imageHover -> imgHover

This commit is contained in:
James Campos 2011-07-20 14:06:54 -07:00
parent a2e6d2da24
commit 20429670b8
2 changed files with 19 additions and 19 deletions

View File

@ -59,7 +59,7 @@
*/ */
(function() { (function() {
var $, $$, Favicon, NAMESPACE, Recaptcha, Time, anonymize, config, cooldown, d, expandComment, expandThread, firstRun, g, imageHover, imgExpand, imgGif, imgPreloading, keybinds, log, main, nav, nodeInserted, options, qr, quoteBacklink, quoteInline, quoteOP, quotePreview, redirect, replyHiding, reportButton, revealSpoilers, sauce, threadHiding, threadStats, threading, titlePost, ui, unread, updater, watcher, _config, _ref; var $, $$, Favicon, NAMESPACE, Recaptcha, Time, anonymize, config, cooldown, d, expandComment, expandThread, firstRun, g, imgExpand, imgGif, imgHover, imgPreloading, keybinds, log, main, nav, nodeInserted, options, qr, quoteBacklink, quoteInline, quoteOP, quotePreview, redirect, replyHiding, reportButton, revealSpoilers, sauce, threadHiding, threadStats, threading, titlePost, ui, unread, updater, watcher, _config, _ref;
var __slice = Array.prototype.slice; var __slice = Array.prototype.slice;
config = { config = {
main: { main: {
@ -2443,29 +2443,29 @@
return _results; return _results;
} }
}; };
imageHover = { imgHover = {
init: function() { init: function() {
imageHover.img = $.el('img', { imgHover.img = $.el('img', {
id: 'iHover' id: 'iHover'
}); });
$.append(d.body, imageHover.img); $.append(d.body, imgHover.img);
return g.callbacks.push(imageHover.node); return g.callbacks.push(imgHover.node);
}, },
node: function(root) { node: function(root) {
var thumb; var thumb;
if (!(thumb = $('img[md5]', root))) { if (!(thumb = $('img[md5]', root))) {
return; return;
} }
$.bind(thumb, 'mouseover', imageHover.mouseover); $.bind(thumb, 'mouseover', imgHover.mouseover);
$.bind(thumb, 'mousemove', ui.hover); $.bind(thumb, 'mousemove', ui.hover);
return $.bind(thumb, 'mouseout', ui.hoverend); return $.bind(thumb, 'mouseout', ui.hoverend);
}, },
mouseover: function(e) { mouseover: function(e) {
/* /*
`img.src = null` doesn't actually null the previous image on chrom. `img.src = null` doesn't actually null the previous image on chrom.
*/ imageHover.img.src = null; */ imgHover.img.src = null;
imageHover.img.src = this.parentNode.href; imgHover.img.src = this.parentNode.href;
return ui.el = imageHover.img; return ui.el = imgHover.img;
} }
}; };
imgPreloading = { imgPreloading = {
@ -2718,7 +2718,7 @@
anonymize.init(); anonymize.init();
} }
if ($.config('Image Hover')) { if ($.config('Image Hover')) {
imageHover.init(); imgHover.init();
} }
if ($.config('Reply Hiding')) { if ($.config('Reply Hiding')) {
replyHiding.init(); replyHiding.init();

View File

@ -1845,23 +1845,23 @@ nodeInserted = (e) ->
for callback in g.callbacks for callback in g.callbacks
callback target callback target
imageHover = imgHover =
init: -> init: ->
imageHover.img = $.el 'img', id: 'iHover' imgHover.img = $.el 'img', id: 'iHover'
$.append d.body, imageHover.img $.append d.body, imgHover.img
g.callbacks.push imageHover.node g.callbacks.push imgHover.node
node: (root) -> node: (root) ->
return unless thumb = $ 'img[md5]', root return unless thumb = $ 'img[md5]', root
$.bind thumb, 'mouseover', imageHover.mouseover $.bind thumb, 'mouseover', imgHover.mouseover
$.bind thumb, 'mousemove', ui.hover $.bind thumb, 'mousemove', ui.hover
$.bind thumb, 'mouseout', ui.hoverend $.bind thumb, 'mouseout', ui.hoverend
mouseover: (e) -> mouseover: (e) ->
### ###
`img.src = null` doesn't actually null the previous image on chrom. `img.src = null` doesn't actually null the previous image on chrom.
### ###
imageHover.img.src = null imgHover.img.src = null
imageHover.img.src = @parentNode.href imgHover.img.src = @parentNode.href
ui.el = imageHover.img ui.el = imgHover.img
imgPreloading = imgPreloading =
init: -> init: ->
@ -2122,7 +2122,7 @@ main =
anonymize.init() anonymize.init()
if $.config 'Image Hover' if $.config 'Image Hover'
imageHover.init() imgHover.init()
if $.config 'Reply Hiding' if $.config 'Reply Hiding'
replyHiding.init() replyHiding.init()