forked from a1gard/xshop
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
54 KiB
JavaScript
12 lines
54 KiB
JavaScript
2 years ago
|
/*
|
||
|
** persian-datepicker - v1.2.0
|
||
|
** Reza Babakhani <babakhani.reza@gmail.com>
|
||
|
** http://babakhani.github.io/PersianWebToolkit/docs/datepicker
|
||
|
** Under MIT license
|
||
|
*/
|
||
|
|
||
|
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.persianDatepicker=t():e.persianDatepicker=t()}(this,function(){return function(e){function t(n){if(i[n])return i[n].exports;var a=i[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var i={};return t.m=e,t.c=i,t.i=function(e){return e},t.d=function(e,i,n){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=5)}([function(e,t,i){"use strict";var n={debounce:function(e,t,i){var n;return function(){var a=this,o=arguments,s=function(){n=null,i||e.apply(a,o)},r=i&&!n;clearTimeout(n),n=setTimeout(s,t),r&&e.apply(a,o)}},log:function(e){console.log(e)},isMobile:function(){var e=!1;return function(t){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0)}(navigator.userAgent||navigator.vendor||window.opera),e}(),debug:function(e,t){window.persianDatepickerDebug&&(e.constructor.name?console.log("Debug: "+e.constructor.name+" : "+t):console.log("Debug: "+t))},delay:function(e,t){clearTimeout(window.datepickerTimer),window.datepickerTimer=setTimeout(e,t)}};e.exports=n},function(e,t,i){"use strict";e.exports='\n<div id="plotId" class="datepicker-plot-area {{cssClass}}">\n {{#navigator.enabled}}\n <div data-navigator class="datepicker-navigator">\n <div class="pwt-btn pwt-btn-next">{{navigator.text.btnNextText}}</div>\n <div class="pwt-btn pwt-btn-switch">{{navigator.switch.text}}</div>\n <div class="pwt-btn pwt-btn-prev">{{navigator.text.btnPrevText}}</div>\n </div>\n {{/navigator.enabled}}\n <div class="datepicker-grid-view" >\n {{#days.enabled}}\n {{#days.viewMode}}\n <div class="datepicker-day-view" > \n <div class="month-grid-box">\n <div class="header">\n <div class="title"></div>\n
|
||
|
* mustache.js - Logic-less {{mustache}} templates with JavaScript
|
||
|
* http://github.com/janl/mustache.js
|
||
|
*/
|
||
|
!function(i,s){"object"==typeof t&&t&&"string"!=typeof t.nodeName?s(t):(a=[t],n=s,void 0!==(o="function"==typeof n?n.apply(t,a):n)&&(e.exports=o))}(0,function(e){function t(e){return"function"==typeof e}function i(e){return f(e)?"array":typeof e}function n(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function a(e,t){return null!=e&&"object"==typeof e&&t in e}function o(e,t){return null!=e&&"object"!=typeof e&&e.hasOwnProperty&&e.hasOwnProperty(t)}function s(e,t){return w.call(e,t)}function r(e){return!s(y,e)}function l(e){return String(e).replace(/[&<>"'`=\/]/g,function(e){return b[e]})}function d(t,i){function a(e){if("string"==typeof e&&(e=e.split(g,2)),!f(e)||2!==e.length)throw new Error("Invalid tags: "+e);o=new RegExp(n(e[0])+"\\s*"),s=new RegExp("\\s*"+n(e[1])),l=new RegExp("\\s*"+n("}"+e[1]))}if(!t)return[];var o,s,l,d=[],m=[],v=[],p=!1,w=!1;a(i||e.tags);for(var y,b,T,M,S,O,E=new h(t);!E.eos();){if(y=E.pos,T=E.scanUntil(o))for(var $=0,C=T.length;$<C;++$)M=T.charAt($),r(M)?v.push(m.length):w=!0,m.push(["text",M,y,y+1]),y+=1,"\n"===M&&function(){if(p&&!w)for(;v.length;)delete m[v.pop()];else v=[];p=!1,w=!1}();if(!E.scan(o))break;if(p=!0,b=E.scan(P)||"name",E.scan(k),"="===b?(T=E.scanUntil(D),E.scan(D),E.scanUntil(s)):"{"===b?(T=E.scanUntil(l),E.scan(x),E.scanUntil(s),b="&"):T=E.scanUntil(s),!E.scan(s))throw new Error("Unclosed tag at "+E.pos);if(S=[b,T,y,E.pos],m.push(S),"#"===b||"^"===b)d.push(S);else if("/"===b){if(!(O=d.pop()))throw new Error('Unopened section "'+T+'" at '+y);if(O[1]!==T)throw new Error('Unclosed section "'+O[1]+'" at '+y)}else"name"===b||"{"===b||"&"===b?w=!0:"="===b&&a(T)}if(O=d.pop())throw new Error('Unclosed section "'+O[1]+'" at '+E.pos);return u(c(m))}function c(e){for(var t,i,n=[],a=0,o=e.length;a<o;++a)(t=e[a])&&("text"===t[0]&&i&&"text"===i[0]?(i[1]+=t[1],i[3]=t[3]):(n.push(t),i=t));return n}function u(e){for(var t,i,n=[],a=n,o=[],s=0,r=e.length;s<r;++s)switch(t=e[s],t[0]){case"#":case"^":a.push(t),o.push(t),a=t[4]=[];break;case"/":i=o.pop(),i[5]=t[2],a=o.length>0?o[o.length-1][4]:n;break;default:a.push(t)}return n}function h(e){this.string=e,this.tail=e,this.pos=0}function m(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function v(){this.cache={}}var p=Object.prototype.toString,f=Array.isArray||function(e){return"[object Array]"===p.call(e)},w=RegExp.prototype.test,y=/\S/,b={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="},k=/\s*/,g=/\s+/,D=/\s*=/,x=/\s*\}/,P=/#|\^|\/|>|\{|&|=|!/;h.prototype.eos=function(){return""===this.tail},h.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var i=t[0];return this.tail=this.tail.substring(i.length),this.pos+=i.length,i},h.prototype.scanUntil=function(e){var t,i=this.tail.search(e);switch(i){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,i),this.tail=this.tail.substring(i)}return this.pos+=t.length,t},m.prototype.push=function(e){return new m(e,this)},m.prototype.lookup=function(e){var i,n=this.cache;if(n.hasOwnProperty(e))i=n[e];else{for(var s,r,l,d=this,c=!1;d;){if(e.indexOf(".")>0)for(s=d.view,r=e.split("."),l=0;null!=s&&l<r.length;)l===r.length-1&&(c=a(s,r[l])||o(s,r[l])),s=s[r[l++]];else s=d.view[e],c=a(d.view,e);if(c){i=s;break}d=d.parent}n[e]=i}return t(i)&&(i=i.call(this.view)),i},v.prototype.clearCache=function(){this.cache={}},v.prototype.parse=function(t,i){var n=this.cache,a=t+":"+(i||e.tags).join(":"),o=n[a];return null==o&&(o=n[a]=d(t,i)),o},v.prototype.render=function(e,t,i,n){var a=this.parse(e,n),o=t instanceof m?t:new m(t);return this.renderTokens(a,o,i,e,n)},v.prototype.renderTokens=function(e,t,i,n,a){for(var o,s,r,l="",d=0,c=e.length;d<c;++d)r=void 0,o=e[d],s=o[0],"#"===s?r=this.renderSection(o,t,i,n):"^"===s?r=this.renderInverted(o,t,i,n):">"===s?r=this.renderPartial(o,t,i,a):"&"===s?r=this.unescapedValue(o,t):"name"===s?r=this.escapedValue(o,t):"text"===s&&(r=this.rawValue(o)),void 0!==r&&(l+=r);return l},v.prototype.renderSection=function(e,i,n,a){function o(e){return s.render(e,i,n
|