diff options
author | Anton Luka Šijanec <sijanecantonluka@gmail.com> | 2020-03-12 15:37:25 +0100 |
---|---|---|
committer | Anton Luka Šijanec <sijanecantonluka@gmail.com> | 2020-03-12 15:37:25 +0100 |
commit | ad597b3e767344e5794f1efb5dbc20dea81efb28 (patch) | |
tree | fbd0642905c3adf9fe82409a7d2a5131fc8ac18e | |
parent | setup-storage critical fix (sw error) 1.0.12.35-beta (diff) | |
download | beziapp-ad597b3e767344e5794f1efb5dbc20dea81efb28.tar beziapp-ad597b3e767344e5794f1efb5dbc20dea81efb28.tar.gz beziapp-ad597b3e767344e5794f1efb5dbc20dea81efb28.tar.bz2 beziapp-ad597b3e767344e5794f1efb5dbc20dea81efb28.tar.lz beziapp-ad597b3e767344e5794f1efb5dbc20dea81efb28.tar.xz beziapp-ad597b3e767344e5794f1efb5dbc20dea81efb28.tar.zst beziapp-ad597b3e767344e5794f1efb5dbc20dea81efb28.zip |
-rw-r--r-- | js/gsec.js | 40 | ||||
-rw-r--r-- | pages/about.html | 2 | ||||
-rw-r--r-- | sw.js | 3 |
3 files changed, 34 insertions, 11 deletions
@@ -9,9 +9,12 @@ const GSE_URL = "https://zgimsis.gimb.tk/gse/"; class gsec { constructor() { } - postback(getUrl, params = {}, formId = null) { + postback(getUrl, params = {}, formId = null, useDiffAction = null) { return new Promise( (resolve, reject) => { $.ajax({ + xhrFields: { + withCredentials: true + }, crossDomain: true, url: getUrl, cache: false, @@ -31,8 +34,17 @@ class gsec { params[input.name] = input.value; // so we don't overwrite existing values } } - var action = new URL($(form).attr("action"), GSE_URL); // absolute == relative + base + if(useDiffAction == null || useDiffAction == false) { + var action = new URL($(form).attr("action"), GSE_URL); // absolute == relative + base + } else if(useDiffAction == true || useDiffAction == 1) { + var action = getUrl; + } else { + var action = useDiffAction; + } $.ajax({ + xhrFields: { + withCredentials: true + }, crossDomain: true, url: action, cache: false, @@ -56,11 +68,15 @@ class gsec { if(response.code == 302) { resolve(true); } else { - var simpleResponse = parsed.getElementById("lblMsg"); - if( simpleResponse = "Napaka pri prijavi.") { - reject(new Error(false)); - } else { - resolve(true); + try { + var simpleResponse = parsed.getElementById("lblMsg"); + if( simpleResponse = "Napaka pri prijavi.") { + reject(new Error(false)); + } else { + resolve(true); + } + } catch (e) { + resolve(null); } } }); @@ -69,8 +85,11 @@ class gsec { fetchSessionData() { return new Promise((resolve, reject) => { $.ajax({ + xhrFields: { + withCredentials: true + }, crossDomain: true, - url: GSE_URL+"WS_Gim/wsGimSisUtils.asmx", + url: GSE_URL+"WS_Gim/wsGimSisUtils.asmx/GetSessionData", cache: false, type: "POST", dataType: "json", @@ -84,7 +103,7 @@ class gsec { reject(new Error(false)); } }); - } + }); } fetchTeachersDirectory() { return new Promise((resolve, reject) => { @@ -95,6 +114,9 @@ class gsec { var letnica = dejt.getFullYear(); } // skratka uporabi se prvi sklop številk v šolskem letu TOLE(/xxxx) $.ajax({ + xhrFields: { + withCredentials: true + }, crossDomain: true, url: GSE_URL+"Page_Gim/Uporabnik/modSporociloPrejemniki.aspx/NajdiOsebePrejemniki", cache: false, diff --git a/pages/about.html b/pages/about.html index ec65c67..22997b2 100644 --- a/pages/about.html +++ b/pages/about.html @@ -63,7 +63,7 @@ <div class="col s12"> <h3><b class="title-secondary">Beži</b><span class="title-primary">App</span> </h3> - <h5 class="subheader"><x-su>version</x-su> 1.0.12.35-beta</h5> + <h5 class="subheader"><x-su>version</x-su> 1.0.12-beta</h5> </div> </div> <div class="row"> @@ -1,7 +1,8 @@ // Change version to cause cache refresh -const static_cache_name = "site-static-v1.0.12.35"; +const static_cache_name = "site-static-v1.0.12.43"; // Got them with find . -not -path '*/\.*' | sed "s/.*/\"&\",/" | grep -v sw.js // sw.js NE SME BITI CACHAN, ker vsebuje verzijo! + const assets = [ "/css/materialize.min.css", "/css/fontawesome.min.css", |