CKEDITOR.dialog.add("button",function(d){function c(f){var a=this;var b=a.getValue();if(b){f.attributes[a.id]=b;if(a.id=="name"){f.attributes["data-cke-saved-name"]=b}}else{delete f.attributes[a.id];if(a.id=="name"){delete f.attributes["data-cke-saved-name"]}}}return{title:d.lang.button.title,minWidth:350,minHeight:150,onShow:function(){var a=this;delete a.button;var f=a.getParentEditor().getSelection().getSelectedElement();if(f&&f.is("input")){var b=f.getAttribute("type");if(b in {button:1,reset:1,submit:1}){a.button=f;a.setupContent(f)}}},onOk:function(){var l=this.getParentEditor(),k=this.button,j=!k,i=k?CKEDITOR.htmlParser.fragment.fromHtml(k.getOuterHtml()).children[0]:new CKEDITOR.htmlParser.element("input");this.commitContent(i);var b=new CKEDITOR.htmlParser.basicWriter();i.writeHtml(b);var a=CKEDITOR.dom.element.createFromHtml(b.getHtml(),l.document);if(j){l.insertElement(a)}else{a.replace(k);l.getSelection().selectElement(a)}},contents:[{id:"info",label:d.lang.button.title,title:d.lang.button.title,elements:[{id:"name",type:"text",label:d.lang.common.name,"default":"",setup:function(a){this.setValue(a.data("cke-saved-name")||a.getAttribute("name")||"")},commit:c},{id:"value",type:"text",label:d.lang.button.text,accessKey:"V","default":"",setup:function(a){this.setValue(a.getAttribute("value")||"")},commit:c},{id:"type",type:"select",label:d.lang.button.type,"default":"button",accessKey:"T",items:[[d.lang.button.typeBtn,"button"],[d.lang.button.typeSbm,"submit"],[d.lang.button.typeRst,"reset"]],setup:function(a){this.setValue(a.getAttribute("type")||"")},commit:c}]}]}});