Index: openacs-4/packages/xowiki/www/resources/chat-common.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/resources/Attic/chat-common.js,v diff -u -N -r1.10.2.2 -r1.10.2.3 --- openacs-4/packages/xowiki/www/resources/chat-common.js 25 Feb 2019 15:35:44 -0000 1.10.2.2 +++ openacs-4/packages/xowiki/www/resources/chat-common.js 25 Feb 2019 15:48:45 -0000 1.10.2.3 @@ -1,3 +1,5 @@ +// Common xowiki chat functions + // Send the message function chatSendMsg(send_url, handler) { var msgField = document.getElementById('xowiki-chat-send'); @@ -9,3 +11,23 @@ http_send.send(null); msgField.value = ''; } + +// Simple function to create links +function createLink(text) { + if (linkRegex != null) { + return text.replace(new RegExp(linkRegex,'g'), function(url) { + return '' + url + ''; + }) + } else { + return text; + } +} + +// Render the data, being a user or a message +function renderData(json) { + if (json.type == "message") { + renderMessage(json); + } else if (json.type == "users") { + renderUsers(json); + } +}