summaryrefslogtreecommitdiff
path: root/common/content
diff options
context:
space:
mode:
authorKris Maglione <maglione.k@gmail.com>2010-12-31 02:11:48 -0500
committerKris Maglione <maglione.k@gmail.com>2010-12-31 02:11:48 -0500
commit012732edc77a1596b34cdba9b4ac94b29da7648b (patch)
treebb6eb30637a08a392b35b2880f8962f67c2da065 /common/content
parent3f3e89e270d5f521730e986a4992e9088d374238 (diff)
downloadpentadactyl-012732edc77a1596b34cdba9b4ac94b29da7648b.tar.gz
Decent filtering for :extrehash. Fix tab bar layout after rehash with go+=n. Cleanup.
Diffstat (limited to 'common/content')
-rw-r--r--common/content/commandline.js2
-rw-r--r--common/content/commands.js19
-rw-r--r--common/content/dactyl.js9
-rw-r--r--common/content/tabs.js2
4 files changed, 20 insertions, 12 deletions
diff --git a/common/content/commandline.js b/common/content/commandline.js
index 4b297915..76296218 100644
--- a/common/content/commandline.js
+++ b/common/content/commandline.js
@@ -160,7 +160,7 @@ var CommandWidgets = Class("CommandWidgets", {
}
});
- let fontSize = util.computedStyle(document.getElementById(config.mainWindowId)).fontSize;
+ let fontSize = util.computedStyle(document.documentElement).fontSize;
styles.registerSheet("chrome://dactyl/skin/dactyl.css");
styles.system.add("font-size", "chrome://dactyl/content/buffer.xhtml",
"body { font-size: " + fontSize + "; }");
diff --git a/common/content/commands.js b/common/content/commands.js
index 9f1d2624..eb10a156 100644
--- a/common/content/commands.js
+++ b/common/content/commands.js
@@ -318,13 +318,15 @@ var Command = Class("Command", {
}, {
bindMacro: function (args, default_, params) {
let process = util.identity;
- let makeParams = function makeParams()
- let (args = arguments)
- params.map(function (name, i) [name, process(args[i])]).toObject();
+
if (callable(params))
- makeParams = function makeParams(args) array(Iterator(params.apply(this, arguments))).map(function ([k, v]) [k, process(v)]).toObject();
+ function makeParams(self, args)
+ array.toObject([[k, process(v)]
+ for ([k, v] in iter(params.apply(this, args)))])
else if (params)
- params = array(params);
+ function makeParams(self, args)
+ array.toObject([[name, process(args[i])]
+ for ([i, name] in Iterator(params))]);
let rhs = args.literalArg;
let type = ["-builtin", "-ex", "-javascript", "-keys"].reduce(function (a, b) args[b] ? b : a, default_);
@@ -335,18 +337,19 @@ var Command = Class("Command", {
case "-keys":
let silent = args["-silent"];
rhs = events.canonicalKeys(rhs, true);
- var action = function action(args) events.feedkeys(action.macro(args), noremap, silent);
+ var action = function action() events.feedkeys(action.macro(makeParams(this, arguments)),
+ noremap, silent);
action.macro = util.compileMacro(rhs, true);
break;
case "-ex":
- action = function action() commands.execute(action.macro, makeParams.apply(this, arguments),
+ action = function action() commands.execute(action.macro, makeParams(this, arguments),
false, null, action.sourcing);
action.macro = util.compileMacro(rhs, true);
action.sourcing = io.sourcing && update({}, io.sourcing);
break;
case "-javascript":
if (callable(params))
- action = dactyl.userEval("(function action() { with (action.makeParams.apply(this, arguments)) {" + args.literalArg + "} })");
+ action = dactyl.userEval("(function action() { with (action.makeParams(this, arguments)) {" + args.literalArg + "} })");
else
action = dactyl.userFunc.apply(dactyl, params.concat(args.literalArg).array);
process = function (param) isObject(param) && param.valueOf ? param.valueOf() : param;
diff --git a/common/content/dactyl.js b/common/content/dactyl.js
index e568c43d..e77d04a0 100644
--- a/common/content/dactyl.js
+++ b/common/content/dactyl.js
@@ -601,7 +601,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
if (context && context.INFO instanceof XML) {
let info = context.INFO;
if (info.*.@lang.length()) {
- let langs = set([String(a) for each (a in info.*.@lang)]);
+ let langs = set(String(a) for each (a in info.*.@lang));
let lang = [window.navigator.language,
window.navigator.language.replace(/-.*/, ""),
"en", "en-US", info.*.@lang[0]
@@ -1477,7 +1477,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
function () { dactyl.quit(true); });
},
- commands: function (_dactyl, _modules, _window) {
+ commands: function () {
commands.add(["addo[ns]"],
"Manage available Extensions and Themes",
function () {
@@ -1667,7 +1667,10 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
addon.userDisabled = false;
});
},
- filter: function ({ item }) !item.userDisabled,
+ get filter() {
+ let ids = set(keys(JSON.parse(prefs.get("extensions.bootstrappedAddons", "{}"))));
+ return function ({ item }) !item.userDisabled && set.has(ids, item.id);
+ },
perm: "disable"
},
{
diff --git a/common/content/tabs.js b/common/content/tabs.js
index 404f5969..0583c177 100644
--- a/common/content/tabs.js
+++ b/common/content/tabs.js
@@ -973,6 +973,8 @@ var Tabs = Module("tabs", {
}
if (value !== "multitab" || !dactyl.has("Gecko2"))
config.tabStrip.collapsed = false;
+ if (config.tabbrowser.tabContainer._positionPinnedTabs)
+ config.tabbrowser.tabContainer._positionPinnedTabs();
return value;
},
completer: function (context) [