Built motion from commit 67e5df37.|2.0.66
[motion2.git] / public / assets / plugins / ckeditor / plugins / forms / dialogs / form.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("form", function(a) {
6     var d = {
7         action: 1,
8         id: 1,
9         method: 1,
10         enctype: 1,
11         target: 1
12     };
13     return {
14         title: a.lang.forms.form.title,
15         minWidth: 350,
16         minHeight: 200,
17         onShow: function() {
18             delete this.form;
19             var b = this.getParentEditor().elementPath().contains("form", 1);
20             b && (this.form = b, this.setupContent(b))
21         },
22         onOk: function() {
23             var b, a = this.form,
24                 c = !a;
25             c && (b = this.getParentEditor(), a = b.document.createElement("form"), a.appendBogus());
26             c && b.insertElement(a);
27             this.commitContent(a)
28         },
29         onLoad: function() {
30             function a(b) {
31                 this.setValue(b.getAttribute(this.id) ||
32                     "")
33             }
34
35             function e(a) {
36                 this.getValue() ? a.setAttribute(this.id, this.getValue()) : a.removeAttribute(this.id)
37             }
38             this.foreach(function(c) {
39                 d[c.id] && (c.setup = a, c.commit = e)
40             })
41         },
42         contents: [{
43             id: "info",
44             label: a.lang.forms.form.title,
45             title: a.lang.forms.form.title,
46             elements: [{
47                 id: "txtName",
48                 bidi: !0,
49                 type: "text",
50                 label: a.lang.common.name,
51                 "default": "",
52                 accessKey: "N",
53                 setup: function(a) {
54                     this.setValue(a.data("cke-saved-name") || a.getAttribute("name") || "")
55                 },
56                 commit: function(a) {
57                     this.getValue() ? a.data("cke-saved-name", this.getValue()) :
58                         (a.data("cke-saved-name", !1), a.removeAttribute("name"))
59                 }
60             }, {
61                 id: "action",
62                 type: "text",
63                 label: a.lang.forms.form.action,
64                 "default": "",
65                 accessKey: "T"
66             }, {
67                 type: "hbox",
68                 widths: ["45%", "55%"],
69                 children: [{
70                     id: "id",
71                     type: "text",
72                     label: a.lang.common.id,
73                     "default": "",
74                     accessKey: "I"
75                 }, {
76                     id: "enctype",
77                     type: "select",
78                     label: a.lang.forms.form.encoding,
79                     style: "width:100%",
80                     accessKey: "E",
81                     "default": "",
82                     items: [
83                         [""],
84                         ["text/plain"],
85                         ["multipart/form-data"],
86                         ["application/x-www-form-urlencoded"]
87                     ]
88                 }]
89             }, {
90                 type: "hbox",
91                 widths: ["45%", "55%"],
92                 children: [{
93                     id: "target",
94                     type: "select",
95                     label: a.lang.common.target,
96                     style: "width:100%",
97                     accessKey: "M",
98                     "default": "",
99                     items: [
100                         [a.lang.common.notSet, ""],
101                         [a.lang.common.targetNew, "_blank"],
102                         [a.lang.common.targetTop, "_top"],
103                         [a.lang.common.targetSelf, "_self"],
104                         [a.lang.common.targetParent, "_parent"]
105                     ]
106                 }, {
107                     id: "method",
108                     type: "select",
109                     label: a.lang.forms.form.method,
110                     accessKey: "M",
111                     "default": "GET",
112                     items: [
113                         ["GET", "get"],
114                         ["POST", "post"]
115                     ]
116                 }]
117             }]
118         }]
119     }
120 });