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 @@
all
Activate all items.
addons
:addons command
+
bookmarks
Tabs loaded from bookmarks
+
diverted
Links with targets set to new tabs
downloads
:downloads command
extoptions
:extoptions command
help
:help command
homepage
gH mapping
+
links
Middle- or Control-clicked links
quickmark
go and gn mappings
tabopen
:tabopen! command
paste
P and gP mappings
diff --git a/pentadactyl/NEWS b/pentadactyl/NEWS index a64e43a1..8197607b 100644 --- a/pentadactyl/NEWS +++ b/pentadactyl/NEWS @@ -42,6 +42,8 @@ * IMPORTANT: 'extendedhinttags' is now a regexmap rather than a string. * IMPORTANT: 'guioptions' default value has changed. + * Added "bookmarks", "diverted", and "links" to 'activate' + option * Added 'altwildmode' and command-line key binding. * Added 'autocomplete' option for specifying which completion groups should be auto-completed. diff --git a/pentadactyl/TODO b/pentadactyl/TODO index 98c0aeaf..8e269be7 100644 --- a/pentadactyl/TODO +++ b/pentadactyl/TODO @@ -35,14 +35,6 @@ FEATURES: :open foo 8 use the storage module for autocommands 8 support 'activate' in buffer.followLink? - Leave this to the bookmarks.tabs.loadInBackground. Hint activation - should be nearly equivalent to the corresponding mouse motion, and that - mouse movement would be governed by the FF pref. However, :tabopen is - something Vimp specific, and so it needs a specific setting (i.e., - activate). OTOH, I think it would be better if ";t" *always* opens a - new foreground tab and ";b" *always* opensa new background tab. So "F" - should be the only hint mode that changes based on loadInBackground. - --Ted 8 add support for filename special characters such as % 8 :redir and 'verbosefile' 8 middleclick in content == p, and if command line is open, paste there the clipboard buffer