add loader
This commit is contained in:
parent
6418e79d49
commit
dcc19f5b23
|
@ -107,3 +107,18 @@
|
||||||
#side-menu.hide-opener .side-menu-logo {
|
#side-menu.hide-opener .side-menu-logo {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#side-menu-loader {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
z-index: 3001;
|
||||||
|
}
|
||||||
|
|
||||||
|
#side-menu-loader-bar {
|
||||||
|
height: 4px;
|
||||||
|
background: var(--side-menu-loader-color, #0e75ac);
|
||||||
|
width: 0;
|
||||||
|
transition-property: width;
|
||||||
|
}
|
||||||
|
|
|
@ -61,6 +61,7 @@ class CssController extends Controller
|
||||||
'background-color' => $backgroundColor,
|
'background-color' => $backgroundColor,
|
||||||
'background-color-to' => $backgroundColorTo,
|
'background-color-to' => $backgroundColorTo,
|
||||||
'current-app-background-color' => $this->config->getAppValue('side_menu', 'current-app-background-color', '#444444'),
|
'current-app-background-color' => $this->config->getAppValue('side_menu', 'current-app-background-color', '#444444'),
|
||||||
|
'loader-color' => $this->config->getAppValue('side_menu', 'loader-color', '#0e75ac'),
|
||||||
'text-color' => $this->config->getAppValue('side_menu', 'text-color', '#FFFFFF'),
|
'text-color' => $this->config->getAppValue('side_menu', 'text-color', '#FFFFFF'),
|
||||||
'opener' => $this->config->getAppValue('side_menu', 'opener', 'side-menu-opener'),
|
'opener' => $this->config->getAppValue('side_menu', 'opener', 'side-menu-opener'),
|
||||||
],
|
],
|
||||||
|
|
|
@ -59,6 +59,7 @@ class JsController extends Controller
|
||||||
'external-sites-in-top-menu' => (bool) $this->config->getAppValue('side_menu', 'external-sites-in-top-menu', 0),
|
'external-sites-in-top-menu' => (bool) $this->config->getAppValue('side_menu', 'external-sites-in-top-menu', 0),
|
||||||
'force-light-icon' => (bool) $this->config->getAppValue('side_menu', 'force-light-icon', '0'),
|
'force-light-icon' => (bool) $this->config->getAppValue('side_menu', 'force-light-icon', '0'),
|
||||||
'hide-when-no-apps' => (bool) $this->config->getAppValue('side_menu', 'hide-when-no-apps', '0'),
|
'hide-when-no-apps' => (bool) $this->config->getAppValue('side_menu', 'hide-when-no-apps', '0'),
|
||||||
|
'loader-enabled' => (bool) $this->config->getAppValue('side_menu', 'loader-enabled', '1'),
|
||||||
];
|
];
|
||||||
|
|
||||||
$response = new TemplateResponse('side_menu', 'js/script', $parameters, 'blank');
|
$response = new TemplateResponse('side_menu', 'js/script', $parameters, 'blank');
|
||||||
|
|
|
@ -60,6 +60,8 @@ class Admin implements ISettings
|
||||||
'background-color' => $backgroundColor,
|
'background-color' => $backgroundColor,
|
||||||
'background-color-to' => $backgroundColorTo,
|
'background-color-to' => $backgroundColorTo,
|
||||||
'current-app-background-color' => $this->config->getAppValue('side_menu', 'current-app-background-color', '#444444'),
|
'current-app-background-color' => $this->config->getAppValue('side_menu', 'current-app-background-color', '#444444'),
|
||||||
|
'loader-color' => $this->config->getAppValue('side_menu', 'loader-color', '#0e75ac'),
|
||||||
|
'loader-enabled' => $this->config->getAppValue('side_menu', 'loader-enabled', '1'),
|
||||||
'text-color' => $this->config->getAppValue('side_menu', 'text-color', '#FFFFFF'),
|
'text-color' => $this->config->getAppValue('side_menu', 'text-color', '#FFFFFF'),
|
||||||
'force-light-icon' => $this->config->getAppValue('side_menu', 'force-light-icon', '0'),
|
'force-light-icon' => $this->config->getAppValue('side_menu', 'force-light-icon', '0'),
|
||||||
'cache' => $this->config->getAppValue('side_menu', 'cache', '0'),
|
'cache' => $this->config->getAppValue('side_menu', 'cache', '0'),
|
||||||
|
|
|
@ -90,6 +90,24 @@
|
||||||
body.append(sideMenuContainer)
|
body.append(sideMenuContainer)
|
||||||
sideMenuContainer.append(sideMenu)
|
sideMenuContainer.append(sideMenu)
|
||||||
|
|
||||||
|
<?php if ($_['loader-enabled'] === true): ?>
|
||||||
|
var pageLoader = $('<div id="side-menu-loader">')
|
||||||
|
var pageLoaderBar = $('<div id="side-menu-loader-bar">')
|
||||||
|
|
||||||
|
body.append(pageLoader)
|
||||||
|
pageLoader.append(pageLoaderBar)
|
||||||
|
|
||||||
|
var pageLoaderValue = 0
|
||||||
|
|
||||||
|
$(window).on('beforeunload', function() {
|
||||||
|
setInterval(function() {
|
||||||
|
pageLoaderBar.width(pageLoaderValue.toString() + '%')
|
||||||
|
|
||||||
|
pageLoaderValue = Math.min(pageLoaderValue + .2, 100)
|
||||||
|
}, 25)
|
||||||
|
})
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ($_['opener-position'] === 'before'): ?>
|
<?php if ($_['opener-position'] === 'before'): ?>
|
||||||
sideMenuOpener.insertBefore('#nextcloud')
|
sideMenuOpener.insertBefore('#nextcloud')
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
|
|
|
@ -102,6 +102,20 @@ $choicesSizes = [
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label for="side-menu-text-color" class="settings-hint">
|
||||||
|
<?php p($l->t('Loader')); ?>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<input
|
||||||
|
id="side-menu-loader-color"
|
||||||
|
name="loader-color"
|
||||||
|
type="color"
|
||||||
|
class="side-menu-setting"
|
||||||
|
value="<?php print_unescaped($_['loader-color']); ?>">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="section">
|
<div class="section">
|
||||||
|
@ -256,6 +270,22 @@ $choicesSizes = [
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label for="side-menu-loader-enabled" class="settings-hint">
|
||||||
|
<?php p($l->t('Loader enabled')); ?>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<select id="side-menu-loader-enabled" name="loader-enabled" class="side-menu-setting">
|
||||||
|
<?php foreach ($choicesYesNo as $label => $value): ?>
|
||||||
|
<option value="<?php echo $value ?>" <?php if ($value === $_['loader-enabled']): ?>selected<?php endif; ?>>
|
||||||
|
<?php echo $l->t($label); ?>
|
||||||
|
</option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label for="side-menu-external-sites-in-top-menu" class="settings-hint">
|
<label for="side-menu-external-sites-in-top-menu" class="settings-hint">
|
||||||
<?php p($l->t('Do not move external sites in the side menu')); ?>
|
<?php p($l->t('Do not move external sites in the side menu')); ?>
|
||||||
|
|
Loading…
Reference in New Issue