diff options
author | Daniel Bainton <dpb@driftaway.org> | 2008-12-04 07:56:35 +0200 |
---|---|---|
committer | Daniel Bainton <dpb@driftaway.org> | 2008-12-04 07:56:35 +0200 |
commit | 729854c749e46bf97a97951614d96cfee302cd9d (patch) | |
tree | 6a64a10b3303ff7f5b0d3e4d5398a7544b0f58ff /common/content/liberator-overlay.js | |
parent | cc6bdfc2fcaa42186dddac10ed96046e4dc7c5f3 (diff) | |
download | pentadactyl-729854c749e46bf97a97951614d96cfee302cd9d.tar.gz |
Rename liberator/ to common/
Diffstat (limited to 'common/content/liberator-overlay.js')
-rw-r--r-- | common/content/liberator-overlay.js | 58 |
1 files changed, 58 insertions, 0 deletions
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: |