Added basic implementation of issue 313 (logo becomes main menu button)
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1202 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
@@ -232,22 +232,91 @@
|
|||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
#svg_editor #logo {
|
#svg_editor #main_button {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 4px;
|
top: 4px;
|
||||||
left: 4px;
|
left: 4px;
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
|
width: 44px;
|
||||||
|
height: 30px;
|
||||||
|
border-radius: 8px;
|
||||||
|
-moz-border-radius: 8px;
|
||||||
|
-webkit-border-radius: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#svg_editor #logo a img {
|
#svg_editor #main_button:hover {
|
||||||
|
top: 2px;
|
||||||
|
left: 2px;
|
||||||
|
padding: 1px 0 2px 1px;
|
||||||
|
border-left: 1px #fcd9ba solid;
|
||||||
|
border-top: 1px #fcd9ba solid;
|
||||||
|
border-right: 1px #e0a874 solid;
|
||||||
|
border-bottom: 1px #e0a874 solid;
|
||||||
|
background-color: #FFC;
|
||||||
|
}
|
||||||
|
|
||||||
|
#svg_editor #main_menu {
|
||||||
|
/* position: */
|
||||||
|
z-index: 1;
|
||||||
|
background: #E8E8E8;
|
||||||
|
position: relative;
|
||||||
|
width: 200px;
|
||||||
|
padding: 5px;
|
||||||
|
-moz-box-shadow: #555 1px 1px 4px;
|
||||||
|
-webkit-box-shadow: #555 1px 1px 4px;
|
||||||
|
font-size: 1.1em;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#svg_editor #main_menu ul,
|
||||||
|
#svg_editor #main_menu li {
|
||||||
|
list-style: none;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#svg_editor #main_menu li {
|
||||||
|
/* height: 35px;*/
|
||||||
|
line-height: 22px;
|
||||||
|
padding-top: 2px;
|
||||||
|
padding-left: 2px;
|
||||||
|
overflow: auto;
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
|
#svg_editor #main_menu li:hover {
|
||||||
|
background: #FFC;
|
||||||
|
}
|
||||||
|
|
||||||
|
#svg_editor #main_menu li > div {
|
||||||
|
float: left;
|
||||||
|
padding-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#svg_editor #main_menu p {
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#svg_editor #logo img {
|
||||||
border: 0;
|
border: 0;
|
||||||
width: 32px;
|
width: 32px;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#main_button > div {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
#svg_editor #main_button .dropdown {
|
||||||
|
padding-top: 10px;
|
||||||
|
margin-left: -1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#svg_editor #tools_top {
|
#svg_editor #tools_top {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 38px;
|
left: 50px;
|
||||||
right: 2px;
|
right: 2px;
|
||||||
top: 2px;
|
top: 2px;
|
||||||
height: 72px;
|
height: 72px;
|
||||||
@@ -442,51 +511,18 @@ span.zoom_tool {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
#svg_editor #main_menu li#tool_open {
|
||||||
div.fileinputs {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.fakefile {
|
|
||||||
position: absolute;
|
|
||||||
top: 2px;
|
|
||||||
left: 2px;
|
|
||||||
z-index: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.fileinputs svg {
|
|
||||||
position: relative;
|
|
||||||
width: 24px;
|
|
||||||
height: 24px;
|
|
||||||
z-index: 2;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* the file input control is placed on top but made invisible */
|
|
||||||
/* TODO: is moz-opacity really needed? filter? */
|
|
||||||
/*
|
|
||||||
input.file {
|
|
||||||
position: relative;
|
|
||||||
text-align: right;
|
|
||||||
-moz-opacity: 0;
|
|
||||||
filter:alpha(opacity: 0);
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#fileinputs {
|
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
#fileinputs input {
|
#tool_open input {
|
||||||
-moz-transform: scale(2.0); /* Not entirely necessary, but keeps it nice and big for OS X*/
|
-moz-transform: scale(4,2); /* Not entirely necessary, but keeps it nice and big for OS X*/
|
||||||
height: 100%;
|
height: 100%;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
top: -3px;
|
top: -3px;
|
||||||
right: 10px;
|
right: 270px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
cursor: pointer; /* Sadly doesn't appear to have an effect */
|
cursor: pointer; /* Sadly doesn't appear to have an effect */
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,23 +74,51 @@ script type="text/javascript" src="locale/locale.min.js"></script-->
|
|||||||
<div id="sidepanel_handle" onselectstart="return false;" title="Drag left/right to resize side panel [X]">L a y e r s</div>
|
<div id="sidepanel_handle" onselectstart="return false;" title="Drag left/right to resize side panel [X]">L a y e r s</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="logo">
|
<div id="main_button" title="Main Menu">
|
||||||
<a href="http://svg-edit.googlecode.com/" target="_blank" title="SVG-edit Home Page">
|
<div id="logo"></div>
|
||||||
</a>
|
<div class="dropdown"></div>
|
||||||
|
|
||||||
|
<div id="main_menu">
|
||||||
|
|
||||||
|
<!-- File-like buttons: New, Save, Source -->
|
||||||
|
<ul>
|
||||||
|
<li id="tool_clear">
|
||||||
|
<div></div>
|
||||||
|
New Image [N]
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li id="tool_open" style="display:none;">
|
||||||
|
<div id="fileinputs">
|
||||||
|
<div></div>
|
||||||
|
</div>
|
||||||
|
Open Image [O]
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li id="tool_save">
|
||||||
|
<div></div>
|
||||||
|
Save Image [S]
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li id="tool_docprops">
|
||||||
|
<div></div>
|
||||||
|
Document Properties [I]
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<a href="http://svg-edit.googlecode.com/" target="_blank">
|
||||||
|
SVG-edit Home Page
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="tools_top" class="tools_panel">
|
<div id="tools_top" class="tools_panel">
|
||||||
|
|
||||||
<!-- File-like buttons: New, Save, Source -->
|
<div id="editor_panel">
|
||||||
<div id="file_panel">
|
|
||||||
<div class="push_button" id="tool_clear" title="New Image [N]"></div>
|
|
||||||
|
|
||||||
<div id="fileinputs" class="push_button">
|
|
||||||
<div id="tool_open" title="Open Image [O]" ></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="push_button" id="tool_save" title="Save Image [S]"></div>
|
|
||||||
<div class="push_button" id="tool_docprops" title="Document Properties [I]"></div>
|
|
||||||
<div class="push_button" id="tool_source" title="Edit Source [U]"></div>
|
<div class="push_button" id="tool_source" title="Edit Source [U]"></div>
|
||||||
<div class="tool_button" id="tool_wireframe" title="Wireframe Mode [F]"></div>
|
<div class="tool_button" id="tool_wireframe" title="Wireframe Mode [F]"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -723,6 +723,34 @@ function svg_edit_setup() {
|
|||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
var button = $('#main_button');
|
||||||
|
var list = $('#main_menu');
|
||||||
|
var on_button = false;
|
||||||
|
$().mouseup(function(evt) {
|
||||||
|
if(!on_button) {
|
||||||
|
button.removeClass('down');
|
||||||
|
list.hide();
|
||||||
|
}
|
||||||
|
on_button = false;
|
||||||
|
});
|
||||||
|
|
||||||
|
button.bind('mousedown',function() {
|
||||||
|
if (!button.hasClass('down')) {
|
||||||
|
button.addClass('down');
|
||||||
|
list.show();
|
||||||
|
on_button = true;
|
||||||
|
} else {
|
||||||
|
button.removeClass('down');
|
||||||
|
// list.hide();
|
||||||
|
}
|
||||||
|
}).hover(function() {
|
||||||
|
on_button = true;
|
||||||
|
}).mouseout(function() {
|
||||||
|
on_button = false;
|
||||||
|
});
|
||||||
|
}());
|
||||||
|
|
||||||
var addDropDown = function(elem, callback, dropUp) {
|
var addDropDown = function(elem, callback, dropUp) {
|
||||||
var button = $(elem).find('button');
|
var button = $(elem).find('button');
|
||||||
var list = $(elem).find('ul');
|
var list = $(elem).find('ul');
|
||||||
@@ -1220,7 +1248,7 @@ function svg_edit_setup() {
|
|||||||
|
|
||||||
$.resizeSvgIcons({
|
$.resizeSvgIcons({
|
||||||
'.flyout_arrow_horiz svg, .flyout_arrow_horiz img': size_num / 3,
|
'.flyout_arrow_horiz svg, .flyout_arrow_horiz img': size_num / 3,
|
||||||
'#logo a > svg, #logo a > img': size_num * 1.3
|
'#logo > svg, #logo > img': size_num * 1.3
|
||||||
});
|
});
|
||||||
if(size != 's') {
|
if(size != 's') {
|
||||||
$.resizeSvgIcons({'#layerbuttons svg, #layerbuttons img': size_num * .6});
|
$.resizeSvgIcons({'#layerbuttons svg, #layerbuttons img': size_num * .6});
|
||||||
@@ -1243,7 +1271,7 @@ function svg_edit_setup() {
|
|||||||
'margin': {s: '2px 2px', l: '2px 5px', xl: '2px 8px'}
|
'margin': {s: '2px 2px', l: '2px 5px', xl: '2px 8px'}
|
||||||
},
|
},
|
||||||
"#tools_top": {
|
"#tools_top": {
|
||||||
'left': {s: '27px', l: '50px', xl: '70px'},
|
'left': {s: '35px', l: '50px', xl: '70px'},
|
||||||
'height': {s: '50px', l: '88px', xl: '125px'}
|
'height': {s: '50px', l: '88px', xl: '125px'}
|
||||||
},
|
},
|
||||||
"#tools_left": {
|
"#tools_left": {
|
||||||
@@ -2047,15 +2075,15 @@ function svg_edit_setup() {
|
|||||||
{sel:'#tool_text', fn: clickText, evt: 'click', key: 7},
|
{sel:'#tool_text', fn: clickText, evt: 'click', key: 7},
|
||||||
{sel:'#tool_image', fn: clickImage, evt: 'mouseup', key: 8},
|
{sel:'#tool_image', fn: clickImage, evt: 'mouseup', key: 8},
|
||||||
{sel:'#tool_zoom', fn: clickZoom, evt: 'mouseup', key: 9},
|
{sel:'#tool_zoom', fn: clickZoom, evt: 'mouseup', key: 9},
|
||||||
{sel:'#tool_clear', fn: clickClear, evt: 'click', key: [modKey+'N', true]},
|
{sel:'#tool_clear', fn: clickClear, evt: 'mouseup', key: [modKey+'N', true]},
|
||||||
{sel:'#tool_save', fn: function() { editingsource?saveSourceEditor():clickSave()}, evt: 'click', key: [modKey+'S', true]},
|
{sel:'#tool_save', fn: function() { editingsource?saveSourceEditor():clickSave()}, evt: 'mouseup', key: [modKey+'S', true]},
|
||||||
{sel:'#tool_open', fn: clickOpen, evt: 'click', key: [modKey+'O', true]},
|
{sel:'#tool_open', fn: clickOpen, evt: 'mouseup', key: [modKey+'O', true]},
|
||||||
{sel:'#tool_source', fn: showSourceEditor, evt: 'click', key: ['U', true]},
|
{sel:'#tool_source', fn: showSourceEditor, evt: 'click', key: ['U', true]},
|
||||||
{sel:'#tool_wireframe', fn: clickWireframe, evt: 'click', key: ['F', 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_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_source_save', fn: saveSourceEditor, evt: 'click'},
|
||||||
{sel:'#tool_docprops_save', fn: saveDocProperties, evt: 'click'},
|
{sel:'#tool_docprops_save', fn: saveDocProperties, evt: 'click'},
|
||||||
{sel:'#tool_docprops', fn: showDocProperties, evt: 'click', key: [modKey+'I', true]},
|
{sel:'#tool_docprops', fn: showDocProperties, evt: 'mouseup', key: [modKey+'I', true]},
|
||||||
{sel:'#tool_delete,#tool_delete_multi', fn: deleteSelected, evt: 'click', key: ['del/backspace', true]},
|
{sel:'#tool_delete,#tool_delete_multi', fn: deleteSelected, evt: 'click', key: ['del/backspace', true]},
|
||||||
{sel:'#tool_reorient', fn: reorientPath, evt: 'click'},
|
{sel:'#tool_reorient', fn: reorientPath, evt: 'click'},
|
||||||
{sel:'#tool_node_link', fn: linkControlPoints, evt: 'click'},
|
{sel:'#tool_node_link', fn: linkControlPoints, evt: 'click'},
|
||||||
@@ -2228,7 +2256,7 @@ function svg_edit_setup() {
|
|||||||
reader.readAsText(this.files[0]);
|
reader.readAsText(this.files[0]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$("#fileinputs").show().prepend(inp);
|
$("#tool_open").show().prepend(inp);
|
||||||
|
|
||||||
// This doesn't appear to be necessary...
|
// This doesn't appear to be necessary...
|
||||||
svgCanvas.setCustomHandlers( {open: fileOpen} );
|
svgCanvas.setCustomHandlers( {open: fileOpen} );
|
||||||
@@ -2303,13 +2331,13 @@ function svg_edit_setup() {
|
|||||||
'arrow_down':'dropdown.gif'
|
'arrow_down':'dropdown.gif'
|
||||||
},
|
},
|
||||||
placement: {
|
placement: {
|
||||||
'#logo a':'logo',
|
'#logo':'logo',
|
||||||
|
|
||||||
'#tool_clear,#layer_new':'new_image',
|
'#tool_clear div,#layer_new':'new_image',
|
||||||
'#tool_save':'save',
|
'#tool_save div':'save',
|
||||||
'#tool_open':'open',
|
'#tool_open div div':'open',
|
||||||
'#tool_source':'source',
|
'#tool_source':'source',
|
||||||
'#tool_docprops':'docprops',
|
'#tool_docprops > div':'docprops',
|
||||||
'#tool_wireframe':'wireframe',
|
'#tool_wireframe':'wireframe',
|
||||||
|
|
||||||
'#tool_undo':'undo',
|
'#tool_undo':'undo',
|
||||||
@@ -2356,14 +2384,15 @@ function svg_edit_setup() {
|
|||||||
'#tool_source_cancel,#tool_docprops_cancel':'cancel',
|
'#tool_source_cancel,#tool_docprops_cancel':'cancel',
|
||||||
|
|
||||||
'.flyout_arrow_horiz':'arrow_right',
|
'.flyout_arrow_horiz':'arrow_right',
|
||||||
'.dropdown button':'arrow_down',
|
'.dropdown button, #main_button .dropdown':'arrow_down',
|
||||||
'#palette .palette_item:first, #fill_bg, #stroke_bg':'no_color'
|
'#palette .palette_item:first, #fill_bg, #stroke_bg':'no_color'
|
||||||
},
|
},
|
||||||
resize: {
|
resize: {
|
||||||
'#logo a .svg_icon': 32,
|
'#logo .svg_icon': 32,
|
||||||
'.flyout_arrow_horiz .svg_icon': 5,
|
'.flyout_arrow_horiz .svg_icon': 5,
|
||||||
'.layer_button .svg_icon, #layerlist td.layervis .svg_icon': 14,
|
'.layer_button .svg_icon, #layerlist td.layervis .svg_icon': 14,
|
||||||
'.dropdown button .svg_icon': 7,
|
'.dropdown button .svg_icon': 7,
|
||||||
|
'#main_button .dropdown .svg_icon': 9,
|
||||||
'.palette_item:first .svg_icon, #fill_bg .svg_icon, #stroke_bg .svg_icon': 16,
|
'.palette_item:first .svg_icon, #fill_bg .svg_icon, #stroke_bg .svg_icon': 16,
|
||||||
'.toolbar_button button .svg_icon':16
|
'.toolbar_button button .svg_icon':16
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user