mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
[ticket/13740] Add navigation bar support for the installer
Also added various UI elements and texts. [ci skip] PHPBB3-13740
This commit is contained in:
@@ -95,6 +95,45 @@
|
||||
interceptFormSubmit($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles navigation status updates
|
||||
*
|
||||
* @param navObj
|
||||
*/
|
||||
function updateNavbarStatus(navObj) {
|
||||
var navID, $stage, $stageListItem, $active;
|
||||
$active = $('#activemenu');
|
||||
|
||||
if (navObj.hasOwnProperty('finished')) {
|
||||
// This should be an Array
|
||||
var navItems = navObj.finished;
|
||||
|
||||
for (var i = 0; i < navItems.length; i++) {
|
||||
navID = 'installer-stage-' + navItems[i];
|
||||
$stage = $('#' + navID);
|
||||
$stageListItem = $stage.parent();
|
||||
|
||||
if ($active.length && $active.is($stageListItem)) {
|
||||
$active.removeAttr('id');
|
||||
}
|
||||
|
||||
$stage.addClass('completed');
|
||||
}
|
||||
}
|
||||
|
||||
if (navObj.hasOwnProperty('active')) {
|
||||
navID = 'installer-stage-' + navObj.active;
|
||||
$stage = $('#' + navID);
|
||||
$stageListItem = $stage.parent();
|
||||
|
||||
if ($active.length && !$active.is($stageListItem)) {
|
||||
$active.removeAttr('id');
|
||||
}
|
||||
|
||||
$stageListItem.attr('id', 'activemenu');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders progress bar
|
||||
*
|
||||
@@ -166,6 +205,10 @@
|
||||
if (responseObject.hasOwnProperty('progress')) {
|
||||
setProgress(responseObject.progress);
|
||||
}
|
||||
|
||||
if (responseObject.hasOwnProperty('nav')) {
|
||||
updateNavbarStatus(responseObject.nav);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -231,6 +274,14 @@
|
||||
}, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the polling timer
|
||||
*/
|
||||
function resetPolling() {
|
||||
clearInterval(pollTimer);
|
||||
nextReadPosition = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets up timer for processing the streamed HTTP response
|
||||
*
|
||||
@@ -240,15 +291,7 @@
|
||||
resetPolling();
|
||||
pollTimer = setInterval(function () {
|
||||
pollContent(xhReq);
|
||||
}, 500);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the polling timer
|
||||
*/
|
||||
function resetPolling() {
|
||||
clearInterval(pollTimer);
|
||||
nextReadPosition = 0;
|
||||
}, 250);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user