buttons for undo/redo
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@200 eee81c28-f429-11dd-99c0-75d572ba1dddmaster
parent
1f5fca2fd6
commit
5c67d896ac
Binary file not shown.
After Width: | Height: | Size: 921 B |
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
|
@ -35,6 +35,13 @@
|
|||
<img class="tool_button" id="tool_save" src="images/save.png" title="Save Image [S]" alt="Save"/>
|
||||
</div>
|
||||
|
||||
<!-- History buttons -->
|
||||
<div>
|
||||
<img class="tool_sep" src="images/sep.png" alt="|"/>
|
||||
<img class="tool_button" id="tool_undo" src="images/undo.png" title="Undo [Z]" alt="Undo" />
|
||||
<img class="tool_button" id="tool_redo" src="images/redo.png" title="Redo [Shift+Z/Y]" alt="Redo"/>
|
||||
</div>
|
||||
|
||||
<!-- Buttons when something is selected -->
|
||||
<div id="selected_panel">
|
||||
<img class="tool_sep" src="images/sep.png" alt="|"/>
|
||||
|
@ -59,47 +66,47 @@
|
|||
<option value="20">20</option>
|
||||
</select>
|
||||
<label class="rect_tool">x:</label>
|
||||
<input id="rect_x" class="rect_tool attr_changer" title="Change rectangle X coordinate" alt="x" size="5"/>
|
||||
<input id="rect_x" class="rect_tool attr_changer" title="Change rectangle X coordinate" alt="x" size="3"/>
|
||||
<label class="rect_tool">y:</label>
|
||||
<input id="rect_y" class="rect_tool attr_changer" title="Change rectangle Y coordinate" alt="y" size="5"/>
|
||||
<input id="rect_y" class="rect_tool attr_changer" title="Change rectangle Y coordinate" alt="y" size="3"/>
|
||||
<label class="rect_tool">width:</label>
|
||||
<input id="rect_w" class="rect_tool attr_changer" title="Change rectangle width" alt="width" size="5"/>
|
||||
<input id="rect_w" class="rect_tool attr_changer" title="Change rectangle width" alt="width" size="3"/>
|
||||
<label class="rect_tool">height:</label>
|
||||
<input id="rect_h" class="rect_tool attr_changer" title="Change rectangle height" alt="height" size="5"/>
|
||||
<input id="rect_h" class="rect_tool attr_changer" title="Change rectangle height" alt="height" size="3"/>
|
||||
</div>
|
||||
|
||||
<div id="circle_panel">
|
||||
<img class="tool_sep" src="images/sep.png" alt="|"/>
|
||||
<label class="circle_tool">cx:</label>
|
||||
<input id="circle_cx" class="circle_tool attr_changer" title="Change circle's cx coordinate" alt="cx" size="5"/>
|
||||
<input id="circle_cx" class="circle_tool attr_changer" title="Change circle's cx coordinate" alt="cx" size="3"/>
|
||||
<label class="circle_tool">cy:</label>
|
||||
<input id="circle_cy" class="circle_tool attr_changer" title="Change circle's cy coordinate" alt="cy" size="5"/>
|
||||
<input id="circle_cy" class="circle_tool attr_changer" title="Change circle's cy coordinate" alt="cy" size="3"/>
|
||||
<label class="circle_tool">r:</label>
|
||||
<input id="circle_r" class="circle_tool attr_changer" title="Change circle's radius" alt="r" size="5"/>
|
||||
<input id="circle_r" class="circle_tool attr_changer" title="Change circle's radius" alt="r" size="3"/>
|
||||
</div>
|
||||
|
||||
<div id="ellipse_panel">
|
||||
<img class="tool_sep" src="images/sep.png" alt="|"/>
|
||||
<label class="ellipse_tool">cx:</label>
|
||||
<input id="ellipse_cx" class="ellipse_tool attr_changer" title="Change ellipse's cx coordinate" alt="cx" size="5"/>
|
||||
<input id="ellipse_cx" class="ellipse_tool attr_changer" title="Change ellipse's cx coordinate" alt="cx" size="3"/>
|
||||
<label class="ellipse_tool">cy:</label>
|
||||
<input id="ellipse_cy" class="ellipse_tool attr_changer" title="Change ellipse's cy coordinate" alt="cy" size="5"/>
|
||||
<input id="ellipse_cy" class="ellipse_tool attr_changer" title="Change ellipse's cy coordinate" alt="cy" size="3"/>
|
||||
<label class="ellipse_tool">rx:</label>
|
||||
<input id="ellipse_rx" class="ellipse_tool attr_changer" title="Change ellipse's x radius" alt="rx" size="5"/>
|
||||
<input id="ellipse_rx" class="ellipse_tool attr_changer" title="Change ellipse's x radius" alt="rx" size="3"/>
|
||||
<label class="ellipse_tool">ry:</label>
|
||||
<input id="ellipse_ry" class="ellipse_tool attr_changer" title="Change ellipse's y radius" alt="ry" size="5"/>
|
||||
<input id="ellipse_ry" class="ellipse_tool attr_changer" title="Change ellipse's y radius" alt="ry" size="3"/>
|
||||
</div>
|
||||
|
||||
<div id="line_panel">
|
||||
<img class="tool_sep" src="images/sep.png" alt="|"/>
|
||||
<label class="line_tool">x1:</label>
|
||||
<input id="line_x1" class="line_tool attr_changer" title="Change line's starting x coordinate" alt="x1" size="5"/>
|
||||
<input id="line_x1" class="line_tool attr_changer" title="Change line's starting x coordinate" alt="x1" size="3"/>
|
||||
<label class="line_tool">y1:</label>
|
||||
<input id="line_y1" class="line_tool attr_changer" title="Change line's starting y coordinate" alt="y1" size="5"/>
|
||||
<input id="line_y1" class="line_tool attr_changer" title="Change line's starting y coordinate" alt="y1" size="3"/>
|
||||
<label class="line_tool">x2:</label>
|
||||
<input id="line_x2" class="line_tool attr_changer" title="Change line's ending x coordinate" alt="x2" size="5"/>
|
||||
<input id="line_x2" class="line_tool attr_changer" title="Change line's ending x coordinate" alt="x2" size="3"/>
|
||||
<label class="line_tool">y2:</label>
|
||||
<input id="line_y2" class="line_tool attr_changer" title="Change line's ending y coordinate" alt="x1" size="5"/>
|
||||
<input id="line_y2" class="line_tool attr_changer" title="Change line's ending y coordinate" alt="x1" size="3"/>
|
||||
</div>
|
||||
|
||||
<div id="text_panel">
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue