editme

WYSIWYG editor based on CKEditor
30 followers

editMe is a Yii Framework extension which creates a highly customizable WYSIWYG editor (based on CKEditor) with just one line of code.

Please visit the extension's wiki page for a full documentation on editMe.

You may find more help and information in the editMe forum topic.

To report a problem or see open issues visit the extension's issues page.

Total 20 comments

#12909 report it
Chris Backhouse at 2013/04/20 12:30am
CKEditor 4.1

Need to change the run function in ExtEditMe.php as follows:-

public function run() {
        // Register JavaScript files
        Yii::app() -> clientScript -> registerCoreScript('jquery');
        Yii::app() -> clientScript -> registerScriptFile(self::$_ckeAssetUrl . '/' . md5(self::$_ckeAssetUrl) . '.js');
        Yii::app() -> clientScript -> registerScriptFile(self::$_ckeAssetUrl . '/ckeditor.js');
        // REMOVED for 4.1 Yii::app() -> clientScript -> registerScriptFile(self::$_ckeAssetUrl . '/adapters/jquery.js');
        // Generate textarea
        $nameId = $this -> resolveNameID();
        $this -> htmlOptions['id'] = $nameId[1];
            // ADD for 4.1 Class='ckeditor'
        $this -> htmlOptions['class'] = 'ckeditor';
        if ($this -> hasModel()) {
            echo CHtml::activeTextArea($this -> model, $this -> attribute, $this -> htmlOptions);
        } else {
            echo CHtml::textArea($this -> name, $this -> value, $this -> htmlOptions);
        }
        // Load CKEditor
        $jquerySelector = CJavaScript::encode('#' . $this -> htmlOptions['id']);
        $ckeConfig = CJavaScript::encode($this -> _ckeGenerateConfig());
        Yii::app() -> clientScript -> registerScript('editMe_' . $this -> htmlOptions['id'], 'jQuery(' . $jquerySelector . ').ckeditor(' . $ckeConfig . ');', 2);
    }
#12306 report it
Gevorg at 2013/03/12 04:14pm
CKEditor 4.0.2 update

Works perfect with CKEditor 4.0.2. Just rename old folder in "vendors" folder from "CKEditor" to "_CKEditor" and paste new CKEditor in there with name "CKEditor". After copy "adapters" folder from "_CKEditor" and paste it in new "CKEditor" folder. Clean assets and refresh:)

#11115 report it
Giacomo at 2012/12/18 05:03am
new ckeditor

Hi, new ckeditor 4.0 is released. Are you plan to update editme with it? Thanks!

#11073 report it
manoj20 at 2012/12/14 07:35am
Thanks

works flawlessly.... good extension keep up the good work

#10896 report it
Giacomo at 2012/11/30 11:17am
Default cellpadding, cellspacing, border for a table

Hi, thanks for your previous advices.

I've another question to ask. Where and how can I set up configuration like these?

Thank you very much

EDIT: I've solved placing the code

CKEDITOR.on('dialogDefinition', function( ev ) {
  var dialogName = ev.data.name;
  var dialogDefinition = ev.data.definition;
 
  if(dialogName === 'table') {
    var infoTab = dialogDefinition.getContents('info');
    var cellSpacing = infoTab.get('txtCellSpace');
    cellSpacing['default'] = "5";
    var cellPadding = infoTab.get('txtCellPad');
    cellPadding['default'] = "5";
    var border = infoTab.get('txtBorder');
    border['default'] = "0";
  }
});

directly inside the page

#10571 report it
TeamTPG at 2012/11/05 12:12pm
Re: How to get textarea value?

Hey Giacomo

Unfortunately CKEditor doesn't offer a classic onChange event.

To accomplish something like that, you will need to implement something yourself.

There is a plugin which implements an onChange event for CKEditor: http://alfonsoml.blogspot.ch/2011/03/onchange-event-for-ckeditor.html Please understand that i can't offer support for this plugin since i myself never used it.

you might be able to find a possible solution here as well: http://stackoverflow.com/questions/5143516/detecting-onchange-events-from-a-ckeditor-using-jquery

Since some of the solutions require you to access to CKEditor instance, here's an example of how to do that:

<?php
$editMe = $this->widget('ext.editMe.widgets.ExtEditMe', array(
    'name'=>'example',
    'value'=>'',
));
?>
<script type="text/javascript">
    jQuery(document).ready(function() {
        var ckeInstance = jQuery("#<?php echo $editMe->htmlOptions['id']; ?>").ckeditorGet();
        alert(ckeInstance.getData());
    });
</script>

hope this helps

#10570 report it
TeamTPG at 2012/11/05 11:04am
Re: New skin

Hey Giacomo

ozone is part of CKEditor 4 which is still beta. editMe 2.0 uses CKEditor 3.6.4, therefore you can only use the skins which are inside the extension. As soon as the final version of CKEditor 4 is released it will be included in editMe.

#10433 report it
Giacomo at 2012/10/27 12:30pm
How to get textarea value?

Also..is there a way to get via js the value of the textarea using the classic onchange function? in the same page i've a lot of instance of editme, with the same class.

in the extension i set

'id'=>'divName_'.$id,
 'htmlOptions'=>array('class'=>'textareaClass'),

and inside the view i tried

$(document).on("change", ".textareaClass", '',function(){
    var id = $(this).attr("id");
    var content = $('#'+id).val();
        alert(content);
}

with a normal textarea works fine. So sad :(

#10430 report it
Giacomo at 2012/10/27 05:37am
New skin

First of all, great ext! saved my time and life :) I'd like to change the dafault skin with new one. I tried to change with one included inside the ext, 'office2003', and it worked. Here's the code

'ckeConfig'=>array(
    'skin'=>'office2003',
    ),

than i googled for some cool skins, and I found these http://ckeditor.com/blog/ckeditor-4-skin-contest-finalists and tried the same stuff

'ckeConfig'=>array(
    'skin'=>'ozone',
    ),

...of course, is not working at all :( Any suggestion? Thank you very much.

#10382 report it
renathy at 2012/10/24 11:53am
re: re: Multiple ContentsCss

Thank you! It works now.

I was trying this before, but I made a mistake - I wrote elements in array in wrong order, it affected result css and I thought it doesn't work.

#10380 report it
TeamTPG at 2012/10/24 10:25am
re: Multiple ContentsCss

Hey renathy

I do apologize, the documentation is unclear on this. You can define multiple items like this: "contentsCss" => array('css1', 'css2', 'css3')

Thanks for the feedback, I will update the documentation

Regards

#10379 report it
renathy at 2012/10/24 10:06am
Multiple ContentsCss

How to add multiple contents css? CKEditor supports it, but I cannot get it using your extension. "contentsCss" => 'http://www.myweb.com/css/mycss.css', //THIS WORKS // but I need to add another url here

#9960 report it
TeamTPG at 2012/09/25 07:39am
Re: Thanks a lot!

CTala

You are very welcome, thank you for the feedback.

#9959 report it
TeamTPG at 2012/09/25 07:39am
Re: thank you again

Hello Hesam Khaki

Thank you very much for the appreciation. I am glad that everything works nicely for you.

#9958 report it
TeamTPG at 2012/09/25 07:37am
Re: Tab key button

Hey seniorboss

By default, pressing the tab key while inside the editor editing area will switch to the next field inside the form, no additional options are necessary for that. Try to remove the option "enableTabKeyTools" and see if it works...

#9950 report it
CTala at 2012/09/24 03:53pm
Thanks a lot!

I had a lot of troubles implementing an editor or using oher extensions.

This one works great, thanks for that!

#9939 report it
Hesam Khaki at 2012/09/24 06:12am
thank you again

since i'm using your great extension in my new project, again, I think I should thank you again, for your work and support, and suggest your extension to anyone who is looking for a WYSIWYG editor which is nicely integrated with Yii.

#9869 report it
seniorboss at 2012/09/17 01:11pm
Tab key button

Hi and thank you for your great work. How can i abilitate the Tab Key Button to switch to next field when pressed?

These are the option i use (usage with model)

'model'=>$prodottoModel,                                                                                    'attribute'=>'descrizione',                                                                                                                                                                        'resizeMode'=>"auto",                                                                                    "toolbar" => array(array('Bold','-', 'Italic','-', 'Underline',)),
'ckeConfig'=>array('enableTabKeyTools'=>true,'enterMode'=>2),

when i'm in the cell if I press Tab Key i can't go anywhere but if i press shift+Tab Key, he goes to the previous field.

What is wrong?

#9788 report it
TeamTPG at 2012/09/10 11:52am
Re: CKEditor upgrade

Hey ryurhrt

In editMe 2.0 CKEditor has been updated to the latest version (3.6.4).

The CKEditor version coming with editMe is not modified. Theoretically you can just replace the version in the vendors folder but that could break editMe if some CKEditor settings have changed.

#9787 report it
TeamTPG at 2012/09/10 11:49am
Re: Please add the "entities" config setting

Hey Littlebob

Since editMe 2.0 you can configure the entities setting like follows:

$this->widget('ext.editMe.widgets.ExtEditMe', array(
        'name'=>'example',
        'value'=>'',
        'ckeConfig'=>array('entities'=>false),
));

Leave a comment

Please to leave your comment.

Create extension
Downloads