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