Jump to content

TinyMCE in UniGUI applications


zilav

Recommended Posts

There are problem to get the html text.

Try put im html editor:

 

<p>123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890</p>

<table border="0">

<tbody>

<tr>

<td>111</td>

<td> </td>

</tr>

<tr>

<td> </td>

<td> </td>

</tr>

</tbody>

</table>

<p> </p>

<p>123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890</p>

 

 

With GetText you get:

<p>123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890</p>

<table border="0">

<tbody>

<tr>

<td>111</td>

<td>

 

 

 

 

Why is it called "tiny"? It's freaking 300kb of javascript...

Link to comment
Share on other sites

Sorry, but I don´t know how can I copy my HTML (on UniMemo component) to this component.

 

Could you help me ?

 

 

Error:

Unexpected token ILLEGAL

tinyMCE.get("ed1").setContent("UniMemo1

");

 

Problem with #13#10 in memo

 

Try

 

 

UniSession.AddJS('tinyMCE.get("ed1").setContent("'+ StringReplace(UniMemo1.Text,#13#10, '<br>', [rfReplaceAll]) + '")');

Link to comment
Share on other sites

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 
Transitional//EN">
<HTML xmlns:o = "urn:schemas-microsoft-
com:office:office"><HEAD>
<META content="text/html; charset=utf-8" http-
equiv=Content-Type>
<META name=GENERATOR content="MSHTML 
9.00.8112.16441"></HEAD>
<BODY>
<DIV>
<DIV>
<P style="MARGIN: 0cm 0cm 0pt" 
class=MsoNormal><o:p><FONT face=Calibri>Dear 
[Who],</FONT></o:p></P>
<P style="MARGIN: 0cm 0cm 0pt" 
class=MsoNormal><o:p><FONT 
face=Calibri></FONT></o:p> </P>
<P style="MARGIN: 0cm 0cm 0pt" 
class=MsoNormal><o:p><FONT face=Calibri>File 
included into attachment</FONT></o:p></P>
<P style="MARGIN: 0cm 0cm 0pt" 
class=MsoNormal> </P>
<P style="MARGIN: 0cm 0cm 0pt" 
class=MsoNormal><o:p></o:p></P>
<P style="MARGIN: 0cm 0cm 0pt" 
class=MsoNormal><o:p><FONT 
face=Calibri> </FONT></o:p></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><A 
name=_MailAutoSig><SPAN 
style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #4f81bd; 
FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; 
mso-fareast-theme-font: minor-fareast; mso-fareast-language: 
ES; mso-no-proof: yes">Regards</SPAN></A><SPAN 
style="mso-bookmark: _MailAutoSig"><SPAN 
style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #1f497d; 
FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; 
mso-fareast-theme-font: minor-fareast; mso-fareast-language: 
ES; mso-no-proof: 
yes">,<o:p></o:p></SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN 
style="mso-bookmark: _MailAutoSig"><SPAN 
style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #1f497d; 
FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; 
mso-fareast-theme-font: minor-fareast; mso-fareast-language: 
ES; mso-no-proof: 
yes"><o:p> </o:p></SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN 
style="mso-bookmark: _MailAutoSig"><SPAN 
style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #1f497d; 
FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; 
mso-fareast-theme-font: minor-fareast; mso-fareast-language: 
ES; mso-no-proof: yes">Dept.</SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN 
style="mso-bookmark: _MailAutoSig"><B><SPAN 
style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #262626; 
FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; 
mso-fareast-theme-font: minor-fareast; mso-fareast-language: 
ES; mso-no-proof: yes">COMPANYU 
LTD</SPAN></B></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN 
style="mso-bookmark: _MailAutoSig"><SPAN 
style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #c00000; 
FONT-SIZE: 8pt; mso-fareast-font-family: 'Times New Roman'; 
mso-fareast-theme-font: minor-fareast; mso-fareast-language: 
ES; mso-no-proof: 
yes"><o:p> </o:p></SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN 
style="mso-bookmark: _MailAutoSig"><SPAN 
style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #1f497d; 
FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; 
mso-fareast-theme-font: minor-fareast; mso-fareast-language: 
ES; mso-no-proof: yes">Web: 
</SPAN></SPAN><SPAN style="mso-bookmark: 
_MailAutoSig"><SPAN 
style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #c00000; 
FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; 
mso-fareast-theme-font: minor-fareast; mso-fareast-language: 
ES; mso-no-proof: yes"> </SPAN></SPAN><A 
href="http://www.como.net"><SPAN style="mso-bookmark: 
_MailAutoSig"><SPAN 
style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #c00000; 
FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; 
mso-fareast-theme-font: minor-fareast; mso-fareast-language: 
ES; mso-no-proof: yes; mso-bidi-font-size: 
11.0pt">www.como.net</SPAN></SPAN><SPAN 
style="mso-bookmark: _MailAutoSig"></SPAN></A><SPAN 
style="mso-bookmark: _MailAutoSig"><SPAN 
style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #c00000; 
FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; 
mso-fareast-theme-font: minor-fareast; mso-fareast-language: 
ES; mso-no-proof: 
yes"><o:p></o:p></SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN 
style="mso-bookmark: _MailAutoSig"><SPAN 
style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #c00000; 
FONT-SIZE: 4pt; mso-fareast-font-family: 'Times New Roman'; 
mso-fareast-theme-font: minor-fareast; mso-fareast-language: 
ES; mso-no-proof: 
yes"><o:p> </o:p></SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN 
style="mso-bookmark: _MailAutoSig"><SPAN 
style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #1f497d; 
FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; 
mso-fareast-theme-font: minor-fareast; mso-fareast-language: 
ES; mso-no-proof: yes">Email: 
</SPAN></SPAN><A href="mailto:info@como.net"><SPAN 
style="mso-bookmark: _MailAutoSig"><SPAN 
style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #1f497d; 
FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; 
mso-fareast-theme-font: minor-fareast; mso-fareast-language: 
ES; mso-no-proof: yes; mso-bidi-font-size: 
11.0pt">info@como.net</SPAN></SPAN><SPAN 
style="mso-bookmark: _MailAutoSig"></SPAN></A><SPAN 
style="mso-bookmark: _MailAutoSig"><SPAN 
style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #1f497d; 
FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; 
mso-fareast-theme-font: minor-fareast; mso-fareast-language: 
ES; mso-no-proof: 
yes"><o:p></o:p></SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN 
style="mso-bookmark: _MailAutoSig"><SPAN 
style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #c00000; 
FONT-SIZE: 4pt; mso-fareast-font-family: 'Times New Roman'; 
mso-fareast-theme-font: minor-fareast; mso-fareast-language: 
ES; mso-no-proof: 
yes"><o:p> </o:p></SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN 
style="mso-bookmark: _MailAutoSig"><SPAN 
style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #1f497d; 
FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; 
mso-fareast-theme-font: minor-fareast; mso-fareast-language: 
ES; mso-no-proof: yes">Phone: 
+1 </SPAN></SPAN><SPAN style="mso-bookmark: 
_MailAutoSig"><SPAN 
style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #4f81bd; 
FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; 
mso-fareast-theme-font: minor-fareast; mso-fareast-language: 
ES; mso-no-proof: yes">800 
07 449 181</SPAN></SPAN><SPAN style="mso-bookmark: 
_MailAutoSig"><SPAN 
style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #c00000; 
FONT-SIZE: 4pt; mso-fareast-font-family: 'Times New Roman'; 
mso-fareast-theme-font: minor-fareast; mso-fareast-language: 
ES; mso-no-proof: 
yes"><o:p></o:p></SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN 
style="mso-bookmark: _MailAutoSig"><SPAN 
style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #c00000; 
FONT-SIZE: 4pt; mso-fareast-font-family: 'Times New Roman'; 
mso-fareast-theme-font: minor-fareast; mso-fareast-language: 
ES; mso-no-proof: 
yes"><o:p> </o:p></SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN 
style="mso-bookmark: _MailAutoSig"><SPAN 
style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: #c00000; 
FONT-SIZE: 4pt; mso-fareast-font-family: 'Times New Roman'; 
mso-fareast-theme-font: minor-fareast; mso-fareast-language: 
ES; mso-no-proof: 
yes"><o:p> </o:p></SPAN></SPAN><SPAN 
style="mso-bookmark: _MailAutoSig"><SPAN 
style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 8pt; 
mso-fareast-font-family: 'Times New Roman'; mso-fareast-
theme-font: minor-fareast; mso-fareast-language: ES; mso-
no-proof: yes"><o:p> </o:p></SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN 
style="mso-bookmark: _MailAutoSig"><SPAN 
style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 9pt; 
mso-fareast-font-family: 'Times New Roman'; mso-fareast-
theme-font: minor-fareast; mso-fareast-language: ES; mso-
no-proof: yes"><o:p> </o:p></SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN 
style="mso-bookmark: _MailAutoSig"><SPAN 
style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 9pt; 
mso-fareast-font-family: 'Times New Roman'; mso-fareast-
theme-font: minor-fareast; mso-fareast-language: ES; mso-
no-proof: 
yes">Discalimer:<o:p></o:p></SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN 
style="mso-bookmark: _MailAutoSig"><SPAN 
style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 9pt; 
mso-fareast-font-family: 'Times New Roman'; mso-fareast-
theme-font: minor-fareast; mso-fareast-language: ES; mso-
no-proof: yes"><SPAN 
style="mso-spacerun: 
yes"> </SPAN><o:p></o:p></SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN 
style="mso-bookmark: _MailAutoSig"><SPAN 
style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 9pt; 
mso-fareast-font-family: 'Times New Roman'; mso-fareast-
theme-font: minor-fareast; mso-fareast-language: ES; mso-
no-proof: yes">DISCLAIMER: 
This e-mail contains propietary information some or all of which 
may be legally 
protected. It is for the intended recipient only. If an addressing 
or 
transmission error has misdirected this e-mail, please notify the 
author by 
replying to this e-mail. If you are not the intended recipient you 
must not use, 
disclose, distribute, copy, print or relay this e-
mail.<BR></SPAN></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><FONT 
face=Arial></FONT> </P></DIV></DIV></BODY></H
TML>

Link to comment
Share on other sites

I think TinyMCE is just a richtext editor that uses basic html tags for formatting. It is not a complete html web page editor. Your example uses custom styles, doctype, body, head, meta and other tags that don't do any formatting.

Your example also contains double quotes used in enclosing string for setContent("") method of TinyMCE, you should encode them or replace with single quote. The same applies to \r\n\ too.

 

p.s. If you already have html text inside some Memo, you can try to copy it directly on client

 

UniSession.AddJS('tinyMCE.get("ed1").setContent(MainForm.UniMemo1.value)');

Link to comment
Share on other sites

I have tried multiple replaces of html sample without success:

 

UniMemo1.Text := StringReplace(UniMemo1.Text, #13#10, '', [rfReplaceAll]);
UniMemo1.Text := StringReplace(UniMemo1.Text, '"', '''', [rfReplaceAll]);
UniMemo1.Text := StringReplace(UniMemo1.Text, '''', '', [rfReplaceAll]);

UniSession.AddJS('tinyMCE.get("ed1").setContent("' + UniMemo1.Text + '")');

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...
  • 1 year later...
  • 1 month later...
  • 11 months later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...