Index: trunk/admin/editor/cmseditor/editor/_source/internals/fck_2.js =================================================================== diff -u -r1528 -r1695 --- trunk/admin/editor/cmseditor/editor/_source/internals/fck_2.js (.../fck_2.js) (revision 1528) +++ trunk/admin/editor/cmseditor/editor/_source/internals/fck_2.js (.../fck_2.js) (revision 1695) @@ -124,21 +124,20 @@ FCK.Preview = function() { - oWindow = window.open(FCKConfig.project_path+'index.php?t='+FCKConfig.template_name, 'prewiev', 'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes') ; - - if ( FCKBrowserInfo.IsIE ) { - oWindow.attachEvent( "onload", FCK.SetPreview ) ; + if (typeof(FCKConfig.template_name) != 'undefined' && FCKConfig.template_name != '') + { + oWindow = window.open(FCKConfig.project_path+'index.php?t='+FCKConfig.template_name, 'prewiev', 'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes') ; + if ( FCKBrowserInfo.IsIE ) { + oWindow.attachEvent( "onload", FCK.SetPreview ) ; + } + else + oWindow.addEventListener( 'load', this.SetPreview, true ) ; + } else { + var oWindow = window.open( '', null, 'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes' ) ; + var sHTML = '' + FCK.GetHTML() + '' ; + oWindow.document.write( sHTML ); + oWindow.document.close(); } - else - oWindow.addEventListener( 'load', this.SetPreview, true ) ; -/* - var sHTML = '' + FCK.GetHTML() + '' ; - - oWindow.document.write( sHTML ); - oWindow.document.close(); - // TODO: The CSS of the editor area must be configurable. - // oWindow.document.createStyleSheet( config.EditorAreaCSS ); -*/ } FCK.SetPreview = function() Index: trunk/admin/editor/cmseditor/editor/dialog/fck_spellerpages/spellerpages/spellchecker.html =================================================================== diff -u -r1415 -r1695 --- trunk/admin/editor/cmseditor/editor/dialog/fck_spellerpages/spellerpages/spellchecker.html (.../spellchecker.html) (revision 1415) +++ trunk/admin/editor/cmseditor/editor/dialog/fck_spellerpages/spellerpages/spellchecker.html (.../spellchecker.html) (revision 1695) @@ -41,7 +41,7 @@ bodyDoc.write(''); if (opener) { var speller = opener.speller; - bodyDoc.write(''); + bodyDoc.write(''); bodyDoc.write('

' + window.parent.FCKLang.DlgSpellProgress + '

'); // by FredCK bodyDoc.write('
'); for( var i = 0; i < speller.textInputs.length; i++ ) { @@ -50,7 +50,7 @@ bodyDoc.write('
'); bodyDoc.write(''); } else { - bodyDoc.write(''); + bodyDoc.write(''); bodyDoc.write('

This page cannot be displayed

The window was not opened from another window.

'); bodyDoc.write(''); } Index: trunk/admin/editor/cmseditor/editor/_source/commandclasses/fckstylecommand.js =================================================================== diff -u -r1415 -r1695 --- trunk/admin/editor/cmseditor/editor/_source/commandclasses/fckstylecommand.js (.../fckstylecommand.js) (revision 1415) +++ trunk/admin/editor/cmseditor/editor/_source/commandclasses/fckstylecommand.js (.../fckstylecommand.js) (revision 1695) @@ -21,7 +21,6 @@ var FCKStyleCommand = function() { this.Name = 'Style' ; - // Load the Styles defined in the XML file. this.StylesLoader = new FCKStylesLoader() ; this.StylesLoader.Load( FCKConfig.StylesXmlPath ) ; @@ -30,6 +29,18 @@ FCKStyleCommand.prototype.Execute = function( styleName, styleComboItem ) { + if (styleName == "Clear Styles") + { + //alert(FCKSelection.GetParentElement()); + if (FCKBrowserInfo.IsIE) + { + var selected = FCKSelection.GetParentElement(); + RemoveStyles(selected.childNodes); + } else + FCK.ExecuteNamedCommand('RemoveFormat'); + return ; + } + if ( styleComboItem.Selected ) styleComboItem.Style.RemoveFromSelection() ; else @@ -40,14 +51,46 @@ FCK.Events.FireEvent( "OnSelectionChange" ) ; } + +function RemoveStyles(nodes) +{ + //alert(nodes.length); + if (nodes.length > 0) + { + for ( var i=nodes.length-1; i>=0; i--) + { + if (nodes[i].childNodes.length > 0) { + RemoveStyles(nodes[i].childNodes); + } else { + if (nodes[i].parentNode.tagName == 'SPAN' && nodes[i].parentNode.id == '') + nodes[i].parentNode.outerHTML = nodes[i].parentNode.innerHTML; + + } + } + } +} + + + +function show_props(obj, objName) { + var result = ""; + for (var i in obj) { + result = objName + "." + i + " = " + obj[i] + " \n"; + alert(result); + } + //return result; + } + + + FCKStyleCommand.prototype.GetState = function() { var oSelection = FCK.EditorDocument.selection ; - + if ( FCKSelection.GetType() == 'Control' ) { var e = FCKSelection.GetSelectedElement() ; - if ( e ) + if ( e ) return this.StylesLoader.StyleGroups[ e.tagName ] ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ; else FCK_TRISTATE_OFF ; @@ -64,28 +107,32 @@ this._CheckStyle( FCKSelection.GetSelectedElement(), aActiveStyles, false ) ; else this._CheckStyle( FCKSelection.GetParentElement(), aActiveStyles, true ) ; - + return aActiveStyles ; } + FCKStyleCommand.prototype._CheckStyle = function( element, targetArray, checkParent ) { if ( ! element ) return ; - + var style_exist = false; if ( element.nodeType == 1 ) { var aStyleGroup = this.StylesLoader.StyleGroups[ element.tagName ] ; if ( aStyleGroup ) { for ( var i = 0 ; i < aStyleGroup.length ; i++ ) { - if ( aStyleGroup[i].IsEqual( element ) ) + if ( aStyleGroup[i].IsEqual( element ) ) { targetArray[ targetArray.length ] = aStyleGroup[i] ; + } } } } + + if ( checkParent ) this._CheckStyle( element.parentNode, targetArray, checkParent ) ; } \ No newline at end of file Index: trunk/admin/editor/cmseditor/editor/_source/classes/fcktoolbarstylecombo.js =================================================================== diff -u -r1415 -r1695 --- trunk/admin/editor/cmseditor/editor/_source/classes/fcktoolbarstylecombo.js (.../fcktoolbarstylecombo.js) (revision 1415) +++ trunk/admin/editor/cmseditor/editor/_source/classes/fcktoolbarstylecombo.js (.../fcktoolbarstylecombo.js) (revision 1695) @@ -63,16 +63,19 @@ if ( aStyles.length > 0 ) { // Select the active styles in the combo. - for ( var i = 0 ; i < aStyles.length ; i++ ) + for ( var i = 0 ; i < aStyles.length ; i++ ) { targetSpecialCombo.SelectItem( aStyles[i].Name ) ; - + } // Set the combo label to the first style in the collection. targetSpecialCombo.SetLabelById( aStyles[0].Name ) ; } - else - targetSpecialCombo.SetLabel('') ; + else { + targetSpecialCombo.SetLabel(FCKConfig.DefaultClass) ; + } + } + FCKToolbarStyleCombo.prototype.RefreshVisibleItems = function( targetSpecialCombo ) { if ( FCKSelection.GetType() == 'Control' ) Index: trunk/admin/editor/cmseditor/editor/fckblank.html =================================================================== diff -u -r1415 -r1695 --- trunk/admin/editor/cmseditor/editor/fckblank.html (.../fckblank.html) (revision 1415) +++ trunk/admin/editor/cmseditor/editor/fckblank.html (.../fckblank.html) (revision 1695) @@ -1,4 +1,4 @@ - + \ No newline at end of file Index: trunk/admin/editor/cmseditor/editor/css/fck_editorarea.css =================================================================== diff -u -r1415 -r1695 --- trunk/admin/editor/cmseditor/editor/css/fck_editorarea.css (.../fck_editorarea.css) (revision 1415) +++ trunk/admin/editor/cmseditor/editor/css/fck_editorarea.css (.../fck_editorarea.css) (revision 1695) @@ -23,15 +23,6 @@ * Frederico Caldeira Knabben (fredck@fckeditor.net) */ -body -{ - font-family: Arial, Verdana, Sans-Serif; - font-size: 12px; - padding: 5px 5px 5px 5px; - margin: 0px; - border-style: none; - background-color: #ffffff; -} .Bold { Index: trunk/admin/editor/cmseditor/editor/fckeditor.html =================================================================== diff -u -r1540 -r1695 --- trunk/admin/editor/cmseditor/editor/fckeditor.html (.../fckeditor.html) (revision 1540) +++ trunk/admin/editor/cmseditor/editor/fckeditor.html (.../fckeditor.html) (revision 1695) @@ -1,28 +1,47 @@ - FCKeditor + + + + + + + + + + + + + + @@ -43,17 +62,12 @@
- +
Index: trunk/admin/editor/cmseditor/editor/_source/classes/fcktoolbarspecialcombo.js =================================================================== diff -u -r1415 -r1695 --- trunk/admin/editor/cmseditor/editor/_source/classes/fcktoolbarspecialcombo.js (.../fcktoolbarspecialcombo.js) (revision 1415) +++ trunk/admin/editor/cmseditor/editor/_source/classes/fcktoolbarspecialcombo.js (.../fcktoolbarspecialcombo.js) (revision 1695) @@ -33,6 +33,7 @@ FCKToolbarSpecialCombo.prototype.CreateInstance = function( parentToolbar ) { + this._Combo = new FCKSpecialCombo( this.GetLabel() ) ; this._Combo.FieldWidth = 100 ; this._Combo.PanelWidth = 150 ; @@ -52,53 +53,46 @@ FCKToolbarSpecialCombo.prototype.RefreshState = function() { - // Gets the actual state. +// Gets the actual state. var eState ; - // if ( FCK.EditMode == FCK_EDITMODE_SOURCE && ! this.SourceView ) // eState = FCK_TRISTATE_DISABLED ; // else // { - var sValue = this.Command.GetState() ; - - if ( sValue != FCK_TRISTATE_DISABLED ) - { - eState = FCK_TRISTATE_ON ; - - if ( !this.RefreshActiveItems ) + var sValue = this.Command.GetState() ; + if ( sValue != FCK_TRISTATE_DISABLED ) { - this.RefreshActiveItems = function( combo, value ) + eState = FCK_TRISTATE_ON ; + if ( !this.RefreshActiveItems ) { - this._Combo.DeselectAll() ; - this._Combo.SelectItem( value ) ; - this._Combo.SetLabelById( value ) ; + this.RefreshActiveItems = function( combo, value ) + { + this._Combo.DeselectAll() ; + this._Combo.SelectItem( value ) ; + this._Combo.SetLabelById( value ) ; + } } + this.RefreshActiveItems( this._Combo, sValue ) ; } - this.RefreshActiveItems( this._Combo, sValue ) ; + else + eState = FCK_TRISTATE_DISABLED ; + // If there are no state changes then do nothing and return. + if ( eState == this.State ) return ; + if ( eState == FCK_TRISTATE_DISABLED ) + { + this._Combo.DeselectAll() ; + this._Combo.SetLabel(FCKConfig.DefaultClass) ; } - else - eState = FCK_TRISTATE_DISABLED ; -// } + // Sets the actual state. + this.State = eState ; - // If there are no state changes then do nothing and return. - if ( eState == this.State ) return ; - - if ( eState == FCK_TRISTATE_DISABLED ) - { - this._Combo.DeselectAll() ; - this._Combo.SetLabel( '' ) ; - } - - // Sets the actual state. - this.State = eState ; - - // Updates the graphical state. - this._Combo.SetEnabled( eState != FCK_TRISTATE_DISABLED ) ; + // Updates the graphical state. + this._Combo.SetEnabled( eState != FCK_TRISTATE_DISABLED ) ; } FCKToolbarSpecialCombo.prototype.Enable = function() { - this.RefreshState() ; + this.RefreshState(); } FCKToolbarSpecialCombo.prototype.Disable = function() Index: trunk/admin/editor/cmseditor/editor/_source/internals/fckcommands.js =================================================================== diff -u -r1415 -r1695 --- trunk/admin/editor/cmseditor/editor/_source/internals/fckcommands.js (.../fckcommands.js) (revision 1415) +++ trunk/admin/editor/cmseditor/editor/_source/internals/fckcommands.js (.../fckcommands.js) (revision 1695) @@ -28,11 +28,14 @@ FCKCommands.GetCommand = function( commandName ) { - var oCommand = FCKCommands.LoadedCommands[ commandName ] ; + var oCommand = FCKCommands.LoadedCommands[ commandName ] ; + + if ( oCommand ) return oCommand ; + switch ( commandName ) { Index: trunk/admin/editor/cmseditor/editor/fckeditor.develop.html =================================================================== diff -u --- trunk/admin/editor/cmseditor/editor/fckeditor.develop.html (revision 0) +++ trunk/admin/editor/cmseditor/editor/fckeditor.develop.html (revision 1695) @@ -0,0 +1,75 @@ + + + + + FCKeditor + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+
+ +
+ + Index: trunk/admin/editor/cmseditor/editor/dialog/fck_spellerpages/spellerpages/spellerStyle.css =================================================================== diff -u -r1415 -r1695 --- trunk/admin/editor/cmseditor/editor/dialog/fck_spellerpages/spellerpages/spellerStyle.css (.../spellerStyle.css) (revision 1415) +++ trunk/admin/editor/cmseditor/editor/dialog/fck_spellerpages/spellerpages/spellerStyle.css (.../spellerStyle.css) (revision 1695) @@ -7,7 +7,7 @@ .normalLabel { font-size:8pt; } -.normalText { +.defaulttext { font-family:arial, helvetica, sans-serif; font-size:10pt; color:000000;