Файловый менеджер - Редактировать - /home/lmsyaran/public_html/joomla5/plugins/fabrik_element/digsig/libs/signature-pad-master/jquery.signaturepad-min.js
Назад
(function(a){function b(B,l){var y=this,F=a.extend({},a.fn.signaturePad.defaults,l),f=a(B),i=a(F.canvas,f),e=i.get(0),t=null,h={x:null,y:null},s=[],o=false,J=false,m=false,A=false,c=30,r=c,z=0;function d(){clearTimeout(o);o=false;J=false}function w(N,L){var P,O,M;N.preventDefault();P=a(N.target).offset();clearTimeout(o);o=false;if(typeof N.targetTouches!=="undefined"){O=Math.floor(N.targetTouches[0].pageX-P.left);M=Math.floor(N.targetTouches[0].pageY-P.top)}else{O=Math.floor(N.pageX-P.left);M=Math.floor(N.pageY-P.top)}if(h.x===O&&h.y===M){return true}if(h.x===null){h.x=O}if(h.y===null){h.y=M}if(L){M+=L}t.beginPath();t.moveTo(h.x,h.y);t.lineTo(O,M);t.lineCap=F.penCap;t.stroke();t.closePath();s.push({lx:O,ly:M,mx:h.x,my:h.y});h.x=O;h.y=M;if(F.onDraw&&typeof F.onDraw==="function"){F.onDraw.apply(y)}}function K(){D()}function D(L){if(!!L){w(L,1)}else{if(m){i.each(function(){this.removeEventListener("touchmove",w)})}else{i.unbind("mousemove.signaturepad")}if(s.length>0&&F.onDrawEnd&&typeof F.onDrawEnd==="function"){F.onDrawEnd.apply(y)}}h.x=null;h.y=null;if(F.output&&s.length>0){a(F.output,f).val(JSON.stringify(s))}}function p(){if(!F.lineWidth){return false}t.beginPath();t.lineWidth=F.lineWidth;t.strokeStyle=F.lineColour;t.moveTo(F.lineMargin,F.lineTop);t.lineTo(e.width-F.lineMargin,F.lineTop);t.stroke();t.closePath()}function v(){t.clearRect(0,0,e.width,e.height);t.fillStyle=F.bgColour;t.fillRect(0,0,e.width,e.height);if(!F.displayOnly){p()}t.lineWidth=F.penWidth;t.strokeStyle=F.penColour;a(F.output,f).val("");s=[];D()}function u(L,M){if(h.x==null){w(L,1)}else{w(L,M)}}function H(M,L){if(m){L.addEventListener("touchmove",u,false)}else{i.bind("mousemove.signaturepad",u)}w(M,1)}function g(){A=false;i.each(function(){if(this.removeEventListener){this.removeEventListener("touchend",K);this.removeEventListener("touchcancel",K);this.removeEventListener("touchmove",w)}if(this.ontouchstart){this.ontouchstart=null}});a(document).unbind("mouseup.signaturepad");i.unbind("mousedown.signaturepad");i.unbind("mousemove.signaturepad");i.unbind("mouseleave.signaturepad");a(F.clear,f).unbind("click.signaturepad")}function q(L){if(A){return false}A=true;a("input").blur();if(typeof L.targetTouches!=="undefined"){m=true}if(m){i.each(function(){this.addEventListener("touchend",K,false);this.addEventListener("touchcancel",K,false)});i.unbind("mousedown.signaturepad")}else{a(document).bind("mouseup.signaturepad",function(){if(J){D();d()}});i.bind("mouseleave.signaturepad",function(M){if(J){D(M)}if(J&&!o){o=setTimeout(function(){D();d()},500)}});i.each(function(){this.ontouchstart=null})}}function n(){a(F.typed,f).hide();v();i.each(function(){this.ontouchstart=function(L){L.preventDefault();J=true;q(L);H(L,this)}});i.bind("mousedown.signaturepad",function(L){L.preventDefault();if(L.which>1){return false}J=true;q(L);H(L)});a(F.clear,f).bind("click.signaturepad",function(L){L.preventDefault();v()});a(F.typeIt,f).bind("click.signaturepad",function(L){L.preventDefault();E()});a(F.drawIt,f).unbind("click.signaturepad");a(F.drawIt,f).bind("click.signaturepad",function(L){L.preventDefault()});a(F.typeIt,f).removeClass(F.currentClass);a(F.drawIt,f).addClass(F.currentClass);a(F.sig,f).addClass(F.currentClass);a(F.typeItDesc,f).hide();a(F.drawItDesc,f).show();a(F.clear,f).show()}function E(){v();g();a(F.typed,f).show();a(F.drawIt,f).bind("click.signaturepad",function(L){L.preventDefault();n()});a(F.typeIt,f).unbind("click.signaturepad");a(F.typeIt,f).bind("click.signaturepad",function(L){L.preventDefault()});a(F.output,f).val("");a(F.drawIt,f).removeClass(F.currentClass);a(F.typeIt,f).addClass(F.currentClass);a(F.sig,f).removeClass(F.currentClass);a(F.drawItDesc,f).hide();a(F.clear,f).hide();a(F.typeItDesc,f).show();r=c=a(F.typed,f).css("font-size").replace(/px/,"")}function k(P){var O=a(F.typed,f),N=P.replace(/>/g,">").replace(/</g,"<").trim(),M=z,L=r*0.5;z=N.length;O.html(N);if(!N){O.css("font-size",c+"px");return}if(z>M&&O.outerWidth()>e.width){while(O.outerWidth()>e.width){r--;O.css("font-size",r+"px")}}if(z<M&&O.outerWidth()+L<e.width&&r<c){while(O.outerWidth()+L<e.width&&r<c){r++;O.css("font-size",r+"px")}}}function x(L,M){a("p."+M.errorClass,L).remove();L.removeClass(M.errorClass);a("input, label",L).removeClass(M.errorClass)}function G(N,L,M){if(N.nameInvalid){L.prepend(['<p class="',M.errorClass,'">',M.errorMessage,"</p>"].join(""));a(M.name,L).focus();a(M.name,L).addClass(M.errorClass);a("label[for="+a(M.name).attr("id")+"]",L).addClass(M.errorClass)}if(N.drawInvalid){L.prepend(['<p class="',M.errorClass,'">',M.errorMessageDraw,"</p>"].join(""))}}function j(){var N=true,O={drawInvalid:false,nameInvalid:false},M=[f,F],L=[O,f,F];if(F.onBeforeValidate&&typeof F.onBeforeValidate==="function"){F.onBeforeValidate.apply(y,M)}else{x.apply(y,M)}if(F.drawOnly&&s.length<1){O.drawInvalid=true;N=false}if(a(F.name,f).val()===""){O.nameInvalid=true;N=false}if(F.onFormError&&typeof F.onFormError==="function"){F.onFormError.apply(y,L)}else{G.apply(y,L)}return N}function I(O,M,N){for(var L in O){if(typeof O[L]==="object"){M.beginPath();M.moveTo(O[L].mx,O[L].my);M.lineTo(O[L].lx,O[L].ly);M.lineCap=F.penCap;M.stroke();M.closePath();if(N){s.push({lx:O[L].lx,ly:O[L].ly,mx:O[L].mx,my:O[L].my})}}}}function C(){if(parseFloat(((/CPU.+OS ([0-9_]{3}).*AppleWebkit.*Mobile/i.exec(navigator.userAgent))||[0,"4_2"])[1].replace("_","."))<4.1){a.fn.Oldoffset=a.fn.offset;a.fn.offset=function(){var L=a(this).Oldoffset();L.top-=window.scrollY;L.left-=window.scrollX;return L}}a(F.typed,f).bind("selectstart.signaturepad",function(L){return a(L.target).is(":input")});i.bind("selectstart.signaturepad",function(L){return a(L.target).is(":input")});if(!e.getContext&&FlashCanvas){FlashCanvas.initElement(e)}if(e.getContext){t=e.getContext("2d");a(F.sig,f).show();if(!F.displayOnly){if(!F.drawOnly){a(F.name,f).bind("keyup.signaturepad",function(){k(a(this).val())});a(F.name,f).bind("blur.signaturepad",function(){k(a(this).val())});a(F.drawIt,f).bind("click.signaturepad",function(L){L.preventDefault();n()})}if(F.drawOnly||F.defaultAction==="drawIt"){n()}else{E()}if(F.validateFields){if(a(B).is("form")){a(B).bind("submit.signaturepad",function(){return j()})}else{a(B).parents("form").bind("submit.signaturepad",function(){return j()})}}a(F.sigNav,f).show()}}}a.extend(y,{init:function(){C()},updateOptions:function(L){a.extend(F,L)},regenerate:function(L){y.clearCanvas();a(F.typed,f).hide();if(typeof L==="string"){L=JSON.parse(L)}I(L,t,true);if(F.output&&a(F.output,f).length>0){a(F.output,f).val(JSON.stringify(s))}},clearCanvas:function(){v()},getSignature:function(){return s},getSignatureString:function(){return JSON.stringify(s)},getSignatureImage:function(){var L=document.createElement("canvas"),M=null,N=null;L.style.position="absolute";L.style.top="-999em";L.width=e.width;L.height=e.height;document.body.appendChild(L);if(!L.getContext&&FlashCanvas){FlashCanvas.initElement(L)}M=L.getContext("2d");M.fillStyle=F.bgColour;M.fillRect(0,0,e.width,e.height);M.lineWidth=F.penWidth;M.strokeStyle=F.penColour;I(s,M);N=L.toDataURL.apply(L,arguments);document.body.removeChild(L);L=null;return N},validateForm:function(){return j()}})}a.fn.signaturePad=function(c){var d=null;this.each(function(){if(!a.data(this,"plugin-signaturePad")){d=new b(this,c);d.init();a.data(this,"plugin-signaturePad",d)}else{d=a.data(this,"plugin-signaturePad");d.updateOptions(c)}});return d};a.fn.signaturePad.defaults={defaultAction:"typeIt",displayOnly:false,drawOnly:false,canvas:"canvas",sig:".sig",sigNav:".sigNav",bgColour:"#ffffff",penColour:"#145394",penWidth:2,penCap:"round",lineColour:"#ccc",lineWidth:2,lineMargin:5,lineTop:35,name:".name",typed:".typed",clear:".clearButton",typeIt:".typeIt a",drawIt:".drawIt a",typeItDesc:".typeItDesc",drawItDesc:".drawItDesc",output:".output",currentClass:"current",validateFields:true,errorClass:"error",errorMessage:"Please enter your name",errorMessageDraw:"Please sign the document",onBeforeValidate:null,onFormError:null,onDraw:null,onDrawEnd:null}}(jQuery));
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка