Author: ygrego Date: 2015-03-26 16:05:41 +0000 (Thu, 26 Mar 2015) New Revision: 974 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/974 Log: This class will replace "ChannelConfig" only in use in objects which need information on channel list. Added: oipf/js/utils/ChannelService.js Added: oipf/js/utils/ChannelService.js =================================================================== --- oipf/js/utils/ChannelService.js (rev 0) +++ oipf/js/utils/ChannelService.js 2015-03-26 16:05:41 UTC (rev 974) @@ -0,0 +1,39 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +var ChannelService = ChannelConfig.extend({ + + channelObject: { + + }, + + init: function(currentChannel) { + this.currentChannel && (this.currentChannel = currentChannel || null); + var channelName = "ARTE"; + var channelIdType = 12; + var channelArte = new Channel(channelIdType, 52, 53, 54, channelName); + + channelName = "FRANCE_5"; + var channelFrance5 = new Channel(channelIdType, 12, 13, 14, channelName); + + channelName = "FRANCE_4"; + var channelFrance4 = new Channel(channelIdType, 22, 23, 24, channelName); + + this.currentChannel = channelArte; + this.channelList = new ChannelList(channelArte, channelFrance5, channelFrance4); + this.favouriteLists = new FavouriteListCollection(); + this.currentFavouriteList = new FavouriteList(); + }, + + prevChannel: function(channelCollection, channel) { + return channelUtils.findChannel(channelCollection, channel, -1); + }, + + nextChannel: function(channelCollection, channel) { + return channelUtils.findChannel(channelCollection, channel, 1); + } + +});