g.startup; better qr keybind
This commit is contained in:
parent
5e86a62974
commit
0df39c402a
@ -407,8 +407,6 @@ keypress = (e) ->
|
||||
when "I"
|
||||
qrLink = $ "#{hash} ~ span[id] a:not(:first-child)"
|
||||
quickReply.call qrLink
|
||||
ta = $ '#qr textarea'
|
||||
ta.focus()
|
||||
when "J"
|
||||
temp = position + count
|
||||
if temp > 9 then temp = 9
|
||||
@ -577,8 +575,8 @@ quickReply = (e) ->
|
||||
inBefore submit, auto
|
||||
addTo qr, clone
|
||||
addTo d.body, qr
|
||||
if e
|
||||
e.preventDefault()
|
||||
unless g.startup
|
||||
e?.preventDefault()
|
||||
$('input[title=autohide]:checked', qr)?.click()
|
||||
selection = window.getSelection()
|
||||
id = x('preceding::span[@id][1]', selection.anchorNode)?.id
|
||||
@ -723,6 +721,7 @@ g =
|
||||
'http://saucenao.com/search.php?db=999&url='
|
||||
'http://tineye.com/search?url='
|
||||
].join '\n'
|
||||
startup: true
|
||||
pathname = location.pathname.substring(1).split('/')
|
||||
[g.BOARD, temp] = pathname
|
||||
if temp is 'res'
|
||||
@ -1042,3 +1041,4 @@ else #not reply
|
||||
|
||||
callback() for callback in g.callbacks
|
||||
d.body.addEventListener('DOMNodeInserted', nodeInserted, true)
|
||||
g.startup = false
|
||||
|
||||
12
4chan_x.js
12
4chan_x.js
@ -447,7 +447,7 @@
|
||||
return recaptchaReload();
|
||||
};
|
||||
keypress = function(e) {
|
||||
var _i, _len, char, count, hash, href, img, kc, position, qrLink, ta, temp;
|
||||
var _i, _len, char, count, hash, href, img, kc, position, qrLink, temp;
|
||||
kc = g.keyCode;
|
||||
if (kc === -1) {
|
||||
return null;
|
||||
@ -506,8 +506,6 @@
|
||||
case "I":
|
||||
qrLink = $("" + (hash) + " ~ span[id] a:not(:first-child)");
|
||||
quickReply.call(qrLink);
|
||||
ta = $('#qr textarea');
|
||||
ta.focus();
|
||||
break;
|
||||
case "J":
|
||||
temp = position + count;
|
||||
@ -747,8 +745,8 @@
|
||||
addTo(qr, clone);
|
||||
addTo(d.body, qr);
|
||||
}
|
||||
if (e) {
|
||||
e.preventDefault();
|
||||
if (!(g.startup)) {
|
||||
(typeof e === "undefined" || e === null) ? undefined : e.preventDefault();
|
||||
(typeof (_ref2 = ((_ref = $('input[title=autohide]:checked', qr)))) === "undefined" || _ref2 === null) ? undefined : _ref2.click();
|
||||
selection = window.getSelection();
|
||||
id = (typeof (_ref2 = ((_ref = x('preceding::span[@id][1]', selection.anchorNode)))) === "undefined" || _ref2 === null) ? undefined : _ref2.id;
|
||||
@ -921,7 +919,8 @@
|
||||
watched: JSON.parse(GM_getValue('watched', '{}')),
|
||||
favEmpty: 'data:image/gif;base64,R0lGODlhEAAQAJEAAAAAAP///9vb2////yH5BAEAAAMALAAAAAAQABAAAAIvnI+pq+D9DBAUoFkPFnbs7lFZKIJOJJ3MyraoB14jFpOcVMpzrnF3OKlZYsMWowAAOw==',
|
||||
favNormal: ((typeof (_ref2 = ((_ref = $('link[rel="shortcut icon"]', $('head', d))))) === "undefined" || _ref2 === null) ? undefined : _ref2.href) || 'http://static.4chan.org/image/favicon.ico',
|
||||
flavors: ['http://regex.info/exif.cgi?url=', 'http://iqdb.org/?url=', 'http://saucenao.com/search.php?db=999&url=', 'http://tineye.com/search?url='].join('\n')
|
||||
flavors: ['http://regex.info/exif.cgi?url=', 'http://iqdb.org/?url=', 'http://saucenao.com/search.php?db=999&url=', 'http://tineye.com/search?url='].join('\n'),
|
||||
startup: true
|
||||
};
|
||||
pathname = location.pathname.substring(1).split('/');
|
||||
_ref = pathname;
|
||||
@ -1350,4 +1349,5 @@
|
||||
callback();
|
||||
}
|
||||
d.body.addEventListener('DOMNodeInserted', nodeInserted, true);
|
||||
g.startup = false;
|
||||
}).call(this);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user