How to use the framework/Util.integerCommaFormat function in framework

To help you get started, we’ve selected a few framework examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github digitalgreenorg / dg / dg / media / social_website / scripts / app / view-controllers / profile / ActivitiesViewController.js View on Github external
collectionStats.totalDuration += currentVideo.duration;

                        carouselSlide.push(currentVideo);

                        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;
                }
            }
        },
github digitalgreenorg / dg / dg / media / social_website / scripts / app / view-controllers / news / NewsFeedViewController.js View on Github external
collectionStats.totalDuration += currentVideo.duration;

                        carouselSlide.push(currentVideo);

                        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;
                }
            }
        },
github digitalgreenorg / dg / dg / media / social_website / scripts / app / view-controllers / news / NewsFeedViewController.js View on Github external
carouselSlide.push(currentVideo);

                        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;
                }
            }
        },
github digitalgreenorg / dg / media / social_website / scripts / app / controllers / ViewCollectionsController.js View on Github external
var $rightValue;
            var $statIndicator;

            var i = 0;
            var len = $statBarWrappers.length;
            for (; i < len; i++) {
                var $currentStatBarWrapper = $statBarWrappers.eq(i);

                $statBar = $currentStatBarWrapper.find('.js-stat-bar');
                var leftValue = $statBar.data('leftValue');
                var rightValue = $statBar.data('rightValue');

                $leftValue = $currentStatBarWrapper.find('.js-left-value');
                $rightValue = $currentStatBarWrapper.find('.js-right-value');
                $leftValue.html(Util.integerCommaFormat(leftValue));
                $rightValue.html(Util.integerCommaFormat(rightValue));

                $statIndicator = $currentStatBarWrapper.find('.js-stat-indicator');

                // for basic width setting, use this line instead
                // $statIndicator.css('width', ((leftValue * 100) / (leftValue + rightValue)) + '%');

                // otherwise, this can be used to animate the effect
                $statIndicator.animate({
                    width: ((leftValue * 100) / (leftValue + rightValue)) + '%'
                }, 2000);

            }
        },
github digitalgreenorg / dg / dg / media / social_website / scripts / app / view-controllers / CollectionViewController.js View on Github external
}
            	else{
            		adoptions = Util.integerAbbreviatedFormat(collectionData.adoptions);
            	}

            var views = ''
            	if (collectionData.views < 10000){
            		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
            };
        },
github digitalgreenorg / dg / dg / media / social_website / scripts / app / view-controllers / GenericCollectionsViewController.js View on Github external
}

            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)
            };
        },
github digitalgreenorg / dg / media / social_website / scripts / app / view-controllers / CollectionViewController.js View on Github external
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)
            };
        },
github digitalgreenorg / dg / media / social_website / scripts / app / view-controllers / CollectionViewController.js View on Github external
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)
            };
        },
github digitalgreenorg / dg / media / social_website / scripts / app / view-controllers / CollectionViewController.js View on Github external
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)
            };
        },
github digitalgreenorg / dg / dg / media / social_website / scripts / app / view-controllers / CommentsFeedViewController.js View on Github external
updateTotalCount: function(totalCount) {
            this._state.totalCount = totalCount;
            jQuery('.js-comment-count').html(Util.integerCommaFormat(totalCount));
        },