代码拉取完成,页面将自动刷新
同步操作将从 RockYang/YYGraft-在线涂鸦工具 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/* YYGraft 1.0.1 (2017-09-20), Copyright (C) r9it.com,*/
!function(a){a.fn.enable=function(){a(this).addClass("active"),a(this).removeAttr("disabled")},a.fn.disable=function(){a(this).removeClass("active"),a(this).attr("disabled",!0)};var b=function(b){function c(b){q=!0,s.push(m.getImageData(0,0,k.width,k.height)),m.beginPath();var c=a(l).offset();m.moveTo(b.pageX-c.left,b.pageY-c.top)}function d(){q=!1,t=[],o.disable(),1==s.length&&(n.enable(),p.enable())}function e(b){if(q){var c=a(l).offset(),d=b.pageX-c.left,e=b.pageY-c.top;m.lineTo(d,e),m.stroke()}}function f(){if(s.length>0){t.push(m.getImageData(0,0,k.width,k.height));var a=s.pop();m.putImageData(a,0,0),o.enable(),0==s.length&&n.disable()}}function g(){if(t.length>0){s.push(m.getImageData(0,0,k.width,k.height));var a=t.pop();m.putImageData(a,0,0),n.enable(),0==t.length&&o.disable()}}function h(){m.clearRect(0,0,m.canvas.width,m.canvas.height),s=[],t=[],n.disable(),o.disable(),p.disable()}function i(b){b||(b=a(".colorBar .active:eq(0)").data("color")),m.strokeStyle=b,m.shadowColor=b}function j(){if(a("#picBoard img").length>0){var b=new Image;b.src=a("#picBoard img:eq(0)").attr("src"),b.onload=function(){m.save(),m.shadowBlur=0,m.shadowColor="#FFF",m.globalCompositeOperation="destination-atop",m.drawImage(this,0,0,k.width,k.height),m.restore(),k.save(l.toDataURL("image/png"))}}else k.save(l.toDataURL("image/png"))}var k={width:360,height:300,save:function(a){}};b=b||{},a.extend(k,b);var l=a("#"+k.canvasId)[0];l.width=k.width,l.height=k.height;var m=l.getContext("2d");m.lineCap="round",m.lineJoin="round",i();var n=a("#J_prevStep"),o=a("#J_nextStep"),p=a("#J_clearBoard"),q=!1,r=!1,s=[],t=[],u={};return a("#picBoard").css({width:k.width+"px",height:k.height+"px"}),l.onmousedown=c,l.onmouseup=d,l.onmouseout=d,l.onmousemove=e,n.on("click",f),o.on("click",g),p.on("click",h),a("#clearSetting").on("click",function(){m.lineWidth=1,i(a(".colorBar span:first").data("color")),m.shadowBlur=0,alert("画笔已重新初始化,请重新配置画笔。")}),a("#J_canvas_bg").on("change",function(){if(a("#picBoard img").length>0)return void a("#picBoard img:eq(0)").attr("src",window.URL.createObjectURL(this.files[0]));var b='<img src="'+window.URL.createObjectURL(this.files[0])+'" width="'+k.width+'" height="'+k.height+'" />';a("#picBoard").append(b),a("#J_removeImg").enable()}),a("#J_removeImg").on("click",function(){a("#picBoard").empty(),a(this).disable()}),a("#J_saveImg").on("click",j),a("#scrawl-main .brush-size").on("click",function(){m.restore(),m.lineWidth=parseInt(a(this).text()),r=!1}),a("#scrawl-main .blur-size").on("click",function(){m.shadowBlur=parseInt(a(this).text())}),a("#scrawl-main .eraser-size").on("click",function(){1!=r&&(r=!0,m.save(),m.lineCap="round",m.lineJoin="round",m.lineWidth=10,m.globalCompositeOperation="destination-out")}),a("#scrawl-main .colorBar span").on("click",function(){a("#scrawl-main .colorBar .active").removeClass("active"),a(this).addClass("active"),i(a(this).data("color"))}),u.nextStep=g,u.prevStep=g,u.setColor=i,u.save=j,u};window.Canvas=b}(jQuery);
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。