Version Description
- Conditional fields and sections
- [current_date_time] notification variable
Download this release
Release Info
Developer | tlovett1 |
Plugin | Custom Contact Forms |
Version | 7.5 |
Comparing to | |
See all releases |
Code changes from version 7.4.5 to 7.5
- assets/build/css/admin.css +37 -0
- assets/build/css/admin.css.map +7 -0
- assets/build/css/admin.min.css +1 -0
- assets/build/css/form-cpt.css +141 -0
- assets/build/css/form-cpt.css.map +7 -0
- assets/build/css/form-cpt.min.css +1 -0
- assets/build/css/form-manager.css +683 -0
- assets/build/css/form-manager.css.map +7 -0
- assets/build/css/form-manager.min.css +1 -0
- assets/build/css/form-mce.css +130 -0
- assets/build/css/form-mce.css.map +7 -0
- assets/build/css/form-mce.min.css +1 -0
- assets/build/css/form-table.css +4 -0
- assets/build/css/form-table.css.map +7 -0
- assets/build/css/form-table.min.css +1 -0
- assets/build/css/form.css +156 -0
- assets/build/css/form.css.map +7 -0
- assets/build/css/form.min.css +1 -0
- assets/build/css/settings.css +15 -0
- assets/build/css/settings.css.map +7 -0
- assets/build/css/settings.min.css +1 -0
- assets/build/js/form-cpt-preview.min.js +1 -0
- assets/build/js/form-manager.js +4214 -0
- assets/build/js/form-manager.min.js +3 -0
- assets/build/js/form-mce.min.js +1 -0
- assets/build/js/form.min.js +1 -0
- assets/build/js/settings.min.js +1 -0
- {fonts → assets/fonts}/form-manager.eot +0 -0
- {fonts → assets/fonts}/form-manager.svg +0 -0
- {fonts → assets/fonts}/form-manager.ttf +0 -0
- {fonts → assets/fonts}/form-manager.woff +0 -0
- {fonts → assets/fonts}/icomoon.json +0 -0
- {fonts → assets/fonts}/menu.eot +0 -0
- {fonts → assets/fonts}/menu.svg +0 -0
- {fonts → assets/fonts}/menu.ttf +0 -0
- {fonts → assets/fonts}/menu.woff +0 -0
- {img → assets/img}/recaptcha.png +0 -0
- {js → assets/js}/form-cpt-preview.js +0 -0
- {js → assets/js}/form-mce.js +0 -0
- {js → assets/js}/form.js +120 -5
- {js → assets/js}/manager/app.js +0 -0
- {js → assets/js}/manager/collections.js +6 -0
- {js → assets/js}/manager/mixins.js +0 -0
- {js → assets/js}/manager/models.js +117 -8
- {js → assets/js}/manager/router.js +0 -0
- {js → assets/js}/manager/utils.js +0 -0
- {js → assets/js}/manager/views.js +225 -28
- {js → assets/js}/settings.js +0 -0
- assets/scss/admin.scss +46 -0
- assets/scss/form-cpt.scss +220 -0
- assets/scss/form-manager.scss +970 -0
- assets/scss/form-mce.scss +194 -0
- assets/scss/form-table.scss +3 -0
- assets/scss/form.scss +240 -0
- assets/scss/settings.scss +17 -0
- build/css/form-manager.css +5 -0
- build/css/form-manager.css.map +1 -1
- build/css/form-manager.min.css +1 -1
- build/js/form-manager.js +348 -36
- build/js/form-manager.min.js +3 -3
- build/js/form.min.js +1 -1
- classes/class-ccf-ads.php +4 -14
- classes/class-ccf-api-form-controller.php +74 -21
- classes/class-ccf-choice-cpt.php +1 -1
- classes/class-ccf-constants.php +1 -1
- classes/class-ccf-custom-contact-forms.php +2 -2
- classes/class-ccf-export.php +4 -5
- classes/class-ccf-field-cpt.php +1 -1
- classes/class-ccf-field-renderer.php +111 -83
- classes/class-ccf-form-cpt.php +36 -42
- classes/class-ccf-form-handler.php +83 -83
- classes/class-ccf-form-mail.php +1 -1
- classes/class-ccf-form-manager.php +463 -69
- classes/class-ccf-form-renderer.php +36 -6
- classes/class-ccf-settings.php +6 -6
- classes/class-ccf-upgrader.php +17 -17
- classes/class-ccf-widget.php +0 -1
- custom-contact-forms.php +2 -2
- languages/custom-contact-forms.mo +0 -0
- languages/custom-contact-forms.po +501 -312
- readme.txt +6 -0
assets/build/css/admin.css
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@charset "UTF-8";
|
2 |
+
@font-face {
|
3 |
+
font-family: 'menu';
|
4 |
+
src: url("../../fonts/menu.eot");
|
5 |
+
src: url("../../fonts/menu.eot?#iefix") format("embedded-opentype"), url("../../fonts/menu.woff") format("woff"), url("../../fonts/menu.ttf") format("truetype"), url("../../fonts/menu.svg#form-manager") format("svg");
|
6 |
+
font-weight: normal;
|
7 |
+
font-style: normal; }
|
8 |
+
#menu-posts-ccf_form .wp-menu-image:before {
|
9 |
+
font-family: 'menu';
|
10 |
+
content: "";
|
11 |
+
speak: none;
|
12 |
+
font-weight: normal;
|
13 |
+
font-variant: normal;
|
14 |
+
text-transform: none;
|
15 |
+
line-height: 1;
|
16 |
+
cursor: pointer;
|
17 |
+
-webkit-font-smoothing: antialiased; }
|
18 |
+
|
19 |
+
.ccf-subscribe.updated {
|
20 |
+
width: 100%;
|
21 |
+
display: block;
|
22 |
+
box-sizing: border-box;
|
23 |
+
border: 0;
|
24 |
+
background-color: #FCECAD; }
|
25 |
+
|
26 |
+
.ccf-subscribe.updated form {
|
27 |
+
display: inline; }
|
28 |
+
|
29 |
+
.ccf-subscribe .ad-wrap {
|
30 |
+
margin: 0.5em 0;
|
31 |
+
padding: 2px; }
|
32 |
+
|
33 |
+
.ccf-subscribe input[type=email] {
|
34 |
+
margin-left: 5px;
|
35 |
+
margin-right: 5px; }
|
36 |
+
|
37 |
+
/*# sourceMappingURL=admin.css.map */
|
assets/build/css/admin.css.map
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"version": 3,
|
3 |
+
"mappings": ";AAAA,UASC;EARA,WAAW,EAAE,MAAM;EACnB,GAAG,EAAC,2BAA2B;EAC/B,GAAG,EAAC,mNAGkD;EACtD,WAAW,EAAE,MAAM;EACnB,UAAU,EAAE,MAAM;AAIlB,0CAAsB;EACrB,WAAW,EAAE,MAAM;EACnB,OAAO,EAAE,GAAG;EACZ,KAAK,EAAE,IAAI;EACX,WAAW,EAAE,MAAM;EACnB,YAAY,EAAE,MAAM;EACpB,cAAc,EAAE,IAAI;EACpB,WAAW,EAAE,CAAC;EACd,MAAM,EAAE,OAAO;EACf,sBAAsB,EAAE,WAAW;;AAIrC,sBAAuB;EACtB,KAAK,EAAE,IAAI;EACX,OAAO,EAAE,KAAK;EACd,UAAU,EAAE,UAAU;EACtB,MAAM,EAAE,CAAC;EACT,gBAAgB,EAAE,OAAO;;AAG1B,2BAA4B;EAC3B,OAAO,EAAE,MAAM;;AAGhB,uBAAwB;EACvB,MAAM,EAAE,OAAO;EACf,OAAO,EAAE,GAAG;;AAGb,gCAAiC;EAChC,WAAW,EAAE,GAAG;EAChB,YAAY,EAAE,GAAG",
|
4 |
+
"sources": ["../../scss/admin.scss"],
|
5 |
+
"names": [],
|
6 |
+
"file": "admin.css"
|
7 |
+
}
|
assets/build/css/admin.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
@charset "UTF-8";@font-face{font-family:menu;src:url(../../fonts/menu.eot);src:url(../../fonts/menu.eot?#iefix) format("embedded-opentype"),url(../../fonts/menu.woff) format("woff"),url(../../fonts/menu.ttf) format("truetype"),url(../../fonts/menu.svg#form-manager) format("svg");font-weight:400;font-style:normal}#menu-posts-ccf_form .wp-menu-image:before{font-family:menu;content:"";speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;cursor:pointer;-webkit-font-smoothing:antialiased}.ccf-subscribe.updated{width:100%;display:block;box-sizing:border-box;border:0;background-color:#FCECAD}.ccf-subscribe.updated form{display:inline}.ccf-subscribe .ad-wrap{margin:.5em 0;padding:2px}.ccf-subscribe input[type=email]{margin-left:5px;margin-right:5px}
|
assets/build/css/form-cpt.css
ADDED
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#titlediv {
|
2 |
+
display: none; }
|
3 |
+
|
4 |
+
#submitdiv {
|
5 |
+
display: none; }
|
6 |
+
|
7 |
+
#wp-admin-bar-view {
|
8 |
+
display: none; }
|
9 |
+
|
10 |
+
.ccf-title h1 {
|
11 |
+
margin: 0; }
|
12 |
+
.ccf-title h1 .button {
|
13 |
+
vertical-align: middle;
|
14 |
+
top: -2px;
|
15 |
+
position: relative;
|
16 |
+
margin-left: 8px; }
|
17 |
+
|
18 |
+
#post-body-content .ccf-open-form-manager {
|
19 |
+
display: none; }
|
20 |
+
|
21 |
+
.add-new-h2 {
|
22 |
+
display: none; }
|
23 |
+
|
24 |
+
#ccf-at-a-glance .inside {
|
25 |
+
margin: 0;
|
26 |
+
padding: 0; }
|
27 |
+
#ccf-at-a-glance .inside .line {
|
28 |
+
display: block; }
|
29 |
+
#ccf-at-a-glance .inside .has-icon {
|
30 |
+
display: block; }
|
31 |
+
#ccf-at-a-glance .inside .has-icon:before {
|
32 |
+
font: normal 20px/1 'dashicons';
|
33 |
+
speak: none;
|
34 |
+
display: inline-block;
|
35 |
+
padding: 0 5px 0 0;
|
36 |
+
left: -1px;
|
37 |
+
position: relative;
|
38 |
+
vertical-align: top;
|
39 |
+
-webkit-font-smoothing: antialiased;
|
40 |
+
-moz-osx-font-smoothing: grayscale;
|
41 |
+
text-decoration: none !important;
|
42 |
+
top: -1px;
|
43 |
+
color: #888; }
|
44 |
+
#ccf-at-a-glance .inside #ccf-created-by:before {
|
45 |
+
content: "\f110"; }
|
46 |
+
#ccf-at-a-glance .inside #ccf-submission-num:before {
|
47 |
+
content: "\f226"; }
|
48 |
+
#ccf-at-a-glance .inside #ccf-field-num:before {
|
49 |
+
content: "\f175"; }
|
50 |
+
#ccf-at-a-glance .inside #major-publishing-actions {
|
51 |
+
overflow: auto; }
|
52 |
+
#ccf-at-a-glance .inside #major-publishing-actions .submitdelete {
|
53 |
+
color: #a00;
|
54 |
+
text-decoration: none;
|
55 |
+
padding: 1px 2px; }
|
56 |
+
#ccf-at-a-glance .inside #major-publishing-actions .export-button {
|
57 |
+
float: right; }
|
58 |
+
|
59 |
+
.ccf-form-cpt-preview .ccf-form-preview {
|
60 |
+
border: 0;
|
61 |
+
padding: 0;
|
62 |
+
background-color: inherit; }
|
63 |
+
.ccf-form-cpt-preview .spinner {
|
64 |
+
display: block;
|
65 |
+
float: none; }
|
66 |
+
|
67 |
+
.ccf-submission-column-controller .spinner {
|
68 |
+
display: block;
|
69 |
+
float: none; }
|
70 |
+
|
71 |
+
#ccf-submissions [data-icon]:before {
|
72 |
+
font-family: 'form-manager';
|
73 |
+
content: attr(data-icon);
|
74 |
+
speak: none;
|
75 |
+
font-weight: normal;
|
76 |
+
font-variant: normal;
|
77 |
+
text-transform: none;
|
78 |
+
line-height: 1;
|
79 |
+
cursor: pointer;
|
80 |
+
-webkit-font-smoothing: antialiased; }
|
81 |
+
#ccf-submissions .ccf-submission-icon {
|
82 |
+
font: normal 20px/1;
|
83 |
+
speak: none;
|
84 |
+
display: inline-block;
|
85 |
+
padding: 12px 0px 4px 10px;
|
86 |
+
top: 0;
|
87 |
+
position: relative;
|
88 |
+
float: right;
|
89 |
+
width: 23px;
|
90 |
+
height: 30px;
|
91 |
+
cursor: pointer;
|
92 |
+
color: inherit; }
|
93 |
+
#ccf-submissions .inside {
|
94 |
+
padding: 0;
|
95 |
+
margin: 0; }
|
96 |
+
#ccf-submissions .inside table {
|
97 |
+
border: 0;
|
98 |
+
border-collapse: collapse;
|
99 |
+
table-layout: auto;
|
100 |
+
width: 100%; }
|
101 |
+
#ccf-submissions .inside table td, #ccf-submissions .inside table th {
|
102 |
+
padding: 8px 10px; }
|
103 |
+
#ccf-submissions .inside table th input {
|
104 |
+
margin: 0; }
|
105 |
+
#ccf-submissions .inside table tbody tr {
|
106 |
+
background-color: #f9f9f9; }
|
107 |
+
#ccf-submissions .inside table tbody tr td {
|
108 |
+
width: auto; }
|
109 |
+
#ccf-submissions .inside table tbody tr .spinner {
|
110 |
+
float: none;
|
111 |
+
display: block; }
|
112 |
+
#ccf-submissions .inside table tbody tr .actions {
|
113 |
+
text-align: right; }
|
114 |
+
#ccf-submissions .inside table tbody tr .actions a {
|
115 |
+
cursor: pointer;
|
116 |
+
color: inherit;
|
117 |
+
padding-left: 4px; }
|
118 |
+
#ccf-submissions .inside table tbody tr .submission-wrapper {
|
119 |
+
display: none; }
|
120 |
+
#ccf-submissions .inside table tbody tr:nth-child(2n-1) {
|
121 |
+
background-color: #fff; }
|
122 |
+
#ccf-submissions .inside table tbody tr td.no-submissions {
|
123 |
+
text-align: center;
|
124 |
+
width: auto;
|
125 |
+
padding-bottom: 8px; }
|
126 |
+
#ccf-submissions .inside .ccf-pagination {
|
127 |
+
border-top: 1px solid #eee;
|
128 |
+
margin-top: 0;
|
129 |
+
padding: 8px; }
|
130 |
+
|
131 |
+
.ccf-submission-content .field-slug {
|
132 |
+
font-weight: bold;
|
133 |
+
font-size: 15px;
|
134 |
+
padding: 7px; }
|
135 |
+
.ccf-submission-content .field-content {
|
136 |
+
padding: 7px;
|
137 |
+
background-color: #f9f9f9; }
|
138 |
+
.ccf-submission-content .field-content span {
|
139 |
+
font-style: italic;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AAoB;QACnB,OAAO,EAAE,IAAI;MAGd,uDAAkB;QACjB,gBAAgB,EAAE,IAAI;MAGvB,yDAAkB;QACjB,UAAU,EAAE,MAAM;QAClB,KAAK,EAAE,IAAI;QACX,cAAc,EAAE,GAAG;EAMvB,wCAAgB;IACf,UAAU,EAAE,cAAc;IAC1B,UAAU,EAAE,CAAC;IACb,OAAO,EAAE,GAAG;;AAMd,mCAAY;EACX,WAAW,EAAE,IAAI;EACjB,SAAS,EAAE,IAAI;EACf,OAAO,EAAE,GAAG;AAGb,sCAAe;EACd,OAAO,EAAE,GAAG;EACZ,gBAAgB,EAAE,OAAO;EAEzB,2CAAK;IACJ,UAAU,EAAE,MAAM",
|
4 |
+
"sources": ["../../scss/form-cpt.scss"],
|
5 |
+
"names": [],
|
6 |
+
"file": "form-cpt.css"
|
7 |
+
}
|
assets/build/css/form-cpt.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
#submitdiv,#titlediv,#wp-admin-bar-view{display:none}.ccf-title h1{margin:0}.ccf-title h1 .button{vertical-align:middle;top:-2px;position:relative;margin-left:8px}#post-body-content .ccf-open-form-manager,.add-new-h2{display:none}#ccf-at-a-glance .inside{margin:0;padding:0}#ccf-at-a-glance .inside .has-icon,#ccf-at-a-glance .inside .line{display:block}#ccf-at-a-glance .inside .has-icon:before{font:400 20px/1 dashicons;speak:none;display:inline-block;padding:0 5px 0 0;left:-1px;position:relative;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important;top:-1px;color:#888}#ccf-at-a-glance .inside #ccf-created-by:before{content:"\f110"}#ccf-at-a-glance .inside #ccf-submission-num:before{content:"\f226"}#ccf-at-a-glance .inside #ccf-field-num:before{content:"\f175"}#ccf-at-a-glance .inside #major-publishing-actions{overflow:auto}#ccf-at-a-glance .inside #major-publishing-actions .submitdelete{color:#a00;text-decoration:none;padding:1px 2px}#ccf-at-a-glance .inside #major-publishing-actions .export-button{float:right}.ccf-form-cpt-preview .ccf-form-preview{border:0;padding:0;background-color:inherit}.ccf-form-cpt-preview .spinner,.ccf-submission-column-controller .spinner{display:block;float:none}#ccf-submissions [data-icon]:before{font-family:form-manager;content:attr(data-icon);speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;cursor:pointer;-webkit-font-smoothing:antialiased}#ccf-submissions .ccf-submission-icon{font:400 20px/1;speak:none;display:inline-block;padding:12px 0 4px 10px;top:0;position:relative;float:right;width:23px;height:30px;cursor:pointer;color:inherit}#ccf-submissions .inside{padding:0;margin:0}#ccf-submissions .inside table{border:0;border-collapse:collapse;table-layout:auto;width:100%}#ccf-submissions .inside table td,#ccf-submissions .inside table th{padding:8px 10px}#ccf-submissions .inside table th input{margin:0}#ccf-submissions .inside table tbody tr{background-color:#f9f9f9}#ccf-submissions .inside table tbody tr td{width:auto}#ccf-submissions .inside table tbody tr .spinner{float:none;display:block}#ccf-submissions .inside table tbody tr .actions{text-align:right}#ccf-submissions .inside table tbody tr .actions a{cursor:pointer;color:inherit;padding-left:4px}#ccf-submissions .inside table tbody tr .submission-wrapper{display:none}#ccf-submissions .inside table tbody tr:nth-child(2n-1){background-color:#fff}#ccf-submissions .inside table tbody tr td.no-submissions{text-align:center;width:auto;padding-bottom:8px}#ccf-submissions .inside .ccf-pagination{border-top:1px solid #eee;margin-top:0;padding:8px}.ccf-submission-content .field-slug{font-weight:700;font-size:15px;padding:7px}.ccf-submission-content .field-content{padding:7px;background-color:#f9f9f9}.ccf-submission-content .field-content span{font-style:italic}
|
assets/build/css/form-manager.css
ADDED
@@ -0,0 +1,683 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@charset "UTF-8";
|
2 |
+
@font-face {
|
3 |
+
font-family: 'menu';
|
4 |
+
src: url("../../fonts/menu.eot");
|
5 |
+
src: url("../../fonts/menu.eot?#iefix") format("embedded-opentype"), url("../../fonts/menu.woff") format("woff"), url("../../fonts/menu.ttf") format("truetype"), url("../../fonts/menu.svg#form-manager") format("svg");
|
6 |
+
font-weight: normal;
|
7 |
+
font-style: normal; }
|
8 |
+
@font-face {
|
9 |
+
font-family: 'form-manager';
|
10 |
+
src: url("../../fonts/form-manager.eot");
|
11 |
+
src: url("../../fonts/form-manager.eot?#iefix") format("embedded-opentype"), url("../../fonts/form-manager.woff") format("woff"), url("../../fonts/form-manager.ttf") format("truetype"), url("../../fonts/form-manager.svg#form-manager") format("svg");
|
12 |
+
font-weight: normal;
|
13 |
+
font-style: normal; }
|
14 |
+
.ccf-open-form-manager:before {
|
15 |
+
font-family: 'menu';
|
16 |
+
content: "";
|
17 |
+
padding-right: 4px;
|
18 |
+
speak: none;
|
19 |
+
font-weight: normal;
|
20 |
+
font-variant: normal;
|
21 |
+
text-transform: none;
|
22 |
+
line-height: 1;
|
23 |
+
cursor: pointer;
|
24 |
+
-webkit-font-smoothing: antialiased; }
|
25 |
+
|
26 |
+
.ccf-main-modal {
|
27 |
+
display: none;
|
28 |
+
position: fixed;
|
29 |
+
top: 30px;
|
30 |
+
left: 30px;
|
31 |
+
right: 30px;
|
32 |
+
bottom: 30px;
|
33 |
+
z-index: 160000;
|
34 |
+
overflow: hidden;
|
35 |
+
background-color: #fff; }
|
36 |
+
.ccf-main-modal [data-icon]:before {
|
37 |
+
font-family: 'form-manager';
|
38 |
+
content: attr(data-icon);
|
39 |
+
speak: none;
|
40 |
+
font-weight: normal;
|
41 |
+
font-variant: normal;
|
42 |
+
text-transform: none;
|
43 |
+
line-height: 1;
|
44 |
+
cursor: pointer;
|
45 |
+
-webkit-font-smoothing: antialiased; }
|
46 |
+
.ccf-main-modal .single .insert-form-button {
|
47 |
+
display: none; }
|
48 |
+
.ccf-main-modal .hidden {
|
49 |
+
display: block; }
|
50 |
+
.ccf-main-modal .field {
|
51 |
+
margin-bottom: 5px;
|
52 |
+
overflow: auto;
|
53 |
+
position: relative; }
|
54 |
+
.ccf-main-modal .field.field-incomplete h4 {
|
55 |
+
background-color: #ffebe8; }
|
56 |
+
.ccf-main-modal .field.field-duplicate-slug h4 {
|
57 |
+
background-color: #ffe6a5; }
|
58 |
+
.ccf-main-modal .field.ccf-editing {
|
59 |
+
border: #999 1px solid; }
|
60 |
+
.ccf-main-modal .field.ccf-editing h4:hover {
|
61 |
+
border: 1px solid #e5e5e5; }
|
62 |
+
.ccf-main-modal .field h4 {
|
63 |
+
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
|
64 |
+
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
|
65 |
+
border: 1px solid #e5e5e5;
|
66 |
+
background: #fafafa;
|
67 |
+
font-size: 13px;
|
68 |
+
margin: 0;
|
69 |
+
font-weight: 600;
|
70 |
+
color: #222;
|
71 |
+
padding: 13px 13px 13px 20px;
|
72 |
+
cursor: move; }
|
73 |
+
.ccf-main-modal .field h4:hover {
|
74 |
+
border: #999 1px solid; }
|
75 |
+
.ccf-main-modal .field .right {
|
76 |
+
float: right;
|
77 |
+
display: block; }
|
78 |
+
.ccf-main-modal .field .right a {
|
79 |
+
color: inherit;
|
80 |
+
margin-left: 3px; }
|
81 |
+
.ccf-main-modal .field .preview {
|
82 |
+
clear: both;
|
83 |
+
display: none;
|
84 |
+
text-align: left;
|
85 |
+
overflow: auto;
|
86 |
+
float: none;
|
87 |
+
background-color: #fff;
|
88 |
+
border-left: 1px solid #e5e5e5;
|
89 |
+
border-right: 1px solid #e5e5e5;
|
90 |
+
border-bottom: 1px solid #e5e5e5;
|
91 |
+
padding: 10px 20px; }
|
92 |
+
.ccf-main-modal .field .preview .recaptcha-preview-img {
|
93 |
+
margin-top: 7px; }
|
94 |
+
.ccf-main-modal .field .preview .field-description {
|
95 |
+
margin-top: 3px;
|
96 |
+
clear: left; }
|
97 |
+
.ccf-main-modal .field .preview .left {
|
98 |
+
float: left;
|
99 |
+
clear: both;
|
100 |
+
width: 47%; }
|
101 |
+
.ccf-main-modal .field .preview .right {
|
102 |
+
float: right;
|
103 |
+
width: 47%; }
|
104 |
+
.ccf-main-modal .field .preview .left input[type="text"], .ccf-main-modal .field .preview .left select, .ccf-main-modal .field .preview .right input[type="text"], .ccf-main-modal .field .preview .right select, .ccf-main-modal .field .preview .full input[type="text"], .ccf-main-modal .field .preview .full select {
|
105 |
+
width: 100%;
|
106 |
+
max-width: 100%; }
|
107 |
+
.ccf-main-modal .field .preview .left .sub-label, .ccf-main-modal .field .preview .right .sub-label, .ccf-main-modal .field .preview .full .sub-label {
|
108 |
+
margin: 3px 0 3px 2px;
|
109 |
+
font-size: 90%; }
|
110 |
+
.ccf-main-modal .field .preview .left .hour, .ccf-main-modal .field .preview .left .minute, .ccf-main-modal .field .preview .right .hour, .ccf-main-modal .field .preview .right .minute, .ccf-main-modal .field .preview .full .hour, .ccf-main-modal .field .preview .full .minute {
|
111 |
+
display: inline-block;
|
112 |
+
margin-right: 5px; }
|
113 |
+
.ccf-main-modal .field .preview .left .hour input, .ccf-main-modal .field .preview .left .minute input, .ccf-main-modal .field .preview .right .hour input, .ccf-main-modal .field .preview .right .minute input, .ccf-main-modal .field .preview .full .hour input, .ccf-main-modal .field .preview .full .minute input {
|
114 |
+
width: 35px; }
|
115 |
+
.ccf-main-modal .field .preview .left .am-pm, .ccf-main-modal .field .preview .right .am-pm, .ccf-main-modal .field .preview .full .am-pm {
|
116 |
+
display: inline-block;
|
117 |
+
vertical-align: top; }
|
118 |
+
.ccf-main-modal .field .preview .left .am-pm select, .ccf-main-modal .field .preview .right .am-pm select, .ccf-main-modal .field .preview .full .am-pm select {
|
119 |
+
width: 60px; }
|
120 |
+
.ccf-main-modal .field .preview .heading {
|
121 |
+
font-size: 125%;
|
122 |
+
font-weight: bold;
|
123 |
+
border-bottom: 1px solid #ccc;
|
124 |
+
padding-bottom: 9px;
|
125 |
+
margin-bottom: 9px; }
|
126 |
+
.ccf-main-modal .field .preview .subheading {
|
127 |
+
font-style: italic; }
|
128 |
+
.ccf-main-modal .field .preview .conditionals-enabled {
|
129 |
+
font-size: 70%;
|
130 |
+
background-color: #ffe6a5;
|
131 |
+
font-weight: bold;
|
132 |
+
padding: 0px 2px;
|
133 |
+
opacity: .5;
|
134 |
+
left: 7px;
|
135 |
+
position: absolute;
|
136 |
+
top: 1.49em; }
|
137 |
+
.ccf-main-modal .field .preview label {
|
138 |
+
font-weight: bold;
|
139 |
+
margin-bottom: 3px;
|
140 |
+
cursor: inherit; }
|
141 |
+
.ccf-main-modal .field .preview label span.required {
|
142 |
+
color: red; }
|
143 |
+
.ccf-main-modal .field .preview input[type="checkbox"] + label {
|
144 |
+
display: inline-block; }
|
145 |
+
.ccf-main-modal .field .preview input[type="radio"] + label {
|
146 |
+
display: inline-block; }
|
147 |
+
.ccf-main-modal .field .preview input[type="text"], .ccf-main-modal .field .preview textarea {
|
148 |
+
border: inherit;
|
149 |
+
width: 100%;
|
150 |
+
background-color: #fff;
|
151 |
+
color: #333;
|
152 |
+
border: 1px solid #ddd;
|
153 |
+
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07);
|
154 |
+
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07); }
|
155 |
+
.ccf-main-modal .field .preview textarea {
|
156 |
+
height: 60px; }
|
157 |
+
.ccf-main-modal .close-icon {
|
158 |
+
position: absolute;
|
159 |
+
top: 16px;
|
160 |
+
right: 16px;
|
161 |
+
font-size: 35px;
|
162 |
+
cursor: pointer;
|
163 |
+
color: #333;
|
164 |
+
z-index: 160001; }
|
165 |
+
.ccf-main-modal .main-menu {
|
166 |
+
position: absolute;
|
167 |
+
top: 0;
|
168 |
+
right: 0;
|
169 |
+
left: 0;
|
170 |
+
height: 125px; }
|
171 |
+
.ccf-main-modal .main-menu h1 {
|
172 |
+
padding: 16px; }
|
173 |
+
.ccf-main-modal .main-menu ul {
|
174 |
+
height: 40px;
|
175 |
+
box-sizing: border-box;
|
176 |
+
font-size: 14px;
|
177 |
+
margin: 0;
|
178 |
+
list-style-type: none;
|
179 |
+
border-top: 1px solid #ddd;
|
180 |
+
background: #f3f3f3;
|
181 |
+
padding: 0 16px; }
|
182 |
+
.ccf-main-modal .main-menu ul li {
|
183 |
+
display: inline-block;
|
184 |
+
margin: 0;
|
185 |
+
padding: 0;
|
186 |
+
display: inline-block;
|
187 |
+
height: 38px;
|
188 |
+
vertical-align: middle;
|
189 |
+
line-height: 40px;
|
190 |
+
padding: 0 8px; }
|
191 |
+
.ccf-main-modal .main-menu ul li a {
|
192 |
+
text-decoration: none; }
|
193 |
+
.ccf-main-modal .main-menu ul li a :hover {
|
194 |
+
color: #000; }
|
195 |
+
.ccf-main-modal .main-menu ul li a.selected {
|
196 |
+
color: #000; }
|
197 |
+
.ccf-main-modal .ccf-form-pane {
|
198 |
+
display: none;
|
199 |
+
position: absolute;
|
200 |
+
top: 125px;
|
201 |
+
right: 0;
|
202 |
+
left: 0;
|
203 |
+
bottom: 0; }
|
204 |
+
.ccf-main-modal .ccf-form-pane.single {
|
205 |
+
top: 85px;
|
206 |
+
border-top: 1px solid #e5e5e5; }
|
207 |
+
.ccf-main-modal .ccf-form-pane.single .form-content, .ccf-main-modal .ccf-form-pane.single .left-sidebar {
|
208 |
+
border-top: 0; }
|
209 |
+
.ccf-main-modal .ccf-form-pane .disabled-overlay {
|
210 |
+
position: absolute;
|
211 |
+
top: 0;
|
212 |
+
left: 0;
|
213 |
+
right: 0;
|
214 |
+
bottom: 50px;
|
215 |
+
background-color: #000;
|
216 |
+
opacity: .1;
|
217 |
+
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=1)";
|
218 |
+
filter: alpha(opacity=1);
|
219 |
+
-moz-opacity: 0.1;
|
220 |
+
-khtml-opacity: 0.1;
|
221 |
+
z-index: 3;
|
222 |
+
display: none; }
|
223 |
+
.ccf-main-modal .ccf-form-pane .bottom {
|
224 |
+
bottom: 0;
|
225 |
+
left: 0;
|
226 |
+
right: 0;
|
227 |
+
height: 50px;
|
228 |
+
padding: 0 16px 0 0;
|
229 |
+
position: absolute;
|
230 |
+
text-align: right;
|
231 |
+
line-height: 50px;
|
232 |
+
border-top: 1px solid #e5e5e5; }
|
233 |
+
.ccf-main-modal .ccf-form-pane .bottom .left {
|
234 |
+
float: left;
|
235 |
+
background-color: #00a0d2;
|
236 |
+
padding-left: 16px;
|
237 |
+
padding-right: 16px;
|
238 |
+
color: #fff; }
|
239 |
+
@media (max-width: 830px) {
|
240 |
+
.ccf-main-modal .ccf-form-pane .bottom .left {
|
241 |
+
display: none; } }
|
242 |
+
.ccf-main-modal .ccf-form-pane .bottom .left input {
|
243 |
+
vertical-align: middle;
|
244 |
+
margin-left: 5px; }
|
245 |
+
.ccf-main-modal .ccf-form-pane .bottom .left button {
|
246 |
+
vertical-align: middle; }
|
247 |
+
.ccf-main-modal .ccf-form-pane .bottom .left .signup-x {
|
248 |
+
color: red;
|
249 |
+
display: none;
|
250 |
+
font-size: 150%;
|
251 |
+
vertical-align: middle;
|
252 |
+
font-weight: bold;
|
253 |
+
margin-left: 4px; }
|
254 |
+
.ccf-main-modal .ccf-form-pane .bottom .left .signup-check {
|
255 |
+
color: green;
|
256 |
+
display: none;
|
257 |
+
vertical-align: middle;
|
258 |
+
font-size: 150%;
|
259 |
+
font-weight: bold;
|
260 |
+
margin-left: 4px; }
|
261 |
+
.ccf-main-modal .ccf-form-pane .bottom .left.signup-success .signup-check {
|
262 |
+
display: inline; }
|
263 |
+
.ccf-main-modal .ccf-form-pane .bottom .left.signup-error .signup-x {
|
264 |
+
display: inline; }
|
265 |
+
.ccf-main-modal .ccf-form-pane .bottom .spinner {
|
266 |
+
display: none;
|
267 |
+
visibility: visible;
|
268 |
+
float: right;
|
269 |
+
width: 16px;
|
270 |
+
height: 16px;
|
271 |
+
margin-top: 16px; }
|
272 |
+
.ccf-main-modal .ccf-form-pane .bottom input[type="button"] {
|
273 |
+
margin-top: 11px;
|
274 |
+
float: right;
|
275 |
+
margin-left: 6px; }
|
276 |
+
.ccf-main-modal .ccf-form-pane .accordion-section {
|
277 |
+
background-color: #fff;
|
278 |
+
border-bottom: 0; }
|
279 |
+
.ccf-main-modal .ccf-form-pane .accordion-section:first-child {
|
280 |
+
border-top: 1px solid #e5e5e5; }
|
281 |
+
.ccf-main-modal .ccf-form-pane .accordion-section.expanded .section-content {
|
282 |
+
display: block; }
|
283 |
+
.ccf-main-modal .ccf-form-pane .accordion-section.expanded .accordion-heading:before {
|
284 |
+
content: ""; }
|
285 |
+
.ccf-main-modal .ccf-form-pane .accordion-section.expanded .form-settings-heading:before {
|
286 |
+
content: ""; }
|
287 |
+
.ccf-main-modal .ccf-form-pane .accordion-section .accordion-heading, .ccf-main-modal .ccf-form-pane .accordion-section .form-settings-heading {
|
288 |
+
cursor: pointer;
|
289 |
+
display: block;
|
290 |
+
line-height: 29px;
|
291 |
+
color: inherit;
|
292 |
+
padding: 10px 20px;
|
293 |
+
border-bottom: 1px solid #e5e5e5;
|
294 |
+
font-size: 150%;
|
295 |
+
background-color: #fafafa;
|
296 |
+
margin: 0; }
|
297 |
+
.ccf-main-modal .ccf-form-pane .accordion-section .accordion-heading:before, .ccf-main-modal .ccf-form-pane .accordion-section .form-settings-heading:before {
|
298 |
+
margin-right: 8px;
|
299 |
+
font-family: 'form-manager';
|
300 |
+
content: "";
|
301 |
+
speak: none;
|
302 |
+
font-weight: normal;
|
303 |
+
font-variant: normal;
|
304 |
+
text-transform: none;
|
305 |
+
line-height: 1;
|
306 |
+
cursor: pointer;
|
307 |
+
-webkit-font-smoothing: antialiased; }
|
308 |
+
.ccf-main-modal .ccf-form-pane .accordion-section .section-content {
|
309 |
+
display: none;
|
310 |
+
padding: 10px 20px;
|
311 |
+
border-bottom: 1px solid #e5e5e5; }
|
312 |
+
.ccf-main-modal .ccf-form-pane label {
|
313 |
+
display: block;
|
314 |
+
margin-bottom: 8px; }
|
315 |
+
.ccf-main-modal .ccf-form-pane .explain {
|
316 |
+
margin-top: 5px;
|
317 |
+
font-style: italic;
|
318 |
+
display: block; }
|
319 |
+
.ccf-main-modal .ccf-form-pane.show-form-settings .ccf-form-settings {
|
320 |
+
display: block; }
|
321 |
+
.ccf-main-modal .ccf-form-pane .ccf-form-settings {
|
322 |
+
display: none;
|
323 |
+
position: absolute;
|
324 |
+
width: 75%;
|
325 |
+
bottom: 50px;
|
326 |
+
left: 25%;
|
327 |
+
z-index: 2;
|
328 |
+
top: 0;
|
329 |
+
overflow: auto;
|
330 |
+
background-color: #fff;
|
331 |
+
border-top: 1px solid #ddd;
|
332 |
+
padding: 21px;
|
333 |
+
box-sizing: border-box; }
|
334 |
+
.ccf-main-modal .ccf-form-pane .ccf-form-settings p:first-child,
|
335 |
+
.ccf-main-modal .ccf-form-pane .ccf-form-settings h3:first-child {
|
336 |
+
margin-top: 0; }
|
337 |
+
.ccf-main-modal .ccf-form-pane .ccf-form-settings h3 {
|
338 |
+
border-bottom: 1px solid #ccc;
|
339 |
+
padding-bottom: .75em;
|
340 |
+
margin-top: 2em; }
|
341 |
+
.ccf-main-modal .ccf-form-pane .ccf-form-settings .ccf-form-notifications td {
|
342 |
+
position: relative; }
|
343 |
+
.ccf-main-modal .ccf-form-pane .ccf-form-settings .variables {
|
344 |
+
margin-top: 0; }
|
345 |
+
.ccf-main-modal .ccf-form-pane .ccf-form-settings .ccf-form-notifications .active {
|
346 |
+
width: 15%; }
|
347 |
+
.ccf-main-modal .ccf-form-pane .ccf-form-settings .ccf-form-notifications .active-indicator {
|
348 |
+
color: #33CA33;
|
349 |
+
font-size: 40px; }
|
350 |
+
.ccf-main-modal .ccf-form-pane .ccf-form-settings .ccf-form-notifications .inactive-indicator {
|
351 |
+
color: red;
|
352 |
+
font-size: 40px; }
|
353 |
+
.ccf-main-modal .ccf-form-pane .ccf-form-settings .ccf-form-notifications .add-notification {
|
354 |
+
margin-top: 1em;
|
355 |
+
cursor: pointer; }
|
356 |
+
.ccf-main-modal .ccf-form-pane .ccf-form-settings .close-notification {
|
357 |
+
position: absolute;
|
358 |
+
top: 10px;
|
359 |
+
right: 10px;
|
360 |
+
cursor: pointer;
|
361 |
+
font-size: 200%;
|
362 |
+
color: inherit; }
|
363 |
+
.ccf-main-modal .ccf-form-pane .ccf-form-settings .delete-notification {
|
364 |
+
color: red; }
|
365 |
+
.ccf-main-modal .ccf-form-pane .ccf-form-settings .address .add,
|
366 |
+
.ccf-main-modal .ccf-form-pane .ccf-form-settings .address .delete,
|
367 |
+
.ccf-main-modal .ccf-form-pane .ccf-form-settings .field-mapping .add,
|
368 |
+
.ccf-main-modal .ccf-form-pane .ccf-form-settings .field-mapping .delete {
|
369 |
+
color: inherit;
|
370 |
+
vertical-align: middle; }
|
371 |
+
.ccf-main-modal .ccf-form-pane .ccf-form-settings .post-creation-mapping-wrapper {
|
372 |
+
margin-top: 1em; }
|
373 |
+
.ccf-main-modal .ccf-form-pane .left-sidebar {
|
374 |
+
box-sizing: border-box;
|
375 |
+
background-color: #f3f3f3;
|
376 |
+
position: absolute;
|
377 |
+
border-top: 1px solid #ddd;
|
378 |
+
border-right: 1px solid #ddd;
|
379 |
+
overflow: scroll;
|
380 |
+
width: 25%;
|
381 |
+
top: 0;
|
382 |
+
padding: 0;
|
383 |
+
bottom: 50px;
|
384 |
+
left: 0;
|
385 |
+
overflow: auto; }
|
386 |
+
.ccf-main-modal .ccf-form-pane .left-sidebar .accordion-section:first-child {
|
387 |
+
border-top: 0; }
|
388 |
+
.ccf-main-modal .ccf-form-pane .left-sidebar .fields, .ccf-main-modal .ccf-form-pane .left-sidebar .structure-fields, .ccf-main-modal .ccf-form-pane .left-sidebar .special-fields {
|
389 |
+
padding: 5px; }
|
390 |
+
.ccf-main-modal .ccf-form-pane .left-sidebar .fields .field .right, .ccf-main-modal .ccf-form-pane .left-sidebar .fields .field .preview, .ccf-main-modal .ccf-form-pane .left-sidebar .structure-fields .field .right, .ccf-main-modal .ccf-form-pane .left-sidebar .structure-fields .field .preview, .ccf-main-modal .ccf-form-pane .left-sidebar .special-fields .field .right, .ccf-main-modal .ccf-form-pane .left-sidebar .special-fields .field .preview {
|
391 |
+
display: none; }
|
392 |
+
.ccf-main-modal .ccf-form-pane .form-content {
|
393 |
+
box-sizing: border-box;
|
394 |
+
position: absolute;
|
395 |
+
width: 40%;
|
396 |
+
bottom: 50px;
|
397 |
+
left: 25%;
|
398 |
+
right: 35%;
|
399 |
+
top: 0;
|
400 |
+
overflow: auto;
|
401 |
+
border-top: 1px solid #ddd;
|
402 |
+
padding: 21px; }
|
403 |
+
.ccf-main-modal .ccf-form-pane .form-content .field-placeholder {
|
404 |
+
border: 1px dashed #e5e5e5;
|
405 |
+
height: 46px;
|
406 |
+
margin-bottom: 5px; }
|
407 |
+
.ccf-main-modal .ccf-form-pane .form-content .no-fields {
|
408 |
+
font-size: 22px;
|
409 |
+
padding: 16px;
|
410 |
+
font-style: italic; }
|
411 |
+
.ccf-main-modal .ccf-form-pane .form-content:after {
|
412 |
+
width: 100%;
|
413 |
+
display: block;
|
414 |
+
margin-top: 5px;
|
415 |
+
box-sizing: border-box;
|
416 |
+
-moz-box-sizing: border-box;
|
417 |
+
-webkit-box-sizing: border-box;
|
418 |
+
font-style: italic;
|
419 |
+
font-size: 22px;
|
420 |
+
text-align: center;
|
421 |
+
padding: 1em .5em;
|
422 |
+
border: 4px dashed #e5e5e5;
|
423 |
+
content: attr(data-drag-message); }
|
424 |
+
.ccf-main-modal .ccf-form-pane .right-sidebar {
|
425 |
+
box-sizing: border-box;
|
426 |
+
padding: 0;
|
427 |
+
position: absolute;
|
428 |
+
overflow: scroll;
|
429 |
+
width: 35%;
|
430 |
+
top: 0;
|
431 |
+
overflow: auto;
|
432 |
+
background-color: #f3f3f3;
|
433 |
+
right: 0;
|
434 |
+
bottom: 50px;
|
435 |
+
border-left: 1px solid #dddddd; }
|
436 |
+
.ccf-main-modal .ccf-form-pane .right-sidebar .section-content > div {
|
437 |
+
margin-bottom: 6px; }
|
438 |
+
.ccf-main-modal .ccf-form-pane .right-sidebar .no-field {
|
439 |
+
padding: 16px;
|
440 |
+
font-style: italic;
|
441 |
+
font-size: 22px; }
|
442 |
+
.ccf-main-modal .ccf-form-pane .right-sidebar label {
|
443 |
+
display: inline-block;
|
444 |
+
margin: 0; }
|
445 |
+
.ccf-main-modal .ccf-form-pane .right-sidebar label .required {
|
446 |
+
color: red; }
|
447 |
+
.ccf-main-modal .ccf-form-pane .right-sidebar .field-error input {
|
448 |
+
border-color: #ff0000;
|
449 |
+
border-width: 2px; }
|
450 |
+
.ccf-main-modal .ccf-form-pane .right-sidebar .field-duplicate-slug input {
|
451 |
+
border-color: #ffe6a5;
|
452 |
+
border-width: 2px; }
|
453 |
+
.ccf-main-modal .ccf-form-pane .right-sidebar input[type=text] {
|
454 |
+
width: 100%;
|
455 |
+
display: block;
|
456 |
+
margin-top: 5px; }
|
457 |
+
.ccf-main-modal .ccf-form-pane .right-sidebar .hide {
|
458 |
+
display: none; }
|
459 |
+
.ccf-main-modal .ccf-form-pane .right-sidebar .conditionals input[type="text"] {
|
460 |
+
width: 100px;
|
461 |
+
display: inline-block; }
|
462 |
+
.ccf-main-modal .ccf-form-pane .right-sidebar input[type="checkbox"] + label {
|
463 |
+
display: inline-block;
|
464 |
+
vertical-align: middle; }
|
465 |
+
.ccf-main-modal .ccf-form-pane .right-sidebar label + select {
|
466 |
+
display: inline-block; }
|
467 |
+
.ccf-main-modal .ccf-form-pane .right-sidebar textarea {
|
468 |
+
width: 100%;
|
469 |
+
height: 80px;
|
470 |
+
margin-top: 5px; }
|
471 |
+
.ccf-main-modal .ccf-form-pane .right-sidebar .field-html {
|
472 |
+
height: 150px;
|
473 |
+
width: 100%; }
|
474 |
+
.ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices .choice input[type='text'] {
|
475 |
+
width: 100px;
|
476 |
+
display: inline-block; }
|
477 |
+
.ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices .choice .move {
|
478 |
+
color: inherit;
|
479 |
+
cursor: move; }
|
480 |
+
.ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices .choice .move:before {
|
481 |
+
cursor: move; }
|
482 |
+
.ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices .choice .add, .ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices .choice .delete {
|
483 |
+
cursor: pointer;
|
484 |
+
color: inherit; }
|
485 |
+
.ccf-main-modal .ccf-existing-form-pane {
|
486 |
+
display: none;
|
487 |
+
position: absolute;
|
488 |
+
overflow: scroll;
|
489 |
+
top: 125px;
|
490 |
+
right: 0;
|
491 |
+
left: 0;
|
492 |
+
bottom: 0;
|
493 |
+
background-color: #fff;
|
494 |
+
padding: 16px; }
|
495 |
+
.ccf-main-modal .ccf-existing-form-pane table,
|
496 |
+
.ccf-main-modal .ccf-form-notifications table {
|
497 |
+
width: 100%;
|
498 |
+
border-collapse: collapse;
|
499 |
+
table-layout: fixed;
|
500 |
+
border: 1px solid #ddd; }
|
501 |
+
.ccf-main-modal .ccf-existing-form-pane table .left,
|
502 |
+
.ccf-main-modal .ccf-form-notifications table .left {
|
503 |
+
float: left;
|
504 |
+
width: 50%;
|
505 |
+
padding-right: 10px;
|
506 |
+
box-sizing: border-box; }
|
507 |
+
.ccf-main-modal .ccf-existing-form-pane table .left textarea,
|
508 |
+
.ccf-main-modal .ccf-form-notifications table .left textarea {
|
509 |
+
width: 100%;
|
510 |
+
height: 300px; }
|
511 |
+
.ccf-main-modal .ccf-existing-form-pane table .right,
|
512 |
+
.ccf-main-modal .ccf-form-notifications table .right {
|
513 |
+
padding-left: 10px;
|
514 |
+
box-sizing: border-box;
|
515 |
+
float: right;
|
516 |
+
width: 50%; }
|
517 |
+
.ccf-main-modal .ccf-existing-form-pane table td,
|
518 |
+
.ccf-main-modal .ccf-form-notifications table td {
|
519 |
+
margin: 0;
|
520 |
+
padding: 14px 21px;
|
521 |
+
text-align: left; }
|
522 |
+
.ccf-main-modal .ccf-existing-form-pane table .empty-form-table,
|
523 |
+
.ccf-main-modal .ccf-existing-form-pane table .no-notifications,
|
524 |
+
.ccf-main-modal .ccf-form-notifications table .empty-form-table,
|
525 |
+
.ccf-main-modal .ccf-form-notifications table .no-notifications {
|
526 |
+
text-align: center; }
|
527 |
+
.ccf-main-modal .ccf-existing-form-pane table thead, .ccf-main-modal .ccf-existing-form-pane table tfoot,
|
528 |
+
.ccf-main-modal .ccf-form-notifications table thead,
|
529 |
+
.ccf-main-modal .ccf-form-notifications table tfoot {
|
530 |
+
background-color: #f0f0f0; }
|
531 |
+
.ccf-main-modal .ccf-existing-form-pane table thead tr, .ccf-main-modal .ccf-existing-form-pane table tfoot tr,
|
532 |
+
.ccf-main-modal .ccf-form-notifications table thead tr,
|
533 |
+
.ccf-main-modal .ccf-form-notifications table tfoot tr {
|
534 |
+
border-bottom: 1px solid #e5e5e5;
|
535 |
+
border-top: 1px solid #e5e5e5; }
|
536 |
+
.ccf-main-modal .ccf-existing-form-pane table thead th, .ccf-main-modal .ccf-existing-form-pane table tfoot th,
|
537 |
+
.ccf-main-modal .ccf-form-notifications table thead th,
|
538 |
+
.ccf-main-modal .ccf-form-notifications table tfoot th {
|
539 |
+
margin: 0;
|
540 |
+
text-align: left;
|
541 |
+
padding: 14px 21px;
|
542 |
+
box-sizing: border-box; }
|
543 |
+
.ccf-main-modal .ccf-existing-form-pane table thead .id, .ccf-main-modal .ccf-existing-form-pane table tfoot .id,
|
544 |
+
.ccf-main-modal .ccf-form-notifications table thead .id,
|
545 |
+
.ccf-main-modal .ccf-form-notifications table tfoot .id {
|
546 |
+
width: 5%; }
|
547 |
+
.ccf-main-modal .ccf-existing-form-pane table thead .title, .ccf-main-modal .ccf-existing-form-pane table tfoot .title,
|
548 |
+
.ccf-main-modal .ccf-form-notifications table thead .title,
|
549 |
+
.ccf-main-modal .ccf-form-notifications table tfoot .title {
|
550 |
+
width: 30%; }
|
551 |
+
.ccf-main-modal .ccf-existing-form-pane table thead .author, .ccf-main-modal .ccf-existing-form-pane table tfoot .author,
|
552 |
+
.ccf-main-modal .ccf-form-notifications table thead .author,
|
553 |
+
.ccf-main-modal .ccf-form-notifications table tfoot .author {
|
554 |
+
width: 10%; }
|
555 |
+
.ccf-main-modal .ccf-existing-form-pane table thead .entries, .ccf-main-modal .ccf-existing-form-pane table tfoot .entries,
|
556 |
+
.ccf-main-modal .ccf-form-notifications table thead .entries,
|
557 |
+
.ccf-main-modal .ccf-form-notifications table tfoot .entries {
|
558 |
+
width: 10%; }
|
559 |
+
.ccf-main-modal .ccf-existing-form-pane table thead .submissions, .ccf-main-modal .ccf-existing-form-pane table tfoot .submissions,
|
560 |
+
.ccf-main-modal .ccf-form-notifications table thead .submissions,
|
561 |
+
.ccf-main-modal .ccf-form-notifications table tfoot .submissions {
|
562 |
+
width: 10%; }
|
563 |
+
.ccf-main-modal .ccf-existing-form-pane table thead .number-of-fields, .ccf-main-modal .ccf-existing-form-pane table tfoot .number-of-fields,
|
564 |
+
.ccf-main-modal .ccf-form-notifications table thead .number-of-fields,
|
565 |
+
.ccf-main-modal .ccf-form-notifications table tfoot .number-of-fields {
|
566 |
+
width: 15%; }
|
567 |
+
.ccf-main-modal .ccf-existing-form-pane table thead .date, .ccf-main-modal .ccf-existing-form-pane table tfoot .date,
|
568 |
+
.ccf-main-modal .ccf-form-notifications table thead .date,
|
569 |
+
.ccf-main-modal .ccf-form-notifications table tfoot .date {
|
570 |
+
width: 20%; }
|
571 |
+
.ccf-main-modal .ccf-existing-form-pane table tbody tr:nth-child(odd),
|
572 |
+
.ccf-main-modal .ccf-form-notifications table tbody tr:nth-child(odd) {
|
573 |
+
background-color: #fafafa;
|
574 |
+
margin: 0; }
|
575 |
+
.ccf-main-modal .ccf-existing-form-pane table tbody tr,
|
576 |
+
.ccf-main-modal .ccf-form-notifications table tbody tr {
|
577 |
+
background-color: #fff; }
|
578 |
+
.ccf-main-modal .ccf-existing-form-pane table tbody td,
|
579 |
+
.ccf-main-modal .ccf-form-notifications table tbody td {
|
580 |
+
vertical-align: top; }
|
581 |
+
.ccf-main-modal .ccf-existing-form-pane table tbody td a,
|
582 |
+
.ccf-main-modal .ccf-form-notifications table tbody td a {
|
583 |
+
text-decoration: none;
|
584 |
+
cursor: pointer; }
|
585 |
+
.ccf-main-modal .ccf-existing-form-pane table tbody td .title,
|
586 |
+
.ccf-main-modal .ccf-form-notifications table tbody td .title {
|
587 |
+
font-weight: bold;
|
588 |
+
font-size: 14px; }
|
589 |
+
.ccf-main-modal .ccf-existing-form-pane table tbody td .actions,
|
590 |
+
.ccf-main-modal .ccf-form-notifications table tbody td .actions {
|
591 |
+
visibility: hidden;
|
592 |
+
margin-top: 6px; }
|
593 |
+
.ccf-main-modal .ccf-existing-form-pane table tbody td .actions .delete,
|
594 |
+
.ccf-main-modal .ccf-form-notifications table tbody td .actions .delete {
|
595 |
+
color: #ff0000; }
|
596 |
+
.ccf-main-modal .ccf-existing-form-pane table tbody tr:hover td .actions,
|
597 |
+
.ccf-main-modal .ccf-form-notifications table tbody tr:hover td .actions {
|
598 |
+
visibility: visible; }
|
599 |
+
|
600 |
+
.ccf-main-modal-overlay {
|
601 |
+
display: none;
|
602 |
+
position: fixed;
|
603 |
+
top: 0px;
|
604 |
+
left: 0px;
|
605 |
+
width: 100%;
|
606 |
+
height: 100%;
|
607 |
+
z-index: 159900;
|
608 |
+
opacity: 0.7;
|
609 |
+
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";
|
610 |
+
filter: alpha(opacity=70);
|
611 |
+
-moz-opacity: 0.7;
|
612 |
+
-khtml-opacity: 0.7;
|
613 |
+
background-color: #000; }
|
614 |
+
|
615 |
+
.ccf-pagination {
|
616 |
+
font-size: 12px;
|
617 |
+
margin-top: 8px;
|
618 |
+
text-align: right; }
|
619 |
+
.ccf-pagination .pages {
|
620 |
+
padding: 0 4px; }
|
621 |
+
.ccf-pagination .num-items {
|
622 |
+
font-style: italic;
|
623 |
+
padding-right: 4px; }
|
624 |
+
.ccf-pagination a {
|
625 |
+
cursor: pointer;
|
626 |
+
color: #0074a2;
|
627 |
+
background: #f0f0f0;
|
628 |
+
text-decoration: none; }
|
629 |
+
.ccf-pagination a.next, .ccf-pagination a.prev, .ccf-pagination a.first, .ccf-pagination a.last {
|
630 |
+
font-size: 16px;
|
631 |
+
line-height: 22px;
|
632 |
+
padding: 0 7px 2px 7px; }
|
633 |
+
.ccf-pagination a.next:hover, .ccf-pagination a.prev:hover, .ccf-pagination a.first:hover, .ccf-pagination a.last:hover {
|
634 |
+
color: #fff;
|
635 |
+
background-color: #2ea2cc; }
|
636 |
+
.ccf-pagination a.disabled {
|
637 |
+
color: #aaa; }
|
638 |
+
.ccf-pagination a.disabled:hover {
|
639 |
+
color: #aaa;
|
640 |
+
background: #f0f0f0; }
|
641 |
+
|
642 |
+
.ccf-error-modal {
|
643 |
+
display: none; }
|
644 |
+
.ccf-error-modal.show {
|
645 |
+
display: block; }
|
646 |
+
.ccf-error-modal .ccf-notification-dialog-background {
|
647 |
+
position: fixed;
|
648 |
+
top: 0;
|
649 |
+
left: 0;
|
650 |
+
right: 0;
|
651 |
+
bottom: 0;
|
652 |
+
background: #000;
|
653 |
+
opacity: 0.7;
|
654 |
+
filter: alpha(opacity=70);
|
655 |
+
z-index: 1000000; }
|
656 |
+
.ccf-error-modal .notification-dialog {
|
657 |
+
position: fixed;
|
658 |
+
top: 30%;
|
659 |
+
left: 50%;
|
660 |
+
width: 450px;
|
661 |
+
margin-left: -225px;
|
662 |
+
background: #fff;
|
663 |
+
-webkit-box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
|
664 |
+
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
|
665 |
+
line-height: 1.5;
|
666 |
+
z-index: 1000005; }
|
667 |
+
.ccf-error-modal .notification-dialog .close {
|
668 |
+
font-size: 25px;
|
669 |
+
position: absolute;
|
670 |
+
right: 10px;
|
671 |
+
cursor: pointer; }
|
672 |
+
.ccf-error-modal .notification-dialog .message {
|
673 |
+
margin: 25px; }
|
674 |
+
.ccf-error-modal .notification-dialog .message .title {
|
675 |
+
color: #23282d;
|
676 |
+
font-size: 1.3em;
|
677 |
+
margin: 0 0 1em 0; }
|
678 |
+
.ccf-error-modal .notification-dialog .message ul {
|
679 |
+
margin-left: 25px; }
|
680 |
+
.ccf-error-modal .notification-dialog .message ul li {
|
681 |
+
list-style-type: disc; }
|
682 |
+
|
683 |
+
/*# sourceMappingURL=form-manager.css.map */
|
assets/build/css/form-manager.css.map
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"version": 3,
|
3 |
+
"mappings": ";AAAA,UASC;EARA,WAAW,EAAE,MAAM;EACnB,GAAG,EAAC,2BAA2B;EAC/B,GAAG,EAAC,mNAGkD;EACtD,WAAW,EAAE,MAAM;EACnB,UAAU,EAAE,MAAM;AAGnB,UASC;EARA,WAAW,EAAE,cAAc;EAC3B,GA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lB,iDAAG;QACF,WAAW,EAAE,IAAI;MAGlB,oDAAM;QACL,eAAe,EAAE,IAAI",
|
4 |
+
"sources": ["../../scss/form-manager.scss"],
|
5 |
+
"names": [],
|
6 |
+
"file": "form-manager.css"
|
7 |
+
}
|
assets/build/css/form-manager.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
@charset "UTF-8";@font-face{font-family:menu;src:url(../../fonts/menu.eot);src:url(../../fonts/menu.eot?#iefix) format("embedded-opentype"),url(../../fonts/menu.woff) format("woff"),url(../../fonts/menu.ttf) format("truetype"),url(../../fonts/menu.svg#form-manager) format("svg");font-weight:400;font-style:normal}@font-face{font-family:form-manager;src:url(../../fonts/form-manager.eot);src:url(../../fonts/form-manager.eot?#iefix) format("embedded-opentype"),url(../../fonts/form-manager.woff) format("woff"),url(../../fonts/form-manager.ttf) format("truetype"),url(../../fonts/form-manager.svg#form-manager) format("svg");font-weight:400;font-style:normal}.ccf-open-form-manager:before{font-family:menu;content:"";padding-right:4px;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;cursor:pointer;-webkit-font-smoothing:antialiased}.ccf-main-modal{display:none;position:fixed;top:30px;left:30px;right:30px;bottom:30px;z-index:160000;overflow:hidden;background-color:#fff}.ccf-main-modal [data-icon]:before{font-family:form-manager;content:attr(data-icon);speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;cursor:pointer;-webkit-font-smoothing:antialiased}.ccf-main-modal .single .insert-form-button{display:none}.ccf-main-modal .hidden{display:block}.ccf-main-modal .field{margin-bottom:5px;overflow:auto;position:relative}.ccf-main-modal .field.field-incomplete h4{background-color:#ffebe8}.ccf-main-modal .field.field-duplicate-slug h4{background-color:#ffe6a5}.ccf-main-modal .field.ccf-editing{border:#999 1px solid}.ccf-main-modal .field.ccf-editing h4:hover{border:1px solid #e5e5e5}.ccf-main-modal .field h4{-webkit-box-shadow:0 1px 1px rgba(0,0,0,.04);box-shadow:0 1px 1px rgba(0,0,0,.04);border:1px solid #e5e5e5;background:#fafafa;font-size:13px;margin:0;font-weight:600;color:#222;padding:13px 13px 13px 20px;cursor:move}.ccf-main-modal .field h4:hover{border:#999 1px solid}.ccf-main-modal .field .right{float:right;display:block}.ccf-main-modal .field .right a{color:inherit;margin-left:3px}.ccf-main-modal .field .preview{clear:both;display:none;text-align:left;overflow:auto;float:none;background-color:#fff;border-left:1px solid #e5e5e5;border-right:1px solid #e5e5e5;border-bottom:1px solid #e5e5e5;padding:10px 20px}.ccf-main-modal .field .preview .recaptcha-preview-img{margin-top:7px}.ccf-main-modal .field .preview .field-description{margin-top:3px;clear:left}.ccf-main-modal .field .preview .left{float:left;clear:both;width:47%}.ccf-main-modal .field .preview .right{float:right;width:47%}.ccf-main-modal .field .preview .full input[type=text],.ccf-main-modal .field .preview .full select,.ccf-main-modal .field .preview .left input[type=text],.ccf-main-modal .field .preview .left select,.ccf-main-modal .field .preview .right input[type=text],.ccf-main-modal .field .preview .right select{width:100%;max-width:100%}.ccf-main-modal .field .preview .full .sub-label,.ccf-main-modal .field .preview .left .sub-label,.ccf-main-modal .field .preview .right .sub-label{margin:3px 0 3px 2px;font-size:90%}.ccf-main-modal .field .preview .full .hour,.ccf-main-modal .field .preview .full .minute,.ccf-main-modal .field .preview .left .hour,.ccf-main-modal .field .preview .left .minute,.ccf-main-modal .field .preview .right .hour,.ccf-main-modal .field .preview .right .minute{display:inline-block;margin-right:5px}.ccf-main-modal .field .preview .full .hour input,.ccf-main-modal .field .preview .full .minute input,.ccf-main-modal .field .preview .left .hour input,.ccf-main-modal .field .preview .left .minute input,.ccf-main-modal .field .preview .right .hour input,.ccf-main-modal .field .preview .right .minute input{width:35px}.ccf-main-modal .field .preview .full .am-pm,.ccf-main-modal .field .preview .left .am-pm,.ccf-main-modal .field .preview .right .am-pm{display:inline-block;vertical-align:top}.ccf-main-modal .field .preview .full .am-pm select,.ccf-main-modal .field .preview .left .am-pm select,.ccf-main-modal .field .preview .right .am-pm select{width:60px}.ccf-main-modal .field .preview .heading{font-size:125%;font-weight:700;border-bottom:1px solid #ccc;padding-bottom:9px;margin-bottom:9px}.ccf-main-modal .field .preview .subheading{font-style:italic}.ccf-main-modal .field .preview .conditionals-enabled{font-size:70%;background-color:#ffe6a5;font-weight:700;padding:0 2px;opacity:.5;left:7px;position:absolute;top:1.49em}.ccf-main-modal .field .preview label{font-weight:700;margin-bottom:3px;cursor:inherit}.ccf-main-modal .field .preview label span.required{color:red}.ccf-main-modal .field .preview input[type=checkbox]+label,.ccf-main-modal .field .preview input[type=radio]+label{display:inline-block}.ccf-main-modal .field .preview input[type=text],.ccf-main-modal .field .preview textarea{width:100%;background-color:#fff;color:#333;border:1px solid #ddd;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.07);box-shadow:inset 0 1px 2px rgba(0,0,0,.07)}.ccf-main-modal .field .preview textarea{height:60px}.ccf-main-modal .close-icon{position:absolute;top:16px;right:16px;font-size:35px;cursor:pointer;color:#333;z-index:160001}.ccf-main-modal .main-menu{position:absolute;top:0;right:0;left:0;height:125px}.ccf-main-modal .main-menu h1{padding:16px}.ccf-main-modal .main-menu ul{height:40px;box-sizing:border-box;font-size:14px;margin:0;list-style-type:none;border-top:1px solid #ddd;background:#f3f3f3;padding:0 16px}.ccf-main-modal .main-menu ul li{margin:0;display:inline-block;height:38px;vertical-align:middle;line-height:40px;padding:0 8px}.ccf-main-modal .main-menu ul li a{text-decoration:none}.ccf-main-modal .main-menu ul li a :hover,.ccf-main-modal .main-menu ul li a.selected{color:#000}.ccf-main-modal .ccf-form-pane{display:none;position:absolute;top:125px;right:0;left:0;bottom:0}.ccf-main-modal .ccf-form-pane.single{top:85px;border-top:1px solid #e5e5e5}.ccf-main-modal .ccf-form-pane.single .form-content,.ccf-main-modal .ccf-form-pane.single .left-sidebar{border-top:0}.ccf-main-modal .ccf-form-pane .disabled-overlay{position:absolute;top:0;left:0;right:0;bottom:50px;background-color:#000;opacity:.1;-ms-filter:"alpha(Opacity=1)";filter:alpha(opacity=1);-moz-opacity:.1;-khtml-opacity:.1;z-index:3;display:none}.ccf-main-modal .ccf-form-pane .bottom{bottom:0;left:0;right:0;height:50px;padding:0 16px 0 0;position:absolute;text-align:right;line-height:50px;border-top:1px solid #e5e5e5}.ccf-main-modal .ccf-form-pane .bottom .left{float:left;background-color:#00a0d2;padding-left:16px;padding-right:16px;color:#fff}@media (max-width:830px){.ccf-main-modal .ccf-form-pane .bottom .left{display:none}}.ccf-main-modal .ccf-form-pane .bottom .left input{vertical-align:middle;margin-left:5px}.ccf-main-modal .ccf-form-pane .bottom .left button{vertical-align:middle}.ccf-main-modal .ccf-form-pane .bottom .left .signup-x{color:red;display:none;font-size:150%;vertical-align:middle;font-weight:700;margin-left:4px}.ccf-main-modal .ccf-form-pane .bottom .left .signup-check{color:green;display:none;vertical-align:middle;font-size:150%;font-weight:700;margin-left:4px}.ccf-main-modal .ccf-form-pane .bottom .left.signup-error .signup-x,.ccf-main-modal .ccf-form-pane .bottom .left.signup-success .signup-check{display:inline}.ccf-main-modal .ccf-form-pane .bottom .spinner{display:none;visibility:visible;float:right;width:16px;height:16px;margin-top:16px}.ccf-main-modal .ccf-form-pane .bottom input[type=button]{margin-top:11px;float:right;margin-left:6px}.ccf-main-modal .ccf-form-pane .accordion-section{background-color:#fff;border-bottom:0}.ccf-main-modal .ccf-form-pane .accordion-section:first-child{border-top:1px solid #e5e5e5}.ccf-main-modal .ccf-form-pane .accordion-section.expanded .section-content{display:block}.ccf-main-modal .ccf-form-pane .accordion-section.expanded .accordion-heading:before{content:""}.ccf-main-modal .ccf-form-pane .accordion-section.expanded .form-settings-heading:before{content:""}.ccf-main-modal .ccf-form-pane .accordion-section .accordion-heading,.ccf-main-modal .ccf-form-pane .accordion-section .form-settings-heading{cursor:pointer;display:block;line-height:29px;color:inherit;padding:10px 20px;border-bottom:1px solid #e5e5e5;font-size:150%;background-color:#fafafa;margin:0}.ccf-main-modal .ccf-form-pane .accordion-section .accordion-heading:before,.ccf-main-modal .ccf-form-pane .accordion-section .form-settings-heading:before{margin-right:8px;font-family:form-manager;content:"";speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;cursor:pointer;-webkit-font-smoothing:antialiased}.ccf-main-modal .ccf-form-pane .accordion-section .section-content{display:none;padding:10px 20px;border-bottom:1px solid #e5e5e5}.ccf-main-modal .ccf-form-pane label{display:block;margin-bottom:8px}.ccf-main-modal .ccf-form-pane .explain{margin-top:5px;font-style:italic;display:block}.ccf-main-modal .ccf-form-pane.show-form-settings .ccf-form-settings{display:block}.ccf-main-modal .ccf-form-pane .ccf-form-settings{display:none;position:absolute;width:75%;bottom:50px;left:25%;z-index:2;top:0;overflow:auto;background-color:#fff;border-top:1px solid #ddd;padding:21px;box-sizing:border-box}.ccf-main-modal .ccf-form-pane .ccf-form-settings h3:first-child,.ccf-main-modal .ccf-form-pane .ccf-form-settings p:first-child{margin-top:0}.ccf-main-modal .ccf-form-pane .ccf-form-settings h3{border-bottom:1px solid #ccc;padding-bottom:.75em;margin-top:2em}.ccf-main-modal .ccf-form-pane .ccf-form-settings .ccf-form-notifications td{position:relative}.ccf-main-modal .ccf-form-pane .ccf-form-settings .variables{margin-top:0}.ccf-main-modal .ccf-form-pane .ccf-form-settings .ccf-form-notifications .active{width:15%}.ccf-main-modal .ccf-form-pane .ccf-form-settings .ccf-form-notifications .active-indicator{color:#33CA33;font-size:40px}.ccf-main-modal .ccf-form-pane .ccf-form-settings .ccf-form-notifications .inactive-indicator{color:red;font-size:40px}.ccf-main-modal .ccf-form-pane .ccf-form-settings .ccf-form-notifications .add-notification{margin-top:1em;cursor:pointer}.ccf-main-modal .ccf-form-pane .ccf-form-settings .close-notification{position:absolute;top:10px;right:10px;cursor:pointer;font-size:200%;color:inherit}.ccf-main-modal .ccf-form-pane .ccf-form-settings .delete-notification{color:red}.ccf-main-modal .ccf-form-pane .ccf-form-settings .address .add,.ccf-main-modal .ccf-form-pane .ccf-form-settings .address .delete,.ccf-main-modal .ccf-form-pane .ccf-form-settings .field-mapping .add,.ccf-main-modal .ccf-form-pane .ccf-form-settings .field-mapping .delete{color:inherit;vertical-align:middle}.ccf-main-modal .ccf-form-pane .ccf-form-settings .post-creation-mapping-wrapper{margin-top:1em}.ccf-main-modal .ccf-form-pane .left-sidebar{box-sizing:border-box;background-color:#f3f3f3;position:absolute;border-top:1px solid #ddd;border-right:1px solid #ddd;width:25%;top:0;padding:0;bottom:50px;left:0;overflow:auto}.ccf-main-modal .ccf-form-pane .left-sidebar .accordion-section:first-child{border-top:0}.ccf-main-modal .ccf-form-pane .left-sidebar .fields,.ccf-main-modal .ccf-form-pane .left-sidebar .special-fields,.ccf-main-modal .ccf-form-pane .left-sidebar .structure-fields{padding:5px}.ccf-main-modal .ccf-form-pane .left-sidebar .fields .field .preview,.ccf-main-modal .ccf-form-pane .left-sidebar .fields .field .right,.ccf-main-modal .ccf-form-pane .left-sidebar .special-fields .field .preview,.ccf-main-modal .ccf-form-pane .left-sidebar .special-fields .field .right,.ccf-main-modal .ccf-form-pane .left-sidebar .structure-fields .field .preview,.ccf-main-modal .ccf-form-pane .left-sidebar .structure-fields .field .right{display:none}.ccf-main-modal .ccf-form-pane .form-content{box-sizing:border-box;position:absolute;width:40%;bottom:50px;left:25%;right:35%;top:0;overflow:auto;border-top:1px solid #ddd;padding:21px}.ccf-main-modal .ccf-form-pane .form-content .field-placeholder{border:1px dashed #e5e5e5;height:46px;margin-bottom:5px}.ccf-main-modal .ccf-form-pane .form-content .no-fields{font-size:22px;padding:16px;font-style:italic}.ccf-main-modal .ccf-form-pane .form-content:after{width:100%;display:block;margin-top:5px;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;font-style:italic;font-size:22px;text-align:center;padding:1em .5em;border:4px dashed #e5e5e5;content:attr(data-drag-message)}.ccf-main-modal .ccf-form-pane .right-sidebar{box-sizing:border-box;padding:0;position:absolute;width:35%;top:0;overflow:auto;background-color:#f3f3f3;right:0;bottom:50px;border-left:1px solid #ddd}.ccf-main-modal .ccf-form-pane .right-sidebar .section-content>div{margin-bottom:6px}.ccf-main-modal .ccf-form-pane .right-sidebar .no-field{padding:16px;font-style:italic;font-size:22px}.ccf-main-modal .ccf-form-pane .right-sidebar label{display:inline-block;margin:0}.ccf-main-modal .ccf-form-pane .right-sidebar label .required{color:red}.ccf-main-modal .ccf-form-pane .right-sidebar .field-error input{border-color:red;border-width:2px}.ccf-main-modal .ccf-form-pane .right-sidebar .field-duplicate-slug input{border-color:#ffe6a5;border-width:2px}.ccf-main-modal .ccf-form-pane .right-sidebar input[type=text]{width:100%;display:block;margin-top:5px}.ccf-main-modal .ccf-form-pane .right-sidebar .hide{display:none}.ccf-main-modal .ccf-form-pane .right-sidebar .conditionals input[type=text]{width:100px;display:inline-block}.ccf-main-modal .ccf-form-pane .right-sidebar input[type=checkbox]+label{display:inline-block;vertical-align:middle}.ccf-main-modal .ccf-form-pane .right-sidebar label+select{display:inline-block}.ccf-main-modal .ccf-form-pane .right-sidebar textarea{width:100%;height:80px;margin-top:5px}.ccf-main-modal .ccf-form-pane .right-sidebar .field-html{height:150px;width:100%}.ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices .choice input[type=text]{width:100px;display:inline-block}.ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices .choice .move{color:inherit;cursor:move}.ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices .choice .move:before{cursor:move}.ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices .choice .add,.ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices .choice .delete{cursor:pointer;color:inherit}.ccf-main-modal .ccf-existing-form-pane{display:none;position:absolute;overflow:scroll;top:125px;right:0;left:0;bottom:0;background-color:#fff;padding:16px}.ccf-main-modal .ccf-existing-form-pane table,.ccf-main-modal .ccf-form-notifications table{width:100%;border-collapse:collapse;table-layout:fixed;border:1px solid #ddd}.ccf-main-modal .ccf-existing-form-pane table .left,.ccf-main-modal .ccf-form-notifications table .left{float:left;width:50%;padding-right:10px;box-sizing:border-box}.ccf-main-modal .ccf-existing-form-pane table .left textarea,.ccf-main-modal .ccf-form-notifications table .left textarea{width:100%;height:300px}.ccf-main-modal .ccf-existing-form-pane table .right,.ccf-main-modal .ccf-form-notifications table .right{padding-left:10px;box-sizing:border-box;float:right;width:50%}.ccf-main-modal .ccf-existing-form-pane table td,.ccf-main-modal .ccf-form-notifications table td{margin:0;padding:14px 21px;text-align:left}.ccf-main-modal .ccf-existing-form-pane table .empty-form-table,.ccf-main-modal .ccf-existing-form-pane table .no-notifications,.ccf-main-modal .ccf-form-notifications table .empty-form-table,.ccf-main-modal .ccf-form-notifications table .no-notifications{text-align:center}.ccf-main-modal .ccf-existing-form-pane table tfoot,.ccf-main-modal .ccf-existing-form-pane table thead,.ccf-main-modal .ccf-form-notifications table tfoot,.ccf-main-modal .ccf-form-notifications table thead{background-color:#f0f0f0}.ccf-main-modal .ccf-existing-form-pane table tfoot tr,.ccf-main-modal .ccf-existing-form-pane table thead tr,.ccf-main-modal .ccf-form-notifications table tfoot tr,.ccf-main-modal .ccf-form-notifications table thead tr{border-bottom:1px solid #e5e5e5;border-top:1px solid #e5e5e5}.ccf-main-modal .ccf-existing-form-pane table tfoot th,.ccf-main-modal .ccf-existing-form-pane table thead th,.ccf-main-modal .ccf-form-notifications table tfoot th,.ccf-main-modal .ccf-form-notifications table thead th{margin:0;text-align:left;padding:14px 21px;box-sizing:border-box}.ccf-main-modal .ccf-existing-form-pane table tfoot .id,.ccf-main-modal .ccf-existing-form-pane table thead .id,.ccf-main-modal .ccf-form-notifications table tfoot .id,.ccf-main-modal .ccf-form-notifications table thead .id{width:5%}.ccf-main-modal .ccf-existing-form-pane table tfoot .title,.ccf-main-modal .ccf-existing-form-pane table thead .title,.ccf-main-modal .ccf-form-notifications table tfoot .title,.ccf-main-modal .ccf-form-notifications table thead .title{width:30%}.ccf-main-modal .ccf-existing-form-pane table tfoot .author,.ccf-main-modal .ccf-existing-form-pane table tfoot .entries,.ccf-main-modal .ccf-existing-form-pane table tfoot .submissions,.ccf-main-modal .ccf-existing-form-pane table thead .author,.ccf-main-modal .ccf-existing-form-pane table thead .entries,.ccf-main-modal .ccf-existing-form-pane table thead .submissions,.ccf-main-modal .ccf-form-notifications table tfoot .author,.ccf-main-modal .ccf-form-notifications table tfoot .entries,.ccf-main-modal .ccf-form-notifications table tfoot .submissions,.ccf-main-modal .ccf-form-notifications table thead .author,.ccf-main-modal .ccf-form-notifications table thead .entries,.ccf-main-modal .ccf-form-notifications table thead .submissions{width:10%}.ccf-main-modal .ccf-existing-form-pane table tfoot .number-of-fields,.ccf-main-modal .ccf-existing-form-pane table thead .number-of-fields,.ccf-main-modal .ccf-form-notifications table tfoot .number-of-fields,.ccf-main-modal .ccf-form-notifications table thead .number-of-fields{width:15%}.ccf-main-modal .ccf-existing-form-pane table tfoot .date,.ccf-main-modal .ccf-existing-form-pane table thead .date,.ccf-main-modal .ccf-form-notifications table tfoot .date,.ccf-main-modal .ccf-form-notifications table thead .date{width:20%}.ccf-main-modal .ccf-existing-form-pane table tbody tr:nth-child(odd),.ccf-main-modal .ccf-form-notifications table tbody tr:nth-child(odd){background-color:#fafafa;margin:0}.ccf-main-modal .ccf-existing-form-pane table tbody tr,.ccf-main-modal .ccf-form-notifications table tbody tr{background-color:#fff}.ccf-main-modal .ccf-existing-form-pane table tbody td,.ccf-main-modal .ccf-form-notifications table tbody td{vertical-align:top}.ccf-main-modal .ccf-existing-form-pane table tbody td a,.ccf-main-modal .ccf-form-notifications table tbody td a{text-decoration:none;cursor:pointer}.ccf-main-modal .ccf-existing-form-pane table tbody td .title,.ccf-main-modal .ccf-form-notifications table tbody td .title{font-weight:700;font-size:14px}.ccf-main-modal .ccf-existing-form-pane table tbody td .actions,.ccf-main-modal .ccf-form-notifications table tbody td .actions{visibility:hidden;margin-top:6px}.ccf-main-modal .ccf-existing-form-pane table tbody td .actions .delete,.ccf-main-modal .ccf-form-notifications table tbody td .actions .delete{color:red}.ccf-main-modal .ccf-existing-form-pane table tbody tr:hover td .actions,.ccf-main-modal .ccf-form-notifications table tbody tr:hover td .actions{visibility:visible}.ccf-main-modal-overlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;z-index:159900;opacity:.7;-ms-filter:"alpha(Opacity=70)";filter:alpha(opacity=70);-moz-opacity:.7;-khtml-opacity:.7;background-color:#000}.ccf-pagination{font-size:12px;margin-top:8px;text-align:right}.ccf-pagination .pages{padding:0 4px}.ccf-pagination .num-items{font-style:italic;padding-right:4px}.ccf-pagination a{cursor:pointer;color:#0074a2;background:#f0f0f0;text-decoration:none}.ccf-pagination a.first,.ccf-pagination a.last,.ccf-pagination a.next,.ccf-pagination a.prev{font-size:16px;line-height:22px;padding:0 7px 2px}.ccf-pagination a.first:hover,.ccf-pagination a.last:hover,.ccf-pagination a.next:hover,.ccf-pagination a.prev:hover{color:#fff;background-color:#2ea2cc}.ccf-pagination a.disabled{color:#aaa}.ccf-pagination a.disabled:hover{color:#aaa;background:#f0f0f0}.ccf-error-modal{display:none}.ccf-error-modal.show{display:block}.ccf-error-modal .ccf-notification-dialog-background{position:fixed;top:0;left:0;right:0;bottom:0;background:#000;opacity:.7;filter:alpha(opacity=70);z-index:1000000}.ccf-error-modal .notification-dialog{position:fixed;top:30%;left:50%;width:450px;margin-left:-225px;background:#fff;-webkit-box-shadow:0 3px 6px rgba(0,0,0,.3);box-shadow:0 3px 6px rgba(0,0,0,.3);line-height:1.5;z-index:1000005}.ccf-error-modal .notification-dialog .close{font-size:25px;position:absolute;right:10px;cursor:pointer}.ccf-error-modal .notification-dialog .message{margin:25px}.ccf-error-modal .notification-dialog .message .title{color:#23282d;font-size:1.3em;margin:0 0 1em}.ccf-error-modal .notification-dialog .message ul{margin-left:25px}.ccf-error-modal .notification-dialog .message ul li{list-style-type:disc}
|
assets/build/css/form-mce.css
ADDED
@@ -0,0 +1,130 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.ccf-form-preview {
|
2 |
+
border: 1px solid #e5e5e5;
|
3 |
+
background-color: #fcfcfc;
|
4 |
+
padding: 3.5% 7.5%;
|
5 |
+
font-size: 14px;
|
6 |
+
font-family: "Open Sans",sans-serif; }
|
7 |
+
.ccf-form-preview.preview-error {
|
8 |
+
text-align: center; }
|
9 |
+
.ccf-form-preview h2 {
|
10 |
+
margin: 0 0 10px 0;
|
11 |
+
padding: 0; }
|
12 |
+
.ccf-form-preview .field-submit {
|
13 |
+
margin-top: 15px; }
|
14 |
+
.ccf-form-preview .field-submit input {
|
15 |
+
color: #555;
|
16 |
+
border-color: #ccc;
|
17 |
+
background: #f7f7f7;
|
18 |
+
-webkit-box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba(0, 0, 0, 0.08);
|
19 |
+
box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba(0, 0, 0, 0.08);
|
20 |
+
vertical-align: top;
|
21 |
+
display: inline-block;
|
22 |
+
text-decoration: none;
|
23 |
+
font-size: 13px;
|
24 |
+
line-height: 26px;
|
25 |
+
height: 28px;
|
26 |
+
margin: 0;
|
27 |
+
padding: 0 10px 1px;
|
28 |
+
cursor: pointer;
|
29 |
+
border-width: 1px;
|
30 |
+
border-style: solid;
|
31 |
+
-webkit-appearance: none;
|
32 |
+
-webkit-border-radius: 3px;
|
33 |
+
border-radius: 3px;
|
34 |
+
white-space: nowrap;
|
35 |
+
-webkit-box-sizing: border-box;
|
36 |
+
-moz-box-sizing: border-box;
|
37 |
+
box-sizing: border-box; }
|
38 |
+
.ccf-form-preview .field {
|
39 |
+
clear: both;
|
40 |
+
text-align: left;
|
41 |
+
float: none;
|
42 |
+
padding: 15px 0; }
|
43 |
+
.ccf-form-preview .field:after {
|
44 |
+
content: ' ';
|
45 |
+
clear: both;
|
46 |
+
height: 0;
|
47 |
+
display: block; }
|
48 |
+
.ccf-form-preview .field label {
|
49 |
+
display: block; }
|
50 |
+
.ccf-form-preview .field .left {
|
51 |
+
float: left;
|
52 |
+
clear: both;
|
53 |
+
width: 47%; }
|
54 |
+
.ccf-form-preview .field .right {
|
55 |
+
float: right;
|
56 |
+
width: 47%; }
|
57 |
+
.ccf-form-preview .field .field-description {
|
58 |
+
margin-top: 7px;
|
59 |
+
clear: left; }
|
60 |
+
.ccf-form-preview .field .left input[type="text"], .ccf-form-preview .field .left select, .ccf-form-preview .field .right input[type="text"], .ccf-form-preview .field .right select, .ccf-form-preview .field .full input[type="text"], .ccf-form-preview .field .full select {
|
61 |
+
width: 100%;
|
62 |
+
max-width: 100%; }
|
63 |
+
.ccf-form-preview .field .left .sub-label, .ccf-form-preview .field .right .sub-label, .ccf-form-preview .field .full .sub-label {
|
64 |
+
margin: 3px 0 3px 2px;
|
65 |
+
font-size: 90%; }
|
66 |
+
.ccf-form-preview .field .heading {
|
67 |
+
font-size: 125%;
|
68 |
+
font-weight: bold;
|
69 |
+
border-bottom: 1px solid #ccc;
|
70 |
+
padding-bottom: 9px;
|
71 |
+
margin-bottom: 9px; }
|
72 |
+
.ccf-form-preview .field .subheading {
|
73 |
+
font-style: italic; }
|
74 |
+
.ccf-form-preview .field label {
|
75 |
+
font-weight: bold;
|
76 |
+
margin-bottom: 7px;
|
77 |
+
cursor: inherit; }
|
78 |
+
.ccf-form-preview .field label span.required {
|
79 |
+
color: red; }
|
80 |
+
.ccf-form-preview .field .conditionals-enabled {
|
81 |
+
display: none; }
|
82 |
+
.ccf-form-preview .field .choice {
|
83 |
+
padding-left: 15px; }
|
84 |
+
.ccf-form-preview .field .choice label {
|
85 |
+
font-weight: normal; }
|
86 |
+
.ccf-form-preview .field input[type="checkbox"] + label {
|
87 |
+
display: inline-block; }
|
88 |
+
.ccf-form-preview .field input[type="radio"] + label {
|
89 |
+
display: inline-block; }
|
90 |
+
.ccf-form-preview .field input[type="text"], .ccf-form-preview .field textarea {
|
91 |
+
border: 1px solid #ddd;
|
92 |
+
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07);
|
93 |
+
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07);
|
94 |
+
background-color: #fff;
|
95 |
+
color: #333;
|
96 |
+
height: 28px;
|
97 |
+
box-sizing: border-box;
|
98 |
+
width: 100%;
|
99 |
+
display: block; }
|
100 |
+
.ccf-form-preview .field input[type="text"], .ccf-form-preview .field textarea, .ccf-form-preview .field select {
|
101 |
+
padding: 3px 6px;
|
102 |
+
font-size: 14px; }
|
103 |
+
.ccf-form-preview .field textarea {
|
104 |
+
height: 80px; }
|
105 |
+
.ccf-form-preview .field select {
|
106 |
+
border: 1px solid #ddd;
|
107 |
+
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07);
|
108 |
+
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07);
|
109 |
+
background-color: #fff;
|
110 |
+
color: #333;
|
111 |
+
outline: 0;
|
112 |
+
padding: 2px;
|
113 |
+
line-height: 28px;
|
114 |
+
height: 28px;
|
115 |
+
vertical-align: middle;
|
116 |
+
font-size: 14px; }
|
117 |
+
.ccf-form-preview .field.date .hour, .ccf-form-preview .field.date .minute {
|
118 |
+
display: inline-block;
|
119 |
+
margin-right: 5px; }
|
120 |
+
.ccf-form-preview .field.date .hour input, .ccf-form-preview .field.date .minute input {
|
121 |
+
width: 35px; }
|
122 |
+
.ccf-form-preview .field.date .hour label, .ccf-form-preview .field.date .minute label {
|
123 |
+
font-weight: normal; }
|
124 |
+
.ccf-form-preview .field.date .am-pm {
|
125 |
+
display: inline-block;
|
126 |
+
vertical-align: top; }
|
127 |
+
.ccf-form-preview .field.date .am-pm select {
|
128 |
+
width: 60px; }
|
129 |
+
|
130 |
+
/*# sourceMappingURL=form-mce.css.map */
|
assets/build/css/form-mce.css.map
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"version": 3,
|
3 |
+
"mappings": "AAAA,iBAAkB;EACjB,MAAM,EAAE,iBAAiB;EACzB,gBAAgB,EAAE,OAAO;EACzB,OAAO,EAAE,SAAS;EAClB,SAAS,EAAE,IAAI;EACf,WAAW,EAAE,sBAAsB;EAEnC,+BAAgB;IACf,UAAU,EAAE,MAAM;EAGnB,oBAAG;IACF,MAAM,EAAE,UAAU;IAClB,OAAO,EAAE,CAAC;EAGX,+BAAc;IACb,UAAU,EAAE,IAAI;IAEhB,qCAAM;MACL,KAAK,EAAE,IAAI;MACX,YAAY,EAAE,IAAI;MAClB,UAAU,EAAE,OAAO;MACnB,kBAAkB,EAAE,+CAA0C;MAC9D,UAAU,EAAE,+CAA0C;MACtD,cAAc,EAAE,GAAG;MACnB,OAAO,EAAE,YAAY;MACrB,eAAe,EAAE,IAAI;MACrB,SAAS,EAAE,IAAI;MACf,WAAW,EAAE,IAAI;MACjB,MAAM,EAAE,IAAI;MACZ,MAAM,EAAE,CAAC;MACT,OAAO,EAAE,UAAU;MACnB,MAAM,EAAE,OAAO;MACf,YAAY,EAAE,GAAG;MACjB,YAAY,EAAE,KAAK;MACnB,kBAAkB,EAAE,IAAI;MACxB,qBAAqB,EAAE,GAAG;MAC1B,aAAa,EAAE,GAAG;MACl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MACnD,UAAU,EAAE,mCAA+B;MAC3C,gBAAgB,EAAE,IAAI;MACtB,KAAK,EAAE,IAAI;MACX,MAAM,EAAE,IAAI;MACZ,UAAU,EAAE,UAAU;MACtB,KAAK,EAAE,IAAI;MACX,OAAO,EAAE,KAAK;IAGf,+GAAqC;MACpC,OAAO,EAAE,OAAO;MAChB,SAAS,EAAE,IAAI;IAGhB,iCAAS;MACR,MAAM,EAAE,IAAI;IAGb,+BAAO;MACN,MAAM,EAAE,cAAc;MACtB,kBAAkB,EAAE,mCAA+B;MACnD,UAAU,EAAE,mCAA+B;MAC3C,gBAAgB,EAAE,IAAI;MACtB,KAAK,EAAE,IAAI;MACX,OAAO,EAAE,CAAC;MACV,OAAO,EAAE,GAAG;MACZ,WAAW,EAAE,IAAI;MACjB,MAAM,EAAE,IAAI;MACZ,cAAc,EAAE,MAAM;MACtB,SAAS,EAAE,IAAI;IAIf,0EAAe;MACd,OAAO,EAAE,YAAY;MACrB,YAAY,EAAE,GAAG;MAEjB,sFAAM;QACL,KAAK,EAAE,IAAI;MAGZ,sFAAM;QACL,WAAW,EAAE,MAAM;IAIrB,oCAAO;MACN,OAAO,EAAE,YAAY;MACrB,cAAc,EAAE,GAAG;MAEnB,2CAAO;QACN,KAAK,EAAE,IAAI",
|
4 |
+
"sources": ["../../scss/form-mce.scss"],
|
5 |
+
"names": [],
|
6 |
+
"file": "form-mce.css"
|
7 |
+
}
|
assets/build/css/form-mce.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.ccf-form-preview{border:1px solid #e5e5e5;background-color:#fcfcfc;padding:3.5% 7.5%;font-size:14px;font-family:"Open Sans",sans-serif}.ccf-form-preview.preview-error{text-align:center}.ccf-form-preview h2{margin:0 0 10px;padding:0}.ccf-form-preview .field-submit{margin-top:15px}.ccf-form-preview .field-submit input{color:#555;border-color:#ccc;background:#f7f7f7;-webkit-box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);vertical-align:top;display:inline-block;text-decoration:none;font-size:13px;line-height:26px;height:28px;margin:0;padding:0 10px 1px;cursor:pointer;border-width:1px;border-style:solid;-webkit-appearance:none;-webkit-border-radius:3px;border-radius:3px;white-space:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.ccf-form-preview .field{clear:both;text-align:left;float:none;padding:15px 0}.ccf-form-preview .field:after{content:' ';clear:both;height:0;display:block}.ccf-form-preview .field label{display:block}.ccf-form-preview .field .left{float:left;clear:both;width:47%}.ccf-form-preview .field .right{float:right;width:47%}.ccf-form-preview .field .field-description{margin-top:7px;clear:left}.ccf-form-preview .field .full input[type=text],.ccf-form-preview .field .full select,.ccf-form-preview .field .left input[type=text],.ccf-form-preview .field .left select,.ccf-form-preview .field .right input[type=text],.ccf-form-preview .field .right select{width:100%;max-width:100%}.ccf-form-preview .field .full .sub-label,.ccf-form-preview .field .left .sub-label,.ccf-form-preview .field .right .sub-label{margin:3px 0 3px 2px;font-size:90%}.ccf-form-preview .field .heading{font-size:125%;font-weight:700;border-bottom:1px solid #ccc;padding-bottom:9px;margin-bottom:9px}.ccf-form-preview .field .subheading{font-style:italic}.ccf-form-preview .field label{font-weight:700;margin-bottom:7px;cursor:inherit}.ccf-form-preview .field label span.required{color:red}.ccf-form-preview .field .conditionals-enabled{display:none}.ccf-form-preview .field .choice{padding-left:15px}.ccf-form-preview .field .choice label{font-weight:400}.ccf-form-preview .field input[type=checkbox]+label,.ccf-form-preview .field input[type=radio]+label{display:inline-block}.ccf-form-preview .field input[type=text],.ccf-form-preview .field textarea{border:1px solid #ddd;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.07);box-shadow:inset 0 1px 2px rgba(0,0,0,.07);background-color:#fff;color:#333;height:28px;box-sizing:border-box;width:100%;display:block}.ccf-form-preview .field input[type=text],.ccf-form-preview .field select,.ccf-form-preview .field textarea{padding:3px 6px;font-size:14px}.ccf-form-preview .field textarea{height:80px}.ccf-form-preview .field select{border:1px solid #ddd;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.07);box-shadow:inset 0 1px 2px rgba(0,0,0,.07);background-color:#fff;color:#333;outline:0;padding:2px;line-height:28px;height:28px;vertical-align:middle;font-size:14px}.ccf-form-preview .field.date .hour,.ccf-form-preview .field.date .minute{display:inline-block;margin-right:5px}.ccf-form-preview .field.date .hour input,.ccf-form-preview .field.date .minute input{width:35px}.ccf-form-preview .field.date .hour label,.ccf-form-preview .field.date .minute label{font-weight:400}.ccf-form-preview .field.date .am-pm{display:inline-block;vertical-align:top}.ccf-form-preview .field.date .am-pm select{width:60px}
|
assets/build/css/form-table.css
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
.view-switch {
|
2 |
+
display: none; }
|
3 |
+
|
4 |
+
/*# sourceMappingURL=form-table.css.map */
|
assets/build/css/form-table.css.map
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"version": 3,
|
3 |
+
"mappings": "AAAA,YAAa;EACZ,OAAO,EAAE,IAAI",
|
4 |
+
"sources": ["../../scss/form-table.scss"],
|
5 |
+
"names": [],
|
6 |
+
"file": "form-table.css"
|
7 |
+
}
|
assets/build/css/form-table.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.view-switch{display:none}
|
assets/build/css/form.css
ADDED
@@ -0,0 +1,156 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.ccf-form-wrapper {
|
2 |
+
margin: 20px 0; }
|
3 |
+
.ccf-form-wrapper .ccf-form-frame {
|
4 |
+
display: none; }
|
5 |
+
.ccf-form-wrapper .ccf-clear {
|
6 |
+
clear: both; }
|
7 |
+
.ccf-form-wrapper .form-title {
|
8 |
+
font-size: 150%;
|
9 |
+
padding: 20px 0; }
|
10 |
+
.ccf-form-wrapper .form-description {
|
11 |
+
padding: 0 0 20px 0; }
|
12 |
+
.ccf-form-wrapper .form-submit img {
|
13 |
+
vertical-align: middle;
|
14 |
+
display: inline-block;
|
15 |
+
border: 0;
|
16 |
+
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
|
17 |
+
filter: alpha(opacity=0);
|
18 |
+
-moz-opacity: 0;
|
19 |
+
-khtml-opacity: 0;
|
20 |
+
opacity: 0;
|
21 |
+
float: none;
|
22 |
+
margin: 0 0 0 6px; }
|
23 |
+
.ccf-form-wrapper .field-description {
|
24 |
+
font-size: 85%;
|
25 |
+
clear: left;
|
26 |
+
margin-top: 6px; }
|
27 |
+
.ccf-form-wrapper .error {
|
28 |
+
color: #ff0000;
|
29 |
+
float: right;
|
30 |
+
font-size: 85%;
|
31 |
+
margin-top: 3px; }
|
32 |
+
.ccf-form-wrapper .error.match-error, .ccf-form-wrapper .error.email-error, .ccf-form-wrapper .error.unknown-error {
|
33 |
+
float: none; }
|
34 |
+
.ccf-form-wrapper .error.right-error {
|
35 |
+
float: right; }
|
36 |
+
.ccf-form-wrapper .field-hide {
|
37 |
+
display: none; }
|
38 |
+
.ccf-form-wrapper .field {
|
39 |
+
margin-bottom: 24px;
|
40 |
+
clear: both; }
|
41 |
+
.ccf-form-wrapper .field[data-field-type="recaptcha"] .error, .ccf-form-wrapper .field[data-field-type="file"] .error, .ccf-form-wrapper .field[data-field-type="dropdown"] .error, .ccf-form-wrapper .field[data-field-type="radio"] .error, .ccf-form-wrapper .field[data-field-type="checkboxes"] .error, .ccf-form-wrapper .field[data-field-type="date"] .error {
|
42 |
+
float: none; }
|
43 |
+
.ccf-form-wrapper .field .field-error-input {
|
44 |
+
border: 1px solid #ff0000; }
|
45 |
+
.ccf-form-wrapper .field label.main-label {
|
46 |
+
display: block;
|
47 |
+
clear: both;
|
48 |
+
margin-bottom: 6px;
|
49 |
+
font-weight: bold; }
|
50 |
+
.ccf-form-wrapper .field label.main-label .required {
|
51 |
+
padding-right: .3em;
|
52 |
+
color: #ff0000; }
|
53 |
+
.ccf-form-wrapper .field input[type="text"], .ccf-form-wrapper .field textarea {
|
54 |
+
width: 100%;
|
55 |
+
box-sizing: border-box; }
|
56 |
+
.ccf-form-wrapper .field select {
|
57 |
+
display: block;
|
58 |
+
width: auto; }
|
59 |
+
.ccf-form-wrapper .field input[type=file] {
|
60 |
+
background-color: inherit;
|
61 |
+
border: 0;
|
62 |
+
line-height: 0; }
|
63 |
+
.ccf-form-wrapper .field textarea {
|
64 |
+
min-height: 100px;
|
65 |
+
color: inherit;
|
66 |
+
font-family: inherit; }
|
67 |
+
.ccf-form-wrapper .field .left {
|
68 |
+
width: 50%;
|
69 |
+
float: left;
|
70 |
+
box-sizing: border-box;
|
71 |
+
padding-right: 10px;
|
72 |
+
clear: both; }
|
73 |
+
.ccf-form-wrapper .field .right {
|
74 |
+
width: 50%;
|
75 |
+
float: right;
|
76 |
+
box-sizing: border-box;
|
77 |
+
padding-left: 10px; }
|
78 |
+
.ccf-form-wrapper .field .sub-label {
|
79 |
+
margin-top: 3px;
|
80 |
+
font-size: 85%;
|
81 |
+
clear: none;
|
82 |
+
font-weight: normal; }
|
83 |
+
.ccf-form-wrapper .field.field-type-section-header .heading {
|
84 |
+
font-size: 125%;
|
85 |
+
border-bottom: 1px solid #ccc;
|
86 |
+
padding-bottom: 5px; }
|
87 |
+
.ccf-form-wrapper .field.field-type-section-header .subheading {
|
88 |
+
margin-top: 10px;
|
89 |
+
font-size: 85%;
|
90 |
+
font-style: italic; }
|
91 |
+
.ccf-form-wrapper .field.field-type-date .hour, .ccf-form-wrapper .field.field-type-date .minute {
|
92 |
+
display: inline-block;
|
93 |
+
margin-right: 5px; }
|
94 |
+
.ccf-form-wrapper .field.field-type-date .hour input, .ccf-form-wrapper .field.field-type-date .minute input {
|
95 |
+
width: 3.5em; }
|
96 |
+
.ccf-form-wrapper .field.field-type-date .hour label, .ccf-form-wrapper .field.field-type-date .minute label {
|
97 |
+
font-weight: normal; }
|
98 |
+
.ccf-form-wrapper .field.field-type-date .am-pm {
|
99 |
+
display: inline-block;
|
100 |
+
vertical-align: top; }
|
101 |
+
.ccf-form-wrapper .field.field-type-date .am-pm select {
|
102 |
+
width: auto; }
|
103 |
+
.ccf-form-wrapper .ccf-theme-dark {
|
104 |
+
font-size: 16px; }
|
105 |
+
.ccf-form-wrapper .ccf-theme-dark input[type=text], .ccf-form-wrapper .ccf-theme-dark input[type=submit], .ccf-form-wrapper .ccf-theme-dark select, .ccf-form-wrapper .ccf-theme-dark textarea, .ccf-form-wrapper .ccf-theme-dark dropdown {
|
106 |
+
border-radius: 4px;
|
107 |
+
background-color: #555;
|
108 |
+
color: #fff;
|
109 |
+
border: 1px solid #ccc;
|
110 |
+
padding: 8px; }
|
111 |
+
.ccf-form-wrapper .ccf-theme-dark input[type=text]::-webkit-input-placeholder, .ccf-form-wrapper .ccf-theme-dark input[type=submit]::-webkit-input-placeholder, .ccf-form-wrapper .ccf-theme-dark select::-webkit-input-placeholder, .ccf-form-wrapper .ccf-theme-dark textarea::-webkit-input-placeholder, .ccf-form-wrapper .ccf-theme-dark dropdown::-webkit-input-placeholder {
|
112 |
+
color: #ccc; }
|
113 |
+
.ccf-form-wrapper .ccf-theme-dark input[type=text]:-moz-placeholder, .ccf-form-wrapper .ccf-theme-dark input[type=submit]:-moz-placeholder, .ccf-form-wrapper .ccf-theme-dark select:-moz-placeholder, .ccf-form-wrapper .ccf-theme-dark textarea:-moz-placeholder, .ccf-form-wrapper .ccf-theme-dark dropdown:-moz-placeholder {
|
114 |
+
color: #ccc; }
|
115 |
+
.ccf-form-wrapper .ccf-theme-dark input[type=text]:-moz-placeholder, .ccf-form-wrapper .ccf-theme-dark input[type=submit]:-moz-placeholder, .ccf-form-wrapper .ccf-theme-dark select:-moz-placeholder, .ccf-form-wrapper .ccf-theme-dark textarea:-moz-placeholder, .ccf-form-wrapper .ccf-theme-dark dropdown:-moz-placeholder {
|
116 |
+
color: #ccc; }
|
117 |
+
.ccf-form-wrapper .ccf-theme-dark input[type=text]:-ms-input-placeholder, .ccf-form-wrapper .ccf-theme-dark input[type=submit]:-ms-input-placeholder, .ccf-form-wrapper .ccf-theme-dark select:-ms-input-placeholder, .ccf-form-wrapper .ccf-theme-dark textarea:-ms-input-placeholder, .ccf-form-wrapper .ccf-theme-dark dropdown:-ms-input-placeholder {
|
118 |
+
color: #ccc; }
|
119 |
+
.ccf-form-wrapper .ccf-theme-dark input.ccf-submit-button {
|
120 |
+
padding: 8px 14px;
|
121 |
+
background-color: #555555;
|
122 |
+
background-image: -webkit-gradient(linear, left top, left bottom, from(#555555), to(#222));
|
123 |
+
background-image: -webkit-linear-gradient(top, #555555, #222);
|
124 |
+
background-image: -moz-linear-gradient(top, #555555, #222);
|
125 |
+
background-image: -ms-linear-gradient(top, #555555, #222);
|
126 |
+
background-image: -o-linear-gradient(top, #555555, #222);
|
127 |
+
background-image: linear-gradient(to bottom, #555555, #222);
|
128 |
+
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#555555, endColorstr=#222); }
|
129 |
+
.ccf-form-wrapper .ccf-theme-light {
|
130 |
+
font-size: 16px; }
|
131 |
+
.ccf-form-wrapper .ccf-theme-light input[type=text], .ccf-form-wrapper .ccf-theme-light input[type=submit], .ccf-form-wrapper .ccf-theme-light select, .ccf-form-wrapper .ccf-theme-light textarea, .ccf-form-wrapper .ccf-theme-light dropdown {
|
132 |
+
border-radius: 4px;
|
133 |
+
background-color: #fcfcfc;
|
134 |
+
color: #333;
|
135 |
+
border: 1px solid #e0e0e0;
|
136 |
+
padding: 8px; }
|
137 |
+
.ccf-form-wrapper .ccf-theme-light input[type=text]::-webkit-input-placeholder, .ccf-form-wrapper .ccf-theme-light input[type=submit]::-webkit-input-placeholder, .ccf-form-wrapper .ccf-theme-light select::-webkit-input-placeholder, .ccf-form-wrapper .ccf-theme-light textarea::-webkit-input-placeholder, .ccf-form-wrapper .ccf-theme-light dropdown::-webkit-input-placeholder {
|
138 |
+
color: #ccc; }
|
139 |
+
.ccf-form-wrapper .ccf-theme-light input[type=text]:-moz-placeholder, .ccf-form-wrapper .ccf-theme-light input[type=submit]:-moz-placeholder, .ccf-form-wrapper .ccf-theme-light select:-moz-placeholder, .ccf-form-wrapper .ccf-theme-light textarea:-moz-placeholder, .ccf-form-wrapper .ccf-theme-light dropdown:-moz-placeholder {
|
140 |
+
color: #ccc; }
|
141 |
+
.ccf-form-wrapper .ccf-theme-light input[type=text]:-moz-placeholder, .ccf-form-wrapper .ccf-theme-light input[type=submit]:-moz-placeholder, .ccf-form-wrapper .ccf-theme-light select:-moz-placeholder, .ccf-form-wrapper .ccf-theme-light textarea:-moz-placeholder, .ccf-form-wrapper .ccf-theme-light dropdown:-moz-placeholder {
|
142 |
+
color: #ccc; }
|
143 |
+
.ccf-form-wrapper .ccf-theme-light input[type=text]:-ms-input-placeholder, .ccf-form-wrapper .ccf-theme-light input[type=submit]:-ms-input-placeholder, .ccf-form-wrapper .ccf-theme-light select:-ms-input-placeholder, .ccf-form-wrapper .ccf-theme-light textarea:-ms-input-placeholder, .ccf-form-wrapper .ccf-theme-light dropdown:-ms-input-placeholder {
|
144 |
+
color: #ccc; }
|
145 |
+
.ccf-form-wrapper .ccf-theme-light input.ccf-submit-button {
|
146 |
+
padding: 8px 14px;
|
147 |
+
background-color: #f0f0f0;
|
148 |
+
background-image: -webkit-gradient(linear, left top, left bottom, from(#f0f0f0), to(#fcfcfc));
|
149 |
+
background-image: -webkit-linear-gradient(top, #f0f0f0, #fcfcfc);
|
150 |
+
background-image: -moz-linear-gradient(top, #f0f0f0, #fcfcfc);
|
151 |
+
background-image: -ms-linear-gradient(top, #f0f0f0, #fcfcfc);
|
152 |
+
background-image: -o-linear-gradient(top, #f0f0f0, #fcfcfc);
|
153 |
+
background-image: linear-gradient(to bottom, #f0f0f0, #fcfcfc);
|
154 |
+
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#f0f0f0, endColorstr=#fcfcfc); }
|
155 |
+
|
156 |
+
/*# sourceMappingURL=form.css.map */
|
assets/build/css/form.css.map
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"version": 3,
|
3 |
+
"mappings": "AAAA,iBAAkB;EACjB,MAAM,EAAE,MAAM;EAEd,iCAAgB;IACf,OAAO,EAAE,IAAI;EAGd,4BAAW;IACV,KAAK,EAAE,IAAI;EAGZ,6BAAY;IACX,SAAS,EAAE,IAAI;IACf,OAAO,EAAE,MAAM;EAGhB,mCAAkB;IACjB,OAAO,EAAE,UAAU;EAInB,kCAAI;IACH,cAAc,EAAE,MAAM;IACtB,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,CAAC;IACT,UAAU,EAAE,oDAAoD;IAChE,MAAM,EAAE,gBAAgB;IACxB,YAAY,EAAE,CAAC;IACf,cAAc,EAA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X,MAAM,EAAE,iBAAiB;MACzB,OAAO,EAAE,GAAG;MAEZ,sXAA6B;QAC5B,KAAK,EAAK,IAAI;MAEf,oUAAmB;QAClB,KAAK,EAAK,IAAI;MAEf,oUAAmB;QAClB,KAAK,EAAK,IAAI;MAEf,6VAAwB;QACvB,KAAK,EAAK,IAAI;IAIhB,0DAAwB;MACvB,OAAO,EAAE,QAAQ;MACjB,gBAAgB,EAAE,OAAO;MAAE,gBAAgB,EAAE,2EAA2E;MACxH,gBAAgB,EAAE,8CAA8C;MAChE,gBAAgB,EAAE,2CAA2C;MAC7D,gBAAgB,EAAE,0CAA0C;MAC5D,gBAAgB,EAAE,yCAAyC;MAC3D,gBAAgB,EAAE,4CAA4C;MAAC,MAAM,EAAC,qGAAqG",
|
4 |
+
"sources": ["../../scss/form.scss"],
|
5 |
+
"names": [],
|
6 |
+
"file": "form.css"
|
7 |
+
}
|
assets/build/css/form.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.ccf-form-wrapper{margin:20px 0}.ccf-form-wrapper .ccf-form-frame{display:none}.ccf-form-wrapper .ccf-clear{clear:both}.ccf-form-wrapper .form-title{font-size:150%;padding:20px 0}.ccf-form-wrapper .form-description{padding:0 0 20px}.ccf-form-wrapper .form-submit img{vertical-align:middle;display:inline-block;border:0;-ms-filter:"alpha(Opacity=0)";filter:alpha(opacity=0);-moz-opacity:0;-khtml-opacity:0;opacity:0;float:none;margin:0 0 0 6px}.ccf-form-wrapper .field-description{font-size:85%;clear:left;margin-top:6px}.ccf-form-wrapper .error{color:red;float:right;font-size:85%;margin-top:3px}.ccf-form-wrapper .error.email-error,.ccf-form-wrapper .error.match-error,.ccf-form-wrapper .error.unknown-error{float:none}.ccf-form-wrapper .error.right-error{float:right}.ccf-form-wrapper .field-hide{display:none}.ccf-form-wrapper .field{margin-bottom:24px;clear:both}.ccf-form-wrapper .field[data-field-type=checkboxes] .error,.ccf-form-wrapper .field[data-field-type=date] .error,.ccf-form-wrapper .field[data-field-type=dropdown] .error,.ccf-form-wrapper .field[data-field-type=file] .error,.ccf-form-wrapper .field[data-field-type=radio] .error,.ccf-form-wrapper .field[data-field-type=recaptcha] .error{float:none}.ccf-form-wrapper .field .field-error-input{border:1px solid red}.ccf-form-wrapper .field label.main-label{display:block;clear:both;margin-bottom:6px;font-weight:700}.ccf-form-wrapper .field label.main-label .required{padding-right:.3em;color:red}.ccf-form-wrapper .field input[type=text],.ccf-form-wrapper .field textarea{width:100%;box-sizing:border-box}.ccf-form-wrapper .field select{display:block;width:auto}.ccf-form-wrapper .field input[type=file]{background-color:inherit;border:0;line-height:0}.ccf-form-wrapper .field textarea{min-height:100px;color:inherit;font-family:inherit}.ccf-form-wrapper .field .left{width:50%;float:left;box-sizing:border-box;padding-right:10px;clear:both}.ccf-form-wrapper .field .right{width:50%;float:right;box-sizing:border-box;padding-left:10px}.ccf-form-wrapper .field .sub-label{margin-top:3px;font-size:85%;clear:none;font-weight:400}.ccf-form-wrapper .field.field-type-section-header .heading{font-size:125%;border-bottom:1px solid #ccc;padding-bottom:5px}.ccf-form-wrapper .field.field-type-section-header .subheading{margin-top:10px;font-size:85%;font-style:italic}.ccf-form-wrapper .field.field-type-date .hour,.ccf-form-wrapper .field.field-type-date .minute{display:inline-block;margin-right:5px}.ccf-form-wrapper .field.field-type-date .hour input,.ccf-form-wrapper .field.field-type-date .minute input{width:3.5em}.ccf-form-wrapper .field.field-type-date .hour label,.ccf-form-wrapper .field.field-type-date .minute label{font-weight:400}.ccf-form-wrapper .field.field-type-date .am-pm{display:inline-block;vertical-align:top}.ccf-form-wrapper .field.field-type-date .am-pm select{width:auto}.ccf-form-wrapper .ccf-theme-dark{font-size:16px}.ccf-form-wrapper .ccf-theme-dark dropdown,.ccf-form-wrapper .ccf-theme-dark input[type=submit],.ccf-form-wrapper .ccf-theme-dark input[type=text],.ccf-form-wrapper .ccf-theme-dark select,.ccf-form-wrapper .ccf-theme-dark textarea{border-radius:4px;background-color:#555;color:#fff;border:1px solid #ccc;padding:8px}.ccf-form-wrapper .ccf-theme-dark dropdown::-webkit-input-placeholder,.ccf-form-wrapper .ccf-theme-dark input[type=submit]::-webkit-input-placeholder,.ccf-form-wrapper .ccf-theme-dark input[type=text]::-webkit-input-placeholder,.ccf-form-wrapper .ccf-theme-dark select::-webkit-input-placeholder,.ccf-form-wrapper .ccf-theme-dark textarea::-webkit-input-placeholder{color:#ccc}.ccf-form-wrapper .ccf-theme-dark dropdown:-moz-placeholder,.ccf-form-wrapper .ccf-theme-dark input[type=submit]:-moz-placeholder,.ccf-form-wrapper .ccf-theme-dark input[type=text]:-moz-placeholder,.ccf-form-wrapper .ccf-theme-dark select:-moz-placeholder,.ccf-form-wrapper .ccf-theme-dark textarea:-moz-placeholder{color:#ccc}.ccf-form-wrapper .ccf-theme-dark dropdown:-ms-input-placeholder,.ccf-form-wrapper .ccf-theme-dark input[type=submit]:-ms-input-placeholder,.ccf-form-wrapper .ccf-theme-dark input[type=text]:-ms-input-placeholder,.ccf-form-wrapper .ccf-theme-dark select:-ms-input-placeholder,.ccf-form-wrapper .ccf-theme-dark textarea:-ms-input-placeholder{color:#ccc}.ccf-form-wrapper .ccf-theme-dark input.ccf-submit-button{padding:8px 14px;background-color:#555;background-image:-webkit-gradient(linear,left top,left bottom,from(#555),to(#222));background-image:-webkit-linear-gradient(top,#555,#222);background-image:-moz-linear-gradient(top,#555,#222);background-image:-ms-linear-gradient(top,#555,#222);background-image:-o-linear-gradient(top,#555,#222);background-image:linear-gradient(to bottom,#555,#222);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#555555, endColorstr=#222)}.ccf-form-wrapper .ccf-theme-light{font-size:16px}.ccf-form-wrapper .ccf-theme-light dropdown,.ccf-form-wrapper .ccf-theme-light input[type=submit],.ccf-form-wrapper .ccf-theme-light input[type=text],.ccf-form-wrapper .ccf-theme-light select,.ccf-form-wrapper .ccf-theme-light textarea{border-radius:4px;background-color:#fcfcfc;color:#333;border:1px solid #e0e0e0;padding:8px}.ccf-form-wrapper .ccf-theme-light dropdown::-webkit-input-placeholder,.ccf-form-wrapper .ccf-theme-light input[type=submit]::-webkit-input-placeholder,.ccf-form-wrapper .ccf-theme-light input[type=text]::-webkit-input-placeholder,.ccf-form-wrapper .ccf-theme-light select::-webkit-input-placeholder,.ccf-form-wrapper .ccf-theme-light textarea::-webkit-input-placeholder{color:#ccc}.ccf-form-wrapper .ccf-theme-light dropdown:-moz-placeholder,.ccf-form-wrapper .ccf-theme-light input[type=submit]:-moz-placeholder,.ccf-form-wrapper .ccf-theme-light input[type=text]:-moz-placeholder,.ccf-form-wrapper .ccf-theme-light select:-moz-placeholder,.ccf-form-wrapper .ccf-theme-light textarea:-moz-placeholder{color:#ccc}.ccf-form-wrapper .ccf-theme-light dropdown:-ms-input-placeholder,.ccf-form-wrapper .ccf-theme-light input[type=submit]:-ms-input-placeholder,.ccf-form-wrapper .ccf-theme-light input[type=text]:-ms-input-placeholder,.ccf-form-wrapper .ccf-theme-light select:-ms-input-placeholder,.ccf-form-wrapper .ccf-theme-light textarea:-ms-input-placeholder{color:#ccc}.ccf-form-wrapper .ccf-theme-light input.ccf-submit-button{padding:8px 14px;background-color:#f0f0f0;background-image:-webkit-gradient(linear,left top,left bottom,from(#f0f0f0),to(#fcfcfc));background-image:-webkit-linear-gradient(top,#f0f0f0,#fcfcfc);background-image:-moz-linear-gradient(top,#f0f0f0,#fcfcfc);background-image:-ms-linear-gradient(top,#f0f0f0,#fcfcfc);background-image:-o-linear-gradient(top,#f0f0f0,#fcfcfc);background-image:linear-gradient(to bottom,#f0f0f0,#fcfcfc);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#f0f0f0, endColorstr=#fcfcfc)}
|
assets/build/css/settings.css
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.ccf-asset-restrictions .add,
|
2 |
+
.ccf-asset-restrictions .delete {
|
3 |
+
font-weight: bold;
|
4 |
+
cursor: pointer;
|
5 |
+
vertical-align: middle;
|
6 |
+
font-size: 200%; }
|
7 |
+
|
8 |
+
.ccf-asset-restrictions input,
|
9 |
+
.ccf-asset-restrictions select {
|
10 |
+
margin-right: 1em; }
|
11 |
+
|
12 |
+
.ccf-hide-field {
|
13 |
+
display: none; }
|
14 |
+
|
15 |
+
/*# sourceMappingURL=settings.css.map */
|
assets/build/css/settings.css.map
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"version": 3,
|
3 |
+
"mappings": "AAAA;+BAEA;EACC,WAAW,EAAE,IAAI;EACjB,MAAM,EAAE,OAAO;EACf,cAAc,EAAE,MAAM;EACtB,SAAS,EAAE,IAAI;;AAGhB;8BAC+B;EAC9B,YAAY,EAAE,GAAG;;AAGlB,eAAgB;EACf,OAAO,EAAE,IAAI",
|
4 |
+
"sources": ["../../scss/settings.scss"],
|
5 |
+
"names": [],
|
6 |
+
"file": "settings.css"
|
7 |
+
}
|
assets/build/css/settings.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.ccf-asset-restrictions .add,.ccf-asset-restrictions .delete{font-weight:700;cursor:pointer;vertical-align:middle;font-size:200%}.ccf-asset-restrictions input,.ccf-asset-restrictions select{margin-right:1em}.ccf-hide-field{display:none}
|
assets/build/js/form-cpt-preview.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(e,t){"use strict";wp.ccf.preview=function(t,i){var l=this;l.id=parseInt(t),l.form=null;var s=l.fetch();e.when(s).done(function(){null===l.form?l.form=wp.ccf.forms.findWhere({id:l.id}):(wp.ccf.forms.add(l.form),delete wp.ccf.forms.formsFetching[l.id]),l.renderPreviews.call(l),i.innerHTML=l.template({form:l.form.toJSON()})}),wp.ccf.dispatcher.on("saveFormComplete",function(){l.renderPreviews(),i.innerHTML=l.template({form:l.form.toJSON()})})},wp.ccf.preview.prototype={template:wp.ccf.utils.template("ccf-form-mce-preview"),fetch:function(){var e=this,t=wp.ccf.forms.findWhere({id:e.id});if(!t){var i;return wp.ccf.forms.formsFetching[e.id]!==void 0?i=wp.ccf.forms.formsFetching[e.id]:(e.form=new wp.ccf.models.Form({id:e.id}),i=e.form.fetch(),wp.ccf.forms.formsFetching[e.id]=i),i}return!0},renderPreviews:function(){var e=this,t=e.form.get("fields");t.each(function(e){var t=document.getElementById("ccf-"+e.get("type")+"-preview-template");if(t){var i=wp.ccf.utils.template("ccf-"+e.get("type")+"-preview-template")({field:e.toJSON(),mce:!0});e.set("preview",i)}})}};var i=document.querySelectorAll(".ccf-form-cpt-preview");t.each(i,function(e){var t=parseInt(e.getAttribute("data-form-id"));new wp.ccf.preview(t,e)})})(jQuery,_);
|
assets/build/js/form-manager.js
ADDED
@@ -0,0 +1,4214 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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f.utils = wp.ccf.utils || {};
|
7 |
+
|
8 |
+
wp.ccf.utils.cleanDateFields = function( object ) {
|
9 |
+
delete object.date;
|
10 |
+
delete object.date_gmt;
|
11 |
+
delete object.modified;
|
12 |
+
delete object.modified_gmt;
|
13 |
+
delete object.date_tz;
|
14 |
+
delete object.modified_tz;
|
15 |
+
};
|
16 |
+
|
17 |
+
wp.ccf.utils.template = _.memoize( function( id ) {
|
18 |
+
// Use WordPress style Backbone template syntax
|
19 |
+
var options = {
|
20 |
+
evaluate: /<#([\s\S]+?)#>/g,
|
21 |
+
interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
|
22 |
+
escape: /\{\{([^\}]+?)\}\}(?!\})/g
|
23 |
+
};
|
24 |
+
|
25 |
+
return _.template( document.getElementById( id ).innerHTML, null, options );
|
26 |
+
});
|
27 |
+
|
28 |
+
wp.ccf.utils.insertFormShortcode = function( form ) {
|
29 |
+
var existingForm = wp.ccf.forms.findWhere( { id: form.get( 'id' ) } );
|
30 |
+
if ( ! existingForm ) {
|
31 |
+
wp.ccf.forms.add( form );
|
32 |
+
}
|
33 |
+
|
34 |
+
var editor = tinymce.get( wpActiveEditor );
|
35 |
+
var shortcode = '[ccf_form id="' + form.get( 'id' ) + '"]';
|
36 |
+
|
37 |
+
if ( editor && ! editor.isHidden() ) {
|
38 |
+
tinymce.activeEditor.execCommand( 'mceInsertContent', false, shortcode );
|
39 |
+
} else {
|
40 |
+
document.getElementById( wpActiveEditor ).value += shortcode;
|
41 |
+
}
|
42 |
+
};
|
43 |
+
|
44 |
+
wp.ccf.utils.getPrettyPostDate = function( date ) {
|
45 |
+
date = moment.utc( date );
|
46 |
+
|
47 |
+
if ( ccfSettings.gmtOffset ) {
|
48 |
+
date = date.utcOffset( parseInt( ccfSettings.gmtOffset ) * 60 );
|
49 |
+
}
|
50 |
+
|
51 |
+
return date.format( 'h:mm a M/D/YYYY' );
|
52 |
+
};
|
53 |
+
|
54 |
+
wp.ccf.utils.wordChop = function( string, maxLength ) {
|
55 |
+
var trimmedString = string.substr( 0, maxLength );
|
56 |
+
trimmedString.substr( 0, Math.min( trimmedString.length, trimmedString.lastIndexOf( ' ' ) ) );
|
57 |
+
|
58 |
+
if ( trimmedString.length < string.length ) {
|
59 |
+
trimmedString += '...';
|
60 |
+
}
|
61 |
+
|
62 |
+
return trimmedString;
|
63 |
+
};
|
64 |
+
|
65 |
+
wp.ccf.utils.isFieldDate = function( value ) {
|
66 |
+
if ( typeof value.date !== 'undefined' || ( typeof value.hour !== 'undefined' && typeof value.minute !== 'undefined' && typeof value['am-pm'] !== 'undefined' ) ) {
|
67 |
+
return true;
|
68 |
+
}
|
69 |
+
|
70 |
+
return false;
|
71 |
+
};
|
72 |
+
|
73 |
+
wp.ccf.utils.isFieldName = function( value ) {
|
74 |
+
if ( typeof value.name !== 'undefined' || typeof value.last !== 'undefined' ) {
|
75 |
+
return true;
|
76 |
+
}
|
77 |
+
|
78 |
+
return false;
|
79 |
+
};
|
80 |
+
|
81 |
+
wp.ccf.utils.isFieldEmailConfirm = function( value ) {
|
82 |
+
if ( typeof value.email !== 'undefined' || typeof value.confirm !== 'undefined' ) {
|
83 |
+
return true;
|
84 |
+
}
|
85 |
+
|
86 |
+
return false;
|
87 |
+
};
|
88 |
+
|
89 |
+
wp.ccf.utils.isFieldAddress = function( value ) {
|
90 |
+
if ( typeof value.street !== 'undefined' && typeof value.city !== 'undefined' && typeof value.zipcode !== 'undefined' && typeof value.line_two !== 'undefined' ) {
|
91 |
+
return true;
|
92 |
+
}
|
93 |
+
|
94 |
+
return false;
|
95 |
+
};
|
96 |
+
|
97 |
+
wp.ccf.utils.isFieldFile = function( value ) {
|
98 |
+
if ( typeof value.id !== 'undefined' && typeof value.url !== 'undefined' && typeof value.file_name !== 'undefined' ) {
|
99 |
+
return true;
|
100 |
+
}
|
101 |
+
|
102 |
+
return false;
|
103 |
+
};
|
104 |
+
|
105 |
+
wp.ccf.utils.getPrettyFieldEmailConfirm = function( value ) {
|
106 |
+
if ( value.email ) {
|
107 |
+
return value.email;
|
108 |
+
}
|
109 |
+
|
110 |
+
if ( value.confirm ) {
|
111 |
+
return value.confirm;
|
112 |
+
}
|
113 |
+
|
114 |
+
return '-';
|
115 |
+
};
|
116 |
+
|
117 |
+
wp.ccf.utils.getPrettyFieldDate = function( value, field ) {
|
118 |
+
var dateString = '',
|
119 |
+
output = '',
|
120 |
+
format = 'HH:mm MM/DD/YY';
|
121 |
+
|
122 |
+
if ( field && field.ccf_field_dateFormat && 'dd/mm/yyyy' === field.ccf_field_dateFormat ) {
|
123 |
+
format = 'HH:mm DD/MM/YY';
|
124 |
+
}
|
125 |
+
|
126 |
+
if ( value.hour && value.minute && value['am-pm'] ) {
|
127 |
+
dateString += value.hour + ':' + value.minute + ' ' + value['am-pm'];
|
128 |
+
}
|
129 |
+
|
130 |
+
if ( value.date ) {
|
131 |
+
dateString += ' ' + value.date;
|
132 |
+
}
|
133 |
+
|
134 |
+
if ( ! dateString ) {
|
135 |
+
return '-';
|
136 |
+
}
|
137 |
+
|
138 |
+
var date = moment( dateString, format );
|
139 |
+
|
140 |
+
if ( ! date.isValid() ) {
|
141 |
+
return ccfSettings.invalidDate;
|
142 |
+
}
|
143 |
+
|
144 |
+
if ( value.hour && value.minute && value['am-pm'] ) {
|
145 |
+
output += date.format( 'h:mm a' );
|
146 |
+
}
|
147 |
+
|
148 |
+
if ( value.date ) {
|
149 |
+
if ( output ) {
|
150 |
+
output += ' ';
|
151 |
+
}
|
152 |
+
|
153 |
+
output += value.date;
|
154 |
+
}
|
155 |
+
|
156 |
+
return output;
|
157 |
+
};
|
158 |
+
|
159 |
+
wp.ccf.utils.getPrettyFieldName = function( value ) {
|
160 |
+
var nameString = value.first;
|
161 |
+
|
162 |
+
if ( nameString.length > 0 ) {
|
163 |
+
nameString += ' ';
|
164 |
+
}
|
165 |
+
|
166 |
+
if ( value.last ) {
|
167 |
+
nameString += value.last;
|
168 |
+
}
|
169 |
+
|
170 |
+
if ( ! nameString ) {
|
171 |
+
nameString = '-';
|
172 |
+
}
|
173 |
+
|
174 |
+
return nameString;
|
175 |
+
};
|
176 |
+
|
177 |
+
wp.ccf.utils.getPrettyFieldAddress = function( value ) {
|
178 |
+
if ( ! value.street || ! value.city ) {
|
179 |
+
return '-';
|
180 |
+
}
|
181 |
+
|
182 |
+
var addressString = value.street;
|
183 |
+
|
184 |
+
if ( value.line_two ) {
|
185 |
+
addressString += ' ' + value.line_two;
|
186 |
+
}
|
187 |
+
|
188 |
+
addressString += ', ' + value.city;
|
189 |
+
|
190 |
+
if ( value.state ) {
|
191 |
+
addressString += ', ' + value.state;
|
192 |
+
}
|
193 |
+
|
194 |
+
if ( value.zipcode ) {
|
195 |
+
addressString += ' ' + value.zipcode;
|
196 |
+
}
|
197 |
+
|
198 |
+
if ( value.country ) {
|
199 |
+
addressString += ' ' + value.country;
|
200 |
+
}
|
201 |
+
|
202 |
+
return addressString;
|
203 |
+
};
|
204 |
+
|
205 |
+
})( jQuery, Backbone, _, ccfSettings );
|
206 |
+
( function( $, Backbone, _, ccfSettings ) {
|
207 |
+
'use strict';
|
208 |
+
|
209 |
+
wp.ccf.mixins = wp.ccf.mixins || {};
|
210 |
+
|
211 |
+
wp.ccf.mixins.subViewable = wp.ccf.mixins.subViewable || {
|
212 |
+
subViews: {},
|
213 |
+
|
214 |
+
initRenderSubViews: function( showAll, forceInit, args ) {
|
215 |
+
if ( ! this.renderedSubViews ) {
|
216 |
+
this.renderedSubViews = {};
|
217 |
+
}
|
218 |
+
|
219 |
+
for ( var id in this.subViews ) {
|
220 |
+
var context = {
|
221 |
+
el: this.$el.find( '.ccf-' + id ),
|
222 |
+
parent: this
|
223 |
+
};
|
224 |
+
|
225 |
+
if ( args ) {
|
226 |
+
_.extend( context, args );
|
227 |
+
}
|
228 |
+
|
229 |
+
if ( this.renderedSubViews[id] && this.renderedSubViews[id].destroy ) {
|
230 |
+
this.renderedSubViews[id].destroy();
|
231 |
+
}
|
232 |
+
|
233 |
+
if ( forceInit || ! this.renderedSubViews[id] ) {
|
234 |
+
this.renderedSubViews[id] = new this.subViews[id]( context );
|
235 |
+
}
|
236 |
+
|
237 |
+
this.renderedSubViews[id].render();
|
238 |
+
|
239 |
+
if ( showAll ) {
|
240 |
+
this.renderedSubViews[id].el.style.display = 'block';
|
241 |
+
}
|
242 |
+
}
|
243 |
+
|
244 |
+
return this;
|
245 |
+
},
|
246 |
+
|
247 |
+
showView: function( id, options, noRender ) {
|
248 |
+
if ( typeof this.renderedSubViews !== 'undefined' && typeof this.renderedSubViews[id] !== 'undefined' ) {
|
249 |
+
var view = this.renderedSubViews[id];
|
250 |
+
if ( ! noRender ) {
|
251 |
+
view.render( options );
|
252 |
+
}
|
253 |
+
|
254 |
+
view.el.style.display = 'block';
|
255 |
+
this.currentView = id;
|
256 |
+
|
257 |
+
for ( var viewId in this.subViews ) {
|
258 |
+
if ( viewId !== id ) {
|
259 |
+
this.renderedSubViews[viewId].el.style.display = 'none';
|
260 |
+
}
|
261 |
+
}
|
262 |
+
}
|
263 |
+
}
|
264 |
+
};
|
265 |
+
})( jQuery, Backbone, _, ccfSettings );
|
266 |
+
( function( $, Backbone, _, ccfSettings ) {
|
267 |
+
'use strict';
|
268 |
+
|
269 |
+
wp.ccf.models = wp.ccf.models || {};
|
270 |
+
wp.ccf.models.Fields = wp.ccf.models.Fields || {};
|
271 |
+
|
272 |
+
/**
|
273 |
+
* A terrible ie8 polyfill to fix JSON.stringify issues and empty strings pulled
|
274 |
+
* straight from the DOM.
|
275 |
+
*/
|
276 |
+
|
277 |
+
var _modelSet = function( key, value, options ) {
|
278 |
+
if ( typeof value !== 'object' && value === '' ) {
|
279 |
+
value = '';
|
280 |
+
}
|
281 |
+
|
282 |
+
return Backbone.Model.prototype.set.call( this, key, value, options );
|
283 |
+
};
|
284 |
+
|
285 |
+
/**
|
286 |
+
* Many web servers don't support PUT
|
287 |
+
*/
|
288 |
+
var _sync = function( method, model, options ) {
|
289 |
+
options = options || {};
|
290 |
+
|
291 |
+
options.emulateHTTP = true;
|
292 |
+
|
293 |
+
return this.constructor.__super__.sync.call( this, method, model, options );
|
294 |
+
};
|
295 |
+
|
296 |
+
/**
|
297 |
+
* We decode HTML entities after syncing then escape on output. The
|
298 |
+
* point of this is to prevent double escaping.
|
299 |
+
*/
|
300 |
+
var _modelDecode = function( excludeKeys ) {
|
301 |
+
for ( var key in this.attributes ) {
|
302 |
+
if ( _.indexOf( excludeKeys, key ) === -1 ) {
|
303 |
+
var value = this.get( key );
|
304 |
+
|
305 |
+
if ( typeof value === 'string' && value !== '' ) {
|
306 |
+
value = String( value )
|
307 |
+
.replace( /&/g, '&' )
|
308 |
+
.replace( /</g, '<' )
|
309 |
+
.replace( />/g, '>' )
|
310 |
+
.replace( /"/g, '"' )
|
311 |
+
.replace( /“/g, '”' )
|
312 |
+
.replace( /”/g, '”' )
|
313 |
+
.replace( /‘/g, "‘" )
|
314 |
+
.replace( /&/g, "&" )
|
315 |
+
.replace( /'/g, "'" );
|
316 |
+
|
317 |
+
this.set( key, value );
|
318 |
+
}
|
319 |
+
}
|
320 |
+
}
|
321 |
+
|
322 |
+
return this;
|
323 |
+
};
|
324 |
+
|
325 |
+
wp.ccf.models.FieldConditional = wp.ccf.models.FieldConditional || Backbone.Model.extend(
|
326 |
+
{
|
327 |
+
defaults: {
|
328 |
+
field: '',
|
329 |
+
compare: 'is',
|
330 |
+
value: ''
|
331 |
+
},
|
332 |
+
|
333 |
+
decode: function() {
|
334 |
+
return _modelDecode.call( this, [] );
|
335 |
+
},
|
336 |
+
|
337 |
+
set: _modelSet
|
338 |
+
}
|
339 |
+
);
|
340 |
+
|
341 |
+
wp.ccf.models.FieldChoice = wp.ccf.models.FieldChoice || Backbone.Model.extend(
|
342 |
+
{
|
343 |
+
defaults: {
|
344 |
+
label: '',
|
345 |
+
value: '',
|
346 |
+
selected: false
|
347 |
+
},
|
348 |
+
|
349 |
+
decode: function() {
|
350 |
+
return _modelDecode.call( this, [] );
|
351 |
+
},
|
352 |
+
|
353 |
+
set: _modelSet
|
354 |
+
}
|
355 |
+
);
|
356 |
+
|
357 |
+
wp.ccf.models.PostFieldMapping = wp.ccf.models.PostFieldMapping || Backbone.Model.extend(
|
358 |
+
{
|
359 |
+
defaults: {
|
360 |
+
formField: '',
|
361 |
+
postField: '',
|
362 |
+
customFieldKey: ''
|
363 |
+
},
|
364 |
+
|
365 |
+
decode: function() {
|
366 |
+
return _modelDecode.call( this, [] );
|
367 |
+
},
|
368 |
+
|
369 |
+
set: _modelSet
|
370 |
+
}
|
371 |
+
);
|
372 |
+
|
373 |
+
wp.ccf.models.FormNotificationAddress = wp.ccf.models.FormNotificationAddress || Backbone.Model.extend(
|
374 |
+
{
|
375 |
+
defaults: {
|
376 |
+
type: 'custom',
|
377 |
+
field: '',
|
378 |
+
email: ''
|
379 |
+
},
|
380 |
+
|
381 |
+
decode: function() {
|
382 |
+
return _modelDecode.call( this, [] );
|
383 |
+
},
|
384 |
+
|
385 |
+
set: _modelSet
|
386 |
+
}
|
387 |
+
);
|
388 |
+
|
389 |
+
wp.ccf.models.FormNotification = wp.ccf.models.FormNotification || Backbone.Model.extend(
|
390 |
+
{
|
391 |
+
defaults: function() {
|
392 |
+
return {
|
393 |
+
title: '',
|
394 |
+
content: '[all_fields]',
|
395 |
+
active: false,
|
396 |
+
addresses: new wp.ccf.collections.FormNotificationAddresses(),
|
397 |
+
fromType: 'default',
|
398 |
+
fromAddress: '',
|
399 |
+
fromField: '',
|
400 |
+
subjectType: 'default',
|
401 |
+
subject: '',
|
402 |
+
subjectField: '',
|
403 |
+
fromNameType: 'custom',
|
404 |
+
fromName: 'WordPress',
|
405 |
+
fromNameField: ''
|
406 |
+
};
|
407 |
+
},
|
408 |
+
|
409 |
+
initialize: function( attributes ) {
|
410 |
+
if ( typeof attributes === 'object' && attributes.addresses ) {
|
411 |
+
var addresses = [];
|
412 |
+
|
413 |
+
_.each( attributes.addresses, function( address ) {
|
414 |
+
var addressModel = new wp.ccf.models.FormNotificationAddress( address );
|
415 |
+
addressModel.decode();
|
416 |
+
|
417 |
+
addresses.push( addressModel );
|
418 |
+
});
|
419 |
+
|
420 |
+
this.set( 'addresses', new wp.ccf.collections.FormNotificationAddresses( addresses ) );
|
421 |
+
}
|
422 |
+
},
|
423 |
+
|
424 |
+
decode: function() {
|
425 |
+
return _modelDecode.call( this, [] );
|
426 |
+
},
|
427 |
+
|
428 |
+
toJSON: function() {
|
429 |
+
var attributes = this.constructor.__super__.toJSON.call( this );
|
430 |
+
|
431 |
+
if ( attributes.addresses ) {
|
432 |
+
attributes.addresses = attributes.addresses.toJSON();
|
433 |
+
}
|
434 |
+
|
435 |
+
return attributes;
|
436 |
+
},
|
437 |
+
|
438 |
+
set: _modelSet
|
439 |
+
}
|
440 |
+
);
|
441 |
+
|
442 |
+
wp.ccf.models.Form = wp.ccf.models.Form || wp.api.models.Post.extend(
|
443 |
+
{
|
444 |
+
|
445 |
+
urlRoot: ccfSettings.apiRoot.replace( /\/$/, '' ) + '/ccf/v1/forms',
|
446 |
+
|
447 |
+
set: _modelSet,
|
448 |
+
|
449 |
+
sync: _sync,
|
450 |
+
|
451 |
+
idAttribute: 'id',
|
452 |
+
|
453 |
+
initialize: function( attributes ) {
|
454 |
+
this.on( 'sync', this.decode, this );
|
455 |
+
},
|
456 |
+
|
457 |
+
defaults: function() {
|
458 |
+
var defaults = {
|
459 |
+
fields: new wp.ccf.collections.Fields(),
|
460 |
+
type: 'ccf_form',
|
461 |
+
status: 'publish',
|
462 |
+
description: '',
|
463 |
+
buttonText: 'Submit Form',
|
464 |
+
completionActionType: 'text',
|
465 |
+
completionRedirectUrl: '',
|
466 |
+
completionMessage: '',
|
467 |
+
postCreation: false,
|
468 |
+
postCreationType: 'post',
|
469 |
+
postCreationStatus: 'draft',
|
470 |
+
postFieldMappings: new wp.ccf.collections.PostFieldMappings(),
|
471 |
+
notifications: new wp.ccf.collections.FormNotifications(),
|
472 |
+
pause: false,
|
473 |
+
pauseMessage: ccfSettings.pauseMessage,
|
474 |
+
theme: 'none'
|
475 |
+
};
|
476 |
+
|
477 |
+
defaults = _.defaults( defaults, this.constructor.__super__.defaults );
|
478 |
+
wp.ccf.utils.cleanDateFields( defaults );
|
479 |
+
|
480 |
+
return defaults;
|
481 |
+
},
|
482 |
+
|
483 |
+
decode: function() {
|
484 |
+
var keys = _.keys( wp.api.models.Post.prototype.defaults );
|
485 |
+
keys = _.without( keys, 'title' );
|
486 |
+
|
487 |
+
return _modelDecode.call( this, keys );
|
488 |
+
},
|
489 |
+
|
490 |
+
getFieldSlugs: function( mutableOnly ) {
|
491 |
+
var fields = wp.ccf.currentForm.get( 'fields' ),
|
492 |
+
columns = [];
|
493 |
+
|
494 |
+
fields.each( function( field ) {
|
495 |
+
if ( mutableOnly ) {
|
496 |
+
if ( field.isImmutable ) {
|
497 |
+
return;
|
498 |
+
}
|
499 |
+
}
|
500 |
+
|
501 |
+
columns.push( field.get( 'slug' ) );
|
502 |
+
});
|
503 |
+
|
504 |
+
return columns;
|
505 |
+
},
|
506 |
+
|
507 |
+
parse: function( response ) {
|
508 |
+
var SELF = this,
|
509 |
+
i = 0,
|
510 |
+
z = 0;
|
511 |
+
|
512 |
+
if ( response.fields ) {
|
513 |
+
|
514 |
+
var fields = SELF.get( 'fields' );
|
515 |
+
|
516 |
+
if ( fields && fields.length > 0 ) {
|
517 |
+
|
518 |
+
for ( i = 0; i < response.fields.length; i++ ) {
|
519 |
+
var newField = response.fields[i];
|
520 |
+
|
521 |
+
var field = fields.findWhere( { slug: newField.slug } );
|
522 |
+
|
523 |
+
if ( field ) {
|
524 |
+
if ( typeof newField.choices !== 'undefined' ) {
|
525 |
+
var choices = SELF.get( 'choices' );
|
526 |
+
|
527 |
+
if ( choices && choices.length > 0 ) {
|
528 |
+
for ( z = 0; z < newField.choices; z++ ) {
|
529 |
+
var choice = choices.at( z );
|
530 |
+
choice.set( newField.choices[z] );
|
531 |
+
choice.decode();
|
532 |
+
}
|
533 |
+
}
|
534 |
+
|
535 |
+
delete response.fields[i].choices;
|
536 |
+
}
|
537 |
+
|
538 |
+
if ( typeof newField.conditionals !== 'undefined' ) {
|
539 |
+
var conditionals = SELF.get( 'conditionals' );
|
540 |
+
|
541 |
+
if ( conditionals && conditionals.length > 0 ) {
|
542 |
+
for ( z = 0; z < newField.conditionals; z++ ) {
|
543 |
+
var conditional = conditionals.at( z );
|
544 |
+
conditional.set( newField.conditionals[z] );
|
545 |
+
conditional.decode();
|
546 |
+
}
|
547 |
+
}
|
548 |
+
|
549 |
+
delete response.fields[i].conditionals;
|
550 |
+
}
|
551 |
+
|
552 |
+
field.set( newField );
|
553 |
+
field.decode();
|
554 |
+
}
|
555 |
+
}
|
556 |
+
|
557 |
+
delete response.fields;
|
558 |
+
} else {
|
559 |
+
var newFields = [];
|
560 |
+
|
561 |
+
_.each( response.fields, function( field ) {
|
562 |
+
var fieldModel = new wp.ccf.models.Fields[field.type]( field );
|
563 |
+
fieldModel.decode();
|
564 |
+
|
565 |
+
newFields.push( fieldModel );
|
566 |
+
});
|
567 |
+
|
568 |
+
response.fields = new wp.ccf.collections.Fields( newFields, { formId: response.id } );
|
569 |
+
if ( ! fields ) {
|
570 |
+
response.fields = new wp.ccf.collections.Fields( newFields, { formId: response.id } );
|
571 |
+
} else {
|
572 |
+
fields.add( newFields );
|
573 |
+
delete response.fields;
|
574 |
+
}
|
575 |
+
}
|
576 |
+
}
|
577 |
+
|
578 |
+
if ( response.notifications ) {
|
579 |
+
|
580 |
+
var notifications = SELF.get( 'notifications' );
|
581 |
+
|
582 |
+
if ( notifications && notifications.length > 0 ) {
|
583 |
+
|
584 |
+
for ( i = 0; i < response.notifications.length; i++ ) {
|
585 |
+
var newNotification = response.notifications[i];
|
586 |
+
|
587 |
+
var notification = notifications.at( i );
|
588 |
+
|
589 |
+
if ( notification ) {
|
590 |
+
if ( typeof newNotification.addresses !== 'undefined' ) {
|
591 |
+
var addresses = notification.get( 'addresses' );
|
592 |
+
|
593 |
+
if ( addresses && addresses.length > 0 ) {
|
594 |
+
for ( z = 0; z < newNotification.addresses; z++ ) {
|
595 |
+
var address = addresses.at( z );
|
596 |
+
address.set( newNotification.addresses[z] );
|
597 |
+
address.decode();
|
598 |
+
}
|
599 |
+
}
|
600 |
+
|
601 |
+
delete response.notifications[i].addresses;
|
602 |
+
}
|
603 |
+
|
604 |
+
notification.set( newNotification );
|
605 |
+
notification.decode();
|
606 |
+
}
|
607 |
+
}
|
608 |
+
|
609 |
+
delete response.notifications;
|
610 |
+
} else {
|
611 |
+
var newNotifications = [];
|
612 |
+
|
613 |
+
_.each( response.notifications, function( notification ) {
|
614 |
+
var notificationModel = new wp.ccf.models.FormNotification( notification );
|
615 |
+
notificationModel.decode();
|
616 |
+
|
617 |
+
newNotifications.push( notificationModel );
|
618 |
+
});
|
619 |
+
|
620 |
+
if ( ! notifications ) {
|
621 |
+
response.notifications = new wp.ccf.collections.FormNotifications( newNotifications );
|
622 |
+
} else {
|
623 |
+
notifications.add( newNotifications );
|
624 |
+
delete response.notifications;
|
625 |
+
}
|
626 |
+
}
|
627 |
+
}
|
628 |
+
|
629 |
+
if ( response.postFieldMappings ) {
|
630 |
+
|
631 |
+
var postFieldMappings = SELF.get( 'postFieldMappings' );
|
632 |
+
|
633 |
+
if ( postFieldMappings && postFieldMappings.length > 0 ) {
|
634 |
+
|
635 |
+
for ( i = 0; i < response.postFieldMappings.length; i++ ) {
|
636 |
+
var newPostFieldMapping = response.postFieldMappings[i];
|
637 |
+
|
638 |
+
var postFieldMapping = postFieldMappings.at( i );
|
639 |
+
|
640 |
+
if ( postFieldMapping ) {
|
641 |
+
postFieldMapping.set( newPostFieldMapping );
|
642 |
+
postFieldMapping.decode();
|
643 |
+
}
|
644 |
+
}
|
645 |
+
|
646 |
+
delete response.postFieldMappings;
|
647 |
+
} else {
|
648 |
+
var newPostFieldMappings = [];
|
649 |
+
|
650 |
+
_.each( response.postFieldMappings, function( postFieldMapping ) {
|
651 |
+
var postFieldMappingModel = new wp.ccf.models.PostFieldMapping( postFieldMapping );
|
652 |
+
postFieldMappingModel.decode();
|
653 |
+
|
654 |
+
newPostFieldMappings.push( postFieldMappingModel );
|
655 |
+
});
|
656 |
+
|
657 |
+
if ( ! postFieldMappings ) {
|
658 |
+
response.postFieldMappings = new wp.ccf.collections.PostFieldMappings( newPostFieldMappings );
|
659 |
+
} else {
|
660 |
+
postFieldMappings.add( newPostFieldMappings );
|
661 |
+
response.postFieldMappings = postFieldMappings;
|
662 |
+
}
|
663 |
+
}
|
664 |
+
}
|
665 |
+
|
666 |
+
return this.constructor.__super__.parse.call( this, response );
|
667 |
+
},
|
668 |
+
|
669 |
+
toJSON: function() {
|
670 |
+
var attributes = this.constructor.__super__.toJSON.call( this );
|
671 |
+
|
672 |
+
if ( attributes.fields ) {
|
673 |
+
attributes.fields = attributes.fields.toJSON();
|
674 |
+
}
|
675 |
+
|
676 |
+
if ( attributes.notifications ) {
|
677 |
+
attributes.notifications = attributes.notifications.toJSON();
|
678 |
+
}
|
679 |
+
|
680 |
+
if ( attributes.postFieldMappings ) {
|
681 |
+
attributes.postFieldMappings = attributes.postFieldMappings.toJSON();
|
682 |
+
}
|
683 |
+
|
684 |
+
if ( attributes.author ) {
|
685 |
+
attributes.author = attributes.author.toJSON();
|
686 |
+
}
|
687 |
+
|
688 |
+
return attributes;
|
689 |
+
}
|
690 |
+
}
|
691 |
+
);
|
692 |
+
|
693 |
+
wp.ccf.models.Submission = wp.api.models.Submission || wp.api.models.Post.extend(
|
694 |
+
{
|
695 |
+
defaults: {
|
696 |
+
id: null,
|
697 |
+
data: {},
|
698 |
+
fields: {}
|
699 |
+
},
|
700 |
+
|
701 |
+
sync: _sync,
|
702 |
+
|
703 |
+
urlRoot: ccfSettings.apiRoot.replace( /\/$/, '' ) + '/ccf/v1/submissions'
|
704 |
+
}
|
705 |
+
);
|
706 |
+
|
707 |
+
wp.ccf.models.Field = wp.api.models.Field || wp.api.models.Post.extend(
|
708 |
+
{
|
709 |
+
idAttribute: 'id',
|
710 |
+
|
711 |
+
defaults: function() {
|
712 |
+
return {
|
713 |
+
id: null,
|
714 |
+
conditionalsEnabled: false,
|
715 |
+
conditionalType: 'show',
|
716 |
+
conditionalFieldsRequired: 'all',
|
717 |
+
conditionals: new wp.ccf.collections.FieldConditionals()
|
718 |
+
};
|
719 |
+
},
|
720 |
+
|
721 |
+
set: _modelSet,
|
722 |
+
|
723 |
+
initialize: function( attributes ) {
|
724 |
+
if ( typeof attributes === 'object' && attributes.conditionals ) {
|
725 |
+
var conditionals = [];
|
726 |
+
|
727 |
+
_.each( attributes.conditionals, function( conditional ) {
|
728 |
+
var conditionalModel = new wp.ccf.models.FieldConditional( conditional );
|
729 |
+
conditionalModel.decode();
|
730 |
+
|
731 |
+
conditionals.push( conditionalModel );
|
732 |
+
});
|
733 |
+
|
734 |
+
this.set( 'conditionals', new wp.ccf.collections.FieldConditionals( conditionals ) );
|
735 |
+
}
|
736 |
+
},
|
737 |
+
|
738 |
+
required: function() {
|
739 |
+
return [ 'slug' ];
|
740 |
+
},
|
741 |
+
|
742 |
+
decode: function() {
|
743 |
+
return _modelDecode.call( this, _.keys( wp.api.models.Post.prototype.defaults ) );
|
744 |
+
},
|
745 |
+
|
746 |
+
hasRequiredAttributes: function() {
|
747 |
+
var SELF = this;
|
748 |
+
var reqsMet = true;
|
749 |
+
|
750 |
+
_.each( this.required(), function( fieldSlug ) {
|
751 |
+
if ( typeof SELF.get( fieldSlug ) === 'undefined' || SELF.get( fieldSlug ) === '' ) {
|
752 |
+
reqsMet = false;
|
753 |
+
}
|
754 |
+
});
|
755 |
+
|
756 |
+
return reqsMet;
|
757 |
+
},
|
758 |
+
|
759 |
+
sync: _sync
|
760 |
+
}
|
761 |
+
);
|
762 |
+
|
763 |
+
wp.ccf.models.StandardField = wp.ccf.models.StandardField || wp.ccf.models.Field.extend(
|
764 |
+
{
|
765 |
+
idAttribute: 'id',
|
766 |
+
|
767 |
+
defaults: function() {
|
768 |
+
var defaults = {
|
769 |
+
label: ccfSettings.fieldLabel,
|
770 |
+
value: '',
|
771 |
+
placeholder: '',
|
772 |
+
slug: '',
|
773 |
+
type: '',
|
774 |
+
required: false,
|
775 |
+
className: '',
|
776 |
+
description: ''
|
777 |
+
};
|
778 |
+
|
779 |
+
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
780 |
+
},
|
781 |
+
|
782 |
+
initialize: function() {
|
783 |
+
return wp.ccf.models.StandardField.__super__.initialize.apply( this, arguments );
|
784 |
+
}
|
785 |
+
}
|
786 |
+
);
|
787 |
+
|
788 |
+
wp.ccf.models.Fields['single-line-text'] = wp.ccf.models.Fields['single-line-text'] || wp.ccf.models.StandardField.extend(
|
789 |
+
{
|
790 |
+
defaults: function() {
|
791 |
+
var defaults = {
|
792 |
+
type: 'single-line-text'
|
793 |
+
};
|
794 |
+
|
795 |
+
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
796 |
+
},
|
797 |
+
|
798 |
+
initialize: function() {
|
799 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
800 |
+
}
|
801 |
+
}
|
802 |
+
);
|
803 |
+
|
804 |
+
wp.ccf.models.Fields.file = wp.ccf.models.Fields.file || wp.ccf.models.StandardField.extend(
|
805 |
+
{
|
806 |
+
defaults: function() {
|
807 |
+
var defaults = {
|
808 |
+
type: 'file',
|
809 |
+
fileExtensions: '',
|
810 |
+
maxFileSize: ccfSettings.maxFileSize
|
811 |
+
};
|
812 |
+
|
813 |
+
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
814 |
+
},
|
815 |
+
|
816 |
+
initialize: function() {
|
817 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
818 |
+
}
|
819 |
+
}
|
820 |
+
);
|
821 |
+
|
822 |
+
wp.ccf.models.Fields['paragraph-text'] = wp.ccf.models.Fields['paragraph-text'] || wp.ccf.models.StandardField.extend(
|
823 |
+
{
|
824 |
+
defaults: function() {
|
825 |
+
var defaults = {
|
826 |
+
type: 'paragraph-text'
|
827 |
+
};
|
828 |
+
|
829 |
+
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
830 |
+
},
|
831 |
+
|
832 |
+
initialize: function() {
|
833 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
834 |
+
}
|
835 |
+
}
|
836 |
+
);
|
837 |
+
|
838 |
+
wp.ccf.models.Fields.hidden = wp.ccf.models.Fields.hidden || wp.ccf.models.StandardField.extend(
|
839 |
+
{
|
840 |
+
defaults: function() {
|
841 |
+
var defaults = {
|
842 |
+
type: 'hidden'
|
843 |
+
};
|
844 |
+
|
845 |
+
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
846 |
+
},
|
847 |
+
|
848 |
+
initialize: function() {
|
849 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
850 |
+
}
|
851 |
+
}
|
852 |
+
);
|
853 |
+
|
854 |
+
wp.ccf.models.Fields.email = wp.ccf.models.Fields.email || wp.ccf.models.StandardField.extend(
|
855 |
+
{
|
856 |
+
defaults: function() {
|
857 |
+
var defaults = {
|
858 |
+
type: 'email',
|
859 |
+
emailConfirmation: false
|
860 |
+
};
|
861 |
+
|
862 |
+
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
863 |
+
},
|
864 |
+
|
865 |
+
initialize: function() {
|
866 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
867 |
+
}
|
868 |
+
}
|
869 |
+
);
|
870 |
+
|
871 |
+
wp.ccf.models.Fields.website = wp.ccf.models.Fields.website || wp.ccf.models.StandardField.extend(
|
872 |
+
{
|
873 |
+
defaults: function() {
|
874 |
+
var defaults = {
|
875 |
+
type: 'website',
|
876 |
+
placeholder: 'http://'
|
877 |
+
};
|
878 |
+
|
879 |
+
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
880 |
+
},
|
881 |
+
|
882 |
+
initialize: function() {
|
883 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
884 |
+
}
|
885 |
+
}
|
886 |
+
);
|
887 |
+
|
888 |
+
wp.ccf.models.Fields.phone = wp.ccf.models.Fields.phone || wp.ccf.models.StandardField.extend(
|
889 |
+
{
|
890 |
+
defaults: function() {
|
891 |
+
var defaults = {
|
892 |
+
type: 'phone',
|
893 |
+
phoneFormat: 'us'
|
894 |
+
};
|
895 |
+
|
896 |
+
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
897 |
+
},
|
898 |
+
|
899 |
+
initialize: function() {
|
900 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
901 |
+
}
|
902 |
+
}
|
903 |
+
);
|
904 |
+
|
905 |
+
wp.ccf.models.Fields.date = wp.ccf.models.Fields.date || wp.ccf.models.StandardField.extend(
|
906 |
+
{
|
907 |
+
defaults: function() {
|
908 |
+
var defaults = {
|
909 |
+
type: 'date',
|
910 |
+
showDate: true,
|
911 |
+
showTime: true,
|
912 |
+
dateFormat: 'mm/dd/yyyy'
|
913 |
+
};
|
914 |
+
|
915 |
+
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
916 |
+
},
|
917 |
+
|
918 |
+
initialize: function() {
|
919 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
920 |
+
}
|
921 |
+
}
|
922 |
+
);
|
923 |
+
|
924 |
+
wp.ccf.models.Fields.name = wp.ccf.models.Fields.name || wp.ccf.models.StandardField.extend(
|
925 |
+
{
|
926 |
+
defaults: function() {
|
927 |
+
var defaults = {
|
928 |
+
type: 'name'
|
929 |
+
};
|
930 |
+
|
931 |
+
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
932 |
+
},
|
933 |
+
|
934 |
+
initialize: function() {
|
935 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
936 |
+
}
|
937 |
+
}
|
938 |
+
);
|
939 |
+
|
940 |
+
wp.ccf.models.Fields.recaptcha = wp.ccf.models.Fields.recaptcha || wp.ccf.models.StandardField.extend(
|
941 |
+
{
|
942 |
+
defaults: function() {
|
943 |
+
var defaults = {
|
944 |
+
type: 'recaptcha',
|
945 |
+
siteKey: '',
|
946 |
+
secretKey: ''
|
947 |
+
};
|
948 |
+
|
949 |
+
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
950 |
+
},
|
951 |
+
|
952 |
+
required: function() {
|
953 |
+
return [ 'siteKey', 'secretKey' ];
|
954 |
+
},
|
955 |
+
|
956 |
+
isImmutable: true,
|
957 |
+
|
958 |
+
initialize: function() {
|
959 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
960 |
+
}
|
961 |
+
}
|
962 |
+
);
|
963 |
+
|
964 |
+
wp.ccf.models.Fields.address = wp.ccf.models.Fields.address || wp.ccf.models.StandardField.extend(
|
965 |
+
{
|
966 |
+
defaults: function() {
|
967 |
+
var defaults = {
|
968 |
+
type: 'address',
|
969 |
+
addressType: 'us'
|
970 |
+
};
|
971 |
+
|
972 |
+
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
973 |
+
},
|
974 |
+
|
975 |
+
initialize: function() {
|
976 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
977 |
+
}
|
978 |
+
}
|
979 |
+
);
|
980 |
+
|
981 |
+
wp.ccf.models.Fields['section-header'] = wp.ccf.models.Fields['section-header'] || wp.ccf.models.Field.extend(
|
982 |
+
{
|
983 |
+
defaults: function() {
|
984 |
+
var defaults = {
|
985 |
+
type: 'section-header',
|
986 |
+
slug: '',
|
987 |
+
heading: '',
|
988 |
+
subheading: '',
|
989 |
+
className: ''
|
990 |
+
};
|
991 |
+
|
992 |
+
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
993 |
+
},
|
994 |
+
|
995 |
+
required: function() {
|
996 |
+
return [];
|
997 |
+
},
|
998 |
+
|
999 |
+
isImmutable: true,
|
1000 |
+
|
1001 |
+
initialize: function() {
|
1002 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
1003 |
+
}
|
1004 |
+
}
|
1005 |
+
);
|
1006 |
+
|
1007 |
+
wp.ccf.models.Fields.html = wp.ccf.models.Fields.html || wp.ccf.models.Field.extend(
|
1008 |
+
{
|
1009 |
+
defaults: function() {
|
1010 |
+
var defaults = {
|
1011 |
+
type: 'html',
|
1012 |
+
slug: '',
|
1013 |
+
html: '',
|
1014 |
+
className: ''
|
1015 |
+
};
|
1016 |
+
|
1017 |
+
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
1018 |
+
},
|
1019 |
+
|
1020 |
+
required: function() {
|
1021 |
+
return [];
|
1022 |
+
},
|
1023 |
+
|
1024 |
+
isImmutable: true,
|
1025 |
+
|
1026 |
+
initialize: function() {
|
1027 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
1028 |
+
}
|
1029 |
+
}
|
1030 |
+
);
|
1031 |
+
|
1032 |
+
wp.ccf.models.ChoiceableField = wp.ccf.models.ChoiceableField || wp.ccf.models.StandardField.extend(
|
1033 |
+
{
|
1034 |
+
defaults: function() {
|
1035 |
+
var defaults = {
|
1036 |
+
choices: new wp.ccf.collections.FieldChoices()
|
1037 |
+
};
|
1038 |
+
|
1039 |
+
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
1040 |
+
},
|
1041 |
+
|
1042 |
+
initialize: function( attributes ) {
|
1043 |
+
if ( typeof attributes === 'object' && attributes.choices ) {
|
1044 |
+
var choices = [];
|
1045 |
+
|
1046 |
+
_.each( attributes.choices, function( choice ) {
|
1047 |
+
var choiceModel = new wp.ccf.models.FieldChoice( choice );
|
1048 |
+
choiceModel.decode();
|
1049 |
+
|
1050 |
+
choices.push( choiceModel );
|
1051 |
+
});
|
1052 |
+
|
1053 |
+
this.set( 'choices', new wp.ccf.collections.FieldChoices( choices ) );
|
1054 |
+
}
|
1055 |
+
|
1056 |
+
return wp.ccf.models.ChoiceableField.__super__.initialize.apply( this, arguments );
|
1057 |
+
}
|
1058 |
+
}
|
1059 |
+
);
|
1060 |
+
|
1061 |
+
wp.ccf.models.Fields.radio = wp.ccf.models.Fields.radio || wp.ccf.models.ChoiceableField.extend(
|
1062 |
+
{
|
1063 |
+
defaults: function() {
|
1064 |
+
var defaults = {
|
1065 |
+
type: 'radio'
|
1066 |
+
};
|
1067 |
+
|
1068 |
+
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
1069 |
+
},
|
1070 |
+
|
1071 |
+
initialize: function() {
|
1072 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
1073 |
+
}
|
1074 |
+
}
|
1075 |
+
);
|
1076 |
+
|
1077 |
+
wp.ccf.models.Fields.checkboxes = wp.ccf.models.Fields.checkboxes || wp.ccf.models.ChoiceableField.extend(
|
1078 |
+
{
|
1079 |
+
defaults: function() {
|
1080 |
+
var defaults = {
|
1081 |
+
type: 'checkboxes'
|
1082 |
+
};
|
1083 |
+
|
1084 |
+
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
1085 |
+
},
|
1086 |
+
|
1087 |
+
initialize: function() {
|
1088 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
1089 |
+
}
|
1090 |
+
}
|
1091 |
+
);
|
1092 |
+
|
1093 |
+
wp.ccf.models.Fields.dropdown = wp.ccf.models.Fields.dropdown || wp.ccf.models.ChoiceableField.extend(
|
1094 |
+
{
|
1095 |
+
defaults: function() {
|
1096 |
+
var defaults = {
|
1097 |
+
type: 'dropdown'
|
1098 |
+
};
|
1099 |
+
|
1100 |
+
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
1101 |
+
},
|
1102 |
+
|
1103 |
+
initialize: function() {
|
1104 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
1105 |
+
}
|
1106 |
+
}
|
1107 |
+
);
|
1108 |
+
})( jQuery, Backbone, _, ccfSettings );
|
1109 |
+
|
1110 |
+
( function( $, Backbone, _, ccfSettings ) {
|
1111 |
+
'use strict';
|
1112 |
+
|
1113 |
+
/**
|
1114 |
+
* Many web servers don't support PUT
|
1115 |
+
*/
|
1116 |
+
var _sync = function( method, model, options ) {
|
1117 |
+
options = options || {};
|
1118 |
+
|
1119 |
+
options.emulateHTTP = true;
|
1120 |
+
|
1121 |
+
return this.constructor.__super__.sync.call( this, method, model, options );
|
1122 |
+
};
|
1123 |
+
|
1124 |
+
wp.ccf.collections = wp.ccf.collections || {};
|
1125 |
+
|
1126 |
+
wp.ccf.collections.Forms = wp.ccf.collections.Forms || wp.api.collections.Posts.extend(
|
1127 |
+
{
|
1128 |
+
model: wp.ccf.models.Form,
|
1129 |
+
|
1130 |
+
url: ccfSettings.apiRoot.replace( /\/$/, '' ) + '/ccf/v1/forms',
|
1131 |
+
|
1132 |
+
formsFetching: {},
|
1133 |
+
|
1134 |
+
initialize: function() {
|
1135 |
+
this.constructor.__super__.initialize();
|
1136 |
+
this.formsFetching = {};
|
1137 |
+
},
|
1138 |
+
|
1139 |
+
sync: _sync,
|
1140 |
+
|
1141 |
+
remove: function( model, options ) {
|
1142 |
+
options = options || {};
|
1143 |
+
|
1144 |
+
var result = this.constructor.__super__.remove.call( this, model, options );
|
1145 |
+
|
1146 |
+
if ( options.destroy ) {
|
1147 |
+
|
1148 |
+
if ( model instanceof Array ) {
|
1149 |
+
_.each( model, function( model ) {
|
1150 |
+
model.destroy();
|
1151 |
+
});
|
1152 |
+
} else {
|
1153 |
+
model.destroy();
|
1154 |
+
}
|
1155 |
+
}
|
1156 |
+
|
1157 |
+
return result;
|
1158 |
+
}
|
1159 |
+
}
|
1160 |
+
);
|
1161 |
+
|
1162 |
+
wp.ccf.collections.Fields = wp.ccf.collections.Fields || wp.api.collections.Posts.extend(
|
1163 |
+
{
|
1164 |
+
model: wp.ccf.models.Field,
|
1165 |
+
|
1166 |
+
url: function() {
|
1167 |
+
return ccfSettings.apiRoot + '/ccf/forms/' + this.formId + '/fields';
|
1168 |
+
},
|
1169 |
+
|
1170 |
+
initialize: function( models, options ) {
|
1171 |
+
if ( options && options.formId ) {
|
1172 |
+
this.formId = options.formId;
|
1173 |
+
}
|
1174 |
+
},
|
1175 |
+
|
1176 |
+
sync: _sync
|
1177 |
+
}
|
1178 |
+
);
|
1179 |
+
|
1180 |
+
wp.ccf.collections.PostFieldMappings = wp.ccf.collections.PostFieldMappings || Backbone.Collection.extend(
|
1181 |
+
{
|
1182 |
+
model: wp.ccf.models.PostFieldMapping
|
1183 |
+
}
|
1184 |
+
);
|
1185 |
+
|
1186 |
+
wp.ccf.collections.FormNotificationAddresses = wp.ccf.collections.FormNotificationAddresses || Backbone.Collection.extend(
|
1187 |
+
{
|
1188 |
+
model: wp.ccf.models.FormNotificationAddress
|
1189 |
+
}
|
1190 |
+
);
|
1191 |
+
|
1192 |
+
wp.ccf.collections.FormNotifications = wp.ccf.collections.FormNotifications || Backbone.Collection.extend(
|
1193 |
+
{
|
1194 |
+
model: wp.ccf.models.FormNotification
|
1195 |
+
}
|
1196 |
+
);
|
1197 |
+
|
1198 |
+
wp.ccf.collections.Submissions = wp.ccf.collections.Submissions || wp.api.collections.Posts.extend(
|
1199 |
+
{
|
1200 |
+
model: wp.ccf.models.Submission,
|
1201 |
+
|
1202 |
+
url: function() {
|
1203 |
+
return ccfSettings.apiRoot.replace( /\/$/, '' ) + '/ccf/v1/forms/' + this.formId + '/submissions';
|
1204 |
+
},
|
1205 |
+
|
1206 |
+
initialize: function( models, options ) {
|
1207 |
+
this.constructor.__super__.initialize.apply( this, arguments );
|
1208 |
+
|
1209 |
+
if ( options && options.formId ) {
|
1210 |
+
this.formId = options.formId;
|
1211 |
+
}
|
1212 |
+
},
|
1213 |
+
|
1214 |
+
sync: _sync
|
1215 |
+
}
|
1216 |
+
);
|
1217 |
+
|
1218 |
+
wp.ccf.collections.FieldChoices = wp.ccf.collections.FieldChoices || Backbone.Collection.extend(
|
1219 |
+
{
|
1220 |
+
model: wp.ccf.models.FieldChoice
|
1221 |
+
}
|
1222 |
+
);
|
1223 |
+
|
1224 |
+
wp.ccf.collections.FieldConditionals = wp.ccf.collections.FieldConditionals || Backbone.Collection.extend(
|
1225 |
+
{
|
1226 |
+
model: wp.ccf.models.FieldConditional
|
1227 |
+
}
|
1228 |
+
);
|
1229 |
+
|
1230 |
+
})( jQuery, Backbone, _, ccfSettings );
|
1231 |
+
|
1232 |
+
( function( $, Backbone, _, ccfSettings ) {
|
1233 |
+
'use strict';
|
1234 |
+
|
1235 |
+
wp.ccf.views = wp.ccf.views || {};
|
1236 |
+
wp.ccf.views.Fields = wp.ccf.views.Fields || {};
|
1237 |
+
|
1238 |
+
wp.ccf.views.FieldChoice = Backbone.View.extend(
|
1239 |
+
{
|
1240 |
+
template: wp.ccf.utils.template( 'ccf-field-choice-template' ),
|
1241 |
+
className: 'choice',
|
1242 |
+
|
1243 |
+
events: {
|
1244 |
+
'click .add': 'triggerAdd',
|
1245 |
+
'click .delete': 'triggerDelete',
|
1246 |
+
'saveChoice': 'saveChoice',
|
1247 |
+
'sorted': 'triggerUpdateSort'
|
1248 |
+
},
|
1249 |
+
|
1250 |
+
initialize: function( options ) {
|
1251 |
+
this.field = options.field;
|
1252 |
+
},
|
1253 |
+
|
1254 |
+
destroy: function() {
|
1255 |
+
wp.ccf.dispatcher.off( 'mainViewChange', this.saveChoice );
|
1256 |
+
this.unbind();
|
1257 |
+
},
|
1258 |
+
|
1259 |
+
triggerUpdateSort: function( event, index ) {
|
1260 |
+
this.field.get( 'choices' ).remove( this.model, { silent: true } );
|
1261 |
+
|
1262 |
+
this.field.get( 'choices' ).add( this.model, { at: index, silent: true } );
|
1263 |
+
},
|
1264 |
+
|
1265 |
+
saveChoice: function() {
|
1266 |
+
// @todo: fix this ie8 hack
|
1267 |
+
if ( this.el.innerHTML === '' ) {
|
1268 |
+
return;
|
1269 |
+
}
|
1270 |
+
|
1271 |
+
var label = this.el.querySelectorAll( '.choice-label' )[0].value;
|
1272 |
+
var value = this.el.querySelectorAll( '.choice-value' )[0].value;
|
1273 |
+
|
1274 |
+
this.model.set( 'label', label );
|
1275 |
+
this.model.set( 'value', value );
|
1276 |
+
|
1277 |
+
var selectedElement = this.el.querySelectorAll( '.choice-selected' )[0];
|
1278 |
+
var selected = ( selectedElement.checked ) ? true : false;
|
1279 |
+
|
1280 |
+
this.model.set( 'selected', selected );
|
1281 |
+
|
1282 |
+
return this;
|
1283 |
+
|
1284 |
+
},
|
1285 |
+
|
1286 |
+
render: function() {
|
1287 |
+
var context = {};
|
1288 |
+
if ( this.model ) {
|
1289 |
+
context.choice = this.model.toJSON();
|
1290 |
+
}
|
1291 |
+
|
1292 |
+
this.el.innerHTML = this.template( context );
|
1293 |
+
|
1294 |
+
wp.ccf.dispatcher.on( 'mainViewChange', this.saveChoice, this );
|
1295 |
+
|
1296 |
+
return this;
|
1297 |
+
},
|
1298 |
+
|
1299 |
+
triggerAdd: function() {
|
1300 |
+
this.field.get( 'choices' ).add( new wp.ccf.models.FieldChoice() );
|
1301 |
+
},
|
1302 |
+
|
1303 |
+
triggerDelete: function() {
|
1304 |
+
var choices = this.field.get( 'choices' );
|
1305 |
+
if ( choices.length > 1 ) {
|
1306 |
+
choices.remove( this.model );
|
1307 |
+
this.destroy();
|
1308 |
+
this.remove();
|
1309 |
+
} else {
|
1310 |
+
var inputs = this.el.querySelectorAll( '.choice-label, .choice-value' );
|
1311 |
+
var selected = this.el.querySelectorAll( '.choice-selected' );
|
1312 |
+
|
1313 |
+
for ( var i = 0; i < inputs.length; i++ ) {
|
1314 |
+
inputs[i].value = '';
|
1315 |
+
}
|
1316 |
+
|
1317 |
+
selected[0].checked = false;
|
1318 |
+
}
|
1319 |
+
}
|
1320 |
+
}
|
1321 |
+
);
|
1322 |
+
|
1323 |
+
wp.ccf.views.FieldConditional = Backbone.View.extend(
|
1324 |
+
{
|
1325 |
+
template: wp.ccf.utils.template( 'ccf-field-conditional-template' ),
|
1326 |
+
className: 'conditional',
|
1327 |
+
|
1328 |
+
events: {
|
1329 |
+
'click .add': 'triggerAdd',
|
1330 |
+
'click .delete': 'triggerDelete',
|
1331 |
+
'saveConditional': 'saveConditional'
|
1332 |
+
},
|
1333 |
+
|
1334 |
+
initialize: function( options ) {
|
1335 |
+
this.field = options.field;
|
1336 |
+
this.fieldCollection = options.fieldCollection;
|
1337 |
+
},
|
1338 |
+
|
1339 |
+
destroy: function() {
|
1340 |
+
wp.ccf.dispatcher.off( 'mainViewChange', this.saveConditional );
|
1341 |
+
this.unbind();
|
1342 |
+
},
|
1343 |
+
|
1344 |
+
saveConditional: function() {
|
1345 |
+
// @todo: fix this ie8 hack
|
1346 |
+
if ( this.el.innerHTML === '' ) {
|
1347 |
+
return;
|
1348 |
+
}
|
1349 |
+
|
1350 |
+
var field = this.el.querySelectorAll( '.conditional-field' )[0].value;
|
1351 |
+
var value = this.el.querySelectorAll( '.conditional-value' )[0].value;
|
1352 |
+
var compare = this.el.querySelectorAll( '.conditional-compare' )[0].value;
|
1353 |
+
|
1354 |
+
this.model.set( 'field', field );
|
1355 |
+
this.model.set( 'value', value );
|
1356 |
+
this.model.set( 'compare', compare );
|
1357 |
+
|
1358 |
+
return this;
|
1359 |
+
|
1360 |
+
},
|
1361 |
+
|
1362 |
+
updateFields: function() {
|
1363 |
+
var conditionalFields = this.el.querySelectorAll( '.conditional-field' )[0];
|
1364 |
+
conditionalFields.innerHTML = '';
|
1365 |
+
conditionalFields.disabled = false;
|
1366 |
+
|
1367 |
+
var fieldsAdded = 0;
|
1368 |
+
|
1369 |
+
var conditionalField = this.model.get( 'field' ),
|
1370 |
+
option;
|
1371 |
+
|
1372 |
+
if ( this.fieldCollection.length >= 1 ) {
|
1373 |
+
option = document.createElement( 'option' );
|
1374 |
+
option.innerHTML = ccfSettings.chooseFormField;
|
1375 |
+
option.value = '';
|
1376 |
+
|
1377 |
+
conditionalFields.appendChild( option );
|
1378 |
+
|
1379 |
+
this.fieldCollection.each( function( field ) {
|
1380 |
+
if ( this.field.get( 'slug' ) !== field.get( 'slug' ) ) {
|
1381 |
+
var type = field.get( 'type' );
|
1382 |
+
|
1383 |
+
if ( 'address' !== type && 'checkboxes' !== type && 'date' !== type && 'name' !== type && 'file' !== type && 'recaptcha' !== type && 'section-header' !== type && 'html' !== type ) {
|
1384 |
+
option = document.createElement( 'option' );
|
1385 |
+
option.innerHTML = field.get( 'slug' );
|
1386 |
+
option.value = field.get( 'slug' );
|
1387 |
+
|
1388 |
+
if ( field.get( 'slug' ) === conditionalField ) {
|
1389 |
+
option.selected = true;
|
1390 |
+
}
|
1391 |
+
|
1392 |
+
conditionalFields.appendChild( option );
|
1393 |
+
|
1394 |
+
fieldsAdded++;
|
1395 |
+
}
|
1396 |
+
}
|
1397 |
+
}, this );
|
1398 |
+
}
|
1399 |
+
|
1400 |
+
if ( 0 === fieldsAdded ) {
|
1401 |
+
conditionalFields.innerHTML = '';
|
1402 |
+
option = document.createElement( 'option' );
|
1403 |
+
option.innerHTML = ccfSettings.noAvailableFields;
|
1404 |
+
option.value = '';
|
1405 |
+
conditionalFields.appendChild( option );
|
1406 |
+
conditionalFields.disabled = true;
|
1407 |
+
}
|
1408 |
+
},
|
1409 |
+
|
1410 |
+
render: function() {
|
1411 |
+
var context = {};
|
1412 |
+
if ( this.model ) {
|
1413 |
+
context.conditional = this.model.toJSON();
|
1414 |
+
}
|
1415 |
+
|
1416 |
+
this.el.innerHTML = this.template( context );
|
1417 |
+
|
1418 |
+
wp.ccf.dispatcher.on( 'mainViewChange', this.saveConditional, this );
|
1419 |
+
|
1420 |
+
this.listenTo( this.fieldCollection, 'add', this.updateFields, this );
|
1421 |
+
this.listenTo( this.fieldCollection, 'remove', this.updateFields, this );
|
1422 |
+
|
1423 |
+
this.updateFields();
|
1424 |
+
|
1425 |
+
return this;
|
1426 |
+
},
|
1427 |
+
|
1428 |
+
triggerAdd: function() {
|
1429 |
+
this.field.get( 'conditionals' ).add( new wp.ccf.models.FieldConditional() );
|
1430 |
+
},
|
1431 |
+
|
1432 |
+
triggerDelete: function() {
|
1433 |
+
var conditionals = this.field.get( 'conditionals' );
|
1434 |
+
if ( conditionals.length > 1 ) {
|
1435 |
+
conditionals.remove( this.model );
|
1436 |
+
this.destroy();
|
1437 |
+
this.remove();
|
1438 |
+
} else {
|
1439 |
+
var value = this.el.querySelectorAll( '.conditional-value' )[0];
|
1440 |
+
var field = this.el.querySelectorAll( '.conditional-field' )[0];
|
1441 |
+
|
1442 |
+
value.value = '';
|
1443 |
+
|
1444 |
+
for ( var i = 0; i < field.childNodes.length; i++ ) {
|
1445 |
+
field.childNodes[i].selected = false;
|
1446 |
+
}
|
1447 |
+
}
|
1448 |
+
}
|
1449 |
+
}
|
1450 |
+
);
|
1451 |
+
|
1452 |
+
wp.ccf.views.EmptyFormNotificationTableRow = wp.ccf.views.EmptyFormNotificationTableRow || Backbone.View.extend(
|
1453 |
+
{
|
1454 |
+
tagName: 'tr',
|
1455 |
+
template: wp.ccf.utils.template( 'ccf-empty-form-notification-row-template'),
|
1456 |
+
|
1457 |
+
events: {
|
1458 |
+
'click .add': 'triggerAdd'
|
1459 |
+
},
|
1460 |
+
|
1461 |
+
initialize: function( options ) {
|
1462 |
+
this.form = options.form;
|
1463 |
+
},
|
1464 |
+
|
1465 |
+
destroy: function() {
|
1466 |
+
this.unbind();
|
1467 |
+
},
|
1468 |
+
|
1469 |
+
render: function() {
|
1470 |
+
this.$el.html( this.template() );
|
1471 |
+
return this;
|
1472 |
+
},
|
1473 |
+
|
1474 |
+
triggerAdd: function() {
|
1475 |
+
var notifications = this.form.get( 'notifications' );
|
1476 |
+
|
1477 |
+
this.destroy();
|
1478 |
+
|
1479 |
+
notifications.add( new wp.ccf.models.FormNotification() );
|
1480 |
+
}
|
1481 |
+
}
|
1482 |
+
);
|
1483 |
+
|
1484 |
+
wp.ccf.views.EmptyFormTableRow = wp.ccf.views.EmptyFormTableRow || Backbone.View.extend(
|
1485 |
+
{
|
1486 |
+
tagName: 'tr',
|
1487 |
+
template: wp.ccf.utils.template( 'ccf-empty-form-table-row-template'),
|
1488 |
+
|
1489 |
+
render: function() {
|
1490 |
+
this.$el.html( this.template() );
|
1491 |
+
return this;
|
1492 |
+
}
|
1493 |
+
}
|
1494 |
+
);
|
1495 |
+
|
1496 |
+
wp.ccf.views.FormNotificationAddress = Backbone.View.extend(
|
1497 |
+
{
|
1498 |
+
template: wp.ccf.utils.template( 'ccf-form-notification-address-template' ),
|
1499 |
+
className: 'address',
|
1500 |
+
|
1501 |
+
events: {
|
1502 |
+
'click .add': 'triggerAdd',
|
1503 |
+
'click .delete': 'triggerDelete',
|
1504 |
+
'blur input': 'save',
|
1505 |
+
'change select': 'save'
|
1506 |
+
},
|
1507 |
+
|
1508 |
+
initialize: function( options ) {
|
1509 |
+
this.notification = options.notification;
|
1510 |
+
this.parent = options.parent;
|
1511 |
+
this.form = options.form;
|
1512 |
+
},
|
1513 |
+
|
1514 |
+
destroy: function() {
|
1515 |
+
this.unbind();
|
1516 |
+
},
|
1517 |
+
|
1518 |
+
save: function() {
|
1519 |
+
// @todo: fix this ie8 hack
|
1520 |
+
if ( this.el.innerHTML === '' ) {
|
1521 |
+
return;
|
1522 |
+
}
|
1523 |
+
|
1524 |
+
var type = this.el.querySelectorAll( '.form-notification-address-type' )[0].value;
|
1525 |
+
var email = this.el.querySelectorAll( '.form-notification-address-email' );
|
1526 |
+
var field = this.el.querySelectorAll( '.form-notification-address-field' );
|
1527 |
+
var oldType = this.model.get( 'type' );
|
1528 |
+
|
1529 |
+
if ( email.length ) {
|
1530 |
+
this.model.set( 'email', email[0].value );
|
1531 |
+
}
|
1532 |
+
|
1533 |
+
if ( field.length ) {
|
1534 |
+
this.model.set( 'field', field[0].value );
|
1535 |
+
}
|
1536 |
+
|
1537 |
+
this.model.set( 'type', type );
|
1538 |
+
|
1539 |
+
if ( oldType !== type ) {
|
1540 |
+
this.render();
|
1541 |
+
}
|
1542 |
+
|
1543 |
+
return this;
|
1544 |
+
|
1545 |
+
},
|
1546 |
+
|
1547 |
+
updateFromFieldField: function() {
|
1548 |
+
if ( 'edit' !== this.parent.context || 'field' !== this.model.get( 'type' ) ) {
|
1549 |
+
return;
|
1550 |
+
}
|
1551 |
+
|
1552 |
+
var addressFromField = this.el.querySelectorAll( '.form-notification-address-field' )[0];
|
1553 |
+
addressFromField.innerHTML = '';
|
1554 |
+
addressFromField.disabled = false;
|
1555 |
+
|
1556 |
+
var fields = this.form.get( 'fields' ),
|
1557 |
+
fieldsAdded = 0;
|
1558 |
+
|
1559 |
+
var addressField = this.model.get( 'field' ),
|
1560 |
+
option;
|
1561 |
+
|
1562 |
+
if ( fields.length >= 1 ) {
|
1563 |
+
fields.each( function( field ) {
|
1564 |
+
if ( 'email' === field.get( 'type' ) || 'dropdown' === field.get( 'type' ) || 'radio' === field.get( 'type' ) || 'single-line-text' === field.get( 'type' ) ) {
|
1565 |
+
option = document.createElement( 'option' );
|
1566 |
+
option.innerHTML = field.get( 'slug' );
|
1567 |
+
option.value = field.get( 'slug' );
|
1568 |
+
|
1569 |
+
if ( field.get( 'slug' ) === addressField ) {
|
1570 |
+
option.selected = true;
|
1571 |
+
}
|
1572 |
+
|
1573 |
+
addressFromField.appendChild( option );
|
1574 |
+
|
1575 |
+
fieldsAdded++;
|
1576 |
+
}
|
1577 |
+
});
|
1578 |
+
}
|
1579 |
+
|
1580 |
+
if ( 0 === fieldsAdded ) {
|
1581 |
+
option = document.createElement( 'option' );
|
1582 |
+
option.innerHTML = ccfSettings.noApplicableFields;
|
1583 |
+
option.value = '';
|
1584 |
+
addressFromField.appendChild( option );
|
1585 |
+
addressFromField.disabled = true;
|
1586 |
+
}
|
1587 |
+
},
|
1588 |
+
|
1589 |
+
render: function() {
|
1590 |
+
var context = {};
|
1591 |
+
if ( this.model ) {
|
1592 |
+
context.address = this.model.toJSON();
|
1593 |
+
}
|
1594 |
+
|
1595 |
+
this.el.innerHTML = this.template( context );
|
1596 |
+
|
1597 |
+
var fields = this.form.get( 'fields' );
|
1598 |
+
|
1599 |
+
this.listenTo( fields, 'add', this.updateFromFieldField, this );
|
1600 |
+
this.listenTo( fields, 'remove', this.updateFromFieldField, this );
|
1601 |
+
|
1602 |
+
if ( 'field' === this.model.get( 'type' ) ) {
|
1603 |
+
this.updateFromFieldField();
|
1604 |
+
}
|
1605 |
+
|
1606 |
+
return this;
|
1607 |
+
},
|
1608 |
+
|
1609 |
+
triggerAdd: function() {
|
1610 |
+
this.notification.get( 'addresses' ).add( new wp.ccf.models.FormNotificationAddress() );
|
1611 |
+
},
|
1612 |
+
|
1613 |
+
triggerDelete: function() {
|
1614 |
+
var addresses = this.notification.get( 'addresses' );
|
1615 |
+
|
1616 |
+
if ( addresses.length > 1 ) {
|
1617 |
+
this.parent.deleteAddress( this );
|
1618 |
+
} else {
|
1619 |
+
this.model.clear().set( wp.ccf.models.FormNotificationAddress.prototype.defaults );
|
1620 |
+
this.destroy();
|
1621 |
+
this.render();
|
1622 |
+
}
|
1623 |
+
}
|
1624 |
+
}
|
1625 |
+
);
|
1626 |
+
|
1627 |
+
wp.ccf.views.ExistingFormNotificationRow = Backbone.View.extend(
|
1628 |
+
{
|
1629 |
+
template: wp.ccf.utils.template( 'ccf-existing-form-notification-table-row-template' ),
|
1630 |
+
tagName: 'tr',
|
1631 |
+
|
1632 |
+
events: {
|
1633 |
+
'change select.form-email-notification-from-type': 'toggleNotificationFields',
|
1634 |
+
'change select.form-email-notification-from-name-type': 'toggleNotificationFields',
|
1635 |
+
'change select.form-email-notification-subject-type': 'toggleNotificationFields',
|
1636 |
+
'click .close-notification': 'changeContext',
|
1637 |
+
'click .edit-notification': 'changeContext',
|
1638 |
+
'click .delete-notification': 'triggerDelete',
|
1639 |
+
'blur input': 'save',
|
1640 |
+
'change select': 'save'
|
1641 |
+
},
|
1642 |
+
|
1643 |
+
addressViews: [],
|
1644 |
+
|
1645 |
+
initialize: function( options ) {
|
1646 |
+
this.form = options.form;
|
1647 |
+
this.addressViews = [];
|
1648 |
+
this.parent = options.parent;
|
1649 |
+
this.context = ( 'undefined' !== typeof options.context ) ? options.context : 'view';
|
1650 |
+
|
1651 |
+
var addresses = this.model.get( 'addresses' );
|
1652 |
+
this.listenTo( addresses, 'add', this.addAddress );
|
1653 |
+
},
|
1654 |
+
|
1655 |
+
deleteAddress: function( view ) {
|
1656 |
+
_.each( this.addressViews, function( currentView ) {
|
1657 |
+
if ( view.cid === currentView.cid ) {
|
1658 |
+
var index = _.indexOf( this.addressViews, currentView );
|
1659 |
+
this.model.get( 'addresses' ).remove( view.model );
|
1660 |
+
this.addressViews[index].remove();
|
1661 |
+
this.addressViews.splice( index, 1 );
|
1662 |
+
}
|
1663 |
+
}, this );
|
1664 |
+
},
|
1665 |
+
|
1666 |
+
addAddress: function( model ) {
|
1667 |
+
var addressesContainer = this.el.querySelectorAll( '.addresses' )[0];
|
1668 |
+
var view = new wp.ccf.views.FormNotificationAddress( { model: model, parent: this, notification: this.model, form: this.form } );
|
1669 |
+
this.addressViews.push( view );
|
1670 |
+
addressesContainer.appendChild( view.render().el );
|
1671 |
+
},
|
1672 |
+
|
1673 |
+
destroy: function() {
|
1674 |
+
this.unbind();
|
1675 |
+
},
|
1676 |
+
|
1677 |
+
changeContext: function( event, forceContext ) {
|
1678 |
+
if ( 'edit' === this.context ) {
|
1679 |
+
this.save();
|
1680 |
+
}
|
1681 |
+
|
1682 |
+
if ( forceContext ) {
|
1683 |
+
this.context = forceContext;
|
1684 |
+
} else {
|
1685 |
+
if ( 'view' === this.context ) {
|
1686 |
+
this.parent.closeAllNotifications();
|
1687 |
+
}
|
1688 |
+
|
1689 |
+
this.context = ( 'edit' === this.context ) ? 'view' : 'edit';
|
1690 |
+
}
|
1691 |
+
|
1692 |
+
this.destroy();
|
1693 |
+
this.render();
|
1694 |
+
},
|
1695 |
+
|
1696 |
+
updateFieldVariables: function() {
|
1697 |
+
if ( 'edit' !== this.context ) {
|
1698 |
+
return;
|
1699 |
+
}
|
1700 |
+
|
1701 |
+
var fieldVariables = this.el.querySelectorAll( '.field-variables' )[0];
|
1702 |
+
var variablesText = '';
|
1703 |
+
var type;
|
1704 |
+
var fields = this.form.get( 'fields' );
|
1705 |
+
|
1706 |
+
fields.each( function( field ) {
|
1707 |
+
type = field.get( 'type' );
|
1708 |
+
|
1709 |
+
if ( 'html' !== type && 'section-header' !== type && 'recaptcha' !== type ) {
|
1710 |
+
variablesText += '[' + field.get( 'slug' ) + '] ';
|
1711 |
+
}
|
1712 |
+
} );
|
1713 |
+
|
1714 |
+
fieldVariables.innerText = variablesText;
|
1715 |
+
},
|
1716 |
+
|
1717 |
+
updateFromFieldField: function() {
|
1718 |
+
if ( 'edit' !== this.context ) {
|
1719 |
+
return;
|
1720 |
+
}
|
1721 |
+
|
1722 |
+
var emailNotificationFromField = this.el.querySelectorAll( '.form-email-notification-from-field' )[0];
|
1723 |
+
emailNotificationFromField.innerHTML = '';
|
1724 |
+
emailNotificationFromField.disabled = false;
|
1725 |
+
|
1726 |
+
var emailNotificationSubjectField = this.el.querySelectorAll( '.form-email-notification-subject-field' )[0];
|
1727 |
+
emailNotificationSubjectField.innerHTML = '';
|
1728 |
+
emailNotificationSubjectField.disabled = false;
|
1729 |
+
|
1730 |
+
var emailNotificationFromNameField = this.el.querySelectorAll( '.form-email-notification-from-name-field' )[0];
|
1731 |
+
emailNotificationFromNameField.innerHTML = '';
|
1732 |
+
emailNotificationFromNameField.disabled = false;
|
1733 |
+
|
1734 |
+
var fields = this.form.get( 'fields' ),
|
1735 |
+
addressFieldsAdded = 0,
|
1736 |
+
nameFieldsAdded = 0,
|
1737 |
+
subjectFieldsAdded = 0;
|
1738 |
+
|
1739 |
+
var addressField = this.model.get( 'emailNotificationFromField' );
|
1740 |
+
var subjectField = this.model.get( 'emailNotificationSubjectField' );
|
1741 |
+
var nameField = this.model.get( 'emailNotificationFromNameField' ),
|
1742 |
+
option;
|
1743 |
+
|
1744 |
+
if ( fields.length >= 1 ) {
|
1745 |
+
fields.each( function( field ) {
|
1746 |
+
if ( 'email' === field.get( 'type' ) || 'dropdown' === field.get( 'type' ) || 'radio' === field.get( 'type' ) || 'single-line-text' === field.get( 'type' ) ) {
|
1747 |
+
option = document.createElement( 'option' );
|
1748 |
+
option.innerHTML = field.get( 'slug' );
|
1749 |
+
option.value = field.get( 'slug' );
|
1750 |
+
|
1751 |
+
if ( field.get( 'slug' ) === addressField ) {
|
1752 |
+
option.selected = true;
|
1753 |
+
}
|
1754 |
+
|
1755 |
+
emailNotificationFromField.appendChild( option );
|
1756 |
+
|
1757 |
+
addressFieldsAdded++;
|
1758 |
+
} if ( 'name' === field.get( 'type' ) || 'single-line-text' === field.get( 'type' ) || 'radio' === field.get( 'type' ) || 'dropdown' === field.get( 'type' ) ) {
|
1759 |
+
option = document.createElement( 'option' );
|
1760 |
+
option.innerHTML = field.get( 'slug' );
|
1761 |
+
option.value = field.get( 'slug' );
|
1762 |
+
|
1763 |
+
if ( field.get( 'slug' ) === nameField ) {
|
1764 |
+
option.selected = true;
|
1765 |
+
}
|
1766 |
+
|
1767 |
+
emailNotificationFromNameField.appendChild( option );
|
1768 |
+
|
1769 |
+
nameFieldsAdded++;
|
1770 |
+
} if ( 'single-line-text' === field.get( 'type' ) || 'radio' === field.get( 'type' ) || 'dropdown' === field.get( 'type' ) ) {
|
1771 |
+
// @Todo: add more applicable fields
|
1772 |
+
|
1773 |
+
option = document.createElement( 'option' );
|
1774 |
+
option.innerHTML = field.get( 'slug' );
|
1775 |
+
option.value = field.get( 'slug' );
|
1776 |
+
|
1777 |
+
if ( field.get( 'slug' ) === subjectField ) {
|
1778 |
+
option.selected = true;
|
1779 |
+
}
|
1780 |
+
|
1781 |
+
emailNotificationSubjectField.appendChild( option );
|
1782 |
+
|
1783 |
+
subjectFieldsAdded++;
|
1784 |
+
}
|
1785 |
+
});
|
1786 |
+
}
|
1787 |
+
|
1788 |
+
if ( 0 === addressFieldsAdded ) {
|
1789 |
+
option = document.createElement( 'option' );
|
1790 |
+
option.innerHTML = ccfSettings.noEmailFields;
|
1791 |
+
option.value = '';
|
1792 |
+
emailNotificationFromField.appendChild( option );
|
1793 |
+
emailNotificationFromField.disabled = true;
|
1794 |
+
}
|
1795 |
+
|
1796 |
+
if ( 0 === nameFieldsAdded ) {
|
1797 |
+
option = document.createElement( 'option' );
|
1798 |
+
option.innerHTML = ccfSettings.noNameFields;
|
1799 |
+
option.value = '';
|
1800 |
+
emailNotificationFromNameField.appendChild( option );
|
1801 |
+
emailNotificationFromNameField.disabled = true;
|
1802 |
+
}
|
1803 |
+
|
1804 |
+
if ( 0 === subjectFieldsAdded ) {
|
1805 |
+
option = document.createElement( 'option' );
|
1806 |
+
option.innerHTML = ccfSettings.noApplicableFields;
|
1807 |
+
option.value = '';
|
1808 |
+
emailNotificationSubjectField.appendChild( option );
|
1809 |
+
emailNotificationSubjectField.disabled = true;
|
1810 |
+
}
|
1811 |
+
},
|
1812 |
+
|
1813 |
+
toggleNotificationFields: function() {
|
1814 |
+
var i;
|
1815 |
+
|
1816 |
+
var emailNotificationFromAddress = this.el.querySelectorAll( '.email-notification-from-address' )[0];
|
1817 |
+
|
1818 |
+
var emailNotificationFromField = this.el.querySelectorAll( '.email-notification-from-field' )[0];
|
1819 |
+
|
1820 |
+
var emailNotificationFromType = this.el.querySelectorAll( '.form-email-notification-from-type' )[0];
|
1821 |
+
|
1822 |
+
var emailNotificationSubject = this.el.querySelectorAll( '.email-notification-subject' )[0];
|
1823 |
+
|
1824 |
+
var emailNotificationSubjectField = this.el.querySelectorAll( '.email-notification-subject-field' )[0];
|
1825 |
+
|
1826 |
+
var emailNotificationSubjectType = this.el.querySelectorAll( '.form-email-notification-subject-type' )[0];
|
1827 |
+
|
1828 |
+
var emailNotificationFromName = this.el.querySelectorAll( '.email-notification-from-name' )[0];
|
1829 |
+
|
1830 |
+
var emailNotificationFromNameField = this.el.querySelectorAll( '.email-notification-from-name-field' )[0];
|
1831 |
+
|
1832 |
+
var emailNotificationFromNameType = this.el.querySelectorAll( '.form-email-notification-from-name-type' )[0];
|
1833 |
+
|
1834 |
+
emailNotificationFromAddress.style.display = 'none';
|
1835 |
+
emailNotificationFromField.style.display = 'none';
|
1836 |
+
|
1837 |
+
if ( 'custom' === emailNotificationFromType.value ) {
|
1838 |
+
emailNotificationFromAddress.style.display = 'block';
|
1839 |
+
} else if ( 'field' === emailNotificationFromType.value ) {
|
1840 |
+
emailNotificationFromField.style.display = 'block';
|
1841 |
+
}
|
1842 |
+
|
1843 |
+
emailNotificationSubject.style.display = 'none';
|
1844 |
+
emailNotificationSubjectField.style.display = 'none';
|
1845 |
+
|
1846 |
+
if ( 'custom' === emailNotificationSubjectType.value ) {
|
1847 |
+
emailNotificationSubject.style.display = 'block';
|
1848 |
+
} else if ( 'field' === emailNotificationSubjectType.value ) {
|
1849 |
+
emailNotificationSubjectField.style.display = 'block';
|
1850 |
+
}
|
1851 |
+
|
1852 |
+
emailNotificationFromName.style.display = 'none';
|
1853 |
+
emailNotificationFromNameField.style.display = 'none';
|
1854 |
+
|
1855 |
+
if ( 'custom' === emailNotificationFromNameType.value ) {
|
1856 |
+
emailNotificationFromName.style.display = 'block';
|
1857 |
+
} else if ( 'field' === emailNotificationFromNameType.value ) {
|
1858 |
+
emailNotificationFromNameField.style.display = 'block';
|
1859 |
+
}
|
1860 |
+
},
|
1861 |
+
|
1862 |
+
save: function() {
|
1863 |
+
// @todo: fix this ie8 hack
|
1864 |
+
if ( this.el.innerHTML === '' ) {
|
1865 |
+
return;
|
1866 |
+
}
|
1867 |
+
|
1868 |
+
if ( 'edit' !== this.context ) {
|
1869 |
+
return;
|
1870 |
+
}
|
1871 |
+
|
1872 |
+
var emailNotificationTitle = this.el.querySelectorAll( '.form-email-notification-title' )[0].value;
|
1873 |
+
this.model.set( 'title', emailNotificationTitle );
|
1874 |
+
|
1875 |
+
var emailNotificationContent = this.el.querySelectorAll( '.form-email-notification-content' )[0].value;
|
1876 |
+
this.model.set( 'content', emailNotificationContent );
|
1877 |
+
|
1878 |
+
var emailNotificationActive = this.el.querySelectorAll( '.form-email-notification-active' )[0].value;
|
1879 |
+
this.model.set( 'active', ( '1' === emailNotificationActive ) ? true : false );
|
1880 |
+
|
1881 |
+
var emailNotificationFromType = this.el.querySelectorAll( '.form-email-notification-from-type' )[0].value;
|
1882 |
+
this.model.set( 'fromType', emailNotificationFromType );
|
1883 |
+
|
1884 |
+
var emailNotificationFromAddress = this.el.querySelectorAll( '.form-email-notification-from-address' )[0].value;
|
1885 |
+
this.model.set( 'fromAddress', emailNotificationFromAddress );
|
1886 |
+
|
1887 |
+
var emailNotificationFromField = this.el.querySelectorAll( '.form-email-notification-from-field' )[0].value;
|
1888 |
+
this.model.set( 'fromField', emailNotificationFromField );
|
1889 |
+
|
1890 |
+
var emailNotificationFromNameType = this.el.querySelectorAll( '.form-email-notification-from-name-type' )[0].value;
|
1891 |
+
this.model.set( 'fromNameType', emailNotificationFromNameType );
|
1892 |
+
|
1893 |
+
var emailNotificationFromName = this.el.querySelectorAll( '.form-email-notification-from-name' )[0].value;
|
1894 |
+
this.model.set( 'fromName', emailNotificationFromName );
|
1895 |
+
|
1896 |
+
var emailNotificationFromNameField = this.el.querySelectorAll( '.form-email-notification-from-name-field' )[0].value;
|
1897 |
+
this.model.set( 'fromNameField', emailNotificationFromNameField );
|
1898 |
+
|
1899 |
+
var emailNotificationSubjectType = this.el.querySelectorAll( '.form-email-notification-subject-type' )[0].value;
|
1900 |
+
this.model.set( 'subjectType', emailNotificationSubjectType );
|
1901 |
+
|
1902 |
+
var emailNotificationSubject = this.el.querySelectorAll( '.form-email-notification-subject' )[0].value;
|
1903 |
+
this.model.set( 'subject', emailNotificationSubject );
|
1904 |
+
|
1905 |
+
var emailNotificationSubjectField = this.el.querySelectorAll( '.form-email-notification-subject-field' )[0].value;
|
1906 |
+
this.model.set( 'subjectField', emailNotificationSubjectField );
|
1907 |
+
|
1908 |
+
for ( var i = 0; i < this.addressViews.length; i++ ) {
|
1909 |
+
this.addressViews[i].save();
|
1910 |
+
}
|
1911 |
+
|
1912 |
+
return this;
|
1913 |
+
|
1914 |
+
},
|
1915 |
+
|
1916 |
+
render: function() {
|
1917 |
+
var context = {
|
1918 |
+
context: this.context,
|
1919 |
+
form: this.form.toJSON()
|
1920 |
+
};
|
1921 |
+
|
1922 |
+
if ( this.model ) {
|
1923 |
+
context.notification = this.model.toJSON();
|
1924 |
+
}
|
1925 |
+
|
1926 |
+
this.el.innerHTML = this.template( context );
|
1927 |
+
|
1928 |
+
if ( 'edit' === this.context) {
|
1929 |
+
this.toggleNotificationFields();
|
1930 |
+
this.updateFromFieldField();
|
1931 |
+
this.updateFieldVariables();
|
1932 |
+
|
1933 |
+
var addressesContainer = this.el.querySelectorAll( '.addresses' )[0];
|
1934 |
+
var addresses = this.model.get( 'addresses' );
|
1935 |
+
|
1936 |
+
if ( addresses.length >= 1 ) {
|
1937 |
+
addresses.each( function( model ) {
|
1938 |
+
var address = new wp.ccf.views.FormNotificationAddress( { model: model, parent: this, notification: this.model, form: this.form } ).render();
|
1939 |
+
addressesContainer.appendChild( address.el );
|
1940 |
+
this.addressViews.push( address );
|
1941 |
+
}, this );
|
1942 |
+
} else {
|
1943 |
+
var newAddress = new wp.ccf.models.FormNotificationAddress();
|
1944 |
+
addresses.add( newAddress );
|
1945 |
+
}
|
1946 |
+
}
|
1947 |
+
|
1948 |
+
var fields = this.form.get( 'fields' );
|
1949 |
+
|
1950 |
+
this.listenTo( fields, 'add', this.updateFromFieldField, this );
|
1951 |
+
this.listenTo( fields, 'remove', this.updateFromFieldField, this );
|
1952 |
+
this.listenTo( fields, 'add', this.updateFieldVariables, this );
|
1953 |
+
this.listenTo( fields, 'remove', this.updateFieldVariables, this );
|
1954 |
+
|
1955 |
+
return this;
|
1956 |
+
},
|
1957 |
+
|
1958 |
+
triggerDelete: function() {
|
1959 |
+
this.parent.deleteNotification( this );
|
1960 |
+
}
|
1961 |
+
}
|
1962 |
+
);
|
1963 |
+
|
1964 |
+
wp.ccf.views.FieldBase = wp.ccf.views.FieldBase || Backbone.View.extend(
|
1965 |
+
{
|
1966 |
+
events: {
|
1967 |
+
'blur input': 'saveField',
|
1968 |
+
'blur input.field-slug': 'checkSlug',
|
1969 |
+
'blur textarea': 'saveField',
|
1970 |
+
'change select': 'saveField',
|
1971 |
+
'change input[type="checkbox"]': 'saveField'
|
1972 |
+
},
|
1973 |
+
|
1974 |
+
initialize: function() {
|
1975 |
+
var conditionals = this.model.get( 'conditionals' );
|
1976 |
+
this.listenTo( conditionals, 'add', this.addConditional );
|
1977 |
+
},
|
1978 |
+
|
1979 |
+
addConditional: function( model ) {
|
1980 |
+
var view = new wp.ccf.views.FieldConditional( { model: model, field: this.model, fieldCollection: this.collection } ).render();
|
1981 |
+
var conditionals = this.el.querySelectorAll( '.conditionals' )[0];
|
1982 |
+
|
1983 |
+
conditionals.appendChild( view.el );
|
1984 |
+
},
|
1985 |
+
|
1986 |
+
checkSlug: function() {
|
1987 |
+
var slugSelection = this.el.querySelectorAll( '.field-slug');
|
1988 |
+
|
1989 |
+
if ( slugSelection.length > 0 ) {
|
1990 |
+
var slug = slugSelection[0];
|
1991 |
+
var duplicate = false;
|
1992 |
+
|
1993 |
+
if ( slug.value && ! slug.value.match( /^[a-zA-Z0-9\-_]+$/ ) ) {
|
1994 |
+
slug.parentNode.className = slug.parentNode.className.replace( / field-error/i, '' ) + ' field-error';
|
1995 |
+
} else {
|
1996 |
+
slug.parentNode.className = slug.parentNode.className.replace( / field-error/i, '' );
|
1997 |
+
}
|
1998 |
+
|
1999 |
+
if ( this.collection.length > 0 && '' !== slug.value ) {
|
2000 |
+
this.collection.each( function( field ) {
|
2001 |
+
if ( field !== this.model && slug.value === field.get( 'slug' ) ) {
|
2002 |
+
duplicate = true;
|
2003 |
+
}
|
2004 |
+
}, this );
|
2005 |
+
|
2006 |
+
if ( duplicate ) {
|
2007 |
+
slug.parentNode.className = slug.parentNode.className.replace( / field-duplicate-slug/i, '' ) + ' field-duplicate-slug';
|
2008 |
+
} else {
|
2009 |
+
slug.parentNode.className = slug.parentNode.className.replace( / field-duplicate-slug/i, '' );
|
2010 |
+
}
|
2011 |
+
} else {
|
2012 |
+
slug.parentNode.className = slug.parentNode.className.replace( / field-duplicate-slug/i, '' );
|
2013 |
+
}
|
2014 |
+
}
|
2015 |
+
|
2016 |
+
},
|
2017 |
+
|
2018 |
+
destroy: function() {
|
2019 |
+
this.unbind();
|
2020 |
+
},
|
2021 |
+
|
2022 |
+
saveField: function() {
|
2023 |
+
var conditionals = this.el.querySelectorAll( '.conditionals' )[0].querySelectorAll( '.conditional' );
|
2024 |
+
|
2025 |
+
_.each( conditionals, function( conditional ) {
|
2026 |
+
$( conditional ).trigger( 'saveConditional' );
|
2027 |
+
});
|
2028 |
+
|
2029 |
+
this.model.set( 'conditionalType', this.el.querySelectorAll( '.field-conditional-type' )[0].value );
|
2030 |
+
this.model.set( 'conditionalFieldsRequired', this.el.querySelectorAll( '.field-conditional-fields-required' )[0].value );
|
2031 |
+
|
2032 |
+
var oldConditionals = this.model.get( 'conditionalsEnabled' );
|
2033 |
+
this.model.set( 'conditionalsEnabled', ( this.el.querySelectorAll( '.field-conditionals-enabled' )[0].value == 1 ) ? true : false );
|
2034 |
+
|
2035 |
+
if ( oldConditionals !== this.model.get( 'conditionalsEnabled' ) ) {
|
2036 |
+
this.render( 'advanced' );
|
2037 |
+
}
|
2038 |
+
},
|
2039 |
+
|
2040 |
+
render: function( startPanel ) {
|
2041 |
+
startPanel = ( startPanel ) ? startPanel : 'basic';
|
2042 |
+
|
2043 |
+
this.el.innerHTML = this.template( { field: this.model.toJSON(), startPanel: startPanel } );
|
2044 |
+
|
2045 |
+
this.checkSlug();
|
2046 |
+
|
2047 |
+
var conditionalsCollection = this.model.get( 'conditionals' );
|
2048 |
+
|
2049 |
+
var conditionals = this.el.querySelectorAll( '.conditionals' )[0];
|
2050 |
+
|
2051 |
+
if ( conditionalsCollection.length >= 1 ) {
|
2052 |
+
|
2053 |
+
conditionalsCollection.each( function( model ) {
|
2054 |
+
var view = new wp.ccf.views.FieldConditional( { model: model, field: this.model, fieldCollection: this.collection } ).render();
|
2055 |
+
conditionals.appendChild( view.el );
|
2056 |
+
}, this );
|
2057 |
+
} else {
|
2058 |
+
var conditional = new wp.ccf.models.FieldConditional();
|
2059 |
+
conditionalsCollection.add( conditional );
|
2060 |
+
}
|
2061 |
+
|
2062 |
+
return this;
|
2063 |
+
}
|
2064 |
+
}
|
2065 |
+
);
|
2066 |
+
|
2067 |
+
wp.ccf.views.Fields['single-line-text'] = wp.ccf.views.Fields['single-line-text'] || wp.ccf.views.FieldBase.extend(
|
2068 |
+
{
|
2069 |
+
template: wp.ccf.utils.template( 'ccf-single-line-text-template' ),
|
2070 |
+
|
2071 |
+
saveField: function() {
|
2072 |
+
// @todo: fix this ie8 hack
|
2073 |
+
if ( this.el.innerHTML === '' ) {
|
2074 |
+
return;
|
2075 |
+
}
|
2076 |
+
|
2077 |
+
this.model.set( 'slug', this.el.querySelectorAll( '.field-slug' )[0].value );
|
2078 |
+
this.model.set( 'label', this.el.querySelectorAll( '.field-label' )[0].value );
|
2079 |
+
this.model.set( 'description', this.el.querySelectorAll( '.field-description' )[0].value );
|
2080 |
+
this.model.set( 'value', this.el.querySelectorAll( '.field-value' )[0].value );
|
2081 |
+
this.model.set( 'placeholder', this.el.querySelectorAll( '.field-placeholder' )[0].value );
|
2082 |
+
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
2083 |
+
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
2084 |
+
|
2085 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
2086 |
+
|
2087 |
+
return this;
|
2088 |
+
}
|
2089 |
+
}
|
2090 |
+
);
|
2091 |
+
|
2092 |
+
wp.ccf.views.Fields.file = wp.ccf.views.Fields.file || wp.ccf.views.FieldBase.extend(
|
2093 |
+
{
|
2094 |
+
template: wp.ccf.utils.template( 'ccf-file-template' ),
|
2095 |
+
|
2096 |
+
saveField: function() {
|
2097 |
+
// @todo: fix this ie8 hack
|
2098 |
+
if ( this.el.innerHTML === '' ) {
|
2099 |
+
return;
|
2100 |
+
}
|
2101 |
+
|
2102 |
+
this.model.set( 'slug', this.el.querySelectorAll( '.field-slug' )[0].value );
|
2103 |
+
this.model.set( 'label', this.el.querySelectorAll( '.field-label' )[0].value );
|
2104 |
+
this.model.set( 'description', this.el.querySelectorAll( '.field-description' )[0].value );
|
2105 |
+
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
2106 |
+
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
2107 |
+
this.model.set( 'fileExtensions', this.el.querySelectorAll( '.field-file-extensions' )[0].value );
|
2108 |
+
this.model.set( 'maxFileSize', this.el.querySelectorAll( '.field-max-file-size' )[0].value );
|
2109 |
+
|
2110 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
2111 |
+
|
2112 |
+
return this;
|
2113 |
+
}
|
2114 |
+
}
|
2115 |
+
);
|
2116 |
+
|
2117 |
+
wp.ccf.views.Fields.recaptcha = wp.ccf.views.Fields.recaptcha || wp.ccf.views.FieldBase.extend(
|
2118 |
+
{
|
2119 |
+
template: wp.ccf.utils.template( 'ccf-recaptcha-template' ),
|
2120 |
+
|
2121 |
+
saveField: function() {
|
2122 |
+
// @todo: fix this ie8 hack
|
2123 |
+
if ( this.el.innerHTML === '' ) {
|
2124 |
+
return;
|
2125 |
+
}
|
2126 |
+
|
2127 |
+
this.model.set( 'label', this.el.querySelectorAll( '.field-label' )[0].value );
|
2128 |
+
this.model.set( 'description', this.el.querySelectorAll( '.field-description' )[0].value );
|
2129 |
+
this.model.set( 'siteKey', this.el.querySelectorAll( '.field-site-key' )[0].value );
|
2130 |
+
this.model.set( 'secretKey', this.el.querySelectorAll( '.field-secret-key' )[0].value );
|
2131 |
+
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
2132 |
+
|
2133 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
2134 |
+
|
2135 |
+
return this;
|
2136 |
+
}
|
2137 |
+
}
|
2138 |
+
);
|
2139 |
+
|
2140 |
+
wp.ccf.views.Fields['section-header'] = wp.ccf.views.Fields['section-header'] || wp.ccf.views.FieldBase.extend(
|
2141 |
+
{
|
2142 |
+
template: wp.ccf.utils.template( 'ccf-section-header-template' ),
|
2143 |
+
|
2144 |
+
saveField: function() {
|
2145 |
+
// @todo: fix this ie8 hack
|
2146 |
+
if ( this.el.innerHTML === '' ) {
|
2147 |
+
return;
|
2148 |
+
}
|
2149 |
+
|
2150 |
+
this.model.set( 'heading', this.el.querySelectorAll( '.field-heading' )[0].value );
|
2151 |
+
this.model.set( 'subheading', this.el.querySelectorAll( '.field-subheading' )[0].value );
|
2152 |
+
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
2153 |
+
|
2154 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
2155 |
+
|
2156 |
+
return this;
|
2157 |
+
}
|
2158 |
+
}
|
2159 |
+
);
|
2160 |
+
|
2161 |
+
wp.ccf.views.Fields.html = wp.ccf.views.Fields.html || wp.ccf.views.FieldBase.extend(
|
2162 |
+
{
|
2163 |
+
template: wp.ccf.utils.template( 'ccf-html-template' ),
|
2164 |
+
|
2165 |
+
saveField: function() {
|
2166 |
+
// @todo: fix this ie8 hack
|
2167 |
+
if ( this.el.innerHTML === '' ) {
|
2168 |
+
return;
|
2169 |
+
}
|
2170 |
+
|
2171 |
+
this.model.set( 'html', this.el.querySelectorAll( '.field-html' )[0].value );
|
2172 |
+
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
2173 |
+
|
2174 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
2175 |
+
|
2176 |
+
return this;
|
2177 |
+
}
|
2178 |
+
}
|
2179 |
+
);
|
2180 |
+
|
2181 |
+
wp.ccf.views.Fields['paragraph-text'] = wp.ccf.views.Fields['paragraph-text'] || wp.ccf.views.FieldBase.extend(
|
2182 |
+
{
|
2183 |
+
template: wp.ccf.utils.template( 'ccf-paragraph-text-template' ),
|
2184 |
+
|
2185 |
+
saveField: function() {
|
2186 |
+
// @todo: fix this ie8 hack
|
2187 |
+
if ( this.el.innerHTML === '' ) {
|
2188 |
+
return;
|
2189 |
+
}
|
2190 |
+
|
2191 |
+
this.model.set( 'slug', this.el.querySelectorAll( '.field-slug' )[0].value );
|
2192 |
+
this.model.set( 'label', this.el.querySelectorAll( '.field-label' )[0].value );
|
2193 |
+
this.model.set( 'description', this.el.querySelectorAll( '.field-description' )[0].value );
|
2194 |
+
this.model.set( 'value', this.el.querySelectorAll( '.field-value' )[0].value );
|
2195 |
+
this.model.set( 'placeholder', this.el.querySelectorAll( '.field-placeholder' )[0].value );
|
2196 |
+
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
2197 |
+
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
2198 |
+
|
2199 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
2200 |
+
|
2201 |
+
return this;
|
2202 |
+
}
|
2203 |
+
}
|
2204 |
+
);
|
2205 |
+
|
2206 |
+
wp.ccf.views.Fields.hidden = wp.ccf.views.Fields.hidden || wp.ccf.views.FieldBase.extend(
|
2207 |
+
{
|
2208 |
+
template: wp.ccf.utils.template( 'ccf-hidden-template' ),
|
2209 |
+
|
2210 |
+
saveField: function() {
|
2211 |
+
// @todo: fix this ie8 hack
|
2212 |
+
if ( this.el.innerHTML === '' ) {
|
2213 |
+
return;
|
2214 |
+
}
|
2215 |
+
|
2216 |
+
this.model.set( 'slug', this.el.querySelectorAll( '.field-slug' )[0].value );
|
2217 |
+
this.model.set( 'value', this.el.querySelectorAll( '.field-value' )[0].value );
|
2218 |
+
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
2219 |
+
|
2220 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
2221 |
+
|
2222 |
+
return this;
|
2223 |
+
}
|
2224 |
+
}
|
2225 |
+
);
|
2226 |
+
|
2227 |
+
wp.ccf.views.Fields.date = wp.ccf.views.Fields.date || wp.ccf.views.FieldBase.extend(
|
2228 |
+
{
|
2229 |
+
template: wp.ccf.utils.template( 'ccf-date-template' ),
|
2230 |
+
|
2231 |
+
saveField: function() {
|
2232 |
+
// @todo: fix this ie8 hack
|
2233 |
+
if ( this.el.innerHTML === '' ) {
|
2234 |
+
return;
|
2235 |
+
}
|
2236 |
+
|
2237 |
+
this.model.set( 'slug', this.el.querySelectorAll( '.field-slug' )[0].value );
|
2238 |
+
this.model.set( 'label', this.el.querySelectorAll( '.field-label' )[0].value );
|
2239 |
+
this.model.set( 'description', this.el.querySelectorAll( '.field-description' )[0].value );
|
2240 |
+
|
2241 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
2242 |
+
|
2243 |
+
var value = this.el.querySelectorAll( '.field-value' );
|
2244 |
+
if ( value.length > 0 ) {
|
2245 |
+
this.model.set( 'value', value[0].value );
|
2246 |
+
}
|
2247 |
+
|
2248 |
+
var dateFormat = this.el.querySelectorAll( '.field-date-format' );
|
2249 |
+
if ( dateFormat.length ) {
|
2250 |
+
this.model.set( 'dateFormat', dateFormat[0].value );
|
2251 |
+
}
|
2252 |
+
|
2253 |
+
var oldShowDate = this.model.get( 'showDate' );
|
2254 |
+
var showDate = ( this.el.querySelectorAll( '.field-show-date' )[0].checked ) ? true : false;
|
2255 |
+
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
2256 |
+
this.model.set( 'showDate', showDate );
|
2257 |
+
|
2258 |
+
var oldShowTime = this.model.get( 'showTime' );
|
2259 |
+
var showTime = ( this.el.querySelectorAll( '.field-show-time' )[0].checked ) ? true : false;
|
2260 |
+
|
2261 |
+
this.model.set( 'showTime', showTime );
|
2262 |
+
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
2263 |
+
|
2264 |
+
if ( showTime != oldShowTime || showDate != oldShowDate ) {
|
2265 |
+
this.render();
|
2266 |
+
}
|
2267 |
+
|
2268 |
+
return this;
|
2269 |
+
}
|
2270 |
+
}
|
2271 |
+
);
|
2272 |
+
|
2273 |
+
wp.ccf.views.Fields.name = wp.ccf.views.Fields.name || wp.ccf.views.FieldBase.extend(
|
2274 |
+
{
|
2275 |
+
template: wp.ccf.utils.template( 'ccf-name-template' ),
|
2276 |
+
|
2277 |
+
saveField: function() {
|
2278 |
+
// @todo: fix this ie8 hack
|
2279 |
+
if ( this.el.innerHTML === '' ) {
|
2280 |
+
return;
|
2281 |
+
}
|
2282 |
+
|
2283 |
+
this.model.set( 'slug', this.el.querySelectorAll( '.field-slug' )[0].value );
|
2284 |
+
this.model.set( 'label', this.el.querySelectorAll( '.field-label' )[0].value );
|
2285 |
+
this.model.set( 'description', this.el.querySelectorAll( '.field-description' )[0].value );
|
2286 |
+
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
2287 |
+
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
2288 |
+
|
2289 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
2290 |
+
|
2291 |
+
return this;
|
2292 |
+
}
|
2293 |
+
}
|
2294 |
+
);
|
2295 |
+
|
2296 |
+
wp.ccf.views.Fields.website = wp.ccf.views.Fields.website || wp.ccf.views.FieldBase.extend(
|
2297 |
+
{
|
2298 |
+
template: wp.ccf.utils.template( 'ccf-website-template' ),
|
2299 |
+
|
2300 |
+
saveField: function() {
|
2301 |
+
// @todo: fix this ie8 hack
|
2302 |
+
if ( this.el.innerHTML === '' ) {
|
2303 |
+
return;
|
2304 |
+
}
|
2305 |
+
|
2306 |
+
this.model.set( 'slug', this.el.querySelectorAll( '.field-slug' )[0].value );
|
2307 |
+
this.model.set( 'label', this.el.querySelectorAll( '.field-label' )[0].value );
|
2308 |
+
this.model.set( 'description', this.el.querySelectorAll( '.field-description' )[0].value );
|
2309 |
+
this.model.set( 'value', this.el.querySelectorAll( '.field-value' )[0].value );
|
2310 |
+
this.model.set( 'placeholder', this.el.querySelectorAll( '.field-placeholder' )[0].value );
|
2311 |
+
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
2312 |
+
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
2313 |
+
|
2314 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
2315 |
+
|
2316 |
+
return this;
|
2317 |
+
}
|
2318 |
+
}
|
2319 |
+
);
|
2320 |
+
|
2321 |
+
wp.ccf.views.Fields.phone = wp.ccf.views.Fields.phone || wp.ccf.views.FieldBase.extend(
|
2322 |
+
{
|
2323 |
+
template: wp.ccf.utils.template( 'ccf-phone-template' ),
|
2324 |
+
|
2325 |
+
saveField: function() {
|
2326 |
+
// @todo: fix this ie8 hack
|
2327 |
+
if ( this.el.innerHTML === '' ) {
|
2328 |
+
return;
|
2329 |
+
}
|
2330 |
+
|
2331 |
+
this.model.set( 'slug', this.el.querySelectorAll( '.field-slug' )[0].value );
|
2332 |
+
this.model.set( 'label', this.el.querySelectorAll( '.field-label' )[0].value );
|
2333 |
+
this.model.set( 'description', this.el.querySelectorAll( '.field-description' )[0].value );
|
2334 |
+
this.model.set( 'value', this.el.querySelectorAll( '.field-value' )[0].value );
|
2335 |
+
this.model.set( 'placeholder', this.el.querySelectorAll( '.field-placeholder' )[0].value );
|
2336 |
+
this.model.set( 'phoneFormat', this.el.querySelectorAll( '.field-phone-format' )[0].value );
|
2337 |
+
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
2338 |
+
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
2339 |
+
|
2340 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
2341 |
+
|
2342 |
+
return this;
|
2343 |
+
}
|
2344 |
+
}
|
2345 |
+
);
|
2346 |
+
|
2347 |
+
wp.ccf.views.Fields.address = wp.ccf.views.Fields.address || wp.ccf.views.FieldBase.extend(
|
2348 |
+
{
|
2349 |
+
template: wp.ccf.utils.template( 'ccf-address-template' ),
|
2350 |
+
|
2351 |
+
saveField: function() {
|
2352 |
+
// @todo: fix this ie8 hack
|
2353 |
+
if ( this.el.innerHTML === '' ) {
|
2354 |
+
return;
|
2355 |
+
}
|
2356 |
+
|
2357 |
+
this.model.set( 'slug', this.el.querySelectorAll( '.field-slug' )[0].value );
|
2358 |
+
this.model.set( 'label', this.el.querySelectorAll( '.field-label' )[0].value );
|
2359 |
+
this.model.set( 'description', this.el.querySelectorAll( '.field-description' )[0].value );
|
2360 |
+
this.model.set( 'addressType', this.el.querySelectorAll( '.field-address-type' )[0].value );
|
2361 |
+
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
2362 |
+
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
2363 |
+
|
2364 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
2365 |
+
|
2366 |
+
return this;
|
2367 |
+
}
|
2368 |
+
}
|
2369 |
+
);
|
2370 |
+
|
2371 |
+
wp.ccf.views.Fields.email = wp.ccf.views.Fields.email || wp.ccf.views.FieldBase.extend(
|
2372 |
+
{
|
2373 |
+
template: wp.ccf.utils.template( 'ccf-email-template' ),
|
2374 |
+
|
2375 |
+
saveField: function() {
|
2376 |
+
// @todo: fix this ie8 hack
|
2377 |
+
if ( this.el.innerHTML === '' ) {
|
2378 |
+
return;
|
2379 |
+
}
|
2380 |
+
|
2381 |
+
this.model.set( 'slug', this.el.querySelectorAll( '.field-slug' )[0].value );
|
2382 |
+
this.model.set( 'label', this.el.querySelectorAll( '.field-label' )[0].value );
|
2383 |
+
this.model.set( 'description', this.el.querySelectorAll( '.field-description' )[0].value );
|
2384 |
+
|
2385 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
2386 |
+
|
2387 |
+
var value = this.el.querySelectorAll( '.field-value' );
|
2388 |
+
if ( value.length ) {
|
2389 |
+
this.model.set( 'value', value[0].value );
|
2390 |
+
}
|
2391 |
+
|
2392 |
+
var placeholder = this.el.querySelectorAll( '.field-placeholder' );
|
2393 |
+
if ( placeholder.length ) {
|
2394 |
+
this.model.set( 'placeholder', placeholder[0].value );
|
2395 |
+
}
|
2396 |
+
|
2397 |
+
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
2398 |
+
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
2399 |
+
|
2400 |
+
var emailConfirmation = ( this.el.querySelectorAll( '.field-email-confirmation' )[0].value == 1 ) ? true : false;
|
2401 |
+
var oldEmailConfirmation = this.model.get( 'emailConfirmation' );
|
2402 |
+
|
2403 |
+
this.model.set( 'emailConfirmation', emailConfirmation );
|
2404 |
+
|
2405 |
+
if ( oldEmailConfirmation != emailConfirmation ) {
|
2406 |
+
this.render();
|
2407 |
+
}
|
2408 |
+
|
2409 |
+
return this;
|
2410 |
+
}
|
2411 |
+
}
|
2412 |
+
);
|
2413 |
+
|
2414 |
+
wp.ccf.views.ChoiceableField = wp.ccf.views.ChoiceableField || wp.ccf.views.FieldBase.extend(
|
2415 |
+
{
|
2416 |
+
template: wp.ccf.utils.template( 'ccf-dropdown-template' ),
|
2417 |
+
|
2418 |
+
initialize: function() {
|
2419 |
+
var choices = this.model.get( 'choices' );
|
2420 |
+
this.listenTo( choices, 'add', this.addChoice );
|
2421 |
+
},
|
2422 |
+
|
2423 |
+
addChoice: function( model ) {
|
2424 |
+
var view = new wp.ccf.views.FieldChoice( { model: model, field: this.model } ).render();
|
2425 |
+
var choices = this.el.querySelectorAll( '.repeatable-choices' )[0];
|
2426 |
+
|
2427 |
+
choices.appendChild( view.el );
|
2428 |
+
},
|
2429 |
+
|
2430 |
+
saveField: function() {
|
2431 |
+
// @todo: fix this ie8 hack
|
2432 |
+
if ( this.el.innerHTML === '' ) {
|
2433 |
+
return;
|
2434 |
+
}
|
2435 |
+
|
2436 |
+
this.model.set( 'slug', this.el.querySelectorAll( '.field-slug' )[0].value );
|
2437 |
+
this.model.set( 'label', this.el.querySelectorAll( '.field-label' )[0].value );
|
2438 |
+
this.model.set( 'description', this.el.querySelectorAll( '.field-description' )[0].value );
|
2439 |
+
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
2440 |
+
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
2441 |
+
|
2442 |
+
wp.ccf.views.ChoiceableField.__super__.saveField.apply( this, arguments );
|
2443 |
+
|
2444 |
+
var choices = this.el.querySelectorAll( '.repeatable-choices' )[0].querySelectorAll( '.choice' );
|
2445 |
+
|
2446 |
+
_.each( choices, function( choice ) {
|
2447 |
+
$( choice ).trigger( 'saveChoice' );
|
2448 |
+
});
|
2449 |
+
|
2450 |
+
return this;
|
2451 |
+
|
2452 |
+
},
|
2453 |
+
|
2454 |
+
render: function( startPanel ) {
|
2455 |
+
var SELF = this;
|
2456 |
+
|
2457 |
+
startPanel = ( startPanel ) ? startPanel : 'basic';
|
2458 |
+
|
2459 |
+
SELF.el.innerHTML = SELF.template( { field: SELF.model.toJSON(), startPanel: startPanel } );
|
2460 |
+
|
2461 |
+
SELF.checkSlug();
|
2462 |
+
|
2463 |
+
var choicesCollection = SELF.model.get( 'choices' );
|
2464 |
+
|
2465 |
+
var choices = this.el.querySelectorAll( '.repeatable-choices' )[0];
|
2466 |
+
|
2467 |
+
if ( choicesCollection.length >= 1 ) {
|
2468 |
+
|
2469 |
+
choicesCollection.each( function( model ) {
|
2470 |
+
var view = new wp.ccf.views.FieldChoice( { model: model, field: SELF.model } ).render();
|
2471 |
+
choices.appendChild( view.el );
|
2472 |
+
});
|
2473 |
+
} else {
|
2474 |
+
var choice = new wp.ccf.models.FieldChoice();
|
2475 |
+
choicesCollection.add( choice );
|
2476 |
+
}
|
2477 |
+
|
2478 |
+
choices = this.el.querySelectorAll( '.repeatable-choices' )[0];
|
2479 |
+
|
2480 |
+
$( choices ).sortable( {
|
2481 |
+
handle: '.move',
|
2482 |
+
axis: 'y',
|
2483 |
+
stop: function( event, $ui ) {
|
2484 |
+
$ui.item.trigger( 'sorted', $ui.item.index() );
|
2485 |
+
}
|
2486 |
+
});
|
2487 |
+
|
2488 |
+
var conditionalsCollection = this.model.get( 'conditionals' );
|
2489 |
+
|
2490 |
+
var conditionals = this.el.querySelectorAll( '.conditionals' )[0];
|
2491 |
+
|
2492 |
+
if ( conditionalsCollection.length >= 1 ) {
|
2493 |
+
|
2494 |
+
conditionalsCollection.each( function( model ) {
|
2495 |
+
var view = new wp.ccf.views.FieldConditional( { model: model, field: this.model, fieldCollection: this.collection } ).render();
|
2496 |
+
conditionals.appendChild( view.el );
|
2497 |
+
}, this );
|
2498 |
+
} else {
|
2499 |
+
var conditional = new wp.ccf.models.FieldConditional();
|
2500 |
+
conditionalsCollection.add( conditional );
|
2501 |
+
}
|
2502 |
+
|
2503 |
+
return SELF;
|
2504 |
+
}
|
2505 |
+
}
|
2506 |
+
);
|
2507 |
+
|
2508 |
+
wp.ccf.views.Fields.dropdown = wp.ccf.views.Fields.dropdown || wp.ccf.views.ChoiceableField.extend(
|
2509 |
+
{
|
2510 |
+
template: wp.ccf.utils.template( 'ccf-dropdown-template' ),
|
2511 |
+
events: function() {
|
2512 |
+
return this.constructor.__super__.events;
|
2513 |
+
}
|
2514 |
+
}
|
2515 |
+
);
|
2516 |
+
|
2517 |
+
wp.ccf.views.Fields.radio = wp.ccf.views.Fields.radio || wp.ccf.views.ChoiceableField.extend(
|
2518 |
+
{
|
2519 |
+
template: wp.ccf.utils.template( 'ccf-radio-template' ),
|
2520 |
+
events: function() {
|
2521 |
+
return this.constructor.__super__.events;
|
2522 |
+
}
|
2523 |
+
}
|
2524 |
+
);
|
2525 |
+
|
2526 |
+
wp.ccf.views.Fields.checkboxes = wp.ccf.views.Fields.checkboxes || wp.ccf.views.ChoiceableField.extend(
|
2527 |
+
{
|
2528 |
+
template: wp.ccf.utils.template( 'ccf-checkboxes-template' ),
|
2529 |
+
events: function() {
|
2530 |
+
return this.constructor.__super__.events;
|
2531 |
+
}
|
2532 |
+
}
|
2533 |
+
);
|
2534 |
+
|
2535 |
+
wp.ccf.views.FieldSidebar = wp.ccf.views.FieldSidebar || Backbone.View.extend(
|
2536 |
+
{
|
2537 |
+
initialize: function( options ) {
|
2538 |
+
this.currentFieldView = null;
|
2539 |
+
this.form = options.form;
|
2540 |
+
},
|
2541 |
+
|
2542 |
+
save: function( $promise ) {
|
2543 |
+
if ( this.currentFieldView ) {
|
2544 |
+
|
2545 |
+
// @todo: fix this ie8 hack
|
2546 |
+
if ( this.currentFieldView.el.innerHTML !== '' ) {
|
2547 |
+
this.currentFieldView.saveField();
|
2548 |
+
}
|
2549 |
+
}
|
2550 |
+
|
2551 |
+
if ( $promise && $promise instanceof Object ) {
|
2552 |
+
$promise.resolve();
|
2553 |
+
}
|
2554 |
+
},
|
2555 |
+
|
2556 |
+
fieldRemoved: function() {
|
2557 |
+
if ( this.currentFieldView ) {
|
2558 |
+
if ( ! this.form.get( 'fields' ).get( this.currentFieldView.model ) ) {
|
2559 |
+
this.render();
|
2560 |
+
}
|
2561 |
+
}
|
2562 |
+
},
|
2563 |
+
|
2564 |
+
destroy: function() {
|
2565 |
+
wp.ccf.dispatcher.off( 'saveField', this.save );
|
2566 |
+
wp.ccf.dispatcher.off( 'mainViewChange', this.save );
|
2567 |
+
this.unbind();
|
2568 |
+
},
|
2569 |
+
|
2570 |
+
render: function( field ) {
|
2571 |
+
var context = {};
|
2572 |
+
|
2573 |
+
if ( ! field ) {
|
2574 |
+
var template = wp.ccf.utils.template( 'ccf-empty-field-template' );
|
2575 |
+
this.el.innerHTML = template( context );
|
2576 |
+
} else {
|
2577 |
+
var type = field.get( 'type' );
|
2578 |
+
|
2579 |
+
if ( this.currentFieldView ) {
|
2580 |
+
this.currentFieldView.saveField();
|
2581 |
+
|
2582 |
+
if ( this.currentFieldView.destroy ) {
|
2583 |
+
this.currentFieldView.destroy();
|
2584 |
+
}
|
2585 |
+
}
|
2586 |
+
|
2587 |
+
this.currentFieldView = new wp.ccf.views.Fields[type]( { model: field, collection: this.form.get( 'fields' ) } );
|
2588 |
+
|
2589 |
+
this.currentFieldView.render();
|
2590 |
+
|
2591 |
+
this.el.innerHTML = '';
|
2592 |
+
|
2593 |
+
this.el.appendChild( this.currentFieldView.el );
|
2594 |
+
|
2595 |
+
var fields = this.form.get( 'fields' );
|
2596 |
+
this.listenTo( fields, 'remove', this.fieldRemoved );
|
2597 |
+
}
|
2598 |
+
|
2599 |
+
wp.ccf.dispatcher.on( 'saveField', this.save, this );
|
2600 |
+
wp.ccf.dispatcher.on( 'mainViewChange', this.save, this );
|
2601 |
+
|
2602 |
+
return this;
|
2603 |
+
}
|
2604 |
+
}
|
2605 |
+
);
|
2606 |
+
|
2607 |
+
wp.ccf.views.FieldRowPlaceholder = wp.ccf.views.FieldRowPlaceholder || Backbone.View.extend(
|
2608 |
+
{
|
2609 |
+
template: wp.ccf.utils.template( 'ccf-field-row-template'),
|
2610 |
+
tagName: 'div',
|
2611 |
+
className: 'field',
|
2612 |
+
|
2613 |
+
initialize: function( options ) {
|
2614 |
+
this.type = options.type;
|
2615 |
+
},
|
2616 |
+
|
2617 |
+
render: function() {
|
2618 |
+
this.el.innerHTML = this.template( { label: ccfSettings.allLabels[this.type] } );
|
2619 |
+
|
2620 |
+
this.el.setAttribute( 'data-field-type', this.type );
|
2621 |
+
this.el.className += ' ' + this.type;
|
2622 |
+
|
2623 |
+
return this;
|
2624 |
+
}
|
2625 |
+
}
|
2626 |
+
);
|
2627 |
+
|
2628 |
+
wp.ccf.views.FieldRow = wp.ccf.views.FieldRow || Backbone.View.extend(
|
2629 |
+
{
|
2630 |
+
template: wp.ccf.utils.template( 'ccf-field-row-template'),
|
2631 |
+
tagName: 'div',
|
2632 |
+
className: 'field',
|
2633 |
+
|
2634 |
+
events: {
|
2635 |
+
'click .delete': 'triggerDelete',
|
2636 |
+
'click h4': 'triggerEdit',
|
2637 |
+
'sorted': 'triggerUpdateSort'
|
2638 |
+
},
|
2639 |
+
|
2640 |
+
initialize: function( options ) {
|
2641 |
+
_.bindAll( this, 'triggerDelete' );
|
2642 |
+
this.form = options.form;
|
2643 |
+
|
2644 |
+
this.listenTo( this.model, 'change', this.handleChange, this );
|
2645 |
+
this.listenTo( this.model, 'requirementsNotMet', this.requirementsNotMet, this );
|
2646 |
+
this.listenTo( this.model, 'requirementsMet', this.requirementsMet, this );
|
2647 |
+
this.listenTo( this.model, 'duplicateSlug', this.duplicateSlug, this );
|
2648 |
+
|
2649 |
+
if ( this.model.attributes.choices ) {
|
2650 |
+
this.listenTo( this.model.attributes.choices, 'change', this.handleChange, this );
|
2651 |
+
}
|
2652 |
+
},
|
2653 |
+
|
2654 |
+
duplicateSlug: function() {
|
2655 |
+
this.requirementsMet();
|
2656 |
+
this.el.className += ' field-duplicate-slug';
|
2657 |
+
},
|
2658 |
+
|
2659 |
+
requirementsNotMet: function() {
|
2660 |
+
this.requirementsMet();
|
2661 |
+
this.el.className += ' field-incomplete';
|
2662 |
+
},
|
2663 |
+
|
2664 |
+
requirementsMet: function() {
|
2665 |
+
this.el.className = this.el.className.replace( /(field-incomplete|field-duplicate-slug)/i, '' );
|
2666 |
+
},
|
2667 |
+
|
2668 |
+
triggerUpdateSort: function( event, index ) {
|
2669 |
+
this.form.get( 'fields' ).remove( this.model );
|
2670 |
+
|
2671 |
+
this.form.get( 'fields' ).add( this.model, { at: index } );
|
2672 |
+
},
|
2673 |
+
|
2674 |
+
handleChange: function( event ) {
|
2675 |
+
this.render();
|
2676 |
+
},
|
2677 |
+
|
2678 |
+
triggerDelete: function( event ) {
|
2679 |
+
event.stopPropagation();
|
2680 |
+
|
2681 |
+
this.form.get( 'fields' ).remove( this.model );
|
2682 |
+
this.undelegateEvents();
|
2683 |
+
this.remove();
|
2684 |
+
},
|
2685 |
+
|
2686 |
+
triggerEdit: function( event ) {
|
2687 |
+
var editing = this.el.parentNode.querySelectorAll( '.ccf-editing' );
|
2688 |
+
_.each( editing, function( node ) {
|
2689 |
+
node.className = node.className.replace( /ccf-editing/i, '' );
|
2690 |
+
});
|
2691 |
+
|
2692 |
+
this.el.className = this.el.className.replace( /ccf-editing/i, '' ) + ' ccf-editing';
|
2693 |
+
wp.ccf.dispatcher.trigger( 'openEditField', this.model );
|
2694 |
+
},
|
2695 |
+
|
2696 |
+
render: function( instantiate ) {
|
2697 |
+
this.el.innerHTML = this.template( { label: ccfSettings.allLabels[this.model.get( 'type' )] } );
|
2698 |
+
|
2699 |
+
this.el.setAttribute( 'data-field-type', this.model.get( 'type' ) );
|
2700 |
+
|
2701 |
+
var regex = new RegExp( ' ' + this.model.get( 'type' ), 'i' );
|
2702 |
+
|
2703 |
+
this.el.className = this.el.className.replace( regex, '' ) + ' ' + this.model.get( 'type' );
|
2704 |
+
|
2705 |
+
if ( instantiate ) {
|
2706 |
+
this.el.className = this.el.className.replace( / instantiated/i, '' ) + ' instantiated';
|
2707 |
+
}
|
2708 |
+
|
2709 |
+
var previewTemplate = document.getElementById( 'ccf-' + this.model.get( 'type' ) + '-preview-template' );
|
2710 |
+
|
2711 |
+
if ( previewTemplate ) {
|
2712 |
+
var preview = this.el.querySelectorAll( '.preview' )[0];
|
2713 |
+
preview.style.display = 'block';
|
2714 |
+
preview.innerHTML = wp.ccf.utils.template( 'ccf-' + this.model.get( 'type' ) + '-preview-template' )( { field: this.model.toJSON() } );
|
2715 |
+
}
|
2716 |
+
|
2717 |
+
return this;
|
2718 |
+
}
|
2719 |
+
}
|
2720 |
+
);
|
2721 |
+
|
2722 |
+
wp.ccf.views.PostFieldMapping = Backbone.View.extend(
|
2723 |
+
{
|
2724 |
+
template: wp.ccf.utils.template( 'ccf-post-field-mapping' ),
|
2725 |
+
className: 'field-mapping',
|
2726 |
+
|
2727 |
+
events: {
|
2728 |
+
'click .add': 'triggerAdd',
|
2729 |
+
'click .delete': 'triggerDelete',
|
2730 |
+
'blur input': 'save',
|
2731 |
+
'change select': 'save'
|
2732 |
+
},
|
2733 |
+
|
2734 |
+
initialize: function( options ) {
|
2735 |
+
this.parent = options.parent;
|
2736 |
+
this.form = options.form;
|
2737 |
+
},
|
2738 |
+
|
2739 |
+
destroy: function() {
|
2740 |
+
this.unbind();
|
2741 |
+
},
|
2742 |
+
|
2743 |
+
save: function() {
|
2744 |
+
// @todo: fix this ie8 hack
|
2745 |
+
if ( this.el.innerHTML === '' ) {
|
2746 |
+
return;
|
2747 |
+
}
|
2748 |
+
|
2749 |
+
var formField = this.el.querySelectorAll( '.field-form-field' )[0].value;
|
2750 |
+
var postField = this.el.querySelectorAll( '.field-post-field' )[0].value;
|
2751 |
+
var customFieldKey = this.el.querySelectorAll( '.field-custom-field-key' );
|
2752 |
+
|
2753 |
+
var oldPostField = this.model.get( 'postField' );
|
2754 |
+
|
2755 |
+
this.model.set( 'formField', formField );
|
2756 |
+
this.model.set( 'postField', postField );
|
2757 |
+
|
2758 |
+
if ( customFieldKey.length ) {
|
2759 |
+
this.model.set( 'customFieldKey', customFieldKey[0].value );
|
2760 |
+
}
|
2761 |
+
|
2762 |
+
if ( oldPostField !== postField ) {
|
2763 |
+
this.render();
|
2764 |
+
}
|
2765 |
+
|
2766 |
+
return this;
|
2767 |
+
|
2768 |
+
},
|
2769 |
+
|
2770 |
+
updateFormFieldField: function() {
|
2771 |
+
var fieldFormField = this.el.querySelectorAll( '.field-form-field' )[0];
|
2772 |
+
fieldFormField.innerHTML = '';
|
2773 |
+
fieldFormField.disabled = false;
|
2774 |
+
|
2775 |
+
var fields = this.form.get( 'fields' ),
|
2776 |
+
fieldsAdded = 0;
|
2777 |
+
|
2778 |
+
var formField = this.model.get( 'formField' ),
|
2779 |
+
option;
|
2780 |
+
|
2781 |
+
if ( fields.length >= 1 ) {
|
2782 |
+
option = document.createElement( 'option' );
|
2783 |
+
option.innerHTML = ccfSettings.chooseFormField;
|
2784 |
+
option.value = '';
|
2785 |
+
|
2786 |
+
fieldFormField.appendChild( option );
|
2787 |
+
|
2788 |
+
fields.each( function( field ) {
|
2789 |
+
option = document.createElement( 'option' );
|
2790 |
+
option.innerHTML = field.get( 'slug' );
|
2791 |
+
option.value = field.get( 'slug' );
|
2792 |
+
|
2793 |
+
if ( field.get( 'slug' ) === formField ) {
|
2794 |
+
option.selected = true;
|
2795 |
+
}
|
2796 |
+
|
2797 |
+
fieldFormField.appendChild( option );
|
2798 |
+
|
2799 |
+
fieldsAdded++;
|
2800 |
+
});
|
2801 |
+
}
|
2802 |
+
|
2803 |
+
if ( 0 === fieldsAdded ) {
|
2804 |
+
option = document.createElement( 'option' );
|
2805 |
+
option.innerHTML = ccfSettings.noAvailableFields;
|
2806 |
+
option.value = '';
|
2807 |
+
fieldFormField.appendChild( option );
|
2808 |
+
fieldFormField.disabled = true;
|
2809 |
+
}
|
2810 |
+
},
|
2811 |
+
|
2812 |
+
updatePostFields: function() {
|
2813 |
+
var dropdown = this.el.querySelectorAll( '.field-post-field' )[0],
|
2814 |
+
option;
|
2815 |
+
|
2816 |
+
option = document.createElement( 'option' );
|
2817 |
+
option.value = '';
|
2818 |
+
option.innerText = ccfSettings.choosePostField;
|
2819 |
+
dropdown.appendChild( option );
|
2820 |
+
|
2821 |
+
var mappings = this.form.get( 'postFieldMappings' );
|
2822 |
+
var usedFields = [];
|
2823 |
+
|
2824 |
+
mappings.each( function( model ) {
|
2825 |
+
if ( model !== this.model ) {
|
2826 |
+
usedFields.push( model.get( 'postField' ) );
|
2827 |
+
}
|
2828 |
+
}, this );
|
2829 |
+
|
2830 |
+
_.each( ccfSettings.postFields.single, function( field, slug ) {
|
2831 |
+
if ( -1 === usedFields.indexOf( slug ) ) {
|
2832 |
+
option = document.createElement( 'option' );
|
2833 |
+
option.value = slug;
|
2834 |
+
option.innerText = field;
|
2835 |
+
|
2836 |
+
if ( this.model.get( 'postField' ) === slug ) {
|
2837 |
+
option.selected = true;
|
2838 |
+
}
|
2839 |
+
|
2840 |
+
dropdown.appendChild( option );
|
2841 |
+
}
|
2842 |
+
}, this );
|
2843 |
+
|
2844 |
+
_.each( ccfSettings.postFields.repeatable, function( field, slug ) {
|
2845 |
+
|
2846 |
+
option = document.createElement( 'option' );
|
2847 |
+
option.value = slug;
|
2848 |
+
option.innerText = field;
|
2849 |
+
|
2850 |
+
if ( this.model.get( 'postField' ) === slug ) {
|
2851 |
+
option.selected = true;
|
2852 |
+
}
|
2853 |
+
|
2854 |
+
dropdown.appendChild( option );
|
2855 |
+
|
2856 |
+
}, this );
|
2857 |
+
},
|
2858 |
+
|
2859 |
+
render: function() {
|
2860 |
+
var context = {};
|
2861 |
+
if ( this.model ) {
|
2862 |
+
context.mapping = this.model.toJSON();
|
2863 |
+
}
|
2864 |
+
|
2865 |
+
this.el.innerHTML = this.template( context );
|
2866 |
+
|
2867 |
+
var fields = this.form.get( 'fields' );
|
2868 |
+
|
2869 |
+
this.listenTo( fields, 'add', this.updateFormFieldField, this );
|
2870 |
+
this.listenTo( fields, 'remove', this.updateFormFieldField, this );
|
2871 |
+
|
2872 |
+
this.updateFormFieldField();
|
2873 |
+
this.updatePostFields();
|
2874 |
+
|
2875 |
+
return this;
|
2876 |
+
},
|
2877 |
+
|
2878 |
+
triggerAdd: function() {
|
2879 |
+
this.form.get( 'postFieldMappings' ).add( new wp.ccf.models.PostFieldMapping() );
|
2880 |
+
},
|
2881 |
+
|
2882 |
+
triggerDelete: function() {
|
2883 |
+
var mappings = this.form.get( 'postFieldMappings' );
|
2884 |
+
|
2885 |
+
if ( mappings.length > 1 ) {
|
2886 |
+
this.parent.deletePostFieldMapping( this );
|
2887 |
+
} else {
|
2888 |
+
this.model.clear().set( wp.ccf.models.PostFieldMapping.prototype.defaults );
|
2889 |
+
this.destroy();
|
2890 |
+
this.render();
|
2891 |
+
}
|
2892 |
+
}
|
2893 |
+
}
|
2894 |
+
);
|
2895 |
+
|
2896 |
+
wp.ccf.views.FormSettings = wp.ccf.views.FormSettings || Backbone.View.extend(
|
2897 |
+
{
|
2898 |
+
template: wp.ccf.utils.template( 'ccf-form-settings-template' ),
|
2899 |
+
|
2900 |
+
events: {
|
2901 |
+
'blur input': 'save',
|
2902 |
+
'change select': 'save',
|
2903 |
+
'change select.form-completion-action-type': 'toggleCompletionFields',
|
2904 |
+
'change select.form-pause': 'togglePauseFields',
|
2905 |
+
'change select.form-post-creation': 'togglePostCreationFields',
|
2906 |
+
'click .add-notification': 'triggerAddNotification'
|
2907 |
+
},
|
2908 |
+
|
2909 |
+
notificationViews: [],
|
2910 |
+
mappingViews: [],
|
2911 |
+
|
2912 |
+
initialize: function( options ) {
|
2913 |
+
this.model = options.form;
|
2914 |
+
this.notificationViews = [];
|
2915 |
+
this.mappingViews = [];
|
2916 |
+
|
2917 |
+
var notifications = this.model.get( 'notifications' );
|
2918 |
+
this.listenTo( notifications, 'add', this.addNotification );
|
2919 |
+
|
2920 |
+
var mappings = this.model.get( 'postFieldMappings' );
|
2921 |
+
this.listenTo( mappings, 'add', this.addPostFieldMapping );
|
2922 |
+
},
|
2923 |
+
|
2924 |
+
deletePostFieldMapping: function( view ) {
|
2925 |
+
_.each( this.mappingViews, function( currentView ) {
|
2926 |
+
if ( view.cid === currentView.cid ) {
|
2927 |
+
var index = _.indexOf( this.mappingViews, currentView );
|
2928 |
+
this.model.get( 'postFieldMappings' ).remove( view.model );
|
2929 |
+
this.mappingViews[index].remove();
|
2930 |
+
this.mappingViews.splice( index, 1 );
|
2931 |
+
}
|
2932 |
+
}, this );
|
2933 |
+
},
|
2934 |
+
|
2935 |
+
addPostFieldMapping: function( model ) {
|
2936 |
+
var mappingContainer = this.el.querySelectorAll( '.post-creation-mapping' )[0];
|
2937 |
+
var view = new wp.ccf.views.PostFieldMapping( { model: model, parent: this, form: this.model } );
|
2938 |
+
this.mappingViews.push( view );
|
2939 |
+
mappingContainer.appendChild( view.render().el );
|
2940 |
+
},
|
2941 |
+
|
2942 |
+
triggerAddNotification: function() {
|
2943 |
+
var notifications = this.model.get( 'notifications' );
|
2944 |
+
|
2945 |
+
notifications.add( new wp.ccf.models.FormNotification() );
|
2946 |
+
},
|
2947 |
+
|
2948 |
+
closeAllNotifications: function() {
|
2949 |
+
_.each( this.notificationViews, function( view ) {
|
2950 |
+
view.changeContext( null, 'view' );
|
2951 |
+
} );
|
2952 |
+
},
|
2953 |
+
|
2954 |
+
addNotification: function( model ) {
|
2955 |
+
var view = new wp.ccf.views.ExistingFormNotificationRow( { model: model, form: this.model, context: 'edit', parent: this } ).render();
|
2956 |
+
var rowContainer = this.el.querySelectorAll( '.ccf-form-notifications .rows' )[0];
|
2957 |
+
|
2958 |
+
if ( rowContainer.querySelectorAll( '.no-notifications' ).length > 0 ) {
|
2959 |
+
rowContainer.removeChild( rowContainer.firstChild );
|
2960 |
+
}
|
2961 |
+
|
2962 |
+
_.each( this.notificationViews, function( view ) {
|
2963 |
+
view.changeContext( null, 'view' );
|
2964 |
+
} );
|
2965 |
+
|
2966 |
+
this.notificationViews.push( view );
|
2967 |
+
|
2968 |
+
rowContainer.appendChild( view.el );
|
2969 |
+
},
|
2970 |
+
|
2971 |
+
toggleCompletionFields: function() {
|
2972 |
+
var completionActionType = this.el.querySelectorAll( '.form-completion-action-type' )[0].value;
|
2973 |
+
|
2974 |
+
var completionMessage = this.el.querySelectorAll( '.completion-message' )[0];
|
2975 |
+
var completionRedirect = this.el.querySelectorAll( '.completion-redirect-url' )[0];
|
2976 |
+
|
2977 |
+
if ( 'text' === completionActionType ) {
|
2978 |
+
completionMessage.style.display = 'block';
|
2979 |
+
completionRedirect.style.display = 'none';
|
2980 |
+
} else {
|
2981 |
+
completionMessage.style.display = 'none';
|
2982 |
+
completionRedirect.style.display = 'block';
|
2983 |
+
}
|
2984 |
+
},
|
2985 |
+
|
2986 |
+
togglePauseFields: function() {
|
2987 |
+
|
2988 |
+
var pause = this.el.querySelectorAll( '.form-pause' )[0].value;
|
2989 |
+
var pauseMessage = this.el.querySelectorAll( '.pause-message' )[0];
|
2990 |
+
|
2991 |
+
if ( parseInt( pause ) ) {
|
2992 |
+
pauseMessage.style.display = 'block';
|
2993 |
+
} else {
|
2994 |
+
pauseMessage.style.display = 'none';
|
2995 |
+
}
|
2996 |
+
},
|
2997 |
+
|
2998 |
+
togglePostCreationFields: function() {
|
2999 |
+
|
3000 |
+
var postCreation = this.el.querySelectorAll( '.form-post-creation' )[0].value;
|
3001 |
+
var $postCreationMappingFields = $( this.el.querySelectorAll( '.post-creation-mapping-field' ) );
|
3002 |
+
|
3003 |
+
if ( parseInt( postCreation ) ) {
|
3004 |
+
$postCreationMappingFields.show();
|
3005 |
+
} else {
|
3006 |
+
$postCreationMappingFields.hide();
|
3007 |
+
}
|
3008 |
+
},
|
3009 |
+
|
3010 |
+
save: function() {
|
3011 |
+
if ( this.el.innerHTML === '' ) {
|
3012 |
+
// @todo: for some reason this is needed for IE8
|
3013 |
+
return;
|
3014 |
+
}
|
3015 |
+
|
3016 |
+
var title = this.el.querySelectorAll( '.form-title' )[0].value;
|
3017 |
+
this.model.set( 'title', { raw: title } );
|
3018 |
+
|
3019 |
+
var description = this.el.querySelectorAll( '.form-description' )[0].value;
|
3020 |
+
this.model.set( 'description', description );
|
3021 |
+
|
3022 |
+
var buttonText = this.el.querySelectorAll( '.form-button-text' )[0].value;
|
3023 |
+
this.model.set( 'buttonText', buttonText );
|
3024 |
+
|
3025 |
+
var pause = this.el.querySelectorAll( '.form-pause' )[0].value;
|
3026 |
+
this.model.set( 'pause', ( parseInt( pause ) ) ? true : false );
|
3027 |
+
|
3028 |
+
var postCreation = this.el.querySelectorAll( '.form-post-creation' )[0].value;
|
3029 |
+
this.model.set( 'postCreation', ( parseInt( postCreation ) ) ? true : false );
|
3030 |
+
|
3031 |
+
var postCreationType = this.el.querySelectorAll( '.form-post-creation-type' )[0].value;
|
3032 |
+
this.model.set( 'postCreationType', postCreationType );
|
3033 |
+
|
3034 |
+
var postCreationStatus = this.el.querySelectorAll( '.form-post-creation-status' )[0].value;
|
3035 |
+
this.model.set( 'postCreationStatus', postCreationStatus );
|
3036 |
+
|
3037 |
+
var pauseMessage = this.el.querySelectorAll( '.form-pause-message' )[0].value;
|
3038 |
+
this.model.set( 'pauseMessage', pauseMessage );
|
3039 |
+
|
3040 |
+
var completionMessage = this.el.querySelectorAll( '.form-completion-message' )[0].value;
|
3041 |
+
this.model.set( 'completionMessage', completionMessage );
|
3042 |
+
|
3043 |
+
var completionRedirectUrl = this.el.querySelectorAll( '.form-completion-redirect-url' )[0].value;
|
3044 |
+
this.model.set( 'completionRedirectUrl', completionRedirectUrl );
|
3045 |
+
|
3046 |
+
var completionActionType = this.el.querySelectorAll( '.form-completion-action-type' )[0].value;
|
3047 |
+
this.model.set( 'completionActionType', completionActionType );
|
3048 |
+
|
3049 |
+
var theme = this.el.querySelectorAll( '.form-theme' )[0].value;
|
3050 |
+
this.model.set( 'theme', theme );
|
3051 |
+
},
|
3052 |
+
|
3053 |
+
fullSave: function( $promise ) {
|
3054 |
+
if ( this.el.innerHTML === '' ) {
|
3055 |
+
// @todo: for some reason this is needed for IE8
|
3056 |
+
return;
|
3057 |
+
}
|
3058 |
+
|
3059 |
+
this.save();
|
3060 |
+
|
3061 |
+
_.each( this.notificationViews, function( view ) {
|
3062 |
+
view.save();
|
3063 |
+
} );
|
3064 |
+
|
3065 |
+
_.each( this.mappingViews, function( view ) {
|
3066 |
+
view.save();
|
3067 |
+
} );
|
3068 |
+
|
3069 |
+
if ( typeof $promise !== 'undefined' && typeof $promise.promise !== 'undefined' ) {
|
3070 |
+
$promise.resolve();
|
3071 |
+
}
|
3072 |
+
},
|
3073 |
+
|
3074 |
+
destroy: function() {
|
3075 |
+
wp.ccf.dispatcher.off( 'saveFormSettings', this.fullSave );
|
3076 |
+
wp.ccf.dispatcher.off( 'mainViewChange', this.fullSave );
|
3077 |
+
},
|
3078 |
+
|
3079 |
+
deleteNotification: function( view ) {
|
3080 |
+
_.each( this.notificationViews, function( currentView ) {
|
3081 |
+
if ( view.cid === currentView.cid ) {
|
3082 |
+
var index = _.indexOf( this.notificationViews, currentView );
|
3083 |
+
this.model.get( 'notifications' ).remove( view.model );
|
3084 |
+
this.notificationViews[index].remove();
|
3085 |
+
this.notificationViews.splice( index, 1 );
|
3086 |
+
}
|
3087 |
+
}, this );
|
3088 |
+
|
3089 |
+
if ( ! this.notificationViews.length ) {
|
3090 |
+
var rowContainer = this.el.querySelectorAll( '.ccf-form-notifications .rows' )[0];
|
3091 |
+
rowContainer.appendChild( new wp.ccf.views.EmptyFormNotificationTableRow( { form: this.model } ).render().el );
|
3092 |
+
}
|
3093 |
+
},
|
3094 |
+
|
3095 |
+
render: function() {
|
3096 |
+
var context = {
|
3097 |
+
form: this.model.toJSON()
|
3098 |
+
};
|
3099 |
+
|
3100 |
+
var fields = this.model.get( 'fields' );
|
3101 |
+
var notifications = this.model.get( 'notifications' );
|
3102 |
+
|
3103 |
+
this.el.innerHTML = this.template( context );
|
3104 |
+
|
3105 |
+
this.toggleCompletionFields();
|
3106 |
+
this.togglePostCreationFields();
|
3107 |
+
this.togglePauseFields();
|
3108 |
+
|
3109 |
+
var rowContainer = this.el.querySelectorAll( '.ccf-form-notifications .rows' )[0];
|
3110 |
+
var newRowContainer = document.createElement( 'tbody');
|
3111 |
+
|
3112 |
+
newRowContainer.className = 'rows';
|
3113 |
+
|
3114 |
+
if ( notifications.length >= 1 ) {
|
3115 |
+
notifications.each( function( model ) {
|
3116 |
+
var row = new wp.ccf.views.ExistingFormNotificationRow( { model: model, form: this.model, parent: this } ).render();
|
3117 |
+
newRowContainer.appendChild( row.el );
|
3118 |
+
this.notificationViews.push( row );
|
3119 |
+
}, this );
|
3120 |
+
} else {
|
3121 |
+
newRowContainer.appendChild( new wp.ccf.views.EmptyFormNotificationTableRow( { form: this.model } ).render().el );
|
3122 |
+
}
|
3123 |
+
|
3124 |
+
rowContainer.parentNode.replaceChild( newRowContainer, rowContainer );
|
3125 |
+
|
3126 |
+
var mappingsContainer = this.el.querySelectorAll( '.post-creation-mapping' )[0];
|
3127 |
+
var mappings = this.model.get( 'postFieldMappings' );
|
3128 |
+
|
3129 |
+
if ( mappings.length >= 1 ) {
|
3130 |
+
mappings.each( function( model ) {
|
3131 |
+
var mapping = new wp.ccf.views.PostFieldMapping( { model: model, parent: this, form: this.model } ).render();
|
3132 |
+
mappingsContainer.appendChild( mapping.el );
|
3133 |
+
this.mappingViews.push( mapping );
|
3134 |
+
}, this );
|
3135 |
+
} else {
|
3136 |
+
var newMapping = new wp.ccf.models.PostFieldMapping();
|
3137 |
+
mappings.add( newMapping );
|
3138 |
+
}
|
3139 |
+
|
3140 |
+
wp.ccf.dispatcher.on( 'mainViewChange', this.fullSave, this );
|
3141 |
+
wp.ccf.dispatcher.on( 'saveFormSettings', this.fullSave, this );
|
3142 |
+
|
3143 |
+
return this;
|
3144 |
+
}
|
3145 |
+
}
|
3146 |
+
);
|
3147 |
+
|
3148 |
+
wp.ccf.views.FormPane = wp.ccf.views.FormPane || Backbone.View.extend( _.defaults(
|
3149 |
+
{
|
3150 |
+
template: wp.ccf.utils.template( 'ccf-form-pane-template' ),
|
3151 |
+
subViews: {
|
3152 |
+
'field-sidebar': wp.ccf.views.FieldSidebar,
|
3153 |
+
'form-settings': wp.ccf.views.FormSettings
|
3154 |
+
},
|
3155 |
+
|
3156 |
+
events: {
|
3157 |
+
'click .save-button': 'sync',
|
3158 |
+
'click .signup-button': 'signup',
|
3159 |
+
'click .accordion-heading': 'accordionClick',
|
3160 |
+
'click .form-settings-heading': 'accordionClick',
|
3161 |
+
'click .insert-form-button': 'insertForm'
|
3162 |
+
},
|
3163 |
+
|
3164 |
+
initialize: function() {
|
3165 |
+
wp.ccf.dispatcher.on( 'openEditField', this.openEditField, this );
|
3166 |
+
},
|
3167 |
+
|
3168 |
+
insertForm: function( event ) {
|
3169 |
+
wp.ccf.utils.insertFormShortcode( this.model );
|
3170 |
+
|
3171 |
+
wp.ccf.toggle();
|
3172 |
+
},
|
3173 |
+
|
3174 |
+
signup: function( event ) {
|
3175 |
+
var email = this.el.querySelectorAll( '.email-signup-field' )[0].value;
|
3176 |
+
var signupContainer = this.el.querySelectorAll( '.bottom .left.signup' )[0];
|
3177 |
+
signupContainer.className = 'left signup';
|
3178 |
+
|
3179 |
+
if (email) {
|
3180 |
+
$.ajax( {
|
3181 |
+
url: '//taylorlovett.us8.list-manage.com/subscribe/post-json?u=66118f9a5b0ab0414e83f043a&id=b4ed816a24&c=?',
|
3182 |
+
method: 'post',
|
3183 |
+
dataType: 'jsonp',
|
3184 |
+
data: {
|
3185 |
+
EMAIL: email
|
3186 |
+
}
|
3187 |
+
}).done(function() {
|
3188 |
+
signupContainer.className = 'left signup signup-success';
|
3189 |
+
});
|
3190 |
+
} else {
|
3191 |
+
signupContainer.className = 'left signup signup-error';
|
3192 |
+
}
|
3193 |
+
},
|
3194 |
+
|
3195 |
+
accordionClick: function( event ) {
|
3196 |
+
var parentContainer = $( event.currentTarget ).parents( '.accordion-container' )[0];
|
3197 |
+
|
3198 |
+
var sections = parentContainer.querySelectorAll( '.accordion-section' );
|
3199 |
+
|
3200 |
+
if ( event.currentTarget.parentNode.className.match( /expanded/i ) ) {
|
3201 |
+
event.currentTarget.parentNode.className = event.currentTarget.parentNode.className.replace( /expanded/i, '' );
|
3202 |
+
} else {
|
3203 |
+
event.currentTarget.parentNode.className += ' expanded';
|
3204 |
+
}
|
3205 |
+
|
3206 |
+
_.each( sections, function( section, index ) {
|
3207 |
+
if ( section != event.currentTarget.parentNode && section.className.match( /expanded/i ) ) {
|
3208 |
+
section.className = section.className.replace( /expanded/i, '' );
|
3209 |
+
}
|
3210 |
+
});
|
3211 |
+
|
3212 |
+
if ( event.currentTarget.className.match( /form-settings-heading/i ) ) {
|
3213 |
+
if ( this.el.className.match( /show-form-settings/i ) ) {
|
3214 |
+
this.el.className = this.el.className.replace( /show-form-settings/i, '' );
|
3215 |
+
} else {
|
3216 |
+
this.el.className += ' show-form-settings';
|
3217 |
+
}
|
3218 |
+
} else {
|
3219 |
+
this.el.className = this.el.className.replace( /show-form-settings/i, '' );
|
3220 |
+
}
|
3221 |
+
},
|
3222 |
+
|
3223 |
+
openEditField: function( field ) {
|
3224 |
+
this.renderedSubViews['field-sidebar'].render( field ).el.style.display = 'block';
|
3225 |
+
},
|
3226 |
+
|
3227 |
+
disable: function() {
|
3228 |
+
this.el.querySelectorAll( '.save-button' )[0].setAttribute( 'disabled', 'disabled' );
|
3229 |
+
this.el.querySelectorAll( '.disabled-overlay' )[0].style.display = 'block';
|
3230 |
+
},
|
3231 |
+
|
3232 |
+
enable: function() {
|
3233 |
+
this.el.querySelectorAll( '.save-button' )[0].removeAttribute( 'disabled' );
|
3234 |
+
this.el.querySelectorAll( '.disabled-overlay' )[0].style.display = 'none';
|
3235 |
+
},
|
3236 |
+
|
3237 |
+
sync: function() {
|
3238 |
+
var SELF = this;
|
3239 |
+
|
3240 |
+
var $spinner = $( this.el.querySelectorAll( '.spinner' )[0] );
|
3241 |
+
$spinner.fadeIn();
|
3242 |
+
SELF.disable();
|
3243 |
+
|
3244 |
+
var $settings = $.Deferred();
|
3245 |
+
var $field = $.Deferred();
|
3246 |
+
|
3247 |
+
wp.ccf.dispatcher.trigger( 'saveFormSettings', $settings );
|
3248 |
+
wp.ccf.dispatcher.trigger( 'saveField', $field );
|
3249 |
+
|
3250 |
+
$.when( $settings, $field ).then( function() {
|
3251 |
+
var fields = SELF.model.get( 'fields' );
|
3252 |
+
var allReqsMet = true;
|
3253 |
+
var slugs = {};
|
3254 |
+
|
3255 |
+
fields.each( function( field ) {
|
3256 |
+
var slug = field.get( 'slug' );
|
3257 |
+
if ( ! field.hasRequiredAttributes() ) {
|
3258 |
+
allReqsMet = false;
|
3259 |
+
|
3260 |
+
field.trigger( 'requirementsNotMet' );
|
3261 |
+
|
3262 |
+
} else if ( slug && ! slug.match( /^[a-zA-Z0-9\-_]+$/ ) ) {
|
3263 |
+
allReqsMet = false;
|
3264 |
+
|
3265 |
+
field.trigger( 'requirementsNotMet' );
|
3266 |
+
} else if ( typeof slugs[field.get( 'slug' )] !== 'undefined' ) {
|
3267 |
+
allReqsMet = false;
|
3268 |
+
|
3269 |
+
field.trigger( 'duplicateSlug' );
|
3270 |
+
slugs[field.get( 'slug' )].trigger( 'duplicateSlug' );
|
3271 |
+
} else {
|
3272 |
+
field.trigger( 'requirementsMet' );
|
3273 |
+
}
|
3274 |
+
|
3275 |
+
if ( field.get( 'slug' ) ) {
|
3276 |
+
slugs[field.get( 'slug' )] = field;
|
3277 |
+
}
|
3278 |
+
});
|
3279 |
+
|
3280 |
+
if ( allReqsMet ) {
|
3281 |
+
|
3282 |
+
SELF.model.save( {}, { context: 'edit' }).error( function( jqXHR, textStatus, errorThrown ) {
|
3283 |
+
var messageType = 'sync';
|
3284 |
+
|
3285 |
+
wp.ccf.errorModal.render( messageType ).show();
|
3286 |
+
}).done( function( response ) {
|
3287 |
+
if (ccfSettings.single && ! ccfSettings.postId ) {
|
3288 |
+
window.location = ccfSettings.adminUrl + 'post.php?post=' + SELF.model.get( 'id' ) + '&action=edit#ccf-form/' + SELF.model.get( 'id' );
|
3289 |
+
}
|
3290 |
+
}).complete( function( response ) {
|
3291 |
+
$spinner.fadeOut();
|
3292 |
+
SELF.enable();
|
3293 |
+
|
3294 |
+
wp.ccf.dispatcher.trigger( 'saveFormComplete', SELF.model );
|
3295 |
+
});
|
3296 |
+
} else {
|
3297 |
+
SELF.enable();
|
3298 |
+
$spinner.fadeOut();
|
3299 |
+
}
|
3300 |
+
});
|
3301 |
+
},
|
3302 |
+
|
3303 |
+
enableDisableInsert: function() {
|
3304 |
+
var insertButton = this.el.querySelectorAll( '.insert-form-button' )[0];
|
3305 |
+
if ( this.model.get( 'id' ) ) {
|
3306 |
+
insertButton.removeAttribute( 'disabled' );
|
3307 |
+
} else {
|
3308 |
+
insertButton.setAttribute( 'disabled', 'disabled' );
|
3309 |
+
}
|
3310 |
+
},
|
3311 |
+
|
3312 |
+
getNextFieldOrd: function() {
|
3313 |
+
var fields = this.model.get( 'fields' );
|
3314 |
+
var ord = fields.length + 1;
|
3315 |
+
|
3316 |
+
fields.each( function( field ) {
|
3317 |
+
var slug = field.get( 'slug' );
|
3318 |
+
var regex = /\-([0-9]+)$/g;
|
3319 |
+
var matches = regex.exec( slug );
|
3320 |
+
|
3321 |
+
if ( matches && matches[1] ) {
|
3322 |
+
var fieldOrd = parseInt( matches[1] );
|
3323 |
+
|
3324 |
+
if ( fieldOrd >= ord ) {
|
3325 |
+
ord = fieldOrd + 1;
|
3326 |
+
}
|
3327 |
+
}
|
3328 |
+
});
|
3329 |
+
|
3330 |
+
return ord;
|
3331 |
+
},
|
3332 |
+
|
3333 |
+
render: function( form ) {
|
3334 |
+
var SELF = this;
|
3335 |
+
|
3336 |
+
if ( form ) {
|
3337 |
+
SELF.model = form;
|
3338 |
+
} else {
|
3339 |
+
SELF.model = new wp.ccf.models.Form();
|
3340 |
+
}
|
3341 |
+
|
3342 |
+
this.listenTo( SELF.model, 'change', this.enableDisableInsert, this );
|
3343 |
+
|
3344 |
+
var context = {
|
3345 |
+
labels: ccfSettings.fieldLabels,
|
3346 |
+
form: SELF.model.toJSON()
|
3347 |
+
};
|
3348 |
+
|
3349 |
+
window.form = SELF.model;
|
3350 |
+
|
3351 |
+
SELF.el.innerHTML = this.template( context );
|
3352 |
+
|
3353 |
+
SELF.el.className = SELF.el.className.replace( /show-form-settings/i, '' );
|
3354 |
+
|
3355 |
+
var fields = SELF.el.querySelectorAll( '.fields' )[0];
|
3356 |
+
|
3357 |
+
_.each( ccfSettings.fieldLabels, function( label, type ) {
|
3358 |
+
fields.appendChild( new wp.ccf.views.FieldRowPlaceholder( { type: type } ).render().el );
|
3359 |
+
});
|
3360 |
+
|
3361 |
+
var structureFields = SELF.el.querySelectorAll( '.structure-fields' )[0];
|
3362 |
+
|
3363 |
+
_.each( ccfSettings.structureFieldLabels, function( label, type ) {
|
3364 |
+
structureFields.appendChild( new wp.ccf.views.FieldRowPlaceholder( { type: type } ).render().el );
|
3365 |
+
});
|
3366 |
+
|
3367 |
+
var specialFields = SELF.el.querySelectorAll( '.special-fields' )[0];
|
3368 |
+
|
3369 |
+
_.each( ccfSettings.specialFieldLabels, function( label, type ) {
|
3370 |
+
specialFields.appendChild( new wp.ccf.views.FieldRowPlaceholder( { type: type } ).render().el );
|
3371 |
+
});
|
3372 |
+
|
3373 |
+
var fieldModels = SELF.model.get( 'fields' );
|
3374 |
+
var formContent = SELF.el.querySelectorAll( '.form-content' )[0];
|
3375 |
+
var $formContent = $( formContent );
|
3376 |
+
|
3377 |
+
$( SELF.el.querySelectorAll( '.left-sidebar' )[0].querySelectorAll( '.field' ) ).draggable( {
|
3378 |
+
cursor: 'move',
|
3379 |
+
distance: 2,
|
3380 |
+
zIndex: 160001,
|
3381 |
+
scroll: false,
|
3382 |
+
containment: 'document',
|
3383 |
+
appendTo: '.ccf-main-modal',
|
3384 |
+
snap: false,
|
3385 |
+
connectToSortable: '.form-content',
|
3386 |
+
helper: function( event ) {
|
3387 |
+
var $field = $( event.currentTarget );
|
3388 |
+
var $helper = $( '<div class="field" data-field-type="' + $field.attr( 'data-field-type' ) + '"><h4>' + $field.find( '.label' ).html() + '</h4></div>' );
|
3389 |
+
return $helper.css( { 'width': $formContent.width(), opacity: '.75', 'height': $field.height() } );
|
3390 |
+
}
|
3391 |
+
|
3392 |
+
});
|
3393 |
+
|
3394 |
+
if ( fieldModels.length >= 1 ) {
|
3395 |
+
formContent.innerHTML = '';
|
3396 |
+
|
3397 |
+
fieldModels.each( function( field ) {
|
3398 |
+
var row = new wp.ccf.views.FieldRow( { model: field, form: SELF.model } ).render( true ).el;
|
3399 |
+
formContent.appendChild( row );
|
3400 |
+
});
|
3401 |
+
}
|
3402 |
+
|
3403 |
+
$( formContent ).sortable( {
|
3404 |
+
axis: 'y',
|
3405 |
+
distance: 2,
|
3406 |
+
handle: 'h4',
|
3407 |
+
placeholder: 'field-placeholder',
|
3408 |
+
stop: function( event, $ui ) {
|
3409 |
+
if ( ! $ui.item.hasClass( 'instantiated' ) ) {
|
3410 |
+
var type = $ui.item.attr( 'data-field-type' );
|
3411 |
+
var defaults = {};
|
3412 |
+
|
3413 |
+
if ( typeof wp.ccf.models.Fields[type].prototype.defaults().slug !== 'undefined' ) {
|
3414 |
+
defaults.slug = type + '-' + SELF.getNextFieldOrd();
|
3415 |
+
}
|
3416 |
+
|
3417 |
+
var field = new wp.ccf.models.Fields[type]( defaults );
|
3418 |
+
var fields = SELF.model.get( 'fields' );
|
3419 |
+
|
3420 |
+
fields.add( field );
|
3421 |
+
|
3422 |
+
new wp.ccf.views.FieldRow( { model: field, el: $ui.item, form: SELF.model } ).render( true );
|
3423 |
+
$ui.item.attr( 'style', '' );
|
3424 |
+
}
|
3425 |
+
|
3426 |
+
$ui.item.trigger( 'sorted', $ui.item.index() );
|
3427 |
+
}
|
3428 |
+
|
3429 |
+
});
|
3430 |
+
|
3431 |
+
SELF.initRenderSubViews( false, true, { form: SELF.model } );
|
3432 |
+
|
3433 |
+
SELF.enableDisableInsert();
|
3434 |
+
|
3435 |
+
return SELF;
|
3436 |
+
}
|
3437 |
+
}, wp.ccf.mixins.subViewable )
|
3438 |
+
);
|
3439 |
+
|
3440 |
+
wp.ccf.views.ExistingFormTableRow = wp.ccf.views.ExistingFormTableRow || Backbone.View.extend(
|
3441 |
+
{
|
3442 |
+
tagName: 'tr',
|
3443 |
+
template: wp.ccf.utils.template( 'ccf-existing-form-table-row-template'),
|
3444 |
+
events: {
|
3445 |
+
'click .edit': 'triggerMainViewChange',
|
3446 |
+
'click .delete': 'triggerDelete',
|
3447 |
+
'click .insert-form-button': 'insertForm'
|
3448 |
+
},
|
3449 |
+
|
3450 |
+
initialize: function( options) {
|
3451 |
+
this.parent = options.parent;
|
3452 |
+
},
|
3453 |
+
|
3454 |
+
insertForm: function( event ) {
|
3455 |
+
wp.ccf.utils.insertFormShortcode( this.model );
|
3456 |
+
|
3457 |
+
wp.ccf.toggle();
|
3458 |
+
},
|
3459 |
+
|
3460 |
+
triggerMainViewChange: function() {
|
3461 |
+
wp.ccf.switchToForm( this.model );
|
3462 |
+
},
|
3463 |
+
|
3464 |
+
triggerDelete: function() {
|
3465 |
+
var SELF = this,
|
3466 |
+
currentPage = SELF.parent.collection.state.currentPage,
|
3467 |
+
page;
|
3468 |
+
|
3469 |
+
SELF.model.destroy().done( function() {
|
3470 |
+
page = currentPage;
|
3471 |
+
|
3472 |
+
if ( page === SELF.parent.collection.state.totalPages && page - 1 === ( SELF.parent.collection.state.totalObjects - 1 ) / ccfSettings.postsPerPage ) {
|
3473 |
+
page--;
|
3474 |
+
}
|
3475 |
+
|
3476 |
+
SELF.parent.showPage( page ).done( function() {
|
3477 |
+
SELF.parent.renderPagination();
|
3478 |
+
});
|
3479 |
+
});
|
3480 |
+
},
|
3481 |
+
|
3482 |
+
render: function() {
|
3483 |
+
this.$el.html( this.template( { form: this.model.toJSON(), utils: { getPrettyPostDate: wp.ccf.utils.getPrettyPostDate } } ) );
|
3484 |
+
return this;
|
3485 |
+
}
|
3486 |
+
}
|
3487 |
+
);
|
3488 |
+
|
3489 |
+
wp.ccf.views.EmptyFormTableRow = wp.ccf.views.EmptyFormTableRow || Backbone.View.extend(
|
3490 |
+
{
|
3491 |
+
tagName: 'tr',
|
3492 |
+
template: wp.ccf.utils.template( 'ccf-empty-form-table-row-template'),
|
3493 |
+
|
3494 |
+
render: function() {
|
3495 |
+
this.$el.html( this.template() );
|
3496 |
+
return this;
|
3497 |
+
}
|
3498 |
+
}
|
3499 |
+
);
|
3500 |
+
|
3501 |
+
wp.ccf.views.ExistingFormTable = wp.ccf.views.ExistingFormTable || Backbone.View.extend(
|
3502 |
+
{
|
3503 |
+
template: wp.ccf.utils.template( 'ccf-existing-form-table-template'),
|
3504 |
+
|
3505 |
+
initialize: function() {
|
3506 |
+
this.parent = arguments.parent;
|
3507 |
+
this.collection = new wp.ccf.collections.Forms();
|
3508 |
+
|
3509 |
+
wp.ccf.dispatcher.on( 'changeFormTablePage', this.showPage, this );
|
3510 |
+
|
3511 |
+
// IMPORTANT
|
3512 |
+
wp.ccf.dispatcher.on( 'saveFormComplete', this.render, this );
|
3513 |
+
},
|
3514 |
+
|
3515 |
+
showPage: function( page ) {
|
3516 |
+
var SELF = this;
|
3517 |
+
|
3518 |
+
var fetch = this.collection.fetch( { data: { page: ( page ) } });
|
3519 |
+
|
3520 |
+
fetch.error( function( jqXHR, textStatus, errorThrown ) {
|
3521 |
+
var messageType = 'sync';
|
3522 |
+
|
3523 |
+
wp.ccf.errorModal.render( messageType ).show();
|
3524 |
+
});
|
3525 |
+
|
3526 |
+
fetch.done( function() {
|
3527 |
+
var rowContainer = SELF.el.querySelectorAll( '.rows' )[0];
|
3528 |
+
var newRowContainer = document.createElement( 'tbody');
|
3529 |
+
|
3530 |
+
newRowContainer.className = 'rows';
|
3531 |
+
|
3532 |
+
if ( SELF.collection.length >= 1 ) {
|
3533 |
+
SELF.collection.each( function( model ) {
|
3534 |
+
var row = new wp.ccf.views.ExistingFormTableRow( { model: model, parent: SELF } ).render();
|
3535 |
+
newRowContainer.appendChild( row.el );
|
3536 |
+
}, SELF );
|
3537 |
+
} else {
|
3538 |
+
newRowContainer.appendChild( new wp.ccf.views.EmptyFormTableRow().render().el );
|
3539 |
+
}
|
3540 |
+
|
3541 |
+
rowContainer.parentNode.replaceChild( newRowContainer, rowContainer );
|
3542 |
+
});
|
3543 |
+
|
3544 |
+
return fetch;
|
3545 |
+
},
|
3546 |
+
|
3547 |
+
renderPagination: function() {
|
3548 |
+
var container = this.el.querySelectorAll( '.ccf-pagination' )[0];
|
3549 |
+
|
3550 |
+
container.innerHTML = '';
|
3551 |
+
if ( this.collection.state.totalPages > 1 ) {
|
3552 |
+
container.appendChild( new wp.ccf.views.Pagination( { parent: this } ).render( this.collection.state.totalPages, this.collection.state.currentPage ).el );
|
3553 |
+
}
|
3554 |
+
},
|
3555 |
+
|
3556 |
+
render: function( skipRefreshPage ) {
|
3557 |
+
var SELF = this;
|
3558 |
+
|
3559 |
+
this.el.innerHTML = this.template();
|
3560 |
+
|
3561 |
+
var pagination = this.el.querySelectorAll( '.ccf-pagination' )[0];
|
3562 |
+
|
3563 |
+
this.showPage( 1 ).done( function() {
|
3564 |
+
SELF.renderPagination();
|
3565 |
+
});
|
3566 |
+
|
3567 |
+
return this;
|
3568 |
+
}
|
3569 |
+
}
|
3570 |
+
);
|
3571 |
+
|
3572 |
+
wp.ccf.views.ExistingFormPane = wp.ccf.views.ExistingFormPane || Backbone.View.extend( _.defaults(
|
3573 |
+
{
|
3574 |
+
template: wp.ccf.utils.template( 'ccf-existing-form-pane-template' ),
|
3575 |
+
subViews: {
|
3576 |
+
'existing-form-table': wp.ccf.views.ExistingFormTable
|
3577 |
+
},
|
3578 |
+
|
3579 |
+
render: function() {
|
3580 |
+
|
3581 |
+
if ( this.rendered ) {
|
3582 |
+
return this;
|
3583 |
+
}
|
3584 |
+
|
3585 |
+
this.rendered = true;
|
3586 |
+
|
3587 |
+
this.el.innerHTML = this.template();
|
3588 |
+
this.initRenderSubViews( true );
|
3589 |
+
|
3590 |
+
return this;
|
3591 |
+
}
|
3592 |
+
}, wp.ccf.mixins.subViewable )
|
3593 |
+
);
|
3594 |
+
|
3595 |
+
wp.ccf.views.MainModal = wp.ccf.views.MainModal || Backbone.View.extend( _.defaults(
|
3596 |
+
{
|
3597 |
+
tagName: 'div',
|
3598 |
+
className: 'ccf-main-modal',
|
3599 |
+
template: wp.ccf.utils.template( 'ccf-main-modal-template' ),
|
3600 |
+
events: {
|
3601 |
+
'click .close-icon': 'hide',
|
3602 |
+
'click .main-menu a': 'menuClick'
|
3603 |
+
},
|
3604 |
+
|
3605 |
+
subViews: {
|
3606 |
+
'form-pane': wp.ccf.views.FormPane
|
3607 |
+
},
|
3608 |
+
|
3609 |
+
initialize: function() {
|
3610 |
+
if ( ! ccfSettings.single ) {
|
3611 |
+
this.subViews['existing-form-pane'] = wp.ccf.views.ExistingFormPane;
|
3612 |
+
}
|
3613 |
+
|
3614 |
+
wp.ccf.dispatcher.on( 'mainViewChange', this.toggleView, this );
|
3615 |
+
},
|
3616 |
+
|
3617 |
+
toggleView: function( view ) {
|
3618 |
+
this.showView( view, wp.ccf.currentForm );
|
3619 |
+
|
3620 |
+
var menuView = view;
|
3621 |
+
|
3622 |
+
if ( 'form-pane' === view && wp.ccf.currentForm ) {
|
3623 |
+
menuView = 'existing-form-pane';
|
3624 |
+
}
|
3625 |
+
|
3626 |
+
var items = this.el.querySelectorAll( '.menu-item' );
|
3627 |
+
|
3628 |
+
_.each( items, function( item ) {
|
3629 |
+
var itemView = item.getAttribute( 'data-view' );
|
3630 |
+
|
3631 |
+
if ( itemView === menuView ) {
|
3632 |
+
item.className = item.className.replace( 'selected', '' ) + ' selected';
|
3633 |
+
} else {
|
3634 |
+
item.className = item.className.replace( 'selected', '' );
|
3635 |
+
}
|
3636 |
+
});
|
3637 |
+
},
|
3638 |
+
|
3639 |
+
menuClick: function( event ) {
|
3640 |
+
var view = event.target.getAttribute( 'data-view' );
|
3641 |
+
|
3642 |
+
if ( 'form-pane' === view ) {
|
3643 |
+
wp.ccf.currentForm = null;
|
3644 |
+
}
|
3645 |
+
|
3646 |
+
wp.ccf.dispatcher.trigger( 'mainViewChange', view );
|
3647 |
+
|
3648 |
+
event.preventDefault();
|
3649 |
+
},
|
3650 |
+
|
3651 |
+
render: function( single ) {
|
3652 |
+
single = single || false;
|
3653 |
+
|
3654 |
+
this.overlay();
|
3655 |
+
|
3656 |
+
this.el.innerHTML = this.template( { single: single } );
|
3657 |
+
this.initRenderSubViews();
|
3658 |
+
|
3659 |
+
this.showView( 'form-pane', wp.ccf.currentForm, true );
|
3660 |
+
|
3661 |
+
return this;
|
3662 |
+
},
|
3663 |
+
|
3664 |
+
overlay: function() {
|
3665 |
+
if ( typeof this.overlayEl === 'undefined' ) {
|
3666 |
+
this.overlayEl = document.createElement( 'div' );
|
3667 |
+
this.overlayEl.className = 'ccf-main-modal-overlay';
|
3668 |
+
document.body.appendChild( this.overlayEl );
|
3669 |
+
}
|
3670 |
+
|
3671 |
+
return this.overlayEl;
|
3672 |
+
},
|
3673 |
+
|
3674 |
+
remove: function() {
|
3675 |
+
document.body.removeChild( this.overlay() );
|
3676 |
+
|
3677 |
+
return this;
|
3678 |
+
},
|
3679 |
+
|
3680 |
+
show: function() {
|
3681 |
+
$( this.overlay() ).show();
|
3682 |
+
this.$el.show();
|
3683 |
+
},
|
3684 |
+
|
3685 |
+
hide: function() {
|
3686 |
+
$( this.overlay() ).hide();
|
3687 |
+
this.$el.hide();
|
3688 |
+
}
|
3689 |
+
}, wp.ccf.mixins.subViewable )
|
3690 |
+
);
|
3691 |
+
|
3692 |
+
wp.ccf.views.SubmissionRow = wp.ccf.views.SubmissionRow || Backbone.View.extend(
|
3693 |
+
{
|
3694 |
+
tagName: 'tr',
|
3695 |
+
template: wp.ccf.utils.template( 'ccf-submission-row-template' ),
|
3696 |
+
events: {
|
3697 |
+
'click .view': 'view',
|
3698 |
+
'click .delete': 'delete'
|
3699 |
+
},
|
3700 |
+
|
3701 |
+
initialize: function( options ) {
|
3702 |
+
this.parent = options.parent;
|
3703 |
+
},
|
3704 |
+
|
3705 |
+
'delete': function() {
|
3706 |
+
var SELF = this,
|
3707 |
+
currentPage = SELF.parent.collection.state.currentPage,
|
3708 |
+
page;
|
3709 |
+
|
3710 |
+
SELF.model.destroy().done( function() {
|
3711 |
+
page = currentPage;
|
3712 |
+
|
3713 |
+
if ( page === SELF.parent.collection.state.totalPages && page - 1 === ( SELF.parent.collection.state.totalObjects - 1 ) / ccfSettings.postsPerPage ) {
|
3714 |
+
page--;
|
3715 |
+
}
|
3716 |
+
|
3717 |
+
SELF.parent.showPage( page ).done( function() {
|
3718 |
+
SELF.parent.renderPagination();
|
3719 |
+
});
|
3720 |
+
});
|
3721 |
+
},
|
3722 |
+
|
3723 |
+
view: function( event ) {
|
3724 |
+
var id = event.currentTarget.getAttribute( 'data-submission-id'),
|
3725 |
+
date = event.currentTarget.getAttribute( 'data-submission-date');
|
3726 |
+
|
3727 |
+
tb_show( ccfSettings.thickboxTitle + ' - ' + wp.ccf.utils.getPrettyPostDate( date ), '#TB_inline?height=500&width=700&inlineId=ccf-submission-content-' + parseInt( id ), null );
|
3728 |
+
},
|
3729 |
+
|
3730 |
+
render: function() {
|
3731 |
+
this.$el.html( this.template( {
|
3732 |
+
submission: this.model.toJSON(),
|
3733 |
+
currentColumns: this.parent.columns,
|
3734 |
+
columns: wp.ccf.currentForm.getFieldSlugs( true ),
|
3735 |
+
utils: {
|
3736 |
+
getPrettyPostDate: wp.ccf.utils.getPrettyPostDate,
|
3737 |
+
wordChop: wp.ccf.utils.wordChop,
|
3738 |
+
isFieldDate: wp.ccf.utils.isFieldDate,
|
3739 |
+
isFieldName: wp.ccf.utils.isFieldName,
|
3740 |
+
isFieldFile: wp.ccf.utils.isFieldFile,
|
3741 |
+
isFieldAddress: wp.ccf.utils.isFieldAddress,
|
3742 |
+
isFieldEmailConfirm: wp.ccf.utils.isFieldEmailConfirm,
|
3743 |
+
getPrettyFieldDate: wp.ccf.utils.getPrettyFieldDate,
|
3744 |
+
getPrettyFieldAddress: wp.ccf.utils.getPrettyFieldAddress,
|
3745 |
+
getPrettyFieldName: wp.ccf.utils.getPrettyFieldName,
|
3746 |
+
getPrettyFieldEmailConfirm: wp.ccf.utils.getPrettyFieldEmailConfirm
|
3747 |
+
}
|
3748 |
+
} ) );
|
3749 |
+
|
3750 |
+
return this;
|
3751 |
+
}
|
3752 |
+
}
|
3753 |
+
);
|
3754 |
+
|
3755 |
+
|
3756 |
+
wp.ccf.views.SubmissionsTable = wp.ccf.views.SubmissionsTable || Backbone.View.extend(
|
3757 |
+
{
|
3758 |
+
template: wp.ccf.utils.template( 'ccf-submission-table-template' ),
|
3759 |
+
events: {
|
3760 |
+
'click .prev:not(.disabled)': 'previousPage',
|
3761 |
+
'click .next:not(.disabled)': 'nextPage',
|
3762 |
+
'click .first:not(.disabled)': 'firstPage',
|
3763 |
+
'click .last:not(.disabled)': 'lastPage'
|
3764 |
+
},
|
3765 |
+
|
3766 |
+
initialize: function() {
|
3767 |
+
this.collection = new wp.ccf.collections.Submissions( {}, { formId: ccfSettings.postId } );
|
3768 |
+
wp.ccf.dispatcher.on( 'submissionTableRebuild', this.render, this );
|
3769 |
+
},
|
3770 |
+
|
3771 |
+
showPage: function( page ) {
|
3772 |
+
var SELF = this;
|
3773 |
+
|
3774 |
+
var fetch = this.collection.fetch( { data: { page: ( page ) } } );
|
3775 |
+
|
3776 |
+
fetch.error( function( jqXHR, textStatus, errorThrown ) {
|
3777 |
+
var messageType = 'sync';
|
3778 |
+
|
3779 |
+
wp.ccf.errorModal.render( messageType ).show();
|
3780 |
+
});
|
3781 |
+
|
3782 |
+
fetch.done( function() {
|
3783 |
+
var rowContainer = SELF.el.querySelectorAll( '.submission-rows' )[0];
|
3784 |
+
var newRowContainer = document.createElement( 'tbody');
|
3785 |
+
|
3786 |
+
newRowContainer.className = 'submission-rows';
|
3787 |
+
|
3788 |
+
if ( SELF.collection.length >= 1 ) {
|
3789 |
+
SELF.collection.each( function( submission ) {
|
3790 |
+
var row = new wp.ccf.views.SubmissionRow( { model: submission, parent: SELF } ).render();
|
3791 |
+
newRowContainer.appendChild( row.el );
|
3792 |
+
}, SELF );
|
3793 |
+
} else {
|
3794 |
+
newRowContainer.appendChild( new wp.ccf.views.EmptySubmissionTableRow( { parent: SELF } ).render( wp.ccf.currentForm.getFieldSlugs( true ).concat( 'date' ) ).el );
|
3795 |
+
}
|
3796 |
+
|
3797 |
+
rowContainer.parentNode.replaceChild( newRowContainer, rowContainer );
|
3798 |
+
});
|
3799 |
+
|
3800 |
+
return fetch;
|
3801 |
+
},
|
3802 |
+
|
3803 |
+
renderPagination: function() {
|
3804 |
+
var container = this.el.querySelectorAll( '.ccf-pagination' )[0];
|
3805 |
+
|
3806 |
+
container.innerHTML = '';
|
3807 |
+
if ( this.collection.state.totalPages > 1 ) {
|
3808 |
+
container.appendChild( new wp.ccf.views.Pagination( { parent: this } ).render( this.collection.state.totalPages, this.collection.state.currentPage ).el );
|
3809 |
+
}
|
3810 |
+
},
|
3811 |
+
|
3812 |
+
render: function( columns ) {
|
3813 |
+
var SELF = this;
|
3814 |
+
|
3815 |
+
if ( ! columns ) {
|
3816 |
+
SELF.columns = wp.ccf.currentForm.getFieldSlugs( true ).slice( 0, 4 ).concat( 'date' );
|
3817 |
+
} else {
|
3818 |
+
SELF.columns = columns;
|
3819 |
+
}
|
3820 |
+
|
3821 |
+
if ( SELF.columns.length < 1 ) {
|
3822 |
+
SELF.el.innerHTML = '';
|
3823 |
+
} else {
|
3824 |
+
SELF.el.innerHTML = SELF.template( { columns: SELF.columns } );
|
3825 |
+
|
3826 |
+
var pagination = SELF.el.querySelectorAll( '.ccf-pagination' )[0];
|
3827 |
+
|
3828 |
+
SELF.showPage( 1 ).done( function() {
|
3829 |
+
SELF.renderPagination();
|
3830 |
+
});
|
3831 |
+
}
|
3832 |
+
|
3833 |
+
return SELF;
|
3834 |
+
}
|
3835 |
+
}
|
3836 |
+
);
|
3837 |
+
|
3838 |
+
wp.ccf.views.ErrorModal = wp.ccf.views.ErrorModal || Backbone.View.extend(
|
3839 |
+
{
|
3840 |
+
template: wp.ccf.utils.template( 'ccf-error-modal-template'),
|
3841 |
+
tagName: 'div',
|
3842 |
+
className: 'ccf-error-modal',
|
3843 |
+
|
3844 |
+
events: {
|
3845 |
+
'click .close': 'hide'
|
3846 |
+
},
|
3847 |
+
|
3848 |
+
hide: function() {
|
3849 |
+
this.el.className = this.el.className.replace( ' show', '' );
|
3850 |
+
},
|
3851 |
+
|
3852 |
+
show: function() {
|
3853 |
+
this.el.className = this.el.className.replace( ' show', '' ) + ' show';
|
3854 |
+
},
|
3855 |
+
|
3856 |
+
toggle: function() {
|
3857 |
+
if ( this.el.className.match( ' show') ) {
|
3858 |
+
this.hide();
|
3859 |
+
} else {
|
3860 |
+
this.show();
|
3861 |
+
}
|
3862 |
+
},
|
3863 |
+
|
3864 |
+
render: function( messageType ) {
|
3865 |
+
var context = {
|
3866 |
+
messageType: ''
|
3867 |
+
};
|
3868 |
+
|
3869 |
+
if ( messageType ) {
|
3870 |
+
context.messageType = messageType;
|
3871 |
+
}
|
3872 |
+
|
3873 |
+
this.el.innerHTML = this.template( context );
|
3874 |
+
|
3875 |
+
return this;
|
3876 |
+
}
|
3877 |
+
}
|
3878 |
+
);
|
3879 |
+
|
3880 |
+
wp.ccf.views.Pagination = wp.ccf.views.Pagination || Backbone.View.extend(
|
3881 |
+
{
|
3882 |
+
template: wp.ccf.utils.template( 'ccf-pagination-template' ),
|
3883 |
+
|
3884 |
+
events: {
|
3885 |
+
'click .prev:not(.disabled)': 'previousPage',
|
3886 |
+
'click .next:not(.disabled)': 'nextPage',
|
3887 |
+
'click .first:not(.disabled)': 'firstPage',
|
3888 |
+
'click .last:not(.disabled)': 'lastPage'
|
3889 |
+
},
|
3890 |
+
|
3891 |
+
initialize: function( options ) {
|
3892 |
+
this.parent = options.parent;
|
3893 |
+
},
|
3894 |
+
|
3895 |
+
previousPage: function( event ) {
|
3896 |
+
var SELF = this;
|
3897 |
+
|
3898 |
+
SELF.parent.showPage( SELF.parent.collection.state.currentPage - 1 ).done( function() {
|
3899 |
+
SELF.render();
|
3900 |
+
});
|
3901 |
+
},
|
3902 |
+
|
3903 |
+
nextPage: function( event ) {
|
3904 |
+
var SELF = this;
|
3905 |
+
|
3906 |
+
SELF.parent.showPage( SELF.parent.collection.state.currentPage + 1 ).done( function() {
|
3907 |
+
SELF.render();
|
3908 |
+
});
|
3909 |
+
},
|
3910 |
+
|
3911 |
+
firstPage: function( event ) {
|
3912 |
+
var SELF = this;
|
3913 |
+
|
3914 |
+
SELF.parent.showPage( 1 ).done( function() {
|
3915 |
+
SELF.render();
|
3916 |
+
});
|
3917 |
+
},
|
3918 |
+
|
3919 |
+
lastPage: function( event ) {
|
3920 |
+
var SELF = this;
|
3921 |
+
|
3922 |
+
SELF.parent.showPage( SELF.parent.collection.state.totalPages ).done( function() {
|
3923 |
+
SELF.render();
|
3924 |
+
});
|
3925 |
+
},
|
3926 |
+
|
3927 |
+
render: function() {
|
3928 |
+
this.el.innerHTML = this.template( { totalPages: this.parent.collection.state.totalPages, currentPage: this.parent.collection.state.currentPage, totalObjects: this.parent.collection.state.totalObjects } );
|
3929 |
+
|
3930 |
+
return this;
|
3931 |
+
}
|
3932 |
+
}
|
3933 |
+
);
|
3934 |
+
|
3935 |
+
wp.ccf.views.EmptySubmissionTableRow = wp.ccf.views.EmptySubmissionTableRow || Backbone.View.extend(
|
3936 |
+
{
|
3937 |
+
tagName: 'tr',
|
3938 |
+
template: wp.ccf.utils.template( 'ccf-no-submissions-row-template'),
|
3939 |
+
|
3940 |
+
initialize: function( options ) {
|
3941 |
+
this.parent = options.parent;
|
3942 |
+
},
|
3943 |
+
|
3944 |
+
render: function( columns ) {
|
3945 |
+
this.el.innerHTML = this.template( { columns: this.parent.columns } );
|
3946 |
+
return this;
|
3947 |
+
}
|
3948 |
+
}
|
3949 |
+
);
|
3950 |
+
|
3951 |
+
wp.ccf.views.SubmissionColumnController = wp.ccf.views.SubmissionColumnController || Backbone.View.extend(
|
3952 |
+
{
|
3953 |
+
template: wp.ccf.utils.template( 'ccf-submissions-controller-template'),
|
3954 |
+
|
3955 |
+
events: {
|
3956 |
+
'click input[type=checkbox]': 'triggerTableRebuild'
|
3957 |
+
},
|
3958 |
+
|
3959 |
+
render: function() {
|
3960 |
+
this.el.innerHTML = this.template( { columns: wp.ccf.currentForm.getFieldSlugs( true ).concat( 'date' ) } );
|
3961 |
+
},
|
3962 |
+
|
3963 |
+
triggerTableRebuild: function( event ) {
|
3964 |
+
var columns = [];
|
3965 |
+
|
3966 |
+
var columnElements = document.querySelectorAll( '.submission-column-checkbox' );
|
3967 |
+
|
3968 |
+
if ( columnElements.length >= 1 ) {
|
3969 |
+
for ( var i = 0; i < columnElements.length; i++ ) {
|
3970 |
+
if ( columnElements[i].checked ) {
|
3971 |
+
columns.push( columnElements[i].value );
|
3972 |
+
}
|
3973 |
+
}
|
3974 |
+
}
|
3975 |
+
|
3976 |
+
wp.ccf.dispatcher.trigger( 'submissionTableRebuild', columns );
|
3977 |
+
}
|
3978 |
+
}
|
3979 |
+
);
|
3980 |
+
})( jQuery, Backbone, _, ccfSettings );
|
3981 |
+
|
3982 |
+
( function( $, Backbone, _, ccfSettings ) {
|
3983 |
+
'use strict';
|
3984 |
+
|
3985 |
+
wp.ccf.router = wp.ccf.router || Backbone.Router.extend( {
|
3986 |
+
routes: {
|
3987 |
+
'ccf-form': 'open',
|
3988 |
+
'ccf-form/:formId': 'open'
|
3989 |
+
},
|
3990 |
+
|
3991 |
+
open: function( formId ) {
|
3992 |
+
wp.ccf.show( formId );
|
3993 |
+
}
|
3994 |
+
});
|
3995 |
+
})( jQuery, Backbone, _, ccfSettings );
|
3996 |
+
( function( $, Backbone, _, ccfSettings ) {
|
3997 |
+
'use strict';
|
3998 |
+
|
3999 |
+
/**
|
4000 |
+
* Wrapper object for CCF form manager
|
4001 |
+
*
|
4002 |
+
* @returns {{}}
|
4003 |
+
*/
|
4004 |
+
wp.ccf = _.defaults( wp.ccf, {
|
4005 |
+
forms: new wp.ccf.collections.Forms(),
|
4006 |
+
|
4007 |
+
currentForm: null,
|
4008 |
+
|
4009 |
+
errorModal: null,
|
4010 |
+
|
4011 |
+
// Used for single form pages
|
4012 |
+
_currentFormDeferred: null,
|
4013 |
+
|
4014 |
+
dispatcher: {},
|
4015 |
+
|
4016 |
+
show: function( form ) {
|
4017 |
+
this.switchToForm( form );
|
4018 |
+
|
4019 |
+
this.instance.show();
|
4020 |
+
return this.instance;
|
4021 |
+
},
|
4022 |
+
|
4023 |
+
initErrorModal: function() {
|
4024 |
+
this.errorModal = new wp.ccf.views.ErrorModal().render();
|
4025 |
+
var body = document.getElementsByTagName( 'body' )[0];
|
4026 |
+
body.appendChild( this.errorModal.el );
|
4027 |
+
},
|
4028 |
+
|
4029 |
+
switchToForm: function( form ) {
|
4030 |
+
var SELF = this;
|
4031 |
+
|
4032 |
+
if ( +form === parseInt( form ) ) {
|
4033 |
+
var formId = parseInt( form );
|
4034 |
+
|
4035 |
+
form = SELF.forms.findWhere( { id: parseInt( formId ) } );
|
4036 |
+
|
4037 |
+
if ( ! form ) {
|
4038 |
+
var $deferred;
|
4039 |
+
|
4040 |
+
if ( typeof SELF.forms.formsFetching[formId] !== 'undefined' ) {
|
4041 |
+
$deferred = SELF.forms.formsFetching[formId];
|
4042 |
+
form = null;
|
4043 |
+
} else {
|
4044 |
+
form = new wp.ccf.models.Form( { id: formId } );
|
4045 |
+
$deferred = form.fetch();
|
4046 |
+
SELF.forms.formsFetching[formId] = $deferred;
|
4047 |
+
}
|
4048 |
+
|
4049 |
+
$deferred.done( function() {
|
4050 |
+
if ( form ) {
|
4051 |
+
delete SELF.forms.formsFetching[formId];
|
4052 |
+
SELF.forms.add( form );
|
4053 |
+
} else {
|
4054 |
+
form = SELF.forms.findWhere( { id: formId } );
|
4055 |
+
}
|
4056 |
+
|
4057 |
+
SELF.currentForm = form;
|
4058 |
+
|
4059 |
+
wp.ccf.dispatcher.trigger( 'mainViewChange', 'form-pane' );
|
4060 |
+
});
|
4061 |
+
|
4062 |
+
return $deferred;
|
4063 |
+
} else {
|
4064 |
+
SELF.currentForm = form;
|
4065 |
+
|
4066 |
+
wp.ccf.dispatcher.trigger( 'mainViewChange', 'form-pane' );
|
4067 |
+
}
|
4068 |
+
} else {
|
4069 |
+
SELF.currentForm = form;
|
4070 |
+
|
4071 |
+
wp.ccf.dispatcher.trigger( 'mainViewChange', 'form-pane' );
|
4072 |
+
}
|
4073 |
+
|
4074 |
+
return true;
|
4075 |
+
},
|
4076 |
+
|
4077 |
+
hide: function() {
|
4078 |
+
this.instance.hide();
|
4079 |
+
return this.instance;
|
4080 |
+
},
|
4081 |
+
|
4082 |
+
toggle: function( form ) {
|
4083 |
+
this.switchToForm( form );
|
4084 |
+
|
4085 |
+
if ( this.instance.$el.is( ':visible' ) ) {
|
4086 |
+
this.instance.hide();
|
4087 |
+
} else {
|
4088 |
+
this.instance.show();
|
4089 |
+
}
|
4090 |
+
|
4091 |
+
return this.instance;
|
4092 |
+
},
|
4093 |
+
|
4094 |
+
createSubmissionsTable: function( container ) {
|
4095 |
+
var columns = [];
|
4096 |
+
|
4097 |
+
var columnControllerContainer = document.querySelectorAll( '.ccf-submission-column-controller' );
|
4098 |
+
|
4099 |
+
var main = new wp.ccf.views.SubmissionsTable( { el: container } );
|
4100 |
+
|
4101 |
+
main.render();
|
4102 |
+
|
4103 |
+
if ( columnControllerContainer ) {
|
4104 |
+
( new wp.ccf.views.SubmissionColumnController( { el: columnControllerContainer } ) ).render();
|
4105 |
+
}
|
4106 |
+
},
|
4107 |
+
|
4108 |
+
_setupMainModal: function( single ) {
|
4109 |
+
this.instance = new wp.ccf.views.MainModal().render( single );
|
4110 |
+
|
4111 |
+
document.getElementsByTagName( 'body' )[0].appendChild( this.instance.el );
|
4112 |
+
|
4113 |
+
Backbone.history.start();
|
4114 |
+
|
4115 |
+
return this.instance;
|
4116 |
+
},
|
4117 |
+
|
4118 |
+
createManager: function() {
|
4119 |
+
var SELF = this;
|
4120 |
+
|
4121 |
+
var managerButton = document.querySelectorAll( '.ccf-open-form-manager')[0];
|
4122 |
+
|
4123 |
+
if ( ! managerButton ) {
|
4124 |
+
return false;
|
4125 |
+
}
|
4126 |
+
|
4127 |
+
_.extend( this.dispatcher, Backbone.Events );
|
4128 |
+
|
4129 |
+
new wp.ccf.router();
|
4130 |
+
|
4131 |
+
SELF.initErrorModal();
|
4132 |
+
|
4133 |
+
var single = false;
|
4134 |
+
|
4135 |
+
if ( ccfSettings.single ) {
|
4136 |
+
single = true;
|
4137 |
+
|
4138 |
+
if ( ccfSettings.postId ) {
|
4139 |
+
var formId = parseInt( ccfSettings.postId );
|
4140 |
+
|
4141 |
+
if ( typeof SELF.forms.formsFetching[formId] === 'undefined' ) {
|
4142 |
+
|
4143 |
+
var form = new wp.ccf.models.Form( { id: formId } );
|
4144 |
+
var $deferred = form.fetch();
|
4145 |
+
SELF.forms.formsFetching[formId] = $deferred;
|
4146 |
+
SELF._currentFormDeferred = $deferred;
|
4147 |
+
|
4148 |
+
$deferred.done( function() {
|
4149 |
+
delete SELF.forms.formsFetching[formId];
|
4150 |
+
SELF.forms.add( form );
|
4151 |
+
SELF.currentForm = form;
|
4152 |
+
});
|
4153 |
+
} else {
|
4154 |
+
SELF._currentFormDeferred = SELF.forms.formsFetching[formId];
|
4155 |
+
|
4156 |
+
SELF._currentFormDeferred.done( function() {
|
4157 |
+
SELF.currentForm = SELF.forms.findWhere( { id: formId } );
|
4158 |
+
});
|
4159 |
+
}
|
4160 |
+
|
4161 |
+
$.when( SELF._currentFormDeferred ).then( function() {
|
4162 |
+
SELF._setupMainModal( true );
|
4163 |
+
managerButton.style.display = 'inline-block';
|
4164 |
+
|
4165 |
+
var metabox = document.getElementById( 'ccf-submissions' );
|
4166 |
+
if ( metabox ) {
|
4167 |
+
var container = metabox.querySelectorAll( '.inside' )[0];
|
4168 |
+
|
4169 |
+
var settings = document.createElement( 'div' );
|
4170 |
+
settings.className = 'ccf-submission-icon';
|
4171 |
+
settings.setAttribute( 'data-icon', '' );
|
4172 |
+
|
4173 |
+
var download = document.createElement( 'a' );
|
4174 |
+
download.href = '?action=edit&post=' + parseInt( ccfSettings.postId ) + '&download_submissions=1&download_submissions_nonce=' + ccfSettings.downloadSubmissionsNonce;
|
4175 |
+
download.className = 'ccf-submission-icon';
|
4176 |
+
download.setAttribute( 'data-icon', '' );
|
4177 |
+
|
4178 |
+
var screenOptionsLink = document.getElementById( 'show-settings-link' );
|
4179 |
+
settings.onclick = function() {
|
4180 |
+
screenOptionsLink.click();
|
4181 |
+
};
|
4182 |
+
|
4183 |
+
metabox.insertBefore( settings, metabox.firstChild.nextSibling.nextSibling );
|
4184 |
+
metabox.insertBefore( download, metabox.firstChild.nextSibling.nextSibling );
|
4185 |
+
|
4186 |
+
wp.ccf.createSubmissionsTable( container );
|
4187 |
+
}
|
4188 |
+
});
|
4189 |
+
} else {
|
4190 |
+
SELF._setupMainModal( true );
|
4191 |
+
managerButton.style.display = 'inline-block';
|
4192 |
+
}
|
4193 |
+
} else {
|
4194 |
+
SELF._setupMainModal();
|
4195 |
+
}
|
4196 |
+
|
4197 |
+
var managerClick = function( evnt ) {
|
4198 |
+
evnt = evnt || window.event;
|
4199 |
+
var target = ( evnt.currentTarget ) ? evnt.currentTarget : evnt.srcElement;
|
4200 |
+
var formId = target.getAttribute( 'data-form-id' );
|
4201 |
+
wp.ccf.toggle( formId );
|
4202 |
+
};
|
4203 |
+
|
4204 |
+
if ( managerButton.addEventListener ) {
|
4205 |
+
managerButton.addEventListener( 'click', managerClick, false );
|
4206 |
+
} else {
|
4207 |
+
managerButton.attachEvent( 'onclick', managerClick );
|
4208 |
+
}
|
4209 |
+
}
|
4210 |
+
});
|
4211 |
+
|
4212 |
+
wp.ccf.createManager();
|
4213 |
+
|
4214 |
+
})( jQuery, Backbone, _, ccfSettings );
|
assets/build/js/form-manager.min.js
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
(function(e,t,i,l){"use strict";window.wp=window.wp||{},wp.ccf=wp.ccf||{},wp.ccf.utils=wp.ccf.utils||{},wp.ccf.utils.cleanDateFields=function(e){delete e.date,delete e.date_gmt,delete e.modified,delete e.modified_gmt,delete e.date_tz,delete e.modified_tz},wp.ccf.utils.template=i.memoize(function(e){var t={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g};return i.template(document.getElementById(e).innerHTML,null,t)}),wp.ccf.utils.insertFormShortcode=function(e){var t=wp.ccf.forms.findWhere({id:e.get("id")});t||wp.ccf.forms.add(e);var i=tinymce.get(wpActiveEditor),l='[ccf_form id="'+e.get("id")+'"]';i&&!i.isHidden()?tinymce.activeEditor.execCommand("mceInsertContent",!1,l):document.getElementById(wpActiveEditor).value+=l},wp.ccf.utils.getPrettyPostDate=function(e){return e=moment.utc(e),l.gmtOffset&&(e=e.utcOffset(60*parseInt(l.gmtOffset))),e.format("h:mm a M/D/YYYY")},wp.ccf.utils.wordChop=function(e,t){var i=e.substr(0,t);return i.substr(0,Math.min(i.length,i.lastIndexOf(" "))),i.length<e.length&&(i+="..."),i},wp.ccf.utils.isFieldDate=function(e){return e.date!==void 0||e.hour!==void 0&&e.minute!==void 0&&e["am-pm"]!==void 0?!0:!1},wp.ccf.utils.isFieldName=function(e){return e.name!==void 0||e.last!==void 0?!0:!1},wp.ccf.utils.isFieldEmailConfirm=function(e){return e.email!==void 0||e.confirm!==void 0?!0:!1},wp.ccf.utils.isFieldAddress=function(e){return e.street!==void 0&&e.city!==void 0&&e.zipcode!==void 0&&e.line_two!==void 0?!0:!1},wp.ccf.utils.isFieldFile=function(e){return e.id!==void 0&&e.url!==void 0&&e.file_name!==void 0?!0:!1},wp.ccf.utils.getPrettyFieldEmailConfirm=function(e){return e.email?e.email:e.confirm?e.confirm:"-"},wp.ccf.utils.getPrettyFieldDate=function(e,t){var i="",s="",o="HH:mm MM/DD/YY";if(t&&t.ccf_field_dateFormat&&"dd/mm/yyyy"===t.ccf_field_dateFormat&&(o="HH:mm DD/MM/YY"),e.hour&&e.minute&&e["am-pm"]&&(i+=e.hour+":"+e.minute+" "+e["am-pm"]),e.date&&(i+=" "+e.date),!i)return"-";var n=moment(i,o);return n.isValid()?(e.hour&&e.minute&&e["am-pm"]&&(s+=n.format("h:mm a")),e.date&&(s&&(s+=" "),s+=e.date),s):l.invalidDate},wp.ccf.utils.getPrettyFieldName=function(e){var t=e.first;return t.length>0&&(t+=" "),e.last&&(t+=e.last),t||(t="-"),t},wp.ccf.utils.getPrettyFieldAddress=function(e){if(!e.street||!e.city)return"-";var t=e.street;return e.line_two&&(t+=" "+e.line_two),t+=", "+e.city,e.state&&(t+=", "+e.state),e.zipcode&&(t+=" "+e.zipcode),e.country&&(t+=" "+e.country),t}})(jQuery,Backbone,_,ccfSettings),function(e,t,i){"use strict";wp.ccf.mixins=wp.ccf.mixins||{},wp.ccf.mixins.subViewable=wp.ccf.mixins.subViewable||{subViews:{},initRenderSubViews:function(e,t,l){this.renderedSubViews||(this.renderedSubViews={});for(var s in this.subViews){var o={el:this.$el.find(".ccf-"+s),parent:this};l&&i.extend(o,l),this.renderedSubViews[s]&&this.renderedSubViews[s].destroy&&this.renderedSubViews[s].destroy(),(t||!this.renderedSubViews[s])&&(this.renderedSubViews[s]=new this.subViews[s](o)),this.renderedSubViews[s].render(),e&&(this.renderedSubViews[s].el.style.display="block")}return this},showView:function(e,t,i){if(this.renderedSubViews!==void 0&&this.renderedSubViews[e]!==void 0){var l=this.renderedSubViews[e];i||l.render(t),l.el.style.display="block",this.currentView=e;for(var s in this.subViews)s!==e&&(this.renderedSubViews[s].el.style.display="none")}}}}(jQuery,Backbone,_,ccfSettings),function(e,t,i,l){"use strict";wp.ccf.models=wp.ccf.models||{},wp.ccf.models.Fields=wp.ccf.models.Fields||{};var s=function(e,i,l){return"object"!=typeof i&&""===i&&(i=""),t.Model.prototype.set.call(this,e,i,l)},o=function(e,t,i){return i=i||{},i.emulateHTTP=!0,this.constructor.__super__.sync.call(this,e,t,i)},n=function(e){for(var t in this.attributes)if(-1===i.indexOf(e,t)){var l=this.get(t);"string"==typeof l&&""!==l&&(l=(l+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/“/g,"”").replace(/”/g,"”").replace(/‘/g,"‘").replace(/&/g,"&").replace(/'/g,"'"),this.set(t,l))}return this};wp.ccf.models.FieldConditional=wp.ccf.models.FieldConditional||t.Model.extend({defaults:{field:"",compare:"is",value:""},decode:function(){return n.call(this,[])},set:s}),wp.ccf.models.FieldChoice=wp.ccf.models.FieldChoice||t.Model.extend({defaults:{label:"",value:"",selected:!1},decode:function(){return n.call(this,[])},set:s}),wp.ccf.models.PostFieldMapping=wp.ccf.models.PostFieldMapping||t.Model.extend({defaults:{formField:"",postField:"",customFieldKey:""},decode:function(){return n.call(this,[])},set:s}),wp.ccf.models.FormNotificationAddress=wp.ccf.models.FormNotificationAddress||t.Model.extend({defaults:{type:"custom",field:"",email:""},decode:function(){return n.call(this,[])},set:s}),wp.ccf.models.FormNotification=wp.ccf.models.FormNotification||t.Model.extend({defaults:function(){return{title:"",content:"[all_fields]",active:!1,addresses:new wp.ccf.collections.FormNotificationAddresses,fromType:"default",fromAddress:"",fromField:"",subjectType:"default",subject:"",subjectField:"",fromNameType:"custom",fromName:"WordPress",fromNameField:""}},initialize:function(e){if("object"==typeof e&&e.addresses){var t=[];i.each(e.addresses,function(e){var i=new wp.ccf.models.FormNotificationAddress(e);i.decode(),t.push(i)}),this.set("addresses",new wp.ccf.collections.FormNotificationAddresses(t))}},decode:function(){return n.call(this,[])},toJSON:function(){var e=this.constructor.__super__.toJSON.call(this);return e.addresses&&(e.addresses=e.addresses.toJSON()),e},set:s}),wp.ccf.models.Form=wp.ccf.models.Form||wp.api.models.Post.extend({urlRoot:l.apiRoot.replace(/\/$/,"")+"/ccf/v1/forms",set:s,sync:o,idAttribute:"id",initialize:function(){this.on("sync",this.decode,this)},defaults:function(){var e={fields:new wp.ccf.collections.Fields,type:"ccf_form",status:"publish",description:"",buttonText:"Submit Form",completionActionType:"text",completionRedirectUrl:"",completionMessage:"",postCreation:!1,postCreationType:"post",postCreationStatus:"draft",postFieldMappings:new wp.ccf.collections.PostFieldMappings,notifications:new wp.ccf.collections.FormNotifications,pause:!1,pauseMessage:l.pauseMessage,theme:"none"};return e=i.defaults(e,this.constructor.__super__.defaults),wp.ccf.utils.cleanDateFields(e),e},decode:function(){var e=i.keys(wp.api.models.Post.prototype.defaults);return e=i.without(e,"title"),n.call(this,e)},getFieldSlugs:function(e){var t=wp.ccf.currentForm.get("fields"),i=[];return t.each(function(t){e&&t.isImmutable||i.push(t.get("slug"))}),i},parse:function(e){var t=this,l=0,s=0;if(e.fields){var o=t.get("fields");if(o&&o.length>0){for(l=0;e.fields.length>l;l++){var n=e.fields[l],c=o.findWhere({slug:n.slug});if(c){if(n.choices!==void 0){var r=t.get("choices");if(r&&r.length>0)for(s=0;n.choices>s;s++){var a=r.at(s);a.set(n.choices[s]),a.decode()}delete e.fields[l].choices}if(n.conditionals!==void 0){var d=t.get("conditionals");if(d&&d.length>0)for(s=0;n.conditionals>s;s++){var u=d.at(s);u.set(n.conditionals[s]),u.decode()}delete e.fields[l].conditionals}c.set(n),c.decode()}}delete e.fields}else{var f=[];i.each(e.fields,function(e){var t=new wp.ccf.models.Fields[e.type](e);t.decode(),f.push(t)}),e.fields=new wp.ccf.collections.Fields(f,{formId:e.id}),o?(o.add(f),delete e.fields):e.fields=new wp.ccf.collections.Fields(f,{formId:e.id})}}if(e.notifications){var p=t.get("notifications");if(p&&p.length>0){for(l=0;e.notifications.length>l;l++){var h=e.notifications[l],m=p.at(l);if(m){if(h.addresses!==void 0){var w=m.get("addresses");if(w&&w.length>0)for(s=0;h.addresses>s;s++){var g=w.at(s);g.set(h.addresses[s]),g.decode()}delete e.notifications[l].addresses}m.set(h),m.decode()}}delete e.notifications}else{var v=[];i.each(e.notifications,function(e){var t=new wp.ccf.models.FormNotification(e);t.decode(),v.push(t)}),p?(p.add(v),delete e.notifications):e.notifications=new wp.ccf.collections.FormNotifications(v)}}if(e.postFieldMappings){var y=t.get("postFieldMappings");if(y&&y.length>0){for(l=0;e.postFieldMappings.length>l;l++){var F=e.postFieldMappings[l],b=y.at(l);b&&(b.set(F),b.decode())}delete e.postFieldMappings}else{var S=[];i.each(e.postFieldMappings,function(e){var t=new wp.ccf.models.PostFieldMapping(e);t.decode(),S.push(t)}),y?(y.add(S),e.postFieldMappings=y):e.postFieldMappings=new wp.ccf.collections.PostFieldMappings(S)}}return this.constructor.__super__.parse.call(this,e)},toJSON:function(){var e=this.constructor.__super__.toJSON.call(this);return e.fields&&(e.fields=e.fields.toJSON()),e.notifications&&(e.notifications=e.notifications.toJSON()),e.postFieldMappings&&(e.postFieldMappings=e.postFieldMappings.toJSON()),e.author&&(e.author=e.author.toJSON()),e}}),wp.ccf.models.Submission=wp.api.models.Submission||wp.api.models.Post.extend({defaults:{id:null,data:{},fields:{}},sync:o,urlRoot:l.apiRoot.replace(/\/$/,"")+"/ccf/v1/submissions"}),wp.ccf.models.Field=wp.api.models.Field||wp.api.models.Post.extend({idAttribute:"id",defaults:function(){return{id:null,conditionalsEnabled:!1,conditionalType:"show",conditionalFieldsRequired:"all",conditionals:new wp.ccf.collections.FieldConditionals}},set:s,initialize:function(e){if("object"==typeof e&&e.conditionals){var t=[];i.each(e.conditionals,function(e){var i=new wp.ccf.models.FieldConditional(e);i.decode(),t.push(i)}),this.set("conditionals",new wp.ccf.collections.FieldConditionals(t))}},required:function(){return["slug"]},decode:function(){return n.call(this,i.keys(wp.api.models.Post.prototype.defaults))},hasRequiredAttributes:function(){var e=this,t=!0;return i.each(this.required(),function(i){(e.get(i)===void 0||""===e.get(i))&&(t=!1)}),t},sync:o}),wp.ccf.models.StandardField=wp.ccf.models.StandardField||wp.ccf.models.Field.extend({idAttribute:"id",defaults:function(){var e={label:l.fieldLabel,value:"",placeholder:"",slug:"",type:"",required:!1,className:"",description:""};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return wp.ccf.models.StandardField.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields["single-line-text"]=wp.ccf.models.Fields["single-line-text"]||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"single-line-text"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.file=wp.ccf.models.Fields.file||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"file",fileExtensions:"",maxFileSize:l.maxFileSize};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields["paragraph-text"]=wp.ccf.models.Fields["paragraph-text"]||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"paragraph-text"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.hidden=wp.ccf.models.Fields.hidden||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"hidden"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.email=wp.ccf.models.Fields.email||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"email",emailConfirmation:!1};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.website=wp.ccf.models.Fields.website||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"website",placeholder:"http://"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.phone=wp.ccf.models.Fields.phone||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"phone",phoneFormat:"us"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.date=wp.ccf.models.Fields.date||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"date",showDate:!0,showTime:!0,dateFormat:"mm/dd/yyyy"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.name=wp.ccf.models.Fields.name||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"name"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.recaptcha=wp.ccf.models.Fields.recaptcha||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"recaptcha",siteKey:"",secretKey:""};return i.defaults(e,this.constructor.__super__.defaults())},required:function(){return["siteKey","secretKey"]},isImmutable:!0,initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.address=wp.ccf.models.Fields.address||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"address",addressType:"us"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields["section-header"]=wp.ccf.models.Fields["section-header"]||wp.ccf.models.Field.extend({defaults:function(){var e={type:"section-header",slug:"",heading:"",subheading:"",className:""};return i.defaults(e,this.constructor.__super__.defaults())},required:function(){return[]},isImmutable:!0,initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.html=wp.ccf.models.Fields.html||wp.ccf.models.Field.extend({defaults:function(){var e={type:"html",slug:"",html:"",className:""};return i.defaults(e,this.constructor.__super__.defaults())},required:function(){return[]},isImmutable:!0,initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.ChoiceableField=wp.ccf.models.ChoiceableField||wp.ccf.models.StandardField.extend({defaults:function(){var e={choices:new wp.ccf.collections.FieldChoices};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(e){if("object"==typeof e&&e.choices){var t=[];i.each(e.choices,function(e){var i=new wp.ccf.models.FieldChoice(e);i.decode(),t.push(i)}),this.set("choices",new wp.ccf.collections.FieldChoices(t))}return wp.ccf.models.ChoiceableField.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.radio=wp.ccf.models.Fields.radio||wp.ccf.models.ChoiceableField.extend({defaults:function(){var e={type:"radio"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.checkboxes=wp.ccf.models.Fields.checkboxes||wp.ccf.models.ChoiceableField.extend({defaults:function(){var e={type:"checkboxes"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.dropdown=wp.ccf.models.Fields.dropdown||wp.ccf.models.ChoiceableField.extend({defaults:function(){var e={type:"dropdown"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}})}(jQuery,Backbone,_,ccfSettings),function(e,t,i,l){"use strict";var s=function(e,t,i){return i=i||{},i.emulateHTTP=!0,this.constructor.__super__.sync.call(this,e,t,i)};wp.ccf.collections=wp.ccf.collections||{},wp.ccf.collections.Forms=wp.ccf.collections.Forms||wp.api.collections.Posts.extend({model:wp.ccf.models.Form,url:l.apiRoot.replace(/\/$/,"")+"/ccf/v1/forms",formsFetching:{},initialize:function(){this.constructor.__super__.initialize(),this.formsFetching={}},sync:s,remove:function(e,t){t=t||{};var l=this.constructor.__super__.remove.call(this,e,t);return t.destroy&&(e instanceof Array?i.each(e,function(e){e.destroy()}):e.destroy()),l}}),wp.ccf.collections.Fields=wp.ccf.collections.Fields||wp.api.collections.Posts.extend({model:wp.ccf.models.Field,url:function(){return l.apiRoot+"/ccf/forms/"+this.formId+"/fields"},initialize:function(e,t){t&&t.formId&&(this.formId=t.formId)},sync:s}),wp.ccf.collections.PostFieldMappings=wp.ccf.collections.PostFieldMappings||t.Collection.extend({model:wp.ccf.models.PostFieldMapping}),wp.ccf.collections.FormNotificationAddresses=wp.ccf.collections.FormNotificationAddresses||t.Collection.extend({model:wp.ccf.models.FormNotificationAddress}),wp.ccf.collections.FormNotifications=wp.ccf.collections.FormNotifications||t.Collection.extend({model:wp.ccf.models.FormNotification}),wp.ccf.collections.Submissions=wp.ccf.collections.Submissions||wp.api.collections.Posts.extend({model:wp.ccf.models.Submission,url:function(){return l.apiRoot.replace(/\/$/,"")+"/ccf/v1/forms/"+this.formId+"/submissions"},initialize:function(e,t){this.constructor.__super__.initialize.apply(this,arguments),t&&t.formId&&(this.formId=t.formId)},sync:s}),wp.ccf.collections.FieldChoices=wp.ccf.collections.FieldChoices||t.Collection.extend({model:wp.ccf.models.FieldChoice}),wp.ccf.collections.FieldConditionals=wp.ccf.collections.FieldConditionals||t.Collection.extend({model:wp.ccf.models.FieldConditional})}(jQuery,Backbone,_,ccfSettings),function(e,t,i,l){"use strict";wp.ccf.views=wp.ccf.views||{},wp.ccf.views.Fields=wp.ccf.views.Fields||{},wp.ccf.views.FieldChoice=t.View.extend({template:wp.ccf.utils.template("ccf-field-choice-template"),className:"choice",events:{"click .add":"triggerAdd","click .delete":"triggerDelete",saveChoice:"saveChoice",sorted:"triggerUpdateSort"},initialize:function(e){this.field=e.field},destroy:function(){wp.ccf.dispatcher.off("mainViewChange",this.saveChoice),this.unbind()},triggerUpdateSort:function(e,t){this.field.get("choices").remove(this.model,{silent:!0}),this.field.get("choices").add(this.model,{at:t,silent:!0})},saveChoice:function(){if(""!==this.el.innerHTML){var e=this.el.querySelectorAll(".choice-label")[0].value,t=this.el.querySelectorAll(".choice-value")[0].value;this.model.set("label",e),this.model.set("value",t);var i=this.el.querySelectorAll(".choice-selected")[0],l=i.checked?!0:!1;return this.model.set("selected",l),this}},render:function(){var e={};return this.model&&(e.choice=this.model.toJSON()),this.el.innerHTML=this.template(e),wp.ccf.dispatcher.on("mainViewChange",this.saveChoice,this),this},triggerAdd:function(){this.field.get("choices").add(new wp.ccf.models.FieldChoice)},triggerDelete:function(){var e=this.field.get("choices");if(e.length>1)e.remove(this.model),this.destroy(),this.remove();else{for(var t=this.el.querySelectorAll(".choice-label, .choice-value"),i=this.el.querySelectorAll(".choice-selected"),l=0;t.length>l;l++)t[l].value="";i[0].checked=!1}}}),wp.ccf.views.FieldConditional=t.View.extend({template:wp.ccf.utils.template("ccf-field-conditional-template"),className:"conditional",events:{"click .add":"triggerAdd","click .delete":"triggerDelete",saveConditional:"saveConditional"},initialize:function(e){this.field=e.field,this.fieldCollection=e.fieldCollection},destroy:function(){wp.ccf.dispatcher.off("mainViewChange",this.saveConditional),this.unbind()},saveConditional:function(){if(""!==this.el.innerHTML){var e=this.el.querySelectorAll(".conditional-field")[0].value,t=this.el.querySelectorAll(".conditional-value")[0].value,i=this.el.querySelectorAll(".conditional-compare")[0].value;return this.model.set("field",e),this.model.set("value",t),this.model.set("compare",i),this}},updateFields:function(){var e=this.el.querySelectorAll(".conditional-field")[0];e.innerHTML="",e.disabled=!1;var t,i=0,s=this.model.get("field");this.fieldCollection.length>=1&&(t=document.createElement("option"),t.innerHTML=l.chooseFormField,t.value="",e.appendChild(t),this.fieldCollection.each(function(l){if(this.field.get("slug")!==l.get("slug")){var o=l.get("type");"address"!==o&&"checkboxes"!==o&&"date"!==o&&"name"!==o&&"file"!==o&&"recaptcha"!==o&&"section-header"!==o&&"html"!==o&&(t=document.createElement("option"),t.innerHTML=l.get("slug"),t.value=l.get("slug"),l.get("slug")===s&&(t.selected=!0),e.appendChild(t),i++)}},this)),0===i&&(e.innerHTML="",t=document.createElement("option"),t.innerHTML=l.noAvailableFields,t.value="",e.appendChild(t),e.disabled=!0)},render:function(){var e={};return this.model&&(e.conditional=this.model.toJSON()),this.el.innerHTML=this.template(e),wp.ccf.dispatcher.on("mainViewChange",this.saveConditional,this),this.listenTo(this.fieldCollection,"add",this.updateFields,this),this.listenTo(this.fieldCollection,"remove",this.updateFields,this),this.updateFields(),this},triggerAdd:function(){this.field.get("conditionals").add(new wp.ccf.models.FieldConditional)},triggerDelete:function(){var e=this.field.get("conditionals");if(e.length>1)e.remove(this.model),this.destroy(),this.remove();else{var t=this.el.querySelectorAll(".conditional-value")[0],i=this.el.querySelectorAll(".conditional-field")[0];t.value="";for(var l=0;i.childNodes.length>l;l++)i.childNodes[l].selected=!1}}}),wp.ccf.views.EmptyFormNotificationTableRow=wp.ccf.views.EmptyFormNotificationTableRow||t.View.extend({tagName:"tr",template:wp.ccf.utils.template("ccf-empty-form-notification-row-template"),events:{"click .add":"triggerAdd"},initialize:function(e){this.form=e.form},destroy:function(){this.unbind()},render:function(){return this.$el.html(this.template()),this},triggerAdd:function(){var e=this.form.get("notifications");this.destroy(),e.add(new wp.ccf.models.FormNotification)}}),wp.ccf.views.EmptyFormTableRow=wp.ccf.views.EmptyFormTableRow||t.View.extend({tagName:"tr",template:wp.ccf.utils.template("ccf-empty-form-table-row-template"),render:function(){return this.$el.html(this.template()),this}}),wp.ccf.views.FormNotificationAddress=t.View.extend({template:wp.ccf.utils.template("ccf-form-notification-address-template"),className:"address",events:{"click .add":"triggerAdd","click .delete":"triggerDelete","blur input":"save","change select":"save"},initialize:function(e){this.notification=e.notification,this.parent=e.parent,this.form=e.form},destroy:function(){this.unbind()},save:function(){if(""!==this.el.innerHTML){var e=this.el.querySelectorAll(".form-notification-address-type")[0].value,t=this.el.querySelectorAll(".form-notification-address-email"),i=this.el.querySelectorAll(".form-notification-address-field"),l=this.model.get("type");return t.length&&this.model.set("email",t[0].value),i.length&&this.model.set("field",i[0].value),this.model.set("type",e),l!==e&&this.render(),this}},updateFromFieldField:function(){if("edit"===this.parent.context&&"field"===this.model.get("type")){var e=this.el.querySelectorAll(".form-notification-address-field")[0];e.innerHTML="",e.disabled=!1;var t,i=this.form.get("fields"),s=0,o=this.model.get("field");i.length>=1&&i.each(function(i){("email"===i.get("type")||"dropdown"===i.get("type")||"radio"===i.get("type")||"single-line-text"===i.get("type"))&&(t=document.createElement("option"),t.innerHTML=i.get("slug"),t.value=i.get("slug"),i.get("slug")===o&&(t.selected=!0),e.appendChild(t),s++)}),0===s&&(t=document.createElement("option"),t.innerHTML=l.noApplicableFields,t.value="",e.appendChild(t),e.disabled=!0)}},render:function(){var e={};this.model&&(e.address=this.model.toJSON()),this.el.innerHTML=this.template(e);var t=this.form.get("fields");return this.listenTo(t,"add",this.updateFromFieldField,this),this.listenTo(t,"remove",this.updateFromFieldField,this),"field"===this.model.get("type")&&this.updateFromFieldField(),this},triggerAdd:function(){this.notification.get("addresses").add(new wp.ccf.models.FormNotificationAddress)},triggerDelete:function(){var e=this.notification.get("addresses");e.length>1?this.parent.deleteAddress(this):(this.model.clear().set(wp.ccf.models.FormNotificationAddress.prototype.defaults),this.destroy(),this.render())}}),wp.ccf.views.ExistingFormNotificationRow=t.View.extend({template:wp.ccf.utils.template("ccf-existing-form-notification-table-row-template"),tagName:"tr",events:{"change select.form-email-notification-from-type":"toggleNotificationFields","change select.form-email-notification-from-name-type":"toggleNotificationFields","change select.form-email-notification-subject-type":"toggleNotificationFields","click .close-notification":"changeContext","click .edit-notification":"changeContext","click .delete-notification":"triggerDelete","blur input":"save","change select":"save"},addressViews:[],initialize:function(e){this.form=e.form,this.addressViews=[],this.parent=e.parent,this.context=e.context!==void 0?e.context:"view";var t=this.model.get("addresses");this.listenTo(t,"add",this.addAddress)},deleteAddress:function(e){i.each(this.addressViews,function(t){if(e.cid===t.cid){var l=i.indexOf(this.addressViews,t);this.model.get("addresses").remove(e.model),this.addressViews[l].remove(),this.addressViews.splice(l,1)}},this)},addAddress:function(e){var t=this.el.querySelectorAll(".addresses")[0],i=new wp.ccf.views.FormNotificationAddress({model:e,parent:this,notification:this.model,form:this.form});this.addressViews.push(i),t.appendChild(i.render().el)},destroy:function(){this.unbind()},changeContext:function(e,t){"edit"===this.context&&this.save(),t?this.context=t:("view"===this.context&&this.parent.closeAllNotifications(),this.context="edit"===this.context?"view":"edit"),this.destroy(),this.render()},updateFieldVariables:function(){if("edit"===this.context){var e,t=this.el.querySelectorAll(".field-variables")[0],i="",l=this.form.get("fields");l.each(function(t){e=t.get("type"),"html"!==e&&"section-header"!==e&&"recaptcha"!==e&&(i+="["+t.get("slug")+"] ")}),t.innerText=i}},updateFromFieldField:function(){if("edit"===this.context){var e=this.el.querySelectorAll(".form-email-notification-from-field")[0];e.innerHTML="",e.disabled=!1;var t=this.el.querySelectorAll(".form-email-notification-subject-field")[0];t.innerHTML="",t.disabled=!1;var i=this.el.querySelectorAll(".form-email-notification-from-name-field")[0];i.innerHTML="",i.disabled=!1;var s,o=this.form.get("fields"),n=0,c=0,r=0,a=this.model.get("emailNotificationFromField"),d=this.model.get("emailNotificationSubjectField"),u=this.model.get("emailNotificationFromNameField");o.length>=1&&o.each(function(l){("email"===l.get("type")||"dropdown"===l.get("type")||"radio"===l.get("type")||"single-line-text"===l.get("type"))&&(s=document.createElement("option"),s.innerHTML=l.get("slug"),s.value=l.get("slug"),l.get("slug")===a&&(s.selected=!0),e.appendChild(s),n++),("name"===l.get("type")||"single-line-text"===l.get("type")||"radio"===l.get("type")||"dropdown"===l.get("type"))&&(s=document.createElement("option"),s.innerHTML=l.get("slug"),s.value=l.get("slug"),l.get("slug")===u&&(s.selected=!0),i.appendChild(s),c++),("single-line-text"===l.get("type")||"radio"===l.get("type")||"dropdown"===l.get("type"))&&(s=document.createElement("option"),s.innerHTML=l.get("slug"),s.value=l.get("slug"),l.get("slug")===d&&(s.selected=!0),t.appendChild(s),r++)}),0===n&&(s=document.createElement("option"),s.innerHTML=l.noEmailFields,s.value="",e.appendChild(s),e.disabled=!0),0===c&&(s=document.createElement("option"),s.innerHTML=l.noNameFields,s.value="",i.appendChild(s),i.disabled=!0),0===r&&(s=document.createElement("option"),s.innerHTML=l.noApplicableFields,s.value="",t.appendChild(s),t.disabled=!0)}},toggleNotificationFields:function(){var e=this.el.querySelectorAll(".email-notification-from-address")[0],t=this.el.querySelectorAll(".email-notification-from-field")[0],i=this.el.querySelectorAll(".form-email-notification-from-type")[0],l=this.el.querySelectorAll(".email-notification-subject")[0],s=this.el.querySelectorAll(".email-notification-subject-field")[0],o=this.el.querySelectorAll(".form-email-notification-subject-type")[0],n=this.el.querySelectorAll(".email-notification-from-name")[0],c=this.el.querySelectorAll(".email-notification-from-name-field")[0],r=this.el.querySelectorAll(".form-email-notification-from-name-type")[0];e.style.display="none",t.style.display="none","custom"===i.value?e.style.display="block":"field"===i.value&&(t.style.display="block"),l.style.display="none",s.style.display="none","custom"===o.value?l.style.display="block":"field"===o.value&&(s.style.display="block"),n.style.display="none",c.style.display="none","custom"===r.value?n.style.display="block":"field"===r.value&&(c.style.display="block")},save:function(){if(""!==this.el.innerHTML&&"edit"===this.context){var e=this.el.querySelectorAll(".form-email-notification-title")[0].value;this.model.set("title",e);var t=this.el.querySelectorAll(".form-email-notification-content")[0].value;this.model.set("content",t);var i=this.el.querySelectorAll(".form-email-notification-active")[0].value;this.model.set("active","1"===i?!0:!1);var l=this.el.querySelectorAll(".form-email-notification-from-type")[0].value;this.model.set("fromType",l);var s=this.el.querySelectorAll(".form-email-notification-from-address")[0].value;this.model.set("fromAddress",s);var o=this.el.querySelectorAll(".form-email-notification-from-field")[0].value;this.model.set("fromField",o);var n=this.el.querySelectorAll(".form-email-notification-from-name-type")[0].value;this.model.set("fromNameType",n);var c=this.el.querySelectorAll(".form-email-notification-from-name")[0].value;this.model.set("fromName",c);var r=this.el.querySelectorAll(".form-email-notification-from-name-field")[0].value;this.model.set("fromNameField",r);var a=this.el.querySelectorAll(".form-email-notification-subject-type")[0].value;this.model.set("subjectType",a);var d=this.el.querySelectorAll(".form-email-notification-subject")[0].value;this.model.set("subject",d);var u=this.el.querySelectorAll(".form-email-notification-subject-field")[0].value;this.model.set("subjectField",u);for(var f=0;this.addressViews.length>f;f++)this.addressViews[f].save();return this}},render:function(){var e={context:this.context,form:this.form.toJSON()};if(this.model&&(e.notification=this.model.toJSON()),this.el.innerHTML=this.template(e),"edit"===this.context){this.toggleNotificationFields(),this.updateFromFieldField(),this.updateFieldVariables();var t=this.el.querySelectorAll(".addresses")[0],i=this.model.get("addresses");if(i.length>=1)i.each(function(e){var i=new wp.ccf.views.FormNotificationAddress({model:e,parent:this,notification:this.model,form:this.form}).render();t.appendChild(i.el),this.addressViews.push(i)},this);else{var l=new wp.ccf.models.FormNotificationAddress;i.add(l)}}var s=this.form.get("fields");return this.listenTo(s,"add",this.updateFromFieldField,this),this.listenTo(s,"remove",this.updateFromFieldField,this),this.listenTo(s,"add",this.updateFieldVariables,this),this.listenTo(s,"remove",this.updateFieldVariables,this),this},triggerDelete:function(){this.parent.deleteNotification(this)}}),wp.ccf.views.FieldBase=wp.ccf.views.FieldBase||t.View.extend({events:{"blur input":"saveField","blur input.field-slug":"checkSlug","blur textarea":"saveField","change select":"saveField",'change input[type="checkbox"]':"saveField"},initialize:function(){var e=this.model.get("conditionals");this.listenTo(e,"add",this.addConditional)},addConditional:function(e){var t=new wp.ccf.views.FieldConditional({model:e,field:this.model,fieldCollection:this.collection}).render(),i=this.el.querySelectorAll(".conditionals")[0];i.appendChild(t.el)},checkSlug:function(){var e=this.el.querySelectorAll(".field-slug");if(e.length>0){var t=e[0],i=!1;t.parentNode.className=t.value&&!t.value.match(/^[a-zA-Z0-9\-_]+$/)?t.parentNode.className.replace(/ field-error/i,"")+" field-error":t.parentNode.className.replace(/ field-error/i,""),this.collection.length>0&&""!==t.value?(this.collection.each(function(e){e!==this.model&&t.value===e.get("slug")&&(i=!0)
|
2 |
+
},this),t.parentNode.className=i?t.parentNode.className.replace(/ field-duplicate-slug/i,"")+" field-duplicate-slug":t.parentNode.className.replace(/ field-duplicate-slug/i,"")):t.parentNode.className=t.parentNode.className.replace(/ field-duplicate-slug/i,"")}},destroy:function(){this.unbind()},saveField:function(){var t=this.el.querySelectorAll(".conditionals")[0].querySelectorAll(".conditional");i.each(t,function(t){e(t).trigger("saveConditional")}),this.model.set("conditionalType",this.el.querySelectorAll(".field-conditional-type")[0].value),this.model.set("conditionalFieldsRequired",this.el.querySelectorAll(".field-conditional-fields-required")[0].value);var l=this.model.get("conditionalsEnabled");this.model.set("conditionalsEnabled",1==this.el.querySelectorAll(".field-conditionals-enabled")[0].value?!0:!1),l!==this.model.get("conditionalsEnabled")&&this.render("advanced")},render:function(e){e=e?e:"basic",this.el.innerHTML=this.template({field:this.model.toJSON(),startPanel:e}),this.checkSlug();var t=this.model.get("conditionals"),i=this.el.querySelectorAll(".conditionals")[0];if(t.length>=1)t.each(function(e){var t=new wp.ccf.views.FieldConditional({model:e,field:this.model,fieldCollection:this.collection}).render();i.appendChild(t.el)},this);else{var l=new wp.ccf.models.FieldConditional;t.add(l)}return this}}),wp.ccf.views.Fields["single-line-text"]=wp.ccf.views.Fields["single-line-text"]||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-single-line-text-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("placeholder",this.el.querySelectorAll(".field-placeholder")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this.constructor.__super__.saveField.apply(this,arguments),this):void 0}}),wp.ccf.views.Fields.file=wp.ccf.views.Fields.file||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-file-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this.model.set("fileExtensions",this.el.querySelectorAll(".field-file-extensions")[0].value),this.model.set("maxFileSize",this.el.querySelectorAll(".field-max-file-size")[0].value),this.constructor.__super__.saveField.apply(this,arguments),this):void 0}}),wp.ccf.views.Fields.recaptcha=wp.ccf.views.Fields.recaptcha||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-recaptcha-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("siteKey",this.el.querySelectorAll(".field-site-key")[0].value),this.model.set("secretKey",this.el.querySelectorAll(".field-secret-key")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.constructor.__super__.saveField.apply(this,arguments),this):void 0}}),wp.ccf.views.Fields["section-header"]=wp.ccf.views.Fields["section-header"]||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-section-header-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("heading",this.el.querySelectorAll(".field-heading")[0].value),this.model.set("subheading",this.el.querySelectorAll(".field-subheading")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.constructor.__super__.saveField.apply(this,arguments),this):void 0}}),wp.ccf.views.Fields.html=wp.ccf.views.Fields.html||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-html-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("html",this.el.querySelectorAll(".field-html")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.constructor.__super__.saveField.apply(this,arguments),this):void 0}}),wp.ccf.views.Fields["paragraph-text"]=wp.ccf.views.Fields["paragraph-text"]||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-paragraph-text-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("placeholder",this.el.querySelectorAll(".field-placeholder")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this.constructor.__super__.saveField.apply(this,arguments),this):void 0}}),wp.ccf.views.Fields.hidden=wp.ccf.views.Fields.hidden||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-hidden-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.constructor.__super__.saveField.apply(this,arguments),this):void 0}}),wp.ccf.views.Fields.date=wp.ccf.views.Fields.date||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-date-template"),saveField:function(){if(""!==this.el.innerHTML){this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.constructor.__super__.saveField.apply(this,arguments);var e=this.el.querySelectorAll(".field-value");e.length>0&&this.model.set("value",e[0].value);var t=this.el.querySelectorAll(".field-date-format");t.length&&this.model.set("dateFormat",t[0].value);var i=this.model.get("showDate"),l=this.el.querySelectorAll(".field-show-date")[0].checked?!0:!1;this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("showDate",l);var s=this.model.get("showTime"),o=this.el.querySelectorAll(".field-show-time")[0].checked?!0:!1;return this.model.set("showTime",o),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),(o!=s||l!=i)&&this.render(),this}}}),wp.ccf.views.Fields.name=wp.ccf.views.Fields.name||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-name-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this.constructor.__super__.saveField.apply(this,arguments),this):void 0}}),wp.ccf.views.Fields.website=wp.ccf.views.Fields.website||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-website-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("placeholder",this.el.querySelectorAll(".field-placeholder")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this.constructor.__super__.saveField.apply(this,arguments),this):void 0}}),wp.ccf.views.Fields.phone=wp.ccf.views.Fields.phone||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-phone-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("placeholder",this.el.querySelectorAll(".field-placeholder")[0].value),this.model.set("phoneFormat",this.el.querySelectorAll(".field-phone-format")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this.constructor.__super__.saveField.apply(this,arguments),this):void 0}}),wp.ccf.views.Fields.address=wp.ccf.views.Fields.address||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-address-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("addressType",this.el.querySelectorAll(".field-address-type")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this.constructor.__super__.saveField.apply(this,arguments),this):void 0}}),wp.ccf.views.Fields.email=wp.ccf.views.Fields.email||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-email-template"),saveField:function(){if(""!==this.el.innerHTML){this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.constructor.__super__.saveField.apply(this,arguments);var e=this.el.querySelectorAll(".field-value");e.length&&this.model.set("value",e[0].value);var t=this.el.querySelectorAll(".field-placeholder");t.length&&this.model.set("placeholder",t[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1);var i=1==this.el.querySelectorAll(".field-email-confirmation")[0].value?!0:!1,l=this.model.get("emailConfirmation");return this.model.set("emailConfirmation",i),l!=i&&this.render(),this}}}),wp.ccf.views.ChoiceableField=wp.ccf.views.ChoiceableField||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-dropdown-template"),initialize:function(){var e=this.model.get("choices");this.listenTo(e,"add",this.addChoice)},addChoice:function(e){var t=new wp.ccf.views.FieldChoice({model:e,field:this.model}).render(),i=this.el.querySelectorAll(".repeatable-choices")[0];i.appendChild(t.el)},saveField:function(){if(""!==this.el.innerHTML){this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),wp.ccf.views.ChoiceableField.__super__.saveField.apply(this,arguments);var t=this.el.querySelectorAll(".repeatable-choices")[0].querySelectorAll(".choice");return i.each(t,function(t){e(t).trigger("saveChoice")}),this}},render:function(t){var i=this;t=t?t:"basic",i.el.innerHTML=i.template({field:i.model.toJSON(),startPanel:t}),i.checkSlug();var l=i.model.get("choices"),s=this.el.querySelectorAll(".repeatable-choices")[0];if(l.length>=1)l.each(function(e){var t=new wp.ccf.views.FieldChoice({model:e,field:i.model}).render();s.appendChild(t.el)});else{var o=new wp.ccf.models.FieldChoice;l.add(o)}s=this.el.querySelectorAll(".repeatable-choices")[0],e(s).sortable({handle:".move",axis:"y",stop:function(e,t){t.item.trigger("sorted",t.item.index())}});var n=this.model.get("conditionals"),c=this.el.querySelectorAll(".conditionals")[0];if(n.length>=1)n.each(function(e){var t=new wp.ccf.views.FieldConditional({model:e,field:this.model,fieldCollection:this.collection}).render();c.appendChild(t.el)},this);else{var r=new wp.ccf.models.FieldConditional;n.add(r)}return i}}),wp.ccf.views.Fields.dropdown=wp.ccf.views.Fields.dropdown||wp.ccf.views.ChoiceableField.extend({template:wp.ccf.utils.template("ccf-dropdown-template"),events:function(){return this.constructor.__super__.events}}),wp.ccf.views.Fields.radio=wp.ccf.views.Fields.radio||wp.ccf.views.ChoiceableField.extend({template:wp.ccf.utils.template("ccf-radio-template"),events:function(){return this.constructor.__super__.events}}),wp.ccf.views.Fields.checkboxes=wp.ccf.views.Fields.checkboxes||wp.ccf.views.ChoiceableField.extend({template:wp.ccf.utils.template("ccf-checkboxes-template"),events:function(){return this.constructor.__super__.events}}),wp.ccf.views.FieldSidebar=wp.ccf.views.FieldSidebar||t.View.extend({initialize:function(e){this.currentFieldView=null,this.form=e.form},save:function(e){this.currentFieldView&&""!==this.currentFieldView.el.innerHTML&&this.currentFieldView.saveField(),e&&e instanceof Object&&e.resolve()},fieldRemoved:function(){this.currentFieldView&&(this.form.get("fields").get(this.currentFieldView.model)||this.render())},destroy:function(){wp.ccf.dispatcher.off("saveField",this.save),wp.ccf.dispatcher.off("mainViewChange",this.save),this.unbind()},render:function(e){var t={};if(e){var i=e.get("type");this.currentFieldView&&(this.currentFieldView.saveField(),this.currentFieldView.destroy&&this.currentFieldView.destroy()),this.currentFieldView=new wp.ccf.views.Fields[i]({model:e,collection:this.form.get("fields")}),this.currentFieldView.render(),this.el.innerHTML="",this.el.appendChild(this.currentFieldView.el);var l=this.form.get("fields");this.listenTo(l,"remove",this.fieldRemoved)}else{var s=wp.ccf.utils.template("ccf-empty-field-template");this.el.innerHTML=s(t)}return wp.ccf.dispatcher.on("saveField",this.save,this),wp.ccf.dispatcher.on("mainViewChange",this.save,this),this}}),wp.ccf.views.FieldRowPlaceholder=wp.ccf.views.FieldRowPlaceholder||t.View.extend({template:wp.ccf.utils.template("ccf-field-row-template"),tagName:"div",className:"field",initialize:function(e){this.type=e.type},render:function(){return this.el.innerHTML=this.template({label:l.allLabels[this.type]}),this.el.setAttribute("data-field-type",this.type),this.el.className+=" "+this.type,this}}),wp.ccf.views.FieldRow=wp.ccf.views.FieldRow||t.View.extend({template:wp.ccf.utils.template("ccf-field-row-template"),tagName:"div",className:"field",events:{"click .delete":"triggerDelete","click h4":"triggerEdit",sorted:"triggerUpdateSort"},initialize:function(e){i.bindAll(this,"triggerDelete"),this.form=e.form,this.listenTo(this.model,"change",this.handleChange,this),this.listenTo(this.model,"requirementsNotMet",this.requirementsNotMet,this),this.listenTo(this.model,"requirementsMet",this.requirementsMet,this),this.listenTo(this.model,"duplicateSlug",this.duplicateSlug,this),this.model.attributes.choices&&this.listenTo(this.model.attributes.choices,"change",this.handleChange,this)},duplicateSlug:function(){this.requirementsMet(),this.el.className+=" field-duplicate-slug"},requirementsNotMet:function(){this.requirementsMet(),this.el.className+=" field-incomplete"},requirementsMet:function(){this.el.className=this.el.className.replace(/(field-incomplete|field-duplicate-slug)/i,"")},triggerUpdateSort:function(e,t){this.form.get("fields").remove(this.model),this.form.get("fields").add(this.model,{at:t})},handleChange:function(){this.render()},triggerDelete:function(e){e.stopPropagation(),this.form.get("fields").remove(this.model),this.undelegateEvents(),this.remove()},triggerEdit:function(){var e=this.el.parentNode.querySelectorAll(".ccf-editing");i.each(e,function(e){e.className=e.className.replace(/ccf-editing/i,"")}),this.el.className=this.el.className.replace(/ccf-editing/i,"")+" ccf-editing",wp.ccf.dispatcher.trigger("openEditField",this.model)},render:function(e){this.el.innerHTML=this.template({label:l.allLabels[this.model.get("type")]}),this.el.setAttribute("data-field-type",this.model.get("type"));var t=RegExp(" "+this.model.get("type"),"i");this.el.className=this.el.className.replace(t,"")+" "+this.model.get("type"),e&&(this.el.className=this.el.className.replace(/ instantiated/i,"")+" instantiated");var i=document.getElementById("ccf-"+this.model.get("type")+"-preview-template");if(i){var s=this.el.querySelectorAll(".preview")[0];s.style.display="block",s.innerHTML=wp.ccf.utils.template("ccf-"+this.model.get("type")+"-preview-template")({field:this.model.toJSON()})}return this}}),wp.ccf.views.PostFieldMapping=t.View.extend({template:wp.ccf.utils.template("ccf-post-field-mapping"),className:"field-mapping",events:{"click .add":"triggerAdd","click .delete":"triggerDelete","blur input":"save","change select":"save"},initialize:function(e){this.parent=e.parent,this.form=e.form},destroy:function(){this.unbind()},save:function(){if(""!==this.el.innerHTML){var e=this.el.querySelectorAll(".field-form-field")[0].value,t=this.el.querySelectorAll(".field-post-field")[0].value,i=this.el.querySelectorAll(".field-custom-field-key"),l=this.model.get("postField");return this.model.set("formField",e),this.model.set("postField",t),i.length&&this.model.set("customFieldKey",i[0].value),l!==t&&this.render(),this}},updateFormFieldField:function(){var e=this.el.querySelectorAll(".field-form-field")[0];e.innerHTML="",e.disabled=!1;var t,i=this.form.get("fields"),s=0,o=this.model.get("formField");i.length>=1&&(t=document.createElement("option"),t.innerHTML=l.chooseFormField,t.value="",e.appendChild(t),i.each(function(i){t=document.createElement("option"),t.innerHTML=i.get("slug"),t.value=i.get("slug"),i.get("slug")===o&&(t.selected=!0),e.appendChild(t),s++})),0===s&&(t=document.createElement("option"),t.innerHTML=l.noAvailableFields,t.value="",e.appendChild(t),e.disabled=!0)},updatePostFields:function(){var e,t=this.el.querySelectorAll(".field-post-field")[0];e=document.createElement("option"),e.value="",e.innerText=l.choosePostField,t.appendChild(e);var s=this.form.get("postFieldMappings"),o=[];s.each(function(e){e!==this.model&&o.push(e.get("postField"))},this),i.each(l.postFields.single,function(i,l){-1===o.indexOf(l)&&(e=document.createElement("option"),e.value=l,e.innerText=i,this.model.get("postField")===l&&(e.selected=!0),t.appendChild(e))},this),i.each(l.postFields.repeatable,function(i,l){e=document.createElement("option"),e.value=l,e.innerText=i,this.model.get("postField")===l&&(e.selected=!0),t.appendChild(e)},this)},render:function(){var e={};this.model&&(e.mapping=this.model.toJSON()),this.el.innerHTML=this.template(e);var t=this.form.get("fields");return this.listenTo(t,"add",this.updateFormFieldField,this),this.listenTo(t,"remove",this.updateFormFieldField,this),this.updateFormFieldField(),this.updatePostFields(),this},triggerAdd:function(){this.form.get("postFieldMappings").add(new wp.ccf.models.PostFieldMapping)},triggerDelete:function(){var e=this.form.get("postFieldMappings");e.length>1?this.parent.deletePostFieldMapping(this):(this.model.clear().set(wp.ccf.models.PostFieldMapping.prototype.defaults),this.destroy(),this.render())}}),wp.ccf.views.FormSettings=wp.ccf.views.FormSettings||t.View.extend({template:wp.ccf.utils.template("ccf-form-settings-template"),events:{"blur input":"save","change select":"save","change select.form-completion-action-type":"toggleCompletionFields","change select.form-pause":"togglePauseFields","change select.form-post-creation":"togglePostCreationFields","click .add-notification":"triggerAddNotification"},notificationViews:[],mappingViews:[],initialize:function(e){this.model=e.form,this.notificationViews=[],this.mappingViews=[];var t=this.model.get("notifications");this.listenTo(t,"add",this.addNotification);var i=this.model.get("postFieldMappings");this.listenTo(i,"add",this.addPostFieldMapping)},deletePostFieldMapping:function(e){i.each(this.mappingViews,function(t){if(e.cid===t.cid){var l=i.indexOf(this.mappingViews,t);this.model.get("postFieldMappings").remove(e.model),this.mappingViews[l].remove(),this.mappingViews.splice(l,1)}},this)},addPostFieldMapping:function(e){var t=this.el.querySelectorAll(".post-creation-mapping")[0],i=new wp.ccf.views.PostFieldMapping({model:e,parent:this,form:this.model});this.mappingViews.push(i),t.appendChild(i.render().el)},triggerAddNotification:function(){var e=this.model.get("notifications");e.add(new wp.ccf.models.FormNotification)},closeAllNotifications:function(){i.each(this.notificationViews,function(e){e.changeContext(null,"view")})},addNotification:function(e){var t=new wp.ccf.views.ExistingFormNotificationRow({model:e,form:this.model,context:"edit",parent:this}).render(),l=this.el.querySelectorAll(".ccf-form-notifications .rows")[0];l.querySelectorAll(".no-notifications").length>0&&l.removeChild(l.firstChild),i.each(this.notificationViews,function(e){e.changeContext(null,"view")}),this.notificationViews.push(t),l.appendChild(t.el)},toggleCompletionFields:function(){var e=this.el.querySelectorAll(".form-completion-action-type")[0].value,t=this.el.querySelectorAll(".completion-message")[0],i=this.el.querySelectorAll(".completion-redirect-url")[0];"text"===e?(t.style.display="block",i.style.display="none"):(t.style.display="none",i.style.display="block")},togglePauseFields:function(){var e=this.el.querySelectorAll(".form-pause")[0].value,t=this.el.querySelectorAll(".pause-message")[0];t.style.display=parseInt(e)?"block":"none"},togglePostCreationFields:function(){var t=this.el.querySelectorAll(".form-post-creation")[0].value,i=e(this.el.querySelectorAll(".post-creation-mapping-field"));parseInt(t)?i.show():i.hide()},save:function(){if(""!==this.el.innerHTML){var e=this.el.querySelectorAll(".form-title")[0].value;this.model.set("title",{raw:e});var t=this.el.querySelectorAll(".form-description")[0].value;this.model.set("description",t);var i=this.el.querySelectorAll(".form-button-text")[0].value;this.model.set("buttonText",i);var l=this.el.querySelectorAll(".form-pause")[0].value;this.model.set("pause",parseInt(l)?!0:!1);var s=this.el.querySelectorAll(".form-post-creation")[0].value;this.model.set("postCreation",parseInt(s)?!0:!1);var o=this.el.querySelectorAll(".form-post-creation-type")[0].value;this.model.set("postCreationType",o);var n=this.el.querySelectorAll(".form-post-creation-status")[0].value;this.model.set("postCreationStatus",n);var c=this.el.querySelectorAll(".form-pause-message")[0].value;this.model.set("pauseMessage",c);var r=this.el.querySelectorAll(".form-completion-message")[0].value;this.model.set("completionMessage",r);var a=this.el.querySelectorAll(".form-completion-redirect-url")[0].value;this.model.set("completionRedirectUrl",a);var d=this.el.querySelectorAll(".form-completion-action-type")[0].value;this.model.set("completionActionType",d);var u=this.el.querySelectorAll(".form-theme")[0].value;this.model.set("theme",u)}},fullSave:function(e){""!==this.el.innerHTML&&(this.save(),i.each(this.notificationViews,function(e){e.save()}),i.each(this.mappingViews,function(e){e.save()}),e!==void 0&&e.promise!==void 0&&e.resolve())},destroy:function(){wp.ccf.dispatcher.off("saveFormSettings",this.fullSave),wp.ccf.dispatcher.off("mainViewChange",this.fullSave)},deleteNotification:function(e){if(i.each(this.notificationViews,function(t){if(e.cid===t.cid){var l=i.indexOf(this.notificationViews,t);this.model.get("notifications").remove(e.model),this.notificationViews[l].remove(),this.notificationViews.splice(l,1)}},this),!this.notificationViews.length){var t=this.el.querySelectorAll(".ccf-form-notifications .rows")[0];t.appendChild(new wp.ccf.views.EmptyFormNotificationTableRow({form:this.model}).render().el)}},render:function(){var e={form:this.model.toJSON()};this.model.get("fields");var t=this.model.get("notifications");this.el.innerHTML=this.template(e),this.toggleCompletionFields(),this.togglePostCreationFields(),this.togglePauseFields();var i=this.el.querySelectorAll(".ccf-form-notifications .rows")[0],l=document.createElement("tbody");l.className="rows",t.length>=1?t.each(function(e){var t=new wp.ccf.views.ExistingFormNotificationRow({model:e,form:this.model,parent:this}).render();l.appendChild(t.el),this.notificationViews.push(t)},this):l.appendChild(new wp.ccf.views.EmptyFormNotificationTableRow({form:this.model}).render().el),i.parentNode.replaceChild(l,i);var s=this.el.querySelectorAll(".post-creation-mapping")[0],o=this.model.get("postFieldMappings");if(o.length>=1)o.each(function(e){var t=new wp.ccf.views.PostFieldMapping({model:e,parent:this,form:this.model}).render();s.appendChild(t.el),this.mappingViews.push(t)},this);else{var n=new wp.ccf.models.PostFieldMapping;o.add(n)}return wp.ccf.dispatcher.on("mainViewChange",this.fullSave,this),wp.ccf.dispatcher.on("saveFormSettings",this.fullSave,this),this}}),wp.ccf.views.FormPane=wp.ccf.views.FormPane||t.View.extend(i.defaults({template:wp.ccf.utils.template("ccf-form-pane-template"),subViews:{"field-sidebar":wp.ccf.views.FieldSidebar,"form-settings":wp.ccf.views.FormSettings},events:{"click .save-button":"sync","click .signup-button":"signup","click .accordion-heading":"accordionClick","click .form-settings-heading":"accordionClick","click .insert-form-button":"insertForm"},initialize:function(){wp.ccf.dispatcher.on("openEditField",this.openEditField,this)},insertForm:function(){wp.ccf.utils.insertFormShortcode(this.model),wp.ccf.toggle()},signup:function(){var t=this.el.querySelectorAll(".email-signup-field")[0].value,i=this.el.querySelectorAll(".bottom .left.signup")[0];i.className="left signup",t?e.ajax({url:"//taylorlovett.us8.list-manage.com/subscribe/post-json?u=66118f9a5b0ab0414e83f043a&id=b4ed816a24&c=?",method:"post",dataType:"jsonp",data:{EMAIL:t}}).done(function(){i.className="left signup signup-success"}):i.className="left signup signup-error"},accordionClick:function(t){var l=e(t.currentTarget).parents(".accordion-container")[0],s=l.querySelectorAll(".accordion-section");t.currentTarget.parentNode.className.match(/expanded/i)?t.currentTarget.parentNode.className=t.currentTarget.parentNode.className.replace(/expanded/i,""):t.currentTarget.parentNode.className+=" expanded",i.each(s,function(e){e!=t.currentTarget.parentNode&&e.className.match(/expanded/i)&&(e.className=e.className.replace(/expanded/i,""))}),t.currentTarget.className.match(/form-settings-heading/i)?this.el.className.match(/show-form-settings/i)?this.el.className=this.el.className.replace(/show-form-settings/i,""):this.el.className+=" show-form-settings":this.el.className=this.el.className.replace(/show-form-settings/i,"")},openEditField:function(e){this.renderedSubViews["field-sidebar"].render(e).el.style.display="block"},disable:function(){this.el.querySelectorAll(".save-button")[0].setAttribute("disabled","disabled"),this.el.querySelectorAll(".disabled-overlay")[0].style.display="block"},enable:function(){this.el.querySelectorAll(".save-button")[0].removeAttribute("disabled"),this.el.querySelectorAll(".disabled-overlay")[0].style.display="none"},sync:function(){var t=this,i=e(this.el.querySelectorAll(".spinner")[0]);i.fadeIn(),t.disable();var s=e.Deferred(),o=e.Deferred();wp.ccf.dispatcher.trigger("saveFormSettings",s),wp.ccf.dispatcher.trigger("saveField",o),e.when(s,o).then(function(){var e=t.model.get("fields"),s=!0,o={};e.each(function(e){var t=e.get("slug");e.hasRequiredAttributes()?t&&!t.match(/^[a-zA-Z0-9\-_]+$/)?(s=!1,e.trigger("requirementsNotMet")):o[e.get("slug")]!==void 0?(s=!1,e.trigger("duplicateSlug"),o[e.get("slug")].trigger("duplicateSlug")):e.trigger("requirementsMet"):(s=!1,e.trigger("requirementsNotMet")),e.get("slug")&&(o[e.get("slug")]=e)}),s?t.model.save({},{context:"edit"}).error(function(){var e="sync";wp.ccf.errorModal.render(e).show()}).done(function(){l.single&&!l.postId&&(window.location=l.adminUrl+"post.php?post="+t.model.get("id")+"&action=edit#ccf-form/"+t.model.get("id"))}).complete(function(){i.fadeOut(),t.enable(),wp.ccf.dispatcher.trigger("saveFormComplete",t.model)}):(t.enable(),i.fadeOut())})},enableDisableInsert:function(){var e=this.el.querySelectorAll(".insert-form-button")[0];this.model.get("id")?e.removeAttribute("disabled"):e.setAttribute("disabled","disabled")},getNextFieldOrd:function(){var e=this.model.get("fields"),t=e.length+1;return e.each(function(e){var i=e.get("slug"),l=/\-([0-9]+)$/g,s=l.exec(i);if(s&&s[1]){var o=parseInt(s[1]);o>=t&&(t=o+1)}}),t},render:function(t){var s=this;s.model=t?t:new wp.ccf.models.Form,this.listenTo(s.model,"change",this.enableDisableInsert,this);var o={labels:l.fieldLabels,form:s.model.toJSON()};window.form=s.model,s.el.innerHTML=this.template(o),s.el.className=s.el.className.replace(/show-form-settings/i,"");var n=s.el.querySelectorAll(".fields")[0];i.each(l.fieldLabels,function(e,t){n.appendChild(new wp.ccf.views.FieldRowPlaceholder({type:t}).render().el)});var c=s.el.querySelectorAll(".structure-fields")[0];i.each(l.structureFieldLabels,function(e,t){c.appendChild(new wp.ccf.views.FieldRowPlaceholder({type:t}).render().el)});var r=s.el.querySelectorAll(".special-fields")[0];i.each(l.specialFieldLabels,function(e,t){r.appendChild(new wp.ccf.views.FieldRowPlaceholder({type:t}).render().el)});var a=s.model.get("fields"),d=s.el.querySelectorAll(".form-content")[0],u=e(d);return e(s.el.querySelectorAll(".left-sidebar")[0].querySelectorAll(".field")).draggable({cursor:"move",distance:2,zIndex:160001,scroll:!1,containment:"document",appendTo:".ccf-main-modal",snap:!1,connectToSortable:".form-content",helper:function(t){var i=e(t.currentTarget),l=e('<div class="field" data-field-type="'+i.attr("data-field-type")+'"><h4>'+i.find(".label").html()+"</h4></div>");return l.css({width:u.width(),opacity:".75",height:i.height()})}}),a.length>=1&&(d.innerHTML="",a.each(function(e){var t=new wp.ccf.views.FieldRow({model:e,form:s.model}).render(!0).el;d.appendChild(t)})),e(d).sortable({axis:"y",distance:2,handle:"h4",placeholder:"field-placeholder",stop:function(e,t){if(!t.item.hasClass("instantiated")){var i=t.item.attr("data-field-type"),l={};wp.ccf.models.Fields[i].prototype.defaults().slug!==void 0&&(l.slug=i+"-"+s.getNextFieldOrd());var o=new wp.ccf.models.Fields[i](l),n=s.model.get("fields");n.add(o),new wp.ccf.views.FieldRow({model:o,el:t.item,form:s.model}).render(!0),t.item.attr("style","")}t.item.trigger("sorted",t.item.index())}}),s.initRenderSubViews(!1,!0,{form:s.model}),s.enableDisableInsert(),s}},wp.ccf.mixins.subViewable)),wp.ccf.views.ExistingFormTableRow=wp.ccf.views.ExistingFormTableRow||t.View.extend({tagName:"tr",template:wp.ccf.utils.template("ccf-existing-form-table-row-template"),events:{"click .edit":"triggerMainViewChange","click .delete":"triggerDelete","click .insert-form-button":"insertForm"},initialize:function(e){this.parent=e.parent
|
3 |
+
},insertForm:function(){wp.ccf.utils.insertFormShortcode(this.model),wp.ccf.toggle()},triggerMainViewChange:function(){wp.ccf.switchToForm(this.model)},triggerDelete:function(){var e,t=this,i=t.parent.collection.state.currentPage;t.model.destroy().done(function(){e=i,e===t.parent.collection.state.totalPages&&e-1===(t.parent.collection.state.totalObjects-1)/l.postsPerPage&&e--,t.parent.showPage(e).done(function(){t.parent.renderPagination()})})},render:function(){return this.$el.html(this.template({form:this.model.toJSON(),utils:{getPrettyPostDate:wp.ccf.utils.getPrettyPostDate}})),this}}),wp.ccf.views.EmptyFormTableRow=wp.ccf.views.EmptyFormTableRow||t.View.extend({tagName:"tr",template:wp.ccf.utils.template("ccf-empty-form-table-row-template"),render:function(){return this.$el.html(this.template()),this}}),wp.ccf.views.ExistingFormTable=wp.ccf.views.ExistingFormTable||t.View.extend({template:wp.ccf.utils.template("ccf-existing-form-table-template"),initialize:function(){this.parent=arguments.parent,this.collection=new wp.ccf.collections.Forms,wp.ccf.dispatcher.on("changeFormTablePage",this.showPage,this),wp.ccf.dispatcher.on("saveFormComplete",this.render,this)},showPage:function(e){var t=this,i=this.collection.fetch({data:{page:e}});return i.error(function(){var e="sync";wp.ccf.errorModal.render(e).show()}),i.done(function(){var e=t.el.querySelectorAll(".rows")[0],i=document.createElement("tbody");i.className="rows",t.collection.length>=1?t.collection.each(function(e){var l=new wp.ccf.views.ExistingFormTableRow({model:e,parent:t}).render();i.appendChild(l.el)},t):i.appendChild((new wp.ccf.views.EmptyFormTableRow).render().el),e.parentNode.replaceChild(i,e)}),i},renderPagination:function(){var e=this.el.querySelectorAll(".ccf-pagination")[0];e.innerHTML="",this.collection.state.totalPages>1&&e.appendChild(new wp.ccf.views.Pagination({parent:this}).render(this.collection.state.totalPages,this.collection.state.currentPage).el)},render:function(){var e=this;return this.el.innerHTML=this.template(),this.el.querySelectorAll(".ccf-pagination")[0],this.showPage(1).done(function(){e.renderPagination()}),this}}),wp.ccf.views.ExistingFormPane=wp.ccf.views.ExistingFormPane||t.View.extend(i.defaults({template:wp.ccf.utils.template("ccf-existing-form-pane-template"),subViews:{"existing-form-table":wp.ccf.views.ExistingFormTable},render:function(){return this.rendered?this:(this.rendered=!0,this.el.innerHTML=this.template(),this.initRenderSubViews(!0),this)}},wp.ccf.mixins.subViewable)),wp.ccf.views.MainModal=wp.ccf.views.MainModal||t.View.extend(i.defaults({tagName:"div",className:"ccf-main-modal",template:wp.ccf.utils.template("ccf-main-modal-template"),events:{"click .close-icon":"hide","click .main-menu a":"menuClick"},subViews:{"form-pane":wp.ccf.views.FormPane},initialize:function(){l.single||(this.subViews["existing-form-pane"]=wp.ccf.views.ExistingFormPane),wp.ccf.dispatcher.on("mainViewChange",this.toggleView,this)},toggleView:function(e){this.showView(e,wp.ccf.currentForm);var t=e;"form-pane"===e&&wp.ccf.currentForm&&(t="existing-form-pane");var l=this.el.querySelectorAll(".menu-item");i.each(l,function(e){var i=e.getAttribute("data-view");e.className=i===t?e.className.replace("selected","")+" selected":e.className.replace("selected","")})},menuClick:function(e){var t=e.target.getAttribute("data-view");"form-pane"===t&&(wp.ccf.currentForm=null),wp.ccf.dispatcher.trigger("mainViewChange",t),e.preventDefault()},render:function(e){return e=e||!1,this.overlay(),this.el.innerHTML=this.template({single:e}),this.initRenderSubViews(),this.showView("form-pane",wp.ccf.currentForm,!0),this},overlay:function(){return this.overlayEl===void 0&&(this.overlayEl=document.createElement("div"),this.overlayEl.className="ccf-main-modal-overlay",document.body.appendChild(this.overlayEl)),this.overlayEl},remove:function(){return document.body.removeChild(this.overlay()),this},show:function(){e(this.overlay()).show(),this.$el.show()},hide:function(){e(this.overlay()).hide(),this.$el.hide()}},wp.ccf.mixins.subViewable)),wp.ccf.views.SubmissionRow=wp.ccf.views.SubmissionRow||t.View.extend({tagName:"tr",template:wp.ccf.utils.template("ccf-submission-row-template"),events:{"click .view":"view","click .delete":"delete"},initialize:function(e){this.parent=e.parent},"delete":function(){var e,t=this,i=t.parent.collection.state.currentPage;t.model.destroy().done(function(){e=i,e===t.parent.collection.state.totalPages&&e-1===(t.parent.collection.state.totalObjects-1)/l.postsPerPage&&e--,t.parent.showPage(e).done(function(){t.parent.renderPagination()})})},view:function(e){var t=e.currentTarget.getAttribute("data-submission-id"),i=e.currentTarget.getAttribute("data-submission-date");tb_show(l.thickboxTitle+" - "+wp.ccf.utils.getPrettyPostDate(i),"#TB_inline?height=500&width=700&inlineId=ccf-submission-content-"+parseInt(t),null)},render:function(){return this.$el.html(this.template({submission:this.model.toJSON(),currentColumns:this.parent.columns,columns:wp.ccf.currentForm.getFieldSlugs(!0),utils:{getPrettyPostDate:wp.ccf.utils.getPrettyPostDate,wordChop:wp.ccf.utils.wordChop,isFieldDate:wp.ccf.utils.isFieldDate,isFieldName:wp.ccf.utils.isFieldName,isFieldFile:wp.ccf.utils.isFieldFile,isFieldAddress:wp.ccf.utils.isFieldAddress,isFieldEmailConfirm:wp.ccf.utils.isFieldEmailConfirm,getPrettyFieldDate:wp.ccf.utils.getPrettyFieldDate,getPrettyFieldAddress:wp.ccf.utils.getPrettyFieldAddress,getPrettyFieldName:wp.ccf.utils.getPrettyFieldName,getPrettyFieldEmailConfirm:wp.ccf.utils.getPrettyFieldEmailConfirm}})),this}}),wp.ccf.views.SubmissionsTable=wp.ccf.views.SubmissionsTable||t.View.extend({template:wp.ccf.utils.template("ccf-submission-table-template"),events:{"click .prev:not(.disabled)":"previousPage","click .next:not(.disabled)":"nextPage","click .first:not(.disabled)":"firstPage","click .last:not(.disabled)":"lastPage"},initialize:function(){this.collection=new wp.ccf.collections.Submissions({},{formId:l.postId}),wp.ccf.dispatcher.on("submissionTableRebuild",this.render,this)},showPage:function(e){var t=this,i=this.collection.fetch({data:{page:e}});return i.error(function(){var e="sync";wp.ccf.errorModal.render(e).show()}),i.done(function(){var e=t.el.querySelectorAll(".submission-rows")[0],i=document.createElement("tbody");i.className="submission-rows",t.collection.length>=1?t.collection.each(function(e){var l=new wp.ccf.views.SubmissionRow({model:e,parent:t}).render();i.appendChild(l.el)},t):i.appendChild(new wp.ccf.views.EmptySubmissionTableRow({parent:t}).render(wp.ccf.currentForm.getFieldSlugs(!0).concat("date")).el),e.parentNode.replaceChild(i,e)}),i},renderPagination:function(){var e=this.el.querySelectorAll(".ccf-pagination")[0];e.innerHTML="",this.collection.state.totalPages>1&&e.appendChild(new wp.ccf.views.Pagination({parent:this}).render(this.collection.state.totalPages,this.collection.state.currentPage).el)},render:function(e){var t=this;return t.columns=e?e:wp.ccf.currentForm.getFieldSlugs(!0).slice(0,4).concat("date"),1>t.columns.length?t.el.innerHTML="":(t.el.innerHTML=t.template({columns:t.columns}),t.el.querySelectorAll(".ccf-pagination")[0],t.showPage(1).done(function(){t.renderPagination()})),t}}),wp.ccf.views.ErrorModal=wp.ccf.views.ErrorModal||t.View.extend({template:wp.ccf.utils.template("ccf-error-modal-template"),tagName:"div",className:"ccf-error-modal",events:{"click .close":"hide"},hide:function(){this.el.className=this.el.className.replace(" show","")},show:function(){this.el.className=this.el.className.replace(" show","")+" show"},toggle:function(){this.el.className.match(" show")?this.hide():this.show()},render:function(e){var t={messageType:""};return e&&(t.messageType=e),this.el.innerHTML=this.template(t),this}}),wp.ccf.views.Pagination=wp.ccf.views.Pagination||t.View.extend({template:wp.ccf.utils.template("ccf-pagination-template"),events:{"click .prev:not(.disabled)":"previousPage","click .next:not(.disabled)":"nextPage","click .first:not(.disabled)":"firstPage","click .last:not(.disabled)":"lastPage"},initialize:function(e){this.parent=e.parent},previousPage:function(){var e=this;e.parent.showPage(e.parent.collection.state.currentPage-1).done(function(){e.render()})},nextPage:function(){var e=this;e.parent.showPage(e.parent.collection.state.currentPage+1).done(function(){e.render()})},firstPage:function(){var e=this;e.parent.showPage(1).done(function(){e.render()})},lastPage:function(){var e=this;e.parent.showPage(e.parent.collection.state.totalPages).done(function(){e.render()})},render:function(){return this.el.innerHTML=this.template({totalPages:this.parent.collection.state.totalPages,currentPage:this.parent.collection.state.currentPage,totalObjects:this.parent.collection.state.totalObjects}),this}}),wp.ccf.views.EmptySubmissionTableRow=wp.ccf.views.EmptySubmissionTableRow||t.View.extend({tagName:"tr",template:wp.ccf.utils.template("ccf-no-submissions-row-template"),initialize:function(e){this.parent=e.parent},render:function(){return this.el.innerHTML=this.template({columns:this.parent.columns}),this}}),wp.ccf.views.SubmissionColumnController=wp.ccf.views.SubmissionColumnController||t.View.extend({template:wp.ccf.utils.template("ccf-submissions-controller-template"),events:{"click input[type=checkbox]":"triggerTableRebuild"},render:function(){this.el.innerHTML=this.template({columns:wp.ccf.currentForm.getFieldSlugs(!0).concat("date")})},triggerTableRebuild:function(){var e=[],t=document.querySelectorAll(".submission-column-checkbox");if(t.length>=1)for(var i=0;t.length>i;i++)t[i].checked&&e.push(t[i].value);wp.ccf.dispatcher.trigger("submissionTableRebuild",e)}})}(jQuery,Backbone,_,ccfSettings),function(e,t){"use strict";wp.ccf.router=wp.ccf.router||t.Router.extend({routes:{"ccf-form":"open","ccf-form/:formId":"open"},open:function(e){wp.ccf.show(e)}})}(jQuery,Backbone,_,ccfSettings),function(e,t,i,l){"use strict";wp.ccf=i.defaults(wp.ccf,{forms:new wp.ccf.collections.Forms,currentForm:null,errorModal:null,_currentFormDeferred:null,dispatcher:{},show:function(e){return this.switchToForm(e),this.instance.show(),this.instance},initErrorModal:function(){this.errorModal=(new wp.ccf.views.ErrorModal).render();var e=document.getElementsByTagName("body")[0];e.appendChild(this.errorModal.el)},switchToForm:function(e){var t=this;if(+e===parseInt(e)){var i=parseInt(e);if(e=t.forms.findWhere({id:parseInt(i)}),!e){var l;return t.forms.formsFetching[i]!==void 0?(l=t.forms.formsFetching[i],e=null):(e=new wp.ccf.models.Form({id:i}),l=e.fetch(),t.forms.formsFetching[i]=l),l.done(function(){e?(delete t.forms.formsFetching[i],t.forms.add(e)):e=t.forms.findWhere({id:i}),t.currentForm=e,wp.ccf.dispatcher.trigger("mainViewChange","form-pane")}),l}t.currentForm=e,wp.ccf.dispatcher.trigger("mainViewChange","form-pane")}else t.currentForm=e,wp.ccf.dispatcher.trigger("mainViewChange","form-pane");return!0},hide:function(){return this.instance.hide(),this.instance},toggle:function(e){return this.switchToForm(e),this.instance.$el.is(":visible")?this.instance.hide():this.instance.show(),this.instance},createSubmissionsTable:function(e){var t=document.querySelectorAll(".ccf-submission-column-controller"),i=new wp.ccf.views.SubmissionsTable({el:e});i.render(),t&&new wp.ccf.views.SubmissionColumnController({el:t}).render()},_setupMainModal:function(e){return this.instance=(new wp.ccf.views.MainModal).render(e),document.getElementsByTagName("body")[0].appendChild(this.instance.el),t.history.start(),this.instance},createManager:function(){var s=this,o=document.querySelectorAll(".ccf-open-form-manager")[0];if(!o)return!1;i.extend(this.dispatcher,t.Events),new wp.ccf.router,s.initErrorModal();var n=!1;if(l.single)if(n=!0,l.postId){var c=parseInt(l.postId);if(s.forms.formsFetching[c]===void 0){var r=new wp.ccf.models.Form({id:c}),a=r.fetch();s.forms.formsFetching[c]=a,s._currentFormDeferred=a,a.done(function(){delete s.forms.formsFetching[c],s.forms.add(r),s.currentForm=r})}else s._currentFormDeferred=s.forms.formsFetching[c],s._currentFormDeferred.done(function(){s.currentForm=s.forms.findWhere({id:c})});e.when(s._currentFormDeferred).then(function(){s._setupMainModal(!0),o.style.display="inline-block";var e=document.getElementById("ccf-submissions");if(e){var t=e.querySelectorAll(".inside")[0],i=document.createElement("div");i.className="ccf-submission-icon",i.setAttribute("data-icon","");var n=document.createElement("a");n.href="?action=edit&post="+parseInt(l.postId)+"&download_submissions=1&download_submissions_nonce="+l.downloadSubmissionsNonce,n.className="ccf-submission-icon",n.setAttribute("data-icon","");var c=document.getElementById("show-settings-link");i.onclick=function(){c.click()},e.insertBefore(i,e.firstChild.nextSibling.nextSibling),e.insertBefore(n,e.firstChild.nextSibling.nextSibling),wp.ccf.createSubmissionsTable(t)}})}else s._setupMainModal(!0),o.style.display="inline-block";else s._setupMainModal();var d=function(e){e=e||window.event;var t=e.currentTarget?e.currentTarget:e.srcElement,i=t.getAttribute("data-form-id");wp.ccf.toggle(i)};o.addEventListener?o.addEventListener("click",d,!1):o.attachEvent("onclick",d)}}),wp.ccf.createManager()}(jQuery,Backbone,_,ccfSettings);
|
assets/build/js/form-mce.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(){wp.mce.ccfForm={template:wp.ccf.utils.template("ccf-form-mce-preview"),initialize:function(){wp.ccf.dispatcher.on("saveFormComplete",this.triggerRefresh,this),this.fetch()},triggerRefresh:function(e){e===wp.ccf.forms.findWhere({id:parseInt(this.shortcode.attrs.named.id)})&&(this.renderPreviews(),this.render(this.getHtml(),!0))},fetch:function(){var e=this,t=parseInt(e.shortcode.attrs.named.id),i=wp.ccf.forms.findWhere({id:t});i?(e.renderPreviews(),e.render(e.getHtml(),!0)):(wp.ccf.forms.formsFetching[t]!==void 0?e.formFetch=wp.ccf.forms.formsFetching[t]:(i=new wp.ccf.models.Form({id:t}),e.formFetch=i.fetch(),wp.ccf.forms.formsFetching[t]=e.formFetch),e.formFetch.complete(function(){"resolved"===e.formFetch.state()&&i!==void 0&&(wp.ccf.forms.add(i),delete wp.ccf.forms.formsFetching[t]),e.renderPreviews(),e.render(e.getHtml(),!0)}))},renderPreviews:function(){var e=parseInt(this.shortcode.attrs.named.id),t=wp.ccf.forms.findWhere({id:e});if(t){var i=t.get("fields");i.each(function(e){var t=document.getElementById("ccf-"+e.get("type")+"-preview-template");if(t){var i=wp.ccf.utils.template("ccf-"+e.get("type")+"-preview-template")({field:e.toJSON(),mce:!0});e.set("preview",i)}})}},getHtml:function(){var e=parseInt(this.shortcode.attrs.named.id);if(this.formFetch===void 0||"resolved"===this.formFetch.state()||"rejected"===this.formFetch.state()){var t=wp.ccf.forms.findWhere({id:e});return this.formFetch===void 0?this.template({form:t.toJSON()}):"resolved"===this.formFetch.state()?this.template({form:t.toJSON()}):wp.ccf.utils.template("ccf-form-mce-error-preview")()}return!1},edit:function(){var e=this.shortcode.attrs.named.id,t=wp.ccf.forms.findWhere({id:parseInt(e)});return t?(wp.ccf.show(t),void 0):!1}},wp.mce.views.register("ccf_form",wp.mce.ccfForm)})(jQuery);
|
assets/build/js/form.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(e,t){"use strict";window.wp=window.wp||{},wp.ccf=wp.ccf||{},wp.ccf.validators=wp.ccf.validators||{};var i={};window.ccfRecaptchaOnload=function(){for(var e=document.querySelectorAll(".ccf-recaptcha-wrapper"),l=function(l){grecaptcha.render(e[s],{sitekey:e[s].getAttribute("data-sitekey"),theme:t.recaptcha_theme,callback:function(){i[l]=!0}})},s=0;e.length>s;s++){var r=e[s].getAttribute("data-form-id");l(r)}};var l=function(e){if(this.wrapper=e,this.errors={},e.className.match(" field-required")){this.inputs=this.wrapper.querySelectorAll(".field-input");var i=this.wrapper.querySelectorAll(".error");i.length&&i[0].parentNode.removeChild(i[0]);var l=!1;if(_.each(this.inputs,function(e){(e.checked&&e.value||e.selected)&&(l=!0)}),!l){this.errors[this.inputs[this.inputs.length-1].getAttribute("name")]={required:!0};var s=document.createElement("div");s.className="error required-error",s.innerHTML=t.required,e.appendChild(s)}}},s=function(e,i){return function(l){this.wrapper=l,this.inputs=this.wrapper.querySelectorAll(".field-input"),this.errors={};for(var s=this.wrapper.querySelectorAll(".error"),r=s.length-1;r>=0;r--)s[r].parentNode.removeChild(s[r]);_.each(this.inputs,function(t){var i=t.getAttribute("name");this.errors[i]={},t.getAttribute("aria-required")&&""===t.value&&(this.errors[i].required=t),e&&e.call(this,t)},this),i&&i.call(this);var o;for(var n in this.errors)if(this.errors.hasOwnProperty(n))for(var c in this.errors[n])o=document.createElement("div"),o.className="error "+c+"-error",o.setAttribute("data-field-name",n),o.innerHTML=t[c],this.errors[n][c].parentNode.insertBefore(o,this.errors[n][c].nextSibling)}};wp.ccf.validators["single-line-text"]=wp.ccf.validators["single-line-text"]||s(),wp.ccf.validators["paragraph-text"]=wp.ccf.validators["paragraph-text"]||s(),wp.ccf.validators.name=wp.ccf.validators.name||s(),wp.ccf.validators.email=wp.ccf.validators.email||s(!1,function(){var e=this.inputs[0].value;if(e){2===this.inputs.length&&e!==this.inputs[1].value&&(this.errors[this.inputs[0].getAttribute("name")].match=this.wrapper.lastChild);var t=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;t.test(e)||(this.errors[this.inputs[0].getAttribute("name")].email=this.wrapper.lastChild)}}),wp.ccf.validators.recaptcha=wp.ccf.validators.recaptcha||function(e,l){this.wrapper=e,this.inputs=this.wrapper.querySelectorAll(".g-recaptcha-response"),this.errors={};for(var s=this.wrapper.querySelectorAll(".error"),r=s.length-1;r>=0;r--)s[r].parentNode.removeChild(s[r]);i[l]||(this.errors["g-recaptcha-response"]={},this.errors["g-recaptcha-response"].recaptcha=this.wrapper.lastChild);var o;for(var n in this.errors)if(this.errors.hasOwnProperty(n))for(var c in this.errors[n])o=document.createElement("div"),o.className="error "+c+"-error",o.setAttribute("data-field-name",n),o.innerHTML=t[c],this.errors[n][c].parentNode.insertBefore(o,this.errors[n][c].nextSibling)},wp.ccf.validators.phone=wp.ccf.validators.phone||s(!1,function(){var e=this.inputs[0].value;if(e){var t=/^[0-9+.)(\- ]+$/;if(t.test(e)){if("us"===this.wrapper.getAttribute("data-phone-format")){var i=e.replace(/[^0-9]/gi,"");10!==i.length&&(this.errors[this.inputs[0].getAttribute("name")].digits=this.wrapper.lastChild)}}else this.errors[this.inputs[0].getAttribute("name")].phone=this.wrapper.lastChild}}),wp.ccf.validators.date=wp.ccf.validators.date||function(e){this.wrapper=e,this.errors={},this.inputs=this.wrapper.querySelectorAll(".field-input");for(var i=this.wrapper.querySelectorAll(".error"),l=i.length-1;l>=0;l--)i[l].parentNode.removeChild(i[l]);var s;_.each(this.inputs,function(i){var l=i.getAttribute("name");if(this.errors[l]={},i.getAttribute("aria-required")&&""===i.value&&(this.errors[l].required=!0,s=document.createElement("div"),s.className="error required-error",1===this.inputs.length?(s.innerHTML=t.required,s.className+=" right-error",i.parentNode.insertBefore(s,i.nextSibling)):(s.innerHTML=t[l.replace(/.*\[(.*?)\]/i,"$1")+"_required"],e.appendChild(s))),""!==i.value){var r=l.replace(/^.*\[(.*?)\]$/,"$1");"date"===r?i.value.match(/^([0-9]|\/)+$/)||(s=document.createElement("div"),s.className="error date-error",s.innerHTML=t.date,e.appendChild(s)):"hour"===r?i.value.match(/^[0-9]+$/)||(s=document.createElement("div"),s.className="error hour-error",s.innerHTML=t.hour,e.appendChild(s)):"minute"===r&&(i.value.match(/^[0-9]+$/)||(s=document.createElement("div"),s.className="error minute-error",s.innerHTML=t.minute,e.appendChild(s)))}},this)},wp.ccf.validators.address=wp.ccf.validators.address||s(),wp.ccf.validators.file=wp.ccf.validators.file||function(e){this.wrapper=e,this.inputs=this.wrapper.querySelectorAll(".field-input"),this.errors={};for(var i=this.wrapper.querySelectorAll(".error"),l=i.length-1;l>=0;l--)i[l].parentNode.removeChild(i[l]);_.each(this.inputs,function(e){var t=e.getAttribute("name");this.errors[t]={},e.getAttribute("aria-required")&&""===e.value&&(this.errors[t].required=e)},this);var s=this.inputs[0],r=this.wrapper.getAttribute("data-max-file-size"),o=this.wrapper.getAttribute("data-file-extensions");if(s.value){if(r){var n=1e3*1e3*parseInt(r);if(s.files)s.files[0].size>n&&(this.errors[this.inputs[0].getAttribute("name")].fileSize=this.wrapper.lastChild);else if("undefined"!=typeof ActiveXObject)try{var c=new ActiveXObject("Scripting.FileSystemObject"),a=c.getFile(s.value);a.size>n&&(this.errors[this.inputs[0].getAttribute("name")].fileSize=this.wrapper.lastChild)}catch(d){}}if(o){var f=o.replace(";",",").toLowerCase();if(f=f.replace(/\s+/g,""),f=f.split(","),f.length){var u=s.value.replace(/^.*\.(.+)$/g,"$1").toLowerCase();-1===_.indexOf(f,u)&&(this.errors[this.inputs[0].getAttribute("name")].fileExtension=this.wrapper.lastChild)}}}var p;for(var h in this.errors)if(this.errors.hasOwnProperty(h))for(var m in this.errors[h])p=document.createElement("div"),p.className="error "+m+"-error",p.setAttribute("data-field-name",h),p.innerHTML=t[m],"fileExtension"===m&&o?p.innerHTML+=" ("+o+")":"fileSize"===m&&r&&(p.innerHTML+=" "+r+" MB"),this.errors[h][m].parentNode.insertBefore(p,this.errors[h][m].nextSibling)},wp.ccf.validators.website=wp.ccf.validators.website||s(function(e){if(e.value){var t=/^http(s?)\:\/\/(([a-zA-Z0-9\-\._]+(\.[a-zA-Z0-9\-\._]+)+)|localhost)(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&%\$#_]*)?([\d\w\.\/\%\+\-\=\&\?\:\\\"\'\,\|\~\;]*)$/;t.test(e.value)||(this.errors[e.getAttribute("name")].website=e)}}),wp.ccf.validators.checkboxes=wp.ccf.validators.checkboxes||l,wp.ccf.validators.dropdown=wp.ccf.validators.dropdown||s(),wp.ccf.validators.radio=wp.ccf.validators.radio||l,wp.ccf.setupDOM=wp.ccf.setupDOM||function(){for(var l,s,r=document.querySelectorAll(".ccf-datepicker"),o=0;r.length>o;o++)l={},s=r[o].getAttribute("data-date-format"),s&&(l.dateFormat=s.replace(/yyyy/i,"yy")),e(r[o]).datepicker(l);var n=document.querySelectorAll(".ccf-form-wrapper");n.length>=1&&_.each(n,function(l){function s(t){var i=[];if(_.each(p,function(e){if(!e.className.match(/ skip-field/i)){var t=e.getAttribute("data-field-type");e.getAttribute("data-field-slug");var l=new wp.ccf.validators[t](e,n);if(_.size(l.errors)){var s=0;for(var r in l.errors)l.errors.hasOwnProperty(r)&&_.size(l.errors[r])&&s++;s>0&&i.push(l)}}}),!i.length)return o.trigger("ccfFormSuccess"),l.className=l.className.replace(/ loading/i,"")+" loading",d.animate({opacity:100}),!0;t.returnFalse=!1,t.preventDefault&&t.preventDefault(),o.trigger("ccfFormError",i);var s=e(window).scrollTop(),r=s+e(window).height(),c=e(i[0].wrapper),a=c.offset(),f=a.top,u=f+c.height();return f>=s&&r>=u||e("html, body").animate({scrollTop:c.offset().top},500),!1}var r=l.querySelectorAll(".ccf-form")[0],o=e(r),n=parseInt(l.getAttribute("data-form-id")),c=r.querySelectorAll(".ccf-submit-button")[0],a=document.getElementById("ccf_form_frame_"+n),d=e(r.querySelectorAll(".loading-img")[0]),f=e(a),u=e(c),p={};f.on("load",function(){var l,s=f.contents().find("body").text();if(!s)return!1;r.className=r.className.replace(/ loading/i,""),d.animate({opacity:0}),i[n]=!1;try{l=e.parseJSON(s)}catch(o){var a=document.createElement("div");return a.className="error unknown-error",a.innerText=t.unknown,c.parentNode.appendChild(a),!1}var u=c.parentNode.querySelectorAll(".error");if(u.length&&u[0].parentNode.removeChild(u[0]),l.success)if("text"===l.action_type&&l.completion_message){r.innerHTML="";var h=document.createElement("div");h.innerHTML=l.completion_message,h.className="ccf-form-complete",r.appendChild(h),e("html, body").animate({scrollTop:e(r).offset().top},500)}else"redirect"===l.action_type&&l.completion_redirect_url&&(document.location=l.completion_redirect_url);else l.field_errors&&_.each(l.field_errors,function(e,t){var i=p[t].querySelectorAll(".field-input");for(var l in e)if(e.hasOwnProperty(l)){var s=document.createElement("div");s.className="error "+l+"-error",s.innerHTML=e[l],1===i.length?i[i.length-1].parentNode.insertBefore(s,i[i.length-1].nextSibling):p[t].appendChild(s)}})}),u.on("click",function(e){return e.preventDefault(),r.target="ccf_form_frame_"+n,r.action=t.ajaxurl,o.submit(),!1});var h=l.querySelectorAll(".field");_.each(h,function(e){var t=e.getAttribute("data-field-slug");p[t]=e}),_.each(h,function(t){var i=t.getAttribute("data-field-slug"),l=t.getAttribute("data-field-type");if(wp.ccf.conditionals[n][i]&&wp.ccf.conditionals[n][i].conditions.length){var s=wp.ccf.conditionals[n][i].conditionalType,r=wp.ccf.conditionals[n][i].conditionalFieldsRequired;wp.ccf.conditionals[n][i].trigger=function(){var o;"any"===r?(o=!1,_.each(wp.ccf.conditionals[n][i].conditions,function(e){e.state&&(o=!0)})):(o=!0,_.each(wp.ccf.conditionals[n][i].conditions,function(e){o=o&&e.state})),"hide"===s&&(o=!o),o?"section-header"===l?e(t).parents(".ccf-section").removeClass("field-hide"):t.className=t.className.replace(/field-hide/i,""):"section-header"===l?e(t).parents(".ccf-section").addClass("field-hide"):t.className=t.className.replace(/field-hide/i,"")+" field-hide"},_.each(wp.ccf.conditionals[n][i].conditions,function(t){function l(e){"is"===t.compare?t.state=e===t.value?!0:!1:"is-not"===t.compare?t.state=e!==t.value?!0:!1:"greater-than"===t.compare?t.state=parseInt(e)>parseInt(t.value)?!0:!1:"less-than"===t.compare?t.state=parseInt(e)<parseInt(t.value)?!0:!1:"contains"===t.compare&&(t.state=e.match(t.value)?!0:!1)}var s=p[t.field].querySelectorAll(".field-input");e(s).on("change keyup",_.debounce(function(e){l(e.currentTarget.value),wp.ccf.conditionals[n][i].trigger()},250)),l(s.value),wp.ccf.conditionals[n][i].trigger()})}}),o.on("submit",s)})},e(document).ready(wp.ccf.setupDOM)})(jQuery,ccfSettings);
|
assets/build/js/settings.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(e){var t=e(document.querySelectorAll(".ccf-asset-restrictions")),i=document.querySelectorAll(".ccf-asset-loading-restrictions-wrap")[0],l=e(document.querySelectorAll(".ccf-asset-loading-restriction-enabled")),s=t.find(".asset").length;l.on("change",function(e){i.className="0"===e.target.value?"ccf-asset-loading-restrictions-wrap ccf-hide-field":"ccf-asset-loading-restrictions-wrap"}),t.on("click",".add",function(i){var l=i.target.parentNode.cloneNode(!0),r=l.querySelectorAll(".asset-location")[0],o=l.querySelectorAll(".restriction-type")[0];r.value="",o.value="url",r.name="ccf_settings[asset_loading_restrictions]["+s+"][location]",o.name="ccf_settings[asset_loading_restrictions]["+s+"][type]",s++,t.append(e(l))}),t.on("click",".delete",function(e){var t=document.querySelectorAll(".ccf-asset-restrictions .asset");2>t.length?(e.target.parentNode.querySelectorAll(".asset-location")[0].value="",e.target.parentNode.querySelectorAll(".restriction-type")[0].value="url"):e.target.parentNode.parentNode.removeChild(e.target.parentNode)})})(jQuery);
|
{fonts → assets/fonts}/form-manager.eot
RENAMED
File without changes
|
{fonts → assets/fonts}/form-manager.svg
RENAMED
File without changes
|
{fonts → assets/fonts}/form-manager.ttf
RENAMED
File without changes
|
{fonts → assets/fonts}/form-manager.woff
RENAMED
File without changes
|
{fonts → assets/fonts}/icomoon.json
RENAMED
File without changes
|
{fonts → assets/fonts}/menu.eot
RENAMED
File without changes
|
{fonts → assets/fonts}/menu.svg
RENAMED
File without changes
|
{fonts → assets/fonts}/menu.ttf
RENAMED
File without changes
|
{fonts → assets/fonts}/menu.woff
RENAMED
File without changes
|
{img → assets/img}/recaptcha.png
RENAMED
File without changes
|
{js → assets/js}/form-cpt-preview.js
RENAMED
File without changes
|
{js → assets/js}/form-mce.js
RENAMED
File without changes
|
{js → assets/js}/form.js
RENAMED
@@ -381,6 +381,7 @@
|
|
381 |
var $button = $( button );
|
382 |
|
383 |
var fieldsBySlug = {};
|
|
|
384 |
|
385 |
$frame.on( 'load', function() {
|
386 |
var data,
|
@@ -457,12 +458,128 @@
|
|
457 |
return false;
|
458 |
});
|
459 |
|
460 |
-
|
461 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
462 |
|
|
|
|
|
|
|
|
|
|
|
|
|
463 |
var errors = [];
|
464 |
|
465 |
-
_.each(
|
466 |
if ( field.className.match( / skip-field/i ) ) {
|
467 |
return;
|
468 |
}
|
@@ -470,8 +587,6 @@
|
|
470 |
var type = field.getAttribute( 'data-field-type' );
|
471 |
var slug = field.getAttribute( 'data-field-slug' );
|
472 |
|
473 |
-
fieldsBySlug[slug] = field;
|
474 |
-
|
475 |
var validation = new ( wp.ccf.validators[type] )( field, formId );
|
476 |
|
477 |
if ( _.size( validation.errors ) ) {
|
381 |
var $button = $( button );
|
382 |
|
383 |
var fieldsBySlug = {};
|
384 |
+
var fieldSubscriptions = {};
|
385 |
|
386 |
$frame.on( 'load', function() {
|
387 |
var data,
|
458 |
return false;
|
459 |
});
|
460 |
|
461 |
+
// Setup conditionals and cache fields
|
462 |
+
var fields = formWrapper.querySelectorAll( '.field' );
|
463 |
+
|
464 |
+
_.each( fields, function( field ) {
|
465 |
+
var slug = field.getAttribute( 'data-field-slug' );
|
466 |
+
// Cache field
|
467 |
+
fieldsBySlug[slug] = field;
|
468 |
+
} );
|
469 |
+
|
470 |
+
_.each( fields, function( field ) {
|
471 |
+
var slug = field.getAttribute( 'data-field-slug' );
|
472 |
+
var type = field.getAttribute( 'data-field-type' );
|
473 |
+
|
474 |
+
if ( wp.ccf.conditionals[formId][slug] && wp.ccf.conditionals[formId][slug].conditions.length ) {
|
475 |
+
var conditionalType = wp.ccf.conditionals[formId][slug].conditionalType;
|
476 |
+
var conditionalFieldsRequired = wp.ccf.conditionals[formId][slug].conditionalFieldsRequired;
|
477 |
+
|
478 |
+
wp.ccf.conditionals[formId][slug].trigger = function() {
|
479 |
+
var overallState;
|
480 |
+
|
481 |
+
if ( 'any' === conditionalFieldsRequired ) {
|
482 |
+
overallState = false;
|
483 |
+
|
484 |
+
_.each( wp.ccf.conditionals[formId][slug].conditions, function( condition ) {
|
485 |
+
if ( condition.state ) {
|
486 |
+
overallState = true;
|
487 |
+
}
|
488 |
+
} );
|
489 |
+
} else {
|
490 |
+
overallState = true;
|
491 |
+
|
492 |
+
_.each( wp.ccf.conditionals[formId][slug].conditions, function( condition ) {
|
493 |
+
overallState = overallState && condition.state;
|
494 |
+
} );
|
495 |
+
}
|
496 |
+
|
497 |
+
if ( 'hide' === conditionalType ) {
|
498 |
+
overallState = ! overallState;
|
499 |
+
}
|
500 |
+
|
501 |
+
if ( overallState ) {
|
502 |
+
// Show field
|
503 |
+
if ( 'section-header' === type ) {
|
504 |
+
$( field ).parents( '.ccf-section' ).removeClass( 'field-hide' );
|
505 |
+
} else {
|
506 |
+
field.className = field.className.replace( /field-hide/i, '' );
|
507 |
+
}
|
508 |
+
} else {
|
509 |
+
// Hide field
|
510 |
+
if ( 'section-header' === type ) {
|
511 |
+
$( field ).parents( '.ccf-section' ).addClass( 'field-hide' );
|
512 |
+
} else {
|
513 |
+
field.className = field.className.replace( /field-hide/i, '' ) + ' field-hide';
|
514 |
+
}
|
515 |
+
}
|
516 |
+
};
|
517 |
+
|
518 |
+
_.each( wp.ccf.conditionals[formId][slug].conditions, function( condition ) {
|
519 |
+
|
520 |
+
var fieldInput = fieldsBySlug[condition.field].querySelectorAll( '.field-input' );
|
521 |
+
|
522 |
+
function adjustConditions( value ) {
|
523 |
+
if ( 'is' === condition.compare ) {
|
524 |
+
if ( value === condition.value ) {
|
525 |
+
// one piece of condition is true
|
526 |
+
condition.state = true;
|
527 |
+
} else {
|
528 |
+
// one part of condition is false
|
529 |
+
condition.state = false;
|
530 |
+
}
|
531 |
+
} else if ( 'is-not' === condition.compare ) {
|
532 |
+
if ( value !== condition.value ) {
|
533 |
+
// one piece of condition is true
|
534 |
+
condition.state = true;
|
535 |
+
} else {
|
536 |
+
// one part of condition is false
|
537 |
+
condition.state = false;
|
538 |
+
}
|
539 |
+
} else if ( 'greater-than' === condition.compare ) {
|
540 |
+
if ( parseInt( value ) > parseInt( condition.value ) ) {
|
541 |
+
// one piece of condition is true
|
542 |
+
condition.state = true;
|
543 |
+
} else {
|
544 |
+
// one part of condition is false
|
545 |
+
condition.state = false;
|
546 |
+
}
|
547 |
+
} else if ( 'less-than' === condition.compare ) {
|
548 |
+
if ( parseInt( value ) < parseInt( condition.value ) ) {
|
549 |
+
// one piece of condition is true
|
550 |
+
condition.state = true;
|
551 |
+
} else {
|
552 |
+
// one part of condition is false
|
553 |
+
condition.state = false;
|
554 |
+
}
|
555 |
+
} else if ( 'contains' === condition.compare ) {
|
556 |
+
if ( value.match( condition.value ) ) {
|
557 |
+
// one piece of condition is true
|
558 |
+
condition.state = true;
|
559 |
+
} else {
|
560 |
+
// one part of condition is false
|
561 |
+
condition.state = false;
|
562 |
+
}
|
563 |
+
}
|
564 |
+
}
|
565 |
+
|
566 |
+
$( fieldInput ).on( 'change keyup', _.debounce( function( event ) {
|
567 |
+
adjustConditions( event.currentTarget.value );
|
568 |
+
|
569 |
+
wp.ccf.conditionals[formId][slug].trigger();
|
570 |
+
}, 250 ) );
|
571 |
+
|
572 |
+
adjustConditions( fieldInput.value );
|
573 |
|
574 |
+
wp.ccf.conditionals[formId][slug].trigger();
|
575 |
+
} );
|
576 |
+
}
|
577 |
+
} );
|
578 |
+
|
579 |
+
function formSubmit( event ) {
|
580 |
var errors = [];
|
581 |
|
582 |
+
_.each( fieldsBySlug, function( field ) {
|
583 |
if ( field.className.match( / skip-field/i ) ) {
|
584 |
return;
|
585 |
}
|
587 |
var type = field.getAttribute( 'data-field-type' );
|
588 |
var slug = field.getAttribute( 'data-field-slug' );
|
589 |
|
|
|
|
|
590 |
var validation = new ( wp.ccf.validators[type] )( field, formId );
|
591 |
|
592 |
if ( _.size( validation.errors ) ) {
|
{js → assets/js}/manager/app.js
RENAMED
File without changes
|
{js → assets/js}/manager/collections.js
RENAMED
@@ -112,4 +112,10 @@
|
|
112 |
}
|
113 |
);
|
114 |
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
})( jQuery, Backbone, _, ccfSettings );
|
112 |
}
|
113 |
);
|
114 |
|
115 |
+
wp.ccf.collections.FieldConditionals = wp.ccf.collections.FieldConditionals || Backbone.Collection.extend(
|
116 |
+
{
|
117 |
+
model: wp.ccf.models.FieldConditional
|
118 |
+
}
|
119 |
+
);
|
120 |
+
|
121 |
})( jQuery, Backbone, _, ccfSettings );
|
{js → assets/js}/manager/mixins.js
RENAMED
File without changes
|
{js → assets/js}/manager/models.js
RENAMED
@@ -57,6 +57,22 @@
|
|
57 |
return this;
|
58 |
};
|
59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
wp.ccf.models.FieldChoice = wp.ccf.models.FieldChoice || Backbone.Model.extend(
|
61 |
{
|
62 |
defaults: {
|
@@ -254,6 +270,20 @@
|
|
254 |
delete response.fields[i].choices;
|
255 |
}
|
256 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
257 |
field.set( newField );
|
258 |
field.decode();
|
259 |
}
|
@@ -413,12 +443,33 @@
|
|
413 |
{
|
414 |
idAttribute: 'id',
|
415 |
|
416 |
-
defaults: {
|
417 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
418 |
},
|
419 |
|
420 |
set: _modelSet,
|
421 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
422 |
required: function() {
|
423 |
return [ 'slug' ];
|
424 |
},
|
@@ -460,7 +511,11 @@
|
|
460 |
description: ''
|
461 |
};
|
462 |
|
463 |
-
return _.defaults( defaults, this.constructor.__super__.defaults );
|
|
|
|
|
|
|
|
|
464 |
}
|
465 |
}
|
466 |
);
|
@@ -473,6 +528,10 @@
|
|
473 |
};
|
474 |
|
475 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
|
|
|
|
|
|
|
|
476 |
}
|
477 |
}
|
478 |
);
|
@@ -487,6 +546,10 @@
|
|
487 |
};
|
488 |
|
489 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
|
|
|
|
|
|
|
|
490 |
}
|
491 |
}
|
492 |
);
|
@@ -499,6 +562,10 @@
|
|
499 |
};
|
500 |
|
501 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
|
|
|
|
|
|
|
|
502 |
}
|
503 |
}
|
504 |
);
|
@@ -511,6 +578,10 @@
|
|
511 |
};
|
512 |
|
513 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
|
|
|
|
|
|
|
|
514 |
}
|
515 |
}
|
516 |
);
|
@@ -524,6 +595,10 @@
|
|
524 |
};
|
525 |
|
526 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
|
|
|
|
|
|
|
|
527 |
}
|
528 |
}
|
529 |
);
|
@@ -537,6 +612,10 @@
|
|
537 |
};
|
538 |
|
539 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
|
|
|
|
|
|
|
|
540 |
}
|
541 |
}
|
542 |
);
|
@@ -550,6 +629,10 @@
|
|
550 |
};
|
551 |
|
552 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
|
|
|
|
|
|
|
|
553 |
}
|
554 |
}
|
555 |
);
|
@@ -565,6 +648,10 @@
|
|
565 |
};
|
566 |
|
567 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
|
|
|
|
|
|
|
|
568 |
}
|
569 |
}
|
570 |
);
|
@@ -577,6 +664,10 @@
|
|
577 |
};
|
578 |
|
579 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
|
|
|
|
|
|
|
|
580 |
}
|
581 |
}
|
582 |
);
|
@@ -597,7 +688,11 @@
|
|
597 |
return [ 'siteKey', 'secretKey' ];
|
598 |
},
|
599 |
|
600 |
-
isImmutable: true
|
|
|
|
|
|
|
|
|
601 |
}
|
602 |
);
|
603 |
|
@@ -610,6 +705,10 @@
|
|
610 |
};
|
611 |
|
612 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
|
|
|
|
|
|
|
|
613 |
}
|
614 |
}
|
615 |
);
|
@@ -625,14 +724,18 @@
|
|
625 |
className: ''
|
626 |
};
|
627 |
|
628 |
-
return _.defaults( defaults, this.constructor.__super__.defaults );
|
629 |
},
|
630 |
|
631 |
required: function() {
|
632 |
return [];
|
633 |
},
|
634 |
|
635 |
-
isImmutable: true
|
|
|
|
|
|
|
|
|
636 |
}
|
637 |
);
|
638 |
|
@@ -646,14 +749,18 @@
|
|
646 |
className: ''
|
647 |
};
|
648 |
|
649 |
-
return _.defaults( defaults, this.constructor.__super__.defaults );
|
650 |
},
|
651 |
|
652 |
required: function() {
|
653 |
return [];
|
654 |
},
|
655 |
|
656 |
-
isImmutable: true
|
|
|
|
|
|
|
|
|
657 |
}
|
658 |
);
|
659 |
|
@@ -680,6 +787,8 @@
|
|
680 |
|
681 |
this.set( 'choices', new wp.ccf.collections.FieldChoices( choices ) );
|
682 |
}
|
|
|
|
|
683 |
}
|
684 |
}
|
685 |
);
|
57 |
return this;
|
58 |
};
|
59 |
|
60 |
+
wp.ccf.models.FieldConditional = wp.ccf.models.FieldConditional || Backbone.Model.extend(
|
61 |
+
{
|
62 |
+
defaults: {
|
63 |
+
field: '',
|
64 |
+
compare: 'is',
|
65 |
+
value: ''
|
66 |
+
},
|
67 |
+
|
68 |
+
decode: function() {
|
69 |
+
return _modelDecode.call( this, [] );
|
70 |
+
},
|
71 |
+
|
72 |
+
set: _modelSet
|
73 |
+
}
|
74 |
+
);
|
75 |
+
|
76 |
wp.ccf.models.FieldChoice = wp.ccf.models.FieldChoice || Backbone.Model.extend(
|
77 |
{
|
78 |
defaults: {
|
270 |
delete response.fields[i].choices;
|
271 |
}
|
272 |
|
273 |
+
if ( typeof newField.conditionals !== 'undefined' ) {
|
274 |
+
var conditionals = SELF.get( 'conditionals' );
|
275 |
+
|
276 |
+
if ( conditionals && conditionals.length > 0 ) {
|
277 |
+
for ( z = 0; z < newField.conditionals; z++ ) {
|
278 |
+
var conditional = conditionals.at( z );
|
279 |
+
conditional.set( newField.conditionals[z] );
|
280 |
+
conditional.decode();
|
281 |
+
}
|
282 |
+
}
|
283 |
+
|
284 |
+
delete response.fields[i].conditionals;
|
285 |
+
}
|
286 |
+
|
287 |
field.set( newField );
|
288 |
field.decode();
|
289 |
}
|
443 |
{
|
444 |
idAttribute: 'id',
|
445 |
|
446 |
+
defaults: function() {
|
447 |
+
return {
|
448 |
+
id: null,
|
449 |
+
conditionalsEnabled: false,
|
450 |
+
conditionalType: 'show',
|
451 |
+
conditionalFieldsRequired: 'all',
|
452 |
+
conditionals: new wp.ccf.collections.FieldConditionals()
|
453 |
+
};
|
454 |
},
|
455 |
|
456 |
set: _modelSet,
|
457 |
|
458 |
+
initialize: function( attributes ) {
|
459 |
+
if ( typeof attributes === 'object' && attributes.conditionals ) {
|
460 |
+
var conditionals = [];
|
461 |
+
|
462 |
+
_.each( attributes.conditionals, function( conditional ) {
|
463 |
+
var conditionalModel = new wp.ccf.models.FieldConditional( conditional );
|
464 |
+
conditionalModel.decode();
|
465 |
+
|
466 |
+
conditionals.push( conditionalModel );
|
467 |
+
});
|
468 |
+
|
469 |
+
this.set( 'conditionals', new wp.ccf.collections.FieldConditionals( conditionals ) );
|
470 |
+
}
|
471 |
+
},
|
472 |
+
|
473 |
required: function() {
|
474 |
return [ 'slug' ];
|
475 |
},
|
511 |
description: ''
|
512 |
};
|
513 |
|
514 |
+
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
515 |
+
},
|
516 |
+
|
517 |
+
initialize: function() {
|
518 |
+
return wp.ccf.models.StandardField.__super__.initialize.apply( this, arguments );
|
519 |
}
|
520 |
}
|
521 |
);
|
528 |
};
|
529 |
|
530 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
531 |
+
},
|
532 |
+
|
533 |
+
initialize: function() {
|
534 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
535 |
}
|
536 |
}
|
537 |
);
|
546 |
};
|
547 |
|
548 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
549 |
+
},
|
550 |
+
|
551 |
+
initialize: function() {
|
552 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
553 |
}
|
554 |
}
|
555 |
);
|
562 |
};
|
563 |
|
564 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
565 |
+
},
|
566 |
+
|
567 |
+
initialize: function() {
|
568 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
569 |
}
|
570 |
}
|
571 |
);
|
578 |
};
|
579 |
|
580 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
581 |
+
},
|
582 |
+
|
583 |
+
initialize: function() {
|
584 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
585 |
}
|
586 |
}
|
587 |
);
|
595 |
};
|
596 |
|
597 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
598 |
+
},
|
599 |
+
|
600 |
+
initialize: function() {
|
601 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
602 |
}
|
603 |
}
|
604 |
);
|
612 |
};
|
613 |
|
614 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
615 |
+
},
|
616 |
+
|
617 |
+
initialize: function() {
|
618 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
619 |
}
|
620 |
}
|
621 |
);
|
629 |
};
|
630 |
|
631 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
632 |
+
},
|
633 |
+
|
634 |
+
initialize: function() {
|
635 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
636 |
}
|
637 |
}
|
638 |
);
|
648 |
};
|
649 |
|
650 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
651 |
+
},
|
652 |
+
|
653 |
+
initialize: function() {
|
654 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
655 |
}
|
656 |
}
|
657 |
);
|
664 |
};
|
665 |
|
666 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
667 |
+
},
|
668 |
+
|
669 |
+
initialize: function() {
|
670 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
671 |
}
|
672 |
}
|
673 |
);
|
688 |
return [ 'siteKey', 'secretKey' ];
|
689 |
},
|
690 |
|
691 |
+
isImmutable: true,
|
692 |
+
|
693 |
+
initialize: function() {
|
694 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
695 |
+
}
|
696 |
}
|
697 |
);
|
698 |
|
705 |
};
|
706 |
|
707 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
708 |
+
},
|
709 |
+
|
710 |
+
initialize: function() {
|
711 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
712 |
}
|
713 |
}
|
714 |
);
|
724 |
className: ''
|
725 |
};
|
726 |
|
727 |
+
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
728 |
},
|
729 |
|
730 |
required: function() {
|
731 |
return [];
|
732 |
},
|
733 |
|
734 |
+
isImmutable: true,
|
735 |
+
|
736 |
+
initialize: function() {
|
737 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
738 |
+
}
|
739 |
}
|
740 |
);
|
741 |
|
749 |
className: ''
|
750 |
};
|
751 |
|
752 |
+
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
753 |
},
|
754 |
|
755 |
required: function() {
|
756 |
return [];
|
757 |
},
|
758 |
|
759 |
+
isImmutable: true,
|
760 |
+
|
761 |
+
initialize: function() {
|
762 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
763 |
+
}
|
764 |
}
|
765 |
);
|
766 |
|
787 |
|
788 |
this.set( 'choices', new wp.ccf.collections.FieldChoices( choices ) );
|
789 |
}
|
790 |
+
|
791 |
+
return wp.ccf.models.ChoiceableField.__super__.initialize.apply( this, arguments );
|
792 |
}
|
793 |
}
|
794 |
);
|
{js → assets/js}/manager/router.js
RENAMED
File without changes
|
{js → assets/js}/manager/utils.js
RENAMED
File without changes
|
{js → assets/js}/manager/views.js
RENAMED
@@ -12,7 +12,6 @@
|
|
12 |
events: {
|
13 |
'click .add': 'triggerAdd',
|
14 |
'click .delete': 'triggerDelete',
|
15 |
-
'blur input': 'saveChoice',
|
16 |
'saveChoice': 'saveChoice',
|
17 |
'sorted': 'triggerUpdateSort'
|
18 |
},
|
@@ -90,6 +89,135 @@
|
|
90 |
}
|
91 |
);
|
92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
wp.ccf.views.EmptyFormNotificationTableRow = wp.ccf.views.EmptyFormNotificationTableRow || Backbone.View.extend(
|
94 |
{
|
95 |
tagName: 'tr',
|
@@ -612,6 +740,18 @@
|
|
612 |
'change input[type="checkbox"]': 'saveField'
|
613 |
},
|
614 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
615 |
checkSlug: function() {
|
616 |
var slugSelection = this.el.querySelectorAll( '.field-slug');
|
617 |
|
@@ -648,11 +788,46 @@
|
|
648 |
this.unbind();
|
649 |
},
|
650 |
|
651 |
-
|
652 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
653 |
|
654 |
this.checkSlug();
|
655 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
656 |
return this;
|
657 |
}
|
658 |
}
|
@@ -662,10 +837,6 @@
|
|
662 |
{
|
663 |
template: wp.ccf.utils.template( 'ccf-single-line-text-template' ),
|
664 |
|
665 |
-
initialize: function() {
|
666 |
-
|
667 |
-
},
|
668 |
-
|
669 |
saveField: function() {
|
670 |
// @todo: fix this ie8 hack
|
671 |
if ( this.el.innerHTML === '' ) {
|
@@ -680,6 +851,8 @@
|
|
680 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
681 |
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
682 |
|
|
|
|
|
683 |
return this;
|
684 |
}
|
685 |
}
|
@@ -689,10 +862,6 @@
|
|
689 |
{
|
690 |
template: wp.ccf.utils.template( 'ccf-file-template' ),
|
691 |
|
692 |
-
initialize: function() {
|
693 |
-
|
694 |
-
},
|
695 |
-
|
696 |
saveField: function() {
|
697 |
// @todo: fix this ie8 hack
|
698 |
if ( this.el.innerHTML === '' ) {
|
@@ -707,6 +876,8 @@
|
|
707 |
this.model.set( 'fileExtensions', this.el.querySelectorAll( '.field-file-extensions' )[0].value );
|
708 |
this.model.set( 'maxFileSize', this.el.querySelectorAll( '.field-max-file-size' )[0].value );
|
709 |
|
|
|
|
|
710 |
return this;
|
711 |
}
|
712 |
}
|
@@ -716,10 +887,6 @@
|
|
716 |
{
|
717 |
template: wp.ccf.utils.template( 'ccf-recaptcha-template' ),
|
718 |
|
719 |
-
initialize: function() {
|
720 |
-
|
721 |
-
},
|
722 |
-
|
723 |
saveField: function() {
|
724 |
// @todo: fix this ie8 hack
|
725 |
if ( this.el.innerHTML === '' ) {
|
@@ -732,6 +899,8 @@
|
|
732 |
this.model.set( 'secretKey', this.el.querySelectorAll( '.field-secret-key' )[0].value );
|
733 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
734 |
|
|
|
|
|
735 |
return this;
|
736 |
}
|
737 |
}
|
@@ -741,10 +910,6 @@
|
|
741 |
{
|
742 |
template: wp.ccf.utils.template( 'ccf-section-header-template' ),
|
743 |
|
744 |
-
initialize: function() {
|
745 |
-
|
746 |
-
},
|
747 |
-
|
748 |
saveField: function() {
|
749 |
// @todo: fix this ie8 hack
|
750 |
if ( this.el.innerHTML === '' ) {
|
@@ -755,6 +920,8 @@
|
|
755 |
this.model.set( 'subheading', this.el.querySelectorAll( '.field-subheading' )[0].value );
|
756 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
757 |
|
|
|
|
|
758 |
return this;
|
759 |
}
|
760 |
}
|
@@ -764,10 +931,6 @@
|
|
764 |
{
|
765 |
template: wp.ccf.utils.template( 'ccf-html-template' ),
|
766 |
|
767 |
-
initialize: function() {
|
768 |
-
|
769 |
-
},
|
770 |
-
|
771 |
saveField: function() {
|
772 |
// @todo: fix this ie8 hack
|
773 |
if ( this.el.innerHTML === '' ) {
|
@@ -777,6 +940,8 @@
|
|
777 |
this.model.set( 'html', this.el.querySelectorAll( '.field-html' )[0].value );
|
778 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
779 |
|
|
|
|
|
780 |
return this;
|
781 |
}
|
782 |
}
|
@@ -800,6 +965,8 @@
|
|
800 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
801 |
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
802 |
|
|
|
|
|
803 |
return this;
|
804 |
}
|
805 |
}
|
@@ -819,6 +986,8 @@
|
|
819 |
this.model.set( 'value', this.el.querySelectorAll( '.field-value' )[0].value );
|
820 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
821 |
|
|
|
|
|
822 |
return this;
|
823 |
}
|
824 |
}
|
@@ -838,6 +1007,8 @@
|
|
838 |
this.model.set( 'label', this.el.querySelectorAll( '.field-label' )[0].value );
|
839 |
this.model.set( 'description', this.el.querySelectorAll( '.field-description' )[0].value );
|
840 |
|
|
|
|
|
841 |
var value = this.el.querySelectorAll( '.field-value' );
|
842 |
if ( value.length > 0 ) {
|
843 |
this.model.set( 'value', value[0].value );
|
@@ -884,6 +1055,8 @@
|
|
884 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
885 |
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
886 |
|
|
|
|
|
887 |
return this;
|
888 |
}
|
889 |
}
|
@@ -907,6 +1080,8 @@
|
|
907 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
908 |
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
909 |
|
|
|
|
|
910 |
return this;
|
911 |
}
|
912 |
}
|
@@ -931,6 +1106,8 @@
|
|
931 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
932 |
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
933 |
|
|
|
|
|
934 |
return this;
|
935 |
}
|
936 |
}
|
@@ -953,6 +1130,8 @@
|
|
953 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
954 |
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
955 |
|
|
|
|
|
956 |
return this;
|
957 |
}
|
958 |
}
|
@@ -972,6 +1151,8 @@
|
|
972 |
this.model.set( 'label', this.el.querySelectorAll( '.field-label' )[0].value );
|
973 |
this.model.set( 'description', this.el.querySelectorAll( '.field-description' )[0].value );
|
974 |
|
|
|
|
|
975 |
var value = this.el.querySelectorAll( '.field-value' );
|
976 |
if ( value.length ) {
|
977 |
this.model.set( 'value', value[0].value );
|
@@ -1027,6 +1208,7 @@
|
|
1027 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
1028 |
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
1029 |
|
|
|
1030 |
|
1031 |
var choices = this.el.querySelectorAll( '.repeatable-choices' )[0].querySelectorAll( '.choice' );
|
1032 |
|
@@ -1038,10 +1220,12 @@
|
|
1038 |
|
1039 |
},
|
1040 |
|
1041 |
-
render: function() {
|
1042 |
var SELF = this;
|
1043 |
|
1044 |
-
|
|
|
|
|
1045 |
|
1046 |
SELF.checkSlug();
|
1047 |
|
@@ -1070,6 +1254,21 @@
|
|
1070 |
}
|
1071 |
});
|
1072 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1073 |
return SELF;
|
1074 |
}
|
1075 |
}
|
@@ -1743,7 +1942,6 @@
|
|
1743 |
|
1744 |
signup: function( event ) {
|
1745 |
var email = this.el.querySelectorAll( '.email-signup-field' )[0].value;
|
1746 |
-
var interest = this.el.querySelectorAll( '.interest-signup-field' )[0].value;
|
1747 |
var signupContainer = this.el.querySelectorAll( '.bottom .left.signup' )[0];
|
1748 |
signupContainer.className = 'left signup';
|
1749 |
|
@@ -1753,8 +1951,7 @@
|
|
1753 |
method: 'post',
|
1754 |
dataType: 'jsonp',
|
1755 |
data: {
|
1756 |
-
EMAIL: email
|
1757 |
-
INTEREST: interest
|
1758 |
}
|
1759 |
}).done(function() {
|
1760 |
signupContainer.className = 'left signup signup-success';
|
12 |
events: {
|
13 |
'click .add': 'triggerAdd',
|
14 |
'click .delete': 'triggerDelete',
|
|
|
15 |
'saveChoice': 'saveChoice',
|
16 |
'sorted': 'triggerUpdateSort'
|
17 |
},
|
89 |
}
|
90 |
);
|
91 |
|
92 |
+
wp.ccf.views.FieldConditional = Backbone.View.extend(
|
93 |
+
{
|
94 |
+
template: wp.ccf.utils.template( 'ccf-field-conditional-template' ),
|
95 |
+
className: 'conditional',
|
96 |
+
|
97 |
+
events: {
|
98 |
+
'click .add': 'triggerAdd',
|
99 |
+
'click .delete': 'triggerDelete',
|
100 |
+
'saveConditional': 'saveConditional'
|
101 |
+
},
|
102 |
+
|
103 |
+
initialize: function( options ) {
|
104 |
+
this.field = options.field;
|
105 |
+
this.fieldCollection = options.fieldCollection;
|
106 |
+
},
|
107 |
+
|
108 |
+
destroy: function() {
|
109 |
+
wp.ccf.dispatcher.off( 'mainViewChange', this.saveConditional );
|
110 |
+
this.unbind();
|
111 |
+
},
|
112 |
+
|
113 |
+
saveConditional: function() {
|
114 |
+
// @todo: fix this ie8 hack
|
115 |
+
if ( this.el.innerHTML === '' ) {
|
116 |
+
return;
|
117 |
+
}
|
118 |
+
|
119 |
+
var field = this.el.querySelectorAll( '.conditional-field' )[0].value;
|
120 |
+
var value = this.el.querySelectorAll( '.conditional-value' )[0].value;
|
121 |
+
var compare = this.el.querySelectorAll( '.conditional-compare' )[0].value;
|
122 |
+
|
123 |
+
this.model.set( 'field', field );
|
124 |
+
this.model.set( 'value', value );
|
125 |
+
this.model.set( 'compare', compare );
|
126 |
+
|
127 |
+
return this;
|
128 |
+
|
129 |
+
},
|
130 |
+
|
131 |
+
updateFields: function() {
|
132 |
+
var conditionalFields = this.el.querySelectorAll( '.conditional-field' )[0];
|
133 |
+
conditionalFields.innerHTML = '';
|
134 |
+
conditionalFields.disabled = false;
|
135 |
+
|
136 |
+
var fieldsAdded = 0;
|
137 |
+
|
138 |
+
var conditionalField = this.model.get( 'field' ),
|
139 |
+
option;
|
140 |
+
|
141 |
+
if ( this.fieldCollection.length >= 1 ) {
|
142 |
+
option = document.createElement( 'option' );
|
143 |
+
option.innerHTML = ccfSettings.chooseFormField;
|
144 |
+
option.value = '';
|
145 |
+
|
146 |
+
conditionalFields.appendChild( option );
|
147 |
+
|
148 |
+
this.fieldCollection.each( function( field ) {
|
149 |
+
if ( this.field.get( 'slug' ) !== field.get( 'slug' ) ) {
|
150 |
+
var type = field.get( 'type' );
|
151 |
+
|
152 |
+
if ( 'address' !== type && 'checkboxes' !== type && 'date' !== type && 'name' !== type && 'file' !== type && 'recaptcha' !== type && 'section-header' !== type && 'html' !== type ) {
|
153 |
+
option = document.createElement( 'option' );
|
154 |
+
option.innerHTML = field.get( 'slug' );
|
155 |
+
option.value = field.get( 'slug' );
|
156 |
+
|
157 |
+
if ( field.get( 'slug' ) === conditionalField ) {
|
158 |
+
option.selected = true;
|
159 |
+
}
|
160 |
+
|
161 |
+
conditionalFields.appendChild( option );
|
162 |
+
|
163 |
+
fieldsAdded++;
|
164 |
+
}
|
165 |
+
}
|
166 |
+
}, this );
|
167 |
+
}
|
168 |
+
|
169 |
+
if ( 0 === fieldsAdded ) {
|
170 |
+
conditionalFields.innerHTML = '';
|
171 |
+
option = document.createElement( 'option' );
|
172 |
+
option.innerHTML = ccfSettings.noAvailableFields;
|
173 |
+
option.value = '';
|
174 |
+
conditionalFields.appendChild( option );
|
175 |
+
conditionalFields.disabled = true;
|
176 |
+
}
|
177 |
+
},
|
178 |
+
|
179 |
+
render: function() {
|
180 |
+
var context = {};
|
181 |
+
if ( this.model ) {
|
182 |
+
context.conditional = this.model.toJSON();
|
183 |
+
}
|
184 |
+
|
185 |
+
this.el.innerHTML = this.template( context );
|
186 |
+
|
187 |
+
wp.ccf.dispatcher.on( 'mainViewChange', this.saveConditional, this );
|
188 |
+
|
189 |
+
this.listenTo( this.fieldCollection, 'add', this.updateFields, this );
|
190 |
+
this.listenTo( this.fieldCollection, 'remove', this.updateFields, this );
|
191 |
+
|
192 |
+
this.updateFields();
|
193 |
+
|
194 |
+
return this;
|
195 |
+
},
|
196 |
+
|
197 |
+
triggerAdd: function() {
|
198 |
+
this.field.get( 'conditionals' ).add( new wp.ccf.models.FieldConditional() );
|
199 |
+
},
|
200 |
+
|
201 |
+
triggerDelete: function() {
|
202 |
+
var conditionals = this.field.get( 'conditionals' );
|
203 |
+
if ( conditionals.length > 1 ) {
|
204 |
+
conditionals.remove( this.model );
|
205 |
+
this.destroy();
|
206 |
+
this.remove();
|
207 |
+
} else {
|
208 |
+
var value = this.el.querySelectorAll( '.conditional-value' )[0];
|
209 |
+
var field = this.el.querySelectorAll( '.conditional-field' )[0];
|
210 |
+
|
211 |
+
value.value = '';
|
212 |
+
|
213 |
+
for ( var i = 0; i < field.childNodes.length; i++ ) {
|
214 |
+
field.childNodes[i].selected = false;
|
215 |
+
}
|
216 |
+
}
|
217 |
+
}
|
218 |
+
}
|
219 |
+
);
|
220 |
+
|
221 |
wp.ccf.views.EmptyFormNotificationTableRow = wp.ccf.views.EmptyFormNotificationTableRow || Backbone.View.extend(
|
222 |
{
|
223 |
tagName: 'tr',
|
740 |
'change input[type="checkbox"]': 'saveField'
|
741 |
},
|
742 |
|
743 |
+
initialize: function() {
|
744 |
+
var conditionals = this.model.get( 'conditionals' );
|
745 |
+
this.listenTo( conditionals, 'add', this.addConditional );
|
746 |
+
},
|
747 |
+
|
748 |
+
addConditional: function( model ) {
|
749 |
+
var view = new wp.ccf.views.FieldConditional( { model: model, field: this.model, fieldCollection: this.collection } ).render();
|
750 |
+
var conditionals = this.el.querySelectorAll( '.conditionals' )[0];
|
751 |
+
|
752 |
+
conditionals.appendChild( view.el );
|
753 |
+
},
|
754 |
+
|
755 |
checkSlug: function() {
|
756 |
var slugSelection = this.el.querySelectorAll( '.field-slug');
|
757 |
|
788 |
this.unbind();
|
789 |
},
|
790 |
|
791 |
+
saveField: function() {
|
792 |
+
var conditionals = this.el.querySelectorAll( '.conditionals' )[0].querySelectorAll( '.conditional' );
|
793 |
+
|
794 |
+
_.each( conditionals, function( conditional ) {
|
795 |
+
$( conditional ).trigger( 'saveConditional' );
|
796 |
+
});
|
797 |
+
|
798 |
+
this.model.set( 'conditionalType', this.el.querySelectorAll( '.field-conditional-type' )[0].value );
|
799 |
+
this.model.set( 'conditionalFieldsRequired', this.el.querySelectorAll( '.field-conditional-fields-required' )[0].value );
|
800 |
+
|
801 |
+
var oldConditionals = this.model.get( 'conditionalsEnabled' );
|
802 |
+
this.model.set( 'conditionalsEnabled', ( this.el.querySelectorAll( '.field-conditionals-enabled' )[0].value == 1 ) ? true : false );
|
803 |
+
|
804 |
+
if ( oldConditionals !== this.model.get( 'conditionalsEnabled' ) ) {
|
805 |
+
this.render( 'advanced' );
|
806 |
+
}
|
807 |
+
},
|
808 |
+
|
809 |
+
render: function( startPanel ) {
|
810 |
+
startPanel = ( startPanel ) ? startPanel : 'basic';
|
811 |
+
|
812 |
+
this.el.innerHTML = this.template( { field: this.model.toJSON(), startPanel: startPanel } );
|
813 |
|
814 |
this.checkSlug();
|
815 |
|
816 |
+
var conditionalsCollection = this.model.get( 'conditionals' );
|
817 |
+
|
818 |
+
var conditionals = this.el.querySelectorAll( '.conditionals' )[0];
|
819 |
+
|
820 |
+
if ( conditionalsCollection.length >= 1 ) {
|
821 |
+
|
822 |
+
conditionalsCollection.each( function( model ) {
|
823 |
+
var view = new wp.ccf.views.FieldConditional( { model: model, field: this.model, fieldCollection: this.collection } ).render();
|
824 |
+
conditionals.appendChild( view.el );
|
825 |
+
}, this );
|
826 |
+
} else {
|
827 |
+
var conditional = new wp.ccf.models.FieldConditional();
|
828 |
+
conditionalsCollection.add( conditional );
|
829 |
+
}
|
830 |
+
|
831 |
return this;
|
832 |
}
|
833 |
}
|
837 |
{
|
838 |
template: wp.ccf.utils.template( 'ccf-single-line-text-template' ),
|
839 |
|
|
|
|
|
|
|
|
|
840 |
saveField: function() {
|
841 |
// @todo: fix this ie8 hack
|
842 |
if ( this.el.innerHTML === '' ) {
|
851 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
852 |
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
853 |
|
854 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
855 |
+
|
856 |
return this;
|
857 |
}
|
858 |
}
|
862 |
{
|
863 |
template: wp.ccf.utils.template( 'ccf-file-template' ),
|
864 |
|
|
|
|
|
|
|
|
|
865 |
saveField: function() {
|
866 |
// @todo: fix this ie8 hack
|
867 |
if ( this.el.innerHTML === '' ) {
|
876 |
this.model.set( 'fileExtensions', this.el.querySelectorAll( '.field-file-extensions' )[0].value );
|
877 |
this.model.set( 'maxFileSize', this.el.querySelectorAll( '.field-max-file-size' )[0].value );
|
878 |
|
879 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
880 |
+
|
881 |
return this;
|
882 |
}
|
883 |
}
|
887 |
{
|
888 |
template: wp.ccf.utils.template( 'ccf-recaptcha-template' ),
|
889 |
|
|
|
|
|
|
|
|
|
890 |
saveField: function() {
|
891 |
// @todo: fix this ie8 hack
|
892 |
if ( this.el.innerHTML === '' ) {
|
899 |
this.model.set( 'secretKey', this.el.querySelectorAll( '.field-secret-key' )[0].value );
|
900 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
901 |
|
902 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
903 |
+
|
904 |
return this;
|
905 |
}
|
906 |
}
|
910 |
{
|
911 |
template: wp.ccf.utils.template( 'ccf-section-header-template' ),
|
912 |
|
|
|
|
|
|
|
|
|
913 |
saveField: function() {
|
914 |
// @todo: fix this ie8 hack
|
915 |
if ( this.el.innerHTML === '' ) {
|
920 |
this.model.set( 'subheading', this.el.querySelectorAll( '.field-subheading' )[0].value );
|
921 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
922 |
|
923 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
924 |
+
|
925 |
return this;
|
926 |
}
|
927 |
}
|
931 |
{
|
932 |
template: wp.ccf.utils.template( 'ccf-html-template' ),
|
933 |
|
|
|
|
|
|
|
|
|
934 |
saveField: function() {
|
935 |
// @todo: fix this ie8 hack
|
936 |
if ( this.el.innerHTML === '' ) {
|
940 |
this.model.set( 'html', this.el.querySelectorAll( '.field-html' )[0].value );
|
941 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
942 |
|
943 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
944 |
+
|
945 |
return this;
|
946 |
}
|
947 |
}
|
965 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
966 |
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
967 |
|
968 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
969 |
+
|
970 |
return this;
|
971 |
}
|
972 |
}
|
986 |
this.model.set( 'value', this.el.querySelectorAll( '.field-value' )[0].value );
|
987 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
988 |
|
989 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
990 |
+
|
991 |
return this;
|
992 |
}
|
993 |
}
|
1007 |
this.model.set( 'label', this.el.querySelectorAll( '.field-label' )[0].value );
|
1008 |
this.model.set( 'description', this.el.querySelectorAll( '.field-description' )[0].value );
|
1009 |
|
1010 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
1011 |
+
|
1012 |
var value = this.el.querySelectorAll( '.field-value' );
|
1013 |
if ( value.length > 0 ) {
|
1014 |
this.model.set( 'value', value[0].value );
|
1055 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
1056 |
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
1057 |
|
1058 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
1059 |
+
|
1060 |
return this;
|
1061 |
}
|
1062 |
}
|
1080 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
1081 |
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
1082 |
|
1083 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
1084 |
+
|
1085 |
return this;
|
1086 |
}
|
1087 |
}
|
1106 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
1107 |
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
1108 |
|
1109 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
1110 |
+
|
1111 |
return this;
|
1112 |
}
|
1113 |
}
|
1130 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
1131 |
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
1132 |
|
1133 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
1134 |
+
|
1135 |
return this;
|
1136 |
}
|
1137 |
}
|
1151 |
this.model.set( 'label', this.el.querySelectorAll( '.field-label' )[0].value );
|
1152 |
this.model.set( 'description', this.el.querySelectorAll( '.field-description' )[0].value );
|
1153 |
|
1154 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
1155 |
+
|
1156 |
var value = this.el.querySelectorAll( '.field-value' );
|
1157 |
if ( value.length ) {
|
1158 |
this.model.set( 'value', value[0].value );
|
1208 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
1209 |
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
1210 |
|
1211 |
+
wp.ccf.views.ChoiceableField.__super__.saveField.apply( this, arguments );
|
1212 |
|
1213 |
var choices = this.el.querySelectorAll( '.repeatable-choices' )[0].querySelectorAll( '.choice' );
|
1214 |
|
1220 |
|
1221 |
},
|
1222 |
|
1223 |
+
render: function( startPanel ) {
|
1224 |
var SELF = this;
|
1225 |
|
1226 |
+
startPanel = ( startPanel ) ? startPanel : 'basic';
|
1227 |
+
|
1228 |
+
SELF.el.innerHTML = SELF.template( { field: SELF.model.toJSON(), startPanel: startPanel } );
|
1229 |
|
1230 |
SELF.checkSlug();
|
1231 |
|
1254 |
}
|
1255 |
});
|
1256 |
|
1257 |
+
var conditionalsCollection = this.model.get( 'conditionals' );
|
1258 |
+
|
1259 |
+
var conditionals = this.el.querySelectorAll( '.conditionals' )[0];
|
1260 |
+
|
1261 |
+
if ( conditionalsCollection.length >= 1 ) {
|
1262 |
+
|
1263 |
+
conditionalsCollection.each( function( model ) {
|
1264 |
+
var view = new wp.ccf.views.FieldConditional( { model: model, field: this.model, fieldCollection: this.collection } ).render();
|
1265 |
+
conditionals.appendChild( view.el );
|
1266 |
+
}, this );
|
1267 |
+
} else {
|
1268 |
+
var conditional = new wp.ccf.models.FieldConditional();
|
1269 |
+
conditionalsCollection.add( conditional );
|
1270 |
+
}
|
1271 |
+
|
1272 |
return SELF;
|
1273 |
}
|
1274 |
}
|
1942 |
|
1943 |
signup: function( event ) {
|
1944 |
var email = this.el.querySelectorAll( '.email-signup-field' )[0].value;
|
|
|
1945 |
var signupContainer = this.el.querySelectorAll( '.bottom .left.signup' )[0];
|
1946 |
signupContainer.className = 'left signup';
|
1947 |
|
1951 |
method: 'post',
|
1952 |
dataType: 'jsonp',
|
1953 |
data: {
|
1954 |
+
EMAIL: email
|
|
|
1955 |
}
|
1956 |
}).done(function() {
|
1957 |
signupContainer.className = 'left signup signup-success';
|
{js → assets/js}/settings.js
RENAMED
File without changes
|
assets/scss/admin.scss
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@font-face {
|
2 |
+
font-family: 'menu';
|
3 |
+
src:url('../../fonts/menu.eot');
|
4 |
+
src:url('../../fonts/menu.eot?#iefix') format('embedded-opentype'),
|
5 |
+
url('../../fonts/menu.woff') format('woff'),
|
6 |
+
url('../../fonts/menu.ttf') format('truetype'),
|
7 |
+
url('../../fonts/menu.svg#form-manager') format('svg');
|
8 |
+
font-weight: normal;
|
9 |
+
font-style: normal;
|
10 |
+
}
|
11 |
+
|
12 |
+
#menu-posts-ccf_form {
|
13 |
+
.wp-menu-image:before {
|
14 |
+
font-family: 'menu';
|
15 |
+
content: "";
|
16 |
+
speak: none;
|
17 |
+
font-weight: normal;
|
18 |
+
font-variant: normal;
|
19 |
+
text-transform: none;
|
20 |
+
line-height: 1;
|
21 |
+
cursor: pointer;
|
22 |
+
-webkit-font-smoothing: antialiased;
|
23 |
+
}
|
24 |
+
}
|
25 |
+
|
26 |
+
.ccf-subscribe.updated {
|
27 |
+
width: 100%;
|
28 |
+
display: block;
|
29 |
+
box-sizing: border-box;
|
30 |
+
border: 0;
|
31 |
+
background-color: #FCECAD;
|
32 |
+
}
|
33 |
+
|
34 |
+
.ccf-subscribe.updated form {
|
35 |
+
display: inline;
|
36 |
+
}
|
37 |
+
|
38 |
+
.ccf-subscribe .ad-wrap {
|
39 |
+
margin: 0.5em 0;
|
40 |
+
padding: 2px;
|
41 |
+
}
|
42 |
+
|
43 |
+
.ccf-subscribe input[type=email] {
|
44 |
+
margin-left: 5px;
|
45 |
+
margin-right: 5px;
|
46 |
+
}
|
assets/scss/form-cpt.scss
ADDED
@@ -0,0 +1,220 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#titlediv {
|
2 |
+
display: none;
|
3 |
+
}
|
4 |
+
|
5 |
+
#submitdiv {
|
6 |
+
display: none;
|
7 |
+
}
|
8 |
+
|
9 |
+
#wp-admin-bar-view {
|
10 |
+
display: none;
|
11 |
+
}
|
12 |
+
|
13 |
+
.ccf-title {
|
14 |
+
h1 {
|
15 |
+
margin: 0;
|
16 |
+
|
17 |
+
.button {
|
18 |
+
vertical-align: middle;
|
19 |
+
top: -2px;
|
20 |
+
position: relative;
|
21 |
+
margin-left: 8px;
|
22 |
+
}
|
23 |
+
}
|
24 |
+
}
|
25 |
+
|
26 |
+
#post-body-content .ccf-open-form-manager {
|
27 |
+
display: none;
|
28 |
+
}
|
29 |
+
|
30 |
+
.add-new-h2 {
|
31 |
+
display: none;
|
32 |
+
}
|
33 |
+
|
34 |
+
#ccf-at-a-glance {
|
35 |
+
.inside {
|
36 |
+
margin: 0;
|
37 |
+
padding: 0;
|
38 |
+
|
39 |
+
.line {
|
40 |
+
display: block;
|
41 |
+
}
|
42 |
+
|
43 |
+
.has-icon {
|
44 |
+
display: block;
|
45 |
+
|
46 |
+
&:before {
|
47 |
+
font: normal 20px/1 'dashicons';
|
48 |
+
speak: none;
|
49 |
+
display: inline-block;
|
50 |
+
padding: 0 5px 0 0;
|
51 |
+
left: -1px;
|
52 |
+
position: relative;
|
53 |
+
vertical-align: top;
|
54 |
+
-webkit-font-smoothing: antialiased;
|
55 |
+
-moz-osx-font-smoothing: grayscale;
|
56 |
+
text-decoration: none !important;
|
57 |
+
top: -1px;
|
58 |
+
color: #888;
|
59 |
+
}
|
60 |
+
}
|
61 |
+
|
62 |
+
#ccf-created-by:before {
|
63 |
+
content: "\f110";
|
64 |
+
}
|
65 |
+
|
66 |
+
#ccf-submission-num:before {
|
67 |
+
content: "\f226";
|
68 |
+
}
|
69 |
+
|
70 |
+
#ccf-field-num:before {
|
71 |
+
content: "\f175";
|
72 |
+
}
|
73 |
+
|
74 |
+
#major-publishing-actions {
|
75 |
+
overflow: auto;
|
76 |
+
|
77 |
+
.submitdelete {
|
78 |
+
color: #a00;
|
79 |
+
text-decoration: none;
|
80 |
+
padding: 1px 2px;
|
81 |
+
}
|
82 |
+
|
83 |
+
.export-button {
|
84 |
+
float: right;
|
85 |
+
}
|
86 |
+
}
|
87 |
+
}
|
88 |
+
}
|
89 |
+
|
90 |
+
.ccf-form-cpt-preview {
|
91 |
+
.ccf-form-preview {
|
92 |
+
border: 0;
|
93 |
+
padding: 0;
|
94 |
+
background-color: inherit;
|
95 |
+
}
|
96 |
+
|
97 |
+
.spinner {
|
98 |
+
display: block;
|
99 |
+
float: none;
|
100 |
+
}
|
101 |
+
}
|
102 |
+
|
103 |
+
.ccf-submission-column-controller {
|
104 |
+
.spinner {
|
105 |
+
display: block;
|
106 |
+
float: none;
|
107 |
+
}
|
108 |
+
}
|
109 |
+
|
110 |
+
#ccf-submissions {
|
111 |
+
[data-icon]:before {
|
112 |
+
font-family: 'form-manager';
|
113 |
+
content: attr(data-icon);
|
114 |
+
speak: none;
|
115 |
+
font-weight: normal;
|
116 |
+
font-variant: normal;
|
117 |
+
text-transform: none;
|
118 |
+
line-height: 1;
|
119 |
+
cursor: pointer;
|
120 |
+
-webkit-font-smoothing: antialiased;
|
121 |
+
}
|
122 |
+
|
123 |
+
.ccf-submission-icon {
|
124 |
+
font: normal 20px/1;
|
125 |
+
speak: none;
|
126 |
+
display: inline-block;
|
127 |
+
padding: 12px 0px 4px 10px;
|
128 |
+
top: 0;
|
129 |
+
position: relative;
|
130 |
+
float: right;
|
131 |
+
width: 23px;
|
132 |
+
height: 30px;
|
133 |
+
cursor: pointer;
|
134 |
+
color: inherit;
|
135 |
+
}
|
136 |
+
|
137 |
+
.inside {
|
138 |
+
padding: 0;
|
139 |
+
margin: 0;
|
140 |
+
|
141 |
+
|
142 |
+
|
143 |
+
table {
|
144 |
+
border: 0;
|
145 |
+
border-collapse: collapse;
|
146 |
+
table-layout: auto;
|
147 |
+
width: 100%;
|
148 |
+
|
149 |
+
td, th {
|
150 |
+
padding: 8px 10px;
|
151 |
+
}
|
152 |
+
|
153 |
+
th input {
|
154 |
+
margin: 0;
|
155 |
+
}
|
156 |
+
|
157 |
+
tbody {
|
158 |
+
tr {
|
159 |
+
background-color: #f9f9f9;
|
160 |
+
|
161 |
+
td {
|
162 |
+
width: auto;
|
163 |
+
}
|
164 |
+
|
165 |
+
.spinner {
|
166 |
+
float: none;
|
167 |
+
display: block;
|
168 |
+
}
|
169 |
+
|
170 |
+
.actions {
|
171 |
+
text-align: right;
|
172 |
+
|
173 |
+
a {
|
174 |
+
cursor: pointer;
|
175 |
+
color: inherit;
|
176 |
+
padding-left: 4px;
|
177 |
+
}
|
178 |
+
}
|
179 |
+
|
180 |
+
.submission-wrapper {
|
181 |
+
display: none;
|
182 |
+
}
|
183 |
+
|
184 |
+
&:nth-child(2n-1) {
|
185 |
+
background-color: #fff;
|
186 |
+
}
|
187 |
+
|
188 |
+
td.no-submissions {
|
189 |
+
text-align: center;
|
190 |
+
width: auto;
|
191 |
+
padding-bottom: 8px;
|
192 |
+
}
|
193 |
+
}
|
194 |
+
}
|
195 |
+
}
|
196 |
+
|
197 |
+
.ccf-pagination {
|
198 |
+
border-top: 1px solid #eee;
|
199 |
+
margin-top: 0;
|
200 |
+
padding: 8px;
|
201 |
+
}
|
202 |
+
}
|
203 |
+
}
|
204 |
+
|
205 |
+
.ccf-submission-content {
|
206 |
+
.field-slug {
|
207 |
+
font-weight: bold;
|
208 |
+
font-size: 15px;
|
209 |
+
padding: 7px;
|
210 |
+
}
|
211 |
+
|
212 |
+
.field-content {
|
213 |
+
padding: 7px;
|
214 |
+
background-color: #f9f9f9;
|
215 |
+
|
216 |
+
span {
|
217 |
+
font-style: italic;
|
218 |
+
}
|
219 |
+
}
|
220 |
+
}
|
assets/scss/form-manager.scss
ADDED
@@ -0,0 +1,970 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@font-face {
|
2 |
+
font-family: 'menu';
|
3 |
+
src:url('../../fonts/menu.eot');
|
4 |
+
src:url('../../fonts/menu.eot?#iefix') format('embedded-opentype'),
|
5 |
+
url('../../fonts/menu.woff') format('woff'),
|
6 |
+
url('../../fonts/menu.ttf') format('truetype'),
|
7 |
+
url('../../fonts/menu.svg#form-manager') format('svg');
|
8 |
+
font-weight: normal;
|
9 |
+
font-style: normal;
|
10 |
+
}
|
11 |
+
|
12 |
+
@font-face {
|
13 |
+
font-family: 'form-manager';
|
14 |
+
src:url('../../fonts/form-manager.eot');
|
15 |
+
src:url('../../fonts/form-manager.eot?#iefix') format('embedded-opentype'),
|
16 |
+
url('../../fonts/form-manager.woff') format('woff'),
|
17 |
+
url('../../fonts/form-manager.ttf') format('truetype'),
|
18 |
+
url('../../fonts/form-manager.svg#form-manager') format('svg');
|
19 |
+
font-weight: normal;
|
20 |
+
font-style: normal;
|
21 |
+
}
|
22 |
+
|
23 |
+
.ccf-open-form-manager:before {
|
24 |
+
font-family: 'menu';
|
25 |
+
content: "";
|
26 |
+
padding-right: 4px;
|
27 |
+
speak: none;
|
28 |
+
font-weight: normal;
|
29 |
+
font-variant: normal;
|
30 |
+
text-transform: none;
|
31 |
+
line-height: 1;
|
32 |
+
cursor: pointer;
|
33 |
+
-webkit-font-smoothing: antialiased;
|
34 |
+
}
|
35 |
+
|
36 |
+
.ccf-main-modal {
|
37 |
+
[data-icon]:before {
|
38 |
+
font-family: 'form-manager';
|
39 |
+
content: attr(data-icon);
|
40 |
+
speak: none;
|
41 |
+
font-weight: normal;
|
42 |
+
font-variant: normal;
|
43 |
+
text-transform: none;
|
44 |
+
line-height: 1;
|
45 |
+
cursor: pointer;
|
46 |
+
-webkit-font-smoothing: antialiased;
|
47 |
+
}
|
48 |
+
|
49 |
+
.single .insert-form-button {
|
50 |
+
display: none;
|
51 |
+
}
|
52 |
+
|
53 |
+
.hidden {
|
54 |
+
display: block;
|
55 |
+
}
|
56 |
+
|
57 |
+
display: none;
|
58 |
+
position: fixed;
|
59 |
+
top: 30px;
|
60 |
+
left: 30px;
|
61 |
+
right: 30px;
|
62 |
+
bottom: 30px;
|
63 |
+
z-index: 160000;
|
64 |
+
overflow: hidden;
|
65 |
+
background-color: #fff;
|
66 |
+
|
67 |
+
.field {
|
68 |
+
margin-bottom: 5px;
|
69 |
+
overflow: auto;
|
70 |
+
position: relative;
|
71 |
+
|
72 |
+
&.field-incomplete {
|
73 |
+
h4 {
|
74 |
+
background-color: #ffebe8;
|
75 |
+
}
|
76 |
+
}
|
77 |
+
|
78 |
+
&.field-duplicate-slug {
|
79 |
+
h4 {
|
80 |
+
background-color: #ffe6a5;
|
81 |
+
}
|
82 |
+
}
|
83 |
+
|
84 |
+
&.ccf-editing {
|
85 |
+
border: #999 1px solid;
|
86 |
+
|
87 |
+
h4:hover {
|
88 |
+
border: 1px solid #e5e5e5;
|
89 |
+
}
|
90 |
+
}
|
91 |
+
|
92 |
+
h4 {
|
93 |
+
-webkit-box-shadow: 0 1px 1px rgba(0,0,0,.04);
|
94 |
+
box-shadow: 0 1px 1px rgba(0,0,0,.04);
|
95 |
+
border: 1px solid #e5e5e5;
|
96 |
+
background: #fafafa;
|
97 |
+
font-size: 13px;
|
98 |
+
margin: 0;
|
99 |
+
font-weight: 600;
|
100 |
+
color: #222;
|
101 |
+
padding: 13px 13px 13px 20px;
|
102 |
+
cursor: move;
|
103 |
+
|
104 |
+
&:hover {
|
105 |
+
border: #999 1px solid;
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
.right {
|
110 |
+
float: right;
|
111 |
+
display: block;
|
112 |
+
|
113 |
+
a {
|
114 |
+
color: inherit;
|
115 |
+
margin-left: 3px;
|
116 |
+
}
|
117 |
+
}
|
118 |
+
|
119 |
+
.preview {
|
120 |
+
clear: both;
|
121 |
+
display: none;
|
122 |
+
text-align: left;
|
123 |
+
overflow: auto;
|
124 |
+
float: none;
|
125 |
+
background-color: #fff;
|
126 |
+
border-left: 1px solid #e5e5e5;
|
127 |
+
border-right: 1px solid #e5e5e5;
|
128 |
+
border-bottom: 1px solid #e5e5e5;
|
129 |
+
padding: 10px 20px;
|
130 |
+
|
131 |
+
.recaptcha-preview-img {
|
132 |
+
margin-top: 7px;
|
133 |
+
}
|
134 |
+
|
135 |
+
.field-description {
|
136 |
+
margin-top: 3px;
|
137 |
+
clear: left;
|
138 |
+
}
|
139 |
+
|
140 |
+
.left {
|
141 |
+
float: left;
|
142 |
+
clear: both;
|
143 |
+
width: 47%;
|
144 |
+
}
|
145 |
+
|
146 |
+
.right {
|
147 |
+
float: right;
|
148 |
+
width: 47%;
|
149 |
+
}
|
150 |
+
|
151 |
+
.left, .right, .full {
|
152 |
+
|
153 |
+
input[type="text"], select {
|
154 |
+
width: 100%;
|
155 |
+
max-width: 100%;
|
156 |
+
}
|
157 |
+
|
158 |
+
.sub-label {
|
159 |
+
margin: 3px 0 3px 2px;
|
160 |
+
font-size: 90%;
|
161 |
+
}
|
162 |
+
|
163 |
+
.hour, .minute {
|
164 |
+
display: inline-block;
|
165 |
+
margin-right: 5px;
|
166 |
+
|
167 |
+
input {
|
168 |
+
width: 35px;
|
169 |
+
}
|
170 |
+
}
|
171 |
+
|
172 |
+
.am-pm {
|
173 |
+
display: inline-block;
|
174 |
+
vertical-align: top;
|
175 |
+
|
176 |
+
select {
|
177 |
+
width: 60px;
|
178 |
+
|
179 |
+
}
|
180 |
+
}
|
181 |
+
}
|
182 |
+
|
183 |
+
.heading {
|
184 |
+
font-size: 125%;
|
185 |
+
font-weight: bold;
|
186 |
+
border-bottom: 1px solid #ccc;
|
187 |
+
padding-bottom: 9px;
|
188 |
+
margin-bottom: 9px;
|
189 |
+
}
|
190 |
+
|
191 |
+
.subheading {
|
192 |
+
font-style: italic;
|
193 |
+
}
|
194 |
+
|
195 |
+
.conditionals-enabled {
|
196 |
+
font-size: 70%;
|
197 |
+
background-color: #ffe6a5;
|
198 |
+
font-weight:bold;
|
199 |
+
padding: 0px 2px;
|
200 |
+
opacity: .5;
|
201 |
+
left: 7px;
|
202 |
+
position: absolute;
|
203 |
+
top: 1.49em;
|
204 |
+
}
|
205 |
+
|
206 |
+
label {
|
207 |
+
font-weight: bold;
|
208 |
+
margin-bottom: 3px;
|
209 |
+
cursor: inherit;
|
210 |
+
|
211 |
+
span.required {
|
212 |
+
color: red;
|
213 |
+
}
|
214 |
+
}
|
215 |
+
|
216 |
+
input[type="checkbox"] + label {
|
217 |
+
display: inline-block;
|
218 |
+
}
|
219 |
+
|
220 |
+
input[type="radio"] + label {
|
221 |
+
display: inline-block;
|
222 |
+
}
|
223 |
+
|
224 |
+
input[type="text"], textarea {
|
225 |
+
border: inherit;
|
226 |
+
width: 100%;
|
227 |
+
background-color: #fff;
|
228 |
+
color: #333;
|
229 |
+
border: 1px solid #ddd;
|
230 |
+
-webkit-box-shadow: inset 0 1px 2px rgba( 0, 0, 0, 0.07 );
|
231 |
+
box-shadow: inset 0 1px 2px rgba( 0, 0, 0, 0.07 );
|
232 |
+
}
|
233 |
+
|
234 |
+
textarea {
|
235 |
+
height: 60px;
|
236 |
+
}
|
237 |
+
}
|
238 |
+
}
|
239 |
+
|
240 |
+
.close-icon {
|
241 |
+
position: absolute;
|
242 |
+
top: 16px;
|
243 |
+
right: 16px;
|
244 |
+
font-size: 35px;
|
245 |
+
cursor: pointer;
|
246 |
+
color: #333;
|
247 |
+
z-index: 160001;
|
248 |
+
}
|
249 |
+
|
250 |
+
.main-menu {
|
251 |
+
position: absolute;
|
252 |
+
top: 0;
|
253 |
+
right: 0;
|
254 |
+
left: 0;
|
255 |
+
height: 125px;
|
256 |
+
|
257 |
+
h1 {
|
258 |
+
padding: 16px;
|
259 |
+
}
|
260 |
+
|
261 |
+
ul {
|
262 |
+
height: 40px;
|
263 |
+
box-sizing: border-box;
|
264 |
+
font-size: 14px;
|
265 |
+
margin: 0;
|
266 |
+
list-style-type: none;
|
267 |
+
border-top: 1px solid #ddd;
|
268 |
+
background: #f3f3f3;
|
269 |
+
padding: 0 16px;
|
270 |
+
|
271 |
+
li {
|
272 |
+
display: inline-block;
|
273 |
+
margin: 0;
|
274 |
+
padding: 0;
|
275 |
+
display: inline-block;
|
276 |
+
height: 38px;
|
277 |
+
vertical-align: middle;
|
278 |
+
line-height: 40px;
|
279 |
+
padding: 0 8px;
|
280 |
+
|
281 |
+
a {
|
282 |
+
text-decoration: none;
|
283 |
+
|
284 |
+
:hover {
|
285 |
+
color: #000;
|
286 |
+
}
|
287 |
+
|
288 |
+
&.selected {
|
289 |
+
color: #000;
|
290 |
+
}
|
291 |
+
}
|
292 |
+
}
|
293 |
+
}
|
294 |
+
}
|
295 |
+
|
296 |
+
.ccf-form-pane {
|
297 |
+
display: none;
|
298 |
+
position: absolute;
|
299 |
+
top: 125px;
|
300 |
+
right: 0;
|
301 |
+
left: 0;
|
302 |
+
bottom: 0;
|
303 |
+
|
304 |
+
&.single {
|
305 |
+
top: 85px;
|
306 |
+
border-top: 1px solid #e5e5e5;
|
307 |
+
|
308 |
+
.form-content, .left-sidebar {
|
309 |
+
border-top: 0;
|
310 |
+
}
|
311 |
+
}
|
312 |
+
|
313 |
+
.disabled-overlay {
|
314 |
+
position: absolute;
|
315 |
+
top: 0;
|
316 |
+
left: 0;
|
317 |
+
right: 0;
|
318 |
+
bottom: 50px;;
|
319 |
+
background-color: #000;
|
320 |
+
opacity: .1;
|
321 |
+
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=1)";
|
322 |
+
filter: alpha(opacity=1);
|
323 |
+
-moz-opacity: 0.1;
|
324 |
+
-khtml-opacity: 0.1;
|
325 |
+
|
326 |
+
z-index: 3;
|
327 |
+
display: none;
|
328 |
+
}
|
329 |
+
|
330 |
+
.bottom {
|
331 |
+
bottom: 0;
|
332 |
+
left: 0;
|
333 |
+
right: 0;
|
334 |
+
height: 50px;
|
335 |
+
padding: 0 16px 0 0;
|
336 |
+
position: absolute;
|
337 |
+
text-align: right;
|
338 |
+
line-height: 50px;
|
339 |
+
border-top: 1px solid #e5e5e5;
|
340 |
+
|
341 |
+
.left {
|
342 |
+
float: left;
|
343 |
+
background-color: #00a0d2;
|
344 |
+
padding-left: 16px;
|
345 |
+
padding-right: 16px;
|
346 |
+
color: #fff;
|
347 |
+
|
348 |
+
@media (max-width: 830px) {
|
349 |
+
display: none;
|
350 |
+
}
|
351 |
+
|
352 |
+
input {
|
353 |
+
vertical-align: middle;
|
354 |
+
margin-left: 5px;
|
355 |
+
}
|
356 |
+
|
357 |
+
button {
|
358 |
+
vertical-align: middle;
|
359 |
+
}
|
360 |
+
|
361 |
+
.signup-x {
|
362 |
+
color: red;
|
363 |
+
display: none;
|
364 |
+
font-size: 150%;
|
365 |
+
vertical-align: middle;
|
366 |
+
font-weight: bold;
|
367 |
+
margin-left: 4px;
|
368 |
+
}
|
369 |
+
|
370 |
+
.signup-check {
|
371 |
+
color: green;
|
372 |
+
display: none;
|
373 |
+
vertical-align: middle;
|
374 |
+
font-size: 150%;
|
375 |
+
font-weight: bold;
|
376 |
+
margin-left: 4px;
|
377 |
+
}
|
378 |
+
}
|
379 |
+
|
380 |
+
.left.signup-success .signup-check {
|
381 |
+
display: inline;
|
382 |
+
}
|
383 |
+
|
384 |
+
.left.signup-error .signup-x {
|
385 |
+
display: inline;
|
386 |
+
}
|
387 |
+
|
388 |
+
.spinner {
|
389 |
+
display: none;
|
390 |
+
visibility: visible;
|
391 |
+
float: right;
|
392 |
+
width: 16px;
|
393 |
+
height: 16px;
|
394 |
+
margin-top: 16px;
|
395 |
+
}
|
396 |
+
|
397 |
+
input[type="button"] {
|
398 |
+
margin-top: 11px;
|
399 |
+
float: right;
|
400 |
+
margin-left: 6px;
|
401 |
+
}
|
402 |
+
}
|
403 |
+
|
404 |
+
.accordion-section {
|
405 |
+
background-color: #fff;
|
406 |
+
border-bottom: 0;
|
407 |
+
|
408 |
+
&:first-child {
|
409 |
+
border-top: 1px solid #e5e5e5;
|
410 |
+
}
|
411 |
+
|
412 |
+
&.expanded {
|
413 |
+
.section-content {
|
414 |
+
display: block;
|
415 |
+
}
|
416 |
+
|
417 |
+
.accordion-heading:before {
|
418 |
+
content: "";
|
419 |
+
}
|
420 |
+
|
421 |
+
.form-settings-heading:before {
|
422 |
+
content: "";
|
423 |
+
}
|
424 |
+
}
|
425 |
+
|
426 |
+
.accordion-heading, .form-settings-heading {
|
427 |
+
&:before {
|
428 |
+
margin-right: 8px;
|
429 |
+
font-family: 'form-manager';
|
430 |
+
content: "";
|
431 |
+
speak: none;
|
432 |
+
font-weight: normal;
|
433 |
+
font-variant: normal;
|
434 |
+
text-transform: none;
|
435 |
+
line-height: 1;
|
436 |
+
cursor: pointer;
|
437 |
+
-webkit-font-smoothing: antialiased;
|
438 |
+
}
|
439 |
+
|
440 |
+
cursor: pointer;
|
441 |
+
display: block;
|
442 |
+
line-height: 29px;
|
443 |
+
color: inherit;
|
444 |
+
padding: 10px 20px;
|
445 |
+
border-bottom: 1px solid #e5e5e5;
|
446 |
+
font-size: 150%;
|
447 |
+
background-color: #fafafa;
|
448 |
+
margin: 0;
|
449 |
+
}
|
450 |
+
|
451 |
+
.section-content {
|
452 |
+
display: none;
|
453 |
+
padding: 10px 20px;
|
454 |
+
border-bottom: 1px solid #e5e5e5;
|
455 |
+
}
|
456 |
+
}
|
457 |
+
|
458 |
+
label {
|
459 |
+
display: block;
|
460 |
+
margin-bottom: 8px;
|
461 |
+
}
|
462 |
+
|
463 |
+
.explain {
|
464 |
+
margin-top: 5px;
|
465 |
+
font-style: italic;
|
466 |
+
display: block;
|
467 |
+
}
|
468 |
+
|
469 |
+
&.show-form-settings .ccf-form-settings {
|
470 |
+
display: block;
|
471 |
+
}
|
472 |
+
|
473 |
+
.ccf-form-settings {
|
474 |
+
display: none;
|
475 |
+
position: absolute;
|
476 |
+
width: 75%;
|
477 |
+
bottom: 50px;
|
478 |
+
left: 25%;
|
479 |
+
z-index: 2;
|
480 |
+
top: 0;
|
481 |
+
overflow: auto;
|
482 |
+
background-color: #fff;
|
483 |
+
border-top: 1px solid #ddd;
|
484 |
+
padding: 21px;
|
485 |
+
box-sizing: border-box;
|
486 |
+
}
|
487 |
+
|
488 |
+
.ccf-form-settings p:first-child,
|
489 |
+
.ccf-form-settings h3:first-child {
|
490 |
+
margin-top: 0;
|
491 |
+
}
|
492 |
+
|
493 |
+
.ccf-form-settings h3 {
|
494 |
+
border-bottom: 1px solid #ccc;
|
495 |
+
padding-bottom: .75em;
|
496 |
+
margin-top: 2em;
|
497 |
+
}
|
498 |
+
|
499 |
+
.ccf-form-settings .ccf-form-notifications td {
|
500 |
+
position: relative;
|
501 |
+
}
|
502 |
+
|
503 |
+
.ccf-form-settings .variables {
|
504 |
+
margin-top: 0;
|
505 |
+
}
|
506 |
+
|
507 |
+
.ccf-form-settings .ccf-form-notifications .active {
|
508 |
+
width: 15%;
|
509 |
+
}
|
510 |
+
|
511 |
+
.ccf-form-settings .ccf-form-notifications .active-indicator {
|
512 |
+
color: #33CA33;
|
513 |
+
font-size: 40px;
|
514 |
+
}
|
515 |
+
|
516 |
+
.ccf-form-settings .ccf-form-notifications .inactive-indicator {
|
517 |
+
color: red;
|
518 |
+
font-size: 40px;
|
519 |
+
}
|
520 |
+
|
521 |
+
.ccf-form-settings .ccf-form-notifications .add-notification {
|
522 |
+
margin-top: 1em;
|
523 |
+
cursor: pointer;
|
524 |
+
}
|
525 |
+
|
526 |
+
.ccf-form-settings .close-notification {
|
527 |
+
position: absolute;
|
528 |
+
top: 10px;
|
529 |
+
right: 10px;
|
530 |
+
cursor: pointer;
|
531 |
+
font-size: 200%;
|
532 |
+
color: inherit;
|
533 |
+
}
|
534 |
+
|
535 |
+
.ccf-form-settings .delete-notification {
|
536 |
+
color: red;
|
537 |
+
}
|
538 |
+
|
539 |
+
.ccf-form-settings .address .add,
|
540 |
+
.ccf-form-settings .address .delete,
|
541 |
+
.ccf-form-settings .field-mapping .add,
|
542 |
+
.ccf-form-settings .field-mapping .delete {
|
543 |
+
color: inherit;
|
544 |
+
vertical-align: middle;
|
545 |
+
}
|
546 |
+
|
547 |
+
.ccf-form-settings .post-creation-mapping-wrapper {
|
548 |
+
margin-top: 1em;
|
549 |
+
}
|
550 |
+
|
551 |
+
.left-sidebar {
|
552 |
+
box-sizing: border-box;
|
553 |
+
background-color: #f3f3f3;
|
554 |
+
position: absolute;
|
555 |
+
border-top: 1px solid #ddd;
|
556 |
+
border-right: 1px solid #ddd;
|
557 |
+
overflow: scroll;
|
558 |
+
width: 25%;
|
559 |
+
top: 0;
|
560 |
+
padding: 0;
|
561 |
+
bottom: 50px;
|
562 |
+
left: 0;
|
563 |
+
overflow: auto;
|
564 |
+
|
565 |
+
.accordion-section:first-child {
|
566 |
+
border-top: 0;
|
567 |
+
}
|
568 |
+
|
569 |
+
.fields, .structure-fields, .special-fields {
|
570 |
+
padding: 5px;
|
571 |
+
|
572 |
+
.field .right, .field .preview {
|
573 |
+
display: none;
|
574 |
+
}
|
575 |
+
}
|
576 |
+
}
|
577 |
+
|
578 |
+
.form-content {
|
579 |
+
box-sizing: border-box;
|
580 |
+
position: absolute;
|
581 |
+
width: 40%;
|
582 |
+
bottom: 50px;
|
583 |
+
left: 25%;
|
584 |
+
right: 35%;
|
585 |
+
top: 0;
|
586 |
+
overflow: auto;
|
587 |
+
border-top: 1px solid #ddd;
|
588 |
+
padding: 21px;
|
589 |
+
|
590 |
+
.field-placeholder {
|
591 |
+
border: 1px dashed #e5e5e5;
|
592 |
+
height: 46px;
|
593 |
+
margin-bottom: 5px;
|
594 |
+
|
595 |
+
}
|
596 |
+
|
597 |
+
.no-fields {
|
598 |
+
font-size: 22px;
|
599 |
+
padding: 16px;
|
600 |
+
font-style: italic;
|
601 |
+
}
|
602 |
+
|
603 |
+
&:after {
|
604 |
+
width: 100%;
|
605 |
+
display: block;
|
606 |
+
margin-top: 5px;
|
607 |
+
box-sizing:border-box;
|
608 |
+
-moz-box-sizing:border-box;
|
609 |
+
-webkit-box-sizing:border-box;
|
610 |
+
font-style: italic;
|
611 |
+
font-size: 22px;
|
612 |
+
text-align: center;
|
613 |
+
padding: 1em .5em;
|
614 |
+
border: 4px dashed #e5e5e5;
|
615 |
+
content: attr(data-drag-message);
|
616 |
+
}
|
617 |
+
}
|
618 |
+
|
619 |
+
.right-sidebar {
|
620 |
+
box-sizing: border-box;
|
621 |
+
padding: 0;
|
622 |
+
position: absolute;
|
623 |
+
overflow: scroll;
|
624 |
+
width: 35%;
|
625 |
+
top: 0;
|
626 |
+
overflow: auto;
|
627 |
+
background-color: #f3f3f3;
|
628 |
+
right: 0;
|
629 |
+
bottom: 50px;
|
630 |
+
border-left: 1px solid #dddddd;
|
631 |
+
|
632 |
+
.section-content > div {
|
633 |
+
margin-bottom: 6px;
|
634 |
+
}
|
635 |
+
|
636 |
+
.no-field {
|
637 |
+
padding: 16px;
|
638 |
+
font-style: italic;
|
639 |
+
font-size: 22px;
|
640 |
+
}
|
641 |
+
|
642 |
+
label {
|
643 |
+
display: inline-block;
|
644 |
+
margin: 0;
|
645 |
+
|
646 |
+
.required {
|
647 |
+
color: red;
|
648 |
+
}
|
649 |
+
}
|
650 |
+
|
651 |
+
.field-error {
|
652 |
+
input {
|
653 |
+
border-color: #ff0000;
|
654 |
+
border-width: 2px;
|
655 |
+
}
|
656 |
+
}
|
657 |
+
|
658 |
+
.field-duplicate-slug input {
|
659 |
+
border-color: #ffe6a5;
|
660 |
+
border-width: 2px;
|
661 |
+
}
|
662 |
+
|
663 |
+
input[type=text] {
|
664 |
+
width: 100%;
|
665 |
+
display: block;
|
666 |
+
margin-top: 5px;
|
667 |
+
}
|
668 |
+
|
669 |
+
.hide {
|
670 |
+
display: none;
|
671 |
+
}
|
672 |
+
|
673 |
+
.conditionals input[type="text"] {
|
674 |
+
width: 100px;
|
675 |
+
display: inline-block;
|
676 |
+
}
|
677 |
+
|
678 |
+
input[type="checkbox"] + label {
|
679 |
+
display: inline-block;
|
680 |
+
vertical-align: middle;
|
681 |
+
}
|
682 |
+
|
683 |
+
label + select {
|
684 |
+
display: inline-block;
|
685 |
+
}
|
686 |
+
|
687 |
+
textarea {
|
688 |
+
width: 100%;
|
689 |
+
height: 80px;
|
690 |
+
margin-top: 5px;
|
691 |
+
}
|
692 |
+
|
693 |
+
.field-html {
|
694 |
+
height: 150px;
|
695 |
+
width: 100%;
|
696 |
+
}
|
697 |
+
|
698 |
+
.repeatable-choices {
|
699 |
+
.choice {
|
700 |
+
input[type='text'] {
|
701 |
+
width: 100px;
|
702 |
+
display: inline-block;
|
703 |
+
}
|
704 |
+
|
705 |
+
.move {
|
706 |
+
color: inherit;
|
707 |
+
cursor: move;
|
708 |
+
|
709 |
+
&:before {
|
710 |
+
cursor: move;
|
711 |
+
}
|
712 |
+
}
|
713 |
+
|
714 |
+
.add, .delete {
|
715 |
+
cursor: pointer;
|
716 |
+
color: inherit;
|
717 |
+
}
|
718 |
+
}
|
719 |
+
}
|
720 |
+
}
|
721 |
+
}
|
722 |
+
|
723 |
+
.ccf-existing-form-pane {
|
724 |
+
display: none;
|
725 |
+
position: absolute;
|
726 |
+
overflow: scroll;
|
727 |
+
top: 125px;
|
728 |
+
right: 0;
|
729 |
+
left: 0;
|
730 |
+
bottom: 0;
|
731 |
+
background-color: #fff;
|
732 |
+
padding: 16px;
|
733 |
+
}
|
734 |
+
|
735 |
+
.ccf-existing-form-pane table,
|
736 |
+
.ccf-form-notifications table {
|
737 |
+
width: 100%;
|
738 |
+
border-collapse: collapse;
|
739 |
+
table-layout: fixed;
|
740 |
+
border: 1px solid #ddd;
|
741 |
+
|
742 |
+
.left {
|
743 |
+
float: left;
|
744 |
+
width: 50%;
|
745 |
+
padding-right: 10px;
|
746 |
+
box-sizing: border-box;
|
747 |
+
|
748 |
+
textarea {
|
749 |
+
width: 100%;
|
750 |
+
height: 300px;
|
751 |
+
}
|
752 |
+
}
|
753 |
+
|
754 |
+
.right {
|
755 |
+
padding-left: 10px;
|
756 |
+
box-sizing: border-box;
|
757 |
+
float: right;
|
758 |
+
width: 50%;
|
759 |
+
}
|
760 |
+
|
761 |
+
td {
|
762 |
+
margin: 0;
|
763 |
+
padding: 14px 21px;
|
764 |
+
text-align: left;
|
765 |
+
}
|
766 |
+
|
767 |
+
.empty-form-table,
|
768 |
+
.no-notifications {
|
769 |
+
text-align: center;
|
770 |
+
}
|
771 |
+
|
772 |
+
thead,tfoot {
|
773 |
+
background-color: #f0f0f0;
|
774 |
+
|
775 |
+
tr {
|
776 |
+
border-bottom: 1px solid #e5e5e5;
|
777 |
+
border-top: 1px solid #e5e5e5;
|
778 |
+
}
|
779 |
+
|
780 |
+
th {
|
781 |
+
margin: 0;
|
782 |
+
text-align: left;
|
783 |
+
padding: 14px 21px;
|
784 |
+
box-sizing: border-box;
|
785 |
+
}
|
786 |
+
|
787 |
+
.id {
|
788 |
+
width: 5%;
|
789 |
+
}
|
790 |
+
|
791 |
+
.title {
|
792 |
+
width: 30%;
|
793 |
+
}
|
794 |
+
|
795 |
+
.author {
|
796 |
+
width: 10%;
|
797 |
+
}
|
798 |
+
|
799 |
+
.entries {
|
800 |
+
width: 10%;
|
801 |
+
}
|
802 |
+
|
803 |
+
.submissions {
|
804 |
+
width: 10%;
|
805 |
+
}
|
806 |
+
|
807 |
+
.number-of-fields {
|
808 |
+
width: 15%;
|
809 |
+
}
|
810 |
+
|
811 |
+
.date {
|
812 |
+
width: 20%;
|
813 |
+
}
|
814 |
+
}
|
815 |
+
|
816 |
+
tbody {
|
817 |
+
tr:nth-child(odd) {
|
818 |
+
background-color: #fafafa;
|
819 |
+
margin: 0;
|
820 |
+
}
|
821 |
+
|
822 |
+
tr {
|
823 |
+
background-color: #fff;
|
824 |
+
}
|
825 |
+
|
826 |
+
td {
|
827 |
+
vertical-align: top;
|
828 |
+
|
829 |
+
a {
|
830 |
+
text-decoration: none;
|
831 |
+
cursor: pointer;
|
832 |
+
}
|
833 |
+
|
834 |
+
.title {
|
835 |
+
font-weight: bold;
|
836 |
+
font-size: 14px;
|
837 |
+
}
|
838 |
+
|
839 |
+
.actions {
|
840 |
+
visibility: hidden;
|
841 |
+
margin-top: 6px;
|
842 |
+
|
843 |
+
.delete {
|
844 |
+
color: #ff0000;
|
845 |
+
}
|
846 |
+
}
|
847 |
+
}
|
848 |
+
|
849 |
+
tr:hover td .actions {
|
850 |
+
visibility: visible;
|
851 |
+
}
|
852 |
+
}
|
853 |
+
}
|
854 |
+
}
|
855 |
+
|
856 |
+
.ccf-main-modal-overlay {
|
857 |
+
display: none;
|
858 |
+
position: fixed;
|
859 |
+
top: 0px;
|
860 |
+
left: 0px;
|
861 |
+
width: 100%;
|
862 |
+
height: 100%;
|
863 |
+
z-index: 159900;
|
864 |
+
opacity: 0.7;
|
865 |
+
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";
|
866 |
+
filter: alpha(opacity=70);
|
867 |
+
-moz-opacity: 0.7;
|
868 |
+
-khtml-opacity: 0.7;
|
869 |
+
background-color: #000;
|
870 |
+
}
|
871 |
+
|
872 |
+
.ccf-pagination {
|
873 |
+
font-size: 12px;
|
874 |
+
margin-top: 8px;
|
875 |
+
text-align: right;
|
876 |
+
|
877 |
+
.pages {
|
878 |
+
padding: 0 4px;
|
879 |
+
}
|
880 |
+
|
881 |
+
.num-items {
|
882 |
+
font-style: italic;
|
883 |
+
padding-right: 4px;
|
884 |
+
}
|
885 |
+
|
886 |
+
a {
|
887 |
+
cursor: pointer;
|
888 |
+
color: #0074a2;
|
889 |
+
background: #f0f0f0;
|
890 |
+
text-decoration: none;
|
891 |
+
|
892 |
+
&.next, &.prev, &.first, &.last {
|
893 |
+
font-size: 16px;
|
894 |
+
line-height: 22px;
|
895 |
+
padding: 0 7px 2px 7px;
|
896 |
+
|
897 |
+
&:hover {
|
898 |
+
color: #fff;
|
899 |
+
background-color: #2ea2cc;
|
900 |
+
}
|
901 |
+
}
|
902 |
+
|
903 |
+
&.disabled {
|
904 |
+
color: #aaa;
|
905 |
+
|
906 |
+
&:hover {
|
907 |
+
color: #aaa;
|
908 |
+
background: #f0f0f0;
|
909 |
+
}
|
910 |
+
}
|
911 |
+
}
|
912 |
+
}
|
913 |
+
|
914 |
+
.ccf-error-modal {
|
915 |
+
display: none;
|
916 |
+
|
917 |
+
&.show {
|
918 |
+
display: block;
|
919 |
+
}
|
920 |
+
|
921 |
+
.ccf-notification-dialog-background {
|
922 |
+
position: fixed;
|
923 |
+
top: 0;
|
924 |
+
left: 0;
|
925 |
+
right: 0;
|
926 |
+
bottom: 0;
|
927 |
+
background: #000;
|
928 |
+
opacity: 0.7;
|
929 |
+
filter: alpha(opacity=70);
|
930 |
+
z-index: 1000000;
|
931 |
+
}
|
932 |
+
|
933 |
+
.notification-dialog {
|
934 |
+
position: fixed;
|
935 |
+
top: 30%;
|
936 |
+
left: 50%;
|
937 |
+
width: 450px;
|
938 |
+
margin-left: -225px;
|
939 |
+
background: #fff;
|
940 |
+
-webkit-box-shadow: 0 3px 6px rgba( 0, 0, 0, 0.3 );
|
941 |
+
box-shadow: 0 3px 6px rgba( 0, 0, 0, 0.3 );
|
942 |
+
line-height: 1.5;
|
943 |
+
z-index: 1000005;
|
944 |
+
|
945 |
+
.close {
|
946 |
+
font-size: 25px;
|
947 |
+
position: absolute;
|
948 |
+
right: 10px;
|
949 |
+
cursor: pointer;
|
950 |
+
}
|
951 |
+
|
952 |
+
.message {
|
953 |
+
margin: 25px;
|
954 |
+
|
955 |
+
.title {
|
956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
2 |
+
border: 1px solid #e5e5e5;
|
3 |
+
background-color: #fcfcfc;
|
4 |
+
padding: 3.5% 7.5%;
|
5 |
+
font-size: 14px;
|
6 |
+
font-family: "Open Sans",sans-serif;
|
7 |
+
|
8 |
+
&.preview-error {
|
9 |
+
text-align: center;
|
10 |
+
}
|
11 |
+
|
12 |
+
h2 {
|
13 |
+
margin: 0 0 10px 0;
|
14 |
+
padding: 0;
|
15 |
+
}
|
16 |
+
|
17 |
+
.field-submit {
|
18 |
+
margin-top: 15px;
|
19 |
+
|
20 |
+
input {
|
21 |
+
color: #555;
|
22 |
+
border-color: #ccc;
|
23 |
+
background: #f7f7f7;
|
24 |
+
-webkit-box-shadow: inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);
|
25 |
+
box-shadow: inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);
|
26 |
+
vertical-align: top;
|
27 |
+
display: inline-block;
|
28 |
+
text-decoration: none;
|
29 |
+
font-size: 13px;
|
30 |
+
line-height: 26px;
|
31 |
+
height: 28px;
|
32 |
+
margin: 0;
|
33 |
+
padding: 0 10px 1px;
|
34 |
+
cursor: pointer;
|
35 |
+
border-width: 1px;
|
36 |
+
border-style: solid;
|
37 |
+
-webkit-appearance: none;
|
38 |
+
-webkit-border-radius: 3px;
|
39 |
+
border-radius: 3px;
|
40 |
+
white-space: nowrap;
|
41 |
+
-webkit-box-sizing: border-box;
|
42 |
+
-moz-box-sizing: border-box;
|
43 |
+
box-sizing: border-box;
|
44 |
+
}
|
45 |
+
}
|
46 |
+
|
47 |
+
.field {
|
48 |
+
clear: both;
|
49 |
+
text-align: left;
|
50 |
+
float: none;
|
51 |
+
padding: 15px 0;
|
52 |
+
|
53 |
+
&:after {
|
54 |
+
content: ' ';
|
55 |
+
clear: both;
|
56 |
+
height: 0;
|
57 |
+
display: block;
|
58 |
+
}
|
59 |
+
|
60 |
+
label {
|
61 |
+
display: block;
|
62 |
+
}
|
63 |
+
|
64 |
+
.left {
|
65 |
+
float: left;
|
66 |
+
clear: both;
|
67 |
+
width: 47%;
|
68 |
+
}
|
69 |
+
|
70 |
+
.right {
|
71 |
+
float: right;
|
72 |
+
width: 47%;
|
73 |
+
}
|
74 |
+
|
75 |
+
.field-description {
|
76 |
+
margin-top: 7px;
|
77 |
+
clear: left;
|
78 |
+
}
|
79 |
+
|
80 |
+
.left, .right, .full {
|
81 |
+
|
82 |
+
input[type="text"], select {
|
83 |
+
width: 100%;
|
84 |
+
max-width: 100%;
|
85 |
+
}
|
86 |
+
|
87 |
+
.sub-label {
|
88 |
+
margin: 3px 0 3px 2px;
|
89 |
+
font-size: 90%;
|
90 |
+
}
|
91 |
+
}
|
92 |
+
|
93 |
+
.heading {
|
94 |
+
font-size: 125%;
|
95 |
+
font-weight: bold;
|
96 |
+
border-bottom: 1px solid #ccc;
|
97 |
+
padding-bottom: 9px;
|
98 |
+
margin-bottom: 9px;
|
99 |
+
}
|
100 |
+
|
101 |
+
.subheading {
|
102 |
+
font-style: italic;
|
103 |
+
}
|
104 |
+
|
105 |
+
label {
|
106 |
+
font-weight: bold;
|
107 |
+
margin-bottom: 7px;
|
108 |
+
cursor: inherit;
|
109 |
+
|
110 |
+
span.required {
|
111 |
+
color: red;
|
112 |
+
}
|
113 |
+
}
|
114 |
+
|
115 |
+
.conditionals-enabled {
|
116 |
+
display: none;
|
117 |
+
}
|
118 |
+
|
119 |
+
.choice {
|
120 |
+
padding-left: 15px;
|
121 |
+
|
122 |
+
label {
|
123 |
+
font-weight: normal;
|
124 |
+
}
|
125 |
+
}
|
126 |
+
|
127 |
+
input[type="checkbox"] + label {
|
128 |
+
display: inline-block;
|
129 |
+
}
|
130 |
+
|
131 |
+
input[type="radio"] + label {
|
132 |
+
display: inline-block;
|
133 |
+
}
|
134 |
+
|
135 |
+
input[type="text"], textarea {
|
136 |
+
border: 1px solid #ddd;
|
137 |
+
-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
|
138 |
+
box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
|
139 |
+
background-color: #fff;
|
140 |
+
color: #333;
|
141 |
+
height: 28px;
|
142 |
+
box-sizing: border-box;
|
143 |
+
width: 100%;
|
144 |
+
display: block;
|
145 |
+
}
|
146 |
+
|
147 |
+
input[type="text"], textarea, select {
|
148 |
+
padding: 3px 6px;
|
149 |
+
font-size: 14px;
|
150 |
+
}
|
151 |
+
|
152 |
+
textarea {
|
153 |
+
height: 80px;
|
154 |
+
}
|
155 |
+
|
156 |
+
select {
|
157 |
+
border: 1px solid #ddd;
|
158 |
+
-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
|
159 |
+
box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
|
160 |
+
background-color: #fff;
|
161 |
+
color: #333;
|
162 |
+
outline: 0;
|
163 |
+
padding: 2px;
|
164 |
+
line-height: 28px;
|
165 |
+
height: 28px;
|
166 |
+
vertical-align: middle;
|
167 |
+
font-size: 14px;
|
168 |
+
}
|
169 |
+
|
170 |
+
&.date {
|
171 |
+
.hour, .minute {
|
172 |
+
display: inline-block;
|
173 |
+
margin-right: 5px;
|
174 |
+
|
175 |
+
input {
|
176 |
+
width: 35px;
|
177 |
+
}
|
178 |
+
|
179 |
+
label {
|
180 |
+
font-weight: normal;
|
181 |
+
}
|
182 |
+
}
|
183 |
+
|
184 |
+
.am-pm {
|
185 |
+
display: inline-block;
|
186 |
+
vertical-align: top;
|
187 |
+
|
188 |
+
select {
|
189 |
+
width: 60px;
|
190 |
+
}
|
191 |
+
}
|
192 |
+
}
|
193 |
+
}
|
194 |
+
}
|
assets/scss/form-table.scss
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
.view-switch {
|
2 |
+
display: none;
|
3 |
+
}
|
assets/scss/form.scss
ADDED
@@ -0,0 +1,240 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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title {
|
13 |
+
font-size: 150%;
|
14 |
+
padding: 20px 0;
|
15 |
+
}
|
16 |
+
|
17 |
+
.form-description {
|
18 |
+
padding: 0 0 20px 0;
|
19 |
+
}
|
20 |
+
|
21 |
+
.form-submit {
|
22 |
+
img {
|
23 |
+
vertical-align: middle;
|
24 |
+
display: inline-block;
|
25 |
+
border: 0;
|
26 |
+
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
|
27 |
+
filter: alpha(opacity=0);
|
28 |
+
-moz-opacity: 0;
|
29 |
+
-khtml-opacity: 0;
|
30 |
+
opacity: 0;
|
31 |
+
float: none;
|
32 |
+
margin: 0 0 0 6px;
|
33 |
+
}
|
34 |
+
}
|
35 |
+
|
36 |
+
.field-description {
|
37 |
+
font-size: 85%;
|
38 |
+
clear: left;
|
39 |
+
margin-top: 6px;
|
40 |
+
}
|
41 |
+
|
42 |
+
.error {
|
43 |
+
color: #ff0000;
|
44 |
+
float: right;
|
45 |
+
font-size: 85%;
|
46 |
+
margin-top: 3px;
|
47 |
+
|
48 |
+
&.match-error, &.email-error, &.unknown-error {
|
49 |
+
float: none;
|
50 |
+
}
|
51 |
+
|
52 |
+
&.right-error {
|
53 |
+
float: right;
|
54 |
+
}
|
55 |
+
}
|
56 |
+
|
57 |
+
.field-hide {
|
58 |
+
display: none;
|
59 |
+
}
|
60 |
+
|
61 |
+
.field {
|
62 |
+
margin-bottom: 24px;
|
63 |
+
clear: both;
|
64 |
+
|
65 |
+
&[data-field-type="recaptcha"],&[data-field-type="file"],&[data-field-type="dropdown"], &[data-field-type="radio"], &[data-field-type="checkboxes"], &[data-field-type="date"] {
|
66 |
+
.error {
|
67 |
+
float: none;
|
68 |
+
}
|
69 |
+
}
|
70 |
+
|
71 |
+
.field-error-input {
|
72 |
+
border: 1px solid #ff0000;
|
73 |
+
}
|
74 |
+
|
75 |
+
label.main-label {
|
76 |
+
display: block;
|
77 |
+
clear: both;
|
78 |
+
margin-bottom: 6px;
|
79 |
+
font-weight: bold;
|
80 |
+
|
81 |
+
.required {
|
82 |
+
padding-right: .3em;
|
83 |
+
color: #ff0000;
|
84 |
+
}
|
85 |
+
}
|
86 |
+
|
87 |
+
input[type="text"], textarea {
|
88 |
+
width: 100%;
|
89 |
+
box-sizing: border-box;
|
90 |
+
}
|
91 |
+
|
92 |
+
select {
|
93 |
+
display: block;
|
94 |
+
width: auto;
|
95 |
+
}
|
96 |
+
|
97 |
+
input[type=file] {
|
98 |
+
background-color: inherit;
|
99 |
+
border: 0;
|
100 |
+
line-height: 0;
|
101 |
+
}
|
102 |
+
|
103 |
+
textarea {
|
104 |
+
min-height: 100px;
|
105 |
+
color: inherit;
|
106 |
+
font-family: inherit;
|
107 |
+
}
|
108 |
+
|
109 |
+
.left {
|
110 |
+
width: 50%;
|
111 |
+
float: left;
|
112 |
+
box-sizing: border-box;
|
113 |
+
padding-right: 10px;
|
114 |
+
clear: both;
|
115 |
+
}
|
116 |
+
|
117 |
+
.right {
|
118 |
+
width: 50%;
|
119 |
+
float: right;
|
120 |
+
box-sizing: border-box;
|
121 |
+
padding-left: 10px;
|
122 |
+
}
|
123 |
+
|
124 |
+
.sub-label {
|
125 |
+
margin-top: 3px;
|
126 |
+
font-size: 85%;
|
127 |
+
clear: none;
|
128 |
+
font-weight: normal;
|
129 |
+
}
|
130 |
+
|
131 |
+
&.field-type-section-header {
|
132 |
+
|
133 |
+
.heading {
|
134 |
+
font-size: 125%;
|
135 |
+
border-bottom: 1px solid #ccc;
|
136 |
+
padding-bottom: 5px;
|
137 |
+
}
|
138 |
+
|
139 |
+
.subheading {
|
140 |
+
margin-top: 10px;
|
141 |
+
font-size: 85%;
|
142 |
+
font-style: italic;
|
143 |
+
}
|
144 |
+
}
|
145 |
+
|
146 |
+
&.field-type-date {
|
147 |
+
.hour, .minute {
|
148 |
+
display: inline-block;
|
149 |
+
margin-right: 5px;
|
150 |
+
|
151 |
+
input {
|
152 |
+
width: 3.5em;
|
153 |
+
}
|
154 |
+
|
155 |
+
label {
|
156 |
+
font-weight: normal;
|
157 |
+
}
|
158 |
+
}
|
159 |
+
|
160 |
+
.am-pm {
|
161 |
+
display: inline-block;
|
162 |
+
vertical-align: top;
|
163 |
+
|
164 |
+
select {
|
165 |
+
width: auto;
|
166 |
+
}
|
167 |
+
}
|
168 |
+
}
|
169 |
+
}
|
170 |
+
|
171 |
+
.ccf-theme-dark {
|
172 |
+
font-size: 16px;
|
173 |
+
|
174 |
+
input[type=text], input[type=submit], select, textarea, dropdown {
|
175 |
+
border-radius: 4px;
|
176 |
+
background-color: #555;
|
177 |
+
color: #fff;
|
178 |
+
border: 1px solid #ccc;
|
179 |
+
padding: 8px;
|
180 |
+
|
181 |
+
&::-webkit-input-placeholder {
|
182 |
+
color: #ccc;
|
183 |
+
}
|
184 |
+
&:-moz-placeholder {
|
185 |
+
color: #ccc;
|
186 |
+
}
|
187 |
+
&:-moz-placeholder {
|
188 |
+
color: #ccc;
|
189 |
+
}
|
190 |
+
&:-ms-input-placeholder {
|
191 |
+
color: #ccc;
|
192 |
+
}
|
193 |
+
}
|
194 |
+
|
195 |
+
input.ccf-submit-button {
|
196 |
+
padding: 8px 14px;
|
197 |
+
background-color: #555555; background-image: -webkit-gradient(linear, left top, left bottom, from(#555555), to(#222));
|
198 |
+
background-image: -webkit-linear-gradient(top, #555555, #222);
|
199 |
+
background-image: -moz-linear-gradient(top, #555555, #222);
|
200 |
+
background-image: -ms-linear-gradient(top, #555555, #222);
|
201 |
+
background-image: -o-linear-gradient(top, #555555, #222);
|
202 |
+
background-image: linear-gradient(to bottom, #555555, #222);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#555555, endColorstr=#222);
|
203 |
+
}
|
204 |
+
}
|
205 |
+
|
206 |
+
.ccf-theme-light {
|
207 |
+
font-size: 16px;
|
208 |
+
|
209 |
+
input[type=text], input[type=submit], select, textarea, dropdown {
|
210 |
+
border-radius: 4px;
|
211 |
+
background-color: #fcfcfc;
|
212 |
+
color: #333;
|
213 |
+
border: 1px solid #e0e0e0;
|
214 |
+
padding: 8px;
|
215 |
+
|
216 |
+
&::-webkit-input-placeholder {
|
217 |
+
color: #ccc;
|
218 |
+
}
|
219 |
+
&:-moz-placeholder {
|
220 |
+
color: #ccc;
|
221 |
+
}
|
222 |
+
&:-moz-placeholder {
|
223 |
+
color: #ccc;
|
224 |
+
}
|
225 |
+
&:-ms-input-placeholder {
|
226 |
+
color: #ccc;
|
227 |
+
}
|
228 |
+
}
|
229 |
+
|
230 |
+
input.ccf-submit-button {
|
231 |
+
padding: 8px 14px;
|
232 |
+
background-color: #f0f0f0; background-image: -webkit-gradient(linear, left top, left bottom, from(#f0f0f0), to(#fcfcfc));
|
233 |
+
background-image: -webkit-linear-gradient(top, #f0f0f0, #fcfcfc);
|
234 |
+
background-image: -moz-linear-gradient(top, #f0f0f0, #fcfcfc);
|
235 |
+
background-image: -ms-linear-gradient(top, #f0f0f0, #fcfcfc);
|
236 |
+
background-image: -o-linear-gradient(top, #f0f0f0, #fcfcfc);
|
237 |
+
background-image: linear-gradient(to bottom, #f0f0f0, #fcfcfc);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#f0f0f0, endColorstr=#fcfcfc);
|
238 |
+
}
|
239 |
+
}
|
240 |
+
}
|
assets/scss/settings.scss
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.ccf-asset-restrictions .add,
|
2 |
+
.ccf-asset-restrictions .delete
|
3 |
+
{
|
4 |
+
font-weight: bold;
|
5 |
+
cursor: pointer;
|
6 |
+
vertical-align: middle;
|
7 |
+
font-size: 200%;
|
8 |
+
}
|
9 |
+
|
10 |
+
.ccf-asset-restrictions input,
|
11 |
+
.ccf-asset-restrictions select {
|
12 |
+
margin-right: 1em;
|
13 |
+
}
|
14 |
+
|
15 |
+
.ccf-hide-field {
|
16 |
+
display: none;
|
17 |
+
}
|
build/css/form-manager.css
CHANGED
@@ -444,6 +444,11 @@
|
|
444 |
width: 100%;
|
445 |
display: block;
|
446 |
margin-top: 5px; }
|
|
|
|
|
|
|
|
|
|
|
447 |
.ccf-main-modal .ccf-form-pane .right-sidebar input[type="checkbox"] + label {
|
448 |
display: inline-block;
|
449 |
vertical-align: middle; }
|
444 |
width: 100%;
|
445 |
display: block;
|
446 |
margin-top: 5px; }
|
447 |
+
.ccf-main-modal .ccf-form-pane .right-sidebar .hide {
|
448 |
+
display: none; }
|
449 |
+
.ccf-main-modal .ccf-form-pane .right-sidebar .conditionals input[type="text"] {
|
450 |
+
width: 100px;
|
451 |
+
display: inline-block; }
|
452 |
.ccf-main-modal .ccf-form-pane .right-sidebar input[type="checkbox"] + label {
|
453 |
display: inline-block;
|
454 |
vertical-align: middle; }
|
build/css/form-manager.css.map
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
{
|
2 |
"version": 3,
|
3 |
-
"mappings": ";AAAA,UASC;EARA,WAAW,EAAE,MAAM;EACnB,GAAG,EAAC,2BAA2B;EAC/B,GAAG,EAAC,mNAGkD;EACtD,WAAW,EAAE,MAAM;EACnB,UAAU,EAAE,MAAM;AAGnB,UASC;EARA,WAAW,EAAE,cAAc;EAC3B,GAAG,EAAC,mCAAmC;EACvC,GAAG,EAAC,mPAG0D;EAC9D,WAAW,EAAE,MAAM;EACnB,UAAU,EAAE,MAAM;AAGnB,6BAA8B;EAC7B,WAAW,EAAE,MAAM;EACnB,OAAO,EAAE,GAAG;EACZ,aAAa,EAAE,GAAG;EAClB,KAAK,EAAE,IAAI;EACX,WAAW,EAAE,MAAM;EACnB,YAAY,EAAE,MAAM;EACpB,cAAc,EAAE,IAAI;EACpB,WAAW,EAAE,CAAC;EACd,MAAM,EAAE,OAAO;EACf,sBAAsB,EAAE,WAAW;;AAGpC,eAAgB;EAqBf,OAAO,EAAE,IAAI;EACb,QAAQ,EAAE,KAAK;EACf,GAAG,EAAE,IAAI;EACT,IAAI,EAA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OAAO,EAAE,GAAG;IACZ,MAAM,EAAE,iBAAiB;IACzB,OAAO,EAAE,OAAO;EAGjB,qCAAqB;IACpB,QAAQ,EAAE,KAAK;IACf,GAAG,EAAE,GAAG;IACR,IAAI,EAAE,GAAG;IACT,KAAK,EAAE,KAAK;IACZ,WAAW,EAAE,MAAM;IACnB,UAAU,EAAE,IAAI;IAChB,kBAAkB,EAAE,4BAA8B;IAClD,UAAU,EAAE,4BAA8B;IAC1C,WAAW,EAAE,GAAG;IAChB,OAAO,EAAE,OAAO;IAEhB,4CAAO;MACN,SAAS,EAAE,IAAI;MACf,QAAQ,EAAE,QAAQ;MAClB,KAAK,EAAE,IAAI;MACX,MAAM,EAAE,OAAO;IAGhB,8CAAS;MACR,MAAM,EAAE,IAAI;MAEZ,qDAAO;QACN,KAAK,EAAE,OAAO;QACd,SAAS,EAAE,KAAK;QAChB,MAAM,EAAE,SAAS;MAGlB,iDAAG;QACF,WAAW,EAAE,IAAI;MAGlB,oDAAM;QACL,eAAe,EAAE,IAAI",
|
4 |
"sources": ["../../scss/form-manager.scss"],
|
5 |
"names": [],
|
6 |
"file": "form-manager.css"
|
build/css/form-manager.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
@charset "UTF-8";@font-face{font-family:menu;src:url(../../fonts/menu.eot);src:url(../../fonts/menu.eot?#iefix) format("embedded-opentype"),url(../../fonts/menu.woff) format("woff"),url(../../fonts/menu.ttf) format("truetype"),url(../../fonts/menu.svg#form-manager) format("svg");font-weight:400;font-style:normal}@font-face{font-family:form-manager;src:url(../../fonts/form-manager.eot);src:url(../../fonts/form-manager.eot?#iefix) format("embedded-opentype"),url(../../fonts/form-manager.woff) format("woff"),url(../../fonts/form-manager.ttf) format("truetype"),url(../../fonts/form-manager.svg#form-manager) format("svg");font-weight:400;font-style:normal}.ccf-open-form-manager:before{font-family:menu;content:"";padding-right:4px;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;cursor:pointer;-webkit-font-smoothing:antialiased}.ccf-main-modal{display:none;position:fixed;top:30px;left:30px;right:30px;bottom:30px;z-index:160000;overflow:hidden;background-color:#fff}.ccf-main-modal [data-icon]:before{font-family:form-manager;content:attr(data-icon);speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;cursor:pointer;-webkit-font-smoothing:antialiased}.ccf-main-modal .single .insert-form-button{display:none}.ccf-main-modal .hidden{display:block}.ccf-main-modal .field{margin-bottom:5px;overflow:auto}.ccf-main-modal .field.field-incomplete h4{background-color:#ffebe8}.ccf-main-modal .field.field-duplicate-slug h4{background-color:#ffe6a5}.ccf-main-modal .field.ccf-editing{border:#999 1px solid}.ccf-main-modal .field.ccf-editing h4:hover{border:1px solid #e5e5e5}.ccf-main-modal .field h4{-webkit-box-shadow:0 1px 1px rgba(0,0,0,.04);box-shadow:0 1px 1px rgba(0,0,0,.04);border:1px solid #e5e5e5;background:#fafafa;font-size:13px;margin:0;font-weight:600;color:#222;padding:13px;cursor:move}.ccf-main-modal .field h4:hover{border:#999 1px solid}.ccf-main-modal .field .right{float:right;display:block}.ccf-main-modal .field .right a{color:inherit;margin-left:3px}.ccf-main-modal .field .preview{clear:both;display:none;text-align:left;overflow:auto;float:none;background-color:#fff;border-left:1px solid #e5e5e5;border-right:1px solid #e5e5e5;border-bottom:1px solid #e5e5e5;padding:10px 20px}.ccf-main-modal .field .preview .recaptcha-preview-img{margin-top:7px}.ccf-main-modal .field .preview .field-description{margin-top:3px;clear:left}.ccf-main-modal .field .preview .left{float:left;clear:both;width:47%}.ccf-main-modal .field .preview .right{float:right;width:47%}.ccf-main-modal .field .preview .full input[type=text],.ccf-main-modal .field .preview .full select,.ccf-main-modal .field .preview .left input[type=text],.ccf-main-modal .field .preview .left select,.ccf-main-modal .field .preview .right input[type=text],.ccf-main-modal .field .preview .right select{width:100%;max-width:100%}.ccf-main-modal .field .preview .full .sub-label,.ccf-main-modal .field .preview .left .sub-label,.ccf-main-modal .field .preview .right .sub-label{margin:3px 0 3px 2px;font-size:90%}.ccf-main-modal .field .preview .full .hour,.ccf-main-modal .field .preview .full .minute,.ccf-main-modal .field .preview .left .hour,.ccf-main-modal .field .preview .left .minute,.ccf-main-modal .field .preview .right .hour,.ccf-main-modal .field .preview .right .minute{display:inline-block;margin-right:5px}.ccf-main-modal .field .preview .full .hour input,.ccf-main-modal .field .preview .full .minute input,.ccf-main-modal .field .preview .left .hour input,.ccf-main-modal .field .preview .left .minute input,.ccf-main-modal .field .preview .right .hour input,.ccf-main-modal .field .preview .right .minute input{width:35px}.ccf-main-modal .field .preview .full .am-pm,.ccf-main-modal .field .preview .left .am-pm,.ccf-main-modal .field .preview .right .am-pm{display:inline-block;vertical-align:top}.ccf-main-modal .field .preview .full .am-pm select,.ccf-main-modal .field .preview .left .am-pm select,.ccf-main-modal .field .preview .right .am-pm select{width:60px}.ccf-main-modal .field .preview .heading{font-size:125%;font-weight:700;border-bottom:1px solid #ccc;padding-bottom:9px;margin-bottom:9px}.ccf-main-modal .field .preview .subheading{font-style:italic}.ccf-main-modal .field .preview label{font-weight:700;margin-bottom:3px;cursor:inherit}.ccf-main-modal .field .preview label span{color:red}.ccf-main-modal .field .preview input[type=checkbox]+label,.ccf-main-modal .field .preview input[type=radio]+label{display:inline-block}.ccf-main-modal .field .preview input[type=text],.ccf-main-modal .field .preview textarea{width:100%;background-color:#fff;color:#333;border:1px solid #ddd;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.07);box-shadow:inset 0 1px 2px rgba(0,0,0,.07)}.ccf-main-modal .field .preview textarea{height:60px}.ccf-main-modal .close-icon{position:absolute;top:16px;right:16px;font-size:35px;cursor:pointer;color:#333;z-index:160001}.ccf-main-modal .main-menu{position:absolute;top:0;right:0;left:0;height:125px}.ccf-main-modal .main-menu h1{padding:16px}.ccf-main-modal .main-menu ul{height:40px;box-sizing:border-box;font-size:14px;margin:0;list-style-type:none;border-top:1px solid #ddd;background:#f3f3f3;padding:0 16px}.ccf-main-modal .main-menu ul li{margin:0;display:inline-block;height:38px;vertical-align:middle;line-height:40px;padding:0 8px}.ccf-main-modal .main-menu ul li a{text-decoration:none}.ccf-main-modal .main-menu ul li a :hover,.ccf-main-modal .main-menu ul li a.selected{color:#000}.ccf-main-modal .ccf-form-pane{display:none;position:absolute;top:125px;right:0;left:0;bottom:0}.ccf-main-modal .ccf-form-pane.single{top:85px;border-top:1px solid #e5e5e5}.ccf-main-modal .ccf-form-pane.single .form-content,.ccf-main-modal .ccf-form-pane.single .left-sidebar{border-top:0}.ccf-main-modal .ccf-form-pane .disabled-overlay{position:absolute;top:0;left:0;right:0;bottom:50px;background-color:#000;opacity:.1;-ms-filter:"alpha(Opacity=1)";filter:alpha(opacity=1);-moz-opacity:.1;-khtml-opacity:.1;z-index:3;display:none}.ccf-main-modal .ccf-form-pane .bottom{bottom:0;left:0;right:0;height:50px;padding:0 16px 0 0;position:absolute;text-align:right;line-height:50px;border-top:1px solid #e5e5e5}.ccf-main-modal .ccf-form-pane .bottom .left{float:left;background-color:#00a0d2;padding-left:16px;padding-right:16px;color:#fff}@media (max-width:830px){.ccf-main-modal .ccf-form-pane .bottom .left{display:none}}.ccf-main-modal .ccf-form-pane .bottom .left input{vertical-align:middle;margin-left:5px}.ccf-main-modal .ccf-form-pane .bottom .left button{vertical-align:middle}.ccf-main-modal .ccf-form-pane .bottom .left .signup-x{color:red;display:none;font-size:150%;vertical-align:middle;font-weight:700;margin-left:4px}.ccf-main-modal .ccf-form-pane .bottom .left .signup-check{color:green;display:none;vertical-align:middle;font-size:150%;font-weight:700;margin-left:4px}.ccf-main-modal .ccf-form-pane .bottom .left.signup-error .signup-x,.ccf-main-modal .ccf-form-pane .bottom .left.signup-success .signup-check{display:inline}.ccf-main-modal .ccf-form-pane .bottom .spinner{display:none;visibility:visible;float:right;width:16px;height:16px;margin-top:16px}.ccf-main-modal .ccf-form-pane .bottom input[type=button]{margin-top:11px;float:right;margin-left:6px}.ccf-main-modal .ccf-form-pane .accordion-section{background-color:#fff;border-bottom:0}.ccf-main-modal .ccf-form-pane .accordion-section:first-child{border-top:1px solid #e5e5e5}.ccf-main-modal .ccf-form-pane .accordion-section.expanded .section-content{display:block}.ccf-main-modal .ccf-form-pane .accordion-section.expanded .accordion-heading:before{content:""}.ccf-main-modal .ccf-form-pane .accordion-section.expanded .form-settings-heading:before{content:""}.ccf-main-modal .ccf-form-pane .accordion-section .accordion-heading,.ccf-main-modal .ccf-form-pane .accordion-section .form-settings-heading{cursor:pointer;display:block;line-height:29px;color:inherit;padding:10px 20px;border-bottom:1px solid #e5e5e5;font-size:150%;background-color:#fafafa;margin:0}.ccf-main-modal .ccf-form-pane .accordion-section .accordion-heading:before,.ccf-main-modal .ccf-form-pane .accordion-section .form-settings-heading:before{margin-right:8px;font-family:form-manager;content:"";speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;cursor:pointer;-webkit-font-smoothing:antialiased}.ccf-main-modal .ccf-form-pane .accordion-section .section-content{display:none;padding:10px 20px;border-bottom:1px solid #e5e5e5}.ccf-main-modal .ccf-form-pane label{display:block;margin-bottom:8px}.ccf-main-modal .ccf-form-pane .explain{margin-top:5px;font-style:italic;display:block}.ccf-main-modal .ccf-form-pane.show-form-settings .ccf-form-settings{display:block}.ccf-main-modal .ccf-form-pane .ccf-form-settings{display:none;position:absolute;width:75%;bottom:50px;left:25%;z-index:2;top:0;overflow:auto;background-color:#fff;border-top:1px solid #ddd;padding:21px;box-sizing:border-box}.ccf-main-modal .ccf-form-pane .ccf-form-settings h3:first-child,.ccf-main-modal .ccf-form-pane .ccf-form-settings p:first-child{margin-top:0}.ccf-main-modal .ccf-form-pane .ccf-form-settings h3{border-bottom:1px solid #ccc;padding-bottom:.75em;margin-top:2em}.ccf-main-modal .ccf-form-pane .ccf-form-settings .ccf-form-notifications td{position:relative}.ccf-main-modal .ccf-form-pane .ccf-form-settings .variables{margin-top:0}.ccf-main-modal .ccf-form-pane .ccf-form-settings .ccf-form-notifications .active{width:15%}.ccf-main-modal .ccf-form-pane .ccf-form-settings .ccf-form-notifications .active-indicator{color:#33CA33;font-size:40px}.ccf-main-modal .ccf-form-pane .ccf-form-settings .ccf-form-notifications .inactive-indicator{color:red;font-size:40px}.ccf-main-modal .ccf-form-pane .ccf-form-settings .ccf-form-notifications .add-notification{margin-top:1em;cursor:pointer}.ccf-main-modal .ccf-form-pane .ccf-form-settings .close-notification{position:absolute;top:10px;right:10px;cursor:pointer;font-size:200%;color:inherit}.ccf-main-modal .ccf-form-pane .ccf-form-settings .delete-notification{color:red}.ccf-main-modal .ccf-form-pane .ccf-form-settings .address .add,.ccf-main-modal .ccf-form-pane .ccf-form-settings .address .delete,.ccf-main-modal .ccf-form-pane .ccf-form-settings .field-mapping .add,.ccf-main-modal .ccf-form-pane .ccf-form-settings .field-mapping .delete{color:inherit;vertical-align:middle}.ccf-main-modal .ccf-form-pane .ccf-form-settings .post-creation-mapping-wrapper{margin-top:1em}.ccf-main-modal .ccf-form-pane .left-sidebar{box-sizing:border-box;background-color:#f3f3f3;position:absolute;border-top:1px solid #ddd;border-right:1px solid #ddd;width:25%;top:0;padding:0;bottom:50px;left:0;overflow:auto}.ccf-main-modal .ccf-form-pane .left-sidebar .accordion-section:first-child{border-top:0}.ccf-main-modal .ccf-form-pane .left-sidebar .fields,.ccf-main-modal .ccf-form-pane .left-sidebar .special-fields,.ccf-main-modal .ccf-form-pane .left-sidebar .structure-fields{padding:5px}.ccf-main-modal .ccf-form-pane .left-sidebar .fields .field .preview,.ccf-main-modal .ccf-form-pane .left-sidebar .fields .field .right,.ccf-main-modal .ccf-form-pane .left-sidebar .special-fields .field .preview,.ccf-main-modal .ccf-form-pane .left-sidebar .special-fields .field .right,.ccf-main-modal .ccf-form-pane .left-sidebar .structure-fields .field .preview,.ccf-main-modal .ccf-form-pane .left-sidebar .structure-fields .field .right{display:none}.ccf-main-modal .ccf-form-pane .form-content{box-sizing:border-box;position:absolute;width:40%;bottom:50px;left:25%;right:35%;top:0;overflow:auto;border-top:1px solid #ddd;padding:21px}.ccf-main-modal .ccf-form-pane .form-content .field-placeholder{border:1px dashed #e5e5e5;height:46px;margin-bottom:5px}.ccf-main-modal .ccf-form-pane .form-content .no-fields{font-size:22px;padding:16px;font-style:italic}.ccf-main-modal .ccf-form-pane .form-content:after{width:100%;display:block;margin-top:5px;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;font-style:italic;font-size:22px;text-align:center;padding:1em .5em;border:4px dashed #e5e5e5;content:attr(data-drag-message)}.ccf-main-modal .ccf-form-pane .right-sidebar{box-sizing:border-box;padding:0;position:absolute;width:35%;top:0;overflow:auto;background-color:#f3f3f3;right:0;bottom:50px;border-left:1px solid #ddd}.ccf-main-modal .ccf-form-pane .right-sidebar .section-content>div{margin-bottom:6px}.ccf-main-modal .ccf-form-pane .right-sidebar .no-field{padding:16px;font-style:italic;font-size:22px}.ccf-main-modal .ccf-form-pane .right-sidebar label{display:inline-block;margin:0}.ccf-main-modal .ccf-form-pane .right-sidebar label .required{color:red}.ccf-main-modal .ccf-form-pane .right-sidebar .field-error input{border-color:red;border-width:2px}.ccf-main-modal .ccf-form-pane .right-sidebar .field-duplicate-slug input{border-color:#ffe6a5;border-width:2px}.ccf-main-modal .ccf-form-pane .right-sidebar input[type=text]{width:100%;display:block;margin-top:5px}.ccf-main-modal .ccf-form-pane .right-sidebar input[type=checkbox]+label{display:inline-block;vertical-align:middle}.ccf-main-modal .ccf-form-pane .right-sidebar label+select{display:inline-block}.ccf-main-modal .ccf-form-pane .right-sidebar textarea{width:100%;height:80px;margin-top:5px}.ccf-main-modal .ccf-form-pane .right-sidebar .field-html{height:150px;width:100%}.ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices .choice input[type=text]{width:100px;display:inline-block}.ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices .choice .move{color:inherit;cursor:move}.ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices .choice .move:before{cursor:move}.ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices .choice .add,.ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices .choice .delete{cursor:pointer;color:inherit}.ccf-main-modal .ccf-existing-form-pane{display:none;position:absolute;overflow:scroll;top:125px;right:0;left:0;bottom:0;background-color:#fff;padding:16px}.ccf-main-modal .ccf-existing-form-pane table,.ccf-main-modal .ccf-form-notifications table{width:100%;border-collapse:collapse;table-layout:fixed;border:1px solid #ddd}.ccf-main-modal .ccf-existing-form-pane table .left,.ccf-main-modal .ccf-form-notifications table .left{float:left;width:50%;padding-right:10px;box-sizing:border-box}.ccf-main-modal .ccf-existing-form-pane table .left textarea,.ccf-main-modal .ccf-form-notifications table .left textarea{width:100%;height:300px}.ccf-main-modal .ccf-existing-form-pane table .right,.ccf-main-modal .ccf-form-notifications table .right{padding-left:10px;box-sizing:border-box;float:right;width:50%}.ccf-main-modal .ccf-existing-form-pane table td,.ccf-main-modal .ccf-form-notifications table td{margin:0;padding:14px 21px;text-align:left}.ccf-main-modal .ccf-existing-form-pane table .empty-form-table,.ccf-main-modal .ccf-existing-form-pane table .no-notifications,.ccf-main-modal .ccf-form-notifications table .empty-form-table,.ccf-main-modal .ccf-form-notifications table .no-notifications{text-align:center}.ccf-main-modal .ccf-existing-form-pane table tfoot,.ccf-main-modal .ccf-existing-form-pane table thead,.ccf-main-modal .ccf-form-notifications table tfoot,.ccf-main-modal .ccf-form-notifications table thead{background-color:#f0f0f0}.ccf-main-modal .ccf-existing-form-pane table tfoot tr,.ccf-main-modal .ccf-existing-form-pane table thead tr,.ccf-main-modal .ccf-form-notifications table tfoot tr,.ccf-main-modal .ccf-form-notifications table thead tr{border-bottom:1px solid #e5e5e5;border-top:1px solid #e5e5e5}.ccf-main-modal .ccf-existing-form-pane table tfoot th,.ccf-main-modal .ccf-existing-form-pane table thead th,.ccf-main-modal .ccf-form-notifications table tfoot th,.ccf-main-modal .ccf-form-notifications table thead th{margin:0;text-align:left;padding:14px 21px;box-sizing:border-box}.ccf-main-modal .ccf-existing-form-pane table tfoot .id,.ccf-main-modal .ccf-existing-form-pane table thead .id,.ccf-main-modal .ccf-form-notifications table tfoot .id,.ccf-main-modal .ccf-form-notifications table thead .id{width:5%}.ccf-main-modal .ccf-existing-form-pane table tfoot .title,.ccf-main-modal .ccf-existing-form-pane table thead .title,.ccf-main-modal .ccf-form-notifications table tfoot .title,.ccf-main-modal .ccf-form-notifications table thead .title{width:30%}.ccf-main-modal .ccf-existing-form-pane table tfoot .author,.ccf-main-modal .ccf-existing-form-pane table tfoot .entries,.ccf-main-modal .ccf-existing-form-pane table tfoot .submissions,.ccf-main-modal .ccf-existing-form-pane table thead .author,.ccf-main-modal .ccf-existing-form-pane table thead .entries,.ccf-main-modal .ccf-existing-form-pane table thead .submissions,.ccf-main-modal .ccf-form-notifications table tfoot .author,.ccf-main-modal .ccf-form-notifications table tfoot .entries,.ccf-main-modal .ccf-form-notifications table tfoot .submissions,.ccf-main-modal .ccf-form-notifications table thead .author,.ccf-main-modal .ccf-form-notifications table thead .entries,.ccf-main-modal .ccf-form-notifications table thead .submissions{width:10%}.ccf-main-modal .ccf-existing-form-pane table tfoot .number-of-fields,.ccf-main-modal .ccf-existing-form-pane table thead .number-of-fields,.ccf-main-modal .ccf-form-notifications table tfoot .number-of-fields,.ccf-main-modal .ccf-form-notifications table thead .number-of-fields{width:15%}.ccf-main-modal .ccf-existing-form-pane table tfoot .date,.ccf-main-modal .ccf-existing-form-pane table thead .date,.ccf-main-modal .ccf-form-notifications table tfoot .date,.ccf-main-modal .ccf-form-notifications table thead .date{width:20%}.ccf-main-modal .ccf-existing-form-pane table tbody tr:nth-child(odd),.ccf-main-modal .ccf-form-notifications table tbody tr:nth-child(odd){background-color:#fafafa;margin:0}.ccf-main-modal .ccf-existing-form-pane table tbody tr,.ccf-main-modal .ccf-form-notifications table tbody tr{background-color:#fff}.ccf-main-modal .ccf-existing-form-pane table tbody td,.ccf-main-modal .ccf-form-notifications table tbody td{vertical-align:top}.ccf-main-modal .ccf-existing-form-pane table tbody td a,.ccf-main-modal .ccf-form-notifications table tbody td a{text-decoration:none;cursor:pointer}.ccf-main-modal .ccf-existing-form-pane table tbody td .title,.ccf-main-modal .ccf-form-notifications table tbody td .title{font-weight:700;font-size:14px}.ccf-main-modal .ccf-existing-form-pane table tbody td .actions,.ccf-main-modal .ccf-form-notifications table tbody td .actions{visibility:hidden;margin-top:6px}.ccf-main-modal .ccf-existing-form-pane table tbody td .actions .delete,.ccf-main-modal .ccf-form-notifications table tbody td .actions .delete{color:red}.ccf-main-modal .ccf-existing-form-pane table tbody tr:hover td .actions,.ccf-main-modal .ccf-form-notifications table tbody tr:hover td .actions{visibility:visible}.ccf-main-modal-overlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;z-index:159900;opacity:.7;-ms-filter:"alpha(Opacity=70)";filter:alpha(opacity=70);-moz-opacity:.7;-khtml-opacity:.7;background-color:#000}.ccf-pagination{font-size:12px;margin-top:8px;text-align:right}.ccf-pagination .pages{padding:0 4px}.ccf-pagination .num-items{font-style:italic;padding-right:4px}.ccf-pagination a{cursor:pointer;color:#0074a2;background:#f0f0f0;text-decoration:none}.ccf-pagination a.first,.ccf-pagination a.last,.ccf-pagination a.next,.ccf-pagination a.prev{font-size:16px;line-height:22px;padding:0 7px 2px}.ccf-pagination a.first:hover,.ccf-pagination a.last:hover,.ccf-pagination a.next:hover,.ccf-pagination a.prev:hover{color:#fff;background-color:#2ea2cc}.ccf-pagination a.disabled{color:#aaa}.ccf-pagination a.disabled:hover{color:#aaa;background:#f0f0f0}.ccf-error-modal{display:none}.ccf-error-modal.show{display:block}.ccf-error-modal .ccf-notification-dialog-background{position:fixed;top:0;left:0;right:0;bottom:0;background:#000;opacity:.7;filter:alpha(opacity=70);z-index:1000000}.ccf-error-modal .notification-dialog{position:fixed;top:30%;left:50%;width:450px;margin-left:-225px;background:#fff;-webkit-box-shadow:0 3px 6px rgba(0,0,0,.3);box-shadow:0 3px 6px rgba(0,0,0,.3);line-height:1.5;z-index:1000005}.ccf-error-modal .notification-dialog .close{font-size:25px;position:absolute;right:10px;cursor:pointer}.ccf-error-modal .notification-dialog .message{margin:25px}.ccf-error-modal .notification-dialog .message .title{color:#23282d;font-size:1.3em;margin:0 0 1em}.ccf-error-modal .notification-dialog .message ul{margin-left:25px}.ccf-error-modal .notification-dialog .message ul li{list-style-type:disc}
|
1 |
+
@charset "UTF-8";@font-face{font-family:menu;src:url(../../fonts/menu.eot);src:url(../../fonts/menu.eot?#iefix) format("embedded-opentype"),url(../../fonts/menu.woff) format("woff"),url(../../fonts/menu.ttf) format("truetype"),url(../../fonts/menu.svg#form-manager) format("svg");font-weight:400;font-style:normal}@font-face{font-family:form-manager;src:url(../../fonts/form-manager.eot);src:url(../../fonts/form-manager.eot?#iefix) format("embedded-opentype"),url(../../fonts/form-manager.woff) format("woff"),url(../../fonts/form-manager.ttf) format("truetype"),url(../../fonts/form-manager.svg#form-manager) format("svg");font-weight:400;font-style:normal}.ccf-open-form-manager:before{font-family:menu;content:"";padding-right:4px;speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;cursor:pointer;-webkit-font-smoothing:antialiased}.ccf-main-modal{display:none;position:fixed;top:30px;left:30px;right:30px;bottom:30px;z-index:160000;overflow:hidden;background-color:#fff}.ccf-main-modal [data-icon]:before{font-family:form-manager;content:attr(data-icon);speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;cursor:pointer;-webkit-font-smoothing:antialiased}.ccf-main-modal .single .insert-form-button{display:none}.ccf-main-modal .hidden{display:block}.ccf-main-modal .field{margin-bottom:5px;overflow:auto}.ccf-main-modal .field.field-incomplete h4{background-color:#ffebe8}.ccf-main-modal .field.field-duplicate-slug h4{background-color:#ffe6a5}.ccf-main-modal .field.ccf-editing{border:#999 1px solid}.ccf-main-modal .field.ccf-editing h4:hover{border:1px solid #e5e5e5}.ccf-main-modal .field h4{-webkit-box-shadow:0 1px 1px rgba(0,0,0,.04);box-shadow:0 1px 1px rgba(0,0,0,.04);border:1px solid #e5e5e5;background:#fafafa;font-size:13px;margin:0;font-weight:600;color:#222;padding:13px;cursor:move}.ccf-main-modal .field h4:hover{border:#999 1px solid}.ccf-main-modal .field .right{float:right;display:block}.ccf-main-modal .field .right a{color:inherit;margin-left:3px}.ccf-main-modal .field .preview{clear:both;display:none;text-align:left;overflow:auto;float:none;background-color:#fff;border-left:1px solid #e5e5e5;border-right:1px solid #e5e5e5;border-bottom:1px solid #e5e5e5;padding:10px 20px}.ccf-main-modal .field .preview .recaptcha-preview-img{margin-top:7px}.ccf-main-modal .field .preview .field-description{margin-top:3px;clear:left}.ccf-main-modal .field .preview .left{float:left;clear:both;width:47%}.ccf-main-modal .field .preview .right{float:right;width:47%}.ccf-main-modal .field .preview .full input[type=text],.ccf-main-modal .field .preview .full select,.ccf-main-modal .field .preview .left input[type=text],.ccf-main-modal .field .preview .left select,.ccf-main-modal .field .preview .right input[type=text],.ccf-main-modal .field .preview .right select{width:100%;max-width:100%}.ccf-main-modal .field .preview .full .sub-label,.ccf-main-modal .field .preview .left .sub-label,.ccf-main-modal .field .preview .right .sub-label{margin:3px 0 3px 2px;font-size:90%}.ccf-main-modal .field .preview .full .hour,.ccf-main-modal .field .preview .full .minute,.ccf-main-modal .field .preview .left .hour,.ccf-main-modal .field .preview .left .minute,.ccf-main-modal .field .preview .right .hour,.ccf-main-modal .field .preview .right .minute{display:inline-block;margin-right:5px}.ccf-main-modal .field .preview .full .hour input,.ccf-main-modal .field .preview .full .minute input,.ccf-main-modal .field .preview .left .hour input,.ccf-main-modal .field .preview .left .minute input,.ccf-main-modal .field .preview .right .hour input,.ccf-main-modal .field .preview .right .minute input{width:35px}.ccf-main-modal .field .preview .full .am-pm,.ccf-main-modal .field .preview .left .am-pm,.ccf-main-modal .field .preview .right .am-pm{display:inline-block;vertical-align:top}.ccf-main-modal .field .preview .full .am-pm select,.ccf-main-modal .field .preview .left .am-pm select,.ccf-main-modal .field .preview .right .am-pm select{width:60px}.ccf-main-modal .field .preview .heading{font-size:125%;font-weight:700;border-bottom:1px solid #ccc;padding-bottom:9px;margin-bottom:9px}.ccf-main-modal .field .preview .subheading{font-style:italic}.ccf-main-modal .field .preview label{font-weight:700;margin-bottom:3px;cursor:inherit}.ccf-main-modal .field .preview label span{color:red}.ccf-main-modal .field .preview input[type=checkbox]+label,.ccf-main-modal .field .preview input[type=radio]+label{display:inline-block}.ccf-main-modal .field .preview input[type=text],.ccf-main-modal .field .preview textarea{width:100%;background-color:#fff;color:#333;border:1px solid #ddd;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.07);box-shadow:inset 0 1px 2px rgba(0,0,0,.07)}.ccf-main-modal .field .preview textarea{height:60px}.ccf-main-modal .close-icon{position:absolute;top:16px;right:16px;font-size:35px;cursor:pointer;color:#333;z-index:160001}.ccf-main-modal .main-menu{position:absolute;top:0;right:0;left:0;height:125px}.ccf-main-modal .main-menu h1{padding:16px}.ccf-main-modal .main-menu ul{height:40px;box-sizing:border-box;font-size:14px;margin:0;list-style-type:none;border-top:1px solid #ddd;background:#f3f3f3;padding:0 16px}.ccf-main-modal .main-menu ul li{margin:0;display:inline-block;height:38px;vertical-align:middle;line-height:40px;padding:0 8px}.ccf-main-modal .main-menu ul li a{text-decoration:none}.ccf-main-modal .main-menu ul li a :hover,.ccf-main-modal .main-menu ul li a.selected{color:#000}.ccf-main-modal .ccf-form-pane{display:none;position:absolute;top:125px;right:0;left:0;bottom:0}.ccf-main-modal .ccf-form-pane.single{top:85px;border-top:1px solid #e5e5e5}.ccf-main-modal .ccf-form-pane.single .form-content,.ccf-main-modal .ccf-form-pane.single .left-sidebar{border-top:0}.ccf-main-modal .ccf-form-pane .disabled-overlay{position:absolute;top:0;left:0;right:0;bottom:50px;background-color:#000;opacity:.1;-ms-filter:"alpha(Opacity=1)";filter:alpha(opacity=1);-moz-opacity:.1;-khtml-opacity:.1;z-index:3;display:none}.ccf-main-modal .ccf-form-pane .bottom{bottom:0;left:0;right:0;height:50px;padding:0 16px 0 0;position:absolute;text-align:right;line-height:50px;border-top:1px solid #e5e5e5}.ccf-main-modal .ccf-form-pane .bottom .left{float:left;background-color:#00a0d2;padding-left:16px;padding-right:16px;color:#fff}@media (max-width:830px){.ccf-main-modal .ccf-form-pane .bottom .left{display:none}}.ccf-main-modal .ccf-form-pane .bottom .left input{vertical-align:middle;margin-left:5px}.ccf-main-modal .ccf-form-pane .bottom .left button{vertical-align:middle}.ccf-main-modal .ccf-form-pane .bottom .left .signup-x{color:red;display:none;font-size:150%;vertical-align:middle;font-weight:700;margin-left:4px}.ccf-main-modal .ccf-form-pane .bottom .left .signup-check{color:green;display:none;vertical-align:middle;font-size:150%;font-weight:700;margin-left:4px}.ccf-main-modal .ccf-form-pane .bottom .left.signup-error .signup-x,.ccf-main-modal .ccf-form-pane .bottom .left.signup-success .signup-check{display:inline}.ccf-main-modal .ccf-form-pane .bottom .spinner{display:none;visibility:visible;float:right;width:16px;height:16px;margin-top:16px}.ccf-main-modal .ccf-form-pane .bottom input[type=button]{margin-top:11px;float:right;margin-left:6px}.ccf-main-modal .ccf-form-pane .accordion-section{background-color:#fff;border-bottom:0}.ccf-main-modal .ccf-form-pane .accordion-section:first-child{border-top:1px solid #e5e5e5}.ccf-main-modal .ccf-form-pane .accordion-section.expanded .section-content{display:block}.ccf-main-modal .ccf-form-pane .accordion-section.expanded .accordion-heading:before{content:""}.ccf-main-modal .ccf-form-pane .accordion-section.expanded .form-settings-heading:before{content:""}.ccf-main-modal .ccf-form-pane .accordion-section .accordion-heading,.ccf-main-modal .ccf-form-pane .accordion-section .form-settings-heading{cursor:pointer;display:block;line-height:29px;color:inherit;padding:10px 20px;border-bottom:1px solid #e5e5e5;font-size:150%;background-color:#fafafa;margin:0}.ccf-main-modal .ccf-form-pane .accordion-section .accordion-heading:before,.ccf-main-modal .ccf-form-pane .accordion-section .form-settings-heading:before{margin-right:8px;font-family:form-manager;content:"";speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;cursor:pointer;-webkit-font-smoothing:antialiased}.ccf-main-modal .ccf-form-pane .accordion-section .section-content{display:none;padding:10px 20px;border-bottom:1px solid #e5e5e5}.ccf-main-modal .ccf-form-pane label{display:block;margin-bottom:8px}.ccf-main-modal .ccf-form-pane .explain{margin-top:5px;font-style:italic;display:block}.ccf-main-modal .ccf-form-pane.show-form-settings .ccf-form-settings{display:block}.ccf-main-modal .ccf-form-pane .ccf-form-settings{display:none;position:absolute;width:75%;bottom:50px;left:25%;z-index:2;top:0;overflow:auto;background-color:#fff;border-top:1px solid #ddd;padding:21px;box-sizing:border-box}.ccf-main-modal .ccf-form-pane .ccf-form-settings h3:first-child,.ccf-main-modal .ccf-form-pane .ccf-form-settings p:first-child{margin-top:0}.ccf-main-modal .ccf-form-pane .ccf-form-settings h3{border-bottom:1px solid #ccc;padding-bottom:.75em;margin-top:2em}.ccf-main-modal .ccf-form-pane .ccf-form-settings .ccf-form-notifications td{position:relative}.ccf-main-modal .ccf-form-pane .ccf-form-settings .variables{margin-top:0}.ccf-main-modal .ccf-form-pane .ccf-form-settings .ccf-form-notifications .active{width:15%}.ccf-main-modal .ccf-form-pane .ccf-form-settings .ccf-form-notifications .active-indicator{color:#33CA33;font-size:40px}.ccf-main-modal .ccf-form-pane .ccf-form-settings .ccf-form-notifications .inactive-indicator{color:red;font-size:40px}.ccf-main-modal .ccf-form-pane .ccf-form-settings .ccf-form-notifications .add-notification{margin-top:1em;cursor:pointer}.ccf-main-modal .ccf-form-pane .ccf-form-settings .close-notification{position:absolute;top:10px;right:10px;cursor:pointer;font-size:200%;color:inherit}.ccf-main-modal .ccf-form-pane .ccf-form-settings .delete-notification{color:red}.ccf-main-modal .ccf-form-pane .ccf-form-settings .address .add,.ccf-main-modal .ccf-form-pane .ccf-form-settings .address .delete,.ccf-main-modal .ccf-form-pane .ccf-form-settings .field-mapping .add,.ccf-main-modal .ccf-form-pane .ccf-form-settings .field-mapping .delete{color:inherit;vertical-align:middle}.ccf-main-modal .ccf-form-pane .ccf-form-settings .post-creation-mapping-wrapper{margin-top:1em}.ccf-main-modal .ccf-form-pane .left-sidebar{box-sizing:border-box;background-color:#f3f3f3;position:absolute;border-top:1px solid #ddd;border-right:1px solid #ddd;width:25%;top:0;padding:0;bottom:50px;left:0;overflow:auto}.ccf-main-modal .ccf-form-pane .left-sidebar .accordion-section:first-child{border-top:0}.ccf-main-modal .ccf-form-pane .left-sidebar .fields,.ccf-main-modal .ccf-form-pane .left-sidebar .special-fields,.ccf-main-modal .ccf-form-pane .left-sidebar .structure-fields{padding:5px}.ccf-main-modal .ccf-form-pane .left-sidebar .fields .field .preview,.ccf-main-modal .ccf-form-pane .left-sidebar .fields .field .right,.ccf-main-modal .ccf-form-pane .left-sidebar .special-fields .field .preview,.ccf-main-modal .ccf-form-pane .left-sidebar .special-fields .field .right,.ccf-main-modal .ccf-form-pane .left-sidebar .structure-fields .field .preview,.ccf-main-modal .ccf-form-pane .left-sidebar .structure-fields .field .right{display:none}.ccf-main-modal .ccf-form-pane .form-content{box-sizing:border-box;position:absolute;width:40%;bottom:50px;left:25%;right:35%;top:0;overflow:auto;border-top:1px solid #ddd;padding:21px}.ccf-main-modal .ccf-form-pane .form-content .field-placeholder{border:1px dashed #e5e5e5;height:46px;margin-bottom:5px}.ccf-main-modal .ccf-form-pane .form-content .no-fields{font-size:22px;padding:16px;font-style:italic}.ccf-main-modal .ccf-form-pane .form-content:after{width:100%;display:block;margin-top:5px;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;font-style:italic;font-size:22px;text-align:center;padding:1em .5em;border:4px dashed #e5e5e5;content:attr(data-drag-message)}.ccf-main-modal .ccf-form-pane .right-sidebar{box-sizing:border-box;padding:0;position:absolute;width:35%;top:0;overflow:auto;background-color:#f3f3f3;right:0;bottom:50px;border-left:1px solid #ddd}.ccf-main-modal .ccf-form-pane .right-sidebar .section-content>div{margin-bottom:6px}.ccf-main-modal .ccf-form-pane .right-sidebar .no-field{padding:16px;font-style:italic;font-size:22px}.ccf-main-modal .ccf-form-pane .right-sidebar label{display:inline-block;margin:0}.ccf-main-modal .ccf-form-pane .right-sidebar label .required{color:red}.ccf-main-modal .ccf-form-pane .right-sidebar .field-error input{border-color:red;border-width:2px}.ccf-main-modal .ccf-form-pane .right-sidebar .field-duplicate-slug input{border-color:#ffe6a5;border-width:2px}.ccf-main-modal .ccf-form-pane .right-sidebar input[type=text]{width:100%;display:block;margin-top:5px}.ccf-main-modal .ccf-form-pane .right-sidebar .hide{display:none}.ccf-main-modal .ccf-form-pane .right-sidebar .conditionals input[type=text]{width:100px;display:inline-block}.ccf-main-modal .ccf-form-pane .right-sidebar input[type=checkbox]+label{display:inline-block;vertical-align:middle}.ccf-main-modal .ccf-form-pane .right-sidebar label+select{display:inline-block}.ccf-main-modal .ccf-form-pane .right-sidebar textarea{width:100%;height:80px;margin-top:5px}.ccf-main-modal .ccf-form-pane .right-sidebar .field-html{height:150px;width:100%}.ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices .choice input[type=text]{width:100px;display:inline-block}.ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices .choice .move{color:inherit;cursor:move}.ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices .choice .move:before{cursor:move}.ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices .choice .add,.ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices .choice .delete{cursor:pointer;color:inherit}.ccf-main-modal .ccf-existing-form-pane{display:none;position:absolute;overflow:scroll;top:125px;right:0;left:0;bottom:0;background-color:#fff;padding:16px}.ccf-main-modal .ccf-existing-form-pane table,.ccf-main-modal .ccf-form-notifications table{width:100%;border-collapse:collapse;table-layout:fixed;border:1px solid #ddd}.ccf-main-modal .ccf-existing-form-pane table .left,.ccf-main-modal .ccf-form-notifications table .left{float:left;width:50%;padding-right:10px;box-sizing:border-box}.ccf-main-modal .ccf-existing-form-pane table .left textarea,.ccf-main-modal .ccf-form-notifications table .left textarea{width:100%;height:300px}.ccf-main-modal .ccf-existing-form-pane table .right,.ccf-main-modal .ccf-form-notifications table .right{padding-left:10px;box-sizing:border-box;float:right;width:50%}.ccf-main-modal .ccf-existing-form-pane table td,.ccf-main-modal .ccf-form-notifications table td{margin:0;padding:14px 21px;text-align:left}.ccf-main-modal .ccf-existing-form-pane table .empty-form-table,.ccf-main-modal .ccf-existing-form-pane table .no-notifications,.ccf-main-modal .ccf-form-notifications table .empty-form-table,.ccf-main-modal .ccf-form-notifications table .no-notifications{text-align:center}.ccf-main-modal .ccf-existing-form-pane table tfoot,.ccf-main-modal .ccf-existing-form-pane table thead,.ccf-main-modal .ccf-form-notifications table tfoot,.ccf-main-modal .ccf-form-notifications table thead{background-color:#f0f0f0}.ccf-main-modal .ccf-existing-form-pane table tfoot tr,.ccf-main-modal .ccf-existing-form-pane table thead tr,.ccf-main-modal .ccf-form-notifications table tfoot tr,.ccf-main-modal .ccf-form-notifications table thead tr{border-bottom:1px solid #e5e5e5;border-top:1px solid #e5e5e5}.ccf-main-modal .ccf-existing-form-pane table tfoot th,.ccf-main-modal .ccf-existing-form-pane table thead th,.ccf-main-modal .ccf-form-notifications table tfoot th,.ccf-main-modal .ccf-form-notifications table thead th{margin:0;text-align:left;padding:14px 21px;box-sizing:border-box}.ccf-main-modal .ccf-existing-form-pane table tfoot .id,.ccf-main-modal .ccf-existing-form-pane table thead .id,.ccf-main-modal .ccf-form-notifications table tfoot .id,.ccf-main-modal .ccf-form-notifications table thead .id{width:5%}.ccf-main-modal .ccf-existing-form-pane table tfoot .title,.ccf-main-modal .ccf-existing-form-pane table thead .title,.ccf-main-modal .ccf-form-notifications table tfoot .title,.ccf-main-modal .ccf-form-notifications table thead .title{width:30%}.ccf-main-modal .ccf-existing-form-pane table tfoot .author,.ccf-main-modal .ccf-existing-form-pane table tfoot .entries,.ccf-main-modal .ccf-existing-form-pane table tfoot .submissions,.ccf-main-modal .ccf-existing-form-pane table thead .author,.ccf-main-modal .ccf-existing-form-pane table thead .entries,.ccf-main-modal .ccf-existing-form-pane table thead .submissions,.ccf-main-modal .ccf-form-notifications table tfoot .author,.ccf-main-modal .ccf-form-notifications table tfoot .entries,.ccf-main-modal .ccf-form-notifications table tfoot .submissions,.ccf-main-modal .ccf-form-notifications table thead .author,.ccf-main-modal .ccf-form-notifications table thead .entries,.ccf-main-modal .ccf-form-notifications table thead .submissions{width:10%}.ccf-main-modal .ccf-existing-form-pane table tfoot .number-of-fields,.ccf-main-modal .ccf-existing-form-pane table thead .number-of-fields,.ccf-main-modal .ccf-form-notifications table tfoot .number-of-fields,.ccf-main-modal .ccf-form-notifications table thead .number-of-fields{width:15%}.ccf-main-modal .ccf-existing-form-pane table tfoot .date,.ccf-main-modal .ccf-existing-form-pane table thead .date,.ccf-main-modal .ccf-form-notifications table tfoot .date,.ccf-main-modal .ccf-form-notifications table thead .date{width:20%}.ccf-main-modal .ccf-existing-form-pane table tbody tr:nth-child(odd),.ccf-main-modal .ccf-form-notifications table tbody tr:nth-child(odd){background-color:#fafafa;margin:0}.ccf-main-modal .ccf-existing-form-pane table tbody tr,.ccf-main-modal .ccf-form-notifications table tbody tr{background-color:#fff}.ccf-main-modal .ccf-existing-form-pane table tbody td,.ccf-main-modal .ccf-form-notifications table tbody td{vertical-align:top}.ccf-main-modal .ccf-existing-form-pane table tbody td a,.ccf-main-modal .ccf-form-notifications table tbody td a{text-decoration:none;cursor:pointer}.ccf-main-modal .ccf-existing-form-pane table tbody td .title,.ccf-main-modal .ccf-form-notifications table tbody td .title{font-weight:700;font-size:14px}.ccf-main-modal .ccf-existing-form-pane table tbody td .actions,.ccf-main-modal .ccf-form-notifications table tbody td .actions{visibility:hidden;margin-top:6px}.ccf-main-modal .ccf-existing-form-pane table tbody td .actions .delete,.ccf-main-modal .ccf-form-notifications table tbody td .actions .delete{color:red}.ccf-main-modal .ccf-existing-form-pane table tbody tr:hover td .actions,.ccf-main-modal .ccf-form-notifications table tbody tr:hover td .actions{visibility:visible}.ccf-main-modal-overlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;z-index:159900;opacity:.7;-ms-filter:"alpha(Opacity=70)";filter:alpha(opacity=70);-moz-opacity:.7;-khtml-opacity:.7;background-color:#000}.ccf-pagination{font-size:12px;margin-top:8px;text-align:right}.ccf-pagination .pages{padding:0 4px}.ccf-pagination .num-items{font-style:italic;padding-right:4px}.ccf-pagination a{cursor:pointer;color:#0074a2;background:#f0f0f0;text-decoration:none}.ccf-pagination a.first,.ccf-pagination a.last,.ccf-pagination a.next,.ccf-pagination a.prev{font-size:16px;line-height:22px;padding:0 7px 2px}.ccf-pagination a.first:hover,.ccf-pagination a.last:hover,.ccf-pagination a.next:hover,.ccf-pagination a.prev:hover{color:#fff;background-color:#2ea2cc}.ccf-pagination a.disabled{color:#aaa}.ccf-pagination a.disabled:hover{color:#aaa;background:#f0f0f0}.ccf-error-modal{display:none}.ccf-error-modal.show{display:block}.ccf-error-modal .ccf-notification-dialog-background{position:fixed;top:0;left:0;right:0;bottom:0;background:#000;opacity:.7;filter:alpha(opacity=70);z-index:1000000}.ccf-error-modal .notification-dialog{position:fixed;top:30%;left:50%;width:450px;margin-left:-225px;background:#fff;-webkit-box-shadow:0 3px 6px rgba(0,0,0,.3);box-shadow:0 3px 6px rgba(0,0,0,.3);line-height:1.5;z-index:1000005}.ccf-error-modal .notification-dialog .close{font-size:25px;position:absolute;right:10px;cursor:pointer}.ccf-error-modal .notification-dialog .message{margin:25px}.ccf-error-modal .notification-dialog .message .title{color:#23282d;font-size:1.3em;margin:0 0 1em}.ccf-error-modal .notification-dialog .message ul{margin-left:25px}.ccf-error-modal .notification-dialog .message ul li{list-style-type:disc}
|
build/js/form-manager.js
CHANGED
@@ -322,6 +322,22 @@
|
|
322 |
return this;
|
323 |
};
|
324 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
325 |
wp.ccf.models.FieldChoice = wp.ccf.models.FieldChoice || Backbone.Model.extend(
|
326 |
{
|
327 |
defaults: {
|
@@ -519,6 +535,20 @@
|
|
519 |
delete response.fields[i].choices;
|
520 |
}
|
521 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
522 |
field.set( newField );
|
523 |
field.decode();
|
524 |
}
|
@@ -678,12 +708,33 @@
|
|
678 |
{
|
679 |
idAttribute: 'id',
|
680 |
|
681 |
-
defaults: {
|
682 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
683 |
},
|
684 |
|
685 |
set: _modelSet,
|
686 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
687 |
required: function() {
|
688 |
return [ 'slug' ];
|
689 |
},
|
@@ -725,7 +776,11 @@
|
|
725 |
description: ''
|
726 |
};
|
727 |
|
728 |
-
return _.defaults( defaults, this.constructor.__super__.defaults );
|
|
|
|
|
|
|
|
|
729 |
}
|
730 |
}
|
731 |
);
|
@@ -738,6 +793,10 @@
|
|
738 |
};
|
739 |
|
740 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
|
|
|
|
|
|
|
|
741 |
}
|
742 |
}
|
743 |
);
|
@@ -752,6 +811,10 @@
|
|
752 |
};
|
753 |
|
754 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
|
|
|
|
|
|
|
|
755 |
}
|
756 |
}
|
757 |
);
|
@@ -764,6 +827,10 @@
|
|
764 |
};
|
765 |
|
766 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
|
|
|
|
|
|
|
|
767 |
}
|
768 |
}
|
769 |
);
|
@@ -776,6 +843,10 @@
|
|
776 |
};
|
777 |
|
778 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
|
|
|
|
|
|
|
|
779 |
}
|
780 |
}
|
781 |
);
|
@@ -789,6 +860,10 @@
|
|
789 |
};
|
790 |
|
791 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
|
|
|
|
|
|
|
|
792 |
}
|
793 |
}
|
794 |
);
|
@@ -802,6 +877,10 @@
|
|
802 |
};
|
803 |
|
804 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
|
|
|
|
|
|
|
|
805 |
}
|
806 |
}
|
807 |
);
|
@@ -815,6 +894,10 @@
|
|
815 |
};
|
816 |
|
817 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
|
|
|
|
|
|
|
|
818 |
}
|
819 |
}
|
820 |
);
|
@@ -830,6 +913,10 @@
|
|
830 |
};
|
831 |
|
832 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
|
|
|
|
|
|
|
|
833 |
}
|
834 |
}
|
835 |
);
|
@@ -842,6 +929,10 @@
|
|
842 |
};
|
843 |
|
844 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
|
|
|
|
|
|
|
|
845 |
}
|
846 |
}
|
847 |
);
|
@@ -862,7 +953,11 @@
|
|
862 |
return [ 'siteKey', 'secretKey' ];
|
863 |
},
|
864 |
|
865 |
-
isImmutable: true
|
|
|
|
|
|
|
|
|
866 |
}
|
867 |
);
|
868 |
|
@@ -875,6 +970,10 @@
|
|
875 |
};
|
876 |
|
877 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
|
|
|
|
|
|
|
|
878 |
}
|
879 |
}
|
880 |
);
|
@@ -890,14 +989,18 @@
|
|
890 |
className: ''
|
891 |
};
|
892 |
|
893 |
-
return _.defaults( defaults, this.constructor.__super__.defaults );
|
894 |
},
|
895 |
|
896 |
required: function() {
|
897 |
return [];
|
898 |
},
|
899 |
|
900 |
-
isImmutable: true
|
|
|
|
|
|
|
|
|
901 |
}
|
902 |
);
|
903 |
|
@@ -911,14 +1014,18 @@
|
|
911 |
className: ''
|
912 |
};
|
913 |
|
914 |
-
return _.defaults( defaults, this.constructor.__super__.defaults );
|
915 |
},
|
916 |
|
917 |
required: function() {
|
918 |
return [];
|
919 |
},
|
920 |
|
921 |
-
isImmutable: true
|
|
|
|
|
|
|
|
|
922 |
}
|
923 |
);
|
924 |
|
@@ -945,6 +1052,8 @@
|
|
945 |
|
946 |
this.set( 'choices', new wp.ccf.collections.FieldChoices( choices ) );
|
947 |
}
|
|
|
|
|
948 |
}
|
949 |
}
|
950 |
);
|
@@ -1112,6 +1221,12 @@
|
|
1112 |
}
|
1113 |
);
|
1114 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1115 |
})( jQuery, Backbone, _, ccfSettings );
|
1116 |
|
1117 |
( function( $, Backbone, _, ccfSettings ) {
|
@@ -1128,7 +1243,6 @@
|
|
1128 |
events: {
|
1129 |
'click .add': 'triggerAdd',
|
1130 |
'click .delete': 'triggerDelete',
|
1131 |
-
'blur input': 'saveChoice',
|
1132 |
'saveChoice': 'saveChoice',
|
1133 |
'sorted': 'triggerUpdateSort'
|
1134 |
},
|
@@ -1206,6 +1320,135 @@
|
|
1206 |
}
|
1207 |
);
|
1208 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1209 |
wp.ccf.views.EmptyFormNotificationTableRow = wp.ccf.views.EmptyFormNotificationTableRow || Backbone.View.extend(
|
1210 |
{
|
1211 |
tagName: 'tr',
|
@@ -1728,6 +1971,18 @@
|
|
1728 |
'change input[type="checkbox"]': 'saveField'
|
1729 |
},
|
1730 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1731 |
checkSlug: function() {
|
1732 |
var slugSelection = this.el.querySelectorAll( '.field-slug');
|
1733 |
|
@@ -1764,11 +2019,46 @@
|
|
1764 |
this.unbind();
|
1765 |
},
|
1766 |
|
1767 |
-
|
1768 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1769 |
|
1770 |
this.checkSlug();
|
1771 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1772 |
return this;
|
1773 |
}
|
1774 |
}
|
@@ -1778,10 +2068,6 @@
|
|
1778 |
{
|
1779 |
template: wp.ccf.utils.template( 'ccf-single-line-text-template' ),
|
1780 |
|
1781 |
-
initialize: function() {
|
1782 |
-
|
1783 |
-
},
|
1784 |
-
|
1785 |
saveField: function() {
|
1786 |
// @todo: fix this ie8 hack
|
1787 |
if ( this.el.innerHTML === '' ) {
|
@@ -1796,6 +2082,8 @@
|
|
1796 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
1797 |
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
1798 |
|
|
|
|
|
1799 |
return this;
|
1800 |
}
|
1801 |
}
|
@@ -1805,10 +2093,6 @@
|
|
1805 |
{
|
1806 |
template: wp.ccf.utils.template( 'ccf-file-template' ),
|
1807 |
|
1808 |
-
initialize: function() {
|
1809 |
-
|
1810 |
-
},
|
1811 |
-
|
1812 |
saveField: function() {
|
1813 |
// @todo: fix this ie8 hack
|
1814 |
if ( this.el.innerHTML === '' ) {
|
@@ -1823,6 +2107,8 @@
|
|
1823 |
this.model.set( 'fileExtensions', this.el.querySelectorAll( '.field-file-extensions' )[0].value );
|
1824 |
this.model.set( 'maxFileSize', this.el.querySelectorAll( '.field-max-file-size' )[0].value );
|
1825 |
|
|
|
|
|
1826 |
return this;
|
1827 |
}
|
1828 |
}
|
@@ -1832,10 +2118,6 @@
|
|
1832 |
{
|
1833 |
template: wp.ccf.utils.template( 'ccf-recaptcha-template' ),
|
1834 |
|
1835 |
-
initialize: function() {
|
1836 |
-
|
1837 |
-
},
|
1838 |
-
|
1839 |
saveField: function() {
|
1840 |
// @todo: fix this ie8 hack
|
1841 |
if ( this.el.innerHTML === '' ) {
|
@@ -1848,6 +2130,8 @@
|
|
1848 |
this.model.set( 'secretKey', this.el.querySelectorAll( '.field-secret-key' )[0].value );
|
1849 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
1850 |
|
|
|
|
|
1851 |
return this;
|
1852 |
}
|
1853 |
}
|
@@ -1857,10 +2141,6 @@
|
|
1857 |
{
|
1858 |
template: wp.ccf.utils.template( 'ccf-section-header-template' ),
|
1859 |
|
1860 |
-
initialize: function() {
|
1861 |
-
|
1862 |
-
},
|
1863 |
-
|
1864 |
saveField: function() {
|
1865 |
// @todo: fix this ie8 hack
|
1866 |
if ( this.el.innerHTML === '' ) {
|
@@ -1871,6 +2151,8 @@
|
|
1871 |
this.model.set( 'subheading', this.el.querySelectorAll( '.field-subheading' )[0].value );
|
1872 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
1873 |
|
|
|
|
|
1874 |
return this;
|
1875 |
}
|
1876 |
}
|
@@ -1880,10 +2162,6 @@
|
|
1880 |
{
|
1881 |
template: wp.ccf.utils.template( 'ccf-html-template' ),
|
1882 |
|
1883 |
-
initialize: function() {
|
1884 |
-
|
1885 |
-
},
|
1886 |
-
|
1887 |
saveField: function() {
|
1888 |
// @todo: fix this ie8 hack
|
1889 |
if ( this.el.innerHTML === '' ) {
|
@@ -1893,6 +2171,8 @@
|
|
1893 |
this.model.set( 'html', this.el.querySelectorAll( '.field-html' )[0].value );
|
1894 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
1895 |
|
|
|
|
|
1896 |
return this;
|
1897 |
}
|
1898 |
}
|
@@ -1916,6 +2196,8 @@
|
|
1916 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
1917 |
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
1918 |
|
|
|
|
|
1919 |
return this;
|
1920 |
}
|
1921 |
}
|
@@ -1935,6 +2217,8 @@
|
|
1935 |
this.model.set( 'value', this.el.querySelectorAll( '.field-value' )[0].value );
|
1936 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
1937 |
|
|
|
|
|
1938 |
return this;
|
1939 |
}
|
1940 |
}
|
@@ -1954,6 +2238,8 @@
|
|
1954 |
this.model.set( 'label', this.el.querySelectorAll( '.field-label' )[0].value );
|
1955 |
this.model.set( 'description', this.el.querySelectorAll( '.field-description' )[0].value );
|
1956 |
|
|
|
|
|
1957 |
var value = this.el.querySelectorAll( '.field-value' );
|
1958 |
if ( value.length > 0 ) {
|
1959 |
this.model.set( 'value', value[0].value );
|
@@ -2000,6 +2286,8 @@
|
|
2000 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
2001 |
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
2002 |
|
|
|
|
|
2003 |
return this;
|
2004 |
}
|
2005 |
}
|
@@ -2023,6 +2311,8 @@
|
|
2023 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
2024 |
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
2025 |
|
|
|
|
|
2026 |
return this;
|
2027 |
}
|
2028 |
}
|
@@ -2047,6 +2337,8 @@
|
|
2047 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
2048 |
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
2049 |
|
|
|
|
|
2050 |
return this;
|
2051 |
}
|
2052 |
}
|
@@ -2069,6 +2361,8 @@
|
|
2069 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
2070 |
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
2071 |
|
|
|
|
|
2072 |
return this;
|
2073 |
}
|
2074 |
}
|
@@ -2088,6 +2382,8 @@
|
|
2088 |
this.model.set( 'label', this.el.querySelectorAll( '.field-label' )[0].value );
|
2089 |
this.model.set( 'description', this.el.querySelectorAll( '.field-description' )[0].value );
|
2090 |
|
|
|
|
|
2091 |
var value = this.el.querySelectorAll( '.field-value' );
|
2092 |
if ( value.length ) {
|
2093 |
this.model.set( 'value', value[0].value );
|
@@ -2143,6 +2439,7 @@
|
|
2143 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
2144 |
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
2145 |
|
|
|
2146 |
|
2147 |
var choices = this.el.querySelectorAll( '.repeatable-choices' )[0].querySelectorAll( '.choice' );
|
2148 |
|
@@ -2154,10 +2451,12 @@
|
|
2154 |
|
2155 |
},
|
2156 |
|
2157 |
-
render: function() {
|
2158 |
var SELF = this;
|
2159 |
|
2160 |
-
|
|
|
|
|
2161 |
|
2162 |
SELF.checkSlug();
|
2163 |
|
@@ -2186,6 +2485,21 @@
|
|
2186 |
}
|
2187 |
});
|
2188 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2189 |
return SELF;
|
2190 |
}
|
2191 |
}
|
@@ -2859,7 +3173,6 @@
|
|
2859 |
|
2860 |
signup: function( event ) {
|
2861 |
var email = this.el.querySelectorAll( '.email-signup-field' )[0].value;
|
2862 |
-
var interest = this.el.querySelectorAll( '.interest-signup-field' )[0].value;
|
2863 |
var signupContainer = this.el.querySelectorAll( '.bottom .left.signup' )[0];
|
2864 |
signupContainer.className = 'left signup';
|
2865 |
|
@@ -2869,8 +3182,7 @@
|
|
2869 |
method: 'post',
|
2870 |
dataType: 'jsonp',
|
2871 |
data: {
|
2872 |
-
EMAIL: email
|
2873 |
-
INTEREST: interest
|
2874 |
}
|
2875 |
}).done(function() {
|
2876 |
signupContainer.className = 'left signup signup-success';
|
322 |
return this;
|
323 |
};
|
324 |
|
325 |
+
wp.ccf.models.FieldConditional = wp.ccf.models.FieldConditional || Backbone.Model.extend(
|
326 |
+
{
|
327 |
+
defaults: {
|
328 |
+
field: '',
|
329 |
+
compare: 'is',
|
330 |
+
value: ''
|
331 |
+
},
|
332 |
+
|
333 |
+
decode: function() {
|
334 |
+
return _modelDecode.call( this, [] );
|
335 |
+
},
|
336 |
+
|
337 |
+
set: _modelSet
|
338 |
+
}
|
339 |
+
);
|
340 |
+
|
341 |
wp.ccf.models.FieldChoice = wp.ccf.models.FieldChoice || Backbone.Model.extend(
|
342 |
{
|
343 |
defaults: {
|
535 |
delete response.fields[i].choices;
|
536 |
}
|
537 |
|
538 |
+
if ( typeof newField.conditionals !== 'undefined' ) {
|
539 |
+
var conditionals = SELF.get( 'conditionals' );
|
540 |
+
|
541 |
+
if ( conditionals && conditionals.length > 0 ) {
|
542 |
+
for ( z = 0; z < newField.conditionals; z++ ) {
|
543 |
+
var conditional = conditionals.at( z );
|
544 |
+
conditional.set( newField.conditionals[z] );
|
545 |
+
conditional.decode();
|
546 |
+
}
|
547 |
+
}
|
548 |
+
|
549 |
+
delete response.fields[i].conditionals;
|
550 |
+
}
|
551 |
+
|
552 |
field.set( newField );
|
553 |
field.decode();
|
554 |
}
|
708 |
{
|
709 |
idAttribute: 'id',
|
710 |
|
711 |
+
defaults: function() {
|
712 |
+
return {
|
713 |
+
id: null,
|
714 |
+
conditionalsEnabled: false,
|
715 |
+
conditionalType: 'show',
|
716 |
+
conditionalFieldsRequired: 'all',
|
717 |
+
conditionals: new wp.ccf.collections.FieldConditionals()
|
718 |
+
};
|
719 |
},
|
720 |
|
721 |
set: _modelSet,
|
722 |
|
723 |
+
initialize: function( attributes ) {
|
724 |
+
if ( typeof attributes === 'object' && attributes.conditionals ) {
|
725 |
+
var conditionals = [];
|
726 |
+
|
727 |
+
_.each( attributes.conditionals, function( conditional ) {
|
728 |
+
var conditionalModel = new wp.ccf.models.FieldConditional( conditional );
|
729 |
+
conditionalModel.decode();
|
730 |
+
|
731 |
+
conditionals.push( conditionalModel );
|
732 |
+
});
|
733 |
+
|
734 |
+
this.set( 'conditionals', new wp.ccf.collections.FieldConditionals( conditionals ) );
|
735 |
+
}
|
736 |
+
},
|
737 |
+
|
738 |
required: function() {
|
739 |
return [ 'slug' ];
|
740 |
},
|
776 |
description: ''
|
777 |
};
|
778 |
|
779 |
+
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
780 |
+
},
|
781 |
+
|
782 |
+
initialize: function() {
|
783 |
+
return wp.ccf.models.StandardField.__super__.initialize.apply( this, arguments );
|
784 |
}
|
785 |
}
|
786 |
);
|
793 |
};
|
794 |
|
795 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
796 |
+
},
|
797 |
+
|
798 |
+
initialize: function() {
|
799 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
800 |
}
|
801 |
}
|
802 |
);
|
811 |
};
|
812 |
|
813 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
814 |
+
},
|
815 |
+
|
816 |
+
initialize: function() {
|
817 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
818 |
}
|
819 |
}
|
820 |
);
|
827 |
};
|
828 |
|
829 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
830 |
+
},
|
831 |
+
|
832 |
+
initialize: function() {
|
833 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
834 |
}
|
835 |
}
|
836 |
);
|
843 |
};
|
844 |
|
845 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
846 |
+
},
|
847 |
+
|
848 |
+
initialize: function() {
|
849 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
850 |
}
|
851 |
}
|
852 |
);
|
860 |
};
|
861 |
|
862 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
863 |
+
},
|
864 |
+
|
865 |
+
initialize: function() {
|
866 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
867 |
}
|
868 |
}
|
869 |
);
|
877 |
};
|
878 |
|
879 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
880 |
+
},
|
881 |
+
|
882 |
+
initialize: function() {
|
883 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
884 |
}
|
885 |
}
|
886 |
);
|
894 |
};
|
895 |
|
896 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
897 |
+
},
|
898 |
+
|
899 |
+
initialize: function() {
|
900 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
901 |
}
|
902 |
}
|
903 |
);
|
913 |
};
|
914 |
|
915 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
916 |
+
},
|
917 |
+
|
918 |
+
initialize: function() {
|
919 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
920 |
}
|
921 |
}
|
922 |
);
|
929 |
};
|
930 |
|
931 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
932 |
+
},
|
933 |
+
|
934 |
+
initialize: function() {
|
935 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
936 |
}
|
937 |
}
|
938 |
);
|
953 |
return [ 'siteKey', 'secretKey' ];
|
954 |
},
|
955 |
|
956 |
+
isImmutable: true,
|
957 |
+
|
958 |
+
initialize: function() {
|
959 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
960 |
+
}
|
961 |
}
|
962 |
);
|
963 |
|
970 |
};
|
971 |
|
972 |
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
973 |
+
},
|
974 |
+
|
975 |
+
initialize: function() {
|
976 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
977 |
}
|
978 |
}
|
979 |
);
|
989 |
className: ''
|
990 |
};
|
991 |
|
992 |
+
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
993 |
},
|
994 |
|
995 |
required: function() {
|
996 |
return [];
|
997 |
},
|
998 |
|
999 |
+
isImmutable: true,
|
1000 |
+
|
1001 |
+
initialize: function() {
|
1002 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
1003 |
+
}
|
1004 |
}
|
1005 |
);
|
1006 |
|
1014 |
className: ''
|
1015 |
};
|
1016 |
|
1017 |
+
return _.defaults( defaults, this.constructor.__super__.defaults() );
|
1018 |
},
|
1019 |
|
1020 |
required: function() {
|
1021 |
return [];
|
1022 |
},
|
1023 |
|
1024 |
+
isImmutable: true,
|
1025 |
+
|
1026 |
+
initialize: function() {
|
1027 |
+
return this.constructor.__super__.initialize.apply( this, arguments );
|
1028 |
+
}
|
1029 |
}
|
1030 |
);
|
1031 |
|
1052 |
|
1053 |
this.set( 'choices', new wp.ccf.collections.FieldChoices( choices ) );
|
1054 |
}
|
1055 |
+
|
1056 |
+
return wp.ccf.models.ChoiceableField.__super__.initialize.apply( this, arguments );
|
1057 |
}
|
1058 |
}
|
1059 |
);
|
1221 |
}
|
1222 |
);
|
1223 |
|
1224 |
+
wp.ccf.collections.FieldConditionals = wp.ccf.collections.FieldConditionals || Backbone.Collection.extend(
|
1225 |
+
{
|
1226 |
+
model: wp.ccf.models.FieldConditional
|
1227 |
+
}
|
1228 |
+
);
|
1229 |
+
|
1230 |
})( jQuery, Backbone, _, ccfSettings );
|
1231 |
|
1232 |
( function( $, Backbone, _, ccfSettings ) {
|
1243 |
events: {
|
1244 |
'click .add': 'triggerAdd',
|
1245 |
'click .delete': 'triggerDelete',
|
|
|
1246 |
'saveChoice': 'saveChoice',
|
1247 |
'sorted': 'triggerUpdateSort'
|
1248 |
},
|
1320 |
}
|
1321 |
);
|
1322 |
|
1323 |
+
wp.ccf.views.FieldConditional = Backbone.View.extend(
|
1324 |
+
{
|
1325 |
+
template: wp.ccf.utils.template( 'ccf-field-conditional-template' ),
|
1326 |
+
className: 'conditional',
|
1327 |
+
|
1328 |
+
events: {
|
1329 |
+
'click .add': 'triggerAdd',
|
1330 |
+
'click .delete': 'triggerDelete',
|
1331 |
+
'saveConditional': 'saveConditional'
|
1332 |
+
},
|
1333 |
+
|
1334 |
+
initialize: function( options ) {
|
1335 |
+
this.field = options.field;
|
1336 |
+
this.fieldCollection = options.fieldCollection;
|
1337 |
+
},
|
1338 |
+
|
1339 |
+
destroy: function() {
|
1340 |
+
wp.ccf.dispatcher.off( 'mainViewChange', this.saveConditional );
|
1341 |
+
this.unbind();
|
1342 |
+
},
|
1343 |
+
|
1344 |
+
saveConditional: function() {
|
1345 |
+
// @todo: fix this ie8 hack
|
1346 |
+
if ( this.el.innerHTML === '' ) {
|
1347 |
+
return;
|
1348 |
+
}
|
1349 |
+
|
1350 |
+
var field = this.el.querySelectorAll( '.conditional-field' )[0].value;
|
1351 |
+
var value = this.el.querySelectorAll( '.conditional-value' )[0].value;
|
1352 |
+
var compare = this.el.querySelectorAll( '.conditional-compare' )[0].value;
|
1353 |
+
|
1354 |
+
this.model.set( 'field', field );
|
1355 |
+
this.model.set( 'value', value );
|
1356 |
+
this.model.set( 'compare', compare );
|
1357 |
+
|
1358 |
+
return this;
|
1359 |
+
|
1360 |
+
},
|
1361 |
+
|
1362 |
+
updateFields: function() {
|
1363 |
+
var conditionalFields = this.el.querySelectorAll( '.conditional-field' )[0];
|
1364 |
+
conditionalFields.innerHTML = '';
|
1365 |
+
conditionalFields.disabled = false;
|
1366 |
+
|
1367 |
+
var fieldsAdded = 0;
|
1368 |
+
|
1369 |
+
var conditionalField = this.model.get( 'field' ),
|
1370 |
+
option;
|
1371 |
+
|
1372 |
+
if ( this.fieldCollection.length >= 1 ) {
|
1373 |
+
option = document.createElement( 'option' );
|
1374 |
+
option.innerHTML = ccfSettings.chooseFormField;
|
1375 |
+
option.value = '';
|
1376 |
+
|
1377 |
+
conditionalFields.appendChild( option );
|
1378 |
+
|
1379 |
+
this.fieldCollection.each( function( field ) {
|
1380 |
+
if ( this.field.get( 'slug' ) !== field.get( 'slug' ) ) {
|
1381 |
+
var type = field.get( 'type' );
|
1382 |
+
|
1383 |
+
if ( 'address' !== type && 'date' !== type && 'name' !== type && 'file' !== type && 'recaptcha' !== type && 'section-header' !== type && 'html' !== type ) {
|
1384 |
+
option = document.createElement( 'option' );
|
1385 |
+
option.innerHTML = field.get( 'slug' );
|
1386 |
+
option.value = field.get( 'slug' );
|
1387 |
+
|
1388 |
+
if ( field.get( 'slug' ) === conditionalField ) {
|
1389 |
+
option.selected = true;
|
1390 |
+
}
|
1391 |
+
|
1392 |
+
conditionalFields.appendChild( option );
|
1393 |
+
|
1394 |
+
fieldsAdded++;
|
1395 |
+
}
|
1396 |
+
}
|
1397 |
+
}, this );
|
1398 |
+
}
|
1399 |
+
|
1400 |
+
if ( 0 === fieldsAdded ) {
|
1401 |
+
conditionalFields.innerHTML = '';
|
1402 |
+
option = document.createElement( 'option' );
|
1403 |
+
option.innerHTML = ccfSettings.noAvailableFields;
|
1404 |
+
option.value = '';
|
1405 |
+
conditionalFields.appendChild( option );
|
1406 |
+
conditionalFields.disabled = true;
|
1407 |
+
}
|
1408 |
+
},
|
1409 |
+
|
1410 |
+
render: function() {
|
1411 |
+
var context = {};
|
1412 |
+
if ( this.model ) {
|
1413 |
+
context.conditional = this.model.toJSON();
|
1414 |
+
}
|
1415 |
+
|
1416 |
+
this.el.innerHTML = this.template( context );
|
1417 |
+
|
1418 |
+
wp.ccf.dispatcher.on( 'mainViewChange', this.saveConditional, this );
|
1419 |
+
|
1420 |
+
this.listenTo( this.fieldCollection, 'add', this.updateFields, this );
|
1421 |
+
this.listenTo( this.fieldCollection, 'remove', this.updateFields, this );
|
1422 |
+
|
1423 |
+
this.updateFields();
|
1424 |
+
|
1425 |
+
return this;
|
1426 |
+
},
|
1427 |
+
|
1428 |
+
triggerAdd: function() {
|
1429 |
+
this.field.get( 'conditionals' ).add( new wp.ccf.models.FieldConditional() );
|
1430 |
+
},
|
1431 |
+
|
1432 |
+
triggerDelete: function() {
|
1433 |
+
var conditionals = this.field.get( 'conditionals' );
|
1434 |
+
if ( conditionals.length > 1 ) {
|
1435 |
+
conditionals.remove( this.model );
|
1436 |
+
this.destroy();
|
1437 |
+
this.remove();
|
1438 |
+
} else {
|
1439 |
+
var value = this.el.querySelectorAll( '.conditional-value' )[0];
|
1440 |
+
var field = this.el.querySelectorAll( '.conditional-field' )[0];
|
1441 |
+
|
1442 |
+
value.value = '';
|
1443 |
+
|
1444 |
+
for ( var i = 0; i < field.childNodes.length; i++ ) {
|
1445 |
+
field.childNodes[i].selected = false;
|
1446 |
+
}
|
1447 |
+
}
|
1448 |
+
}
|
1449 |
+
}
|
1450 |
+
);
|
1451 |
+
|
1452 |
wp.ccf.views.EmptyFormNotificationTableRow = wp.ccf.views.EmptyFormNotificationTableRow || Backbone.View.extend(
|
1453 |
{
|
1454 |
tagName: 'tr',
|
1971 |
'change input[type="checkbox"]': 'saveField'
|
1972 |
},
|
1973 |
|
1974 |
+
initialize: function() {
|
1975 |
+
var conditionals = this.model.get( 'conditionals' );
|
1976 |
+
this.listenTo( conditionals, 'add', this.addConditional );
|
1977 |
+
},
|
1978 |
+
|
1979 |
+
addConditional: function( model ) {
|
1980 |
+
var view = new wp.ccf.views.FieldConditional( { model: model, field: this.model, fieldCollection: this.collection } ).render();
|
1981 |
+
var conditionals = this.el.querySelectorAll( '.conditionals' )[0];
|
1982 |
+
|
1983 |
+
conditionals.appendChild( view.el );
|
1984 |
+
},
|
1985 |
+
|
1986 |
checkSlug: function() {
|
1987 |
var slugSelection = this.el.querySelectorAll( '.field-slug');
|
1988 |
|
2019 |
this.unbind();
|
2020 |
},
|
2021 |
|
2022 |
+
saveField: function() {
|
2023 |
+
var conditionals = this.el.querySelectorAll( '.conditionals' )[0].querySelectorAll( '.conditional' );
|
2024 |
+
|
2025 |
+
_.each( conditionals, function( conditional ) {
|
2026 |
+
$( conditional ).trigger( 'saveConditional' );
|
2027 |
+
});
|
2028 |
+
|
2029 |
+
this.model.set( 'conditionalType', this.el.querySelectorAll( '.field-conditional-type' )[0].value );
|
2030 |
+
this.model.set( 'conditionalFieldsRequired', this.el.querySelectorAll( '.field-conditional-fields-required' )[0].value );
|
2031 |
+
|
2032 |
+
var oldConditionals = this.model.get( 'conditionalsEnabled' );
|
2033 |
+
this.model.set( 'conditionalsEnabled', ( this.el.querySelectorAll( '.field-conditionals-enabled' )[0].value == 1 ) ? true : false );
|
2034 |
+
|
2035 |
+
if ( oldConditionals !== this.model.get( 'conditionalsEnabled' ) ) {
|
2036 |
+
this.render( 'advanced' );
|
2037 |
+
}
|
2038 |
+
},
|
2039 |
+
|
2040 |
+
render: function( startPanel ) {
|
2041 |
+
startPanel = ( startPanel ) ? startPanel : 'basic';
|
2042 |
+
|
2043 |
+
this.el.innerHTML = this.template( { field: this.model.toJSON(), startPanel: startPanel } );
|
2044 |
|
2045 |
this.checkSlug();
|
2046 |
|
2047 |
+
var conditionalsCollection = this.model.get( 'conditionals' );
|
2048 |
+
|
2049 |
+
var conditionals = this.el.querySelectorAll( '.conditionals' )[0];
|
2050 |
+
|
2051 |
+
if ( conditionalsCollection.length >= 1 ) {
|
2052 |
+
|
2053 |
+
conditionalsCollection.each( function( model ) {
|
2054 |
+
var view = new wp.ccf.views.FieldConditional( { model: model, field: this.model, fieldCollection: this.collection } ).render();
|
2055 |
+
conditionals.appendChild( view.el );
|
2056 |
+
}, this );
|
2057 |
+
} else {
|
2058 |
+
var conditional = new wp.ccf.models.FieldConditional();
|
2059 |
+
conditionalsCollection.add( conditional );
|
2060 |
+
}
|
2061 |
+
|
2062 |
return this;
|
2063 |
}
|
2064 |
}
|
2068 |
{
|
2069 |
template: wp.ccf.utils.template( 'ccf-single-line-text-template' ),
|
2070 |
|
|
|
|
|
|
|
|
|
2071 |
saveField: function() {
|
2072 |
// @todo: fix this ie8 hack
|
2073 |
if ( this.el.innerHTML === '' ) {
|
2082 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
2083 |
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
2084 |
|
2085 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
2086 |
+
|
2087 |
return this;
|
2088 |
}
|
2089 |
}
|
2093 |
{
|
2094 |
template: wp.ccf.utils.template( 'ccf-file-template' ),
|
2095 |
|
|
|
|
|
|
|
|
|
2096 |
saveField: function() {
|
2097 |
// @todo: fix this ie8 hack
|
2098 |
if ( this.el.innerHTML === '' ) {
|
2107 |
this.model.set( 'fileExtensions', this.el.querySelectorAll( '.field-file-extensions' )[0].value );
|
2108 |
this.model.set( 'maxFileSize', this.el.querySelectorAll( '.field-max-file-size' )[0].value );
|
2109 |
|
2110 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
2111 |
+
|
2112 |
return this;
|
2113 |
}
|
2114 |
}
|
2118 |
{
|
2119 |
template: wp.ccf.utils.template( 'ccf-recaptcha-template' ),
|
2120 |
|
|
|
|
|
|
|
|
|
2121 |
saveField: function() {
|
2122 |
// @todo: fix this ie8 hack
|
2123 |
if ( this.el.innerHTML === '' ) {
|
2130 |
this.model.set( 'secretKey', this.el.querySelectorAll( '.field-secret-key' )[0].value );
|
2131 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
2132 |
|
2133 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
2134 |
+
|
2135 |
return this;
|
2136 |
}
|
2137 |
}
|
2141 |
{
|
2142 |
template: wp.ccf.utils.template( 'ccf-section-header-template' ),
|
2143 |
|
|
|
|
|
|
|
|
|
2144 |
saveField: function() {
|
2145 |
// @todo: fix this ie8 hack
|
2146 |
if ( this.el.innerHTML === '' ) {
|
2151 |
this.model.set( 'subheading', this.el.querySelectorAll( '.field-subheading' )[0].value );
|
2152 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
2153 |
|
2154 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
2155 |
+
|
2156 |
return this;
|
2157 |
}
|
2158 |
}
|
2162 |
{
|
2163 |
template: wp.ccf.utils.template( 'ccf-html-template' ),
|
2164 |
|
|
|
|
|
|
|
|
|
2165 |
saveField: function() {
|
2166 |
// @todo: fix this ie8 hack
|
2167 |
if ( this.el.innerHTML === '' ) {
|
2171 |
this.model.set( 'html', this.el.querySelectorAll( '.field-html' )[0].value );
|
2172 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
2173 |
|
2174 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
2175 |
+
|
2176 |
return this;
|
2177 |
}
|
2178 |
}
|
2196 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
2197 |
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
2198 |
|
2199 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
2200 |
+
|
2201 |
return this;
|
2202 |
}
|
2203 |
}
|
2217 |
this.model.set( 'value', this.el.querySelectorAll( '.field-value' )[0].value );
|
2218 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
2219 |
|
2220 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
2221 |
+
|
2222 |
return this;
|
2223 |
}
|
2224 |
}
|
2238 |
this.model.set( 'label', this.el.querySelectorAll( '.field-label' )[0].value );
|
2239 |
this.model.set( 'description', this.el.querySelectorAll( '.field-description' )[0].value );
|
2240 |
|
2241 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
2242 |
+
|
2243 |
var value = this.el.querySelectorAll( '.field-value' );
|
2244 |
if ( value.length > 0 ) {
|
2245 |
this.model.set( 'value', value[0].value );
|
2286 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
2287 |
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
2288 |
|
2289 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
2290 |
+
|
2291 |
return this;
|
2292 |
}
|
2293 |
}
|
2311 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
2312 |
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
2313 |
|
2314 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
2315 |
+
|
2316 |
return this;
|
2317 |
}
|
2318 |
}
|
2337 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
2338 |
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
2339 |
|
2340 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
2341 |
+
|
2342 |
return this;
|
2343 |
}
|
2344 |
}
|
2361 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
2362 |
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
2363 |
|
2364 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
2365 |
+
|
2366 |
return this;
|
2367 |
}
|
2368 |
}
|
2382 |
this.model.set( 'label', this.el.querySelectorAll( '.field-label' )[0].value );
|
2383 |
this.model.set( 'description', this.el.querySelectorAll( '.field-description' )[0].value );
|
2384 |
|
2385 |
+
this.constructor.__super__.saveField.apply( this, arguments );
|
2386 |
+
|
2387 |
var value = this.el.querySelectorAll( '.field-value' );
|
2388 |
if ( value.length ) {
|
2389 |
this.model.set( 'value', value[0].value );
|
2439 |
this.model.set( 'className', this.el.querySelectorAll( '.field-class-name' )[0].value );
|
2440 |
this.model.set( 'required', ( this.el.querySelectorAll( '.field-required' )[0].value == 1 ) ? true : false );
|
2441 |
|
2442 |
+
wp.ccf.views.ChoiceableField.__super__.saveField.apply( this, arguments );
|
2443 |
|
2444 |
var choices = this.el.querySelectorAll( '.repeatable-choices' )[0].querySelectorAll( '.choice' );
|
2445 |
|
2451 |
|
2452 |
},
|
2453 |
|
2454 |
+
render: function( startPanel ) {
|
2455 |
var SELF = this;
|
2456 |
|
2457 |
+
startPanel = ( startPanel ) ? startPanel : 'basic';
|
2458 |
+
|
2459 |
+
SELF.el.innerHTML = SELF.template( { field: SELF.model.toJSON(), startPanel: startPanel } );
|
2460 |
|
2461 |
SELF.checkSlug();
|
2462 |
|
2485 |
}
|
2486 |
});
|
2487 |
|
2488 |
+
var conditionalsCollection = this.model.get( 'conditionals' );
|
2489 |
+
|
2490 |
+
var conditionals = this.el.querySelectorAll( '.conditionals' )[0];
|
2491 |
+
|
2492 |
+
if ( conditionalsCollection.length >= 1 ) {
|
2493 |
+
|
2494 |
+
conditionalsCollection.each( function( model ) {
|
2495 |
+
var view = new wp.ccf.views.FieldConditional( { model: model, field: this.model, fieldCollection: this.collection } ).render();
|
2496 |
+
conditionals.appendChild( view.el );
|
2497 |
+
}, this );
|
2498 |
+
} else {
|
2499 |
+
var conditional = new wp.ccf.models.FieldConditional();
|
2500 |
+
conditionalsCollection.add( conditional );
|
2501 |
+
}
|
2502 |
+
|
2503 |
return SELF;
|
2504 |
}
|
2505 |
}
|
3173 |
|
3174 |
signup: function( event ) {
|
3175 |
var email = this.el.querySelectorAll( '.email-signup-field' )[0].value;
|
|
|
3176 |
var signupContainer = this.el.querySelectorAll( '.bottom .left.signup' )[0];
|
3177 |
signupContainer.className = 'left signup';
|
3178 |
|
3182 |
method: 'post',
|
3183 |
dataType: 'jsonp',
|
3184 |
data: {
|
3185 |
+
EMAIL: email
|
|
|
3186 |
}
|
3187 |
}).done(function() {
|
3188 |
signupContainer.className = 'left signup signup-success';
|
build/js/form-manager.min.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
(function(e,t,i,l){"use strict";window.wp=window.wp||{},wp.ccf=wp.ccf||{},wp.ccf.utils=wp.ccf.utils||{},wp.ccf.utils.cleanDateFields=function(e){delete e.date,delete e.date_gmt,delete e.modified,delete e.modified_gmt,delete e.date_tz,delete e.modified_tz},wp.ccf.utils.template=i.memoize(function(e){var t={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g};return i.template(document.getElementById(e).innerHTML,null,t)}),wp.ccf.utils.insertFormShortcode=function(e){var t=wp.ccf.forms.findWhere({id:e.get("id")});t||wp.ccf.forms.add(e);var i=tinymce.get(wpActiveEditor),l='[ccf_form id="'+e.get("id")+'"]';i&&!i.isHidden()?tinymce.activeEditor.execCommand("mceInsertContent",!1,l):document.getElementById(wpActiveEditor).value+=l},wp.ccf.utils.getPrettyPostDate=function(e){return e=moment.utc(e),l.gmtOffset&&(e=e.utcOffset(60*parseInt(l.gmtOffset))),e.format("h:mm a M/D/YYYY")},wp.ccf.utils.wordChop=function(e,t){var i=e.substr(0,t);return i.substr(0,Math.min(i.length,i.lastIndexOf(" "))),i.length<e.length&&(i+="..."),i},wp.ccf.utils.isFieldDate=function(e){return e.date!==void 0||e.hour!==void 0&&e.minute!==void 0&&e["am-pm"]!==void 0?!0:!1},wp.ccf.utils.isFieldName=function(e){return e.name!==void 0||e.last!==void 0?!0:!1},wp.ccf.utils.isFieldEmailConfirm=function(e){return e.email!==void 0||e.confirm!==void 0?!0:!1},wp.ccf.utils.isFieldAddress=function(e){return e.street!==void 0&&e.city!==void 0&&e.zipcode!==void 0&&e.line_two!==void 0?!0:!1},wp.ccf.utils.isFieldFile=function(e){return e.id!==void 0&&e.url!==void 0&&e.file_name!==void 0?!0:!1},wp.ccf.utils.getPrettyFieldEmailConfirm=function(e){return e.email?e.email:e.confirm?e.confirm:"-"},wp.ccf.utils.getPrettyFieldDate=function(e,t){var i="",s="",o="HH:mm MM/DD/YY";if(t&&t.ccf_field_dateFormat&&"dd/mm/yyyy"===t.ccf_field_dateFormat&&(o="HH:mm DD/MM/YY"),e.hour&&e.minute&&e["am-pm"]&&(i+=e.hour+":"+e.minute+" "+e["am-pm"]),e.date&&(i+=" "+e.date),!i)return"-";var c=moment(i,o);return c.isValid()?(e.hour&&e.minute&&e["am-pm"]&&(s+=c.format("h:mm a")),e.date&&(s&&(s+=" "),s+=e.date),s):l.invalidDate},wp.ccf.utils.getPrettyFieldName=function(e){var t=e.first;return t.length>0&&(t+=" "),e.last&&(t+=e.last),t||(t="-"),t},wp.ccf.utils.getPrettyFieldAddress=function(e){if(!e.street||!e.city)return"-";var t=e.street;return e.line_two&&(t+=" "+e.line_two),t+=", "+e.city,e.state&&(t+=", "+e.state),e.zipcode&&(t+=" "+e.zipcode),e.country&&(t+=" "+e.country),t}})(jQuery,Backbone,_,ccfSettings),function(e,t,i){"use strict";wp.ccf.mixins=wp.ccf.mixins||{},wp.ccf.mixins.subViewable=wp.ccf.mixins.subViewable||{subViews:{},initRenderSubViews:function(e,t,l){this.renderedSubViews||(this.renderedSubViews={});for(var s in this.subViews){var o={el:this.$el.find(".ccf-"+s),parent:this};l&&i.extend(o,l),this.renderedSubViews[s]&&this.renderedSubViews[s].destroy&&this.renderedSubViews[s].destroy(),(t||!this.renderedSubViews[s])&&(this.renderedSubViews[s]=new this.subViews[s](o)),this.renderedSubViews[s].render(),e&&(this.renderedSubViews[s].el.style.display="block")}return this},showView:function(e,t,i){if(this.renderedSubViews!==void 0&&this.renderedSubViews[e]!==void 0){var l=this.renderedSubViews[e];i||l.render(t),l.el.style.display="block",this.currentView=e;for(var s in this.subViews)s!==e&&(this.renderedSubViews[s].el.style.display="none")}}}}(jQuery,Backbone,_,ccfSettings),function(e,t,i,l){"use strict";wp.ccf.models=wp.ccf.models||{},wp.ccf.models.Fields=wp.ccf.models.Fields||{};var s=function(e,i,l){return"object"!=typeof i&&""===i&&(i=""),t.Model.prototype.set.call(this,e,i,l)},o=function(e,t,i){return i=i||{},i.emulateHTTP=!0,this.constructor.__super__.sync.call(this,e,t,i)},c=function(e){for(var t in this.attributes)if(-1===i.indexOf(e,t)){var l=this.get(t);"string"==typeof l&&""!==l&&(l=(l+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/“/g,"”").replace(/”/g,"”").replace(/‘/g,"‘").replace(/&/g,"&").replace(/'/g,"'"),this.set(t,l))}return this};wp.ccf.models.FieldChoice=wp.ccf.models.FieldChoice||t.Model.extend({defaults:{label:"",value:"",selected:!1},decode:function(){return c.call(this,[])},set:s}),wp.ccf.models.PostFieldMapping=wp.ccf.models.PostFieldMapping||t.Model.extend({defaults:{formField:"",postField:"",customFieldKey:""},decode:function(){return c.call(this,[])},set:s}),wp.ccf.models.FormNotificationAddress=wp.ccf.models.FormNotificationAddress||t.Model.extend({defaults:{type:"custom",field:"",email:""},decode:function(){return c.call(this,[])},set:s}),wp.ccf.models.FormNotification=wp.ccf.models.FormNotification||t.Model.extend({defaults:function(){return{title:"",content:"[all_fields]",active:!1,addresses:new wp.ccf.collections.FormNotificationAddresses,fromType:"default",fromAddress:"",fromField:"",subjectType:"default",subject:"",subjectField:"",fromNameType:"custom",fromName:"WordPress",fromNameField:""}},initialize:function(e){if("object"==typeof e&&e.addresses){var t=[];i.each(e.addresses,function(e){var i=new wp.ccf.models.FormNotificationAddress(e);i.decode(),t.push(i)}),this.set("addresses",new wp.ccf.collections.FormNotificationAddresses(t))}},decode:function(){return c.call(this,[])},toJSON:function(){var e=this.constructor.__super__.toJSON.call(this);return e.addresses&&(e.addresses=e.addresses.toJSON()),e},set:s}),wp.ccf.models.Form=wp.ccf.models.Form||wp.api.models.Post.extend({urlRoot:l.apiRoot.replace(/\/$/,"")+"/ccf/v1/forms",set:s,sync:o,idAttribute:"id",initialize:function(){this.on("sync",this.decode,this)},defaults:function(){var e={fields:new wp.ccf.collections.Fields,type:"ccf_form",status:"publish",description:"",buttonText:"Submit Form",completionActionType:"text",completionRedirectUrl:"",completionMessage:"",postCreation:!1,postCreationType:"post",postCreationStatus:"draft",postFieldMappings:new wp.ccf.collections.PostFieldMappings,notifications:new wp.ccf.collections.FormNotifications,pause:!1,pauseMessage:l.pauseMessage,theme:"none"};return e=i.defaults(e,this.constructor.__super__.defaults),wp.ccf.utils.cleanDateFields(e),e},decode:function(){var e=i.keys(wp.api.models.Post.prototype.defaults);return e=i.without(e,"title"),c.call(this,e)},getFieldSlugs:function(e){var t=wp.ccf.currentForm.get("fields"),i=[];return t.each(function(t){e&&t.isImmutable||i.push(t.get("slug"))}),i},parse:function(e){var t=this,l=0,s=0;if(e.fields){var o=t.get("fields");if(o&&o.length>0){for(l=0;e.fields.length>l;l++){var c=e.fields[l],n=o.findWhere({slug:c.slug});if(n){if(c.choices!==void 0){var r=t.get("choices");if(r&&r.length>0)for(s=0;c.choices>s;s++){var a=r.at(s);a.set(c.choices[s]),a.decode()}delete e.fields[l].choices}n.set(c),n.decode()}}delete e.fields}else{var d=[];i.each(e.fields,function(e){var t=new wp.ccf.models.Fields[e.type](e);t.decode(),d.push(t)}),e.fields=new wp.ccf.collections.Fields(d,{formId:e.id}),o?(o.add(d),delete e.fields):e.fields=new wp.ccf.collections.Fields(d,{formId:e.id})}}if(e.notifications){var f=t.get("notifications");if(f&&f.length>0){for(l=0;e.notifications.length>l;l++){var u=e.notifications[l],p=f.at(l);if(p){if(u.addresses!==void 0){var h=p.get("addresses");if(h&&h.length>0)for(s=0;u.addresses>s;s++){var m=h.at(s);m.set(u.addresses[s]),m.decode()}delete e.notifications[l].addresses}p.set(u),p.decode()}}delete e.notifications}else{var w=[];i.each(e.notifications,function(e){var t=new wp.ccf.models.FormNotification(e);t.decode(),w.push(t)}),f?(f.add(w),delete e.notifications):e.notifications=new wp.ccf.collections.FormNotifications(w)}}if(e.postFieldMappings){var g=t.get("postFieldMappings");if(g&&g.length>0){for(l=0;e.postFieldMappings.length>l;l++){var v=e.postFieldMappings[l],y=g.at(l);y&&(y.set(v),y.decode())}delete e.postFieldMappings}else{var F=[];i.each(e.postFieldMappings,function(e){var t=new wp.ccf.models.PostFieldMapping(e);t.decode(),F.push(t)}),g?(g.add(F),e.postFieldMappings=g):e.postFieldMappings=new wp.ccf.collections.PostFieldMappings(F)}}return this.constructor.__super__.parse.call(this,e)},toJSON:function(){var e=this.constructor.__super__.toJSON.call(this);return e.fields&&(e.fields=e.fields.toJSON()),e.notifications&&(e.notifications=e.notifications.toJSON()),e.postFieldMappings&&(e.postFieldMappings=e.postFieldMappings.toJSON()),e.author&&(e.author=e.author.toJSON()),e}}),wp.ccf.models.Submission=wp.api.models.Submission||wp.api.models.Post.extend({defaults:{id:null,data:{},fields:{}},sync:o,urlRoot:l.apiRoot.replace(/\/$/,"")+"/ccf/v1/submissions"}),wp.ccf.models.Field=wp.api.models.Field||wp.api.models.Post.extend({idAttribute:"id",defaults:{id:null},set:s,required:function(){return["slug"]},decode:function(){return c.call(this,i.keys(wp.api.models.Post.prototype.defaults))},hasRequiredAttributes:function(){var e=this,t=!0;return i.each(this.required(),function(i){(e.get(i)===void 0||""===e.get(i))&&(t=!1)}),t},sync:o}),wp.ccf.models.StandardField=wp.ccf.models.StandardField||wp.ccf.models.Field.extend({idAttribute:"id",defaults:function(){var e={label:l.fieldLabel,value:"",placeholder:"",slug:"",type:"",required:!1,className:"",description:""};return i.defaults(e,this.constructor.__super__.defaults)}}),wp.ccf.models.Fields["single-line-text"]=wp.ccf.models.Fields["single-line-text"]||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"single-line-text"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.file=wp.ccf.models.Fields.file||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"file",fileExtensions:"",maxFileSize:l.maxFileSize};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields["paragraph-text"]=wp.ccf.models.Fields["paragraph-text"]||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"paragraph-text"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.hidden=wp.ccf.models.Fields.hidden||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"hidden"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.email=wp.ccf.models.Fields.email||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"email",emailConfirmation:!1};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.website=wp.ccf.models.Fields.website||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"website",placeholder:"http://"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.phone=wp.ccf.models.Fields.phone||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"phone",phoneFormat:"us"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.date=wp.ccf.models.Fields.date||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"date",showDate:!0,showTime:!0,dateFormat:"mm/dd/yyyy"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.name=wp.ccf.models.Fields.name||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"name"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.recaptcha=wp.ccf.models.Fields.recaptcha||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"recaptcha",siteKey:"",secretKey:""};return i.defaults(e,this.constructor.__super__.defaults())},required:function(){return["siteKey","secretKey"]},isImmutable:!0}),wp.ccf.models.Fields.address=wp.ccf.models.Fields.address||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"address",addressType:"us"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields["section-header"]=wp.ccf.models.Fields["section-header"]||wp.ccf.models.Field.extend({defaults:function(){var e={type:"section-header",slug:"",heading:"",subheading:"",className:""};return i.defaults(e,this.constructor.__super__.defaults)},required:function(){return[]},isImmutable:!0}),wp.ccf.models.Fields.html=wp.ccf.models.Fields.html||wp.ccf.models.Field.extend({defaults:function(){var e={type:"html",slug:"",html:"",className:""};return i.defaults(e,this.constructor.__super__.defaults)},required:function(){return[]},isImmutable:!0}),wp.ccf.models.ChoiceableField=wp.ccf.models.ChoiceableField||wp.ccf.models.StandardField.extend({defaults:function(){var e={choices:new wp.ccf.collections.FieldChoices};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(e){if("object"==typeof e&&e.choices){var t=[];i.each(e.choices,function(e){var i=new wp.ccf.models.FieldChoice(e);i.decode(),t.push(i)}),this.set("choices",new wp.ccf.collections.FieldChoices(t))}}}),wp.ccf.models.Fields.radio=wp.ccf.models.Fields.radio||wp.ccf.models.ChoiceableField.extend({defaults:function(){var e={type:"radio"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.checkboxes=wp.ccf.models.Fields.checkboxes||wp.ccf.models.ChoiceableField.extend({defaults:function(){var e={type:"checkboxes"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.dropdown=wp.ccf.models.Fields.dropdown||wp.ccf.models.ChoiceableField.extend({defaults:function(){var e={type:"dropdown"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}})}(jQuery,Backbone,_,ccfSettings),function(e,t,i,l){"use strict";var s=function(e,t,i){return i=i||{},i.emulateHTTP=!0,this.constructor.__super__.sync.call(this,e,t,i)};wp.ccf.collections=wp.ccf.collections||{},wp.ccf.collections.Forms=wp.ccf.collections.Forms||wp.api.collections.Posts.extend({model:wp.ccf.models.Form,url:l.apiRoot.replace(/\/$/,"")+"/ccf/v1/forms",formsFetching:{},initialize:function(){this.constructor.__super__.initialize(),this.formsFetching={}},sync:s,remove:function(e,t){t=t||{};var l=this.constructor.__super__.remove.call(this,e,t);return t.destroy&&(e instanceof Array?i.each(e,function(e){e.destroy()}):e.destroy()),l}}),wp.ccf.collections.Fields=wp.ccf.collections.Fields||wp.api.collections.Posts.extend({model:wp.ccf.models.Field,url:function(){return l.apiRoot+"/ccf/forms/"+this.formId+"/fields"},initialize:function(e,t){t&&t.formId&&(this.formId=t.formId)},sync:s}),wp.ccf.collections.PostFieldMappings=wp.ccf.collections.PostFieldMappings||t.Collection.extend({model:wp.ccf.models.PostFieldMapping}),wp.ccf.collections.FormNotificationAddresses=wp.ccf.collections.FormNotificationAddresses||t.Collection.extend({model:wp.ccf.models.FormNotificationAddress}),wp.ccf.collections.FormNotifications=wp.ccf.collections.FormNotifications||t.Collection.extend({model:wp.ccf.models.FormNotification}),wp.ccf.collections.Submissions=wp.ccf.collections.Submissions||wp.api.collections.Posts.extend({model:wp.ccf.models.Submission,url:function(){return l.apiRoot.replace(/\/$/,"")+"/ccf/v1/forms/"+this.formId+"/submissions"},initialize:function(e,t){this.constructor.__super__.initialize.apply(this,arguments),t&&t.formId&&(this.formId=t.formId)},sync:s}),wp.ccf.collections.FieldChoices=wp.ccf.collections.FieldChoices||t.Collection.extend({model:wp.ccf.models.FieldChoice})}(jQuery,Backbone,_,ccfSettings),function(e,t,i,l){"use strict";wp.ccf.views=wp.ccf.views||{},wp.ccf.views.Fields=wp.ccf.views.Fields||{},wp.ccf.views.FieldChoice=t.View.extend({template:wp.ccf.utils.template("ccf-field-choice-template"),className:"choice",events:{"click .add":"triggerAdd","click .delete":"triggerDelete","blur input":"saveChoice",saveChoice:"saveChoice",sorted:"triggerUpdateSort"},initialize:function(e){this.field=e.field},destroy:function(){wp.ccf.dispatcher.off("mainViewChange",this.saveChoice),this.unbind()},triggerUpdateSort:function(e,t){this.field.get("choices").remove(this.model,{silent:!0}),this.field.get("choices").add(this.model,{at:t,silent:!0})},saveChoice:function(){if(""!==this.el.innerHTML){var e=this.el.querySelectorAll(".choice-label")[0].value,t=this.el.querySelectorAll(".choice-value")[0].value;this.model.set("label",e),this.model.set("value",t);var i=this.el.querySelectorAll(".choice-selected")[0],l=i.checked?!0:!1;return this.model.set("selected",l),this}},render:function(){var e={};return this.model&&(e.choice=this.model.toJSON()),this.el.innerHTML=this.template(e),wp.ccf.dispatcher.on("mainViewChange",this.saveChoice,this),this},triggerAdd:function(){this.field.get("choices").add(new wp.ccf.models.FieldChoice)},triggerDelete:function(){var e=this.field.get("choices");if(e.length>1)e.remove(this.model),this.destroy(),this.remove();else{for(var t=this.el.querySelectorAll(".choice-label, .choice-value"),i=this.el.querySelectorAll(".choice-selected"),l=0;t.length>l;l++)t[l].value="";i[0].checked=!1}}}),wp.ccf.views.EmptyFormNotificationTableRow=wp.ccf.views.EmptyFormNotificationTableRow||t.View.extend({tagName:"tr",template:wp.ccf.utils.template("ccf-empty-form-notification-row-template"),events:{"click .add":"triggerAdd"},initialize:function(e){this.form=e.form},destroy:function(){this.unbind()},render:function(){return this.$el.html(this.template()),this},triggerAdd:function(){var e=this.form.get("notifications");this.destroy(),e.add(new wp.ccf.models.FormNotification)}}),wp.ccf.views.EmptyFormTableRow=wp.ccf.views.EmptyFormTableRow||t.View.extend({tagName:"tr",template:wp.ccf.utils.template("ccf-empty-form-table-row-template"),render:function(){return this.$el.html(this.template()),this}}),wp.ccf.views.FormNotificationAddress=t.View.extend({template:wp.ccf.utils.template("ccf-form-notification-address-template"),className:"address",events:{"click .add":"triggerAdd","click .delete":"triggerDelete","blur input":"save","change select":"save"},initialize:function(e){this.notification=e.notification,this.parent=e.parent,this.form=e.form},destroy:function(){this.unbind()},save:function(){if(""!==this.el.innerHTML){var e=this.el.querySelectorAll(".form-notification-address-type")[0].value,t=this.el.querySelectorAll(".form-notification-address-email"),i=this.el.querySelectorAll(".form-notification-address-field"),l=this.model.get("type");return t.length&&this.model.set("email",t[0].value),i.length&&this.model.set("field",i[0].value),this.model.set("type",e),l!==e&&this.render(),this}},updateFromFieldField:function(){if("edit"===this.parent.context&&"field"===this.model.get("type")){var e=this.el.querySelectorAll(".form-notification-address-field")[0];e.innerHTML="",e.disabled=!1;var t,i=this.form.get("fields"),s=0,o=this.model.get("field");i.length>=1&&i.each(function(i){("email"===i.get("type")||"dropdown"===i.get("type")||"radio"===i.get("type")||"single-line-text"===i.get("type"))&&(t=document.createElement("option"),t.innerHTML=i.get("slug"),t.value=i.get("slug"),i.get("slug")===o&&(t.selected=!0),e.appendChild(t),s++)}),0===s&&(t=document.createElement("option"),t.innerHTML=l.noApplicableFields,t.value="",e.appendChild(t),e.disabled=!0)}},render:function(){var e={};this.model&&(e.address=this.model.toJSON()),this.el.innerHTML=this.template(e);var t=this.form.get("fields");return this.listenTo(t,"add",this.updateFromFieldField,this),this.listenTo(t,"remove",this.updateFromFieldField,this),"field"===this.model.get("type")&&this.updateFromFieldField(),this},triggerAdd:function(){this.notification.get("addresses").add(new wp.ccf.models.FormNotificationAddress)},triggerDelete:function(){var e=this.notification.get("addresses");e.length>1?this.parent.deleteAddress(this):(this.model.clear().set(wp.ccf.models.FormNotificationAddress.prototype.defaults),this.destroy(),this.render())}}),wp.ccf.views.ExistingFormNotificationRow=t.View.extend({template:wp.ccf.utils.template("ccf-existing-form-notification-table-row-template"),tagName:"tr",events:{"change select.form-email-notification-from-type":"toggleNotificationFields","change select.form-email-notification-from-name-type":"toggleNotificationFields","change select.form-email-notification-subject-type":"toggleNotificationFields","click .close-notification":"changeContext","click .edit-notification":"changeContext","click .delete-notification":"triggerDelete","blur input":"save","change select":"save"},addressViews:[],initialize:function(e){this.form=e.form,this.addressViews=[],this.parent=e.parent,this.context=e.context!==void 0?e.context:"view";var t=this.model.get("addresses");this.listenTo(t,"add",this.addAddress)},deleteAddress:function(e){i.each(this.addressViews,function(t){if(e.cid===t.cid){var l=i.indexOf(this.addressViews,t);this.model.get("addresses").remove(e.model),this.addressViews[l].remove(),this.addressViews.splice(l,1)}},this)},addAddress:function(e){var t=this.el.querySelectorAll(".addresses")[0],i=new wp.ccf.views.FormNotificationAddress({model:e,parent:this,notification:this.model,form:this.form});this.addressViews.push(i),t.appendChild(i.render().el)},destroy:function(){this.unbind()},changeContext:function(e,t){"edit"===this.context&&this.save(),t?this.context=t:("view"===this.context&&this.parent.closeAllNotifications(),this.context="edit"===this.context?"view":"edit"),this.destroy(),this.render()},updateFieldVariables:function(){if("edit"===this.context){var e,t=this.el.querySelectorAll(".field-variables")[0],i="",l=this.form.get("fields");l.each(function(t){e=t.get("type"),"html"!==e&&"section-header"!==e&&"recaptcha"!==e&&(i+="["+t.get("slug")+"] ")}),t.innerText=i}},updateFromFieldField:function(){if("edit"===this.context){var e=this.el.querySelectorAll(".form-email-notification-from-field")[0];e.innerHTML="",e.disabled=!1;var t=this.el.querySelectorAll(".form-email-notification-subject-field")[0];t.innerHTML="",t.disabled=!1;var i=this.el.querySelectorAll(".form-email-notification-from-name-field")[0];i.innerHTML="",i.disabled=!1;var s,o=this.form.get("fields"),c=0,n=0,r=0,a=this.model.get("emailNotificationFromField"),d=this.model.get("emailNotificationSubjectField"),f=this.model.get("emailNotificationFromNameField");o.length>=1&&o.each(function(l){("email"===l.get("type")||"dropdown"===l.get("type")||"radio"===l.get("type")||"single-line-text"===l.get("type"))&&(s=document.createElement("option"),s.innerHTML=l.get("slug"),s.value=l.get("slug"),l.get("slug")===a&&(s.selected=!0),e.appendChild(s),c++),("name"===l.get("type")||"single-line-text"===l.get("type")||"radio"===l.get("type")||"dropdown"===l.get("type"))&&(s=document.createElement("option"),s.innerHTML=l.get("slug"),s.value=l.get("slug"),l.get("slug")===f&&(s.selected=!0),i.appendChild(s),n++),("single-line-text"===l.get("type")||"radio"===l.get("type")||"dropdown"===l.get("type"))&&(s=document.createElement("option"),s.innerHTML=l.get("slug"),s.value=l.get("slug"),l.get("slug")===d&&(s.selected=!0),t.appendChild(s),r++)}),0===c&&(s=document.createElement("option"),s.innerHTML=l.noEmailFields,s.value="",e.appendChild(s),e.disabled=!0),0===n&&(s=document.createElement("option"),s.innerHTML=l.noNameFields,s.value="",i.appendChild(s),i.disabled=!0),0===r&&(s=document.createElement("option"),s.innerHTML=l.noApplicableFields,s.value="",t.appendChild(s),t.disabled=!0)}},toggleNotificationFields:function(){var e=this.el.querySelectorAll(".email-notification-from-address")[0],t=this.el.querySelectorAll(".email-notification-from-field")[0],i=this.el.querySelectorAll(".form-email-notification-from-type")[0],l=this.el.querySelectorAll(".email-notification-subject")[0],s=this.el.querySelectorAll(".email-notification-subject-field")[0],o=this.el.querySelectorAll(".form-email-notification-subject-type")[0],c=this.el.querySelectorAll(".email-notification-from-name")[0],n=this.el.querySelectorAll(".email-notification-from-name-field")[0],r=this.el.querySelectorAll(".form-email-notification-from-name-type")[0];e.style.display="none",t.style.display="none","custom"===i.value?e.style.display="block":"field"===i.value&&(t.style.display="block"),l.style.display="none",s.style.display="none","custom"===o.value?l.style.display="block":"field"===o.value&&(s.style.display="block"),c.style.display="none",n.style.display="none","custom"===r.value?c.style.display="block":"field"===r.value&&(n.style.display="block")},save:function(){if(""!==this.el.innerHTML&&"edit"===this.context){var e=this.el.querySelectorAll(".form-email-notification-title")[0].value;this.model.set("title",e);var t=this.el.querySelectorAll(".form-email-notification-content")[0].value;this.model.set("content",t);var i=this.el.querySelectorAll(".form-email-notification-active")[0].value;this.model.set("active","1"===i?!0:!1);var l=this.el.querySelectorAll(".form-email-notification-from-type")[0].value;this.model.set("fromType",l);var s=this.el.querySelectorAll(".form-email-notification-from-address")[0].value;this.model.set("fromAddress",s);var o=this.el.querySelectorAll(".form-email-notification-from-field")[0].value;this.model.set("fromField",o);var c=this.el.querySelectorAll(".form-email-notification-from-name-type")[0].value;this.model.set("fromNameType",c);var n=this.el.querySelectorAll(".form-email-notification-from-name")[0].value;this.model.set("fromName",n);var r=this.el.querySelectorAll(".form-email-notification-from-name-field")[0].value;this.model.set("fromNameField",r);var a=this.el.querySelectorAll(".form-email-notification-subject-type")[0].value;this.model.set("subjectType",a);var d=this.el.querySelectorAll(".form-email-notification-subject")[0].value;this.model.set("subject",d);var f=this.el.querySelectorAll(".form-email-notification-subject-field")[0].value;this.model.set("subjectField",f);for(var u=0;this.addressViews.length>u;u++)this.addressViews[u].save();return this}},render:function(){var e={context:this.context,form:this.form.toJSON()};if(this.model&&(e.notification=this.model.toJSON()),this.el.innerHTML=this.template(e),"edit"===this.context){this.toggleNotificationFields(),this.updateFromFieldField(),this.updateFieldVariables();var t=this.el.querySelectorAll(".addresses")[0],i=this.model.get("addresses");if(i.length>=1)i.each(function(e){var i=new wp.ccf.views.FormNotificationAddress({model:e,parent:this,notification:this.model,form:this.form}).render();t.appendChild(i.el),this.addressViews.push(i)},this);else{var l=new wp.ccf.models.FormNotificationAddress;i.add(l)}}var s=this.form.get("fields");return this.listenTo(s,"add",this.updateFromFieldField,this),this.listenTo(s,"remove",this.updateFromFieldField,this),this.listenTo(s,"add",this.updateFieldVariables,this),this.listenTo(s,"remove",this.updateFieldVariables,this),this},triggerDelete:function(){this.parent.deleteNotification(this)}}),wp.ccf.views.FieldBase=wp.ccf.views.FieldBase||t.View.extend({events:{"blur input":"saveField","blur input.field-slug":"checkSlug","blur textarea":"saveField","change select":"saveField",'change input[type="checkbox"]':"saveField"},checkSlug:function(){var e=this.el.querySelectorAll(".field-slug");if(e.length>0){var t=e[0],i=!1;t.parentNode.className=t.value&&!t.value.match(/^[a-zA-Z0-9\-_]+$/)?t.parentNode.className.replace(/ field-error/i,"")+" field-error":t.parentNode.className.replace(/ field-error/i,""),this.collection.length>0&&""!==t.value?(this.collection.each(function(e){e!==this.model&&t.value===e.get("slug")&&(i=!0)},this),t.parentNode.className=i?t.parentNode.className.replace(/ field-duplicate-slug/i,"")+" field-duplicate-slug":t.parentNode.className.replace(/ field-duplicate-slug/i,"")):t.parentNode.className=t.parentNode.className.replace(/ field-duplicate-slug/i,"")}},destroy:function(){this.unbind()},render:function(){return this.el.innerHTML=this.template({field:this.model.toJSON()}),this.checkSlug(),this}}),wp.ccf.views.Fields["single-line-text"]=wp.ccf.views.Fields["single-line-text"]||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-single-line-text-template"),initialize:function(){},saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("placeholder",this.el.querySelectorAll(".field-placeholder")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this):void 0}}),wp.ccf.views.Fields.file=wp.ccf.views.Fields.file||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-file-template"),initialize:function(){},saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this.model.set("fileExtensions",this.el.querySelectorAll(".field-file-extensions")[0].value),this.model.set("maxFileSize",this.el.querySelectorAll(".field-max-file-size")[0].value),this):void 0}}),wp.ccf.views.Fields.recaptcha=wp.ccf.views.Fields.recaptcha||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-recaptcha-template"),initialize:function(){},saveField:function(){return""!==this.el.innerHTML?(this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("siteKey",this.el.querySelectorAll(".field-site-key")[0].value),this.model.set("secretKey",this.el.querySelectorAll(".field-secret-key")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this):void 0}}),wp.ccf.views.Fields["section-header"]=wp.ccf.views.Fields["section-header"]||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-section-header-template"),initialize:function(){},saveField:function(){return""!==this.el.innerHTML?(this.model.set("heading",this.el.querySelectorAll(".field-heading")[0].value),this.model.set("subheading",this.el.querySelectorAll(".field-subheading")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this):void 0}}),wp.ccf.views.Fields.html=wp.ccf.views.Fields.html||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-html-template"),initialize:function(){},saveField:function(){return""!==this.el.innerHTML?(this.model.set("html",this.el.querySelectorAll(".field-html")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this):void 0}}),wp.ccf.views.Fields["paragraph-text"]=wp.ccf.views.Fields["paragraph-text"]||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-paragraph-text-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("placeholder",this.el.querySelectorAll(".field-placeholder")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this):void 0}}),wp.ccf.views.Fields.hidden=wp.ccf.views.Fields.hidden||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-hidden-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this):void 0
|
2 |
-
}}),wp.ccf.views.Fields.date=wp.ccf.views.Fields.date||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-date-template"),saveField:function(){if(""!==this.el.innerHTML){this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value);var e=this.el.querySelectorAll(".field-value");e.length>0&&this.model.set("value",e[0].value);var t=this.el.querySelectorAll(".field-date-format");t.length&&this.model.set("dateFormat",t[0].value);var i=this.model.get("showDate"),l=this.el.querySelectorAll(".field-show-date")[0].checked?!0:!1;this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("showDate",l);var s=this.model.get("showTime"),o=this.el.querySelectorAll(".field-show-time")[0].checked?!0:!1;return this.model.set("showTime",o),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),(o!=s||l!=i)&&this.render(),this}}}),wp.ccf.views.Fields.name=wp.ccf.views.Fields.name||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-name-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this):void 0}}),wp.ccf.views.Fields.website=wp.ccf.views.Fields.website||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-website-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("placeholder",this.el.querySelectorAll(".field-placeholder")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this):void 0}}),wp.ccf.views.Fields.phone=wp.ccf.views.Fields.phone||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-phone-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("placeholder",this.el.querySelectorAll(".field-placeholder")[0].value),this.model.set("phoneFormat",this.el.querySelectorAll(".field-phone-format")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this):void 0}}),wp.ccf.views.Fields.address=wp.ccf.views.Fields.address||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-address-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("addressType",this.el.querySelectorAll(".field-address-type")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this):void 0}}),wp.ccf.views.Fields.email=wp.ccf.views.Fields.email||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-email-template"),saveField:function(){if(""!==this.el.innerHTML){this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value);var e=this.el.querySelectorAll(".field-value");e.length&&this.model.set("value",e[0].value);var t=this.el.querySelectorAll(".field-placeholder");t.length&&this.model.set("placeholder",t[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1);var i=1==this.el.querySelectorAll(".field-email-confirmation")[0].value?!0:!1,l=this.model.get("emailConfirmation");return this.model.set("emailConfirmation",i),l!=i&&this.render(),this}}}),wp.ccf.views.ChoiceableField=wp.ccf.views.ChoiceableField||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-dropdown-template"),initialize:function(){var e=this.model.get("choices");this.listenTo(e,"add",this.addChoice)},addChoice:function(e){var t=new wp.ccf.views.FieldChoice({model:e,field:this.model}).render(),i=this.el.querySelectorAll(".repeatable-choices")[0];i.appendChild(t.el)},saveField:function(){if(""!==this.el.innerHTML){this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1);var t=this.el.querySelectorAll(".repeatable-choices")[0].querySelectorAll(".choice");return i.each(t,function(t){e(t).trigger("saveChoice")}),this}},render:function(){var t=this;t.el.innerHTML=t.template({field:t.model.toJSON()}),t.checkSlug();var i=t.model.get("choices"),l=this.el.querySelectorAll(".repeatable-choices")[0];if(i.length>=1)i.each(function(e){var i=new wp.ccf.views.FieldChoice({model:e,field:t.model}).render();l.appendChild(i.el)});else{var s=new wp.ccf.models.FieldChoice;i.add(s)}return l=this.el.querySelectorAll(".repeatable-choices")[0],e(l).sortable({handle:".move",axis:"y",stop:function(e,t){t.item.trigger("sorted",t.item.index())}}),t}}),wp.ccf.views.Fields.dropdown=wp.ccf.views.Fields.dropdown||wp.ccf.views.ChoiceableField.extend({template:wp.ccf.utils.template("ccf-dropdown-template"),events:function(){return this.constructor.__super__.events}}),wp.ccf.views.Fields.radio=wp.ccf.views.Fields.radio||wp.ccf.views.ChoiceableField.extend({template:wp.ccf.utils.template("ccf-radio-template"),events:function(){return this.constructor.__super__.events}}),wp.ccf.views.Fields.checkboxes=wp.ccf.views.Fields.checkboxes||wp.ccf.views.ChoiceableField.extend({template:wp.ccf.utils.template("ccf-checkboxes-template"),events:function(){return this.constructor.__super__.events}}),wp.ccf.views.FieldSidebar=wp.ccf.views.FieldSidebar||t.View.extend({initialize:function(e){this.currentFieldView=null,this.form=e.form},save:function(e){this.currentFieldView&&""!==this.currentFieldView.el.innerHTML&&this.currentFieldView.saveField(),e&&e instanceof Object&&e.resolve()},fieldRemoved:function(){this.currentFieldView&&(this.form.get("fields").get(this.currentFieldView.model)||this.render())},destroy:function(){wp.ccf.dispatcher.off("saveField",this.save),wp.ccf.dispatcher.off("mainViewChange",this.save),this.unbind()},render:function(e){var t={};if(e){var i=e.get("type");this.currentFieldView&&(this.currentFieldView.saveField(),this.currentFieldView.destroy&&this.currentFieldView.destroy()),this.currentFieldView=new wp.ccf.views.Fields[i]({model:e,collection:this.form.get("fields")}),this.currentFieldView.render(),this.el.innerHTML="",this.el.appendChild(this.currentFieldView.el);var l=this.form.get("fields");this.listenTo(l,"remove",this.fieldRemoved)}else{var s=wp.ccf.utils.template("ccf-empty-field-template");this.el.innerHTML=s(t)}return wp.ccf.dispatcher.on("saveField",this.save,this),wp.ccf.dispatcher.on("mainViewChange",this.save,this),this}}),wp.ccf.views.FieldRowPlaceholder=wp.ccf.views.FieldRowPlaceholder||t.View.extend({template:wp.ccf.utils.template("ccf-field-row-template"),tagName:"div",className:"field",initialize:function(e){this.type=e.type},render:function(){return this.el.innerHTML=this.template({label:l.allLabels[this.type]}),this.el.setAttribute("data-field-type",this.type),this.el.className+=" "+this.type,this}}),wp.ccf.views.FieldRow=wp.ccf.views.FieldRow||t.View.extend({template:wp.ccf.utils.template("ccf-field-row-template"),tagName:"div",className:"field",events:{"click .delete":"triggerDelete","click h4":"triggerEdit",sorted:"triggerUpdateSort"},initialize:function(e){i.bindAll(this,"triggerDelete"),this.form=e.form,this.listenTo(this.model,"change",this.handleChange,this),this.listenTo(this.model,"requirementsNotMet",this.requirementsNotMet,this),this.listenTo(this.model,"requirementsMet",this.requirementsMet,this),this.listenTo(this.model,"duplicateSlug",this.duplicateSlug,this),this.model.attributes.choices&&this.listenTo(this.model.attributes.choices,"change",this.handleChange,this)},duplicateSlug:function(){this.requirementsMet(),this.el.className+=" field-duplicate-slug"},requirementsNotMet:function(){this.requirementsMet(),this.el.className+=" field-incomplete"},requirementsMet:function(){this.el.className=this.el.className.replace(/(field-incomplete|field-duplicate-slug)/i,"")},triggerUpdateSort:function(e,t){this.form.get("fields").remove(this.model),this.form.get("fields").add(this.model,{at:t})},handleChange:function(){this.render()},triggerDelete:function(e){e.stopPropagation(),this.form.get("fields").remove(this.model),this.undelegateEvents(),this.remove()},triggerEdit:function(){var e=this.el.parentNode.querySelectorAll(".ccf-editing");i.each(e,function(e){e.className=e.className.replace(/ccf-editing/i,"")}),this.el.className=this.el.className.replace(/ccf-editing/i,"")+" ccf-editing",wp.ccf.dispatcher.trigger("openEditField",this.model)},render:function(e){this.el.innerHTML=this.template({label:l.allLabels[this.model.get("type")]}),this.el.setAttribute("data-field-type",this.model.get("type"));var t=RegExp(" "+this.model.get("type"),"i");this.el.className=this.el.className.replace(t,"")+" "+this.model.get("type"),e&&(this.el.className=this.el.className.replace(/ instantiated/i,"")+" instantiated");var i=document.getElementById("ccf-"+this.model.get("type")+"-preview-template");if(i){var s=this.el.querySelectorAll(".preview")[0];s.style.display="block",s.innerHTML=wp.ccf.utils.template("ccf-"+this.model.get("type")+"-preview-template")({field:this.model.toJSON()})}return this}}),wp.ccf.views.PostFieldMapping=t.View.extend({template:wp.ccf.utils.template("ccf-post-field-mapping"),className:"field-mapping",events:{"click .add":"triggerAdd","click .delete":"triggerDelete","blur input":"save","change select":"save"},initialize:function(e){this.parent=e.parent,this.form=e.form},destroy:function(){this.unbind()},save:function(){if(""!==this.el.innerHTML){var e=this.el.querySelectorAll(".field-form-field")[0].value,t=this.el.querySelectorAll(".field-post-field")[0].value,i=this.el.querySelectorAll(".field-custom-field-key"),l=this.model.get("postField");return this.model.set("formField",e),this.model.set("postField",t),i.length&&this.model.set("customFieldKey",i[0].value),l!==t&&this.render(),this}},updateFormFieldField:function(){var e=this.el.querySelectorAll(".field-form-field")[0];e.innerHTML="",e.disabled=!1;var t,i=this.form.get("fields"),s=0,o=this.model.get("formField");i.length>=1&&(t=document.createElement("option"),t.innerHTML=l.chooseFormField,t.value="",e.appendChild(t),i.each(function(i){t=document.createElement("option"),t.innerHTML=i.get("slug"),t.value=i.get("slug"),i.get("slug")===o&&(t.selected=!0),e.appendChild(t),s++})),0===s&&(t=document.createElement("option"),t.innerHTML=l.noAvailableFields,t.value="",e.appendChild(t),e.disabled=!0)},updatePostFields:function(){var e,t=this.el.querySelectorAll(".field-post-field")[0];e=document.createElement("option"),e.value="",e.innerText=l.choosePostField,t.appendChild(e);var s=this.form.get("postFieldMappings"),o=[];s.each(function(e){e!==this.model&&o.push(e.get("postField"))},this),i.each(l.postFields.single,function(i,l){-1===o.indexOf(l)&&(e=document.createElement("option"),e.value=l,e.innerText=i,this.model.get("postField")===l&&(e.selected=!0),t.appendChild(e))},this),i.each(l.postFields.repeatable,function(i,l){e=document.createElement("option"),e.value=l,e.innerText=i,this.model.get("postField")===l&&(e.selected=!0),t.appendChild(e)},this)},render:function(){var e={};this.model&&(e.mapping=this.model.toJSON()),this.el.innerHTML=this.template(e);var t=this.form.get("fields");return this.listenTo(t,"add",this.updateFormFieldField,this),this.listenTo(t,"remove",this.updateFormFieldField,this),this.updateFormFieldField(),this.updatePostFields(),this},triggerAdd:function(){this.form.get("postFieldMappings").add(new wp.ccf.models.PostFieldMapping)},triggerDelete:function(){var e=this.form.get("postFieldMappings");e.length>1?this.parent.deletePostFieldMapping(this):(this.model.clear().set(wp.ccf.models.PostFieldMapping.prototype.defaults),this.destroy(),this.render())}}),wp.ccf.views.FormSettings=wp.ccf.views.FormSettings||t.View.extend({template:wp.ccf.utils.template("ccf-form-settings-template"),events:{"blur input":"save","change select":"save","change select.form-completion-action-type":"toggleCompletionFields","change select.form-pause":"togglePauseFields","change select.form-post-creation":"togglePostCreationFields","click .add-notification":"triggerAddNotification"},notificationViews:[],mappingViews:[],initialize:function(e){this.model=e.form,this.notificationViews=[],this.mappingViews=[];var t=this.model.get("notifications");this.listenTo(t,"add",this.addNotification);var i=this.model.get("postFieldMappings");this.listenTo(i,"add",this.addPostFieldMapping)},deletePostFieldMapping:function(e){i.each(this.mappingViews,function(t){if(e.cid===t.cid){var l=i.indexOf(this.mappingViews,t);this.model.get("postFieldMappings").remove(e.model),this.mappingViews[l].remove(),this.mappingViews.splice(l,1)}},this)},addPostFieldMapping:function(e){var t=this.el.querySelectorAll(".post-creation-mapping")[0],i=new wp.ccf.views.PostFieldMapping({model:e,parent:this,form:this.model});this.mappingViews.push(i),t.appendChild(i.render().el)},triggerAddNotification:function(){var e=this.model.get("notifications");e.add(new wp.ccf.models.FormNotification)},closeAllNotifications:function(){i.each(this.notificationViews,function(e){e.changeContext(null,"view")})},addNotification:function(e){var t=new wp.ccf.views.ExistingFormNotificationRow({model:e,form:this.model,context:"edit",parent:this}).render(),l=this.el.querySelectorAll(".ccf-form-notifications .rows")[0];l.querySelectorAll(".no-notifications").length>0&&l.removeChild(l.firstChild),i.each(this.notificationViews,function(e){e.changeContext(null,"view")}),this.notificationViews.push(t),l.appendChild(t.el)},toggleCompletionFields:function(){var e=this.el.querySelectorAll(".form-completion-action-type")[0].value,t=this.el.querySelectorAll(".completion-message")[0],i=this.el.querySelectorAll(".completion-redirect-url")[0];"text"===e?(t.style.display="block",i.style.display="none"):(t.style.display="none",i.style.display="block")},togglePauseFields:function(){var e=this.el.querySelectorAll(".form-pause")[0].value,t=this.el.querySelectorAll(".pause-message")[0];t.style.display=parseInt(e)?"block":"none"},togglePostCreationFields:function(){var t=this.el.querySelectorAll(".form-post-creation")[0].value,i=e(this.el.querySelectorAll(".post-creation-mapping-field"));parseInt(t)?i.show():i.hide()},save:function(){if(""!==this.el.innerHTML){var e=this.el.querySelectorAll(".form-title")[0].value;this.model.set("title",{raw:e});var t=this.el.querySelectorAll(".form-description")[0].value;this.model.set("description",t);var i=this.el.querySelectorAll(".form-button-text")[0].value;this.model.set("buttonText",i);var l=this.el.querySelectorAll(".form-pause")[0].value;this.model.set("pause",parseInt(l)?!0:!1);var s=this.el.querySelectorAll(".form-post-creation")[0].value;this.model.set("postCreation",parseInt(s)?!0:!1);var o=this.el.querySelectorAll(".form-post-creation-type")[0].value;this.model.set("postCreationType",o);var c=this.el.querySelectorAll(".form-post-creation-status")[0].value;this.model.set("postCreationStatus",c);var n=this.el.querySelectorAll(".form-pause-message")[0].value;this.model.set("pauseMessage",n);var r=this.el.querySelectorAll(".form-completion-message")[0].value;this.model.set("completionMessage",r);var a=this.el.querySelectorAll(".form-completion-redirect-url")[0].value;this.model.set("completionRedirectUrl",a);var d=this.el.querySelectorAll(".form-completion-action-type")[0].value;this.model.set("completionActionType",d);var f=this.el.querySelectorAll(".form-theme")[0].value;this.model.set("theme",f)}},fullSave:function(e){""!==this.el.innerHTML&&(this.save(),i.each(this.notificationViews,function(e){e.save()}),i.each(this.mappingViews,function(e){e.save()}),e!==void 0&&e.promise!==void 0&&e.resolve())},destroy:function(){wp.ccf.dispatcher.off("saveFormSettings",this.fullSave),wp.ccf.dispatcher.off("mainViewChange",this.fullSave)},deleteNotification:function(e){if(i.each(this.notificationViews,function(t){if(e.cid===t.cid){var l=i.indexOf(this.notificationViews,t);this.model.get("notifications").remove(e.model),this.notificationViews[l].remove(),this.notificationViews.splice(l,1)}},this),!this.notificationViews.length){var t=this.el.querySelectorAll(".ccf-form-notifications .rows")[0];t.appendChild(new wp.ccf.views.EmptyFormNotificationTableRow({form:this.model}).render().el)}},render:function(){var e={form:this.model.toJSON()};this.model.get("fields");var t=this.model.get("notifications");this.el.innerHTML=this.template(e),this.toggleCompletionFields(),this.togglePostCreationFields(),this.togglePauseFields();var i=this.el.querySelectorAll(".ccf-form-notifications .rows")[0],l=document.createElement("tbody");l.className="rows",t.length>=1?t.each(function(e){var t=new wp.ccf.views.ExistingFormNotificationRow({model:e,form:this.model,parent:this}).render();l.appendChild(t.el),this.notificationViews.push(t)},this):l.appendChild(new wp.ccf.views.EmptyFormNotificationTableRow({form:this.model}).render().el),i.parentNode.replaceChild(l,i);var s=this.el.querySelectorAll(".post-creation-mapping")[0],o=this.model.get("postFieldMappings");if(o.length>=1)o.each(function(e){var t=new wp.ccf.views.PostFieldMapping({model:e,parent:this,form:this.model}).render();s.appendChild(t.el),this.mappingViews.push(t)},this);else{var c=new wp.ccf.models.PostFieldMapping;o.add(c)}return wp.ccf.dispatcher.on("mainViewChange",this.fullSave,this),wp.ccf.dispatcher.on("saveFormSettings",this.fullSave,this),this}}),wp.ccf.views.FormPane=wp.ccf.views.FormPane||t.View.extend(i.defaults({template:wp.ccf.utils.template("ccf-form-pane-template"),subViews:{"field-sidebar":wp.ccf.views.FieldSidebar,"form-settings":wp.ccf.views.FormSettings},events:{"click .save-button":"sync","click .signup-button":"signup","click .accordion-heading":"accordionClick","click .form-settings-heading":"accordionClick","click .insert-form-button":"insertForm"},initialize:function(){wp.ccf.dispatcher.on("openEditField",this.openEditField,this)},insertForm:function(){wp.ccf.utils.insertFormShortcode(this.model),wp.ccf.toggle()},signup:function(){var t=this.el.querySelectorAll(".email-signup-field")[0].value,i=this.el.querySelectorAll(".interest-signup-field")[0].value,l=this.el.querySelectorAll(".bottom .left.signup")[0];l.className="left signup",t?e.ajax({url:"//taylorlovett.us8.list-manage.com/subscribe/post-json?u=66118f9a5b0ab0414e83f043a&id=b4ed816a24&c=?",method:"post",dataType:"jsonp",data:{EMAIL:t,INTEREST:i}}).done(function(){l.className="left signup signup-success"}):l.className="left signup signup-error"},accordionClick:function(t){var l=e(t.currentTarget).parents(".accordion-container")[0],s=l.querySelectorAll(".accordion-section");t.currentTarget.parentNode.className.match(/expanded/i)?t.currentTarget.parentNode.className=t.currentTarget.parentNode.className.replace(/expanded/i,""):t.currentTarget.parentNode.className+=" expanded",i.each(s,function(e){e!=t.currentTarget.parentNode&&e.className.match(/expanded/i)&&(e.className=e.className.replace(/expanded/i,""))}),t.currentTarget.className.match(/form-settings-heading/i)?this.el.className.match(/show-form-settings/i)?this.el.className=this.el.className.replace(/show-form-settings/i,""):this.el.className+=" show-form-settings":this.el.className=this.el.className.replace(/show-form-settings/i,"")},openEditField:function(e){this.renderedSubViews["field-sidebar"].render(e).el.style.display="block"},disable:function(){this.el.querySelectorAll(".save-button")[0].setAttribute("disabled","disabled"),this.el.querySelectorAll(".disabled-overlay")[0].style.display="block"},enable:function(){this.el.querySelectorAll(".save-button")[0].removeAttribute("disabled"),this.el.querySelectorAll(".disabled-overlay")[0].style.display="none"},sync:function(){var t=this,i=e(this.el.querySelectorAll(".spinner")[0]);i.fadeIn(),t.disable();var s=e.Deferred(),o=e.Deferred();wp.ccf.dispatcher.trigger("saveFormSettings",s),wp.ccf.dispatcher.trigger("saveField",o),e.when(s,o).then(function(){var e=t.model.get("fields"),s=!0,o={};e.each(function(e){var t=e.get("slug");e.hasRequiredAttributes()?t&&!t.match(/^[a-zA-Z0-9\-_]+$/)?(s=!1,e.trigger("requirementsNotMet")):o[e.get("slug")]!==void 0?(s=!1,e.trigger("duplicateSlug"),o[e.get("slug")].trigger("duplicateSlug")):e.trigger("requirementsMet"):(s=!1,e.trigger("requirementsNotMet")),e.get("slug")&&(o[e.get("slug")]=e)}),s?t.model.save({},{context:"edit"}).error(function(){var e="sync";wp.ccf.errorModal.render(e).show()}).done(function(){l.single&&!l.postId&&(window.location=l.adminUrl+"post.php?post="+t.model.get("id")+"&action=edit#ccf-form/"+t.model.get("id"))}).complete(function(){i.fadeOut(),t.enable(),wp.ccf.dispatcher.trigger("saveFormComplete",t.model)}):(t.enable(),i.fadeOut())})},enableDisableInsert:function(){var e=this.el.querySelectorAll(".insert-form-button")[0];this.model.get("id")?e.removeAttribute("disabled"):e.setAttribute("disabled","disabled")},getNextFieldOrd:function(){var e=this.model.get("fields"),t=e.length+1;return e.each(function(e){var i=e.get("slug"),l=/\-([0-9]+)$/g,s=l.exec(i);if(s&&s[1]){var o=parseInt(s[1]);o>=t&&(t=o+1)}}),t},render:function(t){var s=this;s.model=t?t:new wp.ccf.models.Form,this.listenTo(s.model,"change",this.enableDisableInsert,this);var o={labels:l.fieldLabels,form:s.model.toJSON()};window.form=s.model,s.el.innerHTML=this.template(o),s.el.className=s.el.className.replace(/show-form-settings/i,"");var c=s.el.querySelectorAll(".fields")[0];i.each(l.fieldLabels,function(e,t){c.appendChild(new wp.ccf.views.FieldRowPlaceholder({type:t}).render().el)});var n=s.el.querySelectorAll(".structure-fields")[0];i.each(l.structureFieldLabels,function(e,t){n.appendChild(new wp.ccf.views.FieldRowPlaceholder({type:t}).render().el)});var r=s.el.querySelectorAll(".special-fields")[0];i.each(l.specialFieldLabels,function(e,t){r.appendChild(new wp.ccf.views.FieldRowPlaceholder({type:t}).render().el)});var a=s.model.get("fields"),d=s.el.querySelectorAll(".form-content")[0],f=e(d);return e(s.el.querySelectorAll(".left-sidebar")[0].querySelectorAll(".field")).draggable({cursor:"move",distance:2,zIndex:160001,scroll:!1,containment:"document",appendTo:".ccf-main-modal",snap:!1,connectToSortable:".form-content",helper:function(t){var i=e(t.currentTarget),l=e('<div class="field" data-field-type="'+i.attr("data-field-type")+'"><h4>'+i.find(".label").html()+"</h4></div>");return l.css({width:f.width(),opacity:".75",height:i.height()})}}),a.length>=1&&(d.innerHTML="",a.each(function(e){var t=new wp.ccf.views.FieldRow({model:e,form:s.model}).render(!0).el;d.appendChild(t)})),e(d).sortable({axis:"y",distance:2,handle:"h4",placeholder:"field-placeholder",stop:function(e,t){if(!t.item.hasClass("instantiated")){var i=t.item.attr("data-field-type"),l={};wp.ccf.models.Fields[i].prototype.defaults().slug!==void 0&&(l.slug=i+"-"+s.getNextFieldOrd());var o=new wp.ccf.models.Fields[i](l),c=s.model.get("fields");c.add(o),new wp.ccf.views.FieldRow({model:o,el:t.item,form:s.model}).render(!0),t.item.attr("style","")}t.item.trigger("sorted",t.item.index())}}),s.initRenderSubViews(!1,!0,{form:s.model}),s.enableDisableInsert(),s}},wp.ccf.mixins.subViewable)),wp.ccf.views.ExistingFormTableRow=wp.ccf.views.ExistingFormTableRow||t.View.extend({tagName:"tr",template:wp.ccf.utils.template("ccf-existing-form-table-row-template"),events:{"click .edit":"triggerMainViewChange","click .delete":"triggerDelete","click .insert-form-button":"insertForm"},initialize:function(e){this.parent=e.parent},insertForm:function(){wp.ccf.utils.insertFormShortcode(this.model),wp.ccf.toggle()},triggerMainViewChange:function(){wp.ccf.switchToForm(this.model)},triggerDelete:function(){var e,t=this,i=t.parent.collection.state.currentPage;t.model.destroy().done(function(){e=i,e===t.parent.collection.state.totalPages&&e-1===(t.parent.collection.state.totalObjects-1)/l.postsPerPage&&e--,t.parent.showPage(e).done(function(){t.parent.renderPagination()})})},render:function(){return this.$el.html(this.template({form:this.model.toJSON(),utils:{getPrettyPostDate:wp.ccf.utils.getPrettyPostDate}})),this}}),wp.ccf.views.EmptyFormTableRow=wp.ccf.views.EmptyFormTableRow||t.View.extend({tagName:"tr",template:wp.ccf.utils.template("ccf-empty-form-table-row-template"),render:function(){return this.$el.html(this.template()),this}}),wp.ccf.views.ExistingFormTable=wp.ccf.views.ExistingFormTable||t.View.extend({template:wp.ccf.utils.template("ccf-existing-form-table-template"),initialize:function(){this.parent=arguments.parent,this.collection=new wp.ccf.collections.Forms,wp.ccf.dispatcher.on("changeFormTablePage",this.showPage,this),wp.ccf.dispatcher.on("saveFormComplete",this.render,this)},showPage:function(e){var t=this,i=this.collection.fetch({data:{page:e}});return i.error(function(){var e="sync";wp.ccf.errorModal.render(e).show()}),i.done(function(){var e=t.el.querySelectorAll(".rows")[0],i=document.createElement("tbody");i.className="rows",t.collection.length>=1?t.collection.each(function(e){var l=new wp.ccf.views.ExistingFormTableRow({model:e,parent:t}).render();i.appendChild(l.el)},t):i.appendChild((new wp.ccf.views.EmptyFormTableRow).render().el),e.parentNode.replaceChild(i,e)}),i},renderPagination:function(){var e=this.el.querySelectorAll(".ccf-pagination")[0];e.innerHTML="",this.collection.state.totalPages>1&&e.appendChild(new wp.ccf.views.Pagination({parent:this}).render(this.collection.state.totalPages,this.collection.state.currentPage).el)},render:function(){var e=this;return this.el.innerHTML=this.template(),this.el.querySelectorAll(".ccf-pagination")[0],this.showPage(1).done(function(){e.renderPagination()}),this}}),wp.ccf.views.ExistingFormPane=wp.ccf.views.ExistingFormPane||t.View.extend(i.defaults({template:wp.ccf.utils.template("ccf-existing-form-pane-template"),subViews:{"existing-form-table":wp.ccf.views.ExistingFormTable},render:function(){return this.rendered?this:(this.rendered=!0,this.el.innerHTML=this.template(),this.initRenderSubViews(!0),this)}},wp.ccf.mixins.subViewable)),wp.ccf.views.MainModal=wp.ccf.views.MainModal||t.View.extend(i.defaults({tagName:"div",className:"ccf-main-modal",template:wp.ccf.utils.template("ccf-main-modal-template"),events:{"click .close-icon":"hide","click .main-menu a":"menuClick"},subViews:{"form-pane":wp.ccf.views.FormPane},initialize:function(){l.single||(this.subViews["existing-form-pane"]=wp.ccf.views.ExistingFormPane),wp.ccf.dispatcher.on("mainViewChange",this.toggleView,this)},toggleView:function(e){this.showView(e,wp.ccf.currentForm);var t=e;"form-pane"===e&&wp.ccf.currentForm&&(t="existing-form-pane");var l=this.el.querySelectorAll(".menu-item");i.each(l,function(e){var i=e.getAttribute("data-view");e.className=i===t?e.className.replace("selected","")+" selected":e.className.replace("selected","")})},menuClick:function(e){var t=e.target.getAttribute("data-view");"form-pane"===t&&(wp.ccf.currentForm=null),wp.ccf.dispatcher.trigger("mainViewChange",t),e.preventDefault()},render:function(e){return e=e||!1,this.overlay(),this.el.innerHTML=this.template({single:e}),this.initRenderSubViews(),this.showView("form-pane",wp.ccf.currentForm,!0),this},overlay:function(){return this.overlayEl===void 0&&(this.overlayEl=document.createElement("div"),this.overlayEl.className="ccf-main-modal-overlay",document.body.appendChild(this.overlayEl)),this.overlayEl},remove:function(){return document.body.removeChild(this.overlay()),this},show:function(){e(this.overlay()).show(),this.$el.show()},hide:function(){e(this.overlay()).hide(),this.$el.hide()}},wp.ccf.mixins.subViewable)),wp.ccf.views.SubmissionRow=wp.ccf.views.SubmissionRow||t.View.extend({tagName:"tr",template:wp.ccf.utils.template("ccf-submission-row-template"),events:{"click .view":"view","click .delete":"delete"},initialize:function(e){this.parent=e.parent},"delete":function(){var e,t=this,i=t.parent.collection.state.currentPage;t.model.destroy().done(function(){e=i,e===t.parent.collection.state.totalPages&&e-1===(t.parent.collection.state.totalObjects-1)/l.postsPerPage&&e--,t.parent.showPage(e).done(function(){t.parent.renderPagination()})})},view:function(e){var t=e.currentTarget.getAttribute("data-submission-id"),i=e.currentTarget.getAttribute("data-submission-date");tb_show(l.thickboxTitle+" - "+wp.ccf.utils.getPrettyPostDate(i),"#TB_inline?height=500&width=700&inlineId=ccf-submission-content-"+parseInt(t),null)},render:function(){return this.$el.html(this.template({submission:this.model.toJSON(),currentColumns:this.parent.columns,columns:wp.ccf.currentForm.getFieldSlugs(!0),utils:{getPrettyPostDate:wp.ccf.utils.getPrettyPostDate,wordChop:wp.ccf.utils.wordChop,isFieldDate:wp.ccf.utils.isFieldDate,isFieldName:wp.ccf.utils.isFieldName,isFieldFile:wp.ccf.utils.isFieldFile,isFieldAddress:wp.ccf.utils.isFieldAddress,isFieldEmailConfirm:wp.ccf.utils.isFieldEmailConfirm,getPrettyFieldDate:wp.ccf.utils.getPrettyFieldDate,getPrettyFieldAddress:wp.ccf.utils.getPrettyFieldAddress,getPrettyFieldName:wp.ccf.utils.getPrettyFieldName,getPrettyFieldEmailConfirm:wp.ccf.utils.getPrettyFieldEmailConfirm}})),this}}),wp.ccf.views.SubmissionsTable=wp.ccf.views.SubmissionsTable||t.View.extend({template:wp.ccf.utils.template("ccf-submission-table-template"),events:{"click .prev:not(.disabled)":"previousPage","click .next:not(.disabled)":"nextPage","click .first:not(.disabled)":"firstPage","click .last:not(.disabled)":"lastPage"},initialize:function(){this.collection=new wp.ccf.collections.Submissions({},{formId:l.postId}),wp.ccf.dispatcher.on("submissionTableRebuild",this.render,this)},showPage:function(e){var t=this,i=this.collection.fetch({data:{page:e}});return i.error(function(){var e="sync";wp.ccf.errorModal.render(e).show()}),i.done(function(){var e=t.el.querySelectorAll(".submission-rows")[0],i=document.createElement("tbody");i.className="submission-rows",t.collection.length>=1?t.collection.each(function(e){var l=new wp.ccf.views.SubmissionRow({model:e,parent:t}).render();i.appendChild(l.el)},t):i.appendChild(new wp.ccf.views.EmptySubmissionTableRow({parent:t}).render(wp.ccf.currentForm.getFieldSlugs(!0).concat("date")).el),e.parentNode.replaceChild(i,e)}),i},renderPagination:function(){var e=this.el.querySelectorAll(".ccf-pagination")[0];
|
3 |
-
e.innerHTML="",this.collection.state.totalPages>1&&e.appendChild(new wp.ccf.views.Pagination({parent:this}).render(this.collection.state.totalPages,this.collection.state.currentPage).el)},render:function(e){var t=this;return t.columns=e?e:wp.ccf.currentForm.getFieldSlugs(!0).slice(0,4).concat("date"),1>t.columns.length?t.el.innerHTML="":(t.el.innerHTML=t.template({columns:t.columns}),t.el.querySelectorAll(".ccf-pagination")[0],t.showPage(1).done(function(){t.renderPagination()})),t}}),wp.ccf.views.ErrorModal=wp.ccf.views.ErrorModal||t.View.extend({template:wp.ccf.utils.template("ccf-error-modal-template"),tagName:"div",className:"ccf-error-modal",events:{"click .close":"hide"},hide:function(){this.el.className=this.el.className.replace(" show","")},show:function(){this.el.className=this.el.className.replace(" show","")+" show"},toggle:function(){this.el.className.match(" show")?this.hide():this.show()},render:function(e){var t={messageType:""};return e&&(t.messageType=e),this.el.innerHTML=this.template(t),this}}),wp.ccf.views.Pagination=wp.ccf.views.Pagination||t.View.extend({template:wp.ccf.utils.template("ccf-pagination-template"),events:{"click .prev:not(.disabled)":"previousPage","click .next:not(.disabled)":"nextPage","click .first:not(.disabled)":"firstPage","click .last:not(.disabled)":"lastPage"},initialize:function(e){this.parent=e.parent},previousPage:function(){var e=this;e.parent.showPage(e.parent.collection.state.currentPage-1).done(function(){e.render()})},nextPage:function(){var e=this;e.parent.showPage(e.parent.collection.state.currentPage+1).done(function(){e.render()})},firstPage:function(){var e=this;e.parent.showPage(1).done(function(){e.render()})},lastPage:function(){var e=this;e.parent.showPage(e.parent.collection.state.totalPages).done(function(){e.render()})},render:function(){return this.el.innerHTML=this.template({totalPages:this.parent.collection.state.totalPages,currentPage:this.parent.collection.state.currentPage,totalObjects:this.parent.collection.state.totalObjects}),this}}),wp.ccf.views.EmptySubmissionTableRow=wp.ccf.views.EmptySubmissionTableRow||t.View.extend({tagName:"tr",template:wp.ccf.utils.template("ccf-no-submissions-row-template"),initialize:function(e){this.parent=e.parent},render:function(){return this.el.innerHTML=this.template({columns:this.parent.columns}),this}}),wp.ccf.views.SubmissionColumnController=wp.ccf.views.SubmissionColumnController||t.View.extend({template:wp.ccf.utils.template("ccf-submissions-controller-template"),events:{"click input[type=checkbox]":"triggerTableRebuild"},render:function(){this.el.innerHTML=this.template({columns:wp.ccf.currentForm.getFieldSlugs(!0).concat("date")})},triggerTableRebuild:function(){var e=[],t=document.querySelectorAll(".submission-column-checkbox");if(t.length>=1)for(var i=0;t.length>i;i++)t[i].checked&&e.push(t[i].value);wp.ccf.dispatcher.trigger("submissionTableRebuild",e)}})}(jQuery,Backbone,_,ccfSettings),function(e,t){"use strict";wp.ccf.router=wp.ccf.router||t.Router.extend({routes:{"ccf-form":"open","ccf-form/:formId":"open"},open:function(e){wp.ccf.show(e)}})}(jQuery,Backbone,_,ccfSettings),function(e,t,i,l){"use strict";wp.ccf=i.defaults(wp.ccf,{forms:new wp.ccf.collections.Forms,currentForm:null,errorModal:null,_currentFormDeferred:null,dispatcher:{},show:function(e){return this.switchToForm(e),this.instance.show(),this.instance},initErrorModal:function(){this.errorModal=(new wp.ccf.views.ErrorModal).render();var e=document.getElementsByTagName("body")[0];e.appendChild(this.errorModal.el)},switchToForm:function(e){var t=this;if(+e===parseInt(e)){var i=parseInt(e);if(e=t.forms.findWhere({id:parseInt(i)}),!e){var l;return t.forms.formsFetching[i]!==void 0?(l=t.forms.formsFetching[i],e=null):(e=new wp.ccf.models.Form({id:i}),l=e.fetch(),t.forms.formsFetching[i]=l),l.done(function(){e?(delete t.forms.formsFetching[i],t.forms.add(e)):e=t.forms.findWhere({id:i}),t.currentForm=e,wp.ccf.dispatcher.trigger("mainViewChange","form-pane")}),l}t.currentForm=e,wp.ccf.dispatcher.trigger("mainViewChange","form-pane")}else t.currentForm=e,wp.ccf.dispatcher.trigger("mainViewChange","form-pane");return!0},hide:function(){return this.instance.hide(),this.instance},toggle:function(e){return this.switchToForm(e),this.instance.$el.is(":visible")?this.instance.hide():this.instance.show(),this.instance},createSubmissionsTable:function(e){var t=document.querySelectorAll(".ccf-submission-column-controller"),i=new wp.ccf.views.SubmissionsTable({el:e});i.render(),t&&new wp.ccf.views.SubmissionColumnController({el:t}).render()},_setupMainModal:function(e){return this.instance=(new wp.ccf.views.MainModal).render(e),document.getElementsByTagName("body")[0].appendChild(this.instance.el),t.history.start(),this.instance},createManager:function(){var s=this,o=document.querySelectorAll(".ccf-open-form-manager")[0];if(!o)return!1;i.extend(this.dispatcher,t.Events),new wp.ccf.router,s.initErrorModal();var c=!1;if(l.single)if(c=!0,l.postId){var n=parseInt(l.postId);if(s.forms.formsFetching[n]===void 0){var r=new wp.ccf.models.Form({id:n}),a=r.fetch();s.forms.formsFetching[n]=a,s._currentFormDeferred=a,a.done(function(){delete s.forms.formsFetching[n],s.forms.add(r),s.currentForm=r})}else s._currentFormDeferred=s.forms.formsFetching[n],s._currentFormDeferred.done(function(){s.currentForm=s.forms.findWhere({id:n})});e.when(s._currentFormDeferred).then(function(){s._setupMainModal(!0),o.style.display="inline-block";var e=document.getElementById("ccf-submissions");if(e){var t=e.querySelectorAll(".inside")[0],i=document.createElement("div");i.className="ccf-submission-icon",i.setAttribute("data-icon","");var c=document.createElement("a");c.href="?action=edit&post="+parseInt(l.postId)+"&download_submissions=1&download_submissions_nonce="+l.downloadSubmissionsNonce,c.className="ccf-submission-icon",c.setAttribute("data-icon","");var n=document.getElementById("show-settings-link");i.onclick=function(){n.click()},e.insertBefore(i,e.firstChild.nextSibling.nextSibling),e.insertBefore(c,e.firstChild.nextSibling.nextSibling),wp.ccf.createSubmissionsTable(t)}})}else s._setupMainModal(!0),o.style.display="inline-block";else s._setupMainModal();var d=function(e){e=e||window.event;var t=e.currentTarget?e.currentTarget:e.srcElement,i=t.getAttribute("data-form-id");wp.ccf.toggle(i)};o.addEventListener?o.addEventListener("click",d,!1):o.attachEvent("onclick",d)}}),wp.ccf.createManager()}(jQuery,Backbone,_,ccfSettings);
|
1 |
+
(function(e,t,i,l){"use strict";window.wp=window.wp||{},wp.ccf=wp.ccf||{},wp.ccf.utils=wp.ccf.utils||{},wp.ccf.utils.cleanDateFields=function(e){delete e.date,delete e.date_gmt,delete e.modified,delete e.modified_gmt,delete e.date_tz,delete e.modified_tz},wp.ccf.utils.template=i.memoize(function(e){var t={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g};return i.template(document.getElementById(e).innerHTML,null,t)}),wp.ccf.utils.insertFormShortcode=function(e){var t=wp.ccf.forms.findWhere({id:e.get("id")});t||wp.ccf.forms.add(e);var i=tinymce.get(wpActiveEditor),l='[ccf_form id="'+e.get("id")+'"]';i&&!i.isHidden()?tinymce.activeEditor.execCommand("mceInsertContent",!1,l):document.getElementById(wpActiveEditor).value+=l},wp.ccf.utils.getPrettyPostDate=function(e){return e=moment.utc(e),l.gmtOffset&&(e=e.utcOffset(60*parseInt(l.gmtOffset))),e.format("h:mm a M/D/YYYY")},wp.ccf.utils.wordChop=function(e,t){var i=e.substr(0,t);return i.substr(0,Math.min(i.length,i.lastIndexOf(" "))),i.length<e.length&&(i+="..."),i},wp.ccf.utils.isFieldDate=function(e){return e.date!==void 0||e.hour!==void 0&&e.minute!==void 0&&e["am-pm"]!==void 0?!0:!1},wp.ccf.utils.isFieldName=function(e){return e.name!==void 0||e.last!==void 0?!0:!1},wp.ccf.utils.isFieldEmailConfirm=function(e){return e.email!==void 0||e.confirm!==void 0?!0:!1},wp.ccf.utils.isFieldAddress=function(e){return e.street!==void 0&&e.city!==void 0&&e.zipcode!==void 0&&e.line_two!==void 0?!0:!1},wp.ccf.utils.isFieldFile=function(e){return e.id!==void 0&&e.url!==void 0&&e.file_name!==void 0?!0:!1},wp.ccf.utils.getPrettyFieldEmailConfirm=function(e){return e.email?e.email:e.confirm?e.confirm:"-"},wp.ccf.utils.getPrettyFieldDate=function(e,t){var i="",s="",o="HH:mm MM/DD/YY";if(t&&t.ccf_field_dateFormat&&"dd/mm/yyyy"===t.ccf_field_dateFormat&&(o="HH:mm DD/MM/YY"),e.hour&&e.minute&&e["am-pm"]&&(i+=e.hour+":"+e.minute+" "+e["am-pm"]),e.date&&(i+=" "+e.date),!i)return"-";var n=moment(i,o);return n.isValid()?(e.hour&&e.minute&&e["am-pm"]&&(s+=n.format("h:mm a")),e.date&&(s&&(s+=" "),s+=e.date),s):l.invalidDate},wp.ccf.utils.getPrettyFieldName=function(e){var t=e.first;return t.length>0&&(t+=" "),e.last&&(t+=e.last),t||(t="-"),t},wp.ccf.utils.getPrettyFieldAddress=function(e){if(!e.street||!e.city)return"-";var t=e.street;return e.line_two&&(t+=" "+e.line_two),t+=", "+e.city,e.state&&(t+=", "+e.state),e.zipcode&&(t+=" "+e.zipcode),e.country&&(t+=" "+e.country),t}})(jQuery,Backbone,_,ccfSettings),function(e,t,i){"use strict";wp.ccf.mixins=wp.ccf.mixins||{},wp.ccf.mixins.subViewable=wp.ccf.mixins.subViewable||{subViews:{},initRenderSubViews:function(e,t,l){this.renderedSubViews||(this.renderedSubViews={});for(var s in this.subViews){var o={el:this.$el.find(".ccf-"+s),parent:this};l&&i.extend(o,l),this.renderedSubViews[s]&&this.renderedSubViews[s].destroy&&this.renderedSubViews[s].destroy(),(t||!this.renderedSubViews[s])&&(this.renderedSubViews[s]=new this.subViews[s](o)),this.renderedSubViews[s].render(),e&&(this.renderedSubViews[s].el.style.display="block")}return this},showView:function(e,t,i){if(this.renderedSubViews!==void 0&&this.renderedSubViews[e]!==void 0){var l=this.renderedSubViews[e];i||l.render(t),l.el.style.display="block",this.currentView=e;for(var s in this.subViews)s!==e&&(this.renderedSubViews[s].el.style.display="none")}}}}(jQuery,Backbone,_,ccfSettings),function(e,t,i,l){"use strict";wp.ccf.models=wp.ccf.models||{},wp.ccf.models.Fields=wp.ccf.models.Fields||{};var s=function(e,i,l){return"object"!=typeof i&&""===i&&(i=""),t.Model.prototype.set.call(this,e,i,l)},o=function(e,t,i){return i=i||{},i.emulateHTTP=!0,this.constructor.__super__.sync.call(this,e,t,i)},n=function(e){for(var t in this.attributes)if(-1===i.indexOf(e,t)){var l=this.get(t);"string"==typeof l&&""!==l&&(l=(l+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/“/g,"”").replace(/”/g,"”").replace(/‘/g,"‘").replace(/&/g,"&").replace(/'/g,"'"),this.set(t,l))}return this};wp.ccf.models.FieldConditional=wp.ccf.models.FieldConditional||t.Model.extend({defaults:{field:"",compare:"is",value:""},decode:function(){return n.call(this,[])},set:s}),wp.ccf.models.FieldChoice=wp.ccf.models.FieldChoice||t.Model.extend({defaults:{label:"",value:"",selected:!1},decode:function(){return n.call(this,[])},set:s}),wp.ccf.models.PostFieldMapping=wp.ccf.models.PostFieldMapping||t.Model.extend({defaults:{formField:"",postField:"",customFieldKey:""},decode:function(){return n.call(this,[])},set:s}),wp.ccf.models.FormNotificationAddress=wp.ccf.models.FormNotificationAddress||t.Model.extend({defaults:{type:"custom",field:"",email:""},decode:function(){return n.call(this,[])},set:s}),wp.ccf.models.FormNotification=wp.ccf.models.FormNotification||t.Model.extend({defaults:function(){return{title:"",content:"[all_fields]",active:!1,addresses:new wp.ccf.collections.FormNotificationAddresses,fromType:"default",fromAddress:"",fromField:"",subjectType:"default",subject:"",subjectField:"",fromNameType:"custom",fromName:"WordPress",fromNameField:""}},initialize:function(e){if("object"==typeof e&&e.addresses){var t=[];i.each(e.addresses,function(e){var i=new wp.ccf.models.FormNotificationAddress(e);i.decode(),t.push(i)}),this.set("addresses",new wp.ccf.collections.FormNotificationAddresses(t))}},decode:function(){return n.call(this,[])},toJSON:function(){var e=this.constructor.__super__.toJSON.call(this);return e.addresses&&(e.addresses=e.addresses.toJSON()),e},set:s}),wp.ccf.models.Form=wp.ccf.models.Form||wp.api.models.Post.extend({urlRoot:l.apiRoot.replace(/\/$/,"")+"/ccf/v1/forms",set:s,sync:o,idAttribute:"id",initialize:function(){this.on("sync",this.decode,this)},defaults:function(){var e={fields:new wp.ccf.collections.Fields,type:"ccf_form",status:"publish",description:"",buttonText:"Submit Form",completionActionType:"text",completionRedirectUrl:"",completionMessage:"",postCreation:!1,postCreationType:"post",postCreationStatus:"draft",postFieldMappings:new wp.ccf.collections.PostFieldMappings,notifications:new wp.ccf.collections.FormNotifications,pause:!1,pauseMessage:l.pauseMessage,theme:"none"};return e=i.defaults(e,this.constructor.__super__.defaults),wp.ccf.utils.cleanDateFields(e),e},decode:function(){var e=i.keys(wp.api.models.Post.prototype.defaults);return e=i.without(e,"title"),n.call(this,e)},getFieldSlugs:function(e){var t=wp.ccf.currentForm.get("fields"),i=[];return t.each(function(t){e&&t.isImmutable||i.push(t.get("slug"))}),i},parse:function(e){var t=this,l=0,s=0;if(e.fields){var o=t.get("fields");if(o&&o.length>0){for(l=0;e.fields.length>l;l++){var n=e.fields[l],c=o.findWhere({slug:n.slug});if(c){if(n.choices!==void 0){var r=t.get("choices");if(r&&r.length>0)for(s=0;n.choices>s;s++){var a=r.at(s);a.set(n.choices[s]),a.decode()}delete e.fields[l].choices}if(n.conditionals!==void 0){var d=t.get("conditionals");if(d&&d.length>0)for(s=0;n.conditionals>s;s++){var u=d.at(s);u.set(n.conditionals[s]),u.decode()}delete e.fields[l].conditionals}c.set(n),c.decode()}}delete e.fields}else{var f=[];i.each(e.fields,function(e){var t=new wp.ccf.models.Fields[e.type](e);t.decode(),f.push(t)}),e.fields=new wp.ccf.collections.Fields(f,{formId:e.id}),o?(o.add(f),delete e.fields):e.fields=new wp.ccf.collections.Fields(f,{formId:e.id})}}if(e.notifications){var p=t.get("notifications");if(p&&p.length>0){for(l=0;e.notifications.length>l;l++){var h=e.notifications[l],m=p.at(l);if(m){if(h.addresses!==void 0){var w=m.get("addresses");if(w&&w.length>0)for(s=0;h.addresses>s;s++){var g=w.at(s);g.set(h.addresses[s]),g.decode()}delete e.notifications[l].addresses}m.set(h),m.decode()}}delete e.notifications}else{var v=[];i.each(e.notifications,function(e){var t=new wp.ccf.models.FormNotification(e);t.decode(),v.push(t)}),p?(p.add(v),delete e.notifications):e.notifications=new wp.ccf.collections.FormNotifications(v)}}if(e.postFieldMappings){var y=t.get("postFieldMappings");if(y&&y.length>0){for(l=0;e.postFieldMappings.length>l;l++){var F=e.postFieldMappings[l],b=y.at(l);b&&(b.set(F),b.decode())}delete e.postFieldMappings}else{var S=[];i.each(e.postFieldMappings,function(e){var t=new wp.ccf.models.PostFieldMapping(e);t.decode(),S.push(t)}),y?(y.add(S),e.postFieldMappings=y):e.postFieldMappings=new wp.ccf.collections.PostFieldMappings(S)}}return this.constructor.__super__.parse.call(this,e)},toJSON:function(){var e=this.constructor.__super__.toJSON.call(this);return e.fields&&(e.fields=e.fields.toJSON()),e.notifications&&(e.notifications=e.notifications.toJSON()),e.postFieldMappings&&(e.postFieldMappings=e.postFieldMappings.toJSON()),e.author&&(e.author=e.author.toJSON()),e}}),wp.ccf.models.Submission=wp.api.models.Submission||wp.api.models.Post.extend({defaults:{id:null,data:{},fields:{}},sync:o,urlRoot:l.apiRoot.replace(/\/$/,"")+"/ccf/v1/submissions"}),wp.ccf.models.Field=wp.api.models.Field||wp.api.models.Post.extend({idAttribute:"id",defaults:function(){return{id:null,conditionalsEnabled:!1,conditionalType:"show",conditionalFieldsRequired:"all",conditionals:new wp.ccf.collections.FieldConditionals}},set:s,initialize:function(e){if("object"==typeof e&&e.conditionals){var t=[];i.each(e.conditionals,function(e){var i=new wp.ccf.models.FieldConditional(e);i.decode(),t.push(i)}),this.set("conditionals",new wp.ccf.collections.FieldConditionals(t))}},required:function(){return["slug"]},decode:function(){return n.call(this,i.keys(wp.api.models.Post.prototype.defaults))},hasRequiredAttributes:function(){var e=this,t=!0;return i.each(this.required(),function(i){(e.get(i)===void 0||""===e.get(i))&&(t=!1)}),t},sync:o}),wp.ccf.models.StandardField=wp.ccf.models.StandardField||wp.ccf.models.Field.extend({idAttribute:"id",defaults:function(){var e={label:l.fieldLabel,value:"",placeholder:"",slug:"",type:"",required:!1,className:"",description:""};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return wp.ccf.models.StandardField.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields["single-line-text"]=wp.ccf.models.Fields["single-line-text"]||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"single-line-text"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.file=wp.ccf.models.Fields.file||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"file",fileExtensions:"",maxFileSize:l.maxFileSize};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields["paragraph-text"]=wp.ccf.models.Fields["paragraph-text"]||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"paragraph-text"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.hidden=wp.ccf.models.Fields.hidden||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"hidden"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.email=wp.ccf.models.Fields.email||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"email",emailConfirmation:!1};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.website=wp.ccf.models.Fields.website||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"website",placeholder:"http://"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.phone=wp.ccf.models.Fields.phone||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"phone",phoneFormat:"us"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.date=wp.ccf.models.Fields.date||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"date",showDate:!0,showTime:!0,dateFormat:"mm/dd/yyyy"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.name=wp.ccf.models.Fields.name||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"name"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.recaptcha=wp.ccf.models.Fields.recaptcha||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"recaptcha",siteKey:"",secretKey:""};return i.defaults(e,this.constructor.__super__.defaults())},required:function(){return["siteKey","secretKey"]},isImmutable:!0,initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.address=wp.ccf.models.Fields.address||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"address",addressType:"us"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields["section-header"]=wp.ccf.models.Fields["section-header"]||wp.ccf.models.Field.extend({defaults:function(){var e={type:"section-header",slug:"",heading:"",subheading:"",className:""};return i.defaults(e,this.constructor.__super__.defaults())},required:function(){return[]},isImmutable:!0,initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.html=wp.ccf.models.Fields.html||wp.ccf.models.Field.extend({defaults:function(){var e={type:"html",slug:"",html:"",className:""};return i.defaults(e,this.constructor.__super__.defaults())},required:function(){return[]},isImmutable:!0,initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.ChoiceableField=wp.ccf.models.ChoiceableField||wp.ccf.models.StandardField.extend({defaults:function(){var e={choices:new wp.ccf.collections.FieldChoices};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(e){if("object"==typeof e&&e.choices){var t=[];i.each(e.choices,function(e){var i=new wp.ccf.models.FieldChoice(e);i.decode(),t.push(i)}),this.set("choices",new wp.ccf.collections.FieldChoices(t))}return wp.ccf.models.ChoiceableField.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.radio=wp.ccf.models.Fields.radio||wp.ccf.models.ChoiceableField.extend({defaults:function(){var e={type:"radio"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.checkboxes=wp.ccf.models.Fields.checkboxes||wp.ccf.models.ChoiceableField.extend({defaults:function(){var e={type:"checkboxes"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.dropdown=wp.ccf.models.Fields.dropdown||wp.ccf.models.ChoiceableField.extend({defaults:function(){var e={type:"dropdown"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}})}(jQuery,Backbone,_,ccfSettings),function(e,t,i,l){"use strict";var s=function(e,t,i){return i=i||{},i.emulateHTTP=!0,this.constructor.__super__.sync.call(this,e,t,i)};wp.ccf.collections=wp.ccf.collections||{},wp.ccf.collections.Forms=wp.ccf.collections.Forms||wp.api.collections.Posts.extend({model:wp.ccf.models.Form,url:l.apiRoot.replace(/\/$/,"")+"/ccf/v1/forms",formsFetching:{},initialize:function(){this.constructor.__super__.initialize(),this.formsFetching={}},sync:s,remove:function(e,t){t=t||{};var l=this.constructor.__super__.remove.call(this,e,t);return t.destroy&&(e instanceof Array?i.each(e,function(e){e.destroy()}):e.destroy()),l}}),wp.ccf.collections.Fields=wp.ccf.collections.Fields||wp.api.collections.Posts.extend({model:wp.ccf.models.Field,url:function(){return l.apiRoot+"/ccf/forms/"+this.formId+"/fields"},initialize:function(e,t){t&&t.formId&&(this.formId=t.formId)},sync:s}),wp.ccf.collections.PostFieldMappings=wp.ccf.collections.PostFieldMappings||t.Collection.extend({model:wp.ccf.models.PostFieldMapping}),wp.ccf.collections.FormNotificationAddresses=wp.ccf.collections.FormNotificationAddresses||t.Collection.extend({model:wp.ccf.models.FormNotificationAddress}),wp.ccf.collections.FormNotifications=wp.ccf.collections.FormNotifications||t.Collection.extend({model:wp.ccf.models.FormNotification}),wp.ccf.collections.Submissions=wp.ccf.collections.Submissions||wp.api.collections.Posts.extend({model:wp.ccf.models.Submission,url:function(){return l.apiRoot.replace(/\/$/,"")+"/ccf/v1/forms/"+this.formId+"/submissions"},initialize:function(e,t){this.constructor.__super__.initialize.apply(this,arguments),t&&t.formId&&(this.formId=t.formId)},sync:s}),wp.ccf.collections.FieldChoices=wp.ccf.collections.FieldChoices||t.Collection.extend({model:wp.ccf.models.FieldChoice}),wp.ccf.collections.FieldConditionals=wp.ccf.collections.FieldConditionals||t.Collection.extend({model:wp.ccf.models.FieldConditional})}(jQuery,Backbone,_,ccfSettings),function(e,t,i,l){"use strict";wp.ccf.views=wp.ccf.views||{},wp.ccf.views.Fields=wp.ccf.views.Fields||{},wp.ccf.views.FieldChoice=t.View.extend({template:wp.ccf.utils.template("ccf-field-choice-template"),className:"choice",events:{"click .add":"triggerAdd","click .delete":"triggerDelete",saveChoice:"saveChoice",sorted:"triggerUpdateSort"},initialize:function(e){this.field=e.field},destroy:function(){wp.ccf.dispatcher.off("mainViewChange",this.saveChoice),this.unbind()},triggerUpdateSort:function(e,t){this.field.get("choices").remove(this.model,{silent:!0}),this.field.get("choices").add(this.model,{at:t,silent:!0})},saveChoice:function(){if(""!==this.el.innerHTML){var e=this.el.querySelectorAll(".choice-label")[0].value,t=this.el.querySelectorAll(".choice-value")[0].value;this.model.set("label",e),this.model.set("value",t);var i=this.el.querySelectorAll(".choice-selected")[0],l=i.checked?!0:!1;return this.model.set("selected",l),this}},render:function(){var e={};return this.model&&(e.choice=this.model.toJSON()),this.el.innerHTML=this.template(e),wp.ccf.dispatcher.on("mainViewChange",this.saveChoice,this),this},triggerAdd:function(){this.field.get("choices").add(new wp.ccf.models.FieldChoice)},triggerDelete:function(){var e=this.field.get("choices");if(e.length>1)e.remove(this.model),this.destroy(),this.remove();else{for(var t=this.el.querySelectorAll(".choice-label, .choice-value"),i=this.el.querySelectorAll(".choice-selected"),l=0;t.length>l;l++)t[l].value="";i[0].checked=!1}}}),wp.ccf.views.FieldConditional=t.View.extend({template:wp.ccf.utils.template("ccf-field-conditional-template"),className:"conditional",events:{"click .add":"triggerAdd","click .delete":"triggerDelete",saveConditional:"saveConditional"},initialize:function(e){this.field=e.field,this.fieldCollection=e.fieldCollection},destroy:function(){wp.ccf.dispatcher.off("mainViewChange",this.saveConditional),this.unbind()},saveConditional:function(){if(""!==this.el.innerHTML){var e=this.el.querySelectorAll(".conditional-field")[0].value,t=this.el.querySelectorAll(".conditional-value")[0].value,i=this.el.querySelectorAll(".conditional-compare")[0].value;return this.model.set("field",e),this.model.set("value",t),this.model.set("compare",i),this}},updateFields:function(){var e=this.el.querySelectorAll(".conditional-field")[0];e.innerHTML="",e.disabled=!1;var t,i=0,s=this.model.get("field");this.fieldCollection.length>=1&&(t=document.createElement("option"),t.innerHTML=l.chooseFormField,t.value="",e.appendChild(t),this.fieldCollection.each(function(l){if(this.field.get("slug")!==l.get("slug")){var o=l.get("type");"address"!==o&&"date"!==o&&"name"!==o&&"file"!==o&&"recaptcha"!==o&&"section-header"!==o&&"html"!==o&&(t=document.createElement("option"),t.innerHTML=l.get("slug"),t.value=l.get("slug"),l.get("slug")===s&&(t.selected=!0),e.appendChild(t),i++)}},this)),0===i&&(e.innerHTML="",t=document.createElement("option"),t.innerHTML=l.noAvailableFields,t.value="",e.appendChild(t),e.disabled=!0)},render:function(){var e={};return this.model&&(e.conditional=this.model.toJSON()),this.el.innerHTML=this.template(e),wp.ccf.dispatcher.on("mainViewChange",this.saveConditional,this),this.listenTo(this.fieldCollection,"add",this.updateFields,this),this.listenTo(this.fieldCollection,"remove",this.updateFields,this),this.updateFields(),this},triggerAdd:function(){this.field.get("conditionals").add(new wp.ccf.models.FieldConditional)},triggerDelete:function(){var e=this.field.get("conditionals");if(e.length>1)e.remove(this.model),this.destroy(),this.remove();else{var t=this.el.querySelectorAll(".conditional-value")[0],i=this.el.querySelectorAll(".conditional-field")[0];t.value="";for(var l=0;i.childNodes.length>l;l++)i.childNodes[l].selected=!1}}}),wp.ccf.views.EmptyFormNotificationTableRow=wp.ccf.views.EmptyFormNotificationTableRow||t.View.extend({tagName:"tr",template:wp.ccf.utils.template("ccf-empty-form-notification-row-template"),events:{"click .add":"triggerAdd"},initialize:function(e){this.form=e.form},destroy:function(){this.unbind()},render:function(){return this.$el.html(this.template()),this},triggerAdd:function(){var e=this.form.get("notifications");this.destroy(),e.add(new wp.ccf.models.FormNotification)}}),wp.ccf.views.EmptyFormTableRow=wp.ccf.views.EmptyFormTableRow||t.View.extend({tagName:"tr",template:wp.ccf.utils.template("ccf-empty-form-table-row-template"),render:function(){return this.$el.html(this.template()),this}}),wp.ccf.views.FormNotificationAddress=t.View.extend({template:wp.ccf.utils.template("ccf-form-notification-address-template"),className:"address",events:{"click .add":"triggerAdd","click .delete":"triggerDelete","blur input":"save","change select":"save"},initialize:function(e){this.notification=e.notification,this.parent=e.parent,this.form=e.form},destroy:function(){this.unbind()},save:function(){if(""!==this.el.innerHTML){var e=this.el.querySelectorAll(".form-notification-address-type")[0].value,t=this.el.querySelectorAll(".form-notification-address-email"),i=this.el.querySelectorAll(".form-notification-address-field"),l=this.model.get("type");return t.length&&this.model.set("email",t[0].value),i.length&&this.model.set("field",i[0].value),this.model.set("type",e),l!==e&&this.render(),this}},updateFromFieldField:function(){if("edit"===this.parent.context&&"field"===this.model.get("type")){var e=this.el.querySelectorAll(".form-notification-address-field")[0];e.innerHTML="",e.disabled=!1;var t,i=this.form.get("fields"),s=0,o=this.model.get("field");i.length>=1&&i.each(function(i){("email"===i.get("type")||"dropdown"===i.get("type")||"radio"===i.get("type")||"single-line-text"===i.get("type"))&&(t=document.createElement("option"),t.innerHTML=i.get("slug"),t.value=i.get("slug"),i.get("slug")===o&&(t.selected=!0),e.appendChild(t),s++)}),0===s&&(t=document.createElement("option"),t.innerHTML=l.noApplicableFields,t.value="",e.appendChild(t),e.disabled=!0)}},render:function(){var e={};this.model&&(e.address=this.model.toJSON()),this.el.innerHTML=this.template(e);var t=this.form.get("fields");return this.listenTo(t,"add",this.updateFromFieldField,this),this.listenTo(t,"remove",this.updateFromFieldField,this),"field"===this.model.get("type")&&this.updateFromFieldField(),this},triggerAdd:function(){this.notification.get("addresses").add(new wp.ccf.models.FormNotificationAddress)},triggerDelete:function(){var e=this.notification.get("addresses");e.length>1?this.parent.deleteAddress(this):(this.model.clear().set(wp.ccf.models.FormNotificationAddress.prototype.defaults),this.destroy(),this.render())}}),wp.ccf.views.ExistingFormNotificationRow=t.View.extend({template:wp.ccf.utils.template("ccf-existing-form-notification-table-row-template"),tagName:"tr",events:{"change select.form-email-notification-from-type":"toggleNotificationFields","change select.form-email-notification-from-name-type":"toggleNotificationFields","change select.form-email-notification-subject-type":"toggleNotificationFields","click .close-notification":"changeContext","click .edit-notification":"changeContext","click .delete-notification":"triggerDelete","blur input":"save","change select":"save"},addressViews:[],initialize:function(e){this.form=e.form,this.addressViews=[],this.parent=e.parent,this.context=e.context!==void 0?e.context:"view";var t=this.model.get("addresses");this.listenTo(t,"add",this.addAddress)},deleteAddress:function(e){i.each(this.addressViews,function(t){if(e.cid===t.cid){var l=i.indexOf(this.addressViews,t);this.model.get("addresses").remove(e.model),this.addressViews[l].remove(),this.addressViews.splice(l,1)}},this)},addAddress:function(e){var t=this.el.querySelectorAll(".addresses")[0],i=new wp.ccf.views.FormNotificationAddress({model:e,parent:this,notification:this.model,form:this.form});this.addressViews.push(i),t.appendChild(i.render().el)},destroy:function(){this.unbind()},changeContext:function(e,t){"edit"===this.context&&this.save(),t?this.context=t:("view"===this.context&&this.parent.closeAllNotifications(),this.context="edit"===this.context?"view":"edit"),this.destroy(),this.render()},updateFieldVariables:function(){if("edit"===this.context){var e,t=this.el.querySelectorAll(".field-variables")[0],i="",l=this.form.get("fields");l.each(function(t){e=t.get("type"),"html"!==e&&"section-header"!==e&&"recaptcha"!==e&&(i+="["+t.get("slug")+"] ")}),t.innerText=i}},updateFromFieldField:function(){if("edit"===this.context){var e=this.el.querySelectorAll(".form-email-notification-from-field")[0];e.innerHTML="",e.disabled=!1;var t=this.el.querySelectorAll(".form-email-notification-subject-field")[0];t.innerHTML="",t.disabled=!1;var i=this.el.querySelectorAll(".form-email-notification-from-name-field")[0];i.innerHTML="",i.disabled=!1;var s,o=this.form.get("fields"),n=0,c=0,r=0,a=this.model.get("emailNotificationFromField"),d=this.model.get("emailNotificationSubjectField"),u=this.model.get("emailNotificationFromNameField");o.length>=1&&o.each(function(l){("email"===l.get("type")||"dropdown"===l.get("type")||"radio"===l.get("type")||"single-line-text"===l.get("type"))&&(s=document.createElement("option"),s.innerHTML=l.get("slug"),s.value=l.get("slug"),l.get("slug")===a&&(s.selected=!0),e.appendChild(s),n++),("name"===l.get("type")||"single-line-text"===l.get("type")||"radio"===l.get("type")||"dropdown"===l.get("type"))&&(s=document.createElement("option"),s.innerHTML=l.get("slug"),s.value=l.get("slug"),l.get("slug")===u&&(s.selected=!0),i.appendChild(s),c++),("single-line-text"===l.get("type")||"radio"===l.get("type")||"dropdown"===l.get("type"))&&(s=document.createElement("option"),s.innerHTML=l.get("slug"),s.value=l.get("slug"),l.get("slug")===d&&(s.selected=!0),t.appendChild(s),r++)}),0===n&&(s=document.createElement("option"),s.innerHTML=l.noEmailFields,s.value="",e.appendChild(s),e.disabled=!0),0===c&&(s=document.createElement("option"),s.innerHTML=l.noNameFields,s.value="",i.appendChild(s),i.disabled=!0),0===r&&(s=document.createElement("option"),s.innerHTML=l.noApplicableFields,s.value="",t.appendChild(s),t.disabled=!0)}},toggleNotificationFields:function(){var e=this.el.querySelectorAll(".email-notification-from-address")[0],t=this.el.querySelectorAll(".email-notification-from-field")[0],i=this.el.querySelectorAll(".form-email-notification-from-type")[0],l=this.el.querySelectorAll(".email-notification-subject")[0],s=this.el.querySelectorAll(".email-notification-subject-field")[0],o=this.el.querySelectorAll(".form-email-notification-subject-type")[0],n=this.el.querySelectorAll(".email-notification-from-name")[0],c=this.el.querySelectorAll(".email-notification-from-name-field")[0],r=this.el.querySelectorAll(".form-email-notification-from-name-type")[0];e.style.display="none",t.style.display="none","custom"===i.value?e.style.display="block":"field"===i.value&&(t.style.display="block"),l.style.display="none",s.style.display="none","custom"===o.value?l.style.display="block":"field"===o.value&&(s.style.display="block"),n.style.display="none",c.style.display="none","custom"===r.value?n.style.display="block":"field"===r.value&&(c.style.display="block")},save:function(){if(""!==this.el.innerHTML&&"edit"===this.context){var e=this.el.querySelectorAll(".form-email-notification-title")[0].value;this.model.set("title",e);var t=this.el.querySelectorAll(".form-email-notification-content")[0].value;this.model.set("content",t);var i=this.el.querySelectorAll(".form-email-notification-active")[0].value;this.model.set("active","1"===i?!0:!1);var l=this.el.querySelectorAll(".form-email-notification-from-type")[0].value;this.model.set("fromType",l);var s=this.el.querySelectorAll(".form-email-notification-from-address")[0].value;this.model.set("fromAddress",s);var o=this.el.querySelectorAll(".form-email-notification-from-field")[0].value;this.model.set("fromField",o);var n=this.el.querySelectorAll(".form-email-notification-from-name-type")[0].value;this.model.set("fromNameType",n);var c=this.el.querySelectorAll(".form-email-notification-from-name")[0].value;this.model.set("fromName",c);var r=this.el.querySelectorAll(".form-email-notification-from-name-field")[0].value;this.model.set("fromNameField",r);var a=this.el.querySelectorAll(".form-email-notification-subject-type")[0].value;this.model.set("subjectType",a);var d=this.el.querySelectorAll(".form-email-notification-subject")[0].value;this.model.set("subject",d);var u=this.el.querySelectorAll(".form-email-notification-subject-field")[0].value;this.model.set("subjectField",u);for(var f=0;this.addressViews.length>f;f++)this.addressViews[f].save();return this}},render:function(){var e={context:this.context,form:this.form.toJSON()};if(this.model&&(e.notification=this.model.toJSON()),this.el.innerHTML=this.template(e),"edit"===this.context){this.toggleNotificationFields(),this.updateFromFieldField(),this.updateFieldVariables();var t=this.el.querySelectorAll(".addresses")[0],i=this.model.get("addresses");if(i.length>=1)i.each(function(e){var i=new wp.ccf.views.FormNotificationAddress({model:e,parent:this,notification:this.model,form:this.form}).render();t.appendChild(i.el),this.addressViews.push(i)},this);else{var l=new wp.ccf.models.FormNotificationAddress;i.add(l)}}var s=this.form.get("fields");return this.listenTo(s,"add",this.updateFromFieldField,this),this.listenTo(s,"remove",this.updateFromFieldField,this),this.listenTo(s,"add",this.updateFieldVariables,this),this.listenTo(s,"remove",this.updateFieldVariables,this),this},triggerDelete:function(){this.parent.deleteNotification(this)}}),wp.ccf.views.FieldBase=wp.ccf.views.FieldBase||t.View.extend({events:{"blur input":"saveField","blur input.field-slug":"checkSlug","blur textarea":"saveField","change select":"saveField",'change input[type="checkbox"]':"saveField"},initialize:function(){var e=this.model.get("conditionals");this.listenTo(e,"add",this.addConditional)},addConditional:function(e){var t=new wp.ccf.views.FieldConditional({model:e,field:this.model,fieldCollection:this.collection}).render(),i=this.el.querySelectorAll(".conditionals")[0];i.appendChild(t.el)},checkSlug:function(){var e=this.el.querySelectorAll(".field-slug");if(e.length>0){var t=e[0],i=!1;t.parentNode.className=t.value&&!t.value.match(/^[a-zA-Z0-9\-_]+$/)?t.parentNode.className.replace(/ field-error/i,"")+" field-error":t.parentNode.className.replace(/ field-error/i,""),this.collection.length>0&&""!==t.value?(this.collection.each(function(e){e!==this.model&&t.value===e.get("slug")&&(i=!0)
|
2 |
+
},this),t.parentNode.className=i?t.parentNode.className.replace(/ field-duplicate-slug/i,"")+" field-duplicate-slug":t.parentNode.className.replace(/ field-duplicate-slug/i,"")):t.parentNode.className=t.parentNode.className.replace(/ field-duplicate-slug/i,"")}},destroy:function(){this.unbind()},saveField:function(){var t=this.el.querySelectorAll(".conditionals")[0].querySelectorAll(".conditional");i.each(t,function(t){e(t).trigger("saveConditional")}),this.model.set("conditionalType",this.el.querySelectorAll(".field-conditional-type")[0].value),this.model.set("conditionalFieldsRequired",this.el.querySelectorAll(".field-conditional-fields-required")[0].value);var l=this.model.get("conditionalsEnabled");this.model.set("conditionalsEnabled",1==this.el.querySelectorAll(".field-conditionals-enabled")[0].value?!0:!1),l!==this.model.get("conditionalsEnabled")&&this.render("advanced")},render:function(e){e=e?e:"basic",this.el.innerHTML=this.template({field:this.model.toJSON(),startPanel:e}),this.checkSlug();var t=this.model.get("conditionals"),i=this.el.querySelectorAll(".conditionals")[0];if(t.length>=1)t.each(function(e){var t=new wp.ccf.views.FieldConditional({model:e,field:this.model,fieldCollection:this.collection}).render();i.appendChild(t.el)},this);else{var l=new wp.ccf.models.FieldConditional;t.add(l)}return this}}),wp.ccf.views.Fields["single-line-text"]=wp.ccf.views.Fields["single-line-text"]||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-single-line-text-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("placeholder",this.el.querySelectorAll(".field-placeholder")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this.constructor.__super__.saveField.apply(this,arguments),this):void 0}}),wp.ccf.views.Fields.file=wp.ccf.views.Fields.file||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-file-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this.model.set("fileExtensions",this.el.querySelectorAll(".field-file-extensions")[0].value),this.model.set("maxFileSize",this.el.querySelectorAll(".field-max-file-size")[0].value),this.constructor.__super__.saveField.apply(this,arguments),this):void 0}}),wp.ccf.views.Fields.recaptcha=wp.ccf.views.Fields.recaptcha||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-recaptcha-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("siteKey",this.el.querySelectorAll(".field-site-key")[0].value),this.model.set("secretKey",this.el.querySelectorAll(".field-secret-key")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.constructor.__super__.saveField.apply(this,arguments),this):void 0}}),wp.ccf.views.Fields["section-header"]=wp.ccf.views.Fields["section-header"]||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-section-header-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("heading",this.el.querySelectorAll(".field-heading")[0].value),this.model.set("subheading",this.el.querySelectorAll(".field-subheading")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.constructor.__super__.saveField.apply(this,arguments),this):void 0}}),wp.ccf.views.Fields.html=wp.ccf.views.Fields.html||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-html-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("html",this.el.querySelectorAll(".field-html")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.constructor.__super__.saveField.apply(this,arguments),this):void 0}}),wp.ccf.views.Fields["paragraph-text"]=wp.ccf.views.Fields["paragraph-text"]||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-paragraph-text-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("placeholder",this.el.querySelectorAll(".field-placeholder")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this.constructor.__super__.saveField.apply(this,arguments),this):void 0}}),wp.ccf.views.Fields.hidden=wp.ccf.views.Fields.hidden||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-hidden-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.constructor.__super__.saveField.apply(this,arguments),this):void 0}}),wp.ccf.views.Fields.date=wp.ccf.views.Fields.date||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-date-template"),saveField:function(){if(""!==this.el.innerHTML){this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.constructor.__super__.saveField.apply(this,arguments);var e=this.el.querySelectorAll(".field-value");e.length>0&&this.model.set("value",e[0].value);var t=this.el.querySelectorAll(".field-date-format");t.length&&this.model.set("dateFormat",t[0].value);var i=this.model.get("showDate"),l=this.el.querySelectorAll(".field-show-date")[0].checked?!0:!1;this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("showDate",l);var s=this.model.get("showTime"),o=this.el.querySelectorAll(".field-show-time")[0].checked?!0:!1;return this.model.set("showTime",o),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),(o!=s||l!=i)&&this.render(),this}}}),wp.ccf.views.Fields.name=wp.ccf.views.Fields.name||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-name-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this.constructor.__super__.saveField.apply(this,arguments),this):void 0}}),wp.ccf.views.Fields.website=wp.ccf.views.Fields.website||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-website-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("placeholder",this.el.querySelectorAll(".field-placeholder")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this.constructor.__super__.saveField.apply(this,arguments),this):void 0}}),wp.ccf.views.Fields.phone=wp.ccf.views.Fields.phone||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-phone-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("placeholder",this.el.querySelectorAll(".field-placeholder")[0].value),this.model.set("phoneFormat",this.el.querySelectorAll(".field-phone-format")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this.constructor.__super__.saveField.apply(this,arguments),this):void 0}}),wp.ccf.views.Fields.address=wp.ccf.views.Fields.address||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-address-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("addressType",this.el.querySelectorAll(".field-address-type")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this.constructor.__super__.saveField.apply(this,arguments),this):void 0}}),wp.ccf.views.Fields.email=wp.ccf.views.Fields.email||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-email-template"),saveField:function(){if(""!==this.el.innerHTML){this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.constructor.__super__.saveField.apply(this,arguments);var e=this.el.querySelectorAll(".field-value");e.length&&this.model.set("value",e[0].value);var t=this.el.querySelectorAll(".field-placeholder");t.length&&this.model.set("placeholder",t[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1);var i=1==this.el.querySelectorAll(".field-email-confirmation")[0].value?!0:!1,l=this.model.get("emailConfirmation");return this.model.set("emailConfirmation",i),l!=i&&this.render(),this}}}),wp.ccf.views.ChoiceableField=wp.ccf.views.ChoiceableField||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-dropdown-template"),initialize:function(){var e=this.model.get("choices");this.listenTo(e,"add",this.addChoice)},addChoice:function(e){var t=new wp.ccf.views.FieldChoice({model:e,field:this.model}).render(),i=this.el.querySelectorAll(".repeatable-choices")[0];i.appendChild(t.el)},saveField:function(){if(""!==this.el.innerHTML){this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),wp.ccf.views.ChoiceableField.__super__.saveField.apply(this,arguments);var t=this.el.querySelectorAll(".repeatable-choices")[0].querySelectorAll(".choice");return i.each(t,function(t){e(t).trigger("saveChoice")}),this}},render:function(t){var i=this;t=t?t:"basic",i.el.innerHTML=i.template({field:i.model.toJSON(),startPanel:t}),i.checkSlug();var l=i.model.get("choices"),s=this.el.querySelectorAll(".repeatable-choices")[0];if(l.length>=1)l.each(function(e){var t=new wp.ccf.views.FieldChoice({model:e,field:i.model}).render();s.appendChild(t.el)});else{var o=new wp.ccf.models.FieldChoice;l.add(o)}s=this.el.querySelectorAll(".repeatable-choices")[0],e(s).sortable({handle:".move",axis:"y",stop:function(e,t){t.item.trigger("sorted",t.item.index())}});var n=this.model.get("conditionals"),c=this.el.querySelectorAll(".conditionals")[0];if(n.length>=1)n.each(function(e){var t=new wp.ccf.views.FieldConditional({model:e,field:this.model,fieldCollection:this.collection}).render();c.appendChild(t.el)},this);else{var r=new wp.ccf.models.FieldConditional;n.add(r)}return i}}),wp.ccf.views.Fields.dropdown=wp.ccf.views.Fields.dropdown||wp.ccf.views.ChoiceableField.extend({template:wp.ccf.utils.template("ccf-dropdown-template"),events:function(){return this.constructor.__super__.events}}),wp.ccf.views.Fields.radio=wp.ccf.views.Fields.radio||wp.ccf.views.ChoiceableField.extend({template:wp.ccf.utils.template("ccf-radio-template"),events:function(){return this.constructor.__super__.events}}),wp.ccf.views.Fields.checkboxes=wp.ccf.views.Fields.checkboxes||wp.ccf.views.ChoiceableField.extend({template:wp.ccf.utils.template("ccf-checkboxes-template"),events:function(){return this.constructor.__super__.events}}),wp.ccf.views.FieldSidebar=wp.ccf.views.FieldSidebar||t.View.extend({initialize:function(e){this.currentFieldView=null,this.form=e.form},save:function(e){this.currentFieldView&&""!==this.currentFieldView.el.innerHTML&&this.currentFieldView.saveField(),e&&e instanceof Object&&e.resolve()},fieldRemoved:function(){this.currentFieldView&&(this.form.get("fields").get(this.currentFieldView.model)||this.render())},destroy:function(){wp.ccf.dispatcher.off("saveField",this.save),wp.ccf.dispatcher.off("mainViewChange",this.save),this.unbind()},render:function(e){var t={};if(e){var i=e.get("type");this.currentFieldView&&(this.currentFieldView.saveField(),this.currentFieldView.destroy&&this.currentFieldView.destroy()),this.currentFieldView=new wp.ccf.views.Fields[i]({model:e,collection:this.form.get("fields")}),this.currentFieldView.render(),this.el.innerHTML="",this.el.appendChild(this.currentFieldView.el);var l=this.form.get("fields");this.listenTo(l,"remove",this.fieldRemoved)}else{var s=wp.ccf.utils.template("ccf-empty-field-template");this.el.innerHTML=s(t)}return wp.ccf.dispatcher.on("saveField",this.save,this),wp.ccf.dispatcher.on("mainViewChange",this.save,this),this}}),wp.ccf.views.FieldRowPlaceholder=wp.ccf.views.FieldRowPlaceholder||t.View.extend({template:wp.ccf.utils.template("ccf-field-row-template"),tagName:"div",className:"field",initialize:function(e){this.type=e.type},render:function(){return this.el.innerHTML=this.template({label:l.allLabels[this.type]}),this.el.setAttribute("data-field-type",this.type),this.el.className+=" "+this.type,this}}),wp.ccf.views.FieldRow=wp.ccf.views.FieldRow||t.View.extend({template:wp.ccf.utils.template("ccf-field-row-template"),tagName:"div",className:"field",events:{"click .delete":"triggerDelete","click h4":"triggerEdit",sorted:"triggerUpdateSort"},initialize:function(e){i.bindAll(this,"triggerDelete"),this.form=e.form,this.listenTo(this.model,"change",this.handleChange,this),this.listenTo(this.model,"requirementsNotMet",this.requirementsNotMet,this),this.listenTo(this.model,"requirementsMet",this.requirementsMet,this),this.listenTo(this.model,"duplicateSlug",this.duplicateSlug,this),this.model.attributes.choices&&this.listenTo(this.model.attributes.choices,"change",this.handleChange,this)},duplicateSlug:function(){this.requirementsMet(),this.el.className+=" field-duplicate-slug"},requirementsNotMet:function(){this.requirementsMet(),this.el.className+=" field-incomplete"},requirementsMet:function(){this.el.className=this.el.className.replace(/(field-incomplete|field-duplicate-slug)/i,"")},triggerUpdateSort:function(e,t){this.form.get("fields").remove(this.model),this.form.get("fields").add(this.model,{at:t})},handleChange:function(){this.render()},triggerDelete:function(e){e.stopPropagation(),this.form.get("fields").remove(this.model),this.undelegateEvents(),this.remove()},triggerEdit:function(){var e=this.el.parentNode.querySelectorAll(".ccf-editing");i.each(e,function(e){e.className=e.className.replace(/ccf-editing/i,"")}),this.el.className=this.el.className.replace(/ccf-editing/i,"")+" ccf-editing",wp.ccf.dispatcher.trigger("openEditField",this.model)},render:function(e){this.el.innerHTML=this.template({label:l.allLabels[this.model.get("type")]}),this.el.setAttribute("data-field-type",this.model.get("type"));var t=RegExp(" "+this.model.get("type"),"i");this.el.className=this.el.className.replace(t,"")+" "+this.model.get("type"),e&&(this.el.className=this.el.className.replace(/ instantiated/i,"")+" instantiated");var i=document.getElementById("ccf-"+this.model.get("type")+"-preview-template");if(i){var s=this.el.querySelectorAll(".preview")[0];s.style.display="block",s.innerHTML=wp.ccf.utils.template("ccf-"+this.model.get("type")+"-preview-template")({field:this.model.toJSON()})}return this}}),wp.ccf.views.PostFieldMapping=t.View.extend({template:wp.ccf.utils.template("ccf-post-field-mapping"),className:"field-mapping",events:{"click .add":"triggerAdd","click .delete":"triggerDelete","blur input":"save","change select":"save"},initialize:function(e){this.parent=e.parent,this.form=e.form},destroy:function(){this.unbind()},save:function(){if(""!==this.el.innerHTML){var e=this.el.querySelectorAll(".field-form-field")[0].value,t=this.el.querySelectorAll(".field-post-field")[0].value,i=this.el.querySelectorAll(".field-custom-field-key"),l=this.model.get("postField");return this.model.set("formField",e),this.model.set("postField",t),i.length&&this.model.set("customFieldKey",i[0].value),l!==t&&this.render(),this}},updateFormFieldField:function(){var e=this.el.querySelectorAll(".field-form-field")[0];e.innerHTML="",e.disabled=!1;var t,i=this.form.get("fields"),s=0,o=this.model.get("formField");i.length>=1&&(t=document.createElement("option"),t.innerHTML=l.chooseFormField,t.value="",e.appendChild(t),i.each(function(i){t=document.createElement("option"),t.innerHTML=i.get("slug"),t.value=i.get("slug"),i.get("slug")===o&&(t.selected=!0),e.appendChild(t),s++})),0===s&&(t=document.createElement("option"),t.innerHTML=l.noAvailableFields,t.value="",e.appendChild(t),e.disabled=!0)},updatePostFields:function(){var e,t=this.el.querySelectorAll(".field-post-field")[0];e=document.createElement("option"),e.value="",e.innerText=l.choosePostField,t.appendChild(e);var s=this.form.get("postFieldMappings"),o=[];s.each(function(e){e!==this.model&&o.push(e.get("postField"))},this),i.each(l.postFields.single,function(i,l){-1===o.indexOf(l)&&(e=document.createElement("option"),e.value=l,e.innerText=i,this.model.get("postField")===l&&(e.selected=!0),t.appendChild(e))},this),i.each(l.postFields.repeatable,function(i,l){e=document.createElement("option"),e.value=l,e.innerText=i,this.model.get("postField")===l&&(e.selected=!0),t.appendChild(e)},this)},render:function(){var e={};this.model&&(e.mapping=this.model.toJSON()),this.el.innerHTML=this.template(e);var t=this.form.get("fields");return this.listenTo(t,"add",this.updateFormFieldField,this),this.listenTo(t,"remove",this.updateFormFieldField,this),this.updateFormFieldField(),this.updatePostFields(),this},triggerAdd:function(){this.form.get("postFieldMappings").add(new wp.ccf.models.PostFieldMapping)},triggerDelete:function(){var e=this.form.get("postFieldMappings");e.length>1?this.parent.deletePostFieldMapping(this):(this.model.clear().set(wp.ccf.models.PostFieldMapping.prototype.defaults),this.destroy(),this.render())}}),wp.ccf.views.FormSettings=wp.ccf.views.FormSettings||t.View.extend({template:wp.ccf.utils.template("ccf-form-settings-template"),events:{"blur input":"save","change select":"save","change select.form-completion-action-type":"toggleCompletionFields","change select.form-pause":"togglePauseFields","change select.form-post-creation":"togglePostCreationFields","click .add-notification":"triggerAddNotification"},notificationViews:[],mappingViews:[],initialize:function(e){this.model=e.form,this.notificationViews=[],this.mappingViews=[];var t=this.model.get("notifications");this.listenTo(t,"add",this.addNotification);var i=this.model.get("postFieldMappings");this.listenTo(i,"add",this.addPostFieldMapping)},deletePostFieldMapping:function(e){i.each(this.mappingViews,function(t){if(e.cid===t.cid){var l=i.indexOf(this.mappingViews,t);this.model.get("postFieldMappings").remove(e.model),this.mappingViews[l].remove(),this.mappingViews.splice(l,1)}},this)},addPostFieldMapping:function(e){var t=this.el.querySelectorAll(".post-creation-mapping")[0],i=new wp.ccf.views.PostFieldMapping({model:e,parent:this,form:this.model});this.mappingViews.push(i),t.appendChild(i.render().el)},triggerAddNotification:function(){var e=this.model.get("notifications");e.add(new wp.ccf.models.FormNotification)},closeAllNotifications:function(){i.each(this.notificationViews,function(e){e.changeContext(null,"view")})},addNotification:function(e){var t=new wp.ccf.views.ExistingFormNotificationRow({model:e,form:this.model,context:"edit",parent:this}).render(),l=this.el.querySelectorAll(".ccf-form-notifications .rows")[0];l.querySelectorAll(".no-notifications").length>0&&l.removeChild(l.firstChild),i.each(this.notificationViews,function(e){e.changeContext(null,"view")}),this.notificationViews.push(t),l.appendChild(t.el)},toggleCompletionFields:function(){var e=this.el.querySelectorAll(".form-completion-action-type")[0].value,t=this.el.querySelectorAll(".completion-message")[0],i=this.el.querySelectorAll(".completion-redirect-url")[0];"text"===e?(t.style.display="block",i.style.display="none"):(t.style.display="none",i.style.display="block")},togglePauseFields:function(){var e=this.el.querySelectorAll(".form-pause")[0].value,t=this.el.querySelectorAll(".pause-message")[0];t.style.display=parseInt(e)?"block":"none"},togglePostCreationFields:function(){var t=this.el.querySelectorAll(".form-post-creation")[0].value,i=e(this.el.querySelectorAll(".post-creation-mapping-field"));parseInt(t)?i.show():i.hide()},save:function(){if(""!==this.el.innerHTML){var e=this.el.querySelectorAll(".form-title")[0].value;this.model.set("title",{raw:e});var t=this.el.querySelectorAll(".form-description")[0].value;this.model.set("description",t);var i=this.el.querySelectorAll(".form-button-text")[0].value;this.model.set("buttonText",i);var l=this.el.querySelectorAll(".form-pause")[0].value;this.model.set("pause",parseInt(l)?!0:!1);var s=this.el.querySelectorAll(".form-post-creation")[0].value;this.model.set("postCreation",parseInt(s)?!0:!1);var o=this.el.querySelectorAll(".form-post-creation-type")[0].value;this.model.set("postCreationType",o);var n=this.el.querySelectorAll(".form-post-creation-status")[0].value;this.model.set("postCreationStatus",n);var c=this.el.querySelectorAll(".form-pause-message")[0].value;this.model.set("pauseMessage",c);var r=this.el.querySelectorAll(".form-completion-message")[0].value;this.model.set("completionMessage",r);var a=this.el.querySelectorAll(".form-completion-redirect-url")[0].value;this.model.set("completionRedirectUrl",a);var d=this.el.querySelectorAll(".form-completion-action-type")[0].value;this.model.set("completionActionType",d);var u=this.el.querySelectorAll(".form-theme")[0].value;this.model.set("theme",u)}},fullSave:function(e){""!==this.el.innerHTML&&(this.save(),i.each(this.notificationViews,function(e){e.save()}),i.each(this.mappingViews,function(e){e.save()}),e!==void 0&&e.promise!==void 0&&e.resolve())},destroy:function(){wp.ccf.dispatcher.off("saveFormSettings",this.fullSave),wp.ccf.dispatcher.off("mainViewChange",this.fullSave)},deleteNotification:function(e){if(i.each(this.notificationViews,function(t){if(e.cid===t.cid){var l=i.indexOf(this.notificationViews,t);this.model.get("notifications").remove(e.model),this.notificationViews[l].remove(),this.notificationViews.splice(l,1)}},this),!this.notificationViews.length){var t=this.el.querySelectorAll(".ccf-form-notifications .rows")[0];t.appendChild(new wp.ccf.views.EmptyFormNotificationTableRow({form:this.model}).render().el)}},render:function(){var e={form:this.model.toJSON()};this.model.get("fields");var t=this.model.get("notifications");this.el.innerHTML=this.template(e),this.toggleCompletionFields(),this.togglePostCreationFields(),this.togglePauseFields();var i=this.el.querySelectorAll(".ccf-form-notifications .rows")[0],l=document.createElement("tbody");l.className="rows",t.length>=1?t.each(function(e){var t=new wp.ccf.views.ExistingFormNotificationRow({model:e,form:this.model,parent:this}).render();l.appendChild(t.el),this.notificationViews.push(t)},this):l.appendChild(new wp.ccf.views.EmptyFormNotificationTableRow({form:this.model}).render().el),i.parentNode.replaceChild(l,i);var s=this.el.querySelectorAll(".post-creation-mapping")[0],o=this.model.get("postFieldMappings");if(o.length>=1)o.each(function(e){var t=new wp.ccf.views.PostFieldMapping({model:e,parent:this,form:this.model}).render();s.appendChild(t.el),this.mappingViews.push(t)},this);else{var n=new wp.ccf.models.PostFieldMapping;o.add(n)}return wp.ccf.dispatcher.on("mainViewChange",this.fullSave,this),wp.ccf.dispatcher.on("saveFormSettings",this.fullSave,this),this}}),wp.ccf.views.FormPane=wp.ccf.views.FormPane||t.View.extend(i.defaults({template:wp.ccf.utils.template("ccf-form-pane-template"),subViews:{"field-sidebar":wp.ccf.views.FieldSidebar,"form-settings":wp.ccf.views.FormSettings},events:{"click .save-button":"sync","click .signup-button":"signup","click .accordion-heading":"accordionClick","click .form-settings-heading":"accordionClick","click .insert-form-button":"insertForm"},initialize:function(){wp.ccf.dispatcher.on("openEditField",this.openEditField,this)},insertForm:function(){wp.ccf.utils.insertFormShortcode(this.model),wp.ccf.toggle()},signup:function(){var t=this.el.querySelectorAll(".email-signup-field")[0].value,i=this.el.querySelectorAll(".bottom .left.signup")[0];i.className="left signup",t?e.ajax({url:"//taylorlovett.us8.list-manage.com/subscribe/post-json?u=66118f9a5b0ab0414e83f043a&id=b4ed816a24&c=?",method:"post",dataType:"jsonp",data:{EMAIL:t}}).done(function(){i.className="left signup signup-success"}):i.className="left signup signup-error"},accordionClick:function(t){var l=e(t.currentTarget).parents(".accordion-container")[0],s=l.querySelectorAll(".accordion-section");t.currentTarget.parentNode.className.match(/expanded/i)?t.currentTarget.parentNode.className=t.currentTarget.parentNode.className.replace(/expanded/i,""):t.currentTarget.parentNode.className+=" expanded",i.each(s,function(e){e!=t.currentTarget.parentNode&&e.className.match(/expanded/i)&&(e.className=e.className.replace(/expanded/i,""))}),t.currentTarget.className.match(/form-settings-heading/i)?this.el.className.match(/show-form-settings/i)?this.el.className=this.el.className.replace(/show-form-settings/i,""):this.el.className+=" show-form-settings":this.el.className=this.el.className.replace(/show-form-settings/i,"")},openEditField:function(e){this.renderedSubViews["field-sidebar"].render(e).el.style.display="block"},disable:function(){this.el.querySelectorAll(".save-button")[0].setAttribute("disabled","disabled"),this.el.querySelectorAll(".disabled-overlay")[0].style.display="block"},enable:function(){this.el.querySelectorAll(".save-button")[0].removeAttribute("disabled"),this.el.querySelectorAll(".disabled-overlay")[0].style.display="none"},sync:function(){var t=this,i=e(this.el.querySelectorAll(".spinner")[0]);i.fadeIn(),t.disable();var s=e.Deferred(),o=e.Deferred();wp.ccf.dispatcher.trigger("saveFormSettings",s),wp.ccf.dispatcher.trigger("saveField",o),e.when(s,o).then(function(){var e=t.model.get("fields"),s=!0,o={};e.each(function(e){var t=e.get("slug");e.hasRequiredAttributes()?t&&!t.match(/^[a-zA-Z0-9\-_]+$/)?(s=!1,e.trigger("requirementsNotMet")):o[e.get("slug")]!==void 0?(s=!1,e.trigger("duplicateSlug"),o[e.get("slug")].trigger("duplicateSlug")):e.trigger("requirementsMet"):(s=!1,e.trigger("requirementsNotMet")),e.get("slug")&&(o[e.get("slug")]=e)}),s?t.model.save({},{context:"edit"}).error(function(){var e="sync";wp.ccf.errorModal.render(e).show()}).done(function(){l.single&&!l.postId&&(window.location=l.adminUrl+"post.php?post="+t.model.get("id")+"&action=edit#ccf-form/"+t.model.get("id"))}).complete(function(){i.fadeOut(),t.enable(),wp.ccf.dispatcher.trigger("saveFormComplete",t.model)}):(t.enable(),i.fadeOut())})},enableDisableInsert:function(){var e=this.el.querySelectorAll(".insert-form-button")[0];this.model.get("id")?e.removeAttribute("disabled"):e.setAttribute("disabled","disabled")},getNextFieldOrd:function(){var e=this.model.get("fields"),t=e.length+1;return e.each(function(e){var i=e.get("slug"),l=/\-([0-9]+)$/g,s=l.exec(i);if(s&&s[1]){var o=parseInt(s[1]);o>=t&&(t=o+1)}}),t},render:function(t){var s=this;s.model=t?t:new wp.ccf.models.Form,this.listenTo(s.model,"change",this.enableDisableInsert,this);var o={labels:l.fieldLabels,form:s.model.toJSON()};window.form=s.model,s.el.innerHTML=this.template(o),s.el.className=s.el.className.replace(/show-form-settings/i,"");var n=s.el.querySelectorAll(".fields")[0];i.each(l.fieldLabels,function(e,t){n.appendChild(new wp.ccf.views.FieldRowPlaceholder({type:t}).render().el)});var c=s.el.querySelectorAll(".structure-fields")[0];i.each(l.structureFieldLabels,function(e,t){c.appendChild(new wp.ccf.views.FieldRowPlaceholder({type:t}).render().el)});var r=s.el.querySelectorAll(".special-fields")[0];i.each(l.specialFieldLabels,function(e,t){r.appendChild(new wp.ccf.views.FieldRowPlaceholder({type:t}).render().el)});var a=s.model.get("fields"),d=s.el.querySelectorAll(".form-content")[0],u=e(d);return e(s.el.querySelectorAll(".left-sidebar")[0].querySelectorAll(".field")).draggable({cursor:"move",distance:2,zIndex:160001,scroll:!1,containment:"document",appendTo:".ccf-main-modal",snap:!1,connectToSortable:".form-content",helper:function(t){var i=e(t.currentTarget),l=e('<div class="field" data-field-type="'+i.attr("data-field-type")+'"><h4>'+i.find(".label").html()+"</h4></div>");return l.css({width:u.width(),opacity:".75",height:i.height()})}}),a.length>=1&&(d.innerHTML="",a.each(function(e){var t=new wp.ccf.views.FieldRow({model:e,form:s.model}).render(!0).el;d.appendChild(t)})),e(d).sortable({axis:"y",distance:2,handle:"h4",placeholder:"field-placeholder",stop:function(e,t){if(!t.item.hasClass("instantiated")){var i=t.item.attr("data-field-type"),l={};wp.ccf.models.Fields[i].prototype.defaults().slug!==void 0&&(l.slug=i+"-"+s.getNextFieldOrd());var o=new wp.ccf.models.Fields[i](l),n=s.model.get("fields");n.add(o),new wp.ccf.views.FieldRow({model:o,el:t.item,form:s.model}).render(!0),t.item.attr("style","")}t.item.trigger("sorted",t.item.index())}}),s.initRenderSubViews(!1,!0,{form:s.model}),s.enableDisableInsert(),s}},wp.ccf.mixins.subViewable)),wp.ccf.views.ExistingFormTableRow=wp.ccf.views.ExistingFormTableRow||t.View.extend({tagName:"tr",template:wp.ccf.utils.template("ccf-existing-form-table-row-template"),events:{"click .edit":"triggerMainViewChange","click .delete":"triggerDelete","click .insert-form-button":"insertForm"},initialize:function(e){this.parent=e.parent
|
3 |
+
},insertForm:function(){wp.ccf.utils.insertFormShortcode(this.model),wp.ccf.toggle()},triggerMainViewChange:function(){wp.ccf.switchToForm(this.model)},triggerDelete:function(){var e,t=this,i=t.parent.collection.state.currentPage;t.model.destroy().done(function(){e=i,e===t.parent.collection.state.totalPages&&e-1===(t.parent.collection.state.totalObjects-1)/l.postsPerPage&&e--,t.parent.showPage(e).done(function(){t.parent.renderPagination()})})},render:function(){return this.$el.html(this.template({form:this.model.toJSON(),utils:{getPrettyPostDate:wp.ccf.utils.getPrettyPostDate}})),this}}),wp.ccf.views.EmptyFormTableRow=wp.ccf.views.EmptyFormTableRow||t.View.extend({tagName:"tr",template:wp.ccf.utils.template("ccf-empty-form-table-row-template"),render:function(){return this.$el.html(this.template()),this}}),wp.ccf.views.ExistingFormTable=wp.ccf.views.ExistingFormTable||t.View.extend({template:wp.ccf.utils.template("ccf-existing-form-table-template"),initialize:function(){this.parent=arguments.parent,this.collection=new wp.ccf.collections.Forms,wp.ccf.dispatcher.on("changeFormTablePage",this.showPage,this),wp.ccf.dispatcher.on("saveFormComplete",this.render,this)},showPage:function(e){var t=this,i=this.collection.fetch({data:{page:e}});return i.error(function(){var e="sync";wp.ccf.errorModal.render(e).show()}),i.done(function(){var e=t.el.querySelectorAll(".rows")[0],i=document.createElement("tbody");i.className="rows",t.collection.length>=1?t.collection.each(function(e){var l=new wp.ccf.views.ExistingFormTableRow({model:e,parent:t}).render();i.appendChild(l.el)},t):i.appendChild((new wp.ccf.views.EmptyFormTableRow).render().el),e.parentNode.replaceChild(i,e)}),i},renderPagination:function(){var e=this.el.querySelectorAll(".ccf-pagination")[0];e.innerHTML="",this.collection.state.totalPages>1&&e.appendChild(new wp.ccf.views.Pagination({parent:this}).render(this.collection.state.totalPages,this.collection.state.currentPage).el)},render:function(){var e=this;return this.el.innerHTML=this.template(),this.el.querySelectorAll(".ccf-pagination")[0],this.showPage(1).done(function(){e.renderPagination()}),this}}),wp.ccf.views.ExistingFormPane=wp.ccf.views.ExistingFormPane||t.View.extend(i.defaults({template:wp.ccf.utils.template("ccf-existing-form-pane-template"),subViews:{"existing-form-table":wp.ccf.views.ExistingFormTable},render:function(){return this.rendered?this:(this.rendered=!0,this.el.innerHTML=this.template(),this.initRenderSubViews(!0),this)}},wp.ccf.mixins.subViewable)),wp.ccf.views.MainModal=wp.ccf.views.MainModal||t.View.extend(i.defaults({tagName:"div",className:"ccf-main-modal",template:wp.ccf.utils.template("ccf-main-modal-template"),events:{"click .close-icon":"hide","click .main-menu a":"menuClick"},subViews:{"form-pane":wp.ccf.views.FormPane},initialize:function(){l.single||(this.subViews["existing-form-pane"]=wp.ccf.views.ExistingFormPane),wp.ccf.dispatcher.on("mainViewChange",this.toggleView,this)},toggleView:function(e){this.showView(e,wp.ccf.currentForm);var t=e;"form-pane"===e&&wp.ccf.currentForm&&(t="existing-form-pane");var l=this.el.querySelectorAll(".menu-item");i.each(l,function(e){var i=e.getAttribute("data-view");e.className=i===t?e.className.replace("selected","")+" selected":e.className.replace("selected","")})},menuClick:function(e){var t=e.target.getAttribute("data-view");"form-pane"===t&&(wp.ccf.currentForm=null),wp.ccf.dispatcher.trigger("mainViewChange",t),e.preventDefault()},render:function(e){return e=e||!1,this.overlay(),this.el.innerHTML=this.template({single:e}),this.initRenderSubViews(),this.showView("form-pane",wp.ccf.currentForm,!0),this},overlay:function(){return this.overlayEl===void 0&&(this.overlayEl=document.createElement("div"),this.overlayEl.className="ccf-main-modal-overlay",document.body.appendChild(this.overlayEl)),this.overlayEl},remove:function(){return document.body.removeChild(this.overlay()),this},show:function(){e(this.overlay()).show(),this.$el.show()},hide:function(){e(this.overlay()).hide(),this.$el.hide()}},wp.ccf.mixins.subViewable)),wp.ccf.views.SubmissionRow=wp.ccf.views.SubmissionRow||t.View.extend({tagName:"tr",template:wp.ccf.utils.template("ccf-submission-row-template"),events:{"click .view":"view","click .delete":"delete"},initialize:function(e){this.parent=e.parent},"delete":function(){var e,t=this,i=t.parent.collection.state.currentPage;t.model.destroy().done(function(){e=i,e===t.parent.collection.state.totalPages&&e-1===(t.parent.collection.state.totalObjects-1)/l.postsPerPage&&e--,t.parent.showPage(e).done(function(){t.parent.renderPagination()})})},view:function(e){var t=e.currentTarget.getAttribute("data-submission-id"),i=e.currentTarget.getAttribute("data-submission-date");tb_show(l.thickboxTitle+" - "+wp.ccf.utils.getPrettyPostDate(i),"#TB_inline?height=500&width=700&inlineId=ccf-submission-content-"+parseInt(t),null)},render:function(){return this.$el.html(this.template({submission:this.model.toJSON(),currentColumns:this.parent.columns,columns:wp.ccf.currentForm.getFieldSlugs(!0),utils:{getPrettyPostDate:wp.ccf.utils.getPrettyPostDate,wordChop:wp.ccf.utils.wordChop,isFieldDate:wp.ccf.utils.isFieldDate,isFieldName:wp.ccf.utils.isFieldName,isFieldFile:wp.ccf.utils.isFieldFile,isFieldAddress:wp.ccf.utils.isFieldAddress,isFieldEmailConfirm:wp.ccf.utils.isFieldEmailConfirm,getPrettyFieldDate:wp.ccf.utils.getPrettyFieldDate,getPrettyFieldAddress:wp.ccf.utils.getPrettyFieldAddress,getPrettyFieldName:wp.ccf.utils.getPrettyFieldName,getPrettyFieldEmailConfirm:wp.ccf.utils.getPrettyFieldEmailConfirm}})),this}}),wp.ccf.views.SubmissionsTable=wp.ccf.views.SubmissionsTable||t.View.extend({template:wp.ccf.utils.template("ccf-submission-table-template"),events:{"click .prev:not(.disabled)":"previousPage","click .next:not(.disabled)":"nextPage","click .first:not(.disabled)":"firstPage","click .last:not(.disabled)":"lastPage"},initialize:function(){this.collection=new wp.ccf.collections.Submissions({},{formId:l.postId}),wp.ccf.dispatcher.on("submissionTableRebuild",this.render,this)},showPage:function(e){var t=this,i=this.collection.fetch({data:{page:e}});return i.error(function(){var e="sync";wp.ccf.errorModal.render(e).show()}),i.done(function(){var e=t.el.querySelectorAll(".submission-rows")[0],i=document.createElement("tbody");i.className="submission-rows",t.collection.length>=1?t.collection.each(function(e){var l=new wp.ccf.views.SubmissionRow({model:e,parent:t}).render();i.appendChild(l.el)},t):i.appendChild(new wp.ccf.views.EmptySubmissionTableRow({parent:t}).render(wp.ccf.currentForm.getFieldSlugs(!0).concat("date")).el),e.parentNode.replaceChild(i,e)}),i},renderPagination:function(){var e=this.el.querySelectorAll(".ccf-pagination")[0];e.innerHTML="",this.collection.state.totalPages>1&&e.appendChild(new wp.ccf.views.Pagination({parent:this}).render(this.collection.state.totalPages,this.collection.state.currentPage).el)},render:function(e){var t=this;return t.columns=e?e:wp.ccf.currentForm.getFieldSlugs(!0).slice(0,4).concat("date"),1>t.columns.length?t.el.innerHTML="":(t.el.innerHTML=t.template({columns:t.columns}),t.el.querySelectorAll(".ccf-pagination")[0],t.showPage(1).done(function(){t.renderPagination()})),t}}),wp.ccf.views.ErrorModal=wp.ccf.views.ErrorModal||t.View.extend({template:wp.ccf.utils.template("ccf-error-modal-template"),tagName:"div",className:"ccf-error-modal",events:{"click .close":"hide"},hide:function(){this.el.className=this.el.className.replace(" show","")},show:function(){this.el.className=this.el.className.replace(" show","")+" show"},toggle:function(){this.el.className.match(" show")?this.hide():this.show()},render:function(e){var t={messageType:""};return e&&(t.messageType=e),this.el.innerHTML=this.template(t),this}}),wp.ccf.views.Pagination=wp.ccf.views.Pagination||t.View.extend({template:wp.ccf.utils.template("ccf-pagination-template"),events:{"click .prev:not(.disabled)":"previousPage","click .next:not(.disabled)":"nextPage","click .first:not(.disabled)":"firstPage","click .last:not(.disabled)":"lastPage"},initialize:function(e){this.parent=e.parent},previousPage:function(){var e=this;e.parent.showPage(e.parent.collection.state.currentPage-1).done(function(){e.render()})},nextPage:function(){var e=this;e.parent.showPage(e.parent.collection.state.currentPage+1).done(function(){e.render()})},firstPage:function(){var e=this;e.parent.showPage(1).done(function(){e.render()})},lastPage:function(){var e=this;e.parent.showPage(e.parent.collection.state.totalPages).done(function(){e.render()})},render:function(){return this.el.innerHTML=this.template({totalPages:this.parent.collection.state.totalPages,currentPage:this.parent.collection.state.currentPage,totalObjects:this.parent.collection.state.totalObjects}),this}}),wp.ccf.views.EmptySubmissionTableRow=wp.ccf.views.EmptySubmissionTableRow||t.View.extend({tagName:"tr",template:wp.ccf.utils.template("ccf-no-submissions-row-template"),initialize:function(e){this.parent=e.parent},render:function(){return this.el.innerHTML=this.template({columns:this.parent.columns}),this}}),wp.ccf.views.SubmissionColumnController=wp.ccf.views.SubmissionColumnController||t.View.extend({template:wp.ccf.utils.template("ccf-submissions-controller-template"),events:{"click input[type=checkbox]":"triggerTableRebuild"},render:function(){this.el.innerHTML=this.template({columns:wp.ccf.currentForm.getFieldSlugs(!0).concat("date")})},triggerTableRebuild:function(){var e=[],t=document.querySelectorAll(".submission-column-checkbox");if(t.length>=1)for(var i=0;t.length>i;i++)t[i].checked&&e.push(t[i].value);wp.ccf.dispatcher.trigger("submissionTableRebuild",e)}})}(jQuery,Backbone,_,ccfSettings),function(e,t){"use strict";wp.ccf.router=wp.ccf.router||t.Router.extend({routes:{"ccf-form":"open","ccf-form/:formId":"open"},open:function(e){wp.ccf.show(e)}})}(jQuery,Backbone,_,ccfSettings),function(e,t,i,l){"use strict";wp.ccf=i.defaults(wp.ccf,{forms:new wp.ccf.collections.Forms,currentForm:null,errorModal:null,_currentFormDeferred:null,dispatcher:{},show:function(e){return this.switchToForm(e),this.instance.show(),this.instance},initErrorModal:function(){this.errorModal=(new wp.ccf.views.ErrorModal).render();var e=document.getElementsByTagName("body")[0];e.appendChild(this.errorModal.el)},switchToForm:function(e){var t=this;if(+e===parseInt(e)){var i=parseInt(e);if(e=t.forms.findWhere({id:parseInt(i)}),!e){var l;return t.forms.formsFetching[i]!==void 0?(l=t.forms.formsFetching[i],e=null):(e=new wp.ccf.models.Form({id:i}),l=e.fetch(),t.forms.formsFetching[i]=l),l.done(function(){e?(delete t.forms.formsFetching[i],t.forms.add(e)):e=t.forms.findWhere({id:i}),t.currentForm=e,wp.ccf.dispatcher.trigger("mainViewChange","form-pane")}),l}t.currentForm=e,wp.ccf.dispatcher.trigger("mainViewChange","form-pane")}else t.currentForm=e,wp.ccf.dispatcher.trigger("mainViewChange","form-pane");return!0},hide:function(){return this.instance.hide(),this.instance},toggle:function(e){return this.switchToForm(e),this.instance.$el.is(":visible")?this.instance.hide():this.instance.show(),this.instance},createSubmissionsTable:function(e){var t=document.querySelectorAll(".ccf-submission-column-controller"),i=new wp.ccf.views.SubmissionsTable({el:e});i.render(),t&&new wp.ccf.views.SubmissionColumnController({el:t}).render()},_setupMainModal:function(e){return this.instance=(new wp.ccf.views.MainModal).render(e),document.getElementsByTagName("body")[0].appendChild(this.instance.el),t.history.start(),this.instance},createManager:function(){var s=this,o=document.querySelectorAll(".ccf-open-form-manager")[0];if(!o)return!1;i.extend(this.dispatcher,t.Events),new wp.ccf.router,s.initErrorModal();var n=!1;if(l.single)if(n=!0,l.postId){var c=parseInt(l.postId);if(s.forms.formsFetching[c]===void 0){var r=new wp.ccf.models.Form({id:c}),a=r.fetch();s.forms.formsFetching[c]=a,s._currentFormDeferred=a,a.done(function(){delete s.forms.formsFetching[c],s.forms.add(r),s.currentForm=r})}else s._currentFormDeferred=s.forms.formsFetching[c],s._currentFormDeferred.done(function(){s.currentForm=s.forms.findWhere({id:c})});e.when(s._currentFormDeferred).then(function(){s._setupMainModal(!0),o.style.display="inline-block";var e=document.getElementById("ccf-submissions");if(e){var t=e.querySelectorAll(".inside")[0],i=document.createElement("div");i.className="ccf-submission-icon",i.setAttribute("data-icon","");var n=document.createElement("a");n.href="?action=edit&post="+parseInt(l.postId)+"&download_submissions=1&download_submissions_nonce="+l.downloadSubmissionsNonce,n.className="ccf-submission-icon",n.setAttribute("data-icon","");var c=document.getElementById("show-settings-link");i.onclick=function(){c.click()},e.insertBefore(i,e.firstChild.nextSibling.nextSibling),e.insertBefore(n,e.firstChild.nextSibling.nextSibling),wp.ccf.createSubmissionsTable(t)}})}else s._setupMainModal(!0),o.style.display="inline-block";else s._setupMainModal();var d=function(e){e=e||window.event;var t=e.currentTarget?e.currentTarget:e.srcElement,i=t.getAttribute("data-form-id");wp.ccf.toggle(i)};o.addEventListener?o.addEventListener("click",d,!1):o.attachEvent("onclick",d)}}),wp.ccf.createManager()}(jQuery,Backbone,_,ccfSettings);
|
build/js/form.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(function(e,t){"use strict";window.wp=window.wp||{},wp.ccf=wp.ccf||{},wp.ccf.validators=wp.ccf.validators||{};var i={};window.ccfRecaptchaOnload=function(){for(var e=document.querySelectorAll(".ccf-recaptcha-wrapper"),l=function(l){grecaptcha.render(e[s],{sitekey:e[s].getAttribute("data-sitekey"),theme:t.recaptcha_theme,callback:function(){i[l]=!0}})},s=0;e.length>s;s++){var r=e[s].getAttribute("data-form-id");l(r)}};var l=function(e){if(this.wrapper=e,this.errors={},e.className.match(" field-required")){this.inputs=this.wrapper.querySelectorAll(".field-input");var i=this.wrapper.querySelectorAll(".error");i.length&&i[0].parentNode.removeChild(i[0]);var l=!1;if(_.each(this.inputs,function(e){(e.checked&&e.value||e.selected)&&(l=!0)}),!l){this.errors[this.inputs[this.inputs.length-1].getAttribute("name")]={required:!0};var s=document.createElement("div");s.className="error required-error",s.innerHTML=t.required,e.appendChild(s)}}},s=function(e,i){return function(l){this.wrapper=l,this.inputs=this.wrapper.querySelectorAll(".field-input"),this.errors={};for(var s=this.wrapper.querySelectorAll(".error"),r=s.length-1;r>=0;r--)s[r].parentNode.removeChild(s[r]);_.each(this.inputs,function(t){var i=t.getAttribute("name");this.errors[i]={},t.getAttribute("aria-required")&&""===t.value&&(this.errors[i].required=t),e&&e.call(this,t)},this),i&&i.call(this);var o;for(var
|
1 |
+
(function(e,t){"use strict";window.wp=window.wp||{},wp.ccf=wp.ccf||{},wp.ccf.validators=wp.ccf.validators||{};var i={};window.ccfRecaptchaOnload=function(){for(var e=document.querySelectorAll(".ccf-recaptcha-wrapper"),l=function(l){grecaptcha.render(e[s],{sitekey:e[s].getAttribute("data-sitekey"),theme:t.recaptcha_theme,callback:function(){i[l]=!0}})},s=0;e.length>s;s++){var r=e[s].getAttribute("data-form-id");l(r)}};var l=function(e){if(this.wrapper=e,this.errors={},e.className.match(" field-required")){this.inputs=this.wrapper.querySelectorAll(".field-input");var i=this.wrapper.querySelectorAll(".error");i.length&&i[0].parentNode.removeChild(i[0]);var l=!1;if(_.each(this.inputs,function(e){(e.checked&&e.value||e.selected)&&(l=!0)}),!l){this.errors[this.inputs[this.inputs.length-1].getAttribute("name")]={required:!0};var s=document.createElement("div");s.className="error required-error",s.innerHTML=t.required,e.appendChild(s)}}},s=function(e,i){return function(l){this.wrapper=l,this.inputs=this.wrapper.querySelectorAll(".field-input"),this.errors={};for(var s=this.wrapper.querySelectorAll(".error"),r=s.length-1;r>=0;r--)s[r].parentNode.removeChild(s[r]);_.each(this.inputs,function(t){var i=t.getAttribute("name");this.errors[i]={},t.getAttribute("aria-required")&&""===t.value&&(this.errors[i].required=t),e&&e.call(this,t)},this),i&&i.call(this);var o;for(var n in this.errors)if(this.errors.hasOwnProperty(n))for(var c in this.errors[n])o=document.createElement("div"),o.className="error "+c+"-error",o.setAttribute("data-field-name",n),o.innerHTML=t[c],this.errors[n][c].parentNode.insertBefore(o,this.errors[n][c].nextSibling)}};wp.ccf.validators["single-line-text"]=wp.ccf.validators["single-line-text"]||s(),wp.ccf.validators["paragraph-text"]=wp.ccf.validators["paragraph-text"]||s(),wp.ccf.validators.name=wp.ccf.validators.name||s(),wp.ccf.validators.email=wp.ccf.validators.email||s(!1,function(){var e=this.inputs[0].value;if(e){2===this.inputs.length&&e!==this.inputs[1].value&&(this.errors[this.inputs[0].getAttribute("name")].match=this.wrapper.lastChild);var t=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;t.test(e)||(this.errors[this.inputs[0].getAttribute("name")].email=this.wrapper.lastChild)}}),wp.ccf.validators.recaptcha=wp.ccf.validators.recaptcha||function(e,l){this.wrapper=e,this.inputs=this.wrapper.querySelectorAll(".g-recaptcha-response"),this.errors={};for(var s=this.wrapper.querySelectorAll(".error"),r=s.length-1;r>=0;r--)s[r].parentNode.removeChild(s[r]);i[l]||(this.errors["g-recaptcha-response"]={},this.errors["g-recaptcha-response"].recaptcha=this.wrapper.lastChild);var o;for(var n in this.errors)if(this.errors.hasOwnProperty(n))for(var c in this.errors[n])o=document.createElement("div"),o.className="error "+c+"-error",o.setAttribute("data-field-name",n),o.innerHTML=t[c],this.errors[n][c].parentNode.insertBefore(o,this.errors[n][c].nextSibling)},wp.ccf.validators.phone=wp.ccf.validators.phone||s(!1,function(){var e=this.inputs[0].value;if(e){var t=/^[0-9+.)(\- ]+$/;if(t.test(e)){if("us"===this.wrapper.getAttribute("data-phone-format")){var i=e.replace(/[^0-9]/gi,"");10!==i.length&&(this.errors[this.inputs[0].getAttribute("name")].digits=this.wrapper.lastChild)}}else this.errors[this.inputs[0].getAttribute("name")].phone=this.wrapper.lastChild}}),wp.ccf.validators.date=wp.ccf.validators.date||function(e){this.wrapper=e,this.errors={},this.inputs=this.wrapper.querySelectorAll(".field-input");for(var i=this.wrapper.querySelectorAll(".error"),l=i.length-1;l>=0;l--)i[l].parentNode.removeChild(i[l]);var s;_.each(this.inputs,function(i){var l=i.getAttribute("name");if(this.errors[l]={},i.getAttribute("aria-required")&&""===i.value&&(this.errors[l].required=!0,s=document.createElement("div"),s.className="error required-error",1===this.inputs.length?(s.innerHTML=t.required,s.className+=" right-error",i.parentNode.insertBefore(s,i.nextSibling)):(s.innerHTML=t[l.replace(/.*\[(.*?)\]/i,"$1")+"_required"],e.appendChild(s))),""!==i.value){var r=l.replace(/^.*\[(.*?)\]$/,"$1");"date"===r?i.value.match(/^([0-9]|\/)+$/)||(s=document.createElement("div"),s.className="error date-error",s.innerHTML=t.date,e.appendChild(s)):"hour"===r?i.value.match(/^[0-9]+$/)||(s=document.createElement("div"),s.className="error hour-error",s.innerHTML=t.hour,e.appendChild(s)):"minute"===r&&(i.value.match(/^[0-9]+$/)||(s=document.createElement("div"),s.className="error minute-error",s.innerHTML=t.minute,e.appendChild(s)))}},this)},wp.ccf.validators.address=wp.ccf.validators.address||s(),wp.ccf.validators.file=wp.ccf.validators.file||function(e){this.wrapper=e,this.inputs=this.wrapper.querySelectorAll(".field-input"),this.errors={};for(var i=this.wrapper.querySelectorAll(".error"),l=i.length-1;l>=0;l--)i[l].parentNode.removeChild(i[l]);_.each(this.inputs,function(e){var t=e.getAttribute("name");this.errors[t]={},e.getAttribute("aria-required")&&""===e.value&&(this.errors[t].required=e)},this);var s=this.inputs[0],r=this.wrapper.getAttribute("data-max-file-size"),o=this.wrapper.getAttribute("data-file-extensions");if(s.value){if(r){var n=1e3*1e3*parseInt(r);if(s.files)s.files[0].size>n&&(this.errors[this.inputs[0].getAttribute("name")].fileSize=this.wrapper.lastChild);else if("undefined"!=typeof ActiveXObject)try{var c=new ActiveXObject("Scripting.FileSystemObject"),a=c.getFile(s.value);a.size>n&&(this.errors[this.inputs[0].getAttribute("name")].fileSize=this.wrapper.lastChild)}catch(d){}}if(o){var f=o.replace(";",",").toLowerCase();if(f=f.replace(/\s+/g,""),f=f.split(","),f.length){var u=s.value.replace(/^.*\.(.+)$/g,"$1").toLowerCase();-1===_.indexOf(f,u)&&(this.errors[this.inputs[0].getAttribute("name")].fileExtension=this.wrapper.lastChild)}}}var p;for(var h in this.errors)if(this.errors.hasOwnProperty(h))for(var m in this.errors[h])p=document.createElement("div"),p.className="error "+m+"-error",p.setAttribute("data-field-name",h),p.innerHTML=t[m],"fileExtension"===m&&o?p.innerHTML+=" ("+o+")":"fileSize"===m&&r&&(p.innerHTML+=" "+r+" MB"),this.errors[h][m].parentNode.insertBefore(p,this.errors[h][m].nextSibling)},wp.ccf.validators.website=wp.ccf.validators.website||s(function(e){if(e.value){var t=/^http(s?)\:\/\/(([a-zA-Z0-9\-\._]+(\.[a-zA-Z0-9\-\._]+)+)|localhost)(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&%\$#_]*)?([\d\w\.\/\%\+\-\=\&\?\:\\\"\'\,\|\~\;]*)$/;t.test(e.value)||(this.errors[e.getAttribute("name")].website=e)}}),wp.ccf.validators.checkboxes=wp.ccf.validators.checkboxes||l,wp.ccf.validators.dropdown=wp.ccf.validators.dropdown||s(),wp.ccf.validators.radio=wp.ccf.validators.radio||l,wp.ccf.setupDOM=wp.ccf.setupDOM||function(){for(var l,s,r=document.querySelectorAll(".ccf-datepicker"),o=0;r.length>o;o++)l={},s=r[o].getAttribute("data-date-format"),s&&(l.dateFormat=s.replace(/yyyy/i,"yy")),e(r[o]).datepicker(l);var n=document.querySelectorAll(".ccf-form-wrapper");n.length>=1&&_.each(n,function(l){function s(t){var i=l.querySelectorAll(".field"),s=[];if(_.each(i,function(e){if(!e.className.match(/ skip-field/i)){var t=e.getAttribute("data-field-type"),i=e.getAttribute("data-field-slug");p[i]=e;var l=new wp.ccf.validators[t](e,n);if(_.size(l.errors)){var r=0;for(var o in l.errors)l.errors.hasOwnProperty(o)&&_.size(l.errors[o])&&r++;r>0&&s.push(l)}}}),!s.length)return o.trigger("ccfFormSuccess"),l.className=l.className.replace(/ loading/i,"")+" loading",d.animate({opacity:100}),!0;t.returnFalse=!1,t.preventDefault&&t.preventDefault(),o.trigger("ccfFormError",s);var r=e(window).scrollTop(),c=r+e(window).height(),a=e(s[0].wrapper),f=a.offset(),u=f.top,h=u+a.height();return u>=r&&c>=h||e("html, body").animate({scrollTop:a.offset().top},500),!1}var r=l.querySelectorAll(".ccf-form")[0],o=e(r),n=parseInt(l.getAttribute("data-form-id")),c=r.querySelectorAll(".ccf-submit-button")[0],a=document.getElementById("ccf_form_frame_"+n),d=e(r.querySelectorAll(".loading-img")[0]),f=e(a),u=e(c),p={};f.on("load",function(){var l,s=f.contents().find("body").text();if(!s)return!1;r.className=r.className.replace(/ loading/i,""),d.animate({opacity:0}),i[n]=!1;try{l=e.parseJSON(s)}catch(o){var a=document.createElement("div");return a.className="error unknown-error",a.innerText=t.unknown,c.parentNode.appendChild(a),!1}var u=c.parentNode.querySelectorAll(".error");if(u.length&&u[0].parentNode.removeChild(u[0]),l.success)if("text"===l.action_type&&l.completion_message){r.innerHTML="";var h=document.createElement("div");h.innerHTML=l.completion_message,h.className="ccf-form-complete",r.appendChild(h),e("html, body").animate({scrollTop:e(r).offset().top},500)}else"redirect"===l.action_type&&l.completion_redirect_url&&(document.location=l.completion_redirect_url);else l.field_errors&&_.each(l.field_errors,function(e,t){var i=p[t].querySelectorAll(".field-input");for(var l in e)if(e.hasOwnProperty(l)){var s=document.createElement("div");s.className="error "+l+"-error",s.innerHTML=e[l],1===i.length?i[i.length-1].parentNode.insertBefore(s,i[i.length-1].nextSibling):p[t].appendChild(s)}})}),u.on("click",function(e){return e.preventDefault(),r.target="ccf_form_frame_"+n,r.action=t.ajaxurl,o.submit(),!1}),o.on("submit",s)})},e(document).ready(wp.ccf.setupDOM)})(jQuery,ccfSettings);
|
classes/class-ccf-ads.php
CHANGED
@@ -23,14 +23,13 @@ class CCF_Ads {
|
|
23 |
if ( apply_filters( 'ccf_hide_ads', false ) ) {
|
24 |
return;
|
25 |
}
|
26 |
-
|
27 |
if ( ! empty( $_POST['ccf_subscribe'] ) && ! empty( $_POST['email'] ) ) {
|
28 |
$request = wp_remote_request( 'http://taylorlovett.us8.list-manage.com/subscribe/post?u=66118f9a5b0ab0414e83f043a&id=b4ed816a24', array(
|
29 |
'method' => 'post',
|
30 |
'body' => array(
|
31 |
'EMAIL' => $_POST['email'],
|
32 |
-
|
33 |
-
)
|
34 |
));
|
35 |
|
36 |
update_option( 'ccf_subscribed', 1 );
|
@@ -77,18 +76,9 @@ class CCF_Ads {
|
|
77 |
<div class="updated update-nag ccf-subscribe">
|
78 |
<div class="ad-wrap">
|
79 |
<?php if ( empty( $_POST['ccf_subscribe'] ) || empty( $_POST['ccf_unsubscribe'] ) ) : ?>
|
80 |
-
|
81 |
<form method="post">
|
82 |
-
<
|
83 |
-
<option value="">Choose one</option>
|
84 |
-
<option>Themes</option>
|
85 |
-
<option>eCommerce</option>
|
86 |
-
<option>Page Load Time</option>
|
87 |
-
<option>Social Media</option>
|
88 |
-
<option>Fast WP Hosting</option>
|
89 |
-
<option>Marketing</option>
|
90 |
-
</select>
|
91 |
-
<input placeholder="Email" type="email" name="email">
|
92 |
<input type="hidden" name="ccf_subscribe" value="1">
|
93 |
<input type="submit" class="button button-primary" value="Sign Me Up">
|
94 |
</form>
|
23 |
if ( apply_filters( 'ccf_hide_ads', false ) ) {
|
24 |
return;
|
25 |
}
|
26 |
+
|
27 |
if ( ! empty( $_POST['ccf_subscribe'] ) && ! empty( $_POST['email'] ) ) {
|
28 |
$request = wp_remote_request( 'http://taylorlovett.us8.list-manage.com/subscribe/post?u=66118f9a5b0ab0414e83f043a&id=b4ed816a24', array(
|
29 |
'method' => 'post',
|
30 |
'body' => array(
|
31 |
'EMAIL' => $_POST['email'],
|
32 |
+
),
|
|
|
33 |
));
|
34 |
|
35 |
update_option( 'ccf_subscribed', 1 );
|
76 |
<div class="updated update-nag ccf-subscribe">
|
77 |
<div class="ad-wrap">
|
78 |
<?php if ( empty( $_POST['ccf_subscribe'] ) || empty( $_POST['ccf_unsubscribe'] ) ) : ?>
|
79 |
+
WordPress exclusive tutorials, blogging tips, themes, plugins, and more.
|
80 |
<form method="post">
|
81 |
+
<input type="email" name="email">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
<input type="hidden" name="ccf_subscribe" value="1">
|
83 |
<input type="submit" class="button button-primary" value="Sign Me Up">
|
84 |
</form>
|
classes/class-ccf-api-form-controller.php
CHANGED
@@ -109,6 +109,18 @@ class CCF_API_Form_Controller extends WP_REST_Controller {
|
|
109 |
'sanitize' => 'sanitize_text_field',
|
110 |
'escape' => 'esc_html',
|
111 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
) );
|
113 |
|
114 |
$this->choice_attribute_keys = apply_filters( 'ccf_choice_attributes', array(
|
@@ -224,7 +236,7 @@ class CCF_API_Form_Controller extends WP_REST_Controller {
|
|
224 |
* Create field choices and attach them to fields. Not an API route.
|
225 |
*
|
226 |
* @param array $choices
|
227 |
-
* @param int
|
228 |
* @since 7.0
|
229 |
*/
|
230 |
public function _create_and_map_choices( $choices, $field_id ) {
|
@@ -247,8 +259,8 @@ class CCF_API_Form_Controller extends WP_REST_Controller {
|
|
247 |
|
248 |
if ( ! is_wp_error( $choice_id ) ) {
|
249 |
foreach ( $this->choice_attribute_keys as $key => $functions ) {
|
250 |
-
if ( isset( $choice[$key] ) ) {
|
251 |
-
update_post_meta( $choice_id, 'ccf_choice_' . $key, call_user_func( $functions['sanitize'], $choice[$key] ) );
|
252 |
}
|
253 |
}
|
254 |
|
@@ -278,7 +290,7 @@ class CCF_API_Form_Controller extends WP_REST_Controller {
|
|
278 |
* Create fields and map them to forms. Not an API route.
|
279 |
*
|
280 |
* @param array $fields
|
281 |
-
* @param int
|
282 |
* @since 7.0
|
283 |
*/
|
284 |
public function _create_and_map_fields( $fields, $form_id ) {
|
@@ -300,8 +312,8 @@ class CCF_API_Form_Controller extends WP_REST_Controller {
|
|
300 |
|
301 |
if ( ! is_wp_error( $field_id ) ) {
|
302 |
foreach ( $this->field_attribute_keys as $key => $functions ) {
|
303 |
-
if ( isset( $field[$key] ) ) {
|
304 |
-
update_post_meta( $field_id, 'ccf_field_' . $key, call_user_func( $functions['sanitize'], $field[$key] ) );
|
305 |
}
|
306 |
}
|
307 |
|
@@ -310,6 +322,11 @@ class CCF_API_Form_Controller extends WP_REST_Controller {
|
|
310 |
$this->_create_and_map_choices( $choices, $field_id );
|
311 |
}
|
312 |
|
|
|
|
|
|
|
|
|
|
|
313 |
$new_fields[] = $field_id;
|
314 |
}
|
315 |
}
|
@@ -331,24 +348,24 @@ class CCF_API_Form_Controller extends WP_REST_Controller {
|
|
331 |
* Create/update notifications
|
332 |
*
|
333 |
* @param array $notifications
|
334 |
-
* @param int
|
335 |
* @since 7.2
|
336 |
*/
|
337 |
public function _create_and_map_notifications( $notifications, $form_id ) {
|
338 |
// @Todo: better sanitization
|
339 |
$clean_notifications = array();
|
340 |
for ( $index = 0; $index < count( $notifications ); $index++ ) {
|
341 |
-
foreach ( $notifications[$index] as $notification_key => $notification_value ) {
|
342 |
if ( 'addresses' === $notification_key ) {
|
343 |
foreach ( $notification_value as $address_key => $address_value ) {
|
344 |
if ( ( 'field' === $address_value['type'] && ! empty( $address_value['field'] ) ) || ( 'custom' === $address_value['type'] && ! empty( $address_value['email'] ) ) ) {
|
345 |
-
$clean_notifications[$index][$notification_key][$address_key] = array_map( 'sanitize_text_field', $address_value );
|
346 |
}
|
347 |
}
|
348 |
} elseif ( 'content' === $notification_key ) {
|
349 |
-
$clean_notifications[$index][$notification_key] = wp_kses_post( $notification_value );
|
350 |
} else {
|
351 |
-
$clean_notifications[$index][$notification_key] = sanitize_text_field( $notification_value );
|
352 |
}
|
353 |
}
|
354 |
}
|
@@ -356,16 +373,36 @@ class CCF_API_Form_Controller extends WP_REST_Controller {
|
|
356 |
update_post_meta( $form_id, 'ccf_form_notifications', $clean_notifications );
|
357 |
}
|
358 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
359 |
/**
|
360 |
* Create/update post field mappings
|
361 |
*
|
362 |
* @param array $post_field_mappings
|
363 |
-
* @param int
|
364 |
* @since 7.3
|
365 |
*/
|
366 |
public function _create_and_map_post_field_mappings( $post_field_mappings, $form_id ) {
|
367 |
$clean_post_field_mappings = array();
|
368 |
-
|
369 |
foreach ( $post_field_mappings as $mapping ) {
|
370 |
if ( ! empty( $mapping['formField'] ) && ! empty( $mapping['postField'] ) ) {
|
371 |
$clean_post_field_mappings[] = array_map( 'sanitize_text_field', $mapping );
|
@@ -469,7 +506,7 @@ class CCF_API_Form_Controller extends WP_REST_Controller {
|
|
469 |
* @return bool
|
470 |
*/
|
471 |
protected function boolval( $value ) {
|
472 |
-
return
|
473 |
}
|
474 |
|
475 |
/**
|
@@ -639,7 +676,7 @@ class CCF_API_Form_Controller extends WP_REST_Controller {
|
|
639 |
return new WP_REST_Response( $data, 200 );
|
640 |
}
|
641 |
|
642 |
-
return new WP_Error( 'cant-create', __( 'Could not create form', 'custom-contact-forms'), array( 'status' => 500 ) );
|
643 |
}
|
644 |
|
645 |
/**
|
@@ -669,7 +706,7 @@ class CCF_API_Form_Controller extends WP_REST_Controller {
|
|
669 |
}
|
670 |
}
|
671 |
|
672 |
-
return new WP_Error( 'cant-update', __( 'Could not update form', 'custom-contact-forms'), array( 'status' => 500 ) );
|
673 |
}
|
674 |
|
675 |
/**
|
@@ -697,7 +734,7 @@ class CCF_API_Form_Controller extends WP_REST_Controller {
|
|
697 |
return new WP_REST_Response( true, 200 );
|
698 |
}
|
699 |
|
700 |
-
return new WP_Error( 'cant-delete', __( 'Could not delete form', 'custom-contact-forms'), array( 'status' => 500 ) );
|
701 |
}
|
702 |
|
703 |
|
@@ -726,7 +763,7 @@ class CCF_API_Form_Controller extends WP_REST_Controller {
|
|
726 |
return new WP_REST_Response( true, 200 );
|
727 |
}
|
728 |
|
729 |
-
return new WP_Error( 'cant-delete', __( 'Could not delete submission', 'custom-contact-forms'), array( 'status' => 500 ) );
|
730 |
}
|
731 |
|
732 |
/**
|
@@ -870,7 +907,7 @@ class CCF_API_Form_Controller extends WP_REST_Controller {
|
|
870 |
$value = get_post_meta( $field_id, 'ccf_field_' . $key );
|
871 |
|
872 |
if ( isset( $value[0] ) ) {
|
873 |
-
$field[$key] = call_user_func( $functions['escape'], $value[0] );
|
874 |
}
|
875 |
}
|
876 |
|
@@ -887,7 +924,7 @@ class CCF_API_Form_Controller extends WP_REST_Controller {
|
|
887 |
$value = get_post_meta( $choice_id, 'ccf_choice_' . $key );
|
888 |
|
889 |
if ( isset( $value[0] ) ) {
|
890 |
-
$choice[$key] = call_user_func( $functions['escape'], $value[0] );
|
891 |
}
|
892 |
}
|
893 |
|
@@ -896,6 +933,22 @@ class CCF_API_Form_Controller extends WP_REST_Controller {
|
|
896 |
}
|
897 |
}
|
898 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
899 |
$fields[] = $field;
|
900 |
}
|
901 |
}
|
@@ -906,7 +959,7 @@ class CCF_API_Form_Controller extends WP_REST_Controller {
|
|
906 |
/**
|
907 |
* Prepare the item for the REST response
|
908 |
*
|
909 |
-
* @param int|object
|
910 |
* @param WP_REST_Request
|
911 |
* @since 7.0
|
912 |
* @return array
|
109 |
'sanitize' => 'sanitize_text_field',
|
110 |
'escape' => 'esc_html',
|
111 |
),
|
112 |
+
'conditionalsEnabled' => array(
|
113 |
+
'sanitize' => array( $this, 'boolval' ),
|
114 |
+
'escape' => array( $this, 'boolval' ),
|
115 |
+
),
|
116 |
+
'conditionalType' => array(
|
117 |
+
'sanitize' => 'sanitize_text_field',
|
118 |
+
'escape' => 'esc_html',
|
119 |
+
),
|
120 |
+
'conditionalFieldsRequired' => array(
|
121 |
+
'sanitize' => 'sanitize_text_field',
|
122 |
+
'escape' => 'esc_html',
|
123 |
+
),
|
124 |
) );
|
125 |
|
126 |
$this->choice_attribute_keys = apply_filters( 'ccf_choice_attributes', array(
|
236 |
* Create field choices and attach them to fields. Not an API route.
|
237 |
*
|
238 |
* @param array $choices
|
239 |
+
* @param int $field_id
|
240 |
* @since 7.0
|
241 |
*/
|
242 |
public function _create_and_map_choices( $choices, $field_id ) {
|
259 |
|
260 |
if ( ! is_wp_error( $choice_id ) ) {
|
261 |
foreach ( $this->choice_attribute_keys as $key => $functions ) {
|
262 |
+
if ( isset( $choice[ $key ] ) ) {
|
263 |
+
update_post_meta( $choice_id, 'ccf_choice_' . $key, call_user_func( $functions['sanitize'], $choice[ $key ] ) );
|
264 |
}
|
265 |
}
|
266 |
|
290 |
* Create fields and map them to forms. Not an API route.
|
291 |
*
|
292 |
* @param array $fields
|
293 |
+
* @param int $form_id
|
294 |
* @since 7.0
|
295 |
*/
|
296 |
public function _create_and_map_fields( $fields, $form_id ) {
|
312 |
|
313 |
if ( ! is_wp_error( $field_id ) ) {
|
314 |
foreach ( $this->field_attribute_keys as $key => $functions ) {
|
315 |
+
if ( isset( $field[ $key ] ) ) {
|
316 |
+
update_post_meta( $field_id, 'ccf_field_' . $key, call_user_func( $functions['sanitize'], $field[ $key ] ) );
|
317 |
}
|
318 |
}
|
319 |
|
322 |
$this->_create_and_map_choices( $choices, $field_id );
|
323 |
}
|
324 |
|
325 |
+
if ( isset( $field['conditionals'] ) ) {
|
326 |
+
$conditionals = ( empty( $field['conditionals'] ) ) ? array() : $field['conditionals'];
|
327 |
+
$this->_create_and_map_conditionals( $conditionals, $field_id );
|
328 |
+
}
|
329 |
+
|
330 |
$new_fields[] = $field_id;
|
331 |
}
|
332 |
}
|
348 |
* Create/update notifications
|
349 |
*
|
350 |
* @param array $notifications
|
351 |
+
* @param int $form_id
|
352 |
* @since 7.2
|
353 |
*/
|
354 |
public function _create_and_map_notifications( $notifications, $form_id ) {
|
355 |
// @Todo: better sanitization
|
356 |
$clean_notifications = array();
|
357 |
for ( $index = 0; $index < count( $notifications ); $index++ ) {
|
358 |
+
foreach ( $notifications[ $index ] as $notification_key => $notification_value ) {
|
359 |
if ( 'addresses' === $notification_key ) {
|
360 |
foreach ( $notification_value as $address_key => $address_value ) {
|
361 |
if ( ( 'field' === $address_value['type'] && ! empty( $address_value['field'] ) ) || ( 'custom' === $address_value['type'] && ! empty( $address_value['email'] ) ) ) {
|
362 |
+
$clean_notifications[ $index ][ $notification_key ][ $address_key ] = array_map( 'sanitize_text_field', $address_value );
|
363 |
}
|
364 |
}
|
365 |
} elseif ( 'content' === $notification_key ) {
|
366 |
+
$clean_notifications[ $index ][ $notification_key ] = wp_kses_post( $notification_value );
|
367 |
} else {
|
368 |
+
$clean_notifications[ $index ][ $notification_key ] = sanitize_text_field( $notification_value );
|
369 |
}
|
370 |
}
|
371 |
}
|
373 |
update_post_meta( $form_id, 'ccf_form_notifications', $clean_notifications );
|
374 |
}
|
375 |
|
376 |
+
/**
|
377 |
+
* Create/update field conditionals
|
378 |
+
*
|
379 |
+
* @param array $conditionals
|
380 |
+
* @param int $field_id
|
381 |
+
* @since 7.5
|
382 |
+
*/
|
383 |
+
public function _create_and_map_conditionals( $conditionals, $field_id ) {
|
384 |
+
// @Todo: better sanitization
|
385 |
+
$clean_conditionals = array();
|
386 |
+
|
387 |
+
for ( $index = 0; $index < count( $conditionals ); $index++ ) {
|
388 |
+
foreach ( $conditionals[ $index ] as $conditional_key => $conditional_value ) {
|
389 |
+
$clean_conditionals[ $index ][ $conditional_key ] = sanitize_text_field( $conditional_value );
|
390 |
+
}
|
391 |
+
}
|
392 |
+
|
393 |
+
update_post_meta( $field_id, 'ccf_attached_conditionals', $clean_conditionals );
|
394 |
+
}
|
395 |
+
|
396 |
/**
|
397 |
* Create/update post field mappings
|
398 |
*
|
399 |
* @param array $post_field_mappings
|
400 |
+
* @param int $form_id
|
401 |
* @since 7.3
|
402 |
*/
|
403 |
public function _create_and_map_post_field_mappings( $post_field_mappings, $form_id ) {
|
404 |
$clean_post_field_mappings = array();
|
405 |
+
|
406 |
foreach ( $post_field_mappings as $mapping ) {
|
407 |
if ( ! empty( $mapping['formField'] ) && ! empty( $mapping['postField'] ) ) {
|
408 |
$clean_post_field_mappings[] = array_map( 'sanitize_text_field', $mapping );
|
506 |
* @return bool
|
507 |
*/
|
508 |
protected function boolval( $value ) {
|
509 |
+
return ! ! $value;
|
510 |
}
|
511 |
|
512 |
/**
|
676 |
return new WP_REST_Response( $data, 200 );
|
677 |
}
|
678 |
|
679 |
+
return new WP_Error( 'cant-create', __( 'Could not create form', 'custom-contact-forms' ), array( 'status' => 500 ) );
|
680 |
}
|
681 |
|
682 |
/**
|
706 |
}
|
707 |
}
|
708 |
|
709 |
+
return new WP_Error( 'cant-update', __( 'Could not update form', 'custom-contact-forms' ), array( 'status' => 500 ) );
|
710 |
}
|
711 |
|
712 |
/**
|
734 |
return new WP_REST_Response( true, 200 );
|
735 |
}
|
736 |
|
737 |
+
return new WP_Error( 'cant-delete', __( 'Could not delete form', 'custom-contact-forms' ), array( 'status' => 500 ) );
|
738 |
}
|
739 |
|
740 |
|
763 |
return new WP_REST_Response( true, 200 );
|
764 |
}
|
765 |
|
766 |
+
return new WP_Error( 'cant-delete', __( 'Could not delete submission', 'custom-contact-forms' ), array( 'status' => 500 ) );
|
767 |
}
|
768 |
|
769 |
/**
|
907 |
$value = get_post_meta( $field_id, 'ccf_field_' . $key );
|
908 |
|
909 |
if ( isset( $value[0] ) ) {
|
910 |
+
$field[ $key ] = call_user_func( $functions['escape'], $value[0] );
|
911 |
}
|
912 |
}
|
913 |
|
924 |
$value = get_post_meta( $choice_id, 'ccf_choice_' . $key );
|
925 |
|
926 |
if ( isset( $value[0] ) ) {
|
927 |
+
$choice[ $key ] = call_user_func( $functions['escape'], $value[0] );
|
928 |
}
|
929 |
}
|
930 |
|
933 |
}
|
934 |
}
|
935 |
|
936 |
+
$conditionals = get_post_meta( $field_id, 'ccf_attached_conditionals' );
|
937 |
+
|
938 |
+
if ( ! empty( $conditionals ) ) {
|
939 |
+
$field['conditionals'] = array();
|
940 |
+
|
941 |
+
if ( ! empty( $conditionals[0] ) ) {
|
942 |
+
foreach ( $conditionals[0] as $conditional ) {
|
943 |
+
$field['conditionals'][] = array(
|
944 |
+
'field' => esc_attr( $conditional['field'] ),
|
945 |
+
'compare' => esc_attr( $conditional['compare'] ),
|
946 |
+
'value' => esc_html( $conditional['value'] ),
|
947 |
+
);
|
948 |
+
}
|
949 |
+
}
|
950 |
+
}
|
951 |
+
|
952 |
$fields[] = $field;
|
953 |
}
|
954 |
}
|
959 |
/**
|
960 |
* Prepare the item for the REST response
|
961 |
*
|
962 |
+
* @param int|object $item
|
963 |
* @param WP_REST_Request
|
964 |
* @since 7.0
|
965 |
* @return array
|
classes/class-ccf-choice-cpt.php
CHANGED
@@ -55,4 +55,4 @@ class CCF_Choice_CPT {
|
|
55 |
|
56 |
return $instance;
|
57 |
}
|
58 |
-
}
|
55 |
|
56 |
return $instance;
|
57 |
}
|
58 |
+
}
|
classes/class-ccf-constants.php
CHANGED
@@ -60,4 +60,4 @@ class CCF_Constants {
|
|
60 |
|
61 |
return $instance;
|
62 |
}
|
63 |
-
}
|
60 |
|
61 |
return $instance;
|
62 |
}
|
63 |
+
}
|
classes/class-ccf-custom-contact-forms.php
CHANGED
@@ -29,7 +29,7 @@ class CCF_Custom_Contact_Forms {
|
|
29 |
* Trick API into thinking non publically queryable post types are queryable
|
30 |
*
|
31 |
* @param string $post_type
|
32 |
-
* @param array
|
33 |
* @since 6.8.1
|
34 |
*/
|
35 |
public function make_post_types_public( $post_type, $args ) {
|
@@ -77,7 +77,7 @@ class CCF_Custom_Contact_Forms {
|
|
77 |
/**
|
78 |
* Add forms and form submissions link to plugin actions
|
79 |
*
|
80 |
-
* @param array
|
81 |
* @param string $plugin_file
|
82 |
* @since 6.1.4
|
83 |
* @return array
|
29 |
* Trick API into thinking non publically queryable post types are queryable
|
30 |
*
|
31 |
* @param string $post_type
|
32 |
+
* @param array $args
|
33 |
* @since 6.8.1
|
34 |
*/
|
35 |
public function make_post_types_public( $post_type, $args ) {
|
77 |
/**
|
78 |
* Add forms and form submissions link to plugin actions
|
79 |
*
|
80 |
+
* @param array $plugin_actions
|
81 |
* @param string $plugin_file
|
82 |
* @since 6.1.4
|
83 |
* @return array
|
classes/class-ccf-export.php
CHANGED
@@ -49,12 +49,12 @@ class CCF_Export {
|
|
49 |
|
50 |
foreach ( $wp_post_types as $slug => $post_type ) {
|
51 |
if ( in_array( $slug, $ccf_post_types ) ) {
|
52 |
-
$this->old_post_types[$slug] = clone $post_type;
|
53 |
$post_type->can_export = false;
|
54 |
}
|
55 |
|
56 |
if ( 'ccf_form' === $slug ) {
|
57 |
-
$this->old_post_types[$slug] = clone $post_type;
|
58 |
$post_type->label = esc_html__( 'Forms and Submissions', 'cutom-contact-forms' );
|
59 |
}
|
60 |
}
|
@@ -102,7 +102,6 @@ class CCF_Export {
|
|
102 |
|
103 |
if ( in_array( get_post_type( $post_id ), $types ) ) {
|
104 |
// Mark post for cleanup later
|
105 |
-
|
106 |
update_post_meta( $post_id, 'ccf_import_cleanup', true );
|
107 |
}
|
108 |
}
|
@@ -264,7 +263,7 @@ class CCF_Export {
|
|
264 |
|
265 |
foreach ( $wp_post_types as $slug => $post_type ) {
|
266 |
if ( ! in_array( $slug, $ccf_post_types ) ) {
|
267 |
-
$this->old_post_types[$slug] = clone $post_type;
|
268 |
$post_type->can_export = false;
|
269 |
}
|
270 |
}
|
@@ -289,4 +288,4 @@ class CCF_Export {
|
|
289 |
|
290 |
return $instance;
|
291 |
}
|
292 |
-
}
|
49 |
|
50 |
foreach ( $wp_post_types as $slug => $post_type ) {
|
51 |
if ( in_array( $slug, $ccf_post_types ) ) {
|
52 |
+
$this->old_post_types[ $slug ] = clone $post_type;
|
53 |
$post_type->can_export = false;
|
54 |
}
|
55 |
|
56 |
if ( 'ccf_form' === $slug ) {
|
57 |
+
$this->old_post_types[ $slug ] = clone $post_type;
|
58 |
$post_type->label = esc_html__( 'Forms and Submissions', 'cutom-contact-forms' );
|
59 |
}
|
60 |
}
|
102 |
|
103 |
if ( in_array( get_post_type( $post_id ), $types ) ) {
|
104 |
// Mark post for cleanup later
|
|
|
105 |
update_post_meta( $post_id, 'ccf_import_cleanup', true );
|
106 |
}
|
107 |
}
|
263 |
|
264 |
foreach ( $wp_post_types as $slug => $post_type ) {
|
265 |
if ( ! in_array( $slug, $ccf_post_types ) ) {
|
266 |
+
$this->old_post_types[ $slug ] = clone $post_type;
|
267 |
$post_type->can_export = false;
|
268 |
}
|
269 |
}
|
288 |
|
289 |
return $instance;
|
290 |
}
|
291 |
+
}
|
classes/class-ccf-field-cpt.php
CHANGED
@@ -56,4 +56,4 @@ class CCF_Field_CPT {
|
|
56 |
|
57 |
return $instance;
|
58 |
}
|
59 |
-
}
|
56 |
|
57 |
return $instance;
|
58 |
}
|
59 |
+
}
|
classes/class-ccf-field-renderer.php
CHANGED
@@ -9,6 +9,11 @@ class CCF_Field_Renderer {
|
|
9 |
*/
|
10 |
public function __construct() {}
|
11 |
|
|
|
|
|
|
|
|
|
|
|
12 |
/**
|
13 |
* Get single-line-text field HTML, including any errors from the last form submission. if there is an
|
14 |
* error the field will remember it's last submitted value.
|
@@ -32,8 +37,8 @@ class CCF_Field_Renderer {
|
|
32 |
|
33 |
if ( ! empty( $all_errors ) ) {
|
34 |
if ( apply_filters( 'ccf_show_last_field_value', true, $field_id ) ) {
|
35 |
-
if ( ! empty( $_POST['ccf_field_' . $slug] ) ) {
|
36 |
-
$post_value = $_POST['ccf_field_' . $slug];
|
37 |
}
|
38 |
}
|
39 |
}
|
@@ -46,7 +51,8 @@ class CCF_Field_Renderer {
|
|
46 |
<?php if ( ! empty( $required ) ) : ?><span class="required">*</span><?php endif; ?>
|
47 |
<?php echo esc_html( $label ); ?>
|
48 |
</label>
|
49 |
-
<input class="form-control <?php if ( ! empty( $errors ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> type="text" name="ccf_field_<?php echo esc_attr( $slug ); ?>" id="ccf_field_<?php echo esc_attr( $slug ); ?>" placeholder="<?php echo esc_attr( $placeholder ); ?>" value="<?php if ( ! empty( $post_value ) ) { echo esc_attr( $post_value );
|
|
|
50 |
|
51 |
<?php if ( ! empty( $description ) ) : ?>
|
52 |
<div class="field-description help-block text-muted">
|
@@ -88,8 +94,8 @@ class CCF_Field_Renderer {
|
|
88 |
|
89 |
if ( ! empty( $all_errors ) ) {
|
90 |
if ( apply_filters( 'ccf_show_last_field_value', true, $field_id ) ) {
|
91 |
-
if ( ! empty( $_POST['ccf_field_' . $slug] ) ) {
|
92 |
-
$post_value = $_POST['ccf_field_' . $slug];
|
93 |
}
|
94 |
}
|
95 |
}
|
@@ -114,7 +120,8 @@ class CCF_Field_Renderer {
|
|
114 |
<?php echo esc_html( $label ); ?>
|
115 |
</label>
|
116 |
|
117 |
-
<input class="form-control <?php if ( ! empty( $errors ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> type="file" name="ccf_field_<?php echo esc_attr( $slug ); ?>" id="ccf_field_<?php echo esc_attr( $slug ); ?>" placeholder="<?php echo esc_attr( $placeholder ); ?>" value="<?php if ( ! empty( $post_value ) ) { echo esc_attr( $post_value );
|
|
|
118 |
|
119 |
<div class="field-description help-block text-muted">
|
120 |
<?php if ( ! empty( $file_extensions ) ) : ?>
|
@@ -192,18 +199,29 @@ class CCF_Field_Renderer {
|
|
192 |
$class_name = get_post_meta( $field_id, 'ccf_field_className', true );
|
193 |
|
194 |
ob_start();
|
|
|
|
|
|
|
|
|
|
|
195 |
?>
|
196 |
|
197 |
-
<div class="
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
|
|
|
|
|
|
203 |
</div>
|
204 |
-
</div>
|
205 |
|
206 |
<?php
|
|
|
|
|
|
|
|
|
207 |
return ob_get_clean();
|
208 |
}
|
209 |
|
@@ -223,7 +241,7 @@ class CCF_Field_Renderer {
|
|
223 |
ob_start();
|
224 |
?>
|
225 |
|
226 |
-
<div class="field skip-field <?php echo esc_attr( $slug ); ?> field-type-html field-<?php echo (int) $field_id; ?> <?php echo esc_attr( $class_name ); ?>">
|
227 |
<?php echo wp_kses_post( $html ); ?>
|
228 |
</div>
|
229 |
|
@@ -264,9 +282,9 @@ class CCF_Field_Renderer {
|
|
264 |
$selected = 0;
|
265 |
if ( ! empty( $choice_ids ) ) {
|
266 |
foreach ( $choice_ids as $choice_id ) {
|
267 |
-
$choices[$choice_id] = $this->get_choice( $choice_id );
|
268 |
|
269 |
-
if ( ! empty( $choices[$choice_id]['selected'] ) ) {
|
270 |
$selected++;
|
271 |
}
|
272 |
}
|
@@ -283,8 +301,8 @@ class CCF_Field_Renderer {
|
|
283 |
|
284 |
if ( ! empty( $all_errors ) ) {
|
285 |
if ( apply_filters( 'ccf_show_last_field_value', true, $field_id ) ) {
|
286 |
-
if ( ! empty( $_POST['ccf_field_' . $slug] ) ) {
|
287 |
-
$post_value = $_POST['ccf_field_' . $slug];
|
288 |
}
|
289 |
}
|
290 |
}
|
@@ -345,16 +363,17 @@ class CCF_Field_Renderer {
|
|
345 |
$selected = 0;
|
346 |
if ( ! empty( $choice_ids ) ) {
|
347 |
foreach ( $choice_ids as $choice_id ) {
|
348 |
-
$choices[$choice_id] = $this->get_choice( $choice_id );
|
349 |
|
350 |
-
if ( ! empty( $choices[$choice_id]['selected'] ) ) {
|
351 |
$selected++;
|
352 |
}
|
353 |
}
|
354 |
}
|
355 |
|
356 |
$slug = get_post_meta( $field_id, 'ccf_field_slug', true );
|
357 |
-
$label = get_post_meta( $field_id, 'ccf_field_label', true )
|
|
|
358 |
$required = get_post_meta( $field_id, 'ccf_field_required', true );
|
359 |
$class_name = get_post_meta( $field_id, 'ccf_field_className', true );
|
360 |
$description = get_post_meta( $field_id, 'ccf_field_description', true );
|
@@ -364,8 +383,8 @@ class CCF_Field_Renderer {
|
|
364 |
|
365 |
if ( ! empty( $all_errors ) ) {
|
366 |
if ( apply_filters( 'ccf_show_last_field_value', true, $field_id ) ) {
|
367 |
-
if ( ! empty( $_POST['ccf_field_' . $slug] ) ) {
|
368 |
-
$post_value = $_POST['ccf_field_' . $slug];
|
369 |
}
|
370 |
}
|
371 |
}
|
@@ -426,16 +445,17 @@ class CCF_Field_Renderer {
|
|
426 |
$selected = 0;
|
427 |
if ( ! empty( $choice_ids ) ) {
|
428 |
foreach ( $choice_ids as $choice_id ) {
|
429 |
-
$choices[$choice_id] = $this->get_choice( $choice_id );
|
430 |
|
431 |
-
if ( ! empty( $choices[$choice_id]['selected'] ) ) {
|
432 |
$selected++;
|
433 |
}
|
434 |
}
|
435 |
}
|
436 |
|
437 |
$slug = get_post_meta( $field_id, 'ccf_field_slug', true );
|
438 |
-
$label = get_post_meta( $field_id, 'ccf_field_label', true )
|
|
|
439 |
$required = get_post_meta( $field_id, 'ccf_field_required', true );
|
440 |
$class_name = get_post_meta( $field_id, 'ccf_field_className', true );
|
441 |
$description = get_post_meta( $field_id, 'ccf_field_description', true );
|
@@ -445,8 +465,8 @@ class CCF_Field_Renderer {
|
|
445 |
|
446 |
if ( ! empty( $all_errors ) ) {
|
447 |
if ( apply_filters( 'ccf_show_last_field_value', true, $field_id ) ) {
|
448 |
-
if ( ! empty( $_POST['ccf_field_' . $slug] ) ) {
|
449 |
-
$post_value = $_POST['ccf_field_' . $slug];
|
450 |
}
|
451 |
}
|
452 |
}
|
@@ -513,28 +533,28 @@ class CCF_Field_Renderer {
|
|
513 |
|
514 |
if ( ! empty( $all_errors ) ) {
|
515 |
if ( apply_filters( 'ccf_show_last_field_value', true, $field_id ) ) {
|
516 |
-
if ( ! empty( $_POST['ccf_field_' . $slug]['street'] ) ) {
|
517 |
-
$street_post_value = $_POST['ccf_field_' . $slug]['street'];
|
518 |
}
|
519 |
|
520 |
-
if ( ! empty( $_POST['ccf_field_' . $slug]['line_two'] ) ) {
|
521 |
-
$line_two_post_value = $_POST['ccf_field_' . $slug]['line_two'];
|
522 |
}
|
523 |
|
524 |
-
if ( ! empty( $_POST['ccf_field_' . $slug]['city'] ) ) {
|
525 |
-
$city_post_value = $_POST['ccf_field_' . $slug]['city'];
|
526 |
}
|
527 |
|
528 |
-
if ( ! empty( $_POST['ccf_field_' . $slug]['state'] ) ) {
|
529 |
-
$state_post_value = $_POST['ccf_field_' . $slug]['state'];
|
530 |
}
|
531 |
|
532 |
-
if ( ! empty( $_POST['ccf_field_' . $slug]['country'] ) ) {
|
533 |
-
$country_post_value = $_POST['ccf_field_' . $slug]['country'];
|
534 |
}
|
535 |
|
536 |
-
if ( ! empty( $_POST['ccf_field_' . $slug]['zipcode'] ) ) {
|
537 |
-
$zipcode_post_value = $_POST['ccf_field_' . $slug]['zipcode'];
|
538 |
}
|
539 |
}
|
540 |
}
|
@@ -548,18 +568,18 @@ class CCF_Field_Renderer {
|
|
548 |
<?php echo esc_html( $label ); ?>
|
549 |
</label>
|
550 |
<div class="full">
|
551 |
-
<input value="<?php if ( ! empty( $street_post_value ) ) echo esc_attr( $street_post_value ); ?>" class="form-control <?php if ( ! empty( $errors['street_required'] ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> id="ccf_field_<?php echo esc_attr( $slug ); ?>-street" type="text" name="ccf_field_<?php echo esc_attr( $slug ); ?>[street]">
|
552 |
<?php if ( ! empty( $errors['street_required'] ) ) : ?>
|
553 |
<div class="error"><?php echo esc_html( $errors['street_required'] ); ?></div>
|
554 |
<?php endif; ?>
|
555 |
<label for="ccf_field_<?php echo esc_attr( $slug ); ?>-street" class="sub-label help-block text-muted"><?php esc_html_e( 'Street Address', 'custom-contact-forms' ); ?></label>
|
556 |
</div>
|
557 |
<div class="full">
|
558 |
-
<input value="<?php if ( ! empty( $line_two_post_value ) ) echo esc_attr( $line_two_post_value ); ?>" class="form-control field-input" id="ccf_field_<?php echo esc_attr( $slug ); ?>-line_two" type="text" name="ccf_field_<?php echo esc_attr( $slug ); ?>[line_two]">
|
559 |
<label for="ccf_field_<?php echo esc_attr( $slug ); ?>-line_two" class="sub-label help-block text-muted"><?php esc_html_e( 'Address Line 2', 'custom-contact-forms' ); ?></label>
|
560 |
</div>
|
561 |
<div class="left">
|
562 |
-
<input value="<?php if ( ! empty( $city_post_value ) ) echo esc_attr( $city_post_value ); ?>" class="form-control <?php if ( ! empty( $errors['city_required'] ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> type="text" name="ccf_field_<?php echo esc_attr( $slug ); ?>[city]" id="ccf_field_<?php echo esc_attr( $slug ); ?>-city">
|
563 |
<?php if ( ! empty( $errors['city_required'] ) ) : ?>
|
564 |
<div class="error"><?php echo esc_html( $errors['city_required'] ); ?></div>
|
565 |
<?php endif; ?>
|
@@ -570,7 +590,7 @@ class CCF_Field_Renderer {
|
|
570 |
<div class="right">
|
571 |
<select class="<?php if ( ! empty( $errors['state_required'] ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> name="ccf_field_<?php echo esc_attr( $slug ); ?>[state]" id="ccf_field_<?php echo esc_attr( $slug ); ?>-state">
|
572 |
<?php foreach ( CCF_Constants::factory()->get_us_states() as $state ) : ?>
|
573 |
-
<option <?php if ( ! empty( $street_post_value ) ) selected( $street_post_value, $state ); ?>><?php echo $state; ?></option>
|
574 |
<?php endforeach; ?>
|
575 |
</select>
|
576 |
<?php if ( ! empty( $errors['state_required'] ) ) : ?>
|
@@ -580,7 +600,7 @@ class CCF_Field_Renderer {
|
|
580 |
|
581 |
</div>
|
582 |
<div class="left">
|
583 |
-
<input value="<?php if ( ! empty( $zipcode_post_value ) ) echo esc_attr( $zipcode_post_value ); ?>" class="form-control <?php if ( ! empty( $errors['zipcode_required'] ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> type="text" name="ccf_field_<?php echo esc_attr( $slug ); ?>[zipcode]" id="ccf_field_<?php echo esc_attr( $slug ); ?>-zipcode">
|
584 |
<?php if ( ! empty( $errors['zipcode_required'] ) ) : ?>
|
585 |
<div class="error"><?php echo esc_html( $errors['zipcode_required'] ); ?></div>
|
586 |
<?php endif; ?>
|
@@ -590,7 +610,7 @@ class CCF_Field_Renderer {
|
|
590 |
<div class="ccf-clear"></div>
|
591 |
<?php } else if ( $address_type === 'international' ) { ?>
|
592 |
<div class="right">
|
593 |
-
<input value="<?php if ( ! empty( $state_post_value ) ) echo esc_attr( $state_post_value ); ?>" class="form-control <?php if ( ! empty( $errors['state_required'] ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> type="text" name="ccf_field_<?php echo esc_attr( $slug ); ?>[state]" id="ccf_field_<?php echo esc_attr( $slug ); ?>-state">
|
594 |
<?php if ( ! empty( $errors['state_required'] ) ) : ?>
|
595 |
<div class="error"><?php echo esc_html( $errors['state_required'] ); ?></div>
|
596 |
<?php endif; ?>
|
@@ -598,7 +618,7 @@ class CCF_Field_Renderer {
|
|
598 |
|
599 |
</div>
|
600 |
<div class="left">
|
601 |
-
<input value="<?php if ( ! empty( $zipcode_post_value ) ) echo esc_attr( $zipcode_post_value ); ?>" class="form-control <?php if ( ! empty( $errors['zipcode_required'] ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> type="text" name="ccf_field_<?php echo esc_attr( $slug ); ?>[zipcode]" id="ccf_field_<?php echo esc_attr( $slug ); ?>-zipcode">
|
602 |
<?php if ( ! empty( $errors['zipcode_required'] ) ) : ?>
|
603 |
<div class="error"><?php echo esc_html( $errors['zipcode_required'] ); ?></div>
|
604 |
<?php endif; ?>
|
@@ -608,7 +628,7 @@ class CCF_Field_Renderer {
|
|
608 |
<div class="right">
|
609 |
<select class="<?php if ( ! empty( $errors['country_required'] ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> name="ccf_field_<?php echo esc_attr( $slug ); ?>[country]" id="ccf_field_<?php echo esc_attr( $slug ); ?>-country">
|
610 |
<?php foreach ( CCF_Constants::factory()->get_countries() as $country ) : ?>
|
611 |
-
<option <?php if ( ! empty( $country_post_value ) ) selected( $country_post_value, $country ); ?>><?php echo $country; ?></option>
|
612 |
<?php endforeach; ?>
|
613 |
</select>
|
614 |
<?php if ( ! empty( $errors['country_required'] ) ) : ?>
|
@@ -655,8 +675,8 @@ class CCF_Field_Renderer {
|
|
655 |
|
656 |
if ( ! empty( $all_errors ) ) {
|
657 |
if ( apply_filters( 'ccf_show_last_field_value', true, $field_id ) ) {
|
658 |
-
if ( ! empty( $_POST['ccf_field_' . $slug] ) ) {
|
659 |
-
$post_value = $_POST['ccf_field_' . $slug];
|
660 |
}
|
661 |
}
|
662 |
}
|
@@ -669,7 +689,8 @@ class CCF_Field_Renderer {
|
|
669 |
<?php if ( ! empty( $required ) ) : ?><span class="required">*</span><?php endif; ?>
|
670 |
<?php echo esc_html( $label ); ?>
|
671 |
</label>
|
672 |
-
<input class="form-control <?php if ( ! empty( $errors ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> type="text" name="ccf_field_<?php echo esc_attr( $slug ); ?>" id="ccf_field_<?php echo esc_attr( $slug ); ?>" placeholder="<?php echo esc_attr( $placeholder ); ?>" value="<?php if ( ! empty( $post_value ) ) { echo esc_attr( $post_value );
|
|
|
673 |
|
674 |
<?php if ( ! empty( $description ) ) : ?>
|
675 |
<div class="field-description help-block text-muted">
|
@@ -711,8 +732,8 @@ class CCF_Field_Renderer {
|
|
711 |
|
712 |
if ( ! empty( $all_errors ) ) {
|
713 |
if ( apply_filters( 'ccf_show_last_field_value', true, $field_id ) ) {
|
714 |
-
if ( ! empty( $_POST['ccf_field_' . $slug] ) ) {
|
715 |
-
$post_value = $_POST['ccf_field_' . $slug];
|
716 |
}
|
717 |
}
|
718 |
}
|
@@ -725,7 +746,8 @@ class CCF_Field_Renderer {
|
|
725 |
<?php if ( ! empty( $required ) ) : ?><span class="required">*</span><?php endif; ?>
|
726 |
<?php echo esc_html( $label ); ?>
|
727 |
</label>
|
728 |
-
<input class="form-control <?php if ( ! empty( $errors ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> type="text" name="ccf_field_<?php echo esc_attr( $slug ); ?>" id="ccf_field_<?php echo esc_attr( $slug ); ?>" placeholder="<?php echo esc_attr( $placeholder ); ?>" value="<?php if ( ! empty( $post_value ) ) { echo esc_attr( $post_value );
|
|
|
729 |
|
730 |
<?php if ( ! empty( $description ) ) : ?>
|
731 |
<div class="field-description help-block text-muted">
|
@@ -735,7 +757,8 @@ class CCF_Field_Renderer {
|
|
735 |
|
736 |
<?php if ( ! empty( $errors ) ) : foreach ( $errors as $error ) : ?>
|
737 |
<div class="error"><?php echo esc_html( $error ); ?></div>
|
738 |
-
<?php endforeach;
|
|
|
739 |
</div>
|
740 |
|
741 |
<?php
|
@@ -767,15 +790,15 @@ class CCF_Field_Renderer {
|
|
767 |
if ( ! empty( $all_errors ) ) {
|
768 |
if ( apply_filters( 'ccf_show_last_field_value', true, $field_id ) ) {
|
769 |
if ( ! empty( $email_confirmation ) ) {
|
770 |
-
if ( ! empty( $_POST['ccf_field_' . $slug]['email'] ) ) {
|
771 |
-
$email_post_value = $_POST['ccf_field_' . $slug]['email'];
|
772 |
}
|
773 |
|
774 |
-
if ( ! empty( $_POST['ccf_field_' . $slug]['confirm'] ) ) {
|
775 |
-
$confirm_post_value = $_POST['ccf_field_' . $slug]['confirm'];
|
776 |
}
|
777 |
} else {
|
778 |
-
$email_post_value = $_POST['ccf_field_' . $slug];
|
779 |
}
|
780 |
}
|
781 |
}
|
@@ -789,10 +812,12 @@ class CCF_Field_Renderer {
|
|
789 |
<?php echo esc_html( $label ); ?>
|
790 |
</label>
|
791 |
<?php if ( empty( $email_confirmation ) ) { ?>
|
792 |
-
<input class="form-control <?php if ( ! empty( $errors ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> name="ccf_field_<?php echo esc_attr( $slug ); ?>" id="ccf_field_<?php echo esc_attr( $slug ); ?>" placeholder="<?php if ( ! empty( $placeholder ) ) { ?><?php echo esc_attr( $placeholder ) ?><?php } else { ?><?php esc_html_e( 'email@example.com', 'custom-contact-forms' ); ?><?php } ?>" type="text" value="<?php if ( ! empty( $email_post_value ) ) { echo esc_attr( $email_post_value );
|
|
|
793 |
<?php if ( ! empty( $errors ) ) : foreach ( $errors as $error ) : ?>
|
794 |
<div class="error"><?php echo esc_html( $error ); ?></div>
|
795 |
-
<?php endforeach;
|
|
|
796 |
<?php } else { ?>
|
797 |
<div class="left">
|
798 |
<input class="form-control field-input <?php if ( ! empty( $errors['email_required'] ) || ! empty( $errors['match'] ) || ! empty( $errors['email'] ) ) : ?>field-error-input<?php endif; ?>" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> name="ccf_field_<?php echo esc_attr( $slug ); ?>[email]" id="ccf_field_<?php echo esc_attr( $slug ); ?>" value="<?php if ( ! empty( $email_post_value ) ) { echo esc_attr( $email_post_value ); }?>" type="text">
|
@@ -849,12 +874,12 @@ class CCF_Field_Renderer {
|
|
849 |
|
850 |
if ( ! empty( $all_errors ) ) {
|
851 |
if ( apply_filters( 'ccf_show_last_field_value', true, $field_id ) ) {
|
852 |
-
if ( ! empty( $_POST['ccf_field_' . $slug]['first'] ) ) {
|
853 |
-
$first_post_value = $_POST['ccf_field_' . $slug]['first'];
|
854 |
}
|
855 |
|
856 |
-
if ( ! empty( $_POST['ccf_field_' . $slug]['last'] ) ) {
|
857 |
-
$last_post_value = $_POST['ccf_field_' . $slug]['last'];
|
858 |
}
|
859 |
}
|
860 |
}
|
@@ -868,14 +893,14 @@ class CCF_Field_Renderer {
|
|
868 |
<?php echo esc_html( $label ); ?>
|
869 |
</label>
|
870 |
<div class="left">
|
871 |
-
<input value="<?php if ( ! empty( $first_post_value ) ) echo esc_attr( $first_post_value ); ?>" class="form-control <?php if ( ! empty( $errors['first_required'] ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> type="text" name="ccf_field_<?php echo esc_attr( $slug ); ?>[first]" id="ccf_field_<?php echo esc_attr( $slug ); ?>-first">
|
872 |
<?php if ( ! empty( $errors['first_required'] ) ) : ?>
|
873 |
<div class="error"><?php echo esc_html( $errors['first_required'] ); ?></div>
|
874 |
<?php endif; ?>
|
875 |
<label for="ccf_field_<?php echo esc_attr( $slug ); ?>-first" class="sub-label help-block text-muted"><?php esc_html_e( 'First', 'custom-contact-forms' ); ?></label>
|
876 |
</div>
|
877 |
<div class="right">
|
878 |
-
<input value="<?php if ( ! empty( $last_post_value ) ) echo esc_attr( $last_post_value ); ?>" class="form-control <?php if ( ! empty( $errors['last_required'] ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> type="text" name="ccf_field_<?php echo esc_attr( $slug ); ?>[last]" id="ccf_field_<?php echo esc_attr( $slug ); ?>-last">
|
879 |
<?php if ( ! empty( $errors['last_required'] ) ) : ?>
|
880 |
<div class="error"><?php echo esc_html( $errors['last_required'] ); ?></div>
|
881 |
<?php endif; ?>
|
@@ -921,20 +946,20 @@ class CCF_Field_Renderer {
|
|
921 |
|
922 |
if ( ! empty( $all_errors ) ) {
|
923 |
if ( apply_filters( 'ccf_show_last_field_value', true, $field_id ) ) {
|
924 |
-
if ( ! empty( $_POST['ccf_field_' . $slug]['date'] ) ) {
|
925 |
-
$date_post_value = $_POST['ccf_field_' . $slug]['date'];
|
926 |
}
|
927 |
|
928 |
-
if ( ! empty( $_POST['ccf_field_' . $slug]['hour'] ) ) {
|
929 |
-
$hour_post_value = $_POST['ccf_field_' . $slug]['hour'];
|
930 |
}
|
931 |
|
932 |
-
if ( ! empty( $_POST['ccf_field_' . $slug]['minute'] ) ) {
|
933 |
-
$minute_post_value = $_POST['ccf_field_' . $slug]['minute'];
|
934 |
}
|
935 |
|
936 |
-
if ( ! empty( $_POST['ccf_field_' . $slug]['am-pm'] ) ) {
|
937 |
-
$am_pm_post_value = $_POST['ccf_field_' . $slug]['am-pm'];
|
938 |
}
|
939 |
}
|
940 |
}
|
@@ -948,7 +973,8 @@ class CCF_Field_Renderer {
|
|
948 |
<?php echo esc_html( $label ); ?>
|
949 |
</label>
|
950 |
<?php if ( ! empty( $show_date ) && empty( $show_time ) ) { ?>
|
951 |
-
<input data-date-format="<?php echo esc_attr( $date_format ); ?>" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> name="ccf_field_<?php echo esc_attr( $slug ); ?>[date]" value="<?php if ( ! empty( $date_post_value ) ) { echo esc_attr( $date_post_value );
|
|
|
952 |
<?php } else if ( empty( $show_date ) && ! empty( $show_time ) ) { ?>
|
953 |
<div class="hour">
|
954 |
<input maxlength="2" class="form-control <?php if ( ! empty( $errors['hour_required'] ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> name="ccf_field_<?php echo esc_attr( $slug ); ?>[hour]" value="<?php if ( ! empty( $hour_post_value ) ) { echo esc_attr( $hour_post_value ); } ?>" id="ccf_field_<?php echo esc_attr( $slug ); ?>-hour" type="text">
|
@@ -997,7 +1023,8 @@ class CCF_Field_Renderer {
|
|
997 |
|
998 |
<?php if ( ! empty( $errors ) ) : foreach ( $errors as $error ) : ?>
|
999 |
<div class="error"><?php echo esc_html( $error ); ?></div>
|
1000 |
-
<?php endforeach;
|
|
|
1001 |
</div>
|
1002 |
|
1003 |
<?php
|
@@ -1027,8 +1054,8 @@ class CCF_Field_Renderer {
|
|
1027 |
|
1028 |
if ( ! empty( $all_errors ) ) {
|
1029 |
if ( apply_filters( 'ccf_show_last_field_value', true, $field_id ) ) {
|
1030 |
-
if ( ! empty( $_POST['ccf_field_' . $slug] ) ) {
|
1031 |
-
$post_value = $_POST['ccf_field_' . $slug];
|
1032 |
}
|
1033 |
}
|
1034 |
}
|
@@ -1041,7 +1068,8 @@ class CCF_Field_Renderer {
|
|
1041 |
<?php if ( ! empty( $required ) ) : ?><span class="required">*</span><?php endif; ?>
|
1042 |
<?php echo esc_html( $label ); ?>
|
1043 |
</label>
|
1044 |
-
<textarea class="form-control <?php if ( ! empty( $errors ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> name="ccf_field_<?php echo esc_attr( $slug ); ?>" id="ccf_field_<?php echo esc_attr( $slug ); ?>" placeholder="<?php echo esc_attr( $placeholder ); ?>"><?php if ( ! empty( $post_value ) ) { echo esc_attr( $post_value );
|
|
|
1045 |
|
1046 |
<?php if ( ! empty( $description ) ) : ?>
|
1047 |
<div class="field-description help-block text-muted">
|
@@ -1083,8 +1111,8 @@ class CCF_Field_Renderer {
|
|
1083 |
* Route field rendering requests to field specific method and return html for given field
|
1084 |
*
|
1085 |
* @param string $type
|
1086 |
-
* @param int
|
1087 |
-
* @param int
|
1088 |
* @since 6.0
|
1089 |
* @return string
|
1090 |
*/
|
9 |
*/
|
10 |
public function __construct() {}
|
11 |
|
12 |
+
/**
|
13 |
+
* Keep track of sections
|
14 |
+
*/
|
15 |
+
public $section_open = false;
|
16 |
+
|
17 |
/**
|
18 |
* Get single-line-text field HTML, including any errors from the last form submission. if there is an
|
19 |
* error the field will remember it's last submitted value.
|
37 |
|
38 |
if ( ! empty( $all_errors ) ) {
|
39 |
if ( apply_filters( 'ccf_show_last_field_value', true, $field_id ) ) {
|
40 |
+
if ( ! empty( $_POST[ 'ccf_field_' . $slug ] ) ) {
|
41 |
+
$post_value = $_POST[ 'ccf_field_' . $slug ];
|
42 |
}
|
43 |
}
|
44 |
}
|
51 |
<?php if ( ! empty( $required ) ) : ?><span class="required">*</span><?php endif; ?>
|
52 |
<?php echo esc_html( $label ); ?>
|
53 |
</label>
|
54 |
+
<input class="form-control <?php if ( ! empty( $errors ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> type="text" name="ccf_field_<?php echo esc_attr( $slug ); ?>" id="ccf_field_<?php echo esc_attr( $slug ); ?>" placeholder="<?php echo esc_attr( $placeholder ); ?>" value="<?php if ( ! empty( $post_value ) ) { echo esc_attr( $post_value );
|
55 |
+
} else { echo esc_attr( $value ); } ?>">
|
56 |
|
57 |
<?php if ( ! empty( $description ) ) : ?>
|
58 |
<div class="field-description help-block text-muted">
|
94 |
|
95 |
if ( ! empty( $all_errors ) ) {
|
96 |
if ( apply_filters( 'ccf_show_last_field_value', true, $field_id ) ) {
|
97 |
+
if ( ! empty( $_POST[ 'ccf_field_' . $slug ] ) ) {
|
98 |
+
$post_value = $_POST[ 'ccf_field_' . $slug ];
|
99 |
}
|
100 |
}
|
101 |
}
|
120 |
<?php echo esc_html( $label ); ?>
|
121 |
</label>
|
122 |
|
123 |
+
<input class="form-control <?php if ( ! empty( $errors ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> type="file" name="ccf_field_<?php echo esc_attr( $slug ); ?>" id="ccf_field_<?php echo esc_attr( $slug ); ?>" placeholder="<?php echo esc_attr( $placeholder ); ?>" value="<?php if ( ! empty( $post_value ) ) { echo esc_attr( $post_value );
|
124 |
+
} else { echo esc_attr( $value ); } ?>" accept="<?php echo esc_attr( preg_replace( '/([^,\s]+)/', '.$1', $file_extensions ) ); ?>">
|
125 |
|
126 |
<div class="field-description help-block text-muted">
|
127 |
<?php if ( ! empty( $file_extensions ) ) : ?>
|
199 |
$class_name = get_post_meta( $field_id, 'ccf_field_className', true );
|
200 |
|
201 |
ob_start();
|
202 |
+
|
203 |
+
if ( $this->section_open ) {
|
204 |
+
echo '</div>';
|
205 |
+
}
|
206 |
+
|
207 |
?>
|
208 |
|
209 |
+
<div class="ccf-section">
|
210 |
+
|
211 |
+
<div data-field-type="section-header" data-field-slug="<?php echo esc_attr( $slug ); ?>" class="field skip-field <?php echo esc_attr( $slug ); ?> field-type-section-header field-<?php echo (int) $field_id; ?> <?php echo esc_attr( $class_name ); ?>">
|
212 |
+
<div class="heading">
|
213 |
+
<?php echo esc_html( $heading ); ?>
|
214 |
+
</div>
|
215 |
+
<div class="subheading">
|
216 |
+
<?php echo esc_html( $subheading ); ?>
|
217 |
+
</div>
|
218 |
</div>
|
|
|
219 |
|
220 |
<?php
|
221 |
+
|
222 |
+
$this->section_open = true;
|
223 |
+
|
224 |
+
|
225 |
return ob_get_clean();
|
226 |
}
|
227 |
|
241 |
ob_start();
|
242 |
?>
|
243 |
|
244 |
+
<div data-field-type="html" data-field-slug="<?php echo esc_attr( $slug ); ?>" class="field skip-field <?php echo esc_attr( $slug ); ?> field-type-html field-<?php echo (int) $field_id; ?> <?php echo esc_attr( $class_name ); ?>">
|
245 |
<?php echo wp_kses_post( $html ); ?>
|
246 |
</div>
|
247 |
|
282 |
$selected = 0;
|
283 |
if ( ! empty( $choice_ids ) ) {
|
284 |
foreach ( $choice_ids as $choice_id ) {
|
285 |
+
$choices[ $choice_id ] = $this->get_choice( $choice_id );
|
286 |
|
287 |
+
if ( ! empty( $choices[ $choice_id ]['selected'] ) ) {
|
288 |
$selected++;
|
289 |
}
|
290 |
}
|
301 |
|
302 |
if ( ! empty( $all_errors ) ) {
|
303 |
if ( apply_filters( 'ccf_show_last_field_value', true, $field_id ) ) {
|
304 |
+
if ( ! empty( $_POST[ 'ccf_field_' . $slug ] ) ) {
|
305 |
+
$post_value = $_POST[ 'ccf_field_' . $slug ];
|
306 |
}
|
307 |
}
|
308 |
}
|
363 |
$selected = 0;
|
364 |
if ( ! empty( $choice_ids ) ) {
|
365 |
foreach ( $choice_ids as $choice_id ) {
|
366 |
+
$choices[ $choice_id ] = $this->get_choice( $choice_id );
|
367 |
|
368 |
+
if ( ! empty( $choices[ $choice_id ]['selected'] ) ) {
|
369 |
$selected++;
|
370 |
}
|
371 |
}
|
372 |
}
|
373 |
|
374 |
$slug = get_post_meta( $field_id, 'ccf_field_slug', true );
|
375 |
+
$label = get_post_meta( $field_id, 'ccf_field_label', true );
|
376 |
+
;
|
377 |
$required = get_post_meta( $field_id, 'ccf_field_required', true );
|
378 |
$class_name = get_post_meta( $field_id, 'ccf_field_className', true );
|
379 |
$description = get_post_meta( $field_id, 'ccf_field_description', true );
|
383 |
|
384 |
if ( ! empty( $all_errors ) ) {
|
385 |
if ( apply_filters( 'ccf_show_last_field_value', true, $field_id ) ) {
|
386 |
+
if ( ! empty( $_POST[ 'ccf_field_' . $slug ] ) ) {
|
387 |
+
$post_value = $_POST[ 'ccf_field_' . $slug ];
|
388 |
}
|
389 |
}
|
390 |
}
|
445 |
$selected = 0;
|
446 |
if ( ! empty( $choice_ids ) ) {
|
447 |
foreach ( $choice_ids as $choice_id ) {
|
448 |
+
$choices[ $choice_id ] = $this->get_choice( $choice_id );
|
449 |
|
450 |
+
if ( ! empty( $choices[ $choice_id ]['selected'] ) ) {
|
451 |
$selected++;
|
452 |
}
|
453 |
}
|
454 |
}
|
455 |
|
456 |
$slug = get_post_meta( $field_id, 'ccf_field_slug', true );
|
457 |
+
$label = get_post_meta( $field_id, 'ccf_field_label', true );
|
458 |
+
;
|
459 |
$required = get_post_meta( $field_id, 'ccf_field_required', true );
|
460 |
$class_name = get_post_meta( $field_id, 'ccf_field_className', true );
|
461 |
$description = get_post_meta( $field_id, 'ccf_field_description', true );
|
465 |
|
466 |
if ( ! empty( $all_errors ) ) {
|
467 |
if ( apply_filters( 'ccf_show_last_field_value', true, $field_id ) ) {
|
468 |
+
if ( ! empty( $_POST[ 'ccf_field_' . $slug ] ) ) {
|
469 |
+
$post_value = $_POST[ 'ccf_field_' . $slug ];
|
470 |
}
|
471 |
}
|
472 |
}
|
533 |
|
534 |
if ( ! empty( $all_errors ) ) {
|
535 |
if ( apply_filters( 'ccf_show_last_field_value', true, $field_id ) ) {
|
536 |
+
if ( ! empty( $_POST[ 'ccf_field_' . $slug ]['street'] ) ) {
|
537 |
+
$street_post_value = $_POST[ 'ccf_field_' . $slug ]['street'];
|
538 |
}
|
539 |
|
540 |
+
if ( ! empty( $_POST[ 'ccf_field_' . $slug ]['line_two'] ) ) {
|
541 |
+
$line_two_post_value = $_POST[ 'ccf_field_' . $slug ]['line_two'];
|
542 |
}
|
543 |
|
544 |
+
if ( ! empty( $_POST[ 'ccf_field_' . $slug ]['city'] ) ) {
|
545 |
+
$city_post_value = $_POST[ 'ccf_field_' . $slug ]['city'];
|
546 |
}
|
547 |
|
548 |
+
if ( ! empty( $_POST[ 'ccf_field_' . $slug ]['state'] ) ) {
|
549 |
+
$state_post_value = $_POST[ 'ccf_field_' . $slug ]['state'];
|
550 |
}
|
551 |
|
552 |
+
if ( ! empty( $_POST[ 'ccf_field_' . $slug ]['country'] ) ) {
|
553 |
+
$country_post_value = $_POST[ 'ccf_field_' . $slug ]['country'];
|
554 |
}
|
555 |
|
556 |
+
if ( ! empty( $_POST[ 'ccf_field_' . $slug ]['zipcode'] ) ) {
|
557 |
+
$zipcode_post_value = $_POST[ 'ccf_field_' . $slug ]['zipcode'];
|
558 |
}
|
559 |
}
|
560 |
}
|
568 |
<?php echo esc_html( $label ); ?>
|
569 |
</label>
|
570 |
<div class="full">
|
571 |
+
<input value="<?php if ( ! empty( $street_post_value ) ) { echo esc_attr( $street_post_value ); } ?>" class="form-control <?php if ( ! empty( $errors['street_required'] ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> id="ccf_field_<?php echo esc_attr( $slug ); ?>-street" type="text" name="ccf_field_<?php echo esc_attr( $slug ); ?>[street]">
|
572 |
<?php if ( ! empty( $errors['street_required'] ) ) : ?>
|
573 |
<div class="error"><?php echo esc_html( $errors['street_required'] ); ?></div>
|
574 |
<?php endif; ?>
|
575 |
<label for="ccf_field_<?php echo esc_attr( $slug ); ?>-street" class="sub-label help-block text-muted"><?php esc_html_e( 'Street Address', 'custom-contact-forms' ); ?></label>
|
576 |
</div>
|
577 |
<div class="full">
|
578 |
+
<input value="<?php if ( ! empty( $line_two_post_value ) ) { echo esc_attr( $line_two_post_value ); } ?>" class="form-control field-input" id="ccf_field_<?php echo esc_attr( $slug ); ?>-line_two" type="text" name="ccf_field_<?php echo esc_attr( $slug ); ?>[line_two]">
|
579 |
<label for="ccf_field_<?php echo esc_attr( $slug ); ?>-line_two" class="sub-label help-block text-muted"><?php esc_html_e( 'Address Line 2', 'custom-contact-forms' ); ?></label>
|
580 |
</div>
|
581 |
<div class="left">
|
582 |
+
<input value="<?php if ( ! empty( $city_post_value ) ) { echo esc_attr( $city_post_value ); } ?>" class="form-control <?php if ( ! empty( $errors['city_required'] ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> type="text" name="ccf_field_<?php echo esc_attr( $slug ); ?>[city]" id="ccf_field_<?php echo esc_attr( $slug ); ?>-city">
|
583 |
<?php if ( ! empty( $errors['city_required'] ) ) : ?>
|
584 |
<div class="error"><?php echo esc_html( $errors['city_required'] ); ?></div>
|
585 |
<?php endif; ?>
|
590 |
<div class="right">
|
591 |
<select class="<?php if ( ! empty( $errors['state_required'] ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> name="ccf_field_<?php echo esc_attr( $slug ); ?>[state]" id="ccf_field_<?php echo esc_attr( $slug ); ?>-state">
|
592 |
<?php foreach ( CCF_Constants::factory()->get_us_states() as $state ) : ?>
|
593 |
+
<option <?php if ( ! empty( $street_post_value ) ) { selected( $street_post_value, $state ); } ?>><?php echo $state; ?></option>
|
594 |
<?php endforeach; ?>
|
595 |
</select>
|
596 |
<?php if ( ! empty( $errors['state_required'] ) ) : ?>
|
600 |
|
601 |
</div>
|
602 |
<div class="left">
|
603 |
+
<input value="<?php if ( ! empty( $zipcode_post_value ) ) { echo esc_attr( $zipcode_post_value ); } ?>" class="form-control <?php if ( ! empty( $errors['zipcode_required'] ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> type="text" name="ccf_field_<?php echo esc_attr( $slug ); ?>[zipcode]" id="ccf_field_<?php echo esc_attr( $slug ); ?>-zipcode">
|
604 |
<?php if ( ! empty( $errors['zipcode_required'] ) ) : ?>
|
605 |
<div class="error"><?php echo esc_html( $errors['zipcode_required'] ); ?></div>
|
606 |
<?php endif; ?>
|
610 |
<div class="ccf-clear"></div>
|
611 |
<?php } else if ( $address_type === 'international' ) { ?>
|
612 |
<div class="right">
|
613 |
+
<input value="<?php if ( ! empty( $state_post_value ) ) { echo esc_attr( $state_post_value ); } ?>" class="form-control <?php if ( ! empty( $errors['state_required'] ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> type="text" name="ccf_field_<?php echo esc_attr( $slug ); ?>[state]" id="ccf_field_<?php echo esc_attr( $slug ); ?>-state">
|
614 |
<?php if ( ! empty( $errors['state_required'] ) ) : ?>
|
615 |
<div class="error"><?php echo esc_html( $errors['state_required'] ); ?></div>
|
616 |
<?php endif; ?>
|
618 |
|
619 |
</div>
|
620 |
<div class="left">
|
621 |
+
<input value="<?php if ( ! empty( $zipcode_post_value ) ) { echo esc_attr( $zipcode_post_value ); } ?>" class="form-control <?php if ( ! empty( $errors['zipcode_required'] ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> type="text" name="ccf_field_<?php echo esc_attr( $slug ); ?>[zipcode]" id="ccf_field_<?php echo esc_attr( $slug ); ?>-zipcode">
|
622 |
<?php if ( ! empty( $errors['zipcode_required'] ) ) : ?>
|
623 |
<div class="error"><?php echo esc_html( $errors['zipcode_required'] ); ?></div>
|
624 |
<?php endif; ?>
|
628 |
<div class="right">
|
629 |
<select class="<?php if ( ! empty( $errors['country_required'] ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> name="ccf_field_<?php echo esc_attr( $slug ); ?>[country]" id="ccf_field_<?php echo esc_attr( $slug ); ?>-country">
|
630 |
<?php foreach ( CCF_Constants::factory()->get_countries() as $country ) : ?>
|
631 |
+
<option <?php if ( ! empty( $country_post_value ) ) { selected( $country_post_value, $country ); } ?>><?php echo $country; ?></option>
|
632 |
<?php endforeach; ?>
|
633 |
</select>
|
634 |
<?php if ( ! empty( $errors['country_required'] ) ) : ?>
|
675 |
|
676 |
if ( ! empty( $all_errors ) ) {
|
677 |
if ( apply_filters( 'ccf_show_last_field_value', true, $field_id ) ) {
|
678 |
+
if ( ! empty( $_POST[ 'ccf_field_' . $slug ] ) ) {
|
679 |
+
$post_value = $_POST[ 'ccf_field_' . $slug ];
|
680 |
}
|
681 |
}
|
682 |
}
|
689 |
<?php if ( ! empty( $required ) ) : ?><span class="required">*</span><?php endif; ?>
|
690 |
<?php echo esc_html( $label ); ?>
|
691 |
</label>
|
692 |
+
<input class="form-control <?php if ( ! empty( $errors ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> type="text" name="ccf_field_<?php echo esc_attr( $slug ); ?>" id="ccf_field_<?php echo esc_attr( $slug ); ?>" placeholder="<?php echo esc_attr( $placeholder ); ?>" value="<?php if ( ! empty( $post_value ) ) { echo esc_attr( $post_value );
|
693 |
+
} else { echo esc_attr( $value ); } ?>">
|
694 |
|
695 |
<?php if ( ! empty( $description ) ) : ?>
|
696 |
<div class="field-description help-block text-muted">
|
732 |
|
733 |
if ( ! empty( $all_errors ) ) {
|
734 |
if ( apply_filters( 'ccf_show_last_field_value', true, $field_id ) ) {
|
735 |
+
if ( ! empty( $_POST[ 'ccf_field_' . $slug ] ) ) {
|
736 |
+
$post_value = $_POST[ 'ccf_field_' . $slug ];
|
737 |
}
|
738 |
}
|
739 |
}
|
746 |
<?php if ( ! empty( $required ) ) : ?><span class="required">*</span><?php endif; ?>
|
747 |
<?php echo esc_html( $label ); ?>
|
748 |
</label>
|
749 |
+
<input class="form-control <?php if ( ! empty( $errors ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> type="text" name="ccf_field_<?php echo esc_attr( $slug ); ?>" id="ccf_field_<?php echo esc_attr( $slug ); ?>" placeholder="<?php echo esc_attr( $placeholder ); ?>" value="<?php if ( ! empty( $post_value ) ) { echo esc_attr( $post_value );
|
750 |
+
} else { echo esc_attr( $value ); } ?>">
|
751 |
|
752 |
<?php if ( ! empty( $description ) ) : ?>
|
753 |
<div class="field-description help-block text-muted">
|
757 |
|
758 |
<?php if ( ! empty( $errors ) ) : foreach ( $errors as $error ) : ?>
|
759 |
<div class="error"><?php echo esc_html( $error ); ?></div>
|
760 |
+
<?php endforeach;
|
761 |
+
endif; ?>
|
762 |
</div>
|
763 |
|
764 |
<?php
|
790 |
if ( ! empty( $all_errors ) ) {
|
791 |
if ( apply_filters( 'ccf_show_last_field_value', true, $field_id ) ) {
|
792 |
if ( ! empty( $email_confirmation ) ) {
|
793 |
+
if ( ! empty( $_POST[ 'ccf_field_' . $slug ]['email'] ) ) {
|
794 |
+
$email_post_value = $_POST[ 'ccf_field_' . $slug ]['email'];
|
795 |
}
|
796 |
|
797 |
+
if ( ! empty( $_POST[ 'ccf_field_' . $slug ]['confirm'] ) ) {
|
798 |
+
$confirm_post_value = $_POST[ 'ccf_field_' . $slug ]['confirm'];
|
799 |
}
|
800 |
} else {
|
801 |
+
$email_post_value = $_POST[ 'ccf_field_' . $slug ];
|
802 |
}
|
803 |
}
|
804 |
}
|
812 |
<?php echo esc_html( $label ); ?>
|
813 |
</label>
|
814 |
<?php if ( empty( $email_confirmation ) ) { ?>
|
815 |
+
<input class="form-control <?php if ( ! empty( $errors ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> name="ccf_field_<?php echo esc_attr( $slug ); ?>" id="ccf_field_<?php echo esc_attr( $slug ); ?>" placeholder="<?php if ( ! empty( $placeholder ) ) { ?><?php echo esc_attr( $placeholder ) ?><?php } else { ?><?php esc_html_e( 'email@example.com', 'custom-contact-forms' ); ?><?php } ?>" type="text" value="<?php if ( ! empty( $email_post_value ) ) { echo esc_attr( $email_post_value );
|
816 |
+
} else { echo esc_attr( $value ); } ?>">
|
817 |
<?php if ( ! empty( $errors ) ) : foreach ( $errors as $error ) : ?>
|
818 |
<div class="error"><?php echo esc_html( $error ); ?></div>
|
819 |
+
<?php endforeach;
|
820 |
+
endif; ?>
|
821 |
<?php } else { ?>
|
822 |
<div class="left">
|
823 |
<input class="form-control field-input <?php if ( ! empty( $errors['email_required'] ) || ! empty( $errors['match'] ) || ! empty( $errors['email'] ) ) : ?>field-error-input<?php endif; ?>" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> name="ccf_field_<?php echo esc_attr( $slug ); ?>[email]" id="ccf_field_<?php echo esc_attr( $slug ); ?>" value="<?php if ( ! empty( $email_post_value ) ) { echo esc_attr( $email_post_value ); }?>" type="text">
|
874 |
|
875 |
if ( ! empty( $all_errors ) ) {
|
876 |
if ( apply_filters( 'ccf_show_last_field_value', true, $field_id ) ) {
|
877 |
+
if ( ! empty( $_POST[ 'ccf_field_' . $slug ]['first'] ) ) {
|
878 |
+
$first_post_value = $_POST[ 'ccf_field_' . $slug ]['first'];
|
879 |
}
|
880 |
|
881 |
+
if ( ! empty( $_POST[ 'ccf_field_' . $slug ]['last'] ) ) {
|
882 |
+
$last_post_value = $_POST[ 'ccf_field_' . $slug ]['last'];
|
883 |
}
|
884 |
}
|
885 |
}
|
893 |
<?php echo esc_html( $label ); ?>
|
894 |
</label>
|
895 |
<div class="left">
|
896 |
+
<input value="<?php if ( ! empty( $first_post_value ) ) { echo esc_attr( $first_post_value ); } ?>" class="form-control <?php if ( ! empty( $errors['first_required'] ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> type="text" name="ccf_field_<?php echo esc_attr( $slug ); ?>[first]" id="ccf_field_<?php echo esc_attr( $slug ); ?>-first">
|
897 |
<?php if ( ! empty( $errors['first_required'] ) ) : ?>
|
898 |
<div class="error"><?php echo esc_html( $errors['first_required'] ); ?></div>
|
899 |
<?php endif; ?>
|
900 |
<label for="ccf_field_<?php echo esc_attr( $slug ); ?>-first" class="sub-label help-block text-muted"><?php esc_html_e( 'First', 'custom-contact-forms' ); ?></label>
|
901 |
</div>
|
902 |
<div class="right">
|
903 |
+
<input value="<?php if ( ! empty( $last_post_value ) ) { echo esc_attr( $last_post_value ); } ?>" class="form-control <?php if ( ! empty( $errors['last_required'] ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> type="text" name="ccf_field_<?php echo esc_attr( $slug ); ?>[last]" id="ccf_field_<?php echo esc_attr( $slug ); ?>-last">
|
904 |
<?php if ( ! empty( $errors['last_required'] ) ) : ?>
|
905 |
<div class="error"><?php echo esc_html( $errors['last_required'] ); ?></div>
|
906 |
<?php endif; ?>
|
946 |
|
947 |
if ( ! empty( $all_errors ) ) {
|
948 |
if ( apply_filters( 'ccf_show_last_field_value', true, $field_id ) ) {
|
949 |
+
if ( ! empty( $_POST[ 'ccf_field_' . $slug ]['date'] ) ) {
|
950 |
+
$date_post_value = $_POST[ 'ccf_field_' . $slug ]['date'];
|
951 |
}
|
952 |
|
953 |
+
if ( ! empty( $_POST[ 'ccf_field_' . $slug ]['hour'] ) ) {
|
954 |
+
$hour_post_value = $_POST[ 'ccf_field_' . $slug ]['hour'];
|
955 |
}
|
956 |
|
957 |
+
if ( ! empty( $_POST[ 'ccf_field_' . $slug ]['minute'] ) ) {
|
958 |
+
$minute_post_value = $_POST[ 'ccf_field_' . $slug ]['minute'];
|
959 |
}
|
960 |
|
961 |
+
if ( ! empty( $_POST[ 'ccf_field_' . $slug ]['am-pm'] ) ) {
|
962 |
+
$am_pm_post_value = $_POST[ 'ccf_field_' . $slug ]['am-pm'];
|
963 |
}
|
964 |
}
|
965 |
}
|
973 |
<?php echo esc_html( $label ); ?>
|
974 |
</label>
|
975 |
<?php if ( ! empty( $show_date ) && empty( $show_time ) ) { ?>
|
976 |
+
<input data-date-format="<?php echo esc_attr( $date_format ); ?>" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> name="ccf_field_<?php echo esc_attr( $slug ); ?>[date]" value="<?php if ( ! empty( $date_post_value ) ) { echo esc_attr( $date_post_value );
|
977 |
+
} else { echo esc_attr( $value ); } ?>" class="form-control <?php if ( ! empty( $errors ) ) : ?>field-error-input<?php endif; ?> ccf-datepicker field-input" id="ccf_field_<?php echo esc_attr( $slug ); ?>" type="text">
|
978 |
<?php } else if ( empty( $show_date ) && ! empty( $show_time ) ) { ?>
|
979 |
<div class="hour">
|
980 |
<input maxlength="2" class="form-control <?php if ( ! empty( $errors['hour_required'] ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> name="ccf_field_<?php echo esc_attr( $slug ); ?>[hour]" value="<?php if ( ! empty( $hour_post_value ) ) { echo esc_attr( $hour_post_value ); } ?>" id="ccf_field_<?php echo esc_attr( $slug ); ?>-hour" type="text">
|
1023 |
|
1024 |
<?php if ( ! empty( $errors ) ) : foreach ( $errors as $error ) : ?>
|
1025 |
<div class="error"><?php echo esc_html( $error ); ?></div>
|
1026 |
+
<?php endforeach;
|
1027 |
+
endif; ?>
|
1028 |
</div>
|
1029 |
|
1030 |
<?php
|
1054 |
|
1055 |
if ( ! empty( $all_errors ) ) {
|
1056 |
if ( apply_filters( 'ccf_show_last_field_value', true, $field_id ) ) {
|
1057 |
+
if ( ! empty( $_POST[ 'ccf_field_' . $slug ] ) ) {
|
1058 |
+
$post_value = $_POST[ 'ccf_field_' . $slug ];
|
1059 |
}
|
1060 |
}
|
1061 |
}
|
1068 |
<?php if ( ! empty( $required ) ) : ?><span class="required">*</span><?php endif; ?>
|
1069 |
<?php echo esc_html( $label ); ?>
|
1070 |
</label>
|
1071 |
+
<textarea class="form-control <?php if ( ! empty( $errors ) ) : ?>field-error-input<?php endif; ?> field-input" <?php if ( ! empty( $required ) ) : ?>required aria-required="true"<?php endif; ?> name="ccf_field_<?php echo esc_attr( $slug ); ?>" id="ccf_field_<?php echo esc_attr( $slug ); ?>" placeholder="<?php echo esc_attr( $placeholder ); ?>"><?php if ( ! empty( $post_value ) ) { echo esc_attr( $post_value );
|
1072 |
+
} else { echo esc_attr( $value ); } ?></textarea>
|
1073 |
|
1074 |
<?php if ( ! empty( $description ) ) : ?>
|
1075 |
<div class="field-description help-block text-muted">
|
1111 |
* Route field rendering requests to field specific method and return html for given field
|
1112 |
*
|
1113 |
* @param string $type
|
1114 |
+
* @param int $field_id
|
1115 |
+
* @param int $form_id
|
1116 |
* @since 6.0
|
1117 |
* @return string
|
1118 |
*/
|
classes/class-ccf-form-cpt.php
CHANGED
@@ -23,10 +23,9 @@ class CCF_Form_CPT {
|
|
23 |
* @since 6.0
|
24 |
*/
|
25 |
public function setup() {
|
26 |
-
|
27 |
|
28 |
add_action( 'init', array( $this, 'setup_cpt' ) );
|
29 |
-
add_filter( 'manage_edit-ccf_form_columns', array( $this, 'filter_columns' ) )
|
30 |
add_action( 'manage_ccf_form_posts_custom_column', array( $this, 'action_columns' ), 10, 2 );
|
31 |
add_action( 'admin_enqueue_scripts', array( $this, 'action_admin_enqueue_scripts' ), 9 );
|
32 |
add_action( 'edit_form_after_title', array( $this, 'action_edit_form_after_title' ) );
|
@@ -53,7 +52,7 @@ class CCF_Form_CPT {
|
|
53 |
return;
|
54 |
}
|
55 |
|
56 |
-
if ( empty( $_GET['post'] ) || 'ccf_form' !== get_post_type( $_GET['post']) ) {
|
57 |
return;
|
58 |
}
|
59 |
|
@@ -75,7 +74,6 @@ class CCF_Form_CPT {
|
|
75 |
) );
|
76 |
|
77 |
// Todo: Unit tests
|
78 |
-
|
79 |
header( 'Content-Type: text/csv' );
|
80 |
header( 'Content-Disposition: attachment; filename=form-' . $post_id . '-submission-' . date( 'Y-m-d' ) . '.csv' );
|
81 |
header( 'Cache-Control: no-cache, no-store, must-revalidate' );
|
@@ -83,7 +81,7 @@ class CCF_Form_CPT {
|
|
83 |
header( 'Expires: 0' );
|
84 |
|
85 |
$output = fopen( 'php://output', 'w' );
|
86 |
-
fwrite($output,chr(0xEF).chr(0xBB).chr(0xBF));
|
87 |
if ( $submissions->have_posts() ) {
|
88 |
$last_submission_id = $submissions->posts[0];
|
89 |
|
@@ -102,18 +100,18 @@ class CCF_Form_CPT {
|
|
102 |
$slug = get_post_meta( $field_id, 'ccf_field_slug', true );
|
103 |
|
104 |
if ( ! empty( $slug ) ) {
|
105 |
-
$attached_field_slugs[$slug] = $field_id;
|
106 |
}
|
107 |
}
|
108 |
|
109 |
foreach ( $slugs as $slug ) {
|
110 |
-
if ( ! empty( $attached_field_slugs[$slug] ) ) {
|
111 |
-
$fields[$slug] = array( 'id' => $attached_field_slugs[$slug], 'type' => get_post_meta( $attached_field_slugs[$slug], 'ccf_field_type', true ) );
|
112 |
}
|
113 |
}
|
114 |
}
|
115 |
|
116 |
-
$headers = array_merge( array( 'date', 'ip'
|
117 |
|
118 |
fputcsv( $output, $headers );
|
119 |
|
@@ -129,8 +127,8 @@ class CCF_Form_CPT {
|
|
129 |
foreach ( $fields as $slug => $field_array ) {
|
130 |
$type = $field_array['type'];
|
131 |
|
132 |
-
if ( ! empty( $submission_data[$slug] ) ) {
|
133 |
-
$field = $submission_data[$slug];
|
134 |
|
135 |
if ( 'date' === $type ) {
|
136 |
|
@@ -155,7 +153,6 @@ class CCF_Form_CPT {
|
|
155 |
} else {
|
156 |
$row[] = stripslashes( $field );
|
157 |
}
|
158 |
-
|
159 |
} elseif ( 'dropdown' === $type || 'radio' === $type || 'checkboxes' === $type ) {
|
160 |
if ( is_array( $field ) ) {
|
161 |
$i = 0;
|
@@ -178,11 +175,9 @@ class CCF_Form_CPT {
|
|
178 |
} else {
|
179 |
$row[] = $outputval;
|
180 |
}
|
181 |
-
|
182 |
} else {
|
183 |
$row[] = stripslashes( $field );
|
184 |
}
|
185 |
-
|
186 |
} else {
|
187 |
$row[] = stripslashes( $field );
|
188 |
}
|
@@ -296,7 +291,7 @@ class CCF_Form_CPT {
|
|
296 |
* @return string
|
297 |
*/
|
298 |
public function filter_get_the_excerpt( $excerpt ) {
|
299 |
-
if ('ccf_form' === get_post_type() ) {
|
300 |
$excerpt = get_post_meta( get_the_ID(), 'ccf_form_description', true );
|
301 |
}
|
302 |
|
@@ -306,7 +301,7 @@ class CCF_Form_CPT {
|
|
306 |
/**
|
307 |
* Modify row actions to fit a form.
|
308 |
*
|
309 |
-
* @param array
|
310 |
* @param object $post
|
311 |
* @since 6.0
|
312 |
* @return array
|
@@ -340,11 +335,11 @@ class CCF_Form_CPT {
|
|
340 |
global $pagenow;
|
341 |
|
342 |
remove_meta_box( 'slugdiv', 'ccf_form', 'normal' );
|
343 |
-
add_meta_box('ccf-at-a-glance', esc_html__( 'At a Glance', 'custom-contact-forms' ), array( $this, 'meta_box_at_a_glance' ), 'ccf_form', 'side', 'core' );
|
344 |
-
add_meta_box('ccf-preview', esc_html__( 'Preview', 'custom-contact-forms' ), array( $this, 'meta_box_preview' ), 'ccf_form', 'normal', 'core' );
|
345 |
|
346 |
if ( 'post-new.php' !== $pagenow ) {
|
347 |
-
add_meta_box('ccf-submissions', esc_html__( 'Submissions', 'custom-contact-forms' ), array( $this, 'meta_box_submissions' ), 'ccf_form', 'normal', 'core' );
|
348 |
}
|
349 |
|
350 |
remove_meta_box( 'wpseo_meta', 'ccf_form', 'normal' );
|
@@ -401,7 +396,7 @@ class CCF_Form_CPT {
|
|
401 |
<span id="timestamp" class="has-icon"><?php esc_html_e( 'Created on:', 'custom-contact-forms' ); ?> <strong><?php echo get_the_date( '', $post->ID ); ?></strong></span>
|
402 |
</div>
|
403 |
<div class="misc-pub-section">
|
404 |
-
<span id="ccf-created-by" class="has-icon"><?php esc_html_e( 'Author:', 'custom-contact-forms' ); ?> <strong><?php printf( '<a href="%s">%s</a>', esc_url( add_query_arg( array( 'post_type' => $post->post_type, 'author' => (int) $user->ID ), 'edit.php' )), esc_attr( $user->user_nicename ) ); ?></strong></span>
|
405 |
</div>
|
406 |
<div class="misc-pub-section">
|
407 |
<span id="ccf-field-num" class="has-icon"><?php esc_html_e( 'Number of fields:', 'custom-contact-forms' ); ?> <strong><?php echo count( $fields ); ?></strong></span>
|
@@ -413,7 +408,7 @@ class CCF_Form_CPT {
|
|
413 |
|
414 |
<div id="major-publishing-actions">
|
415 |
<div id="delete-action">
|
416 |
-
<a class="submitdelete deletion" href="<?php echo get_delete_post_link($post->ID); ?>"><?php esc_html_e( 'Move to Trash', 'custom-contact-forms' ); ?></a>
|
417 |
<div class="clear"></div>
|
418 |
</div>
|
419 |
|
@@ -445,7 +440,7 @@ class CCF_Form_CPT {
|
|
445 |
<span class="ccf-form-cpt-title">
|
446 |
<?php if ( ! empty( $title ) ) : ?>
|
447 |
<?php echo esc_html( $title ); ?>
|
448 |
-
<?php else: ?>
|
449 |
<?php esc_html_e( '(No title)', 'custom-contact-forms' ); ?>
|
450 |
<?php endif; ?>
|
451 |
</span>
|
@@ -465,19 +460,19 @@ class CCF_Form_CPT {
|
|
465 |
*/
|
466 |
public function action_admin_enqueue_scripts() {
|
467 |
if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
|
468 |
-
$admin_css_path = '/build/css/admin.css';
|
469 |
-
$form_cpt_css_path = '/build/css/form-cpt.css';
|
470 |
-
$form_table_css_path = '/build/css/form-table.css';
|
471 |
-
$form_cpt_preview_js_path = '/js/form-cpt-preview.js';
|
472 |
-
$mce_css_path = '/build/css/form-mce.css';
|
473 |
} else {
|
474 |
-
$admin_css_path = '/build/css/admin.min.css';
|
475 |
-
$form_cpt_css_path = '/build/css/form-cpt.min.css';
|
476 |
-
$form_table_css_path = '/build/css/form-table.min.css';
|
477 |
-
$form_cpt_preview_js_path = '/build/js/form-cpt-preview.min.js';
|
478 |
-
$mce_css_path = '/build/css/form-mce.min.css';
|
479 |
}
|
480 |
-
wp_enqueue_style( 'ccf-admin', plugins_url( $admin_css_path, dirname( __FILE__ ) ) );
|
481 |
|
482 |
global $pagenow;
|
483 |
|
@@ -486,12 +481,12 @@ class CCF_Form_CPT {
|
|
486 |
|
487 |
add_thickbox();
|
488 |
|
489 |
-
wp_enqueue_style( 'ccf-form-mce', plugins_url( $mce_css_path, dirname( __FILE__ ) ) );
|
490 |
-
wp_enqueue_style( 'ccf-form-cpt', plugins_url( $form_cpt_css_path, dirname( __FILE__ ) ) );
|
491 |
|
492 |
-
wp_enqueue_script( 'ccf-form-cpt-preview', plugins_url( $form_cpt_preview_js_path, dirname( __FILE__ ) ), array( 'jquery', 'backbone', 'ccf-form-manager' ),
|
493 |
} elseif ( 'edit.php' === $pagenow && 'ccf_form' === get_post_type() ) {
|
494 |
-
wp_enqueue_style( 'ccf-form-table', plugins_url( $form_table_css_path, dirname( __FILE__ ) ) );
|
495 |
}
|
496 |
}
|
497 |
|
@@ -510,7 +505,7 @@ class CCF_Form_CPT {
|
|
510 |
'author' => esc_html__( 'Author', 'custom-contact-forms' ),
|
511 |
'submissions' => esc_html__( 'Submissions', 'custom-contact-forms' ),
|
512 |
'fields' => esc_html__( 'Number of Fields', 'custom-contact-forms' ),
|
513 |
-
'ccf_date' => esc_html__( 'Date', 'custom-contact-forms' )
|
514 |
);
|
515 |
|
516 |
return $columns;
|
@@ -520,7 +515,7 @@ class CCF_Form_CPT {
|
|
520 |
* Output form columns. We redo the date column to get of inappropriate text such as "Published".
|
521 |
*
|
522 |
* @param string $column
|
523 |
-
* @param int
|
524 |
* @since 6.0
|
525 |
*/
|
526 |
public function action_columns( $column, $post_id ) {
|
@@ -551,10 +546,9 @@ class CCF_Form_CPT {
|
|
551 |
|
552 |
$time_diff = time() - $time;
|
553 |
|
554 |
-
if ( $time_diff > 0 && $time_diff < DAY_IN_SECONDS )
|
555 |
$h_time = sprintf( __( '%s ago' ), human_time_diff( $time ) );
|
556 |
-
else
|
557 |
-
$h_time = mysql2date( __( 'Y/m/d' ), $m_time );
|
558 |
}
|
559 |
|
560 |
echo '<abbr title="' . $t_time . '">' . $h_time . '</abbr>';
|
23 |
* @since 6.0
|
24 |
*/
|
25 |
public function setup() {
|
|
|
26 |
|
27 |
add_action( 'init', array( $this, 'setup_cpt' ) );
|
28 |
+
add_filter( 'manage_edit-ccf_form_columns', array( $this, 'filter_columns' ) );
|
29 |
add_action( 'manage_ccf_form_posts_custom_column', array( $this, 'action_columns' ), 10, 2 );
|
30 |
add_action( 'admin_enqueue_scripts', array( $this, 'action_admin_enqueue_scripts' ), 9 );
|
31 |
add_action( 'edit_form_after_title', array( $this, 'action_edit_form_after_title' ) );
|
52 |
return;
|
53 |
}
|
54 |
|
55 |
+
if ( empty( $_GET['post'] ) || 'ccf_form' !== get_post_type( $_GET['post'] ) ) {
|
56 |
return;
|
57 |
}
|
58 |
|
74 |
) );
|
75 |
|
76 |
// Todo: Unit tests
|
|
|
77 |
header( 'Content-Type: text/csv' );
|
78 |
header( 'Content-Disposition: attachment; filename=form-' . $post_id . '-submission-' . date( 'Y-m-d' ) . '.csv' );
|
79 |
header( 'Cache-Control: no-cache, no-store, must-revalidate' );
|
81 |
header( 'Expires: 0' );
|
82 |
|
83 |
$output = fopen( 'php://output', 'w' );
|
84 |
+
fwrite( $output,chr( 0xEF ).chr( 0xBB ).chr( 0xBF ) );
|
85 |
if ( $submissions->have_posts() ) {
|
86 |
$last_submission_id = $submissions->posts[0];
|
87 |
|
100 |
$slug = get_post_meta( $field_id, 'ccf_field_slug', true );
|
101 |
|
102 |
if ( ! empty( $slug ) ) {
|
103 |
+
$attached_field_slugs[ $slug ] = $field_id;
|
104 |
}
|
105 |
}
|
106 |
|
107 |
foreach ( $slugs as $slug ) {
|
108 |
+
if ( ! empty( $attached_field_slugs[ $slug ] ) ) {
|
109 |
+
$fields[ $slug ] = array( 'id' => $attached_field_slugs[ $slug ], 'type' => get_post_meta( $attached_field_slugs[ $slug ], 'ccf_field_type', true ) );
|
110 |
}
|
111 |
}
|
112 |
}
|
113 |
|
114 |
+
$headers = array_merge( array( 'date', 'ip' ), array_keys( $fields ) );
|
115 |
|
116 |
fputcsv( $output, $headers );
|
117 |
|
127 |
foreach ( $fields as $slug => $field_array ) {
|
128 |
$type = $field_array['type'];
|
129 |
|
130 |
+
if ( ! empty( $submission_data[ $slug ] ) ) {
|
131 |
+
$field = $submission_data[ $slug ];
|
132 |
|
133 |
if ( 'date' === $type ) {
|
134 |
|
153 |
} else {
|
154 |
$row[] = stripslashes( $field );
|
155 |
}
|
|
|
156 |
} elseif ( 'dropdown' === $type || 'radio' === $type || 'checkboxes' === $type ) {
|
157 |
if ( is_array( $field ) ) {
|
158 |
$i = 0;
|
175 |
} else {
|
176 |
$row[] = $outputval;
|
177 |
}
|
|
|
178 |
} else {
|
179 |
$row[] = stripslashes( $field );
|
180 |
}
|
|
|
181 |
} else {
|
182 |
$row[] = stripslashes( $field );
|
183 |
}
|
291 |
* @return string
|
292 |
*/
|
293 |
public function filter_get_the_excerpt( $excerpt ) {
|
294 |
+
if ( 'ccf_form' === get_post_type() ) {
|
295 |
$excerpt = get_post_meta( get_the_ID(), 'ccf_form_description', true );
|
296 |
}
|
297 |
|
301 |
/**
|
302 |
* Modify row actions to fit a form.
|
303 |
*
|
304 |
+
* @param array $actions
|
305 |
* @param object $post
|
306 |
* @since 6.0
|
307 |
* @return array
|
335 |
global $pagenow;
|
336 |
|
337 |
remove_meta_box( 'slugdiv', 'ccf_form', 'normal' );
|
338 |
+
add_meta_box( 'ccf-at-a-glance', esc_html__( 'At a Glance', 'custom-contact-forms' ), array( $this, 'meta_box_at_a_glance' ), 'ccf_form', 'side', 'core' );
|
339 |
+
add_meta_box( 'ccf-preview', esc_html__( 'Preview', 'custom-contact-forms' ), array( $this, 'meta_box_preview' ), 'ccf_form', 'normal', 'core' );
|
340 |
|
341 |
if ( 'post-new.php' !== $pagenow ) {
|
342 |
+
add_meta_box( 'ccf-submissions', esc_html__( 'Submissions', 'custom-contact-forms' ), array( $this, 'meta_box_submissions' ), 'ccf_form', 'normal', 'core' );
|
343 |
}
|
344 |
|
345 |
remove_meta_box( 'wpseo_meta', 'ccf_form', 'normal' );
|
396 |
<span id="timestamp" class="has-icon"><?php esc_html_e( 'Created on:', 'custom-contact-forms' ); ?> <strong><?php echo get_the_date( '', $post->ID ); ?></strong></span>
|
397 |
</div>
|
398 |
<div class="misc-pub-section">
|
399 |
+
<span id="ccf-created-by" class="has-icon"><?php esc_html_e( 'Author:', 'custom-contact-forms' ); ?> <strong><?php printf( '<a href="%s">%s</a>', esc_url( add_query_arg( array( 'post_type' => $post->post_type, 'author' => (int) $user->ID ), 'edit.php' ) ), esc_attr( $user->user_nicename ) ); ?></strong></span>
|
400 |
</div>
|
401 |
<div class="misc-pub-section">
|
402 |
<span id="ccf-field-num" class="has-icon"><?php esc_html_e( 'Number of fields:', 'custom-contact-forms' ); ?> <strong><?php echo count( $fields ); ?></strong></span>
|
408 |
|
409 |
<div id="major-publishing-actions">
|
410 |
<div id="delete-action">
|
411 |
+
<a class="submitdelete deletion" href="<?php echo get_delete_post_link( $post->ID ); ?>"><?php esc_html_e( 'Move to Trash', 'custom-contact-forms' ); ?></a>
|
412 |
<div class="clear"></div>
|
413 |
</div>
|
414 |
|
440 |
<span class="ccf-form-cpt-title">
|
441 |
<?php if ( ! empty( $title ) ) : ?>
|
442 |
<?php echo esc_html( $title ); ?>
|
443 |
+
<?php else : ?>
|
444 |
<?php esc_html_e( '(No title)', 'custom-contact-forms' ); ?>
|
445 |
<?php endif; ?>
|
446 |
</span>
|
460 |
*/
|
461 |
public function action_admin_enqueue_scripts() {
|
462 |
if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
|
463 |
+
$admin_css_path = '/assets/build/css/admin.css';
|
464 |
+
$form_cpt_css_path = '/assets/build/css/form-cpt.css';
|
465 |
+
$form_table_css_path = '/assets/build/css/form-table.css';
|
466 |
+
$form_cpt_preview_js_path = '/assets/js/form-cpt-preview.js';
|
467 |
+
$mce_css_path = '/assets/build/css/form-mce.css';
|
468 |
} else {
|
469 |
+
$admin_css_path = '/assets/build/css/admin.min.css';
|
470 |
+
$form_cpt_css_path = '/assets/build/css/form-cpt.min.css';
|
471 |
+
$form_table_css_path = '/assets/build/css/form-table.min.css';
|
472 |
+
$form_cpt_preview_js_path = '/assets/build/js/form-cpt-preview.min.js';
|
473 |
+
$mce_css_path = '/assets/build/css/form-mce.min.css';
|
474 |
}
|
475 |
+
wp_enqueue_style( 'ccf-admin', plugins_url( $admin_css_path, dirname( __FILE__ ) ), array(), CCF_VERSION );
|
476 |
|
477 |
global $pagenow;
|
478 |
|
481 |
|
482 |
add_thickbox();
|
483 |
|
484 |
+
wp_enqueue_style( 'ccf-form-mce', plugins_url( $mce_css_path, dirname( __FILE__ ) ), array(), CCF_VERSION );
|
485 |
+
wp_enqueue_style( 'ccf-form-cpt', plugins_url( $form_cpt_css_path, dirname( __FILE__ ) ), array(), CCF_VERSION );
|
486 |
|
487 |
+
wp_enqueue_script( 'ccf-form-cpt-preview', plugins_url( $form_cpt_preview_js_path, dirname( __FILE__ ) ), array( 'jquery', 'backbone', 'ccf-form-manager' ), CCF_VERSION, true );
|
488 |
} elseif ( 'edit.php' === $pagenow && 'ccf_form' === get_post_type() ) {
|
489 |
+
wp_enqueue_style( 'ccf-form-table', plugins_url( $form_table_css_path, dirname( __FILE__ ) ), array(), CCF_VERSION );
|
490 |
}
|
491 |
}
|
492 |
|
505 |
'author' => esc_html__( 'Author', 'custom-contact-forms' ),
|
506 |
'submissions' => esc_html__( 'Submissions', 'custom-contact-forms' ),
|
507 |
'fields' => esc_html__( 'Number of Fields', 'custom-contact-forms' ),
|
508 |
+
'ccf_date' => esc_html__( 'Date', 'custom-contact-forms' ),
|
509 |
);
|
510 |
|
511 |
return $columns;
|
515 |
* Output form columns. We redo the date column to get of inappropriate text such as "Published".
|
516 |
*
|
517 |
* @param string $column
|
518 |
+
* @param int $post_id
|
519 |
* @since 6.0
|
520 |
*/
|
521 |
public function action_columns( $column, $post_id ) {
|
546 |
|
547 |
$time_diff = time() - $time;
|
548 |
|
549 |
+
if ( $time_diff > 0 && $time_diff < DAY_IN_SECONDS ) {
|
550 |
$h_time = sprintf( __( '%s ago' ), human_time_diff( $time ) );
|
551 |
+
} else { $h_time = mysql2date( __( 'Y/m/d' ), $m_time ); }
|
|
|
552 |
}
|
553 |
|
554 |
echo '<abbr title="' . $t_time . '">' . $h_time . '</abbr>';
|
classes/class-ccf-form-handler.php
CHANGED
@@ -86,7 +86,7 @@ class CCF_Form_Handler {
|
|
86 |
* Upload file and return relevant attachment info
|
87 |
*
|
88 |
* @param string $value
|
89 |
-
* @param int
|
90 |
* @since 6.4
|
91 |
* @return array|int
|
92 |
*/
|
@@ -126,26 +126,26 @@ class CCF_Form_Handler {
|
|
126 |
$errors = array();
|
127 |
|
128 |
if ( $required ) {
|
129 |
-
if ( empty( $_FILES['ccf_field_' . $slug] ) || 4 === $_FILES['ccf_field_' . $slug]['error'] ) {
|
130 |
return array( 'required' => esc_html__( 'This field is required.', 'custom-contact-forms' ) );
|
131 |
}
|
132 |
} else {
|
133 |
-
if ( ! empty( $_FILES['ccf_field_' . $slug] ) && 4 === $_FILES['ccf_field_' . $slug]['error'] ) {
|
134 |
return true;
|
135 |
}
|
136 |
}
|
137 |
|
138 |
$max_file_size = get_post_meta( $field_id, 'ccf_field_maxFileSize', true );
|
139 |
|
140 |
-
if ( ! empty( $max_file_size ) && $_FILES['ccf_field_' . $slug]['size'] > ( $max_file_size * 1000 * 1000 ) || 1 === $_FILES['ccf_field_' . $slug]['error'] ) {
|
141 |
$errors['file_size'] = sprintf( esc_html__( 'This file is too big (%d MB max)', 'custom-contact-forms' ), (int) $max_file_size );
|
142 |
}
|
143 |
|
144 |
-
if ( ! empty( $_FILES['ccf_field_' . $slug]['error'] ) || empty( $_FILES['ccf_field_' . $slug]['size'] ) ) {
|
145 |
return array( 'file_upload' => esc_html__( 'An upload error occurred.', 'custom-contact-forms' ) );
|
146 |
}
|
147 |
|
148 |
-
$extension = strtolower( pathinfo( $_FILES['ccf_field_' . $slug]['name'], PATHINFO_EXTENSION ) );
|
149 |
|
150 |
$valid_extensions = get_post_meta( $field_id, 'ccf_field_fileExtensions', true );
|
151 |
|
@@ -157,9 +157,9 @@ class CCF_Form_Handler {
|
|
157 |
$ext = trim( $ext );
|
158 |
|
159 |
if ( empty( $ext ) ) {
|
160 |
-
unset( $valid_extensions[$key] );
|
161 |
} else {
|
162 |
-
$valid_extensions[$key] = $ext;
|
163 |
}
|
164 |
}
|
165 |
|
@@ -178,19 +178,19 @@ class CCF_Form_Handler {
|
|
178 |
/**
|
179 |
* Get errors for a form. Optional slug allows you to get errors from a specific field within a form
|
180 |
*
|
181 |
-
* @param int
|
182 |
* @param string $slug
|
183 |
* @since 6.0
|
184 |
* @return bool
|
185 |
*/
|
186 |
public function get_errors( $form_id, $slug = null ) {
|
187 |
-
if ( ! empty( $this->errors_by_form[$form_id] ) && is_array( $this->errors_by_form[$form_id] ) ) {
|
188 |
if ( ! empty( $slug ) ) {
|
189 |
-
if ( ! empty( $this->errors_by_form[$form_id][$slug] ) ) {
|
190 |
-
return $this->errors_by_form[$form_id][$slug];
|
191 |
}
|
192 |
} else {
|
193 |
-
return $this->errors_by_form[$form_id];
|
194 |
}
|
195 |
}
|
196 |
|
@@ -201,8 +201,8 @@ class CCF_Form_Handler {
|
|
201 |
* Simple callback to determine if a field is empty.
|
202 |
*
|
203 |
* @param mixed $value
|
204 |
-
* @param int
|
205 |
-
* @param bool
|
206 |
* @since 6.0
|
207 |
* @return array|bool
|
208 |
*/
|
@@ -218,8 +218,8 @@ class CCF_Form_Handler {
|
|
218 |
* Simple callback to determine if a choiceable is "empty"
|
219 |
*
|
220 |
* @param mixed $value
|
221 |
-
* @param int
|
222 |
-
* @param bool
|
223 |
* @since 6.4
|
224 |
* @return array|bool
|
225 |
*/
|
@@ -236,7 +236,7 @@ class CCF_Form_Handler {
|
|
236 |
|
237 |
if ( ! empty( $value ) ) {
|
238 |
foreach ( $value as $something ) {
|
239 |
-
if ( ! empty
|
240 |
$error = false;
|
241 |
}
|
242 |
}
|
@@ -271,8 +271,8 @@ class CCF_Form_Handler {
|
|
271 |
* Simple callback to determine if a phone number is valid
|
272 |
*
|
273 |
* @param mixed $value
|
274 |
-
* @param int
|
275 |
-
* @param bool
|
276 |
* @since 6.0
|
277 |
* @return array|bool
|
278 |
*/
|
@@ -312,8 +312,8 @@ class CCF_Form_Handler {
|
|
312 |
* Simple callback to determine if an address is valid
|
313 |
*
|
314 |
* @param mixed $value
|
315 |
-
* @param int
|
316 |
-
* @param bool
|
317 |
* @since 6.0
|
318 |
* @return array|bool
|
319 |
*/
|
@@ -355,8 +355,8 @@ class CCF_Form_Handler {
|
|
355 |
* Simple callback to determine if an email is valid
|
356 |
*
|
357 |
* @param mixed $value
|
358 |
-
* @param int
|
359 |
-
* @param bool
|
360 |
* @since 6.0
|
361 |
* @return array|bool
|
362 |
*/
|
@@ -400,8 +400,8 @@ class CCF_Form_Handler {
|
|
400 |
* Simple callback to determine if a name is valid
|
401 |
*
|
402 |
* @param mixed $value
|
403 |
-
* @param int
|
404 |
-
* @param bool
|
405 |
* @since 6.0
|
406 |
* @return array|bool
|
407 |
*/
|
@@ -427,8 +427,8 @@ class CCF_Form_Handler {
|
|
427 |
* Simple callback to determine if a website is valid
|
428 |
*
|
429 |
* @param mixed $value
|
430 |
-
* @param int
|
431 |
-
* @param bool
|
432 |
* @since 6.0
|
433 |
* @return array|bool
|
434 |
*/
|
@@ -453,8 +453,8 @@ class CCF_Form_Handler {
|
|
453 |
* Simple callback to determine if a date is valid
|
454 |
*
|
455 |
* @param mixed $value
|
456 |
-
* @param int
|
457 |
-
* @param bool
|
458 |
* @since 6.0
|
459 |
* @return array|bool
|
460 |
*/
|
@@ -537,7 +537,7 @@ class CCF_Form_Handler {
|
|
537 |
* Simple callback to sanitize a phone number
|
538 |
*
|
539 |
* @param mixed $value
|
540 |
-
* @param int
|
541 |
* @since 6.0
|
542 |
* @return string
|
543 |
*/
|
@@ -586,11 +586,11 @@ class CCF_Form_Handler {
|
|
586 |
function process_submission() {
|
587 |
if ( ! empty( $_POST['my_information'] ) ) {
|
588 |
// Honeypot
|
589 |
-
return array( 'error' => 'honeypot', 'success' => false
|
590 |
}
|
591 |
|
592 |
if ( empty( $_POST['form_nonce'] ) || ! wp_verify_nonce( $_POST['form_nonce'], 'ccf_form' ) ) {
|
593 |
-
return array( 'error' => 'nonce', 'success' => false
|
594 |
}
|
595 |
|
596 |
$form_id = (int) $_POST['form_id'];
|
@@ -598,7 +598,7 @@ class CCF_Form_Handler {
|
|
598 |
$form = get_post( $form_id );
|
599 |
|
600 |
if ( empty( $form ) ) {
|
601 |
-
return array( 'error' => 'missing_form', 'success' => false
|
602 |
}
|
603 |
|
604 |
$fields = get_post_meta( $form->ID, 'ccf_attached_fields', true );
|
@@ -633,41 +633,41 @@ class CCF_Form_Handler {
|
|
633 |
$slug = $meta_value[0];
|
634 |
}
|
635 |
|
636 |
-
$new_field[$meta_key] = wp_kses_post( $meta_value[0] );
|
637 |
}
|
638 |
}
|
639 |
|
640 |
-
$all_form_fields[$slug] = $new_field;
|
641 |
|
642 |
// We save this to reference later
|
643 |
-
$field_slug_to_id[$slug] = array( 'id' => $field_id, 'type' => sanitize_text_field( $type ) );
|
644 |
|
645 |
$custom_value_mapping = array( 'recaptcha' => 'g-recaptcha-response' );
|
646 |
|
647 |
if ( in_array( $type, array_keys( $custom_value_mapping ) ) ) {
|
648 |
-
$value = ( isset( $_POST[$custom_value_mapping[$type]] ) ) ? $_POST[$custom_value_mapping[$type]] : '';
|
649 |
} else {
|
650 |
-
$value = ( isset( $_POST['ccf_field_' . $slug] ) ) ? $_POST['ccf_field_' . $slug] : '';
|
651 |
}
|
652 |
|
653 |
$validation = $this->process_field( $field_id, $value );
|
654 |
|
655 |
if ( $validation['error'] !== null ) {
|
656 |
-
$errors[$slug] = $validation['error'];
|
657 |
} else {
|
658 |
if ( ! in_array( $type, $save_skip_fields ) ) {
|
659 |
-
$submission[$slug] = $validation['sanitized_value'];
|
660 |
|
661 |
if ( 'file' === $type ) {
|
662 |
-
$file_ids[] = $submission[$slug]['id'];
|
663 |
}
|
664 |
}
|
665 |
}
|
666 |
}
|
667 |
|
668 |
if ( ! empty( $errors ) ) {
|
669 |
-
$this->errors_by_form[$form_id] = $errors;
|
670 |
-
return array( 'error' => 'invalid_fields', 'field_errors' => $errors, 'success' => false
|
671 |
} else {
|
672 |
$submission_id = wp_insert_post( array(
|
673 |
'post_status' => 'publish',
|
@@ -702,11 +702,10 @@ class CCF_Form_Handler {
|
|
702 |
} else {
|
703 |
do_action( 'ccf_unsuccessful_submission', $form_id );
|
704 |
|
705 |
-
return array( 'error' => 'could_not_create_submission', 'success' => false
|
706 |
}
|
707 |
|
708 |
// Post creation
|
709 |
-
|
710 |
$post_creation = get_post_meta( $form_id, 'ccf_form_post_creation', true );
|
711 |
|
712 |
if ( ! empty( $post_creation ) ) {
|
@@ -726,11 +725,11 @@ class CCF_Form_Handler {
|
|
726 |
$custom_fields = array();
|
727 |
|
728 |
foreach ( $mappings as $mapping ) {
|
729 |
-
if ( ! empty( $mapping['formField'] ) && isset( $submission[$mapping['formField']] ) ) {
|
730 |
-
$field_id = $field_slug_to_id[$mapping['formField']]['id'];
|
731 |
$field_type = get_post_meta( $field_id, 'ccf_field_type', true );
|
732 |
|
733 |
-
$submission_value = $submission[$mapping['formField']];
|
734 |
if ( is_array( $submission_value ) && isset( $submission_value['email'] ) ) {
|
735 |
$submission_value = $submission_value['email'];
|
736 |
}
|
@@ -749,7 +748,7 @@ class CCF_Form_Handler {
|
|
749 |
} elseif ( 'dropdown' == $field_type && is_array( $submission_value ) ) {
|
750 |
$tags = array_merge( $tags, $submission_value );
|
751 |
} else {
|
752 |
-
$tags[] = $this->_flatten_and_concat( $submission[$mapping['formField']] );
|
753 |
}
|
754 |
} elseif ( 'custom_field' === $mapping['postField'] && ! empty( $mapping['customFieldKey'] ) ) {
|
755 |
$custom_fields[] = array(
|
@@ -795,20 +794,19 @@ class CCF_Form_Handler {
|
|
795 |
$form_page = ( ! empty( $_POST['form_page'] ) ) ? $_POST['form_page'] : null;
|
796 |
|
797 |
if ( ! empty( $notifications ) ) {
|
798 |
-
foreach( $notifications as $notification ) {
|
799 |
if ( ! empty( $notification['active'] ) && ! empty( $notification['addresses'] ) ) {
|
800 |
|
801 |
$message = $notification['content'];
|
802 |
|
803 |
// Variables
|
804 |
-
|
805 |
if ( false !== stripos( $message, '[all_fields]' ) ) {
|
806 |
$all_fields = '';
|
807 |
|
808 |
ob_start();
|
809 |
|
810 |
foreach ( $submission as $slug => $field ) {
|
811 |
-
$field_id = $field_slug_to_id[$slug]['id'];
|
812 |
$label = get_post_meta( $field_id, 'ccf_field_label', true );
|
813 |
$type = get_post_meta( $field_id, 'ccf_field_type', true );
|
814 |
|
@@ -909,11 +907,15 @@ class CCF_Form_Handler {
|
|
909 |
$message = str_ireplace( '[ip_address]', $_SERVER['REMOTE_ADDR'], $message );
|
910 |
}
|
911 |
|
|
|
|
|
|
|
|
|
912 |
foreach ( $fields as $field_id ) {
|
913 |
$field_slug = get_post_meta( $field_id, 'ccf_field_slug', true );
|
914 |
|
915 |
-
if ( ! empty( $field_slug ) && isset( $submission[$field_slug] ) ) {
|
916 |
-
$value = $submission[$field_slug];
|
917 |
if ( is_array( $value ) && isset( $value['email'] ) ) {
|
918 |
$value = $value['email'];
|
919 |
}
|
@@ -936,28 +938,28 @@ class CCF_Form_Handler {
|
|
936 |
$name = $notification['fromName'];
|
937 |
} else {
|
938 |
$name_field = $notification['fromNameField'];
|
939 |
-
|
940 |
-
if ( ! empty( $name_field ) && ! empty( $submission[$name_field] ) ) {
|
941 |
-
if ( is_array( $submission[$name_field] ) ) {
|
942 |
-
if ( ! empty( $submission[$name_field]['first'] ) || ! empty( $submission[$name_field]['last'] ) ) {
|
943 |
-
$name = $submission[$name_field]['first'] . ' ' . $submission[$name_field]['last'];
|
944 |
}
|
945 |
} else {
|
946 |
-
$name = $submission[$name_field];
|
947 |
}
|
948 |
}
|
949 |
}
|
950 |
-
|
951 |
if ( 'custom' === $notification['fromType'] ) {
|
952 |
$email = $notification['fromAddress'];
|
953 |
} elseif ( 'field' === $notification['fromType'] ) {
|
954 |
$email_field = $notification['fromField'];
|
955 |
|
956 |
-
if ( ! empty( $email_field ) && ! empty( $submission[$email_field] ) ) {
|
957 |
-
if ( is_array( $submission[$email_field] ) && ! empty( $submission[$email_field]['confirm'] ) ) {
|
958 |
-
$email = $submission[$email_field]['confirm'];
|
959 |
} else {
|
960 |
-
$email = $submission[$email_field];
|
961 |
}
|
962 |
}
|
963 |
}
|
@@ -966,7 +968,7 @@ class CCF_Form_Handler {
|
|
966 |
$headers[] = 'From: ' . sanitize_text_field( $name ) . ' <' . sanitize_email( $email ) . '>';
|
967 |
$headers[] = 'Reply-To: ' . sanitize_email( $email );
|
968 |
} elseif ( ! empty( $name ) && empty( $email ) ) {
|
969 |
-
$headers[] = 'From: ' . sanitize_text_field( $name ) . '<' . sanitize_email( $default_from_email ) . '>';
|
970 |
} elseif ( empty( $name ) && ! empty( $email ) ) {
|
971 |
// @Todo: investigate how wp_mail handles From: email
|
972 |
$headers[] = 'From: ' . sanitize_email( $email );
|
@@ -984,9 +986,9 @@ class CCF_Form_Handler {
|
|
984 |
$subject = $notification['subject'];
|
985 |
} elseif ( 'field' === $email_notification_subject_type ) {
|
986 |
$subject_field = $notification['subjectField'];
|
987 |
-
|
988 |
-
if ( ! empty( $subject_field ) && ! empty( $submission[$subject_field] ) ) {
|
989 |
-
$subject = $submission[$subject_field];
|
990 |
}
|
991 |
}
|
992 |
|
@@ -1001,11 +1003,11 @@ class CCF_Form_Handler {
|
|
1001 |
} else {
|
1002 |
$email_field = $address['field'];
|
1003 |
|
1004 |
-
if ( ! empty( $email_field ) && ! empty( $submission[$email_field] ) ) {
|
1005 |
-
if ( is_array( $submission[$email_field] ) && ! empty( $submission[$email_field]['confirm'] ) ) {
|
1006 |
-
$email = $submission[$email_field]['confirm'];
|
1007 |
} else {
|
1008 |
-
$email = $submission[$email_field];
|
1009 |
}
|
1010 |
}
|
1011 |
}
|
@@ -1025,12 +1027,10 @@ class CCF_Form_Handler {
|
|
1025 |
}
|
1026 |
}
|
1027 |
}
|
1028 |
-
|
1029 |
}
|
1030 |
}
|
1031 |
}
|
1032 |
|
1033 |
-
|
1034 |
if ( 'redirect' === $output['action_type'] ) {
|
1035 |
$output['completion_redirect_url'] = get_post_meta( $form_id, 'ccf_form_completion_redirect_url', true );
|
1036 |
} else {
|
@@ -1048,7 +1048,7 @@ class CCF_Form_Handler {
|
|
1048 |
/**
|
1049 |
* Process a field. Either return errors or sanitized form submission value.
|
1050 |
*
|
1051 |
-
* @param int
|
1052 |
* @param string $value
|
1053 |
* @since 6.0
|
1054 |
* @return array
|
@@ -1062,7 +1062,7 @@ class CCF_Form_Handler {
|
|
1062 |
$type = get_post_meta( $field_id, 'ccf_field_type', true );
|
1063 |
$required = get_post_meta( $field_id, 'ccf_field_required', true );
|
1064 |
|
1065 |
-
$callback = ( ! empty( $this->field_callbacks[$type]['validator'] ) ) ? $this->field_callbacks[$type]['validator'] : null;
|
1066 |
$validator = apply_filters( 'ccf_field_validator', $callback, $value, $field_id, $type );
|
1067 |
|
1068 |
$is_valid = true;
|
@@ -1077,13 +1077,13 @@ class CCF_Form_Handler {
|
|
1077 |
$return['sanitized_value'] = array();
|
1078 |
|
1079 |
foreach ( $value as $key => $single_value ) {
|
1080 |
-
if ( ! empty( $this->field_callbacks[$type]['sanitizer'] ) ) {
|
1081 |
-
$return['sanitized_value'][$key] = call_user_func( apply_filters( 'ccf_field_sanitizer', $this->field_callbacks[$type]['sanitizer'], $single_value, $field_id, $type ), $single_value, $field_id );
|
1082 |
}
|
1083 |
}
|
1084 |
} else {
|
1085 |
-
if ( ! empty( $this->field_callbacks[$type]['sanitizer'] ) ) {
|
1086 |
-
$return['sanitized_value'] = call_user_func( apply_filters( 'ccf_field_sanitizer', $this->field_callbacks[$type]['sanitizer'], $value, $field_id, $type ), $value, $field_id );
|
1087 |
}
|
1088 |
}
|
1089 |
}
|
@@ -1132,4 +1132,4 @@ class CCF_Form_Handler {
|
|
1132 |
|
1133 |
return $instance;
|
1134 |
}
|
1135 |
-
}
|
86 |
* Upload file and return relevant attachment info
|
87 |
*
|
88 |
* @param string $value
|
89 |
+
* @param int $field_id
|
90 |
* @since 6.4
|
91 |
* @return array|int
|
92 |
*/
|
126 |
$errors = array();
|
127 |
|
128 |
if ( $required ) {
|
129 |
+
if ( empty( $_FILES[ 'ccf_field_' . $slug ] ) || 4 === $_FILES[ 'ccf_field_' . $slug ]['error'] ) {
|
130 |
return array( 'required' => esc_html__( 'This field is required.', 'custom-contact-forms' ) );
|
131 |
}
|
132 |
} else {
|
133 |
+
if ( ! empty( $_FILES[ 'ccf_field_' . $slug ] ) && 4 === $_FILES[ 'ccf_field_' . $slug ]['error'] ) {
|
134 |
return true;
|
135 |
}
|
136 |
}
|
137 |
|
138 |
$max_file_size = get_post_meta( $field_id, 'ccf_field_maxFileSize', true );
|
139 |
|
140 |
+
if ( ! empty( $max_file_size ) && $_FILES[ 'ccf_field_' . $slug ]['size'] > ( $max_file_size * 1000 * 1000 ) || 1 === $_FILES[ 'ccf_field_' . $slug ]['error'] ) {
|
141 |
$errors['file_size'] = sprintf( esc_html__( 'This file is too big (%d MB max)', 'custom-contact-forms' ), (int) $max_file_size );
|
142 |
}
|
143 |
|
144 |
+
if ( ! empty( $_FILES[ 'ccf_field_' . $slug ]['error'] ) || empty( $_FILES[ 'ccf_field_' . $slug ]['size'] ) ) {
|
145 |
return array( 'file_upload' => esc_html__( 'An upload error occurred.', 'custom-contact-forms' ) );
|
146 |
}
|
147 |
|
148 |
+
$extension = strtolower( pathinfo( $_FILES[ 'ccf_field_' . $slug ]['name'], PATHINFO_EXTENSION ) );
|
149 |
|
150 |
$valid_extensions = get_post_meta( $field_id, 'ccf_field_fileExtensions', true );
|
151 |
|
157 |
$ext = trim( $ext );
|
158 |
|
159 |
if ( empty( $ext ) ) {
|
160 |
+
unset( $valid_extensions[ $key ] );
|
161 |
} else {
|
162 |
+
$valid_extensions[ $key ] = $ext;
|
163 |
}
|
164 |
}
|
165 |
|
178 |
/**
|
179 |
* Get errors for a form. Optional slug allows you to get errors from a specific field within a form
|
180 |
*
|
181 |
+
* @param int $form_id
|
182 |
* @param string $slug
|
183 |
* @since 6.0
|
184 |
* @return bool
|
185 |
*/
|
186 |
public function get_errors( $form_id, $slug = null ) {
|
187 |
+
if ( ! empty( $this->errors_by_form[ $form_id ] ) && is_array( $this->errors_by_form[ $form_id ] ) ) {
|
188 |
if ( ! empty( $slug ) ) {
|
189 |
+
if ( ! empty( $this->errors_by_form[ $form_id ][ $slug ] ) ) {
|
190 |
+
return $this->errors_by_form[ $form_id ][ $slug ];
|
191 |
}
|
192 |
} else {
|
193 |
+
return $this->errors_by_form[ $form_id ];
|
194 |
}
|
195 |
}
|
196 |
|
201 |
* Simple callback to determine if a field is empty.
|
202 |
*
|
203 |
* @param mixed $value
|
204 |
+
* @param int $field_id
|
205 |
+
* @param bool $required
|
206 |
* @since 6.0
|
207 |
* @return array|bool
|
208 |
*/
|
218 |
* Simple callback to determine if a choiceable is "empty"
|
219 |
*
|
220 |
* @param mixed $value
|
221 |
+
* @param int $field_id
|
222 |
+
* @param bool $required
|
223 |
* @since 6.4
|
224 |
* @return array|bool
|
225 |
*/
|
236 |
|
237 |
if ( ! empty( $value ) ) {
|
238 |
foreach ( $value as $something ) {
|
239 |
+
if ( ! empty( $something ) ) {
|
240 |
$error = false;
|
241 |
}
|
242 |
}
|
271 |
* Simple callback to determine if a phone number is valid
|
272 |
*
|
273 |
* @param mixed $value
|
274 |
+
* @param int $field_id
|
275 |
+
* @param bool $required
|
276 |
* @since 6.0
|
277 |
* @return array|bool
|
278 |
*/
|
312 |
* Simple callback to determine if an address is valid
|
313 |
*
|
314 |
* @param mixed $value
|
315 |
+
* @param int $field_id
|
316 |
+
* @param bool $required
|
317 |
* @since 6.0
|
318 |
* @return array|bool
|
319 |
*/
|
355 |
* Simple callback to determine if an email is valid
|
356 |
*
|
357 |
* @param mixed $value
|
358 |
+
* @param int $field_id
|
359 |
+
* @param bool $required
|
360 |
* @since 6.0
|
361 |
* @return array|bool
|
362 |
*/
|
400 |
* Simple callback to determine if a name is valid
|
401 |
*
|
402 |
* @param mixed $value
|
403 |
+
* @param int $field_id
|
404 |
+
* @param bool $required
|
405 |
* @since 6.0
|
406 |
* @return array|bool
|
407 |
*/
|
427 |
* Simple callback to determine if a website is valid
|
428 |
*
|
429 |
* @param mixed $value
|
430 |
+
* @param int $field_id
|
431 |
+
* @param bool $required
|
432 |
* @since 6.0
|
433 |
* @return array|bool
|
434 |
*/
|
453 |
* Simple callback to determine if a date is valid
|
454 |
*
|
455 |
* @param mixed $value
|
456 |
+
* @param int $field_id
|
457 |
+
* @param bool $required
|
458 |
* @since 6.0
|
459 |
* @return array|bool
|
460 |
*/
|
537 |
* Simple callback to sanitize a phone number
|
538 |
*
|
539 |
* @param mixed $value
|
540 |
+
* @param int $field_id
|
541 |
* @since 6.0
|
542 |
* @return string
|
543 |
*/
|
586 |
function process_submission() {
|
587 |
if ( ! empty( $_POST['my_information'] ) ) {
|
588 |
// Honeypot
|
589 |
+
return array( 'error' => 'honeypot', 'success' => false );
|
590 |
}
|
591 |
|
592 |
if ( empty( $_POST['form_nonce'] ) || ! wp_verify_nonce( $_POST['form_nonce'], 'ccf_form' ) ) {
|
593 |
+
return array( 'error' => 'nonce', 'success' => false );
|
594 |
}
|
595 |
|
596 |
$form_id = (int) $_POST['form_id'];
|
598 |
$form = get_post( $form_id );
|
599 |
|
600 |
if ( empty( $form ) ) {
|
601 |
+
return array( 'error' => 'missing_form', 'success' => false );
|
602 |
}
|
603 |
|
604 |
$fields = get_post_meta( $form->ID, 'ccf_attached_fields', true );
|
633 |
$slug = $meta_value[0];
|
634 |
}
|
635 |
|
636 |
+
$new_field[ $meta_key ] = wp_kses_post( $meta_value[0] );
|
637 |
}
|
638 |
}
|
639 |
|
640 |
+
$all_form_fields[ $slug ] = $new_field;
|
641 |
|
642 |
// We save this to reference later
|
643 |
+
$field_slug_to_id[ $slug ] = array( 'id' => $field_id, 'type' => sanitize_text_field( $type ) );
|
644 |
|
645 |
$custom_value_mapping = array( 'recaptcha' => 'g-recaptcha-response' );
|
646 |
|
647 |
if ( in_array( $type, array_keys( $custom_value_mapping ) ) ) {
|
648 |
+
$value = ( isset( $_POST[ $custom_value_mapping[ $type ] ] ) ) ? $_POST[ $custom_value_mapping[ $type ] ] : '';
|
649 |
} else {
|
650 |
+
$value = ( isset( $_POST[ 'ccf_field_' . $slug ] ) ) ? $_POST[ 'ccf_field_' . $slug ] : '';
|
651 |
}
|
652 |
|
653 |
$validation = $this->process_field( $field_id, $value );
|
654 |
|
655 |
if ( $validation['error'] !== null ) {
|
656 |
+
$errors[ $slug ] = $validation['error'];
|
657 |
} else {
|
658 |
if ( ! in_array( $type, $save_skip_fields ) ) {
|
659 |
+
$submission[ $slug ] = $validation['sanitized_value'];
|
660 |
|
661 |
if ( 'file' === $type ) {
|
662 |
+
$file_ids[] = $submission[ $slug ]['id'];
|
663 |
}
|
664 |
}
|
665 |
}
|
666 |
}
|
667 |
|
668 |
if ( ! empty( $errors ) ) {
|
669 |
+
$this->errors_by_form[ $form_id ] = $errors;
|
670 |
+
return array( 'error' => 'invalid_fields', 'field_errors' => $errors, 'success' => false );
|
671 |
} else {
|
672 |
$submission_id = wp_insert_post( array(
|
673 |
'post_status' => 'publish',
|
702 |
} else {
|
703 |
do_action( 'ccf_unsuccessful_submission', $form_id );
|
704 |
|
705 |
+
return array( 'error' => 'could_not_create_submission', 'success' => false );
|
706 |
}
|
707 |
|
708 |
// Post creation
|
|
|
709 |
$post_creation = get_post_meta( $form_id, 'ccf_form_post_creation', true );
|
710 |
|
711 |
if ( ! empty( $post_creation ) ) {
|
725 |
$custom_fields = array();
|
726 |
|
727 |
foreach ( $mappings as $mapping ) {
|
728 |
+
if ( ! empty( $mapping['formField'] ) && isset( $submission[ $mapping['formField'] ] ) ) {
|
729 |
+
$field_id = $field_slug_to_id[ $mapping['formField'] ]['id'];
|
730 |
$field_type = get_post_meta( $field_id, 'ccf_field_type', true );
|
731 |
|
732 |
+
$submission_value = $submission[ $mapping['formField'] ];
|
733 |
if ( is_array( $submission_value ) && isset( $submission_value['email'] ) ) {
|
734 |
$submission_value = $submission_value['email'];
|
735 |
}
|
748 |
} elseif ( 'dropdown' == $field_type && is_array( $submission_value ) ) {
|
749 |
$tags = array_merge( $tags, $submission_value );
|
750 |
} else {
|
751 |
+
$tags[] = $this->_flatten_and_concat( $submission[ $mapping['formField'] ] );
|
752 |
}
|
753 |
} elseif ( 'custom_field' === $mapping['postField'] && ! empty( $mapping['customFieldKey'] ) ) {
|
754 |
$custom_fields[] = array(
|
794 |
$form_page = ( ! empty( $_POST['form_page'] ) ) ? $_POST['form_page'] : null;
|
795 |
|
796 |
if ( ! empty( $notifications ) ) {
|
797 |
+
foreach ( $notifications as $notification ) {
|
798 |
if ( ! empty( $notification['active'] ) && ! empty( $notification['addresses'] ) ) {
|
799 |
|
800 |
$message = $notification['content'];
|
801 |
|
802 |
// Variables
|
|
|
803 |
if ( false !== stripos( $message, '[all_fields]' ) ) {
|
804 |
$all_fields = '';
|
805 |
|
806 |
ob_start();
|
807 |
|
808 |
foreach ( $submission as $slug => $field ) {
|
809 |
+
$field_id = $field_slug_to_id[ $slug ]['id'];
|
810 |
$label = get_post_meta( $field_id, 'ccf_field_label', true );
|
811 |
$type = get_post_meta( $field_id, 'ccf_field_type', true );
|
812 |
|
907 |
$message = str_ireplace( '[ip_address]', $_SERVER['REMOTE_ADDR'], $message );
|
908 |
}
|
909 |
|
910 |
+
if ( false !== stripos( $message, '[current_date_time]' ) ) {
|
911 |
+
$message = str_ireplace( '[current_date_time]', date( 'F j, Y, g:i a' ), $message );
|
912 |
+
}
|
913 |
+
|
914 |
foreach ( $fields as $field_id ) {
|
915 |
$field_slug = get_post_meta( $field_id, 'ccf_field_slug', true );
|
916 |
|
917 |
+
if ( ! empty( $field_slug ) && isset( $submission[ $field_slug ] ) ) {
|
918 |
+
$value = $submission[ $field_slug ];
|
919 |
if ( is_array( $value ) && isset( $value['email'] ) ) {
|
920 |
$value = $value['email'];
|
921 |
}
|
938 |
$name = $notification['fromName'];
|
939 |
} else {
|
940 |
$name_field = $notification['fromNameField'];
|
941 |
+
|
942 |
+
if ( ! empty( $name_field ) && ! empty( $submission[ $name_field ] ) ) {
|
943 |
+
if ( is_array( $submission[ $name_field ] ) ) {
|
944 |
+
if ( ! empty( $submission[ $name_field ]['first'] ) || ! empty( $submission[ $name_field ]['last'] ) ) {
|
945 |
+
$name = $submission[ $name_field ]['first'] . ' ' . $submission[ $name_field ]['last'];
|
946 |
}
|
947 |
} else {
|
948 |
+
$name = $submission[ $name_field ];
|
949 |
}
|
950 |
}
|
951 |
}
|
952 |
+
|
953 |
if ( 'custom' === $notification['fromType'] ) {
|
954 |
$email = $notification['fromAddress'];
|
955 |
} elseif ( 'field' === $notification['fromType'] ) {
|
956 |
$email_field = $notification['fromField'];
|
957 |
|
958 |
+
if ( ! empty( $email_field ) && ! empty( $submission[ $email_field ] ) ) {
|
959 |
+
if ( is_array( $submission[ $email_field ] ) && ! empty( $submission[ $email_field ]['confirm'] ) ) {
|
960 |
+
$email = $submission[ $email_field ]['confirm'];
|
961 |
} else {
|
962 |
+
$email = $submission[ $email_field ];
|
963 |
}
|
964 |
}
|
965 |
}
|
968 |
$headers[] = 'From: ' . sanitize_text_field( $name ) . ' <' . sanitize_email( $email ) . '>';
|
969 |
$headers[] = 'Reply-To: ' . sanitize_email( $email );
|
970 |
} elseif ( ! empty( $name ) && empty( $email ) ) {
|
971 |
+
$headers[] = 'From: ' . sanitize_text_field( $name ) . ' <' . sanitize_email( $default_from_email ) . '>';
|
972 |
} elseif ( empty( $name ) && ! empty( $email ) ) {
|
973 |
// @Todo: investigate how wp_mail handles From: email
|
974 |
$headers[] = 'From: ' . sanitize_email( $email );
|
986 |
$subject = $notification['subject'];
|
987 |
} elseif ( 'field' === $email_notification_subject_type ) {
|
988 |
$subject_field = $notification['subjectField'];
|
989 |
+
|
990 |
+
if ( ! empty( $subject_field ) && ! empty( $submission[ $subject_field ] ) ) {
|
991 |
+
$subject = $submission[ $subject_field ];
|
992 |
}
|
993 |
}
|
994 |
|
1003 |
} else {
|
1004 |
$email_field = $address['field'];
|
1005 |
|
1006 |
+
if ( ! empty( $email_field ) && ! empty( $submission[ $email_field ] ) ) {
|
1007 |
+
if ( is_array( $submission[ $email_field ] ) && ! empty( $submission[ $email_field ]['confirm'] ) ) {
|
1008 |
+
$email = $submission[ $email_field ]['confirm'];
|
1009 |
} else {
|
1010 |
+
$email = $submission[ $email_field ];
|
1011 |
}
|
1012 |
}
|
1013 |
}
|
1027 |
}
|
1028 |
}
|
1029 |
}
|
|
|
1030 |
}
|
1031 |
}
|
1032 |
}
|
1033 |
|
|
|
1034 |
if ( 'redirect' === $output['action_type'] ) {
|
1035 |
$output['completion_redirect_url'] = get_post_meta( $form_id, 'ccf_form_completion_redirect_url', true );
|
1036 |
} else {
|
1048 |
/**
|
1049 |
* Process a field. Either return errors or sanitized form submission value.
|
1050 |
*
|
1051 |
+
* @param int $field_id
|
1052 |
* @param string $value
|
1053 |
* @since 6.0
|
1054 |
* @return array
|
1062 |
$type = get_post_meta( $field_id, 'ccf_field_type', true );
|
1063 |
$required = get_post_meta( $field_id, 'ccf_field_required', true );
|
1064 |
|
1065 |
+
$callback = ( ! empty( $this->field_callbacks[ $type ]['validator'] ) ) ? $this->field_callbacks[ $type ]['validator'] : null;
|
1066 |
$validator = apply_filters( 'ccf_field_validator', $callback, $value, $field_id, $type );
|
1067 |
|
1068 |
$is_valid = true;
|
1077 |
$return['sanitized_value'] = array();
|
1078 |
|
1079 |
foreach ( $value as $key => $single_value ) {
|
1080 |
+
if ( ! empty( $this->field_callbacks[ $type ]['sanitizer'] ) ) {
|
1081 |
+
$return['sanitized_value'][ $key ] = call_user_func( apply_filters( 'ccf_field_sanitizer', $this->field_callbacks[ $type ]['sanitizer'], $single_value, $field_id, $type ), $single_value, $field_id );
|
1082 |
}
|
1083 |
}
|
1084 |
} else {
|
1085 |
+
if ( ! empty( $this->field_callbacks[ $type ]['sanitizer'] ) ) {
|
1086 |
+
$return['sanitized_value'] = call_user_func( apply_filters( 'ccf_field_sanitizer', $this->field_callbacks[ $type ]['sanitizer'], $value, $field_id, $type ), $value, $field_id );
|
1087 |
}
|
1088 |
}
|
1089 |
}
|
1132 |
|
1133 |
return $instance;
|
1134 |
}
|
1135 |
+
}
|
classes/class-ccf-form-mail.php
CHANGED
@@ -11,4 +11,4 @@ class CCF_Form_Mail {
|
|
11 |
public function send() {
|
12 |
|
13 |
}
|
14 |
-
}
|
11 |
public function send() {
|
12 |
|
13 |
}
|
14 |
+
}
|
classes/class-ccf-form-manager.php
CHANGED
@@ -33,9 +33,9 @@ class CCF_Form_Manager {
|
|
33 |
}
|
34 |
|
35 |
if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
|
36 |
-
$css_path = '/build/css/form-mce.css';
|
37 |
} else {
|
38 |
-
$css_path = '/build/css/form-mce.min.css';
|
39 |
}
|
40 |
|
41 |
$css .= ', ' . plugins_url( $css_path, dirname( __FILE__ ) );
|
@@ -140,18 +140,9 @@ class CCF_Form_Manager {
|
|
140 |
<div class="right-sidebar ccf-field-sidebar accordion-container"></div>
|
141 |
|
142 |
<div class="bottom">
|
143 |
-
<?php
|
144 |
<div class="left signup">
|
145 |
-
<strong>
|
146 |
-
<select name="interest" class="interest-signup-field">
|
147 |
-
<option value="">Choose one</option>
|
148 |
-
<option>Themes</option>
|
149 |
-
<option>eCommerce</option>
|
150 |
-
<option>Page Load Time</option>
|
151 |
-
<option>Social Media</option>
|
152 |
-
<option>Fast WP Hosting</option>
|
153 |
-
<option>Marketing</option>
|
154 |
-
</select>
|
155 |
<input type="email" class="email-signup-field" placeholder="Email">
|
156 |
<button type="button" class="button signup-button">Sign me up!</button>
|
157 |
<span class="signup-check">✓</span>
|
@@ -232,7 +223,7 @@ class CCF_Form_Manager {
|
|
232 |
<label for="ccf_form_email_notification_content"><?php esc_html_e( 'Email Content (HTML):', 'custom-contact-forms' ); ?></label>
|
233 |
<textarea id="ccf_form_email_notification_content" class="form-email-notification-content">{{ notification.content }}</textarea><br />
|
234 |
<p class="variables">
|
235 |
-
<strong><?php esc_html_e( 'Variables:', 'custom-contact-forms' ); ?></strong> [all_fields] [ip_address]
|
236 |
<span class="field-variables"></span>
|
237 |
|
238 |
</p>
|
@@ -545,7 +536,7 @@ class CCF_Form_Manager {
|
|
545 |
</script>
|
546 |
|
547 |
<script type="text/html" id="ccf-single-line-text-template">
|
548 |
-
<div class="accordion-section expanded">
|
549 |
<a class="accordion-heading">Basic</a>
|
550 |
<div class="section-content">
|
551 |
<div>
|
@@ -573,7 +564,7 @@ class CCF_Form_Manager {
|
|
573 |
</div>
|
574 |
</div>
|
575 |
</div>
|
576 |
-
<div class="accordion-section">
|
577 |
<a class="accordion-heading"><?php esc_html_e( 'Advanced', 'custom-contact-forms' ); ?></a>
|
578 |
<div class="section-content">
|
579 |
<div>
|
@@ -584,12 +575,36 @@ class CCF_Form_Manager {
|
|
584 |
<label for="ccf-field-placeholder"><?php esc_html_e( 'Placeholder Text:', 'custom-contact-forms' ); ?></label>
|
585 |
<input id="ccf-field-placeholder" class="field-placeholder" type="text" value="{{ field.placeholder }}">
|
586 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
587 |
</div>
|
588 |
</div>
|
589 |
</script>
|
590 |
|
591 |
<script type="text/html" id="ccf-file-template">
|
592 |
-
<div class="accordion-section expanded">
|
593 |
<a class="accordion-heading">Basic</a>
|
594 |
<div class="section-content">
|
595 |
<div>
|
@@ -623,19 +638,43 @@ class CCF_Form_Manager {
|
|
623 |
</div>
|
624 |
</div>
|
625 |
</div>
|
626 |
-
<div class="accordion-section">
|
627 |
<a class="accordion-heading"><?php esc_html_e( 'Advanced', 'custom-contact-forms' ); ?></a>
|
628 |
<div class="section-content">
|
629 |
<div>
|
630 |
<label for="ccf-field-class-name"><?php esc_html_e( 'Class Name:', 'custom-contact-forms' ); ?></label>
|
631 |
<input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}">
|
632 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
633 |
</div>
|
634 |
</div>
|
635 |
</script>
|
636 |
|
637 |
<script type="text/html" id="ccf-recaptcha-template">
|
638 |
-
<div class="accordion-section expanded">
|
639 |
<a class="accordion-heading">Basic</a>
|
640 |
<div class="section-content">
|
641 |
<p><?php _e( 'reCAPTCHA is a simple captcha service provided by Google. <a target="_blank" href="https://www.google.com/recaptcha/intro/index.html">Learn more</a>', 'custom-contact-forms' ); ?></p>
|
@@ -659,19 +698,43 @@ class CCF_Form_Manager {
|
|
659 |
</div>
|
660 |
</div>
|
661 |
</div>
|
662 |
-
<div class="accordion-section">
|
663 |
<a class="accordion-heading"><?php esc_html_e( 'Advanced', 'custom-contact-forms' ); ?></a>
|
664 |
<div class="section-content">
|
665 |
<div>
|
666 |
<label for="ccf-field-class-name"><?php esc_html_e( 'Class Name:', 'custom-contact-forms' ); ?></label>
|
667 |
<input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}">
|
668 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
669 |
</div>
|
670 |
</div>
|
671 |
</script>
|
672 |
|
673 |
<script type="text/html" id="ccf-website-template">
|
674 |
-
<div class="accordion-section expanded">
|
675 |
<a class="accordion-heading">Basic</a>
|
676 |
<div class="section-content">
|
677 |
<div>
|
@@ -699,7 +762,7 @@ class CCF_Form_Manager {
|
|
699 |
</div>
|
700 |
</div>
|
701 |
</div>
|
702 |
-
<div class="accordion-section">
|
703 |
<a class="accordion-heading"><?php esc_html_e( 'Advanced', 'custom-contact-forms' ); ?></a>
|
704 |
<div class="section-content">
|
705 |
<div>
|
@@ -710,12 +773,36 @@ class CCF_Form_Manager {
|
|
710 |
<label for="ccf-field-placeholder"><?php esc_html_e( 'Placeholder Text:', 'custom-contact-forms' ); ?></label>
|
711 |
<input id="ccf-field-placeholder" class="field-placeholder" type="text" value="{{ field.placeholder }}">
|
712 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
713 |
</div>
|
714 |
</div>
|
715 |
</script>
|
716 |
|
717 |
<script type="text/html" id="ccf-html-template">
|
718 |
-
<div class="accordion-section expanded">
|
719 |
<a class="accordion-heading"><?php esc_html_e( 'Basic', 'custom-contact-forms' ); ?></a>
|
720 |
<div class="section-content">
|
721 |
<div>
|
@@ -724,19 +811,43 @@ class CCF_Form_Manager {
|
|
724 |
</div>
|
725 |
</div>
|
726 |
</div>
|
727 |
-
<div class="accordion-section">
|
728 |
<a class="accordion-heading"><?php esc_html_e( 'Advanced', 'custom-contact-forms' ); ?></a>
|
729 |
<div class="section-content">
|
730 |
<div>
|
731 |
<label for="ccf-field-class-name"><?php esc_html_e( 'Class Name:', 'custom-contact-forms' ); ?></label>
|
732 |
<input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}">
|
733 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
734 |
</div>
|
735 |
</div>
|
736 |
</script>
|
737 |
|
738 |
<script type="text/html" id="ccf-section-header-template">
|
739 |
-
<div class="accordion-section expanded">
|
740 |
<a class="accordion-heading"><?php esc_html_e( 'Basic', 'custom-contact-forms' ); ?></a>
|
741 |
<div class="section-content">
|
742 |
<div>
|
@@ -749,19 +860,43 @@ class CCF_Form_Manager {
|
|
749 |
</div>
|
750 |
</div>
|
751 |
</div>
|
752 |
-
<div class="accordion-section">
|
753 |
<a class="accordion-heading"><?php esc_html_e( 'Advanced', 'custom-contact-forms' ); ?></a>
|
754 |
<div class="section-content">
|
755 |
<div>
|
756 |
<label for="ccf-field-class-name"><?php esc_html_e( 'Class Name:', 'custom-contact-forms' ); ?></label>
|
757 |
<input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}">
|
758 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
759 |
</div>
|
760 |
</div>
|
761 |
</script>
|
762 |
|
763 |
<script type="text/html" id="ccf-paragraph-text-template">
|
764 |
-
<div class="accordion-section expanded">
|
765 |
<a class="accordion-heading"><?php esc_html_e( 'Basic', 'custom-contact-forms' ); ?></a>
|
766 |
<div class="section-content">
|
767 |
<div>
|
@@ -789,7 +924,7 @@ class CCF_Form_Manager {
|
|
789 |
</div>
|
790 |
</div>
|
791 |
</div>
|
792 |
-
<div class="accordion-section">
|
793 |
<a class="accordion-heading"><?php esc_html_e( 'Advanced', 'custom-contact-forms' ); ?></a>
|
794 |
<div class="section-content">
|
795 |
<div>
|
@@ -800,12 +935,36 @@ class CCF_Form_Manager {
|
|
800 |
<label for="ccf-field-placeholder"><?php esc_html_e( 'Placeholder Text:', 'custom-contact-forms' ); ?></label>
|
801 |
<input id="ccf-field-placeholder" class="field-placeholder" type="text" value="{{ field.placeholder }}">
|
802 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
803 |
</div>
|
804 |
</div>
|
805 |
</script>
|
806 |
|
807 |
<script type="text/html" id="ccf-hidden-template">
|
808 |
-
<div class="accordion-section expanded">
|
809 |
<a class="accordion-heading"><?php esc_html_e( 'Basic', 'custom-contact-forms' ); ?></a>
|
810 |
<div class="section-content">
|
811 |
<div>
|
@@ -818,19 +977,43 @@ class CCF_Form_Manager {
|
|
818 |
</div>
|
819 |
</div>
|
820 |
</div>
|
821 |
-
<div class="accordion-section">
|
822 |
<a class="accordion-heading"><?php esc_html_e( 'Advanced', 'custom-contact-forms' ); ?></a>
|
823 |
<div class="section-content">
|
824 |
<div>
|
825 |
<label for="ccf-field-class-name"><?php esc_html_e( 'Class Name:', 'custom-contact-forms' ); ?></label>
|
826 |
<input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}">
|
827 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
828 |
</div>
|
829 |
</div>
|
830 |
</script>
|
831 |
|
832 |
<script type="text/html" id="ccf-name-template">
|
833 |
-
<div class="accordion-section expanded">
|
834 |
<a class="accordion-heading"><?php esc_html_e( 'Basic', 'custom-contact-forms' ); ?></a>
|
835 |
<div class="section-content">
|
836 |
<div>
|
@@ -854,19 +1037,43 @@ class CCF_Form_Manager {
|
|
854 |
</div>
|
855 |
</div>
|
856 |
</div>
|
857 |
-
<div class="accordion-section">
|
858 |
<a class="accordion-heading"><?php esc_html_e( 'Advanced', 'custom-contact-forms' ); ?></a>
|
859 |
<div class="section-content">
|
860 |
<div>
|
861 |
<label for="ccf-field-class-name"><?php esc_html_e( 'Class Name:', 'custom-contact-forms' ); ?></label>
|
862 |
<input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}">
|
863 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
864 |
</div>
|
865 |
</div>
|
866 |
</script>
|
867 |
|
868 |
<script type="text/html" id="ccf-date-template">
|
869 |
-
<div class="accordion-section expanded">
|
870 |
<a class="accordion-heading"><?php esc_html_e( 'Basic', 'custom-contact-forms' ); ?></a>
|
871 |
<div class="section-content">
|
872 |
<div>
|
@@ -913,7 +1120,7 @@ class CCF_Form_Manager {
|
|
913 |
<# } #>
|
914 |
</div>
|
915 |
</div>
|
916 |
-
<div class="accordion-section">
|
917 |
<a class="accordion-heading"><?php esc_html_e( 'Advanced', 'custom-contact-forms' ); ?></a>
|
918 |
<div class="section-content">
|
919 |
<div>
|
@@ -926,12 +1133,36 @@ class CCF_Form_Manager {
|
|
926 |
<input id="ccf-field-placeholder" class="field-placeholder" type="text" value="{{ field.placeholder }}">
|
927 |
</div>
|
928 |
<# } #>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
929 |
</div>
|
930 |
</div>
|
931 |
</script>
|
932 |
|
933 |
<script type="text/html" id="ccf-phone-template">
|
934 |
-
<div class="accordion-section expanded">
|
935 |
<a class="accordion-heading"><?php esc_html_e( 'Basic', 'custom-contact-forms' ); ?></a>
|
936 |
<div class="section-content">
|
937 |
<div>
|
@@ -966,7 +1197,7 @@ class CCF_Form_Manager {
|
|
966 |
</div>
|
967 |
</div>
|
968 |
</div>
|
969 |
-
<div class="accordion-section">
|
970 |
<a class="accordion-heading"><?php esc_html_e( 'Advanced', 'custom-contact-forms' ); ?></a>
|
971 |
<div class="section-content">
|
972 |
<div>
|
@@ -977,12 +1208,36 @@ class CCF_Form_Manager {
|
|
977 |
<label for="ccf-field-placeholder"><?php esc_html_e( 'Placeholder Text:', 'custom-contact-forms' ); ?></label>
|
978 |
<input id="ccf-field-placeholder" class="field-placeholder" type="text" value="{{ field.placeholder }}">
|
979 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
980 |
</div>
|
981 |
</div>
|
982 |
</script>
|
983 |
|
984 |
<script type="text/html" id="ccf-address-template">
|
985 |
-
<div class="accordion-section expanded">
|
986 |
<a class="accordion-heading"><?php esc_html_e( 'Basic', 'custom-contact-forms' ); ?></a>
|
987 |
<div class="section-content">
|
988 |
<div>
|
@@ -1013,19 +1268,43 @@ class CCF_Form_Manager {
|
|
1013 |
</div>
|
1014 |
</div>
|
1015 |
</div>
|
1016 |
-
<div class="accordion-section">
|
1017 |
<a class="accordion-heading"><?php esc_html_e( 'Advanced', 'custom-contact-forms' ); ?></a>
|
1018 |
<div class="section-content">
|
1019 |
<div>
|
1020 |
<label for="ccf-field-class-name"><?php esc_html_e( 'Class Name:', 'custom-contact-forms' ); ?></label>
|
1021 |
<input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}">
|
1022 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1023 |
</div>
|
1024 |
</div>
|
1025 |
</script>
|
1026 |
|
1027 |
<script type="text/html" id="ccf-email-template">
|
1028 |
-
<div class="accordion-section expanded">
|
1029 |
<a class="accordion-heading"><?php esc_html_e( 'Basic', 'custom-contact-forms' ); ?></a>
|
1030 |
<div class="section-content">
|
1031 |
<div>
|
@@ -1062,7 +1341,7 @@ class CCF_Form_Manager {
|
|
1062 |
</div>
|
1063 |
</div>
|
1064 |
</div>
|
1065 |
-
<div class="accordion-section">
|
1066 |
<a class="accordion-heading"><?php esc_html_e( 'Advanced', 'custom-contact-forms' ); ?></a>
|
1067 |
<div class="section-content">
|
1068 |
<div>
|
@@ -1075,6 +1354,30 @@ class CCF_Form_Manager {
|
|
1075 |
<input id="ccf-field-placeholder" class="field-placeholder" type="text" value="{{ field.placeholder }}">
|
1076 |
</div>
|
1077 |
<# } #>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1078 |
</div>
|
1079 |
</div>
|
1080 |
</script>
|
@@ -1088,8 +1391,25 @@ class CCF_Form_Manager {
|
|
1088 |
<a aria-hidden="true" data-icon="" class="delete"></a>
|
1089 |
</script>
|
1090 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1091 |
<script type="text/html" id="ccf-dropdown-template">
|
1092 |
-
<div class="accordion-section expanded">
|
1093 |
<a class="accordion-heading"><?php esc_html_e( 'Basic', 'custom-contact-forms' ); ?></a>
|
1094 |
<div class="section-content">
|
1095 |
<div>
|
@@ -1120,19 +1440,43 @@ class CCF_Form_Manager {
|
|
1120 |
</div>
|
1121 |
</div>
|
1122 |
</div>
|
1123 |
-
<div class="accordion-section">
|
1124 |
<a class="accordion-heading"><?php esc_html_e( 'Advanced', 'custom-contact-forms' ); ?></a>
|
1125 |
<div class="section-content">
|
1126 |
<div>
|
1127 |
<label for="ccf-field-class-name"><?php esc_html_e( 'Class Name:', 'custom-contact-forms' ); ?></label>
|
1128 |
<input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}">
|
1129 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1130 |
</div>
|
1131 |
</div>
|
1132 |
</script>
|
1133 |
|
1134 |
<script type="text/html" id="ccf-radio-template">
|
1135 |
-
<div class="accordion-section expanded">
|
1136 |
<a class="accordion-heading"><?php esc_html_e( 'Basic', 'custom-contact-forms' ); ?></a>
|
1137 |
<div class="section-content">
|
1138 |
<div>
|
@@ -1163,19 +1507,43 @@ class CCF_Form_Manager {
|
|
1163 |
</div>
|
1164 |
</div>
|
1165 |
</div>
|
1166 |
-
<div class="accordion-section">
|
1167 |
<a class="accordion-heading"><?php esc_html_e( 'Advanced', 'custom-contact-forms' ); ?></a>
|
1168 |
<div class="section-content">
|
1169 |
<div>
|
1170 |
<label for="ccf-field-class-name"><?php esc_html_e( 'Class Name:', 'custom-contact-forms' ); ?></label>
|
1171 |
<input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}">
|
1172 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1173 |
</div>
|
1174 |
</div>
|
1175 |
</script>
|
1176 |
|
1177 |
<script type="text/html" id="ccf-checkboxes-template">
|
1178 |
-
<div class="accordion-section expanded">
|
1179 |
<a class="accordion-heading"><?php esc_html_e( 'Basic', 'custom-contact-forms' ); ?></a>
|
1180 |
<div class="section-content">
|
1181 |
<div>
|
@@ -1206,13 +1574,37 @@ class CCF_Form_Manager {
|
|
1206 |
</div>
|
1207 |
</div>
|
1208 |
</div>
|
1209 |
-
<div class="accordion-section">
|
1210 |
<a class="accordion-heading"><?php esc_html_e( 'Advanced', 'custom-contact-forms' ); ?></a>
|
1211 |
<div class="section-content">
|
1212 |
<div>
|
1213 |
<label for="ccf-field-class-name"><?php esc_html_e( 'Class Name:', 'custom-contact-forms' ); ?></label>
|
1214 |
<input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}">
|
1215 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1216 |
</div>
|
1217 |
</div>
|
1218 |
</script>
|
@@ -1224,7 +1616,7 @@ class CCF_Form_Manager {
|
|
1224 |
</script>
|
1225 |
|
1226 |
<script type="text/html" id="ccf-single-line-text-preview-template">
|
1227 |
-
<label>{{ field.label }} <# if ( field.required ) { #><span>*</span><# } #></label>
|
1228 |
<input disabled type="text" placeholder="{{ field.placeholder }}" value="{{ field.value }}">
|
1229 |
<# if ( field.description ) { #>
|
1230 |
<div class="field-description">{{ field.description }}</div>
|
@@ -1232,7 +1624,7 @@ class CCF_Form_Manager {
|
|
1232 |
</script>
|
1233 |
|
1234 |
<script type="text/html" id="ccf-file-preview-template">
|
1235 |
-
<label>{{ field.label }} <# if ( field.required ) { #><span>*</span><# } #></label>
|
1236 |
<input disabled type="file" placeholder="{{ field.placeholder }}" value="{{ field.value }}">
|
1237 |
<div class="field-description">
|
1238 |
<# if ( field.fileExtensions ) {
|
@@ -1250,15 +1642,15 @@ class CCF_Form_Manager {
|
|
1250 |
</script>
|
1251 |
|
1252 |
<script type="text/html" id="ccf-recaptcha-preview-template">
|
1253 |
-
<label>{{ field.label }} <# if ( field.required ) { #><span>*</span><# } #></label>
|
1254 |
-
<img class="recaptcha-preview-img" src="<?php echo plugins_url( 'img/recaptcha.png', dirname( __FILE__ )); ?>">
|
1255 |
<# if ( field.description ) { #>
|
1256 |
<div class="field-description">{{ field.description }}</div>
|
1257 |
<# } #>
|
1258 |
</script>
|
1259 |
|
1260 |
<script type="text/html" id="ccf-paragraph-text-preview-template">
|
1261 |
-
<label>{{ field.label }} <# if ( field.required ) { #><span>*</span><# } #></label>
|
1262 |
<textarea placeholder="{{ field.placeholder }}" disabled>{{ field.value }}</textarea>
|
1263 |
<# if ( field.description ) { #>
|
1264 |
<div class="field-description">{{ field.description }}</div>
|
@@ -1266,7 +1658,7 @@ class CCF_Form_Manager {
|
|
1266 |
</script>
|
1267 |
|
1268 |
<script type="text/html" id="ccf-dropdown-preview-template">
|
1269 |
-
<label>{{ field.label }} <# if ( field.required ) { #><span>*</span><# } #></label>
|
1270 |
<select>
|
1271 |
<# if ( field.choices.length === 0 || ( field.choices.length === 1 && ! field.choices.at( 0 ).get( 'label' ) && ! field.choices.at( 0 ).get( 'value' ) ) ) { #>
|
1272 |
<option><?php esc_html_e( 'An example choice', 'custom-contact-forms' ); ?></option>
|
@@ -1282,7 +1674,7 @@ class CCF_Form_Manager {
|
|
1282 |
</script>
|
1283 |
|
1284 |
<script type="text/html" id="ccf-radio-preview-template">
|
1285 |
-
<label>{{ field.label }} <# if ( field.required ) { #><span>*</span><# } #></label>
|
1286 |
<# if ( field.choices.length === 0 || ( field.choices.length === 1 && ! field.choices.at( 0 ).get( 'label' ) && ! field.choices.at( 0 ).get( 'value' ) ) ) { #>
|
1287 |
<div>
|
1288 |
<input type="radio" value="1" checked="checked"> <label><?php esc_html_e( 'An example choice', 'custom-contact-forms' ); ?></label>
|
@@ -1300,7 +1692,7 @@ class CCF_Form_Manager {
|
|
1300 |
</script>
|
1301 |
|
1302 |
<script type="text/html" id="ccf-checkboxes-preview-template">
|
1303 |
-
<label>{{ field.label }} <# if ( field.required ) { #><span>*</span><# } #></label>
|
1304 |
<# if ( field.choices.length === 0 || ( field.choices.length === 1 && ! field.choices.at( 0 ).get( 'label' ) && ! field.choices.at( 0 ).get( 'value' ) ) ) { #>
|
1305 |
<div>
|
1306 |
<input type="checkbox" value="1" checked="checked"> <label><?php esc_html_e( 'An example choice', 'custom-contact-forms' ); ?></label>
|
@@ -1318,6 +1710,7 @@ class CCF_Form_Manager {
|
|
1318 |
</script>
|
1319 |
|
1320 |
<script type="text/html" id="ccf-html-preview-template">
|
|
|
1321 |
<# if ( typeof mce !== 'undefined' ) { #>
|
1322 |
{{{ field.html }}}
|
1323 |
<# } else { #>
|
@@ -1326,6 +1719,7 @@ class CCF_Form_Manager {
|
|
1326 |
</script>
|
1327 |
|
1328 |
<script type="text/html" id="ccf-section-header-preview-template">
|
|
|
1329 |
<div class="heading">
|
1330 |
<# if ( field.heading ) { #>{{ field.heading }}<# } else { #><?php esc_html_e( 'Section Heading', 'custom-contact-forms' ); ?><# } #>
|
1331 |
</div>
|
@@ -1333,7 +1727,7 @@ class CCF_Form_Manager {
|
|
1333 |
</script>
|
1334 |
|
1335 |
<script type="text/html" id="ccf-name-preview-template">
|
1336 |
-
<label>{{ field.label }} <# if ( field.required ) { #><span>*</span><# } #></label>
|
1337 |
<div class="left">
|
1338 |
<input type="text">
|
1339 |
<label class="sub-label"><?php esc_html_e( 'First', 'custom-contact-forms' ); ?></label>
|
@@ -1348,7 +1742,7 @@ class CCF_Form_Manager {
|
|
1348 |
</script>
|
1349 |
|
1350 |
<script type="text/html" id="ccf-date-preview-template">
|
1351 |
-
<label>{{ field.label }} <# if ( field.required ) { #><span>*</span><# } #></label>
|
1352 |
<# if ( field.showDate && ! field.showTime ) { #>
|
1353 |
<input value="{{ field.value }}" class="ccf-datepicker" disabled type="text">
|
1354 |
<# } else if ( ! field.showDate && field.showTime ) { #>
|
@@ -1396,7 +1790,7 @@ class CCF_Form_Manager {
|
|
1396 |
</script>
|
1397 |
|
1398 |
<script type="text/html" id="ccf-address-preview-template">
|
1399 |
-
<label>{{ field.label }} <# if ( field.required ) { #><span>*</span><# } #></label>
|
1400 |
<# if ( field.addressType === 'us' ) { #>
|
1401 |
<div class="full">
|
1402 |
<input type="text">
|
@@ -1458,7 +1852,7 @@ class CCF_Form_Manager {
|
|
1458 |
</script>
|
1459 |
|
1460 |
<script type="text/html" id="ccf-email-preview-template">
|
1461 |
-
<label>{{ field.label }} <# if ( field.required ) { #><span>*</span><# } #></label>
|
1462 |
<# if ( ! field.emailConfirmation ) { #>
|
1463 |
<input placeholder="<# if ( field.placeholder ) { #>{{ field.placeholder }}<# } else { #><?php esc_html_e( 'email@example.com', 'custom-contact-forms' ); ?><# } #>" disabled type="text" value="{{ field.value }}">
|
1464 |
<# } else { #>
|
@@ -1477,7 +1871,7 @@ class CCF_Form_Manager {
|
|
1477 |
</script>
|
1478 |
|
1479 |
<script type="text/html" id="ccf-website-preview-template">
|
1480 |
-
<label>{{ field.label }} <# if ( field.required ) { #><span>*</span><# } #></label>
|
1481 |
<input placeholder="<# if ( field.placeholder ) { #>{{ field.placeholder }}<# } else { #>http://<# } #>" disabled type="text" value="{{ field.value }}">
|
1482 |
<# if ( field.description ) { #>
|
1483 |
<div class="field-description">{{ field.description }}</div>
|
@@ -1485,7 +1879,7 @@ class CCF_Form_Manager {
|
|
1485 |
</script>
|
1486 |
|
1487 |
<script type="text/html" id="ccf-phone-preview-template">
|
1488 |
-
<label>{{ field.label }} <# if ( field.required ) { #><span>*</span><# } #></label>
|
1489 |
<input placeholder="<# if ( field.placeholder ) { #>{{ field.placeholder }}<# } else if ( 'us' === field.phoneFormat ) { #>(301) 101-8976<# } #>" disabled type="text" value="{{ field.value }}">
|
1490 |
<# if ( field.description ) { #>
|
1491 |
<div class="field-description">{{ field.description }}</div>
|
@@ -1744,13 +2138,13 @@ class CCF_Form_Manager {
|
|
1744 |
|
1745 |
if ( 'post.php' == $pagenow || 'post-new.php' == $pagenow ) {
|
1746 |
if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
|
1747 |
-
$js_manager_path = '/build/js/form-manager.js';
|
1748 |
-
$js_mce_path = '/js/form-mce.js';
|
1749 |
-
$css_path = '/build/css/form-manager.css';
|
1750 |
} else {
|
1751 |
-
$js_manager_path = '/build/js/form-manager.min.js';
|
1752 |
-
$js_mce_path = '/build/js/form-mce.min.js';
|
1753 |
-
$css_path = '/build/css/form-manager.min.css';
|
1754 |
}
|
1755 |
|
1756 |
$field_labels = apply_filters( 'ccf_field_labels', array(
|
@@ -1765,7 +2159,7 @@ class CCF_Form_Manager {
|
|
1765 |
|
1766 |
$structure_field_labels = apply_filters( 'ccf_structure_field_labels', array(
|
1767 |
'html' => __( 'HTML', 'custom-contact-forms' ),
|
1768 |
-
'section-header' => __( 'Section
|
1769 |
));
|
1770 |
|
1771 |
$special_field_labels = apply_filters( 'ccf_special_field_labels', array(
|
@@ -1781,7 +2175,7 @@ class CCF_Form_Manager {
|
|
1781 |
wp_register_script( 'moment', plugins_url( '/bower_components/moment/moment.js', dirname( __FILE__ ) ), array(), CCF_VERSION );
|
1782 |
|
1783 |
if ( ! wp_script_is( 'wp-api', 'registered' ) ) {
|
1784 |
-
wp_register_script( 'wp-api', plugins_url( '/
|
1785 |
}
|
1786 |
|
1787 |
$site_url_parsed = parse_url( site_url() );
|
@@ -1809,7 +2203,7 @@ class CCF_Form_Manager {
|
|
1809 |
'specialFieldLabels' => $special_field_labels,
|
1810 |
'maxFileSize' => floor( wp_max_upload_size() / 1000 / 1000 ),
|
1811 |
'noEmailFields' => esc_html__( 'You have no email fields', 'custom-contact-forms' ),
|
1812 |
-
'noAvailableFields' => esc_html__( '
|
1813 |
'noNameFields' => esc_html__( 'You have no name fields', 'custom-contact-forms' ),
|
1814 |
'noApplicableFields' => esc_html__( 'You have no applicable fields', 'custom-contact-forms' ),
|
1815 |
'chooseFormField' => esc_html__( 'Choose a Form Field', 'custom-contact-forms' ),
|
33 |
}
|
34 |
|
35 |
if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
|
36 |
+
$css_path = '/assets/build/css/form-mce.css';
|
37 |
} else {
|
38 |
+
$css_path = '/assets/build/css/form-mce.min.css';
|
39 |
}
|
40 |
|
41 |
$css .= ', ' . plugins_url( $css_path, dirname( __FILE__ ) );
|
140 |
<div class="right-sidebar ccf-field-sidebar accordion-container"></div>
|
141 |
|
142 |
<div class="bottom">
|
143 |
+
<?php if ( ! apply_filters( 'ccf_hide_ads', false ) ) : ?>
|
144 |
<div class="left signup">
|
145 |
+
<strong>Want free WP blogging tips, tutorials, and marketing tricks? </strong>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
<input type="email" class="email-signup-field" placeholder="Email">
|
147 |
<button type="button" class="button signup-button">Sign me up!</button>
|
148 |
<span class="signup-check">✓</span>
|
223 |
<label for="ccf_form_email_notification_content"><?php esc_html_e( 'Email Content (HTML):', 'custom-contact-forms' ); ?></label>
|
224 |
<textarea id="ccf_form_email_notification_content" class="form-email-notification-content">{{ notification.content }}</textarea><br />
|
225 |
<p class="variables">
|
226 |
+
<strong><?php esc_html_e( 'Variables:', 'custom-contact-forms' ); ?></strong> [all_fields] [ip_address] [current_date_time]
|
227 |
<span class="field-variables"></span>
|
228 |
|
229 |
</p>
|
536 |
</script>
|
537 |
|
538 |
<script type="text/html" id="ccf-single-line-text-template">
|
539 |
+
<div class="accordion-section <# if ( 'basic' === startPanel ) { #>expanded<# } #>">
|
540 |
<a class="accordion-heading">Basic</a>
|
541 |
<div class="section-content">
|
542 |
<div>
|
564 |
</div>
|
565 |
</div>
|
566 |
</div>
|
567 |
+
<div class="accordion-section <# if ( 'advanced' === startPanel ) { #>expanded<# } #>">
|
568 |
<a class="accordion-heading"><?php esc_html_e( 'Advanced', 'custom-contact-forms' ); ?></a>
|
569 |
<div class="section-content">
|
570 |
<div>
|
575 |
<label for="ccf-field-placeholder"><?php esc_html_e( 'Placeholder Text:', 'custom-contact-forms' ); ?></label>
|
576 |
<input id="ccf-field-placeholder" class="field-placeholder" type="text" value="{{ field.placeholder }}">
|
577 |
</div>
|
578 |
+
<div>
|
579 |
+
<label for="ccf-field-conditionals-enabled"><?php esc_html_e( 'Enable Conditional Logic:', 'custom-contact-forms' ); ?></label>
|
580 |
+
<select id="ccf-field-conditionals-enabled" class="field-conditionals-enabled">
|
581 |
+
<option value="0"><?php esc_html_e( 'No', 'custom-contact-forms' ); ?></option>
|
582 |
+
<option value="1" <# if ( field.conditionalsEnabled ) { #>selected="selected"<# } #>><?php esc_html_e( 'Yes', 'custom-contact-forms' ); ?></option>
|
583 |
+
</select>
|
584 |
+
</div>
|
585 |
+
<div class="<# if ( ! field.conditionalsEnabled ) { #>hide<# } #>">
|
586 |
+
<select class="field-conditional-type">
|
587 |
+
<option value="hide"><?php esc_html_e( 'Hide', 'custom-contact-forms' ); ?></option>
|
588 |
+
<option <# if ( 'show' === field.conditionalType ) { #>selected="selected"<# } #> value="show"><?php esc_html_e( 'Show', 'custom-contact-forms' ); ?></option>
|
589 |
+
</select>
|
590 |
+
|
591 |
+
<?php esc_html_e( 'this field if', 'custom-contact-forms' ); ?>
|
592 |
+
|
593 |
+
<select class="field-conditional-fields-required">
|
594 |
+
<option value="all"><?php esc_html_e( 'All', 'custom-contact-forms' ); ?></option>
|
595 |
+
<option <# if ( 'any' === field.conditionalFieldsRequired ) { #>selected="selected"<# } #> value="any"><?php esc_html_e( 'Any', 'custom-contact-forms' ); ?></option>
|
596 |
+
</select>
|
597 |
+
|
598 |
+
<?php esc_html_e( 'of these conditions are true:', 'custom-contact-forms' ); ?>
|
599 |
+
</div>
|
600 |
+
<div class="conditionals <# if ( ! field.conditionalsEnabled ) { #>hide<# } #>">
|
601 |
+
</div>
|
602 |
</div>
|
603 |
</div>
|
604 |
</script>
|
605 |
|
606 |
<script type="text/html" id="ccf-file-template">
|
607 |
+
<div class="accordion-section <# if ( 'basic' === startPanel ) { #>expanded<# } #>">
|
608 |
<a class="accordion-heading">Basic</a>
|
609 |
<div class="section-content">
|
610 |
<div>
|
638 |
</div>
|
639 |
</div>
|
640 |
</div>
|
641 |
+
<div class="accordion-section <# if ( 'advanced' === startPanel ) { #>expanded<# } #>">
|
642 |
<a class="accordion-heading"><?php esc_html_e( 'Advanced', 'custom-contact-forms' ); ?></a>
|
643 |
<div class="section-content">
|
644 |
<div>
|
645 |
<label for="ccf-field-class-name"><?php esc_html_e( 'Class Name:', 'custom-contact-forms' ); ?></label>
|
646 |
<input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}">
|
647 |
</div>
|
648 |
+
<div>
|
649 |
+
<label for="ccf-field-conditionals-enabled"><?php esc_html_e( 'Enable Conditional Logic:', 'custom-contact-forms' ); ?></label>
|
650 |
+
<select id="ccf-field-conditionals-enabled" class="field-conditionals-enabled">
|
651 |
+
<option value="0"><?php esc_html_e( 'No', 'custom-contact-forms' ); ?></option>
|
652 |
+
<option value="1" <# if ( field.conditionalsEnabled ) { #>selected="selected"<# } #>><?php esc_html_e( 'Yes', 'custom-contact-forms' ); ?></option>
|
653 |
+
</select>
|
654 |
+
</div>
|
655 |
+
<div class="<# if ( ! field.conditionalsEnabled ) { #>hide<# } #>">
|
656 |
+
<select class="field-conditional-type">
|
657 |
+
<option value="hide"><?php esc_html_e( 'Hide', 'custom-contact-forms' ); ?></option>
|
658 |
+
<option <# if ( 'show' === field.conditionalType ) { #>selected="selected"<# } #> value="show"><?php esc_html_e( 'Show', 'custom-contact-forms' ); ?></option>
|
659 |
+
</select>
|
660 |
+
|
661 |
+
<?php esc_html_e( 'this field if', 'custom-contact-forms' ); ?>
|
662 |
+
|
663 |
+
<select class="field-conditional-fields-required">
|
664 |
+
<option value="all"><?php esc_html_e( 'All', 'custom-contact-forms' ); ?></option>
|
665 |
+
<option <# if ( 'any' === field.conditionalFieldsRequired ) { #>selected="selected"<# } #> value="any"><?php esc_html_e( 'Any', 'custom-contact-forms' ); ?></option>
|
666 |
+
</select>
|
667 |
+
|
668 |
+
<?php esc_html_e( 'of these conditions are true:', 'custom-contact-forms' ); ?>
|
669 |
+
</div>
|
670 |
+
<div class="conditionals <# if ( ! field.conditionalsEnabled ) { #>hide<# } #>">
|
671 |
+
</div>
|
672 |
</div>
|
673 |
</div>
|
674 |
</script>
|
675 |
|
676 |
<script type="text/html" id="ccf-recaptcha-template">
|
677 |
+
<div class="accordion-section <# if ( 'basic' === startPanel ) { #>expanded<# } #>">
|
678 |
<a class="accordion-heading">Basic</a>
|
679 |
<div class="section-content">
|
680 |
<p><?php _e( 'reCAPTCHA is a simple captcha service provided by Google. <a target="_blank" href="https://www.google.com/recaptcha/intro/index.html">Learn more</a>', 'custom-contact-forms' ); ?></p>
|
698 |
</div>
|
699 |
</div>
|
700 |
</div>
|
701 |
+
<div class="accordion-section <# if ( 'advanced' === startPanel ) { #>expanded<# } #>">
|
702 |
<a class="accordion-heading"><?php esc_html_e( 'Advanced', 'custom-contact-forms' ); ?></a>
|
703 |
<div class="section-content">
|
704 |
<div>
|
705 |
<label for="ccf-field-class-name"><?php esc_html_e( 'Class Name:', 'custom-contact-forms' ); ?></label>
|
706 |
<input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}">
|
707 |
</div>
|
708 |
+
<div>
|
709 |
+
<label for="ccf-field-conditionals-enabled"><?php esc_html_e( 'Enable Conditional Logic:', 'custom-contact-forms' ); ?></label>
|
710 |
+
<select id="ccf-field-conditionals-enabled" class="field-conditionals-enabled">
|
711 |
+
<option value="0"><?php esc_html_e( 'No', 'custom-contact-forms' ); ?></option>
|
712 |
+
<option value="1" <# if ( field.conditionalsEnabled ) { #>selected="selected"<# } #>><?php esc_html_e( 'Yes', 'custom-contact-forms' ); ?></option>
|
713 |
+
</select>
|
714 |
+
</div>
|
715 |
+
<div class="<# if ( ! field.conditionalsEnabled ) { #>hide<# } #>">
|
716 |
+
<select class="field-conditional-type">
|
717 |
+
<option value="hide"><?php esc_html_e( 'Hide', 'custom-contact-forms' ); ?></option>
|
718 |
+
<option <# if ( 'show' === field.conditionalType ) { #>selected="selected"<# } #> value="show"><?php esc_html_e( 'Show', 'custom-contact-forms' ); ?></option>
|
719 |
+
</select>
|
720 |
+
|
721 |
+
<?php esc_html_e( 'this field if', 'custom-contact-forms' ); ?>
|
722 |
+
|
723 |
+
<select class="field-conditional-fields-required">
|
724 |
+
<option value="all"><?php esc_html_e( 'All', 'custom-contact-forms' ); ?></option>
|
725 |
+
<option <# if ( 'any' === field.conditionalFieldsRequired ) { #>selected="selected"<# } #> value="any"><?php esc_html_e( 'Any', 'custom-contact-forms' ); ?></option>
|
726 |
+
</select>
|
727 |
+
|
728 |
+
<?php esc_html_e( 'of these conditions are true:', 'custom-contact-forms' ); ?>
|
729 |
+
</div>
|
730 |
+
<div class="conditionals <# if ( ! field.conditionalsEnabled ) { #>hide<# } #>">
|
731 |
+
</div>
|
732 |
</div>
|
733 |
</div>
|
734 |
</script>
|
735 |
|
736 |
<script type="text/html" id="ccf-website-template">
|
737 |
+
<div class="accordion-section <# if ( 'basic' === startPanel ) { #>expanded<# } #>">
|
738 |
<a class="accordion-heading">Basic</a>
|
739 |
<div class="section-content">
|
740 |
<div>
|
762 |
</div>
|
763 |
</div>
|
764 |
</div>
|
765 |
+
<div class="accordion-section <# if ( 'advanced' === startPanel ) { #>expanded<# } #>">
|
766 |
<a class="accordion-heading"><?php esc_html_e( 'Advanced', 'custom-contact-forms' ); ?></a>
|
767 |
<div class="section-content">
|
768 |
<div>
|
773 |
<label for="ccf-field-placeholder"><?php esc_html_e( 'Placeholder Text:', 'custom-contact-forms' ); ?></label>
|
774 |
<input id="ccf-field-placeholder" class="field-placeholder" type="text" value="{{ field.placeholder }}">
|
775 |
</div>
|
776 |
+
<div>
|
777 |
+
<label for="ccf-field-conditionals-enabled"><?php esc_html_e( 'Enable Conditional Logic:', 'custom-contact-forms' ); ?></label>
|
778 |
+
<select id="ccf-field-conditionals-enabled" class="field-conditionals-enabled">
|
779 |
+
<option value="0"><?php esc_html_e( 'No', 'custom-contact-forms' ); ?></option>
|
780 |
+
<option value="1" <# if ( field.conditionalsEnabled ) { #>selected="selected"<# } #>><?php esc_html_e( 'Yes', 'custom-contact-forms' ); ?></option>
|
781 |
+
</select>
|
782 |
+
</div>
|
783 |
+
<div class="<# if ( ! field.conditionalsEnabled ) { #>hide<# } #>">
|
784 |
+
<select class="field-conditional-type">
|
785 |
+
<option value="hide"><?php esc_html_e( 'Hide', 'custom-contact-forms' ); ?></option>
|
786 |
+
<option <# if ( 'show' === field.conditionalType ) { #>selected="selected"<# } #> value="show"><?php esc_html_e( 'Show', 'custom-contact-forms' ); ?></option>
|
787 |
+
</select>
|
788 |
+
|
789 |
+
<?php esc_html_e( 'this field if', 'custom-contact-forms' ); ?>
|
790 |
+
|
791 |
+
<select class="field-conditional-fields-required">
|
792 |
+
<option value="all"><?php esc_html_e( 'All', 'custom-contact-forms' ); ?></option>
|
793 |
+
<option <# if ( 'any' === field.conditionalFieldsRequired ) { #>selected="selected"<# } #> value="any"><?php esc_html_e( 'Any', 'custom-contact-forms' ); ?></option>
|
794 |
+
</select>
|
795 |
+
|
796 |
+
<?php esc_html_e( 'of these conditions are true:', 'custom-contact-forms' ); ?>
|
797 |
+
</div>
|
798 |
+
<div class="conditionals <# if ( ! field.conditionalsEnabled ) { #>hide<# } #>">
|
799 |
+
</div>
|
800 |
</div>
|
801 |
</div>
|
802 |
</script>
|
803 |
|
804 |
<script type="text/html" id="ccf-html-template">
|
805 |
+
<div class="accordion-section <# if ( 'basic' === startPanel ) { #>expanded<# } #>">
|
806 |
<a class="accordion-heading"><?php esc_html_e( 'Basic', 'custom-contact-forms' ); ?></a>
|
807 |
<div class="section-content">
|
808 |
<div>
|
811 |
</div>
|
812 |
</div>
|
813 |
</div>
|
814 |
+
<div class="accordion-section <# if ( 'advanced' === startPanel ) { #>expanded<# } #>">
|
815 |
<a class="accordion-heading"><?php esc_html_e( 'Advanced', 'custom-contact-forms' ); ?></a>
|
816 |
<div class="section-content">
|
817 |
<div>
|
818 |
<label for="ccf-field-class-name"><?php esc_html_e( 'Class Name:', 'custom-contact-forms' ); ?></label>
|
819 |
<input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}">
|
820 |
</div>
|
821 |
+
<div>
|
822 |
+
<label for="ccf-field-conditionals-enabled"><?php esc_html_e( 'Enable Conditional Logic:', 'custom-contact-forms' ); ?></label>
|
823 |
+
<select id="ccf-field-conditionals-enabled" class="field-conditionals-enabled">
|
824 |
+
<option value="0"><?php esc_html_e( 'No', 'custom-contact-forms' ); ?></option>
|
825 |
+
<option value="1" <# if ( field.conditionalsEnabled ) { #>selected="selected"<# } #>><?php esc_html_e( 'Yes', 'custom-contact-forms' ); ?></option>
|
826 |
+
</select>
|
827 |
+
</div>
|
828 |
+
<div class="<# if ( ! field.conditionalsEnabled ) { #>hide<# } #>">
|
829 |
+
<select class="field-conditional-type">
|
830 |
+
<option value="hide"><?php esc_html_e( 'Hide', 'custom-contact-forms' ); ?></option>
|
831 |
+
<option <# if ( 'show' === field.conditionalType ) { #>selected="selected"<# } #> value="show"><?php esc_html_e( 'Show', 'custom-contact-forms' ); ?></option>
|
832 |
+
</select>
|
833 |
+
|
834 |
+
<?php esc_html_e( 'this field if', 'custom-contact-forms' ); ?>
|
835 |
+
|
836 |
+
<select class="field-conditional-fields-required">
|
837 |
+
<option value="all"><?php esc_html_e( 'All', 'custom-contact-forms' ); ?></option>
|
838 |
+
<option <# if ( 'any' === field.conditionalFieldsRequired ) { #>selected="selected"<# } #> value="any"><?php esc_html_e( 'Any', 'custom-contact-forms' ); ?></option>
|
839 |
+
</select>
|
840 |
+
|
841 |
+
<?php esc_html_e( 'of these conditions are true:', 'custom-contact-forms' ); ?>
|
842 |
+
</div>
|
843 |
+
<div class="conditionals <# if ( ! field.conditionalsEnabled ) { #>hide<# } #>">
|
844 |
+
</div>
|
845 |
</div>
|
846 |
</div>
|
847 |
</script>
|
848 |
|
849 |
<script type="text/html" id="ccf-section-header-template">
|
850 |
+
<div class="accordion-section <# if ( 'basic' === startPanel ) { #>expanded<# } #>">
|
851 |
<a class="accordion-heading"><?php esc_html_e( 'Basic', 'custom-contact-forms' ); ?></a>
|
852 |
<div class="section-content">
|
853 |
<div>
|
860 |
</div>
|
861 |
</div>
|
862 |
</div>
|
863 |
+
<div class="accordion-section <# if ( 'advanced' === startPanel ) { #>expanded<# } #>">
|
864 |
<a class="accordion-heading"><?php esc_html_e( 'Advanced', 'custom-contact-forms' ); ?></a>
|
865 |
<div class="section-content">
|
866 |
<div>
|
867 |
<label for="ccf-field-class-name"><?php esc_html_e( 'Class Name:', 'custom-contact-forms' ); ?></label>
|
868 |
<input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}">
|
869 |
</div>
|
870 |
+
<div>
|
871 |
+
<label for="ccf-field-conditionals-enabled"><?php esc_html_e( 'Enable Conditional Logic:', 'custom-contact-forms' ); ?></label>
|
872 |
+
<select id="ccf-field-conditionals-enabled" class="field-conditionals-enabled">
|
873 |
+
<option value="0"><?php esc_html_e( 'No', 'custom-contact-forms' ); ?></option>
|
874 |
+
<option value="1" <# if ( field.conditionalsEnabled ) { #>selected="selected"<# } #>><?php esc_html_e( 'Yes', 'custom-contact-forms' ); ?></option>
|
875 |
+
</select>
|
876 |
+
</div>
|
877 |
+
<div class="<# if ( ! field.conditionalsEnabled ) { #>hide<# } #>">
|
878 |
+
<select class="field-conditional-type">
|
879 |
+
<option value="hide"><?php esc_html_e( 'Hide', 'custom-contact-forms' ); ?></option>
|
880 |
+
<option <# if ( 'show' === field.conditionalType ) { #>selected="selected"<# } #> value="show"><?php esc_html_e( 'Show', 'custom-contact-forms' ); ?></option>
|
881 |
+
</select>
|
882 |
+
|
883 |
+
<?php esc_html_e( 'this field if', 'custom-contact-forms' ); ?>
|
884 |
+
|
885 |
+
<select class="field-conditional-fields-required">
|
886 |
+
<option value="all"><?php esc_html_e( 'All', 'custom-contact-forms' ); ?></option>
|
887 |
+
<option <# if ( 'any' === field.conditionalFieldsRequired ) { #>selected="selected"<# } #> value="any"><?php esc_html_e( 'Any', 'custom-contact-forms' ); ?></option>
|
888 |
+
</select>
|
889 |
+
|
890 |
+
<?php esc_html_e( 'of these conditions are true:', 'custom-contact-forms' ); ?>
|
891 |
+
</div>
|
892 |
+
<div class="conditionals <# if ( ! field.conditionalsEnabled ) { #>hide<# } #>">
|
893 |
+
</div>
|
894 |
</div>
|
895 |
</div>
|
896 |
</script>
|
897 |
|
898 |
<script type="text/html" id="ccf-paragraph-text-template">
|
899 |
+
<div class="accordion-section <# if ( 'basic' === startPanel ) { #>expanded<# } #>">
|
900 |
<a class="accordion-heading"><?php esc_html_e( 'Basic', 'custom-contact-forms' ); ?></a>
|
901 |
<div class="section-content">
|
902 |
<div>
|
924 |
</div>
|
925 |
</div>
|
926 |
</div>
|
927 |
+
<div class="accordion-section <# if ( 'advanced' === startPanel ) { #>expanded<# } #>">
|
928 |
<a class="accordion-heading"><?php esc_html_e( 'Advanced', 'custom-contact-forms' ); ?></a>
|
929 |
<div class="section-content">
|
930 |
<div>
|
935 |
<label for="ccf-field-placeholder"><?php esc_html_e( 'Placeholder Text:', 'custom-contact-forms' ); ?></label>
|
936 |
<input id="ccf-field-placeholder" class="field-placeholder" type="text" value="{{ field.placeholder }}">
|
937 |
</div>
|
938 |
+
<div>
|
939 |
+
<label for="ccf-field-conditionals-enabled"><?php esc_html_e( 'Enable Conditional Logic:', 'custom-contact-forms' ); ?></label>
|
940 |
+
<select id="ccf-field-conditionals-enabled" class="field-conditionals-enabled">
|
941 |
+
<option value="0"><?php esc_html_e( 'No', 'custom-contact-forms' ); ?></option>
|
942 |
+
<option value="1" <# if ( field.conditionalsEnabled ) { #>selected="selected"<# } #>><?php esc_html_e( 'Yes', 'custom-contact-forms' ); ?></option>
|
943 |
+
</select>
|
944 |
+
</div>
|
945 |
+
<div class="<# if ( ! field.conditionalsEnabled ) { #>hide<# } #>">
|
946 |
+
<select class="field-conditional-type">
|
947 |
+
<option value="hide"><?php esc_html_e( 'Hide', 'custom-contact-forms' ); ?></option>
|
948 |
+
<option <# if ( 'show' === field.conditionalType ) { #>selected="selected"<# } #> value="show"><?php esc_html_e( 'Show', 'custom-contact-forms' ); ?></option>
|
949 |
+
</select>
|
950 |
+
|
951 |
+
<?php esc_html_e( 'this field if', 'custom-contact-forms' ); ?>
|
952 |
+
|
953 |
+
<select class="field-conditional-fields-required">
|
954 |
+
<option value="all"><?php esc_html_e( 'All', 'custom-contact-forms' ); ?></option>
|
955 |
+
<option <# if ( 'any' === field.conditionalFieldsRequired ) { #>selected="selected"<# } #> value="any"><?php esc_html_e( 'Any', 'custom-contact-forms' ); ?></option>
|
956 |
+
</select>
|
957 |
+
|
958 |
+
<?php esc_html_e( 'of these conditions are true:', 'custom-contact-forms' ); ?>
|
959 |
+
</div>
|
960 |
+
<div class="conditionals <# if ( ! field.conditionalsEnabled ) { #>hide<# } #>">
|
961 |
+
</div>
|
962 |
</div>
|
963 |
</div>
|
964 |
</script>
|
965 |
|
966 |
<script type="text/html" id="ccf-hidden-template">
|
967 |
+
<div class="accordion-section <# if ( 'basic' === startPanel ) { #>expanded<# } #>">
|
968 |
<a class="accordion-heading"><?php esc_html_e( 'Basic', 'custom-contact-forms' ); ?></a>
|
969 |
<div class="section-content">
|
970 |
<div>
|
977 |
</div>
|
978 |
</div>
|
979 |
</div>
|
980 |
+
<div class="accordion-section <# if ( 'advanced' === startPanel ) { #>expanded<# } #>">
|
981 |
<a class="accordion-heading"><?php esc_html_e( 'Advanced', 'custom-contact-forms' ); ?></a>
|
982 |
<div class="section-content">
|
983 |
<div>
|
984 |
<label for="ccf-field-class-name"><?php esc_html_e( 'Class Name:', 'custom-contact-forms' ); ?></label>
|
985 |
<input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}">
|
986 |
</div>
|
987 |
+
<div>
|
988 |
+
<label for="ccf-field-conditionals-enabled"><?php esc_html_e( 'Enable Conditional Logic:', 'custom-contact-forms' ); ?></label>
|
989 |
+
<select id="ccf-field-conditionals-enabled" class="field-conditionals-enabled">
|
990 |
+
<option value="0"><?php esc_html_e( 'No', 'custom-contact-forms' ); ?></option>
|
991 |
+
<option value="1" <# if ( field.conditionalsEnabled ) { #>selected="selected"<# } #>><?php esc_html_e( 'Yes', 'custom-contact-forms' ); ?></option>
|
992 |
+
</select>
|
993 |
+
</div>
|
994 |
+
<div class="<# if ( ! field.conditionalsEnabled ) { #>hide<# } #>">
|
995 |
+
<select class="field-conditional-type">
|
996 |
+
<option value="hide"><?php esc_html_e( 'Hide', 'custom-contact-forms' ); ?></option>
|
997 |
+
<option <# if ( 'show' === field.conditionalType ) { #>selected="selected"<# } #> value="show"><?php esc_html_e( 'Show', 'custom-contact-forms' ); ?></option>
|
998 |
+
</select>
|
999 |
+
|
1000 |
+
<?php esc_html_e( 'this field if', 'custom-contact-forms' ); ?>
|
1001 |
+
|
1002 |
+
<select class="field-conditional-fields-required">
|
1003 |
+
<option value="all"><?php esc_html_e( 'All', 'custom-contact-forms' ); ?></option>
|
1004 |
+
<option <# if ( 'any' === field.conditionalFieldsRequired ) { #>selected="selected"<# } #> value="any"><?php esc_html_e( 'Any', 'custom-contact-forms' ); ?></option>
|
1005 |
+
</select>
|
1006 |
+
|
1007 |
+
<?php esc_html_e( 'of these conditions are true:', 'custom-contact-forms' ); ?>
|
1008 |
+
</div>
|
1009 |
+
<div class="conditionals <# if ( ! field.conditionalsEnabled ) { #>hide<# } #>">
|
1010 |
+
</div>
|
1011 |
</div>
|
1012 |
</div>
|
1013 |
</script>
|
1014 |
|
1015 |
<script type="text/html" id="ccf-name-template">
|
1016 |
+
<div class="accordion-section <# if ( 'basic' === startPanel ) { #>expanded<# } #>">
|
1017 |
<a class="accordion-heading"><?php esc_html_e( 'Basic', 'custom-contact-forms' ); ?></a>
|
1018 |
<div class="section-content">
|
1019 |
<div>
|
1037 |
</div>
|
1038 |
</div>
|
1039 |
</div>
|
1040 |
+
<div class="accordion-section <# if ( 'advanced' === startPanel ) { #>expanded<# } #>">
|
1041 |
<a class="accordion-heading"><?php esc_html_e( 'Advanced', 'custom-contact-forms' ); ?></a>
|
1042 |
<div class="section-content">
|
1043 |
<div>
|
1044 |
<label for="ccf-field-class-name"><?php esc_html_e( 'Class Name:', 'custom-contact-forms' ); ?></label>
|
1045 |
<input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}">
|
1046 |
</div>
|
1047 |
+
<div>
|
1048 |
+
<label for="ccf-field-conditionals-enabled"><?php esc_html_e( 'Enable Conditional Logic:', 'custom-contact-forms' ); ?></label>
|
1049 |
+
<select id="ccf-field-conditionals-enabled" class="field-conditionals-enabled">
|
1050 |
+
<option value="0"><?php esc_html_e( 'No', 'custom-contact-forms' ); ?></option>
|
1051 |
+
<option value="1" <# if ( field.conditionalsEnabled ) { #>selected="selected"<# } #>><?php esc_html_e( 'Yes', 'custom-contact-forms' ); ?></option>
|
1052 |
+
</select>
|
1053 |
+
</div>
|
1054 |
+
<div class="<# if ( ! field.conditionalsEnabled ) { #>hide<# } #>">
|
1055 |
+
<select class="field-conditional-type">
|
1056 |
+
<option value="hide"><?php esc_html_e( 'Hide', 'custom-contact-forms' ); ?></option>
|
1057 |
+
<option <# if ( 'show' === field.conditionalType ) { #>selected="selected"<# } #> value="show"><?php esc_html_e( 'Show', 'custom-contact-forms' ); ?></option>
|
1058 |
+
</select>
|
1059 |
+
|
1060 |
+
<?php esc_html_e( 'this field if', 'custom-contact-forms' ); ?>
|
1061 |
+
|
1062 |
+
<select class="field-conditional-fields-required">
|
1063 |
+
<option value="all"><?php esc_html_e( 'All', 'custom-contact-forms' ); ?></option>
|
1064 |
+
<option <# if ( 'any' === field.conditionalFieldsRequired ) { #>selected="selected"<# } #> value="any"><?php esc_html_e( 'Any', 'custom-contact-forms' ); ?></option>
|
1065 |
+
</select>
|
1066 |
+
|
1067 |
+
<?php esc_html_e( 'of these conditions are true:', 'custom-contact-forms' ); ?>
|
1068 |
+
</div>
|
1069 |
+
<div class="conditionals <# if ( ! field.conditionalsEnabled ) { #>hide<# } #>">
|
1070 |
+
</div>
|
1071 |
</div>
|
1072 |
</div>
|
1073 |
</script>
|
1074 |
|
1075 |
<script type="text/html" id="ccf-date-template">
|
1076 |
+
<div class="accordion-section <# if ( 'basic' === startPanel ) { #>expanded<# } #>">
|
1077 |
<a class="accordion-heading"><?php esc_html_e( 'Basic', 'custom-contact-forms' ); ?></a>
|
1078 |
<div class="section-content">
|
1079 |
<div>
|
1120 |
<# } #>
|
1121 |
</div>
|
1122 |
</div>
|
1123 |
+
<div class="accordion-section <# if ( 'advanced' === startPanel ) { #>expanded<# } #>">
|
1124 |
<a class="accordion-heading"><?php esc_html_e( 'Advanced', 'custom-contact-forms' ); ?></a>
|
1125 |
<div class="section-content">
|
1126 |
<div>
|
1133 |
<input id="ccf-field-placeholder" class="field-placeholder" type="text" value="{{ field.placeholder }}">
|
1134 |
</div>
|
1135 |
<# } #>
|
1136 |
+
<div>
|
1137 |
+
<label for="ccf-field-conditionals-enabled"><?php esc_html_e( 'Enable Conditional Logic:', 'custom-contact-forms' ); ?></label>
|
1138 |
+
<select id="ccf-field-conditionals-enabled" class="field-conditionals-enabled">
|
1139 |
+
<option value="0"><?php esc_html_e( 'No', 'custom-contact-forms' ); ?></option>
|
1140 |
+
<option value="1" <# if ( field.conditionalsEnabled ) { #>selected="selected"<# } #>><?php esc_html_e( 'Yes', 'custom-contact-forms' ); ?></option>
|
1141 |
+
</select>
|
1142 |
+
</div>
|
1143 |
+
<div class="<# if ( ! field.conditionalsEnabled ) { #>hide<# } #>">
|
1144 |
+
<select class="field-conditional-type">
|
1145 |
+
<option value="hide"><?php esc_html_e( 'Hide', 'custom-contact-forms' ); ?></option>
|
1146 |
+
<option <# if ( 'show' === field.conditionalType ) { #>selected="selected"<# } #> value="show"><?php esc_html_e( 'Show', 'custom-contact-forms' ); ?></option>
|
1147 |
+
</select>
|
1148 |
+
|
1149 |
+
<?php esc_html_e( 'this field if', 'custom-contact-forms' ); ?>
|
1150 |
+
|
1151 |
+
<select class="field-conditional-fields-required">
|
1152 |
+
<option value="all"><?php esc_html_e( 'All', 'custom-contact-forms' ); ?></option>
|
1153 |
+
<option <# if ( 'any' === field.conditionalFieldsRequired ) { #>selected="selected"<# } #> value="any"><?php esc_html_e( 'Any', 'custom-contact-forms' ); ?></option>
|
1154 |
+
</select>
|
1155 |
+
|
1156 |
+
<?php esc_html_e( 'of these conditions are true:', 'custom-contact-forms' ); ?>
|
1157 |
+
</div>
|
1158 |
+
<div class="conditionals <# if ( ! field.conditionalsEnabled ) { #>hide<# } #>">
|
1159 |
+
</div>
|
1160 |
</div>
|
1161 |
</div>
|
1162 |
</script>
|
1163 |
|
1164 |
<script type="text/html" id="ccf-phone-template">
|
1165 |
+
<div class="accordion-section <# if ( 'basic' === startPanel ) { #>expanded<# } #>">
|
1166 |
<a class="accordion-heading"><?php esc_html_e( 'Basic', 'custom-contact-forms' ); ?></a>
|
1167 |
<div class="section-content">
|
1168 |
<div>
|
1197 |
</div>
|
1198 |
</div>
|
1199 |
</div>
|
1200 |
+
<div class="accordion-section <# if ( 'advanced' === startPanel ) { #>expanded<# } #>">
|
1201 |
<a class="accordion-heading"><?php esc_html_e( 'Advanced', 'custom-contact-forms' ); ?></a>
|
1202 |
<div class="section-content">
|
1203 |
<div>
|
1208 |
<label for="ccf-field-placeholder"><?php esc_html_e( 'Placeholder Text:', 'custom-contact-forms' ); ?></label>
|
1209 |
<input id="ccf-field-placeholder" class="field-placeholder" type="text" value="{{ field.placeholder }}">
|
1210 |
</div>
|
1211 |
+
<div>
|
1212 |
+
<label for="ccf-field-conditionals-enabled"><?php esc_html_e( 'Enable Conditional Logic:', 'custom-contact-forms' ); ?></label>
|
1213 |
+
<select id="ccf-field-conditionals-enabled" class="field-conditionals-enabled">
|
1214 |
+
<option value="0"><?php esc_html_e( 'No', 'custom-contact-forms' ); ?></option>
|
1215 |
+
<option value="1" <# if ( field.conditionalsEnabled ) { #>selected="selected"<# } #>><?php esc_html_e( 'Yes', 'custom-contact-forms' ); ?></option>
|
1216 |
+
</select>
|
1217 |
+
</div>
|
1218 |
+
<div class="<# if ( ! field.conditionalsEnabled ) { #>hide<# } #>">
|
1219 |
+
<select class="field-conditional-type">
|
1220 |
+
<option value="hide"><?php esc_html_e( 'Hide', 'custom-contact-forms' ); ?></option>
|
1221 |
+
<option <# if ( 'show' === field.conditionalType ) { #>selected="selected"<# } #> value="show"><?php esc_html_e( 'Show', 'custom-contact-forms' ); ?></option>
|
1222 |
+
</select>
|
1223 |
+
|
1224 |
+
<?php esc_html_e( 'this field if', 'custom-contact-forms' ); ?>
|
1225 |
+
|
1226 |
+
<select class="field-conditional-fields-required">
|
1227 |
+
<option value="all"><?php esc_html_e( 'All', 'custom-contact-forms' ); ?></option>
|
1228 |
+
<option <# if ( 'any' === field.conditionalFieldsRequired ) { #>selected="selected"<# } #> value="any"><?php esc_html_e( 'Any', 'custom-contact-forms' ); ?></option>
|
1229 |
+
</select>
|
1230 |
+
|
1231 |
+
<?php esc_html_e( 'of these conditions are true:', 'custom-contact-forms' ); ?>
|
1232 |
+
</div>
|
1233 |
+
<div class="conditionals <# if ( ! field.conditionalsEnabled ) { #>hide<# } #>">
|
1234 |
+
</div>
|
1235 |
</div>
|
1236 |
</div>
|
1237 |
</script>
|
1238 |
|
1239 |
<script type="text/html" id="ccf-address-template">
|
1240 |
+
<div class="accordion-section <# if ( 'basic' === startPanel ) { #>expanded<# } #>">
|
1241 |
<a class="accordion-heading"><?php esc_html_e( 'Basic', 'custom-contact-forms' ); ?></a>
|
1242 |
<div class="section-content">
|
1243 |
<div>
|
1268 |
</div>
|
1269 |
</div>
|
1270 |
</div>
|
1271 |
+
<div class="accordion-section <# if ( 'advanced' === startPanel ) { #>expanded<# } #>">
|
1272 |
<a class="accordion-heading"><?php esc_html_e( 'Advanced', 'custom-contact-forms' ); ?></a>
|
1273 |
<div class="section-content">
|
1274 |
<div>
|
1275 |
<label for="ccf-field-class-name"><?php esc_html_e( 'Class Name:', 'custom-contact-forms' ); ?></label>
|
1276 |
<input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}">
|
1277 |
</div>
|
1278 |
+
<div>
|
1279 |
+
<label for="ccf-field-conditionals-enabled"><?php esc_html_e( 'Enable Conditional Logic:', 'custom-contact-forms' ); ?></label>
|
1280 |
+
<select id="ccf-field-conditionals-enabled" class="field-conditionals-enabled">
|
1281 |
+
<option value="0"><?php esc_html_e( 'No', 'custom-contact-forms' ); ?></option>
|
1282 |
+
<option value="1" <# if ( field.conditionalsEnabled ) { #>selected="selected"<# } #>><?php esc_html_e( 'Yes', 'custom-contact-forms' ); ?></option>
|
1283 |
+
</select>
|
1284 |
+
</div>
|
1285 |
+
<div class="<# if ( ! field.conditionalsEnabled ) { #>hide<# } #>">
|
1286 |
+
<select class="field-conditional-type">
|
1287 |
+
<option value="hide"><?php esc_html_e( 'Hide', 'custom-contact-forms' ); ?></option>
|
1288 |
+
<option <# if ( 'show' === field.conditionalType ) { #>selected="selected"<# } #> value="show"><?php esc_html_e( 'Show', 'custom-contact-forms' ); ?></option>
|
1289 |
+
</select>
|
1290 |
+
|
1291 |
+
<?php esc_html_e( 'this field if', 'custom-contact-forms' ); ?>
|
1292 |
+
|
1293 |
+
<select class="field-conditional-fields-required">
|
1294 |
+
<option value="all"><?php esc_html_e( 'All', 'custom-contact-forms' ); ?></option>
|
1295 |
+
<option <# if ( 'any' === field.conditionalFieldsRequired ) { #>selected="selected"<# } #> value="any"><?php esc_html_e( 'Any', 'custom-contact-forms' ); ?></option>
|
1296 |
+
</select>
|
1297 |
+
|
1298 |
+
<?php esc_html_e( 'of these conditions are true:', 'custom-contact-forms' ); ?>
|
1299 |
+
</div>
|
1300 |
+
<div class="conditionals <# if ( ! field.conditionalsEnabled ) { #>hide<# } #>">
|
1301 |
+
</div>
|
1302 |
</div>
|
1303 |
</div>
|
1304 |
</script>
|
1305 |
|
1306 |
<script type="text/html" id="ccf-email-template">
|
1307 |
+
<div class="accordion-section <# if ( 'basic' === startPanel ) { #>expanded<# } #>">
|
1308 |
<a class="accordion-heading"><?php esc_html_e( 'Basic', 'custom-contact-forms' ); ?></a>
|
1309 |
<div class="section-content">
|
1310 |
<div>
|
1341 |
</div>
|
1342 |
</div>
|
1343 |
</div>
|
1344 |
+
<div class="accordion-section <# if ( 'advanced' === startPanel ) { #>expanded<# } #>">
|
1345 |
<a class="accordion-heading"><?php esc_html_e( 'Advanced', 'custom-contact-forms' ); ?></a>
|
1346 |
<div class="section-content">
|
1347 |
<div>
|
1354 |
<input id="ccf-field-placeholder" class="field-placeholder" type="text" value="{{ field.placeholder }}">
|
1355 |
</div>
|
1356 |
<# } #>
|
1357 |
+
<div>
|
1358 |
+
<label for="ccf-field-conditionals-enabled"><?php esc_html_e( 'Enable Conditional Logic:', 'custom-contact-forms' ); ?></label>
|
1359 |
+
<select id="ccf-field-conditionals-enabled" class="field-conditionals-enabled">
|
1360 |
+
<option value="0"><?php esc_html_e( 'No', 'custom-contact-forms' ); ?></option>
|
1361 |
+
<option value="1" <# if ( field.conditionalsEnabled ) { #>selected="selected"<# } #>><?php esc_html_e( 'Yes', 'custom-contact-forms' ); ?></option>
|
1362 |
+
</select>
|
1363 |
+
</div>
|
1364 |
+
<div class="<# if ( ! field.conditionalsEnabled ) { #>hide<# } #>">
|
1365 |
+
<select class="field-conditional-type">
|
1366 |
+
<option value="hide"><?php esc_html_e( 'Hide', 'custom-contact-forms' ); ?></option>
|
1367 |
+
<option <# if ( 'show' === field.conditionalType ) { #>selected="selected"<# } #> value="show"><?php esc_html_e( 'Show', 'custom-contact-forms' ); ?></option>
|
1368 |
+
</select>
|
1369 |
+
|
1370 |
+
<?php esc_html_e( 'this field if', 'custom-contact-forms' ); ?>
|
1371 |
+
|
1372 |
+
<select class="field-conditional-fields-required">
|
1373 |
+
<option value="all"><?php esc_html_e( 'All', 'custom-contact-forms' ); ?></option>
|
1374 |
+
<option <# if ( 'any' === field.conditionalFieldsRequired ) { #>selected="selected"<# } #> value="any"><?php esc_html_e( 'Any', 'custom-contact-forms' ); ?></option>
|
1375 |
+
</select>
|
1376 |
+
|
1377 |
+
<?php esc_html_e( 'of these conditions are true:', 'custom-contact-forms' ); ?>
|
1378 |
+
</div>
|
1379 |
+
<div class="conditionals <# if ( ! field.conditionalsEnabled ) { #>hide<# } #>">
|
1380 |
+
</div>
|
1381 |
</div>
|
1382 |
</div>
|
1383 |
</script>
|
1391 |
<a aria-hidden="true" data-icon="" class="delete"></a>
|
1392 |
</script>
|
1393 |
|
1394 |
+
<script type="text/html" id="ccf-field-conditional-template">
|
1395 |
+
<a aria-hidden="true" data-icon="" class="add"></a>
|
1396 |
+
<a aria-hidden="true" data-icon="" class="delete"></a>
|
1397 |
+
|
1398 |
+
<select class="conditional-field">
|
1399 |
+
</select>
|
1400 |
+
|
1401 |
+
<select class="conditional-compare">
|
1402 |
+
<option <# if ( 'is' === conditional.compare ) { #>selected<# } #> value="is"><?php esc_html_e( 'is', 'custom-contact-forms' ); ?></option>
|
1403 |
+
<option <# if ( 'is-not' === conditional.compare ) { #>selected<# } #> value="is-not"><?php esc_html_e( 'is not', 'custom-contact-forms' ); ?></option>
|
1404 |
+
<option <# if ( 'greater-than' === conditional.compare ) { #>selected<# } #> value="greater-than"><?php esc_html_e( '>', 'custom-contact-forms' ); ?></option>
|
1405 |
+
<option <# if ( 'less-than' === conditional.compare ) { #>selected<# } #> value="less-than"><?php esc_html_e( '<', 'custom-contact-forms' ); ?></option>
|
1406 |
+
<option <# if ( 'contains' === conditional.compare ) { #>selected<# } #> value="contains"><?php esc_html_e( 'contains', 'custom-contact-forms' ); ?></option>
|
1407 |
+
</select>
|
1408 |
+
<input class="conditional-value" placeholder="<?php esc_attr_e( 'Field value', 'custom-contact-forms' ); ?>" type="text" value="{{ conditional.value }}">
|
1409 |
+
</script>
|
1410 |
+
|
1411 |
<script type="text/html" id="ccf-dropdown-template">
|
1412 |
+
<div class="accordion-section <# if ( 'basic' === startPanel ) { #>expanded<# } #>">
|
1413 |
<a class="accordion-heading"><?php esc_html_e( 'Basic', 'custom-contact-forms' ); ?></a>
|
1414 |
<div class="section-content">
|
1415 |
<div>
|
1440 |
</div>
|
1441 |
</div>
|
1442 |
</div>
|
1443 |
+
<div class="accordion-section <# if ( 'advanced' === startPanel ) { #>expanded<# } #>">
|
1444 |
<a class="accordion-heading"><?php esc_html_e( 'Advanced', 'custom-contact-forms' ); ?></a>
|
1445 |
<div class="section-content">
|
1446 |
<div>
|
1447 |
<label for="ccf-field-class-name"><?php esc_html_e( 'Class Name:', 'custom-contact-forms' ); ?></label>
|
1448 |
<input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}">
|
1449 |
</div>
|
1450 |
+
<div>
|
1451 |
+
<label for="ccf-field-conditionals-enabled"><?php esc_html_e( 'Enable Conditional Logic:', 'custom-contact-forms' ); ?></label>
|
1452 |
+
<select id="ccf-field-conditionals-enabled" class="field-conditionals-enabled">
|
1453 |
+
<option value="0"><?php esc_html_e( 'No', 'custom-contact-forms' ); ?></option>
|
1454 |
+
<option value="1" <# if ( field.conditionalsEnabled ) { #>selected="selected"<# } #>><?php esc_html_e( 'Yes', 'custom-contact-forms' ); ?></option>
|
1455 |
+
</select>
|
1456 |
+
</div>
|
1457 |
+
<div class="<# if ( ! field.conditionalsEnabled ) { #>hide<# } #>">
|
1458 |
+
<select class="field-conditional-type">
|
1459 |
+
<option value="hide"><?php esc_html_e( 'Hide', 'custom-contact-forms' ); ?></option>
|
1460 |
+
<option <# if ( 'show' === field.conditionalType ) { #>selected="selected"<# } #> value="show"><?php esc_html_e( 'Show', 'custom-contact-forms' ); ?></option>
|
1461 |
+
</select>
|
1462 |
+
|
1463 |
+
<?php esc_html_e( 'this field if', 'custom-contact-forms' ); ?>
|
1464 |
+
|
1465 |
+
<select class="field-conditional-fields-required">
|
1466 |
+
<option value="all"><?php esc_html_e( 'All', 'custom-contact-forms' ); ?></option>
|
1467 |
+
<option <# if ( 'any' === field.conditionalFieldsRequired ) { #>selected="selected"<# } #> value="any"><?php esc_html_e( 'Any', 'custom-contact-forms' ); ?></option>
|
1468 |
+
</select>
|
1469 |
+
|
1470 |
+
<?php esc_html_e( 'of these conditions are true:', 'custom-contact-forms' ); ?>
|
1471 |
+
</div>
|
1472 |
+
<div class="conditionals <# if ( ! field.conditionalsEnabled ) { #>hide<# } #>">
|
1473 |
+
</div>
|
1474 |
</div>
|
1475 |
</div>
|
1476 |
</script>
|
1477 |
|
1478 |
<script type="text/html" id="ccf-radio-template">
|
1479 |
+
<div class="accordion-section <# if ( 'basic' === startPanel ) { #>expanded<# } #>">
|
1480 |
<a class="accordion-heading"><?php esc_html_e( 'Basic', 'custom-contact-forms' ); ?></a>
|
1481 |
<div class="section-content">
|
1482 |
<div>
|
1507 |
</div>
|
1508 |
</div>
|
1509 |
</div>
|
1510 |
+
<div class="accordion-section <# if ( 'advanced' === startPanel ) { #>expanded<# } #>">
|
1511 |
<a class="accordion-heading"><?php esc_html_e( 'Advanced', 'custom-contact-forms' ); ?></a>
|
1512 |
<div class="section-content">
|
1513 |
<div>
|
1514 |
<label for="ccf-field-class-name"><?php esc_html_e( 'Class Name:', 'custom-contact-forms' ); ?></label>
|
1515 |
<input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}">
|
1516 |
</div>
|
1517 |
+
<div>
|
1518 |
+
<label for="ccf-field-conditionals-enabled"><?php esc_html_e( 'Enable Conditional Logic:', 'custom-contact-forms' ); ?></label>
|
1519 |
+
<select id="ccf-field-conditionals-enabled" class="field-conditionals-enabled">
|
1520 |
+
<option value="0"><?php esc_html_e( 'No', 'custom-contact-forms' ); ?></option>
|
1521 |
+
<option value="1" <# if ( field.conditionalsEnabled ) { #>selected="selected"<# } #>><?php esc_html_e( 'Yes', 'custom-contact-forms' ); ?></option>
|
1522 |
+
</select>
|
1523 |
+
</div>
|
1524 |
+
<div class="<# if ( ! field.conditionalsEnabled ) { #>hide<# } #>">
|
1525 |
+
<select class="field-conditional-type">
|
1526 |
+
<option value="hide"><?php esc_html_e( 'Hide', 'custom-contact-forms' ); ?></option>
|
1527 |
+
<option <# if ( 'show' === field.conditionalType ) { #>selected="selected"<# } #> value="show"><?php esc_html_e( 'Show', 'custom-contact-forms' ); ?></option>
|
1528 |
+
</select>
|
1529 |
+
|
1530 |
+
<?php esc_html_e( 'this field if', 'custom-contact-forms' ); ?>
|
1531 |
+
|
1532 |
+
<select class="field-conditional-fields-required">
|
1533 |
+
<option value="all"><?php esc_html_e( 'All', 'custom-contact-forms' ); ?></option>
|
1534 |
+
<option <# if ( 'any' === field.conditionalFieldsRequired ) { #>selected="selected"<# } #> value="any"><?php esc_html_e( 'Any', 'custom-contact-forms' ); ?></option>
|
1535 |
+
</select>
|
1536 |
+
|
1537 |
+
<?php esc_html_e( 'of these conditions are true:', 'custom-contact-forms' ); ?>
|
1538 |
+
</div>
|
1539 |
+
<div class="conditionals <# if ( ! field.conditionalsEnabled ) { #>hide<# } #>">
|
1540 |
+
</div>
|
1541 |
</div>
|
1542 |
</div>
|
1543 |
</script>
|
1544 |
|
1545 |
<script type="text/html" id="ccf-checkboxes-template">
|
1546 |
+
<div class="accordion-section <# if ( 'basic' === startPanel ) { #>expanded<# } #>">
|
1547 |
<a class="accordion-heading"><?php esc_html_e( 'Basic', 'custom-contact-forms' ); ?></a>
|
1548 |
<div class="section-content">
|
1549 |
<div>
|
1574 |
</div>
|
1575 |
</div>
|
1576 |
</div>
|
1577 |
+
<div class="accordion-section <# if ( 'advanced' === startPanel ) { #>expanded<# } #>">
|
1578 |
<a class="accordion-heading"><?php esc_html_e( 'Advanced', 'custom-contact-forms' ); ?></a>
|
1579 |
<div class="section-content">
|
1580 |
<div>
|
1581 |
<label for="ccf-field-class-name"><?php esc_html_e( 'Class Name:', 'custom-contact-forms' ); ?></label>
|
1582 |
<input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}">
|
1583 |
</div>
|
1584 |
+
<div>
|
1585 |
+
<label for="ccf-field-conditionals-enabled"><?php esc_html_e( 'Enable Conditional Logic:', 'custom-contact-forms' ); ?></label>
|
1586 |
+
<select id="ccf-field-conditionals-enabled" class="field-conditionals-enabled">
|
1587 |
+
<option value="0"><?php esc_html_e( 'No', 'custom-contact-forms' ); ?></option>
|
1588 |
+
<option value="1" <# if ( field.conditionalsEnabled ) { #>selected="selected"<# } #>><?php esc_html_e( 'Yes', 'custom-contact-forms' ); ?></option>
|
1589 |
+
</select>
|
1590 |
+
</div>
|
1591 |
+
<div class="<# if ( ! field.conditionalsEnabled ) { #>hide<# } #>">
|
1592 |
+
<select class="field-conditional-type">
|
1593 |
+
<option value="hide"><?php esc_html_e( 'Hide', 'custom-contact-forms' ); ?></option>
|
1594 |
+
<option <# if ( 'show' === field.conditionalType ) { #>selected="selected"<# } #> value="show"><?php esc_html_e( 'Show', 'custom-contact-forms' ); ?></option>
|
1595 |
+
</select>
|
1596 |
+
|
1597 |
+
<?php esc_html_e( 'this field if', 'custom-contact-forms' ); ?>
|
1598 |
+
|
1599 |
+
<select class="field-conditional-fields-required">
|
1600 |
+
<option value="all"><?php esc_html_e( 'All', 'custom-contact-forms' ); ?></option>
|
1601 |
+
<option <# if ( 'any' === field.conditionalFieldsRequired ) { #>selected="selected"<# } #> value="any"><?php esc_html_e( 'Any', 'custom-contact-forms' ); ?></option>
|
1602 |
+
</select>
|
1603 |
+
|
1604 |
+
<?php esc_html_e( 'of these conditions are true:', 'custom-contact-forms' ); ?>
|
1605 |
+
</div>
|
1606 |
+
<div class="conditionals <# if ( ! field.conditionalsEnabled ) { #>hide<# } #>">
|
1607 |
+
</div>
|
1608 |
</div>
|
1609 |
</div>
|
1610 |
</script>
|
1616 |
</script>
|
1617 |
|
1618 |
<script type="text/html" id="ccf-single-line-text-preview-template">
|
1619 |
+
<label>{{ field.label }} <# if ( field.required ) { #><span class="required">*</span><# } #> <# if ( field.conditionalsEnabled ) { #><span class="conditionals-enabled">if</span><# } #></label>
|
1620 |
<input disabled type="text" placeholder="{{ field.placeholder }}" value="{{ field.value }}">
|
1621 |
<# if ( field.description ) { #>
|
1622 |
<div class="field-description">{{ field.description }}</div>
|
1624 |
</script>
|
1625 |
|
1626 |
<script type="text/html" id="ccf-file-preview-template">
|
1627 |
+
<label>{{ field.label }} <# if ( field.required ) { #><span class="required">*</span><# } #> <# if ( field.conditionalsEnabled ) { #><span class="conditionals-enabled">if</span><# } #></label>
|
1628 |
<input disabled type="file" placeholder="{{ field.placeholder }}" value="{{ field.value }}">
|
1629 |
<div class="field-description">
|
1630 |
<# if ( field.fileExtensions ) {
|
1642 |
</script>
|
1643 |
|
1644 |
<script type="text/html" id="ccf-recaptcha-preview-template">
|
1645 |
+
<label>{{ field.label }} <# if ( field.required ) { #><span class="required">*</span><# } #> <# if ( field.conditionalsEnabled ) { #><span class="conditionals-enabled">if</span><# } #></label>
|
1646 |
+
<img class="recaptcha-preview-img" src="<?php echo plugins_url( 'img/recaptcha.png', dirname( __FILE__ ) ); ?>">
|
1647 |
<# if ( field.description ) { #>
|
1648 |
<div class="field-description">{{ field.description }}</div>
|
1649 |
<# } #>
|
1650 |
</script>
|
1651 |
|
1652 |
<script type="text/html" id="ccf-paragraph-text-preview-template">
|
1653 |
+
<label>{{ field.label }} <# if ( field.required ) { #><span class="required">*</span><# } #> <# if ( field.conditionalsEnabled ) { #><span class="conditionals-enabled">if</span><# } #></label>
|
1654 |
<textarea placeholder="{{ field.placeholder }}" disabled>{{ field.value }}</textarea>
|
1655 |
<# if ( field.description ) { #>
|
1656 |
<div class="field-description">{{ field.description }}</div>
|
1658 |
</script>
|
1659 |
|
1660 |
<script type="text/html" id="ccf-dropdown-preview-template">
|
1661 |
+
<label>{{ field.label }} <# if ( field.required ) { #><span class="required">*</span><# } #> <# if ( field.conditionalsEnabled ) { #><span class="conditionals-enabled">if</span><# } #></label>
|
1662 |
<select>
|
1663 |
<# if ( field.choices.length === 0 || ( field.choices.length === 1 && ! field.choices.at( 0 ).get( 'label' ) && ! field.choices.at( 0 ).get( 'value' ) ) ) { #>
|
1664 |
<option><?php esc_html_e( 'An example choice', 'custom-contact-forms' ); ?></option>
|
1674 |
</script>
|
1675 |
|
1676 |
<script type="text/html" id="ccf-radio-preview-template">
|
1677 |
+
<label>{{ field.label }} <# if ( field.required ) { #><span class="required">*</span><# } #> <# if ( field.conditionalsEnabled ) { #><span class="conditionals-enabled">if</span><# } #></label>
|
1678 |
<# if ( field.choices.length === 0 || ( field.choices.length === 1 && ! field.choices.at( 0 ).get( 'label' ) && ! field.choices.at( 0 ).get( 'value' ) ) ) { #>
|
1679 |
<div>
|
1680 |
<input type="radio" value="1" checked="checked"> <label><?php esc_html_e( 'An example choice', 'custom-contact-forms' ); ?></label>
|
1692 |
</script>
|
1693 |
|
1694 |
<script type="text/html" id="ccf-checkboxes-preview-template">
|
1695 |
+
<label>{{ field.label }} <# if ( field.required ) { #><span class="required">*</span><# } #> <# if ( field.conditionalsEnabled ) { #><span class="conditionals-enabled">if</span><# } #></label>
|
1696 |
<# if ( field.choices.length === 0 || ( field.choices.length === 1 && ! field.choices.at( 0 ).get( 'label' ) && ! field.choices.at( 0 ).get( 'value' ) ) ) { #>
|
1697 |
<div>
|
1698 |
<input type="checkbox" value="1" checked="checked"> <label><?php esc_html_e( 'An example choice', 'custom-contact-forms' ); ?></label>
|
1710 |
</script>
|
1711 |
|
1712 |
<script type="text/html" id="ccf-html-preview-template">
|
1713 |
+
<# if ( field.conditionalsEnabled ) { #><span class="conditionals-enabled">if</span><# } #>
|
1714 |
<# if ( typeof mce !== 'undefined' ) { #>
|
1715 |
{{{ field.html }}}
|
1716 |
<# } else { #>
|
1719 |
</script>
|
1720 |
|
1721 |
<script type="text/html" id="ccf-section-header-preview-template">
|
1722 |
+
<# if ( field.conditionalsEnabled ) { #><span class="conditionals-enabled">if</span><# } #>
|
1723 |
<div class="heading">
|
1724 |
<# if ( field.heading ) { #>{{ field.heading }}<# } else { #><?php esc_html_e( 'Section Heading', 'custom-contact-forms' ); ?><# } #>
|
1725 |
</div>
|
1727 |
</script>
|
1728 |
|
1729 |
<script type="text/html" id="ccf-name-preview-template">
|
1730 |
+
<label>{{ field.label }} <# if ( field.required ) { #><span class="required">*</span><# } #> <# if ( field.conditionalsEnabled ) { #><span class="conditionals-enabled">if</span><# } #></label>
|
1731 |
<div class="left">
|
1732 |
<input type="text">
|
1733 |
<label class="sub-label"><?php esc_html_e( 'First', 'custom-contact-forms' ); ?></label>
|
1742 |
</script>
|
1743 |
|
1744 |
<script type="text/html" id="ccf-date-preview-template">
|
1745 |
+
<label>{{ field.label }} <# if ( field.required ) { #><span class="required">*</span><# } #> <# if ( field.conditionalsEnabled ) { #><span class="conditionals-enabled">if</span><# } #></label>
|
1746 |
<# if ( field.showDate && ! field.showTime ) { #>
|
1747 |
<input value="{{ field.value }}" class="ccf-datepicker" disabled type="text">
|
1748 |
<# } else if ( ! field.showDate && field.showTime ) { #>
|
1790 |
</script>
|
1791 |
|
1792 |
<script type="text/html" id="ccf-address-preview-template">
|
1793 |
+
<label>{{ field.label }} <# if ( field.required ) { #><span class="required">*</span><# } #> <# if ( field.conditionalsEnabled ) { #><span class="conditionals-enabled">if</span><# } #></label>
|
1794 |
<# if ( field.addressType === 'us' ) { #>
|
1795 |
<div class="full">
|
1796 |
<input type="text">
|
1852 |
</script>
|
1853 |
|
1854 |
<script type="text/html" id="ccf-email-preview-template">
|
1855 |
+
<label>{{ field.label }} <# if ( field.required ) { #><span class="required">*</span><# } #> <# if ( field.conditionalsEnabled ) { #><span class="conditionals-enabled">if</span><# } #></label>
|
1856 |
<# if ( ! field.emailConfirmation ) { #>
|
1857 |
<input placeholder="<# if ( field.placeholder ) { #>{{ field.placeholder }}<# } else { #><?php esc_html_e( 'email@example.com', 'custom-contact-forms' ); ?><# } #>" disabled type="text" value="{{ field.value }}">
|
1858 |
<# } else { #>
|
1871 |
</script>
|
1872 |
|
1873 |
<script type="text/html" id="ccf-website-preview-template">
|
1874 |
+
<label>{{ field.label }} <# if ( field.required ) { #><span class="required">*</span><# } #> <# if ( field.conditionalsEnabled ) { #><span class="conditionals-enabled">if</span><# } #></label>
|
1875 |
<input placeholder="<# if ( field.placeholder ) { #>{{ field.placeholder }}<# } else { #>http://<# } #>" disabled type="text" value="{{ field.value }}">
|
1876 |
<# if ( field.description ) { #>
|
1877 |
<div class="field-description">{{ field.description }}</div>
|
1879 |
</script>
|
1880 |
|
1881 |
<script type="text/html" id="ccf-phone-preview-template">
|
1882 |
+
<label>{{ field.label }} <# if ( field.required ) { #><span class="required">*</span><# } #> <# if ( field.conditionalsEnabled ) { #><span class="conditionals-enabled">if</span><# } #></label>
|
1883 |
<input placeholder="<# if ( field.placeholder ) { #>{{ field.placeholder }}<# } else if ( 'us' === field.phoneFormat ) { #>(301) 101-8976<# } #>" disabled type="text" value="{{ field.value }}">
|
1884 |
<# if ( field.description ) { #>
|
1885 |
<div class="field-description">{{ field.description }}</div>
|
2138 |
|
2139 |
if ( 'post.php' == $pagenow || 'post-new.php' == $pagenow ) {
|
2140 |
if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
|
2141 |
+
$js_manager_path = '/assets/build/js/form-manager.js';
|
2142 |
+
$js_mce_path = '/assets/js/form-mce.js';
|
2143 |
+
$css_path = '/assets/build/css/form-manager.css';
|
2144 |
} else {
|
2145 |
+
$js_manager_path = '/assets/build/js/form-manager.min.js';
|
2146 |
+
$js_mce_path = '/assets/build/js/form-mce.min.js';
|
2147 |
+
$css_path = '/assets/build/css/form-manager.min.css';
|
2148 |
}
|
2149 |
|
2150 |
$field_labels = apply_filters( 'ccf_field_labels', array(
|
2159 |
|
2160 |
$structure_field_labels = apply_filters( 'ccf_structure_field_labels', array(
|
2161 |
'html' => __( 'HTML', 'custom-contact-forms' ),
|
2162 |
+
'section-header' => __( 'Section', 'custom-contact-forms' ),
|
2163 |
));
|
2164 |
|
2165 |
$special_field_labels = apply_filters( 'ccf_special_field_labels', array(
|
2175 |
wp_register_script( 'moment', plugins_url( '/bower_components/moment/moment.js', dirname( __FILE__ ) ), array(), CCF_VERSION );
|
2176 |
|
2177 |
if ( ! wp_script_is( 'wp-api', 'registered' ) ) {
|
2178 |
+
wp_register_script( 'wp-api', plugins_url( '/wp-api/wp-api.js', dirname( __FILE__ ) ), array(), CCF_VERSION );
|
2179 |
}
|
2180 |
|
2181 |
$site_url_parsed = parse_url( site_url() );
|
2203 |
'specialFieldLabels' => $special_field_labels,
|
2204 |
'maxFileSize' => floor( wp_max_upload_size() / 1000 / 1000 ),
|
2205 |
'noEmailFields' => esc_html__( 'You have no email fields', 'custom-contact-forms' ),
|
2206 |
+
'noAvailableFields' => esc_html__( 'No available fields', 'custom-contact-forms' ),
|
2207 |
'noNameFields' => esc_html__( 'You have no name fields', 'custom-contact-forms' ),
|
2208 |
'noApplicableFields' => esc_html__( 'You have no applicable fields', 'custom-contact-forms' ),
|
2209 |
'chooseFormField' => esc_html__( 'Choose a Form Field', 'custom-contact-forms' ),
|
classes/class-ccf-form-renderer.php
CHANGED
@@ -81,14 +81,14 @@ class CCF_Form_Renderer {
|
|
81 |
}
|
82 |
|
83 |
if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
|
84 |
-
$css_form_path = '/build/css/form.css';
|
85 |
-
$js_path = '/js/form.js';
|
86 |
} else {
|
87 |
-
$css_form_path = '/build/css/form.min.css';
|
88 |
-
$js_path = '/build/js/form.min.js';
|
89 |
}
|
90 |
|
91 |
-
wp_enqueue_style('ccf-jquery-ui', '//ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css');
|
92 |
wp_enqueue_script( 'ccf-google-recaptcha', '//www.google.com/recaptcha/api.js?ver=2&onload=ccfRecaptchaOnload&render=explicit', array(), CCF_VERSION, true );
|
93 |
wp_enqueue_style( 'ccf-form', plugins_url( $css_form_path, dirname( __FILE__ ) ), array(), CCF_VERSION );
|
94 |
|
@@ -178,7 +178,7 @@ class CCF_Form_Renderer {
|
|
178 |
</div>
|
179 |
|
180 |
<?php
|
181 |
-
} elseif ( ! empty( $_POST['ccf_form'] ) && ! empty( $_POST['form_id'] ) && $_POST['form_id'] == $form_id && empty( CCF_Form_Handler::factory()->errors_by_form[$form_id] ) ) {
|
182 |
|
183 |
$completion_message = get_post_meta( $form_id, 'ccf_form_completion_message', true );
|
184 |
?>
|
@@ -197,10 +197,29 @@ class CCF_Form_Renderer {
|
|
197 |
|
198 |
$fields_html = '';
|
199 |
|
|
|
|
|
200 |
foreach ( $fields as $field_id ) {
|
201 |
$field_id = (int) $field_id;
|
202 |
|
203 |
$type = esc_attr( get_post_meta( $field_id, 'ccf_field_type', true ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
204 |
|
205 |
if ( 'file' === $type ) {
|
206 |
$contains_file = true;
|
@@ -209,6 +228,10 @@ class CCF_Form_Renderer {
|
|
209 |
$fields_html .= apply_filters( 'ccf_field_html', CCF_Field_Renderer::factory()->render_router( $type, $field_id, $form_id ), $type, $field_id );
|
210 |
}
|
211 |
|
|
|
|
|
|
|
|
|
212 |
$theme = get_post_meta( $form_id, 'ccf_form_theme', true );
|
213 |
if ( empty( $theme ) ) {
|
214 |
$theme = 'default';
|
@@ -237,6 +260,13 @@ class CCF_Form_Renderer {
|
|
237 |
<img class="loading-img" src="<?php echo esc_url( site_url( '/wp-admin/images/wpspin_light.gif' ) ); ?>">
|
238 |
</div>
|
239 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
240 |
<input type="hidden" name="form_id" value="<?php echo (int) $form_id; ?>">
|
241 |
<input type="hidden" name="form_page" value="<?php echo esc_url( untrailingslashit( site_url() ) . $_SERVER['REQUEST_URI'] ); ?>">
|
242 |
<input type="text" name="my_information" style="display: none;">
|
81 |
}
|
82 |
|
83 |
if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
|
84 |
+
$css_form_path = '/assets/build/css/form.css';
|
85 |
+
$js_path = '/assets/js/form.js';
|
86 |
} else {
|
87 |
+
$css_form_path = '/assets/build/css/form.min.css';
|
88 |
+
$js_path = '/assets/build/js/form.min.js';
|
89 |
}
|
90 |
|
91 |
+
wp_enqueue_style( 'ccf-jquery-ui', '//ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css' );
|
92 |
wp_enqueue_script( 'ccf-google-recaptcha', '//www.google.com/recaptcha/api.js?ver=2&onload=ccfRecaptchaOnload&render=explicit', array(), CCF_VERSION, true );
|
93 |
wp_enqueue_style( 'ccf-form', plugins_url( $css_form_path, dirname( __FILE__ ) ), array(), CCF_VERSION );
|
94 |
|
178 |
</div>
|
179 |
|
180 |
<?php
|
181 |
+
} elseif ( ! empty( $_POST['ccf_form'] ) && ! empty( $_POST['form_id'] ) && $_POST['form_id'] == $form_id && empty( CCF_Form_Handler::factory()->errors_by_form[ $form_id ] ) ) {
|
182 |
|
183 |
$completion_message = get_post_meta( $form_id, 'ccf_form_completion_message', true );
|
184 |
?>
|
197 |
|
198 |
$fields_html = '';
|
199 |
|
200 |
+
$conditionals = array();
|
201 |
+
|
202 |
foreach ( $fields as $field_id ) {
|
203 |
$field_id = (int) $field_id;
|
204 |
|
205 |
$type = esc_attr( get_post_meta( $field_id, 'ccf_field_type', true ) );
|
206 |
+
$slug = get_post_meta( $field_id, 'ccf_field_slug', true );
|
207 |
+
$conditionals_enabled = get_post_meta( $field_id, 'ccf_field_conditionalsEnabled', true );
|
208 |
+
|
209 |
+
if ( ! empty( $conditionals_enabled ) ) {
|
210 |
+
// Todo: escaping?
|
211 |
+
$field_conditionals = get_post_meta( $field_id, 'ccf_attached_conditionals', true );
|
212 |
+
|
213 |
+
if ( ! empty( $field_conditionals ) ) {
|
214 |
+
$new_conditionals = array(
|
215 |
+
'conditions' => $field_conditionals,
|
216 |
+
'conditionalType' => get_post_meta( $field_id, 'ccf_field_conditionalType', true ),
|
217 |
+
'conditionalFieldsRequired' => get_post_meta( $field_id, 'ccf_field_conditionalFieldsRequired', true ),
|
218 |
+
);
|
219 |
+
|
220 |
+
$conditionals[$slug] = $new_conditionals;
|
221 |
+
}
|
222 |
+
}
|
223 |
|
224 |
if ( 'file' === $type ) {
|
225 |
$contains_file = true;
|
228 |
$fields_html .= apply_filters( 'ccf_field_html', CCF_Field_Renderer::factory()->render_router( $type, $field_id, $form_id ), $type, $field_id );
|
229 |
}
|
230 |
|
231 |
+
if ( CCF_Field_Renderer::factory()->section_open ) {
|
232 |
+
$fields_html .= '</div>';
|
233 |
+
}
|
234 |
+
|
235 |
$theme = get_post_meta( $form_id, 'ccf_form_theme', true );
|
236 |
if ( empty( $theme ) ) {
|
237 |
$theme = 'default';
|
260 |
<img class="loading-img" src="<?php echo esc_url( site_url( '/wp-admin/images/wpspin_light.gif' ) ); ?>">
|
261 |
</div>
|
262 |
|
263 |
+
<script type="text/javascript">
|
264 |
+
window.wp = window.wp || {};
|
265 |
+
wp.ccf = wp.ccf || {};
|
266 |
+
wp.ccf.conditionals = wp.ccf.conditionals || [];
|
267 |
+
wp.ccf.conditionals[<?php echo (int) $form_id; ?>] = <?php echo wp_json_encode( $conditionals ); ?>;
|
268 |
+
</script>
|
269 |
+
|
270 |
<input type="hidden" name="form_id" value="<?php echo (int) $form_id; ?>">
|
271 |
<input type="hidden" name="form_page" value="<?php echo esc_url( untrailingslashit( site_url() ) . $_SERVER['REQUEST_URI'] ); ?>">
|
272 |
<input type="text" name="my_information" style="display: none;">
|
classes/class-ccf-settings.php
CHANGED
@@ -27,11 +27,11 @@ class CCF_Settings {
|
|
27 |
*/
|
28 |
public function action_admin_enqueue_scripts() {
|
29 |
if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
|
30 |
-
$css_path = '/build/css/settings.css';
|
31 |
-
$js_path = '/js/settings.js';
|
32 |
} else {
|
33 |
-
$css_path = '/build/css/settings.min.css';
|
34 |
-
$js_path = '/build/js/settings.min.js';
|
35 |
}
|
36 |
wp_enqueue_style( 'ccf-settings', plugins_url( $css_path, dirname( __FILE__ ) ), array(), CCF_VERSION );
|
37 |
wp_enqueue_script( 'ccf-settings', plugins_url( $js_path, dirname( __FILE__ ) ), array( 'jquery' ), CCF_VERSION, true );
|
@@ -72,7 +72,6 @@ class CCF_Settings {
|
|
72 |
$restriction_classes = 'ccf-asset-loading-restrictions-wrap';
|
73 |
}
|
74 |
|
75 |
-
|
76 |
add_settings_section( 'asset-loading-restriction', 'Asset Loading Restriction', array( $this, 'asset_loading_restriction_summary' ), 'custom-contact-forms' );
|
77 |
add_settings_field( 'asset-loading-restriction-enable', esc_html__( 'Enable Asset Loading Restrictions', 'custom-contact-forms' ), array( $this, 'asset_loading_restriction_enable' ), 'custom-contact-forms', 'asset-loading-restriction' );
|
78 |
add_settings_field( 'asset-loading-restriction-choose', esc_html__( 'Restrict Asset Loading To', 'custom-contact-forms' ), array( $this, 'asset_loading_restriction_choose' ), 'custom-contact-forms', 'asset-loading-restriction', array( 'class' => $restriction_classes ) );
|
@@ -129,7 +128,8 @@ class CCF_Settings {
|
|
129 |
<span class="add">+</span>
|
130 |
<span class="delete">×</span>
|
131 |
</div>
|
132 |
-
<?php $i++;
|
|
|
133 |
<div class="asset">
|
134 |
<input name="ccf_settings[asset_loading_restrictions][0][location]" class="asset-location" type="text" placeholder="<?php esc_attr_e( 'URL or post ID', 'custom-contact-forms' ); ?>">
|
135 |
<?php esc_html_e( 'Restriction type:', 'custom-contact-forms' ); ?>
|
27 |
*/
|
28 |
public function action_admin_enqueue_scripts() {
|
29 |
if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
|
30 |
+
$css_path = '/assets/build/css/settings.css';
|
31 |
+
$js_path = '/assets/js/settings.js';
|
32 |
} else {
|
33 |
+
$css_path = '/assets/build/css/settings.min.css';
|
34 |
+
$js_path = '/assets/build/js/settings.min.js';
|
35 |
}
|
36 |
wp_enqueue_style( 'ccf-settings', plugins_url( $css_path, dirname( __FILE__ ) ), array(), CCF_VERSION );
|
37 |
wp_enqueue_script( 'ccf-settings', plugins_url( $js_path, dirname( __FILE__ ) ), array( 'jquery' ), CCF_VERSION, true );
|
72 |
$restriction_classes = 'ccf-asset-loading-restrictions-wrap';
|
73 |
}
|
74 |
|
|
|
75 |
add_settings_section( 'asset-loading-restriction', 'Asset Loading Restriction', array( $this, 'asset_loading_restriction_summary' ), 'custom-contact-forms' );
|
76 |
add_settings_field( 'asset-loading-restriction-enable', esc_html__( 'Enable Asset Loading Restrictions', 'custom-contact-forms' ), array( $this, 'asset_loading_restriction_enable' ), 'custom-contact-forms', 'asset-loading-restriction' );
|
77 |
add_settings_field( 'asset-loading-restriction-choose', esc_html__( 'Restrict Asset Loading To', 'custom-contact-forms' ), array( $this, 'asset_loading_restriction_choose' ), 'custom-contact-forms', 'asset-loading-restriction', array( 'class' => $restriction_classes ) );
|
128 |
<span class="add">+</span>
|
129 |
<span class="delete">×</span>
|
130 |
</div>
|
131 |
+
<?php $i++;
|
132 |
+
endforeach; else : ?>
|
133 |
<div class="asset">
|
134 |
<input name="ccf_settings[asset_loading_restrictions][0][location]" class="asset-location" type="text" placeholder="<?php esc_attr_e( 'URL or post ID', 'custom-contact-forms' ); ?>">
|
135 |
<?php esc_html_e( 'Restriction type:', 'custom-contact-forms' ); ?>
|
classes/class-ccf-upgrader.php
CHANGED
@@ -140,13 +140,13 @@ class CCF_Upgrader {
|
|
140 |
if ( ! empty( $fields ) ) {
|
141 |
$form_fields = array();
|
142 |
|
143 |
-
foreach( $fields as $field_id ) {
|
144 |
$field = $wpdb->get_row( sprintf( "SELECT * FROM {$wpdb->prefix}customcontactforms_fields WHERE ID='%d'", (int) $field_id ) );
|
145 |
|
146 |
$type = $field->field_type;
|
147 |
|
148 |
-
if ( ! empty( $type_mapping[$type] ) ) {
|
149 |
-
$type = $type_mapping[$type];
|
150 |
} else {
|
151 |
continue;
|
152 |
}
|
@@ -228,17 +228,17 @@ class CCF_Upgrader {
|
|
228 |
* Terrible hack for unserializing weird data form
|
229 |
*/
|
230 |
while ( ! empty( $data ) ) {
|
231 |
-
$key_length = $this->strstrb($data, ':"');
|
232 |
-
$key_length = str_replace('s:', '', $key_length);
|
233 |
-
$piece_length = 6 + strlen($key_length) + (int) $key_length;
|
234 |
-
$key = substr($data, (4 + strlen($key_length)), (int) $key_length);
|
235 |
-
$data = substr($data, $piece_length);
|
236 |
-
$value_length = $this->strstrb($data, ':"');
|
237 |
-
$value_length = str_replace('s:', '', $value_length);
|
238 |
-
$piece_length = 6 + strlen($value_length) + (int) $value_length;
|
239 |
-
$value = substr($data, (4 + strlen($value_length)), (int) $value_length);
|
240 |
-
$data = substr($data, $piece_length);
|
241 |
-
$data_array[$key] = $value;
|
242 |
}
|
243 |
|
244 |
if ( ! is_wp_error( $submission_id ) ) {
|
@@ -247,7 +247,7 @@ class CCF_Upgrader {
|
|
247 |
}
|
248 |
|
249 |
$upgraded_forms[] = (int) $form->id;
|
250 |
-
$new_upgraded_forms[(int) $form->id] = $form_id;
|
251 |
|
252 |
update_option( 'ccf_upgraded_forms', $upgraded_forms );
|
253 |
}
|
@@ -296,7 +296,7 @@ class CCF_Upgrader {
|
|
296 |
* @since 6.1
|
297 |
* @return mixed
|
298 |
*/
|
299 |
-
public function strstrb( $h, $n ){
|
300 |
return array_shift( explode( $n, $h, 2 ) );
|
301 |
}
|
302 |
|
@@ -347,7 +347,7 @@ class CCF_Upgrader {
|
|
347 |
'fromNameType' => sanitize_text_field( get_post_meta( $form_id, 'ccf_form_email_notification_from_name_type', true ) ),
|
348 |
'fromName' => sanitize_text_field( get_post_meta( $form_id, 'ccf_form_email_notification_from_name', true ) ),
|
349 |
'fromNameField' => sanitize_text_field( get_post_meta( $form_id, 'ccf_form_email_notification_from_name_field', true ) ),
|
350 |
-
)
|
351 |
);
|
352 |
|
353 |
update_post_meta( $form_id, 'ccf_form_notifications', $notifications );
|
140 |
if ( ! empty( $fields ) ) {
|
141 |
$form_fields = array();
|
142 |
|
143 |
+
foreach ( $fields as $field_id ) {
|
144 |
$field = $wpdb->get_row( sprintf( "SELECT * FROM {$wpdb->prefix}customcontactforms_fields WHERE ID='%d'", (int) $field_id ) );
|
145 |
|
146 |
$type = $field->field_type;
|
147 |
|
148 |
+
if ( ! empty( $type_mapping[ $type ] ) ) {
|
149 |
+
$type = $type_mapping[ $type ];
|
150 |
} else {
|
151 |
continue;
|
152 |
}
|
228 |
* Terrible hack for unserializing weird data form
|
229 |
*/
|
230 |
while ( ! empty( $data ) ) {
|
231 |
+
$key_length = $this->strstrb( $data, ':"' );
|
232 |
+
$key_length = str_replace( 's:', '', $key_length );
|
233 |
+
$piece_length = 6 + strlen( $key_length ) + (int) $key_length;
|
234 |
+
$key = substr( $data, (4 + strlen( $key_length )), (int) $key_length );
|
235 |
+
$data = substr( $data, $piece_length );
|
236 |
+
$value_length = $this->strstrb( $data, ':"' );
|
237 |
+
$value_length = str_replace( 's:', '', $value_length );
|
238 |
+
$piece_length = 6 + strlen( $value_length ) + (int) $value_length;
|
239 |
+
$value = substr( $data, (4 + strlen( $value_length )), (int) $value_length );
|
240 |
+
$data = substr( $data, $piece_length );
|
241 |
+
$data_array[ $key ] = $value;
|
242 |
}
|
243 |
|
244 |
if ( ! is_wp_error( $submission_id ) ) {
|
247 |
}
|
248 |
|
249 |
$upgraded_forms[] = (int) $form->id;
|
250 |
+
$new_upgraded_forms[ (int) $form->id ] = $form_id;
|
251 |
|
252 |
update_option( 'ccf_upgraded_forms', $upgraded_forms );
|
253 |
}
|
296 |
* @since 6.1
|
297 |
* @return mixed
|
298 |
*/
|
299 |
+
public function strstrb( $h, $n ) {
|
300 |
return array_shift( explode( $n, $h, 2 ) );
|
301 |
}
|
302 |
|
347 |
'fromNameType' => sanitize_text_field( get_post_meta( $form_id, 'ccf_form_email_notification_from_name_type', true ) ),
|
348 |
'fromName' => sanitize_text_field( get_post_meta( $form_id, 'ccf_form_email_notification_from_name', true ) ),
|
349 |
'fromNameField' => sanitize_text_field( get_post_meta( $form_id, 'ccf_form_email_notification_from_name_field', true ) ),
|
350 |
+
),
|
351 |
);
|
352 |
|
353 |
update_post_meta( $form_id, 'ccf_form_notifications', $notifications );
|
classes/class-ccf-widget.php
CHANGED
@@ -56,7 +56,6 @@ class CCF_Widget extends WP_Widget {
|
|
56 |
'no_found_rows' => true,
|
57 |
'post_status' => 'publish',
|
58 |
'fields' => 'ids',
|
59 |
-
|
60 |
) );
|
61 |
?>
|
62 |
<p>
|
56 |
'no_found_rows' => true,
|
57 |
'post_status' => 'publish',
|
58 |
'fields' => 'ids',
|
|
|
59 |
) );
|
60 |
?>
|
61 |
<p>
|
custom-contact-forms.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin URI: http://www.taylorlovett.com
|
5 |
* Description: Build beautiful custom forms and manage submissions the WordPress way. View live previews of your forms while you build them. Contact forms, subscription forms, payment forms, etc.
|
6 |
* Author: Taylor Lovett
|
7 |
-
* Version: 7.
|
8 |
* Text Domain: custom-contact-forms
|
9 |
* Domain Path: /languages
|
10 |
* Author URI: http://www.taylorlovett.com
|
@@ -14,7 +14,7 @@
|
|
14 |
* Include plugin reqs
|
15 |
*/
|
16 |
|
17 |
-
define( 'CCF_VERSION', '7.
|
18 |
|
19 |
require_once( dirname( __FILE__ ) . '/classes/class-ccf-constants.php' );
|
20 |
require_once( dirname( __FILE__ ) . '/classes/class-ccf-custom-contact-forms.php' );
|
4 |
* Plugin URI: http://www.taylorlovett.com
|
5 |
* Description: Build beautiful custom forms and manage submissions the WordPress way. View live previews of your forms while you build them. Contact forms, subscription forms, payment forms, etc.
|
6 |
* Author: Taylor Lovett
|
7 |
+
* Version: 7.5
|
8 |
* Text Domain: custom-contact-forms
|
9 |
* Domain Path: /languages
|
10 |
* Author URI: http://www.taylorlovett.com
|
14 |
* Include plugin reqs
|
15 |
*/
|
16 |
|
17 |
+
define( 'CCF_VERSION', '7.5' );
|
18 |
|
19 |
require_once( dirname( __FILE__ ) . '/classes/class-ccf-constants.php' );
|
20 |
require_once( dirname( __FILE__ ) . '/classes/class-ccf-custom-contact-forms.php' );
|
languages/custom-contact-forms.mo
CHANGED
Binary file
|
languages/custom-contact-forms.po
CHANGED
@@ -5,8 +5,8 @@ msgstr ""
|
|
5 |
"Project-Id-Version: Custom Contact Forms\n"
|
6 |
"Report-Msgid-Bugs-To: https://github.com/tlovett1/custom-contact-forms/"
|
7 |
"issues\n"
|
8 |
-
"POT-Creation-Date: 2016-
|
9 |
-
"PO-Revision-Date: 2016-
|
10 |
"Last-Translator: Taylor Lovett <tlovett88@gmail.com>\n"
|
11 |
"Language-Team: \n"
|
12 |
"Language: en\n"
|
@@ -23,23 +23,23 @@ msgstr ""
|
|
23 |
"X-Textdomain-Support: yes\n"
|
24 |
"X-Poedit-SearchPath-0: ..\n"
|
25 |
|
26 |
-
#: ../classes/class-ccf-api-form-controller.php:
|
27 |
msgid "Form not found"
|
28 |
msgstr ""
|
29 |
|
30 |
-
#: ../classes/class-ccf-api-form-controller.php:
|
31 |
msgid "Could not create form"
|
32 |
msgstr ""
|
33 |
|
34 |
-
#: ../classes/class-ccf-api-form-controller.php:
|
35 |
msgid "Could not update form"
|
36 |
msgstr ""
|
37 |
|
38 |
-
#: ../classes/class-ccf-api-form-controller.php:
|
39 |
msgid "Could not delete form"
|
40 |
msgstr ""
|
41 |
|
42 |
-
#: ../classes/class-ccf-api-form-controller.php:
|
43 |
msgid "Could not delete submission"
|
44 |
msgstr ""
|
45 |
|
@@ -59,7 +59,7 @@ msgstr ""
|
|
59 |
msgid "<a href=\"%s\">Forms and Submissions</a>"
|
60 |
msgstr ""
|
61 |
|
62 |
-
#: ../classes/class-ccf-export.php:58 ../classes/class-ccf-form-cpt.php:
|
63 |
msgid "Forms and Submissions"
|
64 |
msgstr ""
|
65 |
|
@@ -71,248 +71,248 @@ msgstr ""
|
|
71 |
msgid "Form Fields"
|
72 |
msgstr ""
|
73 |
|
74 |
-
#: ../classes/class-ccf-field-renderer.php:
|
75 |
#, php-format
|
76 |
msgid "Allowed file extensions are %s. "
|
77 |
msgstr ""
|
78 |
|
79 |
-
#: ../classes/class-ccf-field-renderer.php:
|
80 |
#, php-format
|
81 |
msgid "Max file size is %d MB. "
|
82 |
msgstr ""
|
83 |
|
84 |
-
#: ../classes/class-ccf-field-renderer.php:
|
85 |
-
#: ../classes/class-ccf-form-manager.php:
|
86 |
-
#: ../classes/class-ccf-form-manager.php:
|
87 |
msgid "Street Address"
|
88 |
msgstr ""
|
89 |
|
90 |
-
#: ../classes/class-ccf-field-renderer.php:
|
91 |
-
#: ../classes/class-ccf-form-manager.php:
|
92 |
-
#: ../classes/class-ccf-form-manager.php:
|
93 |
msgid "Address Line 2"
|
94 |
msgstr ""
|
95 |
|
96 |
-
#: ../classes/class-ccf-field-renderer.php:
|
97 |
-
#: ../classes/class-ccf-form-manager.php:
|
98 |
-
#: ../classes/class-ccf-form-manager.php:
|
99 |
msgid "City"
|
100 |
msgstr ""
|
101 |
|
102 |
-
#: ../classes/class-ccf-field-renderer.php:
|
103 |
-
#: ../classes/class-ccf-form-manager.php:
|
104 |
msgid "State"
|
105 |
msgstr ""
|
106 |
|
107 |
-
#: ../classes/class-ccf-field-renderer.php:
|
108 |
-
#: ../classes/class-ccf-form-manager.php:
|
109 |
msgid "ZIP Code"
|
110 |
msgstr ""
|
111 |
|
112 |
-
#: ../classes/class-ccf-field-renderer.php:
|
113 |
-
#: ../classes/class-ccf-form-manager.php:
|
114 |
msgid "State / Region / Province"
|
115 |
msgstr ""
|
116 |
|
117 |
-
#: ../classes/class-ccf-field-renderer.php:
|
118 |
-
#: ../classes/class-ccf-form-manager.php:
|
119 |
msgid "ZIP / Postal Code"
|
120 |
msgstr ""
|
121 |
|
122 |
-
#: ../classes/class-ccf-field-renderer.php:
|
123 |
-
#: ../classes/class-ccf-form-manager.php:
|
124 |
msgid "Country"
|
125 |
msgstr ""
|
126 |
|
127 |
-
#: ../classes/class-ccf-field-renderer.php:
|
128 |
-
#: ../classes/class-ccf-form-manager.php:
|
129 |
msgid "email@example.com"
|
130 |
msgstr ""
|
131 |
|
132 |
-
#: ../classes/class-ccf-field-renderer.php:
|
133 |
#: ../classes/class-ccf-form-manager.php:327
|
134 |
-
#: ../classes/class-ccf-form-manager.php:
|
135 |
-
#: ../classes/class-ccf-form-manager.php:
|
136 |
msgid "Email"
|
137 |
msgstr ""
|
138 |
|
139 |
-
#: ../classes/class-ccf-field-renderer.php:
|
140 |
-
#: ../classes/class-ccf-form-manager.php:
|
141 |
msgid "Confirm Email"
|
142 |
msgstr ""
|
143 |
|
144 |
-
#: ../classes/class-ccf-field-renderer.php:
|
145 |
-
#: ../classes/class-ccf-form-manager.php:
|
146 |
msgid "First"
|
147 |
msgstr ""
|
148 |
|
149 |
-
#: ../classes/class-ccf-field-renderer.php:
|
150 |
-
#: ../classes/class-ccf-form-manager.php:
|
151 |
msgid "Last"
|
152 |
msgstr ""
|
153 |
|
154 |
-
#: ../classes/class-ccf-field-renderer.php:
|
155 |
-
#: ../classes/class-ccf-field-renderer.php:
|
156 |
-
#: ../classes/class-ccf-form-manager.php:
|
157 |
-
#: ../classes/class-ccf-form-manager.php:
|
158 |
msgid "HH"
|
159 |
msgstr ""
|
160 |
|
161 |
-
#: ../classes/class-ccf-field-renderer.php:
|
162 |
-
#: ../classes/class-ccf-field-renderer.php:
|
163 |
-
#: ../classes/class-ccf-form-manager.php:
|
164 |
-
#: ../classes/class-ccf-form-manager.php:
|
165 |
msgid "MM"
|
166 |
msgstr ""
|
167 |
|
168 |
-
#: ../classes/class-ccf-field-renderer.php:
|
169 |
-
#: ../classes/class-ccf-field-renderer.php:
|
170 |
-
#: ../classes/class-ccf-form-manager.php:
|
171 |
-
#: ../classes/class-ccf-form-manager.php:
|
172 |
msgid "AM"
|
173 |
msgstr ""
|
174 |
|
175 |
-
#: ../classes/class-ccf-field-renderer.php:
|
176 |
-
#: ../classes/class-ccf-field-renderer.php:
|
177 |
-
#: ../classes/class-ccf-form-manager.php:
|
178 |
-
#: ../classes/class-ccf-form-manager.php:
|
179 |
msgid "PM"
|
180 |
msgstr ""
|
181 |
|
182 |
-
#: ../classes/class-ccf-field-renderer.php:
|
183 |
-
#: ../classes/class-ccf-form-cpt.php:
|
184 |
#: ../classes/class-ccf-form-manager.php:508
|
185 |
#: ../classes/class-ccf-form-manager.php:521
|
186 |
-
#: ../classes/class-ccf-form-manager.php:
|
187 |
-
#: ../classes/class-ccf-form-manager.php:
|
188 |
-
#: ../classes/class-ccf-form-manager.php:
|
189 |
-
#: ../classes/class-ccf-form-manager.php:
|
190 |
msgid "Date"
|
191 |
msgstr ""
|
192 |
|
193 |
-
#: ../classes/class-ccf-form-cpt.php:
|
194 |
msgid "Form Submission Columns"
|
195 |
msgstr ""
|
196 |
|
197 |
-
#: ../classes/class-ccf-form-cpt.php:
|
198 |
-
#: ../classes/class-ccf-form-cpt.php:
|
199 |
#: ../classes/class-ccf-form-manager.php:511
|
200 |
#: ../classes/class-ccf-form-manager.php:524
|
201 |
msgid "Submissions"
|
202 |
msgstr ""
|
203 |
|
204 |
-
#: ../classes/class-ccf-form-cpt.php:
|
205 |
msgid "At a Glance"
|
206 |
msgstr ""
|
207 |
|
208 |
-
#: ../classes/class-ccf-form-cpt.php:
|
209 |
msgid "Preview"
|
210 |
msgstr ""
|
211 |
|
212 |
-
#: ../classes/class-ccf-form-cpt.php:
|
213 |
msgid "Save your new form to see a preview."
|
214 |
msgstr ""
|
215 |
|
216 |
-
#: ../classes/class-ccf-form-cpt.php:
|
217 |
msgid "Created on:"
|
218 |
msgstr ""
|
219 |
|
220 |
-
#: ../classes/class-ccf-form-cpt.php:
|
221 |
msgid "Author:"
|
222 |
msgstr ""
|
223 |
|
224 |
-
#: ../classes/class-ccf-form-cpt.php:
|
225 |
msgid "Number of fields:"
|
226 |
msgstr ""
|
227 |
|
228 |
-
#: ../classes/class-ccf-form-cpt.php:
|
229 |
msgid "Number of submissions:"
|
230 |
msgstr ""
|
231 |
|
232 |
-
#: ../classes/class-ccf-form-cpt.php:
|
233 |
msgid "Move to Trash"
|
234 |
msgstr ""
|
235 |
|
236 |
-
#: ../classes/class-ccf-form-cpt.php:
|
237 |
msgid "Export"
|
238 |
msgstr ""
|
239 |
|
240 |
-
#: ../classes/class-ccf-form-cpt.php:
|
241 |
-
#: ../classes/class-ccf-form-manager.php:
|
242 |
msgid "(No title)"
|
243 |
msgstr ""
|
244 |
|
245 |
-
#: ../classes/class-ccf-form-cpt.php:
|
246 |
msgid "Manage Form"
|
247 |
msgstr ""
|
248 |
|
249 |
-
#: ../classes/class-ccf-form-cpt.php:
|
250 |
msgid "Form Title"
|
251 |
msgstr ""
|
252 |
|
253 |
-
#: ../classes/class-ccf-form-cpt.php:
|
254 |
#: ../classes/class-ccf-form-manager.php:509
|
255 |
#: ../classes/class-ccf-form-manager.php:522
|
256 |
msgid "Author"
|
257 |
msgstr ""
|
258 |
|
259 |
-
#: ../classes/class-ccf-form-cpt.php:
|
260 |
#: ../classes/class-ccf-form-manager.php:510
|
261 |
#: ../classes/class-ccf-form-manager.php:523
|
262 |
msgid "Number of Fields"
|
263 |
msgstr ""
|
264 |
|
265 |
-
#: ../classes/class-ccf-form-cpt.php:
|
266 |
msgid "Unpublished"
|
267 |
msgstr ""
|
268 |
|
269 |
-
#: ../classes/class-ccf-form-cpt.php:
|
270 |
msgid "Y/m/d g:i:s A"
|
271 |
msgstr ""
|
272 |
|
273 |
-
#: ../classes/class-ccf-form-cpt.php:
|
274 |
#, php-format
|
275 |
msgid "%s ago"
|
276 |
msgstr ""
|
277 |
|
278 |
-
#: ../classes/class-ccf-form-cpt.php:
|
279 |
msgid "Y/m/d"
|
280 |
msgstr ""
|
281 |
|
282 |
-
#: ../classes/class-ccf-form-cpt.php:
|
283 |
msgid "Forms"
|
284 |
msgstr ""
|
285 |
|
286 |
-
#: ../classes/class-ccf-form-cpt.php:
|
287 |
msgid "Form"
|
288 |
msgstr ""
|
289 |
|
290 |
-
#: ../classes/class-ccf-form-cpt.php:
|
291 |
#: ../classes/class-ccf-form-manager.php:88
|
292 |
msgid "New Form"
|
293 |
msgstr ""
|
294 |
|
295 |
-
#: ../classes/class-ccf-form-cpt.php:
|
296 |
msgid "Add New Form"
|
297 |
msgstr ""
|
298 |
|
299 |
-
#: ../classes/class-ccf-form-cpt.php:
|
300 |
msgid "Edit Form"
|
301 |
msgstr ""
|
302 |
|
303 |
-
#: ../classes/class-ccf-form-cpt.php:
|
304 |
msgid "View Form"
|
305 |
msgstr ""
|
306 |
|
307 |
-
#: ../classes/class-ccf-form-cpt.php:
|
308 |
msgid "Search Forms"
|
309 |
msgstr ""
|
310 |
|
311 |
-
#: ../classes/class-ccf-form-cpt.php:
|
312 |
msgid "No forms found."
|
313 |
msgstr ""
|
314 |
|
315 |
-
#: ../classes/class-ccf-form-cpt.php:
|
316 |
msgid "No forms found in trash."
|
317 |
msgstr ""
|
318 |
|
@@ -435,33 +435,33 @@ msgstr ""
|
|
435 |
msgid "AM/PM is required."
|
436 |
msgstr ""
|
437 |
|
438 |
-
#: ../classes/class-ccf-form-handler.php:
|
439 |
msgid "Post created by form"
|
440 |
msgstr ""
|
441 |
|
442 |
-
#: ../classes/class-ccf-form-handler.php:
|
443 |
msgid "*Hidden Field*"
|
444 |
msgstr ""
|
445 |
|
446 |
-
#: ../classes/class-ccf-form-handler.php:
|
447 |
msgid "Form submitted from"
|
448 |
msgstr ""
|
449 |
|
450 |
-
#: ../classes/class-ccf-form-handler.php:
|
451 |
msgid "Form submitter IP"
|
452 |
msgstr ""
|
453 |
|
454 |
-
#: ../classes/class-ccf-form-handler.php:
|
455 |
#, php-format
|
456 |
msgid "%s: Form Submission"
|
457 |
msgstr ""
|
458 |
|
459 |
-
#: ../classes/class-ccf-form-handler.php:
|
460 |
#, php-format
|
461 |
msgid " to \"%s\""
|
462 |
msgstr ""
|
463 |
|
464 |
-
#: ../classes/class-ccf-form-handler.php:
|
465 |
#: ../classes/class-ccf-form-renderer.php:188
|
466 |
msgid "Thank you for your submission."
|
467 |
msgstr ""
|
@@ -528,7 +528,7 @@ msgid "← Drag fields from the left here."
|
|
528 |
msgstr ""
|
529 |
|
530 |
#: ../classes/class-ccf-form-manager.php:152
|
531 |
-
#: ../classes/class-ccf-form-manager.php:
|
532 |
msgid "Insert into post"
|
533 |
msgstr ""
|
534 |
|
@@ -549,7 +549,7 @@ msgid "(Untitled)"
|
|
549 |
msgstr ""
|
550 |
|
551 |
#: ../classes/class-ccf-form-manager.php:172
|
552 |
-
#: ../classes/class-ccf-form-manager.php:
|
553 |
msgid "Edit"
|
554 |
msgstr ""
|
555 |
|
@@ -558,7 +558,7 @@ msgid "Delete"
|
|
558 |
msgstr ""
|
559 |
|
560 |
#: ../classes/class-ccf-form-manager.php:179
|
561 |
-
#: ../classes/class-ccf-form-manager.php:
|
562 |
msgid "Form Submission"
|
563 |
msgstr ""
|
564 |
|
@@ -609,19 +609,35 @@ msgstr ""
|
|
609 |
#: ../classes/class-ccf-form-manager.php:386
|
610 |
#: ../classes/class-ccf-form-manager.php:434
|
611 |
#: ../classes/class-ccf-form-manager.php:562
|
612 |
-
#: ../classes/class-ccf-form-manager.php:
|
613 |
-
#: ../classes/class-ccf-form-manager.php:
|
614 |
-
#: ../classes/class-ccf-form-manager.php:
|
615 |
-
#: ../classes/class-ccf-form-manager.php:
|
616 |
-
#: ../classes/class-ccf-form-manager.php:
|
617 |
-
#: ../classes/class-ccf-form-manager.php:
|
618 |
-
#: ../classes/class-ccf-form-manager.php:
|
619 |
-
#: ../classes/class-ccf-form-manager.php:
|
620 |
-
#: ../classes/class-ccf-form-manager.php:
|
621 |
-
#: ../classes/class-ccf-form-manager.php:
|
622 |
-
#: ../classes/class-ccf-form-manager.php:
|
623 |
-
#: ../classes/class-ccf-form-manager.php:
|
624 |
-
#: ../classes/class-ccf-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
625 |
msgid "No"
|
626 |
msgstr ""
|
627 |
|
@@ -629,19 +645,35 @@ msgstr ""
|
|
629 |
#: ../classes/class-ccf-form-manager.php:387
|
630 |
#: ../classes/class-ccf-form-manager.php:435
|
631 |
#: ../classes/class-ccf-form-manager.php:561
|
632 |
-
#: ../classes/class-ccf-form-manager.php:
|
633 |
-
#: ../classes/class-ccf-form-manager.php:
|
634 |
-
#: ../classes/class-ccf-form-manager.php:
|
635 |
-
#: ../classes/class-ccf-form-manager.php:
|
636 |
-
#: ../classes/class-ccf-form-manager.php:
|
637 |
-
#: ../classes/class-ccf-form-manager.php:
|
638 |
-
#: ../classes/class-ccf-form-manager.php:
|
639 |
-
#: ../classes/class-ccf-form-manager.php:
|
640 |
-
#: ../classes/class-ccf-form-manager.php:
|
641 |
-
#: ../classes/class-ccf-form-manager.php:
|
642 |
-
#: ../classes/class-ccf-form-manager.php:
|
643 |
-
#: ../classes/class-ccf-form-manager.php:
|
644 |
-
#: ../classes/class-ccf-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
645 |
msgid "Yes"
|
646 |
msgstr ""
|
647 |
|
@@ -882,121 +914,254 @@ msgid "<span>←</span> Click on a field to edit it."
|
|
882 |
msgstr ""
|
883 |
|
884 |
#: ../classes/class-ccf-form-manager.php:543
|
885 |
-
#: ../classes/class-ccf-form-manager.php:
|
886 |
-
#: ../classes/class-ccf-form-manager.php:
|
887 |
-
#: ../classes/class-ccf-form-manager.php:
|
888 |
msgid "Internal Unique Slug"
|
889 |
msgstr ""
|
890 |
|
891 |
#: ../classes/class-ccf-form-manager.php:547
|
892 |
-
#: ../classes/class-ccf-form-manager.php:
|
893 |
-
#: ../classes/class-ccf-form-manager.php:
|
894 |
-
#: ../classes/class-ccf-form-manager.php:
|
895 |
-
#: ../classes/class-ccf-form-manager.php:
|
896 |
-
#: ../classes/class-ccf-form-manager.php:
|
897 |
-
#: ../classes/class-ccf-form-manager.php:
|
898 |
-
#: ../classes/class-ccf-form-manager.php:
|
899 |
-
#: ../classes/class-ccf-form-manager.php:
|
900 |
-
#: ../classes/class-ccf-form-manager.php:
|
901 |
-
#: ../classes/class-ccf-form-manager.php:
|
902 |
-
#: ../classes/class-ccf-form-manager.php:
|
903 |
-
#: ../classes/class-ccf-form-manager.php:
|
904 |
msgid "Label:"
|
905 |
msgstr ""
|
906 |
|
907 |
#: ../classes/class-ccf-form-manager.php:551
|
908 |
-
#: ../classes/class-ccf-form-manager.php:
|
909 |
-
#: ../classes/class-ccf-form-manager.php:
|
910 |
-
#: ../classes/class-ccf-form-manager.php:
|
911 |
-
#: ../classes/class-ccf-form-manager.php:
|
912 |
-
#: ../classes/class-ccf-form-manager.php:
|
913 |
-
#: ../classes/class-ccf-form-manager.php:
|
914 |
-
#: ../classes/class-ccf-form-manager.php:
|
915 |
-
#: ../classes/class-ccf-form-manager.php:
|
916 |
-
#: ../classes/class-ccf-form-manager.php:
|
917 |
-
#: ../classes/class-ccf-form-manager.php:
|
918 |
-
#: ../classes/class-ccf-form-manager.php:
|
919 |
-
#: ../classes/class-ccf-form-manager.php:
|
920 |
msgid "Description:"
|
921 |
msgstr ""
|
922 |
|
923 |
#: ../classes/class-ccf-form-manager.php:555
|
924 |
-
#: ../classes/class-ccf-form-manager.php:
|
925 |
-
#: ../classes/class-ccf-form-manager.php:
|
926 |
-
#: ../classes/class-ccf-form-manager.php:
|
927 |
-
#: ../classes/class-ccf-form-manager.php:
|
928 |
-
#: ../classes/class-ccf-form-manager.php:
|
929 |
-
#: ../classes/class-ccf-form-manager.php:
|
930 |
msgid "Initial Value:"
|
931 |
msgstr ""
|
932 |
|
933 |
#: ../classes/class-ccf-form-manager.php:559
|
934 |
-
#: ../classes/class-ccf-form-manager.php:
|
935 |
-
#: ../classes/class-ccf-form-manager.php:
|
936 |
-
#: ../classes/class-ccf-form-manager.php:
|
937 |
-
#: ../classes/class-ccf-form-manager.php:
|
938 |
-
#: ../classes/class-ccf-form-manager.php:
|
939 |
-
#: ../classes/class-ccf-form-manager.php:
|
940 |
-
#: ../classes/class-ccf-form-manager.php:
|
941 |
-
#: ../classes/class-ccf-form-manager.php:
|
942 |
-
#: ../classes/class-ccf-form-manager.php:
|
943 |
-
#: ../classes/class-ccf-form-manager.php:
|
944 |
-
#: ../classes/class-ccf-form-manager.php:
|
945 |
msgid "Required:"
|
946 |
msgstr ""
|
947 |
|
948 |
#: ../classes/class-ccf-form-manager.php:568
|
949 |
-
#: ../classes/class-ccf-form-manager.php:
|
950 |
-
#: ../classes/class-ccf-form-manager.php:
|
951 |
-
#: ../classes/class-ccf-form-manager.php:
|
952 |
-
#: ../classes/class-ccf-form-manager.php:
|
953 |
-
#: ../classes/class-ccf-form-manager.php:
|
954 |
-
#: ../classes/class-ccf-form-manager.php:
|
955 |
-
#: ../classes/class-ccf-form-manager.php:
|
956 |
-
#: ../classes/class-ccf-form-manager.php:
|
957 |
-
#: ../classes/class-ccf-form-manager.php:
|
958 |
-
#: ../classes/class-ccf-form-manager.php:961
|
959 |
-
#: ../classes/class-ccf-form-manager.php:1008
|
960 |
-
#: ../classes/class-ccf-form-manager.php:1057
|
961 |
-
#: ../classes/class-ccf-form-manager.php:1115
|
962 |
-
#: ../classes/class-ccf-form-manager.php:1158
|
963 |
#: ../classes/class-ccf-form-manager.php:1201
|
|
|
|
|
|
|
|
|
|
|
964 |
msgid "Advanced"
|
965 |
msgstr ""
|
966 |
|
967 |
#: ../classes/class-ccf-form-manager.php:571
|
968 |
-
#: ../classes/class-ccf-form-manager.php:
|
969 |
-
#: ../classes/class-ccf-form-manager.php:
|
970 |
-
#: ../classes/class-ccf-form-manager.php:
|
971 |
-
#: ../classes/class-ccf-form-manager.php:
|
972 |
-
#: ../classes/class-ccf-form-manager.php:
|
973 |
-
#: ../classes/class-ccf-form-manager.php:
|
974 |
-
#: ../classes/class-ccf-form-manager.php:
|
975 |
-
#: ../classes/class-ccf-form-manager.php:
|
976 |
-
#: ../classes/class-ccf-form-manager.php:
|
977 |
-
#: ../classes/class-ccf-form-manager.php:964
|
978 |
-
#: ../classes/class-ccf-form-manager.php:1011
|
979 |
-
#: ../classes/class-ccf-form-manager.php:1060
|
980 |
-
#: ../classes/class-ccf-form-manager.php:1118
|
981 |
-
#: ../classes/class-ccf-form-manager.php:1161
|
982 |
#: ../classes/class-ccf-form-manager.php:1204
|
|
|
|
|
|
|
|
|
|
|
983 |
msgid "Class Name:"
|
984 |
msgstr ""
|
985 |
|
986 |
#: ../classes/class-ccf-form-manager.php:575
|
987 |
-
#: ../classes/class-ccf-form-manager.php:
|
988 |
-
#: ../classes/class-ccf-form-manager.php:
|
989 |
-
#: ../classes/class-ccf-form-manager.php:
|
990 |
-
#: ../classes/class-ccf-form-manager.php:
|
991 |
-
#: ../classes/class-ccf-form-manager.php:
|
992 |
msgid "Placeholder Text:"
|
993 |
msgstr ""
|
994 |
|
995 |
-
#: ../classes/class-ccf-form-manager.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
996 |
msgid "Allowed File Extensions (comma separate):"
|
997 |
msgstr ""
|
998 |
|
999 |
-
#: ../classes/class-ccf-form-manager.php:
|
1000 |
msgid ""
|
1001 |
"If left blank, will default to all extensions registered by WordPress. If "
|
1002 |
"you use a file extension or mime type not <a href=\"http://codex.wordpress."
|
@@ -1004,298 +1169,322 @@ msgid ""
|
|
1004 |
"a>, you will need to filter and manually whitelist the new extension."
|
1005 |
msgstr ""
|
1006 |
|
1007 |
-
#: ../classes/class-ccf-form-manager.php:
|
1008 |
msgid "Max File Size (in MB):"
|
1009 |
msgstr ""
|
1010 |
|
1011 |
-
#: ../classes/class-ccf-form-manager.php:
|
1012 |
#, php-format
|
1013 |
msgid ""
|
1014 |
"If left blank, will default to %d MB. Maximum allowed by server is %d MB."
|
1015 |
msgstr ""
|
1016 |
|
1017 |
-
#: ../classes/class-ccf-form-manager.php:
|
1018 |
msgid ""
|
1019 |
"reCAPTCHA is a simple captcha service provided by Google. <a target=\"_blank"
|
1020 |
"\" href=\"https://www.google.com/recaptcha/intro/index.html\">Learn more</a>"
|
1021 |
msgstr ""
|
1022 |
|
1023 |
-
#: ../classes/class-ccf-form-manager.php:
|
1024 |
msgid "Site Key:"
|
1025 |
msgstr ""
|
1026 |
|
1027 |
-
#: ../classes/class-ccf-form-manager.php:
|
1028 |
-
#: ../classes/class-ccf-form-manager.php:
|
1029 |
msgid "Don't have one?"
|
1030 |
msgstr ""
|
1031 |
|
1032 |
-
#: ../classes/class-ccf-form-manager.php:
|
1033 |
msgid "Secret Key:"
|
1034 |
msgstr ""
|
1035 |
|
1036 |
-
#: ../classes/class-ccf-form-manager.php:
|
1037 |
-
#: ../classes/class-ccf-form-manager.php:
|
1038 |
-
#: ../classes/class-ccf-form-manager.php:
|
1039 |
-
#: ../classes/class-ccf-form-manager.php:
|
1040 |
-
#: ../classes/class-ccf-form-manager.php:
|
1041 |
-
#: ../classes/class-ccf-form-manager.php:
|
1042 |
-
#: ../classes/class-ccf-form-manager.php:
|
1043 |
-
#: ../classes/class-ccf-form-manager.php:
|
1044 |
-
#: ../classes/class-ccf-form-manager.php:
|
1045 |
-
#: ../classes/class-ccf-form-manager.php:
|
1046 |
-
#: ../classes/class-ccf-form-manager.php:
|
1047 |
-
#: ../classes/class-ccf-form-manager.php:
|
1048 |
msgid "Basic"
|
1049 |
msgstr ""
|
1050 |
|
1051 |
-
#: ../classes/class-ccf-form-manager.php:
|
1052 |
msgid "HTML Content:"
|
1053 |
msgstr ""
|
1054 |
|
1055 |
-
#: ../classes/class-ccf-form-manager.php:
|
1056 |
msgid "Heading:"
|
1057 |
msgstr ""
|
1058 |
|
1059 |
-
#: ../classes/class-ccf-form-manager.php:
|
1060 |
msgid "Sub Heading:"
|
1061 |
msgstr ""
|
1062 |
|
1063 |
-
#: ../classes/class-ccf-form-manager.php:
|
1064 |
-
#: ../classes/class-ccf-form-manager.php:
|
1065 |
-
#: ../classes/class-ccf-form-manager.php:
|
1066 |
-
#: ../classes/class-ccf-form-manager.php:
|
1067 |
-
#: ../classes/class-ccf-form-manager.php:
|
1068 |
-
#: ../classes/class-ccf-form-manager.php:
|
1069 |
-
#: ../classes/class-ccf-form-manager.php:
|
1070 |
-
#: ../classes/class-ccf-form-manager.php:
|
1071 |
-
#: ../classes/class-ccf-form-manager.php:
|
1072 |
msgid "Internal Unique Slug (a-z, 0-9, -, _):"
|
1073 |
msgstr ""
|
1074 |
|
1075 |
-
#: ../classes/class-ccf-form-manager.php:
|
1076 |
msgid "Enable Date Select"
|
1077 |
msgstr ""
|
1078 |
|
1079 |
-
#: ../classes/class-ccf-form-manager.php:
|
1080 |
msgid "Enable Time Select"
|
1081 |
msgstr ""
|
1082 |
|
1083 |
-
#: ../classes/class-ccf-form-manager.php:
|
1084 |
msgid "Date Format:"
|
1085 |
msgstr ""
|
1086 |
|
1087 |
-
#: ../classes/class-ccf-form-manager.php:
|
1088 |
msgid "Format:"
|
1089 |
msgstr ""
|
1090 |
|
1091 |
-
#: ../classes/class-ccf-form-manager.php:
|
1092 |
-
#: ../classes/class-ccf-form-manager.php:
|
1093 |
msgid "International"
|
1094 |
msgstr ""
|
1095 |
|
1096 |
-
#: ../classes/class-ccf-form-manager.php:
|
1097 |
msgid "Type:"
|
1098 |
msgstr ""
|
1099 |
|
1100 |
-
#: ../classes/class-ccf-form-manager.php:
|
1101 |
msgid "United States"
|
1102 |
msgstr ""
|
1103 |
|
1104 |
-
#: ../classes/class-ccf-form-manager.php:
|
1105 |
msgid "Require Confirmation:"
|
1106 |
msgstr ""
|
1107 |
|
1108 |
-
#: ../classes/class-ccf-form-manager.php:
|
1109 |
msgid "Label"
|
1110 |
msgstr ""
|
1111 |
|
1112 |
-
#: ../classes/class-ccf-form-manager.php:
|
1113 |
msgid "Value"
|
1114 |
msgstr ""
|
1115 |
|
1116 |
-
#: ../classes/class-ccf-form-manager.php:
|
1117 |
-
|
1118 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1119 |
msgid "Manage field choices:"
|
1120 |
msgstr ""
|
1121 |
|
1122 |
-
#: ../classes/class-ccf-form-manager.php:
|
1123 |
-
#: ../classes/class-ccf-form-manager.php:
|
1124 |
-
#: ../classes/class-ccf-form-manager.php:
|
1125 |
msgid ""
|
1126 |
"Note: If an option does not have a \"value\", it will not be considered a "
|
1127 |
"valid selection if the field is required. The \"value\" is what's read, "
|
1128 |
"stored, and displayed in the submission."
|
1129 |
msgstr ""
|
1130 |
|
1131 |
-
#: ../classes/class-ccf-form-manager.php:
|
1132 |
msgid "You currently have no forms. Add some!"
|
1133 |
msgstr ""
|
1134 |
|
1135 |
-
#: ../classes/class-ccf-form-manager.php:
|
1136 |
msgid "Allowed file extensions are {{ extensions }}. "
|
1137 |
msgstr ""
|
1138 |
|
1139 |
-
#: ../classes/class-ccf-form-manager.php:
|
1140 |
msgid "Max file size is {{ file_size }} MB. "
|
1141 |
msgstr ""
|
1142 |
|
1143 |
-
#: ../classes/class-ccf-form-manager.php:
|
1144 |
-
#: ../classes/class-ccf-form-manager.php:
|
1145 |
-
#: ../classes/class-ccf-form-manager.php:
|
1146 |
msgid "An example choice"
|
1147 |
msgstr ""
|
1148 |
|
1149 |
-
#: ../classes/class-ccf-form-manager.php:
|
1150 |
msgid "Arbitrary block of HTML."
|
1151 |
msgstr ""
|
1152 |
|
1153 |
-
#: ../classes/class-ccf-form-manager.php:
|
1154 |
msgid "Section Heading"
|
1155 |
msgstr ""
|
1156 |
|
1157 |
-
#: ../classes/class-ccf-form-manager.php:
|
1158 |
msgid "This is the sub-heading text."
|
1159 |
msgstr ""
|
1160 |
|
1161 |
-
#: ../classes/class-ccf-form-manager.php:
|
1162 |
msgid "Trash"
|
1163 |
msgstr ""
|
1164 |
|
1165 |
-
#: ../classes/class-ccf-form-manager.php:
|
1166 |
msgid "There is a problem with this form. Is it trashed or deleted?"
|
1167 |
msgstr ""
|
1168 |
|
1169 |
-
#: ../classes/class-ccf-form-manager.php:
|
1170 |
msgid "IP Address"
|
1171 |
msgstr ""
|
1172 |
|
1173 |
-
#: ../classes/class-ccf-form-manager.php:
|
1174 |
msgid "There are no submissions."
|
1175 |
msgstr ""
|
1176 |
|
1177 |
-
#: ../classes/class-ccf-form-manager.php:
|
1178 |
msgid "Add Form"
|
1179 |
msgstr ""
|
1180 |
|
1181 |
-
#: ../classes/class-ccf-form-manager.php:
|
1182 |
msgid "Single Line Text"
|
1183 |
msgstr ""
|
1184 |
|
1185 |
-
#: ../classes/class-ccf-form-manager.php:
|
1186 |
msgid "Dropdown"
|
1187 |
msgstr ""
|
1188 |
|
1189 |
-
#: ../classes/class-ccf-form-manager.php:
|
1190 |
msgid "Checkboxes"
|
1191 |
msgstr ""
|
1192 |
|
1193 |
-
#: ../classes/class-ccf-form-manager.php:
|
1194 |
msgid "Radio Buttons"
|
1195 |
msgstr ""
|
1196 |
|
1197 |
-
#: ../classes/class-ccf-form-manager.php:
|
1198 |
msgid "Paragraph Text"
|
1199 |
msgstr ""
|
1200 |
|
1201 |
-
#: ../classes/class-ccf-form-manager.php:
|
1202 |
msgid "Hidden"
|
1203 |
msgstr ""
|
1204 |
|
1205 |
-
#: ../classes/class-ccf-form-manager.php:
|
1206 |
msgid "File Upload"
|
1207 |
msgstr ""
|
1208 |
|
1209 |
-
#: ../classes/class-ccf-form-manager.php:
|
1210 |
msgid "HTML"
|
1211 |
msgstr ""
|
1212 |
|
1213 |
-
#: ../classes/class-ccf-form-manager.php:
|
1214 |
-
msgid "Section
|
1215 |
msgstr ""
|
1216 |
|
1217 |
-
#: ../classes/class-ccf-form-manager.php:
|
1218 |
msgid "Name"
|
1219 |
msgstr ""
|
1220 |
|
1221 |
-
#: ../classes/class-ccf-form-manager.php:
|
1222 |
msgid "Date/Time"
|
1223 |
msgstr ""
|
1224 |
|
1225 |
-
#: ../classes/class-ccf-form-manager.php:
|
1226 |
msgid "Website"
|
1227 |
msgstr ""
|
1228 |
|
1229 |
-
#: ../classes/class-ccf-form-manager.php:
|
1230 |
msgid "Address"
|
1231 |
msgstr ""
|
1232 |
|
1233 |
-
#: ../classes/class-ccf-form-manager.php:
|
1234 |
msgid "Phone"
|
1235 |
msgstr ""
|
1236 |
|
1237 |
-
#: ../classes/class-ccf-form-manager.php:
|
1238 |
msgid "reCAPTCHA"
|
1239 |
msgstr ""
|
1240 |
|
1241 |
-
#: ../classes/class-ccf-form-manager.php:
|
1242 |
msgid "You have no email fields"
|
1243 |
msgstr ""
|
1244 |
|
1245 |
-
#: ../classes/class-ccf-form-manager.php:
|
1246 |
-
msgid "
|
1247 |
msgstr ""
|
1248 |
|
1249 |
-
#: ../classes/class-ccf-form-manager.php:
|
1250 |
msgid "You have no name fields"
|
1251 |
msgstr ""
|
1252 |
|
1253 |
-
#: ../classes/class-ccf-form-manager.php:
|
1254 |
msgid "You have no applicable fields"
|
1255 |
msgstr ""
|
1256 |
|
1257 |
-
#: ../classes/class-ccf-form-manager.php:
|
1258 |
msgid "Choose a Form Field"
|
1259 |
msgstr ""
|
1260 |
|
1261 |
-
#: ../classes/class-ccf-form-manager.php:
|
1262 |
msgid "Invalid date"
|
1263 |
msgstr ""
|
1264 |
|
1265 |
-
#: ../classes/class-ccf-form-manager.php:
|
1266 |
msgid "Field Label"
|
1267 |
msgstr ""
|
1268 |
|
1269 |
-
#: ../classes/class-ccf-form-manager.php:
|
1270 |
#: ../classes/class-ccf-form-renderer.php:174
|
1271 |
msgid "This form is paused right now. Check back later!"
|
1272 |
msgstr ""
|
1273 |
|
1274 |
-
#: ../classes/class-ccf-form-manager.php:
|
1275 |
msgid "Choose a Post Field"
|
1276 |
msgstr ""
|
1277 |
|
1278 |
-
#: ../classes/class-ccf-form-manager.php:
|
1279 |
msgid "Post Title"
|
1280 |
msgstr ""
|
1281 |
|
1282 |
-
#: ../classes/class-ccf-form-manager.php:
|
1283 |
msgid "Post Content"
|
1284 |
msgstr ""
|
1285 |
|
1286 |
-
#: ../classes/class-ccf-form-manager.php:
|
1287 |
msgid "Post Excerpt"
|
1288 |
msgstr ""
|
1289 |
|
1290 |
-
#: ../classes/class-ccf-form-manager.php:
|
1291 |
msgid "Post Date"
|
1292 |
msgstr ""
|
1293 |
|
1294 |
-
#: ../classes/class-ccf-form-manager.php:
|
1295 |
msgid "Post Tags"
|
1296 |
msgstr ""
|
1297 |
|
1298 |
-
#: ../classes/class-ccf-form-manager.php:
|
1299 |
msgid "Custom Field"
|
1300 |
msgstr ""
|
1301 |
|
@@ -1323,15 +1512,15 @@ msgstr ""
|
|
1323 |
msgid "An unknown error occured."
|
1324 |
msgstr ""
|
1325 |
|
1326 |
-
#: ../classes/class-ccf-settings.php:
|
1327 |
msgid "Enable Asset Loading Restrictions"
|
1328 |
msgstr ""
|
1329 |
|
1330 |
-
#: ../classes/class-ccf-settings.php:
|
1331 |
msgid "Restrict Asset Loading To"
|
1332 |
msgstr ""
|
1333 |
|
1334 |
-
#: ../classes/class-ccf-settings.php:
|
1335 |
msgid ""
|
1336 |
"By default, Custom Contact Forms loads all it's assets (JavaScript, CSS, "
|
1337 |
"etc.) on every page of your site. The reason for this is that there is no "
|
@@ -1341,19 +1530,19 @@ msgid ""
|
|
1341 |
"page of your site."
|
1342 |
msgstr ""
|
1343 |
|
1344 |
-
#: ../classes/class-ccf-settings.php:
|
1345 |
msgid "URL or post ID"
|
1346 |
msgstr ""
|
1347 |
|
1348 |
-
#: ../classes/class-ccf-settings.php:
|
1349 |
msgid "Restriction type:"
|
1350 |
msgstr ""
|
1351 |
|
1352 |
-
#: ../classes/class-ccf-settings.php:
|
1353 |
msgid "URL"
|
1354 |
msgstr ""
|
1355 |
|
1356 |
-
#: ../classes/class-ccf-settings.php:
|
1357 |
msgid "Post ID"
|
1358 |
msgstr ""
|
1359 |
|
@@ -1396,15 +1585,15 @@ msgstr ""
|
|
1396 |
msgid "Custom Contact Form"
|
1397 |
msgstr ""
|
1398 |
|
1399 |
-
#: ../classes/class-ccf-widget.php:
|
1400 |
msgid "Title:"
|
1401 |
msgstr ""
|
1402 |
|
1403 |
-
#: ../classes/class-ccf-widget.php:
|
1404 |
msgid "Choose a form:"
|
1405 |
msgstr ""
|
1406 |
|
1407 |
-
#: ../classes/class-ccf-widget.php:
|
1408 |
msgid "Untitled"
|
1409 |
msgstr ""
|
1410 |
|
5 |
"Project-Id-Version: Custom Contact Forms\n"
|
6 |
"Report-Msgid-Bugs-To: https://github.com/tlovett1/custom-contact-forms/"
|
7 |
"issues\n"
|
8 |
+
"POT-Creation-Date: 2016-02-03 00:48-0500\n"
|
9 |
+
"PO-Revision-Date: 2016-02-03 00:49-0500\n"
|
10 |
"Last-Translator: Taylor Lovett <tlovett88@gmail.com>\n"
|
11 |
"Language-Team: \n"
|
12 |
"Language: en\n"
|
23 |
"X-Textdomain-Support: yes\n"
|
24 |
"X-Poedit-SearchPath-0: ..\n"
|
25 |
|
26 |
+
#: ../classes/class-ccf-api-form-controller.php:653
|
27 |
msgid "Form not found"
|
28 |
msgstr ""
|
29 |
|
30 |
+
#: ../classes/class-ccf-api-form-controller.php:679
|
31 |
msgid "Could not create form"
|
32 |
msgstr ""
|
33 |
|
34 |
+
#: ../classes/class-ccf-api-form-controller.php:709
|
35 |
msgid "Could not update form"
|
36 |
msgstr ""
|
37 |
|
38 |
+
#: ../classes/class-ccf-api-form-controller.php:737
|
39 |
msgid "Could not delete form"
|
40 |
msgstr ""
|
41 |
|
42 |
+
#: ../classes/class-ccf-api-form-controller.php:766
|
43 |
msgid "Could not delete submission"
|
44 |
msgstr ""
|
45 |
|
59 |
msgid "<a href=\"%s\">Forms and Submissions</a>"
|
60 |
msgstr ""
|
61 |
|
62 |
+
#: ../classes/class-ccf-export.php:58 ../classes/class-ccf-form-cpt.php:573
|
63 |
msgid "Forms and Submissions"
|
64 |
msgstr ""
|
65 |
|
71 |
msgid "Form Fields"
|
72 |
msgstr ""
|
73 |
|
74 |
+
#: ../classes/class-ccf-field-renderer.php:128
|
75 |
#, php-format
|
76 |
msgid "Allowed file extensions are %s. "
|
77 |
msgstr ""
|
78 |
|
79 |
+
#: ../classes/class-ccf-field-renderer.php:130
|
80 |
#, php-format
|
81 |
msgid "Max file size is %d MB. "
|
82 |
msgstr ""
|
83 |
|
84 |
+
#: ../classes/class-ccf-field-renderer.php:575
|
85 |
+
#: ../classes/class-ccf-form-manager.php:1797
|
86 |
+
#: ../classes/class-ccf-form-manager.php:1822
|
87 |
msgid "Street Address"
|
88 |
msgstr ""
|
89 |
|
90 |
+
#: ../classes/class-ccf-field-renderer.php:579
|
91 |
+
#: ../classes/class-ccf-form-manager.php:1801
|
92 |
+
#: ../classes/class-ccf-form-manager.php:1826
|
93 |
msgid "Address Line 2"
|
94 |
msgstr ""
|
95 |
|
96 |
+
#: ../classes/class-ccf-field-renderer.php:586
|
97 |
+
#: ../classes/class-ccf-form-manager.php:1805
|
98 |
+
#: ../classes/class-ccf-form-manager.php:1830
|
99 |
msgid "City"
|
100 |
msgstr ""
|
101 |
|
102 |
+
#: ../classes/class-ccf-field-renderer.php:599
|
103 |
+
#: ../classes/class-ccf-form-manager.php:1813
|
104 |
msgid "State"
|
105 |
msgstr ""
|
106 |
|
107 |
+
#: ../classes/class-ccf-field-renderer.php:607
|
108 |
+
#: ../classes/class-ccf-form-manager.php:1817
|
109 |
msgid "ZIP Code"
|
110 |
msgstr ""
|
111 |
|
112 |
+
#: ../classes/class-ccf-field-renderer.php:617
|
113 |
+
#: ../classes/class-ccf-form-manager.php:1834
|
114 |
msgid "State / Region / Province"
|
115 |
msgstr ""
|
116 |
|
117 |
+
#: ../classes/class-ccf-field-renderer.php:625
|
118 |
+
#: ../classes/class-ccf-form-manager.php:1838
|
119 |
msgid "ZIP / Postal Code"
|
120 |
msgstr ""
|
121 |
|
122 |
+
#: ../classes/class-ccf-field-renderer.php:637
|
123 |
+
#: ../classes/class-ccf-form-manager.php:1846
|
124 |
msgid "Country"
|
125 |
msgstr ""
|
126 |
|
127 |
+
#: ../classes/class-ccf-field-renderer.php:815
|
128 |
+
#: ../classes/class-ccf-form-manager.php:1857
|
129 |
msgid "email@example.com"
|
130 |
msgstr ""
|
131 |
|
132 |
+
#: ../classes/class-ccf-field-renderer.php:827
|
133 |
#: ../classes/class-ccf-form-manager.php:327
|
134 |
+
#: ../classes/class-ccf-form-manager.php:1861
|
135 |
+
#: ../classes/class-ccf-form-manager.php:2166
|
136 |
msgid "Email"
|
137 |
msgstr ""
|
138 |
|
139 |
+
#: ../classes/class-ccf-field-renderer.php:834
|
140 |
+
#: ../classes/class-ccf-form-manager.php:1865
|
141 |
msgid "Confirm Email"
|
142 |
msgstr ""
|
143 |
|
144 |
+
#: ../classes/class-ccf-field-renderer.php:900
|
145 |
+
#: ../classes/class-ccf-form-manager.php:1733
|
146 |
msgid "First"
|
147 |
msgstr ""
|
148 |
|
149 |
+
#: ../classes/class-ccf-field-renderer.php:907
|
150 |
+
#: ../classes/class-ccf-form-manager.php:1737
|
151 |
msgid "Last"
|
152 |
msgstr ""
|
153 |
|
154 |
+
#: ../classes/class-ccf-field-renderer.php:981
|
155 |
+
#: ../classes/class-ccf-field-renderer.php:1002
|
156 |
+
#: ../classes/class-ccf-form-manager.php:1752
|
157 |
+
#: ../classes/class-ccf-form-manager.php:1773
|
158 |
msgid "HH"
|
159 |
msgstr ""
|
160 |
|
161 |
+
#: ../classes/class-ccf-field-renderer.php:985
|
162 |
+
#: ../classes/class-ccf-field-renderer.php:1006
|
163 |
+
#: ../classes/class-ccf-form-manager.php:1756
|
164 |
+
#: ../classes/class-ccf-form-manager.php:1777
|
165 |
msgid "MM"
|
166 |
msgstr ""
|
167 |
|
168 |
+
#: ../classes/class-ccf-field-renderer.php:989
|
169 |
+
#: ../classes/class-ccf-field-renderer.php:1010
|
170 |
+
#: ../classes/class-ccf-form-manager.php:1760
|
171 |
+
#: ../classes/class-ccf-form-manager.php:1781
|
172 |
msgid "AM"
|
173 |
msgstr ""
|
174 |
|
175 |
+
#: ../classes/class-ccf-field-renderer.php:990
|
176 |
+
#: ../classes/class-ccf-field-renderer.php:1011
|
177 |
+
#: ../classes/class-ccf-form-manager.php:1761
|
178 |
+
#: ../classes/class-ccf-form-manager.php:1782
|
179 |
msgid "PM"
|
180 |
msgstr ""
|
181 |
|
182 |
+
#: ../classes/class-ccf-field-renderer.php:997
|
183 |
+
#: ../classes/class-ccf-form-cpt.php:508
|
184 |
#: ../classes/class-ccf-form-manager.php:508
|
185 |
#: ../classes/class-ccf-form-manager.php:521
|
186 |
+
#: ../classes/class-ccf-form-manager.php:1768
|
187 |
+
#: ../classes/class-ccf-form-manager.php:1951
|
188 |
+
#: ../classes/class-ccf-form-manager.php:1965
|
189 |
+
#: ../classes/class-ccf-form-manager.php:2108
|
190 |
msgid "Date"
|
191 |
msgstr ""
|
192 |
|
193 |
+
#: ../classes/class-ccf-form-cpt.php:275
|
194 |
msgid "Form Submission Columns"
|
195 |
msgstr ""
|
196 |
|
197 |
+
#: ../classes/class-ccf-form-cpt.php:324 ../classes/class-ccf-form-cpt.php:342
|
198 |
+
#: ../classes/class-ccf-form-cpt.php:506
|
199 |
#: ../classes/class-ccf-form-manager.php:511
|
200 |
#: ../classes/class-ccf-form-manager.php:524
|
201 |
msgid "Submissions"
|
202 |
msgstr ""
|
203 |
|
204 |
+
#: ../classes/class-ccf-form-cpt.php:338
|
205 |
msgid "At a Glance"
|
206 |
msgstr ""
|
207 |
|
208 |
+
#: ../classes/class-ccf-form-cpt.php:339
|
209 |
msgid "Preview"
|
210 |
msgstr ""
|
211 |
|
212 |
+
#: ../classes/class-ccf-form-cpt.php:359
|
213 |
msgid "Save your new form to see a preview."
|
214 |
msgstr ""
|
215 |
|
216 |
+
#: ../classes/class-ccf-form-cpt.php:396
|
217 |
msgid "Created on:"
|
218 |
msgstr ""
|
219 |
|
220 |
+
#: ../classes/class-ccf-form-cpt.php:399
|
221 |
msgid "Author:"
|
222 |
msgstr ""
|
223 |
|
224 |
+
#: ../classes/class-ccf-form-cpt.php:402
|
225 |
msgid "Number of fields:"
|
226 |
msgstr ""
|
227 |
|
228 |
+
#: ../classes/class-ccf-form-cpt.php:405
|
229 |
msgid "Number of submissions:"
|
230 |
msgstr ""
|
231 |
|
232 |
+
#: ../classes/class-ccf-form-cpt.php:411
|
233 |
msgid "Move to Trash"
|
234 |
msgstr ""
|
235 |
|
236 |
+
#: ../classes/class-ccf-form-cpt.php:415
|
237 |
msgid "Export"
|
238 |
msgstr ""
|
239 |
|
240 |
+
#: ../classes/class-ccf-form-cpt.php:444
|
241 |
+
#: ../classes/class-ccf-form-manager.php:1893
|
242 |
msgid "(No title)"
|
243 |
msgstr ""
|
244 |
|
245 |
+
#: ../classes/class-ccf-form-cpt.php:449
|
246 |
msgid "Manage Form"
|
247 |
msgstr ""
|
248 |
|
249 |
+
#: ../classes/class-ccf-form-cpt.php:504
|
250 |
msgid "Form Title"
|
251 |
msgstr ""
|
252 |
|
253 |
+
#: ../classes/class-ccf-form-cpt.php:505
|
254 |
#: ../classes/class-ccf-form-manager.php:509
|
255 |
#: ../classes/class-ccf-form-manager.php:522
|
256 |
msgid "Author"
|
257 |
msgstr ""
|
258 |
|
259 |
+
#: ../classes/class-ccf-form-cpt.php:507
|
260 |
#: ../classes/class-ccf-form-manager.php:510
|
261 |
#: ../classes/class-ccf-form-manager.php:523
|
262 |
msgid "Number of Fields"
|
263 |
msgstr ""
|
264 |
|
265 |
+
#: ../classes/class-ccf-form-cpt.php:541
|
266 |
msgid "Unpublished"
|
267 |
msgstr ""
|
268 |
|
269 |
+
#: ../classes/class-ccf-form-cpt.php:543
|
270 |
msgid "Y/m/d g:i:s A"
|
271 |
msgstr ""
|
272 |
|
273 |
+
#: ../classes/class-ccf-form-cpt.php:550
|
274 |
#, php-format
|
275 |
msgid "%s ago"
|
276 |
msgstr ""
|
277 |
|
278 |
+
#: ../classes/class-ccf-form-cpt.php:551
|
279 |
msgid "Y/m/d"
|
280 |
msgstr ""
|
281 |
|
282 |
+
#: ../classes/class-ccf-form-cpt.php:567 ../classes/class-ccf-form-cpt.php:579
|
283 |
msgid "Forms"
|
284 |
msgstr ""
|
285 |
|
286 |
+
#: ../classes/class-ccf-form-cpt.php:568
|
287 |
msgid "Form"
|
288 |
msgstr ""
|
289 |
|
290 |
+
#: ../classes/class-ccf-form-cpt.php:569 ../classes/class-ccf-form-cpt.php:572
|
291 |
#: ../classes/class-ccf-form-manager.php:88
|
292 |
msgid "New Form"
|
293 |
msgstr ""
|
294 |
|
295 |
+
#: ../classes/class-ccf-form-cpt.php:570
|
296 |
msgid "Add New Form"
|
297 |
msgstr ""
|
298 |
|
299 |
+
#: ../classes/class-ccf-form-cpt.php:571
|
300 |
msgid "Edit Form"
|
301 |
msgstr ""
|
302 |
|
303 |
+
#: ../classes/class-ccf-form-cpt.php:574
|
304 |
msgid "View Form"
|
305 |
msgstr ""
|
306 |
|
307 |
+
#: ../classes/class-ccf-form-cpt.php:575
|
308 |
msgid "Search Forms"
|
309 |
msgstr ""
|
310 |
|
311 |
+
#: ../classes/class-ccf-form-cpt.php:576
|
312 |
msgid "No forms found."
|
313 |
msgstr ""
|
314 |
|
315 |
+
#: ../classes/class-ccf-form-cpt.php:577
|
316 |
msgid "No forms found in trash."
|
317 |
msgstr ""
|
318 |
|
435 |
msgid "AM/PM is required."
|
436 |
msgstr ""
|
437 |
|
438 |
+
#: ../classes/class-ccf-form-handler.php:763
|
439 |
msgid "Post created by form"
|
440 |
msgstr ""
|
441 |
|
442 |
+
#: ../classes/class-ccf-form-handler.php:814
|
443 |
msgid "*Hidden Field*"
|
444 |
msgstr ""
|
445 |
|
446 |
+
#: ../classes/class-ccf-form-handler.php:886
|
447 |
msgid "Form submitted from"
|
448 |
msgstr ""
|
449 |
|
450 |
+
#: ../classes/class-ccf-form-handler.php:895
|
451 |
msgid "Form submitter IP"
|
452 |
msgstr ""
|
453 |
|
454 |
+
#: ../classes/class-ccf-form-handler.php:980
|
455 |
#, php-format
|
456 |
msgid "%s: Form Submission"
|
457 |
msgstr ""
|
458 |
|
459 |
+
#: ../classes/class-ccf-form-handler.php:982
|
460 |
#, php-format
|
461 |
msgid " to \"%s\""
|
462 |
msgstr ""
|
463 |
|
464 |
+
#: ../classes/class-ccf-form-handler.php:1040
|
465 |
#: ../classes/class-ccf-form-renderer.php:188
|
466 |
msgid "Thank you for your submission."
|
467 |
msgstr ""
|
528 |
msgstr ""
|
529 |
|
530 |
#: ../classes/class-ccf-form-manager.php:152
|
531 |
+
#: ../classes/class-ccf-form-manager.php:1896
|
532 |
msgid "Insert into post"
|
533 |
msgstr ""
|
534 |
|
549 |
msgstr ""
|
550 |
|
551 |
#: ../classes/class-ccf-form-manager.php:172
|
552 |
+
#: ../classes/class-ccf-form-manager.php:1895
|
553 |
msgid "Edit"
|
554 |
msgstr ""
|
555 |
|
558 |
msgstr ""
|
559 |
|
560 |
#: ../classes/class-ccf-form-manager.php:179
|
561 |
+
#: ../classes/class-ccf-form-manager.php:2213
|
562 |
msgid "Form Submission"
|
563 |
msgstr ""
|
564 |
|
609 |
#: ../classes/class-ccf-form-manager.php:386
|
610 |
#: ../classes/class-ccf-form-manager.php:434
|
611 |
#: ../classes/class-ccf-form-manager.php:562
|
612 |
+
#: ../classes/class-ccf-form-manager.php:581
|
613 |
+
#: ../classes/class-ccf-form-manager.php:636
|
614 |
+
#: ../classes/class-ccf-form-manager.php:651
|
615 |
+
#: ../classes/class-ccf-form-manager.php:711
|
616 |
+
#: ../classes/class-ccf-form-manager.php:760
|
617 |
+
#: ../classes/class-ccf-form-manager.php:779
|
618 |
+
#: ../classes/class-ccf-form-manager.php:824
|
619 |
+
#: ../classes/class-ccf-form-manager.php:873
|
620 |
+
#: ../classes/class-ccf-form-manager.php:922
|
621 |
+
#: ../classes/class-ccf-form-manager.php:941
|
622 |
+
#: ../classes/class-ccf-form-manager.php:990
|
623 |
+
#: ../classes/class-ccf-form-manager.php:1035
|
624 |
+
#: ../classes/class-ccf-form-manager.php:1050
|
625 |
+
#: ../classes/class-ccf-form-manager.php:1101
|
626 |
+
#: ../classes/class-ccf-form-manager.php:1139
|
627 |
+
#: ../classes/class-ccf-form-manager.php:1195
|
628 |
+
#: ../classes/class-ccf-form-manager.php:1214
|
629 |
+
#: ../classes/class-ccf-form-manager.php:1266
|
630 |
+
#: ../classes/class-ccf-form-manager.php:1281
|
631 |
+
#: ../classes/class-ccf-form-manager.php:1332
|
632 |
+
#: ../classes/class-ccf-form-manager.php:1339
|
633 |
+
#: ../classes/class-ccf-form-manager.php:1360
|
634 |
+
#: ../classes/class-ccf-form-manager.php:1431
|
635 |
+
#: ../classes/class-ccf-form-manager.php:1453
|
636 |
+
#: ../classes/class-ccf-form-manager.php:1498
|
637 |
+
#: ../classes/class-ccf-form-manager.php:1520
|
638 |
+
#: ../classes/class-ccf-form-manager.php:1565
|
639 |
+
#: ../classes/class-ccf-form-manager.php:1587
|
640 |
+
#: ../classes/class-ccf-settings.php:103
|
641 |
msgid "No"
|
642 |
msgstr ""
|
643 |
|
645 |
#: ../classes/class-ccf-form-manager.php:387
|
646 |
#: ../classes/class-ccf-form-manager.php:435
|
647 |
#: ../classes/class-ccf-form-manager.php:561
|
648 |
+
#: ../classes/class-ccf-form-manager.php:582
|
649 |
+
#: ../classes/class-ccf-form-manager.php:635
|
650 |
+
#: ../classes/class-ccf-form-manager.php:652
|
651 |
+
#: ../classes/class-ccf-form-manager.php:712
|
652 |
+
#: ../classes/class-ccf-form-manager.php:759
|
653 |
+
#: ../classes/class-ccf-form-manager.php:780
|
654 |
+
#: ../classes/class-ccf-form-manager.php:825
|
655 |
+
#: ../classes/class-ccf-form-manager.php:874
|
656 |
+
#: ../classes/class-ccf-form-manager.php:921
|
657 |
+
#: ../classes/class-ccf-form-manager.php:942
|
658 |
+
#: ../classes/class-ccf-form-manager.php:991
|
659 |
+
#: ../classes/class-ccf-form-manager.php:1034
|
660 |
+
#: ../classes/class-ccf-form-manager.php:1051
|
661 |
+
#: ../classes/class-ccf-form-manager.php:1100
|
662 |
+
#: ../classes/class-ccf-form-manager.php:1140
|
663 |
+
#: ../classes/class-ccf-form-manager.php:1194
|
664 |
+
#: ../classes/class-ccf-form-manager.php:1215
|
665 |
+
#: ../classes/class-ccf-form-manager.php:1265
|
666 |
+
#: ../classes/class-ccf-form-manager.php:1282
|
667 |
+
#: ../classes/class-ccf-form-manager.php:1331
|
668 |
+
#: ../classes/class-ccf-form-manager.php:1338
|
669 |
+
#: ../classes/class-ccf-form-manager.php:1361
|
670 |
+
#: ../classes/class-ccf-form-manager.php:1430
|
671 |
+
#: ../classes/class-ccf-form-manager.php:1454
|
672 |
+
#: ../classes/class-ccf-form-manager.php:1497
|
673 |
+
#: ../classes/class-ccf-form-manager.php:1521
|
674 |
+
#: ../classes/class-ccf-form-manager.php:1564
|
675 |
+
#: ../classes/class-ccf-form-manager.php:1588
|
676 |
+
#: ../classes/class-ccf-settings.php:104
|
677 |
msgid "Yes"
|
678 |
msgstr ""
|
679 |
|
914 |
msgstr ""
|
915 |
|
916 |
#: ../classes/class-ccf-form-manager.php:543
|
917 |
+
#: ../classes/class-ccf-form-manager.php:611
|
918 |
+
#: ../classes/class-ccf-form-manager.php:741
|
919 |
+
#: ../classes/class-ccf-form-manager.php:903
|
920 |
msgid "Internal Unique Slug"
|
921 |
msgstr ""
|
922 |
|
923 |
#: ../classes/class-ccf-form-manager.php:547
|
924 |
+
#: ../classes/class-ccf-form-manager.php:615
|
925 |
+
#: ../classes/class-ccf-form-manager.php:682
|
926 |
+
#: ../classes/class-ccf-form-manager.php:745
|
927 |
+
#: ../classes/class-ccf-form-manager.php:907
|
928 |
+
#: ../classes/class-ccf-form-manager.php:1024
|
929 |
+
#: ../classes/class-ccf-form-manager.php:1084
|
930 |
+
#: ../classes/class-ccf-form-manager.php:1173
|
931 |
+
#: ../classes/class-ccf-form-manager.php:1248
|
932 |
+
#: ../classes/class-ccf-form-manager.php:1315
|
933 |
+
#: ../classes/class-ccf-form-manager.php:1420
|
934 |
+
#: ../classes/class-ccf-form-manager.php:1487
|
935 |
+
#: ../classes/class-ccf-form-manager.php:1554
|
936 |
msgid "Label:"
|
937 |
msgstr ""
|
938 |
|
939 |
#: ../classes/class-ccf-form-manager.php:551
|
940 |
+
#: ../classes/class-ccf-form-manager.php:619
|
941 |
+
#: ../classes/class-ccf-form-manager.php:686
|
942 |
+
#: ../classes/class-ccf-form-manager.php:749
|
943 |
+
#: ../classes/class-ccf-form-manager.php:911
|
944 |
+
#: ../classes/class-ccf-form-manager.php:1028
|
945 |
+
#: ../classes/class-ccf-form-manager.php:1088
|
946 |
+
#: ../classes/class-ccf-form-manager.php:1177
|
947 |
+
#: ../classes/class-ccf-form-manager.php:1252
|
948 |
+
#: ../classes/class-ccf-form-manager.php:1319
|
949 |
+
#: ../classes/class-ccf-form-manager.php:1424
|
950 |
+
#: ../classes/class-ccf-form-manager.php:1491
|
951 |
+
#: ../classes/class-ccf-form-manager.php:1558
|
952 |
msgid "Description:"
|
953 |
msgstr ""
|
954 |
|
955 |
#: ../classes/class-ccf-form-manager.php:555
|
956 |
+
#: ../classes/class-ccf-form-manager.php:753
|
957 |
+
#: ../classes/class-ccf-form-manager.php:915
|
958 |
+
#: ../classes/class-ccf-form-manager.php:975
|
959 |
+
#: ../classes/class-ccf-form-manager.php:1093
|
960 |
+
#: ../classes/class-ccf-form-manager.php:1181
|
961 |
+
#: ../classes/class-ccf-form-manager.php:1324
|
962 |
msgid "Initial Value:"
|
963 |
msgstr ""
|
964 |
|
965 |
#: ../classes/class-ccf-form-manager.php:559
|
966 |
+
#: ../classes/class-ccf-form-manager.php:633
|
967 |
+
#: ../classes/class-ccf-form-manager.php:757
|
968 |
+
#: ../classes/class-ccf-form-manager.php:919
|
969 |
+
#: ../classes/class-ccf-form-manager.php:1032
|
970 |
+
#: ../classes/class-ccf-form-manager.php:1098
|
971 |
+
#: ../classes/class-ccf-form-manager.php:1192
|
972 |
+
#: ../classes/class-ccf-form-manager.php:1263
|
973 |
+
#: ../classes/class-ccf-form-manager.php:1329
|
974 |
+
#: ../classes/class-ccf-form-manager.php:1428
|
975 |
+
#: ../classes/class-ccf-form-manager.php:1495
|
976 |
+
#: ../classes/class-ccf-form-manager.php:1562
|
977 |
msgid "Required:"
|
978 |
msgstr ""
|
979 |
|
980 |
#: ../classes/class-ccf-form-manager.php:568
|
981 |
+
#: ../classes/class-ccf-form-manager.php:642
|
982 |
+
#: ../classes/class-ccf-form-manager.php:702
|
983 |
+
#: ../classes/class-ccf-form-manager.php:766
|
984 |
+
#: ../classes/class-ccf-form-manager.php:815
|
985 |
+
#: ../classes/class-ccf-form-manager.php:864
|
986 |
+
#: ../classes/class-ccf-form-manager.php:928
|
987 |
+
#: ../classes/class-ccf-form-manager.php:981
|
988 |
+
#: ../classes/class-ccf-form-manager.php:1041
|
989 |
+
#: ../classes/class-ccf-form-manager.php:1124
|
|
|
|
|
|
|
|
|
|
|
990 |
#: ../classes/class-ccf-form-manager.php:1201
|
991 |
+
#: ../classes/class-ccf-form-manager.php:1272
|
992 |
+
#: ../classes/class-ccf-form-manager.php:1345
|
993 |
+
#: ../classes/class-ccf-form-manager.php:1444
|
994 |
+
#: ../classes/class-ccf-form-manager.php:1511
|
995 |
+
#: ../classes/class-ccf-form-manager.php:1578
|
996 |
msgid "Advanced"
|
997 |
msgstr ""
|
998 |
|
999 |
#: ../classes/class-ccf-form-manager.php:571
|
1000 |
+
#: ../classes/class-ccf-form-manager.php:645
|
1001 |
+
#: ../classes/class-ccf-form-manager.php:705
|
1002 |
+
#: ../classes/class-ccf-form-manager.php:769
|
1003 |
+
#: ../classes/class-ccf-form-manager.php:818
|
1004 |
+
#: ../classes/class-ccf-form-manager.php:867
|
1005 |
+
#: ../classes/class-ccf-form-manager.php:931
|
1006 |
+
#: ../classes/class-ccf-form-manager.php:984
|
1007 |
+
#: ../classes/class-ccf-form-manager.php:1044
|
1008 |
+
#: ../classes/class-ccf-form-manager.php:1127
|
|
|
|
|
|
|
|
|
|
|
1009 |
#: ../classes/class-ccf-form-manager.php:1204
|
1010 |
+
#: ../classes/class-ccf-form-manager.php:1275
|
1011 |
+
#: ../classes/class-ccf-form-manager.php:1348
|
1012 |
+
#: ../classes/class-ccf-form-manager.php:1447
|
1013 |
+
#: ../classes/class-ccf-form-manager.php:1514
|
1014 |
+
#: ../classes/class-ccf-form-manager.php:1581
|
1015 |
msgid "Class Name:"
|
1016 |
msgstr ""
|
1017 |
|
1018 |
#: ../classes/class-ccf-form-manager.php:575
|
1019 |
+
#: ../classes/class-ccf-form-manager.php:773
|
1020 |
+
#: ../classes/class-ccf-form-manager.php:935
|
1021 |
+
#: ../classes/class-ccf-form-manager.php:1132
|
1022 |
+
#: ../classes/class-ccf-form-manager.php:1208
|
1023 |
+
#: ../classes/class-ccf-form-manager.php:1353
|
1024 |
msgid "Placeholder Text:"
|
1025 |
msgstr ""
|
1026 |
|
1027 |
+
#: ../classes/class-ccf-form-manager.php:579
|
1028 |
+
#: ../classes/class-ccf-form-manager.php:649
|
1029 |
+
#: ../classes/class-ccf-form-manager.php:709
|
1030 |
+
#: ../classes/class-ccf-form-manager.php:777
|
1031 |
+
#: ../classes/class-ccf-form-manager.php:822
|
1032 |
+
#: ../classes/class-ccf-form-manager.php:871
|
1033 |
+
#: ../classes/class-ccf-form-manager.php:939
|
1034 |
+
#: ../classes/class-ccf-form-manager.php:988
|
1035 |
+
#: ../classes/class-ccf-form-manager.php:1048
|
1036 |
+
#: ../classes/class-ccf-form-manager.php:1137
|
1037 |
+
#: ../classes/class-ccf-form-manager.php:1212
|
1038 |
+
#: ../classes/class-ccf-form-manager.php:1279
|
1039 |
+
#: ../classes/class-ccf-form-manager.php:1358
|
1040 |
+
#: ../classes/class-ccf-form-manager.php:1451
|
1041 |
+
#: ../classes/class-ccf-form-manager.php:1518
|
1042 |
+
#: ../classes/class-ccf-form-manager.php:1585
|
1043 |
+
msgid "Enable Conditional Logic:"
|
1044 |
+
msgstr ""
|
1045 |
+
|
1046 |
+
#: ../classes/class-ccf-form-manager.php:587
|
1047 |
+
#: ../classes/class-ccf-form-manager.php:657
|
1048 |
+
#: ../classes/class-ccf-form-manager.php:717
|
1049 |
+
#: ../classes/class-ccf-form-manager.php:785
|
1050 |
+
#: ../classes/class-ccf-form-manager.php:830
|
1051 |
+
#: ../classes/class-ccf-form-manager.php:879
|
1052 |
+
#: ../classes/class-ccf-form-manager.php:947
|
1053 |
+
#: ../classes/class-ccf-form-manager.php:996
|
1054 |
+
#: ../classes/class-ccf-form-manager.php:1056
|
1055 |
+
#: ../classes/class-ccf-form-manager.php:1145
|
1056 |
+
#: ../classes/class-ccf-form-manager.php:1220
|
1057 |
+
#: ../classes/class-ccf-form-manager.php:1287
|
1058 |
+
#: ../classes/class-ccf-form-manager.php:1366
|
1059 |
+
#: ../classes/class-ccf-form-manager.php:1459
|
1060 |
+
#: ../classes/class-ccf-form-manager.php:1526
|
1061 |
+
#: ../classes/class-ccf-form-manager.php:1593
|
1062 |
+
msgid "Hide"
|
1063 |
+
msgstr ""
|
1064 |
+
|
1065 |
+
#: ../classes/class-ccf-form-manager.php:588
|
1066 |
+
#: ../classes/class-ccf-form-manager.php:658
|
1067 |
+
#: ../classes/class-ccf-form-manager.php:718
|
1068 |
+
#: ../classes/class-ccf-form-manager.php:786
|
1069 |
+
#: ../classes/class-ccf-form-manager.php:831
|
1070 |
+
#: ../classes/class-ccf-form-manager.php:880
|
1071 |
+
#: ../classes/class-ccf-form-manager.php:948
|
1072 |
+
#: ../classes/class-ccf-form-manager.php:997
|
1073 |
+
#: ../classes/class-ccf-form-manager.php:1057
|
1074 |
+
#: ../classes/class-ccf-form-manager.php:1146
|
1075 |
+
#: ../classes/class-ccf-form-manager.php:1221
|
1076 |
+
#: ../classes/class-ccf-form-manager.php:1288
|
1077 |
+
#: ../classes/class-ccf-form-manager.php:1367
|
1078 |
+
#: ../classes/class-ccf-form-manager.php:1460
|
1079 |
+
#: ../classes/class-ccf-form-manager.php:1527
|
1080 |
+
#: ../classes/class-ccf-form-manager.php:1594
|
1081 |
+
msgid "Show"
|
1082 |
+
msgstr ""
|
1083 |
+
|
1084 |
+
#: ../classes/class-ccf-form-manager.php:591
|
1085 |
+
#: ../classes/class-ccf-form-manager.php:661
|
1086 |
+
#: ../classes/class-ccf-form-manager.php:721
|
1087 |
+
#: ../classes/class-ccf-form-manager.php:789
|
1088 |
+
#: ../classes/class-ccf-form-manager.php:834
|
1089 |
+
#: ../classes/class-ccf-form-manager.php:883
|
1090 |
+
#: ../classes/class-ccf-form-manager.php:951
|
1091 |
+
#: ../classes/class-ccf-form-manager.php:1000
|
1092 |
+
#: ../classes/class-ccf-form-manager.php:1060
|
1093 |
+
#: ../classes/class-ccf-form-manager.php:1149
|
1094 |
+
#: ../classes/class-ccf-form-manager.php:1224
|
1095 |
+
#: ../classes/class-ccf-form-manager.php:1291
|
1096 |
+
#: ../classes/class-ccf-form-manager.php:1370
|
1097 |
+
#: ../classes/class-ccf-form-manager.php:1463
|
1098 |
+
#: ../classes/class-ccf-form-manager.php:1530
|
1099 |
+
#: ../classes/class-ccf-form-manager.php:1597
|
1100 |
+
msgid "this field if"
|
1101 |
+
msgstr ""
|
1102 |
+
|
1103 |
+
#: ../classes/class-ccf-form-manager.php:594
|
1104 |
+
#: ../classes/class-ccf-form-manager.php:664
|
1105 |
+
#: ../classes/class-ccf-form-manager.php:724
|
1106 |
+
#: ../classes/class-ccf-form-manager.php:792
|
1107 |
+
#: ../classes/class-ccf-form-manager.php:837
|
1108 |
+
#: ../classes/class-ccf-form-manager.php:886
|
1109 |
+
#: ../classes/class-ccf-form-manager.php:954
|
1110 |
+
#: ../classes/class-ccf-form-manager.php:1003
|
1111 |
+
#: ../classes/class-ccf-form-manager.php:1063
|
1112 |
+
#: ../classes/class-ccf-form-manager.php:1152
|
1113 |
+
#: ../classes/class-ccf-form-manager.php:1227
|
1114 |
+
#: ../classes/class-ccf-form-manager.php:1294
|
1115 |
+
#: ../classes/class-ccf-form-manager.php:1373
|
1116 |
+
#: ../classes/class-ccf-form-manager.php:1466
|
1117 |
+
#: ../classes/class-ccf-form-manager.php:1533
|
1118 |
+
#: ../classes/class-ccf-form-manager.php:1600
|
1119 |
+
msgid "All"
|
1120 |
+
msgstr ""
|
1121 |
+
|
1122 |
+
#: ../classes/class-ccf-form-manager.php:595
|
1123 |
+
#: ../classes/class-ccf-form-manager.php:665
|
1124 |
+
#: ../classes/class-ccf-form-manager.php:725
|
1125 |
+
#: ../classes/class-ccf-form-manager.php:793
|
1126 |
+
#: ../classes/class-ccf-form-manager.php:838
|
1127 |
+
#: ../classes/class-ccf-form-manager.php:887
|
1128 |
+
#: ../classes/class-ccf-form-manager.php:955
|
1129 |
+
#: ../classes/class-ccf-form-manager.php:1004
|
1130 |
+
#: ../classes/class-ccf-form-manager.php:1064
|
1131 |
+
#: ../classes/class-ccf-form-manager.php:1153
|
1132 |
+
#: ../classes/class-ccf-form-manager.php:1228
|
1133 |
+
#: ../classes/class-ccf-form-manager.php:1295
|
1134 |
+
#: ../classes/class-ccf-form-manager.php:1374
|
1135 |
+
#: ../classes/class-ccf-form-manager.php:1467
|
1136 |
+
#: ../classes/class-ccf-form-manager.php:1534
|
1137 |
+
#: ../classes/class-ccf-form-manager.php:1601
|
1138 |
+
msgid "Any"
|
1139 |
+
msgstr ""
|
1140 |
+
|
1141 |
+
#: ../classes/class-ccf-form-manager.php:598
|
1142 |
+
#: ../classes/class-ccf-form-manager.php:668
|
1143 |
+
#: ../classes/class-ccf-form-manager.php:728
|
1144 |
+
#: ../classes/class-ccf-form-manager.php:796
|
1145 |
+
#: ../classes/class-ccf-form-manager.php:841
|
1146 |
+
#: ../classes/class-ccf-form-manager.php:890
|
1147 |
+
#: ../classes/class-ccf-form-manager.php:958
|
1148 |
+
#: ../classes/class-ccf-form-manager.php:1007
|
1149 |
+
#: ../classes/class-ccf-form-manager.php:1067
|
1150 |
+
#: ../classes/class-ccf-form-manager.php:1156
|
1151 |
+
#: ../classes/class-ccf-form-manager.php:1231
|
1152 |
+
#: ../classes/class-ccf-form-manager.php:1298
|
1153 |
+
#: ../classes/class-ccf-form-manager.php:1377
|
1154 |
+
#: ../classes/class-ccf-form-manager.php:1470
|
1155 |
+
#: ../classes/class-ccf-form-manager.php:1537
|
1156 |
+
#: ../classes/class-ccf-form-manager.php:1604
|
1157 |
+
msgid "of these conditions are true:"
|
1158 |
+
msgstr ""
|
1159 |
+
|
1160 |
+
#: ../classes/class-ccf-form-manager.php:623
|
1161 |
msgid "Allowed File Extensions (comma separate):"
|
1162 |
msgstr ""
|
1163 |
|
1164 |
+
#: ../classes/class-ccf-form-manager.php:625
|
1165 |
msgid ""
|
1166 |
"If left blank, will default to all extensions registered by WordPress. If "
|
1167 |
"you use a file extension or mime type not <a href=\"http://codex.wordpress."
|
1169 |
"a>, you will need to filter and manually whitelist the new extension."
|
1170 |
msgstr ""
|
1171 |
|
1172 |
+
#: ../classes/class-ccf-form-manager.php:628
|
1173 |
msgid "Max File Size (in MB):"
|
1174 |
msgstr ""
|
1175 |
|
1176 |
+
#: ../classes/class-ccf-form-manager.php:630
|
1177 |
#, php-format
|
1178 |
msgid ""
|
1179 |
"If left blank, will default to %d MB. Maximum allowed by server is %d MB."
|
1180 |
msgstr ""
|
1181 |
|
1182 |
+
#: ../classes/class-ccf-form-manager.php:680
|
1183 |
msgid ""
|
1184 |
"reCAPTCHA is a simple captcha service provided by Google. <a target=\"_blank"
|
1185 |
"\" href=\"https://www.google.com/recaptcha/intro/index.html\">Learn more</a>"
|
1186 |
msgstr ""
|
1187 |
|
1188 |
+
#: ../classes/class-ccf-form-manager.php:690
|
1189 |
msgid "Site Key:"
|
1190 |
msgstr ""
|
1191 |
|
1192 |
+
#: ../classes/class-ccf-form-manager.php:692
|
1193 |
+
#: ../classes/class-ccf-form-manager.php:697
|
1194 |
msgid "Don't have one?"
|
1195 |
msgstr ""
|
1196 |
|
1197 |
+
#: ../classes/class-ccf-form-manager.php:695
|
1198 |
msgid "Secret Key:"
|
1199 |
msgstr ""
|
1200 |
|
1201 |
+
#: ../classes/class-ccf-form-manager.php:806
|
1202 |
+
#: ../classes/class-ccf-form-manager.php:851
|
1203 |
+
#: ../classes/class-ccf-form-manager.php:900
|
1204 |
+
#: ../classes/class-ccf-form-manager.php:968
|
1205 |
+
#: ../classes/class-ccf-form-manager.php:1017
|
1206 |
+
#: ../classes/class-ccf-form-manager.php:1077
|
1207 |
+
#: ../classes/class-ccf-form-manager.php:1166
|
1208 |
+
#: ../classes/class-ccf-form-manager.php:1241
|
1209 |
+
#: ../classes/class-ccf-form-manager.php:1308
|
1210 |
+
#: ../classes/class-ccf-form-manager.php:1413
|
1211 |
+
#: ../classes/class-ccf-form-manager.php:1480
|
1212 |
+
#: ../classes/class-ccf-form-manager.php:1547
|
1213 |
msgid "Basic"
|
1214 |
msgstr ""
|
1215 |
|
1216 |
+
#: ../classes/class-ccf-form-manager.php:809
|
1217 |
msgid "HTML Content:"
|
1218 |
msgstr ""
|
1219 |
|
1220 |
+
#: ../classes/class-ccf-form-manager.php:854
|
1221 |
msgid "Heading:"
|
1222 |
msgstr ""
|
1223 |
|
1224 |
+
#: ../classes/class-ccf-form-manager.php:858
|
1225 |
msgid "Sub Heading:"
|
1226 |
msgstr ""
|
1227 |
|
1228 |
+
#: ../classes/class-ccf-form-manager.php:971
|
1229 |
+
#: ../classes/class-ccf-form-manager.php:1020
|
1230 |
+
#: ../classes/class-ccf-form-manager.php:1080
|
1231 |
+
#: ../classes/class-ccf-form-manager.php:1169
|
1232 |
+
#: ../classes/class-ccf-form-manager.php:1244
|
1233 |
+
#: ../classes/class-ccf-form-manager.php:1311
|
1234 |
+
#: ../classes/class-ccf-form-manager.php:1416
|
1235 |
+
#: ../classes/class-ccf-form-manager.php:1483
|
1236 |
+
#: ../classes/class-ccf-form-manager.php:1550
|
1237 |
msgid "Internal Unique Slug (a-z, 0-9, -, _):"
|
1238 |
msgstr ""
|
1239 |
|
1240 |
+
#: ../classes/class-ccf-form-manager.php:1106
|
1241 |
msgid "Enable Date Select"
|
1242 |
msgstr ""
|
1243 |
|
1244 |
+
#: ../classes/class-ccf-form-manager.php:1110
|
1245 |
msgid "Enable Time Select"
|
1246 |
msgstr ""
|
1247 |
|
1248 |
+
#: ../classes/class-ccf-form-manager.php:1114
|
1249 |
msgid "Date Format:"
|
1250 |
msgstr ""
|
1251 |
|
1252 |
+
#: ../classes/class-ccf-form-manager.php:1185
|
1253 |
msgid "Format:"
|
1254 |
msgstr ""
|
1255 |
|
1256 |
+
#: ../classes/class-ccf-form-manager.php:1188
|
1257 |
+
#: ../classes/class-ccf-form-manager.php:1259
|
1258 |
msgid "International"
|
1259 |
msgstr ""
|
1260 |
|
1261 |
+
#: ../classes/class-ccf-form-manager.php:1256
|
1262 |
msgid "Type:"
|
1263 |
msgstr ""
|
1264 |
|
1265 |
+
#: ../classes/class-ccf-form-manager.php:1258
|
1266 |
msgid "United States"
|
1267 |
msgstr ""
|
1268 |
|
1269 |
+
#: ../classes/class-ccf-form-manager.php:1336
|
1270 |
msgid "Require Confirmation:"
|
1271 |
msgstr ""
|
1272 |
|
1273 |
+
#: ../classes/class-ccf-form-manager.php:1388
|
1274 |
msgid "Label"
|
1275 |
msgstr ""
|
1276 |
|
1277 |
+
#: ../classes/class-ccf-form-manager.php:1389
|
1278 |
msgid "Value"
|
1279 |
msgstr ""
|
1280 |
|
1281 |
+
#: ../classes/class-ccf-form-manager.php:1402
|
1282 |
+
msgid "is"
|
1283 |
+
msgstr ""
|
1284 |
+
|
1285 |
+
#: ../classes/class-ccf-form-manager.php:1403
|
1286 |
+
msgid "is not"
|
1287 |
+
msgstr ""
|
1288 |
+
|
1289 |
+
#: ../classes/class-ccf-form-manager.php:1404
|
1290 |
+
msgid ">"
|
1291 |
+
msgstr ""
|
1292 |
+
|
1293 |
+
#: ../classes/class-ccf-form-manager.php:1405
|
1294 |
+
msgid "<"
|
1295 |
+
msgstr ""
|
1296 |
+
|
1297 |
+
#: ../classes/class-ccf-form-manager.php:1406
|
1298 |
+
msgid "contains"
|
1299 |
+
msgstr ""
|
1300 |
+
|
1301 |
+
#: ../classes/class-ccf-form-manager.php:1408
|
1302 |
+
msgid "Field value"
|
1303 |
+
msgstr ""
|
1304 |
+
|
1305 |
+
#: ../classes/class-ccf-form-manager.php:1435
|
1306 |
+
#: ../classes/class-ccf-form-manager.php:1502
|
1307 |
+
#: ../classes/class-ccf-form-manager.php:1569
|
1308 |
msgid "Manage field choices:"
|
1309 |
msgstr ""
|
1310 |
|
1311 |
+
#: ../classes/class-ccf-form-manager.php:1439
|
1312 |
+
#: ../classes/class-ccf-form-manager.php:1506
|
1313 |
+
#: ../classes/class-ccf-form-manager.php:1573
|
1314 |
msgid ""
|
1315 |
"Note: If an option does not have a \"value\", it will not be considered a "
|
1316 |
"valid selection if the field is required. The \"value\" is what's read, "
|
1317 |
"stored, and displayed in the submission."
|
1318 |
msgstr ""
|
1319 |
|
1320 |
+
#: ../classes/class-ccf-form-manager.php:1614
|
1321 |
msgid "You currently have no forms. Add some!"
|
1322 |
msgstr ""
|
1323 |
|
1324 |
+
#: ../classes/class-ccf-form-manager.php:1637
|
1325 |
msgid "Allowed file extensions are {{ extensions }}. "
|
1326 |
msgstr ""
|
1327 |
|
1328 |
+
#: ../classes/class-ccf-form-manager.php:1639
|
1329 |
msgid "Max file size is {{ file_size }} MB. "
|
1330 |
msgstr ""
|
1331 |
|
1332 |
+
#: ../classes/class-ccf-form-manager.php:1664
|
1333 |
+
#: ../classes/class-ccf-form-manager.php:1680
|
1334 |
+
#: ../classes/class-ccf-form-manager.php:1698
|
1335 |
msgid "An example choice"
|
1336 |
msgstr ""
|
1337 |
|
1338 |
+
#: ../classes/class-ccf-form-manager.php:1717
|
1339 |
msgid "Arbitrary block of HTML."
|
1340 |
msgstr ""
|
1341 |
|
1342 |
+
#: ../classes/class-ccf-form-manager.php:1724
|
1343 |
msgid "Section Heading"
|
1344 |
msgstr ""
|
1345 |
|
1346 |
+
#: ../classes/class-ccf-form-manager.php:1726
|
1347 |
msgid "This is the sub-heading text."
|
1348 |
msgstr ""
|
1349 |
|
1350 |
+
#: ../classes/class-ccf-form-manager.php:1897
|
1351 |
msgid "Trash"
|
1352 |
msgstr ""
|
1353 |
|
1354 |
+
#: ../classes/class-ccf-form-manager.php:1940
|
1355 |
msgid "There is a problem with this form. Is it trashed or deleted?"
|
1356 |
msgstr ""
|
1357 |
|
1358 |
+
#: ../classes/class-ccf-form-manager.php:2087
|
1359 |
msgid "IP Address"
|
1360 |
msgstr ""
|
1361 |
|
1362 |
+
#: ../classes/class-ccf-form-manager.php:2099
|
1363 |
msgid "There are no submissions."
|
1364 |
msgstr ""
|
1365 |
|
1366 |
+
#: ../classes/class-ccf-form-manager.php:2128
|
1367 |
msgid "Add Form"
|
1368 |
msgstr ""
|
1369 |
|
1370 |
+
#: ../classes/class-ccf-form-manager.php:2151
|
1371 |
msgid "Single Line Text"
|
1372 |
msgstr ""
|
1373 |
|
1374 |
+
#: ../classes/class-ccf-form-manager.php:2152
|
1375 |
msgid "Dropdown"
|
1376 |
msgstr ""
|
1377 |
|
1378 |
+
#: ../classes/class-ccf-form-manager.php:2153
|
1379 |
msgid "Checkboxes"
|
1380 |
msgstr ""
|
1381 |
|
1382 |
+
#: ../classes/class-ccf-form-manager.php:2154
|
1383 |
msgid "Radio Buttons"
|
1384 |
msgstr ""
|
1385 |
|
1386 |
+
#: ../classes/class-ccf-form-manager.php:2155
|
1387 |
msgid "Paragraph Text"
|
1388 |
msgstr ""
|
1389 |
|
1390 |
+
#: ../classes/class-ccf-form-manager.php:2156
|
1391 |
msgid "Hidden"
|
1392 |
msgstr ""
|
1393 |
|
1394 |
+
#: ../classes/class-ccf-form-manager.php:2157
|
1395 |
msgid "File Upload"
|
1396 |
msgstr ""
|
1397 |
|
1398 |
+
#: ../classes/class-ccf-form-manager.php:2161
|
1399 |
msgid "HTML"
|
1400 |
msgstr ""
|
1401 |
|
1402 |
+
#: ../classes/class-ccf-form-manager.php:2162
|
1403 |
+
msgid "Section"
|
1404 |
msgstr ""
|
1405 |
|
1406 |
+
#: ../classes/class-ccf-form-manager.php:2167
|
1407 |
msgid "Name"
|
1408 |
msgstr ""
|
1409 |
|
1410 |
+
#: ../classes/class-ccf-form-manager.php:2168
|
1411 |
msgid "Date/Time"
|
1412 |
msgstr ""
|
1413 |
|
1414 |
+
#: ../classes/class-ccf-form-manager.php:2169
|
1415 |
msgid "Website"
|
1416 |
msgstr ""
|
1417 |
|
1418 |
+
#: ../classes/class-ccf-form-manager.php:2170
|
1419 |
msgid "Address"
|
1420 |
msgstr ""
|
1421 |
|
1422 |
+
#: ../classes/class-ccf-form-manager.php:2171
|
1423 |
msgid "Phone"
|
1424 |
msgstr ""
|
1425 |
|
1426 |
+
#: ../classes/class-ccf-form-manager.php:2172
|
1427 |
msgid "reCAPTCHA"
|
1428 |
msgstr ""
|
1429 |
|
1430 |
+
#: ../classes/class-ccf-form-manager.php:2205
|
1431 |
msgid "You have no email fields"
|
1432 |
msgstr ""
|
1433 |
|
1434 |
+
#: ../classes/class-ccf-form-manager.php:2206
|
1435 |
+
msgid "No available fields"
|
1436 |
msgstr ""
|
1437 |
|
1438 |
+
#: ../classes/class-ccf-form-manager.php:2207
|
1439 |
msgid "You have no name fields"
|
1440 |
msgstr ""
|
1441 |
|
1442 |
+
#: ../classes/class-ccf-form-manager.php:2208
|
1443 |
msgid "You have no applicable fields"
|
1444 |
msgstr ""
|
1445 |
|
1446 |
+
#: ../classes/class-ccf-form-manager.php:2209
|
1447 |
msgid "Choose a Form Field"
|
1448 |
msgstr ""
|
1449 |
|
1450 |
+
#: ../classes/class-ccf-form-manager.php:2210
|
1451 |
msgid "Invalid date"
|
1452 |
msgstr ""
|
1453 |
|
1454 |
+
#: ../classes/class-ccf-form-manager.php:2212
|
1455 |
msgid "Field Label"
|
1456 |
msgstr ""
|
1457 |
|
1458 |
+
#: ../classes/class-ccf-form-manager.php:2214
|
1459 |
#: ../classes/class-ccf-form-renderer.php:174
|
1460 |
msgid "This form is paused right now. Check back later!"
|
1461 |
msgstr ""
|
1462 |
|
1463 |
+
#: ../classes/class-ccf-form-manager.php:2216
|
1464 |
msgid "Choose a Post Field"
|
1465 |
msgstr ""
|
1466 |
|
1467 |
+
#: ../classes/class-ccf-form-manager.php:2219
|
1468 |
msgid "Post Title"
|
1469 |
msgstr ""
|
1470 |
|
1471 |
+
#: ../classes/class-ccf-form-manager.php:2220
|
1472 |
msgid "Post Content"
|
1473 |
msgstr ""
|
1474 |
|
1475 |
+
#: ../classes/class-ccf-form-manager.php:2221
|
1476 |
msgid "Post Excerpt"
|
1477 |
msgstr ""
|
1478 |
|
1479 |
+
#: ../classes/class-ccf-form-manager.php:2222
|
1480 |
msgid "Post Date"
|
1481 |
msgstr ""
|
1482 |
|
1483 |
+
#: ../classes/class-ccf-form-manager.php:2225
|
1484 |
msgid "Post Tags"
|
1485 |
msgstr ""
|
1486 |
|
1487 |
+
#: ../classes/class-ccf-form-manager.php:2226
|
1488 |
msgid "Custom Field"
|
1489 |
msgstr ""
|
1490 |
|
1512 |
msgid "An unknown error occured."
|
1513 |
msgstr ""
|
1514 |
|
1515 |
+
#: ../classes/class-ccf-settings.php:76
|
1516 |
msgid "Enable Asset Loading Restrictions"
|
1517 |
msgstr ""
|
1518 |
|
1519 |
+
#: ../classes/class-ccf-settings.php:77
|
1520 |
msgid "Restrict Asset Loading To"
|
1521 |
msgstr ""
|
1522 |
|
1523 |
+
#: ../classes/class-ccf-settings.php:88
|
1524 |
msgid ""
|
1525 |
"By default, Custom Contact Forms loads all it's assets (JavaScript, CSS, "
|
1526 |
"etc.) on every page of your site. The reason for this is that there is no "
|
1530 |
"page of your site."
|
1531 |
msgstr ""
|
1532 |
|
1533 |
+
#: ../classes/class-ccf-settings.php:121 ../classes/class-ccf-settings.php:134
|
1534 |
msgid "URL or post ID"
|
1535 |
msgstr ""
|
1536 |
|
1537 |
+
#: ../classes/class-ccf-settings.php:122 ../classes/class-ccf-settings.php:135
|
1538 |
msgid "Restriction type:"
|
1539 |
msgstr ""
|
1540 |
|
1541 |
+
#: ../classes/class-ccf-settings.php:124 ../classes/class-ccf-settings.php:137
|
1542 |
msgid "URL"
|
1543 |
msgstr ""
|
1544 |
|
1545 |
+
#: ../classes/class-ccf-settings.php:125 ../classes/class-ccf-settings.php:138
|
1546 |
msgid "Post ID"
|
1547 |
msgstr ""
|
1548 |
|
1585 |
msgid "Custom Contact Form"
|
1586 |
msgstr ""
|
1587 |
|
1588 |
+
#: ../classes/class-ccf-widget.php:63
|
1589 |
msgid "Title:"
|
1590 |
msgstr ""
|
1591 |
|
1592 |
+
#: ../classes/class-ccf-widget.php:70
|
1593 |
msgid "Choose a form:"
|
1594 |
msgstr ""
|
1595 |
|
1596 |
+
#: ../classes/class-ccf-widget.php:79
|
1597 |
msgid "Untitled"
|
1598 |
msgstr ""
|
1599 |
|
readme.txt
CHANGED
@@ -18,12 +18,14 @@ Custom Contact Forms enables you to build forms and manage submissions the WordP
|
|
18 |
|
19 |
* Create text fields, paragraph fields, first/last name fields, email fields (with optional confirmation), US address fields, international address fields, date fields (optional international format), time fields, checkbox fields, dropdown (optional multi-select), radio fields, hidden fields, file upload fields, phone fields (optional international number), website fields, and more.
|
20 |
* Add HTML and sections to your forms.
|
|
|
21 |
* Add help text, modify labels, mark required, add CSS classes, manage options, etc. for each of your form fields.
|
22 |
* Forms use AJAX so no page reloads are necessary. Stylish error messages are shown without page reload.
|
23 |
* All form submissions shown in an easy to view format within the WordPress admin.
|
24 |
* Export form submissions to CSV.
|
25 |
* Pre-setup for Twitter Bootstrap
|
26 |
* Multiple themes to choose from
|
|
|
27 |
* Forms can show customizable completion text or redirect to a URL.
|
28 |
* Temporarily pause forms with a customizable pause message.
|
29 |
* Create and manage multiple notifications for each form. Notifications can send emails to one or more administrators or form submittors. Customize notification email subject, from email address, from email name, and email body. Map form fields to email subject, from name, and from email address. Easily activate and deactivate notifications.
|
@@ -55,6 +57,10 @@ For full documentation, questions, feature requests, and support concerning the
|
|
55 |
|
56 |
== Changelog ==
|
57 |
|
|
|
|
|
|
|
|
|
58 |
= 7.4.5 =
|
59 |
* Fix CCF compat with API plugin
|
60 |
|
18 |
|
19 |
* Create text fields, paragraph fields, first/last name fields, email fields (with optional confirmation), US address fields, international address fields, date fields (optional international format), time fields, checkbox fields, dropdown (optional multi-select), radio fields, hidden fields, file upload fields, phone fields (optional international number), website fields, and more.
|
20 |
* Add HTML and sections to your forms.
|
21 |
+
* Conditional fields and form sections
|
22 |
* Add help text, modify labels, mark required, add CSS classes, manage options, etc. for each of your form fields.
|
23 |
* Forms use AJAX so no page reloads are necessary. Stylish error messages are shown without page reload.
|
24 |
* All form submissions shown in an easy to view format within the WordPress admin.
|
25 |
* Export form submissions to CSV.
|
26 |
* Pre-setup for Twitter Bootstrap
|
27 |
* Multiple themes to choose from
|
28 |
+
* No custom database tables
|
29 |
* Forms can show customizable completion text or redirect to a URL.
|
30 |
* Temporarily pause forms with a customizable pause message.
|
31 |
* Create and manage multiple notifications for each form. Notifications can send emails to one or more administrators or form submittors. Customize notification email subject, from email address, from email name, and email body. Map form fields to email subject, from name, and from email address. Easily activate and deactivate notifications.
|
57 |
|
58 |
== Changelog ==
|
59 |
|
60 |
+
= 7.5 =
|
61 |
+
* Conditional fields and sections
|
62 |
+
* [current_date_time] notification variable
|
63 |
+
|
64 |
= 7.4.5 =
|
65 |
* Fix CCF compat with API plugin
|
66 |
|