mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
Fix CKEditor Korean line break issue in iOS #932
- iOS에서는 divarea 플러그인과 @largeden 님의 ios_enterkey 플러그인을 사용 - iOS에서는 divarea 플러그인과 호환되지 않는 에디터 컴포넌트를 로딩하지 않음 - 추후 호환성 문제가 해결되면 다시 사용하도록 변경할 수 있음 - 기본 폰트 등의 스타일이 cke_wysiwyg_div 클래스에도 적용되도록 조치함
This commit is contained in:
parent
73a46bbac5
commit
ddb2a8afa1
3 changed files with 67 additions and 1 deletions
|
|
@ -0,0 +1,38 @@
|
|||
/**
|
||||
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
|
||||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||
*/
|
||||
|
||||
/**
|
||||
* @fileOverview The "divarea" plugin. It registers the "wysiwyg" editing
|
||||
* mode using a DIV element.
|
||||
*/
|
||||
|
||||
CKEDITOR.plugins.add( 'divarea', {
|
||||
afterInit: function( editor ) {
|
||||
// Add the "wysiwyg" mode.
|
||||
// Do that in the afterInit function, so it'll eventually overwrite
|
||||
// the mode defined by the wysiwygarea plugin.
|
||||
editor.addMode( 'wysiwyg', function( callback ) {
|
||||
var editingBlock = CKEDITOR.dom.element.createFromHtml(
|
||||
'<div class="cke_wysiwyg_div cke_reset cke_enable_context_menu" hidefocus="true"></div>'
|
||||
);
|
||||
|
||||
var contentSpace = editor.ui.space( 'contents' );
|
||||
contentSpace.append( editingBlock );
|
||||
|
||||
editingBlock = editor.editable( editingBlock );
|
||||
|
||||
editingBlock.detach = CKEDITOR.tools.override( editingBlock.detach,
|
||||
function( org ) {
|
||||
return function() {
|
||||
org.apply( this, arguments );
|
||||
this.remove();
|
||||
};
|
||||
} );
|
||||
|
||||
editor.setData( editor.getData( 1 ), callback );
|
||||
editor.fire( 'contentDom' );
|
||||
} );
|
||||
}
|
||||
} );
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
/**
|
||||
* iOS enter key fix for IME
|
||||
*
|
||||
* https://github.com/rhymix/rhymix/issues/932
|
||||
*/
|
||||
CKEDITOR.plugins.add( 'ios_enterkey',
|
||||
{
|
||||
icons: 'ios_enterkey',
|
||||
init: function(editor)
|
||||
{
|
||||
editor.on('contentDom', function()
|
||||
{
|
||||
var editable = editor.editable();
|
||||
editable.attachListener(editable, 'keyup', function(e)
|
||||
{
|
||||
if(e.data.getKey() === 13)
|
||||
{
|
||||
$(editor.document.$).find('.cke_wysiwyg_div').blur();
|
||||
$(editor.document.$).find('.cke_wysiwyg_div').focus();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue