diff options
author | Kris Maglione <maglione.k@gmail.com> | 2010-09-28 10:39:40 -0400 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2010-09-28 10:39:40 -0400 |
commit | 017258955b70a3e72f19c34482c94cd3624d0990 (patch) | |
tree | 4dd7a59f4ec437d8a1e21842cd940fede0f709c0 /common | |
parent | d6aa3d5ef0c066a26d3f3d65ff3bbe4dda57bbd6 (diff) | |
download | pentadactyl-017258955b70a3e72f19c34482c94cd3624d0990.tar.gz |
Add bookmarks, diverted, links to 'activate'.
Diffstat (limited to 'common')
-rw-r--r-- | common/content/options.js | 6 | ||||
-rw-r--r-- | common/content/tabs.js | 35 | ||||
-rw-r--r-- | common/locale/en-US/options.xml | 3 |
3 files changed, 31 insertions, 13 deletions
diff --git a/common/content/options.js b/common/content/options.js index b6d62cd3..619a9cb0 100644 --- a/common/content/options.js +++ b/common/content/options.js @@ -847,8 +847,10 @@ const Options = Module("options", { return this._loadPreference(name, forcedDefault); }, - _checkPrefSafe: function (name, message) { + _checkPrefSafe: function (name, message, value) { let curval = this._loadPreference(name, null, false); + if (arguments.length > 2 && curval === value) + return; let defval = this._loadPreference(name, null, true); let saved = this._loadPreference(Options.SAVED + name); @@ -881,7 +883,7 @@ const Options = Module("options", { * @param {value} value The new preference value. */ safeSetPref: function (name, value, message) { - this._checkPrefSafe(name, message); + this._checkPrefSafe(name, message, value); this._storePreference(name, value); this._storePreference(Options.SAVED + name, value); }, diff --git a/common/content/tabs.js b/common/content/tabs.js index 86d31641..98cd0335 100644 --- a/common/content/tabs.js +++ b/common/content/tabs.js @@ -1014,20 +1014,33 @@ const Tabs = Module("tabs", { }); if (config.hasTabbrowser) { + let activateGroups = [ + ["addons", ":addo[ns] command"], + ["bookmarks", "Tabs loaded from bookmarks", "loadBookmarksInBackground"], + ["diverted", "Links with targets set to new tabs", "loadDivertedInBackground"], + ["downloads", ":downl[oads] command"], + ["extoptions", ":exto[ptions] command"], + ["help", ":h[elp] command"], + ["homepage", "gH mapping"], + ["links", "Middle- or Control-clicked links", "loadInBackground"], + ["quickmark", "go and gn mappings"], + ["tabopen", ":tabopen[!] command"], + ["paste", "P and gP mappings"] + ]; options.add(["activate", "act"], "Define when tabs are automatically activated", - "stringlist", "addons,downloads,extoptions,help,homepage,quickmark,tabopen,paste", + "stringlist", [g[0] for (g in values(activateGroups)) if (!g[2] || !options.getPref("browser.tabs." + g[2]))].join(","), { - completer: function (context) [ - ["addons", ":addo[ns] command"], - ["downloads", ":downl[oads] command"], - ["extoptions", ":exto[ptions] command"], - ["help", ":h[elp] command"], - ["homepage", "gH mapping"], - ["quickmark", "go and gn mappings"], - ["tabopen", ":tabopen[!] command"], - ["paste", "P and gP mappings"] - ] + completer: function (context) activateGroups, + setter: function (newValues) { + let valueSet = set(newValues); + for (let group in values(activateGroups)) + if (group[2]) + options.safeSetPref("browser.tabs." + group[2], + !(valueSet["all"] || valueSet[group[0]]), + "See the 'activate' option"); + return newValues; + } }); options.add(["newtab"], diff --git a/common/locale/en-US/options.xml b/common/locale/en-US/options.xml index fa667110..c27aab9b 100644 --- a/common/locale/en-US/options.xml +++ b/common/locale/en-US/options.xml @@ -330,10 +330,13 @@ <dl> <dt>all</dt> <dd>Activate all items.</dd> <dt>addons</dt> <dd><ex>:addo<oa>ns</oa></ex> command</dd> + <dt>bookmarks</dt> <dd>Tabs loaded from bookmarks</dd> + <dt>diverted</dt> <dd>Links with targets set to new tabs</dd> <dt>downloads</dt> <dd><ex>:downl<oa>oads</oa></ex> command</dd> <dt>extoptions</dt> <dd><ex>:exto<oa>ptions</oa></ex> command</dd> <dt>help</dt> <dd><ex>:h<oa>elp</oa></ex> command</dd> <dt>homepage</dt> <dd><k>gH</k> mapping</dd> + <dt>links</dt> <dd>Middle- or Control-clicked links</dd> <dt>quickmark</dt> <dd><k>go</k> and <k>gn</k> mappings</dd> <dt>tabopen</dt> <dd><ex>:tabopen<oa>!</oa></ex> command</dd> <dt>paste</dt> <dd><k>P</k> and <k>gP</k> mappings</dd> |