Starting Branch to simplify Build process

This commit is contained in:
JFH
2020-08-05 19:58:06 +02:00
parent 8f827c973f
commit 31bca25b1c
344 changed files with 24742 additions and 179621 deletions

View File

@@ -1,39 +1,30 @@
var svgEditorExtension_php_savefile = (function () {
'use strict';
// TODO: Might add support for "exportImage" custom
// handler as in "ext-server_opensave.js" (and in savefile.php)
// TODO: Might add support for "exportImage" custom
// 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;
/**
* Get file name out of SVGEdit document title.
* @returns {string}
*/
function getFileNameFromTitle() {
var title = svgCanvas.getDocumentTitle();
return title.trim();
}
var saveSvgAction = extPath + 'savefile.php';
svgEditor.setCustomHandlers({
save: function save(win, data) {
var svg = '<?xml version="1.0" encoding="UTF-8"?>\n' + data,
filename = getFileNameFromTitle();
$.post(saveSvgAction, {
output_svg: svg,
filename: filename
});
}
});
export default {
name: 'php_savefile',
init ({$}) {
const svgEditor = this;
const {
curConfig: {extPath},
canvas: svgCanvas
} = svgEditor;
/**
* Get file name out of SVGEdit document title.
* @returns {string}
*/
function getFileNameFromTitle () {
const title = svgCanvas.getDocumentTitle();
return title.trim();
}
};
const saveSvgAction = extPath + 'savefile.php';
svgEditor.setCustomHandlers({
save (win, data) {
const svg = '<?xml version="1.0" encoding="UTF-8"?>\n' + data,
filename = getFileNameFromTitle();
return extPhp_savefile;
}());
$.post(saveSvgAction, {output_svg: svg, filename});
}
});
}
};