X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fdialogui%2Fplugin.js;h=a473dc4330f8574a3ca67ed2d46b48599f94f40a;hb=9afde8772159bd3436f1f5b7862960307710ae5a;hp=35c2fdcbeb2a9c56089d9c92b3204bc7bd4d5c34;hpb=e371ddf8abcb89013e20e6d0dd746adec344d0e5;p=ckeditor.git diff --git a/_source/plugins/dialogui/plugin.js b/_source/plugins/dialogui/plugin.js index 35c2fdc..a473dc4 100644 --- a/_source/plugins/dialogui/plugin.js +++ b/_source/plugins/dialogui/plugin.js @@ -59,9 +59,9 @@ CKEDITOR.plugins.add( 'dialogui' ); return this.getValue() != this.getInitValue(); }, - reset : function() + reset : function( noChangeEvent ) { - this.setValue( this.getInitValue() ); + this.setValue( this.getInitValue(), noChangeEvent ); }, setInitValue : function() @@ -380,7 +380,7 @@ CKEDITOR.plugins.add( 'dialogui' ); if ( elementDefinition[ 'default' ] ) attributes.checked = 'checked'; - if (typeof myDefinition.controlStyle != 'undefined') + if ( typeof myDefinition.controlStyle != 'undefined' ) myDefinition.style = myDefinition.controlStyle; _.checkbox = new CKEDITOR.ui.dialog.uiElement( dialog, myDefinition, html, 'input', null, attributes ); @@ -462,7 +462,7 @@ CKEDITOR.plugins.add( 'dialogui' ); cleanInnerDefinition( inputDefinition ); cleanInnerDefinition( labelDefinition ); - if (typeof inputDefinition.controlStyle != 'undefined') + if ( typeof inputDefinition.controlStyle != 'undefined' ) inputDefinition.style = inputDefinition.controlStyle; children.push( new CKEDITOR.ui.dialog.uiElement( dialog, inputDefinition, inputHtml, 'input', null, inputAttributes ) ); @@ -622,7 +622,7 @@ CKEDITOR.plugins.add( 'dialogui' ); CKEDITOR.tools.htmlEncode( item[0] ) ); } - if (typeof myDefinition.controlStyle != 'undefined') + if ( typeof myDefinition.controlStyle != 'undefined' ) myDefinition.style = myDefinition.controlStyle; _.select = new CKEDITOR.ui.dialog.uiElement( dialog, myDefinition, html, 'select', null, attributes, innerHTML.join( '' ) ); @@ -931,7 +931,7 @@ CKEDITOR.plugins.add( 'dialogui' ); { this._.disabled = false; var element = this.getElement(); - element && element.removeClass( 'disabled' ); + element && element.removeClass( 'cke_disabled' ); }, /** @@ -941,7 +941,7 @@ CKEDITOR.plugins.add( 'dialogui' ); disable : function() { this._.disabled = true; - this.getElement().addClass( 'disabled' ); + this.getElement().addClass( 'cke_disabled' ); }, isVisible : function() @@ -1061,7 +1061,7 @@ CKEDITOR.plugins.add( 'dialogui' ); setValue : function( value ) { !value && ( value = '' ); - return CKEDITOR.ui.dialog.uiElement.prototype.setValue.call( this, value ); + return CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply( this, arguments ); }, keyboardFocusable : true @@ -1156,11 +1156,12 @@ CKEDITOR.plugins.add( 'dialogui' ); * Sets the state of the checkbox. * @example * @param {Boolean} true to tick the checkbox, false to untick it. + * @param {Boolean} noChangeEvent Internal commit, to supress 'change' event on this element. */ - setValue : function( checked ) + setValue : function( checked, noChangeEvent ) { this.getInputElement().$.checked = checked; - this.fire( 'change', { value : checked } ); + !noChangeEvent && this.fire( 'change', { value : checked } ); }, /** @@ -1222,14 +1223,15 @@ CKEDITOR.plugins.add( 'dialogui' ); * Checks one of the radio buttons in this button group. * @example * @param {String} value The value of the button to be chcked. + * @param {Boolean} noChangeEvent Internal commit, to supress 'change' event on this element. */ - setValue : function( value ) + setValue : function( value, noChangeEvent ) { var children = this._.children, item; for ( var i = 0 ; ( i < children.length ) && ( item = children[i] ) ; i++ ) item.getElement().$.checked = ( item.getValue() == value ); - this.fire( 'change', { value : value } ); + !noChangeEvent && this.fire( 'change', { value : value } ); }, /** @@ -1382,18 +1384,19 @@ CKEDITOR.plugins.add( 'dialogui' ); */ reset : function() { - var frameElement = CKEDITOR.document.getById( this._.frameId ), + var _ = this._, + frameElement = CKEDITOR.document.getById( _.frameId ), frameDocument = frameElement.getFrameDocument(), - elementDefinition = this._.definition, - buttons = this._.buttons, + elementDefinition = _.definition, + buttons = _.buttons, callNumber = this.formLoadedNumber, unloadNumber = this.formUnloadNumber, - langDir = this._.dialog._.editor.lang.dir, - langCode = this._.dialog._.editor.langCode; + langDir = _.dialog._.editor.lang.dir, + langCode = _.dialog._.editor.langCode; // The callback function for the iframe, but we must call tools.addFunction only once // so we store the function number in this.formLoadedNumber - if (!callNumber) + if ( !callNumber ) { callNumber = this.formLoadedNumber = CKEDITOR.tools.addFunction( function() @@ -1457,7 +1460,7 @@ CKEDITOR.plugins.add( 'dialogui' ); getValue : function() { - return this.getInputElement().$.value; + return this.getInputElement().$.value || ''; }, /***