Added 'Import SVG' menu item and icon - only shows up in Firefox 3.6 and functions identically to Open at the moment
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1420 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
@@ -292,6 +292,19 @@
|
||||
</svg>
|
||||
</g>
|
||||
|
||||
<g id="import">
|
||||
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<defs>
|
||||
<linearGradient y2="0.875" x2="0.21484" y1="0.00391" x1="0.04297" id="svg_46_import">
|
||||
<stop stop-opacity="1" stop-color="#81f4bb" offset="0"/>
|
||||
<stop stop-opacity="1" stop-color="#37b76e" offset="1"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<rect x="2.42792" y="1.6692" width="18" height="21" id="svg_55" fill="#eaeaea" stroke="#606060"/>
|
||||
<path stroke="#285582" fill="url(#svg_46_import)" id="svg_45" d="m7.14286,12.74903l5.21236,5.79151l5.50193,-5.88803l-2.50965,-0.09653l0,-2.79923c0,-2.3166 -2.3166,-5.59846 -6.56371,-5.59846c-4.05405,0 -6.27413,3.37838 -6.56371,6.75676c0.48263,-1.5444 2.7027,-4.53668 4.44015,-4.44015c2.12355,-0.09653 2.79923,1.64093 2.79923,3.37838l0.09653,2.79923l-2.41313,0.09653z"/>
|
||||
</svg>
|
||||
</g>
|
||||
|
||||
<g id="docprops">
|
||||
<svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
||||
<defs>
|
||||
|
||||
@@ -101,6 +101,7 @@
|
||||
{"id": "tool_fhrect", "title": "Free-Hand Rectangle"},
|
||||
{"id": "tool_group", "title": "Group Elements"},
|
||||
{"id": "tool_image", "title": "Image Tool"},
|
||||
{"id": "tool_import", "textContent": "Import Image"},
|
||||
{"id": "tool_italic", "title": "Italic Text"},
|
||||
{"id": "tool_line", "title": "Line Tool"},
|
||||
{"id": "tool_move_bottom", "title": "Move to Bottom"},
|
||||
|
||||
@@ -568,12 +568,12 @@ span.zoom_tool {
|
||||
-webkit-border-radius: 5px;
|
||||
}
|
||||
|
||||
#svg_editor #main_menu li#tool_open {
|
||||
#svg_editor #main_menu li#tool_open, #svg_editor #main_menu li#tool_import {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#tool_open input {
|
||||
#tool_open input, #tool_import input {
|
||||
-moz-transform: scale(4,2); /* Not entirely necessary, but keeps it nice and big for OS X*/
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
|
||||
@@ -100,6 +100,13 @@ script type="text/javascript" src="locale/locale.min.js"></script-->
|
||||
Open Image [O]
|
||||
</li>
|
||||
|
||||
<li id="tool_import" style="display:none;">
|
||||
<div id="fileinputs_import">
|
||||
<div></div>
|
||||
</div>
|
||||
Import SVG
|
||||
</li>
|
||||
|
||||
<li id="tool_save">
|
||||
<div></div>
|
||||
Save Image [S]
|
||||
|
||||
@@ -1459,6 +1459,9 @@ function svg_edit_setup() {
|
||||
var clickOpen = function(){
|
||||
svgCanvas.open();
|
||||
};
|
||||
var clickImport = function(){
|
||||
svgCanvas.open();
|
||||
};
|
||||
|
||||
var clickUndo = function(){
|
||||
if (svgCanvas.getUndoStackSize() > 0) {
|
||||
@@ -2461,12 +2464,13 @@ function svg_edit_setup() {
|
||||
{sel:'#tool_clear', fn: clickClear, evt: 'mouseup', key: [modKey+'N', true]},
|
||||
{sel:'#tool_save', fn: function() { editingsource?saveSourceEditor():clickSave()}, evt: 'mouseup', key: [modKey+'S', true]},
|
||||
{sel:'#tool_open', fn: clickOpen, evt: 'mouseup', key: [modKey+'O', true]},
|
||||
{sel:'#tool_import', fn: clickImport, evt: 'mouseup'},
|
||||
{sel:'#tool_source', fn: showSourceEditor, evt: 'click', key: ['U', true]},
|
||||
{sel:'#tool_wireframe', fn: clickWireframe, evt: 'click', key: ['F', true]},
|
||||
{sel:'#tool_source_cancel,#svg_source_overlay,#tool_docprops_cancel', fn: cancelOverlays, evt: 'click', key: ['esc', false, false], hidekey: true},
|
||||
{sel:'#tool_source_save', fn: saveSourceEditor, evt: 'click'},
|
||||
{sel:'#tool_docprops_save', fn: saveDocProperties, evt: 'click'},
|
||||
{sel:'#tool_docprops', fn: showDocProperties, evt: 'mouseup', key: [modKey+'I', true]},
|
||||
{sel:'#tool_docprops', fn: showDocProperties, evt: 'mouseup', key: [modKey+'P', true]},
|
||||
{sel:'#tool_delete,#tool_delete_multi', fn: deleteSelected, evt: 'click', key: ['del/backspace', true]},
|
||||
{sel:'#tool_reorient', fn: reorientPath, evt: 'click'},
|
||||
{sel:'#tool_node_link', fn: linkControlPoints, evt: 'click'},
|
||||
@@ -2696,6 +2700,18 @@ function svg_edit_setup() {
|
||||
}
|
||||
});
|
||||
$("#tool_open").show().prepend(inp);
|
||||
var inp2 = $('<input type="file">').change(function() {
|
||||
$('#main_menu').hide();
|
||||
if(this.files.length==1) {
|
||||
var reader = new FileReader();
|
||||
reader.onloadend = function(e) {
|
||||
svgCanvas.setSvgString(e.target.result);
|
||||
updateCanvas();
|
||||
};
|
||||
reader.readAsText(this.files[0]);
|
||||
}
|
||||
});
|
||||
$("#tool_import").show().prepend(inp2);
|
||||
}
|
||||
|
||||
|
||||
@@ -2835,6 +2851,7 @@ function svg_edit_setup() {
|
||||
'#tool_clear div,#layer_new':'new_image',
|
||||
'#tool_save div':'save',
|
||||
'#tool_open div div':'open',
|
||||
'#tool_import div div':'import',
|
||||
'#tool_source':'source',
|
||||
'#tool_docprops > div':'docprops',
|
||||
'#tool_wireframe':'wireframe',
|
||||
|
||||
Reference in New Issue
Block a user