Added '/say' command
This commit is contained in:
parent
746f73558f
commit
f320d4c208
|
@ -26,7 +26,7 @@ These are the commands currently implemented:
|
||||||
- [x] /query
|
- [x] /query
|
||||||
- [x] /quit
|
- [x] /quit
|
||||||
- [ ] /raw
|
- [ ] /raw
|
||||||
- [ ] /say
|
- [x] /say
|
||||||
- [x] /send
|
- [x] /send
|
||||||
- [x] /server
|
- [x] /server
|
||||||
- [ ] /time
|
- [ ] /time
|
||||||
|
|
|
@ -18,6 +18,7 @@ $(function() {
|
||||||
"/part",
|
"/part",
|
||||||
"/query",
|
"/query",
|
||||||
"/quit",
|
"/quit",
|
||||||
|
"/say",
|
||||||
"/send",
|
"/send",
|
||||||
"/server",
|
"/server",
|
||||||
"/topic",
|
"/topic",
|
||||||
|
|
|
@ -214,7 +214,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.hint) {
|
if (options.hint) {
|
||||||
if (word.length >= options.minLength) {
|
if (word.length >= options.minLength && words.length) {
|
||||||
hint.call(self, words[0]);
|
hint.call(self, words[0]);
|
||||||
} else {
|
} else {
|
||||||
// Clear hinting.
|
// Clear hinting.
|
||||||
|
@ -309,16 +309,11 @@
|
||||||
var hint = "";
|
var hint = "";
|
||||||
if (typeof word !== "undefined") {
|
if (typeof word !== "undefined") {
|
||||||
var text = input.val();
|
var text = input.val();
|
||||||
hint = text + word.substr(last(text).length);
|
hint = text + word.substr(text.split(/ |\n/).pop().length);
|
||||||
}
|
}
|
||||||
|
|
||||||
clone.val(hint);
|
clone.val(hint);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the last word of a string.
|
|
||||||
function last(str) {
|
|
||||||
return str.split(/ |\n/).pop();
|
|
||||||
}
|
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
@ -129,6 +129,9 @@ function input(data) {
|
||||||
var cmd = text.charAt(0) == "/" ? args[0].toLowerCase() : "";
|
var cmd = text.charAt(0) == "/" ? args[0].toLowerCase() : "";
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
case "say":
|
||||||
|
// Remove '/say' and treat this command as a message.
|
||||||
|
args.shift();
|
||||||
case "":
|
case "":
|
||||||
args.unshift(
|
args.unshift(
|
||||||
"msg",
|
"msg",
|
||||||
|
|
Loading…
Reference in New Issue