Skip to content

Commit

Permalink
Added intrusive notices about Schoology changes
Browse files Browse the repository at this point in the history
  • Loading branch information
aopell committed Dec 8, 2018
1 parent 4625c45 commit b999e04
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 3 deletions.
41 changes: 39 additions & 2 deletions js/version-specific.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,45 @@
function versionSpecificFirstLaunch(currentVersion, previousVersion) {
switch (currentVersion) {
case "4.3.2":
iziToast.show({
theme: 'dark',
iconUrl: chrome.runtime.getURL("/imgs/plus-icon.png"),
title: 'Important Message!',
message: 'Schoology Plus will temporarily stop working beginning December 15',
progressBarColor: 'red',
timeout: 0,
layout: 2,
position: 'topRight',
buttons: [
['<button>Click Here For More Info</button>', function (instance, toast) {
instance.hide({
transitionOut: 'fadeOutRight',
onClosing: function (instance, toast, closedBy) {
window.open("https://aopell.me/SchoologyPlus/notice", "_blank");
}
}, toast, 'moreInfoNoticeButton');
}]
]
});

chrome.storage.sync.get(["unreadBroadcasts", "broadcasts", "themes"], (storage) => {
let broadcasts = storage.unreadBroadcasts || [];
broadcasts.push({
id: 432,
title: '',
message: '<div style="border: 3px solid red; background-color: black; color: white;"><span style="font-size: 16px; font-weight: bold">Important Message!</span><br/><br/><span style="font-size: 14px">LAUSD is updating the Schoology interface on December 15, which will cause Schoology Plus to function incorrectly until the next version.</span><br/><br/><a href="https://aopell.me/SchoologyPlus/notice" style="font-size: 16px; color: white; text-decoration: underline;">Click Here For More Info</a></div>',
shortMessage: "Schoology Plus will temporarily stop working beginning December 15",
timestamp: Date.now()
});

chrome.storage.sync.set({ unreadBroadcasts: broadcasts });
});

versionSpecificFirstLaunch("4.3.1", previousVersion);
break;
case "4.3.1":
case "4.3":
if (previousVersion != "4.2" && previousVersion != "4.3") {
if (previousVersion != "4.2" && previousVersion != "4.3" && previousVersion != "4.3.1") {
versionSpecificFirstLaunch("4.2");
}
break;
Expand Down Expand Up @@ -31,7 +68,7 @@ function versionSpecificFirstLaunch(currentVersion, previousVersion) {
chrome.storage.sync.get(["unreadBroadcasts", "broadcasts", "themes"], (storage) => {
let broadcasts = storage.unreadBroadcasts || [];
broadcasts.push({
id: Number.parseInt(currentVersion.replace('.', '')),
id: 420,
title: '',
message: '<span style="font-size: 16px; font-weight: bold">Take the Schoology Plus Fall 2018 Survey!</span><br/><br/><span style="font-size: 14px">Let us know your thoughts about Schoology Plus and complete the survey for a chance to win <strong style="background-color: yellow">one of two $5 Amazon gift cards!</strong><br/><br/><strong style="background-color: yellow"><a href="https://goo.gl/forms/EVi8cTaakVhLekiN2" target="_blank">Click Here to Take The Survey!</a></strong></span><br/><br/>',
shortMessage: "Complete for a chance to win an Amazon gift card!",
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"update_url": "https://aopell.me/SchoologyPlus/update.json"
}
},
"version": "4.3.1",
"version": "4.3.2",
"icons": {
"128": "imgs/[email protected]",
"64": "imgs/[email protected]",
Expand Down

0 comments on commit b999e04

Please sign in to comment.