X-Git-Url: https://git.donarmstrong.com/dactyl.git?a=blobdiff_plain;f=common%2Fmodules%2Fhighlight.jsm;h=7d6cfaf03cf61a7cef814116d9128b535cc169b7;hb=9044153cb63835e39b9de8ec4ade237c03e3888a;hp=73b6b06ae7cf35ed166aa9b003e442d3285538bd;hpb=70740024f9c028c1fd63e1a1850ab062ff956054;p=dactyl.git
diff --git a/common/modules/highlight.jsm b/common/modules/highlight.jsm
index 73b6b06..7d6cfaf 100644
--- a/common/modules/highlight.jsm
+++ b/common/modules/highlight.jsm
@@ -2,15 +2,16 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
-"use strict";
+/* use strict */
Components.utils.import("resource://dactyl/bootstrap.jsm");
defineModule("highlight", {
exports: ["Highlight", "Highlights", "highlight"],
- require: ["services", "styles", "util"],
- use: ["messages", "template"]
+ require: ["services", "util"]
}, this);
+this.lazyRequire("styles", ["Styles", "styles"]);
+
var Highlight = Struct("class", "selector", "sites",
"defaultExtends", "defaultValue",
"value", "extends", "agent",
@@ -152,7 +153,7 @@ var Highlights = Module("Highlight", {
let highlight = this.highlight[key] || this._create(false, [key]);
- let bases = extend || highlight.extend;
+ let bases = extend || highlight.extends;
if (append) {
newStyle = Styles.append(highlight.value || "", newStyle);
bases = highlight.extends.concat(bases);
@@ -349,7 +350,7 @@ var Highlights = Module("Highlight", {
"text-align: center"],
([h.class,
XXX,
- template.map(h.extends, template.highlight),
+ template.map(h.extends, function (s) template.highlight(s), <>,>),
template.highlightRegexp(h.value, /\b[-\w]+(?=:)|\/\*.*?\*\//g,
function (match) {match})
]
@@ -404,7 +405,10 @@ var Highlights = Module("Highlight", {
{
command: this.name,
arguments: [v.class],
- literalArg: v.value
+ literalArg: v.value,
+ options: {
+ "-link": v.extends.length ? v.extends : undefined
+ }
}
for (v in Iterator(highlight))
if (v.value != v.defaultValue)