<commit_before>(function ($) {

	var app = angular.module('RbsChange');

	/**
	 * @name activateSwitch
	 *
	 * @example: <code><rbs-switch confirm-off="Are you sure to disable this element?" document="myDocument"/></code>
	 */
	app.directive('rbsActivateSwitch', ['$q', 'RbsChange.Dialog', 'RbsChange.Actions', 'RbsChange.i18n', function ($q, Dialog, Actions, i18n) {
		return {
			restrict : 'E',

			template : '<div class="switch-on-off switch" ng-class="{\'busy\':busy}">' +
				'<div class="switch-button"></div>' +
				'<label class="on" ng-bind-html="labelOn"></label>' +
				'<label class="off" ng-bind-html="labelOff"></label>' +
				'</div>',

			replace : true,

			// Create isolated scope
			scope : {
				document : '='
			},

			link : function (scope, elm, attrs) {
				var sw = $(elm);
				scope.labelOn = attrs.labelOn || i18n.trans('m.rbs.admin.adminjs.yes');
				scope.labelOff = attrs.labelOff || i18n.trans('m.rbs.admin.adminjs.no');

				scope.$watch('document', function (doc) {
					if (doc) {
						if (isON()) {
							sw.addClass('on');
							sw.removeClass('off');
						} else {
							sw.addClass('off');
							sw.removeClass('on');
						}
					}
				}, true);

				function isON () {
					return scope.document.active === true;
				}

				function isOFF () {
					return ! isON();
				}

				function toggleState () {<commit_msg>Fix rbs-media-visuals responsive rendering.<commit_after>(function ($) {

	var app = angular.module('RbsChange');

	/**
	 * @name activateSwitch
	 *
	 * @example: <code><rbs-switch confirm-off="Are you sure to disable this element?" document="myDocument"/></code>
	 */
	app.directive('rbsActivateSwitch', ['$q', 'RbsChange.Dialog', 'RbsChange.Actions', 'RbsChange.i18n', function ($q, Dialog, Actions, i18n) {
		return {
			restrict : 'E',

			template : '<div class="switch-on-off switch" ng-class="{\'busy\':busy}">' +
				'<div class="switch-button"></div>' +
				'<label class="on" ng-bind-html="labelOn"></label>' +
				'<label class="off" ng-bind-html="labelOff"></label>' +
				'</div>',

			replace : true,

			// Create isolated scope.
			scope : {
				document : '='
			},

			link : function (scope, elm, attrs) {
				var sw = $(elm);
				scope.labelOn = attrs.labelOn || i18n.trans('m.rbs.admin.adminjs.yes');
				scope.labelOff = attrs.labelOff || i18n.trans('m.rbs.admin.adminjs.no');

				scope.$watch('document', function (doc) {
					if (doc) {
						if (isON()) {
							sw.addClass('on');
							sw.removeClass('off');
						} else {
							sw.addClass('off');
							sw.removeClass('on');
						}
					}
				}, true);

				function isON () {
					return scope.document.active === true;
				}

				function isOFF () {
					return ! isON();
				}

				function toggleState () {
{'fraction_non_alphanumeric': 0.19862268938021022, 'fraction_numerical': 0.005799202609641174, 'mean_word_length': 2.865546218487395, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '7391431', 'n_tokens_mistral': 1194, 'n_tokens_neox': 936, 'n_words': 179}