NEW_CKEDITOR.plugins.add("placeholder",{requires:"widget,dialog",lang:"af,ar,az,bg,ca,cs,cy,da,de,de-ch,el,en,en-au,en-gb,eo,es,es-mx,et,eu,fa,fi,fr,fr-ca,gl,he,hr,hu,id,it,ja,km,ko,ku,lv,nb,nl,no,oc,pl,pt,pt-br,ro,ru,si,sk,sl,sq,sr,sr-latn,sv,th,tr,tt,ug,uk,vi,zh,zh-cn",icons:"placeholder",hidpi:!0,onLoad:function(){NEW_CKEDITOR.addCss(".edi_placeholder{background-color:#ff0}")},init:function(e){var a=e.lang.placeholder;NEW_CKEDITOR.dialog.add("placeholder",this.path+"dialogs/placeholder.js"),e.widgets.add("placeholder",{dialog:"placeholder",pathName:a.pathName,template:'<span class="edi_placeholder">[[]]</span>',downcast:function(){return new NEW_CKEDITOR.htmlParser.text("[["+this.data.name+"]]")},init:function(){this.setData("name",this.element.getText().slice(2,-2))},data:function(){this.element.setText("[["+this.data.name+"]]")},getLabel:function(){return this.editor.lang.widget.label.replace(/%1/,this.data.name+" "+this.pathName)}}),e.ui.addButton&&e.ui.addButton("CreatePlaceholder",{label:a.toolbar,command:"placeholder",toolbar:"insert,5",icon:"placeholder"})},afterInit:function(e){var a=/\[\[([^\[\]])+\]\]/g;e.dataProcessor.dataFilter.addRules({text:function(t,l){var n=l.parent&&NEW_CKEDITOR.dtd[l.parent.name];if(!n||n.span)return t.replace(a,(function(a){var t=null;return(t=new NEW_CKEDITOR.htmlParser.element("span",{class:"edi_placeholder"})).add(new NEW_CKEDITOR.htmlParser.text(a)),(t=e.widgets.wrapElement(t,"placeholder")).getOuterHtml()}))}})}});