mirror of https://github.com/calzoneman/sync.git
Add tabcompletion for PMs
This commit is contained in:
parent
106065184f
commit
d2358924a4
|
@ -122,12 +122,11 @@ CyTube.chatTabCompleteData = {
|
||||||
context: {}
|
context: {}
|
||||||
};
|
};
|
||||||
|
|
||||||
function chatTabComplete() {
|
function chatTabComplete(chatline) {
|
||||||
if (!CyTube.tabCompleteMethods) {
|
if (!CyTube.tabCompleteMethods) {
|
||||||
console.error('Missing CyTube.tabCompleteMethods!');
|
console.error('Missing CyTube.tabCompleteMethods!');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var chatline = document.getElementById("chatline");
|
|
||||||
var currentText = chatline.value;
|
var currentText = chatline.value;
|
||||||
var currentPosition = chatline.selectionEnd;
|
var currentPosition = chatline.selectionEnd;
|
||||||
if (typeof currentPosition !== 'number' || !chatline.setSelectionRange) {
|
if (typeof currentPosition !== 'number' || !chatline.setSelectionRange) {
|
||||||
|
@ -199,7 +198,7 @@ $("#chatline").keydown(function(ev) {
|
||||||
}
|
}
|
||||||
else if(ev.keyCode == 9) { // Tab completion
|
else if(ev.keyCode == 9) { // Tab completion
|
||||||
try {
|
try {
|
||||||
chatTabComplete();
|
chatTabComplete(ev.target);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
|
|
|
@ -776,7 +776,7 @@ function applyOpts() {
|
||||||
else {
|
else {
|
||||||
USEROPTS.notifications = "never";
|
USEROPTS.notifications = "never";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseTimeout(t) {
|
function parseTimeout(t) {
|
||||||
|
@ -2814,6 +2814,14 @@ function initPm(user) {
|
||||||
meta: meta
|
meta: meta
|
||||||
});
|
});
|
||||||
input.val("");
|
input.val("");
|
||||||
|
} else if(ev.keyCode == 9) { // Tab completion
|
||||||
|
try {
|
||||||
|
chatTabComplete(ev.target);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
ev.preventDefault();
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue