Post without name keybind? close #491

This commit is contained in:
Zixaphir 2013-12-16 19:23:14 -07:00
parent 9d69beb137
commit ed84637551
4 changed files with 35 additions and 26 deletions

View File

@ -320,10 +320,7 @@
Indicators: { Indicators: {
'Emoji': ['enabled', 'Add icons besides usernames with triggered e-mails, like sega and neko.', ['enabled', 'disable ponies', 'only ponies', 'disable']], 'Emoji': ['enabled', 'Add icons besides usernames with triggered e-mails, like sega and neko.', ['enabled', 'disable ponies', 'only ponies', 'disable']],
'Emoji Position': ['before', 'Position of emoji icons.', ['before', 'after']], 'Emoji Position': ['before', 'Position of emoji icons.', ['before', 'after']],
'Emoji Spacing': ['5', 'Add some spacing between emoji and text.', 'text'], 'Emoji Spacing': ['5', 'Add some spacing between emoji and text.', 'text']
'Sage Highlighting': ['image', 'Icons or text to highlight saged posts.', ['text', 'image', 'none']],
'Sage Image': ['appchan', 'Image to use for sage highlighting.', ['4chan SS', 'appchan']],
'Sage Highlight Position': ['after', 'Position of Sage Highlighting', ['before', 'after']]
} }
}, },
threadWatcher: { threadWatcher: {
@ -389,8 +386,9 @@
'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.'],
'Toggle sage': ['Alt+s', 'Toggle sage in email field'], 'Toggle sage': ['Alt+s', 'Toggle sage in email field.'],
'Submit QR': ['Ctrl+Enter', 'Submit post.'], 'Submit QR': ['Ctrl+Enter', 'Submit post.'],
'Post Without Name': ['Alt+n', 'Clear name field and then submits 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.'],
@ -14987,6 +14985,12 @@
QR.submit(); QR.submit();
} }
break; break;
case Conf['Post Without Name']:
if (QR.nodes && !QR.status()) {
Keybinds.name();
QR.submit();
}
break;
case Conf['Update']: case Conf['Update']:
switch (g.VIEW) { switch (g.VIEW) {
case 'thread': case 'thread':
@ -15164,6 +15168,9 @@
ta.setSelectionRange(range, range); ta.setSelectionRange(range, range);
return $.event('input', null, ta); return $.event('input', null, ta);
}, },
name: function() {
return QR.nodes.name.value = '';
},
sage: function() { sage: function() {
var isSage; var isSage;

View File

@ -299,10 +299,7 @@
Indicators: { Indicators: {
'Emoji': ['enabled', 'Add icons besides usernames with triggered e-mails, like sega and neko.', ['enabled', 'disable ponies', 'only ponies', 'disable']], 'Emoji': ['enabled', 'Add icons besides usernames with triggered e-mails, like sega and neko.', ['enabled', 'disable ponies', 'only ponies', 'disable']],
'Emoji Position': ['before', 'Position of emoji icons.', ['before', 'after']], 'Emoji Position': ['before', 'Position of emoji icons.', ['before', 'after']],
'Emoji Spacing': ['5', 'Add some spacing between emoji and text.', 'text'], 'Emoji Spacing': ['5', 'Add some spacing between emoji and text.', 'text']
'Sage Highlighting': ['image', 'Icons or text to highlight saged posts.', ['text', 'image', 'none']],
'Sage Image': ['appchan', 'Image to use for sage highlighting.', ['4chan SS', 'appchan']],
'Sage Highlight Position': ['after', 'Position of Sage Highlighting', ['before', 'after']]
} }
}, },
threadWatcher: { threadWatcher: {
@ -368,8 +365,9 @@
'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.'],
'Toggle sage': ['Alt+s', 'Toggle sage in email field'], 'Toggle sage': ['Alt+s', 'Toggle sage in email field.'],
'Submit QR': ['Ctrl+Enter', 'Submit post.'], 'Submit QR': ['Ctrl+Enter', 'Submit post.'],
'Post Without Name': ['Alt+n', 'Clear name field and then submits 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.'],
@ -14979,6 +14977,12 @@
QR.submit(); QR.submit();
} }
break; break;
case Conf['Post Without Name']:
if (QR.nodes && !QR.status()) {
Keybinds.name();
QR.submit();
}
break;
case Conf['Update']: case Conf['Update']:
switch (g.VIEW) { switch (g.VIEW) {
case 'thread': case 'thread':
@ -15156,6 +15160,9 @@
ta.setSelectionRange(range, range); ta.setSelectionRange(range, range);
return $.event('input', null, ta); return $.event('input', null, ta);
}, },
name: function() {
return QR.nodes.name.value = '';
},
sage: function() { sage: function() {
var isSage; var isSage;

View File

@ -740,21 +740,6 @@ Config =
'Add some spacing between emoji and text.' 'Add some spacing between emoji and text.'
'text' 'text'
] ]
'Sage Highlighting': [
'image'
'Icons or text to highlight saged posts.'
['text', 'image', 'none']
]
'Sage Image': [
'appchan'
'Image to use for sage highlighting.'
['4chan SS', 'appchan']
]
'Sage Highlight Position': [
'after'
'Position of Sage Highlighting'
['before', 'after']
]
threadWatcher: threadWatcher:
'Current Board': [ 'Current Board': [
@ -945,12 +930,16 @@ box-shadow: inset 2px 2px 2px rgba(0,0,0,0.2);
] ]
'Toggle sage': [ 'Toggle sage': [
'Alt+s' 'Alt+s'
'Toggle sage in email field' 'Toggle sage in email field.'
] ]
'Submit QR': [ 'Submit QR': [
'Ctrl+Enter' 'Ctrl+Enter'
'Submit post.' 'Submit post.'
] ]
'Post Without Name': [
'Alt+n'
'Clear name field and then submits post.'
]
# Thread related # Thread related
'Watch': [ 'Watch': [
'w' 'w'

View File

@ -64,6 +64,10 @@ Keybinds =
Keybinds.sage() if QR.nodes 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()
when Conf['Post Without Name']
if QR.nodes and !QR.status()
Keybinds.name()
QR.submit()
# Index/Thread related # Index/Thread related
when Conf['Update'] when Conf['Update']
switch g.VIEW switch g.VIEW
@ -191,6 +195,8 @@ Keybinds =
# Fire the 'input' event # Fire the 'input' event
$.event 'input', null, ta $.event 'input', null, ta
name: -> QR.nodes.name.value = ''
sage: -> sage: ->
isSage = /sage/i.test QR.nodes.email.value isSage = /sage/i.test QR.nodes.email.value
QR.nodes.email.value = if isSage QR.nodes.email.value = if isSage