<commit_before>(function($) {
	/**
	 * JsViewports module implementation.
	 *
	 * @author sharte
	 * @namespace Tc.Module
	 * @class JsViewports
	 * @extends Tc.Module
	 */
	Tc.Module.JsViewports = Tc.Module.extend({

		/**
		 * Initializes the JsViewports module.
		 *
		 * @method init
		 * @constructor
		 * @param {jQuery|Zepto} $ctx the jquery context
		 * @param {Sandbox} sandbox the sandbox to get the resources from
		 * @param {String} modId the unique module id
		 */
		init: function($ctx, sandbox, modId) {
			// call base constructor
			this._super($ctx, sandbox, modId);
			
			this.subscribe('media');
			
			this.$viewportDisplay = this.$$('.js-viewport');
		},

		/**
		 * Hook function to do all of your module stuff.
		 *
		 * @method on
		 * @param {Function} callback function
		 * @return void
		 */
		on: function(callback) {
			callback();
		},

		/**
		 * Hook function to trigger your events.
		 *
		 * @method after
		 * @return void
		 */
		after: function() {
		},
		
		////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		// CONNECTOR CALLBACKS

		onViewportChange: function(data) {
			if(data.state == 'match') {
				this.setViewportText(data.query.name);
			}
		},
		
		////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		// METHODS
		
		setViewportText: function(name) {
			this.$viewportDisplay.text(name);
		}
	});
})(Tc.$);<commit_msg>implement js viewport announcement<commit_after>(function ($) {
	/**
	 * JsViewports module implementation.
	 *
	 * @author sharte
	 * @namespace Tc.Module
	 * @class JsViewports
	 * @extends Tc.Module
	 */
	Tc.Module.JsViewports = Tc.Module.extend({

		/**
		 * Initializes the JsViewports module.
		 *
		 * @method init
		 * @constructor
		 * @param {jQuery|Zepto} $ctx the jquery context
		 * @param {Sandbox} sandbox the sandbox to get the resources from
		 * @param {String} modId the unique module id
		 */
		init: function ($ctx, sandbox, modId) {
			// call base constructor
			this._super($ctx, sandbox, modId);

			this.subscribe('media');

			this.$viewportDisplay = this.$$('.js-viewport');
		},

		/**
		 * Hook function to do all of your module stuff.
		 *
		 * @method on
		 * @param {Function} callback function
		 * @return void
		 */
		on: function (callback) {
			callback();
		},

		/**
		 * Hook function to trigger your events.
		 *
		 * @method after
		 * @return void
		 */
		after: function () {
		},

		////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		// CONNECTOR CALLBACKS

		onViewportChange: function (data) {
			if (data.state == 'match') {
				this.setViewportText(data.query.name);
			}
		},

		////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		// METHODS

		setViewportText: function (name) {
			this.$viewportDisplay.text(name);
		}
	});
})(Tc.$);
{'fraction_non_alphanumeric': 0.2717607973421927, 'fraction_numerical': 0.0, 'mean_word_length': 1.6435469710272168, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4890460', 'n_tokens_mistral': 1019, 'n_tokens_neox': 805, 'n_words': 209}