!function(){function t(t,n,i){if(!t.getCustomData("indent_processed")){var s=this.editor,r=this.isIndent;if(n){if(i=0,(s=t.$.className.match(this.classNameRegex))&&(s=s[1],i=CKEDITOR.tools.indexOf(n,s)+1),0>(i+=r?1:-1))return;i=Math.min(i,n.length),i=Math.max(i,0),t.$.className=CKEDITOR.tools.ltrim(t.$.className.replace(this.classNameRegex,"")),0<i&&t.addClass(n[i-1])}else{n=e(t,i),i=parseInt(t.getStyle(n),10);var a=s.config.indentOffset||40;if(isNaN(i)&&(i=0),0>(i+=(r?1:-1)*a))return;i=Math.max(i,0),i=Math.ceil(i/a)*a,t.setStyle(n,i?i+(s.config.indentUnit||"px"):""),""===t.getAttribute("style")&&t.removeAttribute("style")}CKEDITOR.dom.element.setMarker(this.database,t,"indent_processed",1)}}function e(t,e){return"ltr"==(e||t.getComputedStyle("direction"))?"margin-left":"margin-right"}var n=CKEDITOR.dtd.$listItem,i=CKEDITOR.dtd.$list,s=CKEDITOR.TRISTATE_DISABLED,r=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indentblock",{requires:"indent",init:function(a){function l(){o.specificDefinition.apply(this,arguments),this.allowedContent={"div h1 h2 h3 h4 h5 h6 ol p pre ul":{propertiesOnly:!0,styles:h?null:"margin-left,margin-right",classes:h||null}},this.contentTransformations=[["div: splitMarginShorthand"],["h1: splitMarginShorthand"],["h2: splitMarginShorthand"],["h3: splitMarginShorthand"],["h4: splitMarginShorthand"],["h5: splitMarginShorthand"],["h6: splitMarginShorthand"],["ol: splitMarginShorthand"],["p: splitMarginShorthand"],["pre: splitMarginShorthand"],["ul: splitMarginShorthand"]],this.enterBr&&(this.allowedContent.div=!0),this.requiredContent=(this.enterBr?"div":"p")+(h?"("+h.join(",")+")":"{margin-left}"),this.jobs={20:{refresh:function(t,i){if(!(a=i.block||i.blockLimit).is(n))var a=(l=a.getAscendant(n))&&i.contains(l)||a;if(a.is(n)&&(a=a.getParent()),this.enterBr||this.getContext(i)){if(h){var l=h,o=(a=a.$.className.match(this.classNameRegex),this.isIndent);return(l=a?!o||a[1]!=l.slice(-1):o)?r:s}return this.isIndent?r:a?CKEDITOR[0>=(parseInt(a.getStyle(e(a)),10)||0)?"TRISTATE_DISABLED":"TRISTATE_OFF"]:s}return s},exec:function(e){var n,s=(s=e.getSelection())&&s.getRanges()[0];if(n=e.elementPath().contains(i))t.call(this,n,h);else for(s=s.createIterator(),e=e.config.enterMode,s.enforceRealBlocks=!0,s.enlargeBr=e!=CKEDITOR.ENTER_BR;n=s.getNextParagraph(e==CKEDITOR.ENTER_P?"p":"div");)n.isReadOnly()||t.call(this,n,h);return!0}}}}var o=CKEDITOR.plugins.indent,h=a.config.indentClasses;o.registerCommands(a,{indentblock:new l(a,"indentblock",!0),outdentblock:new l(a,"outdentblock")}),CKEDITOR.tools.extend(l.prototype,o.specificDefinition.prototype,{context:{div:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,ul:1,ol:1,p:1,pre:1,table:1},classNameRegex:h?new RegExp("(?:^|\\s+)("+h.join("|")+")(?=$|\\s)"):null})}})}();