Hello Telerik!
Here's a challenge for you! I have implemented a RadEditor coupled with a RadTreeView(within a RadPanelBar) with Drag-and-Drop functionality packaged into a user control(example taken from this site).
When this user control is placed squarely onto an aspx page, it works perfectly fine. My problem is this, I have two instances of this user control within my web project: The one on the page(instance #1; works fine), and there is another instance placed within a custom user control(instance #2; broken); which is a custom-built(legacy) ModalPopup user control using an UpdatePanel. This ModalPopup is then placed within another user control(let's call it KeyView). And KeyView is placed on an aspx page within an UpdatePanel on the page.
I do realize that instance #2 is not ideal or optimal, but I have to figure out a way to make this work in the most time efficient manner possible; the various layers of UpdatePanels have created a multitude of issues with script tags and CSS within markup not being recognized. Most of these issues have been resolved when I migrated all of the script tags/CSS into external files and registered them from the code behind on the page.
The last remaining issue that I am seeing is that when I create a custom ContentFilter for my RadEditor, I am configuring what is seemingly basic functionality for the ContentFilter and it is not being recognized, I am attaching a screenshot of the error, and I will paste my code below:
As you can see from the screenshot, it breaks on: this.set_isDom(false);. If I were to comment out that line, it breaks on any of the following lines:
I am also seeing, and this is notated in the bordered section of the screenshot, that set_isDom, set_enabled, and set_name are not available methods of "this".
Anyway, I hope someone can shed some light on this issue, I welcome any and all suggestions and comments, I do realize that this is not an ideal way to be doing this. I just need some help on how to get this to a working state until I can have enough time to fix this in a proper manner.
Thanks in advance!
Here's a challenge for you! I have implemented a RadEditor coupled with a RadTreeView(within a RadPanelBar) with Drag-and-Drop functionality packaged into a user control(example taken from this site).
When this user control is placed squarely onto an aspx page, it works perfectly fine. My problem is this, I have two instances of this user control within my web project: The one on the page(instance #1; works fine), and there is another instance placed within a custom user control(instance #2; broken); which is a custom-built(legacy) ModalPopup user control using an UpdatePanel. This ModalPopup is then placed within another user control(let's call it KeyView). And KeyView is placed on an aspx page within an UpdatePanel on the page.
I do realize that instance #2 is not ideal or optimal, but I have to figure out a way to make this work in the most time efficient manner possible; the various layers of UpdatePanels have created a multitude of issues with script tags and CSS within markup not being recognized. Most of these issues have been resolved when I migrated all of the script tags/CSS into external files and registered them from the code behind on the page.
The last remaining issue that I am seeing is that when I create a custom ContentFilter for my RadEditor, I am configuring what is seemingly basic functionality for the ContentFilter and it is not being recognized, I am attaching a screenshot of the error, and I will paste my code below:
function
OnEditorLoad(editor, args) {
if
(editor) {
editor.get_filtersManager().add(
new
myConvertFilter());
editor.attachEventHandler(
"onkeydown"
, reKeyDown);
editor.attachEventHandler(
"onkeyup"
, reKeyDown);
}
}
myConvertFilter =
function
() {
myConvertFilter.initializeBase(
this
);
this
.set_isDom(
false
);
this
.set_enabled(
true
);
this
.set_name(
"html filter"
);}
myConvertFilter.prototype =
{
getHtmlContent :
function
(content)
{
var
IndexValue = document.getElementById(
'ctl00_ContentPlaceHolder1_akvAssets_ucTextEditor_mpTextEditor_ucta_ddlOutputChannel'
).selectedIndex;
var
SelectedVal = document.getElementById(
'ctl00_ContentPlaceHolder1_akvAssets_ucTextEditor_mpTextEditor_ucta_ddlOutputChannel'
).options[IndexValue].value;
var
newContent = content;
if
(SelectedVal ==
"1"
) {
newContent = newContent.replace(/©/g,
"\[c\]"
);
newContent = newContent.replace(/®/g,
"\[r\]"
);
newContent = newContent.replace(/™/g,
"\[t\]"
);
newContent = newContent.replace(/•/g,
"\[b\]"
);
newContent = newContent.replace(/–/g,
"\[n\]"
);
newContent = newContent.replace(/—/g,
"\[m\]"
);
newContent = newContent.replace(/¶/g,
"\[ps\]"
);
newContent = newContent.replace(/§/g,
"\[ds\]"
);
newContent = newContent.replace(/†/g,
"\[da\]"
);
newContent = newContent.replace(/‡/g,
"\[dd\]"
);
newContent = newContent.replace(/<STRONG>/g,
"<b>"
);
newContent = newContent.replace(/<\/STRONG>/g,
"<\/b>"
);
newContent = newContent.replace(/<FONT/g,
"<font"
);
newContent = newContent.replace(/<\/FONT>/g,
"<\/font>"
);
newContent = newContent.replace(/<B>/g,
"<b>"
);
newContent = newContent.replace(/<\/B>/g,
"<\/b>"
);
newContent = newContent.replace(/<strong>/g,
"<b>"
);
newContent = newContent.replace(/<\/strong>/g,
"<\/b>"
);
newContent = newContent.replace(/<U>/g,
"<u>"
);
newContent = newContent.replace(/<\/U>/g,
"<\/u>"
);
newContent = newContent.replace(/<BR>/g,
"<br>"
);
newContent = newContent.replace(/<\/BR>/g,
"<\/br>"
);
newContent = newContent.replace(/<SUP>/g,
"<sup>"
);
newContent = newContent.replace(/<\/SUP>/g,
"<\/sup>"
);
newContent = newContent.replace(/<EM>/g,
"<i>"
);
newContent = newContent.replace(/<\/EM>/g,
"<\/i>"
);
newContent = newContent.replace(/<I>/g,
"<i>"
);
newContent = newContent.replace(/<\/I>/g,
"<\/i>"
);
newContent = newContent.replace(/<P/g,
"<p"
);
newContent = newContent.replace(/<\/P>/g,
"<\/p>"
);
newContent = newContent.replace(/<T/g,
"<t"
);
newContent = newContent.replace(/<\/T>/g,
"<\/t>"
);
newContent = newContent.replace(/align=/g,
"alignment="
);
}
return
newContent;},
getDesignContent :
function
(content)
{
var
IndexValue = document.getElementById(
'ctl00_ContentPlaceHolder1_akvAssets_ucTextEditor_mpTextEditor_ucta_ddlOutputChannel'
).selectedIndex;
var
SelectedVal = document.getElementById(
'ctl00_ContentPlaceHolder1_akvAssets_ucTextEditor_mpTextEditor_ucta_ddlOutputChannel'
).options[IndexValue].value;
var
newContent = content;
if
(SelectedVal ==
"1"
) {
newContent = newContent.replace(/\[c\]/g,
"©"
);
newContent = newContent.replace(/\[r\]/g,
"®"
);
newContent = newContent.replace(/\[t\]/g,
"™"
);
newContent = newContent.replace(/\[b\]/g,
"•"
);
newContent = newContent.replace(/\[n\]/g,
"–"
);
newContent = newContent.replace(/\[m\]/g,
"—"
);
newContent = newContent.replace(/\[ps\]/g,
"¶"
);
newContent = newContent.replace(/\[ds\]/g,
"§"
);
newContent = newContent.replace(/\[da\]/g,
"†"
);
newContent = newContent.replace(/\[dd\]/g,
"‡"
);
newContent = newContent.replace(/<b>/g,
"<STRONG>"
);
newContent = newContent.replace(/<\/b>/g,
"<\/STRONG>"
);
newContent = newContent.replace(/<font/g,
"<FONT"
);
newContent = newContent.replace(/<\/font>/g,
"<\/FONT>"
);
newContent = newContent.replace(/<b>/g,
"<B>"
);
newContent = newContent.replace(/<\/b>/g,
"<\/B>"
);
newContent = newContent.replace(/<b>/g,
"<strong>"
);
newContent = newContent.replace(/<\/b>/g,
"<\/strong>"
);
newContent = newContent.replace(/<u>/g,
"<U>"
);
newContent = newContent.replace(/<\/u>/g,
"<\/U>"
);
newContent = newContent.replace(/<br>/g,
"<BR>"
);
newContent = newContent.replace(/<\/br>/g,
"<\/BR>"
);
newContent = newContent.replace(/<sup>/g,
"<SUP>"
);
newContent = newContent.replace(/<\/sup>/g,
"<\/SUP>"
);
newContent = newContent.replace(/<i>/g,
"<EM>"
);
newContent = newContent.replace(/<\/i>/g,
"<\/EM>"
);
newContent = newContent.replace(/<i>/g,
"<I>"
);
newContent = newContent.replace(/<\/i>/g,
"<\/I>"
);
newContent = newContent.replace(/<p/g,
"<P"
);
newContent = newContent.replace(/<\/p>/g,
"<\/P>"
);
newContent = newContent.replace(/<t/g,
"<T"
);
newContent = newContent.replace(/<\/t>/g,
"<\/T>"
);
newContent = newContent.replace(/alignment=/g,
"align="
);
}
return
newContent; }
}
myConvertFilter.registerClass(
'myConvertFilter'
, Telerik.Web.UI.Editor.Filter);
As you can see from the screenshot, it breaks on: this.set_isDom(false);. If I were to comment out that line, it breaks on any of the following lines:
this
.set_isDom(
false
);
this
.set_enabled(
true
);
this
.set_name(
"html filter"
);
I am also seeing, and this is notated in the bordered section of the screenshot, that set_isDom, set_enabled, and set_name are not available methods of "this".
Anyway, I hope someone can shed some light on this issue, I welcome any and all suggestions and comments, I do realize that this is not an ideal way to be doing this. I just need some help on how to get this to a working state until I can have enough time to fix this in a proper manner.
Thanks in advance!