Custom Contact Forms - Version 7.8.2

Version Description

  • Add $submission to ccf_email_subject filter, correct "Invalid Date" issue with datepicker. Props (quayzar)[https://github.com/quayzar]
  • Fix WooCommerce conflict
  • Add support for Customize Posts plugin. Props (westonruter)[https://github.com/westonruter]
Download this release

Release Info

Developer tlovett1
Plugin Icon 128x128 Custom Contact Forms
Version 7.8.2
Comparing to
See all releases

Code changes from version 7.8.1 to 7.8.2

README.md CHANGED
@@ -69,14 +69,23 @@ form is successfully filled out. Each notification contains the following config
69
 
70
  * `[all_fields]` - Shows all your form fields
71
  * `[ip_address]` - Shows the IP address of the submitter
 
72
  * `[FIELD_SLUG]` - Each of your form fields can be inserted using their field slug.
73
 
74
  * `"To" Email Addresses` - You can send each notification to as many emails as you want. Addresses have two types: `custom` and
75
  `field`. `custom` allows you to specify a specific email (such as your own). `field` will pull the email address dynamically from a form field.
 
 
 
 
 
 
 
76
  * `"From" Email Address Type` - This allows you to set what email address the notification is sent from. `WordPress
77
  Default` will use the default WordPress email address. `Custom Email` will allow you to manually type in a from
78
  address. `Form Field` will allow you to choose an email field within the form to dynamically pull a from email
79
  address.
 
80
  * `"From" Name Type` - This allows you to set what name the notification email is sent from. `Custom Name`
81
  will allow you to manually type in a from name. `Form Field` will allow you to choose a name field within
82
  the form to dynamically pull a from email name.
@@ -84,6 +93,9 @@ the form to dynamically pull a from email name.
84
  will use the CCF default subject. `Custom Subject` will allow you to manually type in an email subject.
85
  `Form Field` will allow you to choose a field within the form to dynamically pull a subject line.
86
 
 
 
 
87
  __Note:__ In order for form notification changes to take affect, you will need to save the form.
88
 
89
  #### Post Creation
69
 
70
  * `[all_fields]` - Shows all your form fields
71
  * `[ip_address]` - Shows the IP address of the submitter
72
+ * `[current_date_time]` - Shows the current date and time
73
  * `[FIELD_SLUG]` - Each of your form fields can be inserted using their field slug.
74
 
75
  * `"To" Email Addresses` - You can send each notification to as many emails as you want. Addresses have two types: `custom` and
76
  `field`. `custom` allows you to specify a specific email (such as your own). `field` will pull the email address dynamically from a form field.
77
+ * `Reply To Email Address Type` - This allows you to set what email address is set as the notification email Reply To. `WordPress
78
+ Default` will use the default WordPress email address. `Custom Email` will allow you to manually type in an address. `Form Field` will allow you to choose an email field within the form to dynamically pull a email address.
79
+
80
+ * `Reply To Name Type` - This allows you to set the Reply To name in the notification email. `Custom Name`
81
+ will allow you to manually type in a name. `Form Field` will allow you to choose a name field within
82
+ the form to dynamically pull a name.
83
+
84
  * `"From" Email Address Type` - This allows you to set what email address the notification is sent from. `WordPress
85
  Default` will use the default WordPress email address. `Custom Email` will allow you to manually type in a from
86
  address. `Form Field` will allow you to choose an email field within the form to dynamically pull a from email
87
  address.
88
+
89
  * `"From" Name Type` - This allows you to set what name the notification email is sent from. `Custom Name`
90
  will allow you to manually type in a from name. `Form Field` will allow you to choose a name field within
91
  the form to dynamically pull a from email name.
93
  will use the CCF default subject. `Custom Subject` will allow you to manually type in an email subject.
94
  `Form Field` will allow you to choose a field within the form to dynamically pull a subject line.
95
 
96
+ * `Include File Uploads` - If this is set to yes, file uploads will be sent in notification emails. This only applies if your
97
+ form has File Upload fields.
98
+
99
  __Note:__ In order for form notification changes to take affect, you will need to save the form.
100
 
101
  #### Post Creation
assets/build/css/form-manager.css CHANGED
@@ -30,7 +30,7 @@
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 {
@@ -163,7 +163,7 @@
163
  font-size: 35px;
164
  cursor: pointer;
165
  color: #333;
166
- z-index: 160001; }
167
  .ccf-main-modal .main-menu {
168
  position: absolute;
169
  top: 0;
@@ -612,7 +612,7 @@
612
  left: 0px;
613
  width: 100%;
614
  height: 100%;
615
- z-index: 159900;
616
  opacity: 0.7;
617
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";
618
  filter: alpha(opacity=70);
30
  left: 30px;
31
  right: 30px;
32
  bottom: 30px;
33
+ z-index: 1600000;
34
  overflow: hidden;
35
  background-color: #fff; }
36
  .ccf-main-modal [data-icon]:before {
163
  font-size: 35px;
164
  cursor: pointer;
165
  color: #333;
166
+ z-index: 1600001; }
167
  .ccf-main-modal .main-menu {
168
  position: absolute;
169
  top: 0;
612
  left: 0px;
613
  width: 100%;
614
  height: 100%;
615
+ z-index: 1599000;
616
  opacity: 0.7;
617
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";
618
  filter: alpha(opacity=70);
assets/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,EAAE,IAAI;EACV,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,MAAM;EACf,QAAQ,EAAE,MAAM;EAChB,gBAAgB,EAAE,IAAI;EA5BtB,kCAAmB;IAClB,WAAW,EAAE,cAAc;IAC3B,OAAO,EAAE,eAAe;IACxB,KAAK,EAAE,IAAI;IACX,WAAW,E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AE,IAAI;MAGlB,oDAAM;QACL,eAAe,EAAE,IAAI",
4
  "sources": ["../../scss/form-manager.scss"],
5
  "names": [],
6
  "file": "form-manager.css"
assets/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;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 .simple-captcha-preview-img{margin-bottom: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 .toggle-use-values{float:right}.ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices{clear:both}.ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices .choice input[type=text]{width:250px;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-form-pane .right-sidebar .repeatable-choices.use-values input[type=text]{width:100px}.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:1600000;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 .simple-captcha-preview-img{margin-bottom: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:1600001}.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 .toggle-use-values{float:right}.ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices{clear:both}.ccf-main-modal .ccf-form-pane .right-sidebar .repeatable-choices .choice input[type=text]{width:250px;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-form-pane .right-sidebar .repeatable-choices.use-values input[type=text]{width:100px}.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:1599000;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/js/form-manager.js CHANGED
@@ -393,6 +393,7 @@
393
  title: '',
394
  content: '[all_fields]',
395
  active: true,
 
396
  addresses: new wp.ccf.collections.FormNotificationAddresses(),
397
  fromType: 'default',
398
  fromAddress: '',
@@ -1996,6 +1997,9 @@
1996
  var emailNotificationActive = this.el.querySelectorAll( '.form-email-notification-active' )[0].value;
1997
  this.model.set( 'active', ( '1' === emailNotificationActive ) ? true : false );
1998
 
 
 
 
1999
  var emailNotificationFromType = this.el.querySelectorAll( '.form-email-notification-from-type' )[0].value;
2000
  this.model.set( 'fromType', emailNotificationFromType );
2001
 
393
  title: '',
394
  content: '[all_fields]',
395
  active: true,
396
+ includeUploads: true,
397
  addresses: new wp.ccf.collections.FormNotificationAddresses(),
398
  fromType: 'default',
399
  fromAddress: '',
1997
  var emailNotificationActive = this.el.querySelectorAll( '.form-email-notification-active' )[0].value;
1998
  this.model.set( 'active', ( '1' === emailNotificationActive ) ? true : false );
1999
 
2000
+ var emailNotificationIncludeUploads = this.el.querySelectorAll( '.form-email-notification-include-uploads' )[0].value;
2001
+ this.model.set( 'includeUploads', ( '1' === emailNotificationIncludeUploads ) ? true : false );
2002
+
2003
  var emailNotificationFromType = this.el.querySelectorAll( '.form-email-notification-from-type' )[0].value;
2004
  this.model.set( 'fromType', emailNotificationFromType );
2005
 
assets/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 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(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#8220;/g,"”").replace(/&#8221;/g,"”").replace(/&#8216;/g,"‘").replace(/&#038;/g,"&").replace(/&#039;/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:!0,addresses:new wp.ccf.collections.FormNotificationAddresses,fromType:"default",fromAddress:"",fromField:"",subjectType:"default",subject:"",subjectField:"",fromNameType:"custom",fromName:"WordPress",fromNameField:"",replyToType:"default",replyToAddress:"",replyToField:"",replyToNameType:"custom",replyToName:"WordPress",replyToNameField:""}},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",hideTitle:!1,description:"",buttonText:"Submit Form",buttonClass:"",completionActionType:"text",completionRedirectUrl:"",completionMessage:"",postCreation:!1,postCreationType:"post",postCreationStatus:"draft",postFieldMappings:new wp.ccf.collections.PostFieldMappings,notifications:new wp.ccf.collections.FormNotifications,pause:!1,requireLoggedIn:!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 v=w.at(s);v.set(h.addresses[s]),v.decode()}delete e.notifications[l].addresses}m.set(h),m.decode()}}delete e.notifications}else{var g=[];i.each(e.notifications,function(e){var t=new wp.ccf.models.FormNotification(e);t.decode(),g.push(t)}),p?(p.add(g),delete e.notifications):e.notifications=new wp.ccf.collections.FormNotifications(g)}}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["simple-captcha"]=wp.ccf.models.Fields["simple-captcha"]||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"simple-captcha",placeholder:l.defaultSimpleCaptchaPlaceholder};return i.defaults(e,this.constructor.__super__.defaults())},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,useValues:!1};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"),i="";t.length&&(i=t[0].value),this.model.set("label",e),this.model.set("value",i),this.field.get("useValues")||this.model.set("value",this.model.get("label"));var l=this.el.querySelectorAll(".choice-selected")[0],s=l.checked?!0:!1;return this.model.set("selected",s),this}},render:function(){var e={showValue:this.field.get("useValues")};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&&"simple-captcha"!==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-reply-to-type":"toggleNotificationFields","change select.form-email-notification-reply-to-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&&"simple-captcha"!==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-reply-to-field")[0];t.innerHTML="",t.disabled=!1;var i=this.el.querySelectorAll(".form-email-notification-subject-field")[0];i.innerHTML="",i.disabled=!1;var s=this.el.querySelectorAll(".form-email-notification-from-name-field")[0];s.innerHTML="",s.disabled=!1;var o=this.el.querySelectorAll(".form-email-notification-reply-to-name-field")[0];o.innerHTML="",o.disabled=!1;var n,c,r=this.form.get("fields"),a=0,d=0,u=0,f=this.model.get("fromField"),p=this.model.get("replyToField"),h=this.model.get("subjectField"),m=this.model.get("fromNameField"),w=this.model.get("replyToNameField");r.length>=1&&r.each(function(l){("email"===l.get("type")||"dropdown"===l.get("type")||"radio"===l.get("type")||"single-line-text"===l.get("type"))&&(n=document.createElement("option"),n.innerHTML=l.get("slug"),n.value=l.get("slug"),l.get("slug")===f&&(n.selected=!0),e.appendChild(n),c=document.createElement("option"),c.innerHTML=l.get("slug"),c.value=l.get("slug"),l.get("slug")===p&&(c.selected=!0),t.appendChild(c),a++),("name"===l.get("type")||"single-line-text"===l.get("type")||"radio"===l.get("type")||"dropdown"===l.get("type"))&&(n=document.createElement("option"),n.innerHTML=l.get("slug"),n.value=l.get("slug"),l.get("slug")===m&&(n.selected=!0),s.appendChild(n),c=document.createElement("option"),c.innerHTML=l.get("slug"),c.value=l.get("slug"),l.get("slug")===w&&(c.selected=!0),o.appendChild(c),d++),("single-line-text"===l.get("type")||"radio"===l.get("type")||"dropdown"===l.get("type"))&&(n=document.createElement("option"),n.innerHTML=l.get("slug"),n.value=l.get("slug"),l.get("slug")===h&&(n.selected=!0),i.appendChild(n),u++)}),0===a&&(n=document.createElement("option"),n.innerHTML=l.noEmailFields,n.value="",e.appendChild(n),e.disabled=!0,n=document.createElement("option"),n.innerHTML=l.noEmailFields,n.value="",t.appendChild(n),t.disabled=!0),0===d&&(n=document.createElement("option"),n.innerHTML=l.noNameFields,n.value="",s.appendChild(n),s.disabled=!0),0===u&&(n=document.createElement("option"),n.innerHTML=l.noApplicableFields,n.value="",i.appendChild(n),i.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],a=this.el.querySelectorAll(".email-notification-reply-to-address")[0],d=this.el.querySelectorAll(".email-notification-reply-to-field")[0],u=this.el.querySelectorAll(".form-email-notification-reply-to-type")[0],f=this.el.querySelectorAll(".email-notification-reply-to-name")[0],p=this.el.querySelectorAll(".email-notification-reply-to-name-field")[0],h=this.el.querySelectorAll(".form-email-notification-reply-to-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"),a.style.display="none",d.style.display="none","custom"===u.value?a.style.display="block":"field"===u.value&&(d.style.display="block"),f.style.display="none",p.style.display="none","custom"===h.value?f.style.display="block":"field"===h.value&&(p.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;
2
- this.model.set("fromNameField",r);var a=this.el.querySelectorAll(".form-email-notification-reply-to-type")[0].value;this.model.set("replyToType",a);var d=this.el.querySelectorAll(".form-email-notification-reply-to-address")[0].value;this.model.set("replyToAddress",d);var u=this.el.querySelectorAll(".form-email-notification-reply-to-field")[0].value;this.model.set("replyToField",u);var f=this.el.querySelectorAll(".form-email-notification-reply-to-name-type")[0].value;this.model.set("replyToNameType",f);var p=this.el.querySelectorAll(".form-email-notification-reply-to-name")[0].value;this.model.set("replyToName",p);var h=this.el.querySelectorAll(".form-email-notification-reply-to-name-field")[0].value;this.model.set("replyToNameField",h);var m=this.el.querySelectorAll(".form-email-notification-subject-type")[0].value;this.model.set("subjectType",m);var w=this.el.querySelectorAll(".form-email-notification-subject")[0].value;this.model.set("subject",w);var v=this.el.querySelectorAll(".form-email-notification-subject-field")[0].value;this.model.set("subjectField",v);for(var g=0;this.addressViews.length>g;g++)this.addressViews[g].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)},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");if(t.length){var l=t[0].querySelectorAll(".conditional");i.each(l,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 s=this.model.get("conditionalsEnabled");this.model.set("conditionalsEnabled",1==this.el.querySelectorAll(".field-conditionals-enabled")[0].value?!0:!1),s!==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");if(i.length)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[0].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["simple-captcha"]=wp.ccf.views.Fields["simple-captcha"]||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-simple-captcha-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("placeholder",this.el.querySelectorAll(".field-placeholder")[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(){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.model.get("addressType");this.model.set("addressType",this.el.querySelectorAll(".field-address-type")[0].value);var t=this.el.querySelectorAll(".field-default-country");return t.length&&this.model.set("defaultCountry",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),e!==this.model.get("addressType")&&this.render(),this.constructor.__super__.saveField.apply(this,arguments),this}}}),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(t){if(""!==this.el.innerHTML&&(!t||"field-use-values"!==t.target.className||"focusout"!==t.type)){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 l=this.el.querySelectorAll(".repeatable-choices")[0].querySelectorAll(".choice");i.each(l,function(t){e(t).trigger("saveChoice")});var s=this.model.get("useValues"),o=this.el.querySelectorAll(".field-use-values")[0].checked?!0:!1;return this.model.set("useValues",o),s!==o&&this.render(),this}},render:function(t){var i=this;t=t?t:"basic",this.model.get("useValues"),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(".hide-title")[0].value;this.model.set("hideTitle",parseInt(t)?!0:!1);var i=this.el.querySelectorAll(".form-description")[0].value;this.model.set("description",i);var l=this.el.querySelectorAll(".form-button-text")[0].value;this.model.set("buttonText",l);var s=this.el.querySelectorAll(".form-button-class")[0].value;this.model.set("buttonClass",s);var o=this.el.querySelectorAll(".form-pause")[0].value;this.model.set("pause",parseInt(o)?!0:!1);var n=this.el.querySelectorAll(".form-require-logged-in")[0].value;this.model.set("requireLoggedIn",parseInt(n)?!0:!1);var c=this.el.querySelectorAll(".form-post-creation")[0].value;this.model.set("postCreation",parseInt(c)?!0:!1);var r=this.el.querySelectorAll(".form-post-creation-type")[0].value;this.model.set("postCreationType",r);var a=this.el.querySelectorAll(".form-post-creation-status")[0].value;this.model.set("postCreationStatus",a);var d=this.el.querySelectorAll(".form-pause-message")[0].value;this.model.set("pauseMessage",d);var u=this.el.querySelectorAll(".form-completion-message")[0].value;this.model.set("completionMessage",u);var f=this.el.querySelectorAll(".form-completion-redirect-url")[0].value;this.model.set("completionRedirectUrl",f);var p=this.el.querySelectorAll(".form-completion-action-type")[0].value;this.model.set("completionActionType",p);var h=this.el.querySelectorAll(".form-theme")[0].value;this.model.set("theme",h)}},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&amp;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,"")
3
- },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 .duplicate":"triggerDuplicate","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()})})},triggerDuplicate:function(){var e=this,t=e.parent.collection.state.currentPage;e.model.clone().set("title",{raw:e.model.get("title").raw+" (Duplicate)"}).unset("id").save().done(function(){e.parent.showPage(t).done(function(){e.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.currentTarget.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&amp;width=700&amp;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);var r=document.querySelectorAll("#major-publishing-actions .duplicate")[0],a=function(e){e=e||window.event,e.preventDefault(),s.currentForm.clone().set("title",{raw:s.currentForm.get("title").raw+" (duplicate)"}).unset("id").save().done(function(e){document.location=l.adminUrl+"/post.php?action=edit&post="+e.id})};r.addEventListener?r.addEventListener("click",a,!1):r.attachEvent("onclick",a)}})}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(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#8220;/g,"”").replace(/&#8221;/g,"”").replace(/&#8216;/g,"‘").replace(/&#038;/g,"&").replace(/&#039;/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:!0,includeUploads:!0,addresses:new wp.ccf.collections.FormNotificationAddresses,fromType:"default",fromAddress:"",fromField:"",subjectType:"default",subject:"",subjectField:"",fromNameType:"custom",fromName:"WordPress",fromNameField:"",replyToType:"default",replyToAddress:"",replyToField:"",replyToNameType:"custom",replyToName:"WordPress",replyToNameField:""}},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",hideTitle:!1,description:"",buttonText:"Submit Form",buttonClass:"",completionActionType:"text",completionRedirectUrl:"",completionMessage:"",postCreation:!1,postCreationType:"post",postCreationStatus:"draft",postFieldMappings:new wp.ccf.collections.PostFieldMappings,notifications:new wp.ccf.collections.FormNotifications,pause:!1,requireLoggedIn:!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 v=w.at(s);v.set(h.addresses[s]),v.decode()}delete e.notifications[l].addresses}m.set(h),m.decode()}}delete e.notifications}else{var g=[];i.each(e.notifications,function(e){var t=new wp.ccf.models.FormNotification(e);t.decode(),g.push(t)}),p?(p.add(g),delete e.notifications):e.notifications=new wp.ccf.collections.FormNotifications(g)}}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["simple-captcha"]=wp.ccf.models.Fields["simple-captcha"]||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"simple-captcha",placeholder:l.defaultSimpleCaptchaPlaceholder};return i.defaults(e,this.constructor.__super__.defaults())},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,useValues:!1};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"),i="";t.length&&(i=t[0].value),this.model.set("label",e),this.model.set("value",i),this.field.get("useValues")||this.model.set("value",this.model.get("label"));var l=this.el.querySelectorAll(".choice-selected")[0],s=l.checked?!0:!1;return this.model.set("selected",s),this}},render:function(){var e={showValue:this.field.get("useValues")};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&&"simple-captcha"!==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-reply-to-type":"toggleNotificationFields","change select.form-email-notification-reply-to-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&&"simple-captcha"!==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-reply-to-field")[0];t.innerHTML="",t.disabled=!1;var i=this.el.querySelectorAll(".form-email-notification-subject-field")[0];i.innerHTML="",i.disabled=!1;var s=this.el.querySelectorAll(".form-email-notification-from-name-field")[0];s.innerHTML="",s.disabled=!1;var o=this.el.querySelectorAll(".form-email-notification-reply-to-name-field")[0];o.innerHTML="",o.disabled=!1;var n,c,r=this.form.get("fields"),a=0,d=0,u=0,f=this.model.get("fromField"),p=this.model.get("replyToField"),h=this.model.get("subjectField"),m=this.model.get("fromNameField"),w=this.model.get("replyToNameField");r.length>=1&&r.each(function(l){("email"===l.get("type")||"dropdown"===l.get("type")||"radio"===l.get("type")||"single-line-text"===l.get("type"))&&(n=document.createElement("option"),n.innerHTML=l.get("slug"),n.value=l.get("slug"),l.get("slug")===f&&(n.selected=!0),e.appendChild(n),c=document.createElement("option"),c.innerHTML=l.get("slug"),c.value=l.get("slug"),l.get("slug")===p&&(c.selected=!0),t.appendChild(c),a++),("name"===l.get("type")||"single-line-text"===l.get("type")||"radio"===l.get("type")||"dropdown"===l.get("type"))&&(n=document.createElement("option"),n.innerHTML=l.get("slug"),n.value=l.get("slug"),l.get("slug")===m&&(n.selected=!0),s.appendChild(n),c=document.createElement("option"),c.innerHTML=l.get("slug"),c.value=l.get("slug"),l.get("slug")===w&&(c.selected=!0),o.appendChild(c),d++),("single-line-text"===l.get("type")||"radio"===l.get("type")||"dropdown"===l.get("type"))&&(n=document.createElement("option"),n.innerHTML=l.get("slug"),n.value=l.get("slug"),l.get("slug")===h&&(n.selected=!0),i.appendChild(n),u++)}),0===a&&(n=document.createElement("option"),n.innerHTML=l.noEmailFields,n.value="",e.appendChild(n),e.disabled=!0,n=document.createElement("option"),n.innerHTML=l.noEmailFields,n.value="",t.appendChild(n),t.disabled=!0),0===d&&(n=document.createElement("option"),n.innerHTML=l.noNameFields,n.value="",s.appendChild(n),s.disabled=!0),0===u&&(n=document.createElement("option"),n.innerHTML=l.noApplicableFields,n.value="",i.appendChild(n),i.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],a=this.el.querySelectorAll(".email-notification-reply-to-address")[0],d=this.el.querySelectorAll(".email-notification-reply-to-field")[0],u=this.el.querySelectorAll(".form-email-notification-reply-to-type")[0],f=this.el.querySelectorAll(".email-notification-reply-to-name")[0],p=this.el.querySelectorAll(".email-notification-reply-to-name-field")[0],h=this.el.querySelectorAll(".form-email-notification-reply-to-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"),a.style.display="none",d.style.display="none","custom"===u.value?a.style.display="block":"field"===u.value&&(d.style.display="block"),f.style.display="none",p.style.display="none","custom"===h.value?f.style.display="block":"field"===h.value&&(p.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-include-uploads")[0].value;this.model.set("includeUploads","1"===l?!0:!1);var s=this.el.querySelectorAll(".form-email-notification-from-type")[0].value;this.model.set("fromType",s);var o=this.el.querySelectorAll(".form-email-notification-from-address")[0].value;this.model.set("fromAddress",o);var n=this.el.querySelectorAll(".form-email-notification-from-field")[0].value;this.model.set("fromField",n);var c=this.el.querySelectorAll(".form-email-notification-from-name-type")[0].value;this.model.set("fromNameType",c);
2
+ var r=this.el.querySelectorAll(".form-email-notification-from-name")[0].value;this.model.set("fromName",r);var a=this.el.querySelectorAll(".form-email-notification-from-name-field")[0].value;this.model.set("fromNameField",a);var d=this.el.querySelectorAll(".form-email-notification-reply-to-type")[0].value;this.model.set("replyToType",d);var u=this.el.querySelectorAll(".form-email-notification-reply-to-address")[0].value;this.model.set("replyToAddress",u);var f=this.el.querySelectorAll(".form-email-notification-reply-to-field")[0].value;this.model.set("replyToField",f);var p=this.el.querySelectorAll(".form-email-notification-reply-to-name-type")[0].value;this.model.set("replyToNameType",p);var h=this.el.querySelectorAll(".form-email-notification-reply-to-name")[0].value;this.model.set("replyToName",h);var m=this.el.querySelectorAll(".form-email-notification-reply-to-name-field")[0].value;this.model.set("replyToNameField",m);var w=this.el.querySelectorAll(".form-email-notification-subject-type")[0].value;this.model.set("subjectType",w);var v=this.el.querySelectorAll(".form-email-notification-subject")[0].value;this.model.set("subject",v);var g=this.el.querySelectorAll(".form-email-notification-subject-field")[0].value;this.model.set("subjectField",g);for(var y=0;this.addressViews.length>y;y++)this.addressViews[y].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)},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");if(t.length){var l=t[0].querySelectorAll(".conditional");i.each(l,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 s=this.model.get("conditionalsEnabled");this.model.set("conditionalsEnabled",1==this.el.querySelectorAll(".field-conditionals-enabled")[0].value?!0:!1),s!==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");if(i.length)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[0].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["simple-captcha"]=wp.ccf.views.Fields["simple-captcha"]||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-simple-captcha-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("placeholder",this.el.querySelectorAll(".field-placeholder")[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(){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.model.get("addressType");this.model.set("addressType",this.el.querySelectorAll(".field-address-type")[0].value);var t=this.el.querySelectorAll(".field-default-country");return t.length&&this.model.set("defaultCountry",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),e!==this.model.get("addressType")&&this.render(),this.constructor.__super__.saveField.apply(this,arguments),this}}}),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(t){if(""!==this.el.innerHTML&&(!t||"field-use-values"!==t.target.className||"focusout"!==t.type)){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 l=this.el.querySelectorAll(".repeatable-choices")[0].querySelectorAll(".choice");i.each(l,function(t){e(t).trigger("saveChoice")});var s=this.model.get("useValues"),o=this.el.querySelectorAll(".field-use-values")[0].checked?!0:!1;return this.model.set("useValues",o),s!==o&&this.render(),this}},render:function(t){var i=this;t=t?t:"basic",this.model.get("useValues"),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(".hide-title")[0].value;this.model.set("hideTitle",parseInt(t)?!0:!1);var i=this.el.querySelectorAll(".form-description")[0].value;this.model.set("description",i);var l=this.el.querySelectorAll(".form-button-text")[0].value;this.model.set("buttonText",l);var s=this.el.querySelectorAll(".form-button-class")[0].value;this.model.set("buttonClass",s);var o=this.el.querySelectorAll(".form-pause")[0].value;this.model.set("pause",parseInt(o)?!0:!1);var n=this.el.querySelectorAll(".form-require-logged-in")[0].value;this.model.set("requireLoggedIn",parseInt(n)?!0:!1);var c=this.el.querySelectorAll(".form-post-creation")[0].value;this.model.set("postCreation",parseInt(c)?!0:!1);var r=this.el.querySelectorAll(".form-post-creation-type")[0].value;this.model.set("postCreationType",r);var a=this.el.querySelectorAll(".form-post-creation-status")[0].value;this.model.set("postCreationStatus",a);var d=this.el.querySelectorAll(".form-pause-message")[0].value;this.model.set("pauseMessage",d);var u=this.el.querySelectorAll(".form-completion-message")[0].value;this.model.set("completionMessage",u);var f=this.el.querySelectorAll(".form-completion-redirect-url")[0].value;this.model.set("completionRedirectUrl",f);var p=this.el.querySelectorAll(".form-completion-action-type")[0].value;this.model.set("completionActionType",p);var h=this.el.querySelectorAll(".form-theme")[0].value;this.model.set("theme",h)}},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&amp;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,""))
3
+ }),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 .duplicate":"triggerDuplicate","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()})})},triggerDuplicate:function(){var e=this,t=e.parent.collection.state.currentPage;e.model.clone().set("title",{raw:e.model.get("title").raw+" (Duplicate)"}).unset("id").save().done(function(){e.parent.showPage(t).done(function(){e.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.currentTarget.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&amp;width=700&amp;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);var r=document.querySelectorAll("#major-publishing-actions .duplicate")[0],a=function(e){e=e||window.event,e.preventDefault(),s.currentForm.clone().set("title",{raw:s.currentForm.get("title").raw+" (duplicate)"}).unset("id").save().done(function(e){document.location=l.adminUrl+"/post.php?action=edit&post="+e.id})};r.addEventListener?r.addEventListener("click",a,!1):r.attachEvent("onclick",a)}})}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/js/manager/models.js CHANGED
@@ -128,6 +128,7 @@
128
  title: '',
129
  content: '[all_fields]',
130
  active: true,
 
131
  addresses: new wp.ccf.collections.FormNotificationAddresses(),
132
  fromType: 'default',
133
  fromAddress: '',
128
  title: '',
129
  content: '[all_fields]',
130
  active: true,
131
+ includeUploads: true,
132
  addresses: new wp.ccf.collections.FormNotificationAddresses(),
133
  fromType: 'default',
134
  fromAddress: '',
assets/js/manager/views.js CHANGED
@@ -733,6 +733,9 @@
733
  var emailNotificationActive = this.el.querySelectorAll( '.form-email-notification-active' )[0].value;
734
  this.model.set( 'active', ( '1' === emailNotificationActive ) ? true : false );
735
 
 
 
 
736
  var emailNotificationFromType = this.el.querySelectorAll( '.form-email-notification-from-type' )[0].value;
737
  this.model.set( 'fromType', emailNotificationFromType );
738
 
733
  var emailNotificationActive = this.el.querySelectorAll( '.form-email-notification-active' )[0].value;
734
  this.model.set( 'active', ( '1' === emailNotificationActive ) ? true : false );
735
 
736
+ var emailNotificationIncludeUploads = this.el.querySelectorAll( '.form-email-notification-include-uploads' )[0].value;
737
+ this.model.set( 'includeUploads', ( '1' === emailNotificationIncludeUploads ) ? true : false );
738
+
739
  var emailNotificationFromType = this.el.querySelectorAll( '.form-email-notification-from-type' )[0].value;
740
  this.model.set( 'fromType', emailNotificationFromType );
741
 
assets/scss/form-manager.scss CHANGED
@@ -60,7 +60,7 @@
60
  left: 30px;
61
  right: 30px;
62
  bottom: 30px;
63
- z-index: 160000;
64
  overflow: hidden;
65
  background-color: #fff;
66
 
@@ -248,7 +248,7 @@
248
  font-size: 35px;
249
  cursor: pointer;
250
  color: #333;
251
- z-index: 160001;
252
  }
253
 
254
  .main-menu {
@@ -876,7 +876,7 @@
876
  left: 0px;
877
  width: 100%;
878
  height: 100%;
879
- z-index: 159900;
880
  opacity: 0.7;
881
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";
882
  filter: alpha(opacity=70);
60
  left: 30px;
61
  right: 30px;
62
  bottom: 30px;
63
+ z-index: 1600000;
64
  overflow: hidden;
65
  background-color: #fff;
66
 
248
  font-size: 35px;
249
  cursor: pointer;
250
  color: #333;
251
+ z-index: 1600001;
252
  }
253
 
254
  .main-menu {
876
  left: 0px;
877
  width: 100%;
878
  height: 100%;
879
+ z-index: 1599000;
880
  opacity: 0.7;
881
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";
882
  filter: alpha(opacity=70);
classes/class-ccf-custom-contact-forms.php CHANGED
@@ -129,7 +129,7 @@ class CCF_Custom_Contact_Forms {
129
  }
130
  }
131
 
132
- if ( function_exists( 'create_initial_rest_routes' ) ) {
133
  return;
134
  }
135
 
129
  }
130
  }
131
 
132
+ if ( function_exists( 'create_initial_rest_routes' ) || class_exists( 'WP_REST_Controller' ) ) {
133
  return;
134
  }
135
 
classes/class-ccf-form-cpt.php CHANGED
@@ -28,6 +28,7 @@ class CCF_Form_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' ) );
32
  add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
33
  add_filter( 'post_row_actions', array( $this, 'filter_post_row_actions' ), 10, 2 );
@@ -475,9 +476,16 @@ class CCF_Form_CPT {
475
  }
476
  wp_enqueue_style( 'ccf-admin', plugins_url( $admin_css_path, dirname( __FILE__ ) ), array(), CCF_VERSION );
477
 
478
- global $pagenow;
479
 
480
- if ( ( 'post.php' === $pagenow && 'ccf_form' === get_post_type() ) || ( 'post-new.php' === $pagenow && isset( $_GET['post_type'] ) && 'ccf_form' === $_GET['post_type'] ) ) {
 
 
 
 
 
 
 
481
  wp_dequeue_script( 'autosave' );
482
 
483
  add_thickbox();
@@ -592,6 +600,7 @@ class CCF_Form_CPT {
592
  'exclude_from_search' => true,
593
  'show_ui' => true,
594
  'show_in_menu' => true,
 
595
  'query_var' => false,
596
  'rewrite' => false,
597
  'capability_type' => 'post',
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( 'customize_controls_enqueue_scripts', array( $this, 'action_admin_enqueue_scripts' ) );
32
  add_action( 'edit_form_after_title', array( $this, 'action_edit_form_after_title' ) );
33
  add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
34
  add_filter( 'post_row_actions', array( $this, 'filter_post_row_actions' ), 10, 2 );
476
  }
477
  wp_enqueue_style( 'ccf-admin', plugins_url( $admin_css_path, dirname( __FILE__ ) ), array(), CCF_VERSION );
478
 
479
+ global $pagenow, $wp_customize;
480
 
481
+ $is_edit_post = (
482
+ ( 'post.php' === $pagenow && 'ccf_form' === get_post_type() )
483
+ ||
484
+ ( 'post-new.php' === $pagenow && isset( $_GET['post_type'] ) && 'ccf_form' === $_GET['post_type'] )
485
+ ||
486
+ ( ! empty( $wp_customize ) && isset( $wp_customize->posts ) )
487
+ );
488
+ if ( $is_edit_post ) {
489
  wp_dequeue_script( 'autosave' );
490
 
491
  add_thickbox();
600
  'exclude_from_search' => true,
601
  'show_ui' => true,
602
  'show_in_menu' => true,
603
+ 'show_in_customizer' => false,
604
  'query_var' => false,
605
  'rewrite' => false,
606
  'capability_type' => 'post',
classes/class-ccf-form-handler.php CHANGED
@@ -727,11 +727,15 @@ class CCF_Form_Handler {
727
  $form_page = null;
728
  }
729
 
 
 
730
  foreach ( $file_ids as $file_id ) {
731
  wp_update_post( array(
732
  'ID' => $file_id,
733
  'post_parent' => $submission_id,
734
  ) );
 
 
735
  }
736
 
737
  do_action( 'ccf_successful_submission', $submission_id, $form_id );
@@ -1077,6 +1081,8 @@ class CCF_Form_Handler {
1077
  }
1078
  }
1079
 
 
 
1080
  foreach ( $notification['addresses'] as $address ) {
1081
 
1082
  if ( ! empty( $address['email'] ) || ! empty( $address['field'] ) ) {
@@ -1106,9 +1112,15 @@ class CCF_Form_Handler {
1106
  $notification_content = apply_filters( 'ccf_email_content', $message, $form_id, $email, $form_page, $notification );
1107
  $notification_headers = apply_filters( 'ccf_email_headers', $headers, $form_id, $email, $form_page, $notification );
1108
 
1109
- do_action( 'ccf_send_notification', $email, $subject, $notification_content, $notification_headers, $notification );
 
 
 
 
 
 
1110
 
1111
- wp_mail( $email, $subject, $notification_content, $notification_headers );
1112
  }
1113
  }
1114
  }
727
  $form_page = null;
728
  }
729
 
730
+ $uploads = array();
731
+
732
  foreach ( $file_ids as $file_id ) {
733
  wp_update_post( array(
734
  'ID' => $file_id,
735
  'post_parent' => $submission_id,
736
  ) );
737
+
738
+ $uploads[] = get_attached_file( $file_id );
739
  }
740
 
741
  do_action( 'ccf_successful_submission', $submission_id, $form_id );
1081
  }
1082
  }
1083
 
1084
+ $include_uploads = $notification['includeUploads'];
1085
+
1086
  foreach ( $notification['addresses'] as $address ) {
1087
 
1088
  if ( ! empty( $address['email'] ) || ! empty( $address['field'] ) ) {
1112
  $notification_content = apply_filters( 'ccf_email_content', $message, $form_id, $email, $form_page, $notification );
1113
  $notification_headers = apply_filters( 'ccf_email_headers', $headers, $form_id, $email, $form_page, $notification );
1114
 
1115
+ if ( ! $include_uploads ) {
1116
+ $uploads = array();
1117
+ }
1118
+
1119
+ $uploads = apply_filters( 'ccf_email_uploads', $uploads, $headers, $form_id, $email, $form_page, $file_ids, $notification );
1120
+
1121
+ do_action( 'ccf_send_notification', $email, $subject, $notification_content, $notification_headers, $uploads, $notification );
1122
 
1123
+ wp_mail( $email, $subject, $notification_content, $notification_headers, $uploads );
1124
  }
1125
  }
1126
  }
classes/class-ccf-form-manager.php CHANGED
@@ -16,7 +16,9 @@ class CCF_Form_Manager {
16
  public function setup() {
17
  add_action( 'media_buttons', array( $this, 'action_media_buttons' ) );
18
  add_action( 'admin_footer', array( $this, 'print_templates' ) );
19
- add_action( 'admin_enqueue_scripts' , array( $this, 'action_admin_enqueue_scripts_css' ), 9 );
 
 
20
  add_filter( 'mce_css', array( $this, 'filter_mce_css' ) );
21
  }
22
 
@@ -42,6 +44,16 @@ class CCF_Form_Manager {
42
  return $css;
43
  }
44
 
 
 
 
 
 
 
 
 
 
 
45
  /**
46
  * Print all Backbone templates for form manager
47
  *
@@ -365,6 +377,14 @@ class CCF_Form_Manager {
365
  <select name="email_notification_from_name_field" class="form-email-notification-from-name-field" id="ccf_form_email_notification_from_name_field">
366
  </select>
367
  </p>
 
 
 
 
 
 
 
 
368
  </div>
369
  </td>
370
  <# } #>
@@ -2268,9 +2288,9 @@ class CCF_Form_Manager {
2268
  * @since 6.0
2269
  */
2270
  public function action_admin_enqueue_scripts_css() {
2271
- global $pagenow;
2272
 
2273
- if ( 'post.php' == $pagenow || 'post-new.php' == $pagenow ) {
2274
  if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
2275
  $js_manager_path = '/assets/build/js/form-manager.js';
2276
  $js_mce_path = '/assets/js/form-mce.js';
16
  public function setup() {
17
  add_action( 'media_buttons', array( $this, 'action_media_buttons' ) );
18
  add_action( 'admin_footer', array( $this, 'print_templates' ) );
19
+ add_action( 'customize_controls_print_footer_scripts', array( $this, 'customize_controls_print_footer_scripts' ) );
20
+ add_action( 'admin_enqueue_scripts', array( $this, 'action_admin_enqueue_scripts_css' ), 9 );
21
+ add_action( 'customize_controls_enqueue_scripts' , array( $this, 'action_admin_enqueue_scripts_css' ), 9 );
22
  add_filter( 'mce_css', array( $this, 'filter_mce_css' ) );
23
  }
24
 
44
  return $css;
45
  }
46
 
47
+ /**
48
+ * Print all Backbone templates for form manager in Customizer
49
+ */
50
+ public function customize_controls_print_footer_scripts() {
51
+ global $wp_customize;
52
+ if ( isset( $wp_customize->posts ) ) {
53
+ $this->print_templates();
54
+ }
55
+ }
56
+
57
  /**
58
  * Print all Backbone templates for form manager
59
  *
377
  <select name="email_notification_from_name_field" class="form-email-notification-from-name-field" id="ccf_form_email_notification_from_name_field">
378
  </select>
379
  </p>
380
+
381
+ <p>
382
+ <label for="ccf_form_email_notification_include_uploads"><?php esc_html_e( 'Include File Uploads:', 'custom-contact-forms' ); ?></label>
383
+ <select name="email_notification_include_uploads" class="form-email-notification-include-uploads" id="ccf_form_email_notification_include_uploads">
384
+ <option value="1"><?php esc_html_e( 'Yes', 'custom-contact-forms' ); ?></option>
385
+ <option value="0" <# if ( ! notification.includeUploads ) { #>selected<# } #>><?php esc_html_e( 'No', 'custom-contact-forms' ); ?></option>
386
+ </select>
387
+ </p>
388
  </div>
389
  </td>
390
  <# } #>
2288
  * @since 6.0
2289
  */
2290
  public function action_admin_enqueue_scripts_css() {
2291
+ global $pagenow, $wp_customize;
2292
 
2293
+ if ( 'post.php' == $pagenow || 'post-new.php' == $pagenow || ( ! empty( $wp_customize ) && isset( $wp_customize->posts ) ) ) {
2294
  if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
2295
  $js_manager_path = '/assets/build/js/form-manager.js';
2296
  $js_mce_path = '/assets/js/form-mce.js';
classes/class-ccf-form-renderer.php CHANGED
@@ -149,8 +149,17 @@ class CCF_Form_Renderer {
149
  * @return string
150
  */
151
  public function get_rendered_form( $form_id ) {
152
- $form = get_post( (int) $form_id );
153
-
 
 
 
 
 
 
 
 
 
154
  if ( ! $form ) {
155
  return '';
156
  }
149
  * @return string
150
  */
151
  public function get_rendered_form( $form_id ) {
152
+ if ( is_customize_preview() ) {
153
+ $form_query = new WP_Query( array(
154
+ 'post__in' => array( $form_id ),
155
+ 'post_type' => 'ccf_form',
156
+ 'ignore_sticky_posts' => true,
157
+ 'posts_per_page' => 1,
158
+ ) );
159
+ $form = array_shift( $form_query->posts );
160
+ } else {
161
+ $form = get_post( $form_id );
162
+ }
163
  if ( ! $form ) {
164
  return '';
165
  }
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.1
8
  * Text Domain: custom-contact-forms
9
  * Domain Path: /languages
10
  * Author URI: http://www.taylorlovett.com
@@ -15,7 +15,7 @@
15
  */
16
 
17
 
18
- define( 'CCF_VERSION', '7.8.1' );
19
 
20
  require_once( dirname( __FILE__ ) . '/classes/class-ccf-constants.php' );
21
  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.8.2
8
  * Text Domain: custom-contact-forms
9
  * Domain Path: /languages
10
  * Author URI: http://www.taylorlovett.com
15
  */
16
 
17
 
18
+ define( 'CCF_VERSION', '7.8.2' );
19
 
20
  require_once( dirname( __FILE__ ) . '/classes/class-ccf-constants.php' );
21
  require_once( dirname( __FILE__ ) . '/classes/class-ccf-custom-contact-forms.php' );
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: tlovett1
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HR34W94MM53RQ
4
  Tags: contact form, web form, custom contact form, custom forms, captcha form, contact fields, form mailers, forms
5
  Requires at least: 3.9
6
- Tested up to: 4.5
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -60,6 +60,11 @@ For full documentation, questions, feature requests, and support concerning the
60
 
61
  == Changelog ==
62
 
 
 
 
 
 
63
  = 7.8.1 =
64
  * Cache busy form submission URL
65
  * Improve field choice UI
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HR34W94MM53RQ
4
  Tags: contact form, web form, custom contact form, custom forms, captcha form, contact fields, form mailers, forms
5
  Requires at least: 3.9
6
+ Tested up to: 4.6
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
60
 
61
  == Changelog ==
62
 
63
+ = 7.8.2 =
64
+ * Add $submission to ccf_email_subject filter, correct "Invalid Date" issue with datepicker. Props (quayzar)[https://github.com/quayzar]
65
+ * Fix WooCommerce conflict
66
+ * Add support for Customize Posts plugin. Props (westonruter)[https://github.com/westonruter]
67
+
68
  = 7.8.1 =
69
  * Cache busy form submission URL
70
  * Improve field choice UI