feat: refine next week badge violet logic (v1.7.4)
This commit is contained in:
2
dist/bookmarklet-payload.js
vendored
2
dist/bookmarklet-payload.js
vendored
File diff suppressed because one or more lines are too long
2
dist/bookmarklet.txt
vendored
2
dist/bookmarklet.txt
vendored
File diff suppressed because one or more lines are too long
2
dist/install.html
vendored
2
dist/install.html
vendored
File diff suppressed because one or more lines are too long
9
dist/kantine-standalone.html
vendored
9
dist/kantine-standalone.html
vendored
@@ -2061,12 +2061,15 @@ body {
|
|||||||
// Color Logic
|
// Color Logic
|
||||||
badge.classList.remove('badge-violet', 'badge-green', 'badge-red', 'badge-blue');
|
badge.classList.remove('badge-violet', 'badge-green', 'badge-red', 'badge-blue');
|
||||||
|
|
||||||
if (daysWithOrders === totalDataCount && totalDataCount > 0) {
|
// Refined Logic (v1.7.4):
|
||||||
badge.classList.add('badge-violet'); // All days ordered
|
// Violet: If we have orders AND there are no DAYS left that are orderable but un-ordered.
|
||||||
|
// (i.e. "I have ordered everything I can")
|
||||||
|
if (daysWithOrders > 0 && daysWithOrderableAndNoOrder === 0) {
|
||||||
|
badge.classList.add('badge-violet');
|
||||||
} else if (daysWithOrderableAndNoOrder > 0) {
|
} else if (daysWithOrderableAndNoOrder > 0) {
|
||||||
badge.classList.add('badge-green'); // Orderable days exist without order
|
badge.classList.add('badge-green'); // Orderable days exist without order
|
||||||
} else if (orderableCount === 0) {
|
} else if (orderableCount === 0) {
|
||||||
badge.classList.add('badge-red'); // No orderable days at all
|
badge.classList.add('badge-red'); // No orderable days at all & no orders
|
||||||
} else {
|
} else {
|
||||||
badge.classList.add('badge-blue'); // Default / partial state
|
badge.classList.add('badge-blue'); // Default / partial state
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -915,12 +915,15 @@
|
|||||||
// Color Logic
|
// Color Logic
|
||||||
badge.classList.remove('badge-violet', 'badge-green', 'badge-red', 'badge-blue');
|
badge.classList.remove('badge-violet', 'badge-green', 'badge-red', 'badge-blue');
|
||||||
|
|
||||||
if (daysWithOrders === totalDataCount && totalDataCount > 0) {
|
// Refined Logic (v1.7.4):
|
||||||
badge.classList.add('badge-violet'); // All days ordered
|
// Violet: If we have orders AND there are no DAYS left that are orderable but un-ordered.
|
||||||
|
// (i.e. "I have ordered everything I can")
|
||||||
|
if (daysWithOrders > 0 && daysWithOrderableAndNoOrder === 0) {
|
||||||
|
badge.classList.add('badge-violet');
|
||||||
} else if (daysWithOrderableAndNoOrder > 0) {
|
} else if (daysWithOrderableAndNoOrder > 0) {
|
||||||
badge.classList.add('badge-green'); // Orderable days exist without order
|
badge.classList.add('badge-green'); // Orderable days exist without order
|
||||||
} else if (orderableCount === 0) {
|
} else if (orderableCount === 0) {
|
||||||
badge.classList.add('badge-red'); // No orderable days at all
|
badge.classList.add('badge-red'); // No orderable days at all & no orders
|
||||||
} else {
|
} else {
|
||||||
badge.classList.add('badge-blue'); // Default / partial state
|
badge.classList.add('badge-blue'); // Default / partial state
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user