summaryrefslogtreecommitdiff
path: root/static/js/src/growl.js
diff options
context:
space:
mode:
Diffstat (limited to 'static/js/src/growl.js')
-rw-r--r--static/js/src/growl.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/static/js/src/growl.js b/static/js/src/growl.js
new file mode 100644
index 0000000..4ed84cc
--- /dev/null
+++ b/static/js/src/growl.js
@@ -0,0 +1,23 @@
+// Growl
+
+function buildGrowlDataAndPopDatShit(msg) {
+ var nick = escapeHtml(msg.nick);
+ nick = '<a href="' + RootDomain + nick + ' " style="color:pink">' + nick + '</a>:'
+ var msg = buildMsgContent(msg.content)
+ growl(nick, msg)
+}
+
+function growl(user, msg) {
+ $.gritter.add({title: user, text: msg});
+}
+
+function handleMsgError(resp) {
+ var respText = resp.responseText ? resp.responseText.trim() : false;
+ if (respText == 'MUST_LOGIN') {
+ alert("Can't send message! Please login.");
+ } else if (respText) {
+ alert("Can't send message! " + respText);
+ } else {
+ alert("Can't send message!");
+ }
+} \ No newline at end of file