// Copyright (c) 2009 by Doug Kearns <dougkearns@gmail.com>
-// Copyright (c) 2009-2012 Kris Maglione <maglione.k at Gmail>
+// Copyright (c) 2009-2013 Kris Maglione <maglione.k at Gmail>
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
before: [
["preferences", { id: branch.substr(Item.PREFIX.length) + "history",
xmlns: "xul" },
- template.map(ourItems(persistent), function (item)
+ template.map(ourItems(persistent), item =>
["preference", { type: "bool", id: branch + item.name, name: branch + item.name }])]
],
init: function init(win) {
let (branch = Item.PREFIX + Item.SHUTDOWN_BRANCH) {
overlay.overlayWindow("chrome://browser/content/preferences/sanitize.xul",
- function (win) prefOverlay(branch, true, {
+ function (win) prefOverlay(branch, true, {
append: {
SanitizeDialogPane:
["groupbox", { orient: "horizontal", xmlns: "xul" },
["column", { flex: "1" }]],
["rows", {},
let (items = ourItems(true))
- template.map(util.range(0, Math.ceil(items.length / 2)), function (i)
+ template.map(util.range(0, Math.ceil(items.length / 2)), i =>
["row", {},
- template.map(items.slice(i * 2, i * 2 + 2), function (item)
+ template.map(items.slice(i * 2, i * 2 + 2), item =>
["checkbox", { xmlns: XUL, label: item.description, preference: branch + item.name }])])]]]
}
}));
itemList: [
["listitem", { xmlns: "xul", label: /*L*/"See :help privacy for the following:",
disabled: "true", style: "font-style: italic; font-weight: bold;" }],
- template.map(ourItems(), function ([item, desc])
+ template.map(ourItems(), ([item, desc]) =>
["listitem", { xmlns: "xul", preference: branch + item,
type: "checkbox", label: config.appName + ", " + desc,
onsyncfrompreference: "return gSanitizePromptDialog.onReadGeneric();" }])
if (!("value" in prop) || !callable(prop.value) && !(k in item))
Object.defineProperty(item, k, prop);
- let names = Set([name].concat(params.contains || []).map(function (e) "clear-" + e));
+ let names = Set([name].concat(params.contains || []).map(e => "clear-" + e));
if (params.action)
storage.addObserver("sanitizer",
function (key, event, arg) {
sanitizer.sanitize(items, range);
}
- if (array.nth(opt.value, function (i) i == "all" || /^!/.test(i), 0) == "all" && !args["-host"])
+ if (array.nth(opt.value, i => i == "all" || /^!/.test(i), 0) == "all" && !args["-host"])
modules.commandline.input(_("sanitize.prompt.deleteAll") + " ",
function (resp) {
if (resp.match(/^y(es)?$/i)) {
names: ["-host", "-h"],
description: "Only sanitize items referring to listed host or hosts",
completer: function (context, args) {
- context.filters.push(function (item)
- !args["-host"].some(function (host) util.isSubdomain(item.text, host)));
+ context.filters.push(item =>
+ !args["-host"].some(host => util.isSubdomain(item.text, host)));
modules.completion.domain(context);
},
type: modules.CommandOption.LIST
completion: function initCompletion(dactyl, modules, window) {
modules.completion.visibleHosts = function completeHosts(context) {
let res = util.visibleHosts(window.content);
- if (context.filter && !res.some(function (host) host.indexOf(context.filter) >= 0))
+ if (context.filter && !res.some(host => host.indexOf(context.filter) >= 0))
res.push(context.filter);
context.title = ["Domain"];
},
has: function has(val)
- let (res = array.nth(this.value, function (v) v == "all" || v.replace(/^!/, "") == val, 0))
+ let (res = array.nth(this.value, v => (v == "all" || v.replace(/^!/, "") == val),
+ 0))
res && !/^!/.test(res),
validator: function (values) values.length &&
- values.every(function (val) val === "all" || Set.has(sanitizer.itemMap, val.replace(/^!/, "")))
+ values.every(val => (val === "all" || Set.has(sanitizer.itemMap, val.replace(/^!/, ""))))
});
options.add(["sanitizeshutdown", "ss"],
],
getter: function () (this.values[prefs.get(this.PREF)] || ["all"])[0],
setter: function (val) {
- prefs.set(this.PREF, this.values.map(function (i) i[0]).indexOf(val));
+ prefs.set(this.PREF, this.values.map(i => i[0]).indexOf(val));
return val;
},
initialValue: true,
],
getter: function () (this.values[prefs.get(this.PREF)] || [prefs.get(this.PREF_DAYS)])[0],
setter: function (value) {
- let val = this.values.map(function (i) i[0]).indexOf(value);
+ let val = this.values.map(i => i[0]).indexOf(value);
if (val > -1)
prefs.set(this.PREF, val);
else {