Author: ygrego Date: 2015-02-27 16:47:19 +0000 (Fri, 27 Feb 2015) New Revision: 886 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/886 Log: "FavouriteListCollection" will manage severals lists of favourites channels. Each class concerned here, extend to javascript class "Array" and call her method "push" in their constructor to simulate an array creation if arguments present when the constructor is called. Added: oipf/js/impl/model/FavouriteListCollection.js Modified: oipf/js/impl/model/FavouriteList.js oipf/js/impl/model/IntegerCollection.js oipf/js/impl/model/TunerCollection.js Modified: oipf/js/impl/model/FavouriteList.js =================================================================== --- oipf/js/impl/model/FavouriteList.js 2015-02-27 16:38:33 UTC (rev 885) +++ oipf/js/impl/model/FavouriteList.js 2015-02-27 16:47:19 UTC (rev 886) @@ -5,10 +5,10 @@ * In order to preserve backwards compatibility with already existing DAE content the JavaScript toString() method * SHALL return the FavouriteList.id for FavouriteList objects. */ -var FavouriteList = Collection.extend({ +var FavouriteList = Array.extend({ - init: function(elements) { - this.super.init(elements); + init: function() { + this.push.apply(this, arguments); } }); Added: oipf/js/impl/model/FavouriteListCollection.js =================================================================== --- oipf/js/impl/model/FavouriteListCollection.js (rev 0) +++ oipf/js/impl/model/FavouriteListCollection.js 2015-02-27 16:47:19 UTC (rev 886) @@ -0,0 +1,25 @@ +/* Description; + * The FavouriteListCollection class represents a collection of FavouriteList objects. See Annex K for the + * definition of the collection template. In addition to the methods and properties defined for generic collections, the + * FavouriteListCollection class supports the additional methods defined below. + */ +var FavouriteListCollection = Array.extend({ + + init: function() { + this.push.apply(this, arguments); + }, + /* + * Description: + * Return the first favourite list in the collection with the given favListID. + * + * Arguments: + * - favID: The ID of a favourite list. + * + * Return: FavouriteList + */ + getFavouriteList: function(favID) { + + } + + +}); Modified: oipf/js/impl/model/IntegerCollection.js =================================================================== --- oipf/js/impl/model/IntegerCollection.js 2015-02-27 16:38:33 UTC (rev 885) +++ oipf/js/impl/model/IntegerCollection.js 2015-02-27 16:47:19 UTC (rev 886) @@ -4,12 +4,9 @@ * */ -var IntegerCollection = Collection.extend({ - - init: function(elements) { - if (elements) { - this.super.init(elements); - } - } +var IntegerCollection = Array.extend({ + init: function() { + this.push.apply(this, arguments); + } }); Modified: oipf/js/impl/model/TunerCollection.js =================================================================== --- oipf/js/impl/model/TunerCollection.js 2015-02-27 16:38:33 UTC (rev 885) +++ oipf/js/impl/model/TunerCollection.js 2015-02-27 16:47:19 UTC (rev 886) @@ -1,13 +1,11 @@ /* -* Description: -* The TunerCollection class represents a collection of Tuner objects. See Annex K for the definition of the collection template. -* -*/ -var TunerCollection = Collection.extend({ - - init : function(elements) { - - this.super.init(elements); + * Description: + * The TunerCollection class represents a collection of Tuner objects. See Annex K for the definition of the collection template. + * + */ +var TunerCollection = Array.extend({ + init: function() { + this.push.apply(this, arguments); } }); \ No newline at end of file