2011-04-14 2 views
0

CKEditor에서 백 스페이스 키와 삭제 키는 어떻게 작동합니까? editable 영역에 iframe이 있고 그 옆에 커서가 있으면 backspace/delete를 누르면 iframe이 삭제되고 HTML 코드가 제거됩니다.CKEditor에서 어떻게 백 스페이스와 삭제가 작동합니까?

내가 얻을 수없는 것은이 동작에 대한 코드가 어디에 있습니까? 어디에서 백 스페이스를 치는지 범위가 iframe으로 축소되어 제거되었습니다.

소스 코드에서 올바른 방향으로 가리 키십시오.

+0

및 삭제에 대해하지 않습니다 제대로 작동합니다 ... – Gowri

+0

나도 알아 .. 내 질문은 어떻게 작동합니까, 거기에 대한 코드가 어디 있었는지. 나는 그것을 찾을 수 없었다. : – ghostCoder

답변

1

이 무엇인가에 대한

oKeystrokeHandler.SetKeystrokes

을 삭제하지만 난 그 행동

var FCKEnterKey = function(targetWindow, enterMode, shiftEnterMode, tabSpaces) 
{ 
    this.Window   = targetWindow ; 
    this.EnterMode  = enterMode || 'p' ; 
    this.ShiftEnterMode = shiftEnterMode || 'br' ; 

    // Setup the Keystroke Handler. 
    var oKeystrokeHandler = new FCKKeystrokeHandler(false) ; 
    oKeystrokeHandler._EnterKey = this ; 
    oKeystrokeHandler.OnKeystroke = FCKEnterKey_OnKeystroke ; 

    oKeystrokeHandler.SetKeystrokes([ 
     [ 13  , 'Enter' ], 
     [ SHIFT + 13, 'ShiftEnter' ], 
     [ 8   , 'Backspace' ], 
     [ CTRL + 8 , 'CtrlBackspace' ], 
     [ 46  , 'Delete' ] 
    ]) ; 

    this.TabText = '' ; 

    // Safari by default inserts 4 spaces on TAB, while others make the editor 
    // loose focus. So, we need to handle it here to not include those spaces. 
    if (tabSpaces > 0 || FCKBrowserInfo.IsSafari) 
    { 
     while (tabSpaces--) 
     this.TabText += '\xa0' ; 

     oKeystrokeHandler.SetKeystrokes([ 9, 'Tab' ]); 
    } 

    oKeystrokeHandler.AttachToElement(targetWindow.document) ; 
} 

http://code.google.com/p/easyfckeditor/source/browse/trunk/src/main/java/oh/how/easy/fck/js/fckeditor/editor/_source/classes/fckenterkey.js?r=2

CK 편집기 백 스페이스 여기
+0

나는 키를 입력하는 코드를 보았습니다 ... 해당 삭제 및 백 스페이스 코드는 찾을 수 없습니다. 키 스트로크 핸들러를 확인했는데, 몇 가지 특수 키 동작이 정의되어 있지만 백 스페이스 또는 삭제에 대해서는 아무 것도 없습니다. .. :( – ghostCoder

관련 문제