mirror of
				https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
				synced 2025-11-04 04:12:45 +00:00 
			
		
		
		
	Create and use a nopaque namespace for functions and ressources
This commit is contained in:
		@@ -122,14 +122,20 @@
 | 
			
		||||
      this.jobId = jobId;
 | 
			
		||||
      this.foreignJobFlag = foreignJobFlag;
 | 
			
		||||
      if (this.foreignJobFlag) {
 | 
			
		||||
        foreignJobsSubscribers.push(this);
 | 
			
		||||
        nopaque.foreignJobsSubscribers.push(this);
 | 
			
		||||
      } else {
 | 
			
		||||
        jobsSubscribers.push(this);
 | 
			
		||||
        nopaque.jobsSubscribers.push(this);
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    _init() {
 | 
			
		||||
      var job = this.foreignJobFlag ? foreignJobs[this.jobId] : jobs[this.jobId];
 | 
			
		||||
      let job;
 | 
			
		||||
 | 
			
		||||
      if (this.foreignJobFlag) {
 | 
			
		||||
        job = nopaque.foreignJobs[this.jobId];
 | 
			
		||||
      } else {
 | 
			
		||||
        job = nopaque.jobs[this.jobId];
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      // End date
 | 
			
		||||
      this.setEndDate(job.end_date);
 | 
			
		||||
@@ -146,7 +152,7 @@
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    _update(patch) {
 | 
			
		||||
      var pathArray;
 | 
			
		||||
      let pathArray;
 | 
			
		||||
 | 
			
		||||
      for (let operation of patch) {
 | 
			
		||||
        /* "/jobId/valueName" -> ["jobId", "valueName"] */
 | 
			
		||||
@@ -175,7 +181,8 @@
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    setEndDate(timestamp) {
 | 
			
		||||
      var end_date;
 | 
			
		||||
      let end_date;
 | 
			
		||||
 | 
			
		||||
      if (timestamp === null) {
 | 
			
		||||
        end_date = "N.a.";
 | 
			
		||||
      } else {
 | 
			
		||||
@@ -186,8 +193,9 @@
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    setResult(result) {
 | 
			
		||||
      var resultsElement, resultDownloadButtonElement,
 | 
			
		||||
      let resultsElement, resultDownloadButtonElement,
 | 
			
		||||
          resultDownloadButtonIconElement;
 | 
			
		||||
 | 
			
		||||
      resultsElement = document.getElementById(`input-${result.job_input_id}-results`);
 | 
			
		||||
      resultDownloadButtonElement = document.createElement("a");
 | 
			
		||||
      resultDownloadButtonElement.classList.add("waves-effect", "waves-light", "btn-small");
 | 
			
		||||
@@ -203,7 +211,8 @@
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    setStatus(status) {
 | 
			
		||||
      var statusElement;
 | 
			
		||||
      let statusElement;
 | 
			
		||||
 | 
			
		||||
      statusElement = document.getElementById("status");
 | 
			
		||||
      statusElement.classList.remove(...Object.values(JobList.STATUS_COLORS));
 | 
			
		||||
      statusElement.classList.add(JobList.STATUS_COLORS[status] || JobList.STATUS_COLORS['default']);
 | 
			
		||||
@@ -215,7 +224,7 @@
 | 
			
		||||
  var informationUpdater = new InformationUpdater({{ job.id }}, false);
 | 
			
		||||
  {% else %}
 | 
			
		||||
  var informationUpdater = new InformationUpdater({{ job.id }}, true);
 | 
			
		||||
  socket.emit('subscribe_foreign_user_ressources', {{ job.user_id }});
 | 
			
		||||
  nopaque.socket.emit('subscribe_foreign_user_ressources', {{ job.user_id }});
 | 
			
		||||
  {% endif %}
 | 
			
		||||
</script>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user