<commit_before><?php $this->inlineScript()->captureStart(); ?>
$(function() {
	
	$(document).bind('edit-page-content', function(event, obj) {
		var oBody = obj.contents().find("body");
		$(document).data('edit-frame-content', oBody);
		
		/* Stop links working. */
		$('a', oBody).click(function(e) {
			e.preventDefault();
		});
		
		/* Unbind potential events in elements inside .aitsu_editable elements. */
		$('.aitsu_editable', oBody).find().unbind();
		
		/* Unbind previosly made bindings. */
		$('.aitsu_editable', oBody).unbind();
		$('.show-on-demand', oBody).unbind();
		$(document).unbind('edit-save');
		$(document).unbind('toogle-sub-templates');
		
		/* Hover and edit binding normal .aitsu_editables (except on-domand). */
		$('.aitsu_editable:not(.on-demand)', oBody).bind('mouseenter', function (e){
			e.stopPropagation();
			$('.aitsu_editable', oBody).css({
				'background': 'none',
				'border': 'none',
				'margin': '0',
				'cursor': 'auto'
			});
			$(this).css({
				'background-color': '#ec7537',
				'border': '5px solid #ec7537',
				'margin': '-5px',
				'cursor': 'pointer'
			});
			$('.aitsu_editable', oBody).unbind('click');
			$(this).bind('click', function(e) {
				$(this).triggerHandler('doEdit');
			});
		});
		$('.aitsu_editable:not(.on-demand)', oBody).bind('mouseleave', function (e){
			$(this).css({
				'background': 'none',
				'border': 'none',
				'margin': '0'
			});
			$(this).unbind('click');
			$(this).parents('.aitsu_editable').first().trigger('mouseenter');
		});
		
		$('.aitsu_editable.on-demand .show-on-demand', oBody).bind('mouseenter', function() {
			$('.aitsu_editable', oBody).css({
				'background': 'none',
				'cursor': 'auto'
			});
			$('.aitsu_editable', oBody).unbind('click');
			$(this).bind('click', function(e) {
				$(this).parents('.aitsu_editable').triggerHandler('doEdit'); 
			});
		});
		$('.aitsu_editable.on-demand .show-on-demand', oBody).bind('mouseleave', function() {
			$(this).unbind('click');
			$(this).parents('.aitsu_editable').first().next().trigger('mouseenter');
		});
		
		$(document).bind('toogle-sub-templates', function() {
			if ($(document).data('show-sub-templates') == '1') {
				$('.show-on-demand', oBody).css({
					'display': 'none',
					'border': 'none',
					'padding': '0'
				});
				$(document).data('show-sub-templates', '0');
			} else {
				$('.show-on-demand', oBody).css({
					'display': 'block',
					'border': '1px dotted black',
					'padding': '5px'
				});
				$(document).data('show-sub-templates', '1');
			}
		});
		
		/* Edit handler. */
		$('.aitsu_editable', oBody).bind('doEdit', function(e) {
			$('form#aitsu-content-edit-form').remove();
			$('#box-edit-save').css('visibility', 'hidden');
			$('div.shortcode').removeClass('focused');
			
			/(.*?)\-(.*?)\-(\d*)$/.exec($(this).attr('id'));
	  		var type = RegExp.$1;
	  		var container = RegExp.$2;
	  		var idartlang = RegExp.$3;
	  		var params = '';
	  		if ($(this).find('code.aitsu_params').length > 0) {
	  			params = $(this).find('code.aitsu_params').first().html();
	  		}
			$.post("<?php echo $this->url(array('plugin' => 'edit', 'paction' => 'editcontent'), 'aplugin'); ?>", { type: type, container: container, idartlang: idartlang, params: params },
	  			function(data){
	  				var width = Math.min($(window).width() - 120, 850)
	  				var height = Math.min($(window).height() - 120, 1000);
					$("<div></div>")
						.html(data)
						.dialog({
							title: 'Container #' + container,
							bgiframe: true,
							autoOpen: true,
							modal: true,
							width: width,
							height: height,
							buttons: {
								'<?php echo $this->translate('Save'); ?>': function() {
									$(document).trigger('edit-save', [type, container, idartlang]);
									$(this).dialog('close');
									$(this).remove();
								},
								'<?php echo $this->translate('Cancel'); ?>': function() {
									$(this).dialog('close');
									$(this).remove();
								}
							},
							'open': function(event, ui) {
							var buttons = $(event.target).parent().find('.ui-dialog-buttonset').children();

							buttons.removeClass('ui-button-text-only').addClass('ui-button-icon-only');

							$(buttons[0]).append("<span class='ui-icon ui-icon-circle-close'></span>").addClass('deny');
							$(buttons[1]).append("<span class='ui-icon ui-icon-circle-check'></span>").addClass('confirm');
							$(buttons[0]).css('position','absolute').css('left','15px');
							},
							close: function(event, ui) {
								$(this).remove();
							}
						});
					$('#tabs').css('height', (height - 130) + 'px');
					<?php if (isset(Aitsu_Registry :: get()->config->edit->ckeditor->type)) : ?>
						<?php echo $this->partial('data/ckeditor/' . Aitsu_Registry :: get()->config->edit->ckeditor->type . '.phtml'); ?>
					<?php else : ?>
						<?php echo $this->partial('data/ckeditor/normal.phtml'); ?>
					<?php endif; ?>
					$('.jquery_ckeditor').ckeditor({
					  skin : 'office2003',
					  toolbar : 'normal',<commit_msg>File: application/plugins/article/edit/views/meta.phtml Line 113 - 121: Change button order<commit_after><?php $this->inlineScript()->captureStart(); ?>
$(function() {
	
	$(document).bind('edit-page-content', function(event, obj) {
		var oBody = obj.contents().find("body");
		$(document).data('edit-frame-content', oBody);
		
		/* Stop links working. */
		$('a', oBody).click(function(e) {
			e.preventDefault();
		});
		
		/* Unbind potential events in elements inside .aitsu_editable elements. */
		$('.aitsu_editable', oBody).find().unbind();
		
		/* Unbind previosly made bindings. */
		$('.aitsu_editable', oBody).unbind();
		$('.show-on-demand', oBody).unbind();
		$(document).unbind('edit-save');
		$(document).unbind('toogle-sub-templates');
		
		/* Hover and edit binding normal .aitsu_editables (except on-domand). */
		$('.aitsu_editable:not(.on-demand)', oBody).bind('mouseenter', function (e){
			e.stopPropagation();
			$('.aitsu_editable', oBody).css({
				'background': 'none',
				'border': 'none',
				'margin': '0',
				'cursor': 'auto'
			});
			$(this).css({
				'background-color': '#ec7537',
				'border': '5px solid #ec7537',
				'margin': '-5px',
				'cursor': 'pointer'
			});
			$('.aitsu_editable', oBody).unbind('click');
			$(this).bind('click', function(e) {
				$(this).triggerHandler('doEdit');
			});
		});
		$('.aitsu_editable:not(.on-demand)', oBody).bind('mouseleave', function (e){
			$(this).css({
				'background': 'none',
				'border': 'none',
				'margin': '0'
			});
			$(this).unbind('click');
			$(this).parents('.aitsu_editable').first().trigger('mouseenter');
		});
		
		$('.aitsu_editable.on-demand .show-on-demand', oBody).bind('mouseenter', function() {
			$('.aitsu_editable', oBody).css({
				'background': 'none',
				'cursor': 'auto'
			});
			$('.aitsu_editable', oBody).unbind('click');
			$(this).bind('click', function(e) {
				$(this).parents('.aitsu_editable').triggerHandler('doEdit'); 
			});
		});
		$('.aitsu_editable.on-demand .show-on-demand', oBody).bind('mouseleave', function() {
			$(this).unbind('click');
			$(this).parents('.aitsu_editable').first().next().trigger('mouseenter');
		});
		
		$(document).bind('toogle-sub-templates', function() {
			if ($(document).data('show-sub-templates') == '1') {
				$('.show-on-demand', oBody).css({
					'display': 'none',
					'border': 'none',
					'padding': '0'
				});
				$(document).data('show-sub-templates', '0');
			} else {
				$('.show-on-demand', oBody).css({
					'display': 'block',
					'border': '1px dotted black',
					'padding': '5px'
				});
				$(document).data('show-sub-templates', '1');
			}
		});
		
		/* Edit handler. */
		$('.aitsu_editable', oBody).bind('doEdit', function(e) {
			$('form#aitsu-content-edit-form').remove();
			$('#box-edit-save').css('visibility', 'hidden');
			$('div.shortcode').removeClass('focused');
			
			/(.*?)\-(.*?)\-(\d*)$/.exec($(this).attr('id'));
	  		var type = RegExp.$1;
	  		var container = RegExp.$2;
	  		var idartlang = RegExp.$3;
	  		var params = '';
	  		if ($(this).find('code.aitsu_params').length > 0) {
	  			params = $(this).find('code.aitsu_params').first().html();
	  		}
			$.post("<?php echo $this->url(array('plugin' => 'edit', 'paction' => 'editcontent'), 'aplugin'); ?>", { type: type, container: container, idartlang: idartlang, params: params },
	  			function(data){
	  				var width = Math.min($(window).width() - 120, 850)
	  				var height = Math.min($(window).height() - 120, 1000);
					$("<div></div>")
						.html(data)
						.dialog({
							title: 'Container #' + container,
							bgiframe: true,
							autoOpen: true,
							modal: true,
							width: width,
							height: height,
							buttons: {
								'<?php echo $this->translate('Cancel'); ?>': function() {
									$(this).dialog('close');
									$(this).remove();
								},
								'<?php echo $this->translate('Save'); ?>': function() {
									$(document).trigger('edit-save', [type, container, idartlang]);
									$(this).dialog('close');
									$(this).remove();
								}
							},
							'open': function(event, ui) {
							var buttons = $(event.target).parent().find('.ui-dialog-buttonset').children();

							buttons.removeClass('ui-button-text-only').addClass('ui-button-icon-only');

							$(buttons[0]).append("<span class='ui-icon ui-icon-circle-close'></span>").addClass('deny');
							$(buttons[1]).append("<span class='ui-icon ui-icon-circle-check'></span>").addClass('confirm');
							$(buttons[0]).css('position','absolute').css('left','15px');
							},
							close: function(event, ui) {
								$(this).remove();
							}
						});
					$('#tabs').css('height', (height - 130) + 'px');
					<?php if (isset(Aitsu_Registry :: get()->config->edit->ckeditor->type)) : ?>
						<?php echo $this->partial('data/ckeditor/' . Aitsu_Registry :: get()->config->edit->ckeditor->type . '.phtml'); ?>
					<?php else : ?>
						<?php echo $this->partial('data/ckeditor/normal.phtml'); ?>
					<?php endif; ?>
					$('.jquery_ckeditor').ckeditor({
					  skin : 'office2003',
					  toolbar : 'normal',
{'fraction_non_alphanumeric': 0.24431481115285741, 'fraction_numerical': 0.009887284951552304, 'mean_word_length': 3.2251461988304095, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 69, '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': '7652975', 'n_tokens_mistral': 4340, 'n_tokens_neox': 3363, 'n_words': 540}