From 5c67d896ac1d0011eae5548f88b17f740e814c4d Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Thu, 25 Jun 2009 08:31:36 +0000 Subject: [PATCH] buttons for undo/redo git-svn-id: http://svg-edit.googlecode.com/svn/trunk@200 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/images/redo.png | Bin 0 -> 921 bytes editor/images/undo.png | Bin 0 -> 1122 bytes editor/svg-editor.html | 37 ++++++++++++++++++++++--------------- editor/svg-editor.js | 6 ++++-- 4 files changed, 26 insertions(+), 17 deletions(-) create mode 100644 editor/images/redo.png create mode 100644 editor/images/undo.png diff --git a/editor/images/redo.png b/editor/images/redo.png new file mode 100644 index 0000000000000000000000000000000000000000..1169fc3b45767aa8dd025bf3a8ff579360f9bf45 GIT binary patch literal 921 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjY)RhkE&=3)s@@UbGGR0}Pl5~A9 zvlwrzG%=pJ^SZB^-?1}Wg1F)=&J?_#dH?;q>hlc$A9oxL73^O9yL{5=vWGW&j$Zv{ zD;y(b&CPK0t;+6|3GPC-_=LJwCo+6zwE23-Tsw1%mhF!ZX>tr!LbF!>pR6Djew=ZS zRCx9Cx81eNy>(M>My?Lg5jmsNW8>S0884iQQ}1)1{%fczM>%J3U^3+W}udcqkp_}hd zhrG>)4xWkIPdja6Xz^1ytN)>74)?ychKnnhm^Rc@Ts!w)3mCKg@`|BnRozp>j$Uj@ zQ@dMiy|RH}g21E8{qC4_tEQrivM%W_FVp@dhgudVbSbwtlQgeY@hnw=4F#r!b+}Z_mV$xy>juMT=UXl z%DmZ|mI^o=(U6x+aoaI_%^m*4g4Jw~d0C#c?YciVcIWviytWgps?TkRK5{`hC+E!G z4e>?MAN2G-dgz~AsCMvr*wJfmdUAKB@ZRpOIi!F8u5G>S#d-brgWp;)FcmzX1x(ti zC9V-A$wjG&C8@e8K!U-@z`#P+&`8(7IKP(+_?{p`owPgYAGG`@VB=9{Oy1B=X@L z7m+{r>-2NCTG~s`x^Twc@2$##YNluD&cd~qigMoEOfQ?#xUIqW<4VB;aW@4WZhGB$ z)EqF?k72)pAnW?b9eGhZ!jhl7xoT=!_i1lcrFBD%excuVhU5}-w}Us=gtF0`5^A(VC5B2hbP?m&B!35r6AdGh28Zw z>)vi&p0|}h0z(&9|Ne1T9jIw)Mbp}R&K(6+-v#IX`+4=o6%MUy3Mz{n!c5v{^RA9_ zSv%`s(JLd1I~VrGJ^ISea`)*J+b#ZkMf?p`%Ql#(#h+_alM{Gpn90(>Dqya))HKDs zE>CwJ(--?MChO|{KlZNmc`FXZ{wjJxe)&|1^yQ{-E zvshomiWK~8Z|L1-n(>o=S-)=lnZWxgpZ@5!9DaEAYqPr}pB(E+(Yx)RZ(2)VEwbOf zl9!KLZ1V1mXA>Na+k0{unTj%(X4%ZQspk%8o4fDQYV~(>e4n4lUcI_9L-y{RsK|3U z!c%rS&XoRcta35-)gAXnaiPG1!kar~meomreY$!7+s*alPR@Bb5sXTHD?aY$-HeN36(!)K+E z44p12weOhktM8NBED^17Gu!*k+HyPBm?cXU{pK=UQhDOj&g2jls_~fJOmDP^ZCZa{3)snZJ<*;}&{kZPl?bCmX z2Zy~{?;7*}hsirLB@w4Hj7fcax9#=55XF7z$^D9=c0&`<%=>1R8m6vjNCDss-WMyP%WoV*pU|?lnP*}M53QR+8eoAIq XB>@e32d+KbP0l+XkKNr2&Q literal 0 HcmV?d00001 diff --git a/editor/svg-editor.html b/editor/svg-editor.html index 83bb74ed..6ccc1f9a 100644 --- a/editor/svg-editor.html +++ b/editor/svg-editor.html @@ -35,6 +35,13 @@ Save + +
+ | + Undo + Redo +
+
| @@ -59,47 +66,47 @@ - + - + - + - +
| - + - + - +
| - + - + - + - +
| - + - + - + - +
diff --git a/editor/svg-editor.js b/editor/svg-editor.js index 96204ba2..9869928d 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -326,12 +326,12 @@ function svg_edit_setup() { } var clickUndo = function(){ - if (svgCanvas.getUndoStackSize() > 0) + if (svgCanvas.getUndoStackSize() > 0) svgCanvas.undo(); } var clickRedo = function(){ - if (svgCanvas.getRedoStackSize() > 0) + if (svgCanvas.getRedoStackSize() > 0) svgCanvas.redo(); } @@ -350,6 +350,8 @@ function svg_edit_setup() { $('#tool_delete').click(deleteSelected); $('#tool_move_top').click(moveToTopSelected); $('#tool_move_bottom').click(moveToBottomSelected); + $('#tool_undo').click(clickUndo); + $('#tool_redo').click(clickRedo); // added these event handlers for all the push buttons so they // behave more like buttons being pressed-in and not images