/*
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license
*/ (function(){function z(a){for(var a=a.toUpperCase(),b=A.length,c=0,d=0;d<b;++d)for(var e=A,f=e.length;a.substr(0,f)==e;a=a.substr(f))c+=e;return c}function B(a){for(var a=a.toUpperCase(),b=C.length,c=1,d=1;0<a.length;d*=b)c+=C.indexOf(a.charAt(a.length-1))*d,a=a.substr(0,a.length-1);return c}var D=CKEDITOR.htmlParser.fragment.prototype,v=CKEDITOR.htmlParser.element.prototype;D.onlyChild=v.onlyChild=function(){var a=this.children;return 1==a.length&&a||null};v.removeAnyChildWithName= function(a){for(var b=this.children,c=[],d,e=0;eb
“;”;else{if(“object”== typeof a)for(var e in a)a.hasOwnProperty(e)&&(d+=e+“:”a[e]
“;”);else d+=a;c=b}this.attributes||(this.attributes={});a=this.attributes.style||“”;a=(c?:[a,d]).join(“;”);this.attributes.style=a.replace(/^;|;(?=;)/,“”)};v.getStyle=function(a){var b=this.attributes.style;if(b)return b=CKEDITOR.tools.parseCssText(b,1),b};CKEDITOR.dtd.parentOf=function(a){var b={},c;for(c in this)-1==c.indexOf(“$”)&&this[a]&&(b=1);return b};var H=/^(*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz){1}?/i, E=/^(?:b0s){1,4}$/,y={ol:{decimal:/d+/,“lower-roman”:/^m{0,4}(cm|cd|d?c{0,3})(xc|xl|l?x{0,3})(ix|iv|v?i{0,3})$/,“upper-roman”:/^M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$/,“lower-alpha”:/^+$/,“upper-alpha”:/^+$/},ul:{disc://,circle://,square://}},A=[,[900,“CM”],,[400,“CD”],,[90,“XC”],,[40,“XL”],,[9,“IX”],,[4,“IV”],],C=“ABCDEFGHIJKLMNOPQRSTUVWXYZ”,w=0,o=null,x,F=CKEDITOR.plugins.pastefromword= {utils:{createListBulletMarker:function(a,b){var c=new CKEDITOR.htmlParser.element(“cke:listbullet”);c.attributes={“cke:listsymbol”:a};c.add(new CKEDITOR.htmlParser.text(b));return c},isListBulletIndicator:function(a){if(/mso-lists*:s*Ignore/i.test(a.attributes&&a.attributes.style))return!0},isContainingOnlySpaces:function(a){var b;return(b=a.onlyChild())&&/^(:?s| )+$/.test(b.value)},resolveList:function(a){var b=a.attributes,c;if((c=a.removeAnyChildWithName(“cke:listbullet”))&&c.length&& (c=c))return a.name=“cke:li”,b.style&&(b.style=F.filters.stylesFilter([,[“line-height”],[/^margin(:?-left)?$/,null,function(a){a=a.split(“ ”);a=CKEDITOR.tools.convertToPx(a||a||a);!w&&(null!==o&&a>o)&&(w=a-o);o=a;b=w&&Math.ceil(a/w)+1||1}],[/^mso-list$/,null,function(a){var a=a.split(“ ”),c=Number(a.match(/d+/)),a=Number(a.match(/d+/));1==a&&(c!==x&&(b=1),x=c);b=a}]])(b.style,a)||“”),b||(o=0,b= 1),CKEDITOR.tools.extend(b,c.attributes),!0;x=o=w=null;return!1},getStyleComponents:function(){var a=CKEDITOR.dom.element.createFromHtml(‘<div style=“position:absolute;left:-9999px;top:-9999px;”></div>’,CKEDITOR.document);CKEDITOR.document.getBody().append(a);return function(b,c,d){a.setStyle(b,c);for(var b={},c=d.length,e=0;eb.color
”;“),delete b.color),b.face&&(c+=”font-family:“b.face
”;“,delete b.face),b.size&&(c+=”font-size:“+(3<b.size?”large“:3>b.size?”small“:”medium“)+”;“,delete b.size),a.name= ”span“,a.addStyle©)}},span:function(a){if(l(a.parent))return!1;a.filterChildren();if(k(a))return delete a.name,null;if(l(a)){var b=a.firstChild(function(a){return a.value||”img“==a.name}),c=(b=b&&(b.value||”l.“))&&b.match(/^(?:?)([^s]+?)(?)$/);if©return b=i(c,b),(a=a.getAncestor(”span“))&&/ mso-hide:s*all|display:s*none /.test(a.attributes.style)&&(b.attributes[”cke:ignored“]=1),b}if(c=(b=a.attributes)&&b.style)b.style=f([,[/^font-family$/,null,!n?g(d.font_style,”family“): null],,[/^color$/,null,!n?g(d.colorButton_foreStyle,”color“):null],])(c,a)||”“;b.style||delete b.style;CKEDITOR.tools.isEmpty(b)&&delete a.name;return null},b:h(d.coreStyles_bold),i:h(d.coreStyles_italic),u:h(d.coreStyles_underline),s:h(d.coreStyles_strike),sup:h(d.coreStyles_superscript),sub:h(d.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:///+#/i))&&(b.href=b.href.replace(/file:///+/i,”“))},”cke:listbullet“:function(a){a.getAncestor(/hd/)&&!d.pasteFromWordNumberedHeadingToList&&delete a.name}},attributeNames:[,[/^onload$/,”“],,[/^lang/,”“]],attributes:{style:f(o?[,[/^margin$|^margin-(?!bottom|top)/,null,function(a,b,c){if(b.name in{p:1,div:1}){b=”ltr“==d.contentsLangDirection?”margin-left“:”margin-right“; if(”margin“==c)a=s(c,a,)[b];else if(c!=b)return null;if(a&&!E.test(a))return}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$/,E],,[”page-break-before“],, [”display“,”none“],n?:null],o),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:o?a:function(a,b){b.addStyle(”vertical-align“,a);return!1}},comment:!CKEDITOR.env.ie?function(a,b){var c=a.match(/<img.*?>/),d=a.match(/^[if !supportLists](*?)[endif]$/);return d?(d=(c=d||c&&”l.“)&&c.match(/>(?:?)([^s]+?)(?)</),i(d,c)):CKEDITOR.env.gecko&&c?(c=CKEDITOR.htmlParser.fragment.fromHtml(c).children, (o:href=(.*?)[‘“]/))&&d)&&(c.attributes.src=d),c):!1}:a}}},G=function(){this.dataFilter=new CKEDITOR.htmlParser.filter};G.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*?])–>([Ss]*?)<\!--(\–>)/gi,“$1$2$3”));CKEDITOR.env.webkit&& (supportLists]–>)(+<span+</span>)(<\!--\–>)/gi,“$1<span>$2</span>$3”));var c=new G,d=c.dataFilter;d.addRules(CKEDITOR.plugins.pastefromword.getRules(b));b.fire(“beforeCleanWord”,{filter:d});try{a=c.toHtml(a)}catch(e){alert(b.lang.pastefromword.error)}a=a.replace(/cke:.*?“.*?”/g,“”);a=a.replace(/style=“”/g,“”);return a=a.replace(/<span>/g,“”)}})();