diff options
author | Kris Maglione <maglione.k@gmail.com> | 2009-09-17 14:50:41 -0400 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2009-09-19 01:42:59 -0400 |
commit | a896c9843432d20f4aba00429271add99c50fec3 (patch) | |
tree | a4f816f163e653b5892915b161a96124d48d2651 /common | |
parent | f6e130a93f8c9e2d1d7d2db417872c752dbeddd9 (diff) | |
download | pentadactyl-a896c9843432d20f4aba00429271add99c50fec3.tar.gz |
Make 'popups' more intuitive.
Diffstat (limited to 'common')
-rw-r--r-- | common/content/tabs.js | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/common/content/tabs.js b/common/content/tabs.js index 22d90613..9a9b3e39 100644 --- a/common/content/tabs.js +++ b/common/content/tabs.js @@ -168,27 +168,29 @@ function Tabs() //{{{ // TODO: Is this really applicable to Xulmus? options.add(["popups", "pps"], "Where to show requested popup windows", - "number", 1, + "stringlist", "tab", { setter: function (value) { - let values = [[0, 1], // always in current tab - [0, 3], // in a new tab - [2, 3], // in a new window if it has specified sizes - [1, 2], // always in new window - [2, 1]];// current tab unless it has specified sizes - - options.safeSetPref("browser.link.open_newwindow.restriction", values[value][0]); - options.safeSetPref("browser.link.open_newwindow", values[value][1]); + let [open, restriction] = [1, 0]; + for (let [, opt] in value) + { + if (opt == "tab") + open = 3; + else if (opt == "window") + open = 2; + else if (opt == "resized") + resized = 2; + } + options.safeSetPref("browser.link.open_newwindow", open); + options.safeSetPref("browser.link.open_newwindow.restriction", resized); return value; }, completer: function (context) [ - ["0", "Force to open in the current tab"], - ["1", "Always open in a new tab"], - ["2", "Open in a new window if it has a specific requested size (default in " + config.hostApplication + ")"], - ["3", "Always open in a new window"], - ["4", "Open in the same tab unless it has a specific requested size"] + ["tab", "Open popups in a new tab"], + ["window", "Open popups in a new window"], + ["resized", "Open resized popups in a new window"] ], validator: Option.validateCompleter }); |