Changes between Version 3 and Version 4 of Ticket #4210
- Timestamp:
- Aug 5, 2009, 11:25:51 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #4210
- Property Keywords Confirmed added
-
Ticket #4210 – Description
v3 v4 1 1 Create a jQuery plugin, which will allow jQuery users easily integrate rich text editing into their applications. 2 2 3 Mockup of planned API: 3 Below mockup of planned API. 4 == Editor creation == 4 5 {{{ 5 6 // chainably transform textareas into CKEditor instance 6 $('textarea').ckeditor Create()7 $('textarea').ckeditor() 7 8 8 9 // extensive example 9 10 $('#editors textarea') 10 .eq(0).ckeditor Create({ lang: 'pl', width: 300 }).end()11 .eq(1).ckeditor Create({ width: 500, height: 400 }).end()11 .eq(0).ckeditor({ lang: 'pl', width: 300 }).end() 12 .eq(1).ckeditor({ width: 500, height: 400 }).end() 12 13 // more then one at once 13 .slice(2).ckeditorCreate({ lang: 'ar' }).end() 14 .slice(2).ckeditor({ lang: 'ar' }).end() 15 }}} 14 16 15 // get instance (create it if needed) 16 $('textarea').ckeditor() 17 18 # access internal API methods 19 17 == Internal API access == 18 {{{ 20 19 // get data from editor 21 $('textarea').ckeditor().getData() 20 $('textarea').ckeditor(function(){ 21 var data = this.getData(); 22 }); 22 23 23 24 // set data into editor 24 $('textarea').ckeditor().setData("New editor content") 25 25 var data; 26 $('textarea').ckeditor(function(){ 27 this.setData("New editor content"); 28 }); 26 29 // change ui color 27 $('textarea').ckeditor().setUiColor('#FFFFFF') 30 $('textarea').ckeditor(function(){ 31 this.setUiColor('#FFFFFF'); 32 }); 28 33 29 34 // remove editor from the page 30 $('textarea').ckeditor().destroy() 35 $('textarea').ckeditor(function(){ 36 this.destroy(); 37 }); 38 }}} 39 40 == jQuery integration == 41 {{{ 42 // use val() to get data 43 $('textarea:first').ckeditor(function( textarea ){ 44 $(textarea).val(); 45 }); 46 47 // use val() to set data 48 $('textarea:first').ckeditor(function( textarea ){ 49 $(textarea).val("New editor contents); 50 }); 31 51 }}} 32 52 … … 35 55 2. submit 36 56 3. ajaxSubmit 37 2. Bridge textarea setter/getter val() with CKEditor 38 3. Easy editor's content lookup using selectors 57 2. Easy editor's content lookup using selectors