ScholarItemPane = new function() { var _dynamicFields; var _creatorTypeMenu; var _beforeRow; var _notesPane; var _creatorCount; var _itemBeingEdited; this.onLoad = onLoad; this.viewItem = viewItem; this.addCreatorRow = addCreatorRow; this.removeCreator = removeCreator; this.showEditor = showEditor; this.hideEditor = hideEditor; this.modifyField = modifyField; this.modifyCreator = modifyCreator; function onLoad() { _dynamicFields = document.getElementById('editpane-dynamic-fields'); _creatorTypeMenu = document.getElementById('creatorTypeMenu'); _notesPane = document.getElementById('scholar-notes'); var creatorTypes = Scholar.CreatorTypes.getTypes(); for(var i = 0; i < creatorTypes.length; i++) { var menuitem = document.createElement("menuitem"); menuitem.setAttribute("label",Scholar.getString('creatorTypes.'+creatorTypes[i]['name'])); menuitem.setAttribute("typeid",creatorTypes[i]['id']); if(creatorTypes[i]['id'] == 0) menuitem.setAttribute("selected",true); _creatorTypeMenu.appendChild(menuitem); } return true; } /* * Loads an item */ function viewItem(thisItem) { _itemBeingEdited = thisItem; reloadFields(); } function reloadFields() { while(_dynamicFields.hasChildNodes()) _dynamicFields.removeChild(_dynamicFields.firstChild); var fieldNames = new Array("title","dateAdded","dateModified"); var fields = Scholar.ItemFields.getItemTypeFields(_itemBeingEdited.getField("itemTypeID")); for(var i = 0; i 0) { for(var i = 0, len=_itemBeingEdited.numCreators(); i