From 429a2d9d238f1e4b85d5b029b7067080bd21d04e Mon Sep 17 00:00:00 2001 From: Samit Badle Date: Sat, 18 Apr 2015 15:12:33 +0200 Subject: [PATCH] Reformat code, no other change --- ide/main/src/content/selenium-ide-loader.js | 79 +++++++++++---------- 1 file changed, 41 insertions(+), 38 deletions(-) diff --git a/ide/main/src/content/selenium-ide-loader.js b/ide/main/src/content/selenium-ide-loader.js index 3efca6b50007d..8665f624791fc 100644 --- a/ide/main/src/content/selenium-ide-loader.js +++ b/ide/main/src/content/selenium-ide-loader.js @@ -18,50 +18,53 @@ // functions to call IDE from browser window. // -if (!this.SeleniumIDE) this.SeleniumIDE = {}; +if (!this.SeleniumIDE) { + this.SeleniumIDE = {}; +} SeleniumIDE.Loader = {}; -SeleniumIDE.Loader.openRecorder = function() { - toOpenWindowByType('global:selenium-ide','chrome://selenium-ide/content/selenium-ide.xul'); -} +SeleniumIDE.Loader.openRecorder = function () { + toOpenWindowByType('global:selenium-ide', 'chrome://selenium-ide/content/selenium-ide.xul'); +}; -SeleniumIDE.Loader.getTopEditor = function() { - var editors = this.getEditors(); - if (editors.length > 0) { - return editors[0]; - } else { - return null; - } -} +SeleniumIDE.Loader.getTopEditor = function () { + var editors = this.getEditors(); + if (editors.length > 0) { + return editors[0]; + } else { + return null; + } +}; -SeleniumIDE.Loader.getEditors = function() { - var editors = []; +SeleniumIDE.Loader.getEditors = function () { + var editors = []; var editor = this.getSidebarEditor(document); - if (editor) { + if (editor) { editors.push(editor); - } - var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator); - var editorWindow = wm.getMostRecentWindow('global:selenium-ide'); - if (editorWindow && editorWindow.editor) { - editors.push(editorWindow.editor); - } + } + var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator); + var editorWindow = wm.getMostRecentWindow('global:selenium-ide'); + if (editorWindow && editorWindow.editor) { + editors.push(editorWindow.editor); + } var mainWindow = wm.getMostRecentWindow("navigator:browser"); editor = this.getSidebarEditor(mainWindow.document); if (editor) { editors.push(editor); } - return editors; + return editors; }; -SeleniumIDE.Loader.getSidebarEditor = function(doc) { +SeleniumIDE.Loader.getSidebarEditor = function (doc) { if (doc) { var sidebarBox = doc.getElementById('sidebar-box'); if (sidebarBox && !sidebarBox.hidden) { var sidebar = doc.getElementById('sidebar'); try { if (sidebar && sidebar.contentDocument) { - if ("chrome://selenium-ide/content/selenium-ide-sidebar.xul" == sidebar.contentDocument.documentURI) { + if ("chrome://selenium-ide/content/selenium-ide-sidebar.xul" + == sidebar.contentDocument.documentURI) { var sidebarView = sidebar.contentDocument.defaultView; if (sidebarView && sidebarView.editor) { return sidebarView.editor; @@ -74,19 +77,19 @@ SeleniumIDE.Loader.getSidebarEditor = function(doc) { } }; -SeleniumIDE.Loader.reloadRecorder = function(contentWindow, isRootDocument) { - var editors = this.getEditors(); - for (var i = 0; i < editors.length; i++) { - editors[i].loadRecorderFor(contentWindow, isRootDocument); - } -} +SeleniumIDE.Loader.reloadRecorder = function (contentWindow, isRootDocument) { + var editors = this.getEditors(); + for (var i = 0; i < editors.length; i++) { + editors[i].loadRecorderFor(contentWindow, isRootDocument); + } +}; -SeleniumIDE.Loader.notifyUnload = function(doc) { - this.getEditors().forEach(function(editor) { - editor.onUnloadDocument(doc); - }); -} +SeleniumIDE.Loader.notifyUnload = function (doc) { + this.getEditors().forEach(function (editor) { + editor.onUnloadDocument(doc); + }); +}; -SeleniumIDE.Loader.getRecorder = function(window) { - return window._Selenium_IDE_Recorder; -} +SeleniumIDE.Loader.getRecorder = function (window) { + return window._Selenium_IDE_Recorder; +};