keyNav -> keyAct
This commit is contained in:
parent
e45948b5cb
commit
dc3363a344
@ -11,7 +11,7 @@ config =
|
|||||||
'Reply Hiding': [true, 'Hide single replies']
|
'Reply Hiding': [true, 'Hide single replies']
|
||||||
'Show Stubs': [true, 'Of hidden threads / replies']
|
'Show Stubs': [true, 'Of hidden threads / replies']
|
||||||
'Thread Navigation': [true, 'Navigate to previous / next thread']
|
'Thread Navigation': [true, 'Navigate to previous / next thread']
|
||||||
'Keyboard Navigation': [false, 'Navigate threads w/ your keyboard']
|
'Keyboard Actions': [false, 'Perform actions with your keyboard']
|
||||||
'Reply Navigation': [true, 'Navigate to the beginning / end of a thread']
|
'Reply Navigation': [true, 'Navigate to the beginning / end of a thread']
|
||||||
'Thread Watcher': [true, 'Bookmark threads']
|
'Thread Watcher': [true, 'Bookmark threads']
|
||||||
'Thread Expansion': [true, 'View all replies']
|
'Thread Expansion': [true, 'View all replies']
|
||||||
@ -206,8 +206,8 @@ autoWatch = ->
|
|||||||
closeQR = ->
|
closeQR = ->
|
||||||
div = this.parentNode.parentNode
|
div = this.parentNode.parentNode
|
||||||
remove div
|
remove div
|
||||||
if not g.REPLY and getConfig 'Keyboard Navigation'
|
if not g.REPLY and getConfig 'Keyboard Actions'
|
||||||
d.addEventListener 'keydown', keyboardNav, true
|
d.addEventListener 'keydown', keyAct, true
|
||||||
|
|
||||||
clearHidden = ->
|
clearHidden = ->
|
||||||
#'hidden' might be misleading; it's the number of IDs we're *looking* for,
|
#'hidden' might be misleading; it's the number of IDs we're *looking* for,
|
||||||
@ -364,11 +364,11 @@ iframeLoad = ->
|
|||||||
$('input[title=autohide]:checked', qr)?.click()
|
$('input[title=autohide]:checked', qr)?.click()
|
||||||
else
|
else
|
||||||
remove qr
|
remove qr
|
||||||
if not g.REPLY and getConfig 'Keyboard Navigation'
|
if not g.REPLY and getConfig 'Keyboard Actions'
|
||||||
d.addEventListener 'keydown', keyboardNav, true
|
d.addEventListener 'keydown', keyAct, true
|
||||||
recaptchaReload()
|
recaptchaReload()
|
||||||
|
|
||||||
keyboardNav = (e) ->
|
keyAct = (e) ->
|
||||||
kc = e.keyCode
|
kc = e.keyCode
|
||||||
#https://developer.mozilla.org/en/DOM/Event/UIEvent/KeyEvent
|
#https://developer.mozilla.org/en/DOM/Event/UIEvent/KeyEvent
|
||||||
# [0-9;=A-Z]
|
# [0-9;=A-Z]
|
||||||
@ -504,7 +504,7 @@ parseResponse = (responseText) ->
|
|||||||
|
|
||||||
quickReply = (e) ->
|
quickReply = (e) ->
|
||||||
unless qr = $ '#qr'
|
unless qr = $ '#qr'
|
||||||
d.removeEventListener 'keydown', keyboardNav, true
|
d.removeEventListener 'keydown', keyAct, true
|
||||||
#make quick reply dialog
|
#make quick reply dialog
|
||||||
qr = AEOS.makeDialog 'qr', 'topleft'
|
qr = AEOS.makeDialog 'qr', 'topleft'
|
||||||
titlebar = n 'div',
|
titlebar = n 'div',
|
||||||
@ -947,8 +947,8 @@ if g.REPLY
|
|||||||
d.title = "/#{g.BOARD}/ - #{text}"
|
d.title = "/#{g.BOARD}/ - #{text}"
|
||||||
|
|
||||||
else #not reply
|
else #not reply
|
||||||
if getConfig 'Keyboard Navigation'
|
if getConfig 'Keyboard Actions'
|
||||||
d.addEventListener 'keydown', keyboardNav, true
|
d.addEventListener 'keydown', keyAct, true
|
||||||
|
|
||||||
if getConfig 'Thread Hiding'
|
if getConfig 'Thread Hiding'
|
||||||
delform = $('form[name=delform]')
|
delform = $('form[name=delform]')
|
||||||
|
|||||||
18
4chan_x.js
18
4chan_x.js
@ -1,12 +1,12 @@
|
|||||||
(function() {
|
(function() {
|
||||||
var $, $$, AEOS, DAY, _, _i, _len, _ref, _ref2, a, addTo, arr, as, autoWatch, autohide, b, board, callback, clearHidden, closeQR, config, cooldown, cutoff, d, delform, down, editSauce, el, expandComment, expandThread, formSubmit, g, getConfig, getTime, hide, hideReply, hideThread, href, html, id, iframe, iframeLoad, inAfter, inBefore, inputs, keyboardNav, l1, lastChecked, m, n, navbotr, navtopr, nodeInserted, now, omitted, onloadComment, onloadThread, options, optionsClose, parseResponse, pathname, quickReply, recaptcha, recaptchaListener, recaptchaReload, redirect, remove, replace, replyNav, report, show, showReply, showThread, slice, span, stopPropagation, temp, text, textContent, thread, threadF, threads, tn, up, watch, watchX, watcher, watcherUpdate, x;
|
var $, $$, AEOS, DAY, _, _i, _len, _ref, _ref2, a, addTo, arr, as, autoWatch, autohide, b, board, callback, clearHidden, closeQR, config, cooldown, cutoff, d, delform, down, editSauce, el, expandComment, expandThread, formSubmit, g, getConfig, getTime, hide, hideReply, hideThread, href, html, id, iframe, iframeLoad, inAfter, inBefore, inputs, keyAct, l1, lastChecked, m, n, navbotr, navtopr, nodeInserted, now, omitted, onloadComment, onloadThread, options, optionsClose, parseResponse, pathname, quickReply, recaptcha, recaptchaListener, recaptchaReload, redirect, remove, replace, replyNav, report, show, showReply, showThread, slice, span, stopPropagation, temp, text, textContent, thread, threadF, threads, tn, up, watch, watchX, watcher, watcherUpdate, x;
|
||||||
var __slice = Array.prototype.slice, __hasProp = Object.prototype.hasOwnProperty;
|
var __slice = Array.prototype.slice, __hasProp = Object.prototype.hasOwnProperty;
|
||||||
config = {
|
config = {
|
||||||
'Thread Hiding': [true, 'Hide entire threads'],
|
'Thread Hiding': [true, 'Hide entire threads'],
|
||||||
'Reply Hiding': [true, 'Hide single replies'],
|
'Reply Hiding': [true, 'Hide single replies'],
|
||||||
'Show Stubs': [true, 'Of hidden threads / replies'],
|
'Show Stubs': [true, 'Of hidden threads / replies'],
|
||||||
'Thread Navigation': [true, 'Navigate to previous / next thread'],
|
'Thread Navigation': [true, 'Navigate to previous / next thread'],
|
||||||
'Keyboard Navigation': [false, 'Navigate threads w/ your keyboard'],
|
'Keyboard Actions': [false, 'Perform actions with your keyboard'],
|
||||||
'Reply Navigation': [true, 'Navigate to the beginning / end of a thread'],
|
'Reply Navigation': [true, 'Navigate to the beginning / end of a thread'],
|
||||||
'Thread Watcher': [true, 'Bookmark threads'],
|
'Thread Watcher': [true, 'Bookmark threads'],
|
||||||
'Thread Expansion': [true, 'View all replies'],
|
'Thread Expansion': [true, 'View all replies'],
|
||||||
@ -272,7 +272,7 @@
|
|||||||
var div;
|
var div;
|
||||||
div = this.parentNode.parentNode;
|
div = this.parentNode.parentNode;
|
||||||
remove(div);
|
remove(div);
|
||||||
return !g.REPLY && getConfig('Keyboard Navigation') ? d.addEventListener('keydown', keyboardNav, true) : null;
|
return !g.REPLY && getConfig('Keyboard Actions') ? d.addEventListener('keydown', keyAct, true) : null;
|
||||||
};
|
};
|
||||||
clearHidden = function() {
|
clearHidden = function() {
|
||||||
GM_deleteValue("hiddenReplies/" + (g.BOARD) + "/");
|
GM_deleteValue("hiddenReplies/" + (g.BOARD) + "/");
|
||||||
@ -449,13 +449,13 @@
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
remove(qr);
|
remove(qr);
|
||||||
if (!g.REPLY && getConfig('Keyboard Navigation')) {
|
if (!g.REPLY && getConfig('Keyboard Actions')) {
|
||||||
d.addEventListener('keydown', keyboardNav, true);
|
d.addEventListener('keydown', keyAct, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return recaptchaReload();
|
return recaptchaReload();
|
||||||
};
|
};
|
||||||
keyboardNav = function(e) {
|
keyAct = function(e) {
|
||||||
var _i, _len, char, count, hash, href, img, kc, position, qrLink, temp;
|
var _i, _len, char, count, hash, href, img, kc, position, qrLink, temp;
|
||||||
kc = e.keyCode;
|
kc = e.keyCode;
|
||||||
if (!((48 <= kc) && (kc <= 90))) {
|
if (!((48 <= kc) && (kc <= 90))) {
|
||||||
@ -655,7 +655,7 @@
|
|||||||
quickReply = function(e) {
|
quickReply = function(e) {
|
||||||
var _i, _len, _ref, _ref2, auto, autoBox, autohideB, clone, closeB, form, id, input, qr, script, selection, submit, text, textarea, titlebar, xpath;
|
var _i, _len, _ref, _ref2, auto, autoBox, autohideB, clone, closeB, form, id, input, qr, script, selection, submit, text, textarea, titlebar, xpath;
|
||||||
if (!(qr = $('#qr'))) {
|
if (!(qr = $('#qr'))) {
|
||||||
d.removeEventListener('keydown', keyboardNav, true);
|
d.removeEventListener('keydown', keyAct, true);
|
||||||
qr = AEOS.makeDialog('qr', 'topleft');
|
qr = AEOS.makeDialog('qr', 'topleft');
|
||||||
titlebar = n('div', {
|
titlebar = n('div', {
|
||||||
innerHTML: 'Quick Reply ',
|
innerHTML: 'Quick Reply ',
|
||||||
@ -1223,8 +1223,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (getConfig('Keyboard Navigation')) {
|
if (getConfig('Keyboard Actions')) {
|
||||||
d.addEventListener('keydown', keyboardNav, true);
|
d.addEventListener('keydown', keyAct, true);
|
||||||
}
|
}
|
||||||
if (getConfig('Thread Hiding')) {
|
if (getConfig('Thread Hiding')) {
|
||||||
delform = $('form[name=delform]');
|
delform = $('form[name=delform]');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user