⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

wysiwyg



nullart
  • profile picture
  • Member

Posted 02 October 2012 - 08:03 AM

Hi,

I think this is more a suggestion for grocerycrud.

can you please add this wysiwyg http://redactorjs.com/ ? Are there implementation with grocerycrud and redactor already?

Cheers!

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 07 October 2012 - 09:02 AM

Hello [member='nullart'],

This is a very good wysiwyg editor but I cannot add more texteditors right now. The project is 4 times bigger than before (4MB rather than 1MB that was before) and I don't want to do it bigger only for text-editors .

Thanks to sharing this with us. And yes it seems very good text-editor

Cheers
Johnny

Felipe Rodrigues
  • profile picture
  • Member

Posted 03 January 2013 - 21:31 PM

Hello Johnny,

Does exist a tutorial for change text editors?

Is this an easy task?

Cheers

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 04 January 2013 - 19:02 PM

There is not any tutorial right now for changing the text-editor right now. The only thing that I can found is this discussion /topic/1177-how-to-chang-the-editor-in-old-version/

You can try to change it and share your knowledge step by step to this topic so you can help other people that have similar problems

Thanks
Johnny

jhma
  • profile picture
  • Member

Posted 12 July 2013 - 03:32 AM

I think I can help. I found this topic that explains how to add another text editor. It was made for redactorJs.
 
 
It worked very weel. The only thing with the link arread is that you need to add the following two line in every break of the code:
 
$class_name = $this->config->text_editor_type == 'minimal' ? 'mini-texteditor' : 'texteditor';
$input = "<textarea id='field-{$field_info->name}' name='{$field_info->name}' class='$class_name' >$value</textarea>";

You will need to remove the above lines from the end of the function, because you alread added to every break.

 

There is not an config file for the editor, so I'm setting preferences for every view I need to use it because I have diferent needs for every page. You can create an config file and set in the code like the other editors.
 
This is my code for the function (GC 1.3.3):
 
protected function get_text_input($field_info, $value) {
if ($field_info->extras == 'text_editor') {
   $editor = $this->config->default_text_editor;
   switch ($editor) {
case 'ckeditor':
   $this->set_js($this->default_texteditor_path . '/ckeditor/ckeditor.js');
   $this->set_js($this->default_texteditor_path . '/ckeditor/adapters/jquery.js');
   $this->set_js($this->default_javascript_path . '/jquery_plugins/config/jquery.ckeditor.config.js');
   $class_name = $this->config->text_editor_type == 'minimal' ? 'mini-texteditor' : 'texteditor';
   $input = "<textarea id='field-{$field_info->name}' name='{$field_info->name}' class='$class_name' >$value</textarea>";
   break;

case 'tinymce':
   $this->set_js($this->default_texteditor_path . '/tiny_mce/jquery.tinymce.js');
   $this->set_js($this->default_javascript_path . '/jquery_plugins/config/jquery.tine_mce.config.js');
   $class_name = $this->config->text_editor_type == 'minimal' ? 'mini-texteditor' : 'texteditor';
   $input = "<textarea id='field-{$field_info->name}' name='{$field_info->name}' class='$class_name' >$value</textarea>";
   break;

case 'markitup':
   $this->set_css($this->default_texteditor_path . '/markitup/skins/markitup/style.css');
   $this->set_css($this->default_texteditor_path . '/markitup/sets/default/style.css');

   $this->set_js($this->default_texteditor_path . '/markitup/jquery.markitup.js');
   $this->set_js($this->default_javascript_path . '/jquery_plugins/config/jquery.markitup.config.js');
   $class_name = $this->config->text_editor_type == 'minimal' ? 'mini-texteditor' : 'texteditor';
   $input = "<textarea id='field-{$field_info->name}' name='{$field_info->name}' class='$class_name' >$value</textarea>";
   break;
case 'redactor':
   $this->set_css($this->default_texteditor_path . '/redactor/redactor.css');
   $this->set_js($this->default_texteditor_path . '/redactor/redactor.js');

   $input = "<textarea id='field-{$field_info->name}' class='redactor' name='{$field_info->name}' >$value</textarea>";
   break;
   }

} else {
   $input = "<textarea id='field-{$field_info->name}' name='{$field_info->name}'>$value</textarea>";
}
return $input;
    }