diff options
Diffstat (limited to 'js/dojo-1.7.2/dojox/analytics/plugins')
| -rw-r--r-- | js/dojo-1.7.2/dojox/analytics/plugins/consoleMessages.js | 27 | ||||
| -rw-r--r-- | js/dojo-1.7.2/dojox/analytics/plugins/dojo.js | 28 | ||||
| -rw-r--r-- | js/dojo-1.7.2/dojox/analytics/plugins/idle.js | 39 | ||||
| -rw-r--r-- | js/dojo-1.7.2/dojox/analytics/plugins/mouseClick.js | 52 | ||||
| -rw-r--r-- | js/dojo-1.7.2/dojox/analytics/plugins/mouseOver.js | 93 | ||||
| -rw-r--r-- | js/dojo-1.7.2/dojox/analytics/plugins/window.js | 38 |
6 files changed, 277 insertions, 0 deletions
diff --git a/js/dojo-1.7.2/dojox/analytics/plugins/consoleMessages.js b/js/dojo-1.7.2/dojox/analytics/plugins/consoleMessages.js new file mode 100644 index 0000000..3d422d7 --- /dev/null +++ b/js/dojo-1.7.2/dojox/analytics/plugins/consoleMessages.js @@ -0,0 +1,27 @@ +//>>built +define("dojox/analytics/plugins/consoleMessages", ["dojo/_base/lang","../_base", "dojo/_base/config", "dojo/aspect" +], function(lang, dxa, config, aspect){ + /*===== + dxa = dojox.analytics; + aspect = dojo.aspect; + =====*/ + consoleMessages = lang.getObject("dojox.analytics.plugins.consoleMessages", true); + + // summary: + // plugin to have analyitcs return the base info dojo collects + this.addData = lang.hitch(dxa, "addData", "consoleMessages"); + + var lvls = config["consoleLogFuncs"] || ["error", "warn", "info", "rlog"]; + if(!console){ + console = {}; + } + + for(var i=0; i < lvls.length; i++){ + if(console[lvls[i]]){ + aspect.after(console, lvls[i], lang.hitch(this, "addData", lvls[i]),true); + }else{ + console[lvls[i]] = lang.hitch(this, "addData", lvls[i]); + } + } + return consoleMessages; +}); diff --git a/js/dojo-1.7.2/dojox/analytics/plugins/dojo.js b/js/dojo-1.7.2/dojox/analytics/plugins/dojo.js new file mode 100644 index 0000000..c180d35 --- /dev/null +++ b/js/dojo-1.7.2/dojox/analytics/plugins/dojo.js @@ -0,0 +1,28 @@ +//>>built +define("dojox/analytics/plugins/dojo", ["dojo/_base/lang","../_base", "dojo/_base/config", "dojo/ready" +], function(lang, dxa, config, ready){ + var plugins = lang.getObject("dojox.analytics.plugins", true); + /*===== + dxa = dojox.analytics; + ready = dojo.ready; + plugins = dojox.analytics.plugins; + plugins.dojo = dojox.analytics.plugins.dojo; + =====*/ + + return (plugins.dojo = new (function(){ + // summary: + // plugin to have analyitcs return the base info dojo collects + this.addData = lang.hitch(dxa, "addData", "dojo"); + ready(lang.hitch(this, function(){ + var data = {}; + for(var i in dojo){ + if ((i=="version") || ((!(typeof dojo[i] == "object" || typeof dojo[i] == "function"))&&(i[0]!="_"))){ + data[i]=dojo[i]; + } + } + + if (config){data.djConfig=config} + this.addData(data); + })); + })()); +}); diff --git a/js/dojo-1.7.2/dojox/analytics/plugins/idle.js b/js/dojo-1.7.2/dojox/analytics/plugins/idle.js new file mode 100644 index 0000000..f266cfb --- /dev/null +++ b/js/dojo-1.7.2/dojox/analytics/plugins/idle.js @@ -0,0 +1,39 @@ +//>>built +define("dojox/analytics/plugins/idle", ["dojo/_base/lang", "../_base", "dojo/_base/config", "dojo/ready", + "dojo/aspect", "dojo/_base/window" +], function(lang, dxa, config, ready, aspect, window){ + /*===== + dxa = dojox.analytics; + ready = dojo.ready; + aspect = dojo/aspect; + =====*/ + + // window startup data + return (dxa.plugins.idle = new (function(){ + this.addData = lang.hitch(dxa, "addData", "idle"); + this.idleTime=config["idleTime"] || 60000; + this.idle=true; + + this.setIdle = function(){ + this.addData("isIdle"); + this.idle=true; + + } + + ready(lang.hitch(this, function(){ + var idleResets=["onmousemove","onkeydown","onclick","onscroll"]; + for (var i=0;i<idleResets.length;i++){ + aspect.after(window.doc,idleResets[i],lang.hitch(this, function(e){ + if (this.idle){ + this.idle=false; + this.addData("isActive"); + this.idleTimer=setTimeout(lang.hitch(this,"setIdle"), this.idleTime); + }else{ + clearTimeout(this.idleTimer); + this.idleTimer=setTimeout(lang.hitch(this,"setIdle"), this.idleTime); + } + }),true); + } + })); + })()); +});
\ No newline at end of file diff --git a/js/dojo-1.7.2/dojox/analytics/plugins/mouseClick.js b/js/dojo-1.7.2/dojox/analytics/plugins/mouseClick.js new file mode 100644 index 0000000..915a3a4 --- /dev/null +++ b/js/dojo-1.7.2/dojox/analytics/plugins/mouseClick.js @@ -0,0 +1,52 @@ +//>>built +define("dojox/analytics/plugins/mouseClick", ["dojo/_base/lang","../_base", "dojo/_base/window", "dojo/on" +], function(lang, dxa, window, on){ + /*===== + dxa = dojox.analytics; + on = dojo.on; + =====*/ + + // window startup data + return (dxa.plugins.mouseClick = new (function(){ + this.addData = lang.hitch(dxa, "addData", "mouseClick"); + + this.onClick=function(e){ + this.addData(this.trimEvent(e)); + } + on(window.doc, "click", lang.hitch(this, "onClick")); + + this.trimEvent=function(e){ + var t = {}; + for (var i in e){ + switch(i){ + case "target": + case "originalTarget": + case "explicitOriginalTarget": + var props=["id","className","nodeName", "localName","href", "spellcheck", "lang"]; + t[i]={}; + for(var j=0;j<props.length;j++){ + if(e[i][props[j]]){ + if (props[j]=="text" || props[j]=="textContent"){ + if ((e[i]["localName"]!="HTML")&&(e[i]["localName"]!="BODY")){ + t[i][props[j]]=e[i][props[j]].substr(0,50); + } + }else{ + t[i][props[j]]=e[i][props[j]]; + } + } + } + break; + case "clientX": + case "clientY": + case "pageX": + case "pageY": + case "screenX": + case "screenY": + t[i]=e[i]; + break; + } + } + return t; + } + })()); +});
\ No newline at end of file diff --git a/js/dojo-1.7.2/dojox/analytics/plugins/mouseOver.js b/js/dojo-1.7.2/dojox/analytics/plugins/mouseOver.js new file mode 100644 index 0000000..0afcc7b --- /dev/null +++ b/js/dojo-1.7.2/dojox/analytics/plugins/mouseOver.js @@ -0,0 +1,93 @@ +//>>built +define("dojox/analytics/plugins/mouseOver", ["dojo/_base/lang", "../_base", "dojo/_base/config", "dojo/_base/window", "dojo/on" +], function(lang, dxa, config, window, on){ + /*===== + dxa = dojox.analytics; + on = dojo.on; + =====*/ + + return (dxa.plugins.mouseOver = new (function(){ + this.watchMouse = config["watchMouseOver"] || true; + this.mouseSampleDelay = config["sampleDelay"] || 2500; + this.addData = lang.hitch(dxa, "addData", "mouseOver"); + this.targetProps = config["targetProps"] || ["id","className","localName","href", "spellcheck", "lang", "textContent", "value" ]; + + this.toggleWatchMouse=function(){ + if (this._watchingMouse){ + this._watchingMouse.remove(); + delete this._watchingMouse; + return; + } + on(window.doc, "mousemove", lang.hitch(this, "sampleMouse")); + } + + if (this.watchMouse){ + on(window.doc, "mouseover", lang.hitch(this, "toggleWatchMouse")); + on(window.doc, "mouseout", lang.hitch(this, "toggleWatchMouse")); + } + + this.sampleMouse=function(e){ + if (!this._rateLimited){ + this.addData("sample",this.trimMouseEvent(e)); + this._rateLimited=true; + setTimeout(lang.hitch(this, function(){ + if (this._rateLimited){ + //this.addData("sample", this.trimMouseEvent(this._lastMouseEvent)); + this.trimMouseEvent(this._lastMouseEvent); + delete this._lastMouseEvent; + delete this._rateLimited; + } + }), this.mouseSampleDelay); + } + this._lastMouseEvent = e; + return e; + } + + this.trimMouseEvent=function(e){ + var t = {}; + for (var i in e){ + switch(i){ + //case "currentTarget": + case "target": + //case "originalTarget": + //case "explicitOriginalTarget": + var props=this.targetProps; + t[i]={}; + //console.log(e, i, e[i]); + for(var j=0;j<props.length;j++){ + if((typeof e[i] == "object" || typeof e[i] == "function") && props[j] in e[i]){ + + if (props[j]=="text" || props[j]=="textContent"){ + if (e[i]["localName"] && (e[i]["localName"]!="HTML")&&(e[i]["localName"]!="BODY")){ + t[i][props[j]]=e[i][props[j]].substr(0,50); + } + }else{ + t[i][props[j]]=e[i][props[j]]; + } + } + } + break; + //case "clientX": + //case "clientY": + //case "pageX": + //case "pageY": + //case "screenX": + //case "screenY": + case "x": + case "y": + if (e[i]) { + //console.log("Attempting: " + i); + var val = e[i]; + //console.log("val: " + val); console.log(i + "e of i: " + val); + t[i]=val + ''; + } + break; + default: + //console.log("Skipping: ", i); + break; + } + } + return t; + } + })()); +});
\ No newline at end of file diff --git a/js/dojo-1.7.2/dojox/analytics/plugins/window.js b/js/dojo-1.7.2/dojox/analytics/plugins/window.js new file mode 100644 index 0000000..4d6debe --- /dev/null +++ b/js/dojo-1.7.2/dojox/analytics/plugins/window.js @@ -0,0 +1,38 @@ +//>>built +define("dojox/analytics/plugins/window", ["dojo/_base/lang","../_base", "dojo/ready", "dojo/_base/config", "dojo/aspect" +], function(lang, dxa, ready, config, aspect){ + /*===== + dxa = dojox.analytics; + ready = dojo.ready; + aspect = dojo.aspect; + =====*/ + + // window startup data + return (dxa.plugins.window = new (function(){ + this.addData = lang.hitch(dxa, "addData", "window"); + this.windowConnects = config["windowConnects"] || ["open", "onerror"]; + + for(var i=0; i<this.windowConnects.length;i++){ + aspect.after(window, this.windowConnects[i], lang.hitch(this, "addData", this.windowConnects[i]),true); + } + + ready(lang.hitch(this, function(){ + var data = {}; + for(var i in window){ + if (typeof window[i] == "object" || typeof window[i] == "function"){ + switch(i){ + case "location": + case "console": + data[i]=window[i]; + break; + default: + break; + } + }else{ + data[i]=window[i]; + } + } + this.addData(data); + })); + })()); +});
\ No newline at end of file |
