Changes between Version 3 and Version 4 of Ticket #4210


Ignore:
Timestamp:
Aug 5, 2009, 11:25:51 AM (11 years ago)
Author:
Tobiasz Cudnik
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #4210

    • Property Keywords Confirmed added
  • Ticket #4210 – Description

    v3 v4  
    11Create a jQuery plugin, which will allow jQuery users easily integrate rich text editing into their applications.
    22
    3 Mockup of planned API:
     3Below mockup of planned API.
     4== Editor creation ==
    45{{{
    56// chainably transform textareas into CKEditor instance
    6 $('textarea').ckeditorCreate()
     7$('textarea').ckeditor()
    78
    89// extensive example
    910$('#editors textarea')
    10   .eq(0).ckeditorCreate({ lang: 'pl', width: 300 }).end()
    11   .eq(1).ckeditorCreate({ width: 500, height: 400 }).end()
     11  .eq(0).ckeditor({ lang: 'pl', width: 300 }).end()
     12  .eq(1).ckeditor({ width: 500, height: 400 }).end()
    1213  // more then one at once
    13   .slice(2).ckeditorCreate({ lang: 'ar' }).end()
     14  .slice(2).ckeditor({ lang: 'ar' }).end()
     15}}}
    1416
    15 // get instance (create it if needed)
    16 $('textarea').ckeditor()
    17 
    18 # access internal API methods
    19 
     17== Internal API access ==
     18{{{
    2019// get data from editor
    21 $('textarea').ckeditor().getData()
     20$('textarea').ckeditor(function(){
     21  var data = this.getData();
     22});
    2223
    2324// set data into editor
    24 $('textarea').ckeditor().setData("New editor content")
    25 
     25var data;
     26$('textarea').ckeditor(function(){
     27  this.setData("New editor content");
     28});
    2629// change ui color
    27 $('textarea').ckeditor().setUiColor('#FFFFFF')
     30$('textarea').ckeditor(function(){
     31  this.setUiColor('#FFFFFF');
     32});
    2833
    2934// 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});
    3151}}}
    3252
     
    3555  2. submit
    3656  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
© 2003 – 2020 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy