CKEditor 中的退格键和删除键是如何工作的?

发布于 2024-11-01 04:50:02 字数 181 浏览 1 评论 0原文

CKEditor 中的退格键和删除键如何工作?如果我的可编辑区域中有一个 iframe,并且将光标放在它旁边,则按退格键/删除键会删除 iframe/从那里删除其 HTML 代码。

我无法得到的是这种行为的代码在哪里?当按下退格键时,范围会缩小到 iframe 并被删除。

请指出我在源代码中发生这种情况的正确方向。

How do the backspace and delete keys work in CKEditor? If I have an iframe in the editable area, and have my cursor next to it, hitting backspace/delete deletes the iframe/removes its HTML code from there.

What I was unable to get was where is the code for this behavior? Where on hitting backspace the range is shrunken to the iframe and it was removed.

Please point me in the right direction of where this happens in the source code.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦醒时光 2024-11-08 04:50:02

有一些关于删除的事情

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/哦/how/easy/fck/js/fckeditor/editor/_source/classes/fckenterkey.js?r=2

There is something about delete

oKeystrokeHandler.SetKeystrokes

But i don't about that behavior

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文