Fix style settings, incorrect main settings attribute

This commit is contained in:
Zixaphir 2015-01-10 02:58:42 -07:00
parent 54c5b59946
commit eda8a65132
5 changed files with 87 additions and 71 deletions

View File

@ -4369,14 +4369,13 @@
}
$.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() {
return $.ready(function() {
var a, footer, _i, _len, _ref, _results;
if (a = $("a[href*='/" + g.BOARD + "/']", footer = $.id('boardNavDesktopFoot'))) {
a.className = 'current';
@ -4390,8 +4389,7 @@
}
return _results;
}
};
})(this));
});
},
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) {
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];

View File

@ -4398,14 +4398,13 @@
}
$.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() {
return $.ready(function() {
var a, footer, _i, _len, _ref, _results;
if (a = $("a[href*='/" + g.BOARD + "/']", footer = $.id('boardNavDesktopFoot'))) {
a.className = 'current';
@ -4419,8 +4418,7 @@
}
return _results;
}
};
})(this));
});
},
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) {
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];

View File

@ -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'

View File

@ -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
@ -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

View File

@ -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
@ -475,10 +475,12 @@ Settings =
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]