1 line
11 KiB
JavaScript
1 line
11 KiB
JavaScript
|
|
!function(p,m){"use strict";function k(t,i){var e=m("#gaddon-setting-tab-field-"+i+"_notification_type");(e.toggle(t),t)?(o(e.find("input[type=radio]:checked").val(),i),m("#gaddon-setting-tab-tab_"+i+"_notification i.gravityflow-tab-checked").show(),m("#gaddon-setting-tab-tab_"+i+"_notification i.gravityflow-tab-unchecked").hide()):(o("off",i),m("#gaddon-setting-tab-tab_"+i+"_notification i.gravityflow-tab-checked").hide(),m("#gaddon-setting-tab-tab_"+i+"_notification i.gravityflow-tab-unchecked").show())}function o(e,t){var i=["users","routing","from_name","from_email","reply_to","bcc","subject","message","autoformat","resend","gpdf"],o="#gaddon-setting-tab-field-"+t+"_notification_";m.each(i,function(t,i){m(o+i).hide()}),"off"!=e&&m.each(i,function(t,i){if("users"==i&&"routing"==e||"routing"==i&&"select"==e)return!0;m(o+i).fadeToggle("normal")})}function v(t){i({select:["workflow_notification_users\\[\\]","workflow_notification_from_name","workflow_notification_from_email","workflow_notification_reply_to","workflow_notification_bcc","workflow_notification_subject","workflow_notification_message","workflow_notification_autoformat"],routing:["workflow_notification_routing","workflow_notification_from_name","workflow_notification_from_email","workflow_notification_reply_to","workflow_notification_bcc","workflow_notification_subject","workflow_notification_message","workflow_notification_autoformat"]},t,!1)}function b(t){i({select:["assignees\\[\\]","editable_fields\\[\\]","conditional_logic_editable_fields_enabled"],routing:["routing","conditional_logic_editable_fields_enabled"]},t)}function i(t,e,i){var o=i?"#gaddon-setting-tab-field-":"#gaddon-setting-row-";m.each(t,function(t,i){m.each(i,function(t,i){m(o+i).hide()})}),m.each(t,function(t,i){e==t&&m.each(i,function(t,i){m(o+i).fadeToggle("normal")})})}function h(t){var i=m("#gaddon-setting-row-workflow_notification_type");(i.toggle(t),t)?v(i.find("input[type=radio]:checked").val()):v("off")}m(document).ready(function(){m("#editable_fields, .gravityflow-multiselect-ui").multiSelect();var r={selectableHeader:"<input type='text' class='search-input' autocomplete='off' placeholder='"+gravityflow_form_settings_js_strings.assigneeSearchPlaceholder+"'>",selectionHeader:"<input type='text' class='search-input' autocomplete='off' placeholder='"+gravityflow_form_settings_js_strings.assigneeSearchPlaceholder+"'>",afterInit:function(t){var i=this,e=i.$selectableUl.prev(),o=i.$selectionUl.prev(),n="#"+t.attr("id")+" .ms-elem-selectable:not(.ms-selected)",a="#"+t.attr("id")+" .ms-elem-selection.ms-selected";10<m("#"+t.attr("id")+" .ms-elem-selectable").length&&m(".ms-container .search-input").show(),i.qs1=e.quicksearch(n).on("keydown",function(t){if(40===t.which)return i.$selectableUl.focus(),!1}),i.qs2=o.quicksearch(a).on("keydown",function(t){if(40==t.which)return i.$selectionUl.focus(),!1})},afterSelect:function(){this.qs1.cache(),this.qs2.cache()},afterDeselect:function(){this.qs1.cache(),this.qs2.cache()}};m("#assignees, #workflow_notification_users").multiSelect(r);var t=!1,i=!1;m("form#gform-settings").submit(function(){i=!0,m("form#gform-settings").find(":input").removeAttr("disabled")}),m(":input").change(function(){t=!0}),window.onbeforeunload=function(){if(t&&!i)return"You have unsaved changes."};m("input[name=_gaddon_setting_step_type]:checked").val();var e=m("#status_expiration"),o="expired"==e.val();m("#expiration_sub_setting_destination_expired").toggle(o),e.change(function(){var t="expired"==m(this).val();m("#expiration_sub_setting_destination_expired").fadeToggle(t)}),function(){for(var t=["routing","assignees\\[\\]","assignee_notification_from_name","assignee_notification_from_email","assignee_notification_reply_to","assignee_notification_bcc","assignee_notification_subject","assignee_notification_message","assignee_notification_autoformat","resend_assignee_email","assignee_notification_gpdf","rejection_notification_type","rejection_notification_users\\[\\]","rejection_notification_user_field","rejection_notification_routing","rejection_notification_message","reje
|