From 3b95d4aec6334b0e18eed433120fd549eaa5fa36 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sat, 28 Sep 2013 15:12:03 -0700 Subject: import cpan-explorer --- .../analytics.js | 59 ++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 doc/Viewing Large Images with Seadragon and Pythonhtml_files/analytics.js (limited to 'doc/Viewing Large Images with Seadragon and Pythonhtml_files/analytics.js') 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(""); + } + 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; + } +} -- cgit v1.2.3