Add sage toggle, close #23
This commit is contained in:
parent
b7b95fdc71
commit
7181d008fe
@ -183,7 +183,8 @@
|
|||||||
'Code tags': ['Alt+c', 'Insert code tags.'],
|
'Code tags': ['Alt+c', 'Insert code tags.'],
|
||||||
'Eqn tags': ['Alt+e', 'Insert eqn tags.'],
|
'Eqn tags': ['Alt+e', 'Insert eqn tags.'],
|
||||||
'Math tags': ['Alt+m', 'Insert math tags.'],
|
'Math tags': ['Alt+m', 'Insert math tags.'],
|
||||||
'Submit QR': ['Alt+s', 'Submit post.'],
|
'Toggle sage': ['Alt+s', 'Toggle sage in email field'],
|
||||||
|
'Submit QR': ['Ctrl+Enter', 'Submit post.'],
|
||||||
'Watch': ['w', 'Watch thread.'],
|
'Watch': ['w', 'Watch thread.'],
|
||||||
'Update': ['r', 'Update the thread now.'],
|
'Update': ['r', 'Update the thread now.'],
|
||||||
'Expand image': ['Shift+e', 'Expand selected image.'],
|
'Expand image': ['Shift+e', 'Expand selected image.'],
|
||||||
@ -5096,6 +5097,11 @@
|
|||||||
}
|
}
|
||||||
Keybinds.tags('math', target);
|
Keybinds.tags('math', target);
|
||||||
break;
|
break;
|
||||||
|
case Conf['Toggle sage']:
|
||||||
|
if (QR.nodes) {
|
||||||
|
Keybinds.sage();
|
||||||
|
}
|
||||||
|
break;
|
||||||
case Conf['Submit QR']:
|
case Conf['Submit QR']:
|
||||||
if (QR.nodes && !QR.status()) {
|
if (QR.nodes && !QR.status()) {
|
||||||
QR.submit();
|
QR.submit();
|
||||||
@ -5247,6 +5253,16 @@
|
|||||||
ta.setSelectionRange(range, range);
|
ta.setSelectionRange(range, range);
|
||||||
return $.event('input', null, ta);
|
return $.event('input', null, ta);
|
||||||
},
|
},
|
||||||
|
sage: function() {
|
||||||
|
var isSage;
|
||||||
|
|
||||||
|
isSage = /sage/i.test(QR.nodes.email.value);
|
||||||
|
if (isSage) {
|
||||||
|
return QR.nodes.email.value = "";
|
||||||
|
} else {
|
||||||
|
return QR.nodes.email.value = "sage";
|
||||||
|
}
|
||||||
|
},
|
||||||
img: function(thread, all) {
|
img: function(thread, all) {
|
||||||
var post;
|
var post;
|
||||||
|
|
||||||
|
|||||||
@ -184,7 +184,8 @@
|
|||||||
'Code tags': ['Alt+c', 'Insert code tags.'],
|
'Code tags': ['Alt+c', 'Insert code tags.'],
|
||||||
'Eqn tags': ['Alt+e', 'Insert eqn tags.'],
|
'Eqn tags': ['Alt+e', 'Insert eqn tags.'],
|
||||||
'Math tags': ['Alt+m', 'Insert math tags.'],
|
'Math tags': ['Alt+m', 'Insert math tags.'],
|
||||||
'Submit QR': ['Alt+s', 'Submit post.'],
|
'Toggle sage': ['Alt+s', 'Toggle sage in email field'],
|
||||||
|
'Submit QR': ['Ctrl+Enter', 'Submit post.'],
|
||||||
'Watch': ['w', 'Watch thread.'],
|
'Watch': ['w', 'Watch thread.'],
|
||||||
'Update': ['r', 'Update the thread now.'],
|
'Update': ['r', 'Update the thread now.'],
|
||||||
'Expand image': ['Shift+e', 'Expand selected image.'],
|
'Expand image': ['Shift+e', 'Expand selected image.'],
|
||||||
@ -5087,6 +5088,11 @@
|
|||||||
}
|
}
|
||||||
Keybinds.tags('math', target);
|
Keybinds.tags('math', target);
|
||||||
break;
|
break;
|
||||||
|
case Conf['Toggle sage']:
|
||||||
|
if (QR.nodes) {
|
||||||
|
Keybinds.sage();
|
||||||
|
}
|
||||||
|
break;
|
||||||
case Conf['Submit QR']:
|
case Conf['Submit QR']:
|
||||||
if (QR.nodes && !QR.status()) {
|
if (QR.nodes && !QR.status()) {
|
||||||
QR.submit();
|
QR.submit();
|
||||||
@ -5238,6 +5244,16 @@
|
|||||||
ta.setSelectionRange(range, range);
|
ta.setSelectionRange(range, range);
|
||||||
return $.event('input', null, ta);
|
return $.event('input', null, ta);
|
||||||
},
|
},
|
||||||
|
sage: function() {
|
||||||
|
var isSage;
|
||||||
|
|
||||||
|
isSage = /sage/i.test(QR.nodes.email.value);
|
||||||
|
if (isSage) {
|
||||||
|
return QR.nodes.email.value = "";
|
||||||
|
} else {
|
||||||
|
return QR.nodes.email.value = "sage";
|
||||||
|
}
|
||||||
|
},
|
||||||
img: function(thread, all) {
|
img: function(thread, all) {
|
||||||
var post;
|
var post;
|
||||||
|
|
||||||
|
|||||||
@ -140,7 +140,8 @@
|
|||||||
'Code tags': ['Alt+c', 'Insert code tags.'],
|
'Code tags': ['Alt+c', 'Insert code tags.'],
|
||||||
'Eqn tags': ['Alt+e', 'Insert eqn tags.'],
|
'Eqn tags': ['Alt+e', 'Insert eqn tags.'],
|
||||||
'Math tags': ['Alt+m', 'Insert math tags.'],
|
'Math tags': ['Alt+m', 'Insert math tags.'],
|
||||||
'Submit QR': ['Alt+s', 'Submit post.'],
|
'Toggle sage': ['Alt+s', 'Toggle sage in email field'],
|
||||||
|
'Submit QR': ['Ctrl+Enter', 'Submit post.'],
|
||||||
'Watch': ['w', 'Watch thread.'],
|
'Watch': ['w', 'Watch thread.'],
|
||||||
'Update': ['r', 'Update the thread now.'],
|
'Update': ['r', 'Update the thread now.'],
|
||||||
'Expand image': ['Shift+e', 'Expand selected image.'],
|
'Expand image': ['Shift+e', 'Expand selected image.'],
|
||||||
@ -5010,6 +5011,11 @@
|
|||||||
}
|
}
|
||||||
Keybinds.tags('math', target);
|
Keybinds.tags('math', target);
|
||||||
break;
|
break;
|
||||||
|
case Conf['Toggle sage']:
|
||||||
|
if (QR.nodes) {
|
||||||
|
Keybinds.sage();
|
||||||
|
}
|
||||||
|
break;
|
||||||
case Conf['Submit QR']:
|
case Conf['Submit QR']:
|
||||||
if (QR.nodes && !QR.status()) {
|
if (QR.nodes && !QR.status()) {
|
||||||
QR.submit();
|
QR.submit();
|
||||||
@ -5161,6 +5167,16 @@
|
|||||||
ta.setSelectionRange(range, range);
|
ta.setSelectionRange(range, range);
|
||||||
return $.event('input', null, ta);
|
return $.event('input', null, ta);
|
||||||
},
|
},
|
||||||
|
sage: function() {
|
||||||
|
var isSage;
|
||||||
|
|
||||||
|
isSage = /sage/i.test(QR.nodes.email.value);
|
||||||
|
if (isSage) {
|
||||||
|
return QR.nodes.email.value = "";
|
||||||
|
} else {
|
||||||
|
return QR.nodes.email.value = "sage";
|
||||||
|
}
|
||||||
|
},
|
||||||
img: function(thread, all) {
|
img: function(thread, all) {
|
||||||
var post;
|
var post;
|
||||||
|
|
||||||
|
|||||||
@ -446,8 +446,12 @@ http://iqdb.org/?url=%TURL
|
|||||||
'Alt+m'
|
'Alt+m'
|
||||||
'Insert math tags.'
|
'Insert math tags.'
|
||||||
]
|
]
|
||||||
'Submit QR': [
|
'Toggle sage': [
|
||||||
'Alt+s'
|
'Alt+s'
|
||||||
|
'Toggle sage in email field'
|
||||||
|
]
|
||||||
|
'Submit QR': [
|
||||||
|
'Ctrl+Enter'
|
||||||
'Submit post.'
|
'Submit post.'
|
||||||
]
|
]
|
||||||
# Thread related
|
# Thread related
|
||||||
|
|||||||
@ -50,6 +50,8 @@ Keybinds =
|
|||||||
when Conf['Math tags']
|
when Conf['Math tags']
|
||||||
return if target.nodeName isnt 'TEXTAREA'
|
return if target.nodeName isnt 'TEXTAREA'
|
||||||
Keybinds.tags 'math', target
|
Keybinds.tags 'math', target
|
||||||
|
when Conf['Toggle sage']
|
||||||
|
do Keybinds.sage if QR.nodes
|
||||||
when Conf['Submit QR']
|
when Conf['Submit QR']
|
||||||
QR.submit() if QR.nodes and !QR.status()
|
QR.submit() if QR.nodes and !QR.status()
|
||||||
# Thread related
|
# Thread related
|
||||||
@ -161,6 +163,13 @@ Keybinds =
|
|||||||
# Fire the 'input' event
|
# Fire the 'input' event
|
||||||
$.event 'input', null, ta
|
$.event 'input', null, ta
|
||||||
|
|
||||||
|
sage: ->
|
||||||
|
isSage = /sage/i.test QR.nodes.email.value
|
||||||
|
if isSage
|
||||||
|
QR.nodes.email.value = ""
|
||||||
|
else
|
||||||
|
QR.nodes.email.value = "sage"
|
||||||
|
|
||||||
img: (thread, all) ->
|
img: (thread, all) ->
|
||||||
if all
|
if all
|
||||||
ImageExpand.cb.toggleAll()
|
ImageExpand.cb.toggleAll()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user