Changeset 774
- Timestamp:
- 2007-09-04 16:34:12 (3 years ago)
- Location:
- FCKeditor/trunk
- Files:
-
- 12 added
- 4 removed
- 35 modified
-
editor/css/fck_editorarea.css (modified) (1 diff)
-
editor/dtd (added)
-
editor/dtd/fck_dtd_test.html (added)
-
editor/dtd/fck_xhtml10strict.js (added)
-
editor/dtd/fck_xhtml10transitional.js (added)
-
editor/fckeditor.html (modified) (6 diffs)
-
editor/_source/classes/fckdomrange_gecko.js (modified) (1 diff)
-
editor/_source/classes/fckdomrange_ie.js (modified) (2 diffs)
-
editor/_source/classes/fckdomrange.js (modified) (12 diffs)
-
editor/_source/classes/fckspecialcombo.js (modified) (3 diffs)
-
editor/_source/classes/fckstyledef_gecko.js (deleted)
-
editor/_source/classes/fckstyledef_ie.js (deleted)
-
editor/_source/classes/fckstyledef.js (deleted)
-
editor/_source/classes/fckstyle.js (added)
-
editor/_source/classes/fckstylesloader.js (deleted)
-
editor/_source/classes/fcktoolbarfontformatcombo.js (modified) (4 diffs)
-
editor/_source/classes/fcktoolbarfontscombo.js (modified) (2 diffs)
-
editor/_source/classes/fcktoolbarfontsizecombo.js (modified) (2 diffs)
-
editor/_source/classes/fcktoolbarstylecombo.js (modified) (3 diffs)
-
editor/_source/classes/fckw3crange.js (modified) (1 diff)
-
editor/_source/classes/fckxml_gecko.js (modified) (1 diff)
-
editor/_source/classes/fckxml_ie.js (modified) (1 diff)
-
editor/_source/commandclasses/fckcorestylecommand.js (added)
-
editor/_source/commandclasses/fck_othercommands.js (modified) (1 diff)
-
editor/_source/commandclasses/fckremoveformatcommand.js (added)
-
editor/_source/commandclasses/fckstylecommand.js (modified) (1 diff)
-
editor/_source/commandclasses/fcktextcolorcommand.js (modified) (1 diff)
-
editor/_source/fckconstants.js (modified) (1 diff)
-
editor/_source/fckjscoreextensions.js (modified) (1 diff)
-
editor/_source/fckscriptloader.js (modified) (3 diffs)
-
editor/_source/internals/fckcommands.js (modified) (3 diffs)
-
editor/_source/internals/fckdomtools.js (modified) (6 diffs)
-
editor/_source/internals/fck_gecko.js (modified) (1 diff)
-
editor/_source/internals/fck.js (modified) (2 diffs)
-
editor/_source/internals/fcklistslib.js (modified) (2 diffs)
-
editor/_source/internals/fckregexlib.js (modified) (2 diffs)
-
editor/_source/internals/fckselection_gecko.js (modified) (5 diffs)
-
editor/_source/internals/fckselection_ie.js (modified) (2 diffs)
-
editor/_source/internals/fckstyles.js (added)
-
editor/_source/internals/fcktools.js (modified) (1 diff)
-
editor/_source/internals/fckxhtml.js (modified) (5 diffs)
-
fckconfig.js (modified) (4 diffs)
-
fckeditor.cfc (modified) (1 diff)
-
fckeditor.cfm (modified) (1 diff)
-
fckpackager.xml (modified) (9 diffs)
-
fckstyles.xml (modified) (2 diffs)
-
_test/automated/tests/fckdomtools.html (added)
-
_test/manual/fckdomrange/test1.html (modified) (1 diff)
-
_test/manual/fckstyle (added)
-
_test/manual/fckstyle/test1.html (added)
-
_test/manual/fckstyle/test1_inner.html (added)
Legend:
- Unmodified
- Added
- Removed
-
FCKeditor/trunk/editor/css/fck_editorarea.css
r701 r774 41 41 body, td 42 42 { 43 font-family: Arial, Verdana, Sans-Serif;43 font-family: Arial, Verdana, sans-serif; 44 44 font-size: 12px; 45 45 } -
FCKeditor/trunk/editor/fckeditor.html
r701 r774 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 2 2 <!-- 3 3 * FCKeditor - The text editor for Internet - http://www.fckeditor.net … … 86 86 LoadScript( '_source/classes/fckkeystrokehandler.js' ) ; 87 87 88 LoadScript( 'dtd/fck_xhtml10transitional.js' ) ; 89 LoadScript( '_source/classes/fckstyle.js' ) ; 90 LoadScript( '_source/internals/fckstyles.js' ) ; 91 88 92 LoadScript( '_source/internals/fcklisthandler.js' ) ; 89 93 LoadScript( '_source/classes/fckelementpath.js' ) ; … … 101 105 LoadScript( '_source/internals/fcktablehandler_' + sSuffix + '.js' ) ; 102 106 LoadScript( '_source/classes/fckxml_' + sSuffix + '.js' ) ; 103 LoadScript( '_source/classes/fckstyledef.js' ) ;104 LoadScript( '_source/classes/fckstyledef_' + sSuffix + '.js' ) ;105 LoadScript( '_source/classes/fckstylesloader.js' ) ;106 107 107 108 LoadScript( '_source/commandclasses/fcknamedcommand.js' ) ; 109 LoadScript( '_source/commandclasses/fckstylecommand.js' ) ; 108 110 LoadScript( '_source/commandclasses/fck_othercommands.js' ) ; 109 111 LoadScript( '_source/commandclasses/fckshowblocks.js' ) ; … … 113 115 LoadScript( '_source/commandclasses/fckpastewordcommand.js' ) ; 114 116 LoadScript( '_source/commandclasses/fcktablecommand.js' ) ; 115 LoadScript( '_source/commandclasses/fckstylecommand.js' ) ;116 117 LoadScript( '_source/commandclasses/fckfitwindow.js' ) ; 117 118 LoadScript( '_source/commandclasses/fcklistcommands.js' ) ; 119 LoadScript( '_source/commandclasses/fckcorestylecommand.js' ) ; 120 LoadScript( '_source/commandclasses/fckremoveformatcommand.js' ) ; 118 121 LoadScript( '_source/internals/fckcommands.js' ) ; 119 122 … … 124 127 LoadScript( '_source/classes/fckspecialcombo.js' ) ; 125 128 LoadScript( '_source/classes/fcktoolbarspecialcombo.js' ) ; 129 LoadScript( '_source/classes/fcktoolbarstylecombo.js' ) ; 130 LoadScript( '_source/classes/fcktoolbarfontformatcombo.js' ) ; 126 131 LoadScript( '_source/classes/fcktoolbarfontscombo.js' ) ; 127 132 LoadScript( '_source/classes/fcktoolbarfontsizecombo.js' ) ; 128 LoadScript( '_source/classes/fcktoolbarfontformatcombo.js' ) ;129 LoadScript( '_source/classes/fcktoolbarstylecombo.js' ) ;130 133 LoadScript( '_source/classes/fcktoolbarpanelbutton.js' ) ; 131 134 LoadScript( '_source/internals/fcktoolbaritems.js' ) ; … … 169 172 FCK.IECleanup.AddItem( FCK, FCK_Cleanup ) ; 170 173 } 174 175 // The first function to be called on selection change must the the styles 176 // change checker, because the result of its processing may be used by another 177 // functions listening to the same event. 178 FCK.Events.AttachEvent( 'OnSelectionChange', function() { FCKStyles.CheckSelectionChanges() ; } ) ; 171 179 172 180 // The config hidden field is processed immediately, because -
FCKeditor/trunk/editor/_source/classes/fckdomrange_gecko.js
r694 r774 72 72 } 73 73 } 74 75 // Not compatible with bookmark created with CreateBookmark2. 76 // The bookmark nodes will be deleted from the document. 77 FCKDomRange.prototype.SelectBookmark = function( bookmark ) 78 { 79 var domRange = this.Window.document.createRange() ; 80 81 var startNode = this.GetBookmarkNode( bookmark, true ) ; 82 var endNode = this.GetBookmarkNode( bookmark, false ) ; 83 84 domRange.setStart( startNode.parentNode, FCKDomTools.GetIndexOf( startNode ) ) ; 85 FCKDomTools.RemoveNode( startNode ) ; 86 87 if ( endNode ) 88 { 89 domRange.setEnd( endNode.parentNode, FCKDomTools.GetIndexOf( endNode ) ) ; 90 FCKDomTools.RemoveNode( endNode ) ; 91 } 92 93 var selection = this.Window.getSelection() ; 94 selection.removeAllRanges() ; 95 selection.addRange( domRange ) ; 96 } -
FCKeditor/trunk/editor/_source/classes/fckdomrange_ie.js
r733 r774 70 70 { 71 71 if ( this._Range ) 72 {73 var bIsCollapsed = this.CheckIsCollapsed() ; 72 this.SelectBookmark( this.CreateBookmark( true ) ) ; 73 } 74 74 75 // Create marker tags for the start and end boundaries. 76 var eStartMarker = this._GetRangeMarkerTag( true ) ; 75 // Not compatible with bookmark created with CreateBookmark2. 76 // The bookmark nodes will be deleted from the document. 77 FCKDomRange.prototype.SelectBookmark = function( bookmark ) 78 { 79 var bIsCollapsed = this.CheckIsCollapsed() ; 77 80 var bIsStartMakerAlone ; 78 81 79 if ( !bIsCollapsed ) 80 var eEndMarker = this._GetRangeMarkerTag( false ) ; 82 // Create marker tags for the start and end boundaries. 83 var eStartMarker = this.GetBookmarkNode( bookmark, true ) ; 84 85 if ( !eStartMarker ) 86 return ; 81 87 82 // Create the main range which will be used for the selection. 83 var oIERange = this.Window.document.body.createTextRange() ; 88 var eEndMarker ; 89 if ( !bIsCollapsed ) 90 eEndMarker = this.GetBookmarkNode( bookmark, false ) ; 84 91 85 // Position the range at the start boundary. 86 oIERange.moveToElementText( eStartMarker ) ; 87 oIERange.moveStart( 'character', 1 ) ; 92 // Create the main range which will be used for the selection. 93 var oIERange = this.Window.document.body.createTextRange() ; 88 94 89 if ( !bIsCollapsed ) 95 // Position the range at the start boundary. 96 oIERange.moveToElementText( eStartMarker ) ; 97 oIERange.moveStart( 'character', 1 ) ; 98 99 if ( eEndMarker ) 100 { 101 // Create a tool range for the end. 102 var oIERangeEnd = this.Window.document.body.createTextRange() ; 103 104 // Position the tool range at the end. 105 oIERangeEnd.moveToElementText( eEndMarker ) ; 106 107 // Move the end boundary of the main range to match the tool range. 108 oIERange.setEndPoint( 'EndToEnd', oIERangeEnd ) ; 109 oIERange.moveEnd( 'character', -1 ) ; 110 } 111 else 112 bIsStartMakerAlone = ( !eStartMarker.previousSibling || eStartMarker.previousSibling.nodeName.toLowerCase() == 'br' ) && !eStartMarker.nextSibing ; 113 114 if ( !this._Range ) 115 this._Range = this.CreateRange() ; 116 117 // Remove the markers (reset the position, because of the changes in the DOM tree). 118 this._Range.setStartBefore( eStartMarker ) ; 119 eStartMarker.parentNode.removeChild( eStartMarker ) ; 120 121 if ( bIsCollapsed ) 122 { 123 if ( bIsStartMakerAlone ) 90 124 { 91 // Create a tool range for the end.92 var oIERangeEnd = this.Window.document.body.createTextRange() ;125 // The following trick is needed so IE makes collapsed selections 126 // inside empty blocks visible (expands the block). 93 127 94 // Position the tool range at the end. 95 oIERangeEnd.moveToElementText( eEndMarker ) ; 128 try 129 { 130 oIERange.pasteHTML( ' ' ) ; 131 132 // Move the selection start to include the . 133 oIERange.moveStart( 'character', -1 ) ; 134 } 135 catch (e){} 96 136 97 // Move the end boundary of the main range to match the tool range. 98 oIERange.setEndPoint( 'EndToEnd', oIERangeEnd ) ; 99 oIERange.moveEnd( 'character', -1 ) ; 137 // The following must be done into a separate try block. (#1034) 138 try 139 { 140 oIERange.select() ; 141 this.Window.document.selection.clear() ; 142 } 143 catch (e){} 100 144 } 101 145 else 102 bIsStartMakerAlone = ( !eStartMarker.previousSibling || eStartMarker.previousSibling.nodeName.toLowerCase() == 'br' ) && !eStartMarker.nextSibing ;103 104 // Remove the markers (reset the position, because of the changes in the DOM tree).105 this._Range.setStartBefore( eStartMarker ) ;106 eStartMarker.parentNode.removeChild( eStartMarker ) ;107 108 if ( bIsCollapsed )109 {110 if ( bIsStartMakerAlone )111 {112 // The following trick is needed so IE makes collapsed selections113 // inside empty blocks visible (expands the block).114 115 try116 {117 oIERange.pasteHTML( ' ' ) ;118 119 // Move the selection start to include the .120 oIERange.moveStart( 'character', -1 ) ;121 }122 catch (e){}123 124 // The following must be done into a separate try block. (#1034)125 try126 {127 oIERange.select() ;128 this.Window.document.selection.clear() ;129 }130 catch (e){}131 }132 else133 oIERange.select() ;134 }135 else136 {137 this._Range.setEndBefore( eEndMarker ) ;138 eEndMarker.parentNode.removeChild( eEndMarker ) ;139 146 oIERange.select() ; 140 } 147 } 148 else 149 { 150 this._Range.setEndBefore( eEndMarker ) ; 151 eEndMarker.parentNode.removeChild( eEndMarker ) ; 152 oIERange.select() ; 141 153 } 142 154 } … … 175 187 return doc.getElementById( sMarkerId ) ; 176 188 } 177 178 FCKDomRange.prototype._GetRangeMarkerTag = function( toStart )179 {180 // Get a range for the start boundary.181 var oRange = this._Range ;182 183 // insertNode() will add the node at the beginning of the Range, updating184 // the endOffset if necessary. So, we can work with the current range in this case.185 if ( !toStart )186 {187 oRange = oRange.cloneRange() ;188 oRange.collapse( toStart === true ) ;189 }190 191 var eSpan = this.Window.document.createElement( 'span' ) ;192 eSpan.innerHTML = ' ' ;193 oRange.insertNode( eSpan ) ;194 195 return eSpan ;196 } -
FCKeditor/trunk/editor/_source/classes/fckdomrange.js
r720 r774 34 34 _UpdateElementInfo : function() 35 35 { 36 if ( !this._Range ) 36 var innerRange = this._Range ; 37 38 if ( !innerRange ) 37 39 this.Release( true ) ; 38 40 else 39 41 { 40 var eStart = this._Range.startContainer ; 41 var eEnd = this._Range.endContainer ; 42 // For text nodes, the node itself is the StartNode. 43 var eStart = innerRange.startContainer ; 44 var eEnd = innerRange.endContainer ; 42 45 43 46 var oElementPath = new FCKElementPath( eStart ) ; 44 this.StartContainer = oElementPath.LastElement ; 47 this.StartNode = eStart.nodeType == 3 ? eStart : eStart.childNodes[ innerRange.startOffset ] ; 48 this.StartContainer = eStart ; 45 49 this.StartBlock = oElementPath.Block ; 46 50 this.StartBlockLimit = oElementPath.BlockLimit ; … … 48 52 if ( eStart != eEnd ) 49 53 oElementPath = new FCKElementPath( eEnd ) ; 50 this.EndContainer = oElementPath.LastElement ; 54 this.EndNode = eEnd.nodeType == 3 ? eEnd : eEnd.childNodes[ innerRange.endOffset ] ; 55 this.EndContainer = eEnd ; 51 56 this.EndBlock = oElementPath.Block ; 52 57 this.EndBlockLimit = oElementPath.BlockLimit ; … … 215 220 }, 216 221 217 CreateBookmark : function() 222 // This is an "intrusive" way to create a bookmark. It includes <span> tags 223 // in the range boundaries. The advantage of it is that it is possible to 224 // handle DOM mutations when moving back to the bookmark. 225 // Attention: the inclusion of nodes in the DOM is a design choice and 226 // should not be changes as there are other points in the code that may be 227 // using those nodes to perform operations. See GetBookmarkNode. 228 // For performance, includeNodes=true if intended to SelectBookmark. 229 CreateBookmark : function( includeNodes ) 218 230 { 219 231 // Create the bookmark info (random IDs). 220 232 var oBookmark = 221 233 { 222 StartId : 'fck_dom_range_start_' + (new Date()).valueOf() + '_' + Math.floor(Math.random()*1000),223 EndId : 'fck_dom_range_end_' + (new Date()).valueOf() + '_' + Math.floor(Math.random()*1000)234 StartId : (new Date()).valueOf() + Math.floor(Math.random()*1000) + 'S', 235 EndId : (new Date()).valueOf() + Math.floor(Math.random()*1000) + 'E' 224 236 } ; 225 237 … … 233 245 eSpan = oDoc.createElement( 'span' ) ; 234 246 eSpan.id = oBookmark.EndId ; 235 eSpan.innerHTML = ' ' ; // For IE, it must have something inside, otherwise it may be removed during operations. 247 eSpan.setAttribute( '_fck_bookmark', true ) ; 248 249 // For IE, it must have something inside, otherwise it may be 250 // removed during DOM operations. 251 // if ( FCKBrowserInfo.IsIE ) 252 eSpan.innerHTML = ' ' ; 236 253 237 254 oClone = this.Clone() ; 238 255 oClone.Collapse( false ) ; 239 256 oClone.InsertNode( eSpan ) ; 257 258 if ( includeNodes ) 259 oBookmark.EndNode = eSpan ; 240 260 } 241 261 242 262 eSpan = oDoc.createElement( 'span' ) ; 243 263 eSpan.id = oBookmark.StartId ; 244 eSpan.innerHTML = ' ' ; // For IE, it must have something inside, otherwise it may be removed during operations. 264 eSpan.setAttribute( '_fck_bookmark', true ) ; 265 266 // For IE, it must have something inside, otherwise it may be removed 267 // during DOM operations. 268 // if ( FCKBrowserInfo.IsIE ) 269 eSpan.innerHTML = ' ' ; 245 270 246 271 oClone = this.Clone() ; … … 248 273 oClone.InsertNode( eSpan ) ; 249 274 275 if ( includeNodes ) 276 oBookmark.StartNode = eSpan ; 277 250 278 return oBookmark ; 251 279 }, 252 280 281 // This one should be a part of a hypothetic "bookmark" object. 282 GetBookmarkNode : function( bookmark, start ) 283 { 284 var doc = this.Window.document ; 285 286 if ( start ) 287 return bookmark.StartNode || doc.getElementById( bookmark.StartId ) ; 288 else 289 return bookmark.EndNode || doc.getElementById( bookmark.EndId ) ; 290 }, 291 253 292 MoveToBookmark : function( bookmark, preserveBookmark ) 254 293 { 255 var oDoc = this.Window.document ; 256 257 var eStartSpan = oDoc.getElementById( bookmark.StartId ) ; 258 var eEndSpan = oDoc.getElementById( bookmark.EndId ) ; 294 var eStartSpan = this.GetBookmarkNode( bookmark, true ) ; 295 var eEndSpan = this.GetBookmarkNode( bookmark, false ) ; 259 296 260 297 this.SetStart( eStartSpan, 3 ) ; … … 263 300 FCKDomTools.RemoveNode( eStartSpan ) ; 264 301 265 // If collapsed, the startspan will not be available.302 // If collapsed, the end span will not be available. 266 303 if ( eEndSpan ) 267 304 { … … 284 321 if ( ! this._Range ) 285 322 return { "Start" : 0, "End" : 0 } ; 286 323 287 324 // First, we record down the offset values 288 var bookmark = 325 var bookmark = 289 326 { 290 327 "Start" : [ this._Range.startOffset ], … … 424 461 switch ( unit ) 425 462 { 463 // Expand the range to include all inline parent elements if we are 464 // are in their boundary limits. 465 // For example (where [ ] are the range limits): 466 // Before => Some <b>[<i>Some sample text]</i></b>. 467 // After => Some [<b><i>Some sample text</i></b>]. 468 case 'inline_elements' : 469 // Expand the start boundary. 470 if ( this._Range.startOffset == 0 ) 471 { 472 oNode = this._Range.startContainer ; 473 474 if ( oNode.nodeType != 1 ) 475 oNode = oNode.parentNode ; 476 477 while ( FCKListsLib.InlineNonEmptyElements[ oNode.nodeName.toLowerCase() ] ) 478 { 479 this._Range.setStartBefore( oNode ) ; 480 481 if ( oNode != oNode.parentNode.firstChild ) 482 break ; 483 484 oNode = oNode.parentNode ; 485 } 486 } 487 488 // Expand the end boundary. 489 oNode = this._Range.endContainer ; 490 var offset = this._Range.endOffset ; 491 492 if ( ( oNode.nodeType == 3 && offset >= oNode.nodeValue.length ) || ( oNode.nodeType == 1 && offset >= oNode.childNodes.length ) || ( oNode.nodeType != 1 && oNode.nodeType != 3 ) ) 493 { 494 if ( oNode.nodeType != 1 ) 495 oNode = oNode.parentNode ; 496 497 while ( FCKListsLib.InlineNonEmptyElements[ oNode.nodeName.toLowerCase() ] ) 498 { 499 this._Range.setEndAfter( oNode ) ; 500 501 if ( oNode != oNode.parentNode.lastChild ) 502 break ; 503 504 oNode = oNode.parentNode ; 505 } 506 } 507 508 break ; 509 426 510 case 'block_contents' : 427 511 if ( this.StartBlock ) … … 531 615 if ( !eStartBlock ) 532 616 { 533 eStartBlock = this. _FixBlock( true ) ;534 eEndBlock = this.EndBlock ; // _FixBlock may have fixed the EndBlock too.617 eStartBlock = this.FixBlock( true ) ; 618 eEndBlock = this.EndBlock ; // FixBlock may have fixed the EndBlock too. 535 619 } 536 620 537 621 if ( !eEndBlock ) 538 eEndBlock = this. _FixBlock( false ) ;622 eEndBlock = this.FixBlock( false ) ; 539 623 } 540 624 … … 546 630 this.DeleteContents() ; 547 631 548 if ( eStartBlock && eEndBlock && eStartBlock == eEndBlock )632 if ( eStartBlock && eEndBlock && eStartBlock == eEndBlock ) 549 633 { 550 634 if ( bIsStartOfBlock ) … … 596 680 597 681 // Transform a block without a block tag in a valid block (orphan text in the body or td, usually). 598 _FixBlock : function( isStart )682 FixBlock : function( isStart ) 599 683 { 600 684 // Bookmark the range so we can restore it later. … … 628 712 this.Window = null ; 629 713 714 this.StartNode = null ; 630 715 this.StartContainer = null ; 631 716 this.StartBlock = null ; 632 717 this.StartBlockLimit = null ; 718 this.EndNode = null ; 633 719 this.EndContainer = null ; 634 720 this.EndBlock = null ; 635 721 this.EndBlockLimit = null ; 636 722 this._Range = null ; 723 }, 724 725 CheckHasRange : function() 726 { 727 return ( this._Range && true ) ; 637 728 } 638 729 } ; -
FCKeditor/trunk/editor/_source/classes/fckspecialcombo.js
r741 r774 117 117 } 118 118 119 FCKSpecialCombo.prototype.SelectItem = function( item Id)120 { 121 i temId = itemId ? itemId.toString().toLowerCase() : '' ;122 123 var oDiv = this.Items[ itemId ] ; 124 if ( oDiv)125 { 126 oDiv.className = oDiv.originalClass = 'SC_ItemSelected' ;127 oDiv.Selected = true ;119 FCKSpecialCombo.prototype.SelectItem = function( item ) 120 { 121 if ( typeof item == 'string' ) 122 item = this.Items[ item.toString().toLowerCase() ] ; 123 124 if ( item ) 125 { 126 item.className = item.originalClass = 'SC_ItemSelected' ; 127 item.Selected = true ; 128 128 } 129 129 } … … 169 169 FCKSpecialCombo.prototype.SetLabel = function( text ) 170 170 { 171 this.Label = text.length == 0 ? ' ' : text ; 172 173 if ( this._LabelEl ) 174 { 175 this._LabelEl.innerHTML = this.Label ; 171 text = ( !text || text.length == 0 ) ? ' ' : text ; 172 173 if ( text == this.Label ) 174 return ; 175 176 this.Label = text ; 177 178 var labelEl = this._LabelEl ; 179 if ( labelEl ) 180 { 181 labelEl.innerHTML = text ; 176 182 177 183 // It may happen that the label is some HTML, including tags. This … … 179 185 // combo will get the selection from the editing area. So we must 180 186 // disable any kind of selection here. 181 FCKTools.DisableSelection( this._LabelEl ) ;187 FCKTools.DisableSelection( labelEl ) ; 182 188 } 183 189 } -
FCKeditor/trunk/editor/_source/classes/fcktoolbarfontformatcombo.js
r714 r774 24 24 var FCKToolbarFontFormatCombo = function( tooltip, style ) 25 25 { 26 if ( tooltip === false ) 27 return ; 28 26 29 this.CommandName = 'FontFormat' ; 27 30 this.Label = this.GetLabel() ; … … 37 40 38 41 // Inherit from FCKToolbarSpecialCombo. 39 FCKToolbarFontFormatCombo.prototype = new FCKToolbarSpecialCombo ; 40 41 FCKToolbarFontFormatCombo.prototype.TypeOf = 'FCKToolbarFontFormatCombo' ; // @Packager.RemoveLine 42 FCKToolbarFontFormatCombo.prototype = new FCKToolbarStyleCombo( false ) ; 42 43 43 44 FCKToolbarFontFormatCombo.prototype.GetLabel = function() … … 46 47 } 47 48 48 FCKToolbarFontFormatCombo.prototype. CreateItems = function( targetSpecialCombo)49 FCKToolbarFontFormatCombo.prototype.GetStyles = function() 49 50 { 50 var oTargetDoc = targetSpecialCombo._Panel.Document ; 51 52 // Add the Editor Area CSS to the panel to create a realistic preview. 53 FCKTools.AppendStyleSheet( oTargetDoc, FCKConfig.ToolbarComboPreviewCSS ) ; 54 FCKTools.AppendStyleString( oTargetDoc, FCKConfig.EditorAreaStyles ) ; 55 56 // Add ID and Class to the body 57 FCKConfig.ApplyBodyAttributes( oTargetDoc.body ) ; 51 var styles = {} ; 58 52 59 53 // Get the format names from the language file. … … 69 63 h5 : aNames[7], 70 64 h6 : aNames[8], 71 div : aNames[9] 65 div : aNames[9] || ( aNames[0] + ' (DIV)') 72 66 } ; 67 68 // Get the available formats from the configuration file. 69 var elements = FCKConfig.FontFormats.split(';') ; 73 70 74 // Get the available formats from the configuration file. 75 var aTags = FCKConfig.FontFormats.split(';') ; 71 for ( var i = 0 ; i < elements.length ; i++ ) 72 { 73 var elementName = elements[ i ] ; 74 var style = FCKStyles.GetStyle( '_FCK_' + elementName ) ; 75 style.Label = oNames[ elementName ] ; 76 styles[ '_FCK_' + elementName ] = style ; 77 } 76 78 77 for ( var i = 0 ; i < aTags.length ; i++ ) 79 return styles ; 80 } 81 82 FCKToolbarFontFormatCombo.prototype.RefreshActiveItems = function( targetSpecialCombo ) 83 { 84 var startElement = FCKSelection.GetBoundaryParentElement( true ) ; 85 86 if ( startElement ) 78 87 { 79 // Support for DIV in Firefox has been reintroduced on version 2.2. 80 // if ( aTags[i] == 'div' && FCKBrowserInfo.IsGecko ) 81 // continue ; 88 var path = new FCKElementPath( startElement ) ; 89 var blockElement = path.Block ; 82 90 83 var sTag = aTags[i] ; 84 var sLabel = oNames[sTag] ; 91 if ( blockElement ) 92 { 93 for ( var i in targetSpecialCombo.Items ) 94 { 95 var item = targetSpecialCombo.Items[i] ; 96 var style = item.Style ; 85 97 86 if ( sTag == 'p' ) 87 this.NormalLabel = sLabel ; 98 if ( style.CheckElementRemovable( blockElement ) ) 99 { 100 targetSpecialCombo.SetLabel( style.Label ) ; 101 return ; 102 } 103 } 104 } 105 } 88 106 89 this._Combo.AddItem( sTag, '<div class="BaseFont"><' + sTag + '>' + sLabel + '</' + sTag + '></div>', sLabel ) ; 107 targetSpecialCombo.SetLabel( this.DefaultLabel ) ; 108 } 109 110 FCKToolbarFontFormatCombo.prototype.StyleCombo_OnBeforeClick = function( targetSpecialCombo ) 111 { 112 // Clear the current selection. 113 targetSpecialCombo.DeselectAll() ; 114 115 var startElement = FCKSelection.GetBoundaryParentElement( true ) ; 116 117 if ( startElement ) 118 { 119 var path = new FCKElementPath( startElement ) ; 120 var blockElement = path.Block ; 121 122 for ( var i in targetSpecialCombo.Items ) 123 { 124 var item = targetSpecialCombo.Items[i] ; 125 var style = item.Style ; 126 127 if ( style.CheckElementRemovable( blockElement ) ) 128 { 129 targetSpecialCombo.SelectItem( item ) ; 130 return ; 131 } 132 } 90 133 } 91 134 } 92 93 if ( FCKBrowserInfo.IsIE )94 {95 FCKToolbarFontFormatCombo.prototype.RefreshActiveItems = function( combo, value )96 {97 // FCKDebug.Output( 'FCKToolbarFontFormatCombo Value: ' + value ) ;98 99 // IE returns normal for DIV and P, so to avoid confusion, we will not show it as normal.100 if ( value == this.NormalLabel )101 {102 if ( combo.Label != ' ' )103 combo.DeselectAll(true) ;104 105 combo.SetLabel( this.DefaultLabel ) ;106 }107 else108 {109 if ( this._LastValue == value )110 return ;111 112 if ( !value || value.length == 0 )113 {114 combo.DeselectAll() ;115 combo.SetLabel( this.DefaultLabel ) ;116 }117 118 combo.SelectItemByLabel( value, true ) ;119 }120 121 this._LastValue = value ;122 }123 } -
FCKeditor/trunk/editor/_source/classes/fcktoolbarfontscombo.js
r714 r774 28 28 this.Tooltip = tooltip ? tooltip : this.Label ; 29 29 this.Style = style ? style : FCK_TOOLBARITEM_ICONTEXT ; 30 30 31 31 this.DefaultLabel = FCKConfig.DefaultFontLabel || '' ; 32 32 } 33 33 34 34 // Inherit from FCKToolbarSpecialCombo. 35 FCKToolbarFontsCombo.prototype = new FCKToolbarSpecialCombo ; 36 37 FCKToolbarFontsCombo.prototype.TypeOf = 'FCKToolbarFontsCombo' ; // @Packager.RemoveLine 35 FCKToolbarFontsCombo.prototype = new FCKToolbarFontFormatCombo( false ) ; 38 36 39 37 FCKToolbarFontsCombo.prototype.GetLabel = function() … … 42 40 } 43 41 44 FCKToolbarFontsCombo.prototype. CreateItems = function( targetSpecialCombo)42 FCKToolbarFontsCombo.prototype.GetStyles = function() 45 43 { 46 var aFonts = FCKConfig.FontNames.split(';') ;44 var baseStyle = FCKStyles.GetStyle( '_FCK_FontFace' ) ; 47 45 48 for ( var i = 0 ; i < aFonts.length ; i++ ) 49 this._Combo.AddItem( aFonts[i], '<font face="' + aFonts[i] + '" style="font-size: 12px">' + aFonts[i] + '</font>' ) ; 46 var styles = {} ; 47 48 var fonts = FCKConfig.FontNames.split(';') ; 49 50 for ( var i = 0 ; i < fonts.length ; i++ ) 51 { 52 var fontParts = fonts[i].split('/') ; 53 var font = fontParts[0] ; 54 var caption = fontParts[1] || font ; 55 56 var style = FCKTools.CloneObject( baseStyle ) ; 57 style.SetVariable( 'Font', font ) ; 58 style.Label = caption ; 59 60 styles[ caption ] = style ; 61 } 62 63 return styles ; 50 64 } 65 66 FCKToolbarFontsCombo.prototype.RefreshActiveItems = FCKToolbarStyleCombo.prototype.RefreshActiveItems ; 67 68 FCKToolbarFontsCombo.prototype.StyleCombo_OnBeforeClick = function( targetSpecialCombo ) 69 { 70 // Clear the current selection. 71 targetSpecialCombo.DeselectAll() ; 72 73 var startElement = FCKSelection.GetBoundaryParentElement( true ) ; 74 75 if ( startElement ) 76 { 77 var path = new FCKElementPath( startElement ) ; 78 79 for ( var i in targetSpecialCombo.Items ) 80 { 81 var item = targetSpecialCombo.Items[i] ; 82 var style = item.Style ; 83 84 if ( style.CheckActive( path ) ) 85 { 86 targetSpecialCombo.SelectItem( item ) ; 87 return ; 88 } 89 } 90 } 91 } -
FCKeditor/trunk/editor/_source/classes/fcktoolbarfontsizecombo.js
r714 r774 30 30 31 31 this.DefaultLabel = FCKConfig.DefaultFontSizeLabel || '' ; 32 33 this.FieldWidth = 70 ; 32 34 } 33 35 34 36 // Inherit from FCKToolbarSpecialCombo. 35 FCKToolbarFontSizeCombo.prototype = new FCKToolbarSpecialCombo ; 36 37 FCKToolbarFontSizeCombo.prototype.TypeOf = 'FCKToolbarFontSizeCombo' ; // @Packager.RemoveLine 37 FCKToolbarFontSizeCombo.prototype = new FCKToolbarFontFormatCombo( false ) ; 38 38 39 39 FCKToolbarFontSizeCombo.prototype.GetLabel = function() … … 42 42 } 43 43 44 FCKToolbarFontSizeCombo.prototype. CreateItems = function( targetSpecialCombo)44 FCKToolbarFontSizeCombo.prototype.GetStyles = function() 45 45 { 46 targetSpecialCombo.FieldWidth = 70;46 var baseStyle = FCKStyles.GetStyle( '_FCK_Size' ) ; 47 47 48 var aSizes = FCKConfig.FontSizes.split(';');48 var styles = {} ; 49 49 50 for ( var i = 0 ; i < aSizes.length ; i++ ) 50 var fonts = FCKConfig.FontSizes.split(';') ; 51 52 for ( var i = 0 ; i < fonts.length ; i++ ) 51 53 { 52 var aSizeParts = aSizes[i].split('/') ; 53 this._Combo.AddItem( aSizeParts[0], '<font size="' + aSizeParts[0] + '">' + aSizeParts[1] + '</font>', aSizeParts[1] ) ; 54 var fontParts = fonts[i].split('/') ; 55 var font = fontParts[0] ; 56 var caption = fontParts[1] || font ; 57 58 var style = FCKTools.CloneObject( baseStyle ) ; 59 style.SetVariable( 'Size', font ) ; 60 style.Label = caption ; 61 62 styles[ caption ] = style ; 54 63 } 64 65 return styles ; 55 66 } 67 68 FCKToolbarFontSizeCombo.prototype.RefreshActiveItems = FCKToolbarStyleCombo.prototype.RefreshActiveItems ; 69 70 FCKToolbarFontSizeCombo.prototype.StyleCombo_OnBeforeClick = FCKToolbarFontsCombo.prototype.StyleCombo_OnBeforeClick ; -
FCKeditor/trunk/editor/_source/classes/fcktoolbarstylecombo.js
r714 r774 24 24 var FCKToolbarStyleCombo = function( tooltip, style ) 25 25 { 26 if ( tooltip === false ) 27 return ; 28 26 29 this.CommandName = 'Style' ; 27 30 this.Label = this.GetLabel() ; 28 31 this.Tooltip = tooltip ? tooltip : this.Label ; 29 32 this.Style = style ? style : FCK_TOOLBARITEM_ICONTEXT ; 30 33 31 34 this.DefaultLabel = FCKConfig.DefaultStyleLabel || '' ; 32 35 } … … 35 38 FCKToolbarStyleCombo.prototype = new FCKToolbarSpecialCombo ; 36 39 37 FCKToolbarStyleCombo.prototype.TypeOf = 'FCKToolbarStyleCombo' ; // @Packager.RemoveLine38 39 40 FCKToolbarStyleCombo.prototype.GetLabel = function() 40 41 { … … 42 43 } 43 44 45 FCKToolbarStyleCombo.prototype.GetStyles = function() 46 { 47 var styles = {} ; 48 var allStyles = FCK.ToolbarSet.CurrentInstance.Styles.GetStyles() ; 49 50 for ( var styleName in allStyles ) 51 { 52 var style = allStyles[ styleName ] ; 53 if ( !style.IsCore ) 54 styles[ styleName ] = style ; 55 } 56 return styles ; 57 } 58 44 59 FCKToolbarStyleCombo.prototype.CreateItems = function( targetSpecialCombo ) 45 60 { 46 var oTargetDoc = targetSpecialCombo._Panel.Document ;61 var targetDoc = targetSpecialCombo._Panel.Document ; 47 62 48 63 // Add the Editor Area CSS to the panel so the style classes are previewed correctly. 49 FCKTools.AppendStyleSheet( oTargetDoc, FCKConfig.ToolbarComboPreviewCSS ) ;50 FCKTools.AppendStyleString( oTargetDoc, FCKConfig.EditorAreaStyles ) ;51 oTargetDoc.body.className += ' ForceBaseFont' ;64 FCKTools.AppendStyleSheet( targetDoc, FCKConfig.ToolbarComboPreviewCSS ) ; 65 FCKTools.AppendStyleString( targetDoc, FCKConfig.EditorAreaStyles ) ; 66 targetDoc.body.className += ' ForceBaseFont' ; 52 67 53 // Add ID and Class to the body 54 FCKConfig.ApplyBodyAttributes( oTargetDoc.body ) ;68 // Add ID and Class to the body. 69 FCKConfig.ApplyBodyAttributes( targetDoc.body ) ; 55 70 56 // For some reason Gecko is blocking inside the "RefreshVisibleItems" function. 57 // The problem is present only in old versions 58 if ( !( FCKBrowserInfo.IsGecko && FCKBrowserInfo.IsGecko10 ) ) 59 targetSpecialCombo.OnBeforeClick = this.RefreshVisibleItems ; 71 // Get the styles list. 72 var styles = this.GetStyles() ; 60 73 61 // Add the styles to the special combo. 62 var aCommandStyles = FCK.ToolbarSet.CurrentInstance.Commands.GetCommand( this.CommandName ).Styles ; 63 for ( var s in aCommandStyles ) 74 for ( var styleName in styles ) 64 75 { 65 var oStyle = aCommandStyles[s] ; 66 var oItem ; 76 var style = styles[ styleName ] ; 67 77 68 if ( oStyle.IsObjectElement ) 69 oItem = targetSpecialCombo.AddItem( s, s ) ; 70 else 71 oItem = targetSpecialCombo.AddItem( s, oStyle.GetOpenerTag() + s + oStyle.GetCloserTag() ) ; 78 // Object type styles have no preview. 79 var caption = style.GetType() == FCK_STYLE_OBJECT ? 80 styleName : 81 FCKToolbarStyleCombo_BuildPreview( style, style.Label || styleName ) ; 82 83 var item = targetSpecialCombo.AddItem( styleName, caption ) ; 72 84 73 oItem.Style = oStyle ;85 item.Style = style ; 74 86 } 87 88 // We must prepare the list before showing it. 89 targetSpecialCombo.OnBeforeClick = this.StyleCombo_OnBeforeClick ; 75 90 } 76 91 77 92 FCKToolbarStyleCombo.prototype.RefreshActiveItems = function( targetSpecialCombo ) 78 93 { 79 // Clear the actual selection. 94 var startElement = FCKSelection.GetBoundaryParentElement( true ) ; 95 96 if ( startElement ) 97 { 98 var path = new FCKElementPath( startElement ) ; 99 var elements = path.Elements ; 100 101 for ( var e = 0 ; e < elements.length ; e++ ) 102 { 103 for ( var i in targetSpecialCombo.Items ) 104 { 105 var item = targetSpecialCombo.Items[i] ; 106 var style = item.Style ; 107 108 if ( style.CheckElementRemovable( elements[ e ] ) ) 109 { 110 targetSpecialCombo.SetLabel( style.Label || style.Name ) ; 111 return ; 112 } 113 } 114 } 115 } 116 117 targetSpecialCombo.SetLabel( this.DefaultLabel ) ; 118 } 119 120 FCKToolbarStyleCombo.prototype.StyleCombo_OnBeforeClick = function( targetSpecialCombo ) 121 { 122 // Two things are done here: 123 // - In a control selection, get the element name, so we'll display styles 124 // for that element only. 125 // - Select the styles that are active for the current selection. 126 127 // Clear the current selection. 80 128 targetSpecialCombo.DeselectAll() ; 81 129 82 // Get the active styles. 83 var aStyles = FCK.ToolbarSet.CurrentInstance.Commands.GetCommand( this.CommandName ).GetActiveStyles() ; 84 85 if ( aStyles.length > 0 ) 130 var startElement ; 131 var path ; 132 var tagName ; 133 134 if ( FCKSelection.GetType() == 'Control' ) 86 135 { 87 // Select the active styles in the combo. 88 for ( var i = 0 ; i < aStyles.length ; i++ ) 89 targetSpecialCombo.SelectItem( aStyles[i].Name ) ; 90 91 // Set the combo label to the first style in the collection. 92 targetSpecialCombo.SetLabelById( aStyles[0].Name ) ; 136 startElement = FCKSelection.GetSelectedElement() ; 137 tagName = startElement.nodeName.toLowerCase() ; 93 138 } 94 139 else 95 targetSpecialCombo.SetLabel(this.DefaultLabel) ; 96 } 97 98 FCKToolbarStyleCombo.prototype.RefreshVisibleItems = function( targetSpecialCombo ) 99 { 100 if ( FCKSelection.GetType() == 'Control' ) 101 var sTagName = FCKSelection.GetSelectedElement().tagName ; 140 { 141 startElement = FCKSelection.GetBoundaryParentElement( true ) ; 142 path = new FCKElementPath( startElement ) ; 143 } 102 144 103 145 for ( var i in targetSpecialCombo.Items ) 104 146 { 105 var oItem = targetSpecialCombo.Items[i] ; 106 if ( ( sTagName && oItem.Style.Element == sTagName ) || ( ! sTagName && ! oItem.Style.IsObjectElement ) ) 107 oItem.style.display = '' ; 147 var item = targetSpecialCombo.Items[i] ; 148 var style = item.Style ; 149 150 if ( ( tagName && style.Element == tagName ) || ( !tagName && style.GetType() != FCK_STYLE_OBJECT ) ) 151 { 152 item.style.display = '' ; 153 154 if ( ( path && style.CheckActive( path ) ) || ( !path && style.CheckElementRemovable( startElement, true ) ) ) 155 targetSpecialCombo.SelectItem( style.Name ) ; 156 } 108 157 else 109 oItem.style.display = 'none' ; // For some reason Gecko is blocking here.158 item.style.display = 'none' ; 110 159 } 111 160 } 161 162 function FCKToolbarStyleCombo_BuildPreview( style, caption ) 163 { 164 var styleType = style.GetType() ; 165 var html = [] ; 166 167 if ( styleType == FCK_STYLE_BLOCK ) 168 html.push( '<div class="BaseFont">' ) ; 169 170 var elementName = style.Element ; 171 172 // Avoid <bdo> in the preview. 173 if ( elementName == 'bdo' ) 174 elementName = 'span' ; 175 176 html = [ '<', elementName ] ; 177 178 // Assign all defined attributes. 179 var attribs = style._StyleDesc.Attributes ; 180 if ( attribs ) 181 { 182 for ( var att in attribs ) 183 { 184 html.push( ' ', att, '="', style.GetFinalAttributeValue( att ), '"' ) ; 185 } 186 } 187 188 // Assign the style attribute. 189 if ( style._GetStyleText().length > 0 ) 190 html.push( ' style="', style.GetFinalStyleValue(), '"' ) ; 191 192 html.push( '>', caption, '</', elementName, '>' ) ; 193 194 if ( styleType == FCK_STYLE_BLOCK ) 195 html.push( '</div>' ) ; 196 197 return html.join( '' ) ; 198 } -
FCKeditor/trunk/editor/_source/classes/fckw3crange.js
r718 r774 419 419 // topStart and topEnd. Otherwise, simply collapse it to the start. (W3C specs). 420 420 if ( topStart && topEnd && ( startNode.parentNode != topStart.parentNode || endNode.parentNode != topEnd.parentNode ) ) 421 this.setStart( topEnd.parentNode, FCKDomTools.GetIndexOf( topEnd ) ) ; 421 { 422 var endIndex = FCKDomTools.GetIndexOf( topEnd ) ; 423 424 // If the start node is to be removed, we must correct the 425 // index to reflect the removal. 426 if ( removeStartNode && topEnd.parentNode == startNode.parentNode ) 427 endIndex-- ; 428 429 this.setStart( topEnd.parentNode, endIndex ) ; 430 } 422 431 423 432 // Collapse it to the start. -
FCKeditor/trunk/editor/_source/classes/fckxml_gecko.js
r132 r774 86 86 return null ; 87 87 } 88 89 FCKXml.GetAttribute = function( node, attName, defaultValue ) 90 { 91 var attNode = node.attributes.getNamedItem( attName ) ; 92 return attNode ? attNode.value : defaultValue ; 93 } -
FCKeditor/trunk/editor/_source/classes/fckxml_ie.js
r132 r774 89 89 return this.DOMDocument.selectSingleNode( xpath ) ; 90 90 } 91 92 FCKXml.GetAttribute = function( node, attName, defaultValue ) 93 { 94 var attNode = node.attributes.getNamedItem( attName ) ; 95 return attNode ? attNode.value : defaultValue ; 96 } -
FCKeditor/trunk/editor/_source/commandclasses/fck_othercommands.js
r699 r774 67 67 } 68 68 69 70 // ### FormatBlock 71 var FCKFormatBlockCommand = function() 72 {} 73 74 FCKFormatBlockCommand.prototype = 75 { 76 Name : 'FormatBlock', 77 78 Execute : FCKStyleCommand.prototype.Execute, 79 80 GetState : function() 81 { 82 return FCK.EditorDocument ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ; 83 } 84 }; 85 69 86 // ### FontName 87 70 88 var FCKFontNameCommand = function() 71 { 72 this.Name = 'FontName' ; 73 } 74 75 FCKFontNameCommand.prototype.Execute = function( fontName ) 76 { 77 if (fontName == null || fontName == "") 78 { 79 // TODO: Remove font name attribute. 80 /*jsl:pass*/ // @Packager.RemoveLine 81 } 82 else 83 FCK.ExecuteNamedCommand( 'FontName', fontName ) ; 84 } 85 86 FCKFontNameCommand.prototype.GetState = function() 87 { 88 var value = FCK.GetNamedCommandValue( 'FontName' ) ; 89 if (value && value.charAt( 0 ) == "'" && value.charAt( value.length - 1 ) == "'") 90 value = value.slice( 1, -1 ) ; 91 return value ; 92 } 89 {} 90 91 FCKFontNameCommand.prototype = 92 { 93 Name : 'FontName', 94 Execute : FCKStyleCommand.prototype.Execute, 95 GetState : FCKFormatBlockCommand.prototype.GetState 96 }; 93 97 94 98 // ### FontSize 95 99 var FCKFontSizeCommand = function() 96 { 97 this.Name = 'FontSize' ; 98 } 99 100 FCKFontSizeCommand.prototype.Execute = function( fontSize ) 101 { 102 if ( typeof( fontSize ) == 'string' ) fontSize = parseInt(fontSize, 10) ; 103 104 // If user wants the font size cleared, we have to find 105 // where the font size tag is and go clear it (if there's one) 106 if ( !fontSize ) 107 { 108 var oFont = FCK.Selection.MoveToAncestorNode('FONT'); 109 if ( oFont && oFont.getAttribute("size") ) 110 { 111 //if the only thing here is SIZE, collapse the whole tag 112 if (oFont.attributes.length == 1 || 113 (oFont.outerHTML && oFont.outerHTML.search(/<FONT size=["]*\d["]*>/i))) 114 { 115 FCKTools.RemoveOuterTags(oFont); 116 } 117 else 118 oFont.removeAttribute("size"); 119 } 120 121 } 122 else 123 FCK.ExecuteNamedCommand( 'FontSize', fontSize ) ; 124 } 125 126 FCKFontSizeCommand.prototype.GetState = function() 127 { 128 return FCK.GetNamedCommandValue( 'FontSize' ) ; 129 } 130 131 // ### FormatBlock 132 var FCKFormatBlockCommand = function() 133 { 134 this.Name = 'FormatBlock' ; 135 } 136 137 FCKFormatBlockCommand.prototype.Execute = function( formatName ) 138 { 139 if ( formatName == null || formatName == '' ) 140 FCK.ExecuteNamedCommand( 'FormatBlock', '<P>' ) ; 141 else if ( formatName == 'div' && FCKBrowserInfo.IsGecko ) 142 FCK.ExecuteNamedCommand( 'FormatBlock', 'div' ) ; 143 else 144 FCK.ExecuteNamedCommand( 'FormatBlock', '<' + formatName + '>' ) ; 145 } 146 147 FCKFormatBlockCommand.prototype.GetState = function() 148 { 149 return FCK.GetNamedCommandValue( 'FormatBlock' ) ; 150 } 100 {} 101 102 FCKFontSizeCommand.prototype = 103 { 104 Name : 'FontSize', 105 Execute : FCKStyleCommand.prototype.Execute, 106 GetState : FCKFormatBlockCommand.prototype.GetState 107 }; 151 108 152 109 // ### Preview -
FCKeditor/trunk/editor/_source/commandclasses/fckstylecommand.js
r132 r774 23 23 24 24 var FCKStyleCommand = function() 25 {} 26 27 FCKStyleCommand.prototype = 25 28 { 26 this.Name = 'Style' ; 29 Name : 'Style', 30 31 Execute : function( styleName, styleComboItem ) 32 { 33 FCKUndo.SaveUndoStep() ; 27 34 28 // Load the Styles defined in the XML file. 29 this.StylesLoader = new FCKStylesLoader() ; 30 this.StylesLoader.Load( FCKConfig.StylesXmlPath ) ; 31 this.Styles = this.StylesLoader.Styles ; 32 } 35 if ( styleComboItem.Selected ) 36 FCK.Styles.RemoveStyle( styleComboItem.Style ) ; 37 else 38 FCK.Styles.ApplyStyle( styleComboItem.Style ) ; 33 39 34 FCKStyleCommand.prototype.Execute = function( styleName, styleComboItem ) 35 { 36 FCKUndo.SaveUndoStep() ; 40 FCKUndo.SaveUndoStep() ; 37 41 38 if ( styleComboItem.Selected ) 39 styleComboItem.Style.RemoveFromSelection() ; 40 else 41 styleComboItem.Style.ApplyToSelection() ; 42 FCK.Focus() ; 42 43 43 FCKUndo.SaveUndoStep() ; 44 FCK.Events.FireEvent( 'OnSelectionChange' ) ; 45 }, 44 46 45 FCK.Focus() ; 47 GetState : function() 48 { 49 if ( !FCK.EditorDocument ) 50 return FCK_TRISTATE_DISABLED ; 46 51 47 FCK.Events.FireEvent( "OnSelectionChange" ) ; 48 } 52 if ( FCKSelection.GetType() == 'Control' ) 53 { 54 var el = FCKSelection.GetSelectedElement() ; 55 if ( !el || !FCKStyles.CheckHasObjectStyle( el.nodeName.toLowerCase() ) ) 56 return FCK_TRISTATE_DISABLED ; 57 } 49 58 50 FCKStyleCommand.prototype.GetState = function() 51 { 52 if ( !FCK.EditorDocument ) 53 return FCK_TRISTATE_DISABLED ; 54 55 var oSelection = FCK.EditorDocument.selection ; 56 57 if ( FCKSelection.GetType() == 'Control' ) 58 { 59 var e = FCKSelection.GetSelectedElement() ; 60 if ( e ) 61 return this.StylesLoader.StyleGroups[ e.tagName ] ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ; 59 return FCK_TRISTATE_OFF ; 62 60 } 63 64 return FCK_TRISTATE_OFF ; 65 } 66 67 FCKStyleCommand.prototype.GetActiveStyles = function() 68 { 69 var aActiveStyles = new Array() ; 70 71 if ( FCKSelection.GetType() == 'Control' ) 72 this._CheckStyle( FCKSelection.GetSelectedElement(), aActiveStyles, false ) ; 73 else 74 this._CheckStyle( FCKSelection.GetParentElement(), aActiveStyles, true ) ; 75 76 return aActiveStyles ; 77 } 78 79 FCKStyleCommand.prototype._CheckStyle = function( element, targetArray, checkParent ) 80 { 81 if ( ! element ) 82 return ; 83 84 if ( element.nodeType == 1 ) 85 { 86 var aStyleGroup = this.StylesLoader.StyleGroups[ element.tagName ] ; 87 if ( aStyleGroup ) 88 { 89 for ( var i = 0 ; i < aStyleGroup.length ; i++ ) 90 { 91 if ( aStyleGroup[i].IsEqual( element ) ) 92 targetArray[ targetArray.length ] = aStyleGroup[i] ; 93 } 94 } 95 } 96 97 if ( checkParent ) 98 this._CheckStyle( element.parentNode, targetArray, checkParent ) ; 99 } 61 }; -
FCKeditor/trunk/editor/_source/commandclasses/fcktextcolorcommand.js
r752 r774 58 58 FCKTextColorCommand.prototype.SetColor = function( color ) 59 59 { 60 if ( FCK._ActiveColorPanelType == 'ForeColor' ) 61 FCK.ExecuteNamedCommand( 'ForeColor', color ) ; 62 else if ( FCKBrowserInfo.IsGeckoLike ) 60 var style = FCKStyles.GetStyle( '_FCK_' + 61 ( FCK._ActiveColorPanelType == 'ForeColor' ? 'Color' : 'BackColor' ) ) ; 62 63 if ( !color || color.length == 0 ) 64 FCK.Styles.RemoveStyle( style ) ; 65 else 63 66 { 64 if ( FCKBrowserInfo.IsGecko && !FCKConfig.GeckoUseSPAN ) 65 FCK.EditorDocument.execCommand( 'useCSS', false, false ) ; 66 67 FCK.ExecuteNamedCommand( 'hilitecolor', color ) ; 68 69 if ( FCKBrowserInfo.IsGecko && !FCKConfig.GeckoUseSPAN ) 70 FCK.EditorDocument.execCommand( 'useCSS', false, true ) ; 67 style.SetVariable( 'Color', color ) ; 68 FCKStyles.ApplyStyle( style ) ; 71 69 } 72 else73 FCK.ExecuteNamedCommand( 'BackColor', color ) ;74 70 75 71 // Delete the "cached" active panel type. -
FCKeditor/trunk/editor/_source/fckconstants.js
r132 r774 51 51 var SHIFT = 2000 ; 52 52 var ALT = 4000 ; 53 54 var FCK_STYLE_BLOCK = 0 ; 55 var FCK_STYLE_INLINE = 1 ; 56 var FCK_STYLE_OBJECT = 2 ; -
FCKeditor/trunk/editor/_source/fckjscoreextensions.js
r694 r774 135 135 } 136 136 137 String.prototype.Replace = function( regExp, replacement, thisObj ) 138 { 139 if ( typeof replacement == 'function' ) 140 { 141 return this.replace( regExp, 142 function() 143 { 144 return replacement.apply( thisObj || this, arguments ) ; 145 } ) ; 146 } 147 else 148 return this.replace( regExp, replacement ) ; 149 } 150 137 151 Array.prototype.AddItem = function( item ) 138 152 { -
FCKeditor/trunk/editor/_source/fckscriptloader.js
r654 r774 93 93 FCKScriptLoader.AddScript( 'FCKJSCoreExtensions' ) ; 94 94 95 FCKScriptLoader.AddScript( 'FCK_Xhtml10Transitional', '../dtd/' ) ; 96 95 97 FCKScriptLoader.AddScript( 'FCKDataProcessor' , 'classes/' , ['FCKConfig','FCKBrowserInfo','FCKRegexLib','FCKXHtml'] ) ; 96 98 FCKScriptLoader.AddScript( 'FCKDocumentFragment', 'classes/' , ['FCKDomTools'], FCK_SPECIFIC ) ; … … 100 102 FCKScriptLoader.AddScript( 'FCKImagePreloader' , 'classes/' ) ; 101 103 FCKScriptLoader.AddScript( 'FCKKeystrokeHandler', 'classes/' , ['FCKConstants','FCKBrowserInfo','FCKTools'], FCK_GENERIC ) ; 104 FCKScriptLoader.AddScript( 'FCKStyle' , 'classes/' , ['FCKConstants','FCKDomRange','FCKDomTools','FCKListsLib','FCK_Xhtml10Transitional'], FCK_GENERIC ) ; 102 105 FCKScriptLoader.AddScript( 'FCKW3CRange' , 'classes/' , ['FCKDomTools','FCKTools','FCKDocumentFragment'], FCK_GENERIC ) ; 103 106 … … 106 109 FCKScriptLoader.AddScript( 'FCKConfig' , 'internals/' , ['FCKBrowserInfo','FCKConstants'] ) ; 107 110 FCKScriptLoader.AddScript( 'FCKDebug' , 'internals/' , ['FCKConfig'] ) ; 108 FCKScriptLoader.AddScript( 'FCKDomTools' , 'internals/' , ['FCKJSCoreExtensions' ], FCK_GENERIC ) ;111 FCKScriptLoader.AddScript( 'FCKDomTools' , 'internals/' , ['FCKJSCoreExtensions','FCKBrowserInfo','FCKTools'], FCK_GENERIC ) ; 109 112 FCKScriptLoader.AddScript( 'FCKListsLib' , 'internals/' ) ; 110 FCKScriptLoader.AddScript( 'FCKListHandler' , 'internals/' , ['FCKConfig', 'FCKDocumentFragment', 'FCKJSCoreExtensions','FCKDomTools' ,'FCKTools'], FCK_GENERIC ) ;113 FCKScriptLoader.AddScript( 'FCKListHandler' , 'internals/' , ['FCKConfig', 'FCKDocumentFragment', 'FCKJSCoreExtensions','FCKDomTools'], FCK_GENERIC ) ; 111 114 FCKScriptLoader.AddScript( 'FCKRegexLib' , 'internals/' ) ; 115 FCKScriptLoader.AddScript( 'FCKStyles' , 'internals/' , ['FCKConfig', 'FCKDocumentFragment', 'FCKDomRange','FCKDomTools','FCKElementPath','FCKTools'], FCK_GENERIC ) ; 112 116 FCKScriptLoader.AddScript( 'FCKTools' , 'internals/' , ['FCKJSCoreExtensions','FCKBrowserInfo'], FCK_GENERIC_SPECIFIC ) ; 113 117 FCKScriptLoader.AddScript( 'FCKXHtml' , 'internals/' , ['FCKBrowserInfo','FCKCodeFormatter','FCKConfig','FCKDomTools','FCKListsLib','FCKRegexLib','FCKTools','FCKXHtmlEntities'], FCK_GENERIC_SPECIFIC ) ; -
FCKeditor/trunk/editor/_source/internals/fckcommands.js
r764 r774 39 39 switch ( commandName ) 40 40 { 41 case 'Bold' : 42 case 'Italic' : 43 case 'Underline' : 44 case 'StrikeThrough': 45 case 'Subscript' : 46 case 'Superscript' : oCommand = new FCKCoreStyleCommand( commandName ) ; break ; 47 48 case 'RemoveFormat' : oCommand = new FCKRemoveFormatCommand() ; break ; 49 41 50 case 'DocProps' : oCommand = new FCKDialogCommand( 'DocProps' , FCKLang.DocProps , 'dialog/fck_docprops.html' , 400, 390, FCKCommands.GetFullPageState ) ; break ; 42 51 case 'Templates' : oCommand = new FCKDialogCommand( 'Templates' , FCKLang.DlgTemplatesTitle , 'dialog/fck_template.html' , 380, 450 ) ; break ; … … 82 91 case 'TableInsertRowAfter' : oCommand = new FCKTableCommand('TableInsertRowAfter') ; break ; 83 92 case 'TableInsertRowBefore' : oCommand = new FCKTableCommand('TableInsertRowBefore') ; break ; 84 case 'TableDeleteRows' : oCommand = new FCKTableCommand('TableDeleteRows') ; break ;93 case 'TableDeleteRows' : oCommand = new FCKTableCommand('TableDeleteRows') ; break ; 85 94 case 'TableInsertColumnAfter' : oCommand = new FCKTableCommand('TableInsertColumnAfter') ; break ; 86 95 case 'TableInsertColumnBefore' : oCommand = new FCKTableCommand('TableInsertColumnBefore') ; break ; 87 case 'TableDeleteColumns' : oCommand = new FCKTableCommand('TableDeleteColumns') ; break ;96 case 'TableDeleteColumns' : oCommand = new FCKTableCommand('TableDeleteColumns') ; break ; 88 97 case 'TableInsertCellAfter' : oCommand = new FCKTableCommand('TableInsertCellAfter') ; break ; 89 case 'TableInsertCellBefore' : oCommand = new FCKTableCommand('TableInsertCellBefore') ; break ;90 case 'TableDeleteCells' : oCommand = new FCKTableCommand('TableDeleteCells') ; break ;91 case 'TableMergeCells' : oCommand = new FCKTableCommand('TableMergeCells') ; break ;92 case 'TableMergeRight' : oCommand = new FCKTableCommand('TableMergeRight') ; break ;93 case 'TableMergeDown' : oCommand = new FCKTableCommand('TableMergeDown') ; break ;94 case 'TableHorizontalSplitCell' : oCommand = new FCKTableCommand('TableHorizontalSplitCell') ; break ;95 case 'TableVerticalSplitCell' : oCommand = new FCKTableCommand('TableVerticalSplitCell') ; break ;96 case 'TableDelete' : oCommand = new FCKTableCommand('TableDelete') ; break ;98 case 'TableInsertCellBefore' : oCommand = new FCKTableCommand('TableInsertCellBefore') ; break ; 99 case 'TableDeleteCells' : oCommand = new FCKTableCommand('TableDeleteCells') ; break ; 100 case 'TableMergeCells' : oCommand = new FCKTableCommand('TableMergeCells') ; break ; 101 case 'TableMergeRight' : oCommand = new FCKTableCommand('TableMergeRight') ; break ; 102 case 'TableMergeDown' : oCommand = new FCKTableCommand('TableMergeDown') ; break ; 103 case 'TableHorizontalSplitCell' : oCommand = new FCKTableCommand('TableHorizontalSplitCell') ; break ; 104 case 'TableVerticalSplitCell' : oCommand = new FCKTableCommand('TableVerticalSplitCell') ; break ; 105 case 'TableDelete' : oCommand = new FCKTableCommand('TableDelete') ; break ; 97 106 98 107 case 'Form' : oCommand = new FCKDialogCommand( 'Form' , FCKLang.Form , 'dialog/fck_form.html' , 380, 230 ) ; break ; … … 113 122 case 'Copy' : oCommand = new FCKCopyCommand() ; break ; 114 123 115 case 'SelectAll' : oCommand = new FCKSelectAllCommand() ; break ;116 case 'InsertOrderedList' : oCommand = new FCKListCommand( 'insertorderedlist' ) ; break ;117 case 'InsertUnorderedList' : oCommand = new FCKListCommand( 'insertunorderedlist' ) ; break ;124 case 'SelectAll' : oCommand = new FCKSelectAllCommand() ; break ; 125 case 'InsertOrderedList' : oCommand = new FCKListCommand( 'insertorderedlist' ) ; break ; 126 case 'InsertUnorderedList' : oCommand = new FCKListCommand( 'insertunorderedlist' ) ; break ; 118 127 case 'ShowBlocks' : oCommand = new FCKShowBlockCommand( 'ShowBlocks', FCKConfig.StartupShowBlocks ? FCK_TRISTATE_ON : FCK_TRISTATE_OFF ) ; break ; 119 128 -
FCKeditor/trunk/editor/_source/internals/fckdomtools.js
r771 r774 24 24 var FCKDomTools = 25 25 { 26 MoveChildren : function( source, target )26 MoveChildren : function( source, target, toTargetStart ) 27 27 { 28 28 if ( source == target ) … … 30 30 31 31 var eChild ; 32 while ( (eChild = source.firstChild) ) 33 target.appendChild( source.removeChild( eChild ) ) ; 32 33 if ( toTargetStart ) 34 { 35 while ( (eChild = source.lastChild) ) 36 target.insertBefore( source.removeChild( eChild ), target.firstChild ) ; 37 } 38 else 39 { 40 while ( (eChild = source.firstChild) ) 41 target.appendChild( source.removeChild( eChild ) ) ; 42 } 43 }, 44 45 MoveNode : function( source, target, toTargetStart ) 46 { 47 if ( toTargetStart ) 48 target.insertBefore( FCKDomTools.RemoveNode( source ), target.firstChild ) ; 49 else 50 target.appendChild( FCKDomTools.RemoveNode( source ) ) ; 34 51 }, 35 52 … … 228 245 GetNextSourceElement : function( currentNode, ignoreSpaceTextOnly, stopSearchElements, ignoreElements ) 229 246 { 247 while( ( currentNode = this.GetNextSourceNode( currentNode ) ) ) // Only one "=". 248 { 249 if ( currentNode.nodeType == 1 ) 250 { 251 if ( stopSearchElements && currentNode.nodeName.IEquals( stopSearchElements ) ) 252 break ; 253 254 if ( !ignoreElements || !currentNode.nodeName.IEquals( ignoreElements ) ) 255 return currentNode ; 256 } 257 else if ( ignoreSpaceTextOnly && currentNode.nodeType == 3 && currentNode.nodeValue.RTrim().length > 0 ) 258 break ; 259 } 260 261 return null ; 262 }, 263 264 /* 265 * Get the next DOM node available in source order. 266 */ 267 GetNextSourceNode : function( currentNode, startFromSibling, nodeType ) 268 { 230 269 if ( !currentNode ) 231 270 return null ; 232 271 233 if ( currentNode.nextSibling ) 234 currentNode = currentNode.nextSibling ; 235 else 236 return this.GetNextSourceElement( currentNode.parentNode, ignoreSpaceTextOnly, stopSearchElements, ignoreElements ) ; 237 238 while ( currentNode ) 239 { 240 if ( currentNode.nodeType == 1 ) 241 { 242 if ( stopSearchElements && currentNode.nodeName.IEquals( stopSearchElements ) ) 243 break ; 244 245 if ( !ignoreElements || !currentNode.nodeName.IEquals( ignoreElements ) ) 246 return currentNode ; 247 } 248 else if ( ignoreSpaceTextOnly && currentNode.nodeType == 3 && currentNode.nodeValue.RTrim().length > 0 ) 249 break ; 250 251 if ( currentNode.firstChild ) 252 currentNode = currentNode.firstChild ; 253 else 254 return this.GetNextSourceElement( currentNode, ignoreSpaceTextOnly, stopSearchElements, ignoreElements ) ; 255 } 256 257 return null ; 272 var nextNode ; 273 274 if ( !startFromSibling && currentNode.firstChild ) 275 nextNode = currentNode.firstChild ; 276 else 277 nextNode = ( currentNode.nextSibling || this.GetNextSourceNode( currentNode.parentNode, true, nodeType ) ) ; 278 279 if ( nodeType && nextNode && nextNode.nodeType != nodeType ) 280 return this.GetNextSourceNode( nextNode, false, nodeType ) ; 281 282 return nextNode ; 258 283 }, 259 284 … … 307 332 FCKTools.AppendBogusBr( node ) ; 308 333 this.PaddingNode = node ; 309 if ( doc.body.childNodes.length == 1 334 if ( doc.body.childNodes.length == 1 310 335 && doc.body.firstChild.nodeType == 1 311 336 && doc.body.firstChild.tagName.toLowerCase() == 'br' … … 326 351 if ( paddingNode.parentNode != doc.body 327 352 || paddingNode.tagName.toLowerCase() != tagName 328 || ( paddingNode.childNodes.length > 1 ) 329 || ( paddingNode.firstChild && paddingNode.firstChild.nodeValue != '\xa0' 353 || ( paddingNode.childNodes.length > 1 ) 354 || ( paddingNode.firstChild && paddingNode.firstChild.nodeValue != '\xa0' 330 355 && String(paddingNode.firstChild.tagName).toLowerCase() != 'br' ) ) 331 356 { … … 341 366 this.PaddingNode = null ; 342 367 } 368 }, 369 370 HasAttribute : function( element, attributeName ) 371 { 372 if ( element.hasAttribute ) 373 return element.hasAttribute( attributeName ) ; 374 else 375 { 376 var att = element.attributes[ attributeName ] ; 377 return ( att != undefined && att.specified ) ; 378 } 379 }, 380 381 /** 382 * Checks if an element has "specified" attributes. 383 */ 384 HasAttributes : function( element ) 385 { 386 var attributes = element.attributes ; 387 388 for ( var i = 0 ; i < attributes.length ; i++ ) 389 { 390 if ( attributes[i].specified ) 391 return true ; 392 } 393 394 return false ; 395 }, 396 397 /** 398 * Remove an attribute from an element. 399 */ 400 RemoveAttribute : function( element, attributeName ) 401 { 402 if ( FCKBrowserInfo.IsIE && attributeName.toLowerCase() == 'class' ) 403 attributeName = 'className' ; 404 405 return element.removeAttribute( attributeName ) ; 406 }, 407 408 409 GetAttributeValue : function( element, att ) 410 { 411 var attName = att ; 412 413 if ( typeof att == 'string' ) 414 att = element.attributes[ att ] ; 415 else 416 attName = att.nodeName ; 417 418 if ( att && att.specified ) 419 { 420 // IE returns "null" for the nodeValue of a "style" attribute. 421 if ( attName == 'style' ) 422 return element.style.cssText ; 423 // There are two cases when the nodeValue must be used: 424 // - for the "class" attribute (all browsers). 425 // - for events attributes (IE only). 426 else if ( attName == 'class' || attName.indexOf('on') == 0 ) 427 return att.nodeValue ; 428 else 429 { 430 // Use getAttribute to get its value exactly as it is 431 // defined. 432 return element.getAttribute( attName, 2 ) ; 433 } 434 } 435 return null ; 436 }, 437 438 /** 439 * Checks whether one element contains the other. 440 */ 441 Contains : function( mainElement, otherElement ) 442 { 443 if ( mainElement.contains ) 444 return mainElement.contains( otherElement ) ; 445 446 while ( ( otherElement = otherElement.parentNode ) ) // Only one "=" 447 { 448 if ( otherElement == mainElement ) 449 return true ; 450 } 451 return false ; 452 }, 453 454 /** 455 * Breaks a parent element in the position of one of its contained elements. 456 * For example, in the following case: 457 * <b>This <i>is some<span /> sample</i> test text</b> 458 * If element = <span />, we have these results: 459 * <b>This <i>is some</i><span /><i> sample</i> test text</b> (If parent = <i>) 460 * <b>This <i>is some</i></b><span /><b<i> sample</i> test text</b> (If parent = <b>) 461 */ 462 BreakParent : function( element, parent, reusableRange ) 463 { 464 var range = reusableRange || new FCKDomRange( FCKTools.GetElementWindow( element ) ) ; 465 466 // We'll be extracting part of this element, so let's use our 467 // range to get the correct piece. 468 range.SetStart( element, 4 ) ; 469 range.SetEnd( parent, 4 ) ; 470 471 // Extract it. 472 var docFrag = range.ExtractContents() ; 473 474 // Move the element outside the broken element. 475 range.InsertNode( element.parentNode.removeChild( element ) ) ; 476 477 // Re-insert the extracted piece after the element. 478 docFrag.InsertAfterNode( element ) ; 479 480 range.Release( !!reusableRange ) ; 343 481 } 344 482 } ; -
FCKeditor/trunk/editor/_source/internals/fck_gecko.js
r742 r774 350 350 html = FCK.ProtectTags( html ) ; 351 351 352 // Firefox can't handle correctly the editing of the STRONG and EM tags.353 // We must replace them with B and I.354 html = html.replace( FCKRegexLib.StrongOpener, '<b$1' ) ;355 html = html.replace( FCKRegexLib.StrongCloser, '<\/b>' ) ;356 html = html.replace( FCKRegexLib.EmOpener, '<i$1' ) ;357 html = html.replace( FCKRegexLib.EmCloser, '<\/i>' ) ;358 359 352 // Save an undo snapshot first. 360 353 FCKUndo.SaveUndoStep() ; -
FCKeditor/trunk/editor/_source/internals/fck.js
r756 r774 361 361 data = FCK.ProtectTags( data ) ; 362 362 363 // Firefox can't handle correctly the editing of the STRONG and EM tags.364 // We must replace them with B and I.365 // TODO : remove this check if possible, as soon as the new style system is in use.366 if ( FCKBrowserInfo.IsGecko )367 {368 data = data.replace( FCKRegexLib.StrongOpener, '<b$1' ) ;369 data = data.replace( FCKRegexLib.StrongCloser, '<\/b>' ) ;370 data = data.replace( FCKRegexLib.EmOpener, '<i$1' ) ;371 data = data.replace( FCKRegexLib.EmCloser, '<\/i>' ) ;372 }373 374 363 // Insert the base tag (FCKConfig.BaseHref), if not exists in the source. 375 364 // The base must be the first tag in the HEAD, to get relative … … 737 726 } ; 738 727 739 FCK.Events = new FCKEvents( FCK ) ;728 FCK.Events = new FCKEvents( FCK ) ; 740 729 741 730 // DEPRECATED in favor or "GetData". -
FCKeditor/trunk/editor/_source/internals/fcklistslib.js
r719 r774 37 37 InlineChildReqElements : { abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1 }, 38 38 39 // Inline elements which are not marked as empty "Empty" in the XHTML DTD. 40 InlineNonEmptyElements : { a:1,abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1 }, 41 39 42 // Elements marked as empty "Empty" in the XHTML DTD. 40 43 EmptyElements : { base:1,meta:1,link:1,hr:1,br:1,param:1,img:1,area:1,input:1 }, 41 44 42 45 // Elements that may be considered the "Block boundary" in an element path. 43 46 PathBlockElements : { address:1,blockquote:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,ol:1,ul:1,li:1,dt:1,de:1 }, 44 47 45 48 // Elements that may be considered the "Block limit" in an element path. 46 49 PathBlockLimitElements : { body:1,td:1,th:1,caption:1,form:1 }, 47 50 48 // Final setup of FCKListsLib once the editor is loaded (at FCK.StartEditor). 51 // Block elements for the Styles System. 52 StyleBlockElements : { address:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1 }, 53 54 // Object elements for the Styles System. 55 StyleObjectElements : { img:1,hr:1,li:1,table:1,tr:1,td:1,embed:1,object:1,ol:1,ul:1 }, 56 57 // Final setup of FCKListsLib once the editor is loaded (at FCK.StartEditor). 49 58 // TODO: For v3, there should be a generic way to register to the editor 50 59 // startup event, so this function would not be needed to be defined here, not … … 54 63 // <div> is considered a block element only if EnterMode=div, otherwise it is a block limit. 55 64 if ( FCKConfig.EnterMode == 'div' ) 65 { 56 66 this.PathBlockElements.div = 1 ; 67 this.StyleBlockElements.div = 1 ; 68 } 57 69 else 58 70 this.PathBlockLimitElements.div = 1 ; -
FCKeditor/trunk/editor/_source/internals/fckregexlib.js
r706 r774 68 68 TagBody : /></ , 69 69 70 StrongOpener : /<STRONG([ \>])/gi ,71 StrongCloser : /<\/STRONG>/gi ,72 EmOpener : /<EM([ \>])/gi ,73 EmCloser : /<\/EM>/gi ,74 75 70 GeckoEntitiesMarker : /#\?-\:/g , 76 71 … … 92 87 93 88 // [a-zA-Z0-9:]+ seams to be more efficient than [\w:]+ 94 InvalidSelfCloseTags : /(<(?!base|meta|link|hr|br|param|img|area|input)([a-zA-Z0-9:]+)[^>]*)\/>/gi 89 InvalidSelfCloseTags : /(<(?!base|meta|link|hr|br|param|img|area|input)([a-zA-Z0-9:]+)[^>]*)\/>/gi, 90 91 // All variables defined in a style attribute or style definition. The variable 92 // name is returned with $2. 93 StyleVariableAttName : /#\(\s*("|')(.+?)\1[^\)]*\s*\)/g 95 94 } ; -
FCKeditor/trunk/editor/_source/internals/fckselection_gecko.js
r667 r774 25 25 FCKSelection.GetType = function() 26 26 { 27 // if ( ! this._Type ) 28 // { 29 // By default set the type to "Text". 30 this._Type = 'Text' ; 31 32 // Check if the actual selection is a Control (IMG, TABLE, HR, etc...). 33 var oSel ; 34 try { oSel = FCK.EditorWindow.getSelection() ; } 35 catch (e) {} 36 37 if ( oSel && oSel.rangeCount == 1 ) 27 // By default set the type to "Text". 28 var type = 'Text' ; 29 30 // Check if the actual selection is a Control (IMG, TABLE, HR, etc...). 31 32 var sel ; 33 try { sel = FCK.EditorWindow.getSelection() ; } catch (e) {} 34 35 if ( sel && sel.rangeCount == 1 ) 36 { 37 var range = sel.getRangeAt(0) ; 38 if ( range.startContainer == range.endContainer 39 && ( range.endOffset - range.startOffset ) == 1 40 && range.startContainer.nodeType == 1 41 && FCKListsLib.StyleObjectElements[ range.startContainer.childNodes[ range.startOffset ].nodeName.toLowerCase() ] ) 38 42 { 39 var oRange = oSel.getRangeAt(0) ; 40 if ( oRange.startContainer == oRange.endContainer && (oRange.endOffset - oRange.startOffset) == 1 && oRange.startContainer.nodeType != Node.TEXT_NODE ) 41 this._Type = 'Control' ; 43 type = 'Control' ; 42 44 } 43 // } 44 return this._Type ; 45 } 46 47 return type ; 45 48 } 46 49 … … 52 55 { 53 56 var oSel = FCK.EditorWindow.getSelection() ; 54 return oSel.anchorNode.childNodes[ oSel.anchorOffset ] ; 57 58 // For Safari, the anchor node for a control selection is the control 59 // itself, which seams logic. FF and Opera use the parent as the anchor 60 // node, pointing to the control with the offset. 61 // As FF created the selection "standard", Safari would do better by 62 // following their steps. 63 if ( FCKBrowserInfo.IsSafari ) 64 return oSel.anchorNode ; 65 else 66 return oSel.anchorNode.childNodes[ oSel.anchorOffset ] ; 55 67 } 56 68 return null ; … … 67 79 { 68 80 // make the common case fast - for collapsed/nearly collapsed selections just return anchor.parent. 69 if ( oSel.anchorNode == oSel.focusNode && oSel.anchorNode != null)81 if ( oSel.anchorNode && oSel.anchorNode == oSel.focusNode ) 70 82 return oSel.anchorNode.parentNode ; 71 83 72 84 // looks like we're having a large selection here. To make the behavior same as IE's TextRange.parentElement(), 73 85 // we need to find the nearest ancestor node which encapsulates both the beginning and the end of the selection. 86 // TODO: A simpler logic can be found. 74 87 var anchorPath = new FCKElementPath( oSel.anchorNode ) ; 75 var focusPath = new FCKElementPath( oSel.focusNode ) ; 88 var focusPath = new FCKElementPath( oSel.focusNode ) ; 76 89 var deepPath = null ; 77 90 var shallowPath = null ; … … 86 99 shallowPath = anchorPath.Elements ; 87 100 } 88 101 89 102 var deepPathBase = deepPath.length - shallowPath.length ; 90 103 for( var i = 0 ; i < shallowPath.length ; i++) … … 99 112 } 100 113 114 FCKSelection.GetBoundaryParentElement = function( startBoundary ) 115 { 116 if ( this.GetType() == 'Control' ) 117 return FCKSelection.GetSelectedElement().parentNode ; 118 else 119 { 120 var oSel = FCK.EditorWindow.getSelection() ; 121 if ( oSel && oSel.rangeCount > 0 ) 122 { 123 var range = oSel.getRangeAt( startBoundary ? 0 : ( oSel.rangeCount - 1 ) ) ; 124 125 var element = startBoundary ? range.startContainer : range.endContainer ; 126 127 // Firefox has a strange selection system which diverts from IE, 128 // Safari and Opera. If the start of the selection ends in the left 129 // boundary of an element, it is placed outside the element. All 130 // other browsers place it inside of it. So, the following code is 131 // needed to fix it. 132 if ( element.nodeType == 3 133 && startBoundary 134 && range.startOffset >= element.length ) 135 { 136 var nextText = element ; 137 while ( nextText ) 138 { 139 nextText = FCKDomTools.GetNextSourceNode( nextText, false, 3 ) ; 140 141 if ( nextText && nextText.length > 0 ) 142 break ; 143 } 144 element = nextText || element ; 145 } 146 147 return ( element.nodeType == 1 ? element : element.parentNode ) ; 148 } 149 } 150 return null ; 151 } 152 101 153 FCKSelection.SelectNode = function( element ) 102 154 { 103 // FCK.Focus() ;104 105 155 var oRange = FCK.EditorDocument.createRange() ; 106 156 oRange.selectNode( element ) ; -
FCKeditor/trunk/editor/_source/internals/fckselection_ie.js
r668 r774 64 64 case 'Control' : 65 65 var el = FCKSelection.GetSelectedElement() ; 66 if ( !el ) 67 return null ; 68 return el.parentElement ; 66 return el ? el.parentElement : null ; 69 67 70 68 case 'None' : … … 73 71 default : 74 72 return FCK.EditorDocument.selection.createRange().parentElement() ; 73 } 74 } ; 75 76 FCKSelection.GetBoundaryParentElement = function( startBoundary ) 77 { 78 switch ( this.GetType() ) 79 { 80 case 'Control' : 81 var el = FCKSelection.GetSelectedElement() ; 82 return el ? el.parentElement : null ; 83 84 case 'None' : 85 return null ; 86 87 default : 88 var range = FCK.EditorDocument.selection.createRange() ; 89 range.collapse( startBoundary !== false ) ; 90 return range.parentElement() ; 75 91 } 76 92 } ; -
FCKeditor/trunk/editor/_source/internals/fcktools.js
r771 r774 519 519 domNode.style[i] = styleDict[ i ] ; 520 520 } 521 522 /** 523 * Merge all objects passed by argument into a single object. 524 */ 525 FCKTools.Merge = function() 526 { 527 var args = arguments ; 528 var o = args[0] ; 529 530 for ( var i = 1 ; i < args.length ; i++ ) 531 { 532 var arg = args[i] ; 533 for ( var p in arg ) 534 o[p] = arg[p] ; 535 } 536 537 return o ; 538 } 539 540 /** 541 * Check if the passed argument is a real Array. It may not working when 542 * calling it cross windows. 543 */ 544 FCKTools.IsArray = function( it ) 545 { 546 return ( it instanceof Array ) ; 547 } 548 549 /** 550 * Appends a "length" property to an object, containing the number of 551 * properties available on it, excluded the append property itself. 552 */ 553 FCKTools.AppendLengthProperty = function( targetObject, propertyName ) 554 { 555 var counter = 0 ; 556 557 for ( var n in targetObject ) 558 counter++ ; 559 560 return targetObject[ propertyName || 'length' ] = counter ; 561 } 562 563 /** 564 * Gets the browser parsed version of a css text (style attribute value). On 565 * some cases, the browser makes changes to the css text, returning a different 566 * value. For example, hexadecimal colors get transformed to rgb(). 567 */ 568 FCKTools.NormalizeCssText = function( unparsedCssText ) 569 { 570 // Injects the style in a temporary span object, so the browser parses it, 571 // retrieving its final format. 572 var tempSpan = document.createElement( 'span' ) ; 573 tempSpan.style.cssText = unparsedCssText ; 574 return tempSpan.style.cssText ; 575 } -
FCKeditor/trunk/editor/_source/internals/fckxhtml.js
r755 r774 38 38 var bIsDirty = FCK.IsDirty() ; 39 39 40 this._CreateNode = FCKConfig.ForceStrongEm ? FCKXHtml_CreateNode_StrongEm : FCKXHtml_CreateNode_Normal ;41 42 40 // Special blocks are blocks of content that remain untouched during the 43 41 // process. It is used for SCRIPTs and STYLEs. … … 51 49 52 50 FCKXHtml.CurrentJobNum++ ; 51 52 // var dTimer = new Date() ; 53 53 54 54 if ( includeNode ) … … 59 59 // Get the resulting XHTML as a string. 60 60 var sXHTML = this._GetMainXmlString() ; 61 62 // alert( 'Time: ' + ( ( ( new Date() ) - dTimer ) ) + ' ms' ) ; 61 63 62 64 this.XML = null ; … … 232 234 return false ; 233 235 234 var oNode = this. _CreateNode( sNodeName ) ;235 236 var oNode = this.XML.createElement( sNodeName ) ; 237 236 238 // Add all attributes. 237 239 FCKXHtml._AppendAttributes( xmlNode, htmlNode, oNode, sNodeName ) ; … … 279 281 } 280 282 281 function FCKXHtml_CreateNode_StrongEm( nodeName )282 {283 switch ( nodeName )284 {285 case 'b' :286 nodeName = 'strong' ;287 break ;288 case 'i' :289 nodeName = 'em' ;290 break ;291 }292 return this.XML.createElement( nodeName ) ;293 }294 295 function FCKXHtml_CreateNode_Normal( nodeName )296 {297 return this.XML.createElement( nodeName ) ;298 }299 300 283 // Append an item to the SpecialBlocks array and returns the tag to be used. 301 284 FCKXHtml._AppendSpecialItem = function( item ) -
FCKeditor/trunk/fckconfig.js
r729 r774 74 74 FCKConfig.FormatIndentator = ' ' ; 75 75 76 FCKConfig.ForceStrongEm = true ;77 76 FCKConfig.GeckoUseSPAN = false ; 78 77 FCKConfig.StartupFocus = false ; … … 109 108 ['Style','FontFormat','FontName','FontSize'], 110 109 ['TextColor','BGColor'], 111 ['FitWindow','ShowBlocks','-','About'] 110 ['FitWindow','ShowBlocks','-','About'] // No comma for the last row. 112 111 ] ; 113 112 … … 146 145 FCKConfig.FontColors = '000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,808080,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF' ; 147 146 147 FCKConfig.FontFormats = 'p;div;pre;address;h1;h2;h3;h4;h5;h6' ; 148 148 FCKConfig.FontNames = 'Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana' ; 149 FCKConfig.FontSizes = '1/xx-small;2/x-small;3/small;4/medium;5/large;6/x-large;7/xx-large' ; 150 FCKConfig.FontFormats = 'p;div;pre;address;h1;h2;h3;h4;h5;h6' ; 149 FCKConfig.FontSizes = 'smaller;larger;xx-small;x-small;small;medium;large;x-large;xx-large' ; 151 150 152 151 FCKConfig.StylesXmlPath = FCKConfig.EditorPath + 'fckstyles.xml' ; … … 186 185 // The option switches between trying to keep the html structure or do the changes so the content looks like it was in Word 187 186 FCKConfig.CleanWordKeepsStructure = false ; 187 188 // Only inline elements are valid. 189 FCKConfig.RemoveFormatTags = 'b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var' ; 190 191 FCKConfig.CustomStyles = 192 { 193 'Red Title' : { Element : 'h3', Styles : { 'color' : 'Red' } } 194 }; 195 196 // Do not add, rename or remove styles here. Only apply definition changes. 197 FCKConfig.CoreStyles = 198 { 199 // Basic Inline Styles. 200 'Bold' : { Element : 'b', Overrides : 'strong' }, 201 'Italic' : { Element : 'i', Overrides : 'em' }, 202 'Underline' : { Element : 'u' }, 203 'StrikeThrough' : { Element : 'strike' }, 204 'Subscript' : { Element : 'sub' }, 205 'Superscript' : { Element : 'sup' }, 206 207 // Basic Block Styles (Font Format Combo). 208 'p' : { Element : 'p' }, 209 'div' : { Element : 'div' }, 210 'pre' : { Element : 'pre' }, 211 'address' : { Element : 'address' }, 212 'h1' : { Element : 'h1' }, 213 'h2' : { Element : 'h2' }, 214 'h3' : { Element : 'h3' }, 215 'h4' : { Element : 'h4' }, 216 'h5' : { Element : 'h5' }, 217 'h6' : { Element : 'h6' }, 218 219 // Other formatting features. 220 'FontFace' : 221 { 222 Element : 'span', 223 Styles : { 'font-family' : '#("Font")' }, 224 Overrides : [ { Element : 'font', Attributes : { 'face' : null } } ] 225 }, 226 227 'Size' : 228 { 229 Element : 'span', 230 Styles : { 'font-size' : '#("Size","fontSize")' }, 231 Overrides : [ { Element : 'font', Attributes : { 'size' : null } } ] 232 }, 233 234 'Color' : 235 { 236 Element : 'span', 237 Styles : { 'color' : '#("Color","color")' }, 238 Overrides : [ { Element : 'font', Attributes : { 'color' : null } } ] 239 }, 240 241 'BackColor' : { Element : 'span', Styles : { 'background-color' : '#("Color","color")' } } 242 }; 188 243 189 244 // The following value defines which File Browser connector and Quick Upload -
FCKeditor/trunk/fckeditor.cfc
r735 r774 211 211 lConfigKeys = lConfigKeys & ",PreloadImages,PluginsPath,AutoDetectLanguage,DefaultLanguage,ContentLangDirection"; 212 212 lConfigKeys = lConfigKeys & ",ProcessHTMLEntities,IncludeLatinEntities,IncludeGreekEntities,ProcessNumericEntities,AdditionalNumericEntities"; 213 lConfigKeys = lConfigKeys & ",FillEmptyBlocks,FormatSource,FormatOutput,FormatIndentator ,ForceStrongEm";213 lConfigKeys = lConfigKeys & ",FillEmptyBlocks,FormatSource,FormatOutput,FormatIndentator"; 214 214 lConfigKeys = lConfigKeys & ",GeckoUseSPAN,StartupFocus,ForcePasteAsPlainText,AutoDetectPasteFromWord,ForceSimpleAmpersand"; 215 215 lConfigKeys = lConfigKeys & ",TabSpaces,ShowBorders,SourcePopup,ToolbarStartExpanded,ToolbarCanCollapse"; -
FCKeditor/trunk/fckeditor.cfm
r729 r774 122 122 lConfigKeys = lConfigKeys & ",PreloadImages,PluginsPath,AutoDetectLanguage,DefaultLanguage,ContentLangDirection"; 123 123 lConfigKeys = lConfigKeys & ",ProcessHTMLEntities,IncludeLatinEntities,IncludeGreekEntities,ProcessNumericEntities,AdditionalNumericEntities"; 124 lConfigKeys = lConfigKeys & ",FillEmptyBlocks,FormatSource,FormatOutput,FormatIndentator ,ForceStrongEm";124 lConfigKeys = lConfigKeys & ",FillEmptyBlocks,FormatSource,FormatOutput,FormatIndentator"; 125 125 lConfigKeys = lConfigKeys & ",GeckoUseSPAN,StartupFocus,ForcePasteAsPlainText,AutoDetectPasteFromWord,ForceSimpleAmpersand"; 126 126 lConfigKeys = lConfigKeys & ",TabSpaces,ShowBorders,SourcePopup,ToolbarStartExpanded,ToolbarCanCollapse"; -
FCKeditor/trunk/fckpackager.xml
r701 r774 63 63 <Constant name="FCK_EDITMODE_WYSIWYG" value="0" /> 64 64 <Constant name="FCK_EDITMODE_SOURCE" value="1" /> 65 <Constant name="FCK_STYLE_BLOCK" value="0" /> 66 <Constant name="FCK_STYLE_INLINE" value="1" /> 67 <Constant name="FCK_STYLE_OBJECT" value="2" /> 65 68 </Constants> 66 69 <PackageFile path="editor/js/fckeditorcode_ie.js"> … … 93 96 <File path="editor/_source/classes/fckkeystrokehandler.js" /> 94 97 98 <File path="editor/dtd/fck_xhtml10transitional.js" /> 99 <File path="editor/_source/classes/fckstyle.js" /> 100 <File path="editor/_source/internals/fckstyles.js" /> 101 95 102 <File path="editor/_source/internals/fcklisthandler.js" /> 96 103 <File path="editor/_source/classes/fckelementpath.js" /> … … 108 115 <File path="editor/_source/internals/fcktablehandler_ie.js" /> 109 116 <File path="editor/_source/classes/fckxml_ie.js" /> 110 <File path="editor/_source/classes/fckstyledef.js" />111 <File path="editor/_source/classes/fckstyledef_ie.js" />112 <File path="editor/_source/classes/fckstylesloader.js" />113 117 114 118 <File path="editor/_source/commandclasses/fcknamedcommand.js" /> 119 <File path="editor/_source/commandclasses/fckstylecommand.js" /> 115 120 <File path="editor/_source/commandclasses/fck_othercommands.js" /> 116 121 <File path="editor/_source/commandclasses/fckshowblocks.js" /> … … 120 125 <File path="editor/_source/commandclasses/fckpastewordcommand.js" /> 121 126 <File path="editor/_source/commandclasses/fcktablecommand.js" /> 122 <File path="editor/_source/commandclasses/fckstylecommand.js" />123 127 <File path="editor/_source/commandclasses/fckfitwindow.js" /> 124 128 <File path="editor/_source/commandclasses/fcklistcommands.js" /> 129 <File path="editor/_source/commandclasses/fckcorestylecommand.js" /> 130 <File path="editor/_source/commandclasses/fckremoveformatcommand.js" /> 125 131 <File path="editor/_source/internals/fckcommands.js" /> 126 132 … … 131 137 <File path="editor/_source/classes/fckspecialcombo.js" /> 132 138 <File path="editor/_source/classes/fcktoolbarspecialcombo.js" /> 139 <File path="editor/_source/classes/fcktoolbarstylecombo.js" /> 140 <File path="editor/_source/classes/fcktoolbarfontformatcombo.js" /> 133 141 <File path="editor/_source/classes/fcktoolbarfontscombo.js" /> 134 142 <File path="editor/_source/classes/fcktoolbarfontsizecombo.js" /> 135 <File path="editor/_source/classes/fcktoolbarfontformatcombo.js" />136 <File path="editor/_source/classes/fcktoolbarstylecombo.js" />137 143 <File path="editor/_source/classes/fcktoolbarpanelbutton.js" /> 138 144 <File path="editor/_source/internals/fcktoolbaritems.js" /> … … 181 187 <File path="editor/_source/classes/fckkeystrokehandler.js" /> 182 188 189 <File path="editor/dtd/fck_xhtml10transitional.js" /> 190 <File path="editor/_source/classes/fckstyle.js" /> 191 <File path="editor/_source/internals/fckstyles.js" /> 192 183 193 <File path="editor/_source/internals/fcklisthandler.js" /> 184 194 <File path="editor/_source/classes/fckelementpath.js" /> … … 196 206 <File path="editor/_source/internals/fcktablehandler_gecko.js" /> 197 207 <File path="editor/_source/classes/fckxml_gecko.js" /> 198 <File path="editor/_source/classes/fckstyledef.js" />199 <File path="editor/_source/classes/fckstyledef_gecko.js" />200 <File path="editor/_source/classes/fckstylesloader.js" />201 208 202 209 <File path="editor/_source/commandclasses/fcknamedcommand.js" /> 210 <File path="editor/_source/commandclasses/fckstylecommand.js" /> 203 211 <File path="editor/_source/commandclasses/fck_othercommands.js" /> 204 212 <File path="editor/_source/commandclasses/fckshowblocks.js" /> … … 208 216 <File path="editor/_source/commandclasses/fckpastewordcommand.js" /> 209 217 <File path="editor/_source/commandclasses/fcktablecommand.js" /> 210 <File path="editor/_source/commandclasses/fckstylecommand.js" />211 218 <File path="editor/_source/commandclasses/fckfitwindow.js" /> 212 219 <File path="editor/_source/commandclasses/fcklistcommands.js" /> 220 <File path="editor/_source/commandclasses/fckcorestylecommand.js" /> 221 <File path="editor/_source/commandclasses/fckremoveformatcommand.js" /> 213 222 <File path="editor/_source/internals/fckcommands.js" /> 214 223 … … 219 228 <File path="editor/_source/classes/fckspecialcombo.js" /> 220 229 <File path="editor/_source/classes/fcktoolbarspecialcombo.js" /> 230 <File path="editor/_source/classes/fcktoolbarstylecombo.js" /> 231 <File path="editor/_source/classes/fcktoolbarfontformatcombo.js" /> 221 232 <File path="editor/_source/classes/fcktoolbarfontscombo.js" /> 222 233 <File path="editor/_source/classes/fcktoolbarfontsizecombo.js" /> 223 <File path="editor/_source/classes/fcktoolbarfontformatcombo.js" />224 <File path="editor/_source/classes/fcktoolbarstylecombo.js" />225 234 <File path="editor/_source/classes/fcktoolbarpanelbutton.js" /> 226 235 <File path="editor/_source/internals/fcktoolbaritems.js" /> -
FCKeditor/trunk/fckstyles.xml
r132 r774 26 26 --> 27 27 <Styles> 28 29 <!-- Block Styles --> 30 31 <!-- 32 # These styles are already available in the "Format" combo, so they are not 33 # needed here by default. 34 35 <Style name="Heading 1" element="h1" /> 36 <Style name="Heading 2" element="h2" /> 37 <Style name="Heading 3" element="h3" /> 38 <Style name="Heading 4" element="h4" /> 39 <Style name="Heading 5" element="h5" /> 40 <Style name="Heading 6" element="h6" /> 41 <Style name="Paragraph" element="p" /> 42 <Style name="Document Block" element="div" /> 43 <Style name="Preformatted Text" element="pre" /> 44 <Style name="Address" element="address" /> 45 --> 46 47 <!-- Inline Styles --> 48 49 <!-- 50 # These are core styles available as toolbar buttons. 51 52 <Style name="Bold" element="b" /> 53 <Style name="Italic" element="i" /> 54 <Style name="Underline" element="u" /> 55 <Style name="Strikethrough" element="strike" /> 56 <Style name="Subscript" element="sub" /> 57 <Style name="Superscript" element="sup" /> 58 --> 59 60 <Style name="Marker: Yellow" element="span"> 61 <Style name="background-color" value="Yellow" /> 62 </Style> 63 <Style name="Marker: Green" element="span"> 64 <Style name="background-color" value="Lime" /> 65 </Style> 66 67 <Style name="Strong Emphasis" element="strong" /> 68 <Style name="Emphasis" element="em" /> 69 70 <Style name="Big" element="big" /> 71 <Style name="Small" element="small" /> 72 <Style name="Typewriter" element="tt" /> 73 74 <Style name="Computer Code" element="code" /> 75 <Style name="Keyboard Phrase" element="kbd" /> 76 <Style name="Sample Text" element="samp" /> 77 <Style name="Variable" element="var" /> 78