Fix style settings, incorrect main settings attribute
This commit is contained in:
parent
54c5b59946
commit
eda8a65132
@ -4369,29 +4369,27 @@
|
||||
}
|
||||
$.asap((function() {
|
||||
return $.id('boardNavMobile') || d.readyState !== 'loading';
|
||||
}), Header.setBoardList);
|
||||
}), _this.setBoardList);
|
||||
$.prepend(d.body, _this.bar);
|
||||
$.add(d.body, Header.hover);
|
||||
$.add(d.body, _this.hover);
|
||||
return _this.setBarPosition(Conf['Bottom Header']);
|
||||
};
|
||||
})(this));
|
||||
return $.ready((function(_this) {
|
||||
return function() {
|
||||
var a, footer, _i, _len, _ref, _results;
|
||||
if (a = $("a[href*='/" + g.BOARD + "/']", footer = $.id('boardNavDesktopFoot'))) {
|
||||
a.className = 'current';
|
||||
return $.ready(function() {
|
||||
var a, footer, _i, _len, _ref, _results;
|
||||
if (a = $("a[href*='/" + g.BOARD + "/']", footer = $.id('boardNavDesktopFoot'))) {
|
||||
a.className = 'current';
|
||||
}
|
||||
if (Conf['JSON Navigation']) {
|
||||
_ref = $$('a', footer);
|
||||
_results = [];
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
a = _ref[_i];
|
||||
_results.push($.on(a, 'click', Navigate.navigate));
|
||||
}
|
||||
if (Conf['JSON Navigation']) {
|
||||
_ref = $$('a', footer);
|
||||
_results = [];
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
a = _ref[_i];
|
||||
_results.push($.on(a, 'click', Navigate.navigate));
|
||||
}
|
||||
return _results;
|
||||
}
|
||||
};
|
||||
})(this));
|
||||
return _results;
|
||||
}
|
||||
});
|
||||
},
|
||||
bar: $.el('div', {
|
||||
id: 'header-bar'
|
||||
@ -4454,7 +4452,6 @@
|
||||
fullBoardList.normalize();
|
||||
btn = $('.hide-board-list-button', fullBoardList);
|
||||
$.on(btn, 'click', Header.toggleBoardList);
|
||||
$.rm($('#navtopright', fullBoardList));
|
||||
shortcuts = $.el('span', {
|
||||
id: 'shortcuts'
|
||||
});
|
||||
@ -5556,7 +5553,14 @@
|
||||
pageNum = null;
|
||||
}
|
||||
onload = function(e) {
|
||||
return Index.load(e, pageNum);
|
||||
var err;
|
||||
try {
|
||||
return Index.load(e, pageNum);
|
||||
} catch (_error) {
|
||||
err = _error;
|
||||
console.error(err.message);
|
||||
return console.error(err.stack);
|
||||
}
|
||||
};
|
||||
Index.req = $.ajax("//a.4cdn.org/" + g.BOARD.ID + "/catalog.json", {
|
||||
onabort: onload,
|
||||
@ -18845,7 +18849,7 @@
|
||||
div = $.el('div');
|
||||
$.add(div, [
|
||||
UI.checkbox(key, key, false), $.el('span', {
|
||||
"class": 'description',
|
||||
className: 'description',
|
||||
textContent: ": " + description
|
||||
})
|
||||
]);
|
||||
@ -19279,7 +19283,7 @@
|
||||
return $.cb.value.call(this);
|
||||
},
|
||||
style: function(section) {
|
||||
var arr, description, div, fs, html, input, inputs, items, key, name, nodes, obj, span, type, value, _i, _len, _ref;
|
||||
var arr, box, description, div, fs, html, input, inputs, items, key, name, nodes, obj, span, type, value, _i, _len, _ref;
|
||||
nodes = $.frag();
|
||||
items = {};
|
||||
inputs = {};
|
||||
@ -19317,7 +19321,8 @@
|
||||
textContent: description
|
||||
});
|
||||
span.style.display = 'none';
|
||||
$.add(div, [UI.checkbox(key, key), span]);
|
||||
$.add(div, [box = UI.checkbox(key, key), span]);
|
||||
box.className = 'option';
|
||||
input = $('input', div);
|
||||
}
|
||||
items[key] = Conf[key];
|
||||
|
||||
@ -4398,29 +4398,27 @@
|
||||
}
|
||||
$.asap((function() {
|
||||
return $.id('boardNavMobile') || d.readyState !== 'loading';
|
||||
}), Header.setBoardList);
|
||||
}), _this.setBoardList);
|
||||
$.prepend(d.body, _this.bar);
|
||||
$.add(d.body, Header.hover);
|
||||
$.add(d.body, _this.hover);
|
||||
return _this.setBarPosition(Conf['Bottom Header']);
|
||||
};
|
||||
})(this));
|
||||
return $.ready((function(_this) {
|
||||
return function() {
|
||||
var a, footer, _i, _len, _ref, _results;
|
||||
if (a = $("a[href*='/" + g.BOARD + "/']", footer = $.id('boardNavDesktopFoot'))) {
|
||||
a.className = 'current';
|
||||
return $.ready(function() {
|
||||
var a, footer, _i, _len, _ref, _results;
|
||||
if (a = $("a[href*='/" + g.BOARD + "/']", footer = $.id('boardNavDesktopFoot'))) {
|
||||
a.className = 'current';
|
||||
}
|
||||
if (Conf['JSON Navigation']) {
|
||||
_ref = $$('a', footer);
|
||||
_results = [];
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
a = _ref[_i];
|
||||
_results.push($.on(a, 'click', Navigate.navigate));
|
||||
}
|
||||
if (Conf['JSON Navigation']) {
|
||||
_ref = $$('a', footer);
|
||||
_results = [];
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
a = _ref[_i];
|
||||
_results.push($.on(a, 'click', Navigate.navigate));
|
||||
}
|
||||
return _results;
|
||||
}
|
||||
};
|
||||
})(this));
|
||||
return _results;
|
||||
}
|
||||
});
|
||||
},
|
||||
bar: $.el('div', {
|
||||
id: 'header-bar'
|
||||
@ -4483,7 +4481,6 @@
|
||||
fullBoardList.normalize();
|
||||
btn = $('.hide-board-list-button', fullBoardList);
|
||||
$.on(btn, 'click', Header.toggleBoardList);
|
||||
$.rm($('#navtopright', fullBoardList));
|
||||
shortcuts = $.el('span', {
|
||||
id: 'shortcuts'
|
||||
});
|
||||
@ -5585,7 +5582,14 @@
|
||||
pageNum = null;
|
||||
}
|
||||
onload = function(e) {
|
||||
return Index.load(e, pageNum);
|
||||
var err;
|
||||
try {
|
||||
return Index.load(e, pageNum);
|
||||
} catch (_error) {
|
||||
err = _error;
|
||||
console.error(err.message);
|
||||
return console.error(err.stack);
|
||||
}
|
||||
};
|
||||
Index.req = $.ajax("//a.4cdn.org/" + g.BOARD.ID + "/catalog.json", {
|
||||
onabort: onload,
|
||||
@ -18882,7 +18886,7 @@
|
||||
div = $.el('div');
|
||||
$.add(div, [
|
||||
UI.checkbox(key, key, false), $.el('span', {
|
||||
"class": 'description',
|
||||
className: 'description',
|
||||
textContent: ": " + description
|
||||
})
|
||||
]);
|
||||
@ -19314,7 +19318,7 @@
|
||||
return $.cb.value.call(this);
|
||||
},
|
||||
style: function(section) {
|
||||
var arr, description, div, fs, html, input, inputs, items, key, name, nodes, obj, span, type, value, _i, _len, _ref;
|
||||
var arr, box, description, div, fs, html, input, inputs, items, key, name, nodes, obj, span, type, value, _i, _len, _ref;
|
||||
nodes = $.frag();
|
||||
items = {};
|
||||
inputs = {};
|
||||
@ -19352,7 +19356,8 @@
|
||||
textContent: description
|
||||
});
|
||||
span.style.display = 'none';
|
||||
$.add(div, [UI.checkbox(key, key), span]);
|
||||
$.add(div, [box = UI.checkbox(key, key), span]);
|
||||
box.className = 'option';
|
||||
input = $('input', div);
|
||||
}
|
||||
items[key] = Conf[key];
|
||||
|
||||
@ -71,12 +71,12 @@ Header =
|
||||
return unless Main.isThisPageLegit()
|
||||
# Wait for #boardNavMobile instead of #boardNavDesktop,
|
||||
# it might be incomplete otherwise.
|
||||
$.asap (-> $.id('boardNavMobile') or d.readyState isnt 'loading'), Header.setBoardList
|
||||
$.asap (-> $.id('boardNavMobile') or d.readyState isnt 'loading'), @setBoardList
|
||||
$.prepend d.body, @bar
|
||||
$.add d.body, Header.hover
|
||||
$.add d.body, @hover
|
||||
@setBarPosition Conf['Bottom Header']
|
||||
|
||||
$.ready =>
|
||||
$.ready ->
|
||||
if a = $ "a[href*='/#{g.BOARD}/']", footer = $.id 'boardNavDesktopFoot'
|
||||
a.className = 'current'
|
||||
if Conf['JSON Navigation']
|
||||
@ -137,8 +137,6 @@ Header =
|
||||
btn = $ '.hide-board-list-button', fullBoardList
|
||||
$.on btn, 'click', Header.toggleBoardList
|
||||
|
||||
$.rm $ '#navtopright', fullBoardList
|
||||
|
||||
shortcuts = $.el 'span',
|
||||
id: 'shortcuts'
|
||||
|
||||
|
||||
@ -29,6 +29,7 @@ Index =
|
||||
{ el: $.el 'label', innerHTML: '<input type=radio name="Index Mode" value="infinite"> Infinite scrolling' }
|
||||
{ el: $.el 'label', innerHTML: '<input type=radio name="Index Mode" value="all pages"> All threads' }
|
||||
]
|
||||
|
||||
for label in modeEntry.subEntries
|
||||
input = label.el.firstChild
|
||||
input.checked = Conf['Index Mode'] is input.value
|
||||
@ -338,14 +339,14 @@ Index =
|
||||
|
||||
size: (e) ->
|
||||
if Conf['Index Mode'] isnt 'catalog'
|
||||
$.rmClass Index.root, 'catalog-small'
|
||||
$.rmClass Index.root, 'catalog-large'
|
||||
$.rmClass Index.root, 'catalog-small'
|
||||
$.rmClass Index.root, 'catalog-large'
|
||||
else if Conf['Index Size'] is 'small'
|
||||
$.addClass Index.root, 'catalog-small'
|
||||
$.rmClass Index.root, 'catalog-large'
|
||||
$.addClass Index.root, 'catalog-small'
|
||||
$.rmClass Index.root, 'catalog-large'
|
||||
else
|
||||
$.addClass Index.root, 'catalog-large'
|
||||
$.rmClass Index.root, 'catalog-small'
|
||||
$.addClass Index.root, 'catalog-large'
|
||||
$.rmClass Index.root, 'catalog-small'
|
||||
Index.buildIndex() if e
|
||||
|
||||
threadsNum: ->
|
||||
@ -545,7 +546,12 @@ Index =
|
||||
), 3 * $.SECOND - (Date.now() - now)
|
||||
|
||||
pageNum = null if typeof pageNum isnt 'number' # event
|
||||
onload = (e) -> Index.load e, pageNum
|
||||
onload = (e) ->
|
||||
try
|
||||
Index.load e, pageNum
|
||||
catch err
|
||||
console.error err.message
|
||||
console.error err.stack
|
||||
Index.req = $.ajax "//a.4cdn.org/#{g.BOARD.ID}/catalog.json",
|
||||
onabort: onload
|
||||
onloadend: onload
|
||||
|
||||
@ -13,7 +13,7 @@ Settings =
|
||||
order: 1
|
||||
|
||||
add = @addSection
|
||||
|
||||
|
||||
add 'Style', @style
|
||||
add 'Themes', @themes
|
||||
add 'Mascots', @mascots
|
||||
@ -122,7 +122,7 @@ Settings =
|
||||
div = $.el 'div'
|
||||
$.add div, [
|
||||
UI.checkbox key, key, false
|
||||
$.el 'span', class: 'description', textContent: ": #{description}"
|
||||
$.el 'span', className: 'description', textContent: ": #{description}"
|
||||
]
|
||||
input = $ 'input', div
|
||||
$.on $('label', div), 'mouseover', Settings.mouseover
|
||||
@ -183,7 +183,7 @@ Settings =
|
||||
return unless file = @files[0]
|
||||
unless confirm 'Your current settings will be entirely overwritten, are you sure?'
|
||||
new Notice 'info', "Import aborted.", 1
|
||||
return
|
||||
return
|
||||
|
||||
reader = new FileReader()
|
||||
reader.onload = (e) ->
|
||||
@ -471,14 +471,16 @@ Settings =
|
||||
span = $.el 'span',
|
||||
class: 'description'
|
||||
textContent: description
|
||||
|
||||
|
||||
span.style.display = 'none'
|
||||
|
||||
$.add div, [
|
||||
UI.checkbox key, key
|
||||
box = UI.checkbox key, key
|
||||
span
|
||||
]
|
||||
|
||||
|
||||
box.className = 'option'
|
||||
|
||||
input = $ 'input', div
|
||||
|
||||
items[key] = Conf[key]
|
||||
@ -534,7 +536,7 @@ Settings =
|
||||
div = $.el 'div',
|
||||
className: "theme #{if name is Conf[g.THEMESTRING] then 'selectedtheme' else ''}"
|
||||
id: name
|
||||
|
||||
|
||||
$.extend div, <%= importHTML('Settings/Theme') %>
|
||||
|
||||
div.style.backgroundColor = theme['Background Color']
|
||||
@ -554,7 +556,7 @@ Settings =
|
||||
|
||||
div = $.el 'div',
|
||||
id: 'addthemes'
|
||||
|
||||
|
||||
$.extend div, <%= importHTML('Settings/Batch-Theme') %>
|
||||
|
||||
$.on $("#newtheme", div), 'click', ->
|
||||
@ -585,7 +587,7 @@ Settings =
|
||||
div = $.el 'div',
|
||||
id: name
|
||||
className: theme
|
||||
|
||||
|
||||
$.extend div, <%= importHTML('Settings/Deleted-Theme') %>
|
||||
|
||||
$.on div, 'click', cb.restore
|
||||
@ -681,7 +683,7 @@ Settings =
|
||||
mascotEl = $.el 'div',
|
||||
id: name
|
||||
className: if name in Conf[g.MASCOTSTRING] then 'mascot enabled' else 'mascot'
|
||||
|
||||
|
||||
$.extend div, <%= importHTML('Settings/Mascot') %>
|
||||
|
||||
$.on mascotEl, 'click', cb.select
|
||||
@ -691,7 +693,7 @@ Settings =
|
||||
|
||||
batchmascots = $.el 'div',
|
||||
id: "mascots_batch"
|
||||
|
||||
|
||||
$.extend batchmascots, <%= importHTML('Settings/Batch-Mascot') %>
|
||||
|
||||
$.on $('#clear', batchmascots), 'click', ->
|
||||
@ -732,9 +734,9 @@ Settings =
|
||||
for name in keys when name in Conf["Deleted Mascots"]
|
||||
mascot = Mascots[name]
|
||||
mascotEl = $.el 'div',
|
||||
className: 'mascot'
|
||||
className: 'mascot'
|
||||
id: name
|
||||
|
||||
|
||||
$.extend mascotEl, <%= importHTML('Settings/Mascot') %>
|
||||
|
||||
$.on mascotEl, 'click', cb.restore
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user