1
0
mirror of https://github.com/go-task/task.git synced 2025-08-10 22:42:19 +02:00

Website: Adjustments to Carbon

This commit is contained in:
Andrey Nering
2022-09-17 11:11:02 -03:00
parent b16e705a6c
commit 8f0893b5f7

View File

@@ -1,6 +1,6 @@
(function () { (function () {
function attachAd() { function attachAd() {
const el = document.createElement('script'); var el = document.createElement('script');
el.setAttribute('type', 'text/javascript'); el.setAttribute('type', 'text/javascript');
el.setAttribute('id', '_carbonads_js'); el.setAttribute('id', '_carbonads_js');
el.setAttribute( el.setAttribute(
@@ -9,7 +9,7 @@
); );
el.setAttribute('async', 'async'); el.setAttribute('async', 'async');
const wrapper = document.getElementById('sidebar-ads'); var wrapper = document.getElementById('sidebar-ads');
wrapper.innerHTML = ''; wrapper.innerHTML = '';
wrapper.appendChild(el); wrapper.appendChild(el);
} }
@@ -17,8 +17,13 @@
setTimeout(function () { setTimeout(function () {
attachAd(); attachAd();
window.addEventListener('popstate', function () { var currentPath = window.location.pathname;
attachAd();
}); setInterval(function () {
if (currentPath !== window.location.pathname) {
currentPath = window.location.pathname;
attachAd();
}
}, 1000);
}, 1000); }, 1000);
})(); })();