Simpler selector; shave some lines; make the quick report button less derp.

This commit is contained in:
Nicolas Stepien 2011-08-27 20:34:05 +02:00
parent c13f59556d
commit 798fe78d91
2 changed files with 15 additions and 23 deletions

View File

@ -1108,7 +1108,7 @@
}); });
$.append(hidingul, li); $.append(hidingul, li);
$.bind($('button', li), 'click', options.clearHidden); $.bind($('button', li), 'click', options.clearHidden);
$.bind($('textarea[name=flavors]', dialog), 'change', $.cb.value); $.bind($('#flavors', dialog), 'change', $.cb.value);
$.bind($('input[name=time]', dialog), 'keyup', options.time); $.bind($('input[name=time]', dialog), 'keyup', options.time);
_ref2 = $$('#keybinds input', dialog); _ref2 = $$('#keybinds input', dialog);
for (_i = 0, _len = _ref2.length; _i < _len; _i++) { for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
@ -2380,20 +2380,15 @@
$.after(span, a); $.after(span, a);
$.after(span, $.tn(' ')); $.after(span, $.tn(' '));
} }
return $.bind(a, 'click', reportButton.cb.report); return $.bind(a, 'click', reportButton.report);
}); });
}, },
cb: { report: function() {
report: function(e) { var id, set, url;
return reportButton.report(this); url = "http://sys.4chan.org/" + g.BOARD + "/imgboard.php?mode=report&no=" + this.parentNode.id;
} id = "" + NAMESPACE + "popup";
}, set = "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1,width=685,height=200";
report: function(target) { return window.open(url, id, set);
var input;
input = $('input', target.parentNode);
input.click();
$('input[value="Report"]').click();
return input.click();
} }
}; };
threadStats = { threadStats = {

View File

@ -893,7 +893,7 @@ options =
$.append hidingul, li $.append hidingul, li
$.bind $('button', li), 'click', options.clearHidden $.bind $('button', li), 'click', options.clearHidden
$.bind $('textarea[name=flavors]', dialog), 'change', $.cb.value $.bind $('#flavors', dialog), 'change', $.cb.value
$.bind $('input[name=time]', dialog), 'keyup', options.time $.bind $('input[name=time]', dialog), 'keyup', options.time
for input in $$ '#keybinds input', dialog for input in $$ '#keybinds input', dialog
input.value = conf[input.name] input.value = conf[input.name]
@ -1855,15 +1855,12 @@ reportButton =
innerHTML: '[&nbsp;!&nbsp;]' innerHTML: '[&nbsp;!&nbsp;]'
$.after span, a $.after span, a
$.after span, $.tn(' ') $.after span, $.tn(' ')
$.bind a, 'click', reportButton.cb.report $.bind a, 'click', reportButton.report
cb: report: ->
report: (e) -> url = "http://sys.4chan.org/#{g.BOARD}/imgboard.php?mode=report&no=#{@parentNode.id}"
reportButton.report @ id = "#{NAMESPACE}popup"
report: (target) -> set = "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1,width=685,height=200"
input = $ 'input', target.parentNode window.open url, id, set
input.click()
$('input[value="Report"]').click()
input.click()
threadStats = threadStats =
init: -> init: ->