Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/appSupport.js

Issue 6305806509146112: Issue 427 - Remove non-standard function and getter syntax (Closed)
Patch Set: Wow sorry for those wrong braces, I am so used to a different style that I didn't even realize what… Created May 18, 2014, 10:51 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « .hgsubstate ('k') | lib/customizableUI.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/appSupport.js
===================================================================
--- a/lib/appSupport.js
+++ b/lib/appSupport.js
@@ -23,17 +23,17 @@ Cu.import("resource://gre/modules/XPCOMU
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/AddonManager.jsm");
/**
* Checks whether an application window is known and should get Adblock Plus
* user interface elements.
* @result Boolean
*/
-exports.isKnownWindow = function isKnownWindow(/**Window*/ window) false;
+exports.isKnownWindow = (/**Window*/ window) => false;
/**
* HACK: In some applications the window finishes initialization during load
* event processing which makes an additional delay necessary. This flag
* indicates that.
* @type Boolean
*/
exports.delayInitialization = false;
@@ -259,17 +259,17 @@ switch (application)
{
case "firefox":
{
exports.isKnownWindow = function ff_isKnownWindow(window)
{
return (window.document.documentElement.getAttribute("windowtype") == "navigator:browser");
};
- exports.getBrowser = function ff_getBrowser(window) window.gBrowser;
+ exports.getBrowser = (window) => window.gBrowser;
exports.addTab = function ff_addTab(window, url, event)
{
if (event)
window.openNewTabWith(url, exports.getBrowser(window).contentDocument, null, event, false);
else
window.gBrowser.loadOneTab(url, {inBackground: false});
};
@@ -391,17 +391,17 @@ switch (application)
exports.isKnownWindow = function tb_isKnownWindow(window)
{
let type = window.document.documentElement.getAttribute("windowtype");
return (type == "mail:3pane" || type == "mail:messageWindow");
};
exports.delayInitialization = true;
- exports.getBrowser = function tb_getBrowser(window) window.getBrowser();
+ exports.getBrowser = (window) => window.getBrowser();
exports.addTab = function tb_addTab(window, url, event)
{
let tabmail = window.document.getElementById("tabmail");
if (!tabmail)
{
let wnd = Services.wm.getMostRecentWindow("mail:3pane");
if (window)
@@ -678,21 +678,21 @@ switch (application)
}
});
break;
}
case "fennec2":
{
- exports.isKnownWindow = function fmn_isKnownWindow(/**Window*/ window) window.document.documentElement.id == "main-window";
+ exports.isKnownWindow = (window) => window.document.documentElement.id == "main-window";
- exports.getBrowser = function fmn_getBrowser(window) window.BrowserApp.selectedBrowser;
+ exports.getBrowser = (window) => window.BrowserApp.selectedBrowser;
- exports.addTab = function fmn_addTab(window, url, event) window.BrowserApp.addTab(url, {selected: true});
+ exports.addTab = (window, url, event) => window.BrowserApp.addTab(url, {selected: true});
let BrowserChangeListener = function(window, callback)
{
this.window = window;
this.callback = callback;
this.onSelect = this.onSelect.bind(this);
this.attach();
};
« no previous file with comments | « .hgsubstate ('k') | lib/customizableUI.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld