| Server IP : 69.39.225.240 / Your IP : 216.73.216.138 Web Server : Apache System : Linux bronze7.serverhost.net 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64 User : reademotions ( 1074) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/reademotions/www/wp-content/plugins/gravityformshubspot/js/ |
Upload File : |
jQuery(document).ready(function(){new GFOwnerSetting});var legacyUI=gform_hubspot_owner_settings_strings.legacy_ui,prefix={input:legacyUI?"_gaddon_setting_":"_gform_setting_",field:legacyUI?"gaddon-setting-row-":"gform_setting_"};function GFOwnerSetting(){var n=jQuery;this.init=function(){this.initOwner(),new GFConditionsSetting},this.initOwner=function(){var t=this;n("#contact_owner0, #contact_owner1, #contact_owner2").on("change",function(){t.toggleOwner(!0)}),this.toggleOwner(!1)},this.toggleOwner=function(t){var e=["#"+prefix.field+"contact_owner_select","#"+prefix.field+"contact_owner_conditional"],i=n(".contact_owner_section"),o=n('input[name="'+prefix.input+'contact_owner"]:checked').val();n(e.join(", ")).hide(),"none"===o?t&&legacyUI?i.slideUp():i.hide():(i.is(":hidden")&&(t&&legacyUI?i.slideDown():i.show()),n("#"+prefix.field+"contact_owner_"+o).show())},this.init()}function GFConditionsSetting(){var r=jQuery;this.$element=jQuery("#gform_conditions_setting"),this.fieldId="conditions",this.fieldName=prefix.input+"conditions",this.options=null,this.init=function(){var n=this,t=(this.options={fieldName:this.fieldName,fieldId:this.fieldId,fields:gform_hubspot_owner_settings_strings.fields,owners:gform_hubspot_owner_settings_strings.owners,imagesURL:gf_vars.baseUrl+"/images",items:this.getItems(),operatorStrings:{is:"is",isnot:"isNot",">":"greaterThan","<":"lessThan",contains:"contains",starts_with:"startsWith",ends_with:"endsWith"}},t=(t=(t='<thead><tr><th class="gform-routings__heading gform-routings__heading--assign">{0}</th>')+'<th class="gform-routings__heading gform-routings__heading--condition" colspan="3">{1}</th>'+"</tr></thead>").format(gform_hubspot_owner_settings_strings.assign_to,gform_hubspot_owner_settings_strings.condition),t='<table class="gform-routings">{0}<tbody class="repeater">{1}</tbody></table>'.format(t,this.getNewRow()),r(t));t.find(".repeater").repeater({limit:0,items:this.options.items,addButtonMarkup:'<i class="gficon-add"></i>',removeButtonMarkup:'<i class="gficon-subtract"></i>',callbacks:{save:function(t,e){r("#"+n.options.fieldId).val(r.toJSON(e))},beforeAdd:function(t,e,i){i.owner&&e.find(".gform-routing-owners").val(i.owner);var o=e.find(".gform-routing-field").first(),o=(o.value=i.fieldId,n.changeField(o),e.find(".gform-routing-operator").first());o.value=i.operator,n.changeOperator(o),e.find(".gform-routing-value").val(i.value)}}}).on("change",".gform-routing-field",function(t){n.changeField(this)}).on("change",".gform-routing-operator",function(){n.changeOperator(this)}),this.$element.append(t)},this.getNewRow=function(){var t=[];return t.push("<td>{0}</td>".format(this.getOwners())),t.push("<td>{0}</td>".format(this.getFields())),t.push("<td>{0}</td>".format(this.getOperators(this.options.fields[0]))),t.push("<td>{0}</td>".format(this.getValues())),t.push('<td class="gform-routings-field gform-routings-field__buttons">{buttons}</td>'),'<tr class="gform-routing-row">{0}</tr>'.format(t.join(""))},this.getOwners=function(){for(var t=this.options.owners,e='<select class="gform-routing-owners owner_{i}">',i=0;i<t.length;i++)e+='<option value="{0}">{1}</option>'.format(t[i].value,t[i].label);return e+="</select>"},this.getFields=function(){var t,e,i,o,n,r,s,a,l=[],f=this.options.fields;for(l.push('<select class="gform-routing-field fieldId_{i}" >'),t=0;t<f.length;t++)if(i=f[t].key,f[t].group){for(r=f[t].text,a=f[t].filters.length,s=[],e=0;e<a;e++)n=f[t].filters[e].text,o=f[t].filters[e].key,s.push('<option value="{0}">{1}</option>'.format(o,n));l.push('<optgroup label="{0}">{1}</optgroup>'.format(r,s.join("")))}else n=f[t].text,l.push('<option value="{0}">{1}</option>'.format(i,n));return l.push("</select>"),l.join("")},this.changeOperator=function(t){var e=r(t),i=e.closest("tr").find(".repeater-buttons").find(".add-item ").data("index"),o=e.closest("tr").find(".gform-routing-field"),o=this.getFilter(o.value);o&&e.closest("tr").find(".gform-routing-value").replaceWith(this.getValues(o,t.value,i))},this.changeField=function(t){var e,i=this.getFilter(t.value);i&&(e=(t=r(t)).closest("tr").find(".repeater-buttons").find(".add-item ").data("index"),t.closest("tr").find(".gform-routing-value").replaceWith(this.getValues(i,null,e)),t.closest("tr").find(".gform-filter-type").val(i.type).change(),i=r(this.getOperators(i,e)),t.closest("tr").find(".gform-routing-operator").replaceWith(i),t.closest("tr").find(".gform-routing-operator").change())},this.getOperators=function(t,e){var i,o,n=this.options.operatorStrings,r='<select class="gform-routing-operator operator_{0}">'.format(e=null==e?"{i}":e);if(t)for(i=0;i<t.operators.length;i++)o=t.operators[i],r+='<option value="{0}">{1}</option>'.format(o,gf_vars[n[o]]);return r+="</select>"},this.getValues=function(t,e,i){var o,n,r,s,a="";if(null==i&&(i="{i}"),t&&t.values&&"contains"!=e){for(o=0;o<t.values.length;o++)n=t.values[o].value,r=t.values[o].text,a+='<option value="{0}">{1}</option>'.format(n,r);s='<select class="gform-routing-value value_{0}">{1}</select>'.format(i,a)}else s='<input type="text" value="" class="gform-routing-value value_{0}" />'.format(i);return s},this.getFilter=function(t){var e=this.options.fields;if(t)for(var i=0;i<e.length;i++){if(t==e[i].key)return e[i];if(e[i].group)for(var o=0;o<e[i].filters.length;o++)if(t==e[i].filters[o].key)return e[i].filters[o]}},this.selected=function(t,e){return t==e?'selected="selected"':""},this.getItems=function(){var t=r("#"+this.fieldId).val();return t?r.parseJSON(t):[{owner:"",fieldId:"0",operator:"is",value:""}]},this.init(),String.prototype.format=function(){var i=arguments;return this.replace(/{(\d+)}/g,function(t,e){return void 0!==i[e]?i[e]:t})}}