Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [orion-dev] Using Orion Editor in a form

The complete API of an editor (orion.editor.Editor) should be available (getText/setText, geSelection/setSelection, getModel(), getTextView(), etc). If it is not, please open a bug report with a snippet that reproduces it.

I am not sure I understand what you mean by using a "textarea does not show the XML declaration".   It seems to work fine to me. Would you be able to alter the snippet to show what is the issue?

Silenio



From:        Oliver Kopp <kopp.dev@xxxxxxxxx>
To:        Orion developer discussions <orion-dev@xxxxxxxxxxx>,
Date:        11/29/2013 02:48 AM
Subject:        Re: [orion-dev] Using Orion Editor in a form
Sent by:        orion-dev-bounces@xxxxxxxxxxx




Hi,

Thank your the quick response. I saw "setText()", but what about
"getText()"? That seems to be unavailable.

Furthermore, <textarea> and <pre> produce different results:

<pre>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;</pre>
shows the XML declaration
<textarea>&lt;?xml version="1.0" encoding="UTF-8"
standalone="yes"?&gt;</textarea>
does not.

When using without Orion, the contents are displayed fine.

Cheers,

Oliver

2013/11/28 Silenio Quarti <Silenio_Quarti@xxxxxxxxxx>:
> We really need to improve our documentation for the stand alone editor. I
> opened [1] to track this.
>
> The edit() function does not return an internal object.
>
> It returns an array of editors if you provide a "className" in the options
> argument.   Every node in the document with the specified className will be
> the parent of an editor and the list of editors is returned.
>
> Or it returns a single editor, if you provide a "parent" in the options
> argument.  The parent can be either a string id or the DOM node itself.
> This example shows how to use the parent option.
>
>
https://orion.eclipse.org/examples/editor/edit.html
>
> Once you have the editor, you can call  "editor.setText()" to set its
> contents.
>
> It is possible to turn a textarea into an editor as well. Here is a snippet
> that shows how:
>
>
>
>
> Silenio
>
> [1]
https://bugs.eclipse.org/bugs/show_bug.cgi?id=422799
>
>
>
>
> From:        Oliver Kopp <kopp.dev@xxxxxxxxx>
> To:        orion-dev@xxxxxxxxxxx,
> Date:        11/28/2013 05:46 AM
> Subject:        [orion-dev] Using Orion Editor in a form
> Sent by:        orion-dev-bounces@xxxxxxxxxxx
> ________________________________
>
>
>
> Hi,
>
> I'm trying to replace codemirror by Orion's Editor. Thereby, I'm
> following
http://wiki.eclipse.org/Orion/How_Tos/Editor_Build and I
> also found
>
http://mirrors.xmission.com/eclipse/orion/jsdoc/symbols/orion.editor.Editor.html
> .
>
>
> It is not clear to me, how I can get the text content of the editor.
> Could you give me a hint how I can get a reference to the editor
> object? The return value of "edit()" seems to return internal objects
> only.
>
> Is it possible to pass "id" instead of "className" to edit to generate
> the editor only on a specified pre field?
>
> It seems to be impossible to turn a textarea into an editor. This
> makes it difficult to use the editor in a form. Therefore, I've asked
> how to get the (formatted) content of the editor. $(".XMLtextarea
> .textviewContent").text() seems to be a first shot, but it misses the
> line breaks. Then, I can fill up my request data by hand.
>
> BTW: In the howto, I suppose "2.0" can be replaced by "4.0"? :)
>
> Cheers,
>
> Oliver
> _______________________________________________
> orion-dev mailing list
> orion-dev@xxxxxxxxxxx
>
https://dev.eclipse.org/mailman/listinfo/orion-dev
>
>
>
> _______________________________________________
> orion-dev mailing list
> orion-dev@xxxxxxxxxxx
>
https://dev.eclipse.org/mailman/listinfo/orion-dev
>
_______________________________________________
orion-dev mailing list
orion-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/orion-dev



Back to the top