Skip to content

Commit

Permalink
Deploying version 0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
bradt committed Jun 12, 2015
1 parent ce84140 commit 7d3ab52
Show file tree
Hide file tree
Showing 29 changed files with 5,339 additions and 2,505 deletions.
1 change: 1 addition & 0 deletions asset/css/plugin-manager-styles.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions asset/css/plugin-update-styles.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion asset/css/styles.css

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions asset/img/icon-multisite-tools.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 38 additions & 12 deletions asset/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,33 @@ var migration_error = false;
var connection_data;
var next_step_in_migration;

/**
* Toggle proper translated strings based on migration type selected.
*
* To show the properly translated strings for the selected push or pull
* migration type, we need to hide all strings then show the right
* translated strings based on the migration type selected.
*
* @see https://github.com/deliciousbrains/wp-migrate-db-pro/issues/764
*
* @return void
*/
function wpmdb_toggle_migration_action_text() {
jQuery( '.action-text' ).hide();
jQuery( '.action-text.' + jQuery( 'input[name=action]:checked' ).val() ).show();
}

/**
* Return the currently selected migration type selected.
*
* @return string Will return `push`, `pull`, or `savefile` for exporting as a file.
*/
function wpmdb_migration_type() {
return jQuery( 'input[name=action]:checked' ).val();
}

function wpmdb_call_next_hook() {
if( ! call_stack.length ) {
if ( !call_stack.length ) {
call_stack = hooks;
}

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

function wpmdb_add_commas( number_string ) {
number_string += '';
x = number_string.split('.');
x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
var x = number_string.split( '.' );
var x1 = x[0];
var x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1)) {
x1 = x1.replace(rgx, '$1' + ',' + '$2');
while ( rgx.test( x1 ) ) {
x1 = x1.replace( rgx, '$1' + ',' + '$2' );
}
return x1 + x2;
}

function wpmdb_parse_json( maybe_json ) {
var json_object = {};
try {
var json_object = jQuery.parseJSON( maybe_json );
json_object = jQuery.parseJSON( maybe_json );
}
catch(e){
catch ( e ) {
// we simply return false here because the json data itself will never just contain a value of "false"
return false;
}
Expand Down Expand Up @@ -70,13 +96,13 @@ function wpmdbGetAjaxErrors( title, code, text, jqXHR ) {
}

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

// Add code to the end of the error text if not json errors
if ( ! jsonErrors ) {
if ( !jsonErrors ) {
text += ' ' + code;
}

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

(function($) {
(function( $ ) {
// jQuery code here
})(jQuery);
})( jQuery );
2 changes: 1 addition & 1 deletion asset/js/common.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 17 additions & 16 deletions asset/js/hook.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(function($) {
(function( $ ) {

$.wpmdb = {
/**
Expand All @@ -25,39 +25,40 @@
jQuery.wpmdb.remove_hook( 'filter', action, tag );
},
add_hook: function( hook_type, action, callable, tag ) {
if ( undefined == jQuery.wpmdb.hooks[hook_type][action] ) {
if ( undefined === jQuery.wpmdb.hooks[hook_type][action] ) {
jQuery.wpmdb.hooks[hook_type][action] = [];
}
var hooks = jQuery.wpmdb.hooks[hook_type][action];
if ( undefined == tag ) {
if ( undefined === tag ) {
tag = action + '_' + hooks.length;
}
jQuery.wpmdb.hooks[hook_type][action].push( { tag:tag, callable:callable } );
jQuery.wpmdb.hooks[hook_type][action].push( { tag: tag, callable: callable } );
},
do_hook: function( hook_type, action, value, args ) {
if ( undefined != jQuery.wpmdb.hooks[hook_type][action] ) {
if ( undefined !== jQuery.wpmdb.hooks[hook_type][action] ) {
var hooks = jQuery.wpmdb.hooks[hook_type][action];
for( var i=0; i<hooks.length; i++) {
if ( 'action'==hook_type ) {
hooks[i].callable(args);
for ( var i = 0; i < hooks.length; i++ ) {
if ( 'action' === hook_type ) {
hooks[i].callable( args );
} else {
value = hooks[i].callable(value, args);
value = hooks[i].callable( value, args );
}
}
}
if ( 'filter'==hook_type ) {
if ( 'filter' === hook_type ) {
return value;
}
},
remove_hook: function( hook_type, action, tag ) {
if ( undefined != jQuery.wpmdb.hooks[hook_type][action] ) {
if ( undefined !== jQuery.wpmdb.hooks[hook_type][action] ) {
var hooks = jQuery.wpmdb.hooks[hook_type][action];
for( var i=hooks.length-1; i>=0; i--) {
if (undefined==tag||tag==hooks[i].tag)
hooks.splice(i,1);
for ( var i = hooks.length - 1; i >= 0; i-- ) {
if ( undefined === tag || tag === hooks[i].tag ) {
hooks.splice( i, 1 );
}
}
}
}
}
};

})(jQuery);
})( jQuery );
2 changes: 1 addition & 1 deletion asset/js/hook.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7d3ab52

Please sign in to comment.