X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=common%2Fmodules%2Fhighlight.jsm;h=501edde272d2406b3f2043df60678caa0ce2f3e5;hb=247daf849abc85f4cfb10fa358c62c8daf8db95b;hp=e25b7cc1f5d71adee0103944a26321b8326be465;hpb=354a049cce8415487552ce405cce167b7071fe1f;p=dactyl.git diff --git a/common/modules/highlight.jsm b/common/modules/highlight.jsm index e25b7cc..501edde 100644 --- a/common/modules/highlight.jsm +++ b/common/modules/highlight.jsm @@ -1,4 +1,4 @@ -// Copyright (c) 2008-2013 Kris Maglione +// Copyright (c) 2008-2014 Kris Maglione // // This work is licensed for reuse under an MIT license. Details are // given in the LICENSE.txt file included with this file. @@ -125,7 +125,7 @@ var Highlights = Module("Highlight", { if (/^[[>+: ]/.test(args[1])) obj.selector = this.selector(obj.class) + args[1]; else if (args[1]) - obj.selector = this.selector(args[1]); + obj.selector = this.selector(args[1].replace(/^,/, "")); if (old && old.value != old.defaultValue) obj.value = old.value; @@ -134,8 +134,12 @@ var Highlights = Module("Highlight", { obj.style.enabled = true; else this.loaded.__defineSetter__(obj.class, function () { - delete this[obj.class]; - this[obj.class] = true; + Object.defineProperty(this, obj.class, { + value: true, + configurable: true, + enumerable: true, + writable: true + }); if (obj.class === obj.baseClass) for (let h in highlight) @@ -200,11 +204,11 @@ var Highlights = Module("Highlight", { node.setAttributeNS(NS, "highlight", group); let groups = group.split(" "); - for each (let group in groups) + for (let group of groups) this.loaded[group] = true; if (applyBindings) - for each (let group in groups) { + for (let group of groups) { if (applyBindings.bindings && group in applyBindings.bindings) applyBindings.bindings[group](node, applyBindings); else if (group in template.bindings) @@ -275,7 +279,7 @@ var Highlights = Module("Highlight", { * If Star is provided, the style is applied as an agent sheet. * * The new styles are lazily activated unless Bang or *eager* is - * provided. See {@link Util#xmlToDom}. + * provided. * * @param {string} css The rules to load. See {@link Highlights#css}. * @param {boolean} eager When true, load all provided rules immediately.