From 7103fd4f1d27b4532ca06ff95f2925578d4ed0e6 Mon Sep 17 00:00:00 2001 From: David Norton Date: Thu, 20 Jul 2006 23:19:31 +0000 Subject: [PATCH] Fixes #23, "see also" part of note. Also, metadata looks better. See Also and Tags and Items. --- .../content/scholar/customControls.xml | 378 +++++++++++++++--- .../chromeFiles/content/scholar/itemPane.js | 8 +- .../chromeFiles/content/scholar/itemPane.xul | 5 +- .../content/scholar/selectItemsDialog.js | 48 +++ .../content/scholar/selectItemsDialog.xul | 65 +++ .../skin/default/scholar/overlay.css | 6 +- .../skin/default/scholar/scholar.css | 24 ++ 7 files changed, 469 insertions(+), 65 deletions(-) create mode 100644 chrome/chromeFiles/content/scholar/selectItemsDialog.js create mode 100644 chrome/chromeFiles/content/scholar/selectItemsDialog.xul diff --git a/chrome/chromeFiles/content/scholar/customControls.xml b/chrome/chromeFiles/content/scholar/customControls.xml index 5d49358071..3dc1ca0579 100644 --- a/chrome/chromeFiles/content/scholar/customControls.xml +++ b/chrome/chromeFiles/content/scholar/customControls.xml @@ -49,7 +49,7 @@ - + - + + @@ -121,13 +112,96 @@ - - - - - - - + + + + + + + + + + + + + + + + + + + 0) + this.id('tagsPopup').showPopup(this.id('tagsLabel'),-1,-1,-1,'popup',0,0); + else + this.id('tags').add(); + ]]> + + + + + + + + + + 0) + this.id('seeAlsoPopup').showPopup(this.id('seeAlsoLabel'),-1,-1,'popup',0,0); + else + this.id('seeAlso').add(); + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -138,8 +212,6 @@ @@ -151,21 +223,24 @@ if(this.item) { var tags = this.item.getTags(); - for(var i = 0; i < tags.length; i++) + if(tags) { - r = r + tags[i] + ", "; + for(var i = 0; i < tags.length; i++) + { + r = r + tags[i] + ", "; + } + r = r.substr(0,r.length-2); } - r = r.substr(0,r.length-2); } return r; ]]> - + - + - + + + + + + + + + + + + + - + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/chrome/chromeFiles/content/scholar/itemPane.js b/chrome/chromeFiles/content/scholar/itemPane.js index 5adc28faea..9cfd2ab54d 100644 --- a/chrome/chromeFiles/content/scholar/itemPane.js +++ b/chrome/chromeFiles/content/scholar/itemPane.js @@ -4,7 +4,7 @@ ScholarItemPane = new function() var _creatorTypeMenu; var _beforeRow; var _notesList; - var _tagsList; + var _linksBox; var _notesLabel; var _creatorCount; @@ -30,7 +30,7 @@ ScholarItemPane = new function() _creatorTypeMenu = document.getElementById('creatorTypeMenu'); _notesList = document.getElementById('editpane-dynamic-notes'); _notesLabel = document.getElementById('editpane-notes-label'); - _tagsList = document.getElementById('editpane-dynamic-tags'); + _linksBox = document.getElementById('editpane-links'); var creatorTypes = Scholar.CreatorTypes.getTypes(); for(var i = 0; i < creatorTypes.length; i++) @@ -142,7 +142,7 @@ ScholarItemPane = new function() _updateNoteCount(); //TAGS: - _tagsList.item = _itemBeingEdited; + _linksBox.item = _itemBeingEdited; } function changeTypeTo(id) @@ -156,7 +156,7 @@ ScholarItemPane = new function() } function addDynamicRow(label, value, beforeElement) - { + { var row = document.createElement("row"); row.appendChild(label); row.appendChild(value); diff --git a/chrome/chromeFiles/content/scholar/itemPane.xul b/chrome/chromeFiles/content/scholar/itemPane.xul index 06c4c64df5..d2f95a6547 100644 --- a/chrome/chromeFiles/content/scholar/itemPane.xul +++ b/chrome/chromeFiles/content/scholar/itemPane.xul @@ -9,7 +9,6 @@ - @@ -41,12 +40,10 @@ - - - + \ No newline at end of file diff --git a/chrome/chromeFiles/content/scholar/selectItemsDialog.js b/chrome/chromeFiles/content/scholar/selectItemsDialog.js new file mode 100644 index 0000000000..f853d1ec4c --- /dev/null +++ b/chrome/chromeFiles/content/scholar/selectItemsDialog.js @@ -0,0 +1,48 @@ +var itemsView; +var collectionsView; +var io; + +function doLoad() +{ + io = window.arguments[0]; + + collectionsView = new Scholar.CollectionTreeView(); + document.getElementById('collections-tree').view = collectionsView; +} + +function onCollectionSelected() +{ + if(itemsView) + itemsView.unregister(); + + if(collectionsView.selection.count == 1 && collectionsView.selection.currentIndex != -1) + { + var collection = collectionsView._getItemAtRow(collectionsView.selection.currentIndex); + collection.setSearch(''); + + itemsView = new Scholar.ItemTreeView(collection); + document.getElementById('items-tree').view = itemsView; + } + +} + +function onItemSelected() +{ + +} + +function doAccept() +{ + var start = new Object(); + var end = new Object(); + io.dataOut = new Array(); + + for(var i = 0, rangeCount = itemsView.selection.getRangeCount(); i < rangeCount; i++) + { + itemsView.selection.getRangeAt(i,start,end); + for(var j = start.value; j <= end.value; j++) + { + io.dataOut.push(itemsView._getItemAtRow(j).ref.getID()); + } + } +} \ No newline at end of file diff --git a/chrome/chromeFiles/content/scholar/selectItemsDialog.xul b/chrome/chromeFiles/content/scholar/selectItemsDialog.xul new file mode 100644 index 0000000000..cb76cee533 --- /dev/null +++ b/chrome/chromeFiles/content/scholar/selectItemsDialog.xul @@ -0,0 +1,65 @@ + + + + + + + + +