mirror of
https://github.com/flarum/core.git
synced 2025-08-16 05:14:20 +02:00
Refactor the web app bootstrapping code
- All custom JS variables are now preloaded into the `app.data` object, rather than directly on the `app` object. This means that admin settings are available in `app.data.settings` rather than `app.settings`, etc. - Cleaner route handler generation - Renamed ConfigureClientView to ConfigureWebApp, though the former still exists and is deprecated - Partial fix for #881 (strips ?nojs=1 from URL if possible, so that refreshing will attempt to load JS version again)
This commit is contained in:
@@ -23,16 +23,20 @@ class JsCompiler extends BaseJsCompiler
|
||||
|
||||
public function compile()
|
||||
{
|
||||
$output = "System.register('locale', [], function() {
|
||||
$output = "
|
||||
System.register('locale', [], function(_export) {
|
||||
return {
|
||||
execute: function() {
|
||||
app.translator.translations = ".json_encode($this->translations).";\n";
|
||||
_export('default', function(app) {
|
||||
app.translator.translations = ".json_encode($this->translations).";\n";
|
||||
|
||||
foreach ($this->files as $filename) {
|
||||
$output .= file_get_contents($filename);
|
||||
}
|
||||
|
||||
$output .= '}
|
||||
$output .= '
|
||||
});
|
||||
}
|
||||
};
|
||||
});';
|
||||
|
||||
|
Reference in New Issue
Block a user