/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function(){function y(a){for(var a=a.toUpperCase(),b=z.length,d=0,c=0;cp)&&(u=a-p);p=a;b["cke:indent"]=u&&Math.ceil(a/u)+1||1}],[/^mso-list$/,null,function(a){var a=a.split(" "),d=Number(a[0].match(/\d+/)),a=Number(a[1].match(/\d+/));1==a&&(d!==v&&(b["cke:reset"]=1),v=d);b["cke:indent"]=a}]])(b.style,a)||""),b["cke:indent"]||(p=0,b["cke:indent"]=1),CKEDITOR.tools.extend(b,d.attributes),!0;v=p=u=null;return!1},getStyleComponents:function(){var a=CKEDITOR.dom.element.createFromHtml('
', CKEDITOR.document);CKEDITOR.document.getBody().append(a);return function(b,d,c){a.setStyle(b,d);for(var b={},d=c.length,e=0;ef)a.push(g=new CKEDITOR.htmlParser.element(m)),g.add(d),h.add(g);else{if(eb.size?"small":"medium")+";",delete b.size),a.name="span",a.addStyle(c))}},span:function(a){if(m(a.parent))return!1;a.filterChildren();if(k(a))return delete a.name,null;if(m(a)){var b=a.firstChild(function(a){return a.value||"img"==a.name}), d=(b=b&&(b.value||"l."))&&b.match(/^(?:[(]?)([^\s]+?)([.)]?)$/);if(d)return b=i(d,b),(a=a.getAncestor("span"))&&/ mso-hide:\s*all|display:\s*none /.test(a.attributes.style)&&(b.attributes["cke:ignored"]=1),b}if(d=(b=a.attributes)&&b.style)b.style=f([["line-height"],[/^font-family$/,null,!o?g(c.font_style,"family"):null],[/^font-size$/,null,!o?g(c.fontSize_style,"size"):null],[/^color$/,null,!o?g(c.colorButton_foreStyle,"color"):null],[/^background-color$/,null,!o?g(c.colorButton_backStyle,"color"): null]])(d,a)||"";return null},b:h(c.coreStyles_bold),i:h(c.coreStyles_italic),u:h(c.coreStyles_underline),s:h(c.coreStyles_strike),sup:h(c.coreStyles_superscript),sub:h(c.coreStyles_subscript),a:function(a){var b=a.attributes;b&&!b.href&&b.name?delete a.name:CKEDITOR.env.webkit&&(b.href&&b.href.match(/file:\/\/\/[\S]+#/i))&&(b.href=b.href.replace(/file:\/\/\/[^#]+/i,""))},"cke:listbullet":function(a){a.getAncestor(/h\d/)&&!c.pasteFromWordNumberedHeadingToList&&delete a.name}},attributeNames:[[/^onmouse(:?out|over)/, ""],[/^onload$/,""],[/(?:v|o):\w+/,""],[/^lang/,""]],attributes:{style:f(p?[[/^list-style-type$/,null],[/^margin$|^margin-(?!bottom|top)/,null,function(a,b,d){if(b.name in{p:1,div:1}){b="ltr"==c.contentsLangDirection?"margin-left":"margin-right";if("margin"==d)a=s(d,a,[b])[b];else if(d!=b)return null;if(a&&!D.test(a))return[b,a]}return null}],[/^clear$/],[/^border.*|margin.*|vertical-align|float$/,null,function(a,b){if("img"==b.name)return a}],[/^width|height$/,null,function(a,b){if(b.name in{table:1, td:1,th:1,img:1})return a}]]:[[/^mso-/],[/-color$/,null,function(a){if("transparent"==a)return!1;if(CKEDITOR.env.gecko)return a.replace(/-moz-use-text-color/g,"transparent")}],[/^margin$/,D],["text-indent","0cm"],["page-break-before"],["tab-stops"],["display","none"],o?[/font-?/]:null],p),width:function(a,c){if(c.name in b.$tableContent)return!1},border:function(a,c){if(c.name in b.$tableContent)return!1},"class":a,bgcolor:a,valign:p?a:function(a,b){b.addStyle("vertical-align",a);return!1}},comment:!CKEDITOR.env.ie? function(a,b){var c=a.match(//),d=a.match(/^\[if !supportLists\]([\s\S]*?)\[endif\]$/);return d?(d=(c=d[1]||c&&"l.")&&c.match(/>(?:[(]?)([^\s]+?)([.)]?)]*o:href=['"](.*?)['"]/))&&d[1])&&(c.attributes.src=d),c):!1}:a}}},F=function(){this.dataFilter=new CKEDITOR.htmlParser.filter};F.prototype={toHtml:function(a){var a=CKEDITOR.htmlParser.fragment.fromHtml(a), b=new CKEDITOR.htmlParser.basicWriter;a.writeHtml(b,this.dataFilter);return b.getHtml(!0)}};CKEDITOR.cleanWord=function(a,b){CKEDITOR.env.gecko&&(a=a.replace(/(<\!--\[if[^<]*?\])--\>([\S\s]*?)<\!--(\[endif\]--\>)/gi,"$1$2$3"));var d=new F,c=d.dataFilter;c.addRules(CKEDITOR.plugins.pastefromword.getRules(b));b.fire("beforeCleanWord",{filter:c});try{a=d.toHtml(a)}catch(e){alert(b.lang.pastefromword.error)}a=a.replace(/cke:.*?".*?"/g,"");a=a.replace(/style=""/g,"");return a=a.replace(//g,"")}})();