This commit is contained in:
James Campos 2011-07-10 21:02:13 -07:00
parent b33e25ac76
commit bdd2a0375f
2 changed files with 149 additions and 158 deletions

View File

@ -1080,19 +1080,19 @@
input = _ref2[_i];
$.bind(input, 'click', $.cb.checked);
}
$.bind($('input[type=button]', dialog), 'click', options.cb.clearHidden);
$.bind($('input[type=button]', dialog), 'click', options.clearHidden);
_ref3 = $$('#floaty a', dialog);
for (_j = 0, _len2 = _ref3.length; _j < _len2; _j++) {
link = _ref3[_j];
$.bind(link, 'click', options.tab);
}
$.bind($('textarea[name=flavors]', dialog), 'change', $.cb.value);
$.bind($('input[name=time]', dialog), 'keyup', options.cb.time);
$.bind($('input[name=time]', dialog), 'keyup', options.time);
_ref4 = $$('#keybinds input', dialog);
for (_k = 0, _len3 = _ref4.length; _k < _len3; _k++) {
input = _ref4[_k];
input.value = $.getValue("key/" + input.name, config.hotkeys[input.name]);
$.bind(input, 'keydown', options.cb.keybind);
$.bind(input, 'keydown', options.keybind);
}
/*
Two parent divs are necessary to center on all browsers.
@ -1105,7 +1105,7 @@
});
$.append(overlay, dialog);
$.append(d.body, overlay);
options.cb.time.call($('input[name=time]', dialog));
options.time.call($('input[name=time]', dialog));
$.bind(overlay, 'click', function() {
return $.rm(overlay);
});
@ -1123,7 +1123,6 @@
}
return _results;
},
cb: {
clearHidden: function(e) {
$.deleteValue("hiddenReplies/" + g.BOARD + "/");
$.deleteValue("hiddenThreads/" + g.BOARD + "/");
@ -1155,7 +1154,6 @@
Time.date = new Date();
return $('#timePreview').textContent = Time.funk(Time);
}
}
};
cooldown = {
init: function() {
@ -2301,10 +2299,9 @@
init: function() {
unread.replies = [];
d.title = '(0) ' + d.title;
$.bind(window, 'scroll', unread.cb.scroll);
return g.callbacks.push(unread.cb.node);
$.bind(window, 'scroll', unread.scroll);
return g.callbacks.push(unread.node);
},
cb: {
node: function(root) {
if (root.className) {
return;
@ -2332,7 +2329,6 @@
if (unread.replies.length === 0) {
return Favicon.update();
}
}
},
updateTitle: function() {
return d.title = d.title.replace(/\d+/, unread.replies.length);
@ -2457,15 +2453,14 @@
});
$.hide(img);
$.append(d.body, img);
return g.callbacks.push(imageHover.cb.node);
return g.callbacks.push(imageHover.node);
},
cb: {
node: function(root) {
var thumb;
if (!(thumb = $('img[md5]', root))) {
return;
}
$.bind(thumb, 'mouseover', imageHover.cb.mouseover);
$.bind(thumb, 'mouseover', imageHover.mouseover);
$.bind(thumb, 'mousemove', ui.hover);
return $.bind(thumb, 'mouseout', ui.hoverend);
},
@ -2477,7 +2472,6 @@
ui.el = el;
return $.show(el);
}
}
};
imgPreloading = {
init: function() {
@ -2505,12 +2499,11 @@
};
imgExpand = {
init: function() {
g.callbacks.push(imgExpand.cb.node);
g.callbacks.push(imgExpand.node);
imgExpand.dialog();
$.bind(window, 'resize', imgExpand.resize);
return imgExpand.resize();
},
cb: {
node: function(root) {
var a, thumb;
if (!(thumb = $('img[md5]', root))) {
@ -2522,6 +2515,7 @@
return imgExpand.toggle(a);
}
},
cb: {
toggle: function(e) {
if (e.shiftKey || e.altKey || e.ctrlKey || e.button !== 0) {
return;

View File

@ -860,13 +860,13 @@ options =
for input in $$ 'input[type=checkbox]', dialog
$.bind input, 'click', $.cb.checked
$.bind $('input[type=button]', dialog), 'click', options.cb.clearHidden
$.bind $('input[type=button]', dialog), 'click', options.clearHidden
$.bind link, 'click', options.tab for link in $$ '#floaty a', dialog
$.bind $('textarea[name=flavors]', dialog), 'change', $.cb.value
$.bind $('input[name=time]', dialog), 'keyup', options.cb.time
$.bind $('input[name=time]', dialog), 'keyup', options.time
for input in $$ '#keybinds input', dialog
input.value = $.getValue "key/#{input.name}", config.hotkeys[input.name]
$.bind input, 'keydown', options.cb.keybind
$.bind input, 'keydown', options.keybind
###
Two parent divs are necessary to center on all browsers.
@ -878,7 +878,7 @@ options =
$.append overlay, dialog
$.append d.body, overlay
options.cb.time.call $('input[name=time]', dialog)
options.time.call $('input[name=time]', dialog)
$.bind overlay, 'click', -> $.rm overlay
$.bind dialog.firstElementChild, 'click', (e) -> e.stopPropagation()
@ -890,7 +890,6 @@ options =
else
$.hide div
cb:
clearHidden: (e) ->
#'hidden' might be misleading; it's the number of IDs we're *looking* for,
# not the number of posts actually hidden on the page.
@ -1766,10 +1765,9 @@ unread =
init: ->
unread.replies = []
d.title = '(0) ' + d.title
$.bind window, 'scroll', unread.cb.scroll
g.callbacks.push unread.cb.node
$.bind window, 'scroll', unread.scroll
g.callbacks.push unread.node
cb:
node: (root) ->
return if root.className
unread.replies.push root
@ -1860,11 +1858,10 @@ imageHover =
img = $.el 'img', id: 'iHover'
$.hide img
$.append d.body, img
g.callbacks.push imageHover.cb.node
cb:
g.callbacks.push imageHover.node
node: (root) ->
return unless thumb = $ 'img[md5]', root
$.bind thumb, 'mouseover', imageHover.cb.mouseover
$.bind thumb, 'mouseover', imageHover.mouseover
$.bind thumb, 'mousemove', ui.hover
$.bind thumb, 'mouseout', ui.hoverend
mouseover: (e) ->
@ -1891,17 +1888,17 @@ imgGif =
imgExpand =
init: ->
g.callbacks.push imgExpand.cb.node
g.callbacks.push imgExpand.node
imgExpand.dialog()
$.bind window, 'resize', imgExpand.resize
imgExpand.resize()
cb:
node: (root) ->
return unless thumb = $ 'img[md5]', root
a = thumb.parentNode
$.bind a, 'click', imgExpand.cb.toggle
if imgExpand.on and root.className isnt 'inline' then imgExpand.toggle a
cb:
toggle: (e) ->
return if e.shiftKey or e.altKey or e.ctrlKey or e.button isnt 0
e.preventDefault()