1 line
10 KiB
JavaScript
1 line
10 KiB
JavaScript
![]() |
!function(e){"function"==typeof define&&define.amd?jQueryCookie.define(["jquery"],e):e(jQuery)}(function(h){var t=/\+/g;function d(e){return e}function v(e){return decodeURIComponent(e.replace(t," "))}function m(e){0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return g.json?JSON.parse(e):e}catch(e){}}var g=h.cookie=function(e,t,n){if(void 0!==t){if("number"==typeof(n=h.extend({},g.defaults,n)).expires){var r=n.expires,a=n.expires=new Date;a.setDate(a.getDate()+r)}return t=g.json?JSON.stringify(t):String(t),document.cookie=[g.raw?e:encodeURIComponent(e),"=",g.raw?t:encodeURIComponent(t),n.expires?"; expires="+n.expires.toUTCString():"",n.path?"; path="+n.path:"",n.domain?"; domain="+n.domain:"",n.secure?"; secure":""].join("")}for(var o=g.raw?d:v,i=document.cookie.split("; "),l=e?void 0:{},c=0,u=i.length;c<u;c++){var s=i[c].split("="),f=o(s.shift()),p=o(s.join("="));if(e&&e===f){l=m(p);break}e||(l[f]=m(p))}return l};g.defaults={},h.removeCookie=function(e,t){return void 0!==h.cookie(e)&&(h.cookie(e,"",h.extend({},t,{expires:-1})),!0)}}),function(i){i.fn.serializeForm=function(){if(this.length<1)return!1;var a={},o=a,e=':input[type!="checkbox"][type!="radio"], input:checked',t=function(){if(!this.disabled){var e=this.name.replace(/\[([^\]]+)?\]/g,",$1").split(","),t=e.length-1,n=i(this);if(e[0]){for(var r=0;r<t;r++)o=o[e[r]]=o[e[r]]||(""===e[r+1]||"0"===e[r+1]?[]:{});void 0!==o.length?o.push(n.val()):o[e[t]]=n.val(),o=a}}};return this.filter(e).each(t),this.find(e).each(t),a}}(jQuery),function(i){i.fn.typeWatch=function(e){var o=i.extend({wait:750,callback:function(){},highlight:!0,captureLength:2,inputTypes:["TEXT","TEXTAREA","PASSWORD","TEL","SEARCH","URL","EMAIL","DATETIME","DATE","MONTH","WEEK","TIME","DATETIME-LOCAL","NUMBER","RANGE"]},e);function t(e){var t=e.type.toUpperCase();if(0<=i.inArray(t,o.inputTypes)){var a={timer:null,text:i(e).val().toUpperCase(),cb:o.callback,el:e,wait:o.wait};o.highlight&&i(e).focus(function(){this.select()});i(e).on("keydown paste cut input",function(e){var t=a.wait,r=!1,n=this.type.toUpperCase();void 0!==e.keyCode&&13==e.keyCode&&"TEXTAREA"!=n&&0<=i.inArray(n,o.inputTypes)&&(t=1,r=!0);clearTimeout(a.timer),a.timer=setTimeout(function(){var e,t,n;t=r,((n=i((e=a).el).val()).length>=o.captureLength&&n.toUpperCase()!=e.text||t&&n.length>=o.captureLength)&&(e.text=n.toUpperCase(),e.cb.call(e.el,n))},t)})}}return this.each(function(){t(this)})}}(jQuery),function(c){c.fn.alphanum=function(e){return n(this,m,i(e)),this},c.fn.alpha=function(e){return n(this,m,i(e,i("alpha"))),this},c.fn.numeric=function(e){return n(this,S,h(e)),this.blur(function(){!function(e,t){var n=parseFloat(c(e).val()),r=c(e);if(isNaN(n))return r.val("");o(t.min)&&n<t.min&&r.val("");o(t.max)&&n>t.max&&r.val("")}(this,e)}),this};var e,t,u={allow:"",disallow:"",allowSpace:!0,allowNumeric:!0,allowUpper:!0,allowLower:!0,allowCaseless:!0,allowLatin:!0,allowOtherCharSets:!0,maxLength:NaN},r={allowPlus:!1,allowMinus:!0,allowThouSep:!0,allowDecSep:!0,allowLeadingSpaces:!1,maxDigits:NaN,maxDecimalPlaces:NaN,maxPreDecimalPlaces:NaN,max:NaN,min:NaN},s={alpha:{allowNumeric:!1},upper:{allowNumeric:!1,allowUpper:!0,allowLower:!1,allowCaseless:!0},lower:{allowNumeric:!1,allowUpper:!1,allowLower:!0,allowCaseless:!0}},a={integer:{allowPlus:!1,allowMinus:!0,allowThouSep:!1,allowDecSep:!1},positiveInteger:{allowPlus:!1,allowMinus:!1,allowThouSep:!1,allowDecSep:!1}},f="!@#$%^&*()+=[]\\';,/{}|\":<>?~`.-_ ¬€£¦",l=",",p=".",g=function(){var e,t="0123456789".split(""),n={},r=0;for(r=0;r<t.length;r++)e=t[r],n[e]=!0;return n}(),w=(t=(e="abcdefghijklmnopqrstuvwxyz").toUpperCase(),new T(e+t));function n(e,s,f){e.each(function(){var u=c(this);u.bind("keyup change paste",function(e){var t="";e.originalEvent&&e.originalEvent.clipboardData&&e.originalEvent.clipboardData.getData&&(t=e.originalEvent.clipboardData.getData("text/plain")),setTimeout(function(){!function(e,t,n,r){var a=e.val();""==a&&0<r.length&&(a=r);var o=t(a,n);if(a==o)return;var i=e.alphanum_caret();e.val(o),a.length==o.length+1?e.alphanum_caret
|