d6fa0455e1
- Added 'note' item type - Updated API to support independent note creation Notes are, more or less, just regular items, with an item type of 1. They're created through Scholar.Notes.add(text, sourceItemID), which returns the itemID of the new note. sourceItemID is optional--if left out, an independent note will be created. (There's currently nothing stopping you from doing getNewItemByType(1) yourself, but the note would be contentless and broken, so you shouldn't do that.) Note data could've been stuffed into itemData, but I kept it separate in itemNotes to keep metadata searching faster and to keep things cleaner. Methods calls that can be called on all items: isNote() (same as testing for itemTypeID 1) Method calls that can be called on source items only: numNotes() getNotes() (array of note itemIDs for a source) Method calls that can be called on note items only: updateNote(text) setNoteSource(sourceItemID) (for changing source--use empty or false to make independent, which is currently what happens when you delete a note--will get option with #91) getNote() (note content) getNoteSource() (sourceItemID of a note) Calling the above methods on the wrong item types will throw an error. *** This will break note creation/display until David updates interface code. *** |
||
---|---|---|
.. | ||
preferences.dtd | ||
scholar.dtd | ||
scholar.properties |