From 7f222f547283b03a6e53ef69b228abf11e46e5c8 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 30 Dec 2013 03:10:21 +0100 Subject: webchat -> Cancher --- webchat/public/functions.js | 54 --------------------------------------------- 1 file changed, 54 deletions(-) delete mode 100644 webchat/public/functions.js (limited to 'webchat/public/functions.js') diff --git a/webchat/public/functions.js b/webchat/public/functions.js deleted file mode 100644 index 781fafce..00000000 --- a/webchat/public/functions.js +++ /dev/null @@ -1,54 +0,0 @@ -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; - return text.replace(exp,"$1"); -} - -function getNicklistElement(name, type) { - var el; - $('.'+type+'_name').each(function (i,e) { - if (e.innerHTML === name) { - if (typeof el !== 'undefined') { - throw new Error('duplicate name: ' + name); - }; - el = e; - }; - }); - return el; -} - -function chatboxAppend (chat_from, chat_msg, type) { - type = type||'msg' - $(''+getCurTime()+''+chat_from+''+chat_msg+'').insertBefore('#foot'); - - var elem = document.getElementById('chatter'); - elem.scrollTop = elem.scrollHeight; -}; - -function getCurTime () { - date = new Date; - h = date.getHours(); - if(h<10) - { - h = "0"+h; - } - m = date.getMinutes(); - if(m<10) - { - m = "0"+m; - } - s = date.getSeconds(); - if(s<10) - { - s = "0"+s; - } - return ''+h+':'+m+':'+s; -}; -- cgit v1.2.3