diff --git a/common/modules/bookmarkcache.jsm b/common/modules/bookmarkcache.jsm index 175ce1ad..d48f15dd 100644 --- a/common/modules/bookmarkcache.jsm +++ b/common/modules/bookmarkcache.jsm @@ -7,9 +7,11 @@ Components.utils.import("resource://dactyl/bootstrap.jsm"); defineModule("bookmarkcache", { exports: ["Bookmark", "BookmarkCache", "Keyword", "bookmarkcache"], - require: ["services", "storage", "util"] + require: ["services", "util"] }, this); +this.lazyRequire("storage", ["storage"]); + function newURI(url, charset, base) { try { return services.io.newURI(url, charset, base); diff --git a/common/modules/config.jsm b/common/modules/config.jsm index fbcbcea6..5ebd0ef8 100644 --- a/common/modules/config.jsm +++ b/common/modules/config.jsm @@ -10,7 +10,7 @@ let global = this; Components.utils.import("resource://dactyl/bootstrap.jsm"); defineModule("config", { exports: ["ConfigBase", "Config", "config"], - require: ["dom", "protocol", "services", "storage", "util", "template"] + require: ["dom", "io", "protocol", "services", "util", "template"] }, this); this.lazyRequire("addons", ["AddonManager"]); @@ -18,6 +18,7 @@ this.lazyRequire("cache", ["cache"]); this.lazyRequire("highlight", ["highlight"]); this.lazyRequire("messages", ["_"]); this.lazyRequire("prefs", ["localPrefs", "prefs"]); +this.lazyRequire("storage", ["storage", "File"]); function AboutHandler() {} AboutHandler.prototype = { diff --git a/common/modules/help.jsm b/common/modules/help.jsm index ceedf0c8..dcda5d7c 100644 --- a/common/modules/help.jsm +++ b/common/modules/help.jsm @@ -7,7 +7,7 @@ Components.utils.import("resource://dactyl/bootstrap.jsm"); defineModule("help", { exports: ["help"], - require: ["cache", "dom", "javascript", "protocol", "services", "util"] + require: ["cache", "dom", "protocol", "services", "util"] }, this); this.lazyRequire("completion", ["completion"]); @@ -290,7 +290,7 @@ var Help = Module("Help", { dactyl.open("dactyl://help/" + page, { from: "help" }); }, - exportHelp: JavaScript.setCompleter(function (path) { + exportHelp: function (path) { const FILE = io.File(path); const PATH = FILE.leafName.replace(/\..*/, "") + "/"; const TIME = Date.now(); @@ -401,7 +401,7 @@ var Help = Module("Help", { if (zip) zip.close(); - }, [function (context, args) overlay.activeModules.completion.file(context)]), + } }) }, { @@ -455,6 +455,10 @@ var Help = Module("Help", { mappings.add([modes.MAIN], ["", ""], "Open the single, consolidated help page", function () { modules.ex.helpall(); }); + }, + javascript: function init_javascript(dactyl, modules, window) { + modules.JavaScript.setCompleter([this.exportHelp], + [function (context, args) overlay.activeModules.completion.file(context)]); } }); diff --git a/common/modules/highlight.jsm b/common/modules/highlight.jsm index fbfa87f9..4d0bb2ae 100644 --- a/common/modules/highlight.jsm +++ b/common/modules/highlight.jsm @@ -7,9 +7,11 @@ Components.utils.import("resource://dactyl/bootstrap.jsm"); defineModule("highlight", { exports: ["Highlight", "Highlights", "highlight"], - require: ["services", "styles", "util"] + require: ["services", "util"] }, this); +this.lazyRequire("styles", ["Styles", "styles"]); + var Highlight = Struct("class", "selector", "sites", "defaultExtends", "defaultValue", "value", "extends", "agent", diff --git a/common/modules/io.jsm b/common/modules/io.jsm index 85271b4d..29457613 100644 --- a/common/modules/io.jsm +++ b/common/modules/io.jsm @@ -28,7 +28,7 @@ var IO = Module("io", { this._processDir = services.directory.get("CurWorkD", Ci.nsIFile); this._cwd = this._processDir.path; this._oldcwd = null; - this.config = config; + lazyRequire("config", ["config"], this); }, Local: function Local(dactyl, modules, window) let ({ io, plugins } = modules) ({ diff --git a/common/modules/main.jsm b/common/modules/main.jsm index 5c222325..834551eb 100644 --- a/common/modules/main.jsm +++ b/common/modules/main.jsm @@ -9,7 +9,7 @@ try { Components.utils.import("resource://dactyl/bootstrap.jsm"); defineModule("main", { exports: ["ModuleBase"], - require: ["config", "help", "highlight", "io", "overlay", "services", "util"] + require: ["config", "overlay", "services", "util"] }, this); var BASE = "resource://dactyl-content/"; diff --git a/common/modules/sanitizer.jsm b/common/modules/sanitizer.jsm index ba18674f..38f70cb7 100644 --- a/common/modules/sanitizer.jsm +++ b/common/modules/sanitizer.jsm @@ -15,10 +15,12 @@ Components.utils.import("resource://dactyl/bootstrap.jsm"); defineModule("sanitizer", { exports: ["Range", "Sanitizer", "sanitizer"], - require: ["config", "prefs", "services", "storage", "template", "util"] + require: ["config", "prefs", "services", "util"] }, this); this.lazyRequire("messages", ["_"]); +this.lazyRequire("storage", ["storage"]); +this.lazyRequire("template", ["teplate"]); let tmp = {}; JSMLoader.loadSubScript("chrome://browser/content/sanitize.js", tmp); diff --git a/pentadactyl/content/config.js b/pentadactyl/content/config.js index 6d8b200c..44e0fb9a 100644 --- a/pentadactyl/content/config.js +++ b/pentadactyl/content/config.js @@ -37,8 +37,6 @@ var Config = Module("config", ConfigBase, { function () { window.toErrorConsole(); }], history: ["List your history", function () { window.openDialog("chrome://browser/content/history/history-panel.xul", "History", "dialog,centerscreen,width=600,height=600"); }], - import: ["Import Preferences, Bookmarks, History, etc. from other browsers", - function () { window.BrowserImport(); }], openfile: ["Open the file selector dialog", function () { window.BrowserOpenFileWindow(); }], pageinfo: ["Show information about the current page",