Index: trunk/admin/editor/cmseditor/editor/_source/internals/fck_2.js =================================================================== diff -u -r1489 -r1528 --- trunk/admin/editor/cmseditor/editor/_source/internals/fck_2.js (.../fck_2.js) (revision 1489) +++ trunk/admin/editor/cmseditor/editor/_source/internals/fck_2.js (.../fck_2.js) (revision 1528) @@ -124,17 +124,38 @@ FCK.Preview = function() { - var oWindow = window.open( '', null, 'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,height='+FCKConfig.preview_height+',width='+FCKConfig.preview_width) ; + 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 ) ; +/* 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() +{ + oWindow.document.getElementById('block_'+FCKConfig.block_id).innerHTML = FCK.GetHTML(); +} + + +function show_props(obj, objName) { + var result = ""; + for (var i in obj) { + result = objName + "." + i + " = " + obj[i] + " \n"; + alert(result); + } + //return result; + } + FCK.SwitchEditMode = function() { // Check if the actual mode is WYSIWYG. Index: trunk/admin/editor/cmseditor/editor/js/fckeditorcode_ie_2.js =================================================================== diff -u -r1489 -r1528 --- trunk/admin/editor/cmseditor/editor/js/fckeditorcode_ie_2.js (.../fckeditorcode_ie_2.js) (revision 1489) +++ trunk/admin/editor/cmseditor/editor/js/fckeditorcode_ie_2.js (.../fckeditorcode_ie_2.js) (revision 1528) @@ -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(){var oWindow=window.open('',null,'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,height='+FCKConfig.preview_height+',width='+FCKConfig.preview_width);var sHTML=''+FCK.GetHTML()+'';oWindow.document.write(sHTML);oWindow.document.close();};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(){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);};FCK.SetPreview=function(){oWindow.document.getElementById('block_'+FCKConfig.block_id).innerHTML=FCK.GetHTML();};function show_props(obj,objName) {var result="";for (var i in obj) {result=objName+"."+i+" = "+obj[i]+" \n";alert(result);};};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';oCell=this._Row.insertCell(-1);oCell.className='CM_Label';oCell.unselectable='on';oCell.noWrap=true;oCell.innerHTML=this.Label;};FCKContextMenuItem.prototype.SetVisible=function(isVisible){this._Row.style.display=isVisible?'':'none';};FCKContextMenuItem.prototype.RefreshState=function(){switch (this.Command.GetState()){case FCK_TRISTATE_ON:case FCK_TRISTATE_OFF:this._Row.className='CM_Option';break;default:this._Row.className='CM_Disabled';break;};}; var FCKContextMenuSeparator=function(){};FCKContextMenuSeparator.prototype.CreateTableRow=function(targetTable){this._Row=targetTable.insertRow(-1);this._Row.className='CM_Separator';var oCell=this._Row.insertCell(-1);oCell.className='CM_Icon';oCell=this._Row.insertCell(-1);oCell.className='CM_Label';oCell.innerHTML='
';};FCKContextMenuSeparator.prototype.SetVisible=function(isVisible){this._Row.style.display=isVisible?'':'none';};FCKContextMenuSeparator.prototype.RefreshState=function(){}; var FCKContextMenuGroup=function(addSeparator,contextMenu,firstItemCommand,firstItemLabel,hasIcon){this.IsVisible=true;this.Items=new Array();if (addSeparator) this.Add(new FCKContextMenuSeparator());if (contextMenu&&firstItemCommand&&firstItemLabel) this.Add(new FCKContextMenuItem(contextMenu,firstItemCommand,firstItemLabel,hasIcon));this.ValidationFunction=null;};FCKContextMenuGroup.prototype.Add=function(contextMenuItem){this.Items[this.Items.length]=contextMenuItem;};FCKContextMenuGroup.prototype.CreateTableRows=function(table){for (var i=0;i0&&oTag.href.length==0);if (this.Groups['Anchor']) this.Groups['Anchor'].SetVisible(bIsAnchor);if (this.Groups['Link']) this.Groups['Link'].SetVisible(!bIsAnchor&&LinkState()==true);if (this.Groups['TableCell']) this.Groups['TableCell'].SetVisible(sTagName!='TABLE'&&FCKSelection.HasAncestorNode('TABLE'));if (this.Groups['Table']) this.Groups['Table'].SetVisible(sTagName=='TABLE');if (this.Groups['Image']) this.Groups['Image'].SetVisible(sTagName=='IMG');if (this.Groups['Document']) this.Groups['Document'].SetVisible(true&&LinkState()==true);if (this.Groups['BulletedList']) this.Groups['BulletedList'].SetVisible(FCKSelection.HasAncestorNode('UL'));if (this.Groups['NumberedList']) this.Groups['NumberedList'].SetVisible(FCKSelection.HasAncestorNode('OL'));if (this.Groups['Select']) this.Groups['Select'].SetVisible(sTagName=='SELECT');if (this.Groups['Textarea']) this.Groups['Textarea'].SetVisible(sTagName=='TEXTAREA');if (this.Groups['Form']) this.Groups['Form'].SetVisible(FCKSelection.HasAncestorNode('FORM'));if (this.Groups['Checkbox']) this.Groups['Checkbox'].SetVisible(sTagName=='INPUT'&&oTag.type=='checkbox');if (this.Groups['Radio']) this.Groups['Radio'].SetVisible(sTagName=='INPUT'&&oTag.type=='radio');if (this.Groups['TextField']) this.Groups['TextField'].SetVisible(sTagName=='INPUT'&&(oTag.type=='text'||oTag.type=='password'));if (this.Groups['HiddenField']) this.Groups['HiddenField'].SetVisible(sTagName=='INPUT'&&oTag.type=='hidden');if (this.Groups['ImageButton']) this.Groups['ImageButton'].SetVisible(sTagName=='INPUT'&&oTag.type=='image');if (this.Groups['Button']) this.Groups['Button'].SetVisible(sTagName=='INPUT'&&(oTag.type=='button'||oTag.type=='submit'||oTag.type=='reset'));for (var o in this.Groups){this.Groups[o].RefreshState();};}; +var FCKContextMenu=new Object();FCKContextMenu._IsLoaded=false;FCKContextMenu.Reload=function(){this._Div=this._Document.createElement('DIV');this._Div.className='CM_ContextMenu';this._Div.style.position='absolute';this._Div.style.visibility='hidden';this._Document.body.appendChild(this._Div);var oTable=this._Document.createElement('TABLE');oTable.cellSpacing=0;oTable.cellPadding=0;oTable.border=0;this._Div.appendChild(oTable);this.Groups=new Object();for (var i=0;i0&&oTag.href.length==0);if (this.Groups['Anchor']) this.Groups['Anchor'].SetVisible(bIsAnchor);if (this.Groups['Link']) this.Groups['Link'].SetVisible(!bIsAnchor&&LinkState()==true);if (this.Groups['TableCell']) this.Groups['TableCell'].SetVisible(sTagName!='TABLE'&&FCKSelection.HasAncestorNode('TABLE'));if (this.Groups['Table']) this.Groups['Table'].SetVisible(sTagName=='TABLE');if (this.Groups['Image']) this.Groups['Image'].SetVisible(sTagName=='IMG');if (this.Groups['Document']) this.Groups['Document'].SetVisible(true&&LinkState()==true);if (this.Groups['BulletedList']) this.Groups['BulletedList'].SetVisible(FCKSelection.HasAncestorNode('UL'));if (this.Groups['NumberedList']) this.Groups['NumberedList'].SetVisible(FCKSelection.HasAncestorNode('OL'));if (this.Groups['Select']) this.Groups['Select'].SetVisible(sTagName=='SELECT');if (this.Groups['Textarea']) this.Groups['Textarea'].SetVisible(sTagName=='TEXTAREA');if (this.Groups['Form']) this.Groups['Form'].SetVisible(FCKSelection.HasAncestorNode('FORM'));if (this.Groups['Checkbox']) this.Groups['Checkbox'].SetVisible(sTagName=='INPUT'&&oTag.type=='checkbox');if (this.Groups['Radio']) this.Groups['Radio'].SetVisible(sTagName=='INPUT'&&oTag.type=='radio');if (this.Groups['TextField']) this.Groups['TextField'].SetVisible(sTagName=='INPUT'&&(oTag.type=='text'||oTag.type=='password'));if (this.Groups['HiddenField']) this.Groups['HiddenField'].SetVisible(sTagName=='INPUT'&&oTag.type=='hidden');if (this.Groups['ImageButton']) this.Groups['ImageButton'].SetVisible(sTagName=='INPUT'&&oTag.type=='image');if (this.Groups['Button']) this.Groups['Button'].SetVisible(sTagName=='INPUT'&&(oTag.type=='button'||oTag.type=='submit'||oTag.type=='reset'));for (var o in this.Groups){this.Groups[o].RefreshState();};}; FCKContextMenu.Show=function(x,y){if (!this._Popup){this._Popup=window.createPopup();this._Document=this._Popup.document;this._Document.createStyleSheet(FCKConfig.SkinPath+'fck_contextmenu.css');this._Document.oncontextmenu=function() { return false;};};if (!this._IsLoaded){this.Reload();this._Div.style.visibility='';};this.RefreshState();this._Popup.show(x,y,0,0);this._Popup.show(x,y,this._Div.offsetWidth,this._Div.offsetHeight);};FCKContextMenu.Hide=function(){if (this._Popup) this._Popup.hide();} if (!FCKConfig.PluginsPath.endsWith('/')) FCKConfig.PluginsPath+='/';var FCKPlugin=function(name,availableLangs,basePath){this.Name=name;this.BasePath=basePath?basePath:FCKConfig.PluginsPath;this.Path=this.BasePath+name+'/';if (!availableLangs||availableLangs.length==0) this.AvailableLangs=new Array();else this.AvailableLangs=availableLangs.split(',');};FCKPlugin.prototype.Load=function(){if (this.AvailableLangs.length>0){if (this.AvailableLangs.indexOf(FCKLanguageManager.ActiveLanguage.Code)>=0) var sLang=FCKLanguageManager.ActiveLanguage.Code;else var sLang=this.AvailableLangs[0];FCKScriptLoader.AddScript(this.Path+'lang/'+sLang+'.js');};FCKScriptLoader.AddScript(this.Path+'fckplugin.js');} var FCKPlugins=FCK.Plugins=new Object();FCKPlugins.ItemsCount=0;FCKPlugins.Loaded=false;FCKPlugins.Items=new Object();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(){var oWindow=window.open('',null,'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,height='+FCKConfig.preview_height+',width='+FCKConfig.preview_width);var sHTML=''+FCK.GetHTML()+'';oWindow.document.write(sHTML);oWindow.document.close();};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(){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);};FCK.SetPreview=function(){oWindow.document.getElementById('block_'+FCKConfig.block_id).innerHTML=FCK.GetHTML();};function show_props(obj,objName) {var result="";for (var i in obj) {result=objName+"."+i+" = "+obj[i]+" \n";alert(result);};};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';oCell=this._Row.insertCell(-1);oCell.className='CM_Label';oCell.unselectable='on';oCell.noWrap=true;oCell.innerHTML=this.Label;};FCKContextMenuItem.prototype.SetVisible=function(isVisible){this._Row.style.display=isVisible?'':'none';};FCKContextMenuItem.prototype.RefreshState=function(){switch (this.Command.GetState()){case FCK_TRISTATE_ON:case FCK_TRISTATE_OFF:this._Row.className='CM_Option';break;default:this._Row.className='CM_Disabled';break;};}; var FCKContextMenuSeparator=function(){};FCKContextMenuSeparator.prototype.CreateTableRow=function(targetTable){this._Row=targetTable.insertRow(-1);this._Row.className='CM_Separator';var oCell=this._Row.insertCell(-1);oCell.className='CM_Icon';oCell=this._Row.insertCell(-1);oCell.className='CM_Label';oCell.innerHTML='
';};FCKContextMenuSeparator.prototype.SetVisible=function(isVisible){this._Row.style.display=isVisible?'':'none';};FCKContextMenuSeparator.prototype.RefreshState=function(){}; var FCKContextMenuGroup=function(addSeparator,contextMenu,firstItemCommand,firstItemLabel,hasIcon){this.IsVisible=true;this.Items=new Array();if (addSeparator) this.Add(new FCKContextMenuSeparator());if (contextMenu&&firstItemCommand&&firstItemLabel) this.Add(new FCKContextMenuItem(contextMenu,firstItemCommand,firstItemLabel,hasIcon));this.ValidationFunction=null;};FCKContextMenuGroup.prototype.Add=function(contextMenuItem){this.Items[this.Items.length]=contextMenuItem;};FCKContextMenuGroup.prototype.CreateTableRows=function(table){for (var i=0;i0&&oTag.href.length==0);if (this.Groups['Anchor']) this.Groups['Anchor'].SetVisible(bIsAnchor);if (this.Groups['Link']) this.Groups['Link'].SetVisible(!bIsAnchor&&LinkState()==true);if (this.Groups['TableCell']) this.Groups['TableCell'].SetVisible(sTagName!='TABLE'&&FCKSelection.HasAncestorNode('TABLE'));if (this.Groups['Table']) this.Groups['Table'].SetVisible(sTagName=='TABLE');if (this.Groups['Image']) this.Groups['Image'].SetVisible(sTagName=='IMG');if (this.Groups['Document']) this.Groups['Document'].SetVisible(true&&LinkState()==true);if (this.Groups['BulletedList']) this.Groups['BulletedList'].SetVisible(FCKSelection.HasAncestorNode('UL'));if (this.Groups['NumberedList']) this.Groups['NumberedList'].SetVisible(FCKSelection.HasAncestorNode('OL'));if (this.Groups['Select']) this.Groups['Select'].SetVisible(sTagName=='SELECT');if (this.Groups['Textarea']) this.Groups['Textarea'].SetVisible(sTagName=='TEXTAREA');if (this.Groups['Form']) this.Groups['Form'].SetVisible(FCKSelection.HasAncestorNode('FORM'));if (this.Groups['Checkbox']) this.Groups['Checkbox'].SetVisible(sTagName=='INPUT'&&oTag.type=='checkbox');if (this.Groups['Radio']) this.Groups['Radio'].SetVisible(sTagName=='INPUT'&&oTag.type=='radio');if (this.Groups['TextField']) this.Groups['TextField'].SetVisible(sTagName=='INPUT'&&(oTag.type=='text'||oTag.type=='password'));if (this.Groups['HiddenField']) this.Groups['HiddenField'].SetVisible(sTagName=='INPUT'&&oTag.type=='hidden');if (this.Groups['ImageButton']) this.Groups['ImageButton'].SetVisible(sTagName=='INPUT'&&oTag.type=='image');if (this.Groups['Button']) this.Groups['Button'].SetVisible(sTagName=='INPUT'&&(oTag.type=='button'||oTag.type=='submit'||oTag.type=='reset'));for (var o in this.Groups){this.Groups[o].RefreshState();};}; +var FCKContextMenu=new Object();FCKContextMenu._IsLoaded=false;FCKContextMenu.Reload=function(){this._Div=this._Document.createElement('DIV');this._Div.className='CM_ContextMenu';this._Div.style.position='absolute';this._Div.style.visibility='hidden';this._Document.body.appendChild(this._Div);var oTable=this._Document.createElement('TABLE');oTable.cellSpacing=0;oTable.cellPadding=0;oTable.border=0;this._Div.appendChild(oTable);this.Groups=new Object();for (var i=0;i0&&oTag.href.length==0);if (this.Groups['Anchor']) this.Groups['Anchor'].SetVisible(bIsAnchor);if (this.Groups['Link']) this.Groups['Link'].SetVisible(!bIsAnchor&&LinkState()==true);if (this.Groups['TableCell']) this.Groups['TableCell'].SetVisible(sTagName!='TABLE'&&FCKSelection.HasAncestorNode('TABLE'));if (this.Groups['Table']) this.Groups['Table'].SetVisible(sTagName=='TABLE');if (this.Groups['Image']) this.Groups['Image'].SetVisible(sTagName=='IMG');if (this.Groups['Document']) this.Groups['Document'].SetVisible(true&&LinkState()==true);if (this.Groups['BulletedList']) this.Groups['BulletedList'].SetVisible(FCKSelection.HasAncestorNode('UL'));if (this.Groups['NumberedList']) this.Groups['NumberedList'].SetVisible(FCKSelection.HasAncestorNode('OL'));if (this.Groups['Select']) this.Groups['Select'].SetVisible(sTagName=='SELECT');if (this.Groups['Textarea']) this.Groups['Textarea'].SetVisible(sTagName=='TEXTAREA');if (this.Groups['Form']) this.Groups['Form'].SetVisible(FCKSelection.HasAncestorNode('FORM'));if (this.Groups['Checkbox']) this.Groups['Checkbox'].SetVisible(sTagName=='INPUT'&&oTag.type=='checkbox');if (this.Groups['Radio']) this.Groups['Radio'].SetVisible(sTagName=='INPUT'&&oTag.type=='radio');if (this.Groups['TextField']) this.Groups['TextField'].SetVisible(sTagName=='INPUT'&&(oTag.type=='text'||oTag.type=='password'));if (this.Groups['HiddenField']) this.Groups['HiddenField'].SetVisible(sTagName=='INPUT'&&oTag.type=='hidden');if (this.Groups['ImageButton']) this.Groups['ImageButton'].SetVisible(sTagName=='INPUT'&&oTag.type=='image');if (this.Groups['Button']) this.Groups['Button'].SetVisible(sTagName=='INPUT'&&(oTag.type=='button'||oTag.type=='submit'||oTag.type=='reset'));for (var o in this.Groups){this.Groups[o].RefreshState();};}; FCKTools.AppendStyleSheet(window.parent.document,FCKConfig.SkinPath+'fck_contextmenu.css');FCKContextMenu.Show=function(x,y){if (!this._Document){this._Document=window.parent.document;};if (!this._IsLoaded){this.Reload();this._Div.style.zIndex=10000;this._Div.oncontextmenu=function() { return false;};};this.RefreshState();var oCoordsA=FCKTools.GetElementPosition(FCK.EditorWindow.frameElement);var oCoordsB=FCKTools.GetElementPosition(window.frameElement);x+=oCoordsA.X+oCoordsB.X;y+=oCoordsA.Y+oCoordsB.Y;var iXSpace=x+this._Div.offsetWidth-this._Div.ownerDocument.defaultView.innerWidth;var iYSpace=y+this._Div.offsetHeight-this._Div.ownerDocument.defaultView.innerHeight;if (iXSpace>0) x-=this._Div.offsetWidth;if (iYSpace>0) y-=this._Div.offsetHeight;this._Div.style.left=x+'px';this._Div.style.top=y+'px';var oActualWindow=FCK.EditorWindow;while (oActualWindow){oActualWindow.document.addEventListener('click',FCKContextMenu._OnDocumentClick,false);if (oActualWindow!=oActualWindow.parent) oActualWindow=oActualWindow.parent;else if (oActualWindow.opener==null) oActualWindow=oActualWindow.opener;else break;};this._Div.style.visibility='';};FCKContextMenu._OnDocumentClick=function(event){var e=event.target;while (e){if (e==FCKContextMenu._Div) return;e=e.parentNode;};FCKContextMenu.Hide();};FCKContextMenu.Hide=function(){this._Div.style.visibility='hidden';this._Div.style.left=this._Div.style.top='1px';} if (!FCKConfig.PluginsPath.endsWith('/')) FCKConfig.PluginsPath+='/';var FCKPlugin=function(name,availableLangs,basePath){this.Name=name;this.BasePath=basePath?basePath:FCKConfig.PluginsPath;this.Path=this.BasePath+name+'/';if (!availableLangs||availableLangs.length==0) this.AvailableLangs=new Array();else this.AvailableLangs=availableLangs.split(',');};FCKPlugin.prototype.Load=function(){if (this.AvailableLangs.length>0){if (this.AvailableLangs.indexOf(FCKLanguageManager.ActiveLanguage.Code)>=0) var sLang=FCKLanguageManager.ActiveLanguage.Code;else var sLang=this.AvailableLangs[0];FCKScriptLoader.AddScript(this.Path+'lang/'+sLang+'.js');};FCKScriptLoader.AddScript(this.Path+'fckplugin.js');} var FCKPlugins=FCK.Plugins=new Object();FCKPlugins.ItemsCount=0;FCKPlugins.Loaded=false;FCKPlugins.Items=new Object();for (var i=0;i