mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2026-11-20 09:26:20 +00:00
Compare commits
5
Commits
ff1bcb40f3
...
d0fe4360bb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d0fe4360bb | ||
|
|
1c18806c9c | ||
|
|
9487aa7a60 | ||
|
|
6559051fd5 | ||
|
|
0882e085a3 |
No files matched your search
@@ -45,12 +45,6 @@ def dashboard():
|
||||
)
|
||||
|
||||
|
||||
# @bp.route('/user_manual')
|
||||
# @register_breadcrumb(bp, '.user_manual', '<i class="material-icons left">help</i>User manual')
|
||||
# def user_manual():
|
||||
# return render_template('main/user_manual.html.j2', title='User manual')
|
||||
|
||||
|
||||
@bp.route('/news')
|
||||
@register_breadcrumb(bp, '.news', '<i class="material-icons left">email</i>News')
|
||||
def news():
|
||||
|
||||
@@ -68,7 +68,7 @@ nopaque.corpus_analysis.query_builder.QueryBuilder = class QueryBuilder {
|
||||
})
|
||||
}
|
||||
|
||||
submitQueryChipElement(dataType = undefined, prettyQueryText = undefined, queryText = undefined, index = null, isClosingTag = false, isEditable = false) {
|
||||
submitQueryChipElement(dataType=undefined, prettyQueryText=undefined, queryText=undefined, index=null, isClosingTag=false, isEditable=false) {
|
||||
if (this.elements.editingModusOn) {
|
||||
let editedQueryChipElement = this.elements.queryChipElements[this.elements.editedQueryChipElementIndex];
|
||||
editedQueryChipElement.dataset.type = dataType;
|
||||
@@ -81,7 +81,7 @@ nopaque.corpus_analysis.query_builder.QueryBuilder = class QueryBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
queryChipFactory(dataType, prettyQueryText, queryText, index = null, isClosingTag = false, isEditable = false) {
|
||||
queryChipFactory(dataType, prettyQueryText, queryText, index=null, isClosingTag=false, isEditable=false) {
|
||||
// Creates a new query chip element, adds Eventlisteners for selection, deletion and drag and drop and appends it to the query input field.
|
||||
queryText = nopaque.Utils.escape(queryText);
|
||||
prettyQueryText = nopaque.Utils.escape(prettyQueryText);
|
||||
@@ -93,7 +93,7 @@ nopaque.corpus_analysis.query_builder.QueryBuilder = class QueryBuilder {
|
||||
</span>
|
||||
`
|
||||
);
|
||||
this.actionListeners(queryChipElement);
|
||||
this.addActionListeners(queryChipElement);
|
||||
queryChipElement.addEventListener('dragstart', this.handleDragStart.bind(this, queryChipElement));
|
||||
queryChipElement.addEventListener('dragend', this.handleDragEnd);
|
||||
|
||||
@@ -119,7 +119,7 @@ nopaque.corpus_analysis.query_builder.QueryBuilder = class QueryBuilder {
|
||||
this.queryPreviewBuilder();
|
||||
}
|
||||
|
||||
actionListeners(queryChipElement) {
|
||||
addActionListeners(queryChipElement) {
|
||||
let notQuantifiableDataTypes = ['start-sentence', 'end-sentence', 'start-entity', 'start-empty-entity', 'end-entity', 'token-incidence-modifier'];
|
||||
queryChipElement.addEventListener('click', (event) => {
|
||||
if (event.target.classList.contains('chip')) {
|
||||
@@ -129,8 +129,7 @@ nopaque.corpus_analysis.query_builder.QueryBuilder = class QueryBuilder {
|
||||
}
|
||||
});
|
||||
let chipActionButtons = queryChipElement.querySelectorAll('.chip-action-button');
|
||||
// chipActionButtons.forEach(button => {
|
||||
for (let button of chipActionButtons) {
|
||||
chipActionButtons.forEach(button => {
|
||||
button.addEventListener('click', (event) => {
|
||||
if (event.target.dataset.chipAction === 'delete') {
|
||||
this.deleteChipElement(queryChipElement);
|
||||
@@ -140,8 +139,7 @@ nopaque.corpus_analysis.query_builder.QueryBuilder = class QueryBuilder {
|
||||
this.lockClosingChipElement(queryChipElement);
|
||||
}
|
||||
});
|
||||
}
|
||||
// });
|
||||
});
|
||||
}
|
||||
|
||||
editChipElement(queryChipElement) {
|
||||
@@ -175,10 +173,10 @@ nopaque.corpus_analysis.query_builder.QueryBuilder = class QueryBuilder {
|
||||
let elementIndex = Array.from(this.elements.queryInputField.children).indexOf(attr);
|
||||
switch (attr.dataset.type) {
|
||||
case 'start-sentence':
|
||||
this.deletingClosingTagHandler(elementIndex, 'end-sentence');
|
||||
this.deleteClosingTagHandler(elementIndex, 'end-sentence');
|
||||
break;
|
||||
case 'start-entity':
|
||||
this.deletingClosingTagHandler(elementIndex, 'end-entity');
|
||||
this.deleteClosingTagHandler(elementIndex, 'end-entity');
|
||||
break;
|
||||
case 'token':
|
||||
let nextElement = Array.from(this.elements.queryInputField.children)[elementIndex+1];
|
||||
@@ -196,7 +194,7 @@ nopaque.corpus_analysis.query_builder.QueryBuilder = class QueryBuilder {
|
||||
this.queryPreviewBuilder();
|
||||
}
|
||||
|
||||
deletingClosingTagHandler(elementIndex, closingTagType) {
|
||||
deleteClosingTagHandler(elementIndex, closingTagType) {
|
||||
let closingTags = this.elements.queryInputField.querySelectorAll(`[data-type="${closingTagType}"]`);
|
||||
for (let i = 0; i < closingTags.length; i++) {
|
||||
let closingTag = closingTags[i];
|
||||
@@ -208,7 +206,7 @@ nopaque.corpus_analysis.query_builder.QueryBuilder = class QueryBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
handleDragStart(queryChipElement, event) {
|
||||
handleDragStart(queryChipElement) {
|
||||
// is called when a query chip is dragged. It creates a dropzone (in form of a chip) for the dragged chip and adds it to the query input field.
|
||||
let queryChips = this.elements.queryInputField.querySelectorAll('.query-component');
|
||||
if (queryChipElement.dataset.type === 'token-incidence-modifier') {
|
||||
@@ -232,7 +230,7 @@ nopaque.corpus_analysis.query_builder.QueryBuilder = class QueryBuilder {
|
||||
}, 0);
|
||||
}
|
||||
|
||||
handleDragEnd(event) {
|
||||
handleDragEnd() {
|
||||
document.querySelectorAll('.drop-target').forEach(target => target.remove());
|
||||
}
|
||||
|
||||
|
||||
@@ -102,36 +102,12 @@ nopaque.corpus_analysis.query_builder.TokenAttributeBuilderFunctions = class Tok
|
||||
notSelectedButton.parentNode.removeChild(notSelectedButton);
|
||||
this.elements.tokenQuery.appendChild(tokenQueryTemplateClone);
|
||||
|
||||
// Deleting the options which do not make sense in the context of the condition like "word" AND "word". Also sets selection default.
|
||||
let selectionDefault = "word";
|
||||
let optionDeleteList = ['empty-token'];
|
||||
if (conditionText === 'and') {
|
||||
switch (this.elements.positionalAttrSelection.value) {
|
||||
case 'english-pos' || 'german-pos':
|
||||
optionDeleteList.push('english-pos', 'german-pos');
|
||||
break;
|
||||
default:
|
||||
optionDeleteList.push(this.elements.positionalAttrSelection.value);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
let originalSelectionList =
|
||||
`
|
||||
<option value="word" selected>word</option>
|
||||
<option value="lemma" >lemma</option>
|
||||
<option value="english-pos">english pos</option>
|
||||
<option value="german-pos">german pos</option>
|
||||
<option value="simple_pos">simple_pos</option>
|
||||
`;
|
||||
this.elements.positionalAttrSelection.innerHTML = originalSelectionList;
|
||||
M.FormSelect.init(this.elements.positionalAttrSelection);
|
||||
}
|
||||
let lastTokenQueryRow = this.elements.tokenQuery.lastElementChild;
|
||||
if(lastTokenQueryRow.querySelector('[data-kind-of-token="word"]') || lastTokenQueryRow.querySelector('[data-kind-of-token="lemma"]')) {
|
||||
this.appendIgnoreCaseCheckbox(lastTokenQueryRow.querySelector('.token-query-template-content'), this.elements.ignoreCaseCheckbox.checked);
|
||||
}
|
||||
this.elements.ignoreCaseCheckbox.checked = false;
|
||||
this.setTokenSelection(selectionDefault, optionDeleteList);
|
||||
this.setTokenSelection();
|
||||
}
|
||||
|
||||
deleteTokenQueryRow(deleteButton) {
|
||||
@@ -169,7 +145,7 @@ nopaque.corpus_analysis.query_builder.TokenAttributeBuilderFunctions = class Tok
|
||||
}
|
||||
}
|
||||
|
||||
setTokenSelection(selection, optionDeleteList) {
|
||||
setTokenSelection(selection="word", optionDeleteList=['empty-token']) {
|
||||
optionDeleteList.forEach(option => {
|
||||
if (this.elements.positionalAttrSelection.querySelector(`option[value=${option}]`) !== null) {
|
||||
this.elements.positionalAttrSelection.querySelector(`option[value=${option}]`).remove();
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+8
-8
@@ -13,35 +13,35 @@
|
||||
</ul>
|
||||
<div id="manual-modal-introduction">
|
||||
<br>
|
||||
{% include "main/_manual_modal/_01_introduction.html.j2" %}
|
||||
{% include "_base/_modals/_manual/_01_introduction.html.j2" %}
|
||||
</div>
|
||||
<div id="manual-modal-registration-and-log-in">
|
||||
<br>
|
||||
{% include "main/_manual_modal/_02_registration_and_log_in.html.j2" %}
|
||||
{% include "_base/_modals/_manual/_02_registration_and_log_in.html.j2" %}
|
||||
</div>
|
||||
<div id="manual-modal-dashboard">
|
||||
<br>
|
||||
{% include "main/_manual_modal/_03_dashboard.html.j2" %}
|
||||
{% include "_base/_modals/_manual/_03_dashboard.html.j2" %}
|
||||
</div>
|
||||
<div id="manual-modal-services">
|
||||
<br>
|
||||
{% include "main/_manual_modal/_06_services.html.j2" %}
|
||||
{% include "_base/_modals/_manual/_06_services.html.j2" %}
|
||||
</div>
|
||||
<div id="manual-modal-a-closer-look-at-the-corpus-analysis">
|
||||
<br>
|
||||
{% include "main/_manual_modal/_07_a_closer_look_at_the_corpus_analysis.html.j2" %}
|
||||
{% include "_base/_modals/_manual/_07_a_closer_look_at_the_corpus_analysis.html.j2" %}
|
||||
</div>
|
||||
<div id="manual-modal-cqp-query-language">
|
||||
<br>
|
||||
{% include "main/_manual_modal/_08_cqp_query_language.html.j2" %}
|
||||
{% include "_base/_modals/_manual/_08_cqp_query_language.html.j2" %}
|
||||
</div>
|
||||
<div id="manual-modal-query-builder">
|
||||
<br>
|
||||
{% include "main/_manual_modal/_09_query_builder.html.j2" %}
|
||||
{% include "_base/_modals/_manual/_09_query_builder.html.j2" %}
|
||||
</div>
|
||||
<div id="manual-modal-tagsets">
|
||||
<br>
|
||||
{% include "main/_manual_modal/_10_tagsets.html.j2" %}
|
||||
{% include "_base/_modals/_manual/_10_tagsets.html.j2" %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,5 @@
|
||||
{% include "_base/_modals/manual.html.j2" %}
|
||||
|
||||
{% if current_user.is_authenticated and not current_user.terms_of_use_accepted %}
|
||||
{% include "_base/_modals/terms_of_use.html.j2" %}
|
||||
{% endif %}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -16,16 +16,16 @@
|
||||
|
||||
{% block styles %}
|
||||
{{ super() }}
|
||||
{% include "_styles.html.j2" %}
|
||||
{% include "_base/styles.html.j2" %}
|
||||
{% endblock styles %}
|
||||
|
||||
{% block navbar %}
|
||||
{% include "_navbar.html.j2" %}
|
||||
{% include "_base/navbar.html.j2" %}
|
||||
{% endblock navbar %}
|
||||
|
||||
{% block sidenav %}
|
||||
{% if current_user.is_authenticated %}
|
||||
{% include "_sidenav.html.j2" %}
|
||||
{% include "_base/sidenav.html.j2" %}
|
||||
{% endif %}
|
||||
{% endblock sidenav %}
|
||||
|
||||
@@ -34,23 +34,17 @@
|
||||
{% block page_content %}{% endblock page_content %}
|
||||
<div id="modals">
|
||||
{% block modals %}
|
||||
{% include "main/_manual_modal.html.j2" %}
|
||||
{# {% if current_user.is_authenticated %}
|
||||
{% include "_roadmap.html.j2" %}
|
||||
{% endif %} #}
|
||||
{% if current_user.is_authenticated and not current_user.terms_of_use_accepted %}
|
||||
{% include "_terms_of_use_modal.html.j2" %}
|
||||
{% endif %}
|
||||
{% include "_base/modals.html.j2" %}
|
||||
{% endblock modals %}
|
||||
</div>
|
||||
{% endblock main %}
|
||||
|
||||
{% block footer_attribs %} class="page-footer primary-variant-color"{% endblock footer_attribs %}
|
||||
{% block footer %}
|
||||
{% include "_footer.html.j2" %}
|
||||
{% include "_base/footer.html.j2" %}
|
||||
{% endblock footer %}
|
||||
|
||||
{% block scripts %}
|
||||
{{ super() }}
|
||||
{% include "_scripts.html.j2" %}
|
||||
{% include "_base/scripts.html.j2" %}
|
||||
{% endblock scripts %}
|
||||
@@ -1,43 +0,0 @@
|
||||
{% extends "base.html.j2" %}
|
||||
|
||||
{% block page_content %}
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col s12">
|
||||
<h1 id="title">{{ title }}</h1>
|
||||
</div>
|
||||
|
||||
<div class="col s12 m10">
|
||||
<div class="section scrollspy" id="introduction">
|
||||
{% include "main/manual/_01_introduction.html.j2" %}
|
||||
</div>
|
||||
<div class="section scrollspy" id="registration-and-log-in">
|
||||
{% include "main/manual/_02_registration_and_log_in.html.j2" %}
|
||||
</div>
|
||||
<div class="section scrollspy" id="dashboard">
|
||||
{% include "main/manual/_03_dashboard.html.j2" %}
|
||||
</div>
|
||||
<div class="section scrollspy" id="services">
|
||||
{% include "main/manual/_06_services.html.j2" %}
|
||||
</div>
|
||||
<div class="section scrollspy" id="a-closer-look-at-the-corpus-analysis">
|
||||
{% include "main/manual/_07_a_closer_look_at_the_corpus_analysis.html.j2" %}
|
||||
</div>
|
||||
<div class="section scrollspy" id="cqp-query-language">
|
||||
{% include "main/manual/_08_cqp_query_language.html.j2" %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col m2 hide-on-small-only">
|
||||
<ul class="section table-of-contents" style="position: fixed !important;">
|
||||
<li><a href="#introduction">Introduction</a></li>
|
||||
<li><a href="#registration-and-log-in">Registration and Log in</a></li>
|
||||
<li><a href="#dashboard">Dashboard</a></li>
|
||||
<li><a href="#services">Services</a></li>
|
||||
<li><a href="#a-closer-look-at-the-corpus-analysis">A closer look at the Corpus Analysis</a></li>
|
||||
<li><a href="#cqp-query-language">CQP Query Language</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock page_content %}
|
||||
Reference in new issue
Block a user