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

1.1     ! damieng     1: /**
        !             2:  * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
        !             3:  * For licensing, see LICENSE.md or http://ckeditor.com/license
        !             4:  */
        !             5: 
        !             6: 'use strict';
        !             7: 
        !             8: CKEDITOR.dialog.add( 'lcm', function( editor ) {
        !             9: 
        !            10:     var preview,
        !            11:         lang = editor.lang.lcm;
        !            12: 
        !            13:     return {
        !            14:         title: lang.title,
        !            15:         minWidth: 350,
        !            16:         minHeight: 100,
        !            17:         contents: [
        !            18:             {
        !            19:                 id: 'info',
        !            20:                 elements: [
        !            21:                     {
        !            22:                         id: 'equation',
        !            23:                         type: 'textarea',
        !            24:                         label: lang.dialogInput,
        !            25: 
        !            26:                         onLoad: function() {
        !            27:                             var that = this;
        !            28: 
        !            29:                             if ( !( CKEDITOR.env.ie && CKEDITOR.env.version == 8 ) ) {
        !            30:                                 this.getInputElement().on( 'keyup', function() {
        !            31:                                     preview.setValue( that.getInputElement().getValue() );
        !            32:                                 } );
        !            33:                             }
        !            34:                         },
        !            35: 
        !            36:                         setup: function( widget ) {
        !            37:                             this.setValue( widget.data.math );
        !            38:                         },
        !            39: 
        !            40:                         commit: function( widget ) {
        !            41:                             widget.setData( 'math', this.getValue() );
        !            42:                         }
        !            43:                     },
        !            44:                     {
        !            45:                         id: 'documentation',
        !            46:                         type: 'html',
        !            47:                         html:
        !            48:                             '<div style="width:100%;text-align:right;margin:-8px 0 10px">' +
        !            49:                                 '<a class="cke_mathjax_doc" href="' + lang.docUrl + '" target="_black" style="cursor:pointer;color:#00B2CE;text-decoration:underline">' +
        !            50:                                     lang.docLabel +
        !            51:                                 '</a>' +
        !            52:                             '</div>'
        !            53:                     },
        !            54:                     ( !( CKEDITOR.env.ie && CKEDITOR.env.version == 8 ) ) && {
        !            55:                         id: 'preview',
        !            56:                         type: 'html',
        !            57:                         html:
        !            58:                             '<div style="width:100%;text-align:center;">' +
        !            59:                                 '<iframe style="border:0;width:0;height:0;font-size:20px" scrolling="no" frameborder="0" allowTransparency="true" src="' + CKEDITOR.plugins.lcm.fixSrc + '"></iframe>' +
        !            60:                             '</div>',
        !            61: 
        !            62:                         onLoad: function() {
        !            63:                             var iFrame = CKEDITOR.document.getById( this.domId ).getChild( 0 );
        !            64:                             preview = new CKEDITOR.plugins.lcm.frameWrapper( iFrame, editor );
        !            65:                         },
        !            66: 
        !            67:                         setup: function( widget ) {
        !            68:                             preview.setValue( widget.data.math );
        !            69:                         }
        !            70:                     }
        !            71:                 ]
        !            72:             }
        !            73:         ]
        !            74:     };
        !            75: } );

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