PageSourceSearch

https://laopan33.com/bunker/assets/js/theme-FORMINBODY.js?v=a1.0.5-bvhide

js laopan33.com collected 2026-10-08 20:14:48 UTC 12,836 bytes, 425 lines download raw bytes

1$ = jQuery.noConflict();
2
3(function($) {
4	$(document).ready(function() {
5		
6	});
7	/*
8	$(window).on('scroll', function() {
9		
10	});
11	$(window).on('load', function() {	
12	
13	});
14	*/
15})(jQuery);
16
17function collect_this(form_data,form_id) {
18	
19	arrayradioname = new Array();
20	$('#'+form_id+' .collect-this').each(function() {
21		typex = $(this).attr('type');
22		keyname = $(this).attr('name');
23		thevalue = $(this).val();
24		if ($(this).attr('data-default')) {
25		//if (typeof $(this).data('default') !== 'undefined') {
26			if (thevalue === "") {
27				thevalue = $(this).attr('data-default');
28			}
29		}
30		if (typex === "file") {
31			thevalue =  $(this).prop('files')[0];
32		}
33		
34		allowinsertformdata = true;
35		if (typex === "checkbox") {
36			if (!$(this).prop('checked')) {
37				//if ($(this).attr('data-default').length > 0) {
38				if (typeof $(this).data('default') !== 'undefined') {
39					thevalue = $(this).attr('data-default');
40				} else {
41					allowinsertformdata = false;
42				}
43			}
44		}
45
46		if ((thevalue !== "")&&(thevalue !== null)&&(allowinsertformdata == true)) {
47			if (typex === "radio") {
48				if ( $(this).is(":checked") ) {
49					if (arrayradioname.includes(keyname) == false) {
50						form_data.append( keyname, thevalue );
51					}
52					arrayradioname.push(keyname);
53				}
54			} else {
55				form_data.append( keyname, thevalue );
56			}
57		}
58	});
59	return form_data;
60}
61
62function SubmitForm(form_id,postactionvalue,url_post,hidemodalIDafterpost = false,errorsnotifinsinglepopup = false) {
63	form_data	= new FormData();
64	form_data.append( 'action', postactionvalue );
65	
66	form_data = collect_this(form_data,form_id);
67	
68	//console.log(form_data);
69	//remove or reset unnecessary element
70	if ($('#'+form_id+' .is-invalid').length > 0) {
71		$('#'+form_id+' .is-invalid').removeClass('is-invalid');
72	}
73	if ($('#'+form_id+' .invalid-feedback').length > 0) {
74		$('#'+form_id+' .invalid-feedback').remove();
75	}
76	
77	$( 'body' ).append( '<div id="loading"><div><i class="fa-solid fa-spinner fa-spin fa-3x fa-fw"></i></div></div>' );
78	
79	/*
80	if ($('.formvalidator').length > 0) {
81		grecaptcha.ready(function() {
82			grecaptcha.execute(GRECAP_SITEKEY, {action: 'submit'}).then(function(grtoken) {
83				
84				
85				// Add your logic to submit to your backend server here.
86				$.post(AJAX_SESSIONS_URL,{'grtokenv':grtoken},function(cb){
87					
88					
89					if (cb == true) {
90					*/	
91						
92					
93					//check google recap
94
95					$.ajax({
96						url: url_post,
97						type: 'POST',
98						contentType: false,
99						processData: false,	
100						data: form_data,
101
102						beforeSend: function() {
103							//$( 'body' ).append( '<div id="loading"><div><i class="fa-solid fa-spinner fa-spin fa-3x fa-fw"></i></div></div>' );
104						},						
105						success: function (response) {	
106							response = JSON.parse(response);
107							//console.log(response);
108
109							if (response.isvalid == "debug") {
110								console.log(response);
111								$( '#loading' ).remove();
112							} else if (response.isvalid == true) {
113								if (response.info == false) {
114									if ((typeof response.redirect != "undefined")&&(response.redirect == false)) {
115										//do nothing
116										if (typeof response.function != "undefined") {
117											responsefunc = response.function;
118											eval(responsefunc);
119										}
120									} else if (typeof response.redirect != "undefined") {
121										window.location = response.redirect
122									} else {
123										location.reload();
124									}
125								} else if (typeof response.info != "undefined") {
126									Swal.fire({
127										title: response.title,
128										html: response.info,
129									}).then((result) => {
130										console.log(result);
131										if (result.value == true) {
132											if ((typeof response.redirect != "undefined")&&(response.redirect == false)) {
133												//do nothing
134												if (typeof response.function != "undefined") {
135													responsefunc = response.function;
136													eval(responsefunc);
137												}
138											} else if (typeof response.redirect != "undefined") {
139												window.location = response.redirect;
140											} else {
141												location.reload();
142											}
143										}
144									});
145								} else {
146									if ((typeof response.redirect != "undefined")&&(response.redirect == false)) {
147										//do nothing
148										if (typeof response.function != "undefined") {
149											responsefunc = response.function;
150											eval(responsefunc);
151										}
152									} else if (typeof response.redirect != "undefined") {
153										if (typeof response.function != "undefined") {
154											responsefunc = response.function;
155											eval(responsefunc);
156										}
157										window.location = response.redirect;
158									} else {
159										$.toast({
160											heading: '<strong>'+response.title+'</strong>',
161											text: response.desc,
162											position: 'top-center',
163											allowToastClose: false,
164											hideAfter: 0,
165											allowToastClose: false,
166											showHideTransition: 'fade',
167											icon: 'success',
168											afterHidden: function () {
169												location.reload();
170											}
171										});
172										
173									}
174									/*
175										$.toast({
176											heading: '<strong>'+response.title+'</strong>',
177											text: response.desc,
178											position: 'top-center',
179											allowToastClose: false,
180											hideAfter: 0,
181											allowToastClose: false,
182											showHideTransition: 'fade',
183											icon: 'success',
184											afterHidden: function () {
185												if ((typeof response.redirect != "undefined")&&(response.redirect == false)) {
186													//do nothing
187													if (typeof response.function != "undefined") {
188														responsefunc = response.function;
189														eval(responsefunc);
190													}
191												} else if (typeof response.redirect != "undefined") {
192													window.location = response.redirect;
193												} else {
194													location.reload();
195												}
196											}
197										});
198									*/
199								}
200								
201								if (hidemodalIDafterpost != false) {
202								
203									$( '#'+hidemodalIDafterpost ).modal( 'hide' );
204								}
205								
206								$( '#loading' ).remove();
207								
208								//RELOAD TABLE OR PAGE AFTER SUCCESS INPUT DATA (PREFER RELOAD TABLE use data table server side, SO not need reload All asset again when page reload)
209								//location.reload();
210							} else if (response.isvalid == false) {
211								
212								if (errorsnotifinsinglepopup == true) {
213									toasttextli = '';
214									toasttimersc = 0;
215									errorstext = new Array();
216									for (key in response.errors) {
217										//toasttextli += '<li>'+response.errors[key].desc+'</li>';
218										errorstext.push(response.errors[key].desc);
219										toasttimersc += 5000;
220										
221										//give error sign into field
222										//response.errors[key].name
223										if ((typeof response.errors[key].name != "undefined")&&($('[name="'+response.errors[key].name+'"]').length > 0)) {
224											$('#'+form_id+' [name="'+response.errors[key].name+'"]').addClass('is-invalid');
225											if (response.errors[key].formfeedback != false) {
226												if ($('#'+form_id+' [name="'+response.errors[key].name+'"]').closest('.input-group').length > 0) {
227													$('#'+form_id+' [name="'+response.errors[key].name+'"]').closest('.input-group').append('<div class="invalid-feedback">'+response.errors[key].desc+'</div>');
228												} else {
229													$('#'+form_id+' [name="'+response.errors[key].name+'"]').after('<div class="invalid-feedback">'+response.errors[key].desc+'</div>');
230												}
231											}
232										}
233										
234										if (response.issecurimage == true) {
235											$(".securimage-img").click();
236										}
237										if (response.securimagevalid == true) {
238											$('#'+form_id+' [name="securimage"]').val("");
239											$('#'+form_id+' [name="securimage"]').attr("placeholder","Ulangi Lagi");
240										}
241									}
242									//toasttext = '<ul>'+toasttextli+'</ul>';
243									$.toast({
244										heading: '<strong>'+response.title+'</strong>',
245										text: errorstext,
246										position: 'top-center',
247										allowToastClose: true,
248										hideAfter: toasttimersc,
249										allowToastClose: true,
250										showHideTransition: 'fade',
251										icon: 'error',
252										afterHidden: function () {
253											if ((typeof response.redirect != "undefined")&&(response.redirect == false)) {
254												//do nothing
255												if (typeof response.function != "undefined") {
256													responsefunc = response.function;
257													eval(responsefunc);
258												}
259											} else if (typeof response.redirect != "undefined") {
260												window.location = response.redirect;
261											}
262										}
263									});
264								} else {
265									for (key in response.errors) {
266										$.toast({
267											heading: response.errors[key].title,
268											text: response.errors[key].desc,
269											position: 'top-center',
270											allowToastClose: false,
271											hideAfter: 5000,
272											showHideTransition: 'fade',
273											icon: 'error',
274											afterHidden: function () {
275												if ((typeof response.redirect != "undefined")&&(response.redirect == false)) {
276													//do nothing
277													if (typeof response.function != "undefined") {
278														responsefunc = response.function;
279														eval(responsefunc);
280													}
281												} else if (typeof response.redirect != "undefined") {
282													window.location = response.redirect;
283												}
284											}
285										});
286									}
287								}
288								
289								if (typeof response.function != "undefined") {
290									responsefunc = response.function;
291									eval(responsefunc);
292								}
293								
294								$( '#loading' ).remove();
295							}
296						}
297					});		
298					
299					//check google recapt ends
300					
301					/*
302					}
303				
304				});
305				
306				
307				
308			});
309		});
310	}
311	
312	*/
313
314}
315
316function setPrePopupCookie() {
317    document.cookie = "pre_every_login_glpl_popup=1; path=/;";
318}
319
320function clickOpenForm(buttonID,modalID,url_get,hidemodalIDafterpost = false,errorsnotifinsinglepopup = false) {
321	//$( 'body' ).on( 'click', '#'+buttonID, 
322		//function() {
323			
324			$( 'body' ).find( '#'+modalID ).remove();
325			
326			xdata = $('#'+buttonID).data();
327			stringurldata = "";
328			for(key in xdata) {
329				stringurldata += "&"+key+"="+xdata[key];
330			}
331			
332			console.log('action=open-'+modalID+stringurldata);
333			
334			$.ajax({
335				url: url_get,
336				data: 'action=open-'+modalID+stringurldata, 
337				beforeSend: function() {
338					$( 'body' ).append( '<div id="loading"><div><i class="fa-solid fa-spinner fa-spin fa-3x fa-fw"></i></div></div>' );
339				},					
340				success: function (response) {
341					  
342					if ( $('body').find('#'+modalID).length > 0 ) {
343						$('body').find('#'+modalID).remove();
344					}
345					  
346					$( 'body' ).append( response );
347					
348					$( '#'+modalID ).modal( 'toggle' );
349					
350					$( '#loading' ).remove();
351				}
352			});
353			
354			if (hidemodalIDafterpost == false) {
355				hidemodalIDafterpost = modalID;
356			}
357			
358			/*
359			window.clickSubmitForm = function() {
360				return false;
361			}
362			*/
363			
364			//clickSubmitForm('submit-'+modalID,'save-'+modalID,url_get,hidemodalIDafterpost,errorsnotifinsinglepopup);
365			
366			//SubmitForm('submit-'+modalID,'save-'+modalID,url_get,hidemodalIDafterpost = false,errorsnotifinsinglepopup = false);
367			
368			//return false;
369		//}
370	//);
371	/*
372	$("#"+modalID).on('hide.bs.modal', function() {
373		alert('The modal is about to be hidden.');
374	});
375	*/
376}
377
378function pinfielddinamic() {
379	acttabindex = $('input.pincode:focus').attr("tabindex");
380	contentcurrtabindex = $('input.pincode:focus').val();
381	nexttabindex = parseInt(acttabindex);
382	if (contentcurrtabindex === "") {
383		if (parseInt(acttabindex) > 0) {
384			nexttabindex = parseInt(acttabindex) - 1;
385		}
386	} else {
387		if (parseInt(acttabindex) < 5) {
388			nexttabindex = parseInt(acttabindex) + 1;
389		}
390	}
391	$('input.pincode[tabindex="'+nexttabindex+'"]').focus();
392	
393	countfilled = 0;
394	$('input.pincode[tabindex]').each(function() {
395		chkcurrvalue = $(this).val();
396		if (chkcurrvalue !== "") {
397			countfilled++;
398		}
399	});
400	if (countfilled == 5) {
401		//alert("all filled");
402	}
403}
404function pininputprocess() {
405	acttabindex = $('input.newpin-field:focus').attr("tabindex");
406	contentcurrtabindex = $('input.newpin-field:focus').val();
407	if (contentcurrtabindex === "") {
408		nexttabindex = parseInt(acttabindex) - 1;
409	} else {
410		nexttabindex = parseInt(acttabindex) + 1;
411	}
412	$('input.newpin-field[tabindex="'+nexttabindex+'"]').focus();
413}
414function seehidepassword(eltoread,eleye) {
415	ctype = $(eltoread).attr("type");
416	if (ctype === "password") {
417		$(eltoread).attr("type","text");
418		$(eleye).removeClass("fa-eye-slash");
419		$(eleye).addClass("fa-eye");
420	} else if (ctype === "text") {
421		$(eltoread).attr("type","password");
422		$(eleye).removeClass("fa-eye");
423		$(eleye).addClass("fa-eye-slash");
424	}
425}

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.