From 381e09be873676125edb3b858f565fa5716e82b8 Mon Sep 17 00:00:00 2001 From: Jeff Schiller Date: Fri, 7 Aug 2009 03:46:51 +0000 Subject: [PATCH] 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-75d572ba1ddd --- editor/svg-editor.html | 2 +- editor/svg-editor.js | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/editor/svg-editor.html b/editor/svg-editor.html index 0331d26c..812c83d8 100644 --- a/editor/svg-editor.html +++ b/editor/svg-editor.html @@ -166,7 +166,7 @@ Square
Circle
Text - Poly + Poly
diff --git a/editor/svg-editor.js b/editor/svg-editor.js index e43a3c0e..d9a85588 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -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();});