Skip to content

Commit 7d3ab52

Browse files
committed
Deploying version 0.7
1 parent ce84140 commit 7d3ab52

29 files changed

+5339
-2505
lines changed

asset/css/plugin-manager-styles.css

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/css/plugin-update-styles.css

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/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/img/icon-multisite-tools.svg

Lines changed: 28 additions & 0 deletions
Loading

asset/js/common.js

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,33 @@ var migration_error = false;
66
var connection_data;
77
var next_step_in_migration;
88

9+
/**
10+
* Toggle proper translated strings based on migration type selected.
11+
*
12+
* To show the properly translated strings for the selected push or pull
13+
* migration type, we need to hide all strings then show the right
14+
* translated strings based on the migration type selected.
15+
*
16+
* @see https://github.com/deliciousbrains/wp-migrate-db-pro/issues/764
17+
*
18+
* @return void
19+
*/
20+
function wpmdb_toggle_migration_action_text() {
21+
jQuery( '.action-text' ).hide();
22+
jQuery( '.action-text.' + jQuery( 'input[name=action]:checked' ).val() ).show();
23+
}
24+
25+
/**
26+
* Return the currently selected migration type selected.
27+
*
28+
* @return string Will return `push`, `pull`, or `savefile` for exporting as a file.
29+
*/
30+
function wpmdb_migration_type() {
31+
return jQuery( 'input[name=action]:checked' ).val();
32+
}
33+
934
function wpmdb_call_next_hook() {
10-
if( ! call_stack.length ) {
35+
if ( !call_stack.length ) {
1136
call_stack = hooks;
1237
}
1338

@@ -18,21 +43,22 @@ function wpmdb_call_next_hook() {
1843

1944
function wpmdb_add_commas( number_string ) {
2045
number_string += '';
21-
x = number_string.split('.');
22-
x1 = x[0];
23-
x2 = x.length > 1 ? '.' + x[1] : '';
46+
var x = number_string.split( '.' );
47+
var x1 = x[0];
48+
var x2 = x.length > 1 ? '.' + x[1] : '';
2449
var rgx = /(\d+)(\d{3})/;
25-
while (rgx.test(x1)) {
26-
x1 = x1.replace(rgx, '$1' + ',' + '$2');
50+
while ( rgx.test( x1 ) ) {
51+
x1 = x1.replace( rgx, '$1' + ',' + '$2' );
2752
}
2853
return x1 + x2;
2954
}
3055

3156
function wpmdb_parse_json( maybe_json ) {
57+
var json_object = {};
3258
try {
33-
var json_object = jQuery.parseJSON( maybe_json );
59+
json_object = jQuery.parseJSON( maybe_json );
3460
}
35-
catch(e){
61+
catch ( e ) {
3662
// we simply return false here because the json data itself will never just contain a value of "false"
3763
return false;
3864
}
@@ -70,13 +96,13 @@ function wpmdbGetAjaxErrors( title, code, text, jqXHR ) {
7096
}
7197

7298
// Only add extra error details if not php errors (#144) and jqXHR has been provided
73-
if ( ! jsonErrors && jqXHR !== undefined ) {
99+
if ( !jsonErrors && jqXHR !== undefined ) {
74100
html += wpmdb_strings.status + ': ' + jqXHR.status + ' ' + jqXHR.statusText;
75101
html += '<br /><br />' + wpmdb_strings.response + ':<br />';
76102
}
77103

78104
// Add code to the end of the error text if not json errors
79-
if ( ! jsonErrors ) {
105+
if ( !jsonErrors ) {
80106
text += ' ' + code;
81107
}
82108

@@ -86,6 +112,6 @@ function wpmdbGetAjaxErrors( title, code, text, jqXHR ) {
86112
return html;
87113
}
88114

89-
(function($) {
115+
(function( $ ) {
90116
// jQuery code here
91-
})(jQuery);
117+
})( jQuery );

asset/js/common.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/js/hook.js

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(function($) {
1+
(function( $ ) {
22

33
$.wpmdb = {
44
/**
@@ -25,39 +25,40 @@
2525
jQuery.wpmdb.remove_hook( 'filter', action, tag );
2626
},
2727
add_hook: function( hook_type, action, callable, tag ) {
28-
if ( undefined == jQuery.wpmdb.hooks[hook_type][action] ) {
28+
if ( undefined === jQuery.wpmdb.hooks[hook_type][action] ) {
2929
jQuery.wpmdb.hooks[hook_type][action] = [];
3030
}
3131
var hooks = jQuery.wpmdb.hooks[hook_type][action];
32-
if ( undefined == tag ) {
32+
if ( undefined === tag ) {
3333
tag = action + '_' + hooks.length;
3434
}
35-
jQuery.wpmdb.hooks[hook_type][action].push( { tag:tag, callable:callable } );
35+
jQuery.wpmdb.hooks[hook_type][action].push( { tag: tag, callable: callable } );
3636
},
3737
do_hook: function( hook_type, action, value, args ) {
38-
if ( undefined != jQuery.wpmdb.hooks[hook_type][action] ) {
38+
if ( undefined !== jQuery.wpmdb.hooks[hook_type][action] ) {
3939
var hooks = jQuery.wpmdb.hooks[hook_type][action];
40-
for( var i=0; i<hooks.length; i++) {
41-
if ( 'action'==hook_type ) {
42-
hooks[i].callable(args);
40+
for ( var i = 0; i < hooks.length; i++ ) {
41+
if ( 'action' === hook_type ) {
42+
hooks[i].callable( args );
4343
} else {
44-
value = hooks[i].callable(value, args);
44+
value = hooks[i].callable( value, args );
4545
}
4646
}
4747
}
48-
if ( 'filter'==hook_type ) {
48+
if ( 'filter' === hook_type ) {
4949
return value;
5050
}
5151
},
5252
remove_hook: function( hook_type, action, tag ) {
53-
if ( undefined != jQuery.wpmdb.hooks[hook_type][action] ) {
53+
if ( undefined !== jQuery.wpmdb.hooks[hook_type][action] ) {
5454
var hooks = jQuery.wpmdb.hooks[hook_type][action];
55-
for( var i=hooks.length-1; i>=0; i--) {
56-
if (undefined==tag||tag==hooks[i].tag)
57-
hooks.splice(i,1);
55+
for ( var i = hooks.length - 1; i >= 0; i-- ) {
56+
if ( undefined === tag || tag === hooks[i].tag ) {
57+
hooks.splice( i, 1 );
5858
}
59+
}
5960
}
6061
}
61-
}
62+
};
6263

63-
})(jQuery);
64+
})( jQuery );

asset/js/hook.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.

0 commit comments

Comments
 (0)