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

View file

@ -883,11 +883,6 @@ class AppUser extends AbstractApp {
Remote.logout(() => rl.logoutReload((SettingsGet('ParentEmail')||{length:0}).length)); Remote.logout(() => rl.logoutReload((SettingsGet('ParentEmail')||{length:0}).length));
} }
bootend() {
progressJs.end();
this.hideLoading();
}
bootstart() { bootstart() {
super.bootstart(); super.bootstart();
@ -901,16 +896,12 @@ class AppUser extends AbstractApp {
const startupUrl = pString(SettingsGet('StartupUrl')); const startupUrl = pString(SettingsGet('StartupUrl'));
progressJs.set(90);
rl.setWindowTitle(); rl.setWindowTitle();
if (SettingsGet('Auth')) { if (SettingsGet('Auth')) {
rl.setWindowTitle(i18n('GLOBAL/LOADING')); rl.setWindowTitle(i18n('GLOBAL/LOADING'));
this.foldersReload(value => { this.foldersReload(value => {
try { try {
this.bootend();
if (value) { if (value) {
if (startupUrl) { if (startupUrl) {
rl.route.setHash(root(startupUrl), true); rl.route.setHash(root(startupUrl), true);
@ -954,6 +945,7 @@ class AppUser extends AbstractApp {
Settings.capa(Capa.Settings) ? SettingsUserScreen : null Settings.capa(Capa.Settings) ? SettingsUserScreen : null
// false ? AboutUserScreen : null // false ? AboutUserScreen : null
]); ]);
this.hideLoading();
setInterval(() => { setInterval(() => {
const cF = FolderUserStore.currentFolderFullNameRaw(), const cF = FolderUserStore.currentFolderFullNameRaw(),
@ -1024,8 +1016,8 @@ class AppUser extends AbstractApp {
}); });
} else { } else {
this.bootend();
startScreens([LoginUserScreen]); startScreens([LoginUserScreen]);
this.hideLoading();
} }
setInterval(() => dispatchEvent(new CustomEvent('reload-time')), 60000); 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 = () => { showError = () => {
eId('rl-loading').hidden = true; eId('rl-loading').hidden = true;
eId('rl-loading-error').hidden = false; eId('rl-loading-error').hidden = false;
p.end();
}, },
loadScript = src => { loadScript = src => {
@ -51,29 +50,12 @@ const
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const script = doc.createElement('script'); const script = doc.createElement('script');
script.onload = () => { script.onload = () => resolve();
p.set(pStep += step);
resolve();
};
script.onerror = () => reject(new Error(src)); script.onerror = () => reject(new Error(src));
script.src = src; script.src = src;
// script.async = true; // script.async = true;
doc.head.append(script); 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) { if (!navigator || !navigator.cookieEnabled) {
@ -83,10 +65,14 @@ if (!navigator || !navigator.cookieEnabled) {
const layout = getCookie('rllayout'); const layout = getCookie('rllayout');
doc.documentElement.classList.toggle('rl-mobile', 'mobile' === layout || (!layout && 1000 > innerWidth)); doc.documentElement.classList.toggle('rl-mobile', 'mobile' === layout || (!layout && 1000 > innerWidth));
let pStep = 0, let progress = eId('progressjs'),
progress = eId('progressjs'),
RL_APP_DATA = {}; RL_APP_DATA = {};
if (progress) {
progress.remove();
progress = null;
}
win.rl = { win.rl = {
data: () => RL_APP_DATA, data: () => RL_APP_DATA,
adminArea: () => admin, adminArea: () => admin,
@ -125,8 +111,6 @@ win.rl = {
} }
}; };
p.set(1);
Storage('local'); Storage('local');
eId('app-css').href = eId('app-css').dataset.href; eId('app-css').href = eId('app-css').dataset.href;

View file

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

View file

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