| Server IP : 116.153.78.57 / Your IP : 43.159.78.123 Web Server : nginx/1.28.0 System : Linux 1763701629066 6.8.0-53-generic #55-Ubuntu SMP PREEMPT_DYNAMIC Fri Jan 17 15:37:52 UTC 2025 x86_64 User : www ( 1001) PHP Version : 8.2.28 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/www.lengcat.cn/wp-content/plugins/avatar-manager/assets/js/ |
Upload File : |
( function( $ ) {
$( document ).ready( function() {
var frame;
$( '#your-profile' ).attr( 'enctype', 'multipart/form-data' );
// Disables upload buttons until files are selected.
( function() {
var button, input, avatarManager = $( '#avatar-manager' );
if ( ! avatarManager.length ) {
return;
}
button = avatarManager.find( 'input[type="submit"]' );
input = avatarManager.find( 'input[type="file"]' );
function toggleUploadButton() {
button.prop( 'disabled', '' === input.map( function() {
return $( this ).val();
} ).get().join( '' ) );
}
toggleUploadButton();
input.on( 'change', toggleUploadButton );
} )();
$( '#avatar-manager-choose-from-library-link' ).click( function( event ) {
var $el = $( this );
event.preventDefault();
// Reopens the media frame if it already exists.
if ( frame ) {
frame.open();
return;
}
// Creates the media frame.
frame = wp.media.frames.customAvatar = wp.media( {
// Sets the title of the modal.
title: $el.data( 'choose' ),
// Tells the modal to show only images.
library: {
type: 'image'
},
// Customizes the submit button.
button: {
// Sets the text of the button.
text: $el.data( 'update' ),
// Tells the button not to close the modal, since we're
// going to refresh the page when the image is selected.
close: false
}
} );
// Runs a callback when an image is selected.
frame.on( 'select', function() {
// Grabs the selected attachment.
var attachment = frame.state().get( 'selection' ).first(),
link = $el.data( 'updateLink' );
// Tells the browser to navigate to the update link.
window.location = link + '&avatar_manager_attachment_id=' + attachment.id;
} );
// Opens the modal.
frame.open();
} );
} );
} )( jQuery );