
Charlie Foreman
Top achievements
Rank 1
Charlie Foreman
asked on 24 Feb 2009, 07:48 PM
Hello. We are using RadEditor in a Wiki environment. Because of this, we are processing the HTML output and looking for special character sequences (i.e. ===Heading 2===). We would like to be able to suppress this parsing in certain situations (i.e. the help pages), and have tried entering ===Heading 2=== in the HTML view of the editor. Unfortunately, the editor automatically converts these to equal signs when you switch to the design view and back to the HTML view. Is there any way to suppress this behavior? We'd like to retain the special character sequences if they're manually entered as such.
Thanks for any suggestions.
Thanks for any suggestions.
8 Answers, 1 is accepted
0
Hi Charlie,
In our online Knowledge Base there is an article called Converting Unicode symbols to numeric HTML entities using a content filter . There is suggested a solution of your problem.
What you need to know in addition to the article, is that if you are using RadEditor for MOSS, you can set the OnClientLoad property of the RadEditor for MOSS by modifying the CinfigFile.xml, in your case ListConfigFile.xml (lists, wiki, blogs ...), which are located in the Program Files\Common Files\Microsoft Shared\web server extensions\wpresources\RadEditorSharePoint\5.3.2.0__1f131a624888eeed\Resources folder (5.3.2.0__1f131a624888eeed depends on the version of RadEditor for MOSS).
For example add the following line:
Also you can place javascript code in the MOSSEditorTools.js located in the mentioned above folder.
So you add and modify the suggested js code in this file.
I hope this helps.
Best regards,
Stanimir
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
In our online Knowledge Base there is an article called Converting Unicode symbols to numeric HTML entities using a content filter . There is suggested a solution of your problem.
What you need to know in addition to the article, is that if you are using RadEditor for MOSS, you can set the OnClientLoad property of the RadEditor for MOSS by modifying the CinfigFile.xml, in your case ListConfigFile.xml (lists, wiki, blogs ...), which are located in the Program Files\Common Files\Microsoft Shared\web server extensions\wpresources\RadEditorSharePoint\5.3.2.0__1f131a624888eeed\Resources folder (5.3.2.0__1f131a624888eeed depends on the version of RadEditor for MOSS).
For example add the following line:
<property name="OnClientLoad">OnClientLoad</property> |
Also you can place javascript code in the MOSSEditorTools.js located in the mentioned above folder.
So you add and modify the suggested js code in this file.
function OnClientLoad(editor, args) |
{ |
editor.get_filtersManager().add(new RadEditorCustomFilter()); |
} |
RadEditorCustomFilter = function() |
{ |
RadEditorCustomFilter.initializeBase(this); |
this.set_isDom(false); |
this.set_enabled(true); |
this.set_name("RadEditor filter"); |
this.set_description("RadEditor filter description"); |
} |
RadEditorCustomFilter.prototype = |
{ |
getHtmlContent : function(content) |
{ |
//Make changes to the content and return it |
//Convert all symbols to their numeric HTML entities |
newContent = content.replace(/А/gi, "А"); |
newContent = newContent.replace(/Б/gi, "Б"); |
newContent = newContent.replace(/В/gi, "В"); |
newContent = newContent.replace(/Г/gi, "Г"); |
newContent = newContent.replace(/Д/gi, "Д"); |
//Go ahead and add all letters. Note: this will likely cause a performance problem |
//newContentnewContent = newContent.toUpperCase(); |
return newContent; |
} |
} |
RadEditorCustomFilter.registerClass('RadEditorCustomFilter', Telerik.Web.UI.Editor.Filter); |
</script> function OnClientLoad(editor, args) |
{ |
editor.get_filtersManager().add(new RadEditorCustomFilter()); |
} |
RadEditorCustomFilter = function() |
{ |
RadEditorCustomFilter.initializeBase(this); |
this.set_isDom(false); |
this.set_enabled(true); |
this.set_name("RadEditor filter"); |
this.set_description("RadEditor filter description"); |
} |
RadEditorCustomFilter.prototype = |
{ |
getHtmlContent : function(content) |
{ |
//Make changes to the content and return it |
//Convert all symbols to their numeric HTML entities |
newContent = content.replace(/А/gi, "А"); |
newContent = newContent.replace(/Б/gi, "Б"); |
newContent = newContent.replace(/В/gi, "В"); |
newContent = newContent.replace(/Г/gi, "Г"); |
newContent = newContent.replace(/Д/gi, "Д"); |
//Go ahead and add all letters. Note: this will likely cause a performance problem |
//newContentnewContent = newContent.toUpperCase(); |
return newContent; |
} |
} |
RadEditorCustomFilter.registerClass('RadEditorCustomFilter', Telerik.Web.UI.Editor.Filter); |
I hope this helps.
Best regards,
Stanimir
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0

Daniel
Top achievements
Rank 1
answered on 02 Jun 2009, 12:40 AM
I don't know how old this post is since it only mentions Month and Day (not year). Do we still have to go through the trouble of having to code an OnClientLoad javascript event and provide conversions for all the symbols we anticipate using? Or (hopefully) does the new RadEditor have some property we can set to suppress the automatic unicode conversion when switching from HTML to Design back to HTML?
0
Hello Daniel,
At present you will still need to use this approach - and it is not very likely that a completely built-in solution that requires no extra configuration will appear in the editor. That does not come to say that there will be no improvements - one possibility would be to integrate this content filter into the editor, and provide some default values for it. The editor already features the ability to add and turn on/off content filters, as demonstrated in the following example:
http://demos.telerik.com/aspnet-ajax/editor/examples/builtincontentfilters/defaultcs.aspx
There could be also a server-side collection property added which will allow the developer to add specific symbols for conversion.
Still, the nature of the problem is that the browser converts those symbols to Unicode automatically. This is not a matter of choice. This is not something that the editor does. And it is not a good idea to add a filter that will contain all imaginable Unicode characters as this will certainly ruin performance.
Hence, overall, the solution provided (and its possible future integration in the editor) is a reasonable trade-off - it still requires some developer involvement, in order to customize the list for the particular needs and keep editor performance adequate.
Sincerely yours,
Tervel
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
At present you will still need to use this approach - and it is not very likely that a completely built-in solution that requires no extra configuration will appear in the editor. That does not come to say that there will be no improvements - one possibility would be to integrate this content filter into the editor, and provide some default values for it. The editor already features the ability to add and turn on/off content filters, as demonstrated in the following example:
http://demos.telerik.com/aspnet-ajax/editor/examples/builtincontentfilters/defaultcs.aspx
There could be also a server-side collection property added which will allow the developer to add specific symbols for conversion.
Still, the nature of the problem is that the browser converts those symbols to Unicode automatically. This is not a matter of choice. This is not something that the editor does. And it is not a good idea to add a filter that will contain all imaginable Unicode characters as this will certainly ruin performance.
Hence, overall, the solution provided (and its possible future integration in the editor) is a reasonable trade-off - it still requires some developer involvement, in order to customize the list for the particular needs and keep editor performance adequate.
Sincerely yours,
Tervel
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0

Aaron Clausen
Top achievements
Rank 1
answered on 18 Aug 2009, 06:53 AM
Hi Telerik,
I would have thought this is a pretty common request for people to need to insert special symbols into their editable content, and that content would later be published online, therefore, the symbols should be saved and rendered as their full HTML encoding, not just raw unicode chars.
I am having the same issue, I find it pretty tacky that I need to stick on this massive add-on js function to handle such a simple requirement. Why wouldn't there be server side properties to configure this, or to enable a filter, which could be disabled by default (to save performance). At the very least, why isn't a default filter included that simply handles the default symbols that the RADEditor populates itself with by default. E.g. the Euro symbol and basic/common symbols like that.
I have read your knowledge base article and tried to paste in the recommended js code, but it doesn't seem to work.
The page seems to load fine, but when I click on the symbols button (and also some of the other toolbar buttons I think), I get the following:
Error: this._getPopupVisibilityController() is undefined
Source File: http://localhost:53342/ScriptResource.axd?d=BNU8UZDNDnT2tSX9JcETqpKDvX3IVF6uvMKKfvPLRxUyo0TUXwp_hqKxI5MPU7Bb7L8vQK2IT2wcbTG0KiGc1w2&t=ffffffffadda36b3
Line: 2601
I have the following code in my RADEditor. As my customer simply needs to be able to render a Euro sign using the RADEditor in their custom CMS system, and then have that Euro sign be rendered properly on their outside live www site when the content is published.
Any ideas why this code would crash?
Thx a lot
Aaron.
<telerik:RadEditor onclientload="OnClientLoad" ID="RadEditor" Runat="server" Skin="Default" ToolProviderID="" StripFormattingOptions="MSWordRemoveAll" Width="510px" EnableResize="False" Height="500px">
<CssFiles>
<telerik:EditorCssFile Value="/css/editor.css" />
</CssFiles>
<Content>
</Content>
</telerik:RadEditor>
<script type="text/javascript">
function OnClientLoad(editor, args)
{
editor.get_filtersManager().add(new RadEditorCustomFilter());
}
RadEditorCustomFilter = function()
{
RadEditorCustomFilter.initializeBase(this);
this.set_isDom(true);
this.set_enabled(true);
this.set_name("RadEditor filter");
this.set_description("RadEditor filter description");
}
RadEditorCustomFilter.prototype =
{
getHtmlContent : function(content)
{
//Make changes to the content and return it
//Convert all symbols to their numeric HTML entities
newContent = content.replace(/€/gi, "€");
//Go ahead and add all letters. Note: this will likely cause a performance problem
//newContentnewContent = newContent.toUpperCase();
return newContent;
}
}
RadEditorCustomFilter.registerClass('RadEditorCustomFilter', Telerik.Web.UI.Editor.Filter);
</script>
I would have thought this is a pretty common request for people to need to insert special symbols into their editable content, and that content would later be published online, therefore, the symbols should be saved and rendered as their full HTML encoding, not just raw unicode chars.
I am having the same issue, I find it pretty tacky that I need to stick on this massive add-on js function to handle such a simple requirement. Why wouldn't there be server side properties to configure this, or to enable a filter, which could be disabled by default (to save performance). At the very least, why isn't a default filter included that simply handles the default symbols that the RADEditor populates itself with by default. E.g. the Euro symbol and basic/common symbols like that.
I have read your knowledge base article and tried to paste in the recommended js code, but it doesn't seem to work.
The page seems to load fine, but when I click on the symbols button (and also some of the other toolbar buttons I think), I get the following:
Error: this._getPopupVisibilityController() is undefined
Source File: http://localhost:53342/ScriptResource.axd?d=BNU8UZDNDnT2tSX9JcETqpKDvX3IVF6uvMKKfvPLRxUyo0TUXwp_hqKxI5MPU7Bb7L8vQK2IT2wcbTG0KiGc1w2&t=ffffffffadda36b3
Line: 2601
I have the following code in my RADEditor. As my customer simply needs to be able to render a Euro sign using the RADEditor in their custom CMS system, and then have that Euro sign be rendered properly on their outside live www site when the content is published.
Any ideas why this code would crash?
Thx a lot
Aaron.
<telerik:RadEditor onclientload="OnClientLoad" ID="RadEditor" Runat="server" Skin="Default" ToolProviderID="" StripFormattingOptions="MSWordRemoveAll" Width="510px" EnableResize="False" Height="500px">
<CssFiles>
<telerik:EditorCssFile Value="/css/editor.css" />
</CssFiles>
<Content>
</Content>
</telerik:RadEditor>
<script type="text/javascript">
function OnClientLoad(editor, args)
{
editor.get_filtersManager().add(new RadEditorCustomFilter());
}
RadEditorCustomFilter = function()
{
RadEditorCustomFilter.initializeBase(this);
this.set_isDom(true);
this.set_enabled(true);
this.set_name("RadEditor filter");
this.set_description("RadEditor filter description");
}
RadEditorCustomFilter.prototype =
{
getHtmlContent : function(content)
{
//Make changes to the content and return it
//Convert all symbols to their numeric HTML entities
newContent = content.replace(/€/gi, "€");
//Go ahead and add all letters. Note: this will likely cause a performance problem
//newContentnewContent = newContent.toUpperCase();
return newContent;
}
}
RadEditorCustomFilter.registerClass('RadEditorCustomFilter', Telerik.Web.UI.Editor.Filter);
</script>
0
Hi Aaron,
I was not able to reproduce the error but I noticed that you should set the set_isDom() method parameter to false. For your convenience I have attached a fully working project where the custom content filter code works as expected with RadEditor v.2008.3 1314
Best regards,
Rumen
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
I was not able to reproduce the error but I noticed that you should set the set_isDom() method parameter to false. For your convenience I have attached a fully working project where the custom content filter code works as expected with RadEditor v.2008.3 1314
Best regards,
Rumen
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Hi again,
If the this._getPopupVisibilityController() is undefined error appears only in IE8 then please upgrade to the latest version of RadControls for ASP.NET AJAX. We provided full support for IE8 in Q1 2009 SP1 (version 2009.1.402) of the AJAX suite.
Sincerely,
Rumen
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
If the this._getPopupVisibilityController() is undefined error appears only in IE8 then please upgrade to the latest version of RadControls for ASP.NET AJAX. We provided full support for IE8 in Q1 2009 SP1 (version 2009.1.402) of the AJAX suite.
Sincerely,
Rumen
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0

Aaron Clausen
Top achievements
Rank 1
answered on 21 Aug 2009, 12:01 AM
Hi Rumen,
Thanks for the response.
I am seeing this error on both IE7 and Firefox. It doesn't seem to be solely an IE8 issue.
My version of RADControls for ASP.Net AJAX is "2008.2 1001".
Do you think this version is not compatible with the tack-on script?
Thanks a lot
Aaron.
Thanks for the response.
I am seeing this error on both IE7 and Firefox. It doesn't seem to be solely an IE8 issue.
My version of RADControls for ASP.Net AJAX is "2008.2 1001".
Do you think this version is not compatible with the tack-on script?
Thanks a lot
Aaron.
0
Hello Aaron,
Unfortunately, I was unable to reproduce the problem with the very old version 2008.2.1001 too. For your convenience I have attached my sample project and video demonstrating my test. Could you please test the project and see whether you are able to reproduce the problem on your side?
Best regards,
Rumen
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Unfortunately, I was unable to reproduce the problem with the very old version 2008.2.1001 too. For your convenience I have attached my sample project and video demonstrating my test. Could you please test the project and see whether you are able to reproduce the problem on your side?
Best regards,
Rumen
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.