X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=plugins%2Fstyles%2Fplugin.js;h=7b877a4bb92a04697d571dd060295e33313e86ce;hp=a7a9b508e20fa247a1444b3b29735a181a38815c;hb=8761695d9b70afe75905deaac88f78c1f8aeb32d;hpb=ea7e3453c7b0f023b050aca6d9f83ab372860d91 diff --git a/plugins/styles/plugin.js b/plugins/styles/plugin.js index a7a9b50..7b877a4 100644 --- a/plugins/styles/plugin.js +++ b/plugins/styles/plugin.js @@ -3,8 +3,8 @@ Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ -CKEDITOR.plugins.add('styles',{requires:['selection']});CKEDITOR.editor.prototype.attachStyleStateChange=function(a,b){var c=this._.styleStateChangeCallbacks;if(!c){c=this._.styleStateChangeCallbacks=[];this.on('selectionChange',function(d){for(var e=0;e'+C+'';else A.setHtml(C);B.remove();};function i(A){var B=/(\S\s*)\n(?:\s|(]+_fck_bookmark.*?\/span>))*\n(?!$)/gi,C=A.getName(),D=j(A.getOuterHtml(),B,function(F,G,H){return G+''+H+'
';}),E=[];D.replace(/
([\s\S]*?)<\/pre>/gi,function(F,G){E.push(G);});return E;};function j(A,B,C){var D='',E='';A=A.replace(/(^]+_fck_bookmark.*?\/span>)|(]+_fck_bookmark.*?\/span>$)/gi,function(F,G,H){G&&(D=G);H&&(E=H);return '';});return D+A.replace(B,C)+E;};function k(A,B){var C=new CKEDITOR.dom.documentFragment(B.getDocument());for(var D=0;D');E=E.replace(/[ \t]{2,}/g,function(G){return CKEDITOR.tools.repeat(' ',G.length-1)+' ';
 });var F=B.clone();F.setHtml(E);C.append(F);}return C;};function l(A,B){var C=A.getHtml();C=j(C,/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g,'');C=C.replace(/[ \t\r\n]*(]*>)[ \t\r\n]*/gi,'$1');C=C.replace(/([ \t\n\r]+| )/g,' ');C=C.replace(/]*>/gi,'\n');if(CKEDITOR.env.ie){var D=A.getDocument().createElement('div');D.append(B);B.$.outerHTML='
'+C+'
';B=D.getFirst().remove();}else B.setHtml(C);return B;};function m(A,B){var C=A._.definition,D=C.attributes,E=C.styles,F=x(A);function G(){for(var I in D){if(I=='class'&&B.getAttribute(I)!=D[I])continue;B.removeAttribute(I);}};G();for(var H in E)B.removeStyle(H);D=F[B.getName()];if(D)G();p(B);};function n(A,B){var C=A._.definition,D=C.attributes,E=C.styles,F=x(A),G=B.getElementsByTag(A.element);for(var H=G.count();--H>=0;)m(A,G.getItem(H));for(var I in F)if(I!=A.element){G=B.getElementsByTag(I);for(H=G.count()-1;H>=0;H--){var J=G.getItem(H);o(J,F[I]);}}};function o(A,B){var C=B&&B.attributes;if(C)for(var D=0;D