Fixed issues 269 and 307, added clone SVG icon

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@888 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Alexis Deveria 2009-10-29 19:43:34 +00:00
parent e960db29ff
commit 0e578d675c
5 changed files with 44 additions and 9 deletions

View File

@ -280,6 +280,30 @@
</svg>
</foreignContent>
<foreignContent id="clone">
<svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18">
<!-- Created with SVG-edit - http://svg-edit.googlecode.com/ -->
<defs>
<linearGradient y2="1" x2="1" y1="0" x1="0" id="svg_36">
<stop stop-opacity="1" stop-color="#f9f3de" offset="0"/>
<stop stop-opacity="1" stop-color="#ccbd8f" offset="1"/>
</linearGradient>
<linearGradient y2="0.80078" x2="0.42578" y1="0" x1="0" id="svg_69">
<stop stop-opacity="1" stop-color="#f9f3de" offset="0"/>
<stop stop-opacity="1" stop-color="#af995b" offset="1"/>
</linearGradient>
</defs>
<g>
<path stroke="#8f5902" fill="url(#svg_69)" id="svg_34" d="m2.11676,16.32061l-0.13787,-5.05515l1.93015,-2.02206l10.11029,0l2.02206,2.29779l0,4.77941l-13.92463,0z"/>
<title>Layer 1</title>
<rect x="7.85379" y="6.30027" width="2.2932" height="4.3407" id="svg_38" fill="url(#svg_36)" stroke="#8f5902" rx="1" ry="1"/>
<circle stroke="#8f5902" fill="url(#svg_36)" id="svg_35" r="2.96392" cy="4.48149" cx="9.11757"/>
<line x1="2.44838" y1="12.03512" x2="15.5524" y2="12.03512" id="svg_39" stroke="#f9f3de" fill="none"/>
<path d="m6.72427,12.55859l4.74203,0l-2.30831,2.07258l-2.43372,-2.07258z" id="svg_43" fill="#000000" stroke="#8f5902" fill-opacity="0.76" stroke-width="0"/>
</g>
</svg>
</foreignContent>
<g id="svg_eof"/>
</svg>

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -92,8 +92,8 @@
{"id":"layersLable","textContent":"Layers:"},
{"id":"selectedPredefined","textContent":"Select predefined:"},
{"id":"fitToContent","textContent":"Fit to Content"},
{"id":"tool_source_save","textContent":"Save"},
{"id":"tool_docprops_save","textContent":"Save"},
{"id":"tool_source_save","textContent":"Apply Changes"},
{"id":"tool_docprops_save","textContent":"OK"},
{"id":"tool_docprops_cancel","textContent":"Cancel"},
{"id":"tool_source_cancel","textContent":"Cancel"},
{"id":"fit_to_all","textContent":"Fit to all content"},

View File

@ -55,7 +55,10 @@ $(function() {
'text':'text.png',
'image':'image.png',
'zoom':'zoom.png',
'arrow_right':'flyouth.png',
'clone':'clone.png',
'arrow_right':'flyouth.png'
},
placement: {
'#tool_clear':'new_image',
@ -76,6 +79,9 @@ $(function() {
'#tool_text':'text',
'#tool_image':'image',
'#tool_zoom':'zoom',
'#tool_clone,#tool_clone_multi,#tool_node_clone':'clone',
'.flyout_arrow_horiz':'arrow_right'
},
callback: function() {
@ -168,7 +174,7 @@ script type="text/javascript" src="locale/locale.min.js"></script-->
<!-- Buttons when a single element is selected -->
<div id="selected_panel">
<img class="tool_sep" src="images/sep.png" alt="|"/>
<img class="push_button" id="tool_clone" src="images/clone.png" title="Clone Element [C]" alt="Copy"/>
<div class="push_button" id="tool_clone" title="Clone Element [C]"></div>
<img class="push_button" id="tool_delete" src="images/delete.png" title="Delete Element [Delete/Backspace]" alt="Delete"/>
<img class="tool_sep" src="images/sep.png" alt="|"/>
<img class="push_button" id="tool_move_top" src="images/move_top.png" title="Move to Top [Shift+Up]" alt="Top"/>
@ -197,7 +203,7 @@ script type="text/javascript" src="locale/locale.min.js"></script-->
<!-- Buttons when multiple elements are selected -->
<div id="multiselected_panel">
<img class="tool_sep" src="images/sep.png" alt="|"/>
<img class="push_button" id="tool_clone_multi" src="images/clone.png" title="Clone Elements [C]" alt="Clone"/>
<div class="push_button" id="tool_clone_multi" title="Clone Elements [C]"></div>
<img class="push_button" id="tool_delete_multi" src="images/delete.png" title="Delete Selected Elements [Delete/Backspace]" alt="Delete"/>
<img class="tool_sep" src="images/sep.png" alt="|"/>
<img class="push_button" id="tool_group" src="images/shape_group.png" title="Group Elements [G]" alt="Group"/>
@ -315,7 +321,7 @@ script type="text/javascript" src="locale/locale.min.js"></script-->
<option id="straight_segments" selected="selected" value="4">Straight</option>
<option id="curve_segments" value="6">Curve</option>
</select>
<img class="tool_button" id="tool_node_clone" src="images/clone.png" title="Clone Node" alt="Clone"/>
<div class="tool_button" id="tool_node_clone" title="Clone Node"></div>
<img class="tool_button" id="tool_node_delete" src="images/delete.png" title="Delete Node" alt="Delete"/>
</div>
@ -426,7 +432,7 @@ script type="text/javascript" src="locale/locale.min.js"></script-->
<div id="svg_docprops_overlay"></div>
<div id="svg_docprops_container">
<div id="tool_docprops_back" class="toolbar_button">
<button id="tool_docprops_save">Save</button>
<button id="tool_docprops_save">OK</button>
<button id="tool_docprops_cancel">Cancel</button>
<label><span id="svginfo_title">Image title:</span> <input type="text" id="canvas_title" size="24"></label>

View File

@ -347,7 +347,7 @@ script type="text/javascript" src="locale/locale.min.js"></script-->
<div id="svg_source_overlay"></div>
<div id="svg_source_container">
<div id="tool_source_back" class="toolbar_button">
<button id="tool_source_save">Save</button>
<button id="tool_source_save">Apply Changes</button>
<button id="tool_source_cancel">Cancel</button>
</div>
<form>
@ -360,7 +360,7 @@ script type="text/javascript" src="locale/locale.min.js"></script-->
<div id="svg_docprops_overlay"></div>
<div id="svg_docprops_container">
<div id="tool_docprops_back" class="toolbar_button">
<button id="tool_docprops_save">Save</button>
<button id="tool_docprops_save">OK</button>
<button id="tool_docprops_cancel">Cancel</button>
<label><span id="svginfo_title">Image title:</span> <input type="text" id="canvas_title" size="24"></label>

View File

@ -1041,6 +1041,11 @@ function BatchCommand(text) {
var svgCanvasToString = function() {
removeUnusedGrads();
canvas.clearPath(true);
$.each(svgcontent.childNodes, function(i, node) {
if(i && node.nodeType == 8 && node.data.indexOf('Created with') != -1) {
svgcontent.insertBefore(node, svgcontent.firstChild);
}
});
svgcontent.removeAttribute('id');
var output = svgToString(svgcontent, 0);
svgcontent.id = 'svgcontent';