diff options
author | Franck Cuny <franck.cuny@gmail.com> | 2013-09-28 15:12:03 -0700 |
---|---|---|
committer | Franck Cuny <franck.cuny@gmail.com> | 2013-09-28 15:12:03 -0700 |
commit | 3b95d4aec6334b0e18eed433120fd549eaa5fa36 (patch) | |
tree | dc849b8a5e5414cda9bd7836a7b356f4948015c1 /doc/Viewing Large Images with Seadragon and Pythonhtml_files/analytics.js | |
download | cpan-explorer-master.tar.gz |
import cpan-explorer master
Diffstat (limited to '')
-rw-r--r-- | doc/Viewing Large Images with Seadragon and Pythonhtml_files/analytics.js | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/doc/Viewing Large Images with Seadragon and Pythonhtml_files/analytics.js b/doc/Viewing Large Images with Seadragon and Pythonhtml_files/analytics.js new file mode 100644 index 0000000..3aa054e --- /dev/null +++ b/doc/Viewing Large Images with Seadragon and Pythonhtml_files/analytics.js @@ -0,0 +1,59 @@ +var _amefin = { + pingImage: null, + setZoneId: function(zoneId) + { + this.zoneId = zoneId; + return this; + }, + shouldUseCurrent: false, + setUseCurrent: function(shouldUseCurrent) + { + this.shouldUseCurrent = shouldUseCurrent; + return this; + }, + searchToUse: null, + useSearch: function(searchToUse) + { + this.searchToUse = searchToUse; + return this; + }, + isSearchReferrer: function() + { + var engines = ["google", "search\\.yahoo", "search\\.msn", "search\\.live", "search\\.aol", "ask\\.com", "searchservice\\.myspace", "facebook"]; + + for(var i = 0; i < engines.length; i++) + { + var regexString = "^http:\\/\\/(www\\.)?" + engines[i]; + if(engines[i] != "ask\\.com") + { + regexString += "\\."; + } + var regex = new RegExp(regexString, "i"); + if(regex.test(this.shouldUseCurrent ? document.URL : document.referrer)) + { + return true; + } + } + return false; + }, + track: function() + { + if(this.searchToUse || this.isSearchReferrer()) + { + document.write("<script src='http://amefin.com/analytics?url=" + encodeURIComponent(document.URL) + "&referrer=" + encodeURIComponent(document.referrer) + "&search=" + this.searchToUse + "&shouldUseCurrent=" + this.shouldUseCurrent + "&zoneId=" + this.zoneId + "&width=" + screen.width + "&height=" + screen.height + "' type='text/javascript'></script>"); + } + return this; + }, + druvoid: function() + { + return this; + }, + hit_pixel: function(slot, url) + { + var pix = new Image(1,1); + pix.alt = ''; + pix.src = url; + pix.onload = function () {_amefin.druvoid();}; + this[slot] = pix; + } +} |