Ticket #2247: 2247_3.patch
File 2247_3.patch, 5.2 KB (added by , 16 years ago) |
---|
-
_whatsnew.html
46 46 ability to create, modify and remove Div containers.</li> 47 47 <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2252">#2252</a>] It's now possible to enable the 48 48 browsers default menu using the configuration file (FCKConfig.BrowserContextMenu option).</li> 49 <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2247">#2247</a>] The SHIFT+SPACE 50 keystroke will now produce a &nbsp; character.</li> 49 51 </ul> 50 52 <p> 51 53 Fixed Bugs:</p> -
editor/_source/commandclasses/fck_othercommands.js
613 613 range.Select() ; 614 614 } 615 615 } ; 616 617 // FCKRuleCommand 618 var FCKNbsp = function() 619 { 620 this.Name = 'Non Breaking Space' ; 621 } 622 623 FCKNbsp.prototype = 624 { 625 Execute : function() 626 { 627 FCK.InsertHtml( ' ' ) ; 628 }, 629 630 GetState : function() 631 { 632 return ( FCK.EditMode != FCK_EDITMODE_WYSIWYG ? FCK_TRISTATE_DISABLED : FCK_TRISTATE_OFF ) ; 633 } 634 } ; -
editor/_source/internals/fck_gecko.js
359 359 // Save an undo snapshot first. 360 360 FCKUndo.SaveUndoStep() ; 361 361 362 if ( FCKBrowserInfo.IsGecko ) 362 var fakeNodes = false ; 363 var prevCharNodeValue ; 364 if ( FCKBrowserInfo.IsGecko && /^(?: | )+$/.test( html ) ) 363 365 { 366 // Get the previous character's text node value, if any. 367 var selection = FCK.EditorWindow.getSelection() ; 368 var range = selection && selection.rangeCount > 0 && selection.getRangeAt( 0 ) ; 369 var startNode, prevCharNode ; 370 if ( range ) 371 { 372 if ( range.startContainer.nodeType == 1 ) 373 startNode = range.startContainer.childNodes[ range.startOffset ] ; 374 else if ( range.startContainer.nodeType == 3 ) 375 startNode = range.startContainer ; 376 } 377 if ( startNode ) 378 { 379 if ( range.startContainer.nodeType == 1 ) 380 { 381 var node = startNode.previousSibling ; 382 while ( node && node.nodeType == 3 && node.length < 1 ) 383 node = node.previousSibling ; 384 if ( node && node.nodeType == 3 ) 385 prevCharNode = node ; 386 } 387 else 388 prevCharNode = startNode ; 389 } 390 if ( prevCharNode ) 391 { 392 prevCharNodeValue = prevCharNode.nodeValue ; 393 if ( range.startContainer.nodeType == 3 ) 394 prevCharNodeValue = prevCharNodeValue.substr( 0, range.startOffset ) ; 395 } 396 364 397 // Using the following trick, present at the beginning and at 365 398 // the end of the HTML are preserved (#2248). 366 399 html = '<span id="__fakeFCKRemove1__" style="display:none;">fakeFCKRemove</span>' + html + '<span id="__fakeFCKRemove2__" style="display:none;">fakeFCKRemove</span>' ; 400 fakeNodes = true ; 367 401 } 368 402 369 403 // Insert the HTML code. 370 404 doc.execCommand( 'inserthtml', false, html ) ; 371 405 372 if ( FCKBrowserInfo.IsGecko)406 if ( fakeNodes ) 373 407 { 408 // Retrieve the text node before the newly inserted text node. 409 // Note that this is a different node to the prevCharNode earlier. 410 var firstNode = doc.getElementById( '__fakeFCKRemove1__' ) ; 411 var textNode = firstNode.previousSibling ; 412 374 413 // Remove the fake nodes. 375 FCKDomTools.RemoveNode( doc.getElementById('__fakeFCKRemove1__')) ;414 FCKDomTools.RemoveNode( firstNode ) ; 376 415 FCKDomTools.RemoveNode( doc.getElementById('__fakeFCKRemove2__') ) ; 416 417 // Restore the previous character's text node value, if any. 418 if ( prevCharNodeValue && textNode && textNode.nodeType == 3 ) 419 textNode.nodeValue = prevCharNodeValue ; 377 420 } 378 421 379 422 this.Focus() ; -
editor/_source/internals/fckcommands.js
80 80 case 'NewPage' : oCommand = new FCKNewPageCommand() ; break ; 81 81 case 'PageBreak' : oCommand = new FCKPageBreakCommand() ; break ; 82 82 case 'Rule' : oCommand = new FCKRuleCommand() ; break ; 83 case 'Nbsp' : oCommand = new FCKNbsp() ; break ; 83 84 84 85 case 'TextColor' : oCommand = new FCKTextColorCommand('ForeColor') ; break ; 85 86 case 'BGColor' : oCommand = new FCKTextColorCommand('BackColor') ; break ; -
fckconfig.js
142 142 [ CTRL + 73 /*I*/, 'Italic' ], 143 143 [ CTRL + 85 /*U*/, 'Underline' ], 144 144 [ CTRL + SHIFT + 83 /*S*/, 'Save' ], 145 [ CTRL + ALT + 13 /*ENTER*/, 'FitWindow' ] 145 [ CTRL + ALT + 13 /*ENTER*/, 'FitWindow' ], 146 [ SHIFT + 32 /*SPACE*/, 'Nbsp' ] 146 147 ] ; 147 148 148 149 FCKConfig.ContextMenu = ['Generic','Link','Anchor','Image','Flash','Select','Textarea','Checkbox','Radio','TextField','HiddenField','ImageButton','Button','BulletedList','NumberedList','Table','Form','DivContainer'] ;