-
Notifications
You must be signed in to change notification settings - Fork 0
/
base.js
26 lines (25 loc) · 903 Bytes
/
base.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
var createOrUpdateLink = function () {
var link = document.querySelector('.basecamp-link')
var title = document.querySelector('span.hP')
if (title && link && title.textContent.match(/Daily Recap/)) {
link.style.display = 'none'
}
else {
var links = document.querySelectorAll('[href^="https://basecamp.com/"]')
if (!links.length) return;
var href = links[0].href
if (!link) {
link = document.createElement('a')
link.className = 'basecamp-link T-I J-J5-Ji lS T-I-ax7 ar7'
link.target = '_blank'
link.href = href
var html = 'Visit this on Basecamp <img src="' + imgURL + '" />';
link.innerHTML = html
document.querySelector('.iH > div').appendChild(link)
}
link.style.display = ''
link.href = href
}
}
window.addEventListener('hashchange', createOrUpdateLink)
window.addEventListener('DOMFocusIn', createOrUpdateLink)