Avoid window.name security errors and make export window name configurable through config.exportWindowType (new|same) based on configurable canvas name
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2855 eee81c28-f429-11dd-99c0-75d572ba1dddmaster
parent
5bddabcec3
commit
3fdb8f4377
|
@ -34,6 +34,7 @@ TODOS
|
||||||
//
|
//
|
||||||
// STATE MAINTENANCE PROPERTIES
|
// STATE MAINTENANCE PROPERTIES
|
||||||
editor.tool_scale = 1; // Dependent on icon size, so any use to making configurable instead? Used by JQuerySpinBtn.js
|
editor.tool_scale = 1; // Dependent on icon size, so any use to making configurable instead? Used by JQuerySpinBtn.js
|
||||||
|
editor.exportWindowCt = 0;
|
||||||
editor.langChanged = false;
|
editor.langChanged = false;
|
||||||
editor.showSaveWarning = false;
|
editor.showSaveWarning = false;
|
||||||
editor.storagePromptClosed = false; // For use with ext-storage.js
|
editor.storagePromptClosed = false; // For use with ext-storage.js
|
||||||
|
@ -114,6 +115,7 @@ TODOS
|
||||||
initOpacity: 1,
|
initOpacity: 1,
|
||||||
colorPickerCSS: null, // Defaults to 'left' with a position equal to that of the fill_color or stroke_color element minus 140, and a 'bottom' equal to 40
|
colorPickerCSS: null, // Defaults to 'left' with a position equal to that of the fill_color or stroke_color element minus 140, and a 'bottom' equal to 40
|
||||||
initTool: 'select',
|
initTool: 'select',
|
||||||
|
exportWindowType: 'new', // 'same' (todo: also support 'download')
|
||||||
wireframe: false,
|
wireframe: false,
|
||||||
showlayers: false,
|
showlayers: false,
|
||||||
no_save_warning: false,
|
no_save_warning: false,
|
||||||
|
@ -3650,13 +3652,17 @@ TODOS
|
||||||
// Open placeholder window (prevents popup)
|
// Open placeholder window (prevents popup)
|
||||||
if (!customExportImage) {
|
if (!customExportImage) {
|
||||||
var str = uiStrings.notification.loadingImage;
|
var str = uiStrings.notification.loadingImage;
|
||||||
|
if (curConfig.exportWindowType === 'new') {
|
||||||
|
editor.exportWindowCt++;
|
||||||
|
}
|
||||||
|
var exportWindowName = curConfig.canvasName + editor.exportWindowCt;
|
||||||
exportWindow = window.open(
|
exportWindow = window.open(
|
||||||
'data:text/html;charset=utf-8,' + encodeURIComponent('<title>' + str + '</title><h1>' + str + '</h1>'),
|
'data:text/html;charset=utf-8,' + encodeURIComponent('<title>' + str + '</title><h1>' + str + '</h1>'),
|
||||||
'svg-edit-exportWindow'
|
exportWindowName
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
var quality = parseInt($('#image-slider').val(), 10)/100;
|
var quality = parseInt($('#image-slider').val(), 10)/100;
|
||||||
svgCanvas.rasterExport(imgType, quality, (exportWindow && exportWindow.name));
|
svgCanvas.rasterExport(imgType, quality, exportWindowName);
|
||||||
}, function () {
|
}, function () {
|
||||||
var sel = $(this);
|
var sel = $(this);
|
||||||
if (sel.val() === 'JPEG' || sel.val() === 'WEBP') {
|
if (sel.val() === 'JPEG' || sel.val() === 'WEBP') {
|
||||||
|
|
Loading…
Reference in New Issue