Custom Contact Forms - Version 6.4.6

Version Description

  • Add error modal text for HTTP 501 error code
Download this release

Release Info

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

Code changes from version 6.4.5 to 6.4.6

build/js/form-manager.js CHANGED
@@ -1958,7 +1958,13 @@
1958
  if ( allReqsMet ) {
1959
 
1960
  SELF.model.save( {}, { context: 'edit' }).error( function( jqXHR, textStatus, errorThrown ) {
1961
- wp.ccf.errorModal.show();
 
 
 
 
 
 
1962
  }).done( function( response ) {
1963
  if (ccfSettings.single && ! ccfSettings.postId ) {
1964
  window.location = ccfSettings.adminUrl + 'post.php?post=' + SELF.model.get( 'ID' ) + '&action=edit#ccf-form/' + SELF.model.get( 'ID' );
@@ -2188,8 +2194,14 @@
2188
 
2189
  var fetch = this.collection.fetch( { data: { page: ( page ) } });
2190
 
2191
- fetch.error( function() {
2192
- wp.ccf.errorModal.show();
 
 
 
 
 
 
2193
  });
2194
 
2195
  fetch.done( function() {
@@ -2442,8 +2454,14 @@
2442
 
2443
  var fetch = this.collection.fetch( { data: { page: ( page ) } } );
2444
 
2445
- fetch.error( function() {
2446
- wp.ccf.errorModal.show();
 
 
 
 
 
 
2447
  });
2448
 
2449
  fetch.done( function() {
@@ -2528,8 +2546,16 @@
2528
  }
2529
  },
2530
 
2531
- render: function() {
2532
- this.el.innerHTML = this.template();
 
 
 
 
 
 
 
 
2533
 
2534
  return this;
2535
  }
1958
  if ( allReqsMet ) {
1959
 
1960
  SELF.model.save( {}, { context: 'edit' }).error( function( jqXHR, textStatus, errorThrown ) {
1961
+ var messageType = 'sync';
1962
+
1963
+ if ( parseInt( errorThrown.status ) === 501 || parseInt( errorThrown.status ) === 505 ) {
1964
+ messageType = 'method';
1965
+ }
1966
+
1967
+ wp.ccf.errorModal.render( messageType ).show();
1968
  }).done( function( response ) {
1969
  if (ccfSettings.single && ! ccfSettings.postId ) {
1970
  window.location = ccfSettings.adminUrl + 'post.php?post=' + SELF.model.get( 'ID' ) + '&action=edit#ccf-form/' + SELF.model.get( 'ID' );
2194
 
2195
  var fetch = this.collection.fetch( { data: { page: ( page ) } });
2196
 
2197
+ fetch.error( function( jqXHR, textStatus, errorThrown ) {
2198
+ var messageType = 'sync';
2199
+
2200
+ if ( parseInt( errorThrown.status ) === 501 || parseInt( errorThrown.status ) === 505 ) {
2201
+ messageType = 'method';
2202
+ }
2203
+
2204
+ wp.ccf.errorModal.render( messageType ).show();
2205
  });
2206
 
2207
  fetch.done( function() {
2454
 
2455
  var fetch = this.collection.fetch( { data: { page: ( page ) } } );
2456
 
2457
+ fetch.error( function( jqXHR, textStatus, errorThrown ) {
2458
+ var messageType = 'sync';
2459
+
2460
+ if ( parseInt( errorThrown.status ) === 501 || parseInt( errorThrown.status ) === 505 ) {
2461
+ messageType = 'method';
2462
+ }
2463
+
2464
+ wp.ccf.errorModal.render( messageType ).show();
2465
  });
2466
 
2467
  fetch.done( function() {
2546
  }
2547
  },
2548
 
2549
+ render: function( messageType ) {
2550
+ var context = {
2551
+ messageType: ''
2552
+ };
2553
+
2554
+ if ( messageType ) {
2555
+ context.messageType = messageType;
2556
+ }
2557
+
2558
+ this.el.innerHTML = this.template( context );
2559
 
2560
  return this;
2561
  }
build/js/form-manager.min.js CHANGED
@@ -1,2 +1,2 @@
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(e),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){var t="",i="";if(e.hour&&e.minute&&e["am-pm"]&&(t+=e.hour+":"+e.minute+" "+e["am-pm"]),e.date&&(t+=" "+e.date),!t)return"-";var s=moment(t);return s.isValid()?(e.hour&&e.minute&&e["am-pm"]&&(i+=s.format("h:mm a")),e.date&&(i&&(i+=" "),i+=s.format("M/D/YYYY")),i):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 c={el:this.$el.find(".ccf-"+s),parent:this};l&&i.extend(c,l),this.renderedSubViews[s]&&this.renderedSubViews[s].destroy&&this.renderedSubViews[s].destroy(),(t||!this.renderedSubViews[s])&&(this.renderedSubViews[s]=new this.subViews[s](c)),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,s){"use strict";wp.ccf.models=wp.ccf.models||{},wp.ccf.models.Fields=wp.ccf.models.Fields||{};var c=function(e,i,l){return"object"!=typeof i&&""===i&&(i=""),t.Model.prototype.set.call(this,e,i,l)},r=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(/&#039;/g,"'"),this.set(t,l))}return this};wp.ccf.models.FieldChoice=wp.ccf.models.FieldChoice||t.Model.extend({defaults:{label:"",value:"",selected:!1},decode:function(){return r.call(this,[])},set:c}),wp.ccf.models.Form=wp.ccf.models.Form||wp.api.models.Post.extend({urlRoot:s.root+"/ccf/forms",set:c,initialize:function(){this.on("sync",this.decode,this)},defaults:function(){var e={fields:new wp.ccf.collections.Fields,type:"ccf_form",status:"publish",description:"",buttonText:"Submit Form",completionActionType:"text",completionRedirectUrl:"",completionMessage:"",sendEmailNotifications:!1,emailNotificationAddresses:l.adminEmail,emailNotificationFromType:"default",emailNotificationFromAddress:"",emailNotificationFromField:""};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"),r.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;if(e.fields){var l=t.get("fields");if(l&&l.length>0){for(var s=0;e.fields.length>s;s++){var c=e.fields[s],r=l.findWhere({slug:c.slug});if(r){if(c.choices!==void 0){var n=t.get("choices");if(n&&n.length>0)for(var o=0;c.choices>o;o++){var a=n.at(o);a.set(c.choices[o]),a.decode()}delete e.fields[s].choices}r.set(c),r.decode()}}delete e.fields}else{var d=[];i.each(e.fields,function(e){var t=new wp.ccf.models.Fields[e.type](e);t.decode(),d.push(t)}),e.fields=new wp.ccf.collections.Fields(d,{formId:e.ID})}}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.author&&(e.author=e.author.toJSON()),e}}),wp.ccf.models.Submission=wp.api.models.Submission||wp.api.models.Post.extend({idAttribute:"ID",defaults:{ID:null,data:{}}}),wp.ccf.models.Field=wp.api.models.Field||wp.api.models.Post.extend({idAttribute:"ID",defaults:{ID:null},set:c,required:function(){return["slug"]},decode:function(){return r.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}}),wp.ccf.models.StandardField=wp.ccf.models.StandardField||wp.ccf.models.Field.extend({idAttribute:"ID",defaults:function(){var e={label:"Field Label",value:"",placeholder:"",slug:"",type:"",required:!1,className:"",description:""};return i.defaults(e,this.constructor.__super__.defaults)}}),wp.ccf.models.Fields["single-line-text"]=wp.ccf.models.Fields["single-line-text"]||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"single-line-text"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.file=wp.ccf.models.Fields.file||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"file",fileExtensions:"",maxFileSize:l.maxFileSize};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields["paragraph-text"]=wp.ccf.models.Fields["paragraph-text"]||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"paragraph-text"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.hidden=wp.ccf.models.Fields.hidden||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"hidden"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.email=wp.ccf.models.Fields.email||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"email",emailConfirmation:!1};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.website=wp.ccf.models.Fields.website||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"website",placeholder:"http://"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.phone=wp.ccf.models.Fields.phone||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"phone",phoneFormat:"us"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.date=wp.ccf.models.Fields.date||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"date",showDate:!0,showTime:!0};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.name=wp.ccf.models.Fields.name||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"name"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.recaptcha=wp.ccf.models.Fields.recaptcha||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"recaptcha",siteKey:"",secretKey:""};return i.defaults(e,this.constructor.__super__.defaults())},required:function(){return["siteKey","secretKey"]},isImmutable:!0}),wp.ccf.models.Fields.address=wp.ccf.models.Fields.address||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"address",addressType:"us"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields["section-header"]=wp.ccf.models.Fields["section-header"]||wp.ccf.models.Field.extend({defaults:function(){var e={type:"section-header",slug:"",heading:"",subheading:"",className:""};return i.defaults(e,this.constructor.__super__.defaults)},required:function(){return[]},isImmutable:!0}),wp.ccf.models.Fields.html=wp.ccf.models.Fields.html||wp.ccf.models.Field.extend({defaults:function(){var e={type:"html",slug:"",html:"",className:""};return i.defaults(e,this.constructor.__super__.defaults)},required:function(){return[]},isImmutable:!0}),wp.ccf.models.ChoiceableField=wp.ccf.models.ChoiceableField||wp.ccf.models.StandardField.extend({defaults:function(){var e={choices:new wp.ccf.collections.FieldChoices};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(e){if("object"==typeof e&&e.choices){var t=[];i.each(e.choices,function(e){var i=new wp.ccf.models.FieldChoice(e);i.decode(),t.push(i)}),this.set("choices",new wp.ccf.collections.FieldChoices(t))}}}),wp.ccf.models.Fields.radio=wp.ccf.models.Fields.radio||wp.ccf.models.ChoiceableField.extend({defaults:function(){var e={type:"radio"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.checkboxes=wp.ccf.models.Fields.checkboxes||wp.ccf.models.ChoiceableField.extend({defaults:function(){var e={type:"checkboxes"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.dropdown=wp.ccf.models.Fields.dropdown||wp.ccf.models.ChoiceableField.extend({defaults:function(){var e={type:"dropdown"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}})}(jQuery,Backbone,_,ccfSettings,WP_API_Settings),function(e,t,i){"use strict";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:WP_API_Settings.root+"/ccf/forms",formsFetching:{},initialize:function(){this.constructor.__super__.initialize(),this.formsFetching={}},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 WP_API_Settings.root+"/ccf/forms/"+this.formId+"/fields"},initialize:function(e,t){t&&t.formId&&(this.formId=t.formId)}}),wp.ccf.collections.Submissions=wp.ccf.collections.Submissions||wp.api.collections.Posts.extend({model:wp.ccf.models.Submission,url:function(){return WP_API_Settings.root+"/ccf/forms/"+this.formId+"/submissions"},initialize:function(e,t){this.constructor.__super__.initialize.apply(this,arguments),t&&t.formId&&(this.formId=t.formId)}}),wp.ccf.collections.FieldChoices=wp.ccf.collections.FieldChoices||t.Collection.extend({model:wp.ccf.models.FieldChoice})}(jQuery,Backbone,_,ccfSettings),function(e,t,i,l){"use strict";wp.ccf.views=wp.ccf.views||{},wp.ccf.views.Fields=wp.ccf.views.Fields||{},wp.ccf.views.FieldChoice=t.View.extend({template:wp.ccf.utils.template("ccf-field-choice-template"),className:"choice",events:{"click .add":"triggerAdd","click .delete":"triggerDelete","blur input":"saveChoice",saveChoice:"saveChoice",sorted:"triggerUpdateSort"},initialize:function(e){this.field=e.field},destroy:function(){wp.ccf.dispatcher.off("mainViewChange",this.saveChoice),this.unbind()},triggerUpdateSort:function(e,t){this.field.get("choices").remove(this.model,{silent:!0}),this.field.get("choices").add(this.model,{at:t,silent:!0})},saveChoice:function(){if(""!==this.el.innerHTML){var e=this.el.querySelectorAll(".choice-label")[0].value,t=this.el.querySelectorAll(".choice-value")[0].value;this.model.set("label",e),this.model.set("value",t);var i=this.el.querySelectorAll(".choice-selected")[0],l=i.checked?!0:!1;return this.model.set("selected",l),this}},render:function(){var e={};return this.model&&(e.choice=this.model.toJSON()),this.el.innerHTML=this.template(e),wp.ccf.dispatcher.on("mainViewChange",this.saveChoice,this),this},triggerAdd:function(){this.field.get("choices").add(new wp.ccf.models.FieldChoice)},triggerDelete:function(){var e=this.field.get("choices");if(e.length>1)e.remove(this.model),this.destroy(),this.remove();else{for(var t=this.el.querySelectorAll(".choice-label, .choice-value"),i=this.el.querySelectorAll(".choice-selected"),l=0;t.length>l;l++)t[l].value="";i[0].checked=!1}}}),wp.ccf.views.FieldBase=wp.ccf.views.FieldBase||t.View.extend({events:{"blur input":"saveField","blur input.field-slug":"checkSlug","blur textarea":"saveField","change select":"saveField",'change input[type="checkbox"]':"saveField"},checkSlug:function(){var e=this.el.querySelectorAll(".field-slug");if(e.length>0){var t=e[0],i=!1;t.parentNode.className=t.value&&!t.value.match(/^[a-zA-Z0-9\-_]+$/)?t.parentNode.className.replace(/ field-error/i,"")+" field-error":t.parentNode.className.replace(/ field-error/i,""),this.collection.length>0&&""!==t.value?(this.collection.each(function(e){e!==this.model&&t.value===e.get("slug")&&(i=!0)},this),t.parentNode.className=i?t.parentNode.className.replace(/ field-duplicate-slug/i,"")+" field-duplicate-slug":t.parentNode.className.replace(/ field-duplicate-slug/i,"")):t.parentNode.className=t.parentNode.className.replace(/ field-duplicate-slug/i,"")}},destroy:function(){this.unbind()},render:function(){return this.el.innerHTML=this.template({field:this.model.toJSON()}),this.checkSlug(),this}}),wp.ccf.views.Fields["single-line-text"]=wp.ccf.views.Fields["single-line-text"]||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-single-line-text-template"),initialize:function(){},saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("placeholder",this.el.querySelectorAll(".field-placeholder")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this):void 0}}),wp.ccf.views.Fields.file=wp.ccf.views.Fields.file||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-file-template"),initialize:function(){},saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this.model.set("fileExtensions",this.el.querySelectorAll(".field-file-extensions")[0].value),this.model.set("maxFileSize",this.el.querySelectorAll(".field-max-file-size")[0].value),this):void 0}}),wp.ccf.views.Fields.recaptcha=wp.ccf.views.Fields.recaptcha||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-recaptcha-template"),initialize:function(){},saveField:function(){return""!==this.el.innerHTML?(this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("siteKey",this.el.querySelectorAll(".field-site-key")[0].value),this.model.set("secretKey",this.el.querySelectorAll(".field-secret-key")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this):void 0}}),wp.ccf.views.Fields["section-header"]=wp.ccf.views.Fields["section-header"]||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-section-header-template"),initialize:function(){},saveField:function(){return""!==this.el.innerHTML?(this.model.set("heading",this.el.querySelectorAll(".field-heading")[0].value),this.model.set("subheading",this.el.querySelectorAll(".field-subheading")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this):void 0}}),wp.ccf.views.Fields.html=wp.ccf.views.Fields.html||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-html-template"),initialize:function(){},saveField:function(){return""!==this.el.innerHTML?(this.model.set("html",this.el.querySelectorAll(".field-html")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this):void 0}}),wp.ccf.views.Fields["paragraph-text"]=wp.ccf.views.Fields["paragraph-text"]||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-paragraph-text-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("placeholder",this.el.querySelectorAll(".field-placeholder")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this):void 0}}),wp.ccf.views.Fields.hidden=wp.ccf.views.Fields.hidden||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-hidden-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this):void 0}}),wp.ccf.views.Fields.date=wp.ccf.views.Fields.date||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-date-template"),saveField:function(){if(""!==this.el.innerHTML){this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value);var e=this.el.querySelectorAll(".field-value");e.length>0&&this.model.set("value",e[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("showDate",this.el.querySelectorAll(".field-show-date")[0].checked?!0:!1);var t=this.model.get("showTime"),i=this.el.querySelectorAll(".field-show-time")[0].checked?!0:!1;return this.model.set("showTime",i),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),i!=t&&this.render(),this}}}),wp.ccf.views.Fields.name=wp.ccf.views.Fields.name||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-name-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this):void 0}}),wp.ccf.views.Fields.website=wp.ccf.views.Fields.website||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-website-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("placeholder",this.el.querySelectorAll(".field-placeholder")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this):void 0}}),wp.ccf.views.Fields.phone=wp.ccf.views.Fields.phone||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-phone-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("placeholder",this.el.querySelectorAll(".field-placeholder")[0].value),this.model.set("phoneFormat",this.el.querySelectorAll(".field-phone-format")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this):void 0}}),wp.ccf.views.Fields.address=wp.ccf.views.Fields.address||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-address-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("addressType",this.el.querySelectorAll(".field-address-type")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this):void 0}}),wp.ccf.views.Fields.email=wp.ccf.views.Fields.email||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-email-template"),saveField:function(){if(""!==this.el.innerHTML){this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value);var e=this.el.querySelectorAll(".field-value");e.length&&this.model.set("value",e[0].value);var t=this.el.querySelectorAll(".field-placeholder");t.length&&this.model.set("placeholder",t[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1);var i=1==this.el.querySelectorAll(".field-email-confirmation")[0].value?!0:!1,l=this.model.get("emailConfirmation");return this.model.set("emailConfirmation",i),l!=i&&this.render(),this}}}),wp.ccf.views.ChoiceableField=wp.ccf.views.ChoiceableField||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-dropdown-template"),initialize:function(){var e=this.model.get("choices");this.listenTo(e,"add",this.addChoice)},addChoice:function(e){var t=new wp.ccf.views.FieldChoice({model:e,field:this.model}).render(),i=this.el.querySelectorAll(".repeatable-choices")[0];i.appendChild(t.el)},saveField:function(){if(""!==this.el.innerHTML){this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1);var t=this.el.querySelectorAll(".repeatable-choices")[0].querySelectorAll(".choice");return i.each(t,function(t){e(t).trigger("saveChoice")}),this}},render:function(){var t=this;t.el.innerHTML=t.template({field:t.model.toJSON()}),t.checkSlug();var i=t.model.get("choices"),l=this.el.querySelectorAll(".repeatable-choices")[0];if(i.length>=1)i.each(function(e){var i=new wp.ccf.views.FieldChoice({model:e,field:t.model}).render();l.appendChild(i.el)});else{var s=new wp.ccf.models.FieldChoice;i.add(s)}return l=this.el.querySelectorAll(".repeatable-choices")[0],e(l).sortable({handle:".move",axis:"y",stop:function(e,t){t.item.trigger("sorted",t.item.index())}}),t}}),wp.ccf.views.Fields.dropdown=wp.ccf.views.Fields.dropdown||wp.ccf.views.ChoiceableField.extend({template:wp.ccf.utils.template("ccf-dropdown-template"),events:function(){return this.constructor.__super__.events}}),wp.ccf.views.Fields.radio=wp.ccf.views.Fields.radio||wp.ccf.views.ChoiceableField.extend({template:wp.ccf.utils.template("ccf-radio-template"),events:function(){return this.constructor.__super__.events}}),wp.ccf.views.Fields.checkboxes=wp.ccf.views.Fields.checkboxes||wp.ccf.views.ChoiceableField.extend({template:wp.ccf.utils.template("ccf-checkboxes-template"),events:function(){return this.constructor.__super__.events}}),wp.ccf.views.FieldSidebar=wp.ccf.views.FieldSidebar||t.View.extend({initialize:function(e){this.currentFieldView=null,this.form=e.form},save:function(e){this.currentFieldView&&""!==this.currentFieldView.el.innerHTML&&this.currentFieldView.saveField(),e&&e instanceof Object&&e.resolve()},fieldRemoved:function(){this.currentFieldView&&(this.form.get("fields").get(this.currentFieldView.model)||this.render())},destroy:function(){wp.ccf.dispatcher.off("saveField",this.save),wp.ccf.dispatcher.off("mainViewChange",this.save),this.unbind()},render:function(e){var t={};if(e){var i=e.get("type");this.currentFieldView&&(this.currentFieldView.saveField(),this.currentFieldView.destroy&&this.currentFieldView.destroy()),this.currentFieldView=new wp.ccf.views.Fields[i]({model:e,collection:this.form.get("fields")}),this.currentFieldView.render(),this.el.innerHTML="",this.el.appendChild(this.currentFieldView.el);var l=this.form.get("fields");this.listenTo(l,"remove",this.fieldRemoved)}else{var s=wp.ccf.utils.template("ccf-empty-field-template");this.el.innerHTML=s(t)}return wp.ccf.dispatcher.on("saveField",this.save,this),wp.ccf.dispatcher.on("mainViewChange",this.save,this),this}}),wp.ccf.views.FieldRowPlaceholder=wp.ccf.views.FieldRowPlaceholder||t.View.extend({template:wp.ccf.utils.template("ccf-field-row-template"),tagName:"div",className:"field",initialize:function(e){this.type=e.type},render:function(){return this.el.innerHTML=this.template({label:l.allLabels[this.type]}),this.el.setAttribute("data-field-type",this.type),this.el.className+=" "+this.type,this}}),wp.ccf.views.FieldRow=wp.ccf.views.FieldRow||t.View.extend({template:wp.ccf.utils.template("ccf-field-row-template"),tagName:"div",className:"field",events:{"click .delete":"triggerDelete","click h4":"triggerEdit",sorted:"triggerUpdateSort"},initialize:function(e){i.bindAll(this,"triggerDelete"),this.form=e.form,this.listenTo(this.model,"change",this.handleChange,this),this.listenTo(this.model,"requirementsNotMet",this.requirementsNotMet,this),this.listenTo(this.model,"requirementsMet",this.requirementsMet,this),this.listenTo(this.model,"duplicateSlug",this.duplicateSlug,this),this.model.attributes.choices&&this.listenTo(this.model.attributes.choices,"change",this.handleChange,this)},duplicateSlug:function(){this.requirementsMet(),this.el.className+=" field-duplicate-slug"},requirementsNotMet:function(){this.requirementsMet(),this.el.className+=" field-incomplete"},requirementsMet:function(){this.el.className=this.el.className.replace(/(field-incomplete|field-duplicate-slug)/i,"")},triggerUpdateSort:function(e,t){this.form.get("fields").remove(this.model),this.form.get("fields").add(this.model,{at:t})},handleChange:function(){this.render()},triggerDelete:function(e){e.stopPropagation(),this.form.get("fields").remove(this.model),this.undelegateEvents(),this.remove()},triggerEdit:function(){var e=this.el.parentNode.querySelectorAll(".ccf-editing");i.each(e,function(e){e.className=e.className.replace(/ccf-editing/i,"")}),this.el.className=this.el.className.replace(/ccf-editing/i,"")+" ccf-editing",wp.ccf.dispatcher.trigger("openEditField",this.model)},render:function(e){this.el.innerHTML=this.template({label:l.allLabels[this.model.get("type")]}),this.el.setAttribute("data-field-type",this.model.get("type"));var t=RegExp(" "+this.model.get("type"),"i");this.el.className=this.el.className.replace(t,"")+" "+this.model.get("type"),e&&(this.el.className=this.el.className.replace(/ instantiated/i,"")+" instantiated");var i=document.getElementById("ccf-"+this.model.get("type")+"-preview-template");if(i){var s=this.el.querySelectorAll(".preview")[0];s.style.display="block",s.innerHTML=wp.ccf.utils.template("ccf-"+this.model.get("type")+"-preview-template")({field:this.model.toJSON()})}return this}}),wp.ccf.views.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-send-email-notifications":"toggleNotificationFields"},initialize:function(e){this.model=e.form},destroy:function(){wp.ccf.dispatcher.off("saveFormSettings",this.save),wp.ccf.dispatcher.off("mainViewChange",this.save)},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")},save:function(e){if(""!==this.el.innerHTML){var t=this.el.querySelectorAll(".form-title")[0].value;this.model.set("title",t);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-completion-message")[0].value;this.model.set("completionMessage",s);var c=this.el.querySelectorAll(".form-completion-redirect-url")[0].value;this.model.set("completionRedirectUrl",c);var r=this.el.querySelectorAll(".form-completion-action-type")[0].value;this.model.set("completionActionType",r),e!==void 0&&e.promise!==void 0&&e.resolve()}},render:function(){var e={form:this.model.toJSON()};return this.el.innerHTML=this.template(e),this.toggleCompletionFields(),wp.ccf.dispatcher.on("saveFormSettings",this.save,this),wp.ccf.dispatcher.on("mainViewChange",this.save,this),this}}),wp.ccf.views.FormNotifications=wp.ccf.views.FormNotifications||t.View.extend({template:wp.ccf.utils.template("ccf-form-notifications-template"),events:{"blur input":"save","change select":"save","change select.form-send-email-notifications":"toggleNotificationFields","change select.form-email-notification-from-type":"toggleNotificationFields"},initialize:function(e){this.model=e.form},destroy:function(){wp.ccf.dispatcher.off("saveFormNotifications",this.save),wp.ccf.dispatcher.off("mainViewChange",this.save),this.undelegateEvents(),this.unbind()
2
- },updateFromAddressFieldField:function(){var e=this.el.querySelectorAll(".form-email-notification-from-field")[0];e.innerHTML="",e.disabled=!1;var t=this.model.get("fields"),i=0,s=this.model.get("emailNotificationFromField");if(t.length>=1&&t.each(function(t){if("email"===t.get("type")){var l=document.createElement("option");l.innerHTML=t.get("slug"),l.value=t.get("slug"),t.get("slug")===s&&(l.selected=!0),e.appendChild(l),i++}}),0===i){var c=document.createElement("option");c.innerHTML=l.noEmailFields,e.appendChild(c),e.disabled=!0}},toggleNotificationFields:function(){var e,t=this.el.querySelectorAll(".form-send-email-notifications")[0].value,i=this.el.querySelectorAll(".email-notification-setting"),l=this.el.querySelectorAll(".email-notification-from-address")[0],s=this.el.querySelectorAll(".email-notification-from-field")[0],c=this.el.querySelectorAll(".form-email-notification-from-type")[0];if(parseInt(t)){for(e=0;i.length>e;e++)i[e].style.display="block";l.style.display="none",s.style.display="none","custom"===c.value?l.style.display="block":"field"===c.value&&(s.style.display="block")}else{for(e=0;i.length>e;e++)i[e].style.display="none";l.style.display="none",s.style.display="none"}},save:function(e){if(""!==this.el.innerHTML){var t=this.el.querySelectorAll(".form-send-email-notifications")[0].value;this.model.set("sendEmailNotifications",parseInt(t)?!0:!1);var i=this.el.querySelectorAll(".form-email-notification-addresses")[0].value;this.model.set("emailNotificationAddresses",i);var l=this.el.querySelectorAll(".form-email-notification-from-type")[0].value;this.model.set("emailNotificationFromType",l);var s=this.el.querySelectorAll(".form-email-notification-from-address")[0].value;this.model.set("emailNotificationFromAddress",s);var c=this.el.querySelectorAll(".form-email-notification-from-field")[0].value;this.model.set("emailNotificationFromField",c),e!==void 0&&e.promise!==void 0&&e.resolve()}},render:function(){var e={form:this.model.toJSON()},t=this.model.get("fields");return this.el.innerHTML=this.template(e),this.toggleNotificationFields(),this.updateFromAddressFieldField(),wp.ccf.dispatcher.on("saveFormNotifications",this.save,this),wp.ccf.dispatcher.on("mainViewChange",this.save,this),this.listenTo(t,"add",this.updateFromAddressFieldField,this),this.listenTo(t,"remove",this.updateFromAddressFieldField,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,"form-notifications":wp.ccf.views.FormNotifications},events:{"click .save-button":"sync","click h2":"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()},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,""))})},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(),c=e.Deferred(),r=e.Deferred();wp.ccf.dispatcher.trigger("saveFormSettings",s),wp.ccf.dispatcher.trigger("saveFormNotifications",r),wp.ccf.dispatcher.trigger("saveField",c),e.when(s,c,r).then(function(){var e=t.model.get("fields"),s=!0,c={};e.each(function(e){var t=e.get("slug");e.hasRequiredAttributes()?t&&!t.match(/^[a-zA-Z0-9\-_]+$/)?(s=!1,e.trigger("requirementsNotMet")):c[e.get("slug")]!==void 0?(s=!1,e.trigger("duplicateSlug"),c[e.get("slug")].trigger("duplicateSlug")):e.trigger("requirementsMet"):(s=!1,e.trigger("requirementsNotMet")),e.get("slug")&&(c[e.get("slug")]=e)}),s?t.model.save({},{context:"edit"}).error(function(){wp.ccf.errorModal.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 c=parseInt(s[1]);c>=t&&(t=c+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 c={labels:l.fieldLabels,form:s.model.toJSON()};window.form=s.model,s.el.innerHTML=this.template(c);var r=s.el.querySelectorAll(".fields")[0];i.each(l.fieldLabels,function(e,t){r.appendChild(new wp.ccf.views.FieldRowPlaceholder({type:t}).render().el)});var n=s.el.querySelectorAll(".structure-fields")[0];i.each(l.structureFieldLabels,function(e,t){n.appendChild(new wp.ccf.views.FieldRowPlaceholder({type:t}).render().el)});var o=s.el.querySelectorAll(".special-fields")[0];i.each(l.specialFieldLabels,function(e,t){o.appendChild(new wp.ccf.views.FieldRowPlaceholder({type:t}).render().el)}),e(s.el.querySelectorAll(".left-sidebar")[0].querySelectorAll(".field")).draggable({cursor:"move",zIndex:160001,scroll:!1,containment:".ccf-form-pane",appendTo:".ccf-main-modal",snap:!0,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:i.width(),height:i.height()})}});var a=s.model.get("fields"),d=s.el.querySelectorAll(".form-content")[0];return 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",handle:"h4",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 c=new wp.ccf.models.Fields[i](l),r=s.model.get("fields");r.add(c),new wp.ccf.views.FieldRow({model:c,el:t.item,form:s.model}).render(!0),t.item.attr("style","")}t.item.trigger("sorted",t.item.index())}}),s.initRenderSubViews(!0,!0,{form:s.model}),s.enableDisableInsert(),s}},wp.ccf.mixins.subViewable)),wp.ccf.views.ExistingFormTableRow=wp.ccf.views.ExistingFormTableRow||t.View.extend({tagName:"tr",template:wp.ccf.utils.template("ccf-existing-form-table-row-template"),events:{"click .edit":"triggerMainViewChange","click .delete":"triggerDelete","click .insert-form-button":"insertForm"},initialize:function(e){this.parent=e.parent},insertForm:function(){wp.ccf.utils.insertFormShortcode(this.model),wp.ccf.toggle()},triggerMainViewChange:function(){wp.ccf.switchToForm(this.model)},triggerDelete:function(){var e,t=this,i=t.parent.collection.state.currentPage;t.model.destroy().done(function(){e=i,e===t.parent.collection.state.totalPages&&e-1===(t.parent.collection.state.totalObjects-1)/l.postsPerPage&&e--,t.parent.showPage(e).done(function(){t.parent.renderPagination()})})},render:function(){return this.$el.html(this.template({form:this.model.toJSON(),utils:{getPrettyPostDate:wp.ccf.utils.getPrettyPostDate}})),this}}),wp.ccf.views.EmptyFormTableRow=wp.ccf.views.EmptyFormTableRow||t.View.extend({tagName:"tr",template:wp.ccf.utils.template("ccf-empty-form-table-row-template"),render:function(){return this.$el.html(this.template()),this}}),wp.ccf.views.ExistingFormTable=wp.ccf.views.ExistingFormTable||t.View.extend({template:wp.ccf.utils.template("ccf-existing-form-table-template"),initialize:function(){this.parent=arguments.parent,this.collection=new wp.ccf.collections.Forms,wp.ccf.dispatcher.on("changeFormTablePage",this.showPage,this),wp.ccf.dispatcher.on("saveFormComplete",this.render,this)},showPage:function(e){var t=this,i=this.collection.fetch({data:{page:e}});return i.error(function(){wp.ccf.errorModal.show()}),i.done(function(){var e=t.el.querySelectorAll(".rows")[0],i=document.createElement("tbody");i.className="rows",t.collection.length>=1?t.collection.each(function(e){var l=new wp.ccf.views.ExistingFormTableRow({model:e,parent:t}).render();i.appendChild(l.el)},t):i.appendChild((new wp.ccf.views.EmptyFormTableRow).render().el),e.parentNode.replaceChild(i,e)}),i},renderPagination:function(){var e=this.el.querySelectorAll(".ccf-pagination")[0];e.innerHTML="",this.collection.state.totalPages>1&&e.appendChild(new wp.ccf.views.Pagination({parent:this}).render(this.collection.state.totalPages,this.collection.state.currentPage).el)},render:function(){var e=this;return this.el.innerHTML=this.template(),this.el.querySelectorAll(".ccf-pagination")[0],this.showPage(1).done(function(){e.renderPagination()}),this}}),wp.ccf.views.ExistingFormPane=wp.ccf.views.ExistingFormPane||t.View.extend(i.defaults({template:wp.ccf.utils.template("ccf-existing-form-pane-template"),subViews:{"existing-form-table":wp.ccf.views.ExistingFormTable},render:function(){return this.rendered?this:(this.rendered=!0,this.el.innerHTML=this.template(),this.initRenderSubViews(!0),this)}},wp.ccf.mixins.subViewable)),wp.ccf.views.MainModal=wp.ccf.views.MainModal||t.View.extend(i.defaults({tagName:"div",className:"ccf-main-modal",template:wp.ccf.utils.template("ccf-main-modal-template"),events:{"click .close-icon":"hide","click .main-menu a":"menuClick"},subViews:{"form-pane":wp.ccf.views.FormPane},initialize:function(){l.single||(this.subViews["existing-form-pane"]=wp.ccf.views.ExistingFormPane),wp.ccf.dispatcher.on("mainViewChange",this.toggleView,this)},toggleView:function(e){this.showView(e,wp.ccf.currentForm);var t=e;"form-pane"===e&&wp.ccf.currentForm&&(t="existing-form-pane");var l=this.el.querySelectorAll(".menu-item");i.each(l,function(e){var i=e.getAttribute("data-view");e.className=i===t?e.className.replace("selected","")+" selected":e.className.replace("selected","")})},menuClick:function(e){var t=e.target.getAttribute("data-view");"form-pane"===t&&(wp.ccf.currentForm=null),wp.ccf.dispatcher.trigger("mainViewChange",t),e.preventDefault()},render:function(e){return e=e||!1,this.overlay(),this.el.innerHTML=this.template({single:e}),this.initRenderSubViews(),this.showView("form-pane",wp.ccf.currentForm,!0),this},overlay:function(){return this.overlayEl===void 0&&(this.overlayEl=document.createElement("div"),this.overlayEl.className="ccf-main-modal-overlay",document.body.appendChild(this.overlayEl)),this.overlayEl},remove:function(){return document.body.removeChild(this.overlay()),this},show:function(){e(this.overlay()).show(),this.$el.show()},hide:function(){e(this.overlay()).hide(),this.$el.hide()}},wp.ccf.mixins.subViewable)),wp.ccf.views.SubmissionRow=wp.ccf.views.SubmissionRow||t.View.extend({tagName:"tr",template:wp.ccf.utils.template("ccf-submission-row-template"),events:{"click .view":"view","click .delete":"delete"},initialize:function(e){this.parent=e.parent},"delete":function(){var e,t=this,i=t.parent.collection.state.currentPage;t.model.destroy().done(function(){e=i,e===t.parent.collection.state.totalPages&&e-1===(t.parent.collection.state.totalObjects-1)/l.postsPerPage&&e--,t.parent.showPage(e).done(function(){t.parent.renderPagination()})})},view:function(e){var t=e.currentTarget.getAttribute("data-submission-id"),i=e.currentTarget.getAttribute("data-submission-date");tb_show(l.thickboxTitle+" - "+wp.ccf.utils.getPrettyPostDate(i),"#TB_inline?height=500&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(){wp.ccf.errorModal.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(){return this.el.innerHTML=this.template(),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,c=document.querySelectorAll(".ccf-open-form-manager")[0];if(!c)return!1;i.extend(this.dispatcher,t.Events),new wp.ccf.router,s.initErrorModal();var r=!1;if(l.single)if(r=!0,l.postId){var n=parseInt(l.postId);if(s.forms.formsFetching[n]===void 0){var o=new wp.ccf.models.Form({ID:n}),a=o.fetch();s.forms.formsFetching[n]=a,s._currentFormDeferred=a,a.done(function(){delete s.forms.formsFetching[n],s.forms.add(o),s.currentForm=o})}else s._currentFormDeferred=s.forms.formsFetching[n],s._currentFormDeferred.done(function(){s.currentForm=s.forms.findWhere({ID:n})});e.when(s._currentFormDeferred).then(function(){s._setupMainModal(!0),c.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-settings",i.setAttribute("data-icon","");var l=document.getElementById("show-settings-link");i.onclick=function(){l.click()},e.insertBefore(i,e.firstChild.nextSibling.nextSibling),wp.ccf.createSubmissionsTable(t)}})}else s._setupMainModal(!0),c.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)};c.addEventListener?c.addEventListener("click",d,!1):c.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(e),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){var t="",i="";if(e.hour&&e.minute&&e["am-pm"]&&(t+=e.hour+":"+e.minute+" "+e["am-pm"]),e.date&&(t+=" "+e.date),!t)return"-";var s=moment(t);return s.isValid()?(e.hour&&e.minute&&e["am-pm"]&&(i+=s.format("h:mm a")),e.date&&(i&&(i+=" "),i+=s.format("M/D/YYYY")),i):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 c={el:this.$el.find(".ccf-"+s),parent:this};l&&i.extend(c,l),this.renderedSubViews[s]&&this.renderedSubViews[s].destroy&&this.renderedSubViews[s].destroy(),(t||!this.renderedSubViews[s])&&(this.renderedSubViews[s]=new this.subViews[s](c)),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,s){"use strict";wp.ccf.models=wp.ccf.models||{},wp.ccf.models.Fields=wp.ccf.models.Fields||{};var c=function(e,i,l){return"object"!=typeof i&&""===i&&(i=""),t.Model.prototype.set.call(this,e,i,l)},r=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(/&#039;/g,"'"),this.set(t,l))}return this};wp.ccf.models.FieldChoice=wp.ccf.models.FieldChoice||t.Model.extend({defaults:{label:"",value:"",selected:!1},decode:function(){return r.call(this,[])},set:c}),wp.ccf.models.Form=wp.ccf.models.Form||wp.api.models.Post.extend({urlRoot:s.root+"/ccf/forms",set:c,initialize:function(){this.on("sync",this.decode,this)},defaults:function(){var e={fields:new wp.ccf.collections.Fields,type:"ccf_form",status:"publish",description:"",buttonText:"Submit Form",completionActionType:"text",completionRedirectUrl:"",completionMessage:"",sendEmailNotifications:!1,emailNotificationAddresses:l.adminEmail,emailNotificationFromType:"default",emailNotificationFromAddress:"",emailNotificationFromField:""};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"),r.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;if(e.fields){var l=t.get("fields");if(l&&l.length>0){for(var s=0;e.fields.length>s;s++){var c=e.fields[s],r=l.findWhere({slug:c.slug});if(r){if(c.choices!==void 0){var n=t.get("choices");if(n&&n.length>0)for(var o=0;c.choices>o;o++){var a=n.at(o);a.set(c.choices[o]),a.decode()}delete e.fields[s].choices}r.set(c),r.decode()}}delete e.fields}else{var d=[];i.each(e.fields,function(e){var t=new wp.ccf.models.Fields[e.type](e);t.decode(),d.push(t)}),e.fields=new wp.ccf.collections.Fields(d,{formId:e.ID})}}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.author&&(e.author=e.author.toJSON()),e}}),wp.ccf.models.Submission=wp.api.models.Submission||wp.api.models.Post.extend({idAttribute:"ID",defaults:{ID:null,data:{}}}),wp.ccf.models.Field=wp.api.models.Field||wp.api.models.Post.extend({idAttribute:"ID",defaults:{ID:null},set:c,required:function(){return["slug"]},decode:function(){return r.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}}),wp.ccf.models.StandardField=wp.ccf.models.StandardField||wp.ccf.models.Field.extend({idAttribute:"ID",defaults:function(){var e={label:"Field Label",value:"",placeholder:"",slug:"",type:"",required:!1,className:"",description:""};return i.defaults(e,this.constructor.__super__.defaults)}}),wp.ccf.models.Fields["single-line-text"]=wp.ccf.models.Fields["single-line-text"]||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"single-line-text"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.file=wp.ccf.models.Fields.file||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"file",fileExtensions:"",maxFileSize:l.maxFileSize};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields["paragraph-text"]=wp.ccf.models.Fields["paragraph-text"]||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"paragraph-text"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.hidden=wp.ccf.models.Fields.hidden||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"hidden"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.email=wp.ccf.models.Fields.email||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"email",emailConfirmation:!1};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.website=wp.ccf.models.Fields.website||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"website",placeholder:"http://"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.phone=wp.ccf.models.Fields.phone||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"phone",phoneFormat:"us"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.date=wp.ccf.models.Fields.date||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"date",showDate:!0,showTime:!0};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.name=wp.ccf.models.Fields.name||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"name"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields.recaptcha=wp.ccf.models.Fields.recaptcha||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"recaptcha",siteKey:"",secretKey:""};return i.defaults(e,this.constructor.__super__.defaults())},required:function(){return["siteKey","secretKey"]},isImmutable:!0}),wp.ccf.models.Fields.address=wp.ccf.models.Fields.address||wp.ccf.models.StandardField.extend({defaults:function(){var e={type:"address",addressType:"us"};return i.defaults(e,this.constructor.__super__.defaults())}}),wp.ccf.models.Fields["section-header"]=wp.ccf.models.Fields["section-header"]||wp.ccf.models.Field.extend({defaults:function(){var e={type:"section-header",slug:"",heading:"",subheading:"",className:""};return i.defaults(e,this.constructor.__super__.defaults)},required:function(){return[]},isImmutable:!0}),wp.ccf.models.Fields.html=wp.ccf.models.Fields.html||wp.ccf.models.Field.extend({defaults:function(){var e={type:"html",slug:"",html:"",className:""};return i.defaults(e,this.constructor.__super__.defaults)},required:function(){return[]},isImmutable:!0}),wp.ccf.models.ChoiceableField=wp.ccf.models.ChoiceableField||wp.ccf.models.StandardField.extend({defaults:function(){var e={choices:new wp.ccf.collections.FieldChoices};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(e){if("object"==typeof e&&e.choices){var t=[];i.each(e.choices,function(e){var i=new wp.ccf.models.FieldChoice(e);i.decode(),t.push(i)}),this.set("choices",new wp.ccf.collections.FieldChoices(t))}}}),wp.ccf.models.Fields.radio=wp.ccf.models.Fields.radio||wp.ccf.models.ChoiceableField.extend({defaults:function(){var e={type:"radio"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.checkboxes=wp.ccf.models.Fields.checkboxes||wp.ccf.models.ChoiceableField.extend({defaults:function(){var e={type:"checkboxes"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}}),wp.ccf.models.Fields.dropdown=wp.ccf.models.Fields.dropdown||wp.ccf.models.ChoiceableField.extend({defaults:function(){var e={type:"dropdown"};return i.defaults(e,this.constructor.__super__.defaults())},initialize:function(){return this.constructor.__super__.initialize.apply(this,arguments)}})}(jQuery,Backbone,_,ccfSettings,WP_API_Settings),function(e,t,i){"use strict";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:WP_API_Settings.root+"/ccf/forms",formsFetching:{},initialize:function(){this.constructor.__super__.initialize(),this.formsFetching={}},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 WP_API_Settings.root+"/ccf/forms/"+this.formId+"/fields"},initialize:function(e,t){t&&t.formId&&(this.formId=t.formId)}}),wp.ccf.collections.Submissions=wp.ccf.collections.Submissions||wp.api.collections.Posts.extend({model:wp.ccf.models.Submission,url:function(){return WP_API_Settings.root+"/ccf/forms/"+this.formId+"/submissions"},initialize:function(e,t){this.constructor.__super__.initialize.apply(this,arguments),t&&t.formId&&(this.formId=t.formId)}}),wp.ccf.collections.FieldChoices=wp.ccf.collections.FieldChoices||t.Collection.extend({model:wp.ccf.models.FieldChoice})}(jQuery,Backbone,_,ccfSettings),function(e,t,i,l){"use strict";wp.ccf.views=wp.ccf.views||{},wp.ccf.views.Fields=wp.ccf.views.Fields||{},wp.ccf.views.FieldChoice=t.View.extend({template:wp.ccf.utils.template("ccf-field-choice-template"),className:"choice",events:{"click .add":"triggerAdd","click .delete":"triggerDelete","blur input":"saveChoice",saveChoice:"saveChoice",sorted:"triggerUpdateSort"},initialize:function(e){this.field=e.field},destroy:function(){wp.ccf.dispatcher.off("mainViewChange",this.saveChoice),this.unbind()},triggerUpdateSort:function(e,t){this.field.get("choices").remove(this.model,{silent:!0}),this.field.get("choices").add(this.model,{at:t,silent:!0})},saveChoice:function(){if(""!==this.el.innerHTML){var e=this.el.querySelectorAll(".choice-label")[0].value,t=this.el.querySelectorAll(".choice-value")[0].value;this.model.set("label",e),this.model.set("value",t);var i=this.el.querySelectorAll(".choice-selected")[0],l=i.checked?!0:!1;return this.model.set("selected",l),this}},render:function(){var e={};return this.model&&(e.choice=this.model.toJSON()),this.el.innerHTML=this.template(e),wp.ccf.dispatcher.on("mainViewChange",this.saveChoice,this),this},triggerAdd:function(){this.field.get("choices").add(new wp.ccf.models.FieldChoice)},triggerDelete:function(){var e=this.field.get("choices");if(e.length>1)e.remove(this.model),this.destroy(),this.remove();else{for(var t=this.el.querySelectorAll(".choice-label, .choice-value"),i=this.el.querySelectorAll(".choice-selected"),l=0;t.length>l;l++)t[l].value="";i[0].checked=!1}}}),wp.ccf.views.FieldBase=wp.ccf.views.FieldBase||t.View.extend({events:{"blur input":"saveField","blur input.field-slug":"checkSlug","blur textarea":"saveField","change select":"saveField",'change input[type="checkbox"]':"saveField"},checkSlug:function(){var e=this.el.querySelectorAll(".field-slug");if(e.length>0){var t=e[0],i=!1;t.parentNode.className=t.value&&!t.value.match(/^[a-zA-Z0-9\-_]+$/)?t.parentNode.className.replace(/ field-error/i,"")+" field-error":t.parentNode.className.replace(/ field-error/i,""),this.collection.length>0&&""!==t.value?(this.collection.each(function(e){e!==this.model&&t.value===e.get("slug")&&(i=!0)},this),t.parentNode.className=i?t.parentNode.className.replace(/ field-duplicate-slug/i,"")+" field-duplicate-slug":t.parentNode.className.replace(/ field-duplicate-slug/i,"")):t.parentNode.className=t.parentNode.className.replace(/ field-duplicate-slug/i,"")}},destroy:function(){this.unbind()},render:function(){return this.el.innerHTML=this.template({field:this.model.toJSON()}),this.checkSlug(),this}}),wp.ccf.views.Fields["single-line-text"]=wp.ccf.views.Fields["single-line-text"]||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-single-line-text-template"),initialize:function(){},saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("placeholder",this.el.querySelectorAll(".field-placeholder")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this):void 0}}),wp.ccf.views.Fields.file=wp.ccf.views.Fields.file||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-file-template"),initialize:function(){},saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this.model.set("fileExtensions",this.el.querySelectorAll(".field-file-extensions")[0].value),this.model.set("maxFileSize",this.el.querySelectorAll(".field-max-file-size")[0].value),this):void 0}}),wp.ccf.views.Fields.recaptcha=wp.ccf.views.Fields.recaptcha||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-recaptcha-template"),initialize:function(){},saveField:function(){return""!==this.el.innerHTML?(this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("siteKey",this.el.querySelectorAll(".field-site-key")[0].value),this.model.set("secretKey",this.el.querySelectorAll(".field-secret-key")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this):void 0}}),wp.ccf.views.Fields["section-header"]=wp.ccf.views.Fields["section-header"]||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-section-header-template"),initialize:function(){},saveField:function(){return""!==this.el.innerHTML?(this.model.set("heading",this.el.querySelectorAll(".field-heading")[0].value),this.model.set("subheading",this.el.querySelectorAll(".field-subheading")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this):void 0}}),wp.ccf.views.Fields.html=wp.ccf.views.Fields.html||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-html-template"),initialize:function(){},saveField:function(){return""!==this.el.innerHTML?(this.model.set("html",this.el.querySelectorAll(".field-html")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this):void 0}}),wp.ccf.views.Fields["paragraph-text"]=wp.ccf.views.Fields["paragraph-text"]||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-paragraph-text-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("placeholder",this.el.querySelectorAll(".field-placeholder")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this):void 0}}),wp.ccf.views.Fields.hidden=wp.ccf.views.Fields.hidden||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-hidden-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this):void 0}}),wp.ccf.views.Fields.date=wp.ccf.views.Fields.date||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-date-template"),saveField:function(){if(""!==this.el.innerHTML){this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value);var e=this.el.querySelectorAll(".field-value");e.length>0&&this.model.set("value",e[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("showDate",this.el.querySelectorAll(".field-show-date")[0].checked?!0:!1);var t=this.model.get("showTime"),i=this.el.querySelectorAll(".field-show-time")[0].checked?!0:!1;return this.model.set("showTime",i),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),i!=t&&this.render(),this}}}),wp.ccf.views.Fields.name=wp.ccf.views.Fields.name||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-name-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this):void 0}}),wp.ccf.views.Fields.website=wp.ccf.views.Fields.website||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-website-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("placeholder",this.el.querySelectorAll(".field-placeholder")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this):void 0}}),wp.ccf.views.Fields.phone=wp.ccf.views.Fields.phone||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-phone-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("value",this.el.querySelectorAll(".field-value")[0].value),this.model.set("placeholder",this.el.querySelectorAll(".field-placeholder")[0].value),this.model.set("phoneFormat",this.el.querySelectorAll(".field-phone-format")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this):void 0}}),wp.ccf.views.Fields.address=wp.ccf.views.Fields.address||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-address-template"),saveField:function(){return""!==this.el.innerHTML?(this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("addressType",this.el.querySelectorAll(".field-address-type")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1),this):void 0}}),wp.ccf.views.Fields.email=wp.ccf.views.Fields.email||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-email-template"),saveField:function(){if(""!==this.el.innerHTML){this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value);var e=this.el.querySelectorAll(".field-value");e.length&&this.model.set("value",e[0].value);var t=this.el.querySelectorAll(".field-placeholder");t.length&&this.model.set("placeholder",t[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1);var i=1==this.el.querySelectorAll(".field-email-confirmation")[0].value?!0:!1,l=this.model.get("emailConfirmation");return this.model.set("emailConfirmation",i),l!=i&&this.render(),this}}}),wp.ccf.views.ChoiceableField=wp.ccf.views.ChoiceableField||wp.ccf.views.FieldBase.extend({template:wp.ccf.utils.template("ccf-dropdown-template"),initialize:function(){var e=this.model.get("choices");this.listenTo(e,"add",this.addChoice)},addChoice:function(e){var t=new wp.ccf.views.FieldChoice({model:e,field:this.model}).render(),i=this.el.querySelectorAll(".repeatable-choices")[0];i.appendChild(t.el)},saveField:function(){if(""!==this.el.innerHTML){this.model.set("slug",this.el.querySelectorAll(".field-slug")[0].value),this.model.set("label",this.el.querySelectorAll(".field-label")[0].value),this.model.set("description",this.el.querySelectorAll(".field-description")[0].value),this.model.set("className",this.el.querySelectorAll(".field-class-name")[0].value),this.model.set("required",1==this.el.querySelectorAll(".field-required")[0].value?!0:!1);var t=this.el.querySelectorAll(".repeatable-choices")[0].querySelectorAll(".choice");return i.each(t,function(t){e(t).trigger("saveChoice")}),this}},render:function(){var t=this;t.el.innerHTML=t.template({field:t.model.toJSON()}),t.checkSlug();var i=t.model.get("choices"),l=this.el.querySelectorAll(".repeatable-choices")[0];if(i.length>=1)i.each(function(e){var i=new wp.ccf.views.FieldChoice({model:e,field:t.model}).render();l.appendChild(i.el)});else{var s=new wp.ccf.models.FieldChoice;i.add(s)}return l=this.el.querySelectorAll(".repeatable-choices")[0],e(l).sortable({handle:".move",axis:"y",stop:function(e,t){t.item.trigger("sorted",t.item.index())}}),t}}),wp.ccf.views.Fields.dropdown=wp.ccf.views.Fields.dropdown||wp.ccf.views.ChoiceableField.extend({template:wp.ccf.utils.template("ccf-dropdown-template"),events:function(){return this.constructor.__super__.events}}),wp.ccf.views.Fields.radio=wp.ccf.views.Fields.radio||wp.ccf.views.ChoiceableField.extend({template:wp.ccf.utils.template("ccf-radio-template"),events:function(){return this.constructor.__super__.events}}),wp.ccf.views.Fields.checkboxes=wp.ccf.views.Fields.checkboxes||wp.ccf.views.ChoiceableField.extend({template:wp.ccf.utils.template("ccf-checkboxes-template"),events:function(){return this.constructor.__super__.events}}),wp.ccf.views.FieldSidebar=wp.ccf.views.FieldSidebar||t.View.extend({initialize:function(e){this.currentFieldView=null,this.form=e.form},save:function(e){this.currentFieldView&&""!==this.currentFieldView.el.innerHTML&&this.currentFieldView.saveField(),e&&e instanceof Object&&e.resolve()},fieldRemoved:function(){this.currentFieldView&&(this.form.get("fields").get(this.currentFieldView.model)||this.render())},destroy:function(){wp.ccf.dispatcher.off("saveField",this.save),wp.ccf.dispatcher.off("mainViewChange",this.save),this.unbind()},render:function(e){var t={};if(e){var i=e.get("type");this.currentFieldView&&(this.currentFieldView.saveField(),this.currentFieldView.destroy&&this.currentFieldView.destroy()),this.currentFieldView=new wp.ccf.views.Fields[i]({model:e,collection:this.form.get("fields")}),this.currentFieldView.render(),this.el.innerHTML="",this.el.appendChild(this.currentFieldView.el);var l=this.form.get("fields");this.listenTo(l,"remove",this.fieldRemoved)}else{var s=wp.ccf.utils.template("ccf-empty-field-template");this.el.innerHTML=s(t)}return wp.ccf.dispatcher.on("saveField",this.save,this),wp.ccf.dispatcher.on("mainViewChange",this.save,this),this}}),wp.ccf.views.FieldRowPlaceholder=wp.ccf.views.FieldRowPlaceholder||t.View.extend({template:wp.ccf.utils.template("ccf-field-row-template"),tagName:"div",className:"field",initialize:function(e){this.type=e.type},render:function(){return this.el.innerHTML=this.template({label:l.allLabels[this.type]}),this.el.setAttribute("data-field-type",this.type),this.el.className+=" "+this.type,this}}),wp.ccf.views.FieldRow=wp.ccf.views.FieldRow||t.View.extend({template:wp.ccf.utils.template("ccf-field-row-template"),tagName:"div",className:"field",events:{"click .delete":"triggerDelete","click h4":"triggerEdit",sorted:"triggerUpdateSort"},initialize:function(e){i.bindAll(this,"triggerDelete"),this.form=e.form,this.listenTo(this.model,"change",this.handleChange,this),this.listenTo(this.model,"requirementsNotMet",this.requirementsNotMet,this),this.listenTo(this.model,"requirementsMet",this.requirementsMet,this),this.listenTo(this.model,"duplicateSlug",this.duplicateSlug,this),this.model.attributes.choices&&this.listenTo(this.model.attributes.choices,"change",this.handleChange,this)},duplicateSlug:function(){this.requirementsMet(),this.el.className+=" field-duplicate-slug"},requirementsNotMet:function(){this.requirementsMet(),this.el.className+=" field-incomplete"},requirementsMet:function(){this.el.className=this.el.className.replace(/(field-incomplete|field-duplicate-slug)/i,"")},triggerUpdateSort:function(e,t){this.form.get("fields").remove(this.model),this.form.get("fields").add(this.model,{at:t})},handleChange:function(){this.render()},triggerDelete:function(e){e.stopPropagation(),this.form.get("fields").remove(this.model),this.undelegateEvents(),this.remove()},triggerEdit:function(){var e=this.el.parentNode.querySelectorAll(".ccf-editing");i.each(e,function(e){e.className=e.className.replace(/ccf-editing/i,"")}),this.el.className=this.el.className.replace(/ccf-editing/i,"")+" ccf-editing",wp.ccf.dispatcher.trigger("openEditField",this.model)},render:function(e){this.el.innerHTML=this.template({label:l.allLabels[this.model.get("type")]}),this.el.setAttribute("data-field-type",this.model.get("type"));var t=RegExp(" "+this.model.get("type"),"i");this.el.className=this.el.className.replace(t,"")+" "+this.model.get("type"),e&&(this.el.className=this.el.className.replace(/ instantiated/i,"")+" instantiated");var i=document.getElementById("ccf-"+this.model.get("type")+"-preview-template");if(i){var s=this.el.querySelectorAll(".preview")[0];s.style.display="block",s.innerHTML=wp.ccf.utils.template("ccf-"+this.model.get("type")+"-preview-template")({field:this.model.toJSON()})}return this}}),wp.ccf.views.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-send-email-notifications":"toggleNotificationFields"},initialize:function(e){this.model=e.form},destroy:function(){wp.ccf.dispatcher.off("saveFormSettings",this.save),wp.ccf.dispatcher.off("mainViewChange",this.save)},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")},save:function(e){if(""!==this.el.innerHTML){var t=this.el.querySelectorAll(".form-title")[0].value;this.model.set("title",t);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-completion-message")[0].value;this.model.set("completionMessage",s);var c=this.el.querySelectorAll(".form-completion-redirect-url")[0].value;this.model.set("completionRedirectUrl",c);var r=this.el.querySelectorAll(".form-completion-action-type")[0].value;this.model.set("completionActionType",r),e!==void 0&&e.promise!==void 0&&e.resolve()}},render:function(){var e={form:this.model.toJSON()};return this.el.innerHTML=this.template(e),this.toggleCompletionFields(),wp.ccf.dispatcher.on("saveFormSettings",this.save,this),wp.ccf.dispatcher.on("mainViewChange",this.save,this),this}}),wp.ccf.views.FormNotifications=wp.ccf.views.FormNotifications||t.View.extend({template:wp.ccf.utils.template("ccf-form-notifications-template"),events:{"blur input":"save","change select":"save","change select.form-send-email-notifications":"toggleNotificationFields","change select.form-email-notification-from-type":"toggleNotificationFields"},initialize:function(e){this.model=e.form},destroy:function(){wp.ccf.dispatcher.off("saveFormNotifications",this.save),wp.ccf.dispatcher.off("mainViewChange",this.save),this.undelegateEvents(),this.unbind()
2
+ },updateFromAddressFieldField:function(){var e=this.el.querySelectorAll(".form-email-notification-from-field")[0];e.innerHTML="",e.disabled=!1;var t=this.model.get("fields"),i=0,s=this.model.get("emailNotificationFromField");if(t.length>=1&&t.each(function(t){if("email"===t.get("type")){var l=document.createElement("option");l.innerHTML=t.get("slug"),l.value=t.get("slug"),t.get("slug")===s&&(l.selected=!0),e.appendChild(l),i++}}),0===i){var c=document.createElement("option");c.innerHTML=l.noEmailFields,e.appendChild(c),e.disabled=!0}},toggleNotificationFields:function(){var e,t=this.el.querySelectorAll(".form-send-email-notifications")[0].value,i=this.el.querySelectorAll(".email-notification-setting"),l=this.el.querySelectorAll(".email-notification-from-address")[0],s=this.el.querySelectorAll(".email-notification-from-field")[0],c=this.el.querySelectorAll(".form-email-notification-from-type")[0];if(parseInt(t)){for(e=0;i.length>e;e++)i[e].style.display="block";l.style.display="none",s.style.display="none","custom"===c.value?l.style.display="block":"field"===c.value&&(s.style.display="block")}else{for(e=0;i.length>e;e++)i[e].style.display="none";l.style.display="none",s.style.display="none"}},save:function(e){if(""!==this.el.innerHTML){var t=this.el.querySelectorAll(".form-send-email-notifications")[0].value;this.model.set("sendEmailNotifications",parseInt(t)?!0:!1);var i=this.el.querySelectorAll(".form-email-notification-addresses")[0].value;this.model.set("emailNotificationAddresses",i);var l=this.el.querySelectorAll(".form-email-notification-from-type")[0].value;this.model.set("emailNotificationFromType",l);var s=this.el.querySelectorAll(".form-email-notification-from-address")[0].value;this.model.set("emailNotificationFromAddress",s);var c=this.el.querySelectorAll(".form-email-notification-from-field")[0].value;this.model.set("emailNotificationFromField",c),e!==void 0&&e.promise!==void 0&&e.resolve()}},render:function(){var e={form:this.model.toJSON()},t=this.model.get("fields");return this.el.innerHTML=this.template(e),this.toggleNotificationFields(),this.updateFromAddressFieldField(),wp.ccf.dispatcher.on("saveFormNotifications",this.save,this),wp.ccf.dispatcher.on("mainViewChange",this.save,this),this.listenTo(t,"add",this.updateFromAddressFieldField,this),this.listenTo(t,"remove",this.updateFromAddressFieldField,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,"form-notifications":wp.ccf.views.FormNotifications},events:{"click .save-button":"sync","click h2":"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()},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,""))})},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(),c=e.Deferred(),r=e.Deferred();wp.ccf.dispatcher.trigger("saveFormSettings",s),wp.ccf.dispatcher.trigger("saveFormNotifications",r),wp.ccf.dispatcher.trigger("saveField",c),e.when(s,c,r).then(function(){var e=t.model.get("fields"),s=!0,c={};e.each(function(e){var t=e.get("slug");e.hasRequiredAttributes()?t&&!t.match(/^[a-zA-Z0-9\-_]+$/)?(s=!1,e.trigger("requirementsNotMet")):c[e.get("slug")]!==void 0?(s=!1,e.trigger("duplicateSlug"),c[e.get("slug")].trigger("duplicateSlug")):e.trigger("requirementsMet"):(s=!1,e.trigger("requirementsNotMet")),e.get("slug")&&(c[e.get("slug")]=e)}),s?t.model.save({},{context:"edit"}).error(function(e,t,i){var l="sync";(501===parseInt(i.status)||505===parseInt(i.status))&&(l="method"),wp.ccf.errorModal.render(l).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 c=parseInt(s[1]);c>=t&&(t=c+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 c={labels:l.fieldLabels,form:s.model.toJSON()};window.form=s.model,s.el.innerHTML=this.template(c);var r=s.el.querySelectorAll(".fields")[0];i.each(l.fieldLabels,function(e,t){r.appendChild(new wp.ccf.views.FieldRowPlaceholder({type:t}).render().el)});var n=s.el.querySelectorAll(".structure-fields")[0];i.each(l.structureFieldLabels,function(e,t){n.appendChild(new wp.ccf.views.FieldRowPlaceholder({type:t}).render().el)});var o=s.el.querySelectorAll(".special-fields")[0];i.each(l.specialFieldLabels,function(e,t){o.appendChild(new wp.ccf.views.FieldRowPlaceholder({type:t}).render().el)}),e(s.el.querySelectorAll(".left-sidebar")[0].querySelectorAll(".field")).draggable({cursor:"move",zIndex:160001,scroll:!1,containment:".ccf-form-pane",appendTo:".ccf-main-modal",snap:!0,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:i.width(),height:i.height()})}});var a=s.model.get("fields"),d=s.el.querySelectorAll(".form-content")[0];return 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",handle:"h4",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 c=new wp.ccf.models.Fields[i](l),r=s.model.get("fields");r.add(c),new wp.ccf.views.FieldRow({model:c,el:t.item,form:s.model}).render(!0),t.item.attr("style","")}t.item.trigger("sorted",t.item.index())}}),s.initRenderSubViews(!0,!0,{form:s.model}),s.enableDisableInsert(),s}},wp.ccf.mixins.subViewable)),wp.ccf.views.ExistingFormTableRow=wp.ccf.views.ExistingFormTableRow||t.View.extend({tagName:"tr",template:wp.ccf.utils.template("ccf-existing-form-table-row-template"),events:{"click .edit":"triggerMainViewChange","click .delete":"triggerDelete","click .insert-form-button":"insertForm"},initialize:function(e){this.parent=e.parent},insertForm:function(){wp.ccf.utils.insertFormShortcode(this.model),wp.ccf.toggle()},triggerMainViewChange:function(){wp.ccf.switchToForm(this.model)},triggerDelete:function(){var e,t=this,i=t.parent.collection.state.currentPage;t.model.destroy().done(function(){e=i,e===t.parent.collection.state.totalPages&&e-1===(t.parent.collection.state.totalObjects-1)/l.postsPerPage&&e--,t.parent.showPage(e).done(function(){t.parent.renderPagination()})})},render:function(){return this.$el.html(this.template({form:this.model.toJSON(),utils:{getPrettyPostDate:wp.ccf.utils.getPrettyPostDate}})),this}}),wp.ccf.views.EmptyFormTableRow=wp.ccf.views.EmptyFormTableRow||t.View.extend({tagName:"tr",template:wp.ccf.utils.template("ccf-empty-form-table-row-template"),render:function(){return this.$el.html(this.template()),this}}),wp.ccf.views.ExistingFormTable=wp.ccf.views.ExistingFormTable||t.View.extend({template:wp.ccf.utils.template("ccf-existing-form-table-template"),initialize:function(){this.parent=arguments.parent,this.collection=new wp.ccf.collections.Forms,wp.ccf.dispatcher.on("changeFormTablePage",this.showPage,this),wp.ccf.dispatcher.on("saveFormComplete",this.render,this)},showPage:function(e){var t=this,i=this.collection.fetch({data:{page:e}});return i.error(function(e,t,i){var l="sync";(501===parseInt(i.status)||505===parseInt(i.status))&&(l="method"),wp.ccf.errorModal.render(l).show()}),i.done(function(){var e=t.el.querySelectorAll(".rows")[0],i=document.createElement("tbody");i.className="rows",t.collection.length>=1?t.collection.each(function(e){var l=new wp.ccf.views.ExistingFormTableRow({model:e,parent:t}).render();i.appendChild(l.el)},t):i.appendChild((new wp.ccf.views.EmptyFormTableRow).render().el),e.parentNode.replaceChild(i,e)}),i},renderPagination:function(){var e=this.el.querySelectorAll(".ccf-pagination")[0];e.innerHTML="",this.collection.state.totalPages>1&&e.appendChild(new wp.ccf.views.Pagination({parent:this}).render(this.collection.state.totalPages,this.collection.state.currentPage).el)},render:function(){var e=this;return this.el.innerHTML=this.template(),this.el.querySelectorAll(".ccf-pagination")[0],this.showPage(1).done(function(){e.renderPagination()}),this}}),wp.ccf.views.ExistingFormPane=wp.ccf.views.ExistingFormPane||t.View.extend(i.defaults({template:wp.ccf.utils.template("ccf-existing-form-pane-template"),subViews:{"existing-form-table":wp.ccf.views.ExistingFormTable},render:function(){return this.rendered?this:(this.rendered=!0,this.el.innerHTML=this.template(),this.initRenderSubViews(!0),this)}},wp.ccf.mixins.subViewable)),wp.ccf.views.MainModal=wp.ccf.views.MainModal||t.View.extend(i.defaults({tagName:"div",className:"ccf-main-modal",template:wp.ccf.utils.template("ccf-main-modal-template"),events:{"click .close-icon":"hide","click .main-menu a":"menuClick"},subViews:{"form-pane":wp.ccf.views.FormPane},initialize:function(){l.single||(this.subViews["existing-form-pane"]=wp.ccf.views.ExistingFormPane),wp.ccf.dispatcher.on("mainViewChange",this.toggleView,this)},toggleView:function(e){this.showView(e,wp.ccf.currentForm);var t=e;"form-pane"===e&&wp.ccf.currentForm&&(t="existing-form-pane");var l=this.el.querySelectorAll(".menu-item");i.each(l,function(e){var i=e.getAttribute("data-view");e.className=i===t?e.className.replace("selected","")+" selected":e.className.replace("selected","")})},menuClick:function(e){var t=e.target.getAttribute("data-view");"form-pane"===t&&(wp.ccf.currentForm=null),wp.ccf.dispatcher.trigger("mainViewChange",t),e.preventDefault()},render:function(e){return e=e||!1,this.overlay(),this.el.innerHTML=this.template({single:e}),this.initRenderSubViews(),this.showView("form-pane",wp.ccf.currentForm,!0),this},overlay:function(){return this.overlayEl===void 0&&(this.overlayEl=document.createElement("div"),this.overlayEl.className="ccf-main-modal-overlay",document.body.appendChild(this.overlayEl)),this.overlayEl},remove:function(){return document.body.removeChild(this.overlay()),this},show:function(){e(this.overlay()).show(),this.$el.show()},hide:function(){e(this.overlay()).hide(),this.$el.hide()}},wp.ccf.mixins.subViewable)),wp.ccf.views.SubmissionRow=wp.ccf.views.SubmissionRow||t.View.extend({tagName:"tr",template:wp.ccf.utils.template("ccf-submission-row-template"),events:{"click .view":"view","click .delete":"delete"},initialize:function(e){this.parent=e.parent},"delete":function(){var e,t=this,i=t.parent.collection.state.currentPage;t.model.destroy().done(function(){e=i,e===t.parent.collection.state.totalPages&&e-1===(t.parent.collection.state.totalObjects-1)/l.postsPerPage&&e--,t.parent.showPage(e).done(function(){t.parent.renderPagination()})})},view:function(e){var t=e.currentTarget.getAttribute("data-submission-id"),i=e.currentTarget.getAttribute("data-submission-date");tb_show(l.thickboxTitle+" - "+wp.ccf.utils.getPrettyPostDate(i),"#TB_inline?height=500&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(e,t,i){var l="sync";(501===parseInt(i.status)||505===parseInt(i.status))&&(l="method"),wp.ccf.errorModal.render(l).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,c=document.querySelectorAll(".ccf-open-form-manager")[0];if(!c)return!1;i.extend(this.dispatcher,t.Events),new wp.ccf.router,s.initErrorModal();var r=!1;if(l.single)if(r=!0,l.postId){var n=parseInt(l.postId);if(s.forms.formsFetching[n]===void 0){var o=new wp.ccf.models.Form({ID:n}),a=o.fetch();s.forms.formsFetching[n]=a,s._currentFormDeferred=a,a.done(function(){delete s.forms.formsFetching[n],s.forms.add(o),s.currentForm=o})}else s._currentFormDeferred=s.forms.formsFetching[n],s._currentFormDeferred.done(function(){s.currentForm=s.forms.findWhere({ID:n})});e.when(s._currentFormDeferred).then(function(){s._setupMainModal(!0),c.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-settings",i.setAttribute("data-icon","");var l=document.getElementById("show-settings-link");i.onclick=function(){l.click()},e.insertBefore(i,e.firstChild.nextSibling.nextSibling),wp.ccf.createSubmissionsTable(t)}})}else s._setupMainModal(!0),c.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)};c.addEventListener?c.addEventListener("click",d,!1):c.attachEvent("onclick",d)}}),wp.ccf.createManager()}(jQuery,Backbone,_,ccfSettings);
classes/class-ccf-form-manager.php CHANGED
@@ -63,7 +63,11 @@ class CCF_Form_Manager {
63
  <div class="title"><?php esc_html_e( 'Custom Contact Forms is experiencing issues.', 'custom-contact-forms' ); ?></div>
64
 
65
  <p>
66
- <?php printf( __( 'There is an issue with synchronizing data. Please try deactivating all other plugins and activating the TwentyFifteen theme. If this fixes the problem, you have a plugin or theme conflict. If it does not, please post in the <a href="%s">support forums</a> or <a href="%s">Github</a>.', 'custom-contact-forms' ), 'https://wordpress.org/support/plugin/custom-contact-forms', 'http://github.com/tlovett1/custom-contact-forms' ); ?>
 
 
 
 
67
  </p>
68
  </div>
69
  </div>
63
  <div class="title"><?php esc_html_e( 'Custom Contact Forms is experiencing issues.', 'custom-contact-forms' ); ?></div>
64
 
65
  <p>
66
+ <# if ( 'sync' === messageType ) { #>
67
+ <?php printf( __( 'There is an issue with synchronizing data. Please try deactivating all other plugins and activating the TwentyFifteen theme. If this fixes the problem, you have a plugin or theme conflict. If it does not, please post in the <a href="%s">support forums</a> or <a href="%s">Github</a>.', 'custom-contact-forms' ), 'https://wordpress.org/support/plugin/custom-contact-forms', 'http://github.com/tlovett1/custom-contact-forms' ); ?>
68
+ <# } else if ( 'method' === messageType ) { #>
69
+ <?php printf( __( 'Your web server does not support either PUT, PATCH, or DELETE HTTP methods. Please contact your host to resolve the issue.', 'custom-contact-forms' ), 'https://wordpress.org/support/plugin/custom-contact-forms', 'http://github.com/tlovett1/custom-contact-forms' ); ?>
70
+ <# } #>
71
  </p>
72
  </div>
73
  </div>
classes/class-ccf-form-renderer.php CHANGED
@@ -142,7 +142,7 @@ class CCF_Form_Renderer {
142
  ?>
143
 
144
  <div class="ccf-form-wrapper form-id-<?php echo (int) $form_id; ?>" data-form-id="<?php echo (int) $form_id; ?>">
145
- <form <?php if ( $contains_file ) : ?>enctype="multipart/form-data"<?php endif; ?> novalidate class="ccf-form" method="post" action="" data-form-id="<?php echo (int) $form_id; ?>">
146
 
147
  <?php $title = get_the_title( $form_id ); if ( ! empty( $title ) && apply_filters( 'ccf_show_form_title', true, $form_id ) ) : ?>
148
  <div class="form-title">
142
  ?>
143
 
144
  <div class="ccf-form-wrapper form-id-<?php echo (int) $form_id; ?>" data-form-id="<?php echo (int) $form_id; ?>">
145
+ <form <?php if ( $contains_file ) : ?>enctype="multipart/form-data"<?php endif; ?> class="ccf-form" method="post" action="" data-form-id="<?php echo (int) $form_id; ?>">
146
 
147
  <?php $title = get_the_title( $form_id ); if ( ! empty( $title ) && apply_filters( 'ccf_show_form_title', true, $form_id ) ) : ?>
148
  <div class="form-title">
custom-contact-forms.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: http://www.taylorlovett.com
5
  * Description: Build beautiful custom forms the WordPress way. View live previews of your forms while you build them.
6
  * Author: Taylor Lovett
7
- * Version: 6.4.5
8
  * Author URI: http://www.taylorlovett.com
9
  */
10
 
4
  * Plugin URI: http://www.taylorlovett.com
5
  * Description: Build beautiful custom forms the WordPress way. View live previews of your forms while you build them.
6
  * Author: Taylor Lovett
7
+ * Version: 6.4.6
8
  * Author URI: http://www.taylorlovett.com
9
  */
10
 
fonts/gentium/GenBasB.ttf DELETED
Binary file
fonts/gentium/GenBasBI.ttf DELETED
Binary file
fonts/gentium/GenBasI.ttf DELETED
Binary file
fonts/gentium/GenBasR.ttf DELETED
Binary file
fonts/gentium/GenBkBasB.ttf DELETED
Binary file
fonts/gentium/GenBkBasBI.ttf DELETED
Binary file
fonts/gentium/GenBkBasI.ttf DELETED
Binary file
fonts/gentium/GenBkBasR.ttf DELETED
Binary file
js/manager/views.js CHANGED
@@ -1102,7 +1102,13 @@
1102
  if ( allReqsMet ) {
1103
 
1104
  SELF.model.save( {}, { context: 'edit' }).error( function( jqXHR, textStatus, errorThrown ) {
1105
- wp.ccf.errorModal.show();
 
 
 
 
 
 
1106
  }).done( function( response ) {
1107
  if (ccfSettings.single && ! ccfSettings.postId ) {
1108
  window.location = ccfSettings.adminUrl + 'post.php?post=' + SELF.model.get( 'ID' ) + '&action=edit#ccf-form/' + SELF.model.get( 'ID' );
@@ -1332,8 +1338,14 @@
1332
 
1333
  var fetch = this.collection.fetch( { data: { page: ( page ) } });
1334
 
1335
- fetch.error( function() {
1336
- wp.ccf.errorModal.show();
 
 
 
 
 
 
1337
  });
1338
 
1339
  fetch.done( function() {
@@ -1586,8 +1598,14 @@
1586
 
1587
  var fetch = this.collection.fetch( { data: { page: ( page ) } } );
1588
 
1589
- fetch.error( function() {
1590
- wp.ccf.errorModal.show();
 
 
 
 
 
 
1591
  });
1592
 
1593
  fetch.done( function() {
@@ -1672,8 +1690,16 @@
1672
  }
1673
  },
1674
 
1675
- render: function() {
1676
- this.el.innerHTML = this.template();
 
 
 
 
 
 
 
 
1677
 
1678
  return this;
1679
  }
1102
  if ( allReqsMet ) {
1103
 
1104
  SELF.model.save( {}, { context: 'edit' }).error( function( jqXHR, textStatus, errorThrown ) {
1105
+ var messageType = 'sync';
1106
+
1107
+ if ( parseInt( errorThrown.status ) === 501 || parseInt( errorThrown.status ) === 505 ) {
1108
+ messageType = 'method';
1109
+ }
1110
+
1111
+ wp.ccf.errorModal.render( messageType ).show();
1112
  }).done( function( response ) {
1113
  if (ccfSettings.single && ! ccfSettings.postId ) {
1114
  window.location = ccfSettings.adminUrl + 'post.php?post=' + SELF.model.get( 'ID' ) + '&action=edit#ccf-form/' + SELF.model.get( 'ID' );
1338
 
1339
  var fetch = this.collection.fetch( { data: { page: ( page ) } });
1340
 
1341
+ fetch.error( function( jqXHR, textStatus, errorThrown ) {
1342
+ var messageType = 'sync';
1343
+
1344
+ if ( parseInt( errorThrown.status ) === 501 || parseInt( errorThrown.status ) === 505 ) {
1345
+ messageType = 'method';
1346
+ }
1347
+
1348
+ wp.ccf.errorModal.render( messageType ).show();
1349
  });
1350
 
1351
  fetch.done( function() {
1598
 
1599
  var fetch = this.collection.fetch( { data: { page: ( page ) } } );
1600
 
1601
+ fetch.error( function( jqXHR, textStatus, errorThrown ) {
1602
+ var messageType = 'sync';
1603
+
1604
+ if ( parseInt( errorThrown.status ) === 501 || parseInt( errorThrown.status ) === 505 ) {
1605
+ messageType = 'method';
1606
+ }
1607
+
1608
+ wp.ccf.errorModal.render( messageType ).show();
1609
  });
1610
 
1611
  fetch.done( function() {
1690
  }
1691
  },
1692
 
1693
+ render: function( messageType ) {
1694
+ var context = {
1695
+ messageType: ''
1696
+ };
1697
+
1698
+ if ( messageType ) {
1699
+ context.messageType = messageType;
1700
+ }
1701
+
1702
+ this.el.innerHTML = this.template( context );
1703
 
1704
  return this;
1705
  }
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/editorial-access-manager/"
7
  "issues\n"
8
- "POT-Creation-Date: 2015-02-11 23:45-0500\n"
9
- "PO-Revision-Date: 2015-02-11 23:45-0500\n"
10
  "Last-Translator: Taylor Lovett <tlovett88@gmail.com>\n"
11
  "Language-Team: LANGUAGE <LL@li.org>\n"
12
  "Language: en\n"
@@ -79,40 +79,40 @@ msgstr ""
79
 
80
  #: ../classes/class-ccf-field-renderer.php:955
81
  #: ../classes/class-ccf-field-renderer.php:976
82
- #: ../classes/class-ccf-form-manager.php:1060
83
- #: ../classes/class-ccf-form-manager.php:1081
84
  msgid "HH"
85
  msgstr ""
86
 
87
  #: ../classes/class-ccf-field-renderer.php:959
88
  #: ../classes/class-ccf-field-renderer.php:980
89
- #: ../classes/class-ccf-form-manager.php:1064
90
- #: ../classes/class-ccf-form-manager.php:1085
91
  msgid "MM"
92
  msgstr ""
93
 
94
  #: ../classes/class-ccf-field-renderer.php:963
95
  #: ../classes/class-ccf-field-renderer.php:984
96
- #: ../classes/class-ccf-form-manager.php:1068
97
- #: ../classes/class-ccf-form-manager.php:1089
98
  msgid "AM"
99
  msgstr ""
100
 
101
  #: ../classes/class-ccf-field-renderer.php:964
102
  #: ../classes/class-ccf-field-renderer.php:985
103
- #: ../classes/class-ccf-form-manager.php:1069
104
- #: ../classes/class-ccf-form-manager.php:1090
105
  msgid "PM"
106
  msgstr ""
107
 
108
  #: ../classes/class-ccf-field-renderer.php:971
109
  #: ../classes/class-ccf-form-cpt.php:306
110
- #: ../classes/class-ccf-form-manager.php:228
111
- #: ../classes/class-ccf-form-manager.php:241
112
- #: ../classes/class-ccf-form-manager.php:1076
113
- #: ../classes/class-ccf-form-manager.php:1259
114
- #: ../classes/class-ccf-form-manager.php:1273
115
- #: ../classes/class-ccf-form-manager.php:1405
116
  msgid "Date"
117
  msgstr ""
118
 
@@ -122,8 +122,8 @@ msgstr ""
122
 
123
  #: ../classes/class-ccf-form-cpt.php:123 ../classes/class-ccf-form-cpt.php:141
124
  #: ../classes/class-ccf-form-cpt.php:304
125
- #: ../classes/class-ccf-form-manager.php:231
126
- #: ../classes/class-ccf-form-manager.php:244
127
  msgid "Submissions"
128
  msgstr ""
129
 
@@ -160,7 +160,7 @@ msgid "Move to Trash"
160
  msgstr ""
161
 
162
  #: ../classes/class-ccf-form-cpt.php:247
163
- #: ../classes/class-ccf-form-manager.php:1201
164
  msgid "(No title)"
165
  msgstr ""
166
 
@@ -173,14 +173,14 @@ msgid "Form Title"
173
  msgstr ""
174
 
175
  #: ../classes/class-ccf-form-cpt.php:303
176
- #: ../classes/class-ccf-form-manager.php:229
177
- #: ../classes/class-ccf-form-manager.php:242
178
  msgid "Author"
179
  msgstr ""
180
 
181
  #: ../classes/class-ccf-form-cpt.php:305
182
- #: ../classes/class-ccf-form-manager.php:230
183
- #: ../classes/class-ccf-form-manager.php:243
184
  msgid "Number of Fields"
185
  msgstr ""
186
 
@@ -210,7 +210,7 @@ msgid "Form"
210
  msgstr ""
211
 
212
  #: ../classes/class-ccf-form-cpt.php:368 ../classes/class-ccf-form-cpt.php:371
213
- #: ../classes/class-ccf-form-manager.php:65
214
  msgid "New Form"
215
  msgstr ""
216
 
@@ -361,303 +361,322 @@ msgstr ""
361
  msgid "AM/PM is required."
362
  msgstr ""
363
 
364
- #: ../classes/class-ccf-form-handler.php:695
365
  msgid "*Hidden Field*"
366
  msgstr ""
367
 
368
- #: ../classes/class-ccf-form-handler.php:765
369
  msgid "Form submitted from"
370
  msgstr ""
371
 
372
- #: ../classes/class-ccf-form-handler.php:799
373
  #, php-format
374
  msgid "%s: Form Submission to \"%s\""
375
  msgstr ""
376
 
377
- #: ../classes/class-ccf-form-handler.php:812
378
  #: ../classes/class-ccf-form-renderer.php:119
379
  msgid "Thank you for your submission."
380
  msgstr ""
381
 
382
- #: ../classes/class-ccf-form-manager.php:62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
383
  msgid "Manage Forms"
384
  msgstr ""
385
 
386
- #: ../classes/class-ccf-form-manager.php:66
387
  msgid "Existing Forms"
388
  msgstr ""
389
 
390
- #: ../classes/class-ccf-form-manager.php:90
391
  msgid "Standard Fields"
392
  msgstr ""
393
 
394
- #: ../classes/class-ccf-form-manager.php:96
395
  msgid "Special Fields"
396
  msgstr ""
397
 
398
- #: ../classes/class-ccf-form-manager.php:102
399
  msgid "Structure"
400
  msgstr ""
401
 
402
- #: ../classes/class-ccf-form-manager.php:113
403
  msgid "&rarr; Drag fields here to add them"
404
  msgstr ""
405
 
406
- #: ../classes/class-ccf-form-manager.php:120
407
- #: ../classes/class-ccf-form-manager.php:1204
408
  msgid "Insert into post"
409
  msgstr ""
410
 
411
- #: ../classes/class-ccf-form-manager.php:121
412
  msgid "Save Form"
413
  msgstr ""
414
 
415
- #: ../classes/class-ccf-form-manager.php:127
416
  msgid "Form Settings"
417
  msgstr ""
418
 
419
- #: ../classes/class-ccf-form-manager.php:130
420
  msgid "Form Title:"
421
  msgstr ""
422
 
423
- #: ../classes/class-ccf-form-manager.php:135
424
  msgid "Form Description:"
425
  msgstr ""
426
 
427
- #: ../classes/class-ccf-form-manager.php:140
428
  msgid "Button Text:"
429
  msgstr ""
430
 
431
- #: ../classes/class-ccf-form-manager.php:145
432
  msgid "On form completion:"
433
  msgstr ""
434
 
435
- #: ../classes/class-ccf-form-manager.php:148
436
  msgid "Show text"
437
  msgstr ""
438
 
439
- #: ../classes/class-ccf-form-manager.php:149
440
  msgid "Redirect"
441
  msgstr ""
442
 
443
- #: ../classes/class-ccf-form-manager.php:153
444
  msgid "Redirect URL:"
445
  msgstr ""
446
 
447
- #: ../classes/class-ccf-form-manager.php:157
448
  msgid "Completion Message:"
449
  msgstr ""
450
 
451
- #: ../classes/class-ccf-form-manager.php:164
452
  msgid "Form Notifications"
453
  msgstr ""
454
 
455
- #: ../classes/class-ccf-form-manager.php:167
456
  msgid "Send Email Notifications:"
457
  msgstr ""
458
 
459
- #: ../classes/class-ccf-form-manager.php:170
460
- #: ../classes/class-ccf-form-manager.php:281
461
- #: ../classes/class-ccf-form-manager.php:331
462
- #: ../classes/class-ccf-form-manager.php:407
463
- #: ../classes/class-ccf-form-manager.php:497
464
- #: ../classes/class-ccf-form-manager.php:562
465
- #: ../classes/class-ccf-form-manager.php:604
466
- #: ../classes/class-ccf-form-manager.php:665
467
- #: ../classes/class-ccf-form-manager.php:712
468
- #: ../classes/class-ccf-form-manager.php:754
469
- #: ../classes/class-ccf-form-manager.php:761
470
- #: ../classes/class-ccf-form-manager.php:812
471
- #: ../classes/class-ccf-form-manager.php:855
472
- #: ../classes/class-ccf-form-manager.php:898
473
  msgid "Yes"
474
  msgstr ""
475
 
476
- #: ../classes/class-ccf-form-manager.php:171
477
- #: ../classes/class-ccf-form-manager.php:282
478
- #: ../classes/class-ccf-form-manager.php:332
479
- #: ../classes/class-ccf-form-manager.php:408
480
- #: ../classes/class-ccf-form-manager.php:498
481
- #: ../classes/class-ccf-form-manager.php:563
482
- #: ../classes/class-ccf-form-manager.php:605
483
- #: ../classes/class-ccf-form-manager.php:666
484
- #: ../classes/class-ccf-form-manager.php:713
485
- #: ../classes/class-ccf-form-manager.php:755
486
- #: ../classes/class-ccf-form-manager.php:762
487
- #: ../classes/class-ccf-form-manager.php:813
488
- #: ../classes/class-ccf-form-manager.php:856
489
- #: ../classes/class-ccf-form-manager.php:899
490
  msgid "No"
491
  msgstr ""
492
 
493
- #: ../classes/class-ccf-form-manager.php:176
494
  msgid "\"To\" Email Addresses (comma separated):"
495
  msgstr ""
496
 
497
- #: ../classes/class-ccf-form-manager.php:181
498
  msgid "\"From\" Email Address Type:"
499
  msgstr ""
500
 
501
- #: ../classes/class-ccf-form-manager.php:183
502
  msgid "WordPress Default"
503
  msgstr ""
504
 
505
- #: ../classes/class-ccf-form-manager.php:184
506
  msgid "Custom Email"
507
  msgstr ""
508
 
509
- #: ../classes/class-ccf-form-manager.php:185
510
  msgid "Form Field"
511
  msgstr ""
512
 
513
- #: ../classes/class-ccf-form-manager.php:188
514
  msgid ""
515
  "You can set the notification emails from address to be the WP default, a "
516
  "custom email address, or pull the address from a field in the form."
517
  msgstr ""
518
 
519
- #: ../classes/class-ccf-form-manager.php:192
520
  msgid "Custom \"From\" Email Address:"
521
  msgstr ""
522
 
523
- #: ../classes/class-ccf-form-manager.php:197
524
  msgid "Pull \"From\" Email Dynamically from Field:"
525
  msgstr ""
526
 
527
- #: ../classes/class-ccf-form-manager.php:211
528
  msgid "items"
529
  msgstr ""
530
 
531
- #: ../classes/class-ccf-form-manager.php:226
532
- #: ../classes/class-ccf-form-manager.php:239
533
  msgid "ID"
534
  msgstr ""
535
 
536
- #: ../classes/class-ccf-form-manager.php:227
537
- #: ../classes/class-ccf-form-manager.php:240
538
  msgid "Title"
539
  msgstr ""
540
 
541
- #: ../classes/class-ccf-form-manager.php:254
542
  msgid "<span>&larr;</span> Click on a field to edit it."
543
  msgstr ""
544
 
545
- #: ../classes/class-ccf-form-manager.php:263
546
- #: ../classes/class-ccf-form-manager.php:307
547
- #: ../classes/class-ccf-form-manager.php:389
548
- #: ../classes/class-ccf-form-manager.php:479
549
  msgid "Internal Unique Slug"
550
  msgstr ""
551
 
552
- #: ../classes/class-ccf-form-manager.php:267
553
- #: ../classes/class-ccf-form-manager.php:311
554
- #: ../classes/class-ccf-form-manager.php:354
555
- #: ../classes/class-ccf-form-manager.php:393
556
- #: ../classes/class-ccf-form-manager.php:483
557
- #: ../classes/class-ccf-form-manager.php:552
558
- #: ../classes/class-ccf-form-manager.php:588
559
- #: ../classes/class-ccf-form-manager.php:644
560
- #: ../classes/class-ccf-form-manager.php:695
561
- #: ../classes/class-ccf-form-manager.php:738
562
- #: ../classes/class-ccf-form-manager.php:802
563
- #: ../classes/class-ccf-form-manager.php:845
564
- #: ../classes/class-ccf-form-manager.php:888
565
  msgid "Label:"
566
  msgstr ""
567
 
568
- #: ../classes/class-ccf-form-manager.php:271
569
- #: ../classes/class-ccf-form-manager.php:315
570
- #: ../classes/class-ccf-form-manager.php:358
571
- #: ../classes/class-ccf-form-manager.php:397
572
- #: ../classes/class-ccf-form-manager.php:487
573
- #: ../classes/class-ccf-form-manager.php:556
574
- #: ../classes/class-ccf-form-manager.php:592
575
- #: ../classes/class-ccf-form-manager.php:648
576
- #: ../classes/class-ccf-form-manager.php:699
577
- #: ../classes/class-ccf-form-manager.php:742
578
- #: ../classes/class-ccf-form-manager.php:806
579
- #: ../classes/class-ccf-form-manager.php:849
580
- #: ../classes/class-ccf-form-manager.php:892
581
  msgid "Description:"
582
  msgstr ""
583
 
584
- #: ../classes/class-ccf-form-manager.php:275
585
- #: ../classes/class-ccf-form-manager.php:401
586
- #: ../classes/class-ccf-form-manager.php:491
587
- #: ../classes/class-ccf-form-manager.php:527
588
- #: ../classes/class-ccf-form-manager.php:597
589
- #: ../classes/class-ccf-form-manager.php:652
590
- #: ../classes/class-ccf-form-manager.php:747
591
  msgid "Initial Value:"
592
  msgstr ""
593
 
594
- #: ../classes/class-ccf-form-manager.php:279
595
- #: ../classes/class-ccf-form-manager.php:329
596
- #: ../classes/class-ccf-form-manager.php:405
597
- #: ../classes/class-ccf-form-manager.php:495
598
- #: ../classes/class-ccf-form-manager.php:560
599
- #: ../classes/class-ccf-form-manager.php:602
600
- #: ../classes/class-ccf-form-manager.php:663
601
- #: ../classes/class-ccf-form-manager.php:710
602
- #: ../classes/class-ccf-form-manager.php:752
603
- #: ../classes/class-ccf-form-manager.php:810
604
- #: ../classes/class-ccf-form-manager.php:853
605
- #: ../classes/class-ccf-form-manager.php:896
606
  msgid "Required:"
607
  msgstr ""
608
 
609
- #: ../classes/class-ccf-form-manager.php:288
610
- #: ../classes/class-ccf-form-manager.php:338
611
- #: ../classes/class-ccf-form-manager.php:374
612
- #: ../classes/class-ccf-form-manager.php:414
613
- #: ../classes/class-ccf-form-manager.php:439
614
- #: ../classes/class-ccf-form-manager.php:464
615
- #: ../classes/class-ccf-form-manager.php:504
616
- #: ../classes/class-ccf-form-manager.php:533
617
- #: ../classes/class-ccf-form-manager.php:569
618
- #: ../classes/class-ccf-form-manager.php:619
619
- #: ../classes/class-ccf-form-manager.php:672
620
- #: ../classes/class-ccf-form-manager.php:719
621
- #: ../classes/class-ccf-form-manager.php:768
622
- #: ../classes/class-ccf-form-manager.php:826
623
- #: ../classes/class-ccf-form-manager.php:869
624
- #: ../classes/class-ccf-form-manager.php:912
625
  msgid "Advanced"
626
  msgstr ""
627
 
628
- #: ../classes/class-ccf-form-manager.php:291
629
- #: ../classes/class-ccf-form-manager.php:341
630
- #: ../classes/class-ccf-form-manager.php:377
631
- #: ../classes/class-ccf-form-manager.php:417
632
- #: ../classes/class-ccf-form-manager.php:442
633
- #: ../classes/class-ccf-form-manager.php:467
634
- #: ../classes/class-ccf-form-manager.php:507
635
- #: ../classes/class-ccf-form-manager.php:536
636
- #: ../classes/class-ccf-form-manager.php:572
637
- #: ../classes/class-ccf-form-manager.php:622
638
- #: ../classes/class-ccf-form-manager.php:675
639
- #: ../classes/class-ccf-form-manager.php:722
640
- #: ../classes/class-ccf-form-manager.php:771
641
- #: ../classes/class-ccf-form-manager.php:829
642
- #: ../classes/class-ccf-form-manager.php:872
643
- #: ../classes/class-ccf-form-manager.php:915
644
  msgid "Class Name:"
645
  msgstr ""
646
 
647
- #: ../classes/class-ccf-form-manager.php:295
648
- #: ../classes/class-ccf-form-manager.php:421
649
- #: ../classes/class-ccf-form-manager.php:511
650
- #: ../classes/class-ccf-form-manager.php:627
651
- #: ../classes/class-ccf-form-manager.php:679
652
- #: ../classes/class-ccf-form-manager.php:776
653
  msgid "Placeholder Text:"
654
  msgstr ""
655
 
656
- #: ../classes/class-ccf-form-manager.php:319
657
  msgid "Allowed File Extensions (comma separate):"
658
  msgstr ""
659
 
660
- #: ../classes/class-ccf-form-manager.php:321
661
  msgid ""
662
  "If left blank, will default to all extensions registered by WordPress. If "
663
  "you use a file extension or mime type not <a href=\"http://codex.wordpress."
@@ -665,301 +684,301 @@ msgid ""
665
  "a>, you will need to filter and manually whitelist the new extension."
666
  msgstr ""
667
 
668
- #: ../classes/class-ccf-form-manager.php:324
669
  msgid "Max File Size (in MB):"
670
  msgstr ""
671
 
672
- #: ../classes/class-ccf-form-manager.php:326
673
  #, php-format
674
  msgid ""
675
  "If left blank, will default to %d MB. Maximum allowed by server is %d MB."
676
  msgstr ""
677
 
678
- #: ../classes/class-ccf-form-manager.php:352
679
  msgid ""
680
  "reCAPTCHA is a simple captcha service provided by Google. <a target=\"_blank"
681
  "\" href=\"https://www.google.com/recaptcha/intro/index.html\">Learn more</a>"
682
  msgstr ""
683
 
684
- #: ../classes/class-ccf-form-manager.php:362
685
  msgid "Site Key:"
686
  msgstr ""
687
 
688
- #: ../classes/class-ccf-form-manager.php:364
689
- #: ../classes/class-ccf-form-manager.php:369
690
  msgid "Don't have one?"
691
  msgstr ""
692
 
693
- #: ../classes/class-ccf-form-manager.php:367
694
  msgid "Secret Key:"
695
  msgstr ""
696
 
697
- #: ../classes/class-ccf-form-manager.php:430
698
- #: ../classes/class-ccf-form-manager.php:451
699
- #: ../classes/class-ccf-form-manager.php:476
700
- #: ../classes/class-ccf-form-manager.php:520
701
- #: ../classes/class-ccf-form-manager.php:545
702
- #: ../classes/class-ccf-form-manager.php:581
703
- #: ../classes/class-ccf-form-manager.php:637
704
- #: ../classes/class-ccf-form-manager.php:688
705
- #: ../classes/class-ccf-form-manager.php:731
706
- #: ../classes/class-ccf-form-manager.php:795
707
- #: ../classes/class-ccf-form-manager.php:838
708
- #: ../classes/class-ccf-form-manager.php:881
709
  msgid "Basic"
710
  msgstr ""
711
 
712
- #: ../classes/class-ccf-form-manager.php:433
713
  msgid "HTML Content:"
714
  msgstr ""
715
 
716
- #: ../classes/class-ccf-form-manager.php:454
717
  msgid "Heading:"
718
  msgstr ""
719
 
720
- #: ../classes/class-ccf-form-manager.php:458
721
  msgid "Sub Heading:"
722
  msgstr ""
723
 
724
- #: ../classes/class-ccf-form-manager.php:523
725
- #: ../classes/class-ccf-form-manager.php:548
726
- #: ../classes/class-ccf-form-manager.php:584
727
- #: ../classes/class-ccf-form-manager.php:640
728
- #: ../classes/class-ccf-form-manager.php:691
729
- #: ../classes/class-ccf-form-manager.php:734
730
- #: ../classes/class-ccf-form-manager.php:798
731
- #: ../classes/class-ccf-form-manager.php:841
732
- #: ../classes/class-ccf-form-manager.php:884
733
  msgid "Internal Unique Slug (a-z, 0-9, -, _):"
734
  msgstr ""
735
 
736
- #: ../classes/class-ccf-form-manager.php:610
737
  msgid "Enable Date Select"
738
  msgstr ""
739
 
740
- #: ../classes/class-ccf-form-manager.php:614
741
  msgid "Enable Time Select"
742
  msgstr ""
743
 
744
- #: ../classes/class-ccf-form-manager.php:656
745
  msgid "Format:"
746
  msgstr ""
747
 
748
- #: ../classes/class-ccf-form-manager.php:659
749
- #: ../classes/class-ccf-form-manager.php:706
750
  msgid "International"
751
  msgstr ""
752
 
753
- #: ../classes/class-ccf-form-manager.php:703
754
  msgid "Type:"
755
  msgstr ""
756
 
757
- #: ../classes/class-ccf-form-manager.php:705
758
  msgid "United States"
759
  msgstr ""
760
 
761
- #: ../classes/class-ccf-form-manager.php:759
762
  msgid "Require Confirmation:"
763
  msgstr ""
764
 
765
- #: ../classes/class-ccf-form-manager.php:787
766
  msgid "Label"
767
  msgstr ""
768
 
769
- #: ../classes/class-ccf-form-manager.php:788
770
  msgid "Value"
771
  msgstr ""
772
 
773
- #: ../classes/class-ccf-form-manager.php:817
774
- #: ../classes/class-ccf-form-manager.php:860
775
- #: ../classes/class-ccf-form-manager.php:903
776
  msgid "Manage field choices:"
777
  msgstr ""
778
 
779
- #: ../classes/class-ccf-form-manager.php:821
780
- #: ../classes/class-ccf-form-manager.php:864
781
- #: ../classes/class-ccf-form-manager.php:907
782
  msgid ""
783
  "Note: If an option does not have a \"value\", it will not be considered a "
784
  "valid selection if the field is required. The \"value\" is what's read, "
785
  "stored, and displayed in the submission."
786
  msgstr ""
787
 
788
- #: ../classes/class-ccf-form-manager.php:924
789
  msgid "You currently have no forms. Add some!"
790
  msgstr ""
791
 
792
- #: ../classes/class-ccf-form-manager.php:947
793
  msgid "Allowed file extensions are {{ extensions }}. "
794
  msgstr ""
795
 
796
- #: ../classes/class-ccf-form-manager.php:949
797
  msgid "Max file size is {{ file_size }} MB. "
798
  msgstr ""
799
 
800
- #: ../classes/class-ccf-form-manager.php:974
801
- #: ../classes/class-ccf-form-manager.php:990
802
  #: ../classes/class-ccf-form-manager.php:1008
 
803
  msgid "An example choice"
804
  msgstr ""
805
 
806
- #: ../classes/class-ccf-form-manager.php:1026
807
  msgid "Arbitrary block of HTML."
808
  msgstr ""
809
 
810
- #: ../classes/class-ccf-form-manager.php:1032
811
  msgid "Section Heading"
812
  msgstr ""
813
 
814
- #: ../classes/class-ccf-form-manager.php:1034
815
  msgid "This is the sub-heading text."
816
  msgstr ""
817
 
818
- #: ../classes/class-ccf-form-manager.php:1041
819
  msgid "First"
820
  msgstr ""
821
 
822
- #: ../classes/class-ccf-form-manager.php:1045
823
  msgid "Last"
824
  msgstr ""
825
 
826
- #: ../classes/class-ccf-form-manager.php:1105
827
- #: ../classes/class-ccf-form-manager.php:1130
828
  msgid "Street Address"
829
  msgstr ""
830
 
831
- #: ../classes/class-ccf-form-manager.php:1109
832
- #: ../classes/class-ccf-form-manager.php:1134
833
  msgid "Address Line 2"
834
  msgstr ""
835
 
836
- #: ../classes/class-ccf-form-manager.php:1113
837
- #: ../classes/class-ccf-form-manager.php:1138
838
  msgid "City"
839
  msgstr ""
840
 
841
- #: ../classes/class-ccf-form-manager.php:1121
842
  msgid "State"
843
  msgstr ""
844
 
845
- #: ../classes/class-ccf-form-manager.php:1125
846
  msgid "ZIP Code"
847
  msgstr ""
848
 
849
- #: ../classes/class-ccf-form-manager.php:1142
850
  msgid "State / Region / Province"
851
  msgstr ""
852
 
853
- #: ../classes/class-ccf-form-manager.php:1146
854
  msgid "ZIP / Postal Code"
855
  msgstr ""
856
 
857
- #: ../classes/class-ccf-form-manager.php:1154
858
  msgid "Country"
859
  msgstr ""
860
 
861
- #: ../classes/class-ccf-form-manager.php:1165
862
  msgid "email@example.com"
863
  msgstr ""
864
 
865
- #: ../classes/class-ccf-form-manager.php:1169
866
- #: ../classes/class-ccf-form-manager.php:1464
867
  msgid "Email"
868
  msgstr ""
869
 
870
- #: ../classes/class-ccf-form-manager.php:1173
871
  msgid "Confirm Email"
872
  msgstr ""
873
 
874
- #: ../classes/class-ccf-form-manager.php:1203
875
  msgid "Edit"
876
  msgstr ""
877
 
878
- #: ../classes/class-ccf-form-manager.php:1205
879
  msgid "Trash"
880
  msgstr ""
881
 
882
- #: ../classes/class-ccf-form-manager.php:1248
883
  msgid "There is a problem with this form. Is it trashed or deleted?"
884
  msgstr ""
885
 
886
- #: ../classes/class-ccf-form-manager.php:1396
887
  msgid "There are no submissions."
888
  msgstr ""
889
 
890
- #: ../classes/class-ccf-form-manager.php:1425
891
  msgid "Add Form"
892
  msgstr ""
893
 
894
- #: ../classes/class-ccf-form-manager.php:1449
895
  msgid "Single Line Text"
896
  msgstr ""
897
 
898
- #: ../classes/class-ccf-form-manager.php:1450
899
  msgid "Dropdown"
900
  msgstr ""
901
 
902
- #: ../classes/class-ccf-form-manager.php:1451
903
  msgid "Checkboxes"
904
  msgstr ""
905
 
906
- #: ../classes/class-ccf-form-manager.php:1452
907
  msgid "Radio Buttons"
908
  msgstr ""
909
 
910
- #: ../classes/class-ccf-form-manager.php:1453
911
  msgid "Paragraph Text"
912
  msgstr ""
913
 
914
- #: ../classes/class-ccf-form-manager.php:1454
915
  msgid "Hidden"
916
  msgstr ""
917
 
918
- #: ../classes/class-ccf-form-manager.php:1455
919
  msgid "File Upload"
920
  msgstr ""
921
 
922
- #: ../classes/class-ccf-form-manager.php:1459
923
  msgid "HTML"
924
  msgstr ""
925
 
926
- #: ../classes/class-ccf-form-manager.php:1460
927
  msgid "Section Header"
928
  msgstr ""
929
 
930
- #: ../classes/class-ccf-form-manager.php:1465
931
  msgid "Name"
932
  msgstr ""
933
 
934
- #: ../classes/class-ccf-form-manager.php:1466
935
  msgid "Date/Time"
936
  msgstr ""
937
 
938
- #: ../classes/class-ccf-form-manager.php:1467
939
  msgid "Website"
940
  msgstr ""
941
 
942
- #: ../classes/class-ccf-form-manager.php:1468
943
  msgid "Address"
944
  msgstr ""
945
 
946
- #: ../classes/class-ccf-form-manager.php:1469
947
  msgid "Phone"
948
  msgstr ""
949
 
950
- #: ../classes/class-ccf-form-manager.php:1470
951
  msgid "reCAPTCHA"
952
  msgstr ""
953
 
954
- #: ../classes/class-ccf-form-manager.php:1487
955
  msgid "You have no email fields"
956
  msgstr ""
957
 
958
- #: ../classes/class-ccf-form-manager.php:1488
959
  msgid "Invalid date"
960
  msgstr ""
961
 
962
- #: ../classes/class-ccf-form-manager.php:1490
963
  msgid "Form Submission"
964
  msgstr ""
965
 
5
  "Project-Id-Version: Custom Contact Forms\n"
6
  "Report-Msgid-Bugs-To: https://github.com/tlovett1/editorial-access-manager/"
7
  "issues\n"
8
+ "POT-Creation-Date: 2015-02-24 00:23-0500\n"
9
+ "PO-Revision-Date: 2015-02-24 00:23-0500\n"
10
  "Last-Translator: Taylor Lovett <tlovett88@gmail.com>\n"
11
  "Language-Team: LANGUAGE <LL@li.org>\n"
12
  "Language: en\n"
79
 
80
  #: ../classes/class-ccf-field-renderer.php:955
81
  #: ../classes/class-ccf-field-renderer.php:976
82
+ #: ../classes/class-ccf-form-manager.php:1078
83
+ #: ../classes/class-ccf-form-manager.php:1099
84
  msgid "HH"
85
  msgstr ""
86
 
87
  #: ../classes/class-ccf-field-renderer.php:959
88
  #: ../classes/class-ccf-field-renderer.php:980
89
+ #: ../classes/class-ccf-form-manager.php:1082
90
+ #: ../classes/class-ccf-form-manager.php:1103
91
  msgid "MM"
92
  msgstr ""
93
 
94
  #: ../classes/class-ccf-field-renderer.php:963
95
  #: ../classes/class-ccf-field-renderer.php:984
96
+ #: ../classes/class-ccf-form-manager.php:1086
97
+ #: ../classes/class-ccf-form-manager.php:1107
98
  msgid "AM"
99
  msgstr ""
100
 
101
  #: ../classes/class-ccf-field-renderer.php:964
102
  #: ../classes/class-ccf-field-renderer.php:985
103
+ #: ../classes/class-ccf-form-manager.php:1087
104
+ #: ../classes/class-ccf-form-manager.php:1108
105
  msgid "PM"
106
  msgstr ""
107
 
108
  #: ../classes/class-ccf-field-renderer.php:971
109
  #: ../classes/class-ccf-form-cpt.php:306
110
+ #: ../classes/class-ccf-form-manager.php:246
111
+ #: ../classes/class-ccf-form-manager.php:259
112
+ #: ../classes/class-ccf-form-manager.php:1094
113
+ #: ../classes/class-ccf-form-manager.php:1277
114
+ #: ../classes/class-ccf-form-manager.php:1291
115
+ #: ../classes/class-ccf-form-manager.php:1423
116
  msgid "Date"
117
  msgstr ""
118
 
122
 
123
  #: ../classes/class-ccf-form-cpt.php:123 ../classes/class-ccf-form-cpt.php:141
124
  #: ../classes/class-ccf-form-cpt.php:304
125
+ #: ../classes/class-ccf-form-manager.php:249
126
+ #: ../classes/class-ccf-form-manager.php:262
127
  msgid "Submissions"
128
  msgstr ""
129
 
160
  msgstr ""
161
 
162
  #: ../classes/class-ccf-form-cpt.php:247
163
+ #: ../classes/class-ccf-form-manager.php:1219
164
  msgid "(No title)"
165
  msgstr ""
166
 
173
  msgstr ""
174
 
175
  #: ../classes/class-ccf-form-cpt.php:303
176
+ #: ../classes/class-ccf-form-manager.php:247
177
+ #: ../classes/class-ccf-form-manager.php:260
178
  msgid "Author"
179
  msgstr ""
180
 
181
  #: ../classes/class-ccf-form-cpt.php:305
182
+ #: ../classes/class-ccf-form-manager.php:248
183
+ #: ../classes/class-ccf-form-manager.php:261
184
  msgid "Number of Fields"
185
  msgstr ""
186
 
210
  msgstr ""
211
 
212
  #: ../classes/class-ccf-form-cpt.php:368 ../classes/class-ccf-form-cpt.php:371
213
+ #: ../classes/class-ccf-form-manager.php:83
214
  msgid "New Form"
215
  msgstr ""
216
 
361
  msgid "AM/PM is required."
362
  msgstr ""
363
 
364
+ #: ../classes/class-ccf-form-handler.php:697
365
  msgid "*Hidden Field*"
366
  msgstr ""
367
 
368
+ #: ../classes/class-ccf-form-handler.php:771
369
  msgid "Form submitted from"
370
  msgstr ""
371
 
372
+ #: ../classes/class-ccf-form-handler.php:805
373
  #, php-format
374
  msgid "%s: Form Submission to \"%s\""
375
  msgstr ""
376
 
377
+ #: ../classes/class-ccf-form-handler.php:818
378
  #: ../classes/class-ccf-form-renderer.php:119
379
  msgid "Thank you for your submission."
380
  msgstr ""
381
 
382
+ #: ../classes/class-ccf-form-manager.php:63
383
+ msgid "Custom Contact Forms is experiencing issues."
384
+ msgstr ""
385
+
386
+ #: ../classes/class-ccf-form-manager.php:67
387
+ #, php-format
388
+ msgid ""
389
+ "There is an issue with synchronizing data. Please try deactivating all other "
390
+ "plugins and activating the TwentyFifteen theme. If this fixes the problem, "
391
+ "you have a plugin or theme conflict. If it does not, please post in the <a "
392
+ "href=\"%s\">support forums</a> or <a href=\"%s\">Github</a>."
393
+ msgstr ""
394
+
395
+ #: ../classes/class-ccf-form-manager.php:69
396
+ msgid ""
397
+ "Your web server does not support either PUT, PATCH, or DELETE HTTP methods. "
398
+ "Please contact your host to resolve the issue."
399
+ msgstr ""
400
+
401
+ #: ../classes/class-ccf-form-manager.php:80
402
  msgid "Manage Forms"
403
  msgstr ""
404
 
405
+ #: ../classes/class-ccf-form-manager.php:84
406
  msgid "Existing Forms"
407
  msgstr ""
408
 
409
+ #: ../classes/class-ccf-form-manager.php:108
410
  msgid "Standard Fields"
411
  msgstr ""
412
 
413
+ #: ../classes/class-ccf-form-manager.php:114
414
  msgid "Special Fields"
415
  msgstr ""
416
 
417
+ #: ../classes/class-ccf-form-manager.php:120
418
  msgid "Structure"
419
  msgstr ""
420
 
421
+ #: ../classes/class-ccf-form-manager.php:131
422
  msgid "&rarr; Drag fields here to add them"
423
  msgstr ""
424
 
425
+ #: ../classes/class-ccf-form-manager.php:138
426
+ #: ../classes/class-ccf-form-manager.php:1222
427
  msgid "Insert into post"
428
  msgstr ""
429
 
430
+ #: ../classes/class-ccf-form-manager.php:139
431
  msgid "Save Form"
432
  msgstr ""
433
 
434
+ #: ../classes/class-ccf-form-manager.php:145
435
  msgid "Form Settings"
436
  msgstr ""
437
 
438
+ #: ../classes/class-ccf-form-manager.php:148
439
  msgid "Form Title:"
440
  msgstr ""
441
 
442
+ #: ../classes/class-ccf-form-manager.php:153
443
  msgid "Form Description:"
444
  msgstr ""
445
 
446
+ #: ../classes/class-ccf-form-manager.php:158
447
  msgid "Button Text:"
448
  msgstr ""
449
 
450
+ #: ../classes/class-ccf-form-manager.php:163
451
  msgid "On form completion:"
452
  msgstr ""
453
 
454
+ #: ../classes/class-ccf-form-manager.php:166
455
  msgid "Show text"
456
  msgstr ""
457
 
458
+ #: ../classes/class-ccf-form-manager.php:167
459
  msgid "Redirect"
460
  msgstr ""
461
 
462
+ #: ../classes/class-ccf-form-manager.php:171
463
  msgid "Redirect URL:"
464
  msgstr ""
465
 
466
+ #: ../classes/class-ccf-form-manager.php:175
467
  msgid "Completion Message:"
468
  msgstr ""
469
 
470
+ #: ../classes/class-ccf-form-manager.php:182
471
  msgid "Form Notifications"
472
  msgstr ""
473
 
474
+ #: ../classes/class-ccf-form-manager.php:185
475
  msgid "Send Email Notifications:"
476
  msgstr ""
477
 
478
+ #: ../classes/class-ccf-form-manager.php:188
479
+ #: ../classes/class-ccf-form-manager.php:299
480
+ #: ../classes/class-ccf-form-manager.php:349
481
+ #: ../classes/class-ccf-form-manager.php:425
482
+ #: ../classes/class-ccf-form-manager.php:515
483
+ #: ../classes/class-ccf-form-manager.php:580
484
+ #: ../classes/class-ccf-form-manager.php:622
485
+ #: ../classes/class-ccf-form-manager.php:683
486
+ #: ../classes/class-ccf-form-manager.php:730
487
+ #: ../classes/class-ccf-form-manager.php:772
488
+ #: ../classes/class-ccf-form-manager.php:779
489
+ #: ../classes/class-ccf-form-manager.php:830
490
+ #: ../classes/class-ccf-form-manager.php:873
491
+ #: ../classes/class-ccf-form-manager.php:916
492
  msgid "Yes"
493
  msgstr ""
494
 
495
+ #: ../classes/class-ccf-form-manager.php:189
496
+ #: ../classes/class-ccf-form-manager.php:300
497
+ #: ../classes/class-ccf-form-manager.php:350
498
+ #: ../classes/class-ccf-form-manager.php:426
499
+ #: ../classes/class-ccf-form-manager.php:516
500
+ #: ../classes/class-ccf-form-manager.php:581
501
+ #: ../classes/class-ccf-form-manager.php:623
502
+ #: ../classes/class-ccf-form-manager.php:684
503
+ #: ../classes/class-ccf-form-manager.php:731
504
+ #: ../classes/class-ccf-form-manager.php:773
505
+ #: ../classes/class-ccf-form-manager.php:780
506
+ #: ../classes/class-ccf-form-manager.php:831
507
+ #: ../classes/class-ccf-form-manager.php:874
508
+ #: ../classes/class-ccf-form-manager.php:917
509
  msgid "No"
510
  msgstr ""
511
 
512
+ #: ../classes/class-ccf-form-manager.php:194
513
  msgid "\"To\" Email Addresses (comma separated):"
514
  msgstr ""
515
 
516
+ #: ../classes/class-ccf-form-manager.php:199
517
  msgid "\"From\" Email Address Type:"
518
  msgstr ""
519
 
520
+ #: ../classes/class-ccf-form-manager.php:201
521
  msgid "WordPress Default"
522
  msgstr ""
523
 
524
+ #: ../classes/class-ccf-form-manager.php:202
525
  msgid "Custom Email"
526
  msgstr ""
527
 
528
+ #: ../classes/class-ccf-form-manager.php:203
529
  msgid "Form Field"
530
  msgstr ""
531
 
532
+ #: ../classes/class-ccf-form-manager.php:206
533
  msgid ""
534
  "You can set the notification emails from address to be the WP default, a "
535
  "custom email address, or pull the address from a field in the form."
536
  msgstr ""
537
 
538
+ #: ../classes/class-ccf-form-manager.php:210
539
  msgid "Custom \"From\" Email Address:"
540
  msgstr ""
541
 
542
+ #: ../classes/class-ccf-form-manager.php:215
543
  msgid "Pull \"From\" Email Dynamically from Field:"
544
  msgstr ""
545
 
546
+ #: ../classes/class-ccf-form-manager.php:229
547
  msgid "items"
548
  msgstr ""
549
 
550
+ #: ../classes/class-ccf-form-manager.php:244
551
+ #: ../classes/class-ccf-form-manager.php:257
552
  msgid "ID"
553
  msgstr ""
554
 
555
+ #: ../classes/class-ccf-form-manager.php:245
556
+ #: ../classes/class-ccf-form-manager.php:258
557
  msgid "Title"
558
  msgstr ""
559
 
560
+ #: ../classes/class-ccf-form-manager.php:272
561
  msgid "<span>&larr;</span> Click on a field to edit it."
562
  msgstr ""
563
 
564
+ #: ../classes/class-ccf-form-manager.php:281
565
+ #: ../classes/class-ccf-form-manager.php:325
566
+ #: ../classes/class-ccf-form-manager.php:407
567
+ #: ../classes/class-ccf-form-manager.php:497
568
  msgid "Internal Unique Slug"
569
  msgstr ""
570
 
571
+ #: ../classes/class-ccf-form-manager.php:285
572
+ #: ../classes/class-ccf-form-manager.php:329
573
+ #: ../classes/class-ccf-form-manager.php:372
574
+ #: ../classes/class-ccf-form-manager.php:411
575
+ #: ../classes/class-ccf-form-manager.php:501
576
+ #: ../classes/class-ccf-form-manager.php:570
577
+ #: ../classes/class-ccf-form-manager.php:606
578
+ #: ../classes/class-ccf-form-manager.php:662
579
+ #: ../classes/class-ccf-form-manager.php:713
580
+ #: ../classes/class-ccf-form-manager.php:756
581
+ #: ../classes/class-ccf-form-manager.php:820
582
+ #: ../classes/class-ccf-form-manager.php:863
583
+ #: ../classes/class-ccf-form-manager.php:906
584
  msgid "Label:"
585
  msgstr ""
586
 
587
+ #: ../classes/class-ccf-form-manager.php:289
588
+ #: ../classes/class-ccf-form-manager.php:333
589
+ #: ../classes/class-ccf-form-manager.php:376
590
+ #: ../classes/class-ccf-form-manager.php:415
591
+ #: ../classes/class-ccf-form-manager.php:505
592
+ #: ../classes/class-ccf-form-manager.php:574
593
+ #: ../classes/class-ccf-form-manager.php:610
594
+ #: ../classes/class-ccf-form-manager.php:666
595
+ #: ../classes/class-ccf-form-manager.php:717
596
+ #: ../classes/class-ccf-form-manager.php:760
597
+ #: ../classes/class-ccf-form-manager.php:824
598
+ #: ../classes/class-ccf-form-manager.php:867
599
+ #: ../classes/class-ccf-form-manager.php:910
600
  msgid "Description:"
601
  msgstr ""
602
 
603
+ #: ../classes/class-ccf-form-manager.php:293
604
+ #: ../classes/class-ccf-form-manager.php:419
605
+ #: ../classes/class-ccf-form-manager.php:509
606
+ #: ../classes/class-ccf-form-manager.php:545
607
+ #: ../classes/class-ccf-form-manager.php:615
608
+ #: ../classes/class-ccf-form-manager.php:670
609
+ #: ../classes/class-ccf-form-manager.php:765
610
  msgid "Initial Value:"
611
  msgstr ""
612
 
613
+ #: ../classes/class-ccf-form-manager.php:297
614
+ #: ../classes/class-ccf-form-manager.php:347
615
+ #: ../classes/class-ccf-form-manager.php:423
616
+ #: ../classes/class-ccf-form-manager.php:513
617
+ #: ../classes/class-ccf-form-manager.php:578
618
+ #: ../classes/class-ccf-form-manager.php:620
619
+ #: ../classes/class-ccf-form-manager.php:681
620
+ #: ../classes/class-ccf-form-manager.php:728
621
+ #: ../classes/class-ccf-form-manager.php:770
622
+ #: ../classes/class-ccf-form-manager.php:828
623
+ #: ../classes/class-ccf-form-manager.php:871
624
+ #: ../classes/class-ccf-form-manager.php:914
625
  msgid "Required:"
626
  msgstr ""
627
 
628
+ #: ../classes/class-ccf-form-manager.php:306
629
+ #: ../classes/class-ccf-form-manager.php:356
630
+ #: ../classes/class-ccf-form-manager.php:392
631
+ #: ../classes/class-ccf-form-manager.php:432
632
+ #: ../classes/class-ccf-form-manager.php:457
633
+ #: ../classes/class-ccf-form-manager.php:482
634
+ #: ../classes/class-ccf-form-manager.php:522
635
+ #: ../classes/class-ccf-form-manager.php:551
636
+ #: ../classes/class-ccf-form-manager.php:587
637
+ #: ../classes/class-ccf-form-manager.php:637
638
+ #: ../classes/class-ccf-form-manager.php:690
639
+ #: ../classes/class-ccf-form-manager.php:737
640
+ #: ../classes/class-ccf-form-manager.php:786
641
+ #: ../classes/class-ccf-form-manager.php:844
642
+ #: ../classes/class-ccf-form-manager.php:887
643
+ #: ../classes/class-ccf-form-manager.php:930
644
  msgid "Advanced"
645
  msgstr ""
646
 
647
+ #: ../classes/class-ccf-form-manager.php:309
648
+ #: ../classes/class-ccf-form-manager.php:359
649
+ #: ../classes/class-ccf-form-manager.php:395
650
+ #: ../classes/class-ccf-form-manager.php:435
651
+ #: ../classes/class-ccf-form-manager.php:460
652
+ #: ../classes/class-ccf-form-manager.php:485
653
+ #: ../classes/class-ccf-form-manager.php:525
654
+ #: ../classes/class-ccf-form-manager.php:554
655
+ #: ../classes/class-ccf-form-manager.php:590
656
+ #: ../classes/class-ccf-form-manager.php:640
657
+ #: ../classes/class-ccf-form-manager.php:693
658
+ #: ../classes/class-ccf-form-manager.php:740
659
+ #: ../classes/class-ccf-form-manager.php:789
660
+ #: ../classes/class-ccf-form-manager.php:847
661
+ #: ../classes/class-ccf-form-manager.php:890
662
+ #: ../classes/class-ccf-form-manager.php:933
663
  msgid "Class Name:"
664
  msgstr ""
665
 
666
+ #: ../classes/class-ccf-form-manager.php:313
667
+ #: ../classes/class-ccf-form-manager.php:439
668
+ #: ../classes/class-ccf-form-manager.php:529
669
+ #: ../classes/class-ccf-form-manager.php:645
670
+ #: ../classes/class-ccf-form-manager.php:697
671
+ #: ../classes/class-ccf-form-manager.php:794
672
  msgid "Placeholder Text:"
673
  msgstr ""
674
 
675
+ #: ../classes/class-ccf-form-manager.php:337
676
  msgid "Allowed File Extensions (comma separate):"
677
  msgstr ""
678
 
679
+ #: ../classes/class-ccf-form-manager.php:339
680
  msgid ""
681
  "If left blank, will default to all extensions registered by WordPress. If "
682
  "you use a file extension or mime type not <a href=\"http://codex.wordpress."
684
  "a>, you will need to filter and manually whitelist the new extension."
685
  msgstr ""
686
 
687
+ #: ../classes/class-ccf-form-manager.php:342
688
  msgid "Max File Size (in MB):"
689
  msgstr ""
690
 
691
+ #: ../classes/class-ccf-form-manager.php:344
692
  #, php-format
693
  msgid ""
694
  "If left blank, will default to %d MB. Maximum allowed by server is %d MB."
695
  msgstr ""
696
 
697
+ #: ../classes/class-ccf-form-manager.php:370
698
  msgid ""
699
  "reCAPTCHA is a simple captcha service provided by Google. <a target=\"_blank"
700
  "\" href=\"https://www.google.com/recaptcha/intro/index.html\">Learn more</a>"
701
  msgstr ""
702
 
703
+ #: ../classes/class-ccf-form-manager.php:380
704
  msgid "Site Key:"
705
  msgstr ""
706
 
707
+ #: ../classes/class-ccf-form-manager.php:382
708
+ #: ../classes/class-ccf-form-manager.php:387
709
  msgid "Don't have one?"
710
  msgstr ""
711
 
712
+ #: ../classes/class-ccf-form-manager.php:385
713
  msgid "Secret Key:"
714
  msgstr ""
715
 
716
+ #: ../classes/class-ccf-form-manager.php:448
717
+ #: ../classes/class-ccf-form-manager.php:469
718
+ #: ../classes/class-ccf-form-manager.php:494
719
+ #: ../classes/class-ccf-form-manager.php:538
720
+ #: ../classes/class-ccf-form-manager.php:563
721
+ #: ../classes/class-ccf-form-manager.php:599
722
+ #: ../classes/class-ccf-form-manager.php:655
723
+ #: ../classes/class-ccf-form-manager.php:706
724
+ #: ../classes/class-ccf-form-manager.php:749
725
+ #: ../classes/class-ccf-form-manager.php:813
726
+ #: ../classes/class-ccf-form-manager.php:856
727
+ #: ../classes/class-ccf-form-manager.php:899
728
  msgid "Basic"
729
  msgstr ""
730
 
731
+ #: ../classes/class-ccf-form-manager.php:451
732
  msgid "HTML Content:"
733
  msgstr ""
734
 
735
+ #: ../classes/class-ccf-form-manager.php:472
736
  msgid "Heading:"
737
  msgstr ""
738
 
739
+ #: ../classes/class-ccf-form-manager.php:476
740
  msgid "Sub Heading:"
741
  msgstr ""
742
 
743
+ #: ../classes/class-ccf-form-manager.php:541
744
+ #: ../classes/class-ccf-form-manager.php:566
745
+ #: ../classes/class-ccf-form-manager.php:602
746
+ #: ../classes/class-ccf-form-manager.php:658
747
+ #: ../classes/class-ccf-form-manager.php:709
748
+ #: ../classes/class-ccf-form-manager.php:752
749
+ #: ../classes/class-ccf-form-manager.php:816
750
+ #: ../classes/class-ccf-form-manager.php:859
751
+ #: ../classes/class-ccf-form-manager.php:902
752
  msgid "Internal Unique Slug (a-z, 0-9, -, _):"
753
  msgstr ""
754
 
755
+ #: ../classes/class-ccf-form-manager.php:628
756
  msgid "Enable Date Select"
757
  msgstr ""
758
 
759
+ #: ../classes/class-ccf-form-manager.php:632
760
  msgid "Enable Time Select"
761
  msgstr ""
762
 
763
+ #: ../classes/class-ccf-form-manager.php:674
764
  msgid "Format:"
765
  msgstr ""
766
 
767
+ #: ../classes/class-ccf-form-manager.php:677
768
+ #: ../classes/class-ccf-form-manager.php:724
769
  msgid "International"
770
  msgstr ""
771
 
772
+ #: ../classes/class-ccf-form-manager.php:721
773
  msgid "Type:"
774
  msgstr ""
775
 
776
+ #: ../classes/class-ccf-form-manager.php:723
777
  msgid "United States"
778
  msgstr ""
779
 
780
+ #: ../classes/class-ccf-form-manager.php:777
781
  msgid "Require Confirmation:"
782
  msgstr ""
783
 
784
+ #: ../classes/class-ccf-form-manager.php:805
785
  msgid "Label"
786
  msgstr ""
787
 
788
+ #: ../classes/class-ccf-form-manager.php:806
789
  msgid "Value"
790
  msgstr ""
791
 
792
+ #: ../classes/class-ccf-form-manager.php:835
793
+ #: ../classes/class-ccf-form-manager.php:878
794
+ #: ../classes/class-ccf-form-manager.php:921
795
  msgid "Manage field choices:"
796
  msgstr ""
797
 
798
+ #: ../classes/class-ccf-form-manager.php:839
799
+ #: ../classes/class-ccf-form-manager.php:882
800
+ #: ../classes/class-ccf-form-manager.php:925
801
  msgid ""
802
  "Note: If an option does not have a \"value\", it will not be considered a "
803
  "valid selection if the field is required. The \"value\" is what's read, "
804
  "stored, and displayed in the submission."
805
  msgstr ""
806
 
807
+ #: ../classes/class-ccf-form-manager.php:942
808
  msgid "You currently have no forms. Add some!"
809
  msgstr ""
810
 
811
+ #: ../classes/class-ccf-form-manager.php:965
812
  msgid "Allowed file extensions are {{ extensions }}. "
813
  msgstr ""
814
 
815
+ #: ../classes/class-ccf-form-manager.php:967
816
  msgid "Max file size is {{ file_size }} MB. "
817
  msgstr ""
818
 
819
+ #: ../classes/class-ccf-form-manager.php:992
 
820
  #: ../classes/class-ccf-form-manager.php:1008
821
+ #: ../classes/class-ccf-form-manager.php:1026
822
  msgid "An example choice"
823
  msgstr ""
824
 
825
+ #: ../classes/class-ccf-form-manager.php:1044
826
  msgid "Arbitrary block of HTML."
827
  msgstr ""
828
 
829
+ #: ../classes/class-ccf-form-manager.php:1050
830
  msgid "Section Heading"
831
  msgstr ""
832
 
833
+ #: ../classes/class-ccf-form-manager.php:1052
834
  msgid "This is the sub-heading text."
835
  msgstr ""
836
 
837
+ #: ../classes/class-ccf-form-manager.php:1059
838
  msgid "First"
839
  msgstr ""
840
 
841
+ #: ../classes/class-ccf-form-manager.php:1063
842
  msgid "Last"
843
  msgstr ""
844
 
845
+ #: ../classes/class-ccf-form-manager.php:1123
846
+ #: ../classes/class-ccf-form-manager.php:1148
847
  msgid "Street Address"
848
  msgstr ""
849
 
850
+ #: ../classes/class-ccf-form-manager.php:1127
851
+ #: ../classes/class-ccf-form-manager.php:1152
852
  msgid "Address Line 2"
853
  msgstr ""
854
 
855
+ #: ../classes/class-ccf-form-manager.php:1131
856
+ #: ../classes/class-ccf-form-manager.php:1156
857
  msgid "City"
858
  msgstr ""
859
 
860
+ #: ../classes/class-ccf-form-manager.php:1139
861
  msgid "State"
862
  msgstr ""
863
 
864
+ #: ../classes/class-ccf-form-manager.php:1143
865
  msgid "ZIP Code"
866
  msgstr ""
867
 
868
+ #: ../classes/class-ccf-form-manager.php:1160
869
  msgid "State / Region / Province"
870
  msgstr ""
871
 
872
+ #: ../classes/class-ccf-form-manager.php:1164
873
  msgid "ZIP / Postal Code"
874
  msgstr ""
875
 
876
+ #: ../classes/class-ccf-form-manager.php:1172
877
  msgid "Country"
878
  msgstr ""
879
 
880
+ #: ../classes/class-ccf-form-manager.php:1183
881
  msgid "email@example.com"
882
  msgstr ""
883
 
884
+ #: ../classes/class-ccf-form-manager.php:1187
885
+ #: ../classes/class-ccf-form-manager.php:1482
886
  msgid "Email"
887
  msgstr ""
888
 
889
+ #: ../classes/class-ccf-form-manager.php:1191
890
  msgid "Confirm Email"
891
  msgstr ""
892
 
893
+ #: ../classes/class-ccf-form-manager.php:1221
894
  msgid "Edit"
895
  msgstr ""
896
 
897
+ #: ../classes/class-ccf-form-manager.php:1223
898
  msgid "Trash"
899
  msgstr ""
900
 
901
+ #: ../classes/class-ccf-form-manager.php:1266
902
  msgid "There is a problem with this form. Is it trashed or deleted?"
903
  msgstr ""
904
 
905
+ #: ../classes/class-ccf-form-manager.php:1414
906
  msgid "There are no submissions."
907
  msgstr ""
908
 
909
+ #: ../classes/class-ccf-form-manager.php:1443
910
  msgid "Add Form"
911
  msgstr ""
912
 
913
+ #: ../classes/class-ccf-form-manager.php:1467
914
  msgid "Single Line Text"
915
  msgstr ""
916
 
917
+ #: ../classes/class-ccf-form-manager.php:1468
918
  msgid "Dropdown"
919
  msgstr ""
920
 
921
+ #: ../classes/class-ccf-form-manager.php:1469
922
  msgid "Checkboxes"
923
  msgstr ""
924
 
925
+ #: ../classes/class-ccf-form-manager.php:1470
926
  msgid "Radio Buttons"
927
  msgstr ""
928
 
929
+ #: ../classes/class-ccf-form-manager.php:1471
930
  msgid "Paragraph Text"
931
  msgstr ""
932
 
933
+ #: ../classes/class-ccf-form-manager.php:1472
934
  msgid "Hidden"
935
  msgstr ""
936
 
937
+ #: ../classes/class-ccf-form-manager.php:1473
938
  msgid "File Upload"
939
  msgstr ""
940
 
941
+ #: ../classes/class-ccf-form-manager.php:1477
942
  msgid "HTML"
943
  msgstr ""
944
 
945
+ #: ../classes/class-ccf-form-manager.php:1478
946
  msgid "Section Header"
947
  msgstr ""
948
 
949
+ #: ../classes/class-ccf-form-manager.php:1483
950
  msgid "Name"
951
  msgstr ""
952
 
953
+ #: ../classes/class-ccf-form-manager.php:1484
954
  msgid "Date/Time"
955
  msgstr ""
956
 
957
+ #: ../classes/class-ccf-form-manager.php:1485
958
  msgid "Website"
959
  msgstr ""
960
 
961
+ #: ../classes/class-ccf-form-manager.php:1486
962
  msgid "Address"
963
  msgstr ""
964
 
965
+ #: ../classes/class-ccf-form-manager.php:1487
966
  msgid "Phone"
967
  msgstr ""
968
 
969
+ #: ../classes/class-ccf-form-manager.php:1488
970
  msgid "reCAPTCHA"
971
  msgstr ""
972
 
973
+ #: ../classes/class-ccf-form-manager.php:1505
974
  msgid "You have no email fields"
975
  msgstr ""
976
 
977
+ #: ../classes/class-ccf-form-manager.php:1506
978
  msgid "Invalid date"
979
  msgstr ""
980
 
981
+ #: ../classes/class-ccf-form-manager.php:1508
982
  msgid "Form Submission"
983
  msgstr ""
984
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: contact form, web form, custom contact form, custom forms, captcha form, contact fields, form mailers, forms
5
  Requires at least: 3.9
6
  Tested up to: 4.2
7
- Stable tag: 6.4.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -35,6 +35,9 @@ For questions, feature requests, and support concerning the Custom Contact Forms
35
 
36
  == Changelog ==
37
 
 
 
 
38
  = 6.4.5 =
39
  * Add error modal to explain when the plugin is not working.
40
 
4
  Tags: contact form, web form, custom contact form, custom forms, captcha form, contact fields, form mailers, forms
5
  Requires at least: 3.9
6
  Tested up to: 4.2
7
+ Stable tag: 6.4.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
35
 
36
  == Changelog ==
37
 
38
+ = 6.4.6 =
39
+ * Add error modal text for HTTP 501 error code
40
+
41
  = 6.4.5 =
42
  * Add error modal to explain when the plugin is not working.
43