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(''); 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 @@- + |
-
- You are in HTML mode. Use the [Source] button to switch back to WYSIWYG mode. - Please note that incorrect or invalid HTML may break the web site’s layout or produce undesirable results. - This mode should be utilized only by expert users. Intechnic Corporation assumes no responsibility for problems caused by incorrect modifications of the HTML code. - - + |
+ + | +
+ + | +