Add JS functionality for poly button, then disable it for now
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@358 eee81c28-f429-11dd-99c0-75d572ba1dddmaster
parent
7dbc6fcfa2
commit
381e09be87
|
@ -166,7 +166,7 @@
|
|||
<img class="tool_button" id="tools_rect_show" src="images/square.png" title="Square/Rect Tool [4/Shift+4]" alt="Square"/><br/>
|
||||
<img class="tool_button" id="tools_ellipse_show" src="images/circle.png" title="Ellipse/Circle Tool [5/Shift+5]" alt="Circle"/><br/>
|
||||
<img class="tool_button" id="tool_text" src="images/text.png" title="Text Tool [6]" alt="Text"/>
|
||||
<img class="tool_button" id="tool_poly" src="images/polygon.png" title="Poly Tool [7]" alt="Poly"/>
|
||||
<img class="tool_button_disabled" id="tool_poly" src="images/polygon.png" title="Poly Tool [7]" alt="Poly"/>
|
||||
</div> <!-- tools_left -->
|
||||
|
||||
<div id="tools_bottom" class="tools_panel">
|
||||
|
|
|
@ -395,6 +395,16 @@ function svg_edit_setup() {
|
|||
$('#tools_ellipse_show').attr('src', 'images/freehand-circle.png');
|
||||
};
|
||||
|
||||
var clickText = function(){
|
||||
toolButtonClick('#tool_text');
|
||||
svgCanvas.setMode('text');
|
||||
};
|
||||
|
||||
var clickPoly = function(){
|
||||
toolButtonClick('#tool_poly');
|
||||
svgCanvas.setMode('poly');
|
||||
};
|
||||
|
||||
// Delete is a contextual tool that only appears in the ribbon if
|
||||
// an element has been selected
|
||||
var deleteSelected = function() {
|
||||
|
@ -421,11 +431,6 @@ function svg_edit_setup() {
|
|||
}
|
||||
};
|
||||
|
||||
var clickText = function(){
|
||||
toolButtonClick('#tool_text');
|
||||
svgCanvas.setMode('text');
|
||||
};
|
||||
|
||||
var clickClear = function(){
|
||||
if( confirm('Do you want to clear the drawing?\nThis will also erase your undo history!') ) {
|
||||
svgCanvas.clear();
|
||||
|
@ -507,6 +512,7 @@ function svg_edit_setup() {
|
|||
$('#tool_ellipse').mouseup(clickEllipse);
|
||||
$('#tool_fhellipse').mouseup(clickFHEllipse);
|
||||
$('#tool_text').click(clickText);
|
||||
$('#tool_poly').click(clickPoly);
|
||||
$('#tool_clear').click(clickClear);
|
||||
$('#tool_save').click(clickSave);
|
||||
$('#tool_source').click(showSourceEditor);
|
||||
|
@ -572,6 +578,7 @@ function svg_edit_setup() {
|
|||
$(document).bind('keydown', {combi:'Shift+5', disableInInput: true}, clickCircle);
|
||||
$(document).bind('keydown', {combi:'5', disableInInput: true}, clickEllipse);
|
||||
$(document).bind('keydown', {combi:'6', disableInInput: true}, clickText);
|
||||
$(document).bind('keydown', {combi:'7', disableInInput: true}, clickPoly);
|
||||
$(document).bind('keydown', {combi:'N', disableInInput: true}, clickClear);
|
||||
$(document).bind('keydown', {combi:'S', disableInInput: true}, clickSave);
|
||||
$(document).bind('keydown', {combi:'del', disableInInput: true}, function(evt){deleteSelected();evt.preventDefault();});
|
||||
|
|
Loading…
Reference in New Issue