Update build (npm run prep now restored)

This commit is contained in:
Brett Zamir
2020-07-18 19:25:50 +08:00
parent 7100111d62
commit b620eb55bb
95 changed files with 67950 additions and 74667 deletions

View File

@@ -5,33 +5,41 @@ var svgEditorExtension_php_savefile = (function () {
// handler as in "ext-server_opensave.js" (and in savefile.php)
var extPhp_savefile = {
name: 'php_savefile',
init: function init(_ref) {
var $ = _ref.$;
var svgEditor = this;
var extPath = svgEditor.curConfig.extPath,
svgCanvas = svgEditor.canvas;
init({
$
}) {
const svgEditor = this;
const {
curConfig: {
extPath
},
canvas: svgCanvas
} = svgEditor;
/**
* Get file name out of SVGEdit document title.
* @returns {string}
*/
function getFileNameFromTitle() {
var title = svgCanvas.getDocumentTitle();
const title = svgCanvas.getDocumentTitle();
return title.trim();
}
var saveSvgAction = extPath + 'savefile.php';
const saveSvgAction = extPath + 'savefile.php';
svgEditor.setCustomHandlers({
save: function save(win, data) {
var svg = '<?xml version="1.0" encoding="UTF-8"?>\n' + data,
filename = getFileNameFromTitle();
save(win, data) {
const svg = '<?xml version="1.0" encoding="UTF-8"?>\n' + data,
filename = getFileNameFromTitle();
$.post(saveSvgAction, {
output_svg: svg,
filename: filename
filename
});
}
});
}
};
return extPhp_savefile;