1/** 2 * SyoTimer v.2.1.3 | under MIT licence 3 * http://syomochkin.xyz/folio/syotimer/demo.html 4 */ 5!function(i,e){"function"==typeof define&&define.amd?define(["jquery"],i):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),i(t),t}:i(e)}(function(l){var m="day",a="hour",s="minute",r="second",n={d:m,h:a,m:s,s:r},d={list:[r,s,a,m],next:function(e){e=this.list.indexOf(e);return e<this.list.length&&this.list[e+1]},prev:function(e){e=this.list.indexOf(e);return 0<e&&this.list[e-1]}},o={year:2034,month:7,day:31,hour:0,minute:0,second:0,timeZone:"local",ignoreTransferTime:!1,layout:"dhms",periodic:!1,periodInterval:7,periodUnit:"d",doubleNumbers:!0,effectType:"none",lang:"eng",headTitle:"",footTitle:"",afterDeadline:function(e){e.bodyBlock.html('<p style="font-size: 1.2em;">The countdown is finished!</p>')}},u={second:!1,minute:!1,hour:!1,day:!1},c={init:function(e){var t=l.extend({},o,e||{});t.itemTypes=y.getItemTypesByLayout(t.layout),t._itemsHas=l.extend({},u);for(var i=0;i<t.itemTypes.length;i++)t._itemsHas[t.itemTypes[i]]=!0;return this.each(function(){l(this).data("syotimer-options",t),c._render.apply(this,[]),c._perSecondHandler.apply(this,[])})},_render:function(){for(var e=l(this),t=e.data("syotimer-options"),i=y.getTimerItem(),n=l("<div/>",{class:"syotimer__head"}).html(t.headTitle),o=l("<div/>",{class:"syotimer__body"}),r=l("<div/>",{class:"syotimer__footer"}).html(t.footTitle),a={},s=0;s<t.itemTypes.length;s++){var d=i.clone();d.addClass("syotimer-cell_type_"+t.itemTypes[s]),o.append(d),a[t.itemTypes[s]]=d}var u={headBlock:n,bodyBlock:o,footBlock:r};e.data("syotimer-blocks",u).data("syotimer-items",a).addClass("syotimer").append(n).append(o).append(r)},_perSecondHandler:function(){var e=l(this),t=e.data("syotimer-options");l(".syotimer-cell > .syotimer-cell__value",e).css("opacity",1);var i=new Date,n=new Date(t.year,t.month-1,t.day,t.hour,t.minute,t.second),n=y.getDifferenceWithTimezone(i,n,t),n=y.getSecondsToDeadLine(n,t);0<=n?(c._refreshUnitsDom.apply(this,[n]),c._applyEffectSwitch.apply(this,[t.effectType])):(e=l.extend(e,e.data("syotimer-blocks")),t.afterDeadline(e))},_refreshUnitsDom:function(e){var t=l(this),i=t.data("syotimer-options"),n=t.data("syotimer-items"),o=i.itemTypes,r=y.getUnitsToDeadLine(e);i._itemsHas.day||(r.hour+=24*r.day),i._itemsHas.hour||(r.minute+=60*r.hour),i._itemsHas.minute||(r.second+=60*r.minute);for(var a=0;a<o.length;a++){var s=o[a],d=r[s],u=n[s];u.data("syotimer-unit-value",d),l(".syotimer-cell__value",u).html(y.format2(d,s!==m&&i.doubleNumbers)),l(".syotimer-cell__unit",u).html(l.syotimerLang.getNumeral(d,i.lang,s))}},_applyEffectSwitch:function(e,t){t=t||r;var i,n=this,o=l(n);"none"===e?setTimeout(function(){c._perSecondHandler.apply(n,[])},1e3):"opacity"!==e||(i=o.data("syotimer-items")[t])&&(o=d.next(t),t=i.data("syotimer-unit-value"),l(".syotimer-cell__value",i).animate({opacity:.1},1e3,"linear",function(){c._perSecondHandler.apply(n,[])}),o&&0===t&&c._applyEffectSwitch.apply(n,[e,o]))}},y={getTimerItem:function(){var e=l("<div/>",{class:"syotimer-cell__value",text:"0"}),t=l("<div/>",{class:"syotimer-cell__unit"}),i=l("<div/>",{class:"syotimer-cell"});return i.append(e).append(t),i},getItemTypesByLayout:function(e){for(var t=[],i=0;i<e.length;i++)t.push(n[e[i]]);return t},getSecondsToDeadLine:function(e,t){var i,n,o=e/1e3,o=Math.floor(o),o=t.periodic?(e=e/(1e3*(n=y.getPeriodUnit(t.periodUnit))),e=Math.ceil(e),e=Math.abs(e),0<=o?(i=0===(i=e%t.periodInterval)?t.periodInterval:i,--i):i=t.periodInterval-e%t.periodInterval,0==(t=o%n)&&o<0&&i--,Math.abs(i*n+t)):o;return o},getUnitsToDeadLine:function(e){var t=m,i={};do{var n=y.getPeriodUnit(t)}while(i[t]=Math.floor(e/n),e%=n,t=d.prev(t));return i},getPeriodUnit:function(e){switch(e){case"d":case m:return 86400;case"h":case a:return 3600;case"m":case s:return 60;case"s":case r:return 1}},getDifferenceWithTimezone:function(e,t,i){var n=t.getTime()-e.getTime(),o=0,r=0;return"local"!==i.timeZone&&(o=1e3*(parseFloat(i.timeZone)*y.getPeriodUnit(a)- -e.getTimezoneOffset()*y.getPeriodUnit(s))),i.ignoreTransferTime&&(r=1e3*(-e.getTimezoneOffset()*y.getPeriodUnit(s)- -t.getTimezoneOffset()*y.getPeriodUnit(s))),n-(o+r)},format2:function(e,t){return t=!1!==t,e<=9&&t?"0"+e:""+e}},i={setOption:function(e,t){var i=l(this),n=i.data("syotimer-options");n.hasOwnProperty(e)&&(n[e]=t,i.data("syotimer-options",n))}};l.fn.syotimer=function(e){if("string"==typeof e&&"setOption"===e){var t=Array.prototype.slice.call(arguments,1
5);return this.each(function(){i[e].apply(this,t)})}if(null==e||"object"==typeof e)return c.init.apply(this,[e]);l.error("SyoTimer. Error in call methods: methods is not exist")},l.syotimerLang={rus:{second:["ÑекÑнда","ÑекÑндÑ","ÑекÑнд"],minute:["минÑÑа","минÑÑÑ","минÑÑ"],hour:["ÑаÑ","ÑаÑа","ÑаÑов"],day:["денÑ","днÑ","дней"],handler:"rusNumeral"},eng:{second:["second","seconds"],minute:["minute","minutes"],hour:["hour","hours"],day:["day","days"]},por:{second:["segundo","segundos"],minute:["minuto","minutos"],hour:["hora","horas"],day:["dia","dias"]},spa:{second:["segundo","segundos"],minute:["minuto","minutos"],hour:["hora","horas"],day:["dÃa","dÃas"]},heb:{second:["×©× ××","×©× ××ת"],minute:["××§×","××§×ת"],hour:["שע×","שע×ת"],day:["×××","××××"]},universal:function(e){return 1===e?0:1},rusNumeral:function(e){e=4<e%100&&e%100<20?2:[2,0,1,1,1,2][e%10<5?e%10:5];return e},getNumeral:function(e,t,i){e=this[l.syotimerLang[t].handler||"universal"](e);return l.syotimerLang[t][i][e]}}},window.jQuery); 6//# sourceMappingURL=jquery.syotimer.min.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.