Index: trunk/admin/editor/cmseditor/editor/_source/internals/fck_2.js =================================================================== diff -u -r2442 -r2507 --- trunk/admin/editor/cmseditor/editor/_source/internals/fck_2.js (.../fck_2.js) (revision 2442) +++ trunk/admin/editor/cmseditor/editor/_source/internals/fck_2.js (.../fck_2.js) (revision 2507) @@ -33,7 +33,7 @@ { FCK.Focus() ; //alert(commandName); - + FCK.EditorDocument.execCommand( commandName, false, commandParameter ) ; FCK.Events.FireEvent( 'OnSelectionChange' ) ; } @@ -51,21 +51,14 @@ else { switch ( commandName ) { -/* - case 'CreateLink' : case 'Unlink' : - oDocument = FCK.Selection.MoveToAncestorNode( 'A' ) ; - if ( oDocument ) - { - //FCK.Selection.MoveToNode( oDocument ) ; - if (oDocument.getAttribute('label',2) == 'Doc') - return FCK_TRISTATE_DISABLED; - else + oLink = FCK.Selection.MoveToAncestorNode( 'A' ) ; + if (oLink) return FCK.EditorDocument.queryCommandState( commandName ) ? FCK_TRISTATE_ON : FCK_TRISTATE_OFF ; - } else - return FCK.EditorDocument.queryCommandState( commandName ) ? FCK_TRISTATE_ON : FCK_TRISTATE_OFF ; + else + return FCK_TRISTATE_DISABLED; break; -*/ + default: return FCK.EditorDocument.queryCommandState( commandName ) ? FCK_TRISTATE_ON : FCK_TRISTATE_OFF ; } @@ -77,6 +70,8 @@ } } + + FCK.GetNamedCommandValue = function( commandName ) { Index: trunk/admin/editor/cmseditor/editor/_source/internals/fck_1.js =================================================================== diff -u -r1999 -r2507 --- trunk/admin/editor/cmseditor/editor/_source/internals/fck_1.js (.../fck_1.js) (revision 1999) +++ trunk/admin/editor/cmseditor/editor/_source/internals/fck_1.js (.../fck_1.js) (revision 2507) @@ -55,10 +55,6 @@ // Force the focus in the window to go to the editor. window.onfocus = window.document.body.onfocus = FCK.Focus ; - // Force the focus in the editor. - if ( FCKConfig.StartupFocus ) - FCK.Focus() ; - // @Packager.Compactor.Remove.Start var sBrowserSuffix = FCKBrowserInfo.IsIE ? "ie" : "gecko" ; @@ -123,6 +119,10 @@ if ( this.OnStatusChange ) this.OnStatusChange( newStatus ) ; if (typeof(FCKConfig.newBgColor) != 'undefined') this.EditorDocument.bgColor = FCKConfig.newBgColor; + // Force the focus in the editor. + if ( FCKConfig.StartupFocus ) + FCK.Focus() ; + } FCK.GetHTML = function( format ) Index: trunk/admin/editor/cmseditor/fckeditor.js =================================================================== diff -u -r2493 -r2507 --- trunk/admin/editor/cmseditor/fckeditor.js (.../fckeditor.js) (revision 2493) +++ trunk/admin/editor/cmseditor/fckeditor.js (.../fckeditor.js) (revision 2507) @@ -167,7 +167,7 @@ text = text.replace(//g, ">") ; text = text.replace(/'/g, "'") ; - text = text.replace(/-/g, "-") ; + //text = text.replace(/-/g, "-") ; //text = text.replace( /&lt;/g, "<" ) ; //text = text.replace( /&qt;/g, "&qt;" ) ; Index: trunk/admin/editor/cmseditor/editor/js/fckeditorcode_ie_2.js =================================================================== diff -u -r2442 -r2507 --- trunk/admin/editor/cmseditor/editor/js/fckeditorcode_ie_2.js (.../fckeditorcode_ie_2.js) (revision 2442) +++ trunk/admin/editor/cmseditor/editor/js/fckeditorcode_ie_2.js (.../fckeditorcode_ie_2.js) (revision 2507) @@ -10,7 +10,7 @@ * * This file has been compacted for best loading performance. */ -FCK.RedirectNamedCommands=new Object();var oWindow=new Object();FCK.ExecuteNamedCommand=function(commandName,commandParameter){if (FCK.RedirectNamedCommands[commandName]!=null) {FCK.ExecuteRedirectedNamedCommand(commandName,commandParameter);}else{FCK.Focus();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.ProjectPath+'/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 {if (typeof(FCKConfig.preview_width)!='undefined'&&typeof(FCKConfig.preview_height)!='undefined'&&FCKConfig.preview_width>0&&FCKConfig.preview_height>0) var oWindowE=window.open('',null,'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+FCKConfig.preview_width+',height='+FCKConfig.preview_height);else var oWindowE=window.open('',null,'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');var sHTML=''+FCK.GetHTML()+'';oWindowE.document.write(sHTML);oWindowE.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();if (typeof(FCKConfig.newBgColor)!='undefined') FCK.EditorDocument.bgColor=FCKConfig.newBgColor;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.ProjectPath+'/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 {if (typeof(FCKConfig.preview_width)!='undefined'&&typeof(FCKConfig.preview_height)!='undefined'&&FCKConfig.preview_width>0&&FCKConfig.preview_height>0) var oWindowE=window.open('',null,'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+FCKConfig.preview_width+',height='+FCKConfig.preview_height);else var oWindowE=window.open('',null,'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');var sHTML=''+FCK.GetHTML()+'';oWindowE.document.write(sHTML);oWindowE.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();if (typeof(FCKConfig.newBgColor)!='undefined') FCK.EditorDocument.bgColor=FCKConfig.newBgColor;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;i0) FCKXHtml._AppendAttribute(node,'shape',sCoords);};return node;};FCKXHtml.TagProcessors['label']=function(node,htmlNode){if (htmlNode.htmlFor.length>0) FCKXHtml._AppendAttribute(node,'for',htmlNode.htmlFor);FCKXHtml._AppendChildNodes(node,htmlNode);return node;};FCKXHtml.TagProcessors['form']=function(node,htmlNode){if (htmlNode.acceptCharset.length>0&&htmlNode.acceptCharset!='UNKNOWN') FCKXHtml._AppendAttribute(node,'accept-charset',htmlNode.acceptCharset);FCKXHtml._AppendChildNodes(node,htmlNode);return node;} var FCKCodeFormatter=new Object();FCKCodeFormatter.Regex=new Object();FCKCodeFormatter.Regex.BlocksOpener=/\<(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|AREA|OPTION)[^\>]*\>/gi;FCKCodeFormatter.Regex.BlocksCloser=/\<\/(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|AREA|OPTION)[^\>]*\>/gi;FCKCodeFormatter.Regex.NewLineTags=/\<(BR|HR)[^\>]\>/gi;FCKCodeFormatter.Regex.MainTags=/\<\/?(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR)[^\>]*\>/gi;FCKCodeFormatter.Regex.LineSplitter=/\s*\n+\s*/g;FCKCodeFormatter.Regex.IncreaseIndent=/^\<(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL)[ \/\>]/i;FCKCodeFormatter.Regex.DecreaseIndent=/^\<\/(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL)[ \>]/i;FCKCodeFormatter.Regex.FormatIndentatorRemove=new RegExp(FCKConfig.FormatIndentator);FCKCodeFormatter.Format=function(html){var sFormatted=html.replace(this.Regex.BlocksOpener,'\n$&');;sFormatted=sFormatted.replace(this.Regex.BlocksCloser,'$&\n');sFormatted=sFormatted.replace(this.Regex.NewLineTags,'$&\n');sFormatted=sFormatted.replace(this.Regex.MainTags,'\n$&\n');var sIndentation='';var asLines=sFormatted.split(this.Regex.LineSplitter);sFormatted='';for (var i=0;i=0&&sHtml==FCKUndo.SavedData[FCKUndo.CurrentIndex][0]) return;if (FCKUndo.CurrentIndex+1>=FCKConfig.MaxUndoLevels) FCKUndo.SavedData.shift();else FCKUndo.CurrentIndex++;var sBookmark;if (FCK.EditorDocument.selection.type=='Text') sBookmark=FCK.EditorDocument.selection.createRange().getBookmark();FCKUndo.SavedData[FCKUndo.CurrentIndex]=[sHtml,sBookmark];FCK.Events.FireEvent("OnSelectionChange");};FCKUndo.Undo=function(){if (FCKUndo.CurrentIndex>0){if (FCKUndo.CurrentIndex==(FCKUndo.SavedData.length-1)){FCKUndo.SaveUndoStep();};FCKUndo._ApplyUndoLevel(--FCKUndo.CurrentIndex);FCK.Events.FireEvent("OnSelectionChange");};};FCKUndo.Redo=function(){if (FCKUndo.CurrentIndex<(FCKUndo.SavedData.length-1)){FCKUndo._ApplyUndoLevel(++FCKUndo.CurrentIndex);FCK.Events.FireEvent("OnSelectionChange");};};FCKUndo._ApplyUndoLevel=function(level){var oData=FCKUndo.SavedData[level];FCK.EditorDocument.body.innerHTML=oData[0];if (oData[1]){var oRange=FCK.EditorDocument.selection.createRange();oRange.moveToBookmark(oData[1]);oRange.select();};} -FCK.Events=new FCKEvents(FCK);FCK.Toolbar=null;FCK.TempBaseTag=FCKConfig.BaseHref.length>0?'':'';FCK.StartEditor=function(){this.EditorWindow=window.frames['eEditorArea'];this.EditorDocument=this.EditorWindow.document;if (FCKBrowserInfo.IsGecko) this.MakeEditable();this.SetHTML(FCKTools.GetLinkedFieldValue());FCKTools.AttachToLinkedFieldFormSubmit(this.UpdateLinkedField);this.SetStatus(FCK_STATUS_ACTIVE);};FCK.SetStatus=function(newStatus){this.Status=newStatus;if (newStatus==FCK_STATUS_ACTIVE){window.onfocus=window.document.body.onfocus=FCK.Focus;if (FCKConfig.StartupFocus) FCK.Focus();if (FCKBrowserInfo.IsIE) FCKScriptLoader.AddScript('js/fckeditorcode_ie_2.js');else FCKScriptLoader.AddScript('js/fckeditorcode_gecko_2.js');};this.Events.FireEvent('OnStatusChange',newStatus);if (this.OnStatusChange) this.OnStatusChange(newStatus);if (typeof(FCKConfig.newBgColor)!='undefined') this.EditorDocument.bgColor=FCKConfig.newBgColor;};FCK.GetHTML=function(format){var sHTML;if (FCK.EditMode==FCK_EDITMODE_WYSIWYG){if (FCKBrowserInfo.IsIE) sHTML=this.EditorDocument.body.innerHTML.replace(FCKRegexLib.ToReplace,'$1');else sHTML=this.EditorDocument.body.innerHTML;}else sHTML=document.getElementById('eSourceField').value;if (format) return FCKCodeFormatter.Format(sHTML);else return sHTML;};FCK.GetXHTML=function(format){var bSource=(FCK.EditMode==FCK_EDITMODE_SOURCE);if (bSource) this.SwitchEditMode();if (FCKConfig.FullPage) var sXHTML=FCKXHtml.GetXHTML(this.EditorDocument.getElementsByTagName('html')[0],true,format);else var sXHTML=FCKXHtml.GetXHTML(this.EditorDocument.body,false,format);if (bSource) this.SwitchEditMode();if (FCKBrowserInfo.IsIE) sXHTML=sXHTML.replace(FCKRegexLib.ToReplace,'$1');if (FCK.DocTypeDeclaration&&FCK.DocTypeDeclaration.length>0) sXHTML=FCK.DocTypeDeclaration+'\n'+sXHTML;if (FCK.XmlDeclaration&&FCK.XmlDeclaration.length>0) sXHTML=FCK.XmlDeclaration+'\n'+sXHTML;return sXHTML;};FCK.UpdateLinkedField=function(){if (FCKConfig.EnableXHTML) FCKTools.SetLinkedFieldValue(FCK.GetXHTML(FCKConfig.FormatOutput));else FCKTools.SetLinkedFieldValue(FCK.GetHTML(FCKConfig.FormatOutput));};FCK.ShowContextMenu=function(x,y){if (this.Status!=FCK_STATUS_COMPLETE) return;FCKContextMenu.Show(x,y);this.Events.FireEvent("OnContextMenu");};FCK.RegisteredDoubleClickHandlers=new Object();FCK.OnDoubleClick=function(element){var oHandler=FCK.RegisteredDoubleClickHandlers[element.tagName];if (oHandler){oHandler(element);};};FCK.RegisterDoubleClickHandler=function(handlerFunction,tag){FCK.RegisteredDoubleClickHandlers[tag.toUpperCase()]=handlerFunction;}; +FCK.Events=new FCKEvents(FCK);FCK.Toolbar=null;FCK.TempBaseTag=FCKConfig.BaseHref.length>0?'':'';FCK.StartEditor=function(){this.EditorWindow=window.frames['eEditorArea'];this.EditorDocument=this.EditorWindow.document;if (FCKBrowserInfo.IsGecko) this.MakeEditable();this.SetHTML(FCKTools.GetLinkedFieldValue());FCKTools.AttachToLinkedFieldFormSubmit(this.UpdateLinkedField);this.SetStatus(FCK_STATUS_ACTIVE);};FCK.SetStatus=function(newStatus){this.Status=newStatus;if (newStatus==FCK_STATUS_ACTIVE){window.onfocus=window.document.body.onfocus=FCK.Focus;if (FCKBrowserInfo.IsIE) FCKScriptLoader.AddScript('js/fckeditorcode_ie_2.js');else FCKScriptLoader.AddScript('js/fckeditorcode_gecko_2.js');};this.Events.FireEvent('OnStatusChange',newStatus);if (this.OnStatusChange) this.OnStatusChange(newStatus);if (typeof(FCKConfig.newBgColor)!='undefined') this.EditorDocument.bgColor=FCKConfig.newBgColor;if (FCKConfig.StartupFocus) FCK.Focus();};FCK.GetHTML=function(format){var sHTML;if (FCK.EditMode==FCK_EDITMODE_WYSIWYG){if (FCKBrowserInfo.IsIE) sHTML=this.EditorDocument.body.innerHTML.replace(FCKRegexLib.ToReplace,'$1');else sHTML=this.EditorDocument.body.innerHTML;}else sHTML=document.getElementById('eSourceField').value;if (format) return FCKCodeFormatter.Format(sHTML);else return sHTML;};FCK.GetXHTML=function(format){var bSource=(FCK.EditMode==FCK_EDITMODE_SOURCE);if (bSource) this.SwitchEditMode();if (FCKConfig.FullPage) var sXHTML=FCKXHtml.GetXHTML(this.EditorDocument.getElementsByTagName('html')[0],true,format);else var sXHTML=FCKXHtml.GetXHTML(this.EditorDocument.body,false,format);if (bSource) this.SwitchEditMode();if (FCKBrowserInfo.IsIE) sXHTML=sXHTML.replace(FCKRegexLib.ToReplace,'$1');if (FCK.DocTypeDeclaration&&FCK.DocTypeDeclaration.length>0) sXHTML=FCK.DocTypeDeclaration+'\n'+sXHTML;if (FCK.XmlDeclaration&&FCK.XmlDeclaration.length>0) sXHTML=FCK.XmlDeclaration+'\n'+sXHTML;return sXHTML;};FCK.UpdateLinkedField=function(){if (FCKConfig.EnableXHTML) FCKTools.SetLinkedFieldValue(FCK.GetXHTML(FCKConfig.FormatOutput));else FCKTools.SetLinkedFieldValue(FCK.GetHTML(FCKConfig.FormatOutput));};FCK.ShowContextMenu=function(x,y){if (this.Status!=FCK_STATUS_COMPLETE) return;FCKContextMenu.Show(x,y);this.Events.FireEvent("OnContextMenu");};FCK.RegisteredDoubleClickHandlers=new Object();FCK.OnDoubleClick=function(element){var oHandler=FCK.RegisteredDoubleClickHandlers[element.tagName];if (oHandler){oHandler(element);};};FCK.RegisterDoubleClickHandler=function(handlerFunction,tag){FCK.RegisteredDoubleClickHandlers[tag.toUpperCase()]=handlerFunction;}; FCK.Description="FCKeditor for Internet Explorer 5.5+";FCK._BehaviorsStyle='';FCK.InitializeBehaviors=function(dontReturn){this.EditorDocument.onmousedown=this.EditorDocument.onmouseup=function(){FCK.Focus();FCK.EditorWindow.event.cancelBubble=true;FCK.EditorWindow.event.returnValue=false;};this.EditorDocument.body.onpaste=function(){if (FCK.Status==FCK_STATUS_COMPLETE) return FCK.Events.FireEvent("OnPaste");else return false;};this.EditorDocument.oncontextmenu=function(){var e=this.parentWindow.event;FCK.ShowContextMenu(e.screenX,e.screenY);return false;};if (FCKConfig.UseBROnCarriageReturn||FCKConfig.TabSpaces>0){if (FCKConfig.TabSpaces>0){window.FCKTabHTML='';for (i=0;i ");var oRange=FCK.EditorDocument.selection.createRange();oRange.moveStart('character',-1);oRange.select();FCK.EditorDocument.selection.clear();return false;};}else if (e.keyCode==9&&FCKConfig.TabSpaces>0&&!(e.ctrlKey||e.altKey||e.shiftKey)){FCK.InsertHtml(window.FCKTabHTML);return false;};return true;};};this.EditorDocument.ondblclick=function(){FCK.OnDoubleClick(FCK.EditorWindow.event.srcElement);FCK.EditorWindow.event.cancelBubble=true;};this.EditorDocument.onselectionchange=function(){FCK.Events.FireEvent("OnSelectionChange");};};FCK.Focus=function(){try{if (FCK.EditMode==FCK_EDITMODE_WYSIWYG) FCK.EditorDocument.body.focus();else document.getElementById('eSourceField').focus();}catch(e) {};};FCK.SetHTML=function(html,forceWYSIWYG){if (forceWYSIWYG||FCK.EditMode==FCK_EDITMODE_WYSIWYG){this.EditorDocument.open();if (FCKConfig.FullPage){var sExtraHtml=FCK._BehaviorsStyle+'';if (FCK.TempBaseTag.length>0&&!FCKRegexLib.HasBaseTag.test(html)) sExtraHtml+=FCK.TempBaseTag;html=html.replace(FCKRegexLib.HeadCloser,sExtraHtml+'');this.EditorDocument.write(html);}else{var sHtml=''+''+''+'';sHtml+=FCK._BehaviorsStyle;sHtml+=FCK.TempBaseTag;sHtml+=''+html+'';this.EditorDocument.write(sHtml);};this.EditorDocument.close();this.InitializeBehaviors();this.EditorDocument.body.contentEditable=true;this.Events.FireEvent('OnAfterSetHTML');}else document.getElementById('eSourceField').value=html;};FCK.InsertHtml=function(html){FCK.Focus();var oSel=FCK.EditorDocument.selection;if (oSel.type.toLowerCase()!="none") oSel.clear();oSel.createRange().pasteHTML(html);}; Index: trunk/admin/editor/cmseditor/editor/js/fckeditorcode_gecko_2.js =================================================================== diff -u -r2442 -r2507 --- trunk/admin/editor/cmseditor/editor/js/fckeditorcode_gecko_2.js (.../fckeditorcode_gecko_2.js) (revision 2442) +++ trunk/admin/editor/cmseditor/editor/js/fckeditorcode_gecko_2.js (.../fckeditorcode_gecko_2.js) (revision 2507) @@ -10,7 +10,7 @@ * * This file has been compacted for best loading performance. */ -FCK.RedirectNamedCommands=new Object();var oWindow=new Object();FCK.ExecuteNamedCommand=function(commandName,commandParameter){if (FCK.RedirectNamedCommands[commandName]!=null) {FCK.ExecuteRedirectedNamedCommand(commandName,commandParameter);}else{FCK.Focus();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.ProjectPath+'/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 {if (typeof(FCKConfig.preview_width)!='undefined'&&typeof(FCKConfig.preview_height)!='undefined'&&FCKConfig.preview_width>0&&FCKConfig.preview_height>0) var oWindowE=window.open('',null,'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+FCKConfig.preview_width+',height='+FCKConfig.preview_height);else var oWindowE=window.open('',null,'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');var sHTML=''+FCK.GetHTML()+'';oWindowE.document.write(sHTML);oWindowE.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();if (typeof(FCKConfig.newBgColor)!='undefined') FCK.EditorDocument.bgColor=FCKConfig.newBgColor;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.ProjectPath+'/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 {if (typeof(FCKConfig.preview_width)!='undefined'&&typeof(FCKConfig.preview_height)!='undefined'&&FCKConfig.preview_width>0&&FCKConfig.preview_height>0) var oWindowE=window.open('',null,'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+FCKConfig.preview_width+',height='+FCKConfig.preview_height);else var oWindowE=window.open('',null,'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');var sHTML=''+FCK.GetHTML()+'';oWindowE.document.write(sHTML);oWindowE.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();if (typeof(FCKConfig.newBgColor)!='undefined') FCK.EditorDocument.bgColor=FCKConfig.newBgColor;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]*\>/gi;FCKCodeFormatter.Regex.BlocksCloser=/\<\/(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|AREA|OPTION)[^\>]*\>/gi;FCKCodeFormatter.Regex.NewLineTags=/\<(BR|HR)[^\>]\>/gi;FCKCodeFormatter.Regex.MainTags=/\<\/?(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR)[^\>]*\>/gi;FCKCodeFormatter.Regex.LineSplitter=/\s*\n+\s*/g;FCKCodeFormatter.Regex.IncreaseIndent=/^\<(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL)[ \/\>]/i;FCKCodeFormatter.Regex.DecreaseIndent=/^\<\/(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL)[ \>]/i;FCKCodeFormatter.Regex.FormatIndentatorRemove=new RegExp(FCKConfig.FormatIndentator);FCKCodeFormatter.Format=function(html){var sFormatted=html.replace(this.Regex.BlocksOpener,'\n$&');;sFormatted=sFormatted.replace(this.Regex.BlocksCloser,'$&\n');sFormatted=sFormatted.replace(this.Regex.NewLineTags,'$&\n');sFormatted=sFormatted.replace(this.Regex.MainTags,'\n$&\n');var sIndentation='';var asLines=sFormatted.split(this.Regex.LineSplitter);sFormatted='';for (var i=0;i=0&&sHtml==FCKUndo.SavedData[FCKUndo.CurrentIndex][0]) return;if (FCKUndo.CurrentIndex+1>=FCKConfig.MaxUndoLevels) FCKUndo.SavedData.shift();else FCKUndo.CurrentIndex++;var sBookmark;if (FCK.EditorDocument.selection.type=='Text') sBookmark=FCK.EditorDocument.selection.createRange().getBookmark();FCKUndo.SavedData[FCKUndo.CurrentIndex]=[sHtml,sBookmark];FCK.Events.FireEvent("OnSelectionChange");};FCKUndo.Undo=function(){if (FCKUndo.CurrentIndex>0){if (FCKUndo.CurrentIndex==(FCKUndo.SavedData.length-1)){FCKUndo.SaveUndoStep();};FCKUndo._ApplyUndoLevel(--FCKUndo.CurrentIndex);FCK.Events.FireEvent("OnSelectionChange");};};FCKUndo.Redo=function(){if (FCKUndo.CurrentIndex<(FCKUndo.SavedData.length-1)){FCKUndo._ApplyUndoLevel(++FCKUndo.CurrentIndex);FCK.Events.FireEvent("OnSelectionChange");};};FCKUndo._ApplyUndoLevel=function(level){var oData=FCKUndo.SavedData[level];FCK.EditorDocument.body.innerHTML=oData[0];if (oData[1]){var oRange=FCK.EditorDocument.selection.createRange();oRange.moveToBookmark(oData[1]);oRange.select();};} -FCK.Events=new FCKEvents(FCK);FCK.Toolbar=null;FCK.TempBaseTag=FCKConfig.BaseHref.length>0?'':'';FCK.StartEditor=function(){this.EditorWindow=window.frames['eEditorArea'];this.EditorDocument=this.EditorWindow.document;if (FCKBrowserInfo.IsGecko) this.MakeEditable();this.SetHTML(FCKTools.GetLinkedFieldValue());FCKTools.AttachToLinkedFieldFormSubmit(this.UpdateLinkedField);this.SetStatus(FCK_STATUS_ACTIVE);};FCK.SetStatus=function(newStatus){this.Status=newStatus;if (newStatus==FCK_STATUS_ACTIVE){window.onfocus=window.document.body.onfocus=FCK.Focus;if (FCKConfig.StartupFocus) FCK.Focus();if (FCKBrowserInfo.IsIE) FCKScriptLoader.AddScript('js/fckeditorcode_ie_2.js');else FCKScriptLoader.AddScript('js/fckeditorcode_gecko_2.js');};this.Events.FireEvent('OnStatusChange',newStatus);if (this.OnStatusChange) this.OnStatusChange(newStatus);if (typeof(FCKConfig.newBgColor)!='undefined') this.EditorDocument.bgColor=FCKConfig.newBgColor;};FCK.GetHTML=function(format){var sHTML;if (FCK.EditMode==FCK_EDITMODE_WYSIWYG){if (FCKBrowserInfo.IsIE) sHTML=this.EditorDocument.body.innerHTML.replace(FCKRegexLib.ToReplace,'$1');else sHTML=this.EditorDocument.body.innerHTML;}else sHTML=document.getElementById('eSourceField').value;if (format) return FCKCodeFormatter.Format(sHTML);else return sHTML;};FCK.GetXHTML=function(format){var bSource=(FCK.EditMode==FCK_EDITMODE_SOURCE);if (bSource) this.SwitchEditMode();if (FCKConfig.FullPage) var sXHTML=FCKXHtml.GetXHTML(this.EditorDocument.getElementsByTagName('html')[0],true,format);else var sXHTML=FCKXHtml.GetXHTML(this.EditorDocument.body,false,format);if (bSource) this.SwitchEditMode();if (FCKBrowserInfo.IsIE) sXHTML=sXHTML.replace(FCKRegexLib.ToReplace,'$1');if (FCK.DocTypeDeclaration&&FCK.DocTypeDeclaration.length>0) sXHTML=FCK.DocTypeDeclaration+'\n'+sXHTML;if (FCK.XmlDeclaration&&FCK.XmlDeclaration.length>0) sXHTML=FCK.XmlDeclaration+'\n'+sXHTML;return sXHTML;};FCK.UpdateLinkedField=function(){if (FCKConfig.EnableXHTML) FCKTools.SetLinkedFieldValue(FCK.GetXHTML(FCKConfig.FormatOutput));else FCKTools.SetLinkedFieldValue(FCK.GetHTML(FCKConfig.FormatOutput));};FCK.ShowContextMenu=function(x,y){if (this.Status!=FCK_STATUS_COMPLETE) return;FCKContextMenu.Show(x,y);this.Events.FireEvent("OnContextMenu");};FCK.RegisteredDoubleClickHandlers=new Object();FCK.OnDoubleClick=function(element){var oHandler=FCK.RegisteredDoubleClickHandlers[element.tagName];if (oHandler){oHandler(element);};};FCK.RegisterDoubleClickHandler=function(handlerFunction,tag){FCK.RegisteredDoubleClickHandlers[tag.toUpperCase()]=handlerFunction;}; +FCK.Events=new FCKEvents(FCK);FCK.Toolbar=null;FCK.TempBaseTag=FCKConfig.BaseHref.length>0?'':'';FCK.StartEditor=function(){this.EditorWindow=window.frames['eEditorArea'];this.EditorDocument=this.EditorWindow.document;if (FCKBrowserInfo.IsGecko) this.MakeEditable();this.SetHTML(FCKTools.GetLinkedFieldValue());FCKTools.AttachToLinkedFieldFormSubmit(this.UpdateLinkedField);this.SetStatus(FCK_STATUS_ACTIVE);};FCK.SetStatus=function(newStatus){this.Status=newStatus;if (newStatus==FCK_STATUS_ACTIVE){window.onfocus=window.document.body.onfocus=FCK.Focus;if (FCKBrowserInfo.IsIE) FCKScriptLoader.AddScript('js/fckeditorcode_ie_2.js');else FCKScriptLoader.AddScript('js/fckeditorcode_gecko_2.js');};this.Events.FireEvent('OnStatusChange',newStatus);if (this.OnStatusChange) this.OnStatusChange(newStatus);if (typeof(FCKConfig.newBgColor)!='undefined') this.EditorDocument.bgColor=FCKConfig.newBgColor;if (FCKConfig.StartupFocus) FCK.Focus();};FCK.GetHTML=function(format){var sHTML;if (FCK.EditMode==FCK_EDITMODE_WYSIWYG){if (FCKBrowserInfo.IsIE) sHTML=this.EditorDocument.body.innerHTML.replace(FCKRegexLib.ToReplace,'$1');else sHTML=this.EditorDocument.body.innerHTML;}else sHTML=document.getElementById('eSourceField').value;if (format) return FCKCodeFormatter.Format(sHTML);else return sHTML;};FCK.GetXHTML=function(format){var bSource=(FCK.EditMode==FCK_EDITMODE_SOURCE);if (bSource) this.SwitchEditMode();if (FCKConfig.FullPage) var sXHTML=FCKXHtml.GetXHTML(this.EditorDocument.getElementsByTagName('html')[0],true,format);else var sXHTML=FCKXHtml.GetXHTML(this.EditorDocument.body,false,format);if (bSource) this.SwitchEditMode();if (FCKBrowserInfo.IsIE) sXHTML=sXHTML.replace(FCKRegexLib.ToReplace,'$1');if (FCK.DocTypeDeclaration&&FCK.DocTypeDeclaration.length>0) sXHTML=FCK.DocTypeDeclaration+'\n'+sXHTML;if (FCK.XmlDeclaration&&FCK.XmlDeclaration.length>0) sXHTML=FCK.XmlDeclaration+'\n'+sXHTML;return sXHTML;};FCK.UpdateLinkedField=function(){if (FCKConfig.EnableXHTML) FCKTools.SetLinkedFieldValue(FCK.GetXHTML(FCKConfig.FormatOutput));else FCKTools.SetLinkedFieldValue(FCK.GetHTML(FCKConfig.FormatOutput));};FCK.ShowContextMenu=function(x,y){if (this.Status!=FCK_STATUS_COMPLETE) return;FCKContextMenu.Show(x,y);this.Events.FireEvent("OnContextMenu");};FCK.RegisteredDoubleClickHandlers=new Object();FCK.OnDoubleClick=function(element){var oHandler=FCK.RegisteredDoubleClickHandlers[element.tagName];if (oHandler){oHandler(element);};};FCK.RegisterDoubleClickHandler=function(handlerFunction,tag){FCK.RegisteredDoubleClickHandlers[tag.toUpperCase()]=handlerFunction;}; FCK.Description="FCKeditor for Gecko Browsers";FCK.InitializeBehaviors=function(){var oOnContextMenu=function(e){e.preventDefault();FCK.ShowContextMenu(e.clientX,e.clientY);};this.EditorDocument.addEventListener('contextmenu',oOnContextMenu,true);var oOnKeyDown=function(e){if (e.ctrlKey&&!e.shiftKey&&!e.altKey){if (e.which==86||e.which==118){if (FCK.Status==FCK_STATUS_COMPLETE){if (!FCK.Events.FireEvent("OnPaste")) e.preventDefault();}else e.preventDefault();};};};this.EditorDocument.addEventListener('keydown',oOnKeyDown,true);this.ExecOnSelectionChange=function(){FCK.Events.FireEvent("OnSelectionChange");};this.ExecOnSelectionChangeTimer=function(){if (FCK.LastOnChangeTimer) window.clearTimeout(FCK.LastOnChangeTimer);FCK.LastOnChangeTimer=window.setTimeout(FCK.ExecOnSelectionChange,100);};this.EditorDocument.addEventListener('mouseup',this.ExecOnSelectionChange,false);this.EditorDocument.addEventListener('keyup',this.ExecOnSelectionChangeTimer,false);this._DblClickListener=function(e){FCK.OnDoubleClick(e.target);e.stopPropagation();};this.EditorDocument.addEventListener('dblclick',this._DblClickListener,true);this._OnLoad=function(){if (this._FCK_HTML){this.document.body.innerHTML=this._FCK_HTML;this._FCK_HTML=null;};};this.EditorWindow.addEventListener('load',this._OnLoad,true);};FCK.MakeEditable=function(){this.EditorWindow.document.designMode='on';this.EditorWindow.document.execCommand('useCSS',false,!FCKConfig.GeckoUseSPAN);};FCK.Focus=function(){try{FCK.EditorWindow.focus();}catch(e) {};};FCK.SetHTML=function(html,forceWYSIWYG){if (forceWYSIWYG||FCK.EditMode==FCK_EDITMODE_WYSIWYG){this.EditorDocument.open();if (FCKConfig.FullPage&&FCKRegexLib.BodyContents.test(html)){if (FCK.TempBaseTag.length>0&&!FCKRegexLib.HasBaseTag.test(html)) html=html.replace(FCKRegexLib.HeadCloser,FCK.TempBaseTag+'');html=html.replace(FCKRegexLib.HeadCloser,'');var oMatch=html.match(FCKRegexLib.BodyContents);var sOpener=oMatch[1];var sContents=oMatch[2];var sCloser=oMatch[3];this.EditorDocument.write(sOpener+' '+sCloser);}else{var sHtml=''+''+''+'';sHtml+=FCK.TempBaseTag;sHtml+=' ';this.EditorDocument.write(sHtml);};this.EditorDocument.close();if (this.EditorDocument.body) this.EditorDocument.body.innerHTML=sContents?sContents:html;else this.EditorWindow._FCK_HTML=sContents?sContents:html;this.InitializeBehaviors();this.Events.FireEvent('OnAfterSetHTML');}else document.getElementById('eSourceField').value=html;};