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

Unified Diff: lib/prefs.js

Issue 6648246944399360: Noissue - Document the prefs module (Closed)
Patch Set: Created April 15, 2015, 4 p.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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/prefs.js
===================================================================
--- a/lib/prefs.js
+++ b/lib/prefs.js
@@ -15,35 +15,152 @@
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
+/** @module prefs */
+
const keyPrefix = "pref:";
+/** @lends module:prefs.Prefs */
let defaults = Object.create(null);
let overrides = Object.create(null);
+/**
+ * Only for compatibility with core code. Please do not change!
+ *
+ * @type {boolean}
+ */
defaults.enabled = true;
+/**
+ * The application version as set during intilization. Used to detect updates.
kzar 2015/04/16 12:11:14 Nit: initialization
kzar 2015/04/16 13:32:34 What about these comments?
Sebastian Noack 2015/04/16 13:47:06 I didn't addressed them yet, or do you read "Done"
kzar 2015/04/16 13:48:55 You quite commonly say "What about this comment" o
Sebastian Noack 2015/04/16 13:51:43 Done.
Sebastian Noack 2015/04/16 13:51:43 Only if you uploaded a new patch set, and I have r
kzar 2015/04/16 13:54:50 You had uploaded a new patch set though...
Sebastian Noack 2015/04/16 13:57:02 ... before you published your comments. ;)
+ *
+ * @type {string}
+ */
defaults.currentVersion = "";
+/**
+ * Only for compatibility with core code. Please do not change!
kzar 2015/04/16 12:11:14 It would be nice to add a little detail for all th
Sebastian Noack 2015/04/16 12:52:00 Those are already documented under https://adblock
kzar 2015/04/16 13:32:34 Fair enough but in that case how about adding a "@
Sebastian Noack 2015/04/16 13:47:06 I do for preferences that have an effect here. But
+ *
+ * @type {string}
+ */
defaults.data_directory = "";
+/**
+ * @see https://adblockplus.org/en/preferences#patternsbackups
+ * @type {number}
+ */
defaults.patternsbackups = 5;
+/**
+ * @see https://adblockplus.org/en/preferences#patternsbackupinterval
+ * @type {number}
+ */
defaults.patternsbackupinterval = 24;
+/**
+ * Only for compatibility with core code. Please do not change!
+ *
+ * @type {boolean}
+ */
defaults.savestats = false;
+/**
+ * Only for compatibility with core code. Please do not change!
+ *
+ * @type {boolean}
+ */
defaults.privateBrowsing = false;
+/**
+ * @see https://adblockplus.org/en/preferences#subscriptions_fallbackerrors
+ * @type {number}
+ */
defaults.subscriptions_fallbackerrors = 5;
+/**
+ * @see https://adblockplus.org/en/preferences#subscriptions_fallbackurl
+ * @type {string}
+ */
defaults.subscriptions_fallbackurl = "https://adblockplus.org/getSubscription?version=%VERSION%&url=%SUBSCRIPTION%&downloadURL=%URL%&error=%ERROR%&channelStatus=%CHANNELSTATUS%&responseStatus=%RESPONSESTATUS%";
+/**
+ * @see https://adblockplus.org/en/preferences#subscriptions_autoupdate
+ * @type {boolean}
+ */
defaults.subscriptions_autoupdate = true;
+/**
+ * @see https://adblockplus.org/en/preferences#subscriptions_exceptionsurl
+ * @type {string}
+ */
defaults.subscriptions_exceptionsurl = "https://easylist-downloads.adblockplus.org/exceptionrules.txt";
+/**
+ * @see https://adblockplus.org/en/preferences#subscriptions_antiadblockurl
+ * @type {string}
+ */
defaults.subscriptions_antiadblockurl = "https://easylist-downloads.adblockplus.org/antiadblockfilters.txt";
+/**
+ * @see https://adblockplus.org/en/preferences#documentation_link
+ * @type {string}
+ */
defaults.documentation_link = "https://adblockplus.org/redirect?link=%LINK%&lang=%LANG%";
+/**
+ * @see https://adblockplus.org/en/preferences#notificationdata
+ * @type {object}
+ */
defaults.notificationdata = {};
+/**
+ * @see https://adblockplus.org/en/preferences#notificationurl
+ * @type {string}
+ */
defaults.notificationurl = "https://notification.adblockplus.org/notification.json";
+/**
+ * The total number of ads blocked on all pages.
+ *
+ * @type {object}
+ * @property {number} [blocked]
+ */
defaults.stats_total = {};
+/**
+ * Whether to show a badge in the toolbar icon indicating the number of blocked ads.
+ *
+ * @type {boolean}
+ */
defaults.show_statsinicon = true;
+/**
+ * Whether to show the number of blocked ads in the popup.
+ *
+ * @type {boolean}
+ */
defaults.show_statsinpopup = true;
+/**
+ * Whether to show the "Block element" context menu entry.
+ *
+ * @type {boolean}
+ */
defaults.shouldShowBlockElementMenu = true;
+/**
+ * Whether to collapse placeholders for blocked elements.
+ *
+ * @type {boolean}
+ */
defaults.hidePlaceholders = true;
+/**
+ * Whether to show the first run page. This preference isn't
+ * set by the extension but can be pre-configured externally.
+ *
+ * @type {boolean}
+ */
defaults.suppress_first_run_page = false;
+/**
+ * @namespace
+ * @static
+ */
let Prefs = exports.Prefs = {
+ /**
+ * Fired when the value of a preference changes.
+ *
+ * @event
+ * @property {string} pref The name of the preference that changed.
+ */
onChanged: new ext._EventTarget(),
+
+ /**
+ * Fired when all preferences have been loaded. You must wait for
+ * this event before using preferences during extension intilization.
kzar 2015/04/16 12:11:14 Nit: initialization
Sebastian Noack 2015/04/16 13:51:43 Done.
+ *
+ * @event
+ */
onLoaded: new ext._EventTarget()
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld