group each plugin in its own folder
This commit is contained in:
10
dist/editor/system/extensions/ext-arrows.js
vendored
10
dist/editor/system/extensions/ext-arrows.js
vendored
@@ -1,10 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){function _AwaitValue(e){this.wrapped=e}function _AsyncGenerator(e){var t,r;function resume(t,r){try{var n=e[t](r),a=n.value,o=a instanceof _AwaitValue;Promise.resolve(o?a.wrapped:a).then((function(e){o?resume("return"===t?"return":"next",e):settle(n.done?"return":"normal",e)}),(function(e){resume("throw",e)}))}catch(e){settle("throw",e)}}function settle(e,n){switch(e){case"return":t.resolve({value:n,done:!0});break;case"throw":t.reject(n);break;default:t.resolve({value:n,done:!1})}(t=t.next)?resume(t.key,t.arg):r=null}this._invoke=function send(e,n){return new Promise((function(a,o){var i={key:e,arg:n,resolve:a,reject:o,next:null};r?r=r.next=i:(t=r=i,resume(e,n))}))},"function"!=typeof e.return&&(this.return=void 0)}function asyncGeneratorStep(e,t,r,n,a,o,i){try{var u=e[o](i),c=u.value}catch(e){return void r(e)}u.done?t(c):Promise.resolve(c).then(n,a)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function _next(e){asyncGeneratorStep(o,n,a,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(o,n,a,_next,_throw,"throw",e)}_next(void 0)}))}}"function"==typeof Symbol&&Symbol.asyncIterator&&(_AsyncGenerator.prototype[Symbol.asyncIterator]=function(){return this}),_AsyncGenerator.prototype.next=function(e){return this._invoke("next",e)},_AsyncGenerator.prototype.throw=function(e){return this._invoke("throw",e)},_AsyncGenerator.prototype.return=function(e){return this._invoke("return",e)};
|
||||
/**
|
||||
* @file ext-arrows.js
|
||||
*
|
||||
* @license MIT
|
||||
*
|
||||
* @copyright 2010 Alexis Deveria
|
||||
*
|
||||
*/
|
||||
e("default",{name:"arrows",init:function init(e){var t=this;return _asyncToGenerator(regeneratorRuntime.mark((function _callee2(){var r,n,a,o,i,u,c,l,s,d,f,m,h,v,_,k,p,w,b;return regeneratorRuntime.wrap((function _callee2$(g){for(;;)switch(g.prev=g.next){case 0:return w=function _colorChanged(t){var r=t.getAttribute("stroke"),a=["start","mid","end"],o=n.findDefs();i.each(a,(function(n,u){var c=h(t,"marker-"+u);if(c){var s=i(c).children().attr("fill"),d=i(c).children().attr("d");if(s!==r){var f=i(o).find("marker"),m=null;if(f.each((function(){var e=i(this).children().attr(["fill","d"]);e.fill===r&&e.d===d&&(m=this)})),!m){var v=c.id.includes("_fw")?"fw":"bk";m=k(v,u,l+v+f.length),i(m).children().attr("fill",r)}i(t).attr("marker-"+u,"url(#"+m.id+")");var _=!0;i(e.svgcontent).find("line, polyline, path, polygon").each((function(){var e=this;if(i.each(a,(function(t,r){if(i(e).attr("marker-"+r)==="url(#"+c.id+")")return _=!1})),!_)return!1})),_&&i(c).remove()}}}))},p=function _setArrow(){_();var e=this.value;if("none"!==e){var t="fw";"mid_bk"===e?(e="mid",t="bk"):"both"===e?(k("bk",e),n.changeSelectedAttribute("marker-start","url(#"+m.bk.id+")"),e="end",t="fw"):"start"===e&&(t="bk"),k(t,e),n.changeSelectedAttribute("marker-"+e,"url(#"+m[t].id+")"),n.call("changed",c)}},k=function _addMarker(e,t,r){r=r||l+e;var o=m[e];"mid"===t&&(o.refx=5);var i=n.getElem(r);if(!i){i=a({element:"marker",attr:{viewBox:"0 0 10 10",id:r,refY:5,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",style:"pointer-events:none"}});var u=a({element:"path",attr:{d:o.d,fill:"#000000"}});i.append(u),n.findDefs().append(i)}return i.setAttribute("refX",o.refx),i},_=function _resetMarker(){var e=c[0];e.removeAttribute("marker-start"),e.removeAttribute("marker-mid"),e.removeAttribute("marker-end")},v=function _showPanel(e){if(i("#arrow_panel").toggle(e),e){var t,r=c[0],n=r.getAttribute("marker-end"),a=r.getAttribute("marker-start"),o=r.getAttribute("marker-mid");n&&a?t="both":n?t="end":a?t="start":o&&(t="mid",o.includes("bk")&&(t="mid_bk")),a||o||n||(t="none"),i("#arrow_list").val(t)}},h=function _getLinked(e,t){var r=e.getAttribute(t);if(!r)return null;var a=r.match(/\(#(.*)\)/);return a&&2===a.length?n.getElem(a[1]):null},f=function _unsetArrowNonce(e){s=!1,l=u,m.fw.id=l+"fw",m.bk.id=l+"bk"},d=function _setArrowNonce(e,t){s=!0,l=u+t+"_",m.fw.id=l+"fw",m.bk.id=l+"bk"},g.next=10,e.importLocale();case 10:return r=g.sent,n=t.canvas,a=n.addSVGElementFromJson,o=e.nonce,i=e.$,u="se_arrow_",s=e.randomize_ids,n.bind("setnonce",d),n.bind("unsetnonce",f),m={fw:{d:"m0,0l10,5l-10,5l5,-5l-5,-5z",refx:8,id:(l=s?u+o+"_":u)+"fw"},bk:{d:"m10,0l-10,5l10,5l-5,-5l5,-5z",refx:2,id:l+"bk"}},b=[{type:"select",panel:"arrow_panel",id:"arrow_list",defval:"none",events:{change:p}}],g.abrupt("return",{name:r.name,context_tools:r.contextTools.map((function(e,t){return Object.assign(b[t],e)})),callback:function callback(){i("#arrow_panel").hide(),i("#arrow_list option")[0].id="connector_no_arrow"},addLangData:function addLangData(e){return _asyncToGenerator(regeneratorRuntime.mark((function _callee(){var t,r,n;return regeneratorRuntime.wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:return e.lang,t=e.importLocale,a.next=3,t();case 3:return r=a.sent,n=r.langList,a.abrupt("return",{data:n});case 6:case"end":return a.stop()}}),_callee)})))()},selectedChanged:function selectedChanged(e){for(var t=["line","path","polyline","polygon"],r=(c=e.elems).length;r--;){var n=c[r];n&&t.includes(n.tagName)&&e.selectedElement&&!e.multiselected?v(!0):v(!1)}},elementChanged:function elementChanged(e){var t=e.elems[0];t&&(t.getAttribute("marker-start")||t.getAttribute("marker-mid")||t.getAttribute("marker-end"))&&w(t)}});case 21:case"end":return g.stop()}}),_callee2)})))()}})}}}));
|
||||
9
dist/editor/system/extensions/ext-arrows/ext-arrows.js
vendored
Normal file
9
dist/editor/system/extensions/ext-arrows/ext-arrows.js
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
System.register([],(function(e,t){"use strict";return{execute:function(){function asyncGeneratorStep(e,t,r,n,a,i,o){try{var l=e[i](o),c=l.value}catch(e){return void r(e)}l.done?t(c):Promise.resolve(c).then(n,a)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function _next(e){asyncGeneratorStep(i,n,a,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(i,n,a,_next,_throw,"throw",e)}_next(void 0)}))}}
|
||||
/**
|
||||
* @file ext-arrows.js
|
||||
*
|
||||
* @license MIT
|
||||
*
|
||||
* @copyright 2010 Alexis Deveria
|
||||
*
|
||||
*/e("default",{name:"arrows",init:function init(e){var r=this;return _asyncToGenerator(regeneratorRuntime.mark((function _callee2(){var n,a,i,o,l,c,u,d,s,f,m,h,v,k,g,_,b,p,w,x,A;return regeneratorRuntime.wrap((function _callee2$(y){for(;;)switch(y.prev=y.next){case 0:return x=function _colorChanged(t){var r=t.getAttribute("stroke"),n=["start","mid","end"],a=o.findDefs();u.each(n,(function(i,o){var l=g(t,"marker-"+o);if(l){var c=u(l).children().attr("fill"),d=u(l).children().attr("d");if(c!==r){var s=u(a).find("marker"),m=null;if(s.each((function(){var e=u(this).children().attr(["fill","d"]);e.fill===r&&e.d===d&&(m=this)})),!m){var h=l.id.includes("_fw")?"fw":"bk";m=p(h,o,f+h+s.length),u(m).children().attr("fill",r)}u(t).attr("marker-"+o,"url(#"+m.id+")");var v=!0;u(e.svgcontent).find("line, polyline, path, polygon").each((function(){var e=this;if(u.each(n,(function(t,r){if(u(e).attr("marker-"+r)==="url(#"+l.id+")")return v=!1})),!v)return!1})),v&&u(l).remove()}}}))},w=function _setArrow(){b();var e=this.value;if("none"!==e){var t="fw";"mid_bk"===e?(e="mid",t="bk"):"both"===e?(p("bk",e),o.changeSelectedAttribute("marker-start","url(#"+k.bk.id+")"),e="end",t="fw"):"start"===e&&(t="bk"),p(t,e),o.changeSelectedAttribute("marker-"+e,"url(#"+k[t].id+")"),o.call("changed",s)}},p=function _addMarker(e,t,r){r=r||f+e;var n=k[e];"mid"===t&&(n.refx=5);var a=o.getElem(r);if(!a){a=l({element:"marker",attr:{viewBox:"0 0 10 10",id:r,refY:5,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",style:"pointer-events:none"}});var i=l({element:"path",attr:{d:n.d,fill:"#000000"}});a.append(i),o.findDefs().append(a)}return a.setAttribute("refX",n.refx),a},b=function _resetMarker(){var e=s[0];e.removeAttribute("marker-start"),e.removeAttribute("marker-mid"),e.removeAttribute("marker-end")},_=function _showPanel(e){if(u("#arrow_panel").toggle(e),e){var t,r=s[0],n=r.getAttribute("marker-end"),a=r.getAttribute("marker-start"),i=r.getAttribute("marker-mid");n&&a?t="both":n?t="end":a?t="start":i&&(t="mid",i.includes("bk")&&(t="mid_bk")),a||i||n||(t="none"),u("#arrow_list").val(t)}},g=function _getLinked(e,t){var r=e.getAttribute(t);if(!r)return null;var n=r.match(/\(#(.*)\)/);return n&&2===n.length?o.getElem(n[1]):null},v=function _unsetArrowNonce(e){m=!1,f=d,k.fw.id=f+"fw",k.bk.id=f+"bk"},h=function _setArrowNonce(e,t){m=!0,f=d+t+"_",k.fw.id=f+"fw",k.bk.id=f+"bk"},n=r,y.next=11,t.import("./locale/".concat(n.curPrefs.lang,".js"));case 11:return a=y.sent,i=a.default,o=n.canvas,l=o.addSVGElementFromJson,c=e.nonce,u=e.$,d="se_arrow_",m=e.randomize_ids,o.bind("setnonce",h),o.bind("unsetnonce",v),k={fw:{d:"m0,0l10,5l-10,5l5,-5l-5,-5z",refx:8,id:(f=m?d+c+"_":d)+"fw"},bk:{d:"m10,0l-10,5l10,5l-5,-5l5,-5z",refx:2,id:f+"bk"}},A=[{type:"select",panel:"arrow_panel",id:"arrow_list",defval:"none",events:{change:w}}],y.abrupt("return",{name:i.name,context_tools:i.contextTools.map((function(e,t){return Object.assign(A[t],e)})),callback:function callback(){u("#arrow_panel").hide(),u("#arrow_list option")[0].id="connector_no_arrow"},addLangData:function addLangData(e){return _asyncToGenerator(regeneratorRuntime.mark((function _callee(){var t,r,n;return regeneratorRuntime.wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:return e.lang,t=e.importLocale,a.next=3,t();case 3:return r=a.sent,n=r.langList,a.abrupt("return",{data:n});case 6:case"end":return a.stop()}}),_callee)})))()},selectedChanged:function selectedChanged(e){for(var t=["line","path","polyline","polygon"],r=(s=e.elems).length;r--;){var n=s[r];n&&t.includes(n.tagName)&&e.selectedElement&&!e.multiselected?_(!0):_(!1)}},elementChanged:function elementChanged(e){var t=e.elems[0];t&&(t.getAttribute("marker-start")||t.getAttribute("marker-mid")||t.getAttribute("marker-end"))&&x(t)}});case 22:case"end":return y.stop()}}),_callee2)})))()}})}}}));
|
||||
File diff suppressed because one or more lines are too long
1
dist/editor/system/extensions/ext-closepath/ext-closepath.js
vendored
Normal file
1
dist/editor/system/extensions/ext-closepath/ext-closepath.js
vendored
Normal file
File diff suppressed because one or more lines are too long
10
dist/editor/system/extensions/ext-connector.js
vendored
10
dist/editor/system/extensions/ext-connector.js
vendored
File diff suppressed because one or more lines are too long
10
dist/editor/system/extensions/ext-connector/ext-connector.js
vendored
Normal file
10
dist/editor/system/extensions/ext-connector/ext-connector.js
vendored
Normal file
File diff suppressed because one or more lines are too long
10
dist/editor/system/extensions/ext-eyedropper.js
vendored
10
dist/editor/system/extensions/ext-eyedropper.js
vendored
@@ -1,10 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){function _AwaitValue(e){this.wrapped=e}function _AsyncGenerator(e){var t,r;function resume(t,r){try{var n=e[t](r),o=n.value,i=o instanceof _AwaitValue;Promise.resolve(i?o.wrapped:o).then((function(e){i?resume("return"===t?"return":"next",e):settle(n.done?"return":"normal",e)}),(function(e){resume("throw",e)}))}catch(e){settle("throw",e)}}function settle(e,n){switch(e){case"return":t.resolve({value:n,done:!0});break;case"throw":t.reject(n);break;default:t.resolve({value:n,done:!1})}(t=t.next)?resume(t.key,t.arg):r=null}this._invoke=function send(e,n){return new Promise((function(o,i){var a={key:e,arg:n,resolve:o,reject:i,next:null};r?r=r.next=a:(t=r=a,resume(e,n))}))},"function"!=typeof e.return&&(this.return=void 0)}function asyncGeneratorStep(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}"function"==typeof Symbol&&Symbol.asyncIterator&&(_AsyncGenerator.prototype[Symbol.asyncIterator]=function(){return this}),_AsyncGenerator.prototype.next=function(e){return this._invoke("next",e)},_AsyncGenerator.prototype.throw=function(e){return this._invoke("throw",e)},_AsyncGenerator.prototype.return=function(e){return this._invoke("return",e)};
|
||||
/**
|
||||
* @file ext-eyedropper.js
|
||||
*
|
||||
* @license MIT
|
||||
*
|
||||
* @copyright 2010 Jeff Schiller
|
||||
*
|
||||
*/
|
||||
e("default",{name:"eyedropper",init:function init(e){var t=this;return function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function _next(e){asyncGeneratorStep(i,n,o,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(i,n,o,_next,_throw,"throw",e)}_next(void 0)}))}}(regeneratorRuntime.mark((function _callee(){var r,n,o,i,a,s,c,u,l;return regeneratorRuntime.wrap((function _callee$(p){for(;;)switch(p.prev=p.next){case 0:return u=function _getStyle(e){if("eyedropper"!==a.getMode()){var t=o("#tool_eyedropper"),r=null;e.multiselected||!e.elems[0]||["svg","g","use"].includes(e.elems[0].nodeName)?t.addClass("disabled"):(r=e.elems[0],t.removeClass("disabled"),c.fillPaint=r.getAttribute("fill")||"black",c.fillOpacity=r.getAttribute("fill-opacity")||1,c.strokePaint=r.getAttribute("stroke"),c.strokeOpacity=r.getAttribute("stroke-opacity")||1,c.strokeWidth=r.getAttribute("stroke-width"),c.strokeDashArray=r.getAttribute("stroke-dasharray"),c.strokeLinecap=r.getAttribute("stroke-linecap"),c.strokeLinejoin=r.getAttribute("stroke-linejoin"),c.opacity=r.getAttribute("opacity")||1)}},p.next=3,e.importLocale();case 3:return r=p.sent,n=t,o=e.$,i=e.ChangeElementCommand,a=n.canvas,s=function addToHistory(e){a.undoMgr.addCommandToHistory(e)},c={fillPaint:"red",fillOpacity:1,strokePaint:"black",strokeOpacity:1,strokeWidth:5,strokeDashArray:null,opacity:1,strokeLinecap:"butt",strokeLinejoin:"miter"},l=[{id:"tool_eyedropper",icon:"eyedropper.png",type:"mode",events:{click:function click(){a.setMode("eyedropper")}}}],p.abrupt("return",{name:r.name,svgicons:"eyedropper-icon.xml",buttons:r.buttons.map((function(e,t){return Object.assign(l[t],e)})),selectedChanged:u,elementChanged:u,mouseDown:function mouseDown(e){if("eyedropper"===a.getMode()){var t=e.event.target;if(!["svg","g","use"].includes(t.nodeName)){var r={},n=function change(e,t,n){r[t]=e.getAttribute(t),e.setAttribute(t,n)};c.fillPaint&&n(t,"fill",c.fillPaint),c.fillOpacity&&n(t,"fill-opacity",c.fillOpacity),c.strokePaint&&n(t,"stroke",c.strokePaint),c.strokeOpacity&&n(t,"stroke-opacity",c.strokeOpacity),c.strokeWidth&&n(t,"stroke-width",c.strokeWidth),c.strokeDashArray&&n(t,"stroke-dasharray",c.strokeDashArray),c.opacity&&n(t,"opacity",c.opacity),c.strokeLinecap&&n(t,"stroke-linecap",c.strokeLinecap),c.strokeLinejoin&&n(t,"stroke-linejoin",c.strokeLinejoin),s(new i(t,r))}}}});case 8:case"end":return p.stop()}}),_callee)})))()}})}}}));
|
||||
10
dist/editor/system/extensions/ext-eyedropper/ext-eyedropper.js
vendored
Normal file
10
dist/editor/system/extensions/ext-eyedropper/ext-eyedropper.js
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
System.register([],(function(e,t){"use strict";return{execute:function(){function asyncGeneratorStep(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}
|
||||
/**
|
||||
* @file ext-eyedropper.js
|
||||
*
|
||||
* @license MIT
|
||||
*
|
||||
* @copyright 2010 Jeff Schiller
|
||||
*
|
||||
*/
|
||||
e("default",{name:"eyedropper",init:function init(e){var r=this;return function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function _next(e){asyncGeneratorStep(i,n,o,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(i,n,o,_next,_throw,"throw",e)}_next(void 0)}))}}(regeneratorRuntime.mark((function _callee(){var n,o,i,a,s,c,l,u,p,d;return regeneratorRuntime.wrap((function _callee$(y){for(;;)switch(y.prev=y.next){case 0:return p=function _getStyle(e){if("eyedropper"!==c.getMode()){var t=a("#tool_eyedropper"),r=null;e.multiselected||!e.elems[0]||["svg","g","use"].includes(e.elems[0].nodeName)?t.addClass("disabled"):(r=e.elems[0],t.removeClass("disabled"),u.fillPaint=r.getAttribute("fill")||"black",u.fillOpacity=r.getAttribute("fill-opacity")||1,u.strokePaint=r.getAttribute("stroke"),u.strokeOpacity=r.getAttribute("stroke-opacity")||1,u.strokeWidth=r.getAttribute("stroke-width"),u.strokeDashArray=r.getAttribute("stroke-dasharray"),u.strokeLinecap=r.getAttribute("stroke-linecap"),u.strokeLinejoin=r.getAttribute("stroke-linejoin"),u.opacity=r.getAttribute("opacity")||1)}},n=r,y.next=4,t.import("./locale/".concat(n.curPrefs.lang,".js"));case 4:return o=y.sent,i=o.default,a=e.$,s=e.ChangeElementCommand,c=n.canvas,l=function addToHistory(e){c.undoMgr.addCommandToHistory(e)},u={fillPaint:"red",fillOpacity:1,strokePaint:"black",strokeOpacity:1,strokeWidth:5,strokeDashArray:null,opacity:1,strokeLinecap:"butt",strokeLinejoin:"miter"},d=[{id:"tool_eyedropper",icon:"eyedropper.png",type:"mode",events:{click:function click(){c.setMode("eyedropper")}}}],y.abrupt("return",{name:i.name,svgicons:"eyedropper-icon.xml",buttons:i.buttons.map((function(e,t){return Object.assign(d[t],e)})),selectedChanged:p,elementChanged:p,mouseDown:function mouseDown(e){if("eyedropper"===c.getMode()){var t=e.event.target;if(!["svg","g","use"].includes(t.nodeName)){var r={},n=function change(e,t,n){r[t]=e.getAttribute(t),e.setAttribute(t,n)};u.fillPaint&&n(t,"fill",u.fillPaint),u.fillOpacity&&n(t,"fill-opacity",u.fillOpacity),u.strokePaint&&n(t,"stroke",u.strokePaint),u.strokeOpacity&&n(t,"stroke-opacity",u.strokeOpacity),u.strokeWidth&&n(t,"stroke-width",u.strokeWidth),u.strokeDashArray&&n(t,"stroke-dasharray",u.strokeDashArray),u.opacity&&n(t,"opacity",u.opacity),u.strokeLinecap&&n(t,"stroke-linecap",u.strokeLinecap),u.strokeLinejoin&&n(t,"stroke-linejoin",u.strokeLinejoin),l(new s(t,r))}}}});case 9:case"end":return y.stop()}}),_callee)})))()}})}}}));
|
||||
@@ -1,10 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){function _AwaitValue(e){this.wrapped=e}function _AsyncGenerator(e){var t,n;function resume(t,n){try{var r=e[t](n),o=r.value,i=o instanceof _AwaitValue;Promise.resolve(i?o.wrapped:o).then((function(e){i?resume("return"===t?"return":"next",e):settle(r.done?"return":"normal",e)}),(function(e){resume("throw",e)}))}catch(e){settle("throw",e)}}function settle(e,r){switch(e){case"return":t.resolve({value:r,done:!0});break;case"throw":t.reject(r);break;default:t.resolve({value:r,done:!1})}(t=t.next)?resume(t.key,t.arg):n=null}this._invoke=function send(e,r){return new Promise((function(o,i){var a={key:e,arg:r,resolve:o,reject:i,next:null};n?n=n.next=a:(t=n=a,resume(e,r))}))},"function"!=typeof e.return&&(this.return=void 0)}function asyncGeneratorStep(e,t,n,r,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void n(e)}c.done?t(s):Promise.resolve(s).then(r,o)}function _asyncToGenerator(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function _next(e){asyncGeneratorStep(i,r,o,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(i,r,o,_next,_throw,"throw",e)}_next(void 0)}))}}"function"==typeof Symbol&&Symbol.asyncIterator&&(_AsyncGenerator.prototype[Symbol.asyncIterator]=function(){return this}),_AsyncGenerator.prototype.next=function(e){return this._invoke("next",e)},_AsyncGenerator.prototype.throw=function(e){return this._invoke("throw",e)},_AsyncGenerator.prototype.return=function(e){return this._invoke("return",e)};
|
||||
/**
|
||||
* @file ext-foreignobject.js
|
||||
*
|
||||
* @license Apache-2.0
|
||||
*
|
||||
* @copyright 2010 Jacques Distler, 2010 Alexis Deveria
|
||||
*
|
||||
*/
|
||||
e("default",{name:"foreignobject",init:function init(e){var t=this;return _asyncToGenerator(regeneratorRuntime.mark((function _callee2(){var n,r,o,i,a,c,s,u,l,f,g,_,h,d,v,p,m,b,x,y;return regeneratorRuntime.wrap((function _callee2$(w){for(;;)switch(w.prev=w.next){case 0:return b=function _setAttr(e,t){c.changeSelectedAttribute(e,t),c.call("changed",_)},m=function _showForeignEditor(){var e=_[0];if(e&&!v){v=!0,g(!0),e.removeAttribute("fill");var t=c.svgToString(e,0);r("#svg_source_textarea").val(t),r("#svg_source_editor").fadeIn(),l(),r("#svg_source_textarea").focus()}},p=function _setForeignString(e){var t=_[0];try{var n=o('<svg xmlns="'+i.SVG+'" xmlns:xlink="'+i.XLINK+'">'+e+"</svg>");c.sanitizeSvg(n.documentElement),t.replaceWith(s.importNode(n.documentElement.firstChild,!0)),c.call("changed",[t]),c.clearSelection()}catch(e){return console.log(e),!1}return!0},g=function _toggleSourceButtons(e){r("#tool_source_save, #tool_source_cancel").toggle(!e),r("#foreign_save, #foreign_cancel").toggle(e)},f=function _showPanel(e){var t=r("#fc_rules");t.length||(t=r('<style id="fc_rules"></style>').appendTo("head")),t.text(e?" #tool_topath { display: none !important; }":""),r("#foreignObject_panel").toggle(e)},n=t,r=e.$,o=e.text2xml,i=e.NS,a=e.importLocale,c=n.canvas,s=e.svgroot.parentNode.ownerDocument,w.next=11,a();case 11:return u=w.sent,l=function properlySourceSizeTextArea(){var e=r("#svg_source_container").height()-80;r("#svg_source_textarea").css("height",e)},v=!1,x=[{id:"tool_foreign",icon:"foreignobject-tool.png",type:"mode",events:{click:function click(){c.setMode("foreign")}}},{id:"edit_foreign",icon:"foreignobject-edit.png",type:"context",panel:"foreignObject_panel",events:{click:function click(){m()}}}],y=[{type:"input",panel:"foreignObject_panel",id:"foreign_width",size:3,events:{change:function change(){b("width",this.value)}}},{type:"input",panel:"foreignObject_panel",id:"foreign_height",events:{change:function change(){b("height",this.value)}}},{type:"input",panel:"foreignObject_panel",id:"foreign_font_size",size:2,defval:16,events:{change:function change(){b("font-size",this.value)}}}],w.abrupt("return",{name:u.name,svgicons:"foreignobject-icons.xml",buttons:u.buttons.map((function(e,t){return Object.assign(x[t],e)})),context_tools:u.contextTools.map((function(e,t){return Object.assign(y[t],e)})),callback:function callback(){r("#foreignObject_panel").hide();var e=function endChanges(){r("#svg_source_editor").hide(),v=!1,r("#svg_source_textarea").blur(),g(!1)};setTimeout((function(){r("#tool_source_save").clone().hide().attr("id","foreign_save").unbind().appendTo("#tool_source_back").click(_asyncToGenerator(regeneratorRuntime.mark((function _callee(){return regeneratorRuntime.wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:if(v){t.next=2;break}return t.abrupt("return");case 2:if(p(r("#svg_source_textarea").val())){t.next=11;break}return t.next=5,r.confirm("Errors found. Revert to original?");case 5:if(t.sent){t.next=8;break}return t.abrupt("return");case 8:e(),t.next=12;break;case 11:e();case 12:case"end":return t.stop()}}),_callee)})))),r("#tool_source_cancel").clone().hide().attr("id","foreign_cancel").unbind().appendTo("#tool_source_back").click((function(){e()}))}),3e3)},mouseDown:function mouseDown(e){if("foreign"===c.getMode()){h=!0,d=c.addSVGElementFromJson({element:"foreignObject",attr:{x:e.start_x,y:e.start_y,id:c.getNextId(),"font-size":16,width:"48",height:"20",style:"pointer-events:inherit"}});var t=s.createElementNS(i.MATH,"math");t.setAttributeNS(i.XMLNS,"xmlns",i.MATH),t.setAttribute("display","inline");var n=s.createElementNS(i.MATH,"mi");n.setAttribute("mathvariant","normal"),n.textContent="Φ";var r=s.createElementNS(i.MATH,"mo");r.textContent="∪";var o=s.createElementNS(i.MATH,"mi");return o.textContent="ℳ",t.append(n,r,o),d.append(t),{started:!0}}},mouseUp:function mouseUp(e){if("foreign"===c.getMode()&&h){var t=r(d).attr(["width","height"]),n="0"!==t.width||"0"!==t.height;return c.addToSelection([d],!0),{keep:n,element:d}}},selectedChanged:function selectedChanged(e){for(var t=(_=e.elems).length;t--;){var n=_[t];n&&"foreignObject"===n.tagName&&e.selectedElement&&!e.multiselected?(r("#foreign_font_size").val(n.getAttribute("font-size")),r("#foreign_width").val(n.getAttribute("width")),r("#foreign_height").val(n.getAttribute("height")),f(!0)):f(!1)}},elementChanged:function elementChanged(e){}});case 17:case"end":return w.stop()}}),_callee2)})))()}})}}}));
|
||||
9
dist/editor/system/extensions/ext-foreignobject/ext-foreignobject.js
vendored
Normal file
9
dist/editor/system/extensions/ext-foreignobject/ext-foreignobject.js
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
System.register([],(function(e,t){"use strict";return{execute:function(){function asyncGeneratorStep(e,t,n,r,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void n(e)}c.done?t(s):Promise.resolve(s).then(r,o)}function _asyncToGenerator(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function _next(e){asyncGeneratorStep(i,r,o,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(i,r,o,_next,_throw,"throw",e)}_next(void 0)}))}}
|
||||
/**
|
||||
* @file ext-foreignobject.js
|
||||
*
|
||||
* @license Apache-2.0
|
||||
*
|
||||
* @copyright 2010 Jacques Distler, 2010 Alexis Deveria
|
||||
*
|
||||
*/e("default",{name:"foreignobject",init:function init(e){var n=this;return _asyncToGenerator(regeneratorRuntime.mark((function _callee2(){var r,o,i,a,c,s,l,u,g,f,_,d,h,v,p,m,b,x,y,S;return regeneratorRuntime.wrap((function _callee2$(w){for(;;)switch(w.prev=w.next){case 0:return x=function _setAttr(e,t){c.changeSelectedAttribute(e,t),c.call("changed",d)},b=function _showForeignEditor(){var e=d[0];if(e&&!p){p=!0,_(!0),e.removeAttribute("fill");var t=c.svgToString(e,0);o("#svg_source_textarea").val(t),o("#svg_source_editor").fadeIn(),g(),o("#svg_source_textarea").focus()}},m=function _setForeignString(e){var t=d[0];try{var n=i('<svg xmlns="'+a.SVG+'" xmlns:xlink="'+a.XLINK+'">'+e+"</svg>");c.sanitizeSvg(n.documentElement),t.replaceWith(s.importNode(n.documentElement.firstChild,!0)),c.call("changed",[t]),c.clearSelection()}catch(e){return console.log(e),!1}return!0},_=function _toggleSourceButtons(e){o("#tool_source_save, #tool_source_cancel").toggle(!e),o("#foreign_save, #foreign_cancel").toggle(e)},f=function _showPanel(e){var t=o("#fc_rules");t.length||(t=o('<style id="fc_rules"></style>').appendTo("head")),t.text(e?" #tool_topath { display: none !important; }":""),o("#foreignObject_panel").toggle(e)},r=n,o=e.$,i=e.text2xml,a=e.NS,c=r.canvas,s=e.svgroot.parentNode.ownerDocument,w.next=11,t.import("./locale/".concat(r.curPrefs.lang,".js"));case 11:return l=w.sent,u=l.default,g=function properlySourceSizeTextArea(){var e=o("#svg_source_container").height()-80;o("#svg_source_textarea").css("height",e)},p=!1,y=[{id:"tool_foreign",icon:"foreignobject-tool.png",type:"mode",events:{click:function click(){c.setMode("foreign")}}},{id:"edit_foreign",icon:"foreignobject-edit.png",type:"context",panel:"foreignObject_panel",events:{click:function click(){b()}}}],S=[{type:"input",panel:"foreignObject_panel",id:"foreign_width",size:3,events:{change:function change(){x("width",this.value)}}},{type:"input",panel:"foreignObject_panel",id:"foreign_height",events:{change:function change(){x("height",this.value)}}},{type:"input",panel:"foreignObject_panel",id:"foreign_font_size",size:2,defval:16,events:{change:function change(){x("font-size",this.value)}}}],w.abrupt("return",{name:u.name,svgicons:"foreignobject-icons.xml",buttons:u.buttons.map((function(e,t){return Object.assign(y[t],e)})),context_tools:u.contextTools.map((function(e,t){return Object.assign(S[t],e)})),callback:function callback(){o("#foreignObject_panel").hide();var e=function endChanges(){o("#svg_source_editor").hide(),p=!1,o("#svg_source_textarea").blur(),_(!1)};setTimeout((function(){o("#tool_source_save").clone().hide().attr("id","foreign_save").unbind().appendTo("#tool_source_back").click(_asyncToGenerator(regeneratorRuntime.mark((function _callee(){return regeneratorRuntime.wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:if(p){t.next=2;break}return t.abrupt("return");case 2:if(m(o("#svg_source_textarea").val())){t.next=11;break}return t.next=5,o.confirm("Errors found. Revert to original?");case 5:if(t.sent){t.next=8;break}return t.abrupt("return");case 8:e(),t.next=12;break;case 11:e();case 12:case"end":return t.stop()}}),_callee)})))),o("#tool_source_cancel").clone().hide().attr("id","foreign_cancel").unbind().appendTo("#tool_source_back").click((function(){e()}))}),3e3)},mouseDown:function mouseDown(e){if("foreign"===c.getMode()){h=!0,v=c.addSVGElementFromJson({element:"foreignObject",attr:{x:e.start_x,y:e.start_y,id:c.getNextId(),"font-size":16,width:"48",height:"20",style:"pointer-events:inherit"}});var t=s.createElementNS(a.MATH,"math");t.setAttributeNS(a.XMLNS,"xmlns",a.MATH),t.setAttribute("display","inline");var n=s.createElementNS(a.MATH,"mi");n.setAttribute("mathvariant","normal"),n.textContent="Φ";var r=s.createElementNS(a.MATH,"mo");r.textContent="∪";var o=s.createElementNS(a.MATH,"mi");return o.textContent="ℳ",t.append(n,r,o),v.append(t),{started:!0}}},mouseUp:function mouseUp(e){if("foreign"===c.getMode()&&h){var t=o(v).attr(["width","height"]),n="0"!==t.width||"0"!==t.height;return c.addToSelection([v],!0),{keep:n,element:v}}},selectedChanged:function selectedChanged(e){for(var t=(d=e.elems).length;t--;){var n=d[t];n&&"foreignObject"===n.tagName&&e.selectedElement&&!e.multiselected?(o("#foreign_font_size").val(n.getAttribute("font-size")),o("#foreign_width").val(n.getAttribute("width")),o("#foreign_height").val(n.getAttribute("height")),f(!0)):f(!1)}},elementChanged:function elementChanged(e){}});case 18:case"end":return w.stop()}}),_callee2)})))()}})}}}));
|
||||
10
dist/editor/system/extensions/ext-grid.js
vendored
10
dist/editor/system/extensions/ext-grid.js
vendored
@@ -1,10 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){function _AwaitValue(e){this.wrapped=e}function _AsyncGenerator(e){var t,n;function resume(t,n){try{var r=e[t](n),o=r.value,i=o instanceof _AwaitValue;Promise.resolve(i?o.wrapped:o).then((function(e){i?resume("return"===t?"return":"next",e):settle(r.done?"return":"normal",e)}),(function(e){resume("throw",e)}))}catch(e){settle("throw",e)}}function settle(e,r){switch(e){case"return":t.resolve({value:r,done:!0});break;case"throw":t.reject(r);break;default:t.resolve({value:r,done:!1})}(t=t.next)?resume(t.key,t.arg):n=null}this._invoke=function send(e,r){return new Promise((function(o,i){var a={key:e,arg:r,resolve:o,reject:i,next:null};n?n=n.next=a:(t=n=a,resume(e,r))}))},"function"!=typeof e.return&&(this.return=void 0)}function asyncGeneratorStep(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}"function"==typeof Symbol&&Symbol.asyncIterator&&(_AsyncGenerator.prototype[Symbol.asyncIterator]=function(){return this}),_AsyncGenerator.prototype.next=function(e){return this._invoke("next",e)},_AsyncGenerator.prototype.throw=function(e){return this._invoke("throw",e)},_AsyncGenerator.prototype.return=function(e){return this._invoke("return",e)};
|
||||
/**
|
||||
* @file ext-grid.js
|
||||
*
|
||||
* @license Apache-2.0
|
||||
*
|
||||
* @copyright 2010 Redou Mine, 2010 Alexis Deveria
|
||||
*
|
||||
*/
|
||||
e("default",{name:"grid",init:function init(e){var t=this;return function _asyncToGenerator(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function _next(e){asyncGeneratorStep(i,r,o,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(i,r,o,_next,_throw,"throw",e)}_next(void 0)}))}}(regeneratorRuntime.mark((function _callee(){var n,r,o,i,a,s,c,u,l,d,p,h,v,g,f,m,y,w,_,b,x,G;return regeneratorRuntime.wrap((function _callee$(S){for(;;)switch(S.prev=S.next){case 0:return x=function _gridUpdate(){g&&b(c.getZoom()),n("#canvasGrid").toggle(g),n("#view_grid").toggleClass("push_button_pressed tool_button")},b=function _updateGrid(e){var t=h[s.curConfig.baseUnit]*e,n=100/t,r=1;v.some((function(e){return r=e,n<=e}));var o=r*t;d.width=o,d.height=o;var i=d.getContext("2d"),a=.5,u=o/10;i.globalAlpha=.2,i.strokeStyle=s.curConfig.gridColor;for(var l=1;l<10;l++){var p=Math.round(u*l)+.5;i.moveTo(p,o),i.lineTo(p,0),i.moveTo(o,p),i.lineTo(0,p)}i.stroke(),i.beginPath(),i.globalAlpha=.5,i.moveTo(a,o),i.lineTo(a,0),i.moveTo(o,a),i.lineTo(0,a),i.stroke();var g=d.toDataURL("image/png");w.setAttribute("width",o),w.setAttribute("height",o),w.parentNode.setAttribute("width",o),w.parentNode.setAttribute("height",o),c.setHref(w,g)},n=e.$,r=e.NS,o=e.getTypeMap,i=e.importLocale,S.next=5,i();case 5:return a=S.sent,c=(s=t).canvas,u=document.getElementById("svgcanvas").ownerDocument,l=c.assignAttributes,d=document.createElement("canvas"),p=n("#canvasBackground"),h=o(),v=[.01,.1,1,10,100,1e3],g=s.curConfig.showGrid||!1,n(d).hide().appendTo("body"),f=u.createElementNS(r.SVG,"svg"),l(f,{id:"canvasGrid",width:"100%",height:"100%",x:0,y:0,overflow:"visible",display:"none"}),p.append(f),m=u.createElementNS(r.SVG,"defs"),y=u.createElementNS(r.SVG,"pattern"),l(y,{id:"gridpattern",patternUnits:"userSpaceOnUse",x:0,y:0,width:100,height:100}),w=u.createElementNS(r.SVG,"image"),l(w,{x:0,y:0,width:100,height:100}),y.append(w),m.append(y),n("#canvasGrid").append(m),_=u.createElementNS(r.SVG,"rect"),l(_,{width:"100%",height:"100%",x:0,y:0,"stroke-width":0,stroke:"none",fill:"url(#gridpattern)",style:"pointer-events: none; display:visible;"}),n("#canvasGrid").append(_),G=[{id:"view_grid",icon:"grid.png",type:"context",panel:"editor_panel",events:{click:function click(){s.curConfig.showGrid=g=!g,x()}}}],S.abrupt("return",{name:a.name,svgicons:"grid-icon.xml",zoomChanged:function zoomChanged(e){g&&b(e)},callback:function callback(){g&&x()},buttons:a.buttons.map((function(e,t){return Object.assign(G[t],e)}))});case 27:case"end":return S.stop()}}),_callee)})))()}})}}}));
|
||||
10
dist/editor/system/extensions/ext-grid/ext-grid.js
vendored
Normal file
10
dist/editor/system/extensions/ext-grid/ext-grid.js
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
System.register([],(function(e,t){"use strict";return{execute:function(){function asyncGeneratorStep(e,t,n,r,a,o,i){try{var c=e[o](i),s=c.value}catch(e){return void n(e)}c.done?t(s):Promise.resolve(s).then(r,a)}
|
||||
/**
|
||||
* @file ext-grid.js
|
||||
*
|
||||
* @license Apache-2.0
|
||||
*
|
||||
* @copyright 2010 Redou Mine, 2010 Alexis Deveria
|
||||
*
|
||||
*/
|
||||
e("default",{name:"grid",init:function init(e){var n=this;return function _asyncToGenerator(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function _next(e){asyncGeneratorStep(o,r,a,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(o,r,a,_next,_throw,"throw",e)}_next(void 0)}))}}(regeneratorRuntime.mark((function _callee(){var r,a,o,i,c,s,u,d,l,g,p,h,v,m,f,w,b,y,_,S,G,x;return regeneratorRuntime.wrap((function _callee$(k){for(;;)switch(k.prev=k.next){case 0:return G=function _gridUpdate(){m&&S(u.getZoom()),r("#canvasGrid").toggle(m),r("#view_grid").toggleClass("push_button_pressed tool_button")},S=function _updateGrid(e){var t=h[i.curConfig.baseUnit]*e,n=100/t,r=1;v.some((function(e){return r=e,n<=e}));var a=r*t;g.width=a,g.height=a;var o=g.getContext("2d"),c=.5,s=a/10;o.globalAlpha=.2,o.strokeStyle=i.curConfig.gridColor;for(var d=1;d<10;d++){var l=Math.round(s*d)+.5;o.moveTo(l,a),o.lineTo(l,0),o.moveTo(a,l),o.lineTo(0,l)}o.stroke(),o.beginPath(),o.globalAlpha=.5,o.moveTo(c,a),o.lineTo(c,0),o.moveTo(a,c),o.lineTo(0,c),o.stroke();var p=g.toDataURL("image/png");y.setAttribute("width",a),y.setAttribute("height",a),y.parentNode.setAttribute("width",a),y.parentNode.setAttribute("height",a),u.setHref(y,p)},r=e.$,a=e.NS,o=e.getTypeMap,i=n,k.next=6,t.import("./locale/".concat(i.curPrefs.lang,".js"));case 6:return c=k.sent,s=c.default,u=i.canvas,d=document.getElementById("svgcanvas").ownerDocument,l=u.assignAttributes,g=document.createElement("canvas"),p=r("#canvasBackground"),h=o(),v=[.01,.1,1,10,100,1e3],m=i.curConfig.showGrid||!1,r(g).hide().appendTo("body"),f=d.createElementNS(a.SVG,"svg"),l(f,{id:"canvasGrid",width:"100%",height:"100%",x:0,y:0,overflow:"visible",display:"none"}),p.append(f),w=d.createElementNS(a.SVG,"defs"),b=d.createElementNS(a.SVG,"pattern"),l(b,{id:"gridpattern",patternUnits:"userSpaceOnUse",x:0,y:0,width:100,height:100}),y=d.createElementNS(a.SVG,"image"),l(y,{x:0,y:0,width:100,height:100}),b.append(y),w.append(b),r("#canvasGrid").append(w),_=d.createElementNS(a.SVG,"rect"),l(_,{width:"100%",height:"100%",x:0,y:0,"stroke-width":0,stroke:"none",fill:"url(#gridpattern)",style:"pointer-events: none; display:visible;"}),r("#canvasGrid").append(_),x=[{id:"view_grid",icon:"grid.png",type:"context",panel:"editor_panel",events:{click:function click(){i.curConfig.showGrid=m=!m,G()}}}],k.abrupt("return",{name:s.name,svgicons:"grid-icon.xml",zoomChanged:function zoomChanged(e){m&&S(e)},callback:function callback(){m&&G()},buttons:s.buttons.map((function(e,t){return Object.assign(x[t],e)}))});case 28:case"end":return k.stop()}}),_callee)})))()}})}}}));
|
||||
10
dist/editor/system/extensions/ext-helloworld.js
vendored
10
dist/editor/system/extensions/ext-helloworld.js
vendored
@@ -1,10 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){function _AwaitValue(e){this.wrapped=e}function _AsyncGenerator(e){var r,t;function resume(r,t){try{var n=e[r](t),o=n.value,a=o instanceof _AwaitValue;Promise.resolve(a?o.wrapped:o).then((function(e){a?resume("return"===r?"return":"next",e):settle(n.done?"return":"normal",e)}),(function(e){resume("throw",e)}))}catch(e){settle("throw",e)}}function settle(e,n){switch(e){case"return":r.resolve({value:n,done:!0});break;case"throw":r.reject(n);break;default:r.resolve({value:n,done:!1})}(r=r.next)?resume(r.key,r.arg):t=null}this._invoke=function send(e,n){return new Promise((function(o,a){var i={key:e,arg:n,resolve:o,reject:a,next:null};t?t=t.next=i:(r=t=i,resume(e,n))}))},"function"!=typeof e.return&&(this.return=void 0)}function asyncGeneratorStep(e,r,t,n,o,a,i){try{var u=e[a](i),c=u.value}catch(e){return void t(e)}u.done?r(c):Promise.resolve(c).then(n,o)}function _slicedToArray(e,r){return _arrayWithHoles(e)||function _iterableToArrayLimit(e,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var t=[],n=!0,o=!1,a=void 0;try{for(var i,u=e[Symbol.iterator]();!(n=(i=u.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw a}}return t}(e,r)||_unsupportedIterableToArray(e,r)||_nonIterableRest()}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _unsupportedIterableToArray(e,r){if(e){if("string"==typeof e)return _arrayLikeToArray(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(e,r):void 0}}function _arrayLikeToArray(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}"function"==typeof Symbol&&Symbol.asyncIterator&&(_AsyncGenerator.prototype[Symbol.asyncIterator]=function(){return this}),_AsyncGenerator.prototype.next=function(e){return this._invoke("next",e)},_AsyncGenerator.prototype.throw=function(e){return this._invoke("throw",e)},_AsyncGenerator.prototype.return=function(e){return this._invoke("return",e)};
|
||||
/**
|
||||
* @file ext-helloworld.js
|
||||
*
|
||||
* @license MIT
|
||||
*
|
||||
* @copyright 2010 Alexis Deveria
|
||||
*
|
||||
*/
|
||||
e("default",{name:"helloworld",init:function init(e){var r=this;return function _asyncToGenerator(e){return function(){var r=this,t=arguments;return new Promise((function(n,o){var a=e.apply(r,t);function _next(e){asyncGeneratorStep(a,n,o,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(a,n,o,_next,_throw,"throw",e)}_next(void 0)}))}}(regeneratorRuntime.mark((function _callee(){var t,n,o,a;return regeneratorRuntime.wrap((function _callee$(i){for(;;)switch(i.prev=i.next){case 0:return t=e.$,n=e.importLocale,i.next=3,n();case 3:return o=i.sent,a=r.canvas,i.abrupt("return",{name:o.name,svgicons:"helloworld-icon.xml",buttons:[{id:"hello_world",icon:"helloworld.png",type:"mode",title:o.buttons[0].title,events:{click:function click(){a.setMode("hello_world")}}}],mouseDown:function mouseDown(){if("hello_world"===a.getMode())return{started:!0}},mouseUp:function mouseUp(e){if("hello_world"===a.getMode()){var r=a.getZoom(),n=e.mouse_x/r,i=e.mouse_y/r,u=o.text;[["x",n],["y",i]].forEach((function(e){var r=_slicedToArray(e,2),t=r[0],n=r[1];u=u.replace("{"+t+"}",n)})),t.alert(u)}}});case 7:case"end":return i.stop()}}),_callee)})))()}})}}}));
|
||||
9
dist/editor/system/extensions/ext-helloworld/ext-helloworld.js
vendored
Normal file
9
dist/editor/system/extensions/ext-helloworld/ext-helloworld.js
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
System.register([],(function(e,r){"use strict";return{execute:function(){function asyncGeneratorStep(e,r,t,n,o,a,i){try{var u=e[a](i),l=u.value}catch(e){return void t(e)}u.done?r(l):Promise.resolve(l).then(n,o)}function _slicedToArray(e,r){return function _arrayWithHoles(e){if(Array.isArray(e))return e}(e)||function _iterableToArrayLimit(e,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var t=[],n=!0,o=!1,a=void 0;try{for(var i,u=e[Symbol.iterator]();!(n=(i=u.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw a}}return t}(e,r)||function _unsupportedIterableToArray(e,r){if(!e)return;if("string"==typeof e)return _arrayLikeToArray(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return _arrayLikeToArray(e,r)}(e,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}
|
||||
/**
|
||||
* @file ext-helloworld.js
|
||||
*
|
||||
* @license MIT
|
||||
*
|
||||
* @copyright 2010 Alexis Deveria
|
||||
*
|
||||
*/()}function _arrayLikeToArray(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}e("default",{name:"helloworld",init:function init(e){var t=this;return function _asyncToGenerator(e){return function(){var r=this,t=arguments;return new Promise((function(n,o){var a=e.apply(r,t);function _next(e){asyncGeneratorStep(a,n,o,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(a,n,o,_next,_throw,"throw",e)}_next(void 0)}))}}(regeneratorRuntime.mark((function _callee(){var n,o,a,i,u;return regeneratorRuntime.wrap((function _callee$(l){for(;;)switch(l.prev=l.next){case 0:return n=e.$,e.importLocale,o=t,l.next=4,r.import("./locale/".concat(o.curPrefs.lang,".js"));case 4:return a=l.sent,i=a.default,u=o.canvas,l.abrupt("return",{name:i.name,svgicons:"helloworld-icon.xml",buttons:[{id:"hello_world",icon:"helloworld.png",type:"mode",title:i.buttons[0].title,events:{click:function click(){u.setMode("hello_world")}}}],mouseDown:function mouseDown(){if("hello_world"===u.getMode())return{started:!0}},mouseUp:function mouseUp(e){if("hello_world"===u.getMode()){var r=u.getZoom(),t=e.mouse_x/r,o=e.mouse_y/r,a=i.text;[["x",t],["y",o]].forEach((function(e){var r=_slicedToArray(e,2),t=r[0],n=r[1];a=a.replace("{"+t+"}",n)})),n.alert(a)}}});case 8:case"end":return l.stop()}}),_callee)})))()}})}}}));
|
||||
10
dist/editor/system/extensions/ext-imagelib.js
vendored
10
dist/editor/system/extensions/ext-imagelib.js
vendored
File diff suppressed because one or more lines are too long
9
dist/editor/system/extensions/ext-imagelib/ext-imagelib.js
vendored
Normal file
9
dist/editor/system/extensions/ext-imagelib/ext-imagelib.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
System.register([],(function(t){"use strict";return{execute:function(){t("default",{name:"Arrows",langList:[{id:"arrow_none",textContent:"No arrow"}],contextTools:[{title:"Select arrow type",options:{none:"No arrow",end:"---->",start:"<----",both:"<--->",mid:"-->--",mid_bk:"--<--"}}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(t){"use strict";return{execute:function(){t("default",{name:"Arrows",langList:[{id:"arrow_none",textContent:"Sans flèche"}],contextTools:[{title:"Select arrow type",options:{none:"No arrow",end:"---->",start:"<----",both:"<--->",mid:"-->--",mid_bk:"--<--"}}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(t){"use strict";return{execute:function(){t("default",{name:"箭头",langList:[{id:"arrow_none",textContent:"无箭头"}],contextTools:[{title:"选择箭头类型",options:{none:"无箭头",end:"---->",start:"<----",both:"<--->",mid:"-->--",mid_bk:"--<--"}}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(t){"use strict";return{execute:function(){t("default",{name:"ClosePath",buttons:[{title:"Open path"},{title:"Close path"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(t){"use strict";return{execute:function(){t("default",{name:"闭合路径",buttons:[{title:"打开路径"},{title:"关闭路径"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(t){"use strict";return{execute:function(){t("default",{name:"Connector",langList:[{id:"mode_connect",title:"Connect two objects"}],buttons:[{title:"Connect two objects"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(t){"use strict";return{execute:function(){t("default",{name:"Connector",langList:[{id:"mode_connect",title:"Connecter deux objets"}],buttons:[{title:"Connect two objects"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(t){"use strict";return{execute:function(){t("default",{name:"连接器",langList:[{id:"mode_connect",title:"连接两个对象"}],buttons:[{title:"连接两个对象"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){e("default",{name:"eyedropper",buttons:[{title:"Eye Dropper Tool",key:"I"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(t){"use strict";return{execute:function(){t("default",{name:"滴管",buttons:[{title:"滴管工具",key:"I"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){e("default",{name:"foreignObject",buttons:[{title:"Foreign Object Tool"},{title:"Edit ForeignObject Content"}],contextTools:[{title:"Change foreignObject's width",label:"w"},{title:"Change foreignObject's height",label:"h"},{title:"Change foreignObject's font size",label:"font-size"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(t){"use strict";return{execute:function(){t("default",{name:"外部对象",buttons:[{title:"外部对象工具"},{title:"编辑外部对象内容"}],contextTools:[{title:"改变外部对象宽度",label:"w"},{title:"改变外部对象高度",label:"h"},{title:"改变外部对象文字大小",label:"文字大小"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){e("default",{name:"View Grid",buttons:[{title:"Show/Hide Grid"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(t){"use strict";return{execute:function(){t("default",{name:"网格视图",buttons:[{title:"显示/隐藏网格"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){e("default",{name:"Hello World",text:"Hello World!\n\nYou clicked here: {x}, {y}",buttons:[{title:"Say 'Hello World'"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){e("default",{name:"Hello World",text:"Hello World!\n\n 请点击: {x}, {y}",buttons:[{title:"输出 'Hello World'"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){e("default",{select_lib:"Select an image library",show_list:"Show library list",import_single:"Import single",import_multi:"Import multiple",open:"Open as new document",buttons:[{title:"Bilder-Bibliothek"}],imgLibs:[{name:"Demo library (local)",url:"{path}imagelib/index{modularVersion}.html",description:"Demonstration library for SVG-edit on this server"},{name:"IAN Symbol Libraries",url:"https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3",description:"Free library of illustrations"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){e("default",{select_lib:"Select an image library",show_list:"Show library list",import_single:"Import single",import_multi:"Import multiple",open:"Open as new document",buttons:[{title:"Image library"}],imgLibs:[{name:"Demo library (local)",url:"{path}imagelib/index{modularVersion}.html",description:"Demonstration library for SVG-edit on this server"},{name:"IAN Symbol Libraries",url:"https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3",description:"Free library of illustrations"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(i){"use strict";return{execute:function(){i("default",{select_lib:"Choisir une bibliothèque d'images",show_list:"show_list",import_single:"import_single",import_multi:"import_multi",open:"open",buttons:[{title:"Bibliothèque d'images"}],imgLibs:[{name:"Demo library (local)",url:"{path}imagelib/index{modularVersion}.html",description:"Demonstration library for SVG-edit on this server"},{name:"IAN Symbol Libraries",url:"https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3",description:"Free library of illustrations"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){e("default",{select_lib:"Select an image library",show_list:"Show library list",import_single:"Import single",import_multi:"Import multiple",open:"Open as new document",buttons:[{title:"Biblioteka obrazów"}],imgLibs:[{name:"Demo library (local)",url:"{path}imagelib/index{modularVersion}.html",description:"Demonstration library for SVG-edit on this server"},{name:"IAN Symbol Libraries",url:"https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3",description:"Free library of illustrations"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){e("default",{select_lib:"Select an image library",show_list:"Show library list",import_single:"Import single",import_multi:"Import multiple",open:"Open as new document",buttons:[{title:"Biblioteca de Imagens"}],imgLibs:[{name:"Demo library (local)",url:"{path}imagelib/index{modularVersion}.html",description:"Demonstration library for SVG-edit on this server"},{name:"IAN Symbol Libraries",url:"https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3",description:"Free library of illustrations"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){e("default",{select_lib:"Select an image library",show_list:"Show library list",import_single:"Import single",import_multi:"Import multiple",open:"Open as new document",buttons:[{title:"Bibliotecă de Imagini"}],imgLibs:[{name:"Demo library (local)",url:"{path}imagelib/index{modularVersion}.html",description:"Demonstration library for SVG-edit on this server"},{name:"IAN Symbol Libraries",url:"https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3",description:"Free library of illustrations"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){e("default",{select_lib:"Select an image library",show_list:"Show library list",import_single:"Import single",import_multi:"Import multiple",open:"Open as new document",buttons:[{title:"Knižnica obrázkov"}],imgLibs:[{name:"Demo library (local)",url:"{path}imagelib/index{modularVersion}.html",description:"Demonstration library for SVG-edit on this server"},{name:"IAN Symbol Libraries",url:"https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3",description:"Free library of illustrations"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(i){"use strict";return{execute:function(){i("default",{select_lib:"Select an image library",show_list:"Show library list",import_single:"Import single",import_multi:"Import multiple",open:"Open as new document",buttons:[{title:"Knjižnica slik"}],imgLibs:[{name:"Demo library (local)",url:"{path}imagelib/index{modularVersion}.html",description:"Demonstration library for SVG-edit on this server"},{name:"IAN Symbol Libraries",url:"https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3",description:"Free library of illustrations"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){e("default",{select_lib:"Select an image library",show_list:"Show library list",import_single:"Import single",import_multi:"Import multiple",open:"Open as new document",buttons:[{title:"图像库"}],imgLibs:[{name:"Demo library (local)",url:"{path}imagelib/index{modularVersion}.html",description:"Demonstration library for SVG-edit on this server"},{name:"IAN Symbol Libraries",url:"https://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php?svgedit=3",description:"Free library of illustrations"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){e("default",{name:"Markers",langList:[{id:"nomarker",title:"No Marker"},{id:"leftarrow",title:"Left Arrow"},{id:"rightarrow",title:"Right Arrow"},{id:"textmarker",title:"Text Marker"},{id:"forwardslash",title:"Forward Slash"},{id:"reverseslash",title:"Reverse Slash"},{id:"verticalslash",title:"Vertical Slash"},{id:"box",title:"Box"},{id:"star",title:"Star"},{id:"xmark",title:"X"},{id:"triangle",title:"Triangle"},{id:"mcircle",title:"Circle"},{id:"leftarrow_o",title:"Open Left Arrow"},{id:"rightarrow_o",title:"Open Right Arrow"},{id:"box_o",title:"Open Box"},{id:"star_o",title:"Open Star"},{id:"triangle_o",title:"Open Triangle"},{id:"mcircle_o",title:"Open Circle"}],contextTools:[{title:"Start marker",label:"s"},{title:"Select start marker type"},{title:"Middle marker",label:"m"},{title:"Select mid marker type"},{title:"End marker",label:"e"},{title:"Select end marker type"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(t){"use strict";return{execute:function(){t("default",{name:"标记",langList:[{id:"nomarker",title:"无标记"},{id:"leftarrow",title:"左箭头"},{id:"rightarrow",title:"右箭头"},{id:"textmarker",title:"文本"},{id:"forwardslash",title:"斜杠"},{id:"reverseslash",title:"反斜杠"},{id:"verticalslash",title:"垂直线"},{id:"box",title:"方块"},{id:"star",title:"星形"},{id:"xmark",title:"X"},{id:"triangle",title:"三角形"},{id:"mcircle",title:"圆形"},{id:"leftarrow_o",title:"左箭头(空心)"},{id:"rightarrow_o",title:"右箭头(空心)"},{id:"box_o",title:"方块(空心)"},{id:"star_o",title:"星形(空心)"},{id:"triangle_o",title:"三角形(空心)"},{id:"mcircle_o",title:"圆形(空心)"}],contextTools:[{title:"起始标记",label:"s"},{title:"选择起始标记类型"},{title:"中段标记",label:"m"},{title:"选择中段标记类型"},{title:"末端标记",label:"e"},{title:"选择末端标记类型"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(t){"use strict";return{execute:function(){t("default",{name:"MathJax",buttons:[{title:"Add Mathematics"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(t){"use strict";return{execute:function(){t("default",{name:"数学",buttons:[{title:"添加数学计算"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(n){"use strict";return{execute:function(){n("default",{name:"Extension Panning",buttons:[{title:"Panning"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(t){"use strict";return{execute:function(){t("default",{name:"移动",buttons:[{title:"移动"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(t){"use strict";return{execute:function(){t("default",{name:"placemark",langList:[{id:"nomarker",title:"No Marker"},{id:"leftarrow",title:"Left Arrow"},{id:"rightarrow",title:"Right Arrow"},{id:"forwardslash",title:"Forward Slash"},{id:"reverseslash",title:"Reverse Slash"},{id:"verticalslash",title:"Vertical Slash"},{id:"box",title:"Box"},{id:"star",title:"Star"},{id:"xmark",title:"X"},{id:"triangle",title:"Triangle"},{id:"mcircle",title:"Circle"},{id:"leftarrow_o",title:"Open Left Arrow"},{id:"rightarrow_o",title:"Open Right Arrow"},{id:"box_o",title:"Open Box"},{id:"star_o",title:"Open Star"},{id:"triangle_o",title:"Open Triangle"},{id:"mcircle_o",title:"Open Circle"}],buttons:[{title:"Placemark Tool"}],contextTools:[{title:"Select Place marker type"},{title:"Text on separated with ; ",label:"Text"},{title:"Font for text",label:""}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){e("default",{name:"polygon",buttons:[{title:"Polygon Tool"}],contextTools:[{title:"Number of Sides",label:"sides"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(t){"use strict";return{execute:function(){t("default",{name:"多边形",buttons:[{title:"多边形工具"}],contextTools:[{title:"边数",label:"边数"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){e("default",{saved:"Saved! Return to Item View!",hiddenframe:"Moinsave frame to store hidden values"})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){e("default",{saved:"已保存! 返回视图!",hiddenframe:"Moinsave frame to store hidden values"})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){e("default",{uploading:"Uploading...",hiddenframe:"Opensave frame to store hidden values"})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){e("default",{uploading:"正在上传...",hiddenframe:"Opensave frame to store hidden values"})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(a){"use strict";return{execute:function(){a("default",{loading:"Loading...",categories:{basic:"Basic",object:"Objects",symbol:"Symbols",arrow:"Arrows",flowchart:"Flowchart",animal:"Animals",game:"Cards & Chess",dialog_balloon:"Dialog balloons",electronics:"Electronics",math:"Mathematical",music:"Music",misc:"Miscellaneous",raphael_1:"raphaeljs.com set 1",raphael_2:"raphaeljs.com set 2"},buttons:[{title:"Shape library"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(a){"use strict";return{execute:function(){a("default",{loading:"Loading...",categories:{basic:"Basic",object:"Objects",symbol:"Symbols",arrow:"Arrows",flowchart:"Flowchart",animal:"Animals",game:"Cards & Chess",dialog_balloon:"Dialog balloons",electronics:"Electronics",math:"Mathematical",music:"Music",misc:"Miscellaneous",raphael_1:"raphaeljs.com set 1",raphael_2:"raphaeljs.com set 2"},buttons:[{title:"Bibliothèque d'images"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(a){"use strict";return{execute:function(){a("default",{loading:"正在加载...",categories:{basic:"基本",object:"对象",symbol:"符号",arrow:"箭头",flowchart:"工作流",animal:"动物",game:"棋牌",dialog_balloon:"会话框",electronics:"电子",math:"数学",music:"音乐",misc:"其他",raphael_1:"raphaeljs.com 集合 1",raphael_2:"raphaeljs.com 集合 2"},buttons:[{title:"图元库"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(t){"use strict";return{execute:function(){t("default",{name:"star",buttons:[{title:"Star Tool"}],contextTools:[{title:"Number of Sides",label:"points"},{title:"Pointiness",label:"Pointiness"},{title:"Twists the star",label:"Radial Shift"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(t){"use strict";return{execute:function(){t("default",{name:"星形",buttons:[{title:"星形工具"}],contextTools:[{title:"顶点",label:"顶点"},{title:"钝度",label:"钝度"},{title:"径向",label:"径向"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){e("default",{message:"Standardmäßig kann SVG-Edit Ihre Editor-Einstellungen und die SVG-Inhalte lokal auf Ihrem Gerät abspeichern. So brauchen Sie nicht jedes Mal die SVG neu laden. Falls Sie aus Datenschutzgründen dies nicht wollen, können Sie die Standardeinstellung im Folgenden ändern.",storagePrefsAndContent:"Store preferences and SVG content locally",storagePrefsOnly:"Only store preferences locally",storagePrefs:"Store preferences locally",storageNoPrefsOrContent:"Do not store my preferences or SVG content locally",storageNoPrefs:"Do not store my preferences locally",rememberLabel:"Remember this choice?",rememberTooltip:"If you choose to opt out of storage while remembering this choice, the URL will change so as to avoid asking again."})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){e("default",{message:"By default and where supported, SVG-Edit can store your editor preferences and SVG content locally on your machine so you do not need to add these back each time you load SVG-Edit. If, for privacy reasons, you do not wish to store this information on your machine, you can change away from the default option below.",storagePrefsAndContent:"Store preferences and SVG content locally",storagePrefsOnly:"Only store preferences locally",storagePrefs:"Store preferences locally",storageNoPrefsOrContent:"Do not store my preferences or SVG content locally",storageNoPrefs:"Do not store my preferences locally",rememberLabel:"Remember this choice?",rememberTooltip:"If you choose to opt out of storage while remembering this choice, the URL will change so as to avoid asking again."})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){e("default",{message:"Par défaut et si supporté, SVG-Edit peut stocker les préférences de l'éditeur et le contenu SVG localement sur votre machine de sorte que vous n'ayez pas besoin de les rajouter chaque fois que vous chargez SVG-Edit. Si, pour des raisons de confidentialité, vous ne souhaitez pas stocker ces données sur votre machine, vous pouvez changer ce comportement ci-dessous.",storagePrefsAndContent:"Store preferences and SVG content locally",storagePrefsOnly:"Only store preferences locally",storagePrefs:"Store preferences locally",storageNoPrefsOrContent:"Do not store my preferences or SVG content locally",storageNoPrefs:"Do not store my preferences locally",rememberLabel:"Remember this choice?",rememberTooltip:"Si vous choisissez de désactiver le stockage en mémorisant le choix, l'URL va changer afin que la question ne vous soit plus reposée."})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){e("default",{message:"默认情况下, SVG-Edit 在本地保存配置参数和画布内容. 如果基于隐私考虑, 您可以勾选以下选项修改配置.",storagePrefsAndContent:"本地存储配置参数和SVG图",storagePrefsOnly:"本地只存储配置参数",storagePrefs:"本地存储配置参数",storageNoPrefsOrContent:"本地不保存配置参数和SVG图",storageNoPrefs:"本地不保存配置参数",rememberLabel:"记住选择?",rememberTooltip:"如果您勾选记住选择,将不再弹出本窗口."})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){e("default",{name:"WebAppFind",buttons:[{title:"Save Image back to Disk"}]})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(t){"use strict";return{execute:function(){t("default",{name:"WebAppFind",buttons:[{title:"保存图片到磁盘"}]})}}}));
|
||||
32
dist/editor/system/extensions/ext-markers.js
vendored
32
dist/editor/system/extensions/ext-markers.js
vendored
File diff suppressed because one or more lines are too long
31
dist/editor/system/extensions/ext-markers/ext-markers.js
vendored
Normal file
31
dist/editor/system/extensions/ext-markers/ext-markers.js
vendored
Normal file
File diff suppressed because one or more lines are too long
10
dist/editor/system/extensions/ext-mathjax.js
vendored
10
dist/editor/system/extensions/ext-mathjax.js
vendored
@@ -1,10 +0,0 @@
|
||||
System.register([],(function(e,t){"use strict";return{execute:function(){function _AwaitValue(e){this.wrapped=e}function _AsyncGenerator(e){var t,a;function resume(t,a){try{var n=e[t](a),r=n.value,o=r instanceof _AwaitValue;Promise.resolve(o?r.wrapped:r).then((function(e){o?resume("return"===t?"return":"next",e):settle(n.done?"return":"normal",e)}),(function(e){resume("throw",e)}))}catch(e){settle("throw",e)}}function settle(e,n){switch(e){case"return":t.resolve({value:n,done:!0});break;case"throw":t.reject(n);break;default:t.resolve({value:n,done:!1})}(t=t.next)?resume(t.key,t.arg):a=null}this._invoke=function send(e,n){return new Promise((function(r,o){var i={key:e,arg:n,resolve:r,reject:o,next:null};a?a=a.next=i:(t=a=i,resume(e,n))}))},"function"!=typeof e.return&&(this.return=void 0)}function asyncGeneratorStep(e,t,a,n,r,o,i){try{var s=e[o](i),c=s.value}catch(e){return void a(e)}s.done?t(c):Promise.resolve(c).then(n,r)}function _asyncToGenerator(e){return function(){var t=this,a=arguments;return new Promise((function(n,r){var o=e.apply(t,a);function _next(e){asyncGeneratorStep(o,n,r,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(o,n,r,_next,_throw,"throw",e)}_next(void 0)}))}}"function"==typeof Symbol&&Symbol.asyncIterator&&(_AsyncGenerator.prototype[Symbol.asyncIterator]=function(){return this}),_AsyncGenerator.prototype.next=function(e){return this._invoke("next",e)},_AsyncGenerator.prototype.throw=function(e){return this._invoke("throw",e)},_AsyncGenerator.prototype.return=function(e){return this._invoke("return",e)};
|
||||
/**
|
||||
* @file ext-mathjax.js
|
||||
*
|
||||
* @license MIT
|
||||
*
|
||||
* @copyright 2013 Jo Segaert
|
||||
*
|
||||
*/
|
||||
e("default",{name:"mathjax",init:function init(e){var a=this;return _asyncToGenerator(regeneratorRuntime.mark((function _callee2(){var n,r,o,i,s,c,l,u,h,m,d,x;return regeneratorRuntime.wrap((function _callee2$(p){for(;;)switch(p.prev=p.next){case 0:return d=function _saveMath(){var e=n("#mathjax_code_textarea").val();MathJax.Hub.queue.Push(["Text",l,"\\displaystyle{"+e+"}"]),MathJax.Hub.queue.Push((function(){var e=n(".MathJax_SVG"),t=n(e.html());t.find("use").each((function(){var e=n(this).attr("href")?n(this).attr("href").slice(1):n(this).attr("xlink:href").slice(1),t=n("#"+e).clone().removeAttr("id"),a=n(this).attr("x"),r=n(this).attr("y"),o=n(this).attr("transform");o&&(a||r)?t.attr("transform",o+" translate("+a+","+r+")"):o?t.attr("transform",o):(a||r)&&t.attr("transform","translate("+a+","+r+")"),n(this).replaceWith(t)})),t.removeAttr("style"),t.attr("xmlns","http://www.w3.org/2000/svg"),s.importSvgString(n("<div>").append(t.clone()).html(),!0),s.ungroupSelectedElement(),s.moveSelectedElements(u,h,!0)}))},n=e.$,r=e.importLocale,p.next=4,r();case 4:return o=p.sent,s=(i=a).canvas,"mathjax/MathJax.min.js?config=TeX-AMS-MML_SVG.js",c=i.uiStrings,m=!1,n.extend(c,{mathjax:{embed_svg:"Save as mathematics",embed_mathml:"Save as figure",svg_save_warning:"The math will be transformed into a figure is manipulatable like everything else. You will not be able to manipulate the TeX-code anymore.",mathml_save_warning:"Advised. The math will be saved as a figure.",title:"Mathematics code editor"}}),x=[{id:"tool_mathjax",type:"mode",icon:"mathjax.png",events:{click:function click(){return _asyncToGenerator(regeneratorRuntime.mark((function _callee(){return regeneratorRuntime.wrap((function _callee$(e){for(;;)switch(e.prev=e.next){case 0:if(s.setMode("mathjax"),!1!==m){e.next=17;break}return n('<div id="mathjax">\x3c!-- Here is where MathJax creates the math --\x3e<div id="mathjax_creator" class="tex2jax_process" style="display:none">$${}$$</div><div id="mathjax_overlay"></div><div id="mathjax_container"><div id="tool_mathjax_back" class="toolbar_button"><button id="tool_mathjax_save">OK</button><button id="tool_mathjax_cancel">Cancel</button></div><fieldset><legend id="mathjax_legend">Mathematics Editor</legend><label><span id="mathjax_explication">Please type your mathematics in <a href="https://en.wikipedia.org/wiki/Help:Displaying_a_formula" target="_blank">TeX</a> code.</span></label><textarea id="mathjax_code_textarea" spellcheck="false"></textarea></fieldset></div></div>').insertAfter("#svg_prefs").hide(),n("#mathjax_container").draggable({cancel:"button,fieldset",containment:"window"}),n("#tool_mathjax_cancel").prepend(n.getSvgIcon("cancel",!0)).on("click touched",(function(){n("#mathjax").hide()})),n("#tool_mathjax_save").prepend(n.getSvgIcon("ok",!0)).on("click touched",(function(){d(),n("#mathjax").hide()})),n("body").addClass("tex2jax_ignore"),e.prev=7,e.next=10,t.import("mathjax/MathJax.min.js?config=TeX-AMS-MML_SVG.js");case 10:MathJax.Hub.queue.Push((function(){l=MathJax.Hub.getAllJax("#mathjax_creator")[0],console.log(l),m=!0,console.log("MathJax Loaded")})),e.next=17;break;case 13:e.prev=13,e.t0=e.catch(7),console.log("Failed loading MathJax."),n.alert("Failed loading MathJax. You will not be able to change the mathematics.");case 17:case"end":return e.stop()}}),_callee,null,[[7,13]])})))()}}}],p.abrupt("return",{name:o.name,svgicons:"mathjax-icons.xml",buttons:o.buttons.map((function(e,t){return Object.assign(x[t],e)})),mouseDown:function mouseDown(){if("mathjax"===s.getMode())return{started:!0}},mouseUp:function mouseUp(e){if("mathjax"===s.getMode()){var t=s.getZoom();return u=e.mouse_x/t,h=e.mouse_y/t,n("#mathjax").show(),{started:!1}}},callback:function callback(){n("<style>").text("#mathjax fieldset{padding: 5px;margin: 5px;border: 1px solid #DDD;}#mathjax label{display: block;margin: .5em;}#mathjax legend {max-width:195px;}#mathjax_overlay {position: absolute;top: 0;left: 0;right: 0;bottom: 0;background-color: black;opacity: 0.6;z-index: 20000;}#mathjax_container {position: absolute;top: 50px;padding: 10px;background-color: #B0B0B0;border: 1px outset #777;opacity: 1.0;font-family: Verdana, Helvetica, sans-serif;font-size: .8em;z-index: 20001;}#tool_mathjax_back {margin-left: 1em;overflow: auto;}#mathjax_legend{font-weight: bold;font-size:1.1em;}#mathjax_code_textarea {\\nmargin: 5px .7em;overflow: hidden;width: 416px;display: block;height: 100px;}").appendTo("head")}});case 12:case"end":return p.stop()}}),_callee2)})))()}})}}}));
|
||||
9
dist/editor/system/extensions/ext-mathjax/ext-mathjax.js
vendored
Normal file
9
dist/editor/system/extensions/ext-mathjax/ext-mathjax.js
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
System.register([],(function(e,t){"use strict";return{execute:function(){function asyncGeneratorStep(e,t,a,n,o,r,i){try{var l=e[r](i),s=l.value}catch(e){return void a(e)}l.done?t(s):Promise.resolve(s).then(n,o)}function _asyncToGenerator(e){return function(){var t=this,a=arguments;return new Promise((function(n,o){var r=e.apply(t,a);function _next(e){asyncGeneratorStep(r,n,o,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(r,n,o,_next,_throw,"throw",e)}_next(void 0)}))}}
|
||||
/**
|
||||
* @file ext-mathjax.js
|
||||
*
|
||||
* @license MIT
|
||||
*
|
||||
* @copyright 2013 Jo Segaert
|
||||
*
|
||||
*/e("default",{name:"mathjax",init:function init(e){var a=this;return _asyncToGenerator(regeneratorRuntime.mark((function _callee2(){var n,o,r,i,l,s,c,h,m,d,u,x;return regeneratorRuntime.wrap((function _callee2$(p){for(;;)switch(p.prev=p.next){case 0:return u=function _saveMath(){var e=n("#mathjax_code_textarea").val();MathJax.Hub.queue.Push(["Text",c,"\\displaystyle{"+e+"}"]),MathJax.Hub.queue.Push((function(){var e=n(".MathJax_SVG"),t=n(e.html());t.find("use").each((function(){var e=n(this).attr("href")?n(this).attr("href").slice(1):n(this).attr("xlink:href").slice(1),t=n("#"+e).clone().removeAttr("id"),a=n(this).attr("x"),o=n(this).attr("y"),r=n(this).attr("transform");r&&(a||o)?t.attr("transform",r+" translate("+a+","+o+")"):r?t.attr("transform",r):(a||o)&&t.attr("transform","translate("+a+","+o+")"),n(this).replaceWith(t)})),t.removeAttr("style"),t.attr("xmlns","http://www.w3.org/2000/svg"),l.importSvgString(n("<div>").append(t.clone()).html(),!0),l.ungroupSelectedElement(),l.moveSelectedElements(h,m,!0)}))},n=e.$,o=a,p.next=5,t.import("./locale/".concat(o.curPrefs.lang,".js"));case 5:return r=p.sent,i=r.default,l=o.canvas,"mathjax/MathJax.min.js?config=TeX-AMS-MML_SVG.js",s=o.uiStrings,d=!1,n.extend(s,{mathjax:{embed_svg:"Save as mathematics",embed_mathml:"Save as figure",svg_save_warning:"The math will be transformed into a figure is manipulatable like everything else. You will not be able to manipulate the TeX-code anymore.",mathml_save_warning:"Advised. The math will be saved as a figure.",title:"Mathematics code editor"}}),x=[{id:"tool_mathjax",type:"mode",icon:"mathjax.png",events:{click:function click(){return _asyncToGenerator(regeneratorRuntime.mark((function _callee(){return regeneratorRuntime.wrap((function _callee$(e){for(;;)switch(e.prev=e.next){case 0:if(l.setMode("mathjax"),!1!==d){e.next=17;break}return n('<div id="mathjax">\x3c!-- Here is where MathJax creates the math --\x3e<div id="mathjax_creator" class="tex2jax_process" style="display:none">$${}$$</div><div id="mathjax_overlay"></div><div id="mathjax_container"><div id="tool_mathjax_back" class="toolbar_button"><button id="tool_mathjax_save">OK</button><button id="tool_mathjax_cancel">Cancel</button></div><fieldset><legend id="mathjax_legend">Mathematics Editor</legend><label><span id="mathjax_explication">Please type your mathematics in <a href="https://en.wikipedia.org/wiki/Help:Displaying_a_formula" target="_blank">TeX</a> code.</span></label><textarea id="mathjax_code_textarea" spellcheck="false"></textarea></fieldset></div></div>').insertAfter("#svg_prefs").hide(),n("#mathjax_container").draggable({cancel:"button,fieldset",containment:"window"}),n("#tool_mathjax_cancel").prepend(n.getSvgIcon("cancel",!0)).on("click touched",(function(){n("#mathjax").hide()})),n("#tool_mathjax_save").prepend(n.getSvgIcon("ok",!0)).on("click touched",(function(){u(),n("#mathjax").hide()})),n("body").addClass("tex2jax_ignore"),e.prev=7,e.next=10,t.import("mathjax/MathJax.min.js?config=TeX-AMS-MML_SVG.js");case 10:MathJax.Hub.queue.Push((function(){c=MathJax.Hub.getAllJax("#mathjax_creator")[0],console.log(c),d=!0,console.log("MathJax Loaded")})),e.next=17;break;case 13:e.prev=13,e.t0=e.catch(7),console.log("Failed loading MathJax."),n.alert("Failed loading MathJax. You will not be able to change the mathematics.");case 17:case"end":return e.stop()}}),_callee,null,[[7,13]])})))()}}}],p.abrupt("return",{name:i.name,svgicons:"mathjax-icons.xml",buttons:i.buttons.map((function(e,t){return Object.assign(x[t],e)})),mouseDown:function mouseDown(){if("mathjax"===l.getMode())return{started:!0}},mouseUp:function mouseUp(e){if("mathjax"===l.getMode()){var t=l.getZoom();return h=e.mouse_x/t,m=e.mouse_y/t,n("#mathjax").show(),{started:!1}}},callback:function callback(){n("<style>").text("#mathjax fieldset{padding: 5px;margin: 5px;border: 1px solid #DDD;}#mathjax label{display: block;margin: .5em;}#mathjax legend {max-width:195px;}#mathjax_overlay {position: absolute;top: 0;left: 0;right: 0;bottom: 0;background-color: black;opacity: 0.6;z-index: 20000;}#mathjax_container {position: absolute;top: 50px;padding: 10px;background-color: #B0B0B0;border: 1px outset #777;opacity: 1.0;font-family: Verdana, Helvetica, sans-serif;font-size: .8em;z-index: 20001;}#tool_mathjax_back {margin-left: 1em;overflow: auto;}#mathjax_legend{font-weight: bold;font-size:1.1em;}#mathjax_code_textarea {\\nmargin: 5px .7em;overflow: hidden;width: 416px;display: block;height: 100px;}").appendTo("head")}});case 13:case"end":return p.stop()}}),_callee2)})))()}})}}}));
|
||||
10
dist/editor/system/extensions/ext-panning.js
vendored
10
dist/editor/system/extensions/ext-panning.js
vendored
@@ -1,10 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){function _AwaitValue(e){this.wrapped=e}function _AsyncGenerator(e){var n,t;function resume(n,t){try{var r=e[n](t),o=r.value,u=o instanceof _AwaitValue;Promise.resolve(u?o.wrapped:o).then((function(e){u?resume("return"===n?"return":"next",e):settle(r.done?"return":"normal",e)}),(function(e){resume("throw",e)}))}catch(e){settle("throw",e)}}function settle(e,r){switch(e){case"return":n.resolve({value:r,done:!0});break;case"throw":n.reject(r);break;default:n.resolve({value:r,done:!1})}(n=n.next)?resume(n.key,n.arg):t=null}this._invoke=function send(e,r){return new Promise((function(o,u){var i={key:e,arg:r,resolve:o,reject:u,next:null};t?t=t.next=i:(n=t=i,resume(e,r))}))},"function"!=typeof e.return&&(this.return=void 0)}function asyncGeneratorStep(e,n,t,r,o,u,i){try{var a=e[u](i),c=a.value}catch(e){return void t(e)}a.done?n(c):Promise.resolve(c).then(r,o)}"function"==typeof Symbol&&Symbol.asyncIterator&&(_AsyncGenerator.prototype[Symbol.asyncIterator]=function(){return this}),_AsyncGenerator.prototype.next=function(e){return this._invoke("next",e)},_AsyncGenerator.prototype.throw=function(e){return this._invoke("throw",e)},_AsyncGenerator.prototype.return=function(e){return this._invoke("return",e)};
|
||||
/**
|
||||
* @file ext-panning.js
|
||||
*
|
||||
* @license MIT
|
||||
*
|
||||
* @copyright 2013 Luis Aguirre
|
||||
*
|
||||
*/
|
||||
e("default",{name:"panning",init:function init(e){var n=this;return function _asyncToGenerator(e){return function(){var n=this,t=arguments;return new Promise((function(r,o){var u=e.apply(n,t);function _next(e){asyncGeneratorStep(u,r,o,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(u,r,o,_next,_throw,"throw",e)}_next(void 0)}))}}(regeneratorRuntime.mark((function _callee(){var t,r,o,u,i;return regeneratorRuntime.wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:return t=e.importLocale,a.next=3,t();case 3:return r=a.sent,u=(o=n).canvas,i=[{id:"ext-panning",icon:"panning.png",type:"mode",events:{click:function click(){u.setMode("ext-panning")}}}],a.abrupt("return",{name:r.name,svgicons:"ext-panning.xml",buttons:r.buttons.map((function(e,n){return Object.assign(i[n],e)})),mouseDown:function mouseDown(){if("ext-panning"===u.getMode())return o.setPanning(!0),{started:!0}},mouseUp:function mouseUp(){if("ext-panning"===u.getMode())return o.setPanning(!1),{keep:!1,element:null}}});case 8:case"end":return a.stop()}}),_callee)})))()}})}}}));
|
||||
10
dist/editor/system/extensions/ext-panning/ext-panning.js
vendored
Normal file
10
dist/editor/system/extensions/ext-panning/ext-panning.js
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
System.register([],(function(n,e){"use strict";return{execute:function(){function asyncGeneratorStep(n,e,t,r,o,a,i){try{var c=n[a](i),u=c.value}catch(n){return void t(n)}c.done?e(u):Promise.resolve(u).then(r,o)}
|
||||
/**
|
||||
* @file ext-panning.js
|
||||
*
|
||||
* @license MIT
|
||||
*
|
||||
* @copyright 2013 Luis Aguirre
|
||||
*
|
||||
*/
|
||||
n("default",{name:"panning",init:function init(n){var t=this;return function _asyncToGenerator(n){return function(){var e=this,t=arguments;return new Promise((function(r,o){var a=n.apply(e,t);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n)}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n)}_next(void 0)}))}}(regeneratorRuntime.mark((function _callee(){var r,o,a,i,c;return regeneratorRuntime.wrap((function _callee$(u){for(;;)switch(u.prev=u.next){case 0:return n.importLocale,r=t,u.next=4,e.import("./locale/".concat(r.curPrefs.lang,".js"));case 4:return o=u.sent,a=o.default,i=r.canvas,c=[{id:"ext-panning",icon:"panning.png",type:"mode",events:{click:function click(){i.setMode("ext-panning")}}}],u.abrupt("return",{name:a.name,svgicons:"ext-panning.xml",buttons:a.buttons.map((function(n,e){return Object.assign(c[e],n)})),mouseDown:function mouseDown(){if("ext-panning"===i.getMode())return r.setPanning(!0),{started:!0}},mouseUp:function mouseUp(){if("ext-panning"===i.getMode())return r.setPanning(!1),{keep:!1,element:null}}});case 9:case"end":return u.stop()}}),_callee)})))()}})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){e("default",{name:"php_savefile",init:function init(e){var t=e.$,n=this,i=n.curConfig.extPath,s=n.canvas;var a=i+"savefile.php";n.setCustomHandlers({save:function save(e,n){var i='<?xml version="1.0" encoding="UTF-8"?>\n'+n,r=function getFileNameFromTitle(){return s.getDocumentTitle().trim()}();t.post(a,{output_svg:i,filename:r})}})}})}}}));
|
||||
File diff suppressed because one or more lines are too long
1
dist/editor/system/extensions/ext-placemark/ext-placemark.js
vendored
Normal file
1
dist/editor/system/extensions/ext-placemark/ext-placemark.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/editor/system/extensions/ext-polygon.js
vendored
1
dist/editor/system/extensions/ext-polygon.js
vendored
@@ -1 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){function _AwaitValue(e){this.wrapped=e}function _AsyncGenerator(e){var t,n;function resume(t,n){try{var o=e[t](n),r=o.value,s=r instanceof _AwaitValue;Promise.resolve(s?r.wrapped:r).then((function(e){s?resume("return"===t?"return":"next",e):settle(o.done?"return":"normal",e)}),(function(e){resume("throw",e)}))}catch(e){settle("throw",e)}}function settle(e,o){switch(e){case"return":t.resolve({value:o,done:!0});break;case"throw":t.reject(o);break;default:t.resolve({value:o,done:!1})}(t=t.next)?resume(t.key,t.arg):n=null}this._invoke=function send(e,o){return new Promise((function(r,s){var i={key:e,arg:o,resolve:r,reject:s,next:null};n?n=n.next=i:(t=n=i,resume(e,o))}))},"function"!=typeof e.return&&(this.return=void 0)}function asyncGeneratorStep(e,t,n,o,r,s,i){try{var a=e[s](i),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(o,r)}"function"==typeof Symbol&&Symbol.asyncIterator&&(_AsyncGenerator.prototype[Symbol.asyncIterator]=function(){return this}),_AsyncGenerator.prototype.next=function(e){return this._invoke("next",e)},_AsyncGenerator.prototype.throw=function(e){return this._invoke("throw",e)},_AsyncGenerator.prototype.return=function(e){return this._invoke("return",e)};e("default",{name:"polygon",init:function init(e){var t=this;return function _asyncToGenerator(e){return function(){var t=this,n=arguments;return new Promise((function(o,r){var s=e.apply(t,n);function _next(e){asyncGeneratorStep(s,o,r,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(s,o,r,_next,_throw,"throw",e)}_next(void 0)}))}}(regeneratorRuntime.mark((function _callee(){var n,o,r,s,i,a,c,u,l,d,p,f,h;return regeneratorRuntime.wrap((function _callee$(y){for(;;)switch(y.prev=y.next){case 0:return p=function _sec(e){return 1/Math.cos(e)},d=function _cot(e){return 1/Math.tan(e)},l=function _setAttr(e,t){n.changeSelectedAttribute(e,t),n.call("changed",i)},u=function _showPanel(e){var t=o("#fc_rules");t.length||(t=o('<style id="fc_rules"></style>').appendTo("head")),t.text(e?" #tool_topath { display: none !important; }":""),o("#polygon_panel").toggle(e)},n=t.canvas,o=e.$,r=e.importLocale,!1,y.next=9,r();case 9:return s=y.sent,f=[{id:"tool_polygon",icon:"polygon.png",type:"mode",position:11,events:{click:function click(){n.setMode("polygon"),u(!0)}}}],h=[{type:"input",panel:"polygon_panel",id:"polySides",size:3,defval:5,events:{change:function change(){l("sides",this.value)}}}],y.abrupt("return",{name:s.name,svgicons:"polygon-icons.svg",buttons:s.buttons.map((function(e,t){return Object.assign(f[t],e)})),context_tools:s.contextTools.map((function(e,t){return Object.assign(h[t],e)})),callback:function callback(){o("#polygon_panel").hide();setTimeout((function(){o("#tool_source_save").clone().hide().attr("id","polygon_save").unbind().appendTo("#tool_source_back").click((function(){})),o("#tool_source_cancel").clone().hide().attr("id","polygon_cancel").unbind().appendTo("#tool_source_back").click((function(){}))}),3e3)},mouseDown:function mouseDown(e){if("polygon"===n.getMode()){var t=n.getColor("fill"),o=n.getColor("stroke"),r=n.getStrokeWidth();return a=!0,c=n.addSVGElementFromJson({element:"polygon",attr:{cx:e.start_x,cy:e.start_y,id:n.getNextId(),shape:"regularPoly",sides:document.getElementById("polySides").value,orient:"x",edge:0,fill:t,strokecolor:o,strokeWidth:r}}),{started:!0}}},mouseMove:function mouseMove(e){if(a&&"polygon"===n.getMode()){var t=o(c).attr(["cx","cy","sides","orient","fill","strokecolor","strokeWidth"]),r=e.mouse_x,s=e.mouse_y,i=t.cx,u=t.cy,l=t.fill,f=t.strokecolor,h=t.strokeWidth,y=t.sides,g=Math.sqrt((r-i)*(r-i)+(s-u)*(s-u))/1.5;c.setAttribute("edge",g);for(var _=g/2*d(Math.PI/y)*p(Math.PI/y),m="",v=0;y>=v;v++){var k=2*Math.PI*v/y;m+=(r=_*Math.cos(k)+i)+","+(s=_*Math.sin(k)+u)+" "}return c.setAttribute("points",m),c.setAttribute("fill",l),c.setAttribute("stroke",f),c.setAttribute("stroke-width",h),{started:!0}}},mouseUp:function mouseUp(e){if("polygon"===n.getMode())return{keep:"0"!==o(c).attr("edge").edge,element:c}},selectedChanged:function selectedChanged(e){for(var t=(i=e.elems).length;t--;){var n=i[t];n&&"regularPoly"===n.getAttribute("shape")&&e.selectedElement&&!e.multiselected?(o("#polySides").val(n.getAttribute("sides")),u(!0)):u(!1)}},elementChanged:function elementChanged(e){}});case 13:case"end":return y.stop()}}),_callee)})))()}})}}}));
|
||||
1
dist/editor/system/extensions/ext-polygon/ext-polygon.js
vendored
Normal file
1
dist/editor/system/extensions/ext-polygon/ext-polygon.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
System.register([],(function(e,t){"use strict";return{execute:function(){function asyncGeneratorStep(e,t,n,o,r,s,a){try{var c=e[s](a),i=c.value}catch(e){return void n(e)}c.done?t(i):Promise.resolve(i).then(o,r)}e("default",{name:"polygon",init:function init(e){var n=this;return function _asyncToGenerator(e){return function(){var t=this,n=arguments;return new Promise((function(o,r){var s=e.apply(t,n);function _next(e){asyncGeneratorStep(s,o,r,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(s,o,r,_next,_throw,"throw",e)}_next(void 0)}))}}(regeneratorRuntime.mark((function _callee(){var o,r,s,a,c,i,l,u,d,p,g,f,h,y;return regeneratorRuntime.wrap((function _callee$(_){for(;;)switch(_.prev=_.next){case 0:return f=function _sec(e){return 1/Math.cos(e)},g=function _cot(e){return 1/Math.tan(e)},p=function _setAttr(e,t){r.changeSelectedAttribute(e,t),r.call("changed",i)},d=function _showPanel(e){var t=s("#fc_rules");t.length||(t=s('<style id="fc_rules"></style>').appendTo("head")),t.text(e?" #tool_topath { display: none !important; }":""),s("#polygon_panel").toggle(e)},r=(o=n).canvas,s=e.$,!1,_.next=9,t.import("./locale/".concat(o.curPrefs.lang,".js"));case 9:return a=_.sent,c=a.default,h=[{id:"tool_polygon",icon:"polygon.png",type:"mode",position:11,events:{click:function click(){r.setMode("polygon"),d(!0)}}}],y=[{type:"input",panel:"polygon_panel",id:"polySides",size:3,defval:5,events:{change:function change(){p("sides",this.value)}}}],_.abrupt("return",{name:c.name,svgicons:"polygon-icons.svg",buttons:c.buttons.map((function(e,t){return Object.assign(h[t],e)})),context_tools:c.contextTools.map((function(e,t){return Object.assign(y[t],e)})),callback:function callback(){s("#polygon_panel").hide(),setTimeout((function(){s("#tool_source_save").clone().hide().attr("id","polygon_save").unbind().appendTo("#tool_source_back").click((function(){})),s("#tool_source_cancel").clone().hide().attr("id","polygon_cancel").unbind().appendTo("#tool_source_back").click((function(){}))}),3e3)},mouseDown:function mouseDown(e){if("polygon"===r.getMode()){var t=r.getColor("fill"),n=r.getColor("stroke"),o=r.getStrokeWidth();return l=!0,u=r.addSVGElementFromJson({element:"polygon",attr:{cx:e.start_x,cy:e.start_y,id:r.getNextId(),shape:"regularPoly",sides:document.getElementById("polySides").value,orient:"x",edge:0,fill:t,strokecolor:n,strokeWidth:o}}),{started:!0}}},mouseMove:function mouseMove(e){if(l&&"polygon"===r.getMode()){var t=s(u).attr(["cx","cy","sides","orient","fill","strokecolor","strokeWidth"]),n=e.mouse_x,o=e.mouse_y,a=t.cx,c=t.cy,i=t.fill,d=t.strokecolor,p=t.strokeWidth,h=t.sides,y=Math.sqrt((n-a)*(n-a)+(o-c)*(o-c))/1.5;u.setAttribute("edge",y);for(var _=y/2*g(Math.PI/h)*f(Math.PI/h),m="",v=0;h>=v;v++){var k=2*Math.PI*v/h;m+=(n=_*Math.cos(k)+a)+","+(o=_*Math.sin(k)+c)+" "}return u.setAttribute("points",m),u.setAttribute("fill",i),u.setAttribute("stroke",d),u.setAttribute("stroke-width",p),{started:!0}}},mouseUp:function mouseUp(e){if("polygon"===r.getMode())return{keep:"0"!==s(u).attr("edge").edge,element:u}},selectedChanged:function selectedChanged(e){for(var t=(i=e.elems).length;t--;){var n=i[t];n&&"regularPoly"===n.getAttribute("shape")&&e.selectedElement&&!e.multiselected?(s("#polySides").val(n.getAttribute("sides")),d(!0)):d(!1)}},elementChanged:function elementChanged(e){}});case 14:case"end":return _.stop()}}),_callee)})))()}})}}}));
|
||||
File diff suppressed because one or more lines are too long
8
dist/editor/system/extensions/ext-server_moinsave/ext-server_moinsave.js
vendored
Normal file
8
dist/editor/system/extensions/ext-server_moinsave/ext-server_moinsave.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
8
dist/editor/system/extensions/ext-server_opensave/ext-server_opensave.js
vendored
Normal file
8
dist/editor/system/extensions/ext-server_opensave/ext-server_opensave.js
vendored
Normal file
File diff suppressed because one or more lines are too long
10
dist/editor/system/extensions/ext-shapes.js
vendored
10
dist/editor/system/extensions/ext-shapes.js
vendored
File diff suppressed because one or more lines are too long
9
dist/editor/system/extensions/ext-shapes/ext-shapes.js
vendored
Normal file
9
dist/editor/system/extensions/ext-shapes/ext-shapes.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/editor/system/extensions/ext-star.js
vendored
1
dist/editor/system/extensions/ext-star.js
vendored
@@ -1 +0,0 @@
|
||||
System.register([],(function(t){"use strict";return{execute:function(){function _AwaitValue(t){this.wrapped=t}function _AsyncGenerator(t){var e,n;function resume(e,n){try{var r=t[e](n),o=r.value,a=o instanceof _AwaitValue;Promise.resolve(a?o.wrapped:o).then((function(t){a?resume("return"===e?"return":"next",t):settle(r.done?"return":"normal",t)}),(function(t){resume("throw",t)}))}catch(t){settle("throw",t)}}function settle(t,r){switch(t){case"return":e.resolve({value:r,done:!0});break;case"throw":e.reject(r);break;default:e.resolve({value:r,done:!1})}(e=e.next)?resume(e.key,e.arg):n=null}this._invoke=function send(t,r){return new Promise((function(o,a){var i={key:t,arg:r,resolve:o,reject:a,next:null};n?n=n.next=i:(e=n=i,resume(t,r))}))},"function"!=typeof t.return&&(this.return=void 0)}function asyncGeneratorStep(t,e,n,r,o,a,i){try{var s=t[a](i),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,o)}"function"==typeof Symbol&&Symbol.asyncIterator&&(_AsyncGenerator.prototype[Symbol.asyncIterator]=function(){return this}),_AsyncGenerator.prototype.next=function(t){return this._invoke("next",t)},_AsyncGenerator.prototype.throw=function(t){return this._invoke("throw",t)},_AsyncGenerator.prototype.return=function(t){return this._invoke("return",t)};t("default",{name:"star",init:function init(t){var e=this;return function _asyncToGenerator(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var a=t.apply(e,n);function _next(t){asyncGeneratorStep(a,r,o,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(a,r,o,_next,_throw,"throw",t)}_next(void 0)}))}}(regeneratorRuntime.mark((function _callee(){var n,r,o,a,i,s,u,l,c,h,d;return regeneratorRuntime.wrap((function _callee$(f){for(;;)switch(f.prev=f.next){case 0:return c=function _setAttr(t,e){n.changeSelectedAttribute(t,e),n.call("changed",a)},l=function _showPanel(t){var e=r("#fc_rules");e.length||(e=r('<style id="fc_rules"></style>').appendTo("head")),e.text(t?" #tool_topath { display: none !important; }":""),r("#star_panel").toggle(t)},n=e.canvas,r=t.$,o=t.importLocale,f.next=7,o();case 7:return u=f.sent,h=[{id:"tool_star",icon:"star.png",type:"mode",position:12,events:{click:function click(){l(!0),n.setMode("star")}}}],d=[{type:"input",panel:"star_panel",id:"starNumPoints",size:3,defval:5,events:{change:function change(){c("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(){c("radialshift",this.value)}}}],f.abrupt("return",{name:u.name,svgicons:"star-icons.svg",buttons:u.buttons.map((function(t,e){return Object.assign(h[e],t)})),context_tools:u.contextTools.map((function(t,e){return Object.assign(d[e],t)})),callback:function callback(){r("#star_panel").hide()},mouseDown:function mouseDown(t){var e=n.getColor("fill"),r=n.getColor("stroke"),o=n.getStrokeWidth();if("star"===n.getMode())return i=!0,s=n.addSVGElementFromJson({element:"polygon",attr:{cx:t.start_x,cy:t.start_y,id:n.getNextId(),shape:"star",point:document.getElementById("starNumPoints").value,r:0,radialshift:document.getElementById("radialShift").value,r2:0,orient:"point",fill:e,strokecolor:r,strokeWidth:o}}),{started:!0}},mouseMove:function mouseMove(t){if(i&&"star"===n.getMode()){var e=r(s).attr(["cx","cy","point","orient","fill","strokecolor","strokeWidth","radialshift"]),o=t.mouse_x,a=t.mouse_y,u=e.cx,l=e.cy,c=e.fill,h=e.strokecolor,d=e.strokeWidth,f=e.radialshift,p=e.point,m=e.orient,v=Math.sqrt((o-u)*(o-u)+(a-l)*(a-l))/1.5,y=v/document.getElementById("starRadiusMulitplier").value;s.setAttribute("r",v),s.setAttribute("r2",y);for(var g="",_=0;p>=_;_++){var k=2*Math.PI*(_/p);"point"===m?k-=Math.PI/2:"edge"===m&&(k=k+Math.PI/p-Math.PI/2),g+=(o=v*Math.cos(k)+u)+","+(a=v*Math.sin(k)+l)+" ",isNaN(y)||(k=2*Math.PI*(_/p)+Math.PI/p,"point"===m?k-=Math.PI/2:"edge"===m&&(k=k+Math.PI/p-Math.PI/2),k+=f,g+=(o=y*Math.cos(k)+u)+","+(a=y*Math.sin(k)+l)+" ")}return s.setAttribute("points",g),s.setAttribute("fill",c),s.setAttribute("stroke",h),s.setAttribute("stroke-width",d),s.getAttribute("shape"),{started:!0}}},mouseUp:function mouseUp(){if("star"===n.getMode())return{keep:"0"!==r(s).attr(["r"]).r,element:s}},selectedChanged:function selectedChanged(t){for(var e=(a=t.elems).length;e--;){var n=a[e];n&&"star"===n.getAttribute("shape")&&t.selectedElement&&!t.multiselected?(r("#starNumPoints").val(n.getAttribute("point")),r("#radialShift").val(n.getAttribute("radialshift")),l(!0)):l(!1)}},elementChanged:function elementChanged(t){}});case 11:case"end":return f.stop()}}),_callee)})))()}})}}}));
|
||||
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)})))()}})}}}));
|
||||
22
dist/editor/system/extensions/ext-storage.js
vendored
22
dist/editor/system/extensions/ext-storage.js
vendored
@@ -1,22 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){function _AwaitValue(e){this.wrapped=e}function _AsyncGenerator(e){var t,r;function resume(t,r){try{var n=e[t](r),o=n.value,a=o instanceof _AwaitValue;Promise.resolve(a?o.wrapped:o).then((function(e){a?resume("return"===t?"return":"next",e):settle(n.done?"return":"normal",e)}),(function(e){resume("throw",e)}))}catch(e){settle("throw",e)}}function settle(e,n){switch(e){case"return":t.resolve({value:n,done:!0});break;case"throw":t.reject(n);break;default:t.resolve({value:n,done:!1})}(t=t.next)?resume(t.key,t.arg):r=null}this._invoke=function send(e,n){return new Promise((function(o,a){var i={key:e,arg:n,resolve:o,reject:a,next:null};r?r=r.next=i:(t=r=i,resume(e,n))}))},"function"!=typeof e.return&&(this.return=void 0)}function asyncGeneratorStep(e,t,r,n,o,a,i){try{var s=e[a](i),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function _slicedToArray(e,t){return _arrayWithHoles(e)||function _iterableToArrayLimit(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw a}}return r}(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}"function"==typeof Symbol&&Symbol.asyncIterator&&(_AsyncGenerator.prototype[Symbol.asyncIterator]=function(){return this}),_AsyncGenerator.prototype.next=function(e){return this._invoke("next",e)},_AsyncGenerator.prototype.throw=function(e){return this._invoke("throw",e)},_AsyncGenerator.prototype.return=function(e){return this._invoke("return",e)};
|
||||
/**
|
||||
* @file ext-storage.js
|
||||
*
|
||||
* This extension allows automatic saving of the SVG canvas contents upon
|
||||
* page unload (which can later be automatically retrieved upon future
|
||||
* editor loads).
|
||||
*
|
||||
* The functionality was originally part of the SVG Editor, but moved to a
|
||||
* separate extension to make the setting behavior optional, and adapted
|
||||
* to inform the user of its setting of local data.
|
||||
*
|
||||
* @license MIT
|
||||
*
|
||||
* @copyright 2010 Brett Zamir
|
||||
* @todo Revisit on whether to use `svgEditor.pref` over directly setting
|
||||
* `curConfig` in all extensions for a more public API (not only for `extPath`
|
||||
* and `imagePath`, but other currently used config in the extensions)
|
||||
* @todo We might provide control of storage settings through the UI besides the
|
||||
* initial (or URL-forced) dialog. *
|
||||
*/
|
||||
e("default",{name:"storage",init:function init(e){var t=e.$,r=this,n=r.canvas,o=r.curConfig,a=o.emptyStorageOnDecline,i=o.noStorageOnLoad,s=o.forceStorage,c=r.storage,u=r.updateCanvas;function replaceStoragePrompt(e){e=e?"storagePrompt="+e:"";var t=top.location;t.href.includes("storagePrompt=")?t.href=t.href.replace(/([&?])storagePrompt=[^&]*(&?)/,(function(t,r,n){return(e?r:"")+e+(!e&&n?r:n||"")})):t.href+=(t.href.includes("?")?"&":"?")+e}function setSVGContentStorage(e){if(c){var t="svgedit-"+r.curConfig.canvasName;e?c.setItem(t,e):c.removeItem(t)}}function expireCookie(e){document.cookie=encodeURIComponent(e)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT"}function setupBeforeUnloadListener(){window.addEventListener("beforeunload",(function(e){if(document.cookie.match(/(?:^|;\s*)svgeditstore=(?:prefsAndContent|prefsOnly)/)){document.cookie.match(/(?:^|;\s*)svgeditstore=prefsAndContent/)&&setSVGContentStorage(n.getSvgString()),r.setConfig({no_save_warning:!0});var t=r.curPrefs;Object.entries(t).forEach((function(e){var t=_slicedToArray(e,2),r=t[0],n=t[1];r="svg-edit-"+r,void 0!==n&&(c?c.setItem(r,n):window.widget?window.widget.setPreferenceForKey(n,r):(n=encodeURIComponent(n),document.cookie=encodeURIComponent(r)+"="+n+"; expires=Fri, 31 Dec 9999 23:59:59 GMT"))}))}}))}var l=!1;return{name:"storage",langReady:function langReady(e){return function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function _next(e){asyncGeneratorStep(a,n,o,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(a,n,o,_next,_throw,"throw",e)}_next(void 0)}))}}(regeneratorRuntime.mark((function _callee(){var n,o,f,d,p,y,g,m,h,v,_,b,x,w,k,S,A,P,C;return regeneratorRuntime.wrap((function _callee$(I){for(;;)switch(I.prev=I.next){case 0:return n=e.importLocale,o=new URL(top.location).searchParams.get("storagePrompt"),I.next=4,n();case 4:if(f=I.sent,d=f.message,p=f.storagePrefsAndContent,y=f.storagePrefsOnly,g=f.storagePrefs,m=f.storageNoPrefsOrContent,h=f.storageNoPrefs,v=f.rememberLabel,_=f.rememberTooltip,!l){I.next=8;break}return I.abrupt("return");case 8:if(l=!0,s||"true"!==o&&("false"===o||document.cookie.match(/(?:^|;\s*)svgeditstore=(?:prefsAndContent|prefsOnly)/))){I.next=44;break}return b=[],c?b.unshift({value:"prefsAndContent",text:p},{value:"prefsOnly",text:y},{value:"noPrefsOrContent",text:m}):b.unshift({value:"prefsOnly",text:g},{value:"noPrefsOrContent",text:h}),x=t("#dialog_container")[0].style.width,w=t("#dialog_container")[0].style.marginLeft,k=t("#dialog_content")[0].style.height,S=t("#dialog_container")[0].style.height,t("#dialog_content")[0].style.height="120px",t("#dialog_container")[0].style.height="170px",t("#dialog_container")[0].style.width="800px",t("#dialog_container")[0].style.marginLeft="-400px",r.storagePromptState="waiting",I.next=20,t.select(d,b,null,null,{label:v,checked:!0,tooltip:_});case 20:if(A=I.sent,P=A.response,C=A.checked,!P||"noPrefsOrContent"===P){I.next=30;break}if(document.cookie="svgeditstore="+encodeURIComponent(P)+"; expires=Fri, 31 Dec 9999 23:59:59 GMT","true"!==o||!C){I.next=28;break}return replaceStoragePrompt(),I.abrupt("return");case 28:I.next=35;break;case 30:if(expireCookie("svgeditstore"),P&&a&&(setSVGContentStorage(""),Object.keys(r.curPrefs).forEach((function(e){e="svg-edit-"+e,c&&c.removeItem(e),expireCookie(e)}))),!P||!C){I.next=35;break}return replaceStoragePrompt("false"),I.abrupt("return");case 35:t("#dialog_container")[0].style.width=x,t("#dialog_container")[0].style.marginLeft=w,t("#dialog_content")[0].style.height=k,t("#dialog_container")[0].style.height=S,setupBeforeUnloadListener(),r.storagePromptState="closed",u(!0),I.next=45;break;case 44:i&&!s||setupBeforeUnloadListener();case 45:case"end":return I.stop()}}),_callee)})))()}}}})}}}));
|
||||
21
dist/editor/system/extensions/ext-storage/ext-storage.js
vendored
Normal file
21
dist/editor/system/extensions/ext-storage/ext-storage.js
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){function asyncGeneratorStep(e,t,r,n,o,a,i){try{var s=e[a](i),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function _slicedToArray(e,t){return function _arrayWithHoles(e){if(Array.isArray(e))return e}(e)||function _iterableToArrayLimit(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw a}}return r}(e,t)||function _unsupportedIterableToArray(e,t){if(!e)return;if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray(e,t)}(e,t)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}
|
||||
/**
|
||||
* @file ext-storage.js
|
||||
*
|
||||
* This extension allows automatic saving of the SVG canvas contents upon
|
||||
* page unload (which can later be automatically retrieved upon future
|
||||
* editor loads).
|
||||
*
|
||||
* The functionality was originally part of the SVG Editor, but moved to a
|
||||
* separate extension to make the setting behavior optional, and adapted
|
||||
* to inform the user of its setting of local data.
|
||||
*
|
||||
* @license MIT
|
||||
*
|
||||
* @copyright 2010 Brett Zamir
|
||||
* @todo Revisit on whether to use `svgEditor.pref` over directly setting
|
||||
* `curConfig` in all extensions for a more public API (not only for `extPath`
|
||||
* and `imagePath`, but other currently used config in the extensions)
|
||||
* @todo We might provide control of storage settings through the UI besides the
|
||||
* initial (or URL-forced) dialog. *
|
||||
*/()}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}e("default",{name:"storage",init:function init(e){var t=e.$,r=this,n=r.canvas,o=r.curConfig,a=o.emptyStorageOnDecline,i=o.noStorageOnLoad,s=o.forceStorage,c=r.storage,u=r.updateCanvas;function replaceStoragePrompt(e){e=e?"storagePrompt="+e:"";var t=top.location;t.href.includes("storagePrompt=")?t.href=t.href.replace(/([&?])storagePrompt=[^&]*(&?)/,(function(t,r,n){return(e?r:"")+e+(!e&&n?r:n||"")})):t.href+=(t.href.includes("?")?"&":"?")+e}function setSVGContentStorage(e){if(c){var t="svgedit-"+r.curConfig.canvasName;e?c.setItem(t,e):c.removeItem(t)}}function expireCookie(e){document.cookie=encodeURIComponent(e)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT"}function setupBeforeUnloadListener(){window.addEventListener("beforeunload",(function(e){if(document.cookie.match(/(?:^|;\s*)svgeditstore=(?:prefsAndContent|prefsOnly)/)){document.cookie.match(/(?:^|;\s*)svgeditstore=prefsAndContent/)&&setSVGContentStorage(n.getSvgString()),r.setConfig({no_save_warning:!0});var t=r.curPrefs;Object.entries(t).forEach((function(e){var t=_slicedToArray(e,2),r=t[0],n=t[1];r="svg-edit-"+r,void 0!==n&&(c?c.setItem(r,n):window.widget?window.widget.setPreferenceForKey(n,r):(n=encodeURIComponent(n),document.cookie=encodeURIComponent(r)+"="+n+"; expires=Fri, 31 Dec 9999 23:59:59 GMT"))}))}}))}var l=!1;return{name:"storage",langReady:function langReady(e){return function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function _next(e){asyncGeneratorStep(a,n,o,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(a,n,o,_next,_throw,"throw",e)}_next(void 0)}))}}(regeneratorRuntime.mark((function _callee(){var n,o,f,d,g,p,m,y,h,v,_,x,b,S,w,C,k,P,A;return regeneratorRuntime.wrap((function _callee$(O){for(;;)switch(O.prev=O.next){case 0:return n=e.importLocale,o=new URL(top.location).searchParams.get("storagePrompt"),O.next=4,n();case 4:if(f=O.sent,d=f.message,g=f.storagePrefsAndContent,p=f.storagePrefsOnly,m=f.storagePrefs,y=f.storageNoPrefsOrContent,h=f.storageNoPrefs,v=f.rememberLabel,_=f.rememberTooltip,!l){O.next=8;break}return O.abrupt("return");case 8:if(l=!0,s||"true"!==o&&("false"===o||document.cookie.match(/(?:^|;\s*)svgeditstore=(?:prefsAndContent|prefsOnly)/))){O.next=44;break}return x=[],c?x.unshift({value:"prefsAndContent",text:g},{value:"prefsOnly",text:p},{value:"noPrefsOrContent",text:y}):x.unshift({value:"prefsOnly",text:m},{value:"noPrefsOrContent",text:h}),b=t("#dialog_container")[0].style.width,S=t("#dialog_container")[0].style.marginLeft,w=t("#dialog_content")[0].style.height,C=t("#dialog_container")[0].style.height,t("#dialog_content")[0].style.height="120px",t("#dialog_container")[0].style.height="170px",t("#dialog_container")[0].style.width="800px",t("#dialog_container")[0].style.marginLeft="-400px",r.storagePromptState="waiting",O.next=20,t.select(d,x,null,null,{label:v,checked:!0,tooltip:_});case 20:if(k=O.sent,P=k.response,A=k.checked,!P||"noPrefsOrContent"===P){O.next=30;break}if(document.cookie="svgeditstore="+encodeURIComponent(P)+"; expires=Fri, 31 Dec 9999 23:59:59 GMT","true"!==o||!A){O.next=28;break}return replaceStoragePrompt(),O.abrupt("return");case 28:O.next=35;break;case 30:if(expireCookie("svgeditstore"),P&&a&&(setSVGContentStorage(""),Object.keys(r.curPrefs).forEach((function(e){e="svg-edit-"+e,c&&c.removeItem(e),expireCookie(e)}))),!P||!A){O.next=35;break}return replaceStoragePrompt("false"),O.abrupt("return");case 35:t("#dialog_container")[0].style.width=b,t("#dialog_container")[0].style.marginLeft=S,t("#dialog_content")[0].style.height=w,t("#dialog_container")[0].style.height=C,setupBeforeUnloadListener(),r.storagePromptState="closed",u(!0),O.next=45;break;case 44:i&&!s||setupBeforeUnloadListener();case 45:case"end":return O.stop()}}),_callee)})))()}}}})}}}));
|
||||
@@ -1,9 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){function _AwaitValue(e){this.wrapped=e}function _AsyncGenerator(e){var n,t;function resume(n,t){try{var r=e[n](t),o=r.value,a=o instanceof _AwaitValue;Promise.resolve(a?o.wrapped:o).then((function(e){a?resume("return"===n?"return":"next",e):settle(r.done?"return":"normal",e)}),(function(e){resume("throw",e)}))}catch(e){settle("throw",e)}}function settle(e,r){switch(e){case"return":n.resolve({value:r,done:!0});break;case"throw":n.reject(r);break;default:n.resolve({value:r,done:!1})}(n=n.next)?resume(n.key,n.arg):t=null}this._invoke=function send(e,r){return new Promise((function(o,a){var i={key:e,arg:r,resolve:o,reject:a,next:null};t?t=t.next=i:(n=t=i,resume(e,r))}))},"function"!=typeof e.return&&(this.return=void 0)}function asyncGeneratorStep(e,n,t,r,o,a,i){try{var c=e[a](i),u=c.value}catch(e){return void t(e)}c.done?n(u):Promise.resolve(u).then(r,o)}"function"==typeof Symbol&&Symbol.asyncIterator&&(_AsyncGenerator.prototype[Symbol.asyncIterator]=function(){return this}),_AsyncGenerator.prototype.next=function(e){return this._invoke("next",e)},_AsyncGenerator.prototype.throw=function(e){return this._invoke("throw",e)},_AsyncGenerator.prototype.return=function(e){return this._invoke("return",e)};
|
||||
/**
|
||||
* Depends on Firefox add-on and executables from
|
||||
* {@link https://github.com/brettz9/webappfind}.
|
||||
* @author Brett Zamir
|
||||
* @license MIT
|
||||
* @todo See WebAppFind Readme for SVG-related todos
|
||||
*/
|
||||
e("default",{name:"webappfind",init:function init(e){var n=this;return function _asyncToGenerator(e){return function(){var n=this,t=arguments;return new Promise((function(r,o){var a=e.apply(n,t);function _next(e){asyncGeneratorStep(a,r,o,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(a,r,o,_next,_throw,"throw",e)}_next(void 0)}))}}(regeneratorRuntime.mark((function _callee(){var t,r,o,a,i,c,u,s;return regeneratorRuntime.wrap((function _callee$(p){for(;;)switch(p.prev=p.next){case 0:return t=e.importLocale,r=e.$,p.next=3,t();case 3:return o=p.sent,a=n,"read",c=["read",i="save"],n.canvas.bind("message",(function(e,n){var t,o,i=n.data,s=n.origin;try{var p=i.webappfind;if(t=p.type,u=p.pathID,o=p.content,s!==location.origin||c.includes(t))return}catch(e){return}switch(t){case"view":a.loadFromString(o);break;case"save-end":r.alert("save complete for pathID ".concat(u,"!"));break;default:throw new Error("Unexpected WebAppFind event type")}})),s=[{id:"webappfind_save",icon:"webappfind.png",type:"app_menu",position:4,events:{click:function click(){u&&window.postMessage({webappfind:{type:i,pathID:u,content:a.canvas.getSvgString()}},"null"===window.location.origin?"*":window.location.origin)}}}],p.abrupt("return",{name:o.name,svgicons:"webappfind-icon.svg",buttons:o.buttons.map((function(e,n){return Object.assign(s[n],e)}))});case 9:case"end":return p.stop()}}),_callee)})))()}})}}}));
|
||||
9
dist/editor/system/extensions/ext-webappfind/ext-webappfind.js
vendored
Normal file
9
dist/editor/system/extensions/ext-webappfind/ext-webappfind.js
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
System.register([],(function(e,n){"use strict";return{execute:function(){function asyncGeneratorStep(e,n,t,r,a,i,o){try{var c=e[i](o),s=c.value}catch(e){return void t(e)}c.done?n(s):Promise.resolve(s).then(r,a)}
|
||||
/**
|
||||
* Depends on Firefox add-on and executables from
|
||||
* {@link https://github.com/brettz9/webappfind}.
|
||||
* @author Brett Zamir
|
||||
* @license MIT
|
||||
* @todo See WebAppFind Readme for SVG-related todos
|
||||
*/
|
||||
e("default",{name:"webappfind",init:function init(e){var t=this;return function _asyncToGenerator(e){return function(){var n=this,t=arguments;return new Promise((function(r,a){var i=e.apply(n,t);function _next(e){asyncGeneratorStep(i,r,a,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(i,r,a,_next,_throw,"throw",e)}_next(void 0)}))}}(regeneratorRuntime.mark((function _callee(){var r,a,i,o,c,s,u,p;return regeneratorRuntime.wrap((function _callee$(f){for(;;)switch(f.prev=f.next){case 0:return r=e.$,a=t,f.next=4,n.import("./locale/".concat(a.curPrefs.lang,".js"));case 4:return i=f.sent,o=i.default,"read",s=["read",c="save"],t.canvas.bind("message",(function(e,n){var t,i,o=n.data,c=n.origin;try{var p=o.webappfind;if(t=p.type,u=p.pathID,i=p.content,c!==location.origin||s.includes(t))return}catch(e){return}switch(t){case"view":a.loadFromString(i);break;case"save-end":r.alert("save complete for pathID ".concat(u,"!"));break;default:throw new Error("Unexpected WebAppFind event type")}})),p=[{id:"webappfind_save",icon:"webappfind.png",type:"app_menu",position:4,events:{click:function click(){u&&window.postMessage({webappfind:{type:c,pathID:u,content:a.canvas.getSvgString()}},"null"===window.location.origin?"*":window.location.origin)}}}],f.abrupt("return",{name:o.name,svgicons:"webappfind-icon.svg",buttons:o.buttons.map((function(e,n){return Object.assign(p[n],e)}))});case 10:case"end":return f.stop()}}),_callee)})))()}})}}}));
|
||||
@@ -1 +0,0 @@
|
||||
System.register([],(function(e){"use strict";return{execute:function(){function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _AwaitValue(e){this.wrapped=e}function _AsyncGenerator(e){var t,r;function resume(t,r){try{var n=e[t](r),o=n.value,a=o instanceof _AwaitValue;Promise.resolve(a?o.wrapped:o).then((function(e){a?resume("return"===t?"return":"next",e):settle(n.done?"return":"normal",e)}),(function(e){resume("throw",e)}))}catch(e){settle("throw",e)}}function settle(e,n){switch(e){case"return":t.resolve({value:n,done:!0});break;case"throw":t.reject(n);break;default:t.resolve({value:n,done:!1})}(t=t.next)?resume(t.key,t.arg):r=null}this._invoke=function send(e,n){return new Promise((function(o,a){var i={key:e,arg:n,resolve:o,reject:a,next:null};r?r=r.next=i:(t=r=i,resume(e,n))}))},"function"!=typeof e.return&&(this.return=void 0)}function _toConsumableArray(e){return function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _iterableToArray(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}"function"==typeof Symbol&&Symbol.asyncIterator&&(_AsyncGenerator.prototype[Symbol.asyncIterator]=function(){return this}),_AsyncGenerator.prototype.next=function(e){return this._invoke("next",e)},_AsyncGenerator.prototype.throw=function(e){return this._invoke("throw",e)},_AsyncGenerator.prototype.return=function(e){return this._invoke("return",e)};e("default",{name:"xdomain-messaging",init:function init(){var e=this,t=e.canvas;try{window.addEventListener("message",(function(r){if(r.data&&["string","object"].includes(_typeof(r.data))&&"|"!==r.data.charAt()){var n="object"===_typeof(r.data)?r.data:JSON.parse(r.data);if(n&&"object"===_typeof(n)&&"svgCanvas"===n.namespace){var o=e.curConfig.allowedOrigins;if(o.includes("*")||o.includes(r.origin)){var a=n.id,i=n.name,s=n.args,u={namespace:"svg-edit",id:a};try{u.result=t[i].apply(t,_toConsumableArray(s))}catch(e){u.error=e.message}r.source.postMessage(JSON.stringify(u),"*")}else console.log("Origin ".concat(r.origin," not whitelisted for posting to ").concat(window.origin))}}}))}catch(e){console.log("Error with xdomain message listener: "+e)}}})}}}));
|
||||
1
dist/editor/system/extensions/ext-xdomain-messaging/ext-xdomain-messaging.js
vendored
Normal file
1
dist/editor/system/extensions/ext-xdomain-messaging/ext-xdomain-messaging.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
System.register([],(function(r){"use strict";return{execute:function(){function _typeof(r){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}function _toConsumableArray(r){return function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r)}(r)||function _iterableToArray(r){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(r))return Array.from(r)}(r)||function _unsupportedIterableToArray(r,t){if(!r)return;if("string"==typeof r)return _arrayLikeToArray(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);"Object"===e&&r.constructor&&(e=r.constructor.name);if("Map"===e||"Set"===e)return Array.from(r);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return _arrayLikeToArray(r,t)}(r)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _arrayLikeToArray(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}r("default",{name:"xdomain-messaging",init:function init(){var r=this,t=r.canvas;try{window.addEventListener("message",(function(e){if(e.data&&["string","object"].includes(_typeof(e.data))&&"|"!==e.data.charAt()){var n="object"===_typeof(e.data)?e.data:JSON.parse(e.data);if(n&&"object"===_typeof(n)&&"svgCanvas"===n.namespace){var o=r.curConfig.allowedOrigins;if(o.includes("*")||o.includes(e.origin)){var a=n.id,i=n.name,s=n.args,c={namespace:"svg-edit",id:a};try{c.result=t[i].apply(t,_toConsumableArray(s))}catch(r){c.error=r.message}e.source.postMessage(JSON.stringify(c),"*")}else console.log("Origin ".concat(e.origin," not whitelisted for posting to ").concat(window.origin))}}}))}catch(r){console.log("Error with xdomain message listener: "+r)}}})}}}));
|
||||
12
dist/editor/system/index.js
vendored
12
dist/editor/system/index.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user