mirror of
https://github.com/Derpy-Leggies/OnlyLegs.git
synced 2025-06-29 11:36:16 +00:00
Move JS into pre and post loading folders
This commit is contained in:
parent
266e959605
commit
654ab0eba3
7 changed files with 13 additions and 7 deletions
|
@ -62,9 +62,11 @@ def create_app(test_config=None):
|
|||
# Load theme
|
||||
theme_manager.compile_theme('default', app.root_path)
|
||||
|
||||
# Bundle JS files
|
||||
js_scripts = Bundle('js/*.js', output='gen/packed.js')
|
||||
assets.register('js_all', js_scripts)
|
||||
# Load JS assets
|
||||
js_pre = Bundle('js/pre/*.js', output='gen/pre_packed.js')
|
||||
js_post = Bundle('js/post/*.js', output='gen/post_packed.js')
|
||||
assets.register('js_pre', js_pre)
|
||||
assets.register('js_post', js_post)
|
||||
|
||||
# Error handlers, if the error is not a HTTP error, return 500
|
||||
@app.errorhandler(Exception)
|
||||
|
|
|
@ -54,7 +54,7 @@ function login(event) {
|
|||
}
|
||||
|
||||
// Make form
|
||||
let formData = new FormData();
|
||||
const formData = new FormData();
|
||||
formData.append("username", formUsername);
|
||||
formData.append("password", formPassword);
|
||||
|
||||
|
@ -153,7 +153,7 @@ function register(event) {
|
|||
}
|
||||
|
||||
// Make form
|
||||
let formData = new FormData();
|
||||
const formData = new FormData();
|
||||
formData.append("username", formUsername);
|
||||
formData.append("email", formEmail);
|
||||
formData.append("password", formPassword);
|
|
@ -167,7 +167,7 @@ function clearUpload() {
|
|||
// }
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
// Function to upload images
|
||||
let uploadTab = document.querySelector(".upload-panel");
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
<link rel="stylesheet" href="{{url_for('static', filename='theme/style.css')}}" defer>
|
||||
|
||||
{% assets "js_all" %}
|
||||
{% assets "js_pre" %}
|
||||
<script type="text/javascript" src="{{ ASSET_URL }}"></script>
|
||||
{% endassets %}
|
||||
|
||||
|
@ -152,6 +152,10 @@
|
|||
{% endfor %}
|
||||
</script>
|
||||
|
||||
{% assets "js_post" %}
|
||||
<script type="text/javascript" src="{{ ASSET_URL }}"></script>
|
||||
{% endassets %}
|
||||
|
||||
{% block script %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue