Annotation of loncom/html/adm/ckeditor/plugins/lcm/samples/lcm.html, revision 1.1

1.1     ! damieng     1: <!DOCTYPE html>
        !             2: <!--
        !             3: Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
        !             4: For licensing, see LICENSE.md or http://ckeditor.com/license
        !             5: -->
        !             6: <html>
        !             7: <head>
        !             8:     <meta charset="utf-8">
        !             9:     <title>Mathematical Formulas &mdash; CKEditor Sample</title>
        !            10:     <script src="../../../ckeditor.js"></script>
        !            11:     <link href="../../../samples/sample.css" rel="stylesheet">
        !            12:     <meta name="ckeditor-sample-name" content="Mathematics plugin">
        !            13:     <meta name="ckeditor-sample-group" content="Plugins">
        !            14:     <meta name="ckeditor-sample-description" content="Create mathematical equations in TeX and display them in visual form.">
        !            15:     <meta name="ckeditor-sample-isnew" content="1">
        !            16:     <script>
        !            17:         CKEDITOR.disableAutoInline = true;
        !            18:     </script>
        !            19: </head>
        !            20: <body>
        !            21:     <h1 class="samples">
        !            22:         <a href="../../../samples/index.html">CKEditor Samples</a> &raquo; Mathematical Formulas
        !            23:     </h1>
        !            24: 
        !            25:     <div class="description">
        !            26:         <p>
        !            27:             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.
        !            28:         </p>
        !            29:         <p>
        !            30:             TeX content will be automatically replaced by a widget when you put it in a <code>&lt;span class="math-tex"&gt;</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.
        !            31:         </p>
        !            32:         <p>
        !            33:             The output of the editor will be plain TeX with &lt;m&gt; delimiters: <code>&lt;m&gt;</code> and <code>&lt;/m&gt;</code>, as in the code below:
        !            34:         </p>
        !            35: <pre class="samples">
        !            36: &lt;m&gt; \sqrt{1} + (1)^2 = 2 &lt;/m&gt;
        !            37: </pre>
        !            38:         <p>
        !            39:             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>.
        !            40:         </p>
        !            41:         <p>
        !            42:             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.
        !            43:         </p>
        !            44: <pre class="samples">
        !            45: CKEDITOR.replace( '<em>textarea_id</em>', {
        !            46:     <strong>allowedContent: true,</strong>
        !            47:     <strong>extraPlugins: 'lcm'</strong>
        !            48: } );
        !            49: </pre>
        !            50:         <p id="ie8-warning">
        !            51:             Please note that this plugin is not compatible with Internet Explorer 8.
        !            52:         </p>
        !            53:     </div>
        !            54: 
        !            55:     <textarea id="editor1" cols="10" rows="10">
        !            56: 
        !            57:         &lt;p&gt;The following equations are represented in the HTML source code as LaTeX expressions.&lt;/p&gt;&lt;h1&gt;The Cauchy-Schwarz Inequality&lt;/h1&gt;&lt;p&gt;&lt;m&gt; \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) &lt;/m&gt;&lt;/p&gt;&lt;h1&gt;The probability of getting &lt;m&gt;k&lt;/m&gt; heads when flipping &lt;m&gt;n&lt;/m&gt; coins is&lt;/h1&gt;&lt;p&gt;&lt;m&gt;P(E) = {n \choose k} p^k (1-p)^{ n-k} &lt;/m&gt;&lt;/p&gt;&lt;p&gt;Finally, while displaying equations is useful for demonstration purposes, the ability to mix math and text in a paragraph is also important. This expression &lt;m&gt;\sqrt{3x-1}+(1+x)^2&lt;/m&gt; 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.&lt;/p&gt;
        !            58: 
        !            59:     </textarea>
        !            60:     <script>
        !            61: 
        !            62:         CKEDITOR.replace( 'editor1', {
        !            63:             allowedContent: true,
        !            64:             extraPlugins: 'lcm',
        !            65:             height: 350
        !            66:         } );
        !            67: 
        !            68:         if ( CKEDITOR.env.ie && CKEDITOR.env.version == 8 )
        !            69:             document.getElementById( 'ie8-warning' ).className = 'warning';
        !            70: 
        !            71:     </script>
        !            72: 
        !            73:     <div id="footer">
        !            74:         <hr>
        !            75:         <p>
        !            76:             CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
        !            77:         </p>
        !            78:         <p id="copy">
        !            79:             Copyright &copy; 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
        !            80:             Knabben. All rights reserved.
        !            81:         </p>
        !            82:     </div>
        !            83: </body>
        !            84: </html>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>