diff --git a/editor/svg-editor.js b/editor/svg-editor.js index 1c240bfb..10b9aa67 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -368,7 +368,6 @@ function svg_edit_setup() { } var clickBold = function(){ - alert('wah?') svgCanvas.setBold( !svgCanvas.getBold() ); updateContextPanel(); }; diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 4cc81003..a527fe56 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -1533,8 +1533,19 @@ function SvgCanvas(c) undoStackPointer = 0; }; - this.getUndoStackSize = function() { return undoStackPointer; } - this.getRedoStackSize = function() { return undoStack.length - undoStackPointer; } + this.getUndoStackSize = function() { return undoStackPointer; }; + this.getRedoStackSize = function() { return undoStack.length - undoStackPointer; }; + + this.getNextUndoCommandText = function() { + if (undoStackPointer > 0) + return undoStack[undoStackPointer-1].text; + return ""; + }; + this.getNextRedoCommandText = function() { + if (undoStackPointer < undoStack.length) + return undoStack[undoStackPointer].text; + return ""; + }; this.undo = function() { if (undoStackPointer > 0) { @@ -1543,7 +1554,7 @@ function SvgCanvas(c) cmd.unapply(); call("changed", cmd.elements()); } - } + }; this.redo = function() { if (undoStackPointer < undoStack.length && undoStack.length > 0) { this.clearSelection();