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:
15
docs/static/js/carbon.js
vendored
15
docs/static/js/carbon.js
vendored
@@ -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);
|
||||||
})();
|
})();
|
||||||
|
Reference in New Issue
Block a user