This commit is contained in:
Nicolas Stepien 2012-03-05 14:16:06 +01:00
parent 06afb476e1
commit ddb5007f10
2 changed files with 11 additions and 10 deletions

View File

@ -448,6 +448,9 @@
off: function(el, eventType, handler) {
return el.removeEventListener(eventType, handler, false);
},
open: function(url) {
return (GM_openInTab || window.open)(url, '_blank');
},
isDST: function() {
/*
http://en.wikipedia.org/wiki/Eastern_Time_Zone
@ -1149,12 +1152,11 @@
return $('textarea', qr.el).focus();
},
open: function(thread, tab) {
var id, open, url;
var id, url;
id = thread.firstChild.id;
url = "http://boards.4chan.org/" + g.BOARD + "/res/" + id;
if (tab) {
open = GM_openInTab || window.open;
return open(url, "_blank");
return $.open(url);
} else {
return location.href = url;
}
@ -1911,7 +1913,7 @@
return qr.message.send(post);
},
response: function(html) {
var b, doc, err, node, open, persona, postNumber, reply, thread, _, _ref;
var b, doc, err, node, persona, postNumber, reply, thread, _, _ref;
doc = $.el('a', {
innerHTML: html
});
@ -1960,8 +1962,7 @@
qr.cooldown.auto = qr.replies.length > 1;
qr.cooldown.set(/sage/i.test(reply.email) ? 60 : 30);
if (conf['Open Reply in New Tab'] && !g.REPLY && !qr.cooldown.auto) {
open = GM_openInTab || window.open;
open("http://boards.4chan.org/" + g.BOARD + "/res/" + thread + "#" + postNumber, "_blank");
$.open("http://boards.4chan.org/" + g.BOARD + "/res/" + thread + "#" + postNumber);
}
}
if (conf['Persistent QR'] || qr.cooldown.auto) {

View File

@ -349,6 +349,8 @@ $.extend $,
el.addEventListener eventType, handler, false
off: (el, eventType, handler) ->
el.removeEventListener eventType, handler, false
open: (url) ->
(GM_openInTab or window.open) url, '_blank'
isDST: ->
###
http://en.wikipedia.org/wiki/Eastern_Time_Zone
@ -920,8 +922,7 @@ keybinds =
id = thread.firstChild.id
url = "http://boards.4chan.org/#{g.BOARD}/res/#{id}"
if tab
open = GM_openInTab or window.open
open url, "_blank"
$.open url
else
location.href = url
@ -1594,8 +1595,7 @@ qr =
qr.cooldown.auto = qr.replies.length > 1
qr.cooldown.set if /sage/i.test reply.email then 60 else 30
if conf['Open Reply in New Tab'] && !g.REPLY && !qr.cooldown.auto
open = GM_openInTab or window.open
open "http://boards.4chan.org/#{g.BOARD}/res/#{thread}##{postNumber}", "_blank"
$.open "http://boards.4chan.org/#{g.BOARD}/res/#{thread}##{postNumber}"
if conf['Persistent QR'] or qr.cooldown.auto
reply.rm()