summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--static/js/pichat.js25
1 files changed, 14 insertions, 11 deletions
diff --git a/static/js/pichat.js b/static/js/pichat.js
index e32ec3b..fdbfc8d 100644
--- a/static/js/pichat.js
+++ b/static/js/pichat.js
@@ -44,6 +44,13 @@ String.prototype.trim = function(){ return this.replace(/^\s+|\s+$/g,'') }
function isCSSPropertySupported(prop){ return prop in document.body.style }
+function track(group, name) {
+ if (typeof pageTracker !== 'undefined') {
+ pageTracker._trackEvent(group, name,
+ typeof Nick !== 'undefined' ? Nick : 'anon');
+ }
+}
+
var Preferences = {
"Domain": '.dump.fm',
@@ -137,7 +144,7 @@ function annoyingCaps(text){
}
chunks[i] = letters.join("")
}
- return chunks.join(" ")
+ return chunks.join(" ")
}
@@ -264,10 +271,12 @@ function setTextEnable() {
if ($(this).attr('checked')) {
TextEnabled = true;
Preferences.setProperty("chat.textEnabled", "true");
+ track('UI', 'TextEnabled');
$('.dump').not('.contains-image').show();
} else {
TextEnabled = false;
Preferences.setProperty("chat.textEnabled", "false");
+ track('UI', 'TextDisabled');
$('.dump').not('.contains-image').hide()
}
};
@@ -542,19 +551,13 @@ function refresh() {
}
function sendClicked(){
- if (typeof pageTracker !== 'undefined') {
- pageTracker._trackEvent('UI', 'SendButtonActuallyClicked',
- typeof Nick !== 'undefined' ? Nick : 'anon');
- }
- submitMessage()
+ track('UI', 'SendButtonActuallyClicked');
+ submitMessage();
}
function paletteClicked(){
- if (typeof pageTracker !== 'undefined') {
- pageTracker._trackEvent('UI', 'FavPaletteActuallyClicked',
- typeof Nick !== 'undefined' ? Nick : 'anon');
- }
- paletteToggle()
+ track('UI', 'FavPaletteActuallyClicked');
+ paletteToggle();
}