diff --git a/js/version-specific.js b/js/version-specific.js index c5d5c5f..f90c61c 100644 --- a/js/version-specific.js +++ b/js/version-specific.js @@ -123,8 +123,8 @@ function saveBroadcasts(broadcasts, callback = undefined) { * @param {Date|number} timestamp Timestamp to show as the post time in the home feed * @returns {Broadcast} */ -function createBroadcast(id, title, message, timestamp = Date.now()) { - return { id: String(id), title, message, timestamp: +timestamp }; +function createBroadcast(id, title, message, timestamp = Date.now(), expires = undefined) { + return { id: String(id), title, message, timestamp: +timestamp, expires: expires !== undefined ? +expires : undefined }; } /** @@ -298,6 +298,36 @@ let migrationsTo = { } }, 50); }, + "7.8.6": function (currentVersion, previousVersion) { + saveBroadcasts([ + createBroadcast( + 670, + "Schoology Plus Fall 2023 Survey", + ` +
+ Take the Schoology Plus Fall 2023 Survey! +

Occasionally we run this survey to understand how best to improve Schoology Plus for our users.

+

Spend 10 minutes completing this year's survey and you'll be entered into a giveaway for one of + 20 Amazon gift cards totaling $150 + : ten $10 cards and ten $5 cards, so your chance of winning is higher than ever before! +

+

Thank you for helping improve Schoology Plus! Your feedback is incredibly valuable to us and will likely impact to what extent Schoology Plus is improved in the future.

+

Click here to visit survey.schoologypl.us and take the survey now!

+
+ `, + new Date(2023, 9 /* October */, 15), + new Date(2023, 11 /* December */, 1) // expiration date + ) + ]); + + if (Date.now() < new Date(2023, 11 /* December */, 1)) { + showToast("Take the Schoology Plus Survey!", "Enter to win one of 20 Amazon gift cards!", "yellow", { + buttons: [ + createToastButton("Take Survey!", "toast-take-splus-survey-fall2023", (i, t, b) => window.open(`https://survey.schoologypl.us?source=ExtensionToast&domain=${location.hostname}`, "_blank")) + ] + }); + } + } }; async function versionSpecificFirstLaunch(currentVersion, previousVersion) { diff --git a/manifest.json b/manifest.json index e6be670..e7acd4e 100644 --- a/manifest.json +++ b/manifest.json @@ -10,7 +10,7 @@ "update_url": "https://schoologypl.us/firefox_updates.json" } }, - "version": "7.8.5", + "version": "7.8.6", "icons": { "128": "imgs/icon@128.png", "64": "imgs/icon@64.png",