Fix the QR's thread select.

This commit is contained in:
Zixaphir 2013-05-06 15:43:02 -07:00
parent 376a7a1218
commit 59c6b551a1
5 changed files with 16 additions and 19 deletions

View File

@ -1,5 +1,5 @@
/*
* appchan x - Version 2.0.0 - 2013-05-05
* appchan x - Version 2.0.0 - 2013-05-06
*
* Licensed under the MIT license.
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE

View File

@ -19,7 +19,7 @@
// ==/UserScript==
/*
* appchan x - Version 2.0.0 - 2013-05-05
* appchan x - Version 2.0.0 - 2013-05-06
*
* Licensed under the MIT license.
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE
@ -7097,6 +7097,7 @@
if (!com.value) {
thread.value = OP.ID;
}
thread.nextElementSibling.firstElementChild.textContent = thread.options[thread.selectedIndex].textContent;
caretPos = com.selectionStart;
com.value = com.value.slice(0, caretPos) + text + com.value.slice(com.selectionEnd);
range = caretPos + text.length;
@ -7104,9 +7105,7 @@
com.focus();
QR.selected.save(com);
QR.selected.save(thread);
if (Conf['QR Shortcut']) {
return $.rmClass($('.qr-shortcut'), 'disabled');
}
return $.rmClass($('.qr-shortcut'), 'disabled');
},
characterCount: function() {
var count, counter;
@ -7776,7 +7775,7 @@
for (thread in g.BOARD.threads) {
$.add(nodes.thread, $.el('option', {
value: thread,
textContent: "Thread No." + thread
textContent: "No." + thread
}));
}
$.on(nodes.filename.parentNode, 'click keyup', QR.openFileInput);

View File

@ -19,7 +19,7 @@
// ==/UserScript==
/*
* appchan x - Version 2.0.0 - 2013-05-05
* appchan x - Version 2.0.0 - 2013-05-06
*
* Licensed under the MIT license.
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE
@ -7093,6 +7093,7 @@
if (!com.value) {
thread.value = OP.ID;
}
thread.nextElementSibling.firstElementChild.textContent = thread.options[thread.selectedIndex].textContent;
caretPos = com.selectionStart;
com.value = com.value.slice(0, caretPos) + text + com.value.slice(com.selectionEnd);
range = caretPos + text.length;
@ -7100,9 +7101,7 @@
com.focus();
QR.selected.save(com);
QR.selected.save(thread);
if (Conf['QR Shortcut']) {
return $.rmClass($('.qr-shortcut'), 'disabled');
}
return $.rmClass($('.qr-shortcut'), 'disabled');
},
characterCount: function() {
var count, counter;
@ -7781,7 +7780,7 @@
for (thread in g.BOARD.threads) {
$.add(nodes.thread, $.el('option', {
value: thread,
textContent: "Thread No." + thread
textContent: "No." + thread
}));
}
$.on(nodes.filename.parentNode, 'click keyup', QR.openFileInput);

View File

@ -1,5 +1,5 @@
/*
* appchan x - Version 2.0.0 - 2013-05-05
* appchan x - Version 2.0.0 - 2013-05-06
*
* Licensed under the MIT license.
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE
@ -7095,6 +7095,7 @@
if (!com.value) {
thread.value = OP.ID;
}
thread.nextElementSibling.firstElementChild.textContent = thread.options[thread.selectedIndex].textContent;
caretPos = com.selectionStart;
com.value = com.value.slice(0, caretPos) + text + com.value.slice(com.selectionEnd);
range = caretPos + text.length;
@ -7102,9 +7103,7 @@
com.focus();
QR.selected.save(com);
QR.selected.save(thread);
if (Conf['QR Shortcut']) {
return $.rmClass($('.qr-shortcut'), 'disabled');
}
return $.rmClass($('.qr-shortcut'), 'disabled');
},
characterCount: function() {
var count, counter;
@ -7775,7 +7774,7 @@
for (thread in g.BOARD.threads) {
$.add(nodes.thread, $.el('option', {
value: thread,
textContent: "Thread No." + thread
textContent: "No." + thread
}));
}
$.on(nodes.filename.parentNode, 'click keyup', QR.openFileInput);

View File

@ -355,6 +355,7 @@ QR =
QR.cooldown.auto = true
{com, thread} = QR.nodes
thread.value = OP.ID unless com.value
thread.nextElementSibling.firstElementChild.textContent = thread.options[thread.selectedIndex].textContent
caretPos = com.selectionStart
# Replace selection for text.
@ -367,8 +368,7 @@ QR =
QR.selected.save com
QR.selected.save thread
if Conf['QR Shortcut']
$.rmClass $('.qr-shortcut'), 'disabled'
$.rmClass $('.qr-shortcut'), 'disabled'
characterCount: ->
counter = QR.nodes.charCount
@ -915,7 +915,7 @@ QR =
for thread of g.BOARD.threads
$.add nodes.thread, $.el 'option',
value: thread
textContent: "Thread No.#{thread}"
textContent: "No.#{thread}"
$.on nodes.filename.parentNode, 'click keyup', QR.openFileInput