mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-23 20:03:33 +01:00
Merge old head.
This commit is contained in:
@@ -885,7 +885,7 @@ function Editor() //{{{
|
|||||||
},
|
},
|
||||||
|
|
||||||
// TODO: clean up with 2 functions for textboxes and currentEditor?
|
// TODO: clean up with 2 functions for textboxes and currentEditor?
|
||||||
editFieldExternally: function ()
|
editFieldExternally: function (forceEditing)
|
||||||
{
|
{
|
||||||
if (!options["editor"])
|
if (!options["editor"])
|
||||||
return false;
|
return false;
|
||||||
@@ -894,11 +894,15 @@ function Editor() //{{{
|
|||||||
if (!(config.isComposeWindow))
|
if (!(config.isComposeWindow))
|
||||||
textBox = liberator.focus;
|
textBox = liberator.focus;
|
||||||
|
|
||||||
if (textBox.type == "password")
|
if (!forceEditing && textBox && textBox.type == "password")
|
||||||
{
|
{
|
||||||
liberator.beep();
|
commandline.input("Editing a password field externally will reveal the password. Would you like to continue? (yes/[no]): ",
|
||||||
liberator.echoerr("Cannot edit password fields");
|
function (resp)
|
||||||
return false;
|
{
|
||||||
|
if (resp && resp.match(/^y(es)?$/i))
|
||||||
|
return editor.editFieldExternally(true);
|
||||||
|
});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let text = ""; // XXX
|
let text = ""; // XXX
|
||||||
|
|||||||
@@ -185,7 +185,8 @@ const liberator = (function () //{{{
|
|||||||
styles.addSheet(true, "scrollbar", "*", class.join(", ") + " { visibility: collapse !important; }", true);
|
styles.addSheet(true, "scrollbar", "*", class.join(", ") + " { visibility: collapse !important; }", true);
|
||||||
else
|
else
|
||||||
styles.removeSheet(true, "scrollbar");
|
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)
|
validator: function (opts) (opts.indexOf("l") < 0 || opts.indexOf("r") < 0)
|
||||||
},
|
},
|
||||||
@@ -289,7 +290,8 @@ const liberator = (function () //{{{
|
|||||||
{
|
{
|
||||||
setter: function (value)
|
setter: function (value)
|
||||||
{
|
{
|
||||||
options.safeSetPref("accessibility.typeaheadfind.enablesound", !value);
|
options.safeSetPref("accessibility.typeaheadfind.enablesound", !value,
|
||||||
|
"See 'visualbell' option");
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -448,8 +448,8 @@ function Options() //{{{
|
|||||||
////////////////////// PRIVATE SECTION /////////////////////////////////////////
|
////////////////////// PRIVATE SECTION /////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////{{{
|
/////////////////////////////////////////////////////////////////////////////{{{
|
||||||
|
|
||||||
// TODO: migrate liberator.saved.* prefs to extensions.liberator.saved.*
|
|
||||||
const SAVED = "extensions.liberator.saved.";
|
const SAVED = "extensions.liberator.saved.";
|
||||||
|
const OLD_SAVED = "liberator.saved.";
|
||||||
|
|
||||||
const optionHash = {};
|
const optionHash = {};
|
||||||
|
|
||||||
@@ -925,9 +925,7 @@ function Options() //{{{
|
|||||||
liberator.registerObserver("load_completion", function () {
|
liberator.registerObserver("load_completion", function () {
|
||||||
completion.setFunctionCompleter(options.get, [function () ([o.name, o.description] for (o in options))]);
|
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],
|
completion.setFunctionCompleter([options.getPref, options.safeSetPref, options.setPref, options.resetPref, options.invertPref],
|
||||||
[function () services.get("pref")
|
[function () options.allPrefs().map(function (pref) [pref, ""])]);
|
||||||
.getChildList("", { value: 0 })
|
|
||||||
.map(function (pref) [pref, ""])]);
|
|
||||||
|
|
||||||
completion.option = function option(context, scope) {
|
completion.option = function option(context, scope) {
|
||||||
context.title = ["Option"];
|
context.title = ["Option"];
|
||||||
@@ -990,7 +988,7 @@ function Options() //{{{
|
|||||||
context.anchored = false;
|
context.anchored = false;
|
||||||
context.title = [config.hostApplication + " Preference", "Value"];
|
context.title = [config.hostApplication + " Preference", "Value"];
|
||||||
context.keys = { text: function (item) item, description: function (item) options.getPref(item) };
|
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;
|
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 <b>name</b> in the specified <b>scope</b>.
|
* Returns the option with <b>name</b> in the specified <b>scope</b>.
|
||||||
*
|
*
|
||||||
@@ -1134,7 +1140,7 @@ function Options() //{{{
|
|||||||
if (!scope)
|
if (!scope)
|
||||||
scope = options.OPTION_SCOPE_BOTH;
|
scope = options.OPTION_SCOPE_BOTH;
|
||||||
|
|
||||||
let opts = function (opt) {
|
function opts(opt) {
|
||||||
for (let opt in Iterator(options))
|
for (let opt in Iterator(options))
|
||||||
{
|
{
|
||||||
let option = {
|
let option = {
|
||||||
@@ -1181,9 +1187,9 @@ function Options() //{{{
|
|||||||
if (!filter)
|
if (!filter)
|
||||||
filter = "";
|
filter = "";
|
||||||
|
|
||||||
let prefArray = services.get("pref").getChildList("", { value: 0 });
|
let prefArray = options.allPrefs();
|
||||||
prefArray.sort();
|
prefArray.sort();
|
||||||
let prefs = function () {
|
function prefs() {
|
||||||
for (let [, pref] in Iterator(prefArray))
|
for (let [, pref] in Iterator(prefArray))
|
||||||
{
|
{
|
||||||
let userValue = services.get("pref").prefHasUserValue(pref);
|
let userValue = services.get("pref").prefHasUserValue(pref);
|
||||||
@@ -1299,13 +1305,18 @@ function Options() //{{{
|
|||||||
* @param {value} value The new preference value.
|
* @param {value} value The new preference value.
|
||||||
*/
|
*/
|
||||||
// FIXME: Well it used to. I'm looking at you mst! --djk
|
// 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 val = loadPreference(name, null, false);
|
||||||
let def = loadPreference(name, null, true);
|
let def = loadPreference(name, null, true);
|
||||||
let lib = loadPreference(SAVED + name);
|
let lib = loadPreference(SAVED + name);
|
||||||
if (lib == null && val != def || val != lib)
|
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(name, value);
|
||||||
storePreference(SAVED + 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();
|
self.prefObserver.register();
|
||||||
liberator.registerObserver("shutdown", function () {
|
liberator.registerObserver("shutdown", function () {
|
||||||
self.prefObserver.unregister();
|
self.prefObserver.unregister();
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ function Sanitizer() //{{{
|
|||||||
{
|
{
|
||||||
options.setPref(pref, false);
|
options.setPref(pref, false);
|
||||||
|
|
||||||
for (let [, value] in Iterator(values.split(",")))
|
for (let [, value] in Iterator(this.parseValues(values)))
|
||||||
{
|
{
|
||||||
if (prefToArg(pref) == value)
|
if (prefToArg(pref) == value)
|
||||||
{
|
{
|
||||||
@@ -311,15 +311,8 @@ function Sanitizer() //{{{
|
|||||||
return errors;
|
return errors;
|
||||||
};
|
};
|
||||||
|
|
||||||
self.__defineGetter__("prefNames", function () {
|
self.__defineGetter__("prefNames",
|
||||||
let ret = [];
|
function () util.Array.flatten([self.prefDomain, self.prefDomain2].map(options.allPrefs)));
|
||||||
|
|
||||||
[self.prefDomain, self.prefDomain2].forEach(function (branch) {
|
|
||||||
ret = ret.concat(services.get("pref").getBranch(branch).getChildList("", {}).map(function (pref) branch + pref));
|
|
||||||
});
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
});
|
|
||||||
//}}}
|
//}}}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
|
|||||||
@@ -183,8 +183,8 @@ function Tabs() //{{{
|
|||||||
restriction = 2;
|
restriction = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
options.safeSetPref("browser.link.open_newwindow", open);
|
options.safeSetPref("browser.link.open_newwindow", open, "See 'popups' option.");
|
||||||
options.safeSetPref("browser.link.open_newwindow.restriction", restriction);
|
options.safeSetPref("browser.link.open_newwindow.restriction", restriction, "See 'popups' option.");
|
||||||
return value;
|
return value;
|
||||||
},
|
},
|
||||||
completer: function (context) [
|
completer: function (context) [
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
2009:
|
2009:
|
||||||
|
* Andreas Nerf (biggest Muttator donor so far! thanks a lot)
|
||||||
* Kirill Korotaev
|
* Kirill Korotaev
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ Continuous donations:
|
|||||||
* Daniel Bainton (web hosting)
|
* Daniel Bainton (web hosting)
|
||||||
|
|
||||||
2009:
|
2009:
|
||||||
|
* Oliver Schaefer (2nd donation this year, and largest one in 2009! - Thanks!)
|
||||||
* James Davis
|
* James Davis
|
||||||
* Gregg Archer
|
* Gregg Archer
|
||||||
* James Henderson
|
* James Henderson
|
||||||
|
|||||||
@@ -25,7 +25,6 @@
|
|||||||
* add [c]:verbose[c]
|
* add [c]:verbose[c]
|
||||||
* add [c]:window[c] to run a command in a new window
|
* add [c]:window[c] to run a command in a new window
|
||||||
* add ! version of [c]:delbmarks[c] to delete all bookmarks
|
* 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]
|
* 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]
|
* make [c]:open[c] behavior match that of [c]:tabopen[c] and [c]:winopen[c]
|
||||||
when no argument is specified
|
when no argument is specified
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
<Description>
|
<Description>
|
||||||
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
|
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
|
||||||
<em:minVersion>3.5</em:minVersion>
|
<em:minVersion>3.5</em:minVersion>
|
||||||
<em:maxVersion>3.6a2pre</em:maxVersion>
|
<em:maxVersion>3.6b1pre</em:maxVersion>
|
||||||
</Description>
|
</Description>
|
||||||
</em:targetApplication>
|
</em:targetApplication>
|
||||||
</Description>
|
</Description>
|
||||||
|
|||||||
Reference in New Issue
Block a user