summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlsces <lester@lsces.co.uk>2014-06-07 07:56:35 +0100
committerlsces <lester@lsces.co.uk>2014-06-07 07:56:35 +0100
commitc48edee04c0d2de6eef163cbcca17d131b8d5d44 (patch)
tree9fb26024238b9988ce22a0a313c73df485af719f
parent369b641d5f4e09cf9331aff54b14265d6a138e9c (diff)
downloadckeditor-c48edee04c0d2de6eef163cbcca17d131b8d5d44.tar.gz
ckeditor-c48edee04c0d2de6eef163cbcca17d131b8d5d44.tar.bz2
ckeditor-c48edee04c0d2de6eef163cbcca17d131b8d5d44.zip
Upgrade to version 4.3
-rwxr-xr-x[-rw-r--r--]plugins/table/dialogs/table.js577
-rwxr-xr-x[-rw-r--r--]plugins/tabletools/dialogs/tableCell.js434
-rwxr-xr-x[-rw-r--r--]plugins/templates/dialogs/templates.css2
-rwxr-xr-x[-rw-r--r--]plugins/templates/dialogs/templates.js213
-rwxr-xr-x[-rw-r--r--]plugins/templates/templates/default.js94
-rwxr-xr-x[-rw-r--r--]plugins/wsc/dialogs/tmp.html19
-rwxr-xr-x[-rw-r--r--]plugins/wsc/dialogs/wsc.js2159
-rwxr-xr-x[-rw-r--r--]plugins/wsc/dialogs/wsc_ie.js187
-rwxr-xr-x[-rw-r--r--]styles.js223
9 files changed, 248 insertions, 3660 deletions
diff --git a/plugins/table/dialogs/table.js b/plugins/table/dialogs/table.js
index 681d0b9..cc0b646 100644..100755
--- a/plugins/table/dialogs/table.js
+++ b/plugins/table/dialogs/table.js
@@ -1,556 +1,21 @@
-/**
- * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.html or http://ckeditor.com/license
- */
-
-(function() {
- var defaultToPixel = CKEDITOR.tools.cssLength;
-
- var commitValue = function( data ) {
- var id = this.id;
- if ( !data.info )
- data.info = {};
- data.info[ id ] = this.getValue();
- };
-
- function tableColumns( table ) {
- var cols = 0,
- maxCols = 0;
- for ( var i = 0, row, rows = table.$.rows.length; i < rows; i++ ) {
- row = table.$.rows[ i ], cols = 0;
- for ( var j = 0, cell, cells = row.cells.length; j < cells; j++ ) {
- cell = row.cells[ j ];
- cols += cell.colSpan;
- }
-
- cols > maxCols && ( maxCols = cols );
- }
-
- return maxCols;
- }
-
-
- // Whole-positive-integer validator.
- function validatorNum( msg ) {
- return function() {
- var value = this.getValue(),
- pass = !!( CKEDITOR.dialog.validate.integer()( value ) && value > 0 );
-
- if ( !pass ) {
- alert( msg );
- this.select();
- }
-
- return pass;
- };
- }
-
- function tableDialog( editor, command ) {
- var makeElement = function( name ) {
- return new CKEDITOR.dom.element( name, editor.document );
- };
-
- var editable = editor.editable();
-
- var dialogadvtab = editor.plugins.dialogadvtab;
-
- return {
- title: editor.lang.table.title,
- minWidth: 310,
- minHeight: CKEDITOR.env.ie ? 310 : 280,
-
- onLoad: function() {
- var dialog = this;
-
- var styles = dialog.getContentElement( 'advanced', 'advStyles' );
-
- if ( styles ) {
- styles.on( 'change', function( evt ) {
- // Synchronize width value.
- var width = this.getStyle( 'width', '' ),
- txtWidth = dialog.getContentElement( 'info', 'txtWidth' );
-
- txtWidth && txtWidth.setValue( width, true );
-
- // Synchronize height value.
- var height = this.getStyle( 'height', '' ),
- txtHeight = dialog.getContentElement( 'info', 'txtHeight' );
-
- txtHeight && txtHeight.setValue( height, true );
- });
- }
- },
-
- onShow: function() {
- // Detect if there's a selected table.
- var selection = editor.getSelection(),
- ranges = selection.getRanges(),
- table;
-
- var rowsInput = this.getContentElement( 'info', 'txtRows' ),
- colsInput = this.getContentElement( 'info', 'txtCols' ),
- widthInput = this.getContentElement( 'info', 'txtWidth' ),
- heightInput = this.getContentElement( 'info', 'txtHeight' );
-
- if ( command == 'tableProperties' ) {
- var selected = selection.getSelectedElement();
- if ( selected && selected.is( 'table' ) )
- table = selected;
- else if ( ranges.length > 0 ) {
- // Webkit could report the following range on cell selection (#4948):
- // <table><tr><td>[&nbsp;</td></tr></table>]
- if ( CKEDITOR.env.webkit )
- ranges[ 0 ].shrink( CKEDITOR.NODE_ELEMENT );
-
- table = editor.elementPath( ranges[ 0 ].getCommonAncestor( true ) ).contains( 'table', 1 );
- }
-
- // Save a reference to the selected table, and push a new set of default values.
- this._.selectedElement = table;
- }
-
- // Enable or disable the row, cols, width fields.
- if ( table ) {
- this.setupContent( table );
- rowsInput && rowsInput.disable();
- colsInput && colsInput.disable();
- } else {
- rowsInput && rowsInput.enable();
- colsInput && colsInput.enable();
- }
-
- // Call the onChange method for the widht and height fields so
- // they get reflected into the Advanced tab.
- widthInput && widthInput.onChange();
- heightInput && heightInput.onChange();
- },
- onOk: function() {
- var selection = editor.getSelection(),
- bms = this._.selectedElement && selection.createBookmarks();
-
- var table = this._.selectedElement || makeElement( 'table' ),
- me = this,
- data = {};
-
- this.commitContent( data, table );
-
- if ( data.info ) {
- var info = data.info;
-
- // Generate the rows and cols.
- if ( !this._.selectedElement ) {
- var tbody = table.append( makeElement( 'tbody' ) ),
- rows = parseInt( info.txtRows, 10 ) || 0,
- cols = parseInt( info.txtCols, 10 ) || 0;
-
- for ( var i = 0; i < rows; i++ ) {
- var row = tbody.append( makeElement( 'tr' ) );
- for ( var j = 0; j < cols; j++ ) {
- var cell = row.append( makeElement( 'td' ) );
- if ( !CKEDITOR.env.ie )
- cell.append( makeElement( 'br' ) );
- }
- }
- }
-
- // Modify the table headers. Depends on having rows and cols generated
- // correctly so it can't be done in commit functions.
-
- // Should we make a <thead>?
- var headers = info.selHeaders;
- if ( !table.$.tHead && ( headers == 'row' || headers == 'both' ) ) {
- var thead = new CKEDITOR.dom.element( table.$.createTHead() );
- tbody = table.getElementsByTag( 'tbody' ).getItem( 0 );
- var theRow = tbody.getElementsByTag( 'tr' ).getItem( 0 );
-
- // Change TD to TH:
- for ( i = 0; i < theRow.getChildCount(); i++ ) {
- var th = theRow.getChild( i );
- // Skip bookmark nodes. (#6155)
- if ( th.type == CKEDITOR.NODE_ELEMENT && !th.data( 'cke-bookmark' ) ) {
- th.renameNode( 'th' );
- th.setAttribute( 'scope', 'col' );
- }
- }
- thead.append( theRow.remove() );
- }
-
- if ( table.$.tHead !== null && !( headers == 'row' || headers == 'both' ) ) {
- // Move the row out of the THead and put it in the TBody:
- thead = new CKEDITOR.dom.element( table.$.tHead );
- tbody = table.getElementsByTag( 'tbody' ).getItem( 0 );
-
- var previousFirstRow = tbody.getFirst();
- while ( thead.getChildCount() > 0 ) {
- theRow = thead.getFirst();
- for ( i = 0; i < theRow.getChildCount(); i++ ) {
- var newCell = theRow.getChild( i );
- if ( newCell.type == CKEDITOR.NODE_ELEMENT ) {
- newCell.renameNode( 'td' );
- newCell.removeAttribute( 'scope' );
- }
- }
- theRow.insertBefore( previousFirstRow );
- }
- thead.remove();
- }
-
- // Should we make all first cells in a row TH?
- if ( !this.hasColumnHeaders && ( headers == 'col' || headers == 'both' ) ) {
- for ( row = 0; row < table.$.rows.length; row++ ) {
- newCell = new CKEDITOR.dom.element( table.$.rows[ row ].cells[ 0 ] );
- newCell.renameNode( 'th' );
- newCell.setAttribute( 'scope', 'row' );
- }
- }
-
- // Should we make all first TH-cells in a row make TD? If 'yes' we do it the other way round :-)
- if ( ( this.hasColumnHeaders ) && !( headers == 'col' || headers == 'both' ) ) {
- for ( i = 0; i < table.$.rows.length; i++ ) {
- row = new CKEDITOR.dom.element( table.$.rows[ i ] );
- if ( row.getParent().getName() == 'tbody' ) {
- newCell = new CKEDITOR.dom.element( row.$.cells[ 0 ] );
- newCell.renameNode( 'td' );
- newCell.removeAttribute( 'scope' );
- }
- }
- }
-
- // Set the width and height.
- info.txtHeight ? table.setStyle( 'height', info.txtHeight ) : table.removeStyle( 'height' );
- info.txtWidth ? table.setStyle( 'width', info.txtWidth ) : table.removeStyle( 'width' );
-
- if ( !table.getAttribute( 'style' ) )
- table.removeAttribute( 'style' );
- }
-
- // Insert the table element if we're creating one.
- if ( !this._.selectedElement ) {
- editor.insertElement( table );
- // Override the default cursor position after insertElement to place
- // cursor inside the first cell (#7959), IE needs a while.
- setTimeout( function() {
- var firstCell = new CKEDITOR.dom.element( table.$.rows[ 0 ].cells[ 0 ] );
- var range = editor.createRange();
- range.moveToPosition( firstCell, CKEDITOR.POSITION_AFTER_START );
- range.select();
- }, 0 );
- }
- // Properly restore the selection, (#4822) but don't break
- // because of this, e.g. updated table caption.
- else
- try {
- selection.selectBookmarks( bms );
- } catch ( er ) {}
- },
- contents: [
- {
- id: 'info',
- label: editor.lang.table.title,
- elements: [
- {
- type: 'hbox',
- widths: [ null, null ],
- styles: [ 'vertical-align:top' ],
- children: [
- {
- type: 'vbox',
- padding: 0,
- children: [
- {
- type: 'text',
- id: 'txtRows',
- 'default': 3,
- label: editor.lang.table.rows,
- required: true,
- controlStyle: 'width:5em',
- validate: validatorNum( editor.lang.table.invalidRows ),
- setup: function( selectedElement ) {
- this.setValue( selectedElement.$.rows.length );
- },
- commit: commitValue
- },
- {
- type: 'text',
- id: 'txtCols',
- 'default': 2,
- label: editor.lang.table.columns,
- required: true,
- controlStyle: 'width:5em',
- validate: validatorNum( editor.lang.table.invalidCols ),
- setup: function( selectedTable ) {
- this.setValue( tableColumns( selectedTable ) );
- },
- commit: commitValue
- },
- {
- type: 'html',
- html: '&nbsp;'
- },
- {
- type: 'select',
- id: 'selHeaders',
- requiredContent: 'th',
- 'default': '',
- label: editor.lang.table.headers,
- items: [
- [ editor.lang.table.headersNone, '' ],
- [ editor.lang.table.headersRow, 'row' ],
- [ editor.lang.table.headersColumn, 'col' ],
- [ editor.lang.table.headersBoth, 'both' ]
- ],
- setup: function( selectedTable ) {
- // Fill in the headers field.
- var dialog = this.getDialog();
- dialog.hasColumnHeaders = true;
-
- // Check if all the first cells in every row are TH
- for ( var row = 0; row < selectedTable.$.rows.length; row++ ) {
- // If just one cell isn't a TH then it isn't a header column
- var headCell = selectedTable.$.rows[ row ].cells[ 0 ];
- if ( headCell && headCell.nodeName.toLowerCase() != 'th' ) {
- dialog.hasColumnHeaders = false;
- break;
- }
- }
-
- // Check if the table contains <thead>.
- if ( ( selectedTable.$.tHead !== null ) )
- this.setValue( dialog.hasColumnHeaders ? 'both' : 'row' );
- else
- this.setValue( dialog.hasColumnHeaders ? 'col' : '' );
- },
- commit: commitValue
- },
- {
- type: 'text',
- id: 'txtBorder',
- requiredContent: 'table[border]',
- // Avoid setting border which will then disappear.
- 'default': editor.filter.check( 'table[border]' ) ? 1 : 0,
- label: editor.lang.table.border,
- controlStyle: 'width:3em',
- validate: CKEDITOR.dialog.validate[ 'number' ]( editor.lang.table.invalidBorder ),
- setup: function( selectedTable ) {
- this.setValue( selectedTable.getAttribute( 'border' ) || '' );
- },
- commit: function( data, selectedTable ) {
- if ( this.getValue() )
- selectedTable.setAttribute( 'border', this.getValue() );
- else
- selectedTable.removeAttribute( 'border' );
- }
- },
- {
- id: 'cmbAlign',
- type: 'select',
- requiredContent: 'table[align]',
- 'default': '',
- label: editor.lang.common.align,
- items: [
- [ editor.lang.common.notSet, '' ],
- [ editor.lang.common.alignLeft, 'left' ],
- [ editor.lang.common.alignCenter, 'center' ],
- [ editor.lang.common.alignRight, 'right' ]
- ],
- setup: function( selectedTable ) {
- this.setValue( selectedTable.getAttribute( 'align' ) || '' );
- },
- commit: function( data, selectedTable ) {
- if ( this.getValue() )
- selectedTable.setAttribute( 'align', this.getValue() );
- else
- selectedTable.removeAttribute( 'align' );
- }
- }
- ]
- },
- {
- type: 'vbox',
- padding: 0,
- children: [
- {
- type: 'hbox',
- widths: [ '5em' ],
- children: [
- {
- type: 'text',
- id: 'txtWidth',
- requiredContent: 'table{width}',
- controlStyle: 'width:5em',
- label: editor.lang.common.width,
- title: editor.lang.common.cssLengthTooltip,
- // Smarter default table width. (#9600)
- 'default': editor.filter.check( 'table{width}' ) ? ( editable.getSize( 'width' ) < 500 ? '100%' : 500 ) : 0,
- getValue: defaultToPixel,
- validate: CKEDITOR.dialog.validate.cssLength( editor.lang.common.invalidCssLength.replace( '%1', editor.lang.common.width ) ),
- onChange: function() {
- var styles = this.getDialog().getContentElement( 'advanced', 'advStyles' );
- styles && styles.updateStyle( 'width', this.getValue() );
- },
- setup: function( selectedTable ) {
- var val = selectedTable.getStyle( 'width' );
- this.setValue( val );
- },
- commit: commitValue
- }
- ]
- },
- {
- type: 'hbox',
- widths: [ '5em' ],
- children: [
- {
- type: 'text',
- id: 'txtHeight',
- requiredContent: 'table{height}',
- controlStyle: 'width:5em',
- label: editor.lang.common.height,
- title: editor.lang.common.cssLengthTooltip,
- 'default': '',
- getValue: defaultToPixel,
- validate: CKEDITOR.dialog.validate.cssLength( editor.lang.common.invalidCssLength.replace( '%1', editor.lang.common.height ) ),
- onChange: function() {
- var styles = this.getDialog().getContentElement( 'advanced', 'advStyles' );
- styles && styles.updateStyle( 'height', this.getValue() );
- },
-
- setup: function( selectedTable ) {
- var val = selectedTable.getStyle( 'height' );
- val && this.setValue( val );
- },
- commit: commitValue
- }
- ]
- },
- {
- type: 'html',
- html: '&nbsp;'
- },
- {
- type: 'text',
- id: 'txtCellSpace',
- requiredContent: 'table[cellspacing]',
- controlStyle: 'width:3em',
- label: editor.lang.table.cellSpace,
- 'default': editor.filter.check( 'table[cellspacing]' ) ? 1 : 0,
- validate: CKEDITOR.dialog.validate.number( editor.lang.table.invalidCellSpacing ),
- setup: function( selectedTable ) {
- this.setValue( selectedTable.getAttribute( 'cellSpacing' ) || '' );
- },
- commit: function( data, selectedTable ) {
- if ( this.getValue() )
- selectedTable.setAttribute( 'cellSpacing', this.getValue() );
- else
- selectedTable.removeAttribute( 'cellSpacing' );
- }
- },
- {
- type: 'text',
- id: 'txtCellPad',
- requiredContent: 'table[cellpadding]',
- controlStyle: 'width:3em',
- label: editor.lang.table.cellPad,
- 'default': editor.filter.check( 'table[cellpadding]' ) ? 1 : 0,
- validate: CKEDITOR.dialog.validate.number( editor.lang.table.invalidCellPadding ),
- setup: function( selectedTable ) {
- this.setValue( selectedTable.getAttribute( 'cellPadding' ) || '' );
- },
- commit: function( data, selectedTable ) {
- if ( this.getValue() )
- selectedTable.setAttribute( 'cellPadding', this.getValue() );
- else
- selectedTable.removeAttribute( 'cellPadding' );
- }
- }
- ]
- }
- ]
- },
- {
- type: 'html',
- align: 'right',
- html: ''
- },
- {
- type: 'vbox',
- padding: 0,
- children: [
- {
- type: 'text',
- id: 'txtCaption',
- requiredContent: 'caption',
- label: editor.lang.table.caption,
- setup: function( selectedTable ) {
- this.enable();
-
- var nodeList = selectedTable.getElementsByTag( 'caption' );
- if ( nodeList.count() > 0 ) {
- var caption = nodeList.getItem( 0 );
- var firstElementChild = caption.getFirst( CKEDITOR.dom.walker.nodeType( CKEDITOR.NODE_ELEMENT ) );
-
- if ( firstElementChild && !firstElementChild.equals( caption.getBogus() ) ) {
- this.disable();
- this.setValue( caption.getText() );
- return;
- }
-
- caption = CKEDITOR.tools.trim( caption.getText() );
- this.setValue( caption );
- }
- },
- commit: function( data, table ) {
- if ( !this.isEnabled() )
- return;
-
- var caption = this.getValue(),
- captionElement = table.getElementsByTag( 'caption' );
- if ( caption ) {
- if ( captionElement.count() > 0 ) {
- captionElement = captionElement.getItem( 0 );
- captionElement.setHtml( '' );
- } else {
- captionElement = new CKEDITOR.dom.element( 'caption', editor.document );
- if ( table.getChildCount() )
- captionElement.insertBefore( table.getFirst() );
- else
- captionElement.appendTo( table );
- }
- captionElement.append( new CKEDITOR.dom.text( caption, editor.document ) );
- } else if ( captionElement.count() > 0 ) {
- for ( var i = captionElement.count() - 1; i >= 0; i-- )
- captionElement.getItem( i ).remove();
- }
- }
- },
- {
- type: 'text',
- id: 'txtSummary',
- requiredContent: 'table[summary]',
- label: editor.lang.table.summary,
- setup: function( selectedTable ) {
- this.setValue( selectedTable.getAttribute( 'summary' ) || '' );
- },
- commit: function( data, selectedTable ) {
- if ( this.getValue() )
- selectedTable.setAttribute( 'summary', this.getValue() );
- else
- selectedTable.removeAttribute( 'summary' );
- }
- }
- ]
- }
- ]
- },
- dialogadvtab && dialogadvtab.createAdvancedTab( editor, null, 'table' )
- ]
- };
- }
-
- CKEDITOR.dialog.add( 'table', function( editor ) {
- return tableDialog( editor, 'table' );
- });
- CKEDITOR.dialog.add( 'tableProperties', function( editor ) {
- return tableDialog( editor, 'tableProperties' );
- });
-})();
+/*
+ Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ For licensing, see LICENSE.md or http://ckeditor.com/license
+*/
+(function(){function r(a){for(var e=0,l=0,k=0,m,g=a.$.rows.length;k<g;k++){m=a.$.rows[k];for(var d=e=0,c,b=m.cells.length;d<b;d++)c=m.cells[d],e+=c.colSpan;e>l&&(l=e)}return l}function o(a){return function(){var e=this.getValue(),e=!!(CKEDITOR.dialog.validate.integer()(e)&&0<e);e||(alert(a),this.select());return e}}function n(a,e){var l=function(g){return new CKEDITOR.dom.element(g,a.document)},n=a.editable(),m=a.plugins.dialogadvtab;return{title:a.lang.table.title,minWidth:310,minHeight:CKEDITOR.env.ie?
+310:280,onLoad:function(){var g=this,a=g.getContentElement("advanced","advStyles");if(a)a.on("change",function(){var a=this.getStyle("width",""),b=g.getContentElement("info","txtWidth");b&&b.setValue(a,!0);a=this.getStyle("height","");(b=g.getContentElement("info","txtHeight"))&&b.setValue(a,!0)})},onShow:function(){var g=a.getSelection(),d=g.getRanges(),c,b=this.getContentElement("info","txtRows"),h=this.getContentElement("info","txtCols"),p=this.getContentElement("info","txtWidth"),f=this.getContentElement("info",
+"txtHeight");"tableProperties"==e&&((g=g.getSelectedElement())&&g.is("table")?c=g:0<d.length&&(CKEDITOR.env.webkit&&d[0].shrink(CKEDITOR.NODE_ELEMENT),c=a.elementPath(d[0].getCommonAncestor(!0)).contains("table",1)),this._.selectedElement=c);c?(this.setupContent(c),b&&b.disable(),h&&h.disable()):(b&&b.enable(),h&&h.enable());p&&p.onChange();f&&f.onChange()},onOk:function(){var g=a.getSelection(),d=this._.selectedElement&&g.createBookmarks(),c=this._.selectedElement||l("table"),b={};this.commitContent(b,
+c);if(b.info){b=b.info;if(!this._.selectedElement)for(var h=c.append(l("tbody")),e=parseInt(b.txtRows,10)||0,f=parseInt(b.txtCols,10)||0,i=0;i<e;i++)for(var j=h.append(l("tr")),k=0;k<f;k++)j.append(l("td")).appendBogus();e=b.selHeaders;if(!c.$.tHead&&("row"==e||"both"==e)){j=new CKEDITOR.dom.element(c.$.createTHead());h=c.getElementsByTag("tbody").getItem(0);h=h.getElementsByTag("tr").getItem(0);for(i=0;i<h.getChildCount();i++)f=h.getChild(i),f.type==CKEDITOR.NODE_ELEMENT&&!f.data("cke-bookmark")&&
+(f.renameNode("th"),f.setAttribute("scope","col"));j.append(h.remove())}if(null!==c.$.tHead&&!("row"==e||"both"==e)){j=new CKEDITOR.dom.element(c.$.tHead);h=c.getElementsByTag("tbody").getItem(0);for(k=h.getFirst();0<j.getChildCount();){h=j.getFirst();for(i=0;i<h.getChildCount();i++)f=h.getChild(i),f.type==CKEDITOR.NODE_ELEMENT&&(f.renameNode("td"),f.removeAttribute("scope"));h.insertBefore(k)}j.remove()}if(!this.hasColumnHeaders&&("col"==e||"both"==e))for(j=0;j<c.$.rows.length;j++)f=new CKEDITOR.dom.element(c.$.rows[j].cells[0]),
+f.renameNode("th"),f.setAttribute("scope","row");if(this.hasColumnHeaders&&!("col"==e||"both"==e))for(i=0;i<c.$.rows.length;i++)j=new CKEDITOR.dom.element(c.$.rows[i]),"tbody"==j.getParent().getName()&&(f=new CKEDITOR.dom.element(j.$.cells[0]),f.renameNode("td"),f.removeAttribute("scope"));b.txtHeight?c.setStyle("height",b.txtHeight):c.removeStyle("height");b.txtWidth?c.setStyle("width",b.txtWidth):c.removeStyle("width");c.getAttribute("style")||c.removeAttribute("style")}if(this._.selectedElement)try{g.selectBookmarks(d)}catch(m){}else a.insertElement(c),
+setTimeout(function(){var g=new CKEDITOR.dom.element(c.$.rows[0].cells[0]),b=a.createRange();b.moveToPosition(g,CKEDITOR.POSITION_AFTER_START);b.select()},0)},contents:[{id:"info",label:a.lang.table.title,elements:[{type:"hbox",widths:[null,null],styles:["vertical-align:top"],children:[{type:"vbox",padding:0,children:[{type:"text",id:"txtRows","default":3,label:a.lang.table.rows,required:!0,controlStyle:"width:5em",validate:o(a.lang.table.invalidRows),setup:function(a){this.setValue(a.$.rows.length)},
+commit:k},{type:"text",id:"txtCols","default":2,label:a.lang.table.columns,required:!0,controlStyle:"width:5em",validate:o(a.lang.table.invalidCols),setup:function(a){this.setValue(r(a))},commit:k},{type:"html",html:"&nbsp;"},{type:"select",id:"selHeaders",requiredContent:"th","default":"",label:a.lang.table.headers,items:[[a.lang.table.headersNone,""],[a.lang.table.headersRow,"row"],[a.lang.table.headersColumn,"col"],[a.lang.table.headersBoth,"both"]],setup:function(a){var d=this.getDialog();d.hasColumnHeaders=
+!0;for(var c=0;c<a.$.rows.length;c++){var b=a.$.rows[c].cells[0];if(b&&"th"!=b.nodeName.toLowerCase()){d.hasColumnHeaders=!1;break}}null!==a.$.tHead?this.setValue(d.hasColumnHeaders?"both":"row"):this.setValue(d.hasColumnHeaders?"col":"")},commit:k},{type:"text",id:"txtBorder",requiredContent:"table[border]","default":a.filter.check("table[border]")?1:0,label:a.lang.table.border,controlStyle:"width:3em",validate:CKEDITOR.dialog.validate.number(a.lang.table.invalidBorder),setup:function(a){this.setValue(a.getAttribute("border")||
+"")},commit:function(a,d){this.getValue()?d.setAttribute("border",this.getValue()):d.removeAttribute("border")}},{id:"cmbAlign",type:"select",requiredContent:"table[align]","default":"",label:a.lang.common.align,items:[[a.lang.common.notSet,""],[a.lang.common.alignLeft,"left"],[a.lang.common.alignCenter,"center"],[a.lang.common.alignRight,"right"]],setup:function(a){this.setValue(a.getAttribute("align")||"")},commit:function(a,d){this.getValue()?d.setAttribute("align",this.getValue()):d.removeAttribute("align")}}]},
+{type:"vbox",padding:0,children:[{type:"hbox",widths:["5em"],children:[{type:"text",id:"txtWidth",requiredContent:"table{width}",controlStyle:"width:5em",label:a.lang.common.width,title:a.lang.common.cssLengthTooltip,"default":a.filter.check("table{width}")?500>n.getSize("width")?"100%":500:0,getValue:q,validate:CKEDITOR.dialog.validate.cssLength(a.lang.common.invalidCssLength.replace("%1",a.lang.common.width)),onChange:function(){var a=this.getDialog().getContentElement("advanced","advStyles");a&&
+a.updateStyle("width",this.getValue())},setup:function(a){this.setValue(a.getStyle("width"))},commit:k}]},{type:"hbox",widths:["5em"],children:[{type:"text",id:"txtHeight",requiredContent:"table{height}",controlStyle:"width:5em",label:a.lang.common.height,title:a.lang.common.cssLengthTooltip,"default":"",getValue:q,validate:CKEDITOR.dialog.validate.cssLength(a.lang.common.invalidCssLength.replace("%1",a.lang.common.height)),onChange:function(){var a=this.getDialog().getContentElement("advanced","advStyles");
+a&&a.updateStyle("height",this.getValue())},setup:function(a){(a=a.getStyle("height"))&&this.setValue(a)},commit:k}]},{type:"html",html:"&nbsp;"},{type:"text",id:"txtCellSpace",requiredContent:"table[cellspacing]",controlStyle:"width:3em",label:a.lang.table.cellSpace,"default":a.filter.check("table[cellspacing]")?1:0,validate:CKEDITOR.dialog.validate.number(a.lang.table.invalidCellSpacing),setup:function(a){this.setValue(a.getAttribute("cellSpacing")||"")},commit:function(a,d){this.getValue()?d.setAttribute("cellSpacing",
+this.getValue()):d.removeAttribute("cellSpacing")}},{type:"text",id:"txtCellPad",requiredContent:"table[cellpadding]",controlStyle:"width:3em",label:a.lang.table.cellPad,"default":a.filter.check("table[cellpadding]")?1:0,validate:CKEDITOR.dialog.validate.number(a.lang.table.invalidCellPadding),setup:function(a){this.setValue(a.getAttribute("cellPadding")||"")},commit:function(a,d){this.getValue()?d.setAttribute("cellPadding",this.getValue()):d.removeAttribute("cellPadding")}}]}]},{type:"html",align:"right",
+html:""},{type:"vbox",padding:0,children:[{type:"text",id:"txtCaption",requiredContent:"caption",label:a.lang.table.caption,setup:function(a){this.enable();a=a.getElementsByTag("caption");if(0<a.count()){var a=a.getItem(0),d=a.getFirst(CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT));d&&!d.equals(a.getBogus())?(this.disable(),this.setValue(a.getText())):(a=CKEDITOR.tools.trim(a.getText()),this.setValue(a))}},commit:function(e,d){if(this.isEnabled()){var c=this.getValue(),b=d.getElementsByTag("caption");
+if(c)0<b.count()?(b=b.getItem(0),b.setHtml("")):(b=new CKEDITOR.dom.element("caption",a.document),d.getChildCount()?b.insertBefore(d.getFirst()):b.appendTo(d)),b.append(new CKEDITOR.dom.text(c,a.document));else if(0<b.count())for(c=b.count()-1;0<=c;c--)b.getItem(c).remove()}}},{type:"text",id:"txtSummary",requiredContent:"table[summary]",label:a.lang.table.summary,setup:function(a){this.setValue(a.getAttribute("summary")||"")},commit:function(a,d){this.getValue()?d.setAttribute("summary",this.getValue()):
+d.removeAttribute("summary")}}]}]},m&&m.createAdvancedTab(a,null,"table")]}}var q=CKEDITOR.tools.cssLength,k=function(a){var e=this.id;a.info||(a.info={});a.info[e]=this.getValue()};CKEDITOR.dialog.add("table",function(a){return n(a,"table")});CKEDITOR.dialog.add("tableProperties",function(a){return n(a,"tableProperties")})})(); \ No newline at end of file
diff --git a/plugins/tabletools/dialogs/tableCell.js b/plugins/tabletools/dialogs/tableCell.js
index fff7e0e..a328cc9 100644..100755
--- a/plugins/tabletools/dialogs/tableCell.js
+++ b/plugins/tabletools/dialogs/tableCell.js
@@ -1,418 +1,16 @@
-/**
- * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.html or http://ckeditor.com/license
- */
-
-CKEDITOR.dialog.add( 'cellProperties', function( editor ) {
- var langTable = editor.lang.table,
- langCell = langTable.cell,
- langCommon = editor.lang.common,
- validate = CKEDITOR.dialog.validate,
- widthPattern = /^(\d+(?:\.\d+)?)(px|%)$/,
- heightPattern = /^(\d+(?:\.\d+)?)px$/,
- bind = CKEDITOR.tools.bind,
- spacer = { type: 'html', html: '&nbsp;' },
- rtl = editor.lang.dir == 'rtl',
- colorDialog = editor.plugins.colordialog;
-
- return {
- title: langCell.title,
- minWidth: CKEDITOR.env.ie && CKEDITOR.env.quirks ? 450 : 410,
- minHeight: CKEDITOR.env.ie && ( CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks ) ? 230 : 220,
- contents: [
- {
- id: 'info',
- label: langCell.title,
- accessKey: 'I',
- elements: [
- {
- type: 'hbox',
- widths: [ '40%', '5%', '40%' ],
- children: [
- {
- type: 'vbox',
- padding: 0,
- children: [
- {
- type: 'hbox',
- widths: [ '70%', '30%' ],
- children: [
- {
- type: 'text',
- id: 'width',
- width: '100px',
- label: langCommon.width,
- validate: validate[ 'number' ]( langCell.invalidWidth ),
-
- // Extra labelling of width unit type.
- onLoad: function() {
- var widthType = this.getDialog().getContentElement( 'info', 'widthType' ),
- labelElement = widthType.getElement(),
- inputElement = this.getInputElement(),
- ariaLabelledByAttr = inputElement.getAttribute( 'aria-labelledby' );
-
- inputElement.setAttribute( 'aria-labelledby', [ ariaLabelledByAttr, labelElement.$.id ].join( ' ' ) );
- },
-
- setup: function( element ) {
- var widthAttr = parseInt( element.getAttribute( 'width' ), 10 ),
- widthStyle = parseInt( element.getStyle( 'width' ), 10 );
-
- !isNaN( widthAttr ) && this.setValue( widthAttr );
- !isNaN( widthStyle ) && this.setValue( widthStyle );
- },
- commit: function( element ) {
- var value = parseInt( this.getValue(), 10 ),
- unit = this.getDialog().getValueOf( 'info', 'widthType' );
-
- if ( !isNaN( value ) )
- element.setStyle( 'width', value + unit );
- else
- element.removeStyle( 'width' );
-
- element.removeAttribute( 'width' );
- },
- 'default': ''
- },
- {
- type: 'select',
- id: 'widthType',
- label: editor.lang.table.widthUnit,
- labelStyle: 'visibility:hidden',
- 'default': 'px',
- items: [
- [ langTable.widthPx, 'px' ],
- [ langTable.widthPc, '%' ]
- ],
- setup: function( selectedCell ) {
- var widthMatch = widthPattern.exec( selectedCell.getStyle( 'width' ) || selectedCell.getAttribute( 'width' ) );
- if ( widthMatch )
- this.setValue( widthMatch[ 2 ] );
- }
- }
- ]
- },
- {
- type: 'hbox',
- widths: [ '70%', '30%' ],
- children: [
- {
- type: 'text',
- id: 'height',
- label: langCommon.height,
- width: '100px',
- 'default': '',
- validate: validate[ 'number' ]( langCell.invalidHeight ),
-
- // Extra labelling of height unit type.
- onLoad: function() {
- var heightType = this.getDialog().getContentElement( 'info', 'htmlHeightType' ),
- labelElement = heightType.getElement(),
- inputElement = this.getInputElement(),
- ariaLabelledByAttr = inputElement.getAttribute( 'aria-labelledby' );
-
- inputElement.setAttribute( 'aria-labelledby', [ ariaLabelledByAttr, labelElement.$.id ].join( ' ' ) );
- },
-
- setup: function( element ) {
- var heightAttr = parseInt( element.getAttribute( 'height' ), 10 ),
- heightStyle = parseInt( element.getStyle( 'height' ), 10 );
-
- !isNaN( heightAttr ) && this.setValue( heightAttr );
- !isNaN( heightStyle ) && this.setValue( heightStyle );
- },
- commit: function( element ) {
- var value = parseInt( this.getValue(), 10 );
-
- if ( !isNaN( value ) )
- element.setStyle( 'height', CKEDITOR.tools.cssLength( value ) );
- else
- element.removeStyle( 'height' );
-
- element.removeAttribute( 'height' );
- }
- },
- {
- id: 'htmlHeightType',
- type: 'html',
- html: '<br />' + langTable.widthPx
- }
- ]
- },
- spacer,
- {
- type: 'select',
- id: 'wordWrap',
- label: langCell.wordWrap,
- 'default': 'yes',
- items: [
- [ langCell.yes, 'yes' ],
- [ langCell.no, 'no' ]
- ],
- setup: function( element ) {
- var wordWrapAttr = element.getAttribute( 'noWrap' ),
- wordWrapStyle = element.getStyle( 'white-space' );
-
- if ( wordWrapStyle == 'nowrap' || wordWrapAttr )
- this.setValue( 'no' );
- },
- commit: function( element ) {
- if ( this.getValue() == 'no' )
- element.setStyle( 'white-space', 'nowrap' );
- else
- element.removeStyle( 'white-space' );
-
- element.removeAttribute( 'noWrap' );
- }
- },
- spacer,
- {
- type: 'select',
- id: 'hAlign',
- label: langCell.hAlign,
- 'default': '',
- items: [
- [ langCommon.notSet, '' ],
- [ langCommon.alignLeft, 'left' ],
- [ langCommon.alignCenter, 'center' ],
- [ langCommon.alignRight, 'right' ]
- ],
- setup: function( element ) {
- var alignAttr = element.getAttribute( 'align' ),
- textAlignStyle = element.getStyle( 'text-align' );
-
- this.setValue( textAlignStyle || alignAttr || '' );
- },
- commit: function( selectedCell ) {
- var value = this.getValue();
-
- if ( value )
- selectedCell.setStyle( 'text-align', value );
- else
- selectedCell.removeStyle( 'text-align' );
-
- selectedCell.removeAttribute( 'align' );
- }
- },
- {
- type: 'select',
- id: 'vAlign',
- label: langCell.vAlign,
- 'default': '',
- items: [
- [ langCommon.notSet, '' ],
- [ langCommon.alignTop, 'top' ],
- [ langCommon.alignMiddle, 'middle' ],
- [ langCommon.alignBottom, 'bottom' ],
- [ langCell.alignBaseline, 'baseline' ]
- ],
- setup: function( element ) {
- var vAlignAttr = element.getAttribute( 'vAlign' ),
- vAlignStyle = element.getStyle( 'vertical-align' );
-
- switch ( vAlignStyle ) {
- // Ignore all other unrelated style values..
- case 'top':
- case 'middle':
- case 'bottom':
- case 'baseline':
- break;
- default:
- vAlignStyle = '';
- }
-
- this.setValue( vAlignStyle || vAlignAttr || '' );
- },
- commit: function( element ) {
- var value = this.getValue();
-
- if ( value )
- element.setStyle( 'vertical-align', value );
- else
- element.removeStyle( 'vertical-align' );
-
- element.removeAttribute( 'vAlign' );
- }
- }
- ]
- },
- spacer,
- {
- type: 'vbox',
- padding: 0,
- children: [
- {
- type: 'select',
- id: 'cellType',
- label: langCell.cellType,
- 'default': 'td',
- items: [
- [ langCell.data, 'td' ],
- [ langCell.header, 'th' ]
- ],
- setup: function( selectedCell ) {
- this.setValue( selectedCell.getName() );
- },
- commit: function( selectedCell ) {
- selectedCell.renameNode( this.getValue() );
- }
- },
- spacer,
- {
- type: 'text',
- id: 'rowSpan',
- label: langCell.rowSpan,
- 'default': '',
- validate: validate.integer( langCell.invalidRowSpan ),
- setup: function( selectedCell ) {
- var attrVal = parseInt( selectedCell.getAttribute( 'rowSpan' ), 10 );
- if ( attrVal && attrVal != 1 )
- this.setValue( attrVal );
- },
- commit: function( selectedCell ) {
- var value = parseInt( this.getValue(), 10 );
- if ( value && value != 1 )
- selectedCell.setAttribute( 'rowSpan', this.getValue() );
- else
- selectedCell.removeAttribute( 'rowSpan' );
- }
- },
- {
- type: 'text',
- id: 'colSpan',
- label: langCell.colSpan,
- 'default': '',
- validate: validate.integer( langCell.invalidColSpan ),
- setup: function( element ) {
- var attrVal = parseInt( element.getAttribute( 'colSpan' ), 10 );
- if ( attrVal && attrVal != 1 )
- this.setValue( attrVal );
- },
- commit: function( selectedCell ) {
- var value = parseInt( this.getValue(), 10 );
- if ( value && value != 1 )
- selectedCell.setAttribute( 'colSpan', this.getValue() );
- else
- selectedCell.removeAttribute( 'colSpan' );
- }
- },
- spacer,
- {
- type: 'hbox',
- padding: 0,
- widths: [ '60%', '40%' ],
- children: [
- {
- type: 'text',
- id: 'bgColor',
- label: langCell.bgColor,
- 'default': '',
- setup: function( element ) {
- var bgColorAttr = element.getAttribute( 'bgColor' ),
- bgColorStyle = element.getStyle( 'background-color' );
-
- this.setValue( bgColorStyle || bgColorAttr );
- },
- commit: function( selectedCell ) {
- var value = this.getValue();
-
- if ( value )
- selectedCell.setStyle( 'background-color', this.getValue() );
- else
- selectedCell.removeStyle( 'background-color' );
-
- selectedCell.removeAttribute( 'bgColor' );
- }
- },
- colorDialog ? {
- type: 'button',
- id: 'bgColorChoose',
- "class": 'colorChooser',
- label: langCell.chooseColor,
- onLoad: function() {
- // Stick the element to the bottom (#5587)
- this.getElement().getParent().setStyle( 'vertical-align', 'bottom' );
- },
- onClick: function() {
- editor.getColorFromDialog( function( color ) {
- if ( color )
- this.getDialog().getContentElement( 'info', 'bgColor' ).setValue( color );
- this.focus();
- }, this );
- }
- } : spacer
- ]
- },
- spacer,
- {
- type: 'hbox',
- padding: 0,
- widths: [ '60%', '40%' ],
- children: [
- {
- type: 'text',
- id: 'borderColor',
- label: langCell.borderColor,
- 'default': '',
- setup: function( element ) {
- var borderColorAttr = element.getAttribute( 'borderColor' ),
- borderColorStyle = element.getStyle( 'border-color' );
-
- this.setValue( borderColorStyle || borderColorAttr );
- },
- commit: function( selectedCell ) {
- var value = this.getValue();
- if ( value )
- selectedCell.setStyle( 'border-color', this.getValue() );
- else
- selectedCell.removeStyle( 'border-color' );
-
- selectedCell.removeAttribute( 'borderColor' );
- }
- },
-
- colorDialog ? {
- type: 'button',
- id: 'borderColorChoose',
- "class": 'colorChooser',
- label: langCell.chooseColor,
- style: ( rtl ? 'margin-right' : 'margin-left' ) + ': 10px',
- onLoad: function() {
- // Stick the element to the bottom (#5587)
- this.getElement().getParent().setStyle( 'vertical-align', 'bottom' );
- },
- onClick: function() {
- editor.getColorFromDialog( function( color ) {
- if ( color )
- this.getDialog().getContentElement( 'info', 'borderColor' ).setValue( color );
- this.focus();
- }, this );
- }
- } : spacer
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ],
- onShow: function() {
- this.cells = CKEDITOR.plugins.tabletools.getSelectedCells( this._.editor.getSelection() );
- this.setupContent( this.cells[ 0 ] );
- },
- onOk: function() {
- var selection = this._.editor.getSelection(),
- bookmarks = selection.createBookmarks();
-
- var cells = this.cells;
- for ( var i = 0; i < cells.length; i++ )
- this.commitContent( cells[ i ] );
-
- this._.editor.forceNextSelectionCheck();
- selection.selectBookmarks( bookmarks );
- this._.editor.selectionChange();
- }
- };
-});
+/*
+ Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ For licensing, see LICENSE.md or http://ckeditor.com/license
+*/
+CKEDITOR.dialog.add("cellProperties",function(f){var g=f.lang.table,c=g.cell,d=f.lang.common,h=CKEDITOR.dialog.validate,j=/^(\d+(?:\.\d+)?)(px|%)$/,e={type:"html",html:"&nbsp;"},k="rtl"==f.lang.dir,i=f.plugins.colordialog;return{title:c.title,minWidth:CKEDITOR.env.ie&&CKEDITOR.env.quirks?450:410,minHeight:CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?230:220,contents:[{id:"info",label:c.title,accessKey:"I",elements:[{type:"hbox",widths:["40%","5%","40%"],children:[{type:"vbox",padding:0,
+children:[{type:"hbox",widths:["70%","30%"],children:[{type:"text",id:"width",width:"100px",label:d.width,validate:h.number(c.invalidWidth),onLoad:function(){var a=this.getDialog().getContentElement("info","widthType").getElement(),b=this.getInputElement(),c=b.getAttribute("aria-labelledby");b.setAttribute("aria-labelledby",[c,a.$.id].join(" "))},setup:function(a){var b=parseInt(a.getAttribute("width"),10),a=parseInt(a.getStyle("width"),10);!isNaN(b)&&this.setValue(b);!isNaN(a)&&this.setValue(a)},
+commit:function(a){var b=parseInt(this.getValue(),10),c=this.getDialog().getValueOf("info","widthType");isNaN(b)?a.removeStyle("width"):a.setStyle("width",b+c);a.removeAttribute("width")},"default":""},{type:"select",id:"widthType",label:f.lang.table.widthUnit,labelStyle:"visibility:hidden","default":"px",items:[[g.widthPx,"px"],[g.widthPc,"%"]],setup:function(a){(a=j.exec(a.getStyle("width")||a.getAttribute("width")))&&this.setValue(a[2])}}]},{type:"hbox",widths:["70%","30%"],children:[{type:"text",
+id:"height",label:d.height,width:"100px","default":"",validate:h.number(c.invalidHeight),onLoad:function(){var a=this.getDialog().getContentElement("info","htmlHeightType").getElement(),b=this.getInputElement(),c=b.getAttribute("aria-labelledby");b.setAttribute("aria-labelledby",[c,a.$.id].join(" "))},setup:function(a){var b=parseInt(a.getAttribute("height"),10),a=parseInt(a.getStyle("height"),10);!isNaN(b)&&this.setValue(b);!isNaN(a)&&this.setValue(a)},commit:function(a){var b=parseInt(this.getValue(),
+10);isNaN(b)?a.removeStyle("height"):a.setStyle("height",CKEDITOR.tools.cssLength(b));a.removeAttribute("height")}},{id:"htmlHeightType",type:"html",html:"<br />"+g.widthPx}]},e,{type:"select",id:"wordWrap",label:c.wordWrap,"default":"yes",items:[[c.yes,"yes"],[c.no,"no"]],setup:function(a){var b=a.getAttribute("noWrap");("nowrap"==a.getStyle("white-space")||b)&&this.setValue("no")},commit:function(a){"no"==this.getValue()?a.setStyle("white-space","nowrap"):a.removeStyle("white-space");a.removeAttribute("noWrap")}},
+e,{type:"select",id:"hAlign",label:c.hAlign,"default":"",items:[[d.notSet,""],[d.alignLeft,"left"],[d.alignCenter,"center"],[d.alignRight,"right"]],setup:function(a){var b=a.getAttribute("align");this.setValue(a.getStyle("text-align")||b||"")},commit:function(a){var b=this.getValue();b?a.setStyle("text-align",b):a.removeStyle("text-align");a.removeAttribute("align")}},{type:"select",id:"vAlign",label:c.vAlign,"default":"",items:[[d.notSet,""],[d.alignTop,"top"],[d.alignMiddle,"middle"],[d.alignBottom,
+"bottom"],[c.alignBaseline,"baseline"]],setup:function(a){var b=a.getAttribute("vAlign"),a=a.getStyle("vertical-align");switch(a){case "top":case "middle":case "bottom":case "baseline":break;default:a=""}this.setValue(a||b||"")},commit:function(a){var b=this.getValue();b?a.setStyle("vertical-align",b):a.removeStyle("vertical-align");a.removeAttribute("vAlign")}}]},e,{type:"vbox",padding:0,children:[{type:"select",id:"cellType",label:c.cellType,"default":"td",items:[[c.data,"td"],[c.header,"th"]],
+setup:function(a){this.setValue(a.getName())},commit:function(a){a.renameNode(this.getValue())}},e,{type:"text",id:"rowSpan",label:c.rowSpan,"default":"",validate:h.integer(c.invalidRowSpan),setup:function(a){(a=parseInt(a.getAttribute("rowSpan"),10))&&1!=a&&this.setValue(a)},commit:function(a){var b=parseInt(this.getValue(),10);b&&1!=b?a.setAttribute("rowSpan",this.getValue()):a.removeAttribute("rowSpan")}},{type:"text",id:"colSpan",label:c.colSpan,"default":"",validate:h.integer(c.invalidColSpan),
+setup:function(a){(a=parseInt(a.getAttribute("colSpan"),10))&&1!=a&&this.setValue(a)},commit:function(a){var b=parseInt(this.getValue(),10);b&&1!=b?a.setAttribute("colSpan",this.getValue()):a.removeAttribute("colSpan")}},e,{type:"hbox",padding:0,widths:["60%","40%"],children:[{type:"text",id:"bgColor",label:c.bgColor,"default":"",setup:function(a){var b=a.getAttribute("bgColor");this.setValue(a.getStyle("background-color")||b)},commit:function(a){this.getValue()?a.setStyle("background-color",this.getValue()):
+a.removeStyle("background-color");a.removeAttribute("bgColor")}},i?{type:"button",id:"bgColorChoose","class":"colorChooser",label:c.chooseColor,onLoad:function(){this.getElement().getParent().setStyle("vertical-align","bottom")},onClick:function(){f.getColorFromDialog(function(a){a&&this.getDialog().getContentElement("info","bgColor").setValue(a);this.focus()},this)}}:e]},e,{type:"hbox",padding:0,widths:["60%","40%"],children:[{type:"text",id:"borderColor",label:c.borderColor,"default":"",setup:function(a){var b=
+a.getAttribute("borderColor");this.setValue(a.getStyle("border-color")||b)},commit:function(a){this.getValue()?a.setStyle("border-color",this.getValue()):a.removeStyle("border-color");a.removeAttribute("borderColor")}},i?{type:"button",id:"borderColorChoose","class":"colorChooser",label:c.chooseColor,style:(k?"margin-right":"margin-left")+": 10px",onLoad:function(){this.getElement().getParent().setStyle("vertical-align","bottom")},onClick:function(){f.getColorFromDialog(function(a){a&&this.getDialog().getContentElement("info",
+"borderColor").setValue(a);this.focus()},this)}}:e]}]}]}]}],onShow:function(){this.cells=CKEDITOR.plugins.tabletools.getSelectedCells(this._.editor.getSelection());this.setupContent(this.cells[0])},onOk:function(){for(var a=this._.editor.getSelection(),b=a.createBookmarks(),c=this.cells,d=0;d<c.length;d++)this.commitContent(c[d]);this._.editor.forceNextSelectionCheck();a.selectBookmarks(b);this._.editor.selectionChange()}}}); \ No newline at end of file
diff --git a/plugins/templates/dialogs/templates.css b/plugins/templates/dialogs/templates.css
index e226d79..dcb79e5 100644..100755
--- a/plugins/templates/dialogs/templates.css
+++ b/plugins/templates/dialogs/templates.css
@@ -1,6 +1,6 @@
/*
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
-For licensing, see LICENSE.html or http://ckeditor.com/license
+For licensing, see LICENSE.md or http://ckeditor.com/license
*/
.cke_tpl_list
diff --git a/plugins/templates/dialogs/templates.js b/plugins/templates/dialogs/templates.js
index 8b3b70f..4867aca 100644..100755
--- a/plugins/templates/dialogs/templates.js
+++ b/plugins/templates/dialogs/templates.js
@@ -1,203 +1,10 @@
-/**
- * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.html or http://ckeditor.com/license
- */
-
-(function() {
- var doc = CKEDITOR.document;
-
- CKEDITOR.dialog.add( 'templates', function( editor ) {
- // Constructs the HTML view of the specified templates data.
- function renderTemplatesList( container, templatesDefinitions ) {
- // clear loading wait text.
- container.setHtml( '' );
-
- for ( var i = 0, totalDefs = templatesDefinitions.length; i < totalDefs; i++ ) {
- var definition = CKEDITOR.getTemplates( templatesDefinitions[ i ] ),
- imagesPath = definition.imagesPath,
- templates = definition.templates,
- count = templates.length;
-
- for ( var j = 0; j < count; j++ ) {
- var template = templates[ j ],
- item = createTemplateItem( template, imagesPath );
- item.setAttribute( 'aria-posinset', j + 1 );
- item.setAttribute( 'aria-setsize', count );
- container.append( item );
- }
- }
- }
-
- function createTemplateItem( template, imagesPath ) {
- var item = CKEDITOR.dom.element.createFromHtml( '<a href="javascript:void(0)" tabIndex="-1" role="option" >' +
- '<div class="cke_tpl_item"></div>' +
- '</a>' );
-
- // Build the inner HTML of our new item DIV.
- var html = '<table style="width:350px;" class="cke_tpl_preview" role="presentation"><tr>';
-
- if ( template.image && imagesPath )
- html += '<td class="cke_tpl_preview_img"><img src="' + CKEDITOR.getUrl( imagesPath + template.image ) + '"' + ( CKEDITOR.env.ie6Compat ? ' onload="this.width=this.width"' : '' ) + ' alt="" title=""></td>';
-
- html += '<td style="white-space:normal;"><span class="cke_tpl_title">' + template.title + '</span><br/>';
-
- if ( template.description )
- html += '<span>' + template.description + '</span>';
-
- html += '</td></tr></table>';
-
- item.getFirst().setHtml( html );
-
- item.on( 'click', function() {
- insertTemplate( template.html );
- });
-
- return item;
- }
-
- // Insert the specified template content into editor.
- // @param {Number} index
- function insertTemplate( html ) {
- var dialog = CKEDITOR.dialog.getCurrent(),
- isReplace = dialog.getValueOf( 'selectTpl', 'chkInsertOpt' );
-
- if ( isReplace ) {
- editor.fire( 'saveSnapshot' );
- // Everything should happen after the document is loaded (#4073).
- editor.setData( html, function() {
- dialog.hide();
-
- // Place the cursor at the first editable place.
- var range = editor.createRange();
- range.moveToElementEditStart( editor.editable() );
- range.select();
- setTimeout( function() {
- editor.fire( 'saveSnapshot' );
- }, 0 );
-
- } );
- } else {
- editor.insertHtml( html );
- dialog.hide();
- }
- }
-
- function keyNavigation( evt ) {
- var target = evt.data.getTarget(),
- onList = listContainer.equals( target );
-
- // Keyboard navigation for template list.
- if ( onList || listContainer.contains( target ) ) {
- var keystroke = evt.data.getKeystroke(),
- items = listContainer.getElementsByTag( 'a' ),
- focusItem;
-
- if ( items ) {
- // Focus not yet onto list items?
- if ( onList )
- focusItem = items.getItem( 0 );
- else {
- switch ( keystroke ) {
- case 40: // ARROW-DOWN
- focusItem = target.getNext();
- break;
-
- case 38: // ARROW-UP
- focusItem = target.getPrevious();
- break;
-
- case 13: // ENTER
- case 32: // SPACE
- target.fire( 'click' );
- }
- }
-
- if ( focusItem ) {
- focusItem.focus();
- evt.data.preventDefault();
- }
- }
- }
- }
-
- // Load skin at first.
- var plugin = CKEDITOR.plugins.get( 'templates' );
- CKEDITOR.document.appendStyleSheet( CKEDITOR.getUrl( plugin.path + 'dialogs/templates.css' ) );
-
-
- var listContainer;
-
- var templateListLabelId = 'cke_tpl_list_label_' + CKEDITOR.tools.getNextNumber(),
- lang = editor.lang.templates,
- config = editor.config;
- return {
- title: editor.lang.templates.title,
-
- minWidth: CKEDITOR.env.ie ? 440 : 400,
- minHeight: 340,
-
- contents: [
- {
- id: 'selectTpl',
- label: lang.title,
- elements: [
- {
- type: 'vbox',
- padding: 5,
- children: [
- {
- id: 'selectTplText',
- type: 'html',
- html: '<span>' +
- lang.selectPromptMsg +
- '</span>'
- },
- {
- id: 'templatesList',
- type: 'html',
- focus: true,
- html: '<div class="cke_tpl_list" tabIndex="-1" role="listbox" aria-labelledby="' + templateListLabelId + '">' +
- '<div class="cke_tpl_loading"><span></span></div>' +
- '</div>' +
- '<span class="cke_voice_label" id="' + templateListLabelId + '">' + lang.options + '</span>'
- },
- {
- id: 'chkInsertOpt',
- type: 'checkbox',
- label: lang.insertOption,
- 'default': config.templates_replaceContent
- }
- ]
- }
- ]
- }
- ],
-
- buttons: [ CKEDITOR.dialog.cancelButton ],
-
- onShow: function() {
- var templatesListField = this.getContentElement( 'selectTpl', 'templatesList' );
- listContainer = templatesListField.getElement();
-
- CKEDITOR.loadTemplates( config.templates_files, function() {
- var templates = ( config.templates || 'default' ).split( ',' );
-
- if ( templates.length ) {
- renderTemplatesList( listContainer, templates );
- templatesListField.focus();
- } else {
- listContainer.setHtml( '<div class="cke_tpl_empty">' +
- '<span>' + lang.emptyListMsg + '</span>' +
- '</div>' );
- }
- });
-
- this._.element.on( 'keydown', keyNavigation );
- },
-
- onHide: function() {
- this._.element.removeListener( 'keydown', keyNavigation );
- }
- };
- });
-})();
+/*
+ Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ For licensing, see LICENSE.md or http://ckeditor.com/license
+*/
+(function(){CKEDITOR.dialog.add("templates",function(c){function o(a,b){var k=CKEDITOR.dom.element.createFromHtml('<a href="javascript:void(0)" tabIndex="-1" role="option" ><div class="cke_tpl_item"></div></a>'),d='<table style="width:350px;" class="cke_tpl_preview" role="presentation"><tr>';a.image&&b&&(d+='<td class="cke_tpl_preview_img"><img src="'+CKEDITOR.getUrl(b+a.image)+'"'+(CKEDITOR.env.ie6Compat?' onload="this.width=this.width"':"")+' alt="" title=""></td>');d+='<td style="white-space:normal;"><span class="cke_tpl_title">'+
+a.title+"</span><br/>";a.description&&(d+="<span>"+a.description+"</span>");k.getFirst().setHtml(d+"</td></tr></table>");k.on("click",function(){p(a.html)});return k}function p(a){var b=CKEDITOR.dialog.getCurrent();b.getValueOf("selectTpl","chkInsertOpt")?(c.fire("saveSnapshot"),c.setData(a,function(){b.hide();var a=c.createRange();a.moveToElementEditStart(c.editable());a.select();setTimeout(function(){c.fire("saveSnapshot")},0)})):(c.insertHtml(a),b.hide())}function i(a){var b=a.data.getTarget(),
+c=g.equals(b);if(c||g.contains(b)){var d=a.data.getKeystroke(),f=g.getElementsByTag("a"),e;if(f){if(c)e=f.getItem(0);else switch(d){case 40:e=b.getNext();break;case 38:e=b.getPrevious();break;case 13:case 32:b.fire("click")}e&&(e.focus(),a.data.preventDefault())}}}var h=CKEDITOR.plugins.get("templates");CKEDITOR.document.appendStyleSheet(CKEDITOR.getUrl(h.path+"dialogs/templates.css"));var g,h="cke_tpl_list_label_"+CKEDITOR.tools.getNextNumber(),f=c.lang.templates,l=c.config;return{title:c.lang.templates.title,
+minWidth:CKEDITOR.env.ie?440:400,minHeight:340,contents:[{id:"selectTpl",label:f.title,elements:[{type:"vbox",padding:5,children:[{id:"selectTplText",type:"html",html:"<span>"+f.selectPromptMsg+"</span>"},{id:"templatesList",type:"html",focus:!0,html:'<div class="cke_tpl_list" tabIndex="-1" role="listbox" aria-labelledby="'+h+'"><div class="cke_tpl_loading"><span></span></div></div><span class="cke_voice_label" id="'+h+'">'+f.options+"</span>"},{id:"chkInsertOpt",type:"checkbox",label:f.insertOption,
+"default":l.templates_replaceContent}]}]}],buttons:[CKEDITOR.dialog.cancelButton],onShow:function(){var a=this.getContentElement("selectTpl","templatesList");g=a.getElement();CKEDITOR.loadTemplates(l.templates_files,function(){var b=(l.templates||"default").split(",");if(b.length){var c=g;c.setHtml("");for(var d=0,h=b.length;d<h;d++)for(var e=CKEDITOR.getTemplates(b[d]),i=e.imagesPath,e=e.templates,n=e.length,j=0;j<n;j++){var m=o(e[j],i);m.setAttribute("aria-posinset",j+1);m.setAttribute("aria-setsize",
+n);c.append(m)}a.focus()}else g.setHtml('<div class="cke_tpl_empty"><span>'+f.emptyListMsg+"</span></div>")});this._.element.on("keydown",i)},onHide:function(){this._.element.removeListener("keydown",i)}}})})(); \ No newline at end of file
diff --git a/plugins/templates/templates/default.js b/plugins/templates/templates/default.js
index 7cab991..337f9fc 100644..100755
--- a/plugins/templates/templates/default.js
+++ b/plugins/templates/templates/default.js
@@ -1,88 +1,6 @@
-/**
- * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.html or http://ckeditor.com/license
- */
-
-// Register a templates definition set named "default".
-CKEDITOR.addTemplates( 'default', {
- // The name of sub folder which hold the shortcut preview images of the
- // templates.
- imagesPath: CKEDITOR.getUrl( CKEDITOR.plugins.getPath( 'templates' ) + 'templates/images/' ),
-
- // The templates definitions.
- templates: [
- {
- title: 'Image and Title',
- image: 'template1.gif',
- description: 'One main image with a title and text that surround the image.',
- html: '<h3>' +
- '<img style="margin-right: 10px" height="100" width="100" align="left"/>' +
- 'Type the title here' +
- '</h3>' +
- '<p>' +
- 'Type the text here' +
- '</p>'
- },
- {
- title: 'Strange Template',
- image: 'template2.gif',
- description: 'A template that defines two colums, each one with a title, and some text.',
- html: '<table cellspacing="0" cellpadding="0" style="width:100%" border="0">' +
- '<tr>' +
- '<td style="width:50%">' +
- '<h3>Title 1</h3>' +
- '</td>' +
- '<td></td>' +
- '<td style="width:50%">' +
- '<h3>Title 2</h3>' +
- '</td>' +
- '</tr>' +
- '<tr>' +
- '<td>' +
- 'Text 1' +
- '</td>' +
- '<td></td>' +
- '<td>' +
- 'Text 2' +
- '</td>' +
- '</tr>' +
- '</table>' +
- '<p>' +
- 'More text goes here.' +
- '</p>'
- },
- {
- title: 'Text and Table',
- image: 'template3.gif',
- description: 'A title with some text and a table.',
- html: '<div style="width: 80%">' +
- '<h3>' +
- 'Title goes here' +
- '</h3>' +
- '<table style="width:150px;float: right" cellspacing="0" cellpadding="0" border="1">' +
- '<caption style="border:solid 1px black">' +
- '<strong>Table title</strong>' +
- '</caption>' +
- '<tr>' +
- '<td>&nbsp;</td>' +
- '<td>&nbsp;</td>' +
- '<td>&nbsp;</td>' +
- '</tr>' +
- '<tr>' +
- '<td>&nbsp;</td>' +
- '<td>&nbsp;</td>' +
- '<td>&nbsp;</td>' +
- '</tr>' +
- '<tr>' +
- '<td>&nbsp;</td>' +
- '<td>&nbsp;</td>' +
- '<td>&nbsp;</td>' +
- '</tr>' +
- '</table>' +
- '<p>' +
- 'Type the text here' +
- '</p>' +
- '</div>'
- }
- ]
-});
+/*
+ Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ For licensing, see LICENSE.md or http://ckeditor.com/license
+*/
+CKEDITOR.addTemplates("default",{imagesPath:CKEDITOR.getUrl(CKEDITOR.plugins.getPath("templates")+"templates/images/"),templates:[{title:"Image and Title",image:"template1.gif",description:"One main image with a title and text that surround the image.",html:'<h3><img style="margin-right: 10px" height="100" width="100" align="left"/>Type the title here</h3><p>Type the text here</p>'},{title:"Strange Template",image:"template2.gif",description:"A template that defines two colums, each one with a title, and some text.",
+html:'<table cellspacing="0" cellpadding="0" style="width:100%" border="0"><tr><td style="width:50%"><h3>Title 1</h3></td><td></td><td style="width:50%"><h3>Title 2</h3></td></tr><tr><td>Text 1</td><td></td><td>Text 2</td></tr></table><p>More text goes here.</p>'},{title:"Text and Table",image:"template3.gif",description:"A title with some text and a table.",html:'<div style="width: 80%"><h3>Title goes here</h3><table style="width:150px;float: right" cellspacing="0" cellpadding="0" border="1"><caption style="border:solid 1px black"><strong>Table title</strong></caption><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr></table><p>Type the text here</p></div>'}]}); \ No newline at end of file
diff --git a/plugins/wsc/dialogs/tmp.html b/plugins/wsc/dialogs/tmp.html
index c5e722e..c00d8c2 100644..100755
--- a/plugins/wsc/dialogs/tmp.html
+++ b/plugins/wsc/dialogs/tmp.html
@@ -72,14 +72,11 @@
var manageMessageTmp = new ManagerPostMessage;
- var appString = 'lf/23/unpacked_js/spell.js';
- var toolsString = 'lf/23/js/tools.js';
- var url_version = 0;
-
- var parseUrl = function(){
- var serverUrl = window.location.hash.replace( /^#server=/, '' );
- return serverUrl;
- };
+ var appString = (function(){
+ var spell = parent.CKEDITOR.config.wsc.DefaultParams.scriptPath;
+ var serverUrl = parent.CKEDITOR.config.wsc.DefaultParams.serviceHost;
+ return serverUrl + spell;
+ })();
function loadScript(src, callback) {
var scriptTag = document.createElement("script");
@@ -108,19 +105,13 @@
window.onload = function(){
- toolsString = parseUrl() + toolsString;
- url_version += 1;
- appString = parseUrl() + appString + '?'+ url_version;
-
loadScript(appString, function(){
- url_version += 1;
manageMessageTmp.send({
'id': 'iframeOnload',
'target': window.parent
});
});
}
-
})(this);
</script>
</body>
diff --git a/plugins/wsc/dialogs/wsc.js b/plugins/wsc/dialogs/wsc.js
index f71918a..abe0b08 100644..100755
--- a/plugins/wsc/dialogs/wsc.js
+++ b/plugins/wsc/dialogs/wsc.js
@@ -1,2092 +1,67 @@
-/**
- * @license Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.html or http://ckeditor.com/license
- */
-
-/** ManagerPostMessage
- *************************/
-var ManagerPostMessage = function() {
- var _init = function(handler) {
- if (document.addEventListener) {
- window.addEventListener('message', handler, false);
- } else {
- window.attachEvent("onmessage", handler);
- };
- };
- var _sendCmd = function(o) {
- var str,
- type = Object.prototype.toString,
- objObject = "[object Object]";
- fn = o.fn || null;
- id = o.id || '';
- target = o.target || window;
- message = o.message || {
- 'id': id
- };
-
- if (type.call(o.message) == objObject) {
- (o.message.id) ? o.message.id : o.message.id = id;
- message = o.message;
- };
-
- str = JSON.stringify(message, fn);
- target.postMessage(str, '*');
- };
-
- return {
- init: _init,
- send: _sendCmd
- }
-};
-
-/** Tools
- *************************/
-var tools = {
- hash: {
- create: function(o, fn) {
- var fn = fn || null;
- var str = JSON.stringify(o, fn);
- return str;
- },
- parse: function(str, fn) {
- var fn = fn || null;
- return JSON.parse(str, fn);
- }
- },
- filter4html: function(str) {
- return str.replace(/"/g, "&quot;").replace(/'/g, "&#146;");
- },
- setCookie: function(name, value, options) {
- options = options || {};
-
- var expires = options.expires;
-
- if (typeof expires == "number" && expires) {
- var d = new Date();
- d.setTime(d.getTime() + expires*1000);
- expires = options.expires = d;
- }
- if (expires && expires.toUTCString) {
- options.expires = expires.toUTCString();
- }
-
- value = encodeURIComponent(value);
-
- var updatedCookie = name + "=" + value;
-
- for(var propName in options) {
- updatedCookie += "; " + propName;
- var propValue = options[propName];
- if (propValue !== true) {
- updatedCookie += "=" + propValue;
- }
- }
-
- document.cookie = updatedCookie;
- },
- getCookie: function(name) {
- var matches = document.cookie.match(new RegExp(
- "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
- ));
- return matches ? decodeURIComponent(matches[1]) : undefined;
- },
- deleteCookie: function(name) {
- setCookie(name, "", { expires: -1 })
- }
-};
-
-var optionsDataObject = {};
-var NS = {};
-var nameNode = null;
-NS.targetFromFrame = {};
-//NS.currentLang = CKEDITOR.config.wsc_lang || 'en_US';
-NS.wsc_customerId = CKEDITOR.config.wsc_customerId;
-NS.cust_dic_ids = CKEDITOR.config.wsc_customDictionaryIds;
-NS.userDictionaryName = CKEDITOR.config.wsc_userDictionaryName;
-NS.defaultLanguage = CKEDITOR.config.defaultLanguage;
-NS.LocalizationComing = {};
-
-function OptionsConfirm(state) {
- if (state) {
- nameNode.setValue('');
- };
-};
-
-CKEDITOR.dialog.add('checkspell', function(editor) {
-
- CKEDITOR.on('dialogDefinition', function(dialogDefinitionEvent) {
- var dialogDefinition = dialogDefinitionEvent.data.definition;
- dialogDefinition.dialog.on('cancel', function(cancelEvent) {
- return false;
- }, this, null, -1);
- });
-
- /* NameSpace Plugin
- *************************/
- NS.CKNumber = CKEDITOR.tools.getNextNumber();
- NS.iframeNumber = 'cke_frame_' + NS.CKNumber;
- NS.TextAreaNumber = 'cke_textarea_' + NS.CKNumber;
- NS.pluginPath = CKEDITOR.getUrl(editor.plugins.wsc.path);
- NS.logotype = DefaultParams.logoPath;
- NS.templatePath = NS.pluginPath + 'dialogs/tmp.html';
- NS.div_overlay_no_check = null;
- NS.loadIcon = DefaultParams.iconPath;
- NS.loadIconEmptyEditor = DefaultParams.iconPathEmptyEditor;
- NS.LangComparer = new _SP_FCK_LangCompare();
- NS.LangComparer.setDefaulLangCode( NS.defaultLanguage );
- NS.currentLang = editor.config.wsc_lang || NS.LangComparer.getSPLangCode( editor.langCode );
- NS.LocalizationButton = {
- 'ChangeTo': {
- 'instance' : null,
- 'text' : 'Change to'
- },
-
- 'ChangeAll': {
- 'instance' : null,
- 'text' : 'Change All'
- },
-
- 'IgnoreWord': {
- 'instance' : null,
- 'text' : 'Ignore word'
- },
-
- 'IgnoreAllWords': {
- 'instance' : null,
- 'text' : 'Ignore all words'
- },
-
- 'Options': {
- 'instance' : null,
- 'text' : 'Options',
- 'optionsDialog': {
- 'instance' : null
- }
- },
-
- 'AddWord': {
- 'instance' : null,
- 'text' : 'Add word'
- },
-
- 'FinishChecking': {
- 'instance' : null,
- 'text' : 'Finish Checking'
- }
- };
-
- NS.LocalizationLabel = {
- 'ChangeTo': {
- 'instance' : null,
- 'text' : 'Change to'
- },
-
- 'Suggestions': {
- 'instance' : null,
- 'text' : 'Suggestions'
- }
- };
-
- var SetLocalizationButton = function(obj) {
-
- for(var i in obj) {
- obj[i].instance.getElement().setText(NS.LocalizationComing[i]);
- };
- };
-
- var SetLocalizationLabel = function(obj) {
-
- for(var i in obj) {
- if (!obj[i].instance.setLabel) {
- return;
- };
- obj[i].instance.setLabel(NS.LocalizationComing[i]);
- };
- };
-
-
- NS.load = true;
- NS.cmd = {
- "SpellTab": 'spell',
- "Thesaurus": 'thes',
- "GrammTab": 'grammar'
- };
- NS.dialog = null;
- NS.optionNode = null;
- NS.selectNode = null;
- NS.grammerSuggest = null;
- NS.textNode = {};
- NS.iframeMain = null;
- NS.dataTemp = '';
- NS.div_overlay = null;
- NS.textNodeInfo = {};
- NS.selectNode = {};
- NS.selectNodeResponce = {};
- NS.selectingLang = NS.currentLang;//NS.LangComparer.getSPLangCode( NS.currentLang ) || NS.LangComparer.getDefaulLangCode();
- NS.langList = null;
- NS.serverLocationHash = DefaultParams.serviceHost;
- NS.serverLocation = '#server=' + NS.serverLocationHash;
- NS.langSelectbox = null;
- NS.banner = '';
-
- var manageMessage = null;
- iframeOnload = false;
-
-
- NS.framesetHtml = function(tab) {
- var str = '<iframe src="' + NS.templatePath + NS.serverLocation +'" id=' + NS.iframeNumber + '_' + tab + ' frameborder="0" allowtransparency="1" style="width:100%;border: 1px solid #AEB3B9;overflow: auto;background:#fff; border-radius: 3px;"></iframe>'
- return str;
- };
-
- NS.setIframe = function(that, nameTab) {
- var str = NS.framesetHtml(nameTab);
- return that.getElement().setHtml(str);
- };
-
- NS.setCurrentIframe = function(currentTab) {
- var that = NS.dialog._.contents[currentTab].Content,
- tabID, iframe;
-
- NS.setIframe(that, currentTab);
-
- };
-
- NS.sendData = function() {
- var currentTab = NS.dialog._.currentTabId,
- that = NS.dialog._.contents[currentTab].Content,
- tabID, iframe;
-
- NS.setIframe(that, currentTab);
- NS.dialog.parts.tabs.removeAllListeners();
-
- NS.dialog.parts.tabs.on('click', function(event) {
- event = event || window.event;
- if (!event.data.getTarget().is('a')) {
- return
- };
-
- if (currentTab == NS.dialog._.currentTabId) { return };
-
- currentTab = NS.dialog._.currentTabId;
- that = NS.dialog._.contents[currentTab].Content;
- tabID = NS.iframeNumber + '_' + currentTab;
-
-
- if (that.getElement().$.children.length == 0) {
- NS.setIframe(that, currentTab);
- iframe = document.getElementById(tabID);
-
- /* iframe.onload = function() {
- NS.targetFromFrame[tabID] = iframe.contentWindow;
- //sendData(NS.targetFromFrame[tabID], NS.cmd[currentTab], null);
- };*/
- NS.targetFromFrame[tabID] = iframe.contentWindow;
- //NS.div_overlay.setDisable();
- } else {
- sendData(NS.targetFromFrame[tabID], NS.cmd[currentTab]);
- //NS.div_overlay.setDisable();
- };
- });
-
- };
-
- NS.buildOptionSynonyms = function(key) {
- var syn = NS.selectNodeResponce[key];
- NS.selectNode['synonyms'].clear();
-
- for (var item = 0; item < syn.length; item++) {
- NS.selectNode['synonyms'].add(syn[item], syn[item]);
- };
-
- NS.selectNode['synonyms'].getInputElement().$.firstChild.selected = true;
- NS.textNode['Thesaurus'].setValue(NS.selectNode['synonyms'].getInputElement().getValue())
- };
-
- NS.buildSelectLang = function() {
- var divContainer = new CKEDITOR.dom.element('div'),
- selectContainer = new CKEDITOR.dom.element('select'),
- id = "wscLang" + NS.CKNumber;
-
- divContainer.addClass("cke_dialog_ui_input_select");
- divContainer.setAttribute("role", "presentation");
- divContainer.setStyles({
- 'height': 'auto',
- 'position': 'absolute',
- 'right': '0',
- 'top': '-1px',
- 'width': '160px',
- 'white-space': 'normal'
- });
-
- selectContainer.setAttribute('id', id)
- selectContainer.addClass("cke_dialog_ui_input_select");
- selectContainer.setStyles({
- 'width': '160px'
- });
- var currentTabId = NS.dialog._.currentTabId,
- frameId = NS.iframeNumber + '_' + currentTabId;
-
- divContainer.append(selectContainer);
-
- return divContainer;
-
- };
-
- NS.buildOptionLang = function(key) {
- var id = "wscLang" + NS.CKNumber;
- var select = document.getElementById(id),
- create_option, txt_option;
-
- if(select.options.length === 0) {
- for (var lang in key) {
- create_option=document.createElement("option");
- create_option.setAttribute("value", key[lang]);
- txt_option = document.createTextNode(lang);
- create_option.appendChild(txt_option);
-
- if (key[lang] == NS.selectingLang) {
- create_option.selected = true;
- };
-
- select.appendChild(create_option);
- };
- };
-
- for (var i = 0; i < select.options.length; i++) {
- if (select.options[i].value == NS.selectingLang) {
- select.options[i].selected = true;
- };
- continue;
- };
-
- };
-
- // banner add
- var setBannerInPlace = function(htmlBanner) {
- var findBannerPlace = NS.dialog.getContentElement(NS.dialog._.currentTabId, 'banner').getElement();
- findBannerPlace.setHtml(htmlBanner);
- };
-
-
- // Create overlay block on iframe when run button "options"
- var overlayBlock = function overlayBlock(opt) {
- var progress = opt.progress || "",
- doc = document,
- target = opt.target || doc.body,
- overlayId = opt.id || "overlayBlock",
- opacity = opt.opacity || "0.9",
- background = opt.background || "#f1f1f1",
- getOverlay = doc.getElementById(overlayId),
- thisOverlay = getOverlay || doc.createElement("div");
-
- thisOverlay.style.cssText = "position: absolute;" +
- "top:30px;" +
- "bottom:40px;" +
- "left:1px;" +
- "right:1px;" +
- "z-index: 10020;" +
- "padding:0;" +
- "margin:0;" +
- "background:" + background + ";" +
- "opacity: " + opacity + ";" +
- "filter: alpha(opacity=" + opacity * 100 + ");" +
- "display: none;"
- thisOverlay.id = overlayId;
-
- if (!getOverlay) {
- target.appendChild(thisOverlay);
- }
-
- return {
- setDisable: function() {
- thisOverlay.style.display = "none";
- },
- setEnable: function() {
- thisOverlay.style.display = "block";
- }
- }
- };
-
-
- var buildRadioInputs = function(key, value, check) {
- var divContainer = new CKEDITOR.dom.element('div'),
- radioButton = new CKEDITOR.dom.element('input'),
- radioLabel = new CKEDITOR.dom.element('label'),
- id = "wscGrammerSuggest" + key + "_" + value;
-
-
- divContainer.addClass("cke_dialog_ui_input_radio");
- divContainer.setAttribute("role", "presentation");
- divContainer.setStyles({
- width: "97%",
- padding: "5px",
- 'white-space': 'normal'
- });
-
- radioButton.setAttributes({
- type: "radio",
- value: value,
- name: 'wscGrammerSuggest',
- id: id
- });
- radioButton.setStyles({
- "float":"left"
- });
-
- radioButton.on("click", function(data) {
- NS.textNode['GrammTab'].setValue(data.sender.getValue())
- });
-
- (check) ? radioButton.setAttribute("checked", true) : false;
-
- radioButton.addClass("cke_dialog_ui_radio_input");
-
- radioLabel.appendText(key);
- radioLabel.setAttribute("for", id);
- radioLabel.setStyles({
- 'display': "block",
- 'line-height': '16px',
- 'margin-left': '18px',
- 'white-space': 'normal'
- });
-
- divContainer.append(radioButton);
- divContainer.append(radioLabel);
-
- return divContainer;
- };
-
-var langConstructor = function(lang) {
- var langSelectBox = new __constructLangSelectbox(lang),
- selectId = "wscLang" + NS.CKNumber,
- selectContainer = document.getElementById(selectId),
- currentTabId = NS.dialog._.currentTabId,
- frameId = NS.iframeNumber + '_' + currentTabId;
-
- NS.buildOptionLang(langSelectBox.setLangList);
-
- //tabView[langSelectBox.getCurrentLangGroup(NS.selectingLang)]();
-
- selectContainer.onchange = function(e){
- e = e || window.event;
- tabView[langSelectBox.getCurrentLangGroup(this.value)]();
- NS.div_overlay.setEnable();
-
- NS.selectingLang = this.value;
-
- manageMessage.send({
- 'message': {
- 'changeLang': NS.selectingLang,
- 'text': NS.dataTemp
- },
- 'target': NS.targetFromFrame[frameId],
- 'id': 'selectionLang_outer__page'
- });
- //NS.div_overlay.setDisable();
- };
-
-};
-
-var disableButtonSuggest = function(word) {
- if (word == 'no_any_suggestions') {
- word = 'No suggestions';
- NS.LocalizationButton['ChangeTo'].instance.disable();
- NS.LocalizationButton['ChangeAll'].instance.disable();
-
- // hack for css disable button ckeditor 4
- function styleDisable(/* string */instanceButton) {
- var button = NS.LocalizationButton[instanceButton].instance;
- button.getElement().hasClass('cke_disabled') ? button.getElement().setStyle('color', '#a0a0a0') : button.disable();
- };
-
- styleDisable('ChangeTo');
- styleDisable('ChangeAll');
-
- return word;
- } else {
- NS.LocalizationButton['ChangeTo'].instance.enable();
- NS.LocalizationButton['ChangeAll'].instance.enable();
- NS.LocalizationButton['ChangeTo'].instance.getElement().setStyle('color', '#333');
- NS.LocalizationButton['ChangeAll'].instance.getElement().setStyle('color', '#333');
- return word;
- };
-
-};
-
- var handlerId = {
- iframeOnload: function(response) {
- NS.div_overlay.setEnable();
- iframeOnload = true;
- var currentTab = NS.dialog._.currentTabId,
- tabId = NS.iframeNumber + '_' + currentTab;
- //debugger
-
- sendData(NS.targetFromFrame[tabId], NS.cmd[currentTab]);
- },
-
- suggestlist: function(response) {
- delete response.id;
- NS.div_overlay_no_check.setDisable();
- hideCurrentFinishChecking();
- langConstructor(NS.langList);
-
-
- var word = disableButtonSuggest(response.word),
- suggestionsList = '';
-
- if (word instanceof Array) {
- word = response.word[0];
-
- };
- word = word.split(',');
-
-
- //NS.langSelectbox = new __constructLangSelectbox(NS.langList);
-
- //tabView[NS.langSelectbox.getCurrentLangGroup(NS.selectingLang)]();
-
- //NS.buildOptionLang(NS.langSelectbox.setLangList);
-
- suggestionsList = word;
-
- selectNode.clear();
- NS.textNode['SpellTab'].setValue(suggestionsList[0]);
-
- for (var item = 0; item < suggestionsList.length; item++) {
- selectNode.add(suggestionsList[item], suggestionsList[item]);
- };
-
- showCurrentTabs();
- //NS.div_overlay.setEnable();
- NS.div_overlay.setDisable();
-
- },
-
- grammerSuggest: function(response) {
- delete response.id;
-// NS.langList = response.mocklangs;
-
-// langConstructor(NS.langList);
- delete response.mocklangs;
-
- hideCurrentFinishChecking();
- var firstSuggestValue = response.grammSuggest[0];// ? firstSuggestValue = response.grammSuggest[0] : firstSuggestValue = 'No suggestion for this words';
- NS.grammerSuggest.getElement().setHtml('');
- NS.textNode['GrammTab'].reset();
- NS.textNode['GrammTab'].setValue(firstSuggestValue);
-
- NS.textNodeInfo['GrammTab'].getElement().setHtml('');
- NS.textNodeInfo['GrammTab'].getElement().setText(response.info);
-
- var arr = response.grammSuggest,
- len = arr.length,
- check = true;
-
- for (var i = 0; i < len; i++) {
- NS.grammerSuggest.getElement().append(buildRadioInputs(arr[i], arr[i], check));
- check = false;
- };
-
- showCurrentTabs();
- NS.div_overlay.setDisable();
- },
-
- thesaurusSuggest: function(response) {
- delete response.id;
-// NS.langList = response.mocklangs;
-// langConstructor(NS.langList);
- delete response.mocklangs;
-
- hideCurrentFinishChecking();
-
- NS.selectNodeResponce = response;
-
- NS.textNode['Thesaurus'].reset();
- NS.selectNode['categories'].clear();
-
- for (var i in response) {
- NS.selectNode['categories'].add(i, i);
- };
-
- var synKey = NS.selectNode['categories'].getInputElement().getChildren().$[0].value;
-
- NS.selectNode['categories'].getInputElement().getChildren().$[0].selected = true;
-
- NS.buildOptionSynonyms(synKey);
-
- showCurrentTabs();
- NS.div_overlay.setDisable();
- },
- finish: function(response) {
- delete response.id;
-
- hideCurrentTabs();
- showCurrentFinishChecking();
- NS.div_overlay.setDisable();
- },
- settext: function(response) {
- delete response.id;
-
- NS.dialog.getParentEditor().focus();
- NS.dialog.getParentEditor().setData(response.text, NS.dialog.hide());
- //NS.dataTemp = NS.dialog.getParentEditor().getData();
-
- },
- ReplaceText: function(response) {
- delete response.id;
- NS.div_overlay.setEnable();
-
- NS.dataTemp = response.text;
- NS.selectingLang = response.currentLang;
-
- window.setTimeout(function() {
- NS.div_overlay.setDisable();
- }, 500);
-
- SetLocalizationButton(NS.LocalizationButton);
- SetLocalizationLabel(NS.LocalizationLabel);
-
- },
-
- options_checkbox_send: function(response) {
- delete response.id;
-
- var obj = {
- 'osp': tools.getCookie('osp'),
- 'udn': tools.getCookie('udn'),
- //'ud': tools.getCookie('ud'),
- 'cust_dic_ids': NS.cust_dic_ids
- //'udnCmd': tools.getCookie('udnCmd')
- }
-
- var currentTabId = NS.dialog._.currentTabId,
- frameId = NS.iframeNumber + '_' + currentTabId;
-
- manageMessage.send({
- 'message': obj,
- 'target': NS.targetFromFrame[frameId],
- 'id': 'options_outer__page'
- });
- },
-
- getOptions: function(response) {
- var udn = response.DefOptions.udn;
- NS.LocalizationComing = response.DefOptions.localizationButtonsAndText;
-
- NS.langList = response.lang;
-
- setBannerInPlace(response.banner);
-
- if (udn == 'undefined') {
- if (NS.userDictionaryName) {
- udn = NS.userDictionaryName;
-
- var obj = {
- 'osp': tools.getCookie('osp'),
- 'udn': NS.userDictionaryName,
- //'ud': tools.getCookie('ud'),
- 'cust_dic_ids': NS.cust_dic_ids,
- 'id': 'options_dic_send',
- 'udnCmd': 'create'
- };
-
- manageMessage.send({
- 'message': obj,
- 'target': NS.targetFromFrame[frameId]
- });
-
- } else{
- udn = '';
- };
- };
-
- tools.setCookie('osp', response.DefOptions.osp);
- tools.setCookie('udn', udn);
- //tools.setCookie('ud', response.ud);
- tools.setCookie('cust_dic_ids', response.DefOptions.cust_dic_ids);
-
- manageMessage.send({
- 'id': 'giveOptions'
- });
- },
-
- options_dic_send: function(response) {
- //delete response.id;
-
- var obj = {
- 'osp': tools.getCookie('osp'),
- 'udn': tools.getCookie('udn'),
- //'ud': tools.getCookie('ud'),
- 'cust_dic_ids': NS.cust_dic_ids,
- 'id': 'options_dic_send',
- 'udnCmd': tools.getCookie('udnCmd')
- };
-
- var currentTabId = NS.dialog._.currentTabId,
- frameId = NS.iframeNumber + '_' + currentTabId;
-
- manageMessage.send({
- 'message': obj,
- 'target': NS.targetFromFrame[frameId]
- });
- },
- data: function(response) {
- delete response.id; // fix from ie9
- },
-
- giveOptions: function() {
-
- },
-
- setOptionsConfirmF:function() {
- OptionsConfirm(false);
- },
-
- setOptionsConfirmT:function() {
- OptionsConfirm(true);
- },
-
- clickBusy: function() {
- NS.div_overlay.setEnable();
- },
-
- suggestAllCame: function() {
- NS.div_overlay.setDisable();
- NS.div_overlay_no_check.setDisable();
- },
-
- TextCorrect: function() {
- langConstructor(NS.langList);
- }
-
- }
-
- var handlerIncomingData = function(event) {
- event = event || window.event;
- var response = JSON.parse(event.data);
-
- handlerId[response.id](response);
- };
-
- var handlerButtonOptions = function(event) {
- event = event || window.event;
-
- var currentTabId = NS.dialog._.currentTabId,
- frameId = NS.iframeNumber + '_' + currentTabId;
-
- manageMessage.send({
- 'message': {
- 'cmd': 'Options'
- },
- 'target': NS.targetFromFrame[frameId],
- 'id': 'cmd'
- });
-
- };
-
- var handlerButtons = function(event) {
- event = event || window.event;
- NS.div_overlay.setEnable();
- var currentTabId = NS.dialog._.currentTabId,
- frameId = NS.iframeNumber + '_' + currentTabId,
- new_word = NS.textNode[currentTabId].getValue();
-
- manageMessage.send({
- 'message': {
- 'cmd': this.getElement().getAttribute("title-cmd"),
- 'tabId': currentTabId,
- 'new_word': new_word
- },
- 'target': NS.targetFromFrame[frameId],
- 'id': 'cmd_outer__page'
- });
-
- };
-
- var sendData = function(frameTarget, cmd, sendText, reset_suggest) {
- cmd = cmd || CKEDITOR.config.wsc_cmd || 'spell';
- reset_suggest = reset_suggest || false;
- sendText = sendText || NS.dataTemp;
-
- manageMessage.send({
- 'message': {
- 'customerId': NS.wsc_customerId,
- 'text': sendText,
- 'txt_ctrl': NS.TextAreaNumber,
- 'cmd': cmd,
- 'cust_dic_ids': NS.cust_dic_ids,
- 'udn': NS.userDictionaryName,
- 'slang': NS.selectingLang,
- 'reset_suggest': reset_suggest
- },
- 'target': frameTarget,
- 'id': 'data_outer__page'
- });
-NS.div_overlay.setEnable();
- };
-
- var tabView = {
- "superset" : function() {
- showThesaurusTab();
- showGrammTab();
- showSpellTab();
- },
- "usual" : function() {
- hideThesaurusTab();
- hideGrammTab();
- showSpellTab();
- }
- };
-
- var showFirstTab = function() {
-
-
-
-
- var cmdManger = function(cmdView) {
- var obj = {};
- var _getCmd = function(cmd) {
- for (var tabId in cmdView) {
- obj[cmdView[tabId]] = tabId;
- };
- return obj[cmd];
- };
- return {
- getCmdByTab: _getCmd
- }
- };
-
- var cmdM = new cmdManger(NS.cmd);
- NS.dialog.selectPage(cmdM.getCmdByTab(CKEDITOR.config.wsc_cmd));
- NS.sendData();
-// tabView[langSelectBox.getCurrentLangGroup(NS.selectingLang)]()
- //NS.dialog._.currentTabId.click();
- };
-
- var showThesaurusTab = function() {
- NS.dialog.showPage('Thesaurus');
- };
-
- var hideThesaurusTab = function() {
- NS.dialog.hidePage('Thesaurus');
- };
-
- var showGrammTab = function() {
- NS.dialog.showPage('GrammTab');
- };
-
- var hideGrammTab = function() {
- NS.dialog.hidePage('GrammTab');
- };
-
- var showSpellTab = function() {
- NS.dialog.showPage('SpellTab');
- };
-
- var hideSpellTab = function() {
- NS.dialog.hidePage('SpellTab');
- };
-
- var showCurrentTabs = function() {
- /*if (NS.dialog._.currentTabId == 'Thesaurus') {
- return;
- };*/
-
- NS.dialog.getContentElement(NS.dialog._.currentTabId, 'bottomGroup').getElement().show();
- };
-
- var hideCurrentTabs = function() {
- /*if (NS.dialog._.currentTabId == 'Thesaurus') {
- return;
- };*/
-
- NS.dialog.getContentElement(NS.dialog._.currentTabId, 'bottomGroup').getElement().hide();
- };
-
- var showCurrentFinishChecking = function() {
- /*if (NS.dialog._.currentTabId == 'Thesaurus') {
- return;
- };*/
-
- NS.dialog.getContentElement(NS.dialog._.currentTabId, 'BlockFinishChecking').getElement().show();
- };
-
- var hideCurrentFinishChecking = function() {
- /*if (NS.dialog._.currentTabId == 'Thesaurus') {
- return;
- };*/
-
- NS.dialog.getContentElement(NS.dialog._.currentTabId, 'BlockFinishChecking').getElement().hide();
- };
-
-
-
-function __constructLangSelectbox(languageGroup) {
-
- if ( !languageGroup ) throw "Languages-by-groups list are required for construct selectbox";
-
- var that = this,
- o_arr = [],
- priorLang ="en_US",
- priorLangTitle = "",
- currLang = NS.selectingLang;
-
-
- for ( var group in languageGroup){
- for ( var langCode in languageGroup[group]){
- var langName = languageGroup[group][langCode];
- if ( langName == priorLang )
- priorLangTitle = langName;
- else
- o_arr.push( langName );
- }
-
- }
-
- o_arr.sort();
- if(priorLangTitle) {
- o_arr.unshift( priorLangTitle );
- };
-
- var searchGroup = function ( code ){
- for ( var group in languageGroup){
- for ( var langCode in languageGroup[group]){
- if ( langCode.toUpperCase() === code.toUpperCase() )
- return group;
- };
-
- };
- return "";
- };
-
- var _setLangList = function() {
- var langList = {},
- langArray = [];
- for (var group in languageGroup) {
- for ( var langCode in languageGroup[group]){
- langList[languageGroup[group][langCode]] = langCode;
- };
- };
- return langList;
- };
-
-
- var _return = {
- getCurrentLangGroup: function(code) {
- return searchGroup(code);
- },
- setLangList: _setLangList()
- };
-
-
- return _return;
-
-};
-
- return {
- title: editor.config.wsc_dialogTitle || editor.lang.wsc.title,
- minWidth: 560,
- minHeight: 350,
- resizable: CKEDITOR.DIALOG_RESIZE_NONE,
- buttons: [CKEDITOR.dialog.cancelButton],
- onLoad: function() {
- manageMessage = new ManagerPostMessage();
- NS.dialog = this;
- showFirstTab();
- NS.dataTemp = NS.dialog.getParentEditor().getData();
- manageMessage.init(handlerIncomingData);
-
- NS.div_overlay = new overlayBlock({
- opacity: "0.95",
- background: "#fff url(" + NS.loadIcon + ") no-repeat 50% 50%",
- target: this.parts.tabs.getParent().$
- });
-
- NS.div_overlay_no_check = new overlayBlock({
- opacity: "1",
- id: 'no_check_over',
- background: "#fff url(" + NS.loadIconEmptyEditor + ") no-repeat 50% 50%",
- target: this.parts.tabs.getParent().$
- });
- //NS.div_overlay.setDisable();
-
- //NS.sendData();
- var number_ck = NS.CKNumber + 1,
- id_tab = CKEDITOR.document.getById('cke_dialog_tabs_' + number_ck);
-
- id_tab.setStyle('width', '97%');
- id_tab.append(NS.buildSelectLang());
-
- },
- onShow: function() {
- NS.div_overlay.setDisable();
- /*var tabId = NS.iframeNumber + '_' + NS.dialog._.currentTabId;
- NS.dataTemp = NS.dialog.getParentEditor().getData();*/
- showFirstTab();
- //sendData(NS.targetFromFrame[tabId], null, null, true);
- if ( NS.dialog.getParentEditor().getData() == '' ) {
- NS.div_overlay_no_check.setEnable();
- //alert( 'Nothing to check' );
- //NS.dialog.getParentEditor().focus();
- //NS.dialog.hide()
- };
- },
- onHide: function() {
- //var firstTabId = NS.iframeNumber + '_SpellTab';
- //sendData(NS.targetFromFrame[firstTabId], null, NS.dataTemp, true);
- /*manageMessage.send({
- 'message': { 'changeLang': NS.selectingLang},
- 'target': NS.targetFromFrame[firstTabId],
- 'id': 'selectionLang_outer__page'
- });*/
- NS.dataTemp = null;
- },
- contents: [
- {
- id: 'SpellTab',
- label: 'SpellChecker',
- accessKey: 'S',
- elements: [
- {
- type: 'html',
- id: 'banner',
- label: 'banner',
- html: '<div></div>'
- },
- {
- type: 'html',
- id: 'Content',
- label: 'spellContent',
- html: '',
- onLoad: function() {
- //NS.setCurrentIframe(NS.dialog._.currentTabId);
- var tabId = NS.iframeNumber + '_' + NS.dialog._.currentTabId;
- var iframe = document.getElementById(tabId);
- NS.targetFromFrame[tabId] = iframe.contentWindow;
-
- },
- onShow: function() {
- NS.dataTemp = NS.dialog.getParentEditor().getData();
- var tabId = NS.iframeNumber + '_' + NS.dialog._.currentTabId;
- //sendData(NS.targetFromFrame[tabId], null, NS.dataTemp);
- NS.div_overlay.setEnable();
- }
- },
- {
- type: 'hbox',
- id: 'bottomGroup',
- widths: ['50%', '50%'],
- children: [
- {
- type: 'hbox',
- id: 'leftCol',
- align: 'left',
- width: '50%',
- children: [
- {
- type: 'vbox',
- id: 'rightCol1',
- widths: ['50%', '50%'],
- children: [
- {
- type: 'text',
- id: 'text',
- label: NS.LocalizationLabel['ChangeTo'].text + ':',
- labelLayout: 'horizontal',
- labelStyle: 'font: 12px/25px arial, sans-serif;',
- width: '140px',
- 'default': '',
- onLoad: function() {
- NS.textNode['SpellTab'] = this;
- NS.LocalizationLabel['ChangeTo'].instance = this;
- },
- onHide: function() {
- this.reset();
- }
- },
- {
- type: 'hbox',
- id: 'rightCol',
- align: 'right',
- width: '30%',
- children: [
- {
- type: 'vbox',
- id: 'rightCol_col__left',
- children: [
- {
- type: 'text',
- id: 'labelSuggestions',
- label: NS.LocalizationLabel['Suggestions'].text + ':',
- onLoad: function() {
- NS.LocalizationLabel['Suggestions'].instance = this;
- this.getInputElement().hide();
- }
- },
- {
- type: 'html',
- id: 'logo',
- html: '<img width="99" height="68" border="0" src="" title="WebSpellChecker.net" alt="WebSpellChecker.net" style="display: inline-block;">',
- onShow: function() {
- this.getElement().$.src = NS.logotype;
- this.getElement().getParent().setStyles({
- "text-align": "left"
- })
- }
- }
- ]
- },
- {
- type: 'select',
- id: 'list_of_suggestions',
- labelStyle: 'font: 12px/25px arial, sans-serif;',
- size: '6',
- inputStyle: 'width: 140px; height: auto;',
- items: [['loading...']],
- onShow: function() {
- selectNode = this;
- },
- onHide: function() {
- this.clear();
- },
- onChange: function() {
- NS.textNode['SpellTab'].setValue(this.getValue());
- }
- }
- ]
- }
- ]
- }
- ]
- },
- {
- type: 'hbox',
- id: 'rightCol',
- align: 'right',
- width: '50%',
- children: [
- {
- type: 'vbox',
- id: 'rightCol_col__left',
- widths: ['50%', '50%', '50%', '50%'],
- children: [
- {
- type: 'button',
- id: 'ChangeTo',
- label: NS.LocalizationButton['ChangeTo'].text,
- title: 'Change to',
- style: 'width: 100%;',
- onLoad: function() {
- this.getElement().setAttribute("title-cmd", this.id);
- NS.LocalizationButton['ChangeTo'].instance = this;
- },
- onClick: handlerButtons
- },
- {
- type: 'button',
- id: 'ChangeAll',
- label: NS.LocalizationButton['ChangeAll'].text,
- title: 'Change All',
- style: 'width: 100%;',
- onLoad: function() {
- this.getElement().setAttribute("title-cmd", this.id);
- NS.LocalizationButton['ChangeAll'].instance = this;
- },
- onClick: handlerButtons
- },
- {
- type: 'button',
- id: 'AddWord',
- label: NS.LocalizationButton['AddWord'].text,
- title: 'Add word',
- style: 'width: 100%;',
- onLoad: function() {
- this.getElement().setAttribute("title-cmd", this.id);
- NS.LocalizationButton['AddWord'].instance = this;
- },
- onClick: handlerButtons
- },
- {
- type: 'button',
- id: 'FinishChecking',
- label: NS.LocalizationButton['FinishChecking'].text,
- title: 'Finish Checking',
- style: 'width: 100%;margin-top: 9px;',
- onLoad: function() {
- this.getElement().setAttribute("title-cmd", this.id);
- NS.LocalizationButton['FinishChecking'].instance = this;
- },
- onClick: handlerButtons
- }
- ]
- },
- {
- type: 'vbox',
- id: 'rightCol_col__right',
- widths: ['50%', '50%', '50%'],
- children: [
- {
- type: 'button',
- id: 'IgnoreWord',
- label: NS.LocalizationButton['IgnoreWord'].text,
- title: 'Ignore word',
- style: 'width: 100%;',
- onLoad: function() {
- this.getElement().setAttribute("title-cmd", this.id);
- NS.LocalizationButton['IgnoreWord'].instance = this;
- },
- onClick: handlerButtons
- },
- {
- type: 'button',
- id: 'IgnoreAllWords',
- label: NS.LocalizationButton['IgnoreAllWords'].text,
- title: 'Ignore all words',
- style: 'width: 100%;',
- onLoad: function() {
- this.getElement().setAttribute("title-cmd", this.id);
- NS.LocalizationButton['IgnoreAllWords'].instance = this;
- },
- onClick: handlerButtons
- },
- {
- type: 'button',
- id: 'option',
- label: NS.LocalizationButton['Options'].text,
- title: 'Option',
- style: 'width: 100%;',
- onLoad: function() {
- NS.LocalizationButton['Options'].instance = this;
- },
- onClick: function() {
- editor.openDialog('options');
- }
- }
- ]
- }
-
- ]
- }
- ]
- },
- {
- type: 'hbox',
- id: 'BlockFinishChecking',
- widths: ['70%', '30%'],
- onShow: function() {
- this.getElement().hide();
- },
- onHide: showCurrentTabs,
- children: [
-
- {
- type: 'hbox',
- id: 'leftCol',
- align: 'left',
- width: '70%',
- children: [
- {
- type: 'vbox',
- id: 'rightCol1',
- children: [
- {
- type: 'html',
- id: 'logo',
- html: '<img width="99" height="68" border="0" src="" title="WebSpellChecker.net" alt="WebSpellChecker.net" style="display: inline-block;">',
- onShow: function() {
- this.getElement().$.src = NS.logotype;
- this.getElement().getParent().setStyles({
- "text-align": "center"
- })
- }
- }
- ]
- }
- ]
- },
- {
- type: 'hbox',
- id: 'rightCol',
- align: 'right',
- width: '30%',
- children: [
- {
- type: 'vbox',
- id: 'rightCol_col__left',
- children: [
- {
- type: 'button',
- id: 'Option_button',
- label: NS.LocalizationButton['Options'].text,
- title: 'Option',
- style: 'width: 100%;',
- onLoad: function() {
- this.getElement().setAttribute("title-cmd", this.id);
- },
- onClick: function() {
- editor.openDialog('options');
- }
- },
- {
- type: 'button',
- id: 'FinishChecking',
- label: NS.LocalizationButton['FinishChecking'].text,
- title: 'Finish Checking',
- style: 'width: 100%;',
- onLoad: function() {
- this.getElement().setAttribute("title-cmd", this.id);
- },
- onClick: handlerButtons
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- id: 'GrammTab',
- label: 'Grammar',
- accessKey: 'G',
- elements: [
- {
- type: 'html',
- id: 'banner',
- label: 'banner',
- html: '<div></div>'
- },
- {
- type: 'html',
- id: 'Content',
- label: 'GrammarContent',
- html: '',
- onShow: function() {
- var tabId = NS.iframeNumber + '_' + NS.dialog._.currentTabId;
- var iframe = document.getElementById(tabId);
- NS.targetFromFrame[tabId] = iframe.contentWindow;
- }
- },
- {
- type: 'vbox',
- id: 'bottomGroup',
- children: [
- {
- type: 'hbox',
- id: 'leftCol',
- widths: ['66%', '34%'],
- children: [
- {
- type: 'vbox',
- children: [
- {
- type: 'text',
- id: 'text',
- label: "Change to:",
- labelLayout: 'horizontal',
- labelStyle: 'font: 12px/25px arial, sans-serif; float: right;margin-right: 80px;',
- inputStyle: '',
- width: '200px',
- 'default': '',
- onLoad: function(e) {
- NS.textNode['GrammTab'] = this;
- },
- onHide: function() {
- this.reset();
- }
- },
- {
-
- type: 'html',
- id: 'html_text',
- html: "<div style='min-height: 17px; width: 330px; line-height: 17px; padding: 5px; text-align: left;background: #F1F1F1;color: #595959; white-space: normal!important;'></div>",
- onLoad: function(e) {
- NS.textNodeInfo['GrammTab'] = this;
- }
- },
- {
- type: 'html',
- id: 'radio',
- html: "",
- onLoad: function() {
- NS.grammerSuggest = this;
- }
- }
- ]
- },
- {
- type: 'vbox',
- children: [
- {
- type: 'button',
- id: 'ChangeTo',
- label: 'Change to',
- title: 'Change to',
- style: 'width: 133px; float: right;',
- onLoad: function() {
- this.getElement().setAttribute("title-cmd", this.id);
- },
- onClick: handlerButtons
- },
- {
- type: 'button',
- id: 'IgnoreWord',
- label: 'Ignore word',
- title: 'Ignore word',
- style: 'width: 133px; float: right;',
- onLoad: function() {
- this.getElement().setAttribute("title-cmd", this.id);
- },
- onClick: handlerButtons
- },
- {
- type: 'button',
- id: 'IgnoreAllWords',
- label: 'Ignore Problem',
- title: 'Ignore Problem',
- style: 'width: 133px; float: right;',
- onLoad: function() {
- this.getElement().setAttribute("title-cmd", this.id);
- },
- onClick: handlerButtons
- },
- {
- type: 'button',
- id: 'FinishChecking',
- label: 'Finish Checking',
- title: 'Finish Checking',
- style: 'width: 133px; float: right; margin-top: 9px;',
- onLoad: function() {
- this.getElement().setAttribute("title-cmd", this.id);
- },
- onClick: handlerButtons
- }
- ]
- }
- ]
- }
- ]
- },
- {
- type: 'hbox',
- id: 'BlockFinishChecking',
- widths: ['70%', '30%'],
- onShow: function() {
- this.getElement().hide();
- },
- onHide: showCurrentTabs,
- children: [
- {
- type: 'hbox',
- id: 'leftCol',
- align: 'left',
- width: '70%',
- children: [
- {
- type: 'vbox',
- id: 'rightCol1',
- children: [
- {
- type: 'html',
- id: 'logo',
- html: '<img width="99" height="68" border="0" src="" title="WebSpellChecker.net" alt="WebSpellChecker.net" style="display: inline-block;">',
- onShow: function() {
- this.getElement().$.src = NS.logotype;
- this.getElement().getParent().setStyles({
- "text-align": "center"
- })
- }
- }
- ]
- }
- ]
- },
- {
- type: 'hbox',
- id: 'rightCol',
- align: 'right',
- width: '30%',
- children: [
- {
- type: 'vbox',
- id: 'rightCol_col__left',
- children: [
- {
- type: 'button',
- id: 'FinishChecking',
- label: 'Finish Checking',
- title: 'Finish Checking',
- style: 'width: 100%;',
- onLoad: function() {
- this.getElement().setAttribute("title-cmd", this.id);
- },
- onClick: handlerButtons
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- id: 'Thesaurus',
- label: 'Thesaurus',
- accessKey: 'T',
- elements: [
- {
- type: 'html',
- id: 'banner',
- label: 'banner',
- html: '<div></div>'
- },
- {
- type: 'html',
- id: 'Content',
- label: 'spellContent',
- html: '',
- onShow: function() {
- var tabId = NS.iframeNumber + '_' + NS.dialog._.currentTabId;
- var iframe = document.getElementById(tabId);
- NS.targetFromFrame[tabId] = iframe.contentWindow;
- }
- },
- {
- type: 'vbox',
- id: 'bottomGroup',
- children: [
- {
- type: 'hbox',
- widths: ['75%', '25%'],
- children: [
- {
- type: 'vbox',
- children: [
- {
- type: 'hbox',
- widths: ['65%', '35%'],
- children: [
- {
- type: 'text',
- id: 'ChangeTo',
- label: 'Change to:',
- labelLayout: 'horizontal',
- inputStyle: 'width: 160px;',
- labelStyle: 'font: 12px/25px arial, sans-serif;',
- 'default': '',
- onLoad: function(e) {
- NS.textNode['Thesaurus'] = this;
- },
- onHide: function() {
- this.reset();
- }
- },
- {
- type: 'button',
- id: 'ChangeTo',
- label: 'Change to',
- title: 'Change to',
- style: 'width: 121px; margin-top: 1px;',
- onLoad: function() {
- this.getElement().setAttribute("title-cmd", this.id);
- },
- onClick: handlerButtons
- }
- ]
- },
- {
- type: 'hbox',
- children: [
- {
- type: 'select',
- id: 'categories',
- label: "Categories:",
- labelStyle: 'font: 12px/25px arial, sans-serif;',
- size: '6',
- inputStyle: 'width: 180px; height: auto;',
- items: [],
- onLoad: function(e) {
- NS.selectNode['categories'] = this;
-
- },
- onHide: function() {
- this.clear();
- },
- onChange: function() {
- NS.buildOptionSynonyms(this.getValue())
- }
- },
- {
- type: 'select',
- id: 'synonyms',
- label: "Synonyms:",
- labelStyle: 'font: 12px/25px arial, sans-serif;',
- size: '6',
- inputStyle: 'width: 180px; height: auto;',
- items: [],
- onLoad: function(e) {
- NS.selectNode['synonyms'] = this;
- },
- onShow: function() {
- NS.textNode['Thesaurus'].setValue(this.getValue());
- },
- onHide: function() {
- this.clear();
- },
- onChange: function(e) {
- NS.textNode['Thesaurus'].setValue(this.getValue());
- }
- }
- ]
- }
- ]
- },
- {
- type: 'vbox',
- width: '120px',
- style: "margin-top:46px;",
- children: [
- {
- type: 'html',
- id: 'logotype',
- label: 'WebSpellChecker.net',
- html: '<img width="99" height="68" border="0" src="" title="WebSpellChecker.net" alt="WebSpellChecker.net" style="display: inline-block;">',
- onShow: function() {
- this.getElement().$.src = NS.logotype;
- this.getElement().getParent().setStyles({
- "text-align": "center"
- })
- }
- },
- {
- type: 'button',
- id: 'FinishChecking',
- label: 'Finish Checking',
- title: 'Finish Checking',
- style: 'width: 121px; float: right; margin-top: 9px;',
- onLoad: function() {
- this.getElement().setAttribute("title-cmd", this.id);
- },
- onClick: handlerButtons
- }
- ]
- }
- ]
- }
- ]
- },
- {
- type: 'hbox',
- id: 'BlockFinishChecking',
- widths: ['70%', '30%'],
- onShow: function() {
- this.getElement().hide();
- },
- onHide: showCurrentTabs,
- children: [
- {
- type: 'hbox',
- id: 'leftCol',
- align: 'left',
- width: '70%',
- children: [
- {
- type: 'vbox',
- id: 'rightCol1',
- children: [
- {
- type: 'html',
- id: 'logo',
- html: '<img width="99" height="68" border="0" src="" title="WebSpellChecker.net" alt="WebSpellChecker.net" style="display: inline-block;">',
- onShow: function() {
- this.getElement().$.src = NS.logotype;
- this.getElement().getParent().setStyles({
- "text-align": "center"
- })
- }
- }
- ]
- }
- ]
- },
- {
- type: 'hbox',
- id: 'rightCol',
- align: 'right',
- width: '30%',
- children: [
- {
- type: 'vbox',
- id: 'rightCol_col__left',
- children: [
- {
- type: 'button',
- id: 'FinishChecking',
- label: 'Finish Checking',
- title: 'Finish Checking',
- style: 'width: 100%;',
- onLoad: function() {
- this.getElement().setAttribute("title-cmd", this.id);
- },
- onClick: handlerButtons
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- };
-});
-
-
-// Options dialog
-CKEDITOR.dialog.add('options', function(editor) {
- var manageMessage = new ManagerPostMessage;
- var dialog = null;
- var linkOnCheckbox = {};
- var checkboxState = {};
- var ospString = null;
- var OptionsTextError = null;
- var cmd = null;
-
- var set_osp = [];
- var dictionaryState = {
- 'udn': tools.getCookie('udn'),
- 'osp': tools.getCookie('osp')
- //'ud': tools.getCookie('ud'),
- //'cmd': ''
- }
-
- var setHandlerOptions = function() {
- var osp = tools.getCookie('osp');
- strToArr = osp.split('');
-
- checkboxState['IgnoreAllCapsWords'] = strToArr[0];
- checkboxState['IgnoreWordsNumbers'] = strToArr[1];
- checkboxState['IgnoreMixedCaseWords'] = strToArr[2];
- checkboxState['IgnoreDomainNames'] = strToArr[3];
- };
-
- var sendDicOptions = function(event) {
- event = event || window.event;
- cmd = this.getElement().getAttribute("title-cmd");
- var osp = [];
-
- osp[0] = checkboxState['IgnoreAllCapsWords'];
- osp[1] = checkboxState['IgnoreWordsNumbers'];
- osp[2] = checkboxState['IgnoreMixedCaseWords'];
- osp[3] = checkboxState['IgnoreDomainNames'];
-
- osp = osp.toString().replace(/,/g, "");
-
-
- tools.setCookie('osp', osp);
- tools.setCookie('udnCmd', cmd ? cmd : 'ignore');
- if (cmd == "delete") {
-
- manageMessage.send({
- 'id': 'options_dic_send'
- });
- } else {
- tools.setCookie('udn', nameNode.getValue() == '' ? '' : nameNode.getValue());
- manageMessage.send({
- 'id': 'options_dic_send'
- });
- };
-
- };
-
-
- var sendAllOptions = function() {
- var osp = [];
-
- osp[0] = checkboxState['IgnoreAllCapsWords'];
- osp[1] = checkboxState['IgnoreWordsNumbers'];
- osp[2] = checkboxState['IgnoreMixedCaseWords'];
- osp[3] = checkboxState['IgnoreDomainNames'];
-
- osp = osp.toString().replace(/,/g, "");
-
- tools.setCookie('osp', osp);
- tools.setCookie('udn', nameNode.getValue());
- //tools.setCookie('udnCmd', cmd ? cmd : 'ignore');
- //tools.setCookie('ud', tools.getCookie('ud'));
-
- manageMessage.send({
- 'id': 'options_checkbox_send'
- });
-
-
- };
-
- var cameOptions = function() {
- OptionsTextError.getElement().setHtml(NS.LocalizationComing['error']);
- OptionsTextError.getElement().show();
- };
-
- return {
- title: NS.LocalizationComing['Options'],
- minWidth: 430,
- minHeight: 130,
- resizable: CKEDITOR.DIALOG_RESIZE_NONE,
- contents: [
- {
- id: 'OptionsTab',
- label: 'Options',
- accessKey: 'O',
- elements: [
- {
- type: 'hbox',
- id: 'options_error',
- children: [
- {
- type: 'html',
- style: "display: block;text-align: center;white-space: normal!important; font-size: 12px;color:red",
- html: '<div></div>',
- onShow: function() {
- OptionsTextError = this;
- }
- }
- ]
- },
- {
- type: 'vbox',
- id: 'Options_content',
- children: [
- {
- type: 'hbox',
- id: 'Options_manager',
- widths: ['52%', '48%'],
- children: [
- {
- type: 'fieldset',
- label: 'Spell Checking Options',
- style: 'border: none;margin-top: 13px;padding: 10px 0 10px 10px',
- onShow: function() {
- this.getInputElement().$.children[0].innerHTML = NS.LocalizationComing['SpellCheckingOptions'];
- },
- children: [
- {
- type: 'vbox',
- id: 'Options_checkbox',
- children: [
- {
- type: 'checkbox',
- id: 'IgnoreAllCapsWords',
- label: 'Ignore All-Caps Words',
- labelStyle: 'margin-left: 5px; font: 12px/16px arial, sans-serif;display: inline-block;white-space: normal;',
- style: "float:left; min-height: 16px;",
- 'default': '',
- onClick: function() {
- checkboxState[this.id] = (this.getValue() == false) ? 0 : 1;
- }
- },
- {
- type: 'checkbox',
- id: 'IgnoreWordsNumbers',
- label: 'Ignore Words with Numbers',
- labelStyle: 'margin-left: 5px; font: 12px/16px arial, sans-serif;display: inline-block;white-space: normal;',
- style: "float:left; min-height: 16px;",
- 'default': '',
- onClick: function() {
- checkboxState[this.id] = (this.getValue() == false) ? 0 : 1;
- }
- },
- {
- type: 'checkbox',
- id: 'IgnoreMixedCaseWords',
- label: 'Ignore Mixed-Case Words',
- labelStyle: 'margin-left: 5px; font: 12px/16px arial, sans-serif;display: inline-block;white-space: normal;',
- style: "float:left; min-height: 16px;",
- 'default': '',
- onClick: function() {
- checkboxState[this.id] = (this.getValue() == false) ? 0 : 1;
- }
- },
- {
- type: 'checkbox',
- id: 'IgnoreDomainNames',
- label: 'Ignore Domain Names',
- labelStyle: 'margin-left: 5px; font: 12px/16px arial, sans-serif;display: inline-block;white-space: normal;',
- style: "float:left; min-height: 16px;",
- 'default': '',
- onClick: function() {
- checkboxState[this.id] = (this.getValue() == false) ? 0 : 1;
- }
- }
- ]
- }
- ]
- },
- {
- type: 'vbox',
- id: 'Options_DictionaryName',
- children: [
- {
- type: 'text',
- id: 'DictionaryName',
- style: 'margin-bottom: 10px',
- label: 'Dictionary Name:',
- labelLayout: 'vertical',
- labelStyle: 'font: 12px/25px arial, sans-serif;',
- 'default': '',
- onLoad: function() {
- nameNode = this;
- var udn = NS.userDictionaryName ? NS.userDictionaryName : tools.getCookie('udn') && undefined ? ' ' : this.getValue();
- this.setValue(udn);
- },
- onShow: function() {
- nameNode = this;
- var udn = !tools.getCookie('udn') ? this.getValue() : tools.getCookie('udn');
- this.setValue(udn);
-
- this.setLabel(NS.LocalizationComing['DictionaryName']);
- },
- onHide: function() {
- this.reset();
- }
- },
- {
- type: 'hbox',
- id: 'Options_buttons',
- children: [
-
- {
- type: 'vbox',
- id: 'Options_leftCol_col',
- widths: ['50%', '50%'],
- children: [
- {
- type: 'button',
- id: 'create',
- label: 'Create',
- title: 'Create',
- style: 'width: 100%;',
- onLoad: function() {
- this.getElement().setAttribute("title-cmd", this.id);
- },
- onShow: function() {
- this.getElement().setText(NS.LocalizationComing['Create']);
- },
- onClick: sendDicOptions
- },
- {
- type: 'button',
- id: 'restore',
- label: 'Restore',
- title: 'Restore',
- style: 'width: 100%;',
- onLoad: function() {
- this.getElement().setAttribute("title-cmd", this.id);
- },
- onShow: function() {
- this.getElement().setText(NS.LocalizationComing['Restore']);
- },
- onClick: sendDicOptions
- }
- ]
- },
- {
- type: 'vbox',
- id: 'Options_rightCol_col',
- widths: ['50%', '50%'],
- children: [
- {
- type: 'button',
- id: 'rename',
- label: 'Rename',
- title: 'Rename',
- style: 'width: 100%;',
- onLoad: function() {
- this.getElement().setAttribute("title-cmd", this.id);
- },
- onShow: function() {
- this.getElement().setText(NS.LocalizationComing['Rename']);
- },
- onClick: sendDicOptions
- },
- {
- type: 'button',
- id: 'delete',
- label: 'Remove',
- title: 'Remove',
- style: 'width: 100%;',
- onLoad: function() {
- this.getElement().setAttribute("title-cmd", this.id);
- },
- onShow: function() {
- this.getElement().setText(NS.LocalizationComing['Remove']);
- },
- onClick: sendDicOptions
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- type: 'hbox',
- id: 'Options_text',
- children: [
- {
- type: 'html',
- style: "text-align: justify;margin-top: 15px;white-space: normal!important; font-size: 12px;color:#777;",
- html: "<div>" + NS.LocalizationComing['OptionsTextIntro'] + "</div>",
- onShow: function() {
- this.getElement().setText(NS.LocalizationComing['OptionsTextIntro']);
-
- }
- }
- ]
- }
- ]
- }
- ]
- }
- ],
- buttons: [CKEDITOR.dialog.okButton, CKEDITOR.dialog.cancelButton],
- onOk: function() {
- //sendCheckboxOptions(checkboxState);
- sendAllOptions();
- OptionsTextError.getElement().hide();
- OptionsTextError.getElement().setHtml(' ');
- },
- onLoad: function() {
- dialog = this;
- manageMessage.init(cameOptions);
-
- linkOnCheckbox['IgnoreAllCapsWords'] = dialog.getContentElement('OptionsTab', 'IgnoreAllCapsWords');
- linkOnCheckbox['IgnoreWordsNumbers'] = dialog.getContentElement('OptionsTab', 'IgnoreWordsNumbers');
- linkOnCheckbox['IgnoreMixedCaseWords'] = dialog.getContentElement('OptionsTab', 'IgnoreMixedCaseWords');
- linkOnCheckbox['IgnoreDomainNames'] = dialog.getContentElement('OptionsTab', 'IgnoreDomainNames');
-
- },
- onShow: function() {
- setHandlerOptions();
-
- (checkboxState['IgnoreAllCapsWords'] == 0) ? linkOnCheckbox['IgnoreAllCapsWords'].setValue('', false) : linkOnCheckbox['IgnoreAllCapsWords'].setValue('checked', false);
- (checkboxState['IgnoreWordsNumbers'] == 0) ? linkOnCheckbox['IgnoreWordsNumbers'].setValue('', false) : linkOnCheckbox['IgnoreWordsNumbers'].setValue('checked', false);
- (checkboxState['IgnoreMixedCaseWords'] == 0) ? linkOnCheckbox['IgnoreMixedCaseWords'].setValue('', false) : linkOnCheckbox['IgnoreMixedCaseWords'].setValue('checked', false);
- (checkboxState['IgnoreDomainNames'] == 0) ? linkOnCheckbox['IgnoreDomainNames'].setValue('', false) : linkOnCheckbox['IgnoreDomainNames'].setValue('checked', false);
-
- checkboxState['IgnoreAllCapsWords'] = (linkOnCheckbox['IgnoreAllCapsWords'].getValue() == false) ? 0 : 1;
- checkboxState['IgnoreWordsNumbers'] = (linkOnCheckbox['IgnoreWordsNumbers'].getValue() == false) ? 0 : 1;
- checkboxState['IgnoreMixedCaseWords'] = (linkOnCheckbox['IgnoreMixedCaseWords'].getValue() == false) ? 0 : 1;
- checkboxState['IgnoreDomainNames'] = (linkOnCheckbox['IgnoreDomainNames'].getValue() == false) ? 0 : 1;
-
- linkOnCheckbox['IgnoreAllCapsWords'].getElement().$.lastChild.innerHTML = NS.LocalizationComing['IgnoreAllCapsWords'];
- linkOnCheckbox['IgnoreWordsNumbers'].getElement().$.lastChild.innerHTML = NS.LocalizationComing['IgnoreWordsWithNumbers'];
- linkOnCheckbox['IgnoreMixedCaseWords'].getElement().$.lastChild.innerHTML = NS.LocalizationComing['IgnoreMixedCaseWords'];
- linkOnCheckbox['IgnoreDomainNames'].getElement().$.lastChild.innerHTML = NS.LocalizationComing['IgnoreDomainNames'];
- }
- };
-});
+/*
+ Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
+ For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+(function(){function v(a){if(!a)throw"Languages-by-groups list are required for construct selectbox";var c=[],d="",f;for(f in a)for(var g in a[f]){var h=a[f][g];"en_US"==h?d=h:c.push(h)}c.sort();d&&c.unshift(d);return{getCurrentLangGroup:function(c){a:{for(var d in a)for(var f in a[d])if(f.toUpperCase()===c.toUpperCase()){c=d;break a}c=""}return c},setLangList:function(){var c={},d;for(d in a)for(var f in a[d])c[a[d][f]]=f;return c}()}}var e=function(){var a=function(a,b,f){var f=f||{},g=f.expires;
+if("number"==typeof g&&g){var h=new Date;h.setTime(h.getTime()+1E3*g);g=f.expires=h}g&&g.toUTCString&&(f.expires=g.toUTCString());var b=encodeURIComponent(b),a=a+"="+b,e;for(e in f)b=f[e],a+="; "+e,!0!==b&&(a+="="+b);document.cookie=a};return{postMessage:{init:function(a){document.addEventListener?window.addEventListener("message",a,!1):window.attachEvent("onmessage",a)},send:function(a){var b=a.fn||null,f=a.id||"",g=a.target||window,h=a.message||{id:f};"[object Object]"==Object.prototype.toString.call(a.message)&&
+(a.message.id||(a.message.id=f),h=a.message);a=window.JSON.stringify(h,b);g.postMessage(a,"*")}},hash:{create:function(){},parse:function(){}},cookie:{set:a,get:function(a){return(a=document.cookie.match(RegExp("(?:^|; )"+a.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)")))?decodeURIComponent(a[1]):void 0},remove:function(c){a(c,"",{expires:-1})}}}}(),a=a||{};a.TextAreaNumber=null;a.load=!0;a.cmd={SpellTab:"spell",Thesaurus:"thes",GrammTab:"grammar"};a.dialog=null;a.optionNode=null;a.selectNode=
+null;a.grammerSuggest=null;a.textNode={};a.iframeMain=null;a.dataTemp="";a.div_overlay=null;a.textNodeInfo={};a.selectNode={};a.selectNodeResponce={};a.langList=null;a.langSelectbox=null;a.banner="";a.show_grammar=null;a.div_overlay_no_check=null;a.targetFromFrame={};a.onLoadOverlay=null;a.LocalizationComing={};a.OverlayPlace=null;a.LocalizationButton={ChangeTo:{instance:null,text:"Change to"},ChangeAll:{instance:null,text:"Change All"},IgnoreWord:{instance:null,text:"Ignore word"},IgnoreAllWords:{instance:null,
+text:"Ignore all words"},Options:{instance:null,text:"Options",optionsDialog:{instance:null}},AddWord:{instance:null,text:"Add word"},FinishChecking:{instance:null,text:"Finish Checking"}};a.LocalizationLabel={ChangeTo:{instance:null,text:"Change to"},Suggestions:{instance:null,text:"Suggestions"}};var w=function(b){for(var c in b)b[c].instance.getElement().setText(a.LocalizationComing[c])},x=function(b){for(var c in b){if(!b[c].instance.setLabel)break;b[c].instance.setLabel(a.LocalizationComing[c])}},
+j,n;a.framesetHtml=function(b){return'<iframe src="'+a.templatePath+'" id='+a.iframeNumber+"_"+b+' frameborder="0" allowtransparency="1" style="width:100%;border: 1px solid #AEB3B9;overflow: auto;background:#fff; border-radius: 3px;"></iframe>'};a.setIframe=function(b,c){var d=a.framesetHtml(c);return b.getElement().setHtml(d)};a.setCurrentIframe=function(b){a.setIframe(a.dialog._.contents[b].Content,b)};a.setHeightBannerFrame=function(){var b=a.dialog.getContentElement("SpellTab","banner").getElement(),
+c=a.dialog.getContentElement("GrammTab","banner").getElement(),d=a.dialog.getContentElement("Thesaurus","banner").getElement();b.setStyle("height","90px");c.setStyle("height","90px");d.setStyle("height","90px")};a.setHeightFrame=function(){document.getElementById(a.iframeNumber+"_"+a.dialog._.currentTabId).style.height="240px"};a.sendData=function(b){var c=b._.currentTabId,d=b._.contents[c].Content,f,g;a.setIframe(d,c);b.parts.tabs.removeAllListeners();b.parts.tabs.on("click",function(h){h=h||window.event;
+h.data.getTarget().is("a")&&c!=b._.currentTabId&&(c=b._.currentTabId,d=b._.contents[c].Content,f=a.iframeNumber+"_"+c,a.div_overlay.setEnable(),d.getElement().getChildCount()?s(a.targetFromFrame[f],a.cmd[c]):(a.setIframe(d,c),g=document.getElementById(f),a.targetFromFrame[f]=g.contentWindow))})};a.buildSelectLang=function(a){var c=new CKEDITOR.dom.element("div"),d=new CKEDITOR.dom.element("select"),a="wscLang"+a;c.addClass("cke_dialog_ui_input_select");c.setAttribute("role","presentation");c.setStyles({height:"auto",
+position:"absolute",right:"0",top:"-1px",width:"160px","white-space":"normal"});d.setAttribute("id",a);d.addClass("cke_dialog_ui_input_select");d.setStyles({width:"160px"});c.append(d);return c};a.buildOptionLang=function(b,c){var d=document.getElementById("wscLang"+c),f=document.createDocumentFragment(),g,h,e=[];if(0===d.options.length){for(g in b)e.push([g,b[g]]);e.sort();for(var k=0;k<e.length;k++)g=document.createElement("option"),g.setAttribute("value",e[k][1]),h=document.createTextNode(e[k][0]),
+g.appendChild(h),e[k][1]==a.selectingLang&&g.setAttribute("selected","selected"),f.appendChild(g);d.appendChild(f)}};a.buildOptionSynonyms=function(b){b=a.selectNodeResponce[b];a.selectNode.synonyms.clear();for(var c=0;c<b.length;c++)a.selectNode.synonyms.add(b[c],b[c]);a.selectNode.synonyms.getInputElement().$.firstChild.selected=!0;a.textNode.Thesaurus.setValue(a.selectNode.synonyms.getInputElement().getValue())};var o=function(a){var c=document,d=a.target||c.body,f=a.id||"overlayBlock",g=a.opacity||
+"0.9",a=a.background||"#f1f1f1",e=c.getElementById(f),i=e||c.createElement("div");i.style.cssText="position: absolute;top:30px;bottom:41px;left:1px;right:1px;z-index: 10020;padding:0;margin:0;background:"+a+";opacity: "+g+";filter: alpha(opacity="+100*g+");display: none;";i.id=f;e||d.appendChild(i);return{setDisable:function(){i.style.display="none"},setEnable:function(){i.style.display="block"}}},y=function(b,c,d){var f=new CKEDITOR.dom.element("div"),g=new CKEDITOR.dom.element("input"),e=new CKEDITOR.dom.element("label"),
+i="wscGrammerSuggest"+b+"_"+c;f.addClass("cke_dialog_ui_input_radio");f.setAttribute("role","presentation");f.setStyles({width:"97%",padding:"5px","white-space":"normal"});g.setAttributes({type:"radio",value:c,name:"wscGrammerSuggest",id:i});g.setStyles({"float":"left"});g.on("click",function(b){a.textNode.GrammTab.setValue(b.sender.getValue())});d&&g.setAttribute("checked",!0);g.addClass("cke_dialog_ui_radio_input");e.appendText(b);e.setAttribute("for",i);e.setStyles({display:"block","line-height":"16px",
+"margin-left":"18px","white-space":"normal"});f.append(g);f.append(e);return f},t=function(a){a=a||"true";null!==a&&"false"==a&&p()},m=function(b){var c=new v(b),b="wscLang"+a.dialog.getParentEditor().name,b=document.getElementById(b),d=a.iframeNumber+"_"+a.dialog._.currentTabId;a.buildOptionLang(c.setLangList,a.dialog.getParentEditor().name);u[c.getCurrentLangGroup(a.selectingLang)]();t(a.show_grammar);b.onchange=function(){u[c.getCurrentLangGroup(this.value)]();t(a.show_grammar);a.div_overlay.setEnable();
+a.selectingLang=this.value;e.postMessage.send({message:{changeLang:a.selectingLang,text:a.dataTemp},target:a.targetFromFrame[d],id:"selectionLang_outer__page"})}},z=function(b){if("no_any_suggestions"==b){b="No suggestions";a.LocalizationButton.ChangeTo.instance.disable();a.LocalizationButton.ChangeAll.instance.disable();var c=function(b){b=a.LocalizationButton[b].instance;b.getElement().hasClass("cke_disabled")?b.getElement().setStyle("color","#a0a0a0"):b.disable()};c("ChangeTo");c("ChangeAll")}else a.LocalizationButton.ChangeTo.instance.enable(),
+a.LocalizationButton.ChangeAll.instance.enable(),a.LocalizationButton.ChangeTo.instance.getElement().setStyle("color","#333"),a.LocalizationButton.ChangeAll.instance.getElement().setStyle("color","#333");return b},A={iframeOnload:function(){a.div_overlay.setEnable();var b=a.dialog._.currentTabId;s(a.targetFromFrame[a.iframeNumber+"_"+b],a.cmd[b])},suggestlist:function(b){delete b.id;a.div_overlay_no_check.setDisable();q();m(a.langList);var c=z(b.word),d="";c instanceof Array&&(c=b.word[0]);d=c=c.split(",");
+n.clear();a.textNode.SpellTab.setValue(d[0]);for(b=0;b<d.length;b++)n.add(d[b],d[b]);l();a.div_overlay.setDisable()},grammerSuggest:function(b){delete b.id;delete b.mocklangs;q();m(a.langList);var c=b.grammSuggest[0];a.grammerSuggest.getElement().setHtml("");a.textNode.GrammTab.reset();a.textNode.GrammTab.setValue(c);a.textNodeInfo.GrammTab.getElement().setHtml("");a.textNodeInfo.GrammTab.getElement().setText(b.info);for(var b=b.grammSuggest,c=b.length,d=!0,f=0;f<c;f++)a.grammerSuggest.getElement().append(y(b[f],
+b[f],d)),d=!1;l();a.div_overlay.setDisable()},thesaurusSuggest:function(b){delete b.id;delete b.mocklangs;q();m(a.langList);a.selectNodeResponce=b;a.textNode.Thesaurus.reset();a.selectNode.categories.clear();for(var c in b)a.selectNode.categories.add(c,c);b=a.selectNode.categories.getInputElement().getChildren().$[0].value;a.selectNode.categories.getInputElement().getChildren().$[0].selected=!0;a.buildOptionSynonyms(b);l();a.div_overlay.setDisable()},finish:function(b){delete b.id;a.dialog.getContentElement(a.dialog._.currentTabId,
+"bottomGroup").getElement().hide();a.dialog.getContentElement(a.dialog._.currentTabId,"BlockFinishChecking").getElement().show();a.div_overlay.setDisable()},settext:function(b){delete b.id;a.dialog.getParentEditor().getCommand("checkspell");var c=a.dialog.getParentEditor();c.focus();c.setData(b.text,function(){a.dataTemp="";c.unlockSelection();c.fire("saveSnapshot");a.dialog.hide()})},ReplaceText:function(b){delete b.id;a.div_overlay.setEnable();a.dataTemp=b.text;a.selectingLang=b.currentLang;window.setTimeout(function(){a.div_overlay.setDisable()},
+500);w(a.LocalizationButton);x(a.LocalizationLabel)},options_checkbox_send:function(b){delete b.id;b={osp:e.cookie.get("osp"),udn:e.cookie.get("udn"),cust_dic_ids:a.cust_dic_ids};e.postMessage.send({message:b,target:a.targetFromFrame[a.iframeNumber+"_"+a.dialog._.currentTabId],id:"options_outer__page"})},getOptions:function(b){var c=b.DefOptions.udn;a.LocalizationComing=b.DefOptions.localizationButtonsAndText;a.show_grammar=b.show_grammar;a.langList=b.lang;if(a.bnr=b.bannerId){a.setHeightBannerFrame();
+var d=b.banner;a.dialog.getContentElement(a.dialog._.currentTabId,"banner").getElement().setHtml(d)}else a.setHeightFrame();"undefined"==c&&(a.userDictionaryName?(c=a.userDictionaryName,d={osp:e.cookie.get("osp"),udn:a.userDictionaryName,cust_dic_ids:a.cust_dic_ids,id:"options_dic_send",udnCmd:"create"},e.postMessage.send({message:d,target:a.targetFromFrame[void 0]})):c="");e.cookie.set("osp",b.DefOptions.osp);e.cookie.set("udn",c);e.cookie.set("cust_dic_ids",b.DefOptions.cust_dic_ids);e.postMessage.send({id:"giveOptions"})},
+options_dic_send:function(){var b={osp:e.cookie.get("osp"),udn:e.cookie.get("udn"),cust_dic_ids:a.cust_dic_ids,id:"options_dic_send",udnCmd:e.cookie.get("udnCmd")};e.postMessage.send({message:b,target:a.targetFromFrame[a.iframeNumber+"_"+a.dialog._.currentTabId]})},data:function(a){delete a.id},giveOptions:function(){},setOptionsConfirmF:function(){},setOptionsConfirmT:function(){j.setValue("")},clickBusy:function(){a.div_overlay.setEnable()},suggestAllCame:function(){a.div_overlay.setDisable();a.div_overlay_no_check.setDisable()},
+TextCorrect:function(){m(a.langList)}},B=function(a){a=a||window.event;if((a=window.JSON.parse(a.data))&&a.id)A[a.id](a)},s=function(b,c,d,f){c=c||CKEDITOR.config.wsc_cmd;d=d||a.dataTemp;e.postMessage.send({message:{customerId:a.wsc_customerId,text:d,txt_ctrl:a.TextAreaNumber,cmd:c,cust_dic_ids:a.cust_dic_ids,udn:a.userDictionaryName,slang:a.selectingLang,reset_suggest:f||!1},target:b,id:"data_outer__page"});a.div_overlay.setEnable()},u={superset:function(){a.dialog.showPage("Thesaurus");a.dialog.showPage("GrammTab");
+r()},usual:function(){a.dialog.hidePage("Thesaurus");p();r()}},C=function(b){var c=new function(a){var b={};return{getCmdByTab:function(c){for(var e in a)b[a[e]]=e;return b[c]}}}(a.cmd);b.selectPage(c.getCmdByTab(CKEDITOR.config.wsc_cmd));a.sendData(b)},p=function(){a.dialog.hidePage("GrammTab")},r=function(){a.dialog.showPage("SpellTab")},l=function(){a.dialog.getContentElement(a.dialog._.currentTabId,"bottomGroup").getElement().show()},q=function(){a.dialog.getContentElement(a.dialog._.currentTabId,
+"BlockFinishChecking").getElement().hide()};CKEDITOR.dialog.add("checkspell",function(b){var c=function(){a.div_overlay.setEnable();var c=a.dialog._.currentTabId,f=a.iframeNumber+"_"+c,g=a.textNode[c].getValue(),h=this.getElement().getAttribute("title-cmd");e.postMessage.send({message:{cmd:h,tabId:c,new_word:g},target:a.targetFromFrame[f],id:"cmd_outer__page"});("ChangeTo"==h||"ChangeAll"==h)&&b.fire("saveSnapshot");"FinishChecking"==h&&b.config.wsc_onFinish.call(CKEDITOR.document.getWindow().getFrame())};
+return{title:b.config.wsc_dialogTitle||b.lang.wsc.title,minWidth:560,minHeight:444,buttons:[CKEDITOR.dialog.cancelButton],onLoad:function(){a.dialog=this;a.dialog.hidePage("Thesaurus");p();r()},onShow:function(){b.lockSelection(b.getSelection());a.TextAreaNumber="cke_textarea_"+CKEDITOR.currentInstance.name;e.postMessage.init(B);a.dataTemp=CKEDITOR.currentInstance.getData();a.OverlayPlace=a.dialog.parts.tabs.getParent().$;if(CKEDITOR&&CKEDITOR.config){a.wsc_customerId=b.config.wsc_customerId;a.cust_dic_ids=
+b.config.wsc_customDictionaryIds;a.userDictionaryName=b.config.wsc_userDictionaryName;a.defaultLanguage=CKEDITOR.config.defaultLanguage;var c="file:"==document.location.protocol?"http:":document.location.protocol;CKEDITOR.scriptLoader.load(b.config.wsc_customLoaderScript||c+"//loader.webspellchecker.net/sproxy_fck/sproxy.php?plugin=fck2&customerid="+a.wsc_customerId+"&cmd=script&doc=wsc&schema=22",function(c){CKEDITOR.config&&CKEDITOR.config.wsc&&CKEDITOR.config.wsc.DefaultParams?(a.serverLocationHash=
+CKEDITOR.config.wsc.DefaultParams.serviceHost,a.logotype=CKEDITOR.config.wsc.DefaultParams.logoPath,a.loadIcon=CKEDITOR.config.wsc.DefaultParams.iconPath,a.loadIconEmptyEditor=CKEDITOR.config.wsc.DefaultParams.iconPathEmptyEditor,a.LangComparer=new CKEDITOR.config.wsc.DefaultParams._SP_FCK_LangCompare):(a.serverLocationHash=DefaultParams.serviceHost,a.logotype=DefaultParams.logoPath,a.loadIcon=DefaultParams.iconPath,a.loadIconEmptyEditor=DefaultParams.iconPathEmptyEditor,a.LangComparer=new _SP_FCK_LangCompare);
+a.pluginPath=CKEDITOR.getUrl(b.plugins.wsc.path);a.iframeNumber=a.TextAreaNumber;a.templatePath=a.pluginPath+"dialogs/tmp.html";a.LangComparer.setDefaulLangCode(a.defaultLanguage);a.currentLang=b.config.wsc_lang||a.LangComparer.getSPLangCode(b.langCode);a.selectingLang=a.currentLang;a.div_overlay=new o({opacity:"1",background:"#fff url("+a.loadIcon+") no-repeat 50% 50%",target:a.OverlayPlace});var d=a.dialog.parts.tabs.getId(),d=CKEDITOR.document.getById(d);d.setStyle("width","97%");d.getElementsByTag("DIV").count()||
+d.append(a.buildSelectLang(a.dialog.getParentEditor().name));a.div_overlay_no_check=new o({opacity:"1",id:"no_check_over",background:"#fff url("+a.loadIconEmptyEditor+") no-repeat 50% 50%",target:a.OverlayPlace});c&&(C(a.dialog),a.dialog.setupContent(a.dialog))})}else a.dialog.hide()},onHide:function(){a.dataTemp=""},contents:[{id:"SpellTab",label:"SpellChecker",accessKey:"S",elements:[{type:"html",id:"banner",label:"banner",style:"",html:"<div></div>"},{type:"html",id:"Content",label:"spellContent",
+html:"",setup:function(b){var b=a.iframeNumber+"_"+b._.currentTabId,c=document.getElementById(b);a.targetFromFrame[b]=c.contentWindow}},{type:"hbox",id:"bottomGroup",style:"width:560px; margin: 0 auto;",widths:["50%","50%"],children:[{type:"hbox",id:"leftCol",align:"left",width:"50%",children:[{type:"vbox",id:"rightCol1",widths:["50%","50%"],children:[{type:"text",id:"text",label:a.LocalizationLabel.ChangeTo.text+":",labelLayout:"horizontal",labelStyle:"font: 12px/25px arial, sans-serif;",width:"140px",
+"default":"",onShow:function(){a.textNode.SpellTab=this;a.LocalizationLabel.ChangeTo.instance=this},onHide:function(){this.reset()}},{type:"hbox",id:"rightCol",align:"right",width:"30%",children:[{type:"vbox",id:"rightCol_col__left",children:[{type:"text",id:"labelSuggestions",label:a.LocalizationLabel.Suggestions.text+":",onShow:function(){a.LocalizationLabel.Suggestions.instance=this;this.getInputElement().hide()}},{type:"html",id:"logo",html:'<img width="99" height="68" border="0" src="" title="WebSpellChecker.net" alt="WebSpellChecker.net" style="display: inline-block;">',
+setup:function(){this.getElement().$.src=a.logotype;this.getElement().getParent().setStyles({"text-align":"left"})}}]},{type:"select",id:"list_of_suggestions",labelStyle:"font: 12px/25px arial, sans-serif;",size:"6",inputStyle:"width: 140px; height: auto;",items:[["loading..."]],onShow:function(){n=this},onHide:function(){this.clear()},onChange:function(){a.textNode.SpellTab.setValue(this.getValue())}}]}]}]},{type:"hbox",id:"rightCol",align:"right",width:"50%",children:[{type:"vbox",id:"rightCol_col__left",
+widths:["50%","50%","50%","50%"],children:[{type:"button",id:"ChangeTo",label:a.LocalizationButton.ChangeTo.text,title:"Change to",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id);a.LocalizationButton.ChangeTo.instance=this},onClick:c},{type:"button",id:"ChangeAll",label:a.LocalizationButton.ChangeAll.text,title:"Change All",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id);a.LocalizationButton.ChangeAll.instance=this},
+onClick:c},{type:"button",id:"AddWord",label:a.LocalizationButton.AddWord.text,title:"Add word",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id);a.LocalizationButton.AddWord.instance=this},onClick:c},{type:"button",id:"FinishChecking",label:a.LocalizationButton.FinishChecking.text,title:"Finish Checking",style:"width: 100%;margin-top: 9px;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id);a.LocalizationButton.FinishChecking.instance=this},
+onClick:c}]},{type:"vbox",id:"rightCol_col__right",widths:["50%","50%","50%"],children:[{type:"button",id:"IgnoreWord",label:a.LocalizationButton.IgnoreWord.text,title:"Ignore word",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id);a.LocalizationButton.IgnoreWord.instance=this},onClick:c},{type:"button",id:"IgnoreAllWords",label:a.LocalizationButton.IgnoreAllWords.text,title:"Ignore all words",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",
+this.id);a.LocalizationButton.IgnoreAllWords.instance=this},onClick:c},{type:"button",id:"option",label:a.LocalizationButton.Options.text,title:"Option",style:"width: 100%;",onLoad:function(){a.LocalizationButton.Options.instance=this;"file:"==document.location.protocol&&this.disable()},onClick:function(){"file:"==document.location.protocol?alert("WSC: Options functionality is disabled when runing from file system"):b.openDialog("options")}}]}]}]},{type:"hbox",id:"BlockFinishChecking",style:"width:560px; margin: 0 auto;",
+widths:["70%","30%"],onShow:function(){this.getElement().hide()},onHide:l,children:[{type:"hbox",id:"leftCol",align:"left",width:"70%",children:[{type:"vbox",id:"rightCol1",setup:function(){this.getChild()[0].getElement().$.src=a.logotype;this.getChild()[0].getElement().getParent().setStyles({"text-align":"center"})},children:[{type:"html",id:"logo",html:'<img width="99" height="68" border="0" src="" title="WebSpellChecker.net" alt="WebSpellChecker.net" style="display: inline-block;">'}]}]},{type:"hbox",
+id:"rightCol",align:"right",width:"30%",children:[{type:"vbox",id:"rightCol_col__left",children:[{type:"button",id:"Option_button",label:a.LocalizationButton.Options.text,title:"Option",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id);"file:"==document.location.protocol&&this.disable()},onClick:function(){"file:"==document.location.protocol?alert("WSC: Options functionality is disabled when runing from file system"):b.openDialog("options")}},{type:"button",
+id:"FinishChecking",label:a.LocalizationButton.FinishChecking.text,title:"Finish Checking",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onClick:c}]}]}]}]},{id:"GrammTab",label:"Grammar",accessKey:"G",elements:[{type:"html",id:"banner",label:"banner",style:"",html:"<div></div>"},{type:"html",id:"Content",label:"GrammarContent",html:"",setup:function(){var b=a.iframeNumber+"_"+a.dialog._.currentTabId,c=document.getElementById(b);a.targetFromFrame[b]=c.contentWindow}},
+{type:"vbox",id:"bottomGroup",style:"width:560px; margin: 0 auto;",children:[{type:"hbox",id:"leftCol",widths:["66%","34%"],children:[{type:"vbox",children:[{type:"text",id:"text",label:"Change to:",labelLayout:"horizontal",labelStyle:"font: 12px/25px arial, sans-serif;",inputStyle:"float: right; width: 200px;","default":"",onShow:function(){a.textNode.GrammTab=this},onHide:function(){this.reset()}},{type:"html",id:"html_text",html:"<div style='min-height: 17px; line-height: 17px; padding: 5px; text-align: left;background: #F1F1F1;color: #595959; white-space: normal!important;'></div>",
+onShow:function(){a.textNodeInfo.GrammTab=this}},{type:"html",id:"radio",html:"",onShow:function(){a.grammerSuggest=this}}]},{type:"vbox",children:[{type:"button",id:"ChangeTo",label:"Change to",title:"Change to",style:"width: 133px; float: right;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onClick:c},{type:"button",id:"IgnoreWord",label:"Ignore word",title:"Ignore word",style:"width: 133px; float: right;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},
+onClick:c},{type:"button",id:"IgnoreAllWords",label:"Ignore Problem",title:"Ignore Problem",style:"width: 133px; float: right;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onClick:c},{type:"button",id:"FinishChecking",label:"Finish Checking",title:"Finish Checking",style:"width: 133px; float: right; margin-top: 9px;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onClick:c}]}]}]},{type:"hbox",id:"BlockFinishChecking",style:"width:560px; margin: 0 auto;",
+widths:["70%","30%"],onShow:function(){this.getElement().hide()},onHide:l,children:[{type:"hbox",id:"leftCol",align:"left",width:"70%",children:[{type:"vbox",id:"rightCol1",children:[{type:"html",id:"logo",html:'<img width="99" height="68" border="0" src="" title="WebSpellChecker.net" alt="WebSpellChecker.net" style="display: inline-block;">',setup:function(){this.getElement().$.src=a.logotype;this.getElement().getParent().setStyles({"text-align":"center"})}}]}]},{type:"hbox",id:"rightCol",align:"right",
+width:"30%",children:[{type:"vbox",id:"rightCol_col__left",children:[{type:"button",id:"FinishChecking",label:"Finish Checking",title:"Finish Checking",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onClick:c}]}]}]}]},{id:"Thesaurus",label:"Thesaurus",accessKey:"T",elements:[{type:"html",id:"banner",label:"banner",style:"",html:"<div></div>"},{type:"html",id:"Content",label:"spellContent",html:"",setup:function(){var b=a.iframeNumber+"_"+a.dialog._.currentTabId,
+c=document.getElementById(b);a.targetFromFrame[b]=c.contentWindow}},{type:"vbox",id:"bottomGroup",style:"width:560px; margin: -10px auto; overflow: hidden;",children:[{type:"hbox",widths:["75%","25%"],children:[{type:"vbox",children:[{type:"hbox",widths:["65%","35%"],children:[{type:"text",id:"ChangeTo",label:"Change to:",labelLayout:"horizontal",inputStyle:"width: 160px;",labelStyle:"font: 12px/25px arial, sans-serif;","default":"",onShow:function(){a.textNode.Thesaurus=this},onHide:function(){this.reset()}},
+{type:"button",id:"ChangeTo",label:"Change to",title:"Change to",style:"width: 121px; margin-top: 1px;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onClick:c}]},{type:"hbox",children:[{type:"select",id:"categories",label:"Categories:",labelStyle:"font: 12px/25px arial, sans-serif;",size:"5",inputStyle:"width: 180px; height: auto;",items:[],onShow:function(){a.selectNode.categories=this},onHide:function(){this.clear()},onChange:function(){a.buildOptionSynonyms(this.getValue())}},
+{type:"select",id:"synonyms",label:"Synonyms:",labelStyle:"font: 12px/25px arial, sans-serif;",size:"5",inputStyle:"width: 180px; height: auto;",items:[],onShow:function(){a.selectNode.synonyms=this;a.textNode.Thesaurus.setValue(this.getValue())},onHide:function(){this.clear()},onChange:function(){a.textNode.Thesaurus.setValue(this.getValue())}}]}]},{type:"vbox",width:"120px",style:"margin-top:46px;",children:[{type:"html",id:"logotype",label:"WebSpellChecker.net",html:'<img width="99" height="68" border="0" src="" title="WebSpellChecker.net" alt="WebSpellChecker.net" style="display: inline-block;">',
+setup:function(){this.getElement().$.src=a.logotype;this.getElement().getParent().setStyles({"text-align":"center"})}},{type:"button",id:"FinishChecking",label:"Finish Checking",title:"Finish Checking",style:"width: 121px; float: right; margin-top: 9px;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onClick:c}]}]}]},{type:"hbox",id:"BlockFinishChecking",style:"width:560px; margin: 0 auto;",widths:["70%","30%"],onShow:function(){this.getElement().hide()},children:[{type:"hbox",
+id:"leftCol",align:"left",width:"70%",children:[{type:"vbox",id:"rightCol1",children:[{type:"html",id:"logo",html:'<img width="99" height="68" border="0" src="" title="WebSpellChecker.net" alt="WebSpellChecker.net" style="display: inline-block;">',setup:function(){this.getElement().$.src=a.logotype;this.getElement().getParent().setStyles({"text-align":"center"})}}]}]},{type:"hbox",id:"rightCol",align:"right",width:"30%",children:[{type:"vbox",id:"rightCol_col__left",children:[{type:"button",id:"FinishChecking",
+label:"Finish Checking",title:"Finish Checking",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onClick:c}]}]}]}]}]}});CKEDITOR.dialog.add("options",function(){var b=null,c={},d={},f=null,g=null;e.cookie.get("udn");e.cookie.get("osp");var h=function(){g=this.getElement().getAttribute("title-cmd");var a=[];a[0]=d.IgnoreAllCapsWords;a[1]=d.IgnoreWordsNumbers;a[2]=d.IgnoreMixedCaseWords;a[3]=d.IgnoreDomainNames;a=a.toString().replace(/,/g,"");e.cookie.set("osp",
+a);e.cookie.set("udnCmd",g?g:"ignore");"delete"!=g&&(a="",""!==j.getValue()&&(a=j.getValue()),e.cookie.set("udn",a));e.postMessage.send({id:"options_dic_send"})},i=function(){f.getElement().setHtml(a.LocalizationComing.error);f.getElement().show()};return{title:a.LocalizationComing.Options,minWidth:430,minHeight:130,resizable:CKEDITOR.DIALOG_RESIZE_NONE,contents:[{id:"OptionsTab",label:"Options",accessKey:"O",elements:[{type:"hbox",id:"options_error",children:[{type:"html",style:"display: block;text-align: center;white-space: normal!important; font-size: 12px;color:red",
+html:"<div></div>",onShow:function(){f=this}}]},{type:"vbox",id:"Options_content",children:[{type:"hbox",id:"Options_manager",widths:["52%","48%"],children:[{type:"fieldset",label:"Spell Checking Options",style:"border: none;margin-top: 13px;padding: 10px 0 10px 10px",onShow:function(){this.getInputElement().$.children[0].innerHTML=a.LocalizationComing.SpellCheckingOptions},children:[{type:"vbox",id:"Options_checkbox",children:[{type:"checkbox",id:"IgnoreAllCapsWords",label:"Ignore All-Caps Words",
+labelStyle:"margin-left: 5px; font: 12px/16px arial, sans-serif;display: inline-block;white-space: normal;",style:"float:left; min-height: 16px;","default":"",onClick:function(){d[this.id]=!this.getValue()?0:1}},{type:"checkbox",id:"IgnoreWordsNumbers",label:"Ignore Words with Numbers",labelStyle:"margin-left: 5px; font: 12px/16px arial, sans-serif;display: inline-block;white-space: normal;",style:"float:left; min-height: 16px;","default":"",onClick:function(){d[this.id]=!this.getValue()?0:1}},{type:"checkbox",
+id:"IgnoreMixedCaseWords",label:"Ignore Mixed-Case Words",labelStyle:"margin-left: 5px; font: 12px/16px arial, sans-serif;display: inline-block;white-space: normal;",style:"float:left; min-height: 16px;","default":"",onClick:function(){d[this.id]=!this.getValue()?0:1}},{type:"checkbox",id:"IgnoreDomainNames",label:"Ignore Domain Names",labelStyle:"margin-left: 5px; font: 12px/16px arial, sans-serif;display: inline-block;white-space: normal;",style:"float:left; min-height: 16px;","default":"",onClick:function(){d[this.id]=
+!this.getValue()?0:1}}]}]},{type:"vbox",id:"Options_DictionaryName",children:[{type:"text",id:"DictionaryName",style:"margin-bottom: 10px",label:"Dictionary Name:",labelLayout:"vertical",labelStyle:"font: 12px/25px arial, sans-serif;","default":"",onLoad:function(){j=this;this.setValue(a.userDictionaryName?a.userDictionaryName:(e.cookie.get("udn"),this.getValue()))},onShow:function(){j=this;this.setValue(!e.cookie.get("udn")?this.getValue():e.cookie.get("udn"));this.setLabel(a.LocalizationComing.DictionaryName)},
+onHide:function(){this.reset()}},{type:"hbox",id:"Options_buttons",children:[{type:"vbox",id:"Options_leftCol_col",widths:["50%","50%"],children:[{type:"button",id:"create",label:"Create",title:"Create",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onShow:function(){this.getElement().setText(a.LocalizationComing.Create)},onClick:h},{type:"button",id:"restore",label:"Restore",title:"Restore",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",
+this.id)},onShow:function(){this.getElement().setText(a.LocalizationComing.Restore)},onClick:h}]},{type:"vbox",id:"Options_rightCol_col",widths:["50%","50%"],children:[{type:"button",id:"rename",label:"Rename",title:"Rename",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id)},onShow:function(){this.getElement().setText(a.LocalizationComing.Rename)},onClick:h},{type:"button",id:"delete",label:"Remove",title:"Remove",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",
+this.id)},onShow:function(){this.getElement().setText(a.LocalizationComing.Remove)},onClick:h}]}]}]}]},{type:"hbox",id:"Options_text",children:[{type:"html",style:"text-align: justify;margin-top: 15px;white-space: normal!important; font-size: 12px;color:#777;",html:"<div>"+a.LocalizationComing.OptionsTextIntro+"</div>",onShow:function(){this.getElement().setText(a.LocalizationComing.OptionsTextIntro)}}]}]}]}],buttons:[CKEDITOR.dialog.okButton,CKEDITOR.dialog.cancelButton],onOk:function(){var a=[];
+a[0]=d.IgnoreAllCapsWords;a[1]=d.IgnoreWordsNumbers;a[2]=d.IgnoreMixedCaseWords;a[3]=d.IgnoreDomainNames;a=a.toString().replace(/,/g,"");e.cookie.set("osp",a);e.cookie.set("udn",j.getValue());e.postMessage.send({id:"options_checkbox_send"});f.getElement().hide();f.getElement().setHtml(" ")},onLoad:function(){b=this;e.postMessage.init(i);c.IgnoreAllCapsWords=b.getContentElement("OptionsTab","IgnoreAllCapsWords");c.IgnoreWordsNumbers=b.getContentElement("OptionsTab","IgnoreWordsNumbers");c.IgnoreMixedCaseWords=
+b.getContentElement("OptionsTab","IgnoreMixedCaseWords");c.IgnoreDomainNames=b.getContentElement("OptionsTab","IgnoreDomainNames")},onShow:function(){var b=e.cookie.get("osp").split("");d.IgnoreAllCapsWords=b[0];d.IgnoreWordsNumbers=b[1];d.IgnoreMixedCaseWords=b[2];d.IgnoreDomainNames=b[3];!parseInt(d.IgnoreAllCapsWords,10)?c.IgnoreAllCapsWords.setValue("",!1):c.IgnoreAllCapsWords.setValue("checked",!1);!parseInt(d.IgnoreWordsNumbers,10)?c.IgnoreWordsNumbers.setValue("",!1):c.IgnoreWordsNumbers.setValue("checked",
+!1);!parseInt(d.IgnoreMixedCaseWords,10)?c.IgnoreMixedCaseWords.setValue("",!1):c.IgnoreMixedCaseWords.setValue("checked",!1);!parseInt(d.IgnoreDomainNames,10)?c.IgnoreDomainNames.setValue("",!1):c.IgnoreDomainNames.setValue("checked",!1);d.IgnoreAllCapsWords=!c.IgnoreAllCapsWords.getValue()?0:1;d.IgnoreWordsNumbers=!c.IgnoreWordsNumbers.getValue()?0:1;d.IgnoreMixedCaseWords=!c.IgnoreMixedCaseWords.getValue()?0:1;d.IgnoreDomainNames=!c.IgnoreDomainNames.getValue()?0:1;c.IgnoreAllCapsWords.getElement().$.lastChild.innerHTML=
+a.LocalizationComing.IgnoreAllCapsWords;c.IgnoreWordsNumbers.getElement().$.lastChild.innerHTML=a.LocalizationComing.IgnoreWordsWithNumbers;c.IgnoreMixedCaseWords.getElement().$.lastChild.innerHTML=a.LocalizationComing.IgnoreMixedCaseWords;c.IgnoreDomainNames.getElement().$.lastChild.innerHTML=a.LocalizationComing.IgnoreDomainNames}}});CKEDITOR.dialog.on("resize",function(b){var b=b.data,c=b.dialog,d=CKEDITOR.document.getById(a.iframeNumber+"_"+c._.currentTabId);"checkspell"==c._.name&&(a.bnr?d&&
+d.setSize("height",b.height-310):d&&d.setSize("height",b.height-220))});CKEDITOR.on("dialogDefinition",function(b){var c=b.data.definition;a.onLoadOverlay=new o({opacity:"1",background:"#fff",target:c.dialog.parts.tabs.getParent().$});a.onLoadOverlay.setEnable();c.dialog.on("show",function(){});c.dialog.on("cancel",function(){c.dialog.getParentEditor().config.wsc_onClose.call(this.document.getWindow().getFrame());a.div_overlay.setDisable();return!1},this,null,-1)})})(); \ No newline at end of file
diff --git a/plugins/wsc/dialogs/wsc_ie.js b/plugins/wsc/dialogs/wsc_ie.js
index 2995bee..6b39b00 100644..100755
--- a/plugins/wsc/dialogs/wsc_ie.js
+++ b/plugins/wsc/dialogs/wsc_ie.js
@@ -1,176 +1,11 @@
-/**
- * @license Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.html or http://ckeditor.com/license
- */
-
-CKEDITOR.dialog.add( 'checkspell', function( editor ) {
- var number = CKEDITOR.tools.getNextNumber(),
- iframeId = 'cke_frame_' + number,
- textareaId = 'cke_data_' + number,
- errorBoxId = 'cke_error_' + number,
- interval,
- protocol = document.location.protocol || 'http:',
- errorMsg = editor.lang.wsc.notAvailable;
-
- var pasteArea =
- '<textarea' +
- ' style="display: none"' +
- ' id="' + textareaId + '"' +
- ' rows="10"' +
- ' cols="40">' +
- ' </textarea><div' +
- ' id="' + errorBoxId + '"' +
- ' style="display:none;color:red;font-size:16px;font-weight:bold;padding-top:160px;text-align:center;z-index:11;">' +
- '</div><iframe' +
- ' src=""' +
- ' style="width:100%;background-color:#f1f1e3;"' +
- ' frameborder="0"' +
- ' name="' + iframeId + '"' +
- ' id="' + iframeId + '"' +
- ' allowtransparency="1">' +
- '</iframe>';
-
- var wscCoreUrl = editor.config.wsc_customLoaderScript || ( protocol + '//loader.webspellchecker.net/sproxy_fck/sproxy.php' + '?plugin=fck2'
- + '&customerid=' + editor.config.wsc_customerId
- + '&cmd=script&doc=wsc&schema=22'
- );
-
- if ( editor.config.wsc_customLoaderScript ) {
- errorMsg += '<p style="color:#000;font-size:11px;font-weight: normal;text-align:center;padding-top:10px">' +
- editor.lang.wsc.errorLoading.replace( /%s/g, editor.config.wsc_customLoaderScript ) + '</p>';
- }
-
- function burnSpelling( dialog, errorMsg ) {
- var i = 0;
- return function() {
- if ( typeof( window.doSpell ) == 'function' ) {
- //Call from window.setInteval expected at once.
- if ( typeof( interval ) != 'undefined' )
- window.clearInterval( interval );
-
- initAndSpell( dialog );
- } else if ( i++ == 180 ) // Timeout: 180 * 250ms = 45s.
- window._cancelOnError( errorMsg );
- };
- }
-
- window._cancelOnError = function( m ) {
- if ( typeof( window.WSC_Error ) == 'undefined' ) {
- CKEDITOR.document.getById( iframeId ).setStyle( 'display', 'none' );
- var errorBox = CKEDITOR.document.getById( errorBoxId );
- errorBox.setStyle( 'display', 'block' );
- errorBox.setHtml( m || editor.lang.wsc.notAvailable );
- }
- };
-
- function initAndSpell( dialog ) {
- var LangComparer = new window._SP_FCK_LangCompare(),
- // Language abbr standarts comparer.
- pluginPath = CKEDITOR.getUrl( editor.plugins.wsc.path + 'dialogs/' ),
- // Service paths corecting/preparing.
- framesetPath = pluginPath + 'tmpFrameset.html';
-
- // global var is used in FCK specific core
- // change on equal var used in fckplugin.js
- window.gFCKPluginName = 'wsc';
-
- LangComparer.setDefaulLangCode( editor.config.defaultLanguage );
-
- window.doSpell({
- ctrl: textareaId,
-
- lang: editor.config.wsc_lang || LangComparer.getSPLangCode( editor.langCode ),
- intLang: editor.config.wsc_uiLang || LangComparer.getSPLangCode( editor.langCode ),
- winType: iframeId, // If not defined app will run on winpopup.
-
- // Callback binding section.
- onCancel: function() {
- dialog.hide();
- },
- onFinish: function( dT ) {
- editor.focus();
- dialog.getParentEditor().setData( dT.value );
- dialog.hide();
- },
-
- // Some manipulations with client static pages.
- staticFrame: framesetPath,
- framesetPath: framesetPath,
- iframePath: pluginPath + 'ciframe.html',
-
- // Styles defining.
- schemaURI: pluginPath + 'wsc.css',
-
- userDictionaryName: editor.config.wsc_userDictionaryName,
- customDictionaryName: editor.config.wsc_customDictionaryIds && editor.config.wsc_customDictionaryIds.split( "," ),
- domainName: editor.config.wsc_domainName
-
- });
-
- // Hide user message console (if application was loaded more then after timeout).
- CKEDITOR.document.getById( errorBoxId ).setStyle( 'display', 'none' );
- CKEDITOR.document.getById( iframeId ).setStyle( 'display', 'block' );
- }
-
- return {
- title: editor.config.wsc_dialogTitle || editor.lang.wsc.title,
- minWidth: 485,
- minHeight: 380,
- buttons: [ CKEDITOR.dialog.cancelButton ],
- onShow: function() {
- var contentArea = this.getContentElement( 'general', 'content' ).getElement();
- contentArea.setHtml( pasteArea );
- contentArea.getChild( 2 ).setStyle( 'height', this._.contentSize.height + 'px' );
-
- if ( typeof( window.doSpell ) != 'function' ) {
- // Load script.
- CKEDITOR.document.getHead().append( CKEDITOR.document.createElement( 'script', {
- attributes: {
- type: 'text/javascript',
- src: wscCoreUrl
- }
- }));
- }
-
- var sData = editor.getData(); // Get the data to be checked.
-
- CKEDITOR.document.getById( textareaId ).setValue( sData );
-
- interval = window.setInterval( burnSpelling( this, errorMsg ), 250 );
- },
- onHide: function() {
- window.ooo = undefined;
- window.int_framsetLoaded = undefined;
- window.framesetLoaded = undefined;
- window.is_window_opened = false;
- },
- contents: [
- {
- id: 'general',
- label: editor.config.wsc_dialogTitle || editor.lang.wsc.title,
- padding: 0,
- elements: [
- {
- type: 'html',
- id: 'content',
- html: ''
- }
- ]
- }
- ]
- };
-});
-
-// Expand the spell-check frame when dialog resized. (#6829)
-CKEDITOR.dialog.on( 'resize', function( evt ) {
- var data = evt.data,
- dialog = data.dialog;
-
- if ( dialog._.name == 'checkspell' ) {
- var content = dialog.getContentElement( 'general', 'content' ).getElement(),
- iframe = content && content.getChild( 2 );
-
- iframe && iframe.setSize( 'height', data.height );
- iframe && iframe.setSize( 'width', data.width );
- }
-});
+/*
+ Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
+ For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+CKEDITOR.dialog.add("checkspell",function(a){function c(a,c){var d=0;return function(){"function"==typeof window.doSpell?("undefined"!=typeof e&&window.clearInterval(e),j(a)):180==d++&&window._cancelOnError(c)}}function j(c){var f=new window._SP_FCK_LangCompare,b=CKEDITOR.getUrl(a.plugins.wsc.path+"dialogs/"),e=b+"tmpFrameset.html";window.gFCKPluginName="wsc";f.setDefaulLangCode(a.config.defaultLanguage);window.doSpell({ctrl:g,lang:a.config.wsc_lang||f.getSPLangCode(a.langCode),intLang:a.config.wsc_uiLang||
+f.getSPLangCode(a.langCode),winType:d,onCancel:function(){c.hide()},onFinish:function(b){a.focus();c.getParentEditor().setData(b.value);c.hide()},staticFrame:e,framesetPath:e,iframePath:b+"ciframe.html",schemaURI:b+"wsc.css",userDictionaryName:a.config.wsc_userDictionaryName,customDictionaryName:a.config.wsc_customDictionaryIds&&a.config.wsc_customDictionaryIds.split(","),domainName:a.config.wsc_domainName});CKEDITOR.document.getById(h).setStyle("display","none");CKEDITOR.document.getById(d).setStyle("display",
+"block")}var b=CKEDITOR.tools.getNextNumber(),d="cke_frame_"+b,g="cke_data_"+b,h="cke_error_"+b,e,b=document.location.protocol||"http:",i=a.lang.wsc.notAvailable,k='<textarea style="display: none" id="'+g+'" rows="10" cols="40"> </textarea><div id="'+h+'" style="display:none;color:red;font-size:16px;font-weight:bold;padding-top:160px;text-align:center;z-index:11;"></div><iframe src="" style="width:100%;background-color:#f1f1e3;" frameborder="0" name="'+d+'" id="'+d+'" allowtransparency="1"></iframe>',
+l=a.config.wsc_customLoaderScript||b+"//loader.webspellchecker.net/sproxy_fck/sproxy.php?plugin=fck2&customerid="+a.config.wsc_customerId+"&cmd=script&doc=wsc&schema=22";a.config.wsc_customLoaderScript&&(i+='<p style="color:#000;font-size:11px;font-weight: normal;text-align:center;padding-top:10px">'+a.lang.wsc.errorLoading.replace(/%s/g,a.config.wsc_customLoaderScript)+"</p>");window._cancelOnError=function(c){if("undefined"==typeof window.WSC_Error){CKEDITOR.document.getById(d).setStyle("display",
+"none");var b=CKEDITOR.document.getById(h);b.setStyle("display","block");b.setHtml(c||a.lang.wsc.notAvailable)}};return{title:a.config.wsc_dialogTitle||a.lang.wsc.title,minWidth:485,minHeight:380,buttons:[CKEDITOR.dialog.cancelButton],onShow:function(){var b=this.getContentElement("general","content").getElement();b.setHtml(k);b.getChild(2).setStyle("height",this._.contentSize.height+"px");"function"!=typeof window.doSpell&&CKEDITOR.document.getHead().append(CKEDITOR.document.createElement("script",
+{attributes:{type:"text/javascript",src:l}}));b=a.getData();CKEDITOR.document.getById(g).setValue(b);e=window.setInterval(c(this,i),250)},onHide:function(){window.ooo=void 0;window.int_framsetLoaded=void 0;window.framesetLoaded=void 0;window.is_window_opened=!1},contents:[{id:"general",label:a.config.wsc_dialogTitle||a.lang.wsc.title,padding:0,elements:[{type:"html",id:"content",html:""}]}]}});
+CKEDITOR.dialog.on("resize",function(a){var a=a.data,c=a.dialog;"checkspell"==c._.name&&((c=(c=c.getContentElement("general","content").getElement())&&c.getChild(2))&&c.setSize("height",a.height),c&&c.setSize("width",a.width))}); \ No newline at end of file
diff --git a/styles.js b/styles.js
index 354415e..6ffdb02 100644..100755
--- a/styles.js
+++ b/styles.js
@@ -1,112 +1,111 @@
-/**
- * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.html or http://ckeditor.com/license
- */
-
-// This file contains style definitions that can be used by CKEditor plugins.
-//
-// The most common use for it is the "stylescombo" plugin, which shows a combo
-// in the editor toolbar, containing all styles. Other plugins instead, like
-// the div plugin, use a subset of the styles on their feature.
-//
-// If you don't have plugins that depend on this file, you can simply ignore it.
-// Otherwise it is strongly recommended to customize this file to match your
-// website requirements and design properly.
-
-CKEDITOR.stylesSet.add( 'default', [
- /* Block Styles */
-
- // These styles are already available in the "Format" combo ("format" plugin),
- // so they are not needed here by default. You may enable them to avoid
- // placing the "Format" combo in the toolbar, maintaining the same features.
- /*
- { name: 'Paragraph', element: 'p' },
- { name: 'Heading 1', element: 'h1' },
- { name: 'Heading 2', element: 'h2' },
- { name: 'Heading 3', element: 'h3' },
- { name: 'Heading 4', element: 'h4' },
- { name: 'Heading 5', element: 'h5' },
- { name: 'Heading 6', element: 'h6' },
- { name: 'Preformatted Text',element: 'pre' },
- { name: 'Address', element: 'address' },
- */
-
- { name: 'Italic Title', element: 'h2', styles: { 'font-style': 'italic' } },
- { name: 'Subtitle', element: 'h3', styles: { 'color': '#aaa', 'font-style': 'italic' } },
- {
- name: 'Special Container',
- element: 'div',
- styles: {
- padding: '5px 10px',
- background: '#eee',
- border: '1px solid #ccc'
- }
- },
-
- /* Inline Styles */
-
- // These are core styles available as toolbar buttons. You may opt enabling
- // some of them in the Styles combo, removing them from the toolbar.
- // (This requires the "stylescombo" plugin)
- /*
- { name: 'Strong', element: 'strong', overrides: 'b' },
- { name: 'Emphasis', element: 'em' , overrides: 'i' },
- { name: 'Underline', element: 'u' },
- { name: 'Strikethrough', element: 'strike' },
- { name: 'Subscript', element: 'sub' },
- { name: 'Superscript', element: 'sup' },
- */
-
- { name: 'Marker', element: 'span', attributes: { 'class': 'marker' } },
-
- { name: 'Big', element: 'big' },
- { name: 'Small', element: 'small' },
- { name: 'Typewriter', element: 'tt' },
-
- { name: 'Computer Code', element: 'code' },
- { name: 'Keyboard Phrase', element: 'kbd' },
- { name: 'Sample Text', element: 'samp' },
- { name: 'Variable', element: 'var' },
-
- { name: 'Deleted Text', element: 'del' },
- { name: 'Inserted Text', element: 'ins' },
-
- { name: 'Cited Work', element: 'cite' },
- { name: 'Inline Quotation', element: 'q' },
-
- { name: 'Language: RTL', element: 'span', attributes: { 'dir': 'rtl' } },
- { name: 'Language: LTR', element: 'span', attributes: { 'dir': 'ltr' } },
-
- /* Object Styles */
-
- {
- name: 'Styled image (left)',
- element: 'img',
- attributes: { 'class': 'left' }
- },
-
- {
- name: 'Styled image (right)',
- element: 'img',
- attributes: { 'class': 'right' }
- },
-
- {
- name: 'Compact table',
- element: 'table',
- attributes: {
- cellpadding: '5',
- cellspacing: '0',
- border: '1',
- bordercolor: '#ccc'
- },
- styles: {
- 'border-collapse': 'collapse'
- }
- },
-
- { name: 'Borderless Table', element: 'table', styles: { 'border-style': 'hidden', 'background-color': '#E6E6FA' } },
- { name: 'Square Bulleted List', element: 'ul', styles: { 'list-style-type': 'square' } }
-]);
-
-// %LEAVE_UNMINIFIED% %REMOVE_LINE%
+/**
+ * Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md or http://ckeditor.com/license
+ */
+
+// This file contains style definitions that can be used by CKEditor plugins.
+//
+// The most common use for it is the "stylescombo" plugin, which shows a combo
+// in the editor toolbar, containing all styles. Other plugins instead, like
+// the div plugin, use a subset of the styles on their feature.
+//
+// If you don't have plugins that depend on this file, you can simply ignore it.
+// Otherwise it is strongly recommended to customize this file to match your
+// website requirements and design properly.
+
+CKEDITOR.stylesSet.add( 'default', [
+ /* Block Styles */
+
+ // These styles are already available in the "Format" combo ("format" plugin),
+ // so they are not needed here by default. You may enable them to avoid
+ // placing the "Format" combo in the toolbar, maintaining the same features.
+ /*
+ { name: 'Paragraph', element: 'p' },
+ { name: 'Heading 1', element: 'h1' },
+ { name: 'Heading 2', element: 'h2' },
+ { name: 'Heading 3', element: 'h3' },
+ { name: 'Heading 4', element: 'h4' },
+ { name: 'Heading 5', element: 'h5' },
+ { name: 'Heading 6', element: 'h6' },
+ { name: 'Preformatted Text',element: 'pre' },
+ { name: 'Address', element: 'address' },
+ */
+
+ { name: 'Italic Title', element: 'h2', styles: { 'font-style': 'italic' } },
+ { name: 'Subtitle', element: 'h3', styles: { 'color': '#aaa', 'font-style': 'italic' } },
+ {
+ name: 'Special Container',
+ element: 'div',
+ styles: {
+ padding: '5px 10px',
+ background: '#eee',
+ border: '1px solid #ccc'
+ }
+ },
+
+ /* Inline Styles */
+
+ // These are core styles available as toolbar buttons. You may opt enabling
+ // some of them in the Styles combo, removing them from the toolbar.
+ // (This requires the "stylescombo" plugin)
+ /*
+ { name: 'Strong', element: 'strong', overrides: 'b' },
+ { name: 'Emphasis', element: 'em' , overrides: 'i' },
+ { name: 'Underline', element: 'u' },
+ { name: 'Strikethrough', element: 'strike' },
+ { name: 'Subscript', element: 'sub' },
+ { name: 'Superscript', element: 'sup' },
+ */
+
+ { name: 'Marker', element: 'span', attributes: { 'class': 'marker' } },
+
+ { name: 'Big', element: 'big' },
+ { name: 'Small', element: 'small' },
+ { name: 'Typewriter', element: 'tt' },
+
+ { name: 'Computer Code', element: 'code' },
+ { name: 'Keyboard Phrase', element: 'kbd' },
+ { name: 'Sample Text', element: 'samp' },
+ { name: 'Variable', element: 'var' },
+
+ { name: 'Deleted Text', element: 'del' },
+ { name: 'Inserted Text', element: 'ins' },
+
+ { name: 'Cited Work', element: 'cite' },
+ { name: 'Inline Quotation', element: 'q' },
+
+ { name: 'Language: RTL', element: 'span', attributes: { 'dir': 'rtl' } },
+ { name: 'Language: LTR', element: 'span', attributes: { 'dir': 'ltr' } },
+
+ /* Object Styles */
+
+ {
+ name: 'Styled image (left)',
+ element: 'img',
+ attributes: { 'class': 'left' }
+ },
+
+ {
+ name: 'Styled image (right)',
+ element: 'img',
+ attributes: { 'class': 'right' }
+ },
+
+ {
+ name: 'Compact table',
+ element: 'table',
+ attributes: {
+ cellpadding: '5',
+ cellspacing: '0',
+ border: '1',
+ bordercolor: '#ccc'
+ },
+ styles: {
+ 'border-collapse': 'collapse'
+ }
+ },
+
+ { name: 'Borderless Table', element: 'table', styles: { 'border-style': 'hidden', 'background-color': '#E6E6FA' } },
+ { name: 'Square Bulleted List', element: 'ul', styles: { 'list-style-type': 'square' } }
+]);
+