PageSourceSearch

https://www.punyafoundation.org/wp-content/themes/charitywp/assets/js/user-box.js?ver=7.1.3

js punyafoundation.org collected 2026-10-08 07:28:40 UTC 2,336 bytes, 107 lines download raw bytes

1function pt_open_login_dialog(href){
2
3	jQuery('#user_login_popup .modal-dialog').removeClass('registration-complete');
4
5	var modal_dialog = jQuery('#user_login_popup .modal-dialog');
6	modal_dialog.attr('data-active-tab', '');
7
8	switch(href){
9
10		case '#pt-register':
11			modal_dialog.attr('data-active-tab', '#pt-register');
12			break;
13
14		case '#pt-login':
15		default:
16			modal_dialog.attr('data-active-tab', '#pt-login');
17			break;
18	}
19
20	jQuery('#user_login_popup').modal('show');
21}	
22
23function pt_close_login_dialog(){
24
25	jQuery('#user_login_popup').modal('hide');
26}	
27
28jQuery(function($){
29
30	"use strict";
31	/***************************
32	**  LOGIN / REGISTER DIALOG
33	***************************/
34
35	// Open login/register modal
36	$('[href="#pt-login"], [href="#pt-register"]').click(function(e){
37
38		e.preventDefault();
39
40		pt_open_login_dialog( $(this).attr('href') );
41
42	});
43
44	// Switch forms login/register
45	$('.modal-footer a, a[href="#pt-reset-password"]').click(function(e){
46		e.preventDefault();
47		$('#user_login_popup .modal-dialog').attr('data-active-tab', $(this).attr('href'));
48	});
49
50
51	// Post login form
52	$('#pt_login_form').on('submit', function(e){
53
54		e.preventDefault();
55
56		var button = $(this).find('button');
57			button.button('loading');
58
59		$.post(ptajax.ajaxurl, $('#pt_login_form').serialize(), function(data){
60
61			var obj = $.parseJSON(data);
62
63			$('.pt-login .pt-errors').html(obj.message);
64			
65			if(obj.error == false){
66				$('#user_login_popup .modal-dialog').addClass('loading');
67				window.location.reload(true);
68				button.hide();
69			}
70
71			button.button('reset');
72		});
73
74	});
75
76
77	// Post register form
78	$('#pt_registration_form').on('submit', function(e){
79
80		e.preventDefault();
81
82		var button = $(this).find('button');
83			button.button('loading');
84
85		$.post(ptajax.ajaxurl, $('#pt_registration_form').serialize(), function(data){
86			
87			var obj = $.parseJSON(data);
88
89			$('.pt-register .pt-errors').html(obj.message);
90			
91			if(obj.error == false){
92				$('#user_login_popup .modal-dialog').addClass('registration-complete');
93				// window.location.reload(true);
94				button.hide();
95			}
96
97			button.button('reset');
98			
99		});
100
101	});
102
103	if(window.location.hash == '#login'){
104		pt_open_login_dialog('#pt-login');
105	}		
106
107});

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.