Index: trunk/admin/editor/cmseditor/editor/_source/classes/fcktoolbarstylecombo.js =================================================================== diff -u -r1697 -r1746 --- trunk/admin/editor/cmseditor/editor/_source/classes/fcktoolbarstylecombo.js (.../fcktoolbarstylecombo.js) (revision 1697) +++ trunk/admin/editor/cmseditor/editor/_source/classes/fcktoolbarstylecombo.js (.../fcktoolbarstylecombo.js) (revision 1746) @@ -70,8 +70,12 @@ targetSpecialCombo.SetLabelById( aStyles[0].Name ) ; } else { - targetSpecialCombo.SelectItem(FCKConfig.DefaultClass) ; - targetSpecialCombo.SetLabel(FCKConfig.DefaultClass) ; + if (typeof(FCKConfig.DefaultClass) != 'undefined') { + targetSpecialCombo.SelectItem() ; + targetSpecialCombo.SetLabel(FCKConfig.DefaultClass); + } else + targetSpecialCombo.SetLabel(' '); + } } Index: trunk/admin/editor/cmseditor/editor/js/fckeditorcode_ie_2.js =================================================================== diff -u -r1709 -r1746 --- trunk/admin/editor/cmseditor/editor/js/fckeditorcode_ie_2.js (.../fckeditorcode_ie_2.js) (revision 1709) +++ trunk/admin/editor/cmseditor/editor/js/fckeditorcode_ie_2.js (.../fckeditorcode_ie_2.js) (revision 1746) @@ -10,7 +10,7 @@ * * This file has been compacted for best loading performance. */ -FCK.RedirectNamedCommands=new Object();FCK.ExecuteNamedCommand=function(commandName,commandParameter){if (FCK.RedirectNamedCommands[commandName]!=null) {FCK.ExecuteRedirectedNamedCommand(commandName,commandParameter);}else{FCK.Focus();if (commandName=="Undo"){if (confirm("This will delete everything on this page. Are you sure?")) FCK.EditorDocument.execCommand(commandName,false,commandParameter);} else FCK.EditorDocument.execCommand(commandName,false,commandParameter);FCK.Events.FireEvent('OnSelectionChange');};};FCK.GetNamedCommandState=function(commandName){try{if (commandName=='InsertHorizontalRule') return FCK_TRISTATE_OFF;if (!FCK.EditorDocument.queryCommandEnabled(commandName)) return FCK_TRISTATE_DISABLED;else {switch (commandName){default:return FCK.EditorDocument.queryCommandState(commandName)?FCK_TRISTATE_ON:FCK_TRISTATE_OFF;};};}catch (e){return FCK_TRISTATE_OFF;};};FCK.GetNamedCommandValue=function(commandName){var sValue='';var eState=FCK.GetNamedCommandState(commandName);if (eState==FCK_TRISTATE_DISABLED) return null;try{sValue=this.EditorDocument.queryCommandValue(commandName);}catch(e) {};return sValue?sValue:'';};FCK.CleanAndPaste=function(html){html=html.replace(/<\/?SPAN[^>]*>/gi,"");html=html.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi,"<$1$3");html=html.replace(/<(\w[^>]*) style="([^"]*)"([^>]*)/gi,"<$1$3");html=html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi,"<$1$3");html=html.replace(/<\\?\?xml[^>]*>/gi,"");html=html.replace(/<\/?\w+:[^>]*>/gi,"");html=html.replace(/ /," ");var re=new RegExp("(]*>.*?)(<\/P>)","gi");html=html.replace(re,"");FCK.InsertHtml(html);};FCK.Preview=function(){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',FCK.SetPreview,true);return;}else {var oWindow_2=window.open('',null,'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');var sHTML=''+FCK.GetHTML()+'';oWindow_2.document.write(sHTML);oWindow_2.document.close();};};FCK.SetPreview=function(){oWindow.document.getElementById('block_'+FCKConfig.block_id).innerHTML=FCK.GetHTML();};FCK.SwitchEditMode=function(){var bWYSIWYG=(FCK.EditMode==FCK_EDITMODE_WYSIWYG);document.getElementById('eWysiwyg').style.display=bWYSIWYG?'none':'';document.getElementById('eSource').style.display=bWYSIWYG?'':'none';if (bWYSIWYG) document.getElementById('eSourceField').value=(FCKConfig.EnableXHTML&&FCKConfig.EnableSourceXHTML?FCK.GetXHTML(FCKConfig.FormatSource):FCK.GetHTML(FCKConfig.FormatSource));else FCK.SetHTML(FCK.GetHTML(),true);FCK.EditMode=bWYSIWYG?FCK_EDITMODE_SOURCE:FCK_EDITMODE_WYSIWYG;FCKToolbarSet.RefreshModeState();FCK.Focus();};FCK.CreateElement=function(tag){var e=FCK.EditorDocument.createElement(tag);return FCK.InsertElementAndGetIt(e);};FCK.InsertElementAndGetIt=function(e){e.setAttribute('__FCKTempLabel',1);this.InsertElement(e);var aEls=FCK.EditorDocument.getElementsByTagName(e.tagName);for (var i=0;i]*>/gi,"");html=html.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi,"<$1$3");html=html.replace(/<(\w[^>]*) style="([^"]*)"([^>]*)/gi,"<$1$3");html=html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi,"<$1$3");html=html.replace(/<\\?\?xml[^>]*>/gi,"");html=html.replace(/<\/?\w+:[^>]*>/gi,"");html=html.replace(/ /," ");var re=new RegExp("(]*>.*?)(<\/P>)","gi");html=html.replace(re,"");FCK.InsertHtml(html);};FCK.Preview=function(){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',FCK.SetPreview,true);return;}else {var oWindow=window.open('',null,'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');var sHTML=''+FCK.GetHTML()+'';oWindow_2.document.write(sHTML);oWindow_2.document.close();};};FCK.SetPreview=function(){oWindow.document.getElementById('block_'+FCKConfig.block_id).innerHTML=FCK.GetHTML();};FCK.SwitchEditMode=function(){var bWYSIWYG=(FCK.EditMode==FCK_EDITMODE_WYSIWYG);document.getElementById('eWysiwyg').style.display=bWYSIWYG?'none':'';document.getElementById('eSource').style.display=bWYSIWYG?'':'none';if (bWYSIWYG) document.getElementById('eSourceField').value=(FCKConfig.EnableXHTML&&FCKConfig.EnableSourceXHTML?FCK.GetXHTML(FCKConfig.FormatSource):FCK.GetHTML(FCKConfig.FormatSource));else FCK.SetHTML(FCK.GetHTML(),true);FCK.EditMode=bWYSIWYG?FCK_EDITMODE_SOURCE:FCK_EDITMODE_WYSIWYG;FCKToolbarSet.RefreshModeState();FCK.Focus();};FCK.CreateElement=function(tag){var e=FCK.EditorDocument.createElement(tag);return FCK.InsertElementAndGetIt(e);};FCK.InsertElementAndGetIt=function(e){e.setAttribute('__FCKTempLabel',1);this.InsertElement(e);var aEls=FCK.EditorDocument.getElementsByTagName(e.tagName);for (var i=0;i]* class="?MsoNormal"?/gi;if (re.test(sHTML)){if (confirm(FCKLang["PasteWordConfirm"])){FCK.CleanAndPaste(sHTML);return false;};};}else return true;};FCK.PasteAsPlainText=function(){var sText=FCKTools.HTMLEncode(clipboardData.getData("Text"));sText=sText.replace(/\n/g,'
');this.InsertHtml(sText);};FCK.PasteFromWord=function(){FCK.CleanAndPaste(FCK.GetClipboardHTML());};FCK.InsertElement=function(element){FCK.InsertHtml(element.outerHTML);};FCK.GetClipboardHTML=function(){var oDiv=document.getElementById('___FCKHiddenDiv');if (!oDiv){var oDiv=document.createElement('DIV');oDiv.id='___FCKHiddenDiv';oDiv.style.visibility='hidden';oDiv.style.overflow='hidden';oDiv.style.position='absolute';oDiv.style.width=1;oDiv.style.height=1;document.body.appendChild(oDiv);};oDiv.innerHTML='';var oTextRange=document.body.createTextRange();oTextRange.moveToElementText(oDiv);oTextRange.execCommand('Paste');var sData=oDiv.innerHTML;oDiv.innerHTML='';return sData;};FCK.AttachToOnSelectionChange=function(functionPointer){this.Events.AttachEvent('OnSelectionChange',functionPointer);};FCK.CreateLink=function(url){FCK.ExecuteNamedCommand('Unlink');if (url.length>0){var sTempUrl='javascript:void(0);/*'+(new Date().getTime())+'*/';FCK.ExecuteNamedCommand('CreateLink',sTempUrl);var oLinks=this.EditorDocument.links;for (i=0;i'+''+''+''+this.Label+''+''+'';var oCell=parentToolbar.DOMRow.insertCell(-1);oCell.appendChild(this.DOMDiv);this.RefreshState();};FCKToolbarButton.prototype.RefreshState=function(){var eState=this.Command.GetState();if (eState==this.State) return;this.State=eState;switch (this.State){case FCK_TRISTATE_ON:this.DOMDiv.className='TB_Button_On';break;case FCK_TRISTATE_OFF:this.DOMDiv.className='TB_Button_Off';break;default:this.DOMDiv.className='TB_Button_Disabled';break;};};FCKToolbarButton.prototype.Enable=function(){this.RefreshState();};FCKToolbarButton.prototype.Disable=function(){this.State=FCK_TRISTATE_DISABLED;this.DOMDiv.className='TB_Button_Disabled';} var FCKSpecialCombo=function(caption){this.FieldWidth=80;this.PanelWidth=130;this.PanelMaxHeight=150;this.Label=' ';this.Caption=caption;this.Enabled=true;this.Items=new Object();this._Panel=new FCKPanel();this._Panel.StyleSheet=FCKConfig.SkinPath+'fck_contextmenu.css';this._Panel.Create();this._Panel.PanelDiv.className+=' SC_Panel';this._Panel.PanelDiv.innerHTML='
';this._ItemsHolderEl=this._Panel.PanelDiv.getElementsByTagName('TD')[0];};FCKSpecialCombo.prototype.AddItem=function(id,html,label){var oDiv=this._ItemsHolderEl.appendChild(this._Panel.Document.createElement('DIV'));oDiv.className=oDiv.originalClass='SC_Item';oDiv.innerHTML=html;oDiv.FCKItemID=id;oDiv.FCKItemLabel=label?label:id;oDiv.FCKSpecialCombo=this;oDiv.Selected=false;oDiv.onmouseover=function(){this.className+=' SC_ItemOver';};oDiv.onmouseout=function(){this.className=this.originalClass;};oDiv.onclick=function(){this.FCKSpecialCombo._Panel.Hide();this.FCKSpecialCombo.SetLabel(this.FCKItemLabel);if (typeof(this.FCKSpecialCombo.OnSelect)=='function') this.FCKSpecialCombo.OnSelect(this.FCKItemID,this);};this.Items[id.toString().toLowerCase()]=oDiv;return oDiv;};FCKSpecialCombo.prototype.SelectItem=function(itemId){itemId=itemId?itemId.toString().toLowerCase():'';var oDiv=this.Items[itemId];if (oDiv){oDiv.className=oDiv.originalClass='SC_ItemSelected';oDiv.Selected=true;};};FCKSpecialCombo.prototype.DeselectAll=function(){for (var i in this.Items){this.Items[i].className=this.Items[i].originalClass='SC_Item';this.Items[i].Selected=false;};};FCKSpecialCombo.prototype.SetLabelById=function(id){FCKDebug.Output(this.Caption+': '+id,'#0000FF');id=id?id.toString().toLowerCase():'';var oDiv=this.Items[id];this.SetLabel(oDiv?oDiv.FCKItemLabel:'');};FCKSpecialCombo.prototype.SetLabel=function(text){this.Label=text.length==0?' ':text;if (this._LabelEl) this._LabelEl.innerHTML=this.Label;};FCKSpecialCombo.prototype.SetEnabled=function(isEnabled){this.Enabled=isEnabled;this._OuterTable.className=isEnabled?'':'SC_FieldDisabled';};FCKSpecialCombo.prototype.Create=function(targetElement){this._OuterTable=targetElement.appendChild(document.createElement('TABLE'));this._OuterTable.cellPadding=0;this._OuterTable.cellSpacing=0;this._OuterTable.insertRow(-1);if (this.Caption&&this.Caption.length>0){var oCaptionCell=this._OuterTable.rows[0].insertCell(-1);oCaptionCell.unselectable='on';oCaptionCell.innerHTML=this.Caption;oCaptionCell.className='SC_FieldCaption';};var oField=this._OuterTable.rows[0].insertCell(-1).appendChild(document.createElement('DIV'));oField.className='SC_Field';oField.style.width=this.FieldWidth+'px';oField.innerHTML='
 
';this._LabelEl=oField.getElementsByTagName('label')[0];this._LabelEl.innerHTML=this.Label;oField.SpecialCombo=this;oField.onmouseover=function(){if (this.SpecialCombo.Enabled) this.className='SC_Field SC_FieldOver';};oField.onmouseout=function(){this.className='SC_Field';};oField.onclick=function(e){if (e){e.stopPropagation();FCKPanelEventHandlers.OnDocumentClick(e);};if (this.SpecialCombo.Enabled){if (typeof(this.SpecialCombo.OnBeforeClick)=='function') this.SpecialCombo.OnBeforeClick(this.SpecialCombo);if (this.SpecialCombo._ItemsHolderEl.offsetHeight>this.SpecialCombo.PanelMaxHeight) this.SpecialCombo._Panel.PanelDiv.style.height=this.SpecialCombo.PanelMaxHeight+'px';else this.SpecialCombo._Panel.PanelDiv.style.height=this.SpecialCombo._ItemsHolderEl.offsetHeight+'px';this.SpecialCombo._Panel.PanelDiv.style.width=this.SpecialCombo.PanelWidth+'px';if (FCKBrowserInfo.IsGecko) this.SpecialCombo._Panel.PanelDiv.style.overflow='-moz-scrollbars-vertical';this.SpecialCombo._Panel.Show(0,this.offsetHeight,this,null,this.SpecialCombo.PanelMaxHeight,true);};return false;};}; -var FCKToolbarSpecialCombo=function(){this.SourceView=false;this.ContextSensitive=true;};FCKToolbarSpecialCombo.prototype.CreateInstance=function(parentToolbar){this._Combo=new FCKSpecialCombo(this.GetLabel());this._Combo.FieldWidth=100;this._Combo.PanelWidth=150;this._Combo.PanelMaxHeight=150;this.CreateItems(this._Combo);this._Combo.Create(parentToolbar.DOMRow.insertCell(-1));this._Combo.Command=this.Command;this._Combo.OnSelect=function(itemId,item){this.Command.Execute(itemId,item);};};FCKToolbarSpecialCombo.prototype.RefreshState=function(){var eState;var sValue=this.Command.GetState();if (sValue!=FCK_TRISTATE_DISABLED){eState=FCK_TRISTATE_ON;if (!this.RefreshActiveItems){this.RefreshActiveItems=function(combo,value){this._Combo.DeselectAll();this._Combo.SelectItem(value);this._Combo.SetLabelById(value);};};this.RefreshActiveItems(this._Combo,sValue);}else eState=FCK_TRISTATE_DISABLED;if (eState==this.State) return;if (eState==FCK_TRISTATE_DISABLED){this._Combo.DeselectAll();this._Combo.SetLabel(FCKConfig.DefaultClass);};this.State=eState;this._Combo.SetEnabled(eState!=FCK_TRISTATE_DISABLED);};FCKToolbarSpecialCombo.prototype.Enable=function(){this.RefreshState();};FCKToolbarSpecialCombo.prototype.Disable=function(){this.State=FCK_TRISTATE_DISABLED;this._Combo.DeselectAll();this._Combo.SetLabel(FCKConfig.DefaultClass);this._Combo.SetEnabled(false);} +var FCKToolbarSpecialCombo=function(){this.SourceView=false;this.ContextSensitive=true;};FCKToolbarSpecialCombo.prototype.CreateInstance=function(parentToolbar){this._Combo=new FCKSpecialCombo(this.GetLabel());this._Combo.FieldWidth=100;this._Combo.PanelWidth=150;this._Combo.PanelMaxHeight=150;this.CreateItems(this._Combo);this._Combo.Create(parentToolbar.DOMRow.insertCell(-1));this._Combo.Command=this.Command;this._Combo.OnSelect=function(itemId,item){this.Command.Execute(itemId,item);};};FCKToolbarSpecialCombo.prototype.RefreshState=function(){var eState;var sValue=this.Command.GetState();if (sValue!=FCK_TRISTATE_DISABLED){eState=FCK_TRISTATE_ON;if (!this.RefreshActiveItems){this.RefreshActiveItems=function(combo,value){this._Combo.DeselectAll();this._Combo.SelectItem(value);this._Combo.SetLabelById(value);};};this.RefreshActiveItems(this._Combo,sValue);}else eState=FCK_TRISTATE_DISABLED;if (eState==this.State) return;if (eState==FCK_TRISTATE_DISABLED){this._Combo.DeselectAll();if (typeof(FCKConfig.DefaultClass)!='undefined') this._Combo.SetLabel(FCKConfig.DefaultClass);else this._Combo.SetLabel(' ');};this.State=eState;this._Combo.SetEnabled(eState!=FCK_TRISTATE_DISABLED);};FCKToolbarSpecialCombo.prototype.Enable=function(){this.RefreshState();};FCKToolbarSpecialCombo.prototype.Disable=function(){this.State=FCK_TRISTATE_DISABLED;this._Combo.DeselectAll();if (typeof(FCKConfig.DefaultClass)!='undefined') this._Combo.SetLabel(FCKConfig.DefaultClass);else this._Combo.SetLabel(' ');this._Combo.SetEnabled(false);} var FCKToolbarFontsCombo=function(){this.Command=FCKCommands.GetCommand('FontName');};FCKToolbarFontsCombo.prototype=new FCKToolbarSpecialCombo;FCKToolbarFontsCombo.prototype.GetLabel=function(){return FCKLang.Font;};FCKToolbarFontsCombo.prototype.CreateItems=function(targetSpecialCombo){var aFonts=FCKConfig.FontNames.split(';');for (var i=0;i'+aFonts[i]+'');} var FCKToolbarFontSizeCombo=function(){this.Command=FCKCommands.GetCommand('FontSize');};FCKToolbarFontSizeCombo.prototype=new FCKToolbarSpecialCombo;FCKToolbarFontSizeCombo.prototype.GetLabel=function(){return FCKLang.FontSize;};FCKToolbarFontSizeCombo.prototype.CreateItems=function(targetSpecialCombo){targetSpecialCombo.FieldWidth=70;var aSizes=FCKConfig.FontSizes.split(';');for (var i=0;i'+aSizeParts[1]+'',aSizeParts[1]);};} var FCKToolbarFontFormatCombo=function(){this.Command=FCKCommands.GetCommand('FontFormat');};FCKToolbarFontFormatCombo.prototype=new FCKToolbarSpecialCombo;FCKToolbarFontFormatCombo.prototype.GetLabel=function(){return FCKLang.FontFormat;};FCKToolbarFontFormatCombo.prototype.CreateItems=function(targetSpecialCombo){var aNames=FCKLang['FontFormats'].split(';');var oNames={p:aNames[0],pre:aNames[1],address:aNames[2],h1:aNames[3],h2:aNames[4],h3:aNames[5],h4:aNames[6],h5:aNames[7],h6:aNames[8],div:aNames[9]};var aTags=FCKConfig.FontFormats.split(';');for (var i=0;i'+oNames[aTags[i]]+'',oNames[aTags[i]]);};} -var FCKToolbarStyleCombo=function(){this.Command=FCKCommands.GetCommand('Style');};FCKToolbarStyleCombo.prototype=new FCKToolbarSpecialCombo;FCKToolbarStyleCombo.prototype.GetLabel=function(){return FCKLang.Style;};FCKToolbarStyleCombo.prototype.CreateItems=function(targetSpecialCombo){FCKTools.AppendStyleSheet(targetSpecialCombo._Panel.Document,FCKConfig.EditorAreaCSS);if (!FCKBrowserInfo.IsGecko) targetSpecialCombo.OnBeforeClick=this.RefreshVisibleItems;for (var s in this.Command.Styles){var oStyle=this.Command.Styles[s];if (oStyle.IsObjectElement) var oItem=targetSpecialCombo.AddItem(s,s);else var oItem=targetSpecialCombo.AddItem(s,oStyle.GetOpenerTag()+s+oStyle.GetCloserTag());oItem.Style=oStyle;};};FCKToolbarStyleCombo.prototype.RefreshActiveItems=function(targetSpecialCombo){targetSpecialCombo.DeselectAll();var aStyles=this.Command.GetActiveStyles();if (aStyles.length>0){for (var i=0;i0){for (var i=0;i'+''+''+''+this.Label+''+''+''+'';var oCell=parentToolbar.DOMRow.insertCell(-1);oCell.appendChild(this.DOMDiv);this.RefreshState();};FCKToolbarPanelButton.prototype.RefreshState=FCKToolbarButton.prototype.RefreshState;FCKToolbarPanelButton.prototype.Enable=FCKToolbarButton.prototype.Enable;FCKToolbarPanelButton.prototype.Disable=FCKToolbarButton.prototype.Disable; var FCKToolbarItems=new Object();FCKToolbarItems.LoadedItems=new Object();FCKToolbarItems.RegisterItem=function(itemName,item){this.LoadedItems[itemName]=item;};FCKToolbarItems.GetItem=function(itemName){var oItem=FCKToolbarItems.LoadedItems[itemName];if (oItem) return oItem;switch (itemName){case 'Source':oItem=new FCKToolbarButton('Source',FCKLang.Source,null,FCK_TOOLBARITEM_ICONTEXT,true,true);break;case 'DocProps':oItem=new FCKToolbarButton('DocProps',FCKLang.DocProps);break;case 'Save':oItem=new FCKToolbarButton('Save',FCKLang.Save,null,null,true);break;case 'NewPage':oItem=new FCKToolbarButton('NewPage',FCKLang.NewPage,null,null,true);break;case 'Preview':oItem=new FCKToolbarButton('Preview',FCKLang.Preview,null,null,true);break;case 'About':oItem=new FCKToolbarButton('About',FCKLang.About,null,null,true);break;case 'Cut':oItem=new FCKToolbarButton('Cut',FCKLang.Cut,null,null,false,true);break;case 'Copy':oItem=new FCKToolbarButton('Copy',FCKLang.Copy,null,null,false,true);break;case 'Paste':oItem=new FCKToolbarButton('Paste',FCKLang.Paste,null,null,false,true);break;case 'PasteText':oItem=new FCKToolbarButton('PasteText',FCKLang.PasteText,null,null,false,true);break;case 'PasteWord':oItem=new FCKToolbarButton('PasteWord',FCKLang.PasteWord,null,null,false,true);break;case 'Print':oItem=new FCKToolbarButton('Print',FCKLang.Print,null,null,false,true);break;case 'SpellCheck':oItem=new FCKToolbarButton('SpellCheck',FCKLang.SpellCheck,null,null,false,true);break;case 'Undo':oItem=new FCKToolbarButton('Undo',FCKLang.Undo,null,null,false,true);break;case 'Redo':oItem=new FCKToolbarButton('Redo',FCKLang.Redo,null,null,false,true);break;case 'SelectAll':oItem=new FCKToolbarButton('SelectAll',FCKLang.SelectAll);break;case 'RemoveFormat':oItem=new FCKToolbarButton('RemoveFormat',FCKLang.RemoveFormat,null,null,false,true);break;case 'Bold':oItem=new FCKToolbarButton('Bold',FCKLang.Bold,null,null,false,true);break;case 'Italic':oItem=new FCKToolbarButton('Italic',FCKLang.Italic,null,null,false,true);break;case 'Underline':oItem=new FCKToolbarButton('Underline',FCKLang.Underline,null,null,false,true);break;case 'StrikeThrough':oItem=new FCKToolbarButton('StrikeThrough',FCKLang.StrikeThrough,null,null,false,true);break;case 'Subscript':oItem=new FCKToolbarButton('Subscript',FCKLang.Subscript,null,null,false,true);break;case 'Superscript':oItem=new FCKToolbarButton('Superscript',FCKLang.Superscript,null,null,false,true);break;case 'OrderedList':oItem=new FCKToolbarButton('InsertOrderedList',FCKLang.NumberedListLbl,FCKLang.NumberedList,null,false,true);break;case 'UnorderedList':oItem=new FCKToolbarButton('InsertUnorderedList',FCKLang.BulletedListLbl,FCKLang.BulletedList,null,false,true);break;case 'Outdent':oItem=new FCKToolbarButton('Outdent',FCKLang.DecreaseIndent,null,null,false,true);break;case 'Indent':oItem=new FCKToolbarButton('Indent',FCKLang.IncreaseIndent,null,null,false,true);break;case 'Link':oItem=new FCKToolbarButton('Link',FCKLang.InsertLinkLbl,FCKLang.InsertLink,null,false,true);break;case 'Unlink':oItem=new FCKToolbarButton('Unlink',FCKLang.RemoveLink,null,null,false,true);break;case 'Anchor':oItem=new FCKToolbarButton('Anchor',FCKLang.Anchor);break;case 'Image':oItem=new FCKToolbarButton('Image',FCKLang.InsertImageLbl,FCKLang.InsertImage);break;case 'Document':oItem=new FCKToolbarButton('Document',FCKLang.InsertDocumentLbl,FCKLang.InsertDocument);break;case 'Table':oItem=new FCKToolbarButton('Table',FCKLang.InsertTableLbl,FCKLang.InsertTable);break;case 'SpecialChar':oItem=new FCKToolbarButton('SpecialChar',FCKLang.InsertSpecialCharLbl,FCKLang.InsertSpecialChar);break;case 'Smiley':oItem=new FCKToolbarButton('Smiley',FCKLang.InsertSmileyLbl,FCKLang.InsertSmiley);break;case 'UniversalKey':oItem=new FCKToolbarButton('UniversalKey',FCKLang.UniversalKeyboard);break;case 'Rule':oItem=new FCKToolbarButton('InsertHorizontalRule',FCKLang.InsertLineLbl,FCKLang.InsertLine);break;case 'JustifyLeft':oItem=new FCKToolbarButton('JustifyLeft',FCKLang.LeftJustify,null,null,false,true);break;case 'JustifyCenter':oItem=new FCKToolbarButton('JustifyCenter',FCKLang.CenterJustify,null,null,false,true);break;case 'JustifyRight':oItem=new FCKToolbarButton('JustifyRight',FCKLang.RightJustify,null,null,false,true);break;case 'JustifyFull':oItem=new FCKToolbarButton('JustifyFull',FCKLang.BlockJustify,null,null,false,true);break;case 'Style':oItem=new FCKToolbarStyleCombo();break;case 'FontName':oItem=new FCKToolbarFontsCombo();break;case 'FontSize':oItem=new FCKToolbarFontSizeCombo();break;case 'FontFormat':oItem=new FCKToolbarFontFormatCombo();break;case 'TextColor':oItem=new FCKToolbarPanelButton('TextColor',FCKLang.TextColor);break;case 'BGColor':oItem=new FCKToolbarPanelButton('BGColor',FCKLang.BGColor);break;case 'Find':oItem=new FCKToolbarButton('Find',FCKLang.Find);break;case 'Replace':oItem=new FCKToolbarButton('Replace',FCKLang.Replace);break;case 'Form':oItem=new FCKToolbarButton('Form',FCKLang.Form);break;case 'Checkbox':oItem=new FCKToolbarButton('Checkbox',FCKLang.Checkbox);break;case 'Radio':oItem=new FCKToolbarButton('Radio',FCKLang.RadioButton);break;case 'TextField':oItem=new FCKToolbarButton('TextField',FCKLang.TextField);break;case 'Textarea':oItem=new FCKToolbarButton('Textarea',FCKLang.Textarea);break;case 'HiddenField':oItem=new FCKToolbarButton('HiddenField',FCKLang.HiddenField);break;case 'Button':oItem=new FCKToolbarButton('Button',FCKLang.Button);break;case 'Select':oItem=new FCKToolbarButton('Select',FCKLang.SelectionField);break;case 'ImageButton':oItem=new FCKToolbarButton('ImageButton',FCKLang.ImageButton);break;default:alert(FCKLang.UnknownToolbarItem.replace(/%1/g,itemName));return;};FCKToolbarItems.LoadedItems[itemName]=oItem;return oItem;} var FCKToolbar=function(width_){this.Items=new Array();this.DOMTable=document.createElement('table');this.DOMTable.className='TB_Toolbar';with (this.DOMTable){style.styleFloat=style.cssFloat=FCKLang.Dir=='rtl'?'right':'left';cellPadding=0;cellSpacing=0;border=0;if (width_&&width_>0) {width=width_+'%';};};this.DOMRow=this.DOMTable.insertRow(-1);var oCell=this.DOMRow.insertCell(-1);oCell.className='TB_Start';oCell.innerHTML='';FCKToolbarSet.DOMElement.appendChild(this.DOMTable);};FCKToolbar.prototype.AddItem=function(toolbarItem){this.Items[this.Items.length]=toolbarItem;toolbarItem.CreateInstance(this);};FCKToolbar.prototype.AddEmpty=function(){var oCell=this.DOMRow.insertCell(-1);oCell.unselectable='on';oCell.width='50%';oCell.innerHTML='';};FCKToolbar.prototype.AddSeparator=function(){var oCell=this.DOMRow.insertCell(-1);oCell.unselectable='on';oCell.innerHTML='';};FCKToolbar.prototype.AddTerminator=function(){var oCell=this.DOMRow.insertCell(-1);oCell.className='TB_End';oCell.innerHTML='';};FCKToolbar.prototype.AddBigSeparator=function(){var oCell=this.DOMRow.insertCell(-1);oCell.className='TB_Start';oCell.innerHTML='';}; Index: trunk/admin/editor/cmseditor/editor/_source/classes/fcktoolbarspecialcombo.js =================================================================== diff -u -r1697 -r1746 --- trunk/admin/editor/cmseditor/editor/_source/classes/fcktoolbarspecialcombo.js (.../fcktoolbarspecialcombo.js) (revision 1697) +++ trunk/admin/editor/cmseditor/editor/_source/classes/fcktoolbarspecialcombo.js (.../fcktoolbarspecialcombo.js) (revision 1746) @@ -81,7 +81,10 @@ if ( eState == FCK_TRISTATE_DISABLED ) { this._Combo.DeselectAll() ; - this._Combo.SetLabel(FCKConfig.DefaultClass) ; + if (typeof(FCKConfig.DefaultClass) != 'undefined') + this._Combo.SetLabel(FCKConfig.DefaultClass) ; + else + this._Combo.SetLabel(' ') ; } // Sets the actual state. this.State = eState ; @@ -99,6 +102,9 @@ { this.State = FCK_TRISTATE_DISABLED ; this._Combo.DeselectAll() ; - this._Combo.SetLabel(FCKConfig.DefaultClass) ; + if (typeof(FCKConfig.DefaultClass) != 'undefined') + this._Combo.SetLabel(FCKConfig.DefaultClass) ; + else + this._Combo.SetLabel(' ') ; this._Combo.SetEnabled( false ) ; } \ No newline at end of file Index: trunk/admin/editor/cmseditor/editor/js/fckeditorcode_gecko_2.js =================================================================== diff -u -r1709 -r1746 --- trunk/admin/editor/cmseditor/editor/js/fckeditorcode_gecko_2.js (.../fckeditorcode_gecko_2.js) (revision 1709) +++ trunk/admin/editor/cmseditor/editor/js/fckeditorcode_gecko_2.js (.../fckeditorcode_gecko_2.js) (revision 1746) @@ -10,7 +10,7 @@ * * This file has been compacted for best loading performance. */ -FCK.RedirectNamedCommands=new Object();FCK.ExecuteNamedCommand=function(commandName,commandParameter){if (FCK.RedirectNamedCommands[commandName]!=null) {FCK.ExecuteRedirectedNamedCommand(commandName,commandParameter);}else{FCK.Focus();if (commandName=="Undo"){if (confirm("This will delete everything on this page. Are you sure?")) FCK.EditorDocument.execCommand(commandName,false,commandParameter);} else FCK.EditorDocument.execCommand(commandName,false,commandParameter);FCK.Events.FireEvent('OnSelectionChange');};};FCK.GetNamedCommandState=function(commandName){try{if (commandName=='InsertHorizontalRule') return FCK_TRISTATE_OFF;if (!FCK.EditorDocument.queryCommandEnabled(commandName)) return FCK_TRISTATE_DISABLED;else {switch (commandName){default:return FCK.EditorDocument.queryCommandState(commandName)?FCK_TRISTATE_ON:FCK_TRISTATE_OFF;};};}catch (e){return FCK_TRISTATE_OFF;};};FCK.GetNamedCommandValue=function(commandName){var sValue='';var eState=FCK.GetNamedCommandState(commandName);if (eState==FCK_TRISTATE_DISABLED) return null;try{sValue=this.EditorDocument.queryCommandValue(commandName);}catch(e) {};return sValue?sValue:'';};FCK.CleanAndPaste=function(html){html=html.replace(/<\/?SPAN[^>]*>/gi,"");html=html.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi,"<$1$3");html=html.replace(/<(\w[^>]*) style="([^"]*)"([^>]*)/gi,"<$1$3");html=html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi,"<$1$3");html=html.replace(/<\\?\?xml[^>]*>/gi,"");html=html.replace(/<\/?\w+:[^>]*>/gi,"");html=html.replace(/ /," ");var re=new RegExp("(]*>.*?)(<\/P>)","gi");html=html.replace(re,"");FCK.InsertHtml(html);};FCK.Preview=function(){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',FCK.SetPreview,true);return;}else {var oWindow_2=window.open('',null,'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');var sHTML=''+FCK.GetHTML()+'';oWindow_2.document.write(sHTML);oWindow_2.document.close();};};FCK.SetPreview=function(){oWindow.document.getElementById('block_'+FCKConfig.block_id).innerHTML=FCK.GetHTML();};FCK.SwitchEditMode=function(){var bWYSIWYG=(FCK.EditMode==FCK_EDITMODE_WYSIWYG);document.getElementById('eWysiwyg').style.display=bWYSIWYG?'none':'';document.getElementById('eSource').style.display=bWYSIWYG?'':'none';if (bWYSIWYG) document.getElementById('eSourceField').value=(FCKConfig.EnableXHTML&&FCKConfig.EnableSourceXHTML?FCK.GetXHTML(FCKConfig.FormatSource):FCK.GetHTML(FCKConfig.FormatSource));else FCK.SetHTML(FCK.GetHTML(),true);FCK.EditMode=bWYSIWYG?FCK_EDITMODE_SOURCE:FCK_EDITMODE_WYSIWYG;FCKToolbarSet.RefreshModeState();FCK.Focus();};FCK.CreateElement=function(tag){var e=FCK.EditorDocument.createElement(tag);return FCK.InsertElementAndGetIt(e);};FCK.InsertElementAndGetIt=function(e){e.setAttribute('__FCKTempLabel',1);this.InsertElement(e);var aEls=FCK.EditorDocument.getElementsByTagName(e.tagName);for (var i=0;i]*>/gi,"");html=html.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi,"<$1$3");html=html.replace(/<(\w[^>]*) style="([^"]*)"([^>]*)/gi,"<$1$3");html=html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi,"<$1$3");html=html.replace(/<\\?\?xml[^>]*>/gi,"");html=html.replace(/<\/?\w+:[^>]*>/gi,"");html=html.replace(/ /," ");var re=new RegExp("(]*>.*?)(<\/P>)","gi");html=html.replace(re,"");FCK.InsertHtml(html);};FCK.Preview=function(){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',FCK.SetPreview,true);return;}else {var oWindow=window.open('',null,'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');var sHTML=''+FCK.GetHTML()+'';oWindow_2.document.write(sHTML);oWindow_2.document.close();};};FCK.SetPreview=function(){oWindow.document.getElementById('block_'+FCKConfig.block_id).innerHTML=FCK.GetHTML();};FCK.SwitchEditMode=function(){var bWYSIWYG=(FCK.EditMode==FCK_EDITMODE_WYSIWYG);document.getElementById('eWysiwyg').style.display=bWYSIWYG?'none':'';document.getElementById('eSource').style.display=bWYSIWYG?'':'none';if (bWYSIWYG) document.getElementById('eSourceField').value=(FCKConfig.EnableXHTML&&FCKConfig.EnableSourceXHTML?FCK.GetXHTML(FCKConfig.FormatSource):FCK.GetHTML(FCKConfig.FormatSource));else FCK.SetHTML(FCK.GetHTML(),true);FCK.EditMode=bWYSIWYG?FCK_EDITMODE_SOURCE:FCK_EDITMODE_WYSIWYG;FCKToolbarSet.RefreshModeState();FCK.Focus();};FCK.CreateElement=function(tag){var e=FCK.EditorDocument.createElement(tag);return FCK.InsertElementAndGetIt(e);};FCK.InsertElementAndGetIt=function(e){e.setAttribute('__FCKTempLabel',1);this.InsertElement(e);var aEls=FCK.EditorDocument.getElementsByTagName(e.tagName);for (var i=0;i]* class="?MsoNormal"?/gi;if (re.test(sHTML)){if (confirm(FCKLang["PasteWordConfirm"])){FCK.CleanAndPaste(sHTML);return false;};};}else return true;};FCK.InsertHtml=function(html){var oSel=FCKSelection.Delete();var oRange=oSel.getRangeAt(0);var oFragment=oRange.createContextualFragment(html);var oLastNode=oFragment.lastChild;oRange.insertNode(oFragment);oRange.setEndAfter(oLastNode);oRange.setStartAfter(oLastNode);oSel.removeAllRanges();oSel=FCK.EditorWindow.getSelection();this.Focus();};FCK.InsertElement=function(element){var oSel=FCKSelection.Delete();var oRange=oSel.getRangeAt(0);oRange.insertNode(element);oRange.setEndAfter(element);oRange.setStartAfter(element);this.Focus();};FCK.PasteAsPlainText=function(){FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.PasteAsText,'dialog/fck_paste.html',400,330,'PlainText');};FCK.PasteFromWord=function(){FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.PasteFromWord,'dialog/fck_paste.html',400,330,'Word');};FCK.GetClipboardHTML=function(){return '';};FCK.CreateLink=function(url){FCK.ExecuteNamedCommand('Unlink');if (url.length>0){var sTempUrl='javascript:void(0);/*'+(new Date().getTime())+'*/';FCK.ExecuteNamedCommand('CreateLink',sTempUrl);var oLink=document.evaluate("//a[@href='"+sTempUrl+"']",this.EditorDocument.body,null,9,null).singleNodeValue;if (oLink){oLink.href=url;return oLink;};};}; var FCKSelection=new Object();FCK.Selection=FCKSelection; FCKSelection.GetType=function(){this._Type='Text';var oSel=FCK.EditorWindow.getSelection();if (oSel&&oSel.rangeCount==1){var oRange=oSel.getRangeAt(0);if (oRange.startContainer==oRange.endContainer&&(oRange.endOffset-oRange.startOffset)==1) this._Type='Control';};return this._Type;};FCKSelection.GetSelectedElement=function(){if (this.GetType()=='Control'){var oSel=FCK.EditorWindow.getSelection();return oSel.anchorNode.childNodes[oSel.anchorOffset];};};FCKSelection.GetParentElement=function(){if (this.GetType()=='Control') return FCKSelection.GetSelectedElement().parentElement;else{var oSel=FCK.EditorWindow.getSelection();if (oSel){var oNode=oSel.anchorNode;while (oNode&&oNode.nodeType!=1) oNode=oNode.parentNode;return oNode;};};};FCKSelection.MoveToNode=function(node){var oSel=FCK.EditorWindow.getSelection();for (i=oSel.rangeCount-1;i>=0;i--){if (i==0) oSel.getRangeAt(i).selectNodeContents(node);else oSel.removeRange(oSel.getRangeAt(i));};};FCKSelection.HasAncestorNode=function(nodeTagName){var oContainer=this.GetSelectedElement();if (!oContainer&&FCK.EditorWindow){try { oContainer=FCK.EditorWindow.getSelection().getRangeAt(0).startContainer;}catch(e){};};while (oContainer){if (oContainer.tagName==nodeTagName) return true;oContainer=oContainer.parentNode;};return false;};FCKSelection.MoveToAncestorNode=function(nodeTagName){var oNode;var oContainer=this.GetSelectedElement();if (!oContainer) oContainer=FCK.EditorWindow.getSelection().getRangeAt(0).startContainer;while (oContainer){if (oContainer.tagName==nodeTagName) return oContainer;oContainer=oContainer.parentNode;};};FCKSelection.Delete=function(){var oSel=FCK.EditorWindow.getSelection();for (var i=0;i'+''+''+''+this.Label+''+''+'';var oCell=parentToolbar.DOMRow.insertCell(-1);oCell.appendChild(this.DOMDiv);this.RefreshState();};FCKToolbarButton.prototype.RefreshState=function(){var eState=this.Command.GetState();if (eState==this.State) return;this.State=eState;switch (this.State){case FCK_TRISTATE_ON:this.DOMDiv.className='TB_Button_On';break;case FCK_TRISTATE_OFF:this.DOMDiv.className='TB_Button_Off';break;default:this.DOMDiv.className='TB_Button_Disabled';break;};};FCKToolbarButton.prototype.Enable=function(){this.RefreshState();};FCKToolbarButton.prototype.Disable=function(){this.State=FCK_TRISTATE_DISABLED;this.DOMDiv.className='TB_Button_Disabled';} var FCKSpecialCombo=function(caption){this.FieldWidth=80;this.PanelWidth=130;this.PanelMaxHeight=150;this.Label=' ';this.Caption=caption;this.Enabled=true;this.Items=new Object();this._Panel=new FCKPanel();this._Panel.StyleSheet=FCKConfig.SkinPath+'fck_contextmenu.css';this._Panel.Create();this._Panel.PanelDiv.className+=' SC_Panel';this._Panel.PanelDiv.innerHTML='
';this._ItemsHolderEl=this._Panel.PanelDiv.getElementsByTagName('TD')[0];};FCKSpecialCombo.prototype.AddItem=function(id,html,label){var oDiv=this._ItemsHolderEl.appendChild(this._Panel.Document.createElement('DIV'));oDiv.className=oDiv.originalClass='SC_Item';oDiv.innerHTML=html;oDiv.FCKItemID=id;oDiv.FCKItemLabel=label?label:id;oDiv.FCKSpecialCombo=this;oDiv.Selected=false;oDiv.onmouseover=function(){this.className+=' SC_ItemOver';};oDiv.onmouseout=function(){this.className=this.originalClass;};oDiv.onclick=function(){this.FCKSpecialCombo._Panel.Hide();this.FCKSpecialCombo.SetLabel(this.FCKItemLabel);if (typeof(this.FCKSpecialCombo.OnSelect)=='function') this.FCKSpecialCombo.OnSelect(this.FCKItemID,this);};this.Items[id.toString().toLowerCase()]=oDiv;return oDiv;};FCKSpecialCombo.prototype.SelectItem=function(itemId){itemId=itemId?itemId.toString().toLowerCase():'';var oDiv=this.Items[itemId];if (oDiv){oDiv.className=oDiv.originalClass='SC_ItemSelected';oDiv.Selected=true;};};FCKSpecialCombo.prototype.DeselectAll=function(){for (var i in this.Items){this.Items[i].className=this.Items[i].originalClass='SC_Item';this.Items[i].Selected=false;};};FCKSpecialCombo.prototype.SetLabelById=function(id){FCKDebug.Output(this.Caption+': '+id,'#0000FF');id=id?id.toString().toLowerCase():'';var oDiv=this.Items[id];this.SetLabel(oDiv?oDiv.FCKItemLabel:'');};FCKSpecialCombo.prototype.SetLabel=function(text){this.Label=text.length==0?' ':text;if (this._LabelEl) this._LabelEl.innerHTML=this.Label;};FCKSpecialCombo.prototype.SetEnabled=function(isEnabled){this.Enabled=isEnabled;this._OuterTable.className=isEnabled?'':'SC_FieldDisabled';};FCKSpecialCombo.prototype.Create=function(targetElement){this._OuterTable=targetElement.appendChild(document.createElement('TABLE'));this._OuterTable.cellPadding=0;this._OuterTable.cellSpacing=0;this._OuterTable.insertRow(-1);if (this.Caption&&this.Caption.length>0){var oCaptionCell=this._OuterTable.rows[0].insertCell(-1);oCaptionCell.unselectable='on';oCaptionCell.innerHTML=this.Caption;oCaptionCell.className='SC_FieldCaption';};var oField=this._OuterTable.rows[0].insertCell(-1).appendChild(document.createElement('DIV'));oField.className='SC_Field';oField.style.width=this.FieldWidth+'px';oField.innerHTML='
 
';this._LabelEl=oField.getElementsByTagName('label')[0];this._LabelEl.innerHTML=this.Label;oField.SpecialCombo=this;oField.onmouseover=function(){if (this.SpecialCombo.Enabled) this.className='SC_Field SC_FieldOver';};oField.onmouseout=function(){this.className='SC_Field';};oField.onclick=function(e){if (e){e.stopPropagation();FCKPanelEventHandlers.OnDocumentClick(e);};if (this.SpecialCombo.Enabled){if (typeof(this.SpecialCombo.OnBeforeClick)=='function') this.SpecialCombo.OnBeforeClick(this.SpecialCombo);if (this.SpecialCombo._ItemsHolderEl.offsetHeight>this.SpecialCombo.PanelMaxHeight) this.SpecialCombo._Panel.PanelDiv.style.height=this.SpecialCombo.PanelMaxHeight+'px';else this.SpecialCombo._Panel.PanelDiv.style.height=this.SpecialCombo._ItemsHolderEl.offsetHeight+'px';this.SpecialCombo._Panel.PanelDiv.style.width=this.SpecialCombo.PanelWidth+'px';if (FCKBrowserInfo.IsGecko) this.SpecialCombo._Panel.PanelDiv.style.overflow='-moz-scrollbars-vertical';this.SpecialCombo._Panel.Show(0,this.offsetHeight,this,null,this.SpecialCombo.PanelMaxHeight,true);};return false;};}; -var FCKToolbarSpecialCombo=function(){this.SourceView=false;this.ContextSensitive=true;};FCKToolbarSpecialCombo.prototype.CreateInstance=function(parentToolbar){this._Combo=new FCKSpecialCombo(this.GetLabel());this._Combo.FieldWidth=100;this._Combo.PanelWidth=150;this._Combo.PanelMaxHeight=150;this.CreateItems(this._Combo);this._Combo.Create(parentToolbar.DOMRow.insertCell(-1));this._Combo.Command=this.Command;this._Combo.OnSelect=function(itemId,item){this.Command.Execute(itemId,item);};};FCKToolbarSpecialCombo.prototype.RefreshState=function(){var eState;var sValue=this.Command.GetState();if (sValue!=FCK_TRISTATE_DISABLED){eState=FCK_TRISTATE_ON;if (!this.RefreshActiveItems){this.RefreshActiveItems=function(combo,value){this._Combo.DeselectAll();this._Combo.SelectItem(value);this._Combo.SetLabelById(value);};};this.RefreshActiveItems(this._Combo,sValue);}else eState=FCK_TRISTATE_DISABLED;if (eState==this.State) return;if (eState==FCK_TRISTATE_DISABLED){this._Combo.DeselectAll();this._Combo.SetLabel(FCKConfig.DefaultClass);};this.State=eState;this._Combo.SetEnabled(eState!=FCK_TRISTATE_DISABLED);};FCKToolbarSpecialCombo.prototype.Enable=function(){this.RefreshState();};FCKToolbarSpecialCombo.prototype.Disable=function(){this.State=FCK_TRISTATE_DISABLED;this._Combo.DeselectAll();this._Combo.SetLabel(FCKConfig.DefaultClass);this._Combo.SetEnabled(false);} +var FCKToolbarSpecialCombo=function(){this.SourceView=false;this.ContextSensitive=true;};FCKToolbarSpecialCombo.prototype.CreateInstance=function(parentToolbar){this._Combo=new FCKSpecialCombo(this.GetLabel());this._Combo.FieldWidth=100;this._Combo.PanelWidth=150;this._Combo.PanelMaxHeight=150;this.CreateItems(this._Combo);this._Combo.Create(parentToolbar.DOMRow.insertCell(-1));this._Combo.Command=this.Command;this._Combo.OnSelect=function(itemId,item){this.Command.Execute(itemId,item);};};FCKToolbarSpecialCombo.prototype.RefreshState=function(){var eState;var sValue=this.Command.GetState();if (sValue!=FCK_TRISTATE_DISABLED){eState=FCK_TRISTATE_ON;if (!this.RefreshActiveItems){this.RefreshActiveItems=function(combo,value){this._Combo.DeselectAll();this._Combo.SelectItem(value);this._Combo.SetLabelById(value);};};this.RefreshActiveItems(this._Combo,sValue);}else eState=FCK_TRISTATE_DISABLED;if (eState==this.State) return;if (eState==FCK_TRISTATE_DISABLED){this._Combo.DeselectAll();if (typeof(FCKConfig.DefaultClass)!='undefined') this._Combo.SetLabel(FCKConfig.DefaultClass);else this._Combo.SetLabel(' ');};this.State=eState;this._Combo.SetEnabled(eState!=FCK_TRISTATE_DISABLED);};FCKToolbarSpecialCombo.prototype.Enable=function(){this.RefreshState();};FCKToolbarSpecialCombo.prototype.Disable=function(){this.State=FCK_TRISTATE_DISABLED;this._Combo.DeselectAll();if (typeof(FCKConfig.DefaultClass)!='undefined') this._Combo.SetLabel(FCKConfig.DefaultClass);else this._Combo.SetLabel(' ');this._Combo.SetEnabled(false);} var FCKToolbarFontsCombo=function(){this.Command=FCKCommands.GetCommand('FontName');};FCKToolbarFontsCombo.prototype=new FCKToolbarSpecialCombo;FCKToolbarFontsCombo.prototype.GetLabel=function(){return FCKLang.Font;};FCKToolbarFontsCombo.prototype.CreateItems=function(targetSpecialCombo){var aFonts=FCKConfig.FontNames.split(';');for (var i=0;i'+aFonts[i]+'');} var FCKToolbarFontSizeCombo=function(){this.Command=FCKCommands.GetCommand('FontSize');};FCKToolbarFontSizeCombo.prototype=new FCKToolbarSpecialCombo;FCKToolbarFontSizeCombo.prototype.GetLabel=function(){return FCKLang.FontSize;};FCKToolbarFontSizeCombo.prototype.CreateItems=function(targetSpecialCombo){targetSpecialCombo.FieldWidth=70;var aSizes=FCKConfig.FontSizes.split(';');for (var i=0;i'+aSizeParts[1]+'',aSizeParts[1]);};} var FCKToolbarFontFormatCombo=function(){this.Command=FCKCommands.GetCommand('FontFormat');};FCKToolbarFontFormatCombo.prototype=new FCKToolbarSpecialCombo;FCKToolbarFontFormatCombo.prototype.GetLabel=function(){return FCKLang.FontFormat;};FCKToolbarFontFormatCombo.prototype.CreateItems=function(targetSpecialCombo){var aNames=FCKLang['FontFormats'].split(';');var oNames={p:aNames[0],pre:aNames[1],address:aNames[2],h1:aNames[3],h2:aNames[4],h3:aNames[5],h4:aNames[6],h5:aNames[7],h6:aNames[8],div:aNames[9]};var aTags=FCKConfig.FontFormats.split(';');for (var i=0;i'+oNames[aTags[i]]+'',oNames[aTags[i]]);};} -var FCKToolbarStyleCombo=function(){this.Command=FCKCommands.GetCommand('Style');};FCKToolbarStyleCombo.prototype=new FCKToolbarSpecialCombo;FCKToolbarStyleCombo.prototype.GetLabel=function(){return FCKLang.Style;};FCKToolbarStyleCombo.prototype.CreateItems=function(targetSpecialCombo){FCKTools.AppendStyleSheet(targetSpecialCombo._Panel.Document,FCKConfig.EditorAreaCSS);if (!FCKBrowserInfo.IsGecko) targetSpecialCombo.OnBeforeClick=this.RefreshVisibleItems;for (var s in this.Command.Styles){var oStyle=this.Command.Styles[s];if (oStyle.IsObjectElement) var oItem=targetSpecialCombo.AddItem(s,s);else var oItem=targetSpecialCombo.AddItem(s,oStyle.GetOpenerTag()+s+oStyle.GetCloserTag());oItem.Style=oStyle;};};FCKToolbarStyleCombo.prototype.RefreshActiveItems=function(targetSpecialCombo){targetSpecialCombo.DeselectAll();var aStyles=this.Command.GetActiveStyles();if (aStyles.length>0){for (var i=0;i0){for (var i=0;i'+''+''+''+this.Label+''+''+''+'';var oCell=parentToolbar.DOMRow.insertCell(-1);oCell.appendChild(this.DOMDiv);this.RefreshState();};FCKToolbarPanelButton.prototype.RefreshState=FCKToolbarButton.prototype.RefreshState;FCKToolbarPanelButton.prototype.Enable=FCKToolbarButton.prototype.Enable;FCKToolbarPanelButton.prototype.Disable=FCKToolbarButton.prototype.Disable; var FCKToolbarItems=new Object();FCKToolbarItems.LoadedItems=new Object();FCKToolbarItems.RegisterItem=function(itemName,item){this.LoadedItems[itemName]=item;};FCKToolbarItems.GetItem=function(itemName){var oItem=FCKToolbarItems.LoadedItems[itemName];if (oItem) return oItem;switch (itemName){case 'Source':oItem=new FCKToolbarButton('Source',FCKLang.Source,null,FCK_TOOLBARITEM_ICONTEXT,true,true);break;case 'DocProps':oItem=new FCKToolbarButton('DocProps',FCKLang.DocProps);break;case 'Save':oItem=new FCKToolbarButton('Save',FCKLang.Save,null,null,true);break;case 'NewPage':oItem=new FCKToolbarButton('NewPage',FCKLang.NewPage,null,null,true);break;case 'Preview':oItem=new FCKToolbarButton('Preview',FCKLang.Preview,null,null,true);break;case 'About':oItem=new FCKToolbarButton('About',FCKLang.About,null,null,true);break;case 'Cut':oItem=new FCKToolbarButton('Cut',FCKLang.Cut,null,null,false,true);break;case 'Copy':oItem=new FCKToolbarButton('Copy',FCKLang.Copy,null,null,false,true);break;case 'Paste':oItem=new FCKToolbarButton('Paste',FCKLang.Paste,null,null,false,true);break;case 'PasteText':oItem=new FCKToolbarButton('PasteText',FCKLang.PasteText,null,null,false,true);break;case 'PasteWord':oItem=new FCKToolbarButton('PasteWord',FCKLang.PasteWord,null,null,false,true);break;case 'Print':oItem=new FCKToolbarButton('Print',FCKLang.Print,null,null,false,true);break;case 'SpellCheck':oItem=new FCKToolbarButton('SpellCheck',FCKLang.SpellCheck,null,null,false,true);break;case 'Undo':oItem=new FCKToolbarButton('Undo',FCKLang.Undo,null,null,false,true);break;case 'Redo':oItem=new FCKToolbarButton('Redo',FCKLang.Redo,null,null,false,true);break;case 'SelectAll':oItem=new FCKToolbarButton('SelectAll',FCKLang.SelectAll);break;case 'RemoveFormat':oItem=new FCKToolbarButton('RemoveFormat',FCKLang.RemoveFormat,null,null,false,true);break;case 'Bold':oItem=new FCKToolbarButton('Bold',FCKLang.Bold,null,null,false,true);break;case 'Italic':oItem=new FCKToolbarButton('Italic',FCKLang.Italic,null,null,false,true);break;case 'Underline':oItem=new FCKToolbarButton('Underline',FCKLang.Underline,null,null,false,true);break;case 'StrikeThrough':oItem=new FCKToolbarButton('StrikeThrough',FCKLang.StrikeThrough,null,null,false,true);break;case 'Subscript':oItem=new FCKToolbarButton('Subscript',FCKLang.Subscript,null,null,false,true);break;case 'Superscript':oItem=new FCKToolbarButton('Superscript',FCKLang.Superscript,null,null,false,true);break;case 'OrderedList':oItem=new FCKToolbarButton('InsertOrderedList',FCKLang.NumberedListLbl,FCKLang.NumberedList,null,false,true);break;case 'UnorderedList':oItem=new FCKToolbarButton('InsertUnorderedList',FCKLang.BulletedListLbl,FCKLang.BulletedList,null,false,true);break;case 'Outdent':oItem=new FCKToolbarButton('Outdent',FCKLang.DecreaseIndent,null,null,false,true);break;case 'Indent':oItem=new FCKToolbarButton('Indent',FCKLang.IncreaseIndent,null,null,false,true);break;case 'Link':oItem=new FCKToolbarButton('Link',FCKLang.InsertLinkLbl,FCKLang.InsertLink,null,false,true);break;case 'Unlink':oItem=new FCKToolbarButton('Unlink',FCKLang.RemoveLink,null,null,false,true);break;case 'Anchor':oItem=new FCKToolbarButton('Anchor',FCKLang.Anchor);break;case 'Image':oItem=new FCKToolbarButton('Image',FCKLang.InsertImageLbl,FCKLang.InsertImage);break;case 'Document':oItem=new FCKToolbarButton('Document',FCKLang.InsertDocumentLbl,FCKLang.InsertDocument);break;case 'Table':oItem=new FCKToolbarButton('Table',FCKLang.InsertTableLbl,FCKLang.InsertTable);break;case 'SpecialChar':oItem=new FCKToolbarButton('SpecialChar',FCKLang.InsertSpecialCharLbl,FCKLang.InsertSpecialChar);break;case 'Smiley':oItem=new FCKToolbarButton('Smiley',FCKLang.InsertSmileyLbl,FCKLang.InsertSmiley);break;case 'UniversalKey':oItem=new FCKToolbarButton('UniversalKey',FCKLang.UniversalKeyboard);break;case 'Rule':oItem=new FCKToolbarButton('InsertHorizontalRule',FCKLang.InsertLineLbl,FCKLang.InsertLine);break;case 'JustifyLeft':oItem=new FCKToolbarButton('JustifyLeft',FCKLang.LeftJustify,null,null,false,true);break;case 'JustifyCenter':oItem=new FCKToolbarButton('JustifyCenter',FCKLang.CenterJustify,null,null,false,true);break;case 'JustifyRight':oItem=new FCKToolbarButton('JustifyRight',FCKLang.RightJustify,null,null,false,true);break;case 'JustifyFull':oItem=new FCKToolbarButton('JustifyFull',FCKLang.BlockJustify,null,null,false,true);break;case 'Style':oItem=new FCKToolbarStyleCombo();break;case 'FontName':oItem=new FCKToolbarFontsCombo();break;case 'FontSize':oItem=new FCKToolbarFontSizeCombo();break;case 'FontFormat':oItem=new FCKToolbarFontFormatCombo();break;case 'TextColor':oItem=new FCKToolbarPanelButton('TextColor',FCKLang.TextColor);break;case 'BGColor':oItem=new FCKToolbarPanelButton('BGColor',FCKLang.BGColor);break;case 'Find':oItem=new FCKToolbarButton('Find',FCKLang.Find);break;case 'Replace':oItem=new FCKToolbarButton('Replace',FCKLang.Replace);break;case 'Form':oItem=new FCKToolbarButton('Form',FCKLang.Form);break;case 'Checkbox':oItem=new FCKToolbarButton('Checkbox',FCKLang.Checkbox);break;case 'Radio':oItem=new FCKToolbarButton('Radio',FCKLang.RadioButton);break;case 'TextField':oItem=new FCKToolbarButton('TextField',FCKLang.TextField);break;case 'Textarea':oItem=new FCKToolbarButton('Textarea',FCKLang.Textarea);break;case 'HiddenField':oItem=new FCKToolbarButton('HiddenField',FCKLang.HiddenField);break;case 'Button':oItem=new FCKToolbarButton('Button',FCKLang.Button);break;case 'Select':oItem=new FCKToolbarButton('Select',FCKLang.SelectionField);break;case 'ImageButton':oItem=new FCKToolbarButton('ImageButton',FCKLang.ImageButton);break;default:alert(FCKLang.UnknownToolbarItem.replace(/%1/g,itemName));return;};FCKToolbarItems.LoadedItems[itemName]=oItem;return oItem;} var FCKToolbar=function(width_){this.Items=new Array();this.DOMTable=document.createElement('table');this.DOMTable.className='TB_Toolbar';with (this.DOMTable){style.styleFloat=style.cssFloat=FCKLang.Dir=='rtl'?'right':'left';cellPadding=0;cellSpacing=0;border=0;if (width_&&width_>0) {width=width_+'%';};};this.DOMRow=this.DOMTable.insertRow(-1);var oCell=this.DOMRow.insertCell(-1);oCell.className='TB_Start';oCell.innerHTML='';FCKToolbarSet.DOMElement.appendChild(this.DOMTable);};FCKToolbar.prototype.AddItem=function(toolbarItem){this.Items[this.Items.length]=toolbarItem;toolbarItem.CreateInstance(this);};FCKToolbar.prototype.AddEmpty=function(){var oCell=this.DOMRow.insertCell(-1);oCell.unselectable='on';oCell.width='50%';oCell.innerHTML='';};FCKToolbar.prototype.AddSeparator=function(){var oCell=this.DOMRow.insertCell(-1);oCell.unselectable='on';oCell.innerHTML='';};FCKToolbar.prototype.AddTerminator=function(){var oCell=this.DOMRow.insertCell(-1);oCell.className='TB_End';oCell.innerHTML='';};FCKToolbar.prototype.AddBigSeparator=function(){var oCell=this.DOMRow.insertCell(-1);oCell.className='TB_Start';oCell.innerHTML='';};