Collection names must be non-empty -- interface side might follow iTunes behavior ('untitled playlist') here

This commit is contained in:
Dan Stillman 2006-06-03 20:51:48 +00:00
parent e2c9ee0387
commit bd840a4c58

View file

@ -1029,6 +1029,8 @@ Scholar.Collection.prototype.hasChildItems = function(){
/** /**
* Rename the collection * Rename the collection
* *
* _name_ is non-empty string
*
* Returns true on success, or false on error * Returns true on success, or false on error
**/ **/
Scholar.Collection.prototype.rename = function(name){ Scholar.Collection.prototype.rename = function(name){
@ -1248,6 +1250,14 @@ Scholar.Collections = new function(){
} }
/**
* Add new collection to DB and return Collection object
*
* _name_ is non-empty string
* _parent_ is optional collectionID -- creates root collection by default
*
* Returns true on success; false on error
**/
function add(name, parent){ function add(name, parent){
if (!name){ if (!name){
return false; return false;