summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKris Maglione <jg@suckless.org>2009-09-26 16:55:40 -0400
committerKris Maglione <jg@suckless.org>2009-09-26 16:55:40 -0400
commit5a0a8dd223c21c1a54b681346696971fe22cd137 (patch)
tree90b8de56f050741dee35aabe8261d349db340441
parentf3e015e00e8037a992fdb6f9824f12979fb6af03 (diff)
parenta0c023113c54a184d3d5e37997f838ab5238fd96 (diff)
downloadpentadactyl-5a0a8dd223c21c1a54b681346696971fe22cd137.tar.gz
Merge old head.
-rw-r--r--common/content/editor.js14
-rw-r--r--common/content/liberator.js6
-rw-r--r--common/content/options.js39
-rw-r--r--common/content/sanitizer.js13
-rw-r--r--common/content/tabs.js4
-rw-r--r--muttator/Donors1
-rw-r--r--vimperator/Donors1
-rw-r--r--vimperator/NEWS1
-rw-r--r--vimperator/install.rdf2
9 files changed, 50 insertions, 31 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/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 9c486fe0..e96b6b5b 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();
};
});
@@ -1096,6 +1094,14 @@ function Options() //{{{
},
/**
+ * 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 <b>name</b> in the specified <b>scope</b>.
*
* @param {string} name The option's name.
@@ -1134,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 = {
@@ -1181,9 +1187,9 @@ function Options() //{{{
if (!filter)
filter = "";
- let prefArray = services.get("pref").getChildList("", { value: 0 });
+ let prefArray = options.allPrefs();
prefArray.sort();
- let prefs = function () {
+ function prefs() {
for (let [, pref] in Iterator(prefArray))
{
let userValue = services.get("pref").prefHasUserValue(pref);
@@ -1299,13 +1305,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);
},
@@ -1397,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();
diff --git a/common/content/sanitizer.js b/common/content/sanitizer.js
index d68fa346..4db4f33d 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)
{
@@ -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;
diff --git a/common/content/tabs.js b/common/content/tabs.js
index bd3eb6ae..07349e8d 100644
--- a/common/content/tabs.js
+++ b/common/content/tabs.js
@@ -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) [
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/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
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 @@
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>3.5</em:minVersion>
- <em:maxVersion>3.6a2pre</em:maxVersion>
+ <em:maxVersion>3.6b1pre</em:maxVersion>
</Description>
</em:targetApplication>
</Description>