mirror of
https://github.com/flarum/framework.git
synced 2024-11-29 21:11:55 +08:00
3f683dd6ee
* Replace gulp with webpack and npm scripts for JS compilation * Set up Travis CI to commit compiled JS * Restructure `js` directory; only one instance of npm, forum/admin are "submodules" * Refactor JS initializers into Application subclasses * Maintain partial compatibility API (importing from absolute paths) for extensions * Remove minification responsibility from PHP asset compiler * Restructure `less` directory
62 lines
1.6 KiB
PHP
62 lines
1.6 KiB
PHP
<!doctype html>
|
|
<html dir="{{ $direction }}" lang="{{ $language }}">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>{{ $title }}</title>
|
|
<meta name="description" content="{{ $description }}">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1">
|
|
<meta name="theme-color" content="{{ array_get($forum, 'attributes.themePrimaryColor') }}">
|
|
@if (! $allowJs)
|
|
<meta name="robots" content="noindex" />
|
|
@endif
|
|
|
|
@foreach ($cssUrls as $url)
|
|
<link rel="stylesheet" href="{{ $url }}">
|
|
@endforeach
|
|
|
|
@if ($faviconUrl = array_get($forum, 'attributes.faviconUrl'))
|
|
<link href="{{ $faviconUrl }}" rel="shortcut icon">
|
|
@endif
|
|
|
|
{!! $head !!}
|
|
</head>
|
|
|
|
<body>
|
|
{!! $layout !!}
|
|
|
|
<div id="modal"></div>
|
|
<div id="alerts"></div>
|
|
|
|
@if ($allowJs)
|
|
<script>
|
|
document.getElementById('flarum-loading').style.display = 'block';
|
|
var flarum={extensions:{}};
|
|
</script>
|
|
|
|
@foreach ($jsUrls as $url)
|
|
<script src="{{ $url }}"></script>
|
|
@endforeach
|
|
|
|
<script>
|
|
document.getElementById('flarum-loading').style.display = 'none';
|
|
@if (! $debug)
|
|
try {
|
|
@endif
|
|
flarum.core.app.boot(@json($payload));
|
|
@if (! $debug)
|
|
} catch (e) {
|
|
window.location += (window.location.search ? '&' : '?') + 'nojs=1';
|
|
throw e;
|
|
}
|
|
@endif
|
|
</script>
|
|
@else
|
|
<script>
|
|
window.history.replaceState(null, null, window.location.toString().replace(/([&?]nojs=1$|nojs=1&)/, ''));
|
|
</script>
|
|
@endif
|
|
|
|
{!! $foot !!}
|
|
</body>
|
|
</html>
|