Custom Contact Forms - Version 7.8

Version Description

  • Hide form title setting
  • Reply to notification fields
  • Activate form notifications by default
Download this release

Release Info

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

Code changes from version 7.7 to 7.8

assets/build/css/admin.css CHANGED
@@ -34,4 +34,18 @@
34
  margin-left: 5px;
35
  margin-right: 5px; }
36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  /*# sourceMappingURL=admin.css.map */
34
  margin-left: 5px;
35
  margin-right: 5px; }
36
 
37
+ #wpfooter .ccf-please-rate {
38
+ text-align: right;
39
+ margin-bottom: 10px; }
40
+
41
+ #wpfooter .ccf-please-rate a {
42
+ color: inherit;
43
+ text-decoration: none; }
44
+
45
+ #wpfooter .ccf-please-rate a span {
46
+ color: #0073aa; }
47
+
48
+ #wpfooter .ccf-please-rate a:hover span {
49
+ color: #00a0d2; }
50
+
51
  /*# sourceMappingURL=admin.css.map */
assets/build/css/admin.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;AAIlB,0CAAsB;EACrB,WAAW,EAAE,MAAM;EACnB,OAAO,EAAE,GAAG;EACZ,KAAK,EAAE,IAAI;EACX,WAAW,EAAE,MAAM;EACnB,YAAY,EAAE,MAAM;EACpB,cAAc,EAAE,IAAI;EACpB,WAAW,EAAE,CAAC;EACd,MAAM,EAAE,OAAO;EACf,sBAAsB,EAAE,WAAW;;AAIrC,sBAAuB;EACtB,KAAK,EAAE,IAAI;EACX,OAAO,EAAE,KAAK;EACd,UAAU,EAAE,UAAU;EACtB,MAAM,EAAE,CAAC;EACT,gBAAgB,EAAE,OAAO;;AAG1B,2BAA4B;EAC3B,OAAO,EAAE,MAAM;;AAGhB,uBAAwB;EACvB,MAAM,EAAE,OAAO;EACf,OAAO,EAAE,GAAG;;AAGb,gCAAiC;EAChC,WAAW,EAAE,GAAG;EAChB,YAAY,EAAE,GAAG",
4
  "sources": ["../../scss/admin.scss"],
5
  "names": [],
6
  "file": "admin.css"
1
  {
2
  "version": 3,
3
+ "mappings": ";AAAA,UASC;EARA,WAAW,EAAE,MAAM;EACnB,GAAG,EAAC,2BAA2B;EAC/B,GAAG,EAAC,mNAGkD;EACtD,WAAW,EAAE,MAAM;EACnB,UAAU,EAAE,MAAM;AAIlB,0CAAsB;EACrB,WAAW,EAAE,MAAM;EACnB,OAAO,EAAE,GAAG;EACZ,KAAK,EAAE,IAAI;EACX,WAAW,EAAE,MAAM;EACnB,YAAY,EAAE,MAAM;EACpB,cAAc,EAAE,IAAI;EACpB,WAAW,EAAE,CAAC;EACd,MAAM,EAAE,OAAO;EACf,sBAAsB,EAAE,WAAW;;AAIrC,sBAAuB;EACtB,KAAK,EAAE,IAAI;EACX,OAAO,EAAE,KAAK;EACd,UAAU,EAAE,UAAU;EACtB,MAAM,EAAE,CAAC;EACT,gBAAgB,EAAE,OAAO;;AAG1B,2BAA4B;EAC3B,OAAO,EAAE,MAAM;;AAGhB,uBAAwB;EACvB,MAAM,EAAE,OAAO;EACf,OAAO,EAAE,GAAG;;AAGb,gCAAiC;EAChC,WAAW,EAAE,GAAG;EAChB,YAAY,EAAE,GAAG;;AAGlB,0BAA2B;EAC1B,UAAU,EAAE,KAAK;EACjB,aAAa,EAAE,IAAI;;AAGpB,4BAA6B;EAC5B,KAAK,EAAE,OAAO;EACd,eAAe,EAAE,IAAI;;AAGtB,iCAAkC;EACjC,KAAK,EAAE,OAAO;;AAGf,uCAAwC;EACvC,KAAK,EAAE,OAAO",
4
  "sources": ["../../scss/admin.scss"],
5
  "names": [],
6
  "file": "admin.css"
assets/build/css/admin.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}#menu-posts-ccf_form .wp-menu-image:before{font-family:menu;content:"";speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;cursor:pointer;-webkit-font-smoothing:antialiased}.ccf-subscribe.updated{width:100%;display:block;box-sizing:border-box;border:0;background-color:#FCECAD}.ccf-subscribe.updated form{display:inline}.ccf-subscribe .ad-wrap{margin:.5em 0;padding:2px}.ccf-subscribe input[type=email]{margin-left:5px;margin-right:5px}
1
+ @charset "UTF-8";@font-face{font-family:menu;src:url(../../fonts/menu.eot);src:url(../../fonts/menu.eot?#iefix) format("embedded-opentype"),url(../../fonts/menu.woff) format("woff"),url(../../fonts/menu.ttf) format("truetype"),url(../../fonts/menu.svg#form-manager) format("svg");font-weight:400;font-style:normal}#menu-posts-ccf_form .wp-menu-image:before{font-family:menu;content:"";speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;cursor:pointer;-webkit-font-smoothing:antialiased}.ccf-subscribe.updated{width:100%;display:block;box-sizing:border-box;border:0;background-color:#FCECAD}.ccf-subscribe.updated form{display:inline}.ccf-subscribe .ad-wrap{margin:.5em 0;padding:2px}.ccf-subscribe input[type=email]{margin-left:5px;margin-right:5px}#wpfooter .ccf-please-rate{text-align:right;margin-bottom:10px}#wpfooter .ccf-please-rate a{color:inherit;text-decoration:none}#wpfooter .ccf-please-rate a span{color:#0073aa}#wpfooter .ccf-please-rate a:hover span{color:#00a0d2}
assets/build/js/form-manager.js CHANGED
@@ -392,7 +392,7 @@
392
  return {
393
  title: '',
394
  content: '[all_fields]',
395
- active: false,
396
  addresses: new wp.ccf.collections.FormNotificationAddresses(),
397
  fromType: 'default',
398
  fromAddress: '',
@@ -402,7 +402,16 @@
402
  subjectField: '',
403
  fromNameType: 'custom',
404
  fromName: 'WordPress',
405
- fromNameField: ''
 
 
 
 
 
 
 
 
 
406
  };
407
  },
408
 
@@ -459,6 +468,7 @@
459
  fields: new wp.ccf.collections.Fields(),
460
  type: 'ccf_form',
461
  status: 'publish',
 
462
  description: '',
463
  buttonText: 'Submit Form',
464
  buttonClass: '',
@@ -1653,6 +1663,8 @@
1653
  events: {
1654
  'change select.form-email-notification-from-type': 'toggleNotificationFields',
1655
  'change select.form-email-notification-from-name-type': 'toggleNotificationFields',
 
 
1656
  'change select.form-email-notification-subject-type': 'toggleNotificationFields',
1657
  'click .close-notification': 'changeContext',
1658
  'click .edit-notification': 'changeContext',
@@ -1744,6 +1756,10 @@
1744
  emailNotificationFromField.innerHTML = '';
1745
  emailNotificationFromField.disabled = false;
1746
 
 
 
 
 
1747
  var emailNotificationSubjectField = this.el.querySelectorAll( '.form-email-notification-subject-field' )[0];
1748
  emailNotificationSubjectField.innerHTML = '';
1749
  emailNotificationSubjectField.disabled = false;
@@ -1752,15 +1768,22 @@
1752
  emailNotificationFromNameField.innerHTML = '';
1753
  emailNotificationFromNameField.disabled = false;
1754
 
 
 
 
 
1755
  var fields = this.form.get( 'fields' ),
1756
  addressFieldsAdded = 0,
1757
  nameFieldsAdded = 0,
1758
  subjectFieldsAdded = 0;
1759
 
1760
- var addressField = this.model.get( 'emailNotificationFromField' );
1761
- var subjectField = this.model.get( 'emailNotificationSubjectField' );
1762
- var nameField = this.model.get( 'emailNotificationFromNameField' ),
1763
- option;
 
 
 
1764
 
1765
  if ( fields.length >= 1 ) {
1766
  fields.each( function( field ) {
@@ -1775,6 +1798,16 @@
1775
 
1776
  emailNotificationFromField.appendChild( option );
1777
 
 
 
 
 
 
 
 
 
 
 
1778
  addressFieldsAdded++;
1779
  } if ( 'name' === field.get( 'type' ) || 'single-line-text' === field.get( 'type' ) || 'radio' === field.get( 'type' ) || 'dropdown' === field.get( 'type' ) ) {
1780
  option = document.createElement( 'option' );
@@ -1787,6 +1820,16 @@
1787
 
1788
  emailNotificationFromNameField.appendChild( option );
1789
 
 
 
 
 
 
 
 
 
 
 
1790
  nameFieldsAdded++;
1791
  } if ( 'single-line-text' === field.get( 'type' ) || 'radio' === field.get( 'type' ) || 'dropdown' === field.get( 'type' ) ) {
1792
  // @Todo: add more applicable fields
@@ -1812,6 +1855,12 @@
1812
  option.value = '';
1813
  emailNotificationFromField.appendChild( option );
1814
  emailNotificationFromField.disabled = true;
 
 
 
 
 
 
1815
  }
1816
 
1817
  if ( 0 === nameFieldsAdded ) {
@@ -1852,6 +1901,24 @@
1852
 
1853
  var emailNotificationFromNameType = this.el.querySelectorAll( '.form-email-notification-from-name-type' )[0];
1854
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1855
  emailNotificationFromAddress.style.display = 'none';
1856
  emailNotificationFromField.style.display = 'none';
1857
 
@@ -1878,6 +1945,24 @@
1878
  } else if ( 'field' === emailNotificationFromNameType.value ) {
1879
  emailNotificationFromNameField.style.display = 'block';
1880
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1881
  },
1882
 
1883
  save: function() {
@@ -1917,6 +2002,24 @@
1917
  var emailNotificationFromNameField = this.el.querySelectorAll( '.form-email-notification-from-name-field' )[0].value;
1918
  this.model.set( 'fromNameField', emailNotificationFromNameField );
1919
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1920
  var emailNotificationSubjectType = this.el.querySelectorAll( '.form-email-notification-subject-type' )[0].value;
1921
  this.model.set( 'subjectType', emailNotificationSubjectType );
1922
 
@@ -3079,6 +3182,9 @@
3079
  var title = this.el.querySelectorAll( '.form-title' )[0].value;
3080
  this.model.set( 'title', { raw: title } );
3081
 
 
 
 
3082
  var description = this.el.querySelectorAll( '.form-description' )[0].value;
3083
  this.model.set( 'description', description );
3084
 
392
  return {
393
  title: '',
394
  content: '[all_fields]',
395
+ active: true,
396
  addresses: new wp.ccf.collections.FormNotificationAddresses(),
397
  fromType: 'default',
398
  fromAddress: '',
402
  subjectField: '',
403
  fromNameType: 'custom',
404
  fromName: 'WordPress',
405
+ fromNameField: '',
406
+
407
+ replyToType: 'default',
408
+ replyToAddress: '',
409
+ replyToField: '',
410
+
411
+
412
+ replyToNameType: 'custom',
413
+ replyToName: 'WordPress',
414
+ replyToNameField: ''
415
  };
416
  },
417
 
468
  fields: new wp.ccf.collections.Fields(),
469
  type: 'ccf_form',
470
  status: 'publish',
471
+ hideTitle: false,
472
  description: '',
473
  buttonText: 'Submit Form',
474
  buttonClass: '',
1663
  events: {
1664
  'change select.form-email-notification-from-type': 'toggleNotificationFields',
1665
  'change select.form-email-notification-from-name-type': 'toggleNotificationFields',
1666
+ 'change select.form-email-notification-reply-to-type': 'toggleNotificationFields',
1667
+ 'change select.form-email-notification-reply-to-name-type': 'toggleNotificationFields',
1668
  'change select.form-email-notification-subject-type': 'toggleNotificationFields',
1669
  'click .close-notification': 'changeContext',
1670
  'click .edit-notification': 'changeContext',
1756
  emailNotificationFromField.innerHTML = '';
1757
  emailNotificationFromField.disabled = false;
1758
 
1759
+ var emailNotificationReplyToField = this.el.querySelectorAll( '.form-email-notification-reply-to-field' )[0];
1760
+ emailNotificationReplyToField.innerHTML = '';
1761
+ emailNotificationReplyToField.disabled = false;
1762
+
1763
  var emailNotificationSubjectField = this.el.querySelectorAll( '.form-email-notification-subject-field' )[0];
1764
  emailNotificationSubjectField.innerHTML = '';
1765
  emailNotificationSubjectField.disabled = false;
1768
  emailNotificationFromNameField.innerHTML = '';
1769
  emailNotificationFromNameField.disabled = false;
1770
 
1771
+ var emailNotificationReplyToNameField = this.el.querySelectorAll( '.form-email-notification-reply-to-name-field' )[0];
1772
+ emailNotificationReplyToNameField.innerHTML = '';
1773
+ emailNotificationReplyToNameField.disabled = false;
1774
+
1775
  var fields = this.form.get( 'fields' ),
1776
  addressFieldsAdded = 0,
1777
  nameFieldsAdded = 0,
1778
  subjectFieldsAdded = 0;
1779
 
1780
+ var addressField = this.model.get( 'fromField' );
1781
+ var replyToAddressField = this.model.get( 'replyToField' );
1782
+ var subjectField = this.model.get( 'subjectField' );
1783
+ var nameField = this.model.get( 'fromNameField' ),
1784
+ replyToNameField = this.model.get( 'replyToNameField' ),
1785
+ option,
1786
+ replyToOption;
1787
 
1788
  if ( fields.length >= 1 ) {
1789
  fields.each( function( field ) {
1798
 
1799
  emailNotificationFromField.appendChild( option );
1800
 
1801
+ replyToOption = document.createElement( 'option' );
1802
+ replyToOption.innerHTML = field.get( 'slug' );
1803
+ replyToOption.value = field.get( 'slug' );
1804
+
1805
+ if ( field.get( 'slug' ) === replyToAddressField ) {
1806
+ replyToOption.selected = true;
1807
+ }
1808
+
1809
+ emailNotificationReplyToField.appendChild( replyToOption );
1810
+
1811
  addressFieldsAdded++;
1812
  } if ( 'name' === field.get( 'type' ) || 'single-line-text' === field.get( 'type' ) || 'radio' === field.get( 'type' ) || 'dropdown' === field.get( 'type' ) ) {
1813
  option = document.createElement( 'option' );
1820
 
1821
  emailNotificationFromNameField.appendChild( option );
1822
 
1823
+ replyToOption = document.createElement( 'option' );
1824
+ replyToOption.innerHTML = field.get( 'slug' );
1825
+ replyToOption.value = field.get( 'slug' );
1826
+
1827
+ if ( field.get( 'slug' ) === replyToNameField ) {
1828
+ replyToOption.selected = true;
1829
+ }
1830
+
1831
+ emailNotificationReplyToNameField.appendChild( replyToOption );
1832
+
1833
  nameFieldsAdded++;
1834
  } if ( 'single-line-text' === field.get( 'type' ) || 'radio' === field.get( 'type' ) || 'dropdown' === field.get( 'type' ) ) {
1835
  // @Todo: add more applicable fields
1855
  option.value = '';
1856
  emailNotificationFromField.appendChild( option );
1857
  emailNotificationFromField.disabled = true;
1858
+
1859
+ option = document.createElement( 'option' );
1860
+ option.innerHTML = ccfSettings.noEmailFields;
1861
+ option.value = '';
1862
+ emailNotificationReplyToField.appendChild( option );
1863
+ emailNotificationReplyToField.disabled = true;
1864
  }
1865
 
1866
  if ( 0 === nameFieldsAdded ) {
1901
 
1902
  var emailNotificationFromNameType = this.el.querySelectorAll( '.form-email-notification-from-name-type' )[0];
1903
 
1904
+
1905
+
1906
+ var emailNotificationReplyToAddress = this.el.querySelectorAll( '.email-notification-reply-to-address' )[0];
1907
+
1908
+ var emailNotificationReplyToField = this.el.querySelectorAll( '.email-notification-reply-to-field' )[0];
1909
+
1910
+ var emailNotificationReplyToType = this.el.querySelectorAll( '.form-email-notification-reply-to-type' )[0];
1911
+
1912
+ var emailNotificationReplyToName = this.el.querySelectorAll( '.email-notification-reply-to-name' )[0];
1913
+
1914
+ var emailNotificationReplyToNameField = this.el.querySelectorAll( '.email-notification-reply-to-name-field' )[0];
1915
+
1916
+ var emailNotificationReplyToNameType = this.el.querySelectorAll( '.form-email-notification-reply-to-name-type' )[0];
1917
+
1918
+
1919
+
1920
+
1921
+
1922
  emailNotificationFromAddress.style.display = 'none';
1923
  emailNotificationFromField.style.display = 'none';
1924
 
1945
  } else if ( 'field' === emailNotificationFromNameType.value ) {
1946
  emailNotificationFromNameField.style.display = 'block';
1947
  }
1948
+
1949
+ emailNotificationReplyToAddress.style.display = 'none';
1950
+ emailNotificationReplyToField.style.display = 'none';
1951
+
1952
+ if ( 'custom' === emailNotificationReplyToType.value ) {
1953
+ emailNotificationReplyToAddress.style.display = 'block';
1954
+ } else if ( 'field' === emailNotificationReplyToType.value ) {
1955
+ emailNotificationReplyToField.style.display = 'block';
1956
+ }
1957
+
1958
+ emailNotificationReplyToName.style.display = 'none';
1959
+ emailNotificationReplyToNameField.style.display = 'none';
1960
+
1961
+ if ( 'custom' === emailNotificationReplyToNameType.value ) {
1962
+ emailNotificationReplyToName.style.display = 'block';
1963
+ } else if ( 'field' === emailNotificationReplyToNameType.value ) {
1964
+ emailNotificationReplyToNameField.style.display = 'block';
1965
+ }
1966
  },
1967
 
1968
  save: function() {
2002
  var emailNotificationFromNameField = this.el.querySelectorAll( '.form-email-notification-from-name-field' )[0].value;
2003
  this.model.set( 'fromNameField', emailNotificationFromNameField );
2004
 
2005
+ var emailNotificationReplyToType = this.el.querySelectorAll( '.form-email-notification-reply-to-type' )[0].value;
2006
+ this.model.set( 'replyToType', emailNotificationReplyToType );
2007
+
2008
+ var emailNotificationReplyToAddress = this.el.querySelectorAll( '.form-email-notification-reply-to-address' )[0].value;
2009
+ this.model.set( 'replyToAddress', emailNotificationReplyToAddress );
2010
+
2011
+ var emailNotificationReplyToField = this.el.querySelectorAll( '.form-email-notification-reply-to-field' )[0].value;
2012
+ this.model.set( 'replyToField', emailNotificationReplyToField );
2013
+
2014
+ var emailNotificationReplyToNameType = this.el.querySelectorAll( '.form-email-notification-reply-to-name-type' )[0].value;
2015
+ this.model.set( 'replyToNameType', emailNotificationReplyToNameType );
2016
+
2017
+ var emailNotificationReplyToName = this.el.querySelectorAll( '.form-email-notification-reply-to-name' )[0].value;
2018
+ this.model.set( 'replyToName', emailNotificationReplyToName );
2019
+
2020
+ var emailNotificationReplyToNameField = this.el.querySelectorAll( '.form-email-notification-reply-to-name-field' )[0].value;
2021
+ this.model.set( 'replyToNameField', emailNotificationReplyToNameField );
2022
+
2023
  var emailNotificationSubjectType = this.el.querySelectorAll( '.form-email-notification-subject-type' )[0].value;
2024
  this.model.set( 'subjectType', emailNotificationSubjectType );
2025
 
3182
  var title = this.el.querySelectorAll( '.form-title' )[0].value;
3183
  this.model.set( 'title', { raw: title } );
3184
 
3185
+ var hideTitle = this.el.querySelectorAll( '.hide-title' )[0].value;
3186
+ this.model.set( 'hideTitle', ( parseInt( hideTitle ) ) ? true : false );
3187
+
3188
  var description = this.el.querySelectorAll( '.form-description' )[0].value;
3189
  this.model.set( 'description', description );
3190
 
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:!1,addresses:new wp.ccf.collections.FormNotificationAddresses,fromType:"default",fromAddress:"",fromField:"",subjectType:"default",subject:"",subjectField:"",fromNameType:"custom",fromName:"WordPress",fromNameField:""}},initialize:function(e){if("object"==typeof e&&e.addresses){var t=[];i.each(e.addresses,function(e){var i=new wp.ccf.models.FormNotificationAddress(e);i.decode(),t.push(i)}),this.set("addresses",new wp.ccf.collections.FormNotificationAddresses(t))}},decode:function(){return n.call(this,[])},toJSON:function(){var e=this.constructor.__super__.toJSON.call(this);return e.addresses&&(e.addresses=e.addresses.toJSON()),e},set:s}),wp.ccf.models.Form=wp.ccf.models.Form||wp.api.models.Post.extend({urlRoot:l.apiRoot.replace(/\/$/,"")+"/ccf/v1/forms",set:s,sync:o,idAttribute:"id",initialize:function(){this.on("sync",this.decode,this)},defaults:function(){var e={fields:new wp.ccf.collections.Fields,type:"ccf_form",status:"publish",description:"",buttonText:"Submit Form",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};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(e){if("object"==typeof e&&e.choices){var t=[];i.each(e.choices,function(e){var i=new wp.ccf.models.FieldChoice(e);i.decode(),t.push(i)}),this.set("choices",new wp.ccf.collections.FieldChoices(t))}return wp.ccf.models.ChoiceableField.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.radio=wp.ccf.models.Fields.radio||wp.ccf.models.ChoiceableField.extend({defaults:function(){var e={type:"radio"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.checkboxes=wp.ccf.models.Fields.checkboxes||wp.ccf.models.ChoiceableField.extend({defaults:function(){var e={type:"checkboxes"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.dropdown=wp.ccf.models.Fields.dropdown||wp.ccf.models.ChoiceableField.extend({defaults:function(){var e={type:"dropdown"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}})}(jQuery,Backbone,_,ccfSettings),function(e,t,i,l){"use strict";var s=function(e,t,i){return i=i||{},i.emulateHTTP=!0,this.constructor.__super__.sync.call(this,e,t,i)};wp.ccf.collections=wp.ccf.collections||{},wp.ccf.collections.Forms=wp.ccf.collections.Forms||wp.api.collections.Posts.extend({model:wp.ccf.models.Form,url:l.apiRoot.replace(/\/$/,"")+"/ccf/v1/forms",formsFetching:{},initialize:function(){this.constructor.__super__.initialize(),this.formsFetching={}},sync:s,remove:function(e,t){t=t||{};var l=this.constructor.__super__.remove.call(this,e,t);return t.destroy&&(e instanceof Array?i.each(e,function(e){e.destroy()}):e.destroy()),l}}),wp.ccf.collections.Fields=wp.ccf.collections.Fields||wp.api.collections.Posts.extend({model:wp.ccf.models.Field,url:function(){return l.apiRoot+"/ccf/forms/"+this.formId+"/fields"},initialize:function(e,t){t&&t.formId&&(this.formId=t.formId)},sync:s}),wp.ccf.collections.PostFieldMappings=wp.ccf.collections.PostFieldMappings||t.Collection.extend({model:wp.ccf.models.PostFieldMapping}),wp.ccf.collections.FormNotificationAddresses=wp.ccf.collections.FormNotificationAddresses||t.Collection.extend({model:wp.ccf.models.FormNotificationAddress}),wp.ccf.collections.FormNotifications=wp.ccf.collections.FormNotifications||t.Collection.extend({model:wp.ccf.models.FormNotification}),wp.ccf.collections.Submissions=wp.ccf.collections.Submissions||wp.api.collections.Posts.extend({model:wp.ccf.models.Submission,url:function(){return l.apiRoot.replace(/\/$/,"")+"/ccf/v1/forms/"+this.formId+"/submissions"},initialize:function(e,t){this.constructor.__super__.initialize.apply(this,arguments),t&&t.formId&&(this.formId=t.formId)},sync:s}),wp.ccf.collections.FieldChoices=wp.ccf.collections.FieldChoices||t.Collection.extend({model:wp.ccf.models.FieldChoice}),wp.ccf.collections.FieldConditionals=wp.ccf.collections.FieldConditionals||t.Collection.extend({model:wp.ccf.models.FieldConditional})}(jQuery,Backbone,_,ccfSettings),function(e,t,i,l){"use strict";wp.ccf.views=wp.ccf.views||{},wp.ccf.views.Fields=wp.ccf.views.Fields||{},wp.ccf.views.FieldChoice=t.View.extend({template:wp.ccf.utils.template("ccf-field-choice-template"),className:"choice",events:{"click .add":"triggerAdd","click .delete":"triggerDelete",saveChoice:"saveChoice",sorted:"triggerUpdateSort"},initialize:function(e){this.field=e.field},destroy:function(){wp.ccf.dispatcher.off("mainViewChange",this.saveChoice),this.unbind()},triggerUpdateSort:function(e,t){this.field.get("choices").remove(this.model,{silent:!0}),this.field.get("choices").add(this.model,{at:t,silent:!0})},saveChoice:function(){if(""!==this.el.innerHTML){var e=this.el.querySelectorAll(".choice-label")[0].value,t=this.el.querySelectorAll(".choice-value")[0].value;this.model.set("label",e),this.model.set("value",t);var i=this.el.querySelectorAll(".choice-selected")[0],l=i.checked?!0:!1;return this.model.set("selected",l),this}},render:function(){var e={};return this.model&&(e.choice=this.model.toJSON()),this.el.innerHTML=this.template(e),wp.ccf.dispatcher.on("mainViewChange",this.saveChoice,this),this},triggerAdd:function(){this.field.get("choices").add(new wp.ccf.models.FieldChoice)},triggerDelete:function(){var e=this.field.get("choices");if(e.length>1)e.remove(this.model),this.destroy(),this.remove();else{for(var t=this.el.querySelectorAll(".choice-label, .choice-value"),i=this.el.querySelectorAll(".choice-selected"),l=0;t.length>l;l++)t[l].value="";i[0].checked=!1}}}),wp.ccf.views.FieldConditional=t.View.extend({template:wp.ccf.utils.template("ccf-field-conditional-template"),className:"conditional",events:{"click .add":"triggerAdd","click .delete":"triggerDelete",saveConditional:"saveConditional"},initialize:function(e){this.field=e.field,this.fieldCollection=e.fieldCollection},destroy:function(){wp.ccf.dispatcher.off("mainViewChange",this.saveConditional),this.unbind()},saveConditional:function(){if(""!==this.el.innerHTML){var e=this.el.querySelectorAll(".conditional-field")[0].value,t=this.el.querySelectorAll(".conditional-value")[0].value,i=this.el.querySelectorAll(".conditional-compare")[0].value;return this.model.set("field",e),this.model.set("value",t),this.model.set("compare",i),this}},updateFields:function(){var e=this.el.querySelectorAll(".conditional-field")[0];e.innerHTML="",e.disabled=!1;var t,i=0,s=this.model.get("field");this.fieldCollection.length>=1&&(t=document.createElement("option"),t.innerHTML=l.chooseFormField,t.value="",e.appendChild(t),this.fieldCollection.each(function(l){if(this.field.get("slug")!==l.get("slug")){var o=l.get("type");"address"!==o&&"checkboxes"!==o&&"date"!==o&&"name"!==o&&"file"!==o&&"recaptcha"!==o&&"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-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-subject-field")[0];t.innerHTML="",t.disabled=!1;var i=this.el.querySelectorAll(".form-email-notification-from-name-field")[0];i.innerHTML="",i.disabled=!1;var s,o=this.form.get("fields"),n=0,c=0,r=0,a=this.model.get("emailNotificationFromField"),d=this.model.get("emailNotificationSubjectField"),u=this.model.get("emailNotificationFromNameField");o.length>=1&&o.each(function(l){("email"===l.get("type")||"dropdown"===l.get("type")||"radio"===l.get("type")||"single-line-text"===l.get("type"))&&(s=document.createElement("option"),s.innerHTML=l.get("slug"),s.value=l.get("slug"),l.get("slug")===a&&(s.selected=!0),e.appendChild(s),n++),("name"===l.get("type")||"single-line-text"===l.get("type")||"radio"===l.get("type")||"dropdown"===l.get("type"))&&(s=document.createElement("option"),s.innerHTML=l.get("slug"),s.value=l.get("slug"),l.get("slug")===u&&(s.selected=!0),i.appendChild(s),c++),("single-line-text"===l.get("type")||"radio"===l.get("type")||"dropdown"===l.get("type"))&&(s=document.createElement("option"),s.innerHTML=l.get("slug"),s.value=l.get("slug"),l.get("slug")===d&&(s.selected=!0),t.appendChild(s),r++)}),0===n&&(s=document.createElement("option"),s.innerHTML=l.noEmailFields,s.value="",e.appendChild(s),e.disabled=!0),0===c&&(s=document.createElement("option"),s.innerHTML=l.noNameFields,s.value="",i.appendChild(s),i.disabled=!0),0===r&&(s=document.createElement("option"),s.innerHTML=l.noApplicableFields,s.value="",t.appendChild(s),t.disabled=!0)}},toggleNotificationFields:function(){var e=this.el.querySelectorAll(".email-notification-from-address")[0],t=this.el.querySelectorAll(".email-notification-from-field")[0],i=this.el.querySelectorAll(".form-email-notification-from-type")[0],l=this.el.querySelectorAll(".email-notification-subject")[0],s=this.el.querySelectorAll(".email-notification-subject-field")[0],o=this.el.querySelectorAll(".form-email-notification-subject-type")[0],n=this.el.querySelectorAll(".email-notification-from-name")[0],c=this.el.querySelectorAll(".email-notification-from-name-field")[0],r=this.el.querySelectorAll(".form-email-notification-from-name-type")[0];e.style.display="none",t.style.display="none","custom"===i.value?e.style.display="block":"field"===i.value&&(t.style.display="block"),l.style.display="none",s.style.display="none","custom"===o.value?l.style.display="block":"field"===o.value&&(s.style.display="block"),n.style.display="none",c.style.display="none","custom"===r.value?n.style.display="block":"field"===r.value&&(c.style.display="block")},save:function(){if(""!==this.el.innerHTML&&"edit"===this.context){var e=this.el.querySelectorAll(".form-email-notification-title")[0].value;this.model.set("title",e);var t=this.el.querySelectorAll(".form-email-notification-content")[0].value;this.model.set("content",t);var i=this.el.querySelectorAll(".form-email-notification-active")[0].value;this.model.set("active","1"===i?!0:!1);var l=this.el.querySelectorAll(".form-email-notification-from-type")[0].value;this.model.set("fromType",l);var s=this.el.querySelectorAll(".form-email-notification-from-address")[0].value;this.model.set("fromAddress",s);var o=this.el.querySelectorAll(".form-email-notification-from-field")[0].value;this.model.set("fromField",o);var n=this.el.querySelectorAll(".form-email-notification-from-name-type")[0].value;this.model.set("fromNameType",n);var c=this.el.querySelectorAll(".form-email-notification-from-name")[0].value;this.model.set("fromName",c);var r=this.el.querySelectorAll(".form-email-notification-from-name-field")[0].value;this.model.set("fromNameField",r);var a=this.el.querySelectorAll(".form-email-notification-subject-type")[0].value;this.model.set("subjectType",a);var d=this.el.querySelectorAll(".form-email-notification-subject")[0].value;this.model.set("subject",d);var u=this.el.querySelectorAll(".form-email-notification-subject-field")[0].value;this.model.set("subjectField",u);for(var f=0;this.addressViews.length>f;f++)this.addressViews[f].save();return this}},render:function(){var e={context:this.context,form:this.form.toJSON()};if(this.model&&(e.notification=this.model.toJSON()),this.el.innerHTML=this.template(e),"edit"===this.context){this.toggleNotificationFields(),this.updateFromFieldField(),this.updateFieldVariables();var t=this.el.querySelectorAll(".addresses")[0],i=this.model.get("addresses");if(i.length>=1)i.each(function(e){var i=new wp.ccf.views.FormNotificationAddress({model:e,parent:this,notification:this.model,form:this.form}).render();t.appendChild(i.el),this.addressViews.push(i)},this);else{var l=new wp.ccf.models.FormNotificationAddress;i.add(l)}}var s=this.form.get("fields");return this.listenTo(s,"add",this.updateFromFieldField,this),this.listenTo(s,"remove",this.updateFromFieldField,this),this.listenTo(s,"add",this.updateFieldVariables,this),this.listenTo(s,"remove",this.updateFieldVariables,this),this},triggerDelete:function(){this.parent.deleteNotification(this)}}),wp.ccf.views.FieldBase=wp.ccf.views.FieldBase||t.View.extend({events:{"blur input":"saveField","blur input.field-slug":"checkSlug","blur textarea":"saveField","change select":"saveField",'change input[type="checkbox"]':"saveField"},initialize:function(){var e=this.model.get("conditionals");this.listenTo(e,"add",this.addConditional)
2
- },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(){if(""!==this.el.innerHTML){this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),wp.ccf.views.ChoiceableField.__super__.saveField.apply(this,arguments);var t=this.el.querySelectorAll(".repeatable-choices")[0].querySelectorAll(".choice");return i.each(t,function(t){e(t).trigger("saveChoice")}),this}},render:function(t){var i=this;t=t?t:"basic",i.el.innerHTML=i.template({field:i.model.toJSON(),startPanel:t}),i.checkSlug();var l=i.model.get("choices"),s=this.el.querySelectorAll(".repeatable-choices")[0];if(l.length>=1)l.each(function(e){var t=new wp.ccf.views.FieldChoice({model:e,field:i.model}).render();s.appendChild(t.el)});else{var o=new wp.ccf.models.FieldChoice;l.add(o)}s=this.el.querySelectorAll(".repeatable-choices")[0],e(s).sortable({handle:".move",axis:"y",stop:function(e,t){t.item.trigger("sorted",t.item.index())}});var n=this.model.get("conditionals"),c=this.el.querySelectorAll(".conditionals")[0];if(n.length>=1)n.each(function(e){var t=new wp.ccf.views.FieldConditional({model:e,field:this.model,fieldCollection:this.collection}).render();c.appendChild(t.el)},this);else{var r=new wp.ccf.models.FieldConditional;n.add(r)}return i}}),wp.ccf.views.Fields.dropdown=wp.ccf.views.Fields.dropdown||wp.ccf.views.ChoiceableField.extend({template:wp.ccf.utils.template("ccf-dropdown-template"),events:function(){return this.constructor.__super__.events}}),wp.ccf.views.Fields.radio=wp.ccf.views.Fields.radio||wp.ccf.views.ChoiceableField.extend({template:wp.ccf.utils.template("ccf-radio-template"),events:function(){return this.constructor.__super__.events}}),wp.ccf.views.Fields.checkboxes=wp.ccf.views.Fields.checkboxes||wp.ccf.views.ChoiceableField.extend({template:wp.ccf.utils.template("ccf-checkboxes-template"),events:function(){return this.constructor.__super__.events}}),wp.ccf.views.FieldSidebar=wp.ccf.views.FieldSidebar||t.View.extend({initialize:function(e){this.currentFieldView=null,this.form=e.form},save:function(e){this.currentFieldView&&""!==this.currentFieldView.el.innerHTML&&this.currentFieldView.saveField(),e&&e instanceof Object&&e.resolve()},fieldRemoved:function(){this.currentFieldView&&(this.form.get("fields").get(this.currentFieldView.model)||this.render())},destroy:function(){wp.ccf.dispatcher.off("saveField",this.save),wp.ccf.dispatcher.off("mainViewChange",this.save),this.unbind()},render:function(e){var t={};if(e){var i=e.get("type");this.currentFieldView&&(this.currentFieldView.saveField(),this.currentFieldView.destroy&&this.currentFieldView.destroy()),this.currentFieldView=new wp.ccf.views.Fields[i]({model:e,collection:this.form.get("fields")}),this.currentFieldView.render(),this.el.innerHTML="",this.el.appendChild(this.currentFieldView.el);var l=this.form.get("fields");this.listenTo(l,"remove",this.fieldRemoved)}else{var s=wp.ccf.utils.template("ccf-empty-field-template");this.el.innerHTML=s(t)}return wp.ccf.dispatcher.on("saveField",this.save,this),wp.ccf.dispatcher.on("mainViewChange",this.save,this),this}}),wp.ccf.views.FieldRowPlaceholder=wp.ccf.views.FieldRowPlaceholder||t.View.extend({template:wp.ccf.utils.template("ccf-field-row-template"),tagName:"div",className:"field",initialize:function(e){this.type=e.type},render:function(){return this.el.innerHTML=this.template({label:l.allLabels[this.type]}),this.el.setAttribute("data-field-type",this.type),this.el.className+=" "+this.type,this}}),wp.ccf.views.FieldRow=wp.ccf.views.FieldRow||t.View.extend({template:wp.ccf.utils.template("ccf-field-row-template"),tagName:"div",className:"field",events:{"click .delete":"triggerDelete","click h4":"triggerEdit",sorted:"triggerUpdateSort"},initialize:function(e){i.bindAll(this,"triggerDelete"),this.form=e.form,this.listenTo(this.model,"change",this.handleChange,this),this.listenTo(this.model,"requirementsNotMet",this.requirementsNotMet,this),this.listenTo(this.model,"requirementsMet",this.requirementsMet,this),this.listenTo(this.model,"duplicateSlug",this.duplicateSlug,this),this.model.attributes.choices&&this.listenTo(this.model.attributes.choices,"change",this.handleChange,this)},duplicateSlug:function(){this.requirementsMet(),this.el.className+=" field-duplicate-slug"},requirementsNotMet:function(){this.requirementsMet(),this.el.className+=" field-incomplete"},requirementsMet:function(){this.el.className=this.el.className.replace(/(field-incomplete|field-duplicate-slug)/i,"")},triggerUpdateSort:function(e,t){this.form.get("fields").remove(this.model),this.form.get("fields").add(this.model,{at:t})},handleChange:function(){this.render()},triggerDelete:function(e){e.stopPropagation(),this.form.get("fields").remove(this.model),this.undelegateEvents(),this.remove()},triggerEdit:function(){var e=this.el.parentNode.querySelectorAll(".ccf-editing");i.each(e,function(e){e.className=e.className.replace(/ccf-editing/i,"")}),this.el.className=this.el.className.replace(/ccf-editing/i,"")+" ccf-editing",wp.ccf.dispatcher.trigger("openEditField",this.model)},render:function(e){this.el.innerHTML=this.template({label:l.allLabels[this.model.get("type")]}),this.el.setAttribute("data-field-type",this.model.get("type"));var t=RegExp(" "+this.model.get("type"),"i");this.el.className=this.el.className.replace(t,"")+" "+this.model.get("type"),e&&(this.el.className=this.el.className.replace(/ instantiated/i,"")+" instantiated");var i=document.getElementById("ccf-"+this.model.get("type")+"-preview-template");if(i){var s=this.el.querySelectorAll(".preview")[0];s.style.display="block",s.innerHTML=wp.ccf.utils.template("ccf-"+this.model.get("type")+"-preview-template")({field:this.model.toJSON()})}return this}}),wp.ccf.views.PostFieldMapping=t.View.extend({template:wp.ccf.utils.template("ccf-post-field-mapping"),className:"field-mapping",events:{"click .add":"triggerAdd","click .delete":"triggerDelete","blur input":"save","change select":"save"},initialize:function(e){this.parent=e.parent,this.form=e.form},destroy:function(){this.unbind()},save:function(){if(""!==this.el.innerHTML){var e=this.el.querySelectorAll(".field-form-field")[0].value,t=this.el.querySelectorAll(".field-post-field")[0].value,i=this.el.querySelectorAll(".field-custom-field-key"),l=this.model.get("postField");return this.model.set("formField",e),this.model.set("postField",t),i.length&&this.model.set("customFieldKey",i[0].value),l!==t&&this.render(),this}},updateFormFieldField:function(){var e=this.el.querySelectorAll(".field-form-field")[0];e.innerHTML="",e.disabled=!1;var t,i=this.form.get("fields"),s=0,o=this.model.get("formField");i.length>=1&&(t=document.createElement("option"),t.innerHTML=l.chooseFormField,t.value="",e.appendChild(t),i.each(function(i){t=document.createElement("option"),t.innerHTML=i.get("slug"),t.value=i.get("slug"),i.get("slug")===o&&(t.selected=!0),e.appendChild(t),s++})),0===s&&(t=document.createElement("option"),t.innerHTML=l.noAvailableFields,t.value="",e.appendChild(t),e.disabled=!0)},updatePostFields:function(){var e,t=this.el.querySelectorAll(".field-post-field")[0];e=document.createElement("option"),e.value="",e.innerText=l.choosePostField,t.appendChild(e);var s=this.form.get("postFieldMappings"),o=[];s.each(function(e){e!==this.model&&o.push(e.get("postField"))},this),i.each(l.postFields.single,function(i,l){-1===o.indexOf(l)&&(e=document.createElement("option"),e.value=l,e.innerText=i,this.model.get("postField")===l&&(e.selected=!0),t.appendChild(e))},this),i.each(l.postFields.repeatable,function(i,l){e=document.createElement("option"),e.value=l,e.innerText=i,this.model.get("postField")===l&&(e.selected=!0),t.appendChild(e)},this)},render:function(){var e={};this.model&&(e.mapping=this.model.toJSON()),this.el.innerHTML=this.template(e);var t=this.form.get("fields");return this.listenTo(t,"add",this.updateFormFieldField,this),this.listenTo(t,"remove",this.updateFormFieldField,this),this.updateFormFieldField(),this.updatePostFields(),this},triggerAdd:function(){this.form.get("postFieldMappings").add(new wp.ccf.models.PostFieldMapping)},triggerDelete:function(){var e=this.form.get("postFieldMappings");e.length>1?this.parent.deletePostFieldMapping(this):(this.model.clear().set(wp.ccf.models.PostFieldMapping.prototype.defaults),this.destroy(),this.render())}}),wp.ccf.views.FormSettings=wp.ccf.views.FormSettings||t.View.extend({template:wp.ccf.utils.template("ccf-form-settings-template"),events:{"blur input":"save","change select":"save","change select.form-completion-action-type":"toggleCompletionFields","change select.form-pause":"togglePauseFields","change select.form-post-creation":"togglePostCreationFields","click .add-notification":"triggerAddNotification"},notificationViews:[],mappingViews:[],initialize:function(e){this.model=e.form,this.notificationViews=[],this.mappingViews=[];var t=this.model.get("notifications");this.listenTo(t,"add",this.addNotification);var i=this.model.get("postFieldMappings");this.listenTo(i,"add",this.addPostFieldMapping)},deletePostFieldMapping:function(e){i.each(this.mappingViews,function(t){if(e.cid===t.cid){var l=i.indexOf(this.mappingViews,t);this.model.get("postFieldMappings").remove(e.model),this.mappingViews[l].remove(),this.mappingViews.splice(l,1)}},this)},addPostFieldMapping:function(e){var t=this.el.querySelectorAll(".post-creation-mapping")[0],i=new wp.ccf.views.PostFieldMapping({model:e,parent:this,form:this.model});this.mappingViews.push(i),t.appendChild(i.render().el)},triggerAddNotification:function(){var e=this.model.get("notifications");e.add(new wp.ccf.models.FormNotification)},closeAllNotifications:function(){i.each(this.notificationViews,function(e){e.changeContext(null,"view")})},addNotification:function(e){var t=new wp.ccf.views.ExistingFormNotificationRow({model:e,form:this.model,context:"edit",parent:this}).render(),l=this.el.querySelectorAll(".ccf-form-notifications .rows")[0];l.querySelectorAll(".no-notifications").length>0&&l.removeChild(l.firstChild),i.each(this.notificationViews,function(e){e.changeContext(null,"view")}),this.notificationViews.push(t),l.appendChild(t.el)},toggleCompletionFields:function(){var e=this.el.querySelectorAll(".form-completion-action-type")[0].value,t=this.el.querySelectorAll(".completion-message")[0],i=this.el.querySelectorAll(".completion-redirect-url")[0];"text"===e?(t.style.display="block",i.style.display="none"):(t.style.display="none",i.style.display="block")},togglePauseFields:function(){var e=this.el.querySelectorAll(".form-pause")[0].value,t=this.el.querySelectorAll(".pause-message")[0];t.style.display=parseInt(e)?"block":"none"},togglePostCreationFields:function(){var t=this.el.querySelectorAll(".form-post-creation")[0].value,i=e(this.el.querySelectorAll(".post-creation-mapping-field"));parseInt(t)?i.show():i.hide()},save:function(){if(""!==this.el.innerHTML){var e=this.el.querySelectorAll(".form-title")[0].value;this.model.set("title",{raw:e});var t=this.el.querySelectorAll(".form-description")[0].value;this.model.set("description",t);var i=this.el.querySelectorAll(".form-button-text")[0].value;this.model.set("buttonText",i);var l=this.el.querySelectorAll(".form-button-class")[0].value;this.model.set("buttonClass",l);var s=this.el.querySelectorAll(".form-pause")[0].value;this.model.set("pause",parseInt(s)?!0:!1);var o=this.el.querySelectorAll(".form-require-logged-in")[0].value;this.model.set("requireLoggedIn",parseInt(o)?!0:!1);var n=this.el.querySelectorAll(".form-post-creation")[0].value;this.model.set("postCreation",parseInt(n)?!0:!1);var c=this.el.querySelectorAll(".form-post-creation-type")[0].value;this.model.set("postCreationType",c);var r=this.el.querySelectorAll(".form-post-creation-status")[0].value;this.model.set("postCreationStatus",r);var a=this.el.querySelectorAll(".form-pause-message")[0].value;this.model.set("pauseMessage",a);var d=this.el.querySelectorAll(".form-completion-message")[0].value;this.model.set("completionMessage",d);var u=this.el.querySelectorAll(".form-completion-redirect-url")[0].value;this.model.set("completionRedirectUrl",u);var f=this.el.querySelectorAll(".form-completion-action-type")[0].value;this.model.set("completionActionType",f);var p=this.el.querySelectorAll(".form-theme")[0].value;this.model.set("theme",p)}},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,"")},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)
3
- });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,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};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(e){if("object"==typeof e&&e.choices){var t=[];i.each(e.choices,function(e){var i=new wp.ccf.models.FieldChoice(e);i.decode(),t.push(i)}),this.set("choices",new wp.ccf.collections.FieldChoices(t))}return wp.ccf.models.ChoiceableField.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.radio=wp.ccf.models.Fields.radio||wp.ccf.models.ChoiceableField.extend({defaults:function(){var e={type:"radio"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.checkboxes=wp.ccf.models.Fields.checkboxes||wp.ccf.models.ChoiceableField.extend({defaults:function(){var e={type:"checkboxes"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.dropdown=wp.ccf.models.Fields.dropdown||wp.ccf.models.ChoiceableField.extend({defaults:function(){var e={type:"dropdown"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}})}(jQuery,Backbone,_,ccfSettings),function(e,t,i,l){"use strict";var s=function(e,t,i){return i=i||{},i.emulateHTTP=!0,this.constructor.__super__.sync.call(this,e,t,i)};wp.ccf.collections=wp.ccf.collections||{},wp.ccf.collections.Forms=wp.ccf.collections.Forms||wp.api.collections.Posts.extend({model:wp.ccf.models.Form,url:l.apiRoot.replace(/\/$/,"")+"/ccf/v1/forms",formsFetching:{},initialize:function(){this.constructor.__super__.initialize(),this.formsFetching={}},sync:s,remove:function(e,t){t=t||{};var l=this.constructor.__super__.remove.call(this,e,t);return t.destroy&&(e instanceof Array?i.each(e,function(e){e.destroy()}):e.destroy()),l}}),wp.ccf.collections.Fields=wp.ccf.collections.Fields||wp.api.collections.Posts.extend({model:wp.ccf.models.Field,url:function(){return l.apiRoot+"/ccf/forms/"+this.formId+"/fields"},initialize:function(e,t){t&&t.formId&&(this.formId=t.formId)},sync:s}),wp.ccf.collections.PostFieldMappings=wp.ccf.collections.PostFieldMappings||t.Collection.extend({model:wp.ccf.models.PostFieldMapping}),wp.ccf.collections.FormNotificationAddresses=wp.ccf.collections.FormNotificationAddresses||t.Collection.extend({model:wp.ccf.models.FormNotificationAddress}),wp.ccf.collections.FormNotifications=wp.ccf.collections.FormNotifications||t.Collection.extend({model:wp.ccf.models.FormNotification}),wp.ccf.collections.Submissions=wp.ccf.collections.Submissions||wp.api.collections.Posts.extend({model:wp.ccf.models.Submission,url:function(){return l.apiRoot.replace(/\/$/,"")+"/ccf/v1/forms/"+this.formId+"/submissions"},initialize:function(e,t){this.constructor.__super__.initialize.apply(this,arguments),t&&t.formId&&(this.formId=t.formId)},sync:s}),wp.ccf.collections.FieldChoices=wp.ccf.collections.FieldChoices||t.Collection.extend({model:wp.ccf.models.FieldChoice}),wp.ccf.collections.FieldConditionals=wp.ccf.collections.FieldConditionals||t.Collection.extend({model:wp.ccf.models.FieldConditional})}(jQuery,Backbone,_,ccfSettings),function(e,t,i,l){"use strict";wp.ccf.views=wp.ccf.views||{},wp.ccf.views.Fields=wp.ccf.views.Fields||{},wp.ccf.views.FieldChoice=t.View.extend({template:wp.ccf.utils.template("ccf-field-choice-template"),className:"choice",events:{"click .add":"triggerAdd","click .delete":"triggerDelete",saveChoice:"saveChoice",sorted:"triggerUpdateSort"},initialize:function(e){this.field=e.field},destroy:function(){wp.ccf.dispatcher.off("mainViewChange",this.saveChoice),this.unbind()},triggerUpdateSort:function(e,t){this.field.get("choices").remove(this.model,{silent:!0}),this.field.get("choices").add(this.model,{at:t,silent:!0})},saveChoice:function(){if(""!==this.el.innerHTML){var e=this.el.querySelectorAll(".choice-label")[0].value,t=this.el.querySelectorAll(".choice-value")[0].value;this.model.set("label",e),this.model.set("value",t);var i=this.el.querySelectorAll(".choice-selected")[0],l=i.checked?!0:!1;return this.model.set("selected",l),this}},render:function(){var e={};return this.model&&(e.choice=this.model.toJSON()),this.el.innerHTML=this.template(e),wp.ccf.dispatcher.on("mainViewChange",this.saveChoice,this),this},triggerAdd:function(){this.field.get("choices").add(new wp.ccf.models.FieldChoice)},triggerDelete:function(){var e=this.field.get("choices");if(e.length>1)e.remove(this.model),this.destroy(),this.remove();else{for(var t=this.el.querySelectorAll(".choice-label, .choice-value"),i=this.el.querySelectorAll(".choice-selected"),l=0;t.length>l;l++)t[l].value="";i[0].checked=!1}}}),wp.ccf.views.FieldConditional=t.View.extend({template:wp.ccf.utils.template("ccf-field-conditional-template"),className:"conditional",events:{"click .add":"triggerAdd","click .delete":"triggerDelete",saveConditional:"saveConditional"},initialize:function(e){this.field=e.field,this.fieldCollection=e.fieldCollection},destroy:function(){wp.ccf.dispatcher.off("mainViewChange",this.saveConditional),this.unbind()},saveConditional:function(){if(""!==this.el.innerHTML){var e=this.el.querySelectorAll(".conditional-field")[0].value,t=this.el.querySelectorAll(".conditional-value")[0].value,i=this.el.querySelectorAll(".conditional-compare")[0].value;return this.model.set("field",e),this.model.set("value",t),this.model.set("compare",i),this}},updateFields:function(){var e=this.el.querySelectorAll(".conditional-field")[0];e.innerHTML="",e.disabled=!1;var t,i=0,s=this.model.get("field");this.fieldCollection.length>=1&&(t=document.createElement("option"),t.innerHTML=l.chooseFormField,t.value="",e.appendChild(t),this.fieldCollection.each(function(l){if(this.field.get("slug")!==l.get("slug")){var o=l.get("type");"address"!==o&&"checkboxes"!==o&&"date"!==o&&"name"!==o&&"file"!==o&&"recaptcha"!==o&&"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;this.model.set("fromNameField",r);var a=this.el.querySelectorAll(".form-email-notification-reply-to-type")[0].value;
2
+ 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(){if(""!==this.el.innerHTML){this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),wp.ccf.views.ChoiceableField.__super__.saveField.apply(this,arguments);var t=this.el.querySelectorAll(".repeatable-choices")[0].querySelectorAll(".choice");return i.each(t,function(t){e(t).trigger("saveChoice")}),this}},render:function(t){var i=this;t=t?t:"basic",i.el.innerHTML=i.template({field:i.model.toJSON(),startPanel:t}),i.checkSlug();var l=i.model.get("choices"),s=this.el.querySelectorAll(".repeatable-choices")[0];if(l.length>=1)l.each(function(e){var t=new wp.ccf.views.FieldChoice({model:e,field:i.model}).render();s.appendChild(t.el)});else{var o=new wp.ccf.models.FieldChoice;l.add(o)}s=this.el.querySelectorAll(".repeatable-choices")[0],e(s).sortable({handle:".move",axis:"y",stop:function(e,t){t.item.trigger("sorted",t.item.index())}});var n=this.model.get("conditionals"),c=this.el.querySelectorAll(".conditionals")[0];if(n.length>=1)n.each(function(e){var t=new wp.ccf.views.FieldConditional({model:e,field:this.model,fieldCollection:this.collection}).render();c.appendChild(t.el)},this);else{var r=new wp.ccf.models.FieldConditional;n.add(r)}return i}}),wp.ccf.views.Fields.dropdown=wp.ccf.views.Fields.dropdown||wp.ccf.views.ChoiceableField.extend({template:wp.ccf.utils.template("ccf-dropdown-template"),events:function(){return this.constructor.__super__.events}}),wp.ccf.views.Fields.radio=wp.ccf.views.Fields.radio||wp.ccf.views.ChoiceableField.extend({template:wp.ccf.utils.template("ccf-radio-template"),events:function(){return this.constructor.__super__.events}}),wp.ccf.views.Fields.checkboxes=wp.ccf.views.Fields.checkboxes||wp.ccf.views.ChoiceableField.extend({template:wp.ccf.utils.template("ccf-checkboxes-template"),events:function(){return this.constructor.__super__.events}}),wp.ccf.views.FieldSidebar=wp.ccf.views.FieldSidebar||t.View.extend({initialize:function(e){this.currentFieldView=null,this.form=e.form},save:function(e){this.currentFieldView&&""!==this.currentFieldView.el.innerHTML&&this.currentFieldView.saveField(),e&&e instanceof Object&&e.resolve()},fieldRemoved:function(){this.currentFieldView&&(this.form.get("fields").get(this.currentFieldView.model)||this.render())},destroy:function(){wp.ccf.dispatcher.off("saveField",this.save),wp.ccf.dispatcher.off("mainViewChange",this.save),this.unbind()},render:function(e){var t={};if(e){var i=e.get("type");this.currentFieldView&&(this.currentFieldView.saveField(),this.currentFieldView.destroy&&this.currentFieldView.destroy()),this.currentFieldView=new wp.ccf.views.Fields[i]({model:e,collection:this.form.get("fields")}),this.currentFieldView.render(),this.el.innerHTML="",this.el.appendChild(this.currentFieldView.el);var l=this.form.get("fields");this.listenTo(l,"remove",this.fieldRemoved)}else{var s=wp.ccf.utils.template("ccf-empty-field-template");this.el.innerHTML=s(t)}return wp.ccf.dispatcher.on("saveField",this.save,this),wp.ccf.dispatcher.on("mainViewChange",this.save,this),this}}),wp.ccf.views.FieldRowPlaceholder=wp.ccf.views.FieldRowPlaceholder||t.View.extend({template:wp.ccf.utils.template("ccf-field-row-template"),tagName:"div",className:"field",initialize:function(e){this.type=e.type},render:function(){return this.el.innerHTML=this.template({label:l.allLabels[this.type]}),this.el.setAttribute("data-field-type",this.type),this.el.className+=" "+this.type,this}}),wp.ccf.views.FieldRow=wp.ccf.views.FieldRow||t.View.extend({template:wp.ccf.utils.template("ccf-field-row-template"),tagName:"div",className:"field",events:{"click .delete":"triggerDelete","click h4":"triggerEdit",sorted:"triggerUpdateSort"},initialize:function(e){i.bindAll(this,"triggerDelete"),this.form=e.form,this.listenTo(this.model,"change",this.handleChange,this),this.listenTo(this.model,"requirementsNotMet",this.requirementsNotMet,this),this.listenTo(this.model,"requirementsMet",this.requirementsMet,this),this.listenTo(this.model,"duplicateSlug",this.duplicateSlug,this),this.model.attributes.choices&&this.listenTo(this.model.attributes.choices,"change",this.handleChange,this)},duplicateSlug:function(){this.requirementsMet(),this.el.className+=" field-duplicate-slug"},requirementsNotMet:function(){this.requirementsMet(),this.el.className+=" field-incomplete"},requirementsMet:function(){this.el.className=this.el.className.replace(/(field-incomplete|field-duplicate-slug)/i,"")},triggerUpdateSort:function(e,t){this.form.get("fields").remove(this.model),this.form.get("fields").add(this.model,{at:t})},handleChange:function(){this.render()},triggerDelete:function(e){e.stopPropagation(),this.form.get("fields").remove(this.model),this.undelegateEvents(),this.remove()},triggerEdit:function(){var e=this.el.parentNode.querySelectorAll(".ccf-editing");i.each(e,function(e){e.className=e.className.replace(/ccf-editing/i,"")}),this.el.className=this.el.className.replace(/ccf-editing/i,"")+" ccf-editing",wp.ccf.dispatcher.trigger("openEditField",this.model)},render:function(e){this.el.innerHTML=this.template({label:l.allLabels[this.model.get("type")]}),this.el.setAttribute("data-field-type",this.model.get("type"));var t=RegExp(" "+this.model.get("type"),"i");this.el.className=this.el.className.replace(t,"")+" "+this.model.get("type"),e&&(this.el.className=this.el.className.replace(/ instantiated/i,"")+" instantiated");var i=document.getElementById("ccf-"+this.model.get("type")+"-preview-template");if(i){var s=this.el.querySelectorAll(".preview")[0];s.style.display="block",s.innerHTML=wp.ccf.utils.template("ccf-"+this.model.get("type")+"-preview-template")({field:this.model.toJSON()})}return this}}),wp.ccf.views.PostFieldMapping=t.View.extend({template:wp.ccf.utils.template("ccf-post-field-mapping"),className:"field-mapping",events:{"click .add":"triggerAdd","click .delete":"triggerDelete","blur input":"save","change select":"save"},initialize:function(e){this.parent=e.parent,this.form=e.form},destroy:function(){this.unbind()},save:function(){if(""!==this.el.innerHTML){var e=this.el.querySelectorAll(".field-form-field")[0].value,t=this.el.querySelectorAll(".field-post-field")[0].value,i=this.el.querySelectorAll(".field-custom-field-key"),l=this.model.get("postField");return this.model.set("formField",e),this.model.set("postField",t),i.length&&this.model.set("customFieldKey",i[0].value),l!==t&&this.render(),this}},updateFormFieldField:function(){var e=this.el.querySelectorAll(".field-form-field")[0];e.innerHTML="",e.disabled=!1;var t,i=this.form.get("fields"),s=0,o=this.model.get("formField");i.length>=1&&(t=document.createElement("option"),t.innerHTML=l.chooseFormField,t.value="",e.appendChild(t),i.each(function(i){t=document.createElement("option"),t.innerHTML=i.get("slug"),t.value=i.get("slug"),i.get("slug")===o&&(t.selected=!0),e.appendChild(t),s++})),0===s&&(t=document.createElement("option"),t.innerHTML=l.noAvailableFields,t.value="",e.appendChild(t),e.disabled=!0)},updatePostFields:function(){var e,t=this.el.querySelectorAll(".field-post-field")[0];e=document.createElement("option"),e.value="",e.innerText=l.choosePostField,t.appendChild(e);var s=this.form.get("postFieldMappings"),o=[];s.each(function(e){e!==this.model&&o.push(e.get("postField"))},this),i.each(l.postFields.single,function(i,l){-1===o.indexOf(l)&&(e=document.createElement("option"),e.value=l,e.innerText=i,this.model.get("postField")===l&&(e.selected=!0),t.appendChild(e))},this),i.each(l.postFields.repeatable,function(i,l){e=document.createElement("option"),e.value=l,e.innerText=i,this.model.get("postField")===l&&(e.selected=!0),t.appendChild(e)},this)},render:function(){var e={};this.model&&(e.mapping=this.model.toJSON()),this.el.innerHTML=this.template(e);var t=this.form.get("fields");return this.listenTo(t,"add",this.updateFormFieldField,this),this.listenTo(t,"remove",this.updateFormFieldField,this),this.updateFormFieldField(),this.updatePostFields(),this},triggerAdd:function(){this.form.get("postFieldMappings").add(new wp.ccf.models.PostFieldMapping)},triggerDelete:function(){var e=this.form.get("postFieldMappings");e.length>1?this.parent.deletePostFieldMapping(this):(this.model.clear().set(wp.ccf.models.PostFieldMapping.prototype.defaults),this.destroy(),this.render())}}),wp.ccf.views.FormSettings=wp.ccf.views.FormSettings||t.View.extend({template:wp.ccf.utils.template("ccf-form-settings-template"),events:{"blur input":"save","change select":"save","change select.form-completion-action-type":"toggleCompletionFields","change select.form-pause":"togglePauseFields","change select.form-post-creation":"togglePostCreationFields","click .add-notification":"triggerAddNotification"},notificationViews:[],mappingViews:[],initialize:function(e){this.model=e.form,this.notificationViews=[],this.mappingViews=[];var t=this.model.get("notifications");this.listenTo(t,"add",this.addNotification);var i=this.model.get("postFieldMappings");this.listenTo(i,"add",this.addPostFieldMapping)},deletePostFieldMapping:function(e){i.each(this.mappingViews,function(t){if(e.cid===t.cid){var l=i.indexOf(this.mappingViews,t);this.model.get("postFieldMappings").remove(e.model),this.mappingViews[l].remove(),this.mappingViews.splice(l,1)}},this)},addPostFieldMapping:function(e){var t=this.el.querySelectorAll(".post-creation-mapping")[0],i=new wp.ccf.views.PostFieldMapping({model:e,parent:this,form:this.model});this.mappingViews.push(i),t.appendChild(i.render().el)},triggerAddNotification:function(){var e=this.model.get("notifications");e.add(new wp.ccf.models.FormNotification)},closeAllNotifications:function(){i.each(this.notificationViews,function(e){e.changeContext(null,"view")})},addNotification:function(e){var t=new wp.ccf.views.ExistingFormNotificationRow({model:e,form:this.model,context:"edit",parent:this}).render(),l=this.el.querySelectorAll(".ccf-form-notifications .rows")[0];l.querySelectorAll(".no-notifications").length>0&&l.removeChild(l.firstChild),i.each(this.notificationViews,function(e){e.changeContext(null,"view")}),this.notificationViews.push(t),l.appendChild(t.el)},toggleCompletionFields:function(){var e=this.el.querySelectorAll(".form-completion-action-type")[0].value,t=this.el.querySelectorAll(".completion-message")[0],i=this.el.querySelectorAll(".completion-redirect-url")[0];"text"===e?(t.style.display="block",i.style.display="none"):(t.style.display="none",i.style.display="block")},togglePauseFields:function(){var e=this.el.querySelectorAll(".form-pause")[0].value,t=this.el.querySelectorAll(".pause-message")[0];t.style.display=parseInt(e)?"block":"none"},togglePostCreationFields:function(){var t=this.el.querySelectorAll(".form-post-creation")[0].value,i=e(this.el.querySelectorAll(".post-creation-mapping-field"));parseInt(t)?i.show():i.hide()},save:function(){if(""!==this.el.innerHTML){var e=this.el.querySelectorAll(".form-title")[0].value;this.model.set("title",{raw:e});var t=this.el.querySelectorAll(".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,"")},openEditField:function(e){this.renderedSubViews["field-sidebar"].render(e).el.style.display="block"
3
+ },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/build/js/form.min.js CHANGED
@@ -1 +1 @@
1
- (function(e,t){"use strict";window.wp=window.wp||{},wp.ccf=wp.ccf||{},wp.ccf.validators=wp.ccf.validators||{};var i={};window.ccfRecaptchaOnload=function(){for(var e=document.querySelectorAll(".ccf-recaptcha-wrapper"),l=function(l){grecaptcha.render(e[s],{sitekey:e[s].getAttribute("data-sitekey"),theme:t.recaptcha_theme,callback:function(){i[l]=!0}})},s=0;e.length>s;s++){var r=e[s].getAttribute("data-form-id");l(r)}};var l=function(e){if(this.wrapper=e,this.errors={},e.className.match(" field-required")){this.inputs=this.wrapper.querySelectorAll(".field-input");var i=this.wrapper.querySelectorAll(".error");i.length&&i[0].parentNode.removeChild(i[0]);var l=!1;if(_.each(this.inputs,function(e){(e.checked&&e.value||e.selected)&&(l=!0)}),!l){this.errors[this.inputs[this.inputs.length-1].getAttribute("name")]={required:!0};var s=document.createElement("div");s.className="error required-error",s.innerHTML=t.required,e.appendChild(s)}}},s=function(e,i){return function(l){this.wrapper=l,this.inputs=this.wrapper.querySelectorAll(".field-input"),this.errors={};for(var s=this.wrapper.querySelectorAll(".error"),r=s.length-1;r>=0;r--)s[r].parentNode.removeChild(s[r]);_.each(this.inputs,function(t){var i=t.getAttribute("name");this.errors[i]={},t.getAttribute("aria-required")&&""===t.value&&(this.errors[i].required=t),e&&e.call(this,t)},this),i&&i.call(this);var o;for(var n in this.errors)if(this.errors.hasOwnProperty(n))for(var c in this.errors[n])o=document.createElement("div"),o.className="error "+c+"-error",o.setAttribute("data-field-name",n),o.innerHTML=t[c],this.errors[n][c].parentNode.insertBefore(o,this.errors[n][c].nextSibling)}};wp.ccf.validators["single-line-text"]=wp.ccf.validators["single-line-text"]||s(),wp.ccf.validators["paragraph-text"]=wp.ccf.validators["paragraph-text"]||s(),wp.ccf.validators.name=wp.ccf.validators.name||s(),wp.ccf.validators.email=wp.ccf.validators.email||s(!1,function(){var e=this.inputs[0].value;if(e){2===this.inputs.length&&e!==this.inputs[1].value&&(this.errors[this.inputs[0].getAttribute("name")].match=this.wrapper.lastChild);var t=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;t.test(e)||(this.errors[this.inputs[0].getAttribute("name")].email=this.wrapper.lastChild)}}),wp.ccf.validators.recaptcha=wp.ccf.validators.recaptcha||function(e,l){this.wrapper=e,this.inputs=this.wrapper.querySelectorAll(".g-recaptcha-response"),this.errors={};for(var s=this.wrapper.querySelectorAll(".error"),r=s.length-1;r>=0;r--)s[r].parentNode.removeChild(s[r]);i[l]||(this.errors["g-recaptcha-response"]={},this.errors["g-recaptcha-response"].recaptcha=this.wrapper.lastChild);var o;for(var n in this.errors)if(this.errors.hasOwnProperty(n))for(var c in this.errors[n])o=document.createElement("div"),o.className="error "+c+"-error",o.setAttribute("data-field-name",n),o.innerHTML=t[c],this.errors[n][c].parentNode.insertBefore(o,this.errors[n][c].nextSibling)},wp.ccf.validators["simple-captcha"]=wp.ccf.validators["simple-captcha"]||s(function(){}),wp.ccf.validators.phone=wp.ccf.validators.phone||s(!1,function(){var e=this.inputs[0].value;if(e){var t=/^[0-9+.)(\- ]+$/;if(t.test(e)){if("us"===this.wrapper.getAttribute("data-phone-format")){var i=e.replace(/[^0-9]/gi,"");10!==i.length&&(this.errors[this.inputs[0].getAttribute("name")].digits=this.wrapper.lastChild)}}else this.errors[this.inputs[0].getAttribute("name")].phone=this.wrapper.lastChild}}),wp.ccf.validators.date=wp.ccf.validators.date||function(e){this.wrapper=e,this.errors={},this.inputs=this.wrapper.querySelectorAll(".field-input");for(var i=this.wrapper.querySelectorAll(".error"),l=i.length-1;l>=0;l--)i[l].parentNode.removeChild(i[l]);var s;_.each(this.inputs,function(i){var l=i.getAttribute("name");if(this.errors[l]={},i.getAttribute("aria-required")&&""===i.value&&(this.errors[l].required=!0,s=document.createElement("div"),s.className="error required-error",1===this.inputs.length?(s.innerHTML=t.required,s.className+=" right-error",i.parentNode.insertBefore(s,i.nextSibling)):(s.innerHTML=t[l.replace(/.*\[(.*?)\]/i,"$1")+"_required"],e.appendChild(s))),""!==i.value){var r=l.replace(/^.*\[(.*?)\]$/,"$1");"date"===r?i.value.match(/^([0-9]|\/)+$/)||(s=document.createElement("div"),s.className="error date-error",s.innerHTML=t.date,e.appendChild(s)):"hour"===r?i.value.match(/^[0-9]+$/)||(s=document.createElement("div"),s.className="error hour-error",s.innerHTML=t.hour,e.appendChild(s)):"minute"===r&&(i.value.match(/^[0-9]+$/)||(s=document.createElement("div"),s.className="error minute-error",s.innerHTML=t.minute,e.appendChild(s)))}},this)},wp.ccf.validators.address=wp.ccf.validators.address||s(),wp.ccf.validators.file=wp.ccf.validators.file||function(e){this.wrapper=e,this.inputs=this.wrapper.querySelectorAll(".field-input"),this.errors={};for(var i=this.wrapper.querySelectorAll(".error"),l=i.length-1;l>=0;l--)i[l].parentNode.removeChild(i[l]);_.each(this.inputs,function(e){var t=e.getAttribute("name");this.errors[t]={},e.getAttribute("aria-required")&&""===e.value&&(this.errors[t].required=e)},this);var s=this.inputs[0],r=this.wrapper.getAttribute("data-max-file-size"),o=this.wrapper.getAttribute("data-file-extensions");if(s.value){if(r){var n=1e3*1e3*parseInt(r);if(s.files)s.files[0].size>n&&(this.errors[this.inputs[0].getAttribute("name")].fileSize=this.wrapper.lastChild);else if("undefined"!=typeof ActiveXObject)try{var c=new ActiveXObject("Scripting.FileSystemObject"),a=c.getFile(s.value);a.size>n&&(this.errors[this.inputs[0].getAttribute("name")].fileSize=this.wrapper.lastChild)}catch(d){}}if(o){var u=o.replace(";",",").toLowerCase();if(u=u.replace(/\s+/g,""),u=u.split(","),u.length){var f=s.value.replace(/^.*\.(.+)$/g,"$1").toLowerCase();-1===_.indexOf(u,f)&&(this.errors[this.inputs[0].getAttribute("name")].fileExtension=this.wrapper.lastChild)}}}var p;for(var h in this.errors)if(this.errors.hasOwnProperty(h))for(var m in this.errors[h])p=document.createElement("div"),p.className="error "+m+"-error",p.setAttribute("data-field-name",h),p.innerHTML=t[m],"fileExtension"===m&&o?p.innerHTML+=" ("+o+")":"fileSize"===m&&r&&(p.innerHTML+=" "+r+" MB"),this.errors[h][m].parentNode.insertBefore(p,this.errors[h][m].nextSibling)},wp.ccf.validators.website=wp.ccf.validators.website||s(function(e){if(e.value){var t=/^http(s?)\:\/\/(([a-zA-Z0-9\-\._]+(\.[a-zA-Z0-9\-\._]+)+)|localhost)(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&amp;%\$#_]*)?([\d\w\.\/\%\+\-\=\&amp;\?\:\\\&quot;\'\,\|\~\;]*)$/;t.test(e.value)||(this.errors[e.getAttribute("name")].website=e)}}),wp.ccf.validators.checkboxes=wp.ccf.validators.checkboxes||l,wp.ccf.validators.dropdown=wp.ccf.validators.dropdown||s(),wp.ccf.validators.radio=wp.ccf.validators.radio||l,wp.ccf.setupDOM=wp.ccf.setupDOM||function(){for(var l,s,r=document.querySelectorAll(".ccf-datepicker"),o=0;r.length>o;o++)l={},s=r[o].getAttribute("data-date-format"),s&&(l.dateFormat=s.replace(/yyyy/i,"yy")),e(r[o]).datepicker(l);var n=document.querySelectorAll(".ccf-form-wrapper");n.length>=1&&_.each(n,function(l){function s(t){var i=[];if(_.each(p,function(e){if(!e.className.match(/ skip-field/i)){var t=e.getAttribute("data-field-type");e.getAttribute("data-field-slug");var l=new wp.ccf.validators[t](e,n);if(_.size(l.errors)){var s=0;for(var r in l.errors)l.errors.hasOwnProperty(r)&&_.size(l.errors[r])&&s++;s>0&&i.push(l)}}}),!i.length)return o.trigger("ccfFormSuccess"),l.className=l.className.replace(/ loading/i,"")+" loading",d.animate({opacity:100}),!0;t.returnFalse=!1,t.preventDefault&&t.preventDefault(),o.trigger("ccfFormError",i);var s=e(window).scrollTop(),r=s+e(window).height(),c=e(i[0].wrapper),a=c.offset(),u=a.top,f=u+c.height();return u>=s&&r>=f||e("html, body").animate({scrollTop:c.offset().top},500),!1}var r=l.querySelectorAll(".ccf-form")[0],o=e(r),n=parseInt(l.getAttribute("data-form-id")),c=r.querySelectorAll(".ccf-submit-button")[0],a=document.getElementById("ccf_form_frame_"+n),d=e(r.querySelectorAll(".loading-img")[0]),u=e(a),f=e(c),p={};u.on("load",function(){var l,s=u.contents().find("body").text();if(!s)return!1;r.className=r.className.replace(/ loading/i,""),d.animate({opacity:0}),i[n]=!1;try{l=e.parseJSON(s)}catch(o){var a=document.createElement("div");return a.className="error unknown-error",a.innerText=t.unknown,c.parentNode.appendChild(a),!1}var f=c.parentNode.querySelectorAll(".error");if(f.length&&f[0].parentNode.removeChild(f[0]),l.success)if("text"===l.action_type&&l.completion_message){r.innerHTML="";var h=document.createElement("div");h.innerHTML=l.completion_message,h.className="ccf-form-complete",r.appendChild(h),e("html, body").animate({scrollTop:e(r).offset().top},500)}else"redirect"===l.action_type&&l.completion_redirect_url&&(document.location=l.completion_redirect_url);else l.field_errors&&_.each(l.field_errors,function(e,t){var i=p[t].querySelectorAll(".field-input");for(var l in e)if(e.hasOwnProperty(l)){var s=document.createElement("div");s.className="error "+l+"-error",s.innerHTML=e[l],1===i.length?i[i.length-1].parentNode.insertBefore(s,i[i.length-1].nextSibling):p[t].appendChild(s)}})}),f.on("click",function(e){return e.preventDefault(),r.target="ccf_form_frame_"+n,r.action=t.ajaxurl,o.submit(),!1});var h=l.querySelectorAll(".field");_.each(h,function(e){var t=e.getAttribute("data-field-slug");p[t]=e}),_.each(h,function(t){var i=t.getAttribute("data-field-slug"),l=t.getAttribute("data-field-type");if(wp.ccf.conditionals[n][i]&&wp.ccf.conditionals[n][i].conditions.length){var s=wp.ccf.conditionals[n][i].conditionalType,r=wp.ccf.conditionals[n][i].conditionalFieldsRequired;wp.ccf.conditionals[n][i].trigger=function(){var o;"any"===r?(o=!1,_.each(wp.ccf.conditionals[n][i].conditions,function(e){e.state&&(o=!0)})):(o=!0,_.each(wp.ccf.conditionals[n][i].conditions,function(e){o=o&&e.state})),"hide"===s&&(o=!o),o?"section-header"===l?e(t).parents(".ccf-section").removeClass("field-hide"):t.className=t.className.replace(/field-hide/i,""):"section-header"===l?e(t).parents(".ccf-section").addClass("field-hide"):t.className=t.className.replace(/field-hide/i,"")+" field-hide"},_.each(wp.ccf.conditionals[n][i].conditions,function(t){function l(e){"is"===t.compare?t.state=e===t.value?!0:!1:"is-not"===t.compare?t.state=e!==t.value?!0:!1:"greater-than"===t.compare?t.state=parseInt(e)>parseInt(t.value)?!0:!1:"less-than"===t.compare?t.state=parseInt(e)<parseInt(t.value)?!0:!1:"contains"===t.compare&&(t.state=e.match(t.value)?!0:!1)}var s=p[t.field].querySelectorAll(".field-input");e(s).on("change keyup",_.debounce(function(e){l(e.currentTarget.value),wp.ccf.conditionals[n][i].trigger()},250)),l(s.value),wp.ccf.conditionals[n][i].trigger()})}}),o.on("submit",s)})},e(document).ready(wp.ccf.setupDOM)})(jQuery,ccfSettings);
1
+ (function(e,t){"use strict";window.wp=window.wp||{},wp.ccf=wp.ccf||{},wp.ccf.validators=wp.ccf.validators||{};var i={};window.ccfRecaptchaOnload=function(){for(var e=document.querySelectorAll(".ccf-recaptcha-wrapper"),l=function(l){grecaptcha.render(e[s],{sitekey:e[s].getAttribute("data-sitekey"),theme:t.recaptcha_theme,callback:function(){i[l]=!0}})},s=0;e.length>s;s++){var r=e[s].getAttribute("data-form-id");l(r)}};var l=function(e){if(this.wrapper=e,this.errors={},e.className.match(" field-required")){this.inputs=this.wrapper.querySelectorAll(".field-input");var i=this.wrapper.querySelectorAll(".error");i.length&&i[0].parentNode.removeChild(i[0]);var l=!1;if(_.each(this.inputs,function(e){(e.checked&&e.value||e.selected)&&(l=!0)}),!l){this.errors[this.inputs[this.inputs.length-1].getAttribute("name")]={required:!0};var s=document.createElement("div");s.className="error required-error",s.innerHTML=t.required,e.appendChild(s)}}},s=function(e,i){return function(l){this.wrapper=l,this.inputs=this.wrapper.querySelectorAll(".field-input"),this.errors={};for(var s=this.wrapper.querySelectorAll(".error"),r=s.length-1;r>=0;r--)s[r].parentNode.removeChild(s[r]);_.each(this.inputs,function(t){var i=t.getAttribute("name");this.errors[i]={},t.getAttribute("aria-required")&&""===t.value&&(this.errors[i].required=t),e&&e.call(this,t)},this),i&&i.call(this);var o;for(var n in this.errors)if(this.errors.hasOwnProperty(n))for(var c in this.errors[n])o=document.createElement("div"),o.className="error "+c+"-error",o.setAttribute("data-field-name",n),o.innerHTML=t[c],this.errors[n][c].parentNode.insertBefore(o,this.errors[n][c].nextSibling)}};wp.ccf.validators["single-line-text"]=wp.ccf.validators["single-line-text"]||s(),wp.ccf.validators["paragraph-text"]=wp.ccf.validators["paragraph-text"]||s(),wp.ccf.validators.name=wp.ccf.validators.name||s(),wp.ccf.validators.email=wp.ccf.validators.email||s(!1,function(){var e=this.inputs[0].value;if(e){2===this.inputs.length&&e!==this.inputs[1].value&&(this.errors[this.inputs[0].getAttribute("name")].match=this.wrapper.lastChild);var t=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;t.test(e)||(this.errors[this.inputs[0].getAttribute("name")].email=this.wrapper.lastChild)}}),wp.ccf.validators.recaptcha=wp.ccf.validators.recaptcha||function(e,l){this.wrapper=e,this.inputs=this.wrapper.querySelectorAll(".g-recaptcha-response"),this.errors={};for(var s=this.wrapper.querySelectorAll(".error"),r=s.length-1;r>=0;r--)s[r].parentNode.removeChild(s[r]);i[l]||(this.errors["g-recaptcha-response"]={},this.errors["g-recaptcha-response"].recaptcha=this.wrapper.lastChild);var o;for(var n in this.errors)if(this.errors.hasOwnProperty(n))for(var c in this.errors[n])o=document.createElement("div"),o.className="error "+c+"-error",o.setAttribute("data-field-name",n),o.innerHTML=t[c],this.errors[n][c].parentNode.insertBefore(o,this.errors[n][c].nextSibling)},wp.ccf.validators["simple-captcha"]=wp.ccf.validators["simple-captcha"]||s(function(){}),wp.ccf.validators.phone=wp.ccf.validators.phone||s(!1,function(){var e=this.inputs[0].value;if(e){var t=/^[0-9+.)(\- ]+$/;if(t.test(e)){if("us"===this.wrapper.getAttribute("data-phone-format")){var i=e.replace(/[^0-9]/gi,"");10!==i.length&&(this.errors[this.inputs[0].getAttribute("name")].digits=this.wrapper.lastChild)}}else this.errors[this.inputs[0].getAttribute("name")].phone=this.wrapper.lastChild}}),wp.ccf.validators.date=wp.ccf.validators.date||function(e){this.wrapper=e,this.errors={},this.inputs=this.wrapper.querySelectorAll(".field-input");for(var i=this.wrapper.querySelectorAll(".error"),l=i.length-1;l>=0;l--)i[l].parentNode.removeChild(i[l]);var s;_.each(this.inputs,function(i){var l=i.getAttribute("name");if(this.errors[l]={},i.getAttribute("aria-required")&&""===i.value&&(this.errors[l].required=!0,s=document.createElement("div"),s.className="error required-error",1===this.inputs.length?(s.innerHTML=t.required,s.className+=" right-error",i.parentNode.insertBefore(s,i.nextSibling)):(s.innerHTML=t[l.replace(/.*\[(.*?)\]/i,"$1")+"_required"],e.appendChild(s))),""!==i.value){var r=l.replace(/^.*\[(.*?)\]$/,"$1");"date"===r?i.value.match(/^([0-9]|\/)+$/)||(s=document.createElement("div"),s.className="error date-error",s.innerHTML=t.date,e.appendChild(s)):"hour"===r?i.value.match(/^[0-9]+$/)||(s=document.createElement("div"),s.className="error hour-error",s.innerHTML=t.hour,e.appendChild(s)):"minute"===r&&(i.value.match(/^[0-9]+$/)||(s=document.createElement("div"),s.className="error minute-error",s.innerHTML=t.minute,e.appendChild(s)))}},this)},wp.ccf.validators.address=wp.ccf.validators.address||s(),wp.ccf.validators.file=wp.ccf.validators.file||function(e){this.wrapper=e,this.inputs=this.wrapper.querySelectorAll(".field-input"),this.errors={};for(var i=this.wrapper.querySelectorAll(".error"),l=i.length-1;l>=0;l--)i[l].parentNode.removeChild(i[l]);_.each(this.inputs,function(e){var t=e.getAttribute("name");this.errors[t]={},e.getAttribute("aria-required")&&""===e.value&&(this.errors[t].required=e)},this);var s=this.inputs[0],r=this.wrapper.getAttribute("data-max-file-size"),o=this.wrapper.getAttribute("data-file-extensions");if(s.value){if(r){var n=1e3*1e3*parseInt(r);if(s.files)s.files[0].size>n&&(this.errors[this.inputs[0].getAttribute("name")].fileSize=this.wrapper.lastChild);else if("undefined"!=typeof ActiveXObject)try{var c=new ActiveXObject("Scripting.FileSystemObject"),a=c.getFile(s.value);a.size>n&&(this.errors[this.inputs[0].getAttribute("name")].fileSize=this.wrapper.lastChild)}catch(d){}}if(o){var u=o.replace(";",",").toLowerCase();if(u=u.replace(/\s+/g,""),u=u.split(","),u.length){var f=s.value.replace(/^.*\.(.+)$/g,"$1").toLowerCase();-1===_.indexOf(u,f)&&(this.errors[this.inputs[0].getAttribute("name")].fileExtension=this.wrapper.lastChild)}}}var p;for(var h in this.errors)if(this.errors.hasOwnProperty(h))for(var m in this.errors[h])p=document.createElement("div"),p.className="error "+m+"-error",p.setAttribute("data-field-name",h),p.innerHTML=t[m],"fileExtension"===m&&o?p.innerHTML+=" ("+o+")":"fileSize"===m&&r&&(p.innerHTML+=" "+r+" MB"),this.errors[h][m].parentNode.insertBefore(p,this.errors[h][m].nextSibling)},wp.ccf.validators.website=wp.ccf.validators.website||s(function(e){if(e.value){var t=/^http(s?)\:\/\/(([a-zA-Z0-9\-\._]+(\.[a-zA-Z0-9\-\._]+)+)|localhost)(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&amp;%\$#_]*)?([\d\w\.\/\%\+\-\=\&amp;\?\:\\\&quot;\'\,\|\~\;]*)$/;t.test(e.value)||(this.errors[e.getAttribute("name")].website=e)}}),wp.ccf.validators.checkboxes=wp.ccf.validators.checkboxes||l,wp.ccf.validators.dropdown=wp.ccf.validators.dropdown||s(),wp.ccf.validators.radio=wp.ccf.validators.radio||l,wp.ccf.setupDOM=wp.ccf.setupDOM||function(){for(var l,s,r=document.querySelectorAll(".ccf-datepicker"),o=0;r.length>o;o++)l={},s=r[o].getAttribute("data-date-format"),s&&(l.dateFormat=s.replace(/yyyy/i,"yy")),e(r[o]).datepicker(l);var n=document.querySelectorAll(".ccf-form-wrapper");n.length>=1&&_.each(n,function(l){function s(t){var i=[];if(_.each(p,function(e){if(!e.className.match(/ skip-field/i)){var t=e.getAttribute("data-field-type");e.getAttribute("data-field-slug");var l=new wp.ccf.validators[t](e,n);if(_.size(l.errors)){var s=0;for(var r in l.errors)l.errors.hasOwnProperty(r)&&_.size(l.errors[r])&&s++;s>0&&i.push(l)}}}),!i.length)return o.trigger("ccfFormSuccess"),l.className=l.className.replace(/ loading/i,"")+" loading",d.animate({opacity:100}),!0;t.returnFalse=!1,t.preventDefault&&t.preventDefault(),o.trigger("ccfFormError",i);var s=e(window).scrollTop(),r=s+e(window).height(),c=e(i[0].wrapper),a=c.offset(),u=a.top,f=u+c.height();return u>=s&&r>=f||e("html, body").animate({scrollTop:c.offset().top},500),!1}var r=l.querySelectorAll(".ccf-form")[0],o=e(r),n=parseInt(l.getAttribute("data-form-id")),c=r.querySelectorAll(".ccf-submit-button")[0],a=document.getElementById("ccf_form_frame_"+n),d=e(r.querySelectorAll(".loading-img")[0]),u=e(a),f=e(c),p={};u.on("load",function(){var l,s=u.contents().find("body").text();if(!s)return!1;r.className=r.className.replace(/ loading/i,""),d.animate({opacity:0}),i[n]=!1;try{l=e.parseJSON(s)}catch(o){var a=document.createElement("div");return a.className="error unknown-error",a.innerText=t.unknown,c.parentNode.appendChild(a),!1}var f=c.parentNode.querySelectorAll(".error");if(f.length&&f[0].parentNode.removeChild(f[0]),l.success)if("text"===l.action_type&&l.completion_message){r.innerHTML="";var h=document.createElement("div");h.innerHTML=l.completion_message,h.className="ccf-form-complete",r.appendChild(h),e("html, body").animate({scrollTop:e(r).offset().top},500)}else"redirect"===l.action_type&&l.completion_redirect_url&&(document.location=l.completion_redirect_url);else l.field_errors&&_.each(l.field_errors,function(e,t){var i=p[t].querySelectorAll(".field-input");for(var l in e)if(e.hasOwnProperty(l)){var s=document.createElement("div");s.className="error "+l+"-error",s.innerHTML=e[l],1===i.length?i[i.length-1].parentNode.insertBefore(s,i[i.length-1].nextSibling):p[t].appendChild(s)}})}),f.on("click",function(e){return e.preventDefault(),r.target="ccf_form_frame_"+n,o.submit(),!1});var h=l.querySelectorAll(".field");_.each(h,function(e){var t=e.getAttribute("data-field-slug");p[t]=e}),_.each(h,function(t){var i=t.getAttribute("data-field-slug"),l=t.getAttribute("data-field-type");if(wp.ccf.conditionals[n][i]&&wp.ccf.conditionals[n][i].conditions.length){var s=wp.ccf.conditionals[n][i].conditionalType,r=wp.ccf.conditionals[n][i].conditionalFieldsRequired;wp.ccf.conditionals[n][i].trigger=function(){var o;"any"===r?(o=!1,_.each(wp.ccf.conditionals[n][i].conditions,function(e){e.state&&(o=!0)})):(o=!0,_.each(wp.ccf.conditionals[n][i].conditions,function(e){o=o&&e.state})),"hide"===s&&(o=!o),o?"section-header"===l?e(t).parents(".ccf-section").removeClass("field-hide"):t.className=t.className.replace(/field-hide/i,""):"section-header"===l?e(t).parents(".ccf-section").addClass("field-hide"):t.className=t.className.replace(/field-hide/i,"")+" field-hide"},_.each(wp.ccf.conditionals[n][i].conditions,function(t){function l(e){"is"===t.compare?t.state=e===t.value?!0:!1:"is-not"===t.compare?t.state=e!==t.value?!0:!1:"greater-than"===t.compare?t.state=parseInt(e)>parseInt(t.value)?!0:!1:"less-than"===t.compare?t.state=parseInt(e)<parseInt(t.value)?!0:!1:"contains"===t.compare&&(t.state=e.match(t.value)?!0:!1)}var s=p[t.field].querySelectorAll(".field-input");e(s).on("change keyup",_.debounce(function(e){l(e.currentTarget.value),wp.ccf.conditionals[n][i].trigger()},250)),l(s.value),wp.ccf.conditionals[n][i].trigger()})}}),o.on("submit",s)})},e(document).ready(wp.ccf.setupDOM)})(jQuery,ccfSettings);
assets/js/form.js CHANGED
@@ -462,7 +462,6 @@
462
  event.preventDefault();
463
 
464
  form.target = 'ccf_form_frame_' + formId;
465
- form.action = ccfSettings.ajaxurl;
466
  $form.submit();
467
 
468
  return false;
462
  event.preventDefault();
463
 
464
  form.target = 'ccf_form_frame_' + formId;
 
465
  $form.submit();
466
 
467
  return false;
assets/js/manager/models.js CHANGED
@@ -127,7 +127,7 @@
127
  return {
128
  title: '',
129
  content: '[all_fields]',
130
- active: false,
131
  addresses: new wp.ccf.collections.FormNotificationAddresses(),
132
  fromType: 'default',
133
  fromAddress: '',
@@ -137,7 +137,16 @@
137
  subjectField: '',
138
  fromNameType: 'custom',
139
  fromName: 'WordPress',
140
- fromNameField: ''
 
 
 
 
 
 
 
 
 
141
  };
142
  },
143
 
@@ -194,6 +203,7 @@
194
  fields: new wp.ccf.collections.Fields(),
195
  type: 'ccf_form',
196
  status: 'publish',
 
197
  description: '',
198
  buttonText: 'Submit Form',
199
  buttonClass: '',
127
  return {
128
  title: '',
129
  content: '[all_fields]',
130
+ active: true,
131
  addresses: new wp.ccf.collections.FormNotificationAddresses(),
132
  fromType: 'default',
133
  fromAddress: '',
137
  subjectField: '',
138
  fromNameType: 'custom',
139
  fromName: 'WordPress',
140
+ fromNameField: '',
141
+
142
+ replyToType: 'default',
143
+ replyToAddress: '',
144
+ replyToField: '',
145
+
146
+
147
+ replyToNameType: 'custom',
148
+ replyToName: 'WordPress',
149
+ replyToNameField: ''
150
  };
151
  },
152
 
203
  fields: new wp.ccf.collections.Fields(),
204
  type: 'ccf_form',
205
  status: 'publish',
206
+ hideTitle: false,
207
  description: '',
208
  buttonText: 'Submit Form',
209
  buttonClass: '',
assets/js/manager/views.js CHANGED
@@ -401,6 +401,8 @@
401
  events: {
402
  'change select.form-email-notification-from-type': 'toggleNotificationFields',
403
  'change select.form-email-notification-from-name-type': 'toggleNotificationFields',
 
 
404
  'change select.form-email-notification-subject-type': 'toggleNotificationFields',
405
  'click .close-notification': 'changeContext',
406
  'click .edit-notification': 'changeContext',
@@ -492,6 +494,10 @@
492
  emailNotificationFromField.innerHTML = '';
493
  emailNotificationFromField.disabled = false;
494
 
 
 
 
 
495
  var emailNotificationSubjectField = this.el.querySelectorAll( '.form-email-notification-subject-field' )[0];
496
  emailNotificationSubjectField.innerHTML = '';
497
  emailNotificationSubjectField.disabled = false;
@@ -500,15 +506,22 @@
500
  emailNotificationFromNameField.innerHTML = '';
501
  emailNotificationFromNameField.disabled = false;
502
 
 
 
 
 
503
  var fields = this.form.get( 'fields' ),
504
  addressFieldsAdded = 0,
505
  nameFieldsAdded = 0,
506
  subjectFieldsAdded = 0;
507
 
508
- var addressField = this.model.get( 'emailNotificationFromField' );
509
- var subjectField = this.model.get( 'emailNotificationSubjectField' );
510
- var nameField = this.model.get( 'emailNotificationFromNameField' ),
511
- option;
 
 
 
512
 
513
  if ( fields.length >= 1 ) {
514
  fields.each( function( field ) {
@@ -523,6 +536,16 @@
523
 
524
  emailNotificationFromField.appendChild( option );
525
 
 
 
 
 
 
 
 
 
 
 
526
  addressFieldsAdded++;
527
  } if ( 'name' === field.get( 'type' ) || 'single-line-text' === field.get( 'type' ) || 'radio' === field.get( 'type' ) || 'dropdown' === field.get( 'type' ) ) {
528
  option = document.createElement( 'option' );
@@ -535,6 +558,16 @@
535
 
536
  emailNotificationFromNameField.appendChild( option );
537
 
 
 
 
 
 
 
 
 
 
 
538
  nameFieldsAdded++;
539
  } if ( 'single-line-text' === field.get( 'type' ) || 'radio' === field.get( 'type' ) || 'dropdown' === field.get( 'type' ) ) {
540
  // @Todo: add more applicable fields
@@ -560,6 +593,12 @@
560
  option.value = '';
561
  emailNotificationFromField.appendChild( option );
562
  emailNotificationFromField.disabled = true;
 
 
 
 
 
 
563
  }
564
 
565
  if ( 0 === nameFieldsAdded ) {
@@ -600,6 +639,24 @@
600
 
601
  var emailNotificationFromNameType = this.el.querySelectorAll( '.form-email-notification-from-name-type' )[0];
602
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
603
  emailNotificationFromAddress.style.display = 'none';
604
  emailNotificationFromField.style.display = 'none';
605
 
@@ -626,6 +683,24 @@
626
  } else if ( 'field' === emailNotificationFromNameType.value ) {
627
  emailNotificationFromNameField.style.display = 'block';
628
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
629
  },
630
 
631
  save: function() {
@@ -665,6 +740,24 @@
665
  var emailNotificationFromNameField = this.el.querySelectorAll( '.form-email-notification-from-name-field' )[0].value;
666
  this.model.set( 'fromNameField', emailNotificationFromNameField );
667
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
668
  var emailNotificationSubjectType = this.el.querySelectorAll( '.form-email-notification-subject-type' )[0].value;
669
  this.model.set( 'subjectType', emailNotificationSubjectType );
670
 
@@ -1827,6 +1920,9 @@
1827
  var title = this.el.querySelectorAll( '.form-title' )[0].value;
1828
  this.model.set( 'title', { raw: title } );
1829
 
 
 
 
1830
  var description = this.el.querySelectorAll( '.form-description' )[0].value;
1831
  this.model.set( 'description', description );
1832
 
401
  events: {
402
  'change select.form-email-notification-from-type': 'toggleNotificationFields',
403
  'change select.form-email-notification-from-name-type': 'toggleNotificationFields',
404
+ 'change select.form-email-notification-reply-to-type': 'toggleNotificationFields',
405
+ 'change select.form-email-notification-reply-to-name-type': 'toggleNotificationFields',
406
  'change select.form-email-notification-subject-type': 'toggleNotificationFields',
407
  'click .close-notification': 'changeContext',
408
  'click .edit-notification': 'changeContext',
494
  emailNotificationFromField.innerHTML = '';
495
  emailNotificationFromField.disabled = false;
496
 
497
+ var emailNotificationReplyToField = this.el.querySelectorAll( '.form-email-notification-reply-to-field' )[0];
498
+ emailNotificationReplyToField.innerHTML = '';
499
+ emailNotificationReplyToField.disabled = false;
500
+
501
  var emailNotificationSubjectField = this.el.querySelectorAll( '.form-email-notification-subject-field' )[0];
502
  emailNotificationSubjectField.innerHTML = '';
503
  emailNotificationSubjectField.disabled = false;
506
  emailNotificationFromNameField.innerHTML = '';
507
  emailNotificationFromNameField.disabled = false;
508
 
509
+ var emailNotificationReplyToNameField = this.el.querySelectorAll( '.form-email-notification-reply-to-name-field' )[0];
510
+ emailNotificationReplyToNameField.innerHTML = '';
511
+ emailNotificationReplyToNameField.disabled = false;
512
+
513
  var fields = this.form.get( 'fields' ),
514
  addressFieldsAdded = 0,
515
  nameFieldsAdded = 0,
516
  subjectFieldsAdded = 0;
517
 
518
+ var addressField = this.model.get( 'fromField' );
519
+ var replyToAddressField = this.model.get( 'replyToField' );
520
+ var subjectField = this.model.get( 'subjectField' );
521
+ var nameField = this.model.get( 'fromNameField' ),
522
+ replyToNameField = this.model.get( 'replyToNameField' ),
523
+ option,
524
+ replyToOption;
525
 
526
  if ( fields.length >= 1 ) {
527
  fields.each( function( field ) {
536
 
537
  emailNotificationFromField.appendChild( option );
538
 
539
+ replyToOption = document.createElement( 'option' );
540
+ replyToOption.innerHTML = field.get( 'slug' );
541
+ replyToOption.value = field.get( 'slug' );
542
+
543
+ if ( field.get( 'slug' ) === replyToAddressField ) {
544
+ replyToOption.selected = true;
545
+ }
546
+
547
+ emailNotificationReplyToField.appendChild( replyToOption );
548
+
549
  addressFieldsAdded++;
550
  } if ( 'name' === field.get( 'type' ) || 'single-line-text' === field.get( 'type' ) || 'radio' === field.get( 'type' ) || 'dropdown' === field.get( 'type' ) ) {
551
  option = document.createElement( 'option' );
558
 
559
  emailNotificationFromNameField.appendChild( option );
560
 
561
+ replyToOption = document.createElement( 'option' );
562
+ replyToOption.innerHTML = field.get( 'slug' );
563
+ replyToOption.value = field.get( 'slug' );
564
+
565
+ if ( field.get( 'slug' ) === replyToNameField ) {
566
+ replyToOption.selected = true;
567
+ }
568
+
569
+ emailNotificationReplyToNameField.appendChild( replyToOption );
570
+
571
  nameFieldsAdded++;
572
  } if ( 'single-line-text' === field.get( 'type' ) || 'radio' === field.get( 'type' ) || 'dropdown' === field.get( 'type' ) ) {
573
  // @Todo: add more applicable fields
593
  option.value = '';
594
  emailNotificationFromField.appendChild( option );
595
  emailNotificationFromField.disabled = true;
596
+
597
+ option = document.createElement( 'option' );
598
+ option.innerHTML = ccfSettings.noEmailFields;
599
+ option.value = '';
600
+ emailNotificationReplyToField.appendChild( option );
601
+ emailNotificationReplyToField.disabled = true;
602
  }
603
 
604
  if ( 0 === nameFieldsAdded ) {
639
 
640
  var emailNotificationFromNameType = this.el.querySelectorAll( '.form-email-notification-from-name-type' )[0];
641
 
642
+
643
+
644
+ var emailNotificationReplyToAddress = this.el.querySelectorAll( '.email-notification-reply-to-address' )[0];
645
+
646
+ var emailNotificationReplyToField = this.el.querySelectorAll( '.email-notification-reply-to-field' )[0];
647
+
648
+ var emailNotificationReplyToType = this.el.querySelectorAll( '.form-email-notification-reply-to-type' )[0];
649
+
650
+ var emailNotificationReplyToName = this.el.querySelectorAll( '.email-notification-reply-to-name' )[0];
651
+
652
+ var emailNotificationReplyToNameField = this.el.querySelectorAll( '.email-notification-reply-to-name-field' )[0];
653
+
654
+ var emailNotificationReplyToNameType = this.el.querySelectorAll( '.form-email-notification-reply-to-name-type' )[0];
655
+
656
+
657
+
658
+
659
+
660
  emailNotificationFromAddress.style.display = 'none';
661
  emailNotificationFromField.style.display = 'none';
662
 
683
  } else if ( 'field' === emailNotificationFromNameType.value ) {
684
  emailNotificationFromNameField.style.display = 'block';
685
  }
686
+
687
+ emailNotificationReplyToAddress.style.display = 'none';
688
+ emailNotificationReplyToField.style.display = 'none';
689
+
690
+ if ( 'custom' === emailNotificationReplyToType.value ) {
691
+ emailNotificationReplyToAddress.style.display = 'block';
692
+ } else if ( 'field' === emailNotificationReplyToType.value ) {
693
+ emailNotificationReplyToField.style.display = 'block';
694
+ }
695
+
696
+ emailNotificationReplyToName.style.display = 'none';
697
+ emailNotificationReplyToNameField.style.display = 'none';
698
+
699
+ if ( 'custom' === emailNotificationReplyToNameType.value ) {
700
+ emailNotificationReplyToName.style.display = 'block';
701
+ } else if ( 'field' === emailNotificationReplyToNameType.value ) {
702
+ emailNotificationReplyToNameField.style.display = 'block';
703
+ }
704
  },
705
 
706
  save: function() {
740
  var emailNotificationFromNameField = this.el.querySelectorAll( '.form-email-notification-from-name-field' )[0].value;
741
  this.model.set( 'fromNameField', emailNotificationFromNameField );
742
 
743
+ var emailNotificationReplyToType = this.el.querySelectorAll( '.form-email-notification-reply-to-type' )[0].value;
744
+ this.model.set( 'replyToType', emailNotificationReplyToType );
745
+
746
+ var emailNotificationReplyToAddress = this.el.querySelectorAll( '.form-email-notification-reply-to-address' )[0].value;
747
+ this.model.set( 'replyToAddress', emailNotificationReplyToAddress );
748
+
749
+ var emailNotificationReplyToField = this.el.querySelectorAll( '.form-email-notification-reply-to-field' )[0].value;
750
+ this.model.set( 'replyToField', emailNotificationReplyToField );
751
+
752
+ var emailNotificationReplyToNameType = this.el.querySelectorAll( '.form-email-notification-reply-to-name-type' )[0].value;
753
+ this.model.set( 'replyToNameType', emailNotificationReplyToNameType );
754
+
755
+ var emailNotificationReplyToName = this.el.querySelectorAll( '.form-email-notification-reply-to-name' )[0].value;
756
+ this.model.set( 'replyToName', emailNotificationReplyToName );
757
+
758
+ var emailNotificationReplyToNameField = this.el.querySelectorAll( '.form-email-notification-reply-to-name-field' )[0].value;
759
+ this.model.set( 'replyToNameField', emailNotificationReplyToNameField );
760
+
761
  var emailNotificationSubjectType = this.el.querySelectorAll( '.form-email-notification-subject-type' )[0].value;
762
  this.model.set( 'subjectType', emailNotificationSubjectType );
763
 
1920
  var title = this.el.querySelectorAll( '.form-title' )[0].value;
1921
  this.model.set( 'title', { raw: title } );
1922
 
1923
+ var hideTitle = this.el.querySelectorAll( '.hide-title' )[0].value;
1924
+ this.model.set( 'hideTitle', ( parseInt( hideTitle ) ) ? true : false );
1925
+
1926
  var description = this.el.querySelectorAll( '.form-description' )[0].value;
1927
  this.model.set( 'description', description );
1928
 
assets/scss/admin.scss CHANGED
@@ -43,4 +43,23 @@
43
  .ccf-subscribe input[type=email] {
44
  margin-left: 5px;
45
  margin-right: 5px;
46
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  .ccf-subscribe input[type=email] {
44
  margin-left: 5px;
45
  margin-right: 5px;
46
+ }
47
+
48
+ #wpfooter .ccf-please-rate {
49
+ text-align: right;
50
+ margin-bottom: 10px;
51
+ }
52
+
53
+ #wpfooter .ccf-please-rate a {
54
+ color: inherit;
55
+ text-decoration: none;
56
+ }
57
+
58
+ #wpfooter .ccf-please-rate a span {
59
+ color: #0073aa;
60
+ }
61
+
62
+ #wpfooter .ccf-please-rate a:hover span {
63
+ color: #00a0d2;
64
+ }
65
+
classes/class-ccf-ads.php CHANGED
@@ -17,6 +17,7 @@ class CCF_Ads {
17
  public function setup() {
18
  add_action( 'admin_notices', array( $this, 'show_ad' ) );
19
  add_action( 'init', array( $this, 'process_submission' ) );
 
20
  }
21
 
22
  public function process_submission() {
@@ -94,6 +95,44 @@ class CCF_Ads {
94
  <?php
95
  }
96
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  /**
98
  * Return singleton instance of class
99
  *
17
  public function setup() {
18
  add_action( 'admin_notices', array( $this, 'show_ad' ) );
19
  add_action( 'init', array( $this, 'process_submission' ) );
20
+ add_action( 'in_admin_footer', array( $this, 'please_rate' ) );
21
  }
22
 
23
  public function process_submission() {
95
  <?php
96
  }
97
 
98
+ /**
99
+ * Output please rate
100
+ *
101
+ * @since 6.9.4
102
+ */
103
+ public function please_rate() {
104
+ global $pagenow;
105
+
106
+ if ( apply_filters( 'ccf_hide_please_rate', false ) ) {
107
+ return;
108
+ }
109
+
110
+ if ( 'edit.php' === $pagenow || 'post-new.php' === $pagenow ) {
111
+ if ( empty( $_GET['post_type'] ) || 'ccf_form' !== $_GET['post_type'] ) {
112
+ return;
113
+ }
114
+ }
115
+
116
+ if ( 'post.php' === $pagenow ) {
117
+ if ( 'ccf_form' !== get_post_type() ) {
118
+ return;
119
+ }
120
+ }
121
+
122
+ if ( 'post.php' !== $pagenow && 'edit.php' !== $pagenow && 'post-new.php' !== $pagenow ) {
123
+ return;
124
+ }
125
+
126
+ ?>
127
+ <p class="ccf-please-rate">
128
+ <a href="https://wordpress.org/support/view/plugin-reviews/custom-contact-forms#postform">
129
+
130
+ <?php _e( "We need your support. Please rate Custom Contact Forms five <span alt=\"f155\" class=\"dashicons dashicons-star-filled\"></span>'s", 'custom-contact-forms' ); ?>
131
+ </a>
132
+ </p>
133
+ <?php
134
+ }
135
+
136
  /**
137
  * Return singleton instance of class
138
  *
classes/class-ccf-api-form-controller.php CHANGED
@@ -462,7 +462,7 @@ class CCF_API_Form_Controller extends WP_REST_Controller {
462
  update_post_meta( $result, 'ccf_form_buttonText', sanitize_text_field( $data['buttonText'] ) );
463
  }
464
 
465
- if ( isset( $data['buttonText'] ) ) {
466
  update_post_meta( $result, 'ccf_form_buttonClass', sanitize_text_field( $data['buttonClass'] ) );
467
  }
468
 
@@ -490,6 +490,10 @@ class CCF_API_Form_Controller extends WP_REST_Controller {
490
  update_post_meta( $result, 'ccf_form_pause', (bool) $data['pause'] );
491
  }
492
 
 
 
 
 
493
  if ( isset( $data['requireLoggedIn'] ) ) {
494
  update_post_meta( $result, 'ccf_form_require_logged_in', (bool) $data['requireLoggedIn'] );
495
  }
@@ -1028,6 +1032,7 @@ class CCF_API_Form_Controller extends WP_REST_Controller {
1028
  $data['completionRedirectUrl'] = esc_url_raw( get_post_meta( $data['id'], 'ccf_form_completion_redirect_url', true ) );
1029
  $data['completionMessage'] = esc_html( get_post_meta( $data['id'], 'ccf_form_completion_message', true ) );
1030
  $data['pause'] = (bool) get_post_meta( $data['id'], 'ccf_form_pause', true );
 
1031
  $data['requireLoggedIn'] = (bool) get_post_meta( $data['id'], 'ccf_form_require_logged_in', true );
1032
  $data['postCreation'] = (bool) get_post_meta( $data['id'], 'ccf_form_post_creation', true );
1033
  $data['postCreationType'] = esc_html( get_post_meta( $data['id'], 'ccf_form_post_creation_type', true ) );
462
  update_post_meta( $result, 'ccf_form_buttonText', sanitize_text_field( $data['buttonText'] ) );
463
  }
464
 
465
+ if ( isset( $data['buttonClass'] ) ) {
466
  update_post_meta( $result, 'ccf_form_buttonClass', sanitize_text_field( $data['buttonClass'] ) );
467
  }
468
 
490
  update_post_meta( $result, 'ccf_form_pause', (bool) $data['pause'] );
491
  }
492
 
493
+ if ( isset( $data['hideTitle'] ) ) {
494
+ update_post_meta( $result, 'ccf_form_hide_title', (bool) $data['hideTitle'] );
495
+ }
496
+
497
  if ( isset( $data['requireLoggedIn'] ) ) {
498
  update_post_meta( $result, 'ccf_form_require_logged_in', (bool) $data['requireLoggedIn'] );
499
  }
1032
  $data['completionRedirectUrl'] = esc_url_raw( get_post_meta( $data['id'], 'ccf_form_completion_redirect_url', true ) );
1033
  $data['completionMessage'] = esc_html( get_post_meta( $data['id'], 'ccf_form_completion_message', true ) );
1034
  $data['pause'] = (bool) get_post_meta( $data['id'], 'ccf_form_pause', true );
1035
+ $data['hideTitle'] = (bool) get_post_meta( $data['id'], 'ccf_form_hide_title', true );
1036
  $data['requireLoggedIn'] = (bool) get_post_meta( $data['id'], 'ccf_form_require_logged_in', true );
1037
  $data['postCreation'] = (bool) get_post_meta( $data['id'], 'ccf_form_post_creation', true );
1038
  $data['postCreationType'] = esc_html( get_post_meta( $data['id'], 'ccf_form_post_creation_type', true ) );
classes/class-ccf-form-handler.php CHANGED
@@ -600,16 +600,8 @@ class CCF_Form_Handler {
600
 
601
  $submission_response = $this->process_submission();
602
 
603
- if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
604
- // Hack to fix IE prompting for download
605
- echo json_encode( $submission_response );
606
- wp_die();
607
- } else {
608
- if ( ! empty( $submission_response['completion_redirect_url'] ) ) {
609
- wp_redirect( esc_url_raw( $submission_response['completion_redirect_url'] ) );
610
- exit;
611
- }
612
- }
613
  }
614
 
615
  /**
@@ -974,6 +966,9 @@ class CCF_Form_Handler {
974
  $name = null;
975
  $email = null;
976
 
 
 
 
977
  $sitename = strtolower( $_SERVER['SERVER_NAME'] );
978
  if ( substr( $sitename, 0, 4 ) === 'www.' ) {
979
  $sitename = substr( $sitename, 4 );
@@ -1010,15 +1005,59 @@ class CCF_Form_Handler {
1010
  }
1011
  }
1012
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1013
  if ( ! empty( $name ) && ! empty( $email ) ) {
1014
  $headers[] = 'From: ' . sanitize_text_field( $name ) . ' <' . sanitize_email( $email ) . '>';
1015
- $headers[] = 'Reply-To: ' . sanitize_email( $email );
1016
  } elseif ( ! empty( $name ) && empty( $email ) ) {
1017
  $headers[] = 'From: ' . sanitize_text_field( $name ) . ' <' . sanitize_email( $default_from_email ) . '>';
1018
  } elseif ( empty( $name ) && ! empty( $email ) ) {
1019
  // @Todo: investigate how wp_mail handles From: email
1020
  $headers[] = 'From: ' . sanitize_email( $email );
1021
- $headers[] = 'Reply-To: ' . sanitize_email( $email );
 
 
 
 
 
 
 
 
 
 
 
 
1022
  }
1023
 
1024
  $email_notification_subject_type = $notification['subjectType'];
600
 
601
  $submission_response = $this->process_submission();
602
 
603
+ echo json_encode( $submission_response );
604
+ exit;
 
 
 
 
 
 
 
 
605
  }
606
 
607
  /**
966
  $name = null;
967
  $email = null;
968
 
969
+ $reply_to_name = null;
970
+ $reply_to_email = null;
971
+
972
  $sitename = strtolower( $_SERVER['SERVER_NAME'] );
973
  if ( substr( $sitename, 0, 4 ) === 'www.' ) {
974
  $sitename = substr( $sitename, 4 );
1005
  }
1006
  }
1007
 
1008
+ if ( 'custom' === $notification['replyToNameType'] ) {
1009
+ $reply_to_name = $notification['replyToName'];
1010
+ } else {
1011
+ $name_field = $notification['replyToNameField'];
1012
+
1013
+ if ( ! empty( $name_field ) && ! empty( $submission[ $name_field ] ) ) {
1014
+ if ( is_array( $submission[ $name_field ] ) ) {
1015
+ if ( ! empty( $submission[ $name_field ]['first'] ) || ! empty( $submission[ $name_field ]['last'] ) ) {
1016
+ $reply_to_name = $submission[ $name_field ]['first'] . ' ' . $submission[ $name_field ]['last'];
1017
+ }
1018
+ } else {
1019
+ $reply_to_name = $submission[ $name_field ];
1020
+ }
1021
+ }
1022
+ }
1023
+
1024
+ if ( 'custom' === $notification['replyToType'] ) {
1025
+ $reply_to_email = $notification['replyToAddress'];
1026
+ } elseif ( 'field' === $notification['replyToType'] ) {
1027
+ $email_field = $notification['replyToField'];
1028
+
1029
+ if ( ! empty( $email_field ) && ! empty( $submission[ $email_field ] ) ) {
1030
+ if ( is_array( $submission[ $email_field ] ) && ! empty( $submission[ $email_field ]['confirm'] ) ) {
1031
+ $reply_to_email = $submission[ $email_field ]['confirm'];
1032
+ } else {
1033
+ $reply_to_email = $submission[ $email_field ];
1034
+ }
1035
+ }
1036
+ }
1037
+
1038
+ $reply_to = '';
1039
+
1040
  if ( ! empty( $name ) && ! empty( $email ) ) {
1041
  $headers[] = 'From: ' . sanitize_text_field( $name ) . ' <' . sanitize_email( $email ) . '>';
1042
+ $reply_to = 'Reply-To: ' . sanitize_email( $email );
1043
  } elseif ( ! empty( $name ) && empty( $email ) ) {
1044
  $headers[] = 'From: ' . sanitize_text_field( $name ) . ' <' . sanitize_email( $default_from_email ) . '>';
1045
  } elseif ( empty( $name ) && ! empty( $email ) ) {
1046
  // @Todo: investigate how wp_mail handles From: email
1047
  $headers[] = 'From: ' . sanitize_email( $email );
1048
+ $reply_to = 'Reply-To: ' . sanitize_email( $email );
1049
+ }
1050
+
1051
+ if ( ! empty( $reply_to_name ) && ! empty( $reply_to_email ) ) {
1052
+ $reply_to = 'Reply-To: ' . sanitize_text_field( $reply_to_name ) . ' <' . sanitize_email( $reply_to_email ) . '>';
1053
+ } elseif ( ! empty( $reply_to_name ) && empty( $reply_to_email ) ) {
1054
+ $reply_to = 'Reply-To: ' . sanitize_text_field( $reply_to_name ) . ' <' . sanitize_email( $default_from_email ) . '>';
1055
+ } elseif ( empty( $reply_to_name ) && ! empty( $reply_to_email ) ) {
1056
+ $reply_to = 'Reply-To: ' . sanitize_email( $reply_to_email );
1057
+ }
1058
+
1059
+ if ( ! empty( $reply_to ) ) {
1060
+ $headers[] = $reply_to;
1061
  }
1062
 
1063
  $email_notification_subject_type = $notification['subjectType'];
classes/class-ccf-form-manager.php CHANGED
@@ -241,56 +241,63 @@ class CCF_Form_Manager {
241
  <label for="ccf_form_email_notification_active"><strong><?php esc_html_e( 'Activate Notification:', 'custom-contact-forms' ); ?></strong></label>
242
 
243
  <select name="email_notification_active" class="form-email-notification-active" id="ccf_form_email_notification_active">
244
- <option value="0"><?php esc_html_e( 'No', 'custom-contact-forms' ); ?></option>
245
- <option value="1" <# if ( notification.active ) { #>selected<# } #>><?php esc_html_e( 'Yes', 'custom-contact-forms' ); ?></option>
246
  </select>
247
 
248
  <span class="explain"><?php esc_html_e( 'Only active notifications will be sent.', 'custom-contact-forms' ); ?></span>
249
  </p>
250
 
 
 
 
 
251
  <p class="email-notification-setting">
252
- <label for="ccf_form_email_notification_from_type"><?php esc_html_e( '"From" Email Address Type:', 'custom-contact-forms' ); ?></label>
253
- <select name="email_notification_from_type" class="form-email-notification-from-type" id="ccf_form_email_notification_from_type">
254
- <option value="default"><?php esc_html_e( 'WordPress Default', 'custom-contact-forms' ); ?></option>
255
- <option value="custom" <# if ( 'custom' === notification.fromType ) { #>selected<# } #>><?php esc_html_e( 'Custom Email', 'custom-contact-forms' ); ?></option>
256
- <option value="field" <# if ( 'field' === notification.fromType ) { #>selected<# } #>><?php esc_html_e( 'Form Field', 'custom-contact-forms' ); ?></option>
257
  </select>
258
 
259
- <span class="explain"><?php esc_html_e( 'You can set the notification emails from address to be the WP default, a custom email address, or pull the address from a field in the form.', 'custom-contact-forms' ); ?></span>
260
  </p>
261
 
262
- <p class="email-notification-from-address">
263
- <label for="ccf_form_email_notification_from_address"><?php esc_html_e( 'Custom "From" Email Address:', 'custom-contact-forms' ); ?></label>
264
- <input class="widefat form-email-notification-from-address" id="ccf_form_email_notification_from_address" name="email-notification-from-address" value="{{ notification.fromAddress }}">
265
  </p>
266
 
267
- <p class="email-notification-from-field">
268
- <label for="ccf_form_email_notification_from_field"><?php esc_html_e( 'Pull "From" Email Dynamically from Field:', 'custom-contact-forms' ); ?></label>
269
- <select name="email_notification_from_field" class="form-email-notification-from-field" id="ccf_form_email_notification_from_field">
270
  </select>
271
  </p>
272
 
273
  <p class="email-notification-setting">
274
- <label for="ccf_form_email_notification_from_name_type"><?php esc_html_e( '"From" Name Type:', 'custom-contact-forms' ); ?></label>
275
- <select name="email_notification_from_name_type" class="form-email-notification-from-name-type" id="ccf_form_email_notification_from_name_type">
276
  <option value="custom"><?php esc_html_e( 'Custom Name', 'custom-contact-forms' ); ?></option>
277
- <option value="field" <# if ( 'field' === notification.fromNameType ) { #>selected<# } #>><?php esc_html_e( 'Form Field', 'custom-contact-forms' ); ?></option>
278
  </select>
279
 
280
- <span class="explain"><?php esc_html_e( 'You can set the notification emails from name to be a custom name or pull the name from a field in the form.', 'custom-contact-forms' ); ?></span>
281
  </p>
282
 
283
- <p class="email-notification-from-name">
284
- <label for="ccf_form_email_notification_from_name"><?php esc_html_e( 'Custom "From" Name:', 'custom-contact-forms' ); ?></label>
285
- <input class="widefat form-email-notification-from-name" id="ccf_form_email_notification_from_name" name="email-notification-from-name" value="{{ notification.fromName }}">
286
  </p>
287
 
288
- <p class="email-notification-from-name-field">
289
- <label for="ccf_form_email_notification_from_name_field"><?php esc_html_e( 'Pull "From" Name Dynamically from Field:', 'custom-contact-forms' ); ?></label>
290
- <select name="email_notification_from_name_field" class="form-email-notification-from-name-field" id="ccf_form_email_notification_from_name_field">
291
  </select>
292
  </p>
293
 
 
 
 
294
  <p class="email-notification-setting">
295
  <label for="ccf_form_email_notification_subject_type"><?php esc_html_e( 'Email Subject Type:', 'custom-contact-forms' ); ?></label>
296
  <select name="email_notification_subject_type" class="form-email-notification-subject-type" id="ccf_form_email_notification_subject_type">
@@ -312,6 +319,52 @@ class CCF_Form_Manager {
312
  <select name="email_notification_subject_field" class="form-email-notification-subject-field" id="ccf_form_email_notification_subject_field">
313
  </select>
314
  </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
315
  </div>
316
  </td>
317
  <# } #>
@@ -341,6 +394,15 @@ class CCF_Form_Manager {
341
  <input class="widefat form-title" id="ccf_form_title" name="title" type="text" value="{{ form.title.raw }}">
342
  </p>
343
 
 
 
 
 
 
 
 
 
 
344
  <p>
345
  <label for="ccf_form_description"><?php esc_html_e( 'Form Description:', 'custom-contact-forms' ); ?></label>
346
  <textarea class="widefat form-description" id="ccf_form_description" name="description">{{ form.description }}</textarea>
241
  <label for="ccf_form_email_notification_active"><strong><?php esc_html_e( 'Activate Notification:', 'custom-contact-forms' ); ?></strong></label>
242
 
243
  <select name="email_notification_active" class="form-email-notification-active" id="ccf_form_email_notification_active">
244
+ <option value="1"><?php esc_html_e( 'Yes', 'custom-contact-forms' ); ?></option>
245
+ <option value="0" <# if ( ! notification.active ) { #>selected<# } #>><?php esc_html_e( 'No', 'custom-contact-forms' ); ?></option>
246
  </select>
247
 
248
  <span class="explain"><?php esc_html_e( 'Only active notifications will be sent.', 'custom-contact-forms' ); ?></span>
249
  </p>
250
 
251
+
252
+
253
+
254
+
255
  <p class="email-notification-setting">
256
+ <label for="ccf_form_email_notification_reply_to_type"><?php esc_html_e( '"Reply To" Address Type:', 'custom-contact-forms' ); ?></label>
257
+ <select name="email_notification_reply_to_type" class="form-email-notification-reply-to-type" id="ccf_form_email_notification_reply_to_type">
258
+ <option value="default"><?php esc_html_e( 'Default', 'custom-contact-forms' ); ?></option>
259
+ <option value="custom" <# if ( 'custom' === notification.replyToType ) { #>selected<# } #>><?php esc_html_e( 'Custom Email', 'custom-contact-forms' ); ?></option>
260
+ <option value="field" <# if ( 'field' === notification.replyToType ) { #>selected<# } #>><?php esc_html_e( 'Form Field', 'custom-contact-forms' ); ?></option>
261
  </select>
262
 
263
+ <span class="explain"><?php esc_html_e( 'You can set the notification emails "reply to" address to be the WP default, a custom email address, or pull the address from a field in the form.', 'custom-contact-forms' ); ?></span>
264
  </p>
265
 
266
+ <p class="email-notification-reply-to-address">
267
+ <label for="ccf_form_email_notification_reply_to_address"><?php esc_html_e( 'Custom "Reply To" Email Address:', 'custom-contact-forms' ); ?></label>
268
+ <input class="widefat form-email-notification-reply-to-address" id="ccf_form_email_notification_reply_to_address" name="email-notification-reply-to-address" value="{{ notification.replyToAddress }}">
269
  </p>
270
 
271
+ <p class="email-notification-reply-to-field">
272
+ <label for="ccf_form_email_notification_reply_to_field"><?php esc_html_e( 'Pull "Reply To" Email Dynamically from Field:', 'custom-contact-forms' ); ?></label>
273
+ <select name="email_notification_reply_to_field" class="form-email-notification-reply-to-field" id="ccf_form_email_notification_reply_to_field">
274
  </select>
275
  </p>
276
 
277
  <p class="email-notification-setting">
278
+ <label for="ccf_form_email_notification_reply_to_name_type"><?php esc_html_e( '"Reply To" Name Type:', 'custom-contact-forms' ); ?></label>
279
+ <select name="email_notification_reply_to_name_type" class="form-email-notification-reply-to-name-type" id="ccf_form_email_notification_reply_to_name_type">
280
  <option value="custom"><?php esc_html_e( 'Custom Name', 'custom-contact-forms' ); ?></option>
281
+ <option value="field" <# if ( 'field' === notification.replyToNameType ) { #>selected<# } #>><?php esc_html_e( 'Form Field', 'custom-contact-forms' ); ?></option>
282
  </select>
283
 
284
+ <span class="explain"><?php esc_html_e( 'You can set the notification emails "reply to" name to be a custom name or pull the name from a field in the form.', 'custom-contact-forms' ); ?></span>
285
  </p>
286
 
287
+ <p class="email-notification-reply-to-name">
288
+ <label for="ccf_form_email_notification_reply_to_name"><?php esc_html_e( '"Reply To" Name:', 'custom-contact-forms' ); ?></label>
289
+ <input class="widefat form-email-notification-reply-to-name" id="ccf_form_email_notification_reply_to_name" name="email-notification-reply-to-name" value="{{ notification.replyToName }}">
290
  </p>
291
 
292
+ <p class="email-notification-reply-to-name-field">
293
+ <label for="ccf_form_email_notification_reply_to_name_field"><?php esc_html_e( 'Pull "Reply To" Name Dynamically from Field:', 'custom-contact-forms' ); ?></label>
294
+ <select name="email_notification_reply_to_name_field" class="form-email-notification-reply-to-name-field" id="ccf_form_email_notification_reply_to_name_field">
295
  </select>
296
  </p>
297
 
298
+
299
+
300
+
301
  <p class="email-notification-setting">
302
  <label for="ccf_form_email_notification_subject_type"><?php esc_html_e( 'Email Subject Type:', 'custom-contact-forms' ); ?></label>
303
  <select name="email_notification_subject_type" class="form-email-notification-subject-type" id="ccf_form_email_notification_subject_type">
319
  <select name="email_notification_subject_field" class="form-email-notification-subject-field" id="ccf_form_email_notification_subject_field">
320
  </select>
321
  </p>
322
+
323
+
324
+ <p><strong><?php esc_html_e( 'We highly recommend leaving the "from" fields below as their defaults to ensure your notification emails get delivered.', 'custom-contact-forms' ); ?></strong></p>
325
+
326
+ <p class="email-notification-setting">
327
+ <label for="ccf_form_email_notification_from_type"><?php esc_html_e( '"From" Email Address Type:', 'custom-contact-forms' ); ?></label>
328
+ <select name="email_notification_from_type" class="form-email-notification-from-type" id="ccf_form_email_notification_from_type">
329
+ <option value="default"><?php esc_html_e( 'WordPress Default', 'custom-contact-forms' ); ?></option>
330
+ <option value="custom" <# if ( 'custom' === notification.fromType ) { #>selected<# } #>><?php esc_html_e( 'Custom Email', 'custom-contact-forms' ); ?></option>
331
+ <option value="field" <# if ( 'field' === notification.fromType ) { #>selected<# } #>><?php esc_html_e( 'Form Field', 'custom-contact-forms' ); ?></option>
332
+ </select>
333
+
334
+ <span class="explain"><?php esc_html_e( 'You can set the notification emails from address to be the WP default, a custom email address, or pull the address from a field in the form.', 'custom-contact-forms' ); ?></span>
335
+ </p>
336
+
337
+ <p class="email-notification-from-address">
338
+ <label for="ccf_form_email_notification_from_address"><?php esc_html_e( 'Custom "From" Email Address:', 'custom-contact-forms' ); ?></label>
339
+ <input class="widefat form-email-notification-from-address" id="ccf_form_email_notification_from_address" name="email-notification-from-address" value="{{ notification.fromAddress }}">
340
+ </p>
341
+
342
+ <p class="email-notification-from-field">
343
+ <label for="ccf_form_email_notification_from_field"><?php esc_html_e( 'Pull "From" Email Dynamically from Field:', 'custom-contact-forms' ); ?></label>
344
+ <select name="email_notification_from_field" class="form-email-notification-from-field" id="ccf_form_email_notification_from_field">
345
+ </select>
346
+ </p>
347
+
348
+ <p class="email-notification-setting">
349
+ <label for="ccf_form_email_notification_from_name_type"><?php esc_html_e( '"From" Name Type:', 'custom-contact-forms' ); ?></label>
350
+ <select name="email_notification_from_name_type" class="form-email-notification-from-name-type" id="ccf_form_email_notification_from_name_type">
351
+ <option value="custom"><?php esc_html_e( 'Custom Name', 'custom-contact-forms' ); ?></option>
352
+ <option value="field" <# if ( 'field' === notification.fromNameType ) { #>selected<# } #>><?php esc_html_e( 'Form Field', 'custom-contact-forms' ); ?></option>
353
+ </select>
354
+
355
+ <span class="explain"><?php esc_html_e( 'You can set the notification emails from name to be a custom name or pull the name from a field in the form.', 'custom-contact-forms' ); ?></span>
356
+ </p>
357
+
358
+ <p class="email-notification-from-name">
359
+ <label for="ccf_form_email_notification_from_name"><?php esc_html_e( 'Custom "From" Name:', 'custom-contact-forms' ); ?></label>
360
+ <input class="widefat form-email-notification-from-name" id="ccf_form_email_notification_from_name" name="email-notification-from-name" value="{{ notification.fromName }}">
361
+ </p>
362
+
363
+ <p class="email-notification-from-name-field">
364
+ <label for="ccf_form_email_notification_from_name_field"><?php esc_html_e( 'Pull "From" Name Dynamically from Field:', 'custom-contact-forms' ); ?></label>
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
  <# } #>
394
  <input class="widefat form-title" id="ccf_form_title" name="title" type="text" value="{{ form.title.raw }}">
395
  </p>
396
 
397
+ <p>
398
+ <label for="ccf_form_hide_title"><?php esc_html_e( 'Hide Form Title:', 'custom-contact-forms' ); ?></label>
399
+
400
+ <select name="form_hide_title" class="hide-title" id="ccf_form_hide_title">
401
+ <option value="0"><?php esc_html_e( 'No', 'custom-contact-forms' ); ?></option>
402
+ <option value="1" <# if ( form.hideTitle ) { #>selected<# } #>><?php esc_html_e( 'Yes', 'custom-contact-forms' ); ?></option>
403
+ </select>
404
+ </p>
405
+
406
  <p>
407
  <label for="ccf_form_description"><?php esc_html_e( 'Form Description:', 'custom-contact-forms' ); ?></label>
408
  <textarea class="widefat form-description" id="ccf_form_description" name="description">{{ form.description }}</textarea>
classes/class-ccf-form-renderer.php CHANGED
@@ -244,15 +244,19 @@ class CCF_Form_Renderer {
244
  if ( empty( $theme ) ) {
245
  $theme = 'default';
246
  }
 
 
247
  ?>
248
 
249
  <div class="ccf-form-wrapper form-id-<?php echo (int) $form_id; ?>" data-form-id="<?php echo (int) $form_id; ?>">
250
  <form <?php if ( $contains_file ) : ?>enctype="multipart/form-data"<?php endif; ?> class="ccf-form ccf-theme-<?php echo esc_attr( $theme ); ?>" method="post" action="" data-form-id="<?php echo (int) $form_id; ?>">
251
 
252
- <?php $title = get_the_title( $form_id ); if ( ! empty( $title ) && apply_filters( 'ccf_show_form_title', true, $form_id ) ) : ?>
253
- <div class="form-title">
254
- <?php echo $title; ?>
255
- </div>
 
 
256
  <?php endif; ?>
257
 
258
  <?php $description = get_post_meta( $form_id, 'ccf_form_description', true ); if ( ! empty( $description ) && apply_filters( 'ccf_show_form_description', true, $form_id ) ) : ?>
244
  if ( empty( $theme ) ) {
245
  $theme = 'default';
246
  }
247
+
248
+ $hide_title = get_post_meta( $form_id, 'ccf_form_hide_title', true );
249
  ?>
250
 
251
  <div class="ccf-form-wrapper form-id-<?php echo (int) $form_id; ?>" data-form-id="<?php echo (int) $form_id; ?>">
252
  <form <?php if ( $contains_file ) : ?>enctype="multipart/form-data"<?php endif; ?> class="ccf-form ccf-theme-<?php echo esc_attr( $theme ); ?>" method="post" action="" data-form-id="<?php echo (int) $form_id; ?>">
253
 
254
+ <?php if ( empty( $hide_title ) ) : ?>
255
+ <?php $title = get_the_title( $form_id ); if ( ! empty( $title ) && apply_filters( 'ccf_show_form_title', true, $form_id ) ) : ?>
256
+ <div class="form-title">
257
+ <?php echo $title; ?>
258
+ </div>
259
+ <?php endif; ?>
260
  <?php endif; ?>
261
 
262
  <?php $description = get_post_meta( $form_id, 'ccf_form_description', true ); if ( ! empty( $description ) && apply_filters( 'ccf_show_form_description', true, $form_id ) ) : ?>
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.7
8
  * Text Domain: custom-contact-forms
9
  * Domain Path: /languages
10
  * Author URI: http://www.taylorlovett.com
@@ -14,7 +14,8 @@
14
  * Include plugin reqs
15
  */
16
 
17
- define( 'CCF_VERSION', '7.7' );
 
18
 
19
  require_once( dirname( __FILE__ ) . '/classes/class-ccf-constants.php' );
20
  require_once( dirname( __FILE__ ) . '/classes/class-ccf-custom-contact-forms.php' );
4
  * Plugin URI: http://www.taylorlovett.com
5
  * Description: Build beautiful custom forms and manage submissions the WordPress way. View live previews of your forms while you build them. Contact forms, subscription forms, payment forms, etc.
6
  * Author: Taylor Lovett
7
+ * Version: 7.8
8
  * Text Domain: custom-contact-forms
9
  * Domain Path: /languages
10
  * Author URI: http://www.taylorlovett.com
14
  * Include plugin reqs
15
  */
16
 
17
+
18
+ define( 'CCF_VERSION', '7.8' );
19
 
20
  require_once( dirname( __FILE__ ) . '/classes/class-ccf-constants.php' );
21
  require_once( dirname( __FILE__ ) . '/classes/class-ccf-custom-contact-forms.php' );
languages/custom-contact-forms.mo CHANGED
Binary file
languages/custom-contact-forms.po CHANGED
@@ -5,8 +5,8 @@ msgstr ""
5
  "Project-Id-Version: Custom Contact Forms\n"
6
  "Report-Msgid-Bugs-To: https://github.com/tlovett1/custom-contact-forms/"
7
  "issues\n"
8
- "POT-Creation-Date: 2016-03-02 23:55-0500\n"
9
- "PO-Revision-Date: 2016-03-02 23:55-0500\n"
10
  "Last-Translator: Taylor Lovett <tlovett88@gmail.com>\n"
11
  "Language-Team: \n"
12
  "Language: en\n"
@@ -23,23 +23,29 @@ msgstr ""
23
  "X-Textdomain-Support: yes\n"
24
  "X-Poedit-SearchPath-0: ..\n"
25
 
26
- #: ../classes/class-ccf-api-form-controller.php:676
 
 
 
 
 
 
27
  msgid "Form not found"
28
  msgstr ""
29
 
30
- #: ../classes/class-ccf-api-form-controller.php:702
31
  msgid "Could not create form"
32
  msgstr ""
33
 
34
- #: ../classes/class-ccf-api-form-controller.php:732
35
  msgid "Could not update form"
36
  msgstr ""
37
 
38
- #: ../classes/class-ccf-api-form-controller.php:760
39
  msgid "Could not delete form"
40
  msgstr ""
41
 
42
- #: ../classes/class-ccf-api-form-controller.php:789
43
  msgid "Could not delete submission"
44
  msgstr ""
45
 
@@ -82,111 +88,111 @@ msgid "Max file size is %d MB. "
82
  msgstr ""
83
 
84
  #: ../classes/class-ccf-field-renderer.php:625
85
- #: ../classes/class-ccf-form-manager.php:1835
86
- #: ../classes/class-ccf-form-manager.php:1860
87
  msgid "Street Address"
88
  msgstr ""
89
 
90
  #: ../classes/class-ccf-field-renderer.php:629
91
- #: ../classes/class-ccf-form-manager.php:1839
92
- #: ../classes/class-ccf-form-manager.php:1864
93
  msgid "Address Line 2"
94
  msgstr ""
95
 
96
  #: ../classes/class-ccf-field-renderer.php:636
97
- #: ../classes/class-ccf-form-manager.php:1843
98
- #: ../classes/class-ccf-form-manager.php:1868
99
  msgid "City"
100
  msgstr ""
101
 
102
  #: ../classes/class-ccf-field-renderer.php:649
103
- #: ../classes/class-ccf-form-manager.php:1851
104
  msgid "State"
105
  msgstr ""
106
 
107
  #: ../classes/class-ccf-field-renderer.php:657
108
- #: ../classes/class-ccf-form-manager.php:1855
109
  msgid "ZIP Code"
110
  msgstr ""
111
 
112
  #: ../classes/class-ccf-field-renderer.php:667
113
- #: ../classes/class-ccf-form-manager.php:1872
114
  msgid "State / Region / Province"
115
  msgstr ""
116
 
117
  #: ../classes/class-ccf-field-renderer.php:675
118
- #: ../classes/class-ccf-form-manager.php:1876
119
  msgid "ZIP / Postal Code"
120
  msgstr ""
121
 
122
  #: ../classes/class-ccf-field-renderer.php:687
123
- #: ../classes/class-ccf-form-manager.php:1884
124
  msgid "Country"
125
  msgstr ""
126
 
127
  #: ../classes/class-ccf-field-renderer.php:865
128
- #: ../classes/class-ccf-form-manager.php:1895
129
  msgid "email@example.com"
130
  msgstr ""
131
 
132
  #: ../classes/class-ccf-field-renderer.php:877
133
- #: ../classes/class-ccf-form-manager.php:327
134
- #: ../classes/class-ccf-form-manager.php:1899
135
- #: ../classes/class-ccf-form-manager.php:2213
136
  msgid "Email"
137
  msgstr ""
138
 
139
  #: ../classes/class-ccf-field-renderer.php:884
140
- #: ../classes/class-ccf-form-manager.php:1903
141
  msgid "Confirm Email"
142
  msgstr ""
143
 
144
  #: ../classes/class-ccf-field-renderer.php:950
145
- #: ../classes/class-ccf-form-manager.php:1771
146
  msgid "First"
147
  msgstr ""
148
 
149
  #: ../classes/class-ccf-field-renderer.php:957
150
- #: ../classes/class-ccf-form-manager.php:1775
151
  msgid "Last"
152
  msgstr ""
153
 
154
  #: ../classes/class-ccf-field-renderer.php:1031
155
  #: ../classes/class-ccf-field-renderer.php:1052
156
- #: ../classes/class-ccf-form-manager.php:1790
157
- #: ../classes/class-ccf-form-manager.php:1811
158
  msgid "HH"
159
  msgstr ""
160
 
161
  #: ../classes/class-ccf-field-renderer.php:1035
162
  #: ../classes/class-ccf-field-renderer.php:1056
163
- #: ../classes/class-ccf-form-manager.php:1794
164
- #: ../classes/class-ccf-form-manager.php:1815
165
  msgid "MM"
166
  msgstr ""
167
 
168
  #: ../classes/class-ccf-field-renderer.php:1039
169
  #: ../classes/class-ccf-field-renderer.php:1060
170
- #: ../classes/class-ccf-form-manager.php:1798
171
- #: ../classes/class-ccf-form-manager.php:1819
172
  msgid "AM"
173
  msgstr ""
174
 
175
  #: ../classes/class-ccf-field-renderer.php:1040
176
  #: ../classes/class-ccf-field-renderer.php:1061
177
- #: ../classes/class-ccf-form-manager.php:1799
178
- #: ../classes/class-ccf-form-manager.php:1820
179
  msgid "PM"
180
  msgstr ""
181
 
182
  #: ../classes/class-ccf-field-renderer.php:1047
183
  #: ../classes/class-ccf-form-cpt.php:510
184
- #: ../classes/class-ccf-form-manager.php:521
185
- #: ../classes/class-ccf-form-manager.php:534
186
- #: ../classes/class-ccf-form-manager.php:1806
187
- #: ../classes/class-ccf-form-manager.php:1990
188
- #: ../classes/class-ccf-form-manager.php:2004
189
- #: ../classes/class-ccf-form-manager.php:2155
190
  msgid "Date"
191
  msgstr ""
192
 
@@ -196,8 +202,8 @@ msgstr ""
196
 
197
  #: ../classes/class-ccf-form-cpt.php:324 ../classes/class-ccf-form-cpt.php:342
198
  #: ../classes/class-ccf-form-cpt.php:507
199
- #: ../classes/class-ccf-form-manager.php:524
200
- #: ../classes/class-ccf-form-manager.php:537
201
  msgid "Submissions"
202
  msgstr ""
203
 
@@ -242,7 +248,7 @@ msgid "Export"
242
  msgstr ""
243
 
244
  #: ../classes/class-ccf-form-cpt.php:445
245
- #: ../classes/class-ccf-form-manager.php:1931
246
  msgid "(No title)"
247
  msgstr ""
248
 
@@ -255,14 +261,14 @@ msgid "Form Title"
255
  msgstr ""
256
 
257
  #: ../classes/class-ccf-form-cpt.php:506
258
- #: ../classes/class-ccf-form-manager.php:522
259
- #: ../classes/class-ccf-form-manager.php:535
260
  msgid "Author"
261
  msgstr ""
262
 
263
  #: ../classes/class-ccf-form-cpt.php:508
264
- #: ../classes/class-ccf-form-manager.php:523
265
- #: ../classes/class-ccf-form-manager.php:536
266
  msgid "Number of Fields"
267
  msgstr ""
268
 
@@ -447,33 +453,33 @@ msgstr ""
447
  msgid "AM/PM is required."
448
  msgstr ""
449
 
450
- #: ../classes/class-ccf-form-handler.php:807
451
  msgid "Post created by form"
452
  msgstr ""
453
 
454
- #: ../classes/class-ccf-form-handler.php:856
455
  msgid "*Hidden Field*"
456
  msgstr ""
457
 
458
- #: ../classes/class-ccf-form-handler.php:928
459
  msgid "Form submitted from"
460
  msgstr ""
461
 
462
- #: ../classes/class-ccf-form-handler.php:937
463
  msgid "Form submitter IP"
464
  msgstr ""
465
 
466
- #: ../classes/class-ccf-form-handler.php:1026
467
  #, php-format
468
  msgid "%s: Form Submission"
469
  msgstr ""
470
 
471
- #: ../classes/class-ccf-form-handler.php:1028
472
  #, php-format
473
  msgid " to \"%s\""
474
  msgstr ""
475
 
476
- #: ../classes/class-ccf-form-handler.php:1086
477
  #: ../classes/class-ccf-form-renderer.php:196
478
  msgid "Thank you for your submission."
479
  msgstr ""
@@ -540,7 +546,7 @@ msgid "&larr; Drag fields from the left here."
540
  msgstr ""
541
 
542
  #: ../classes/class-ccf-form-manager.php:152
543
- #: ../classes/class-ccf-form-manager.php:1934
544
  msgid "Insert into post"
545
  msgstr ""
546
 
@@ -561,7 +567,7 @@ msgid "(Untitled)"
561
  msgstr ""
562
 
563
  #: ../classes/class-ccf-form-manager.php:172
564
- #: ../classes/class-ccf-form-manager.php:1933
565
  msgid "Edit"
566
  msgstr ""
567
 
@@ -570,7 +576,7 @@ msgid "Delete"
570
  msgstr ""
571
 
572
  #: ../classes/class-ccf-form-manager.php:179
573
- #: ../classes/class-ccf-form-manager.php:2262
574
  msgid "Form Submission"
575
  msgstr ""
576
 
@@ -618,568 +624,622 @@ msgid "Activate Notification:"
618
  msgstr ""
619
 
620
  #: ../classes/class-ccf-form-manager.php:244
621
- #: ../classes/class-ccf-form-manager.php:391
622
- #: ../classes/class-ccf-form-manager.php:403
623
- #: ../classes/class-ccf-form-manager.php:447
624
- #: ../classes/class-ccf-form-manager.php:575
625
- #: ../classes/class-ccf-form-manager.php:594
626
- #: ../classes/class-ccf-form-manager.php:649
627
- #: ../classes/class-ccf-form-manager.php:664
628
- #: ../classes/class-ccf-form-manager.php:778
629
- #: ../classes/class-ccf-form-manager.php:797
630
- #: ../classes/class-ccf-form-manager.php:842
631
- #: ../classes/class-ccf-form-manager.php:891
632
- #: ../classes/class-ccf-form-manager.php:940
633
- #: ../classes/class-ccf-form-manager.php:959
634
- #: ../classes/class-ccf-form-manager.php:1008
635
- #: ../classes/class-ccf-form-manager.php:1053
636
- #: ../classes/class-ccf-form-manager.php:1068
637
- #: ../classes/class-ccf-form-manager.php:1119
638
- #: ../classes/class-ccf-form-manager.php:1157
639
- #: ../classes/class-ccf-form-manager.php:1213
640
- #: ../classes/class-ccf-form-manager.php:1232
641
- #: ../classes/class-ccf-form-manager.php:1294
642
- #: ../classes/class-ccf-form-manager.php:1309
643
- #: ../classes/class-ccf-form-manager.php:1360
644
- #: ../classes/class-ccf-form-manager.php:1367
645
- #: ../classes/class-ccf-form-manager.php:1388
646
- #: ../classes/class-ccf-form-manager.php:1459
647
- #: ../classes/class-ccf-form-manager.php:1481
648
- #: ../classes/class-ccf-form-manager.php:1526
649
- #: ../classes/class-ccf-form-manager.php:1548
650
- #: ../classes/class-ccf-form-manager.php:1593
651
- #: ../classes/class-ccf-form-manager.php:1615
652
- #: ../classes/class-ccf-settings.php:103
653
- msgid "No"
 
654
  msgstr ""
655
 
656
  #: ../classes/class-ccf-form-manager.php:245
657
- #: ../classes/class-ccf-form-manager.php:392
658
- #: ../classes/class-ccf-form-manager.php:404
659
- #: ../classes/class-ccf-form-manager.php:448
660
- #: ../classes/class-ccf-form-manager.php:574
661
- #: ../classes/class-ccf-form-manager.php:595
662
- #: ../classes/class-ccf-form-manager.php:648
663
- #: ../classes/class-ccf-form-manager.php:665
664
- #: ../classes/class-ccf-form-manager.php:777
665
- #: ../classes/class-ccf-form-manager.php:798
666
- #: ../classes/class-ccf-form-manager.php:843
667
- #: ../classes/class-ccf-form-manager.php:892
668
- #: ../classes/class-ccf-form-manager.php:939
669
- #: ../classes/class-ccf-form-manager.php:960
670
- #: ../classes/class-ccf-form-manager.php:1009
671
- #: ../classes/class-ccf-form-manager.php:1052
672
- #: ../classes/class-ccf-form-manager.php:1069
673
- #: ../classes/class-ccf-form-manager.php:1118
674
- #: ../classes/class-ccf-form-manager.php:1158
675
- #: ../classes/class-ccf-form-manager.php:1212
676
- #: ../classes/class-ccf-form-manager.php:1233
677
- #: ../classes/class-ccf-form-manager.php:1293
678
- #: ../classes/class-ccf-form-manager.php:1310
679
- #: ../classes/class-ccf-form-manager.php:1359
680
- #: ../classes/class-ccf-form-manager.php:1366
681
- #: ../classes/class-ccf-form-manager.php:1389
682
- #: ../classes/class-ccf-form-manager.php:1458
683
- #: ../classes/class-ccf-form-manager.php:1482
684
- #: ../classes/class-ccf-form-manager.php:1525
685
- #: ../classes/class-ccf-form-manager.php:1549
686
- #: ../classes/class-ccf-form-manager.php:1592
687
- #: ../classes/class-ccf-form-manager.php:1616
688
- #: ../classes/class-ccf-settings.php:104
689
- msgid "Yes"
 
690
  msgstr ""
691
 
692
  #: ../classes/class-ccf-form-manager.php:248
693
  msgid "Only active notifications will be sent."
694
  msgstr ""
695
 
696
- #: ../classes/class-ccf-form-manager.php:252
697
- msgid "\"From\" Email Address Type:"
698
  msgstr ""
699
 
700
- #: ../classes/class-ccf-form-manager.php:254
701
- msgid "WordPress Default"
 
702
  msgstr ""
703
 
704
- #: ../classes/class-ccf-form-manager.php:255
705
- #: ../classes/class-ccf-form-manager.php:322
 
706
  msgid "Custom Email"
707
  msgstr ""
708
 
709
- #: ../classes/class-ccf-form-manager.php:256
710
- #: ../classes/class-ccf-form-manager.php:277
711
- #: ../classes/class-ccf-form-manager.php:299
712
- #: ../classes/class-ccf-form-manager.php:323
 
 
713
  msgid "Form Field"
714
  msgstr ""
715
 
716
- #: ../classes/class-ccf-form-manager.php:259
717
  msgid ""
718
- "You can set the notification emails from address to be the WP default, a "
719
- "custom email address, or pull the address from a field in the form."
 
720
  msgstr ""
721
 
722
- #: ../classes/class-ccf-form-manager.php:263
723
- msgid "Custom \"From\" Email Address:"
724
  msgstr ""
725
 
726
- #: ../classes/class-ccf-form-manager.php:268
727
- msgid "Pull \"From\" Email Dynamically from Field:"
728
  msgstr ""
729
 
730
- #: ../classes/class-ccf-form-manager.php:274
731
- msgid "\"From\" Name Type:"
732
  msgstr ""
733
 
734
- #: ../classes/class-ccf-form-manager.php:276
 
735
  msgid "Custom Name"
736
  msgstr ""
737
 
738
- #: ../classes/class-ccf-form-manager.php:280
739
  msgid ""
740
- "You can set the notification emails from name to be a custom name or pull "
741
- "the name from a field in the form."
742
  msgstr ""
743
 
744
- #: ../classes/class-ccf-form-manager.php:284
745
- msgid "Custom \"From\" Name:"
746
  msgstr ""
747
 
748
- #: ../classes/class-ccf-form-manager.php:289
749
- msgid "Pull \"From\" Name Dynamically from Field:"
750
  msgstr ""
751
 
752
- #: ../classes/class-ccf-form-manager.php:295
753
  msgid "Email Subject Type:"
754
  msgstr ""
755
 
756
- #: ../classes/class-ccf-form-manager.php:297
757
- msgid "Default"
758
- msgstr ""
759
-
760
- #: ../classes/class-ccf-form-manager.php:298
761
  msgid "Custom Subject"
762
  msgstr ""
763
 
764
- #: ../classes/class-ccf-form-manager.php:302
765
  msgid ""
766
  "You can set the notification emails subject line to be the CCF default, "
767
  "custom text, or pull the subject from a field in the form."
768
  msgstr ""
769
 
770
- #: ../classes/class-ccf-form-manager.php:306
771
  msgid "Custom Email Subject:"
772
  msgstr ""
773
 
774
- #: ../classes/class-ccf-form-manager.php:311
775
  msgid "Pull Email Subject Dynamically from Field:"
776
  msgstr ""
777
 
778
- #: ../classes/class-ccf-form-manager.php:337
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
779
  msgid "General"
780
  msgstr ""
781
 
782
- #: ../classes/class-ccf-form-manager.php:340
783
  msgid "Form Title:"
784
  msgstr ""
785
 
786
- #: ../classes/class-ccf-form-manager.php:345
 
 
 
 
787
  msgid "Form Description:"
788
  msgstr ""
789
 
790
- #: ../classes/class-ccf-form-manager.php:350
791
  msgid "Button Text:"
792
  msgstr ""
793
 
794
- #: ../classes/class-ccf-form-manager.php:355
795
  msgid "Button Class:"
796
  msgstr ""
797
 
798
- #: ../classes/class-ccf-form-manager.php:360
799
  msgid "Form Theme:"
800
  msgstr ""
801
 
802
- #: ../classes/class-ccf-form-manager.php:363
803
  msgid "None"
804
  msgstr ""
805
 
806
- #: ../classes/class-ccf-form-manager.php:364
807
  msgid "Light"
808
  msgstr ""
809
 
810
- #: ../classes/class-ccf-form-manager.php:365
811
  msgid "Dark"
812
  msgstr ""
813
 
814
- #: ../classes/class-ccf-form-manager.php:368
815
  msgid "\"None\" will have your form inherit styles from your theme."
816
  msgstr ""
817
 
818
- #: ../classes/class-ccf-form-manager.php:372
819
  msgid "On form completion:"
820
  msgstr ""
821
 
822
- #: ../classes/class-ccf-form-manager.php:375
823
  msgid "Show text"
824
  msgstr ""
825
 
826
- #: ../classes/class-ccf-form-manager.php:376
827
  msgid "Redirect"
828
  msgstr ""
829
 
830
- #: ../classes/class-ccf-form-manager.php:380
831
  msgid "Redirect URL:"
832
  msgstr ""
833
 
834
- #: ../classes/class-ccf-form-manager.php:384
835
  msgid "Completion Message:"
836
  msgstr ""
837
 
838
- #: ../classes/class-ccf-form-manager.php:388
839
  msgid "Pause form:"
840
  msgstr ""
841
 
842
- #: ../classes/class-ccf-form-manager.php:396
843
  msgid "Pause Message:"
844
  msgstr ""
845
 
846
- #: ../classes/class-ccf-form-manager.php:400
847
  msgid "Require User to Be Logged In:"
848
  msgstr ""
849
 
850
- #: ../classes/class-ccf-form-manager.php:408
851
  msgid "Email Notifications"
852
  msgstr ""
853
 
854
- #: ../classes/class-ccf-form-manager.php:414
855
- #: ../classes/class-ccf-form-manager.php:425
856
- #: ../classes/class-ccf-form-manager.php:520
857
- #: ../classes/class-ccf-form-manager.php:533
858
  msgid "Title"
859
  msgstr ""
860
 
861
- #: ../classes/class-ccf-form-manager.php:415
862
- #: ../classes/class-ccf-form-manager.php:426
863
  msgid "Subject"
864
  msgstr ""
865
 
866
- #: ../classes/class-ccf-form-manager.php:416
867
- #: ../classes/class-ccf-form-manager.php:427
868
  msgid "To"
869
  msgstr ""
870
 
871
- #: ../classes/class-ccf-form-manager.php:417
872
- #: ../classes/class-ccf-form-manager.php:428
873
  msgid "Active"
874
  msgstr ""
875
 
876
- #: ../classes/class-ccf-form-manager.php:433
877
  msgid "New Notification"
878
  msgstr ""
879
 
880
- #: ../classes/class-ccf-form-manager.php:436
881
  msgid ""
882
  "For notification changes to take affect (updating, adding, deleting, etc.), "
883
  "you will need to save the form."
884
  msgstr ""
885
 
886
- #: ../classes/class-ccf-form-manager.php:440
887
  msgid "Post Creation"
888
  msgstr ""
889
 
890
- #: ../classes/class-ccf-form-manager.php:441
891
  msgid ""
892
  "You can have Custom Contact Forms create a post (or custom post type) "
893
  "whenever someone submits your form."
894
  msgstr ""
895
 
896
- #: ../classes/class-ccf-form-manager.php:444
897
  msgid "Enable Post Creation:"
898
  msgstr ""
899
 
900
- #: ../classes/class-ccf-form-manager.php:453
901
  msgid "Post Type:"
902
  msgstr ""
903
 
904
- #: ../classes/class-ccf-form-manager.php:463
905
  msgid "Post Status:"
906
  msgstr ""
907
 
908
- #: ../classes/class-ccf-form-manager.php:473
909
  msgid "Field Mappings:"
910
  msgstr ""
911
 
912
- #: ../classes/class-ccf-form-manager.php:478
913
  msgid ""
914
  "You can map as few or as many fields as you like. However, if no form fields "
915
  "are mapped, no post will be created. Mapping a field to post_title is "
916
  "required."
917
  msgstr ""
918
 
919
- #: ../classes/class-ccf-form-manager.php:490
920
  msgid "Custom Field Key"
921
  msgstr ""
922
 
923
- #: ../classes/class-ccf-form-manager.php:504
924
  msgid "items"
925
  msgstr ""
926
 
927
- #: ../classes/class-ccf-form-manager.php:519
928
- #: ../classes/class-ccf-form-manager.php:532
929
  msgid "ID"
930
  msgstr ""
931
 
932
- #: ../classes/class-ccf-form-manager.php:547
933
  msgid "<span>&larr;</span> Click on a field to edit it."
934
  msgstr ""
935
 
936
- #: ../classes/class-ccf-form-manager.php:556
937
- #: ../classes/class-ccf-form-manager.php:624
938
- #: ../classes/class-ccf-form-manager.php:759
939
- #: ../classes/class-ccf-form-manager.php:921
940
  msgid "Internal Unique Slug"
941
  msgstr ""
942
 
943
- #: ../classes/class-ccf-form-manager.php:560
944
- #: ../classes/class-ccf-form-manager.php:628
945
- #: ../classes/class-ccf-form-manager.php:695
946
- #: ../classes/class-ccf-form-manager.php:730
947
- #: ../classes/class-ccf-form-manager.php:763
948
- #: ../classes/class-ccf-form-manager.php:925
949
- #: ../classes/class-ccf-form-manager.php:1042
950
- #: ../classes/class-ccf-form-manager.php:1102
951
- #: ../classes/class-ccf-form-manager.php:1191
952
- #: ../classes/class-ccf-form-manager.php:1266
953
- #: ../classes/class-ccf-form-manager.php:1343
954
- #: ../classes/class-ccf-form-manager.php:1448
955
- #: ../classes/class-ccf-form-manager.php:1515
956
- #: ../classes/class-ccf-form-manager.php:1582
957
  msgid "Label:"
958
  msgstr ""
959
 
960
- #: ../classes/class-ccf-form-manager.php:564
961
- #: ../classes/class-ccf-form-manager.php:632
962
- #: ../classes/class-ccf-form-manager.php:699
963
- #: ../classes/class-ccf-form-manager.php:734
964
- #: ../classes/class-ccf-form-manager.php:767
965
- #: ../classes/class-ccf-form-manager.php:929
966
- #: ../classes/class-ccf-form-manager.php:1046
967
- #: ../classes/class-ccf-form-manager.php:1106
968
- #: ../classes/class-ccf-form-manager.php:1195
969
- #: ../classes/class-ccf-form-manager.php:1270
970
- #: ../classes/class-ccf-form-manager.php:1347
971
- #: ../classes/class-ccf-form-manager.php:1452
972
- #: ../classes/class-ccf-form-manager.php:1519
973
- #: ../classes/class-ccf-form-manager.php:1586
974
  msgid "Description:"
975
  msgstr ""
976
 
977
- #: ../classes/class-ccf-form-manager.php:568
978
- #: ../classes/class-ccf-form-manager.php:771
979
- #: ../classes/class-ccf-form-manager.php:933
980
- #: ../classes/class-ccf-form-manager.php:993
981
- #: ../classes/class-ccf-form-manager.php:1111
982
- #: ../classes/class-ccf-form-manager.php:1199
983
- #: ../classes/class-ccf-form-manager.php:1352
984
  msgid "Initial Value:"
985
  msgstr ""
986
 
987
- #: ../classes/class-ccf-form-manager.php:572
988
- #: ../classes/class-ccf-form-manager.php:646
989
- #: ../classes/class-ccf-form-manager.php:775
990
- #: ../classes/class-ccf-form-manager.php:937
991
- #: ../classes/class-ccf-form-manager.php:1050
992
- #: ../classes/class-ccf-form-manager.php:1116
993
- #: ../classes/class-ccf-form-manager.php:1210
994
- #: ../classes/class-ccf-form-manager.php:1291
995
- #: ../classes/class-ccf-form-manager.php:1357
996
- #: ../classes/class-ccf-form-manager.php:1456
997
- #: ../classes/class-ccf-form-manager.php:1523
998
- #: ../classes/class-ccf-form-manager.php:1590
999
  msgid "Required:"
1000
  msgstr ""
1001
 
1002
- #: ../classes/class-ccf-form-manager.php:581
1003
- #: ../classes/class-ccf-form-manager.php:655
1004
- #: ../classes/class-ccf-form-manager.php:715
1005
- #: ../classes/class-ccf-form-manager.php:740
1006
- #: ../classes/class-ccf-form-manager.php:784
1007
- #: ../classes/class-ccf-form-manager.php:833
1008
- #: ../classes/class-ccf-form-manager.php:882
1009
- #: ../classes/class-ccf-form-manager.php:946
1010
- #: ../classes/class-ccf-form-manager.php:999
1011
- #: ../classes/class-ccf-form-manager.php:1059
1012
- #: ../classes/class-ccf-form-manager.php:1142
1013
- #: ../classes/class-ccf-form-manager.php:1219
1014
- #: ../classes/class-ccf-form-manager.php:1300
1015
- #: ../classes/class-ccf-form-manager.php:1373
1016
- #: ../classes/class-ccf-form-manager.php:1472
1017
- #: ../classes/class-ccf-form-manager.php:1539
1018
- #: ../classes/class-ccf-form-manager.php:1606
1019
  msgid "Advanced"
1020
  msgstr ""
1021
 
1022
- #: ../classes/class-ccf-form-manager.php:584
1023
- #: ../classes/class-ccf-form-manager.php:658
1024
- #: ../classes/class-ccf-form-manager.php:718
1025
- #: ../classes/class-ccf-form-manager.php:743
1026
- #: ../classes/class-ccf-form-manager.php:787
1027
- #: ../classes/class-ccf-form-manager.php:836
1028
- #: ../classes/class-ccf-form-manager.php:885
1029
- #: ../classes/class-ccf-form-manager.php:949
1030
- #: ../classes/class-ccf-form-manager.php:1002
1031
- #: ../classes/class-ccf-form-manager.php:1062
1032
- #: ../classes/class-ccf-form-manager.php:1145
1033
- #: ../classes/class-ccf-form-manager.php:1222
1034
- #: ../classes/class-ccf-form-manager.php:1303
1035
- #: ../classes/class-ccf-form-manager.php:1376
1036
- #: ../classes/class-ccf-form-manager.php:1475
1037
- #: ../classes/class-ccf-form-manager.php:1542
1038
- #: ../classes/class-ccf-form-manager.php:1609
1039
  msgid "Class Name:"
1040
  msgstr ""
1041
 
1042
- #: ../classes/class-ccf-form-manager.php:588
1043
- #: ../classes/class-ccf-form-manager.php:747
1044
- #: ../classes/class-ccf-form-manager.php:791
1045
- #: ../classes/class-ccf-form-manager.php:953
1046
- #: ../classes/class-ccf-form-manager.php:1150
1047
- #: ../classes/class-ccf-form-manager.php:1226
1048
- #: ../classes/class-ccf-form-manager.php:1381
1049
  msgid "Placeholder Text:"
1050
  msgstr ""
1051
 
1052
- #: ../classes/class-ccf-form-manager.php:592
1053
- #: ../classes/class-ccf-form-manager.php:662
1054
- #: ../classes/class-ccf-form-manager.php:795
1055
- #: ../classes/class-ccf-form-manager.php:840
1056
- #: ../classes/class-ccf-form-manager.php:889
1057
- #: ../classes/class-ccf-form-manager.php:957
1058
- #: ../classes/class-ccf-form-manager.php:1006
1059
- #: ../classes/class-ccf-form-manager.php:1066
1060
- #: ../classes/class-ccf-form-manager.php:1155
1061
- #: ../classes/class-ccf-form-manager.php:1230
1062
- #: ../classes/class-ccf-form-manager.php:1307
1063
- #: ../classes/class-ccf-form-manager.php:1386
1064
- #: ../classes/class-ccf-form-manager.php:1479
1065
- #: ../classes/class-ccf-form-manager.php:1546
1066
- #: ../classes/class-ccf-form-manager.php:1613
1067
  msgid "Enable Conditional Logic:"
1068
  msgstr ""
1069
 
1070
- #: ../classes/class-ccf-form-manager.php:600
1071
- #: ../classes/class-ccf-form-manager.php:670
1072
- #: ../classes/class-ccf-form-manager.php:803
1073
- #: ../classes/class-ccf-form-manager.php:848
1074
- #: ../classes/class-ccf-form-manager.php:897
1075
- #: ../classes/class-ccf-form-manager.php:965
1076
- #: ../classes/class-ccf-form-manager.php:1014
1077
- #: ../classes/class-ccf-form-manager.php:1074
1078
- #: ../classes/class-ccf-form-manager.php:1163
1079
- #: ../classes/class-ccf-form-manager.php:1238
1080
- #: ../classes/class-ccf-form-manager.php:1315
1081
- #: ../classes/class-ccf-form-manager.php:1394
1082
- #: ../classes/class-ccf-form-manager.php:1487
1083
- #: ../classes/class-ccf-form-manager.php:1554
1084
- #: ../classes/class-ccf-form-manager.php:1621
1085
  msgid "Hide"
1086
  msgstr ""
1087
 
1088
- #: ../classes/class-ccf-form-manager.php:601
1089
- #: ../classes/class-ccf-form-manager.php:671
1090
- #: ../classes/class-ccf-form-manager.php:804
1091
- #: ../classes/class-ccf-form-manager.php:849
1092
- #: ../classes/class-ccf-form-manager.php:898
1093
- #: ../classes/class-ccf-form-manager.php:966
1094
- #: ../classes/class-ccf-form-manager.php:1015
1095
- #: ../classes/class-ccf-form-manager.php:1075
1096
- #: ../classes/class-ccf-form-manager.php:1164
1097
- #: ../classes/class-ccf-form-manager.php:1239
1098
- #: ../classes/class-ccf-form-manager.php:1316
1099
- #: ../classes/class-ccf-form-manager.php:1395
1100
- #: ../classes/class-ccf-form-manager.php:1488
1101
- #: ../classes/class-ccf-form-manager.php:1555
1102
- #: ../classes/class-ccf-form-manager.php:1622
1103
  msgid "Show"
1104
  msgstr ""
1105
 
1106
- #: ../classes/class-ccf-form-manager.php:604
1107
- #: ../classes/class-ccf-form-manager.php:674
1108
- #: ../classes/class-ccf-form-manager.php:807
1109
- #: ../classes/class-ccf-form-manager.php:852
1110
- #: ../classes/class-ccf-form-manager.php:901
1111
- #: ../classes/class-ccf-form-manager.php:969
1112
- #: ../classes/class-ccf-form-manager.php:1018
1113
- #: ../classes/class-ccf-form-manager.php:1078
1114
- #: ../classes/class-ccf-form-manager.php:1167
1115
- #: ../classes/class-ccf-form-manager.php:1242
1116
- #: ../classes/class-ccf-form-manager.php:1319
1117
- #: ../classes/class-ccf-form-manager.php:1398
1118
- #: ../classes/class-ccf-form-manager.php:1491
1119
- #: ../classes/class-ccf-form-manager.php:1558
1120
- #: ../classes/class-ccf-form-manager.php:1625
1121
  msgid "this field if"
1122
  msgstr ""
1123
 
1124
- #: ../classes/class-ccf-form-manager.php:607
1125
- #: ../classes/class-ccf-form-manager.php:677
1126
- #: ../classes/class-ccf-form-manager.php:810
1127
- #: ../classes/class-ccf-form-manager.php:855
1128
- #: ../classes/class-ccf-form-manager.php:904
1129
- #: ../classes/class-ccf-form-manager.php:972
1130
- #: ../classes/class-ccf-form-manager.php:1021
1131
- #: ../classes/class-ccf-form-manager.php:1081
1132
- #: ../classes/class-ccf-form-manager.php:1170
1133
- #: ../classes/class-ccf-form-manager.php:1245
1134
- #: ../classes/class-ccf-form-manager.php:1322
1135
- #: ../classes/class-ccf-form-manager.php:1401
1136
- #: ../classes/class-ccf-form-manager.php:1494
1137
- #: ../classes/class-ccf-form-manager.php:1561
1138
- #: ../classes/class-ccf-form-manager.php:1628
1139
  msgid "All"
1140
  msgstr ""
1141
 
1142
- #: ../classes/class-ccf-form-manager.php:608
1143
- #: ../classes/class-ccf-form-manager.php:678
1144
- #: ../classes/class-ccf-form-manager.php:811
1145
- #: ../classes/class-ccf-form-manager.php:856
1146
- #: ../classes/class-ccf-form-manager.php:905
1147
- #: ../classes/class-ccf-form-manager.php:973
1148
- #: ../classes/class-ccf-form-manager.php:1022
1149
- #: ../classes/class-ccf-form-manager.php:1082
1150
- #: ../classes/class-ccf-form-manager.php:1171
1151
- #: ../classes/class-ccf-form-manager.php:1246
1152
- #: ../classes/class-ccf-form-manager.php:1323
1153
- #: ../classes/class-ccf-form-manager.php:1402
1154
- #: ../classes/class-ccf-form-manager.php:1495
1155
- #: ../classes/class-ccf-form-manager.php:1562
1156
- #: ../classes/class-ccf-form-manager.php:1629
1157
  msgid "Any"
1158
  msgstr ""
1159
 
1160
- #: ../classes/class-ccf-form-manager.php:611
1161
- #: ../classes/class-ccf-form-manager.php:681
1162
- #: ../classes/class-ccf-form-manager.php:814
1163
- #: ../classes/class-ccf-form-manager.php:859
1164
- #: ../classes/class-ccf-form-manager.php:908
1165
- #: ../classes/class-ccf-form-manager.php:976
1166
- #: ../classes/class-ccf-form-manager.php:1025
1167
- #: ../classes/class-ccf-form-manager.php:1085
1168
- #: ../classes/class-ccf-form-manager.php:1174
1169
- #: ../classes/class-ccf-form-manager.php:1249
1170
- #: ../classes/class-ccf-form-manager.php:1326
1171
- #: ../classes/class-ccf-form-manager.php:1405
1172
- #: ../classes/class-ccf-form-manager.php:1498
1173
- #: ../classes/class-ccf-form-manager.php:1565
1174
- #: ../classes/class-ccf-form-manager.php:1632
1175
  msgid "of these conditions are true:"
1176
  msgstr ""
1177
 
1178
- #: ../classes/class-ccf-form-manager.php:636
1179
  msgid "Allowed File Extensions (comma separate):"
1180
  msgstr ""
1181
 
1182
- #: ../classes/class-ccf-form-manager.php:638
1183
  msgid ""
1184
  "If left blank, will default to all extensions registered by WordPress. If "
1185
  "you use a file extension or mime type not <a href=\"http://codex.wordpress."
@@ -1187,342 +1247,342 @@ msgid ""
1187
  "a>, you will need to filter and manually whitelist the new extension."
1188
  msgstr ""
1189
 
1190
- #: ../classes/class-ccf-form-manager.php:641
1191
  msgid "Max File Size (in MB):"
1192
  msgstr ""
1193
 
1194
- #: ../classes/class-ccf-form-manager.php:643
1195
  #, php-format
1196
  msgid ""
1197
  "If left blank, will default to %d MB. Maximum allowed by server is %d MB."
1198
  msgstr ""
1199
 
1200
- #: ../classes/class-ccf-form-manager.php:693
1201
  msgid ""
1202
  "reCAPTCHA is a simple captcha service provided by Google. <a target=\"_blank"
1203
  "\" href=\"https://www.google.com/recaptcha/intro/index.html\">Learn more</a>"
1204
  msgstr ""
1205
 
1206
- #: ../classes/class-ccf-form-manager.php:703
1207
  msgid "Site Key:"
1208
  msgstr ""
1209
 
1210
- #: ../classes/class-ccf-form-manager.php:705
1211
- #: ../classes/class-ccf-form-manager.php:710
1212
  msgid "Don't have one?"
1213
  msgstr ""
1214
 
1215
- #: ../classes/class-ccf-form-manager.php:708
1216
  msgid "Secret Key:"
1217
  msgstr ""
1218
 
1219
- #: ../classes/class-ccf-form-manager.php:824
1220
- #: ../classes/class-ccf-form-manager.php:869
1221
- #: ../classes/class-ccf-form-manager.php:918
1222
- #: ../classes/class-ccf-form-manager.php:986
1223
- #: ../classes/class-ccf-form-manager.php:1035
1224
- #: ../classes/class-ccf-form-manager.php:1095
1225
- #: ../classes/class-ccf-form-manager.php:1184
1226
- #: ../classes/class-ccf-form-manager.php:1259
1227
- #: ../classes/class-ccf-form-manager.php:1336
1228
- #: ../classes/class-ccf-form-manager.php:1441
1229
- #: ../classes/class-ccf-form-manager.php:1508
1230
- #: ../classes/class-ccf-form-manager.php:1575
1231
  msgid "Basic"
1232
  msgstr ""
1233
 
1234
- #: ../classes/class-ccf-form-manager.php:827
1235
  msgid "HTML Content:"
1236
  msgstr ""
1237
 
1238
- #: ../classes/class-ccf-form-manager.php:872
1239
  msgid "Heading:"
1240
  msgstr ""
1241
 
1242
- #: ../classes/class-ccf-form-manager.php:876
1243
  msgid "Sub Heading:"
1244
  msgstr ""
1245
 
1246
- #: ../classes/class-ccf-form-manager.php:989
1247
- #: ../classes/class-ccf-form-manager.php:1038
1248
- #: ../classes/class-ccf-form-manager.php:1098
1249
- #: ../classes/class-ccf-form-manager.php:1187
1250
- #: ../classes/class-ccf-form-manager.php:1262
1251
- #: ../classes/class-ccf-form-manager.php:1339
1252
- #: ../classes/class-ccf-form-manager.php:1444
1253
- #: ../classes/class-ccf-form-manager.php:1511
1254
- #: ../classes/class-ccf-form-manager.php:1578
1255
  msgid "Internal Unique Slug (a-z, 0-9, -, _):"
1256
  msgstr ""
1257
 
1258
- #: ../classes/class-ccf-form-manager.php:1124
1259
  msgid "Enable Date Select"
1260
  msgstr ""
1261
 
1262
- #: ../classes/class-ccf-form-manager.php:1128
1263
  msgid "Enable Time Select"
1264
  msgstr ""
1265
 
1266
- #: ../classes/class-ccf-form-manager.php:1132
1267
  msgid "Date Format:"
1268
  msgstr ""
1269
 
1270
- #: ../classes/class-ccf-form-manager.php:1203
1271
  msgid "Format:"
1272
  msgstr ""
1273
 
1274
- #: ../classes/class-ccf-form-manager.php:1206
1275
- #: ../classes/class-ccf-form-manager.php:1277
1276
  msgid "International"
1277
  msgstr ""
1278
 
1279
- #: ../classes/class-ccf-form-manager.php:1274
1280
  msgid "Type:"
1281
  msgstr ""
1282
 
1283
- #: ../classes/class-ccf-form-manager.php:1276
1284
  msgid "United States"
1285
  msgstr ""
1286
 
1287
- #: ../classes/class-ccf-form-manager.php:1282
1288
  msgid "Default Country:"
1289
  msgstr ""
1290
 
1291
- #: ../classes/class-ccf-form-manager.php:1364
1292
  msgid "Require Confirmation:"
1293
  msgstr ""
1294
 
1295
- #: ../classes/class-ccf-form-manager.php:1416
1296
  msgid "Label"
1297
  msgstr ""
1298
 
1299
- #: ../classes/class-ccf-form-manager.php:1417
1300
  msgid "Value"
1301
  msgstr ""
1302
 
1303
- #: ../classes/class-ccf-form-manager.php:1430
1304
  msgid "is"
1305
  msgstr ""
1306
 
1307
- #: ../classes/class-ccf-form-manager.php:1431
1308
  msgid "is not"
1309
  msgstr ""
1310
 
1311
- #: ../classes/class-ccf-form-manager.php:1432
1312
  msgid ">"
1313
  msgstr ""
1314
 
1315
- #: ../classes/class-ccf-form-manager.php:1433
1316
  msgid "<"
1317
  msgstr ""
1318
 
1319
- #: ../classes/class-ccf-form-manager.php:1434
1320
  msgid "contains"
1321
  msgstr ""
1322
 
1323
- #: ../classes/class-ccf-form-manager.php:1436
1324
  msgid "Field value"
1325
  msgstr ""
1326
 
1327
- #: ../classes/class-ccf-form-manager.php:1463
1328
- #: ../classes/class-ccf-form-manager.php:1530
1329
- #: ../classes/class-ccf-form-manager.php:1597
1330
  msgid "Manage field choices:"
1331
  msgstr ""
1332
 
1333
- #: ../classes/class-ccf-form-manager.php:1467
1334
- #: ../classes/class-ccf-form-manager.php:1534
1335
- #: ../classes/class-ccf-form-manager.php:1601
1336
  msgid ""
1337
  "Note: If an option does not have a \"value\", it will not be considered a "
1338
  "valid selection if the field is required. The \"value\" is what's read, "
1339
  "stored, and displayed in the submission."
1340
  msgstr ""
1341
 
1342
- #: ../classes/class-ccf-form-manager.php:1642
1343
  msgid "You currently have no forms. Add some!"
1344
  msgstr ""
1345
 
1346
- #: ../classes/class-ccf-form-manager.php:1665
1347
  msgid "Allowed file extensions are {{ extensions }}. "
1348
  msgstr ""
1349
 
1350
- #: ../classes/class-ccf-form-manager.php:1667
1351
  msgid "Max file size is {{ file_size }} MB. "
1352
  msgstr ""
1353
 
1354
- #: ../classes/class-ccf-form-manager.php:1702
1355
- #: ../classes/class-ccf-form-manager.php:1718
1356
- #: ../classes/class-ccf-form-manager.php:1736
1357
  msgid "An example choice"
1358
  msgstr ""
1359
 
1360
- #: ../classes/class-ccf-form-manager.php:1755
1361
  msgid "Arbitrary block of HTML."
1362
  msgstr ""
1363
 
1364
- #: ../classes/class-ccf-form-manager.php:1762
1365
  msgid "Section Heading"
1366
  msgstr ""
1367
 
1368
- #: ../classes/class-ccf-form-manager.php:1764
1369
  msgid "This is the sub-heading text."
1370
  msgstr ""
1371
 
1372
- #: ../classes/class-ccf-form-manager.php:1935
1373
  msgid "Duplicate form"
1374
  msgstr ""
1375
 
1376
- #: ../classes/class-ccf-form-manager.php:1936
1377
  msgid "Trash"
1378
  msgstr ""
1379
 
1380
- #: ../classes/class-ccf-form-manager.php:1979
1381
  msgid "There is a problem with this form. Is it trashed or deleted?"
1382
  msgstr ""
1383
 
1384
- #: ../classes/class-ccf-form-manager.php:2126
1385
  msgid "IP Address"
1386
  msgstr ""
1387
 
1388
- #: ../classes/class-ccf-form-manager.php:2133
1389
  msgid "Form Page URL"
1390
  msgstr ""
1391
 
1392
- #: ../classes/class-ccf-form-manager.php:2146
1393
  msgid "There are no submissions."
1394
  msgstr ""
1395
 
1396
- #: ../classes/class-ccf-form-manager.php:2175
1397
  msgid "Add Form"
1398
  msgstr ""
1399
 
1400
- #: ../classes/class-ccf-form-manager.php:2198
1401
  msgid "Single Line Text"
1402
  msgstr ""
1403
 
1404
- #: ../classes/class-ccf-form-manager.php:2199
1405
  msgid "Dropdown"
1406
  msgstr ""
1407
 
1408
- #: ../classes/class-ccf-form-manager.php:2200
1409
  msgid "Checkboxes"
1410
  msgstr ""
1411
 
1412
- #: ../classes/class-ccf-form-manager.php:2201
1413
  msgid "Radio Buttons"
1414
  msgstr ""
1415
 
1416
- #: ../classes/class-ccf-form-manager.php:2202
1417
  msgid "Paragraph Text"
1418
  msgstr ""
1419
 
1420
- #: ../classes/class-ccf-form-manager.php:2203
1421
  msgid "Hidden"
1422
  msgstr ""
1423
 
1424
- #: ../classes/class-ccf-form-manager.php:2204
1425
  msgid "File Upload"
1426
  msgstr ""
1427
 
1428
- #: ../classes/class-ccf-form-manager.php:2208
1429
  msgid "HTML"
1430
  msgstr ""
1431
 
1432
- #: ../classes/class-ccf-form-manager.php:2209
1433
  msgid "Section"
1434
  msgstr ""
1435
 
1436
- #: ../classes/class-ccf-form-manager.php:2214
1437
  msgid "Name"
1438
  msgstr ""
1439
 
1440
- #: ../classes/class-ccf-form-manager.php:2215
1441
  msgid "Date/Time"
1442
  msgstr ""
1443
 
1444
- #: ../classes/class-ccf-form-manager.php:2216
1445
  msgid "Website"
1446
  msgstr ""
1447
 
1448
- #: ../classes/class-ccf-form-manager.php:2217
1449
  msgid "Address"
1450
  msgstr ""
1451
 
1452
- #: ../classes/class-ccf-form-manager.php:2218
1453
  msgid "Phone"
1454
  msgstr ""
1455
 
1456
- #: ../classes/class-ccf-form-manager.php:2219
1457
  msgid "reCAPTCHA"
1458
  msgstr ""
1459
 
1460
- #: ../classes/class-ccf-form-manager.php:2220
1461
  msgid "Simple CAPTCHA"
1462
  msgstr ""
1463
 
1464
- #: ../classes/class-ccf-form-manager.php:2252
1465
  msgid "Type the characters in the image"
1466
  msgstr ""
1467
 
1468
- #: ../classes/class-ccf-form-manager.php:2254
1469
  msgid "You have no email fields"
1470
  msgstr ""
1471
 
1472
- #: ../classes/class-ccf-form-manager.php:2255
1473
  msgid "No available fields"
1474
  msgstr ""
1475
 
1476
- #: ../classes/class-ccf-form-manager.php:2256
1477
  msgid "You have no name fields"
1478
  msgstr ""
1479
 
1480
- #: ../classes/class-ccf-form-manager.php:2257
1481
  msgid "You have no applicable fields"
1482
  msgstr ""
1483
 
1484
- #: ../classes/class-ccf-form-manager.php:2258
1485
  msgid "Choose a Form Field"
1486
  msgstr ""
1487
 
1488
- #: ../classes/class-ccf-form-manager.php:2259
1489
  msgid "Invalid date"
1490
  msgstr ""
1491
 
1492
- #: ../classes/class-ccf-form-manager.php:2261
1493
  msgid "Field Label"
1494
  msgstr ""
1495
 
1496
- #: ../classes/class-ccf-form-manager.php:2263
1497
  #: ../classes/class-ccf-form-renderer.php:182
1498
  msgid "This form is paused right now. Check back later!"
1499
  msgstr ""
1500
 
1501
- #: ../classes/class-ccf-form-manager.php:2265
1502
  msgid "Choose a Post Field"
1503
  msgstr ""
1504
 
1505
- #: ../classes/class-ccf-form-manager.php:2268
1506
  msgid "Post Title"
1507
  msgstr ""
1508
 
1509
- #: ../classes/class-ccf-form-manager.php:2269
1510
  msgid "Post Content"
1511
  msgstr ""
1512
 
1513
- #: ../classes/class-ccf-form-manager.php:2270
1514
  msgid "Post Excerpt"
1515
  msgstr ""
1516
 
1517
- #: ../classes/class-ccf-form-manager.php:2271
1518
  msgid "Post Date"
1519
  msgstr ""
1520
 
1521
- #: ../classes/class-ccf-form-manager.php:2274
1522
  msgid "Post Tags"
1523
  msgstr ""
1524
 
1525
- #: ../classes/class-ccf-form-manager.php:2275
1526
  msgid "Custom Field"
1527
  msgstr ""
1528
 
5
  "Project-Id-Version: Custom Contact Forms\n"
6
  "Report-Msgid-Bugs-To: https://github.com/tlovett1/custom-contact-forms/"
7
  "issues\n"
8
+ "POT-Creation-Date: 2016-03-14 01:27-0400\n"
9
+ "PO-Revision-Date: 2016-03-14 01:27-0400\n"
10
  "Last-Translator: Taylor Lovett <tlovett88@gmail.com>\n"
11
  "Language-Team: \n"
12
  "Language: en\n"
23
  "X-Textdomain-Support: yes\n"
24
  "X-Poedit-SearchPath-0: ..\n"
25
 
26
+ #: ../classes/class-ccf-ads.php:130
27
+ msgid ""
28
+ "We need your support. Please rate Custom Contact Forms five <span alt="
29
+ "\"f155\" class=\"dashicons dashicons-star-filled\"></span>'s"
30
+ msgstr ""
31
+
32
+ #: ../classes/class-ccf-api-form-controller.php:680
33
  msgid "Form not found"
34
  msgstr ""
35
 
36
+ #: ../classes/class-ccf-api-form-controller.php:706
37
  msgid "Could not create form"
38
  msgstr ""
39
 
40
+ #: ../classes/class-ccf-api-form-controller.php:736
41
  msgid "Could not update form"
42
  msgstr ""
43
 
44
+ #: ../classes/class-ccf-api-form-controller.php:764
45
  msgid "Could not delete form"
46
  msgstr ""
47
 
48
+ #: ../classes/class-ccf-api-form-controller.php:793
49
  msgid "Could not delete submission"
50
  msgstr ""
51
 
88
  msgstr ""
89
 
90
  #: ../classes/class-ccf-field-renderer.php:625
91
+ #: ../classes/class-ccf-form-manager.php:1897
92
+ #: ../classes/class-ccf-form-manager.php:1922
93
  msgid "Street Address"
94
  msgstr ""
95
 
96
  #: ../classes/class-ccf-field-renderer.php:629
97
+ #: ../classes/class-ccf-form-manager.php:1901
98
+ #: ../classes/class-ccf-form-manager.php:1926
99
  msgid "Address Line 2"
100
  msgstr ""
101
 
102
  #: ../classes/class-ccf-field-renderer.php:636
103
+ #: ../classes/class-ccf-form-manager.php:1905
104
+ #: ../classes/class-ccf-form-manager.php:1930
105
  msgid "City"
106
  msgstr ""
107
 
108
  #: ../classes/class-ccf-field-renderer.php:649
109
+ #: ../classes/class-ccf-form-manager.php:1913
110
  msgid "State"
111
  msgstr ""
112
 
113
  #: ../classes/class-ccf-field-renderer.php:657
114
+ #: ../classes/class-ccf-form-manager.php:1917
115
  msgid "ZIP Code"
116
  msgstr ""
117
 
118
  #: ../classes/class-ccf-field-renderer.php:667
119
+ #: ../classes/class-ccf-form-manager.php:1934
120
  msgid "State / Region / Province"
121
  msgstr ""
122
 
123
  #: ../classes/class-ccf-field-renderer.php:675
124
+ #: ../classes/class-ccf-form-manager.php:1938
125
  msgid "ZIP / Postal Code"
126
  msgstr ""
127
 
128
  #: ../classes/class-ccf-field-renderer.php:687
129
+ #: ../classes/class-ccf-form-manager.php:1946
130
  msgid "Country"
131
  msgstr ""
132
 
133
  #: ../classes/class-ccf-field-renderer.php:865
134
+ #: ../classes/class-ccf-form-manager.php:1957
135
  msgid "email@example.com"
136
  msgstr ""
137
 
138
  #: ../classes/class-ccf-field-renderer.php:877
139
+ #: ../classes/class-ccf-form-manager.php:380
140
+ #: ../classes/class-ccf-form-manager.php:1961
141
+ #: ../classes/class-ccf-form-manager.php:2275
142
  msgid "Email"
143
  msgstr ""
144
 
145
  #: ../classes/class-ccf-field-renderer.php:884
146
+ #: ../classes/class-ccf-form-manager.php:1965
147
  msgid "Confirm Email"
148
  msgstr ""
149
 
150
  #: ../classes/class-ccf-field-renderer.php:950
151
+ #: ../classes/class-ccf-form-manager.php:1833
152
  msgid "First"
153
  msgstr ""
154
 
155
  #: ../classes/class-ccf-field-renderer.php:957
156
+ #: ../classes/class-ccf-form-manager.php:1837
157
  msgid "Last"
158
  msgstr ""
159
 
160
  #: ../classes/class-ccf-field-renderer.php:1031
161
  #: ../classes/class-ccf-field-renderer.php:1052
162
+ #: ../classes/class-ccf-form-manager.php:1852
163
+ #: ../classes/class-ccf-form-manager.php:1873
164
  msgid "HH"
165
  msgstr ""
166
 
167
  #: ../classes/class-ccf-field-renderer.php:1035
168
  #: ../classes/class-ccf-field-renderer.php:1056
169
+ #: ../classes/class-ccf-form-manager.php:1856
170
+ #: ../classes/class-ccf-form-manager.php:1877
171
  msgid "MM"
172
  msgstr ""
173
 
174
  #: ../classes/class-ccf-field-renderer.php:1039
175
  #: ../classes/class-ccf-field-renderer.php:1060
176
+ #: ../classes/class-ccf-form-manager.php:1860
177
+ #: ../classes/class-ccf-form-manager.php:1881
178
  msgid "AM"
179
  msgstr ""
180
 
181
  #: ../classes/class-ccf-field-renderer.php:1040
182
  #: ../classes/class-ccf-field-renderer.php:1061
183
+ #: ../classes/class-ccf-form-manager.php:1861
184
+ #: ../classes/class-ccf-form-manager.php:1882
185
  msgid "PM"
186
  msgstr ""
187
 
188
  #: ../classes/class-ccf-field-renderer.php:1047
189
  #: ../classes/class-ccf-form-cpt.php:510
190
+ #: ../classes/class-ccf-form-manager.php:583
191
+ #: ../classes/class-ccf-form-manager.php:596
192
+ #: ../classes/class-ccf-form-manager.php:1868
193
+ #: ../classes/class-ccf-form-manager.php:2052
194
+ #: ../classes/class-ccf-form-manager.php:2066
195
+ #: ../classes/class-ccf-form-manager.php:2217
196
  msgid "Date"
197
  msgstr ""
198
 
202
 
203
  #: ../classes/class-ccf-form-cpt.php:324 ../classes/class-ccf-form-cpt.php:342
204
  #: ../classes/class-ccf-form-cpt.php:507
205
+ #: ../classes/class-ccf-form-manager.php:586
206
+ #: ../classes/class-ccf-form-manager.php:599
207
  msgid "Submissions"
208
  msgstr ""
209
 
248
  msgstr ""
249
 
250
  #: ../classes/class-ccf-form-cpt.php:445
251
+ #: ../classes/class-ccf-form-manager.php:1993
252
  msgid "(No title)"
253
  msgstr ""
254
 
261
  msgstr ""
262
 
263
  #: ../classes/class-ccf-form-cpt.php:506
264
+ #: ../classes/class-ccf-form-manager.php:584
265
+ #: ../classes/class-ccf-form-manager.php:597
266
  msgid "Author"
267
  msgstr ""
268
 
269
  #: ../classes/class-ccf-form-cpt.php:508
270
+ #: ../classes/class-ccf-form-manager.php:585
271
+ #: ../classes/class-ccf-form-manager.php:598
272
  msgid "Number of Fields"
273
  msgstr ""
274
 
453
  msgid "AM/PM is required."
454
  msgstr ""
455
 
456
+ #: ../classes/class-ccf-form-handler.php:799
457
  msgid "Post created by form"
458
  msgstr ""
459
 
460
+ #: ../classes/class-ccf-form-handler.php:848
461
  msgid "*Hidden Field*"
462
  msgstr ""
463
 
464
+ #: ../classes/class-ccf-form-handler.php:920
465
  msgid "Form submitted from"
466
  msgstr ""
467
 
468
+ #: ../classes/class-ccf-form-handler.php:929
469
  msgid "Form submitter IP"
470
  msgstr ""
471
 
472
+ #: ../classes/class-ccf-form-handler.php:1065
473
  #, php-format
474
  msgid "%s: Form Submission"
475
  msgstr ""
476
 
477
+ #: ../classes/class-ccf-form-handler.php:1067
478
  #, php-format
479
  msgid " to \"%s\""
480
  msgstr ""
481
 
482
+ #: ../classes/class-ccf-form-handler.php:1125
483
  #: ../classes/class-ccf-form-renderer.php:196
484
  msgid "Thank you for your submission."
485
  msgstr ""
546
  msgstr ""
547
 
548
  #: ../classes/class-ccf-form-manager.php:152
549
+ #: ../classes/class-ccf-form-manager.php:1996
550
  msgid "Insert into post"
551
  msgstr ""
552
 
567
  msgstr ""
568
 
569
  #: ../classes/class-ccf-form-manager.php:172
570
+ #: ../classes/class-ccf-form-manager.php:1995
571
  msgid "Edit"
572
  msgstr ""
573
 
576
  msgstr ""
577
 
578
  #: ../classes/class-ccf-form-manager.php:179
579
+ #: ../classes/class-ccf-form-manager.php:2324
580
  msgid "Form Submission"
581
  msgstr ""
582
 
624
  msgstr ""
625
 
626
  #: ../classes/class-ccf-form-manager.php:244
627
+ #: ../classes/class-ccf-form-manager.php:402
628
+ #: ../classes/class-ccf-form-manager.php:454
629
+ #: ../classes/class-ccf-form-manager.php:466
630
+ #: ../classes/class-ccf-form-manager.php:510
631
+ #: ../classes/class-ccf-form-manager.php:636
632
+ #: ../classes/class-ccf-form-manager.php:657
633
+ #: ../classes/class-ccf-form-manager.php:710
634
+ #: ../classes/class-ccf-form-manager.php:727
635
+ #: ../classes/class-ccf-form-manager.php:839
636
+ #: ../classes/class-ccf-form-manager.php:860
637
+ #: ../classes/class-ccf-form-manager.php:905
638
+ #: ../classes/class-ccf-form-manager.php:954
639
+ #: ../classes/class-ccf-form-manager.php:1001
640
+ #: ../classes/class-ccf-form-manager.php:1022
641
+ #: ../classes/class-ccf-form-manager.php:1071
642
+ #: ../classes/class-ccf-form-manager.php:1114
643
+ #: ../classes/class-ccf-form-manager.php:1131
644
+ #: ../classes/class-ccf-form-manager.php:1180
645
+ #: ../classes/class-ccf-form-manager.php:1220
646
+ #: ../classes/class-ccf-form-manager.php:1274
647
+ #: ../classes/class-ccf-form-manager.php:1295
648
+ #: ../classes/class-ccf-form-manager.php:1355
649
+ #: ../classes/class-ccf-form-manager.php:1372
650
+ #: ../classes/class-ccf-form-manager.php:1421
651
+ #: ../classes/class-ccf-form-manager.php:1428
652
+ #: ../classes/class-ccf-form-manager.php:1451
653
+ #: ../classes/class-ccf-form-manager.php:1520
654
+ #: ../classes/class-ccf-form-manager.php:1544
655
+ #: ../classes/class-ccf-form-manager.php:1587
656
+ #: ../classes/class-ccf-form-manager.php:1611
657
+ #: ../classes/class-ccf-form-manager.php:1654
658
+ #: ../classes/class-ccf-form-manager.php:1678
659
+ #: ../classes/class-ccf-settings.php:104
660
+ msgid "Yes"
661
  msgstr ""
662
 
663
  #: ../classes/class-ccf-form-manager.php:245
664
+ #: ../classes/class-ccf-form-manager.php:401
665
+ #: ../classes/class-ccf-form-manager.php:453
666
+ #: ../classes/class-ccf-form-manager.php:465
667
+ #: ../classes/class-ccf-form-manager.php:509
668
+ #: ../classes/class-ccf-form-manager.php:637
669
+ #: ../classes/class-ccf-form-manager.php:656
670
+ #: ../classes/class-ccf-form-manager.php:711
671
+ #: ../classes/class-ccf-form-manager.php:726
672
+ #: ../classes/class-ccf-form-manager.php:840
673
+ #: ../classes/class-ccf-form-manager.php:859
674
+ #: ../classes/class-ccf-form-manager.php:904
675
+ #: ../classes/class-ccf-form-manager.php:953
676
+ #: ../classes/class-ccf-form-manager.php:1002
677
+ #: ../classes/class-ccf-form-manager.php:1021
678
+ #: ../classes/class-ccf-form-manager.php:1070
679
+ #: ../classes/class-ccf-form-manager.php:1115
680
+ #: ../classes/class-ccf-form-manager.php:1130
681
+ #: ../classes/class-ccf-form-manager.php:1181
682
+ #: ../classes/class-ccf-form-manager.php:1219
683
+ #: ../classes/class-ccf-form-manager.php:1275
684
+ #: ../classes/class-ccf-form-manager.php:1294
685
+ #: ../classes/class-ccf-form-manager.php:1356
686
+ #: ../classes/class-ccf-form-manager.php:1371
687
+ #: ../classes/class-ccf-form-manager.php:1422
688
+ #: ../classes/class-ccf-form-manager.php:1429
689
+ #: ../classes/class-ccf-form-manager.php:1450
690
+ #: ../classes/class-ccf-form-manager.php:1521
691
+ #: ../classes/class-ccf-form-manager.php:1543
692
+ #: ../classes/class-ccf-form-manager.php:1588
693
+ #: ../classes/class-ccf-form-manager.php:1610
694
+ #: ../classes/class-ccf-form-manager.php:1655
695
+ #: ../classes/class-ccf-form-manager.php:1677
696
+ #: ../classes/class-ccf-settings.php:103
697
+ msgid "No"
698
  msgstr ""
699
 
700
  #: ../classes/class-ccf-form-manager.php:248
701
  msgid "Only active notifications will be sent."
702
  msgstr ""
703
 
704
+ #: ../classes/class-ccf-form-manager.php:256
705
+ msgid "\"Reply To\" Address Type:"
706
  msgstr ""
707
 
708
+ #: ../classes/class-ccf-form-manager.php:258
709
+ #: ../classes/class-ccf-form-manager.php:304
710
+ msgid "Default"
711
  msgstr ""
712
 
713
+ #: ../classes/class-ccf-form-manager.php:259
714
+ #: ../classes/class-ccf-form-manager.php:330
715
+ #: ../classes/class-ccf-form-manager.php:375
716
  msgid "Custom Email"
717
  msgstr ""
718
 
719
+ #: ../classes/class-ccf-form-manager.php:260
720
+ #: ../classes/class-ccf-form-manager.php:281
721
+ #: ../classes/class-ccf-form-manager.php:306
722
+ #: ../classes/class-ccf-form-manager.php:331
723
+ #: ../classes/class-ccf-form-manager.php:352
724
+ #: ../classes/class-ccf-form-manager.php:376
725
  msgid "Form Field"
726
  msgstr ""
727
 
728
+ #: ../classes/class-ccf-form-manager.php:263
729
  msgid ""
730
+ "You can set the notification emails \"reply to\" address to be the WP "
731
+ "default, a custom email address, or pull the address from a field in the "
732
+ "form."
733
  msgstr ""
734
 
735
+ #: ../classes/class-ccf-form-manager.php:267
736
+ msgid "Custom \"Reply To\" Email Address:"
737
  msgstr ""
738
 
739
+ #: ../classes/class-ccf-form-manager.php:272
740
+ msgid "Pull \"Reply To\" Email Dynamically from Field:"
741
  msgstr ""
742
 
743
+ #: ../classes/class-ccf-form-manager.php:278
744
+ msgid "\"Reply To\" Name Type:"
745
  msgstr ""
746
 
747
+ #: ../classes/class-ccf-form-manager.php:280
748
+ #: ../classes/class-ccf-form-manager.php:351
749
  msgid "Custom Name"
750
  msgstr ""
751
 
752
+ #: ../classes/class-ccf-form-manager.php:284
753
  msgid ""
754
+ "You can set the notification emails \"reply to\" name to be a custom name or "
755
+ "pull the name from a field in the form."
756
  msgstr ""
757
 
758
+ #: ../classes/class-ccf-form-manager.php:288
759
+ msgid "\"Reply To\" Name:"
760
  msgstr ""
761
 
762
+ #: ../classes/class-ccf-form-manager.php:293
763
+ msgid "Pull \"Reply To\" Name Dynamically from Field:"
764
  msgstr ""
765
 
766
+ #: ../classes/class-ccf-form-manager.php:302
767
  msgid "Email Subject Type:"
768
  msgstr ""
769
 
770
+ #: ../classes/class-ccf-form-manager.php:305
 
 
 
 
771
  msgid "Custom Subject"
772
  msgstr ""
773
 
774
+ #: ../classes/class-ccf-form-manager.php:309
775
  msgid ""
776
  "You can set the notification emails subject line to be the CCF default, "
777
  "custom text, or pull the subject from a field in the form."
778
  msgstr ""
779
 
780
+ #: ../classes/class-ccf-form-manager.php:313
781
  msgid "Custom Email Subject:"
782
  msgstr ""
783
 
784
+ #: ../classes/class-ccf-form-manager.php:318
785
  msgid "Pull Email Subject Dynamically from Field:"
786
  msgstr ""
787
 
788
+ #: ../classes/class-ccf-form-manager.php:324
789
+ msgid ""
790
+ "We highly recommend leaving the \"from\" fields below as their defaults to "
791
+ "ensure your notification emails get delivered."
792
+ msgstr ""
793
+
794
+ #: ../classes/class-ccf-form-manager.php:327
795
+ msgid "\"From\" Email Address Type:"
796
+ msgstr ""
797
+
798
+ #: ../classes/class-ccf-form-manager.php:329
799
+ msgid "WordPress Default"
800
+ msgstr ""
801
+
802
+ #: ../classes/class-ccf-form-manager.php:334
803
+ msgid ""
804
+ "You can set the notification emails from address to be the WP default, a "
805
+ "custom email address, or pull the address from a field in the form."
806
+ msgstr ""
807
+
808
+ #: ../classes/class-ccf-form-manager.php:338
809
+ msgid "Custom \"From\" Email Address:"
810
+ msgstr ""
811
+
812
+ #: ../classes/class-ccf-form-manager.php:343
813
+ msgid "Pull \"From\" Email Dynamically from Field:"
814
+ msgstr ""
815
+
816
+ #: ../classes/class-ccf-form-manager.php:349
817
+ msgid "\"From\" Name Type:"
818
+ msgstr ""
819
+
820
+ #: ../classes/class-ccf-form-manager.php:355
821
+ msgid ""
822
+ "You can set the notification emails from name to be a custom name or pull "
823
+ "the name from a field in the form."
824
+ msgstr ""
825
+
826
+ #: ../classes/class-ccf-form-manager.php:359
827
+ msgid "Custom \"From\" Name:"
828
+ msgstr ""
829
+
830
+ #: ../classes/class-ccf-form-manager.php:364
831
+ msgid "Pull \"From\" Name Dynamically from Field:"
832
+ msgstr ""
833
+
834
+ #: ../classes/class-ccf-form-manager.php:390
835
  msgid "General"
836
  msgstr ""
837
 
838
+ #: ../classes/class-ccf-form-manager.php:393
839
  msgid "Form Title:"
840
  msgstr ""
841
 
842
+ #: ../classes/class-ccf-form-manager.php:398
843
+ msgid "Hide Form Title:"
844
+ msgstr ""
845
+
846
+ #: ../classes/class-ccf-form-manager.php:407
847
  msgid "Form Description:"
848
  msgstr ""
849
 
850
+ #: ../classes/class-ccf-form-manager.php:412
851
  msgid "Button Text:"
852
  msgstr ""
853
 
854
+ #: ../classes/class-ccf-form-manager.php:417
855
  msgid "Button Class:"
856
  msgstr ""
857
 
858
+ #: ../classes/class-ccf-form-manager.php:422
859
  msgid "Form Theme:"
860
  msgstr ""
861
 
862
+ #: ../classes/class-ccf-form-manager.php:425
863
  msgid "None"
864
  msgstr ""
865
 
866
+ #: ../classes/class-ccf-form-manager.php:426
867
  msgid "Light"
868
  msgstr ""
869
 
870
+ #: ../classes/class-ccf-form-manager.php:427
871
  msgid "Dark"
872
  msgstr ""
873
 
874
+ #: ../classes/class-ccf-form-manager.php:430
875
  msgid "\"None\" will have your form inherit styles from your theme."
876
  msgstr ""
877
 
878
+ #: ../classes/class-ccf-form-manager.php:434
879
  msgid "On form completion:"
880
  msgstr ""
881
 
882
+ #: ../classes/class-ccf-form-manager.php:437
883
  msgid "Show text"
884
  msgstr ""
885
 
886
+ #: ../classes/class-ccf-form-manager.php:438
887
  msgid "Redirect"
888
  msgstr ""
889
 
890
+ #: ../classes/class-ccf-form-manager.php:442
891
  msgid "Redirect URL:"
892
  msgstr ""
893
 
894
+ #: ../classes/class-ccf-form-manager.php:446
895
  msgid "Completion Message:"
896
  msgstr ""
897
 
898
+ #: ../classes/class-ccf-form-manager.php:450
899
  msgid "Pause form:"
900
  msgstr ""
901
 
902
+ #: ../classes/class-ccf-form-manager.php:458
903
  msgid "Pause Message:"
904
  msgstr ""
905
 
906
+ #: ../classes/class-ccf-form-manager.php:462
907
  msgid "Require User to Be Logged In:"
908
  msgstr ""
909
 
910
+ #: ../classes/class-ccf-form-manager.php:470
911
  msgid "Email Notifications"
912
  msgstr ""
913
 
914
+ #: ../classes/class-ccf-form-manager.php:476
915
+ #: ../classes/class-ccf-form-manager.php:487
916
+ #: ../classes/class-ccf-form-manager.php:582
917
+ #: ../classes/class-ccf-form-manager.php:595
918
  msgid "Title"
919
  msgstr ""
920
 
921
+ #: ../classes/class-ccf-form-manager.php:477
922
+ #: ../classes/class-ccf-form-manager.php:488
923
  msgid "Subject"
924
  msgstr ""
925
 
926
+ #: ../classes/class-ccf-form-manager.php:478
927
+ #: ../classes/class-ccf-form-manager.php:489
928
  msgid "To"
929
  msgstr ""
930
 
931
+ #: ../classes/class-ccf-form-manager.php:479
932
+ #: ../classes/class-ccf-form-manager.php:490
933
  msgid "Active"
934
  msgstr ""
935
 
936
+ #: ../classes/class-ccf-form-manager.php:495
937
  msgid "New Notification"
938
  msgstr ""
939
 
940
+ #: ../classes/class-ccf-form-manager.php:498
941
  msgid ""
942
  "For notification changes to take affect (updating, adding, deleting, etc.), "
943
  "you will need to save the form."
944
  msgstr ""
945
 
946
+ #: ../classes/class-ccf-form-manager.php:502
947
  msgid "Post Creation"
948
  msgstr ""
949
 
950
+ #: ../classes/class-ccf-form-manager.php:503
951
  msgid ""
952
  "You can have Custom Contact Forms create a post (or custom post type) "
953
  "whenever someone submits your form."
954
  msgstr ""
955
 
956
+ #: ../classes/class-ccf-form-manager.php:506
957
  msgid "Enable Post Creation:"
958
  msgstr ""
959
 
960
+ #: ../classes/class-ccf-form-manager.php:515
961
  msgid "Post Type:"
962
  msgstr ""
963
 
964
+ #: ../classes/class-ccf-form-manager.php:525
965
  msgid "Post Status:"
966
  msgstr ""
967
 
968
+ #: ../classes/class-ccf-form-manager.php:535
969
  msgid "Field Mappings:"
970
  msgstr ""
971
 
972
+ #: ../classes/class-ccf-form-manager.php:540
973
  msgid ""
974
  "You can map as few or as many fields as you like. However, if no form fields "
975
  "are mapped, no post will be created. Mapping a field to post_title is "
976
  "required."
977
  msgstr ""
978
 
979
+ #: ../classes/class-ccf-form-manager.php:552
980
  msgid "Custom Field Key"
981
  msgstr ""
982
 
983
+ #: ../classes/class-ccf-form-manager.php:566
984
  msgid "items"
985
  msgstr ""
986
 
987
+ #: ../classes/class-ccf-form-manager.php:581
988
+ #: ../classes/class-ccf-form-manager.php:594
989
  msgid "ID"
990
  msgstr ""
991
 
992
+ #: ../classes/class-ccf-form-manager.php:609
993
  msgid "<span>&larr;</span> Click on a field to edit it."
994
  msgstr ""
995
 
996
+ #: ../classes/class-ccf-form-manager.php:618
997
+ #: ../classes/class-ccf-form-manager.php:686
998
+ #: ../classes/class-ccf-form-manager.php:821
999
+ #: ../classes/class-ccf-form-manager.php:983
1000
  msgid "Internal Unique Slug"
1001
  msgstr ""
1002
 
1003
+ #: ../classes/class-ccf-form-manager.php:622
1004
+ #: ../classes/class-ccf-form-manager.php:690
1005
+ #: ../classes/class-ccf-form-manager.php:757
1006
+ #: ../classes/class-ccf-form-manager.php:792
1007
+ #: ../classes/class-ccf-form-manager.php:825
1008
+ #: ../classes/class-ccf-form-manager.php:987
1009
+ #: ../classes/class-ccf-form-manager.php:1104
1010
+ #: ../classes/class-ccf-form-manager.php:1164
1011
+ #: ../classes/class-ccf-form-manager.php:1253
1012
+ #: ../classes/class-ccf-form-manager.php:1328
1013
+ #: ../classes/class-ccf-form-manager.php:1405
1014
+ #: ../classes/class-ccf-form-manager.php:1510
1015
+ #: ../classes/class-ccf-form-manager.php:1577
1016
+ #: ../classes/class-ccf-form-manager.php:1644
1017
  msgid "Label:"
1018
  msgstr ""
1019
 
1020
+ #: ../classes/class-ccf-form-manager.php:626
1021
+ #: ../classes/class-ccf-form-manager.php:694
1022
+ #: ../classes/class-ccf-form-manager.php:761
1023
+ #: ../classes/class-ccf-form-manager.php:796
1024
+ #: ../classes/class-ccf-form-manager.php:829
1025
+ #: ../classes/class-ccf-form-manager.php:991
1026
+ #: ../classes/class-ccf-form-manager.php:1108
1027
+ #: ../classes/class-ccf-form-manager.php:1168
1028
+ #: ../classes/class-ccf-form-manager.php:1257
1029
+ #: ../classes/class-ccf-form-manager.php:1332
1030
+ #: ../classes/class-ccf-form-manager.php:1409
1031
+ #: ../classes/class-ccf-form-manager.php:1514
1032
+ #: ../classes/class-ccf-form-manager.php:1581
1033
+ #: ../classes/class-ccf-form-manager.php:1648
1034
  msgid "Description:"
1035
  msgstr ""
1036
 
1037
+ #: ../classes/class-ccf-form-manager.php:630
1038
+ #: ../classes/class-ccf-form-manager.php:833
1039
+ #: ../classes/class-ccf-form-manager.php:995
1040
+ #: ../classes/class-ccf-form-manager.php:1055
1041
+ #: ../classes/class-ccf-form-manager.php:1173
1042
+ #: ../classes/class-ccf-form-manager.php:1261
1043
+ #: ../classes/class-ccf-form-manager.php:1414
1044
  msgid "Initial Value:"
1045
  msgstr ""
1046
 
1047
+ #: ../classes/class-ccf-form-manager.php:634
1048
+ #: ../classes/class-ccf-form-manager.php:708
1049
+ #: ../classes/class-ccf-form-manager.php:837
1050
+ #: ../classes/class-ccf-form-manager.php:999
1051
+ #: ../classes/class-ccf-form-manager.php:1112
1052
+ #: ../classes/class-ccf-form-manager.php:1178
1053
+ #: ../classes/class-ccf-form-manager.php:1272
1054
+ #: ../classes/class-ccf-form-manager.php:1353
1055
+ #: ../classes/class-ccf-form-manager.php:1419
1056
+ #: ../classes/class-ccf-form-manager.php:1518
1057
+ #: ../classes/class-ccf-form-manager.php:1585
1058
+ #: ../classes/class-ccf-form-manager.php:1652
1059
  msgid "Required:"
1060
  msgstr ""
1061
 
1062
+ #: ../classes/class-ccf-form-manager.php:643
1063
+ #: ../classes/class-ccf-form-manager.php:717
1064
+ #: ../classes/class-ccf-form-manager.php:777
1065
+ #: ../classes/class-ccf-form-manager.php:802
1066
+ #: ../classes/class-ccf-form-manager.php:846
1067
+ #: ../classes/class-ccf-form-manager.php:895
1068
+ #: ../classes/class-ccf-form-manager.php:944
1069
+ #: ../classes/class-ccf-form-manager.php:1008
1070
+ #: ../classes/class-ccf-form-manager.php:1061
1071
+ #: ../classes/class-ccf-form-manager.php:1121
1072
+ #: ../classes/class-ccf-form-manager.php:1204
1073
+ #: ../classes/class-ccf-form-manager.php:1281
1074
+ #: ../classes/class-ccf-form-manager.php:1362
1075
+ #: ../classes/class-ccf-form-manager.php:1435
1076
+ #: ../classes/class-ccf-form-manager.php:1534
1077
+ #: ../classes/class-ccf-form-manager.php:1601
1078
+ #: ../classes/class-ccf-form-manager.php:1668
1079
  msgid "Advanced"
1080
  msgstr ""
1081
 
1082
+ #: ../classes/class-ccf-form-manager.php:646
1083
+ #: ../classes/class-ccf-form-manager.php:720
1084
+ #: ../classes/class-ccf-form-manager.php:780
1085
+ #: ../classes/class-ccf-form-manager.php:805
1086
+ #: ../classes/class-ccf-form-manager.php:849
1087
+ #: ../classes/class-ccf-form-manager.php:898
1088
+ #: ../classes/class-ccf-form-manager.php:947
1089
+ #: ../classes/class-ccf-form-manager.php:1011
1090
+ #: ../classes/class-ccf-form-manager.php:1064
1091
+ #: ../classes/class-ccf-form-manager.php:1124
1092
+ #: ../classes/class-ccf-form-manager.php:1207
1093
+ #: ../classes/class-ccf-form-manager.php:1284
1094
+ #: ../classes/class-ccf-form-manager.php:1365
1095
+ #: ../classes/class-ccf-form-manager.php:1438
1096
+ #: ../classes/class-ccf-form-manager.php:1537
1097
+ #: ../classes/class-ccf-form-manager.php:1604
1098
+ #: ../classes/class-ccf-form-manager.php:1671
1099
  msgid "Class Name:"
1100
  msgstr ""
1101
 
1102
+ #: ../classes/class-ccf-form-manager.php:650
1103
+ #: ../classes/class-ccf-form-manager.php:809
1104
+ #: ../classes/class-ccf-form-manager.php:853
1105
+ #: ../classes/class-ccf-form-manager.php:1015
1106
+ #: ../classes/class-ccf-form-manager.php:1212
1107
+ #: ../classes/class-ccf-form-manager.php:1288
1108
+ #: ../classes/class-ccf-form-manager.php:1443
1109
  msgid "Placeholder Text:"
1110
  msgstr ""
1111
 
1112
+ #: ../classes/class-ccf-form-manager.php:654
1113
+ #: ../classes/class-ccf-form-manager.php:724
1114
+ #: ../classes/class-ccf-form-manager.php:857
1115
+ #: ../classes/class-ccf-form-manager.php:902
1116
+ #: ../classes/class-ccf-form-manager.php:951
1117
+ #: ../classes/class-ccf-form-manager.php:1019
1118
+ #: ../classes/class-ccf-form-manager.php:1068
1119
+ #: ../classes/class-ccf-form-manager.php:1128
1120
+ #: ../classes/class-ccf-form-manager.php:1217
1121
+ #: ../classes/class-ccf-form-manager.php:1292
1122
+ #: ../classes/class-ccf-form-manager.php:1369
1123
+ #: ../classes/class-ccf-form-manager.php:1448
1124
+ #: ../classes/class-ccf-form-manager.php:1541
1125
+ #: ../classes/class-ccf-form-manager.php:1608
1126
+ #: ../classes/class-ccf-form-manager.php:1675
1127
  msgid "Enable Conditional Logic:"
1128
  msgstr ""
1129
 
1130
+ #: ../classes/class-ccf-form-manager.php:662
1131
+ #: ../classes/class-ccf-form-manager.php:732
1132
+ #: ../classes/class-ccf-form-manager.php:865
1133
+ #: ../classes/class-ccf-form-manager.php:910
1134
+ #: ../classes/class-ccf-form-manager.php:959
1135
+ #: ../classes/class-ccf-form-manager.php:1027
1136
+ #: ../classes/class-ccf-form-manager.php:1076
1137
+ #: ../classes/class-ccf-form-manager.php:1136
1138
+ #: ../classes/class-ccf-form-manager.php:1225
1139
+ #: ../classes/class-ccf-form-manager.php:1300
1140
+ #: ../classes/class-ccf-form-manager.php:1377
1141
+ #: ../classes/class-ccf-form-manager.php:1456
1142
+ #: ../classes/class-ccf-form-manager.php:1549
1143
+ #: ../classes/class-ccf-form-manager.php:1616
1144
+ #: ../classes/class-ccf-form-manager.php:1683
1145
  msgid "Hide"
1146
  msgstr ""
1147
 
1148
+ #: ../classes/class-ccf-form-manager.php:663
1149
+ #: ../classes/class-ccf-form-manager.php:733
1150
+ #: ../classes/class-ccf-form-manager.php:866
1151
+ #: ../classes/class-ccf-form-manager.php:911
1152
+ #: ../classes/class-ccf-form-manager.php:960
1153
+ #: ../classes/class-ccf-form-manager.php:1028
1154
+ #: ../classes/class-ccf-form-manager.php:1077
1155
+ #: ../classes/class-ccf-form-manager.php:1137
1156
+ #: ../classes/class-ccf-form-manager.php:1226
1157
+ #: ../classes/class-ccf-form-manager.php:1301
1158
+ #: ../classes/class-ccf-form-manager.php:1378
1159
+ #: ../classes/class-ccf-form-manager.php:1457
1160
+ #: ../classes/class-ccf-form-manager.php:1550
1161
+ #: ../classes/class-ccf-form-manager.php:1617
1162
+ #: ../classes/class-ccf-form-manager.php:1684
1163
  msgid "Show"
1164
  msgstr ""
1165
 
1166
+ #: ../classes/class-ccf-form-manager.php:666
1167
+ #: ../classes/class-ccf-form-manager.php:736
1168
+ #: ../classes/class-ccf-form-manager.php:869
1169
+ #: ../classes/class-ccf-form-manager.php:914
1170
+ #: ../classes/class-ccf-form-manager.php:963
1171
+ #: ../classes/class-ccf-form-manager.php:1031
1172
+ #: ../classes/class-ccf-form-manager.php:1080
1173
+ #: ../classes/class-ccf-form-manager.php:1140
1174
+ #: ../classes/class-ccf-form-manager.php:1229
1175
+ #: ../classes/class-ccf-form-manager.php:1304
1176
+ #: ../classes/class-ccf-form-manager.php:1381
1177
+ #: ../classes/class-ccf-form-manager.php:1460
1178
+ #: ../classes/class-ccf-form-manager.php:1553
1179
+ #: ../classes/class-ccf-form-manager.php:1620
1180
+ #: ../classes/class-ccf-form-manager.php:1687
1181
  msgid "this field if"
1182
  msgstr ""
1183
 
1184
+ #: ../classes/class-ccf-form-manager.php:669
1185
+ #: ../classes/class-ccf-form-manager.php:739
1186
+ #: ../classes/class-ccf-form-manager.php:872
1187
+ #: ../classes/class-ccf-form-manager.php:917
1188
+ #: ../classes/class-ccf-form-manager.php:966
1189
+ #: ../classes/class-ccf-form-manager.php:1034
1190
+ #: ../classes/class-ccf-form-manager.php:1083
1191
+ #: ../classes/class-ccf-form-manager.php:1143
1192
+ #: ../classes/class-ccf-form-manager.php:1232
1193
+ #: ../classes/class-ccf-form-manager.php:1307
1194
+ #: ../classes/class-ccf-form-manager.php:1384
1195
+ #: ../classes/class-ccf-form-manager.php:1463
1196
+ #: ../classes/class-ccf-form-manager.php:1556
1197
+ #: ../classes/class-ccf-form-manager.php:1623
1198
+ #: ../classes/class-ccf-form-manager.php:1690
1199
  msgid "All"
1200
  msgstr ""
1201
 
1202
+ #: ../classes/class-ccf-form-manager.php:670
1203
+ #: ../classes/class-ccf-form-manager.php:740
1204
+ #: ../classes/class-ccf-form-manager.php:873
1205
+ #: ../classes/class-ccf-form-manager.php:918
1206
+ #: ../classes/class-ccf-form-manager.php:967
1207
+ #: ../classes/class-ccf-form-manager.php:1035
1208
+ #: ../classes/class-ccf-form-manager.php:1084
1209
+ #: ../classes/class-ccf-form-manager.php:1144
1210
+ #: ../classes/class-ccf-form-manager.php:1233
1211
+ #: ../classes/class-ccf-form-manager.php:1308
1212
+ #: ../classes/class-ccf-form-manager.php:1385
1213
+ #: ../classes/class-ccf-form-manager.php:1464
1214
+ #: ../classes/class-ccf-form-manager.php:1557
1215
+ #: ../classes/class-ccf-form-manager.php:1624
1216
+ #: ../classes/class-ccf-form-manager.php:1691
1217
  msgid "Any"
1218
  msgstr ""
1219
 
1220
+ #: ../classes/class-ccf-form-manager.php:673
1221
+ #: ../classes/class-ccf-form-manager.php:743
1222
+ #: ../classes/class-ccf-form-manager.php:876
1223
+ #: ../classes/class-ccf-form-manager.php:921
1224
+ #: ../classes/class-ccf-form-manager.php:970
1225
+ #: ../classes/class-ccf-form-manager.php:1038
1226
+ #: ../classes/class-ccf-form-manager.php:1087
1227
+ #: ../classes/class-ccf-form-manager.php:1147
1228
+ #: ../classes/class-ccf-form-manager.php:1236
1229
+ #: ../classes/class-ccf-form-manager.php:1311
1230
+ #: ../classes/class-ccf-form-manager.php:1388
1231
+ #: ../classes/class-ccf-form-manager.php:1467
1232
+ #: ../classes/class-ccf-form-manager.php:1560
1233
+ #: ../classes/class-ccf-form-manager.php:1627
1234
+ #: ../classes/class-ccf-form-manager.php:1694
1235
  msgid "of these conditions are true:"
1236
  msgstr ""
1237
 
1238
+ #: ../classes/class-ccf-form-manager.php:698
1239
  msgid "Allowed File Extensions (comma separate):"
1240
  msgstr ""
1241
 
1242
+ #: ../classes/class-ccf-form-manager.php:700
1243
  msgid ""
1244
  "If left blank, will default to all extensions registered by WordPress. If "
1245
  "you use a file extension or mime type not <a href=\"http://codex.wordpress."
1247
  "a>, you will need to filter and manually whitelist the new extension."
1248
  msgstr ""
1249
 
1250
+ #: ../classes/class-ccf-form-manager.php:703
1251
  msgid "Max File Size (in MB):"
1252
  msgstr ""
1253
 
1254
+ #: ../classes/class-ccf-form-manager.php:705
1255
  #, php-format
1256
  msgid ""
1257
  "If left blank, will default to %d MB. Maximum allowed by server is %d MB."
1258
  msgstr ""
1259
 
1260
+ #: ../classes/class-ccf-form-manager.php:755
1261
  msgid ""
1262
  "reCAPTCHA is a simple captcha service provided by Google. <a target=\"_blank"
1263
  "\" href=\"https://www.google.com/recaptcha/intro/index.html\">Learn more</a>"
1264
  msgstr ""
1265
 
1266
+ #: ../classes/class-ccf-form-manager.php:765
1267
  msgid "Site Key:"
1268
  msgstr ""
1269
 
1270
+ #: ../classes/class-ccf-form-manager.php:767
1271
+ #: ../classes/class-ccf-form-manager.php:772
1272
  msgid "Don't have one?"
1273
  msgstr ""
1274
 
1275
+ #: ../classes/class-ccf-form-manager.php:770
1276
  msgid "Secret Key:"
1277
  msgstr ""
1278
 
1279
+ #: ../classes/class-ccf-form-manager.php:886
1280
+ #: ../classes/class-ccf-form-manager.php:931
1281
+ #: ../classes/class-ccf-form-manager.php:980
1282
+ #: ../classes/class-ccf-form-manager.php:1048
1283
+ #: ../classes/class-ccf-form-manager.php:1097
1284
+ #: ../classes/class-ccf-form-manager.php:1157
1285
+ #: ../classes/class-ccf-form-manager.php:1246
1286
+ #: ../classes/class-ccf-form-manager.php:1321
1287
+ #: ../classes/class-ccf-form-manager.php:1398
1288
+ #: ../classes/class-ccf-form-manager.php:1503
1289
+ #: ../classes/class-ccf-form-manager.php:1570
1290
+ #: ../classes/class-ccf-form-manager.php:1637
1291
  msgid "Basic"
1292
  msgstr ""
1293
 
1294
+ #: ../classes/class-ccf-form-manager.php:889
1295
  msgid "HTML Content:"
1296
  msgstr ""
1297
 
1298
+ #: ../classes/class-ccf-form-manager.php:934
1299
  msgid "Heading:"
1300
  msgstr ""
1301
 
1302
+ #: ../classes/class-ccf-form-manager.php:938
1303
  msgid "Sub Heading:"
1304
  msgstr ""
1305
 
1306
+ #: ../classes/class-ccf-form-manager.php:1051
1307
+ #: ../classes/class-ccf-form-manager.php:1100
1308
+ #: ../classes/class-ccf-form-manager.php:1160
1309
+ #: ../classes/class-ccf-form-manager.php:1249
1310
+ #: ../classes/class-ccf-form-manager.php:1324
1311
+ #: ../classes/class-ccf-form-manager.php:1401
1312
+ #: ../classes/class-ccf-form-manager.php:1506
1313
+ #: ../classes/class-ccf-form-manager.php:1573
1314
+ #: ../classes/class-ccf-form-manager.php:1640
1315
  msgid "Internal Unique Slug (a-z, 0-9, -, _):"
1316
  msgstr ""
1317
 
1318
+ #: ../classes/class-ccf-form-manager.php:1186
1319
  msgid "Enable Date Select"
1320
  msgstr ""
1321
 
1322
+ #: ../classes/class-ccf-form-manager.php:1190
1323
  msgid "Enable Time Select"
1324
  msgstr ""
1325
 
1326
+ #: ../classes/class-ccf-form-manager.php:1194
1327
  msgid "Date Format:"
1328
  msgstr ""
1329
 
1330
+ #: ../classes/class-ccf-form-manager.php:1265
1331
  msgid "Format:"
1332
  msgstr ""
1333
 
1334
+ #: ../classes/class-ccf-form-manager.php:1268
1335
+ #: ../classes/class-ccf-form-manager.php:1339
1336
  msgid "International"
1337
  msgstr ""
1338
 
1339
+ #: ../classes/class-ccf-form-manager.php:1336
1340
  msgid "Type:"
1341
  msgstr ""
1342
 
1343
+ #: ../classes/class-ccf-form-manager.php:1338
1344
  msgid "United States"
1345
  msgstr ""
1346
 
1347
+ #: ../classes/class-ccf-form-manager.php:1344
1348
  msgid "Default Country:"
1349
  msgstr ""
1350
 
1351
+ #: ../classes/class-ccf-form-manager.php:1426
1352
  msgid "Require Confirmation:"
1353
  msgstr ""
1354
 
1355
+ #: ../classes/class-ccf-form-manager.php:1478
1356
  msgid "Label"
1357
  msgstr ""
1358
 
1359
+ #: ../classes/class-ccf-form-manager.php:1479
1360
  msgid "Value"
1361
  msgstr ""
1362
 
1363
+ #: ../classes/class-ccf-form-manager.php:1492
1364
  msgid "is"
1365
  msgstr ""
1366
 
1367
+ #: ../classes/class-ccf-form-manager.php:1493
1368
  msgid "is not"
1369
  msgstr ""
1370
 
1371
+ #: ../classes/class-ccf-form-manager.php:1494
1372
  msgid ">"
1373
  msgstr ""
1374
 
1375
+ #: ../classes/class-ccf-form-manager.php:1495
1376
  msgid "<"
1377
  msgstr ""
1378
 
1379
+ #: ../classes/class-ccf-form-manager.php:1496
1380
  msgid "contains"
1381
  msgstr ""
1382
 
1383
+ #: ../classes/class-ccf-form-manager.php:1498
1384
  msgid "Field value"
1385
  msgstr ""
1386
 
1387
+ #: ../classes/class-ccf-form-manager.php:1525
1388
+ #: ../classes/class-ccf-form-manager.php:1592
1389
+ #: ../classes/class-ccf-form-manager.php:1659
1390
  msgid "Manage field choices:"
1391
  msgstr ""
1392
 
1393
+ #: ../classes/class-ccf-form-manager.php:1529
1394
+ #: ../classes/class-ccf-form-manager.php:1596
1395
+ #: ../classes/class-ccf-form-manager.php:1663
1396
  msgid ""
1397
  "Note: If an option does not have a \"value\", it will not be considered a "
1398
  "valid selection if the field is required. The \"value\" is what's read, "
1399
  "stored, and displayed in the submission."
1400
  msgstr ""
1401
 
1402
+ #: ../classes/class-ccf-form-manager.php:1704
1403
  msgid "You currently have no forms. Add some!"
1404
  msgstr ""
1405
 
1406
+ #: ../classes/class-ccf-form-manager.php:1727
1407
  msgid "Allowed file extensions are {{ extensions }}. "
1408
  msgstr ""
1409
 
1410
+ #: ../classes/class-ccf-form-manager.php:1729
1411
  msgid "Max file size is {{ file_size }} MB. "
1412
  msgstr ""
1413
 
1414
+ #: ../classes/class-ccf-form-manager.php:1764
1415
+ #: ../classes/class-ccf-form-manager.php:1780
1416
+ #: ../classes/class-ccf-form-manager.php:1798
1417
  msgid "An example choice"
1418
  msgstr ""
1419
 
1420
+ #: ../classes/class-ccf-form-manager.php:1817
1421
  msgid "Arbitrary block of HTML."
1422
  msgstr ""
1423
 
1424
+ #: ../classes/class-ccf-form-manager.php:1824
1425
  msgid "Section Heading"
1426
  msgstr ""
1427
 
1428
+ #: ../classes/class-ccf-form-manager.php:1826
1429
  msgid "This is the sub-heading text."
1430
  msgstr ""
1431
 
1432
+ #: ../classes/class-ccf-form-manager.php:1997
1433
  msgid "Duplicate form"
1434
  msgstr ""
1435
 
1436
+ #: ../classes/class-ccf-form-manager.php:1998
1437
  msgid "Trash"
1438
  msgstr ""
1439
 
1440
+ #: ../classes/class-ccf-form-manager.php:2041
1441
  msgid "There is a problem with this form. Is it trashed or deleted?"
1442
  msgstr ""
1443
 
1444
+ #: ../classes/class-ccf-form-manager.php:2188
1445
  msgid "IP Address"
1446
  msgstr ""
1447
 
1448
+ #: ../classes/class-ccf-form-manager.php:2195
1449
  msgid "Form Page URL"
1450
  msgstr ""
1451
 
1452
+ #: ../classes/class-ccf-form-manager.php:2208
1453
  msgid "There are no submissions."
1454
  msgstr ""
1455
 
1456
+ #: ../classes/class-ccf-form-manager.php:2237
1457
  msgid "Add Form"
1458
  msgstr ""
1459
 
1460
+ #: ../classes/class-ccf-form-manager.php:2260
1461
  msgid "Single Line Text"
1462
  msgstr ""
1463
 
1464
+ #: ../classes/class-ccf-form-manager.php:2261
1465
  msgid "Dropdown"
1466
  msgstr ""
1467
 
1468
+ #: ../classes/class-ccf-form-manager.php:2262
1469
  msgid "Checkboxes"
1470
  msgstr ""
1471
 
1472
+ #: ../classes/class-ccf-form-manager.php:2263
1473
  msgid "Radio Buttons"
1474
  msgstr ""
1475
 
1476
+ #: ../classes/class-ccf-form-manager.php:2264
1477
  msgid "Paragraph Text"
1478
  msgstr ""
1479
 
1480
+ #: ../classes/class-ccf-form-manager.php:2265
1481
  msgid "Hidden"
1482
  msgstr ""
1483
 
1484
+ #: ../classes/class-ccf-form-manager.php:2266
1485
  msgid "File Upload"
1486
  msgstr ""
1487
 
1488
+ #: ../classes/class-ccf-form-manager.php:2270
1489
  msgid "HTML"
1490
  msgstr ""
1491
 
1492
+ #: ../classes/class-ccf-form-manager.php:2271
1493
  msgid "Section"
1494
  msgstr ""
1495
 
1496
+ #: ../classes/class-ccf-form-manager.php:2276
1497
  msgid "Name"
1498
  msgstr ""
1499
 
1500
+ #: ../classes/class-ccf-form-manager.php:2277
1501
  msgid "Date/Time"
1502
  msgstr ""
1503
 
1504
+ #: ../classes/class-ccf-form-manager.php:2278
1505
  msgid "Website"
1506
  msgstr ""
1507
 
1508
+ #: ../classes/class-ccf-form-manager.php:2279
1509
  msgid "Address"
1510
  msgstr ""
1511
 
1512
+ #: ../classes/class-ccf-form-manager.php:2280
1513
  msgid "Phone"
1514
  msgstr ""
1515
 
1516
+ #: ../classes/class-ccf-form-manager.php:2281
1517
  msgid "reCAPTCHA"
1518
  msgstr ""
1519
 
1520
+ #: ../classes/class-ccf-form-manager.php:2282
1521
  msgid "Simple CAPTCHA"
1522
  msgstr ""
1523
 
1524
+ #: ../classes/class-ccf-form-manager.php:2314
1525
  msgid "Type the characters in the image"
1526
  msgstr ""
1527
 
1528
+ #: ../classes/class-ccf-form-manager.php:2316
1529
  msgid "You have no email fields"
1530
  msgstr ""
1531
 
1532
+ #: ../classes/class-ccf-form-manager.php:2317
1533
  msgid "No available fields"
1534
  msgstr ""
1535
 
1536
+ #: ../classes/class-ccf-form-manager.php:2318
1537
  msgid "You have no name fields"
1538
  msgstr ""
1539
 
1540
+ #: ../classes/class-ccf-form-manager.php:2319
1541
  msgid "You have no applicable fields"
1542
  msgstr ""
1543
 
1544
+ #: ../classes/class-ccf-form-manager.php:2320
1545
  msgid "Choose a Form Field"
1546
  msgstr ""
1547
 
1548
+ #: ../classes/class-ccf-form-manager.php:2321
1549
  msgid "Invalid date"
1550
  msgstr ""
1551
 
1552
+ #: ../classes/class-ccf-form-manager.php:2323
1553
  msgid "Field Label"
1554
  msgstr ""
1555
 
1556
+ #: ../classes/class-ccf-form-manager.php:2325
1557
  #: ../classes/class-ccf-form-renderer.php:182
1558
  msgid "This form is paused right now. Check back later!"
1559
  msgstr ""
1560
 
1561
+ #: ../classes/class-ccf-form-manager.php:2327
1562
  msgid "Choose a Post Field"
1563
  msgstr ""
1564
 
1565
+ #: ../classes/class-ccf-form-manager.php:2330
1566
  msgid "Post Title"
1567
  msgstr ""
1568
 
1569
+ #: ../classes/class-ccf-form-manager.php:2331
1570
  msgid "Post Content"
1571
  msgstr ""
1572
 
1573
+ #: ../classes/class-ccf-form-manager.php:2332
1574
  msgid "Post Excerpt"
1575
  msgstr ""
1576
 
1577
+ #: ../classes/class-ccf-form-manager.php:2333
1578
  msgid "Post Date"
1579
  msgstr ""
1580
 
1581
+ #: ../classes/class-ccf-form-manager.php:2336
1582
  msgid "Post Tags"
1583
  msgstr ""
1584
 
1585
+ #: ../classes/class-ccf-form-manager.php:2337
1586
  msgid "Custom Field"
1587
  msgstr ""
1588
 
readme.txt CHANGED
@@ -60,6 +60,11 @@ For full documentation, questions, feature requests, and support concerning the
60
 
61
  == Changelog ==
62
 
 
 
 
 
 
63
  = 7.7 =
64
  * New CAPTCHA option
65
  * Fix "0" choice input bug
60
 
61
  == Changelog ==
62
 
63
+ = 7.8 =
64
+ * Hide form title setting
65
+ * Reply to notification fields
66
+ * Activate form notifications by default
67
+
68
  = 7.7 =
69
  * New CAPTCHA option
70
  * Fix "0" choice input bug