Skip to content

Commit

Permalink
Extracting courses data finished, Need test
Browse files Browse the repository at this point in the history
  • Loading branch information
JafarAkhondali committed Oct 3, 2017
1 parent 4549036 commit 63fa9f1
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions web-extension/popup/js/final.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,31 +46,38 @@ $(document).ready(function () {
let className = tr[i-1].children[1].firstChild.innerText;

let classData = {
name:className
name: className,
};

let sections = [];

for(section in section_data){
let section_info = section.split("،");
let

const
class_date = section_info[0],
place = section_info[1],
teacher = section_info[2];

const posOfDay = class_date.indexOf(':');
const nameOfDay = class_date.substr(0,posOfDay);

const fromTo = class_date.substring(pposOfDay+2,class_date.length-2).split(" تا ");
const classPlace = place.substring(place.indexOf("(")+1,place.length-2).trim();
const teacherName = teacher.substring(teacher.indexOf("(")+1,teacher.length-2).trim().replace("_"," ");
sections.append({

day: nameOfDay.trim(),
from: fromTo[0].trim(),
to: fromTo[1].trim(),
place: classPlace,
teacher: teacherName
});
}
section_data.append();



classData["sections"] = sections;
section_data.append(classData);
}


}



}//End for loop

});


Expand Down

0 comments on commit 63fa9f1

Please sign in to comment.