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="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="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_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 id="tools_bottom" class="tools_panel">

View File

@ -176,7 +176,7 @@ function svg_edit_setup() {
// update contextual tools here
var panels = {
rect: ['radius','x','y','width','height'],
image: ['x','y','width','height'],
image: ['x','y','width','height'],
circle: ['cx','cy','r'],
ellipse: ['cx','cy','rx','ry'],
line: ['x1','y1','x2','y2'],
@ -216,13 +216,11 @@ function svg_edit_setup() {
if (svgCanvas.addedNew) {
$('#text').focus().select();
}
}else if(el_name == 'image') {
var xlinkNS="http://www.w3.org/1999/xlink";
$('#image_url').val(elem.getAttributeNS(xlinkNS, "href"));
}
}
else if(el_name == 'image') {
var xlinkNS="http://www.w3.org/1999/xlink";
$('#image_url').val(elem.getAttributeNS(xlinkNS, "href"));
}
}
} // if (elem != null)
else if (multiselected) {
@ -642,7 +640,7 @@ function svg_edit_setup() {
$('#tool_circle').mouseup(clickCircle);
$('#tool_ellipse').mouseup(clickEllipse);
$('#tool_fhellipse').mouseup(clickFHEllipse);
$('#tool_image').mouseup(clickImage);
$('#tool_image').mouseup(clickImage);
$('#tool_text').click(clickText);
$('#tool_poly').click(clickPoly);
$('#tool_clear').click(clickClear);
@ -723,6 +721,7 @@ function svg_edit_setup() {
['5', clickEllipse],
['6', clickText],
['7', clickPoly],
['8', clickImage],
[modKey+'N', function(evt){clickClear();evt.preventDefault();}],
[modKey+'S', function(evt){editingsource?saveSourceEditor():clickSave();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"],
"defs": [],
"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"],
"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"],
@ -2447,6 +2447,7 @@ function BatchCommand(text) {
};
this.setFillColor = function(val,preventUndo) {
console.log('setFillColor(' + val + ')');
cur_properties.fill = val;
cur_properties.fill_paint = {type:"solidColor"};
// take out any path/line elements when setting fill