PageSourceSearch

https://bobcares.com/wp-content/plugins/auto-advance-for-gravity-forms/js/gfaa-admin.js?ver=5.0.4

js bobcares.com collected 2026-09-24 15:26:32 UTC 11,853 bytes, 379 lines download raw bytes

1jQuery(document).ready(function($) {
2	
3	jQuery(document).on('click', '.aafg-notice .notice-dis', function(){ 
4		$( this ).parents('.aafg-notice').find('.notice-dismiss').click();
5	});
6	jQuery(document).on('click', '.aafg-notice .notice-dismiss', function(){ 
7		
8		var notice_id = $( this ).parents('.aafg-notice').attr( 'id' ) || '';
9		jQuery.ajax({
10			url: aafg.ajaxurl,
11			type: 'POST',
12			data: {
13				action            : 'aafg-notice-dismiss',
14				notice_id         : notice_id,
15			},
16		});
17	});
18	
19	
20	if( $("#toplevel_page_gf_edit_forms .auto-advance-for-gravity-forms.pricing.upgrade-mode").length > 0) {
21		$("#toplevel_page_gf_edit_forms .auto-advance-for-gravity-forms.pricing.upgrade-mode").parent().attr("href", "https://multipagepro.com/").attr("target", "_blank");
22	}
23	
24	
25	if( $('.gfaa-cg-field').length ) {
26		
27		$('.gfaa-cg-field input').wpColorPicker();
28	}
29	
30	
31	function gfaa_perform_hide_show() {
32		
33		if( ! $('[name=_gform_setting_gfaa_type]').length ) {
34			return;
35			
36		}
37		
38		var _gform_setting_gfaa_type = $('[name=_gform_setting_gfaa_type]');
39		var _gform_setting_enable_animation = $('input[name=_gform_setting_enable_animation]');
40		var _gform_setting_enable_step_colors = $('input[name=_gform_setting_enable_step_colors]');
41		var _gform_setting_enable_conversational = $('input[name=_gform_setting_enable_conversational]');
42		
43		/*if( _gform_setting_enable_conversational.val() == 1 ) {
44			
45			if( _gform_setting_enable_animation.val() == 0 ) {
46				_gform_setting_enable_animation.prop('checked', true);
47				_gform_setting_enable_animation.trigger('change');
48			}
49			$('#gform-settings-section-step-colors-settings').hide();
50		}*/
51		
52		if( _gform_setting_enable_animation.val() == 1 ) {
53			
54			if( _gform_setting_enable_conversational.val() == 1 ) {
55				$('#gform-settings-section-step-colors-settings').hide();
56			}
57			else {
58				$('#gform-settings-section-step-colors-settings').show();
59			}
60			
61		}
62		
63		/*if( _gform_setting_enable_animation.val() == 0 ) {
64			$('#gform-settings-section-step-colors-settings').hide();
65		}*/
66		
67		
68		$('#gform-settings-section-pro-features-walkthrough').hide();
69		$('#gform-settings-section-plus-features-walkthrough').hide();
70		$('#gform-settings-section-basic-features-walkthrough').hide();
71		$('.gform-settings-save-container').show();
72		
73		
74		if( _gform_setting_gfaa_type.val() == 'basic' ) {
75			$('#gform-settings-section-step-colors-settings').hide();
76			$('#gform-settings-section-conversational-form-settings').hide();
77			$('#gform-settings-section-animation-settings').hide();
78			$('#gform-settings-section-basic-features-walkthrough').show();
79		}
80		if( _gform_setting_gfaa_type.val() == 'animationed' ) {
81			$('#gform-settings-section-step-colors-settings').show();
82			$('#gform-settings-section-conversational-form-settings').hide();
83			$('#gform-settings-section-animation-settings').show();
84			$('#gform-settings-section-pro-features-walkthrough').show();			
85		}
86		if( _gform_setting_gfaa_type.val() == 'conversational' ) {
87			$('#gform-settings-section-step-colors-settings').hide();
88			$('#gform-settings-section-conversational-form-settings').show();
89			$('#gform-settings-section-animation-settings').show();
90			$('#gform-settings-section-plus-features-walkthrough').show();
91		}
92		
93		if( _gform_setting_gfaa_type.val() == 'proautoadvance' ) {
94			$('#gform-settings-section-pro-features-walkthrough').show();
95			$('#gform-settings-section-step-colors-settings').hide();
96			$('#gform-settings-section-conversational-form-settings').hide();
97			$('#gform-settings-section-animation-settings').hide();
98			$('#gform-settings-save').attr('disabled', 'disabled');
99			$('.gform-settings-save-container').hide();
100		}
101		if( _gform_setting_gfaa_type.val() == 'plusautoadvance' ) {
102			$('#gform-settings-section-plus-features-walkthrough').show();
103			$('#gform-settings-section-step-colors-settings').hide();
104			$('#gform-settings-section-conversational-form-settings').hide();
105			$('#gform-settings-section-animation-settings').hide();
106			$('#gform-settings-save').attr('disabled', 'disabled');
107			$('.gform-settings-save-container').hide();
108		}
109		
110		
111		
112		$connections = [ 
113			'animation' 
114		];
115		$action = _gform_setting_enable_animation.val() == 1 ? 'show' : 'hide';
116		gfa_hide_show_inner_elements( $connections, $action );
117		
118		
119		$connections = [ 
120			'active-step-color-fields', 'inactive-step-color-fields', 'completed-step-color-fields'
121		];
122		$action = _gform_setting_enable_step_colors.val() == 1 ? 'show' : 'hide';
123		gfa_hide_show_inner_elements( $connections, $action );
124		
125		
126		$connections = [ 
127			'page', 'cover-image', 'logo-image', 'conversational-layout', 'side-image', 'intro_heading', 'intro_description', 'side-image', 'form_style'	
128		];
129		$action = _gform_setting_enable_conversational.val() == 1 ? 'show' : 'hide';
130		gfa_hide_show_inner_elements( $connections, $action );
131		
132		if( _gform_setting_enable_conversational.val() == 1 && _gform_setting_gfaa_type.val() == 'conversational') {
133			
134			$connections = [ 
135				'cover-image'
136			];
137			$action = $('[name=_gform_setting_conversational-layout]').val() == 'bgimage' ? 'show' : 'hide';
138			// console.log( $action );
139			gfa_hide_show_inner_elements( $connections, $action );
140			
141			
142			$connections = [ 
143				'side-image'
144			];
145			$action = $('[name=_gform_setting_conversational-layout]').val() == 'leftimage' || $('[name=_gform_setting_conversational-layout]').val() == 'rightimage'  ? 'show' : 'hide';
146			
147			gfa_hide_show_inner_elements( $connections, $action );
148		}
149		
150		
151	}
152	
153	
154	function gfa_hide_show_inner_elements( $connections, $action ) {
155		$.each($connections, function(i, e) {
156			
157			if( $action == 'show' ) {
158				$('#gform_setting_' + e ).show();
159			}
160			else {
161				$('#gform_setting_' + e ).hide();
162			}
163		});
164	}
165	
166	
167	function aagf_check_premium_field(field) {
168		
169		var result = false;
170		
171		if( typeof aafg.prem != 'undefined' ) {
172		
173			prem = aafg.prem;
174			
175			if( typeof prem[ field.type ] != 'undefined' ) {
176				
177				available_types = prem[ field.type ];
178				
179				if( jQuery.isArray( available_types ) ) {
180					jQuery.each( available_types, function(i, available_type) {
181						if( field.inputType == available_type ) {
182							result = true;
183						}
184					} );
185				}
186				else if( available_types == 'all' || available_types == 1 ) {
187					result = true;
188				}
189			}
190		}
191		
192		return result;
193	}
194	
195	
196	setTimeout(function() {
197		
198		gfaa_perform_hide_show();
199		
200		$('#gform-settings-section-animation-settings .gform-settings-panel__content').slideUp();
201		$('#gform-settings-section-conversational-form-settings .gform-settings-panel__content').slideUp();
202		$('#gform-settings-section-step-colors-settings .gform-settings-panel__content').slideUp();
203	}, 100);
204	
205	
206	$(document).on(
207		'change', 
208		'#enable_animation, #enable_conversational, #enable_step_colors, #gform-settings-section-conversational-form-settings select, #gfaa_type', 
209		function() {
210		setTimeout(gfaa_perform_hide_show, 100);
211	});
212	
213	
214	$(document).on('click', '.gfaa-cg-heading', function() {
215		var $this = $(this);
216		var $parent = $this.parents('.gfaa-cg-wrap');
217		$parent.find('.gfaa-cg-fields').slideToggle(300);
218		setTimeout(function() { $parent.toggleClass('expanded'); }, 100);
219	});
220	
221	$(document).on('click', '#tab_gfaa fieldset.gform-settings-panel > legend', function() {
222		var $this = $(this);
223		var $parent = $this.parent().find('.gform-settings-panel__content').slideToggle(200);
224	});
225	
226	
227	gform.addAction("formEditorNullClick", function(e) {
228		
229		var $target = $(e.target);
230		
231		if( $target.hasClass('custom-button') ) {
232			var custom_uploader = wp.media({
233				title: 'Choose Image',
234				button: {
235					text: 'Choose Image'
236				},
237				multiple: false  // Set this to true to allow multiple files to be selected
238			}).on('select', function() {
239				var attachment = custom_uploader.state().get('selection').first().toJSON();
240				$('#gfac_image_url').val(attachment.url);
241				
242				SetFieldProperty('gfac_image_url', attachment.url);						
243				
244			}).open();
245		}
246	});
247	
248	
249	$(document).on('click', '.custom-button-field', function(e) {
250		
251		e.preventDefault();
252		var $this = $(this);
253		var $parent = $this.parents('.gfaa-field-wrap');
254		
255		var custom_uploader = wp.media({
256			title: 'Choose Image',
257			button: {
258				text: 'Choose Image'
259			},
260			multiple: false  // Set this to true to allow multiple files to be selected
261		}).on('select', function() {
262			var attachment = custom_uploader.state().get('selection').first().toJSON();
263			
264			$parent.find('.gfaa-field-text input').val(attachment.url);					
265			
266		}).open();
267	});
268	
269	
270	$(document).on('input propertychange', '.gfac_image_url', function(){
271		SetFieldProperty('gfac_image_url', this.value);
272	});
273	
274	
275	$(document).bind("gform_load_field_settings", function(event, field, form){
276		
277		if( typeof field.gfac_image_url != 'undefined' ) {
278			$('#gfac_image_url').val(field.gfac_image_url);
279		}
280		else {
281			$('#gfac_image_url').val('');
282		}
283		
284	});
285	
286	
287	$(document).bind('gform_load_field_settings', function(event, field, form){
288				
289		$('#gfaa_tab_tab_toggle').show();
290		$('.gfaa_image_setting.field_setting').show();
291		$('.gfaa_hide_next_button.field_setting').show();
292		$('.gfaa_hidePreviousButton.field_setting').show();
293		
294		
295		$('#hide_next_button').prop('checked', field['hideNextButton'] == true);
296		$('#hidePreviousButton').prop('checked', field['hidePreviousButton'] == true);
297		$('#hideSubmitButton').prop('checked', field['hideSubmitButton'] == true);
298		
299		$('#field_list_value').prop('checked', field['autoAdvancedField'] == true);
300		$('#inputNumberKeys').val(field['inputNumberKeys']);
301		
302		// console.log( aafg );
303		if( typeof aafg.inputNumberKeys_selection_string != 'undefined' ) {
304			if( field.type == 'checkbox' ) {
305				var $change_string = aafg.inputNumberKeys_selection_string;
306				$('.gfaa_inputNumberKeys > label').html($change_string);
307			}
308			else {
309				var $change_string = aafg.inputNumberKeys_inputs_string;
310				$('.gfaa_inputNumberKeys >
310 label').html($change_string);
311			}
312		}
313		
314		var fields = ['radio', 'select'];
315		if ( $.inArray( field.type, fields) !== -1) { 
316			$('.gfaa_inputNumberKeys').hide();
317			$('.gfaa_field_list_value').show();
318		}
319		
320		else if(field.type == 'survey' ) { 
321			var type = $('#gsurvey-field-type').val();
322			var types = ['radio', 'select', 'likert', 'rating'];
323			if ( $.inArray( type, types) !== -1) {
324				$('.gfaa_inputNumberKeys').hide();
325				$('.gfaa_field_list_value').show();
326			}
327			else {
328				$('.gfaa_inputNumberKeys').hide();
329				$('.gfaa_field_list_value').hide();
330			}
331		}
332		
333		else if (typeof aagf_check_premium_field == 'function' && aagf_check_premium_field(field) ) { 
334			
335			$('.gfaa_field_list_value').show();
336			
337			// console.log(field.type);
338			
339			if( field.type == 'product' ) {
340				$('.gfaa_inputNumberKeys').hide();
341			}
342			else if( typeof field.autoAdvancedField != 'undefined' && ( field.autoAdvancedField == 'true' || field.autoAdvancedField === true ) ) {
343				$('.gfaa_inputNumberKeys').show();				
344			}
345		}
346		
347		else {
348			
349			$('.gfaa_inputNumberKeys').hide();
350			$('.gfaa_field_list_value').hide();
351			$('.gfaa_hide_next_button').hide();
352			$('.gfaa_hidePreviousButton').hide();
353		}
354		
355		
356		if( $('#hide_next_button').hasClass('disabled') || $('#hidePreviousButton').hasClass('disabled')  ) {
357			$('#hide_next_button').prop('checked', false);
358			$('#hidePreviousButton').prop('checked', false);
359			
360			SetFieldProperty('hideNextButton', false);
361			SetFieldProperty('hidePreviousButton', false);
362		}
363	});
364	
365	/*$(document).on( 'change', '#field_list_value', function() {
366		
367		console.log('h1');
368		console.log(field);
369		jQuery('.gfaa_inputNumberKeys').hide();
370		if( this.checked ) {
371			
372			if ( field.type == 'text' || field.type == 'textarea' || field.type == 'checkbox' || field.type == 'number' || field.type == 'address' ) {
373				
374				jQuery('.gfaa_inputNumberKeys').show();
375			}
376		}
377	} );*/
378
379});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.