From 79522f74343e75e21704cafa920e51f161a9a94e Mon Sep 17 00:00:00 2001 From: Jeff Schiller Date: Tue, 13 Oct 2009 03:16:02 +0000 Subject: [PATCH] Prompt user when moving elements to a layer. Remove some dead code. Comment more prompts needing localization. git-svn-id: http://svg-edit.googlecode.com/svn/trunk@812 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svg-editor.js | 9 +++++---- editor/svgcanvas.js | 5 +++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/editor/svg-editor.js b/editor/svg-editor.js index 9a7438de..b8a7b25f 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -373,7 +373,8 @@ function svg_edit_setup() { // fired when user wants to move elements to another layer $('#selLayerNames').change(function(){ var destLayer = this.options[this.selectedIndex].value; - if (destLayer) { + // TODO: localize this prompt + if (destLayer && confirm('Move selected elements to layer \'' + destLayer + '\'?')) { svgCanvas.moveSelectedToLayer(destLayer); svgCanvas.clearSelection(); } @@ -701,6 +702,7 @@ function svg_edit_setup() { } var clickClear = function(){ + // TODO: localize this prompt if( confirm('Do you want to clear the drawing?\nThis will also erase your undo history!') ) { svgCanvas.clear(); updateContextPanel(); @@ -814,6 +816,7 @@ function svg_edit_setup() { if (!editingsource) return; if (!svgCanvas.setSvgString($('#svg_source_textarea').val())) { + // TODO: localize this prompt if( !confirm('There were parsing errors in your SVG source.\nRevert back to original SVG source?') ) { return false; } @@ -843,6 +846,7 @@ function svg_edit_setup() { if (editingsource) { var oldString = svgCanvas.getSvgString(); if (oldString != $('#svg_source_textarea').val()) { + // TODO: localize this prompt if( !confirm('Ignore changes made to SVG source?') ) { return false; } @@ -1274,10 +1278,8 @@ function svg_edit_setup() { var populateLayers = function(){ var layerlist = $('#layerlist tbody'); var selLayerNames = $('#selLayerNames'); - var mselLayerNames = $('#mselLayerNames'); layerlist.empty(); selLayerNames.empty(); - mselLayerNames.empty(); var layer = svgCanvas.getNumLayers(); // we get the layers in the reverse z-order (the layer rendered on top is listed first) while (layer--) { @@ -1290,7 +1292,6 @@ function svg_edit_setup() { layerlist.append("" + name + ""); } selLayerNames.append(""); - mselLayerNames.append(""); } // if we only have one layer, then always make sure that layer is selected // (This is really only required upon first initialization) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 10ec15c1..5ecb72a2 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -3755,6 +3755,8 @@ function BatchCommand(text) { return null; }; + + // Group: Fill and Stroke this.setStrokePaint = function(p, addGrad) { // make a copy @@ -3798,6 +3800,9 @@ function BatchCommand(text) { return cur_properties.stroke_width; }; + // TODO: this seems like two bugs - if val is 0 and current_mode is NOT line/scribble, then + // we RECURSIVELY call setStrokeWidth(1) and then the rest of the function continues and + // stroke_width is set to 0 and selected element's stroke-width is set to 0 this.setStrokeWidth = function(val) { if(val == 0 && $.inArray(current_mode, ['line', 'path']) == -1) { canvas.setStrokeWidth(1);