Skip to content

Commit

Permalink
Find rows of courses and sections
Browse files Browse the repository at this point in the history
  • Loading branch information
JafarAkhondali committed Oct 3, 2017
1 parent 90981da commit 4549036
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 8 deletions.
4 changes: 3 additions & 1 deletion web-extension/popup/css/popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,6 @@ body,html {

#range_inp{
margin: 5px;
}
}


67 changes: 64 additions & 3 deletions web-extension/popup/js/final.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,77 @@
$(document).ready(function () {

$('#tabs-swipe-demo').tabs();
$('#tabs-swipe-demo').tabs(); //Inital tabs


//Submit data for voting
$("#submit_data").on('click',function () {
let autoSend = $("#auto_send").prop("checked");
let bypassFilter = $("#bypass_filter").prop("checked");
let percent = $("#range_inp").val();
fillOptions(percent,bypassFilter,autoSend);
});


//Really? Should i say what it does?
$("#cancel").on('click',function () {
window.close();
})
});


$("#generate_schulde").on('click',function () {
//Before telling what i'm doing here, i would like to say FUCK YOU SAMA
//FUCK YOUR CREATORS
//FUCK YOUR DESIGNERS
//FUCK ANY UNIVERSITY WHICH PAYED YOU FOR THIS SHIT
//Ok let's go on, it's 3:47am now and i've just started writing this shit
//There is no fucking id attribute or any fucking class to find which table are they using
//To show data of schedule, So i should to it dirty too ...


let section_data = [];

//First, I'll find 9th td of any table, the only table which has it is the schedule
//So now let's go to grandparent to get main table
let sch_table = $("table td:nth-child(9)").parent().parent();

//Select all rows and set it to tr, I know the variable "tr" is redundant here
//But i love it so much <3 My codes = My rules . It's non of your fucking businesses.
let tr = sch_table.children();

//Skip first and second rows, Cause they are shit
for (let i=2;i<tr.length;i++){
//Shows there is only one fucking row, so it's the time of class
if (tr[i].firstChild.children.length == 1){
let section_data = tr[i].firstChild.children[0].innerText.trim().split("\n");
let className = tr[i-1].children[1].firstChild.innerText;

let classData = {
name:className
};

let sections = [];
for(section in section_data){
let section_info = section.split("،");
let
class_date = section_info[0],
place = section_info[1],
teacher = section_info[2];
sections.append({

});
}
section_data.append();



}


}



});


});
});
10 changes: 6 additions & 4 deletions web-extension/popup/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
<h1 id="header_name">GSama</h1>

<ul id="tabs-swipe-demo" class="tabs">
<li class="tab col s6"><a class="active" href="#test-swipe-1">ارزشیابی</a></li>
<li class="tab col s6"><a href="#test-swipe-2">برنامه هفتگی</a></li>
<li class="tab col s6"><a class="active" href="#vote">ارزشیابی</a></li>
<li class="tab col s6"><a href="#weekschelude">برنامه هفتگی</a></li>
</ul>

<div id="test-swipe-1" class="budget-wrap" style="width: 400px;padding-top: 15px;">
<div id="vote" class="budget-wrap" style="width: 400px;padding-top: 15px;">
<div class="budget">
<div class="header">
<div class="title clearfix" style="text-align: center">
Expand Down Expand Up @@ -56,7 +56,9 @@ <h1 id="header_name">GSama</h1>
</div>
</div>

<div id="test-swipe-2" class="col s12 blue" style="width: 400px">برنامه هفتگی</div>
<div id="weekschelude" class="col s12" style="width: 400px">
<a id="generate_schulde" class="waves-effect waves-light btn">ساخت برنامه درسی</a>
</div>



Expand Down

0 comments on commit 4549036

Please sign in to comment.