1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 10:37:59 +01:00
Files
pentadactyl-pm/common/content/liberator-overlay.js
2009-11-15 02:08:10 -05:00

66 lines
1.7 KiB
JavaScript

// Copyright (c) 2008-2009 Kris Maglione <maglione.k at Gmail>
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
(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");
dump(e.stack + "\n");
}
}
}
let prefix = [BASE];
["base.js",
"modules.js",
"autocommands.js",
"buffer.js",
"commandline.js",
"commands.js",
"completion.js",
"configbase.js",
"config.js",
"liberator.js",
"editor.js",
"events.js",
"finder.js",
"hints.js",
"io.js",
"javascript.js",
"mappings.js",
"marks.js",
"modes.js",
"options.js",
"services.js",
"statusline.js",
"style.js",
"template.js",
"util.js",
].forEach(load);
prefix.unshift("chrome://" + modules.Config.prototype.name.toLowerCase() + "/content/");
modules.Config.prototype.scripts.forEach(load);
})();
// vim: set fdm=marker sw=4 ts=4 et: