mirror of
https://github.com/flarum/core.git
synced 2025-07-21 00:31:17 +02:00
Display "Loading..." text while JS is loading
This commit is contained in:
@@ -137,3 +137,10 @@ blockquote ol:last-child {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#flarum-loading {
|
||||||
|
text-align: center;
|
||||||
|
padding: 50px 0;
|
||||||
|
font-size: 18px;
|
||||||
|
color: @muted-more-color;
|
||||||
|
}
|
||||||
|
@@ -22,30 +22,35 @@
|
|||||||
<div id="alerts"></div>
|
<div id="alerts"></div>
|
||||||
|
|
||||||
@if (! $noJs)
|
@if (! $noJs)
|
||||||
@foreach ($scripts as $file)
|
<script>
|
||||||
<script src="{{ $forum->attributes->baseUrl . str_replace(public_path(), '', $file) }}"></script>
|
document.getElementById('flarum-loading').style.display = 'block';
|
||||||
@endforeach
|
</script>
|
||||||
|
|
||||||
<script>
|
@foreach ($scripts as $file)
|
||||||
@if (! $forum->attributes->debug)
|
<script src="{{ $forum->attributes->baseUrl . str_replace(public_path(), '', $file) }}"></script>
|
||||||
try {
|
@endforeach
|
||||||
@endif
|
|
||||||
var app = System.get('flarum/app').default;
|
|
||||||
|
|
||||||
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)
|
babelHelpers._extends(app, {!! json_encode($app) !!});
|
||||||
System.get('{{ $bootstrapper }}');
|
|
||||||
@endforeach
|
|
||||||
|
|
||||||
app.boot();
|
@foreach ($bootstrappers as $bootstrapper)
|
||||||
@if (! $forum->attributes->debug)
|
System.get('{{ $bootstrapper }}');
|
||||||
} catch (e) {
|
@endforeach
|
||||||
var nojs = window.location.search ? '&nojs=1' : '?nojs=1';
|
|
||||||
window.location = window.location + nojs;
|
app.boot();
|
||||||
}
|
@if (! $forum->attributes->debug)
|
||||||
@endif
|
} catch (e) {
|
||||||
</script>
|
var nojs = window.location.search ? '&nojs=1' : '?nojs=1';
|
||||||
|
window.location = window.location + nojs;
|
||||||
|
}
|
||||||
|
@endif
|
||||||
|
</script>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
{!! $foot !!}
|
{!! $foot !!}
|
||||||
|
@@ -1,12 +1,16 @@
|
|||||||
|
<div id="flarum-loading" style="display: none">
|
||||||
|
{{ $translator->trans('core.basic.loading_text') }}
|
||||||
|
</div>
|
||||||
|
|
||||||
@if (! $noJs) <noscript> @endif
|
@if (! $noJs) <noscript> @endif
|
||||||
<div class="Alert">
|
<div class="Alert">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
@if ($noJs)
|
@if ($noJs)
|
||||||
{{ $translator->trans('core.basic.load_error_message') }}
|
{{ $translator->trans('core.basic.load_error_message') }}
|
||||||
@else
|
@else
|
||||||
{{ $translator->trans('core.basic.javascript_disabled_message') }}
|
{{ $translator->trans('core.basic.javascript_disabled_message') }}
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{!! $content !!}
|
{!! $content !!}
|
||||||
|
Reference in New Issue
Block a user