group each plugin in its own folder
This commit is contained in:
1
dist/editor/system/extensions/ext-star/ext-star.js
vendored
Normal file
1
dist/editor/system/extensions/ext-star/ext-star.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
System.register([],(function(t,e){"use strict";return{execute:function(){function asyncGeneratorStep(t,e,n,r,a,o,i){try{var s=t[o](i),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,a)}t("default",{name:"star",init:function init(t){var n=this;return function _asyncToGenerator(t){return function(){var e=this,n=arguments;return new Promise((function(r,a){var o=t.apply(e,n);function _next(t){asyncGeneratorStep(o,r,a,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(o,r,a,_next,_throw,"throw",t)}_next(void 0)}))}}(regeneratorRuntime.mark((function _callee(){var r,a,o,i,s,l,u,c,d,h,p,f;return regeneratorRuntime.wrap((function _callee$(g){for(;;)switch(g.prev=g.next){case 0:return h=function _setAttr(t,e){a.changeSelectedAttribute(t,e),a.call("changed",i)},d=function _showPanel(t){var e=o("#fc_rules");e.length||(e=o('<style id="fc_rules"></style>').appendTo("head")),e.text(t?" #tool_topath { display: none !important; }":""),o("#star_panel").toggle(t)},a=(r=n).canvas,o=t.$,g.next=7,e.import("./locale/".concat(r.curPrefs.lang,".js"));case 7:return u=g.sent,c=u.default,p=[{id:"tool_star",icon:"star.png",type:"mode",position:12,events:{click:function click(){d(!0),a.setMode("star")}}}],f=[{type:"input",panel:"star_panel",id:"starNumPoints",size:3,defval:5,events:{change:function change(){h("point",this.value)}}},{type:"input",panel:"star_panel",id:"starRadiusMulitplier",size:3,defval:2.5},{type:"input",panel:"star_panel",id:"radialShift",size:3,defval:0,events:{change:function change(){h("radialshift",this.value)}}}],g.abrupt("return",{name:c.name,svgicons:"star-icons.svg",buttons:c.buttons.map((function(t,e){return Object.assign(p[e],t)})),context_tools:c.contextTools.map((function(t,e){return Object.assign(f[e],t)})),callback:function callback(){o("#star_panel").hide()},mouseDown:function mouseDown(t){var e=a.getColor("fill"),n=a.getColor("stroke"),r=a.getStrokeWidth();if("star"===a.getMode())return s=!0,l=a.addSVGElementFromJson({element:"polygon",attr:{cx:t.start_x,cy:t.start_y,id:a.getNextId(),shape:"star",point:document.getElementById("starNumPoints").value,r:0,radialshift:document.getElementById("radialShift").value,r2:0,orient:"point",fill:e,strokecolor:n,strokeWidth:r}}),{started:!0}},mouseMove:function mouseMove(t){if(s&&"star"===a.getMode()){var e=o(l).attr(["cx","cy","point","orient","fill","strokecolor","strokeWidth","radialshift"]),n=t.mouse_x,r=t.mouse_y,i=e.cx,u=e.cy,c=e.fill,d=e.strokecolor,h=e.strokeWidth,p=e.radialshift,f=e.point,g=e.orient,m=Math.sqrt((n-i)*(n-i)+(r-u)*(r-u))/1.5,v=m/document.getElementById("starRadiusMulitplier").value;l.setAttribute("r",m),l.setAttribute("r2",v);for(var _="",y=0;f>=y;y++){var M=2*Math.PI*(y/f);"point"===g?M-=Math.PI/2:"edge"===g&&(M=M+Math.PI/f-Math.PI/2),_+=(n=m*Math.cos(M)+i)+","+(r=m*Math.sin(M)+u)+" ",isNaN(v)||(M=2*Math.PI*(y/f)+Math.PI/f,"point"===g?M-=Math.PI/2:"edge"===g&&(M=M+Math.PI/f-Math.PI/2),M+=p,_+=(n=v*Math.cos(M)+i)+","+(r=v*Math.sin(M)+u)+" ")}return l.setAttribute("points",_),l.setAttribute("fill",c),l.setAttribute("stroke",d),l.setAttribute("stroke-width",h),l.getAttribute("shape"),{started:!0}}},mouseUp:function mouseUp(){if("star"===a.getMode())return{keep:"0"!==o(l).attr(["r"]).r,element:l}},selectedChanged:function selectedChanged(t){for(var e=(i=t.elems).length;e--;){var n=i[e];n&&"star"===n.getAttribute("shape")&&t.selectedElement&&!t.multiselected?(o("#starNumPoints").val(n.getAttribute("point")),o("#radialShift").val(n.getAttribute("radialshift")),d(!0)):d(!1)}},elementChanged:function elementChanged(t){}});case 12:case"end":return g.stop()}}),_callee)})))()}})}}}));
|
||||
Reference in New Issue
Block a user