1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-04 07:05:46 +01:00

Make 'popups' more intuitive.

This commit is contained in:
Kris Maglione
2009-09-17 14:50:41 -04:00
parent f6e130a93f
commit a896c98434
3 changed files with 25 additions and 20 deletions

View File

@@ -168,27 +168,29 @@ function Tabs() //{{{
// TODO: Is this really applicable to Xulmus? // TODO: Is this really applicable to Xulmus?
options.add(["popups", "pps"], options.add(["popups", "pps"],
"Where to show requested popup windows", "Where to show requested popup windows",
"number", 1, "stringlist", "tab",
{ {
setter: function (value) setter: function (value)
{ {
let values = [[0, 1], // always in current tab let [open, restriction] = [1, 0];
[0, 3], // in a new tab for (let [, opt] in value)
[2, 3], // in a new window if it has specified sizes {
[1, 2], // always in new window if (opt == "tab")
[2, 1]];// current tab unless it has specified sizes open = 3;
else if (opt == "window")
options.safeSetPref("browser.link.open_newwindow.restriction", values[value][0]); open = 2;
options.safeSetPref("browser.link.open_newwindow", values[value][1]); else if (opt == "resized")
resized = 2;
}
options.safeSetPref("browser.link.open_newwindow", open);
options.safeSetPref("browser.link.open_newwindow.restriction", resized);
return value; return value;
}, },
completer: function (context) [ completer: function (context) [
["0", "Force to open in the current tab"], ["tab", "Open popups in a new tab"],
["1", "Always open in a new tab"], ["window", "Open popups in a new window"],
["2", "Open in a new window if it has a specific requested size (default in " + config.hostApplication + ")"], ["resized", "Open resized popups in a new window"]
["3", "Always open in a new window"],
["4", "Open in the same tab unless it has a specific requested size"]
], ],
validator: Option.validateCompleter validator: Option.validateCompleter
}); });

View File

@@ -17,6 +17,7 @@
and <C-A> are equivalent, to map the uppercase character use <C-S-A>. and <C-A> are equivalent, to map the uppercase character use <C-S-A>.
(this might change again, as this is REALLY inconsistent, and i don't (this might change again, as this is REALLY inconsistent, and i don't
know if I like copying bugs) know if I like copying bugs)
* IMPORTANT: 'popups' now takes a stringlist rather than a number.
* add [c]:keepalt[c] * add [c]:keepalt[c]
* add [c]:styledisable[c], [c]:styleenable[c], and [c]:styletoggle[c] * add [c]:styledisable[c], [c]:styleenable[c], and [c]:styletoggle[c]

View File

@@ -613,7 +613,7 @@ ____
|\'pps'| |\'popups'| + |\'pps'| |\'popups'| +
||'popups' 'pps'|| number (default: 1) ||'popups' 'pps'|| stringlist (default: tab)
____ ____
Define where to show requested popup windows. Define where to show requested popup windows.
Does not apply to windows which are opened by middle clicking a link, Does not apply to windows which are opened by middle clicking a link,
@@ -621,13 +621,15 @@ they always open in a new tab. Possible values:
[frame="topbot",grid="none",cols="1,10"] [frame="topbot",grid="none",cols="1,10"]
|=============================================================================== |===============================================================================
|*0*|Force to open in the current tab (Warning: this can stop some web sites from working correctly!) |*tab* | Open popups in a new tab
|*1*|Always open in a new tab |*window* | Open popups in a new window
|*2*|Open in a new window if it has a specific requested size (default in Firefox) |*resized* | Open resized popups in a new window
|*3*|Always open in a new window
|*4*|Open in the same tab unless it has a specific requested size
|=============================================================================== |===============================================================================
If neither *tab* nor *window* is provided, all popups open in the current tab.
*tab* and *window* are mutually exclusive, and the last one listed is
effective.
Note: This option does not change the popup blocker of Firefox in any way. Note: This option does not change the popup blocker of Firefox in any way.
____ ____