Hey everybody!
After a long day of trying to build custom data convertor, her it's the Guide how to do it.
First of all, we have to clone the ORGINAL data processor(DP):
This lines will enable us the option to build an ADD for converting to rich-mode(editor, html), and now we can do all the basic actions.
ConvertToHtml
This lines create an custom converting to rich-mode.
red lines - open an new DP Html convertor that's replace the old convertor.
blue lines - do my actions on the code(the converting).
green lines - return the new data after converting with the old convertor.
ConvertToDataFormat
This lines will create the converting to the code mode.
red lines - open an new DP Code convertor that's replace the old convertor.
pink lines - get the "html code" from the editor
blue lines - do my actions on the code(the converting).
green lines - return the new data after converting.
GOOD LUCK!, and sorry about the worest english,
Almog Baku, Isreal.
After a long day of trying to build custom data convertor, her it's the Guide how to do it.
First of all, we have to clone the ORGINAL data processor(DP):
var oldDP = new FCKDataProcessor() ;
This lines will enable us the option to build an ADD for converting to rich-mode(editor, html), and now we can do all the basic actions.
ConvertToHtml
FCK.DataProcessor.ConvertToHtml = function(data) {
data=data.replace(/<--page-->/gi, 'PAGE BREAK');
return oldDP.ConvertToHtml(data);
}
This lines create an custom converting to rich-mode.
red lines - open an new DP Html convertor that's replace the old convertor.
blue lines - do my actions on the code(the converting).
green lines - return the new data after converting with the old convertor.
ConvertToDataFormat
FCK.DataProcessor.ConvertToDataFormat = function(rootNode, excludeRoot) {
var data = rootNode.innerHTML;
data=data.replace(/PAGE BREAK/gi, '<--page-->');
return data;
}
This lines will create the converting to the code mode.
red lines - open an new DP Code convertor that's replace the old convertor.
pink lines - get the "html code" from the editor
blue lines - do my actions on the code(the converting).
green lines - return the new data after converting.
GOOD LUCK!, and sorry about the worest english,
Almog Baku, Isreal.