We often need to get the editor content, so an API function would be really great.

CommentFileSizeAuthor
#1 wysiwyg.patch2.11 KBjide

Comments

jide’s picture

Version: 7.x-2.x-dev » 6.x-2.x-dev
StatusFileSize
new2.11 KB

Here is a patch to implement this on last 6.x-2.x-dev, on FCKEditor, CKEditor and TinyMCE 3.

jide’s picture

Status: Active » Needs review

Changing status.

markus_petrux’s picture

It would really be nice to have this in WYSIWYG API.

Yahoo! Editor also provides saveHTML().

  getContent: function() {
    YAHOO.widget.EditorInfo.getEditorById(this.field).saveHTML();
    return this.field.value;
  }
jide’s picture

Thanks for the tips markus.
Concerning YUI, Wysiwyg does not implement the instances functions yet so right now it is not useful.
About TinyMCE 2, I could not even make the editor work with last 6.x-2.x so I did not implement it.
For FCKEditor, CKEditor an TinyMCE 3 it is working fine though.

markus_petrux’s picture

hmm... I guess thought, that when a particular editor does not provide such a method, a javascript error may occur when the method is invoked, and that may break the page.

jide’s picture

Status: Needs review » Closed (duplicate)

I mark this issue as a duplicate of #614146: Drupal.wysiwyg.editor.instance needs additional methods since this issue is overlapped by it.