diff options
| author | CHItA <mate.bartus@gmail.com> | 2015-06-11 19:32:11 +0200 |
|---|---|---|
| committer | Mate Bartus <mate.bartus@gmail.com> | 2015-07-08 01:28:02 +0200 |
| commit | db4cfa7df62d5911bc5a0edcdc59236c39aede08 (patch) | |
| tree | 35c6a99c900a0b9a3fa5db0e8d60e39045ed6591 /phpBB/assets/javascript | |
| parent | 1b81bf5b2370c045a6369705d2a11a2b35fe2281 (diff) | |
| download | forums-db4cfa7df62d5911bc5a0edcdc59236c39aede08.tar forums-db4cfa7df62d5911bc5a0edcdc59236c39aede08.tar.gz forums-db4cfa7df62d5911bc5a0edcdc59236c39aede08.tar.bz2 forums-db4cfa7df62d5911bc5a0edcdc59236c39aede08.tar.xz forums-db4cfa7df62d5911bc5a0edcdc59236c39aede08.zip | |
[ticket/13740] Add navigation bar support for the installer
Also added various UI elements and texts.
[ci skip]
PHPBB3-13740
Diffstat (limited to 'phpBB/assets/javascript')
| -rw-r--r-- | phpBB/assets/javascript/installer.js | 61 |
1 files changed, 52 insertions, 9 deletions
diff --git a/phpBB/assets/javascript/installer.js b/phpBB/assets/javascript/installer.js index a9a315c0d5..eafcd78f47 100644 --- a/phpBB/assets/javascript/installer.js +++ b/phpBB/assets/javascript/installer.js @@ -96,6 +96,45 @@ } /** + * 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 * * @param progressObject @@ -166,6 +205,10 @@ if (responseObject.hasOwnProperty('progress')) { setProgress(responseObject.progress); } + + if (responseObject.hasOwnProperty('nav')) { + updateNavbarStatus(responseObject.nav); + } } /** @@ -232,6 +275,14 @@ } /** + * Resets the polling timer + */ + function resetPolling() { + clearInterval(pollTimer); + nextReadPosition = 0; + } + + /** * Sets up timer for processing the streamed HTTP response * * @param xhReq @@ -240,15 +291,7 @@ resetPolling(); pollTimer = setInterval(function () { pollContent(xhReq); - }, 500); - } - - /** - * Resets the polling timer - */ - function resetPolling() { - clearInterval(pollTimer); - nextReadPosition = 0; + }, 250); } /** |
