diff --git a/icons.svg b/icons.svg index 92fe680e6..80cb208d5 100644 --- a/icons.svg +++ b/icons.svg @@ -7,6 +7,9 @@ fill: #2c2b3d; } + + + @@ -64,6 +67,7 @@ + @@ -78,4 +82,5 @@ + diff --git a/index.html b/index.html new file mode 100644 index 000000000..585ee4f78 --- /dev/null +++ b/index.html @@ -0,0 +1,37 @@ + + + + Quatalog Home + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + diff --git a/js/search_helper.js b/js/search_helper.js index 5f1f642cd..ab18beafc 100644 --- a/js/search_helper.js +++ b/js/search_helper.js @@ -8,7 +8,7 @@ const search_helper = function(event) { var course_code = false; if(input.length == 8) { // "abcd1345" => ["abcd","1345"] - course_code = input.match(/.{1,3}/g) + course_code = input.match(/.{1,4}/g) } else if(input.length == 9) { // "abcd - 1345" => ["abcd","1345"] course_code = input.split(/(?:,| )+/); @@ -26,7 +26,13 @@ const search_helper = function(event) { // if it is, redirect to it if(course_exists) { - location.href = code_str; + const loc = window.location.pathname; + // handle both homepage and courses pages + if(loc.substring(0,loc.lastIndexOf('/')) != "/courses") { + location.href = "courses/"+code_str; + } else { + location.href = code_str; + } return; } }