Changeset 1066
- Timestamp:
- 2007-11-04 13:30:20 (2 years ago)
- Location:
- FCKeditor/trunk/editor/_source
- Files:
-
- 3 modified
-
classes/fckevents.js (modified) (1 diff)
-
internals/fck_gecko.js (modified) (3 diffs)
-
internals/fck.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
FCKeditor/trunk/editor/_source/classes/fckevents.js
r409 r1066 35 35 this._RegisteredEvents[ eventName ] = [ functionPointer ] ; 36 36 else 37 aTargets.push( functionPointer ) ; 37 { 38 // Check that the event handler isn't already registered with the same listener 39 // It doesn't detect function pointers belonging to an object (at least in Gecko) 40 if ( aTargets.IndexOf( functionPointer ) == -1 ) 41 aTargets.push( functionPointer ) ; 42 } 38 43 } 39 44 -
FCKeditor/trunk/editor/_source/internals/fck_gecko.js
r925 r1066 197 197 } 198 198 199 this._FillEmptyBlock = function( emptyBlockNode )200 {201 if ( ! emptyBlockNode || emptyBlockNode.nodeType != 1 )202 return ;203 var nodeTag = emptyBlockNode.tagName.toLowerCase() ;204 if ( nodeTag != 'p' && nodeTag != 'div' )205 return ;206 if ( emptyBlockNode.firstChild )207 return ;208 FCKTools.AppendBogusBr( emptyBlockNode ) ;209 }210 211 this._ExecCheckEmptyBlock = function()212 {213 FCK._FillEmptyBlock( FCK.EditorDocument.body.firstChild ) ;214 var sel = FCK.EditorWindow.getSelection() ;215 if ( !sel || sel.rangeCount < 1 )216 return ;217 var range = sel.getRangeAt( 0 );218 FCK._FillEmptyBlock( range.startContainer ) ;219 }220 221 199 this.ExecOnSelectionChangeTimer = function() 222 200 { … … 286 264 this.EditorDocument.addEventListener( 'click', this._ExecCheckCaret, false ) ; 287 265 } 288 if ( FCKBrowserInfo.IsGecko )289 this.AttachToOnSelectionChange( this._ExecCheckEmptyBlock ) ;290 266 291 267 // Reset the context menu. … … 457 433 return aCreatedLinks ; 458 434 } 435 436 FCK._FillEmptyBlock = function( emptyBlockNode ) 437 { 438 if ( ! emptyBlockNode || emptyBlockNode.nodeType != 1 ) 439 return ; 440 var nodeTag = emptyBlockNode.tagName.toLowerCase() ; 441 if ( nodeTag != 'p' && nodeTag != 'div' ) 442 return ; 443 if ( emptyBlockNode.firstChild ) 444 return ; 445 FCKTools.AppendBogusBr( emptyBlockNode ) ; 446 } 447 448 FCK._ExecCheckEmptyBlock = function() 449 { 450 FCK._FillEmptyBlock( FCK.EditorDocument.body.firstChild ) ; 451 var sel = FCK.EditorWindow.getSelection() ; 452 if ( !sel || sel.rangeCount < 1 ) 453 return ; 454 var range = sel.getRangeAt( 0 ); 455 FCK._FillEmptyBlock( range.startContainer ) ; 456 } -
FCKeditor/trunk/editor/_source/internals/fck.js
r1062 r1066 105 105 // Tab key handling for source mode. 106 106 FCKTools.AddEventListener( document, "keydown", this._TabKeyHandler ) ; 107 108 // Add selection change listeners. They must be attached only once. 109 this.AttachToOnSelectionChange( _FCK_PaddingNodeListener ) ; 110 if ( FCKBrowserInfo.IsGecko ) 111 this.AttachToOnSelectionChange( this._ExecCheckEmptyBlock ) ; 112 107 113 }, 108 114 … … 811 817 812 818 FCK.InitializeBehaviors() ; 813 FCK.AttachToOnSelectionChange( _FCK_PaddingNodeListener ) ;814 819 815 820 // Listen for mousedown and mouseup events for tracking drag and drops.