mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-25 02:44:18 +00:00
Use Flask-Assets to compile multiple Javascript files to one
This commit is contained in:
parent
6bc5e5f7b1
commit
e0bbc517e9
4
.gitignore
vendored
4
.gitignore
vendored
@ -3,6 +3,10 @@
|
||||
# C extensions
|
||||
*.so
|
||||
|
||||
# Flask-Assets files
|
||||
.webassets-cache
|
||||
*.compiled.js
|
||||
|
||||
# Docker related files
|
||||
docker-compose.override.yml
|
||||
db
|
||||
|
@ -5,8 +5,10 @@ from flask_mail import Mail
|
||||
from flask_paranoid import Paranoid
|
||||
from flask_socketio import SocketIO
|
||||
from flask_sqlalchemy import SQLAlchemy
|
||||
import flask_assets
|
||||
|
||||
|
||||
assets = flask_assets.Environment()
|
||||
db = SQLAlchemy()
|
||||
login_manager = LoginManager()
|
||||
login_manager.login_view = 'auth.login'
|
||||
@ -20,6 +22,7 @@ def create_app(config_name):
|
||||
app = Flask(__name__)
|
||||
app.config.from_object(config[config_name])
|
||||
|
||||
assets.init_app(app)
|
||||
config[config_name].init_app(app)
|
||||
db.init_app(app)
|
||||
login_manager.init_app(app)
|
||||
|
@ -254,17 +254,23 @@
|
||||
<script src="{{ url_for('static', filename='js/list.min.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/socket.io.min.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/nopaque/main.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/nopaque/RessourceDisplays/RessourceDisplay.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/nopaque/RessourceDisplays/CorpusDisplay.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/nopaque/RessourceDisplays/JobDisplay.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/nopaque/RessourceLists/RessourceList.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/nopaque/RessourceLists/CorpusList.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/nopaque/RessourceLists/CorpusFileList.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/nopaque/RessourceLists/JobList.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/nopaque/RessourceLists/JobInputList.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/nopaque/RessourceLists/JobResultList.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/nopaque/RessourceLists/QueryResultList.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/nopaque/RessourceLists/UserList.js') }}"></script>
|
||||
{% assets output="js/nopaque/RessourceDisplays.compiled.js",
|
||||
"js/nopaque/RessourceDisplays/RessourceDisplay.js",
|
||||
"js/nopaque/RessourceDisplays/CorpusDisplay.js",
|
||||
"js/nopaque/RessourceDisplays/JobDisplay.js" %}
|
||||
<script src="{{ ASSET_URL }}"></script>
|
||||
{% endassets %}
|
||||
{% assets output="js/nopaque/RessourceLists.compiled.js",
|
||||
"js/nopaque/RessourceLists/RessourceList.js",
|
||||
"js/nopaque/RessourceLists/CorpusList.js",
|
||||
"js/nopaque/RessourceLists/CorpusFileList.js",
|
||||
"js/nopaque/RessourceLists/JobList.js",
|
||||
"js/nopaque/RessourceLists/JobInputList.js",
|
||||
"js/nopaque/RessourceLists/JobResultList.js",
|
||||
"js/nopaque/RessourceLists/QueryResultList.js",
|
||||
"js/nopaque/RessourceLists/UserList.js" %}
|
||||
<script src="{{ ASSET_URL }}"></script>
|
||||
{% endassets %}
|
||||
<script>
|
||||
// Disable all option elements with no value
|
||||
for (let optionElement of document.querySelectorAll('option[value=""]')) {optionElement.disabled = true;}
|
||||
|
@ -2,6 +2,7 @@ cqi
|
||||
docker
|
||||
eventlet
|
||||
Flask
|
||||
Flask-Assets
|
||||
Flask-Login
|
||||
Flask-Mail
|
||||
Flask-Migrate
|
||||
|
Loading…
Reference in New Issue
Block a user