1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-25 03:23:32 +01:00

Don't push pass through mode multiple times. Closes issue #641.

This commit is contained in:
Kris Maglione
2011-08-19 15:20:15 -04:00
parent 05eac8c5c3
commit 4579a1fd16
4 changed files with 21 additions and 8 deletions

View File

@@ -1586,7 +1586,10 @@ var Events = Module("events", {
mappings.add([modes.MAIN], mappings.add([modes.MAIN],
["<C-z>", "<pass-all-keys>"], "Temporarily ignore all " + config.appName + " key bindings", ["<C-z>", "<pass-all-keys>"], "Temporarily ignore all " + config.appName + " key bindings",
function () { modes.push(modes.PASS_THROUGH); }); function () {
if (modes.main != modes.PASS_THROUGH)
modes.push(modes.PASS_THROUGH);
});
mappings.add([modes.MAIN, modes.PASS_THROUGH, modes.QUOTE], mappings.add([modes.MAIN, modes.PASS_THROUGH, modes.QUOTE],
["<C-v>", "<pass-next-key>"], "Pass through next key", ["<C-v>", "<pass-next-key>"], "Pass through next key",

View File

@@ -47,7 +47,7 @@ var Group = Class("Group", {
makeArgs: function makeArgs(doc, context, args) { makeArgs: function makeArgs(doc, context, args) {
let res = update({ doc: doc, context: context }, args); let res = update({ doc: doc, context: context }, args);
return update(this.argsExtra(res), args); return update(res, this.argsExtra(res), args);
}, },
get toStringParams() [this.name], get toStringParams() [this.name],
@@ -194,7 +194,7 @@ var Contexts = Module("contexts", {
let contextPath = file.path; let contextPath = file.path;
let self = Set.has(plugins, contextPath) && plugins.contexts[contextPath]; let self = Set.has(plugins, contextPath) && plugins.contexts[contextPath];
if (!self && isPlugin) if (!self && isPlugin && false)
self = Set.has(plugins, id) && plugins[id]; self = Set.has(plugins, id) && plugins[id];
if (self) { if (self) {

View File

@@ -798,8 +798,8 @@ var Options = Module("options", {
util.makeDTD( util.makeDTD(
iter(([["option", o.name, "default"].join("."), iter(([["option", o.name, "default"].join("."),
o.type === "string" ? o.defaultValue.replace(/'/g, "''") : o.type === "string" ? o.defaultValue.replace(/'/g, "''") :
o.value === true ? "on" : o.defaultValue === true ? "on" :
o.value === false ? "off" : o.stringDefaultValue] o.defaultValue === false ? "off" : o.stringDefaultValue]
for (o in self)), for (o in self)),
([["option", o.name, "type"].join("."), o.type] for (o in self)), ([["option", o.name, "type"].join("."), o.type] for (o in self)),

View File

@@ -74,11 +74,11 @@ update(Sheet.prototype, {
return preamble + css; return preamble + css;
let selectors = filter.map(function (part) let selectors = filter.map(function (part)
!/^(?:[a-z-]+[:*]|[a-z-.]+$)/i.test(part) ? "regexp(" + (".*(?:" + part + ").*").quote() + ")" : !/^(?:[a-z-]+[:*]|[a-z-.]+$)/i.test(part) ? "regexp(" + Styles.quote(".*(?:" + part + ").*") + ")" :
(/[*]$/.test(part) ? "url-prefix" : (/[*]$/.test(part) ? "url-prefix" :
/[\/:]/.test(part) ? "url" /[\/:]/.test(part) ? "url"
: "domain") : "domain")
+ '("' + part.replace(/"/g, "%22").replace(/\*$/, "") + '")') + '(' + Styles.quote(part.replace(/\*$/, "")) + ')')
.join(",\n "); .join(",\n ");
return preamble + "@-moz-document " + selectors + " {\n\n" + css + "\n\n}\n"; return preamble + "@-moz-document " + selectors + " {\n\n" + css + "\n\n}\n";
@@ -530,7 +530,17 @@ var Styles = Module("Styles", {
| [^;}\s]+ | [^;}\s]+
) )
]]>, "gix", this) ]]>, "gix", this)
}) }),
/**
* Quotes a string for use in CSS stylesheets.
*
* @param {string} str
* @returns {string}
*/
quote: function quote(str) {
return '"' + str.replace(/([\\"])/g, "\\$1").replace(/\n/g, "\\00000a") + '"';
},
}, { }, {
commands: function (dactyl, modules, window) { commands: function (dactyl, modules, window) {
const { commands, contexts, styles } = modules; const { commands, contexts, styles } = modules;