Skip to content

Commit fb5782b

Browse files
committed
Deploying version 0.9
1 parent d214296 commit fb5782b

26 files changed

+6383
-4683
lines changed

asset/dist/css/styles.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

asset/dist/js/common.js renamed to asset/dist/js/common-09.js

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,14 @@ function wpmdb_toggle_migration_action_text() {
2727
/**
2828
* Return the currently selected migration type selected.
2929
*
30-
* @return string Will return `push`, `pull`, or `savefile` for exporting as a file.
30+
* @return string Will return `push`, `pull`, `savefile`, or `` for exporting as a file.
3131
*/
3232
function wpmdb_migration_type() {
33-
return jQuery( 'input[name=action]:checked' ).val();
33+
var action = jQuery( 'input[name=action]:checked' );
34+
if ( 0 === action.length ) {
35+
return '';
36+
}
37+
return action.val();
3438
}
3539

3640
function wpmdb_call_next_hook() {
@@ -157,26 +161,35 @@ wpmdb.subsite_for_table = function( table_prefix, table_name ) {
157161
}
158162
};
159163

160-
wpmdb.functions.convertKBSizeToHR = function( size, dec, kbSize ) {
164+
wpmdb.functions.convertKBSizeToHR = function( size, dec, kbSize, retArray ) {
165+
var retVal, units;
161166
kbSize = kbSize || 1000;
162167
dec = dec || 2;
163168
size = parseInt( size );
164169

165170
if ( kbSize > Math.abs( size ) ) {
166-
return size.toFixed( 0 ) + ' KB';
171+
retVal = [ size.toFixed( 0 ), 'KB' ];
172+
} else {
173+
units = [ 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB' ];
174+
var u = -1;
175+
do {
176+
size /= kbSize;
177+
++u;
178+
} while ( Math.abs( size ) >= kbSize && u < units.length - 1 );
179+
retVal = [ Math.round( size * Math.pow( 10, dec ) ) / Math.pow( 10, dec ), units[ u ] ];
167180
}
168-
var units = [ 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB' ];
169-
var u = -1;
170-
do {
171-
size /= kbSize;
172-
++u;
173-
} while ( Math.abs( size ) >= kbSize && u < units.length - 1 );
174-
175-
return Math.round( size * Math.pow( 10, dec ) ) / Math.pow( 10, dec ) + ' ' + units[ u ];
176-
};
177181

178-
(function( $ ) {
179-
180-
// jQuery code here
182+
if ( ! retArray ) {
183+
retVal = retVal[0] + ' ' + retVal[1];
184+
}
185+
return retVal;
186+
};
181187

182-
})( jQuery );
188+
wpmdb.functions.convertKBSizeToHRFixed = function( size, dec, kbSize ) {
189+
dec = dec || 2;
190+
var hrSizeArray = wpmdb.functions.convertKBSizeToHR( size, dec, kbSize, true );
191+
if ( 'KB' !== hrSizeArray[1] ) {
192+
return hrSizeArray[ 0 ].toFixed( 2 ) + ' ' + hrSizeArray[ 1 ];
193+
}
194+
return hrSizeArray[ 0 ] + ' ' + hrSizeArray[ 1 ];
195+
};

asset/dist/js/common-09.min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

asset/dist/js/common.min.js

Lines changed: 0 additions & 1 deletion
This file was deleted.
File renamed without changes.

asset/dist/js/hook.min.js renamed to asset/dist/js/hook-09.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

asset/dist/js/multisite.js renamed to asset/dist/js/multisite-09.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ wpmdb.multisite = {};
1616

1717
var selected = ' ';
1818
if ( ( undefined === selected_subsite_ids || null === selected_subsite_ids || 0 === selected_subsite_ids.length ) ||
19-
( undefined !== selected_subsite_ids && null !== selected_subsite_ids && 0 < selected_subsite_ids.length && -1 !== $.inArray( blog_id, selected_subsite_ids ) )
19+
( undefined !== selected_subsite_ids && null !== selected_subsite_ids && 0 < selected_subsite_ids.length && -1 !== $.inArray( blog_id, selected_subsite_ids ) )
2020
) {
2121
selected = ' selected="selected" ';
2222
site_selected = true;
@@ -31,5 +31,4 @@ wpmdb.multisite = {};
3131
}
3232
}
3333
};
34-
3534
})( jQuery, wpmdb );
File renamed without changes.

asset/dist/js/plugin-update-09.js

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
(function( $ ) {
2+
3+
var doing_check_licence = false;
4+
var fade_duration = 650;
5+
6+
var admin_url = ajaxurl.replace( '/admin-ajax.php', '' );
7+
var spinner_url = admin_url + '/images/spinner';
8+
var spinner;
9+
if ( 2 < window.devicePixelRatio ) {
10+
spinner_url += '-2x';
11+
}
12+
spinner_url += '.gif';
13+
spinner = $( '<img src="' + spinner_url + '" alt="" class="check-licence-spinner" />' );
14+
15+
$( document ).ready( function() {
16+
17+
$( 'body' ).on( 'click', '.check-my-licence-again', function( e ) {
18+
e.preventDefault();
19+
$( this ).blur();
20+
21+
if ( doing_check_licence ) {
22+
return false;
23+
}
24+
25+
doing_check_licence = true;
26+
27+
$( this ).hide();
28+
spinner.insertAfter( this );
29+
30+
var check_again_link = ' <a class="check-my-licence-again" href="#">' + wpmdb_update_strings.check_license_again + '</a>';
31+
32+
$.ajax( {
33+
url: ajaxurl,
34+
type: 'POST',
35+
dataType: 'json',
36+
cache: false,
37+
data: {
38+
action: 'wpmdb_check_licence',
39+
nonce: wpmdb_nonces.check_licence,
40+
context: 'update'
41+
},
42+
error: function( jqXHR, textStatus, errorThrown ) {
43+
doing_check_licence = false;
44+
$( '.wpmdb-licence-error-notice' ).fadeOut( fade_duration, function() {
45+
$( '.wpmdb-licence-error-notice' ).empty()
46+
.html( wpmdb_update_strings.license_check_problem + check_again_link )
47+
.fadeIn( fade_duration );
48+
} );
49+
},
50+
success: function( data ) {
51+
doing_check_licence = false;
52+
if ( 'undefined' !== typeof data.errors ) {
53+
var msg = '';
54+
for ( var key in data.errors ) {
55+
msg += data.errors[ key ];
56+
}
57+
$( '.wpmdb-licence-error-notice' ).fadeOut( fade_duration, function() {
58+
$( '.check-licence-spinner' ).remove();
59+
$( '.wpmdb-licence-error-notice' ).empty()
60+
.html( msg )
61+
.fadeIn( fade_duration );
62+
} );
63+
} else {
64+
65+
// Success
66+
// Fade out, empty wpmdb custom error content, swap back in the original wordpress upgrade message, fade in
67+
$( '.wpmdbpro-custom-visible' ).fadeOut( fade_duration, function() {
68+
$( '.check-licence-spinner' ).remove();
69+
$( '.wpmdbpro-custom-visible' ).empty()
70+
.html( $( '.wpmdb-original-update-row' ).html() )
71+
.fadeIn( fade_duration );
72+
} );
73+
}
74+
}
75+
} );
76+
77+
} );
78+
79+
$( '.wpmdbpro-custom' ).prev().addClass( 'wpmdbpro-has-message' );
80+
81+
} );
82+
83+
})( jQuery );

asset/dist/js/plugin-update-09.min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)