Changeset 2500
- Timestamp:
- 09/29/08 07:07:07 (5 years ago)
- Location:
- CKEditor/branches/prototype/_source/plugins
- Files:
-
- 2 edited
-
dialog/plugin.js (modified) (3 diffs)
-
dialogui/plugin.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
CKEditor/branches/prototype/_source/plugins/dialog/plugin.js
r2499 r2500 330 330 onClick : function( evt ) 331 331 { 332 var ret = evt.data.dialog.fire( 'ok', { hide : true } ).hide; 332 var dialog = evt.data.dialog, 333 ret = dialog.fire( 'ok', { hide : true } ).hide; 334 for ( var i in dialog._.contents ) 335 { 336 if ( dialog._.contents[i].validate && !dialog._.contents[i].validate( dialog ) ) 337 ret = false; 338 } 333 339 if ( ret !== false ) 334 evt.data.dialog.hide();340 dialog.hide(); 335 341 } 336 342 }, … … 354 360 } 355 361 if ( ret !== false ) 356 evt.data.dialog.hide();362 dialog.hide(); 357 363 } 358 364 }, … … 430 436 title : 'Your love is like bad medicine!', 431 437 id : 'testText4', 432 'default' : 'hello world!' 438 'default' : 'hello world!', 439 validate : function( dialog ) 440 { 441 var valid = /^[A-Z a-z!]+$/.test( this.getValue() ); 442 if ( !valid ) 443 { 444 alert( 'Test Text 4 must only contain alphanumeric characters, space, or ! and must not be empty.' ); 445 this.focus(); 446 } 447 return valid; 448 } 433 449 }, 434 450 -
CKEditor/branches/prototype/_source/plugins/dialogui/plugin.js
r2499 r2500 134 134 attributes.style = styleStr.join( '; ' ); 135 135 136 // Set the validator, if any. 137 if ( elementDefinition.validate ) 138 this.validate = elementDefinition.validate; 139 136 140 var innerHTML = function() 137 141 { … … 152 156 var _ = initPrivateObject.call( this, elementDefinition ); 153 157 this._['default'] = elementDefinition.checked || false; 158 159 if ( elementDefinition.validate ) 160 this.validate = elementDefinition.validate(); 154 161 155 162 var innerHTML = function() … … 181 188 if ( !( 'default' in this._ ) ) 182 189 this._['default'] = elementDefinition.items[0][1] ; 190 if ( elementDefinition.validate ) 191 this.validate = elementDefinition.valdiate; 183 192 var children = []; 184 193 … … 336 345 setValue : function( value ) 337 346 { 338 console.log( 'Radio button... children length=' + this._.children.length );339 347 var children = this._.children, 340 348 item;
Note: See TracChangeset
for help on using the changeset viewer.
