mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 16:22:27 +01:00
Add liberator.modules namespace, load scripts via subscript loader, report better errors on :so with here docs, beep when clicking an input field in command line mode.
This commit is contained in:
45
content/liberator-overlay.js
Normal file
45
content/liberator-overlay.js
Normal file
@@ -0,0 +1,45 @@
|
||||
|
||||
(function () {
|
||||
const modules = {};
|
||||
const BASE = "chrome://liberator/content/";
|
||||
|
||||
modules.modules = modules;
|
||||
|
||||
var loader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
|
||||
.getService(Components.interfaces.mozIJSSubScriptLoader);
|
||||
function load(script) {
|
||||
try
|
||||
{
|
||||
dump("liberator: Loading script: " + script + "\n");
|
||||
loader.loadSubScript(BASE + script, modules)
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
if (Components.utils.reportError)
|
||||
Components.utils.reportError(e);
|
||||
dump("liberator: Loading script " + script + ": " + e + "\n");
|
||||
}
|
||||
}
|
||||
|
||||
Components.utils.import("resource://liberator/storage.jsm", modules);
|
||||
|
||||
["liberator.js",
|
||||
"config.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",
|
||||
"util.js"].forEach(load);
|
||||
modules.config.scripts.forEach(load);
|
||||
|
||||
})()
|
||||
|
||||
Reference in New Issue
Block a user