Announcement:Many features no longer work with the new Shop My Wants Marketplace. It will take a significant amount of work to get things back in order. I've written a post in the DE group with more details. Please take a moment to read it and give feedback if you like. Thank you!
+
Announcement:Discogs Enhancer will soon be moving to a subscription model. This change is necessary to support the growing amount of work required to keep the extension running across all areas of Discogs. Learn More.
@@ -70,29 +70,6 @@
Discogs Enhancer
Having issues with this extension? Try the Troubleshooting section or email me: discogs.enhancer@gmail.com.
Discogs Enhancer uses a custom foreign exchange rate API for currency conversions and price comparisons. Hosting for the API costs $7.20 a month / $86.40 a year via Digital Ocean. Even the smallest contribution helps pay for the server!
-
You'll also get your name listed in the Thank You section with a rad star (★) next to it!
diff --git a/js/extension/dependencies/resource-library.js b/js/extension/dependencies/resource-library.js
index 8a1ad106..6ed9dd07 100644
--- a/js/extension/dependencies/resource-library.js
+++ b/js/extension/dependencies/resource-library.js
@@ -1011,6 +1011,44 @@
}
},
+ /**
+ * Set a cookie
+ *
+ * @param {string} name - The name of the cookie
+ * @param {string} value - The value of the cookie
+ * @param {Object} [options] - Optional settings
+ * @param {number} [options.days] - Number of days until the cookie expires
+ * @param {string} [options.path] - The path where the cookie is valid (default: "/")
+ * @param {string} [options.domain] - The domain for the cookie
+ * @param {boolean} [options.secure] - Whether the cookie should only be sent over HTTPS
+ * @param {boolean} [options.sameSite] - "Strict", "Lax", or "None"
+ */
+ setCookie: function(name, value, options = {}) {
+ let cookieString = `${encodeURIComponent(name)}=${encodeURIComponent(value)}`;
+
+ if (options.days) {
+ const date = new Date();
+ date.setTime(date.getTime() + options.days * 24 * 60 * 60 * 1000);
+ cookieString += `; expires=${date.toUTCString()}`;
+ }
+
+ cookieString += `; path=${options.path || '/'}`;
+
+ if (options.domain) {
+ cookieString += `; domain=${options.domain}`;
+ }
+
+ if (options.secure) {
+ cookieString += '; secure';
+ }
+
+ if (options.sameSite) {
+ cookieString += `; samesite=${options.sameSite}`;
+ }
+
+ document.cookie = cookieString;
+ },
+
/**
* Convenience method so I don't forget to stringify
* my values before setting them.
diff --git a/js/extension/features/dashboard-notification.js b/js/extension/features/dashboard-notification.js
new file mode 100644
index 00000000..bf617288
--- /dev/null
+++ b/js/extension/features/dashboard-notification.js
@@ -0,0 +1,88 @@
+rl.ready(() => {
+
+ if ( rl.pageIs('dashboard') ) {
+
+ let dashboard = document.querySelector('#page_aside ul.module_blocks.right'),
+ forumPost = 'https://www.discogs.com/group/thread/1136261',
+ isAdmin = window.dsdata().userIsAdmin,
+ cookieName = 'de-subscription-notice',
+ cookie = rl.getCookie(cookieName);
+
+ let rules = /* css */`
+ .de-dashboard-notification {
+ --bg-col: #ffffff;
+ }
+ .de-dark-theme .de-dashboard-notification {
+ --bg-col: var(--main-bg-color);
+ }
+ .de-dashboard-notification .alert-message {
+ background: radial-gradient(circle at 100% 100%, var(--bg-col) 0, var(--bg-col) 8px, transparent 8px) 0% 0%/10px 10px no-repeat,
+ radial-gradient(circle at 0 100%, var(--bg-col) 0, var(--bg-col) 8px, transparent 8px) 100% 0%/10px 10px no-repeat,
+ radial-gradient(circle at 100% 0, var(--bg-col) 0, var(--bg-col) 8px, transparent 8px) 0% 100%/10px 10px no-repeat,
+ radial-gradient(circle at 0 0, var(--bg-col) 0, var(--bg-col) 8px, transparent 8px) 100% 100%/10px 10px no-repeat,
+ linear-gradient(var(--bg-col), var(--bg-col)) 50% 50%/calc(100% - 4px) calc(100% - 20px) no-repeat,
+ linear-gradient(var(--bg-col), var(--bg-col)) 50% 50%/calc(100% - 20px) calc(100% - 4px) no-repeat,
+ repeating-linear-gradient(45deg, #8848e0 0%, #c848e0 25%, #fe6e01 50%, rgba(245, 181, 65, 1) 75%, #efec73 100%) no-repeat;
+ border-radius: 10px;
+ padding: 16px;
+ box-sizing: content-box;
+ }
+
+ .de-close-icon {
+ float: right;
+ height: 22px;
+ text-decoration: none;
+ font-size: 18px;
+ font-weight: bold;
+ color: #000;
+ background: none;
+ border: none;
+ padding: 0px;
+ }
+
+ .de-dark-theme .de-dashboard-notification .alert-message-announcement.alert-message .alert-message-text a.de-learn-more {
+ color: var(--link) !important;
+ }
+ `;
+
+ let markup = /* html */`
+
+
+
+
+ A Message from Discogs Enhancer
+
+
+
+
+ A Message from Discogs Enhancer
+
+ Discogs Enhancer will soon be moving to a subscription model. This change is necessary to support the growing amount of work required to keep the extension running across all areas of Discogs. Learn more.
+
+