PluginProbe
WP-Stateless – Google Cloud Storage / trunk
WP-Stateless – Google Cloud Storage vtrunk
4.4.3 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.3.0 2.3.1 2.3.2 3.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.2.0 3.2.1 3.2.2 All 62 releases
wp-stateless / static / scripts / wp-stateless-uploads.js

wp-stateless-uploads.js in WP-Stateless – Google Cloud Storage trunk, at static/scripts/wp-stateless-uploads.js

42 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * Uploads Page specific scripts.
3 *
4 * @author korotkov@UD
5 */
6
7 jQuery(document).ready(function(){
8
9 jQuery('.sm_inline_sync').one( 'click', function( e ) {
10
11 var that = jQuery(this);
12
13 that.html('Please wait...');
14
15 jQuery
16 .ajax({
17 method: 'POST',
18 url: ajaxurl,
19 data: {
20 action: that.data('type') == 'image' ? "stateless_process_image" : "stateless_process_file",
21 id: that.data('id'),
22 size: that.data('size'),
23 _ajax_nonce: stateless_upload.inline_sync_nonce ?? '',
24 }
25 })
26 .done(function( response ) {
27 if ( response.success ) {
28 if (that.data('reload_page')) {
29 location.reload();
30 }
31 that.replaceWith( '<span style="color:#00520a">'+response.data+'</span>' );
32 } else {
33 that.replaceWith( '<span style="color:#a00">'+response.data+'</span>' );
34 }
35 })
36 .fail(function( jqXHR, textStatus, message ) {
37 that.replaceWith( '<span style="color:#a00">'+message+'. Check your server configuration.</span>' );
38 });
39 });
40
41 });
42