Apply user-defined CSS after plugins' JavaScript runs (#3661)

This commit is contained in:
Naoki Takezoe
2024-12-15 12:30:07 +09:00
committed by GitHub
parent ef95ce99d2
commit 2abdd233e7
2 changed files with 15 additions and 0 deletions

View File

@@ -192,6 +192,16 @@ trait IndexControllerBase extends ControllerBase {
Ok()
}
get("/user.css") {
context.settings.userDefinedCss match {
case Some(css) =>
contentType = "text/css"
css
case None =>
NotFound()
}
}
/**
* Set account information into HttpSession and redirect.
*/

View File

@@ -159,5 +159,10 @@
@Html(script)
</script>
}
@if(context.settings.userDefinedCss.isDefined) {
<script>
$('head').append($('<link rel="stylesheet" type="text/css" href="@context.baseUrl/user.css">'))
</script>
}
</body>
</html>