@@ -58,7 +58,9 @@ function main_page() {
5858 $course = $grade_rows . eq ( i ) . children ( 'td' ) . eq ( 3 ) . find ( "a[href^='scores.html?']" ) ;
5959 let first_grade = $grade_rows . eq ( i ) . children ( 'td' ) . eq ( 2 ) . find ( `a[href^='scores.html?']` ) ;
6060 if ( first_grade . length === 1 ) {
61- fill_percent ( first_grade , `https://powerschool.sas.edu.sg/guardian/${ first_grade . attr ( 'href' ) } ` , [ 0 ] , 0 )
61+ if ( grade_gpa ( first_grade . text ( ) ) !== - 1 ) {
62+ fill_percent ( first_grade , `https://powerschool.sas.edu.sg/guardian/${ first_grade . attr ( 'href' ) } ` , [ 0 ] , 0 ) ;
63+ }
6264 }
6365 } else {
6466 $course = $grade_rows . eq ( i ) . children ( 'td' ) . eq ( 2 ) . find ( "a[href^='scores.html?']" ) ;
@@ -69,7 +71,9 @@ function main_page() {
6971 grades . push ( $course . text ( ) ) ;
7072 course_links . push ( $course . attr ( 'href' ) ) ;
7173 percents . push ( - 1 ) ;
72- fill_percent ( $course , "https://powerschool.sas.edu.sg/guardian/" + $course . attr ( 'href' ) , percents , percents . length - 1 ) ;
74+ if ( grade_gpa ( $course . text ( ) ) !== - 1 ) {
75+ fill_percent ( $course , "https://powerschool.sas.edu.sg/guardian/" + $course . attr ( 'href' ) , percents , percents . length - 1 ) ;
76+ }
7377 }
7478
7579 }
@@ -173,7 +177,7 @@ function class_page() {
173177 if ( number === - Infinity ) {
174178 return ;
175179 }
176- $ ( "table.linkDescList:first " ) . append ( `<tr><td><strong>Final Percent: </strong></td><td>` + parseFloat ( number ) . toFixed ( 2 ) + ` <div class="tooltip saspe">ⓘ<span class="tooltiptext saspe">85: A+ | 75: A <br />65: B+ | 55: B <br />45: C+ | 35: C <br/>25: D+ | 15: D</span></div></td></tr>` ) ;
180+ document . querySelector ( "table.linkDescList" ) . append ( html2node ( `<tr><td><strong>Final Percent: </strong></td><td>` + parseFloat ( number ) . toFixed ( 2 ) + ` <div class="tooltip saspe">ⓘ<span class="tooltiptext saspe">85: A+ | 75: A <br />65: B+ | 55: B <br />45: C+ | 35: C <br/>25: D+ | 15: D</span></div></td></tr>` ) ) ;
177181}
178182function login_page ( ) {
179183 /*
@@ -193,6 +197,11 @@ function login_page() {
193197 */
194198
195199 //document.getElementById('sign-in-content').append(document.createTextNode("Last Seen Grades has been temporarily removed to be improved upon."))
200+
201+ /*
202+ let insert_location = document.querySelector('#content');
203+ insert_location.parentNode.insertBefore(document.createElement('a'), insert_location);
204+ */
196205}
197206function fill_percent ( $fill_location , url_link , percents , pos_in_arr ) {
198207 if ( ! percent_main_page ) {
@@ -289,3 +298,11 @@ function grade_gpa(grade) {
289298 break ;
290299 }
291300}
301+ function html2node ( html_string ) {
302+ return html2nodelist ( html_string ) [ 0 ] ;
303+ }
304+ function html2nodelist ( html_string ) {
305+ let temp = document . createElement ( 'template' ) ;
306+ temp . innerHTML = html_string ;
307+ return temp . content . childNodes ;
308+ }
0 commit comments