It would be nice if the JavaScript-based Editor "EditArea" could be implemented: http://www.cdolivet.com/editarea/

He is pretty straight forward and provides an reliable code highlighting. It is not really a WYSIWYG-Editor but it would be nice if users could choose if they want to use a solution like TinyMCE or something like EditArea to change their texts.

Thank you :)

Comments

sun’s picture

Title: EditArea » Add EditArea editor support
Component: Plugins » Code
jhoff484’s picture

Component: Code » Editor - Editarea

This would be an excellent php code editor. I second this motion.

sun’s picture

Given that there are so many supported editors already which can be used as template, I really hope someone of you guys will step up and provide a straight patch.

It just needs one .inc file and one .js file.

sun’s picture

Title: Add EditArea editor support » Add editor: EditArea
nick_helps’s picture

Can I use editarea with my drupal install?

math-hew’s picture

If EditArea were to become available for WYSIWYG, I would poop myself with sheer joy.

Stomper’s picture

This would be great to see implemented

hunziker’s picture

I see this editor:
http://codemirror.net

It seems that this better then http://www.cdolivet.com/. You can implement also autocomplete features.

Stomper’s picture

status on implementation of this feature?

doublejosh’s picture

This sounds like solid gold to me!

No more: select all > copy > alt+tab > paste > edit in your IDE > select all > copy > alt+tab > paste, repeat...

BTW: Looks like the EditArea javascript tool was tied to a D5 dev project a few years ago: http://drupal.org/project/editarea

Fidelix’s picture

Oh Jesus! This would make my views building time FUN!

tingdongc’s picture

StatusFileSize
new2.07 KB

I forgot where I get these files, but I confirmed it works in both drupal 6 and 7. Unzip the attached file you will get editarea.inc, which should go to /sites/all/modules/wysiwyg/editors, and editarea.js, which should go to /sites/all/modules/wysiwyg/editors/js. Good luck

doublejosh’s picture

BTW: I've done this with BUEditor, though there are still several browser and situation compatibility issues.

jmouse888’s picture

Ok,

- I used files in #12 and got EditArea to show as a supported editor.
- Downloaded the editor and unpacked into /sites/all/libraries/editarea per installation instructions
- picked EditArea 0.8.2 in "Wysiwyg profiles" for PHP code
- try to create a page and switch input to PHP code...

EditArea is NOT loading, still just a plain text area as before.

btw, I'm running D6.25

jmouse888’s picture

StatusFileSize
new2.12 KB

It's working!

EditArea's script was not loading because our site has "Optimize JavaScript files" turned on in admin/settings/performance. We need to load the EditArea's javascript file independently, just like any other wysiwyg editor.

editarea.inc, on line 22

		'libraries' => array(
			'' => array(
				'title' => 'Source',
				'files' => array('edit_area_full.js'),    <-- line 22
				)
			),

change to:

		'libraries' => array(
			'' => array(
				'title' => 'Source',
				'files' => array('edit_area_full.js' => array('preprocess' => FALSE), ),
				)
			),

the editor should load after the change.

jmouse888’s picture

so to summarize, here are the steps form the beginning to get EditArea into Wysiwyg.

  1. make sure your Wysiwyg is working already
  2. download the updated wysiwyg_editarea_addon.tgz, and untar/unzip into /sites/all/modules/wysiwyg/editors, i.e. editarea.inc should be in /sites/all/modules/wysiwyg/editors, and editarea.js should be in /sites/all/modules/wysiwyg/editors/js
  3. go to admin/settings/wysiwyg, and you should have EditArea listed in the "Installation instructions"
  4. download EditArea from author's site (you need ver >=0.8.1.1), and put it in your /sites/all/libraries according to the instruction.
  5. go back to Wysiwyg profiles (admin/settings/wysiwyg), and assign EditArea to PHP code.

this should do it. edit a page and switch input to PHP code. You should have a code editor with syntax highlight.

BTW, I'm running D6.25 and latest dev version of wysiwyg.

Thanks to floor 12 (tingdongc) providing the scripts. It would be great if any one can try this in a D7 setup and report back. Good luck!

brunoslessa’s picture

Nice solution,

It works in D7. I made a little change, more to customize for my needs.

In file js/editarea.js, at editAreaLoader.init function, I added these lines:

,toolbar: "search, go_to_line, |, undo, redo, |, select_font, |, syntax_selection, |, change_smooth_selection, highlight, reset_highlight, |, help"
,syntax_selection_allow: "css,html,js,php,python,xml,sql"

Now I can change the syntax highlight for different languages.

Thanks for all.

Bernsch’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev

.
Thanx jmouse888 for the nice description/summary and tingdongc for this plugin!

I test it with Drupal 7.15 and Wysiwyg 7.x-2.x-dev from 2012-Jul-22
It works fine! :-)

One thing I noticed: when i save a node i becoms this error message whith the SimpleAds module (version 7.x-1.8):

Notice: Undefined variable: plugins in simpleads_wysiwyg_plugin() (Zeile 89 von C:\wamp\www\drupal\sites\all\modules\simpleads\includes\simpleads.filter.inc).

@brunoslessa
Can you specify the code for the drupal standard, please:
line
+
-

Sorry, I can not follow this description in #17 :-/

mijail.deltoro’s picture

Hi Bernsch

You could try:
Go to modules/simpleads/includes folder and edit simpleads.filter.inc.
Find the function simpleads_wysiwyg_plugin and add the case 'editarea': block like this


function simpleads_wysiwyg_plugin($editor, $version) {

  _simpleads_filter_add_settings('wysiwyg_' . $editor);

  switch ($editor) {
    case 'tinymce':
      $plugins['simpleads'] = array(
        'path' => drupal_get_path('module', 'simpleads') . '/editors/tinymce',
        'filename' => 'editor_plugin.js',
        'buttons' => array('simpleads' => t('Inject ads into content')),
        'load' => TRUE,
      );
      break;
    case 'ckeditor':
      $plugins['simpleads'] = array(
        'path' => drupal_get_path('module', 'simpleads') . '/editors/ckeditor/',
        'buttons' => array('simpleads' => t('Inject ads into content')),
        'load' => TRUE,
      );
      break;
    case 'fckeditor':
      $plugins['simpleads'] = array(
        'path' => drupal_get_path('module', 'simpleads') . '/editors/fckeditor/',
        'buttons' => array('simpleads' => t('Inject ads into content')),
        'load' => TRUE,
      );
      break;
    case 'editarea':
      $plugins['simpleads'] = array(
        'path' => drupal_get_path('module', 'simpleads') . '/editors/editarea/',
        'buttons' => array('simpleads' => t('Inject ads into content')),
        'load' => TRUE,
      );
      break;
  }

  return $plugins;
}

It works for me at NiceEdit editor
Good luck

brunoslessa’s picture

StatusFileSize
new762 bytes

Hi,

Sorry, but I am not sure about the drupal diff standard, then I used that I know. The result is:

12	+     ,toolbar: "search, go_to_line, |, undo, redo, |, select_font, |, syntax_selection, |, change_smooth_selection, highlight, reset_highlight, |, help"
13	+         
14	+     ,syntax_selection_allow: "css,html,js,php,python,xml,sql"

Anyway, I attached the file I changed.

Bruno

sst2001’s picture

Category: feature » bug
Priority: Normal » Major
StatusFileSize
new56.79 KB

Am I the only one who has problems in the selection_field ? :

Using eadit_area with Drupal 7 , as I go down the text (inside the editor) I am getting the selection displayed one to three lines (depends how low I am in the text) below the current line...

See attached file..

Also, in IE 9 its not really working, it start to select characters... as endless loop...

I played a lot with it, it seams that the CSS values are set within the edit_area_functions.js and are hard coded...

Any one solved this?

twod’s picture

Category: bug » feature
Priority: Major » Normal

Please don't change this to a bug report, we have not yet had time to commit any support patches for EditArea so this is still a feature request.

Speaking of which... I need an actual .patch or .diff file against the 7.x-2.x git branch to be able to efficiently review and test the support for this code. If someone has the time to create one, and maybe even bring it to the same level of support as the other editors, it would be greatly appreciated and it'd help speed things up.

I have almost no experience with EditArea so it is going to take a long time before I can get around to digging into it.