From 7d5d9c5722a5a21083d004ed1beecb130bd408d2 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 23 Sep 2009 01:00:28 +1000 Subject: Fix 'pps' setter. --- common/content/tabs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/content/tabs.js b/common/content/tabs.js index 7ca46281..5914283b 100644 --- a/common/content/tabs.js +++ b/common/content/tabs.js @@ -173,7 +173,7 @@ function Tabs() //{{{ setter: function (value) { let [open, restriction] = [1, 0]; - for (let [, opt] in value) + for (let [, opt] in Iterator(value.split(","))) { if (opt == "tab") open = 3; -- cgit v1.2.3 From ec5a78ff2e6770254328dc0e3ec8b76c19108fa7 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Tue, 22 Sep 2009 14:12:08 -0400 Subject: Add more helpful information to safeSetPref messages. --- common/content/liberator.js | 6 ++++-- common/content/options.js | 20 ++++++++------------ common/content/tabs.js | 6 +++--- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/common/content/liberator.js b/common/content/liberator.js index a667a6e7..f4f6e320 100644 --- a/common/content/liberator.js +++ b/common/content/liberator.js @@ -185,7 +185,8 @@ const liberator = (function () //{{{ styles.addSheet(true, "scrollbar", "*", class.join(", ") + " { visibility: collapse !important; }", true); else styles.removeSheet(true, "scrollbar"); - options.safeSetPref("layout.scrollbar.side", opts.indexOf("l") >= 0 ? 3 : 2); + options.safeSetPref("layout.scrollbar.side", opts.indexOf("l") >= 0 ? 3 : 2, + "See 'guioptions' scrollbar flags."); }, validator: function (opts) (opts.indexOf("l") < 0 || opts.indexOf("r") < 0) }, @@ -289,7 +290,8 @@ const liberator = (function () //{{{ { setter: function (value) { - options.safeSetPref("accessibility.typeaheadfind.enablesound", !value); + options.safeSetPref("accessibility.typeaheadfind.enablesound", !value, + "See 'visualbell' option"); return value; } }); diff --git a/common/content/options.js b/common/content/options.js index 8d3f4c19..eedda31c 100644 --- a/common/content/options.js +++ b/common/content/options.js @@ -251,16 +251,7 @@ Option.prototype = { return null; if (this.setter) - { - let tmpValue = newValue; - newValue = this.setter.call(this, newValue); - - if (newValue === undefined) - { - newValue = tmpValue; - liberator.log("DEPRECATED: '" + this.name + "' setter should return a value"); - } - } + newValue = this.setter(newValue); if (liberator.has("tabs") && (scope & options.OPTION_SCOPE_LOCAL)) tabs.options[this.name] = newValue; @@ -1308,13 +1299,18 @@ function Options() //{{{ * @param {value} value The new preference value. */ // FIXME: Well it used to. I'm looking at you mst! --djk - safeSetPref: function (name, value) + safeSetPref: function (name, value, message) { let val = loadPreference(name, null, false); let def = loadPreference(name, null, true); let lib = loadPreference(SAVED + name); if (lib == null && val != def || val != lib) - liberator.echomsg("Warning: setting preference " + name + ", but it's changed from its default value."); + { + let msg = "Warning: setting preference " + name + ", but it's changed from its default value."; + if (message) + msg += " " + message; + liberator.echomsg(msg); + } storePreference(name, value); storePreference(SAVED + name, value); }, diff --git a/common/content/tabs.js b/common/content/tabs.js index 5914283b..fec81609 100644 --- a/common/content/tabs.js +++ b/common/content/tabs.js @@ -173,7 +173,7 @@ function Tabs() //{{{ setter: function (value) { let [open, restriction] = [1, 0]; - for (let [, opt] in Iterator(value.split(","))) + for (let [, opt] in Iterator(this.parseValues(value))) { if (opt == "tab") open = 3; @@ -183,8 +183,8 @@ function Tabs() //{{{ restriction = 2; } - options.safeSetPref("browser.link.open_newwindow", open); - options.safeSetPref("browser.link.open_newwindow.restriction", restriction); + options.safeSetPref("browser.link.open_newwindow", open, "See 'popups' option."); + options.safeSetPref("browser.link.open_newwindow.restriction", restriction, "See 'popups' option."); return value; }, completer: function (context) [ -- cgit v1.2.3 From d46fe30d28a2ea6f24dc160331394d866ff8a319 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 23 Sep 2009 04:20:59 +1000 Subject: Use Option#parseValues in 'sanitizeitems' setter. --- common/content/sanitizer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/content/sanitizer.js b/common/content/sanitizer.js index d68fa346..579ccf93 100644 --- a/common/content/sanitizer.js +++ b/common/content/sanitizer.js @@ -72,7 +72,7 @@ function Sanitizer() //{{{ { options.setPref(pref, false); - for (let [, value] in Iterator(values.split(","))) + for (let [, value] in Iterator(this.parseValues(values))) { if (prefToArg(pref) == value) { -- cgit v1.2.3 From b980157575dc5a96ddb2e6a750567de3aafa2d9b Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Wed, 23 Sep 2009 00:46:45 -0400 Subject: Migrage from liberator.saved. to extensions.liberator.saved. --- common/content/options.js | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/common/content/options.js b/common/content/options.js index eedda31c..9ea4ef5c 100644 --- a/common/content/options.js +++ b/common/content/options.js @@ -448,8 +448,8 @@ function Options() //{{{ ////////////////////// PRIVATE SECTION ///////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ - // TODO: migrate liberator.saved.* prefs to extensions.liberator.saved.* const SAVED = "extensions.liberator.saved."; + const OLD_SAVED = "liberator.saved."; const optionHash = {}; @@ -925,9 +925,7 @@ function Options() //{{{ liberator.registerObserver("load_completion", function () { completion.setFunctionCompleter(options.get, [function () ([o.name, o.description] for (o in options))]); completion.setFunctionCompleter([options.getPref, options.safeSetPref, options.setPref, options.resetPref, options.invertPref], - [function () services.get("pref") - .getChildList("", { value: 0 }) - .map(function (pref) [pref, ""])]); + [function () options.allPrefs().map(function (pref) [pref, ""])]); completion.option = function option(context, scope) { context.title = ["Option"]; @@ -990,7 +988,7 @@ function Options() //{{{ context.anchored = false; context.title = [config.hostApplication + " Preference", "Value"]; context.keys = { text: function (item) item, description: function (item) options.getPref(item) }; - context.completions = services.get("pref").getChildList("", { value: 0 }); + context.completions = options.allPrefs(); }; }); @@ -1095,6 +1093,14 @@ function Options() //{{{ return true; }, + /** + * Returns the names of all preferences. + * + * @param {string} branch The branch in which to search preferences. + * @default "" + */ + allPrefs: function (branch) services.get("pref").getChildList(branch || "", { value: 0 }), + /** * Returns the option with name in the specified scope. * @@ -1402,6 +1408,14 @@ function Options() //{{{ } }; //}}} + for (let [, pref] in Iterator(self.allPrefs(OLD_SAVED))) + { + let saved = SAVED + pref.substr(OLD_SAVED.length) + if (!self.getPref(saved)) + self.setPref(saved, self.getPref(pref)); + self.resetPref(pref); + } + self.prefObserver.register(); liberator.registerObserver("shutdown", function () { self.prefObserver.unregister(); -- cgit v1.2.3 From 4931f013535d9ab945ded449bda84d229658bc8b Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Wed, 23 Sep 2009 01:09:11 -0400 Subject: Use options.allPrefs rather than nsIPrefBranch#getChildList --- common/content/options.js | 2 +- common/content/sanitizer.js | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/common/content/options.js b/common/content/options.js index 9ea4ef5c..00bf0745 100644 --- a/common/content/options.js +++ b/common/content/options.js @@ -1187,7 +1187,7 @@ function Options() //{{{ if (!filter) filter = ""; - let prefArray = services.get("pref").getChildList("", { value: 0 }); + let prefArray = options.allPrefs(); prefArray.sort(); let prefs = function () { for (let [, pref] in Iterator(prefArray)) diff --git a/common/content/sanitizer.js b/common/content/sanitizer.js index 579ccf93..4db4f33d 100644 --- a/common/content/sanitizer.js +++ b/common/content/sanitizer.js @@ -311,15 +311,8 @@ function Sanitizer() //{{{ return errors; }; - self.__defineGetter__("prefNames", function () { - let ret = []; - - [self.prefDomain, self.prefDomain2].forEach(function (branch) { - ret = ret.concat(services.get("pref").getBranch(branch).getChildList("", {}).map(function (pref) branch + pref)); - }); - - return ret; - }); + self.__defineGetter__("prefNames", + function () util.Array.flatten([self.prefDomain, self.prefDomain2].map(options.allPrefs))); //}}} return self; -- cgit v1.2.3 From a74cc55f6dac70af277001c2371f3a4ac941b554 Mon Sep 17 00:00:00 2001 From: Martin Stubenschrott Date: Thu, 24 Sep 2009 12:08:47 +0200 Subject: * Ask for permission when editing external password fields. * Bump maxVersion to 3.6b1 --- common/content/editor.js | 14 +++++++++----- muttator/Donors | 1 + vimperator/Donors | 1 + vimperator/install.rdf | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/common/content/editor.js b/common/content/editor.js index 1b242968..31bdfd2f 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -885,7 +885,7 @@ function Editor() //{{{ }, // TODO: clean up with 2 functions for textboxes and currentEditor? - editFieldExternally: function () + editFieldExternally: function (forceEditing) { if (!options["editor"]) return false; @@ -894,11 +894,15 @@ function Editor() //{{{ if (!(config.isComposeWindow)) textBox = liberator.focus; - if (textBox.type == "password") + if (!forceEditing && textBox && textBox.type == "password") { - liberator.beep(); - liberator.echoerr("Cannot edit password fields"); - return false; + commandline.input("Editing a password field externally will reveal the password. Would you like to continue? (yes/[no]): ", + function (resp) + { + if (resp && resp.match(/^y(es)?$/i)) + return editor.editFieldExternally(true); + }); + return; } let text = ""; // XXX diff --git a/muttator/Donors b/muttator/Donors index 38f782d7..9b41e8c0 100644 --- a/muttator/Donors +++ b/muttator/Donors @@ -1,2 +1,3 @@ 2009: +* Andreas Nerf (biggest Muttator donor so far! thanks a lot) * Kirill Korotaev diff --git a/vimperator/Donors b/vimperator/Donors index 2c73a05c..9f9c7186 100644 --- a/vimperator/Donors +++ b/vimperator/Donors @@ -2,6 +2,7 @@ Continuous donations: * Daniel Bainton (web hosting) 2009: +* Oliver Schaefer (2nd donation this year, and largest one in 2009! - Thanks!) * James Davis * Gregg Archer * James Henderson diff --git a/vimperator/install.rdf b/vimperator/install.rdf index 3d44a2b1..b9a16d2f 100644 --- a/vimperator/install.rdf +++ b/vimperator/install.rdf @@ -19,7 +19,7 @@ {ec8030f7-c20a-464f-9b0e-13a3a9e97384} 3.5 - 3.6a2pre + 3.6b1pre -- cgit v1.2.3 From a0c023113c54a184d3d5e37997f838ab5238fd96 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Fri, 25 Sep 2009 17:32:07 -0400 Subject: Remove spurious entry about 't' flag for 'complete' from NEWS.. --- common/content/options.js | 4 ++-- vimperator/NEWS | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/common/content/options.js b/common/content/options.js index 00bf0745..e96b6b5b 100644 --- a/common/content/options.js +++ b/common/content/options.js @@ -1140,7 +1140,7 @@ function Options() //{{{ if (!scope) scope = options.OPTION_SCOPE_BOTH; - let opts = function (opt) { + function opts(opt) { for (let opt in Iterator(options)) { let option = { @@ -1189,7 +1189,7 @@ function Options() //{{{ let prefArray = options.allPrefs(); prefArray.sort(); - let prefs = function () { + function prefs() { for (let [, pref] in Iterator(prefArray)) { let userValue = services.get("pref").prefHasUserValue(pref); diff --git a/vimperator/NEWS b/vimperator/NEWS index 82de544a..ead10034 100644 --- a/vimperator/NEWS +++ b/vimperator/NEWS @@ -25,7 +25,6 @@ * add [c]:verbose[c] * add [c]:window[c] to run a command in a new window * add ! version of [c]:delbmarks[c] to delete all bookmarks - * new "t" option for 'complete' to also switch to open tabs with :open * add [c]:toolbaropen[c], [c]:toolbarclose[c], and [c]:toolbartoggle[c] * make [c]:open[c] behavior match that of [c]:tabopen[c] and [c]:winopen[c] when no argument is specified -- cgit v1.2.3