From e4af0eb2617bf20aac29785045460dd320f1602c Mon Sep 17 00:00:00 2001 From: Jeff Schiller Date: Mon, 6 Jul 2009 18:54:38 +0000 Subject: [PATCH] Woops again, left a debug alert in by accident git-svn-id: http://svg-edit.googlecode.com/svn/trunk@274 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svg-editor.js | 1 - editor/svgcanvas.js | 17 ++++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) 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();