18
18
// functions to call IDE from browser window.
19
19
//
20
20
21
- if ( ! this . SeleniumIDE ) this . SeleniumIDE = { } ;
21
+ if ( ! this . SeleniumIDE ) {
22
+ this . SeleniumIDE = { } ;
23
+ }
22
24
23
25
SeleniumIDE . Loader = { } ;
24
26
25
- SeleniumIDE . Loader . openRecorder = function ( ) {
26
- toOpenWindowByType ( 'global:selenium-ide' , 'chrome://selenium-ide/content/selenium-ide.xul' ) ;
27
- }
27
+ SeleniumIDE . Loader . openRecorder = function ( ) {
28
+ toOpenWindowByType ( 'global:selenium-ide' , 'chrome://selenium-ide/content/selenium-ide.xul' ) ;
29
+ } ;
28
30
29
- SeleniumIDE . Loader . getTopEditor = function ( ) {
30
- var editors = this . getEditors ( ) ;
31
- if ( editors . length > 0 ) {
32
- return editors [ 0 ] ;
33
- } else {
34
- return null ;
35
- }
36
- }
31
+ SeleniumIDE . Loader . getTopEditor = function ( ) {
32
+ var editors = this . getEditors ( ) ;
33
+ if ( editors . length > 0 ) {
34
+ return editors [ 0 ] ;
35
+ } else {
36
+ return null ;
37
+ }
38
+ } ;
37
39
38
- SeleniumIDE . Loader . getEditors = function ( ) {
39
- var editors = [ ] ;
40
+ SeleniumIDE . Loader . getEditors = function ( ) {
41
+ var editors = [ ] ;
40
42
var editor = this . getSidebarEditor ( document ) ;
41
- if ( editor ) {
43
+ if ( editor ) {
42
44
editors . push ( editor ) ;
43
- }
44
- var wm = Components . classes [ "@mozilla.org/appshell/window-mediator;1" ] . getService ( Components . interfaces . nsIWindowMediator ) ;
45
- var editorWindow = wm . getMostRecentWindow ( 'global:selenium-ide' ) ;
46
- if ( editorWindow && editorWindow . editor ) {
47
- editors . push ( editorWindow . editor ) ;
48
- }
45
+ }
46
+ var wm = Components . classes [ "@mozilla.org/appshell/window-mediator;1" ] . getService ( Components . interfaces . nsIWindowMediator ) ;
47
+ var editorWindow = wm . getMostRecentWindow ( 'global:selenium-ide' ) ;
48
+ if ( editorWindow && editorWindow . editor ) {
49
+ editors . push ( editorWindow . editor ) ;
50
+ }
49
51
var mainWindow = wm . getMostRecentWindow ( "navigator:browser" ) ;
50
52
editor = this . getSidebarEditor ( mainWindow . document ) ;
51
53
if ( editor ) {
52
54
editors . push ( editor ) ;
53
55
}
54
- return editors ;
56
+ return editors ;
55
57
} ;
56
58
57
- SeleniumIDE . Loader . getSidebarEditor = function ( doc ) {
59
+ SeleniumIDE . Loader . getSidebarEditor = function ( doc ) {
58
60
if ( doc ) {
59
61
var sidebarBox = doc . getElementById ( 'sidebar-box' ) ;
60
62
if ( sidebarBox && ! sidebarBox . hidden ) {
61
63
var sidebar = doc . getElementById ( 'sidebar' ) ;
62
64
try {
63
65
if ( sidebar && sidebar . contentDocument ) {
64
- if ( "chrome://selenium-ide/content/selenium-ide-sidebar.xul" == sidebar . contentDocument . documentURI ) {
66
+ if ( "chrome://selenium-ide/content/selenium-ide-sidebar.xul"
67
+ == sidebar . contentDocument . documentURI ) {
65
68
var sidebarView = sidebar . contentDocument . defaultView ;
66
69
if ( sidebarView && sidebarView . editor ) {
67
70
return sidebarView . editor ;
@@ -74,19 +77,19 @@ SeleniumIDE.Loader.getSidebarEditor = function(doc) {
74
77
}
75
78
} ;
76
79
77
- SeleniumIDE . Loader . reloadRecorder = function ( contentWindow , isRootDocument ) {
78
- var editors = this . getEditors ( ) ;
79
- for ( var i = 0 ; i < editors . length ; i ++ ) {
80
- editors [ i ] . loadRecorderFor ( contentWindow , isRootDocument ) ;
81
- }
82
- }
80
+ SeleniumIDE . Loader . reloadRecorder = function ( contentWindow , isRootDocument ) {
81
+ var editors = this . getEditors ( ) ;
82
+ for ( var i = 0 ; i < editors . length ; i ++ ) {
83
+ editors [ i ] . loadRecorderFor ( contentWindow , isRootDocument ) ;
84
+ }
85
+ } ;
83
86
84
- SeleniumIDE . Loader . notifyUnload = function ( doc ) {
85
- this . getEditors ( ) . forEach ( function ( editor ) {
86
- editor . onUnloadDocument ( doc ) ;
87
- } ) ;
88
- }
87
+ SeleniumIDE . Loader . notifyUnload = function ( doc ) {
88
+ this . getEditors ( ) . forEach ( function ( editor ) {
89
+ editor . onUnloadDocument ( doc ) ;
90
+ } ) ;
91
+ } ;
89
92
90
- SeleniumIDE . Loader . getRecorder = function ( window ) {
91
- return window . _Selenium_IDE_Recorder ;
92
- }
93
+ SeleniumIDE . Loader . getRecorder = function ( window ) {
94
+ return window . _Selenium_IDE_Recorder ;
95
+ } ;
0 commit comments