add extensions and locales

This commit is contained in:
jfh
2020-08-24 01:23:00 +02:00
parent f542676098
commit 5b6e3fef8e
481 changed files with 144942 additions and 86993 deletions

View File

@@ -0,0 +1,41 @@
System.register([], function (exports) {
'use strict';
return {
execute: function () {
// TODO: Might add support for "exportImage" custom
// handler as in "ext-server_opensave.js" (and in savefile.php)
var extPhp_savefile = exports('default', {
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
});
}
});
}
});
}
};
});