Warning: Use of undefined constant Symbol - assumed 'Symbol' (this will throw an Error in a future version of PHP) in /mnt/new-ebs/workbench-106550/lib/dojo/util/docscripts/lib/parser2/dojo2.inc on line 215 Warning: Use of undefined constant JavaScriptSymbol - assumed 'JavaScriptSymbol' (this will throw an Error in a future version of PHP) in /mnt/new-ebs/workbench-106550/lib/dojo/util/docscripts/lib/parser2/dojo2.inc on line 215

dijit/_editor/plugins/EnterKeyHandling.js

  • Provides:

    • dijit._editor.plugins.EnterKeyHandling
  • Requires:

    • dojo.window in common
    • dijit._editor._Plugin in common
    • dijit._editor.range in common
  • dijit._editor.plugins.EnterKeyHandling

    • type
      Function
    • chains:
      • dijit._editor._Plugin: (prototype)
      • dijit._editor._Plugin: (call)
    • parameters:
      • args
    • summary
      This plugin tries to make all browsers behave consistently with regard to
      how ENTER behaves in the editor window.  It traps the ENTER key and alters
      the way DOM is constructed in certain cases to try to commonize the generated
      DOM and behaviors across browsers.
    • description
      This plugin has three modes:
      
      * blockModeForEnter=BR
      * blockModeForEnter=DIV
      * blockModeForEnter=P
      
      In blockModeForEnter=P, the ENTER key starts a new
      paragraph, and shift-ENTER starts a new line in the current paragraph.
      For example, the input:
      
      	first paragraph <shift-ENTER>
      	second line of first paragraph <ENTER>
      	second paragraph
      
      will generate:
      
      	<p>
      		first paragraph
      		<br/>
      		second line of first paragraph
      	</p>
      	<p>
      		second paragraph
      	</p>
      
      In BR and DIV mode, the ENTER key conceptually goes to a new line in the
      current paragraph, and users conceptually create a new paragraph by pressing ENTER twice.
      For example, if the user enters text into an editor like this:
      
      		one <ENTER>
      		two <ENTER>
      		three <ENTER>
      		<ENTER>
      		four <ENTER>
      		five <ENTER>
      		six <ENTER>
      
      It will appear on the screen as two 'paragraphs' of three lines each.  Markupwise, this generates:
      
      BR:
      		one<br/>
      		two<br/>
      		three<br/>
      		<br/>
      		four<br/>
      		five<br/>
      		six<br/>
      
      DIV:
      		<div>one</div>
      		<div>two</div>
      		<div>three</div>
      		<div>&nbsp;</div>
      		<div>four</div>
      		<div>five</div>
      		<div>six</div>
  • dijit._editor.plugins.EnterKeyHandling.blockNodeForEnter

    • type
      String
    • summary
      This property decides the behavior of Enter key. It can be either P,
      DIV, BR, or empty (which means disable this feature). Anything else
      will trigger errors.  The default is 'BR'
      
      See class description for more details.
  • dijit._editor.plugins.EnterKeyHandling.constructor

    • constructor - constructor
    • type
      Function
    • parameters:
      • args
  • dijit._editor.plugins.EnterKeyHandling.setEditor

    • parameters:
      • editor
    • type
      Function
  • dijit._editor.plugins.EnterKeyHandling.editor

  • dijit._editor.plugins.EnterKeyHandling.editor.customUndo

    • type
      Object
  • dijit._editor.plugins.EnterKeyHandling.onKeyPressed

    • parameters:
      • e
    • summary
      Handler for keypress events.
    • tags:
    • type
      Function
  • dijit._editor.plugins.EnterKeyHandling._checkListLater

    • type
      bool
  • dijit._editor.plugins.EnterKeyHandling.bogusHtmlContent

    • tags:
    • type
      String
    • summary
      HTML to stick into a new empty block
  • dijit._editor.plugins.EnterKeyHandling.blockNodes

    • tags:
    • type
      Regex
    • summary
      Regex for testing if a given tag is a block level (display:block) tag
  • dijit._editor.plugins.EnterKeyHandling.handleEnterKey

    • parameters:
      • e
    • returns
      let browser handle
    • summary
      Handler for enter key events when blockModeForEnter is DIV or P.
    • description
      Manually handle enter key event to make the behavior consistent across
      all supported browsers. See class description for details.
    • tags:
    • type
      Function
  • dijit._editor.plugins.EnterKeyHandling.editor.document

  • dijit._editor.plugins.EnterKeyHandling._pressedEnterInBlock

  • dijit._editor.plugins.EnterKeyHandling._adjustNodeAndOffset

    • parameters:
      • node: (typeof DomNode)
        The node to check.
      • offset: (typeof Int)
        The position to find within the text node
    • summary
      In the case there are multiple text nodes in a row the offset may not be within the node.  If the offset is larger than the node length, it will attempt to find
      the next text sibling until it locates the text node in which the offset refers to
    • tags: private.
    • type
      Function
  • dijit._editor.plugins.EnterKeyHandling.removeTrailingBr

    • parameters:
      • container
    • summary
      If last child of container is a &lt;br&gt;, then remove it.
    • tags:
    • type
      Function
  • dijit._editor.plugins

    • type
      Object
  • dijit._editor

    • type
      Object
  • dijit

    • type
      Object