Remove progressJs bar because we are fast...

This commit is contained in:
djmaze 2021-04-28 22:59:42 +02:00
parent a8fd699575
commit 89b52b512f
6 changed files with 11 additions and 64 deletions

View file

@ -18,9 +18,6 @@ class AdminApp extends AbstractApp {
bootstart() {
super.bootstart();
this.hideLoading();
if (!Settings.app('allowAdminPanel')) {
rl.route.root();
setTimeout(() => location.href = '/', 1);
@ -30,8 +27,7 @@ class AdminApp extends AbstractApp {
} else {
startScreens([LoginAdminScreen]);
}
progressJs.end();
this.hideLoading();
}
}

View file

@ -883,11 +883,6 @@ class AppUser extends AbstractApp {
Remote.logout(() => rl.logoutReload((SettingsGet('ParentEmail')||{length:0}).length));
}
bootend() {
progressJs.end();
this.hideLoading();
}
bootstart() {
super.bootstart();
@ -901,16 +896,12 @@ class AppUser extends AbstractApp {
const startupUrl = pString(SettingsGet('StartupUrl'));
progressJs.set(90);
rl.setWindowTitle();
if (SettingsGet('Auth')) {
rl.setWindowTitle(i18n('GLOBAL/LOADING'));
this.foldersReload(value => {
try {
this.bootend();
if (value) {
if (startupUrl) {
rl.route.setHash(root(startupUrl), true);
@ -954,6 +945,7 @@ class AppUser extends AbstractApp {
Settings.capa(Capa.Settings) ? SettingsUserScreen : null
// false ? AboutUserScreen : null
]);
this.hideLoading();
setInterval(() => {
const cF = FolderUserStore.currentFolderFullNameRaw(),
@ -1024,8 +1016,8 @@ class AppUser extends AbstractApp {
});
} else {
this.bootend();
startScreens([LoginUserScreen]);
this.hideLoading();
}
setInterval(() => dispatchEvent(new CustomEvent('reload-time')), 60000);

View file

@ -1,23 +0,0 @@
#progressjs {
background-color: #999;
left: 0;
overflow: hidden;
position: fixed;
top: 0;
transition: width .5s;
width: 0;
z-index: 2000;
}
#progressjs > div {
animation: simple-pace-stripe-animation 500ms linear infinite;
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.3) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.3) 75%, transparent 75%, transparent);
background-size: 32px 32px;
height: 3px;
margin-right: -32px;
}
@keyframes simple-pace-stripe-animation {
0% { transform: none; }
100% { transform: translate(-32px, 0); }
}

View file

@ -42,7 +42,6 @@ const
showError = () => {
eId('rl-loading').hidden = true;
eId('rl-loading-error').hidden = false;
p.end();
},
loadScript = src => {
@ -51,29 +50,12 @@ const
}
return new Promise((resolve, reject) => {
const script = doc.createElement('script');
script.onload = () => {
p.set(pStep += step);
resolve();
};
script.onload = () => resolve();
script.onerror = () => reject(new Error(src));
script.src = src;
// script.async = true;
doc.head.append(script);
});
},
step = 100 / 7,
p = win.progressJs = {
set: percent => progress.style.width = Math.min(percent, 100) + '%',
end: () => {
if (progress) {
p.set(100);
setTimeout(() => {
progress.remove();
progress = null;
}, 600);
}
}
};
if (!navigator || !navigator.cookieEnabled) {
@ -83,10 +65,14 @@ if (!navigator || !navigator.cookieEnabled) {
const layout = getCookie('rllayout');
doc.documentElement.classList.toggle('rl-mobile', 'mobile' === layout || (!layout && 1000 > innerWidth));
let pStep = 0,
progress = eId('progressjs'),
let progress = eId('progressjs'),
RL_APP_DATA = {};
if (progress) {
progress.remove();
progress = null;
}
win.rl = {
data: () => RL_APP_DATA,
adminArea: () => admin,
@ -125,8 +111,6 @@ win.rl = {
}
};
p.set(1);
Storage('local');
eId('app-css').href = eId('app-css').dataset.href;

View file

@ -39,7 +39,6 @@
</div>
</div>
</div>
<div id="progressjs"><div></div></div>
{{BaseTemplates}}
<script type="text/javascript">{{BaseAppBootScript}}{{BaseLanguage}}</script>
</body>

View file

@ -50,8 +50,7 @@ config.paths.css = {
boot: {
name: 'boot.css',
src: [
'dev/Styles/@Boot.css',
'dev/Styles/_progressjs.css'
'dev/Styles/@Boot.css'
]
}
};