1
0
mirror of https://github.com/flarum/core.git synced 2025-07-23 09:41:26 +02:00
Commit Graph

28 Commits

Author SHA1 Message Date
Toby Zerner
2b9e969b95 Fix empty meta description tag. Fixes #1677 2018-12-04 09:28:24 +10:30
David Sevilla Martín
84b4f4832d Throw FileNotFoundException when FileSource path does not exist
Closes #1649.
2018-11-22 23:40:38 +01:00
Toby Zerner
d4cebc5901 Include LESS mixins and variables in all frontend compilers 2018-11-22 12:09:50 +10:30
Toby Zerner
171f9184d9 Refactor frontend code to allow for extension of assets
- Simpler class naming:
    Frontend\CompilerFactory → Frontend\Assets
    Frontend\HtmlDocumentFactory → Frontend\Frontend
    Frontend\HtmlDocument → Frontend\Document

- Remove AssetInterface and simply collect callbacks in Frontend\Assets
  instead

- Remove ContentInterface because it serves no purpose (never type-
  hinted or type-checked)

- Commit and add asset URLs to the Document via a content callback
  instead of in the Document factory class itself

- Add translations and locale assets to Assets separate to the assets
  factory, as non-forum/admin asset bundles probably won't want them

- Update Frontend Extender to allow the creation of new asset bundles

- Make custom LESS validation listener a standalone class instead of
  extending RecompileFrontendAssets
2018-11-22 12:09:50 +10:30
Toby Zerner
d4bf453a5b Fix empty JS files not actually being empty 2018-11-16 15:17:57 +10:30
Toby Zerner
0f05ecbbc6 Fix incorrect regex modifier, causing JS to become malformed is some cases 2018-11-14 06:45:14 +10:30
Franz Liedke
d335ce8eef Tweak ContentInterface so that callables can be used as well 2018-10-21 20:41:45 +02:00
Toby Zerner
5cda25c8b6 Make registration errors still work properly when debug mode is on 2018-09-21 14:18:17 +09:30
Toby Zerner
3a7f88b74c Use default system font instead of Open Sans 2018-09-21 11:20:17 +09:30
Franz Liedke
e8c779fcf4 Frontend extender: Work without extension, too 2018-09-01 16:15:02 +02:00
Toby Zerner
9cb85066fe Apply fixes from StyleCI (#1551)
[ci skip] [skip ci]
2018-08-18 12:13:40 +09:30
Toby Zerner
5f4717da2a Add extension JS as a file to allow sourcemap detection
Fixes #1538
2018-08-18 12:13:17 +09:30
Toby Zerner
651a6bf4ea Frontend refactor (#1471)
Refactor Frontend + Asset code

- Use Laravel's Filesystem component for asset IO, meaning theoretically
  assets should be storable on S3 etc.

- More reliable checking for asset recompilation when debug mode is on,
  so you don't have to constantly delete the compiled assets to force
  a recompile. Should also fix issues with locale JS files being
  recompiled with the same name and cached.

- Remove JavaScript minification, because it will be done by Webpack
  (exception is for the TextFormatter JS).

- Add support for JS sourcemaps.

- Separate frontend view and assets completely. This is an important
  distinction because frontend assets are compiled independent of a
  request, whereas putting together a view depends on a request.

- Bind frontend view/asset factory instances to the container (in
  service providers) rather than subclassing. Asset and content
  populators can be added to these factories – these are simply objects
  that populate the asset compilers or the view with information.

- Add RouteHandlerFactory functions that make it easy to hook up a
  frontend controller with a frontend instance ± some content.

- Remove the need for "nojs"

- Fix cache:clear command

- Recompile assets when settings/enabled extensions change
2018-06-30 12:31:12 +09:30
Toby Zerner
c6ebef3631 Webpack (#1367)
* 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
2018-06-20 13:20:31 +09:30
Toby Zerner
a0105eb40b Use Illuminate Session component instead of Symfony
Symfony's component relies on PHP's native session functionality, which
is not ideal. It automatically sets its own cookie headers, resulting in
this issue: https://github.com/flarum/core/issues/1084#issuecomment-364569953

The Illuminate component is more powerful and has a simpler API for
extension with other drivers and such, and fits in nicely with other
components we use (the majority of which are from Illuminate).
2018-03-18 14:43:44 +01:00
Toby Zerner
b8e5dcd587 fire -> dispatch
As per Illuminate\Contracts\Events\Dispatcher
2018-02-10 12:09:35 +10:30
Willem de Groot
257fb93d03 Fix StyleCI spacing 2018-01-06 12:03:02 +01:00
Franz Liedke
048c0a21c3 Add another newline before custom footer HTML 2018-01-05 23:46:38 +01:00
AFR
0d8dfabbb3 Add Custom Footer HTML (#1315)
* Add Custom Footer HTML

Straight copy from Custom Header HTML

* Move Custom Footer HTML to exactly before `</body>` tag.

* Fix invalid class name

* Append CustomFooterHTML when preparing the view.

* Some consistency in placing the variable
2018-01-05 23:44:11 +01:00
Toby Zerner
b491df89c2 Fix view paths 2017-12-29 21:28:53 +10:30
Daniël Klabbers
2f97da972c merges 5.5 and master into next-back 2017-12-14 01:00:16 +01:00
Daniel Klabbers
949244ae56 fixed symfony translator now using catalogues 2017-11-01 17:07:22 +01:00
Franz Liedke
cafb38aa64 Cleanup code, typehints and class references 2017-10-03 18:54:07 +02:00
Franz Liedke
f33de84540 Fix namespace orderings
(Thanks, StyleCI!)
2017-10-03 18:54:06 +02:00
Franz Liedke
6e8b8ac357 Split up old CoreServiceProvider 2017-10-03 18:52:50 +02:00
Franz Liedke
614f83803b Flarum\Frontend: Rename ConfigureWebApp event to Rendering 2017-10-03 18:45:41 +02:00
Franz Liedke
a12686ac80 Flarum\Frontend: Fix view paths after renaming namespace 2017-10-03 18:45:41 +02:00
Franz Liedke
5e9308fb4c Create new Flarum\Frontend namespace
It replaces the old Http\WebApp namespace and swallows other namespaces
and files, such as Flarum\Asset.
2017-10-03 18:45:40 +02:00