mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-24 10:34:17 +00:00
Change js structure for displays
This commit is contained in:
parent
53f4400731
commit
1d6834302d
@ -1,4 +1,4 @@
|
|||||||
class CorpusDisplay extends ResourceDisplay {
|
ResourceDisplays.CorpusDisplay = class CorpusDisplay extends ResourceDisplays.BaseDisplay {
|
||||||
constructor(displayElement) {
|
constructor(displayElement) {
|
||||||
super(displayElement);
|
super(displayElement);
|
||||||
this.corpusId = displayElement.dataset.corpusId;
|
this.corpusId = displayElement.dataset.corpusId;
|
@ -1,4 +1,6 @@
|
|||||||
class ResourceDisplay {
|
var ResourceDisplays = {};
|
||||||
|
|
||||||
|
ResourceDisplays.BaseDisplay = class BaseDisplay {
|
||||||
constructor(displayElement) {
|
constructor(displayElement) {
|
||||||
this.displayElement = displayElement;
|
this.displayElement = displayElement;
|
||||||
this.userId = this.displayElement.dataset.userId;
|
this.userId = this.displayElement.dataset.userId;
|
||||||
@ -41,4 +43,4 @@ class ResourceDisplay {
|
|||||||
this.setElement(element, value);
|
this.setElement(element, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
@ -1,4 +1,4 @@
|
|||||||
class JobDisplay extends ResourceDisplay {
|
ResourceDisplays.JobDisplay = class JobDisplay extends ResourceDisplays.BaseDisplay {
|
||||||
constructor(displayElement) {
|
constructor(displayElement) {
|
||||||
super(displayElement);
|
super(displayElement);
|
||||||
this.jobId = this.displayElement.dataset.jobId;
|
this.jobId = this.displayElement.dataset.jobId;
|
@ -45,10 +45,10 @@
|
|||||||
|
|
||||||
{%- assets
|
{%- assets
|
||||||
filters='rjsmin',
|
filters='rjsmin',
|
||||||
output='gen/ResourceDisplays.%(version)s.js',
|
output='gen/resource-displays.%(version)s.js',
|
||||||
'js/ResourceDisplays/ResourceDisplay.js',
|
'js/resource-displays/index.js',
|
||||||
'js/ResourceDisplays/CorpusDisplay.js',
|
'js/resource-displays/corpus-display.js',
|
||||||
'js/ResourceDisplays/JobDisplay.js'
|
'js/resource-displays/job-display.js'
|
||||||
%}
|
%}
|
||||||
<script src="{{ ASSET_URL }}"></script>
|
<script src="{{ ASSET_URL }}"></script>
|
||||||
{%- endassets %}
|
{%- endassets %}
|
||||||
|
@ -237,7 +237,7 @@
|
|||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
{{ super() }}
|
{{ super() }}
|
||||||
<script>
|
<script>
|
||||||
let corpusDisplay = new CorpusDisplay(document.querySelector('#corpus-display'));
|
let corpusDisplay = new ResourceDisplays.CorpusDisplay(document.querySelector('#corpus-display'));
|
||||||
|
|
||||||
{# {% if current_user.is_following_corpus(corpus) %}
|
{# {% if current_user.is_following_corpus(corpus) %}
|
||||||
let unfollowRequestElement = document.querySelector('.action-button[data-action="unfollow-request"]');
|
let unfollowRequestElement = document.querySelector('.action-button[data-action="unfollow-request"]');
|
||||||
|
@ -150,7 +150,7 @@
|
|||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
{{ super() }}
|
{{ super() }}
|
||||||
<script>
|
<script>
|
||||||
let jobDisplay = new JobDisplay(document.querySelector('#job-display'));
|
let jobDisplay = new ResourceDisplays.JobDisplay(document.querySelector('#job-display'));
|
||||||
let deleteJobRequestElement = document.querySelector('#delete-job-request');
|
let deleteJobRequestElement = document.querySelector('#delete-job-request');
|
||||||
let restartJobRequestElement = document.querySelector('#restart-job-request');
|
let restartJobRequestElement = document.querySelector('#restart-job-request');
|
||||||
deleteJobRequestElement.addEventListener('click', (event) => {
|
deleteJobRequestElement.addEventListener('click', (event) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user