1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 02:17:59 +01:00

Hackier but more reliable literal() stuff.

This commit is contained in:
Kris Maglione
2014-06-18 12:24:55 -07:00
parent fdf188166d
commit cde8cd6763
15 changed files with 66 additions and 63 deletions

View File

@@ -215,18 +215,18 @@ var Abbreviations = Module("abbreviations", {
nonkeyword: /[ "']/
};
this._match = util.regexp(literal(/*
this._match = util.regexp(literal(function () /*
(^ | \s | <nonkeyword>) (<keyword>+ )$ | // full-id
(^ | \s | <keyword> ) (<nonkeyword>+ <keyword>)$ | // end-id
(^ | \s ) (\S* <nonkeyword> )$ // non-id
*/), "x", params);
this._check = util.regexp(literal(/*
*/$), "x", params);
this._check = util.regexp(literal(function () /*
^ (?:
<keyword>+ | // full-id
<nonkeyword>+ <keyword> | // end-id
\S* <nonkeyword> // non-id
) $
*/), "x", params);
*/$), "x", params);
},
get allHives() contexts.allGroups.abbrevs,

View File

@@ -54,9 +54,9 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
delete window.liberator;
// Prevents box ordering bugs after our stylesheet is removed.
styles.system.add("cleanup-sheet", config.styleableChrome, literal(/*
styles.system.add("cleanup-sheet", config.styleableChrome, literal(function () /*
#TabsToolbar tab { display: none; }
*/));
*/$));
styles.unregisterSheet("resource://dactyl-skin/dactyl.css");
DOM('#TabsToolbar tab', document).style.display;
},
@@ -1041,15 +1041,15 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
}, this);
},
stringToURLArray: deprecated("dactyl.parseURLs", "parseURLs"),
urlish: Class.Memoize(() => util.regexp(literal(/*
urlish: Class.Memoize(() => util.regexp(literal(function () /*
^ (
<domain>+ (:\d+)? (/ .*) |
<domain>+ (:\d+) |
<domain>+ \. [a-z0-9]+ |
localhost
) $
*/), "ix", {
domain: util.regexp(String.replace(literal(/*
*/$), "ix", {
domain: util.regexp(String.replace(literal(function () /*
[^
U0000-U002c // U002d-U002e --.
U002f // /
@@ -1058,7 +1058,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
U005b-U0060 // U0061-U007a A-Z
U007b-U007f
]
*/), /U/g, "\\u"), "x")
*/$), /U/g, "\\u"), "x")
})),
pluginFiles: {},

View File

@@ -38,20 +38,20 @@ var StatusLine = Module("statusline", {
config.tabbrowser.getStatusPanel().hidden = true;
if (this.statusBar.localName == "toolbar") {
styles.system.add("addon-bar", config.styleableChrome, literal(/*
styles.system.add("addon-bar", config.styleableChrome, literal(function () /*
#status-bar, #dactyl-status-bar { margin-top: 0 !important; }
#dactyl-status-bar { min-height: 0 !important; }
:-moz-any(#addon-bar, #dactyl-addon-bar) > statusbar { -moz-box-flex: 1 }
:-moz-any(#addon-bar, #dactyl-addon-bar) > xul|toolbarspring { visibility: collapse; }
#addon-bar > #addonbar-closebutton { visibility: collapse; }
*/));
*/$));
overlay.overlayWindow(window, {
append: [
["statusbar", { id: this._statusLine.id, ordinal: "0" }]]
});
highlight.loadCSS(util.compileMacro(literal(/*
highlight.loadCSS(util.compileMacro(literal(function () /*
!AddonBar;#addon-bar,#dactyl-addon-bar {
padding-left: 0 !important;
padding-top: 0 !important;
@@ -68,12 +68,12 @@ var StatusLine = Module("statusline", {
color: inherit !important;
}
AddonButton:not(:hover) background: transparent;
*/))({ padding: config.OS.isMacOSX ? "padding-right: 10px !important;" : "" }));
*/$))({ padding: config.OS.isMacOSX ? "padding-right: 10px !important;" : "" }));
if (document.getElementById("appmenu-button"))
highlight.loadCSS(literal(/*
highlight.loadCSS(literal(function () /*
AppmenuButton min-width: 0 !important; padding: 0 .5em !important;
*/));
*/$));
}
let _commandline = "if (window.dactyl) return dactyl.modules.commandline";

View File

@@ -36,9 +36,9 @@ var Tabs = Module("tabs", {
tabs.switchTo(event.originalTarget.getAttribute("identifier"));
};
this.tabBinding = styles.system.add("tab-binding", "chrome://browser/content/browser.xul", literal(/*
this.tabBinding = styles.system.add("tab-binding", "chrome://browser/content/browser.xul", literal(function () /*
xul|tab { -moz-binding: url(chrome://dactyl/content/bindings.xml#tab) !important; }
*/).replace(/tab-./g, m => config.OS.isMacOSX ? "tab-mac" : m),
*/$).replace(/tab-./g, m => config.OS.isMacOSX ? "tab-mac" : m),
false, true);
this.timeout(function () {