Index: lams_central/web/ckeditor/plugins/equation_html/equation.gif =================================================================== diff -u Binary files differ Index: lams_central/web/ckeditor/plugins/equation_html/lang/en.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/equation_html/lang/en.js (revision 0) +++ lams_central/web/ckeditor/plugins/equation_html/lang/en.js (revision 71fc993bdfde6c292ef4d611da5f571092cb9bff) @@ -0,0 +1,4 @@ +FCKLang.EquationBtn = 'Insert/Edit Equation' ; +FCKLang.EquationDlgTitle = 'Equation Properties' ; +FCKLang.EquationDlgName = 'Equation Editor' ; +FCKLang.EquationErrNoEqn = 'Please enter an equation first' ; Index: lams_central/web/ckeditor/plugins/equation_html/plugin.js =================================================================== diff -u --- lams_central/web/ckeditor/plugins/equation_html/plugin.js (revision 0) +++ lams_central/web/ckeditor/plugins/equation_html/plugin.js (revision 71fc993bdfde6c292ef4d611da5f571092cb9bff) @@ -0,0 +1,67 @@ +CKEDITOR.plugins.add('equation_html', +{ + // Latex Equation Editor + init: function(editor) + { + var language=''; // specify your language if not English (en_en) + + var popupEqnwin = null; + + // Register the related command. + editor.addCommand( 'Equation', + { + exec : function( editor ) + { + + var url='http://latex.codecogs.com/editor_json.php?type=url'; + + if(language!='') url+='&lang='+language; + + //open a popup window when the button is clicked + if (popupEqnwin==null || popupEqnwin.closed || !popupEqnwin.location) + { + popupEqnwin=window.open('','LaTexEditor','width=700,height=450,status=1,scrollbars=yes,resizable=1'); + if (!popupEqnwin.opener) popupEqnwin.opener = self; + popupEqnwin.document.write(''); + } + else if (window.focus) + { + popupEqnwin.focus() + } + }, + state: CKEDITOR.TRISTATE_OFF + }); + + // Create the toolbar button. + editor.ui.addButton('Equation', + { + icon: CKEDITOR.plugins.getPath('equation_html') + 'equation.gif', + command: 'Equation' + }); + + + // The object used for all Placeholder operations. + FCKEquation = new Object() ; + + // Add a new placeholder at the actual selection. + FCKEquation.Add = function( name ) + { + var oImage = new CKEDITOR.dom.element( 'img', CKEDITOR.document ); + oImage.setAttributes({ + 'src' : name, + 'align' : 'absmiddle', + 'alt' : name, + 'contentEditable' : false }); + editor.insertElement( oImage ); + // Then select the new placeholder + editor.getSelection().selectElement( oImage ); + } + + // http://latex.codecogs.com/editor_json.php?type=url currently expects FCKeditor methods. + // Add FCKeditor stand-in methods + FCKSelection = new Object() ; + FCKSelection.GetSelectedElement = function() { + return editor.getSelection().getSelectedElement(); + }; + } +}); \ No newline at end of file Index: lams_central/web/includes/javascript/ckconfig_custom.js =================================================================== diff -u -rd0c090e91794c1e3b6f91a51f4dd404b01160255 -r71fc993bdfde6c292ef4d611da5f571092cb9bff --- lams_central/web/includes/javascript/ckconfig_custom.js (.../ckconfig_custom.js) (revision d0c090e91794c1e3b6f91a51f4dd404b01160255) +++ lams_central/web/includes/javascript/ckconfig_custom.js (.../ckconfig_custom.js) (revision 71fc993bdfde6c292ef4d611da5f571092cb9bff) @@ -44,7 +44,7 @@ CKEDITOR.config.enterMode = 'div' ; CKEDITOR.plugins.addExternal('WikiLink', CKEDITOR.basePath + '../tool/lawiki10/wikilink/', 'plugin.js') ; //CKEDITOR.config.extraPlugins = 'equation,movieplayer,videorecorder,paint,wikilink' ; -CKEDITOR.config.extraPlugins = 'videorecorder,WikiLink' ; +CKEDITOR.config.extraPlugins = 'videorecorder,WikiLink,equation_html' ; // ---- Additional scripts ----- // Hides editor instaces until they are fully initialized