display course department and number with unique for the conflict popup
This commit is contained in:
27
js/util.js
27
js/util.js
@@ -54,6 +54,19 @@ function capitalizeString(string) {
|
||||
return output.trim();
|
||||
}
|
||||
|
||||
function seperateCourseNameParts(name) {
|
||||
let num_index = name.search(/\d/);
|
||||
department = name.substring(0, num_index).trim();
|
||||
number = name.substring(num_index, name.indexOf(" ", num_index)).trim();
|
||||
name = capitalizeString(name.substring(name.indexOf(" ", num_index)).trim());
|
||||
return {
|
||||
name: name,
|
||||
department: department,
|
||||
number: number
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function seperateDays(date, simple=false) {
|
||||
let arr = [];
|
||||
for (var i = 0; i < date.length; i++) {
|
||||
@@ -99,18 +112,6 @@ function prettifyDaysText(arr) {
|
||||
return output
|
||||
}
|
||||
|
||||
function seperateCourseNameParts(name) {
|
||||
let num_index = name.search(/\d/);
|
||||
department = name.substring(0, num_index).trim();
|
||||
number = name.substring(num_index, name.indexOf(" ", num_index)).trim();
|
||||
name = capitalizeString(name.substring(name.indexOf(" ", num_index)).trim());
|
||||
return {
|
||||
name: name,
|
||||
department: department,
|
||||
number: number
|
||||
}
|
||||
}
|
||||
|
||||
function isIndividualCoursePage(){
|
||||
return $("#textbook_button").length != 0;
|
||||
}
|
||||
@@ -371,4 +372,4 @@ function buildChartConfig(data) {
|
||||
|
||||
function canNotRegister(status, register_link) {
|
||||
return status.includes("closed") || status.includes("cancelled") || !status || !register_link
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user