/** * Copyright (c) 2014-2016, CKSource - Frederico Knabben. All rights reserved. * Licensed under the terms of the MIT License (see LICENSE.md). * * The abbr plugin dialog window definition. * * Created out of the CKEditor Plugin SDK: * http://docs.ckeditor.com/#!/guide/plugin_sdk_sample_1 */ // Our dialog definition. CKEDITOR.dialog.add( 'mswordDialog', function( editor ) { var ed_lang = editor.lang.msword; /*top right bottom left*/ // var olstyle ='list-style: decimal-leading-zero; font-size: 1.1em; margin: 0 0 0 .25em'; var olstyle ='font-size: 1.1em;'; return { // Basic properties of the dialog window: title, minimum size. title: 'MS Word', minWidth: 600, minHeight: 350, // Dialog window content definition. contents: [ { // Definition of the Basic Settings dialog tab (page). id: 'tab-basic', label: 'Text', // The tab content. elements: [ { type: 'html', html: '
', minWidth: 350, minHeight: 350, }, { type: 'hbox', height: [ '18px;'], children: [ { type: 'html', html: editor.lang.msword.info, } ] //hbox children }, //hbox ], //elements }, //contents { id: 'Info', label: editor.lang.msword.instructionsLabel, elements: [ { type: 'html', html: "
  1. "+ ed_lang.instructions +'
  2. ' + ed_lang.instructions_2 +'
  3. ' + ed_lang.instructions_5 + '
', }, ] } ], //contents onShow : function() { var dialog = this; geshi_dialog = dialog; selection = editor.getSelection(); var selected=editor.getSelectedHtml(true) ; if(selected) { var data_id = document.getElementById('ckgedit_mswin'); data_id.innerHTML = selected; } jQuery( "#ckgedit_mswin" ).keydown(function(ev) { if (ev.which == 13 ) { ev.stopPropagation(); } }); }, onOk: function() { // The context of this function is the dialog object itself. // http://docs.ckeditor.com/#!/api/CKEDITOR.dialog var data_id = document.getElementById('ckgedit_mswin'); var inner = data_id.innerHTML; inner = inner.replace(/</gm,'<'); inner = inner.replace(/>/mg,'>'); //if(confirm("exit now") { //jQuery('.cke_dialog_ui_button_cancel').children().click(); // } var regex = new RegExp('([^]*)<\/xml>','gm'); inner = inner.replace(regex, function(m,n) { return ""; }); var regex = new RegExp('