<commit_before>/*
 * @author Arnia <<EMAIL>>
 * @modifier XpressEngine <<EMAIL>>
 */
CKEDITOR.plugins.add('xe_component', {
	requires: 'menubutton',
	icons: 'xe_component',

	init: function(editor) {
		var config=editor.config;
		var items = {};

		editor.addMenuGroup('xe_component');

		var openSelectComponent = function() {
			window.editorPrevSrl = config.xe_editor_sequence;
			openComponent(this.name, config.xe_editor_sequence);
		};

		for(var key in config.xe_component_arrays) {
			var component_name = key;
			var component_title = config.xe_component_arrays[key];

			items[component_name] = {
				label: component_title,
				group: 'xe_component',
				icon : request_uri + 'modules/editor/components/' + component_name + '/component_icon.gif',
				onClick: openSelectComponent
			};
		}

		editor.addMenuItems( items );

		editor.ui.add('xe_component', CKEDITOR.UI_MENUBUTTON, {
			label: '추가 기능', // @TODO lang
			modes: {
				wysiwyg: 1
			},
			onMenu: function() {
				var active = {};

				for(var p in items)
				{
					active[p] = CKEDITOR.TRISTATE_OFF;
				}

				return active;
			}
		});

		editor.on( 'doubleclick', function( evt ) {
			var element = evt.data.element;
			var editor_component = element.getAttribute('editor_component');
			window.editorPrevNode = element.$;

			while(!editor_component && element) {
				editor_component = element.getAttribute('editor_component');
				if(editor_component) {
					window.editorPrevNode = element.$;
				} else {
					element = element.getParent();
				}
			}

			if(!editor_component && element && element.is('img')) {
				editor_component = 'image_link';
			}

			if(editor_component) {
				evt.cancel();
				window.openComponent(editor_component, config.xe_editor_sequence);
			}
		});
	}
});
<commit_msg>#1086 에디터 컴포넌트 더블클릭 시 이미지 타입을 처리하지 못하는 문제 수정<commit_after>/*
 * @author Arnia <<EMAIL>>
 * @modifier XpressEngine <<EMAIL>>
 */
CKEDITOR.plugins.add('xe_component', {
	requires: 'menubutton',
	icons: 'xe_component',

	init: function(editor) {
		var config=editor.config;
		var items = {};

		editor.addMenuGroup('xe_component');

		var openSelectComponent = function() {
			window.editorPrevSrl = config.xe_editor_sequence;
			openComponent(this.name, config.xe_editor_sequence);
		};

		for(var key in config.xe_component_arrays) {
			var component_name = key;
			var component_title = config.xe_component_arrays[key];

			items[component_name] = {
				label: component_title,
				group: 'xe_component',
				icon : request_uri + 'modules/editor/components/' + component_name + '/component_icon.gif',
				onClick: openSelectComponent
			};
		}

		editor.addMenuItems( items );

		editor.ui.add('xe_component', CKEDITOR.UI_MENUBUTTON, {
			label: '추가 기능', // @TODO lang
			modes: {
				wysiwyg: 1
			},
			onMenu: function() {
				var active = {};

				for(var p in items)
				{
					active[p] = CKEDITOR.TRISTATE_OFF;
				}

				return active;
			}
		});

		editor.on( 'doubleclick', function( evt ) {
			var element = evt.data.element;
			var editor_component = element.getAttribute('editor_component');
			window.editorPrevNode = element.$;

			while(!editor_component && element) {
				editor_component = element.getAttribute('editor_component');
				if(editor_component) {
					window.editorPrevNode = element.$;
				} else {
					element = element.getParent();
				}
			}

			if(!element) element = evt.data.element;
			if(!editor_component && element && element.is('img')) {
				editor_component = 'image_link';
			}

			if(editor_component) {
				evt.cancel();
				window.openComponent(editor_component, config.xe_editor_sequence);
			}
		});
	}
});

{'fraction_non_alphanumeric': 0.1374003847210772, 'fraction_numerical': 0.0016488046166529267, 'mean_word_length': 3.5728643216080402, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '4333101', 'n_tokens_mistral': 1486, 'n_tokens_neox': 1251, 'n_words': 219}