Stop using $.extend for Style

This commit is contained in:
Zixaphir 2013-08-06 18:22:46 -07:00
parent 7d20ee32c4
commit 24d2f47c52
3 changed files with 41 additions and 28 deletions

View File

@ -11568,22 +11568,24 @@
});
}
},
addSheet: function(_arg) {
var id, key, text;
key = _arg[0], text = _arg[1], id = _arg[2];
return Style[key] = $.addStyle(text, id);
},
setup: function() {
var theme;
var i, item, items, theme;
theme = Themes[Conf['theme']] || Themes['Yotsuba B'];
Style.svg = $.el('div', {
id: 'svg_filters'
});
$.extend(Style, {
layoutCSS: $.addStyle(Style.layout, 'layout'),
themeCSS: $.addStyle(Style.theme(theme), 'theme'),
emojiCSS: $.addStyle(Emoji.css(), 'emoji'),
dynamicCSS: $.addStyle(Style.dynamic(), 'dynamic'),
icons: $.addStyle("", 'icons'),
paddingSheet: $.addStyle("", 'padding'),
mascot: $.addStyle("", 'mascotSheet')
});
items = [['layoutCSS', Style.layout, 'layout'], ['themeCSS', Style.theme(theme), 'theme'], ['emojiCSS', Emoji.css(), 'emoji'], ['dynamicCSS', Style.dynamic(), 'dynamic'], ['icons', "", 'icons'], ['paddingSheet', "", 'padding'], ['mascot', "", 'mascotSheet']];
i = 0;
while (item = items[i++]) {
Style.addSheet(item);
}
$.addStyle(JSColor.css(), 'jsColor');
if (d.head) {
this.remStyle();

View File

@ -11556,22 +11556,24 @@
});
}
},
addSheet: function(_arg) {
var id, key, text;
key = _arg[0], text = _arg[1], id = _arg[2];
return Style[key] = $.addStyle(text, id);
},
setup: function() {
var theme;
var i, item, items, theme;
theme = Themes[Conf['theme']] || Themes['Yotsuba B'];
Style.svg = $.el('div', {
id: 'svg_filters'
});
$.extend(Style, {
layoutCSS: $.addStyle(Style.layout, 'layout'),
themeCSS: $.addStyle(Style.theme(theme), 'theme'),
emojiCSS: $.addStyle(Emoji.css(), 'emoji'),
dynamicCSS: $.addStyle(Style.dynamic(), 'dynamic'),
icons: $.addStyle("", 'icons'),
paddingSheet: $.addStyle("", 'padding'),
mascot: $.addStyle("", 'mascotSheet')
});
items = [['layoutCSS', Style.layout, 'layout'], ['themeCSS', Style.theme(theme), 'theme'], ['emojiCSS', Emoji.css(), 'emoji'], ['dynamicCSS', Style.dynamic(), 'dynamic'], ['icons', "", 'icons'], ['paddingSheet', "", 'padding'], ['mascot', "", 'mascotSheet']];
i = 0;
while (item = items[i++]) {
Style.addSheet(item);
}
$.addStyle(JSColor.css(), 'jsColor');
if (d.head) {
this.remStyle();

View File

@ -47,18 +47,27 @@ Style =
$.on exLink, "click", ->
setTimeout Rice.nodes, 100
addSheet: ([key, text, id]) ->
Style[key] = $.addStyle text, id
setup: ->
theme = Themes[Conf['theme']] or Themes['Yotsuba B']
Style.svg = $.el 'div',
id: 'svg_filters'
$.extend Style,
layoutCSS: $.addStyle Style.layout, 'layout'
themeCSS: $.addStyle Style.theme(theme), 'theme'
emojiCSS: $.addStyle Emoji.css(), 'emoji'
dynamicCSS: $.addStyle Style.dynamic(), 'dynamic'
icons: $.addStyle "", 'icons'
paddingSheet: $.addStyle "", 'padding'
mascot: $.addStyle "", 'mascotSheet'
items = [
['layoutCSS', Style.layout, 'layout']
['themeCSS', Style.theme(theme), 'theme']
['emojiCSS', Emoji.css(), 'emoji']
['dynamicCSS', Style.dynamic(), 'dynamic']
['icons', "", 'icons']
['paddingSheet', "", 'padding']
['mascot', "", 'mascotSheet']
]
i = 0
while item = items[i++]
Style.addSheet item
# Non-customizable
$.addStyle JSColor.css(), 'jsColor'