From 741d3224aad198b9c76bf47dde723982569e01f7 Mon Sep 17 00:00:00 2001 From: James Campos Date: Sun, 17 Apr 2011 08:43:33 -0700 Subject: [PATCH] mv quickReport --- 4chan_x.js | 68 +++++++++++++++++++++++++-------------------------- script.coffee | 42 +++++++++++++++---------------- 2 files changed, 55 insertions(+), 55 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index 28155d5e8..a4ca5d702 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1724,6 +1724,40 @@ } } }; + quickReport = { + init: function() { + return g.callbacks.push(quickReport.cb.node); + }, + cb: { + node: function(root) { + var a, arr, el, _i, _len, _results; + arr = $$('span[id^=no]', root); + _results = []; + for (_i = 0, _len = arr.length; _i < _len; _i++) { + el = arr[_i]; + a = $.el('a', { + textContent: '[ ! ]' + }); + $.bind(a, 'click', quickReport.cb.report); + $.after(el, a); + _results.push($.after(el, $.tn(' '))); + } + return _results; + }, + report: function(e) { + var target; + target = e.target; + return quickReport.report(target); + } + }, + report: function(target) { + var input; + input = $.x('preceding-sibling::input[1]', target); + input.click(); + $('input[value="Report"]').click(); + return input.click(); + } + }; unread = { init: function() { d.title = '(0) ' + d.title; @@ -1947,40 +1981,6 @@ } return location.href = url; }; - quickReport = { - init: function() { - return g.callbacks.push(quickReport.cb.node); - }, - cb: { - node: function(root) { - var a, arr, el, _i, _len, _results; - arr = $$('span[id^=no]', root); - _results = []; - for (_i = 0, _len = arr.length; _i < _len; _i++) { - el = arr[_i]; - a = $.el('a', { - textContent: '[ ! ]' - }); - $.bind(a, 'click', quickReport.cb.report); - $.after(el, a); - _results.push($.after(el, $.tn(' '))); - } - return _results; - }, - report: function(e) { - var target; - target = e.target; - return quickReport.report(target); - } - }, - report: function(target) { - var input; - input = $.x('preceding-sibling::input[1]', target); - input.click(); - $('input[value="Report"]').click(); - return input.click(); - } - }; NAMESPACE = 'AEOS.4chan_x.'; g = { cache: {}, diff --git a/script.coffee b/script.coffee index 604052fb5..436e51ae2 100644 --- a/script.coffee +++ b/script.coffee @@ -1341,6 +1341,27 @@ imgExpansion = $.bind thumb.parentNode, 'click', imageClick if g.expand then imageToggle thumb.parentNode +quickReport = + init: -> + g.callbacks.push quickReport.cb.node + cb: + node: (root) -> + arr = $$ 'span[id^=no]', root + for el in arr + a = $.el 'a', + textContent: '[ ! ]' + $.bind a, 'click', quickReport.cb.report + $.after el, a + $.after el, $.tn(' ') + report: (e) -> + {target} = e + quickReport.report target + report: (target) -> + input = $.x('preceding-sibling::input[1]', target) + input.click() + $('input[value="Report"]').click() + input.click() + unread = init: -> d.title = '(0) ' + d.title @@ -1495,27 +1516,6 @@ redirect = -> url = "http://boards.4chan.org/#{g.BOARD}" location.href = url -quickReport = - init: -> - g.callbacks.push quickReport.cb.node - cb: - node: (root) -> - arr = $$ 'span[id^=no]', root - for el in arr - a = $.el 'a', - textContent: '[ ! ]' - $.bind a, 'click', quickReport.cb.report - $.after el, a - $.after el, $.tn(' ') - report: (e) -> - {target} = e - quickReport.report target - report: (target) -> - input = $.x('preceding-sibling::input[1]', target) - input.click() - $('input[value="Report"]').click() - input.click() - # /TODO *************************************************************** #main