hide -> $.hide

This commit is contained in:
James Campos 2011-03-27 13:14:28 -07:00
parent 2b7afae938
commit d02a1b494b
2 changed files with 18 additions and 18 deletions

View File

@ -56,7 +56,7 @@
*/ */
(function() { (function() {
var $, $$, DAY, a, arr, as, autoWatch, callback, changeCheckbox, changeValue, clearHidden, closeQR, config, cooldown, cutoff, d, delform, down, editSauce, el, expand, expandComment, expandThread, g, getConfig, getThread, getTime, hide, hideReply, hideThread, href, html, i, id, imageClick, imageExpand, imageExpandClick, imageHover, imageResize, imageThumb, imageToggle, imageType, imageTypeChange, img, inAfter, input, inputs, keyModeInsert, keyModeNormal, keydown, keypress, l1, lastChecked, log, mv, navbotr, navtopr, nodeInserted, now, omitted, onloadComment, onloadThread, option, options, parseResponse, pathname, qr, recaptcha, recaptchaListener, recaptchaReload, redirect, replace, replyNav, report, request, scroll, scrollThread, show, showReply, showThread, slice, span, src, start, stopPropagation, temp, text, textContent, threadF, threads, tn, tzOffset, ui, up, updateAuto, updateCallback, updateFavicon, updateInterval, updateNow, updateTime, updateTitle, updateVerbose, updaterMake, watch, watchX, watcher, watcherUpdate, x, zeroPad, _i, _j, _k, _l, _len, _len2, _len3, _len4, _len5, _len6, _len7, _m, _n, _ref, _ref2, _ref3, _ref4; var $, $$, DAY, a, arr, as, autoWatch, callback, changeCheckbox, changeValue, clearHidden, closeQR, config, cooldown, cutoff, d, delform, down, editSauce, el, expand, expandComment, expandThread, g, getConfig, getThread, getTime, hideReply, hideThread, href, html, i, id, imageClick, imageExpand, imageExpandClick, imageHover, imageResize, imageThumb, imageToggle, imageType, imageTypeChange, img, inAfter, input, inputs, keyModeInsert, keyModeNormal, keydown, keypress, l1, lastChecked, log, mv, navbotr, navtopr, nodeInserted, now, omitted, onloadComment, onloadThread, option, options, parseResponse, pathname, qr, recaptcha, recaptchaListener, recaptchaReload, redirect, replace, replyNav, report, request, scroll, scrollThread, show, showReply, showThread, slice, span, src, start, stopPropagation, temp, text, textContent, threadF, threads, tn, tzOffset, ui, up, updateAuto, updateCallback, updateFavicon, updateInterval, updateNow, updateTime, updateTitle, updateVerbose, updaterMake, watch, watchX, watcher, watcherUpdate, x, zeroPad, _i, _j, _k, _l, _len, _len2, _len3, _len4, _len5, _len6, _len7, _m, _n, _ref, _ref2, _ref3, _ref4;
var __slice = Array.prototype.slice; var __slice = Array.prototype.slice;
if (typeof console != "undefined" && console !== null) { if (typeof console != "undefined" && console !== null) {
log = console.log; log = console.log;
@ -242,6 +242,9 @@
return object; return object;
}; };
$.extend($, { $.extend($, {
hide: function(el) {
return el.style.display = 'none';
},
addClass: function(el, className) { addClass: function(el, className) {
return el.className += ' ' + className; return el.className += ' ' + className;
}, },
@ -342,9 +345,6 @@
getTime = function() { getTime = function() {
return Math.floor(new Date().getTime() / 1000); return Math.floor(new Date().getTime() / 1000);
}; };
hide = function(el) {
return el.style.display = 'none';
};
inAfter = function(root, el) { inAfter = function(root, el) {
return root.parentNode.insertBefore(el, root.nextSibling); return root.parentNode.insertBefore(el, root.nextSibling);
}; };
@ -423,7 +423,7 @@
if (ta.style.display) { if (ta.style.display) {
return show(ta); return show(ta);
} else { } else {
return hide(ta); return $.hide(ta);
} }
}; };
expandComment = function(e) { expandComment = function(e) {
@ -499,7 +499,7 @@
name = $('span.commentpostername', reply).textContent; name = $('span.commentpostername', reply).textContent;
trip = ((_ref = $('span.postertrip', reply)) != null ? _ref.textContent : void 0) || ''; trip = ((_ref = $('span.postertrip', reply)) != null ? _ref.textContent : void 0) || '';
table = x('ancestor::table', reply); table = x('ancestor::table', reply);
hide(table); $.hide(table);
if (getConfig('Show Stubs')) { if (getConfig('Show Stubs')) {
a = $.el('a', { a = $.el('a', {
textContent: "[ + ] " + name + " " + trip, textContent: "[ + ] " + name + " " + trip,
@ -521,7 +521,7 @@
}); });
GM_setValue("hiddenThreads/" + g.BOARD + "/", JSON.stringify(g.hiddenThreads)); GM_setValue("hiddenThreads/" + g.BOARD + "/", JSON.stringify(g.hiddenThreads));
} }
hide(div); $.hide(div);
if (getConfig('Show Stubs')) { if (getConfig('Show Stubs')) {
if (span = $('.omittedposts', div)) { if (span = $('.omittedposts', div)) {
num = Number(span.textContent.match(/\d+/)[0]); num = Number(span.textContent.match(/\d+/)[0]);
@ -546,7 +546,7 @@
img = $.el('img', { img = $.el('img', {
id: 'iHover' id: 'iHover'
}); });
hide(img); $.hide(img);
d.body.appendChild(img); d.body.appendChild(img);
return g.callbacks.push(imageHover.cb.node); return g.callbacks.push(imageHover.cb.node);
}, },
@ -591,7 +591,7 @@
var img, target; var img, target;
target = e.target; target = e.target;
img = $('#iHover'); img = $('#iHover');
hide(img); $.hide(img);
img.src = null; img.src = null;
target.removeEventListener('mousemove', imageHover.cb.mousemove, true); target.removeEventListener('mousemove', imageHover.cb.mousemove, true);
return target.removeEventListener('mouseout', imageHover.cb.mouseout, true); return target.removeEventListener('mouseout', imageHover.cb.mouseout, true);
@ -1262,7 +1262,7 @@
var div, id; var div, id;
div = this.nextSibling; div = this.nextSibling;
show(div); show(div);
hide(this); $.hide(this);
id = div.id; id = div.id;
slice(g.hiddenThreads, id); slice(g.hiddenThreads, id);
return GM_setValue("hiddenThreads/" + g.BOARD + "/", JSON.stringify(g.hiddenThreads)); return GM_setValue("hiddenThreads/" + g.BOARD + "/", JSON.stringify(g.hiddenThreads));

View File

@ -145,6 +145,8 @@ $.extend = (object, properties) ->
object object
$.extend $, $.extend $,
hide: (el) ->
el.style.display = 'none'
addClass: (el, className) -> addClass: (el, className) ->
el.className += ' ' + className el.className += ' ' + className
removeClass: (el, className) -> removeClass: (el, className) ->
@ -222,8 +224,6 @@ getConfig = (name) ->
GM_getValue name, config[name][0] GM_getValue name, config[name][0]
getTime = -> getTime = ->
Math.floor(new Date().getTime() / 1000) Math.floor(new Date().getTime() / 1000)
hide = (el) ->
el.style.display = 'none'
inAfter = (root, el) -> inAfter = (root, el) ->
root.parentNode.insertBefore el, root.nextSibling root.parentNode.insertBefore el, root.nextSibling
replace = (root, el) -> replace = (root, el) ->
@ -284,7 +284,7 @@ cooldown = ->
editSauce = -> editSauce = ->
ta = $ '#options textarea' ta = $ '#options textarea'
if ta.style.display then show ta else hide ta if ta.style.display then show ta else $.hide ta
expandComment = (e) -> expandComment = (e) ->
e.preventDefault() e.preventDefault()
@ -348,7 +348,7 @@ hideReply = (reply) ->
name = $('span.commentpostername', reply).textContent name = $('span.commentpostername', reply).textContent
trip = $('span.postertrip', reply)?.textContent or '' trip = $('span.postertrip', reply)?.textContent or ''
table = x 'ancestor::table', reply table = x 'ancestor::table', reply
hide table $.hide table
if getConfig 'Show Stubs' if getConfig 'Show Stubs'
a = $.el 'a', a = $.el 'a',
textContent: "[ + ] #{name} #{trip}" textContent: "[ + ] #{name} #{trip}"
@ -366,7 +366,7 @@ hideThread = (div) ->
timestamp: getTime() timestamp: getTime()
} }
GM_setValue("hiddenThreads/#{g.BOARD}/", JSON.stringify(g.hiddenThreads)) GM_setValue("hiddenThreads/#{g.BOARD}/", JSON.stringify(g.hiddenThreads))
hide div $.hide div
if getConfig 'Show Stubs' if getConfig 'Show Stubs'
if span = $ '.omittedposts', div if span = $ '.omittedposts', div
num = Number(span.textContent.match(/\d+/)[0]) num = Number(span.textContent.match(/\d+/)[0])
@ -385,7 +385,7 @@ hideThread = (div) ->
imageHover = imageHover =
init: -> init: ->
img = $.el 'img', id: 'iHover' img = $.el 'img', id: 'iHover'
hide img $.hide img
d.body.appendChild img d.body.appendChild img
g.callbacks.push imageHover.cb.node g.callbacks.push imageHover.cb.node
offset: offset:
@ -424,7 +424,7 @@ imageHover =
mouseout: (e) -> mouseout: (e) ->
{target} = e {target} = e
img = $ '#iHover' img = $ '#iHover'
hide img $.hide img
img.src = null img.src = null
target.removeEventListener 'mousemove', imageHover.cb.mousemove, true target.removeEventListener 'mousemove', imageHover.cb.mousemove, true
target.removeEventListener 'mouseout', imageHover.cb.mouseout, true target.removeEventListener 'mouseout', imageHover.cb.mouseout, true
@ -940,7 +940,7 @@ showReply = ->
showThread = -> showThread = ->
div = @nextSibling div = @nextSibling
show div show div
hide this $.hide this
id = div.id id = div.id
slice g.hiddenThreads, id slice g.hiddenThreads, id
GM_setValue("hiddenThreads/#{g.BOARD}/", JSON.stringify(g.hiddenThreads)) GM_setValue("hiddenThreads/#{g.BOARD}/", JSON.stringify(g.hiddenThreads))