summaryrefslogtreecommitdiffstats
path: root/webchat/public/functions.js
diff options
context:
space:
mode:
authorlassulus <lassulus@googlemail.com>2013-11-12 04:08:38 +0100
committerlassulus <lassulus@googlemail.com>2013-11-12 04:08:38 +0100
commitb749c216ae84f02330da7396135be11259ec12d9 (patch)
treeb9a6f98f3f2b4f4c5ee60d36e1d11acdf57da267 /webchat/public/functions.js
parent721b4fb1b32ee47f158fb3b9a1ad0747ff579044 (diff)
webchat: fix nicklist
Diffstat (limited to 'webchat/public/functions.js')
-rw-r--r--webchat/public/functions.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/webchat/public/functions.js b/webchat/public/functions.js
index 318d0865..781fafce 100644
--- a/webchat/public/functions.js
+++ b/webchat/public/functions.js
@@ -1,3 +1,11 @@
+function inputParser (str) {
+ var match = /^\/([a-z]+)(?:\s+(.*\S))?\s*$/.exec(str)
+ if (match) {
+ return { method: match[1], params: match[2] }
+ } else {
+ return { method: 'msg', params: str }
+ }
+}
function replaceURLWithHTMLLinks (text) {
var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;