Notes now automatically save - no "save" button.

The collections list does not resize randomly now.
The pane on the right stays open all the time - even when 0/multiple items are selected. This is to avoid frequent resizing of the items pane.
Temporarily, if the first "word" of a field's value is more than 29 characters long, it will set it to crop. This is for the long URLs, etc.
This commit is contained in:
David Norton 2006-06-13 20:45:30 +00:00
parent ba16889bb0
commit 3e11379c3a
4 changed files with 26 additions and 13 deletions

View file

@ -143,12 +143,20 @@ ScholarItemPane = new function()
function createValueElement(valueText, fieldName)
{
var valueElement = document.createElement("label");
valueElement.appendChild(document.createTextNode(valueText));
if(fieldName)
{
valueElement.setAttribute('fieldname',fieldName);
valueElement.setAttribute('onclick', 'ScholarItemPane.showEditor(this);');
}
var firstSpace = valueText.indexOf(" ");
if((firstSpace == -1 && valueText.length > 29 ) || firstSpace > 29)
{
valueElement.setAttribute('crop', 'end');
valueElement.setAttribute('value',valueText);
}
else
valueElement.appendChild(document.createTextNode(valueText));
return valueElement;
}

View file

@ -26,9 +26,10 @@
</grid>
</vbox>
<vbox>
<textbox id="scholar-notes" multiline="true" flex="1"
fieldname="notes" onblur="ScholarItemPane.modifyField('notes',this.value);"/>
<button label="Save" oncommand="ScholarItemPane.modifyField('notes',document.getElementById('scholar-notes').value);"/>
<textbox id="scholar-notes"
type="timed" timeout="1000" oncommand="ScholarItemPane.modifyField('notes',this.value);"
multiline="true" flex="1"
onblur="ScholarItemPane.modifyField('notes',this.value);"/>
</vbox>
</tabpanels>
</tabbox>

View file

@ -74,7 +74,7 @@ var ScholarPane = new function()
{
ScholarItemPane.viewItem(new Scholar.Item(typeID));
document.getElementById('scholar-view-item').hidden = false;
document.getElementById('scholar-view-splitter').hidden = false;
document.getElementById('scholar-view-selected-label').hidden = true;
}
function newCollection()
@ -97,13 +97,13 @@ var ScholarPane = new function()
itemsView = new Scholar.ItemTreeView(collection);
document.getElementById('items-tree').view = itemsView;
document.getElementById('tb-rename').disabled = collection.isLibrary();
itemsView.selection.clearSelection();
}
else
{
document.getElementById('items-tree').view = itemsView = null;
document.getElementById('tb-rename').disabled = true;
}
}
function itemSelected()
@ -115,13 +115,14 @@ var ScholarPane = new function()
ScholarItemPane.viewItem(item);
document.getElementById('scholar-view-item').hidden = false;
document.getElementById('scholar-view-splitter').hidden = false;
document.getElementById('scholar-view-selected-label').hidden = true;
}
else
{
document.getElementById('scholar-view-item').hidden = true;
document.getElementById('scholar-view-splitter').hidden = true;
var label = document.getElementById('scholar-view-selected-label');
label.hidden = false;
label.value = itemsView.selection.count + " items selected.";
}
}

View file

@ -21,7 +21,7 @@
<vbox id="appcontent">
<hbox id="scholar-pane" position="1" persist="height collapsed">
<vbox persist="width" flex="1" style="min-width: 150px;">
<vbox persist="width" width="200" style="min-width: 150px;">
<toolbar>
<toolbarbutton label="&toolbar.newCollection.label;" command="cmd_scholar_newCollection"/>
<toolbarbutton id="tb-rename" label="&toolbar.renameCollection.label;" oncommand="ScholarPane.renameSelectedCollection();" disabled="true"/>
@ -43,7 +43,7 @@
</tree>
</vbox>
<splitter id="scholar-tree-splitter" resizebefore="closest" resizeafter="closest"/>
<vbox persist="width" flex="5" style="min-width: 300px;">
<vbox persist="width" flex="1" style="min-width: 300px;">
<toolbar align="center">
<toolbarbutton id="tb-add" label="&toolbar.newItem.label;" type="menu">
<menupopup>
@ -102,8 +102,11 @@
</tree>
</vbox>
<separator orient="vertical" class="thin" id="scholar-view-splitter" hidden="true"/>
<tabbox id="scholar-view-item" hidden="true" flex="2" style="min-width: 300px; max-width: 300px;"/>
<splitter id="scholar-view-splitter" collapse="after"><grippy/></splitter>
<box width="300" style="min-width: 300px;" pack="center" align="center">
<label id="scholar-view-selected-label" style="text-align: center;"/>
<tabbox id="scholar-view-item" hidden="true" flex="1"/>
</box>
</hbox>
<splitter id="scholar-splitter" resizebefore="closest" resizeafter="closest" position="2" persist="collapsed"/>
</vbox>