Spruced up docprops to fix Issue 315, made Image Title appear in browser title when available
git-svn-id: http://svg-edit.googlecode.com/svn/branches/transformlist@926 eee81c28-f429-11dd-99c0-75d572ba1dddmaster
parent
a5ae9e78de
commit
e40619cc67
|
@ -564,6 +564,7 @@ span.zoom_tool {
|
|||
background-color: #B0B0B0;
|
||||
opacity: 1.0;
|
||||
text-align: center;
|
||||
border: 1px outset #777;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -573,22 +574,52 @@ span.zoom_tool {
|
|||
bottom: 100px;
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#svg_docprops #svg_docprops_container {
|
||||
position: absolute;
|
||||
top: 50px;
|
||||
padding: 10px;
|
||||
background-color: #B0B0B0;
|
||||
border: 1px outset #777;
|
||||
opacity: 1.0;
|
||||
/* width: 450px;*/
|
||||
font-family: Verdana, Helvetica, sans-serif;
|
||||
font-size: .8em;
|
||||
}
|
||||
|
||||
#tool_docprops_back {
|
||||
margin-left: 1em;
|
||||
}
|
||||
|
||||
#svg_docprops_container #svg_docprops_docprops,
|
||||
#svg_docprops_container #svg_docprops_prefs {
|
||||
float: left;
|
||||
width: 200px;
|
||||
margin: 5px .7em;
|
||||
}
|
||||
|
||||
#svg_docprops_docprops > legend, #svg_docprops_prefs > legend {
|
||||
font-weight: bold;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
|
||||
#svg_docprops_container fieldset {
|
||||
padding: 5px;
|
||||
margin: 5px;
|
||||
border: 1px solid #DDD;
|
||||
}
|
||||
|
||||
#svg_docprops_container label {
|
||||
display: block;
|
||||
margin-bottom: .2em;
|
||||
margin: .5em;
|
||||
}
|
||||
|
||||
#svginfo_bg_note {
|
||||
font-size: .9em;
|
||||
font-style: italic;
|
||||
color: #444;
|
||||
}
|
||||
|
||||
#canvas_title {
|
||||
|
|
|
@ -362,14 +362,15 @@ script type="text/javascript" src="locale/locale.min.js"></script-->
|
|||
<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>
|
||||
</div>
|
||||
|
||||
|
||||
<fieldset id="change_background">
|
||||
<legend id="svginfo_change_background">Editor Background</legend>
|
||||
<div id="bg_blocks"></div>
|
||||
<label><span id="svginfo_bg_url">URL:</span> <input type="text" id="canvas_bg_url" size="17"></label>
|
||||
</fieldset>
|
||||
<fieldset id="svg_docprops_docprops">
|
||||
<legend id="svginfo_image_props">Image Properties</legend>
|
||||
<label>
|
||||
<span id="svginfo_title">Title:</span>
|
||||
<input type="text" id="canvas_title" size="24">
|
||||
</label>
|
||||
|
||||
<fieldset id="change_resolution">
|
||||
<legend id="svginfo_dim">Canvas Dimensions</legend>
|
||||
|
@ -391,16 +392,29 @@ script type="text/javascript" src="locale/locale.min.js"></script-->
|
|||
</label>
|
||||
</fieldset>
|
||||
|
||||
<fieldset id="change_iconsize">
|
||||
<legend id="svginfo_icons">Icon size</legend>
|
||||
</fieldset>
|
||||
|
||||
<fieldset id="svg_docprops_prefs">
|
||||
<legend id="svginfo_editor_profs">Editor Preferences</legend>
|
||||
|
||||
<label><span id="svginfo_icons">Icon size:</span>
|
||||
<select id="iconsize">
|
||||
<option id="icon_small" value="s">Small</option>
|
||||
<option id="icon_medium" value="m" selected="selected">Medium</option>
|
||||
<option id="icon_large" value="l">Large</option>
|
||||
<option id="icon_xlarge" value="xl">Extra Large</option>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<fieldset id="change_background">
|
||||
<legend id="svginfo_change_background">Editor Background</legend>
|
||||
<div id="bg_blocks"></div>
|
||||
<label><span id="svginfo_bg_url">URL:</span> <input type="text" id="canvas_bg_url" size="21"></label>
|
||||
<p id="svginfo_bg_note">Note: Background will not be saved with image.</p>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -861,6 +861,8 @@ function svg_edit_setup() {
|
|||
$('#svg_source_textarea').focus();
|
||||
};
|
||||
|
||||
$('#svg_docprops_container').draggable({cancel:'button,fieldset'});
|
||||
|
||||
var showDocProperties = function(){
|
||||
if (docprops) return;
|
||||
docprops = true;
|
||||
|
@ -910,11 +912,20 @@ function svg_edit_setup() {
|
|||
svgCanvas.clearSelection();
|
||||
hideSourceEditor();
|
||||
populateLayers();
|
||||
setTitle(svgCanvas.getImageTitle());
|
||||
};
|
||||
|
||||
var setTitle = function(title) {
|
||||
var editor_title = $('title:first').text().split(':')[0];
|
||||
var new_title = editor_title + (title?': ' + title:'');
|
||||
$('title:first').text(new_title);
|
||||
}
|
||||
|
||||
var saveDocProperties = function(){
|
||||
// set title
|
||||
svgCanvas.setImageTitle($('#canvas_title').val());
|
||||
var new_title = $('#canvas_title').val();
|
||||
setTitle(new_title);
|
||||
svgCanvas.setImageTitle(new_title);
|
||||
|
||||
// update resolution
|
||||
var x = parseInt($('#canvas_width').val());
|
||||
|
|
Loading…
Reference in New Issue