From 5b2e83a3e328679200236aa2788f698571ecbcfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Ra=C3=B1a?= Date: Mon, 27 Jul 2009 23:04:52 +0200 Subject: [PATCH 01/56] [svn r22394] improve layout for online task --- main/wiki/wiki.inc.php | 92 +++++++++++++++++++++++++++--------------- 1 file changed, 60 insertions(+), 32 deletions(-) diff --git a/main/wiki/wiki.inc.php b/main/wiki/wiki.inc.php index 34675e77e8..44e81dff26 100644 --- a/main/wiki/wiki.inc.php +++ b/main/wiki/wiki.inc.php @@ -332,12 +332,20 @@ function save_wiki() { if ($_clean['page_id'] ==0) { - $sql='UPDATE '.$tbl_wiki.' SET page_id="'.$Id.'" WHERE id="'.$Id.'"'; + $sql='UPDATE '.$tbl_wiki.' SET page_id="'.$Id.'" WHERE id="'.$Id.'"'; api_sql_query($sql,__FILE__,__LINE__); } //update wiki config - $sql='UPDATE'.$tbl_wiki.' SET page_id="'.$Id.'", feedback1="'.$_clean['feedback1'].'", feedback2="'.$_clean['feedback2'].'", feedback3="'.$_clean['feedback3'].'", max_text="'.$_clean['max_text'].'", max_version="'.$_clean['max_version'].'", startdate_assig="'.$_clean['startdate_assig'].'", enddate_assig="'.$_clean['enddate_assig'].'", delayedsubmit="'.$_clean['delayedsubmit'].'" WHERE id="'.$Id.'"'; + + if ($_clean['reflink']=='index' && $_clean['version']==1) + { + $sql="INSERT INTO ".$tbl_wiki_conf." (page_id, feedback1, feedback2, feedback3, fprogress1, fprogress2, fprogress3, max_text, max_version, startdate_assig, enddate_assig, delayedsubmit) VALUES ('".$Id."','".$_clean['feedback1']."','".$_clean['feedback2']."','".$_clean['feedback3']."','".$_clean['fprogress1']."','".$_clean['fprogress2']."','".$_clean['fprogress3']."','".$_clean['max_text']."','".$_clean['max_version']."','".$_clean['startdate_assig']."','".$_clean['enddate_assig']."','".$_clean['delayedsubmit']."')"; + } + else + { + $sql='UPDATE'.$tbl_wiki_conf.' SET page_id="'.$Id.'", feedback1="'.$_clean['feedback1'].'", feedback2="'.$_clean['feedback2'].'", feedback3="'.$_clean['feedback3'].'", max_text="'.$_clean['max_text'].'", max_version="'.$_clean['max_version'].'", startdate_assig="'.$_clean['startdate_assig'].'", enddate_assig="'.$_clean['enddate_assig'].'", delayedsubmit="'.$_clean['delayedsubmit'].'" WHERE page_id="'.$Id.'"'; + } api_sql_query($sql,__FILE__,__LINE__); api_item_property_update($_course, 'wiki', $Id, 'WikiAdded', api_get_user_id(), $_clean['group_id']); @@ -454,18 +462,27 @@ function save_new_wiki() { $_clean['linksto'] = links_to($_clean['content']); //check wikilinks - //cleaning config variables - $_clean['feedback1']=Database::escape_string(Security::remove_XSS($_POST['feedback1'])); - $_clean['feedback2']=Database::escape_string(Security::remove_XSS($_POST['feedback2'])); - $_clean['feedback3']=Database::escape_string(Security::remove_XSS($_POST['feedback3'])); - $_clean['fprogress1']=Database::escape_string(Security::remove_XSS($_POST['fprogress1'])); - $_clean['fprogress2']=Database::escape_string(Security::remove_XSS($_POST['fprogress2'])); - $_clean['fprogress3']=Database::escape_string(Security::remove_XSS($_POST['fprogress3'])); - $_clean['max_text']=Database::escape_string(Security::remove_XSS($_POST['max_text'])); - $_clean['max_version']=Database::escape_string(Security::remove_XSS($_POST['max_version'])); - $_clean['startdate_assig']=Database::escape_string(Security::remove_XSS(get_date_from_select('startdate_assig'))); - $_clean['enddate_assig']=Database::escape_string(Security::remove_XSS(get_date_from_select('enddate_assig'))); - $_clean['delayedsubmit']=Database::escape_string(Security::remove_XSS($_POST['delayedsubmit'])); + //cleaning config variables + if(Security::remove_XSS($_POST['timelimit']==1)) + { + $_clean['startdate_assig']=Database::escape_string(Security::remove_XSS(get_date_from_select('startdate_assig'))); + $_clean['enddate_assig']=Database::escape_string(Security::remove_XSS(get_date_from_select('enddate_assig'))); + $_clean['delayedsubmit']=Database::escape_string(Security::remove_XSS($_POST['delayedsubmit'])); + } + if(Security::remove_XSS($_POST['feedback']==1)) + { + $_clean['feedback1']=Database::escape_string(Security::remove_XSS($_POST['feedback1'])); + $_clean['feedback2']=Database::escape_string(Security::remove_XSS($_POST['feedback2'])); + $_clean['feedback3']=Database::escape_string(Security::remove_XSS($_POST['feedback3'])); + $_clean['fprogress1']=Database::escape_string(Security::remove_XSS($_POST['fprogress1'])); + $_clean['fprogress2']=Database::escape_string(Security::remove_XSS($_POST['fprogress2'])); + $_clean['fprogress3']=Database::escape_string(Security::remove_XSS($_POST['fprogress3'])); + } + if(Security::remove_XSS($_POST['otherlimit']==1)) + { + $_clean['max_text']=Database::escape_string(Security::remove_XSS($_POST['max_text'])); + $_clean['max_version']=Database::escape_string(Security::remove_XSS($_POST['max_version'])); + } //filter no _uass if (api_eregi('_uass', $_POST['title']) || (api_strtoupper(trim($_POST['title'])) == 'INDEX' || api_strtoupper(trim(api_htmlentities($_POST['title'], ENT_QUOTES, $charset))) == api_strtoupper(api_htmlentities(get_lang('DefaultTitle'), ENT_QUOTES, $charset)))) { @@ -532,27 +549,38 @@ return true; $_clean['group_id']=(int)$_SESSION['_gid']; // TODO: check if delete ? - // echo' '.Display::return_icon('div_show.gif',get_lang('Show')).' '.get_lang('AdvancedParameters').''; // TODO: under develop, uncoment and activate later + //echo' '.Display::return_icon('div_show.gif',get_lang('Show')).' '.get_lang('AdvancedParameters').''; // TODO: under develop, uncoment and activate later echo '';this.Elements[i].isHtml=true;}},ToElements:function(){var A=FCK.EditorDocument.createElement('div');for (var i=0;i0) C+='TABLE { behavior: '+B+' ; }';C+='';FCK._BehaviorsStyle=C;};return FCK._BehaviorsStyle;};function Doc_OnMouseUp(){if (FCK.EditorWindow.event.srcElement.tagName=='HTML'){FCK.Focus();FCK.EditorWindow.event.cancelBubble=true;FCK.EditorWindow.event.returnValue=false;}};function Doc_OnPaste(){var A=FCK.EditorDocument.body;A.detachEvent('onpaste',Doc_OnPaste);var B=FCK.Paste(!FCKConfig.ForcePasteAsPlainText&&!FCKConfig.AutoDetectPasteFromWord);A.attachEvent('onpaste',Doc_OnPaste);return B;};function Doc_OnDblClick(){FCK.OnDoubleClick(FCK.EditorWindow.event.srcElement);FCK.EditorWindow.event.cancelBubble=true;};function Doc_OnSelectionChange(){if (!FCK.IsSelectionChangeLocked&&FCK.EditorDocument) FCK.Events.FireEvent("OnSelectionChange");};function Doc_OnDrop(){if (FCK.MouseDownFlag){FCK.MouseDownFlag=false;return;};if (FCKConfig.ForcePasteAsPlainText){var A=FCK.EditorWindow.event;if (FCK._CheckIsPastingEnabled()||FCKConfig.ShowDropDialog) FCK.PasteAsPlainText(A.dataTransfer.getData('Text'));A.returnValue=false;A.cancelBubble=true;}};FCK.InitializeBehaviors=function(A){this.EditorDocument.attachEvent('onmouseup',Doc_OnMouseUp);this.EditorDocument.body.attachEvent('onpaste',Doc_OnPaste);this.EditorDocument.body.attachEvent('ondrop',Doc_OnDrop);FCK.ContextMenu._InnerContextMenu.AttachToElement(FCK.EditorDocument.body);this.EditorDocument.attachEvent("onkeydown",FCK._KeyDownListener);this.EditorDocument.attachEvent("ondblclick",Doc_OnDblClick);this.EditorDocument.attachEvent("onbeforedeactivate",function(){ FCKSelection.Save();});this.EditorDocument.attachEvent("onselectionchange",Doc_OnSelectionChange);FCKTools.AddEventListener(FCK.EditorDocument,'mousedown',Doc_OnMouseDown);};FCK.InsertHtml=function(A){A=FCKConfig.ProtectedSource.Protect(A);A=FCK.ProtectEvents(A);A=FCK.ProtectUrls(A);A=FCK.ProtectTags(A);FCKSelection.Restore();FCK.EditorWindow.focus();FCKUndo.SaveUndoStep();var B=FCKSelection.GetSelection();if (B.type.toLowerCase()=='control') B.clear();A=''+A;B.createRange().pasteHTML(A);FCK.EditorDocument.getElementById('__fakeFCKRemove__').removeNode(true);FCKDocumentProcessor.Process(FCK.EditorDocument);this.Events.FireEvent("OnSelectionChange");};FCK.SetInnerHtml=function(A){var B=FCK.EditorDocument;B.body.innerHTML='
 
'+A;B.getElementById('__fakeFCKRemove__').removeNode(true);};function FCK_PreloadImages(){var A=new FCKImagePreloader();A.AddImages(FCKConfig.PreloadImages);A.AddImages(FCKConfig.SkinPath+'fck_strip.gif');A.OnComplete=LoadToolbarSetup;A.Start();};function Document_OnContextMenu(){return (event.srcElement._FCKShowContextMenu==true);};document.oncontextmenu=Document_OnContextMenu;function FCK_Cleanup(){this.LinkedField=null;this.EditorWindow=null;this.EditorDocument=null;};FCK._ExecPaste=function(){if (FCK._PasteIsRunning) return true;if (FCKConfig.ForcePasteAsPlainText){FCK.PasteAsPlainText();return false;};var A=FCK._CheckIsPastingEnabled(true);if (A===false) FCKTools.RunFunction(FCKDialog.OpenDialog,FCKDialog,['FCKDialog_Paste',FCKLang.Paste,'dialog/fck_paste.html',400,330,'Security']);else{if (FCKConfig.AutoDetectPasteFromWord&&A.length>0){var B=/<\w[^>]*(( class="?MsoNormal"?)|(="mso-))/gi;if (B.test(A)){if (confirm(FCKLang.PasteWordConfirm)){FCK.PasteFromWord();return false;}}};FCK._PasteIsRunning=true;FCK.ExecuteNamedCommand('Paste');delete FCK._PasteIsRunning;};return false;};FCK.PasteAsPlainText=function(A){if (!FCK._CheckIsPastingEnabled()){FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.PasteAsText,'dialog/fck_paste.html',400,330,'PlainText');return;};var B=null;if (!A) B=clipboardData.getData("Text");else B=A;if (B&&B.length>0){B=FCKTools.HTMLEncode(B);B=FCKTools.ProcessLineBreaks(window,FCKConfig,B);var C=B.search('

');var D=B.search('

');if ((C!=-1&&D!=-1&&C0){if (FCKSelection.GetType()=='Control'){var D=this.EditorDocument.createElement('A');D.href=A;var E=FCKSelection.GetSelectedElement();E.parentNode.insertBefore(D,E);E.parentNode.removeChild(E);D.appendChild(E);return [D];};var F='javascript:void(0);/*'+(new Date().getTime())+'*/';FCK.ExecuteNamedCommand('CreateLink',F,false,!!B);var G=this.EditorDocument.links;for (i=0;i0) C+='TABLE { behavior: '+B+' ; }';C+='';FCK._BehaviorsStyle=C;};return FCK._BehaviorsStyle;};function Doc_OnMouseUp(){if (FCK.EditorWindow.event.srcElement.tagName=='HTML'){FCK.Focus();FCK.EditorWindow.event.cancelBubble=true;FCK.EditorWindow.event.returnValue=false;}};function Doc_OnPaste(){var A=FCK.EditorDocument.body;A.detachEvent('onpaste',Doc_OnPaste);var B=FCK.Paste(!FCKConfig.ForcePasteAsPlainText&&!FCKConfig.AutoDetectPasteFromWord);A.attachEvent('onpaste',Doc_OnPaste);return B;};function Doc_OnDblClick(){FCK.OnDoubleClick(FCK.EditorWindow.event.srcElement);FCK.EditorWindow.event.cancelBubble=true;};function Doc_OnSelectionChange(){if (!FCK.IsSelectionChangeLocked&&FCK.EditorDocument) FCK.Events.FireEvent("OnSelectionChange");};function Doc_OnDrop(){if (FCK.MouseDownFlag){FCK.MouseDownFlag=false;return;};if (FCKConfig.ForcePasteAsPlainText){var A=FCK.EditorWindow.event;if (FCK._CheckIsPastingEnabled()||FCKConfig.ShowDropDialog) FCK.PasteAsPlainText(A.dataTransfer.getData('Text'));A.returnValue=false;A.cancelBubble=true;}};FCK.InitializeBehaviors=function(A){this.EditorDocument.attachEvent('onmouseup',Doc_OnMouseUp);this.EditorDocument.body.attachEvent('onpaste',Doc_OnPaste);this.EditorDocument.body.attachEvent('ondrop',Doc_OnDrop);FCK.ContextMenu._InnerContextMenu.AttachToElement(FCK.EditorDocument.body);this.EditorDocument.attachEvent("onkeydown",FCK._KeyDownListener);this.EditorDocument.attachEvent("ondblclick",Doc_OnDblClick);this.EditorDocument.attachEvent("onbeforedeactivate",function(){ FCKSelection.Save();});this.EditorDocument.attachEvent("onselectionchange",Doc_OnSelectionChange);FCKTools.AddEventListener(FCK.EditorDocument,'mousedown',Doc_OnMouseDown);};FCK.InsertHtml=function(A){A=FCKConfig.ProtectedSource.Protect(A);A=FCK.ProtectEvents(A);A=FCK.ProtectUrls(A);A=FCK.ProtectTags(A);FCKSelection.Restore();FCK.EditorWindow.focus();FCKUndo.SaveUndoStep();var B=FCKSelection.GetSelection();if (B.type.toLowerCase()=='control') B.clear();A=''+A;B.createRange().pasteHTML(A);var C=FCK.EditorDocument.getElementById('__fakeFCKRemove__');if (C.parentNode.childNodes.length==1) C=C.parentNode;C.removeNode(true);FCKDocumentProcessor.Process(FCK.EditorDocument);this.Events.FireEvent("OnSelectionChange");};FCK.SetInnerHtml=function(A){var B=FCK.EditorDocument;B.body.innerHTML='

 
'+A;B.getElementById('__fakeFCKRemove__').removeNode(true);};function FCK_PreloadImages(){var A=new FCKImagePreloader();A.AddImages(FCKConfig.PreloadImages);A.AddImages(FCKConfig.SkinPath+'fck_strip.gif');A.OnComplete=LoadToolbarSetup;A.Start();};function Document_OnContextMenu(){return (event.srcElement._FCKShowContextMenu==true);};document.oncontextmenu=Document_OnContextMenu;function FCK_Cleanup(){this.LinkedField=null;this.EditorWindow=null;this.EditorDocument=null;};FCK._ExecPaste=function(){if (FCK._PasteIsRunning) return true;if (FCKConfig.ForcePasteAsPlainText){FCK.PasteAsPlainText();return false;};var A=FCK._CheckIsPastingEnabled(true);if (A===false) FCKTools.RunFunction(FCKDialog.OpenDialog,FCKDialog,['FCKDialog_Paste',FCKLang.Paste,'dialog/fck_paste.html',400,330,'Security']);else{if (FCKConfig.AutoDetectPasteFromWord&&A.length>0){var B=/<\w[^>]*(( class="?MsoNormal"?)|(="mso-))/gi;if (B.test(A)){if (confirm(FCKLang.PasteWordConfirm)){FCK.PasteFromWord();return false;}}};FCK._PasteIsRunning=true;FCK.ExecuteNamedCommand('Paste');delete FCK._PasteIsRunning;};return false;};FCK.PasteAsPlainText=function(A){if (!FCK._CheckIsPastingEnabled()){FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.PasteAsText,'dialog/fck_paste.html',400,330,'PlainText');return;};var B=null;if (!A) B=clipboardData.getData("Text");else B=A;if (B&&B.length>0){B=FCKTools.HTMLEncode(B);B=FCKTools.ProcessLineBreaks(window,FCKConfig,B);var C=B.search('

');var D=B.search('

');if ((C!=-1&&D!=-1&&C0){if (FCKSelection.GetType()=='Control'){var D=this.EditorDocument.createElement('A');D.href=A;var E=FCKSelection.GetSelectedElement();E.parentNode.insertBefore(D,E);E.parentNode.removeChild(E);D.appendChild(E);return [D];};var F='javascript:void(0);/*'+(new Date().getTime())+'*/';FCK.ExecuteNamedCommand('CreateLink',F,false,!!B);var G=this.EditorDocument.links;for (i=0;i0&&!isNaN(E)) this.PageConfig[D]=parseFloat(E);else this.PageConfig[D]=E;}};function FCKConfig_LoadPageConfig(){var A=FCKConfig.PageConfig;for (var B in A) FCKConfig[B]=A[B];};function FCKConfig_PreProcess(){var A=FCKConfig;if (A.AllowQueryStringDebug){try{if ((/fckdebug=true/i).test(window.top.location.search)) A.Debug=true;}catch (e) { }};if (!A.PluginsPath.EndsWith('/')) A.PluginsPath+='/';var B=A.ToolbarComboPreviewCSS;if (!B||B.length==0) A.ToolbarComboPreviewCSS=A.EditorAreaCSS;A.RemoveAttributesArray=(A.RemoveAttributes||'').split(',');if (!FCKConfig.SkinEditorCSS||FCKConfig.SkinEditorCSS.length==0) FCKConfig.SkinEditorCSS=FCKConfig.SkinPath+'fck_editor.css';if (!FCKConfig.SkinDialogCSS||FCKConfig.SkinDialogCSS.length==0) FCKConfig.SkinDialogCSS=FCKConfig.SkinPath+'fck_dialog.css';};FCKConfig.ToolbarSets={};FCKConfig.Plugins={};FCKConfig.Plugins.Items=[];FCKConfig.Plugins.Add=function(A,B,C){FCKConfig.Plugins.Items.push([A,B,C]);};FCKConfig.ProtectedSource={};FCKConfig.ProtectedSource._CodeTag=(new Date()).valueOf();FCKConfig.ProtectedSource.RegexEntries=[//g,//gi,//gi];FCKConfig.ProtectedSource.Add=function(A){this.RegexEntries.push(A);};FCKConfig.ProtectedSource.Protect=function(A){var B=this._CodeTag;function _Replace(protectedSource){var C=FCKTempBin.AddElement(protectedSource);return '';};for (var i=0;i|>)","g");return A.replace(D,_Replace);};FCKConfig.GetBodyAttributes=function(){var A='';if (this.BodyId&&this.BodyId.length>0) A+=' id="'+this.BodyId+'"';if (this.BodyClass&&this.BodyClass.length>0) A+=' class="'+this.BodyClass+'"';return A;};FCKConfig.ApplyBodyAttributes=function(A){if (this.BodyId&&this.BodyId.length>0) A.id=FCKConfig.BodyId;if (this.BodyClass&&this.BodyClass.length>0) A.className+=' '+FCKConfig.BodyClass;}; var FCKDebug={Output:function(){},OutputObject:function(){}}; var FCKDomTools={MoveChildren:function(A,B,C){if (A==B) return;var D;if (C){while ((D=A.lastChild)) B.insertBefore(A.removeChild(D),B.firstChild);}else{while ((D=A.firstChild)) B.appendChild(A.removeChild(D));}},MoveNode:function(A,B,C){if (C) B.insertBefore(FCKDomTools.RemoveNode(A),B.firstChild);else B.appendChild(FCKDomTools.RemoveNode(A));},TrimNode:function(A){this.LTrimNode(A);this.RTrimNode(A);},LTrimNode:function(A){var B;while ((B=A.firstChild)){if (B.nodeType==3){var C=B.nodeValue.LTrim();var D=B.nodeValue.length;if (C.length==0){A.removeChild(B);continue;}else if (C.length0) break;if (A.lastChild) A=A.lastChild;else return this.GetPreviousSourceElement(A,B,C,D);};return null;},GetNextSourceElement:function(A,B,C,D,E){while((A=this.GetNextSourceNode(A,E))){if (A.nodeType==1){if (C&&A.nodeName.IEquals(C)) break;if (D&&A.nodeName.IEquals(D)) return this.GetNextSourceElement(A,B,C,D);return A;}else if (B&&A.nodeType==3&&A.nodeValue.RTrim().length>0) break;};return null;},GetNextSourceNode:function(A,B,C,D){if (!A) return null;var E;if (!B&&A.firstChild) E=A.firstChild;else{if (D&&A==D) return null;E=A.nextSibling;if (!E&&(!D||D!=A.parentNode)) return this.GetNextSourceNode(A.parentNode,true,C,D);};if (C&&E&&E.nodeType!=C) return this.GetNextSourceNode(E,false,C,D);return E;},GetPreviousSourceNode:function(A,B,C,D){if (!A) return null;var E;if (!B&&A.lastChild) E=A.lastChild;else{if (D&&A==D) return null;E=A.previousSibling;if (!E&&(!D||D!=A.parentNode)) return this.GetPreviousSourceNode(A.parentNode,true,C,D);};if (C&&E&&E.nodeType!=C) return this.GetPreviousSourceNode(E,false,C,D);return E;},InsertAfterNode:function(A,B){return A.parentNode.insertBefore(B,A.nextSibling);},GetParents:function(A){var B=[];while (A){B.unshift(A);A=A.parentNode;};return B;},GetCommonParents:function(A,B){var C=this.GetParents(A);var D=this.GetParents(B);var E=[];for (var i=0;i0) D[C.pop().toLowerCase()]=1;var E=this.GetCommonParents(A,B);var F=null;while ((F=E.pop())){if (D[F.nodeName.toLowerCase()]) return F;};return null;},GetIndexOf:function(A){var B=A.parentNode?A.parentNode.firstChild:null;var C=-1;while (B){C++;if (B==A) return C;B=B.nextSibling;};return-1;},PaddingNode:null,EnforcePaddingNode:function(A,B){try{if (!A||!A.body) return;}catch (e){return;};this.CheckAndRemovePaddingNode(A,B,true);try{if (A.body.lastChild&&(A.body.lastChild.nodeType!=1||A.body.lastChild.tagName.toLowerCase()==B.toLowerCase())) return;}catch (e){return;};var C=A.createElement(B);if (FCKBrowserInfo.IsGecko&&FCKListsLib.NonEmptyBlockElements[B]) FCKTools.AppendBogusBr(C);this.PaddingNode=C;if (A.body.childNodes.length==1&&A.body.firstChild.nodeType==1&&A.body.firstChild.tagName.toLowerCase()=='br'&&(A.body.firstChild.getAttribute('_moz_dirty')!=null||A.body.firstChild.getAttribute('type')=='_moz')) A.body.replaceChild(C,A.body.firstChild);else A.body.appendChild(C);},CheckAndRemovePaddingNode:function(A,B,C){var D=this.PaddingNode;if (!D) return;try{if (D.parentNode!=A.body||D.tagName.toLowerCase()!=B||(D.childNodes.length>1)||(D.firstChild&&D.firstChild.nodeValue!='\xa0'&&String(D.firstChild.tagName).toLowerCase()!='br')){this.PaddingNode=null;return;}}catch (e){this.PaddingNode=null;return;};if (!C){if (D.parentNode.childNodes.length>1) D.parentNode.removeChild(D);this.PaddingNode=null;}},HasAttribute:function(A,B){if (A.hasAttribute) return A.hasAttribute(B);else{var C=A.attributes[B];return (C!=undefined&&C.specified);}},HasAttributes:function(A){var B=A.attributes;for (var i=0;i0) return true;}else if (B[i].specified) return true;};return false;},RemoveAttribute:function(A,B){if (FCKBrowserInfo.IsIE&&B.toLowerCase()=='class') B='className';return A.removeAttribute(B,0);},RemoveAttributes:function (A,B){for (var i=0;i0) return false;C=C.nextSibling;};return D?this.CheckIsEmptyElement(D,B):true;},SetElementStyles:function(A,B){var C=A.style;for (var D in B) C[D]=B[D];},SetOpacity:function(A,B){if (FCKBrowserInfo.IsIE){B=Math.round(B*100);A.style.filter=(B>100?'':'progid:DXImageTransform.Microsoft.Alpha(opacity='+B+')');}else A.style.opacity=B;},GetCurrentElementStyle:function(A,B){if (FCKBrowserInfo.IsIE) return A.currentStyle[B];else return A.ownerDocument.defaultView.getComputedStyle(A,'').getPropertyValue(B);},GetPositionedAncestor:function(A){var B=A;while (B!=FCKTools.GetElementDocument(B).documentElement){if (this.GetCurrentElementStyle(B,'position')!='static') return B;if (B==FCKTools.GetElementDocument(B).documentElement&¤tWindow!=w) B=currentWindow.frameElement;else B=B.parentNode;};return null;},ScrollIntoView:function(A,B){var C=FCKTools.GetElementWindow(A);var D=FCKTools.GetViewPaneSize(C).Height;var E=D*-1;if (B===false){E+=A.offsetHeight||0;E+=parseInt(this.GetCurrentElementStyle(A,'marginBottom')||0,10)||0;};var F=FCKTools.GetDocumentPosition(C,A);E+=F.y;var G=FCKTools.GetScrollPosition(C).Y;if (E>0&&(E>G||E'+styleDef+'';};var C=function(cssFileUrl,markTemp){if (cssFileUrl.length==0) return '';var B=markTemp?' _fcktemp="true"':'';return '';};return function(cssFileOrArrayOrDef,markTemp){if (!cssFileOrArrayOrDef) return '';if (typeof(cssFileOrArrayOrDef)=='string'){if (/[\\\/\.][^{}]*$/.test(cssFileOrArrayOrDef)){return this.GetStyleHtml(cssFileOrArrayOrDef.split(','),markTemp);}else return A(this._GetUrlFixedCss(cssFileOrArrayOrDef),markTemp);}else{var E='';for (var i=0;i/g,'>');return A;};FCKTools.HTMLDecode=function(A){if (!A) return '';A=A.replace(/>/g,'>');A=A.replace(/</g,'<');A=A.replace(/&/g,'&');return A;};FCKTools._ProcessLineBreaksForPMode=function(A,B,C,D,E){var F=0;var G="

";var H="

";var I="
";if (C){G="
  • ";H="
  • ";F=1;}while (D&&D!=A.FCK.EditorDocument.body){if (D.tagName.toLowerCase()=='p'){F=1;break;};D=D.parentNode;};for (var i=0;i0) return A[A.length-1];return null;};FCKTools.GetDocumentPosition=function(w,A){var x=0;var y=0;var B=A;var C=null;var D=FCKTools.GetElementWindow(B);while (B&&!(D==w&&(B==w.document.body||B==w.document.documentElement))){x+=B.offsetLeft-B.scrollLeft;y+=B.offsetTop-B.scrollTop;if (!FCKBrowserInfo.IsOpera){var E=C;while (E&&E!=B){x-=E.scrollLeft;y-=E.scrollTop;E=E.parentNode;}};C=B;if (B.offsetParent) B=B.offsetParent;else{if (D!=w){B=D.frameElement;C=null;if (B) D=B.contentWindow.parent;}else B=null;}};if (FCKDomTools.GetCurrentElementStyle(w.document.body,'position')!='static'||(FCKBrowserInfo.IsIE&&FCKDomTools.GetPositionedAncestor(A)==null)){x+=w.document.body.offsetLeft;y+=w.document.body.offsetTop;};return { "x":x,"y":y };};FCKTools.GetWindowPosition=function(w,A){var B=this.GetDocumentPosition(w,A);var C=FCKTools.GetScrollPosition(w);B.x-=C.X;B.y-=C.Y;return B;};FCKTools.ProtectFormStyles=function(A){if (!A||A.nodeType!=1||A.tagName.toLowerCase()!='form') return [];var B=[];var C=['style','className'];for (var i=0;i0){for (var i=B.length-1;i>=0;i--){var C=B[i][0];var D=B[i][1];if (D) A.insertBefore(C,D);else A.appendChild(C);}}};FCKTools.GetNextNode=function(A,B){if (A.firstChild) return A.firstChild;else if (A.nextSibling) return A.nextSibling;else{var C=A.parentNode;while (C){if (C==B) return null;if (C.nextSibling) return C.nextSibling;else C=C.parentNode;}};return null;};FCKTools.GetNextTextNode=function(A,B,C){node=this.GetNextNode(A,B);if (C&&node&&C(node)) return null;while (node&&node.nodeType!=3){node=this.GetNextNode(node,B);if (C&&node&&C(node)) return null;};return node;};FCKTools.Merge=function(){var A=arguments;var o=A[0];for (var i=1;i');document.domain = '"+FCK_RUNTIME_DOMAIN+"';document.close();}() ) ;";if (FCKBrowserInfo.IsIE){if (FCKBrowserInfo.IsIE7||!FCKBrowserInfo.IsIE6) return "";else return "javascript: '';";};return "javascript: void(0);";};FCKTools.ResetStyles=function(A){A.style.cssText='margin:0;padding:0;border:0;background-color:transparent;background-image:none;';}; FCKTools.CancelEvent=function(e){return false;};FCKTools._AppendStyleSheet=function(A,B){return A.createStyleSheet(B).owningElement;};FCKTools.AppendStyleString=function(A,B){if (!B) return null;var s=A.createStyleSheet("");s.cssText=B;return s;};FCKTools.ClearElementAttributes=function(A){A.clearAttributes();};FCKTools.GetAllChildrenIds=function(A){var B=[];for (var i=0;i0) B[B.length]=C;};return B;};FCKTools.RemoveOuterTags=function(e){e.insertAdjacentHTML('beforeBegin',e.innerHTML);e.parentNode.removeChild(e);};FCKTools.CreateXmlObject=function(A){var B;switch (A){case 'XmlHttp':if (document.location.protocol!='file:') try { return new XMLHttpRequest();} catch (e) {};B=['MSXML2.XmlHttp','Microsoft.XmlHttp'];break;case 'DOMDocument':B=['MSXML2.DOMDocument','Microsoft.XmlDom'];break;};for (var i=0;i<2;i++){try { return new ActiveXObject(B[i]);}catch (e){}};if (FCKLang.NoActiveX){alert(FCKLang.NoActiveX);FCKLang.NoActiveX=null;};return null;};FCKTools.DisableSelection=function(A){A.unselectable='on';var e,i=0;while ((e=A.all[i++])){switch (e.tagName){case 'IFRAME':case 'TEXTAREA':case 'INPUT':case 'SELECT':break;default:e.unselectable='on';}}};FCKTools.GetScrollPosition=function(A){var B=A.document;var C={ X:B.documentElement.scrollLeft,Y:B.documentElement.scrollTop };if (C.X>0||C.Y>0) return C;return { X:B.body.scrollLeft,Y:B.body.scrollTop };};FCKTools.AddEventListener=function(A,B,C){A.attachEvent('on'+B,C);};FCKTools.RemoveEventListener=function(A,B,C){A.detachEvent('on'+B,C);};FCKTools.AddEventListenerEx=function(A,B,C,D){var o={};o.Source=A;o.Params=D||[];o.Listener=function(ev){return C.apply(o.Source,[ev].concat(o.Params));};if (FCK.IECleanup) FCK.IECleanup.AddItem(null,function() { o.Source=null;o.Params=null;});A.attachEvent('on'+B,o.Listener);A=null;D=null;};FCKTools.GetViewPaneSize=function(A){var B;var C=A.document.documentElement;if (C&&C.clientWidth) B=C;else B=A.document.body;if (B) return { Width:B.clientWidth,Height:B.clientHeight };else return { Width:0,Height:0 };};FCKTools.SaveStyles=function(A){var B=FCKTools.ProtectFormStyles(A);var C={};if (A.className.length>0){C.Class=A.className;A.className='';};var D=A.style.cssText;if (D.length>0){C.Inline=D;A.style.cssText='';};FCKTools.RestoreFormStyles(A,B);return C;};FCKTools.RestoreStyles=function(A,B){var C=FCKTools.ProtectFormStyles(A);A.className=B.Class||'';A.style.cssText=B.Inline||'';FCKTools.RestoreFormStyles(A,C);};FCKTools.RegisterDollarFunction=function(A){A.$=A.document.getElementById;};FCKTools.AppendElement=function(A,B){return A.appendChild(this.GetElementDocument(A).createElement(B));};FCKTools.ToLowerCase=function(A){return A.toLowerCase();}; -var FCKeditorAPI;function InitializeAPI(){var A=window.parent;if (!(FCKeditorAPI=A.FCKeditorAPI)){var B='window.FCKeditorAPI = {Version : "2.6.4.1",VersionBuild : "23195",Instances : window.FCKeditorAPI && window.FCKeditorAPI.Instances || {},GetInstance : function( name ){return this.Instances[ name ];},_FormSubmit : function(){for ( var name in FCKeditorAPI.Instances ){var oEditor = FCKeditorAPI.Instances[ name ] ;if ( oEditor.GetParentForm && oEditor.GetParentForm() == this )oEditor.UpdateLinkedField() ;}this._FCKOriginalSubmit() ;},_FunctionQueue : window.FCKeditorAPI && window.FCKeditorAPI._FunctionQueue || {Functions : new Array(),IsRunning : false,Add : function( f ){this.Functions.push( f );if ( !this.IsRunning )this.StartNext();},StartNext : function(){var aQueue = this.Functions ;if ( aQueue.length > 0 ){this.IsRunning = true;aQueue[0].call();}else this.IsRunning = false;},Remove : function( f ){var aQueue = this.Functions;var i = 0, fFunc;while( (fFunc = aQueue[ i ]) ){if ( fFunc == f )aQueue.splice( i,1 );i++ ;}this.StartNext();}}}';if (A.execScript) A.execScript(B,'JavaScript');else{if (FCKBrowserInfo.IsGecko10){eval.call(A,B);}else if(FCKBrowserInfo.IsAIR){FCKAdobeAIR.FCKeditorAPI_Evaluate(A,B);}else if (FCKBrowserInfo.IsSafari){var C=A.document;var D=C.createElement('script');D.appendChild(C.createTextNode(B));C.documentElement.appendChild(D);}else A.eval(B);};FCKeditorAPI=A.FCKeditorAPI;FCKeditorAPI.__Instances=FCKeditorAPI.Instances;};FCKeditorAPI.Instances[FCK.Name]=FCK;};function _AttachFormSubmitToAPI(){var A=FCK.GetParentForm();if (A){FCKTools.AddEventListener(A,'submit',FCK.UpdateLinkedField);if (!A._FCKOriginalSubmit&&(typeof(A.submit)=='function'||(!A.submit.tagName&&!A.submit.length))){A._FCKOriginalSubmit=A.submit;A.submit=FCKeditorAPI._FormSubmit;}}};function FCKeditorAPI_Cleanup(){if (window.FCKConfig&&FCKConfig.MsWebBrowserControlCompat&&!window.FCKUnloadFlag) return;delete FCKeditorAPI.Instances[FCK.Name];};function FCKeditorAPI_ConfirmCleanup(){if (window.FCKConfig&&FCKConfig.MsWebBrowserControlCompat) window.FCKUnloadFlag=true;};FCKTools.AddEventListener(window,'unload',FCKeditorAPI_Cleanup);FCKTools.AddEventListener(window,'beforeunload',FCKeditorAPI_ConfirmCleanup); +var FCKeditorAPI;function InitializeAPI(){var A=window.parent;if (!(FCKeditorAPI=A.FCKeditorAPI)){var B='window.FCKeditorAPI = {Version : "2.6.4.1",VersionBuild : "23195",Instances : window.FCKeditorAPI && window.FCKeditorAPI.Instances || {},GetInstance : function( name ){return this.Instances[ name ];},_FormSubmit : function(){for ( var name in FCKeditorAPI.Instances ){var oEditor = FCKeditorAPI.Instances[ name ] ;if ( oEditor.GetParentForm && oEditor.GetParentForm() == this )oEditor.UpdateLinkedField() ;}this._FCKOriginalSubmit() ;},_FunctionQueue : window.FCKeditorAPI && window.FCKeditorAPI._FunctionQueue || {Functions : new Array(),IsRunning : false,Add : function( f ){this.Functions.push( f );if ( !this.IsRunning )this.StartNext();},StartNext : function(){var aQueue = this.Functions ;if ( aQueue.length > 0 ){this.IsRunning = true;aQueue[0].call();}else this.IsRunning = false;},Remove : function( f ){var aQueue = this.Functions;var i = 0, fFunc;while( (fFunc = aQueue[ i ]) ){if ( fFunc == f )aQueue.splice( i,1 );i++ ;}this.StartNext();}}}';if (A.execScript) A.execScript(B,'JavaScript');else{if (FCKBrowserInfo.IsGecko10){eval.call(A,B);}else if(FCKBrowserInfo.IsAIR){FCKAdobeAIR.FCKeditorAPI_Evaluate(A,B);}else if (FCKBrowserInfo.IsSafari){var C=A.document;var D=C.createElement('script');D.appendChild(C.createTextNode(B));C.documentElement.appendChild(D);}else A.eval(B);};FCKeditorAPI=A.FCKeditorAPI;FCKeditorAPI.__Instances=FCKeditorAPI.Instances;};FCKeditorAPI.Instances[FCK.Name]=FCK;};function _AttachFormSubmitToAPI(){var A=FCK.GetParentForm();if (A){FCKTools.AddEventListener(A,'submit',FCK.UpdateLinkedField);if (!A._FCKOriginalSubmit&&(typeof(A.submit)=='function'||(!A.submit.tagName&&!A.submit.length))){A._FCKOriginalSubmit=A.submit;A.submit=FCKeditorAPI._FormSubmit;}}};function FCKeditorAPI_Cleanup(){if (window.FCKConfig&&FCKConfig.MsWebBrowserControlCompat&&!window.FCKUnloadFlag) return;delete FCKeditorAPI.Instances[FCK.Name];};function FCKeditorAPI_ConfirmCleanup(){if (window.FCKConfig&&FCKConfig.MsWebBrowserControlCompat) window.FCKUnloadFlag=true;};FCKTools.AddEventListener(window,'unload',FCKeditorAPI_Cleanup);FCKTools.AddEventListener(window,'beforeunload',FCKeditorAPI_ConfirmCleanup); var FCKImagePreloader=function(){this._Images=[];};FCKImagePreloader.prototype={AddImages:function(A){if (typeof(A)=='string') A=A.split(';');this._Images=this._Images.concat(A);},Start:function(){var A=this._Images;this._PreloadCount=A.length;for (var i=0;i]*\>)/i,AfterBody:/(\<\/body\>[\s\S]*$)/i,ToReplace:/___fcktoreplace:([\w]+)/ig,MetaHttpEquiv:/http-equiv\s*=\s*["']?([^"' ]+)/i,HasBaseTag:/]/i,HtmlOpener:/]*>/i,HeadOpener:/]*>/i,HeadCloser:/<\/head\s*>/i,FCK_Class:/\s*FCK__[^ ]*(?=\s+|$)/,ElementName:/(^[a-z_:][\w.\-:]*\w$)|(^[a-z_]$)/,ForceSimpleAmpersand:/___FCKAmp___/g,SpaceNoClose:/\/>/g,EmptyParagraph:/^<(p|div|address|h\d|center)(?=[ >])[^>]*>\s*(<\/\1>)?$/,EmptyOutParagraph:/^<(p|div|address|h\d|center)(?=[ >])[^>]*>(?:\s*| | )(<\/\1>)?$/,TagBody:/>]+))/gi,ProtectUrlsA:/]+))/gi,ProtectUrlsArea:/]+))/gi,Html4DocType:/HTML 4\.0 Transitional/i,DocTypeTag:/]*>/i,HtmlDocType:/DTD HTML/,TagsWithEvent:/<[^\>]+ on\w+[\s\r\n]*=[\s\r\n]*?('|")[\s\S]+?\>/g,EventAttributes:/\s(on\w+)[\s\r\n]*=[\s\r\n]*?('|")([\s\S]*?)\2/g,ProtectedEvents:/\s\w+_fckprotectedatt="([^"]+)"/g,StyleProperties:/\S+\s*:/g,InvalidSelfCloseTags:/(<(?!base|meta|link|hr|br|param|img|area|input)([a-zA-Z0-9:]+)[^>]*)\/>/gi,StyleVariableAttName:/#\(\s*("|')(.+?)\1[^\)]*\s*\)/g,RegExp:/^\/(.*)\/([gim]*)$/,HtmlTag:/<[^\s<>](?:"[^"]*"|'[^']*'|[^<])*>/}; var FCKListsLib={BlockElements:{ address:1,blockquote:1,center:1,div:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,marquee:1,noscript:1,ol:1,p:1,pre:1,script:1,table:1,ul:1 },NonEmptyBlockElements:{ p:1,div:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,address:1,pre:1,ol:1,ul:1,li:1,td:1,th:1 },InlineChildReqElements:{ abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1 },InlineNonEmptyElements:{ a:1,abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1 },EmptyElements:{ base:1,col:1,meta:1,link:1,hr:1,br:1,param:1,img:1,area:1,input:1 },PathBlockElements:{ address:1,blockquote:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,li:1,dt:1,de:1 },PathBlockLimitElements:{ body:1,div:1,td:1,th:1,caption:1,form:1 },StyleBlockElements:{ address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1 },StyleObjectElements:{ img:1,hr:1,li:1,table:1,tr:1,td:1,embed:1,object:1,ol:1,ul:1 },NonEditableElements:{ button:1,option:1,script:1,iframe:1,textarea:1,object:1,embed:1,map:1,applet:1 },BlockBoundaries:{ p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,address:1,pre:1,ol:1,ul:1,li:1,dt:1,de:1,table:1,thead:1,tbody:1,tfoot:1,tr:1,th:1,td:1,caption:1,col:1,colgroup:1,blockquote:1,body:1 },ListBoundaries:{ p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,address:1,pre:1,ol:1,ul:1,li:1,dt:1,de:1,table:1,thead:1,tbody:1,tfoot:1,tr:1,th:1,td:1,caption:1,col:1,colgroup:1,blockquote:1,body:1,br:1 }}; From 01a567f12dc61aa22d5b1fc4c9eb62103a4ddb9d Mon Sep 17 00:00:00 2001 From: Ivan Tcholakov Date: Tue, 28 Jul 2009 22:14:42 +0200 Subject: [PATCH 11/56] [svn r22423] FS#2867 - The online editor: Implementing 2.6.5 SVN patch, ticket #2156 - http://dev.fckeditor.net/ticket/2156 . --- documentation/changelog.html | 2 +- .../editor/_source/internals/fckdomtools.js | 48 +++++++++++++++---- .../editor/_source/internals/fckxhtml.js | 17 +++++++ .../editor/_source/internals/fckxhtml_ie.js | 36 ++++++++++++++ .../editor/js/fckeditorcode_gecko.js | 4 +- .../fckeditor/editor/js/fckeditorcode_ie.js | 6 +-- 6 files changed, 97 insertions(+), 16 deletions(-) diff --git a/documentation/changelog.html b/documentation/changelog.html index 36227ccee8..979040868e 100644 --- a/documentation/changelog.html +++ b/documentation/changelog.html @@ -34,7 +34,7 @@
  • The installation sript: The page about system requilements has been updated. Also, at the very beginning, a check has been added whether the mbstring php-extension is installed - see the related forum topic. (FS#306)
  • A new php-based configuration for the online editor has been implemented, see dokeos/main/inc/lib/fckeditor/myconfig.php. Also, toolbar definitions have been split in separate php-files within the directory dokeos/main/inc/lib/fckeditor/toolbars/ . Customization of the editor is more convenient and flexible now. (FS#2867)
  • Online editor: A upgrade from FCKEditor 2.6.4 to FCKEditor 2.6.4.1 has been implemented. (FS#4383)
  • -
  • Online editor: Several known bug-fixes from FCKEditor 2.6.5 SVN have been implemented, tickets #1537, #2821, #2856, #2915, #3120, #3181, #3429, #3439, #3880. (FS#2867)
  • +
  • Online editor: Several known bug-fixes from FCKEditor 2.6.5 SVN have been implemented, tickets #1537, #2156, #2821, #2856, #2915, #3120, #3181, #3429, #3439, #3880. (FS#2867)
  • Online editor: The simple file manager, the advanced file manager and the image manager have been integrated by default with the editor's dialog system. Thus, they work faster and in a more secure way. (FS#2867)
  • Online editor: Blocking copy/paste for trainees has been added. The feature is configurable through editing the toolbar definition files within the directory dokeos/main/inc/lib/fckeditor/toolbars/ . (FS#2867)
  • Online editor: Preview tabs have been added to the dialogs for inserting video, flv-video, and YouTube video. (FS#2867)
  • diff --git a/main/inc/lib/fckeditor/editor/_source/internals/fckdomtools.js b/main/inc/lib/fckeditor/editor/_source/internals/fckdomtools.js index 7eaf3bde51..cf11075c5f 100644 --- a/main/inc/lib/fckeditor/editor/_source/internals/fckdomtools.js +++ b/main/inc/lib/fckeditor/editor/_source/internals/fckdomtools.js @@ -488,18 +488,46 @@ var FCKDomTools = for ( var i = 0 ; i < attributes.length ; i++ ) { - if ( FCKBrowserInfo.IsIE && attributes[i].nodeName == 'class' ) + if ( FCKBrowserInfo.IsIE ) { - // IE has a strange bug. If calling removeAttribute('className'), - // the attributes collection will still contain the "class" - // attribute, which will be marked as "specified", even if the - // outerHTML of the element is not displaying the class attribute. - // Note : I was not able to reproduce it outside the editor, - // but I've faced it while working on the TC of #1391. - if ( element.className.length > 0 ) - return true ; + var attributeNodeName = attributes[i].nodeName ; + + if ( attributeNodeName.StartsWith( '_fck' ) ) + { + /** + * There are places in the FCKeditor code where HTML element objects + * get values stored as properties (e.g. _fckxhtmljob). In Internet + * Explorer, these are interpreted as attempts to set attributes on + * the element. + * + * http://msdn.microsoft.com/en-us/library/ms533026(VS.85).aspx#Accessing_Element_Pr + * + * Counting these as HTML attributes cripples + * FCK.Style.RemoveFromRange() once FCK.GetData() has been called. + * + * The above conditional prevents these internal properties being + * counted as attributes. + * + * refs #2156 and #2834 + */ + + continue ; + } + + if ( attributeNodeName == 'class' ) + { + // IE has a strange bug. If calling removeAttribute('className'), + // the attributes collection will still contain the "class" + // attribute, which will be marked as "specified", even if the + // outerHTML of the element is not displaying the class attribute. + // Note : I was not able to reproduce it outside the editor, + // but I've faced it while working on the TC of #1391. + if ( element.className.length > 0 ) + return true ; + continue ; + } } - else if ( attributes[i].specified ) + if ( attributes[i].specified ) return true ; } diff --git a/main/inc/lib/fckeditor/editor/_source/internals/fckxhtml.js b/main/inc/lib/fckeditor/editor/_source/internals/fckxhtml.js index 130a3a9b9f..480a1e1913 100644 --- a/main/inc/lib/fckeditor/editor/_source/internals/fckxhtml.js +++ b/main/inc/lib/fckeditor/editor/_source/internals/fckxhtml.js @@ -56,6 +56,23 @@ FCKXHtml.GetXHTML = function( node, includeNode, format ) else this._AppendChildNodes( this.MainNode, node, false ) ; + /** + * FCKXHtml._AppendNode() marks DOM element objects it has + * processed by adding a property called _fckxhtmljob, + * setting it equal to the value of FCKXHtml.CurrentJobNum. + * On Internet Explorer, if an element object has such a + * property, it will show up in the object's attributes + * NamedNodeMap, and the corresponding Attr object in + * that collection will have is specified property set + * to true. This trips up code elsewhere that checks to + * see if an element is free of attributes before proceeding + * with an edit operation (c.f. FCK.Style.RemoveFromRange()) + * + * refs #2156 and #2834 + */ + if ( FCKBrowserInfo.IsIE ) + FCKXHtml._RemoveXHtmlJobProperties( node ) ; + // Get the resulting XHTML as a string. var sXHTML = this._GetMainXmlString() ; diff --git a/main/inc/lib/fckeditor/editor/_source/internals/fckxhtml_ie.js b/main/inc/lib/fckeditor/editor/_source/internals/fckxhtml_ie.js index 94f2ef975c..2d23eaecf6 100644 --- a/main/inc/lib/fckeditor/editor/_source/internals/fckxhtml_ie.js +++ b/main/inc/lib/fckeditor/editor/_source/internals/fckxhtml_ie.js @@ -92,6 +92,42 @@ FCKXHtml._AppendAttributes = function( xmlNode, htmlNode, node, nodeName ) } } +/** + * Used to clean up HTML that has been processed FCKXHtml._AppendNode(). + * + * For objects corresponding to HTML elements, Internet Explorer will + * treat a property as if it were an attribute set on that element. + * + * http://msdn.microsoft.com/en-us/library/ms533026(VS.85).aspx#Accessing_Element_Pr + * + * FCKXHtml._AppendNode() sets the property _fckxhtmljob on node objects + * corresponding HTML elements to mark them as having been processed. + * Counting these properties as attributes will cripple style removal + * because FCK.Styles.RemoveFromSelection() will not remove an element + * as long as it still has attributes. + * + * refs #2156 and #2834 + */ + +FCKXHtml._RemoveXHtmlJobProperties = function ( node ) +{ + // Select only nodes of type ELEMENT_NODE + if (!node || !node.nodeType || node.nodeType != 1) + return ; + + // Clear the _fckhtmljob attribute. + if ( typeof node._fckxhtmljob !== 'undefined' ) + node.removeAttribute('_fckxhtmljob') ; + + // Recurse upon child nodes. + if ( node.hasChildNodes() ) + { + var childNodes = node.childNodes ; + for ( var i = childNodes.length - 1 ; i >= 0 ; i-- ) + FCKXHtml._RemoveXHtmlJobProperties( childNodes.item(i) ) ; + } +} + // On very rare cases, IE is loosing the "align" attribute for DIV. (right align and apply bulleted list) FCKXHtml.TagProcessors['div'] = function( node, htmlNode ) { diff --git a/main/inc/lib/fckeditor/editor/js/fckeditorcode_gecko.js b/main/inc/lib/fckeditor/editor/js/fckeditorcode_gecko.js index b63d9c70ec..d43e355d88 100644 --- a/main/inc/lib/fckeditor/editor/js/fckeditorcode_gecko.js +++ b/main/inc/lib/fckeditor/editor/js/fckeditorcode_gecko.js @@ -32,7 +32,7 @@ var FCK={Name:FCKURLParams['InstanceName'],Status:0,EditMode:0,Toolbar:null,HasF FCK.Description="FCKeditor for Gecko Browsers";FCK.InitializeBehaviors=function(){if (window.onresize) window.onresize();FCKFocusManager.AddWindow(this.EditorWindow);this.ExecOnSelectionChange=function(){FCK.Events.FireEvent("OnSelectionChange");};this._ExecDrop=function(evt){if (FCK.MouseDownFlag){FCK.MouseDownFlag=false;return;};if (FCKConfig.ForcePasteAsPlainText){if (evt.dataTransfer){var A=evt.dataTransfer.getData('Text');A=FCKTools.HTMLEncode(A);A=FCKTools.ProcessLineBreaks(window,FCKConfig,A);FCK.InsertHtml(A);}else if (FCKConfig.ShowDropDialog) FCK.PasteAsPlainText();evt.preventDefault();evt.stopPropagation();}};this._ExecCheckCaret=function(evt){if (FCK.EditMode!=0) return;if (evt.type=='keypress'){var B=evt.keyCode;if (B<33||B>40) return;};var C=function(H){if (H.nodeType!=1) return false;var D=H.tagName.toLowerCase();return (FCKListsLib.BlockElements[D]||FCKListsLib.EmptyElements[D]);};var E=function(){var F=FCKSelection.GetSelection();var G=F.getRangeAt(0);if (!G||!G.collapsed) return;var H=G.endContainer;if (H.nodeType!=3) return;if (H.nodeValue.length!=G.endOffset) return;var I=H.parentNode.tagName.toLowerCase();if (!(I=='a'||(!FCKBrowserInfo.IsOpera&&String(H.parentNode.contentEditable)=='false')||(!(FCKListsLib.BlockElements[I]||FCKListsLib.NonEmptyBlockElements[I])&&B==35))) return;var J=FCKTools.GetNextTextNode(H,H.parentNode,C);if (J) return;G=FCK.EditorDocument.createRange();J=FCKTools.GetNextTextNode(H,H.parentNode.parentNode,C);if (J){if (FCKBrowserInfo.IsOpera&&B==37) return;G.setStart(J,0);G.setEnd(J,0);}else{while (H.parentNode&&H.parentNode!=FCK.EditorDocument.body&&H.parentNode!=FCK.EditorDocument.documentElement&&H==H.parentNode.lastChild&&(!FCKListsLib.BlockElements[H.parentNode.tagName.toLowerCase()]&&!FCKListsLib.NonEmptyBlockElements[H.parentNode.tagName.toLowerCase()])) H=H.parentNode;if (FCKListsLib.BlockElements[I]||FCKListsLib.EmptyElements[I]||H==FCK.EditorDocument.body){G.setStart(H,H.childNodes.length);G.setEnd(H,H.childNodes.length);}else{var K=H.nextSibling;while (K){if (K.nodeType!=1){K=K.nextSibling;continue;};var L=K.tagName.toLowerCase();if (FCKListsLib.BlockElements[L]||FCKListsLib.EmptyElements[L]||FCKListsLib.NonEmptyBlockElements[L]) break;K=K.nextSibling;};var M=FCK.EditorDocument.createTextNode('');if (K) H.parentNode.insertBefore(M,K);else H.parentNode.appendChild(M);G.setStart(M,0);G.setEnd(M,0);}};F.removeAllRanges();F.addRange(G);FCK.Events.FireEvent("OnSelectionChange");};setTimeout(E,1);};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.EditorDocument.addEventListener('keydown',this._KeyDownListener,false);if (FCKBrowserInfo.IsGecko){this.EditorWindow.addEventListener('dragdrop',this._ExecDrop,true);}else if (FCKBrowserInfo.IsSafari){this.EditorDocument.addEventListener('dragover',function (evt){ if (!FCK.MouseDownFlag&&FCK.Config.ForcePasteAsPlainText) evt.returnValue=false;},true);this.EditorDocument.addEventListener('drop',this._ExecDrop,true);this.EditorDocument.addEventListener('mousedown',function(ev){var N=ev.srcElement;if (N.nodeName.IEquals('IMG','HR','INPUT','TEXTAREA','SELECT')){FCKSelection.SelectNode(N);}},true);this.EditorDocument.addEventListener('mouseup',function(ev){if (ev.srcElement.nodeName.IEquals('INPUT','TEXTAREA','SELECT')) ev.preventDefault()},true);this.EditorDocument.addEventListener('click',function(ev){if (ev.srcElement.nodeName.IEquals('INPUT','TEXTAREA','SELECT')) ev.preventDefault()},true);};if (FCKBrowserInfo.IsGecko||FCKBrowserInfo.IsOpera){this.EditorDocument.addEventListener('keypress',this._ExecCheckCaret,false);this.EditorDocument.addEventListener('click',this._ExecCheckCaret,false);};FCK.ContextMenu._InnerContextMenu.SetMouseClickWindow(FCK.EditorWindow);FCK.ContextMenu._InnerContextMenu.AttachToElement(FCK.EditorDocument);};FCK.MakeEditable=function(){this.EditingArea.MakeEditable();};function Document_OnContextMenu(e){if (!e.target._FCKShowContextMenu) e.preventDefault();};document.oncontextmenu=Document_OnContextMenu;FCK._BaseGetNamedCommandState=FCK.GetNamedCommandState;FCK.GetNamedCommandState=function(A){switch (A){case 'Unlink':return FCKSelection.HasAncestorNode('A')?0:-1;default:return FCK._BaseGetNamedCommandState(A);}};FCK.RedirectNamedCommands={Print:true,Paste:true};FCK.ExecuteRedirectedNamedCommand=function(A,B){switch (A){case 'Print':FCK.EditorWindow.print();break;case 'Paste':try{if (FCKBrowserInfo.IsSafari) throw '';if (FCK.Paste()) FCK.ExecuteNamedCommand('Paste',null,true);}catch (e) {if (FCKConfig.ForcePasteAsPlainText) FCK.PasteAsPlainText();else FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.Paste,'dialog/fck_paste.html',400,330,'Security');};break;default:FCK.ExecuteNamedCommand(A,B);}};FCK._ExecPaste=function(){FCKUndo.SaveUndoStep();if (FCKConfig.ForcePasteAsPlainText){FCK.PasteAsPlainText();return false;};return true;};FCK.InsertHtml=function(A){var B=FCK.EditorDocument,range;A=FCKConfig.ProtectedSource.Protect(A);A=FCK.ProtectEvents(A);A=FCK.ProtectUrls(A);A=FCK.ProtectTags(A);FCKUndo.SaveUndoStep();if (FCKBrowserInfo.IsGecko){A=A.replace(/ $/,'$&');var C=new FCKDocumentFragment(this.EditorDocument);C.AppendHtml(A);var D=C.RootNode.lastChild;range=new FCKDomRange(this.EditorWindow);range.MoveToSelection();var E=C.RootNode.firstChild;while (E&&E.nodeType!=1) E=E.nextSibling;if (E&&FCKListsLib.BlockElements[E.nodeName.toLowerCase()]) range.SplitBlock();range.DeleteContents();range.InsertNode(C.RootNode);range.MoveToPosition(D,4);}else B.execCommand('inserthtml',false,A);this.Focus();if (!range){range=new FCKDomRange(this.EditorWindow);range.MoveToSelection();};var E=range.CreateBookmark();FCKDocumentProcessor.Process(B);try{range.MoveToBookmark(E);range.Select();}catch (e) {};this.Events.FireEvent("OnSelectionChange");};FCK.PasteAsPlainText=function(){FCKTools.RunFunction(FCKDialog.OpenDialog,FCKDialog,['FCKDialog_Paste',FCKLang.PasteAsText,'dialog/fck_paste.html',400,330,'PlainText']);};FCK.GetClipboardHTML=function(){return '';};FCK.CreateLink=function(A,B){var C=[];if (FCKSelection.GetSelection().isCollapsed) return C;FCK.ExecuteNamedCommand('Unlink',null,false,!!B);if (A.length>0){var D='javascript:void(0);/*'+(new Date().getTime())+'*/';FCK.ExecuteNamedCommand('CreateLink',D,false,!!B);var E=this.EditorDocument.evaluate("//a[@href='"+D+"']",this.EditorDocument.body,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);for (var i=0;i0&&!isNaN(E)) this.PageConfig[D]=parseFloat(E);else this.PageConfig[D]=E;}};function FCKConfig_LoadPageConfig(){var A=FCKConfig.PageConfig;for (var B in A) FCKConfig[B]=A[B];};function FCKConfig_PreProcess(){var A=FCKConfig;if (A.AllowQueryStringDebug){try{if ((/fckdebug=true/i).test(window.top.location.search)) A.Debug=true;}catch (e) { }};if (!A.PluginsPath.EndsWith('/')) A.PluginsPath+='/';var B=A.ToolbarComboPreviewCSS;if (!B||B.length==0) A.ToolbarComboPreviewCSS=A.EditorAreaCSS;A.RemoveAttributesArray=(A.RemoveAttributes||'').split(',');if (!FCKConfig.SkinEditorCSS||FCKConfig.SkinEditorCSS.length==0) FCKConfig.SkinEditorCSS=FCKConfig.SkinPath+'fck_editor.css';if (!FCKConfig.SkinDialogCSS||FCKConfig.SkinDialogCSS.length==0) FCKConfig.SkinDialogCSS=FCKConfig.SkinPath+'fck_dialog.css';};FCKConfig.ToolbarSets={};FCKConfig.Plugins={};FCKConfig.Plugins.Items=[];FCKConfig.Plugins.Add=function(A,B,C){FCKConfig.Plugins.Items.push([A,B,C]);};FCKConfig.ProtectedSource={};FCKConfig.ProtectedSource._CodeTag=(new Date()).valueOf();FCKConfig.ProtectedSource.RegexEntries=[//g,//gi,//gi];FCKConfig.ProtectedSource.Add=function(A){this.RegexEntries.push(A);};FCKConfig.ProtectedSource.Protect=function(A){var B=this._CodeTag;function _Replace(protectedSource){var C=FCKTempBin.AddElement(protectedSource);return '';};for (var i=0;i|>)","g");return A.replace(D,_Replace);};FCKConfig.GetBodyAttributes=function(){var A='';if (this.BodyId&&this.BodyId.length>0) A+=' id="'+this.BodyId+'"';if (this.BodyClass&&this.BodyClass.length>0) A+=' class="'+this.BodyClass+'"';return A;};FCKConfig.ApplyBodyAttributes=function(A){if (this.BodyId&&this.BodyId.length>0) A.id=FCKConfig.BodyId;if (this.BodyClass&&this.BodyClass.length>0) A.className+=' '+FCKConfig.BodyClass;}; var FCKDebug={Output:function(){},OutputObject:function(){}}; -var FCKDomTools={MoveChildren:function(A,B,C){if (A==B) return;var D;if (C){while ((D=A.lastChild)) B.insertBefore(A.removeChild(D),B.firstChild);}else{while ((D=A.firstChild)) B.appendChild(A.removeChild(D));}},MoveNode:function(A,B,C){if (C) B.insertBefore(FCKDomTools.RemoveNode(A),B.firstChild);else B.appendChild(FCKDomTools.RemoveNode(A));},TrimNode:function(A){this.LTrimNode(A);this.RTrimNode(A);},LTrimNode:function(A){var B;while ((B=A.firstChild)){if (B.nodeType==3){var C=B.nodeValue.LTrim();var D=B.nodeValue.length;if (C.length==0){A.removeChild(B);continue;}else if (C.length0) break;if (A.lastChild) A=A.lastChild;else return this.GetPreviousSourceElement(A,B,C,D);};return null;},GetNextSourceElement:function(A,B,C,D,E){while((A=this.GetNextSourceNode(A,E))){if (A.nodeType==1){if (C&&A.nodeName.IEquals(C)) break;if (D&&A.nodeName.IEquals(D)) return this.GetNextSourceElement(A,B,C,D);return A;}else if (B&&A.nodeType==3&&A.nodeValue.RTrim().length>0) break;};return null;},GetNextSourceNode:function(A,B,C,D){if (!A) return null;var E;if (!B&&A.firstChild) E=A.firstChild;else{if (D&&A==D) return null;E=A.nextSibling;if (!E&&(!D||D!=A.parentNode)) return this.GetNextSourceNode(A.parentNode,true,C,D);};if (C&&E&&E.nodeType!=C) return this.GetNextSourceNode(E,false,C,D);return E;},GetPreviousSourceNode:function(A,B,C,D){if (!A) return null;var E;if (!B&&A.lastChild) E=A.lastChild;else{if (D&&A==D) return null;E=A.previousSibling;if (!E&&(!D||D!=A.parentNode)) return this.GetPreviousSourceNode(A.parentNode,true,C,D);};if (C&&E&&E.nodeType!=C) return this.GetPreviousSourceNode(E,false,C,D);return E;},InsertAfterNode:function(A,B){return A.parentNode.insertBefore(B,A.nextSibling);},GetParents:function(A){var B=[];while (A){B.unshift(A);A=A.parentNode;};return B;},GetCommonParents:function(A,B){var C=this.GetParents(A);var D=this.GetParents(B);var E=[];for (var i=0;i0) D[C.pop().toLowerCase()]=1;var E=this.GetCommonParents(A,B);var F=null;while ((F=E.pop())){if (D[F.nodeName.toLowerCase()]) return F;};return null;},GetIndexOf:function(A){var B=A.parentNode?A.parentNode.firstChild:null;var C=-1;while (B){C++;if (B==A) return C;B=B.nextSibling;};return-1;},PaddingNode:null,EnforcePaddingNode:function(A,B){try{if (!A||!A.body) return;}catch (e){return;};this.CheckAndRemovePaddingNode(A,B,true);try{if (A.body.lastChild&&(A.body.lastChild.nodeType!=1||A.body.lastChild.tagName.toLowerCase()==B.toLowerCase())) return;}catch (e){return;};var C=A.createElement(B);if (FCKBrowserInfo.IsGecko&&FCKListsLib.NonEmptyBlockElements[B]) FCKTools.AppendBogusBr(C);this.PaddingNode=C;if (A.body.childNodes.length==1&&A.body.firstChild.nodeType==1&&A.body.firstChild.tagName.toLowerCase()=='br'&&(A.body.firstChild.getAttribute('_moz_dirty')!=null||A.body.firstChild.getAttribute('type')=='_moz')) A.body.replaceChild(C,A.body.firstChild);else A.body.appendChild(C);},CheckAndRemovePaddingNode:function(A,B,C){var D=this.PaddingNode;if (!D) return;try{if (D.parentNode!=A.body||D.tagName.toLowerCase()!=B||(D.childNodes.length>1)||(D.firstChild&&D.firstChild.nodeValue!='\xa0'&&String(D.firstChild.tagName).toLowerCase()!='br')){this.PaddingNode=null;return;}}catch (e){this.PaddingNode=null;return;};if (!C){if (D.parentNode.childNodes.length>1) D.parentNode.removeChild(D);this.PaddingNode=null;}},HasAttribute:function(A,B){if (A.hasAttribute) return A.hasAttribute(B);else{var C=A.attributes[B];return (C!=undefined&&C.specified);}},HasAttributes:function(A){var B=A.attributes;for (var i=0;i0) return true;}else if (B[i].specified) return true;};return false;},RemoveAttribute:function(A,B){if (FCKBrowserInfo.IsIE&&B.toLowerCase()=='class') B='className';return A.removeAttribute(B,0);},RemoveAttributes:function (A,B){for (var i=0;i0) return false;C=C.nextSibling;};return D?this.CheckIsEmptyElement(D,B):true;},SetElementStyles:function(A,B){var C=A.style;for (var D in B) C[D]=B[D];},SetOpacity:function(A,B){if (FCKBrowserInfo.IsIE){B=Math.round(B*100);A.style.filter=(B>100?'':'progid:DXImageTransform.Microsoft.Alpha(opacity='+B+')');}else A.style.opacity=B;},GetCurrentElementStyle:function(A,B){if (FCKBrowserInfo.IsIE) return A.currentStyle[B];else return A.ownerDocument.defaultView.getComputedStyle(A,'').getPropertyValue(B);},GetPositionedAncestor:function(A){var B=A;while (B!=FCKTools.GetElementDocument(B).documentElement){if (this.GetCurrentElementStyle(B,'position')!='static') return B;if (B==FCKTools.GetElementDocument(B).documentElement&¤tWindow!=w) B=currentWindow.frameElement;else B=B.parentNode;};return null;},ScrollIntoView:function(A,B){var C=FCKTools.GetElementWindow(A);var D=FCKTools.GetViewPaneSize(C).Height;var E=D*-1;if (B===false){E+=A.offsetHeight||0;E+=parseInt(this.GetCurrentElementStyle(A,'marginBottom')||0,10)||0;};var F=FCKTools.GetDocumentPosition(C,A);E+=F.y;var G=FCKTools.GetScrollPosition(C).Y;if (E>0&&(E>G||E0) break;if (A.lastChild) A=A.lastChild;else return this.GetPreviousSourceElement(A,B,C,D);};return null;},GetNextSourceElement:function(A,B,C,D,E){while((A=this.GetNextSourceNode(A,E))){if (A.nodeType==1){if (C&&A.nodeName.IEquals(C)) break;if (D&&A.nodeName.IEquals(D)) return this.GetNextSourceElement(A,B,C,D);return A;}else if (B&&A.nodeType==3&&A.nodeValue.RTrim().length>0) break;};return null;},GetNextSourceNode:function(A,B,C,D){if (!A) return null;var E;if (!B&&A.firstChild) E=A.firstChild;else{if (D&&A==D) return null;E=A.nextSibling;if (!E&&(!D||D!=A.parentNode)) return this.GetNextSourceNode(A.parentNode,true,C,D);};if (C&&E&&E.nodeType!=C) return this.GetNextSourceNode(E,false,C,D);return E;},GetPreviousSourceNode:function(A,B,C,D){if (!A) return null;var E;if (!B&&A.lastChild) E=A.lastChild;else{if (D&&A==D) return null;E=A.previousSibling;if (!E&&(!D||D!=A.parentNode)) return this.GetPreviousSourceNode(A.parentNode,true,C,D);};if (C&&E&&E.nodeType!=C) return this.GetPreviousSourceNode(E,false,C,D);return E;},InsertAfterNode:function(A,B){return A.parentNode.insertBefore(B,A.nextSibling);},GetParents:function(A){var B=[];while (A){B.unshift(A);A=A.parentNode;};return B;},GetCommonParents:function(A,B){var C=this.GetParents(A);var D=this.GetParents(B);var E=[];for (var i=0;i0) D[C.pop().toLowerCase()]=1;var E=this.GetCommonParents(A,B);var F=null;while ((F=E.pop())){if (D[F.nodeName.toLowerCase()]) return F;};return null;},GetIndexOf:function(A){var B=A.parentNode?A.parentNode.firstChild:null;var C=-1;while (B){C++;if (B==A) return C;B=B.nextSibling;};return-1;},PaddingNode:null,EnforcePaddingNode:function(A,B){try{if (!A||!A.body) return;}catch (e){return;};this.CheckAndRemovePaddingNode(A,B,true);try{if (A.body.lastChild&&(A.body.lastChild.nodeType!=1||A.body.lastChild.tagName.toLowerCase()==B.toLowerCase())) return;}catch (e){return;};var C=A.createElement(B);if (FCKBrowserInfo.IsGecko&&FCKListsLib.NonEmptyBlockElements[B]) FCKTools.AppendBogusBr(C);this.PaddingNode=C;if (A.body.childNodes.length==1&&A.body.firstChild.nodeType==1&&A.body.firstChild.tagName.toLowerCase()=='br'&&(A.body.firstChild.getAttribute('_moz_dirty')!=null||A.body.firstChild.getAttribute('type')=='_moz')) A.body.replaceChild(C,A.body.firstChild);else A.body.appendChild(C);},CheckAndRemovePaddingNode:function(A,B,C){var D=this.PaddingNode;if (!D) return;try{if (D.parentNode!=A.body||D.tagName.toLowerCase()!=B||(D.childNodes.length>1)||(D.firstChild&&D.firstChild.nodeValue!='\xa0'&&String(D.firstChild.tagName).toLowerCase()!='br')){this.PaddingNode=null;return;}}catch (e){this.PaddingNode=null;return;};if (!C){if (D.parentNode.childNodes.length>1) D.parentNode.removeChild(D);this.PaddingNode=null;}},HasAttribute:function(A,B){if (A.hasAttribute) return A.hasAttribute(B);else{var C=A.attributes[B];return (C!=undefined&&C.specified);}},HasAttributes:function(A){var B=A.attributes;for (var i=0;i0) return true;continue;}};if (B[i].specified) return true;};return false;},RemoveAttribute:function(A,B){if (FCKBrowserInfo.IsIE&&B.toLowerCase()=='class') B='className';return A.removeAttribute(B,0);},RemoveAttributes:function (A,B){for (var i=0;i0) return false;C=C.nextSibling;};return D?this.CheckIsEmptyElement(D,B):true;},SetElementStyles:function(A,B){var C=A.style;for (var D in B) C[D]=B[D];},SetOpacity:function(A,B){if (FCKBrowserInfo.IsIE){B=Math.round(B*100);A.style.filter=(B>100?'':'progid:DXImageTransform.Microsoft.Alpha(opacity='+B+')');}else A.style.opacity=B;},GetCurrentElementStyle:function(A,B){if (FCKBrowserInfo.IsIE) return A.currentStyle[B];else return A.ownerDocument.defaultView.getComputedStyle(A,'').getPropertyValue(B);},GetPositionedAncestor:function(A){var B=A;while (B!=FCKTools.GetElementDocument(B).documentElement){if (this.GetCurrentElementStyle(B,'position')!='static') return B;if (B==FCKTools.GetElementDocument(B).documentElement&¤tWindow!=w) B=currentWindow.frameElement;else B=B.parentNode;};return null;},ScrollIntoView:function(A,B){var C=FCKTools.GetElementWindow(A);var D=FCKTools.GetViewPaneSize(C).Height;var E=D*-1;if (B===false){E+=A.offsetHeight||0;E+=parseInt(this.GetCurrentElementStyle(A,'marginBottom')||0,10)||0;};var F=FCKTools.GetDocumentPosition(C,A);E+=F.y;var G=FCKTools.GetScrollPosition(C).Y;if (E>0&&(E>G||E'+styleDef+'';};var C=function(cssFileUrl,markTemp){if (cssFileUrl.length==0) return '';var B=markTemp?' _fcktemp="true"':'';return '';};return function(cssFileOrArrayOrDef,markTemp){if (!cssFileOrArrayOrDef) return '';if (typeof(cssFileOrArrayOrDef)=='string'){if (/[\\\/\.][^{}]*$/.test(cssFileOrArrayOrDef)){return this.GetStyleHtml(cssFileOrArrayOrDef.split(','),markTemp);}else return A(this._GetUrlFixedCss(cssFileOrArrayOrDef),markTemp);}else{var E='';for (var i=0;i/g,'>');return A;};FCKTools.HTMLDecode=function(A){if (!A) return '';A=A.replace(/>/g,'>');A=A.replace(/</g,'<');A=A.replace(/&/g,'&');return A;};FCKTools._ProcessLineBreaksForPMode=function(A,B,C,D,E){var F=0;var G="

    ";var H="

    ";var I="
    ";if (C){G="
  • ";H="
  • ";F=1;}while (D&&D!=A.FCK.EditorDocument.body){if (D.tagName.toLowerCase()=='p'){F=1;break;};D=D.parentNode;};for (var i=0;i0) return A[A.length-1];return null;};FCKTools.GetDocumentPosition=function(w,A){var x=0;var y=0;var B=A;var C=null;var D=FCKTools.GetElementWindow(B);while (B&&!(D==w&&(B==w.document.body||B==w.document.documentElement))){x+=B.offsetLeft-B.scrollLeft;y+=B.offsetTop-B.scrollTop;if (!FCKBrowserInfo.IsOpera){var E=C;while (E&&E!=B){x-=E.scrollLeft;y-=E.scrollTop;E=E.parentNode;}};C=B;if (B.offsetParent) B=B.offsetParent;else{if (D!=w){B=D.frameElement;C=null;if (B) D=B.contentWindow.parent;}else B=null;}};if (FCKDomTools.GetCurrentElementStyle(w.document.body,'position')!='static'||(FCKBrowserInfo.IsIE&&FCKDomTools.GetPositionedAncestor(A)==null)){x+=w.document.body.offsetLeft;y+=w.document.body.offsetTop;};return { "x":x,"y":y };};FCKTools.GetWindowPosition=function(w,A){var B=this.GetDocumentPosition(w,A);var C=FCKTools.GetScrollPosition(w);B.x-=C.X;B.y-=C.Y;return B;};FCKTools.ProtectFormStyles=function(A){if (!A||A.nodeType!=1||A.tagName.toLowerCase()!='form') return [];var B=[];var C=['style','className'];for (var i=0;i0){for (var i=B.length-1;i>=0;i--){var C=B[i][0];var D=B[i][1];if (D) A.insertBefore(C,D);else A.appendChild(C);}}};FCKTools.GetNextNode=function(A,B){if (A.firstChild) return A.firstChild;else if (A.nextSibling) return A.nextSibling;else{var C=A.parentNode;while (C){if (C==B) return null;if (C.nextSibling) return C.nextSibling;else C=C.parentNode;}};return null;};FCKTools.GetNextTextNode=function(A,B,C){node=this.GetNextNode(A,B);if (C&&node&&C(node)) return null;while (node&&node.nodeType!=3){node=this.GetNextNode(node,B);if (C&&node&&C(node)) return null;};return node;};FCKTools.Merge=function(){var A=arguments;var o=A[0];for (var i=1;i');document.domain = '"+FCK_RUNTIME_DOMAIN+"';document.close();}() ) ;";if (FCKBrowserInfo.IsIE){if (FCKBrowserInfo.IsIE7||!FCKBrowserInfo.IsIE6) return "";else return "javascript: '';";};return "javascript: void(0);";};FCKTools.ResetStyles=function(A){A.style.cssText='margin:0;padding:0;border:0;background-color:transparent;background-image:none;';}; FCKTools.CancelEvent=function(e){if (e) e.preventDefault();};FCKTools.DisableSelection=function(A){if (FCKBrowserInfo.IsGecko) A.style.MozUserSelect='none';else if (FCKBrowserInfo.IsSafari) A.style.KhtmlUserSelect='none';else A.style.userSelect='none';};FCKTools._AppendStyleSheet=function(A,B){var e=A.createElement('LINK');e.rel='stylesheet';e.type='text/css';e.href=B;A.getElementsByTagName("HEAD")[0].appendChild(e);return e;};FCKTools.AppendStyleString=function(A,B){if (!B) return null;var e=A.createElement("STYLE");e.appendChild(A.createTextNode(B));A.getElementsByTagName("HEAD")[0].appendChild(e);return e;};FCKTools.ClearElementAttributes=function(A){for (var i=0;i0) B[B.length]=D;C(parent.childNodes[i]);}};C(A);return B;};FCKTools.RemoveOuterTags=function(e){var A=e.ownerDocument.createDocumentFragment();for (var i=0;i','text/xml');FCKDomTools.RemoveNode(B.firstChild);return B;};return null;};FCKTools.GetScrollPosition=function(A){return { X:A.pageXOffset,Y:A.pageYOffset };};FCKTools.AddEventListener=function(A,B,C){A.addEventListener(B,C,false);};FCKTools.RemoveEventListener=function(A,B,C){A.removeEventListener(B,C,false);};FCKTools.AddEventListenerEx=function(A,B,C,D){A.addEventListener(B,function(e){C.apply(A,[e].concat(D||[]));},false);};FCKTools.GetViewPaneSize=function(A){return { Width:A.innerWidth,Height:A.innerHeight };};FCKTools.SaveStyles=function(A){var B=FCKTools.ProtectFormStyles(A);var C={};if (A.className.length>0){C.Class=A.className;A.className='';};var D=A.getAttribute('style');if (D&&D.length>0){C.Inline=D;A.setAttribute('style','',0);};FCKTools.RestoreFormStyles(A,B);return C;};FCKTools.RestoreStyles=function(A,B){var C=FCKTools.ProtectFormStyles(A);A.className=B.Class||'';if (B.Inline) A.setAttribute('style',B.Inline,0);else A.removeAttribute('style',0);FCKTools.RestoreFormStyles(A,C);};FCKTools.RegisterDollarFunction=function(A){A.$=function(id){return A.document.getElementById(id);};};FCKTools.AppendElement=function(A,B){return A.appendChild(A.ownerDocument.createElement(B));};FCKTools.GetElementPosition=function(A,B){var c={ X:0,Y:0 };var C=B||window;var D=FCKTools.GetElementWindow(A);var E=null;while (A){var F=D.getComputedStyle(A,'').position;if (F&&F!='static'&&A.style.zIndex!=FCKConfig.FloatingPanelsZIndex) break;c.X+=A.offsetLeft-A.scrollLeft;c.Y+=A.offsetTop-A.scrollTop;if (!FCKBrowserInfo.IsOpera){var G=E;while (G&&G!=A){c.X-=G.scrollLeft;c.Y-=G.scrollTop;G=G.parentNode;}};E=A;if (A.offsetParent) A=A.offsetParent;else{if (D!=C){A=D.frameElement;E=null;if (A) D=FCKTools.GetElementWindow(A);}else{c.X+=A.scrollLeft;c.Y+=A.scrollTop;break;}}};return c;}; var FCKeditorAPI;function InitializeAPI(){var A=window.parent;if (!(FCKeditorAPI=A.FCKeditorAPI)){var B='window.FCKeditorAPI = {Version : "2.6.4.1",VersionBuild : "23195",Instances : window.FCKeditorAPI && window.FCKeditorAPI.Instances || {},GetInstance : function( name ){return this.Instances[ name ];},_FormSubmit : function(){for ( var name in FCKeditorAPI.Instances ){var oEditor = FCKeditorAPI.Instances[ name ] ;if ( oEditor.GetParentForm && oEditor.GetParentForm() == this )oEditor.UpdateLinkedField() ;}this._FCKOriginalSubmit() ;},_FunctionQueue : window.FCKeditorAPI && window.FCKeditorAPI._FunctionQueue || {Functions : new Array(),IsRunning : false,Add : function( f ){this.Functions.push( f );if ( !this.IsRunning )this.StartNext();},StartNext : function(){var aQueue = this.Functions ;if ( aQueue.length > 0 ){this.IsRunning = true;aQueue[0].call();}else this.IsRunning = false;},Remove : function( f ){var aQueue = this.Functions;var i = 0, fFunc;while( (fFunc = aQueue[ i ]) ){if ( fFunc == f )aQueue.splice( i,1 );i++ ;}this.StartNext();}}}';if (A.execScript) A.execScript(B,'JavaScript');else{if (FCKBrowserInfo.IsGecko10){eval.call(A,B);}else if(FCKBrowserInfo.IsAIR){FCKAdobeAIR.FCKeditorAPI_Evaluate(A,B);}else if (FCKBrowserInfo.IsSafari){var C=A.document;var D=C.createElement('script');D.appendChild(C.createTextNode(B));C.documentElement.appendChild(D);}else A.eval(B);};FCKeditorAPI=A.FCKeditorAPI;FCKeditorAPI.__Instances=FCKeditorAPI.Instances;};FCKeditorAPI.Instances[FCK.Name]=FCK;};function _AttachFormSubmitToAPI(){var A=FCK.GetParentForm();if (A){FCKTools.AddEventListener(A,'submit',FCK.UpdateLinkedField);if (!A._FCKOriginalSubmit&&(typeof(A.submit)=='function'||(!A.submit.tagName&&!A.submit.length))){A._FCKOriginalSubmit=A.submit;A.submit=FCKeditorAPI._FormSubmit;}}};function FCKeditorAPI_Cleanup(){if (window.FCKConfig&&FCKConfig.MsWebBrowserControlCompat&&!window.FCKUnloadFlag) return;delete FCKeditorAPI.Instances[FCK.Name];};function FCKeditorAPI_ConfirmCleanup(){if (window.FCKConfig&&FCKConfig.MsWebBrowserControlCompat) window.FCKUnloadFlag=true;};FCKTools.AddEventListener(window,'unload',FCKeditorAPI_Cleanup);FCKTools.AddEventListener(window,'beforeunload',FCKeditorAPI_ConfirmCleanup); @@ -41,7 +41,7 @@ var FCKRegexLib={AposEntity:/'/gi,ObjectElements:/^(?:IMG|TABLE|TR|TD|TH|IN var FCKListsLib={BlockElements:{ address:1,blockquote:1,center:1,div:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,marquee:1,noscript:1,ol:1,p:1,pre:1,script:1,table:1,ul:1 },NonEmptyBlockElements:{ p:1,div:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,address:1,pre:1,ol:1,ul:1,li:1,td:1,th:1 },InlineChildReqElements:{ abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1 },InlineNonEmptyElements:{ a:1,abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1 },EmptyElements:{ base:1,col:1,meta:1,link:1,hr:1,br:1,param:1,img:1,area:1,input:1 },PathBlockElements:{ address:1,blockquote:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,li:1,dt:1,de:1 },PathBlockLimitElements:{ body:1,div:1,td:1,th:1,caption:1,form:1 },StyleBlockElements:{ address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1 },StyleObjectElements:{ img:1,hr:1,li:1,table:1,tr:1,td:1,embed:1,object:1,ol:1,ul:1 },NonEditableElements:{ button:1,option:1,script:1,iframe:1,textarea:1,object:1,embed:1,map:1,applet:1 },BlockBoundaries:{ p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,address:1,pre:1,ol:1,ul:1,li:1,dt:1,de:1,table:1,thead:1,tbody:1,tfoot:1,tr:1,th:1,td:1,caption:1,col:1,colgroup:1,blockquote:1,body:1 },ListBoundaries:{ p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,address:1,pre:1,ol:1,ul:1,li:1,dt:1,de:1,table:1,thead:1,tbody:1,tfoot:1,tr:1,th:1,td:1,caption:1,col:1,colgroup:1,blockquote:1,body:1,br:1 }}; var FCKLanguageManager=FCK.Language={AvailableLanguages:{af:'Afrikaans',ar:'Arabic',bg:'Bulgarian',bn:'Bengali/Bangla',bs:'Bosnian',ca:'Catalan',cs:'Czech',da:'Danish',de:'German',el:'Greek',en:'English','en-au':'English (Australia)','en-ca':'English (Canadian)','en-uk':'English (United Kingdom)',eo:'Esperanto',es:'Spanish',et:'Estonian',eu:'Basque',fa:'Persian',fi:'Finnish',fo:'Faroese',fr:'French','fr-ca':'French (Canada)',gl:'Galician',gu:'Gujarati',he:'Hebrew',hi:'Hindi',hr:'Croatian',hu:'Hungarian',is:'Icelandic',it:'Italian',ja:'Japanese',km:'Khmer',ko:'Korean',lt:'Lithuanian',lv:'Latvian',mn:'Mongolian',ms:'Malay',nb:'Norwegian Bokmal',nl:'Dutch',no:'Norwegian',pl:'Polish',pt:'Portuguese (Portugal)','pt-br':'Portuguese (Brazil)',ro:'Romanian',ru:'Russian',sk:'Slovak',sl:'Slovenian',sr:'Serbian (Cyrillic)','sr-latn':'Serbian (Latin)',sv:'Swedish',th:'Thai',tr:'Turkish',uk:'Ukrainian',vi:'Vietnamese',zh:'Chinese Traditional','zh-cn':'Chinese Simplified'},GetActiveLanguage:function(){if (FCKConfig.AutoDetectLanguage){var A;if (navigator.userLanguage) A=navigator.userLanguage.toLowerCase();else if (navigator.language) A=navigator.language.toLowerCase();else{return FCKConfig.DefaultLanguage;};if (A.length>=5){A=A.substr(0,5);if (this.AvailableLanguages[A]) return A;};if (A.length>=2){A=A.substr(0,2);if (this.AvailableLanguages[A]) return A;}};return this.DefaultLanguage;},TranslateElements:function(A,B,C,D){var e=A.getElementsByTagName(B);var E,s;for (var i=0;i':'gt','ˆ':'circ','˜':'tilde',' ':'ensp',' ':'emsp',' ':'thinsp','‌':'zwnj','‍':'zwj','‎':'lrm','‏':'rlm','–':'ndash','—':'mdash','‘':'lsquo','’':'rsquo','‚':'sbquo','“':'ldquo','”':'rdquo','„':'bdquo','†':'dagger','‡':'Dagger','‰':'permil','‹':'lsaquo','›':'rsaquo','€':'euro'};for (e in FCKXHtmlEntities.Entities) A+=e;if (FCKConfig.IncludeLatinEntities){B={'À':'Agrave','Á':'Aacute','Â':'Acirc','Ã':'Atilde','Ä':'Auml','Å':'Aring','Æ':'AElig','Ç':'Ccedil','È':'Egrave','É':'Eacute','Ê':'Ecirc','Ë':'Euml','Ì':'Igrave','Í':'Iacute','Î':'Icirc','Ï':'Iuml','Ð':'ETH','Ñ':'Ntilde','Ò':'Ograve','Ó':'Oacute','Ô':'Ocirc','Õ':'Otilde','Ö':'Ouml','Ø':'Oslash','Ù':'Ugrave','Ú':'Uacute','Û':'Ucirc','Ü':'Uuml','Ý':'Yacute','Þ':'THORN','ß':'szlig','à':'agrave','á':'aacute','â':'acirc','ã':'atilde','ä':'auml','å':'aring','æ':'aelig','ç':'ccedil','è':'egrave','é':'eacute','ê':'ecirc','ë':'euml','ì':'igrave','í':'iacute','î':'icirc','ï':'iuml','ð':'eth','ñ':'ntilde','ò':'ograve','ó':'oacute','ô':'ocirc','õ':'otilde','ö':'ouml','ø':'oslash','ù':'ugrave','ú':'uacute','û':'ucirc','ü':'uuml','ý':'yacute','þ':'thorn','ÿ':'yuml','Œ':'OElig','œ':'oelig','Š':'Scaron','š':'scaron','Ÿ':'Yuml'};for (e in B){FCKXHtmlEntities.Entities[e]=B[e];A+=e;};B=null;};if (FCKConfig.IncludeGreekEntities){B={'Α':'Alpha','Β':'Beta','Γ':'Gamma','Δ':'Delta','Ε':'Epsilon','Ζ':'Zeta','Η':'Eta','Θ':'Theta','Ι':'Iota','Κ':'Kappa','Λ':'Lambda','Μ':'Mu','Ν':'Nu','Ξ':'Xi','Ο':'Omicron','Π':'Pi','Ρ':'Rho','Σ':'Sigma','Τ':'Tau','Υ':'Upsilon','Φ':'Phi','Χ':'Chi','Ψ':'Psi','Ω':'Omega','α':'alpha','β':'beta','γ':'gamma','δ':'delta','ε':'epsilon','ζ':'zeta','η':'eta','θ':'theta','ι':'iota','κ':'kappa','λ':'lambda','μ':'mu','ν':'nu','ξ':'xi','ο':'omicron','π':'pi','ρ':'rho','ς':'sigmaf','σ':'sigma','τ':'tau','υ':'upsilon','φ':'phi','χ':'chi','ψ':'psi','ω':'omega','\u03d1':'thetasym','\u03d2':'upsih','\u03d6':'piv'};for (e in B){FCKXHtmlEntities.Entities[e]=B[e];A+=e;};B=null;}}else{FCKXHtmlEntities.Entities={'>':'gt'};A='>';A+=' ';};var C='['+A+']';if (FCKConfig.ProcessNumericEntities) C='[^ -~]|'+C;var D=FCKConfig.AdditionalNumericEntities;if (D&&D.length>0) C+='|'+FCKConfig.AdditionalNumericEntities;FCKXHtmlEntities.EntitiesRegex=new RegExp(C,'g');}; -var FCKXHtml={};FCKXHtml.CurrentJobNum=0;FCKXHtml.GetXHTML=function(A,B,C){FCKDomTools.CheckAndRemovePaddingNode(FCKTools.GetElementDocument(A),FCKConfig.EnterMode);FCKXHtmlEntities.Initialize();this._NbspEntity=(FCKConfig.ProcessHTMLEntities?'nbsp':'#160');var D=FCK.IsDirty();FCKXHtml.SpecialBlocks=[];this.XML=FCKTools.CreateXmlObject('DOMDocument');this.MainNode=this.XML.appendChild(this.XML.createElement('xhtml'));FCKXHtml.CurrentJobNum++;if (B) this._AppendNode(this.MainNode,A);else this._AppendChildNodes(this.MainNode,A,false);var E=this._GetMainXmlString();this.XML=null;if (FCKBrowserInfo.IsSafari) E=E.replace(/^/,'');E=E.substr(7,E.length-15).Trim();if (FCKConfig.DocType.length>0&&FCKRegexLib.HtmlDocType.test(FCKConfig.DocType)) E=E.replace(FCKRegexLib.SpaceNoClose,'>');else E=E.replace(FCKRegexLib.SpaceNoClose,' />');if (FCKConfig.ForceSimpleAmpersand) E=E.replace(FCKRegexLib.ForceSimpleAmpersand,'&');if (C) E=FCKCodeFormatter.Format(E);for (var i=0;i0;if (C) A.appendChild(this.XML.createTextNode(B.replace(FCKXHtmlEntities.EntitiesRegex,FCKXHtml_GetEntity)));return C;};function FCKXHtml_GetEntity(A){var B=FCKXHtmlEntities.Entities[A]||('#'+A.charCodeAt(0));return '#?-:'+B+';';};FCKXHtml.TagProcessors={a:function(A,B){if (B.innerHTML.Trim().length==0&&!B.name) return false;var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'href',C);if (FCKBrowserInfo.IsIE){if (B.name) FCKXHtml._AppendAttribute(A,'name',B.name);};A=FCKXHtml._AppendChildNodes(A,B,false);return A;},area:function(A,B){var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'href',C);if (FCKBrowserInfo.IsIE){if (!A.attributes.getNamedItem('coords')){var D=B.getAttribute('coords',2);if (D&&D!='0,0,0') FCKXHtml._AppendAttribute(A,'coords',D);};if (!A.attributes.getNamedItem('shape')){var E=B.getAttribute('shape',2);if (E&&E.length>0) FCKXHtml._AppendAttribute(A,'shape',E.toLowerCase());}};return A;},body:function(A,B){A=FCKXHtml._AppendChildNodes(A,B,false);A.removeAttribute('spellcheck');return A;},iframe:function(A,B){var C=B.innerHTML;if (FCKBrowserInfo.IsGecko) C=FCKTools.HTMLDecode(C);C=C.replace(/\s_fcksavedurl="[^"]*"/g,'');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(C)));return A;},img:function(A,B){if (!A.attributes.getNamedItem('alt')) FCKXHtml._AppendAttribute(A,'alt','');var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'src',C);if (B.style.width) A.removeAttribute('width');if (B.style.height) A.removeAttribute('height');return A;},li:function(A,B,C){if (C.nodeName.IEquals(['ul','ol'])) return FCKXHtml._AppendChildNodes(A,B,true);var D=FCKXHtml.XML.createElement('ul');B._fckxhtmljob=null;do{FCKXHtml._AppendNode(D,B);do{B=FCKDomTools.GetNextSibling(B);} while (B&&B.nodeType==3&&B.nodeValue.Trim().length==0)} while (B&&B.nodeName.toLowerCase()=='li') return D;},ol:function(A,B,C){if (B.innerHTML.Trim().length==0) return false;var D=C.lastChild;if (D&&D.nodeType==3) D=D.previousSibling;if (D&&D.nodeName.toUpperCase()=='LI'){B._fckxhtmljob=null;FCKXHtml._AppendNode(D,B);return false;};A=FCKXHtml._AppendChildNodes(A,B);return A;},pre:function (A,B){var C=B.firstChild;if (C&&C.nodeType==3) A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem('\r\n')));FCKXHtml._AppendChildNodes(A,B,true);return A;},script:function(A,B){if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text/javascript');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(B.text)));return A;},span:function(A,B){if (B.innerHTML.length==0) return false;A=FCKXHtml._AppendChildNodes(A,B,false);return A;},style:function(A,B){if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text/css');var C=B.innerHTML;if (FCKBrowserInfo.IsIE) C=C.replace(/^(\r\n|\n|\r)/,'');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(C)));return A;},title:function(A,B){A.appendChild(FCKXHtml.XML.createTextNode(FCK.EditorDocument.title));return A;}};FCKXHtml.TagProcessors.ul=FCKXHtml.TagProcessors.ol; +var FCKXHtml={};FCKXHtml.CurrentJobNum=0;FCKXHtml.GetXHTML=function(A,B,C){FCKDomTools.CheckAndRemovePaddingNode(FCKTools.GetElementDocument(A),FCKConfig.EnterMode);FCKXHtmlEntities.Initialize();this._NbspEntity=(FCKConfig.ProcessHTMLEntities?'nbsp':'#160');var D=FCK.IsDirty();FCKXHtml.SpecialBlocks=[];this.XML=FCKTools.CreateXmlObject('DOMDocument');this.MainNode=this.XML.appendChild(this.XML.createElement('xhtml'));FCKXHtml.CurrentJobNum++;if (B) this._AppendNode(this.MainNode,A);else this._AppendChildNodes(this.MainNode,A,false);if (FCKBrowserInfo.IsIE) FCKXHtml._RemoveXHtmlJobProperties(A);var E=this._GetMainXmlString();this.XML=null;if (FCKBrowserInfo.IsSafari) E=E.replace(/^/,'');E=E.substr(7,E.length-15).Trim();if (FCKConfig.DocType.length>0&&FCKRegexLib.HtmlDocType.test(FCKConfig.DocType)) E=E.replace(FCKRegexLib.SpaceNoClose,'>');else E=E.replace(FCKRegexLib.SpaceNoClose,' />');if (FCKConfig.ForceSimpleAmpersand) E=E.replace(FCKRegexLib.ForceSimpleAmpersand,'&');if (C) E=FCKCodeFormatter.Format(E);for (var i=0;i0;if (C) A.appendChild(this.XML.createTextNode(B.replace(FCKXHtmlEntities.EntitiesRegex,FCKXHtml_GetEntity)));return C;};function FCKXHtml_GetEntity(A){var B=FCKXHtmlEntities.Entities[A]||('#'+A.charCodeAt(0));return '#?-:'+B+';';};FCKXHtml.TagProcessors={a:function(A,B){if (B.innerHTML.Trim().length==0&&!B.name) return false;var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'href',C);if (FCKBrowserInfo.IsIE){if (B.name) FCKXHtml._AppendAttribute(A,'name',B.name);};A=FCKXHtml._AppendChildNodes(A,B,false);return A;},area:function(A,B){var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'href',C);if (FCKBrowserInfo.IsIE){if (!A.attributes.getNamedItem('coords')){var D=B.getAttribute('coords',2);if (D&&D!='0,0,0') FCKXHtml._AppendAttribute(A,'coords',D);};if (!A.attributes.getNamedItem('shape')){var E=B.getAttribute('shape',2);if (E&&E.length>0) FCKXHtml._AppendAttribute(A,'shape',E.toLowerCase());}};return A;},body:function(A,B){A=FCKXHtml._AppendChildNodes(A,B,false);A.removeAttribute('spellcheck');return A;},iframe:function(A,B){var C=B.innerHTML;if (FCKBrowserInfo.IsGecko) C=FCKTools.HTMLDecode(C);C=C.replace(/\s_fcksavedurl="[^"]*"/g,'');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(C)));return A;},img:function(A,B){if (!A.attributes.getNamedItem('alt')) FCKXHtml._AppendAttribute(A,'alt','');var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'src',C);if (B.style.width) A.removeAttribute('width');if (B.style.height) A.removeAttribute('height');return A;},li:function(A,B,C){if (C.nodeName.IEquals(['ul','ol'])) return FCKXHtml._AppendChildNodes(A,B,true);var D=FCKXHtml.XML.createElement('ul');B._fckxhtmljob=null;do{FCKXHtml._AppendNode(D,B);do{B=FCKDomTools.GetNextSibling(B);} while (B&&B.nodeType==3&&B.nodeValue.Trim().length==0)} while (B&&B.nodeName.toLowerCase()=='li') return D;},ol:function(A,B,C){if (B.innerHTML.Trim().length==0) return false;var D=C.lastChild;if (D&&D.nodeType==3) D=D.previousSibling;if (D&&D.nodeName.toUpperCase()=='LI'){B._fckxhtmljob=null;FCKXHtml._AppendNode(D,B);return false;};A=FCKXHtml._AppendChildNodes(A,B);return A;},pre:function (A,B){var C=B.firstChild;if (C&&C.nodeType==3) A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem('\r\n')));FCKXHtml._AppendChildNodes(A,B,true);return A;},script:function(A,B){if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text/javascript');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(B.text)));return A;},span:function(A,B){if (B.innerHTML.length==0) return false;A=FCKXHtml._AppendChildNodes(A,B,false);return A;},style:function(A,B){if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text/css');var C=B.innerHTML;if (FCKBrowserInfo.IsIE) C=C.replace(/^(\r\n|\n|\r)/,'');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(C)));return A;},title:function(A,B){A.appendChild(FCKXHtml.XML.createTextNode(FCK.EditorDocument.title));return A;}};FCKXHtml.TagProcessors.ul=FCKXHtml.TagProcessors.ol; FCKXHtml._GetMainXmlString=function(){return (new XMLSerializer()).serializeToString(this.MainNode);};FCKXHtml._AppendAttributes=function(A,B,C){var D=B.attributes;for (var n=0;n]*\>/gi;A.BlocksCloser=/\<\/(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|DL|DT|DD|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION)[^\>]*\>/gi;A.NewLineTags=/\<(BR|HR)[^\>]*\>/gi;A.MainTags=/\<\/?(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR)[^\>]*\>/gi;A.LineSplitter=/\s*\n+\s*/g;A.IncreaseIndent=/^\<(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL|DL)[ \/\>]/i;A.DecreaseIndent=/^\<\/(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL|DL)[ \>]/i;A.FormatIndentatorRemove=new RegExp('^'+FCKConfig.FormatIndentator);A.ProtectedTags=/(]*>)([\s\S]*?)(<\/PRE>)/gi;};FCKCodeFormatter._ProtectData=function(A,B,C,D){return B+'___FCKpd___'+(FCKCodeFormatter.ProtectedData.push(C)-1)+D;};FCKCodeFormatter.Format=function(A){if (!this.Regex) this.Init();FCKCodeFormatter.ProtectedData=[];var B=A.replace(this.Regex.ProtectedTags,FCKCodeFormatter._ProtectData);B=B.replace(this.Regex.BlocksOpener,'\n$&');B=B.replace(this.Regex.BlocksCloser,'$&\n');B=B.replace(this.Regex.NewLineTags,'$&\n');B=B.replace(this.Regex.MainTags,'\n$&\n');var C='';var D=B.split(this.Regex.LineSplitter);B='';for (var i=0;iB[i]) return 1;};if (A.lengthB.length) return 1;return 0;};FCKUndo._CheckIsBookmarksEqual=function(A,B){if (!(A&&B)) return false;if (FCKBrowserInfo.IsIE){var C=A[1].search(A[0].StartId);var D=B[1].search(B[0].StartId);var E=A[1].search(A[0].EndId);var F=B[1].search(B[0].EndId);return C==D&&E==F;}else{return this._CompareCursors(A.Start,B.Start)==0&&this._CompareCursors(A.End,B.End)==0;}};FCKUndo.SaveUndoStep=function(){if (FCK.EditMode!=0||this.SaveLocked) return;if (this.SavedData.length) this.Changed=true;var A=FCK.EditorDocument.body.innerHTML;var B=this._GetBookmark();this.SavedData=this.SavedData.slice(0,this.CurrentIndex+1);if (this.CurrentIndex>0&&A==this.SavedData[this.CurrentIndex][0]&&this._CheckIsBookmarksEqual(B,this.SavedData[this.CurrentIndex][1])) return;else if (this.CurrentIndex==0&&this.SavedData.length&&A==this.SavedData[0][0]){this.SavedData[0][1]=B;return;};if (this.CurrentIndex+1>=FCKConfig.MaxUndoLevels) this.SavedData.shift();else this.CurrentIndex++;this.SavedData[this.CurrentIndex]=[A,B];FCK.Events.FireEvent("OnSelectionChange");};FCKUndo.CheckUndoState=function(){return (this.Changed||this.CurrentIndex>0);};FCKUndo.CheckRedoState=function(){return (this.CurrentIndex<(this.SavedData.length-1));};FCKUndo.Undo=function(){if (this.CheckUndoState()){if (this.CurrentIndex==(this.SavedData.length-1)){this.SaveUndoStep();};this._ApplyUndoLevel(--this.CurrentIndex);FCK.Events.FireEvent("OnSelectionChange");}};FCKUndo.Redo=function(){if (this.CheckRedoState()){this._ApplyUndoLevel(++this.CurrentIndex);FCK.Events.FireEvent("OnSelectionChange");}};FCKUndo._ApplyUndoLevel=function(A){var B=this.SavedData[A];if (!B) return;if (FCKBrowserInfo.IsIE){if (B[1]&&B[1][1]) FCK.SetInnerHtml(B[1][1]);else FCK.SetInnerHtml(B[0]);}else FCK.EditorDocument.body.innerHTML=B[0];this._SelectBookmark(B[1]);this.TypesCount=0;this.Changed=false;this.Typing=false;}; diff --git a/main/inc/lib/fckeditor/editor/js/fckeditorcode_ie.js b/main/inc/lib/fckeditor/editor/js/fckeditorcode_ie.js index 5efebfd076..72ee506b87 100644 --- a/main/inc/lib/fckeditor/editor/js/fckeditorcode_ie.js +++ b/main/inc/lib/fckeditor/editor/js/fckeditorcode_ie.js @@ -33,7 +33,7 @@ var FCK={Name:FCKURLParams['InstanceName'],Status:0,EditMode:0,Toolbar:null,HasF FCK.Description="FCKeditor for Internet Explorer 5.5+";FCK._GetBehaviorsStyle=function(){if (!FCK._BehaviorsStyle){var A=FCKConfig.BasePath;var B='';var C;C='';FCK._BehaviorsStyle=C;};return FCK._BehaviorsStyle;};function Doc_OnMouseUp(){if (FCK.EditorWindow.event.srcElement.tagName=='HTML'){FCK.Focus();FCK.EditorWindow.event.cancelBubble=true;FCK.EditorWindow.event.returnValue=false;}};function Doc_OnPaste(){var A=FCK.EditorDocument.body;A.detachEvent('onpaste',Doc_OnPaste);var B=FCK.Paste(!FCKConfig.ForcePasteAsPlainText&&!FCKConfig.AutoDetectPasteFromWord);A.attachEvent('onpaste',Doc_OnPaste);return B;};function Doc_OnDblClick(){FCK.OnDoubleClick(FCK.EditorWindow.event.srcElement);FCK.EditorWindow.event.cancelBubble=true;};function Doc_OnSelectionChange(){if (!FCK.IsSelectionChangeLocked&&FCK.EditorDocument) FCK.Events.FireEvent("OnSelectionChange");};function Doc_OnDrop(){if (FCK.MouseDownFlag){FCK.MouseDownFlag=false;return;};if (FCKConfig.ForcePasteAsPlainText){var A=FCK.EditorWindow.event;if (FCK._CheckIsPastingEnabled()||FCKConfig.ShowDropDialog) FCK.PasteAsPlainText(A.dataTransfer.getData('Text'));A.returnValue=false;A.cancelBubble=true;}};FCK.InitializeBehaviors=function(A){this.EditorDocument.attachEvent('onmouseup',Doc_OnMouseUp);this.EditorDocument.body.attachEvent('onpaste',Doc_OnPaste);this.EditorDocument.body.attachEvent('ondrop',Doc_OnDrop);FCK.ContextMenu._InnerContextMenu.AttachToElement(FCK.EditorDocument.body);this.EditorDocument.attachEvent("onkeydown",FCK._KeyDownListener);this.EditorDocument.attachEvent("ondblclick",Doc_OnDblClick);this.EditorDocument.attachEvent("onbeforedeactivate",function(){ FCKSelection.Save();});this.EditorDocument.attachEvent("onselectionchange",Doc_OnSelectionChange);FCKTools.AddEventListener(FCK.EditorDocument,'mousedown',Doc_OnMouseDown);};FCK.InsertHtml=function(A){A=FCKConfig.ProtectedSource.Protect(A);A=FCK.ProtectEvents(A);A=FCK.ProtectUrls(A);A=FCK.ProtectTags(A);FCKSelection.Restore();FCK.EditorWindow.focus();FCKUndo.SaveUndoStep();var B=FCKSelection.GetSelection();if (B.type.toLowerCase()=='control') B.clear();A=''+A;B.createRange().pasteHTML(A);var C=FCK.EditorDocument.getElementById('__fakeFCKRemove__');if (C.parentNode.childNodes.length==1) C=C.parentNode;C.removeNode(true);FCKDocumentProcessor.Process(FCK.EditorDocument);this.Events.FireEvent("OnSelectionChange");};FCK.SetInnerHtml=function(A){var B=FCK.EditorDocument;B.body.innerHTML='
     
    '+A;B.getElementById('__fakeFCKRemove__').removeNode(true);};function FCK_PreloadImages(){var A=new FCKImagePreloader();A.AddImages(FCKConfig.PreloadImages);A.AddImages(FCKConfig.SkinPath+'fck_strip.gif');A.OnComplete=LoadToolbarSetup;A.Start();};function Document_OnContextMenu(){return (event.srcElement._FCKShowContextMenu==true);};document.oncontextmenu=Document_OnContextMenu;function FCK_Cleanup(){this.LinkedField=null;this.EditorWindow=null;this.EditorDocument=null;};FCK._ExecPaste=function(){if (FCK._PasteIsRunning) return true;if (FCKConfig.ForcePasteAsPlainText){FCK.PasteAsPlainText();return false;};var A=FCK._CheckIsPastingEnabled(true);if (A===false) FCKTools.RunFunction(FCKDialog.OpenDialog,FCKDialog,['FCKDialog_Paste',FCKLang.Paste,'dialog/fck_paste.html',400,330,'Security']);else{if (FCKConfig.AutoDetectPasteFromWord&&A.length>0){var B=/<\w[^>]*(( class="?MsoNormal"?)|(="mso-))/gi;if (B.test(A)){if (confirm(FCKLang.PasteWordConfirm)){FCK.PasteFromWord();return false;}}};FCK._PasteIsRunning=true;FCK.ExecuteNamedCommand('Paste');delete FCK._PasteIsRunning;};return false;};FCK.PasteAsPlainText=function(A){if (!FCK._CheckIsPastingEnabled()){FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.PasteAsText,'dialog/fck_paste.html',400,330,'PlainText');return;};var B=null;if (!A) B=clipboardData.getData("Text");else B=A;if (B&&B.length>0){B=FCKTools.HTMLEncode(B);B=FCKTools.ProcessLineBreaks(window,FCKConfig,B);var C=B.search('

    ');var D=B.search('

    ');if ((C!=-1&&D!=-1&&C0){if (FCKSelection.GetType()=='Control'){var D=this.EditorDocument.createElement('A');D.href=A;var E=FCKSelection.GetSelectedElement();E.parentNode.insertBefore(D,E);E.parentNode.removeChild(E);D.appendChild(E);return [D];};var F='javascript:void(0);/*'+(new Date().getTime())+'*/';FCK.ExecuteNamedCommand('CreateLink',F,false,!!B);var G=this.EditorDocument.links;for (i=0;i0&&!isNaN(E)) this.PageConfig[D]=parseFloat(E);else this.PageConfig[D]=E;}};function FCKConfig_LoadPageConfig(){var A=FCKConfig.PageConfig;for (var B in A) FCKConfig[B]=A[B];};function FCKConfig_PreProcess(){var A=FCKConfig;if (A.AllowQueryStringDebug){try{if ((/fckdebug=true/i).test(window.top.location.search)) A.Debug=true;}catch (e) { }};if (!A.PluginsPath.EndsWith('/')) A.PluginsPath+='/';var B=A.ToolbarComboPreviewCSS;if (!B||B.length==0) A.ToolbarComboPreviewCSS=A.EditorAreaCSS;A.RemoveAttributesArray=(A.RemoveAttributes||'').split(',');if (!FCKConfig.SkinEditorCSS||FCKConfig.SkinEditorCSS.length==0) FCKConfig.SkinEditorCSS=FCKConfig.SkinPath+'fck_editor.css';if (!FCKConfig.SkinDialogCSS||FCKConfig.SkinDialogCSS.length==0) FCKConfig.SkinDialogCSS=FCKConfig.SkinPath+'fck_dialog.css';};FCKConfig.ToolbarSets={};FCKConfig.Plugins={};FCKConfig.Plugins.Items=[];FCKConfig.Plugins.Add=function(A,B,C){FCKConfig.Plugins.Items.push([A,B,C]);};FCKConfig.ProtectedSource={};FCKConfig.ProtectedSource._CodeTag=(new Date()).valueOf();FCKConfig.ProtectedSource.RegexEntries=[//g,//gi,//gi];FCKConfig.ProtectedSource.Add=function(A){this.RegexEntries.push(A);};FCKConfig.ProtectedSource.Protect=function(A){var B=this._CodeTag;function _Replace(protectedSource){var C=FCKTempBin.AddElement(protectedSource);return '';};for (var i=0;i|>)","g");return A.replace(D,_Replace);};FCKConfig.GetBodyAttributes=function(){var A='';if (this.BodyId&&this.BodyId.length>0) A+=' id="'+this.BodyId+'"';if (this.BodyClass&&this.BodyClass.length>0) A+=' class="'+this.BodyClass+'"';return A;};FCKConfig.ApplyBodyAttributes=function(A){if (this.BodyId&&this.BodyId.length>0) A.id=FCKConfig.BodyId;if (this.BodyClass&&this.BodyClass.length>0) A.className+=' '+FCKConfig.BodyClass;}; var FCKDebug={Output:function(){},OutputObject:function(){}}; -var FCKDomTools={MoveChildren:function(A,B,C){if (A==B) return;var D;if (C){while ((D=A.lastChild)) B.insertBefore(A.removeChild(D),B.firstChild);}else{while ((D=A.firstChild)) B.appendChild(A.removeChild(D));}},MoveNode:function(A,B,C){if (C) B.insertBefore(FCKDomTools.RemoveNode(A),B.firstChild);else B.appendChild(FCKDomTools.RemoveNode(A));},TrimNode:function(A){this.LTrimNode(A);this.RTrimNode(A);},LTrimNode:function(A){var B;while ((B=A.firstChild)){if (B.nodeType==3){var C=B.nodeValue.LTrim();var D=B.nodeValue.length;if (C.length==0){A.removeChild(B);continue;}else if (C.length0) break;if (A.lastChild) A=A.lastChild;else return this.GetPreviousSourceElement(A,B,C,D);};return null;},GetNextSourceElement:function(A,B,C,D,E){while((A=this.GetNextSourceNode(A,E))){if (A.nodeType==1){if (C&&A.nodeName.IEquals(C)) break;if (D&&A.nodeName.IEquals(D)) return this.GetNextSourceElement(A,B,C,D);return A;}else if (B&&A.nodeType==3&&A.nodeValue.RTrim().length>0) break;};return null;},GetNextSourceNode:function(A,B,C,D){if (!A) return null;var E;if (!B&&A.firstChild) E=A.firstChild;else{if (D&&A==D) return null;E=A.nextSibling;if (!E&&(!D||D!=A.parentNode)) return this.GetNextSourceNode(A.parentNode,true,C,D);};if (C&&E&&E.nodeType!=C) return this.GetNextSourceNode(E,false,C,D);return E;},GetPreviousSourceNode:function(A,B,C,D){if (!A) return null;var E;if (!B&&A.lastChild) E=A.lastChild;else{if (D&&A==D) return null;E=A.previousSibling;if (!E&&(!D||D!=A.parentNode)) return this.GetPreviousSourceNode(A.parentNode,true,C,D);};if (C&&E&&E.nodeType!=C) return this.GetPreviousSourceNode(E,false,C,D);return E;},InsertAfterNode:function(A,B){return A.parentNode.insertBefore(B,A.nextSibling);},GetParents:function(A){var B=[];while (A){B.unshift(A);A=A.parentNode;};return B;},GetCommonParents:function(A,B){var C=this.GetParents(A);var D=this.GetParents(B);var E=[];for (var i=0;i0) D[C.pop().toLowerCase()]=1;var E=this.GetCommonParents(A,B);var F=null;while ((F=E.pop())){if (D[F.nodeName.toLowerCase()]) return F;};return null;},GetIndexOf:function(A){var B=A.parentNode?A.parentNode.firstChild:null;var C=-1;while (B){C++;if (B==A) return C;B=B.nextSibling;};return-1;},PaddingNode:null,EnforcePaddingNode:function(A,B){try{if (!A||!A.body) return;}catch (e){return;};this.CheckAndRemovePaddingNode(A,B,true);try{if (A.body.lastChild&&(A.body.lastChild.nodeType!=1||A.body.lastChild.tagName.toLowerCase()==B.toLowerCase())) return;}catch (e){return;};var C=A.createElement(B);if (FCKBrowserInfo.IsGecko&&FCKListsLib.NonEmptyBlockElements[B]) FCKTools.AppendBogusBr(C);this.PaddingNode=C;if (A.body.childNodes.length==1&&A.body.firstChild.nodeType==1&&A.body.firstChild.tagName.toLowerCase()=='br'&&(A.body.firstChild.getAttribute('_moz_dirty')!=null||A.body.firstChild.getAttribute('type')=='_moz')) A.body.replaceChild(C,A.body.firstChild);else A.body.appendChild(C);},CheckAndRemovePaddingNode:function(A,B,C){var D=this.PaddingNode;if (!D) return;try{if (D.parentNode!=A.body||D.tagName.toLowerCase()!=B||(D.childNodes.length>1)||(D.firstChild&&D.firstChild.nodeValue!='\xa0'&&String(D.firstChild.tagName).toLowerCase()!='br')){this.PaddingNode=null;return;}}catch (e){this.PaddingNode=null;return;};if (!C){if (D.parentNode.childNodes.length>1) D.parentNode.removeChild(D);this.PaddingNode=null;}},HasAttribute:function(A,B){if (A.hasAttribute) return A.hasAttribute(B);else{var C=A.attributes[B];return (C!=undefined&&C.specified);}},HasAttributes:function(A){var B=A.attributes;for (var i=0;i0) return true;}else if (B[i].specified) return true;};return false;},RemoveAttribute:function(A,B){if (FCKBrowserInfo.IsIE&&B.toLowerCase()=='class') B='className';return A.removeAttribute(B,0);},RemoveAttributes:function (A,B){for (var i=0;i0) return false;C=C.nextSibling;};return D?this.CheckIsEmptyElement(D,B):true;},SetElementStyles:function(A,B){var C=A.style;for (var D in B) C[D]=B[D];},SetOpacity:function(A,B){if (FCKBrowserInfo.IsIE){B=Math.round(B*100);A.style.filter=(B>100?'':'progid:DXImageTransform.Microsoft.Alpha(opacity='+B+')');}else A.style.opacity=B;},GetCurrentElementStyle:function(A,B){if (FCKBrowserInfo.IsIE) return A.currentStyle[B];else return A.ownerDocument.defaultView.getComputedStyle(A,'').getPropertyValue(B);},GetPositionedAncestor:function(A){var B=A;while (B!=FCKTools.GetElementDocument(B).documentElement){if (this.GetCurrentElementStyle(B,'position')!='static') return B;if (B==FCKTools.GetElementDocument(B).documentElement&¤tWindow!=w) B=currentWindow.frameElement;else B=B.parentNode;};return null;},ScrollIntoView:function(A,B){var C=FCKTools.GetElementWindow(A);var D=FCKTools.GetViewPaneSize(C).Height;var E=D*-1;if (B===false){E+=A.offsetHeight||0;E+=parseInt(this.GetCurrentElementStyle(A,'marginBottom')||0,10)||0;};var F=FCKTools.GetDocumentPosition(C,A);E+=F.y;var G=FCKTools.GetScrollPosition(C).Y;if (E>0&&(E>G||E0) break;if (A.lastChild) A=A.lastChild;else return this.GetPreviousSourceElement(A,B,C,D);};return null;},GetNextSourceElement:function(A,B,C,D,E){while((A=this.GetNextSourceNode(A,E))){if (A.nodeType==1){if (C&&A.nodeName.IEquals(C)) break;if (D&&A.nodeName.IEquals(D)) return this.GetNextSourceElement(A,B,C,D);return A;}else if (B&&A.nodeType==3&&A.nodeValue.RTrim().length>0) break;};return null;},GetNextSourceNode:function(A,B,C,D){if (!A) return null;var E;if (!B&&A.firstChild) E=A.firstChild;else{if (D&&A==D) return null;E=A.nextSibling;if (!E&&(!D||D!=A.parentNode)) return this.GetNextSourceNode(A.parentNode,true,C,D);};if (C&&E&&E.nodeType!=C) return this.GetNextSourceNode(E,false,C,D);return E;},GetPreviousSourceNode:function(A,B,C,D){if (!A) return null;var E;if (!B&&A.lastChild) E=A.lastChild;else{if (D&&A==D) return null;E=A.previousSibling;if (!E&&(!D||D!=A.parentNode)) return this.GetPreviousSourceNode(A.parentNode,true,C,D);};if (C&&E&&E.nodeType!=C) return this.GetPreviousSourceNode(E,false,C,D);return E;},InsertAfterNode:function(A,B){return A.parentNode.insertBefore(B,A.nextSibling);},GetParents:function(A){var B=[];while (A){B.unshift(A);A=A.parentNode;};return B;},GetCommonParents:function(A,B){var C=this.GetParents(A);var D=this.GetParents(B);var E=[];for (var i=0;i0) D[C.pop().toLowerCase()]=1;var E=this.GetCommonParents(A,B);var F=null;while ((F=E.pop())){if (D[F.nodeName.toLowerCase()]) return F;};return null;},GetIndexOf:function(A){var B=A.parentNode?A.parentNode.firstChild:null;var C=-1;while (B){C++;if (B==A) return C;B=B.nextSibling;};return-1;},PaddingNode:null,EnforcePaddingNode:function(A,B){try{if (!A||!A.body) return;}catch (e){return;};this.CheckAndRemovePaddingNode(A,B,true);try{if (A.body.lastChild&&(A.body.lastChild.nodeType!=1||A.body.lastChild.tagName.toLowerCase()==B.toLowerCase())) return;}catch (e){return;};var C=A.createElement(B);if (FCKBrowserInfo.IsGecko&&FCKListsLib.NonEmptyBlockElements[B]) FCKTools.AppendBogusBr(C);this.PaddingNode=C;if (A.body.childNodes.length==1&&A.body.firstChild.nodeType==1&&A.body.firstChild.tagName.toLowerCase()=='br'&&(A.body.firstChild.getAttribute('_moz_dirty')!=null||A.body.firstChild.getAttribute('type')=='_moz')) A.body.replaceChild(C,A.body.firstChild);else A.body.appendChild(C);},CheckAndRemovePaddingNode:function(A,B,C){var D=this.PaddingNode;if (!D) return;try{if (D.parentNode!=A.body||D.tagName.toLowerCase()!=B||(D.childNodes.length>1)||(D.firstChild&&D.firstChild.nodeValue!='\xa0'&&String(D.firstChild.tagName).toLowerCase()!='br')){this.PaddingNode=null;return;}}catch (e){this.PaddingNode=null;return;};if (!C){if (D.parentNode.childNodes.length>1) D.parentNode.removeChild(D);this.PaddingNode=null;}},HasAttribute:function(A,B){if (A.hasAttribute) return A.hasAttribute(B);else{var C=A.attributes[B];return (C!=undefined&&C.specified);}},HasAttributes:function(A){var B=A.attributes;for (var i=0;i0) return true;continue;}};if (B[i].specified) return true;};return false;},RemoveAttribute:function(A,B){if (FCKBrowserInfo.IsIE&&B.toLowerCase()=='class') B='className';return A.removeAttribute(B,0);},RemoveAttributes:function (A,B){for (var i=0;i0) return false;C=C.nextSibling;};return D?this.CheckIsEmptyElement(D,B):true;},SetElementStyles:function(A,B){var C=A.style;for (var D in B) C[D]=B[D];},SetOpacity:function(A,B){if (FCKBrowserInfo.IsIE){B=Math.round(B*100);A.style.filter=(B>100?'':'progid:DXImageTransform.Microsoft.Alpha(opacity='+B+')');}else A.style.opacity=B;},GetCurrentElementStyle:function(A,B){if (FCKBrowserInfo.IsIE) return A.currentStyle[B];else return A.ownerDocument.defaultView.getComputedStyle(A,'').getPropertyValue(B);},GetPositionedAncestor:function(A){var B=A;while (B!=FCKTools.GetElementDocument(B).documentElement){if (this.GetCurrentElementStyle(B,'position')!='static') return B;if (B==FCKTools.GetElementDocument(B).documentElement&¤tWindow!=w) B=currentWindow.frameElement;else B=B.parentNode;};return null;},ScrollIntoView:function(A,B){var C=FCKTools.GetElementWindow(A);var D=FCKTools.GetViewPaneSize(C).Height;var E=D*-1;if (B===false){E+=A.offsetHeight||0;E+=parseInt(this.GetCurrentElementStyle(A,'marginBottom')||0,10)||0;};var F=FCKTools.GetDocumentPosition(C,A);E+=F.y;var G=FCKTools.GetScrollPosition(C).Y;if (E>0&&(E>G||E'+styleDef+'';};var C=function(cssFileUrl,markTemp){if (cssFileUrl.length==0) return '';var B=markTemp?' _fcktemp="true"':'';return '';};return function(cssFileOrArrayOrDef,markTemp){if (!cssFileOrArrayOrDef) return '';if (typeof(cssFileOrArrayOrDef)=='string'){if (/[\\\/\.][^{}]*$/.test(cssFileOrArrayOrDef)){return this.GetStyleHtml(cssFileOrArrayOrDef.split(','),markTemp);}else return A(this._GetUrlFixedCss(cssFileOrArrayOrDef),markTemp);}else{var E='';for (var i=0;i/g,'>');return A;};FCKTools.HTMLDecode=function(A){if (!A) return '';A=A.replace(/>/g,'>');A=A.replace(/</g,'<');A=A.replace(/&/g,'&');return A;};FCKTools._ProcessLineBreaksForPMode=function(A,B,C,D,E){var F=0;var G="

    ";var H="

    ";var I="
    ";if (C){G="
  • ";H="
  • ";F=1;}while (D&&D!=A.FCK.EditorDocument.body){if (D.tagName.toLowerCase()=='p'){F=1;break;};D=D.parentNode;};for (var i=0;i0) return A[A.length-1];return null;};FCKTools.GetDocumentPosition=function(w,A){var x=0;var y=0;var B=A;var C=null;var D=FCKTools.GetElementWindow(B);while (B&&!(D==w&&(B==w.document.body||B==w.document.documentElement))){x+=B.offsetLeft-B.scrollLeft;y+=B.offsetTop-B.scrollTop;if (!FCKBrowserInfo.IsOpera){var E=C;while (E&&E!=B){x-=E.scrollLeft;y-=E.scrollTop;E=E.parentNode;}};C=B;if (B.offsetParent) B=B.offsetParent;else{if (D!=w){B=D.frameElement;C=null;if (B) D=B.contentWindow.parent;}else B=null;}};if (FCKDomTools.GetCurrentElementStyle(w.document.body,'position')!='static'||(FCKBrowserInfo.IsIE&&FCKDomTools.GetPositionedAncestor(A)==null)){x+=w.document.body.offsetLeft;y+=w.document.body.offsetTop;};return { "x":x,"y":y };};FCKTools.GetWindowPosition=function(w,A){var B=this.GetDocumentPosition(w,A);var C=FCKTools.GetScrollPosition(w);B.x-=C.X;B.y-=C.Y;return B;};FCKTools.ProtectFormStyles=function(A){if (!A||A.nodeType!=1||A.tagName.toLowerCase()!='form') return [];var B=[];var C=['style','className'];for (var i=0;i0){for (var i=B.length-1;i>=0;i--){var C=B[i][0];var D=B[i][1];if (D) A.insertBefore(C,D);else A.appendChild(C);}}};FCKTools.GetNextNode=function(A,B){if (A.firstChild) return A.firstChild;else if (A.nextSibling) return A.nextSibling;else{var C=A.parentNode;while (C){if (C==B) return null;if (C.nextSibling) return C.nextSibling;else C=C.parentNode;}};return null;};FCKTools.GetNextTextNode=function(A,B,C){node=this.GetNextNode(A,B);if (C&&node&&C(node)) return null;while (node&&node.nodeType!=3){node=this.GetNextNode(node,B);if (C&&node&&C(node)) return null;};return node;};FCKTools.Merge=function(){var A=arguments;var o=A[0];for (var i=1;i');document.domain = '"+FCK_RUNTIME_DOMAIN+"';document.close();}() ) ;";if (FCKBrowserInfo.IsIE){if (FCKBrowserInfo.IsIE7||!FCKBrowserInfo.IsIE6) return "";else return "javascript: '';";};return "javascript: void(0);";};FCKTools.ResetStyles=function(A){A.style.cssText='margin:0;padding:0;border:0;background-color:transparent;background-image:none;';}; FCKTools.CancelEvent=function(e){return false;};FCKTools._AppendStyleSheet=function(A,B){return A.createStyleSheet(B).owningElement;};FCKTools.AppendStyleString=function(A,B){if (!B) return null;var s=A.createStyleSheet("");s.cssText=B;return s;};FCKTools.ClearElementAttributes=function(A){A.clearAttributes();};FCKTools.GetAllChildrenIds=function(A){var B=[];for (var i=0;i0) B[B.length]=C;};return B;};FCKTools.RemoveOuterTags=function(e){e.insertAdjacentHTML('beforeBegin',e.innerHTML);e.parentNode.removeChild(e);};FCKTools.CreateXmlObject=function(A){var B;switch (A){case 'XmlHttp':if (document.location.protocol!='file:') try { return new XMLHttpRequest();} catch (e) {};B=['MSXML2.XmlHttp','Microsoft.XmlHttp'];break;case 'DOMDocument':B=['MSXML2.DOMDocument','Microsoft.XmlDom'];break;};for (var i=0;i<2;i++){try { return new ActiveXObject(B[i]);}catch (e){}};if (FCKLang.NoActiveX){alert(FCKLang.NoActiveX);FCKLang.NoActiveX=null;};return null;};FCKTools.DisableSelection=function(A){A.unselectable='on';var e,i=0;while ((e=A.all[i++])){switch (e.tagName){case 'IFRAME':case 'TEXTAREA':case 'INPUT':case 'SELECT':break;default:e.unselectable='on';}}};FCKTools.GetScrollPosition=function(A){var B=A.document;var C={ X:B.documentElement.scrollLeft,Y:B.documentElement.scrollTop };if (C.X>0||C.Y>0) return C;return { X:B.body.scrollLeft,Y:B.body.scrollTop };};FCKTools.AddEventListener=function(A,B,C){A.attachEvent('on'+B,C);};FCKTools.RemoveEventListener=function(A,B,C){A.detachEvent('on'+B,C);};FCKTools.AddEventListenerEx=function(A,B,C,D){var o={};o.Source=A;o.Params=D||[];o.Listener=function(ev){return C.apply(o.Source,[ev].concat(o.Params));};if (FCK.IECleanup) FCK.IECleanup.AddItem(null,function() { o.Source=null;o.Params=null;});A.attachEvent('on'+B,o.Listener);A=null;D=null;};FCKTools.GetViewPaneSize=function(A){var B;var C=A.document.documentElement;if (C&&C.clientWidth) B=C;else B=A.document.body;if (B) return { Width:B.clientWidth,Height:B.clientHeight };else return { Width:0,Height:0 };};FCKTools.SaveStyles=function(A){var B=FCKTools.ProtectFormStyles(A);var C={};if (A.className.length>0){C.Class=A.className;A.className='';};var D=A.style.cssText;if (D.length>0){C.Inline=D;A.style.cssText='';};FCKTools.RestoreFormStyles(A,B);return C;};FCKTools.RestoreStyles=function(A,B){var C=FCKTools.ProtectFormStyles(A);A.className=B.Class||'';A.style.cssText=B.Inline||'';FCKTools.RestoreFormStyles(A,C);};FCKTools.RegisterDollarFunction=function(A){A.$=A.document.getElementById;};FCKTools.AppendElement=function(A,B){return A.appendChild(this.GetElementDocument(A).createElement(B));};FCKTools.ToLowerCase=function(A){return A.toLowerCase();}; var FCKeditorAPI;function InitializeAPI(){var A=window.parent;if (!(FCKeditorAPI=A.FCKeditorAPI)){var B='window.FCKeditorAPI = {Version : "2.6.4.1",VersionBuild : "23195",Instances : window.FCKeditorAPI && window.FCKeditorAPI.Instances || {},GetInstance : function( name ){return this.Instances[ name ];},_FormSubmit : function(){for ( var name in FCKeditorAPI.Instances ){var oEditor = FCKeditorAPI.Instances[ name ] ;if ( oEditor.GetParentForm && oEditor.GetParentForm() == this )oEditor.UpdateLinkedField() ;}this._FCKOriginalSubmit() ;},_FunctionQueue : window.FCKeditorAPI && window.FCKeditorAPI._FunctionQueue || {Functions : new Array(),IsRunning : false,Add : function( f ){this.Functions.push( f );if ( !this.IsRunning )this.StartNext();},StartNext : function(){var aQueue = this.Functions ;if ( aQueue.length > 0 ){this.IsRunning = true;aQueue[0].call();}else this.IsRunning = false;},Remove : function( f ){var aQueue = this.Functions;var i = 0, fFunc;while( (fFunc = aQueue[ i ]) ){if ( fFunc == f )aQueue.splice( i,1 );i++ ;}this.StartNext();}}}';if (A.execScript) A.execScript(B,'JavaScript');else{if (FCKBrowserInfo.IsGecko10){eval.call(A,B);}else if(FCKBrowserInfo.IsAIR){FCKAdobeAIR.FCKeditorAPI_Evaluate(A,B);}else if (FCKBrowserInfo.IsSafari){var C=A.document;var D=C.createElement('script');D.appendChild(C.createTextNode(B));C.documentElement.appendChild(D);}else A.eval(B);};FCKeditorAPI=A.FCKeditorAPI;FCKeditorAPI.__Instances=FCKeditorAPI.Instances;};FCKeditorAPI.Instances[FCK.Name]=FCK;};function _AttachFormSubmitToAPI(){var A=FCK.GetParentForm();if (A){FCKTools.AddEventListener(A,'submit',FCK.UpdateLinkedField);if (!A._FCKOriginalSubmit&&(typeof(A.submit)=='function'||(!A.submit.tagName&&!A.submit.length))){A._FCKOriginalSubmit=A.submit;A.submit=FCKeditorAPI._FormSubmit;}}};function FCKeditorAPI_Cleanup(){if (window.FCKConfig&&FCKConfig.MsWebBrowserControlCompat&&!window.FCKUnloadFlag) return;delete FCKeditorAPI.Instances[FCK.Name];};function FCKeditorAPI_ConfirmCleanup(){if (window.FCKConfig&&FCKConfig.MsWebBrowserControlCompat) window.FCKUnloadFlag=true;};FCKTools.AddEventListener(window,'unload',FCKeditorAPI_Cleanup);FCKTools.AddEventListener(window,'beforeunload',FCKeditorAPI_ConfirmCleanup); @@ -42,8 +42,8 @@ var FCKRegexLib={AposEntity:/'/gi,ObjectElements:/^(?:IMG|TABLE|TR|TD|TH|IN var FCKListsLib={BlockElements:{ address:1,blockquote:1,center:1,div:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,marquee:1,noscript:1,ol:1,p:1,pre:1,script:1,table:1,ul:1 },NonEmptyBlockElements:{ p:1,div:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,address:1,pre:1,ol:1,ul:1,li:1,td:1,th:1 },InlineChildReqElements:{ abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1 },InlineNonEmptyElements:{ a:1,abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1 },EmptyElements:{ base:1,col:1,meta:1,link:1,hr:1,br:1,param:1,img:1,area:1,input:1 },PathBlockElements:{ address:1,blockquote:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,li:1,dt:1,de:1 },PathBlockLimitElements:{ body:1,div:1,td:1,th:1,caption:1,form:1 },StyleBlockElements:{ address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1 },StyleObjectElements:{ img:1,hr:1,li:1,table:1,tr:1,td:1,embed:1,object:1,ol:1,ul:1 },NonEditableElements:{ button:1,option:1,script:1,iframe:1,textarea:1,object:1,embed:1,map:1,applet:1 },BlockBoundaries:{ p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,address:1,pre:1,ol:1,ul:1,li:1,dt:1,de:1,table:1,thead:1,tbody:1,tfoot:1,tr:1,th:1,td:1,caption:1,col:1,colgroup:1,blockquote:1,body:1 },ListBoundaries:{ p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,address:1,pre:1,ol:1,ul:1,li:1,dt:1,de:1,table:1,thead:1,tbody:1,tfoot:1,tr:1,th:1,td:1,caption:1,col:1,colgroup:1,blockquote:1,body:1,br:1 }}; var FCKLanguageManager=FCK.Language={AvailableLanguages:{af:'Afrikaans',ar:'Arabic',bg:'Bulgarian',bn:'Bengali/Bangla',bs:'Bosnian',ca:'Catalan',cs:'Czech',da:'Danish',de:'German',el:'Greek',en:'English','en-au':'English (Australia)','en-ca':'English (Canadian)','en-uk':'English (United Kingdom)',eo:'Esperanto',es:'Spanish',et:'Estonian',eu:'Basque',fa:'Persian',fi:'Finnish',fo:'Faroese',fr:'French','fr-ca':'French (Canada)',gl:'Galician',gu:'Gujarati',he:'Hebrew',hi:'Hindi',hr:'Croatian',hu:'Hungarian',is:'Icelandic',it:'Italian',ja:'Japanese',km:'Khmer',ko:'Korean',lt:'Lithuanian',lv:'Latvian',mn:'Mongolian',ms:'Malay',nb:'Norwegian Bokmal',nl:'Dutch',no:'Norwegian',pl:'Polish',pt:'Portuguese (Portugal)','pt-br':'Portuguese (Brazil)',ro:'Romanian',ru:'Russian',sk:'Slovak',sl:'Slovenian',sr:'Serbian (Cyrillic)','sr-latn':'Serbian (Latin)',sv:'Swedish',th:'Thai',tr:'Turkish',uk:'Ukrainian',vi:'Vietnamese',zh:'Chinese Traditional','zh-cn':'Chinese Simplified'},GetActiveLanguage:function(){if (FCKConfig.AutoDetectLanguage){var A;if (navigator.userLanguage) A=navigator.userLanguage.toLowerCase();else if (navigator.language) A=navigator.language.toLowerCase();else{return FCKConfig.DefaultLanguage;};if (A.length>=5){A=A.substr(0,5);if (this.AvailableLanguages[A]) return A;};if (A.length>=2){A=A.substr(0,2);if (this.AvailableLanguages[A]) return A;}};return this.DefaultLanguage;},TranslateElements:function(A,B,C,D){var e=A.getElementsByTagName(B);var E,s;for (var i=0;i':'gt','ˆ':'circ','˜':'tilde',' ':'ensp',' ':'emsp',' ':'thinsp','‌':'zwnj','‍':'zwj','‎':'lrm','‏':'rlm','–':'ndash','—':'mdash','‘':'lsquo','’':'rsquo','‚':'sbquo','“':'ldquo','”':'rdquo','„':'bdquo','†':'dagger','‡':'Dagger','‰':'permil','‹':'lsaquo','›':'rsaquo','€':'euro'};for (e in FCKXHtmlEntities.Entities) A+=e;if (FCKConfig.IncludeLatinEntities){B={'À':'Agrave','Á':'Aacute','Â':'Acirc','Ã':'Atilde','Ä':'Auml','Å':'Aring','Æ':'AElig','Ç':'Ccedil','È':'Egrave','É':'Eacute','Ê':'Ecirc','Ë':'Euml','Ì':'Igrave','Í':'Iacute','Î':'Icirc','Ï':'Iuml','Ð':'ETH','Ñ':'Ntilde','Ò':'Ograve','Ó':'Oacute','Ô':'Ocirc','Õ':'Otilde','Ö':'Ouml','Ø':'Oslash','Ù':'Ugrave','Ú':'Uacute','Û':'Ucirc','Ü':'Uuml','Ý':'Yacute','Þ':'THORN','ß':'szlig','à':'agrave','á':'aacute','â':'acirc','ã':'atilde','ä':'auml','å':'aring','æ':'aelig','ç':'ccedil','è':'egrave','é':'eacute','ê':'ecirc','ë':'euml','ì':'igrave','í':'iacute','î':'icirc','ï':'iuml','ð':'eth','ñ':'ntilde','ò':'ograve','ó':'oacute','ô':'ocirc','õ':'otilde','ö':'ouml','ø':'oslash','ù':'ugrave','ú':'uacute','û':'ucirc','ü':'uuml','ý':'yacute','þ':'thorn','ÿ':'yuml','Œ':'OElig','œ':'oelig','Š':'Scaron','š':'scaron','Ÿ':'Yuml'};for (e in B){FCKXHtmlEntities.Entities[e]=B[e];A+=e;};B=null;};if (FCKConfig.IncludeGreekEntities){B={'Α':'Alpha','Β':'Beta','Γ':'Gamma','Δ':'Delta','Ε':'Epsilon','Ζ':'Zeta','Η':'Eta','Θ':'Theta','Ι':'Iota','Κ':'Kappa','Λ':'Lambda','Μ':'Mu','Ν':'Nu','Ξ':'Xi','Ο':'Omicron','Π':'Pi','Ρ':'Rho','Σ':'Sigma','Τ':'Tau','Υ':'Upsilon','Φ':'Phi','Χ':'Chi','Ψ':'Psi','Ω':'Omega','α':'alpha','β':'beta','γ':'gamma','δ':'delta','ε':'epsilon','ζ':'zeta','η':'eta','θ':'theta','ι':'iota','κ':'kappa','λ':'lambda','μ':'mu','ν':'nu','ξ':'xi','ο':'omicron','π':'pi','ρ':'rho','ς':'sigmaf','σ':'sigma','τ':'tau','υ':'upsilon','φ':'phi','χ':'chi','ψ':'psi','ω':'omega','\u03d1':'thetasym','\u03d2':'upsih','\u03d6':'piv'};for (e in B){FCKXHtmlEntities.Entities[e]=B[e];A+=e;};B=null;}}else{FCKXHtmlEntities.Entities={'>':'gt'};A='>';A+=' ';};var C='['+A+']';if (FCKConfig.ProcessNumericEntities) C='[^ -~]|'+C;var D=FCKConfig.AdditionalNumericEntities;if (D&&D.length>0) C+='|'+FCKConfig.AdditionalNumericEntities;FCKXHtmlEntities.EntitiesRegex=new RegExp(C,'g');}; -var FCKXHtml={};FCKXHtml.CurrentJobNum=0;FCKXHtml.GetXHTML=function(A,B,C){FCKDomTools.CheckAndRemovePaddingNode(FCKTools.GetElementDocument(A),FCKConfig.EnterMode);FCKXHtmlEntities.Initialize();this._NbspEntity=(FCKConfig.ProcessHTMLEntities?'nbsp':'#160');var D=FCK.IsDirty();FCKXHtml.SpecialBlocks=[];this.XML=FCKTools.CreateXmlObject('DOMDocument');this.MainNode=this.XML.appendChild(this.XML.createElement('xhtml'));FCKXHtml.CurrentJobNum++;if (B) this._AppendNode(this.MainNode,A);else this._AppendChildNodes(this.MainNode,A,false);var E=this._GetMainXmlString();this.XML=null;if (FCKBrowserInfo.IsSafari) E=E.replace(/^/,'');E=E.substr(7,E.length-15).Trim();if (FCKConfig.DocType.length>0&&FCKRegexLib.HtmlDocType.test(FCKConfig.DocType)) E=E.replace(FCKRegexLib.SpaceNoClose,'>');else E=E.replace(FCKRegexLib.SpaceNoClose,' />');if (FCKConfig.ForceSimpleAmpersand) E=E.replace(FCKRegexLib.ForceSimpleAmpersand,'&');if (C) E=FCKCodeFormatter.Format(E);for (var i=0;i0;if (C) A.appendChild(this.XML.createTextNode(B.replace(FCKXHtmlEntities.EntitiesRegex,FCKXHtml_GetEntity)));return C;};function FCKXHtml_GetEntity(A){var B=FCKXHtmlEntities.Entities[A]||('#'+A.charCodeAt(0));return '#?-:'+B+';';};FCKXHtml.TagProcessors={a:function(A,B){if (B.innerHTML.Trim().length==0&&!B.name) return false;var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'href',C);if (FCKBrowserInfo.IsIE){if (B.name) FCKXHtml._AppendAttribute(A,'name',B.name);};A=FCKXHtml._AppendChildNodes(A,B,false);return A;},area:function(A,B){var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'href',C);if (FCKBrowserInfo.IsIE){if (!A.attributes.getNamedItem('coords')){var D=B.getAttribute('coords',2);if (D&&D!='0,0,0') FCKXHtml._AppendAttribute(A,'coords',D);};if (!A.attributes.getNamedItem('shape')){var E=B.getAttribute('shape',2);if (E&&E.length>0) FCKXHtml._AppendAttribute(A,'shape',E.toLowerCase());}};return A;},body:function(A,B){A=FCKXHtml._AppendChildNodes(A,B,false);A.removeAttribute('spellcheck');return A;},iframe:function(A,B){var C=B.innerHTML;if (FCKBrowserInfo.IsGecko) C=FCKTools.HTMLDecode(C);C=C.replace(/\s_fcksavedurl="[^"]*"/g,'');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(C)));return A;},img:function(A,B){if (!A.attributes.getNamedItem('alt')) FCKXHtml._AppendAttribute(A,'alt','');var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'src',C);if (B.style.width) A.removeAttribute('width');if (B.style.height) A.removeAttribute('height');return A;},li:function(A,B,C){if (C.nodeName.IEquals(['ul','ol'])) return FCKXHtml._AppendChildNodes(A,B,true);var D=FCKXHtml.XML.createElement('ul');B._fckxhtmljob=null;do{FCKXHtml._AppendNode(D,B);do{B=FCKDomTools.GetNextSibling(B);} while (B&&B.nodeType==3&&B.nodeValue.Trim().length==0)} while (B&&B.nodeName.toLowerCase()=='li') return D;},ol:function(A,B,C){if (B.innerHTML.Trim().length==0) return false;var D=C.lastChild;if (D&&D.nodeType==3) D=D.previousSibling;if (D&&D.nodeName.toUpperCase()=='LI'){B._fckxhtmljob=null;FCKXHtml._AppendNode(D,B);return false;};A=FCKXHtml._AppendChildNodes(A,B);return A;},pre:function (A,B){var C=B.firstChild;if (C&&C.nodeType==3) A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem('\r\n')));FCKXHtml._AppendChildNodes(A,B,true);return A;},script:function(A,B){if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text/javascript');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(B.text)));return A;},span:function(A,B){if (B.innerHTML.length==0) return false;A=FCKXHtml._AppendChildNodes(A,B,false);return A;},style:function(A,B){if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text/css');var C=B.innerHTML;if (FCKBrowserInfo.IsIE) C=C.replace(/^(\r\n|\n|\r)/,'');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(C)));return A;},title:function(A,B){A.appendChild(FCKXHtml.XML.createTextNode(FCK.EditorDocument.title));return A;}};FCKXHtml.TagProcessors.ul=FCKXHtml.TagProcessors.ol; -FCKXHtml._GetMainXmlString=function(){return this.MainNode.xml;};FCKXHtml._AppendAttributes=function(A,B,C,D){var E=B.attributes,bHasStyle;for (var n=0;n0){var I=FCKTools.ProtectFormStyles(B);var J=B.style.cssText.replace(FCKRegexLib.StyleProperties,FCKTools.ToLowerCase);FCKTools.RestoreFormStyles(B,I);this._AppendAttribute(C,'style',J);}};FCKXHtml.TagProcessors['div']=function(A,B){if (B.align.length>0) FCKXHtml._AppendAttribute(A,'align',B.align);A=FCKXHtml._AppendChildNodes(A,B,true);return A;};FCKXHtml.TagProcessors['font']=function(A,B){if (A.attributes.length==0) A=FCKXHtml.XML.createDocumentFragment();A=FCKXHtml._AppendChildNodes(A,B);return A;};FCKXHtml.TagProcessors['form']=function(A,B){if (B.acceptCharset&&B.acceptCharset.length>0&&B.acceptCharset!='UNKNOWN') FCKXHtml._AppendAttribute(A,'accept-charset',B.acceptCharset);var C=B.attributes['name'];if (C&&C.value.length>0) FCKXHtml._AppendAttribute(A,'name',C.value);A=FCKXHtml._AppendChildNodes(A,B,true);return A;};FCKXHtml.TagProcessors['input']=function(A,B){if (B.name) FCKXHtml._AppendAttribute(A,'name',B.name);if (B.value&&!A.attributes.getNamedItem('value')) FCKXHtml._AppendAttribute(A,'value',B.value);if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text');return A;};FCKXHtml.TagProcessors['label']=function(A,B){if (B.htmlFor.length>0) FCKXHtml._AppendAttribute(A,'for',B.htmlFor);A=FCKXHtml._AppendChildNodes(A,B);return A;};FCKXHtml.TagProcessors['map']=function(A,B){if (!A.attributes.getNamedItem('name')){var C=B.name;if (C) FCKXHtml._AppendAttribute(A,'name',C);};A=FCKXHtml._AppendChildNodes(A,B,true);return A;};FCKXHtml.TagProcessors['meta']=function(A,B){var C=A.attributes.getNamedItem('http-equiv');if (C==null||C.value.length==0){var D=B.outerHTML.match(FCKRegexLib.MetaHttpEquiv);if (D){D=D[1];FCKXHtml._AppendAttribute(A,'http-equiv',D);}};return A;};FCKXHtml.TagProcessors['option']=function(A,B){if (B.selected&&!A.attributes.getNamedItem('selected')) FCKXHtml._AppendAttribute(A,'selected','selected');A=FCKXHtml._AppendChildNodes(A,B);return A;};FCKXHtml.TagProcessors['textarea']=FCKXHtml.TagProcessors['select']=function(A,B){if (B.name) FCKXHtml._AppendAttribute(A,'name',B.name);A=FCKXHtml._AppendChildNodes(A,B);return A;}; +var FCKXHtml={};FCKXHtml.CurrentJobNum=0;FCKXHtml.GetXHTML=function(A,B,C){FCKDomTools.CheckAndRemovePaddingNode(FCKTools.GetElementDocument(A),FCKConfig.EnterMode);FCKXHtmlEntities.Initialize();this._NbspEntity=(FCKConfig.ProcessHTMLEntities?'nbsp':'#160');var D=FCK.IsDirty();FCKXHtml.SpecialBlocks=[];this.XML=FCKTools.CreateXmlObject('DOMDocument');this.MainNode=this.XML.appendChild(this.XML.createElement('xhtml'));FCKXHtml.CurrentJobNum++;if (B) this._AppendNode(this.MainNode,A);else this._AppendChildNodes(this.MainNode,A,false);if (FCKBrowserInfo.IsIE) FCKXHtml._RemoveXHtmlJobProperties(A);var E=this._GetMainXmlString();this.XML=null;if (FCKBrowserInfo.IsSafari) E=E.replace(/^/,'');E=E.substr(7,E.length-15).Trim();if (FCKConfig.DocType.length>0&&FCKRegexLib.HtmlDocType.test(FCKConfig.DocType)) E=E.replace(FCKRegexLib.SpaceNoClose,'>');else E=E.replace(FCKRegexLib.SpaceNoClose,' />');if (FCKConfig.ForceSimpleAmpersand) E=E.replace(FCKRegexLib.ForceSimpleAmpersand,'&');if (C) E=FCKCodeFormatter.Format(E);for (var i=0;i0;if (C) A.appendChild(this.XML.createTextNode(B.replace(FCKXHtmlEntities.EntitiesRegex,FCKXHtml_GetEntity)));return C;};function FCKXHtml_GetEntity(A){var B=FCKXHtmlEntities.Entities[A]||('#'+A.charCodeAt(0));return '#?-:'+B+';';};FCKXHtml.TagProcessors={a:function(A,B){if (B.innerHTML.Trim().length==0&&!B.name) return false;var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'href',C);if (FCKBrowserInfo.IsIE){if (B.name) FCKXHtml._AppendAttribute(A,'name',B.name);};A=FCKXHtml._AppendChildNodes(A,B,false);return A;},area:function(A,B){var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'href',C);if (FCKBrowserInfo.IsIE){if (!A.attributes.getNamedItem('coords')){var D=B.getAttribute('coords',2);if (D&&D!='0,0,0') FCKXHtml._AppendAttribute(A,'coords',D);};if (!A.attributes.getNamedItem('shape')){var E=B.getAttribute('shape',2);if (E&&E.length>0) FCKXHtml._AppendAttribute(A,'shape',E.toLowerCase());}};return A;},body:function(A,B){A=FCKXHtml._AppendChildNodes(A,B,false);A.removeAttribute('spellcheck');return A;},iframe:function(A,B){var C=B.innerHTML;if (FCKBrowserInfo.IsGecko) C=FCKTools.HTMLDecode(C);C=C.replace(/\s_fcksavedurl="[^"]*"/g,'');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(C)));return A;},img:function(A,B){if (!A.attributes.getNamedItem('alt')) FCKXHtml._AppendAttribute(A,'alt','');var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'src',C);if (B.style.width) A.removeAttribute('width');if (B.style.height) A.removeAttribute('height');return A;},li:function(A,B,C){if (C.nodeName.IEquals(['ul','ol'])) return FCKXHtml._AppendChildNodes(A,B,true);var D=FCKXHtml.XML.createElement('ul');B._fckxhtmljob=null;do{FCKXHtml._AppendNode(D,B);do{B=FCKDomTools.GetNextSibling(B);} while (B&&B.nodeType==3&&B.nodeValue.Trim().length==0)} while (B&&B.nodeName.toLowerCase()=='li') return D;},ol:function(A,B,C){if (B.innerHTML.Trim().length==0) return false;var D=C.lastChild;if (D&&D.nodeType==3) D=D.previousSibling;if (D&&D.nodeName.toUpperCase()=='LI'){B._fckxhtmljob=null;FCKXHtml._AppendNode(D,B);return false;};A=FCKXHtml._AppendChildNodes(A,B);return A;},pre:function (A,B){var C=B.firstChild;if (C&&C.nodeType==3) A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem('\r\n')));FCKXHtml._AppendChildNodes(A,B,true);return A;},script:function(A,B){if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text/javascript');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(B.text)));return A;},span:function(A,B){if (B.innerHTML.length==0) return false;A=FCKXHtml._AppendChildNodes(A,B,false);return A;},style:function(A,B){if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text/css');var C=B.innerHTML;if (FCKBrowserInfo.IsIE) C=C.replace(/^(\r\n|\n|\r)/,'');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(C)));return A;},title:function(A,B){A.appendChild(FCKXHtml.XML.createTextNode(FCK.EditorDocument.title));return A;}};FCKXHtml.TagProcessors.ul=FCKXHtml.TagProcessors.ol; +FCKXHtml._GetMainXmlString=function(){return this.MainNode.xml;};FCKXHtml._AppendAttributes=function(A,B,C,D){var E=B.attributes,bHasStyle;for (var n=0;n0){var I=FCKTools.ProtectFormStyles(B);var J=B.style.cssText.replace(FCKRegexLib.StyleProperties,FCKTools.ToLowerCase);FCKTools.RestoreFormStyles(B,I);this._AppendAttribute(C,'style',J);}};FCKXHtml._RemoveXHtmlJobProperties=function (A){if (!A||!A.nodeType||A.nodeType!=1) return;if (typeof A._fckxhtmljob!=='undefined') A.removeAttribute('_fckxhtmljob');if (A.hasChildNodes()){var B=A.childNodes;for (var i=B.length-1;i>=0;i--) FCKXHtml._RemoveXHtmlJobProperties(B.item(i));}};FCKXHtml.TagProcessors['div']=function(A,B){if (B.align.length>0) FCKXHtml._AppendAttribute(A,'align',B.align);A=FCKXHtml._AppendChildNodes(A,B,true);return A;};FCKXHtml.TagProcessors['font']=function(A,B){if (A.attributes.length==0) A=FCKXHtml.XML.createDocumentFragment();A=FCKXHtml._AppendChildNodes(A,B);return A;};FCKXHtml.TagProcessors['form']=function(A,B){if (B.acceptCharset&&B.acceptCharset.length>0&&B.acceptCharset!='UNKNOWN') FCKXHtml._AppendAttribute(A,'accept-charset',B.acceptCharset);var C=B.attributes['name'];if (C&&C.value.length>0) FCKXHtml._AppendAttribute(A,'name',C.value);A=FCKXHtml._AppendChildNodes(A,B,true);return A;};FCKXHtml.TagProcessors['input']=function(A,B){if (B.name) FCKXHtml._AppendAttribute(A,'name',B.name);if (B.value&&!A.attributes.getNamedItem('value')) FCKXHtml._AppendAttribute(A,'value',B.value);if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text');return A;};FCKXHtml.TagProcessors['label']=function(A,B){if (B.htmlFor.length>0) FCKXHtml._AppendAttribute(A,'for',B.htmlFor);A=FCKXHtml._AppendChildNodes(A,B);return A;};FCKXHtml.TagProcessors['map']=function(A,B){if (!A.attributes.getNamedItem('name')){var C=B.name;if (C) FCKXHtml._AppendAttribute(A,'name',C);};A=FCKXHtml._AppendChildNodes(A,B,true);return A;};FCKXHtml.TagProcessors['meta']=function(A,B){var C=A.attributes.getNamedItem('http-equiv');if (C==null||C.value.length==0){var D=B.outerHTML.match(FCKRegexLib.MetaHttpEquiv);if (D){D=D[1];FCKXHtml._AppendAttribute(A,'http-equiv',D);}};return A;};FCKXHtml.TagProcessors['option']=function(A,B){if (B.selected&&!A.attributes.getNamedItem('selected')) FCKXHtml._AppendAttribute(A,'selected','selected');A=FCKXHtml._AppendChildNodes(A,B);return A;};FCKXHtml.TagProcessors['textarea']=FCKXHtml.TagProcessors['select']=function(A,B){if (B.name) FCKXHtml._AppendAttribute(A,'name',B.name);A=FCKXHtml._AppendChildNodes(A,B);return A;}; var FCKCodeFormatter={};FCKCodeFormatter.Init=function(){var A=this.Regex={};A.BlocksOpener=/\<(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|DL|DT|DD|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION)[^\>]*\>/gi;A.BlocksCloser=/\<\/(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|DL|DT|DD|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION)[^\>]*\>/gi;A.NewLineTags=/\<(BR|HR)[^\>]*\>/gi;A.MainTags=/\<\/?(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR)[^\>]*\>/gi;A.LineSplitter=/\s*\n+\s*/g;A.IncreaseIndent=/^\<(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL|DL)[ \/\>]/i;A.DecreaseIndent=/^\<\/(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL|DL)[ \>]/i;A.FormatIndentatorRemove=new RegExp('^'+FCKConfig.FormatIndentator);A.ProtectedTags=/(]*>)([\s\S]*?)(<\/PRE>)/gi;};FCKCodeFormatter._ProtectData=function(A,B,C,D){return B+'___FCKpd___'+(FCKCodeFormatter.ProtectedData.push(C)-1)+D;};FCKCodeFormatter.Format=function(A){if (!this.Regex) this.Init();FCKCodeFormatter.ProtectedData=[];var B=A.replace(this.Regex.ProtectedTags,FCKCodeFormatter._ProtectData);B=B.replace(this.Regex.BlocksOpener,'\n$&');B=B.replace(this.Regex.BlocksCloser,'$&\n');B=B.replace(this.Regex.NewLineTags,'$&\n');B=B.replace(this.Regex.MainTags,'\n$&\n');var C='';var D=B.split(this.Regex.LineSplitter);B='';for (var i=0;iB[i]) return 1;};if (A.lengthB.length) return 1;return 0;};FCKUndo._CheckIsBookmarksEqual=function(A,B){if (!(A&&B)) return false;if (FCKBrowserInfo.IsIE){var C=A[1].search(A[0].StartId);var D=B[1].search(B[0].StartId);var E=A[1].search(A[0].EndId);var F=B[1].search(B[0].EndId);return C==D&&E==F;}else{return this._CompareCursors(A.Start,B.Start)==0&&this._CompareCursors(A.End,B.End)==0;}};FCKUndo.SaveUndoStep=function(){if (FCK.EditMode!=0||this.SaveLocked) return;if (this.SavedData.length) this.Changed=true;var A=FCK.EditorDocument.body.innerHTML;var B=this._GetBookmark();this.SavedData=this.SavedData.slice(0,this.CurrentIndex+1);if (this.CurrentIndex>0&&A==this.SavedData[this.CurrentIndex][0]&&this._CheckIsBookmarksEqual(B,this.SavedData[this.CurrentIndex][1])) return;else if (this.CurrentIndex==0&&this.SavedData.length&&A==this.SavedData[0][0]){this.SavedData[0][1]=B;return;};if (this.CurrentIndex+1>=FCKConfig.MaxUndoLevels) this.SavedData.shift();else this.CurrentIndex++;this.SavedData[this.CurrentIndex]=[A,B];FCK.Events.FireEvent("OnSelectionChange");};FCKUndo.CheckUndoState=function(){return (this.Changed||this.CurrentIndex>0);};FCKUndo.CheckRedoState=function(){return (this.CurrentIndex<(this.SavedData.length-1));};FCKUndo.Undo=function(){if (this.CheckUndoState()){if (this.CurrentIndex==(this.SavedData.length-1)){this.SaveUndoStep();};this._ApplyUndoLevel(--this.CurrentIndex);FCK.Events.FireEvent("OnSelectionChange");}};FCKUndo.Redo=function(){if (this.CheckRedoState()){this._ApplyUndoLevel(++this.CurrentIndex);FCK.Events.FireEvent("OnSelectionChange");}};FCKUndo._ApplyUndoLevel=function(A){var B=this.SavedData[A];if (!B) return;if (FCKBrowserInfo.IsIE){if (B[1]&&B[1][1]) FCK.SetInnerHtml(B[1][1]);else FCK.SetInnerHtml(B[0]);}else FCK.EditorDocument.body.innerHTML=B[0];this._SelectBookmark(B[1]);this.TypesCount=0;this.Changed=false;this.Typing=false;}; var FCKEditingArea=function(A){this.TargetElement=A;this.Mode=0;if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKEditingArea_Cleanup);};FCKEditingArea.prototype.Start=function(A,B){var C=this.TargetElement;var D=FCKTools.GetElementDocument(C);while(C.firstChild) C.removeChild(C.firstChild);if (this.Mode==0){if (FCK_IS_CUSTOM_DOMAIN) A=''+A;if (FCKBrowserInfo.IsIE) A=A.replace(/(]*?)\s*\/?>(?!\s*<\/base>)/gi,'$1>');else if (!B){var E=A.match(FCKRegexLib.BeforeBody);var F=A.match(FCKRegexLib.AfterBody);if (E&&F){var G=A.substr(E[1].length,A.length-E[1].length-F[1].length);A=E[1]+' '+F[1];if (FCKBrowserInfo.IsGecko&&(G.length==0||FCKRegexLib.EmptyParagraph.test(G))) G='
    ';this._BodyHTML=G;}else this._BodyHTML=A;};var H=this.IFrame=D.createElement('iframe');var I='';H.frameBorder=0;H.style.width=H.style.height='100%';if (FCK_IS_CUSTOM_DOMAIN&&FCKBrowserInfo.IsIE){window._FCKHtmlToLoad=A.replace(//i,''+I);H.src='javascript:void( (function(){document.open() ;document.domain="'+document.domain+'" ;document.write( window.parent._FCKHtmlToLoad );document.close() ;window.parent._FCKHtmlToLoad = null ;})() )';}else if (!FCKBrowserInfo.IsGecko){H.src='javascript:void(0)';};C.appendChild(H);this.Window=H.contentWindow;if (!FCK_IS_CUSTOM_DOMAIN||!FCKBrowserInfo.IsIE){var J=this.Window.document;J.open();J.write(A.replace(//i,''+I));J.close();};if (FCKBrowserInfo.IsAIR) FCKAdobeAIR.EditingArea_Start(J,A);if (FCKBrowserInfo.IsGecko10&&!B){this.Start(A,true);return;};if (H.readyState&&H.readyState!='completed'){var K=this;setTimeout(function(){try{K.Window.document.documentElement.doScroll("left");}catch(e){setTimeout(arguments.callee,0);return;};K.Window._FCKEditingArea=K;FCKEditingArea_CompleteStart.call(K.Window);},0);}else{this.Window._FCKEditingArea=this;if (FCKBrowserInfo.IsGecko10) this.Window.setTimeout(FCKEditingArea_CompleteStart,500);else FCKEditingArea_CompleteStart.call(this.Window);}}else{var L=this.Textarea=D.createElement('textarea');L.className='SourceField';L.dir='ltr';FCKDomTools.SetElementStyles(L,{width:'100%',height:'100%',border:'none',resize:'none',outline:'none'});C.appendChild(L);L.value=A;FCKTools.RunFunction(this.OnLoad);}};function FCKEditingArea_CompleteStart(){if (!this.document.body){this.setTimeout(FCKEditingArea_CompleteStart,50);return;};var A=this._FCKEditingArea;A.Document=A.Window.document;A.MakeEditable();FCKTools.RunFunction(A.OnLoad);};FCKEditingArea.prototype.MakeEditable=function(){var A=this.Document;if (FCKBrowserInfo.IsIE){A.body.disabled=true;A.body.contentEditable=true;A.body.removeAttribute("disabled");}else{try{A.body.spellcheck=(this.FFSpellChecker!==false);if (this._BodyHTML){A.body.innerHTML=this._BodyHTML;A.body.offsetLeft;this._BodyHTML=null;};A.designMode='on';A.execCommand('enableObjectResizing',false,!FCKConfig.DisableObjectResizing);A.execCommand('enableInlineTableEditing',false,!FCKConfig.DisableFFTableHandles);}catch (e){FCKTools.AddEventListener(this.Window.frameElement,'DOMAttrModified',FCKEditingArea_Document_AttributeNodeModified);}}};function FCKEditingArea_Document_AttributeNodeModified(A){var B=A.currentTarget.contentWindow._FCKEditingArea;if (B._timer) window.clearTimeout(B._timer);B._timer=FCKTools.SetTimeout(FCKEditingArea_MakeEditableByMutation,1000,B);};function FCKEditingArea_MakeEditableByMutation(){delete this._timer;FCKTools.RemoveEventListener(this.Window.frameElement,'DOMAttrModified',FCKEditingArea_Document_AttributeNodeModified);this.MakeEditable();};FCKEditingArea.prototype.Focus=function(){try{if (this.Mode==0){if (FCKBrowserInfo.IsIE) this._FocusIE();else this.Window.focus();}else{var A=FCKTools.GetElementDocument(this.Textarea);if ((!A.hasFocus||A.hasFocus())&&A.activeElement==this.Textarea) return;this.Textarea.focus();}}catch(e) {}};FCKEditingArea.prototype._FocusIE=function(){this.Document.body.setActive();this.Window.focus();var A=this.Document.selection.createRange();var B=A.parentElement();var C=B.nodeName.toLowerCase();if (B.childNodes.length>0||!(FCKListsLib.BlockElements[C]||FCKListsLib.NonEmptyBlockElements[C])){return;};A=new FCKDomRange(this.Window);A.MoveToElementEditStart(B);A.Select();};function FCKEditingArea_Cleanup(){if (this.Document) this.Document.body.innerHTML="";this.TargetElement=null;this.IFrame=null;this.Document=null;this.Textarea=null;if (this.Window){this.Window._FCKEditingArea=null;this.Window=null;}}; From 8b4fcfa78cd0dc12ce6e3ab002b2315990d600e8 Mon Sep 17 00:00:00 2001 From: Ivan Tcholakov Date: Tue, 28 Jul 2009 22:31:38 +0200 Subject: [PATCH 12/56] [svn r22424] FS#2867 - The online editor: Implementing 2.6.5 SVN patch, ticket #2689 - http://dev.fckeditor.net/ticket/2689 . --- documentation/changelog.html | 2 +- .../filemanager/browser/default/frmresourceslist.html | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/documentation/changelog.html b/documentation/changelog.html index 979040868e..3d4cedf715 100644 --- a/documentation/changelog.html +++ b/documentation/changelog.html @@ -34,7 +34,7 @@
  • The installation sript: The page about system requilements has been updated. Also, at the very beginning, a check has been added whether the mbstring php-extension is installed - see the related forum topic. (FS#306)
  • A new php-based configuration for the online editor has been implemented, see dokeos/main/inc/lib/fckeditor/myconfig.php. Also, toolbar definitions have been split in separate php-files within the directory dokeos/main/inc/lib/fckeditor/toolbars/ . Customization of the editor is more convenient and flexible now. (FS#2867)
  • Online editor: A upgrade from FCKEditor 2.6.4 to FCKEditor 2.6.4.1 has been implemented. (FS#4383)
  • -
  • Online editor: Several known bug-fixes from FCKEditor 2.6.5 SVN have been implemented, tickets #1537, #2156, #2821, #2856, #2915, #3120, #3181, #3429, #3439, #3880. (FS#2867)
  • +
  • Online editor: Several known bug-fixes from FCKEditor 2.6.5 SVN have been implemented, tickets #1537, #2156, #2689, #2821, #2856, #2915, #3120, #3181, #3429, #3439, #3880. (FS#2867)
  • Online editor: The simple file manager, the advanced file manager and the image manager have been integrated by default with the editor's dialog system. Thus, they work faster and in a more secure way. (FS#2867)
  • Online editor: Blocking copy/paste for trainees has been added. The feature is configurable through editing the toolbar definition files within the directory dokeos/main/inc/lib/fckeditor/toolbars/ . (FS#2867)
  • Online editor: Preview tabs have been added to the dialogs for inserting video, flv-video, and YouTube video. (FS#2867)
  • diff --git a/main/inc/lib/fckeditor/editor/filemanager/browser/default/frmresourceslist.html b/main/inc/lib/fckeditor/editor/filemanager/browser/default/frmresourceslist.html index c8977e0cde..233a3a4bd7 100644 --- a/main/inc/lib/fckeditor/editor/filemanager/browser/default/frmresourceslist.html +++ b/main/inc/lib/fckeditor/editor/filemanager/browser/default/frmresourceslist.html @@ -94,14 +94,14 @@ function OpenFile( fileUrl ) if ( window.parent.opener ) { // The file manager has been opened in a new window. - window.parent.opener.SetUrl( encodeURI( fileUrl ).replace( /#/g, '%23' ) ) ; + window.parent.opener.SetUrl( fileUrl ) ; window.parent.close() ; window.parent.opener.focus() ; } else if ( window.parent.parent && typeof (window.parent.parent.ParentDialog) == 'function' ) { // The file manager is inside a dialog. - window.parent.parent.ParentDialog().contentWindow.frames['frmMain'].SetUrl( encodeURI( fileUrl ).replace( /#/g, '%23' ) ) ; + window.parent.parent.ParentDialog().contentWindow.frames['frmMain'].SetUrl( fileUrl ) ; window.parent.parent.CloseDialog() ; } return true ; @@ -163,7 +163,7 @@ function GetFoldersAndFilesCallBack( fckXml ) // Get the optional "url" attribute. If not available, build the url. var oFileUrlAtt = oNodes[j].attributes.getNamedItem('url') ; - var sFileUrl = oFileUrlAtt != null ? oFileUrlAtt.value : sCurrentFolderUrl + sFileName ; + var sFileUrl = oFileUrlAtt != null ? oFileUrlAtt.value : encodeURI( sCurrentFolderUrl + sFileName ).replace( /#/g, '%23' ) ; oHtml.Append( oListManager.GetFileRowHtml( sFileName, sFileUrl, sFileSize ) ) ; } From c53c441a8242faf931a4a84043536c14b3bcec24 Mon Sep 17 00:00:00 2001 From: Ivan Tcholakov Date: Tue, 28 Jul 2009 22:53:24 +0200 Subject: [PATCH 13/56] [svn r22425] FS#2867 - The online editor: Implementing 2.6.5 SVN patch, ticket #2874 - http://dev.fckeditor.net/ticket/2874 . Making some files to be binary equal to the original source. --- documentation/changelog.html | 2 +- .../fckeditor/editor/dialog/fck_table.html | 44 +++++++++---------- .../filemanager/connectors/php/basexml.php | 6 +-- .../filemanager/connectors/php/upload.php | 2 +- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/documentation/changelog.html b/documentation/changelog.html index 3d4cedf715..ef42846e8b 100644 --- a/documentation/changelog.html +++ b/documentation/changelog.html @@ -34,7 +34,7 @@
  • The installation sript: The page about system requilements has been updated. Also, at the very beginning, a check has been added whether the mbstring php-extension is installed - see the related forum topic. (FS#306)
  • A new php-based configuration for the online editor has been implemented, see dokeos/main/inc/lib/fckeditor/myconfig.php. Also, toolbar definitions have been split in separate php-files within the directory dokeos/main/inc/lib/fckeditor/toolbars/ . Customization of the editor is more convenient and flexible now. (FS#2867)
  • Online editor: A upgrade from FCKEditor 2.6.4 to FCKEditor 2.6.4.1 has been implemented. (FS#4383)
  • -
  • Online editor: Several known bug-fixes from FCKEditor 2.6.5 SVN have been implemented, tickets #1537, #2156, #2689, #2821, #2856, #2915, #3120, #3181, #3429, #3439, #3880. (FS#2867)
  • +
  • Online editor: Several known bug-fixes from FCKEditor 2.6.5 SVN have been implemented, tickets #1537, #2156, #2689, #2821, #2856, #2874, #2915, #3120, #3181, #3429, #3439, #3880. (FS#2867)
  • Online editor: The simple file manager, the advanced file manager and the image manager have been integrated by default with the editor's dialog system. Thus, they work faster and in a more secure way. (FS#2867)
  • Online editor: Blocking copy/paste for trainees has been added. The feature is configurable through editing the toolbar definition files within the directory dokeos/main/inc/lib/fckeditor/toolbars/ . (FS#2867)
  • Online editor: Preview tabs have been added to the dialogs for inserting video, flv-video, and YouTube video. (FS#2867)
  • diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_table.html b/main/inc/lib/fckeditor/editor/dialog/fck_table.html index 053d0423b0..2711e69562 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_table.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_table.html @@ -155,28 +155,6 @@ function Ok() SetAttribute( table, 'cellSpacing' , GetE('txtCellSpacing').value ) ; SetAttribute( table, 'summary' , GetE('txtSummary').value ) ; - var eCaption = oEditor.FCKDomTools.GetFirstChild( table, 'CAPTION' ) ; - - if ( document.getElementById('txtCaption').value != '') - { - if ( !eCaption ) - { - eCaption = oDoc.createElement( 'CAPTION' ) ; - table.insertBefore( eCaption, table.firstChild ) ; - } - - eCaption.innerHTML = document.getElementById('txtCaption').value ; - } - else if ( bExists && eCaption ) - { - // TODO: It causes an IE internal error if using removeChild or - // table.deleteCaption() (see #505). - if ( oEditor.FCKBrowserInfo.IsIE ) - eCaption.innerHTML = '' ; - else - eCaption.parentNode.removeChild( eCaption ) ; - } - var headers = GetE('selHeaders').value ; if ( bExists ) { @@ -307,6 +285,28 @@ function Ok() oEditor.FCK.InsertElement( table ) ; } + var eCaption = oEditor.FCKDomTools.GetFirstChild( table, 'CAPTION' ) ; + + if ( document.getElementById('txtCaption').value != '' ) + { + if ( !eCaption ) + { + eCaption = oDoc.createElement( 'CAPTION' ) ; + table.insertBefore( eCaption, table.firstChild ) ; + } + + eCaption.innerHTML = document.getElementById('txtCaption').value ; + } + else if ( bExists && eCaption ) + { + // TODO: It causes an IE internal error if using removeChild or + // table.deleteCaption() (see #505). + if ( oEditor.FCKBrowserInfo.IsIE ) + eCaption.innerHTML = '' ; + else + eCaption.parentNode.removeChild( eCaption ) ; + } + return true ; } diff --git a/main/inc/lib/fckeditor/editor/filemanager/connectors/php/basexml.php b/main/inc/lib/fckeditor/editor/filemanager/connectors/php/basexml.php index 268d388a4b..e8ae37bad7 100644 --- a/main/inc/lib/fckeditor/editor/filemanager/connectors/php/basexml.php +++ b/main/inc/lib/fckeditor/editor/filemanager/connectors/php/basexml.php @@ -65,8 +65,8 @@ function CreateXmlFooter() function SendError( $number, $text ) { - if ( $_GET['Command'] == 'FileUpload' ) - SendUploadResults( $number, "", "", $text ) ; + if ( $_GET['Command'] == 'FileUpload' ) + SendUploadResults( $number, "", "", $text ) ; if ( isset( $GLOBALS['HeaderSent'] ) && $GLOBALS['HeaderSent'] ) { @@ -94,6 +94,6 @@ function SendErrorNode( $number, $text ) if ($text) echo '' ; else - echo '' ; + echo '' ; } ?> diff --git a/main/inc/lib/fckeditor/editor/filemanager/connectors/php/upload.php b/main/inc/lib/fckeditor/editor/filemanager/connectors/php/upload.php index 7e330b3c39..8a4343d4bf 100755 --- a/main/inc/lib/fckeditor/editor/filemanager/connectors/php/upload.php +++ b/main/inc/lib/fckeditor/editor/filemanager/connectors/php/upload.php @@ -1,4 +1,4 @@ - Date: Tue, 28 Jul 2009 23:10:05 +0200 Subject: [PATCH 14/56] [svn r22426] FS#2867 - The online editor: Implementing 2.6.5 SVN patch, ticket #3446 - http://dev.fckeditor.net/ticket/3446 . --- documentation/changelog.html | 2 +- main/inc/lib/fckeditor/editor/dialog/fck_tablecell.html | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/documentation/changelog.html b/documentation/changelog.html index ef42846e8b..63a882aac8 100644 --- a/documentation/changelog.html +++ b/documentation/changelog.html @@ -34,7 +34,7 @@
  • The installation sript: The page about system requilements has been updated. Also, at the very beginning, a check has been added whether the mbstring php-extension is installed - see the related forum topic. (FS#306)
  • A new php-based configuration for the online editor has been implemented, see dokeos/main/inc/lib/fckeditor/myconfig.php. Also, toolbar definitions have been split in separate php-files within the directory dokeos/main/inc/lib/fckeditor/toolbars/ . Customization of the editor is more convenient and flexible now. (FS#2867)
  • Online editor: A upgrade from FCKEditor 2.6.4 to FCKEditor 2.6.4.1 has been implemented. (FS#4383)
  • -
  • Online editor: Several known bug-fixes from FCKEditor 2.6.5 SVN have been implemented, tickets #1537, #2156, #2689, #2821, #2856, #2874, #2915, #3120, #3181, #3429, #3439, #3880. (FS#2867)
  • +
  • Online editor: Several known bug-fixes from FCKEditor 2.6.5 SVN have been implemented, tickets #1537, #2156, #2689, #2821, #2856, #2874, #2915, #3120, #3181, #3429, #3439, #3446, #3880. (FS#2867)
  • Online editor: The simple file manager, the advanced file manager and the image manager have been integrated by default with the editor's dialog system. Thus, they work faster and in a more secure way. (FS#2867)
  • Online editor: Blocking copy/paste for trainees has been added. The feature is configurable through editing the toolbar definition files within the directory dokeos/main/inc/lib/fckeditor/toolbars/ . (FS#2867)
  • Online editor: Preview tabs have been added to the dialogs for inserting video, flv-video, and YouTube video. (FS#2867)
  • diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_tablecell.html b/main/inc/lib/fckeditor/editor/dialog/fck_tablecell.html index ce882d3b9b..a7bc921530 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_tablecell.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_tablecell.html @@ -139,7 +139,7 @@ function SelectBorderColor( color ) function SelectColor( wich ) { - oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', oEditor.FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 410, 320, wich == 'Back' ? SelectBackColor : SelectBorderColor, window ) ; + oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', oEditor.FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 410, 320, wich == 'Back' ? SelectBackColor : SelectBorderColor ) ; } @@ -224,8 +224,8 @@ function SelectColor( wich ) Cell Type:   From 0eb0aa1b506489b3aee15a13d1d5ce42a996f0f5 Mon Sep 17 00:00:00 2001 From: Ivan Tcholakov Date: Tue, 28 Jul 2009 23:54:13 +0200 Subject: [PATCH 15/56] [svn r22427] FS#2867 - The online editor: Implementing 2.6.5 SVN patch, ticket #3481 - http://dev.fckeditor.net/ticket/3481 . --- documentation/changelog.html | 2 +- .../fckeditor/editor/_source/internals/fck.js | 32 +++++++++++++++++++ .../editor/js/fckeditorcode_gecko.js | 2 +- .../fckeditor/editor/js/fckeditorcode_ie.js | 2 +- 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/documentation/changelog.html b/documentation/changelog.html index 63a882aac8..8fb46a4bc5 100644 --- a/documentation/changelog.html +++ b/documentation/changelog.html @@ -34,7 +34,7 @@
  • The installation sript: The page about system requilements has been updated. Also, at the very beginning, a check has been added whether the mbstring php-extension is installed - see the related forum topic. (FS#306)
  • A new php-based configuration for the online editor has been implemented, see dokeos/main/inc/lib/fckeditor/myconfig.php. Also, toolbar definitions have been split in separate php-files within the directory dokeos/main/inc/lib/fckeditor/toolbars/ . Customization of the editor is more convenient and flexible now. (FS#2867)
  • Online editor: A upgrade from FCKEditor 2.6.4 to FCKEditor 2.6.4.1 has been implemented. (FS#4383)
  • -
  • Online editor: Several known bug-fixes from FCKEditor 2.6.5 SVN have been implemented, tickets #1537, #2156, #2689, #2821, #2856, #2874, #2915, #3120, #3181, #3429, #3439, #3446, #3880. (FS#2867)
  • +
  • Online editor: Several known bug-fixes from FCKEditor 2.6.5 SVN have been implemented, tickets #1537, #2156, #2689, #2821, #2856, #2874, #2915, #3120, #3181, #3429, #3439, #3446, #3481, #3880. (FS#2867)
  • Online editor: The simple file manager, the advanced file manager and the image manager have been integrated by default with the editor's dialog system. Thus, they work faster and in a more secure way. (FS#2867)
  • Online editor: Blocking copy/paste for trainees has been added. The feature is configurable through editing the toolbar definition files within the directory dokeos/main/inc/lib/fckeditor/toolbars/ . (FS#2867)
  • Online editor: Preview tabs have been added to the dialogs for inserting video, flv-video, and YouTube video. (FS#2867)
  • diff --git a/main/inc/lib/fckeditor/editor/_source/internals/fck.js b/main/inc/lib/fckeditor/editor/_source/internals/fck.js index e5fd3ab16a..9f115273a3 100644 --- a/main/inc/lib/fckeditor/editor/_source/internals/fck.js +++ b/main/inc/lib/fckeditor/editor/_source/internals/fck.js @@ -955,6 +955,38 @@ function _FCK_EditingArea_OnLoad() FCKTools.AddEventListener( FCK.EditorDocument, 'mousemove', _FCK_MouseEventsListener ) ; FCKTools.AddEventListener( FCK.EditorDocument, 'mousedown', _FCK_MouseEventsListener ) ; FCKTools.AddEventListener( FCK.EditorDocument, 'mouseup', _FCK_MouseEventsListener ) ; + if ( FCKBrowserInfo.IsSafari ) + { + // #3481: WebKit has a bug with paste where the paste contents may leak + // outside table cells. So add padding nodes before and after the paste. + FCKTools.AddEventListener( FCK.EditorDocument, 'paste', function( evt ) + { + var range = new FCKDomRange( FCK.EditorWindow ); + var nodeBefore = FCK.EditorDocument.createTextNode( '\ufeff' ); + var nodeAfter = FCK.EditorDocument.createElement( 'a' ); + nodeAfter.id = 'fck_paste_padding'; + nodeAfter.innerHTML = ''; + range.MoveToSelection(); + range.DeleteContents(); + + // Insert padding nodes. + range.InsertNode( nodeBefore ); + range.Collapse(); + range.InsertNode( nodeAfter ); + + // Move the selection to between the padding nodes. + range.MoveToPosition( nodeAfter, 3 ); + range.Select(); + + // Remove the padding nodes after the paste is done. + setTimeout( function() + { + nodeBefore.parentNode.removeChild( nodeBefore ); + nodeAfter = FCK.EditorDocument.getElementById( 'fck_paste_padding' ); + nodeAfter.parentNode.removeChild( nodeAfter ); + }, 0 ); + } ); + } // Most of the CTRL key combos do not work under Safari for onkeydown and onkeypress (See #1119) // But we can use the keyup event to override some of these... diff --git a/main/inc/lib/fckeditor/editor/js/fckeditorcode_gecko.js b/main/inc/lib/fckeditor/editor/js/fckeditorcode_gecko.js index d43e355d88..c3469245d0 100644 --- a/main/inc/lib/fckeditor/editor/js/fckeditorcode_gecko.js +++ b/main/inc/lib/fckeditor/editor/js/fckeditorcode_gecko.js @@ -28,7 +28,7 @@ var s=navigator.userAgent.toLowerCase();var FCKBrowserInfo={IsIE:/*@cc_on!@*/fal var FCKURLParams={};(function(){var A=document.location.search.substr(1).split('&');for (var i=0;i';if (!FCKRegexLib.HtmlOpener.test(A)) A=''+A+'';if (!FCKRegexLib.HeadOpener.test(A)) A=A.replace(FCKRegexLib.HtmlOpener,'$&');return A;}else{var B=FCKConfig.DocType+'0&&!FCKRegexLib.Html4DocType.test(FCKConfig.DocType)) B+=' style="overflow-y: scroll"';B+='>'+A+'';return B;}},ConvertToDataFormat:function(A,B,C,D){var E=FCKXHtml.GetXHTML(A,!B,D);if (C&&FCKRegexLib.EmptyOutParagraph.test(E)) return '';return E;},FixHtml:function(A){return A;}}; -var FCK={Name:FCKURLParams['InstanceName'],Status:0,EditMode:0,Toolbar:null,HasFocus:false,DataProcessor:new FCKDataProcessor(),GetInstanceObject:(function(){var w=window;return function(name){return w[name];}})(),AttachToOnSelectionChange:function(A){this.Events.AttachEvent('OnSelectionChange',A);},GetLinkedFieldValue:function(){return this.LinkedField.value;},GetParentForm:function(){return this.LinkedField.form;},StartupValue:'',IsDirty:function(){if (this.EditMode==1) return (this.StartupValue!=this.EditingArea.Textarea.value);else{if (!this.EditorDocument) return false;return (this.StartupValue!=this.EditorDocument.body.innerHTML);}},ResetIsDirty:function(){if (this.EditMode==1) this.StartupValue=this.EditingArea.Textarea.value;else if (this.EditorDocument.body) this.StartupValue=this.EditorDocument.body.innerHTML;},StartEditor:function(){this.TempBaseTag=FCKConfig.BaseHref.length>0?'':'';var A=FCK.KeystrokeHandler=new FCKKeystrokeHandler();A.OnKeystroke=_FCK_KeystrokeHandler_OnKeystroke;A.SetKeystrokes(FCKConfig.Keystrokes);if (FCKBrowserInfo.IsIE7){if ((CTRL+86) in A.Keystrokes) A.SetKeystrokes([CTRL+86,true]);if ((SHIFT+45) in A.Keystrokes) A.SetKeystrokes([SHIFT+45,true]);};A.SetKeystrokes([CTRL+8,true]);this.EditingArea=new FCKEditingArea(document.getElementById('xEditingArea'));this.EditingArea.FFSpellChecker=FCKConfig.FirefoxSpellChecker;this.SetData(this.GetLinkedFieldValue(),true);FCKTools.AddEventListener(document,"keydown",this._TabKeyHandler);this.AttachToOnSelectionChange(_FCK_PaddingNodeListener);if (FCKBrowserInfo.IsGecko) this.AttachToOnSelectionChange(this._ExecCheckEmptyBlock);},Focus:function(){FCK.EditingArea.Focus();},SetStatus:function(A){this.Status=A;if (A==1){FCKFocusManager.AddWindow(window,true);if (FCKBrowserInfo.IsIE) FCKFocusManager.AddWindow(window.frameElement,true);if (FCKConfig.StartupFocus) FCK.Focus();};this.Events.FireEvent('OnStatusChange',A);},FixBody:function(){var A=FCKConfig.EnterMode;if (A!='p'&&A!='div') return;var B=this.EditorDocument;if (!B) return;var C=B.body;if (!C) return;FCKDomTools.TrimNode(C);var D=C.firstChild;var E;while (D){var F=false;switch (D.nodeType){case 1:var G=D.nodeName.toLowerCase();if (!FCKListsLib.BlockElements[G]&&G!='li'&&!D.getAttribute('_fckfakelement')&&D.getAttribute('_moz_dirty')==null) F=true;break;case 3:if (E||D.nodeValue.Trim().length>0) F=true;break;case 8:if (E) F=true;break;};if (F){var H=D.parentNode;if (!E) E=H.insertBefore(B.createElement(A),D);E.appendChild(H.removeChild(D));D=E.nextSibling;}else{if (E){FCKDomTools.TrimNode(E);E=null;};D=D.nextSibling;}};if (E) FCKDomTools.TrimNode(E);},GetData:function(A){if (FCK.EditMode==1) return FCK.EditingArea.Textarea.value;this.FixBody();var B=FCK.EditorDocument;if (!B) return null;var C=FCKConfig.FullPage;var D=FCK.DataProcessor.ConvertToDataFormat(C?B.documentElement:B.body,!C,FCKConfig.IgnoreEmptyParagraphValue,A);D=FCK.ProtectEventsRestore(D);if (FCKBrowserInfo.IsIE) D=D.replace(FCKRegexLib.ToReplace,'$1');if (C){if (FCK.DocTypeDeclaration&&FCK.DocTypeDeclaration.length>0) D=FCK.DocTypeDeclaration+'\n'+D;if (FCK.XmlDeclaration&&FCK.XmlDeclaration.length>0) D=FCK.XmlDeclaration+'\n'+D;};return FCKConfig.ProtectedSource.Revert(D);},UpdateLinkedField:function(){var A=FCK.GetXHTML(FCKConfig.FormatOutput);if (FCKConfig.HtmlEncodeOutput) A=FCKTools.HTMLEncode(A);FCK.LinkedField.value=A;FCK.Events.FireEvent('OnAfterLinkedFieldUpdate');},RegisteredDoubleClickHandlers:{},OnDoubleClick:function(A){var B=FCK.RegisteredDoubleClickHandlers[A.tagName.toUpperCase()];if (B){for (var i=0;i0?'|ABBR|XML|EMBED|OBJECT':'ABBR|XML|EMBED|OBJECT';var C;if (B.length>0){C=new RegExp('<('+B+')(?!\w|:)','gi');A=A.replace(C,'','gi');A=A.replace(C,'<\/FCK:$1>');};B='META';if (FCKBrowserInfo.IsIE) B+='|HR';C=new RegExp('<(('+B+')(?=\\s|>|/)[\\s\\S]*?)/?>','gi');A=A.replace(C,'');return A;},SetData:function(A,B){this.EditingArea.Mode=FCK.EditMode;if (FCKBrowserInfo.IsIE&&FCK.EditorDocument){FCK.EditorDocument.detachEvent("onselectionchange",Doc_OnSelectionChange);};FCKTempBin.Reset();FCK.Selection.Release();if (FCK.EditMode==0){this._ForceResetIsDirty=(B===true);A=FCKConfig.ProtectedSource.Protect(A);A=FCK.DataProcessor.ConvertToHtml(A);A=A.replace(FCKRegexLib.InvalidSelfCloseTags,'$1>');A=FCK.ProtectEvents(A);A=FCK.ProtectUrls(A);A=FCK.ProtectTags(A);if (FCK.TempBaseTag.length>0&&!FCKRegexLib.HasBaseTag.test(A)) A=A.replace(FCKRegexLib.HeadOpener,'$&'+FCK.TempBaseTag);var C='';if (!FCKConfig.FullPage) C+=_FCK_GetEditorAreaStyleTags();if (FCKBrowserInfo.IsIE) C+=FCK._GetBehaviorsStyle();else if (FCKConfig.ShowBorders) C+=FCKTools.GetStyleHtml(FCK_ShowTableBordersCSS,true);C+=FCKTools.GetStyleHtml(FCK_InternalCSS,true);A=A.replace(FCKRegexLib.HeadCloser,C+'$&');this.EditingArea.OnLoad=_FCK_EditingArea_OnLoad;this.EditingArea.Start(A);}else{FCK.EditorWindow=null;FCK.EditorDocument=null;FCKDomTools.PaddingNode=null;this.EditingArea.OnLoad=null;this.EditingArea.Start(A);this.EditingArea.Textarea._FCKShowContextMenu=true;FCK.EnterKeyHandler=null;if (B) this.ResetIsDirty();FCK.KeystrokeHandler.AttachToElement(this.EditingArea.Textarea);this.EditingArea.Textarea.focus();FCK.Events.FireEvent('OnAfterSetHTML');};if (FCKBrowserInfo.IsGecko) window.onresize();},RedirectNamedCommands:{},ExecuteNamedCommand:function(A,B,C,D){if (!D) FCKUndo.SaveUndoStep();if (!C&&FCK.RedirectNamedCommands[A]!=null) FCK.ExecuteRedirectedNamedCommand(A,B);else{FCK.Focus();FCK.EditorDocument.execCommand(A,false,B);FCK.Events.FireEvent('OnSelectionChange');};if (!D) FCKUndo.SaveUndoStep();},GetNamedCommandState:function(A){try{if (FCKBrowserInfo.IsSafari&&FCK.EditorWindow&&A.IEquals('Paste')) return 0;if (!FCK.EditorDocument.queryCommandEnabled(A)) return -1;else{return FCK.EditorDocument.queryCommandState(A)?1:0;}}catch (e){return 0;}},GetNamedCommandValue:function(A){var B='';var C=FCK.GetNamedCommandState(A);if (C==-1) return null;try{B=this.EditorDocument.queryCommandValue(A);}catch(e) {};return B?B:'';},Paste:function(A){if (FCK.Status!=2||!FCK.Events.FireEvent('OnPaste')) return false;return A||FCK._ExecPaste();},PasteFromWord:function(){FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.PasteFromWord,'dialog/fck_paste.html',400,330,'Word');},Preview:function(){var A;if (FCKConfig.FullPage){if (FCK.TempBaseTag.length>0) A=FCK.TempBaseTag+FCK.GetXHTML();else A=FCK.GetXHTML();}else{A=FCKConfig.DocType+''+FCK.TempBaseTag+''+FCKLang.Preview+''+_FCK_GetEditorAreaStyleTags()+''+FCK.GetXHTML()+'';};var B=FCKConfig.ScreenWidth*0.8;var C=FCKConfig.ScreenHeight*0.7;var D=(FCKConfig.ScreenWidth-B)/2;var E='';if (FCK_IS_CUSTOM_DOMAIN&&FCKBrowserInfo.IsIE){window._FCKHtmlToLoad=A;E='javascript:void( (function(){document.open() ;document.domain="'+document.domain+'" ;document.write( window.opener._FCKHtmlToLoad );document.close() ;window.opener._FCKHtmlToLoad = null ;})() )';};var F=window.open(E,null,'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+B+',height='+C+',left='+D);if (!FCK_IS_CUSTOM_DOMAIN||!FCKBrowserInfo.IsIE){F.document.write(A);F.document.close();}},SwitchEditMode:function(A){var B=(FCK.EditMode==0);var C=FCK.IsDirty();var D;if (B){FCKCommands.GetCommand('ShowBlocks').SaveState();if (!A&&FCKBrowserInfo.IsIE) FCKUndo.SaveUndoStep();D=FCK.GetXHTML(FCKConfig.FormatSource);if (FCKBrowserInfo.IsIE) FCKTempBin.ToHtml();if (D==null) return false;}else D=this.EditingArea.Textarea.value;FCK.EditMode=B?1:0;FCK.SetData(D,!C);FCK.Focus();FCKTools.RunFunction(FCK.ToolbarSet.RefreshModeState,FCK.ToolbarSet);return true;},InsertElement:function(A){if (typeof A=='string') A=this.EditorDocument.createElement(A);var B=A.nodeName.toLowerCase();FCKSelection.Restore();var C=new FCKDomRange(this.EditorWindow);C.MoveToSelection();C.DeleteContents();if (FCKListsLib.BlockElements[B]!=null){if (C.StartBlock){if (C.CheckStartOfBlock()) C.MoveToPosition(C.StartBlock,3);else if (C.CheckEndOfBlock()) C.MoveToPosition(C.StartBlock,4);else C.SplitBlock();};C.InsertNode(A);var D=FCKDomTools.GetNextSourceElement(A,false,null,['hr','br','param','img','area','input'],true);if (!D&&FCKConfig.EnterMode!='br'){D=this.EditorDocument.body.appendChild(this.EditorDocument.createElement(FCKConfig.EnterMode));if (FCKBrowserInfo.IsGeckoLike) FCKTools.AppendBogusBr(D);};if (FCKListsLib.EmptyElements[B]==null) C.MoveToElementEditStart(A);else if (D) C.MoveToElementEditStart(D);else C.MoveToPosition(A,4);if (FCKBrowserInfo.IsGeckoLike){if (D) FCKDomTools.ScrollIntoView(D,false);FCKDomTools.ScrollIntoView(A,false);}}else{C.InsertNode(A);C.SetStart(A,4);C.SetEnd(A,4);};C.Select();C.Release();this.Focus();return A;},_InsertBlockElement:function(A){},_IsFunctionKey:function(A){if (A>=16&&A<=20) return true;if (A==27||(A>=33&&A<=40)) return true;if (A==45) return true;return false;},_KeyDownListener:function(A){if (!A) A=FCK.EditorWindow.event;if (FCK.EditorWindow){if (!FCK._IsFunctionKey(A.keyCode)&&!(A.ctrlKey||A.metaKey)&&!(A.keyCode==46)) FCK._KeyDownUndo();};return true;},_KeyDownUndo:function(){if (!FCKUndo.Typing){FCKUndo.SaveUndoStep();FCKUndo.Typing=true;FCK.Events.FireEvent("OnSelectionChange");};FCKUndo.TypesCount++;FCKUndo.Changed=1;if (FCKUndo.TypesCount>FCKUndo.MaxTypes){FCKUndo.TypesCount=0;FCKUndo.SaveUndoStep();}},_TabKeyHandler:function(A){if (!A) A=window.event;var B=A.keyCode;if (B==9&&FCK.EditMode!=0){if (FCKBrowserInfo.IsIE){var C=document.selection.createRange();if (C.parentElement()!=FCK.EditingArea.Textarea) return true;C.text='\t';C.select();}else{var a=[];var D=FCK.EditingArea.Textarea;var E=D.selectionStart;var F=D.selectionEnd;a.push(D.value.substr(0,E));a.push('\t');a.push(D.value.substr(F));D.value=a.join('');D.setSelectionRange(E+1,E+1);};if (A.preventDefault) return A.preventDefault();return A.returnValue=false;};return true;}};FCK.Events=new FCKEvents(FCK);FCK.GetHTML=FCK.GetXHTML=FCK.GetData;FCK.SetHTML=FCK.SetData;FCK.InsertElementAndGetIt=FCK.CreateElement=FCK.InsertElement;function _FCK_ProtectEvents_ReplaceTags(A){return A.replace(FCKRegexLib.EventAttributes,_FCK_ProtectEvents_ReplaceEvents);};function _FCK_ProtectEvents_ReplaceEvents(A,B){return ' '+B+'_fckprotectedatt="'+encodeURIComponent(A)+'"';};function _FCK_ProtectEvents_RestoreEvents(A,B){return decodeURIComponent(B);};function _FCK_MouseEventsListener(A){if (!A) A=window.event;if (A.type=='mousedown') FCK.MouseDownFlag=true;else if (A.type=='mouseup') FCK.MouseDownFlag=false;else if (A.type=='mousemove') FCK.Events.FireEvent('OnMouseMove',A);};function _FCK_PaddingNodeListener(){if (FCKConfig.EnterMode.IEquals('br')) return;FCKDomTools.EnforcePaddingNode(FCK.EditorDocument,FCKConfig.EnterMode);if (!FCKBrowserInfo.IsIE&&FCKDomTools.PaddingNode){var A=FCKSelection.GetSelection();if (A&&A.rangeCount==1){var B=A.getRangeAt(0);if (B.collapsed&&B.startContainer==FCK.EditorDocument.body&&B.startOffset==0){B.selectNodeContents(FCKDomTools.PaddingNode);B.collapse(true);A.removeAllRanges();A.addRange(B);}}}else if (FCKDomTools.PaddingNode){var C=FCKSelection.GetParentElement();var D=FCKDomTools.PaddingNode;if (C&&C.nodeName.IEquals('body')){if (FCK.EditorDocument.body.childNodes.length==1&&FCK.EditorDocument.body.firstChild==D){if (FCKSelection._GetSelectionDocument(FCK.EditorDocument.selection)!=FCK.EditorDocument) return;var B=FCK.EditorDocument.body.createTextRange();var F=false;if (!D.childNodes.firstChild){D.appendChild(FCKTools.GetElementDocument(D).createTextNode('\ufeff'));F=true;};B.moveToElementText(D);B.select();if (F) B.pasteHTML('');}}}};function _FCK_EditingArea_OnLoad(){FCK.EditorWindow=FCK.EditingArea.Window;FCK.EditorDocument=FCK.EditingArea.Document;if (FCKBrowserInfo.IsIE) FCKTempBin.ToElements();FCK.InitializeBehaviors();FCK.MouseDownFlag=false;FCKTools.AddEventListener(FCK.EditorDocument,'mousemove',_FCK_MouseEventsListener);FCKTools.AddEventListener(FCK.EditorDocument,'mousedown',_FCK_MouseEventsListener);FCKTools.AddEventListener(FCK.EditorDocument,'mouseup',_FCK_MouseEventsListener);if (FCKBrowserInfo.IsSafari){var A=function(evt){if (!(evt.ctrlKey||evt.metaKey)) return;if (FCK.EditMode!=0) return;switch (evt.keyCode){case 89:FCKUndo.Redo();break;case 90:FCKUndo.Undo();break;}};FCKTools.AddEventListener(FCK.EditorDocument,'keyup',A);};FCK.EnterKeyHandler=new FCKEnterKey(FCK.EditorWindow,FCKConfig.EnterMode,FCKConfig.ShiftEnterMode,FCKConfig.TabSpaces);FCK.KeystrokeHandler.AttachToElement(FCK.EditorDocument);if (FCK._ForceResetIsDirty) FCK.ResetIsDirty();if (FCKBrowserInfo.IsIE&&FCK.HasFocus) FCK.EditorDocument.body.setActive();FCK.OnAfterSetHTML();FCKCommands.GetCommand('ShowBlocks').RestoreState();if (FCK.Status!=0) return;FCK.SetStatus(1);};function _FCK_GetEditorAreaStyleTags(){return FCKTools.GetStyleHtml(FCKConfig.EditorAreaCSS)+FCKTools.GetStyleHtml(FCKConfig.EditorAreaStyles);};function _FCK_KeystrokeHandler_OnKeystroke(A,B){if (FCK.Status!=2) return false;if (FCK.EditMode==0){switch (B){case 'Paste':return!FCK.Paste();case 'Cut':FCKUndo.SaveUndoStep();return false;}}else{if (B.Equals('Paste','Undo','Redo','SelectAll','Cut')) return false;};var C=FCK.Commands.GetCommand(B);if (C.GetState()==-1) return false;return (C.Execute.apply(C,FCKTools.ArgumentsToArray(arguments,2))!==false);};(function(){var A=window.parent.document;var B=A.getElementById(FCK.Name);var i=0;while (B||i==0){if (B&&B.tagName.toLowerCase().Equals('input','textarea')){FCK.LinkedField=B;break;};B=A.getElementsByName(FCK.Name)[i++];}})();var FCKTempBin={Elements:[],AddElement:function(A){var B=this.Elements.length;this.Elements[B]=A;return B;},RemoveElement:function(A){var e=this.Elements[A];this.Elements[A]=null;return e;},Reset:function(){var i=0;while (i '+this.Elements[i].outerHTML+'';this.Elements[i].isHtml=true;}},ToElements:function(){var A=FCK.EditorDocument.createElement('div');for (var i=0;i0?'':'';var A=FCK.KeystrokeHandler=new FCKKeystrokeHandler();A.OnKeystroke=_FCK_KeystrokeHandler_OnKeystroke;A.SetKeystrokes(FCKConfig.Keystrokes);if (FCKBrowserInfo.IsIE7){if ((CTRL+86) in A.Keystrokes) A.SetKeystrokes([CTRL+86,true]);if ((SHIFT+45) in A.Keystrokes) A.SetKeystrokes([SHIFT+45,true]);};A.SetKeystrokes([CTRL+8,true]);this.EditingArea=new FCKEditingArea(document.getElementById('xEditingArea'));this.EditingArea.FFSpellChecker=FCKConfig.FirefoxSpellChecker;this.SetData(this.GetLinkedFieldValue(),true);FCKTools.AddEventListener(document,"keydown",this._TabKeyHandler);this.AttachToOnSelectionChange(_FCK_PaddingNodeListener);if (FCKBrowserInfo.IsGecko) this.AttachToOnSelectionChange(this._ExecCheckEmptyBlock);},Focus:function(){FCK.EditingArea.Focus();},SetStatus:function(A){this.Status=A;if (A==1){FCKFocusManager.AddWindow(window,true);if (FCKBrowserInfo.IsIE) FCKFocusManager.AddWindow(window.frameElement,true);if (FCKConfig.StartupFocus) FCK.Focus();};this.Events.FireEvent('OnStatusChange',A);},FixBody:function(){var A=FCKConfig.EnterMode;if (A!='p'&&A!='div') return;var B=this.EditorDocument;if (!B) return;var C=B.body;if (!C) return;FCKDomTools.TrimNode(C);var D=C.firstChild;var E;while (D){var F=false;switch (D.nodeType){case 1:var G=D.nodeName.toLowerCase();if (!FCKListsLib.BlockElements[G]&&G!='li'&&!D.getAttribute('_fckfakelement')&&D.getAttribute('_moz_dirty')==null) F=true;break;case 3:if (E||D.nodeValue.Trim().length>0) F=true;break;case 8:if (E) F=true;break;};if (F){var H=D.parentNode;if (!E) E=H.insertBefore(B.createElement(A),D);E.appendChild(H.removeChild(D));D=E.nextSibling;}else{if (E){FCKDomTools.TrimNode(E);E=null;};D=D.nextSibling;}};if (E) FCKDomTools.TrimNode(E);},GetData:function(A){if (FCK.EditMode==1) return FCK.EditingArea.Textarea.value;this.FixBody();var B=FCK.EditorDocument;if (!B) return null;var C=FCKConfig.FullPage;var D=FCK.DataProcessor.ConvertToDataFormat(C?B.documentElement:B.body,!C,FCKConfig.IgnoreEmptyParagraphValue,A);D=FCK.ProtectEventsRestore(D);if (FCKBrowserInfo.IsIE) D=D.replace(FCKRegexLib.ToReplace,'$1');if (C){if (FCK.DocTypeDeclaration&&FCK.DocTypeDeclaration.length>0) D=FCK.DocTypeDeclaration+'\n'+D;if (FCK.XmlDeclaration&&FCK.XmlDeclaration.length>0) D=FCK.XmlDeclaration+'\n'+D;};return FCKConfig.ProtectedSource.Revert(D);},UpdateLinkedField:function(){var A=FCK.GetXHTML(FCKConfig.FormatOutput);if (FCKConfig.HtmlEncodeOutput) A=FCKTools.HTMLEncode(A);FCK.LinkedField.value=A;FCK.Events.FireEvent('OnAfterLinkedFieldUpdate');},RegisteredDoubleClickHandlers:{},OnDoubleClick:function(A){var B=FCK.RegisteredDoubleClickHandlers[A.tagName.toUpperCase()];if (B){for (var i=0;i0?'|ABBR|XML|EMBED|OBJECT':'ABBR|XML|EMBED|OBJECT';var C;if (B.length>0){C=new RegExp('<('+B+')(?!\w|:)','gi');A=A.replace(C,'','gi');A=A.replace(C,'<\/FCK:$1>');};B='META';if (FCKBrowserInfo.IsIE) B+='|HR';C=new RegExp('<(('+B+')(?=\\s|>|/)[\\s\\S]*?)/?>','gi');A=A.replace(C,'');return A;},SetData:function(A,B){this.EditingArea.Mode=FCK.EditMode;if (FCKBrowserInfo.IsIE&&FCK.EditorDocument){FCK.EditorDocument.detachEvent("onselectionchange",Doc_OnSelectionChange);};FCKTempBin.Reset();FCK.Selection.Release();if (FCK.EditMode==0){this._ForceResetIsDirty=(B===true);A=FCKConfig.ProtectedSource.Protect(A);A=FCK.DataProcessor.ConvertToHtml(A);A=A.replace(FCKRegexLib.InvalidSelfCloseTags,'$1>');A=FCK.ProtectEvents(A);A=FCK.ProtectUrls(A);A=FCK.ProtectTags(A);if (FCK.TempBaseTag.length>0&&!FCKRegexLib.HasBaseTag.test(A)) A=A.replace(FCKRegexLib.HeadOpener,'$&'+FCK.TempBaseTag);var C='';if (!FCKConfig.FullPage) C+=_FCK_GetEditorAreaStyleTags();if (FCKBrowserInfo.IsIE) C+=FCK._GetBehaviorsStyle();else if (FCKConfig.ShowBorders) C+=FCKTools.GetStyleHtml(FCK_ShowTableBordersCSS,true);C+=FCKTools.GetStyleHtml(FCK_InternalCSS,true);A=A.replace(FCKRegexLib.HeadCloser,C+'$&');this.EditingArea.OnLoad=_FCK_EditingArea_OnLoad;this.EditingArea.Start(A);}else{FCK.EditorWindow=null;FCK.EditorDocument=null;FCKDomTools.PaddingNode=null;this.EditingArea.OnLoad=null;this.EditingArea.Start(A);this.EditingArea.Textarea._FCKShowContextMenu=true;FCK.EnterKeyHandler=null;if (B) this.ResetIsDirty();FCK.KeystrokeHandler.AttachToElement(this.EditingArea.Textarea);this.EditingArea.Textarea.focus();FCK.Events.FireEvent('OnAfterSetHTML');};if (FCKBrowserInfo.IsGecko) window.onresize();},RedirectNamedCommands:{},ExecuteNamedCommand:function(A,B,C,D){if (!D) FCKUndo.SaveUndoStep();if (!C&&FCK.RedirectNamedCommands[A]!=null) FCK.ExecuteRedirectedNamedCommand(A,B);else{FCK.Focus();FCK.EditorDocument.execCommand(A,false,B);FCK.Events.FireEvent('OnSelectionChange');};if (!D) FCKUndo.SaveUndoStep();},GetNamedCommandState:function(A){try{if (FCKBrowserInfo.IsSafari&&FCK.EditorWindow&&A.IEquals('Paste')) return 0;if (!FCK.EditorDocument.queryCommandEnabled(A)) return -1;else{return FCK.EditorDocument.queryCommandState(A)?1:0;}}catch (e){return 0;}},GetNamedCommandValue:function(A){var B='';var C=FCK.GetNamedCommandState(A);if (C==-1) return null;try{B=this.EditorDocument.queryCommandValue(A);}catch(e) {};return B?B:'';},Paste:function(A){if (FCK.Status!=2||!FCK.Events.FireEvent('OnPaste')) return false;return A||FCK._ExecPaste();},PasteFromWord:function(){FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.PasteFromWord,'dialog/fck_paste.html',400,330,'Word');},Preview:function(){var A;if (FCKConfig.FullPage){if (FCK.TempBaseTag.length>0) A=FCK.TempBaseTag+FCK.GetXHTML();else A=FCK.GetXHTML();}else{A=FCKConfig.DocType+''+FCK.TempBaseTag+''+FCKLang.Preview+''+_FCK_GetEditorAreaStyleTags()+''+FCK.GetXHTML()+'';};var B=FCKConfig.ScreenWidth*0.8;var C=FCKConfig.ScreenHeight*0.7;var D=(FCKConfig.ScreenWidth-B)/2;var E='';if (FCK_IS_CUSTOM_DOMAIN&&FCKBrowserInfo.IsIE){window._FCKHtmlToLoad=A;E='javascript:void( (function(){document.open() ;document.domain="'+document.domain+'" ;document.write( window.opener._FCKHtmlToLoad );document.close() ;window.opener._FCKHtmlToLoad = null ;})() )';};var F=window.open(E,null,'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+B+',height='+C+',left='+D);if (!FCK_IS_CUSTOM_DOMAIN||!FCKBrowserInfo.IsIE){F.document.write(A);F.document.close();}},SwitchEditMode:function(A){var B=(FCK.EditMode==0);var C=FCK.IsDirty();var D;if (B){FCKCommands.GetCommand('ShowBlocks').SaveState();if (!A&&FCKBrowserInfo.IsIE) FCKUndo.SaveUndoStep();D=FCK.GetXHTML(FCKConfig.FormatSource);if (FCKBrowserInfo.IsIE) FCKTempBin.ToHtml();if (D==null) return false;}else D=this.EditingArea.Textarea.value;FCK.EditMode=B?1:0;FCK.SetData(D,!C);FCK.Focus();FCKTools.RunFunction(FCK.ToolbarSet.RefreshModeState,FCK.ToolbarSet);return true;},InsertElement:function(A){if (typeof A=='string') A=this.EditorDocument.createElement(A);var B=A.nodeName.toLowerCase();FCKSelection.Restore();var C=new FCKDomRange(this.EditorWindow);C.MoveToSelection();C.DeleteContents();if (FCKListsLib.BlockElements[B]!=null){if (C.StartBlock){if (C.CheckStartOfBlock()) C.MoveToPosition(C.StartBlock,3);else if (C.CheckEndOfBlock()) C.MoveToPosition(C.StartBlock,4);else C.SplitBlock();};C.InsertNode(A);var D=FCKDomTools.GetNextSourceElement(A,false,null,['hr','br','param','img','area','input'],true);if (!D&&FCKConfig.EnterMode!='br'){D=this.EditorDocument.body.appendChild(this.EditorDocument.createElement(FCKConfig.EnterMode));if (FCKBrowserInfo.IsGeckoLike) FCKTools.AppendBogusBr(D);};if (FCKListsLib.EmptyElements[B]==null) C.MoveToElementEditStart(A);else if (D) C.MoveToElementEditStart(D);else C.MoveToPosition(A,4);if (FCKBrowserInfo.IsGeckoLike){if (D) FCKDomTools.ScrollIntoView(D,false);FCKDomTools.ScrollIntoView(A,false);}}else{C.InsertNode(A);C.SetStart(A,4);C.SetEnd(A,4);};C.Select();C.Release();this.Focus();return A;},_InsertBlockElement:function(A){},_IsFunctionKey:function(A){if (A>=16&&A<=20) return true;if (A==27||(A>=33&&A<=40)) return true;if (A==45) return true;return false;},_KeyDownListener:function(A){if (!A) A=FCK.EditorWindow.event;if (FCK.EditorWindow){if (!FCK._IsFunctionKey(A.keyCode)&&!(A.ctrlKey||A.metaKey)&&!(A.keyCode==46)) FCK._KeyDownUndo();};return true;},_KeyDownUndo:function(){if (!FCKUndo.Typing){FCKUndo.SaveUndoStep();FCKUndo.Typing=true;FCK.Events.FireEvent("OnSelectionChange");};FCKUndo.TypesCount++;FCKUndo.Changed=1;if (FCKUndo.TypesCount>FCKUndo.MaxTypes){FCKUndo.TypesCount=0;FCKUndo.SaveUndoStep();}},_TabKeyHandler:function(A){if (!A) A=window.event;var B=A.keyCode;if (B==9&&FCK.EditMode!=0){if (FCKBrowserInfo.IsIE){var C=document.selection.createRange();if (C.parentElement()!=FCK.EditingArea.Textarea) return true;C.text='\t';C.select();}else{var a=[];var D=FCK.EditingArea.Textarea;var E=D.selectionStart;var F=D.selectionEnd;a.push(D.value.substr(0,E));a.push('\t');a.push(D.value.substr(F));D.value=a.join('');D.setSelectionRange(E+1,E+1);};if (A.preventDefault) return A.preventDefault();return A.returnValue=false;};return true;}};FCK.Events=new FCKEvents(FCK);FCK.GetHTML=FCK.GetXHTML=FCK.GetData;FCK.SetHTML=FCK.SetData;FCK.InsertElementAndGetIt=FCK.CreateElement=FCK.InsertElement;function _FCK_ProtectEvents_ReplaceTags(A){return A.replace(FCKRegexLib.EventAttributes,_FCK_ProtectEvents_ReplaceEvents);};function _FCK_ProtectEvents_ReplaceEvents(A,B){return ' '+B+'_fckprotectedatt="'+encodeURIComponent(A)+'"';};function _FCK_ProtectEvents_RestoreEvents(A,B){return decodeURIComponent(B);};function _FCK_MouseEventsListener(A){if (!A) A=window.event;if (A.type=='mousedown') FCK.MouseDownFlag=true;else if (A.type=='mouseup') FCK.MouseDownFlag=false;else if (A.type=='mousemove') FCK.Events.FireEvent('OnMouseMove',A);};function _FCK_PaddingNodeListener(){if (FCKConfig.EnterMode.IEquals('br')) return;FCKDomTools.EnforcePaddingNode(FCK.EditorDocument,FCKConfig.EnterMode);if (!FCKBrowserInfo.IsIE&&FCKDomTools.PaddingNode){var A=FCKSelection.GetSelection();if (A&&A.rangeCount==1){var B=A.getRangeAt(0);if (B.collapsed&&B.startContainer==FCK.EditorDocument.body&&B.startOffset==0){B.selectNodeContents(FCKDomTools.PaddingNode);B.collapse(true);A.removeAllRanges();A.addRange(B);}}}else if (FCKDomTools.PaddingNode){var C=FCKSelection.GetParentElement();var D=FCKDomTools.PaddingNode;if (C&&C.nodeName.IEquals('body')){if (FCK.EditorDocument.body.childNodes.length==1&&FCK.EditorDocument.body.firstChild==D){if (FCKSelection._GetSelectionDocument(FCK.EditorDocument.selection)!=FCK.EditorDocument) return;var B=FCK.EditorDocument.body.createTextRange();var F=false;if (!D.childNodes.firstChild){D.appendChild(FCKTools.GetElementDocument(D).createTextNode('\ufeff'));F=true;};B.moveToElementText(D);B.select();if (F) B.pasteHTML('');}}}};function _FCK_EditingArea_OnLoad(){FCK.EditorWindow=FCK.EditingArea.Window;FCK.EditorDocument=FCK.EditingArea.Document;if (FCKBrowserInfo.IsIE) FCKTempBin.ToElements();FCK.InitializeBehaviors();FCK.MouseDownFlag=false;FCKTools.AddEventListener(FCK.EditorDocument,'mousemove',_FCK_MouseEventsListener);FCKTools.AddEventListener(FCK.EditorDocument,'mousedown',_FCK_MouseEventsListener);FCKTools.AddEventListener(FCK.EditorDocument,'mouseup',_FCK_MouseEventsListener);if (FCKBrowserInfo.IsSafari){FCKTools.AddEventListener(FCK.EditorDocument,'paste',function(evt){var A=new FCKDomRange(FCK.EditorWindow);var B=FCK.EditorDocument.createTextNode('\ufeff');var C=FCK.EditorDocument.createElement('a');C.id='fck_paste_padding';C.innerHTML='';A.MoveToSelection();A.DeleteContents();A.InsertNode(B);A.Collapse();A.InsertNode(C);A.MoveToPosition(C,3);A.Select();setTimeout(function(){B.parentNode.removeChild(B);C=FCK.EditorDocument.getElementById('fck_paste_padding');C.parentNode.removeChild(C);},0);});};if (FCKBrowserInfo.IsSafari){var A=function(evt){if (!(evt.ctrlKey||evt.metaKey)) return;if (FCK.EditMode!=0) return;switch (evt.keyCode){case 89:FCKUndo.Redo();break;case 90:FCKUndo.Undo();break;}};FCKTools.AddEventListener(FCK.EditorDocument,'keyup',A);};FCK.EnterKeyHandler=new FCKEnterKey(FCK.EditorWindow,FCKConfig.EnterMode,FCKConfig.ShiftEnterMode,FCKConfig.TabSpaces);FCK.KeystrokeHandler.AttachToElement(FCK.EditorDocument);if (FCK._ForceResetIsDirty) FCK.ResetIsDirty();if (FCKBrowserInfo.IsIE&&FCK.HasFocus) FCK.EditorDocument.body.setActive();FCK.OnAfterSetHTML();FCKCommands.GetCommand('ShowBlocks').RestoreState();if (FCK.Status!=0) return;FCK.SetStatus(1);};function _FCK_GetEditorAreaStyleTags(){return FCKTools.GetStyleHtml(FCKConfig.EditorAreaCSS)+FCKTools.GetStyleHtml(FCKConfig.EditorAreaStyles);};function _FCK_KeystrokeHandler_OnKeystroke(A,B){if (FCK.Status!=2) return false;if (FCK.EditMode==0){switch (B){case 'Paste':return!FCK.Paste();case 'Cut':FCKUndo.SaveUndoStep();return false;}}else{if (B.Equals('Paste','Undo','Redo','SelectAll','Cut')) return false;};var C=FCK.Commands.GetCommand(B);if (C.GetState()==-1) return false;return (C.Execute.apply(C,FCKTools.ArgumentsToArray(arguments,2))!==false);};(function(){var A=window.parent.document;var B=A.getElementById(FCK.Name);var i=0;while (B||i==0){if (B&&B.tagName.toLowerCase().Equals('input','textarea')){FCK.LinkedField=B;break;};B=A.getElementsByName(FCK.Name)[i++];}})();var FCKTempBin={Elements:[],AddElement:function(A){var B=this.Elements.length;this.Elements[B]=A;return B;},RemoveElement:function(A){var e=this.Elements[A];this.Elements[A]=null;return e;},Reset:function(){var i=0;while (i '+this.Elements[i].outerHTML+'';this.Elements[i].isHtml=true;}},ToElements:function(){var A=FCK.EditorDocument.createElement('div');for (var i=0;i40) return;};var C=function(H){if (H.nodeType!=1) return false;var D=H.tagName.toLowerCase();return (FCKListsLib.BlockElements[D]||FCKListsLib.EmptyElements[D]);};var E=function(){var F=FCKSelection.GetSelection();var G=F.getRangeAt(0);if (!G||!G.collapsed) return;var H=G.endContainer;if (H.nodeType!=3) return;if (H.nodeValue.length!=G.endOffset) return;var I=H.parentNode.tagName.toLowerCase();if (!(I=='a'||(!FCKBrowserInfo.IsOpera&&String(H.parentNode.contentEditable)=='false')||(!(FCKListsLib.BlockElements[I]||FCKListsLib.NonEmptyBlockElements[I])&&B==35))) return;var J=FCKTools.GetNextTextNode(H,H.parentNode,C);if (J) return;G=FCK.EditorDocument.createRange();J=FCKTools.GetNextTextNode(H,H.parentNode.parentNode,C);if (J){if (FCKBrowserInfo.IsOpera&&B==37) return;G.setStart(J,0);G.setEnd(J,0);}else{while (H.parentNode&&H.parentNode!=FCK.EditorDocument.body&&H.parentNode!=FCK.EditorDocument.documentElement&&H==H.parentNode.lastChild&&(!FCKListsLib.BlockElements[H.parentNode.tagName.toLowerCase()]&&!FCKListsLib.NonEmptyBlockElements[H.parentNode.tagName.toLowerCase()])) H=H.parentNode;if (FCKListsLib.BlockElements[I]||FCKListsLib.EmptyElements[I]||H==FCK.EditorDocument.body){G.setStart(H,H.childNodes.length);G.setEnd(H,H.childNodes.length);}else{var K=H.nextSibling;while (K){if (K.nodeType!=1){K=K.nextSibling;continue;};var L=K.tagName.toLowerCase();if (FCKListsLib.BlockElements[L]||FCKListsLib.EmptyElements[L]||FCKListsLib.NonEmptyBlockElements[L]) break;K=K.nextSibling;};var M=FCK.EditorDocument.createTextNode('');if (K) H.parentNode.insertBefore(M,K);else H.parentNode.appendChild(M);G.setStart(M,0);G.setEnd(M,0);}};F.removeAllRanges();F.addRange(G);FCK.Events.FireEvent("OnSelectionChange");};setTimeout(E,1);};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.EditorDocument.addEventListener('keydown',this._KeyDownListener,false);if (FCKBrowserInfo.IsGecko){this.EditorWindow.addEventListener('dragdrop',this._ExecDrop,true);}else if (FCKBrowserInfo.IsSafari){this.EditorDocument.addEventListener('dragover',function (evt){ if (!FCK.MouseDownFlag&&FCK.Config.ForcePasteAsPlainText) evt.returnValue=false;},true);this.EditorDocument.addEventListener('drop',this._ExecDrop,true);this.EditorDocument.addEventListener('mousedown',function(ev){var N=ev.srcElement;if (N.nodeName.IEquals('IMG','HR','INPUT','TEXTAREA','SELECT')){FCKSelection.SelectNode(N);}},true);this.EditorDocument.addEventListener('mouseup',function(ev){if (ev.srcElement.nodeName.IEquals('INPUT','TEXTAREA','SELECT')) ev.preventDefault()},true);this.EditorDocument.addEventListener('click',function(ev){if (ev.srcElement.nodeName.IEquals('INPUT','TEXTAREA','SELECT')) ev.preventDefault()},true);};if (FCKBrowserInfo.IsGecko||FCKBrowserInfo.IsOpera){this.EditorDocument.addEventListener('keypress',this._ExecCheckCaret,false);this.EditorDocument.addEventListener('click',this._ExecCheckCaret,false);};FCK.ContextMenu._InnerContextMenu.SetMouseClickWindow(FCK.EditorWindow);FCK.ContextMenu._InnerContextMenu.AttachToElement(FCK.EditorDocument);};FCK.MakeEditable=function(){this.EditingArea.MakeEditable();};function Document_OnContextMenu(e){if (!e.target._FCKShowContextMenu) e.preventDefault();};document.oncontextmenu=Document_OnContextMenu;FCK._BaseGetNamedCommandState=FCK.GetNamedCommandState;FCK.GetNamedCommandState=function(A){switch (A){case 'Unlink':return FCKSelection.HasAncestorNode('A')?0:-1;default:return FCK._BaseGetNamedCommandState(A);}};FCK.RedirectNamedCommands={Print:true,Paste:true};FCK.ExecuteRedirectedNamedCommand=function(A,B){switch (A){case 'Print':FCK.EditorWindow.print();break;case 'Paste':try{if (FCKBrowserInfo.IsSafari) throw '';if (FCK.Paste()) FCK.ExecuteNamedCommand('Paste',null,true);}catch (e) {if (FCKConfig.ForcePasteAsPlainText) FCK.PasteAsPlainText();else FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.Paste,'dialog/fck_paste.html',400,330,'Security');};break;default:FCK.ExecuteNamedCommand(A,B);}};FCK._ExecPaste=function(){FCKUndo.SaveUndoStep();if (FCKConfig.ForcePasteAsPlainText){FCK.PasteAsPlainText();return false;};return true;};FCK.InsertHtml=function(A){var B=FCK.EditorDocument,range;A=FCKConfig.ProtectedSource.Protect(A);A=FCK.ProtectEvents(A);A=FCK.ProtectUrls(A);A=FCK.ProtectTags(A);FCKUndo.SaveUndoStep();if (FCKBrowserInfo.IsGecko){A=A.replace(/ $/,'$&');var C=new FCKDocumentFragment(this.EditorDocument);C.AppendHtml(A);var D=C.RootNode.lastChild;range=new FCKDomRange(this.EditorWindow);range.MoveToSelection();var E=C.RootNode.firstChild;while (E&&E.nodeType!=1) E=E.nextSibling;if (E&&FCKListsLib.BlockElements[E.nodeName.toLowerCase()]) range.SplitBlock();range.DeleteContents();range.InsertNode(C.RootNode);range.MoveToPosition(D,4);}else B.execCommand('inserthtml',false,A);this.Focus();if (!range){range=new FCKDomRange(this.EditorWindow);range.MoveToSelection();};var E=range.CreateBookmark();FCKDocumentProcessor.Process(B);try{range.MoveToBookmark(E);range.Select();}catch (e) {};this.Events.FireEvent("OnSelectionChange");};FCK.PasteAsPlainText=function(){FCKTools.RunFunction(FCKDialog.OpenDialog,FCKDialog,['FCKDialog_Paste',FCKLang.PasteAsText,'dialog/fck_paste.html',400,330,'PlainText']);};FCK.GetClipboardHTML=function(){return '';};FCK.CreateLink=function(A,B){var C=[];if (FCKSelection.GetSelection().isCollapsed) return C;FCK.ExecuteNamedCommand('Unlink',null,false,!!B);if (A.length>0){var D='javascript:void(0);/*'+(new Date().getTime())+'*/';FCK.ExecuteNamedCommand('CreateLink',D,false,!!B);var E=this.EditorDocument.evaluate("//a[@href='"+D+"']",this.EditorDocument.body,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);for (var i=0;i0&&!isNaN(E)) this.PageConfig[D]=parseFloat(E);else this.PageConfig[D]=E;}};function FCKConfig_LoadPageConfig(){var A=FCKConfig.PageConfig;for (var B in A) FCKConfig[B]=A[B];};function FCKConfig_PreProcess(){var A=FCKConfig;if (A.AllowQueryStringDebug){try{if ((/fckdebug=true/i).test(window.top.location.search)) A.Debug=true;}catch (e) { }};if (!A.PluginsPath.EndsWith('/')) A.PluginsPath+='/';var B=A.ToolbarComboPreviewCSS;if (!B||B.length==0) A.ToolbarComboPreviewCSS=A.EditorAreaCSS;A.RemoveAttributesArray=(A.RemoveAttributes||'').split(',');if (!FCKConfig.SkinEditorCSS||FCKConfig.SkinEditorCSS.length==0) FCKConfig.SkinEditorCSS=FCKConfig.SkinPath+'fck_editor.css';if (!FCKConfig.SkinDialogCSS||FCKConfig.SkinDialogCSS.length==0) FCKConfig.SkinDialogCSS=FCKConfig.SkinPath+'fck_dialog.css';};FCKConfig.ToolbarSets={};FCKConfig.Plugins={};FCKConfig.Plugins.Items=[];FCKConfig.Plugins.Add=function(A,B,C){FCKConfig.Plugins.Items.push([A,B,C]);};FCKConfig.ProtectedSource={};FCKConfig.ProtectedSource._CodeTag=(new Date()).valueOf();FCKConfig.ProtectedSource.RegexEntries=[//g,//gi,//gi];FCKConfig.ProtectedSource.Add=function(A){this.RegexEntries.push(A);};FCKConfig.ProtectedSource.Protect=function(A){var B=this._CodeTag;function _Replace(protectedSource){var C=FCKTempBin.AddElement(protectedSource);return '';};for (var i=0;i|>)","g");return A.replace(D,_Replace);};FCKConfig.GetBodyAttributes=function(){var A='';if (this.BodyId&&this.BodyId.length>0) A+=' id="'+this.BodyId+'"';if (this.BodyClass&&this.BodyClass.length>0) A+=' class="'+this.BodyClass+'"';return A;};FCKConfig.ApplyBodyAttributes=function(A){if (this.BodyId&&this.BodyId.length>0) A.id=FCKConfig.BodyId;if (this.BodyClass&&this.BodyClass.length>0) A.className+=' '+FCKConfig.BodyClass;}; var FCKDebug={Output:function(){},OutputObject:function(){}}; diff --git a/main/inc/lib/fckeditor/editor/js/fckeditorcode_ie.js b/main/inc/lib/fckeditor/editor/js/fckeditorcode_ie.js index 72ee506b87..a8e8a9019e 100644 --- a/main/inc/lib/fckeditor/editor/js/fckeditorcode_ie.js +++ b/main/inc/lib/fckeditor/editor/js/fckeditorcode_ie.js @@ -29,7 +29,7 @@ var s=navigator.userAgent.toLowerCase();var FCKBrowserInfo={IsIE:/*@cc_on!@*/fal var FCKURLParams={};(function(){var A=document.location.search.substr(1).split('&');for (var i=0;i';if (!FCKRegexLib.HtmlOpener.test(A)) A=''+A+'';if (!FCKRegexLib.HeadOpener.test(A)) A=A.replace(FCKRegexLib.HtmlOpener,'$&');return A;}else{var B=FCKConfig.DocType+'0&&!FCKRegexLib.Html4DocType.test(FCKConfig.DocType)) B+=' style="overflow-y: scroll"';B+='>'+A+'';return B;}},ConvertToDataFormat:function(A,B,C,D){var E=FCKXHtml.GetXHTML(A,!B,D);if (C&&FCKRegexLib.EmptyOutParagraph.test(E)) return '';return E;},FixHtml:function(A){return A;}}; -var FCK={Name:FCKURLParams['InstanceName'],Status:0,EditMode:0,Toolbar:null,HasFocus:false,DataProcessor:new FCKDataProcessor(),GetInstanceObject:(function(){var w=window;return function(name){return w[name];}})(),AttachToOnSelectionChange:function(A){this.Events.AttachEvent('OnSelectionChange',A);},GetLinkedFieldValue:function(){return this.LinkedField.value;},GetParentForm:function(){return this.LinkedField.form;},StartupValue:'',IsDirty:function(){if (this.EditMode==1) return (this.StartupValue!=this.EditingArea.Textarea.value);else{if (!this.EditorDocument) return false;return (this.StartupValue!=this.EditorDocument.body.innerHTML);}},ResetIsDirty:function(){if (this.EditMode==1) this.StartupValue=this.EditingArea.Textarea.value;else if (this.EditorDocument.body) this.StartupValue=this.EditorDocument.body.innerHTML;},StartEditor:function(){this.TempBaseTag=FCKConfig.BaseHref.length>0?'':'';var A=FCK.KeystrokeHandler=new FCKKeystrokeHandler();A.OnKeystroke=_FCK_KeystrokeHandler_OnKeystroke;A.SetKeystrokes(FCKConfig.Keystrokes);if (FCKBrowserInfo.IsIE7){if ((CTRL+86) in A.Keystrokes) A.SetKeystrokes([CTRL+86,true]);if ((SHIFT+45) in A.Keystrokes) A.SetKeystrokes([SHIFT+45,true]);};A.SetKeystrokes([CTRL+8,true]);this.EditingArea=new FCKEditingArea(document.getElementById('xEditingArea'));this.EditingArea.FFSpellChecker=FCKConfig.FirefoxSpellChecker;this.SetData(this.GetLinkedFieldValue(),true);FCKTools.AddEventListener(document,"keydown",this._TabKeyHandler);this.AttachToOnSelectionChange(_FCK_PaddingNodeListener);if (FCKBrowserInfo.IsGecko) this.AttachToOnSelectionChange(this._ExecCheckEmptyBlock);},Focus:function(){FCK.EditingArea.Focus();},SetStatus:function(A){this.Status=A;if (A==1){FCKFocusManager.AddWindow(window,true);if (FCKBrowserInfo.IsIE) FCKFocusManager.AddWindow(window.frameElement,true);if (FCKConfig.StartupFocus) FCK.Focus();};this.Events.FireEvent('OnStatusChange',A);},FixBody:function(){var A=FCKConfig.EnterMode;if (A!='p'&&A!='div') return;var B=this.EditorDocument;if (!B) return;var C=B.body;if (!C) return;FCKDomTools.TrimNode(C);var D=C.firstChild;var E;while (D){var F=false;switch (D.nodeType){case 1:var G=D.nodeName.toLowerCase();if (!FCKListsLib.BlockElements[G]&&G!='li'&&!D.getAttribute('_fckfakelement')&&D.getAttribute('_moz_dirty')==null) F=true;break;case 3:if (E||D.nodeValue.Trim().length>0) F=true;break;case 8:if (E) F=true;break;};if (F){var H=D.parentNode;if (!E) E=H.insertBefore(B.createElement(A),D);E.appendChild(H.removeChild(D));D=E.nextSibling;}else{if (E){FCKDomTools.TrimNode(E);E=null;};D=D.nextSibling;}};if (E) FCKDomTools.TrimNode(E);},GetData:function(A){if (FCK.EditMode==1) return FCK.EditingArea.Textarea.value;this.FixBody();var B=FCK.EditorDocument;if (!B) return null;var C=FCKConfig.FullPage;var D=FCK.DataProcessor.ConvertToDataFormat(C?B.documentElement:B.body,!C,FCKConfig.IgnoreEmptyParagraphValue,A);D=FCK.ProtectEventsRestore(D);if (FCKBrowserInfo.IsIE) D=D.replace(FCKRegexLib.ToReplace,'$1');if (C){if (FCK.DocTypeDeclaration&&FCK.DocTypeDeclaration.length>0) D=FCK.DocTypeDeclaration+'\n'+D;if (FCK.XmlDeclaration&&FCK.XmlDeclaration.length>0) D=FCK.XmlDeclaration+'\n'+D;};return FCKConfig.ProtectedSource.Revert(D);},UpdateLinkedField:function(){var A=FCK.GetXHTML(FCKConfig.FormatOutput);if (FCKConfig.HtmlEncodeOutput) A=FCKTools.HTMLEncode(A);FCK.LinkedField.value=A;FCK.Events.FireEvent('OnAfterLinkedFieldUpdate');},RegisteredDoubleClickHandlers:{},OnDoubleClick:function(A){var B=FCK.RegisteredDoubleClickHandlers[A.tagName.toUpperCase()];if (B){for (var i=0;i0?'|ABBR|XML|EMBED|OBJECT':'ABBR|XML|EMBED|OBJECT';var C;if (B.length>0){C=new RegExp('<('+B+')(?!\w|:)','gi');A=A.replace(C,'','gi');A=A.replace(C,'<\/FCK:$1>');};B='META';if (FCKBrowserInfo.IsIE) B+='|HR';C=new RegExp('<(('+B+')(?=\\s|>|/)[\\s\\S]*?)/?>','gi');A=A.replace(C,'');return A;},SetData:function(A,B){this.EditingArea.Mode=FCK.EditMode;if (FCKBrowserInfo.IsIE&&FCK.EditorDocument){FCK.EditorDocument.detachEvent("onselectionchange",Doc_OnSelectionChange);};FCKTempBin.Reset();FCK.Selection.Release();if (FCK.EditMode==0){this._ForceResetIsDirty=(B===true);A=FCKConfig.ProtectedSource.Protect(A);A=FCK.DataProcessor.ConvertToHtml(A);A=A.replace(FCKRegexLib.InvalidSelfCloseTags,'$1>');A=FCK.ProtectEvents(A);A=FCK.ProtectUrls(A);A=FCK.ProtectTags(A);if (FCK.TempBaseTag.length>0&&!FCKRegexLib.HasBaseTag.test(A)) A=A.replace(FCKRegexLib.HeadOpener,'$&'+FCK.TempBaseTag);var C='';if (!FCKConfig.FullPage) C+=_FCK_GetEditorAreaStyleTags();if (FCKBrowserInfo.IsIE) C+=FCK._GetBehaviorsStyle();else if (FCKConfig.ShowBorders) C+=FCKTools.GetStyleHtml(FCK_ShowTableBordersCSS,true);C+=FCKTools.GetStyleHtml(FCK_InternalCSS,true);A=A.replace(FCKRegexLib.HeadCloser,C+'$&');this.EditingArea.OnLoad=_FCK_EditingArea_OnLoad;this.EditingArea.Start(A);}else{FCK.EditorWindow=null;FCK.EditorDocument=null;FCKDomTools.PaddingNode=null;this.EditingArea.OnLoad=null;this.EditingArea.Start(A);this.EditingArea.Textarea._FCKShowContextMenu=true;FCK.EnterKeyHandler=null;if (B) this.ResetIsDirty();FCK.KeystrokeHandler.AttachToElement(this.EditingArea.Textarea);this.EditingArea.Textarea.focus();FCK.Events.FireEvent('OnAfterSetHTML');};if (FCKBrowserInfo.IsGecko) window.onresize();},RedirectNamedCommands:{},ExecuteNamedCommand:function(A,B,C,D){if (!D) FCKUndo.SaveUndoStep();if (!C&&FCK.RedirectNamedCommands[A]!=null) FCK.ExecuteRedirectedNamedCommand(A,B);else{FCK.Focus();FCK.EditorDocument.execCommand(A,false,B);FCK.Events.FireEvent('OnSelectionChange');};if (!D) FCKUndo.SaveUndoStep();},GetNamedCommandState:function(A){try{if (FCKBrowserInfo.IsSafari&&FCK.EditorWindow&&A.IEquals('Paste')) return 0;if (!FCK.EditorDocument.queryCommandEnabled(A)) return -1;else{return FCK.EditorDocument.queryCommandState(A)?1:0;}}catch (e){return 0;}},GetNamedCommandValue:function(A){var B='';var C=FCK.GetNamedCommandState(A);if (C==-1) return null;try{B=this.EditorDocument.queryCommandValue(A);}catch(e) {};return B?B:'';},Paste:function(A){if (FCK.Status!=2||!FCK.Events.FireEvent('OnPaste')) return false;return A||FCK._ExecPaste();},PasteFromWord:function(){FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.PasteFromWord,'dialog/fck_paste.html',400,330,'Word');},Preview:function(){var A;if (FCKConfig.FullPage){if (FCK.TempBaseTag.length>0) A=FCK.TempBaseTag+FCK.GetXHTML();else A=FCK.GetXHTML();}else{A=FCKConfig.DocType+''+FCK.TempBaseTag+''+FCKLang.Preview+''+_FCK_GetEditorAreaStyleTags()+''+FCK.GetXHTML()+'';};var B=FCKConfig.ScreenWidth*0.8;var C=FCKConfig.ScreenHeight*0.7;var D=(FCKConfig.ScreenWidth-B)/2;var E='';if (FCK_IS_CUSTOM_DOMAIN&&FCKBrowserInfo.IsIE){window._FCKHtmlToLoad=A;E='javascript:void( (function(){document.open() ;document.domain="'+document.domain+'" ;document.write( window.opener._FCKHtmlToLoad );document.close() ;window.opener._FCKHtmlToLoad = null ;})() )';};var F=window.open(E,null,'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+B+',height='+C+',left='+D);if (!FCK_IS_CUSTOM_DOMAIN||!FCKBrowserInfo.IsIE){F.document.write(A);F.document.close();}},SwitchEditMode:function(A){var B=(FCK.EditMode==0);var C=FCK.IsDirty();var D;if (B){FCKCommands.GetCommand('ShowBlocks').SaveState();if (!A&&FCKBrowserInfo.IsIE) FCKUndo.SaveUndoStep();D=FCK.GetXHTML(FCKConfig.FormatSource);if (FCKBrowserInfo.IsIE) FCKTempBin.ToHtml();if (D==null) return false;}else D=this.EditingArea.Textarea.value;FCK.EditMode=B?1:0;FCK.SetData(D,!C);FCK.Focus();FCKTools.RunFunction(FCK.ToolbarSet.RefreshModeState,FCK.ToolbarSet);return true;},InsertElement:function(A){if (typeof A=='string') A=this.EditorDocument.createElement(A);var B=A.nodeName.toLowerCase();FCKSelection.Restore();var C=new FCKDomRange(this.EditorWindow);C.MoveToSelection();C.DeleteContents();if (FCKListsLib.BlockElements[B]!=null){if (C.StartBlock){if (C.CheckStartOfBlock()) C.MoveToPosition(C.StartBlock,3);else if (C.CheckEndOfBlock()) C.MoveToPosition(C.StartBlock,4);else C.SplitBlock();};C.InsertNode(A);var D=FCKDomTools.GetNextSourceElement(A,false,null,['hr','br','param','img','area','input'],true);if (!D&&FCKConfig.EnterMode!='br'){D=this.EditorDocument.body.appendChild(this.EditorDocument.createElement(FCKConfig.EnterMode));if (FCKBrowserInfo.IsGeckoLike) FCKTools.AppendBogusBr(D);};if (FCKListsLib.EmptyElements[B]==null) C.MoveToElementEditStart(A);else if (D) C.MoveToElementEditStart(D);else C.MoveToPosition(A,4);if (FCKBrowserInfo.IsGeckoLike){if (D) FCKDomTools.ScrollIntoView(D,false);FCKDomTools.ScrollIntoView(A,false);}}else{C.InsertNode(A);C.SetStart(A,4);C.SetEnd(A,4);};C.Select();C.Release();this.Focus();return A;},_InsertBlockElement:function(A){},_IsFunctionKey:function(A){if (A>=16&&A<=20) return true;if (A==27||(A>=33&&A<=40)) return true;if (A==45) return true;return false;},_KeyDownListener:function(A){if (!A) A=FCK.EditorWindow.event;if (FCK.EditorWindow){if (!FCK._IsFunctionKey(A.keyCode)&&!(A.ctrlKey||A.metaKey)&&!(A.keyCode==46)) FCK._KeyDownUndo();};return true;},_KeyDownUndo:function(){if (!FCKUndo.Typing){FCKUndo.SaveUndoStep();FCKUndo.Typing=true;FCK.Events.FireEvent("OnSelectionChange");};FCKUndo.TypesCount++;FCKUndo.Changed=1;if (FCKUndo.TypesCount>FCKUndo.MaxTypes){FCKUndo.TypesCount=0;FCKUndo.SaveUndoStep();}},_TabKeyHandler:function(A){if (!A) A=window.event;var B=A.keyCode;if (B==9&&FCK.EditMode!=0){if (FCKBrowserInfo.IsIE){var C=document.selection.createRange();if (C.parentElement()!=FCK.EditingArea.Textarea) return true;C.text='\t';C.select();}else{var a=[];var D=FCK.EditingArea.Textarea;var E=D.selectionStart;var F=D.selectionEnd;a.push(D.value.substr(0,E));a.push('\t');a.push(D.value.substr(F));D.value=a.join('');D.setSelectionRange(E+1,E+1);};if (A.preventDefault) return A.preventDefault();return A.returnValue=false;};return true;}};FCK.Events=new FCKEvents(FCK);FCK.GetHTML=FCK.GetXHTML=FCK.GetData;FCK.SetHTML=FCK.SetData;FCK.InsertElementAndGetIt=FCK.CreateElement=FCK.InsertElement;function _FCK_ProtectEvents_ReplaceTags(A){return A.replace(FCKRegexLib.EventAttributes,_FCK_ProtectEvents_ReplaceEvents);};function _FCK_ProtectEvents_ReplaceEvents(A,B){return ' '+B+'_fckprotectedatt="'+encodeURIComponent(A)+'"';};function _FCK_ProtectEvents_RestoreEvents(A,B){return decodeURIComponent(B);};function _FCK_MouseEventsListener(A){if (!A) A=window.event;if (A.type=='mousedown') FCK.MouseDownFlag=true;else if (A.type=='mouseup') FCK.MouseDownFlag=false;else if (A.type=='mousemove') FCK.Events.FireEvent('OnMouseMove',A);};function _FCK_PaddingNodeListener(){if (FCKConfig.EnterMode.IEquals('br')) return;FCKDomTools.EnforcePaddingNode(FCK.EditorDocument,FCKConfig.EnterMode);if (!FCKBrowserInfo.IsIE&&FCKDomTools.PaddingNode){var A=FCKSelection.GetSelection();if (A&&A.rangeCount==1){var B=A.getRangeAt(0);if (B.collapsed&&B.startContainer==FCK.EditorDocument.body&&B.startOffset==0){B.selectNodeContents(FCKDomTools.PaddingNode);B.collapse(true);A.removeAllRanges();A.addRange(B);}}}else if (FCKDomTools.PaddingNode){var C=FCKSelection.GetParentElement();var D=FCKDomTools.PaddingNode;if (C&&C.nodeName.IEquals('body')){if (FCK.EditorDocument.body.childNodes.length==1&&FCK.EditorDocument.body.firstChild==D){if (FCKSelection._GetSelectionDocument(FCK.EditorDocument.selection)!=FCK.EditorDocument) return;var B=FCK.EditorDocument.body.createTextRange();var F=false;if (!D.childNodes.firstChild){D.appendChild(FCKTools.GetElementDocument(D).createTextNode('\ufeff'));F=true;};B.moveToElementText(D);B.select();if (F) B.pasteHTML('');}}}};function _FCK_EditingArea_OnLoad(){FCK.EditorWindow=FCK.EditingArea.Window;FCK.EditorDocument=FCK.EditingArea.Document;if (FCKBrowserInfo.IsIE) FCKTempBin.ToElements();FCK.InitializeBehaviors();FCK.MouseDownFlag=false;FCKTools.AddEventListener(FCK.EditorDocument,'mousemove',_FCK_MouseEventsListener);FCKTools.AddEventListener(FCK.EditorDocument,'mousedown',_FCK_MouseEventsListener);FCKTools.AddEventListener(FCK.EditorDocument,'mouseup',_FCK_MouseEventsListener);if (FCKBrowserInfo.IsSafari){var A=function(evt){if (!(evt.ctrlKey||evt.metaKey)) return;if (FCK.EditMode!=0) return;switch (evt.keyCode){case 89:FCKUndo.Redo();break;case 90:FCKUndo.Undo();break;}};FCKTools.AddEventListener(FCK.EditorDocument,'keyup',A);};FCK.EnterKeyHandler=new FCKEnterKey(FCK.EditorWindow,FCKConfig.EnterMode,FCKConfig.ShiftEnterMode,FCKConfig.TabSpaces);FCK.KeystrokeHandler.AttachToElement(FCK.EditorDocument);if (FCK._ForceResetIsDirty) FCK.ResetIsDirty();if (FCKBrowserInfo.IsIE&&FCK.HasFocus) FCK.EditorDocument.body.setActive();FCK.OnAfterSetHTML();FCKCommands.GetCommand('ShowBlocks').RestoreState();if (FCK.Status!=0) return;FCK.SetStatus(1);};function _FCK_GetEditorAreaStyleTags(){return FCKTools.GetStyleHtml(FCKConfig.EditorAreaCSS)+FCKTools.GetStyleHtml(FCKConfig.EditorAreaStyles);};function _FCK_KeystrokeHandler_OnKeystroke(A,B){if (FCK.Status!=2) return false;if (FCK.EditMode==0){switch (B){case 'Paste':return!FCK.Paste();case 'Cut':FCKUndo.SaveUndoStep();return false;}}else{if (B.Equals('Paste','Undo','Redo','SelectAll','Cut')) return false;};var C=FCK.Commands.GetCommand(B);if (C.GetState()==-1) return false;return (C.Execute.apply(C,FCKTools.ArgumentsToArray(arguments,2))!==false);};(function(){var A=window.parent.document;var B=A.getElementById(FCK.Name);var i=0;while (B||i==0){if (B&&B.tagName.toLowerCase().Equals('input','textarea')){FCK.LinkedField=B;break;};B=A.getElementsByName(FCK.Name)[i++];}})();var FCKTempBin={Elements:[],AddElement:function(A){var B=this.Elements.length;this.Elements[B]=A;return B;},RemoveElement:function(A){var e=this.Elements[A];this.Elements[A]=null;return e;},Reset:function(){var i=0;while (i '+this.Elements[i].outerHTML+'';this.Elements[i].isHtml=true;}},ToElements:function(){var A=FCK.EditorDocument.createElement('div');for (var i=0;i0?'':'';var A=FCK.KeystrokeHandler=new FCKKeystrokeHandler();A.OnKeystroke=_FCK_KeystrokeHandler_OnKeystroke;A.SetKeystrokes(FCKConfig.Keystrokes);if (FCKBrowserInfo.IsIE7){if ((CTRL+86) in A.Keystrokes) A.SetKeystrokes([CTRL+86,true]);if ((SHIFT+45) in A.Keystrokes) A.SetKeystrokes([SHIFT+45,true]);};A.SetKeystrokes([CTRL+8,true]);this.EditingArea=new FCKEditingArea(document.getElementById('xEditingArea'));this.EditingArea.FFSpellChecker=FCKConfig.FirefoxSpellChecker;this.SetData(this.GetLinkedFieldValue(),true);FCKTools.AddEventListener(document,"keydown",this._TabKeyHandler);this.AttachToOnSelectionChange(_FCK_PaddingNodeListener);if (FCKBrowserInfo.IsGecko) this.AttachToOnSelectionChange(this._ExecCheckEmptyBlock);},Focus:function(){FCK.EditingArea.Focus();},SetStatus:function(A){this.Status=A;if (A==1){FCKFocusManager.AddWindow(window,true);if (FCKBrowserInfo.IsIE) FCKFocusManager.AddWindow(window.frameElement,true);if (FCKConfig.StartupFocus) FCK.Focus();};this.Events.FireEvent('OnStatusChange',A);},FixBody:function(){var A=FCKConfig.EnterMode;if (A!='p'&&A!='div') return;var B=this.EditorDocument;if (!B) return;var C=B.body;if (!C) return;FCKDomTools.TrimNode(C);var D=C.firstChild;var E;while (D){var F=false;switch (D.nodeType){case 1:var G=D.nodeName.toLowerCase();if (!FCKListsLib.BlockElements[G]&&G!='li'&&!D.getAttribute('_fckfakelement')&&D.getAttribute('_moz_dirty')==null) F=true;break;case 3:if (E||D.nodeValue.Trim().length>0) F=true;break;case 8:if (E) F=true;break;};if (F){var H=D.parentNode;if (!E) E=H.insertBefore(B.createElement(A),D);E.appendChild(H.removeChild(D));D=E.nextSibling;}else{if (E){FCKDomTools.TrimNode(E);E=null;};D=D.nextSibling;}};if (E) FCKDomTools.TrimNode(E);},GetData:function(A){if (FCK.EditMode==1) return FCK.EditingArea.Textarea.value;this.FixBody();var B=FCK.EditorDocument;if (!B) return null;var C=FCKConfig.FullPage;var D=FCK.DataProcessor.ConvertToDataFormat(C?B.documentElement:B.body,!C,FCKConfig.IgnoreEmptyParagraphValue,A);D=FCK.ProtectEventsRestore(D);if (FCKBrowserInfo.IsIE) D=D.replace(FCKRegexLib.ToReplace,'$1');if (C){if (FCK.DocTypeDeclaration&&FCK.DocTypeDeclaration.length>0) D=FCK.DocTypeDeclaration+'\n'+D;if (FCK.XmlDeclaration&&FCK.XmlDeclaration.length>0) D=FCK.XmlDeclaration+'\n'+D;};return FCKConfig.ProtectedSource.Revert(D);},UpdateLinkedField:function(){var A=FCK.GetXHTML(FCKConfig.FormatOutput);if (FCKConfig.HtmlEncodeOutput) A=FCKTools.HTMLEncode(A);FCK.LinkedField.value=A;FCK.Events.FireEvent('OnAfterLinkedFieldUpdate');},RegisteredDoubleClickHandlers:{},OnDoubleClick:function(A){var B=FCK.RegisteredDoubleClickHandlers[A.tagName.toUpperCase()];if (B){for (var i=0;i0?'|ABBR|XML|EMBED|OBJECT':'ABBR|XML|EMBED|OBJECT';var C;if (B.length>0){C=new RegExp('<('+B+')(?!\w|:)','gi');A=A.replace(C,'','gi');A=A.replace(C,'<\/FCK:$1>');};B='META';if (FCKBrowserInfo.IsIE) B+='|HR';C=new RegExp('<(('+B+')(?=\\s|>|/)[\\s\\S]*?)/?>','gi');A=A.replace(C,'');return A;},SetData:function(A,B){this.EditingArea.Mode=FCK.EditMode;if (FCKBrowserInfo.IsIE&&FCK.EditorDocument){FCK.EditorDocument.detachEvent("onselectionchange",Doc_OnSelectionChange);};FCKTempBin.Reset();FCK.Selection.Release();if (FCK.EditMode==0){this._ForceResetIsDirty=(B===true);A=FCKConfig.ProtectedSource.Protect(A);A=FCK.DataProcessor.ConvertToHtml(A);A=A.replace(FCKRegexLib.InvalidSelfCloseTags,'$1>');A=FCK.ProtectEvents(A);A=FCK.ProtectUrls(A);A=FCK.ProtectTags(A);if (FCK.TempBaseTag.length>0&&!FCKRegexLib.HasBaseTag.test(A)) A=A.replace(FCKRegexLib.HeadOpener,'$&'+FCK.TempBaseTag);var C='';if (!FCKConfig.FullPage) C+=_FCK_GetEditorAreaStyleTags();if (FCKBrowserInfo.IsIE) C+=FCK._GetBehaviorsStyle();else if (FCKConfig.ShowBorders) C+=FCKTools.GetStyleHtml(FCK_ShowTableBordersCSS,true);C+=FCKTools.GetStyleHtml(FCK_InternalCSS,true);A=A.replace(FCKRegexLib.HeadCloser,C+'$&');this.EditingArea.OnLoad=_FCK_EditingArea_OnLoad;this.EditingArea.Start(A);}else{FCK.EditorWindow=null;FCK.EditorDocument=null;FCKDomTools.PaddingNode=null;this.EditingArea.OnLoad=null;this.EditingArea.Start(A);this.EditingArea.Textarea._FCKShowContextMenu=true;FCK.EnterKeyHandler=null;if (B) this.ResetIsDirty();FCK.KeystrokeHandler.AttachToElement(this.EditingArea.Textarea);this.EditingArea.Textarea.focus();FCK.Events.FireEvent('OnAfterSetHTML');};if (FCKBrowserInfo.IsGecko) window.onresize();},RedirectNamedCommands:{},ExecuteNamedCommand:function(A,B,C,D){if (!D) FCKUndo.SaveUndoStep();if (!C&&FCK.RedirectNamedCommands[A]!=null) FCK.ExecuteRedirectedNamedCommand(A,B);else{FCK.Focus();FCK.EditorDocument.execCommand(A,false,B);FCK.Events.FireEvent('OnSelectionChange');};if (!D) FCKUndo.SaveUndoStep();},GetNamedCommandState:function(A){try{if (FCKBrowserInfo.IsSafari&&FCK.EditorWindow&&A.IEquals('Paste')) return 0;if (!FCK.EditorDocument.queryCommandEnabled(A)) return -1;else{return FCK.EditorDocument.queryCommandState(A)?1:0;}}catch (e){return 0;}},GetNamedCommandValue:function(A){var B='';var C=FCK.GetNamedCommandState(A);if (C==-1) return null;try{B=this.EditorDocument.queryCommandValue(A);}catch(e) {};return B?B:'';},Paste:function(A){if (FCK.Status!=2||!FCK.Events.FireEvent('OnPaste')) return false;return A||FCK._ExecPaste();},PasteFromWord:function(){FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.PasteFromWord,'dialog/fck_paste.html',400,330,'Word');},Preview:function(){var A;if (FCKConfig.FullPage){if (FCK.TempBaseTag.length>0) A=FCK.TempBaseTag+FCK.GetXHTML();else A=FCK.GetXHTML();}else{A=FCKConfig.DocType+''+FCK.TempBaseTag+''+FCKLang.Preview+''+_FCK_GetEditorAreaStyleTags()+''+FCK.GetXHTML()+'';};var B=FCKConfig.ScreenWidth*0.8;var C=FCKConfig.ScreenHeight*0.7;var D=(FCKConfig.ScreenWidth-B)/2;var E='';if (FCK_IS_CUSTOM_DOMAIN&&FCKBrowserInfo.IsIE){window._FCKHtmlToLoad=A;E='javascript:void( (function(){document.open() ;document.domain="'+document.domain+'" ;document.write( window.opener._FCKHtmlToLoad );document.close() ;window.opener._FCKHtmlToLoad = null ;})() )';};var F=window.open(E,null,'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+B+',height='+C+',left='+D);if (!FCK_IS_CUSTOM_DOMAIN||!FCKBrowserInfo.IsIE){F.document.write(A);F.document.close();}},SwitchEditMode:function(A){var B=(FCK.EditMode==0);var C=FCK.IsDirty();var D;if (B){FCKCommands.GetCommand('ShowBlocks').SaveState();if (!A&&FCKBrowserInfo.IsIE) FCKUndo.SaveUndoStep();D=FCK.GetXHTML(FCKConfig.FormatSource);if (FCKBrowserInfo.IsIE) FCKTempBin.ToHtml();if (D==null) return false;}else D=this.EditingArea.Textarea.value;FCK.EditMode=B?1:0;FCK.SetData(D,!C);FCK.Focus();FCKTools.RunFunction(FCK.ToolbarSet.RefreshModeState,FCK.ToolbarSet);return true;},InsertElement:function(A){if (typeof A=='string') A=this.EditorDocument.createElement(A);var B=A.nodeName.toLowerCase();FCKSelection.Restore();var C=new FCKDomRange(this.EditorWindow);C.MoveToSelection();C.DeleteContents();if (FCKListsLib.BlockElements[B]!=null){if (C.StartBlock){if (C.CheckStartOfBlock()) C.MoveToPosition(C.StartBlock,3);else if (C.CheckEndOfBlock()) C.MoveToPosition(C.StartBlock,4);else C.SplitBlock();};C.InsertNode(A);var D=FCKDomTools.GetNextSourceElement(A,false,null,['hr','br','param','img','area','input'],true);if (!D&&FCKConfig.EnterMode!='br'){D=this.EditorDocument.body.appendChild(this.EditorDocument.createElement(FCKConfig.EnterMode));if (FCKBrowserInfo.IsGeckoLike) FCKTools.AppendBogusBr(D);};if (FCKListsLib.EmptyElements[B]==null) C.MoveToElementEditStart(A);else if (D) C.MoveToElementEditStart(D);else C.MoveToPosition(A,4);if (FCKBrowserInfo.IsGeckoLike){if (D) FCKDomTools.ScrollIntoView(D,false);FCKDomTools.ScrollIntoView(A,false);}}else{C.InsertNode(A);C.SetStart(A,4);C.SetEnd(A,4);};C.Select();C.Release();this.Focus();return A;},_InsertBlockElement:function(A){},_IsFunctionKey:function(A){if (A>=16&&A<=20) return true;if (A==27||(A>=33&&A<=40)) return true;if (A==45) return true;return false;},_KeyDownListener:function(A){if (!A) A=FCK.EditorWindow.event;if (FCK.EditorWindow){if (!FCK._IsFunctionKey(A.keyCode)&&!(A.ctrlKey||A.metaKey)&&!(A.keyCode==46)) FCK._KeyDownUndo();};return true;},_KeyDownUndo:function(){if (!FCKUndo.Typing){FCKUndo.SaveUndoStep();FCKUndo.Typing=true;FCK.Events.FireEvent("OnSelectionChange");};FCKUndo.TypesCount++;FCKUndo.Changed=1;if (FCKUndo.TypesCount>FCKUndo.MaxTypes){FCKUndo.TypesCount=0;FCKUndo.SaveUndoStep();}},_TabKeyHandler:function(A){if (!A) A=window.event;var B=A.keyCode;if (B==9&&FCK.EditMode!=0){if (FCKBrowserInfo.IsIE){var C=document.selection.createRange();if (C.parentElement()!=FCK.EditingArea.Textarea) return true;C.text='\t';C.select();}else{var a=[];var D=FCK.EditingArea.Textarea;var E=D.selectionStart;var F=D.selectionEnd;a.push(D.value.substr(0,E));a.push('\t');a.push(D.value.substr(F));D.value=a.join('');D.setSelectionRange(E+1,E+1);};if (A.preventDefault) return A.preventDefault();return A.returnValue=false;};return true;}};FCK.Events=new FCKEvents(FCK);FCK.GetHTML=FCK.GetXHTML=FCK.GetData;FCK.SetHTML=FCK.SetData;FCK.InsertElementAndGetIt=FCK.CreateElement=FCK.InsertElement;function _FCK_ProtectEvents_ReplaceTags(A){return A.replace(FCKRegexLib.EventAttributes,_FCK_ProtectEvents_ReplaceEvents);};function _FCK_ProtectEvents_ReplaceEvents(A,B){return ' '+B+'_fckprotectedatt="'+encodeURIComponent(A)+'"';};function _FCK_ProtectEvents_RestoreEvents(A,B){return decodeURIComponent(B);};function _FCK_MouseEventsListener(A){if (!A) A=window.event;if (A.type=='mousedown') FCK.MouseDownFlag=true;else if (A.type=='mouseup') FCK.MouseDownFlag=false;else if (A.type=='mousemove') FCK.Events.FireEvent('OnMouseMove',A);};function _FCK_PaddingNodeListener(){if (FCKConfig.EnterMode.IEquals('br')) return;FCKDomTools.EnforcePaddingNode(FCK.EditorDocument,FCKConfig.EnterMode);if (!FCKBrowserInfo.IsIE&&FCKDomTools.PaddingNode){var A=FCKSelection.GetSelection();if (A&&A.rangeCount==1){var B=A.getRangeAt(0);if (B.collapsed&&B.startContainer==FCK.EditorDocument.body&&B.startOffset==0){B.selectNodeContents(FCKDomTools.PaddingNode);B.collapse(true);A.removeAllRanges();A.addRange(B);}}}else if (FCKDomTools.PaddingNode){var C=FCKSelection.GetParentElement();var D=FCKDomTools.PaddingNode;if (C&&C.nodeName.IEquals('body')){if (FCK.EditorDocument.body.childNodes.length==1&&FCK.EditorDocument.body.firstChild==D){if (FCKSelection._GetSelectionDocument(FCK.EditorDocument.selection)!=FCK.EditorDocument) return;var B=FCK.EditorDocument.body.createTextRange();var F=false;if (!D.childNodes.firstChild){D.appendChild(FCKTools.GetElementDocument(D).createTextNode('\ufeff'));F=true;};B.moveToElementText(D);B.select();if (F) B.pasteHTML('');}}}};function _FCK_EditingArea_OnLoad(){FCK.EditorWindow=FCK.EditingArea.Window;FCK.EditorDocument=FCK.EditingArea.Document;if (FCKBrowserInfo.IsIE) FCKTempBin.ToElements();FCK.InitializeBehaviors();FCK.MouseDownFlag=false;FCKTools.AddEventListener(FCK.EditorDocument,'mousemove',_FCK_MouseEventsListener);FCKTools.AddEventListener(FCK.EditorDocument,'mousedown',_FCK_MouseEventsListener);FCKTools.AddEventListener(FCK.EditorDocument,'mouseup',_FCK_MouseEventsListener);if (FCKBrowserInfo.IsSafari){FCKTools.AddEventListener(FCK.EditorDocument,'paste',function(evt){var A=new FCKDomRange(FCK.EditorWindow);var B=FCK.EditorDocument.createTextNode('\ufeff');var C=FCK.EditorDocument.createElement('a');C.id='fck_paste_padding';C.innerHTML='';A.MoveToSelection();A.DeleteContents();A.InsertNode(B);A.Collapse();A.InsertNode(C);A.MoveToPosition(C,3);A.Select();setTimeout(function(){B.parentNode.removeChild(B);C=FCK.EditorDocument.getElementById('fck_paste_padding');C.parentNode.removeChild(C);},0);});};if (FCKBrowserInfo.IsSafari){var A=function(evt){if (!(evt.ctrlKey||evt.metaKey)) return;if (FCK.EditMode!=0) return;switch (evt.keyCode){case 89:FCKUndo.Redo();break;case 90:FCKUndo.Undo();break;}};FCKTools.AddEventListener(FCK.EditorDocument,'keyup',A);};FCK.EnterKeyHandler=new FCKEnterKey(FCK.EditorWindow,FCKConfig.EnterMode,FCKConfig.ShiftEnterMode,FCKConfig.TabSpaces);FCK.KeystrokeHandler.AttachToElement(FCK.EditorDocument);if (FCK._ForceResetIsDirty) FCK.ResetIsDirty();if (FCKBrowserInfo.IsIE&&FCK.HasFocus) FCK.EditorDocument.body.setActive();FCK.OnAfterSetHTML();FCKCommands.GetCommand('ShowBlocks').RestoreState();if (FCK.Status!=0) return;FCK.SetStatus(1);};function _FCK_GetEditorAreaStyleTags(){return FCKTools.GetStyleHtml(FCKConfig.EditorAreaCSS)+FCKTools.GetStyleHtml(FCKConfig.EditorAreaStyles);};function _FCK_KeystrokeHandler_OnKeystroke(A,B){if (FCK.Status!=2) return false;if (FCK.EditMode==0){switch (B){case 'Paste':return!FCK.Paste();case 'Cut':FCKUndo.SaveUndoStep();return false;}}else{if (B.Equals('Paste','Undo','Redo','SelectAll','Cut')) return false;};var C=FCK.Commands.GetCommand(B);if (C.GetState()==-1) return false;return (C.Execute.apply(C,FCKTools.ArgumentsToArray(arguments,2))!==false);};(function(){var A=window.parent.document;var B=A.getElementById(FCK.Name);var i=0;while (B||i==0){if (B&&B.tagName.toLowerCase().Equals('input','textarea')){FCK.LinkedField=B;break;};B=A.getElementsByName(FCK.Name)[i++];}})();var FCKTempBin={Elements:[],AddElement:function(A){var B=this.Elements.length;this.Elements[B]=A;return B;},RemoveElement:function(A){var e=this.Elements[A];this.Elements[A]=null;return e;},Reset:function(){var i=0;while (i '+this.Elements[i].outerHTML+'';this.Elements[i].isHtml=true;}},ToElements:function(){var A=FCK.EditorDocument.createElement('div');for (var i=0;i0) C+='TABLE { behavior: '+B+' ; }';C+='';FCK._BehaviorsStyle=C;};return FCK._BehaviorsStyle;};function Doc_OnMouseUp(){if (FCK.EditorWindow.event.srcElement.tagName=='HTML'){FCK.Focus();FCK.EditorWindow.event.cancelBubble=true;FCK.EditorWindow.event.returnValue=false;}};function Doc_OnPaste(){var A=FCK.EditorDocument.body;A.detachEvent('onpaste',Doc_OnPaste);var B=FCK.Paste(!FCKConfig.ForcePasteAsPlainText&&!FCKConfig.AutoDetectPasteFromWord);A.attachEvent('onpaste',Doc_OnPaste);return B;};function Doc_OnDblClick(){FCK.OnDoubleClick(FCK.EditorWindow.event.srcElement);FCK.EditorWindow.event.cancelBubble=true;};function Doc_OnSelectionChange(){if (!FCK.IsSelectionChangeLocked&&FCK.EditorDocument) FCK.Events.FireEvent("OnSelectionChange");};function Doc_OnDrop(){if (FCK.MouseDownFlag){FCK.MouseDownFlag=false;return;};if (FCKConfig.ForcePasteAsPlainText){var A=FCK.EditorWindow.event;if (FCK._CheckIsPastingEnabled()||FCKConfig.ShowDropDialog) FCK.PasteAsPlainText(A.dataTransfer.getData('Text'));A.returnValue=false;A.cancelBubble=true;}};FCK.InitializeBehaviors=function(A){this.EditorDocument.attachEvent('onmouseup',Doc_OnMouseUp);this.EditorDocument.body.attachEvent('onpaste',Doc_OnPaste);this.EditorDocument.body.attachEvent('ondrop',Doc_OnDrop);FCK.ContextMenu._InnerContextMenu.AttachToElement(FCK.EditorDocument.body);this.EditorDocument.attachEvent("onkeydown",FCK._KeyDownListener);this.EditorDocument.attachEvent("ondblclick",Doc_OnDblClick);this.EditorDocument.attachEvent("onbeforedeactivate",function(){ FCKSelection.Save();});this.EditorDocument.attachEvent("onselectionchange",Doc_OnSelectionChange);FCKTools.AddEventListener(FCK.EditorDocument,'mousedown',Doc_OnMouseDown);};FCK.InsertHtml=function(A){A=FCKConfig.ProtectedSource.Protect(A);A=FCK.ProtectEvents(A);A=FCK.ProtectUrls(A);A=FCK.ProtectTags(A);FCKSelection.Restore();FCK.EditorWindow.focus();FCKUndo.SaveUndoStep();var B=FCKSelection.GetSelection();if (B.type.toLowerCase()=='control') B.clear();A=''+A;B.createRange().pasteHTML(A);var C=FCK.EditorDocument.getElementById('__fakeFCKRemove__');if (C.parentNode.childNodes.length==1) C=C.parentNode;C.removeNode(true);FCKDocumentProcessor.Process(FCK.EditorDocument);this.Events.FireEvent("OnSelectionChange");};FCK.SetInnerHtml=function(A){var B=FCK.EditorDocument;B.body.innerHTML='
     
    '+A;B.getElementById('__fakeFCKRemove__').removeNode(true);};function FCK_PreloadImages(){var A=new FCKImagePreloader();A.AddImages(FCKConfig.PreloadImages);A.AddImages(FCKConfig.SkinPath+'fck_strip.gif');A.OnComplete=LoadToolbarSetup;A.Start();};function Document_OnContextMenu(){return (event.srcElement._FCKShowContextMenu==true);};document.oncontextmenu=Document_OnContextMenu;function FCK_Cleanup(){this.LinkedField=null;this.EditorWindow=null;this.EditorDocument=null;};FCK._ExecPaste=function(){if (FCK._PasteIsRunning) return true;if (FCKConfig.ForcePasteAsPlainText){FCK.PasteAsPlainText();return false;};var A=FCK._CheckIsPastingEnabled(true);if (A===false) FCKTools.RunFunction(FCKDialog.OpenDialog,FCKDialog,['FCKDialog_Paste',FCKLang.Paste,'dialog/fck_paste.html',400,330,'Security']);else{if (FCKConfig.AutoDetectPasteFromWord&&A.length>0){var B=/<\w[^>]*(( class="?MsoNormal"?)|(="mso-))/gi;if (B.test(A)){if (confirm(FCKLang.PasteWordConfirm)){FCK.PasteFromWord();return false;}}};FCK._PasteIsRunning=true;FCK.ExecuteNamedCommand('Paste');delete FCK._PasteIsRunning;};return false;};FCK.PasteAsPlainText=function(A){if (!FCK._CheckIsPastingEnabled()){FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.PasteAsText,'dialog/fck_paste.html',400,330,'PlainText');return;};var B=null;if (!A) B=clipboardData.getData("Text");else B=A;if (B&&B.length>0){B=FCKTools.HTMLEncode(B);B=FCKTools.ProcessLineBreaks(window,FCKConfig,B);var C=B.search('

    ');var D=B.search('

    ');if ((C!=-1&&D!=-1&&C0){if (FCKSelection.GetType()=='Control'){var D=this.EditorDocument.createElement('A');D.href=A;var E=FCKSelection.GetSelectedElement();E.parentNode.insertBefore(D,E);E.parentNode.removeChild(E);D.appendChild(E);return [D];};var F='javascript:void(0);/*'+(new Date().getTime())+'*/';FCK.ExecuteNamedCommand('CreateLink',F,false,!!B);var G=this.EditorDocument.links;for (i=0;i0&&!isNaN(E)) this.PageConfig[D]=parseFloat(E);else this.PageConfig[D]=E;}};function FCKConfig_LoadPageConfig(){var A=FCKConfig.PageConfig;for (var B in A) FCKConfig[B]=A[B];};function FCKConfig_PreProcess(){var A=FCKConfig;if (A.AllowQueryStringDebug){try{if ((/fckdebug=true/i).test(window.top.location.search)) A.Debug=true;}catch (e) { }};if (!A.PluginsPath.EndsWith('/')) A.PluginsPath+='/';var B=A.ToolbarComboPreviewCSS;if (!B||B.length==0) A.ToolbarComboPreviewCSS=A.EditorAreaCSS;A.RemoveAttributesArray=(A.RemoveAttributes||'').split(',');if (!FCKConfig.SkinEditorCSS||FCKConfig.SkinEditorCSS.length==0) FCKConfig.SkinEditorCSS=FCKConfig.SkinPath+'fck_editor.css';if (!FCKConfig.SkinDialogCSS||FCKConfig.SkinDialogCSS.length==0) FCKConfig.SkinDialogCSS=FCKConfig.SkinPath+'fck_dialog.css';};FCKConfig.ToolbarSets={};FCKConfig.Plugins={};FCKConfig.Plugins.Items=[];FCKConfig.Plugins.Add=function(A,B,C){FCKConfig.Plugins.Items.push([A,B,C]);};FCKConfig.ProtectedSource={};FCKConfig.ProtectedSource._CodeTag=(new Date()).valueOf();FCKConfig.ProtectedSource.RegexEntries=[//g,//gi,//gi];FCKConfig.ProtectedSource.Add=function(A){this.RegexEntries.push(A);};FCKConfig.ProtectedSource.Protect=function(A){var B=this._CodeTag;function _Replace(protectedSource){var C=FCKTempBin.AddElement(protectedSource);return '';};for (var i=0;i|>)","g");return A.replace(D,_Replace);};FCKConfig.GetBodyAttributes=function(){var A='';if (this.BodyId&&this.BodyId.length>0) A+=' id="'+this.BodyId+'"';if (this.BodyClass&&this.BodyClass.length>0) A+=' class="'+this.BodyClass+'"';return A;};FCKConfig.ApplyBodyAttributes=function(A){if (this.BodyId&&this.BodyId.length>0) A.id=FCKConfig.BodyId;if (this.BodyClass&&this.BodyClass.length>0) A.className+=' '+FCKConfig.BodyClass;}; var FCKDebug={Output:function(){},OutputObject:function(){}}; From 8bb18f8693a8600c8719b05984aa815446a619db Mon Sep 17 00:00:00 2001 From: Ivan Tcholakov Date: Wed, 29 Jul 2009 00:01:57 +0200 Subject: [PATCH 16/56] [svn r22428] FS#2867 - The online editor: Updating some language files. --- main/inc/lib/fckeditor/editor/lang/_translationstatus.txt | 4 ++-- main/inc/lib/fckeditor/editor/lang/ko.js | 2 +- main/inc/lib/fckeditor/editor/lang/pl.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/main/inc/lib/fckeditor/editor/lang/_translationstatus.txt b/main/inc/lib/fckeditor/editor/lang/_translationstatus.txt index 15b3bcf175..6b9072d2de 100644 --- a/main/inc/lib/fckeditor/editor/lang/_translationstatus.txt +++ b/main/inc/lib/fckeditor/editor/lang/_translationstatus.txt @@ -53,7 +53,7 @@ is.js Found: 428 Missing: 0 it.js Found: 410 Missing: 18 ja.js Found: 420 Missing: 8 km.js Found: 370 Missing: 58 -ko.js Found: 390 Missing: 38 +ko.js Found: 391 Missing: 37 lt.js Found: 428 Missing: 0 lv.js Found: 381 Missing: 47 mn.js Found: 411 Missing: 17 @@ -61,7 +61,7 @@ ms.js Found: 352 Missing: 76 nb.js Found: 414 Missing: 14 nl.js Found: 420 Missing: 8 no.js Found: 414 Missing: 14 -pl.js Found: 411 Missing: 17 +pl.js Found: 412 Missing: 16 pt-br.js Found: 411 Missing: 17 pt.js Found: 381 Missing: 47 ro.js Found: 410 Missing: 18 diff --git a/main/inc/lib/fckeditor/editor/lang/ko.js b/main/inc/lib/fckeditor/editor/lang/ko.js index a5d2e0ce59..7c9eb8e679 100644 --- a/main/inc/lib/fckeditor/editor/lang/ko.js +++ b/main/inc/lib/fckeditor/editor/lang/ko.js @@ -307,7 +307,7 @@ DlgTableHeight : "높이", DlgTableCellSpace : "셀 간격", DlgTableCellPad : "셀 여백", DlgTableCaption : "캡션", -DlgTableSummary : "Summary", //MISSING +DlgTableSummary : "요약", DlgTableHeaders : "Headers", //MISSING DlgTableHeadersNone : "None", //MISSING DlgTableHeadersColumn : "First column", //MISSING diff --git a/main/inc/lib/fckeditor/editor/lang/pl.js b/main/inc/lib/fckeditor/editor/lang/pl.js index de1bc3bd59..75e5de9efb 100644 --- a/main/inc/lib/fckeditor/editor/lang/pl.js +++ b/main/inc/lib/fckeditor/editor/lang/pl.js @@ -308,7 +308,7 @@ DlgTableCellSpace : "Odstęp pomiędzy komórkami", DlgTableCellPad : "Margines wewnętrzny komórek", DlgTableCaption : "Tytuł", DlgTableSummary : "Podsumowanie", -DlgTableHeaders : "Headers", //MISSING +DlgTableHeaders : "Nagłówki", DlgTableHeadersNone : "None", //MISSING DlgTableHeadersColumn : "First column", //MISSING DlgTableHeadersRow : "First Row", //MISSING @@ -512,7 +512,7 @@ DlgDocMeCopy : "Prawa autorskie", DlgDocPreview : "Podgląd", // Templates Dialog -Templates : "Sablony", +Templates : "Szablony", DlgTemplatesTitle : "Szablony zawartości", DlgTemplatesSelMsg : "Wybierz szablon do otwarcia w edytorze
    (obecna zawartość okna edytora zostanie utracona):", DlgTemplatesLoading : "Ładowanie listy szablonów. Proszę czekać...", From f58133b575c11de5305880efbc7e1b35dc7c4cca Mon Sep 17 00:00:00 2001 From: Ivan Tcholakov Date: Wed, 29 Jul 2009 00:32:32 +0200 Subject: [PATCH 17/56] [svn r22429] FS#2867 - The online editor: Implementing 2.6.5 SVN patch, ticket #3677 - http://dev.fckeditor.net/ticket/3677 . --- documentation/changelog.html | 2 +- .../lib/fckeditor/editor/_source/internals/fck_ie.js | 11 ++++++++--- main/inc/lib/fckeditor/editor/js/fckeditorcode_ie.js | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/documentation/changelog.html b/documentation/changelog.html index 8fb46a4bc5..0f07414a44 100644 --- a/documentation/changelog.html +++ b/documentation/changelog.html @@ -34,7 +34,7 @@

  • The installation sript: The page about system requilements has been updated. Also, at the very beginning, a check has been added whether the mbstring php-extension is installed - see the related forum topic. (FS#306)
  • A new php-based configuration for the online editor has been implemented, see dokeos/main/inc/lib/fckeditor/myconfig.php. Also, toolbar definitions have been split in separate php-files within the directory dokeos/main/inc/lib/fckeditor/toolbars/ . Customization of the editor is more convenient and flexible now. (FS#2867)
  • Online editor: A upgrade from FCKEditor 2.6.4 to FCKEditor 2.6.4.1 has been implemented. (FS#4383)
  • -
  • Online editor: Several known bug-fixes from FCKEditor 2.6.5 SVN have been implemented, tickets #1537, #2156, #2689, #2821, #2856, #2874, #2915, #3120, #3181, #3429, #3439, #3446, #3481, #3880. (FS#2867)
  • +
  • Online editor: Several known bug-fixes from FCKEditor 2.6.5 SVN have been implemented, tickets #1537, #2156, #2689, #2821, #2856, #2874, #2915, #3120, #3181, #3429, #3439, #3446, #3481, #3677, #3880. (FS#2867)
  • Online editor: The simple file manager, the advanced file manager and the image manager have been integrated by default with the editor's dialog system. Thus, they work faster and in a more secure way. (FS#2867)
  • Online editor: Blocking copy/paste for trainees has been added. The feature is configurable through editing the toolbar definition files within the directory dokeos/main/inc/lib/fckeditor/toolbars/ . (FS#2867)
  • Online editor: Preview tabs have been added to the dialogs for inserting video, flv-video, and YouTube video. (FS#2867)
  • diff --git a/main/inc/lib/fckeditor/editor/_source/internals/fck_ie.js b/main/inc/lib/fckeditor/editor/_source/internals/fck_ie.js index 430463c8e5..5ac7fa17b3 100644 --- a/main/inc/lib/fckeditor/editor/_source/internals/fck_ie.js +++ b/main/inc/lib/fckeditor/editor/_source/internals/fck_ie.js @@ -378,22 +378,27 @@ FCK.CreateLink = function( url, noUndo ) { // Creates the array that will be returned. It contains one or more created links (see #220). var aCreatedLinks = new Array() ; + var isControl = FCKSelection.GetType() == 'Control' ; + var selectedElement = isControl && FCKSelection.GetSelectedElement() ; // Remove any existing link in the selection. - FCK.ExecuteNamedCommand( 'Unlink', null, false, !!noUndo ) ; + // IE BUG: Unlinking a floating control selection that is not inside a link + // will collapse the selection. (#3677) + if ( !( isControl && !FCKTools.GetElementAscensor( selectedElement, 'a' ) ) ) + FCK.ExecuteNamedCommand( 'Unlink', null, false, !!noUndo ) ; if ( url.length > 0 ) { // If there are several images, and you try to link each one, all the images get inside the link: // -> -> due to the call to 'CreateLink' (bug in IE) - if (FCKSelection.GetType() == 'Control') + if ( isControl ) { // Create a link var oLink = this.EditorDocument.createElement( 'A' ) ; oLink.href = url ; // Get the selected object - var oControl = FCKSelection.GetSelectedElement() ; + var oControl = selectedElement ; // Put the link just before the object oControl.parentNode.insertBefore(oLink, oControl) ; // Move the object inside the link diff --git a/main/inc/lib/fckeditor/editor/js/fckeditorcode_ie.js b/main/inc/lib/fckeditor/editor/js/fckeditorcode_ie.js index a8e8a9019e..9a87cb7566 100644 --- a/main/inc/lib/fckeditor/editor/js/fckeditorcode_ie.js +++ b/main/inc/lib/fckeditor/editor/js/fckeditorcode_ie.js @@ -30,7 +30,7 @@ var FCKURLParams={};(function(){var A=document.location.search.substr(1).split(' var FCKEvents=function(A){this.Owner=A;this._RegisteredEvents={};};FCKEvents.prototype.AttachEvent=function(A,B){var C;if (!(C=this._RegisteredEvents[A])) this._RegisteredEvents[A]=[B];else{if (C.IndexOf(B)==-1) C.push(B);}};FCKEvents.prototype.FireEvent=function(A,B){var C=true;var D=this._RegisteredEvents[A];if (D){for (var i=0;i';if (!FCKRegexLib.HtmlOpener.test(A)) A=''+A+'';if (!FCKRegexLib.HeadOpener.test(A)) A=A.replace(FCKRegexLib.HtmlOpener,'$&');return A;}else{var B=FCKConfig.DocType+'0&&!FCKRegexLib.Html4DocType.test(FCKConfig.DocType)) B+=' style="overflow-y: scroll"';B+='>'+A+'';return B;}},ConvertToDataFormat:function(A,B,C,D){var E=FCKXHtml.GetXHTML(A,!B,D);if (C&&FCKRegexLib.EmptyOutParagraph.test(E)) return '';return E;},FixHtml:function(A){return A;}}; var FCK={Name:FCKURLParams['InstanceName'],Status:0,EditMode:0,Toolbar:null,HasFocus:false,DataProcessor:new FCKDataProcessor(),GetInstanceObject:(function(){var w=window;return function(name){return w[name];}})(),AttachToOnSelectionChange:function(A){this.Events.AttachEvent('OnSelectionChange',A);},GetLinkedFieldValue:function(){return this.LinkedField.value;},GetParentForm:function(){return this.LinkedField.form;},StartupValue:'',IsDirty:function(){if (this.EditMode==1) return (this.StartupValue!=this.EditingArea.Textarea.value);else{if (!this.EditorDocument) return false;return (this.StartupValue!=this.EditorDocument.body.innerHTML);}},ResetIsDirty:function(){if (this.EditMode==1) this.StartupValue=this.EditingArea.Textarea.value;else if (this.EditorDocument.body) this.StartupValue=this.EditorDocument.body.innerHTML;},StartEditor:function(){this.TempBaseTag=FCKConfig.BaseHref.length>0?'':'';var A=FCK.KeystrokeHandler=new FCKKeystrokeHandler();A.OnKeystroke=_FCK_KeystrokeHandler_OnKeystroke;A.SetKeystrokes(FCKConfig.Keystrokes);if (FCKBrowserInfo.IsIE7){if ((CTRL+86) in A.Keystrokes) A.SetKeystrokes([CTRL+86,true]);if ((SHIFT+45) in A.Keystrokes) A.SetKeystrokes([SHIFT+45,true]);};A.SetKeystrokes([CTRL+8,true]);this.EditingArea=new FCKEditingArea(document.getElementById('xEditingArea'));this.EditingArea.FFSpellChecker=FCKConfig.FirefoxSpellChecker;this.SetData(this.GetLinkedFieldValue(),true);FCKTools.AddEventListener(document,"keydown",this._TabKeyHandler);this.AttachToOnSelectionChange(_FCK_PaddingNodeListener);if (FCKBrowserInfo.IsGecko) this.AttachToOnSelectionChange(this._ExecCheckEmptyBlock);},Focus:function(){FCK.EditingArea.Focus();},SetStatus:function(A){this.Status=A;if (A==1){FCKFocusManager.AddWindow(window,true);if (FCKBrowserInfo.IsIE) FCKFocusManager.AddWindow(window.frameElement,true);if (FCKConfig.StartupFocus) FCK.Focus();};this.Events.FireEvent('OnStatusChange',A);},FixBody:function(){var A=FCKConfig.EnterMode;if (A!='p'&&A!='div') return;var B=this.EditorDocument;if (!B) return;var C=B.body;if (!C) return;FCKDomTools.TrimNode(C);var D=C.firstChild;var E;while (D){var F=false;switch (D.nodeType){case 1:var G=D.nodeName.toLowerCase();if (!FCKListsLib.BlockElements[G]&&G!='li'&&!D.getAttribute('_fckfakelement')&&D.getAttribute('_moz_dirty')==null) F=true;break;case 3:if (E||D.nodeValue.Trim().length>0) F=true;break;case 8:if (E) F=true;break;};if (F){var H=D.parentNode;if (!E) E=H.insertBefore(B.createElement(A),D);E.appendChild(H.removeChild(D));D=E.nextSibling;}else{if (E){FCKDomTools.TrimNode(E);E=null;};D=D.nextSibling;}};if (E) FCKDomTools.TrimNode(E);},GetData:function(A){if (FCK.EditMode==1) return FCK.EditingArea.Textarea.value;this.FixBody();var B=FCK.EditorDocument;if (!B) return null;var C=FCKConfig.FullPage;var D=FCK.DataProcessor.ConvertToDataFormat(C?B.documentElement:B.body,!C,FCKConfig.IgnoreEmptyParagraphValue,A);D=FCK.ProtectEventsRestore(D);if (FCKBrowserInfo.IsIE) D=D.replace(FCKRegexLib.ToReplace,'$1');if (C){if (FCK.DocTypeDeclaration&&FCK.DocTypeDeclaration.length>0) D=FCK.DocTypeDeclaration+'\n'+D;if (FCK.XmlDeclaration&&FCK.XmlDeclaration.length>0) D=FCK.XmlDeclaration+'\n'+D;};return FCKConfig.ProtectedSource.Revert(D);},UpdateLinkedField:function(){var A=FCK.GetXHTML(FCKConfig.FormatOutput);if (FCKConfig.HtmlEncodeOutput) A=FCKTools.HTMLEncode(A);FCK.LinkedField.value=A;FCK.Events.FireEvent('OnAfterLinkedFieldUpdate');},RegisteredDoubleClickHandlers:{},OnDoubleClick:function(A){var B=FCK.RegisteredDoubleClickHandlers[A.tagName.toUpperCase()];if (B){for (var i=0;i0?'|ABBR|XML|EMBED|OBJECT':'ABBR|XML|EMBED|OBJECT';var C;if (B.length>0){C=new RegExp('<('+B+')(?!\w|:)','gi');A=A.replace(C,'','gi');A=A.replace(C,'<\/FCK:$1>');};B='META';if (FCKBrowserInfo.IsIE) B+='|HR';C=new RegExp('<(('+B+')(?=\\s|>|/)[\\s\\S]*?)/?>','gi');A=A.replace(C,'');return A;},SetData:function(A,B){this.EditingArea.Mode=FCK.EditMode;if (FCKBrowserInfo.IsIE&&FCK.EditorDocument){FCK.EditorDocument.detachEvent("onselectionchange",Doc_OnSelectionChange);};FCKTempBin.Reset();FCK.Selection.Release();if (FCK.EditMode==0){this._ForceResetIsDirty=(B===true);A=FCKConfig.ProtectedSource.Protect(A);A=FCK.DataProcessor.ConvertToHtml(A);A=A.replace(FCKRegexLib.InvalidSelfCloseTags,'$1>');A=FCK.ProtectEvents(A);A=FCK.ProtectUrls(A);A=FCK.ProtectTags(A);if (FCK.TempBaseTag.length>0&&!FCKRegexLib.HasBaseTag.test(A)) A=A.replace(FCKRegexLib.HeadOpener,'$&'+FCK.TempBaseTag);var C='';if (!FCKConfig.FullPage) C+=_FCK_GetEditorAreaStyleTags();if (FCKBrowserInfo.IsIE) C+=FCK._GetBehaviorsStyle();else if (FCKConfig.ShowBorders) C+=FCKTools.GetStyleHtml(FCK_ShowTableBordersCSS,true);C+=FCKTools.GetStyleHtml(FCK_InternalCSS,true);A=A.replace(FCKRegexLib.HeadCloser,C+'$&');this.EditingArea.OnLoad=_FCK_EditingArea_OnLoad;this.EditingArea.Start(A);}else{FCK.EditorWindow=null;FCK.EditorDocument=null;FCKDomTools.PaddingNode=null;this.EditingArea.OnLoad=null;this.EditingArea.Start(A);this.EditingArea.Textarea._FCKShowContextMenu=true;FCK.EnterKeyHandler=null;if (B) this.ResetIsDirty();FCK.KeystrokeHandler.AttachToElement(this.EditingArea.Textarea);this.EditingArea.Textarea.focus();FCK.Events.FireEvent('OnAfterSetHTML');};if (FCKBrowserInfo.IsGecko) window.onresize();},RedirectNamedCommands:{},ExecuteNamedCommand:function(A,B,C,D){if (!D) FCKUndo.SaveUndoStep();if (!C&&FCK.RedirectNamedCommands[A]!=null) FCK.ExecuteRedirectedNamedCommand(A,B);else{FCK.Focus();FCK.EditorDocument.execCommand(A,false,B);FCK.Events.FireEvent('OnSelectionChange');};if (!D) FCKUndo.SaveUndoStep();},GetNamedCommandState:function(A){try{if (FCKBrowserInfo.IsSafari&&FCK.EditorWindow&&A.IEquals('Paste')) return 0;if (!FCK.EditorDocument.queryCommandEnabled(A)) return -1;else{return FCK.EditorDocument.queryCommandState(A)?1:0;}}catch (e){return 0;}},GetNamedCommandValue:function(A){var B='';var C=FCK.GetNamedCommandState(A);if (C==-1) return null;try{B=this.EditorDocument.queryCommandValue(A);}catch(e) {};return B?B:'';},Paste:function(A){if (FCK.Status!=2||!FCK.Events.FireEvent('OnPaste')) return false;return A||FCK._ExecPaste();},PasteFromWord:function(){FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.PasteFromWord,'dialog/fck_paste.html',400,330,'Word');},Preview:function(){var A;if (FCKConfig.FullPage){if (FCK.TempBaseTag.length>0) A=FCK.TempBaseTag+FCK.GetXHTML();else A=FCK.GetXHTML();}else{A=FCKConfig.DocType+''+FCK.TempBaseTag+''+FCKLang.Preview+''+_FCK_GetEditorAreaStyleTags()+''+FCK.GetXHTML()+'';};var B=FCKConfig.ScreenWidth*0.8;var C=FCKConfig.ScreenHeight*0.7;var D=(FCKConfig.ScreenWidth-B)/2;var E='';if (FCK_IS_CUSTOM_DOMAIN&&FCKBrowserInfo.IsIE){window._FCKHtmlToLoad=A;E='javascript:void( (function(){document.open() ;document.domain="'+document.domain+'" ;document.write( window.opener._FCKHtmlToLoad );document.close() ;window.opener._FCKHtmlToLoad = null ;})() )';};var F=window.open(E,null,'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+B+',height='+C+',left='+D);if (!FCK_IS_CUSTOM_DOMAIN||!FCKBrowserInfo.IsIE){F.document.write(A);F.document.close();}},SwitchEditMode:function(A){var B=(FCK.EditMode==0);var C=FCK.IsDirty();var D;if (B){FCKCommands.GetCommand('ShowBlocks').SaveState();if (!A&&FCKBrowserInfo.IsIE) FCKUndo.SaveUndoStep();D=FCK.GetXHTML(FCKConfig.FormatSource);if (FCKBrowserInfo.IsIE) FCKTempBin.ToHtml();if (D==null) return false;}else D=this.EditingArea.Textarea.value;FCK.EditMode=B?1:0;FCK.SetData(D,!C);FCK.Focus();FCKTools.RunFunction(FCK.ToolbarSet.RefreshModeState,FCK.ToolbarSet);return true;},InsertElement:function(A){if (typeof A=='string') A=this.EditorDocument.createElement(A);var B=A.nodeName.toLowerCase();FCKSelection.Restore();var C=new FCKDomRange(this.EditorWindow);C.MoveToSelection();C.DeleteContents();if (FCKListsLib.BlockElements[B]!=null){if (C.StartBlock){if (C.CheckStartOfBlock()) C.MoveToPosition(C.StartBlock,3);else if (C.CheckEndOfBlock()) C.MoveToPosition(C.StartBlock,4);else C.SplitBlock();};C.InsertNode(A);var D=FCKDomTools.GetNextSourceElement(A,false,null,['hr','br','param','img','area','input'],true);if (!D&&FCKConfig.EnterMode!='br'){D=this.EditorDocument.body.appendChild(this.EditorDocument.createElement(FCKConfig.EnterMode));if (FCKBrowserInfo.IsGeckoLike) FCKTools.AppendBogusBr(D);};if (FCKListsLib.EmptyElements[B]==null) C.MoveToElementEditStart(A);else if (D) C.MoveToElementEditStart(D);else C.MoveToPosition(A,4);if (FCKBrowserInfo.IsGeckoLike){if (D) FCKDomTools.ScrollIntoView(D,false);FCKDomTools.ScrollIntoView(A,false);}}else{C.InsertNode(A);C.SetStart(A,4);C.SetEnd(A,4);};C.Select();C.Release();this.Focus();return A;},_InsertBlockElement:function(A){},_IsFunctionKey:function(A){if (A>=16&&A<=20) return true;if (A==27||(A>=33&&A<=40)) return true;if (A==45) return true;return false;},_KeyDownListener:function(A){if (!A) A=FCK.EditorWindow.event;if (FCK.EditorWindow){if (!FCK._IsFunctionKey(A.keyCode)&&!(A.ctrlKey||A.metaKey)&&!(A.keyCode==46)) FCK._KeyDownUndo();};return true;},_KeyDownUndo:function(){if (!FCKUndo.Typing){FCKUndo.SaveUndoStep();FCKUndo.Typing=true;FCK.Events.FireEvent("OnSelectionChange");};FCKUndo.TypesCount++;FCKUndo.Changed=1;if (FCKUndo.TypesCount>FCKUndo.MaxTypes){FCKUndo.TypesCount=0;FCKUndo.SaveUndoStep();}},_TabKeyHandler:function(A){if (!A) A=window.event;var B=A.keyCode;if (B==9&&FCK.EditMode!=0){if (FCKBrowserInfo.IsIE){var C=document.selection.createRange();if (C.parentElement()!=FCK.EditingArea.Textarea) return true;C.text='\t';C.select();}else{var a=[];var D=FCK.EditingArea.Textarea;var E=D.selectionStart;var F=D.selectionEnd;a.push(D.value.substr(0,E));a.push('\t');a.push(D.value.substr(F));D.value=a.join('');D.setSelectionRange(E+1,E+1);};if (A.preventDefault) return A.preventDefault();return A.returnValue=false;};return true;}};FCK.Events=new FCKEvents(FCK);FCK.GetHTML=FCK.GetXHTML=FCK.GetData;FCK.SetHTML=FCK.SetData;FCK.InsertElementAndGetIt=FCK.CreateElement=FCK.InsertElement;function _FCK_ProtectEvents_ReplaceTags(A){return A.replace(FCKRegexLib.EventAttributes,_FCK_ProtectEvents_ReplaceEvents);};function _FCK_ProtectEvents_ReplaceEvents(A,B){return ' '+B+'_fckprotectedatt="'+encodeURIComponent(A)+'"';};function _FCK_ProtectEvents_RestoreEvents(A,B){return decodeURIComponent(B);};function _FCK_MouseEventsListener(A){if (!A) A=window.event;if (A.type=='mousedown') FCK.MouseDownFlag=true;else if (A.type=='mouseup') FCK.MouseDownFlag=false;else if (A.type=='mousemove') FCK.Events.FireEvent('OnMouseMove',A);};function _FCK_PaddingNodeListener(){if (FCKConfig.EnterMode.IEquals('br')) return;FCKDomTools.EnforcePaddingNode(FCK.EditorDocument,FCKConfig.EnterMode);if (!FCKBrowserInfo.IsIE&&FCKDomTools.PaddingNode){var A=FCKSelection.GetSelection();if (A&&A.rangeCount==1){var B=A.getRangeAt(0);if (B.collapsed&&B.startContainer==FCK.EditorDocument.body&&B.startOffset==0){B.selectNodeContents(FCKDomTools.PaddingNode);B.collapse(true);A.removeAllRanges();A.addRange(B);}}}else if (FCKDomTools.PaddingNode){var C=FCKSelection.GetParentElement();var D=FCKDomTools.PaddingNode;if (C&&C.nodeName.IEquals('body')){if (FCK.EditorDocument.body.childNodes.length==1&&FCK.EditorDocument.body.firstChild==D){if (FCKSelection._GetSelectionDocument(FCK.EditorDocument.selection)!=FCK.EditorDocument) return;var B=FCK.EditorDocument.body.createTextRange();var F=false;if (!D.childNodes.firstChild){D.appendChild(FCKTools.GetElementDocument(D).createTextNode('\ufeff'));F=true;};B.moveToElementText(D);B.select();if (F) B.pasteHTML('');}}}};function _FCK_EditingArea_OnLoad(){FCK.EditorWindow=FCK.EditingArea.Window;FCK.EditorDocument=FCK.EditingArea.Document;if (FCKBrowserInfo.IsIE) FCKTempBin.ToElements();FCK.InitializeBehaviors();FCK.MouseDownFlag=false;FCKTools.AddEventListener(FCK.EditorDocument,'mousemove',_FCK_MouseEventsListener);FCKTools.AddEventListener(FCK.EditorDocument,'mousedown',_FCK_MouseEventsListener);FCKTools.AddEventListener(FCK.EditorDocument,'mouseup',_FCK_MouseEventsListener);if (FCKBrowserInfo.IsSafari){FCKTools.AddEventListener(FCK.EditorDocument,'paste',function(evt){var A=new FCKDomRange(FCK.EditorWindow);var B=FCK.EditorDocument.createTextNode('\ufeff');var C=FCK.EditorDocument.createElement('a');C.id='fck_paste_padding';C.innerHTML='';A.MoveToSelection();A.DeleteContents();A.InsertNode(B);A.Collapse();A.InsertNode(C);A.MoveToPosition(C,3);A.Select();setTimeout(function(){B.parentNode.removeChild(B);C=FCK.EditorDocument.getElementById('fck_paste_padding');C.parentNode.removeChild(C);},0);});};if (FCKBrowserInfo.IsSafari){var A=function(evt){if (!(evt.ctrlKey||evt.metaKey)) return;if (FCK.EditMode!=0) return;switch (evt.keyCode){case 89:FCKUndo.Redo();break;case 90:FCKUndo.Undo();break;}};FCKTools.AddEventListener(FCK.EditorDocument,'keyup',A);};FCK.EnterKeyHandler=new FCKEnterKey(FCK.EditorWindow,FCKConfig.EnterMode,FCKConfig.ShiftEnterMode,FCKConfig.TabSpaces);FCK.KeystrokeHandler.AttachToElement(FCK.EditorDocument);if (FCK._ForceResetIsDirty) FCK.ResetIsDirty();if (FCKBrowserInfo.IsIE&&FCK.HasFocus) FCK.EditorDocument.body.setActive();FCK.OnAfterSetHTML();FCKCommands.GetCommand('ShowBlocks').RestoreState();if (FCK.Status!=0) return;FCK.SetStatus(1);};function _FCK_GetEditorAreaStyleTags(){return FCKTools.GetStyleHtml(FCKConfig.EditorAreaCSS)+FCKTools.GetStyleHtml(FCKConfig.EditorAreaStyles);};function _FCK_KeystrokeHandler_OnKeystroke(A,B){if (FCK.Status!=2) return false;if (FCK.EditMode==0){switch (B){case 'Paste':return!FCK.Paste();case 'Cut':FCKUndo.SaveUndoStep();return false;}}else{if (B.Equals('Paste','Undo','Redo','SelectAll','Cut')) return false;};var C=FCK.Commands.GetCommand(B);if (C.GetState()==-1) return false;return (C.Execute.apply(C,FCKTools.ArgumentsToArray(arguments,2))!==false);};(function(){var A=window.parent.document;var B=A.getElementById(FCK.Name);var i=0;while (B||i==0){if (B&&B.tagName.toLowerCase().Equals('input','textarea')){FCK.LinkedField=B;break;};B=A.getElementsByName(FCK.Name)[i++];}})();var FCKTempBin={Elements:[],AddElement:function(A){var B=this.Elements.length;this.Elements[B]=A;return B;},RemoveElement:function(A){var e=this.Elements[A];this.Elements[A]=null;return e;},Reset:function(){var i=0;while (i '+this.Elements[i].outerHTML+'';this.Elements[i].isHtml=true;}},ToElements:function(){var A=FCK.EditorDocument.createElement('div');for (var i=0;i0) C+='TABLE { behavior: '+B+' ; }';C+='';FCK._BehaviorsStyle=C;};return FCK._BehaviorsStyle;};function Doc_OnMouseUp(){if (FCK.EditorWindow.event.srcElement.tagName=='HTML'){FCK.Focus();FCK.EditorWindow.event.cancelBubble=true;FCK.EditorWindow.event.returnValue=false;}};function Doc_OnPaste(){var A=FCK.EditorDocument.body;A.detachEvent('onpaste',Doc_OnPaste);var B=FCK.Paste(!FCKConfig.ForcePasteAsPlainText&&!FCKConfig.AutoDetectPasteFromWord);A.attachEvent('onpaste',Doc_OnPaste);return B;};function Doc_OnDblClick(){FCK.OnDoubleClick(FCK.EditorWindow.event.srcElement);FCK.EditorWindow.event.cancelBubble=true;};function Doc_OnSelectionChange(){if (!FCK.IsSelectionChangeLocked&&FCK.EditorDocument) FCK.Events.FireEvent("OnSelectionChange");};function Doc_OnDrop(){if (FCK.MouseDownFlag){FCK.MouseDownFlag=false;return;};if (FCKConfig.ForcePasteAsPlainText){var A=FCK.EditorWindow.event;if (FCK._CheckIsPastingEnabled()||FCKConfig.ShowDropDialog) FCK.PasteAsPlainText(A.dataTransfer.getData('Text'));A.returnValue=false;A.cancelBubble=true;}};FCK.InitializeBehaviors=function(A){this.EditorDocument.attachEvent('onmouseup',Doc_OnMouseUp);this.EditorDocument.body.attachEvent('onpaste',Doc_OnPaste);this.EditorDocument.body.attachEvent('ondrop',Doc_OnDrop);FCK.ContextMenu._InnerContextMenu.AttachToElement(FCK.EditorDocument.body);this.EditorDocument.attachEvent("onkeydown",FCK._KeyDownListener);this.EditorDocument.attachEvent("ondblclick",Doc_OnDblClick);this.EditorDocument.attachEvent("onbeforedeactivate",function(){ FCKSelection.Save();});this.EditorDocument.attachEvent("onselectionchange",Doc_OnSelectionChange);FCKTools.AddEventListener(FCK.EditorDocument,'mousedown',Doc_OnMouseDown);};FCK.InsertHtml=function(A){A=FCKConfig.ProtectedSource.Protect(A);A=FCK.ProtectEvents(A);A=FCK.ProtectUrls(A);A=FCK.ProtectTags(A);FCKSelection.Restore();FCK.EditorWindow.focus();FCKUndo.SaveUndoStep();var B=FCKSelection.GetSelection();if (B.type.toLowerCase()=='control') B.clear();A=''+A;B.createRange().pasteHTML(A);var C=FCK.EditorDocument.getElementById('__fakeFCKRemove__');if (C.parentNode.childNodes.length==1) C=C.parentNode;C.removeNode(true);FCKDocumentProcessor.Process(FCK.EditorDocument);this.Events.FireEvent("OnSelectionChange");};FCK.SetInnerHtml=function(A){var B=FCK.EditorDocument;B.body.innerHTML='
     
    '+A;B.getElementById('__fakeFCKRemove__').removeNode(true);};function FCK_PreloadImages(){var A=new FCKImagePreloader();A.AddImages(FCKConfig.PreloadImages);A.AddImages(FCKConfig.SkinPath+'fck_strip.gif');A.OnComplete=LoadToolbarSetup;A.Start();};function Document_OnContextMenu(){return (event.srcElement._FCKShowContextMenu==true);};document.oncontextmenu=Document_OnContextMenu;function FCK_Cleanup(){this.LinkedField=null;this.EditorWindow=null;this.EditorDocument=null;};FCK._ExecPaste=function(){if (FCK._PasteIsRunning) return true;if (FCKConfig.ForcePasteAsPlainText){FCK.PasteAsPlainText();return false;};var A=FCK._CheckIsPastingEnabled(true);if (A===false) FCKTools.RunFunction(FCKDialog.OpenDialog,FCKDialog,['FCKDialog_Paste',FCKLang.Paste,'dialog/fck_paste.html',400,330,'Security']);else{if (FCKConfig.AutoDetectPasteFromWord&&A.length>0){var B=/<\w[^>]*(( class="?MsoNormal"?)|(="mso-))/gi;if (B.test(A)){if (confirm(FCKLang.PasteWordConfirm)){FCK.PasteFromWord();return false;}}};FCK._PasteIsRunning=true;FCK.ExecuteNamedCommand('Paste');delete FCK._PasteIsRunning;};return false;};FCK.PasteAsPlainText=function(A){if (!FCK._CheckIsPastingEnabled()){FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.PasteAsText,'dialog/fck_paste.html',400,330,'PlainText');return;};var B=null;if (!A) B=clipboardData.getData("Text");else B=A;if (B&&B.length>0){B=FCKTools.HTMLEncode(B);B=FCKTools.ProcessLineBreaks(window,FCKConfig,B);var C=B.search('

    ');var D=B.search('

    ');if ((C!=-1&&D!=-1&&C0){if (FCKSelection.GetType()=='Control'){var D=this.EditorDocument.createElement('A');D.href=A;var E=FCKSelection.GetSelectedElement();E.parentNode.insertBefore(D,E);E.parentNode.removeChild(E);D.appendChild(E);return [D];};var F='javascript:void(0);/*'+(new Date().getTime())+'*/';FCK.ExecuteNamedCommand('CreateLink',F,false,!!B);var G=this.EditorDocument.links;for (i=0;i0) C+='TABLE { behavior: '+B+' ; }';C+='';FCK._BehaviorsStyle=C;};return FCK._BehaviorsStyle;};function Doc_OnMouseUp(){if (FCK.EditorWindow.event.srcElement.tagName=='HTML'){FCK.Focus();FCK.EditorWindow.event.cancelBubble=true;FCK.EditorWindow.event.returnValue=false;}};function Doc_OnPaste(){var A=FCK.EditorDocument.body;A.detachEvent('onpaste',Doc_OnPaste);var B=FCK.Paste(!FCKConfig.ForcePasteAsPlainText&&!FCKConfig.AutoDetectPasteFromWord);A.attachEvent('onpaste',Doc_OnPaste);return B;};function Doc_OnDblClick(){FCK.OnDoubleClick(FCK.EditorWindow.event.srcElement);FCK.EditorWindow.event.cancelBubble=true;};function Doc_OnSelectionChange(){if (!FCK.IsSelectionChangeLocked&&FCK.EditorDocument) FCK.Events.FireEvent("OnSelectionChange");};function Doc_OnDrop(){if (FCK.MouseDownFlag){FCK.MouseDownFlag=false;return;};if (FCKConfig.ForcePasteAsPlainText){var A=FCK.EditorWindow.event;if (FCK._CheckIsPastingEnabled()||FCKConfig.ShowDropDialog) FCK.PasteAsPlainText(A.dataTransfer.getData('Text'));A.returnValue=false;A.cancelBubble=true;}};FCK.InitializeBehaviors=function(A){this.EditorDocument.attachEvent('onmouseup',Doc_OnMouseUp);this.EditorDocument.body.attachEvent('onpaste',Doc_OnPaste);this.EditorDocument.body.attachEvent('ondrop',Doc_OnDrop);FCK.ContextMenu._InnerContextMenu.AttachToElement(FCK.EditorDocument.body);this.EditorDocument.attachEvent("onkeydown",FCK._KeyDownListener);this.EditorDocument.attachEvent("ondblclick",Doc_OnDblClick);this.EditorDocument.attachEvent("onbeforedeactivate",function(){ FCKSelection.Save();});this.EditorDocument.attachEvent("onselectionchange",Doc_OnSelectionChange);FCKTools.AddEventListener(FCK.EditorDocument,'mousedown',Doc_OnMouseDown);};FCK.InsertHtml=function(A){A=FCKConfig.ProtectedSource.Protect(A);A=FCK.ProtectEvents(A);A=FCK.ProtectUrls(A);A=FCK.ProtectTags(A);FCKSelection.Restore();FCK.EditorWindow.focus();FCKUndo.SaveUndoStep();var B=FCKSelection.GetSelection();if (B.type.toLowerCase()=='control') B.clear();A=''+A;B.createRange().pasteHTML(A);var C=FCK.EditorDocument.getElementById('__fakeFCKRemove__');if (C.parentNode.childNodes.length==1) C=C.parentNode;C.removeNode(true);FCKDocumentProcessor.Process(FCK.EditorDocument);this.Events.FireEvent("OnSelectionChange");};FCK.SetInnerHtml=function(A){var B=FCK.EditorDocument;B.body.innerHTML='

     
    '+A;B.getElementById('__fakeFCKRemove__').removeNode(true);};function FCK_PreloadImages(){var A=new FCKImagePreloader();A.AddImages(FCKConfig.PreloadImages);A.AddImages(FCKConfig.SkinPath+'fck_strip.gif');A.OnComplete=LoadToolbarSetup;A.Start();};function Document_OnContextMenu(){return (event.srcElement._FCKShowContextMenu==true);};document.oncontextmenu=Document_OnContextMenu;function FCK_Cleanup(){this.LinkedField=null;this.EditorWindow=null;this.EditorDocument=null;};FCK._ExecPaste=function(){if (FCK._PasteIsRunning) return true;if (FCKConfig.ForcePasteAsPlainText){FCK.PasteAsPlainText();return false;};var A=FCK._CheckIsPastingEnabled(true);if (A===false) FCKTools.RunFunction(FCKDialog.OpenDialog,FCKDialog,['FCKDialog_Paste',FCKLang.Paste,'dialog/fck_paste.html',400,330,'Security']);else{if (FCKConfig.AutoDetectPasteFromWord&&A.length>0){var B=/<\w[^>]*(( class="?MsoNormal"?)|(="mso-))/gi;if (B.test(A)){if (confirm(FCKLang.PasteWordConfirm)){FCK.PasteFromWord();return false;}}};FCK._PasteIsRunning=true;FCK.ExecuteNamedCommand('Paste');delete FCK._PasteIsRunning;};return false;};FCK.PasteAsPlainText=function(A){if (!FCK._CheckIsPastingEnabled()){FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.PasteAsText,'dialog/fck_paste.html',400,330,'PlainText');return;};var B=null;if (!A) B=clipboardData.getData("Text");else B=A;if (B&&B.length>0){B=FCKTools.HTMLEncode(B);B=FCKTools.ProcessLineBreaks(window,FCKConfig,B);var C=B.search('

    ');var D=B.search('

    ');if ((C!=-1&&D!=-1&&C0){if (D){var F=this.EditorDocument.createElement('A');F.href=A;var G=E;G.parentNode.insertBefore(F,G);G.parentNode.removeChild(G);F.appendChild(G);return [F];};var H='javascript:void(0);/*'+(new Date().getTime())+'*/';FCK.ExecuteNamedCommand('CreateLink',H,false,!!B);var I=this.EditorDocument.links;for (i=0;i0&&!isNaN(E)) this.PageConfig[D]=parseFloat(E);else this.PageConfig[D]=E;}};function FCKConfig_LoadPageConfig(){var A=FCKConfig.PageConfig;for (var B in A) FCKConfig[B]=A[B];};function FCKConfig_PreProcess(){var A=FCKConfig;if (A.AllowQueryStringDebug){try{if ((/fckdebug=true/i).test(window.top.location.search)) A.Debug=true;}catch (e) { }};if (!A.PluginsPath.EndsWith('/')) A.PluginsPath+='/';var B=A.ToolbarComboPreviewCSS;if (!B||B.length==0) A.ToolbarComboPreviewCSS=A.EditorAreaCSS;A.RemoveAttributesArray=(A.RemoveAttributes||'').split(',');if (!FCKConfig.SkinEditorCSS||FCKConfig.SkinEditorCSS.length==0) FCKConfig.SkinEditorCSS=FCKConfig.SkinPath+'fck_editor.css';if (!FCKConfig.SkinDialogCSS||FCKConfig.SkinDialogCSS.length==0) FCKConfig.SkinDialogCSS=FCKConfig.SkinPath+'fck_dialog.css';};FCKConfig.ToolbarSets={};FCKConfig.Plugins={};FCKConfig.Plugins.Items=[];FCKConfig.Plugins.Add=function(A,B,C){FCKConfig.Plugins.Items.push([A,B,C]);};FCKConfig.ProtectedSource={};FCKConfig.ProtectedSource._CodeTag=(new Date()).valueOf();FCKConfig.ProtectedSource.RegexEntries=[//g,//gi,//gi];FCKConfig.ProtectedSource.Add=function(A){this.RegexEntries.push(A);};FCKConfig.ProtectedSource.Protect=function(A){var B=this._CodeTag;function _Replace(protectedSource){var C=FCKTempBin.AddElement(protectedSource);return '';};for (var i=0;i|>)","g");return A.replace(D,_Replace);};FCKConfig.GetBodyAttributes=function(){var A='';if (this.BodyId&&this.BodyId.length>0) A+=' id="'+this.BodyId+'"';if (this.BodyClass&&this.BodyClass.length>0) A+=' class="'+this.BodyClass+'"';return A;};FCKConfig.ApplyBodyAttributes=function(A){if (this.BodyId&&this.BodyId.length>0) A.id=FCKConfig.BodyId;if (this.BodyClass&&this.BodyClass.length>0) A.className+=' '+FCKConfig.BodyClass;}; var FCKDebug={Output:function(){},OutputObject:function(){}}; var FCKDomTools={MoveChildren:function(A,B,C){if (A==B) return;var D;if (C){while ((D=A.lastChild)) B.insertBefore(A.removeChild(D),B.firstChild);}else{while ((D=A.firstChild)) B.appendChild(A.removeChild(D));}},MoveNode:function(A,B,C){if (C) B.insertBefore(FCKDomTools.RemoveNode(A),B.firstChild);else B.appendChild(FCKDomTools.RemoveNode(A));},TrimNode:function(A){this.LTrimNode(A);this.RTrimNode(A);},LTrimNode:function(A){var B;while ((B=A.firstChild)){if (B.nodeType==3){var C=B.nodeValue.LTrim();var D=B.nodeValue.length;if (C.length==0){A.removeChild(B);continue;}else if (C.length0) break;if (A.lastChild) A=A.lastChild;else return this.GetPreviousSourceElement(A,B,C,D);};return null;},GetNextSourceElement:function(A,B,C,D,E){while((A=this.GetNextSourceNode(A,E))){if (A.nodeType==1){if (C&&A.nodeName.IEquals(C)) break;if (D&&A.nodeName.IEquals(D)) return this.GetNextSourceElement(A,B,C,D);return A;}else if (B&&A.nodeType==3&&A.nodeValue.RTrim().length>0) break;};return null;},GetNextSourceNode:function(A,B,C,D){if (!A) return null;var E;if (!B&&A.firstChild) E=A.firstChild;else{if (D&&A==D) return null;E=A.nextSibling;if (!E&&(!D||D!=A.parentNode)) return this.GetNextSourceNode(A.parentNode,true,C,D);};if (C&&E&&E.nodeType!=C) return this.GetNextSourceNode(E,false,C,D);return E;},GetPreviousSourceNode:function(A,B,C,D){if (!A) return null;var E;if (!B&&A.lastChild) E=A.lastChild;else{if (D&&A==D) return null;E=A.previousSibling;if (!E&&(!D||D!=A.parentNode)) return this.GetPreviousSourceNode(A.parentNode,true,C,D);};if (C&&E&&E.nodeType!=C) return this.GetPreviousSourceNode(E,false,C,D);return E;},InsertAfterNode:function(A,B){return A.parentNode.insertBefore(B,A.nextSibling);},GetParents:function(A){var B=[];while (A){B.unshift(A);A=A.parentNode;};return B;},GetCommonParents:function(A,B){var C=this.GetParents(A);var D=this.GetParents(B);var E=[];for (var i=0;i0) D[C.pop().toLowerCase()]=1;var E=this.GetCommonParents(A,B);var F=null;while ((F=E.pop())){if (D[F.nodeName.toLowerCase()]) return F;};return null;},GetIndexOf:function(A){var B=A.parentNode?A.parentNode.firstChild:null;var C=-1;while (B){C++;if (B==A) return C;B=B.nextSibling;};return-1;},PaddingNode:null,EnforcePaddingNode:function(A,B){try{if (!A||!A.body) return;}catch (e){return;};this.CheckAndRemovePaddingNode(A,B,true);try{if (A.body.lastChild&&(A.body.lastChild.nodeType!=1||A.body.lastChild.tagName.toLowerCase()==B.toLowerCase())) return;}catch (e){return;};var C=A.createElement(B);if (FCKBrowserInfo.IsGecko&&FCKListsLib.NonEmptyBlockElements[B]) FCKTools.AppendBogusBr(C);this.PaddingNode=C;if (A.body.childNodes.length==1&&A.body.firstChild.nodeType==1&&A.body.firstChild.tagName.toLowerCase()=='br'&&(A.body.firstChild.getAttribute('_moz_dirty')!=null||A.body.firstChild.getAttribute('type')=='_moz')) A.body.replaceChild(C,A.body.firstChild);else A.body.appendChild(C);},CheckAndRemovePaddingNode:function(A,B,C){var D=this.PaddingNode;if (!D) return;try{if (D.parentNode!=A.body||D.tagName.toLowerCase()!=B||(D.childNodes.length>1)||(D.firstChild&&D.firstChild.nodeValue!='\xa0'&&String(D.firstChild.tagName).toLowerCase()!='br')){this.PaddingNode=null;return;}}catch (e){this.PaddingNode=null;return;};if (!C){if (D.parentNode.childNodes.length>1) D.parentNode.removeChild(D);this.PaddingNode=null;}},HasAttribute:function(A,B){if (A.hasAttribute) return A.hasAttribute(B);else{var C=A.attributes[B];return (C!=undefined&&C.specified);}},HasAttributes:function(A){var B=A.attributes;for (var i=0;i0) return true;continue;}};if (B[i].specified) return true;};return false;},RemoveAttribute:function(A,B){if (FCKBrowserInfo.IsIE&&B.toLowerCase()=='class') B='className';return A.removeAttribute(B,0);},RemoveAttributes:function (A,B){for (var i=0;i0) return false;C=C.nextSibling;};return D?this.CheckIsEmptyElement(D,B):true;},SetElementStyles:function(A,B){var C=A.style;for (var D in B) C[D]=B[D];},SetOpacity:function(A,B){if (FCKBrowserInfo.IsIE){B=Math.round(B*100);A.style.filter=(B>100?'':'progid:DXImageTransform.Microsoft.Alpha(opacity='+B+')');}else A.style.opacity=B;},GetCurrentElementStyle:function(A,B){if (FCKBrowserInfo.IsIE) return A.currentStyle[B];else return A.ownerDocument.defaultView.getComputedStyle(A,'').getPropertyValue(B);},GetPositionedAncestor:function(A){var B=A;while (B!=FCKTools.GetElementDocument(B).documentElement){if (this.GetCurrentElementStyle(B,'position')!='static') return B;if (B==FCKTools.GetElementDocument(B).documentElement&¤tWindow!=w) B=currentWindow.frameElement;else B=B.parentNode;};return null;},ScrollIntoView:function(A,B){var C=FCKTools.GetElementWindow(A);var D=FCKTools.GetViewPaneSize(C).Height;var E=D*-1;if (B===false){E+=A.offsetHeight||0;E+=parseInt(this.GetCurrentElementStyle(A,'marginBottom')||0,10)||0;};var F=FCKTools.GetDocumentPosition(C,A);E+=F.y;var G=FCKTools.GetScrollPosition(C).Y;if (E>0&&(E>G||E Date: Wed, 29 Jul 2009 00:45:28 +0200 Subject: [PATCH 18/56] [svn r22430] FS#2867 - The online editor: Implementing 2.6.5 SVN patch, ticket #3818 - http://dev.fckeditor.net/ticket/3818 . --- documentation/changelog.html | 2 +- .../editor/_source/commandclasses/fcktextcolorcommand.js | 8 ++++---- main/inc/lib/fckeditor/editor/js/fckeditorcode_gecko.js | 2 +- main/inc/lib/fckeditor/editor/js/fckeditorcode_ie.js | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/documentation/changelog.html b/documentation/changelog.html index 0f07414a44..928acb40ce 100644 --- a/documentation/changelog.html +++ b/documentation/changelog.html @@ -34,7 +34,7 @@

  • The installation sript: The page about system requilements has been updated. Also, at the very beginning, a check has been added whether the mbstring php-extension is installed - see the related forum topic. (FS#306)
  • A new php-based configuration for the online editor has been implemented, see dokeos/main/inc/lib/fckeditor/myconfig.php. Also, toolbar definitions have been split in separate php-files within the directory dokeos/main/inc/lib/fckeditor/toolbars/ . Customization of the editor is more convenient and flexible now. (FS#2867)
  • Online editor: A upgrade from FCKEditor 2.6.4 to FCKEditor 2.6.4.1 has been implemented. (FS#4383)
  • -
  • Online editor: Several known bug-fixes from FCKEditor 2.6.5 SVN have been implemented, tickets #1537, #2156, #2689, #2821, #2856, #2874, #2915, #3120, #3181, #3429, #3439, #3446, #3481, #3677, #3880. (FS#2867)
  • +
  • Online editor: Several known bug-fixes from FCKEditor 2.6.5 SVN have been implemented, tickets #1537, #2156, #2689, #2821, #2856, #2874, #2915, #3120, #3181, #3429, #3439, #3446, #3481, #3677, #3818, #3880. (FS#2867)
  • Online editor: The simple file manager, the advanced file manager and the image manager have been integrated by default with the editor's dialog system. Thus, they work faster and in a more secure way. (FS#2867)
  • Online editor: Blocking copy/paste for trainees has been added. The feature is configurable through editing the toolbar definition files within the directory dokeos/main/inc/lib/fckeditor/toolbars/ . (FS#2867)
  • Online editor: Preview tabs have been added to the dialogs for inserting video, flv-video, and YouTube video. (FS#2867)
  • diff --git a/main/inc/lib/fckeditor/editor/_source/commandclasses/fcktextcolorcommand.js b/main/inc/lib/fckeditor/editor/_source/commandclasses/fcktextcolorcommand.js index dccd794625..f919105a6f 100644 --- a/main/inc/lib/fckeditor/editor/_source/commandclasses/fcktextcolorcommand.js +++ b/main/inc/lib/fckeditor/editor/_source/commandclasses/fcktextcolorcommand.js @@ -193,9 +193,9 @@ FCKTextColorCommand.prototype._CreatePanelBody = function( targetDocument, targe oDiv.innerHTML = '
    ' + FCKLang.ColorMoreColors + '
    ' ; FCKTools.AddEventListenerEx( oDiv, 'click', FCKTextColorCommand_MoreOnClick, this ) ; + + // Dirty hack for Opera, Safari and Firefox 3. + if ( !FCKBrowserInfo.IsIE ) + oDiv.style.width = '96%' ; } - - // Dirty hack for Opera, Safari and Firefox 3. - if ( !FCKBrowserInfo.IsIE ) - oDiv.style.width = '96%' ; } diff --git a/main/inc/lib/fckeditor/editor/js/fckeditorcode_gecko.js b/main/inc/lib/fckeditor/editor/js/fckeditorcode_gecko.js index c3469245d0..53b409dfd8 100644 --- a/main/inc/lib/fckeditor/editor/js/fckeditorcode_gecko.js +++ b/main/inc/lib/fckeditor/editor/js/fckeditorcode_gecko.js @@ -70,7 +70,7 @@ var FCKStyleCommand=function(){};FCKStyleCommand.prototype={Name:'Style',Execute var FCKDialogCommand=function(A,B,C,D,E,F,G,H){this.Name=A;this.Title=B;this.Url=C;this.Width=D;this.Height=E;this.CustomValue=H;this.GetStateFunction=F;this.GetStateParam=G;this.Resizable=false;};FCKDialogCommand.prototype.Execute=function(){FCKDialog.OpenDialog('FCKDialog_'+this.Name,this.Title,this.Url,this.Width,this.Height,this.CustomValue,null,this.Resizable);};FCKDialogCommand.prototype.GetState=function(){if (this.GetStateFunction) return this.GetStateFunction(this.GetStateParam);else return FCK.EditMode==0?0:-1;};var FCKUndefinedCommand=function(){this.Name='Undefined';};FCKUndefinedCommand.prototype.Execute=function(){alert(FCKLang.NotImplemented);};FCKUndefinedCommand.prototype.GetState=function(){return 0;};var FCKFormatBlockCommand=function(){};FCKFormatBlockCommand.prototype={Name:'FormatBlock',Execute:FCKStyleCommand.prototype.Execute,GetState:function(){return FCK.EditorDocument?0:-1;}};var FCKFontNameCommand=function(){};FCKFontNameCommand.prototype={Name:'FontName',Execute:FCKStyleCommand.prototype.Execute,GetState:FCKFormatBlockCommand.prototype.GetState};var FCKFontSizeCommand=function(){};FCKFontSizeCommand.prototype={Name:'FontSize',Execute:FCKStyleCommand.prototype.Execute,GetState:FCKFormatBlockCommand.prototype.GetState};var FCKPreviewCommand=function(){this.Name='Preview';};FCKPreviewCommand.prototype.Execute=function(){FCK.Preview();};FCKPreviewCommand.prototype.GetState=function(){return 0;};var FCKSaveCommand=function(){this.Name='Save';};FCKSaveCommand.prototype.Execute=function(){var A=FCK.GetParentForm();if (typeof(A.onsubmit)=='function'){var B=A.onsubmit();if (B!=null&&B===false) return;};if (typeof(A.submit)=='function') A.submit();else A.submit.click();};FCKSaveCommand.prototype.GetState=function(){return 0;};var FCKNewPageCommand=function(){this.Name='NewPage';};FCKNewPageCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();FCK.SetData('');FCKUndo.Typing=true;FCK.Focus();};FCKNewPageCommand.prototype.GetState=function(){return 0;};var FCKSourceCommand=function(){this.Name='Source';};FCKSourceCommand.prototype.Execute=function(){if (FCKConfig.SourcePopup){var A=FCKConfig.ScreenWidth*0.65;var B=FCKConfig.ScreenHeight*0.65;FCKDialog.OpenDialog('FCKDialog_Source',FCKLang.Source,'dialog/fck_source.html',A,B,null,null,true);}else FCK.SwitchEditMode();};FCKSourceCommand.prototype.GetState=function(){return (FCK.EditMode==0?0:1);};var FCKUndoCommand=function(){this.Name='Undo';};FCKUndoCommand.prototype.Execute=function(){FCKUndo.Undo();};FCKUndoCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return (FCKUndo.CheckUndoState()?0:-1);};var FCKRedoCommand=function(){this.Name='Redo';};FCKRedoCommand.prototype.Execute=function(){FCKUndo.Redo();};FCKRedoCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return (FCKUndo.CheckRedoState()?0:-1);};var FCKPageBreakCommand=function(){this.Name='PageBreak';};FCKPageBreakCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();var e=FCK.EditorDocument.createElement('DIV');e.style.pageBreakAfter='always';e.innerHTML=' ';var A=FCKDocumentProcessor_CreateFakeImage('FCK__PageBreak',e);var B=new FCKDomRange(FCK.EditorWindow);B.MoveToSelection();var C=B.SplitBlock();B.InsertNode(A);FCK.Events.FireEvent('OnSelectionChange');};FCKPageBreakCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return 0;};var FCKUnlinkCommand=function(){this.Name='Unlink';};FCKUnlinkCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();if (FCKBrowserInfo.IsGeckoLike){var A=FCK.Selection.MoveToAncestorNode('A');if (A) FCKTools.RemoveOuterTags(A);return;};FCK.ExecuteNamedCommand(this.Name);};FCKUnlinkCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;var A=FCK.GetNamedCommandState(this.Name);if (A==0&&FCK.EditMode==0){var B=FCKSelection.MoveToAncestorNode('A');var C=(B&&B.name.length>0&&B.href.length==0);if (C) A=-1;};return A;};var FCKVisitLinkCommand=function(){this.Name='VisitLink';};FCKVisitLinkCommand.prototype={GetState:function(){if (FCK.EditMode!=0) return -1;var A=FCK.GetNamedCommandState('Unlink');if (A==0){var B=FCKSelection.MoveToAncestorNode('A');if (!B.href) A=-1;};return A;},Execute:function(){var A=FCKSelection.MoveToAncestorNode('A');var B=A.getAttribute('_fcksavedurl')||A.getAttribute('href',2);if (!/:\/\//.test(B)){var C=FCKConfig.BaseHref;var D=FCK.GetInstanceObject('parent');if (!C){C=D.document.location.href;C=C.substring(0,C.lastIndexOf('/')+1);};if (/^\//.test(B)){try{C=C.match(/^.*:\/\/+[^\/]+/)[0];}catch (e){C=D.document.location.protocol+'://'+D.parent.document.location.host;}};B=C+B;};if (!window.open(B,'_blank')) alert(FCKLang.VisitLinkBlocked);}};var FCKSelectAllCommand=function(){this.Name='SelectAll';};FCKSelectAllCommand.prototype.Execute=function(){if (FCK.EditMode==0){FCK.ExecuteNamedCommand('SelectAll');}else{var A=FCK.EditingArea.Textarea;if (FCKBrowserInfo.IsIE){A.createTextRange().execCommand('SelectAll');}else{A.selectionStart=0;A.selectionEnd=A.value.length;};A.focus();}};FCKSelectAllCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return 0;};var FCKPasteCommand=function(){this.Name='Paste';};FCKPasteCommand.prototype={Execute:function(){if (FCKBrowserInfo.IsIE) FCK.Paste();else FCK.ExecuteNamedCommand('Paste');},GetState:function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('Paste');}};var FCKRuleCommand=function(){this.Name='Rule';};FCKRuleCommand.prototype={Execute:function(){FCKUndo.SaveUndoStep();FCK.InsertElement('hr');},GetState:function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('InsertHorizontalRule');}};var FCKCutCopyCommand=function(A){this.Name=A?'Cut':'Copy';};FCKCutCopyCommand.prototype={Execute:function(){var A=false;if (FCKBrowserInfo.IsIE){var B=function(){A=true;};var C='on'+this.Name.toLowerCase();FCK.EditorDocument.body.attachEvent(C,B);FCK.ExecuteNamedCommand(this.Name);FCK.EditorDocument.body.detachEvent(C,B);}else{try{FCK.ExecuteNamedCommand(this.Name);A=true;}catch(e){}};if (!A) alert(FCKLang['PasteError'+this.Name]);},GetState:function(){return FCK.EditMode!=0?-1:FCK.GetNamedCommandState('Cut');}};var FCKAnchorDeleteCommand=function(){this.Name='AnchorDelete';};FCKAnchorDeleteCommand.prototype={Execute:function(){if (FCK.Selection.GetType()=='Control'){FCK.Selection.Delete();}else{var A=FCK.Selection.GetSelectedElement();if (A){if (A.tagName=='IMG'&&A.getAttribute('_fckanchor')) oAnchor=FCK.GetRealElement(A);else A=null;};if (!A){oAnchor=FCK.Selection.MoveToAncestorNode('A');if (oAnchor) FCK.Selection.SelectNode(oAnchor);};if (oAnchor.href.length!=0){oAnchor.removeAttribute('name');if (FCKBrowserInfo.IsIE) oAnchor.className=oAnchor.className.replace(FCKRegexLib.FCK_Class,'');return;};if (A){A.parentNode.removeChild(A);return;};if (oAnchor.innerHTML.length==0){oAnchor.parentNode.removeChild(oAnchor);return;};FCKTools.RemoveOuterTags(oAnchor);};if (FCKBrowserInfo.IsGecko) FCK.Selection.Collapse(true);},GetState:function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('Unlink');}};var FCKDeleteDivCommand=function(){};FCKDeleteDivCommand.prototype={GetState:function(){if (FCK.EditMode!=0) return -1;var A=FCKSelection.GetParentElement();var B=new FCKElementPath(A);return B.BlockLimit&&B.BlockLimit.nodeName.IEquals('div')?0:-1;},Execute:function(){FCKUndo.SaveUndoStep();var A=FCKDomTools.GetSelectedDivContainers();var B=new FCKDomRange(FCK.EditorWindow);B.MoveToSelection();var C=B.CreateBookmark();for (var i=0;i\n \n
    \n '+FCKLang.ColorAutomatic+'\n \n ';FCKTools.AddEventListenerEx(C,'click',FCKTextColorCommand_AutoOnClick,this);if (!FCKBrowserInfo.IsIE) C.style.width='96%';var G=FCKConfig.FontColors.toString().split(',');var H=0;while (H
    ';if (H>=G.length) C.style.visibility='hidden';else FCKTools.AddEventListenerEx(C,'click',FCKTextColorCommand_OnClick,[this,L]);}};if (FCKConfig.EnableMoreFontColors){E=D.insertRow(-1).insertCell(-1);E.colSpan=8;C=E.appendChild(CreateSelectionDiv());C.innerHTML='
    '+FCKLang.ColorMoreColors+'
    ';FCKTools.AddEventListenerEx(C,'click',FCKTextColorCommand_MoreOnClick,this);};if (!FCKBrowserInfo.IsIE) C.style.width='96%';}; +var FCKTextColorCommand=function(A){this.Name=A=='ForeColor'?'TextColor':'BGColor';this.Type=A;var B;if (FCKBrowserInfo.IsIE) B=window;else if (FCK.ToolbarSet._IFrame) B=FCKTools.GetElementWindow(FCK.ToolbarSet._IFrame);else B=window.parent;this._Panel=new FCKPanel(B);this._Panel.AppendStyleSheet(FCKConfig.SkinEditorCSS);this._Panel.MainNode.className='FCK_Panel';this._CreatePanelBody(this._Panel.Document,this._Panel.MainNode);FCK.ToolbarSet.ToolbarItems.GetItem(this.Name).RegisterPanel(this._Panel);FCKTools.DisableSelection(this._Panel.Document.body);};FCKTextColorCommand.prototype.Execute=function(A,B,C){this._Panel.Show(A,B,C);};FCKTextColorCommand.prototype.SetColor=function(A){FCKUndo.SaveUndoStep();var B=FCKStyles.GetStyle('_FCK_'+(this.Type=='ForeColor'?'Color':'BackColor'));if (!A||A.length==0) FCK.Styles.RemoveStyle(B);else{B.SetVariable('Color',A);FCKStyles.ApplyStyle(B);};FCKUndo.SaveUndoStep();FCK.Focus();FCK.Events.FireEvent('OnSelectionChange');};FCKTextColorCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return 0;};function FCKTextColorCommand_OnMouseOver(){this.className='ColorSelected';};function FCKTextColorCommand_OnMouseOut(){this.className='ColorDeselected';};function FCKTextColorCommand_OnClick(A,B,C){this.className='ColorDeselected';B.SetColor(C);B._Panel.Hide();};function FCKTextColorCommand_AutoOnClick(A,B){this.className='ColorDeselected';B.SetColor('');B._Panel.Hide();};function FCKTextColorCommand_MoreOnClick(A,B){this.className='ColorDeselected';B._Panel.Hide();FCKDialog.OpenDialog('FCKDialog_Color',FCKLang.DlgColorTitle,'dialog/fck_colorselector.html',410,320,FCKTools.Bind(B,B.SetColor));};FCKTextColorCommand.prototype._CreatePanelBody=function(A,B){function CreateSelectionDiv(){var C=A.createElement("DIV");C.className='ColorDeselected';FCKTools.AddEventListenerEx(C,'mouseover',FCKTextColorCommand_OnMouseOver);FCKTools.AddEventListenerEx(C,'mouseout',FCKTextColorCommand_OnMouseOut);return C;};var D=B.appendChild(A.createElement("TABLE"));D.className='ForceBaseFont';D.style.tableLayout='fixed';D.cellPadding=0;D.cellSpacing=0;D.border=0;D.width=150;var E=D.insertRow(-1).insertCell(-1);E.colSpan=8;var C=E.appendChild(CreateSelectionDiv());C.innerHTML='\n \n \n \n \n
    '+FCKLang.ColorAutomatic+'
    ';FCKTools.AddEventListenerEx(C,'click',FCKTextColorCommand_AutoOnClick,this);if (!FCKBrowserInfo.IsIE) C.style.width='96%';var G=FCKConfig.FontColors.toString().split(',');var H=0;while (H
    ';if (H>=G.length) C.style.visibility='hidden';else FCKTools.AddEventListenerEx(C,'click',FCKTextColorCommand_OnClick,[this,L]);}};if (FCKConfig.EnableMoreFontColors){E=D.insertRow(-1).insertCell(-1);E.colSpan=8;C=E.appendChild(CreateSelectionDiv());C.innerHTML='
    '+FCKLang.ColorMoreColors+'
    ';FCKTools.AddEventListenerEx(C,'click',FCKTextColorCommand_MoreOnClick,this);if (!FCKBrowserInfo.IsIE) C.style.width='96%';}}; var FCKPastePlainTextCommand=function(){this.Name='PasteText';};FCKPastePlainTextCommand.prototype.Execute=function(){FCK.PasteAsPlainText();};FCKPastePlainTextCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('Paste');}; var FCKPasteWordCommand=function(){this.Name='PasteWord';};FCKPasteWordCommand.prototype.Execute=function(){FCK.PasteFromWord();};FCKPasteWordCommand.prototype.GetState=function(){if (FCK.EditMode!=0||FCKConfig.ForcePasteAsPlainText) return -1;else return FCK.GetNamedCommandState('Paste');}; var FCKTableCommand=function(A){this.Name=A;};FCKTableCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();if (!FCKBrowserInfo.IsGecko){switch (this.Name){case 'TableMergeRight':return FCKTableHandler.MergeRight();case 'TableMergeDown':return FCKTableHandler.MergeDown();}};switch (this.Name){case 'TableInsertRowAfter':return FCKTableHandler.InsertRow(false);case 'TableInsertRowBefore':return FCKTableHandler.InsertRow(true);case 'TableDeleteRows':return FCKTableHandler.DeleteRows();case 'TableInsertColumnAfter':return FCKTableHandler.InsertColumn(false);case 'TableInsertColumnBefore':return FCKTableHandler.InsertColumn(true);case 'TableDeleteColumns':return FCKTableHandler.DeleteColumns();case 'TableInsertCellAfter':return FCKTableHandler.InsertCell(null,false);case 'TableInsertCellBefore':return FCKTableHandler.InsertCell(null,true);case 'TableDeleteCells':return FCKTableHandler.DeleteCells();case 'TableMergeCells':return FCKTableHandler.MergeCells();case 'TableHorizontalSplitCell':return FCKTableHandler.HorizontalSplitCell();case 'TableVerticalSplitCell':return FCKTableHandler.VerticalSplitCell();case 'TableDelete':return FCKTableHandler.DeleteTable();default:return alert(FCKLang.UnknownCommand.replace(/%1/g,this.Name));}};FCKTableCommand.prototype.GetState=function(){if (FCK.EditorDocument!=null&&FCKSelection.HasAncestorNode('TABLE')){switch (this.Name){case 'TableHorizontalSplitCell':case 'TableVerticalSplitCell':if (FCKTableHandler.GetSelectedCells().length==1) return 0;else return -1;case 'TableMergeCells':if (FCKTableHandler.CheckIsSelectionRectangular()&&FCKTableHandler.GetSelectedCells().length>1) return 0;else return -1;case 'TableMergeRight':return FCKTableHandler.GetMergeRightTarget()?0:-1;case 'TableMergeDown':return FCKTableHandler.GetMergeDownTarget()?0:-1;default:return 0;}}else return -1;}; diff --git a/main/inc/lib/fckeditor/editor/js/fckeditorcode_ie.js b/main/inc/lib/fckeditor/editor/js/fckeditorcode_ie.js index 9a87cb7566..8c2cfd5c5e 100644 --- a/main/inc/lib/fckeditor/editor/js/fckeditorcode_ie.js +++ b/main/inc/lib/fckeditor/editor/js/fckeditorcode_ie.js @@ -71,7 +71,7 @@ var FCKStyleCommand=function(){};FCKStyleCommand.prototype={Name:'Style',Execute var FCKDialogCommand=function(A,B,C,D,E,F,G,H){this.Name=A;this.Title=B;this.Url=C;this.Width=D;this.Height=E;this.CustomValue=H;this.GetStateFunction=F;this.GetStateParam=G;this.Resizable=false;};FCKDialogCommand.prototype.Execute=function(){FCKDialog.OpenDialog('FCKDialog_'+this.Name,this.Title,this.Url,this.Width,this.Height,this.CustomValue,null,this.Resizable);};FCKDialogCommand.prototype.GetState=function(){if (this.GetStateFunction) return this.GetStateFunction(this.GetStateParam);else return FCK.EditMode==0?0:-1;};var FCKUndefinedCommand=function(){this.Name='Undefined';};FCKUndefinedCommand.prototype.Execute=function(){alert(FCKLang.NotImplemented);};FCKUndefinedCommand.prototype.GetState=function(){return 0;};var FCKFormatBlockCommand=function(){};FCKFormatBlockCommand.prototype={Name:'FormatBlock',Execute:FCKStyleCommand.prototype.Execute,GetState:function(){return FCK.EditorDocument?0:-1;}};var FCKFontNameCommand=function(){};FCKFontNameCommand.prototype={Name:'FontName',Execute:FCKStyleCommand.prototype.Execute,GetState:FCKFormatBlockCommand.prototype.GetState};var FCKFontSizeCommand=function(){};FCKFontSizeCommand.prototype={Name:'FontSize',Execute:FCKStyleCommand.prototype.Execute,GetState:FCKFormatBlockCommand.prototype.GetState};var FCKPreviewCommand=function(){this.Name='Preview';};FCKPreviewCommand.prototype.Execute=function(){FCK.Preview();};FCKPreviewCommand.prototype.GetState=function(){return 0;};var FCKSaveCommand=function(){this.Name='Save';};FCKSaveCommand.prototype.Execute=function(){var A=FCK.GetParentForm();if (typeof(A.onsubmit)=='function'){var B=A.onsubmit();if (B!=null&&B===false) return;};if (typeof(A.submit)=='function') A.submit();else A.submit.click();};FCKSaveCommand.prototype.GetState=function(){return 0;};var FCKNewPageCommand=function(){this.Name='NewPage';};FCKNewPageCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();FCK.SetData('');FCKUndo.Typing=true;FCK.Focus();};FCKNewPageCommand.prototype.GetState=function(){return 0;};var FCKSourceCommand=function(){this.Name='Source';};FCKSourceCommand.prototype.Execute=function(){if (FCKConfig.SourcePopup){var A=FCKConfig.ScreenWidth*0.65;var B=FCKConfig.ScreenHeight*0.65;FCKDialog.OpenDialog('FCKDialog_Source',FCKLang.Source,'dialog/fck_source.html',A,B,null,null,true);}else FCK.SwitchEditMode();};FCKSourceCommand.prototype.GetState=function(){return (FCK.EditMode==0?0:1);};var FCKUndoCommand=function(){this.Name='Undo';};FCKUndoCommand.prototype.Execute=function(){FCKUndo.Undo();};FCKUndoCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return (FCKUndo.CheckUndoState()?0:-1);};var FCKRedoCommand=function(){this.Name='Redo';};FCKRedoCommand.prototype.Execute=function(){FCKUndo.Redo();};FCKRedoCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return (FCKUndo.CheckRedoState()?0:-1);};var FCKPageBreakCommand=function(){this.Name='PageBreak';};FCKPageBreakCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();var e=FCK.EditorDocument.createElement('DIV');e.style.pageBreakAfter='always';e.innerHTML=' ';var A=FCKDocumentProcessor_CreateFakeImage('FCK__PageBreak',e);var B=new FCKDomRange(FCK.EditorWindow);B.MoveToSelection();var C=B.SplitBlock();B.InsertNode(A);FCK.Events.FireEvent('OnSelectionChange');};FCKPageBreakCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return 0;};var FCKUnlinkCommand=function(){this.Name='Unlink';};FCKUnlinkCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();if (FCKBrowserInfo.IsGeckoLike){var A=FCK.Selection.MoveToAncestorNode('A');if (A) FCKTools.RemoveOuterTags(A);return;};FCK.ExecuteNamedCommand(this.Name);};FCKUnlinkCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;var A=FCK.GetNamedCommandState(this.Name);if (A==0&&FCK.EditMode==0){var B=FCKSelection.MoveToAncestorNode('A');var C=(B&&B.name.length>0&&B.href.length==0);if (C) A=-1;};return A;};var FCKVisitLinkCommand=function(){this.Name='VisitLink';};FCKVisitLinkCommand.prototype={GetState:function(){if (FCK.EditMode!=0) return -1;var A=FCK.GetNamedCommandState('Unlink');if (A==0){var B=FCKSelection.MoveToAncestorNode('A');if (!B.href) A=-1;};return A;},Execute:function(){var A=FCKSelection.MoveToAncestorNode('A');var B=A.getAttribute('_fcksavedurl')||A.getAttribute('href',2);if (!/:\/\//.test(B)){var C=FCKConfig.BaseHref;var D=FCK.GetInstanceObject('parent');if (!C){C=D.document.location.href;C=C.substring(0,C.lastIndexOf('/')+1);};if (/^\//.test(B)){try{C=C.match(/^.*:\/\/+[^\/]+/)[0];}catch (e){C=D.document.location.protocol+'://'+D.parent.document.location.host;}};B=C+B;};if (!window.open(B,'_blank')) alert(FCKLang.VisitLinkBlocked);}};var FCKSelectAllCommand=function(){this.Name='SelectAll';};FCKSelectAllCommand.prototype.Execute=function(){if (FCK.EditMode==0){FCK.ExecuteNamedCommand('SelectAll');}else{var A=FCK.EditingArea.Textarea;if (FCKBrowserInfo.IsIE){A.createTextRange().execCommand('SelectAll');}else{A.selectionStart=0;A.selectionEnd=A.value.length;};A.focus();}};FCKSelectAllCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return 0;};var FCKPasteCommand=function(){this.Name='Paste';};FCKPasteCommand.prototype={Execute:function(){if (FCKBrowserInfo.IsIE) FCK.Paste();else FCK.ExecuteNamedCommand('Paste');},GetState:function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('Paste');}};var FCKRuleCommand=function(){this.Name='Rule';};FCKRuleCommand.prototype={Execute:function(){FCKUndo.SaveUndoStep();FCK.InsertElement('hr');},GetState:function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('InsertHorizontalRule');}};var FCKCutCopyCommand=function(A){this.Name=A?'Cut':'Copy';};FCKCutCopyCommand.prototype={Execute:function(){var A=false;if (FCKBrowserInfo.IsIE){var B=function(){A=true;};var C='on'+this.Name.toLowerCase();FCK.EditorDocument.body.attachEvent(C,B);FCK.ExecuteNamedCommand(this.Name);FCK.EditorDocument.body.detachEvent(C,B);}else{try{FCK.ExecuteNamedCommand(this.Name);A=true;}catch(e){}};if (!A) alert(FCKLang['PasteError'+this.Name]);},GetState:function(){return FCK.EditMode!=0?-1:FCK.GetNamedCommandState('Cut');}};var FCKAnchorDeleteCommand=function(){this.Name='AnchorDelete';};FCKAnchorDeleteCommand.prototype={Execute:function(){if (FCK.Selection.GetType()=='Control'){FCK.Selection.Delete();}else{var A=FCK.Selection.GetSelectedElement();if (A){if (A.tagName=='IMG'&&A.getAttribute('_fckanchor')) oAnchor=FCK.GetRealElement(A);else A=null;};if (!A){oAnchor=FCK.Selection.MoveToAncestorNode('A');if (oAnchor) FCK.Selection.SelectNode(oAnchor);};if (oAnchor.href.length!=0){oAnchor.removeAttribute('name');if (FCKBrowserInfo.IsIE) oAnchor.className=oAnchor.className.replace(FCKRegexLib.FCK_Class,'');return;};if (A){A.parentNode.removeChild(A);return;};if (oAnchor.innerHTML.length==0){oAnchor.parentNode.removeChild(oAnchor);return;};FCKTools.RemoveOuterTags(oAnchor);};if (FCKBrowserInfo.IsGecko) FCK.Selection.Collapse(true);},GetState:function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('Unlink');}};var FCKDeleteDivCommand=function(){};FCKDeleteDivCommand.prototype={GetState:function(){if (FCK.EditMode!=0) return -1;var A=FCKSelection.GetParentElement();var B=new FCKElementPath(A);return B.BlockLimit&&B.BlockLimit.nodeName.IEquals('div')?0:-1;},Execute:function(){FCKUndo.SaveUndoStep();var A=FCKDomTools.GetSelectedDivContainers();var B=new FCKDomRange(FCK.EditorWindow);B.MoveToSelection();var C=B.CreateBookmark();for (var i=0;i\n \n
    \n '+FCKLang.ColorAutomatic+'\n \n ';FCKTools.AddEventListenerEx(C,'click',FCKTextColorCommand_AutoOnClick,this);if (!FCKBrowserInfo.IsIE) C.style.width='96%';var G=FCKConfig.FontColors.toString().split(',');var H=0;while (H
    ';if (H>=G.length) C.style.visibility='hidden';else FCKTools.AddEventListenerEx(C,'click',FCKTextColorCommand_OnClick,[this,L]);}};if (FCKConfig.EnableMoreFontColors){E=D.insertRow(-1).insertCell(-1);E.colSpan=8;C=E.appendChild(CreateSelectionDiv());C.innerHTML='
    '+FCKLang.ColorMoreColors+'
    ';FCKTools.AddEventListenerEx(C,'click',FCKTextColorCommand_MoreOnClick,this);};if (!FCKBrowserInfo.IsIE) C.style.width='96%';}; +var FCKTextColorCommand=function(A){this.Name=A=='ForeColor'?'TextColor':'BGColor';this.Type=A;var B;if (FCKBrowserInfo.IsIE) B=window;else if (FCK.ToolbarSet._IFrame) B=FCKTools.GetElementWindow(FCK.ToolbarSet._IFrame);else B=window.parent;this._Panel=new FCKPanel(B);this._Panel.AppendStyleSheet(FCKConfig.SkinEditorCSS);this._Panel.MainNode.className='FCK_Panel';this._CreatePanelBody(this._Panel.Document,this._Panel.MainNode);FCK.ToolbarSet.ToolbarItems.GetItem(this.Name).RegisterPanel(this._Panel);FCKTools.DisableSelection(this._Panel.Document.body);};FCKTextColorCommand.prototype.Execute=function(A,B,C){this._Panel.Show(A,B,C);};FCKTextColorCommand.prototype.SetColor=function(A){FCKUndo.SaveUndoStep();var B=FCKStyles.GetStyle('_FCK_'+(this.Type=='ForeColor'?'Color':'BackColor'));if (!A||A.length==0) FCK.Styles.RemoveStyle(B);else{B.SetVariable('Color',A);FCKStyles.ApplyStyle(B);};FCKUndo.SaveUndoStep();FCK.Focus();FCK.Events.FireEvent('OnSelectionChange');};FCKTextColorCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return 0;};function FCKTextColorCommand_OnMouseOver(){this.className='ColorSelected';};function FCKTextColorCommand_OnMouseOut(){this.className='ColorDeselected';};function FCKTextColorCommand_OnClick(A,B,C){this.className='ColorDeselected';B.SetColor(C);B._Panel.Hide();};function FCKTextColorCommand_AutoOnClick(A,B){this.className='ColorDeselected';B.SetColor('');B._Panel.Hide();};function FCKTextColorCommand_MoreOnClick(A,B){this.className='ColorDeselected';B._Panel.Hide();FCKDialog.OpenDialog('FCKDialog_Color',FCKLang.DlgColorTitle,'dialog/fck_colorselector.html',410,320,FCKTools.Bind(B,B.SetColor));};FCKTextColorCommand.prototype._CreatePanelBody=function(A,B){function CreateSelectionDiv(){var C=A.createElement("DIV");C.className='ColorDeselected';FCKTools.AddEventListenerEx(C,'mouseover',FCKTextColorCommand_OnMouseOver);FCKTools.AddEventListenerEx(C,'mouseout',FCKTextColorCommand_OnMouseOut);return C;};var D=B.appendChild(A.createElement("TABLE"));D.className='ForceBaseFont';D.style.tableLayout='fixed';D.cellPadding=0;D.cellSpacing=0;D.border=0;D.width=150;var E=D.insertRow(-1).insertCell(-1);E.colSpan=8;var C=E.appendChild(CreateSelectionDiv());C.innerHTML='\n \n \n \n \n
    '+FCKLang.ColorAutomatic+'
    ';FCKTools.AddEventListenerEx(C,'click',FCKTextColorCommand_AutoOnClick,this);if (!FCKBrowserInfo.IsIE) C.style.width='96%';var G=FCKConfig.FontColors.toString().split(',');var H=0;while (H
    ';if (H>=G.length) C.style.visibility='hidden';else FCKTools.AddEventListenerEx(C,'click',FCKTextColorCommand_OnClick,[this,L]);}};if (FCKConfig.EnableMoreFontColors){E=D.insertRow(-1).insertCell(-1);E.colSpan=8;C=E.appendChild(CreateSelectionDiv());C.innerHTML='
    '+FCKLang.ColorMoreColors+'
    ';FCKTools.AddEventListenerEx(C,'click',FCKTextColorCommand_MoreOnClick,this);if (!FCKBrowserInfo.IsIE) C.style.width='96%';}}; var FCKPastePlainTextCommand=function(){this.Name='PasteText';};FCKPastePlainTextCommand.prototype.Execute=function(){FCK.PasteAsPlainText();};FCKPastePlainTextCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('Paste');}; var FCKPasteWordCommand=function(){this.Name='PasteWord';};FCKPasteWordCommand.prototype.Execute=function(){FCK.PasteFromWord();};FCKPasteWordCommand.prototype.GetState=function(){if (FCK.EditMode!=0||FCKConfig.ForcePasteAsPlainText) return -1;else return FCK.GetNamedCommandState('Paste');}; var FCKTableCommand=function(A){this.Name=A;};FCKTableCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();if (!FCKBrowserInfo.IsGecko){switch (this.Name){case 'TableMergeRight':return FCKTableHandler.MergeRight();case 'TableMergeDown':return FCKTableHandler.MergeDown();}};switch (this.Name){case 'TableInsertRowAfter':return FCKTableHandler.InsertRow(false);case 'TableInsertRowBefore':return FCKTableHandler.InsertRow(true);case 'TableDeleteRows':return FCKTableHandler.DeleteRows();case 'TableInsertColumnAfter':return FCKTableHandler.InsertColumn(false);case 'TableInsertColumnBefore':return FCKTableHandler.InsertColumn(true);case 'TableDeleteColumns':return FCKTableHandler.DeleteColumns();case 'TableInsertCellAfter':return FCKTableHandler.InsertCell(null,false);case 'TableInsertCellBefore':return FCKTableHandler.InsertCell(null,true);case 'TableDeleteCells':return FCKTableHandler.DeleteCells();case 'TableMergeCells':return FCKTableHandler.MergeCells();case 'TableHorizontalSplitCell':return FCKTableHandler.HorizontalSplitCell();case 'TableVerticalSplitCell':return FCKTableHandler.VerticalSplitCell();case 'TableDelete':return FCKTableHandler.DeleteTable();default:return alert(FCKLang.UnknownCommand.replace(/%1/g,this.Name));}};FCKTableCommand.prototype.GetState=function(){if (FCK.EditorDocument!=null&&FCKSelection.HasAncestorNode('TABLE')){switch (this.Name){case 'TableHorizontalSplitCell':case 'TableVerticalSplitCell':if (FCKTableHandler.GetSelectedCells().length==1) return 0;else return -1;case 'TableMergeCells':if (FCKTableHandler.CheckIsSelectionRectangular()&&FCKTableHandler.GetSelectedCells().length>1) return 0;else return -1;case 'TableMergeRight':return FCKTableHandler.GetMergeRightTarget()?0:-1;case 'TableMergeDown':return FCKTableHandler.GetMergeDownTarget()?0:-1;default:return 0;}}else return -1;}; From 42bb547f240becab347040e9253275c0766afe39 Mon Sep 17 00:00:00 2001 From: Ivan Tcholakov Date: Wed, 29 Jul 2009 00:57:44 +0200 Subject: [PATCH 19/56] [svn r22431] FS#2867 - The online editor: Implementing 2.6.5 SVN patch, ticket #3427 - http://dev.fckeditor.net/ticket/3427 . --- documentation/changelog.html | 2 +- .../fckeditor/editor/dialog/fck_docprops.html | 34 +++++++++---------- .../fck_docprops/fck_document_preview.html | 2 +- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/documentation/changelog.html b/documentation/changelog.html index 928acb40ce..3d7440eba7 100644 --- a/documentation/changelog.html +++ b/documentation/changelog.html @@ -34,7 +34,7 @@
  • The installation sript: The page about system requilements has been updated. Also, at the very beginning, a check has been added whether the mbstring php-extension is installed - see the related forum topic. (FS#306)
  • A new php-based configuration for the online editor has been implemented, see dokeos/main/inc/lib/fckeditor/myconfig.php. Also, toolbar definitions have been split in separate php-files within the directory dokeos/main/inc/lib/fckeditor/toolbars/ . Customization of the editor is more convenient and flexible now. (FS#2867)
  • Online editor: A upgrade from FCKEditor 2.6.4 to FCKEditor 2.6.4.1 has been implemented. (FS#4383)
  • -
  • Online editor: Several known bug-fixes from FCKEditor 2.6.5 SVN have been implemented, tickets #1537, #2156, #2689, #2821, #2856, #2874, #2915, #3120, #3181, #3429, #3439, #3446, #3481, #3677, #3818, #3880. (FS#2867)
  • +
  • Online editor: Several known bug-fixes from FCKEditor 2.6.5 SVN have been implemented, tickets #1537, #2156, #2689, #2821, #2856, #2874, #2915, #3120, #3181, #3427, #3429, #3439, #3446, #3481, #3677, #3818, #3880. (FS#2867)
  • Online editor: The simple file manager, the advanced file manager and the image manager have been integrated by default with the editor's dialog system. Thus, they work faster and in a more secure way. (FS#2867)
  • Online editor: Blocking copy/paste for trainees has been added. The feature is configurable through editing the toolbar definition files within the directory dokeos/main/inc/lib/fckeditor/toolbars/ . (FS#2867)
  • Online editor: Preview tabs have been added to the dialogs for inserting video, flv-video, and YouTube video. (FS#2867)
  • diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_docprops.html b/main/inc/lib/fckeditor/editor/dialog/fck_docprops.html index e1875d74c4..364a23de5c 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_docprops.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_docprops.html @@ -21,11 +21,11 @@ * * Link dialog window. --> - + - - + + '+document.getElementById('xToolbarSpace').innerHTML+'');G.close();if(FCKBrowserInfo.IsAIR) FCKAdobeAIR.ToolbarSet_InitOutFrame(G);FCKTools.AddEventListener(G,'contextmenu',FCKTools.CancelEvent);FCKTools.AppendStyleSheet(G,FCKConfig.SkinEditorCSS);B=D.__FCKToolbarSet=new FCKToolbarSet(G);B._IFrame=F;if (FCK.IECleanup) FCK.IECleanup.AddItem(D,FCKToolbarSet_Target_Cleanup);};B.CurrentInstance=FCK;if (!B.ToolbarItems) B.ToolbarItems=FCKToolbarItems;FCK.AttachToOnSelectionChange(B.RefreshItemsState);return B;};function FCK_OnBlur(A){var B=A.ToolbarSet;if (B.CurrentInstance==A) B.Disable();};function FCK_OnFocus(A){var B=A.ToolbarSet;var C=A||FCK;B.CurrentInstance.FocusManager.RemoveWindow(B._IFrame.contentWindow);B.CurrentInstance=C;C.FocusManager.AddWindow(B._IFrame.contentWindow,true);B.Enable();};function FCKToolbarSet_Cleanup(){this._TargetElement=null;this._IFrame=null;};function FCKToolbarSet_Target_Cleanup(){this.__FCKToolbarSet=null;};var FCKToolbarSet=function(A){this._Document=A;this._TargetElement=A.getElementById('xToolbar');var B=A.getElementById('xExpandHandle');var C=A.getElementById('xCollapseHandle');B.title=FCKLang.ToolbarExpand;FCKTools.AddEventListener(B,'click',FCKToolbarSet_Expand_OnClick);C.title=FCKLang.ToolbarCollapse;FCKTools.AddEventListener(C,'click',FCKToolbarSet_Collapse_OnClick);if (!FCKConfig.ToolbarCanCollapse||FCKConfig.ToolbarStartExpanded) this.Expand();else this.Collapse();C.style.display=FCKConfig.ToolbarCanCollapse?'':'none';if (FCKConfig.ToolbarCanCollapse) C.style.display='';else A.getElementById('xTBLeftBorder').style.display='';this.Toolbars=[];this.IsLoaded=false;if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKToolbarSet_Cleanup);};function FCKToolbarSet_Expand_OnClick(){FCK.ToolbarSet.Expand();};function FCKToolbarSet_Collapse_OnClick(){FCK.ToolbarSet.Collapse();};FCKToolbarSet.prototype.Expand=function(){this._ChangeVisibility(false);};FCKToolbarSet.prototype.Collapse=function(){this._ChangeVisibility(true);};FCKToolbarSet.prototype._ChangeVisibility=function(A){this._Document.getElementById('xCollapsed').style.display=A?'':'none';this._Document.getElementById('xExpanded').style.display=A?'none':'';if (FCKBrowserInfo.IsGecko){FCKTools.RunFunction(window.onresize);}};FCKToolbarSet.prototype.Load=function(A){this.Name=A;this.Items=[];this.ItemsWysiwygOnly=[];this.ItemsContextSensitive=[];this._TargetElement.innerHTML='';var B=FCKConfig.ToolbarSets[A];if (!B){alert(FCKLang.UnknownToolbarSet.replace(/%1/g,A));return;};this.Toolbars=[];for (var x=0;x0) break;}catch (e){break;};D=D.parent;};var E=D.document;var F=function(){if (!B) B=FCKConfig.FloatingPanelsZIndex+999;return++B;};var G=function(){if (!C) return;var H=FCKTools.IsStrictMode(E)?E.documentElement:E.body;FCKDomTools.SetElementStyles(C,{'width':Math.max(H.scrollWidth,H.clientWidth,E.scrollWidth||0)-1+'px','height':Math.max(H.scrollHeight,H.clientHeight,E.scrollHeight||0)-1+'px'});};return {OpenDialog:function(dialogName,dialogTitle,dialogPage,width,height,customValue,parentWindow,resizable){if (!A) this.DisplayMainCover();var I={Title:dialogTitle,Page:dialogPage,Editor:window,CustomValue:customValue,TopWindow:D};FCK.ToolbarSet.CurrentInstance.Selection.Save(true);var J=FCKTools.GetViewPaneSize(D);var K={ 'X':0,'Y':0 };var L=FCKBrowserInfo.IsIE&&(!FCKBrowserInfo.IsIE7||!FCKTools.IsStrictMode(D.document));if (L) K=FCKTools.GetScrollPosition(D);var M=Math.max(K.Y+(J.Height-height-20)/2,0);var N=Math.max(K.X+(J.Width-width-20)/2,0);var O=E.createElement('iframe');FCKTools.ResetStyles(O);O.src=FCKConfig.BasePath+'fckdialog.html';O.frameBorder=0;O.allowTransparency=true;FCKDomTools.SetElementStyles(O,{'position':(L)?'absolute':'fixed','top':M+'px','left':N+'px','width':width+'px','height':height+'px','zIndex':F()});O._DialogArguments=I;E.body.appendChild(O);O._ParentDialog=A;A=O;},OnDialogClose:function(dialogWindow){var O=dialogWindow.frameElement;FCKDomTools.RemoveNode(O);if (O._ParentDialog){A=O._ParentDialog;O._ParentDialog.contentWindow.SetEnabled(true);}else{if (!FCKBrowserInfo.IsIE) FCK.Focus();this.HideMainCover();setTimeout(function(){ A=null;},0);FCK.ToolbarSet.CurrentInstance.Selection.Release();}},DisplayMainCover:function(){C=E.createElement('div');FCKTools.ResetStyles(C);FCKDomTools.SetElementStyles(C,{'position':'absolute','zIndex':F(),'top':'0px','left':'0px','backgroundColor':FCKConfig.BackgroundBlockerColor});FCKDomTools.SetOpacity(C,FCKConfig.BackgroundBlockerOpacity);if (FCKBrowserInfo.IsIE&&!FCKBrowserInfo.IsIE7){var Q=E.createElement('iframe');FCKTools.ResetStyles(Q);Q.hideFocus=true;Q.frameBorder=0;Q.src=FCKTools.GetVoidUrl();FCKDomTools.SetElementStyles(Q,{'width':'100%','height':'100%','position':'absolute','left':'0px','top':'0px','filter':'progid:DXImageTransform.Microsoft.Alpha(opacity=0)'});C.appendChild(Q);};FCKTools.AddEventListener(D,'resize',G);G();E.body.appendChild(C);FCKFocusManager.Lock();var R=FCK.ToolbarSet.CurrentInstance.GetInstanceObject('frameElement');R._fck_originalTabIndex=R.tabIndex;R.tabIndex=-1;},HideMainCover:function(){FCKDomTools.RemoveNode(C);FCKFocusManager.Unlock();var R=FCK.ToolbarSet.CurrentInstance.GetInstanceObject('frameElement');R.tabIndex=R._fck_originalTabIndex;FCKDomTools.ClearElementJSProperty(R,'_fck_originalTabIndex');},GetCover:function(){return C;}};})(); +var FCKDialog=(function(){var A;var B;var C;var D=window.parent;while (D.parent&&D.parent!=D){try{if (D.parent.document.domain!=document.domain) break;if (D.parent.document.getElementsByTagName('frameset').length>0) break;}catch (e){break;};D=D.parent;};var E=D.document;var F=function(){if (!B) B=FCKConfig.FloatingPanelsZIndex+999;return++B;};var G=function(){if (!C) return;var H=FCKTools.IsStrictMode(E)?E.documentElement:E.body;FCKDomTools.SetElementStyles(C,{'width':Math.max(H.scrollWidth,H.clientWidth,E.scrollWidth||0)-1+'px','height':Math.max(H.scrollHeight,H.clientHeight,E.scrollHeight||0)-1+'px'});};return {OpenDialog:function(dialogName,dialogTitle,dialogPage,width,height,customValue,resizable){if (!A) this.DisplayMainCover();var I={Title:dialogTitle,Page:dialogPage,Editor:window,CustomValue:customValue,TopWindow:D};FCK.ToolbarSet.CurrentInstance.Selection.Save(true);var J=FCKTools.GetViewPaneSize(D);var K={ 'X':0,'Y':0 };var L=FCKBrowserInfo.IsIE&&(!FCKBrowserInfo.IsIE7||!FCKTools.IsStrictMode(D.document));if (L) K=FCKTools.GetScrollPosition(D);var M=Math.max(K.Y+(J.Height-height-20)/2,0);var N=Math.max(K.X+(J.Width-width-20)/2,0);var O=E.createElement('iframe');FCKTools.ResetStyles(O);O.src=FCKConfig.BasePath+'fckdialog.html';O.frameBorder=0;O.allowTransparency=true;FCKDomTools.SetElementStyles(O,{'position':(L)?'absolute':'fixed','top':M+'px','left':N+'px','width':width+'px','height':height+'px','zIndex':F()});O._DialogArguments=I;E.body.appendChild(O);O._ParentDialog=A;A=O;},OnDialogClose:function(dialogWindow){var O=dialogWindow.frameElement;FCKDomTools.RemoveNode(O);if (O._ParentDialog){A=O._ParentDialog;O._ParentDialog.contentWindow.SetEnabled(true);}else{if (!FCKBrowserInfo.IsIE) FCK.Focus();this.HideMainCover();setTimeout(function(){ A=null;},0);FCK.ToolbarSet.CurrentInstance.Selection.Release();}},DisplayMainCover:function(){C=E.createElement('div');FCKTools.ResetStyles(C);FCKDomTools.SetElementStyles(C,{'position':'absolute','zIndex':F(),'top':'0px','left':'0px','backgroundColor':FCKConfig.BackgroundBlockerColor});FCKDomTools.SetOpacity(C,FCKConfig.BackgroundBlockerOpacity);if (FCKBrowserInfo.IsIE&&!FCKBrowserInfo.IsIE7){var Q=E.createElement('iframe');FCKTools.ResetStyles(Q);Q.hideFocus=true;Q.frameBorder=0;Q.src=FCKTools.GetVoidUrl();FCKDomTools.SetElementStyles(Q,{'width':'100%','height':'100%','position':'absolute','left':'0px','top':'0px','filter':'progid:DXImageTransform.Microsoft.Alpha(opacity=0)'});C.appendChild(Q);};FCKTools.AddEventListener(D,'resize',G);G();E.body.appendChild(C);FCKFocusManager.Lock();var R=FCK.ToolbarSet.CurrentInstance.GetInstanceObject('frameElement');R._fck_originalTabIndex=R.tabIndex;R.tabIndex=-1;},HideMainCover:function(){FCKDomTools.RemoveNode(C);FCKFocusManager.Unlock();var R=FCK.ToolbarSet.CurrentInstance.GetInstanceObject('frameElement');R.tabIndex=R._fck_originalTabIndex;FCKDomTools.ClearElementJSProperty(R,'_fck_originalTabIndex');},GetCover:function(){return C;}};})(); var FCKMenuItem=function(A,B,C,D,E,F){this.Name=B;this.Label=C||B;this.IsDisabled=E;this.Icon=new FCKIcon(D);this.SubMenu=new FCKMenuBlockPanel();this.SubMenu.Parent=A;this.SubMenu.OnClick=FCKTools.CreateEventListener(FCKMenuItem_SubMenu_OnClick,this);this.CustomData=F;if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKMenuItem_Cleanup);};FCKMenuItem.prototype.AddItem=function(A,B,C,D,E){this.HasSubMenu=true;return this.SubMenu.AddItem(A,B,C,D,E);};FCKMenuItem.prototype.AddSeparator=function(){this.SubMenu.AddSeparator();};FCKMenuItem.prototype.Create=function(A){var B=this.HasSubMenu;var C=FCKTools.GetElementDocument(A);var r=this.MainElement=A.insertRow(-1);r.className=this.IsDisabled?'MN_Item_Disabled':'MN_Item';if (!this.IsDisabled){FCKTools.AddEventListenerEx(r,'mouseover',FCKMenuItem_OnMouseOver,[this]);FCKTools.AddEventListenerEx(r,'click',FCKMenuItem_OnClick,[this]);if (!B) FCKTools.AddEventListenerEx(r,'mouseout',FCKMenuItem_OnMouseOut,[this]);};var D=r.insertCell(-1);D.className='MN_Icon';D.appendChild(this.Icon.CreateIconElement(C));D=r.insertCell(-1);D.className='MN_Label';D.noWrap=true;D.appendChild(C.createTextNode(this.Label));D=r.insertCell(-1);if (B){D.className='MN_Arrow';var E=D.appendChild(C.createElement('IMG'));E.src=FCK_IMAGES_PATH+'arrow_'+FCKLang.Dir+'.gif';E.width=4;E.height=7;this.SubMenu.Create();this.SubMenu.Panel.OnHide=FCKTools.CreateEventListener(FCKMenuItem_SubMenu_OnHide,this);}};FCKMenuItem.prototype.Activate=function(){this.MainElement.className='MN_Item_Over';if (this.HasSubMenu){this.SubMenu.Show(this.MainElement.offsetWidth+2,-2,this.MainElement);};FCKTools.RunFunction(this.OnActivate,this);};FCKMenuItem.prototype.Deactivate=function(){this.MainElement.className='MN_Item';if (this.HasSubMenu) this.SubMenu.Hide();};function FCKMenuItem_SubMenu_OnClick(A,B){FCKTools.RunFunction(B.OnClick,B,[A]);};function FCKMenuItem_SubMenu_OnHide(A){A.Deactivate();};function FCKMenuItem_OnClick(A,B){if (B.HasSubMenu) B.Activate();else{B.Deactivate();FCKTools.RunFunction(B.OnClick,B,[B]);}};function FCKMenuItem_OnMouseOver(A,B){B.Activate();};function FCKMenuItem_OnMouseOut(A,B){B.Deactivate();};function FCKMenuItem_Cleanup(){this.MainElement=null;}; var FCKMenuBlock=function(){this._Items=[];};FCKMenuBlock.prototype.Count=function(){return this._Items.length;};FCKMenuBlock.prototype.AddItem=function(A,B,C,D,E){var F=new FCKMenuItem(this,A,B,C,D,E);F.OnClick=FCKTools.CreateEventListener(FCKMenuBlock_Item_OnClick,this);F.OnActivate=FCKTools.CreateEventListener(FCKMenuBlock_Item_OnActivate,this);this._Items.push(F);return F;};FCKMenuBlock.prototype.AddSeparator=function(){this._Items.push(new FCKMenuSeparator());};FCKMenuBlock.prototype.RemoveAllItems=function(){this._Items=[];var A=this._ItemsTable;if (A){while (A.rows.length>0) A.deleteRow(0);}};FCKMenuBlock.prototype.Create=function(A){if (!this._ItemsTable){if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKMenuBlock_Cleanup);this._Window=FCKTools.GetElementWindow(A);var B=FCKTools.GetElementDocument(A);var C=A.appendChild(B.createElement('table'));C.cellPadding=0;C.cellSpacing=0;FCKTools.DisableSelection(C);var D=C.insertRow(-1).insertCell(-1);D.className='MN_Menu';var E=this._ItemsTable=D.appendChild(B.createElement('table'));E.cellPadding=0;E.cellSpacing=0;};for (var i=0;i 
    ';var A=FCKDocumentProcessor_CreateFakeImage('FCK__PageBreak',e);var B=new FCKDomRange(FCK.EditorWindow);B.MoveToSelection();var C=B.SplitBlock();B.InsertNode(A);FCK.Events.FireEvent('OnSelectionChange');};FCKPageBreakCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return 0;};var FCKUnlinkCommand=function(){this.Name='Unlink';};FCKUnlinkCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();if (FCKBrowserInfo.IsGeckoLike){var A=FCK.Selection.MoveToAncestorNode('A');if (A) FCKTools.RemoveOuterTags(A);return;};FCK.ExecuteNamedCommand(this.Name);};FCKUnlinkCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;var A=FCK.GetNamedCommandState(this.Name);if (A==0&&FCK.EditMode==0){var B=FCKSelection.MoveToAncestorNode('A');var C=(B&&B.name.length>0&&B.href.length==0);if (C) A=-1;};return A;};var FCKVisitLinkCommand=function(){this.Name='VisitLink';};FCKVisitLinkCommand.prototype={GetState:function(){if (FCK.EditMode!=0) return -1;var A=FCK.GetNamedCommandState('Unlink');if (A==0){var B=FCKSelection.MoveToAncestorNode('A');if (!B.href) A=-1;};return A;},Execute:function(){var A=FCKSelection.MoveToAncestorNode('A');var B=A.getAttribute('_fcksavedurl')||A.getAttribute('href',2);if (!/:\/\//.test(B)){var C=FCKConfig.BaseHref;var D=FCK.GetInstanceObject('parent');if (!C){C=D.document.location.href;C=C.substring(0,C.lastIndexOf('/')+1);};if (/^\//.test(B)){try{C=C.match(/^.*:\/\/+[^\/]+/)[0];}catch (e){C=D.document.location.protocol+'://'+D.parent.document.location.host;}};B=C+B;};if (!window.open(B,'_blank')) alert(FCKLang.VisitLinkBlocked);}};var FCKSelectAllCommand=function(){this.Name='SelectAll';};FCKSelectAllCommand.prototype.Execute=function(){if (FCK.EditMode==0){FCK.ExecuteNamedCommand('SelectAll');}else{var A=FCK.EditingArea.Textarea;if (FCKBrowserInfo.IsIE){A.createTextRange().execCommand('SelectAll');}else{A.selectionStart=0;A.selectionEnd=A.value.length;};A.focus();}};FCKSelectAllCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return 0;};var FCKPasteCommand=function(){this.Name='Paste';};FCKPasteCommand.prototype={Execute:function(){if (FCKBrowserInfo.IsIE) FCK.Paste();else FCK.ExecuteNamedCommand('Paste');},GetState:function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('Paste');}};var FCKRuleCommand=function(){this.Name='Rule';};FCKRuleCommand.prototype={Execute:function(){FCKUndo.SaveUndoStep();FCK.InsertElement('hr');},GetState:function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('InsertHorizontalRule');}};var FCKCutCopyCommand=function(A){this.Name=A?'Cut':'Copy';};FCKCutCopyCommand.prototype={Execute:function(){var A=false;if (FCKBrowserInfo.IsIE){var B=function(){A=true;};var C='on'+this.Name.toLowerCase();FCK.EditorDocument.body.attachEvent(C,B);FCK.ExecuteNamedCommand(this.Name);FCK.EditorDocument.body.detachEvent(C,B);}else{try{FCK.ExecuteNamedCommand(this.Name);A=true;}catch(e){}};if (!A) alert(FCKLang['PasteError'+this.Name]);},GetState:function(){return FCK.EditMode!=0?-1:FCK.GetNamedCommandState('Cut');}};var FCKAnchorDeleteCommand=function(){this.Name='AnchorDelete';};FCKAnchorDeleteCommand.prototype={Execute:function(){if (FCK.Selection.GetType()=='Control'){FCK.Selection.Delete();}else{var A=FCK.Selection.GetSelectedElement();if (A){if (A.tagName=='IMG'&&A.getAttribute('_fckanchor')) oAnchor=FCK.GetRealElement(A);else A=null;};if (!A){oAnchor=FCK.Selection.MoveToAncestorNode('A');if (oAnchor) FCK.Selection.SelectNode(oAnchor);};if (oAnchor.href.length!=0){oAnchor.removeAttribute('name');if (FCKBrowserInfo.IsIE) oAnchor.className=oAnchor.className.replace(FCKRegexLib.FCK_Class,'');return;};if (A){A.parentNode.removeChild(A);return;};if (oAnchor.innerHTML.length==0){oAnchor.parentNode.removeChild(oAnchor);return;};FCKTools.RemoveOuterTags(oAnchor);};if (FCKBrowserInfo.IsGecko) FCK.Selection.Collapse(true);},GetState:function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('Unlink');}};var FCKDeleteDivCommand=function(){};FCKDeleteDivCommand.prototype={GetState:function(){if (FCK.EditMode!=0) return -1;var A=FCKSelection.GetParentElement();var B=new FCKElementPath(A);return B.BlockLimit&&B.BlockLimit.nodeName.IEquals('div')?0:-1;},Execute:function(){FCKUndo.SaveUndoStep();var A=FCKDomTools.GetSelectedDivContainers();var B=new FCKDomRange(FCK.EditorWindow);B.MoveToSelection();var C=B.CreateBookmark();for (var i=0;i 
    ';var A=FCKDocumentProcessor_CreateFakeImage('FCK__PageBreak',e);var B=new FCKDomRange(FCK.EditorWindow);B.MoveToSelection();var C=B.SplitBlock();B.InsertNode(A);FCK.Events.FireEvent('OnSelectionChange');};FCKPageBreakCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return 0;};var FCKUnlinkCommand=function(){this.Name='Unlink';};FCKUnlinkCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();if (FCKBrowserInfo.IsGeckoLike){var A=FCK.Selection.MoveToAncestorNode('A');if (A) FCKTools.RemoveOuterTags(A);return;};FCK.ExecuteNamedCommand(this.Name);};FCKUnlinkCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;var A=FCK.GetNamedCommandState(this.Name);if (A==0&&FCK.EditMode==0){var B=FCKSelection.MoveToAncestorNode('A');var C=(B&&B.name.length>0&&B.href.length==0);if (C) A=-1;};return A;};var FCKVisitLinkCommand=function(){this.Name='VisitLink';};FCKVisitLinkCommand.prototype={GetState:function(){if (FCK.EditMode!=0) return -1;var A=FCK.GetNamedCommandState('Unlink');if (A==0){var B=FCKSelection.MoveToAncestorNode('A');if (!B.href) A=-1;};return A;},Execute:function(){var A=FCKSelection.MoveToAncestorNode('A');var B=A.getAttribute('_fcksavedurl')||A.getAttribute('href',2);if (!/:\/\//.test(B)){var C=FCKConfig.BaseHref;var D=FCK.GetInstanceObject('parent');if (!C){C=D.document.location.href;C=C.substring(0,C.lastIndexOf('/')+1);};if (/^\//.test(B)){try{C=C.match(/^.*:\/\/+[^\/]+/)[0];}catch (e){C=D.document.location.protocol+'://'+D.parent.document.location.host;}};B=C+B;};if (!window.open(B,'_blank')) alert(FCKLang.VisitLinkBlocked);}};var FCKSelectAllCommand=function(){this.Name='SelectAll';};FCKSelectAllCommand.prototype.Execute=function(){if (FCK.EditMode==0){FCK.ExecuteNamedCommand('SelectAll');}else{var A=FCK.EditingArea.Textarea;if (FCKBrowserInfo.IsIE){A.createTextRange().execCommand('SelectAll');}else{A.selectionStart=0;A.selectionEnd=A.value.length;};A.focus();}};FCKSelectAllCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return 0;};var FCKPasteCommand=function(){this.Name='Paste';};FCKPasteCommand.prototype={Execute:function(){if (FCKBrowserInfo.IsIE) FCK.Paste();else FCK.ExecuteNamedCommand('Paste');},GetState:function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('Paste');}};var FCKRuleCommand=function(){this.Name='Rule';};FCKRuleCommand.prototype={Execute:function(){FCKUndo.SaveUndoStep();FCK.InsertElement('hr');},GetState:function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('InsertHorizontalRule');}};var FCKCutCopyCommand=function(A){this.Name=A?'Cut':'Copy';};FCKCutCopyCommand.prototype={Execute:function(){var A=false;if (FCKBrowserInfo.IsIE){var B=function(){A=true;};var C='on'+this.Name.toLowerCase();FCK.EditorDocument.body.attachEvent(C,B);FCK.ExecuteNamedCommand(this.Name);FCK.EditorDocument.body.detachEvent(C,B);}else{try{FCK.ExecuteNamedCommand(this.Name);A=true;}catch(e){}};if (!A) alert(FCKLang['PasteError'+this.Name]);},GetState:function(){return FCK.EditMode!=0?-1:FCK.GetNamedCommandState('Cut');}};var FCKAnchorDeleteCommand=function(){this.Name='AnchorDelete';};FCKAnchorDeleteCommand.prototype={Execute:function(){if (FCK.Selection.GetType()=='Control'){FCK.Selection.Delete();}else{var A=FCK.Selection.GetSelectedElement();if (A){if (A.tagName=='IMG'&&A.getAttribute('_fckanchor')) oAnchor=FCK.GetRealElement(A);else A=null;};if (!A){oAnchor=FCK.Selection.MoveToAncestorNode('A');if (oAnchor) FCK.Selection.SelectNode(oAnchor);};if (oAnchor.href.length!=0){oAnchor.removeAttribute('name');if (FCKBrowserInfo.IsIE) oAnchor.className=oAnchor.className.replace(FCKRegexLib.FCK_Class,'');return;};if (A){A.parentNode.removeChild(A);return;};if (oAnchor.innerHTML.length==0){oAnchor.parentNode.removeChild(oAnchor);return;};FCKTools.RemoveOuterTags(oAnchor);};if (FCKBrowserInfo.IsGecko) FCK.Selection.Collapse(true);},GetState:function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('Unlink');}};var FCKDeleteDivCommand=function(){};FCKDeleteDivCommand.prototype={GetState:function(){if (FCK.EditMode!=0) return -1;var A=FCKSelection.GetParentElement();var B=new FCKElementPath(A);return B.BlockLimit&&B.BlockLimit.nodeName.IEquals('div')?0:-1;},Execute:function(){FCKUndo.SaveUndoStep();var A=FCKDomTools.GetSelectedDivContainers();var B=new FCKDomRange(FCK.EditorWindow);B.MoveToSelection();var C=B.CreateBookmark();for (var i=0;i\n \n
    \n '+FCKLang.ColorAutomatic+'\n \n ';FCKTools.AddEventListenerEx(C,'click',FCKTextColorCommand_AutoOnClick,this);if (!FCKBrowserInfo.IsIE) C.style.width='96%';var G=FCKConfig.FontColors.toString().split(',');var H=0;while (H
    ';if (H>=G.length) C.style.visibility='hidden';else FCKTools.AddEventListenerEx(C,'click',FCKTextColorCommand_OnClick,[this,L]);}};if (FCKConfig.EnableMoreFontColors){E=D.insertRow(-1).insertCell(-1);E.colSpan=8;C=E.appendChild(CreateSelectionDiv());C.innerHTML='
    '+FCKLang.ColorMoreColors+'
    ';FCKTools.AddEventListenerEx(C,'click',FCKTextColorCommand_MoreOnClick,this);if (!FCKBrowserInfo.IsIE) C.style.width='96%';}}; @@ -98,7 +98,7 @@ var FCKToolbarItems={};FCKToolbarItems.LoadedItems={};FCKToolbarItems.RegisterIt var FCKToolbar=function(){this.Items=[];};FCKToolbar.prototype.AddItem=function(A){return this.Items[this.Items.length]=A;};FCKToolbar.prototype.AddButton=function(A,B,C,D,E,F){if (typeof(D)=='number') D=[this.DefaultIconsStrip,this.DefaultIconSize,D];var G=new FCKToolbarButtonUI(A,B,C,D,E,F);G._FCKToolbar=this;G.OnClick=FCKToolbar_OnItemClick;return this.AddItem(G);};function FCKToolbar_OnItemClick(A){var B=A._FCKToolbar;if (B.OnItemClick) B.OnItemClick(B,A);};FCKToolbar.prototype.AddSeparator=function(){this.AddItem(new FCKToolbarSeparator());};FCKToolbar.prototype.Create=function(A){var B=FCKTools.GetElementDocument(A);var e=B.createElement('table');e.className='TB_Toolbar';e.style.styleFloat=e.style.cssFloat=(FCKLang.Dir=='ltr'?'left':'right');e.dir=FCKLang.Dir;e.cellPadding=0;e.cellSpacing=0;var C=e.insertRow(-1);var D;if (!this.HideStart){D=C.insertCell(-1);D.appendChild(B.createElement('div')).className='TB_Start';};for (var i=0;i';G.open();G.write(''+H+''+document.getElementById('xToolbarSpace').innerHTML+'');G.close();if(FCKBrowserInfo.IsAIR) FCKAdobeAIR.ToolbarSet_InitOutFrame(G);FCKTools.AddEventListener(G,'contextmenu',FCKTools.CancelEvent);FCKTools.AppendStyleSheet(G,FCKConfig.SkinEditorCSS);B=D.__FCKToolbarSet=new FCKToolbarSet(G);B._IFrame=F;if (FCK.IECleanup) FCK.IECleanup.AddItem(D,FCKToolbarSet_Target_Cleanup);};B.CurrentInstance=FCK;if (!B.ToolbarItems) B.ToolbarItems=FCKToolbarItems;FCK.AttachToOnSelectionChange(B.RefreshItemsState);return B;};function FCK_OnBlur(A){var B=A.ToolbarSet;if (B.CurrentInstance==A) B.Disable();};function FCK_OnFocus(A){var B=A.ToolbarSet;var C=A||FCK;B.CurrentInstance.FocusManager.RemoveWindow(B._IFrame.contentWindow);B.CurrentInstance=C;C.FocusManager.AddWindow(B._IFrame.contentWindow,true);B.Enable();};function FCKToolbarSet_Cleanup(){this._TargetElement=null;this._IFrame=null;};function FCKToolbarSet_Target_Cleanup(){this.__FCKToolbarSet=null;};var FCKToolbarSet=function(A){this._Document=A;this._TargetElement=A.getElementById('xToolbar');var B=A.getElementById('xExpandHandle');var C=A.getElementById('xCollapseHandle');B.title=FCKLang.ToolbarExpand;FCKTools.AddEventListener(B,'click',FCKToolbarSet_Expand_OnClick);C.title=FCKLang.ToolbarCollapse;FCKTools.AddEventListener(C,'click',FCKToolbarSet_Collapse_OnClick);if (!FCKConfig.ToolbarCanCollapse||FCKConfig.ToolbarStartExpanded) this.Expand();else this.Collapse();C.style.display=FCKConfig.ToolbarCanCollapse?'':'none';if (FCKConfig.ToolbarCanCollapse) C.style.display='';else A.getElementById('xTBLeftBorder').style.display='';this.Toolbars=[];this.IsLoaded=false;if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKToolbarSet_Cleanup);};function FCKToolbarSet_Expand_OnClick(){FCK.ToolbarSet.Expand();};function FCKToolbarSet_Collapse_OnClick(){FCK.ToolbarSet.Collapse();};FCKToolbarSet.prototype.Expand=function(){this._ChangeVisibility(false);};FCKToolbarSet.prototype.Collapse=function(){this._ChangeVisibility(true);};FCKToolbarSet.prototype._ChangeVisibility=function(A){this._Document.getElementById('xCollapsed').style.display=A?'':'none';this._Document.getElementById('xExpanded').style.display=A?'none':'';if (FCKBrowserInfo.IsGecko){FCKTools.RunFunction(window.onresize);}};FCKToolbarSet.prototype.Load=function(A){this.Name=A;this.Items=[];this.ItemsWysiwygOnly=[];this.ItemsContextSensitive=[];this._TargetElement.innerHTML='';var B=FCKConfig.ToolbarSets[A];if (!B){alert(FCKLang.UnknownToolbarSet.replace(/%1/g,A));return;};this.Toolbars=[];for (var x=0;x0) break;}catch (e){break;};D=D.parent;};var E=D.document;var F=function(){if (!B) B=FCKConfig.FloatingPanelsZIndex+999;return++B;};var G=function(){if (!C) return;var H=FCKTools.IsStrictMode(E)?E.documentElement:E.body;FCKDomTools.SetElementStyles(C,{'width':Math.max(H.scrollWidth,H.clientWidth,E.scrollWidth||0)-1+'px','height':Math.max(H.scrollHeight,H.clientHeight,E.scrollHeight||0)-1+'px'});};return {OpenDialog:function(dialogName,dialogTitle,dialogPage,width,height,customValue,parentWindow,resizable){if (!A) this.DisplayMainCover();var I={Title:dialogTitle,Page:dialogPage,Editor:window,CustomValue:customValue,TopWindow:D};FCK.ToolbarSet.CurrentInstance.Selection.Save(true);var J=FCKTools.GetViewPaneSize(D);var K={ 'X':0,'Y':0 };var L=FCKBrowserInfo.IsIE&&(!FCKBrowserInfo.IsIE7||!FCKTools.IsStrictMode(D.document));if (L) K=FCKTools.GetScrollPosition(D);var M=Math.max(K.Y+(J.Height-height-20)/2,0);var N=Math.max(K.X+(J.Width-width-20)/2,0);var O=E.createElement('iframe');FCKTools.ResetStyles(O);O.src=FCKConfig.BasePath+'fckdialog.html';O.frameBorder=0;O.allowTransparency=true;FCKDomTools.SetElementStyles(O,{'position':(L)?'absolute':'fixed','top':M+'px','left':N+'px','width':width+'px','height':height+'px','zIndex':F()});O._DialogArguments=I;E.body.appendChild(O);O._ParentDialog=A;A=O;},OnDialogClose:function(dialogWindow){var O=dialogWindow.frameElement;FCKDomTools.RemoveNode(O);if (O._ParentDialog){A=O._ParentDialog;O._ParentDialog.contentWindow.SetEnabled(true);}else{if (!FCKBrowserInfo.IsIE) FCK.Focus();this.HideMainCover();setTimeout(function(){ A=null;},0);FCK.ToolbarSet.CurrentInstance.Selection.Release();}},DisplayMainCover:function(){C=E.createElement('div');FCKTools.ResetStyles(C);FCKDomTools.SetElementStyles(C,{'position':'absolute','zIndex':F(),'top':'0px','left':'0px','backgroundColor':FCKConfig.BackgroundBlockerColor});FCKDomTools.SetOpacity(C,FCKConfig.BackgroundBlockerOpacity);if (FCKBrowserInfo.IsIE&&!FCKBrowserInfo.IsIE7){var Q=E.createElement('iframe');FCKTools.ResetStyles(Q);Q.hideFocus=true;Q.frameBorder=0;Q.src=FCKTools.GetVoidUrl();FCKDomTools.SetElementStyles(Q,{'width':'100%','height':'100%','position':'absolute','left':'0px','top':'0px','filter':'progid:DXImageTransform.Microsoft.Alpha(opacity=0)'});C.appendChild(Q);};FCKTools.AddEventListener(D,'resize',G);G();E.body.appendChild(C);FCKFocusManager.Lock();var R=FCK.ToolbarSet.CurrentInstance.GetInstanceObject('frameElement');R._fck_originalTabIndex=R.tabIndex;R.tabIndex=-1;},HideMainCover:function(){FCKDomTools.RemoveNode(C);FCKFocusManager.Unlock();var R=FCK.ToolbarSet.CurrentInstance.GetInstanceObject('frameElement');R.tabIndex=R._fck_originalTabIndex;FCKDomTools.ClearElementJSProperty(R,'_fck_originalTabIndex');},GetCover:function(){return C;}};})(); +var FCKDialog=(function(){var A;var B;var C;var D=window.parent;while (D.parent&&D.parent!=D){try{if (D.parent.document.domain!=document.domain) break;if (D.parent.document.getElementsByTagName('frameset').length>0) break;}catch (e){break;};D=D.parent;};var E=D.document;var F=function(){if (!B) B=FCKConfig.FloatingPanelsZIndex+999;return++B;};var G=function(){if (!C) return;var H=FCKTools.IsStrictMode(E)?E.documentElement:E.body;FCKDomTools.SetElementStyles(C,{'width':Math.max(H.scrollWidth,H.clientWidth,E.scrollWidth||0)-1+'px','height':Math.max(H.scrollHeight,H.clientHeight,E.scrollHeight||0)-1+'px'});};return {OpenDialog:function(dialogName,dialogTitle,dialogPage,width,height,customValue,resizable){if (!A) this.DisplayMainCover();var I={Title:dialogTitle,Page:dialogPage,Editor:window,CustomValue:customValue,TopWindow:D};FCK.ToolbarSet.CurrentInstance.Selection.Save(true);var J=FCKTools.GetViewPaneSize(D);var K={ 'X':0,'Y':0 };var L=FCKBrowserInfo.IsIE&&(!FCKBrowserInfo.IsIE7||!FCKTools.IsStrictMode(D.document));if (L) K=FCKTools.GetScrollPosition(D);var M=Math.max(K.Y+(J.Height-height-20)/2,0);var N=Math.max(K.X+(J.Width-width-20)/2,0);var O=E.createElement('iframe');FCKTools.ResetStyles(O);O.src=FCKConfig.BasePath+'fckdialog.html';O.frameBorder=0;O.allowTransparency=true;FCKDomTools.SetElementStyles(O,{'position':(L)?'absolute':'fixed','top':M+'px','left':N+'px','width':width+'px','height':height+'px','zIndex':F()});O._DialogArguments=I;E.body.appendChild(O);O._ParentDialog=A;A=O;},OnDialogClose:function(dialogWindow){var O=dialogWindow.frameElement;FCKDomTools.RemoveNode(O);if (O._ParentDialog){A=O._ParentDialog;O._ParentDialog.contentWindow.SetEnabled(true);}else{if (!FCKBrowserInfo.IsIE) FCK.Focus();this.HideMainCover();setTimeout(function(){ A=null;},0);FCK.ToolbarSet.CurrentInstance.Selection.Release();}},DisplayMainCover:function(){C=E.createElement('div');FCKTools.ResetStyles(C);FCKDomTools.SetElementStyles(C,{'position':'absolute','zIndex':F(),'top':'0px','left':'0px','backgroundColor':FCKConfig.BackgroundBlockerColor});FCKDomTools.SetOpacity(C,FCKConfig.BackgroundBlockerOpacity);if (FCKBrowserInfo.IsIE&&!FCKBrowserInfo.IsIE7){var Q=E.createElement('iframe');FCKTools.ResetStyles(Q);Q.hideFocus=true;Q.frameBorder=0;Q.src=FCKTools.GetVoidUrl();FCKDomTools.SetElementStyles(Q,{'width':'100%','height':'100%','position':'absolute','left':'0px','top':'0px','filter':'progid:DXImageTransform.Microsoft.Alpha(opacity=0)'});C.appendChild(Q);};FCKTools.AddEventListener(D,'resize',G);G();E.body.appendChild(C);FCKFocusManager.Lock();var R=FCK.ToolbarSet.CurrentInstance.GetInstanceObject('frameElement');R._fck_originalTabIndex=R.tabIndex;R.tabIndex=-1;},HideMainCover:function(){FCKDomTools.RemoveNode(C);FCKFocusManager.Unlock();var R=FCK.ToolbarSet.CurrentInstance.GetInstanceObject('frameElement');R.tabIndex=R._fck_originalTabIndex;FCKDomTools.ClearElementJSProperty(R,'_fck_originalTabIndex');},GetCover:function(){return C;}};})(); var FCKMenuItem=function(A,B,C,D,E,F){this.Name=B;this.Label=C||B;this.IsDisabled=E;this.Icon=new FCKIcon(D);this.SubMenu=new FCKMenuBlockPanel();this.SubMenu.Parent=A;this.SubMenu.OnClick=FCKTools.CreateEventListener(FCKMenuItem_SubMenu_OnClick,this);this.CustomData=F;if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKMenuItem_Cleanup);};FCKMenuItem.prototype.AddItem=function(A,B,C,D,E){this.HasSubMenu=true;return this.SubMenu.AddItem(A,B,C,D,E);};FCKMenuItem.prototype.AddSeparator=function(){this.SubMenu.AddSeparator();};FCKMenuItem.prototype.Create=function(A){var B=this.HasSubMenu;var C=FCKTools.GetElementDocument(A);var r=this.MainElement=A.insertRow(-1);r.className=this.IsDisabled?'MN_Item_Disabled':'MN_Item';if (!this.IsDisabled){FCKTools.AddEventListenerEx(r,'mouseover',FCKMenuItem_OnMouseOver,[this]);FCKTools.AddEventListenerEx(r,'click',FCKMenuItem_OnClick,[this]);if (!B) FCKTools.AddEventListenerEx(r,'mouseout',FCKMenuItem_OnMouseOut,[this]);};var D=r.insertCell(-1);D.className='MN_Icon';D.appendChild(this.Icon.CreateIconElement(C));D=r.insertCell(-1);D.className='MN_Label';D.noWrap=true;D.appendChild(C.createTextNode(this.Label));D=r.insertCell(-1);if (B){D.className='MN_Arrow';var E=D.appendChild(C.createElement('IMG'));E.src=FCK_IMAGES_PATH+'arrow_'+FCKLang.Dir+'.gif';E.width=4;E.height=7;this.SubMenu.Create();this.SubMenu.Panel.OnHide=FCKTools.CreateEventListener(FCKMenuItem_SubMenu_OnHide,this);}};FCKMenuItem.prototype.Activate=function(){this.MainElement.className='MN_Item_Over';if (this.HasSubMenu){this.SubMenu.Show(this.MainElement.offsetWidth+2,-2,this.MainElement);};FCKTools.RunFunction(this.OnActivate,this);};FCKMenuItem.prototype.Deactivate=function(){this.MainElement.className='MN_Item';if (this.HasSubMenu) this.SubMenu.Hide();};function FCKMenuItem_SubMenu_OnClick(A,B){FCKTools.RunFunction(B.OnClick,B,[A]);};function FCKMenuItem_SubMenu_OnHide(A){A.Deactivate();};function FCKMenuItem_OnClick(A,B){if (B.HasSubMenu) B.Activate();else{B.Deactivate();FCKTools.RunFunction(B.OnClick,B,[B]);}};function FCKMenuItem_OnMouseOver(A,B){B.Activate();};function FCKMenuItem_OnMouseOut(A,B){B.Deactivate();};function FCKMenuItem_Cleanup(){this.MainElement=null;}; var FCKMenuBlock=function(){this._Items=[];};FCKMenuBlock.prototype.Count=function(){return this._Items.length;};FCKMenuBlock.prototype.AddItem=function(A,B,C,D,E){var F=new FCKMenuItem(this,A,B,C,D,E);F.OnClick=FCKTools.CreateEventListener(FCKMenuBlock_Item_OnClick,this);F.OnActivate=FCKTools.CreateEventListener(FCKMenuBlock_Item_OnActivate,this);this._Items.push(F);return F;};FCKMenuBlock.prototype.AddSeparator=function(){this._Items.push(new FCKMenuSeparator());};FCKMenuBlock.prototype.RemoveAllItems=function(){this._Items=[];var A=this._ItemsTable;if (A){while (A.rows.length>0) A.deleteRow(0);}};FCKMenuBlock.prototype.Create=function(A){if (!this._ItemsTable){if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKMenuBlock_Cleanup);this._Window=FCKTools.GetElementWindow(A);var B=FCKTools.GetElementDocument(A);var C=A.appendChild(B.createElement('table'));C.cellPadding=0;C.cellSpacing=0;FCKTools.DisableSelection(C);var D=C.insertRow(-1).insertCell(-1);D.className='MN_Menu';var E=this._ItemsTable=D.appendChild(B.createElement('table'));E.cellPadding=0;E.cellSpacing=0;};for (var i=0;i Date: Wed, 29 Jul 2009 02:09:48 +0200 Subject: [PATCH 21/56] [svn r22433] FS#2867 - The online editor: Removing some unnecessary files. --- .../server-scripts/spellchecker.cfm | 148 -------------- .../server-scripts/spellchecker.pl | 181 ------------------ 2 files changed, 329 deletions(-) delete mode 100644 main/inc/lib/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.cfm delete mode 100644 main/inc/lib/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.cfm b/main/inc/lib/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.cfm deleted file mode 100644 index 27e368e8bb..0000000000 --- a/main/inc/lib/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.cfm +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ]+>", " ", "all")> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl b/main/inc/lib/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl deleted file mode 100644 index 443fa8001a..0000000000 --- a/main/inc/lib/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl +++ /dev/null @@ -1,181 +0,0 @@ -#!/usr/bin/perl - -use CGI qw/ :standard /; -use File::Temp qw/ tempfile tempdir /; - -# my $spellercss = '/speller/spellerStyle.css'; # by FredCK -my $spellercss = '../spellerStyle.css'; # by FredCK -# my $wordWindowSrc = '/speller/wordWindow.js'; # by FredCK -my $wordWindowSrc = '../wordWindow.js'; # by FredCK -my @textinputs = param( 'textinputs[]' ); # array -# my $aspell_cmd = 'aspell'; # by FredCK (for Linux) -my $aspell_cmd = '"C:\Program Files\Aspell\bin\aspell.exe"'; # by FredCK (for Windows) -my $lang = 'en_US'; -# my $aspell_opts = "-a --lang=$lang --encoding=utf-8"; # by FredCK -my $aspell_opts = "-a --lang=$lang --encoding=utf-8 -H --rem-sgml-check=alt"; # by FredCK -my $input_separator = "A"; - -# set the 'wordtext' JavaScript variable to the submitted text. -sub printTextVar { - for( my $i = 0; $i <= $#textinputs; $i++ ) { - print "textinputs[$i] = decodeURIComponent('" . escapeQuote( $textinputs[$i] ) . "')\n"; - } -} - -sub printTextIdxDecl { - my $idx = shift; - print "words[$idx] = [];\n"; - print "suggs[$idx] = [];\n"; -} - -sub printWordsElem { - my( $textIdx, $wordIdx, $word ) = @_; - print "words[$textIdx][$wordIdx] = '" . escapeQuote( $word ) . "';\n"; -} - -sub printSuggsElem { - my( $textIdx, $wordIdx, @suggs ) = @_; - print "suggs[$textIdx][$wordIdx] = ["; - for my $i ( 0..$#suggs ) { - print "'" . escapeQuote( $suggs[$i] ) . "'"; - if( $i < $#suggs ) { - print ", "; - } - } - print "];\n"; -} - -sub printCheckerResults { - my $textInputIdx = -1; - my $wordIdx = 0; - my $unhandledText; - # create temp file - my $dir = tempdir( CLEANUP => 1 ); - my( $fh, $tmpfilename ) = tempfile( DIR => $dir ); - - # temp file was created properly? - - # open temp file, add the submitted text. - for( my $i = 0; $i <= $#textinputs; $i++ ) { - $text = url_decode( $textinputs[$i] ); - # Strip all tags for the text. (by FredCK - #339 / #681) - $text =~ s/<[^>]+>/ /g; - @lines = split( /\n/, $text ); - print $fh "\%\n"; # exit terse mode - print $fh "^$input_separator\n"; - print $fh "!\n"; # enter terse mode - for my $line ( @lines ) { - # use carat on each line to escape possible aspell commands - print $fh "^$line\n"; - } - - } - # exec aspell command - my $cmd = "$aspell_cmd $aspell_opts < $tmpfilename 2>&1"; - open ASPELL, "$cmd |" or handleError( "Could not execute `$cmd`\\n$!" ) and return; - # parse each line of aspell return - for my $ret ( ) { - chomp( $ret ); - # if '&', then not in dictionary but has suggestions - # if '#', then not in dictionary and no suggestions - # if '*', then it is a delimiter between text inputs - if( $ret =~ /^\*/ ) { - $textInputIdx++; - printTextIdxDecl( $textInputIdx ); - $wordIdx = 0; - - } elsif( $ret =~ /^(&|#)/ ) { - my @tokens = split( " ", $ret, 5 ); - printWordsElem( $textInputIdx, $wordIdx, $tokens[1] ); - my @suggs = (); - if( $tokens[4] ) { - @suggs = split( ", ", $tokens[4] ); - } - printSuggsElem( $textInputIdx, $wordIdx, @suggs ); - $wordIdx++; - } else { - $unhandledText .= $ret; - } - } - close ASPELL or handleError( "Error executing `$cmd`\\n$unhandledText" ) and return; -} - -sub escapeQuote { - my $str = shift; - $str =~ s/'/\\'/g; - return $str; -} - -sub handleError { - my $err = shift; - print "error = '" . escapeQuote( $err ) . "';\n"; -} - -sub url_decode { - local $_ = @_ ? shift : $_; - defined or return; - # change + signs to spaces - tr/+/ /; - # change hex escapes to the proper characters - s/%([a-fA-F0-9]{2})/pack "H2", $1/eg; - return $_; -} - -# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # -# Display HTML -# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # - -print < - - - - - - - - - - - - - -EOF From 34ad2680f1e7fc7f46c22be7e14d0c39e2f23cfd Mon Sep 17 00:00:00 2001 From: Ivan Tcholakov Date: Wed, 29 Jul 2009 02:14:10 +0200 Subject: [PATCH 22/56] [svn r22434] FS#2867 - The online editor: Removing a unnecessary option within the javascript configuration file. --- main/inc/lib/fckeditor/myconfig.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/main/inc/lib/fckeditor/myconfig.js b/main/inc/lib/fckeditor/myconfig.js index abcad2f4e3..02de6a6b24 100644 --- a/main/inc/lib/fckeditor/myconfig.js +++ b/main/inc/lib/fckeditor/myconfig.js @@ -116,11 +116,3 @@ FCKConfig.VideoUploadDeniedExtensions = '' ; FCKConfig.MediaUploadAllowedExtensions = '.(flv|mp4)$' ; FCKConfig.MediaUploadDeniedExtensions = '' ; // Note: These lists get combined with the platform's white and black lists. - - -/* - * Other settings. - */ - -// TODO: This setting seems obsolete. To be checked for removal. -FCKConfig.UserStatus = 'teacher' ; From 08e84bcb044e1057dd167eeed3f572eb12137f75 Mon Sep 17 00:00:00 2001 From: Ivan Tcholakov Date: Wed, 29 Jul 2009 02:25:09 +0200 Subject: [PATCH 23/56] [svn r22435] FS#2867 - The online editor: Updating the build-number. --- .../fckeditor/editor/_source/fckeditorapi.js | 356 +++++++++--------- .../fckeditor/editor/dialog/fck_about.html | 2 +- .../editor/js/fckeditorcode_gecko.js | 2 +- .../fckeditor/editor/js/fckeditorcode_ie.js | 2 +- 4 files changed, 181 insertions(+), 181 deletions(-) diff --git a/main/inc/lib/fckeditor/editor/_source/fckeditorapi.js b/main/inc/lib/fckeditor/editor/_source/fckeditorapi.js index c0937f71e2..95b7ee34ab 100644 --- a/main/inc/lib/fckeditor/editor/_source/fckeditorapi.js +++ b/main/inc/lib/fckeditor/editor/_source/fckeditorapi.js @@ -1,179 +1,179 @@ -/* - * FCKeditor - The text editor for Internet - http://www.fckeditor.net - * Copyright (C) 2003-2009 Frederico Caldeira Knabben - * - * == BEGIN LICENSE == - * - * Licensed under the terms of any of the following licenses at your - * choice: - * - * - GNU General Public License Version 2 or later (the "GPL") - * http://www.gnu.org/licenses/gpl.html - * - * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") - * http://www.gnu.org/licenses/lgpl.html - * - * - Mozilla Public License Version 1.1 or later (the "MPL") - * http://www.mozilla.org/MPL/MPL-1.1.html - * - * == END LICENSE == - * - * Create the FCKeditorAPI object that is available as a global object in - * the page where the editor is placed in. - */ - -var FCKeditorAPI ; - -function InitializeAPI() -{ - var oParentWindow = window.parent ; - - if ( !( FCKeditorAPI = oParentWindow.FCKeditorAPI ) ) - { - // Make the FCKeditorAPI object available in the parent window. Use - // eval so this core runs in the parent's scope and so it will still be - // available if the editor instance is removed ("Can't execute code - // from a freed script" error). - - // Note: we check the existence of oEditor.GetParentForm because some external - // code (like JSON) can extend the Object prototype and we get then extra oEditor - // objects that aren't really FCKeditor instances. - var sScript = +/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2009 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Create the FCKeditorAPI object that is available as a global object in + * the page where the editor is placed in. + */ + +var FCKeditorAPI ; + +function InitializeAPI() +{ + var oParentWindow = window.parent ; + + if ( !( FCKeditorAPI = oParentWindow.FCKeditorAPI ) ) + { + // Make the FCKeditorAPI object available in the parent window. Use + // eval so this core runs in the parent's scope and so it will still be + // available if the editor instance is removed ("Can't execute code + // from a freed script" error). + + // Note: we check the existence of oEditor.GetParentForm because some external + // code (like JSON) can extend the Object prototype and we get then extra oEditor + // objects that aren't really FCKeditor instances. + var sScript = 'window.FCKeditorAPI = {' + - 'Version : "2.6.4.1",' + - 'VersionBuild : "23195",' + - 'Instances : window.FCKeditorAPI && window.FCKeditorAPI.Instances || {},' + - - 'GetInstance : function( name )' + - '{' + - 'return this.Instances[ name ];' + - '},' + - - '_FormSubmit : function()' + - '{' + - 'for ( var name in FCKeditorAPI.Instances )' + - '{' + - 'var oEditor = FCKeditorAPI.Instances[ name ] ;' + - 'if ( oEditor.GetParentForm && oEditor.GetParentForm() == this )' + - 'oEditor.UpdateLinkedField() ;' + - '}' + - 'this._FCKOriginalSubmit() ;' + - '},' + - - '_FunctionQueue : window.FCKeditorAPI && window.FCKeditorAPI._FunctionQueue || {' + - 'Functions : new Array(),' + - 'IsRunning : false,' + - - 'Add : function( f )' + - '{' + - 'this.Functions.push( f );' + - 'if ( !this.IsRunning )' + - 'this.StartNext();' + - '},' + - - 'StartNext : function()' + - '{' + - 'var aQueue = this.Functions ;' + - 'if ( aQueue.length > 0 )' + - '{' + - 'this.IsRunning = true;' + - 'aQueue[0].call();' + - '}' + - 'else ' + - 'this.IsRunning = false;' + - '},' + - - 'Remove : function( f )' + - '{' + - 'var aQueue = this.Functions;' + - 'var i = 0, fFunc;' + - 'while( (fFunc = aQueue[ i ]) )' + - '{' + - 'if ( fFunc == f )' + - 'aQueue.splice( i,1 );' + - 'i++ ;' + - '}' + - 'this.StartNext();' + - '}' + - '}' + - '}' ; - - // In IE, the "eval" function is not always available (it works with - // the JavaScript samples, but not with the ASP ones, for example). - // So, let's use the execScript instead. - if ( oParentWindow.execScript ) - oParentWindow.execScript( sScript, 'JavaScript' ) ; - else - { - if ( FCKBrowserInfo.IsGecko10 ) - { - // FF 1.0.4 gives an error with the request bellow. The - // following seams to work well. - eval.call( oParentWindow, sScript ) ; - } - else if( FCKBrowserInfo.IsAIR ) - { - FCKAdobeAIR.FCKeditorAPI_Evaluate( oParentWindow, sScript ) ; - } - else if ( FCKBrowserInfo.IsSafari ) - { - // oParentWindow.eval in Safari executes in the calling window - // environment, instead of the parent one. The following should - // make it work. - var oParentDocument = oParentWindow.document ; - var eScript = oParentDocument.createElement('script') ; - eScript.appendChild( oParentDocument.createTextNode( sScript ) ) ; - oParentDocument.documentElement.appendChild( eScript ) ; - } - else - oParentWindow.eval( sScript ) ; - } - - FCKeditorAPI = oParentWindow.FCKeditorAPI ; - - // The __Instances properly has been changed to the public Instances, - // but we should still have the "deprecated" version of it. - FCKeditorAPI.__Instances = FCKeditorAPI.Instances ; - } - - // Add the current instance to the FCKeditorAPI's instances collection. - FCKeditorAPI.Instances[ FCK.Name ] = FCK ; -} - -// Attach to the form onsubmit event and to the form.submit(). -function _AttachFormSubmitToAPI() -{ - // Get the linked field form. - var oForm = FCK.GetParentForm() ; - - if ( oForm ) - { - // Attach to the onsubmit event. - FCKTools.AddEventListener( oForm, 'submit', FCK.UpdateLinkedField ) ; - - // IE sees oForm.submit function as an 'object'. - if ( !oForm._FCKOriginalSubmit && ( typeof( oForm.submit ) == 'function' || ( !oForm.submit.tagName && !oForm.submit.length ) ) ) - { - // Save the original submit. - oForm._FCKOriginalSubmit = oForm.submit ; - - // Create our replacement for the submit. - oForm.submit = FCKeditorAPI._FormSubmit ; - } - } -} - -function FCKeditorAPI_Cleanup() -{ - if ( window.FCKConfig && FCKConfig.MsWebBrowserControlCompat - && !window.FCKUnloadFlag ) - return ; - delete FCKeditorAPI.Instances[ FCK.Name ] ; -} -function FCKeditorAPI_ConfirmCleanup() -{ - if ( window.FCKConfig && FCKConfig.MsWebBrowserControlCompat ) - window.FCKUnloadFlag = true ; -} -FCKTools.AddEventListener( window, 'unload', FCKeditorAPI_Cleanup ) ; -FCKTools.AddEventListener( window, 'beforeunload', FCKeditorAPI_ConfirmCleanup) ; + 'Version : "2.6.4.1",' + + 'VersionBuild : "23405",' + + 'Instances : window.FCKeditorAPI && window.FCKeditorAPI.Instances || {},' + + + 'GetInstance : function( name )' + + '{' + + 'return this.Instances[ name ];' + + '},' + + + '_FormSubmit : function()' + + '{' + + 'for ( var name in FCKeditorAPI.Instances )' + + '{' + + 'var oEditor = FCKeditorAPI.Instances[ name ] ;' + + 'if ( oEditor.GetParentForm && oEditor.GetParentForm() == this )' + + 'oEditor.UpdateLinkedField() ;' + + '}' + + 'this._FCKOriginalSubmit() ;' + + '},' + + + '_FunctionQueue : window.FCKeditorAPI && window.FCKeditorAPI._FunctionQueue || {' + + 'Functions : new Array(),' + + 'IsRunning : false,' + + + 'Add : function( f )' + + '{' + + 'this.Functions.push( f );' + + 'if ( !this.IsRunning )' + + 'this.StartNext();' + + '},' + + + 'StartNext : function()' + + '{' + + 'var aQueue = this.Functions ;' + + 'if ( aQueue.length > 0 )' + + '{' + + 'this.IsRunning = true;' + + 'aQueue[0].call();' + + '}' + + 'else ' + + 'this.IsRunning = false;' + + '},' + + + 'Remove : function( f )' + + '{' + + 'var aQueue = this.Functions;' + + 'var i = 0, fFunc;' + + 'while( (fFunc = aQueue[ i ]) )' + + '{' + + 'if ( fFunc == f )' + + 'aQueue.splice( i,1 );' + + 'i++ ;' + + '}' + + 'this.StartNext();' + + '}' + + '}' + + '}' ; + + // In IE, the "eval" function is not always available (it works with + // the JavaScript samples, but not with the ASP ones, for example). + // So, let's use the execScript instead. + if ( oParentWindow.execScript ) + oParentWindow.execScript( sScript, 'JavaScript' ) ; + else + { + if ( FCKBrowserInfo.IsGecko10 ) + { + // FF 1.0.4 gives an error with the request bellow. The + // following seams to work well. + eval.call( oParentWindow, sScript ) ; + } + else if( FCKBrowserInfo.IsAIR ) + { + FCKAdobeAIR.FCKeditorAPI_Evaluate( oParentWindow, sScript ) ; + } + else if ( FCKBrowserInfo.IsSafari ) + { + // oParentWindow.eval in Safari executes in the calling window + // environment, instead of the parent one. The following should + // make it work. + var oParentDocument = oParentWindow.document ; + var eScript = oParentDocument.createElement('script') ; + eScript.appendChild( oParentDocument.createTextNode( sScript ) ) ; + oParentDocument.documentElement.appendChild( eScript ) ; + } + else + oParentWindow.eval( sScript ) ; + } + + FCKeditorAPI = oParentWindow.FCKeditorAPI ; + + // The __Instances properly has been changed to the public Instances, + // but we should still have the "deprecated" version of it. + FCKeditorAPI.__Instances = FCKeditorAPI.Instances ; + } + + // Add the current instance to the FCKeditorAPI's instances collection. + FCKeditorAPI.Instances[ FCK.Name ] = FCK ; +} + +// Attach to the form onsubmit event and to the form.submit(). +function _AttachFormSubmitToAPI() +{ + // Get the linked field form. + var oForm = FCK.GetParentForm() ; + + if ( oForm ) + { + // Attach to the onsubmit event. + FCKTools.AddEventListener( oForm, 'submit', FCK.UpdateLinkedField ) ; + + // IE sees oForm.submit function as an 'object'. + if ( !oForm._FCKOriginalSubmit && ( typeof( oForm.submit ) == 'function' || ( !oForm.submit.tagName && !oForm.submit.length ) ) ) + { + // Save the original submit. + oForm._FCKOriginalSubmit = oForm.submit ; + + // Create our replacement for the submit. + oForm.submit = FCKeditorAPI._FormSubmit ; + } + } +} + +function FCKeditorAPI_Cleanup() +{ + if ( window.FCKConfig && FCKConfig.MsWebBrowserControlCompat + && !window.FCKUnloadFlag ) + return ; + delete FCKeditorAPI.Instances[ FCK.Name ] ; +} +function FCKeditorAPI_ConfirmCleanup() +{ + if ( window.FCKConfig && FCKConfig.MsWebBrowserControlCompat ) + window.FCKUnloadFlag = true ; +} +FCKTools.AddEventListener( window, 'unload', FCKeditorAPI_Cleanup ) ; +FCKTools.AddEventListener( window, 'beforeunload', FCKeditorAPI_ConfirmCleanup) ; diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_about.html b/main/inc/lib/fckeditor/editor/dialog/fck_about.html index 66b2fc9aa6..392a79cae3 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_about.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_about.html @@ -79,7 +79,7 @@ window.onload = function() version
    2.6.4.1
    - Build 23195 + Build 23405 diff --git a/main/inc/lib/fckeditor/editor/js/fckeditorcode_gecko.js b/main/inc/lib/fckeditor/editor/js/fckeditorcode_gecko.js index 5868208a3e..0c79129f33 100644 --- a/main/inc/lib/fckeditor/editor/js/fckeditorcode_gecko.js +++ b/main/inc/lib/fckeditor/editor/js/fckeditorcode_gecko.js @@ -35,7 +35,7 @@ var FCKDebug={Output:function(){},OutputObject:function(){}}; var FCKDomTools={MoveChildren:function(A,B,C){if (A==B) return;var D;if (C){while ((D=A.lastChild)) B.insertBefore(A.removeChild(D),B.firstChild);}else{while ((D=A.firstChild)) B.appendChild(A.removeChild(D));}},MoveNode:function(A,B,C){if (C) B.insertBefore(FCKDomTools.RemoveNode(A),B.firstChild);else B.appendChild(FCKDomTools.RemoveNode(A));},TrimNode:function(A){this.LTrimNode(A);this.RTrimNode(A);},LTrimNode:function(A){var B;while ((B=A.firstChild)){if (B.nodeType==3){var C=B.nodeValue.LTrim();var D=B.nodeValue.length;if (C.length==0){A.removeChild(B);continue;}else if (C.length0) break;if (A.lastChild) A=A.lastChild;else return this.GetPreviousSourceElement(A,B,C,D);};return null;},GetNextSourceElement:function(A,B,C,D,E){while((A=this.GetNextSourceNode(A,E))){if (A.nodeType==1){if (C&&A.nodeName.IEquals(C)) break;if (D&&A.nodeName.IEquals(D)) return this.GetNextSourceElement(A,B,C,D);return A;}else if (B&&A.nodeType==3&&A.nodeValue.RTrim().length>0) break;};return null;},GetNextSourceNode:function(A,B,C,D){if (!A) return null;var E;if (!B&&A.firstChild) E=A.firstChild;else{if (D&&A==D) return null;E=A.nextSibling;if (!E&&(!D||D!=A.parentNode)) return this.GetNextSourceNode(A.parentNode,true,C,D);};if (C&&E&&E.nodeType!=C) return this.GetNextSourceNode(E,false,C,D);return E;},GetPreviousSourceNode:function(A,B,C,D){if (!A) return null;var E;if (!B&&A.lastChild) E=A.lastChild;else{if (D&&A==D) return null;E=A.previousSibling;if (!E&&(!D||D!=A.parentNode)) return this.GetPreviousSourceNode(A.parentNode,true,C,D);};if (C&&E&&E.nodeType!=C) return this.GetPreviousSourceNode(E,false,C,D);return E;},InsertAfterNode:function(A,B){return A.parentNode.insertBefore(B,A.nextSibling);},GetParents:function(A){var B=[];while (A){B.unshift(A);A=A.parentNode;};return B;},GetCommonParents:function(A,B){var C=this.GetParents(A);var D=this.GetParents(B);var E=[];for (var i=0;i0) D[C.pop().toLowerCase()]=1;var E=this.GetCommonParents(A,B);var F=null;while ((F=E.pop())){if (D[F.nodeName.toLowerCase()]) return F;};return null;},GetIndexOf:function(A){var B=A.parentNode?A.parentNode.firstChild:null;var C=-1;while (B){C++;if (B==A) return C;B=B.nextSibling;};return-1;},PaddingNode:null,EnforcePaddingNode:function(A,B){try{if (!A||!A.body) return;}catch (e){return;};this.CheckAndRemovePaddingNode(A,B,true);try{if (A.body.lastChild&&(A.body.lastChild.nodeType!=1||A.body.lastChild.tagName.toLowerCase()==B.toLowerCase())) return;}catch (e){return;};var C=A.createElement(B);if (FCKBrowserInfo.IsGecko&&FCKListsLib.NonEmptyBlockElements[B]) FCKTools.AppendBogusBr(C);this.PaddingNode=C;if (A.body.childNodes.length==1&&A.body.firstChild.nodeType==1&&A.body.firstChild.tagName.toLowerCase()=='br'&&(A.body.firstChild.getAttribute('_moz_dirty')!=null||A.body.firstChild.getAttribute('type')=='_moz')) A.body.replaceChild(C,A.body.firstChild);else A.body.appendChild(C);},CheckAndRemovePaddingNode:function(A,B,C){var D=this.PaddingNode;if (!D) return;try{if (D.parentNode!=A.body||D.tagName.toLowerCase()!=B||(D.childNodes.length>1)||(D.firstChild&&D.firstChild.nodeValue!='\xa0'&&String(D.firstChild.tagName).toLowerCase()!='br')){this.PaddingNode=null;return;}}catch (e){this.PaddingNode=null;return;};if (!C){if (D.parentNode.childNodes.length>1) D.parentNode.removeChild(D);this.PaddingNode=null;}},HasAttribute:function(A,B){if (A.hasAttribute) return A.hasAttribute(B);else{var C=A.attributes[B];return (C!=undefined&&C.specified);}},HasAttributes:function(A){var B=A.attributes;for (var i=0;i0) return true;continue;}};if (B[i].specified) return true;};return false;},RemoveAttribute:function(A,B){if (FCKBrowserInfo.IsIE&&B.toLowerCase()=='class') B='className';return A.removeAttribute(B,0);},RemoveAttributes:function (A,B){for (var i=0;i0) return false;C=C.nextSibling;};return D?this.CheckIsEmptyElement(D,B):true;},SetElementStyles:function(A,B){var C=A.style;for (var D in B) C[D]=B[D];},SetOpacity:function(A,B){if (FCKBrowserInfo.IsIE){B=Math.round(B*100);A.style.filter=(B>100?'':'progid:DXImageTransform.Microsoft.Alpha(opacity='+B+')');}else A.style.opacity=B;},GetCurrentElementStyle:function(A,B){if (FCKBrowserInfo.IsIE) return A.currentStyle[B];else return A.ownerDocument.defaultView.getComputedStyle(A,'').getPropertyValue(B);},GetPositionedAncestor:function(A){var B=A;while (B!=FCKTools.GetElementDocument(B).documentElement){if (this.GetCurrentElementStyle(B,'position')!='static') return B;if (B==FCKTools.GetElementDocument(B).documentElement&¤tWindow!=w) B=currentWindow.frameElement;else B=B.parentNode;};return null;},ScrollIntoView:function(A,B){var C=FCKTools.GetElementWindow(A);var D=FCKTools.GetViewPaneSize(C).Height;var E=D*-1;if (B===false){E+=A.offsetHeight||0;E+=parseInt(this.GetCurrentElementStyle(A,'marginBottom')||0,10)||0;};var F=FCKTools.GetDocumentPosition(C,A);E+=F.y;var G=FCKTools.GetScrollPosition(C).Y;if (E>0&&(E>G||E'+styleDef+'';};var C=function(cssFileUrl,markTemp){if (cssFileUrl.length==0) return '';var B=markTemp?' _fcktemp="true"':'';return '';};return function(cssFileOrArrayOrDef,markTemp){if (!cssFileOrArrayOrDef) return '';if (typeof(cssFileOrArrayOrDef)=='string'){if (/[\\\/\.][^{}]*$/.test(cssFileOrArrayOrDef)){return this.GetStyleHtml(cssFileOrArrayOrDef.split(','),markTemp);}else return A(this._GetUrlFixedCss(cssFileOrArrayOrDef),markTemp);}else{var E='';for (var i=0;i/g,'>');return A;};FCKTools.HTMLDecode=function(A){if (!A) return '';A=A.replace(/>/g,'>');A=A.replace(/</g,'<');A=A.replace(/&/g,'&');return A;};FCKTools._ProcessLineBreaksForPMode=function(A,B,C,D,E){var F=0;var G="

    ";var H="

    ";var I="
    ";if (C){G="
  • ";H="
  • ";F=1;}while (D&&D!=A.FCK.EditorDocument.body){if (D.tagName.toLowerCase()=='p'){F=1;break;};D=D.parentNode;};for (var i=0;i0) return A[A.length-1];return null;};FCKTools.GetDocumentPosition=function(w,A){var x=0;var y=0;var B=A;var C=null;var D=FCKTools.GetElementWindow(B);while (B&&!(D==w&&(B==w.document.body||B==w.document.documentElement))){x+=B.offsetLeft-B.scrollLeft;y+=B.offsetTop-B.scrollTop;if (!FCKBrowserInfo.IsOpera){var E=C;while (E&&E!=B){x-=E.scrollLeft;y-=E.scrollTop;E=E.parentNode;}};C=B;if (B.offsetParent) B=B.offsetParent;else{if (D!=w){B=D.frameElement;C=null;if (B) D=B.contentWindow.parent;}else B=null;}};if (FCKDomTools.GetCurrentElementStyle(w.document.body,'position')!='static'||(FCKBrowserInfo.IsIE&&FCKDomTools.GetPositionedAncestor(A)==null)){x+=w.document.body.offsetLeft;y+=w.document.body.offsetTop;};return { "x":x,"y":y };};FCKTools.GetWindowPosition=function(w,A){var B=this.GetDocumentPosition(w,A);var C=FCKTools.GetScrollPosition(w);B.x-=C.X;B.y-=C.Y;return B;};FCKTools.ProtectFormStyles=function(A){if (!A||A.nodeType!=1||A.tagName.toLowerCase()!='form') return [];var B=[];var C=['style','className'];for (var i=0;i0){for (var i=B.length-1;i>=0;i--){var C=B[i][0];var D=B[i][1];if (D) A.insertBefore(C,D);else A.appendChild(C);}}};FCKTools.GetNextNode=function(A,B){if (A.firstChild) return A.firstChild;else if (A.nextSibling) return A.nextSibling;else{var C=A.parentNode;while (C){if (C==B) return null;if (C.nextSibling) return C.nextSibling;else C=C.parentNode;}};return null;};FCKTools.GetNextTextNode=function(A,B,C){node=this.GetNextNode(A,B);if (C&&node&&C(node)) return null;while (node&&node.nodeType!=3){node=this.GetNextNode(node,B);if (C&&node&&C(node)) return null;};return node;};FCKTools.Merge=function(){var A=arguments;var o=A[0];for (var i=1;i');document.domain = '"+FCK_RUNTIME_DOMAIN+"';document.close();}() ) ;";if (FCKBrowserInfo.IsIE){if (FCKBrowserInfo.IsIE7||!FCKBrowserInfo.IsIE6) return "";else return "javascript: '';";};return "javascript: void(0);";};FCKTools.ResetStyles=function(A){A.style.cssText='margin:0;padding:0;border:0;background-color:transparent;background-image:none;';}; FCKTools.CancelEvent=function(e){if (e) e.preventDefault();};FCKTools.DisableSelection=function(A){if (FCKBrowserInfo.IsGecko) A.style.MozUserSelect='none';else if (FCKBrowserInfo.IsSafari) A.style.KhtmlUserSelect='none';else A.style.userSelect='none';};FCKTools._AppendStyleSheet=function(A,B){var e=A.createElement('LINK');e.rel='stylesheet';e.type='text/css';e.href=B;A.getElementsByTagName("HEAD")[0].appendChild(e);return e;};FCKTools.AppendStyleString=function(A,B){if (!B) return null;var e=A.createElement("STYLE");e.appendChild(A.createTextNode(B));A.getElementsByTagName("HEAD")[0].appendChild(e);return e;};FCKTools.ClearElementAttributes=function(A){for (var i=0;i0) B[B.length]=D;C(parent.childNodes[i]);}};C(A);return B;};FCKTools.RemoveOuterTags=function(e){var A=e.ownerDocument.createDocumentFragment();for (var i=0;i','text/xml');FCKDomTools.RemoveNode(B.firstChild);return B;};return null;};FCKTools.GetScrollPosition=function(A){return { X:A.pageXOffset,Y:A.pageYOffset };};FCKTools.AddEventListener=function(A,B,C){A.addEventListener(B,C,false);};FCKTools.RemoveEventListener=function(A,B,C){A.removeEventListener(B,C,false);};FCKTools.AddEventListenerEx=function(A,B,C,D){A.addEventListener(B,function(e){C.apply(A,[e].concat(D||[]));},false);};FCKTools.GetViewPaneSize=function(A){return { Width:A.innerWidth,Height:A.innerHeight };};FCKTools.SaveStyles=function(A){var B=FCKTools.ProtectFormStyles(A);var C={};if (A.className.length>0){C.Class=A.className;A.className='';};var D=A.getAttribute('style');if (D&&D.length>0){C.Inline=D;A.setAttribute('style','',0);};FCKTools.RestoreFormStyles(A,B);return C;};FCKTools.RestoreStyles=function(A,B){var C=FCKTools.ProtectFormStyles(A);A.className=B.Class||'';if (B.Inline) A.setAttribute('style',B.Inline,0);else A.removeAttribute('style',0);FCKTools.RestoreFormStyles(A,C);};FCKTools.RegisterDollarFunction=function(A){A.$=function(id){return A.document.getElementById(id);};};FCKTools.AppendElement=function(A,B){return A.appendChild(A.ownerDocument.createElement(B));};FCKTools.GetElementPosition=function(A,B){var c={ X:0,Y:0 };var C=B||window;var D=FCKTools.GetElementWindow(A);var E=null;while (A){var F=D.getComputedStyle(A,'').position;if (F&&F!='static'&&A.style.zIndex!=FCKConfig.FloatingPanelsZIndex) break;c.X+=A.offsetLeft-A.scrollLeft;c.Y+=A.offsetTop-A.scrollTop;if (!FCKBrowserInfo.IsOpera){var G=E;while (G&&G!=A){c.X-=G.scrollLeft;c.Y-=G.scrollTop;G=G.parentNode;}};E=A;if (A.offsetParent) A=A.offsetParent;else{if (D!=C){A=D.frameElement;E=null;if (A) D=FCKTools.GetElementWindow(A);}else{c.X+=A.scrollLeft;c.Y+=A.scrollTop;break;}}};return c;}; -var FCKeditorAPI;function InitializeAPI(){var A=window.parent;if (!(FCKeditorAPI=A.FCKeditorAPI)){var B='window.FCKeditorAPI = {Version : "2.6.4.1",VersionBuild : "23195",Instances : window.FCKeditorAPI && window.FCKeditorAPI.Instances || {},GetInstance : function( name ){return this.Instances[ name ];},_FormSubmit : function(){for ( var name in FCKeditorAPI.Instances ){var oEditor = FCKeditorAPI.Instances[ name ] ;if ( oEditor.GetParentForm && oEditor.GetParentForm() == this )oEditor.UpdateLinkedField() ;}this._FCKOriginalSubmit() ;},_FunctionQueue : window.FCKeditorAPI && window.FCKeditorAPI._FunctionQueue || {Functions : new Array(),IsRunning : false,Add : function( f ){this.Functions.push( f );if ( !this.IsRunning )this.StartNext();},StartNext : function(){var aQueue = this.Functions ;if ( aQueue.length > 0 ){this.IsRunning = true;aQueue[0].call();}else this.IsRunning = false;},Remove : function( f ){var aQueue = this.Functions;var i = 0, fFunc;while( (fFunc = aQueue[ i ]) ){if ( fFunc == f )aQueue.splice( i,1 );i++ ;}this.StartNext();}}}';if (A.execScript) A.execScript(B,'JavaScript');else{if (FCKBrowserInfo.IsGecko10){eval.call(A,B);}else if(FCKBrowserInfo.IsAIR){FCKAdobeAIR.FCKeditorAPI_Evaluate(A,B);}else if (FCKBrowserInfo.IsSafari){var C=A.document;var D=C.createElement('script');D.appendChild(C.createTextNode(B));C.documentElement.appendChild(D);}else A.eval(B);};FCKeditorAPI=A.FCKeditorAPI;FCKeditorAPI.__Instances=FCKeditorAPI.Instances;};FCKeditorAPI.Instances[FCK.Name]=FCK;};function _AttachFormSubmitToAPI(){var A=FCK.GetParentForm();if (A){FCKTools.AddEventListener(A,'submit',FCK.UpdateLinkedField);if (!A._FCKOriginalSubmit&&(typeof(A.submit)=='function'||(!A.submit.tagName&&!A.submit.length))){A._FCKOriginalSubmit=A.submit;A.submit=FCKeditorAPI._FormSubmit;}}};function FCKeditorAPI_Cleanup(){if (window.FCKConfig&&FCKConfig.MsWebBrowserControlCompat&&!window.FCKUnloadFlag) return;delete FCKeditorAPI.Instances[FCK.Name];};function FCKeditorAPI_ConfirmCleanup(){if (window.FCKConfig&&FCKConfig.MsWebBrowserControlCompat) window.FCKUnloadFlag=true;};FCKTools.AddEventListener(window,'unload',FCKeditorAPI_Cleanup);FCKTools.AddEventListener(window,'beforeunload',FCKeditorAPI_ConfirmCleanup); +var FCKeditorAPI;function InitializeAPI(){var A=window.parent;if (!(FCKeditorAPI=A.FCKeditorAPI)){var B='window.FCKeditorAPI = {Version : "2.6.4.1",VersionBuild : "23405",Instances : window.FCKeditorAPI && window.FCKeditorAPI.Instances || {},GetInstance : function( name ){return this.Instances[ name ];},_FormSubmit : function(){for ( var name in FCKeditorAPI.Instances ){var oEditor = FCKeditorAPI.Instances[ name ] ;if ( oEditor.GetParentForm && oEditor.GetParentForm() == this )oEditor.UpdateLinkedField() ;}this._FCKOriginalSubmit() ;},_FunctionQueue : window.FCKeditorAPI && window.FCKeditorAPI._FunctionQueue || {Functions : new Array(),IsRunning : false,Add : function( f ){this.Functions.push( f );if ( !this.IsRunning )this.StartNext();},StartNext : function(){var aQueue = this.Functions ;if ( aQueue.length > 0 ){this.IsRunning = true;aQueue[0].call();}else this.IsRunning = false;},Remove : function( f ){var aQueue = this.Functions;var i = 0, fFunc;while( (fFunc = aQueue[ i ]) ){if ( fFunc == f )aQueue.splice( i,1 );i++ ;}this.StartNext();}}}';if (A.execScript) A.execScript(B,'JavaScript');else{if (FCKBrowserInfo.IsGecko10){eval.call(A,B);}else if(FCKBrowserInfo.IsAIR){FCKAdobeAIR.FCKeditorAPI_Evaluate(A,B);}else if (FCKBrowserInfo.IsSafari){var C=A.document;var D=C.createElement('script');D.appendChild(C.createTextNode(B));C.documentElement.appendChild(D);}else A.eval(B);};FCKeditorAPI=A.FCKeditorAPI;FCKeditorAPI.__Instances=FCKeditorAPI.Instances;};FCKeditorAPI.Instances[FCK.Name]=FCK;};function _AttachFormSubmitToAPI(){var A=FCK.GetParentForm();if (A){FCKTools.AddEventListener(A,'submit',FCK.UpdateLinkedField);if (!A._FCKOriginalSubmit&&(typeof(A.submit)=='function'||(!A.submit.tagName&&!A.submit.length))){A._FCKOriginalSubmit=A.submit;A.submit=FCKeditorAPI._FormSubmit;}}};function FCKeditorAPI_Cleanup(){if (window.FCKConfig&&FCKConfig.MsWebBrowserControlCompat&&!window.FCKUnloadFlag) return;delete FCKeditorAPI.Instances[FCK.Name];};function FCKeditorAPI_ConfirmCleanup(){if (window.FCKConfig&&FCKConfig.MsWebBrowserControlCompat) window.FCKUnloadFlag=true;};FCKTools.AddEventListener(window,'unload',FCKeditorAPI_Cleanup);FCKTools.AddEventListener(window,'beforeunload',FCKeditorAPI_ConfirmCleanup); var FCKImagePreloader=function(){this._Images=[];};FCKImagePreloader.prototype={AddImages:function(A){if (typeof(A)=='string') A=A.split(';');this._Images=this._Images.concat(A);},Start:function(){var A=this._Images;this._PreloadCount=A.length;for (var i=0;i]*\>)/i,AfterBody:/(\<\/body\>[\s\S]*$)/i,ToReplace:/___fcktoreplace:([\w]+)/ig,MetaHttpEquiv:/http-equiv\s*=\s*["']?([^"' ]+)/i,HasBaseTag:/]/i,HtmlOpener:/]*>/i,HeadOpener:/]*>/i,HeadCloser:/<\/head\s*>/i,FCK_Class:/\s*FCK__[^ ]*(?=\s+|$)/,ElementName:/(^[a-z_:][\w.\-:]*\w$)|(^[a-z_]$)/,ForceSimpleAmpersand:/___FCKAmp___/g,SpaceNoClose:/\/>/g,EmptyParagraph:/^<(p|div|address|h\d|center)(?=[ >])[^>]*>\s*(<\/\1>)?$/,EmptyOutParagraph:/^<(p|div|address|h\d|center)(?=[ >])[^>]*>(?:\s*| | )(<\/\1>)?$/,TagBody:/>]+))/gi,ProtectUrlsA:/]+))/gi,ProtectUrlsArea:/]+))/gi,Html4DocType:/HTML 4\.0 Transitional/i,DocTypeTag:/]*>/i,HtmlDocType:/DTD HTML/,TagsWithEvent:/<[^\>]+ on\w+[\s\r\n]*=[\s\r\n]*?('|")[\s\S]+?\>/g,EventAttributes:/\s(on\w+)[\s\r\n]*=[\s\r\n]*?('|")([\s\S]*?)\2/g,ProtectedEvents:/\s\w+_fckprotectedatt="([^"]+)"/g,StyleProperties:/\S+\s*:/g,InvalidSelfCloseTags:/(<(?!base|meta|link|hr|br|param|img|area|input)([a-zA-Z0-9:]+)[^>]*)\/>/gi,StyleVariableAttName:/#\(\s*("|')(.+?)\1[^\)]*\s*\)/g,RegExp:/^\/(.*)\/([gim]*)$/,HtmlTag:/<[^\s<>](?:"[^"]*"|'[^']*'|[^<])*>/}; var FCKListsLib={BlockElements:{ address:1,blockquote:1,center:1,div:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,marquee:1,noscript:1,ol:1,p:1,pre:1,script:1,table:1,ul:1 },NonEmptyBlockElements:{ p:1,div:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,address:1,pre:1,ol:1,ul:1,li:1,td:1,th:1 },InlineChildReqElements:{ abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1 },InlineNonEmptyElements:{ a:1,abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1 },EmptyElements:{ base:1,col:1,meta:1,link:1,hr:1,br:1,param:1,img:1,area:1,input:1 },PathBlockElements:{ address:1,blockquote:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,li:1,dt:1,de:1 },PathBlockLimitElements:{ body:1,div:1,td:1,th:1,caption:1,form:1 },StyleBlockElements:{ address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1 },StyleObjectElements:{ img:1,hr:1,li:1,table:1,tr:1,td:1,embed:1,object:1,ol:1,ul:1 },NonEditableElements:{ button:1,option:1,script:1,iframe:1,textarea:1,object:1,embed:1,map:1,applet:1 },BlockBoundaries:{ p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,address:1,pre:1,ol:1,ul:1,li:1,dt:1,de:1,table:1,thead:1,tbody:1,tfoot:1,tr:1,th:1,td:1,caption:1,col:1,colgroup:1,blockquote:1,body:1 },ListBoundaries:{ p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,address:1,pre:1,ol:1,ul:1,li:1,dt:1,de:1,table:1,thead:1,tbody:1,tfoot:1,tr:1,th:1,td:1,caption:1,col:1,colgroup:1,blockquote:1,body:1,br:1 }}; diff --git a/main/inc/lib/fckeditor/editor/js/fckeditorcode_ie.js b/main/inc/lib/fckeditor/editor/js/fckeditorcode_ie.js index 531b9b7b42..de1d83f028 100644 --- a/main/inc/lib/fckeditor/editor/js/fckeditorcode_ie.js +++ b/main/inc/lib/fckeditor/editor/js/fckeditorcode_ie.js @@ -36,7 +36,7 @@ var FCKDebug={Output:function(){},OutputObject:function(){}}; var FCKDomTools={MoveChildren:function(A,B,C){if (A==B) return;var D;if (C){while ((D=A.lastChild)) B.insertBefore(A.removeChild(D),B.firstChild);}else{while ((D=A.firstChild)) B.appendChild(A.removeChild(D));}},MoveNode:function(A,B,C){if (C) B.insertBefore(FCKDomTools.RemoveNode(A),B.firstChild);else B.appendChild(FCKDomTools.RemoveNode(A));},TrimNode:function(A){this.LTrimNode(A);this.RTrimNode(A);},LTrimNode:function(A){var B;while ((B=A.firstChild)){if (B.nodeType==3){var C=B.nodeValue.LTrim();var D=B.nodeValue.length;if (C.length==0){A.removeChild(B);continue;}else if (C.length0) break;if (A.lastChild) A=A.lastChild;else return this.GetPreviousSourceElement(A,B,C,D);};return null;},GetNextSourceElement:function(A,B,C,D,E){while((A=this.GetNextSourceNode(A,E))){if (A.nodeType==1){if (C&&A.nodeName.IEquals(C)) break;if (D&&A.nodeName.IEquals(D)) return this.GetNextSourceElement(A,B,C,D);return A;}else if (B&&A.nodeType==3&&A.nodeValue.RTrim().length>0) break;};return null;},GetNextSourceNode:function(A,B,C,D){if (!A) return null;var E;if (!B&&A.firstChild) E=A.firstChild;else{if (D&&A==D) return null;E=A.nextSibling;if (!E&&(!D||D!=A.parentNode)) return this.GetNextSourceNode(A.parentNode,true,C,D);};if (C&&E&&E.nodeType!=C) return this.GetNextSourceNode(E,false,C,D);return E;},GetPreviousSourceNode:function(A,B,C,D){if (!A) return null;var E;if (!B&&A.lastChild) E=A.lastChild;else{if (D&&A==D) return null;E=A.previousSibling;if (!E&&(!D||D!=A.parentNode)) return this.GetPreviousSourceNode(A.parentNode,true,C,D);};if (C&&E&&E.nodeType!=C) return this.GetPreviousSourceNode(E,false,C,D);return E;},InsertAfterNode:function(A,B){return A.parentNode.insertBefore(B,A.nextSibling);},GetParents:function(A){var B=[];while (A){B.unshift(A);A=A.parentNode;};return B;},GetCommonParents:function(A,B){var C=this.GetParents(A);var D=this.GetParents(B);var E=[];for (var i=0;i0) D[C.pop().toLowerCase()]=1;var E=this.GetCommonParents(A,B);var F=null;while ((F=E.pop())){if (D[F.nodeName.toLowerCase()]) return F;};return null;},GetIndexOf:function(A){var B=A.parentNode?A.parentNode.firstChild:null;var C=-1;while (B){C++;if (B==A) return C;B=B.nextSibling;};return-1;},PaddingNode:null,EnforcePaddingNode:function(A,B){try{if (!A||!A.body) return;}catch (e){return;};this.CheckAndRemovePaddingNode(A,B,true);try{if (A.body.lastChild&&(A.body.lastChild.nodeType!=1||A.body.lastChild.tagName.toLowerCase()==B.toLowerCase())) return;}catch (e){return;};var C=A.createElement(B);if (FCKBrowserInfo.IsGecko&&FCKListsLib.NonEmptyBlockElements[B]) FCKTools.AppendBogusBr(C);this.PaddingNode=C;if (A.body.childNodes.length==1&&A.body.firstChild.nodeType==1&&A.body.firstChild.tagName.toLowerCase()=='br'&&(A.body.firstChild.getAttribute('_moz_dirty')!=null||A.body.firstChild.getAttribute('type')=='_moz')) A.body.replaceChild(C,A.body.firstChild);else A.body.appendChild(C);},CheckAndRemovePaddingNode:function(A,B,C){var D=this.PaddingNode;if (!D) return;try{if (D.parentNode!=A.body||D.tagName.toLowerCase()!=B||(D.childNodes.length>1)||(D.firstChild&&D.firstChild.nodeValue!='\xa0'&&String(D.firstChild.tagName).toLowerCase()!='br')){this.PaddingNode=null;return;}}catch (e){this.PaddingNode=null;return;};if (!C){if (D.parentNode.childNodes.length>1) D.parentNode.removeChild(D);this.PaddingNode=null;}},HasAttribute:function(A,B){if (A.hasAttribute) return A.hasAttribute(B);else{var C=A.attributes[B];return (C!=undefined&&C.specified);}},HasAttributes:function(A){var B=A.attributes;for (var i=0;i0) return true;continue;}};if (B[i].specified) return true;};return false;},RemoveAttribute:function(A,B){if (FCKBrowserInfo.IsIE&&B.toLowerCase()=='class') B='className';return A.removeAttribute(B,0);},RemoveAttributes:function (A,B){for (var i=0;i0) return false;C=C.nextSibling;};return D?this.CheckIsEmptyElement(D,B):true;},SetElementStyles:function(A,B){var C=A.style;for (var D in B) C[D]=B[D];},SetOpacity:function(A,B){if (FCKBrowserInfo.IsIE){B=Math.round(B*100);A.style.filter=(B>100?'':'progid:DXImageTransform.Microsoft.Alpha(opacity='+B+')');}else A.style.opacity=B;},GetCurrentElementStyle:function(A,B){if (FCKBrowserInfo.IsIE) return A.currentStyle[B];else return A.ownerDocument.defaultView.getComputedStyle(A,'').getPropertyValue(B);},GetPositionedAncestor:function(A){var B=A;while (B!=FCKTools.GetElementDocument(B).documentElement){if (this.GetCurrentElementStyle(B,'position')!='static') return B;if (B==FCKTools.GetElementDocument(B).documentElement&¤tWindow!=w) B=currentWindow.frameElement;else B=B.parentNode;};return null;},ScrollIntoView:function(A,B){var C=FCKTools.GetElementWindow(A);var D=FCKTools.GetViewPaneSize(C).Height;var E=D*-1;if (B===false){E+=A.offsetHeight||0;E+=parseInt(this.GetCurrentElementStyle(A,'marginBottom')||0,10)||0;};var F=FCKTools.GetDocumentPosition(C,A);E+=F.y;var G=FCKTools.GetScrollPosition(C).Y;if (E>0&&(E>G||E'+styleDef+'';};var C=function(cssFileUrl,markTemp){if (cssFileUrl.length==0) return '';var B=markTemp?' _fcktemp="true"':'';return '';};return function(cssFileOrArrayOrDef,markTemp){if (!cssFileOrArrayOrDef) return '';if (typeof(cssFileOrArrayOrDef)=='string'){if (/[\\\/\.][^{}]*$/.test(cssFileOrArrayOrDef)){return this.GetStyleHtml(cssFileOrArrayOrDef.split(','),markTemp);}else return A(this._GetUrlFixedCss(cssFileOrArrayOrDef),markTemp);}else{var E='';for (var i=0;i/g,'>');return A;};FCKTools.HTMLDecode=function(A){if (!A) return '';A=A.replace(/>/g,'>');A=A.replace(/</g,'<');A=A.replace(/&/g,'&');return A;};FCKTools._ProcessLineBreaksForPMode=function(A,B,C,D,E){var F=0;var G="

    ";var H="

    ";var I="
    ";if (C){G="
  • ";H="
  • ";F=1;}while (D&&D!=A.FCK.EditorDocument.body){if (D.tagName.toLowerCase()=='p'){F=1;break;};D=D.parentNode;};for (var i=0;i0) return A[A.length-1];return null;};FCKTools.GetDocumentPosition=function(w,A){var x=0;var y=0;var B=A;var C=null;var D=FCKTools.GetElementWindow(B);while (B&&!(D==w&&(B==w.document.body||B==w.document.documentElement))){x+=B.offsetLeft-B.scrollLeft;y+=B.offsetTop-B.scrollTop;if (!FCKBrowserInfo.IsOpera){var E=C;while (E&&E!=B){x-=E.scrollLeft;y-=E.scrollTop;E=E.parentNode;}};C=B;if (B.offsetParent) B=B.offsetParent;else{if (D!=w){B=D.frameElement;C=null;if (B) D=B.contentWindow.parent;}else B=null;}};if (FCKDomTools.GetCurrentElementStyle(w.document.body,'position')!='static'||(FCKBrowserInfo.IsIE&&FCKDomTools.GetPositionedAncestor(A)==null)){x+=w.document.body.offsetLeft;y+=w.document.body.offsetTop;};return { "x":x,"y":y };};FCKTools.GetWindowPosition=function(w,A){var B=this.GetDocumentPosition(w,A);var C=FCKTools.GetScrollPosition(w);B.x-=C.X;B.y-=C.Y;return B;};FCKTools.ProtectFormStyles=function(A){if (!A||A.nodeType!=1||A.tagName.toLowerCase()!='form') return [];var B=[];var C=['style','className'];for (var i=0;i0){for (var i=B.length-1;i>=0;i--){var C=B[i][0];var D=B[i][1];if (D) A.insertBefore(C,D);else A.appendChild(C);}}};FCKTools.GetNextNode=function(A,B){if (A.firstChild) return A.firstChild;else if (A.nextSibling) return A.nextSibling;else{var C=A.parentNode;while (C){if (C==B) return null;if (C.nextSibling) return C.nextSibling;else C=C.parentNode;}};return null;};FCKTools.GetNextTextNode=function(A,B,C){node=this.GetNextNode(A,B);if (C&&node&&C(node)) return null;while (node&&node.nodeType!=3){node=this.GetNextNode(node,B);if (C&&node&&C(node)) return null;};return node;};FCKTools.Merge=function(){var A=arguments;var o=A[0];for (var i=1;i');document.domain = '"+FCK_RUNTIME_DOMAIN+"';document.close();}() ) ;";if (FCKBrowserInfo.IsIE){if (FCKBrowserInfo.IsIE7||!FCKBrowserInfo.IsIE6) return "";else return "javascript: '';";};return "javascript: void(0);";};FCKTools.ResetStyles=function(A){A.style.cssText='margin:0;padding:0;border:0;background-color:transparent;background-image:none;';}; FCKTools.CancelEvent=function(e){return false;};FCKTools._AppendStyleSheet=function(A,B){return A.createStyleSheet(B).owningElement;};FCKTools.AppendStyleString=function(A,B){if (!B) return null;var s=A.createStyleSheet("");s.cssText=B;return s;};FCKTools.ClearElementAttributes=function(A){A.clearAttributes();};FCKTools.GetAllChildrenIds=function(A){var B=[];for (var i=0;i0) B[B.length]=C;};return B;};FCKTools.RemoveOuterTags=function(e){e.insertAdjacentHTML('beforeBegin',e.innerHTML);e.parentNode.removeChild(e);};FCKTools.CreateXmlObject=function(A){var B;switch (A){case 'XmlHttp':if (document.location.protocol!='file:') try { return new XMLHttpRequest();} catch (e) {};B=['MSXML2.XmlHttp','Microsoft.XmlHttp'];break;case 'DOMDocument':B=['MSXML2.DOMDocument','Microsoft.XmlDom'];break;};for (var i=0;i<2;i++){try { return new ActiveXObject(B[i]);}catch (e){}};if (FCKLang.NoActiveX){alert(FCKLang.NoActiveX);FCKLang.NoActiveX=null;};return null;};FCKTools.DisableSelection=function(A){A.unselectable='on';var e,i=0;while ((e=A.all[i++])){switch (e.tagName){case 'IFRAME':case 'TEXTAREA':case 'INPUT':case 'SELECT':break;default:e.unselectable='on';}}};FCKTools.GetScrollPosition=function(A){var B=A.document;var C={ X:B.documentElement.scrollLeft,Y:B.documentElement.scrollTop };if (C.X>0||C.Y>0) return C;return { X:B.body.scrollLeft,Y:B.body.scrollTop };};FCKTools.AddEventListener=function(A,B,C){A.attachEvent('on'+B,C);};FCKTools.RemoveEventListener=function(A,B,C){A.detachEvent('on'+B,C);};FCKTools.AddEventListenerEx=function(A,B,C,D){var o={};o.Source=A;o.Params=D||[];o.Listener=function(ev){return C.apply(o.Source,[ev].concat(o.Params));};if (FCK.IECleanup) FCK.IECleanup.AddItem(null,function() { o.Source=null;o.Params=null;});A.attachEvent('on'+B,o.Listener);A=null;D=null;};FCKTools.GetViewPaneSize=function(A){var B;var C=A.document.documentElement;if (C&&C.clientWidth) B=C;else B=A.document.body;if (B) return { Width:B.clientWidth,Height:B.clientHeight };else return { Width:0,Height:0 };};FCKTools.SaveStyles=function(A){var B=FCKTools.ProtectFormStyles(A);var C={};if (A.className.length>0){C.Class=A.className;A.className='';};var D=A.style.cssText;if (D.length>0){C.Inline=D;A.style.cssText='';};FCKTools.RestoreFormStyles(A,B);return C;};FCKTools.RestoreStyles=function(A,B){var C=FCKTools.ProtectFormStyles(A);A.className=B.Class||'';A.style.cssText=B.Inline||'';FCKTools.RestoreFormStyles(A,C);};FCKTools.RegisterDollarFunction=function(A){A.$=A.document.getElementById;};FCKTools.AppendElement=function(A,B){return A.appendChild(this.GetElementDocument(A).createElement(B));};FCKTools.ToLowerCase=function(A){return A.toLowerCase();}; -var FCKeditorAPI;function InitializeAPI(){var A=window.parent;if (!(FCKeditorAPI=A.FCKeditorAPI)){var B='window.FCKeditorAPI = {Version : "2.6.4.1",VersionBuild : "23195",Instances : window.FCKeditorAPI && window.FCKeditorAPI.Instances || {},GetInstance : function( name ){return this.Instances[ name ];},_FormSubmit : function(){for ( var name in FCKeditorAPI.Instances ){var oEditor = FCKeditorAPI.Instances[ name ] ;if ( oEditor.GetParentForm && oEditor.GetParentForm() == this )oEditor.UpdateLinkedField() ;}this._FCKOriginalSubmit() ;},_FunctionQueue : window.FCKeditorAPI && window.FCKeditorAPI._FunctionQueue || {Functions : new Array(),IsRunning : false,Add : function( f ){this.Functions.push( f );if ( !this.IsRunning )this.StartNext();},StartNext : function(){var aQueue = this.Functions ;if ( aQueue.length > 0 ){this.IsRunning = true;aQueue[0].call();}else this.IsRunning = false;},Remove : function( f ){var aQueue = this.Functions;var i = 0, fFunc;while( (fFunc = aQueue[ i ]) ){if ( fFunc == f )aQueue.splice( i,1 );i++ ;}this.StartNext();}}}';if (A.execScript) A.execScript(B,'JavaScript');else{if (FCKBrowserInfo.IsGecko10){eval.call(A,B);}else if(FCKBrowserInfo.IsAIR){FCKAdobeAIR.FCKeditorAPI_Evaluate(A,B);}else if (FCKBrowserInfo.IsSafari){var C=A.document;var D=C.createElement('script');D.appendChild(C.createTextNode(B));C.documentElement.appendChild(D);}else A.eval(B);};FCKeditorAPI=A.FCKeditorAPI;FCKeditorAPI.__Instances=FCKeditorAPI.Instances;};FCKeditorAPI.Instances[FCK.Name]=FCK;};function _AttachFormSubmitToAPI(){var A=FCK.GetParentForm();if (A){FCKTools.AddEventListener(A,'submit',FCK.UpdateLinkedField);if (!A._FCKOriginalSubmit&&(typeof(A.submit)=='function'||(!A.submit.tagName&&!A.submit.length))){A._FCKOriginalSubmit=A.submit;A.submit=FCKeditorAPI._FormSubmit;}}};function FCKeditorAPI_Cleanup(){if (window.FCKConfig&&FCKConfig.MsWebBrowserControlCompat&&!window.FCKUnloadFlag) return;delete FCKeditorAPI.Instances[FCK.Name];};function FCKeditorAPI_ConfirmCleanup(){if (window.FCKConfig&&FCKConfig.MsWebBrowserControlCompat) window.FCKUnloadFlag=true;};FCKTools.AddEventListener(window,'unload',FCKeditorAPI_Cleanup);FCKTools.AddEventListener(window,'beforeunload',FCKeditorAPI_ConfirmCleanup); +var FCKeditorAPI;function InitializeAPI(){var A=window.parent;if (!(FCKeditorAPI=A.FCKeditorAPI)){var B='window.FCKeditorAPI = {Version : "2.6.4.1",VersionBuild : "23405",Instances : window.FCKeditorAPI && window.FCKeditorAPI.Instances || {},GetInstance : function( name ){return this.Instances[ name ];},_FormSubmit : function(){for ( var name in FCKeditorAPI.Instances ){var oEditor = FCKeditorAPI.Instances[ name ] ;if ( oEditor.GetParentForm && oEditor.GetParentForm() == this )oEditor.UpdateLinkedField() ;}this._FCKOriginalSubmit() ;},_FunctionQueue : window.FCKeditorAPI && window.FCKeditorAPI._FunctionQueue || {Functions : new Array(),IsRunning : false,Add : function( f ){this.Functions.push( f );if ( !this.IsRunning )this.StartNext();},StartNext : function(){var aQueue = this.Functions ;if ( aQueue.length > 0 ){this.IsRunning = true;aQueue[0].call();}else this.IsRunning = false;},Remove : function( f ){var aQueue = this.Functions;var i = 0, fFunc;while( (fFunc = aQueue[ i ]) ){if ( fFunc == f )aQueue.splice( i,1 );i++ ;}this.StartNext();}}}';if (A.execScript) A.execScript(B,'JavaScript');else{if (FCKBrowserInfo.IsGecko10){eval.call(A,B);}else if(FCKBrowserInfo.IsAIR){FCKAdobeAIR.FCKeditorAPI_Evaluate(A,B);}else if (FCKBrowserInfo.IsSafari){var C=A.document;var D=C.createElement('script');D.appendChild(C.createTextNode(B));C.documentElement.appendChild(D);}else A.eval(B);};FCKeditorAPI=A.FCKeditorAPI;FCKeditorAPI.__Instances=FCKeditorAPI.Instances;};FCKeditorAPI.Instances[FCK.Name]=FCK;};function _AttachFormSubmitToAPI(){var A=FCK.GetParentForm();if (A){FCKTools.AddEventListener(A,'submit',FCK.UpdateLinkedField);if (!A._FCKOriginalSubmit&&(typeof(A.submit)=='function'||(!A.submit.tagName&&!A.submit.length))){A._FCKOriginalSubmit=A.submit;A.submit=FCKeditorAPI._FormSubmit;}}};function FCKeditorAPI_Cleanup(){if (window.FCKConfig&&FCKConfig.MsWebBrowserControlCompat&&!window.FCKUnloadFlag) return;delete FCKeditorAPI.Instances[FCK.Name];};function FCKeditorAPI_ConfirmCleanup(){if (window.FCKConfig&&FCKConfig.MsWebBrowserControlCompat) window.FCKUnloadFlag=true;};FCKTools.AddEventListener(window,'unload',FCKeditorAPI_Cleanup);FCKTools.AddEventListener(window,'beforeunload',FCKeditorAPI_ConfirmCleanup); var FCKImagePreloader=function(){this._Images=[];};FCKImagePreloader.prototype={AddImages:function(A){if (typeof(A)=='string') A=A.split(';');this._Images=this._Images.concat(A);},Start:function(){var A=this._Images;this._PreloadCount=A.length;for (var i=0;i]*\>)/i,AfterBody:/(\<\/body\>[\s\S]*$)/i,ToReplace:/___fcktoreplace:([\w]+)/ig,MetaHttpEquiv:/http-equiv\s*=\s*["']?([^"' ]+)/i,HasBaseTag:/]/i,HtmlOpener:/]*>/i,HeadOpener:/]*>/i,HeadCloser:/<\/head\s*>/i,FCK_Class:/\s*FCK__[^ ]*(?=\s+|$)/,ElementName:/(^[a-z_:][\w.\-:]*\w$)|(^[a-z_]$)/,ForceSimpleAmpersand:/___FCKAmp___/g,SpaceNoClose:/\/>/g,EmptyParagraph:/^<(p|div|address|h\d|center)(?=[ >])[^>]*>\s*(<\/\1>)?$/,EmptyOutParagraph:/^<(p|div|address|h\d|center)(?=[ >])[^>]*>(?:\s*| | )(<\/\1>)?$/,TagBody:/>]+))/gi,ProtectUrlsA:/]+))/gi,ProtectUrlsArea:/]+))/gi,Html4DocType:/HTML 4\.0 Transitional/i,DocTypeTag:/]*>/i,HtmlDocType:/DTD HTML/,TagsWithEvent:/<[^\>]+ on\w+[\s\r\n]*=[\s\r\n]*?('|")[\s\S]+?\>/g,EventAttributes:/\s(on\w+)[\s\r\n]*=[\s\r\n]*?('|")([\s\S]*?)\2/g,ProtectedEvents:/\s\w+_fckprotectedatt="([^"]+)"/g,StyleProperties:/\S+\s*:/g,InvalidSelfCloseTags:/(<(?!base|meta|link|hr|br|param|img|area|input)([a-zA-Z0-9:]+)[^>]*)\/>/gi,StyleVariableAttName:/#\(\s*("|')(.+?)\1[^\)]*\s*\)/g,RegExp:/^\/(.*)\/([gim]*)$/,HtmlTag:/<[^\s<>](?:"[^"]*"|'[^']*'|[^<])*>/}; var FCKListsLib={BlockElements:{ address:1,blockquote:1,center:1,div:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,marquee:1,noscript:1,ol:1,p:1,pre:1,script:1,table:1,ul:1 },NonEmptyBlockElements:{ p:1,div:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,address:1,pre:1,ol:1,ul:1,li:1,td:1,th:1 },InlineChildReqElements:{ abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1 },InlineNonEmptyElements:{ a:1,abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1 },EmptyElements:{ base:1,col:1,meta:1,link:1,hr:1,br:1,param:1,img:1,area:1,input:1 },PathBlockElements:{ address:1,blockquote:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,li:1,dt:1,de:1 },PathBlockLimitElements:{ body:1,div:1,td:1,th:1,caption:1,form:1 },StyleBlockElements:{ address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1 },StyleObjectElements:{ img:1,hr:1,li:1,table:1,tr:1,td:1,embed:1,object:1,ol:1,ul:1 },NonEditableElements:{ button:1,option:1,script:1,iframe:1,textarea:1,object:1,embed:1,map:1,applet:1 },BlockBoundaries:{ p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,address:1,pre:1,ol:1,ul:1,li:1,dt:1,de:1,table:1,thead:1,tbody:1,tfoot:1,tr:1,th:1,td:1,caption:1,col:1,colgroup:1,blockquote:1,body:1 },ListBoundaries:{ p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,address:1,pre:1,ol:1,ul:1,li:1,dt:1,de:1,table:1,thead:1,tbody:1,tfoot:1,tr:1,th:1,td:1,caption:1,col:1,colgroup:1,blockquote:1,body:1,br:1 }}; From dc01bd28b51bcb3aaf20a047deec49b7eac4f947 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Ra=C3=B1a?= Date: Wed, 29 Jul 2009 18:51:46 +0200 Subject: [PATCH 24/56] [svn r22472] one field more for task on line --- main/inc/lib/add_course.lib.inc.php | 1 + main/install/migrate-db-1.8.6-1.8.6.1-pre.sql | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/main/inc/lib/add_course.lib.inc.php b/main/inc/lib/add_course.lib.inc.php index f9ff354f47..9c182350d2 100644 --- a/main/inc/lib/add_course.lib.inc.php +++ b/main/inc/lib/add_course.lib.inc.php @@ -901,6 +901,7 @@ function update_Db_course($courseDbName) // $sql = "CREATE TABLE `".$TABLEWIKICONF . "` ( page_id int NOT NULL default 0, + task text NOT NULL, feedback1 text NOT NULL, feedback2 text NOT NULL, feedback3 text NOT NULL, diff --git a/main/install/migrate-db-1.8.6-1.8.6.1-pre.sql b/main/install/migrate-db-1.8.6-1.8.6.1-pre.sql index 6f0435641e..e5395350af 100755 --- a/main/install/migrate-db-1.8.6-1.8.6.1-pre.sql +++ b/main/install/migrate-db-1.8.6-1.8.6.1-pre.sql @@ -46,5 +46,5 @@ INSERT INTO settings_options (variable, value, display_text) VALUES ('show_teach -- xxCOURSExx ALTER TABLE wiki CHANGE title title varchar(255), CHANGE reflink reflink varchar(255), ADD time_edit datetime NOT NULL default '0000-00-00 00:00:00' AFTER is_editing, ADD INDEX (title), ADD INDEX (reflink), ADD INDEX (group_id), ADD INDEX (page_id); -ALTER TABLE wiki_conf DROP id, ADD fprogress3 varchar(3) NOT NULL AFTER feedback3, ADD fprogress2 varchar(3) NOT NULL AFTER feedback3, ADD fprogress1 varchar(3) NOT NULL AFTER feedback3, ADD INDEX(page_id); +ALTER TABLE wiki_conf DROP id, ADD task text NOT NULL BEFORE feedback1, ADD fprogress3 varchar(3) NOT NULL AFTER feedback3, ADD fprogress2 varchar(3) NOT NULL AFTER feedback3, ADD fprogress1 varchar(3) NOT NULL AFTER feedback3, ADD INDEX(page_id); ALTER TABLE link ADD COLUMN target char(10) DEFAULT '_self'; \ No newline at end of file From 94a1ddbab8ff6a505e3f8cac476761fdfbd9bdad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Ra=C3=B1a?= Date: Wed, 29 Jul 2009 21:17:56 +0200 Subject: [PATCH 25/56] [svn r22474] change icons for individual assignment --- main/img/wiki/assignment.gif | Bin 14082 -> 1047 bytes main/img/wiki/task.gif | Bin 0 -> 553 bytes main/img/wiki/works.gif | Bin 553 -> 1035 bytes 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 main/img/wiki/task.gif diff --git a/main/img/wiki/assignment.gif b/main/img/wiki/assignment.gif index 6f3aac6dedf25bdf425e42b917d71b52eb3ab938..fa5dbbbca35e08f110cf79dc2248ff7438787ce9 100644 GIT binary patch literal 1047 zcmeH`|7#Ox9LG;hH|y3}tA)`8>1M(H&{f6hI?P60&dx%M1%q=EMgn1O@izPtLLEn` z*;!_HW?hWiEJvvI!7m}m2oI$k4`E!-GQvY((i+G=n_5!M+Q98Bwp~~UDT%@vY@96vUt_Ytl@ef`geEYZ4S?sk{e5oDNj&DTIm_{^#43v8L0I3Q%R+-f4Pg(Q zb76IZqG&P?Lf;gqL7>S(Nep%DdSKN!T?0ACoVWxpxRfzzmB;eH3^`i_z7Fy-C>!3k z`bN?WO@~nhERQ=?1`QKxS!Y4QHPCV@IU|u3&MHW$0IVp?V-IV44&z(GHz?wW?IqWO^^+M%?hldQp1E7K&v3Uj3D%FO4$5@upNX`t$~(%rV==u zkQNVKjLe?CHKBDa9Zz3>r8m;Gp6=heY+A-GRH^p)?=zy4MxTgBJ9zV<)ddh_PCcZAm8 zcCQBaU+cOMnf_N9_6ePS`S_FXejM!E_D|sI%<|Y=&x5^Z*RPz2wE0ngXK(ixWBU#s z0P1}A5>kR`R#|L)-1(WUyX^c(XrG;n=x6rGIkaXz^F{l`5! t-t@QJS?qmvDtLQt@b0B&LqglRBk5@9%iX_>o>-jxqa*mk?~}r@{{bC#*?j;2 literal 14082 zcmeI3YdlnG9LI;0OA2k$bvs7wM&?RQ#*iYqEM3@=Y<0|>VKTR7P7J%1Tana`OV;X! zq>?S=-i3-%xkPP6Ygn_&OGP)|3ByXKEJn*(-Oyd zR;WHnpVUPn_4W1j_P+hQyQ}AQdq;cM)Ar7`wzk&R-qzN}mo2R=Ew37yJDQrB9yYZ+ zsc&ekZ|-;)Qd`?}zozp>-HV!2Hn3%lnK=tNhTZO5C z%DC9beQCR5vhZYg_r!+X(TDN464QJ$QQQHigl7Wfb=Q~{xiWrQ`n1q6Z&B!>^;uTy$5TjmC9y2pa)E-b=7310u70pq^W?#?R^2NXw% zU(S4m6y^G2IO2tQ3&b|$m*-RD|Iuq7Vtia<;;TjPfL27@N3P4b#X-KZ5((kQb;PAgVd-B{B@Lq%tU6x`icT zIhV?0F|Am0%@J1=N0y>ugvmmfbUN|HWLvO^4>EX>ZFPt{j*Q1=uX1o4oRj!xL-xUO zDVs*~_xGpzTTmr3ZyLkO%8Ev3(wIyNK~UrYVjNXa#B!5?Chz(VWaj0}?BC(v>zfdYyBBCi!DUCs;(}p?|g&bm#Z7;)6Tq1LmNQAZn z%XbvWFn@{6SB}`bT5wdAA3(#i4%cJE7Gbt39~3%+Lbr4ytT5yg^#jmH<<1hG zfFJO#d>)19z+kyC=CK);Z06j-^7o*@at=);;yp3_)>UizX#Br~@wh|2q+4Xd{%zrL zX_ycbVPafPIAeV1jK^j3B{C6;+X_UeH%9Xo@Hw>M!B4*5z*`fsAYw@y%H_LPAKJ># zax?7xv$P**3MT=Q3w1$VKn8$dm@cRb$N&%w(*<<_832M|x}Yu~13)lL7t{r000@TZ zg1UeV0KqU_P#2H^AQ+|#>H;zV1jBSeT|fqaV3;nb3&;Qv4ATX50T}>-VY;9$AOk=! zOc&GzWB>?;>4Lg|3;@9}T~HU00U#Kr3+e(g00hHyL0v!wfMA#|s0+vd5De1=bpaUw zfg;&^XZx#{Z7*7%KYQBpGmPNttYek|>1>XDS>q{D{}9@wAwbHY#Y`{H6_qLn}H-4nGta#uw7&K+T)A;Cf0 zw{895`@jH&zuy*IF54`Xh($u*O#&ZpKE~sEp&K`>|ITxr$6EI_tG{(~UA1z>au?@s zmMvYf*vWB`gZ;tuCk zq=`lo499;l&Ol#p>=@nAI@(&Aqeg0sP*)?7jNfReX_A6S=Bo2Jssmyqt=l9u?Wv2U zNN9+bX5fm(t9A=RCdCWu8)qbk7`fbbIH5eccSp$NLs10=DK~eRZ=0pdq1)>k8IIJq zGi`5PJ}P)zP|#(jG11OCp)OkPI5TOE$)@^l?WEv6W?T8Vz@(}?++-cOhZpUnGiEaS zIG>~u8abA{P{T53W5dX(DYiAUNU0i&qL8WT6A@*-+9(6ldR?{gmm_u=E}5V!y_6ho z$W%P4({OWe)EsB!=5E@^*Grr}cBGk|dP7(|E3n1$O@zKfEX(gowpOpQbo@Q-5$YuC Fe*uf+gWv!F diff --git a/main/img/wiki/task.gif b/main/img/wiki/task.gif new file mode 100644 index 0000000000000000000000000000000000000000..1e8d5690bd8c352e8ba85e220dea2b6f1036783a GIT binary patch literal 553 zcmZ?wbhEHb6krfwc*elcAg|uP@`u2|09ea;FPG@-b{K2_pOCFxPJh!{MamLR+ z2Zg6={r^v7*psP$tgiB#8pHMV)2A(1v%9b5QO9rsM_v-@-j#jQ_>Wd&dqPn6vQct}y?r z58rI+sQkac@qa1PRC~7njtm>l|Gszf^usOHhfkfK)v@rybcRI>m;doYr&u;L1lgj^Es{@ZqCJSB@Ru?aA=u@|DT;RsZKOUR*!( z*Y_U}0~wYd{QvCv^W)oBfB*Dt>(;#tGy{r1Ss2+FJQ#F9Hh|)UfxWH4!z0v6-Z;9c zv&%zJh);r3t-Cu!)ly3=%4u?E91FX(N)U(VoF;zmcn#e^gJmB20&O zeGJ9ddqjk}N(np9UdHMzYQk*9k+9y~OE%I}=D;#R-TZ dgAaOenK|ewfAWx2Ph|Y*p~SMpLxh9D8UO-)=Ar-q literal 0 HcmV?d00001 diff --git a/main/img/wiki/works.gif b/main/img/wiki/works.gif index 1e8d5690bd8c352e8ba85e220dea2b6f1036783a..398fa545a705089d7a05a43d9c3aaa77e6343a6c 100644 GIT binary patch literal 1035 zcmeH`|4S2b7{{k*XX>M`;YH7^3skA;Tb! z(s2mt`6W3-$0;$6QR7%Oj)T^?XdFYvhb7~~i1oo>JV@ss(0|bL;{y-x*Ykq+z0UUA zw+1K^W%^?>nfrK~7bKq`#{puTxGTCxEGP}US4J`2GK-PVhBeV00-`cv2rMHaBxTV< zW0fOmjFLE#1a}a4l_*g{kMP!2AQ^B3fW&2PiNzsa)SzJskra-^jGzb(+CgJ^4Isg@ zUIHp(9@Q031JO8?B(xvs*Ro|)A_u?+uww~B1}g~yF+mAR{EQVP5b`_pDCP{LFe`-t zk_x1CJq<#bI6@$6fKvoAV0|LcyP)sVijnJ=Id8<`Aw(0|uyN>?RALBG~DZyZ5zM@3_MBRWF?J65+DXK4l#lTybmcG20sS}*tTmJ<0YTO&CoavD2{Q! z&K`+!izt*qDkxFt-87siVic@S2~sE$2OM%hLJ&6<-N)HCK@RBRjM?!< zrkxV&BfXFL$U*~exb^CGKUha4lma*;mIWYD$@)@)FavP`QVJaCa0p5q^b{~b5TXE4 z4ka-1GdN|u2B!b>4+GUl`=c(H@_w0W@@2++-gWm;Q@;1+R@t?xuADwk>lb&)^jyZW zHQw$jyfhYbd|dxIy;6EkTEDa1;#`~RXprAA%ROrsdMx|Te+=cE&8~d--t~Jex8y`o zZuMeaP<7WWo=itt!q~Xrfor{Zs znE8%CAmy!3|B(Q^X)nfpdG;m%*RPkBpsc%&gvr?Qk9B>2$gQuMFE6{_|DmkP%Gve% zvSavE3AxGY`G_Lt?(@~Qwduu#|ISd@%FL8*Qvb9IpB4}3+1|#&z?`AQx>irs;q0=A zdH4j2h0 zi;GkxIVu)fLX(MJ1P41LQV2<$f)5K{C@oPirbsUk9zk6=AvdoSKRgXgF&D2$SXM Date: Thu, 30 Jul 2009 13:10:45 +0200 Subject: [PATCH 26/56] [svn r22497] FS#2867 - The online editor: Assigning styles to all dialogs for unification their appearance in different browsers. --- main/inc/lib/fckeditor/editor/dialog/fck_about.html | 5 +++++ main/inc/lib/fckeditor/editor/dialog/fck_anchor.html | 5 +++++ main/inc/lib/fckeditor/editor/dialog/fck_button.html | 5 +++++ main/inc/lib/fckeditor/editor/dialog/fck_checkbox.html | 5 +++++ main/inc/lib/fckeditor/editor/dialog/fck_colorselector.html | 5 +++++ main/inc/lib/fckeditor/editor/dialog/fck_div.html | 5 +++++ main/inc/lib/fckeditor/editor/dialog/fck_docprops.html | 5 +++++ main/inc/lib/fckeditor/editor/dialog/fck_flash.html | 5 +++++ main/inc/lib/fckeditor/editor/dialog/fck_form.html | 5 +++++ main/inc/lib/fckeditor/editor/dialog/fck_hiddenfield.html | 5 +++++ main/inc/lib/fckeditor/editor/dialog/fck_image.html | 5 +++++ main/inc/lib/fckeditor/editor/dialog/fck_link.html | 5 +++++ main/inc/lib/fckeditor/editor/dialog/fck_listprop.html | 5 +++++ main/inc/lib/fckeditor/editor/dialog/fck_paste.html | 5 +++++ main/inc/lib/fckeditor/editor/dialog/fck_radiobutton.html | 5 +++++ main/inc/lib/fckeditor/editor/dialog/fck_replace.html | 5 +++++ main/inc/lib/fckeditor/editor/dialog/fck_select.html | 5 +++++ main/inc/lib/fckeditor/editor/dialog/fck_smiley.html | 5 +++++ main/inc/lib/fckeditor/editor/dialog/fck_source.html | 5 +++++ main/inc/lib/fckeditor/editor/dialog/fck_specialchar.html | 5 +++++ main/inc/lib/fckeditor/editor/dialog/fck_spellerpages.html | 5 +++++ main/inc/lib/fckeditor/editor/dialog/fck_table.html | 5 +++++ main/inc/lib/fckeditor/editor/dialog/fck_tablecell.html | 5 +++++ main/inc/lib/fckeditor/editor/dialog/fck_template.html | 5 +++++ main/inc/lib/fckeditor/editor/dialog/fck_textarea.html | 5 +++++ main/inc/lib/fckeditor/editor/dialog/fck_textfield.html | 5 +++++ .../editor/filemanager/browser/default/browser.css | 2 ++ .../lib/fckeditor/editor/plugins/ImageManager/editor.php | 4 ++++ .../lib/fckeditor/editor/plugins/ImageManager/manager.php | 4 ++++ main/inc/lib/fckeditor/editor/plugins/audio/fck_audio.html | 5 +++++ .../editor/plugins/fckEmbedMovies/fck_embedmovies.html | 5 +++++ .../lib/fckeditor/editor/plugins/flvPlayer/flvPlayer.html | 6 ++++-- .../editor/plugins/googlemaps/dialog/googleMaps.html | 5 +++++ main/inc/lib/fckeditor/editor/plugins/imgmap/popup.html | 6 +++++- main/inc/lib/fckeditor/editor/plugins/mimetex/mimetex.html | 4 ++++ .../editor/plugins/placeholder/fck_placeholder.html | 5 +++++ .../inc/lib/fckeditor/editor/plugins/prompt/fck_prompt.html | 6 ++++-- .../lib/fckeditor/editor/plugins/wikilink/fck_wikilink.html | 5 +++++ main/inc/lib/fckeditor/editor/plugins/youtube/youtube.html | 5 +++++ 39 files changed, 187 insertions(+), 5 deletions(-) diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_about.html b/main/inc/lib/fckeditor/editor/dialog/fck_about.html index 392a79cae3..9f1eff1cbc 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_about.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_about.html @@ -65,6 +65,11 @@ window.onload = function() } + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_anchor.html b/main/inc/lib/fckeditor/editor/dialog/fck_anchor.html index 235535b4ad..2f3921b48b 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_anchor.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_anchor.html @@ -200,6 +200,11 @@ function ReadjustLinksToAnchor( sCurrent, sNew ) } + + + diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_button.html b/main/inc/lib/fckeditor/editor/dialog/fck_button.html index 6dc21b448a..21a68767cf 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_button.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_button.html @@ -68,6 +68,11 @@ function Ok() } + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_checkbox.html b/main/inc/lib/fckeditor/editor/dialog/fck_checkbox.html index 9a5d43c736..f55266ac26 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_checkbox.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_checkbox.html @@ -75,6 +75,11 @@ function Ok() } + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_colorselector.html b/main/inc/lib/fckeditor/editor/dialog/fck_colorselector.html index a6eac5ca95..7c9637e597 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_colorselector.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_colorselector.html @@ -142,6 +142,11 @@ function Ok() return true ; } + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_div.html b/main/inc/lib/fckeditor/editor/dialog/fck_div.html index c5496e1fd2..cd16d1cda3 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_div.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_div.html @@ -319,6 +319,11 @@ function Ok() } + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_docprops.html b/main/inc/lib/fckeditor/editor/dialog/fck_docprops.html index 364a23de5c..d1b421f064 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_docprops.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_docprops.html @@ -394,6 +394,11 @@ function SetUrl( url ) } + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_flash.html b/main/inc/lib/fckeditor/editor/dialog/fck_flash.html index 2db48461d5..60796691e1 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_flash.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_flash.html @@ -33,6 +33,11 @@ document.write( FCKTools.GetStyleHtml( GetCommonDialogCss() ) ) ; + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_form.html b/main/inc/lib/fckeditor/editor/dialog/fck_form.html index c724282ed8..1a6bdd04dd 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_form.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_form.html @@ -74,6 +74,11 @@ function Ok() } + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_hiddenfield.html b/main/inc/lib/fckeditor/editor/dialog/fck_hiddenfield.html index 2d0e0b55b5..f34f8f9ef9 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_hiddenfield.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_hiddenfield.html @@ -89,6 +89,11 @@ function Ok() } + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_image.html b/main/inc/lib/fckeditor/editor/dialog/fck_image.html index 75681bf2c0..ad03c2bd02 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_image.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_image.html @@ -33,6 +33,11 @@ document.write( FCKTools.GetStyleHtml( GetCommonDialogCss() ) ) ; + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_link.html b/main/inc/lib/fckeditor/editor/dialog/fck_link.html index 061c84e14b..561c72409d 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_link.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_link.html @@ -28,6 +28,11 @@ + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_paste.html b/main/inc/lib/fckeditor/editor/dialog/fck_paste.html index dc831725f1..30edf82129 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_paste.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_paste.html @@ -305,6 +305,11 @@ function CleanWord( oNode, bIgnoreFont, bRemoveStyles ) + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_radiobutton.html b/main/inc/lib/fckeditor/editor/dialog/fck_radiobutton.html index 80516e042f..d4dfdb1122 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_radiobutton.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_radiobutton.html @@ -75,6 +75,11 @@ function Ok() } + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_replace.html b/main/inc/lib/fckeditor/editor/dialog/fck_replace.html index bf983353ae..a61ed1de8f 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_replace.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_replace.html @@ -577,6 +577,11 @@ window.onunload = function() } } + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_smiley.html b/main/inc/lib/fckeditor/editor/dialog/fck_smiley.html index 96c449f9c4..9323bc4827 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_smiley.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_smiley.html @@ -77,6 +77,11 @@ function out(td) td.className = 'DarkBackground Hand' ; } + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_source.html b/main/inc/lib/fckeditor/editor/dialog/fck_source.html index d61e710ca2..383d467637 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_source.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_source.html @@ -57,6 +57,11 @@ function Ok() return true ; } + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_specialchar.html b/main/inc/lib/fckeditor/editor/dialog/fck_specialchar.html index eb0238c632..ff17c52450 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_specialchar.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_specialchar.html @@ -75,6 +75,11 @@ function setDefaults() } + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_spellerpages.html b/main/inc/lib/fckeditor/editor/dialog/fck_spellerpages.html index cd2355dee6..7ae206afc4 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_spellerpages.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_spellerpages.html @@ -62,6 +62,11 @@ function oSpeller_OnFinished( numberOCorrections ) } + + + diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_table.html b/main/inc/lib/fckeditor/editor/dialog/fck_table.html index 2711e69562..4763f3b824 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_table.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_table.html @@ -311,6 +311,11 @@ function Ok() } + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_tablecell.html b/main/inc/lib/fckeditor/editor/dialog/fck_tablecell.html index a7bc921530..ec73d8c0ab 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_tablecell.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_tablecell.html @@ -143,6 +143,11 @@ function SelectColor( wich ) } + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_template.html b/main/inc/lib/fckeditor/editor/dialog/fck_template.html index 90e96967fd..b7eea90f13 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_template.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_template.html @@ -208,6 +208,11 @@ function SelectTemplate( index ) } + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_textarea.html b/main/inc/lib/fckeditor/editor/dialog/fck_textarea.html index e4edae9664..051b2c9d0f 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_textarea.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_textarea.html @@ -69,6 +69,11 @@ function Ok() } + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_textfield.html b/main/inc/lib/fckeditor/editor/dialog/fck_textfield.html index efde66daee..8368f63990 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_textfield.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_textfield.html @@ -85,6 +85,11 @@ function Ok() } + + +
    diff --git a/main/inc/lib/fckeditor/editor/filemanager/browser/default/browser.css b/main/inc/lib/fckeditor/editor/filemanager/browser/default/browser.css index 982ddd9ff0..b3243859b1 100644 --- a/main/inc/lib/fckeditor/editor/filemanager/browser/default/browser.css +++ b/main/inc/lib/fckeditor/editor/filemanager/browser/default/browser.css @@ -86,3 +86,5 @@ body, td, input, select .fullHeight { height: 100%; } + +body, td, input, textarea, select, label { font-family: Arial, Verdana, Geneva, helvetica, sans-serif; font-size: 11px; } diff --git a/main/inc/lib/fckeditor/editor/plugins/ImageManager/editor.php b/main/inc/lib/fckeditor/editor/plugins/ImageManager/editor.php index 074dc44ca6..227b954e31 100644 --- a/main/inc/lib/fckeditor/editor/plugins/ImageManager/editor.php +++ b/main/inc/lib/fckeditor/editor/plugins/ImageManager/editor.php @@ -119,6 +119,10 @@ body { /*]]>*/ + + diff --git a/main/inc/lib/fckeditor/editor/plugins/ImageManager/manager.php b/main/inc/lib/fckeditor/editor/plugins/ImageManager/manager.php index af6c77a5be..744a03d40c 100644 --- a/main/inc/lib/fckeditor/editor/plugins/ImageManager/manager.php +++ b/main/inc/lib/fckeditor/editor/plugins/ImageManager/manager.php @@ -129,6 +129,10 @@ body { /*]]>*/ + + diff --git a/main/inc/lib/fckeditor/editor/plugins/audio/fck_audio.html b/main/inc/lib/fckeditor/editor/plugins/audio/fck_audio.html index 3d6cf83465..c8afacf096 100644 --- a/main/inc/lib/fckeditor/editor/plugins/audio/fck_audio.html +++ b/main/inc/lib/fckeditor/editor/plugins/audio/fck_audio.html @@ -34,6 +34,11 @@ document.write( FCKTools.GetStyleHtml( GetCommonDialogCss() ) ) ; + + +
    diff --git a/main/inc/lib/fckeditor/editor/plugins/fckEmbedMovies/fck_embedmovies.html b/main/inc/lib/fckeditor/editor/plugins/fckEmbedMovies/fck_embedmovies.html index b8c704089a..b132164303 100644 --- a/main/inc/lib/fckeditor/editor/plugins/fckEmbedMovies/fck_embedmovies.html +++ b/main/inc/lib/fckeditor/editor/plugins/fckEmbedMovies/fck_embedmovies.html @@ -11,6 +11,11 @@ document.write( FCKTools.GetStyleHtml( GetCommonDialogCss() ) ) ; + + +
    diff --git a/main/inc/lib/fckeditor/editor/plugins/flvPlayer/flvPlayer.html b/main/inc/lib/fckeditor/editor/plugins/flvPlayer/flvPlayer.html index 8fada75c53..2d4b4d784e 100644 --- a/main/inc/lib/fckeditor/editor/plugins/flvPlayer/flvPlayer.html +++ b/main/inc/lib/fckeditor/editor/plugins/flvPlayer/flvPlayer.html @@ -12,9 +12,11 @@ document.write( FCKTools.GetStyleHtml( GetCommonDialogCss() ) ) ; - +
    diff --git a/main/inc/lib/fckeditor/editor/plugins/googlemaps/dialog/googleMaps.html b/main/inc/lib/fckeditor/editor/plugins/googlemaps/dialog/googleMaps.html index 062805b8e4..8072d59ffa 100644 --- a/main/inc/lib/fckeditor/editor/plugins/googlemaps/dialog/googleMaps.html +++ b/main/inc/lib/fckeditor/editor/plugins/googlemaps/dialog/googleMaps.html @@ -26,6 +26,11 @@ + + + + @@ -25,7 +29,7 @@
    - +
    diff --git a/main/inc/lib/fckeditor/editor/plugins/mimetex/mimetex.html b/main/inc/lib/fckeditor/editor/plugins/mimetex/mimetex.html index 42d5fcc752..a0c99205d1 100644 --- a/main/inc/lib/fckeditor/editor/plugins/mimetex/mimetex.html +++ b/main/inc/lib/fckeditor/editor/plugins/mimetex/mimetex.html @@ -559,6 +559,10 @@ function Ok() document.write( FCKTools.GetStyleHtml( GetCommonDialogCss() ) ) ; + + +
    diff --git a/main/inc/lib/fckeditor/editor/plugins/prompt/fck_prompt.html b/main/inc/lib/fckeditor/editor/plugins/prompt/fck_prompt.html index 0339fe513c..691d206e1d 100644 --- a/main/inc/lib/fckeditor/editor/plugins/prompt/fck_prompt.html +++ b/main/inc/lib/fckeditor/editor/plugins/prompt/fck_prompt.html @@ -58,9 +58,11 @@ window.onload = function() } - +
    diff --git a/main/inc/lib/fckeditor/editor/plugins/wikilink/fck_wikilink.html b/main/inc/lib/fckeditor/editor/plugins/wikilink/fck_wikilink.html index 004ce8a017..7115ccdbef 100644 --- a/main/inc/lib/fckeditor/editor/plugins/wikilink/fck_wikilink.html +++ b/main/inc/lib/fckeditor/editor/plugins/wikilink/fck_wikilink.html @@ -87,6 +87,11 @@ function Ok() } + + +
    diff --git a/main/inc/lib/fckeditor/editor/plugins/youtube/youtube.html b/main/inc/lib/fckeditor/editor/plugins/youtube/youtube.html index c2a5d8854f..7e624276f1 100644 --- a/main/inc/lib/fckeditor/editor/plugins/youtube/youtube.html +++ b/main/inc/lib/fckeditor/editor/plugins/youtube/youtube.html @@ -11,6 +11,11 @@ document.write( FCKTools.GetStyleHtml( GetCommonDialogCss() ) ) ; + + +
    From 3d138eea6d0dcda4ffffa675f88f8ebd0b254a53 Mon Sep 17 00:00:00 2001 From: Ivan Tcholakov Date: Thu, 30 Jul 2009 16:47:03 +0200 Subject: [PATCH 27/56] [svn r22531] FS#2867 - The online editor: Hiding from the simple file manager listing some system files (.editor_*.jpeg) that are produced by the Image Editor. Increasing the font-size of the "Insert special character" dialog. --- main/inc/lib/fckeditor/editor/dialog/fck_specialchar.html | 2 +- .../fckeditor/editor/filemanager/connectors/php/commands.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_specialchar.html b/main/inc/lib/fckeditor/editor/dialog/fck_specialchar.html index ff17c52450..05f1a85bbb 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_specialchar.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_specialchar.html @@ -77,7 +77,7 @@ function setDefaults() diff --git a/main/inc/lib/fckeditor/editor/filemanager/connectors/php/commands.php b/main/inc/lib/fckeditor/editor/filemanager/connectors/php/commands.php index dd1e20b8f9..7791104c0c 100644 --- a/main/inc/lib/fckeditor/editor/filemanager/connectors/php/commands.php +++ b/main/inc/lib/fckeditor/editor/filemanager/connectors/php/commands.php @@ -94,6 +94,7 @@ function GetFoldersAndFiles( $resourceType, $currentFolder ) && ( $in_group || ( !$in_group && strpos( $sFile, '_groupdocs' ) === false ) ) && (!$in_shared_folder || ($in_shared_folder && (!$is_dir || ($is_dir && $sFile == $user_id)))) && $sFile != '.thumbs' + && strpos( $sFile, '.editor_' ) === false && $sFile != '.svn' ) { if ( $is_dir ) From d0c4161c6752581e72da4d172ad9e240012646a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Ra=C3=B1a?= Date: Thu, 30 Jul 2009 20:58:48 +0200 Subject: [PATCH 28/56] [svn r22536] implementation of on line tasks --- main/wiki/index.php | 275 ++++++++++++++++++++++++++++++++++++----- main/wiki/wiki.inc.php | 209 +++++++++++++++++++------------ 2 files changed, 371 insertions(+), 113 deletions(-) diff --git a/main/wiki/index.php b/main/wiki/index.php index 4e2fc9b025..93bdc73eec 100644 --- a/main/wiki/index.php +++ b/main/wiki/index.php @@ -195,9 +195,8 @@ $result=api_sql_query($sql,__LINE__,__FILE__); while ($is_editing_block=Database::fetch_array($result)) { $max_edit_time=1200; // 20 minutes - $timestamp_edit=convert_date_to_number($is_editing_block['time_edit']); - $time_editing=time()-$timestamp_edit; - + $timestamp_edit=strtotime($is_editing_block['time_edit']); + $time_editing=time()-$timestamp_edit; //first prevent concurrent users and double version if($is_editing_block['is_editing']==$_user['user_id']) @@ -234,8 +233,7 @@ if (isset($_POST['SaveWikiChange']) AND $_POST['title']<>'') { //prevent concurrent users and double version Display::display_error_message(get_lang("EditedByAnotherUser")); - } - + } else { $return_message=save_wiki(); @@ -360,7 +358,7 @@ if ($_GET['view']) if($last_row['is_editing']!=0 && $last_row['is_editing']!=$_user['user_id']) { //checking for concurrent users - $timestamp_edit=convert_date_to_number($last_row['time_edit']); + $timestamp_edit=strtotime($last_row['time_edit']); $time_editing=time()-$timestamp_edit; $max_edit_time=1200; // 20 minutes $rest_time=$max_edit_time-$time_editing; @@ -1230,11 +1228,10 @@ if ($_GET['action']=='showpage' AND !isset($_POST['SaveWikiNew'])) if ($_GET['action']=='edit') { $_clean['group_id']=(int)$_SESSION['_gid']; - - $sql='SELECT * FROM '.$tbl_wiki.'WHERE reflink="'.html_entity_decode(Database::escape_string(stripslashes(urldecode($page)))).'" AND '.$groupfilter.' ORDER BY id DESC'; - $result=api_sql_query($sql,__LINE__,__FILE__); - $row=Database::fetch_array($result); // we do not need a while loop since we are always displaying the last version + $sql='SELECT * FROM '.$tbl_wiki.', '.$tbl_wiki_conf.' WHERE '.$tbl_wiki_conf.'.page_id='.$tbl_wiki.'.page_id AND '.$tbl_wiki.'.reflink="'.html_entity_decode(Database::escape_string(stripslashes(urldecode($page)))).'" AND '.$tbl_wiki.'.'.$groupfilter.' ORDER BY id DESC'; + $result=api_sql_query($sql,__LINE__,__FILE__); + $row=Database::fetch_array($result); // we do not need a while loop since we are always displaying the last version if ($row['content']=='' AND $row['title']=='' AND $page=='') @@ -1316,9 +1313,82 @@ if ($_GET['action']=='edit') Display::display_normal_message(get_lang('PageLockedExtra')); } else - { - - //previous checking for concurrent editions + { + //check tasks + if (!empty($row['startdate_assig']) && $row['startdate_assig']!='0000-00-00 00:00:00' && time()strtotime($row['enddate_assig']) && $row['enddate_assig']!='0000-00-00 00:00:00' && $row['delayedsubmit']==0) + { + $message=get_lang('TheDeadlineHasBeenCompleted').': '.$row['enddate_assig']; + Display::display_warning_message($message); + if(!api_is_allowed_to_edit()) + { + exit; + } + } + + // + if(!empty($row['max_version']) && $row['version']>=$row['max_version']) + { + $message=get_lang('HasReachedMaxiNumVersions'); + Display::display_warning_message($message); + if(!api_is_allowed_to_edit()) + { + exit; + } + } + + // + if (!empty($row['max_text']) && $row['max_text']>=word_count($row['content'])) + { + $message=get_lang('HasReachedMaxNumWords'); + Display::display_warning_message($message); + if(!api_is_allowed_to_edit()) + { + exit; + } + + } + + //// + if (!empty($row['task'])) + { + $message_task=''.get_lang('DescriptionOfTheTask').'

    '.$row['task'].'


    '; + $message_task.='

    '.get_lang('StartDate').': '.$row['startdate_assig'].'

    '; + $message_task.='

    '.get_lang('EndDate').': '.$row['enddate_assig']; + $message_task.=' ('.get_lang('AllowLaterSends').') '.$row['delayedsubmit'].'

    '; + $message_task.='

    '.get_lang('OtherRequirements').': '.get_lang('NMaxVersion').': '.$row['max_version']; + $message_task.=' '.get_lang('NMaxWords').': '.$row['max_text']; + + Display::display_normal_message($message_task); + } + + if($row['progress']==$row['fprogress1'] && !empty($row['fprogress1'])) + { + $feedback_message=''.get_lang('Feedback').'

    '.$row['feedback1'].'

    '; + Display::display_normal_message($feedback_message); + } + elseif($row['progress']==$row['fprogress2'] && !empty($row['fprogress2'])) + { + $feedback_message=''.get_lang('Feedback').'

    '.$row['feedback2'].'

    '; + Display::display_normal_message($feedback_message); + } + elseif($row['progress']==$row['fprogress3'] && !empty($row['fprogress3'])) + { + $feedback_message=''.get_lang('Feedback').'

    '.$row['feedback3'].'

    '; + Display::display_normal_message($feedback_message); + } + + //previous checking for concurrent editions if($row['is_editing']==0) { Display::display_normal_message(get_lang('WarningMaxEditingTime')); @@ -1329,7 +1399,7 @@ if ($_GET['action']=='edit') } elseif($row['is_editing']!=$_user['user_id']) { - $timestamp_edit=convert_date_to_number($row['time_edit']); + $timestamp_edit=strtotime($row['time_edit']); $time_editing=time()-$timestamp_edit; $max_edit_time=1200; // 20 minutes $rest_time=$max_edit_time-$time_editing; @@ -1339,12 +1409,155 @@ if ($_GET['action']=='edit') $is_being_edited= get_lang('ThisPageisBeginEditedBy').' '.$userinfo['lastname'].', '.$userinfo['firstname'].'. '.get_lang('ThisPageisBeginEditedTryLater').' '.date( "i",$rest_time).' '.get_lang('MinMinutes').''; Display::display_normal_message($is_being_edited); exit; - } - - echo '
    '; - echo $icon_assignment.'   '.$title.'
    '; - echo '
    '; + } + //form echo '
    '; + echo '
    '; + echo $icon_assignment.'   '.$title; + // + + if((api_is_allowed_to_edit() || api_is_platform_admin()) && $_SESSION['_gid']!=0) + { + + echo' '.Display::return_icon('div_show.gif',get_lang('Show')).' '.get_lang('AdvancedParameters').''; + + echo '
    '; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo '
    '.get_lang('DescriptionOfTheTask').'
    '; + echo '
    '; + + //feedback + echo '
     
     '.get_lang('AddFeedback').''; + echo '   '; + echo ''; + + //time limit + echo '
     
     '.get_lang('PutATimeLimit').''; + echo '   '; + echo ''; + + //other limit + echo '
     
     '.get_lang('OtherSettings').''; + echo '   '; + echo ''; + + // + echo ''; + } + + echo ''; + echo '
    '; + echo ''; echo ''; echo ''; @@ -1354,19 +1567,19 @@ if ($_GET['action']=='edit') : array('ToolbarSet' => 'WikiStudent', 'Width' => '100%', 'Height' => '400', 'UserStatus' => 'student') ); echo '
    '; - echo '
    '; + echo '
    '; //if(api_is_allowed_to_edit() || api_is_platform_admin()) //off for now //{ - echo get_lang('Comments').':     '; - //} - + echo get_lang('Comments').':     '; + //} echo ''; - //echo ''; //off for now - //echo ''; //off for now - //echo ''; //off for now - - echo ''; //get current version - + echo ''; + + //hack date for edit + echo ''; + echo ''; + + // echo get_lang('Progress').':  ';//prevent double post echo ''; //for save icon echo '';//for save button - echo ''; - echo '
    '; + echo ''; + echo ''; } } } diff --git a/main/wiki/wiki.inc.php b/main/wiki/wiki.inc.php index 44e81dff26..a9d6d92e7b 100644 --- a/main/wiki/wiki.inc.php +++ b/main/wiki/wiki.inc.php @@ -314,16 +314,46 @@ function save_wiki() { } //cleaning config variables - - $_clean['feedback1']=Database::escape_string(Security::remove_XSS($_POST['feedback1'])); - $_clean['feedback2']=Database::escape_string(Security::remove_XSS($_POST['feedback2'])); - $_clean['feedback3']=Database::escape_string(Security::remove_XSS($_POST['feedback3'])); - $_clean['max_text']=Database::escape_string(Security::remove_XSS($_POST['max_text'])); - $_clean['max_version']=Database::escape_string(Security::remove_XSS($_POST['max_version'])); - $_clean['startdate_assig']=Database::escape_string(Security::remove_XSS($_POST['startdate_assig'])); - $_clean['enddate_assig']=Database::escape_string(Security::remove_XSS($_POST['enddate_assig'])); - $_clean['delayedsubmit']=Database::escape_string(Security::remove_XSS($_POST['delayedsubmit'])); + + if(!empty($_POST['task'])) + { + $_clean['task']=Database::escape_string(Security::remove_XSS($_POST['task'])); + } + if(!empty($_POST['feedback1']) || !empty($_POST['feedback2']) || !empty($_POST['feedback3'])) + { + $_clean['feedback1']=Database::escape_string(Security::remove_XSS($_POST['feedback1'])); + $_clean['feedback2']=Database::escape_string(Security::remove_XSS($_POST['feedback2'])); + $_clean['feedback3']=Database::escape_string(Security::remove_XSS($_POST['feedback3'])); + $_clean['fprogress1']=Database::escape_string(Security::remove_XSS($_POST['fprogress1'])); + $_clean['fprogress2']=Database::escape_string(Security::remove_XSS($_POST['fprogress2'])); + $_clean['fprogress3']=Database::escape_string(Security::remove_XSS($_POST['fprogress3'])); + } + + if(Security::remove_XSS($_POST['initstartdate']==1)) + { + $_clean['startdate_assig']=Database::escape_string(Security::remove_XSS(get_date_from_select('startdate_assig'))); + } + else + { + $_clean['startdate_assig']=Database::escape_string(Security::remove_XSS($_POST['startdate_assig'])); + } + + if(Security::remove_XSS($_POST['initenddate']==1)) + { + $_clean['enddate_assig']=Database::escape_string(Security::remove_XSS(get_date_from_select('enddate_assig'))); + } + else + { + $_clean['enddate_assig']=Database::escape_string(Security::remove_XSS($_POST['enddate_assig'])); + } + + $_clean['delayedsubmit']=Database::escape_string(Security::remove_XSS($_POST['delayedsubmit'])); + if(!empty($_POST['max_text']) || !empty($_POST['max_version'])) + { + $_clean['max_text']=Database::escape_string(Security::remove_XSS($_POST['max_text'])); + $_clean['max_version']=Database::escape_string(Security::remove_XSS($_POST['max_version'])); + } $sql="INSERT INTO ".$tbl_wiki." (page_id, reflink, title, content, user_id, group_id, dtime, assignment, comment, progress, version, linksto, user_ip) VALUES ('".$_clean['page_id']."','".$_clean['reflink']."','".$_clean['title']."','".$_clean['content']."','".$_clean['user_id']."','".$_clean['group_id']."','".$dtime."','".$_clean['assignment']."','".$_clean['comment']."','".$_clean['progress']."','".$_clean['version']."','".$_clean['linksto']."','".Database::escape_string($_SERVER['REMOTE_ADDR'])."')"; @@ -340,11 +370,11 @@ function save_wiki() { if ($_clean['reflink']=='index' && $_clean['version']==1) { - $sql="INSERT INTO ".$tbl_wiki_conf." (page_id, feedback1, feedback2, feedback3, fprogress1, fprogress2, fprogress3, max_text, max_version, startdate_assig, enddate_assig, delayedsubmit) VALUES ('".$Id."','".$_clean['feedback1']."','".$_clean['feedback2']."','".$_clean['feedback3']."','".$_clean['fprogress1']."','".$_clean['fprogress2']."','".$_clean['fprogress3']."','".$_clean['max_text']."','".$_clean['max_version']."','".$_clean['startdate_assig']."','".$_clean['enddate_assig']."','".$_clean['delayedsubmit']."')"; + $sql="INSERT INTO ".$tbl_wiki_conf." (page_id, task, feedback1, feedback2, feedback3, fprogress1, fprogress2, fprogress3, max_text, max_version, startdate_assig, enddate_assig, delayedsubmit) VALUES ('".$Id."','".$_clean['task']."','".$_clean['feedback1']."','".$_clean['feedback2']."','".$_clean['feedback3']."','".$_clean['fprogress1']."','".$_clean['fprogress2']."','".$_clean['fprogress3']."','".$_clean['max_text']."','".$_clean['max_version']."','".$_clean['startdate_assig']."','".$_clean['enddate_assig']."','".$_clean['delayedsubmit']."')"; } else { - $sql='UPDATE'.$tbl_wiki_conf.' SET page_id="'.$Id.'", feedback1="'.$_clean['feedback1'].'", feedback2="'.$_clean['feedback2'].'", feedback3="'.$_clean['feedback3'].'", max_text="'.$_clean['max_text'].'", max_version="'.$_clean['max_version'].'", startdate_assig="'.$_clean['startdate_assig'].'", enddate_assig="'.$_clean['enddate_assig'].'", delayedsubmit="'.$_clean['delayedsubmit'].'" WHERE page_id="'.$Id.'"'; + $sql='UPDATE'.$tbl_wiki_conf.' SET task="'.$_clean['task'].'", feedback1="'.$_clean['feedback1'].'", feedback2="'.$_clean['feedback2'].'", feedback3="'.$_clean['feedback3'].'", fprogress1="'.$_clean['fprogress1'].'", fprogress2="'.$_clean['fprogress2'].'", fprogress3="'.$_clean['fprogress3'].'", max_text="'.$_clean['max_text'].'", max_version="'.$_clean['max_version'].'", startdate_assig="'.$_clean['startdate_assig'].'", enddate_assig="'.$_clean['enddate_assig'].'", delayedsubmit="'.$_clean['delayedsubmit'].'" WHERE page_id="'.$_clean['page_id'].'"'; } api_sql_query($sql,__FILE__,__LINE__); @@ -463,27 +493,36 @@ function save_new_wiki() { $_clean['linksto'] = links_to($_clean['content']); //check wikilinks //cleaning config variables - if(Security::remove_XSS($_POST['timelimit']==1)) + $_clean['task']=Database::escape_string(Security::remove_XSS($_POST['task'])); + $_clean['feedback1']=Database::escape_string(Security::remove_XSS($_POST['feedback1'])); + $_clean['feedback2']=Database::escape_string(Security::remove_XSS($_POST['feedback2'])); + $_clean['feedback3']=Database::escape_string(Security::remove_XSS($_POST['feedback3'])); + $_clean['fprogress1']=Database::escape_string(Security::remove_XSS($_POST['fprogress1'])); + $_clean['fprogress2']=Database::escape_string(Security::remove_XSS($_POST['fprogress2'])); + $_clean['fprogress3']=Database::escape_string(Security::remove_XSS($_POST['fprogress3'])); + + if(Security::remove_XSS($_POST['initstartdate']==1)) { $_clean['startdate_assig']=Database::escape_string(Security::remove_XSS(get_date_from_select('startdate_assig'))); - $_clean['enddate_assig']=Database::escape_string(Security::remove_XSS(get_date_from_select('enddate_assig'))); - $_clean['delayedsubmit']=Database::escape_string(Security::remove_XSS($_POST['delayedsubmit'])); } - if(Security::remove_XSS($_POST['feedback']==1)) + else { - $_clean['feedback1']=Database::escape_string(Security::remove_XSS($_POST['feedback1'])); - $_clean['feedback2']=Database::escape_string(Security::remove_XSS($_POST['feedback2'])); - $_clean['feedback3']=Database::escape_string(Security::remove_XSS($_POST['feedback3'])); - $_clean['fprogress1']=Database::escape_string(Security::remove_XSS($_POST['fprogress1'])); - $_clean['fprogress2']=Database::escape_string(Security::remove_XSS($_POST['fprogress2'])); - $_clean['fprogress3']=Database::escape_string(Security::remove_XSS($_POST['fprogress3'])); + $_clean['startdate_assig']=Database::escape_string(Security::remove_XSS($_POST['startdate_assig'])); } - if(Security::remove_XSS($_POST['otherlimit']==1)) + + if(Security::remove_XSS($_POST['initenddate']==1)) { - $_clean['max_text']=Database::escape_string(Security::remove_XSS($_POST['max_text'])); - $_clean['max_version']=Database::escape_string(Security::remove_XSS($_POST['max_version'])); - } + $_clean['enddate_assig']=Database::escape_string(Security::remove_XSS(get_date_from_select('enddate_assig'))); + } + else + { + $_clean['enddate_assig']=Database::escape_string(Security::remove_XSS($_POST['enddate_assig'])); + } + $_clean['delayedsubmit']=Database::escape_string(Security::remove_XSS($_POST['delayedsubmit'])); + $_clean['max_text']=Database::escape_string(Security::remove_XSS($_POST['max_text'])); + $_clean['max_version']=Database::escape_string(Security::remove_XSS($_POST['max_version'])); + //filter no _uass if (api_eregi('_uass', $_POST['title']) || (api_strtoupper(trim($_POST['title'])) == 'INDEX' || api_strtoupper(trim(api_htmlentities($_POST['title'], ENT_QUOTES, $charset))) == api_strtoupper(api_htmlentities(get_lang('DefaultTitle'), ENT_QUOTES, $charset)))) { $message= get_lang('GoAndEditMainPage'); @@ -505,7 +544,7 @@ function save_new_wiki() { api_sql_query($sql,__FILE__,__LINE__); //insert wiki config - $sql="INSERT INTO ".$tbl_wiki_conf." (page_id, feedback1, feedback2, feedback3, fprogress1, fprogress2, fprogress3, max_text, max_version, startdate_assig, enddate_assig, delayedsubmit) VALUES ('".$Id."','".$_clean['feedback1']."','".$_clean['feedback2']."','".$_clean['feedback3']."','".$_clean['fprogress1']."','".$_clean['fprogress2']."','".$_clean['fprogress3']."','".$_clean['max_text']."','".$_clean['max_version']."','".$_clean['startdate_assig']."','".$_clean['enddate_assig']."','".$_clean['delayedsubmit']."')"; + $sql="INSERT INTO ".$tbl_wiki_conf." (page_id, task, feedback1, feedback2, feedback3, fprogress1, fprogress2, fprogress3, max_text, max_version, startdate_assig, enddate_assig, delayedsubmit) VALUES ('".$Id."','".$_clean['task']."','".$_clean['feedback1']."','".$_clean['feedback2']."','".$_clean['feedback3']."','".$_clean['fprogress1']."','".$_clean['fprogress2']."','".$_clean['fprogress3']."','".$_clean['max_text']."','".$_clean['max_version']."','".$_clean['startdate_assig']."','".$_clean['enddate_assig']."','".$_clean['delayedsubmit']."')"; api_sql_query($sql,__LINE__,__FILE__); api_item_property_update($_course, 'wiki', $Id, 'WikiAdded', api_get_user_id(), $_clean['group_id']); @@ -539,7 +578,7 @@ return true; } '; echo '
    '; echo '* '.get_lang(Title).': '; @@ -548,39 +587,34 @@ return true; { $_clean['group_id']=(int)$_SESSION['_gid']; // TODO: check if delete ? - - //echo' '.Display::return_icon('div_show.gif',get_lang('Show')).' '.get_lang('AdvancedParameters').''; // TODO: under develop, uncoment and activate later + + echo' '.Display::return_icon('div_show.gif',get_lang('Show')).' '.get_lang('AdvancedParameters').''; echo ''; + //to define as an individual assignment echo '
     '.get_lang('DefineAssignmentPage').':
    '; // 1= teacher 2 =student - + // echo'
    '; - echo '
     
    '; - } echo ''; echo '
    '; @@ -689,6 +745,7 @@ function display_wiki_entry() { global $charset; global $tbl_wiki; + global $tbl_wiki_conf; global $groupfilter; global $page; @@ -697,7 +754,8 @@ function display_wiki_entry() if ($_GET['view']) { $_clean['view']=(int)Database::escape_string($_GET['view']); - $filter=" AND id='".$_clean['view']."'"; + + $filter=' AND '.$tbl_wiki.'.id="'.$_clean['view'].'"'; } //first, check page visibility in the first page version @@ -707,9 +765,9 @@ function display_wiki_entry() $KeyVisibility=$row['visibility']; // second, show the last version - $sql="SELECT * FROM ".$tbl_wiki."WHERE reflink='".html_entity_decode(Database::escape_string(stripslashes(urldecode($page))))."' AND $groupfilter $filter ORDER BY id DESC"; - $result=api_sql_query($sql,__LINE__,__FILE__); - $row=Database::fetch_array($result); // we do not need a while loop since we are always displaying the last version + $sql='SELECT * FROM '.$tbl_wiki.', '.$tbl_wiki_conf.' WHERE '.$tbl_wiki_conf.'.page_id='.$tbl_wiki.'.page_id AND '.$tbl_wiki.'.reflink="'.html_entity_decode(Database::escape_string(stripslashes(urldecode($page)))).'" AND '.$tbl_wiki.'.'.$groupfilter.' '.$filter.' ORDER BY id DESC'; + $result=api_sql_query($sql,__LINE__,__FILE__); + $row=Database::fetch_array($result); // we do not need a while loop since we are always displaying the last version //update visits @@ -740,7 +798,7 @@ function display_wiki_entry() } - //assignment mode: for identify page type + //assignment mode: identify page type if(stripslashes($row['assignment'])==1) { $icon_assignment=''.get_lang('AssignmentDescExtra').''; @@ -749,8 +807,13 @@ function display_wiki_entry() { $icon_assignment=''.get_lang('AssignmentWorkExtra').''; } - - + + //task mode + + if (!empty($row['task'])) + { + $icon_task=''.get_lang('TaskExtra').''; + } //Show page. Show page to all users if isn't hide page. Mode assignments: if student is the author, can view if($KeyVisibility=="1" || api_is_allowed_to_edit() || api_is_platform_admin() || ($row['assignment']==2 && $KeyVisibility=="0" && (api_get_user_id()==$row['user_id']))) @@ -861,7 +924,7 @@ function display_wiki_entry() if (wiki_exist($title)) { - echo $icon_assignment.'   '.stripslashes($title); + echo $icon_assignment.' '.$icon_task.' '.stripslashes($title); } else { @@ -1751,17 +1814,6 @@ function double_post($wpost_id) } } -/** - * Function convert date to number - * 2008-10-12 00:00:00 ---to--> 12345672218 (timestamp) - */ -function convert_date_to_number($default) -{ - $parts = split(' ',$default); - list($d_year,$d_month,$d_day) = split('-',$parts[0]); - list($d_hour,$d_minute,$d_second) = split(':',$parts[1]); - return mktime($d_hour, $d_minute, $d_second, $d_month, $d_day, $d_year); -} /** * Function wizard individual assignment @@ -2008,7 +2060,7 @@ function display_wiki_search_results($search_term, $search_content=0) * */ function draw_date_picker($prefix,$default='') { - //$default = 2008-10-01 10:00:00 + if(empty($default)) { $default = date('Y-m-d H:i:s'); } @@ -2035,7 +2087,7 @@ function draw_date_picker($prefix,$default='') { array_unshift($minute,'00','01','02','03','04','05','06','07','08','09'); $date_form = make_select($prefix.'_day', array_combine(range(1,31),range(1,31)), $d_day); $date_form .= make_select($prefix.'_month', $month_list, $d_month); - $date_form .= make_select($prefix.'_year', array( $d_year=> $d_year, $d_year+1=>$d_year+1), $d_year).'    '; + $date_form .= make_select($prefix.'_year', array($d_year-2=>$d_year-2, $d_year-1=>$d_year-1, $d_year=> $d_year, $d_year+1=>$d_year+1, $d_year+2=>$d_year+2), $d_year).'    '; $date_form .= make_select($prefix.'_hour', array_combine(range(0,23),range(0,23)), $d_hour).' : '; $date_form .= make_select($prefix.'_minute', $minute, $d_minute); return $date_form; @@ -2054,14 +2106,6 @@ function make_select($name,$values,$checked='') { return $output; } -/** - * Enter description here... - * - */ -function make_checkbox($name,$checked='') { - return '' . - ''; -} /** * Enter description here... @@ -2079,4 +2123,5 @@ function two_digits($number) $number = (int)$number; return ($number < 10) ? '0'.$number : $number; } + ?> \ No newline at end of file From b32b014687892b4352757e5a09e6af5c867e1c67 Mon Sep 17 00:00:00 2001 From: Ricardo Rodriguez Date: Thu, 30 Jul 2009 21:57:54 +0200 Subject: [PATCH 29/56] [svn r22537] Minor - update new test function --- tests/main/admin/calendar.lib.test.php | 102 ++++++++++++++++++++----- 1 file changed, 85 insertions(+), 17 deletions(-) diff --git a/tests/main/admin/calendar.lib.test.php b/tests/main/admin/calendar.lib.test.php index 83b6051562..1da4db3e88 100644 --- a/tests/main/admin/calendar.lib.test.php +++ b/tests/main/admin/calendar.lib.test.php @@ -2,7 +2,7 @@ require_once(api_get_path(LIBRARY_PATH) . "/fckeditor/fckeditor.php"); require_once(api_get_path(LIBRARY_PATH).'fileUpload.lib.php'); -require_once (api_get_path(LIBRARY_PATH).'icalcreator/iCalcreator.class.php'); +require_once(api_get_path(LIBRARY_PATH).'icalcreator/iCalcreator.class.php'); Mock::generate('Database'); Mock::generate('Display'); class TestCalendar extends UnitTestCase { @@ -549,17 +549,18 @@ class TestCalendar extends UnitTestCase { //var_dump($res); } /** - * para poder realizar esta prueba, se tuvo que comentar el die hubicado en la - * linea 2877 para que la prueba resultara exitosa. + * para poder realizar esta prueba, se tuvo que comentar el "die" ubicado en la + * linea 2877 para que la prueba pudiera ejecutarse de manera exitosa. */ public function testAgendaAddItem(){ + $realagenda = new MockDatabase(); global $_course; - $course_info=''; - $title=''; - $content=''; - $db_start_date=''; - $db_end_date=''; + $course_info='null'; + $title='test'; + $content='test function'; + $db_start_date='07/11/2009'; + $db_end_date='07/20/2009'; $to=array(); $parent_id=null; $t_agenda = Database::get_main_table(TABLE_MAIN_SYSTEM_CALENDAR); @@ -570,23 +571,90 @@ class TestCalendar extends UnitTestCase { $sql = "SELECT * FROM $t_agenda WHERE title='$title' AND content = '$content' AND start_date = '$start_date' AND end_date = '$end_date' ".(!empty($parent_id)? "AND parent_event_id = '$parent_id'":""); $result = api_sql_query($sql,__FILE__,__LINE__); - $count = Database::num_rows($result); - $sql1 = "INSERT INTO ".$t_agenda." - (title,content, start_date, end_date) - VALUES - ('".$title."','".$content."', '".$start_date."','".$end_date."')"; - $result = api_sql_query($sql1,__FILE__,__LINE__); + $sql1 = "INSERT INTO ".$t_agenda."(title,content, start_date, end_date)VALUES + ('".$title."','".$content."', '".$start_date."','".$end_date."')"; + $result1 = api_sql_query($sql1,__FILE__,__LINE__); $real_agenda[]= $result; + $real_agenda1[]= $result1; //$res = agenda_add_item($course_info, $title, $content, $db_start_date, $db_end_date, $to, $parent_id); $realagenda->expectOnce($real_agenda); + $realagenda->expectOnce($real_agenda1); //$this->assertTrue(is_numeric($res)); $this->assertTrue(is_array($real_agenda)); - $this->assertTrue($realagenda); + $this->assertTrue(is_array($real_agenda1)); //var_dump($res); - var_dump($real_agenda); - var_dump($realagenda); + //var_dump($real_agenda); + //var_dump($real_agenda1); } + public function testGetCalendarItems(){ + $realgetcalendar = new MockDatabase(); + global $_user, $_course; + global $is_allowed_to_edit; + $month='march'; + $year='2009'; + $TABLEAGENDA = Database::get_main_table(TABLE_MAIN_SYSTEM_CALENDAR); + $sql="SELECT + DISTINCT * + FROM ".$TABLEAGENDA." agenda + WHERE MONTH(start_date)='".$month."' AND YEAR(start_date)='".$year."' + GROUP BY id ". + "ORDER BY start_date "; + $result=api_sql_query($sql,__FILE__,__LINE__); + $row=Database::fetch_array($result); + $res = get_calendar_items($month, $year); + $real_get_calendar[]= $row; + $realgetcalendar->expectOnce($real_get_calendar); + $realgetcalendar->expectCallCount($real_get_calendar); + $this->assertTrue(is_bool($row)); + $this->assertTrue(is_array($real_get_calendar)); + $this->assertTrue(is_array($res)); + //var_dump($real_get_calendar); + //var_dump($row); + //var_dump($res); + } + + public function testAgendaAddRepeatItem(){ + $realagenda = new MockDatabase(); + $course_info='course of test'; + $orig_id=001; + $type='daily'; + $end=10; + $orig_dest='monday'; + $t_agenda = Database::get_main_table(TABLE_MAIN_SYSTEM_CALENDAR,$course_info['dbName']); + $sql = "SELECT title, content, start_date as sd, end_date as ed FROM $t_agenda WHERE id = $orig_id"; + $res = Database::query($sql,__FILE__,__LINE__); + $row = Database::fetch_array($res); + $sql1 = "INSERT INTO $t_agenda_r (cal_id, cal_type, cal_end)" . + " VALUES ($orig_id,'$type',$end)"; + $res1 = Database::query($sql1,__FILE__,__LINE__); + $resu= agenda_add_repeat_item($course_info,$orig_id,$type,$end,$orig_dest); + $real_agenda[] = $row; + $realagenda->expectOnce($real_agenda); + $realagenda->expectCallCount($real_agenda); + $realagenda->expectOnce($t_agenda); + $realagenda->expectOnce($res1); + $this->assertTrue(is_bool($resu)); + $this->assertTrue(is_array($real_agenda)); + $this->assertTrue($row); + //var_dump($resu); + //var_dump($res); + //var_dump($res1); + //var_dump($real_agenda); + } + + public function testAgendaImportIcal(){ + $course_info='course_test'; + $file=''; + $res = agenda_import_ical($course_info,$file); + if(is_bool($res)){ + $this->assertTrue(is_bool($res)); + $this->assertTrue($res===false || $res === true); + }else{ + $this->assertTrue($res); + } + var_dump($res); + } From f9979e3f4ded09d9b4182b488d6ea7c5570221be Mon Sep 17 00:00:00 2001 From: Ricardo Rodriguez Date: Thu, 30 Jul 2009 22:04:07 +0200 Subject: [PATCH 30/56] [svn r22539] Minor - update library to test function --- tests/all.test2.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/all.test2.php b/tests/all.test2.php index 3e61402461..ac91e3f5fb 100644 --- a/tests/all.test2.php +++ b/tests/all.test2.php @@ -7,6 +7,7 @@ require_once('simpletest/web_tester.php'); require_once('simpletest/mock_objects.php'); require_once('simpletest/autorun.php'); require_once(api_get_path(SYS_CODE_PATH).'admin/calendar.lib.php'); + $_SESSION['_user']['user_id'] = 1; $_user= 1; From 7d054bf637647d253bf3cdf562399817fcc3c2fb Mon Sep 17 00:00:00 2001 From: Cristian Fasanando Date: Thu, 30 Jul 2009 22:10:28 +0200 Subject: [PATCH 31/56] [svn r22540] Fixed extra information into my shared profile - see FS#4447 --- main/social/profile.php | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/main/social/profile.php b/main/social/profile.php index ad26077eba..733790fd24 100644 --- a/main/social/profile.php +++ b/main/social/profile.php @@ -701,17 +701,49 @@ echo '
    '; }*/ if ($show_full_profile) { - //-- Extra Data + //-- Extra Data + $t_uf = Database :: get_main_table(TABLE_MAIN_USER_FIELD); + $t_ufo = Database :: get_main_table(TABLE_MAIN_USER_FIELD_OPTIONS); $extra_user_data = UserManager::get_extra_user_data($user_id); if (is_array($extra_user_data) && count($extra_user_data)>0 ) { echo '
    '; echo get_lang('ExtraInformation'); echo '
    '; echo ''; echo '

    '; } From 949f542b0c9b9952a41c3401fb357dd775e4ec04 Mon Sep 17 00:00:00 2001 From: Arthur Portugal Date: Thu, 30 Jul 2009 22:14:45 +0200 Subject: [PATCH 32/56] [svn r22541] Added a new folder and lib --- tests/main/auth/lost_password.lib.test.php | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 tests/main/auth/lost_password.lib.test.php diff --git a/tests/main/auth/lost_password.lib.test.php b/tests/main/auth/lost_password.lib.test.php new file mode 100644 index 0000000000..54756b875f --- /dev/null +++ b/tests/main/auth/lost_password.lib.test.php @@ -0,0 +1,78 @@ +assertTrue($res); + $this->assertTrue(is_string($res)); + //var_dump($res); + } + + function testget_secret_word(){ + global $_configuration; + $add=''; + $res = get_secret_word($add); + $this->assertTrue($res); + $this->assertTrue(is_string($res)); + //var_dump($res); + } + + function testget_user_account_list(){ + global $_configuration; + $user=''; + $thisUser=array(); + $secretword = get_secret_word($thisUser["email"]); + $reset_link = get_lang('Pass')." : $thisUser[password]"; + $userAccountList[] = get_lang('YourRegistrationData')." : \n".get_lang('UserName').' : '.$thisUser["loginName"]."\n".get_lang('ResetLink').' : '.$reset_link.''; + $res = get_user_account_list($user, $reset = false); + $this->assertTrue($userAccountList); + $this->assertTrue(is_array($userAccountList)); + //var_dump($userAccountList); + } + + function testhandle_encrypted_password() { + require_once api_get_path (LIBRARY_PATH).'mail.lib.inc.php'; + global $charset; + global $_configuration; + ob_start(); + $user=array('abc'); + $emailHeaders = get_email_headers(); // Email Headers + $emailSubject = "[".get_setting('siteName')."] ".get_lang('LoginRequest'); // SUBJECT + $userAccountList = get_user_account_list($user, true); // BODY + $emailTo = $user[0]["email"]; + $secretword = get_secret_word($emailTo); + $emailBody = get_lang('DearUser')." :\n".get_lang("password_request")."\n\n"; + $emailBody .= "-----------------------------------------------\n".$userAccountList."\n-----------------------------------------------\n\n"; + $emailBody .=get_lang('PasswordEncryptedForSecurity'); + $emailBody .="\n\n".get_lang('Formula').",\n".get_lang('PlataformAdmin'); + $sender_name = get_setting('administratorName').' '.get_setting('administratorSurname'); + $email_admin = get_setting('emailAdministrator'); + $res=handle_encrypted_password($user); + if(!is_array($res))$this->assertTrue(is_null($res)); + ob_end_clean(); + //var_dump($res); + } + + function testreset_password(){ + $secret='1234567891011'; + $id=5; + $res=reset_password($secret, $id); + $this->assertTrue($res); + $this->assertTrue(is_string($res)); + //var_dump($res); + } + + function testsend_password_to_user() { + $user=array(); + ob_start(); + $res=send_password_to_user($user); + if(!is_null($res))$this->assertTrue(is_array($res)); + ob_end_clean(); + //var_dump($res); + } +} +?> From 28aa3ebc10ebfeb49d098f3ce1c44d1d08f17814 Mon Sep 17 00:00:00 2001 From: Ricardo Rodriguez Date: Thu, 30 Jul 2009 22:31:32 +0200 Subject: [PATCH 33/56] [svn r22542] Minor - fixed error in the declaration of the return in the assert --- tests/main/admin/calendar.lib.test.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/main/admin/calendar.lib.test.php b/tests/main/admin/calendar.lib.test.php index 1da4db3e88..9ffcb99103 100644 --- a/tests/main/admin/calendar.lib.test.php +++ b/tests/main/admin/calendar.lib.test.php @@ -634,7 +634,11 @@ class TestCalendar extends UnitTestCase { $realagenda->expectCallCount($real_agenda); $realagenda->expectOnce($t_agenda); $realagenda->expectOnce($res1); + if(is_bool($resu)){ $this->assertTrue(is_bool($resu)); + $this->assertTrue($resu === true || $resu===false); + }else + $this->assertTrue(is_null($resu)); $this->assertTrue(is_array($real_agenda)); $this->assertTrue($row); //var_dump($resu); @@ -653,7 +657,7 @@ class TestCalendar extends UnitTestCase { }else{ $this->assertTrue($res); } - var_dump($res); + //var_dump($res); } From 7f7812a12c99b671b4b3e91c7ffc3c8af10f6c63 Mon Sep 17 00:00:00 2001 From: Arthur Portugal Date: Thu, 30 Jul 2009 22:55:20 +0200 Subject: [PATCH 34/56] [svn r22543] Added new folder open id --- tests/main/auth/openid/openid.lib.test.php | 9 +++++ tests/main/auth/openid/xrds.lib.test.php | 46 ++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 tests/main/auth/openid/openid.lib.test.php create mode 100644 tests/main/auth/openid/xrds.lib.test.php diff --git a/tests/main/auth/openid/openid.lib.test.php b/tests/main/auth/openid/openid.lib.test.php new file mode 100644 index 0000000000..71b3fc80de --- /dev/null +++ b/tests/main/auth/openid/openid.lib.test.php @@ -0,0 +1,9 @@ + diff --git a/tests/main/auth/openid/xrds.lib.test.php b/tests/main/auth/openid/xrds.lib.test.php new file mode 100644 index 0000000000..96e7902b8e --- /dev/null +++ b/tests/main/auth/openid/xrds.lib.test.php @@ -0,0 +1,46 @@ +assertTrue(is_null($res)); + //var_dump($res); + } + + function test_xrds_element_end() { + global $xrds_open_elements, $xrds_services, $xrds_current_service; + $parser=''; + $name=''; + $xrds_current_service['version'] = 2; + $xrds_current_service['version'] = 1; + $xrds_services[] = $xrds_current_service; + $xrds_current_service= array(); + $res=_xrds_element_end($parser, $name); + $this->assertTrue(is_null($res)); + //var_dump($xrds_current_service); + } + + function test_xrds_element_start() { + global $xrds_open_elements; + $parser=''; + $name=''; + $attribs=''; + $xrds_open_elements[] = _xrds_strip_namespace($name); + $res=_xrds_element_start($parser, $name); + $this->assertTrue(is_null($res)); + //var_dump($res); + } + + function test_xrds_strip_namespace() { + $name=''; + $res=_xrds_strip_namespace($name); + $this->assertTrue(is_string($res)); + //var_dump($res); + } +} +?> From bd7fe72d4dd7a855b2bbc6f2486b595a7e82ab96 Mon Sep 17 00:00:00 2001 From: Arthur Portugal Date: Fri, 31 Jul 2009 00:48:08 +0200 Subject: [PATCH 35/56] [svn r22544] Added all functions in open id --- tests/main/auth/openid/openid.lib.test.php | 213 +++++++++++++++++++++ 1 file changed, 213 insertions(+) diff --git a/tests/main/auth/openid/openid.lib.test.php b/tests/main/auth/openid/openid.lib.test.php index 71b3fc80de..15164e2c4c 100644 --- a/tests/main/auth/openid/openid.lib.test.php +++ b/tests/main/auth/openid/openid.lib.test.php @@ -1,9 +1,222 @@ assertTrue(is_string($res)); + $this->assertTrue(is_string($serialized)); + //var_dump($serialized); + } + + function test_openid_dh_base64_to_long() { + $str=''; + $b64 = base64_decode($str); + $res=_openid_dh_base64_to_long($str); + $this->assertTrue(is_numeric($res)); + $this->assertTrue(is_string($b64)); + //var_dump($res); + } + + function test_openid_dh_binary_to_long() { + $str=''; + $bytes = array_merge(unpack('C*', $str)); + $res=_openid_dh_binary_to_long($str); + $this->assertTrue(is_numeric($res)); + $this->assertTrue(is_array($bytes)); + //var_dump($bytes); + } + + function test_openid_dh_long_to_base64() { + $str=''; + $res=_openid_dh_long_to_base64($str); + $this->assertTrue(is_string($res)); + //var_dump($res); + } + + function test_openid_dh_long_to_binary() { + $long=''; + $res=_openid_dh_long_to_binary($long); + $this->assertTrue(is_string($res)); + //var_dump($res); + } + + function test_openid_dh_rand() { + $stop=''; + $rbytes = _openid_dh_long_to_binary($stop); + $nbytes = strlen($rbytes); + $mxrand = bcpow(256, $nbytes); + $duplicate = bcmod($mxrand, $stop); + $duplicate_cache = array(); + $duplicate_cache[$rbytes] = array($duplicate, $nbytes); + $res=_openid_dh_rand($stop); + if(!is_array($res))$this->assertTrue(is_null($res)); + $this->assertTrue(is_array($duplicate_cache)); + //var_dump($res); + //var_dump($duplicate_cache); + } + + function test_openid_dh_xorsecret() { + $shared=''; + $secret=''; + $res=_openid_dh_xorsecret($shared, $secret); + $this->assertTrue(is_string($res)); + //var_dump($res); + } + + function test_openid_encode_message() { + $message=''; + $res=_openid_encode_message($message); + $this->assertTrue(is_string($res)); + //var_dump($res); + } + + function test_openid_fix_post() { + $post=''; + $res=_openid_fix_post($post); + $this->assertTrue(is_null($res)); + //var_dump($res); + } + + function test_openid_get_bytes() { + static $f = null; + $num_bytes=''; + $res=_openid_get_bytes($num_bytes); + $this->assertTrue(is_bool($res)); + //var_dump($res); + } + + function test_openid_hmac() { + $key=''; + $text=''; + $res=_openid_hmac($key, $text); + $this->assertTrue(is_string($res)); + //var_dump($res); + } + + function test_openid_is_xri() { + $identifier=''; + $res=_openid_is_xri($identifier); + $this->assertTrue(is_bool($res)); + //var_dump($res); + } + + function test_openid_link_href() { + $rel=''; + $html=''; + $res=_openid_link_href($rel, $html); + $this->assertTrue(is_bool($res)); + //var_dump($res); + } + + function test_openid_meta_httpequiv() { + $equiv=''; + $html=''; + $res=_openid_meta_httpequiv($equiv, $html); + $this->assertTrue(is_bool($res)); + //var_dump($res); + } + + function test_openid_nonce() { + $res=_openid_nonce(); + $this->assertTrue(is_string($res)); + //var_dump($res); + } + + function test_openid_normalize() { + $identifier=''; + $res=_openid_normalize($identifier); + $this->assertTrue(is_string($res)); + //var_dump($res); + } + + function test_openid_normalize_url() { + $url=''; + $res=_openid_normalize_url($url); + $this->assertTrue(is_string($res)); + //var_dump($res); + } + + function test_openid_normalize_xri() { + $xri=''; + $res=_openid_normalize_xri($xri); + $this->assertTrue(is_string($res)); + //var_dump($res); + } + + function test_openid_parse_message() { + $message=''; + $parsed_message = array(); + $res=_openid_parse_message($message); + $this->assertTrue(is_array($res)); + //var_dump($res); + } + + function test_openid_sha1() { + $text=''; + $res=_openid_sha1($text); + $this->assertTrue(is_string($res)); + //var_dump($res); + } + + function test_openid_signature() { + $association=''; + $message_array=''; + $keys_to_sign=''; + $res=_openid_signature($association, $message_array, $keys_to_sign); + $this->assertTrue(is_string($res)); + //var_dump($res); + } + + function testbcpowmod() { + $base=''; + $exp=''; + $mod=''; + $res=bcpowmod($base, $exp, $mod); + $this->assertTrue(is_bool($res)); + //var_dump($res); + } + function testopenid_redirect() { + $url='http://localhost/dokeossvn186/tests/all.test2.php'; + $message=''; + ob_start(); + $res=openid_redirect($url, $message); + $this->assertTrue(is_null($res)); + ob_end_clean(); + //var_dump($res); + } + function testopenid_redirect_http() { + $url='http://localhost/dokeossvn186/tests/all.test2.php'; + $message=''; + ob_start(); + $res=openid_redirect_http($url, $message); + $this->assertTrue(is_null($res)); + ob_end_clean(); + //var_dump($res); + } } ?> From 193e1eaf9d7adb3ac07e680c4fbdd036570c5820 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Fri, 31 Jul 2009 01:18:01 +0200 Subject: [PATCH 36/56] [svn r22545] Fixes user's average score see FS#4444 (requires testing) --- main/inc/lib/tracking.lib.php | 148 +++++++++++++++++++++------------- 1 file changed, 94 insertions(+), 54 deletions(-) diff --git a/main/inc/lib/tracking.lib.php b/main/inc/lib/tracking.lib.php index 16707373f3..3ac50e9433 100644 --- a/main/inc/lib/tracking.lib.php +++ b/main/inc/lib/tracking.lib.php @@ -369,15 +369,14 @@ class Tracking { * @param Array limit average to listed lp ids * @return string value (number %) Which represents a round integer explain in got in 3. */ - function get_avg_student_score($student_id, $course_code, $lp_ids=array()) { - + function get_avg_student_score($student_id, $course_code, $lp_ids=array()) { $course_table = Database :: get_main_table(TABLE_MAIN_COURSE); $course_user_table = Database :: get_main_table(TABLE_MAIN_COURSE_USER); $table_session_course_user = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER); $tbl_stats_exercices = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES); $tbl_stats_attempts= Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT); - $course = CourseManager :: get_course_information($course_code); + $course = CourseManager :: get_course_information($course_code); if (!empty($course['db_name'])) { $tbl_quiz_questions= Database :: get_course_table(TABLE_QUIZ_QUESTION,$course['db_name']); @@ -387,67 +386,108 @@ class Tracking { $lp_item_view_table = Database :: get_course_table(TABLE_LP_ITEM_VIEW,$course['db_name']); $sql_course_lp = 'SELECT id FROM '.$lp_table; - if(count($lp_ids)!=0) - { + if(count($lp_ids)!=0) { $sql_course_lp.=' WHERE id IN ('.implode(',',$lp_ids).')'; } + $sql_result_lp = api_sql_query($sql_course_lp, __FILE__, __LINE__); - $lp_scorm_score_total = 0; $lp_scorm_weighting_total = 0; $lp_scorm_result_score_total = 0; $lp_scorm_loop=0; + $lp_count = 0; + $progress = 0; + if(Database::num_rows($sql_result_lp)>0){ - //Scorm test - while($a_learnpath = Database::fetch_array($sql_result_lp)){ + //Scorm test + while($a_learnpath = Database::fetch_array($sql_result_lp)) { - //We get the last view id of this LP - $sql='SELECT max(id) as id FROM '.$lp_view_table.' WHERE lp_id='.$a_learnpath['id'].' AND user_id="'.intval($student_id).'"'; + //We get the last view id of this LP (with the higher id) + $sql='SELECT max(id) as id FROM '.$lp_view_table.' + WHERE lp_id='.$a_learnpath['id'].' AND user_id="'.intval($student_id).'"'; $rs_last_lp_view_id = api_sql_query($sql, __FILE__, __LINE__); - $lp_view_id = Database::result($rs_last_lp_view_id,0,'id'); + $lp_view_id = Database::result($rs_last_lp_view_id,0,'id'); // THE view - $sql_max_score='SELECT lp_iv.score as score,lp_i.max_score - FROM '.$lp_item_view_table.' as lp_iv - INNER JOIN '.$lp_item_table.' as lp_i - ON lp_i.id = lp_iv.lp_item_id - AND lp_i.item_type="sco" - WHERE lp_view_id="'.$lp_view_id.'"'; - - //$rs = api_sql_query($sql, __FILE__, __LINE__); - //$sql_max_score='SELECT max_score FROM '.$lp_item_view_table.' WHERE lp_view_id="'.$lp_view_id.'" '; - $res_max_score=Database::query($sql_max_score,__FILE__,__LINE__); - $count_total_loop=0; - $num_rows_max_score=Database::num_rows($res_max_score); - if ($num_rows_max_score==1) { - while ($row_max_score=Database::fetch_array($res_max_score)) { - if ($row_max_score['max_score']==0) { - //when there's no max score, we assume 100 as the max score, as the SCORM 1.2 says that the value should always be between 0 and 100. - $lp_scorm_result_score_total+=($row_max_score['score']/100); - } else { - $lp_scorm_result_score_total+=($row_max_score['score']/$row_max_score['max_score']); - } - $count_total_loop++; - } - } elseif ($num_rows_max_score>1) { - while ($row_max_score=Database::fetch_array($res_max_score)) { - if ($row_max_score['max_score']==0) { - $lp_scorm_result_score_total+=($row_max_score['score']/100); - } else { - $lp_scorm_result_score_total+=($row_max_score['score']/$row_max_score['max_score']); - } - $count_total_loop++; - } - } - if ($count_total_loop==0) { - $count_total_loop=1; - } - $score_of_scorm_calculate=round((($lp_scorm_result_score_total/$count_total_loop)*100),2); + if ($lp_view_id != '') { + // we get the progress + $sql='SELECT progress FROM '.$lp_view_table.' WHERE id="'.$lp_view_id.'"'; + $rs = api_sql_query($sql, __FILE__, __LINE__); + $progress = Database::result($rs,0,'progress'); + + // item's list of an scorm + $sql_max_score='SELECT lp_iv.score as score,lp_i.max_score + FROM '.$lp_item_view_table.' as lp_iv + INNER JOIN '.$lp_item_table.' as lp_i + ON lp_i.id = lp_iv.lp_item_id + AND lp_i.item_type="sco" + WHERE lp_view_id="'.$lp_view_id.'"'; + + //$rs = api_sql_query($sql, __FILE__, __LINE__); + //$sql_max_score='SELECT max_score FROM '.$lp_item_view_table.' WHERE lp_view_id="'.$lp_view_id.'" '; + $res_max_score=Database::query($sql_max_score,__FILE__,__LINE__); + $count_total_loop=0; + $num_rows_max_score=Database::num_rows($res_max_score); + + if ($num_rows_max_score==1) { + while ($row_max_score=Database::fetch_array($res_max_score)) { + echo $row_max_score['score'].' - '.$row_max_score['max_score']; + if ($row_max_score['max_score']==0) { + //when there's no max score, we assume 100 as the max score, as the SCORM 1.2 says that the value should always be between 0 and 100. + $lp_scorm_result_score_total+=($row_max_score['score']/100); + $current_value = $row_max_score['score']/100; + + } else { + $lp_scorm_result_score_total+=($row_max_score['score']/$row_max_score['max_score']); + $current_value = $row_max_score['score']/$row_max_score['max_score']; + } + $count_total_loop++; + } + } elseif ($num_rows_max_score > 1) { + //echo ' ----
    '; + while ($row_max_score=Database::fetch_array($res_max_score)) { + //echo $row_max_score['score'].' - '.$row_max_score['max_score']; + //echo '
    '; + if ($row_max_score['max_score']==0) { + $lp_scorm_result_score_total+=($row_max_score['score']/100); + $current_value = $row_max_score['score']/100; + } else { + //when there's no max score, we assume 100 as the max score, as the SCORM 1.2 says that the value should always be between 0 and 100. + $lp_scorm_result_score_total+=($row_max_score['score']/$row_max_score['max_score']); + $current_value = $row_max_score['score']/$row_max_score['max_score']; + } + $count_total_loop++; + } + } + + if ($num_rows_max_score > 0 && ($progress > 0 || $current_value > 0 )) { + $lp_count++; + } + + if ($count_total_loop==0) { + $count_total_loop=1; + } + $score_of_scorm_calculate=round((($lp_scorm_result_score_total/$count_total_loop)*100),2); + + } else { + $score_of_scorm_calculate = 0; + } } + //The next call to a MySQL fetch function, such as mysql_fetch_assoc(), would return that row. mysql_data_seek($sql_result_lp,0); - + + if ($lp_count==0) { + $lp_count=1; + } + + if(count($lp_ids)==0 ) { + $score_of_scorm_calculate=round((($score_of_scorm_calculate/$lp_count)),2); + } + + $lp_scorm_score_total = $score_of_scorm_calculate; + //Quizz in a LP - while($a_learnpath = Database::fetch_array($sql_result_lp)){ + while($a_learnpath = Database::fetch_array($sql_result_lp)) { //we got the maxscore this is wrong /* echo $sql = 'SELECT id as item_id, max_score @@ -528,8 +568,8 @@ class Tracking { $total_weighting += $maxscore; if($total_weighting>0 && $maxscore>0) { //echo $total_score.' - '.$maxscore; echo '
    '; - //echo $lp_scorm_score_total += ($total_score/$total_weighting)*100; - $lp_scorm_score_total += ($total_score/$maxscore)*100; + //echo $lp_scorm_score_total += ($total_score/$total_weighting)*100; + $lp_scorm_score_total += ($total_score/$maxscore)*100; $lp_scorm_weighting_total+=100; } } @@ -538,14 +578,14 @@ class Tracking { } } - $totalScore = $lp_scorm_score_total; - + $totalScore = $lp_scorm_score_total; $pourcentageScore = 0; if($lp_scorm_weighting_total>0) { //i.e 10.52 $pourcentageScore = round( (($totalScore * 100) / $lp_scorm_weighting_total),2); return $pourcentageScore; } elseif ($score_of_scorm_calculate>0) { + //echo '
    '.$score_of_scorm_calculate; return $score_of_scorm_calculate; } else { return null; @@ -1308,4 +1348,4 @@ class Tracking { return $avg_student_score; } } -?> +?> \ No newline at end of file From 1a55be2fa0fdea48f74a04cd407aa6dc4d6cfe60 Mon Sep 17 00:00:00 2001 From: Arthur Portugal Date: Fri, 31 Jul 2009 01:18:22 +0200 Subject: [PATCH 37/56] [svn r22546] Added the function chat --- tests/main/chat/chat_functions.lib.test.php | 38 +++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 tests/main/chat/chat_functions.lib.test.php diff --git a/tests/main/chat/chat_functions.lib.test.php b/tests/main/chat/chat_functions.lib.test.php new file mode 100644 index 0000000000..60cfe7c3f4 --- /dev/null +++ b/tests/main/chat/chat_functions.lib.test.php @@ -0,0 +1,38 @@ +assertTrue(is_null($res)); + //var_dump($res); + } + + function testexit_of_chat () { + $docu = new MockCourseManager(); + $user_id=1; + $res = exit_of_chat(); + $docu->expectOnce(CourseManager::get_courses_list_by_user_id($user_id),'admin'); + $this->assertTrue(is_object($docu)); + $this->assertTrue(is_null($res)); + //var_dump($res); + } + + function testuser_connected_in_chat () { + $user_id=1; + $database_name=''; + $res = user_connected_in_chat($user_id,$database_name); + $this->assertTrue(is_bool($res)); + //var_dump($res); + } + + function testusers_list_in_chat () { + $res = users_list_in_chat(); + $this->assertTrue(is_array($res)); + //var_dump($res); + } +} +?> From 53ff551693a8c62a232c539b62a2b2594e883354 Mon Sep 17 00:00:00 2001 From: Ricardo Rodriguez Date: Fri, 31 Jul 2009 01:28:20 +0200 Subject: [PATCH 38/56] [svn r22547] Minor - created new test function --- .../admin/statistics/statistics.lib.test.php | 151 ++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 tests/main/admin/statistics/statistics.lib.test.php diff --git a/tests/main/admin/statistics/statistics.lib.test.php b/tests/main/admin/statistics/statistics.lib.test.php new file mode 100644 index 0000000000..7951089b86 --- /dev/null +++ b/tests/main/admin/statistics/statistics.lib.test.php @@ -0,0 +1,151 @@ +UnitTestCase('this File test the provides some function for statistics '); + } + + public function setUp(){ + $this-> statisc = new Statistics(); + } + + public function tearDown(){ + $this->statisc = null; + } + + public function testMakeSizeString(){ + $size=20960000; + $res = Statistics::make_size_string($size); + $this->assertTrue(is_string($res)); + //var_dump($res); + } + + public function testCountCourse(){ + $instans = new MockDatabase(); + + $course_code = 'ABC'; + $course_code2 = 'ABCD'; + $category_code = NULL; + $session_id = SessionManager::create_session($course_code,2009,07,20,2010,07,20,0,0,1,'coach'); + $res = Statistics::count_courses($category_code); + $this->assertTrue(is_numeric($res)); + $this->assertTrue(count($res) !== 0); + //var_dump($res); + } + + public function testCountCourse2(){ + $instans = new MockDatabase(); + $user_id=1; + $course_code = 'ABC'; + $course_code2 = 'ABCD'; + $category_code = NULL; + $session_id = SessionManager::create_session($course_code,2009,07,20,2010,07,20,0,0,1,'coach'); + SessionManager::add_courses_to_session($session_id,array($course_code)); + SessionManager::suscribe_users_to_session($session_id,array($user_id)); + $res = Statistics::count_courses($category_code); + $this->assertTrue(count($res ==0)); + $this->assertTrue(is_numeric($res)); + CourseManager::delete_course($course_code); + //var_dump($res); + } + + public function testCountCourse3(){ + $user_id=1; + $course_code = 'ABC'; + $course_code2 = 'ABCD'; + $category_code = NULL; + $session_id = SessionManager::create_session($course_code,2009,07,20,2010,07,20,0,0,1,'coach'); + SessionManager::suscribe_users_to_session($session_id,array($user_id+3)); + $res = Statistics::count_courses($category_code); + $this->assertTrue(is_numeric($res)); + $this->assertTrue(count($res)!==0); + //var_dump($res); + } + + public function testCountCourse4(){ + $user_id=1; + $course_code = 'ABC'; + $course_code2 = 'ABCD'; + $category_code = NULL; + //ob_start(); + $session_id = SessionManager::create_session($course_code,2009,07,20,2010,07,20,0,0,1,'coach'); + SessionManager::suscribe_users_to_session($session_id,array($user_id+3)); + SessionManager::add_courses_to_session($session_id,array()); + $res = Statistics::count_courses($category_code); + $this->assertTrue(is_numeric($res)); + $this->assertTrue(count($res)!==0); + SessionManager::delete_session($session_id); + CourseManager::delete_course($course_code2); + CourseManager::delete_course($course_code); + //ob_end_clean(); + //var_dump($res); + } + + public function testCountUsers(){ + $user_id =001; + $category_code = NULL; + $course_code='ABC'; + $firstName='adam'; $lastName='ivan'; $status='01'; $email='ricardo.rodriguez@dokeos.com'; $loginName='adam'; $password='1234'; + $count_invisible_courses = true; + $session_id = SessionManager::create_session($course_code,2009,07,20,2010,07,20,0,0,1,'coach'); + SessionManager::suscribe_users_to_session($session_id,array($user_id+3)); + $res = Statistics::count_users($status, $category_code, $count_invisible_courses); + $this->assertTrue(is_numeric($res)); + $this->assertTrue(count($res)===0 || count($res)!==0); + SessionManager::delete_session($session_id); + //var_dump($res); + } + + public function testGetNumberOfActivities(){ + $activitis = new MockDatabase(); + $sql = "SELECT count(default_id) AS total_number_of_items FROM $track_e_default "; + $res = api_sql_query($sql, __FILE__, __LINE__); + $obj = Database::fetch_object($res); + $resu = Statistics::get_number_of_activities(); + $this->assertTrue(is_numeric($resu)); + $this->assertTrue(count($resu)==0 || count($resu)!==0); + //var_dump($resu); + //var_dump($res); + } + + public function testGetActivitiesData(){ + $instans = new MockDatabase(); + global $dateTimeFormatLong; + $from=''; + $number_of_items=10; + $column=''; + $direction=''; + $track_e_default = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_DEFAULT); + $table_user = Database::get_main_table(TABLE_MAIN_USER); + $sql = "SELECT + default_event_type as col0, + default_value_type as col1, + default_value as col2, + user.username as col3, + default_date as col4 + FROM $track_e_default track_default, $table_user user + WHERE track_default.default_user_id = user.user_id "; + $res = api_sql_query($sql, __FILE__, __LINE__); + $row = Database::fetch_row($res); + $resu = Statistics::get_activities_data($from, $number_of_items, $column, $direction); + $this->assertTrue(is_array($resu)); + $this->assertTrue($row); + //var_dump($resu); + //var_dump($row); + //var_dump($res); + } + + public function testGetCourseCategories(){ + + } +} +?> From 969c2679e7a4a84f8eacc71eb57466ead4410491 Mon Sep 17 00:00:00 2001 From: Arthur Portugal Date: Fri, 31 Jul 2009 23:14:53 +0200 Subject: [PATCH 39/56] [svn r22562] Added a new folder with get translation --- tests/main/conference/get_translation.lib.test.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/main/conference/get_translation.lib.test.php diff --git a/tests/main/conference/get_translation.lib.test.php b/tests/main/conference/get_translation.lib.test.php new file mode 100644 index 0000000000..9be7ad4123 --- /dev/null +++ b/tests/main/conference/get_translation.lib.test.php @@ -0,0 +1,12 @@ +assertTrue(($res)); + //var_dump($res); + } +} +?> From 5ff25148dec28a27dd97cd9d8bde39134ea4e505 Mon Sep 17 00:00:00 2001 From: Ricardo Rodriguez Date: Sat, 1 Aug 2009 01:28:20 +0200 Subject: [PATCH 40/56] [svn r22563] Minor - created new test function to statistics.lib.php --- .../admin/statistics/statistics.lib.test.php | 167 +++++++++++++++++- 1 file changed, 166 insertions(+), 1 deletion(-) diff --git a/tests/main/admin/statistics/statistics.lib.test.php b/tests/main/admin/statistics/statistics.lib.test.php index 7951089b86..2915a3863f 100644 --- a/tests/main/admin/statistics/statistics.lib.test.php +++ b/tests/main/admin/statistics/statistics.lib.test.php @@ -145,7 +145,172 @@ class TestStatistics extends UnitTestCase{ } public function testGetCourseCategories(){ - + $user_id =002; + $category_code = NULL; + $course_code='ABCDE'; + $real_course_code='00001'; + $course_title='test1'; + $wanted_course_code='test2'; + $course_language='es'; + $course_category='primary'; + $code='00001'; + $session_id = SessionManager::create_session($course_code,2009,07,20,2010,07,20,0,0,1,'coach'); + CourseManager::create_virtual_course ($real_course_code, $course_title, $wanted_course_code, $course_language, $course_category); + $res = Statistics::get_course_categories(); + $this->assertTrue($res); + CourseManager::delete_course($code); + //var_dump($res); + } + + public function testRescale(){ + $data=array('aas','aaa'.'aab'); + $max = 500; + $res = Statistics::rescale($data, $max); + $this->assertTrue($res); + $this->assertTrue(is_array($res)); + //var_dump($res); + } + + public function testPrintStats(){ + ob_start(); + $title='testing'; + $stats=array('aa','bb','cc'); + $show_total = true; + $is_file_size = false; + $res = Statistics::print_stats($title, $stats, $show_total = true, $is_file_size = false); + ob_end_clean(); + $this->assertTrue(is_null($res)); + //var_dump($res); + } + + public function testPrintLoginStats(){ + ob_start(); + $instans = new MockDatabase(); + $type='january'; + $table = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_LOGIN); + if($type === 'month'){ + $sql = "SELECT DATE_FORMAT( login_date, '%Y %b' ) AS stat_date , count( login_id ) AS number_of_logins FROM ".$table." GROUP BY stat_date ORDER BY login_date "; + }if($type === 'hour'){ + $sql = "SELECT DATE_FORMAT( login_date, '%H' ) AS stat_date , count( login_id ) AS number_of_logins FROM ".$table." GROUP BY stat_date ORDER BY stat_date "; + }else{ + $sql = "SELECT DATE_FORMAT( login_date, '%a' ) AS stat_date , count( login_id ) AS number_of_logins FROM ".$table." GROUP BY stat_date ORDER BY DATE_FORMAT( login_date, '%w' ) "; + } + $res = api_sql_query($sql,__FILE__,__LINE__); + $obj = Database::fetch_object($res); + $result[$obj->stat_date] = $obj->number_of_logins; + $login_stats[] = $result; + $resu = Statistics::print_login_stats($type); + ob_end_clean(); + $instans->expectOnce($login_stats); + $this->assertTrue(is_null($resu)); + $this->assertTrue($result); + //var_dump($resu); + //var_dump($result); + } + + public function testPrintRecenLoginStats(){ + ob_start(); + $instans = new MockDatabase(); + $total_logins = array(); + $table = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_LOGIN); + $query[get_lang('Total')] = "SELECT count(login_user_id) AS number FROM $table"; + $res = api_sql_query($query,__FILE__,__LINE__); + $obj = Database::fetch_object($res); + $total_logins[] = $obj->number; + $res = Statistics::print_recent_login_stats(); + ob_end_clean(); + $instans->expectCallCount($total_logins); + $this->assertTrue(is_null($res)); + $this->assertTrue(count($total_logins)); + //var_dump($res); + //var_dump($total_logins); + } + + public function testPrintToolStats(){ + ob_start(); + $instans = new MockDatabase(); + $table = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ACCESS); + $tools = array('announcement','assignment','calendar_event','chat','conference','course_description','document','dropbox','group','learnpath','link','quiz','student_publication','user','bb_forum'); + $sql = "SELECT access_tool, count( access_id ) AS number_of_logins FROM $table WHERE access_tool IN ('".implode("','",$tools)."') GROUP BY access_tool "; + $res = api_sql_query($sql,__FILE__,__LINE__); + $result = array(); + $obj = Database::fetch_object($res); + $result[$obj->access_tool] = $obj->number_of_logins; + $resu = Statistics::print_tool_stats(); + ob_end_clean(); + $instans->expectCallCount($result); + $this->assertTrue(is_null($resu)); + //var_dump($resu); + //var_dump($result); } + + public function testPrintCourseByLanguageStats(){ + ob_start(); + $instans = new MockDatabase(); + $table = Database::get_main_table(TABLE_MAIN_COURSE); + $sql = "SELECT course_language, count( code ) AS number_of_courses FROM $table GROUP BY course_language "; + $res = api_sql_query($sql,__FILE__,__LINE__); + $result = array(); + $obj = Database::fetch_object($res); + $result[$obj->course_language] = $obj->number_of_courses; + $instans->expectOnce($result); + $resu = Statistics::print_course_by_language_stats(); + ob_end_clean(); + $this->assertTrue(is_null($resu)); + $this->assertTrue(is_array($result)); + //var_dump($resu); + //var_dump($result); + } + + public function testPrintUserPicturesStats(){ + ob_start(); + $instans = new MockDatabase(); + $user_table = Database :: get_main_table(TABLE_MAIN_USER); + $sql = "SELECT COUNT(*) AS n FROM $user_table"; + $res = api_sql_query($sql,__FILE__,__LINE__); + $count1 = Database::fetch_object($res); + $instans_print[]= $count1; + $instans->expectOnce($instans_print); + $instans->expectCallCount($instans_print); + $resu = Statistics::print_user_pictures_stats(); + ob_end_clean(); + $this->assertTrue(is_null($resu)); + $this->assertTrue($instans_print); + //var_dump($resu); + //var_dump($instans_print); + } + + public function testPrintActivitiesStats(){ + ob_start(); + $res = Statistics::print_activities_stats(); + ob_end_clean(); + $this->assertTrue(is_null($res)); + //var_dump($res); + } + + public function testPrintCourseLastVisit(){ + ob_start(); + $instans = new MockDatabase(); + $instans1 = new MockDisplay(); + $table_header[] = array ("Coursecode", true); + $course = array (); + $courses[] = $course; + $column=''; + $direction=''; + $parameters['action'] = 'courselastvisit'; + $instans->expectCallCount('Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_LASTACCESS)'); + $instans1->expectOnce(Display :: display_sortable_table($table_header, $courses, array('column'=>$column,'direction'=>$direction), array (), $parameters)); + $res = Statistics::print_course_last_visit(); + ob_end_clean(); + $this->assertTrue(is_null($res)); + //var_dump($res); + } + + + + + + + } ?> From ff5e46e9fc4425910fc54a9abf4b2677ec2997ea Mon Sep 17 00:00:00 2001 From: Ricardo Rodriguez Date: Sat, 1 Aug 2009 01:29:10 +0200 Subject: [PATCH 41/56] [svn r22564] Minor - added new library to test the function statistics --- tests/all.test2.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/all.test2.php b/tests/all.test2.php index ac91e3f5fb..87ec7c2982 100644 --- a/tests/all.test2.php +++ b/tests/all.test2.php @@ -7,6 +7,7 @@ require_once('simpletest/web_tester.php'); require_once('simpletest/mock_objects.php'); require_once('simpletest/autorun.php'); require_once(api_get_path(SYS_CODE_PATH).'admin/calendar.lib.php'); +require_once(api_get_path(SYS_CODE_PATH).'admin/statistics/statistics.lib.php'); $_SESSION['_user']['user_id'] = 1; $_user= 1; @@ -14,8 +15,8 @@ $_user= 1; class AllTests2 extends TestSuite { function AllTests2() { $this->TestSuite('All tests2'); - $this->addTestFile(dirname(__FILE__).'/main/admin/calendar.lib.test.php'); - + //$this->addTestFile(dirname(__FILE__).'/main/admin/calendar.lib.test.php'); + $this->addTestFile(dirname(__FILE__).'/main/admin/statistics/statistics.lib.test.php'); } } $test = &new AllTests2(); From e89494206273e8288321af8b5cd0a24cbd0bd4b8 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Sun, 2 Aug 2009 23:12:59 +0200 Subject: [PATCH 42/56] [svn r22565] Minor updates - coding style --- main/document/slideshowoptions.php | 33 +++++++++++++----------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/main/document/slideshowoptions.php b/main/document/slideshowoptions.php index a8ada88fd7..e64eb674de 100644 --- a/main/document/slideshowoptions.php +++ b/main/document/slideshowoptions.php @@ -1,4 +1,4 @@ -'; } ?>>
    -

    +

    @@ -178,32 +178,28 @@ echo '
    '; ?>>
    -

    +

    :   > -
    +
    :      - > + } else { + echo " class=\"disabled_input\""; + } + ?> >
    @@ -216,5 +212,4 @@ echo '
    '; +Display::display_footer(); \ No newline at end of file From 7c577f0d3e113c14cbb087e58c61386b04a77c0d Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Sun, 2 Aug 2009 23:47:07 +0200 Subject: [PATCH 43/56] [svn r22566] Remove double constant definition generating a warning-level message --- main/inc/lib/main_api.lib.php | 1 - 1 file changed, 1 deletion(-) diff --git a/main/inc/lib/main_api.lib.php b/main/inc/lib/main_api.lib.php index dbe9700c06..467fa2240d 100644 --- a/main/inc/lib/main_api.lib.php +++ b/main/inc/lib/main_api.lib.php @@ -183,7 +183,6 @@ define('LOG_USER_DELETE', 'user_deleted'); define('LOG_USER_CREATE', 'user_created'); define('LOG_SESSION_CREATE', 'session_created'); define('LOG_SESSION_DELETE', 'session_deleted'); -define('LOG_SESSION_DELETE', 'session_deleted'); define('LOG_CONFIGURATION_SETTINGS_CHANGE', 'settings_changed'); define('LOG_SUBSCRIBE_USER_TO_COURSE', 'user_subscribed'); define('LOG_UNSUBSCRIBE_USER_FROM_COURSE', 'user_unsubscribed'); From 9f2406719cb447a4185290d7ae0d4acc42c93ba7 Mon Sep 17 00:00:00 2001 From: Isaac Flores Date: Mon, 3 Aug 2009 01:10:29 +0200 Subject: [PATCH 44/56] [svn r22567] logic changes - improvements in terms and conditions - (partial FS#4320) --- main/auth/inscription.php | 5 +++-- main/inc/lib/legal.lib.php | 36 ++++++++++++++++++++++++------------ main/inc/local.inc.php | 24 +++++++++++++++++++----- 3 files changed, 46 insertions(+), 19 deletions(-) diff --git a/main/auth/inscription.php b/main/auth/inscription.php index 921dafb2bc..d07ff55e09 100644 --- a/main/auth/inscription.php +++ b/main/auth/inscription.php @@ -1,5 +1,5 @@ addElement('hidden', 'legal_accept_type',$term_preview['version'].':'.$term_preview['language_id']); + $form->addElement('hidden', 'legal_info',$term_preview['legal_id'].':'.$term_preview['language_id']); if (isset($_SESSION['info_current_user'][1]) && isset($_SESSION['info_current_user'][2])) { $form->addElement('hidden', 'login',$_SESSION['info_current_user'][1]); - $form->addElement('hidden', 'password',$_SESSION['info_current_user'][2]); + $form->addElement('hidden', 'password',$_SESSION['info_current_user'][2]); } if($term_preview['type'] == 1) { $form->addElement('checkbox', 'legal_accept', null, get_lang('IhaveReadAndAgree').' '.get_lang('TermsAndConditions').''); diff --git a/main/inc/lib/legal.lib.php b/main/inc/lib/legal.lib.php index 103edc73ec..b0fdc9a652 100644 --- a/main/inc/lib/legal.lib.php +++ b/main/inc/lib/legal.lib.php @@ -2,12 +2,11 @@ /* ============================================================================== */ -class LegalManager -{ - private function __construct() { +class LegalManager { + private function __construct () { //void } - function add($language, $content, $type, $changes) { + public function add ($language, $content, $type, $changes) { $legal_table = Database::get_main_table(TABLE_MAIN_LEGAL); $last = self::get_last_condition($language); $language = Database::escape_string($language); @@ -43,7 +42,7 @@ class LegalManager } } - function delete($id) { + public function delete ($id) { /* $legal_table = Database::get_main_table(TABLE_MAIN_LEGAL); $id = intval($id); @@ -51,7 +50,7 @@ class LegalManager */ } - function get_last_condition_version($language){ + public function get_last_condition_version ($language) { $legal_conditions_table = Database::get_main_table(TABLE_MAIN_LEGAL); $language= Database::escape_string($language); $sql = "SELECT version FROM $legal_conditions_table WHERE language_id = '".$language."' ORDER BY legal_id DESC LIMIT 1 "; @@ -64,7 +63,7 @@ class LegalManager } } - function get_last_condition($language) { + public function get_last_condition ($language) { $legal_conditions_table = Database::get_main_table(TABLE_MAIN_LEGAL); $language= Database::escape_string($language); $sql = "SELECT * FROM $legal_conditions_table WHERE language_id = '".$language."' ORDER BY version DESC LIMIT 1 "; @@ -72,8 +71,7 @@ class LegalManager return Database::fetch_array($result); } - function show_last_condition($term_preview) - { + public function show_last_condition ($term_preview) { $preview = ''; switch ($term_preview['type']) { /*// scroll box @@ -124,7 +122,7 @@ class LegalManager } return $preview; } - function get_last_version($language){ + public function get_last_version ($language) { $legal_conditions_table = Database::get_main_table(TABLE_MAIN_LEGAL); $language= Database::escape_string($language); $sql = "SELECT version FROM $legal_conditions_table WHERE language_id = '".$language."' ORDER BY version DESC LIMIT 1 "; @@ -138,7 +136,7 @@ class LegalManager } } - function get_legal_data($from, $number_of_items, $column) { + public function get_legal_data ($from, $number_of_items, $column) { $legal_conditions_table = Database::get_main_table(TABLE_MAIN_LEGAL); $lang_table = Database::get_main_table(TABLE_MAIN_LANGUAGE); $from = intval($from); @@ -169,7 +167,7 @@ class LegalManager return $legals; } - function count() { + public function count() { $legal_conditions_table = Database::get_main_table(TABLE_MAIN_LEGAL); $sql = "SELECT count(*) as count_result FROM $legal_conditions_table ORDER BY legal_id DESC "; $result = Database::query($sql, __FILE__, __LINE__); @@ -177,4 +175,18 @@ class LegalManager $result = $url['count_result']; return $result; } + /** + * Get type of terms and conditions + * @param int The legal id + * @param int The language id + * @return int The current type of terms and conditions + */ + public function get_type_of_terms_and_conditions ($legal_id,$language_id) { + $legal_conditions_table = Database::get_main_table(TABLE_MAIN_LEGAL); + $legal_id=Database::escape_string($legal_id); + $language_id=Database::escape_string($language_id); + $sql='SELECT type FROM '.$legal_conditions_table.' WHERE legal_id="'.$legal_id.'" AND language_id="'.$language_id.'"'; + $rs=Database::query($sql,__FILE__,__LINE__); + return Database::result($rs,0,'type'); + } } \ No newline at end of file diff --git a/main/inc/local.inc.php b/main/inc/local.inc.php index e680b1cd9b..f32814667b 100644 --- a/main/inc/local.inc.php +++ b/main/inc/local.inc.php @@ -10,7 +10,8 @@ Copyright (c) Roan Embrechts (Vrije Universiteit Brussel) Copyright (c) Patrick Cool Copyright (c) Julio Montoya Armas - + Copyright (c) Isaac flores paz + For a full list of contributors, see "credits.txt". The full license can be read in "license.txt". @@ -159,6 +160,7 @@ The course id is stored in $_cid session variable. // verified if exists the username and password in session current if (isset($_SESSION['info_current_user'][1]) && isset($_SESSION['info_current_user'][2])) { require_once (api_get_path(LIBRARY_PATH).'usermanager.lib.php'); + require_once (api_get_path(LIBRARY_PATH).'legal.lib.php'); } // parameters passed via GET $logout = isset($_GET["logout"]) ? $_GET["logout"] : ''; @@ -210,11 +212,23 @@ if (get_setting('allow_terms_conditions')=='true') { $user_id=$_SESSION['update_term_and_condition'][1]; // user id // update the terms & conditions - if ((isset($_POST['legal_accept']) && $_POST['legal_accept']=='1') || !isset($_POST['legal_accept'])) { + + //verify type of terms and conditions + $info_legal = explode(':',$_POST['legal_info']); + $legal_type=LegalManager::get_type_of_terms_and_conditions($info_legal[0],$info_legal[1]); + + //is necessary verify check + if ($legal_type==1) { + if ((isset($_POST['legal_accept']) && $_POST['legal_accept']=='1')) { + $legal_option=true; + } else { + $legal_option=false; + + } + } + //no is check option + if ($legal_type==0) { $legal_option=true; - } else { - $legal_option=false; - } if (isset($_POST['legal_accept_type']) && $legal_option===true) { From ca5fbb5622abd9e8f32c9015521983fb06e3773d Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Mon, 3 Aug 2009 02:02:14 +0200 Subject: [PATCH 45/56] [svn r22568] Add option to make DRH have the same rights as tutor (see SVN#20406) --- main/install/dokeos_main_corp.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main/install/dokeos_main_corp.sql b/main/install/dokeos_main_corp.sql index 0420146038..5de97ab762 100644 --- a/main/install/dokeos_main_corp.sql +++ b/main/install/dokeos_main_corp.sql @@ -44,3 +44,6 @@ search_did INT NOT NULL INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext) VALUES ('allow_message_tool', NULL, 'radio', 'Tools', 'false', 'AllowMessageToolTitle', 'AllowMessageToolComment', NULL, NULL); INSERT INTO settings_options (variable, value, display_text) VALUES ('allow_message_tool', 'true', 'Yes'); INSERT INTO settings_options (variable, value, display_text) VALUES ('allow_message_tool', 'false', 'No'); + +-- to make a DRH have the same rights as a tutor +-- INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext) VALUES ('drhCourseManagerRights',null,'radio','Platform','true','DrhCourseManagerRightsTitle','DrhCoursManagerRightsComment',null,null,1,0); \ No newline at end of file From 9fcf30dba86530f6a1ff7afd074650778da7a263 Mon Sep 17 00:00:00 2001 From: Isaac Flores Date: Mon, 3 Aug 2009 02:51:02 +0200 Subject: [PATCH 46/56] [svn r22569] logic changes-improvements in social tool - (partial FS#4447) --- main/forum/forumfunction.inc.php | 38 ++++++++++++++++++------------- main/inc/lib/blog.lib.php | 5 ++-- main/inc/lib/course.lib.php | 11 +++++++++ main/social/data_personal.inc.php | 8 ++++--- 4 files changed, 41 insertions(+), 21 deletions(-) diff --git a/main/forum/forumfunction.inc.php b/main/forum/forumfunction.inc.php index e687a7c8bb..0dca9a920e 100644 --- a/main/forum/forumfunction.inc.php +++ b/main/forum/forumfunction.inc.php @@ -3898,23 +3898,28 @@ function get_thread_user_post($course_db, $thread_id, $user_id ) $j=0; $forums = get_forums(); krsort($forums); - $forum_results = ''; + $forum_results = ''; + foreach($forums as $forum) { if ($j<=4) { - $threads = get_threads($forum['forum_id']); + $threads = get_threads($forum['forum_id']); + if (is_array($threads)) { /*echo Display::return_icon('forum.gif'); echo $forum['forum_title'];*/ - $my_course_db=explode('_',$course_db); - $my_course_code=$my_course_db[1]; + //$my_course_db=explode('_',$course_db); + //$my_course_code=$my_course_db[1]; + $my_course_code=CourseManager::get_course_id_by_database_name($course_db); $i=0; $hand_forums = ''; $post_counter = 0; foreach($threads as $thread) { if ($i<=4) { $post_list = get_thread_user_post_limit($course_db, $thread['thread_id'], $user_id, 1); + $post_counter = count($post_list); if (is_array($post_list) && count($post_list)>0) { + $hand_forums.= '
    '; $hand_forums.= Display::return_icon('forumthread.gif'); $hand_forums.= $thread['thread_title'].' '; @@ -3930,17 +3935,18 @@ function get_thread_user_post($course_db, $thread_id, $user_id ) $hand_forums.= '
    '; } $i++; - } - if ($post_counter > 0 ) { - $forum_results .='
    '; - $forum_results .='

    '; - $forum_results .='
    '.Display::return_icon('forum.gif').'    '.$forum['forum_title'].'        
    '; - $forum_results .='
    '; - $forum_results .=$hand_forums; - $forum_results .='
    '; - } - } - } $j++; + + if ($post_counter > 0 ) { + $forum_results .='
    '; + $forum_results .='

    '; + $forum_results .='
    '.Display::return_icon('forum.gif').'    '.$forum['forum_title'].'        
    '; + $forum_results .='
    '; + $forum_results .=$hand_forums; + $forum_results .='
    '; + } + } + } $j++; + } } return $forum_results; } @@ -3957,7 +3963,7 @@ function get_thread_user_post_limit($course_db, $thread_id, $user_id, $limit=10) AND posts.poster_id='".Database::escape_string($user_id)."' ORDER BY posts.post_id DESC LIMIT $limit "; $result=api_sql_query($sql, __FILE__, __LINE__); - + while ($row=Database::fetch_array($result)) { $row['status'] = '1'; $post_list[]=$row; diff --git a/main/inc/lib/blog.lib.php b/main/inc/lib/blog.lib.php index b41ebfe572..811abf3235 100644 --- a/main/inc/lib/blog.lib.php +++ b/main/inc/lib/blog.lib.php @@ -3026,11 +3026,12 @@ function get_blog_post_from_user($course_db_name, $user_id) { ORDER BY post.date_creation DESC "; $result = api_sql_query($sql, __FILE__, __LINE__); $return_data = ''; - $my_course_info=explode('_',$course_db_name); + //$my_course_info=explode('_',$course_db_name); + $my_course_id=CourseManager::get_course_id_by_database_name($course_db_name); if (Database::num_rows($result)!=0) { while ($row=Database::fetch_array($result)) { $return_data.= '

    '; - $return_data.= '
    '.$row['title'].'        
    '; + $return_data.= '
    '.$row['title'].'        
    '; $return_data.= '
    '; //$return_data.= ''.$row['title'].''; echo '
    '; $return_data.= $row['full_text']; diff --git a/main/inc/lib/course.lib.php b/main/inc/lib/course.lib.php index a45bb7cebb..67db70e032 100644 --- a/main/inc/lib/course.lib.php +++ b/main/inc/lib/course.lib.php @@ -2129,5 +2129,16 @@ class CourseManager { } else { return false; //field not found } + } + /** + * Get the course id of an course by the database name + * @param string The database name + * @return string The course id + */ + public static function get_course_id_by_database_name ($db_name) { + $t_course = Database::get_main_table(TABLE_MAIN_COURSE); + $sql='SELECT code FROM '.$t_course.' WHERE db_name="'.Database::escape_string($db_name).'"'; + $rs=Database::query($sql,__FILE__,__LINE__); + return Database::result($rs,0,'code'); } } //end class CourseManager diff --git a/main/social/data_personal.inc.php b/main/social/data_personal.inc.php index 80b2ba9c92..ff2065dd1a 100755 --- a/main/social/data_personal.inc.php +++ b/main/social/data_personal.inc.php @@ -5,6 +5,7 @@ $language_file = array('registration','messages','userInfo','admin','forum','blo require_once '../inc/global.inc.php'; require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php'; require_once api_get_path(LIBRARY_PATH).'social.lib.php'; +require_once api_get_path(LIBRARY_PATH).'course.lib.php'; // @todo here we must show the user information as read only //User picture size is calculated from SYSTEM path @@ -21,8 +22,8 @@ if (isset($_POST['load_ajax'])) { $course_db = $_POST['course_code']; // @todo goto the course link //echo ''.get_lang('GotoCourse').''; - $my_course_info_db=explode('_',$course_db); - $course_id=$my_course_info_db[1]; + $course_id=CourseManager::get_course_id_by_database_name($course_db); + if (api_is_user_of_course($course_id,api_get_user_id())) { $table_forums = Database :: get_course_table(TABLE_FORUM,$course_db); @@ -31,7 +32,8 @@ if (isset($_POST['load_ajax'])) { $table_item_property = Database :: get_course_table(TABLE_ITEM_PROPERTY,$course_db); $table_users = Database :: get_main_table(TABLE_MAIN_USER); - //------Forum messages + //------Forum messages + $forum_result = get_all_post_from_user($user_id, $course_db); $all_result_data = 0; if ($forum_result !='') { From f07be393b850cab633d9b04f059b7dbcc46002f8 Mon Sep 17 00:00:00 2001 From: Isaac Flores Date: Mon, 3 Aug 2009 03:18:34 +0200 Subject: [PATCH 47/56] [svn r22570] style changes-improvements in shared profile of social tool - (partial FS#4447) --- main/social/profile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/social/profile.php b/main/social/profile.php index 733790fd24..c791440c94 100644 --- a/main/social/profile.php +++ b/main/social/profile.php @@ -551,7 +551,7 @@ echo '
    '; $friend_html.= ''; From e4598957391b4d71d4a5ffba19da0b2d74d6d0c5 Mon Sep 17 00:00:00 2001 From: Isaac Flores Date: Mon, 3 Aug 2009 03:31:18 +0200 Subject: [PATCH 48/56] [svn r22571] Minor-logic changes - Added function api_xml_http_response_encode in words - (partial FS#4447) --- main/social/data_personal.inc.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main/social/data_personal.inc.php b/main/social/data_personal.inc.php index ff2065dd1a..f0f81068e6 100755 --- a/main/social/data_personal.inc.php +++ b/main/social/data_personal.inc.php @@ -49,7 +49,7 @@ if (isset($_POST['load_ajax'])) { $result = get_blog_post_from_user($course_db, $user_id); if (!empty($result)) { echo '

    '; - api_display_tool_title(get_lang('BlogPosts')); + api_display_tool_title(api_xml_http_response_encode(get_lang('BlogPosts'))); echo ''; @@ -60,7 +60,7 @@ if (isset($_POST['load_ajax'])) { //------Blog comments $result = get_blog_comment_from_user($course_db, $user_id); if (!empty($result)) { - api_display_tool_title(get_lang('BlogComments')); + api_display_tool_title(api_xml_http_response_encode(get_lang('BlogComments'))); echo ''; @@ -73,9 +73,9 @@ if (isset($_POST['load_ajax'])) { } else { echo '

    '; - api_display_tool_title(get_lang('Details')); + api_display_tool_title(api_xml_http_response_encode(get_lang('Details'))); echo ''; echo '

    '; From 383e293e59822bee990e0fb9a71e9afe08ddd6ce Mon Sep 17 00:00:00 2001 From: Isaac Flores Date: Mon, 3 Aug 2009 03:53:28 +0200 Subject: [PATCH 49/56] [svn r22572] Minor-style changes-added function api_convert_encoding in words - (partial FS#4447) --- main/social/profile.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main/social/profile.php b/main/social/profile.php index c791440c94..31e54ba3f9 100644 --- a/main/social/profile.php +++ b/main/social/profile.php @@ -568,7 +568,7 @@ echo '
    '; echo '
    '; if ($count_pending_invitations > 0) { echo '
    '; - echo get_lang('PendingInvitations'); + echo api_convert_encoding(get_lang('PendingInvitations'),$charset,'UTF-8'); echo '
    '; for ($i=0;$i<$count_pending_invitations;$i++) { //var_dump($invitations); @@ -577,7 +577,7 @@ echo '
    '; echo ''; echo '
    '; echo '
    '; - echo ' '.substr($pending_invitations[$i]['content'],0,50); + echo ' '.api_convert_encoding(substr($pending_invitations[$i]['content'],0,50),$charset,'UTF-8'); echo '
    '; echo ''.get_lang('SocialAddToFriends').''; echo '
     
    '; From 0667c5430b3caa66fd714199d77f67347627905d Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Mon, 3 Aug 2009 05:38:13 +0200 Subject: [PATCH 50/56] [svn r22573] Fixed security flaw Updated license to use global file --- main/survey/survey.php | 92 +++++++++++++++++------------------------- 1 file changed, 37 insertions(+), 55 deletions(-) diff --git a/main/survey/survey.php b/main/survey/survey.php index c3a8db1f4d..6047b9a66c 100644 --- a/main/survey/survey.php +++ b/main/survey/survey.php @@ -1,29 +1,10 @@ -, Ghent University: cleanup, refactoring and rewriting large parts of the code -* @version $Id: survey.php 21734 2009-07-02 17:12:41Z cvargas1 $ +* @version $Id: survey.php 22573 2009-08-03 03:38:13Z yannoo $ * * @todo use quickforms for the forms */ @@ -58,6 +39,7 @@ $table_survey_question_group = Database :: get_course_table(TABLE_SURVEY_QUES $table_course = Database :: get_main_table(TABLE_MAIN_COURSE); $table_user = Database :: get_main_table(TABLE_MAIN_USER); $user_info = Database :: get_main_table(TABLE_MAIN_SURVEY_REMINDER); +$survey_id = intval($_GET['survey_id']); // breadcrumbs $interbreadcrumb[] = array ("url" => "survey_list.php", "name" => get_lang('SurveyList')); @@ -66,7 +48,7 @@ $interbreadcrumb[] = array ("url" => "survey_list.php", "name" => get_lang('Surv if (isset($_GET['survey_id'])) { $course_code = api_get_course_id(); if ($course_code!=-1) { - $survey_data = survey_manager::get_survey($_GET['survey_id']); + $survey_data = survey_manager::get_survey($survey_id); } else { Display :: display_header(get_lang('Survey')); Display :: display_error_message(get_lang('NotAllowed'), false); @@ -99,7 +81,7 @@ if($is_survey_type_1 && ($_GET['action']=='addgroup')||($_GET['action']=='delete } elseif(!empty($_POST['name'])) { - api_sql_query('INSERT INTO '.$table_survey_question_group.' (name,description,survey_id) values (\''.Database::escape_string($_POST['name']).'\',\''.Database::escape_string($_POST['description']).'\',\''.Database::escape_string($_GET['survey_id']).'\') '); + api_sql_query('INSERT INTO '.$table_survey_question_group.' (name,description,survey_id) values (\''.Database::escape_string($_POST['name']).'\',\''.Database::escape_string($_POST['description']).'\',\''.Database::escape_string($survey_id).'\') '); $sendmsg = 'GroupCreatedSuccessfully'; } else { $sendmsg = 'GroupNeedName'; @@ -107,11 +89,11 @@ if($is_survey_type_1 && ($_GET['action']=='addgroup')||($_GET['action']=='delete } if($_GET['action']=='deletegroup'){ - api_sql_query('DELETE FROM '.$table_survey_question_group.' WHERE id = '.Database::escape_string($_GET['gid']).' and survey_id = '.Database::escape_string($_GET['survey_id'])); + api_sql_query('DELETE FROM '.$table_survey_question_group.' WHERE id = '.Database::escape_string($_GET['gid']).' and survey_id = '.Database::escape_string($survey_id)); $sendmsg = 'GroupDeletedSuccessfully'; } - header('Location:survey.php?survey_id='.(int)$_GET['survey_id'].'&sendmsg='.$sendmsg); + header('Location:survey.php?survey_id='.$survey_id.'&sendmsg='.$sendmsg); exit; } @@ -151,30 +133,30 @@ if(!empty($survey_data['survey_version'])) echo ''.get_lang('Version').': '.$ SurveyUtil::check_first_last_question($_GET['survey_id']); // Action links -$survey_actions = ''.Display::return_icon('edit.gif', get_lang('Edit')).' '.get_lang('EditSurvey').''; -$survey_actions .= ''.Display::return_icon('delete.gif', get_lang('Delete')).' '.get_lang('DeleteSurvey').''; -//$survey_actions .= ''.Display::return_icon('copy.gif', get_lang('Copy')).''; -$survey_actions .= ''.Display::return_icon('preview.gif', get_lang('Preview')).' '.get_lang('Preview').''; -$survey_actions .= ''.Display::return_icon('survey_publish.gif', get_lang('Publish')).' '.get_lang('Publish').''; -$survey_actions .= ''.Display::return_icon('statistics.gif', get_lang('Reporting')).' '.get_lang('Reporting').''; +$survey_actions = ''.Display::return_icon('edit.gif', get_lang('Edit')).' '.get_lang('EditSurvey').''; +$survey_actions .= ''.Display::return_icon('delete.gif', get_lang('Delete')).' '.get_lang('DeleteSurvey').''; +//$survey_actions .= ''.Display::return_icon('copy.gif', get_lang('Copy')).''; +$survey_actions .= ''.Display::return_icon('preview.gif', get_lang('Preview')).' '.get_lang('Preview').''; +$survey_actions .= ''.Display::return_icon('survey_publish.gif', get_lang('Publish')).' '.get_lang('Publish').''; +$survey_actions .= ''.Display::return_icon('statistics.gif', get_lang('Reporting')).' '.get_lang('Reporting').''; echo '
    '.$survey_actions.'
    '; if ($survey_data['survey_type']==0) { echo ''; } else { echo ''; - echo ''.get_lang('PersonalityQuestion').'
    '; + //echo '
    '.get_lang('Add groups').'
    '; + echo ''.get_lang('PersonalityQuestion').'
    '; echo '
    '; } @@ -193,7 +175,7 @@ if($is_survey_type_1) { echo ' '; // Displaying the table contents with all the questions $question_counter = 1; -$sql = "SELECT * FROM $table_survey_question_group WHERE survey_id = '".Database::escape_string($_GET['survey_id'])."' ORDER BY id"; +$sql = "SELECT * FROM $table_survey_question_group WHERE survey_id = '".Database::escape_string($survey_id)."' ORDER BY id"; $result = api_sql_query($sql, __FILE__, __LINE__); $groups = array(); while($row = Database::fetch_array($result)) { @@ -203,7 +185,7 @@ $sql = "SELECT survey_question.*, count(survey_question_option.question_option_i FROM $table_survey_question survey_question LEFT JOIN $table_survey_question_option survey_question_option ON survey_question.question_id = survey_question_option.question_id - WHERE survey_question.survey_id = '".Database::escape_string($_GET['survey_id'])."' + WHERE survey_question.survey_id = '".Database::escape_string($survey_id)."' GROUP BY survey_question.question_id ORDER BY survey_question.sort ASC"; $result = api_sql_query($sql, __FILE__, __LINE__); @@ -231,17 +213,17 @@ while ($row = Database::fetch_array($result,'ASSOC')) { echo ' '.$tool_name.''; echo ' '.$row['number_of_options'].''; echo ' '; - echo ' '.Display::return_icon('edit.gif', get_lang('Edit')).''; - echo ' '.Display::return_icon('delete.gif', get_lang('Delete')).''; + echo ' '.Display::return_icon('edit.gif', get_lang('Edit')).''; + echo ' '.Display::return_icon('delete.gif', get_lang('Delete')).''; if ($question_counter > 1) { - echo ' '.Display::return_icon('up.gif', get_lang('MoveUp')).''; + echo ' '.Display::return_icon('up.gif', get_lang('MoveUp')).''; } else { Display::display_icon('up_na.gif'); } if ($question_counter < $question_counter_max) { - echo ' '.Display::return_icon('down.gif', get_lang('MoveDown')).''; + echo ' '.Display::return_icon('down.gif', get_lang('MoveDown')).''; } else { Display::display_icon('down_na.gif'); } @@ -271,16 +253,16 @@ if($is_survey_type_1) echo '
    '.get_lang('Name').''.get_lang('Description').'
    '; - echo '
    '; + echo ''; if($_GET['action']=='editgroup') { - $sql = 'SELECT name,description FROM '.$table_survey_question_group.' WHERE id = '.Database::escape_string($_GET['gid']).' AND survey_id = '.Database::escape_string($_GET['survey_id']).' limit 1'; + $sql = 'SELECT name,description FROM '.$table_survey_question_group.' WHERE id = '.Database::escape_string($_GET['gid']).' AND survey_id = '.Database::escape_string($survey_id).' limit 1'; $rs = api_sql_query($sql,__FILE__,__LINE__); $editedrow = Database::fetch_array($rs,'ASSOC'); echo ''; echo ''; echo ''; - echo ''; + echo ''; } else { echo ''; echo ''; @@ -295,14 +277,14 @@ if($is_survey_type_1) echo ' '.get_lang('Modify').''; echo ' '; - $sql = 'SELECT id,name,description FROM '.$table_survey_question_group.' WHERE survey_id = '.Database::escape_string($_GET['survey_id']).' ORDER BY name'; + $sql = 'SELECT id,name,description FROM '.$table_survey_question_group.' WHERE survey_id = '.Database::escape_string($survey_id).' ORDER BY name'; $rs = api_sql_query($sql,__FILE__,__LINE__); while($row = Database::fetch_array($rs,ASSOC)){ $grouplist .= ''.$row['name'].''.$row['description'].''. - ''. + ''. Display::return_icon('edit.gif', get_lang('Edit')).' '. - ''. + ''. Display::return_icon('delete.gif', get_lang('Delete')).''. ''; } From ee31d20595b00ecfb92c8ad510eb9c936f8b26e4 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Mon, 3 Aug 2009 05:51:14 +0200 Subject: [PATCH 51/56] [svn r22574] Fixed SQL injection and XSS flaws --- main/dropbox/dropbox_functions.inc.php | 46 ++++++++++++++------------ 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/main/dropbox/dropbox_functions.inc.php b/main/dropbox/dropbox_functions.inc.php index ab3bc65c6b..4d2d9d5c9c 100644 --- a/main/dropbox/dropbox_functions.inc.php +++ b/main/dropbox/dropbox_functions.inc.php @@ -137,13 +137,13 @@ function delete_category($action, $id) // step 1: delete the category $sql="DELETE FROM ".$dropbox_cnf['tbl_category']." WHERE cat_id='".Database::escape_string($id)."' AND $sentreceived='1'"; - $result=api_sql_query($sql); + $result=Database::query($sql); // step 2: delete all the documents in this category $sql="SELECT * FROM ".$entries_table." WHERE cat_id='".Database::escape_string($id)."'"; - $result=api_sql_query($sql); + $result=Database::query($sql); - while ($row=mysql_fetch_array($result)) + while ($row=Database::fetch_array($result)) { $dropboxfile=new Dropbox_Person( $_user['user_id'], $is_courseAdmin, $is_courseTutor); if ($action=='deletereceivedcategory') @@ -170,8 +170,8 @@ function display_move_form($part, $id, $target=array()) { echo '
    '.get_lang('MoveFileTo').'
    '; echo ''; - echo ''; - echo ''; + echo ''; + echo ''; echo '
    @@ -278,7 +278,7 @@ function display_action_options($part, $categories, $current_category=0) echo ''; } echo ''; - echo ''; + echo ''; } /** @@ -299,7 +299,7 @@ function display_file_checkbox($id, $part) { $checked='checked'; } - $return_value=''; + $return_value=''; return $return_value; } @@ -485,7 +485,7 @@ function display_addcategory_form($category_name='', $id='',$action) { echo ''.get_lang('CategoryAlreadyExistsEditIt').'
    '; } - echo ' + echo '
    '; @@ -503,7 +503,7 @@ function display_addcategory_form($category_name='', $id='',$action) * '.get_lang('ThisFieldIsRequired').' '; - echo ""; + echo ''; echo '
    '; } @@ -520,7 +520,7 @@ function display_add_form() $token = Security::get_token(); $dropbox_person = new Dropbox_Person( $_user['user_id'], $is_courseAdmin, $is_courseTutor); ?> -
    " enctype="multipart/form-data" onsubmit="return checkForm(this)"> + " enctype="multipart/form-data" onsubmit="return checkForm(this)">
    @@ -536,7 +536,7 @@ function display_add_form() "; + echo ''; } ?> @@ -686,10 +686,10 @@ function getUserNameFromId ( $id) // RH: Mailing: return 'Mailing ' + id { return dropbox_lang("mailingAsUsername", "noDLTT") . $mailingId; } - + $id = intval($id); $sql = "SELECT CONCAT(lastname,' ', firstname) AS name FROM " . dropbox_cnf("tbl_user") . " - WHERE user_id='" . addslashes( $id) . "'"; + WHERE user_id='$id'"; $result = api_sql_query($sql,__FILE__,__LINE__); $res = mysql_fetch_array( $result); @@ -703,9 +703,10 @@ function getUserNameFromId ( $id) // RH: Mailing: return 'Mailing ' + id */ function getLoginFromId ( $id) { + $id = intval($id); $sql = "SELECT username FROM " . dropbox_cnf("tbl_user") . " - WHERE user_id='" . addslashes( $id) . "'"; + WHERE user_id='$id'"; $result =api_sql_query($sql,__FILE__,__LINE__); $res = mysql_fetch_array( $result); if ( $res == FALSE) return FALSE; @@ -759,12 +760,13 @@ function removeUnusedFiles( ) * Mailing content files have uploader_id == mailing pseudo_id, a normal recipient, * and are visible initially to recipient and pseudo_id. * -* @author Ren� Haentjens, Ghent University +* @author René Haentjens, Ghent University * * @todo check if this function is still necessary. */ function getUserOwningThisMailing($mailingPseudoId, $owner = 0, $or_die = '') { + $mailingPseudoId = intval($mailingPseudoId); $sql = "SELECT f.uploader_id FROM " . dropbox_cnf("tbl_file") . " f LEFT JOIN " . dropbox_cnf("tbl_post") . " p ON f.id = p.file_id @@ -791,7 +793,7 @@ function removeMoreIfMailing($file_id) // for all content files, delete mailingPseudoId from person-table // 2. finding the owner (getUserOwningThisMailing) is no longer possible, so // for all content files, replace mailingPseudoId by owner as uploader - + $file_id = intval($file_id); $sql = "SELECT p.dest_user_id FROM " . dropbox_cnf("tbl_post") . " p WHERE p.file_id = '" . $file_id . "'"; @@ -817,7 +819,7 @@ function removeMoreIfMailing($file_id) * * @todo check if this function is still necessary. * -* @author Ren� Haentjens, Ghent University +* @author René Haentjens, Ghent University */ function dropbox_lang($variable, $notrans = 'DLTT') { @@ -1061,7 +1063,8 @@ function display_user_link($user_id, $name='') } else { - return "".$name.""; + $user_id = intval($user_id); + return "".Security::remove_XSS($name).""; } } else @@ -1101,8 +1104,8 @@ function feedback($array) function format_feedback($feedback) { $output.=display_user_link($feedback['author_user_id']); - $output.='  ['.$feedback['feedback_date'].']
    '; - $output.='
    '.nl2br($feedback['feedback']).'


    '; + $output.='  ['.$feedback['feedback_date'].']
    '; + $output.='
    '.nl2br($feedback['feedback']).'


    '; return $output; } @@ -1529,5 +1532,4 @@ function get_last_tool_access($tool, $course_code='', $user_id='') $result=api_sql_query($sql,__FILE__,__LINE__); $row=mysql_fetch_array($result); return $row['access_date']; -} -?> +} \ No newline at end of file From 73a882ed92e77c74dd60406b770b57666ef2c11f Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Mon, 3 Aug 2009 05:57:59 +0200 Subject: [PATCH 52/56] [svn r22575] Minor - using database class --- main/dropbox/dropbox_functions.inc.php | 72 +++++++++++++------------- 1 file changed, 35 insertions(+), 37 deletions(-) diff --git a/main/dropbox/dropbox_functions.inc.php b/main/dropbox/dropbox_functions.inc.php index 4d2d9d5c9c..fcd4d47a52 100644 --- a/main/dropbox/dropbox_functions.inc.php +++ b/main/dropbox/dropbox_functions.inc.php @@ -1,12 +1,10 @@ , Ghent University */ - /** * This function is a wrapper function for the multiple actions feature. * @return Mixed If there is a problem, return a string message, otherwise nothing @@ -137,11 +135,11 @@ function delete_category($action, $id) // step 1: delete the category $sql="DELETE FROM ".$dropbox_cnf['tbl_category']." WHERE cat_id='".Database::escape_string($id)."' AND $sentreceived='1'"; - $result=Database::query($sql); + $result=Database::query($sql,__FILE__,__LINE__); // step 2: delete all the documents in this category $sql="SELECT * FROM ".$entries_table." WHERE cat_id='".Database::escape_string($id)."'"; - $result=Database::query($sql); + $result=Database::query($sql,__FILE__,__LINE__); while ($row=Database::fetch_array($result)) { @@ -227,7 +225,7 @@ function store_move($id, $target, $part) WHERE dest_user_id='".Database::escape_string($_user['user_id'])."' AND file_id='".Database::escape_string($id)."' "; - api_sql_query($sql,__FILE__,__LINE__); + Database::query($sql,__FILE__,__LINE__); $return_message=get_lang('ReceivedFileMoved'); } if ($part=='sent') @@ -236,7 +234,7 @@ function store_move($id, $target, $part) WHERE uploader_id='".Database::escape_string($_user['user_id'])."' AND id='".Database::escape_string($id)."' "; - api_sql_query($sql,__FILE__,__LINE__); + Database::query($sql,__FILE__,__LINE__); $return_message=get_lang('SentFileMoved'); } } @@ -325,8 +323,8 @@ function get_dropbox_categories($filter='') $sql="SELECT * FROM ".$dropbox_cnf['tbl_category']." WHERE user_id='".$_user['user_id']."'"; - $result=api_sql_query($sql); - while ($row=mysql_fetch_array($result)) + $result=Database::query($sql,__FILE__,__LINE__); + while ($row=Database::fetch_array($result)) { if(($filter=='sent' AND $row['sent']==1) OR ($filter=='received' AND $row['received']==1) OR $filter=='') { @@ -382,7 +380,7 @@ function store_addcategory() { // step 3a, we check if the category doesn't already exist $sql="SELECT * FROM ".$dropbox_cnf['tbl_category']." WHERE user_id='".$_user['user_id']."' AND cat_name='".Database::escape_string(Security::remove_XSS($_POST['category_name']))."' AND received='".$received."' AND sent='".$sent."'"; - $result=api_sql_query($sql); + $result=Database::query($sql,__FILE__,__LINE__); // step 3b, we add the category if it does not exist yet. @@ -390,7 +388,7 @@ function store_addcategory() { $sql="INSERT INTO ".$dropbox_cnf['tbl_category']." (cat_name, received, sent, user_id) VALUES ('".Database::escape_string(Security::remove_XSS($_POST['category_name']))."', '".Database::escape_string($received)."', '".Database::escape_string($sent)."', '".Database::escape_string($_user['user_id'])."')"; - api_sql_query($sql); + Database::query($sql,__FILE__,__LINE__); return array('type' => 'confirmation', 'message'=>get_lang('CategoryStored')); } else @@ -403,7 +401,7 @@ function store_addcategory() $sql="UPDATE ".$dropbox_cnf['tbl_category']." SET cat_name='".Database::escape_string(Security::remove_XSS($_POST['category_name']))."', received='".Database::escape_string($received)."' , sent='".Database::escape_string($sent)."' WHERE user_id='".Database::escape_string($_user['user_id'])."' AND cat_id='".Database::escape_string(Security::remove_XSS($_POST['edit_id']))."'"; - api_sql_query($sql); + Database::query($sql,__FILE__,__LINE__); return array('type' => 'confirmation', 'message'=>get_lang('CategoryModified')); } } @@ -427,7 +425,7 @@ function display_addcategory_form($category_name='', $id='',$action) { // retrieve the category we are editing $sql="SELECT * FROM ".$dropbox_cnf['tbl_category']." WHERE cat_id='".Database::escape_string($id)."'"; - $result=api_sql_query($sql); + $result=Database::query($sql,__FILE__,__LINE__); $row=Database::fetch_array($result); if ($category_name=='') // after an edit with an error we do not want to return to the original name but the name we already modified. (happens when createinrecievedfiles AND createinsentfiles are not checked) @@ -690,8 +688,8 @@ function getUserNameFromId ( $id) // RH: Mailing: return 'Mailing ' + id $sql = "SELECT CONCAT(lastname,' ', firstname) AS name FROM " . dropbox_cnf("tbl_user") . " WHERE user_id='$id'"; - $result = api_sql_query($sql,__FILE__,__LINE__); - $res = mysql_fetch_array( $result); + $result = Database::query($sql,__FILE__,__LINE__); + $res = Database::fetch_array( $result); if ( $res == FALSE) return FALSE; return stripslashes( $res["name"]); @@ -707,8 +705,8 @@ function getLoginFromId ( $id) $sql = "SELECT username FROM " . dropbox_cnf("tbl_user") . " WHERE user_id='$id'"; - $result =api_sql_query($sql,__FILE__,__LINE__); - $res = mysql_fetch_array( $result); + $result =Database::query($sql,__FILE__,__LINE__); + $res = Database::fetch_array( $result); if ( $res == FALSE) return FALSE; return stripslashes( $res["username"]); } @@ -737,14 +735,14 @@ function removeUnusedFiles( ) FROM " . dropbox_cnf("tbl_file") . " f LEFT JOIN " . dropbox_cnf("tbl_person") . " p ON f.id = p.file_id WHERE p.user_id IS NULL"; - $result = api_sql_query($sql,__FILE__,__LINE__); - while ( $res = mysql_fetch_array( $result)) + $result = Database::query($sql,__FILE__,__LINE__); + while ( $res = Database::fetch_array( $result)) { //delete the selected files from the post and file tables $sql = "DELETE FROM " . dropbox_cnf("tbl_post") . " WHERE file_id='" . $res['id'] . "'"; - $result1 = api_sql_query($sql,__FILE__,__LINE__); + $result1 = Database::query($sql,__FILE__,__LINE__); $sql = "DELETE FROM " . dropbox_cnf("tbl_file") . " WHERE id='" . $res['id'] . "'"; - $result1 = api_sql_query($sql,__FILE__,__LINE__); + $result1 = Database::query($sql,__FILE__,__LINE__); //delete file from server @unlink( dropbox_cnf("sysPath") . "/" . $res["filename"]); @@ -771,9 +769,9 @@ function getUserOwningThisMailing($mailingPseudoId, $owner = 0, $or_die = '') FROM " . dropbox_cnf("tbl_file") . " f LEFT JOIN " . dropbox_cnf("tbl_post") . " p ON f.id = p.file_id WHERE p.dest_user_id = '" . $mailingPseudoId . "'"; - $result = api_sql_query($sql,__FILE__,__LINE__); + $result = Database::query($sql,__FILE__,__LINE__); - if (!($res = mysql_fetch_array($result))) + if (!($res = Database::fetch_array($result))) die(dropbox_lang("generalError")." (code 901)"); if ($owner == 0) return $res['uploader_id']; @@ -797,19 +795,19 @@ function removeMoreIfMailing($file_id) $sql = "SELECT p.dest_user_id FROM " . dropbox_cnf("tbl_post") . " p WHERE p.file_id = '" . $file_id . "'"; - $result = api_sql_query($sql,__FILE__,__LINE__); + $result = Database::query($sql,__FILE__,__LINE__); - if ( $res = mysql_fetch_array( $result)) + if ( $res = Database::fetch_array( $result)) { $mailingPseudoId = $res['dest_user_id']; if ( $mailingPseudoId > dropbox_cnf("mailingIdBase")) { $sql = "DELETE FROM " . dropbox_cnf("tbl_person") . " WHERE user_id='" . $mailingPseudoId . "'"; - $result1 = api_sql_query($sql,__FILE__,__LINE__); + $result1 = Database::query($sql,__FILE__,__LINE__); $sql = "UPDATE " . dropbox_cnf("tbl_file") . " SET uploader_id='" . api_get_user_id() . "' WHERE uploader_id='" . $mailingPseudoId . "'"; - $result1 = api_sql_query($sql,__FILE__,__LINE__); + $result1 = Database::query($sql,__FILE__,__LINE__); } } } @@ -1057,8 +1055,8 @@ function display_user_link($user_id, $name='') { $table_user = Database::get_main_table(TABLE_MAIN_USER); $sql="SELECT * FROM $table_user WHERE user_id='".Database::escape_string($user_id)."'"; - $result=api_sql_query($sql,__FILE__,__LINE__); - $row=mysql_fetch_array($result); + $result=Database::query($sql,__FILE__,__LINE__); + $row=Database::fetch_array($result); return "".$row['firstname']." ".$row['lastname'].""; } else @@ -1125,8 +1123,8 @@ function feedback_form() // we now check if the other users have not delete this document yet. If this is the case then it is useless to see the // add feedback since the other users will never get to see the feedback. $sql="SELECT * FROM ".$dropbox_cnf["tbl_person"]." WHERE file_id='".Database::escape_string($_GET['id'])."'"; - $result=api_sql_query($sql,__LINE__, __FILE__); - $number_users_who_see_file=mysql_num_rows($result); + $result=Database::query($sql,__LINE__, __FILE__); + $number_users_who_see_file=Database::num_rows($result); if ($number_users_who_see_file>1) { $return .= '