Report Button: simpler selector, use xpath to avoid problems next year with silly hats.
This commit is contained in:
parent
716a335488
commit
e43d6d4431
@ -2598,7 +2598,7 @@
|
|||||||
return g.callbacks.push(function(root) {
|
return g.callbacks.push(function(root) {
|
||||||
var a, span;
|
var a, span;
|
||||||
if (!(a = $('.reportbutton', root))) {
|
if (!(a = $('.reportbutton', root))) {
|
||||||
span = $('span[id^=no]', root);
|
span = $('span[id]', root);
|
||||||
a = $.el('a', {
|
a = $.el('a', {
|
||||||
className: 'reportbutton',
|
className: 'reportbutton',
|
||||||
innerHTML: '[ ! ]'
|
innerHTML: '[ ! ]'
|
||||||
@ -2611,7 +2611,7 @@
|
|||||||
},
|
},
|
||||||
report: function() {
|
report: function() {
|
||||||
var id, set, url;
|
var id, set, url;
|
||||||
url = "http://sys.4chan.org/" + g.BOARD + "/imgboard.php?mode=report&no=" + this.previousElementSibling.childNodes[1].textContent;
|
url = "http://sys.4chan.org/" + g.BOARD + "/imgboard.php?mode=report&no=" + ($.x('preceding-sibling::input', this).name);
|
||||||
id = "" + NAMESPACE + "popup";
|
id = "" + NAMESPACE + "popup";
|
||||||
set = "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1,width=685,height=200";
|
set = "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1,width=685,height=200";
|
||||||
return window.open(url, id, set);
|
return window.open(url, id, set);
|
||||||
|
|||||||
@ -1919,7 +1919,7 @@ reportButton =
|
|||||||
init: ->
|
init: ->
|
||||||
g.callbacks.push (root) ->
|
g.callbacks.push (root) ->
|
||||||
if not a = $ '.reportbutton', root
|
if not a = $ '.reportbutton', root
|
||||||
span = $ 'span[id^=no]', root
|
span = $ 'span[id]', root
|
||||||
a = $.el 'a',
|
a = $.el 'a',
|
||||||
className: 'reportbutton'
|
className: 'reportbutton'
|
||||||
innerHTML: '[ ! ]'
|
innerHTML: '[ ! ]'
|
||||||
@ -1927,7 +1927,7 @@ reportButton =
|
|||||||
$.after span, $.tn(' ')
|
$.after span, $.tn(' ')
|
||||||
$.bind a, 'click', reportButton.report
|
$.bind a, 'click', reportButton.report
|
||||||
report: ->
|
report: ->
|
||||||
url = "http://sys.4chan.org/#{g.BOARD}/imgboard.php?mode=report&no=#{@previousElementSibling.childNodes[1].textContent}"
|
url = "http://sys.4chan.org/#{g.BOARD}/imgboard.php?mode=report&no=#{$.x('preceding-sibling::input', @).name}"
|
||||||
id = "#{NAMESPACE}popup"
|
id = "#{NAMESPACE}popup"
|
||||||
set = "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1,width=685,height=200"
|
set = "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1,width=685,height=200"
|
||||||
window.open url, id, set
|
window.open url, id, set
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user