init
This commit is contained in:
1
PCSurvey/PCstatic/js/external/json2.min.js
vendored
Normal file
1
PCSurvey/PCstatic/js/external/json2.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
if(!this.JSON){this.JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}}());
|
||||
2721
PCSurvey/PCstatic/js/external/jspsych.js
vendored
Normal file
2721
PCSurvey/PCstatic/js/external/jspsych.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2
PCSurvey/PCstatic/js/external/jstat.min.js
vendored
Normal file
2
PCSurvey/PCstatic/js/external/jstat.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
PCSurvey/PCstatic/js/external/load.min.js
vendored
Normal file
2
PCSurvey/PCstatic/js/external/load.min.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/*! evtrack -- Load module */
|
||||
(function(){function a(m){var l=document.createElement("script");l.type="text/javascript";l.src=m;return l}var d=document.getElementsByTagName("script");var c=d[d.length-1];var j=c.src.split("/");j.splice(j.length-1,1);var k=j.join("/");var b=j[j.length-1]=="src"?".js":".min.js";function i(l,n){var m=a(k+"/"+l+b);c.parentNode.insertBefore(m,c);m.onload=function(){n()}}var h;window.TrackUI={record:function(l){h=function(){window.TrackUI.record(l)}}};var f=["json2","tracklib","trackui"];for(var g in f){i(f[g],e)}function e(){f.shift();if(f.length===0){c.parentNode.removeChild(c);if(typeof h==="function"){h()}}}})();
|
||||
9
PCSurvey/PCstatic/js/external/sha256.min.js
vendored
Normal file
9
PCSurvey/PCstatic/js/external/sha256.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
PCSurvey/PCstatic/js/external/tracklib.min.js
vendored
Normal file
2
PCSurvey/PCstatic/js/external/tracklib.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
223
PCSurvey/PCstatic/js/external/trackui.min.js
vendored
Normal file
223
PCSurvey/PCstatic/js/external/trackui.min.js
vendored
Normal file
@@ -0,0 +1,223 @@
|
||||
/*! evtrack -- UI module */
|
||||
(function(f) {
|
||||
var g = f.document;
|
||||
var c = "mousedown mouseup mousemove mouseover mouseout mousewheel ";
|
||||
c += "touchstart touchend touchmove keydown keyup keypress ";
|
||||
c += "click dblclick scroll change select submit reset contextmenu cut copy paste";
|
||||
var d = "load unload beforeunload blur focus resize error online offline";
|
||||
c = c.split(" ");
|
||||
d = d.split(" ");
|
||||
var a = c.concat(d);
|
||||
var b = " "
|
||||
, e = "|||";
|
||||
var h = 0
|
||||
, k = 0
|
||||
, j = [];
|
||||
var i = {
|
||||
settings: {
|
||||
postServer: "//my.server.org/save.script",
|
||||
postInterval: 30,
|
||||
regularEvents: "*",
|
||||
pollingEvents: "",
|
||||
pollingMs: 150,
|
||||
taskName: "evtrack",
|
||||
callback: null,
|
||||
saveAttributes: true,
|
||||
layoutType: "liquid",
|
||||
debug: false
|
||||
},
|
||||
record: function(l) {
|
||||
k = new Date().getTime();
|
||||
for (var m in i.settings) {
|
||||
if (l.hasOwnProperty(m) && l[m] !== null) {
|
||||
i.settings[m] = l[m]
|
||||
}
|
||||
}
|
||||
i.log("Recording starts...", k, i.settings);
|
||||
i.addEventListeners();
|
||||
setTimeout(function() {
|
||||
i.initNewData(true)
|
||||
}, i.settings.postInterval * 1000)
|
||||
},
|
||||
addEventListeners: function() {
|
||||
if (i.settings.regularEvents == "*") {
|
||||
i.addCustomEventListeners(a)
|
||||
} else {
|
||||
i.log("Settings regular events...");
|
||||
i.settings.regularEvents = i.settings.regularEvents.split(" ");
|
||||
i.addCustomEventListeners(i.settings.regularEvents)
|
||||
}
|
||||
if (i.settings.pollingEvents == "*") {
|
||||
i.addCustomEventListeners(a)
|
||||
} else {
|
||||
i.log("Settings polling events...");
|
||||
i.settings.pollingEvents = i.settings.pollingEvents.split(" ");
|
||||
i.addCustomEventListeners(i.settings.pollingEvents)
|
||||
}
|
||||
var l = (typeof f.onbeforeunload === "function") ? "beforeunload" : "unload";
|
||||
TrackLib.Events.add(f, l, i.flush)
|
||||
},
|
||||
addCustomEventListeners: function(n) {
|
||||
i.log("Adding event listeners:", n);
|
||||
for (var l = 0; l < n.length; ++l) {
|
||||
var m = n[l];
|
||||
if (!m) {
|
||||
continue
|
||||
}
|
||||
if (c.indexOf(m) > -1) {
|
||||
TrackLib.Events.add(g, m, i.docHandler);
|
||||
i.log("Adding document event:", m);
|
||||
if (g.attachEvent) {
|
||||
if (m == "focus") {
|
||||
TrackLib.Events.add(g.body, "focusin", i.winHandler)
|
||||
}
|
||||
if (m == "blur") {
|
||||
TrackLib.Events.add(g.body, "focusout", i.winHandler)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (d.indexOf(m) > -1) {
|
||||
TrackLib.Events.add(f, m, i.winHandler);
|
||||
i.log("Adding window event:", m)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
initNewData: function(l) {
|
||||
var o = TrackLib.Dimension.getWindowSize()
|
||||
, n = TrackLib.Dimension.getDocumentSize()
|
||||
, m = "url=" + encodeURIComponent(f.location.href);
|
||||
m += "&screenw=" + screen.width;
|
||||
m += "&screenh=" + screen.height;
|
||||
m += "&winw=" + o.width;
|
||||
m += "&winh=" + o.height;
|
||||
m += "&docw=" + n.width;
|
||||
m += "&doch=" + n.height;
|
||||
m += "&info=" + encodeURIComponent(j.join(e));
|
||||
m += "&task=" + encodeURIComponent(i.settings.taskName);
|
||||
m += "&action=init";
|
||||
i.send({
|
||||
async: l,
|
||||
postdata: m,
|
||||
callback: i.setUserId
|
||||
});
|
||||
j = []
|
||||
},
|
||||
setUserId: function(l) {
|
||||
h = parseInt(l.responseText);
|
||||
i.log("setUserId:", h);
|
||||
if (h) {
|
||||
setInterval(function() {
|
||||
i.appendData(true)
|
||||
}, i.settings.postInterval * 1000)
|
||||
}
|
||||
},
|
||||
appendData: function(l) {
|
||||
var m = "uid=" + h;
|
||||
m += "&info=" + encodeURIComponent(j.join(e));
|
||||
m += "&task=" + encodeURIComponent(i.settings.taskName);
|
||||
m += "&action=append";
|
||||
i.send({
|
||||
async: l,
|
||||
postdata: m
|
||||
});
|
||||
j = []
|
||||
},
|
||||
send: function(l) {
|
||||
l.url = i.settings.postServer;
|
||||
TrackLib.XHR.sendAjaxRequest(l)
|
||||
},
|
||||
docHandler: function(l) {
|
||||
if (l.type.indexOf("touch") > -1) {
|
||||
i.touchHandler(l)
|
||||
} else {
|
||||
i.eventHandler(l)
|
||||
}
|
||||
},
|
||||
winHandler: function(l) {
|
||||
i.eventHandler(l)
|
||||
},
|
||||
eventHandler: function(q) {
|
||||
q = TrackLib.Events.fix(q);
|
||||
var n = new Date().getTime()
|
||||
, m = q.type
|
||||
, o = true;
|
||||
if (i.settings.pollingMs > 0 && i.settings.pollingEvents.indexOf(m) > -1) {
|
||||
o = (n - k >= i.settings.pollingMs)
|
||||
}
|
||||
if (o) {
|
||||
var s = i.getMousePos(q)
|
||||
, r = TrackLib.XPath.getXPath(q.target)
|
||||
, l = i.settings.saveAttributes ? TrackLib.Util.serializeAttrs(q.target) : "{}"
|
||||
, p = {};
|
||||
if (typeof i.settings.callback === "function") {
|
||||
p = i.settings.callback(q)
|
||||
}
|
||||
i.fillInfo(q.id, n, s.x, s.y, m, r, l, JSON.stringify(p));
|
||||
k = n
|
||||
}
|
||||
},
|
||||
touchHandler: function(n) {
|
||||
n = TrackLib.Events.fix(n);
|
||||
var m = n.changedTouches;
|
||||
if (m) {
|
||||
for (var l = 0, o; l < m.length; ++l) {
|
||||
o = m[l];
|
||||
o.type = n.type;
|
||||
i.eventHandler(o)
|
||||
}
|
||||
}
|
||||
},
|
||||
getMousePos: function(m) {
|
||||
m = TrackLib.Events.fix(m);
|
||||
var l = 0
|
||||
, n = 0;
|
||||
if (m.pageX || m.pageY) {
|
||||
l = m.pageX;
|
||||
n = m.pageY
|
||||
} else {
|
||||
if (m.clientX || m.clientY) {
|
||||
l = m.clientX + g.body.scrollLeft + g.documentElement.scrollLeft;
|
||||
n = m.clientY + g.body.scrollTop + g.documentElement.scrollTop
|
||||
}
|
||||
}
|
||||
if (!l || l < 0) {
|
||||
l = 0
|
||||
}
|
||||
if (!n || n < 0) {
|
||||
n = 0
|
||||
}
|
||||
return {
|
||||
x: l,
|
||||
y: n
|
||||
}
|
||||
},
|
||||
fillInfo: function() {
|
||||
var l = [].slice.apply(arguments);
|
||||
j.push(l.join(b));
|
||||
i.log(l)
|
||||
},
|
||||
flush: function(m) {
|
||||
i.log("Flushing data...", h);
|
||||
var l;
|
||||
for (l = 0; l < c.length; ++l) {
|
||||
TrackLib.Events.remove(g, c[l], i.docHandler)
|
||||
}
|
||||
for (l = 0; l < d.length; ++l) {
|
||||
TrackLib.Events.remove(f, d[l], i.winHandler)
|
||||
}
|
||||
if (h) {
|
||||
i.appendData(false)
|
||||
} else {
|
||||
i.initNewData(false)
|
||||
}
|
||||
},
|
||||
log: function() {
|
||||
if (i.settings.debug && typeof console.log === "function") {
|
||||
console.log.apply(console, arguments)
|
||||
}
|
||||
}
|
||||
};
|
||||
f.TrackUI = i
|
||||
}
|
||||
)(this);
|
||||
Reference in New Issue
Block a user