Stop using $.extend for Style
This commit is contained in:
parent
7d20ee32c4
commit
24d2f47c52
@ -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();
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user