Commit 6cff2641 authored by Arnaud Fontaine's avatar Arnaud Fontaine

erp5_code_mirror: Use HTML <textarea> rather than dirty JS hacks.

There was problems handling '\' and '`' characters.
parent 215681bb
...@@ -151,6 +151,13 @@ ...@@ -151,6 +151,13 @@
\n \n
<div id="merge" style="height: 100%; width: 100%">\n <div id="merge" style="height: 100%; width: 100%">\n
<div id="view" style="display: none;"></div>\n <div id="view" style="display: none;"></div>\n
\n
<dtml-if field_id>\n
<textarea id="&dtml-field_id;" name="&dtml-field_id;" style="display: none;">\n
<dtml-var content>\n
</textarea>\n
</dtml-if>\n
\n
</div>\n </div>\n
</dtml-unless>\n </dtml-unless>\n
\n \n
...@@ -167,14 +174,6 @@ ...@@ -167,14 +174,6 @@
// When the textarea does not exist yet (eg ERP5Form EditorField)\n // When the textarea does not exist yet (eg ERP5Form EditorField)\n
<dtml-if field_id>\n <dtml-if field_id>\n
textarea = $(\'#&dtml-field_id;\');\n textarea = $(\'#&dtml-field_id;\');\n
if(!textarea.length) {\n
$(\'#merge\').append(\n
\'<textarea id="&dtml-field_id;" name="&dtml-field_id;" style="display: none;">\' + \n
`&dtml-content;` +\n
\'</textarea>\');\n
\n
textarea = $(\'#&dtml-field_id;\');\n
}\n
<dtml-elif textarea_selector>\n <dtml-elif textarea_selector>\n
textarea = $(\'<dtml-var name="textarea_selector">\');\n textarea = $(\'<dtml-var name="textarea_selector">\');\n
<dtml-else>\n <dtml-else>\n
......
2015-05-08 arnaud.fontaine
* Use HTML <textarea> rather than dirty JS hacks.
2015-05-08 arnaud.fontaine 2015-05-08 arnaud.fontaine
* 'viewportMargin: Infinity' is too slow with files with > 1000 lines. * 'viewportMargin: Infinity' is too slow with files with > 1000 lines.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment