Dynamic DOM Flow.

This commit is contained in:
Zixaphir 2013-04-24 11:57:26 -07:00
parent 792284060b
commit 10590c9c00
4 changed files with 46 additions and 70 deletions

View File

@ -4714,7 +4714,6 @@
$.on(editCustomNav, 'click', this.editCustomNav); $.on(editCustomNav, 'click', this.editCustomNav);
this.setBarFixed(Conf['Fixed Header']); this.setBarFixed(Conf['Fixed Header']);
this.setBarVisibility(Conf['Header auto-hide']); this.setBarVisibility(Conf['Header auto-hide']);
this.setBarPosition(Conf['Bottom Header']);
$.sync('Fixed Header', Header.setBarFixed); $.sync('Fixed Header', Header.setBarFixed);
$.sync('Bottom Header', Header.setBarPosition); $.sync('Bottom Header', Header.setBarPosition);
$.sync('Header auto-hide', Header.setBarVisibility); $.sync('Header auto-hide', Header.setBarVisibility);
@ -4752,28 +4751,20 @@
$.asap((function() { $.asap((function() {
return $.id('boardNavMobile') || d.readyState === 'complete'; return $.id('boardNavMobile') || d.readyState === 'complete';
}), Header.setBoardList); }), Header.setBoardList);
return $.prepend(d.body, _this.bar); $.prepend(d.body, _this.bar);
}); return _this.setBarPosition(Conf['Bottom Header']);
$.ready(function() {
var a;
if (a = $("a[href*='/" + g.BOARD + "/']", $.id('boardNavDesktopFoot'))) {
return a.className = 'current';
}
}); });
return $.ready(function() { return $.ready(function() {
var cs, footer; var a, footer;
if (a = $("a[href*='/" + g.BOARD + "/']", $.id('boardNavDesktopFoot'))) {
a.className = 'current';
}
$.add(d.body, Header.hover); $.add(d.body, Header.hover);
Header.footer = footer = $.id('boardNavDesktopFoot'); Header.footer = footer = $.id('boardNavDesktopFoot');
this.footer = $.id('boardNavDesktopFoot'); _this.footer = $.id('boardNavDesktopFoot');
Header.setFooterVisibility(Conf['Footer auto-hide']); Header.setFooterVisibility(Conf['Footer auto-hide']);
$.sync('Footer auto-hide', Header.setFooterVisibility); $.sync('Footer auto-hide', Header.setFooterVisibility);
cs = $.id('settingsWindowLink');
cs.textContent = 'Catalog Settings';
if (g.VIEW === 'catalog') {
Header.addShortcut(cs);
}
return $.sync('Bottom Board List', Header.setFooterVisibility); return $.sync('Bottom Board List', Header.setFooterVisibility);
}); });
}, },
@ -4801,7 +4792,7 @@
} }
boardList = $.el('span', { boardList = $.el('span', {
id: 'board-list', id: 'board-list',
innerHTML: "<span id=custom-board-list></span><span id=full-board-list hidden>[<a href=javascript:; class='hide-board-list-button'> - </a>]" + fourchannav.innerHTML + "</span>" innerHTML: "<span id=custom-board-list></span><span id=full-board-list hidden><span class='hide-board-list-button brackets-wrap'><a href=javascript:;> - </a></span>" + fourchannav.innerHTML + "</span>"
}); });
fullBoardList = $('#full-board-list', boardList); fullBoardList = $('#full-board-list', boardList);
btn = $('.hide-board-list-button', fullBoardList); btn = $('.hide-board-list-button', fullBoardList);
@ -4886,10 +4877,12 @@
Header.barPositionToggler.checked = bottom; Header.barPositionToggler.checked = bottom;
if (bottom) { if (bottom) {
$.rmClass(doc, 'top'); $.rmClass(doc, 'top');
return $.addClass(doc, 'bottom'); $.addClass(doc, 'bottom');
return $.after(Header.bar, Header.notify);
} else { } else {
$.rmClass(doc, 'bottom'); $.rmClass(doc, 'bottom');
return $.addClass(doc, 'top'); $.addClass(doc, 'top');
return $.add(Header.bar, Header.notify);
} }
}, },
toggleBarPosition: function() { toggleBarPosition: function() {
@ -4953,7 +4946,7 @@
cust = $('#custom-board-list', Header.bar); cust = $('#custom-board-list', Header.bar);
full = $('#full-board-list', Header.bar); full = $('#full-board-list', Header.bar);
btn = $('.hide-board-list-button', full); btn = $('.hide-board-list-button', full);
return _ref = show ? [false, true, false] : [true, false, true], cust.hidden = _ref[0], full.hidden = _ref[1], btn.hidden = _ref[2], _ref; return _ref = show ? [false, true] : [true, false], cust.hidden = _ref[0], full.hidden = _ref[1], _ref;
}, },
toggleCustomNav: function() { toggleCustomNav: function() {
$.cb.checked.call(this); $.cb.checked.call(this);

View File

@ -4705,7 +4705,6 @@
$.on(editCustomNav, 'click', this.editCustomNav); $.on(editCustomNav, 'click', this.editCustomNav);
this.setBarFixed(Conf['Fixed Header']); this.setBarFixed(Conf['Fixed Header']);
this.setBarVisibility(Conf['Header auto-hide']); this.setBarVisibility(Conf['Header auto-hide']);
this.setBarPosition(Conf['Bottom Header']);
$.sync('Fixed Header', Header.setBarFixed); $.sync('Fixed Header', Header.setBarFixed);
$.sync('Bottom Header', Header.setBarPosition); $.sync('Bottom Header', Header.setBarPosition);
$.sync('Header auto-hide', Header.setBarVisibility); $.sync('Header auto-hide', Header.setBarVisibility);
@ -4743,28 +4742,20 @@
$.asap((function() { $.asap((function() {
return $.id('boardNavMobile') || d.readyState === 'complete'; return $.id('boardNavMobile') || d.readyState === 'complete';
}), Header.setBoardList); }), Header.setBoardList);
return $.prepend(d.body, _this.bar); $.prepend(d.body, _this.bar);
}); return _this.setBarPosition(Conf['Bottom Header']);
$.ready(function() {
var a;
if (a = $("a[href*='/" + g.BOARD + "/']", $.id('boardNavDesktopFoot'))) {
return a.className = 'current';
}
}); });
return $.ready(function() { return $.ready(function() {
var cs, footer; var a, footer;
if (a = $("a[href*='/" + g.BOARD + "/']", $.id('boardNavDesktopFoot'))) {
a.className = 'current';
}
$.add(d.body, Header.hover); $.add(d.body, Header.hover);
Header.footer = footer = $.id('boardNavDesktopFoot'); Header.footer = footer = $.id('boardNavDesktopFoot');
this.footer = $.id('boardNavDesktopFoot'); _this.footer = $.id('boardNavDesktopFoot');
Header.setFooterVisibility(Conf['Footer auto-hide']); Header.setFooterVisibility(Conf['Footer auto-hide']);
$.sync('Footer auto-hide', Header.setFooterVisibility); $.sync('Footer auto-hide', Header.setFooterVisibility);
cs = $.id('settingsWindowLink');
cs.textContent = 'Catalog Settings';
if (g.VIEW === 'catalog') {
Header.addShortcut(cs);
}
return $.sync('Bottom Board List', Header.setFooterVisibility); return $.sync('Bottom Board List', Header.setFooterVisibility);
}); });
}, },
@ -4792,7 +4783,7 @@
} }
boardList = $.el('span', { boardList = $.el('span', {
id: 'board-list', id: 'board-list',
innerHTML: "<span id=custom-board-list></span><span id=full-board-list hidden>[<a href=javascript:; class='hide-board-list-button'> - </a>]" + fourchannav.innerHTML + "</span>" innerHTML: "<span id=custom-board-list></span><span id=full-board-list hidden><span class='hide-board-list-button brackets-wrap'><a href=javascript:;> - </a></span>" + fourchannav.innerHTML + "</span>"
}); });
fullBoardList = $('#full-board-list', boardList); fullBoardList = $('#full-board-list', boardList);
btn = $('.hide-board-list-button', fullBoardList); btn = $('.hide-board-list-button', fullBoardList);
@ -4877,10 +4868,12 @@
Header.barPositionToggler.checked = bottom; Header.barPositionToggler.checked = bottom;
if (bottom) { if (bottom) {
$.rmClass(doc, 'top'); $.rmClass(doc, 'top');
return $.addClass(doc, 'bottom'); $.addClass(doc, 'bottom');
return $.after(Header.bar, Header.notify);
} else { } else {
$.rmClass(doc, 'bottom'); $.rmClass(doc, 'bottom');
return $.addClass(doc, 'top'); $.addClass(doc, 'top');
return $.add(Header.bar, Header.notify);
} }
}, },
toggleBarPosition: function() { toggleBarPosition: function() {
@ -4944,7 +4937,7 @@
cust = $('#custom-board-list', Header.bar); cust = $('#custom-board-list', Header.bar);
full = $('#full-board-list', Header.bar); full = $('#full-board-list', Header.bar);
btn = $('.hide-board-list-button', full); btn = $('.hide-board-list-button', full);
return _ref = show ? [false, true, false] : [true, false, true], cust.hidden = _ref[0], full.hidden = _ref[1], btn.hidden = _ref[2], _ref; return _ref = show ? [false, true] : [true, false], cust.hidden = _ref[0], full.hidden = _ref[1], _ref;
}, },
toggleCustomNav: function() { toggleCustomNav: function() {
$.cb.checked.call(this); $.cb.checked.call(this);

View File

@ -4628,7 +4628,6 @@
$.on(editCustomNav, 'click', this.editCustomNav); $.on(editCustomNav, 'click', this.editCustomNav);
this.setBarFixed(Conf['Fixed Header']); this.setBarFixed(Conf['Fixed Header']);
this.setBarVisibility(Conf['Header auto-hide']); this.setBarVisibility(Conf['Header auto-hide']);
this.setBarPosition(Conf['Bottom Header']);
$.sync('Fixed Header', Header.setBarFixed); $.sync('Fixed Header', Header.setBarFixed);
$.sync('Bottom Header', Header.setBarPosition); $.sync('Bottom Header', Header.setBarPosition);
$.sync('Header auto-hide', Header.setBarVisibility); $.sync('Header auto-hide', Header.setBarVisibility);
@ -4666,28 +4665,20 @@
$.asap((function() { $.asap((function() {
return $.id('boardNavMobile') || d.readyState === 'complete'; return $.id('boardNavMobile') || d.readyState === 'complete';
}), Header.setBoardList); }), Header.setBoardList);
return $.prepend(d.body, _this.bar); $.prepend(d.body, _this.bar);
}); return _this.setBarPosition(Conf['Bottom Header']);
$.ready(function() {
var a;
if (a = $("a[href*='/" + g.BOARD + "/']", $.id('boardNavDesktopFoot'))) {
return a.className = 'current';
}
}); });
return $.ready(function() { return $.ready(function() {
var cs, footer; var a, footer;
if (a = $("a[href*='/" + g.BOARD + "/']", $.id('boardNavDesktopFoot'))) {
a.className = 'current';
}
$.add(d.body, Header.hover); $.add(d.body, Header.hover);
Header.footer = footer = $.id('boardNavDesktopFoot'); Header.footer = footer = $.id('boardNavDesktopFoot');
this.footer = $.id('boardNavDesktopFoot'); _this.footer = $.id('boardNavDesktopFoot');
Header.setFooterVisibility(Conf['Footer auto-hide']); Header.setFooterVisibility(Conf['Footer auto-hide']);
$.sync('Footer auto-hide', Header.setFooterVisibility); $.sync('Footer auto-hide', Header.setFooterVisibility);
cs = $.id('settingsWindowLink');
cs.textContent = 'Catalog Settings';
if (g.VIEW === 'catalog') {
Header.addShortcut(cs);
}
return $.sync('Bottom Board List', Header.setFooterVisibility); return $.sync('Bottom Board List', Header.setFooterVisibility);
}); });
}, },
@ -4715,7 +4706,7 @@
} }
boardList = $.el('span', { boardList = $.el('span', {
id: 'board-list', id: 'board-list',
innerHTML: "<span id=custom-board-list></span><span id=full-board-list hidden>[<a href=javascript:; class='hide-board-list-button'> - </a>]" + fourchannav.innerHTML + "</span>" innerHTML: "<span id=custom-board-list></span><span id=full-board-list hidden><span class='hide-board-list-button brackets-wrap'><a href=javascript:;> - </a></span>" + fourchannav.innerHTML + "</span>"
}); });
fullBoardList = $('#full-board-list', boardList); fullBoardList = $('#full-board-list', boardList);
btn = $('.hide-board-list-button', fullBoardList); btn = $('.hide-board-list-button', fullBoardList);
@ -4800,10 +4791,12 @@
Header.barPositionToggler.checked = bottom; Header.barPositionToggler.checked = bottom;
if (bottom) { if (bottom) {
$.rmClass(doc, 'top'); $.rmClass(doc, 'top');
return $.addClass(doc, 'bottom'); $.addClass(doc, 'bottom');
return $.after(Header.bar, Header.notify);
} else { } else {
$.rmClass(doc, 'bottom'); $.rmClass(doc, 'bottom');
return $.addClass(doc, 'top'); $.addClass(doc, 'top');
return $.add(Header.bar, Header.notify);
} }
}, },
toggleBarPosition: function() { toggleBarPosition: function() {
@ -4867,7 +4860,7 @@
cust = $('#custom-board-list', Header.bar); cust = $('#custom-board-list', Header.bar);
full = $('#full-board-list', Header.bar); full = $('#full-board-list', Header.bar);
btn = $('.hide-board-list-button', full); btn = $('.hide-board-list-button', full);
return _ref = show ? [false, true, false] : [true, false, true], cust.hidden = _ref[0], full.hidden = _ref[1], btn.hidden = _ref[2], _ref; return _ref = show ? [false, true] : [true, false], cust.hidden = _ref[0], full.hidden = _ref[1], _ref;
}, },
toggleCustomNav: function() { toggleCustomNav: function() {
$.cb.checked.call(this); $.cb.checked.call(this);

View File

@ -35,7 +35,6 @@ Header =
@setBarFixed Conf['Fixed Header'] @setBarFixed Conf['Fixed Header']
@setBarVisibility Conf['Header auto-hide'] @setBarVisibility Conf['Header auto-hide']
@setBarPosition Conf['Bottom Header']
$.sync 'Fixed Header', Header.setBarFixed $.sync 'Fixed Header', Header.setBarFixed
$.sync 'Bottom Header', Header.setBarPosition $.sync 'Bottom Header', Header.setBarPosition
@ -66,21 +65,17 @@ Header =
# it might be incomplete otherwise. # it might be incomplete otherwise.
$.asap (-> $.id('boardNavMobile') or d.readyState is 'complete'), Header.setBoardList $.asap (-> $.id('boardNavMobile') or d.readyState is 'complete'), Header.setBoardList
$.prepend d.body, @bar $.prepend d.body, @bar
@setBarPosition Conf['Bottom Header']
$.ready => $.ready =>
if a = $ "a[href*='/#{g.BOARD}/']", $.id 'boardNavDesktopFoot' if a = $ "a[href*='/#{g.BOARD}/']", $.id 'boardNavDesktopFoot'
a.className = 'current' a.className = 'current'
$.ready ->
$.add d.body, Header.hover $.add d.body, Header.hover
Header.footer = footer = $.id 'boardNavDesktopFoot' Header.footer = footer = $.id 'boardNavDesktopFoot'
@footer = $.id 'boardNavDesktopFoot' @footer = $.id 'boardNavDesktopFoot'
Header.setFooterVisibility Conf['Footer auto-hide'] Header.setFooterVisibility Conf['Footer auto-hide']
$.sync 'Footer auto-hide', Header.setFooterVisibility $.sync 'Footer auto-hide', Header.setFooterVisibility
cs = $.id('settingsWindowLink')
cs.textContent = 'Catalog Settings'
if g.VIEW is 'catalog'
Header.addShortcut cs
$.sync 'Bottom Board List', Header.setFooterVisibility $.sync 'Bottom Board List', Header.setFooterVisibility
bar: $.el 'div', bar: $.el 'div',
@ -105,7 +100,7 @@ Header =
boardList = $.el 'span', boardList = $.el 'span',
id: 'board-list' id: 'board-list'
innerHTML: "<span id=custom-board-list></span><span id=full-board-list hidden>[<a href=javascript:; class='hide-board-list-button'> - </a>]#{fourchannav.innerHTML}</span>" innerHTML: "<span id=custom-board-list></span><span id=full-board-list hidden><span class='hide-board-list-button brackets-wrap'><a href=javascript:;> - </a></span>#{fourchannav.innerHTML}</span>"
fullBoardList = $ '#full-board-list', boardList fullBoardList = $ '#full-board-list', boardList
btn = $ '.hide-board-list-button', fullBoardList btn = $ '.hide-board-list-button', fullBoardList
$.on btn, 'click', Header.toggleBoardList $.on btn, 'click', Header.toggleBoardList
@ -175,9 +170,11 @@ Header =
if bottom if bottom
$.rmClass doc, 'top' $.rmClass doc, 'top'
$.addClass doc, 'bottom' $.addClass doc, 'bottom'
$.after Header.bar, Header.notify
else else
$.rmClass doc, 'bottom' $.rmClass doc, 'bottom'
$.addClass doc, 'top' $.addClass doc, 'top'
$.add Header.bar, Header.notify
toggleBarPosition: -> toggleBarPosition: ->
$.event 'CloseMenu' $.event 'CloseMenu'
@ -247,10 +244,10 @@ Header =
cust = $ '#custom-board-list', Header.bar cust = $ '#custom-board-list', Header.bar
full = $ '#full-board-list', Header.bar full = $ '#full-board-list', Header.bar
btn = $ '.hide-board-list-button', full btn = $ '.hide-board-list-button', full
[cust.hidden, full.hidden, btn.hidden] = if show [cust.hidden, full.hidden] = if show
[false, true, false] [false, true]
else else
[true, false, true] [true, false]
toggleCustomNav: -> toggleCustomNav: ->
$.cb.checked.call @ $.cb.checked.call @