/** * @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: '
' + '' + lang.docLabel + '' + '
' }, ( !( CKEDITOR.env.ie && CKEDITOR.env.version == 8 ) ) && { id: 'preview', type: 'html', html: '
' + '' + '
', 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 ); } } ] } ] }; } );