mirror of
				https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
				synced 2025-11-04 04:12:45 +00:00 
			
		
		
		
	not working test
This commit is contained in:
		@@ -16,6 +16,29 @@ nopaque["foreignJobsSubscribers"] = [];
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// nopaque functions
 | 
			
		||||
nopaque["forms"] = {};
 | 
			
		||||
nopaque["forms"]["init"] = function() {
 | 
			
		||||
  for (let form of document.querySelectorAll(".nopaque-form")) {
 | 
			
		||||
    form.addEventListener("submit", function(event) {
 | 
			
		||||
      event.preventDefault();
 | 
			
		||||
      if (form.dataset.hasOwnProperty('loadingModal')) {
 | 
			
		||||
        let loadingModalElement = document.getElementById(form.dataset.loadingModal);
 | 
			
		||||
        M.Modal.getInstance(loadingModalElement).open();
 | 
			
		||||
      }
 | 
			
		||||
      let data = {};
 | 
			
		||||
      for (let input of form.querySelectorAll("input")) {
 | 
			
		||||
        if (input.type === "file") {
 | 
			
		||||
          file = input.files[0];
 | 
			
		||||
          data[`${input.name}-wrapper`] = {"bytes": file, "name": file.name};
 | 
			
		||||
        } else {
 | 
			
		||||
          data[input.name] = input.value;
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      nopaque.socket.emit(`submit-${form.id}`, data);
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
nopaque["navigation"] = {};
 | 
			
		||||
nopaque["navigation"]["init"] = function() {
 | 
			
		||||
  for (let entry of document.querySelectorAll("#slide-out a:not(.subheader)")) {
 | 
			
		||||
@@ -112,6 +135,7 @@ document.addEventListener("DOMContentLoaded", function() {
 | 
			
		||||
                  {"alignment": "right", "constrainWidth": false, "coverTrigger": false});
 | 
			
		||||
  M.Dropdown.init(document.getElementById("nav-account"),
 | 
			
		||||
                  {"alignment": "right", "constrainWidth": false, "coverTrigger": false});
 | 
			
		||||
  nopaque.forms.init();
 | 
			
		||||
  nopaque.navigation.init();
 | 
			
		||||
  nopaque.socket.emit("subscribe_user_ressources");
 | 
			
		||||
});
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user