Fix duplicate file link.

This commit is contained in:
Nicolas Stepien 2012-09-02 14:55:21 +02:00
parent a92f4261a5
commit f5ebd27b3a
3 changed files with 11 additions and 21 deletions

View File

@ -2448,11 +2448,7 @@
},
onerror: function() {
QR.status();
return QR.error($.el('a', {
href: '//www.4chan.org/banned',
target: '_blank',
textContent: 'Connection error, or you are banned.'
}));
return QR.error('Connection error with sys.4chan.org.');
}
};
opts = {
@ -2473,7 +2469,7 @@
return QR.ajax = $.ajax($.id('postForm').parentNode.action, callbacks, opts);
},
response: function(html) {
var bs, doc, err, msg, persona, postID, reply, threadID, _, _ref;
var bs, doc, err, msg, persona, postID, reply, threadID, _, _ref, _ref1;
doc = d.implementation.createHTMLDocument('');
doc.documentElement.innerHTML = html;
if (doc.title === '4chan - Banned') {
@ -2481,11 +2477,9 @@
err = $.el('span', {
innerHTML: /^You were issued a warning/.test($('.boxcontent', doc).textContent.trim()) ? "You were issued a warning on " + bs[0].innerHTML + " as " + bs[3].innerHTML + ".<br>Warning reason: " + bs[1].innerHTML : "You are banned! ;_;<br>Please click <a href=//www.4chan.org/banned target=_blank>HERE</a> to see the reason."
});
} else if (msg = doc.getElementById('errmsg')) {
err = msg.textContent;
if (msg.firstChild.tagName) {
err = msg.firstChild;
err.target = '_blank';
} else if (err = doc.getElementById('errmsg')) {
if ((_ref = $('a', err)) != null) {
_ref.target = '_blank';
}
} else if (!(msg = $('b', doc))) {
err = 'Connection error with sys.4chan.org.';
@ -2509,7 +2503,7 @@
sub: Conf['Remember Subject'] ? reply.sub : null
};
$.set('QR.persona', persona);
_ref = msg.lastChild.textContent.match(/thread:(\d+),no:(\d+)/), _ = _ref[0], threadID = _ref[1], postID = _ref[2];
_ref1 = msg.lastChild.textContent.match(/thread:(\d+),no:(\d+)/), _ = _ref1[0], threadID = _ref1[1], postID = _ref1[2];
$.event(QR.el, new CustomEvent('QRPostSuccessful', {
bubbles: true,
detail: {

View File

@ -1,4 +1,6 @@
master
- Mayhem
Fix duplicate file upload error link.
2.34.8
- Mayhem

View File

@ -1910,10 +1910,7 @@ QR =
# Connection error, or
# CORS disabled error on www.4chan.org/banned
QR.status()
QR.error $.el 'a',
href: '//www.4chan.org/banned'
target: '_blank'
textContent: 'Connection error, or you are banned.'
QR.error 'Connection error with sys.4chan.org.'
opts =
form: $.formData post
upCallbacks:
@ -1937,11 +1934,8 @@ QR =
"You were issued a warning on #{bs[0].innerHTML} as #{bs[3].innerHTML}.<br>Warning reason: #{bs[1].innerHTML}"
else
"You are banned! ;_;<br>Please click <a href=//www.4chan.org/banned target=_blank>HERE</a> to see the reason."
else if msg = doc.getElementById 'errmsg' # error!
err = msg.textContent
if msg.firstChild.tagName # duplicate image link
err = msg.firstChild
err.target = '_blank'
else if err = doc.getElementById 'errmsg' # error!
$('a', err)?.target = '_blank' # duplicate image link
else unless msg = $ 'b', doc
err = 'Connection error with sys.4chan.org.'