{"size": 906, "ext": "js", "max_stars_repo_path": "src/plugins/count-visualization.js", "max_stars_repo_name": "vlizard/EchoConversations", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/plugins/count-visualization.js", "max_issues_repo_name": "vlizard/EchoConversations", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/plugins/count-visualization.js", "max_forks_repo_name": "vlizard/EchoConversations", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.2307692308, "max_line_length": 98, "alphanum_fraction": 0.6589403974}
(function($) {
"use strict";

var plugin = Echo.Plugin.manifest("CountVisualization", "Echo.StreamServer.Controls.PostCounter");

if (Echo.Plugin.isDefined(plugin)) return;

plugin.events = {
	"Echo.StreamServer.Controls.PostCounter.onUpdate": function() {
		this.view.render({"name": "count"});
	}
};

plugin.init = function() {
	this.extendTemplate("replace", "count", plugin.templates.main);
};

plugin.templates.main =
	'<span class="{plugin.class:count}">' +
		' (<span class="{class:count}"></span>)' +
	'</span>';

plugin.renderers.count = function(element) {
	var count = this.component.get("data.count");
	var visible = (typeof count === "string" && count === "5000+")
		|| (typeof count === "number" && count > 0);

	return visible
		? element.show()
		: element.hide();
};

plugin.css =
	'.{plugin.class} .echo-control-message { display: none; }';

Echo.Plugin.create(plugin);

})(Echo.jQuery);
