Re: [Xsltforms-support] Rich Text Editor
Brought to you by:
alain-couthures
|
From: Alain C. <ala...@ag...> - 2024-01-03 10:14:14
|
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div>
Hi Winona,
</div>
<div class="default-style">
</div>
<div class="default-style">
Looking at the simplified example, it appears that the new record does not have the very same structure: the document root is named "TEI" with a child named "data" whilst the pre-loaded document has the "data" element as root.
</div>
<div class="default-style">
</div>
<div class="default-style">
XForms bindings are context dependant, they are not like XSLT template match attribute values.
</div>
<div class="default-style">
</div>
<div class="default-style">
Whether subforms are used should not interfere with bindings.
</div>
<div class="default-style">
</div>
<div class="default-style">
Thank you for your feedback!
</div>
<div class="default-style">
</div>
<div class="default-style">
--Alain
</div>
<blockquote type="cite">
<div>
Le 03/01/2024 00:54 CET, Winona Salesky <wsa...@gm...> a écrit :
</div>
<div>
</div>
<div>
</div>
<div dir="ltr">
Hi Alain,
<div>
This sort of works. Here is an example of multiple text editors working: <a href="https://gist.github.com/wsalesky/00b872cd91c99344a030f0e667cb9e35">https://gist.github.com/wsalesky/00b872cd91c99344a030f0e667cb9e35</a>
</div>
<div>
</div>
<div>
However, when I try to use this in my actual forms I run into issue. I think it is because my data is loaded after the form is loaded. The user is presented with a main form that allows them to search for records or load a 'template' record into the form. If the data is pre-loaded, the tinyMCE editor works, once I select and load a new record, the textarea are displayed a regular textareas, not as tinyMCE editors.
</div>
<div>
Here is a simplified example: <a href="https://gist.github.com/wsalesky/bf6b25b50b082c8f0bd8dcf7e7b1eaf2">https://gist.github.com/wsalesky/bf6b25b50b082c8f0bd8dcf7e7b1eaf2</a>
<br>
<br>Any thoughts on how to solve this issue? Also, many of my textareas that I want editable will be in subforms. Not sure if that adds another layer of complication or not.
</div>
<div>
Thanks!
</div>
<div>
-Winona
</div>
<div>
</div>
</div>
<br>
<div class="gmail_quote">
<div class="gmail_attr" dir="ltr">
On Sun, Dec 31, 2023 at 8:00 AM Alain Couthures <<a href="mailto:ala...@ag...">ala...@ag...</a>> wrote:
</div>
<blockquote>
<u></u>
<div>
<div>
Hi Winona,
</div>
<div>
<div>
</div>
<div>
Sorry for the delay.
</div>
<div>
</div>
</div>
<div>
Please have a look at the tinymce.xml sample (<a href="https://github.com/AlainCouthures/declarative4all/blob/master/public/samples/tinymce.xml)" target="_blank" rel="noopener">https://github.com/AlainCouthures/declarative4all/blob/master/public/samples/tinymce.xml)</a>.
</div>
<div>
</div>
<div>
Because of compatibility issues between tinymce versions, it is required to add data-uri and data-version attributes to allow XSLTForms to properly manage the rich text editors. In the sample:
<br><script type="text/javascript" src="js/tinymce_4.5.3/tinymce.min.js" data-uri="<a href="http://www.tinymce.com" target="_blank" rel="noopener">http://www.tinymce.com</a>" data-version="4.5.3">/* */</script>
</div>
<div>
</div>
<div>
In next release, XSLTForms will also check "tinymce.majorVersion + '.' + tinymce.minorVersion", as suggested by ChatGPT ;-)
</div>
<div>
</div>
<div>
After upgrading the repeat test case accordingly, it works as expected for me!
</div>
<div>
</div>
<div>
Thank you for your feedback!
</div>
<div>
</div>
<div>
--Alain
</div>
<blockquote type="cite">
<div>
Le 17/12/2023 19:30 CET, Winona Salesky <<a href="mailto:wsa...@gm..." target="_blank" rel="noopener">wsa...@gm...</a>> a écrit :
</div>
<div>
</div>
<div>
</div>
<div dir="ltr">
Hi All,
<br>
<div>
I'm looking into adding a rich text editor to my textarea's. I was trying to experiment with this example:
</div>
<div>
<a href="http://www.agencexml.com/xsltforms/tinymce.xml" target="_blank" rel="noopener">http://www.agencexml.com/xsltforms/tinymce.xml</a>
</div>
<div>
</div>
<div>
But have had some trouble getting it working. My use case would include multiple textarea's almost all of them appearing in a nested repeat structure. I found this on the list (<a href="https://sourceforge.net/p/xsltforms/mailman/xsltforms-support/thread/A6AB89C8-E8E0-49C3-965F-65464934B94D%40basex.org/#msg30316903" target="_blank" rel="noopener">https://sourceforge.net/p/xsltforms/mailman/xsltforms-support/thread/A6AB89C8-E8E0-49C3-965F-65464934B94D%40basex.org/#msg30316903</a>) which suggests repeats could be a problem. Has this been solved? Has anyone integrated a text editor into their XForms? I can mock up a simplified example of what I am trying to do if that would be useful, but I'm mostly looking for examples for how someone else may have solved this issue.
</div>
<div>
</div>
<div>
Thanks!
</div>
<div>
-Winona
</div>
<div>
</div>
</div> _______________________________________________ Xsltforms-support mailing list <a href="mailto:Xsl...@li..." target="_blank" rel="noopener">Xsl...@li...</a> <a href="https://lists.sourceforge.net/lists/listinfo/xsltforms-support" target="_blank" rel="noopener">https://lists.sourceforge.net/lists/listinfo/xsltforms-support</a>
</blockquote>
</div>
</blockquote>
</div>
</blockquote>
</body>
</html>
|