1 line
1.4 KiB
XML
1 line
1.4 KiB
XML
{"version":3,"file":"ext-php_savefile.js","sources":["../../../src/editor/extensions/ext-php_savefile.js"],"sourcesContent":["// TODO: Might add support for \"exportImage\" custom\n// handler as in \"ext-server_opensave.js\" (and in savefile.php)\n\nexport default {\n name: 'php_savefile',\n init ({$}) {\n const svgEditor = this;\n const {\n curConfig: {extPath},\n canvas: svgCanvas\n } = svgEditor;\n /**\n * Get file name out of SVGEdit document title.\n * @returns {string}\n */\n function getFileNameFromTitle () {\n const title = svgCanvas.getDocumentTitle();\n return title.trim();\n }\n const saveSvgAction = extPath + 'savefile.php';\n svgEditor.setCustomHandlers({\n save (win, data) {\n const svg = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n' + data,\n filename = getFileNameFromTitle();\n\n $.post(saveSvgAction, {output_svg: svg, filename});\n }\n });\n }\n};\n"],"names":["name","init","$","svgEditor","this","extPath","curConfig","svgCanvas","canvas","saveSvgAction","setCustomHandlers","save","win","data","svg","filename","getFileNameFromTitle","getDocumentTitle","trim","post","output_svg"],"mappings":"cAGe,CACbA,KAAM,eACNC,0BAAOC,IAAAA,EACCC,EAAYC,KAEJC,EAEVF,EAFFG,UAAYD,QACJE,EACNJ,EADFK,WAUIC,EAAgBJ,EAAU,eAChCF,EAAUO,kBAAkB,CAC1BC,mBAAMC,EAAKC,OACHC,EAAM,2CAA6CD,EACvDE,WARGC,8BACOT,EAAUU,mBACXC,OAMEF,GAEbd,EAAEiB,KAAKV,EAAe,CAACW,WAAYN,EAAKC,SAAAA"} |