X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fdialogadvtab%2Fplugin.js;h=39f2b80d8f7eec4b7a77c046dc37e96b322cb316;hb=fb481ba0a7d298e3e7b9034fcb9f2afdc6e8e796;hp=ad111ffc480e727c6b13ca4d46b1af1963ac50e7;hpb=f0610347140239143439a511ee2bd48cb784f470;p=ckeditor.git diff --git a/_source/plugins/dialogadvtab/plugin.js b/_source/plugins/dialogadvtab/plugin.js index ad111ff..39f2b80 100644 --- a/_source/plugins/dialogadvtab/plugin.js +++ b/_source/plugins/dialogadvtab/plugin.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -132,6 +132,7 @@ CKEDITOR.plugins.add( 'dialogadvtab', label : lang.styles, 'default' : '', + validate : CKEDITOR.dialog.validate.inlineStyle( lang.invalidInlineStyle ), onChange : function(){}, getStyle : function( name, defaultValue ) @@ -144,23 +145,12 @@ CKEDITOR.plugins.add( 'dialogadvtab', { var styles = this.getValue(); - // Remove the current value. - if ( styles ) - { - styles = styles - .replace( new RegExp( '\\s*' + name + '\s*:[^;]*(?:$|;\s*)', 'i' ), '' ) - .replace( /^[;\s]+/, '' ) - .replace( /\s+$/, '' ); - } - - if ( value ) - { - styles && !(/;\s*$/).test( styles ) && ( styles += '; ' ); - styles += name + ': ' + value; - } + var tmp = editor.document.createElement( 'span' ); + tmp.setAttribute( 'style', styles ); + tmp.setStyle( name, value ); + styles = CKEDITOR.tools.normalizeCssText( tmp.getAttribute( 'style' ) ); this.setValue( styles, 1 ); - }, setup : setupAdvParams,