add x-browser GM_openInTab; add t - tabopen

This commit is contained in:
James Campos 2010-11-14 01:25:17 -08:00
parent 5be92870f6
commit 49f2251008
2 changed files with 28 additions and 3 deletions

View File

@ -50,6 +50,14 @@ AEOS =
style.type = 'text/css'
style.textContent = css
document.getElementsByTagName('head')[0].appendChild style
window.GM_openInTab = (url) ->
form = document.getElementById 'GM_form'
form.action = link
form.submit()
form = document.createElement 'form'
form.id = 'GM_form'
document.body.appendChild form
#dialog styling
GM_addStyle '
div.dialog {
@ -361,7 +369,7 @@ iframeLoad = ->
keyboardNav = (e) ->
char = String.fromCharCode e.keyCode
unless char in '1234567890GHJKLO'
unless char in '1234567890GHJKLOT'
return
e.preventDefault()
hash = location.hash
@ -407,6 +415,9 @@ keyboardNav = (e) ->
when "O"
qrLink = $ "#{hash} ~ span[id] a:not(:first-child)"
quickReply.call qrLink
when "T"
href = $("#{hash} ~ span[id] a:last-of-type").href
GM_openInTab href
g.count = 0
nodeInserted = (e) ->

View File

@ -22,6 +22,7 @@
};
AEOS = {
init: function() {
var form;
if (!(typeof GM_deleteValue !== "undefined" && GM_deleteValue !== null)) {
window.GM_setValue = function(name, value) {
value = (typeof value)[0] + value;
@ -50,6 +51,15 @@
style.textContent = css;
return document.getElementsByTagName('head')[0].appendChild(style);
};
window.GM_openInTab = function(url) {
var form;
form = document.getElementById('GM_form');
form.action = link;
return form.submit();
};
form = document.createElement('form');
form.id = 'GM_form';
document.body.appendChild(form);
}
return GM_addStyle('\
div.dialog {\
@ -445,9 +455,9 @@
return recaptchaReload();
};
keyboardNav = function(e) {
var _i, _len, char, count, hash, position, qrLink, temp;
var _i, _len, char, count, hash, href, position, qrLink, temp;
char = String.fromCharCode(e.keyCode);
if (!((function(){ for (var _i=0, _len='1234567890GHJKLO'.length; _i<_len; _i++) { if ('1234567890GHJKLO'[_i] === char) return true; } return false; }).call(this))) {
if (!((function(){ for (var _i=0, _len='1234567890GHJKLOT'.length; _i<_len; _i++) { if ('1234567890GHJKLOT'[_i] === char) return true; } return false; }).call(this))) {
return null;
}
e.preventDefault();
@ -515,6 +525,10 @@
qrLink = $("" + (hash) + " ~ span[id] a:not(:first-child)");
quickReply.call(qrLink);
break;
case "T":
href = $("" + (hash) + " ~ span[id] a:last-of-type").href;
GM_openInTab(href);
break;
}
return (g.count = 0);
};