Ticket #11052: plugin.js

File plugin.js, 770 bytes (added by Sebastian Röher, 10 years ago)

my dataProcessor in plugins/mycoreprocessor/

Line 
1CKEDITOR.plugins.add('mycoreprocessor', {
2        requires : [ 'htmlwriter' ],
3        init : function(editor) {
4                editor.dataProcessor = new CKEDITOR.mycoreprocessor(editor);
5        }
6});
7
8CKEDITOR.mycoreprocessor = function(editor) {
9        this.editor = editor;
10        this.writer = new CKEDITOR.htmlWriter();
11        this.dataFilter = new CKEDITOR.htmlParser.filter();
12        this.htmlFilter = new CKEDITOR.htmlParser.filter();
13};
14
15CKEDITOR.mycoreprocessor.prototype = {
16        toHtml : function(data, fixForBody) {
17                // all converting to html (like: data = data.replace( /</g, '&lt;' );)
18                return data;
19        },
20
21        toDataFormat : function(html, fixForBody) {
22                // all converting from html (like: html = html.replace( /<br><\/p>/gi, '\r\n');)
23                html.replace('&lt;' , '<');
24                html.replace('&gt;' , '>');
25                return html;
26        }
27};
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy