(function () { 'use strict'; /* globals jQuery */ /* * ext-server_opensave.js * * Licensed under the MIT License * * Copyright(c) 2010 Alexis Deveria * */ svgEditor.addExtension('server_opensave', { callback: function callback(_ref) { var canvg = _ref.canvg, decode64 = _ref.decode64, encode64 = _ref.encode64, buildCanvgCallback = _ref.buildCanvgCallback; var $ = jQuery; var svgCanvas = svgEditor.canvas; function getFileNameFromTitle() { var title = svgCanvas.getDocumentTitle(); // We convert (to underscore) only those disallowed Win7 file name characters return title.trim().replace(/[/\\:*?"<>|]/g, '_'); } function xhtmlEscape(str) { return str.replace(/&(?!amp;)/g, '&').replace(/"/g, '"').replace(/')[0].download === ''; var a = void 0; if (support) { a = $('hidden').attr({ download: (filename || 'image') + suffix, href: uri }).css('display', 'none').appendTo('body'); a[0].click(); return true; } } var saveSvgAction = svgEditor.curConfig.extPath + 'filesave.php', saveImgAction = svgEditor.curConfig.extPath + 'filesave.php'; // Create upload target (hidden iframe) var cancelled = false; $('