From a8f8ebaeb51030eab3cc62ed66e4e2794aad5e14 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Fri, 13 Nov 2009 22:04:50 -0500 Subject: [PATCH] Allow :setcomm /dev/null <(js -Cv180 options.js |& grep .) all& --- common/content/options.js | 9 +++++++-- common/content/util.js | 3 +++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/common/content/options.js b/common/content/options.js index 46c75594..f55bce5f 100644 --- a/common/content/options.js +++ b/common/content/options.js @@ -937,8 +937,13 @@ const Options = Module("options", { } if (name == "all" && reset) - // TODO: Why? --djk - liberator.echoerr("You can't reset all options, it could make " + config.hostApplication + " unusable."); + commandline.input("Warning: Resetting all preferences may make " + config.hostApplication + " unusable. Continue (yes/[no]): ", + function (resp) { + if (resp == "yes") + for (let pref in values(options.allPrefs())) + options.resetPref(pref); + }, + { promptHighlight: "WarningMsg" }); else if (name == "all") options.listPrefs(onlyNonDefault, ""); else if (reset) diff --git a/common/content/util.js b/common/content/util.js index 806963b2..c02dfce2 100644 --- a/common/content/util.js +++ b/common/content/util.js @@ -782,6 +782,9 @@ const Util = Module("util", { isinstance: function isinstance(obj) { return Object.prototype.toString.call(obj) == "[object Array]"; }, + + toString: function () this.__proto__.toString(), + /** * Converts an array to an object. As in lisp, an assoc is an * array of key-value pairs, which maps directly to an object,