Author: ygrego Date: 2015-02-13 14:25:06 +0000 (Fri, 13 Feb 2015) New Revision: 798 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/798 Log: Deletion of duplicated variables and addition of javascript operators: "===", "!==". Modified: oipf/js/impl/model/SearchResults.js Modified: oipf/js/impl/model/SearchResults.js =================================================================== --- oipf/js/impl/model/SearchResults.js 2015-02-13 14:21:13 UTC (rev 797) +++ oipf/js/impl/model/SearchResults.js 2015-02-13 14:25:06 UTC (rev 798) @@ -87,8 +87,8 @@ item = channels[i]; displayName = item[displayNameStr]; - if (displayName == this._currentQuery.channel.name) { - currentChannelId = item[idStr] + if (displayName === this._currentQuery.channel.name) { + currentChannelId = item[idStr]; break; } } @@ -105,7 +105,7 @@ for (var i = 0; i< programs.length; i++) { var item = programs[i]; - if (item[channelStr] == currentChannelId) { // && date + if (item[channelStr] === currentChannelId) { // && date var tmpSSTime = item[startStr]; tmpSSTime = pattern.exec(tmpSSTime); @@ -128,9 +128,6 @@ tmpSSTime = pattern.exec(tmpSSTime); console.log(tmpSSTime); - year = dateTmp.getFullYear(); - month = dateTmp.getUTCMonth(); - day = dateTmp.getUTCDate(); hs = parseInt(tmpSSTime[4]); mins = parseInt(tmpSSTime[5]); secs = parseInt(tmpSSTime[6]); @@ -170,9 +167,9 @@ // console.log(this._search); var self = this; setTimeout(function() { - console.log("<<<<<<<<<<<<<<", new Date(), ">>>>>>>>>>>>>>>>"); + console.log("<<<<<<<<<<<<<<", new Date(), ">>>>>>>>>>>>>>>>", currentProgramIndex); //When user want more than one result into his search. - if (currentProgramIndex) { + if (currentProgramIndex !== undefined) { for (var i = 0; i < count; i++) { self.push(programs[currentProgramIndex]); currentProgramIndex++;