Skip to content

Commit d3ae9af

Browse files
committed
Open Beta 0.1.5.6
1 parent 4a1b41a commit d3ae9af

File tree

5 files changed

+25
-21
lines changed

5 files changed

+25
-21
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# Open Beta 0.1.5.6
2+
3+
## 2019-01-11
4+
5+
### Bug Fixes
6+
7+
* **Final Percent:** Code to identify the final percent has been vastly improved.
8+
19
# Open Beta 0.1.5.5
210

311
## 2019-01-04

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ SAS PES is an extension using the WebExtension standard for use by Singapore Ame
1313
* View final percent and cutoffs for grades
1414

1515
### Extra Features
16-
* View grades and final percents for courses even when Powerschool is closed.
16+
* (Temporarily removed for development) ~~View grades and final percents for courses even when Powerschool is closed.~~
1717

1818
## Browser Support
1919

@@ -45,6 +45,6 @@ Refer to the 'Third-Party Licenses.txt' file for their respective licenses.
4545

4646
## License
4747

48-
Copyright (c) 2018 Gary Kim ([email protected]) All Rights Reserved
48+
Copyright © 2018 Gary Kim ([email protected]) All Rights Reserved
4949

5050
Various open-source licenses are under consideration.

src/js/saspowerschoolff.js

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,13 @@ function main_page() {
164164
*/
165165
}
166166
function class_page() {
167-
let regex = /(?=document\.write).*/g
168167
let current_string = $("table.linkDescList").html();
169-
regex.exec(current_string);
170-
current_string = regex.exec(current_string)[0];
171-
regex = /[0-9]*\.[0-9]*/g
172-
let temp = current_string.match(regex);
173-
let number = temp[temp.length - 1];
168+
current_string = current_string.match(/(?=document\.write).*/g)[1];
169+
current_string = /\[.*\]/g.exec(current_string)[0].slice(1,-1);
170+
let temp = current_string.split(";");
171+
let number = Math.max(isNaN(temp[temp.length-2])?-Infinity:parseFloat(temp[temp.length-2]),isNaN(temp[temp.length-1])?-Infinity:parseFloat(temp[temp.length-1]));
174172
//let number = $("table.linkDescList").html().match("(?=;\.;).*(?=])")[0].substring(3);
175-
if(isNaN(number)) {
173+
if(number === -Infinity) {
176174
return;
177175
}
178176
$("table.linkDescList:first").append(`<tr><td><strong>Final Percent: </strong></td><td>` + parseFloat(number).toFixed(2) + ` <div class="tooltip saspe">&#9432;<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>`);
@@ -203,19 +201,17 @@ function fill_percent($fill_location,url_link,percents, pos_in_arr) {
203201
$.ajax({
204202
url: url_link
205203
}).done(function(data) {
206-
let regex = /(?=document\.write).*/g
207204
let current_string = data;
208-
regex.exec(current_string);
209-
current_string = regex.exec(current_string)[0];
210-
regex = /[0-9]*\.[0-9]*/g
211-
let temp = current_string.match(regex);
212-
let final_percent = temp[temp.length - 1];
213-
if(isNaN(final_percent)) {
205+
current_string = current_string.match(/(?=document\.write).*/g)[1];
206+
current_string = /\[.*\]/g.exec(current_string)[0].slice(1,-1);
207+
let temp = current_string.split(";");
208+
let final_percent = Math.max(isNaN(temp[temp.length-2])?-Infinity:parseFloat(temp[temp.length-2]),isNaN(temp[temp.length-1])?-Infinity:parseFloat(temp[temp.length-1]));
209+
if(final_percent === -Infinity) {
214210
percents[pos_in_arr] = -1;
215211
return;
216212
}
217-
$fill_location.append(` (${parseFloat(final_percent).toFixed(2)})`);
218-
percents[pos_in_arr] = parseFloat(final_percent).toFixed(2);
213+
$fill_location.append(` (${final_percent.toFixed(2)})`);
214+
percents[pos_in_arr] = final_percent.toFixed(2);
219215
}).fail(function() {
220216
percents[pos_in_arr] = -1;
221217
console.log(`Ajax failed! Error on accessing: ${url_link}.`);

src/manifest - chromium.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"manifest_version": 2,
33
"name": "SAS Powerschool Enhancement Suite",
44
"short_name": "SAS PES",
5-
"version": "0.1.5.5",
6-
"version_name": "Public Beta 0.1.5.5",
5+
"version": "0.1.5.6",
6+
"version_name": "Public Beta 0.1.5.6",
77
"author": "Gary Kim",
88
"description": "Provides various enhancements for SAS Powerschool",
99
"permissions": [

src/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifest_version": 2,
33
"name": "SAS Powerschool Enhancement Suite",
44
"short_name": "SAS PES",
5-
"version": "0.1.5.5",
5+
"version": "0.1.5.6",
66
"author": "Gary Kim",
77
"description": "Provides various enhancements for SAS Powerschool",
88
"permissions": [

0 commit comments

Comments
 (0)