{"size": 1760, "ext": "js", "max_stars_repo_path": "Chapter07/resources/ext-6.2.0-gpl/ext-6.2.0/templates/admin-dashboard/modern/src/view/widgets/SocialStatus.js", "max_stars_repo_name": "PacktPublishing/Mastering-Postgis", "max_stars_repo_stars_event_min_datetime": "2018-05-07T07:40:10.000Z", "max_stars_repo_stars_event_max_datetime": "2019-10-20T15:49:00.000Z", "max_issues_repo_path": "Chapter07/resources/ext-6.2.0-gpl/ext-6.2.0/templates/admin-dashboard/modern/src/view/widgets/SocialStatus.js", "max_issues_repo_name": "PacktPublishing/Mastering-Postgis", "max_issues_repo_issues_event_min_datetime": "2021-03-10T11:45:17.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-27T15:05:54.000Z", "max_forks_repo_path": "Chapter07/resources/ext-6.2.0-gpl/ext-6.2.0/templates/admin-dashboard/modern/src/view/widgets/SocialStatus.js", "max_forks_repo_name": "PacktPublishing/Mastering-Postgis", "max_forks_repo_forks_event_min_datetime": "2018-11-30T12:52:22.000Z", "max_forks_repo_forks_event_max_datetime": "2021-04-01T08:17:41.000Z"}
{"max_stars_count": 7, "max_issues_count": 15, "max_forks_count": 7, "avg_line_length": 26.6666666667, "max_line_length": 92, "alphanum_fraction": 0.5528409091}
/**
 * This class is a custom toolbar intended for use as a BioTile footer.
 */
Ext.define('Admin.view.widgets.SocialStatus', {
    extend: 'Ext.Toolbar',
    xtype: 'socialstatus',
    border: false,

    config: {
        format: '0,000',

        followers: null,

        following: null,

        likes: null
    },

    referenceHolder: true, // all logic is our updaters, we'll hold the refs (no controller)

    items: [{
        xtype: 'component',
        flex: 1,
        reference: 'following',
        userCls: 'social-status-category',
        html: '<div class="social-status-header">Following</div>' +
              '<div class="social-status-count">3</div>'
    }, {
        xtype: 'component',
        flex: 1,
        reference: 'followers',
        userCls: 'social-status-category',
        html: '<div class="social-status-header">Followers</div>' +
              '<div class="social-status-count">1</div>'
    }, {
        xtype: 'component',
        flex: 1,
        reference: 'likes',
        userCls: 'social-status-category',
        html: '<div class="social-status-header">Likes</div>' +
              '<div class="social-status-count">2</div>'
    }],

    updateFollowers: function (value) {
        this.setCount('followers', value);
    },

    updateFollowing: function (value) {
        this.setCount('following', value);
    },

    updateLikes: function (value) {
        this.setCount('likes', value);
    },

    privates: {
        setCount: function (name, value) {
            var component = this.lookup(name),
                el = component.element.down('.social-status-count'),
                format = this.getFormat();

            el.dom.textContent = Ext.util.Format.number(value, format);
        }
    }
});
