diff --git a/.eslintrc.js b/.eslintrc.js index 93a3cbb5..2558a110 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -144,7 +144,6 @@ module.exports = { complexity: ["off"], "default-case": ["off"], "require-unicode-regexp": ["off"], - "no-console": ["off"], "no-magic-numbers": ["off"], "no-warning-comments": ["off"], "max-len": ["off", { diff --git a/CHANGES.md b/CHANGES.md index 92ba234e..d4c04b5e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,8 +2,8 @@ # ? -- l10n: Add Chinese (simplified) extension locales (Thanks, @enlove!) -- Linting (ESLint): Avoid reporting `no-console` +- Fix: Problem with retaining lines with grid mode (@NeiroNx) +- l10n: Add Chinese (simplified) extension locales (@enlove) - Refactoring: Avoid Firefox console errors with hidden iframe ## 4.1.0 diff --git a/dist/extensions/ext-arrows.js b/dist/extensions/ext-arrows.js index 94908b34..ce286777 100644 --- a/dist/extensions/ext-arrows.js +++ b/dist/extensions/ext-arrows.js @@ -352,9 +352,11 @@ var svgEditorExtension_arrows = (function () { }, _callee, this); })); - return function addLangData(_x2) { + function addLangData(_x2) { return _addLangData.apply(this, arguments); - }; + } + + return addLangData; }(), selectedChanged: function selectedChanged(opts) { // Use this to update the current selected elements @@ -397,9 +399,11 @@ var svgEditorExtension_arrows = (function () { }, _callee2, this); })); - return function init(_x) { + function init(_x) { return _init.apply(this, arguments); - }; + } + + return init; }() }; diff --git a/dist/extensions/ext-closepath.js b/dist/extensions/ext-closepath.js index 39a84fd7..92f67eb3 100644 --- a/dist/extensions/ext-closepath.js +++ b/dist/extensions/ext-closepath.js @@ -162,9 +162,11 @@ var svgEditorExtension_closepath = (function () { }, _callee, this); })); - return function init(_x) { + function init(_x) { return _init.apply(this, arguments); - }; + } + + return init; }() }; diff --git a/dist/extensions/ext-connector.js b/dist/extensions/ext-connector.js index 86c8b48b..3fbedc65 100644 --- a/dist/extensions/ext-connector.js +++ b/dist/extensions/ext-connector.js @@ -686,9 +686,11 @@ var svgEditorExtension_connector = (function () { }, _callee, this); })); - return function init(_x) { + function init(_x) { return _init.apply(this, arguments); - }; + } + + return init; }() }; diff --git a/dist/extensions/ext-eyedropper.js b/dist/extensions/ext-eyedropper.js index 54c3f314..39dee302 100644 --- a/dist/extensions/ext-eyedropper.js +++ b/dist/extensions/ext-eyedropper.js @@ -195,9 +195,11 @@ var svgEditorExtension_eyedropper = (function () { }, _callee, this); })); - return function init(_x) { + function init(_x) { return _init.apply(this, arguments); - }; + } + + return init; }() }; diff --git a/dist/extensions/ext-foreignobject.js b/dist/extensions/ext-foreignobject.js index 702acb74..88c7acc0 100644 --- a/dist/extensions/ext-foreignobject.js +++ b/dist/extensions/ext-foreignobject.js @@ -359,9 +359,11 @@ var svgEditorExtension_foreignobject = (function () { }, _callee2, this); })); - return function init(_x) { + function init(_x) { return _init.apply(this, arguments); - }; + } + + return init; }() }; diff --git a/dist/extensions/ext-grid.js b/dist/extensions/ext-grid.js index 35d10720..ff1afa2f 100644 --- a/dist/extensions/ext-grid.js +++ b/dist/extensions/ext-grid.js @@ -140,8 +140,9 @@ var svgEditorExtension_grid = (function () { overflow: 'visible', display: 'none' }); - canvBG.append(canvasGrid); // grid-pattern - gridDefs = svgdoc.createElementNS(NS.SVG, 'defs'); + canvBG.append(canvasGrid); + gridDefs = svgdoc.createElementNS(NS.SVG, 'defs'); // grid-pattern + gridPattern = svgdoc.createElementNS(NS.SVG, 'pattern'); assignAttributes(gridPattern, { id: 'gridpattern', @@ -212,7 +213,7 @@ var svgEditorExtension_grid = (function () { }) }); - case 25: + case 27: case "end": return _context.stop(); } @@ -220,9 +221,11 @@ var svgEditorExtension_grid = (function () { }, _callee, this); })); - return function init(_x) { + function init(_x) { return _init.apply(this, arguments); - }; + } + + return init; }() }; diff --git a/dist/extensions/ext-helloworld.js b/dist/extensions/ext-helloworld.js index 72146cc7..709aadc5 100644 --- a/dist/extensions/ext-helloworld.js +++ b/dist/extensions/ext-helloworld.js @@ -180,9 +180,11 @@ var svgEditorExtension_helloworld = (function () { }, _callee, this); })); - return function init(_x) { + function init(_x) { return _init.apply(this, arguments); - }; + } + + return init; }() }; diff --git a/dist/extensions/ext-imagelib.js b/dist/extensions/ext-imagelib.js index b3ac4657..aa2a2307 100644 --- a/dist/extensions/ext-imagelib.js +++ b/dist/extensions/ext-imagelib.js @@ -573,9 +573,11 @@ var svgEditorExtension_imagelib = (function () { }, _callee2, this); })); - return function init(_x) { + function init(_x) { return _init.apply(this, arguments); - }; + } + + return init; }() }; diff --git a/dist/extensions/ext-locale/arrows/zh-CN.js b/dist/extensions/ext-locale/arrows/zh-CN.js new file mode 100644 index 00000000..cb9286a6 --- /dev/null +++ b/dist/extensions/ext-locale/arrows/zh-CN.js @@ -0,0 +1,25 @@ +var svgEditorExtensionLocale_arrows_zh_CN = (function () { + 'use strict'; + + var zhCN = { + name: '箭头', + langList: [{ + id: 'arrow_none', + textContent: '无箭头' + }], + contextTools: [{ + title: '选择箭头类型', + options: { + none: '无箭头', + end: '---->', + start: '<----', + both: '<--->', + mid: '-->--', + mid_bk: '--<--' + } + }] + }; + + return zhCN; + +}()); diff --git a/dist/extensions/ext-locale/closepath/zh-CN.js b/dist/extensions/ext-locale/closepath/zh-CN.js new file mode 100644 index 00000000..fa9f1a3b --- /dev/null +++ b/dist/extensions/ext-locale/closepath/zh-CN.js @@ -0,0 +1,15 @@ +var svgEditorExtensionLocale_closepath_zh_CN = (function () { + 'use strict'; + + var zhCN = { + name: '闭合路径', + buttons: [{ + title: '打开路径' + }, { + title: '关闭路径' + }] + }; + + return zhCN; + +}()); diff --git a/dist/extensions/ext-locale/connector/zh-CN.js b/dist/extensions/ext-locale/connector/zh-CN.js new file mode 100644 index 00000000..19c812d3 --- /dev/null +++ b/dist/extensions/ext-locale/connector/zh-CN.js @@ -0,0 +1,17 @@ +var svgEditorExtensionLocale_connector_zh_CN = (function () { + 'use strict'; + + var zhCN = { + name: '连接器', + langList: [{ + id: 'mode_connect', + title: '连接两个对象' + }], + buttons: [{ + title: '连接两个对象' + }] + }; + + return zhCN; + +}()); diff --git a/dist/extensions/ext-locale/eyedropper/zh-CN.js b/dist/extensions/ext-locale/eyedropper/zh-CN.js new file mode 100644 index 00000000..2ccb17cd --- /dev/null +++ b/dist/extensions/ext-locale/eyedropper/zh-CN.js @@ -0,0 +1,14 @@ +var svgEditorExtensionLocale_eyedropper_zh_CN = (function () { + 'use strict'; + + var zhCN = { + name: '滴管', + buttons: [{ + title: '滴管工具', + key: 'I' + }] + }; + + return zhCN; + +}()); diff --git a/dist/extensions/ext-locale/foreignobject/zh-CN.js b/dist/extensions/ext-locale/foreignobject/zh-CN.js new file mode 100644 index 00000000..99fa9f63 --- /dev/null +++ b/dist/extensions/ext-locale/foreignobject/zh-CN.js @@ -0,0 +1,25 @@ +var svgEditorExtensionLocale_foreignobject_zh_CN = (function () { + 'use strict'; + + var zhCN = { + name: '外部对象', + buttons: [{ + title: '外部对象工具' + }, { + title: '编辑外部对象内容' + }], + contextTools: [{ + title: '改变外部对象宽度', + label: 'w' + }, { + title: '改变外部对象高度', + label: 'h' + }, { + title: '改变外部对象文字大小', + label: '文字大小' + }] + }; + + return zhCN; + +}()); diff --git a/dist/extensions/ext-locale/grid/zh-CN.js b/dist/extensions/ext-locale/grid/zh-CN.js new file mode 100644 index 00000000..829fac4e --- /dev/null +++ b/dist/extensions/ext-locale/grid/zh-CN.js @@ -0,0 +1,13 @@ +var svgEditorExtensionLocale_grid_zh_CN = (function () { + 'use strict'; + + var zhCN = { + name: '网格视图', + buttons: [{ + title: '显示/隐藏网格' + }] + }; + + return zhCN; + +}()); diff --git a/dist/extensions/ext-locale/helloworld/zh-CN.js b/dist/extensions/ext-locale/helloworld/zh-CN.js new file mode 100644 index 00000000..1fee497b --- /dev/null +++ b/dist/extensions/ext-locale/helloworld/zh-CN.js @@ -0,0 +1,14 @@ +var svgEditorExtensionLocale_helloworld_zh_CN = (function () { + 'use strict'; + + var zhCN = { + name: 'Hello World', + text: 'Hello World!\n\n 请点击: {x}, {y}', + buttons: [{ + title: "输出 'Hello World'" + }] + }; + + return zhCN; + +}()); diff --git a/dist/extensions/ext-locale/markers/zh-CN.js b/dist/extensions/ext-locale/markers/zh-CN.js new file mode 100644 index 00000000..3f86f2f1 --- /dev/null +++ b/dist/extensions/ext-locale/markers/zh-CN.js @@ -0,0 +1,81 @@ +var svgEditorExtensionLocale_markers_zh_CN = (function () { + 'use strict'; + + var zhCN = { + 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: '选择末端标记类型' + }] + }; + + return zhCN; + +}()); diff --git a/dist/extensions/ext-locale/mathjax/zh-CN.js b/dist/extensions/ext-locale/mathjax/zh-CN.js new file mode 100644 index 00000000..372d3710 --- /dev/null +++ b/dist/extensions/ext-locale/mathjax/zh-CN.js @@ -0,0 +1,13 @@ +var svgEditorExtensionLocale_mathjax_zh_CN = (function () { + 'use strict'; + + var zhCN = { + name: '数学', + buttons: [{ + title: '添加数学计算' + }] + }; + + return zhCN; + +}()); diff --git a/dist/extensions/ext-locale/panning/zh-CN.js b/dist/extensions/ext-locale/panning/zh-CN.js new file mode 100644 index 00000000..dcc266c5 --- /dev/null +++ b/dist/extensions/ext-locale/panning/zh-CN.js @@ -0,0 +1,13 @@ +var svgEditorExtensionLocale_panning_zh_CN = (function () { + 'use strict'; + + var zhCN = { + name: '移动', + buttons: [{ + title: '移动' + }] + }; + + return zhCN; + +}()); diff --git a/dist/extensions/ext-locale/polygon/zh-CN.js b/dist/extensions/ext-locale/polygon/zh-CN.js new file mode 100644 index 00000000..2afc4ec9 --- /dev/null +++ b/dist/extensions/ext-locale/polygon/zh-CN.js @@ -0,0 +1,17 @@ +var svgEditorExtensionLocale_polygon_zh_CN = (function () { + 'use strict'; + + var zhCN = { + name: '多边形', + buttons: [{ + title: '多边形工具' + }], + contextTools: [{ + title: '边数', + label: '边数' + }] + }; + + return zhCN; + +}()); diff --git a/dist/extensions/ext-locale/server_moinsave/zh-CN.js b/dist/extensions/ext-locale/server_moinsave/zh-CN.js new file mode 100644 index 00000000..86a47c71 --- /dev/null +++ b/dist/extensions/ext-locale/server_moinsave/zh-CN.js @@ -0,0 +1,10 @@ +var svgEditorExtensionLocale_server_moinsave_zh_CN = (function () { + 'use strict'; + + var zhCN = { + saved: '已保存! 返回视图!' + }; + + return zhCN; + +}()); diff --git a/dist/extensions/ext-locale/server_opensave/zh-CN.js b/dist/extensions/ext-locale/server_opensave/zh-CN.js new file mode 100644 index 00000000..7b10037b --- /dev/null +++ b/dist/extensions/ext-locale/server_opensave/zh-CN.js @@ -0,0 +1,10 @@ +var svgEditorExtensionLocale_server_opensave_zh_CN = (function () { + 'use strict'; + + var zhCN = { + uploading: '正在上传...' + }; + + return zhCN; + +}()); diff --git a/dist/extensions/ext-locale/shapes/zh-CN.js b/dist/extensions/ext-locale/shapes/zh-CN.js new file mode 100644 index 00000000..215ab2c6 --- /dev/null +++ b/dist/extensions/ext-locale/shapes/zh-CN.js @@ -0,0 +1,29 @@ +var svgEditorExtensionLocale_shapes_zh_CN = (function () { + 'use strict'; + + var zhCN = { + 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: '图元库' + }] + }; + + return zhCN; + +}()); diff --git a/dist/extensions/ext-locale/star/zh-CN.js b/dist/extensions/ext-locale/star/zh-CN.js new file mode 100644 index 00000000..cda4d8a2 --- /dev/null +++ b/dist/extensions/ext-locale/star/zh-CN.js @@ -0,0 +1,23 @@ +var svgEditorExtensionLocale_star_zh_CN = (function () { + 'use strict'; + + var zhCN = { + name: '星形', + buttons: [{ + title: '星形工具' + }], + contextTools: [{ + title: '顶点', + label: '顶点' + }, { + title: '钝度', + label: '钝度' + }, { + title: '径向', + label: '径向' + }] + }; + + return zhCN; + +}()); diff --git a/dist/extensions/ext-locale/storage/zh-CN.js b/dist/extensions/ext-locale/storage/zh-CN.js new file mode 100644 index 00000000..b5c12eb2 --- /dev/null +++ b/dist/extensions/ext-locale/storage/zh-CN.js @@ -0,0 +1,17 @@ +var svgEditorExtensionLocale_storage_zh_CN = (function () { + 'use strict'; + + var zhCN = { + message: '默认情况下, SVG-Edit 在本地保存配置参数和画布内容. 如果基于隐私考虑, ' + '您可以勾选以下选项修改配置.', + storagePrefsAndContent: '本地存储配置参数和SVG图', + storagePrefsOnly: '本地只存储配置参数', + storagePrefs: '本地存储配置参数', + storageNoPrefsOrContent: '本地不保存配置参数和SVG图', + storageNoPrefs: '本地不保存配置参数', + rememberLabel: '记住选择?', + rememberTooltip: '如果您勾选记住选择,将不再弹出本窗口.' + }; + + return zhCN; + +}()); diff --git a/dist/extensions/ext-locale/webappfind/zh-CN.js b/dist/extensions/ext-locale/webappfind/zh-CN.js new file mode 100644 index 00000000..bb8fd461 --- /dev/null +++ b/dist/extensions/ext-locale/webappfind/zh-CN.js @@ -0,0 +1,13 @@ +var svgEditorExtensionLocale_webappfind_zh_CN = (function () { + 'use strict'; + + var zhCN = { + name: 'WebAppFind', + buttons: [{ + title: '保存图片到磁盘' + }] + }; + + return zhCN; + +}()); diff --git a/dist/extensions/ext-markers.js b/dist/extensions/ext-markers.js index 50537c7a..1c42bdda 100644 --- a/dist/extensions/ext-markers.js +++ b/dist/extensions/ext-markers.js @@ -759,9 +759,11 @@ var svgEditorExtension_markers = (function () { }, _callee3, this); })); - return function init(_x) { + function init(_x) { return _init.apply(this, arguments); - }; + } + + return init; }() }; diff --git a/dist/extensions/ext-mathjax.js b/dist/extensions/ext-mathjax.js index ab2e9f4d..c3e1a95d 100644 --- a/dist/extensions/ext-mathjax.js +++ b/dist/extensions/ext-mathjax.js @@ -309,9 +309,11 @@ var svgEditorExtension_mathjax = (function () { }, _callee, this, [[7, 13]]); })); - return function click() { + function click() { return _click.apply(this, arguments); - }; + } + + return click; }() } }]; @@ -359,9 +361,11 @@ var svgEditorExtension_mathjax = (function () { }, _callee2, this); })); - return function init(_x) { + function init(_x) { return _init.apply(this, arguments); - }; + } + + return init; }() }; diff --git a/dist/extensions/ext-panning.js b/dist/extensions/ext-panning.js index e2f6a987..7ea9eb9c 100644 --- a/dist/extensions/ext-panning.js +++ b/dist/extensions/ext-panning.js @@ -115,9 +115,11 @@ var svgEditorExtension_panning = (function () { }, _callee, this); })); - return function init(_x) { + function init(_x) { return _init.apply(this, arguments); - }; + } + + return init; }() }; diff --git a/dist/extensions/ext-polygon.js b/dist/extensions/ext-polygon.js index 87a0ab0d..3bb2ff47 100644 --- a/dist/extensions/ext-polygon.js +++ b/dist/extensions/ext-polygon.js @@ -301,9 +301,11 @@ var svgEditorExtension_polygon = (function () { }, _callee, this); })); - return function init(_x) { + function init(_x) { return _init.apply(this, arguments); - }; + } + + return init; }() }; diff --git a/dist/extensions/ext-server_moinsave.js b/dist/extensions/ext-server_moinsave.js index 7622b7ca..0402b869 100644 --- a/dist/extensions/ext-server_moinsave.js +++ b/dist/extensions/ext-server_moinsave.js @@ -4861,10 +4861,12 @@ var svgEditorExtension_server_moinsave = (function () { svgEditor = this; svgCanvas = svgEditor.canvas; saveSvgAction = '/+modify'; // Create upload target (hidden iframe) + // Hiding by size instead of display to avoid FF console errors + // with `getBBox` in browser.js `supportsPathBBox_`) /* const target = */ - $('