<
telerik:RadFileExplorer
ID
=
"RadFileExplorer1"
Runat
=
"server"
>
<
Configuration
ViewPaths
=
"~/Customers"
UploadPaths
=
"~/Customers"
DeletePaths
=
"~/Customers"
/>
</
telerik:RadFileExplorer
>
Test de formulaire
Avec du rouge
Du bleu
Et du vert
User highlight Test de formulaire and click custom button with this code : //selection = selection.replace("<q>", "");
//selection = selection.replace("</q>", "");
//selection = selection.replace("<Q>", "");
//selection = selection.replace("</Q>", "");
//Remove all custom tags before insert new custom tags
var html = editor.get_html(false);
html = html.replace("<q>", "");
html = html.replace("</q>", "");
html = html.replace("<Q>", "");
html = html.replace("</Q>", "");
var newhtml = html.replace(selectedText, '<q>' + selectedText + '</q>');
//var newhtml = html.replace(selection, '<q>' + selection + '</q>');
editor.set_html(newhtml);
//Set schedule text
var txtScheduleText = $find("<%=txtScheduleText.ClientID%>");
txtScheduleText.set_mode(4);
txtScheduleText.set_html(selection);
txtScheduleText.set_mode(4);
This code must replace selectedhtml text like this : <FONT size=3 face=calibri>Ceci est un test</FONT> by <q><FONT size=3 face=calibri>Ceci est un test</FONT></q>
The problem is that when i call var newhtml = html.replace(selection, '<q>' + selection + '</q>'); selection not exist in html because html look like this with msword special tag :
<FONT face=georgia>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT size=3 face=calibri>Ceci est un test<?xml:namespace prefix = o /><o:p></o:p></FONT></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT color=#ff0000 size=3 face=calibri>En rouge<o:p></o:p></FONT></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT color=#00b0f0 size=3 face=calibri>En bleu<o:p></o:p></FONT></P>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT color=#00b050 size=3 face=calibri>En vert<o:p></o:p></FONT></P></FONT>
Do you have a valid solution to replace my html selection ?
<telerik:RadButton ID="btnNew" runat="server" OnClientClicked="ShowLectureAuthor(); return false;" Text="New" ToolTip="Create New File" Skin="Telerik"> <Icon PrimaryIconUrl="~/images/fileimages/AddRecord.gif" PrimaryIconLeft="5px" /> <Icon PrimaryIconUrl="~/images/fileimages/AddRecord.gif" PrimaryIconLeft="5px"></Icon> </telerik:RadButton> the javascript which works, looks like this:function ShowLectureAuthor() { var oWindow = window.radopen("Admin-Lecture-Author.aspx", null); oWindow.SetTitle("Author Document"); oWindow.SetModal(true);} when I add the (); return false; I get errors on page load and none of the buttons work: Webpage error details
Message: Expected '}'
Line: 762
Char: 421
Code: 0
Really confused , thanks in advance