Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if ((j > 0 && (j + 1) % 4 == 0) || j == videosLen - 1) {
carouselSlides.push({
videos: carouselSlide
});
carouselSlide = [];
}
}
currentActivity.collection._carouselSlides = carouselSlides;
// format
collectionStats.likes = Util.integerCommaFormat(collectionStats.likes);
collectionStats.views = Util.integerCommaFormat(collectionStats.views);
collectionStats.adoptions = Util.integerCommaFormat(collectionStats.adoptions);
collectionStats.totalDuration = Util.secondsToHMSFormat(collectionStats.totalDuration);
currentActivity.collection._collectionStats = collectionStats;
}
}
},
var i = 0;
var j;
var len = collectionsArray.length;
for (; i < len; i++) {
var currentCollectionData = Util.Object.clone(collectionsArray[i], true);
currentCollectionData._index = i;
currentCollectionData._collectionStats = this._getCollectionStats(currentCollectionData);
currentCollectionData._plural = (currentCollectionData.videos.length != 1);
// render collections
entireRenderedHTML += viewRenderer.render(collectionTemplate, currentCollectionData);
// add length to each video
for (j = 0; j < currentCollectionData.videos.length; j++) {
currentCollectionData.videos[j]._time = Util.secondsToHMSFormat(currentCollectionData.videos[j].duration);
}
// organize videos into slides
var videoDrawerData = this._prepareVideoDrawerData(currentCollectionData.videos);
// assign remaining needed rendering data
videoDrawerData._index = i;
// store the video drawer data
tempVideoDrawerArray.push(videoDrawerData);
// once we've displayed our desired amount of videos in this column.
// include accumulated video drawer html with the overall html
if ((i + 1) % collectionsPerRow == 0 || i == len - 1) {
entireRenderedHTML += viewRenderer.render(collectionVideoDrawerTemplate, {
_videoDrawerClasses: videoDrawerClasses,
if ((j > 0 && (j + 1) % 4 == 0) || j == videosLen - 1) {
carouselSlides.push({
videos: carouselSlide
});
carouselSlide = [];
}
}
currentActivity.collection._carouselSlides = carouselSlides;
// format
collectionStats.likes = Util.integerCommaFormat(collectionStats.likes);
collectionStats.views = Util.integerCommaFormat(collectionStats.views);
collectionStats.adoptions = Util.integerCommaFormat(collectionStats.adoptions);
collectionStats.totalDuration = Util.secondsToHMSFormat(collectionStats.totalDuration);
currentActivity.collection._collectionStats = collectionStats;
}
}
},
if ((j > 0 && (j + 1) % 3 == 0) || j == videosLen - 1) {
carouselSlides.push({
videos: carouselSlide
});
carouselSlide = [];
}
}
currentActivity.collection._carouselSlides = carouselSlides;
// format
collectionStats.likes = Util.integerCommaFormat(collectionStats.likes);
collectionStats.views = Util.integerCommaFormat(collectionStats.views);
collectionStats.adoptions = Util.integerCommaFormat(collectionStats.adoptions);
collectionStats.totalDuration = Util.secondsToHMSFormat(collectionStats.totalDuration);
currentActivity.collection._collectionStats = collectionStats;
}
}
},
var j;
var len = collectionsArray.length;
for (; i < len; i++) {
var currentCollectionData = Util.Object.clone(collectionsArray[i], true);
var itemIndex = (collectionsData.startPage * collectionsData.countPerPage) + i
currentCollectionData._index = itemIndex;
currentCollectionData._collectionStats = this._getCollectionStats(currentCollectionData);
currentCollectionData._plural = (currentCollectionData.videos.length != 1);
// render collections
tempRenderHTML += viewRenderer.render(collectionTemplate, currentCollectionData);
// add length to each video
for (j = 0; j < currentCollectionData.videos.length; j++) {
currentCollectionData.videos[j]._time = Util.secondsToHMSFormat(currentCollectionData.videos[j].duration);
}
// organize videos into slides
var videoDrawerData = this._prepareVideoDrawerData(currentCollectionData.videos);
// assign remaining needed rendering data
videoDrawerData._index = itemIndex;
// store the video drawer data
tempVideoDrawerArray.push(videoDrawerData);
// once we've displayed our desired amount of videos in this column.
// include accumulated video drawer html with the overall html
if ((i + 1) % collectionsPerRow == 0 || i == len - 1) {
tempRenderHTML += viewRenderer.render(collectionVideoDrawerTemplate, {
_videoDrawerClasses: videoDrawerClasses,
var i = 0;
var j;
var len = collectionsArray.length;
for (; i < len; i++) {
var currentCollectionData = Util.Object.clone(collectionsArray[i], true);
currentCollectionData._index = i;
currentCollectionData._collectionStats = this._getCollectionStats(currentCollectionData);
currentCollectionData._plural = (currentCollectionData.videos.length != 1);
// render collections
entireRenderedHTML += viewRenderer.render(collectionTemplate, currentCollectionData);
// add length to each video
for (j = 0; j < currentCollectionData.videos.length; j++) {
currentCollectionData.videos[j]._time = Util.secondsToHMSFormat(currentCollectionData.videos[j].duration);
}
// organize videos into slides
var videoDrawerData = this._prepareVideoDrawerData(currentCollectionData.videos);
// assign remaining needed rendering data
videoDrawerData._index = i;
// store the video drawer data
tempVideoDrawerArray.push(videoDrawerData);
// once we've displayed our desired amount of videos in this column.
// include accumulated video drawer html with the overall html
if ((i + 1) % collectionsPerRow == 0 || i == len - 1) {
entireRenderedHTML += viewRenderer.render(collectionVideoDrawerTemplate, {
_videoDrawerClasses: videoDrawerClasses,
throw new Error('CollectionViewController._getCollectionStats(): trying to get collection stats on an object with no videos array');
}
var i = 0;
var len = videos.length;
for (; i < len; i++) {
var currentVideo = videos[i];
time += currentVideo.duration;
adoptions += currentVideo.adoptions;
views += currentVideo.offlineViews + currentVideo.onlineViews;
likes += currentVideo.onlineLikes;
}
return {
time: Util.secondsToHMSFormat(time),
adoptions: Util.integerCommaFormat(adoptions),
views: Util.integerCommaFormat(views),
likes: Util.integerCommaFormat(likes)
};
},
views = Util.integerCommaFormat(collectionData.views);
}
else{
views = Util.integerAbbreviatedFormat(collectionData.views);
}
var likes = ''
if (collectionData.likes < 10000){
likes = Util.integerCommaFormat(collectionData.likes);
}
else{
likes = Util.integerAbbreviatedFormat(collectionData.likes);
}
return {
time: Util.secondsToHMSFormat(time),
adoptions: adoptions,
views: views,
likes: likes
};
},
var videos = collectionData.videos;
if (!videos) {
throw new Error('CollectionViewController._getCollectionStats(): trying to get collection stats on an object with no videos array');
}
var i = 0;
var len = videos.length;
for (; i < len; i++) {
var currentVideo = videos[i];
time += currentVideo.duration;
}
return {
time: Util.secondsToHMSFormat(time),
adoptions: Util.integerCommaFormat(collectionData.adoptions),
views: Util.integerCommaFormat(collectionData.views),
likes: Util.integerCommaFormat(collectionData.likes)
};
},