X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=plugins%2Fhtmldataprocessor%2Fplugin.js;h=ecf87ed45212310349d1f2696abad5e95bdd39b4;hb=HEAD;hp=942c1555f78770e5710689117aec80b5bb7572a2;hpb=ea7e3453c7b0f023b050aca6d9f83ab372860d91;p=ckeditor.git diff --git a/plugins/htmldataprocessor/plugin.js b/plugins/htmldataprocessor/plugin.js deleted file mode 100644 index 942c155..0000000 --- a/plugins/htmldataprocessor/plugin.js +++ /dev/null @@ -1,7 +0,0 @@ -/* -Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. -For licensing, see LICENSE.html or http://ckeditor.com/license -*/ - -(function(){var a=/^[\t\r\n ]*(?: |\xa0)$/,b='{cke_protected}';function c(A,B){var C=A.children,D=C[C.length-1];if(D){if((B||!CKEDITOR.env.ie)&&(D.type==CKEDITOR.NODE_ELEMENT&&D.name=='br'))C.pop();if(D.type==CKEDITOR.NODE_TEXT&&a.test(D.value))C.pop();}};function d(A){if(A.children.length<1)return true;var B=A.children[A.children.length-1];return B.type==CKEDITOR.NODE_ELEMENT&&B.name=='br';};function e(A){c(A,true);if(d(A))if(CKEDITOR.env.ie)A.add(new CKEDITOR.htmlParser.text('\xa0'));else A.add(new CKEDITOR.htmlParser.element('br',{}));};function f(A){c(A);if(d(A))A.add(new CKEDITOR.htmlParser.text('\xa0'));};var g=CKEDITOR.dtd,h=CKEDITOR.tools.extend({},g.$block,g.$listItem,g.$tableContent);for(var i in h)if(!('br' in g[i]))delete h[i];delete h.pre;var j={attributeNames:[[/^on/,'_cke_pa_on']]},k={elements:{}};for(i in h)k.elements[i]=e;var l={elementNames:[[/^cke:/,''],[/^\?xml:namespace$/,'']],attributeNames:[[/^_cke_(saved|pa)_/,''],[/^_cke.*/,'']],elements:{$:function(A){var B=A.attributes;if(B){var C=['name','href','src'],D;for(var E=0;E]+)))/gi;function o(A){return A.replace(n,'$& _cke_saved_$1');};var p=/<(style)(?=[ >])[^>]*>[^<]*<\/\1>/gi,q=/([^<]*)<\/cke:encoded>/gi,r=/(<\/?)((?:object|embed|param).*?>)/gi,s=//gi;function t(A){return ''+encodeURIComponent(A)+'';};function u(A){return A.replace(p,t);};function v(A){return A.replace(r,'$1cke:$2');};function w(A){return A.replace(s,'');};function x(A,B){return decodeURIComponent(B);};function y(A){return A.replace(q,x);};function z(A,B){var C=[],D=/<\!--\{cke_temp\}(\d*?)-->/g,E=[//g,//gi,//gi].concat(B); -for(var F=0;F';});A=A.replace(D,function(G,H){return '';});return A;};CKEDITOR.plugins.add('htmldataprocessor',{requires:['htmlwriter'],init:function(A){var B=A.dataProcessor=new CKEDITOR.htmlDataProcessor(A);B.writer.forceSimpleAmpersand=A.config.forceSimpleAmpersand;B.dataFilter.addRules(j);B.dataFilter.addRules(k);B.htmlFilter.addRules(l);B.htmlFilter.addRules(m);}});CKEDITOR.htmlDataProcessor=function(A){var B=this;B.editor=A;B.writer=new CKEDITOR.htmlWriter();B.dataFilter=new CKEDITOR.htmlParser.filter();B.htmlFilter=new CKEDITOR.htmlParser.filter();};CKEDITOR.htmlDataProcessor.prototype={toHtml:function(A,B){A=z(A,this.editor.config.protectedSource);A=o(A);if(CKEDITOR.env.ie)A=u(A);A=v(A);A=w(A);var C=document.createElement('div');C.innerHTML='a'+A;A=C.innerHTML.substr(1);if(CKEDITOR.env.ie)A=y(A);var D=CKEDITOR.htmlParser.fragment.fromHtml(A,B),E=new CKEDITOR.htmlParser.basicWriter();D.writeHtml(E,this.dataFilter);return E.getHtml(true);},toDataFormat:function(A,B){var C=this.writer,D=CKEDITOR.htmlParser.fragment.fromHtml(A,B);C.reset();D.writeHtml(C,this.htmlFilter);return C.getHtml(true);}};})();CKEDITOR.config.forceSimpleAmpersand=false;