Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit 8c8be6f

Browse files
committed
feat: remove "announcement" feature ๐Ÿงน
1 parent d1e9101 commit 8c8be6f

7 files changed

+1
-116
lines changed

โ€Žassets/announcement.ama.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

โ€Žassets/announcement.comment-editor.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

โ€Žassets/announcement.donate.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

โ€Žassets/announcement.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

โ€Žassets/announcement.stars.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

โ€Ždist/next-step-for-trello.css

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
display: block;
119119
}
120120

121-
/* next step toolbar button - announcements */
121+
/* next step toolbar button */
122122

123123
@keyframes pulse {
124124
0% {
@@ -129,51 +129,6 @@
129129
}
130130
}
131131

132-
.aj-nextstep-ant-icon {
133-
display: none;
134-
transform: translate3d(0, 0, 0);
135-
/* animation: pulse 1s linear infinite; */
136-
}
137-
138-
body.aj-nextstep-display-ant .aj-nextstep-ant-icon {
139-
display: inline !important;
140-
background: red;
141-
color: white;
142-
font-weight: bold;
143-
padding: 0 3px 0 3px;
144-
border: 1px solid white;
145-
font-size: 12px;
146-
position: relative;
147-
top: -1px;
148-
margin-right: 4px;
149-
}
150-
151-
body.aj-nextstep-display-ant .aj-nextstep-icon {
152-
display: none;
153-
}
154-
155-
body.aj-nextstep-display-ant .aj-nextstep-ant-menuitem {
156-
background-color: rgba(255, 0, 0, 0.1);
157-
}
158-
159-
.aj-nextstep-ant-pic {
160-
position: absolute;
161-
right: 10px;
162-
width: 40px;
163-
height: 40px;
164-
background-image: url('https://i.imgur.com/CK4hCZq.jpg');
165-
background-size: cover;
166-
}
167-
168-
.aj-nextstep-ant-pic2 {
169-
position: absolute;
170-
right: 10px;
171-
width: 40px;
172-
height: 40px;
173-
background-image: url('https://fr.gravatar.com/userimage/19157316/3f0cd85f9f19d20059d989b073e5f045.jpg');
174-
background-size: cover;
175-
}
176-
177132
#aj-nextstep-selector {
178133
margin-top: 6px;
179134
}

โ€Ždist/next-step-for-trello.user.js

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -87,26 +87,6 @@ function makeUserPrefs (COOKIE_NAME) {
8787
})
8888
}
8989

90-
// announcement helper
91-
function makeAnnouncement (announcementId, userPrefs) {
92-
const SEEN_PROP = 'seen-' + announcementId
93-
const getCheckCount = () => userPrefs.getValue('checkCounter', 0)
94-
const shouldDisplay = () => !userPrefs.getValue(SEEN_PROP) && getCheckCount() > 5
95-
const displayIfNecessary = () =>
96-
document.body.classList.toggle('aj-nextstep-display-ant', shouldDisplay())
97-
displayIfNecessary()
98-
return Object.assign(this, {
99-
incrementCheckCounter: () => {
100-
userPrefs.set({ checkCounter: getCheckCount() + 1 })
101-
displayIfNecessary()
102-
},
103-
setAsSeen: () => {
104-
userPrefs.setValue(SEEN_PROP, true)
105-
displayIfNecessary()
106-
}
107-
})
108-
}
109-
11090
// analytics helper
11191
class Analytics {
11292
constructor (code = 'UA-XXXXXXXX-X') {
@@ -230,7 +210,6 @@ let refreshing = false
230210
let token // needed by onCheckItem, populated by getToken()
231211
let initialized = false // populated by init()
232212
let watching = false // populated by watchForChanges()
233-
let announcement
234213

235214
function showCompleted () {
236215
return MODES[currentMode].showCompleted
@@ -309,10 +288,8 @@ function initToolbarButton () {
309288
btn.innerHTML = '<span class="board-header-btn-text">' +
310289
'<div id="aj-nextstep-loading" class="uil-reload-css"><div></div></div>' +
311290
'<img class="aj-nextstep-icon" src="' + iconUrl + '" />' +
312-
'<span class="aj-nextstep-ant-icon" style="display: none;">1</span>' + // announcement
313291
'<span id="aj-nextstep-mode">Next steps</span>' +
314292
'</span>'
315-
announcement = makeAnnouncement('ant7', userPrefs)
316293
return btn
317294
}
318295

@@ -376,7 +353,6 @@ function showToolbarSelector (btn) {
376353
node.hide && node.hide()
377354
}
378355
})
379-
announcement.setAsSeen()
380356
}, 1)
381357
const rect = btn.getBoundingClientRect()
382358
const width = 320
@@ -494,8 +470,6 @@ function onCheckItem (evt) {
494470
needsRefresh = {
495471
cardUrls: [item.getAttribute('data-card-url')]
496472
}
497-
// increment check counter
498-
announcement.incrementCheckCounter()
499473
})
500474
analytics.trackEvent('Checklist item', 'tick')
501475
}
@@ -610,20 +584,6 @@ function watchForChanges () {
610584
watching = true
611585
}
612586

613-
/*
614-
const loadAnnouncement = () => fetch(getAssetURL('announcement.json'))
615-
.then((response) => response.json())
616-
.catch(() => ({
617-
label: 'โœ Any feedback on Next Step for Trello?',
618-
description: 'Let me know how I can help, or give us some stars!',
619-
className: 'aj-nextstep-ant-menuitem aj-nextstep-ant-feedback',
620-
href: 'https://chrome.google.com/webstore/detail/next-step-for-trello/iajhmklhilkjgabejjemfbhmclgnmamf'
621-
}))
622-
.then((json) => MENU_ITEMS.push(Object.assign(json, {
623-
onClick: (evt) => announcement.setAsSeen()
624-
})))
625-
*/
626-
627587
const getToken = () => injectJs(
628588
getSymbolFromHost(
629589
'window.getAuthorization().token',

0 commit comments

Comments
ย (0)