skala
Juan Carlos Raña 16 years ago
commit 1a66d65e48
  1. 8
      main/inc/lib/fckeditor/editor/plugins/asciimath/fckplugin.js
  2. 2
      main/inc/lib/fckeditor/editor/plugins/asciimath/fckplugin_compressed.js
  3. 2
      main/install/dokeos_main.sql

@ -314,17 +314,13 @@ FCK.UpdateLinkedField = function()
if ( head_data ) if ( head_data )
{ {
head_data = head_data.toString().match( /<head\s?[^>]*>(.*?)<\/head\s*>/i ) ; head_data = head_data.toString().match( /<head\s?[^>]*>(.*?)<\/head\s*>/i ) ;
if ( head_data[1] ) if ( head_data && head_data.toString().indexOf( 'ASCIIMathML.js' ) != -1 )
{
head_data = head_data[1] ;
if ( head_data.indexOf( 'ASCIIMathML.js' ) != -1 )
{ {
has_script = true ; has_script = true ;
} }
} }
}
if ( !has_script ) if ( has_formula && !has_script )
{ {
// TODO: This fragment works in WYSIWYG mode only. // TODO: This fragment works in WYSIWYG mode only.
script = FCK.EditorDocument.createElement( 'script' ) ; script = FCK.EditorDocument.createElement( 'script' ) ;

@ -1 +1 @@
if (typeof AMprocessNode!='function'){LoadScript(FCKConfig.ScriptASCIIMathML);};notifyIfNoMathML=false;translateASCIIMath=false;mathfontsize="1.1em";FCKCommands.RegisterCommand('asciimath',new FCKDialogCommand(FCKLang['DlgAsciiMath'],FCKLang['DlgAsciiMath'],FCKConfig.PluginsPath+'asciimath/fck_asciimath.html',800,550));var oAsciiMathItem=new FCKToolbarButton('asciimath',FCKLang['DlgAsciiMath']);oAsciiMathItem.IconPath=FCKConfig.PluginsPath+'asciimath/asciimath.gif';FCKToolbarItems.RegisterItem('asciimath',oAsciiMathItem);FCK.ContextMenu.RegisterListener({AddItems:function(A,B,C){if (FCKAsciiMath.FindFormulaContainer(B)){A.AddSeparator();A.AddItem('asciimath',FCKLang['DlgAsciiMath'],oAsciiMathItem.IconPath);}}});FCK.RegisterDoubleClickHandler(function (A){if (FCKAsciiMath.FindFormulaContainer(A)){FCKCommands.GetCommand('asciimath').Execute();}},null);var FCKAsciiMath={};FCKAsciiMath.GetSearchElementFromSelection=function(){var A=FCK.Selection.GetSelectedElement();if (!A){A=FCK.Selection.GetBoundaryParentElement(true);};return A;};FCKAsciiMath.IsFormula=function(A){if (A&&A.nodeName&&A.nodeName.IEquals('span')&&A.className&&A.className.indexOf('AM')!=-1){return true;};return false;};FCKAsciiMath.FindFormulaContainer=function(A){var B=A;while (B){if (!B.nodeName){continue;};if (B.nodeName.IEquals('body','table')){break;};if (FCKAsciiMath.IsFormula(B)){return B;};if (B.parentNode){B=B.parentNode;}else{break;}};return null;};FCKAsciiMath.IsParsed=function(A){return A.getElementsByTagName('math')[0]?true:false;};FCKAsciiMath.GetFormula=function(A){var B='';if (FCKAsciiMath.IsFormula(A)){if (FCKAsciiMath.IsParsed(A)){if (A.title){B=A.title;}}else{B=A.innerHTML;}};return B.replace(/`/g,'');};FCKAsciiMath.Delete=function(){var A=FCKAsciiMath.FindFormulaContainer(FCKAsciiMath.GetSearchElementFromSelection());if (A){FCK.Selection.SelectNode(A);}else{return;};if (FCKBrowserInfo.IsIE){var B=FCK.EditorDocument.createElement('span');B.innerHTML='&nbsp;';B=A.parentNode.insertBefore(B,A);FCK.Selection.SelectNode(B);};FCK.Selection.Delete();if (FCKBrowserInfo.IsIE){FCKUndo.SaveUndoStep();A.parentNode.removeChild(A);}};var FCKAsciiMathProcessor=FCKDocumentProcessor.AppendNew();FCKAsciiMathProcessor.ProcessDocument=function(A){var B=FCK.EditorDocument.getElementsByTagName('SPAN');var C;var i=B.length-1;while (i>=0&&(C=B[i--])){if (FCKAsciiMath.IsFormula(C)&&!FCKAsciiMath.IsParsed (C)){var D=C.cloneNode(true);D.title=C.innerHTML;AMprocessNode(D,false);D.setAttribute('_fckfakelement','true',0);D.setAttribute('_fckrealelement',FCKTempBin.AddElement(C),0);D.onresizestart=function(){FCK.EditorWindow.event.returnValue=false;return false;};C.parentNode.insertBefore(D,C);C.parentNode.removeChild(C);}}};FCKAsciiMath.SetListeners=function(){if (FCK.EditMode!=FCK_EDITMODE_WYSIWYG){return;};if (!FCKBrowserInfo.IsIE){FCK.EditorDocument.addEventListener('click',function(e){var A=FCKAsciiMath.FindFormulaContainer(e.target);if (A){FCKSelection.SelectNode(A);}},true);FCK.EditorDocument.addEventListener('keypress',function(e){var B=e.keyCode||e.which;switch (B){case 37:case 39:case 38:case 40:case 36:case 35:case 33:case 34:break;case 8:case 46:if (FCKAsciiMath.FindFormulaContainer(FCKAsciiMath.GetSearchElementFromSelection())){FCKAsciiMath.Delete();if (e.preventDefault) e.preventDefault();if (e.stopPropagation) e.stopPropagation();break;};default:if (FCKAsciiMath.FindFormulaContainer(FCKAsciiMath.GetSearchElementFromSelection())){if (e.preventDefault) e.preventDefault();if (e.stopPropagation) e.stopPropagation();};break;}},true);}else{FCKAsciiMath.KeyDownIE=function(e){if (!e) e=window.event;var B=e.keyCode;switch (B){case 8:case 46:if (FCKAsciiMath.FindFormulaContainer(FCKAsciiMath.GetSearchElementFromSelection())){FCKAsciiMath.Delete();e.cancelBubble=true;break;};default:break;}};FCKTools.AddEventListener(FCK.EditorDocument.body,'keydown',FCKAsciiMath.KeyDownIE);}};FCK.Events.AttachEvent('OnAfterSetHTML',FCKAsciiMath.SetListeners);FCK.UpdateLinkedField=function(){if (FCKConfig.FullPage){var A=FCK.EditorDocument.getElementsByTagName('html')[0];var B;if (typeof A=='object'){B=A.getElementsByTagName('HEAD')[0];};if (typeof B=='object'){var C=false;var D=FCK.EditorDocument.getElementsByTagName('SPAN');var E;var i=D.length-1;while (i>=0&&(E=D[i--])){if (FCKAsciiMath.IsFormula(E)){C=true;break;}};var F=false;var G=FCK.GetData(false);if (G){G=G.toString().match(/<head\s?[^>]*>(.*?)<\/head\s*>/i);if (G[1]){G=G[1];if (G.indexOf('ASCIIMathML.js')!=-1){F=true;}}};if (!F){script=FCK.EditorDocument.createElement('script');script.setAttribute('src',FCKConfig.ScriptASCIIMathML);script.setAttribute('type','text/javascript');B.appendChild(script);}}};var H=FCK.GetData(FCKConfig.FormatOutput);if (FCKConfig.HtmlEncodeOutput) H=FCKTools.HTMLEncode(H);FCK.LinkedField.value=H;FCK.Events.FireEvent('OnAfterLinkedFieldUpdate');}; if (typeof AMprocessNode!='function'){LoadScript(FCKConfig.ScriptASCIIMathML);};notifyIfNoMathML=false;translateASCIIMath=false;mathfontsize="1.1em";FCKCommands.RegisterCommand('asciimath',new FCKDialogCommand(FCKLang['DlgAsciiMath'],FCKLang['DlgAsciiMath'],FCKConfig.PluginsPath+'asciimath/fck_asciimath.html',800,550));var oAsciiMathItem=new FCKToolbarButton('asciimath',FCKLang['DlgAsciiMath']);oAsciiMathItem.IconPath=FCKConfig.PluginsPath+'asciimath/asciimath.gif';FCKToolbarItems.RegisterItem('asciimath',oAsciiMathItem);FCK.ContextMenu.RegisterListener({AddItems:function(A,B,C){if (FCKAsciiMath.FindFormulaContainer(B)){A.AddSeparator();A.AddItem('asciimath',FCKLang['DlgAsciiMath'],oAsciiMathItem.IconPath);}}});FCK.RegisterDoubleClickHandler(function (A){if (FCKAsciiMath.FindFormulaContainer(A)){FCKCommands.GetCommand('asciimath').Execute();}},null);var FCKAsciiMath={};FCKAsciiMath.GetSearchElementFromSelection=function(){var A=FCK.Selection.GetSelectedElement();if (!A){A=FCK.Selection.GetBoundaryParentElement(true);};return A;};FCKAsciiMath.IsFormula=function(A){if (A&&A.nodeName&&A.nodeName.IEquals('span')&&A.className&&A.className.indexOf('AM')!=-1){return true;};return false;};FCKAsciiMath.FindFormulaContainer=function(A){var B=A;while (B){if (!B.nodeName){continue;};if (B.nodeName.IEquals('body','table')){break;};if (FCKAsciiMath.IsFormula(B)){return B;};if (B.parentNode){B=B.parentNode;}else{break;}};return null;};FCKAsciiMath.IsParsed=function(A){return A.getElementsByTagName('math')[0]?true:false;};FCKAsciiMath.GetFormula=function(A){var B='';if (FCKAsciiMath.IsFormula(A)){if (FCKAsciiMath.IsParsed(A)){if (A.title){B=A.title;}}else{B=A.innerHTML;}};return B.replace(/`/g,'');};FCKAsciiMath.Delete=function(){var A=FCKAsciiMath.FindFormulaContainer(FCKAsciiMath.GetSearchElementFromSelection());if (A){FCK.Selection.SelectNode(A);}else{return;};if (FCKBrowserInfo.IsIE){var B=FCK.EditorDocument.createElement('span');B.innerHTML='&nbsp;';B=A.parentNode.insertBefore(B,A);FCK.Selection.SelectNode(B);};FCK.Selection.Delete();if (FCKBrowserInfo.IsIE){FCKUndo.SaveUndoStep();A.parentNode.removeChild(A);}};var FCKAsciiMathProcessor=FCKDocumentProcessor.AppendNew();FCKAsciiMathProcessor.ProcessDocument=function(A){var B=FCK.EditorDocument.getElementsByTagName('SPAN');var C;var i=B.length-1;while (i>=0&&(C=B[i--])){if (FCKAsciiMath.IsFormula(C)&&!FCKAsciiMath.IsParsed (C)){var D=C.cloneNode(true);D.title=C.innerHTML;AMprocessNode(D,false);D.setAttribute('_fckfakelement','true',0);D.setAttribute('_fckrealelement',FCKTempBin.AddElement(C),0);D.onresizestart=function(){FCK.EditorWindow.event.returnValue=false;return false;};C.parentNode.insertBefore(D,C);C.parentNode.removeChild(C);}}};FCKAsciiMath.SetListeners=function(){if (FCK.EditMode!=FCK_EDITMODE_WYSIWYG){return;};if (!FCKBrowserInfo.IsIE){FCK.EditorDocument.addEventListener('click',function(e){var A=FCKAsciiMath.FindFormulaContainer(e.target);if (A){FCKSelection.SelectNode(A);}},true);FCK.EditorDocument.addEventListener('keypress',function(e){var B=e.keyCode||e.which;switch (B){case 37:case 39:case 38:case 40:case 36:case 35:case 33:case 34:break;case 8:case 46:if (FCKAsciiMath.FindFormulaContainer(FCKAsciiMath.GetSearchElementFromSelection())){FCKAsciiMath.Delete();if (e.preventDefault) e.preventDefault();if (e.stopPropagation) e.stopPropagation();break;};default:if (FCKAsciiMath.FindFormulaContainer(FCKAsciiMath.GetSearchElementFromSelection())){if (e.preventDefault) e.preventDefault();if (e.stopPropagation) e.stopPropagation();};break;}},true);}else{FCKAsciiMath.KeyDownIE=function(e){if (!e) e=window.event;var B=e.keyCode;switch (B){case 8:case 46:if (FCKAsciiMath.FindFormulaContainer(FCKAsciiMath.GetSearchElementFromSelection())){FCKAsciiMath.Delete();e.cancelBubble=true;break;};default:break;}};FCKTools.AddEventListener(FCK.EditorDocument.body,'keydown',FCKAsciiMath.KeyDownIE);}};FCK.Events.AttachEvent('OnAfterSetHTML',FCKAsciiMath.SetListeners);FCK.UpdateLinkedField=function(){if (FCKConfig.FullPage){var A=FCK.EditorDocument.getElementsByTagName('html')[0];var B;if (typeof A=='object'){B=A.getElementsByTagName('HEAD')[0];};if (typeof B=='object'){var C=false;var D=FCK.EditorDocument.getElementsByTagName('SPAN');var E;var i=D.length-1;while (i>=0&&(E=D[i--])){if (FCKAsciiMath.IsFormula(E)){C=true;break;}};var F=false;var G=FCK.GetData(false);if (G){G=G.toString().match(/<head\s?[^>]*>(.*?)<\/head\s*>/i);if (G&&G.toString().indexOf('ASCIIMathML.js')!=-1){F=true;}};if (C&&!F){script=FCK.EditorDocument.createElement('script');script.setAttribute('src',FCKConfig.ScriptASCIIMathML);script.setAttribute('type','text/javascript');B.appendChild(script);}}};var H=FCK.GetData(FCKConfig.FormatOutput);if (FCKConfig.HtmlEncodeOutput) H=FCKTools.HTMLEncode(H);FCK.LinkedField.value=H;FCK.Events.FireEvent('OnAfterLinkedFieldUpdate');};

@ -610,7 +610,7 @@ VALUES
('allow_personal_agenda',NULL,'radio','User','false','AllowPersonalAgendaTitle','AllowPersonalAgendaComment',NULL,NULL, 0), ('allow_personal_agenda',NULL,'radio','User','false','AllowPersonalAgendaTitle','AllowPersonalAgendaComment',NULL,NULL, 0),
('display_coursecode_in_courselist',NULL,'radio','Platform','true','DisplayCourseCodeInCourselistTitle','DisplayCourseCodeInCourselistComment',NULL,NULL, 0), ('display_coursecode_in_courselist',NULL,'radio','Platform','true','DisplayCourseCodeInCourselistTitle','DisplayCourseCodeInCourselistComment',NULL,NULL, 0),
('display_teacher_in_courselist',NULL,'radio','Platform','true','DisplayTeacherInCourselistTitle','DisplayTeacherInCourselistComment',NULL,NULL, 0), ('display_teacher_in_courselist',NULL,'radio','Platform','true','DisplayTeacherInCourselistTitle','DisplayTeacherInCourselistComment',NULL,NULL, 0),
('use_document_title',NULL,'radio','Tools','false','UseDocumentTitleTitle','UseDocumentTitleComment',NULL,NULL, 0), ('use_document_title',NULL,'radio','Tools','true','UseDocumentTitleTitle','UseDocumentTitleComment',NULL,NULL, 0),
('permanently_remove_deleted_files',NULL,'radio','Tools','false','PermanentlyRemoveFilesTitle','PermanentlyRemoveFilesComment',NULL,NULL, 0), ('permanently_remove_deleted_files',NULL,'radio','Tools','false','PermanentlyRemoveFilesTitle','PermanentlyRemoveFilesComment',NULL,NULL, 0),
('dropbox_allow_overwrite',NULL,'radio','Tools','true','DropboxAllowOverwriteTitle','DropboxAllowOverwriteComment',NULL,NULL, 0), ('dropbox_allow_overwrite',NULL,'radio','Tools','true','DropboxAllowOverwriteTitle','DropboxAllowOverwriteComment',NULL,NULL, 0),
('dropbox_max_filesize',NULL,'textfield','Tools','100000000','DropboxMaxFilesizeTitle','DropboxMaxFilesizeComment',NULL,NULL, 0), ('dropbox_max_filesize',NULL,'textfield','Tools','100000000','DropboxMaxFilesizeTitle','DropboxMaxFilesizeComment',NULL,NULL, 0),

Loading…
Cancel
Save