Mercurial > hg > extraction-interface
diff geotemco/lib/simile/ajax/scripts/remoteLog.js @ 0:b12c99b7c3f0
commit for previous development
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Mon, 19 Jan 2015 17:13:49 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/geotemco/lib/simile/ajax/scripts/remoteLog.js Mon Jan 19 17:13:49 2015 +0100 @@ -0,0 +1,24 @@ +/*====================================================================== + * RemoteLog + * + * This is a singleton that permis logging of key-valued data to a + * remote location. + *====================================================================== + */ + +SimileAjax.RemoteLog = { + defaultURL:"http://groups.csail.mit.edu/haystack/facetlog/logger.php", + url:null, + logActive: false +}; + +SimileAjax.RemoteLog.possiblyLog = function(vals) { + if ((SimileAjax.RemoteLog.logActive) && (SimileAjax.RemoteLog.url != null)) { + vals["url"] = window.location.href; + try { + SimileAjax.jQuery.ajax({type:'POST',url:SimileAjax.RemoteLog.url,data:vals}); + } + catch (e) {} + } +}; +