[Pkg-mozext-commits] [requestpolicy] 04/100: [refactoring] code formatting of arrays and objects
David Prévot
taffit at moszumanska.debian.org
Fri Dec 12 22:56:45 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository requestpolicy.
commit 86659c3b83e8cddfea1bab8887a5e6695ef22354
Author: myrdd <myrdd at users.noreply.github.com>
Date: Fri Sep 12 19:16:23 2014 +0200
[refactoring] code formatting of arrays and objects
---
src/components/requestpolicyService.js | 217 +++++++++++++++++++++------------
src/content/overlay.js | 77 ++++++------
src/content/requestLogTreeView.js | 16 ++-
src/content/settings/advancedprefs.js | 24 +++-
src/content/settings/basicprefs.js | 10 +-
src/content/settings/common.js | 10 +-
src/content/settings/defaultpolicy.js | 16 ++-
src/content/settings/oldrules.js | 12 +-
src/content/settings/setup.js | 24 ++--
src/content/settings/subscriptions.js | 17 ++-
src/content/settings/yourpolicy.js | 17 ++-
src/modules/Policy.jsm | 8 +-
src/modules/PolicyManager.jsm | 23 ++--
src/modules/Subscription.jsm | 11 +-
14 files changed, 322 insertions(+), 160 deletions(-)
diff --git a/src/components/requestpolicyService.js b/src/components/requestpolicyService.js
index 809c1a5..d92ead5 100644
--- a/src/components/requestpolicyService.js
+++ b/src/components/requestpolicyService.js
@@ -41,9 +41,7 @@ Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
// Scope for imported modules.
if (!requestpolicy) {
- var requestpolicy = {
- mod : {}
- };
+ var requestpolicy = {mod : {}};
}
function RequestPolicyService() {
@@ -58,15 +56,13 @@ RequestPolicyService.prototype = {
contractID : "@requestpolicy.com/requestpolicy-service;1",
// For info about the change from app-startup to profile-after-change, see:
// https://developer.mozilla.org/en/XPCOM/XPCOM_changes_in_Gecko_1.9.3
- _xpcom_categories : [{
- category : "app-startup"
- }, {
- category : "profile-after-change"
- }, {
- category : "content-policy"
- }],
- QueryInterface : XPCOMUtils.generateQI([CI.nsIRequestPolicy, CI.nsIObserver,
- CI.nsIContentPolicy]),
+ _xpcom_categories : [
+ {category : "app-startup"},
+ {category : "profile-after-change"},
+ {category : "content-policy"}
+ ],
+ QueryInterface : XPCOMUtils.generateQI(
+ [CI.nsIRequestPolicy, CI.nsIObserver, CI.nsIContentPolicy]),
/* Factory that creates a singleton instance of the component */
_xpcom_factory : {
@@ -244,29 +240,32 @@ RequestPolicyService.prototype = {
case "greasefire at skrul.com" : // Greasefire
requestpolicy.mod.Logger.info(requestpolicy.mod.Logger.TYPE_INTERNAL,
"Using extension compatibility rules for: " + ext.name);
- this._compatibilityRules.push(["file://", "http://userscripts.org/",
- ext.name]);
- this._compatibilityRules.push(["file://",
- "http://static.userscripts.org/", ext.name]);
+ this._compatibilityRules.push(
+ ["file://", "http://userscripts.org/", ext.name]);
+ this._compatibilityRules.push(
+ ["file://", "http://static.userscripts.org/", ext.name]);
break;
case "{0f9daf7e-2ee2-4fcf-9d4f-d43d93963420}" : // Sage-Too
case "{899DF1F8-2F43-4394-8315-37F6744E6319}" : // NewsFox
case "brief at mozdev.org" : // Brief
requestpolicy.mod.Logger.info(requestpolicy.mod.Logger.TYPE_INTERNAL,
"Conflicting extension: " + ext.name);
- this._compatibilityRules.push(["resource://brief-content/", null,
- ext.name]);
+ this._compatibilityRules.push(
+ ["resource://brief-content/", null, ext.name]);
this._conflictingExtensions.push({
- "id" : ext.id,
- "name" : ext.name,
- "version" : ext.version
- });
+ "id" : ext.id,
+ "name" : ext.name,
+ "version" : ext.version
+ });
break;
case "foxmarks at kei.com" : // Xmarks Sync
requestpolicy.mod.Logger.info(requestpolicy.mod.Logger.TYPE_INTERNAL,
"Using extension compatibility rules for: " + ext.name);
- this._compatibilityRules.push(["https://login.xmarks.com/",
- "https://static.xmarks.com/", ext.name]);
+ this._compatibilityRules.push([
+ "https://login.xmarks.com/",
+ "https://static.xmarks.com/",
+ ext.name
+ ]);
break;
case "{203FB6B2-2E1E-4474-863B-4C483ECCE78E}" : // Norton Safe Web Lite
case "{0C55C096-0F1D-4F28-AAA2-85EF591126E7}" : // Norton NIS Toolbar
@@ -279,10 +278,13 @@ RequestPolicyService.prototype = {
case "{c45c406e-ab73-11d8-be73-000a95be3b12}" : // Web Developer
requestpolicy.mod.Logger.info(requestpolicy.mod.Logger.TYPE_INTERNAL,
"Using extension compatibility rules for: " + ext.name);
- this._compatibilityRules.push(["about:blank",
- "http://jigsaw.w3.org/css-validator/validator", ext.name]);
- this._compatibilityRules.push(["about:blank",
- "http://validator.w3.org/check", ext.name]);
+ this._compatibilityRules.push([
+ "about:blank",
+ "http://jigsaw.w3.org/css-validator/validator",
+ ext.name
+ ]);
+ this._compatibilityRules.push(
+ ["about:blank", "http://validator.w3.org/check", ext.name]);
break;
case "{c07d1a49-9894-49ff-a594-38960ede8fb9}" : // Update Scanner
requestpolicy.mod.Logger.info(requestpolicy.mod.Logger.TYPE_INTERNAL,
@@ -294,10 +296,16 @@ RequestPolicyService.prototype = {
case "FirefoxAddon at similarWeb.com" : // SimilarWeb
requestpolicy.mod.Logger.info(requestpolicy.mod.Logger.TYPE_INTERNAL,
"Using extension compatibility rules for: " + ext.name);
- this._compatibilityRules.push(["http://api2.similarsites.com/",
- "http://images2.similargroup.com/", ext.name]);
- this._compatibilityRules.push(["http://www.similarweb.com/",
- "http://go.similarsites.com/", ext.name]);
+ this._compatibilityRules.push([
+ "http://api2.similarsites.com/",
+ "http://images2.similargroup.com/",
+ ext.name
+ ]);
+ this._compatibilityRules.push([
+ "http://www.similarweb.com/",
+ "http://go.similarsites.com/",
+ ext.name
+ ]);
break;
case "{6614d11d-d21d-b211-ae23-815234e1ebb5}" : // Dr. Web Link Checker
requestpolicy.mod.Logger.info(requestpolicy.mod.Logger.TYPE_INTERNAL,
@@ -318,46 +326,71 @@ RequestPolicyService.prototype = {
// applications from the Mozilla community that I'm aware of).
// At least the http url is needed for Firefox updates, adding the https
// one as well to be safe.
- this._compatibilityRules.push(["http://download.mozilla.org/", null,
- appInfo.vendor]);
- this._compatibilityRules.push(["https://download.mozilla.org/", null,
- appInfo.vendor]);
+ this._compatibilityRules.push(
+ ["http://download.mozilla.org/", null, appInfo.vendor]);
+ this._compatibilityRules.push(
+ ["https://download.mozilla.org/", null, appInfo.vendor]);
// There are redirects from 'addons' to 'releases' when installing addons
// from AMO. Adding the origin of 'releases' to be safe in case those
// start redirecting elsewhere at some point.
- this._compatibilityRules.push(["http://addons.mozilla.org/", null,
- appInfo.vendor]);
- this._compatibilityRules.push(["https://addons.mozilla.org/", null,
- appInfo.vendor]);
- this._compatibilityRules.push(["http://releases.mozilla.org/", null,
- appInfo.vendor]);
- this._compatibilityRules.push(["https://releases.mozilla.org/", null,
- appInfo.vendor]);
+ this._compatibilityRules.push(
+ ["http://addons.mozilla.org/", null, appInfo.vendor]);
+ this._compatibilityRules.push(
+ ["https://addons.mozilla.org/", null, appInfo.vendor]);
+ this._compatibilityRules.push(
+ ["http://releases.mozilla.org/", null, appInfo.vendor]);
+ this._compatibilityRules.push(
+ ["https://releases.mozilla.org/", null, appInfo.vendor]);
// Firefox 4 has the about:addons page open an iframe to the mozilla site.
// That opened page grabs content from other mozilla domains.
- this._compatibilityRules.push(["about:addons",
- "https://services.addons.mozilla.org/", appInfo.vendor]);
- this._compatibilityRules.push(["https://services.addons.mozilla.org/",
- "https://static.addons.mozilla.net/", appInfo.vendor]);
- this._compatibilityRules.push(["https://services.addons.mozilla.org/",
- "https://addons.mozilla.org/", appInfo.vendor]);
- this._compatibilityRules.push(["https://services.addons.mozilla.org/",
- "https://www.mozilla.com/", appInfo.vendor]);
- this._compatibilityRules.push(["https://services.addons.mozilla.org/",
- "https://www.getpersonas.com/", appInfo.vendor]);
- this._compatibilityRules.push(["https://services.addons.mozilla.org/",
- "https://static-cdn.addons.mozilla.net/", appInfo.vendor]);
+ this._compatibilityRules.push([
+ "about:addons",
+ "https://services.addons.mozilla.org/",
+ appInfo.vendor
+ ]);
+ this._compatibilityRules.push([
+ "https://services.addons.mozilla.org/",
+ "https://static.addons.mozilla.net/",
+ appInfo.vendor
+ ]);
+ this._compatibilityRules.push([
+ "https://services.addons.mozilla.org/",
+ "https://addons.mozilla.org/",
+ appInfo.vendor]);
+ this._compatibilityRules.push([
+ "https://services.addons.mozilla.org/",
+ "https://www.mozilla.com/",
+ appInfo.vendor
+ ]);
+ this._compatibilityRules.push([
+ "https://services.addons.mozilla.org/",
+ "https://www.getpersonas.com/",
+ appInfo.vendor
+ ]);
+ this._compatibilityRules.push([
+ "https://services.addons.mozilla.org/",
+ "https://static-cdn.addons.mozilla.net/",
+ appInfo.vendor
+ ]);
// Firefox 4 uses an about:home page that is locally stored but can be
// the origin for remote requests. See bug #140 for more info.
this._compatibilityRules.push(["about:home", null, appInfo.vendor]);
// Firefox Sync uses a google captcha.
- this._compatibilityRules.push(["https://auth.services.mozilla.com/",
- "https://api-secure.recaptcha.net/challenge?", appInfo.vendor]);
this._compatibilityRules.push([
- "https://api-secure.recaptcha.net/challenge?",
- "https://www.google.com/recaptcha/api/challenge?", appInfo.vendor]);
- this._compatibilityRules.push(["https://auth.services.mozilla.com/",
- "https://www.google.com/recaptcha/api/", appInfo.vendor]);
+ "https://auth.services.mozilla.com/",
+ "https://api-secure.recaptcha.net/challenge?",
+ appInfo.vendor
+ ]);
+ this._compatibilityRules.push([
+ "https://api-secure.recaptcha.net/challenge?",
+ "https://www.google.com/recaptcha/api/challenge?",
+ appInfo.vendor
+ ]);
+ this._compatibilityRules.push([
+ "https://auth.services.mozilla.com/",
+ "https://www.google.com/recaptcha/api/",
+ appInfo.vendor
+ ]);
// Firefox 13 added links from about:newtab
this._compatibilityRules.push(["about:newtab", null, appInfo.vendor]);
@@ -365,13 +398,19 @@ RequestPolicyService.prototype = {
if (appInfo.ID == "{a463f10c-3994-11da-9945-000d60ca027b}") {
requestpolicy.mod.Logger.info(requestpolicy.mod.Logger.TYPE_INTERNAL,
"Application detected: " + appInfo.vendor);
- this._compatibilityRules.push(["about:myworld", "http://www.flock.com/",
- appInfo.vendor]);
+ this._compatibilityRules.push(
+ ["about:myworld", "http://www.flock.com/", appInfo.vendor]);
this._compatibilityRules.push(["about:flock", null, appInfo.vendor]);
- this._compatibilityRules.push(["http://www.flock.com/rss",
- "http://feeds.feedburner.com/flock", appInfo.vendor]);
- this._compatibilityRules.push(["http://feeds.feedburner.com/",
- "http://www.flock.com/", appInfo.vendor]);
+ this._compatibilityRules.push([
+ "http://www.flock.com/rss",
+ "http://feeds.feedburner.com/flock",
+ appInfo.vendor
+ ]);
+ this._compatibilityRules.push([
+ "http://feeds.feedburner.com/",
+ "http://www.flock.com/",
+ appInfo.vendor
+ ]);
}
// Seamonkey
@@ -413,9 +452,11 @@ RequestPolicyService.prototype = {
}
// Clean up old, unused prefs (removed in 0.2.0).
- deletePrefs = ["temporarilyAllowedOrigins",
- "temporarilyAllowedDestinations",
- "temporarilyAllowedOriginsToDestinations"];
+ deletePrefs = [
+ "temporarilyAllowedOrigins",
+ "temporarilyAllowedDestinations",
+ "temporarilyAllowedOriginsToDestinations"
+ ];
for (var i = 0; i < deletePrefs.length; i++) {
if (this.prefs.prefHasUserValue(deletePrefs[i])) {
this.prefs.clearUserPref(deletePrefs[i]);
@@ -634,9 +675,15 @@ RequestPolicyService.prototype = {
},
_loadLibraries : function() {
- var modules = ["Logger.jsm", "DomainUtil.jsm", "Policy.jsm",
- "PolicyManager.jsm", "RequestUtil.jsm", "Subscription.jsm",
- "Util.jsm"];
+ var modules = [
+ "Logger.jsm",
+ "DomainUtil.jsm",
+ "Policy.jsm",
+ "PolicyManager.jsm",
+ "RequestUtil.jsm",
+ "Subscription.jsm",
+ "Util.jsm"
+ ];
for (var i in modules) {
filename = modules[i];
try {
@@ -1187,8 +1234,10 @@ RequestPolicyService.prototype = {
_allowOriginToDestination : function(originIdentifier, destIdentifier,
noStore) {
- var ruleData = {"o": {"h" : originIdentifier},
- "d": {"h" : destIdentifier}};
+ var ruleData = {
+ "o": {"h" : originIdentifier},
+ "d": {"h" : destIdentifier}
+ };
this._policyMgr.addRule(requestpolicy.mod.RULE_TYPE_ALLOW, ruleData,
noStore);
},
@@ -1205,8 +1254,10 @@ RequestPolicyService.prototype = {
temporarilyAllowOriginToDestination : function temporarilyAllowOriginToDestination(
originIdentifier, destIdentifier) {
- var ruleData = {"o": {"h" : originIdentifier},
- "d": {"h" : destIdentifier}};
+ var ruleData = {
+ "o": {"h" : originIdentifier},
+ "d": {"h" : destIdentifier}
+ };
this._policyMgr.addTemporaryRule(requestpolicy.mod.RULE_TYPE_ALLOW, ruleData);
},
@@ -1959,8 +2010,14 @@ RequestPolicyService.prototype = {
return CP_OK;
}
- var args = [aContentType, dest, origin, aContext, aMimeTypeGuess,
- aExtra];
+ var args = [
+ aContentType,
+ dest,
+ origin,
+ aContext,
+ aMimeTypeGuess,
+ aExtra
+ ];
if (aContext && aContext.nodeName == "LINK" &&
(aContext.rel == "icon" || aContext.rel == "shortcut icon")) {
diff --git a/src/content/overlay.js b/src/content/overlay.js
index 9013182..d12655f 100644
--- a/src/content/overlay.js
+++ b/src/content/overlay.js
@@ -175,8 +175,13 @@ requestpolicy.overlay = {
return;
}
- var toolbars = ["addon-bar", "nav-bar", "toolbar-menubar",
- "PersonalToolbar", "TabsToolbar"];
+ var toolbars = [
+ "addon-bar",
+ "nav-bar",
+ "toolbar-menubar",
+ "PersonalToolbar",
+ "TabsToolbar"
+ ];
for (var i in toolbars) {
var toolbarName = toolbars[i];
if (this._isButtonInToolbar(toolbarName)) {
@@ -426,39 +431,43 @@ requestpolicy.overlay = {
if (notification) {
notification.label = notificationLabel;
} else {
- var buttons = [{
- label : notificationButtonAllow,
- accessKey : notificationButtonAllowKey,
- popup : null,
- callback : function() {
- var location = targetDocument.location;
- // When refreshing a page that wants to redirect, sometimes the
- // targetDocument.location is null. If that's the case, just use
- // do the redirection in the current content pane.
- if (targetDocument.location == null) {
- requestpolicy.mod.Logger
- .dump("in callback: targetDocument.location == null, "
- + "using content.location instead");
- location = content.location;
- }
- // Fx 3.7a5+ calls shouldLoad for location.href changes.
- rpServiceObj.registerAllowedRedirect(location.href,
- redirectTargetUri);
- location.href = redirectTargetUri;
- }
- }, {
- label : notificationButtonDeny,
- accessKey : notificationButtonDenyKey,
- popup : null,
- callback : function() {
- // Do nothing. The notification closes when this is called.
+ var buttons = [
+ {
+ label : notificationButtonAllow,
+ accessKey : notificationButtonAllowKey,
+ popup : null,
+ callback : function() {
+ var location = targetDocument.location;
+ // When refreshing a page that wants to redirect, sometimes the
+ // targetDocument.location is null. If that's the case, just use
+ // do the redirection in the current content pane.
+ if (targetDocument.location == null) {
+ requestpolicy.mod.Logger
+ .dump("in callback: targetDocument.location == null, "
+ + "using content.location instead");
+ location = content.location;
}
-// }, {
-// label : notificationButtonOptions,
-// accessKey : notificationButtonOptionsKey,
-// popup : optionsPopupName,
-// callback : null
- }];
+ // Fx 3.7a5+ calls shouldLoad for location.href changes.
+ rpServiceObj.registerAllowedRedirect(location.href,
+ redirectTargetUri);
+ location.href = redirectTargetUri;
+ }
+ },
+ {
+ label : notificationButtonDeny,
+ accessKey : notificationButtonDenyKey,
+ popup : null,
+ callback : function() {
+ // Do nothing. The notification closes when this is called.
+ }
+// },
+// {
+// label : notificationButtonOptions,
+// accessKey : notificationButtonOptionsKey,
+// popup : optionsPopupName,
+// callback : null
+ }
+ ];
const priority = notificationBox.PRIORITY_WARNING_MEDIUM;
notificationBox.appendNotification(notificationLabel, notificationValue,
"chrome://browser/skin/Info.png", priority, buttons);
diff --git a/src/content/requestLogTreeView.js b/src/content/requestLogTreeView.js
index 40e7b91..9047917 100644
--- a/src/content/requestLogTreeView.js
+++ b/src/content/requestLogTreeView.js
@@ -71,8 +71,12 @@ requestpolicy.requestLogTreeView = {
this._emptyMessageDisplayed = false;
this._treebox.rowCountChanged(0, -1);
}
- this._visibleData.push([originUri, destUri, false,
- (new Date()).toLocaleTimeString()]);
+ this._visibleData.push([
+ originUri,
+ destUri,
+ false,
+ (new Date()).toLocaleTimeString()
+ ]);
if (!this._treebox) {
return;
}
@@ -87,8 +91,12 @@ requestpolicy.requestLogTreeView = {
this._emptyMessageDisplayed = false;
this._treebox.rowCountChanged(0, -1);
}
- this._visibleData.push([originUri, destUri, true,
- (new Date()).toLocaleTimeString()]);
+ this._visibleData.push([
+ originUri,
+ destUri,
+ true,
+ (new Date()).toLocaleTimeString()
+ ]);
if (!this._treebox) {
return;
}
diff --git a/src/content/settings/advancedprefs.js b/src/content/settings/advancedprefs.js
index 4bdd01c..1e72470 100644
--- a/src/content/settings/advancedprefs.js
+++ b/src/content/settings/advancedprefs.js
@@ -1,8 +1,22 @@
-PAGE_STRINGS = ['basic', 'advanced', 'advancedPreferences', 'linkPrefetching',
- 'dnsPrefetching', 'enabled', 'disableOnStartup', 'restoreDefaultOnUninstall',
- 'menuPreferences', 'menuSorting', 'sortByNumRequests', 'sortByDestName', 'noSorting',
- 'hint', 'menuSortingHint',
- 'menuIndicatedInformation', 'menuIndicateNumRequests'];
+PAGE_STRINGS = [
+ 'basic',
+ 'advanced',
+ 'advancedPreferences',
+ 'linkPrefetching',
+ 'dnsPrefetching',
+ 'enabled',
+ 'disableOnStartup',
+ 'restoreDefaultOnUninstall',
+ 'menuPreferences',
+ 'menuSorting',
+ 'sortByNumRequests',
+ 'sortByDestName',
+ 'noSorting',
+ 'hint',
+ 'menuSortingHint',
+ 'menuIndicatedInformation',
+ 'menuIndicateNumRequests'
+];
$(function () {
common.localize(PAGE_STRINGS);
diff --git a/src/content/settings/basicprefs.js b/src/content/settings/basicprefs.js
index 8e72e71..795ccd1 100644
--- a/src/content/settings/basicprefs.js
+++ b/src/content/settings/basicprefs.js
@@ -1,5 +1,11 @@
-PAGE_STRINGS = ['basic', 'advanced', 'webPages', 'indicateBlockedImages',
- 'menu', 'allowAddingNonTemporaryRulesInPBM'];
+PAGE_STRINGS = [
+ 'basic',
+ 'advanced',
+ 'webPages',
+ 'indicateBlockedImages',
+ 'menu',
+ 'allowAddingNonTemporaryRulesInPBM'
+];
$(function () {
common.localize(PAGE_STRINGS);
diff --git a/src/content/settings/common.js b/src/content/settings/common.js
index c74f1e6..6357fd3 100644
--- a/src/content/settings/common.js
+++ b/src/content/settings/common.js
@@ -15,8 +15,14 @@ var stringBundleService = Components.classes["@mozilla.org/intl/stringbundle;1"]
strbundle = stringBundleService.createBundle(
"chrome://requestpolicy/locale/requestpolicy.properties");
-const COMMON_STRINGS = ['preferences', 'managePolicies', 'about', 'help',
- 'basic', 'advanced'];
+const COMMON_STRINGS = [
+ 'preferences',
+ 'managePolicies',
+ 'about',
+ 'help',
+ 'basic',
+ 'advanced'
+];
function _(msg, args) {
diff --git a/src/content/settings/defaultpolicy.js b/src/content/settings/defaultpolicy.js
index 22e6f31..c4cff00 100644
--- a/src/content/settings/defaultpolicy.js
+++ b/src/content/settings/defaultpolicy.js
@@ -1,7 +1,15 @@
-PAGE_STRINGS = ['yourPolicy', 'defaultPolicy', 'subscriptions',
- 'allowRequestsByDefault', 'blockRequestsByDefault',
- 'defaultPolicyDefinition', 'learnMore', 'allowRequestsToTheSameDomain',
- 'differentSubscriptionsAreAvailable', 'manageSubscriptions'];
+PAGE_STRINGS = [
+ 'yourPolicy',
+ 'defaultPolicy',
+ 'subscriptions',
+ 'allowRequestsByDefault',
+ 'blockRequestsByDefault',
+ 'defaultPolicyDefinition',
+ 'learnMore',
+ 'allowRequestsToTheSameDomain',
+ 'differentSubscriptionsAreAvailable',
+ 'manageSubscriptions'
+];
$(function () {
common.localize(PAGE_STRINGS);
diff --git a/src/content/settings/oldrules.js b/src/content/settings/oldrules.js
index bef06bf..ad1ecc4 100644
--- a/src/content/settings/oldrules.js
+++ b/src/content/settings/oldrules.js
@@ -1,6 +1,12 @@
-PAGE_STRINGS = ['importOldRules', 'deleteOldRules',
- 'showOldRuleReimportOptions', 'yourOldRulesHaveBeenDeleted', 'type',
- 'origin', 'destination'];
+PAGE_STRINGS = [
+ 'importOldRules',
+ 'deleteOldRules',
+ 'showOldRuleReimportOptions',
+ 'yourOldRulesHaveBeenDeleted',
+ 'type',
+ 'origin',
+ 'destination'
+];
$(function () {
common.localize(PAGE_STRINGS);
diff --git a/src/content/settings/setup.js b/src/content/settings/setup.js
index 0b39f85..b2ba71c 100644
--- a/src/content/settings/setup.js
+++ b/src/content/settings/setup.js
@@ -1,10 +1,20 @@
-PAGE_STRINGS = ['welcomeToRequestPolicy', 'forMostUsersDefaultsAreIdeal',
- 'youCanConfigureRequestPolicyToBeMoreStrict', 'teachMeHowToUseRequestPolicy',
- 'returnToBrowsing', 'configureRequestPolicy', 'defaultPolicy',
- 'defaultPolicyDefinition', 'allowRequestsByDefault', 'blockRequestsByDefault',
- 'allowRequestsToTheSameDomain', 'subscriptionPolicies',
- 'subscriptionPoliciesDefinition', 'yesUseSubscriptions',
- 'noDoNotUseSubscriptions'];
+PAGE_STRINGS = [
+ 'welcomeToRequestPolicy',
+ 'forMostUsersDefaultsAreIdeal',
+ 'youCanConfigureRequestPolicyToBeMoreStrict',
+ 'teachMeHowToUseRequestPolicy',
+ 'returnToBrowsing',
+ 'configureRequestPolicy',
+ 'defaultPolicy',
+ 'defaultPolicyDefinition',
+ 'allowRequestsByDefault',
+ 'blockRequestsByDefault',
+ 'allowRequestsToTheSameDomain',
+ 'subscriptionPolicies',
+ 'subscriptionPoliciesDefinition',
+ 'yesUseSubscriptions',
+ 'noDoNotUseSubscriptions'
+];
$(function () {
common.localize(PAGE_STRINGS);
diff --git a/src/content/settings/subscriptions.js b/src/content/settings/subscriptions.js
index 37b669e..0b27c15 100644
--- a/src/content/settings/subscriptions.js
+++ b/src/content/settings/subscriptions.js
@@ -1,11 +1,20 @@
-PAGE_STRINGS = ['yourPolicy', 'defaultPolicy', 'subscriptions', 'learnMore',
- 'subscriptionPolicies', 'subscriptionPoliciesDefinition', 'usability',
- 'privacy', 'browser', 'subscriptionDenyTrackersDescription',
+PAGE_STRINGS = [
+ 'yourPolicy',
+ 'defaultPolicy',
+ 'subscriptions',
+ 'learnMore',
+ 'subscriptionPolicies',
+ 'subscriptionPoliciesDefinition',
+ 'usability',
+ 'privacy',
+ 'browser',
+ 'subscriptionDenyTrackersDescription',
'subscriptionAllowSameOrgDescription',
'subscriptionAllowFunctionalityDescription',
'subscriptionAllowEmbeddedDescription',
'subscriptionAllowMozillaDescription',
- 'subscriptionAllowExtensionsDescription'];
+ 'subscriptionAllowExtensionsDescription'
+];
$(function () {
common.localize(PAGE_STRINGS);
diff --git a/src/content/settings/yourpolicy.js b/src/content/settings/yourpolicy.js
index 3b768a2..e9e7564 100644
--- a/src/content/settings/yourpolicy.js
+++ b/src/content/settings/yourpolicy.js
@@ -1,6 +1,17 @@
-PAGE_STRINGS = ['yourPolicy', 'defaultPolicy', 'subscriptions', 'type',
- 'origin', 'destination', 'allow', 'block', 'temporary', 'addRule',
- 'learnMoreAboutRules', 'removeOldRules'];
+PAGE_STRINGS = [
+ 'yourPolicy',
+ 'defaultPolicy',
+ 'subscriptions',
+ 'type',
+ 'origin',
+ 'destination',
+ 'allow',
+ 'block',
+ 'temporary',
+ 'addRule',
+ 'learnMoreAboutRules',
+ 'removeOldRules'
+];
$(function () {
common.localize(PAGE_STRINGS);
diff --git a/src/modules/Policy.jsm b/src/modules/Policy.jsm
index 68aa6cb..b53a935 100644
--- a/src/modules/Policy.jsm
+++ b/src/modules/Policy.jsm
@@ -20,8 +20,12 @@
* ***** END LICENSE BLOCK *****
*/
-var EXPORTED_SYMBOLS = ["Policy", "RawPolicy", "RULE_TYPE_ALLOW",
- "RULE_TYPE_DENY"];
+var EXPORTED_SYMBOLS = [
+ "Policy",
+ "RawPolicy",
+ "RULE_TYPE_ALLOW",
+ "RULE_TYPE_DENY"
+];
if (!requestpolicy) {
var requestpolicy = {
diff --git a/src/modules/PolicyManager.jsm b/src/modules/PolicyManager.jsm
index a0d620f..4adb670 100644
--- a/src/modules/PolicyManager.jsm
+++ b/src/modules/PolicyManager.jsm
@@ -20,7 +20,10 @@
* ***** END LICENSE BLOCK *****
*/
-var EXPORTED_SYMBOLS = ["PolicyManager", "RequestResult", "Destination",
+var EXPORTED_SYMBOLS = [
+ "PolicyManager",
+ "RequestResult",
+ "Destination",
"REQUEST_TYPE_NORMAL",
"REQUEST_TYPE_REDIRECT",
"REQUEST_REASON_USER_POLICY",
@@ -294,8 +297,10 @@ PolicyManager.prototype = {
// we'll assume this is a new install.
rawPolicy = new requestpolicy.mod.RawPolicy();
}
- this._userPolicies["user"] = {"rawPolicy" : rawPolicy,
- "policy" : rawPolicy.toPolicy("user")};
+ this._userPolicies["user"] = {
+ "rawPolicy" : rawPolicy,
+ "policy" : rawPolicy.toPolicy("user")
+ };
this._userPolicies["user"]["policy"].userPolicy = true;
this._userPolicies["user"].policy.print();
// Temporary rules. These are never stored.
@@ -326,8 +331,10 @@ PolicyManager.prototype = {
this._subscriptionPolicies[listName] = {};
}
var list = this._subscriptionPolicies[listName];
- list[subName] = {"rawPolicy" : rawPolicy,
- "policy" : rawPolicy.toPolicy(subName)};
+ list[subName] = {
+ "rawPolicy" : rawPolicy,
+ "policy" : rawPolicy.toPolicy(subName)
+ };
list[subName]["policy"].userPolicy = false;
list[subName].policy.print();
}
@@ -460,8 +467,10 @@ PolicyManager.prototype = {
resetTemporaryPolicy : function() {
var rawPolicy = new requestpolicy.mod.RawPolicy();
- this._userPolicies["temp"] = {"rawPolicy" : rawPolicy,
- "policy" : rawPolicy.toPolicy("temp")};
+ this._userPolicies["temp"] = {
+ "rawPolicy" : rawPolicy,
+ "policy" : rawPolicy.toPolicy("temp")
+ };
this._userPolicies["temp"]["policy"].userPolicy = true;
},
diff --git a/src/modules/Subscription.jsm b/src/modules/Subscription.jsm
index 14f003d..f030ba9 100644
--- a/src/modules/Subscription.jsm
+++ b/src/modules/Subscription.jsm
@@ -20,9 +20,14 @@
* ***** END LICENSE BLOCK *****
*/
-var EXPORTED_SYMBOLS = ["UserSubscriptions", "SubscriptionList", "Subscription",
- "SUBSCRIPTION_UPDATED_TOPIC", "SUBSCRIPTION_ADDED_TOPIC",
- "SUBSCRIPTION_REMOVED_TOPIC"];
+var EXPORTED_SYMBOLS = [
+ "UserSubscriptions",
+ "SubscriptionList",
+ "Subscription",
+ "SUBSCRIPTION_UPDATED_TOPIC",
+ "SUBSCRIPTION_ADDED_TOPIC",
+ "SUBSCRIPTION_REMOVED_TOPIC"
+];
Components.utils.import("resource://requestpolicy/FileUtil.jsm");
Components.utils.import("resource://requestpolicy/Logger.jsm");
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/requestpolicy.git
More information about the Pkg-mozext-commits
mailing list