- Linting: Add `ignore` folder to ignore file; ensure license versions are valid semver
- npm: Update devDepsmaster
parent
d808cc22de
commit
a09c47283e
|
@ -1,4 +1,5 @@
|
|||
node_modules
|
||||
ignore
|
||||
|
||||
dist
|
||||
docs/jsdoc
|
||||
|
|
|
@ -15,42 +15,6 @@ var canvg = (function (exports) {
|
|||
return _typeof(obj);
|
||||
}
|
||||
|
||||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
||||
try {
|
||||
var info = gen[key](arg);
|
||||
var value = info.value;
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.done) {
|
||||
resolve(value);
|
||||
} else {
|
||||
Promise.resolve(value).then(_next, _throw);
|
||||
}
|
||||
}
|
||||
|
||||
function _asyncToGenerator(fn) {
|
||||
return function () {
|
||||
var self = this,
|
||||
args = arguments;
|
||||
return new Promise(function (resolve, reject) {
|
||||
var gen = fn.apply(self, args);
|
||||
|
||||
function _next(value) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
||||
}
|
||||
|
||||
function _throw(err) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
||||
}
|
||||
|
||||
_next(undefined);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function _classCallCheck(instance, Constructor) {
|
||||
if (!(instance instanceof Constructor)) {
|
||||
throw new TypeError("Cannot call a class as a function");
|
||||
|
@ -4684,19 +4648,14 @@ var canvg = (function (exports) {
|
|||
}; // load from url
|
||||
|
||||
|
||||
svg.load =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
var _ref12 = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee(ctx, url) {
|
||||
svg.load = function _callee(ctx, url) {
|
||||
var dom;
|
||||
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||
return regeneratorRuntime.async(function _callee$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
_context.next = 2;
|
||||
return svg.ajax(url, true);
|
||||
return regeneratorRuntime.awrap(svg.ajax(url, true));
|
||||
|
||||
case 2:
|
||||
dom = _context.sent;
|
||||
|
@ -4707,13 +4666,8 @@ var canvg = (function (exports) {
|
|||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
|
||||
return function (_x2, _x3) {
|
||||
return _ref12.apply(this, arguments);
|
||||
};
|
||||
}(); // load from xml
|
||||
});
|
||||
}; // load from xml
|
||||
|
||||
|
||||
svg.loadXml = function (ctx, xml) {
|
||||
|
@ -4934,9 +4888,9 @@ var canvg = (function (exports) {
|
|||
checkPath: function checkPath(element, ctx) {
|
||||
var _this26 = this;
|
||||
|
||||
this.events.forEach(function (_ref13, i) {
|
||||
var x = _ref13.x,
|
||||
y = _ref13.y;
|
||||
this.events.forEach(function (_ref12, i) {
|
||||
var x = _ref12.x,
|
||||
y = _ref12.y;
|
||||
|
||||
if (ctx.isPointInPath && ctx.isPointInPath(x, y)) {
|
||||
_this26.eventElements[i] = element;
|
||||
|
@ -4946,9 +4900,9 @@ var canvg = (function (exports) {
|
|||
checkBoundingBox: function checkBoundingBox(element, bb) {
|
||||
var _this27 = this;
|
||||
|
||||
this.events.forEach(function (_ref14, i) {
|
||||
var x = _ref14.x,
|
||||
y = _ref14.y;
|
||||
this.events.forEach(function (_ref13, i) {
|
||||
var x = _ref13.x,
|
||||
y = _ref13.y;
|
||||
|
||||
if (bb.isPointInBox(x, y)) {
|
||||
_this27.eventElements[i] = element;
|
||||
|
|
|
@ -1,42 +1,6 @@
|
|||
var svgEditorExtension_arrows = (function () {
|
||||
'use strict';
|
||||
|
||||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
||||
try {
|
||||
var info = gen[key](arg);
|
||||
var value = info.value;
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.done) {
|
||||
resolve(value);
|
||||
} else {
|
||||
Promise.resolve(value).then(_next, _throw);
|
||||
}
|
||||
}
|
||||
|
||||
function _asyncToGenerator(fn) {
|
||||
return function () {
|
||||
var self = this,
|
||||
args = arguments;
|
||||
return new Promise(function (resolve, reject) {
|
||||
var gen = fn.apply(self, args);
|
||||
|
||||
function _next(value) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
||||
}
|
||||
|
||||
function _throw(err) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
||||
}
|
||||
|
||||
_next(undefined);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function _inherits(subClass, superClass) {
|
||||
if (typeof superClass !== "function" && superClass !== null) {
|
||||
throw new TypeError("Super expression must either be null or a function");
|
||||
|
@ -211,12 +175,9 @@ var svgEditorExtension_arrows = (function () {
|
|||
*/
|
||||
var extArrows = {
|
||||
name: 'arrows',
|
||||
init: function () {
|
||||
var _init = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee2(S) {
|
||||
init: function init(S) {
|
||||
var strings, svgEditor, svgCanvas, addElem, nonce, $, prefix, selElems, arrowprefix, randomizeIds, setArrowNonce, unsetArrowNonce, pathdata, getLinked, showPanel, resetMarker, addMarker, setArrow, colorChanged, contextTools;
|
||||
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
||||
return regeneratorRuntime.async(function init$(_context2) {
|
||||
while (1) {
|
||||
switch (_context2.prev = _context2.next) {
|
||||
case 0:
|
||||
|
@ -427,7 +388,7 @@ var svgEditorExtension_arrows = (function () {
|
|||
};
|
||||
|
||||
_context2.next = 10;
|
||||
return S.importLocale();
|
||||
return regeneratorRuntime.awrap(S.importLocale());
|
||||
|
||||
case 10:
|
||||
strings = _context2.sent;
|
||||
|
@ -489,19 +450,16 @@ var svgEditorExtension_arrows = (function () {
|
|||
|
||||
$('#arrow_list option')[0].id = 'connector_no_arrow';
|
||||
},
|
||||
addLangData: function () {
|
||||
var _addLangData = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee(_ref) {
|
||||
addLangData: function addLangData(_ref) {
|
||||
var lang, importLocale, _ref2, langList;
|
||||
|
||||
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||
return regeneratorRuntime.async(function addLangData$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
lang = _ref.lang, importLocale = _ref.importLocale;
|
||||
_context.next = 3;
|
||||
return importLocale();
|
||||
return regeneratorRuntime.awrap(importLocale());
|
||||
|
||||
case 3:
|
||||
_ref2 = _context.sent;
|
||||
|
@ -515,15 +473,8 @@ var svgEditorExtension_arrows = (function () {
|
|||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
|
||||
function addLangData(_x2) {
|
||||
return _addLangData.apply(this, arguments);
|
||||
}
|
||||
|
||||
return addLangData;
|
||||
}(),
|
||||
});
|
||||
},
|
||||
selectedChanged: function selectedChanged(opts) {
|
||||
// Use this to update the current selected elements
|
||||
selElems = opts.elems;
|
||||
|
@ -562,15 +513,8 @@ var svgEditorExtension_arrows = (function () {
|
|||
return _context2.stop();
|
||||
}
|
||||
}
|
||||
}, _callee2, this);
|
||||
}));
|
||||
|
||||
function init(_x) {
|
||||
return _init.apply(this, arguments);
|
||||
}, null, this);
|
||||
}
|
||||
|
||||
return init;
|
||||
}()
|
||||
};
|
||||
|
||||
return extArrows;
|
||||
|
|
|
@ -1,42 +1,6 @@
|
|||
var svgEditorExtension_closepath = (function () {
|
||||
'use strict';
|
||||
|
||||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
||||
try {
|
||||
var info = gen[key](arg);
|
||||
var value = info.value;
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.done) {
|
||||
resolve(value);
|
||||
} else {
|
||||
Promise.resolve(value).then(_next, _throw);
|
||||
}
|
||||
}
|
||||
|
||||
function _asyncToGenerator(fn) {
|
||||
return function () {
|
||||
var self = this,
|
||||
args = arguments;
|
||||
return new Promise(function (resolve, reject) {
|
||||
var gen = fn.apply(self, args);
|
||||
|
||||
function _next(value) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
||||
}
|
||||
|
||||
function _throw(err) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
||||
}
|
||||
|
||||
_next(undefined);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* ext-closepath.js
|
||||
*
|
||||
|
@ -49,18 +13,15 @@ var svgEditorExtension_closepath = (function () {
|
|||
// The button toggles whether the path is open or closed
|
||||
var extClosepath = {
|
||||
name: 'closepath',
|
||||
init: function () {
|
||||
var _init = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee(_ref) {
|
||||
init: function init(_ref) {
|
||||
var importLocale, $, strings, svgEditor, selElems, updateButton, showPanel, toggleClosed, buttons;
|
||||
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||
return regeneratorRuntime.async(function init$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
importLocale = _ref.importLocale, $ = _ref.$;
|
||||
_context.next = 3;
|
||||
return importLocale();
|
||||
return regeneratorRuntime.awrap(importLocale());
|
||||
|
||||
case 3:
|
||||
strings = _context.sent;
|
||||
|
@ -159,15 +120,8 @@ var svgEditorExtension_closepath = (function () {
|
|||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _callee, this);
|
||||
}));
|
||||
|
||||
function init(_x) {
|
||||
return _init.apply(this, arguments);
|
||||
}, null, this);
|
||||
}
|
||||
|
||||
return init;
|
||||
}()
|
||||
};
|
||||
|
||||
return extClosepath;
|
||||
|
|
|
@ -1,42 +1,6 @@
|
|||
var svgEditorExtension_connector = (function () {
|
||||
'use strict';
|
||||
|
||||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
||||
try {
|
||||
var info = gen[key](arg);
|
||||
var value = info.value;
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.done) {
|
||||
resolve(value);
|
||||
} else {
|
||||
Promise.resolve(value).then(_next, _throw);
|
||||
}
|
||||
}
|
||||
|
||||
function _asyncToGenerator(fn) {
|
||||
return function () {
|
||||
var self = this,
|
||||
args = arguments;
|
||||
return new Promise(function (resolve, reject) {
|
||||
var gen = fn.apply(self, args);
|
||||
|
||||
function _next(value) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
||||
}
|
||||
|
||||
function _throw(err) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
||||
}
|
||||
|
||||
_next(undefined);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
/* eslint-disable unicorn/no-fn-reference-in-iterator */
|
||||
|
||||
/**
|
||||
|
@ -49,12 +13,9 @@ var svgEditorExtension_connector = (function () {
|
|||
*/
|
||||
var extConnector = {
|
||||
name: 'connector',
|
||||
init: function () {
|
||||
var _init = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee(S) {
|
||||
init: function init(S) {
|
||||
var svgEditor, svgCanvas, getElem, $, svgroot, importLocale, addElem, selManager, connSel, elData, strings, startX, startY, curLine, startElem, endElem, seNs, svgcontent, started, connections, selElems, getBBintersect, getOffset, showPanel, setPoint, updateLine, findConnectors, updateConnectors, init, buttons;
|
||||
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||
return regeneratorRuntime.async(function init$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
|
@ -303,7 +264,7 @@ var svgEditorExtension_connector = (function () {
|
|||
getElem = svgCanvas.getElem;
|
||||
$ = S.$, svgroot = S.svgroot, importLocale = S.importLocale, addElem = svgCanvas.addSVGElementFromJson, selManager = S.selectorManager, connSel = '.se_connector', elData = $.data;
|
||||
_context.next = 14;
|
||||
return importLocale();
|
||||
return regeneratorRuntime.awrap(importLocale());
|
||||
|
||||
case 14:
|
||||
strings = _context.sent;
|
||||
|
@ -683,15 +644,8 @@ var svgEditorExtension_connector = (function () {
|
|||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _callee, this);
|
||||
}));
|
||||
|
||||
function init(_x) {
|
||||
return _init.apply(this, arguments);
|
||||
}, null, this);
|
||||
}
|
||||
|
||||
return init;
|
||||
}()
|
||||
};
|
||||
|
||||
return extConnector;
|
||||
|
|
|
@ -1,42 +1,6 @@
|
|||
var svgEditorExtension_eyedropper = (function () {
|
||||
'use strict';
|
||||
|
||||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
||||
try {
|
||||
var info = gen[key](arg);
|
||||
var value = info.value;
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.done) {
|
||||
resolve(value);
|
||||
} else {
|
||||
Promise.resolve(value).then(_next, _throw);
|
||||
}
|
||||
}
|
||||
|
||||
function _asyncToGenerator(fn) {
|
||||
return function () {
|
||||
var self = this,
|
||||
args = arguments;
|
||||
return new Promise(function (resolve, reject) {
|
||||
var gen = fn.apply(self, args);
|
||||
|
||||
function _next(value) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
||||
}
|
||||
|
||||
function _throw(err) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
||||
}
|
||||
|
||||
_next(undefined);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* ext-eyedropper.js
|
||||
*
|
||||
|
@ -47,12 +11,9 @@ var svgEditorExtension_eyedropper = (function () {
|
|||
*/
|
||||
var extEyedropper = {
|
||||
name: 'eyedropper',
|
||||
init: function () {
|
||||
var _init = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee(S) {
|
||||
init: function init(S) {
|
||||
var strings, svgEditor, $, ChangeElementCommand, svgCanvas, addToHistory, currentStyle, getStyle, buttons;
|
||||
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||
return regeneratorRuntime.async(function init$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
|
@ -87,7 +48,7 @@ var svgEditorExtension_eyedropper = (function () {
|
|||
};
|
||||
|
||||
_context.next = 3;
|
||||
return S.importLocale();
|
||||
return regeneratorRuntime.awrap(S.importLocale());
|
||||
|
||||
case 3:
|
||||
strings = _context.sent;
|
||||
|
@ -192,15 +153,8 @@ var svgEditorExtension_eyedropper = (function () {
|
|||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _callee, this);
|
||||
}));
|
||||
|
||||
function init(_x) {
|
||||
return _init.apply(this, arguments);
|
||||
}, null, this);
|
||||
}
|
||||
|
||||
return init;
|
||||
}()
|
||||
};
|
||||
|
||||
return extEyedropper;
|
||||
|
|
|
@ -1,42 +1,6 @@
|
|||
var svgEditorExtension_foreignobject = (function () {
|
||||
'use strict';
|
||||
|
||||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
||||
try {
|
||||
var info = gen[key](arg);
|
||||
var value = info.value;
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.done) {
|
||||
resolve(value);
|
||||
} else {
|
||||
Promise.resolve(value).then(_next, _throw);
|
||||
}
|
||||
}
|
||||
|
||||
function _asyncToGenerator(fn) {
|
||||
return function () {
|
||||
var self = this,
|
||||
args = arguments;
|
||||
return new Promise(function (resolve, reject) {
|
||||
var gen = fn.apply(self, args);
|
||||
|
||||
function _next(value) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
||||
}
|
||||
|
||||
function _throw(err) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
||||
}
|
||||
|
||||
_next(undefined);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* ext-foreignobject.js
|
||||
*
|
||||
|
@ -47,21 +11,18 @@ var svgEditorExtension_foreignobject = (function () {
|
|||
*/
|
||||
var extForeignobject = {
|
||||
name: 'foreignobject',
|
||||
init: function () {
|
||||
var _init = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee2(S) {
|
||||
init: function init(S) {
|
||||
var svgEditor, $, text2xml, NS, importLocale, svgCanvas, svgdoc, strings, properlySourceSizeTextArea, showPanel, toggleSourceButtons, selElems, started, newFO, editingforeign, setForeignString, showForeignEditor, setAttr, buttons, contextTools;
|
||||
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
||||
return regeneratorRuntime.async(function init$(_context2) {
|
||||
while (1) {
|
||||
switch (_context2.prev = _context2.next) {
|
||||
case 0:
|
||||
setAttr = function _ref6(attr, val) {
|
||||
setAttr = function _ref5(attr, val) {
|
||||
svgCanvas.changeSelectedAttribute(attr, val);
|
||||
svgCanvas.call('changed', selElems);
|
||||
};
|
||||
|
||||
showForeignEditor = function _ref5() {
|
||||
showForeignEditor = function _ref4() {
|
||||
var elt = selElems[0];
|
||||
|
||||
if (!elt || editingforeign) {
|
||||
|
@ -78,7 +39,7 @@ var svgEditorExtension_foreignobject = (function () {
|
|||
$('#svg_source_textarea').focus();
|
||||
};
|
||||
|
||||
setForeignString = function _ref4(xmlString) {
|
||||
setForeignString = function _ref3(xmlString) {
|
||||
var elt = selElems[0]; // The parent `Element` to append to
|
||||
|
||||
try {
|
||||
|
@ -99,12 +60,12 @@ var svgEditorExtension_foreignobject = (function () {
|
|||
return true;
|
||||
};
|
||||
|
||||
toggleSourceButtons = function _ref3(on) {
|
||||
toggleSourceButtons = function _ref2(on) {
|
||||
$('#tool_source_save, #tool_source_cancel').toggle(!on);
|
||||
$('#foreign_save, #foreign_cancel').toggle(on);
|
||||
};
|
||||
|
||||
showPanel = function _ref2(on) {
|
||||
showPanel = function _ref(on) {
|
||||
var fcRules = $('#fc_rules');
|
||||
|
||||
if (!fcRules.length) {
|
||||
|
@ -120,7 +81,7 @@ var svgEditorExtension_foreignobject = (function () {
|
|||
svgCanvas = svgEditor.canvas;
|
||||
svgdoc = S.svgroot.parentNode.ownerDocument;
|
||||
_context2.next = 11;
|
||||
return importLocale();
|
||||
return regeneratorRuntime.awrap(importLocale());
|
||||
|
||||
case 11:
|
||||
strings = _context2.sent;
|
||||
|
@ -218,13 +179,9 @@ var svgEditorExtension_foreignobject = (function () {
|
|||
// Create source save/cancel buttons
|
||||
|
||||
/* const save = */
|
||||
$('#tool_source_save').clone().hide().attr('id', 'foreign_save').unbind().appendTo('#tool_source_back').click(
|
||||
/*#__PURE__*/
|
||||
_asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee() {
|
||||
$('#tool_source_save').clone().hide().attr('id', 'foreign_save').unbind().appendTo('#tool_source_back').click(function _callee() {
|
||||
var ok;
|
||||
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||
return regeneratorRuntime.async(function _callee$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
|
@ -242,7 +199,7 @@ var svgEditorExtension_foreignobject = (function () {
|
|||
}
|
||||
|
||||
_context.next = 5;
|
||||
return $.confirm('Errors found. Revert to original?');
|
||||
return regeneratorRuntime.awrap($.confirm('Errors found. Revert to original?'));
|
||||
|
||||
case 5:
|
||||
ok = _context.sent;
|
||||
|
@ -267,8 +224,8 @@ var svgEditorExtension_foreignobject = (function () {
|
|||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _callee);
|
||||
})));
|
||||
});
|
||||
});
|
||||
/* const cancel = */
|
||||
|
||||
$('#tool_source_cancel').clone().hide().attr('id', 'foreign_cancel').unbind().appendTo('#tool_source_back').click(function () {
|
||||
|
@ -357,15 +314,8 @@ var svgEditorExtension_foreignobject = (function () {
|
|||
return _context2.stop();
|
||||
}
|
||||
}
|
||||
}, _callee2, this);
|
||||
}));
|
||||
|
||||
function init(_x) {
|
||||
return _init.apply(this, arguments);
|
||||
}, null, this);
|
||||
}
|
||||
|
||||
return init;
|
||||
}()
|
||||
};
|
||||
|
||||
return extForeignobject;
|
||||
|
|
|
@ -1,42 +1,6 @@
|
|||
var svgEditorExtension_grid = (function () {
|
||||
'use strict';
|
||||
|
||||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
||||
try {
|
||||
var info = gen[key](arg);
|
||||
var value = info.value;
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.done) {
|
||||
resolve(value);
|
||||
} else {
|
||||
Promise.resolve(value).then(_next, _throw);
|
||||
}
|
||||
}
|
||||
|
||||
function _asyncToGenerator(fn) {
|
||||
return function () {
|
||||
var self = this,
|
||||
args = arguments;
|
||||
return new Promise(function (resolve, reject) {
|
||||
var gen = fn.apply(self, args);
|
||||
|
||||
function _next(value) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
||||
}
|
||||
|
||||
function _throw(err) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
||||
}
|
||||
|
||||
_next(undefined);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* ext-grid.js
|
||||
*
|
||||
|
@ -47,12 +11,9 @@ var svgEditorExtension_grid = (function () {
|
|||
*/
|
||||
var extGrid = {
|
||||
name: 'grid',
|
||||
init: function () {
|
||||
var _init = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee(_ref) {
|
||||
init: function init(_ref) {
|
||||
var $, NS, getTypeMap, importLocale, strings, svgEditor, svgCanvas, svgdoc, assignAttributes, hcanvas, canvBG, units, intervals, showGrid, canvasGrid, gridDefs, gridPattern, gridimg, gridBox, updateGrid, gridUpdate, buttons;
|
||||
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||
return regeneratorRuntime.async(function init$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
|
@ -115,7 +76,7 @@ var svgEditorExtension_grid = (function () {
|
|||
|
||||
$ = _ref.$, NS = _ref.NS, getTypeMap = _ref.getTypeMap, importLocale = _ref.importLocale;
|
||||
_context.next = 5;
|
||||
return importLocale();
|
||||
return regeneratorRuntime.awrap(importLocale());
|
||||
|
||||
case 5:
|
||||
strings = _context.sent;
|
||||
|
@ -212,15 +173,8 @@ var svgEditorExtension_grid = (function () {
|
|||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _callee, this);
|
||||
}));
|
||||
|
||||
function init(_x) {
|
||||
return _init.apply(this, arguments);
|
||||
}, null, this);
|
||||
}
|
||||
|
||||
return init;
|
||||
}()
|
||||
};
|
||||
|
||||
return extGrid;
|
||||
|
|
|
@ -1,42 +1,6 @@
|
|||
var svgEditorExtension_helloworld = (function () {
|
||||
'use strict';
|
||||
|
||||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
||||
try {
|
||||
var info = gen[key](arg);
|
||||
var value = info.value;
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.done) {
|
||||
resolve(value);
|
||||
} else {
|
||||
Promise.resolve(value).then(_next, _throw);
|
||||
}
|
||||
}
|
||||
|
||||
function _asyncToGenerator(fn) {
|
||||
return function () {
|
||||
var self = this,
|
||||
args = arguments;
|
||||
return new Promise(function (resolve, reject) {
|
||||
var gen = fn.apply(self, args);
|
||||
|
||||
function _next(value) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
||||
}
|
||||
|
||||
function _throw(err) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
||||
}
|
||||
|
||||
_next(undefined);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function _slicedToArray(arr, i) {
|
||||
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
|
||||
}
|
||||
|
@ -95,18 +59,15 @@ var svgEditorExtension_helloworld = (function () {
|
|||
*/
|
||||
var extHelloworld = {
|
||||
name: 'helloworld',
|
||||
init: function () {
|
||||
var _init = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee(_ref) {
|
||||
init: function init(_ref) {
|
||||
var $, importLocale, strings, svgEditor, svgCanvas;
|
||||
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||
return regeneratorRuntime.async(function init$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
$ = _ref.$, importLocale = _ref.importLocale;
|
||||
_context.next = 3;
|
||||
return importLocale();
|
||||
return regeneratorRuntime.awrap(importLocale());
|
||||
|
||||
case 3:
|
||||
strings = _context.sent;
|
||||
|
@ -181,15 +142,8 @@ var svgEditorExtension_helloworld = (function () {
|
|||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _callee, this);
|
||||
}));
|
||||
|
||||
function init(_x) {
|
||||
return _init.apply(this, arguments);
|
||||
}, null, this);
|
||||
}
|
||||
|
||||
return init;
|
||||
}()
|
||||
};
|
||||
|
||||
return extHelloworld;
|
||||
|
|
|
@ -15,42 +15,6 @@ var svgEditorExtension_imagelib = (function () {
|
|||
return _typeof(obj);
|
||||
}
|
||||
|
||||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
||||
try {
|
||||
var info = gen[key](arg);
|
||||
var value = info.value;
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.done) {
|
||||
resolve(value);
|
||||
} else {
|
||||
Promise.resolve(value).then(_next, _throw);
|
||||
}
|
||||
}
|
||||
|
||||
function _asyncToGenerator(fn) {
|
||||
return function () {
|
||||
var self = this,
|
||||
args = arguments;
|
||||
return new Promise(function (resolve, reject) {
|
||||
var gen = fn.apply(self, args);
|
||||
|
||||
function _next(value) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
||||
}
|
||||
|
||||
function _throw(err) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
||||
}
|
||||
|
||||
_next(undefined);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* ext-imagelib.js
|
||||
*
|
||||
|
@ -61,16 +25,13 @@ var svgEditorExtension_imagelib = (function () {
|
|||
*/
|
||||
var extImagelib = {
|
||||
name: 'imagelib',
|
||||
init: function () {
|
||||
var _init = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee2(_ref) {
|
||||
init: function init(_ref) {
|
||||
var $, decode64, importLocale, dropXMLInternalSubset, imagelibStrings, modularVersion, svgEditor, uiStrings, svgCanvas, extIconsPath, allowedImageLibOrigins, closeBrowser, importImage, pending, mode, multiArr, transferStopped, preview, submit, toggleMulti, showBrowser, buttons;
|
||||
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
||||
return regeneratorRuntime.async(function init$(_context2) {
|
||||
while (1) {
|
||||
switch (_context2.prev = _context2.next) {
|
||||
case 0:
|
||||
showBrowser = function _ref10() {
|
||||
showBrowser = function _ref9() {
|
||||
var browser = $('#imgbrowse');
|
||||
|
||||
if (!browser.length) {
|
||||
|
@ -126,10 +87,10 @@ var svgEditorExtension_imagelib = (function () {
|
|||
});
|
||||
cancel.prepend($.getSvgIcon('cancel', true));
|
||||
back.prepend($.getSvgIcon('tool_imagelib', true));
|
||||
imagelibStrings.imgLibs.forEach(function (_ref6) {
|
||||
var name = _ref6.name,
|
||||
url = _ref6.url,
|
||||
description = _ref6.description;
|
||||
imagelibStrings.imgLibs.forEach(function (_ref5) {
|
||||
var name = _ref5.name,
|
||||
url = _ref5.url,
|
||||
description = _ref5.description;
|
||||
$('<li>').appendTo(libOpts).text(name).on('click touchend', function () {
|
||||
frame.attr('src', url).show();
|
||||
header.text(name);
|
||||
|
@ -142,7 +103,7 @@ var svgEditorExtension_imagelib = (function () {
|
|||
}
|
||||
};
|
||||
|
||||
toggleMulti = function _ref9(show) {
|
||||
toggleMulti = function _ref8(show) {
|
||||
$('#lib_framewrap, #imglib_opts').css({
|
||||
right: show ? 200 : 10
|
||||
});
|
||||
|
@ -184,7 +145,7 @@ var svgEditorExtension_imagelib = (function () {
|
|||
submit.toggle(show);
|
||||
};
|
||||
|
||||
importImage = function _ref8(url) {
|
||||
importImage = function _ref7(url) {
|
||||
var newImage = svgCanvas.addSVGElementFromJson({
|
||||
element: 'image',
|
||||
attr: {
|
||||
|
@ -201,13 +162,13 @@ var svgEditorExtension_imagelib = (function () {
|
|||
svgCanvas.setImageURL(url);
|
||||
};
|
||||
|
||||
closeBrowser = function _ref7() {
|
||||
closeBrowser = function _ref6() {
|
||||
$('#imgbrowse_holder').hide();
|
||||
};
|
||||
|
||||
$ = _ref.$, decode64 = _ref.decode64, importLocale = _ref.importLocale, dropXMLInternalSubset = _ref.dropXMLInternalSubset;
|
||||
_context2.next = 7;
|
||||
return importLocale();
|
||||
return regeneratorRuntime.awrap(importLocale());
|
||||
|
||||
case 7:
|
||||
imagelibStrings = _context2.sent;
|
||||
|
@ -245,14 +206,9 @@ var svgEditorExtension_imagelib = (function () {
|
|||
multiArr = [];
|
||||
transferStopped = false;
|
||||
// Receive `postMessage` data
|
||||
window.addEventListener('message',
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
var _ref5 = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee(_ref4) {
|
||||
window.addEventListener('message', function _callee(_ref4) {
|
||||
var origin, response, id, type, hasName, hasHref, char1, secondpos, entry, curMeta, svgStr, imgStr, name, message, pre, src, title, xml, ok;
|
||||
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||
return regeneratorRuntime.async(function _callee$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
|
@ -362,7 +318,7 @@ var svgEditorExtension_imagelib = (function () {
|
|||
}
|
||||
|
||||
_context.next = 39;
|
||||
return $.process_cancel(message);
|
||||
return regeneratorRuntime.awrap($.process_cancel(message));
|
||||
|
||||
case 39:
|
||||
// eslint-disable-next-line require-atomic-updates
|
||||
|
@ -511,7 +467,7 @@ var svgEditorExtension_imagelib = (function () {
|
|||
case 74:
|
||||
closeBrowser();
|
||||
_context.next = 77;
|
||||
return svgEditor.openPrep();
|
||||
return regeneratorRuntime.awrap(svgEditor.openPrep());
|
||||
|
||||
case 77:
|
||||
ok = _context.sent;
|
||||
|
@ -534,13 +490,8 @@ var svgEditorExtension_imagelib = (function () {
|
|||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _callee, null, [[3, 20]]);
|
||||
}));
|
||||
|
||||
return function (_x2) {
|
||||
return _ref5.apply(this, arguments);
|
||||
};
|
||||
}(), true);
|
||||
}, null, null, [[3, 20]]);
|
||||
}, true);
|
||||
/**
|
||||
* @param {boolean} show
|
||||
* @returns {void}
|
||||
|
@ -571,15 +522,8 @@ var svgEditorExtension_imagelib = (function () {
|
|||
return _context2.stop();
|
||||
}
|
||||
}
|
||||
}, _callee2, this);
|
||||
}));
|
||||
|
||||
function init(_x) {
|
||||
return _init.apply(this, arguments);
|
||||
}, null, this);
|
||||
}
|
||||
|
||||
return init;
|
||||
}()
|
||||
};
|
||||
|
||||
return extImagelib;
|
||||
|
|
|
@ -1,42 +1,6 @@
|
|||
var svgEditorExtension_markers = (function () {
|
||||
'use strict';
|
||||
|
||||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
||||
try {
|
||||
var info = gen[key](arg);
|
||||
var value = info.value;
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.done) {
|
||||
resolve(value);
|
||||
} else {
|
||||
Promise.resolve(value).then(_next, _throw);
|
||||
}
|
||||
}
|
||||
|
||||
function _asyncToGenerator(fn) {
|
||||
return function () {
|
||||
var self = this,
|
||||
args = arguments;
|
||||
return new Promise(function (resolve, reject) {
|
||||
var gen = fn.apply(self, args);
|
||||
|
||||
function _next(value) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
||||
}
|
||||
|
||||
function _throw(err) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
||||
}
|
||||
|
||||
_next(undefined);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function _inherits(subClass, superClass) {
|
||||
if (typeof superClass !== "function" && superClass !== null) {
|
||||
throw new TypeError("Super expression must either be null or a function");
|
||||
|
@ -233,17 +197,13 @@ var svgEditorExtension_markers = (function () {
|
|||
*/
|
||||
var extMarkers = {
|
||||
name: 'markers',
|
||||
init: function () {
|
||||
var _init = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee3(S) {
|
||||
var strings, svgEditor, $, svgCanvas, addElem, mtypes, markerPrefix, idPrefix, markerTypes, getLinked, setIcon, selElems, showPanel, addMarker, convertline, setMarker, colorChanged, updateReferences, triggerTextEntry, showTextPrompt, _showTextPrompt, setArrowFromButton, _setArrowFromButton, getTitle, buildButtonList, contextTools;
|
||||
|
||||
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
||||
init: function init(S) {
|
||||
var strings, svgEditor, $, svgCanvas, addElem, mtypes, markerPrefix, idPrefix, markerTypes, getLinked, setIcon, selElems, showPanel, addMarker, convertline, setMarker, colorChanged, updateReferences, triggerTextEntry, showTextPrompt, setArrowFromButton, getTitle, buildButtonList, contextTools;
|
||||
return regeneratorRuntime.async(function init$(_context3) {
|
||||
while (1) {
|
||||
switch (_context3.prev = _context3.next) {
|
||||
case 0:
|
||||
buildButtonList = function _ref16() {
|
||||
buildButtonList = function _ref14() {
|
||||
var buttons = []; // const i = 0;
|
||||
|
||||
/*
|
||||
|
@ -294,7 +254,7 @@ var svgEditorExtension_markers = (function () {
|
|||
return buttons;
|
||||
};
|
||||
|
||||
getTitle = function _ref15(id) {
|
||||
getTitle = function _ref13(id) {
|
||||
var langList = strings.langList;
|
||||
var item = langList.find(function (itm) {
|
||||
return itm.id === id;
|
||||
|
@ -302,12 +262,9 @@ var svgEditorExtension_markers = (function () {
|
|||
return item ? item.title : id;
|
||||
};
|
||||
|
||||
_setArrowFromButton = function _ref14() {
|
||||
_setArrowFromButton = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee2(ev) {
|
||||
setArrowFromButton = function _ref12(ev) {
|
||||
var parts, pos, val;
|
||||
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
||||
return regeneratorRuntime.async(function setArrowFromButton$(_context2) {
|
||||
while (1) {
|
||||
switch (_context2.prev = _context2.next) {
|
||||
case 0:
|
||||
|
@ -330,28 +287,19 @@ var svgEditorExtension_markers = (function () {
|
|||
|
||||
case 8:
|
||||
_context2.next = 10;
|
||||
return showTextPrompt(pos);
|
||||
return regeneratorRuntime.awrap(showTextPrompt(pos));
|
||||
|
||||
case 10:
|
||||
case "end":
|
||||
return _context2.stop();
|
||||
}
|
||||
}
|
||||
}, _callee2, this);
|
||||
}));
|
||||
return _setArrowFromButton.apply(this, arguments);
|
||||
}, null, this);
|
||||
};
|
||||
|
||||
setArrowFromButton = function _ref13(_x3) {
|
||||
return _setArrowFromButton.apply(this, arguments);
|
||||
};
|
||||
|
||||
_showTextPrompt = function _ref12() {
|
||||
_showTextPrompt = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee(pos) {
|
||||
showTextPrompt = function _ref11(pos) {
|
||||
var def, txt;
|
||||
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||
return regeneratorRuntime.async(function showTextPrompt$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
|
@ -362,7 +310,7 @@ var svgEditorExtension_markers = (function () {
|
|||
}
|
||||
|
||||
_context.next = 4;
|
||||
return $.prompt('Enter text for ' + pos + ' marker', def);
|
||||
return regeneratorRuntime.awrap($.prompt('Enter text for ' + pos + ' marker', def));
|
||||
|
||||
case 4:
|
||||
txt = _context.sent;
|
||||
|
@ -376,13 +324,7 @@ var svgEditorExtension_markers = (function () {
|
|||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
return _showTextPrompt.apply(this, arguments);
|
||||
};
|
||||
|
||||
showTextPrompt = function _ref11(_x2) {
|
||||
return _showTextPrompt.apply(this, arguments);
|
||||
});
|
||||
};
|
||||
|
||||
triggerTextEntry = function _ref10(pos, val) {
|
||||
|
@ -710,10 +652,10 @@ var svgEditorExtension_markers = (function () {
|
|||
return svgCanvas.getElem(m.groups.id);
|
||||
};
|
||||
|
||||
_context3.next = 17;
|
||||
return S.importLocale();
|
||||
_context3.next = 15;
|
||||
return regeneratorRuntime.awrap(S.importLocale());
|
||||
|
||||
case 17:
|
||||
case 15:
|
||||
strings = _context3.sent;
|
||||
svgEditor = this;
|
||||
$ = S.$;
|
||||
|
@ -917,20 +859,13 @@ var svgEditorExtension_markers = (function () {
|
|||
})
|
||||
});
|
||||
|
||||
case 29:
|
||||
case 27:
|
||||
case "end":
|
||||
return _context3.stop();
|
||||
}
|
||||
}
|
||||
}, _callee3, this);
|
||||
}));
|
||||
|
||||
function init(_x) {
|
||||
return _init.apply(this, arguments);
|
||||
}, null, this);
|
||||
}
|
||||
|
||||
return init;
|
||||
}()
|
||||
};
|
||||
|
||||
return extMarkers;
|
||||
|
|
|
@ -1,42 +1,6 @@
|
|||
var svgEditorExtension_mathjax = (function () {
|
||||
'use strict';
|
||||
|
||||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
||||
try {
|
||||
var info = gen[key](arg);
|
||||
var value = info.value;
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.done) {
|
||||
resolve(value);
|
||||
} else {
|
||||
Promise.resolve(value).then(_next, _throw);
|
||||
}
|
||||
}
|
||||
|
||||
function _asyncToGenerator(fn) {
|
||||
return function () {
|
||||
var self = this,
|
||||
args = arguments;
|
||||
return new Promise(function (resolve, reject) {
|
||||
var gen = fn.apply(self, args);
|
||||
|
||||
function _next(value) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
||||
}
|
||||
|
||||
function _throw(err) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
||||
}
|
||||
|
||||
_next(undefined);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Add any of the whitelisted attributes to the script tag.
|
||||
* @param {HTMLScriptElement} script
|
||||
|
@ -52,6 +16,14 @@ var svgEditorExtension_mathjax = (function () {
|
|||
}
|
||||
});
|
||||
} // Additions by Brett
|
||||
/**
|
||||
*
|
||||
* @author Brett Zamir (other items are from `dynamic-import-polyfill`)
|
||||
* @param {string|string[]} url
|
||||
* @param {PlainObject} [atts={}]
|
||||
* @returns {Promise<void|Error>} Resolves to `undefined` or rejects with an `Error` upon a
|
||||
* script loading error
|
||||
*/
|
||||
|
||||
function importScript(url) {
|
||||
var atts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
|
@ -101,14 +73,12 @@ var svgEditorExtension_mathjax = (function () {
|
|||
});
|
||||
}
|
||||
|
||||
/* globals MathJax */
|
||||
var extMathjax = {
|
||||
name: 'mathjax',
|
||||
init: function () {
|
||||
var _init = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee2(_ref) {
|
||||
init: function init(_ref) {
|
||||
var $, importLocale, strings, svgEditor, svgCanvas, mathjaxSrcSecure, uiStrings, math, locationX, locationY, mathjaxLoaded, saveMath, buttons;
|
||||
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
||||
return regeneratorRuntime.async(function init$(_context2) {
|
||||
while (1) {
|
||||
switch (_context2.prev = _context2.next) {
|
||||
case 0:
|
||||
|
@ -166,7 +136,7 @@ var svgEditorExtension_mathjax = (function () {
|
|||
|
||||
$ = _ref.$, importLocale = _ref.importLocale;
|
||||
_context2.next = 4;
|
||||
return importLocale();
|
||||
return regeneratorRuntime.awrap(importLocale());
|
||||
|
||||
case 4:
|
||||
strings = _context2.sent;
|
||||
|
@ -222,11 +192,8 @@ var svgEditorExtension_mathjax = (function () {
|
|||
type: 'mode',
|
||||
icon: svgEditor.curConfig.extIconsPath + 'mathjax.png',
|
||||
events: {
|
||||
click: function () {
|
||||
var _click = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee() {
|
||||
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||
click: function click() {
|
||||
return regeneratorRuntime.async(function click$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
|
@ -280,7 +247,7 @@ var svgEditorExtension_mathjax = (function () {
|
|||
|
||||
_context.prev = 7;
|
||||
_context.next = 10;
|
||||
return importScript(svgEditor.curConfig.extIconsPath + mathjaxSrcSecure);
|
||||
return regeneratorRuntime.awrap(importScript(svgEditor.curConfig.extIconsPath + mathjaxSrcSecure));
|
||||
|
||||
case 10:
|
||||
// When MathJax is loaded get the div where the math will be rendered.
|
||||
|
@ -306,15 +273,8 @@ var svgEditorExtension_mathjax = (function () {
|
|||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _callee, null, [[7, 13]]);
|
||||
}));
|
||||
|
||||
function click() {
|
||||
return _click.apply(this, arguments);
|
||||
}, null, null, [[7, 13]]);
|
||||
}
|
||||
|
||||
return click;
|
||||
}()
|
||||
}
|
||||
}];
|
||||
return _context2.abrupt("return", {
|
||||
|
@ -358,15 +318,8 @@ var svgEditorExtension_mathjax = (function () {
|
|||
return _context2.stop();
|
||||
}
|
||||
}
|
||||
}, _callee2, this);
|
||||
}));
|
||||
|
||||
function init(_x) {
|
||||
return _init.apply(this, arguments);
|
||||
}, null, this);
|
||||
}
|
||||
|
||||
return init;
|
||||
}()
|
||||
};
|
||||
|
||||
return extMathjax;
|
||||
|
|
|
@ -1,42 +1,6 @@
|
|||
var svgEditorExtension_panning = (function () {
|
||||
'use strict';
|
||||
|
||||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
||||
try {
|
||||
var info = gen[key](arg);
|
||||
var value = info.value;
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.done) {
|
||||
resolve(value);
|
||||
} else {
|
||||
Promise.resolve(value).then(_next, _throw);
|
||||
}
|
||||
}
|
||||
|
||||
function _asyncToGenerator(fn) {
|
||||
return function () {
|
||||
var self = this,
|
||||
args = arguments;
|
||||
return new Promise(function (resolve, reject) {
|
||||
var gen = fn.apply(self, args);
|
||||
|
||||
function _next(value) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
||||
}
|
||||
|
||||
function _throw(err) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
||||
}
|
||||
|
||||
_next(undefined);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* ext-panning.js
|
||||
*
|
||||
|
@ -51,18 +15,15 @@ var svgEditorExtension_panning = (function () {
|
|||
*/
|
||||
var extPanning = {
|
||||
name: 'panning',
|
||||
init: function () {
|
||||
var _init = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee(_ref) {
|
||||
init: function init(_ref) {
|
||||
var importLocale, strings, svgEditor, svgCanvas, buttons;
|
||||
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||
return regeneratorRuntime.async(function init$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
importLocale = _ref.importLocale;
|
||||
_context.next = 3;
|
||||
return importLocale();
|
||||
return regeneratorRuntime.awrap(importLocale());
|
||||
|
||||
case 3:
|
||||
strings = _context.sent;
|
||||
|
@ -112,15 +73,8 @@ var svgEditorExtension_panning = (function () {
|
|||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _callee, this);
|
||||
}));
|
||||
|
||||
function init(_x) {
|
||||
return _init.apply(this, arguments);
|
||||
}, null, this);
|
||||
}
|
||||
|
||||
return init;
|
||||
}()
|
||||
};
|
||||
|
||||
return extPanning;
|
||||
|
|
|
@ -1,42 +1,6 @@
|
|||
var svgEditorExtension_placemark = (function () {
|
||||
'use strict';
|
||||
|
||||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
||||
try {
|
||||
var info = gen[key](arg);
|
||||
var value = info.value;
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.done) {
|
||||
resolve(value);
|
||||
} else {
|
||||
Promise.resolve(value).then(_next, _throw);
|
||||
}
|
||||
}
|
||||
|
||||
function _asyncToGenerator(fn) {
|
||||
return function () {
|
||||
var self = this,
|
||||
args = arguments;
|
||||
return new Promise(function (resolve, reject) {
|
||||
var gen = fn.apply(self, args);
|
||||
|
||||
function _next(value) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
||||
}
|
||||
|
||||
function _throw(err) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
||||
}
|
||||
|
||||
_next(undefined);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function _inherits(subClass, superClass) {
|
||||
if (typeof superClass !== "function" && superClass !== null) {
|
||||
throw new TypeError("Super expression must either be null or a function");
|
||||
|
@ -252,12 +216,9 @@ var svgEditorExtension_placemark = (function () {
|
|||
*/
|
||||
var extPlacemark = {
|
||||
name: 'placemark',
|
||||
init: function () {
|
||||
var _init = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee(S) {
|
||||
init: function init(S) {
|
||||
var svgEditor, svgCanvas, addElem, $, importLocale, selElems, started, newPM, strings, markerTypes, showPanel, getLinked, updateText, updateFont, addMarker, setMarker, colorChanged, updateReferences, setArrowFromButton, getTitle, addMarkerButtons, buttons, contextTools;
|
||||
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||
return regeneratorRuntime.async(function init$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
|
@ -510,7 +471,7 @@ var svgEditorExtension_placemark = (function () {
|
|||
$ = S.$, importLocale = S.importLocale; // {svgcontent},
|
||||
|
||||
_context.next = 17;
|
||||
return importLocale();
|
||||
return regeneratorRuntime.awrap(importLocale());
|
||||
|
||||
case 17:
|
||||
strings = _context.sent;
|
||||
|
@ -864,15 +825,8 @@ var svgEditorExtension_placemark = (function () {
|
|||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _callee, this);
|
||||
}));
|
||||
|
||||
function init(_x) {
|
||||
return _init.apply(this, arguments);
|
||||
}, null, this);
|
||||
}
|
||||
|
||||
return init;
|
||||
}()
|
||||
};
|
||||
|
||||
return extPlacemark;
|
||||
|
|
|
@ -1,42 +1,6 @@
|
|||
var svgEditorExtension_polygon = (function () {
|
||||
'use strict';
|
||||
|
||||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
||||
try {
|
||||
var info = gen[key](arg);
|
||||
var value = info.value;
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.done) {
|
||||
resolve(value);
|
||||
} else {
|
||||
Promise.resolve(value).then(_next, _throw);
|
||||
}
|
||||
}
|
||||
|
||||
function _asyncToGenerator(fn) {
|
||||
return function () {
|
||||
var self = this,
|
||||
args = arguments;
|
||||
return new Promise(function (resolve, reject) {
|
||||
var gen = fn.apply(self, args);
|
||||
|
||||
function _next(value) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
||||
}
|
||||
|
||||
function _throw(err) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
||||
}
|
||||
|
||||
_next(undefined);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* ext-polygon.js
|
||||
*
|
||||
|
@ -46,12 +10,9 @@ var svgEditorExtension_polygon = (function () {
|
|||
*/
|
||||
var extPolygon = {
|
||||
name: 'polygon',
|
||||
init: function () {
|
||||
var _init = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee(S) {
|
||||
init: function init(S) {
|
||||
var svgEditor, svgCanvas, $, importLocale, editingitex, strings, selElems, started, newFO, showPanel, setAttr, cot, sec, buttons, contextTools;
|
||||
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||
return regeneratorRuntime.async(function init$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
|
@ -83,7 +44,7 @@ var svgEditorExtension_polygon = (function () {
|
|||
svgCanvas = svgEditor.canvas;
|
||||
$ = S.$, importLocale = S.importLocale, editingitex = false;
|
||||
_context.next = 9;
|
||||
return importLocale();
|
||||
return regeneratorRuntime.awrap(importLocale());
|
||||
|
||||
case 9:
|
||||
strings = _context.sent;
|
||||
|
@ -299,15 +260,8 @@ var svgEditorExtension_polygon = (function () {
|
|||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _callee, this);
|
||||
}));
|
||||
|
||||
function init(_x) {
|
||||
return _init.apply(this, arguments);
|
||||
}, null, this);
|
||||
}
|
||||
|
||||
return init;
|
||||
}()
|
||||
};
|
||||
|
||||
return extPolygon;
|
||||
|
|
|
@ -15,42 +15,6 @@ var svgEditorExtension_server_moinsave = (function () {
|
|||
return _typeof(obj);
|
||||
}
|
||||
|
||||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
||||
try {
|
||||
var info = gen[key](arg);
|
||||
var value = info.value;
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.done) {
|
||||
resolve(value);
|
||||
} else {
|
||||
Promise.resolve(value).then(_next, _throw);
|
||||
}
|
||||
}
|
||||
|
||||
function _asyncToGenerator(fn) {
|
||||
return function () {
|
||||
var self = this,
|
||||
args = arguments;
|
||||
return new Promise(function (resolve, reject) {
|
||||
var gen = fn.apply(self, args);
|
||||
|
||||
function _next(value) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
||||
}
|
||||
|
||||
function _throw(err) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
||||
}
|
||||
|
||||
_next(undefined);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function _classCallCheck(instance, Constructor) {
|
||||
if (!(instance instanceof Constructor)) {
|
||||
throw new TypeError("Cannot call a class as a function");
|
||||
|
@ -4684,19 +4648,14 @@ var svgEditorExtension_server_moinsave = (function () {
|
|||
}; // load from url
|
||||
|
||||
|
||||
svg.load =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
var _ref12 = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee(ctx, url) {
|
||||
svg.load = function _callee(ctx, url) {
|
||||
var dom;
|
||||
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||
return regeneratorRuntime.async(function _callee$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
_context.next = 2;
|
||||
return svg.ajax(url, true);
|
||||
return regeneratorRuntime.awrap(svg.ajax(url, true));
|
||||
|
||||
case 2:
|
||||
dom = _context.sent;
|
||||
|
@ -4707,13 +4666,8 @@ var svgEditorExtension_server_moinsave = (function () {
|
|||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
|
||||
return function (_x2, _x3) {
|
||||
return _ref12.apply(this, arguments);
|
||||
};
|
||||
}(); // load from xml
|
||||
});
|
||||
}; // load from xml
|
||||
|
||||
|
||||
svg.loadXml = function (ctx, xml) {
|
||||
|
@ -4934,9 +4888,9 @@ var svgEditorExtension_server_moinsave = (function () {
|
|||
checkPath: function checkPath(element, ctx) {
|
||||
var _this26 = this;
|
||||
|
||||
this.events.forEach(function (_ref13, i) {
|
||||
var x = _ref13.x,
|
||||
y = _ref13.y;
|
||||
this.events.forEach(function (_ref12, i) {
|
||||
var x = _ref12.x,
|
||||
y = _ref12.y;
|
||||
|
||||
if (ctx.isPointInPath && ctx.isPointInPath(x, y)) {
|
||||
_this26.eventElements[i] = element;
|
||||
|
@ -4946,9 +4900,9 @@ var svgEditorExtension_server_moinsave = (function () {
|
|||
checkBoundingBox: function checkBoundingBox(element, bb) {
|
||||
var _this27 = this;
|
||||
|
||||
this.events.forEach(function (_ref14, i) {
|
||||
var x = _ref14.x,
|
||||
y = _ref14.y;
|
||||
this.events.forEach(function (_ref13, i) {
|
||||
var x = _ref13.x,
|
||||
y = _ref13.y;
|
||||
|
||||
if (bb.isPointInBox(x, y)) {
|
||||
_this27.eventElements[i] = element;
|
||||
|
@ -4992,18 +4946,15 @@ var svgEditorExtension_server_moinsave = (function () {
|
|||
|
||||
var extServer_moinsave = {
|
||||
name: 'server_moinsave',
|
||||
init: function () {
|
||||
var _init = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee2(_ref) {
|
||||
init: function init(_ref) {
|
||||
var $, encode64, importLocale, strings, svgEditor, svgCanvas, saveSvgAction;
|
||||
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
||||
return regeneratorRuntime.async(function init$(_context2) {
|
||||
while (1) {
|
||||
switch (_context2.prev = _context2.next) {
|
||||
case 0:
|
||||
$ = _ref.$, encode64 = _ref.encode64, importLocale = _ref.importLocale;
|
||||
_context2.next = 3;
|
||||
return importLocale();
|
||||
return regeneratorRuntime.awrap(importLocale());
|
||||
|
||||
case 3:
|
||||
strings = _context2.sent;
|
||||
|
@ -5017,13 +4968,10 @@ var svgEditorExtension_server_moinsave = (function () {
|
|||
|
||||
$("<iframe name=\"output_frame\" title=\"".concat(strings.hiddenframe, "\"\n style=\"width: 0; height: 0;\" src=\"#\"/>")).appendTo('body');
|
||||
svgEditor.setCustomHandlers({
|
||||
save: function () {
|
||||
var _save = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee(win, data) {
|
||||
save: function save(win, data) {
|
||||
var svg, qstr, _qstr$substr$split, _qstr$substr$split2, name, svgData, c, datauri, pngData;
|
||||
|
||||
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||
return regeneratorRuntime.async(function save$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
|
@ -5042,7 +4990,7 @@ var svgEditorExtension_server_moinsave = (function () {
|
|||
c.width = svgCanvas.contentW;
|
||||
c.height = svgCanvas.contentH;
|
||||
_context.next = 10;
|
||||
return canvg(c, svg);
|
||||
return regeneratorRuntime.awrap(canvg(c, svg));
|
||||
|
||||
case 10:
|
||||
datauri = c.toDataURL('image/png'); // const {uiStrings} = svgEditor;
|
||||
|
@ -5064,15 +5012,8 @@ var svgEditorExtension_server_moinsave = (function () {
|
|||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
|
||||
function save(_x2, _x3) {
|
||||
return _save.apply(this, arguments);
|
||||
});
|
||||
}
|
||||
|
||||
return save;
|
||||
}()
|
||||
});
|
||||
|
||||
case 9:
|
||||
|
@ -5080,15 +5021,8 @@ var svgEditorExtension_server_moinsave = (function () {
|
|||
return _context2.stop();
|
||||
}
|
||||
}
|
||||
}, _callee2, this);
|
||||
}));
|
||||
|
||||
function init(_x) {
|
||||
return _init.apply(this, arguments);
|
||||
}, null, this);
|
||||
}
|
||||
|
||||
return init;
|
||||
}()
|
||||
};
|
||||
|
||||
return extServer_moinsave;
|
||||
|
|
|
@ -15,42 +15,6 @@ var svgEditorExtension_server_opensave = (function () {
|
|||
return _typeof(obj);
|
||||
}
|
||||
|
||||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
||||
try {
|
||||
var info = gen[key](arg);
|
||||
var value = info.value;
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.done) {
|
||||
resolve(value);
|
||||
} else {
|
||||
Promise.resolve(value).then(_next, _throw);
|
||||
}
|
||||
}
|
||||
|
||||
function _asyncToGenerator(fn) {
|
||||
return function () {
|
||||
var self = this,
|
||||
args = arguments;
|
||||
return new Promise(function (resolve, reject) {
|
||||
var gen = fn.apply(self, args);
|
||||
|
||||
function _next(value) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
||||
}
|
||||
|
||||
function _throw(err) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
||||
}
|
||||
|
||||
_next(undefined);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function _classCallCheck(instance, Constructor) {
|
||||
if (!(instance instanceof Constructor)) {
|
||||
throw new TypeError("Cannot call a class as a function");
|
||||
|
@ -4684,19 +4648,14 @@ var svgEditorExtension_server_opensave = (function () {
|
|||
}; // load from url
|
||||
|
||||
|
||||
svg.load =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
var _ref12 = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee(ctx, url) {
|
||||
svg.load = function _callee(ctx, url) {
|
||||
var dom;
|
||||
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||
return regeneratorRuntime.async(function _callee$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
_context.next = 2;
|
||||
return svg.ajax(url, true);
|
||||
return regeneratorRuntime.awrap(svg.ajax(url, true));
|
||||
|
||||
case 2:
|
||||
dom = _context.sent;
|
||||
|
@ -4707,13 +4666,8 @@ var svgEditorExtension_server_opensave = (function () {
|
|||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
|
||||
return function (_x2, _x3) {
|
||||
return _ref12.apply(this, arguments);
|
||||
};
|
||||
}(); // load from xml
|
||||
});
|
||||
}; // load from xml
|
||||
|
||||
|
||||
svg.loadXml = function (ctx, xml) {
|
||||
|
@ -4934,9 +4888,9 @@ var svgEditorExtension_server_opensave = (function () {
|
|||
checkPath: function checkPath(element, ctx) {
|
||||
var _this26 = this;
|
||||
|
||||
this.events.forEach(function (_ref13, i) {
|
||||
var x = _ref13.x,
|
||||
y = _ref13.y;
|
||||
this.events.forEach(function (_ref12, i) {
|
||||
var x = _ref12.x,
|
||||
y = _ref12.y;
|
||||
|
||||
if (ctx.isPointInPath && ctx.isPointInPath(x, y)) {
|
||||
_this26.eventElements[i] = element;
|
||||
|
@ -4946,9 +4900,9 @@ var svgEditorExtension_server_opensave = (function () {
|
|||
checkBoundingBox: function checkBoundingBox(element, bb) {
|
||||
var _this27 = this;
|
||||
|
||||
this.events.forEach(function (_ref14, i) {
|
||||
var x = _ref14.x,
|
||||
y = _ref14.y;
|
||||
this.events.forEach(function (_ref13, i) {
|
||||
var x = _ref13.x,
|
||||
y = _ref13.y;
|
||||
|
||||
if (bb.isPointInBox(x, y)) {
|
||||
_this27.eventElements[i] = element;
|
||||
|
@ -4990,19 +4944,24 @@ var svgEditorExtension_server_opensave = (function () {
|
|||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* ext-server_opensave.js
|
||||
*
|
||||
* @license MIT
|
||||
*
|
||||
* @copyright 2010 Alexis Deveria
|
||||
*
|
||||
*/
|
||||
var extServer_opensave = {
|
||||
name: 'server_opensave',
|
||||
init: function () {
|
||||
var _init = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee5(_ref) {
|
||||
init: function init(_ref) {
|
||||
var $, decode64, encode64, importLocale, strings, svgEditor, _svgEditor$curConfig, extPath, avoidClientSide, avoidClientSideDownload, avoidClientSideOpen, svgCanvas, getFileNameFromTitle, xhtmlEscape, clientDownloadSupport, saveSvgAction, saveImgAction, cancelled, openSvgAction, importSvgAction, importImgAction, openSvgForm, importSvgForm, importImgForm, rebuildInput;
|
||||
|
||||
return regeneratorRuntime.wrap(function _callee5$(_context5) {
|
||||
return regeneratorRuntime.async(function init$(_context5) {
|
||||
while (1) {
|
||||
switch (_context5.prev = _context5.next) {
|
||||
case 0:
|
||||
rebuildInput = function _ref7(form) {
|
||||
rebuildInput = function _ref5(form) {
|
||||
form.empty();
|
||||
var inp = $('<input type="file" name="svg_file">').appendTo(form);
|
||||
/**
|
||||
|
@ -5012,97 +4971,80 @@ var svgEditorExtension_server_opensave = (function () {
|
|||
*/
|
||||
|
||||
function submit() {
|
||||
return _submit.apply(this, arguments);
|
||||
}
|
||||
|
||||
function _submit() {
|
||||
_submit = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee4() {
|
||||
return regeneratorRuntime.wrap(function _callee4$(_context4) {
|
||||
return regeneratorRuntime.async(function submit$(_context2) {
|
||||
while (1) {
|
||||
switch (_context4.prev = _context4.next) {
|
||||
switch (_context2.prev = _context2.next) {
|
||||
case 0:
|
||||
// This submits the form, which returns the file data using `svgEditor.processFile()`
|
||||
form.submit();
|
||||
rebuildInput(form);
|
||||
_context4.next = 4;
|
||||
return $.process_cancel(strings.uploading);
|
||||
_context2.next = 4;
|
||||
return regeneratorRuntime.awrap($.process_cancel(strings.uploading));
|
||||
|
||||
case 4:
|
||||
cancelled = true;
|
||||
$('#dialog_box').hide();
|
||||
|
||||
case 6:
|
||||
case "end":
|
||||
return _context4.stop();
|
||||
}
|
||||
}
|
||||
}, _callee4);
|
||||
}));
|
||||
return _submit.apply(this, arguments);
|
||||
}
|
||||
|
||||
if (form[0] === openSvgForm[0]) {
|
||||
inp.change(
|
||||
/*#__PURE__*/
|
||||
_asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee2() {
|
||||
var ok;
|
||||
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
||||
while (1) {
|
||||
switch (_context2.prev = _context2.next) {
|
||||
case 0:
|
||||
_context2.next = 2;
|
||||
return svgEditor.openPrep();
|
||||
|
||||
case 2:
|
||||
ok = _context2.sent;
|
||||
|
||||
if (ok) {
|
||||
_context2.next = 6;
|
||||
break;
|
||||
}
|
||||
|
||||
rebuildInput(form);
|
||||
return _context2.abrupt("return");
|
||||
|
||||
case 6:
|
||||
_context2.next = 8;
|
||||
return submit();
|
||||
|
||||
case 8:
|
||||
case "end":
|
||||
return _context2.stop();
|
||||
}
|
||||
}
|
||||
}, _callee2);
|
||||
})));
|
||||
} else {
|
||||
inp.change(
|
||||
/*#__PURE__*/
|
||||
_asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee3() {
|
||||
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
||||
});
|
||||
}
|
||||
|
||||
if (form[0] === openSvgForm[0]) {
|
||||
inp.change(function _callee() {
|
||||
var ok;
|
||||
return regeneratorRuntime.async(function _callee$(_context3) {
|
||||
while (1) {
|
||||
switch (_context3.prev = _context3.next) {
|
||||
case 0:
|
||||
_context3.next = 2;
|
||||
return submit();
|
||||
return regeneratorRuntime.awrap(svgEditor.openPrep());
|
||||
|
||||
case 2:
|
||||
ok = _context3.sent;
|
||||
|
||||
if (ok) {
|
||||
_context3.next = 6;
|
||||
break;
|
||||
}
|
||||
|
||||
rebuildInput(form);
|
||||
return _context3.abrupt("return");
|
||||
|
||||
case 6:
|
||||
_context3.next = 8;
|
||||
return regeneratorRuntime.awrap(submit());
|
||||
|
||||
case 8:
|
||||
case "end":
|
||||
return _context3.stop();
|
||||
}
|
||||
}
|
||||
}, _callee3);
|
||||
})));
|
||||
});
|
||||
});
|
||||
} else {
|
||||
inp.change(function _callee2() {
|
||||
return regeneratorRuntime.async(function _callee2$(_context4) {
|
||||
while (1) {
|
||||
switch (_context4.prev = _context4.next) {
|
||||
case 0:
|
||||
_context4.next = 2;
|
||||
return regeneratorRuntime.awrap(submit());
|
||||
|
||||
case 2:
|
||||
case "end":
|
||||
return _context4.stop();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
clientDownloadSupport = function _ref6(filename, suffix, uri) {
|
||||
clientDownloadSupport = function _ref4(filename, suffix, uri) {
|
||||
if (avoidClientSide || avoidClientSideDownload) {
|
||||
return false;
|
||||
}
|
||||
|
@ -5122,11 +5064,11 @@ var svgEditorExtension_server_opensave = (function () {
|
|||
return false;
|
||||
};
|
||||
|
||||
xhtmlEscape = function _ref5(str) {
|
||||
xhtmlEscape = function _ref3(str) {
|
||||
return str.replace(/&(?!amp;)/g, '&').replace(/"/g, '"').replace(/</g, '<'); // < is actually disallowed above anyways
|
||||
};
|
||||
|
||||
getFileNameFromTitle = function _ref4() {
|
||||
getFileNameFromTitle = function _ref2() {
|
||||
var title = svgCanvas.getDocumentTitle(); // We convert (to underscore) only those disallowed Win7 file name characters
|
||||
|
||||
return title.trim().replace(/[/\\:*?"<>|]/g, '_');
|
||||
|
@ -5134,7 +5076,7 @@ var svgEditorExtension_server_opensave = (function () {
|
|||
|
||||
$ = _ref.$, decode64 = _ref.decode64, encode64 = _ref.encode64, importLocale = _ref.importLocale;
|
||||
_context5.next = 7;
|
||||
return importLocale();
|
||||
return regeneratorRuntime.awrap(importLocale());
|
||||
|
||||
case 7:
|
||||
strings = _context5.sent;
|
||||
|
@ -5182,12 +5124,9 @@ var svgEditorExtension_server_opensave = (function () {
|
|||
}).append("\n <input type=\"hidden\" name=\"output_img\" value=\"".concat(datauri, "\">\n <input type=\"hidden\" name=\"mime\" value=\"application/pdf\">\n <input type=\"hidden\" name=\"filename\" value=\"").concat(xhtmlEscape(filename), "\">\n ")).appendTo('body').submit().remove();
|
||||
},
|
||||
// Todo: Integrate this extension with a new built-in exportWindowType, "download"
|
||||
exportImage: function () {
|
||||
var _exportImage = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee(win, data) {
|
||||
exportImage: function exportImage(win, data) {
|
||||
var issues, mimeType, quality, c, datauri, pre, note, filename, suffix;
|
||||
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||
return regeneratorRuntime.async(function exportImage$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
|
@ -5203,7 +5142,7 @@ var svgEditorExtension_server_opensave = (function () {
|
|||
c.width = svgCanvas.contentW;
|
||||
c.height = svgCanvas.contentH;
|
||||
_context.next = 7;
|
||||
return canvg(c, data.svg);
|
||||
return regeneratorRuntime.awrap(canvg(c, data.svg));
|
||||
|
||||
case 7:
|
||||
datauri = quality ? c.toDataURL(mimeType, quality) : c.toDataURL(mimeType); // {uiStrings} = svgEditor;
|
||||
|
@ -5223,7 +5162,7 @@ var svgEditorExtension_server_opensave = (function () {
|
|||
}
|
||||
|
||||
_context.next = 13;
|
||||
return $.alert(note);
|
||||
return regeneratorRuntime.awrap($.alert(note));
|
||||
|
||||
case 13:
|
||||
filename = getFileNameFromTitle();
|
||||
|
@ -5248,15 +5187,8 @@ var svgEditorExtension_server_opensave = (function () {
|
|||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
|
||||
function exportImage(_x2, _x3) {
|
||||
return _exportImage.apply(this, arguments);
|
||||
});
|
||||
}
|
||||
|
||||
return exportImage;
|
||||
}()
|
||||
}); // Do nothing if client support is found
|
||||
|
||||
if (!(window.FileReader && !avoidClientSideOpen)) {
|
||||
|
@ -5338,15 +5270,8 @@ var svgEditorExtension_server_opensave = (function () {
|
|||
return _context5.stop();
|
||||
}
|
||||
}
|
||||
}, _callee5, this);
|
||||
}));
|
||||
|
||||
function init(_x) {
|
||||
return _init.apply(this, arguments);
|
||||
}, null, this);
|
||||
}
|
||||
|
||||
return init;
|
||||
}()
|
||||
};
|
||||
|
||||
return extServer_opensave;
|
||||
|
|
|
@ -1,42 +1,6 @@
|
|||
var svgEditorExtension_shapes = (function () {
|
||||
'use strict';
|
||||
|
||||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
||||
try {
|
||||
var info = gen[key](arg);
|
||||
var value = info.value;
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.done) {
|
||||
resolve(value);
|
||||
} else {
|
||||
Promise.resolve(value).then(_next, _throw);
|
||||
}
|
||||
}
|
||||
|
||||
function _asyncToGenerator(fn) {
|
||||
return function () {
|
||||
var self = this,
|
||||
args = arguments;
|
||||
return new Promise(function (resolve, reject) {
|
||||
var gen = fn.apply(self, args);
|
||||
|
||||
function _next(value) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
||||
}
|
||||
|
||||
function _throw(err) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
||||
}
|
||||
|
||||
_next(undefined);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function _slicedToArray(arr, i) {
|
||||
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
|
||||
}
|
||||
|
@ -89,12 +53,9 @@ var svgEditorExtension_shapes = (function () {
|
|||
*/
|
||||
var extShapes = {
|
||||
name: 'shapes',
|
||||
init: function () {
|
||||
var _init = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee(_ref) {
|
||||
init: function init(_ref) {
|
||||
var $, importLocale, strings, svgEditor, canv, svgroot, lastBBox, categories, library, modeId, startClientPos, currentD, curShapeId, curShape, startX, startY, curLib, loadIcons, makeButtons, loadLibrary, buttons;
|
||||
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||
return regeneratorRuntime.async(function init$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
|
@ -159,7 +120,7 @@ var svgEditorExtension_shapes = (function () {
|
|||
|
||||
$ = _ref.$, importLocale = _ref.importLocale;
|
||||
_context.next = 6;
|
||||
return importLocale();
|
||||
return regeneratorRuntime.awrap(importLocale());
|
||||
|
||||
case 6:
|
||||
strings = _context.sent;
|
||||
|
@ -413,15 +374,8 @@ var svgEditorExtension_shapes = (function () {
|
|||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _callee, this);
|
||||
}));
|
||||
|
||||
function init(_x) {
|
||||
return _init.apply(this, arguments);
|
||||
}, null, this);
|
||||
}
|
||||
|
||||
return init;
|
||||
}()
|
||||
};
|
||||
|
||||
return extShapes;
|
||||
|
|
|
@ -1,42 +1,6 @@
|
|||
var svgEditorExtension_star = (function () {
|
||||
'use strict';
|
||||
|
||||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
||||
try {
|
||||
var info = gen[key](arg);
|
||||
var value = info.value;
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.done) {
|
||||
resolve(value);
|
||||
} else {
|
||||
Promise.resolve(value).then(_next, _throw);
|
||||
}
|
||||
}
|
||||
|
||||
function _asyncToGenerator(fn) {
|
||||
return function () {
|
||||
var self = this,
|
||||
args = arguments;
|
||||
return new Promise(function (resolve, reject) {
|
||||
var gen = fn.apply(self, args);
|
||||
|
||||
function _next(value) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
||||
}
|
||||
|
||||
function _throw(err) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
||||
}
|
||||
|
||||
_next(undefined);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* ext-star.js
|
||||
*
|
||||
|
@ -46,12 +10,9 @@ var svgEditorExtension_star = (function () {
|
|||
*/
|
||||
var extStar = {
|
||||
name: 'star',
|
||||
init: function () {
|
||||
var _init = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee(S) {
|
||||
init: function init(S) {
|
||||
var svgEditor, svgCanvas, $, importLocale, selElems, started, newFO, strings, showPanel, setAttr, buttons, contextTools;
|
||||
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||
return regeneratorRuntime.async(function init$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
|
@ -76,7 +37,7 @@ var svgEditorExtension_star = (function () {
|
|||
$ = S.$, importLocale = S.importLocale; // {svgcontent},
|
||||
|
||||
_context.next = 7;
|
||||
return importLocale();
|
||||
return regeneratorRuntime.awrap(importLocale());
|
||||
|
||||
case 7:
|
||||
strings = _context.sent;
|
||||
|
@ -284,15 +245,8 @@ var svgEditorExtension_star = (function () {
|
|||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _callee, this);
|
||||
}));
|
||||
|
||||
function init(_x) {
|
||||
return _init.apply(this, arguments);
|
||||
}, null, this);
|
||||
}
|
||||
|
||||
return init;
|
||||
}()
|
||||
};
|
||||
|
||||
return extStar;
|
||||
|
|
|
@ -1,42 +1,6 @@
|
|||
var svgEditorExtension_storage = (function () {
|
||||
'use strict';
|
||||
|
||||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
||||
try {
|
||||
var info = gen[key](arg);
|
||||
var value = info.value;
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.done) {
|
||||
resolve(value);
|
||||
} else {
|
||||
Promise.resolve(value).then(_next, _throw);
|
||||
}
|
||||
}
|
||||
|
||||
function _asyncToGenerator(fn) {
|
||||
return function () {
|
||||
var self = this,
|
||||
args = arguments;
|
||||
return new Promise(function (resolve, reject) {
|
||||
var gen = fn.apply(self, args);
|
||||
|
||||
function _next(value) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
||||
}
|
||||
|
||||
function _throw(err) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
||||
}
|
||||
|
||||
_next(undefined);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function _inherits(subClass, superClass) {
|
||||
if (typeof superClass !== "function" && superClass !== null) {
|
||||
throw new TypeError("Super expression must either be null or a function");
|
||||
|
@ -415,20 +379,17 @@ var svgEditorExtension_storage = (function () {
|
|||
var loaded = false;
|
||||
return {
|
||||
name: 'storage',
|
||||
langReady: function () {
|
||||
var _langReady = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee(_ref4) {
|
||||
langReady: function langReady(_ref4) {
|
||||
var importLocale, _$$deparam$querystrin, storagePrompt, confirmSetStorage, message, storagePrefsAndContent, storagePrefsOnly, storagePrefs, storageNoPrefsOrContent, storageNoPrefs, rememberLabel, rememberTooltip, options, oldContainerWidth, oldContainerMarginLeft, oldContentHeight, oldContainerHeight, _ref5, pref, checked;
|
||||
|
||||
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||
return regeneratorRuntime.async(function langReady$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
importLocale = _ref4.importLocale;
|
||||
_$$deparam$querystrin = $.deparam.querystring(true), storagePrompt = _$$deparam$querystrin.storagePrompt;
|
||||
_context.next = 4;
|
||||
return importLocale();
|
||||
return regeneratorRuntime.awrap(importLocale());
|
||||
|
||||
case 4:
|
||||
confirmSetStorage = _context.sent;
|
||||
|
@ -495,11 +456,11 @@ var svgEditorExtension_storage = (function () {
|
|||
|
||||
svgEditor.storagePromptState = 'waiting';
|
||||
_context.next = 20;
|
||||
return $.select(message, options, null, null, {
|
||||
return regeneratorRuntime.awrap($.select(message, options, null, null, {
|
||||
label: rememberLabel,
|
||||
checked: true,
|
||||
tooltip: rememberTooltip
|
||||
});
|
||||
}));
|
||||
|
||||
case 20:
|
||||
_ref5 = _context.sent;
|
||||
|
@ -584,15 +545,8 @@ var svgEditorExtension_storage = (function () {
|
|||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
|
||||
function langReady(_x) {
|
||||
return _langReady.apply(this, arguments);
|
||||
});
|
||||
}
|
||||
|
||||
return langReady;
|
||||
}()
|
||||
};
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,42 +1,6 @@
|
|||
var svgEditorExtension_webappfind = (function () {
|
||||
'use strict';
|
||||
|
||||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
||||
try {
|
||||
var info = gen[key](arg);
|
||||
var value = info.value;
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.done) {
|
||||
resolve(value);
|
||||
} else {
|
||||
Promise.resolve(value).then(_next, _throw);
|
||||
}
|
||||
}
|
||||
|
||||
function _asyncToGenerator(fn) {
|
||||
return function () {
|
||||
var self = this,
|
||||
args = arguments;
|
||||
return new Promise(function (resolve, reject) {
|
||||
var gen = fn.apply(self, args);
|
||||
|
||||
function _next(value) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
||||
}
|
||||
|
||||
function _throw(err) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
||||
}
|
||||
|
||||
_next(undefined);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Depends on Firefox add-on and executables from {@link https://github.com/brettz9/webappfind}
|
||||
* @author Brett Zamir
|
||||
|
@ -45,18 +9,15 @@ var svgEditorExtension_webappfind = (function () {
|
|||
*/
|
||||
var extWebappfind = {
|
||||
name: 'webappfind',
|
||||
init: function () {
|
||||
var _init = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee(_ref) {
|
||||
init: function init(_ref) {
|
||||
var importLocale, $, strings, svgEditor, saveMessage, readMessage, excludedMessages, pathID, buttons;
|
||||
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||
return regeneratorRuntime.async(function init$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
importLocale = _ref.importLocale, $ = _ref.$;
|
||||
_context.next = 3;
|
||||
return importLocale();
|
||||
return regeneratorRuntime.awrap(importLocale());
|
||||
|
||||
case 3:
|
||||
strings = _context.sent;
|
||||
|
@ -163,15 +124,8 @@ var svgEditorExtension_webappfind = (function () {
|
|||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _callee, this);
|
||||
}));
|
||||
|
||||
function init(_x) {
|
||||
return _init.apply(this, arguments);
|
||||
}, null, this);
|
||||
}
|
||||
|
||||
return init;
|
||||
}()
|
||||
};
|
||||
|
||||
return extWebappfind;
|
||||
|
|
|
@ -15,42 +15,6 @@
|
|||
return _typeof(obj);
|
||||
}
|
||||
|
||||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
||||
try {
|
||||
var info = gen[key](arg);
|
||||
var value = info.value;
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.done) {
|
||||
resolve(value);
|
||||
} else {
|
||||
Promise.resolve(value).then(_next, _throw);
|
||||
}
|
||||
}
|
||||
|
||||
function _asyncToGenerator(fn) {
|
||||
return function () {
|
||||
var self = this,
|
||||
args = arguments;
|
||||
return new Promise(function (resolve, reject) {
|
||||
var gen = fn.apply(self, args);
|
||||
|
||||
function _next(value) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
||||
}
|
||||
|
||||
function _throw(err) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
||||
}
|
||||
|
||||
_next(undefined);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function _classCallCheck(instance, Constructor) {
|
||||
if (!(instance instanceof Constructor)) {
|
||||
throw new TypeError("Cannot call a class as a function");
|
||||
|
@ -303,20 +267,35 @@
|
|||
return obj;
|
||||
}
|
||||
|
||||
function _objectSpread(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
var ownKeys = Object.keys(source);
|
||||
function ownKeys(object, enumerableOnly) {
|
||||
var keys = Object.keys(object);
|
||||
|
||||
if (typeof Object.getOwnPropertySymbols === 'function') {
|
||||
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
|
||||
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
||||
}));
|
||||
if (Object.getOwnPropertySymbols) {
|
||||
var symbols = Object.getOwnPropertySymbols(object);
|
||||
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
||||
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
||||
});
|
||||
keys.push.apply(keys, symbols);
|
||||
}
|
||||
|
||||
ownKeys.forEach(function (key) {
|
||||
return keys;
|
||||
}
|
||||
|
||||
function _objectSpread2(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
|
||||
if (i % 2) {
|
||||
ownKeys(source, true).forEach(function (key) {
|
||||
_defineProperty(target, key, source[key]);
|
||||
});
|
||||
} else if (Object.getOwnPropertyDescriptors) {
|
||||
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
||||
} else {
|
||||
ownKeys(source).forEach(function (key) {
|
||||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return target;
|
||||
|
@ -494,6 +473,10 @@
|
|||
}
|
||||
|
||||
function _iterableToArrayLimit$1(arr, i) {
|
||||
if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
|
||||
return;
|
||||
}
|
||||
|
||||
var _arr = [];
|
||||
var _n = true;
|
||||
var _d = false;
|
||||
|
@ -683,7 +666,7 @@
|
|||
* @static
|
||||
* @param {Element} el DOM element to which to attach the event
|
||||
* @param {string} type The DOM event (without 'on') to attach to the element
|
||||
* @param {Function} handler The event handler to attach to the element
|
||||
* @param {EventListener} handler The event handler to attach to the element
|
||||
* @param {boolean} [capturing] Whether or not the event should be
|
||||
* capturing (W3C-browsers only); default is false; NOT IN USE
|
||||
* @returns {void}
|
||||
|
@ -725,7 +708,7 @@
|
|||
} // Todo: Make as public utility
|
||||
|
||||
/**
|
||||
* @param {*} o
|
||||
* @param {any} o
|
||||
* @returns {boolean}
|
||||
*/
|
||||
|
||||
|
@ -737,7 +720,7 @@
|
|||
/**
|
||||
* @private
|
||||
* @static
|
||||
* @param {string|object|Array|Element|DocumentFragment} item
|
||||
* @param {string|JamilihAttributes|JamilihArray|Element|DocumentFragment} item
|
||||
* @returns {"string"|"null"|"array"|"element"|"fragment"|"object"}
|
||||
*/
|
||||
|
||||
|
@ -833,7 +816,7 @@
|
|||
return jml(arg);
|
||||
}
|
||||
/**
|
||||
* @typedef {Array} AttributeArray
|
||||
* @typedef {JamilihAttributes} AttributeArray
|
||||
* @property {string} 0 The key
|
||||
* @property {string} 1 The value
|
||||
*/
|
||||
|
@ -932,12 +915,16 @@
|
|||
* @typedef {Element|DocumentFragment} JamilihReturn
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {PlainObject} JamilihAttributes
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {GenericArray} JamilihArray
|
||||
* @property {string} 0 The element to create (by lower-case name)
|
||||
* @property {Object} [1] Attributes to add with the key as the attribute name
|
||||
* and value as the attribute value; important for IE where the input
|
||||
* element's type cannot be added later after already added to the page
|
||||
* @property {JamilihAttributes} [1] Attributes to add with the key as the
|
||||
* attribute name and value as the attribute value; important for IE where
|
||||
* the input element's type cannot be added later after already added to the page
|
||||
* @param {Element[]} [children] The optional children of this element
|
||||
* (but raw DOM elements required to be specified within arrays since
|
||||
* could not otherwise be distinguished from siblings being added)
|
||||
|
@ -1569,8 +1556,6 @@
|
|||
obj = dataVal[1] || defaultMap[1];
|
||||
} // Map
|
||||
|
||||
/* eslint-disable-next-line unicorn/no-unsafe-regex */
|
||||
|
||||
} else if (/^\[object (?:Weak)?Map\]$/.test([].toString.call(dataVal))) {
|
||||
map = dataVal;
|
||||
obj = defaultMap[1]; // Non-map data object
|
||||
|
@ -1823,11 +1808,11 @@
|
|||
/**
|
||||
* Converts a DOM object or a string of HTML into a Jamilih object (or string).
|
||||
* @param {string|HTMLElement} [dom=document.documentElement] Defaults to converting the current document.
|
||||
* @param {object} [config={stringOutput:false}] Configuration object
|
||||
* @param {PlainObject} [config] Configuration object
|
||||
* @param {boolean} [config.stringOutput=false] Whether to output the Jamilih object as a string.
|
||||
* @returns {Array|string} Array containing the elements which represent a Jamilih object, or,
|
||||
if `stringOutput` is true, it will be the stringified version of
|
||||
such an object
|
||||
* @returns {JamilihArray|string} Array containing the elements which represent
|
||||
* a Jamilih object, or, if `stringOutput` is true, it will be the stringified
|
||||
* version of such an object
|
||||
*/
|
||||
|
||||
|
||||
|
@ -1890,7 +1875,7 @@
|
|||
}
|
||||
/**
|
||||
*
|
||||
* @param {*} val
|
||||
* @param {any} val
|
||||
* @returns {void}
|
||||
*/
|
||||
|
||||
|
@ -1942,7 +1927,7 @@
|
|||
}
|
||||
*/
|
||||
var type = 'nodeType' in node ? node.nodeType : null;
|
||||
namespaces = _objectSpread({}, namespaces);
|
||||
namespaces = _objectSpread2({}, namespaces);
|
||||
var xmlChars = /([\t\n\r -\uD7FF\uE000-\uFFFD]|(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF]))(?:(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))*$/; // eslint-disable-line no-control-regex
|
||||
|
||||
if ([2, 3, 4, 7, 8].includes(type) && !xmlChars.test(node.nodeValue)) {
|
||||
|
@ -2018,7 +2003,7 @@
|
|||
break;
|
||||
}
|
||||
|
||||
case undefined: // Treat as attribute node until this is fixed: https://github.com/tmpvar/jsdom/issues/1641 / https://github.com/tmpvar/jsdom/pull/1822
|
||||
case undefined: // Treat as attribute node until this is fixed: https://github.com/jsdom/jsdom/issues/1641 / https://github.com/jsdom/jsdom/pull/1822
|
||||
|
||||
case 2:
|
||||
// ATTRIBUTE (should only get here if passing in an attribute node)
|
||||
|
@ -3235,21 +3220,14 @@
|
|||
* @returns {Promise<void>}
|
||||
*/
|
||||
|
||||
function processResults(_x) {
|
||||
return _processResults.apply(this, arguments);
|
||||
}
|
||||
|
||||
function _processResults() {
|
||||
_processResults = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee3(url) {
|
||||
function processResults(url) {
|
||||
var queryLink, r, json, payload, _json$info, numResults, pages, currentPage, semiColonSep;
|
||||
|
||||
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
||||
return regeneratorRuntime.async(function processResults$(_context2) {
|
||||
while (1) {
|
||||
switch (_context3.prev = _context3.next) {
|
||||
switch (_context2.prev = _context2.next) {
|
||||
case 0:
|
||||
queryLink = function _ref4(query) {
|
||||
queryLink = function _ref2(query) {
|
||||
return ['a', {
|
||||
href: jsVoid,
|
||||
dataset: {
|
||||
|
@ -3266,26 +3244,26 @@
|
|||
}, [query]];
|
||||
};
|
||||
|
||||
_context3.next = 3;
|
||||
return fetch(url);
|
||||
_context2.next = 3;
|
||||
return regeneratorRuntime.awrap(fetch(url));
|
||||
|
||||
case 3:
|
||||
r = _context3.sent;
|
||||
_context3.next = 6;
|
||||
return r.json();
|
||||
r = _context2.sent;
|
||||
_context2.next = 6;
|
||||
return regeneratorRuntime.awrap(r.json());
|
||||
|
||||
case 6:
|
||||
json = _context3.sent;
|
||||
json = _context2.sent;
|
||||
|
||||
if (!(!json || json.msg !== 'success')) {
|
||||
_context3.next = 10;
|
||||
_context2.next = 10;
|
||||
break;
|
||||
}
|
||||
|
||||
// Todo: This could use a generic alert library instead
|
||||
alert('There was a problem downloading the results'); // eslint-disable-line no-alert
|
||||
|
||||
return _context3.abrupt("return");
|
||||
return _context2.abrupt("return");
|
||||
|
||||
case 10:
|
||||
payload = json.payload, _json$info = json.info, numResults = _json$info.results, pages = _json$info.pages, currentPage = _json$info.current_page; // $('#page')[0].value = currentPage;
|
||||
|
@ -3300,17 +3278,17 @@
|
|||
// - `svg`'s: `png_thumb`, `png_full_lossy`, `png_2400px`
|
||||
|
||||
semiColonSep = '; ' + nbsp;
|
||||
$$1('#results').jml('div', [['span', ['Number of results: ', numResults]], semiColonSep, ['span', ['page ', currentPage, ' out of ', pages]]].concat(_toConsumableArray(payload.map(function (_ref3) {
|
||||
var title = _ref3.title,
|
||||
description = _ref3.description,
|
||||
id = _ref3.id,
|
||||
uploader = _ref3.uploader,
|
||||
created = _ref3.created,
|
||||
svgURL = _ref3.svg.url,
|
||||
detailLink = _ref3.detail_link,
|
||||
tagsArray = _ref3.tags_array,
|
||||
downloadedBy = _ref3.downloaded_by,
|
||||
totalFavorites = _ref3.total_favorites;
|
||||
$$1('#results').jml('div', [['span', ['Number of results: ', numResults]], semiColonSep, ['span', ['page ', currentPage, ' out of ', pages]]].concat(_toConsumableArray(payload.map(function (_ref) {
|
||||
var title = _ref.title,
|
||||
description = _ref.description,
|
||||
id = _ref.id,
|
||||
uploader = _ref.uploader,
|
||||
created = _ref.created,
|
||||
svgURL = _ref.svg.url,
|
||||
detailLink = _ref.detail_link,
|
||||
tagsArray = _ref.tags_array,
|
||||
downloadedBy = _ref.downloaded_by,
|
||||
totalFavorites = _ref.total_favorites;
|
||||
var imgHW = '100px';
|
||||
var colonSep = ': ' + nbsp;
|
||||
return ['div', [['button', {
|
||||
|
@ -3320,14 +3298,11 @@
|
|||
value: svgURL
|
||||
},
|
||||
$on: {
|
||||
click: function () {
|
||||
var _click = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee2(e) {
|
||||
click: function click(e) {
|
||||
var svgurl, post, result, svg;
|
||||
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
||||
return regeneratorRuntime.async(function click$(_context) {
|
||||
while (1) {
|
||||
switch (_context2.prev = _context2.next) {
|
||||
switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
e.preventDefault();
|
||||
svgurl = this.dataset.value; // console.log('this', id, svgurl);
|
||||
|
@ -3345,16 +3320,16 @@
|
|||
name: title,
|
||||
id: svgurl
|
||||
});
|
||||
_context2.next = 6;
|
||||
return fetch(svgurl);
|
||||
_context.next = 6;
|
||||
return regeneratorRuntime.awrap(fetch(svgurl));
|
||||
|
||||
case 6:
|
||||
result = _context2.sent;
|
||||
_context2.next = 9;
|
||||
return result.text();
|
||||
result = _context.sent;
|
||||
_context.next = 9;
|
||||
return regeneratorRuntime.awrap(result.text());
|
||||
|
||||
case 9:
|
||||
svg = _context2.sent;
|
||||
svg = _context.sent;
|
||||
// console.log('url and svg', svgurl, svg);
|
||||
post({
|
||||
href: svgurl,
|
||||
|
@ -3363,18 +3338,11 @@
|
|||
|
||||
case 11:
|
||||
case "end":
|
||||
return _context2.stop();
|
||||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _callee2, this);
|
||||
}));
|
||||
|
||||
function click(_x2) {
|
||||
return _click.apply(this, arguments);
|
||||
}, null, this);
|
||||
}
|
||||
|
||||
return click;
|
||||
}()
|
||||
}
|
||||
}, [// If we wanted interactive versions despite security risk:
|
||||
// ['object', {data: svgURL, type: 'image/svg+xml'}]
|
||||
|
@ -3440,25 +3408,20 @@
|
|||
|
||||
case 13:
|
||||
case "end":
|
||||
return _context3.stop();
|
||||
return _context2.stop();
|
||||
}
|
||||
}
|
||||
}, _callee3);
|
||||
}));
|
||||
return _processResults.apply(this, arguments);
|
||||
});
|
||||
}
|
||||
|
||||
jml('div', [['style', [".control {\n padding-top: 10px;\n }"]], ['form', {
|
||||
id: 'openclipart',
|
||||
$custom: {
|
||||
$submit: function () {
|
||||
var _$submit = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee() {
|
||||
$submit: function $submit() {
|
||||
var url;
|
||||
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||
return regeneratorRuntime.async(function $submit$(_context3) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
switch (_context3.prev = _context3.next) {
|
||||
case 0:
|
||||
url = new URL(baseAPIURL);
|
||||
['query', 'sort', 'amount', 'page', 'byids'].forEach(function (prop) {
|
||||
|
@ -3468,23 +3431,16 @@
|
|||
url.searchParams.set(prop, value);
|
||||
}
|
||||
});
|
||||
_context.next = 4;
|
||||
return processResults(url);
|
||||
_context3.next = 4;
|
||||
return regeneratorRuntime.awrap(processResults(url));
|
||||
|
||||
case 4:
|
||||
case "end":
|
||||
return _context.stop();
|
||||
return _context3.stop();
|
||||
}
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
|
||||
function $submit() {
|
||||
return _$submit.apply(this, arguments);
|
||||
});
|
||||
}
|
||||
|
||||
return $submit;
|
||||
}()
|
||||
},
|
||||
$on: {
|
||||
submit: function submit(e) {
|
||||
|
@ -3532,11 +3488,11 @@
|
|||
}, [['label', ['Sort by: ', ['select', {
|
||||
id: 'sort'
|
||||
}, [// Todo: i18nize first values
|
||||
['Date', 'date'], ['Downloads', 'downloads'], ['Favorited', 'favorites']].map(function (_ref) {
|
||||
var _ref2 = _slicedToArray(_ref, 2),
|
||||
text = _ref2[0],
|
||||
_ref2$ = _ref2[1],
|
||||
value = _ref2$ === void 0 ? text : _ref2$;
|
||||
['Date', 'date'], ['Downloads', 'downloads'], ['Favorited', 'favorites']].map(function (_ref3) {
|
||||
var _ref4 = _slicedToArray(_ref3, 2),
|
||||
text = _ref4[0],
|
||||
_ref4$ = _ref4[1],
|
||||
value = _ref4$ === void 0 ? text : _ref4$;
|
||||
|
||||
return ['option', {
|
||||
value: value
|
||||
|
|
File diff suppressed because it is too large
Load Diff
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 it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -15,42 +15,6 @@ var SvgCanvas = (function () {
|
|||
return _typeof(obj);
|
||||
}
|
||||
|
||||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
||||
try {
|
||||
var info = gen[key](arg);
|
||||
var value = info.value;
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.done) {
|
||||
resolve(value);
|
||||
} else {
|
||||
Promise.resolve(value).then(_next, _throw);
|
||||
}
|
||||
}
|
||||
|
||||
function _asyncToGenerator(fn) {
|
||||
return function () {
|
||||
var self = this,
|
||||
args = arguments;
|
||||
return new Promise(function (resolve, reject) {
|
||||
var gen = fn.apply(self, args);
|
||||
|
||||
function _next(value) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
||||
}
|
||||
|
||||
function _throw(err) {
|
||||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
||||
}
|
||||
|
||||
_next(undefined);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function _classCallCheck(instance, Constructor) {
|
||||
if (!(instance instanceof Constructor)) {
|
||||
throw new TypeError("Cannot call a class as a function");
|
||||
|
@ -11449,24 +11413,9 @@ var SvgCanvas = (function () {
|
|||
* any other value depends on the export of the targeted module.
|
||||
*/
|
||||
|
||||
function importSetGlobal(_x, _x2) {
|
||||
return _importSetGlobal.apply(this, arguments);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @author Brett Zamir (other items are from `dynamic-import-polyfill`)
|
||||
* @param {string|string[]} url
|
||||
* @param {PlainObject} [atts={}]
|
||||
* @returns {Promise<void|Error>} Resolves to `undefined` or rejects with an `Error` upon a
|
||||
* script loading error
|
||||
*/
|
||||
|
||||
function _importSetGlobal() {
|
||||
_importSetGlobal = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee(url, _ref) {
|
||||
function importSetGlobal(url, _ref) {
|
||||
var glob, returnDefault, modularVersion;
|
||||
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||
return regeneratorRuntime.async(function importSetGlobal$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
|
@ -11485,7 +11434,7 @@ var SvgCanvas = (function () {
|
|||
|
||||
case 4:
|
||||
_context.next = 6;
|
||||
return importScript(url);
|
||||
return regeneratorRuntime.awrap(importScript(url));
|
||||
|
||||
case 6:
|
||||
return _context.abrupt("return", window[glob]);
|
||||
|
@ -11495,10 +11444,16 @@ var SvgCanvas = (function () {
|
|||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
return _importSetGlobal.apply(this, arguments);
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @author Brett Zamir (other items are from `dynamic-import-polyfill`)
|
||||
* @param {string|string[]} url
|
||||
* @param {PlainObject} [atts={}]
|
||||
* @returns {Promise<void|Error>} Resolves to `undefined` or rejects with an `Error` upon a
|
||||
* script loading error
|
||||
*/
|
||||
|
||||
function importScript(url) {
|
||||
var atts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
|
@ -12351,16 +12306,16 @@ var SvgCanvas = (function () {
|
|||
// }
|
||||
|
||||
var angle = getRotationAngle(child);
|
||||
oldStartTransform = context_.getStartTransform();
|
||||
var childxforms = [];
|
||||
oldStartTransform = context_.getStartTransform(); // const childxforms = [];
|
||||
|
||||
context_.setStartTransform(child.getAttribute('transform'));
|
||||
|
||||
if (angle || hasMatrixTransform(childTlist)) {
|
||||
var e2t = svgroot.createSVGTransform();
|
||||
e2t.setMatrix(matrixMultiply(tm, sm, tmn, _m));
|
||||
childTlist.clear();
|
||||
childTlist.appendItem(e2t);
|
||||
childxforms.push(e2t); // if not rotated or skewed, push the [T][S][-T] down to the child
|
||||
childTlist.appendItem(e2t); // childxforms.push(e2t);
|
||||
// if not rotated or skewed, push the [T][S][-T] down to the child
|
||||
} else {
|
||||
// update the transform list with translate,scale,translate
|
||||
// slide the [T][S][-T] from the front to the back
|
||||
|
@ -12384,10 +12339,10 @@ var SvgCanvas = (function () {
|
|||
translateBack.setTranslate(t2.e, t2.f);
|
||||
childTlist.appendItem(translateBack);
|
||||
childTlist.appendItem(scale);
|
||||
childTlist.appendItem(translateOrigin);
|
||||
childxforms.push(translateBack);
|
||||
childxforms.push(scale);
|
||||
childxforms.push(translateOrigin); // logMatrix(translateBack.matrix);
|
||||
childTlist.appendItem(translateOrigin); // childxforms.push(translateBack);
|
||||
// childxforms.push(scale);
|
||||
// childxforms.push(translateOrigin);
|
||||
// logMatrix(translateBack.matrix);
|
||||
// logMatrix(scale.matrix);
|
||||
} // not rotated
|
||||
|
||||
|
@ -14628,14 +14583,9 @@ var SvgCanvas = (function () {
|
|||
*/
|
||||
|
||||
|
||||
this.addExtension =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
var _ref4 = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee(name, extInitFunc, _ref3) {
|
||||
this.addExtension = function _callee(name, extInitFunc, _ref3) {
|
||||
var jq, importLocale, argObj, extObj;
|
||||
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||
return regeneratorRuntime.async(function _callee$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
|
@ -14681,7 +14631,7 @@ var SvgCanvas = (function () {
|
|||
selectorManager: selectorManager
|
||||
});
|
||||
_context.next = 8;
|
||||
return extInitFunc(argObj);
|
||||
return regeneratorRuntime.awrap(extInitFunc(argObj));
|
||||
|
||||
case 8:
|
||||
extObj = _context.sent;
|
||||
|
@ -14699,13 +14649,8 @@ var SvgCanvas = (function () {
|
|||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
|
||||
return function (_x, _x2, _x3) {
|
||||
return _ref4.apply(this, arguments);
|
||||
});
|
||||
};
|
||||
}();
|
||||
/**
|
||||
* This method sends back an array or a NodeList full of elements that
|
||||
* intersect the multi-select rubber-band-box on the currentLayer only.
|
||||
|
@ -17826,12 +17771,7 @@ var SvgCanvas = (function () {
|
|||
* @returns {Promise<module:svgcanvas.ImageExportedResults>} Resolves to {@link module:svgcanvas.ImageExportedResults}
|
||||
*/
|
||||
|
||||
this.rasterExport =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
var _ref5 = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee2(imgType, quality, exportWindowName) {
|
||||
this.rasterExport = function _callee2(imgType, quality, exportWindowName) {
|
||||
var opts,
|
||||
type,
|
||||
mimeType,
|
||||
|
@ -17839,11 +17779,11 @@ var SvgCanvas = (function () {
|
|||
issues,
|
||||
issueCodes,
|
||||
svg,
|
||||
_ref6,
|
||||
_ref4,
|
||||
c,
|
||||
_args2 = arguments;
|
||||
|
||||
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
||||
return regeneratorRuntime.async(function _callee2$(_context2) {
|
||||
while (1) {
|
||||
switch (_context2.prev = _context2.next) {
|
||||
case 0:
|
||||
|
@ -17859,13 +17799,13 @@ var SvgCanvas = (function () {
|
|||
}
|
||||
|
||||
_context2.next = 8;
|
||||
return importSetGlobal(curConfig.canvgPath + 'canvg.js', {
|
||||
return regeneratorRuntime.awrap(importSetGlobal(curConfig.canvgPath + 'canvg.js', {
|
||||
global: 'canvg'
|
||||
});
|
||||
}));
|
||||
|
||||
case 8:
|
||||
_ref6 = _context2.sent;
|
||||
canvg = _ref6.canvg;
|
||||
_ref4 = _context2.sent;
|
||||
canvg = _ref4.canvg;
|
||||
|
||||
case 10:
|
||||
if (!$$8('#export_canvas').length) {
|
||||
|
@ -17878,7 +17818,7 @@ var SvgCanvas = (function () {
|
|||
c.width = canvas.contentW;
|
||||
c.height = canvas.contentH;
|
||||
_context2.next = 16;
|
||||
return canvg(c, svg);
|
||||
return regeneratorRuntime.awrap(canvg(c, svg));
|
||||
|
||||
case 16:
|
||||
return _context2.abrupt("return", new Promise(function (resolve, reject) {
|
||||
|
@ -17928,13 +17868,8 @@ var SvgCanvas = (function () {
|
|||
return _context2.stop();
|
||||
}
|
||||
}
|
||||
}, _callee2, this);
|
||||
}));
|
||||
|
||||
return function (_x4, _x5, _x6) {
|
||||
return _ref5.apply(this, arguments);
|
||||
}, null, this);
|
||||
};
|
||||
}();
|
||||
/**
|
||||
* @external jsPDF
|
||||
*/
|
||||
|
@ -17974,12 +17909,7 @@ var SvgCanvas = (function () {
|
|||
*/
|
||||
|
||||
|
||||
this.exportPDF =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
var _ref7 = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee3(exportWindowName) {
|
||||
this.exportPDF = function _callee3(exportWindowName) {
|
||||
var outputType,
|
||||
modularVersion,
|
||||
res,
|
||||
|
@ -17994,7 +17924,7 @@ var SvgCanvas = (function () {
|
|||
obj,
|
||||
_args3 = arguments;
|
||||
|
||||
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
||||
return regeneratorRuntime.async(function _callee3$(_context3) {
|
||||
while (1) {
|
||||
switch (_context3.prev = _context3.next) {
|
||||
case 0:
|
||||
|
@ -18006,17 +17936,17 @@ var SvgCanvas = (function () {
|
|||
}
|
||||
|
||||
_context3.next = 4;
|
||||
return importScript([// We do not currently have these paths configurable as they are
|
||||
return regeneratorRuntime.awrap(importScript([// We do not currently have these paths configurable as they are
|
||||
// currently global-only, so not Rolled-up
|
||||
'jspdf/underscore-min.js', 'jspdf/jspdf.min.js']);
|
||||
'jspdf/underscore-min.js', 'jspdf/jspdf.min.js']));
|
||||
|
||||
case 4:
|
||||
modularVersion = !('svgEditor' in window) || !window.svgEditor || window.svgEditor.modules !== false; // Todo: Switch to `import()` when widely supported and available (also allow customization of path)
|
||||
|
||||
_context3.next = 7;
|
||||
return importScript(curConfig.jspdfPath + 'jspdf.plugin.svgToPdf.js', {
|
||||
return regeneratorRuntime.awrap(importScript(curConfig.jspdfPath + 'jspdf.plugin.svgToPdf.js', {
|
||||
type: modularVersion ? 'module' : 'text/javascript'
|
||||
});
|
||||
}));
|
||||
|
||||
case 7:
|
||||
res = getResolution();
|
||||
|
@ -18064,13 +17994,8 @@ var SvgCanvas = (function () {
|
|||
return _context3.stop();
|
||||
}
|
||||
}
|
||||
}, _callee3, this);
|
||||
}));
|
||||
|
||||
return function (_x7) {
|
||||
return _ref7.apply(this, arguments);
|
||||
}, null, this);
|
||||
};
|
||||
}();
|
||||
/**
|
||||
* Returns the current drawing as raw SVG XML text.
|
||||
* @function module:svgcanvas.SvgCanvas#getSvgString
|
||||
|
@ -18798,10 +18723,10 @@ var SvgCanvas = (function () {
|
|||
leaveContext: leaveContext,
|
||||
setContext: setContext
|
||||
};
|
||||
Object.entries(dr).forEach(function (_ref8) {
|
||||
var _ref9 = _slicedToArray(_ref8, 2),
|
||||
prop = _ref9[0],
|
||||
propVal = _ref9[1];
|
||||
Object.entries(dr).forEach(function (_ref5) {
|
||||
var _ref6 = _slicedToArray(_ref5, 2),
|
||||
prop = _ref6[0],
|
||||
propVal = _ref6[1];
|
||||
|
||||
canvas[prop] = propVal;
|
||||
});
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -8,10 +8,9 @@
|
|||
*
|
||||
* @module jQueryContextMenu
|
||||
* @todo Update to latest version and adapt (and needs jQuery update as well): {@link https://github.com/swisnl/jQuery-contextMenu}
|
||||
* @version 1.01
|
||||
* @version 1.0.1
|
||||
*
|
||||
* @license
|
||||
* Terms of Use
|
||||
* @license (GPL-2.0-or-later OR MIT)
|
||||
*
|
||||
* This plugin is dual-licensed under the GNU General Public License
|
||||
* and the MIT License and is copyright A Beautiful Site, LLC.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* ext-mathjax.js
|
||||
*
|
||||
* @license Apache
|
||||
* @license Apache-2.0
|
||||
*
|
||||
* @copyright 2013 Jo Segaert
|
||||
*
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -4011,9 +4011,9 @@
|
|||
}
|
||||
},
|
||||
"eslint-config-ash-nazg": {
|
||||
"version": "11.3.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-ash-nazg/-/eslint-config-ash-nazg-11.3.0.tgz",
|
||||
"integrity": "sha512-mQ6yQXBCxSy2nVk0LRNfyJWxUGMwXRhtOJyQJjF3lIHyjUdjYd2IMDpPBg7Ie/tftkkk6zEzQ+TBuUsHVHEtfg==",
|
||||
"version": "11.4.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-ash-nazg/-/eslint-config-ash-nazg-11.4.0.tgz",
|
||||
"integrity": "sha512-5HvR9GtShur4y1+QFzpF6v3aB4juRtAA8vi+cQA1gIPd6/rq3zSVwKgjefsU1DY3LttnE68DTLgfoYPnvDgPiA==",
|
||||
"dev": true
|
||||
},
|
||||
"eslint-config-standard": {
|
||||
|
@ -4229,17 +4229,27 @@
|
|||
}
|
||||
},
|
||||
"eslint-plugin-jsdoc": {
|
||||
"version": "17.1.1",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-17.1.1.tgz",
|
||||
"integrity": "sha512-astLOTsj87UIzvDyiuAKbkgQgtChutazTDVxdG254tAtcvIVlWnPmlN7/dLnMYld/aHBhB4SWiUalMuKwTaynQ==",
|
||||
"version": "18.0.1",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-18.0.1.tgz",
|
||||
"integrity": "sha512-ofNW3JmuZD9Gqn+qp/M6vPUfyaWHtfiNdmuoYmjyBcf5Xh2SMe1dnFa+gTGpfZLrjvBCdIbjxryRiF2QdqlQ0g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"comment-parser": "^0.7.0",
|
||||
"debug": "^4.1.1",
|
||||
"jsdoctypeparser": "^5.1.1",
|
||||
"jsdoctypeparser": "^6.0.0",
|
||||
"lodash": "^4.17.15",
|
||||
"object.entries-ponyfill": "^1.0.1",
|
||||
"regextras": "^0.6.1"
|
||||
"regextras": "^0.6.1",
|
||||
"semver": "^6.3.0",
|
||||
"spdx-expression-parse": "^3.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"semver": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"eslint-plugin-markdown": {
|
||||
|
@ -5942,9 +5952,9 @@
|
|||
}
|
||||
},
|
||||
"jsdoctypeparser": {
|
||||
"version": "5.1.1",
|
||||
"resolved": "https://registry.npmjs.org/jsdoctypeparser/-/jsdoctypeparser-5.1.1.tgz",
|
||||
"integrity": "sha512-APGygIJrT5bbz5lsVt8vyLJC0miEbQf/z9ZBfTr4RYvdia8AhWMRlYgivvwHG5zKD/VW3d6qpChCy64hpQET3A==",
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/jsdoctypeparser/-/jsdoctypeparser-6.0.0.tgz",
|
||||
"integrity": "sha512-61VtBXLkHfOFSIdp/VDVNMksxK0ID0cPTNvxDR92tPA6K7r2AX0OcJegYxhJIwtpWKU4p3D9L3U02hhlP1kQLQ==",
|
||||
"dev": true
|
||||
},
|
||||
"jsdom": {
|
||||
|
@ -8042,9 +8052,9 @@
|
|||
}
|
||||
},
|
||||
"rollup": {
|
||||
"version": "1.26.5",
|
||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-1.26.5.tgz",
|
||||
"integrity": "sha512-c6Pv0yWzjYNpy2DIhLFUnyP6e1UTGownr4IfpJcPY/k186RJjpaGGPRwKQ62KCauctG6dgtHt88pw1EGrPRkuA==",
|
||||
"version": "1.27.0",
|
||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-1.27.0.tgz",
|
||||
"integrity": "sha512-yaMna4MJ8LLEHhHl1ilgHakylf0LKeQctDxhngZLQ+W57GnXa5vtH7XKaK8zlAhNEhlWiH5YFVFt+QCDPUmNkw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/estree": "*",
|
||||
|
|
|
@ -88,14 +88,14 @@
|
|||
"babel-plugin-transform-object-rest-spread": "^7.0.0-beta.3",
|
||||
"core-js-bundle": "^3.4.1",
|
||||
"eslint": "6.6.0",
|
||||
"eslint-config-ash-nazg": "11.3.0",
|
||||
"eslint-config-ash-nazg": "11.4.0",
|
||||
"eslint-config-standard": "14.1.0",
|
||||
"eslint-plugin-array-func": "^3.1.3",
|
||||
"eslint-plugin-compat": "^3.3.0",
|
||||
"eslint-plugin-eslint-comments": "^3.1.2",
|
||||
"eslint-plugin-html": "^6.0.0",
|
||||
"eslint-plugin-import": "2.18.2",
|
||||
"eslint-plugin-jsdoc": "^17.1.1",
|
||||
"eslint-plugin-jsdoc": "^18.0.1",
|
||||
"eslint-plugin-markdown": "^1.0.1",
|
||||
"eslint-plugin-no-use-extend-native": "^0.4.1",
|
||||
"eslint-plugin-node": "10.0.0",
|
||||
|
@ -118,7 +118,7 @@
|
|||
"regenerator-runtime": "^0.13.3",
|
||||
"remark-cli": "^7.0.1",
|
||||
"remark-lint-ordered-list-marker-value": "^1.0.3",
|
||||
"rollup": "1.26.5",
|
||||
"rollup": "1.27.0",
|
||||
"rollup-plugin-babel": "^4.3.3",
|
||||
"rollup-plugin-re": "^1.0.7",
|
||||
"rollup-plugin-terser": "^5.1.2",
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue