mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-23 17:13:31 +01:00
Fix some startup issues.
This commit is contained in:
@@ -12,8 +12,8 @@ let global = this;
|
|||||||
Components.utils.import("resource://dactyl/bootstrap.jsm");
|
Components.utils.import("resource://dactyl/bootstrap.jsm");
|
||||||
defineModule("config", {
|
defineModule("config", {
|
||||||
exports: ["ConfigBase", "Config", "config"],
|
exports: ["ConfigBase", "Config", "config"],
|
||||||
require: ["highlight", "services", "storage", "util", "template"],
|
require: ["services", "storage", "util", "template"],
|
||||||
use: ["highlight", "io"]
|
use: ["io"]
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
var ConfigBase = Class("ConfigBase", {
|
var ConfigBase = Class("ConfigBase", {
|
||||||
@@ -22,23 +22,6 @@ var ConfigBase = Class("ConfigBase", {
|
|||||||
* initialization code. Must call superclass's init function.
|
* initialization code. Must call superclass's init function.
|
||||||
*/
|
*/
|
||||||
init: function init() {
|
init: function init() {
|
||||||
|
|
||||||
this.timeout(function () {
|
|
||||||
highlight.styleableChrome = this.styleableChrome;
|
|
||||||
highlight.loadCSS(this.CSS);
|
|
||||||
highlight.loadCSS(this.helpCSS);
|
|
||||||
if (!util.haveGecko("2b"))
|
|
||||||
highlight.loadCSS(<![CDATA[
|
|
||||||
!TabNumber font-weight: bold; margin: 0px; padding-right: .8ex;
|
|
||||||
!TabIconNumber {
|
|
||||||
font-weight: bold;
|
|
||||||
color: white;
|
|
||||||
text-align: center;
|
|
||||||
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));
|
this.features.push = deprecated("set.add", function push(feature) set.add(this, feature));
|
||||||
if (util.haveGecko("2b"))
|
if (util.haveGecko("2b"))
|
||||||
set.add(this.features, "Gecko2");
|
set.add(this.features, "Gecko2");
|
||||||
@@ -53,6 +36,23 @@ var ConfigBase = Class("ConfigBase", {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
loadStyles: function loadStyles() {
|
||||||
|
const { highlight } = require("highlight");
|
||||||
|
highlight.styleableChrome = this.styleableChrome;
|
||||||
|
highlight.loadCSS(this.CSS);
|
||||||
|
highlight.loadCSS(this.helpCSS);
|
||||||
|
if (!util.haveGecko("2b"))
|
||||||
|
highlight.loadCSS(<![CDATA[
|
||||||
|
!TabNumber font-weight: bold; margin: 0px; padding-right: .8ex;
|
||||||
|
!TabIconNumber {
|
||||||
|
font-weight: bold;
|
||||||
|
color: white;
|
||||||
|
text-align: center;
|
||||||
|
text-shadow: black -1px 0 1px, black 0 1px 1px, black 1px 0 1px, black 0 -1px 1px;
|
||||||
|
}
|
||||||
|
]]>);
|
||||||
|
},
|
||||||
|
|
||||||
get addonID() this.name + "@dactyl.googlecode.com",
|
get addonID() this.name + "@dactyl.googlecode.com",
|
||||||
addon: Class.memoize(function () {
|
addon: Class.memoize(function () {
|
||||||
let addon;
|
let addon;
|
||||||
@@ -169,6 +169,7 @@ var ConfigBase = Class("ConfigBase", {
|
|||||||
],
|
],
|
||||||
|
|
||||||
styleHelp: function styleHelp() {
|
styleHelp: function styleHelp() {
|
||||||
|
const { highlight } = require("highlight");
|
||||||
if (!this.helpStyled)
|
if (!this.helpStyled)
|
||||||
for (let k in keys(highlight.loaded))
|
for (let k in keys(highlight.loaded))
|
||||||
if (/^(Help|StatusLine)|^(Boolean|Indicator|MoreMsg|Number|Logo|Key(word)?|String)$/.test(k))
|
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();
|
endModule();
|
||||||
|
|
||||||
|
config.loadStyles();
|
||||||
|
|
||||||
} catch(e){ if (isString(e)) e = Error(e); dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack); }
|
} 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:
|
// vim: set fdm=marker sw=4 sts=4 et ft=javascript:
|
||||||
|
|||||||
Reference in New Issue
Block a user