mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 08:21:24 +02:00
Clean-up javascript formatting
This commit is contained in:
parent
e96cad230a
commit
f5e14565b8
1 changed files with 22 additions and 24 deletions
|
@ -14,8 +14,7 @@ $(document).ready(function(){
|
||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
|
|
||||||
function uploadNextChunk(file, offset)
|
function uploadNextChunk(file, offset) {
|
||||||
{
|
|
||||||
if (offset == undefined) {
|
if (offset == undefined) {
|
||||||
offset = 0;
|
offset = 0;
|
||||||
}
|
}
|
||||||
|
@ -33,29 +32,29 @@ $(document).ready(function(){
|
||||||
var formItemName = isFinal ? 'restore-file-chunk-final' : 'restore-file-chunk';
|
var formItemName = isFinal ? 'restore-file-chunk-final' : 'restore-file-chunk';
|
||||||
chunkFormData.append(formItemName, chunk, filename);
|
chunkFormData.append(formItemName, chunk, filename);
|
||||||
var ajaxParams = {
|
var ajaxParams = {
|
||||||
url: '/content/upload',
|
url: '/content/upload',
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
timeout: 30000, // 30 s
|
timeout: 30000, // 30 s
|
||||||
cache: false,
|
cache: false,
|
||||||
processData: false,
|
processData: false,
|
||||||
contentType: false,
|
contentType: false,
|
||||||
data: chunkFormData
|
data: chunkFormData
|
||||||
};
|
};
|
||||||
|
|
||||||
var ajaxObject = $.ajax(ajaxParams);
|
var ajaxObject = $.ajax(ajaxParams);
|
||||||
ajaxObject.fail(function(jqXHR, textStatus, errorThrown) {
|
ajaxObject.fail(function(jqXHR, textStatus, errorThrown) {
|
||||||
showErrorMessage(
|
showErrorMessage(
|
||||||
"Error",
|
"Error",
|
||||||
"There was a problem restoring domain content.\n"
|
"There was a problem restoring domain content.\n"
|
||||||
+ "Please ensure that the content archive or entity file is valid and try again."
|
+ "Please ensure that the content archive or entity file is valid and try again."
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!isFinal) {
|
if (!isFinal) {
|
||||||
ajaxObject.done(function (data, textStatus, jqXHR)
|
ajaxObject.done(function (data, textStatus, jqXHR)
|
||||||
{uploadNextChunk(file, offset + CHUNK_SIZE);});
|
{ uploadNextChunk(file, offset + CHUNK_SIZE); });
|
||||||
} else {
|
} else {
|
||||||
ajaxObject.done(function(data, textStatus, jqXHR) {
|
ajaxObject.done(function(data, textStatus, jqXHR) {
|
||||||
isRestoring = true;
|
isRestoring = true;
|
||||||
|
|
||||||
// immediately reload backup information since one should be restoring now
|
// immediately reload backup information since one should be restoring now
|
||||||
|
@ -65,7 +64,7 @@ $(document).ready(function(){
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function setupBackupUpload() {
|
function setupBackupUpload() {
|
||||||
// construct the HTML needed for the settings backup panel
|
// construct the HTML needed for the settings backup panel
|
||||||
|
@ -106,7 +105,6 @@ $(document).ready(function(){
|
||||||
|
|
||||||
showSpinnerAlert("Uploading content to restore");
|
showSpinnerAlert("Uploading content to restore");
|
||||||
|
|
||||||
|
|
||||||
uploadNextChunk(files[0]);
|
uploadNextChunk(files[0]);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue