From 2f4d572752c9da42bb02b8ebda9510723d2eabc4 Mon Sep 17 00:00:00 2001 From: Erik Rothoff Andersson Date: Wed, 31 Aug 2016 10:45:20 +0200 Subject: [PATCH] V3.0.1 --- dist/glimr.min.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/glimr.min.js b/dist/glimr.min.js index cdbe94b..916e877 100644 --- a/dist/glimr.min.js +++ b/dist/glimr.min.js @@ -1 +1 @@ -!function(t,e){"use strict";var r="//pixel.glimr.io",a="/v4/iptags/:id/",n=300,i=function(){},s={tags:0},o="[v2]:",c=function(){var e,r,a=(new Date).getTime().toString();try{return(e=t.localStorage).setItem(a,a),r=e.getItem(a)===a,e.removeItem(a),r&&e}catch(n){}}(),u={flattenObjectIntoArray:function(t){var e=[];for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var a=t[r];if("object"==typeof a&&a.constructor===Array)for(var n=0,i=a.length;i>n;n+=1)e.push(a[n]);else"object"==typeof a?e=e.concat(u.Library.flattenObjectIntoArray(a)):e.push(a)}return e},bindFunction:function(t,e){var r=Array.prototype.slice.call(arguments,2),a=e,n=function(){},i=function(){return a.apply(this instanceof n?this:t,r.concat(Array.prototype.slice.call(arguments)))};return e.prototype&&(n.prototype=e.prototype),i.prototype=new n,i},JSONP:function(r,a){t.Glimr.networkRequests+=1;var n=(new Date).getTime(),i="glmrjsonp"+Math.round(n+1000001*Math.random()),s=e.createElement("script");t[i]=function(e){a(e);try{delete t[i]}catch(r){t[i]=void 0}try{s.parentNode.removeChild(s)}catch(r){}},r+=-1===r.indexOf("?")?"?":"&",r+="callback="+i,"function"==typeof s.addEventListener&&s.addEventListener("error",function(){a(!1)},!1),s.setAttribute("src",r),e.getElementsByTagName("head")[0].appendChild(s)},createCookie:function(t,r,a){var n=e.location.hostname.split("."),i=n.slice(n.length-2,n.length).join("."),s="";if(a){var o=new Date;o.setTime(o.getTime()+24*a*60*60*1e3),s="; expires="+o.toGMTString()}e.cookie=t+"="+r+s+"; path=/; domain="+i},readCookie:function(t){for(var r=t+"=",a=e.cookie.split(";"),n=0;nn&&(t=n),s.tags=t},h.getTagCacheTimeInSeconds=function(){return s.tags},h.setGlimrCookie=function(){u.createCookie("__glmrid",this.glimrId)},h.currentURLCacheKey=function(){return this.state.currentURLCacheKey?this.state.currentURLCacheKey:i(this.currentURLIdentifier()).substr(0,10)},h.currentURLIdentifier=function(){return e.location.hash&&-1!==e.location.hash.indexOf("#!")?e.location.hash.replace("#!",""):e.location.pathname},h.getPixelLastUpdated=function(t){return this.useLocalStorage?c["glimrArticleTags_"+t+"_lastUpdate"]||!1:!1},h.getCachedURLTags=function(t){var e=this._getOrUnmarshalCache(t),r=this.currentURLCacheKey();return e[r]||(e[r]=[]),e[r]},h.getCachedTags=function(e){return t.console&&t.console.warn&&t.console.warn("`Glimr.getCachedTags` has been deprecated in favor of `Glimr.getCachedURLTags` for getting pre-fetched tags synchronously. `Glimr.getCachedTags` and `Glimr.getCachedURLTags` only return a subset of the available tags, use `Glimr.getTags` for fetching all tags, which takes care of caching behind the scenes."),this.getCachedURLTags.apply(this,arguments)},h.getTags=function(t,e){if(this.state.loadedTags[t]){var r=this.state.loadedTags[t];return void e(r[0],r[1])}return"undefined"!=typeof this.state.loadingTags[t]?void this.state.loadingTags[t].push(e):void this._requestTags(t,e,u.bindFunction(this,function(e){var r=[],a={},n=r;e&&e.tags&&(r=e.tags,n=r),e&&e.mapping&&(a=e.mapping,n=a),e&&e.cache&&this._updateURLCache(t,e.cache),this.usesTagCache()&&this._updateTagCache(t,n);for(var i=this.getCachedURLTags(t),s=0;s0&&this.useLocalStorage},h.objectToQuery=function(t){var e=[];for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var a=t[r];"object"==typeof a&&a.constructor===Array?e.push(this.arrayToQuery(a,r)):"object"==typeof r?e.push(this.objectToQuery(a)):e.push(this.escapeStringForQuery(r)+"="+this.escapeStringForQuery(a)),e.push("&")}return e.pop(),e.join("")},h.arrayToQuery=function(t,e){e=e||"";for(var r=this.escapeStringForQuery(e),a=[],n=0,i=t.length;i>n;n+=1){var s=this.escapeStringForQuery(t[n]);a.push(r+"="+s)}return a.join("&")},h.queryToObject=function(t){for(var e={},r=t.split("&"),a=0,n=r.length;n>a;a+=1){var i=r[a].split("="),s=this.unescapeStringForQuery(i[0]||""),o=this.unescapeStringForQuery(i[1]||"");"undefined"==typeof e[s]&&(e[s]=[]),o.length>0&&e[s].push(o)}return e},h.escapeStringForQuery=function(t){return encodeURIComponent(t)},h.unescapeStringForQuery=function(t){return decodeURIComponent(t)},h._unmarshalTags=function(t){if(!t)return{};for(var e=t.split("|"),r={},a=0;a>>32-e}function r(t,e){var r,a,n,i,s;return n=2147483648&t,i=2147483648&e,r=1073741824&t,a=1073741824&e,s=(1073741823&t)+(1073741823&e),r&a?2147483648^s^n^i:r|a?1073741824&s?3221225472^s^n^i:1073741824^s^n^i:s^n^i}function a(t,e,r){return t&e|~t&r}function n(t,e,r){return t&r|e&~r}function i(t,e,r){return t^e^r}function s(t,e,r){return e^(t|~r)}function o(t,n,i,s,o,c,u){return t=r(t,r(r(a(n,i,s),o),u)),r(e(t,c),n)}function c(t,a,i,s,o,c,u){return t=r(t,r(r(n(a,i,s),o),u)),r(e(t,c),a)}function u(t,a,n,s,o,c,u){return t=r(t,r(r(i(a,n,s),o),u)),r(e(t,c),a)}function g(t,a,n,i,o,c,u){return t=r(t,r(r(s(a,n,i),o),u)),r(e(t,c),a)}function h(t){for(var e,r=t.length,a=r+8,n=(a-a%64)/64,i=16*(n+1),s=Array(i-1),o=0,c=0;r>c;)e=(c-c%4)/4,o=c%4*8,s[e]=s[e]|t.charCodeAt(c)<>>29,s}function l(t){var e,r,a="",n="";for(r=0;3>=r;r+=1)e=t>>>8*r&255,n="0"+e.toString(16),a+=n.substr(n.length-2,2);return a}function f(t){t=t.replace(/\r\n/g,"\n");for(var e="",r=0;ra?e+=String.fromCharCode(a):a>127&&2048>a?(e+=String.fromCharCode(a>>6|192),e+=String.fromCharCode(63&a|128)):(e+=String.fromCharCode(a>>12|224),e+=String.fromCharCode(a>>6&63|128),e+=String.fromCharCode(63&a|128))}return e}var d,p,T,m,y,v,C,x,_,b=[],L=7,S=12,U=17,I=22,w=5,j=9,A=14,O=20,R=4,k=11,G=16,Q=23,D=6,F=10,P=15,z=21;for(t=f(t),b=h(t),v=1732584193,C=4023233417,x=2562383102,_=271733878,d=0;dn;n+=1)e.push(a[n]);else"object"==typeof a?e=e.concat(u.Library.flattenObjectIntoArray(a)):e.push(a)}return e},bindFunction:function(t,e){var r=Array.prototype.slice.call(arguments,2),a=e,n=function(){},i=function(){return a.apply(this instanceof n?this:t,r.concat(Array.prototype.slice.call(arguments)))};return e.prototype&&(n.prototype=e.prototype),i.prototype=new n,i},JSONP:function(r,a){t.Glimr.networkRequests+=1;var n=(new Date).getTime(),i="glmrjsonp"+Math.round(n+1000001*Math.random()),s=e.createElement("script");t[i]=function(e){a(e);try{delete t[i]}catch(r){t[i]=void 0}try{s.parentNode.removeChild(s)}catch(r){}},r+=-1===r.indexOf("?")?"?":"&",r+="callback="+i,"function"==typeof s.addEventListener&&s.addEventListener("error",function(){a(!1)},!1),s.setAttribute("src",r),e.getElementsByTagName("head")[0].appendChild(s)},createCookie:function(t,r,a){var n=e.location.hostname.split("."),i=n.slice(n.length-2,n.length).join("."),s="";if(a){var o=new Date;o.setTime(o.getTime()+24*a*60*60*1e3),s="; expires="+o.toGMTString()}e.cookie=t+"="+r+s+"; path=/; domain="+i},readCookie:function(t){for(var r=t+"=",a=e.cookie.split(";"),n=0;nn&&(t=n),s.tags=t},h.getTagCacheTimeInSeconds=function(){return s.tags},h.setGlimrCookie=function(){u.createCookie("__glmrid",this.glimrId)},h.currentURLCacheKey=function(){return this.state.currentURLCacheKey?this.state.currentURLCacheKey:i(this.currentURLIdentifier()).substr(0,10)},h.currentURLIdentifier=function(){return e.location.hash&&-1!==e.location.hash.indexOf("#!")?e.location.hash.replace("#!",""):e.location.pathname},h.getPixelLastUpdated=function(t){return this.useLocalStorage?c["glimrArticleTags_"+t+"_lastUpdate"]||!1:!1},h.getCachedURLTags=function(t){var e=this._getOrUnmarshalCache(t),r=this.currentURLCacheKey();return e[r]||(e[r]=[]),e[r]},h.getCachedTags=function(e){return t.console&&t.console.warn&&t.console.warn("`Glimr.getCachedTags` has been deprecated in favor of `Glimr.getCachedURLTags` for getting pre-fetched tags synchronously. `Glimr.getCachedTags` and `Glimr.getCachedURLTags` only return a subset of the available tags, use `Glimr.getTags` for fetching all tags, which takes care of caching behind the scenes."),this.getCachedURLTags.apply(this,arguments)},h.getTags=function(t,e){var r=t+this.currentURLCacheKey();if(this.state.loadedTags[r]){var a=this.state.loadedTags[r];return void e(a[0],a[1])}return"undefined"!=typeof this.state.loadingTags[r]?void this.state.loadingTags[r].push(e):void this._requestTags(t,r,e,u.bindFunction(this,function(e){var a=[],n={},i=a;e&&e.tags&&(a=e.tags,i=a),e&&e.mapping&&(n=e.mapping,i=n),e&&e.cache&&this._updateURLCache(t,e.cache),this.usesTagCache()&&this._updateTagCache(t,i);for(var s=this.getCachedURLTags(t),o=0;o0&&this.useLocalStorage},h.objectToQuery=function(t){var e=[];for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var a=t[r];"object"==typeof a&&a.constructor===Array?e.push(this.arrayToQuery(a,r)):"object"==typeof r?e.push(this.objectToQuery(a)):e.push(this.escapeStringForQuery(r)+"="+this.escapeStringForQuery(a)),e.push("&")}return e.pop(),e.join("")},h.arrayToQuery=function(t,e){e=e||"";for(var r=this.escapeStringForQuery(e),a=[],n=0,i=t.length;i>n;n+=1){var s=this.escapeStringForQuery(t[n]);a.push(r+"="+s)}return a.join("&")},h.queryToObject=function(t){for(var e={},r=t.split("&"),a=0,n=r.length;n>a;a+=1){var i=r[a].split("="),s=this.unescapeStringForQuery(i[0]||""),o=this.unescapeStringForQuery(i[1]||"");"undefined"==typeof e[s]&&(e[s]=[]),o.length>0&&e[s].push(o)}return e},h.escapeStringForQuery=function(t){return encodeURIComponent(t)},h.unescapeStringForQuery=function(t){return decodeURIComponent(t)},h._unmarshalTags=function(t){if(!t)return{};for(var e=t.split("|"),r={},a=0;a>>32-e}function r(t,e){var r,a,n,i,s;return n=2147483648&t,i=2147483648&e,r=1073741824&t,a=1073741824&e,s=(1073741823&t)+(1073741823&e),r&a?2147483648^s^n^i:r|a?1073741824&s?3221225472^s^n^i:1073741824^s^n^i:s^n^i}function a(t,e,r){return t&e|~t&r}function n(t,e,r){return t&r|e&~r}function i(t,e,r){return t^e^r}function s(t,e,r){return e^(t|~r)}function o(t,n,i,s,o,c,u){return t=r(t,r(r(a(n,i,s),o),u)),r(e(t,c),n)}function c(t,a,i,s,o,c,u){return t=r(t,r(r(n(a,i,s),o),u)),r(e(t,c),a)}function u(t,a,n,s,o,c,u){return t=r(t,r(r(i(a,n,s),o),u)),r(e(t,c),a)}function g(t,a,n,i,o,c,u){return t=r(t,r(r(s(a,n,i),o),u)),r(e(t,c),a)}function h(t){for(var e,r=t.length,a=r+8,n=(a-a%64)/64,i=16*(n+1),s=Array(i-1),o=0,c=0;r>c;)e=(c-c%4)/4,o=c%4*8,s[e]=s[e]|t.charCodeAt(c)<>>29,s}function l(t){var e,r,a="",n="";for(r=0;3>=r;r+=1)e=t>>>8*r&255,n="0"+e.toString(16),a+=n.substr(n.length-2,2);return a}function f(t){t=t.replace(/\r\n/g,"\n");for(var e="",r=0;ra?e+=String.fromCharCode(a):a>127&&2048>a?(e+=String.fromCharCode(a>>6|192),e+=String.fromCharCode(63&a|128)):(e+=String.fromCharCode(a>>12|224),e+=String.fromCharCode(a>>6&63|128),e+=String.fromCharCode(63&a|128))}return e}var d,p,T,m,y,v,C,x,_,b=[],L=7,U=12,S=17,I=22,w=5,j=9,A=14,O=20,R=4,k=11,G=16,Q=23,D=6,F=10,P=15,z=21;for(t=f(t),b=h(t),v=1732584193,C=4023233417,x=2562383102,_=271733878,d=0;d