//
// 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",
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);
"text-align: center"],
([h.class,
<span style={"text-align: center; line-height: 1em;" + h.value + style}>XXX</span>,
- template.map(h.extends, template.highlight),
+ template.map(h.extends, function (s) template.highlight(s), <>,</>),
template.highlightRegexp(h.value, /\b[-\w]+(?=:)|\/\*.*?\*\//g,
function (match) <span highlight={match[0] == "/" ? "Comment" : "Key"}>{match}</span>)
]
{
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)