PageSourceSearch

https://worldfringe.com/wp-content/plugins/ultimate-member/assets/js/um-profile.js?ver=2.14.0

js worldfringe.com collected 2026-10-01 11:51:21 UTC 4,826 bytes, 147 lines download raw bytes

1jQuery(document).ready(function() {
2
3	jQuery('.um-profile.um-viewing .um-profile-body .um-row').each(function(){
4		var this_row = jQuery(this);
5		if ( this_row.find('.um-field').length == 0 ) {
6			this_row.prev('.um-row-heading').remove();
7			this_row.remove();
8		}
9	});
10
11	if ( jQuery('.um-profile.um-viewing .um-profile-body').length && jQuery('.um-profile.um-viewing .um-profile-body').find('.um-field').length == 0 ) {
12		jQuery('.um-profile.um-viewing .um-profile-body').find('.um-row-heading,.um-row').remove();
13		jQuery('.um-profile-note').show();
14	}
15
16	jQuery( document.body ).on( 'click', '.um-profile-save', function(e){
17		e.preventDefault();
18		jQuery(this).parents('.um.um-profile.um-editing').find('form').trigger('submit');
19		return false;
20	});
21
22	jQuery( document.body ).on( 'click', '.um-profile-edit-a', function(e){
23		jQuery(this).addClass('active');
24	});
25
26	jQuery( document.body ).on( 'click', '.um-cover a.um-cover-add, .um-photo a', function(e){
27		e.preventDefault();
28	});
29
30	jQuery( document.body ).on('click', '.um-photo-modal', function(e){
31		e.preventDefault();
32		var photo_src = jQuery(this).attr('data-src');
33		um_new_modal('um_view_photo', 'fit', true, photo_src );
34		return false;
35	});
36
37	jQuery(document.body).on('click', '.um-reset-profile-photo', function(e) {
38		let $obj = jQuery(this);
39		let user_id = $obj.data('user_id');
40		let nonce = $obj.data('nonce');
41
42		let $dropdownItem = $obj.parents('ul').find('.um-manual-trigger[data-parent=".um-profile-photo"]');
43		let altText = $dropdownItem.data('alt_text');
44		$dropdownItem.data( 'alt_text', $dropdownItem.text() ).text( altText );
45
46		jQuery('.um-profile-photo-img img').attr( 'src', $obj.data( 'default_src' ) );
47
48		jQuery.ajax({
49			url: wp.ajax.settings.url,
50			type: 'post',
51			data: {
52				action:'um_delete_profile_photo',
53				user_id: user_id,
54				_wpnonce: nonce
55			},
56			success: function() {
57				$obj.removeClass('um-is-visible').hide();
58			}
59		});
60
61		UM.dropdown.hideAll();
62		return false;
63	});
64
65	jQuery(document.body).on('click', '.um-reset-cover-photo', function(e){
66		let $obj = jQuery(this);
67		let user_id = $obj.data('user_id');
68		let nonce = $obj.data('nonce');
69
70		let $dropdownItem = $obj.parents('ul').find('.um-manual-trigger[data-parent=".um-cover"]');
71		let altText = $dropdownItem.data('alt_text');
72		$dropdownItem.data( 'alt_text', $dropdownItem.text() ).text( altText );
73
74		jQuery('.um-cover-overlay').hide();
75		jQuery('.um-cover-e').html('<a href="javascript:void(0);" class="um-cover-add" style="height: 370px;"><span class="um-cover-add-i"><i class="um-icon-plus um-tip-n" title="' + wp.i18n.__( 'Upload a cover photo', 'ultimate-member' ) + '"></i></span></a>');
76
77		um_responsive();
78
79		jQuery.ajax({
80			url: wp.ajax.settings.url,
81			type: 'post',
82			data: {
83				action: 'um_delete_cover_photo',
84				user_id: user_id,
85				_wpnonce: nonce
86			},
87			success: function() {
88				$obj.removeClass('um-is-visible').hide();
89			}
90		});
91
92		UM.dropdown.hideAll();
93		return false;
94	});
95
96	// Bio characters limit
97	jQuery( document.body ).on( 'change keyup', '#um-meta-bio', function() {
98		if ( typeof jQuery(this).val() !== 'undefined' ) {
99			let um_bio_limit = jQuery(this).data( 'character-limit' );
100			let bio_html     = jQuery(this).data( 'html' );
101
102			let remaining = um_bio_limit - jQuery(this).val().length;
103			if ( parseInt( bio_html ) === 1 ) {
104				remaining = um_bio_limit - jQuery(this).val().replace(/(<([^>]+)>)/ig,'').length;
105			}
106
107			remaining = remaining < 0 ? 0 : remaining;
108
109			jQuery( 'span.um-meta-bio-character span.um-bio-limit' ).text( remaining );
110			let color = remaining < 5 ? 'red' : '';
111			jQuery('span.um-meta-bio-character').css( 'color', color );
112		}
113	});
114	jQuery( '#um-meta-bio' ).trigger('change');
115
116	// Biography (description) fields syncing.
117	jQuery( '.um-profile form' ).each( function () {
118		let descKey = jQuery(this).data('description_key');
119		if ( jQuery(this).find( 'textarea[name="' + descKey + '"]' ).length ) {
120			jQuery( document.body ).on( 'change input', 'textarea[name="' + descKey + '"]', function ( e ) {
121				jQuery(this).parents( 'form' ).find( 'textarea[name="' + descKey + '"]' ).each( function() {
122					jQuery(this).val( e.currentTarget.value );
123					if ( jQuery('#um-meta-bio')[0] !== e.currentTarget && jQuery('#um-meta-bio')[0] === jQuery(this)[0] ) {
124						jQuery(this).trigger('change');
125					}
126				});
127			});
128		}
129	});
130
131
132	jQuery( '.um-profile-edit a.um_delete-item' ).on( 'click', function(e) {
133		e.preventDefault();
134
135		if ( ! confirm( wp.i18n.__( 'Are you sure that you want to delete this user?', 'ultimate-member' ) ) ) {
136			return false;
137		}
138	});
139
140	/**
141	 * Fix profile nav links for iPhone
142	 * @see https://www.html5rocks.com/en/mobile/touchandmouse/
143	 */
144	jQuery( '.um-profile-nav a' ).on( 'touchend', function(e) {
145		jQuery( e.currentTarget).trigger( "click" );
146	});
147});

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.