Fix bug in whitelist that I introduced. FIx more tabination. Move image tool after polygon and add shortcut key (8)

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@585 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Jeff Schiller 2009-09-05 11:34:51 +00:00
parent 93cfb44e91
commit 60b1aa01ba
3 changed files with 11 additions and 11 deletions

View File

@ -210,9 +210,9 @@
<img class="flyout_arrow_horiz" src="images/flyouth.png"/> <img class="flyout_arrow_horiz" src="images/flyouth.png"/>
<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="tools_ellipse_show" src="images/circle.png" title="Ellipse/Circle Tool [5/Shift+5]" alt="Circle"/><br/>
<img class="flyout_arrow_horiz" src="images/flyouth.png"/> <img class="flyout_arrow_horiz" src="images/flyouth.png"/>
<img class="tool_button" id="tool_image" src="images/image.png" title="Image Tool" alt="Image"/>
<img class="tool_button" id="tool_text" src="images/text.png" title="Text Tool [6]" alt="Text"/> <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" id="tool_poly" src="images/polygon.png" title="Poly Tool [7]" alt="Poly"/>
<img class="tool_button" id="tool_image" src="images/image.png" title="Image Tool [8]" alt="Image"/>
</div> <!-- tools_left --> </div> <!-- tools_left -->
<div id="tools_bottom" class="tools_panel"> <div id="tools_bottom" class="tools_panel">

View File

@ -176,7 +176,7 @@ function svg_edit_setup() {
// update contextual tools here // update contextual tools here
var panels = { var panels = {
rect: ['radius','x','y','width','height'], rect: ['radius','x','y','width','height'],
image: ['x','y','width','height'], image: ['x','y','width','height'],
circle: ['cx','cy','r'], circle: ['cx','cy','r'],
ellipse: ['cx','cy','rx','ry'], ellipse: ['cx','cy','rx','ry'],
line: ['x1','y1','x2','y2'], line: ['x1','y1','x2','y2'],
@ -216,13 +216,11 @@ function svg_edit_setup() {
if (svgCanvas.addedNew) { if (svgCanvas.addedNew) {
$('#text').focus().select(); $('#text').focus().select();
} }
}else if(el_name == 'image') { }
var xlinkNS="http://www.w3.org/1999/xlink"; else if(el_name == 'image') {
$('#image_url').val(elem.getAttributeNS(xlinkNS, "href")); var xlinkNS="http://www.w3.org/1999/xlink";
$('#image_url').val(elem.getAttributeNS(xlinkNS, "href"));
} }
} }
} // if (elem != null) } // if (elem != null)
else if (multiselected) { else if (multiselected) {
@ -642,7 +640,7 @@ function svg_edit_setup() {
$('#tool_circle').mouseup(clickCircle); $('#tool_circle').mouseup(clickCircle);
$('#tool_ellipse').mouseup(clickEllipse); $('#tool_ellipse').mouseup(clickEllipse);
$('#tool_fhellipse').mouseup(clickFHEllipse); $('#tool_fhellipse').mouseup(clickFHEllipse);
$('#tool_image').mouseup(clickImage); $('#tool_image').mouseup(clickImage);
$('#tool_text').click(clickText); $('#tool_text').click(clickText);
$('#tool_poly').click(clickPoly); $('#tool_poly').click(clickPoly);
$('#tool_clear').click(clickClear); $('#tool_clear').click(clickClear);
@ -723,6 +721,7 @@ function svg_edit_setup() {
['5', clickEllipse], ['5', clickEllipse],
['6', clickText], ['6', clickText],
['7', clickPoly], ['7', clickPoly],
['8', clickImage],
[modKey+'N', function(evt){clickClear();evt.preventDefault();}], [modKey+'N', function(evt){clickClear();evt.preventDefault();}],
[modKey+'S', function(evt){editingsource?saveSourceEditor():clickSave();evt.preventDefault();}], [modKey+'S', function(evt){editingsource?saveSourceEditor():clickSave();evt.preventDefault();}],
[modKey+'O', function(evt){clickOpen();evt.preventDefault();}], [modKey+'O', function(evt){clickOpen();evt.preventDefault();}],

View File

@ -13,7 +13,7 @@ var svgWhiteList = {
"circle": ["cx", "cy", "fill", "fill-opacity", "id", "opacity", "r", "stroke", "stroke-dasharray", "stroke-opacity", "stroke-width", "transform"], "circle": ["cx", "cy", "fill", "fill-opacity", "id", "opacity", "r", "stroke", "stroke-dasharray", "stroke-opacity", "stroke-width", "transform"],
"defs": [], "defs": [],
"ellipse": ["cx", "cy", "fill", "fill-opacity", "id", "opacity", "rx", "ry", "stroke", "stroke-dasharray", "stroke-opacity", "stroke-width", "transform"], "ellipse": ["cx", "cy", "fill", "fill-opacity", "id", "opacity", "rx", "ry", "stroke", "stroke-dasharray", "stroke-opacity", "stroke-width", "transform"],
"image": ["height", "id", "opacity", "transform" "width", "x", "xlink:href", "xlink:title", "y"], "image": ["height", "id", "opacity", "transform", "width", "x", "xlink:href", "xlink:title", "y"],
"line": ["fill", "fill-opacity", "id", "opacity", "stroke", "stroke-dasharray", "stroke-linecap", "stroke-opacity", "stroke-width", "transform", "x1", "x2", "y1", "y2"], "line": ["fill", "fill-opacity", "id", "opacity", "stroke", "stroke-dasharray", "stroke-linecap", "stroke-opacity", "stroke-width", "transform", "x1", "x2", "y1", "y2"],
"linearGradient": ["id", "gradientTransform", "gradientUnits", "spreadMethod", "x1", "x2", "y1", "y2"], "linearGradient": ["id", "gradientTransform", "gradientUnits", "spreadMethod", "x1", "x2", "y1", "y2"],
"path": ["d", "fill", "fill-opacity", "id", "opacity", "stroke", "stroke-dasharray", "stroke-linecap", "stroke-linejoin", "stroke-opacity", "stroke-width", "transform"], "path": ["d", "fill", "fill-opacity", "id", "opacity", "stroke", "stroke-dasharray", "stroke-linecap", "stroke-linejoin", "stroke-opacity", "stroke-width", "transform"],
@ -2447,6 +2447,7 @@ function BatchCommand(text) {
}; };
this.setFillColor = function(val,preventUndo) { this.setFillColor = function(val,preventUndo) {
console.log('setFillColor(' + val + ')');
cur_properties.fill = val; cur_properties.fill = val;
cur_properties.fill_paint = {type:"solidColor"}; cur_properties.fill_paint = {type:"solidColor"};
// take out any path/line elements when setting fill // take out any path/line elements when setting fill