mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 11:17:58 +01:00
Add bookmarks, diverted, links to 'activate'.
This commit is contained in:
@@ -847,8 +847,10 @@ const Options = Module("options", {
|
|||||||
return this._loadPreference(name, forcedDefault);
|
return this._loadPreference(name, forcedDefault);
|
||||||
},
|
},
|
||||||
|
|
||||||
_checkPrefSafe: function (name, message) {
|
_checkPrefSafe: function (name, message, value) {
|
||||||
let curval = this._loadPreference(name, null, false);
|
let curval = this._loadPreference(name, null, false);
|
||||||
|
if (arguments.length > 2 && curval === value)
|
||||||
|
return;
|
||||||
let defval = this._loadPreference(name, null, true);
|
let defval = this._loadPreference(name, null, true);
|
||||||
let saved = this._loadPreference(Options.SAVED + name);
|
let saved = this._loadPreference(Options.SAVED + name);
|
||||||
|
|
||||||
@@ -881,7 +883,7 @@ const Options = Module("options", {
|
|||||||
* @param {value} value The new preference value.
|
* @param {value} value The new preference value.
|
||||||
*/
|
*/
|
||||||
safeSetPref: function (name, value, message) {
|
safeSetPref: function (name, value, message) {
|
||||||
this._checkPrefSafe(name, message);
|
this._checkPrefSafe(name, message, value);
|
||||||
this._storePreference(name, value);
|
this._storePreference(name, value);
|
||||||
this._storePreference(Options.SAVED + name, value);
|
this._storePreference(Options.SAVED + name, value);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1014,20 +1014,33 @@ const Tabs = Module("tabs", {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (config.hasTabbrowser) {
|
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"],
|
options.add(["activate", "act"],
|
||||||
"Define when tabs are automatically activated",
|
"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) [
|
completer: function (context) activateGroups,
|
||||||
["addons", ":addo[ns] command"],
|
setter: function (newValues) {
|
||||||
["downloads", ":downl[oads] command"],
|
let valueSet = set(newValues);
|
||||||
["extoptions", ":exto[ptions] command"],
|
for (let group in values(activateGroups))
|
||||||
["help", ":h[elp] command"],
|
if (group[2])
|
||||||
["homepage", "gH mapping"],
|
options.safeSetPref("browser.tabs." + group[2],
|
||||||
["quickmark", "go and gn mappings"],
|
!(valueSet["all"] || valueSet[group[0]]),
|
||||||
["tabopen", ":tabopen[!] command"],
|
"See the 'activate' option");
|
||||||
["paste", "P and gP mappings"]
|
return newValues;
|
||||||
]
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
options.add(["newtab"],
|
options.add(["newtab"],
|
||||||
|
|||||||
@@ -330,10 +330,13 @@
|
|||||||
<dl>
|
<dl>
|
||||||
<dt>all</dt> <dd>Activate all items.</dd>
|
<dt>all</dt> <dd>Activate all items.</dd>
|
||||||
<dt>addons</dt> <dd><ex>:addo<oa>ns</oa></ex> command</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>downloads</dt> <dd><ex>:downl<oa>oads</oa></ex> command</dd>
|
||||||
<dt>extoptions</dt> <dd><ex>:exto<oa>ptions</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>help</dt> <dd><ex>:h<oa>elp</oa></ex> command</dd>
|
||||||
<dt>homepage</dt> <dd><k>gH</k> mapping</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>quickmark</dt> <dd><k>go</k> and <k>gn</k> mappings</dd>
|
||||||
<dt>tabopen</dt> <dd><ex>:tabopen<oa>!</oa></ex> command</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>
|
<dt>paste</dt> <dd><k>P</k> and <k>gP</k> mappings</dd>
|
||||||
|
|||||||
@@ -42,6 +42,8 @@
|
|||||||
* IMPORTANT: 'extendedhinttags' is now a regexmap rather than a
|
* IMPORTANT: 'extendedhinttags' is now a regexmap rather than a
|
||||||
string.
|
string.
|
||||||
* IMPORTANT: 'guioptions' default value has changed.
|
* IMPORTANT: 'guioptions' default value has changed.
|
||||||
|
* Added "bookmarks", "diverted", and "links" to 'activate'
|
||||||
|
option
|
||||||
* Added 'altwildmode' and <A-Tab> command-line key binding.
|
* Added 'altwildmode' and <A-Tab> command-line key binding.
|
||||||
* Added 'autocomplete' option for specifying which completion
|
* Added 'autocomplete' option for specifying which completion
|
||||||
groups should be auto-completed.
|
groups should be auto-completed.
|
||||||
|
|||||||
@@ -35,14 +35,6 @@ FEATURES:
|
|||||||
:open foo
|
:open foo
|
||||||
8 use the storage module for autocommands
|
8 use the storage module for autocommands
|
||||||
8 support 'activate' in buffer.followLink?
|
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 add support for filename special characters such as %
|
||||||
8 :redir and 'verbosefile'
|
8 :redir and 'verbosefile'
|
||||||
8 middleclick in content == p, and if command line is open, paste there the clipboard buffer
|
8 middleclick in content == p, and if command line is open, paste there the clipboard buffer
|
||||||
|
|||||||
Reference in New Issue
Block a user