[LON-CAPA-cvs] cvs: loncom /html/adm/ckeditor VERSION ckeditor_4.4.7.tar.gz commands loncapaconfig.js /html/adm/ckeditor/plugins/lcm plugin.js /html/adm/ckeditor/plugins/lcm/dev lcm.html /html/adm/ckeditor/plugins/lcm/dialogs lcm.js /html/adm/ckeditor/plugins/lcm/icons lcm.png /html/adm/ckeditor/plugins/lcm/icons/hidpi lcm.png /html/adm/ckeditor/plugins/lcm/images loader.gif /html/adm/ckeditor/plugins/lcm/lang af.js ar.js ca.js cs.js cy.js da.js de.js el.js en-gb.js en.js eo.js es.js fa.js fi.js fr.js gl.js he.js hr.js hu.js it.js ja.js km.js ku.js lt.js nb.js nl.js no.js pl.js pt-br.js pt.js ro.js ru.js sk.js sl.js sq.js sv.js tr.js tt.js uk.js vi.js zh-cn.js zh.js /html/adm/ckeditor/plugins/lcm/samples lcm.html /interface lonhtmlcommon.pm doc/loncapafiles loncapafiles.lpml

damieng damieng at source.lon-capa.org
Tue Mar 31 09:46:01 EDT 2015


damieng		Tue Mar 31 13:46:01 2015 EDT

  Added files:                 
    /loncom/html/adm/ckeditor	ckeditor_4.4.7.tar.gz 
    /loncom/html/adm/ckeditor/plugins/lcm	plugin.js 
    /loncom/html/adm/ckeditor/plugins/lcm/dev	lcm.html 
    /loncom/html/adm/ckeditor/plugins/lcm/dialogs	lcm.js 
    /loncom/html/adm/ckeditor/plugins/lcm/icons	lcm.png 
    /loncom/html/adm/ckeditor/plugins/lcm/icons/hidpi	lcm.png 
    /loncom/html/adm/ckeditor/plugins/lcm/images	loader.gif 
    /loncom/html/adm/ckeditor/plugins/lcm/lang	af.js ar.js ca.js cs.js 
                                              	cy.js da.js de.js el.js 
                                              	en-gb.js en.js eo.js 
                                              	es.js fa.js fi.js fr.js 
                                              	gl.js he.js hr.js hu.js 
                                              	it.js ja.js km.js ku.js 
                                              	lt.js nb.js nl.js no.js 
                                              	pl.js pt-br.js pt.js 
                                              	ro.js ru.js sk.js sl.js 
                                              	sq.js sv.js tr.js tt.js 
                                              	uk.js vi.js zh-cn.js 
                                              	zh.js 
    /loncom/html/adm/ckeditor/plugins/lcm/samples	lcm.html 

  Modified files:              
    /doc/loncapafiles	loncapafiles.lpml 
    /loncom/html/adm/ckeditor	VERSION commands loncapaconfig.js 
    /loncom/interface	lonhtmlcommon.pm 
  Log:
  updated ckeditor to 4.4.7 with an additional plugin to handle <m> with MathJax
  
-------------- next part --------------
Index: doc/loncapafiles/loncapafiles.lpml
diff -u doc/loncapafiles/loncapafiles.lpml:1.911 doc/loncapafiles/loncapafiles.lpml:1.912
--- doc/loncapafiles/loncapafiles.lpml:1.911	Thu Mar 26 16:18:48 2015
+++ doc/loncapafiles/loncapafiles.lpml	Tue Mar 31 13:45:36 2015
@@ -2,7 +2,7 @@
  "http://lpml.sourceforge.net/DTD/lpml.dtd">
 <!-- loncapafiles.lpml -->
 
-<!-- $Id: loncapafiles.lpml,v 1.911 2015/03/26 16:18:48 raeburn Exp $ -->
+<!-- $Id: loncapafiles.lpml,v 1.912 2015/03/31 13:45:36 damieng Exp $ -->
 
 <!--
 
@@ -4772,7 +4772,7 @@
 </file>
 
 <file>
-  <source>loncom/html/adm/ckeditor/ckeditor_3.6.6.1.tar.gz</source>
+  <source>loncom/html/adm/ckeditor/ckeditor_4.4.7.tar.gz</source>
   <target dist='default'>home/httpd/html/ckeditor</target>
   <categoryname>script</categoryname>
   <description>
@@ -4784,9 +4784,56 @@
   </installscript>
   <dependencies>
 loncom/html/adm/ckeditor/commands;
-loncom/html/adm/ckeditor/ckeditor_3.6.6.1.tar.gz;
+loncom/html/adm/ckeditor/ckeditor_4.4.7.tar.gz;
 loncom/html/adm/ckeditor/loncapaconfig.js;
 loncom/html/adm/ckeditor/VERSION;
+loncom/html/adm/ckeditor/plugins/lcm/plugin.js;
+loncom/html/adm/ckeditor/plugins/lcm/dialogs/lcm.js;
+loncom/html/adm/ckeditor/plugins/lcm/icons/lcm.png;
+loncom/html/adm/ckeditor/plugins/lcm/icons/hidpi/lcm.png;
+loncom/html/adm/ckeditor/plugins/lcm/images/loader.gif;
+loncom/html/adm/ckeditor/plugins/lcm/lang/af.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/ar.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/ca.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/cs.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/cy.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/da.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/de.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/el.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/en-gb.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/en.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/eo.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/es.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/fa.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/fi.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/fr.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/gl.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/he.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/hr.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/hu.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/it.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/ja.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/km.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/ku.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/lt.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/nb.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/nl.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/no.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/pl.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/pt-br.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/pt.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/ro.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/ru.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/sk.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/sl.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/sq.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/sv.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/tr.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/tt.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/uk.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/vi.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/zh-cn.js;
+loncom/html/adm/ckeditor/plugins/lcm/lang/zh.js;
   </dependencies>
 </file>
 
Index: loncom/html/adm/ckeditor/VERSION
diff -u loncom/html/adm/ckeditor/VERSION:1.1 loncom/html/adm/ckeditor/VERSION:1.2
--- loncom/html/adm/ckeditor/VERSION:1.1	Thu Jul 18 00:40:07 2013
+++ loncom/html/adm/ckeditor/VERSION	Tue Mar 31 13:45:39 2015
@@ -1 +1 @@
-3.661
+4.47
Index: loncom/html/adm/ckeditor/commands
diff -u loncom/html/adm/ckeditor/commands:1.6 loncom/html/adm/ckeditor/commands:1.7
--- loncom/html/adm/ckeditor/commands:1.6	Thu Jul 18 00:40:07 2013
+++ loncom/html/adm/ckeditor/commands	Tue Mar 31 13:45:39 2015
@@ -1,6 +1,6 @@
 path=`pwd`
 htmldir='/home/httpd/html'
-currversion=3.62
+currversion=4.47
 ckeditordir="$htmldir/ckeditor"
 if [ -e $ckeditordir ]
 then
@@ -18,8 +18,9 @@
     rm -rf $ckeditordir
   fi
   cd $htmldir
-  echo $path/ckeditor_3.6.6.1.tar.gz
-  tar -zxf $path/ckeditor_3.6.6.1.tar.gz
+  echo $path/ckeditor_4.4.7.tar.gz
+  tar -zxf $path/ckeditor_4.4.7.tar.gz
+  cp -r $path/plugins/lcm ckeditor/plugins/
   cp $path/VERSION ckeditor/VERSION
   cp $path/loncapaconfig.js ckeditor/loncapaconfig.js
   chown -R www:www ckeditor
Index: loncom/html/adm/ckeditor/loncapaconfig.js
diff -u loncom/html/adm/ckeditor/loncapaconfig.js:1.2 loncom/html/adm/ckeditor/loncapaconfig.js:1.3
--- loncom/html/adm/ckeditor/loncapaconfig.js:1.2	Sun Sep 15 21:06:19 2013
+++ loncom/html/adm/ckeditor/loncapaconfig.js	Tue Mar 31 13:45:39 2015
@@ -1,68 +1,117 @@
-CKEDITOR.editorConfig = function (config) {
-	/*
-	FCKConfig.ToolbarSets["Default"] = [
-		['Source','DocProps'],
-		['Cut','Copy','Paste','PasteText','PasteWord'],
-		['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
-		['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
-		['OrderedList','UnorderedList','-','Outdent','Indent'],
-		['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
-		['Link','Unlink','Anchor'],
-		['Table', 'Rule', 'Smiley','SpecialChar','PageBreak'], // removed 'Image', 'Table' from front
-		['TextColor','BGColor'],
-		['Style','FontFormat','FontName','FontSize'],
-		['FitWindow','-','About']
-	] ;
-	FCKConfig.LinkUpload = false ;
-	FCKConfig.FlashBrowser = false ;
-	FCKConfig.FlashUpload = false ;
-	//FCKConfig.Plugins.Add('autogrow');
-	//FCKConfig.AutoGrowMax = 500;
-	FCKConfig.IgnoreEmptyParagraphValue = true;
-	FCKConfig.FormatSource = false;
-	FCKConfig.FormatOutput = true;
-	FCKConfig.EnterMode = 'br' ; // p | div | br
-	FCKConfig.ShiftEnterMode = 'p' ; // p | div | br
-	FCKConfig.ImageBrowser = false;
-	*/
+/**
+ * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md or http://ckeditor.com/license
+ */
 
-	config.entities_additional = '';
-	config.browserContextMenuOnCtrl = true;
-	config.disableNativeSpellChecker = false;
-	//config.enterMode = CKEDITOR.ENTER_BR;
-	//config.shiftEnterMode = CKEDITOR.ENTER_P;
-	
-	config.ignoreEmptyParagraph = true;
-	config.smiley_path = '/adm/lonIcons/';
-	
-	config.smiley_descriptions = [
-    'happy', 'sad', 'wink', 'big smile', 'uncertain', 'raspberry',
-    'embarrassed', 'cool', 'glasses', 'plain', 'surprised', 'angry',
-    'crying', 'quiet', 'uncertain', 'kiss', 'sick', 'heart',
-    'rose', 'pizza', 'ninja', 'pirate', 'agree', 
-    'disagree', 'angel'];
+CKEDITOR.editorConfig = function( config ) {
+    // Define changes to default configuration here.
+    // For complete reference see:
+    // http://docs.ckeditor.com/#!/api/CKEDITOR.config
+
+    // The toolbar groups arrangement, optimized for two toolbar rows.
+    config.toolbarGroups = [
+        { name: 'edits',   groups: [ 'undo' ] },
+        { name: 'clipboard',   groups: [ 'clipboard' ] },
+        { name: 'editing',     groups: [ 'find', 'selection', 'spellchecker' ] },
+        { name: 'links' },
+        { name: 'insert' },
+        { name: 'forms' },
+        { name: 'tools' },
+        { name: 'document',       groups: [ 'mode', 'document', 'doctools' ] },
+        { name: 'others' },
+        { name: 'about' },
+        '/',
+        { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
+        { name: 'paragraph',   groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] },
+        { name: 'styles' },
+        { name: 'colors' }
+    ];
+    
+    // config.disableNativeSpellChecker = false;
+    // to see the native spellchecker, we need to disable the contextual menu:
+    // config.removePlugins = 'contextmenu,tabletools'; // problem: it removes the table tools !
+    // see http://dev.ckeditor.com/ticket/12716
+    
+    config.removePlugins = 'sourcearea';
+    
+    // Remove some buttons provided by the standard plugins, which are
+    // not needed in the Standard(s) toolbar.
+    // config.removeButtons = 'spellchecker';
+    // NOTE: we might want to disable spell checking to avoid the ads (if only we could use the native spellcheckers)
+
+    // Set the most common block elements.
+    config.format_tags = 'p;h1;h2;h3;pre';
+
+    // Simplify the dialog windows.
+    config.removeDialogTabs = 'image:advanced;link:advanced';
+    
+    
+    config.allowedContent = true;
+    config.extraPlugins = 'lcm';
+    
+    config.specialChars = [
+        /* upercase greek */
+            ["\u0393", "Gamma"], ["\u0394", "Delta"], ["\u0398", "Theta"], ["\u039B", "Lamda"],
+            ["\u039E", "Xi"], ["\u03A0", "Pi"], ["\u03A3", "Sigma"], ["\u03A5", "Upsilon"],
+            ["\u03A6", "Phi"], ["\u03A7", "Chi"], ["\u03A8", "Psi"], ["\u03A9", "Omega"],
+            "", "", "", "", "",
+        /* lowercase greek */
+            ["\u03B1", "alpha"], ["\u03B2", "beta"], ["\u03B3", "gamma"], ["\u03B4", "delta"],
+            ["\u03B5", "epsilon"], ["\u03B6", "zeta"], ["\u03B7", "eta"], ["\u03B8", "theta"],
+            ["\u03B9", "iota"], ["\u03BA", "kappa"], ["\u03BB", "lambda"], ["\u03BC", "mu"],
+            ["\u03BD", "nu"], ["\u03BE", "xi"], ["\u03BF", "omicron"], ["\u03C0", "pi"],
+            ["\u03C1", "rho"], ["\u03C2", "final sigma"], ["\u03C3", "sigma"],
+            ["\u03C4", "tau"], ["\u03C5", "upsilon"], ["\u03C6", "phi"], ["\u03C7", "chi"],
+            ["\u03C8", "psi"], ["\u03C9", "omega"],
+            "", 
+        /* greek symbols */
+            ["\u03D1", "theta symbol"], ["\u03D5", "phi symbol"], ["\u03D6", "pi symbol"],
+            "", "", "", "", "",
+        /* maths */
+            ["\u00AC", "not"], ["\u00B1", "plus-minus"], ["\u00D7", "multiplication"], ["\u2113", "script l"],
+            ["\u2102", "double-struck C"], ["\u2115", "double-struck N"], ["\u211A", "double-struck Q"],
+            ["\u211D", "double-struck R"], ["\u2124", "double-struck Z"], ["\u212B", "Angstrom"],
+            ["\u2190", "leftwards arrow"], ["\u2192", "rightwards arrow"], ["\u2194", "left right arrow"],
+            ["\u21D0", "leftwards double arrow"], ["\u21D2", "rightwards double arrow"],
+            ["\u21D4", "left right double arrow"],
+            ["\u2200", "for all"], ["\u2202", "partial differential"], ["\u2203", "there exists"],
+            ["\u2205", "empty set"], ["\u2207", "nabla"], ["\u2208", "element of"],
+            ["\u2209", "not an element of"], ["\u2211", "n-ary summation"], ["\u221D", "proportional to"],
+            ["\u221E", "infinity"], ["\u2227", "logical and"], ["\u2228", "logical or"],
+            ["\u2229", "intersection"], ["\u222A", "union"], ["\u222B", "integral"],
+            ["\u223C", "tilde operator"], ["\u2248", "almost equal to"], ["\u2260", "not equal to"],
+            ["\u2261", "identical to"], ["\u2264", "less-than or equal to"],
+            ["\u2265", "greater-than or equal to"], ["\u2282", "subset of"],
+            "", "", "", "", "", "", "", "", "", "", "", "", "",
+        /* cursive uppercase */
+            ["\uD835\uDC9C", "script A"], ["\u212C", "script B"], ["\uD835\uDC9E", "script C"],
+            ["\uD835\uDC9F", "script D"], ["\u2130", "script E"], ["\u2131", "script F"],
+            ["\uD835\uDCA2", "script G"], ["\u210B", "script H"], ["\u2110", "script I"],
+            ["\uD835\uDCA5", "script J"], ["\uD835\uDCA6", "script K"], ["\u2112", "script L"],
+            ["\u2133", "script M"], ["\uD835\uDCA9", "script N"], ["\uD835\uDCAA", "script O"],
+            ["\uD835\uDCAB", "script P"], ["\uD835\uDCAC", "script Q"], ["\u211B", "script R"],
+            ["\uD835\uDCAE", "script S"], ["\uD835\uDCAF", "script T"], ["\uD835\uDCB0", "script U"],
+            ["\uD835\uDCB1", "script V"], ["\uD835\uDCB2", "script W"], ["\uD835\uDCB3", "script X"],
+            ["\uD835\uDCB4", "script Y"], ["\uD835\uDCB5", "script Z"]
+        ];
+    
+
+    config.smiley_path = '/adm/lonIcons/';
+    
+    config.smiley_descriptions = [
+        'happy', 'sad', 'wink', 'big smile', 'uncertain', 'raspberry',
+        'embarrassed', 'cool', 'glasses', 'plain', 'surprised', 'angry',
+        'crying', 'quiet', 'uncertain', 'kiss', 'sick', 'heart',
+        'rose', 'pizza', 'ninja', 'pirate', 'agree', 
+        'disagree', 'angel'
+    ];
     
     config.smiley_images = [
-    'face-smile.png','face-sad.png','face-wink.png','face-smile-big.png','face-uncertain.png','face-raspberry.png',
-    'face-embarrassed.png','face-cool.png','face-glasses.png','face-plain.png','face-surprise.png','face-angry.png',
-    'face-crying.png','face-quiet.png','face-uncertain.png','face-kiss.png','face-sick.png','heart.png',
-    'rose.png','food-pizza.png','face-ninja.png', 'face-pirate.png', 'opinion-agree.png',
-    'opinion-disagree.png', 'face-angel.png'];
-	
-	config.toolbar_Full =
-	[
-		['Source','-','Preview'],
-		['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print'],
-		['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
-		'/',
-		['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
-		['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
-		['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
-		['Link','Unlink','Anchor'],
-		['Image','Table','HorizontalRule','Smiley','SpecialChar'],
-		'/',
-		['Styles','Format','Font','FontSize'],
-		['TextColor','BGColor'],
-		['Maximize', 'ShowBlocks','-','About']
-	];
-}
+        'face-smile.png','face-sad.png','face-wink.png','face-smile-big.png','face-uncertain.png','face-raspberry.png',
+        'face-embarrassed.png','face-cool.png','face-glasses.png','face-plain.png','face-surprise.png','face-angry.png',
+        'face-crying.png','face-quiet.png','face-uncertain.png','face-kiss.png','face-sick.png','heart.png',
+        'rose.png','food-pizza.png','face-ninja.png', 'face-pirate.png', 'opinion-agree.png',
+        'opinion-disagree.png', 'face-angel.png'
+    ];
+    
+};
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.358 loncom/interface/lonhtmlcommon.pm:1.359
--- loncom/interface/lonhtmlcommon.pm:1.358	Sat Dec 20 15:35:40 2014
+++ loncom/interface/lonhtmlcommon.pm	Tue Mar 31 13:46:01 2015
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.358 2014/12/20 15:35:40 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.359 2015/03/31 13:46:01 damieng Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1306,6 +1306,40 @@
     }
     
     function startRichEditor(id) {
+        // fix character entities inside <m>
+        // NOTE: this is not fixing characters inside <parse>
+        var ta = document.getElementById(id);
+        var value = ta.value;
+        var in_m = false; // in the m element
+        var in_text = false; // in the text inside the m element
+        var im = -1; // position of <m>
+        var it = -1; // position of the text inside
+        for (var i=0; i<value.length; i++) {
+            if (value.substr(i, 2) == "<m") {
+                // ignore previous <m> if found twice
+                in_m = true;
+                in_text = false;
+                im = i;
+                it = -1;
+            } else if (in_m) {
+                if (!in_text) {
+                    if (value.charAt(i) == ">") {
+                        in_text = true;
+                        it = i+1;
+                    }
+                } else if (value.substr(i, 4) == "</m>") {
+                    in_m = false;
+                    var text = value.substr(it, i-it);
+                    var l1 = text.length;
+                    text = text.replace(/</g, "<");
+                    text = text.replace(/>/g, ">");
+                    var l2 = text.length;
+                    value = value.substr(0, it) + text + "</m>" + value.substr(i+4);
+                    i = i + (l2-l1);
+                }
+            }
+        }
+        ta.value = value;
     	CKEDITOR.replace(id, 
     		{
     			customConfig: "/ckeditor/loncapaconfig.js",
@@ -1317,6 +1351,63 @@
     
     function destroyRichEditor(id) {
     	CKEDITOR.instances[id].destroy();
+        // replace character entities < and > in <m>
+        // and "&fctname(" by "&fctname("
+        // and the quotes inside functions: "&fct(1, "a")" -> "&fct(1, "a")"
+        var ta = document.getElementById(id);
+        var value = ta.value;
+        var in_m = false; // in the m element
+        var in_text = false; // in the text inside the m element
+        var im = -1; // position of <m>
+        var it = -1; // position of the text inside
+        for (var i=0; i<value.length; i++) {
+            if (value.substr(i, 2) == "<m") {
+                // ignore previous <m> if found twice
+                in_m = true;
+                in_text = false;
+                im = i;
+                it = -1;
+            } else if (in_m) {
+                if (!in_text) {
+                    if (value.charAt(i) == ">") {
+                        in_text = true;
+                        it = i+1;
+                    }
+                } else if (value.substr(i, 4) == "</m>") {
+                    in_m = false;
+                    var text = value.substr(it, i-it);
+                    var l1 = text.length;
+                    text = text.replace(/</g, "<");
+                    text = text.replace(/>/g, ">");
+                    var l2 = text.length;
+                    value = value.substr(0, it) + text + "</m>" + value.substr(i+4);
+                    i = i + (l2-l1);
+                }
+            }
+        }
+        // fix function names
+        value = value.replace(/&([a-zA-Z_]+)\(/g, "&$1(");
+        // fix quotes in functions
+        var pos_next_fct = value.search(/&[a-zA-Z_]+\(/);
+        var depth = 0;
+        for (var i=0; i<value.length; i++) {
+            if (i == pos_next_fct) {
+                depth++;
+                var sub = value.substring(i+1);
+                var pos2 = sub.search(/&[a-zA-Z_]+\(/);
+                if (pos2 == -1)
+                    pos_next_fct = -1;
+                else
+                    pos_next_fct = i + 1 + pos2;
+            } else if (depth > 0) {
+                if (value.charAt(i) == ")")
+                    depth--;
+                else if (value.substr(i, 6) == """)
+                    value = value.substr(0, i) + "\"" + value.substr(i+6);
+            }
+        }
+        // replace the text value
+        ta.value = value;
     }
     
     function editorHandler(event) {

Index: loncom/html/adm/ckeditor/plugins/lcm/plugin.js
+++ loncom/html/adm/ckeditor/plugins/lcm/plugin.js
/**
 * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
 * For licensing, see LICENSE.md or http://ckeditor.com/license
 */

/**
 * @fileOverview [Mathematical Formulas] LON-CAPA ckeditor plugin for the m element, derived from ckeditor mathjax plugin.
 */

'use strict';

( function() {

    var cdn = 'http:\/\/cdn.mathjax.org\/mathjax\/2.2-latest\/MathJax.js?config=TeX-AMS_HTML';

    CKEDITOR.plugins.add( 'lcm', {
        lang: 'af,ar,ca,cs,cy,da,de,el,en,en-gb,eo,es,fa,fi,fr,gl,he,hr,hu,it,ja,km,ku,lt,nb,nl,no,pl,pt,pt-br,ro,ru,sk,sl,sq,sv,tr,tt,uk,vi,zh,zh-cn', // %REMOVE_LINE_CORE%
        requires: 'widget,dialog',
        icons: 'lcm',
        hidpi: true, // %REMOVE_LINE_CORE%

        init: function( editor ) {
            var cls = editor.config.mathJaxClass || 'math-tex';

            editor.widgets.add( 'lcm', {
                inline: true,
                dialog: 'lcm',
                button: editor.lang.lcm.button,
                mask: true,
                allowedContent: 'span(!' + cls + ')',
                // Allow style classes only on spans having lcm class.
                styleToAllowedContentRules: function( style ) {
                    var classes = style.getClassesArray();
                    if ( !classes )
                        return null;
                    classes.push( '!' + cls );

                    return 'span(' + classes.join( ',' ) + ')';
                },
                pathName: editor.lang.lcm.pathName,

                template: '<span class="' + cls + '" style="display:inline-block" data-cke-survive=1></span>',

                parts: {
                    span: 'span'
                },

                defaults: {
                    math: '$ x $' // the default helps to show the $...$ syntax
                },

                init: function() {
                    var iframe = this.parts.span.getChild( 0 );

                    // Check if span contains iframe and create it otherwise.
                    if ( !iframe || iframe.type != CKEDITOR.NODE_ELEMENT || !iframe.is( 'iframe' ) ) {
                        iframe = new CKEDITOR.dom.element( 'iframe' );
                        iframe.setAttributes( {
                            style: 'border:0;width:0;height:0',
                            scrolling: 'no',
                            frameborder: 0,
                            allowTransparency: true,
                            src: CKEDITOR.plugins.lcm.fixSrc
                        } );
                        this.parts.span.append( iframe );
                    }

                    // Wait for ready because on some browsers iFrame will not
                    // have document element until it is put into document.
                    // This is a problem when you crate widget using dialog.
                    this.once( 'ready', function() {
                        // Src attribute must be recreated to fix custom domain error after undo
                        // (see iFrame.removeAttribute( 'src' ) in frameWrapper.load).
                        if ( CKEDITOR.env.ie )
                            iframe.setAttribute( 'src', CKEDITOR.plugins.lcm.fixSrc );

                        this.frameWrapper = new CKEDITOR.plugins.lcm.frameWrapper( iframe, editor );
                        this.frameWrapper.setValue( this.data.math );
                    } );
                },

                data: function() {
                    if ( this.frameWrapper )
                        this.frameWrapper.setValue( this.data.math );
                },

                upcast: function( el, data ) {
                    if ( !( el.name == 'm' ) )
                        return;

                    if ( el.children.length > 1 || el.children[ 0 ].type != CKEDITOR.NODE_TEXT )
                        return;

                    data.math = CKEDITOR.tools.htmlDecode( el.children[ 0 ].value );
                    
                    // NOTE: we do not preserve the display attribute, because only MathJax is used for preview
                    var span = new CKEDITOR.htmlParser.element('span');
                    span.addClass(cls);
                    
                    // Add style display:inline-block to have proper height of widget wrapper and mask.
                    var attrs = span.attributes;

                    if ( attrs.style )
                        attrs.style += ';display:inline-block';
                    else
                        attrs.style = 'display:inline-block';

                    // Add attribute to prevent deleting empty span in data processing.
                    attrs[ 'data-cke-survive' ] = 1;
                    if (el.attributes.eval)
                        attrs['data-eval'] = el.attributes.eval;
                    // NOTE: the display attribute is not preserved
                    el.replaceWith(span);
                    return span;
                },

                downcast: function( el ) {
                    var m = new CKEDITOR.htmlParser.element('m');
                    if (el.attributes['data-eval'])
                        m.attributes.eval = el.attributes['data-eval'];
                    m.add(new CKEDITOR.htmlParser.text(CKEDITOR.tools.htmlEncode(this.data.math)));
                    return m;
                }
            } );

            // Add dialog.
            CKEDITOR.dialog.add( 'lcm', this.path + 'dialogs/lcm.js' );

            // Add MathJax script to page preview.
            editor.on( 'contentPreview', function( evt ) {
                evt.data.dataValue = evt.data.dataValue.replace( /<\/head>/,
                    '<script src="' + ( editor.config.mathJaxLib ? CKEDITOR.getUrl( editor.config.mathJaxLib ) : cdn ) + '"><\/script><\/head>' );
            } );

            editor.on( 'paste', function( evt ) {
                // Firefox does remove iFrame elements from pasted content so this event do the same on other browsers.
                // Also iFrame in paste content is reason of "Unspecified error" in IE9 (#10857).
                var regex = new RegExp( '<span[^>]*?' + cls + '.*?<\/span>', 'ig' );
                evt.data.dataValue = evt.data.dataValue.replace( regex, function( match ) {
                    return match.replace( /(<iframe.*?\/iframe>)/i, '' );
                } );
            } );
        }
    } );

    /**
     * @private
     * @singleton
     * @class CKEDITOR.plugins.lcm
     */
    CKEDITOR.plugins.lcm = {};

    /**
     * A variable to fix problems with `iframe`. This variable is global
     * because it is used in both the widget and the dialog window.
     *
     * @private
     * @property {String} fixSrc
     */
    CKEDITOR.plugins.lcm.fixSrc =
        // In Firefox src must exist and be different than about:blank to emit load event.
        CKEDITOR.env.gecko ? 'javascript:true' : // jshint ignore:line
        // Support for custom document.domain in IE.
        CKEDITOR.env.ie ? 'javascript:' + // jshint ignore:line
                        'void((function(){' + encodeURIComponent(
                            'document.open();' +
                            '(' + CKEDITOR.tools.fixDomain + ')();' +
                            'document.close();'
                        ) + '})())' :
        // In Chrome src must be undefined to emit load event.
                        'javascript:void(0)'; // jshint ignore:line

    /**
     * Loading indicator image generated by http://preloaders.net.
     *
     * @private
     * @property {String} loadingIcon
     */
    CKEDITOR.plugins.lcm.loadingIcon = CKEDITOR.plugins.get( 'lcm' ).path + 'images/loader.gif';

    /**
     * Computes predefined styles and copies them to another element.
     *
     * @private
     * @param {CKEDITOR.dom.element} from Copy source.
     * @param {CKEDITOR.dom.element} to Copy target.
     */
    CKEDITOR.plugins.lcm.copyStyles = function( from, to ) {
        var stylesToCopy = [ 'color', 'font-family', 'font-style', 'font-weight', 'font-variant', 'font-size' ];

        for ( var i = 0; i < stylesToCopy.length; i++ ) {
            var key = stylesToCopy[ i ],
                val = from.getComputedStyle( key );
            if ( val )
                to.setStyle( key, val );
        }
    };

    /**
     * Trims MathJax value from '\(1+1=2\)' to '1+1=2'.
     *
     * @private
     * @param {String} value String to trim.
     * @returns {String} Trimed string.
     */
    CKEDITOR.plugins.lcm.trim = function( value ) {
        var begin = value.indexOf( '\\(' ) + 2,
            end = value.lastIndexOf( '\\)' );

        return value.substring( begin, end );
    };

    /**
     * FrameWrapper is responsible for communication between the MathJax library
     * and the `iframe` element that is used for rendering mathematical formulas
     * inside the editor.
     * It lets you create visual mathematics by using the
     * {@link CKEDITOR.plugins.lcm.frameWrapper#setValue setValue} method.
     *
     * @private
     * @class CKEDITOR.plugins.lcm.frameWrapper
     * @constructor Creates a class instance.
     * @param {CKEDITOR.dom.element} iFrame The `iframe` element to be wrapped.
     * @param {CKEDITOR.editor} editor The editor instance.
     */
    if ( !( CKEDITOR.env.ie && CKEDITOR.env.version == 8 ) ) {
        CKEDITOR.plugins.lcm.frameWrapper = function( iFrame, editor ) {

            var buffer, preview, value, newValue,
                doc = iFrame.getFrameDocument(),

                // Is MathJax loaded and ready to work.
                isInit = false,

                // Is MathJax parsing Tex.
                isRunning = false,

                // Function called when MathJax is loaded.
                loadedHandler = CKEDITOR.tools.addFunction( function() {
                    preview = doc.getById( 'preview' );
                    buffer = doc.getById( 'buffer' );
                    isInit = true;

                    if ( newValue )
                        update();

                    // Private! For test usage only.
                    CKEDITOR.fire( 'mathJaxLoaded', iFrame );
                } ),

                // Function called when MathJax finish his job.
                updateDoneHandler = CKEDITOR.tools.addFunction( function() {
                    CKEDITOR.plugins.lcm.copyStyles( iFrame, preview );

                    preview.setHtml( buffer.getHtml() );

                    editor.fire( 'lockSnapshot' );

                    iFrame.setStyles( {
                        height: 0,
                        width: 0
                    } );

                    // Set iFrame dimensions.
                    var height = Math.max( doc.$.body.offsetHeight, doc.$.documentElement.offsetHeight ),
                        width = Math.max( preview.$.offsetWidth, doc.$.body.scrollWidth );

                    iFrame.setStyles( {
                        height: height + 'px',
                        width: width + 'px'
                    } );

                    editor.fire( 'unlockSnapshot' );

                    // Private! For test usage only.
                    CKEDITOR.fire( 'mathJaxUpdateDone', iFrame );

                    // If value changed in the meantime update it again.
                    if ( value != newValue )
                        update();
                    else
                        isRunning = false;
                } );

            iFrame.on( 'load', load );

            load();

            function load() {
                doc = iFrame.getFrameDocument();

                if ( doc.getById( 'preview' ) )
                    return;

                // Because of IE9 bug in a src attribute can not be javascript
                // when you undo (#10930). If you have iFrame with javascript in src
                // and call insertBefore on such element then IE9 will see crash.
                if ( CKEDITOR.env.ie )
                    iFrame.removeAttribute( 'src' );

                doc.write( '<!DOCTYPE html>' +
                            '<html>' +
                            '<head>' +
                                '<meta charset="utf-8">' +
                                '<script type="text/x-mathjax-config">' +

                                    // MathJax configuration, disable messages.
                                    'MathJax.Hub.Config( {' +
                                        'showMathMenu: false,' +
                                        'messageStyle: "none"' +
                                    '} );' +

                                    // Get main CKEDITOR form parent.
                                    'function getCKE() {' +
                                        'if ( typeof window.parent.CKEDITOR == \'object\' ) {' +
                                            'return window.parent.CKEDITOR;' +
                                        '} else {' +
                                            'return window.parent.parent.CKEDITOR;' +
                                        '}' +
                                    '}' +

                                    // Run MathJax.Hub with its actual parser and call callback function after that.
                                    // Because MathJax.Hub is asynchronous create MathJax.Hub.Queue to wait with callback.
                                    'function update() {' +
                                        'MathJax.Hub.Queue(' +
                                            '[ \'Typeset\', MathJax.Hub, this.buffer ],' +
                                            'function() {' +
                                                'getCKE().tools.callFunction( ' + updateDoneHandler + ' );' +
                                            '}' +
                                        ');' +
                                    '}' +

                                    // Run MathJax for the first time, when the script is loaded.
                                    // Callback function will be called then it's done.
                                    'MathJax.Hub.Queue( function() {' +
                                        'getCKE().tools.callFunction(' + loadedHandler + ');' +
                                    '} );' +
                                '</script>' +

                                // Load MathJax lib.
                                '<script src="' + ( editor.config.mathJaxLib || cdn ) + '"></script>' +
                            '</head>' +
                            '<body style="padding:0;margin:0;background:transparent;overflow:hidden">' +
                                '<span id="preview"></span>' +

                                // Render everything here and after that copy it to the preview.
                                '<span id="buffer" style="display:none"></span>' +
                            '</body>' +
                            '</html>' );
            }

            // Run MathJax parsing Tex.
            function update() {
                isRunning = true;

                value = newValue;

                editor.fire( 'lockSnapshot' );

                buffer.setHtml( value );

                // Set loading indicator.
                preview.setHtml( '<img src=' + CKEDITOR.plugins.lcm.loadingIcon + ' alt=' + editor.lang.lcm.loading + '>' );

                iFrame.setStyles( {
                    height: '16px',
                    width: '16px',
                    display: 'inline',
                    'vertical-align': 'middle'
                } );

                editor.fire( 'unlockSnapshot' );

                // Run MathJax.
                doc.getWindow().$.update( value );
            }

            return {
                /**
                 * Sets the TeX value to be displayed in the `iframe` element inside
                 * the editor. This function will activate the MathJax
                 * library which interprets TeX expressions and converts them into
                 * their representation that is displayed in the editor.
                 *
                 * @param {String} value TeX string.
                 */
                setValue: function( value ) {
                    if (/^\s*\$\$.*\$\$\s*$/.test(value)) {
                        // replace $$...$$ by \[...\]
                        value = value.replace(/^\s*\$\$(.*)\$\$\s*$/, '\\[$1\\]');
                    } else if (/^\s*\$.*\$\s*$/.test(value)) {
                        // replace $...$ by \(...\)
                        value = value.replace(/^\s*\$(.*)\$\s*$/, '\\($1\\)');
                    } else if (/^\s*\\\(.*\\\)\s*$/.test(value)) {
                        // leave \( \) as is
                    } else if (/^\s*\\\[.*\\\]\s*$/.test(value)) {
                        // leave \[ \] as is
                    } else {
                        // add \( \)
                        value = '\\(' + value + '\\)';
                    }
                    newValue = CKEDITOR.tools.htmlEncode( value );

                    if ( isInit && !isRunning )
                        update();
                }
            };
        };
    } else {
        // In IE8 MathJax does not work stable so instead of using standard
        // frame wrapper it is replaced by placeholder to show pure TeX in iframe.
        CKEDITOR.plugins.lcm.frameWrapper = function( iFrame, editor ) {
            iFrame.getFrameDocument().write( '<!DOCTYPE html>' +
                '<html>' +
                '<head>' +
                    '<meta charset="utf-8">' +
                '</head>' +
                '<body style="padding:0;margin:0;background:transparent;overflow:hidden">' +
                    '<span style="white-space:nowrap;" id="tex"></span>' +
                '</body>' +
                '</html>' );

            return {
                setValue: function( value ) {
                    var doc = iFrame.getFrameDocument(),
                        tex = doc.getById( 'tex' );

                    tex.setHtml( CKEDITOR.plugins.lcm.trim( CKEDITOR.tools.htmlEncode( value ) ) );

                    CKEDITOR.plugins.lcm.copyStyles( iFrame, tex );

                    editor.fire( 'lockSnapshot' );

                    iFrame.setStyles( {
                        width: Math.min( 250, tex.$.offsetWidth ) + 'px',
                        height: doc.$.body.offsetHeight + 'px',
                        display: 'inline',
                        'vertical-align': 'middle'
                    } );

                    editor.fire( 'unlockSnapshot' );
                }
            };
        };
    }
} )();

/**
 * Sets the path to the MathJax library. It can be both a local
 * resource and a location different than the default CDN.
 *
 * Please note that this must be a full or absolute path.
 *
 *        config.mathJaxLib = 'http:\/\/example.com\/libs\/MathJax.js';
 *
 * @cfg {String} [mathJaxLib='http:\/\/cdn.mathjax.org\/mathjax\/2.2-latest\/MathJax.js?config=TeX-AMS_HTML']
 * @member CKEDITOR.config
 */


Index: loncom/html/adm/ckeditor/plugins/lcm/dev/lcm.html
+++ loncom/html/adm/ckeditor/plugins/lcm/dev/lcm.html
<!DOCTYPE html>
<!--
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
-->
<html>
<head>
	<meta charset="utf-8">
	<title>Widgets: LCM — CKEditor Sample</title>
	<script src="../../../ckeditor.js"></script>
	<script src="../../../dev/console/console.js"></script>
	<script src="../../../dev/console/focusconsole.js"></script>
	<script src="../../widget/dev/console.js"></script>
	<link href="../../../samples/sample.css" rel="stylesheet">
	<meta name="ckeditor-sample-name" content="Mathematics">
	<meta name="ckeditor-sample-group" content="Plugins">
	<meta name="ckeditor-sample-description" content="Create mathematical equations in TeX and display them in visual form.">
	<meta name="ckeditor-sample-isnew" content="1">
	<script>
		CKEDITOR.disableAutoInline = true;
		document.domain = 'ckeditor.dev';
	</script>
</head>
<body>
	<h1 class="samples">
		<a href="../../../samples/index.html">CKEditor Samples</a> » Widgets: LCM
	</h1>

	<h2>Classic (iframe-based) Sample</h2>

	<textarea id="editor1" cols="10" rows="10">
		<h1>Apollo 11</h1>

		<div style="background:red;color:blue">
			<p><strong>Apollo 11</strong> was the spaceflight that landed the first humans, Americans <a href="http://en.wikipedia.org/wiki/Neil_Armstrong">Neil Armstrong</a> and <a href="http://en.wikipedia.org/wiki/Buzz_Aldrin">Buzz Aldrin</a> <span class="math-tex"><m>x = {-b \pm \sqrt{b^2-4ac} \over 2a}</m></span>. Armstrong became the first to step onto the lunar surface 6 hours later. Armstrong spent about two and a half hours outside the spacecraft, Aldrin slightly less; and together they collected 47.5 pounds (21.5 kg) of lunar material for return to Earth. A third member of the mission, Michael Collins, piloted the command spacecraft alone in lunar orbit until Armstrong and Aldrin returned to it for the trip back to Earth.</p>
		</div>

		<p>Foo foo <span class="userclass mjx"><m>J_\alpha(x) = \sum\limits_{m=0}^\infty \frac{(-1)^m}{m! \, \Gamma(m + \alpha + 1)}{\left({\frac{x}{2}}\right)}^{2 m + \alpha}</m></span> bar bar.</p>

		<p>Launched by a Saturn V rocket from Kennedy Space Center in Merritt Island, Florida on July 16, Apollo 11 was the fifth manned mission of <a href="http://en.wikipedia.org/wiki/NASA">NASA</a>'s Apollo program. The Apollo spacecraft had three parts: aCommand Module with a cabin for the three astronauts which was the only part which landed back on Earth; a Service Module which supported the Command Module with propulsion, electrical power, oxygen and water; and a Lunar Module for landing on the Moon. After being sent to the Moon by the Saturn V's upper stage, the astronauts separated the spacecraft from it and travelled for three days until they entered into lunar orbit. Armstrong and Aldrin then moved into the Lunar Module and landed in the Sea of Tranquility. They stayed a total of about 21 and a half hours on the lunar surface. After lifting off in the upper part of the Lunar Module and re!
 joining Collins in the Command Module, they returned to Earth and landed in the Pacific Ocean .</p>
	</textarea>

	<h2>Inline Sample</h2>

	<div id="editor2" contenteditable="true" cols="10" rows="10">
		<h1>Apollo 11</h1>

		<div style="background:red;color:blue">
			<p><strong>Apollo 11</strong> was the spaceflight that landed the first humans, Americans <a href="http://en.wikipedia.org/wiki/Neil_Armstrong">Neil Armstrong</a> and <a href="http://en.wikipedia.org/wiki/Buzz_Aldrin">Buzz Aldrin</a> <span class="math-tex"><m>x = {-b \pm \sqrt{b^2-4ac} \over 2a}</m></span>. Armstrong became the first to step onto the lunar surface 6 hours later. Armstrong spent about two and a half hours outside the spacecraft, Aldrin slightly less; and together they collected 47.5 pounds (21.5 kg) of lunar material for return to Earth. A third member of the mission, Michael Collins, piloted the command spacecraft alone in lunar orbit until Armstrong and Aldrin returned to it for the trip back to Earth.</p>
		</div>

		<p>Foo foo <span class="userclass mjx"><m>J_\alpha(x) = \sum\limits_{m=0}^\infty \frac{(-1)^m}{m! \, \Gamma(m + \alpha + 1)}{\left({\frac{x}{2}}\right)}^{2 m + \alpha}</m></span> bar bar.</p>

		<p>Launched by a Saturn V rocket from Kennedy Space Center in Merritt Island, Florida on July 16, Apollo 11 was the fifth manned mission of <a href="http://en.wikipedia.org/wiki/NASA">NASA</a>'s Apollo program. The Apollo spacecraft had three parts: aCommand Module with a cabin for the three astronauts which was the only part which landed back on Earth; a Service Module which supported the Command Module with propulsion, electrical power, oxygen and water; and a Lunar Module for landing on the Moon. After being sent to the Moon by the Saturn V's upper stage, the astronauts separated the spacecraft from it and travelled for three days until they entered into lunar orbit. Armstrong and Aldrin then moved into the Lunar Module and landed in the Sea of Tranquility. They stayed a total of about 21 and a half hours on the lunar surface. After lifting off in the upper part of the Lunar Module and re!
 joining Collins in the Command Module, they returned to Earth and landed in the Pacific Ocean .</p>
	</div>

	<h2>Div Editing Area Sample</h2>

	<textarea id="editor3" cols="10" rows="10">
		<h1>Apollo 11</h1>

		<div style="background:red;color:blue">
			<p><strong>Apollo 11</strong> was the spaceflight that landed the first humans, Americans <a href="http://en.wikipedia.org/wiki/Neil_Armstrong">Neil Armstrong</a> and <a href="http://en.wikipedia.org/wiki/Buzz_Aldrin">Buzz Aldrin</a> <span class="math-tex">\(x = {-b \pm \sqrt{b^2-4ac} \over 2a}\)</span>. Armstrong became the first to step onto the lunar surface 6 hours later. Armstrong spent about two and a half hours outside the spacecraft, Aldrin slightly less; and together they collected 47.5 pounds (21.5 kg) of lunar material for return to Earth. A third member of the mission, Michael Collins, piloted the command spacecraft alone in lunar orbit until Armstrong and Aldrin returned to it for the trip back to Earth.</p>
		</div>

		<p>Foo foo <span class="userclass mjx"><m>J_\alpha(x) = \sum\limits_{m=0}^\infty \frac{(-1)^m}{m! \, \Gamma(m + \alpha + 1)}{\left({\frac{x}{2}}\right)}^{2 m + \alpha}</m></span> bar bar.</p>

		<p>Launched by a Saturn V rocket from Kennedy Space Center in Merritt Island, Florida on July 16, Apollo 11 was the fifth manned mission of <a href="http://en.wikipedia.org/wiki/NASA">NASA</a>'s Apollo program. The Apollo spacecraft had three parts: aCommand Module with a cabin for the three astronauts which was the only part which landed back on Earth; a Service Module which supported the Command Module with propulsion, electrical power, oxygen and water; and a Lunar Module for landing on the Moon. After being sent to the Moon by the Saturn V's upper stage, the astronauts separated the spacecraft from it and travelled for three days until they entered into lunar orbit. Armstrong and Aldrin then moved into the Lunar Module and landed in the Sea of Tranquility. They stayed a total of about 21 and a half hours on the lunar surface. After lifting off in the upper part of the Lunar Module and re!
 joining Collins in the Command Module, they returned to Earth and landed in the Pacific Ocean .</p>
	</textarea>

	<script>

		CKEDITOR.stylesSet.add('my_custom_style', [
			{ name: 'My Custom Block', element: 'h1', styles: { color: 'blue'} }
		]);

		CKEDITOR.replace( 'editor1', {
			extraPlugins: 'mathjax',
			height: 350,
			allowedContent: true,
			// mathJaxLib: './truncated-mathjax/MathJax.js?config=TeX-AMS_HTML',
			mathJaxClass: 'mjx'
		} );

		CKEDITOR.inline( 'editor2', {
			extraPlugins: 'mathjax',
			height: 350,
			allowedContent: true,
			// mathJaxLib: './truncated-mathjax/MathJax.js?config=TeX-AMS_HTML',
			mathJaxClass: 'mjx'
		} );

		CKEDITOR.replace( 'editor3', {
			extraPlugins: 'mathjax,divarea',
			height: 350,
			allowedContent: true,
			// mathJaxLib: './truncated-mathjax/MathJax.js?config=TeX-AMS_HTML',
			mathJaxClass: 'mjx'
		} );

		CKCONSOLE.create( 'widget', { editor: 'editor1' } );
		CKCONSOLE.create( 'focus', { editor: 'editor1' } );
		CKCONSOLE.create( 'widget', { editor: 'editor2' } );
		CKCONSOLE.create( 'focus', { editor: 'editor2' } );
		CKCONSOLE.create( 'widget', { editor: 'editor3' } );
		CKCONSOLE.create( 'focus', { editor: 'editor3' } );

	</script>

	<div id="footer">
		<hr>
		<p>
			CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
		</p>
		<p id="copy">
			Copyright © 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
			Knabben. All rights reserved.
		</p>
	</div>
</body>
</html>

Index: loncom/html/adm/ckeditor/plugins/lcm/dialogs/lcm.js
+++ loncom/html/adm/ckeditor/plugins/lcm/dialogs/lcm.js
/**
 * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
 * For licensing, see LICENSE.md or http://ckeditor.com/license
 */

'use strict';

CKEDITOR.dialog.add( 'lcm', function( editor ) {

    var preview,
        lang = editor.lang.lcm;

    return {
        title: lang.title,
        minWidth: 350,
        minHeight: 100,
        contents: [
            {
                id: 'info',
                elements: [
                    {
                        id: 'equation',
                        type: 'textarea',
                        label: lang.dialogInput,

                        onLoad: function() {
                            var that = this;

                            if ( !( CKEDITOR.env.ie && CKEDITOR.env.version == 8 ) ) {
                                this.getInputElement().on( 'keyup', function() {
                                    preview.setValue( that.getInputElement().getValue() );
                                } );
                            }
                        },

                        setup: function( widget ) {
                            this.setValue( widget.data.math );
                        },

                        commit: function( widget ) {
                            widget.setData( 'math', this.getValue() );
                        }
                    },
                    {
                        id: 'documentation',
                        type: 'html',
                        html:
                            '<div style="width:100%;text-align:right;margin:-8px 0 10px">' +
                                '<a class="cke_mathjax_doc" href="' + lang.docUrl + '" target="_black" style="cursor:pointer;color:#00B2CE;text-decoration:underline">' +
                                    lang.docLabel +
                                '</a>' +
                            '</div>'
                    },
                    ( !( CKEDITOR.env.ie && CKEDITOR.env.version == 8 ) ) && {
                        id: 'preview',
                        type: 'html',
                        html:
                            '<div style="width:100%;text-align:center;">' +
                                '<iframe style="border:0;width:0;height:0;font-size:20px" scrolling="no" frameborder="0" allowTransparency="true" src="' + CKEDITOR.plugins.lcm.fixSrc + '"></iframe>' +
                            '</div>',

                        onLoad: function() {
                            var iFrame = CKEDITOR.document.getById( this.domId ).getChild( 0 );
                            preview = new CKEDITOR.plugins.lcm.frameWrapper( iFrame, editor );
                        },

                        setup: function( widget ) {
                            preview.setValue( widget.data.math );
                        }
                    }
                ]
            }
        ]
    };
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/af.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/af.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'af', {
	title: 'Wiskunde in TeX',
	button: 'Wiskunde',
	dialogInput: 'Skryf you Tex hier',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'TeX dokument',
	loading: 'laai...',
	pathName: 'wiskunde'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/ar.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/ar.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'ar', {
	title: 'Mathematics in TeX', // MISSING
	button: 'Math', // MISSING
	dialogInput: 'Write your TeX here', // MISSING
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'TeX documentation', // MISSING
	loading: 'تحميل',
	pathName: 'math' // MISSING
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/ca.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/ca.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'ca', {
	title: 'Matemàtiques a TeX',
	button: 'Matemàtiques',
	dialogInput: 'Escriu el TeX aquí',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'Documentació TeX',
	loading: 'carregant...',
	pathName: 'matemàtiques'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/cs.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/cs.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'cs', {
	title: 'Matematika v TeXu',
	button: 'Matematika',
	dialogInput: 'Zde napište TeXový kód',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'Dokumentace k TeXu',
	loading: 'Nahrává se...',
	pathName: 'Matematika'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/cy.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/cy.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'cy', {
	title: 'Mathemateg mewn TeX',
	button: 'Math',
	dialogInput: 'Ysgrifennwch eich TeX yma',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'Dogfennaeth TeX',
	loading: 'llwytho...',
	pathName: 'math'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/da.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/da.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'da', {
	title: 'Matematik i TeX',
	button: 'Matematik',
	dialogInput: 'Write your TeX here', // MISSING
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'TeX dokumentation',
	loading: 'loading...', // MISSING
	pathName: 'matematik'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/de.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/de.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'de', {
	title: 'Mathematik in Tex',
	button: 'Rechnung',
	dialogInput: 'Schreiben Sie hier in Tex',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'Tex Dokumentation',
	loading: 'lädt...',
	pathName: 'rechnen'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/el.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/el.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'el', {
	title: 'Μαθηματικά με τη γλώσσα TeX',
	button: 'Μαθηματικά',
	dialogInput: 'Γράψτε κώδικα TeX εδώ',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'Τεκμηρίωση TeX',
	loading: 'γίνεται φόρτωση...',
	pathName: 'μαθηματικά'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/en-gb.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/en-gb.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'en-gb', {
	title: 'Mathematics in TeX',
	button: 'Math',
	dialogInput: 'Write you TeX here',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'TeX documentation',
	loading: 'loading...',
	pathName: 'math'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/en.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/en.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'en', {
	title: 'Mathematics in TeX',
	button: 'Math',
	dialogInput: 'Write your TeX here',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'TeX documentation',
	loading: 'loading...',
	pathName: 'math'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/eo.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/eo.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'eo', {
	title: 'Matematiko en TeX',
	button: 'Matematiko',
	dialogInput: 'Skribu vian TeX tien',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'TeX dokumentado',
	loading: 'estas ŝarganta',
	pathName: 'matematiko'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/es.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/es.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'es', {
	title: 'Matemáticas en TeX',
	button: 'Matemáticas',
	dialogInput: 'Escribe tu TeX aquí',
	docUrl: 'http://es.wikipedia.org/wiki/TeX',
	docLabel: 'Documentación de TeX',
	loading: 'cargando...',
	pathName: 'matemáticas'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/fa.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/fa.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'fa', {
	title: 'ریاضیات در تک',
	button: 'ریاضی',
	dialogInput: 'فرمول خود را اینجا بنویسید',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'مستندسازی فرمول نویسی',
	loading: 'بارگیری',
	pathName: 'ریاضی'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/fi.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/fi.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'fi', {
	title: 'Matematiikkaa TeX:llä',
	button: 'Matematiikka',
	dialogInput: 'Kirjoita TeX:iä tähän',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'TeX dokumentaatio',
	loading: 'lataa...',
	pathName: 'matematiikka'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/fr.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/fr.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'fr', {
	title: 'Mathématiques au format TeX',
	button: 'Math',
	dialogInput: 'Saisir la formule TeX ici',
	docUrl: 'http://fr.wikibooks.org/wiki/LaTeX/Math%C3%A9matiques',
	docLabel: 'Documentation du format TeX',
	loading: 'chargement...',
	pathName: 'math'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/gl.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/gl.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'gl', {
	title: 'Matemáticas en TeX',
	button: 'Matemáticas',
	dialogInput: 'Escriba o seu TeX aquí',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'Documentación de TeX',
	loading: 'cargando...',
	pathName: 'matemáticas'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/he.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/he.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'he', {
	title: 'מתמטיקה בTeX',
	button: 'מתמטיקה',
	dialogInput: 'כתוב את הTeX שלך כאן',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'תיעוד TeX',
	loading: 'טוען...',
	pathName: 'מתמטיקה'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/hr.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/hr.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'hr', {
	title: 'Matematika u TeXu',
	button: 'Matematika',
	dialogInput: 'Napiši svoj TeX ovdje',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'TeX dokumentacija',
	loading: 'učitavanje...',
	pathName: 'matematika'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/hu.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/hu.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'hu', {
	title: 'Matematika a TeX-ben',
	button: 'Matek',
	dialogInput: 'Írd a TeX-ed ide',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'TeX dokumentáció',
	loading: 'töltés...',
	pathName: 'matek'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/it.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/it.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'it', {
	title: 'Formule in TeX',
	button: 'Formule',
	dialogInput: 'Scrivere qui il proprio TeX',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'Documentazione TeX',
	loading: 'caricamento…',
	pathName: 'formula'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/ja.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/ja.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'ja', {
	title: 'TeX形式の数式',
	button: '数式',
	dialogInput: 'TeX形式の数式を入力してください',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'TeXの解説',
	loading: '読み込み中…',
	pathName: 'math'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/km.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/km.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'km', {
	title: 'គណិត​វិទ្យា​ក្នុង TeX',
	button: 'គណិត',
	dialogInput: 'សរសេរ TeX របស់​អ្នក​នៅ​ទីនេះ',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'ឯកសារ​អត្ថបទ​ពី ​TeX',
	loading: 'កំពុង​ផ្ទុក..',
	pathName: 'គណិត'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/ku.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/ku.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'ku', {
	title: 'بیرکاری لە TeX',
	button: 'بیرکاری',
	dialogInput: 'TeXەکەت لێرە بنووسە',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'بەڵگەنامەکردنی TeX',
	loading: 'بارکردن...',
	pathName: 'بیرکاری'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/lt.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/lt.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'lt', {
	title: 'Matematika per TeX',
	button: 'Matematika',
	dialogInput: 'Parašyk savo TeX čia',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'TeX žinynas',
	loading: 'kraunasi...',
	pathName: 'matematika'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/nb.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/nb.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'nb', {
	title: 'Matematikk i TeX',
	button: 'Matte',
	dialogInput: 'Skriv TeX-koden her',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'TeX-dokumentasjon',
	loading: 'laster...',
	pathName: 'matte'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/nl.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/nl.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'nl', {
	title: 'Wiskunde in TeX',
	button: 'Wiskunde',
	dialogInput: 'Typ hier uw TeX',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'TeX documentatie',
	loading: 'laden...',
	pathName: 'wiskunde'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/no.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/no.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'no', {
	title: 'Matematikk i TeX',
	button: 'Matte',
	dialogInput: 'Skriv TeX-koden her',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'TeX-dokumentasjon',
	loading: 'laster...',
	pathName: 'matte'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/pl.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/pl.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'pl', {
	title: 'Wzory matematyczne w TeX',
	button: 'Wzory matematyczne',
	dialogInput: 'Wpisz wyrażenie w TeX',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'Dokumentacja TeX',
	loading: 'Å‚adowanie...',
	pathName: 'matematyka'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/pt-br.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/pt-br.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'pt-br', {
	title: 'Matemática em TeX',
	button: 'Matemática',
	dialogInput: 'Escreva seu TeX aqui',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'Documentação TeX',
	loading: 'carregando...',
	pathName: 'Matemática'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/pt.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/pt.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'pt', {
	title: 'Matemática em TeX',
	button: 'Matemática',
	dialogInput: 'Escreva aqui o seu Tex',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'Documentação TeX',
	loading: 'a carregar ...',
	pathName: 'matemática'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/ro.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/ro.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'ro', {
	title: 'Matematici in TeX',
	button: 'Matematici',
	dialogInput: 'Scrie TeX-ul aici',
	docUrl: 'http://ro.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'Documentatie TeX',
	loading: 'încarcă...',
	pathName: 'matematici'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/ru.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/ru.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'ru', {
	title: 'Математика в TeX-системе',
	button: 'Математика',
	dialogInput: 'Введите здесь TeX',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'TeX документация',
	loading: 'загрузка...',
	pathName: 'мат.'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/sk.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/sk.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'sk', {
	title: 'Matematika v TeX',
	button: 'Matika',
	dialogInput: 'Napíšte svoj TeX sem',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'Dokumentácia TeX',
	loading: 'načítavanie...',
	pathName: 'matika'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/sl.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/sl.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'sl', {
	title: 'Matematika v TeX',
	button: 'Matematika',
	dialogInput: 'Napišite svoj TeX tukaj',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'TeX dokumentacija',
	loading: 'nalaganje...',
	pathName: 'matematika'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/sq.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/sq.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'sq', {
	title: 'Matematikë në TeX',
	button: 'Matematikë',
	dialogInput: 'Shkruani TeX-in tuaj këtu',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'Tex dokumentimi',
	loading: 'duke u hapur...',
	pathName: 'matematikë'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/sv.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/sv.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'sv', {
	title: 'Mattematik i TeX',
	button: 'Matte',
	dialogInput: 'Skriv din TeX här',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'TeX dokumentation',
	loading: 'laddar',
	pathName: 'matte'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/tr.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/tr.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'tr', {
	title: 'TeX ile Matematik',
	button: 'Matematik',
	dialogInput: 'TeX kodunuzu buraya yazın',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'TeX yardım dökümanı',
	loading: 'yükleniyor...',
	pathName: 'matematik'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/tt.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/tt.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'tt', {
	title: 'TeX\'та математика',
	button: 'Математика',
	dialogInput: 'Биредә TeX форматында аңлатмагызны языгыз',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'TeX турыдна документлар',
	loading: 'йөкләнә...',
	pathName: 'математика'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/uk.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/uk.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'uk', {
	title: 'Математика у TeX',
	button: 'Математика',
	dialogInput: 'Наберіть тут на TeX\'у',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'Документація про TeX',
	loading: 'завантажується…',
	pathName: 'математика'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/vi.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/vi.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'vi', {
	title: 'Toán học bằng TeX',
	button: 'Toán',
	dialogInput: 'Nhập mã TeX ở đây',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'Tài liệu TeX',
	loading: 'đang nạp...',
	pathName: 'toán'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/zh-cn.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/zh-cn.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'zh-cn', {
	title: 'TeX 语法的数学公式编辑器',
	button: '数学公式',
	dialogInput: '在此编写您的 TeX 指令',
	docUrl: 'http://zh.wikipedia.org/wiki/TeX',
	docLabel: 'TeX 语法(可以参考维基百科自身关于数学公式显示方式的帮助)',
	loading: '正在加载...',
	pathName: '数字公式'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/lang/zh.js
+++ loncom/html/adm/ckeditor/plugins/lcm/lang/zh.js
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'lcm', 'zh', {
	title: '以 TeX 表示數學',
	button: '數學',
	dialogInput: '請輸入 TeX',
	docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics',
	docLabel: 'TeX 說明文件',
	loading: '載入中…',
	pathName: '數學'
} );

Index: loncom/html/adm/ckeditor/plugins/lcm/samples/lcm.html
+++ loncom/html/adm/ckeditor/plugins/lcm/samples/lcm.html
<!DOCTYPE html>
<!--
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
-->
<html>
<head>
    <meta charset="utf-8">
    <title>Mathematical Formulas — CKEditor Sample</title>
    <script src="../../../ckeditor.js"></script>
    <link href="../../../samples/sample.css" rel="stylesheet">
    <meta name="ckeditor-sample-name" content="Mathematics plugin">
    <meta name="ckeditor-sample-group" content="Plugins">
    <meta name="ckeditor-sample-description" content="Create mathematical equations in TeX and display them in visual form.">
    <meta name="ckeditor-sample-isnew" content="1">
    <script>
        CKEDITOR.disableAutoInline = true;
    </script>
</head>
<body>
    <h1 class="samples">
        <a href="../../../samples/index.html">CKEditor Samples</a> » Mathematical Formulas
    </h1>

    <div class="description">
        <p>
            This sample shows the usage of the CKEditor mathematical plugin that introduces a LCM widget. You can now use it to create or modify equations using TeX.
        </p>
        <p>
            TeX content will be automatically replaced by a widget when you put it in a <code><span class="math-tex"></code> element. You can also add new equations by using the <strong>Math</strong> toolbar button and entering TeX content in the plugin dialog window. After you click <strong>OK</strong>, a widget will be inserted into the editor content.
        </p>
        <p>
            The output of the editor will be plain TeX with <m> delimiters: <code><m></code> and <code></m></code>, as in the code below:
        </p>
<pre class="samples">
<m> \sqrt{1} + (1)^2 = 2 </m>
</pre>
        <p>
            To transform TeX into a visual equation, a page must include the <a href="http://docs.mathjax.org/en/latest/start.html">MathJax script</a>.
        </p>
        <p>
            In order to use the new plugin, include it in the <code><a class="samples" href="http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-extraPlugins">config.extraPlugins</a></code> configuration setting.
        </p>
<pre class="samples">
CKEDITOR.replace( '<em>textarea_id</em>', {
    <strong>allowedContent: true,</strong>
    <strong>extraPlugins: 'lcm'</strong>
} );
</pre>
        <p id="ie8-warning">
            Please note that this plugin is not compatible with Internet Explorer 8.
        </p>
    </div>

    <textarea id="editor1" cols="10" rows="10">

        <p>The following equations are represented in the HTML source code as LaTeX expressions.</p><h1>The Cauchy-Schwarz Inequality</h1><p><m> \left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right) </m></p><h1>The probability of getting <m>k</m> heads when flipping <m>n</m> coins is</h1><p><m>P(E) = {n \choose k} p^k (1-p)^{ n-k} </m></p><p>Finally, while displaying equations is useful for demonstration purposes, the ability to mix math and text in a paragraph is also important. This expression <m>\sqrt{3x-1}+(1+x)^2</m> is an example of an inline equation.  As you see, MathJax equations can be used this way as well, without disturbing the spacing between the lines.</p>

    </textarea>
    <script>

        CKEDITOR.replace( 'editor1', {
            allowedContent: true,
            extraPlugins: 'lcm',
            height: 350
        } );

        if ( CKEDITOR.env.ie && CKEDITOR.env.version == 8 )
            document.getElementById( 'ie8-warning' ).className = 'warning';

    </script>

    <div id="footer">
        <hr>
        <p>
            CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
        </p>
        <p id="copy">
            Copyright © 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
            Knabben. All rights reserved.
        </p>
    </div>
</body>
</html>


More information about the LON-CAPA-cvs mailing list