Built motion from commit 67e5df37.|2.0.65
[motion2.git] / public / assets / plugins / ckeditor / plugins / forms / dialogs / textarea.js
1 /*
2  Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3  For licensing, see LICENSE.md or http://ckeditor.com/license
4 */
5 CKEDITOR.dialog.add("textarea", function(b) {
6     return {
7         title: b.lang.forms.textarea.title,
8         minWidth: 350,
9         minHeight: 220,
10         onShow: function() {
11             delete this.textarea;
12             var a = this.getParentEditor().getSelection().getSelectedElement();
13             a && "textarea" == a.getName() && (this.textarea = a, this.setupContent(a))
14         },
15         onOk: function() {
16             var a, b = this.textarea,
17                 c = !b;
18             c && (a = this.getParentEditor(), b = a.document.createElement("textarea"));
19             this.commitContent(b);
20             c && a.insertElement(b)
21         },
22         contents: [{
23             id: "info",
24             label: b.lang.forms.textarea.title,
25             title: b.lang.forms.textarea.title,
26             elements: [{
27                 id: "_cke_saved_name",
28                 type: "text",
29                 label: b.lang.common.name,
30                 "default": "",
31                 accessKey: "N",
32                 setup: function(a) {
33                     this.setValue(a.data("cke-saved-name") || a.getAttribute("name") || "")
34                 },
35                 commit: function(a) {
36                     this.getValue() ? a.data("cke-saved-name", this.getValue()) : (a.data("cke-saved-name", !1), a.removeAttribute("name"))
37                 }
38             }, {
39                 type: "hbox",
40                 widths: ["50%", "50%"],
41                 children: [{
42                     id: "cols",
43                     type: "text",
44                     label: b.lang.forms.textarea.cols,
45                     "default": "",
46                     accessKey: "C",
47                     style: "width:50px",
48                     validate: CKEDITOR.dialog.validate.integer(b.lang.common.validateNumberFailed),
49                     setup: function(a) {
50                         a = a.hasAttribute("cols") && a.getAttribute("cols");
51                         this.setValue(a || "")
52                     },
53                     commit: function(a) {
54                         this.getValue() ? a.setAttribute("cols", this.getValue()) : a.removeAttribute("cols")
55                     }
56                 }, {
57                     id: "rows",
58                     type: "text",
59                     label: b.lang.forms.textarea.rows,
60                     "default": "",
61                     accessKey: "R",
62                     style: "width:50px",
63                     validate: CKEDITOR.dialog.validate.integer(b.lang.common.validateNumberFailed),
64                     setup: function(a) {
65                         a = a.hasAttribute("rows") && a.getAttribute("rows");
66                         this.setValue(a || "")
67                     },
68                     commit: function(a) {
69                         this.getValue() ? a.setAttribute("rows",
70                             this.getValue()) : a.removeAttribute("rows")
71                     }
72                 }]
73             }, {
74                 id: "value",
75                 type: "textarea",
76                 label: b.lang.forms.textfield.value,
77                 "default": "",
78                 setup: function(a) {
79                     this.setValue(a.$.defaultValue)
80                 },
81                 commit: function(a) {
82                     a.$.value = a.$.defaultValue = this.getValue()
83                 }
84             }, {
85                 id: "required",
86                 type: "checkbox",
87                 label: b.lang.forms.textfield.required,
88                 "default": "",
89                 accessKey: "Q",
90                 value: "required",
91                 setup: function(a) {
92                     this.setValue(a.getAttribute("required"))
93                 },
94                 commit: function(a) {
95                     this.getValue() ? a.setAttribute("required", "required") : a.removeAttribute("required")
96                 }
97             }]
98         }]
99     }
100 });