#4210: CKEditor plugin for jQuery ----------------------------+----------------------------------------------- Reporter: tobiasz.cudnik | Owner: tobiasz.cudnik Type: Bug | Status: assigned Priority: Normal | Milestone: CKEditor 3.1 Component: General | Version: Keywords: Confirmed | ----------------------------+----------------------------------------------- Description changed by tobiasz.cudnik:
Old description: > Create a jQuery plugin, which will allow jQuery users easily integrate > rich text editing into their applications. > > == Planned == > * All API mockups > * .ckeditor( func, config )[[BR]] > Create new editor instance and fire callback when ready. > * .ckeditorGet()[[BR]] > Get already existing editor instance. > * .ckeditorConfig()[[BR]] > Change global ckeditor config > * .val()[[BR]] > val() on textareas returns/sets data on the editor > * Some global CKEditor events > * create > * setData > * getData > * destroy > * Submit integration > * normal submit > * ajaxSubmit ? > > Below mockup of planned API. > === Editor creation === > {{{ > // chainably transform textareas into CKEditor instance > $('textarea').ckeditor() > > // extensive example > $('#editors textarea') > .eq(0).ckeditor({ lang: 'pl', width: 300 }).end() > .eq(1).ckeditor({ width: 500, height: 400 }).end() > // more then one at once > .slice(2).ckeditor({ lang: 'ar' }).end() > }}} > > === Internal API access === > {{{ > // get data from editor > $('textarea').ckeditor(function(){ > alert(this.getData()); > }); > > // set data into editor > $('textarea').ckeditor(function(){ > this.setData("New editor content"); > }); > > // change ui color > $('textarea').ckeditor(function(){ > this.setUiColor('#FFFFFF'); > }); > > // remove editor from the page > $('textarea').ckeditor(function(){ > this.destroy(); > }); > }}} > > === jQuery integration === > {{{ > // use val() to get data > $('textarea:first').ckeditor(function( textarea ){ > $(textarea).val(); > }); > > // use val() to set data > $('textarea:first').ckeditor(function( textarea ){ > $(textarea).val("New editor content"); > }); > }}} > > Possible, not confirmed: > 1. Easy editor's content lookup using selectors New description: Create a jQuery plugin, which will allow jQuery users easily integrate rich text editing into their applications. == Planned == * All API mockups * '''.ckeditor( func, config )'''[[BR]] Create new editor instance and fire callback when ready. Allowed are all elements, not only textareas. * '''.ckeditorGet()'''[[BR]] Get already existing editor instance. * '''.val()'''[[BR]] val() on textareas returns/sets data on the editor * '''jQuery.ckeditorConfig()'''[[BR]] Change global CKEditor config * Forwarding some CKEditor events (namespaced) * newInstance * setData * getData * destroy * Submit integration * normal submit * ajaxSubmit Below mockup of planned API. === Editor creation === {{{ // chainably transform textareas into CKEditor instance $('textarea').ckeditor() // extensive example $('#editors textarea') .eq(0).ckeditor({ lang: 'pl', width: 300 }).end() .eq(1).ckeditor({ width: 500, height: 400 }).end() // more then one at once .slice(2).ckeditor({ lang: 'ar' }).end() }}} === Internal API access === {{{ // get data from editor $('textarea').ckeditor(function(){ alert(this.getData()); }); // set data into editor $('textarea').ckeditor(function(){ this.setData("New editor content"); }); // change ui color $('textarea').ckeditor(function(){ this.setUiColor('#FFFFFF'); }); // remove editor from the page $('textarea').ckeditor(function(){ this.destroy(); }); // use editor synchronously // requires it to be created earlier var editor = $('textarea').ckeditorGet(); alert( editor.getData() ); }}} === jQuery integration === {{{ // use val() to get data $('textarea:first').ckeditor(function( textarea ){ $(textarea).val(); }); // use val() to set data $('textarea:first').ckeditor(function( textarea ){ $(textarea).val("New editor content"); }); // listen to creation event of any CKEditor $( document ).bind( 'instanceCreated.ckeditor', function( editor ){ alert( editor.name + ' has been created' ); }); }}} Possible, not confirmed: 1. Easy editor's content lookup using selectors -- -- Ticket URL: <http://dev.fckeditor.net/ticket/4210#comment:9> FCKeditor <http://www.fckeditor.net/> The text editor for Internet ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ FCKeditor-Trac mailing list FCKeditor-Trac@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fckeditor-trac