From 729854c749e46bf97a97951614d96cfee302cd9d Mon Sep 17 00:00:00 2001 From: Daniel Bainton Date: Thu, 4 Dec 2008 07:56:35 +0200 Subject: Rename liberator/ to common/ --- common/content/liberator-overlay.js | 58 +++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 common/content/liberator-overlay.js (limited to 'common/content/liberator-overlay.js') diff --git a/common/content/liberator-overlay.js b/common/content/liberator-overlay.js new file mode 100644 index 00000000..5175b75b --- /dev/null +++ b/common/content/liberator-overlay.js @@ -0,0 +1,58 @@ + +(function () { + const modules = {}; + const BASE = "chrome://liberator/content/"; + + modules.modules = modules; + + const loader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"] + .getService(Components.interfaces.mozIJSSubScriptLoader); + function load(script) + { + for (let [i, base] in Iterator(prefix)) + { + try + { + loader.loadSubScript(base + script, modules) + return; + } + catch (e) + { + if (i + 1 < prefix.length) + continue; + if (Components.utils.reportError) + Components.utils.reportError(e); + dump("liberator: Loading script " + script + ": " + e + "\n"); + } + } + } + + Components.utils.import("resource://liberator/storage.jsm", modules); + + let prefix = [BASE]; + + ["liberator.js", + "config.js", + "util.js", + "style.js", + "buffer.js", + "commands.js", + "completion.js", + "editor.js", + "events.js", + "find.js", + "hints.js", + "io.js", + "mappings.js", + "modes.js", + "options.js", + "template.js", + "ui.js"].forEach(load); + + prefix.unshift("chrome://" + modules.config.name.toLowerCase() + "/content/"); + if (modules.config.scripts) + modules.config.scripts.forEach(load); + +})() + +// vim: set fdm=marker sw=4 ts=4 et: -- cgit v1.2.3