Merge branch 'loading-indicator'

This commit is contained in:
Toby Zerner 2015-11-03 18:13:11 +10:30
commit 5c0b6d68f5
3 changed files with 43 additions and 27 deletions

View File

@ -137,3 +137,10 @@ blockquote ol:last-child {
margin: 0;
}
}
#flarum-loading {
text-align: center;
padding: 50px 0;
font-size: 18px;
color: @muted-more-color;
}

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 !!}

View File

@ -1,12 +1,16 @@
<div id="flarum-loading" style="display: none">
{{ $translator->trans('core.basic.loading_text') }}
</div>
@if (! $noJs) <noscript> @endif
<div class="Alert">
<div class="container">
@if ($noJs)
{{ $translator->trans('core.basic.load_error_message') }}
@else
{{ $translator->trans('core.basic.javascript_disabled_message') }}
@endif
</div>
<div class="container">
@if ($noJs)
{{ $translator->trans('core.basic.load_error_message') }}
@else
{{ $translator->trans('core.basic.javascript_disabled_message') }}
@endif
</div>
</div>
{!! $content !!}