commit 1096a95f62fa477deacf25f033b5ec89acbad250
parent b94cf81ba38abd974b57e55480b5440a0eecfe06
Author: David Norton <david@nortoncrew.com>
Date: Mon, 26 Jun 2006 14:46:21 +0000
Several little interface bugs fixed regarding Notes.
Diffstat:
5 files changed, 26 insertions(+), 12 deletions(-)
diff --git a/chrome/chromeFiles/content/scholar/itemPane.js b/chrome/chromeFiles/content/scholar/itemPane.js
@@ -116,14 +116,15 @@ ScholarItemPane = new function()
var icon = document.createElement('image');
icon.setAttribute('src','chrome://scholar/skin/treeitem-note.png');
- var button = document.createElement('label');
- button.setAttribute('value',_noteToTitle(_itemBeingEdited.getNote(notes[i])));
+ var label = document.createElement('label');
+ label.setAttribute('value',_noteToTitle(_itemBeingEdited.getNote(notes[i])));
+ label.setAttribute('crop','end');
box = document.createElement('box');
box.setAttribute('onclick',"window.open('chrome://scholar/content/note.xul?item="+_itemBeingEdited.getID()+"¬e="+notes[i]+"','','chrome,resizable,centerscreen');");
box.setAttribute('class','clicky');
box.appendChild(icon);
- box.appendChild(button);
+ box.appendChild(label);
var removeButton = document.createElement('label');
removeButton.setAttribute("value","-");
diff --git a/chrome/chromeFiles/content/scholar/itemPane.xul b/chrome/chromeFiles/content/scholar/itemPane.xul
@@ -25,14 +25,14 @@
<column/>
<column flex="1"/>
</columns>
-
- <rows id="editpane-dynamic-fields" flex="1">
- </rows>
+ <rows id="editpane-dynamic-fields" flex="1"/>
</grid>
</vbox>
- <vbox>
- <button label="New Note" oncommand="ScholarItemPane.addNote();"/>
- <label id="editpane-notes-label"/>
+ <vbox flex="1">
+ <hbox align="center">
+ <label id="editpane-notes-label"/>
+ <button label="New Note" oncommand="ScholarItemPane.addNote();"/>
+ </hbox>
<grid flex="1">
<columns>
<column flex="1"/>
diff --git a/chrome/chromeFiles/content/scholar/note.js b/chrome/chromeFiles/content/scholar/note.js
@@ -6,6 +6,8 @@ var _notesField;
function onLoad()
{
_notesField = document.getElementById('notes-box');
+ _notesField.focus();
+
var params = new Array();
var b = document.location.href.substr(document.location.href.indexOf('?')+1).split('&');
for(var i = 0; i < b.length; i++)
@@ -22,6 +24,11 @@ function onLoad()
_notesField.setAttribute('value',item.getNote(noteID));
}
+function onUnload()
+{
+ save();
+}
+
function save()
{
if(noteID)
@@ -30,4 +37,5 @@ function save()
noteID = item.addNote(_notesField.value);
}
-addEventListener("load", function(e) { onLoad(e); }, false);
-\ No newline at end of file
+addEventListener("load", function(e) { onLoad(e); }, false);
+addEventListener("unload", function(e) { onUnload(e); }, false);
+\ No newline at end of file
diff --git a/chrome/chromeFiles/content/scholar/note.xul b/chrome/chromeFiles/content/scholar/note.xul
@@ -12,6 +12,11 @@
<script src="include.js"/>
<script src="note.js"/>
+
+ <keyset>
+ <key id="key_close" key="W" modifiers="accel" command="cmd_close"/>
+ </keyset>
+ <command id="cmd_close" oncommand="window.close();"/>
<label id="info-label"/>
<textbox id="notes-box" flex="1" multiline="true" type="timed" timeout="1000" oncommand="save();"/>
diff --git a/chrome/chromeFiles/skin/default/scholar/overlay.css b/chrome/chromeFiles/skin/default/scholar/overlay.css
@@ -90,7 +90,7 @@ vbox #scholar-pane
width: 150px;
}
-#scholar-info
+#scholar-view-item vbox
{
overflow: auto;
}