group each plugin in its own folder
parent
caa4fe38cc
commit
cfb3620d3a
|
@ -28,7 +28,7 @@ src/editor/js-hotkeys
|
|||
src/editor/jspdf/jspdf.min.js
|
||||
src/editor/jspdf/underscore-min.js
|
||||
|
||||
src/editor/extensions/mathjax
|
||||
src/editor/extensions/ext-mathjax/mathjax
|
||||
|
||||
# Todo: We should at least check `compat/compat` in our other files, however
|
||||
## Two "external" items are modified locally, so we undo their ignoring
|
||||
|
|
|
@ -129,7 +129,7 @@ module.exports = {
|
|||
// and translations may need a longer line length
|
||||
{
|
||||
files: [
|
||||
'src/editor/locale/lang.*.js', 'src/editor/extensions/ext-locale/**',
|
||||
'src/editor/locale/lang.*.js', 'src/editor/extensions/*/locale/**',
|
||||
'docs/tutorials/ExtensionDocs.md'
|
||||
],
|
||||
rules: {
|
||||
|
@ -144,7 +144,7 @@ module.exports = {
|
|||
'src/editor/touch.js',
|
||||
'src/editor/typedefs.js',
|
||||
'src/editor/redirect-on-no-module-support.js',
|
||||
'src/editor/extensions/imagelib/index.js',
|
||||
'src/editor/extensions/ext-imagelib/index.js',
|
||||
'src/external/dom-polyfill/dom-polyfill.js',
|
||||
'screencasts/svgopen2010/script.js'
|
||||
],
|
||||
|
|
|
@ -1 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="428" height="20"><defs><style>text{font-size:11px;font-family:Verdana,DejaVu Sans,Geneva,sans-serif}text.shadow{fill:#010101;fill-opacity:.3}text.high{fill:#fff}</style><linearGradient id="smooth" x2="0" y2="100%"><stop offset="0" stop-color="#aaa" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><mask id="round"><rect width="100%" height="100%" rx="3" fill="#fff"/></mask></defs><g id="bg" mask="url(#round)"><path fill="green" stroke="#000" d="M0 0h120v20H0zM120 0h109v20H120zM229 0h87v20h-87zM316 0h112v20H316z"/><path fill="url(#smooth)" d="M0 0h428v20H0z"/></g><g id="fg"><text class="shadow" x="5.5" y="15">Statements 50.54%</text><text class="high" x="5" y="14">Statements 50.54%</text><text class="shadow" x="125.5" y="15">Branches 42.39%</text><text class="high" x="125" y="14">Branches 42.39%</text><text class="shadow" x="234.5" y="15">Lines 49.32%</text><text class="high" x="234" y="14">Lines 49.32%</text><text class="shadow" x="321.5" y="15">Functions 52.98%</text><text class="high" x="321" y="14">Functions 52.98%</text></g></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="428" height="20"><defs><style>text{font-size:11px;font-family:Verdana,DejaVu Sans,Geneva,sans-serif}text.shadow{fill:#010101;fill-opacity:.3}text.high{fill:#fff}</style><linearGradient id="smooth" x2="0" y2="100%"><stop offset="0" stop-color="#aaa" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><mask id="round"><rect width="100%" height="100%" rx="3" fill="#fff"/></mask></defs><g id="bg" mask="url(#round)"><path fill="orange" stroke="#000" d="M0 0h120v20H0zM120 0h109v20H120zM229 0h87v20h-87zM316 0h112v20H316z"/><path fill="url(#smooth)" d="M0 0h428v20H0z"/></g><g id="fg"><text class="shadow" x="5.5" y="15">Statements 36.76%</text><text class="high" x="5" y="14">Statements 36.76%</text><text class="shadow" x="125.5" y="15">Branches 25.98%</text><text class="high" x="125" y="14">Branches 25.98%</text><text class="shadow" x="234.5" y="15">Lines 37.65%</text><text class="high" x="234" y="14">Lines 37.65%</text><text class="shadow" x="321.5" y="15">Functions 38.42%</text><text class="high" x="321" y="14">Functions 38.42%</text></g></svg>
|
||||
|
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
@ -1 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="97" height="20"><defs><style>text{font-size:11px;font-family:Verdana,DejaVu Sans,Geneva,sans-serif}text.shadow{fill:#010101;fill-opacity:.3}text.high{fill:#fff}</style><linearGradient id="smooth" x2="0" y2="100%"><stop offset="0" stop-color="#aaa" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><mask id="round"><rect width="100%" height="100%" rx="3" fill="#fff"/></mask></defs><g id="bg" mask="url(#round)"><path fill="#696969" d="M0 0h41v20H0z"/><path fill="#e05d44" d="M41 0h56v20H41z"/><path fill="url(#smooth)" d="M0 0h97v20H0z"/></g><g id="fg"><text class="shadow" x="5.5" y="15">Tests</text><text class="high" x="5" y="14">Tests</text><text class="shadow" x="46.5" y="15">124/125</text><text class="high" x="46" y="14">124/125</text></g></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="97" height="20"><defs><style>text{font-size:11px;font-family:Verdana,DejaVu Sans,Geneva,sans-serif}text.shadow{fill:#010101;fill-opacity:.3}text.high{fill:#fff}</style><linearGradient id="smooth" x2="0" y2="100%"><stop offset="0" stop-color="#aaa" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><mask id="round"><rect width="100%" height="100%" rx="3" fill="#fff"/></mask></defs><g id="bg" mask="url(#round)"><path fill="#696969" d="M0 0h41v20H0z"/><path fill="#e05d44" d="M41 0h56v20H41z"/><path fill="url(#smooth)" d="M0 0h97v20H0z"/></g><g id="fg"><text class="shadow" x="5.5" y="15">Tests</text><text class="high" x="5" y="14">Tests</text><text class="shadow" x="46.5" y="15">121/131</text><text class="high" x="46" y="14">121/131</text></g></svg>
|
Before Width: | Height: | Size: 823 B After Width: | Height: | Size: 823 B |
|
@ -1,11 +0,0 @@
|
|||
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 l=e[o](i),u=l.value}catch(e){return void r(e)}l.done?t(u):Promise.resolve(u).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
|
||||
*
|
||||
*/
|
||||
var e={name:"arrows",init:function init(e){var t=this;return _asyncToGenerator(regeneratorRuntime.mark((function _callee2(){var r,n,a,o,i,l,u,c,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,l){var u=h(t,"marker-"+l);if(u){var s=i(u).children().attr("fill"),d=i(u).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=u.id.includes("_fw")?"fw":"bk";m=k(v,l,c+v+f.length),i(m).children().attr("fill",r)}i(t).attr("marker-"+l,"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(#"+u.id+")")return _=!1})),!_)return!1})),_&&i(u).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",u)}},k=function _addMarker(e,t,r){r=r||c+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 l=a({element:"path",attr:{d:o.d,fill:"#000000"}});i.append(l),n.findDefs().append(i)}return i.setAttribute("refX",o.refx),i},_=function _resetMarker(){var e=u[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=u[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,c=l,m.fw.id=c+"fw",m.bk.id=c+"bk"},d=function _setArrowNonce(e,t){s=!0,c=l+t+"_",m.fw.id=c+"fw",m.bk.id=c+"bk"},g.next=10,e.importLocale();case 10:return r=g.sent,n=t.canvas,a=n.addSVGElementFromJson,o=e.nonce,i=e.$,l="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:(c=s?l+o+"_":l)+"fw"},bk:{d:"m10,0l-10,5l10,5l-5,-5l5,-5z",refx:2,id:c+"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=(u=e.elems).length;r--;){var n=u[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)})))()}};export default e;
|
||||
//# sourceMappingURL=ext-arrows.js.map
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,10 @@
|
|||
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
|
||||
*
|
||||
*/var e={name:"arrows",init:function init(e){var t=this;return _asyncToGenerator(regeneratorRuntime.mark((function _callee2(){var r,n,a,i,o,l,c,u,d,s,f,m,h,v,k,_,g,b,p,w,x;return regeneratorRuntime.wrap((function _callee2$(A){for(;;)switch(A.prev=A.next){case 0:return w=function _colorChanged(t){var r=t.getAttribute("stroke"),n=["start","mid","end"],a=i.findDefs();c.each(n,(function(i,o){var l=k(t,"marker-"+o);if(l){var u=c(l).children().attr("fill"),d=c(l).children().attr("d");if(u!==r){var f=c(a).find("marker"),m=null;if(f.each((function(){var e=c(this).children().attr(["fill","d"]);e.fill===r&&e.d===d&&(m=this)})),!m){var h=l.id.includes("_fw")?"fw":"bk";m=b(h,o,s+h+f.length),c(m).children().attr("fill",r)}c(t).attr("marker-"+o,"url(#"+m.id+")");var v=!0;c(e.svgcontent).find("line, polyline, path, polygon").each((function(){var e=this;if(c.each(n,(function(t,r){if(c(e).attr("marker-"+r)==="url(#"+l.id+")")return v=!1})),!v)return!1})),v&&c(l).remove()}}}))},p=function _setArrow(){g();var e=this.value;if("none"!==e){var t="fw";"mid_bk"===e?(e="mid",t="bk"):"both"===e?(b("bk",e),i.changeSelectedAttribute("marker-start","url(#"+v.bk.id+")"),e="end",t="fw"):"start"===e&&(t="bk"),b(t,e),i.changeSelectedAttribute("marker-"+e,"url(#"+v[t].id+")"),i.call("changed",d)}},b=function _addMarker(e,t,r){r=r||s+e;var n=v[e];"mid"===t&&(n.refx=5);var a=i.getElem(r);if(!a){a=o({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 l=o({element:"path",attr:{d:n.d,fill:"#000000"}});a.append(l),i.findDefs().append(a)}return a.setAttribute("refX",n.refx),a},g=function _resetMarker(){var e=d[0];e.removeAttribute("marker-start"),e.removeAttribute("marker-mid"),e.removeAttribute("marker-end")},_=function _showPanel(e){if(c("#arrow_panel").toggle(e),e){var t,r=d[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"),c("#arrow_list").val(t)}},k=function _getLinked(e,t){var r=e.getAttribute(t);if(!r)return null;var n=r.match(/\(#(.*)\)/);return n&&2===n.length?i.getElem(n[1]):null},h=function _unsetArrowNonce(e){f=!1,s=u,v.fw.id=s+"fw",v.bk.id=s+"bk"},m=function _setArrowNonce(e,t){f=!0,s=u+t+"_",v.fw.id=s+"fw",v.bk.id=s+"bk"},r=t,A.next=11,import("./locale/".concat(r.curPrefs.lang,".js"));case 11:return n=A.sent,a=n.default,i=r.canvas,o=i.addSVGElementFromJson,l=e.nonce,c=e.$,u="se_arrow_",f=e.randomize_ids,i.bind("setnonce",m),i.bind("unsetnonce",h),v={fw:{d:"m0,0l10,5l-10,5l5,-5l-5,-5z",refx:8,id:(s=f?u+l+"_":u)+"fw"},bk:{d:"m10,0l-10,5l10,5l-5,-5l5,-5z",refx:2,id:s+"bk"}},x=[{type:"select",panel:"arrow_panel",id:"arrow_list",defval:"none",events:{change:p}}],A.abrupt("return",{name:a.name,context_tools:a.contextTools.map((function(e,t){return Object.assign(x[t],e)})),callback:function callback(){c("#arrow_panel").hide(),c("#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=(d=e.elems).length;r--;){var n=d[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"))&&w(t)}});case 22:case"end":return A.stop()}}),_callee2)})))()}};export default e;
|
||||
//# sourceMappingURL=ext-arrows.js.map
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,11 +0,0 @@
|
|||
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
|
||||
*
|
||||
*/
|
||||
var e={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)})))()}};export default e;
|
||||
//# sourceMappingURL=ext-eyedropper.js.map
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,11 @@
|
|||
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
|
||||
*
|
||||
*/
|
||||
var e={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,l,u,p;return regeneratorRuntime.wrap((function _callee$(d){for(;;)switch(d.prev=d.next){case 0:return u=function _getStyle(e){if("eyedropper"!==s.getMode()){var t=i("#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"),l.fillPaint=r.getAttribute("fill")||"black",l.fillOpacity=r.getAttribute("fill-opacity")||1,l.strokePaint=r.getAttribute("stroke"),l.strokeOpacity=r.getAttribute("stroke-opacity")||1,l.strokeWidth=r.getAttribute("stroke-width"),l.strokeDashArray=r.getAttribute("stroke-dasharray"),l.strokeLinecap=r.getAttribute("stroke-linecap"),l.strokeLinejoin=r.getAttribute("stroke-linejoin"),l.opacity=r.getAttribute("opacity")||1)}},r=t,d.next=4,import("./locale/".concat(r.curPrefs.lang,".js"));case 4:return n=d.sent,o=n.default,i=e.$,a=e.ChangeElementCommand,s=r.canvas,c=function addToHistory(e){s.undoMgr.addCommandToHistory(e)},l={fillPaint:"red",fillOpacity:1,strokePaint:"black",strokeOpacity:1,strokeWidth:5,strokeDashArray:null,opacity:1,strokeLinecap:"butt",strokeLinejoin:"miter"},p=[{id:"tool_eyedropper",icon:"eyedropper.png",type:"mode",events:{click:function click(){s.setMode("eyedropper")}}}],d.abrupt("return",{name:o.name,svgicons:"eyedropper-icon.xml",buttons:o.buttons.map((function(e,t){return Object.assign(p[t],e)})),selectedChanged:u,elementChanged:u,mouseDown:function mouseDown(e){if("eyedropper"===s.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)};l.fillPaint&&n(t,"fill",l.fillPaint),l.fillOpacity&&n(t,"fill-opacity",l.fillOpacity),l.strokePaint&&n(t,"stroke",l.strokePaint),l.strokeOpacity&&n(t,"stroke-opacity",l.strokeOpacity),l.strokeWidth&&n(t,"stroke-width",l.strokeWidth),l.strokeDashArray&&n(t,"stroke-dasharray",l.strokeDashArray),l.opacity&&n(t,"opacity",l.opacity),l.strokeLinecap&&n(t,"stroke-linecap",l.strokeLinecap),l.strokeLinejoin&&n(t,"stroke-linejoin",l.strokeLinejoin),c(new a(t,r))}}}});case 9:case"end":return d.stop()}}),_callee)})))()}};export default e;
|
||||
//# sourceMappingURL=ext-eyedropper.js.map
|
File diff suppressed because one or more lines are too long
|
@ -1,11 +0,0 @@
|
|||
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
|
||||
*
|
||||
*/
|
||||
var e={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)})))()}};export default e;
|
||||
//# sourceMappingURL=ext-foreignobject.js.map
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,10 @@
|
|||
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
|
||||
*
|
||||
*/var e={name:"foreignobject",init:function init(e){var t=this;return _asyncToGenerator(regeneratorRuntime.mark((function _callee2(){var n,r,o,i,a,c,s,l,u,g,f,_,d,h,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){a.changeSelectedAttribute(e,t),a.call("changed",_)},m=function _showForeignEditor(){var e=_[0];if(e&&!v){v=!0,f(!0),e.removeAttribute("fill");var t=a.svgToString(e,0);r("#svg_source_textarea").val(t),r("#svg_source_editor").fadeIn(),u(),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>");a.sanitizeSvg(n.documentElement),t.replaceWith(c.importNode(n.documentElement.firstChild,!0)),a.call("changed",[t]),a.clearSelection()}catch(e){return console.log(e),!1}return!0},f=function _toggleSourceButtons(e){r("#tool_source_save, #tool_source_cancel").toggle(!e),r("#foreign_save, #foreign_cancel").toggle(e)},g=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=n.canvas,c=e.svgroot.parentNode.ownerDocument,w.next=11,import("./locale/".concat(n.curPrefs.lang,".js"));case 11:return s=w.sent,l=s.default,u=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(){a.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:l.name,svgicons:"foreignobject-icons.xml",buttons:l.buttons.map((function(e,t){return Object.assign(x[t],e)})),context_tools:l.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(),f(!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"===a.getMode()){d=!0,h=a.addSVGElementFromJson({element:"foreignObject",attr:{x:e.start_x,y:e.start_y,id:a.getNextId(),"font-size":16,width:"48",height:"20",style:"pointer-events:inherit"}});var t=c.createElementNS(i.MATH,"math");t.setAttributeNS(i.XMLNS,"xmlns",i.MATH),t.setAttribute("display","inline");var n=c.createElementNS(i.MATH,"mi");n.setAttribute("mathvariant","normal"),n.textContent="Φ";var r=c.createElementNS(i.MATH,"mo");r.textContent="∪";var o=c.createElementNS(i.MATH,"mi");return o.textContent="ℳ",t.append(n,r,o),h.append(t),{started:!0}}},mouseUp:function mouseUp(e){if("foreign"===a.getMode()&&d){var t=r(h).attr(["width","height"]),n="0"!==t.width||"0"!==t.height;return a.addToSelection([h],!0),{keep:n,element:h}}},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")),g(!0)):g(!1)}},elementChanged:function elementChanged(e){}});case 18:case"end":return w.stop()}}),_callee2)})))()}};export default e;
|
||||
//# sourceMappingURL=ext-foreignobject.js.map
|
File diff suppressed because one or more lines are too long
|
@ -1,11 +0,0 @@
|
|||
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,a=o instanceof _AwaitValue;Promise.resolve(a?o.wrapped:o).then((function(e){a?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,a){var i={key:e,arg:r,resolve:o,reject:a,next:null};n?n=n.next=i:(t=n=i,resume(e,r))}))},"function"!=typeof e.return&&(this.return=void 0)}function asyncGeneratorStep(e,t,n,r,o,a,i){try{var s=e[a](i),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
|
||||
*
|
||||
*/
|
||||
var e={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 a=e.apply(t,n);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 n,r,o,a,i,s,c,u,l,d,p,h,v,g,f,m,y,w,_,b,x,G;return regeneratorRuntime.wrap((function _callee$(k){for(;;)switch(k.prev=k.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 a=d.getContext("2d"),i=.5,u=o/10;a.globalAlpha=.2,a.strokeStyle=s.curConfig.gridColor;for(var l=1;l<10;l++){var p=Math.round(u*l)+.5;a.moveTo(p,o),a.lineTo(p,0),a.moveTo(o,p),a.lineTo(0,p)}a.stroke(),a.beginPath(),a.globalAlpha=.5,a.moveTo(i,o),a.lineTo(i,0),a.moveTo(o,i),a.lineTo(0,i),a.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,a=e.importLocale,k.next=5,a();case 5:return i=k.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()}}}],k.abrupt("return",{name:i.name,svgicons:"grid-icon.xml",zoomChanged:function zoomChanged(e){g&&b(e)},callback:function callback(){g&&x()},buttons:i.buttons.map((function(e,t){return Object.assign(G[t],e)}))});case 27:case"end":return k.stop()}}),_callee)})))()}};export default e;
|
||||
//# sourceMappingURL=ext-grid.js.map
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,11 @@
|
|||
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
|
||||
*
|
||||
*/
|
||||
var e={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,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 n,r,a,o,i,c,s,d,u,l,p,g,h,v,m,f,w,b,_,y,G,S;return regeneratorRuntime.wrap((function _callee$(x){for(;;)switch(x.prev=x.next){case 0:return G=function _gridUpdate(){v&&y(s.getZoom()),n("#canvasGrid").toggle(v),n("#view_grid").toggleClass("push_button_pressed tool_button")},y=function _updateGrid(e){var t=g[o.curConfig.baseUnit]*e,n=100/t,r=1;h.some((function(e){return r=e,n<=e}));var a=r*t;l.width=a,l.height=a;var i=l.getContext("2d"),c=.5,d=a/10;i.globalAlpha=.2,i.strokeStyle=o.curConfig.gridColor;for(var u=1;u<10;u++){var p=Math.round(d*u)+.5;i.moveTo(p,a),i.lineTo(p,0),i.moveTo(a,p),i.lineTo(0,p)}i.stroke(),i.beginPath(),i.globalAlpha=.5,i.moveTo(c,a),i.lineTo(c,0),i.moveTo(a,c),i.lineTo(0,c),i.stroke();var v=l.toDataURL("image/png");b.setAttribute("width",a),b.setAttribute("height",a),b.parentNode.setAttribute("width",a),b.parentNode.setAttribute("height",a),s.setHref(b,v)},n=e.$,r=e.NS,a=e.getTypeMap,o=t,x.next=6,import("./locale/".concat(o.curPrefs.lang,".js"));case 6:return i=x.sent,c=i.default,s=o.canvas,d=document.getElementById("svgcanvas").ownerDocument,u=s.assignAttributes,l=document.createElement("canvas"),p=n("#canvasBackground"),g=a(),h=[.01,.1,1,10,100,1e3],v=o.curConfig.showGrid||!1,n(l).hide().appendTo("body"),m=d.createElementNS(r.SVG,"svg"),u(m,{id:"canvasGrid",width:"100%",height:"100%",x:0,y:0,overflow:"visible",display:"none"}),p.append(m),f=d.createElementNS(r.SVG,"defs"),w=d.createElementNS(r.SVG,"pattern"),u(w,{id:"gridpattern",patternUnits:"userSpaceOnUse",x:0,y:0,width:100,height:100}),b=d.createElementNS(r.SVG,"image"),u(b,{x:0,y:0,width:100,height:100}),w.append(b),f.append(w),n("#canvasGrid").append(f),_=d.createElementNS(r.SVG,"rect"),u(_,{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(_),S=[{id:"view_grid",icon:"grid.png",type:"context",panel:"editor_panel",events:{click:function click(){o.curConfig.showGrid=v=!v,G()}}}],x.abrupt("return",{name:c.name,svgicons:"grid-icon.xml",zoomChanged:function zoomChanged(e){v&&y(e)},callback:function callback(){v&&G()},buttons:c.buttons.map((function(e,t){return Object.assign(S[t],e)}))});case 28:case"end":return x.stop()}}),_callee)})))()}};export default e;
|
||||
//# sourceMappingURL=ext-grid.js.map
|
File diff suppressed because one or more lines are too long
|
@ -1,11 +0,0 @@
|
|||
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),l=u.value}catch(e){return void t(e)}u.done?r(l):Promise.resolve(l).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
|
||||
*
|
||||
*/
|
||||
var e={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)})))()}};export default e;
|
||||
//# sourceMappingURL=ext-helloworld.js.map
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"ext-helloworld.js","sources":["../../../src/editor/extensions/ext-helloworld.js"],"sourcesContent":["/**\n * @file ext-helloworld.js\n *\n * @license MIT\n *\n * @copyright 2010 Alexis Deveria\n *\n */\n\n/**\n* This is a very basic SVG-Edit extension. It adds a \"Hello World\" button in\n* the left (\"mode\") panel. Clicking on the button, and then the canvas\n* will show the user the point on the canvas that was clicked on.\n*/\nexport default {\n name: 'helloworld',\n async init ({$, importLocale}) {\n // See `/editor/extensions/ext-locale/helloworld/`\n const strings = await importLocale();\n const svgEditor = this;\n const svgCanvas = svgEditor.canvas;\n return {\n name: strings.name,\n // For more notes on how to make an icon file, see the source of\n // the helloworld-icon.xml\n svgicons: 'helloworld-icon.xml',\n\n // Multiple buttons can be added in this array\n buttons: [{\n // Must match the icon ID in helloworld-icon.xml\n id: 'hello_world',\n\n // Fallback, e.g., for `file:///` access\n icon: 'helloworld.png',\n\n // This indicates that the button will be added to the \"mode\"\n // button panel on the left side\n type: 'mode',\n\n // Tooltip text\n title: strings.buttons[0].title,\n\n // Events\n events: {\n click () {\n // The action taken when the button is clicked on.\n // For \"mode\" buttons, any other button will\n // automatically be de-pressed.\n svgCanvas.setMode('hello_world');\n }\n }\n }],\n // This is triggered when the main mouse button is pressed down\n // on the editor canvas (not the tool panels)\n mouseDown () {\n // Check the mode on mousedown\n if (svgCanvas.getMode() === 'hello_world') {\n // The returned object must include \"started\" with\n // a value of true in order for mouseUp to be triggered\n return {started: true};\n }\n return undefined;\n },\n\n // This is triggered from anywhere, but \"started\" must have been set\n // to true (see above). Note that \"opts\" is an object with event info\n mouseUp (opts) {\n // Check the mode on mouseup\n if (svgCanvas.getMode() === 'hello_world') {\n const zoom = svgCanvas.getZoom();\n\n // Get the actual coordinate by dividing by the zoom value\n const x = opts.mouse_x / zoom;\n const y = opts.mouse_y / zoom;\n\n // We do our own formatting\n let {text} = strings;\n [\n ['x', x],\n ['y', y]\n ].forEach(([prop, val]) => {\n text = text.replace('{' + prop + '}', val);\n });\n\n // Show the text using the custom alert function\n $.alert(text);\n }\n }\n };\n }\n};\n"],"names":["name","init","$","importLocale","strings","svgCanvas","_this","canvas","svgicons","buttons","id","icon","type","title","events","click","setMode","mouseDown","getMode","started","mouseUp","opts","zoom","getZoom","x","mouse_x","y","mouse_y","text","forEach","prop","val","replace","alert"],"mappings":";;;;;;;;;AAcA,MAAe,CACbA,KAAM,aACAC,qdAAOC,IAAAA,EAAGC,IAAAA,sBAEQA,kBAAhBC,SAEAC,EADYC,EACUC,yBACrB,CACLP,KAAMI,EAAQJ,KAGdQ,SAAU,sBAGVC,QAAS,CAAC,CAERC,GAAI,cAGJC,KAAM,iBAINC,KAAM,OAGNC,MAAOT,EAAQK,QAAQ,GAAGI,MAG1BC,OAAQ,CACNC,uBAIEV,EAAUW,QAAQ,mBAMxBC,kCAE8B,gBAAxBZ,EAAUa,gBAGL,CAACC,SAAS,IAOrBC,yBAASC,MAEqB,gBAAxBhB,EAAUa,UAA6B,KACnCI,EAAOjB,EAAUkB,UAGjBC,EAAIH,EAAKI,QAAUH,EACnBI,EAAIL,EAAKM,QAAUL,EAGpBM,EAAQxB,EAARwB,MAEH,CAAC,IAAKJ,GACN,CAAC,IAAKE,IACNG,SAAQ,sCAAEC,OAAMC,OAChBH,EAAOA,EAAKI,QAAQ,IAAMF,EAAO,IAAKC,MAIxC7B,EAAE+B,MAAML"}
|
|
@ -0,0 +1,10 @@
|
|||
function asyncGeneratorStep(r,e,t,n,o,a,i){try{var l=r[a](i),u=l.value}catch(r){return void t(r)}l.done?e(u):Promise.resolve(u).then(n,o)}function _slicedToArray(r,e){return function _arrayWithHoles(r){if(Array.isArray(r))return r}(r)||function _iterableToArrayLimit(r,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(r)))return;var t=[],n=!0,o=!1,a=void 0;try{for(var i,l=r[Symbol.iterator]();!(n=(i=l.next()).done)&&(t.push(i.value),!e||t.length!==e);n=!0);}catch(r){o=!0,a=r}finally{try{n||null==l.return||l.return()}finally{if(o)throw a}}return t}(r,e)||function _unsupportedIterableToArray(r,e){if(!r)return;if("string"==typeof r)return _arrayLikeToArray(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);"Object"===t&&r.constructor&&(t=r.constructor.name);if("Map"===t||"Set"===t)return Array.from(r);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return _arrayLikeToArray(r,e)}(r,e)||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(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}var r={name:"helloworld",init:function init(r){var e=this;return function _asyncToGenerator(r){return function(){var e=this,t=arguments;return new Promise((function(n,o){var a=r.apply(e,t);function _next(r){asyncGeneratorStep(a,n,o,_next,_throw,"next",r)}function _throw(r){asyncGeneratorStep(a,n,o,_next,_throw,"throw",r)}_next(void 0)}))}}(regeneratorRuntime.mark((function _callee(){var t,n,o,a,i;return regeneratorRuntime.wrap((function _callee$(l){for(;;)switch(l.prev=l.next){case 0:return t=r.$,r.importLocale,n=e,l.next=4,import("./locale/".concat(n.curPrefs.lang,".js"));case 4:return o=l.sent,a=o.default,i=n.canvas,l.abrupt("return",{name:a.name,svgicons:"helloworld-icon.xml",buttons:[{id:"hello_world",icon:"helloworld.png",type:"mode",title:a.buttons[0].title,events:{click:function click(){i.setMode("hello_world")}}}],mouseDown:function mouseDown(){if("hello_world"===i.getMode())return{started:!0}},mouseUp:function mouseUp(r){if("hello_world"===i.getMode()){var e=i.getZoom(),n=r.mouse_x/e,o=r.mouse_y/e,l=a.text;[["x",n],["y",o]].forEach((function(r){var e=_slicedToArray(r,2),t=e[0],n=e[1];l=l.replace("{"+t+"}",n)})),t.alert(l)}}});case 8:case"end":return l.stop()}}),_callee)})))()}};export default r;
|
||||
//# sourceMappingURL=ext-helloworld.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"ext-helloworld.js","sources":["../../../../src/editor/extensions/ext-helloworld/ext-helloworld.js"],"sourcesContent":["/**\n * @file ext-helloworld.js\n *\n * @license MIT\n *\n * @copyright 2010 Alexis Deveria\n *\n */\n\n/**\n* This is a very basic SVG-Edit extension. It adds a \"Hello World\" button in\n* the left (\"mode\") panel. Clicking on the button, and then the canvas\n* will show the user the point on the canvas that was clicked on.\n*/\nexport default {\n name: 'helloworld',\n async init ({$, importLocale}) {\n const svgEditor = this;\n // eslint-disable-next-line node/no-unsupported-features/es-syntax\n const {default: strings} = await import(`./locale/${svgEditor.curPrefs.lang}.js`);\n const svgCanvas = svgEditor.canvas;\n return {\n name: strings.name,\n // For more notes on how to make an icon file, see the source of\n // the helloworld-icon.xml\n svgicons: 'helloworld-icon.xml',\n\n // Multiple buttons can be added in this array\n buttons: [{\n // Must match the icon ID in helloworld-icon.xml\n id: 'hello_world',\n\n // Fallback, e.g., for `file:///` access\n icon: 'helloworld.png',\n\n // This indicates that the button will be added to the \"mode\"\n // button panel on the left side\n type: 'mode',\n\n // Tooltip text\n title: strings.buttons[0].title,\n\n // Events\n events: {\n click () {\n // The action taken when the button is clicked on.\n // For \"mode\" buttons, any other button will\n // automatically be de-pressed.\n svgCanvas.setMode('hello_world');\n }\n }\n }],\n // This is triggered when the main mouse button is pressed down\n // on the editor canvas (not the tool panels)\n mouseDown () {\n // Check the mode on mousedown\n if (svgCanvas.getMode() === 'hello_world') {\n // The returned object must include \"started\" with\n // a value of true in order for mouseUp to be triggered\n return {started: true};\n }\n return undefined;\n },\n\n // This is triggered from anywhere, but \"started\" must have been set\n // to true (see above). Note that \"opts\" is an object with event info\n mouseUp (opts) {\n // Check the mode on mouseup\n if (svgCanvas.getMode() === 'hello_world') {\n const zoom = svgCanvas.getZoom();\n\n // Get the actual coordinate by dividing by the zoom value\n const x = opts.mouse_x / zoom;\n const y = opts.mouse_y / zoom;\n\n // We do our own formatting\n let {text} = strings;\n [\n ['x', x],\n ['y', y]\n ].forEach(([prop, val]) => {\n text = text.replace('{' + prop + '}', val);\n });\n\n // Show the text using the custom alert function\n $.alert(text);\n }\n }\n };\n }\n};\n"],"names":["name","init","$","importLocale","svgEditor","_this","import","curPrefs","lang","strings","svgCanvas","canvas","svgicons","buttons","id","icon","type","title","events","click","setMode","mouseDown","getMode","started","mouseUp","opts","zoom","getZoom","x","mouse_x","y","mouse_y","text","forEach","prop","val","replace","alert"],"mappings":";;;;;;;;gIAcA,MAAe,CACbA,KAAM,aACAC,udAAOC,IAAAA,IAAGC,aACRC,EAAYC,WAEeC,0BAAmBF,EAAUG,SAASC,oCAAvDC,YACVC,EAAYN,EAAUO,yBACrB,CACLX,KAAMS,EAAQT,KAGdY,SAAU,sBAGVC,QAAS,CAAC,CAERC,GAAI,cAGJC,KAAM,iBAINC,KAAM,OAGNC,MAAOR,EAAQI,QAAQ,GAAGI,MAG1BC,OAAQ,CACNC,uBAIET,EAAUU,QAAQ,mBAMxBC,kCAE8B,gBAAxBX,EAAUY,gBAGL,CAACC,SAAS,IAOrBC,yBAASC,MAEqB,gBAAxBf,EAAUY,UAA6B,KACnCI,EAAOhB,EAAUiB,UAGjBC,EAAIH,EAAKI,QAAUH,EACnBI,EAAIL,EAAKM,QAAUL,EAGpBM,EAAQvB,EAARuB,MAEH,CAAC,IAAKJ,GACN,CAAC,IAAKE,IACNG,SAAQ,sCAAEC,OAAMC,OAChBH,EAAOA,EAAKI,QAAQ,IAAMF,EAAO,IAAKC,MAIxCjC,EAAEmC,MAAML"}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1 +0,0 @@
|
|||
export 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 @@
|
|||
export 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 @@
|
|||
export default{name:"箭头",langList:[{id:"arrow_none",textContent:"无箭头"}],contextTools:[{title:"选择箭头类型",options:{none:"无箭头",end:"---->",start:"<----",both:"<--->",mid:"-->--",mid_bk:"--<--"}}]};
|
|
@ -1 +0,0 @@
|
|||
export default{name:"ClosePath",buttons:[{title:"Open path"},{title:"Close path"}]};
|
|
@ -1 +0,0 @@
|
|||
export default{name:"闭合路径",buttons:[{title:"打开路径"},{title:"关闭路径"}]};
|
|
@ -1 +0,0 @@
|
|||
export default{name:"Connector",langList:[{id:"mode_connect",title:"Connect two objects"}],buttons:[{title:"Connect two objects"}]};
|
|
@ -1 +0,0 @@
|
|||
export default{name:"Connector",langList:[{id:"mode_connect",title:"Connecter deux objets"}],buttons:[{title:"Connect two objects"}]};
|
|
@ -1 +0,0 @@
|
|||
export default{name:"连接器",langList:[{id:"mode_connect",title:"连接两个对象"}],buttons:[{title:"连接两个对象"}]};
|
|
@ -1 +0,0 @@
|
|||
export default{name:"eyedropper",buttons:[{title:"Eye Dropper Tool",key:"I"}]};
|
|
@ -1 +0,0 @@
|
|||
export default{name:"滴管",buttons:[{title:"滴管工具",key:"I"}]};
|
|
@ -1 +0,0 @@
|
|||
export 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 @@
|
|||
export default{name:"外部对象",buttons:[{title:"外部对象工具"},{title:"编辑外部对象内容"}],contextTools:[{title:"改变外部对象宽度",label:"w"},{title:"改变外部对象高度",label:"h"},{title:"改变外部对象文字大小",label:"文字大小"}]};
|
|
@ -1 +0,0 @@
|
|||
export default{name:"View Grid",buttons:[{title:"Show/Hide Grid"}]};
|
|
@ -1 +0,0 @@
|
|||
export default{name:"网格视图",buttons:[{title:"显示/隐藏网格"}]};
|
|
@ -1 +0,0 @@
|
|||
export default{name:"Hello World",text:"Hello World!\n\nYou clicked here: {x}, {y}",buttons:[{title:"Say 'Hello World'"}]};
|
|
@ -1 +0,0 @@
|
|||
export default{name:"Hello World",text:"Hello World!\n\n 请点击: {x}, {y}",buttons:[{title:"输出 'Hello World'"}]};
|
|
@ -1 +0,0 @@
|
|||
export 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 @@
|
|||
export 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 @@
|
|||
export 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 @@
|
|||
export 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 @@
|
|||
export 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 @@
|
|||
export 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 @@
|
|||
export 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 @@
|
|||
export 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 @@
|
|||
export 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 @@
|
|||
export 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 @@
|
|||
export 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 @@
|
|||
export default{name:"MathJax",buttons:[{title:"Add Mathematics"}]};
|
|
@ -1 +0,0 @@
|
|||
export default{name:"数学",buttons:[{title:"添加数学计算"}]};
|
|
@ -1 +0,0 @@
|
|||
export default{name:"Extension Panning",buttons:[{title:"Panning"}]};
|
|
@ -1 +0,0 @@
|
|||
export default{name:"移动",buttons:[{title:"移动"}]};
|
|
@ -1 +0,0 @@
|
|||
export 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 @@
|
|||
export default{name:"polygon",buttons:[{title:"Polygon Tool"}],contextTools:[{title:"Number of Sides",label:"sides"}]};
|
|
@ -1 +0,0 @@
|
|||
export default{name:"多边形",buttons:[{title:"多边形工具"}],contextTools:[{title:"边数",label:"边数"}]};
|
|
@ -1 +0,0 @@
|
|||
export default{saved:"Saved! Return to Item View!",hiddenframe:"Moinsave frame to store hidden values"};
|
|
@ -1 +0,0 @@
|
|||
export default{saved:"已保存! 返回视图!",hiddenframe:"Moinsave frame to store hidden values"};
|
|
@ -1 +0,0 @@
|
|||
export default{uploading:"Uploading...",hiddenframe:"Opensave frame to store hidden values"};
|
|
@ -1 +0,0 @@
|
|||
export default{uploading:"正在上传...",hiddenframe:"Opensave frame to store hidden values"};
|
|
@ -1 +0,0 @@
|
|||
export 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 @@
|
|||
export 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 @@
|
|||
export 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 @@
|
|||
export 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 @@
|
|||
export default{name:"星形",buttons:[{title:"星形工具"}],contextTools:[{title:"顶点",label:"顶点"},{title:"钝度",label:"钝度"},{title:"径向",label:"径向"}]};
|
|
@ -1 +0,0 @@
|
|||
export 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 @@
|
|||
export 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 @@
|
|||
export 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 @@
|
|||
export default{message:"默认情况下, SVG-Edit 在本地保存配置参数和画布内容. 如果基于隐私考虑, 您可以勾选以下选项修改配置.",storagePrefsAndContent:"本地存储配置参数和SVG图",storagePrefsOnly:"本地只存储配置参数",storagePrefs:"本地存储配置参数",storageNoPrefsOrContent:"本地不保存配置参数和SVG图",storageNoPrefs:"本地不保存配置参数",rememberLabel:"记住选择?",rememberTooltip:"如果您勾选记住选择,将不再弹出本窗口."};
|
|
@ -1 +0,0 @@
|
|||
export default{name:"WebAppFind",buttons:[{title:"Save Image back to Disk"}]};
|
|
@ -1 +0,0 @@
|
|||
export default{name:"WebAppFind",buttons:[{title:"保存图片到磁盘"}]};
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,11 +0,0 @@
|
|||
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),l=s.value}catch(e){return void a(e)}s.done?t(l):Promise.resolve(l).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
|
||||
*
|
||||
*/
|
||||
var e={name:"mathjax",init:function init(e){var t=this;return _asyncToGenerator(regeneratorRuntime.mark((function _callee2(){var a,n,r,o,i,s,l,c,u,h,m,d;return regeneratorRuntime.wrap((function _callee2$(x){for(;;)switch(x.prev=x.next){case 0:return m=function _saveMath(){var e=a("#mathjax_code_textarea").val();MathJax.Hub.queue.Push(["Text",l,"\\displaystyle{"+e+"}"]),MathJax.Hub.queue.Push((function(){var e=a(".MathJax_SVG"),t=a(e.html());t.find("use").each((function(){var e=a(this).attr("href")?a(this).attr("href").slice(1):a(this).attr("xlink:href").slice(1),t=a("#"+e).clone().removeAttr("id"),n=a(this).attr("x"),r=a(this).attr("y"),o=a(this).attr("transform");o&&(n||r)?t.attr("transform",o+" translate("+n+","+r+")"):o?t.attr("transform",o):(n||r)&&t.attr("transform","translate("+n+","+r+")"),a(this).replaceWith(t)})),t.removeAttr("style"),t.attr("xmlns","http://www.w3.org/2000/svg"),i.importSvgString(a("<div>").append(t.clone()).html(),!0),i.ungroupSelectedElement(),i.moveSelectedElements(c,u,!0)}))},a=e.$,n=e.importLocale,x.next=4,n();case 4:return r=x.sent,i=(o=t).canvas,"mathjax/MathJax.min.js?config=TeX-AMS-MML_SVG.js",s=o.uiStrings,h=!1,a.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"}}),d=[{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(i.setMode("mathjax"),!1!==h){e.next=17;break}return a('<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(),a("#mathjax_container").draggable({cancel:"button,fieldset",containment:"window"}),a("#tool_mathjax_cancel").prepend(a.getSvgIcon("cancel",!0)).on("click touched",(function(){a("#mathjax").hide()})),a("#tool_mathjax_save").prepend(a.getSvgIcon("ok",!0)).on("click touched",(function(){m(),a("#mathjax").hide()})),a("body").addClass("tex2jax_ignore"),e.prev=7,e.next=10,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),h=!0,console.log("MathJax Loaded")})),e.next=17;break;case 13:e.prev=13,e.t0=e.catch(7),console.log("Failed loading MathJax."),a.alert("Failed loading MathJax. You will not be able to change the mathematics.");case 17:case"end":return e.stop()}}),_callee,null,[[7,13]])})))()}}}],x.abrupt("return",{name:r.name,svgicons:"mathjax-icons.xml",buttons:r.buttons.map((function(e,t){return Object.assign(d[t],e)})),mouseDown:function mouseDown(){if("mathjax"===i.getMode())return{started:!0}},mouseUp:function mouseUp(e){if("mathjax"===i.getMode()){var t=i.getZoom();return c=e.mouse_x/t,u=e.mouse_y/t,a("#mathjax").show(),{started:!1}}},callback:function callback(){a("<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 x.stop()}}),_callee2)})))()}};export default e;
|
||||
//# sourceMappingURL=ext-mathjax.js.map
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,10 @@
|
|||
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
|
||||
*
|
||||
*/var e={name:"mathjax",init:function init(e){var t=this;return _asyncToGenerator(regeneratorRuntime.mark((function _callee2(){var a,n,o,r,i,l,s,c,h,m,d,u;return regeneratorRuntime.wrap((function _callee2$(x){for(;;)switch(x.prev=x.next){case 0:return d=function _saveMath(){var e=a("#mathjax_code_textarea").val();MathJax.Hub.queue.Push(["Text",s,"\\displaystyle{"+e+"}"]),MathJax.Hub.queue.Push((function(){var e=a(".MathJax_SVG"),t=a(e.html());t.find("use").each((function(){var e=a(this).attr("href")?a(this).attr("href").slice(1):a(this).attr("xlink:href").slice(1),t=a("#"+e).clone().removeAttr("id"),n=a(this).attr("x"),o=a(this).attr("y"),r=a(this).attr("transform");r&&(n||o)?t.attr("transform",r+" translate("+n+","+o+")"):r?t.attr("transform",r):(n||o)&&t.attr("transform","translate("+n+","+o+")"),a(this).replaceWith(t)})),t.removeAttr("style"),t.attr("xmlns","http://www.w3.org/2000/svg"),i.importSvgString(a("<div>").append(t.clone()).html(),!0),i.ungroupSelectedElement(),i.moveSelectedElements(c,h,!0)}))},a=e.$,n=t,x.next=5,import("./locale/".concat(n.curPrefs.lang,".js"));case 5:return o=x.sent,r=o.default,i=n.canvas,"mathjax/MathJax.min.js?config=TeX-AMS-MML_SVG.js",l=n.uiStrings,m=!1,a.extend(l,{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"}}),u=[{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(i.setMode("mathjax"),!1!==m){e.next=17;break}return a('<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(),a("#mathjax_container").draggable({cancel:"button,fieldset",containment:"window"}),a("#tool_mathjax_cancel").prepend(a.getSvgIcon("cancel",!0)).on("click touched",(function(){a("#mathjax").hide()})),a("#tool_mathjax_save").prepend(a.getSvgIcon("ok",!0)).on("click touched",(function(){d(),a("#mathjax").hide()})),a("body").addClass("tex2jax_ignore"),e.prev=7,e.next=10,import("mathjax/MathJax.min.js?config=TeX-AMS-MML_SVG.js");case 10:MathJax.Hub.queue.Push((function(){s=MathJax.Hub.getAllJax("#mathjax_creator")[0],console.log(s),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."),a.alert("Failed loading MathJax. You will not be able to change the mathematics.");case 17:case"end":return e.stop()}}),_callee,null,[[7,13]])})))()}}}],x.abrupt("return",{name:r.name,svgicons:"mathjax-icons.xml",buttons:r.buttons.map((function(e,t){return Object.assign(u[t],e)})),mouseDown:function mouseDown(){if("mathjax"===i.getMode())return{started:!0}},mouseUp:function mouseUp(e){if("mathjax"===i.getMode()){var t=i.getZoom();return c=e.mouse_x/t,h=e.mouse_y/t,a("#mathjax").show(),{started:!1}}},callback:function callback(){a("<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 x.stop()}}),_callee2)})))()}};export default e;
|
||||
//# sourceMappingURL=ext-mathjax.js.map
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,11 +0,0 @@
|
|||
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 u={key:e,arg:r,resolve:o,reject:a,next:null};t?t=t.next=u:(n=t=u,resume(e,r))}))},"function"!=typeof e.return&&(this.return=void 0)}function asyncGeneratorStep(e,n,t,r,o,a,u){try{var i=e[a](u),c=i.value}catch(e){return void t(e)}i.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
|
||||
*
|
||||
*/
|
||||
var e={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 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,u;return regeneratorRuntime.wrap((function _callee$(i){for(;;)switch(i.prev=i.next){case 0:return t=e.importLocale,i.next=3,t();case 3:return r=i.sent,a=(o=n).canvas,u=[{id:"ext-panning",icon:"panning.png",type:"mode",events:{click:function click(){a.setMode("ext-panning")}}}],i.abrupt("return",{name:r.name,svgicons:"ext-panning.xml",buttons:r.buttons.map((function(e,n){return Object.assign(u[n],e)})),mouseDown:function mouseDown(){if("ext-panning"===a.getMode())return o.setPanning(!0),{started:!0}},mouseUp:function mouseUp(){if("ext-panning"===a.getMode())return o.setPanning(!1),{keep:!1,element:null}}});case 8:case"end":return i.stop()}}),_callee)})))()}};export default e;
|
||||
//# sourceMappingURL=ext-panning.js.map
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"ext-panning.js","sources":["../../../src/editor/extensions/ext-panning.js"],"sourcesContent":["/**\n * @file ext-panning.js\n *\n * @license MIT\n *\n * @copyright 2013 Luis Aguirre\n *\n */\n/*\n This is a very basic SVG-Edit extension to let tablet/mobile devices pan without problem\n*/\n\nexport default {\n name: 'panning',\n async init ({importLocale}) {\n const strings = await importLocale();\n const svgEditor = this;\n const svgCanvas = svgEditor.canvas;\n const buttons = [{\n id: 'ext-panning',\n icon: 'panning.png',\n type: 'mode',\n events: {\n click () {\n svgCanvas.setMode('ext-panning');\n }\n }\n }];\n return {\n name: strings.name,\n svgicons: 'ext-panning.xml',\n buttons: strings.buttons.map((button, i) => {\n return Object.assign(buttons[i], button);\n }),\n mouseDown () {\n if (svgCanvas.getMode() === 'ext-panning') {\n svgEditor.setPanning(true);\n return {started: true};\n }\n return undefined;\n },\n mouseUp () {\n if (svgCanvas.getMode() === 'ext-panning') {\n svgEditor.setPanning(false);\n return {\n keep: false,\n element: null\n };\n }\n return undefined;\n }\n };\n }\n};\n"],"names":["name","init","importLocale","strings","svgCanvas","svgEditor","_this","canvas","buttons","id","icon","type","events","click","setMode","svgicons","map","button","i","Object","assign","mouseDown","getMode","setPanning","started","mouseUp","keep","element"],"mappings":";;;;;;;;;AAYA,MAAe,CACbA,KAAM,UACAC,udAAOC,IAAAA,sBACWA,kBAAhBC,SAEAC,GADAC,EAAYC,GACUC,OACtBC,EAAU,CAAC,CACfC,GAAI,cACJC,KAAM,cACNC,KAAM,OACNC,OAAQ,CACNC,uBACET,EAAUU,QAAQ,qCAIjB,CACLd,KAAMG,EAAQH,KACde,SAAU,kBACVP,QAASL,EAAQK,QAAQQ,KAAI,SAACC,EAAQC,UAC7BC,OAAOC,OAAOZ,EAAQU,GAAID,MAEnCI,kCAC8B,gBAAxBjB,EAAUkB,iBACZjB,EAAUkB,YAAW,GACd,CAACC,SAAS,IAIrBC,8BAC8B,gBAAxBrB,EAAUkB,iBACZjB,EAAUkB,YAAW,GACd,CACLG,MAAM,EACNC,QAAS"}
|
|
@ -0,0 +1,11 @@
|
|||
function asyncGeneratorStep(n,e,t,r,a,o,i){try{var c=n[o](i),u=c.value}catch(n){return void t(n)}c.done?e(u):Promise.resolve(u).then(r,a)}
|
||||
/**
|
||||
* @file ext-panning.js
|
||||
*
|
||||
* @license MIT
|
||||
*
|
||||
* @copyright 2013 Luis Aguirre
|
||||
*
|
||||
*/
|
||||
var n={name:"panning",init:function init(n){var e=this;return function _asyncToGenerator(n){return function(){var e=this,t=arguments;return new Promise((function(r,a){var o=n.apply(e,t);function _next(n){asyncGeneratorStep(o,r,a,_next,_throw,"next",n)}function _throw(n){asyncGeneratorStep(o,r,a,_next,_throw,"throw",n)}_next(void 0)}))}}(regeneratorRuntime.mark((function _callee(){var t,r,a,o,i;return regeneratorRuntime.wrap((function _callee$(c){for(;;)switch(c.prev=c.next){case 0:return n.importLocale,t=e,c.next=4,import("./locale/".concat(t.curPrefs.lang,".js"));case 4:return r=c.sent,a=r.default,o=t.canvas,i=[{id:"ext-panning",icon:"panning.png",type:"mode",events:{click:function click(){o.setMode("ext-panning")}}}],c.abrupt("return",{name:a.name,svgicons:"ext-panning.xml",buttons:a.buttons.map((function(n,e){return Object.assign(i[e],n)})),mouseDown:function mouseDown(){if("ext-panning"===o.getMode())return t.setPanning(!0),{started:!0}},mouseUp:function mouseUp(){if("ext-panning"===o.getMode())return t.setPanning(!1),{keep:!1,element:null}}});case 9:case"end":return c.stop()}}),_callee)})))()}};export default n;
|
||||
//# sourceMappingURL=ext-panning.js.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"ext-panning.js","sources":["../../../../src/editor/extensions/ext-panning/ext-panning.js"],"sourcesContent":["/**\n * @file ext-panning.js\n *\n * @license MIT\n *\n * @copyright 2013 Luis Aguirre\n *\n */\n/*\n This is a very basic SVG-Edit extension to let tablet/mobile devices pan without problem\n*/\n\nexport default {\n name: 'panning',\n async init ({importLocale}) {\n const svgEditor = this;\n // eslint-disable-next-line node/no-unsupported-features/es-syntax\n const {default: strings} = await import(`./locale/${svgEditor.curPrefs.lang}.js`);\n const svgCanvas = svgEditor.canvas;\n const buttons = [{\n id: 'ext-panning',\n icon: 'panning.png',\n type: 'mode',\n events: {\n click () {\n svgCanvas.setMode('ext-panning');\n }\n }\n }];\n return {\n name: strings.name,\n svgicons: 'ext-panning.xml',\n buttons: strings.buttons.map((button, i) => {\n return Object.assign(buttons[i], button);\n }),\n mouseDown () {\n if (svgCanvas.getMode() === 'ext-panning') {\n svgEditor.setPanning(true);\n return {started: true};\n }\n return undefined;\n },\n mouseUp () {\n if (svgCanvas.getMode() === 'ext-panning') {\n svgEditor.setPanning(false);\n return {\n keep: false,\n element: null\n };\n }\n return undefined;\n }\n };\n }\n};\n"],"names":["name","init","importLocale","svgEditor","_this","import","curPrefs","lang","strings","svgCanvas","canvas","buttons","id","icon","type","events","click","setMode","svgicons","map","button","i","Object","assign","mouseDown","getMode","setPanning","started","mouseUp","keep","element"],"mappings":";;;;;;;;;AAYA,MAAe,CACbA,KAAM,UACAC,ydAAOC,aACLC,EAAYC,WAEeC,0BAAmBF,EAAUG,SAASC,oCAAvDC,YACVC,EAAYN,EAAUO,OACtBC,EAAU,CAAC,CACfC,GAAI,cACJC,KAAM,cACNC,KAAM,OACNC,OAAQ,CACNC,uBACEP,EAAUQ,QAAQ,qCAIjB,CACLjB,KAAMQ,EAAQR,KACdkB,SAAU,kBACVP,QAASH,EAAQG,QAAQQ,KAAI,SAACC,EAAQC,UAC7BC,OAAOC,OAAOZ,EAAQU,GAAID,MAEnCI,kCAC8B,gBAAxBf,EAAUgB,iBACZtB,EAAUuB,YAAW,GACd,CAACC,SAAS,IAIrBC,8BAC8B,gBAAxBnB,EAAUgB,iBACZtB,EAAUuB,YAAW,GACd,CACLG,MAAM,EACNC,QAAS"}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue