Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/main.js

Issue 5684127030312960: Issue 1091 - Implement a better templating approach for Element Hiding Helper (Closed)
Patch Set: Switched to a functional approach Created Sept. 11, 2014, 4:50 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/aardvark.js ('k') | lib/windowWrapper.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/main.js
===================================================================
--- a/lib/main.js
+++ b/lib/main.js
@@ -28,16 +28,17 @@ let elementMarkerClass = null;
{
let rnd = [];
let offset = "a".charCodeAt(0);
for (let i = 0; i < 20; i++)
rnd.push(offset + Math.random() * 26);
elementMarkerClass = String.fromCharCode.apply(String, rnd);
}
+exports.elementMarkerClass = elementMarkerClass;
// Load CSS asynchronously
let request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Ci.nsIXMLHttpRequest);
request.open("GET", "chrome://elemhidehelper/content/elementmarker.css");
request.overrideMimeType("text/plain");
request.addEventListener("load", function(event)
{
if (onShutdown.done)
@@ -70,17 +71,17 @@ request.addEventListener("load", functio
if (!(type in knownWindowTypes) || window._ehhWrapper)
return;
window.document.documentElement.appendChild(overlay.cloneNode(true));
let style = window.document.createProcessingInstruction("xml-stylesheet", 'class="elemhidehelper-node" href="chrome://elemhidehelper/skin/overlay.css" type="text/css"');
window.document.insertBefore(style, window.document.firstChild);
- window._ehhWrapper = new WindowWrapper(window, elementMarkerClass);
+ window._ehhWrapper = new WindowWrapper(window);
},
removeFromWindow: function(window)
{
if (!window._ehhWrapper)
return;
window._ehhWrapper.shutdown();
« no previous file with comments | « lib/aardvark.js ('k') | lib/windowWrapper.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld