Changeset 7118
- Timestamp:
- 07/19/11 09:12:48 (22 months ago)
- Location:
- CKTester/runners/manual
- Files:
-
- 2 edited
-
manual.js (modified) (4 diffs)
-
scripts.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
CKTester/runners/manual/manual.js
r7117 r7118 10 10 centeredX = (screen.width - box.width)/2; 11 11 12 var popup = window.open( 'javascript:void(0)', 'test-scripts-window',12 var popup = window.open( scriptsFrameUrl, 'scripts', 13 13 'height='+ box.height + ',width=' + box.width + 14 ' left='+ centeredX + ',top=' + centeredY +14 ',left='+ centeredX + ',top=' + centeredY + 15 15 ',toolbar=no,directories=no,status=no, menubar = no,scrollbars = no,resizable = no,modal = yes ' ); 16 16 17 17 YAHOO.util.Event.addListener( window, 'unload', function(){ popup.close(); }); 18 18 return popup; … … 32 32 scriptsType = scriptsInput.nodeName.toLowerCase() == 'pre' ? 'tracwiki' : 'html'; 33 33 34 var isPopup = YAHOO.util.Dom.hasClass( scriptsInput, 'popup' ), win; 34 var isPopup = YAHOO.util.Dom.hasClass( scriptsInput, 'popup' ), win, 35 scriptsFrameUrl = CKTESTER.cell.getAbsolutePath( 'runners/manual/scripts.html', true ); 35 36 37 self.frameLoaded = function() 38 { 39 // Load scripts. 40 win.loadScripts( scripts, scriptsType ); 41 scriptsInput.parentNode.removeChild( scriptsInput ); 42 // Start the cell. 43 CKTESTER.cell.start(); 44 45 var Evt = YAHOO.util.Event, complete = function ( data ) { CKTESTER.cell.complete( data ); self.close(); }; 46 47 var doc = win.document; 48 // Receive decisions. 49 Evt.addListener( doc.getElementById( 'pass' ), 'click', function() 50 { 51 complete( { results : { failed : 0 , passed : 1 } } ) 52 } ); 53 Evt.addListener( doc.getElementById( 'fail' ), 'click', function() 54 { 55 complete( { results : { failed : 1 , passed : 0 } } ) 56 } ); 57 }; 58 36 59 if ( isPopup ) 37 60 win = modalWin(); … … 40 63 YAHOO.util.Dom.setStyle( body, 'overflow:hidden' ); 41 64 var temp = document.createElement( 'div' ); 42 temp.innerHTML = '<div id="scripts"><iframe id="scriptsFrame" src=" javascript:void(0)"> </iframe></div>';65 temp.innerHTML = '<div id="scripts"><iframe id="scriptsFrame" src="' + scriptsFrameUrl + '"> </iframe></div>'; 43 66 body.appendChild( temp ); 44 67 win = document.getElementById( 'scriptsFrame' ).contentWindow; … … 49 72 } ); 50 73 } 51 52 YAHOO.util.Event.addListener( win, 'load', function()53 {54 // Load scripts.55 win.loadScripts( scripts, scriptsType );56 scriptsInput.parentNode.removeChild( scriptsInput );57 // Start the cell.58 CKTESTER.cell.start();59 60 var Evt = YAHOO.util.Event,61 complete = function ( data )62 {63 CKTESTER.cell.complete( data );64 self.close();65 };66 67 var doc = win.document;68 // Receive decisions.69 Evt.addListener( doc.getElementById('pass'), 'click', function(){ complete( { results : { failed : 0 , passed : 1 } } ) } );70 Evt.addListener( doc.getElementById('fail'), 'click', function(){ complete( { results : { failed : 1 , passed : 0 } } ) } );71 } );72 73 win.location.href = CKTESTER.cell.getAbsolutePath( 'runners/manual/scripts.html', true );74 74 } ); -
CKTester/runners/manual/scripts.html
r7117 r7118 34 34 ct.html( source ).appendTo( document.body ); 35 35 } 36 37 self.onload = ( opener || parent ).frameLoaded; 36 38 </script> 37 39 </body>
Note: See TracChangeset
for help on using the changeset viewer.
