X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Fstylescombo%2Fplugin.js;h=74dd0b73094db13cc5468dfbc60b8c1f9d66cd69;hp=d2f8eb3efaa7c396a9c2b291b2898c0add803323;hb=4e90e78dc97789709ee7404359a5517540c27553;hpb=8f6c203fdaa543c3bca40baea6ae4ddcdf1a77f5 diff --git a/_source/plugins/stylescombo/plugin.js b/_source/plugins/stylescombo/plugin.js index d2f8eb3..74dd0b7 100644 --- a/_source/plugins/stylescombo/plugin.js +++ b/_source/plugins/stylescombo/plugin.js @@ -66,17 +66,20 @@ For licensing, see LICENSE.html or http://ckeditor.com/license loadStylesSet( function() { - var style, styleName; + var style, + styleName, + lastType, + type, + i, + count; // Loop over the Array, adding all items to the // combo. - var lastType; - for ( var i = 0, count = stylesList.length ; i < count ; i++ ) + for ( i = 0, count = stylesList.length ; i < count ; i++ ) { style = stylesList[ i ]; styleName = style._name; - - var type = style.type; + type = style.type; if ( type != lastType ) { @@ -102,9 +105,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license editor.fire( 'saveSnapshot' ); var style = styles[ value ], - selection = editor.getSelection(); - - var elementPath = new CKEDITOR.dom.elementPath( selection.getStartElement() ); + selection = editor.getSelection(), + elementPath = new CKEDITOR.dom.elementPath( selection.getStartElement() ); style[ style.checkActive( elementPath ) ? 'remove' : 'apply' ]( editor.document ); @@ -115,9 +117,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { editor.on( 'selectionChange', function( ev ) { - var currentValue = this.getValue(); - - var elementPath = ev.data.path, + var currentValue = this.getValue(), + elementPath = ev.data.path, elements = elementPath.elements; // For each element into the elements path. @@ -151,9 +152,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var selection = editor.getSelection(), element = selection.getSelectedElement(), - elementPath = new CKEDITOR.dom.elementPath( element || selection.getStartElement() ); + elementPath = new CKEDITOR.dom.elementPath( element || selection.getStartElement() ), + counter = [ 0, 0, 0, 0 ]; - var counter = [ 0, 0, 0, 0 ]; this.showAll(); this.unmarkAll(); for ( var name in styles )