From c28c1c56dd807f620e916f9711d4c969817c6dd0 Mon Sep 17 00:00:00 2001 From: sijanec Date: Thu, 4 Jun 2020 16:51:55 +0200 Subject: terms of service css fix - who reads those? --- dist/css/styles.css | 4 ++++ dist/js/app.js | 2 +- dist/pages/about.html | 2 +- dist/sw.js | 4 ++-- 4 files changed, 8 insertions(+), 4 deletions(-) (limited to 'dist') diff --git a/dist/css/styles.css b/dist/css/styles.css index 3f403e7..0e11125 100755 --- a/dist/css/styles.css +++ b/dist/css/styles.css @@ -424,4 +424,8 @@ h1, h2, h3, h4, h5, h6 { .zakljucna-grade { color: red; +} + +ol { + color: var(--color-text) !important; } \ No newline at end of file diff --git a/dist/js/app.js b/dist/js/app.js index d44995d..63ca198 100755 --- a/dist/js/app.js +++ b/dist/js/app.js @@ -3,7 +3,7 @@ const app_version = "1.0.14.1-beta"; -const previous_commit = "ab895dc64437ac9ea42b2c9790a0b29550bdbc17"; +const previous_commit = "1f5f25a3ade732d7b5b84db7decbdf3a9059a8c2"; if ("serviceWorker" in navigator) { navigator.serviceWorker.register("/sw.js") diff --git a/dist/pages/about.html b/dist/pages/about.html index a08ae16..e216944 100755 --- a/dist/pages/about.html +++ b/dist/pages/about.html @@ -142,7 +142,7 @@

- ^HEAD ab895dc64437ac9ea42b2c9790a0b29550bdbc17 + ^HEAD 1f5f25a3ade732d7b5b84db7decbdf3a9059a8c2

diff --git a/dist/sw.js b/dist/sw.js index c1ccb21..f379590 100755 --- a/dist/sw.js +++ b/dist/sw.js @@ -3,8 +3,8 @@ // Change version to cause cache refresh -const static_cache_name = "site-static-1.0.14.1-beta-ab895dc"; -// commit before the latest is ab895dc64437ac9ea42b2c9790a0b29550bdbc17 +const static_cache_name = "site-static-1.0.14.1-beta-1f5f25a"; +// commit before the latest is 1f5f25a3ade732d7b5b84db7decbdf3a9059a8c2 // Got them with find . -not -path '*/\.*' | sed "s/.*/\"&\",/" | grep -v sw.js // sw.js NE SME BITI CACHAN, ker vsebuje verzijo! -- cgit v1.2.3 From 134d89078f864250abf340713edc1d23d90ede24 Mon Sep 17 00:00:00 2001 From: sijanec Date: Mon, 8 Jun 2020 15:21:59 +0200 Subject: fixed grades for edge-case and removed performance optimizations --- dist/js/app.js | 4 ++-- dist/js/gsec.js | 7 +++---- dist/js/login.js | 2 +- dist/pages/about.html | 4 ++-- dist/sw.js | 4 ++-- 5 files changed, 10 insertions(+), 11 deletions(-) (limited to 'dist') diff --git a/dist/js/app.js b/dist/js/app.js index 63ca198..f5c2f1b 100755 --- a/dist/js/app.js +++ b/dist/js/app.js @@ -2,8 +2,8 @@ -const app_version = "1.0.14.1-beta"; -const previous_commit = "1f5f25a3ade732d7b5b84db7decbdf3a9059a8c2"; +const app_version = "1.0.14.2-beta"; +const previous_commit = "c28c1c56dd807f620e916f9711d4c969817c6dd0"; if ("serviceWorker" in navigator) { navigator.serviceWorker.register("/sw.js") diff --git a/dist/js/gsec.js b/dist/js/gsec.js index 36d49a5..59d95bf 100644 --- a/dist/js/gsec.js +++ b/dist/js/gsec.js @@ -32,10 +32,9 @@ var dataToBeSent={"ctl00$ContentPlaceHolder1$edtDatZacetka":`${fromDate.getDay() var absences=[];for(const izostanek of rowElements){var subFields=izostanek.getElementsByTagName("td");var date=subFields[0].innerHTML.trim().split(".");var dateObj=new Date(Date.parse(`${date[2]}-${date[1]}-${date[0]}`));var subjects=[];subFields[2].innerHTML.match(SUBJECT_LIST_REGEX).forEach((subject)=>{subjects.push(subject);});var absencesBySubject={};for(const subject of subjects){const matched_info=FIELDS_REGEX.exec(subject);var subjectName=matched_info[1];var status=Number(matched_info[2]);var period=matched_info[3];period=period.includes("P")?Number(period.replace("P",""))+7:Number(period);absencesBySubject[period]={status:status,subject:subjectName};} absences.push({subjects:absencesBySubject,date:dateObj});} resolve(absences);});});} -fetchGrades(){var grades=[];return new Promise((resolve,reject)=>{$.ajax({xhrFields:{withCredentials:true},crossDomain:true,url:GSE_URL+"Page_Gim/Ucenec/OceneUcenec.aspx",cache:false,type:"GET",dataType:"html",processData:false,success:(data)=>{let parser=new DOMParser();let parsed=parser.parseFromString(data,"text/html");let gradeSpans=parsed.getElementsByClassName("txtVOcObd");for(const grade of gradeSpans){var ist=grade.getElementsByTagName("span")[0].getAttribute("title").split("\n");if(ist.length==1){var gradeToAdd={"gradeType":GSEC_ZAKLJUCNA_GRADE,"grade":Number(grade.getElementsByTagName("span")[0].innerHTML),"subject":grade.parentElement.parentElement.parentElement.parentElement.getElementsByTagName("th")[0].innerText} -grades.push(gradeToAdd);}else{var date=ist[0].split(": ")[1].trim().split(".");var dateObj=new Date(Date.parse(`${date[2]}-${date[1]}-${date[0]}`));var teacher=ist[1].split(": ")[1].trim();var subject=ist[2].split(": ")[1].trim();var name=[];name.push(ist[3].split(": ")[1].trim()) -name.push(ist[4].split(": ")[1].trim()) -name.push(ist[5].split(": ")[1].trim()) +fetchGrades(){var grades=[];return new Promise((resolve,reject)=>{$.ajax({xhrFields:{withCredentials:true},crossDomain:true,url:GSE_URL+"Page_Gim/Ucenec/OceneUcenec.aspx",cache:false,type:"GET",dataType:"html",processData:false,success:(data)=>{let parser=new DOMParser();let parsed=parser.parseFromString(data,"text/html");let gradeSpans=parsed.getElementsByClassName("txtVOcObd");for(const grade of gradeSpans){var whatever_ist_meant_in_my_head_back_then_but_as_a_string=grade.getElementsByTagName("span")[0].getAttribute("title");var ist=whatever_ist_meant_in_my_head_back_then_but_as_a_string.split("\n");if(ist.length==1){var gradeToAdd={"gradeType":GSEC_ZAKLJUCNA_GRADE,"grade":Number(grade.getElementsByTagName("span")[0].innerHTML),"subject":grade.parentElement.parentElement.parentElement.parentElement.getElementsByTagName("th")[0].innerText} +grades.push(gradeToAdd);}else{var date=ist[0].split(": ")[1].trim().split(".");var dateObj=new Date(Date.parse(`${date[2]}-${date[1]}-${date[0]}`));var teacher=ist[1].split(": ")[1].trim();var subject=ist[2].split(": ")[1].trim();var name=[];name.push(whatever_ist_meant_in_my_head_back_then_but_as_a_string.split("Ocenjevanje: ")[1].split("\nVrsta: ")[0].trim());name.push(whatever_ist_meant_in_my_head_back_then_but_as_a_string.split("Vrsta: ")[1].split("\nRok: ")[0].trim()) +name.push(whatever_ist_meant_in_my_head_back_then_but_as_a_string.split("Rok: ")[1].trim()) var gradeNumber=Number(grade.getElementsByTagName("span")[0].innerHTML);var temporary=grade.getElementsByTagName("span")[0].classList.contains("ocVmesna");var gradeToAdd={"gradeType":GSEC_NORMAL_GRADE,"date":dateObj,"teacher":teacher,"subject":subject,"name":name,"temporary":temporary,"grade":gradeNumber};if(grade.getElementsByTagName("span").length>1){if(grade.getElementsByTagName("span")[1].classList.contains("ocVmesna")){gradeToAdd["temporary"]=true;}else{gradeToAdd["temporary"]=false;} gradeToAdd["grade"]=Number(grade.getElementsByTagName("span")[1].innerHTML);gradeToAdd["oldgrade"]=Number(grade.getElementsByTagName("span")[0].innerHTML);} grades.push(gradeToAdd);}} diff --git a/dist/js/login.js b/dist/js/login.js index 2d79576..88cf081 100644 --- a/dist/js/login.js +++ b/dist/js/login.js @@ -2,4 +2,4 @@ document.addEventListener("DOMContentLoaded",()=>{setupEventListeners();}) function setupEventListeners(){$("#login-button").click(()=>{login();});window.addEventListener("keyup",(event)=>{if(event.keyCode===13){event.preventDefault();login();}});} function login(){let username=$("#username").val();let password=$("#password").val();var gsecInstance;try{gsecInstance=new gsec();}catch(error){$.ajax({url:'js/gsec.js?ajaxload',async:false,dataType:"script",});try{gsecInstance=new gsec();}catch(error){alert(D("browserNotSupported"));}} -gsecInstance.login(username,password).then((value)=>{if(typeof value=="string"){let promises_to_run=[localforage.setItem("logged_in",true),localforage.setItem("username",username),localforage.setItem("password",password)];read_val(0);Promise.all(promises_to_run).then(function(){window.location.replace("/pages/timetable.html");});}else{UIAlert("loginFailed");$("#password").val("");}}).catch((err)=>{gsecErrorHandlerUI(err);$("#password").val("");});} \ No newline at end of file +gsecInstance.login(username,password).then((value)=>{if(typeof value=="string"){let promises_to_run=[localforage.setItem("logged_in",true),localforage.setItem("username",username),localforage.setItem("password",password)];Promise.all(promises_to_run).then(function(){window.location.replace("/pages/timetable.html");});}else{UIAlert("loginFailed");$("#password").val("");}}).catch((err)=>{gsecErrorHandlerUI(err);$("#password").val("");});} \ No newline at end of file diff --git a/dist/pages/about.html b/dist/pages/about.html index e216944..834a0a6 100755 --- a/dist/pages/about.html +++ b/dist/pages/about.html @@ -73,7 +73,7 @@ BežiApp -
version 1.0.14.1-beta
+
version 1.0.14.2-beta
@@ -142,7 +142,7 @@

- ^HEAD 1f5f25a3ade732d7b5b84db7decbdf3a9059a8c2 + ^HEAD c28c1c56dd807f620e916f9711d4c969817c6dd0

diff --git a/dist/sw.js b/dist/sw.js index f379590..36962ce 100755 --- a/dist/sw.js +++ b/dist/sw.js @@ -3,8 +3,8 @@ // Change version to cause cache refresh -const static_cache_name = "site-static-1.0.14.1-beta-1f5f25a"; -// commit before the latest is 1f5f25a3ade732d7b5b84db7decbdf3a9059a8c2 +const static_cache_name = "site-static-1.0.14.2-beta-c28c1c5"; +// commit before the latest is c28c1c56dd807f620e916f9711d4c969817c6dd0 // Got them with find . -not -path '*/\.*' | sed "s/.*/\"&\",/" | grep -v sw.js // sw.js NE SME BITI CACHAN, ker vsebuje verzijo! -- cgit v1.2.3