From b65a56b4d9d980a414bf90df70a1804a6d23f695 Mon Sep 17 00:00:00 2001 From: David Norton Date: Tue, 6 Jun 2006 19:53:27 +0000 Subject: [PATCH] Fairly major metadatapane reworking. It is now nextdoor to the items list. - Lots of work to be done. For example, the present way of showing a textbox is sort of a hack - taking a label, assigning certain properties to a textbox, then removing the label and placing the textbox in its place. I will be looking into our options. - Also, I need to figure out adding/editing/deleting creators. - When the textbox loses focus, it updates and saves the item (like iCal). Date: removed Scholare.Date functions, as they are overkill. We can use the built-in Date.toLocaleString() --- .../content/scholar/itemTreeView.js | 6 +- .../content/scholar/metadataPane.js | 143 +++++++++--------- .../content/scholar/metadataPane.xul | 26 ---- chrome/chromeFiles/content/scholar/overlay.js | 37 +---- .../chromeFiles/content/scholar/overlay.xul | 38 ++--- .../content/scholar/xpcom/scholar.js | 22 +-- .../skin/default/scholar/overlay.css | 61 +------- 7 files changed, 92 insertions(+), 241 deletions(-) diff --git a/chrome/chromeFiles/content/scholar/itemTreeView.js b/chrome/chromeFiles/content/scholar/itemTreeView.js index 4de13e3b0..e49cd19ae 100644 --- a/chrome/chromeFiles/content/scholar/itemTreeView.js +++ b/chrome/chromeFiles/content/scholar/itemTreeView.js @@ -41,11 +41,7 @@ Scholar.ItemTreeView.prototype.getCellText = function(row, column) if(column.id == 'dateAdded' || column.id == 'dateModified') //this is not so much that we will use this format for date, but a simple template for later revisions. { - var myDate = new Date(); - - myDate.setTime(Date.parse(val.replace("-","/").replace("-","/"))); - - val = Scholar.Date.formatDate(myDate,'M/d/y h:mma'); + val = new Date(Date.parse(val.replace(/-/g,"/"))).toLocaleString(); } return val; diff --git a/chrome/chromeFiles/content/scholar/metadataPane.js b/chrome/chromeFiles/content/scholar/metadataPane.js index ab4bd84dd..30af17dae 100644 --- a/chrome/chromeFiles/content/scholar/metadataPane.js +++ b/chrome/chromeFiles/content/scholar/metadataPane.js @@ -1,21 +1,17 @@ MetadataPane = new function() { var _dynamicFields; - var _dynamicCreators; - var _editButton; - var _cancelButton; - var _saveButton; - var _creatorsToolbar; var _itemBeingEdited; var _creatorTypes = Scholar.CreatorTypes.getTypes(); this.onLoad = onLoad; this.viewItem = viewItem; - this.toggleEdit = toggleEdit; - this.saveItem = saveItem; +/* this.saveItem = saveItem; this.addCreator = addCreator; - this.removeCreator = removeCreator; + this.removeCreator = removeCreator; */ + this.showEditor = showEditor; + this.hideEditor = hideEditor; function onLoad() { @@ -34,33 +30,27 @@ MetadataPane = new function() * Loads an item */ function viewItem(thisItem) - { - if(_editButton.hidden) - toggleEdit(confirm(Scholar.getString('metadata.savechanges').replace('%1',_itemBeingEdited.getField('title')))); - + { _itemBeingEdited = thisItem; reloadFields(); - } function reloadFields() { removeDynamicRows(_dynamicFields); - removeDynamicRows(_dynamicCreators); thisItem = _itemBeingEdited; var fieldNames = getFullFieldList(thisItem); - var editingMode = _editButton.hidden; for(var i = 0; i 0) @@ -68,39 +58,15 @@ MetadataPane = new function() for(var i = 0, len=thisItem.numCreators(); i