Added pending page

master
Mike Gerwitz 2012-03-03 23:33:16 -05:00
parent e200ab3e82
commit 7a8356d2a6
4 changed files with 86 additions and 37 deletions

View File

@ -1,4 +1,3 @@
/**
* Facade for the entire application
*/
@ -56,27 +55,39 @@ rectest.RecTest = Class( 'RecTest',
},
'bindContinue': function( $element, callback )
'public goConfig': function()
{
var _self = this,
$body = this._jQuery( 'body' );
this._jQuery( 'body' )
.removeClass( 'pending' )
.removeClass( 'testing' )
;
$element.click( function()
return this;
},
'public goVerify': function()
{
this._jQuery( 'body' ).addClass( 'pending' );
return this;
},
'public run': function()
{
var _self = this,
$body = this._jQuery( 'body' ),
options = this._getOptions(),
testcase = this._cases[ options['case'] ].testCase();
$body.addClass( 'testing' ).removeClass( 'pending' );
this._runner.run( testcase, options, function( history )
{
var options = _self._getOptions(),
testcase = _self._cases[ options['case'] ].testCase();
_self.goConfig();
$body.addClass( 'testing' );
_self._runner.run( testcase, options, function( history )
{
$body.removeClass( 'testing' );
console.log( history );
console.log( 'done' );
} );
callback && callback.call( _self.__inst );
console.log( history );
console.log( 'done' );
} );
return this;

View File

@ -7,8 +7,22 @@ window.rectest = { cases: {} };
$( document ).ready( function()
{
rectest.RecTest( jQuery, rectest.cases ).init()
var app = rectest.RecTest( jQuery, rectest.cases ).init()
.listCases( $( '#case' ) )
.bindContinue( $( '#continue' ) )
;
$( '#continue' ).click( function()
{
app.goVerify();
} );
$( '#reconfigure' ).click( function()
{
app.goConfig();
} );
$( '#run' ).click( function()
{
app.run();
} );
} );

View File

@ -24,16 +24,6 @@ dd {
display: block;
}
.testing .while-idle {
display: none;
}
.while-testing {
display: none;
}
.testing .while-testing {
display: block;
}
.topbox {
position: absolute;
@ -113,3 +103,21 @@ dd {
width: 300px;
height: 300px;
}
/** after everything else to ensure it takes precidence **/
.pending .while-idle,
.testing .while-idle {
display: none;
}
.while-pending,
.while-testing {
display: none;
}
.pending .while-pending,
.testing .while-testing {
display: block;
}
.testing .until-testing {
display: none;
}

View File

@ -5,7 +5,7 @@
<link rel="stylesheet" href="style.css" />
</head>
<body>
<h1 class="while-idle">Recollection Test</h1>
<h1 class="until-testing">Recollection Test</h1>
<noscript>
<p>It appears that you have JavaScript disabled. Please consult your
browser's documentation to enable it before continuing. Don't worry - it
@ -17,11 +17,6 @@
Please wait while we get our act together... (Loading)
</div>
<!-- holds notices -->
<div class="hasjs topbox notice while-idle">
Please configure the test using the form below.
</div>
<!-- status (while testing) -->
<div class="statusbar-area while-testing">
<div class="statusbar">
@ -29,6 +24,11 @@
</div>
</div>
<!-- configure -->
<div class="hasjs topbox notice while-idle">
Please configure the test using the form below.
</div>
<div class="hasjs config while-idle">
<h2 class="title">Test Setup</h2>
@ -62,10 +62,26 @@
<dd><input type="number" id="delay" value="5.0" /> seconds</dd>
</dl>
<button id="continue" class="action">Continue</button>
<button id="continue" class="action">Continue &raquo;</button>
<br clear="both" />
</div>
<!-- pending -->
<div class="topbox notice while-pending">
Test configured. Click "Begin Test" to continue, or "Reconfigure" to alter
the configuration.
</div>
<div class="while-pending">
<p>To share this configuration with others, please use the following URL:
(TODO)
</p>
<div>
<button id="reconfigure">&laquo; Reconfigure</button>
<button id="run">Begin Test &raquo;</button>
</div>
</div>
<script type="text/javascript" src="scripts/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="scripts/ease.min.js"></script>
<script type="text/javascript" src="scripts/main.js"></script>