From a8f68aee3c92d2df52c990703a66701570cc2b84 Mon Sep 17 00:00:00 2001 From: "John R. D'Orazio" Date: Sat, 24 Jun 2017 11:58:11 +0200 Subject: [PATCH] reminify for v2.2.0 --- jqClock.min.js | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/jqClock.min.js b/jqClock.min.js index b308caa..d664cc6 100644 --- a/jqClock.min.js +++ b/jqClock.min.js @@ -1,13 +1,18 @@ -Date.prototype.hasOwnProperty("stdTimezoneOffset")||(Date.prototype.stdTimezoneOffset=function(){var c=this.getFullYear();if(!Date.prototype.stdTimezoneOffset.cache.hasOwnProperty(c)){for(var b=(new Date(c,0,1)).getTimezoneOffset(),a=[6,7,5,8,4,9,3,10,2,11,1],n=0;12>n;n++){var g=(new Date(c,a[n],1)).getTimezoneOffset();if(g!=b){b=Math.max(b,g);break}}Date.prototype.stdTimezoneOffset.cache[c]=b}return Date.prototype.stdTimezoneOffset.cache[c]},Date.prototype.stdTimezoneOffset.cache={}); +Date.prototype.hasOwnProperty("stdTimezoneOffset")||(Date.prototype.stdTimezoneOffset=function(){var c=this.getFullYear();if(!Date.prototype.stdTimezoneOffset.cache.hasOwnProperty(c)){for(var b=(new Date(c,0,1)).getTimezoneOffset(),a=[6,7,5,8,4,9,3,10,2,11,1],q=0;12>q;q++){var k=(new Date(c,a[q],1)).getTimezoneOffset();if(k!=b){b=Math.max(b,k);break}}Date.prototype.stdTimezoneOffset.cache[c]=b}return Date.prototype.stdTimezoneOffset.cache[c]},Date.prototype.stdTimezoneOffset.cache={}); Date.prototype.hasOwnProperty("isDST")||(Date.prototype.isDST=function(){return this.getTimezoneOffset()>=0;b=String(b||" ");if(this.length>c)return String(this);c-=this.length;c>b.length&&(b+=b.repeat(c/b.length));return b.slice(0,c)+String(this)}); -(function(c,b){c.clock={};Object.defineProperty(c.clock,"version",{value:"2.1.9",writable:!1});jqClock=[];c.fn.clock=function(a){return this.each(function(){var b=new Date;a=a||{};a.timestamp=a.timestamp||"localsystime";a.langSet=a.langSet||"en";a.calendar=a.hasOwnProperty("calendar")?a.calendar:!0;a.dateFormat=a.dateFormat||("en"==a.langSet?"l, F j, Y":"l, j F Y");a.timeFormat=a.timeFormat||("en"==a.langSet?"h:i:s A":"H:i:s");a.timezone=a.timezone||"localsystimezone";a.isDST=a.hasOwnProperty("isDST")? -a.isDST:b.isDST();a.rate=a.rate||500;"string"===typeof a.calendar&&(a.calendar="false"==a.calendar?!1:!0);"string"===typeof a.isDST&&(a.isDST="true"==a.isDST?!0:!1);a.tzOffset=b.getTimezoneOffset();var g=a.tzOffset/60;a.sysdiff=0;"localsystime"!=a.timestamp?2<(b.getTime()+"").length-(a.timestamp+"").length?(a.timestamp*=1E3,a.sysdiff=a.timestamp-b.getTime()+6E4*a.tzOffset):(a.sysdiff=a.timestamp-b.getTime(),"localsystimezone"==a.timezone&&(a.timezone="UTC",0>g?a.timezone+="+"+Math.abs(g):0g?a.timezone+="+"+Math.abs(g):0'+e+""}d="";for(m=0;m<=b.timeFormat.length;m++)switch(l=b.timeFormat.charAt(m),l){case "a":d+=x.toLowerCase();break;case "A":d+=x;break;case "B":d+=F;break;case "g":d+=q;break;case "G":d+=p;break;case "h":d+=(""+q).padStart(2,"0");break;case "H":d+=(""+p).padStart(2,"0");break;case "i":d+=(""+u).padStart(2,"0");break;case "s":d+= -(""+v).padStart(2,"0");break;case "v":d+=(""+z).padStart(3,"0");break;case "e":d+=b.timezone;break;case "I":d+=b.isDST?"DST":"";break;case "O":d+=(0>k?"+"+(""+Math.abs(k)).padStart(2,"0"):0k?"+"+(""+Math.abs(k)).padStart(2,"0"):0t?""+Math.abs(t):0k?"+"+(""+Math.abs(k)).padStart(2,"0"):0k?"+"+(""+Math.abs(k)).padStart(2,"0"):0";c(a).html(e+l);jqClock[g]=setTimeout(function(){y(c(a),b)},b.rate)}};c(this).hasClass("jqclock")||c(this).addClass("jqclock");c(this).is("[id]")||c(this).attr("id",b());y(c(this),a)})};return this})(jQuery); +(function(c,b){c.clock={version:"2.2.0",options:[{type:"string",value:"destroy",description:"Passing in 'destroy' to an already initialized clock will remove the setTimeout for that clock from the global jqClock variable"},{type:"object",description:"option set {}",values:[{name:"timestamp",description:"Either a javascript timestamp as produces by [JAVASCRIPT new Date().getTime()] or a php timestamp as produced by [PHP time()] ",type:"unix timestamp",values:["javascript timestamp","php timestamp"]}, +{name:"langSet",description:"two letter locale to be used for the translation of Day names and Month names",type:"String",values:"am ar bn bg ca zh hr cs da nl en et fi fr de el gu hi hu id it ja kn ko lv lt ms ml mr mo ps fa pl pt ro ru sr sk sl es sw sv ta te th tr uk vi".split(" ")},{name:"calendar",description:"Whether the date should be displayed together with the time",type:"Boolean",values:[!0,!1]},{name:"dateFormat",description:"PHP Style Format string for formatting a local date, see http://php.net/manual/en/function.date.php", +type:"String",values:"dDjlNSwzWFmMntLoYy".split("")},{name:"timeFormat",description:"PHP Style Format string for formatting a local date, see http://php.net/manual/en/function.date.php",type:"String",values:"aABgGhHisveIOPZcrU".split("")},{name:"isDST",description:"When a client side timestamp is used, whether DST is active will be automatically determined. However this cannot be determined for a server-side timestamp which must be passed in as UTC, in that can case it can be set with this option", +type:"Boolean",values:[!0,!1]},{name:"rate",description:"Defines the rate at which the clock will update, in milliseconds",type:"Integer",values:"1 - 9007199254740991 (recommended 10-60000)"}]}]};Object.freeze(c.clock);jqClock=[];c.fn.clock=function(a){return this.each(function(){var b=new Date;a=a||{};a.timestamp=a.timestamp||"localsystime";a.langSet=a.langSet||"en";a.calendar=a.hasOwnProperty("calendar")?a.calendar:!0;a.dateFormat=a.dateFormat||("en"==a.langSet?"l, F j, Y":"l, j F Y");a.timeFormat= +a.timeFormat||("en"==a.langSet?"h:i:s A":"H:i:s");a.timezone=a.timezone||"localsystimezone";a.isDST=a.hasOwnProperty("isDST")?a.isDST:b.isDST();a.rate=a.rate||500;"string"!==typeof a.langSet&&(a.langSet=""+a.langSet);"string"===typeof a.calendar?a.calendar="false"==a.calendar?!1:!0:"boolean"!==typeof a.calendar&&(a.calendar=!!a.calendar);"string"!==typeof a.dateFormat&&(a.dateFormat=""+a.dateFormat);"string"!==typeof a.timeFormat&&(a.timeFormat=""+a.dateFormat);"string"!==typeof a.timezone&&(a.timezone= +""+a.timezone);"string"===typeof a.isDST?a.isDST="true"==a.isDST?!0:!1:"boolean"!==typeof a.isDST&&(a.isDST=!!a.isDST);"number"!==typeof a.rate&&(a.rate=parseInt(a.rate));a.tzOffset=b.getTimezoneOffset();var k=a.tzOffset/60;a.sysdiff=0;"localsystime"!=a.timestamp?2<(b.getTime()+"").length-(a.timestamp+"").length?(a.timestamp*=1E3,a.sysdiff=a.timestamp-b.getTime()+6E4*a.tzOffset):(a.sysdiff=a.timestamp-b.getTime(),"localsystimezone"==a.timezone&&(a.timezone="UTC",0>k?a.timezone+="+"+Math.abs(k):0< +k&&(a.timezone+=-1*k))):"localsystimezone"==a.timezone&&(a.timezone="UTC",0>k?a.timezone+="+"+Math.abs(k):0g+1&&h!=n.length?(e+=n.substring(g+1,h),g+=h-g):e+=p;break;default:e+=p}}e=''+e+""}d="";for(g=0;g<=b.timeFormat.length;g++)switch(p=b.timeFormat.charAt(g),p){case "a":d+=z.toLowerCase(); +break;case "A":d+=z;break;case "B":d+=H;break;case "g":d+=t;break;case "G":d+=r;break;case "h":d+=(""+t).padStart(2,"0");break;case "H":d+=(""+r).padStart(2,"0");break;case "i":d+=(""+w).padStart(2,"0");break;case "s":d+=(""+x).padStart(2,"0");break;case "v":d+=(""+B).padStart(3,"0");break;case "e":d+=b.timezone;break;case "I":d+=b.isDST?"DST":"";break;case "O":d+=(0>m?"+"+(""+Math.abs(m)).padStart(2,"0"):0m?"+"+(""+Math.abs(m)).padStart(2, +"0"):0v?""+Math.abs(v):0m?"+"+(""+Math.abs(m)).padStart(2,"0"):0m?"+"+(""+Math.abs(m)).padStart(2,"0"):0g+1&&h!=n.length?(d+=n.substring(g+1,h),g+=h-g):d+=p;break;default:d+=p}n=''+d+"";c(a).html(e+n);jqClock[k]=setTimeout(function(){A(c(a), +b)},b.rate)}};c(this).hasClass("jqclock")||c(this).addClass("jqclock");c(this).is("[id]")||c(this).attr("id",b());A(c(this),a)})};return this})(jQuery);