mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-02 16:52:16 +09:00
#1087 ckeditor 정리
- xeEditor plugin 제거 및 app로 변경 - ckeditor config를 app 파일로 이동 - 툴바 접기 설정이 잘못 반영된 문제 수정
This commit is contained in:
parent
a6c15ffb0e
commit
e1c6be4bf3
7 changed files with 109 additions and 119 deletions
Binary file not shown.
|
Before Width: | Height: | Size: 3.5 KiB |
|
|
@ -1,2 +1 @@
|
|||
ckeditor/ckeditor.js
|
||||
xeEditor.plugin.js
|
||||
|
|
|
|||
|
|
@ -1,76 +0,0 @@
|
|||
(function($){
|
||||
"use strict";
|
||||
var App = window.xe.getApp('xeEditorApp')[0];
|
||||
var CK = window.CKEDITOR;
|
||||
|
||||
var xeCKEditor = App.createPlugin("CKEditor", {
|
||||
instance_prefix : 'ckeditor_instance_',
|
||||
|
||||
init : function() {
|
||||
var self = this;
|
||||
CKEDITOR.on('instanceCreated', function(evt){
|
||||
self.cast('CKEDITOR_CREATED');
|
||||
});
|
||||
|
||||
CKEDITOR.on('ready', function(evt){
|
||||
self.cast('CKEDITOR_READY');
|
||||
});
|
||||
|
||||
CKEDITOR.on('instanceReady', function(evt){
|
||||
self.cast('CKEDITOR_INSTANCE_READY');
|
||||
});
|
||||
|
||||
CKEDITOR.on('instanceLoaded', function(evt){
|
||||
self.cast('CKEDITOR_LOADED');
|
||||
});
|
||||
},
|
||||
editorInit : function(sequence, obj) {
|
||||
var self = this;
|
||||
var $editor_area = jQuery("#ckeditor_instance_"+sequence);
|
||||
var $form = $editor_area.closest('form');
|
||||
var $contentField = $('input[name=' + obj.content_key + ']');
|
||||
var ckconfig = obj.ckconfig || {};
|
||||
ckconfig.xe_editor_sequence = sequence;
|
||||
|
||||
$form.attr('editor_sequence', sequence);
|
||||
|
||||
var insance = CKEDITOR.appendTo(this.instance_prefix + sequence, ckconfig, obj.content);
|
||||
$editor_area.data('cke_instance', insance);
|
||||
|
||||
insance.on('change', function(e){
|
||||
if($contentField.length){
|
||||
$contentField.val(e.editor.getData());
|
||||
}
|
||||
});
|
||||
this.sequence = sequence;
|
||||
window.editorRelKeys[sequence] = {};
|
||||
window.editorRelKeys[sequence].primary = $form.find('[name='+obj.primary_key+']')[0];
|
||||
window.editorRelKeys[sequence].content = $form.find('[name='+obj.content_key+']')[0];
|
||||
window.editorRelKeys[sequence].func = function(seq) {
|
||||
return self.getContent.call(self, seq);
|
||||
};
|
||||
window.editorRelKeys[sequence].pasteHTML = function(text){
|
||||
insance.insertHtml(text, 'html');
|
||||
};
|
||||
},
|
||||
getContent : function(seq) {
|
||||
var self = this;
|
||||
var content = _getCkeInstance(seq).getData();
|
||||
self.cast('GET_CONTENT', [content]);
|
||||
|
||||
return content;
|
||||
},
|
||||
API_ONREADY : function() {
|
||||
},
|
||||
API_GET_CONTENT: function() {
|
||||
},
|
||||
getInstance : function(name) {
|
||||
return CKEDITOR.instances[name];
|
||||
},
|
||||
autosave: function(seq) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
App.registerPlugin(new xeCKEditor());
|
||||
})(jQuery);
|
||||
Loading…
Add table
Add a link
Reference in a new issue