Author: ygrego Date: 2015-02-25 15:47:05 +0000 (Wed, 25 Feb 2015) New Revision: 877 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/877 Log: This class will contain several methods very useful in order to operate tasks on channels. Added: oipf/js/utils/ChannelTools.js Added: oipf/js/utils/ChannelTools.js =================================================================== --- oipf/js/utils/ChannelTools.js (rev 0) +++ oipf/js/utils/ChannelTools.js 2015-02-25 15:47:05 UTC (rev 877) @@ -0,0 +1,20 @@ +/* + * 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 ChannelTools = Class.extend({ + init: function() { + }, + findChannel: function(channelCollection, channel, step) { + + for (var keys = Object.keys(channelCollection) in channelCollection) { + if (channelCollection[keys] == channel) { + return channelCollection[(keys % channelCollection.length) + step]; + } + } + return null; + } + +}); +