From a179c0c6cef694ec130cbd2756023a18774a4fca Mon Sep 17 00:00:00 2001 From: James Campos Date: Thu, 21 Oct 2010 02:15:41 -0700 Subject: [PATCH] hide pig disgusting text area --- 4chan_x.coffee | 8 +++++++- 4chan_x.js | 11 +++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/4chan_x.coffee b/4chan_x.coffee index dded96525..fa0e17231 100644 --- a/4chan_x.coffee +++ b/4chan_x.coffee @@ -318,6 +318,10 @@ clearHidden = -> hiddenThreads = [] +editSauce = -> + ta = $ '#options textarea' + if ta.style.display then show ta else hide ta + options = -> #redo this if div = $('#options') @@ -329,11 +333,13 @@ options = -> for option of config checked = if getConfig option then "checked" else "" html += "
" - html += "
" + html += "
Edit Sauce
" + html += "
" html += "
" div.innerHTML = html $('div.move', div).addEventListener 'mousedown', AEOS.move, true $('a.pointer', div).addEventListener 'click', optionsClose, true + $('a.sauce', div).addEventListener 'click', editSauce, true $('textarea', div).value = GM_getValue 'saucePrefix', defaultSaucePrefix $('input[type="button"]', div).addEventListener 'click', clearHidden, true addTo d.body, div diff --git a/4chan_x.js b/4chan_x.js index ffbd9ab73..85c1e00f6 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1,5 +1,5 @@ (function() { - var $, $$, AEOS, BOARD, DAY, PAGENUM, REPLY, THREAD_ID, _i, _j, _len, _len2, _ref, _ref2, _result, a, addTo, arr, as, autoWatch, autohide, b, board, callback, callbacks, clearHidden, close, config, cutoff, d, defaultSaucePrefix, delform, down, el, expandComment, expandThread, favEmpty, favNormal, favicon, getConfig, getTime, head, hiddenReplies, hiddenThreads, hide, hideReply, hideThread, href, html, i, i1, id, iframe, iframeLoad, iframeLoop, img, inAfter, inBefore, input, inputs, l, l1, lastChecked, link, magic, n, names, navtopr, nodeInserted, nop, now, omitted, onloadComment, onloadThread, options, optionsClose, parseResponse, pathname, prefix, prefixes, quickReply, r, recaptcha, recaptchaListener, recaptchaReload, redirect, remove, replace, replyNav, report, show, showReply, showThread, slice, span, spans, src, stopPropagation, submit, suffix, text, textContent, thread, threadF, threads, tn, up, watch, watchX, watched, watcher, watcherUpdate, x, xhrs; + var $, $$, AEOS, BOARD, DAY, PAGENUM, REPLY, THREAD_ID, _i, _j, _len, _len2, _ref, _ref2, _result, a, addTo, arr, as, autoWatch, autohide, b, board, callback, callbacks, clearHidden, close, config, cutoff, d, defaultSaucePrefix, delform, down, editSauce, el, expandComment, expandThread, favEmpty, favNormal, favicon, getConfig, getTime, head, hiddenReplies, hiddenThreads, hide, hideReply, hideThread, href, html, i, i1, id, iframe, iframeLoad, iframeLoop, img, inAfter, inBefore, input, inputs, l, l1, lastChecked, link, magic, n, names, navtopr, nodeInserted, nop, now, omitted, onloadComment, onloadThread, options, optionsClose, parseResponse, pathname, prefix, prefixes, quickReply, r, recaptcha, recaptchaListener, recaptchaReload, redirect, remove, replace, replyNav, report, show, showReply, showThread, slice, span, spans, src, stopPropagation, submit, suffix, text, textContent, thread, threadF, threads, tn, up, watch, watchX, watched, watcher, watcherUpdate, x, xhrs; var __slice = Array.prototype.slice, __hasProp = Object.prototype.hasOwnProperty; config = { 'Thread Hiding': true, @@ -364,6 +364,11 @@ hiddenReplies = []; return (hiddenThreads = []); }; + editSauce = function() { + var ta; + ta = $('#options textarea'); + return ta.style.display ? show(ta) : hide(ta); + }; options = function() { var _i, _ref2, checked, div, hiddenNum, option; if (div = $('#options')) { @@ -379,11 +384,13 @@ checked = getConfig(option) ? "checked" : ""; html += ("
"); } - html += "
"; + html += "
Edit Sauce
"; + html += "
"; html += ("
"); div.innerHTML = html; $('div.move', div).addEventListener('mousedown', AEOS.move, true); $('a.pointer', div).addEventListener('click', optionsClose, true); + $('a.sauce', div).addEventListener('click', editSauce, true); $('textarea', div).value = GM_getValue('saucePrefix', defaultSaucePrefix); $('input[type="button"]', div).addEventListener('click', clearHidden, true); return addTo(d.body, div);