2 Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3 For licensing, see LICENSE.md or http://ckeditor.com/license
5 CKEDITOR.dialog.add("button", function(b) {
7 var b = this.getValue();
8 b ? (a.attributes[this.id] = b, "name" == this.id && (a.attributes["data-cke-saved-name"] = b)) : (delete a.attributes[this.id], "name" == this.id && delete a.attributes["data-cke-saved-name"])
11 title: b.lang.forms.button.title,
16 var a = this.getParentEditor().getSelection().getSelectedElement();
17 a && a.is("input") && a.getAttribute("type") in {
22 a, this.setupContent(a))
25 var a = this.getParentEditor(),
28 c = b ? CKEDITOR.htmlParser.fragment.fromHtml(b.getOuterHtml()).children[0] : new CKEDITOR.htmlParser.element("input");
29 this.commitContent(c);
30 var e = new CKEDITOR.htmlParser.basicWriter;
32 c = CKEDITOR.dom.element.createFromHtml(e.getHtml(), a.document);
33 d ? a.insertElement(c) : (c.replace(b), a.getSelection().selectElement(c))
37 label: b.lang.forms.button.title,
38 title: b.lang.forms.button.title,
43 label: b.lang.common.name,
46 this.setValue(a.data("cke-saved-name") || a.getAttribute("name") || "")
52 label: b.lang.forms.button.text,
56 this.setValue(a.getAttribute("value") || "")
62 label: b.lang.forms.button.type,
66 [b.lang.forms.button.typeBtn, "button"],
67 [b.lang.forms.button.typeSbm, "submit"],
68 [b.lang.forms.button.typeRst,
73 this.setValue(a.getAttribute("type") || "")