This repository has been archived by the owner on Oct 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alexander Matyushentsev
authored and
Alexander Matyushentsev
committed
Jan 2, 2021
1 parent
3397d9f
commit 17ed41e
Showing
1 changed file
with
25 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,26 @@ | ||
function callback(response) { | ||
const div = document.createElement('div'); | ||
div.innerHTML = response.html; | ||
document.body.appendChild(div); | ||
const container = div.querySelector('.rst-versions'); | ||
div.querySelector('.rst-current-version').addEventListener('click', function() { | ||
const classes = container.className.split(' '); | ||
const index = classes.indexOf('shift-up'); | ||
if (index === -1) { | ||
classes.push('shift-up'); | ||
} else { | ||
classes.splice(index, 1); | ||
} | ||
container.className = classes.join(' '); | ||
}); | ||
} | ||
(function() { | ||
const callbackName = 'callback_' + new Date().getTime(); | ||
window[callbackName] = function (response) { | ||
const div = document.createElement('div'); | ||
div.innerHTML = response.html; | ||
document.body.appendChild(div); | ||
const container = div.querySelector('.rst-versions'); | ||
div.querySelector('.rst-current-version').addEventListener('click', function() { | ||
const classes = container.className.split(' '); | ||
const index = classes.indexOf('shift-up'); | ||
if (index === -1) { | ||
classes.push('shift-up'); | ||
} else { | ||
classes.splice(index, 1); | ||
} | ||
container.className = classes.join(' '); | ||
}); | ||
} | ||
|
||
var script = document.createElement('script'); | ||
script.src = 'https://argocd-notifications.readthedocs.io/_/api/v2/footer_html/?'+ | ||
'callback=' + callbackName + '&project=argocd-notifications&page=&theme=mkdocs&format=jsonp&docroot=docs&source_suffix=.md&version=' + (window['READTHEDOCS_DATA'] || { version: 'latest' }).version; | ||
|
||
document.getElementsByTagName('head')[0].appendChild(script); | ||
})(); | ||
|
||
var script = document.createElement('script'); | ||
script.src = 'https://argocd-notifications.readthedocs.io/_/api/v2/footer_html/?'+ | ||
'callback=callback&project=argocd-notifications&page=&theme=mkdocs&format=jsonp&docroot=docs&source_suffix=.md&version=' + (window['READTHEDOCS_DATA'] || { version: 'latest' }).version; | ||
|
||
document.getElementsByTagName('head')[0].appendChild(script); |