//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
Components.utils.import("resource://dactyl/bootstrap.jsm");
defineModule("highlight", {
exports: ["Highlight", "Highlights", "highlight"],
Components.utils.import("resource://dactyl/bootstrap.jsm");
defineModule("highlight", {
exports: ["Highlight", "Highlights", "highlight"],
- require: ["services", "styles", "util"],
- use: ["messages", "template"]
+ require: ["services", "util"]
var Highlight = Struct("class", "selector", "sites",
"defaultExtends", "defaultValue",
"value", "extends", "agent",
var Highlight = Struct("class", "selector", "sites",
"defaultExtends", "defaultValue",
"value", "extends", "agent",
if (append) {
newStyle = Styles.append(highlight.value || "", newStyle);
bases = highlight.extends.concat(bases);
if (append) {
newStyle = Styles.append(highlight.value || "", newStyle);
bases = highlight.extends.concat(bases);
- 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>)
]
template.highlightRegexp(h.value, /\b[-\w]+(?=:)|\/\*.*?\*\//g,
function (match) <span highlight={match[0] == "/" ? "Comment" : "Key"}>{match}</span>)
]