mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-04-21 16:51:26 +02:00
Fix some startup issues.
This commit is contained in:
+19
-16
@@ -12,8 +12,8 @@ let global = this;
|
||||
Components.utils.import("resource://dactyl/bootstrap.jsm");
|
||||
defineModule("config", {
|
||||
exports: ["ConfigBase", "Config", "config"],
|
||||
require: ["highlight", "services", "storage", "util", "template"],
|
||||
use: ["highlight", "io"]
|
||||
require: ["services", "storage", "util", "template"],
|
||||
use: ["io"]
|
||||
}, this);
|
||||
|
||||
var ConfigBase = Class("ConfigBase", {
|
||||
@@ -22,8 +22,22 @@ var ConfigBase = Class("ConfigBase", {
|
||||
* initialization code. Must call superclass's init function.
|
||||
*/
|
||||
init: function init() {
|
||||
this.features.push = deprecated("set.add", function push(feature) set.add(this, feature));
|
||||
if (util.haveGecko("2b"))
|
||||
set.add(this.features, "Gecko2");
|
||||
|
||||
this.timeout(function () {
|
||||
services["dactyl:"].pages.dtd = function () [null,
|
||||
iter(config.dtdExtra,
|
||||
(["dactyl." + k, v] for ([k, v] in iter(config.dtd))),
|
||||
(["dactyl." + s, config[s]] for each (s in config.dtdStrings)))
|
||||
.map(function ([k, v]) ["<!ENTITY ", k, " '", String.replace(v, /'/g, "'"), "'>"].join(""))
|
||||
.join("\n")]
|
||||
});
|
||||
},
|
||||
|
||||
loadStyles: function loadStyles() {
|
||||
const { highlight } = require("highlight");
|
||||
highlight.styleableChrome = this.styleableChrome;
|
||||
highlight.loadCSS(this.CSS);
|
||||
highlight.loadCSS(this.helpCSS);
|
||||
@@ -37,20 +51,6 @@ var ConfigBase = Class("ConfigBase", {
|
||||
text-shadow: black -1px 0 1px, black 0 1px 1px, black 1px 0 1px, black 0 -1px 1px;
|
||||
}
|
||||
]]>);
|
||||
});
|
||||
|
||||
this.features.push = deprecated("set.add", function push(feature) set.add(this, feature));
|
||||
if (util.haveGecko("2b"))
|
||||
set.add(this.features, "Gecko2");
|
||||
|
||||
this.timeout(function () {
|
||||
services["dactyl:"].pages.dtd = function () [null,
|
||||
iter(config.dtdExtra,
|
||||
(["dactyl." + k, v] for ([k, v] in iter(config.dtd))),
|
||||
(["dactyl." + s, config[s]] for each (s in config.dtdStrings)))
|
||||
.map(function ([k, v]) ["<!ENTITY ", k, " '", String.replace(v, /'/g, "'"), "'>"].join(""))
|
||||
.join("\n")]
|
||||
});
|
||||
},
|
||||
|
||||
get addonID() this.name + "@dactyl.googlecode.com",
|
||||
@@ -169,6 +169,7 @@ var ConfigBase = Class("ConfigBase", {
|
||||
],
|
||||
|
||||
styleHelp: function styleHelp() {
|
||||
const { highlight } = require("highlight");
|
||||
if (!this.helpStyled)
|
||||
for (let k in keys(highlight.loaded))
|
||||
if (/^(Help|StatusLine)|^(Boolean|Indicator|MoreMsg|Number|Logo|Key(word)?|String)$/.test(k))
|
||||
@@ -726,6 +727,8 @@ config.INIT = update(Object.create(config.INIT), config.INIT, {
|
||||
|
||||
endModule();
|
||||
|
||||
config.loadStyles();
|
||||
|
||||
} catch(e){ if (isString(e)) e = Error(e); dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack); }
|
||||
|
||||
// vim: set fdm=marker sw=4 sts=4 et ft=javascript:
|
||||
|
||||
Reference in New Issue
Block a user