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