improved design
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@20 eee81c28-f429-11dd-99c0-75d572ba1dddmaster
Before Width: | Height: | Size: 663 B After Width: | Height: | Size: 1.0 KiB |
BIN
images/clear.png
Before Width: | Height: | Size: 373 B After Width: | Height: | Size: 812 B |
Before Width: | Height: | Size: 549 B After Width: | Height: | Size: 1.3 KiB |
BIN
images/line.png
Before Width: | Height: | Size: 665 B After Width: | Height: | Size: 1.0 KiB |
BIN
images/path.png
Before Width: | Height: | Size: 801 B After Width: | Height: | Size: 1.2 KiB |
BIN
images/rect.png
Before Width: | Height: | Size: 428 B After Width: | Height: | Size: 422 B |
Before Width: | Height: | Size: 456 B After Width: | Height: | Size: 712 B |
Before Width: | Height: | Size: 668 B After Width: | Height: | Size: 1.2 KiB |
|
@ -1,4 +1,18 @@
|
|||
#svg_editor .canvas {
|
||||
#svg_editor {
|
||||
font-size: 8pt;
|
||||
font-family: Verdana, Helvetica, Arial;
|
||||
}
|
||||
|
||||
#svg_editor hr {
|
||||
border: none;
|
||||
border-bottom: 1px solid #808080;
|
||||
}
|
||||
|
||||
#svg_editor select {
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
#svg_editor .svgcanvas {
|
||||
width: 640px;
|
||||
height: 480px;
|
||||
border: 1px solid #808080;
|
||||
|
@ -18,6 +32,7 @@
|
|||
height: 16px;
|
||||
width: 16px;
|
||||
border: 1px solid #808080;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#fill_color {
|
||||
|
@ -48,16 +63,39 @@
|
|||
float: left;
|
||||
}
|
||||
|
||||
.tool_button {
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
border: 4px solid #E8E8E4;
|
||||
#tools {
|
||||
background: #E8E8E8;
|
||||
height: 504px;
|
||||
border: 1px solid #808080;
|
||||
border-right: none;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
.tool_button, .tool_button_current {
|
||||
height: 24px;
|
||||
width: 24px;
|
||||
border: 1px solid red;
|
||||
margin: 2px;
|
||||
padding: 2px;
|
||||
border-left: 1px solid #FFFFFF;
|
||||
border-top: 1px solid #FFFFFF;
|
||||
border-right: 1px solid #808080;
|
||||
border-bottom: 1px solid #808080;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.tool_button_current {
|
||||
border-left: 1px solid #808080;
|
||||
border-top: 1px solid #808080;
|
||||
border-right: 1px solid #FFFFFF;
|
||||
border-bottom: 1px solid #FFFFFF;
|
||||
background-color: #B0B0B0;
|
||||
}
|
||||
|
||||
#color_pick {
|
||||
position: absolute;
|
||||
display: none;
|
||||
background: white;
|
||||
background: #E8E8E8;
|
||||
border: 1px solid #808080;
|
||||
padding: 5px;
|
||||
}
|
||||
|
@ -69,3 +107,32 @@
|
|||
float: left;
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
#color_pick_ok {
|
||||
background: #E8E8E8;
|
||||
border-left: 1px solid #FFFFFF;
|
||||
border-top: 1px solid #FFFFFF;
|
||||
border-right: 1px solid #808080;
|
||||
border-bottom: 1px solid #808080;
|
||||
}
|
||||
|
||||
#tools_rect, #tools_circle {
|
||||
position: absolute;
|
||||
display: none;
|
||||
height: 28px;
|
||||
width: 90px;
|
||||
background: red;
|
||||
cursor: pointer;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#tools_rect div, #tools_circle div {
|
||||
float: left;
|
||||
background: #E8E8E8;
|
||||
border-left: 1px solid #FFFFFF;
|
||||
border-top: 1px solid #FFFFFF;
|
||||
border-right: 1px solid #808080;
|
||||
border-bottom: 1px solid #808080;
|
||||
height: 28px;
|
||||
width: 28px;
|
||||
}
|
||||
|
|
|
@ -10,40 +10,52 @@
|
|||
</head>
|
||||
<body>
|
||||
|
||||
<div id="svg_editor">
|
||||
|
||||
<div id="color_pick">
|
||||
<div id="color_pick_wheel"></div>
|
||||
<input type="text" id="color_pick_text" />
|
||||
<input type="button" id="color_pick_ok" value="OK" />
|
||||
</div>
|
||||
|
||||
<div id="svg_editor">
|
||||
<div id="tools_rect">
|
||||
<div id="tool_square">square</div>
|
||||
<div id="tool_rect">rectangle</div>
|
||||
<div id="tool_fhrect">freehand</div>
|
||||
</div>
|
||||
|
||||
<div id="tools_circle">
|
||||
<div id="tool_circle">circle</div>
|
||||
<div id="tool_ellipse">ellipse</div>
|
||||
<div id="tool_fhellipse">freehand</div>
|
||||
</div>
|
||||
|
||||
<div id="tools">
|
||||
|
||||
<div>
|
||||
<img class="tool_button" id="tool_select" src="images/select.png" />
|
||||
<img class="tool_button" id="tool_path" src="images/path.png" />
|
||||
<img class="tool_button" id="tool_line" src="images/line.png" />
|
||||
<br/>
|
||||
<img class="tool_button" id="tool_square" src="images/rect.png" />
|
||||
<img class="tool_button" id="tool_rect" src="images/rect.png" />
|
||||
<img class="tool_button" id="tool_fhrect" src="images/rect.png" />
|
||||
<br/>
|
||||
<img class="tool_button" id="tool_circle" src="images/circle.png" />
|
||||
<img class="tool_button" id="tool_ellipse" src="images/circle.png" />
|
||||
<img class="tool_button" id="tool_fhellipse" src="images/circle.png" />
|
||||
<br/>
|
||||
<img class="tool_button" id="tool_delete" src="images/delete.png" />
|
||||
<img class="tool_button" id="tool_clear" src="images/clear.png" />
|
||||
<img class="tool_button" id="tool_submit" src="images/submit.png" />
|
||||
<!--
|
||||
<img class="tool_button" id="tool_select" src="images/select.png" /><br/>
|
||||
-->
|
||||
<img class="tool_button_current" id="tool_path" src="images/path.png" /><br/>
|
||||
<img class="tool_button" id="tool_line" src="images/line.png" /><br/>
|
||||
<img class="tool_button" id="tools_rect_show" src="images/rect.png" /><br/>
|
||||
<img class="tool_button" id="tools_circle_show" src="images/circle.png" /><br/>
|
||||
<img class="tool_button" id="tool_delete" src="images/delete.png" /><hr/>
|
||||
<img class="tool_button" id="tool_clear" src="images/clear.png" /><br/>
|
||||
<img class="tool_button" id="tool_submit" src="images/submit.png" /><br/>
|
||||
</div>
|
||||
|
||||
<div>Fill
|
||||
<hr/>
|
||||
|
||||
<div>fill
|
||||
<div id="fill_color"></div>
|
||||
</div>
|
||||
|
||||
<div>Stroke
|
||||
<hr/>
|
||||
|
||||
<div>stroke
|
||||
<div id="stroke_color"></div>
|
||||
<div>
|
||||
<select id="stroke_width">
|
||||
<option selected="selected" value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
|
@ -51,23 +63,24 @@
|
|||
<option value="5">5</option>
|
||||
<option value="7">7</option>
|
||||
</select>
|
||||
</div><div>
|
||||
<select id="stroke_style">
|
||||
<option selected="selected" value="none">-----</option>
|
||||
<option value="2,2">.....</option>
|
||||
<option value="5,5">- - -</option>
|
||||
<option value="5,2,2,2">- . -</option>
|
||||
<option value="5,2,2,2,2,2">- .. -</option>
|
||||
<option selected="selected" value="none">---</option>
|
||||
<option value="2,2">...</option>
|
||||
<option value="5,5">- -</option>
|
||||
<option value="5,2,2,2">- .</option>
|
||||
<option value="5,2,2,2,2,2">- ..</option>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="workarea">
|
||||
|
||||
<div id="canvas">
|
||||
<object class="canvas" data="svgcanvas.svg" type="image/svg+xml">
|
||||
<embed class="canvas" src="svgcanvas.svg" type="image/svg+xml" />
|
||||
<div id="svgcanvas">
|
||||
<object class="svgcanvas" data="svgcanvas.svg" type="image/svg+xml">
|
||||
<embed class="svgcanvas" src="svgcanvas.svg" type="image/svg+xml" />
|
||||
</object>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -8,6 +8,11 @@ $(document).ready(function(){
|
|||
});
|
||||
$('#palette').append(str);
|
||||
|
||||
var pos = $('#tools_rect_show').position();
|
||||
$('#tools_rect').css({'left': pos.left+2, 'top': pos.top+2});
|
||||
pos = $('#tools_circle_show').position();
|
||||
$('#tools_circle').css({'left': pos.left+2, 'top': pos.top+2});
|
||||
|
||||
$('#stroke_width').change(function(){
|
||||
SvgCanvas.setStrokeWidth(this.options[this.selectedIndex].value);
|
||||
});
|
||||
|
@ -40,42 +45,68 @@ $(document).ready(function(){
|
|||
|
||||
$('#tool_select').click(function(){
|
||||
SvgCanvas.setMode('select');
|
||||
$('.tool_button_current').removeClass('tool_button_current').addClass('tool_button');
|
||||
$(this).addClass('tool_button_current');
|
||||
});
|
||||
|
||||
$('#tool_path').click(function(){
|
||||
SvgCanvas.setMode('path');
|
||||
$('.tool_button_current').removeClass('tool_button_current').addClass('tool_button');
|
||||
$(this).addClass('tool_button_current');
|
||||
});
|
||||
|
||||
$('#tool_line').click(function(){
|
||||
SvgCanvas.setMode('line');
|
||||
$('.tool_button_current').removeClass('tool_button_current').addClass('tool_button');
|
||||
$(this).addClass('tool_button_current');
|
||||
});
|
||||
|
||||
$('#tool_square').click(function(){
|
||||
SvgCanvas.setMode('square');
|
||||
$('#tools_rect').hide();
|
||||
$('.tool_button_current').removeClass('tool_button_current').addClass('tool_button');
|
||||
$('#tools_rect_show').addClass('tool_button_current');
|
||||
});
|
||||
|
||||
$('#tool_rect').click(function(){
|
||||
SvgCanvas.setMode('rect');
|
||||
$('#tools_rect').hide();
|
||||
$('.tool_button_current').removeClass('tool_button_current').addClass('tool_button');
|
||||
$('#tools_rect_show').addClass('tool_button_current');
|
||||
});
|
||||
|
||||
$('#tool_fhrect').click(function(){
|
||||
SvgCanvas.setMode('fhrect');
|
||||
$('#tools_rect').hide();
|
||||
$('.tool_button_current').removeClass('tool_button_current').addClass('tool_button');
|
||||
$('#tools_rect_show').addClass('tool_button_current');
|
||||
});
|
||||
|
||||
$('#tool_circle').click(function(){
|
||||
SvgCanvas.setMode('circle');
|
||||
$('#tools_circle').hide();
|
||||
$('.tool_button_current').removeClass('tool_button_current').addClass('tool_button');
|
||||
$('#tools_circle_show').addClass('tool_button_current');
|
||||
});
|
||||
|
||||
$('#tool_ellipse').click(function(){
|
||||
SvgCanvas.setMode('ellipse');
|
||||
$('#tools_circle').hide();
|
||||
$('.tool_button_current').removeClass('tool_button_current').addClass('tool_button');
|
||||
$('#tools_circle_show').addClass('tool_button_current');
|
||||
});
|
||||
|
||||
$('#tool_fhellipse').click(function(){
|
||||
SvgCanvas.setMode('fhellipse');
|
||||
$('#tools_circle').hide();
|
||||
$('.tool_button_current').removeClass('tool_button_current').addClass('tool_button');
|
||||
$('#tools_circle_show').addClass('tool_button_current');
|
||||
});
|
||||
|
||||
$('#tool_delete').click(function(){
|
||||
SvgCanvas.setMode('delete');
|
||||
$('.tool_button_current').removeClass('tool_button_current').addClass('tool_button');
|
||||
$(this).addClass('tool_button_current');
|
||||
});
|
||||
|
||||
$('#tool_clear').click(function(){
|
||||
|
@ -124,6 +155,22 @@ $(document).ready(function(){
|
|||
picker.setColor($(this).attr('value'));
|
||||
});
|
||||
|
||||
$('#tools_rect_show').click(function(){
|
||||
$('#tools_rect').show();
|
||||
});
|
||||
/*
|
||||
$('#tools_rect').mouseout(function(){
|
||||
$('#tools_rect').hide();
|
||||
});
|
||||
*/
|
||||
$('#tools_circle_show').click(function(){
|
||||
$('#tools_circle').show();
|
||||
});
|
||||
/*
|
||||
$('#tools_circle').mouseout(function(){
|
||||
$('#tools_circle').hide();
|
||||
});
|
||||
*/
|
||||
})
|
||||
|
||||
function serializeHandler(svg) {
|
||||
|
|