diff --git a/addons/scratch-notifier/addon.json b/addons/scratch-notifier/addon.json index 7dbbe680a0..46ced31f79 100644 --- a/addons/scratch-notifier/addon.json +++ b/addons/scratch-notifier/addon.json @@ -4,6 +4,9 @@ "credits": [ { "name": "World_Languages" + }, + { + "name": "NitroCipher/ZenithRogue" } ], "permissions": ["notifications"], @@ -16,55 +19,55 @@ "default": true }, { - "name": "๐Ÿ’ฌ Notify profile comments & replies", + "name": "@comment.svg Notify profile comments & replies", "id": "commentsforme_notifications", "type": "boolean", "default": true }, { - "name": "๐Ÿ’ฌ Notify comments on my projects", + "name": "@comment.svg Notify comments on my projects", "id": "commentsonmyprojects_notifications", "type": "boolean", "default": true }, { - "name": "๐Ÿ“š Notify forum activity", + "name": "@forum.svg Notify forum activity", "id": "forumpost_notifications", "type": "boolean", "default": true }, { - "name": "โค๏ธ Notify loves", + "name": "@heart.svg Notify loves", "id": "loveproject_notifications", "type": "boolean", "default": true }, { - "name": "โญ Notify favorites", + "name": "@star.svg Notify favorites", "id": "favoriteproject_notifications", "type": "boolean", "default": true }, { - "name": "๐Ÿง‘ Notify new followers", + "name": "@follow.svg Notify new followers", "id": "followuser_notifications", "type": "boolean", "default": true }, { - "name": "โœ‰๏ธ Notify studio invites", + "name": "@studio-add.svg Notify studio invites", "id": "curatorinvite_notifications", "type": "boolean", "default": true }, { - "name": "๐Ÿ†• Notify studio activity", + "name": "@studio.svg Notify studio activity", "id": "studioactivity_notifications", "type": "boolean", "default": true }, { - "name": "๐Ÿ”„ Notify remixes", + "name": "@remix.svg Notify remixes", "id": "remixproject_notifications", "type": "boolean", "default": true diff --git a/addons/scratch-notifier/background.js b/addons/scratch-notifier/background.js index 7695b2ec58..7f9041e5bf 100644 --- a/addons/scratch-notifier/background.js +++ b/addons/scratch-notifier/background.js @@ -5,14 +5,14 @@ export default async function ({ addon, global, console, setTimeout, setInterval let lastDateTime = null; let lastAuthChange; // Used to check if auth changed while waiting for promises to resolve const emojis = { - addcomment: "๐Ÿ’ฌ", - forumpost: "๐Ÿ“š", - loveproject: "โค๏ธ", - favoriteproject: "โญ", - followuser: "๐Ÿง‘", - curatorinvite: "โœ‰๏ธ", - remixproject: "๐Ÿ”„", - studioactivity: "๐Ÿ†•", + addcomment: "comment", + forumpost: "forum", + loveproject: "heart", + favoriteproject: "star", + followuser: "follow", + curatorinvite: "studio-add", + remixproject: "remix", + studioactivity: "studio", }; checkCount(); @@ -44,52 +44,85 @@ export default async function ({ addon, global, console, setTimeout, setInterval }) { let text = ""; let url; - if (emoji) text += `${emoji} `; if (messageType.startsWith("addcomment/")) { url = commentUrl; if (title.length > 20) title = `${title.substring(0, 17).trimEnd()}...`; - if (messageType === "addcomment/ownProjectNewComment") { - text += `${actor} commented in your project "${title}":\n${fragment}`; - } else if (messageType === "addcomment/projectReplyToSelf") { - text += `${actor} replied to you in project "${title}":\n${fragment}`; - } else if (messageType === "addcomment/ownProjectReplyToOther") { - text += `${actor} replied to ${commentee} in project "${title}":\n${fragment}`; - } else if (messageType === "addcomment/ownProfileNewComment") { - text += `${actor} commented in your profile:\n${fragment}`; - } else if (messageType === "addcomment/ownProfileReplyToSelf") { - text += `${actor} replied to you in your profile:\n${fragment}`; - } else if (messageType === "addcomment/ownProfileReplyToOther") { - text += `${actor} replied to ${commentee} in your profile:\n${fragment}`; - } else if (messageType === "addcomment/otherProfileReplyToSelf") { - text += `${actor} replied in ${title}'s profile:\n${fragment}`; - } else if (messageType === "addcomment/studio") { - text += `${actor} replied in studio "${title}":\n${fragment}`; + var notificationTitle; + switch (messageType.split("/")[1]) { + case "ownProjectNewComment": + notificationTitle = `${actor} commented on your project "${title}"`; + text = fragment; + break; + case "projectReplyToSelf": + notificationTitle = `${actor} replied to you on project "${title}"`; + text = fragment; + break; + case "ownProjectReplyToOther": + notificationTitle = `${actor} replied to ${commentee} on project "${title}"`; + text = fragment; + break; + case "ownProfileNewComment": + notificationTitle = `${actor} commented on your profile`; + text = fragment; + break; + case "ownProfileReplyToSelf": + notificationTitle = `${actor} replied to you on your profile`; + text = fragment; + break; + case "ownProfileReplyToOther": + notificationTitle = `${actor} replied to ${commentee} on your profile`; + text = fragment; + break; + case "otherProfileReplyToSelf": + notificationTitle = `${actor} replied on ${title}'s profile`; + text = fragment; + break; + case "studio": + notificationTitle = `${actor} replied in studio "${title}"`; + text = fragment; + break; + default: + notificationTitle = "New Scratch comment"; + break; + } + } else { + switch (messageType) { + case "forumpost": + notificationTitle = `There are new posts in the forum thread "${title}"`; + url = `https://scratch.mit.edu/discuss/topic/${element_id}/unread/`; + break; + case "loveproject": + notificationTitle = `${actor} loved your project "${title}"`; + url = `https://scratch.mit.edu/users/${actor}/`; + break; + case "favoriteproject": + notificationTitle = `${actor} favorited your project "${title}"`; + url = `https://scratch.mit.edu/users/${actor}/`; + break; + case "followuser": + notificationTitle = `${actor} is now following you`; + url = `https://scratch.mit.edu/users/${actor}/`; + break; + case "curatorinvite": + notificationTitle = `${actor} invited you to curate the studio "${title}"`; + url = `https://scratch.mit.edu/studios/${element_id}/curators/`; + break; + case "remixproject": + notificationTitle = `${actor} remixed your project "${parent_title}" as "${title}"`; + url = `https://scratch.mit.edu/projects/${element_id}/`; + break; + case "studioactivity": + notificationTitle = `There was new activity in studio "${title}" today`; + break; + default: + notificationTitle = "New Scratch message"; + break; } - } else if (messageType === "forumpost") { - text += `There are new posts in the forum thread "${title}"`; - url = `https://scratch.mit.edu/discuss/topic/${element_id}/unread/`; - } else if (messageType === "loveproject") { - text += `${actor} loved your project "${title}"`; - url = `https://scratch.mit.edu/users/${actor}/`; - } else if (messageType === "favoriteproject") { - text += `${actor} favorited your project "${title}"`; - url = `https://scratch.mit.edu/users/${actor}/`; - } else if (messageType === "followuser") { - text += `${actor} is now following you`; - url = `https://scratch.mit.edu/users/${actor}/`; - } else if (messageType === "curatorinvite") { - text += `${actor} invited you to curate the studio "${title}"`; - url = `https://scratch.mit.edu/studios/${element_id}/curators/`; - } else if (messageType === "remixproject") { - text += `${actor} remixed your project "${parent_title}" as "${title}"`; - url = `https://scratch.mit.edu/projects/${element_id}/`; - } else if (messageType === "studioactivity") { - text += `There was new activity in studio "${title}" today`; } const notifId = await addon.notifications.create({ type: "basic", - title: "New Scratch message", - iconUrl: "/images/icon.png", + title: notificationTitle, + iconUrl: emoji ? `../../images/icons/${emoji}.svg` : "/images/icon.png", message: text, buttons: [ { diff --git a/webpages/settings/brush.svg b/images/icons/brush.svg similarity index 100% rename from webpages/settings/brush.svg rename to images/icons/brush.svg diff --git a/images/icons/cloud.svg b/images/icons/cloud.svg new file mode 100644 index 0000000000..05e2782431 --- /dev/null +++ b/images/icons/cloud.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/images/icons/comment.svg b/images/icons/comment.svg new file mode 100644 index 0000000000..61032ae3f0 --- /dev/null +++ b/images/icons/comment.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/images/icons/envelope.svg b/images/icons/envelope.svg new file mode 100644 index 0000000000..20e606e4b6 --- /dev/null +++ b/images/icons/envelope.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/webpages/settings/expand.svg b/images/icons/expand.svg similarity index 100% rename from webpages/settings/expand.svg rename to images/icons/expand.svg diff --git a/images/icons/follow.svg b/images/icons/follow.svg new file mode 100644 index 0000000000..3619065b2d --- /dev/null +++ b/images/icons/follow.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/images/icons/forum.svg b/images/icons/forum.svg new file mode 100644 index 0000000000..49180ed03d --- /dev/null +++ b/images/icons/forum.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/images/icons/heart.svg b/images/icons/heart.svg new file mode 100644 index 0000000000..dd0e88b58c --- /dev/null +++ b/images/icons/heart.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/webpages/settings/list.svg b/images/icons/list.svg similarity index 100% rename from webpages/settings/list.svg rename to images/icons/list.svg diff --git a/images/icons/plus.svg b/images/icons/plus.svg new file mode 100644 index 0000000000..bb7d92e90c --- /dev/null +++ b/images/icons/plus.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/images/icons/popout.svg b/images/icons/popout.svg new file mode 100644 index 0000000000..533a7129fe --- /dev/null +++ b/images/icons/popout.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/webpages/settings/puzzle.svg b/images/icons/puzzle.svg similarity index 100% rename from webpages/settings/puzzle.svg rename to images/icons/puzzle.svg diff --git a/images/icons/read.svg b/images/icons/read.svg new file mode 100644 index 0000000000..8e288f922c --- /dev/null +++ b/images/icons/read.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/images/icons/reload.svg b/images/icons/reload.svg new file mode 100644 index 0000000000..66026a149a --- /dev/null +++ b/images/icons/reload.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/images/icons/remix.svg b/images/icons/remix.svg new file mode 100644 index 0000000000..eacc197126 --- /dev/null +++ b/images/icons/remix.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/webpages/popup/settings.svg b/images/icons/settings.svg similarity index 100% rename from webpages/popup/settings.svg rename to images/icons/settings.svg diff --git a/images/icons/star.svg b/images/icons/star.svg new file mode 100644 index 0000000000..d2c2d89ac3 --- /dev/null +++ b/images/icons/star.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/images/icons/studio-add.svg b/images/icons/studio-add.svg new file mode 100644 index 0000000000..e1acc6c980 --- /dev/null +++ b/images/icons/studio-add.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/images/icons/studio.svg b/images/icons/studio.svg new file mode 100644 index 0000000000..76b8a821a5 --- /dev/null +++ b/images/icons/studio.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/webpages/settings/theme.svg b/images/icons/theme.svg similarity index 100% rename from webpages/settings/theme.svg rename to images/icons/theme.svg diff --git a/webpages/settings/undo.svg b/images/icons/undo.svg similarity index 100% rename from webpages/settings/undo.svg rename to images/icons/undo.svg diff --git a/images/icons/users.svg b/images/icons/users.svg new file mode 100644 index 0000000000..d6a5c1a64e --- /dev/null +++ b/images/icons/users.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/webpages/settings/web.svg b/images/icons/web.svg similarity index 100% rename from webpages/settings/web.svg rename to images/icons/web.svg diff --git a/webpages/settings/wrench.svg b/images/icons/wrench.svg similarity index 100% rename from webpages/settings/wrench.svg rename to images/icons/wrench.svg diff --git a/popups/cloud-games/light.css b/popups/cloud-games/light.css index e429a1d481..481e1a5030 100644 --- a/popups/cloud-games/light.css +++ b/popups/cloud-games/light.css @@ -20,3 +20,7 @@ body::-webkit-scrollbar-thumb { .title a { color: #222; } + +.small-icon:not(.colored) { + filter: brightness(0); +} diff --git a/popups/cloud-games/popup.css b/popups/cloud-games/popup.css index 8833e2e899..39883f02d1 100644 --- a/popups/cloud-games/popup.css +++ b/popups/cloud-games/popup.css @@ -59,7 +59,7 @@ a:hover { .float-right { margin-left: 4px; white-space: nowrap; - font-size: 0.9rem; + font-size: 12px; } .float-right > span { display: inline-block; @@ -86,3 +86,8 @@ a:hover { .title a { color: white; } + +.small-icon { + height: 14px; + vertical-align: text-bottom; +} diff --git a/popups/cloud-games/popup.html b/popups/cloud-games/popup.html index a0adb8e7a5..5cf40a2c8c 100644 --- a/popups/cloud-games/popup.html +++ b/popups/cloud-games/popup.html @@ -15,7 +15,7 @@ {{ project.title }} - ๐Ÿ‘ค {{ project.amt }} + {{ project.amt }}
diff --git a/popups/scratch-messaging/light.css b/popups/scratch-messaging/light.css index c1e2029da2..0fe7378763 100644 --- a/popups/scratch-messaging/light.css +++ b/popups/scratch-messaging/light.css @@ -16,9 +16,6 @@ body::-webkit-scrollbar-thumb { #bottom-bar { background: #e3e3e3; } -#bottom-bar img { - filter: invert(0%); -} .message-type { border: 1px solid #cfcfcf; @@ -40,10 +37,18 @@ body::-webkit-scrollbar-thumb { border: 1px solid #b9b9b9; } +.small-icon:not(.colored) { + filter: brightness(0); +} + .popout-comment { filter: none; } +#popout { + filter: brightness(0); +} + .comment.unread, .unread .comment { background-color: #fff; diff --git a/popups/scratch-messaging/popout.png b/popups/scratch-messaging/popout.png deleted file mode 100644 index 2e21bc8422..0000000000 Binary files a/popups/scratch-messaging/popout.png and /dev/null differ diff --git a/popups/scratch-messaging/popup.css b/popups/scratch-messaging/popup.css index 383646c279..ae4f9535af 100644 --- a/popups/scratch-messaging/popup.css +++ b/popups/scratch-messaging/popup.css @@ -117,6 +117,13 @@ button { z-index: 999; margin: 10px 0px; } +.small-icon { + height: 14px; + vertical-align: text-bottom; +} +.small-icon:not(.colored) { + filter: brightness(100); +} .message-type-title-text { white-space: nowrap; text-overflow: ellipsis; @@ -128,7 +135,7 @@ button { .float-right { margin-left: 4px; white-space: nowrap; - font-size: 0.9rem; + font-size: 12px; } .float-right > span { display: inline-block; @@ -192,9 +199,9 @@ button { } .popout-comment { cursor: pointer; - height: 0.5rem; - vertical-align: middle; - filter: brightness(0) invert(1); + height: 10px; + vertical-align: text-top; + filter: brightness(100); } .delete-btn { float: right; @@ -286,11 +293,12 @@ button { height: 0.8rem; vertical-align: middle; opacity: 0.6; - filter: invert(1); + filter: brightness(100); } #open-messages { color: inherit; } #open-messages:hover #popout { opacity: 1; + filter: none; } diff --git a/popups/scratch-messaging/popup.html b/popups/scratch-messaging/popup.html index af44c16443..6b018b4fb5 100644 --- a/popups/scratch-messaging/popup.html +++ b/popups/scratch-messaging/popup.html @@ -17,8 +17,13 @@ > {{ thisComment.author }} - ยท {{ commentTimeAgo }}   - + ยท {{ commentTimeAgo }} + {{ deleteStep === 0 ? "Delete" : "Click to confirm deletion" }} @@ -57,10 +62,12 @@ @click="messageTypeExtended.follows = !messageTypeExtended.follows" >
- v + v
Follows - ๐Ÿง‘ {{ follows.length }} + {{ follows.length }}
@@ -76,14 +83,12 @@ @click="messageTypeExtended.studioInvites = !messageTypeExtended.studioInvites" >
- v + v
Studio invites - โœ‰๏ธ {{ studioInvites.length }} + {{ studioInvites.length }}
@@ -102,14 +107,12 @@ @click="messageTypeExtended.forumActivity = !messageTypeExtended.forumActivity" >
- v + v
Forum activity - ๐Ÿ“š {{ forumActivity.length }} + {{ forumActivity.length }}
@@ -129,13 +132,15 @@ >
v
Studio activity - ๐Ÿ†• {{ studioActivity.length }} + {{ studioActivity.length }}
@@ -152,10 +157,12 @@ @click="messageTypeExtended.remixes = !messageTypeExtended.remixes" >
- v + v
Remixes - ๐Ÿ”„ {{ remixes.length }} + {{ remixes.length }}
@@ -177,7 +184,9 @@ {{ profile.username }}'s profile - ๐Ÿ’ฌ {{profile.unreadComments}} + {{profile.unreadComments}}
@@ -211,7 +220,9 @@
Studio: {{ studio.title }} - ๐Ÿ’ฌ {{studio.unreadComments}} + {{studio.unreadComments}}
@@ -251,9 +262,15 @@
{{ project.title }} - โค๏ธ {{project.loves}} - โญ {{project.favorites}} - ๐Ÿ’ฌ {{project.unreadComments}} + {{project.loves}} + {{project.favorites}} + {{project.unreadComments}}
@@ -294,18 +311,24 @@ Scratch Addons settings. Loading comments... - + No unread messages.

- +
Mark messages as read - โœ“ Marked as read  |   + Marked as read  |   Open messages page  Open messages page  
diff --git a/webpages/popup/index.html b/webpages/popup/index.html index 2d40980c68..1847a7af06 100644 --- a/webpages/popup/index.html +++ b/webpages/popup/index.html @@ -13,7 +13,7 @@ Scratch Addons ...
-
+