The following filter obviously doesn't do anything, however there is an interesting side effect.
If I use Telerik.Web.UI.Editor.Utils.setElementInnerHtml(dom, content), the default content filters do not appear to fire. However if I do this instead:
the default content filters do their job.
Any ideas?
function
OnRadEditorClientLoad(editor, args) {
editor.get_filtersManager().add(
new
testFilter());
}
testFilter =
function
() {
testFilter.initializeBase(
this
);
this
.set_isDom(
false
);
this
.set_enabled(
true
);
this
.set_name(
"RadEditor Strip Table Margins"
);
this
.set_description(
"Strip table margins"
);
}
testFilter.prototype = {
getHtmlContent:
function
(content) {
return
testCleanContent(content);
}
}
function
testCleanContent(content) {
var
TOP_LEVEL_ELEMENT_TAG =
"DIV_TOP_ELEMENT"
;
var
dom = document.createElement(TOP_LEVEL_ELEMENT_TAG);
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(dom, content);
var
textOut = dom.innerHTML;
return
textOut;
}
testFilter.registerClass(
'testFilter'
, Telerik.Web.UI.Editor.Filter);
If I use Telerik.Web.UI.Editor.Utils.setElementInnerHtml(dom, content), the default content filters do not appear to fire. However if I do this instead:
function
testCleanContent(content) {
var
textOut = content;
return
textOut;
}
the default content filters do their job.
Any ideas?