2024-05-04 12:41:40 +00:00
|
|
|
<script src="{{ url_for('static', filename='external/materialize/js/materialize.min.js') }}"></script>
|
2024-04-11 12:13:04 +00:00
|
|
|
<script src="{{ url_for('static', filename='external/JSON-Patch/js/fast-json-patch.min.js') }}"></script>
|
|
|
|
<script src="{{ url_for('static', filename='external/list.js/js/list.min.js') }}"></script>
|
|
|
|
<script src="{{ url_for('static', filename='external/pako/js/pako_inflate.min.js') }}"></script>
|
|
|
|
<script src="{{ url_for('static', filename='external/plotly.js/js/plotly.min.js') }}"></script>
|
|
|
|
<script src="{{ url_for('static', filename='external/socket.io/js/socket.io.min.js') }}"></script>
|
2024-05-04 12:41:40 +00:00
|
|
|
{% assets
|
2023-10-04 10:32:27 +00:00
|
|
|
filters='rjsmin',
|
|
|
|
output='gen/app.%(version)s.js',
|
2023-11-09 13:29:01 +00:00
|
|
|
'js/index.js',
|
|
|
|
'js/app.js',
|
|
|
|
'js/utils.js'
|
2024-05-04 12:41:40 +00:00
|
|
|
-%}
|
2023-10-04 10:32:27 +00:00
|
|
|
<script src="{{ ASSET_URL }}"></script>
|
2024-05-04 12:41:40 +00:00
|
|
|
{% endassets -%}
|
2023-10-04 10:32:27 +00:00
|
|
|
|
2024-05-04 12:41:40 +00:00
|
|
|
{% assets
|
2023-03-08 10:42:53 +00:00
|
|
|
filters='rjsmin',
|
|
|
|
output='gen/Forms.%(version)s.js',
|
2023-10-05 14:08:04 +00:00
|
|
|
'js/forms/index.js',
|
2023-10-11 12:26:07 +00:00
|
|
|
'js/forms/base-form.js',
|
2023-10-05 14:08:04 +00:00
|
|
|
'js/forms/create-contribution-form.js',
|
|
|
|
'js/forms/create-corpus-file-form.js',
|
|
|
|
'js/forms/create-job-form.js'
|
2024-05-04 12:41:40 +00:00
|
|
|
-%}
|
2023-03-08 10:42:53 +00:00
|
|
|
<script src="{{ ASSET_URL }}"></script>
|
2024-05-04 12:41:40 +00:00
|
|
|
{% endassets -%}
|
2023-10-04 10:32:27 +00:00
|
|
|
|
2024-05-04 12:41:40 +00:00
|
|
|
{% assets
|
2023-03-08 10:42:53 +00:00
|
|
|
filters='rjsmin',
|
2023-10-05 12:11:17 +00:00
|
|
|
output='gen/resource-displays.%(version)s.js',
|
|
|
|
'js/resource-displays/index.js',
|
2023-10-11 12:26:07 +00:00
|
|
|
'js/resource-displays/resource-display.js',
|
2023-10-05 12:11:17 +00:00
|
|
|
'js/resource-displays/corpus-display.js',
|
|
|
|
'js/resource-displays/job-display.js'
|
2024-05-04 12:41:40 +00:00
|
|
|
-%}
|
2023-03-08 10:42:53 +00:00
|
|
|
<script src="{{ ASSET_URL }}"></script>
|
2024-05-04 12:41:40 +00:00
|
|
|
{% endassets -%}
|
2023-10-04 10:32:27 +00:00
|
|
|
|
2024-05-04 12:41:40 +00:00
|
|
|
{% assets
|
2023-03-08 10:42:53 +00:00
|
|
|
filters='rjsmin',
|
2023-10-11 14:20:17 +00:00
|
|
|
output='gen/resource-lists.%(version)s.js',
|
|
|
|
'js/resource-lists/index.js',
|
|
|
|
'js/resource-lists/resource-list.js',
|
|
|
|
'js/resource-lists/admin-user-list.js',
|
|
|
|
'js/resource-lists/corpus-file-list.js',
|
|
|
|
'js/resource-lists/corpus-follower-list.js',
|
|
|
|
'js/resource-lists/corpus-list.js',
|
|
|
|
'js/resource-lists/corpus-text-info-list.js',
|
|
|
|
'js/resource-lists/corpus-token-list.js',
|
|
|
|
'js/resource-lists/detailed-public-corpus-list.js',
|
|
|
|
'js/resource-lists/job-input-list.js',
|
|
|
|
'js/resource-lists/job-list.js',
|
|
|
|
'js/resource-lists/job-result-list.js',
|
|
|
|
'js/resource-lists/public-corpus-list.js',
|
2023-10-25 14:21:30 +00:00
|
|
|
'js/resource-lists/public-user-list.js',
|
2023-10-11 14:20:17 +00:00
|
|
|
'js/resource-lists/spacy-nlp-pipeline-model-list.js',
|
2023-10-25 14:21:30 +00:00
|
|
|
'js/resource-lists/tesseract-ocr-pipeline-model-list.js'
|
2024-05-04 12:41:40 +00:00
|
|
|
-%}
|
2023-03-08 10:42:53 +00:00
|
|
|
<script src="{{ ASSET_URL }}"></script>
|
2024-05-04 12:41:40 +00:00
|
|
|
{% endassets -%}
|
2023-10-04 10:32:27 +00:00
|
|
|
|
2024-05-04 12:41:40 +00:00
|
|
|
{% assets
|
2023-03-08 10:42:53 +00:00
|
|
|
filters='rjsmin',
|
2023-10-04 10:32:27 +00:00
|
|
|
output='gen/requests.%(version)s.js',
|
|
|
|
'js/requests/index.js',
|
|
|
|
'js/requests/admin.js',
|
|
|
|
'js/requests/contributions.js',
|
|
|
|
'js/requests/corpora.js',
|
|
|
|
'js/requests/jobs.js',
|
|
|
|
'js/requests/users.js'
|
2024-05-04 12:41:40 +00:00
|
|
|
-%}
|
2021-05-28 13:51:23 +00:00
|
|
|
<script src="{{ ASSET_URL }}"></script>
|
2024-05-04 12:41:40 +00:00
|
|
|
{% endassets -%}
|
2023-10-04 10:32:27 +00:00
|
|
|
|
2024-05-04 12:41:40 +00:00
|
|
|
{% assets
|
2023-09-25 10:42:10 +00:00
|
|
|
filters='rjsmin',
|
2023-11-10 09:27:39 +00:00
|
|
|
output='gen/corpus-analysis.%(version)s.js',
|
2023-11-13 11:59:36 +00:00
|
|
|
'js/corpus-analysis/index.js',
|
|
|
|
'js/corpus-analysis/cqi/index.js',
|
|
|
|
'js/corpus-analysis/cqi/constants.js',
|
|
|
|
'js/corpus-analysis/cqi/errors.js',
|
|
|
|
'js/corpus-analysis/cqi/status.js',
|
|
|
|
'js/corpus-analysis/cqi/api/index.js',
|
|
|
|
'js/corpus-analysis/cqi/api/client.js',
|
|
|
|
'js/corpus-analysis/cqi/models/index.js',
|
|
|
|
'js/corpus-analysis/cqi/models/resource.js',
|
|
|
|
'js/corpus-analysis/cqi/models/attributes.js',
|
|
|
|
'js/corpus-analysis/cqi/models/subcorpora.js',
|
|
|
|
'js/corpus-analysis/cqi/models/corpora.js',
|
|
|
|
'js/corpus-analysis/cqi/client.js',
|
|
|
|
'js/corpus-analysis/query-builder/index.js',
|
|
|
|
'js/corpus-analysis/query-builder/element-references.js',
|
2023-11-13 13:20:19 +00:00
|
|
|
'js/corpus-analysis/query-builder/query-builder.js',
|
2023-11-13 11:59:36 +00:00
|
|
|
'js/corpus-analysis/query-builder/structural-attribute-builder-functions.js',
|
|
|
|
'js/corpus-analysis/query-builder/token-attribute-builder-functions.js',
|
|
|
|
'js/corpus-analysis/app.js',
|
|
|
|
'js/corpus-analysis/concordance-extension.js',
|
|
|
|
'js/corpus-analysis/reader-extension.js',
|
|
|
|
'js/corpus-analysis/static-visualization-extension.js'
|
2024-05-04 12:41:40 +00:00
|
|
|
-%}
|
2023-09-25 10:42:10 +00:00
|
|
|
<script src="{{ ASSET_URL }}"></script>
|
2024-05-04 12:41:40 +00:00
|
|
|
{% endassets -%}
|
2023-10-04 10:32:27 +00:00
|
|
|
|
2021-05-28 13:51:23 +00:00
|
|
|
<script>
|
2023-10-04 12:07:39 +00:00
|
|
|
// TODO: Implement an app.run method and use this for all of the following
|
2023-10-30 10:36:28 +00:00
|
|
|
const app = new nopaque.App();
|
2023-10-24 13:09:20 +00:00
|
|
|
app.init();
|
|
|
|
|
2024-05-04 12:41:40 +00:00
|
|
|
{% if current_user.is_authenticated -%}
|
2023-10-24 13:09:20 +00:00
|
|
|
// TODO: Set this as a property of the app object
|
2021-12-09 14:39:45 +00:00
|
|
|
const currentUserId = {{ current_user.hashid|tojson }};
|
|
|
|
|
2023-10-24 13:09:20 +00:00
|
|
|
// Subscribe to the current user's data events
|
2023-01-03 16:03:47 +00:00
|
|
|
app.subscribeUser(currentUserId)
|
|
|
|
.catch((error) => {throw JSON.stringify(error);});
|
2023-10-24 13:09:20 +00:00
|
|
|
|
|
|
|
// Get the current user's data
|
2023-01-03 16:03:47 +00:00
|
|
|
app.getUser(currentUserId, true, true)
|
|
|
|
.catch((error) => {throw JSON.stringify(error);});
|
2022-04-12 14:11:24 +00:00
|
|
|
|
2024-05-04 12:41:40 +00:00
|
|
|
{% if not current_user.terms_of_use_accepted -%}
|
2023-10-24 13:09:20 +00:00
|
|
|
M.Modal.getInstance(document.querySelector('#terms-of-use-modal')).open();
|
2024-05-04 12:41:40 +00:00
|
|
|
{% endif -%}
|
|
|
|
{% endif -%}
|
2021-12-09 14:39:45 +00:00
|
|
|
|
|
|
|
// Display flashed messages
|
2023-01-03 16:03:47 +00:00
|
|
|
for (let [category, message] of {{ get_flashed_messages(with_categories=True)|tojson }}) {
|
|
|
|
app.flash(message, message);
|
2021-12-09 14:39:45 +00:00
|
|
|
}
|
2021-05-28 13:51:23 +00:00
|
|
|
</script>
|
2023-12-20 14:37:59 +00:00
|
|
|
|
|
|
|
<script>
|
2023-12-21 12:03:58 +00:00
|
|
|
let languageModalSwitch = document.querySelector('#terms-of-use-modal-switch');
|
|
|
|
let termsOfUseModalContent = document.querySelectorAll('.terms-of-use-modal-content');
|
|
|
|
if (languageModalSwitch) {
|
|
|
|
languageModalSwitch.addEventListener('change', function() {
|
|
|
|
termsOfUseModalContent.forEach(content => {
|
2023-12-21 11:48:50 +00:00
|
|
|
content.classList.toggle('hide');
|
|
|
|
});
|
2023-12-20 14:37:59 +00:00
|
|
|
});
|
2023-12-21 11:48:50 +00:00
|
|
|
}
|
2023-12-20 14:37:59 +00:00
|
|
|
</script>
|