|
|
@ -120,81 +120,87 @@ const Popup = {
|
|
|
|
document.querySelector('.empty').remove()
|
|
|
|
document.querySelector('.empty').remove()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Popup.categorise(detections).forEach(
|
|
|
|
const categorised = Popup.categorise(detections)
|
|
|
|
({ id, name, slug: categorySlug, technologies }) => {
|
|
|
|
|
|
|
|
const categoryNode = Popup.templates.category.cloneNode(true)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const link = categoryNode.querySelector('.category__link')
|
|
|
|
categorised.forEach(({ id, name, slug: categorySlug, technologies }) => {
|
|
|
|
|
|
|
|
const categoryNode = Popup.templates.category.cloneNode(true)
|
|
|
|
|
|
|
|
|
|
|
|
link.href = `https://www.wappalyzer.com/technologies/${categorySlug}`
|
|
|
|
const link = categoryNode.querySelector('.category__link')
|
|
|
|
link.textContent = name
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const pins = categoryNode.querySelectorAll('.category__pin')
|
|
|
|
link.href = `https://www.wappalyzer.com/technologies/${categorySlug}`
|
|
|
|
|
|
|
|
link.dataset.i18n = `categoryName${id}`
|
|
|
|
|
|
|
|
|
|
|
|
if (pinnedCategory === id) {
|
|
|
|
const pins = categoryNode.querySelectorAll('.category__pin')
|
|
|
|
pins.forEach((pin) => pin.classList.add('category__pin--active'))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pins.forEach((pin) =>
|
|
|
|
if (pinnedCategory === id) {
|
|
|
|
pin.addEventListener('click', async () => {
|
|
|
|
pins.forEach((pin) => pin.classList.add('category__pin--active'))
|
|
|
|
const pinnedCategory = await getOption('pinnedCategory')
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Array.from(
|
|
|
|
pins.forEach((pin) =>
|
|
|
|
document.querySelectorAll('.category__pin--active')
|
|
|
|
pin.addEventListener('click', async () => {
|
|
|
|
).forEach((pin) => pin.classList.remove('category__pin--active'))
|
|
|
|
const pinnedCategory = await getOption('pinnedCategory')
|
|
|
|
|
|
|
|
|
|
|
|
if (pinnedCategory === id) {
|
|
|
|
Array.from(
|
|
|
|
await setOption('pinnedCategory', null)
|
|
|
|
document.querySelectorAll('.category__pin--active')
|
|
|
|
} else {
|
|
|
|
).forEach((pin) => pin.classList.remove('category__pin--active'))
|
|
|
|
await setOption('pinnedCategory', id)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pins.forEach((pin) => pin.classList.add('category__pin--active'))
|
|
|
|
if (pinnedCategory === id) {
|
|
|
|
}
|
|
|
|
await setOption('pinnedCategory', null)
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
)
|
|
|
|
await setOption('pinnedCategory', id)
|
|
|
|
|
|
|
|
|
|
|
|
technologies
|
|
|
|
pins.forEach((pin) => pin.classList.add('category__pin--active'))
|
|
|
|
.filter(({ confidence }) => confidence >= 50)
|
|
|
|
}
|
|
|
|
.forEach(({ name, slug, confidence, version, icon, website }) => {
|
|
|
|
})
|
|
|
|
const technologyNode = Popup.templates.technology.cloneNode(true)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
const image = technologyNode.querySelector('.technology__icon')
|
|
|
|
technologies
|
|
|
|
|
|
|
|
.filter(({ confidence }) => confidence >= 50)
|
|
|
|
|
|
|
|
.forEach(({ name, slug, confidence, version, icon, website }) => {
|
|
|
|
|
|
|
|
const technologyNode = Popup.templates.technology.cloneNode(true)
|
|
|
|
|
|
|
|
|
|
|
|
image.src = `../images/icons/${icon}`
|
|
|
|
const image = technologyNode.querySelector('.technology__icon')
|
|
|
|
|
|
|
|
|
|
|
|
const link = technologyNode.querySelector('.technology__link')
|
|
|
|
image.src = `../images/icons/${icon}`
|
|
|
|
|
|
|
|
|
|
|
|
link.href = `https://www.wappalyzer.com/technologies/${categorySlug}/${slug}`
|
|
|
|
const link = technologyNode.querySelector('.technology__link')
|
|
|
|
link.textContent = name
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const confidenceNode = technologyNode.querySelector(
|
|
|
|
link.href = `https://www.wappalyzer.com/technologies/${categorySlug}/${slug}`
|
|
|
|
'.technology__confidence'
|
|
|
|
link.textContent = name
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (confidence < 100) {
|
|
|
|
const confidenceNode = technologyNode.querySelector(
|
|
|
|
confidenceNode.textContent = `${confidence}% sure`
|
|
|
|
'.technology__confidence'
|
|
|
|
} else {
|
|
|
|
)
|
|
|
|
confidenceNode.remove()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const versionNode = technologyNode.querySelector(
|
|
|
|
if (confidence < 100) {
|
|
|
|
'.technology__version'
|
|
|
|
confidenceNode.textContent = `${confidence}% sure`
|
|
|
|
)
|
|
|
|
} else {
|
|
|
|
|
|
|
|
confidenceNode.remove()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (version) {
|
|
|
|
const versionNode = technologyNode.querySelector(
|
|
|
|
versionNode.textContent = version
|
|
|
|
'.technology__version'
|
|
|
|
} else {
|
|
|
|
)
|
|
|
|
versionNode.remove()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
categoryNode
|
|
|
|
if (version) {
|
|
|
|
.querySelector('.technologies')
|
|
|
|
versionNode.textContent = version
|
|
|
|
.appendChild(technologyNode)
|
|
|
|
} else {
|
|
|
|
})
|
|
|
|
versionNode.remove()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
document.querySelector('.detections').appendChild(categoryNode)
|
|
|
|
categoryNode
|
|
|
|
}
|
|
|
|
.querySelector('.technologies')
|
|
|
|
)
|
|
|
|
.appendChild(technologyNode)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
document.querySelector('.detections').appendChild(categoryNode)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (categorised.length === 1) {
|
|
|
|
|
|
|
|
document
|
|
|
|
|
|
|
|
.querySelector('.detections')
|
|
|
|
|
|
|
|
.appendChild(Popup.templates.category.cloneNode(true))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Array.from(document.querySelectorAll('a')).forEach((a) =>
|
|
|
|
Array.from(document.querySelectorAll('a')).forEach((a) =>
|
|
|
|
a.addEventListener('click', (event) => {
|
|
|
|
a.addEventListener('click', (event) => {
|
|
|
|