mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-15 01:05:42 +00:00
73 lines
3.3 KiB
Django/Jinja
73 lines
3.3 KiB
Django/Jinja
<script src="https://cdnjs.cloudflare.com/ajax/libs/fast-json-patch/3.1.1/fast-json-patch.min.js" integrity="sha512-5uDdefwnzyq4N+SkmMBmekZLZNmc6dLixvVxCdlHBfqpyz0N3bzLdrJ55OLm7QrZmgZuhLGgHLDtJwU6RZoFCA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/list.js/2.3.1/list.min.js" integrity="sha512-93wYgwrIFL+b+P3RvYxi/WUFRXXUDSLCT2JQk9zhVGXuS2mHl2axj6d+R6pP+gcU5isMHRj1u0oYE/mWyt/RjA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js" integrity="sha512-WFN04846sdKMIP5LKNphMaWzU7YpMyCU245etK3g/2ARYbPK9Ub18eG+ljU96qKRCWh+quCY7yefSmlkQw1ANQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.5.1/socket.io.min.js" integrity="sha512-mHO4BJ0ELk7Pb1AzhTi3zvUeRgq3RXVOu9tTRfnA6qOxGK4pG2u57DJYolI4KrEnnLTcH9/J5wNOozRTDaybXg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
{%- assets
|
|
filters='rjsmin',
|
|
output='gen/app.%(version)s.js',
|
|
'js/App.js',
|
|
'js/Utils.js',
|
|
'js/Forms/Form.js',
|
|
'js/Forms/CreateCorpusFileForm.js',
|
|
'js/Forms/CreateJobForm.js',
|
|
'js/Forms/CreateContributionForm.js',
|
|
'js/CorpusAnalysis/CQiClient.js',
|
|
'js/CorpusAnalysis/CorpusAnalysisApp.js',
|
|
'js/CorpusAnalysis/CorpusAnalysisConcordance.js',
|
|
'js/CorpusAnalysis/CorpusAnalysisReader.js',
|
|
'js/CorpusAnalysis/QueryBuilder.js',
|
|
'js/RessourceDisplays/RessourceDisplay.js',
|
|
'js/RessourceDisplays/CorpusDisplay.js',
|
|
'js/RessourceDisplays/JobDisplay.js',
|
|
'js/RessourceLists/RessourceList.js',
|
|
'js/RessourceLists/CorpusList.js',
|
|
'js/RessourceLists/CorpusFileList.js',
|
|
'js/RessourceLists/JobList.js',
|
|
'js/RessourceLists/JobInputList.js',
|
|
'js/RessourceLists/JobResultList.js',
|
|
'js/RessourceLists/PublicUserList.js',
|
|
'js/RessourceLists/SpacyNLPPipelineModelList.js',
|
|
'js/RessourceLists/TesseractOCRPipelineModelList.js',
|
|
'js/RessourceLists/UserList.js',
|
|
'js/XMLtoObject.js'
|
|
%}
|
|
<script src="{{ ASSET_URL }}"></script>
|
|
{%- endassets %}
|
|
<script>
|
|
const app = new App();
|
|
{%- if current_user.is_authenticated %}
|
|
const currentUserId = {{ current_user.hashid|tojson }};
|
|
|
|
// Initialize components for current user
|
|
app.subscribeUser(currentUserId)
|
|
.catch((error) => {throw JSON.stringify(error);});
|
|
app.getUser(currentUserId, true, true)
|
|
.catch((error) => {throw JSON.stringify(error);});
|
|
{%- endif %}
|
|
|
|
// Disable all option elements with no value
|
|
for (let optionElement of document.querySelectorAll('option[value=""]')) {
|
|
optionElement.disabled = true;
|
|
}
|
|
|
|
// Set the data-length attribute on textareas/inputs with the maxlength attribute
|
|
for (let inputElement of document.querySelectorAll('textarea[maxlength], input[maxlength]')) {
|
|
inputElement.dataset.length = inputElement.getAttribute('maxlength');
|
|
}
|
|
|
|
// Initialize components
|
|
M.AutoInit();
|
|
M.CharacterCounter.init(document.querySelectorAll('input[data-length], textarea[data-length]'));
|
|
M.Dropdown.init(
|
|
document.querySelectorAll('#nav-more-dropdown-trigger'),
|
|
{alignment: 'right', constrainWidth: false, coverTrigger: false}
|
|
);
|
|
RessourceList.autoInit();
|
|
Form.autoInit();
|
|
|
|
// Display flashed messages
|
|
for (let [category, message] of {{ get_flashed_messages(with_categories=True)|tojson }}) {
|
|
app.flash(message, message);
|
|
}
|
|
</script>
|