1
0
mirror of https://github.com/flarum/core.git synced 2025-08-30 11:30:21 +02:00

Display "Loading..." text while JS is loading

This commit is contained in:
Toby Zerner
2015-11-02 16:47:36 +10:30
parent 4e047bae6a
commit 7dcb99621d
3 changed files with 43 additions and 27 deletions

View File

@@ -22,30 +22,35 @@
<div id="alerts"></div>
@if (! $noJs)
@foreach ($scripts as $file)
<script src="{{ $forum->attributes->baseUrl . str_replace(public_path(), '', $file) }}"></script>
@endforeach
<script>
document.getElementById('flarum-loading').style.display = 'block';
</script>
<script>
@if (! $forum->attributes->debug)
try {
@endif
var app = System.get('flarum/app').default;
@foreach ($scripts as $file)
<script src="{{ $forum->attributes->baseUrl . str_replace(public_path(), '', $file) }}"></script>
@endforeach
babelHelpers._extends(app, {!! json_encode($app) !!});
<script>
document.getElementById('flarum-loading').style.display = 'none';
@if (! $forum->attributes->debug)
try {
@endif
var app = System.get('flarum/app').default;
@foreach ($bootstrappers as $bootstrapper)
System.get('{{ $bootstrapper }}');
@endforeach
babelHelpers._extends(app, {!! json_encode($app) !!});
app.boot();
@if (! $forum->attributes->debug)
} catch (e) {
var nojs = window.location.search ? '&nojs=1' : '?nojs=1';
window.location = window.location + nojs;
}
@endif
</script>
@foreach ($bootstrappers as $bootstrapper)
System.get('{{ $bootstrapper }}');
@endforeach
app.boot();
@if (! $forum->attributes->debug)
} catch (e) {
var nojs = window.location.search ? '&nojs=1' : '?nojs=1';
window.location = window.location + nojs;
}
@endif
</script>
@endif
{!! $foot !!}