Version 3.1.4
This commit is contained in:
1 parent
1d4720f3e2
commit
ae5c01cc78
2563 files changed
+283048
-240689
No files matched your search
@@ -63,8 +63,11 @@ function IPBTemplateDiff()
|
||||
/**
|
||||
* URLS
|
||||
*/
|
||||
this.baseUrl = '';
|
||||
this.imageUrl = '';
|
||||
this.baseUrl = '';
|
||||
this.baseUrlMerge = '';
|
||||
this.imageUrl = '';
|
||||
this.doneUrl = '';
|
||||
this.currentAction = 'process';
|
||||
|
||||
/*
|
||||
* Stored JSON
|
||||
@@ -96,7 +99,7 @@ function IPBTemplateDiff()
|
||||
this.beginDiff = function()
|
||||
{
|
||||
/* Start text output.. */
|
||||
this.updateCounter( 0 );
|
||||
this.updateCounter( '' );
|
||||
|
||||
/* Reset progress bar */
|
||||
this.updateProgressBar( false );
|
||||
@@ -106,7 +109,7 @@ function IPBTemplateDiff()
|
||||
|
||||
/* Start off with the SQL */
|
||||
this.fireAjax( 0 );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Update the progress bar
|
||||
@@ -170,9 +173,9 @@ function IPBTemplateDiff()
|
||||
if ( IPB3TemplateDiff.currentImage != _img )
|
||||
{
|
||||
$( 'diffStatusImage' ).src = IPB3TemplateDiff.imageUrl + _img;
|
||||
IPB3TemplateDiff.currentImage = _img;
|
||||
IPB3TemplateDiff.currentImage = _img;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Fire Ajax
|
||||
@@ -182,7 +185,7 @@ function IPBTemplateDiff()
|
||||
/* Update image */
|
||||
this.updateProgressImage( 'send' );
|
||||
|
||||
new Ajax.Request( this.baseUrl + '&do=process',
|
||||
new Ajax.Request( this.baseUrl.replace( /&/g, '&' ) + '&do=' + this.currentAction,
|
||||
{
|
||||
method: 'get',
|
||||
onSuccess: this.processAjax.bind(this),
|
||||
@@ -214,14 +217,14 @@ function IPBTemplateDiff()
|
||||
*/
|
||||
this.timeOutAjax = function( t )
|
||||
{
|
||||
if ( confirm( "No response from the webserver.\nDo you wish to continue waiting?" ) )
|
||||
if ( confirm( "Нет ответа от сервера.\nХотите подождать?" ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
t.transport.abort();
|
||||
alert( "Request Cancelled" );
|
||||
alert( "Запрос отменен" );
|
||||
}
|
||||
};
|
||||
|
||||
@@ -230,7 +233,7 @@ function IPBTemplateDiff()
|
||||
*/
|
||||
this.failureAjax = function( t )
|
||||
{
|
||||
alert( "Failure: " + t.responseText );
|
||||
alert( "Ошибка: " + t.responseText );
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -238,8 +241,8 @@ function IPBTemplateDiff()
|
||||
*/
|
||||
this.exceptionAjax = function( t )
|
||||
{
|
||||
alert( "Exception: " + t.responseText );
|
||||
}
|
||||
alert( "Исключение: " + t.responseText );
|
||||
};
|
||||
|
||||
/**
|
||||
* Process Ajax (Success)
|
||||
@@ -252,7 +255,8 @@ function IPBTemplateDiff()
|
||||
/* Not a JSON response? */
|
||||
if ( ! t.responseText.match( /^(\s+?)?\{/ ) )
|
||||
{
|
||||
alert( "Error:\n" + t.responseText );
|
||||
alert( "Ошибка:\n" + t.responseText );
|
||||
Debug.write( t );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -261,16 +265,24 @@ function IPBTemplateDiff()
|
||||
|
||||
if ( json['error'] )
|
||||
{
|
||||
alert( "An error occured: " . json['error'] );
|
||||
alert( "Ошибка: " . json['error'] );
|
||||
return false;
|
||||
}
|
||||
|
||||
/* All good: Update status message... */
|
||||
this.updateCounter( json['processed'] );
|
||||
this.updateCounter( json['title'], json['message'] );
|
||||
|
||||
/* Update progress bar */
|
||||
this.updateProgressBar( json['processed'] );
|
||||
|
||||
if ( json['perGo'] )
|
||||
{
|
||||
this.baseUrl = this.baseUrl.replace( 'perGo=(\d+?)', 'perGo=' + json['perGo'] );
|
||||
this.perGo = json['perGo'];
|
||||
}
|
||||
|
||||
this.totalBits = json['totalBits'] ? json['totalBits'] : this.totalBits;
|
||||
|
||||
/* Finish? If so - say all done and go tubby-bye-bye */
|
||||
if ( json['completed'] != 1 )
|
||||
{
|
||||
@@ -279,21 +291,33 @@ function IPBTemplateDiff()
|
||||
}
|
||||
else
|
||||
{
|
||||
/* All Done */
|
||||
this.updateProgressBar( -1 );
|
||||
this.updateProgressImage( 'ready' );
|
||||
/* Diff? Then merge */
|
||||
if ( this.currentAction == 'process' )
|
||||
{
|
||||
this.currentAction = 'merge';
|
||||
this.perGo = 10;
|
||||
this.baseUrl = this.baseUrl.replace( 'perGo=(\d+?)', 'perGo=' + this.perGo );
|
||||
/* Go ahead */
|
||||
this.beginDiff();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* All Done */
|
||||
this.updateProgressBar( -1 );
|
||||
this.updateProgressImage( 'ready' );
|
||||
|
||||
/* Show done thing */
|
||||
$( 'diffDone' ).show();
|
||||
/* Show done thing */
|
||||
window.location = this.doneUrl.replace( /&/g, '&' );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Write to Log
|
||||
*/
|
||||
this.updateCounter = function( count )
|
||||
this.updateCounter = function( title, msg )
|
||||
{
|
||||
$( 'diffLogProcessed' ).innerHTML = count;
|
||||
$( 'diffLogTitle' ).update( title );
|
||||
$( 'diffLogText' ).update( msg );
|
||||
};
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user