show -> $.show

This commit is contained in:
James Campos 2011-03-27 13:15:58 -07:00
parent d02a1b494b
commit 7894495e3e
2 changed files with 14 additions and 14 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, 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, 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;
@ -245,6 +245,9 @@
hide: function(el) { hide: function(el) {
return el.style.display = 'none'; return el.style.display = 'none';
}, },
show: function(el) {
return el.style.display = '';
},
addClass: function(el, className) { addClass: function(el, className) {
return el.className += ' ' + className; return el.className += ' ' + className;
}, },
@ -351,9 +354,6 @@
replace = function(root, el) { replace = function(root, el) {
return root.parentNode.replaceChild(el, root); return root.parentNode.replaceChild(el, root);
}; };
show = function(el) {
return el.style.display = '';
};
slice = function(arr, id) { slice = function(arr, id) {
var i, l, _results; var i, l, _results;
i = 0; i = 0;
@ -421,7 +421,7 @@
var ta; var ta;
ta = $('#options textarea'); ta = $('#options textarea');
if (ta.style.display) { if (ta.style.display) {
return show(ta); return $.show(ta);
} else { } else {
return $.hide(ta); return $.hide(ta);
} }
@ -570,7 +570,7 @@
target = e.target, clientX = e.clientX, clientY = e.clientY; target = e.target, clientX = e.clientX, clientY = e.clientY;
img = $('#iHover'); img = $('#iHover');
img.src = target.parentNode.href; img.src = target.parentNode.href;
show(img); $.show(img);
imageHover.winHeight = d.body.clientHeight; imageHover.winHeight = d.body.clientHeight;
imageHover.winWidth = d.body.clientWidth; imageHover.winWidth = d.body.clientWidth;
target.addEventListener('mousemove', imageHover.cb.mousemove, true); target.addEventListener('mousemove', imageHover.cb.mousemove, true);
@ -1252,7 +1252,7 @@
var div, id, table; var div, id, table;
div = this.parentNode; div = this.parentNode;
table = div.nextSibling; table = div.nextSibling;
show(table); $.show(table);
$.remove(div); $.remove(div);
id = $('td.reply, td.replyhl', table).id; id = $('td.reply, td.replyhl', table).id;
slice(g.hiddenReplies, id); slice(g.hiddenReplies, id);
@ -1261,7 +1261,7 @@
showThread = function() { showThread = function() {
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);

View File

@ -147,6 +147,8 @@ $.extend = (object, properties) ->
$.extend $, $.extend $,
hide: (el) -> hide: (el) ->
el.style.display = 'none' el.style.display = 'none'
show: (el) ->
el.style.display = ''
addClass: (el, className) -> addClass: (el, className) ->
el.className += ' ' + className el.className += ' ' + className
removeClass: (el, className) -> removeClass: (el, className) ->
@ -228,8 +230,6 @@ inAfter = (root, el) ->
root.parentNode.insertBefore el, root.nextSibling root.parentNode.insertBefore el, root.nextSibling
replace = (root, el) -> replace = (root, el) ->
root.parentNode.replaceChild el, root root.parentNode.replaceChild el, root
show = (el) ->
el.style.display = ''
slice = (arr, id) -> slice = (arr, id) ->
# the while loop is the only low-level loop left in coffeescript. # the while loop is the only low-level loop left in coffeescript.
# we need to use it to see the index. # we need to use it to see the index.
@ -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()
@ -400,7 +400,7 @@ imageHover =
{target, clientX, clientY} = e {target, clientX, clientY} = e
img = $ '#iHover' img = $ '#iHover'
img.src = target.parentNode.href img.src = target.parentNode.href
show img $.show img
imageHover.winHeight = d.body.clientHeight imageHover.winHeight = d.body.clientHeight
imageHover.winWidth = d.body.clientWidth imageHover.winWidth = d.body.clientWidth
target.addEventListener 'mousemove', imageHover.cb.mousemove, true target.addEventListener 'mousemove', imageHover.cb.mousemove, true
@ -931,7 +931,7 @@ scrollThread = (count) ->
showReply = -> showReply = ->
div = @parentNode div = @parentNode
table = div.nextSibling table = div.nextSibling
show table $.show table
$.remove div $.remove div
id = $('td.reply, td.replyhl', table).id id = $('td.reply, td.replyhl', table).id
slice g.hiddenReplies, id slice g.hiddenReplies, id
@ -939,7 +939,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