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("textarea", function(b) {
7 title: b.lang.forms.textarea.title,
12 var a = this.getParentEditor().getSelection().getSelectedElement();
13 a && "textarea" == a.getName() && (this.textarea = a, this.setupContent(a))
16 var a, b = this.textarea,
18 c && (a = this.getParentEditor(), b = a.document.createElement("textarea"));
19 this.commitContent(b);
20 c && a.insertElement(b)
24 label: b.lang.forms.textarea.title,
25 title: b.lang.forms.textarea.title,
27 id: "_cke_saved_name",
29 label: b.lang.common.name,
33 this.setValue(a.data("cke-saved-name") || a.getAttribute("name") || "")
36 this.getValue() ? a.data("cke-saved-name", this.getValue()) : (a.data("cke-saved-name", !1), a.removeAttribute("name"))
40 widths: ["50%", "50%"],
44 label: b.lang.forms.textarea.cols,
48 validate: CKEDITOR.dialog.validate.integer(b.lang.common.validateNumberFailed),
50 a = a.hasAttribute("cols") && a.getAttribute("cols");
51 this.setValue(a || "")
54 this.getValue() ? a.setAttribute("cols", this.getValue()) : a.removeAttribute("cols")
59 label: b.lang.forms.textarea.rows,
63 validate: CKEDITOR.dialog.validate.integer(b.lang.common.validateNumberFailed),
65 a = a.hasAttribute("rows") && a.getAttribute("rows");
66 this.setValue(a || "")
69 this.getValue() ? a.setAttribute("rows",
70 this.getValue()) : a.removeAttribute("rows")
76 label: b.lang.forms.textfield.value,
79 this.setValue(a.$.defaultValue)
82 a.$.value = a.$.defaultValue = this.getValue()
87 label: b.lang.forms.textfield.required,
92 this.setValue(a.getAttribute("required"))
95 this.getValue() ? a.setAttribute("required", "required") : a.removeAttribute("required")