Vincent Massol wrote:
Is this temporary? I'm not sure it's a good
idea to generate HTML from
business code. The HTML should be generated in the templates IMO.
WDYT?
We were doing it already and for a good reason I believe:
$xwiki.getTextArea($tdoc.content)
generates
<textarea id='content' rows='25' name='content'
cols='80'>
...content here...
</textarea>
I'm doing the same with $xwiki.wysiwyg.getInput(id, source, syntax) only
that I'm generating an input hidden. This way I can put HTML in the
value attribute without having problems.
Do you still think this is wrong?
Thanks
-Vincent
On Sep 30, 2008, at 6:31 PM, mflorea (SVN) wrote:
Author: mflorea
Date: 2008-09-30 18:31:41 +0200 (Tue, 30 Sep 2008)
New Revision: 13101
Modified:
platform/web/trunk/standard/src/main/webapp/templates/
editwysiwygnew.vm
Log:
I'm using the WysiwygPlugin to generate the HTML input hidden
element that will hold the initial HTML content of the editor. This
way the HTML special symbols are escaped inside the value attribute.
Modified: platform/web/trunk/standard/src/main/webapp/templates/
editwysiwygnew.vm
===================================================================
--- platform/web/trunk/standard/src/main/webapp/templates/
editwysiwygnew.vm 2008-09-30 16:24:51 UTC (rev 13100)
+++ platform/web/trunk/standard/src/main/webapp/templates/
editwysiwygnew.vm 2008-09-30 16:31:41 UTC (rev 13101)
@@ -28,7 +28,7 @@
## If JavaScript is disabled the user will still be able to edit the
document using this HTML text area.
$xwiki.getTextArea($tdoc.content)
## We separated the hook of the editor (the previous HTML text area)
from editor's input source (the following hidden input)
-<input type="hidden" id="htmlContent" value="$
{xwiki.wysiwyg.toHTML($tdoc.content, $doc.syntaxId)}"
disabled="disabled" />
+$xwiki.wysiwyg.getInput("htmlContent", $tdoc.content, $doc.syntaxId)
<script type="text/javascript">
//<![CDATA[
var Wysiwyg0 = {
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs