mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
fix: url template vars
This commit is contained in:
parent
0557a5000f
commit
62e3decf0f
@ -9,26 +9,4 @@
|
|||||||
<div class="text-sm">
|
<div class="text-sm">
|
||||||
<a href="imprint" class="font-semibold hover:text-gray-400">Imprint, Cookies & Data Privacy</a>
|
<a href="imprint" class="font-semibold hover:text-gray-400">Imprint, Cookies & Data Privacy</a>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
const baseUrl = location.href.substring(0, location.href.lastIndexOf('/'))
|
|
||||||
document.querySelectorAll('.with-url-src').forEach(e => {
|
|
||||||
e.setAttribute('src', e.getAttribute('src').replace('%s', baseUrl))
|
|
||||||
e.classList.remove('hidden')
|
|
||||||
})
|
|
||||||
document.querySelectorAll('.with-url-src-no-scheme').forEach(e => {
|
|
||||||
const strippedUrl = baseUrl.replace(/https?:\/\//, '')
|
|
||||||
e.setAttribute('src', e.getAttribute('src').replace('%s', strippedUrl))
|
|
||||||
e.classList.remove('hidden')
|
|
||||||
})
|
|
||||||
document.querySelectorAll('.with-url-inner').forEach(e => {
|
|
||||||
e.innerHTML = e.innerHTML.replace('%s', baseUrl)
|
|
||||||
e.classList.remove('hidden')
|
|
||||||
})
|
|
||||||
document.querySelectorAll('.with-url-inner-no-scheme').forEach(e => {
|
|
||||||
const strippedUrl = baseUrl.replace(/https?:\/\//, '')
|
|
||||||
e.innerHTML = e.innerHTML.replace('%s', strippedUrl)
|
|
||||||
e.classList.remove('hidden')
|
|
||||||
})
|
|
||||||
</script>
|
|
@ -1,4 +1,4 @@
|
|||||||
<div class="flex justify-between space-x-4 items-center relative">
|
<div class="flex justify-between space-x-4 items-center relative" id="main-menu">
|
||||||
<div class="mr-8">
|
<div class="mr-8">
|
||||||
{{ template "logo.tpl.html" }}
|
{{ template "logo.tpl.html" }}
|
||||||
</div>
|
</div>
|
||||||
|
@ -579,7 +579,7 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<input
|
<input
|
||||||
class="flex-shrink w-full font-mono text-xs appearance-none bg-gray-850 text-gray-500 outline-none rounded py-2 px-4 cursor-not-allowed"
|
class="with-url-value flex-shrink w-full font-mono text-xs appearance-none bg-gray-850 text-gray-500 outline-none rounded py-2 px-4 cursor-not-allowed"
|
||||||
value="https://img.shields.io/endpoint?url=%s/api/compat/shields/v1/{{ .User.ID }}/interval:today&style=flat-square&color=2F855A&label=today"
|
value="https://img.shields.io/endpoint?url=%s/api/compat/shields/v1/{{ .User.ID }}/interval:today&style=flat-square&color=2F855A&label=today"
|
||||||
readonly
|
readonly
|
||||||
>
|
>
|
||||||
@ -594,7 +594,7 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<input
|
<input
|
||||||
class="flex-shrink w-full font-mono text-xs appearance-none bg-gray-850 text-gray-500 outline-none rounded py-2 px-4 cursor-not-allowed"
|
class="with-url-value flex-shrink w-full font-mono text-xs appearance-none bg-gray-850 text-gray-500 outline-none rounded py-2 px-4 cursor-not-allowed"
|
||||||
value="https://img.shields.io/endpoint?url=%s/api/compat/shields/v1/{{ .User.ID }}/interval:30_days&style=flat-square&color=2F855A&label=last 30d"
|
value="https://img.shields.io/endpoint?url=%s/api/compat/shields/v1/{{ .User.ID }}/interval:30_days&style=flat-square&color=2F855A&label=last 30d"
|
||||||
readonly
|
readonly
|
||||||
>
|
>
|
||||||
@ -625,7 +625,7 @@
|
|||||||
class="with-url-src-no-scheme" alt="Readme Stats Card">
|
class="with-url-src-no-scheme" alt="Readme Stats Card">
|
||||||
</div>
|
</div>
|
||||||
<textarea
|
<textarea
|
||||||
class="flex-shrink w-full font-mono text-xs appearance-none bg-gray-850 text-gray-500 outline-none rounded py-2 px-4 cursor-not-allowed mt-2"
|
class="with-url-inner-no-scheme flex-shrink w-full font-mono text-xs appearance-none bg-gray-850 text-gray-500 outline-none rounded py-2 px-4 cursor-not-allowed mt-2"
|
||||||
rows="5" style="resize: none"
|
rows="5" style="resize: none"
|
||||||
readonly>https://github-readme-stats.vercel.app/api/wakatime?username={{ .User.ID }}&api_domain=%s&bg_color=1A202C&title_color=2F855A&icon_color=2F855A&text_color=ffffff&custom_title=Wakapi%20Week%20Stats&layout=compact</textarea>
|
readonly>https://github-readme-stats.vercel.app/api/wakatime?username={{ .User.ID }}&api_domain=%s&bg_color=1A202C&title_color=2F855A&icon_color=2F855A&text_color=ffffff&custom_title=Wakapi%20Week%20Stats&layout=compact</textarea>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
@ -684,6 +684,27 @@
|
|||||||
|
|
||||||
{{ template "footer.tpl.html" . }}
|
{{ template "footer.tpl.html" . }}
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
const baseUrl = location.href.substring(0, location.href.lastIndexOf('/'))
|
||||||
|
document.querySelectorAll('.with-url-src').forEach(e => {
|
||||||
|
e.setAttribute('src', e.getAttribute('src').replace('%s', baseUrl))
|
||||||
|
})
|
||||||
|
document.querySelectorAll('.with-url-src-no-scheme').forEach(e => {
|
||||||
|
const strippedUrl = baseUrl.replace(/https?:\/\//, '')
|
||||||
|
e.setAttribute('src', e.getAttribute('src').replace('%s', strippedUrl))
|
||||||
|
})
|
||||||
|
document.querySelectorAll('.with-url-value').forEach(e => {
|
||||||
|
e.setAttribute('value', e.getAttribute('value').replace('%s', baseUrl))
|
||||||
|
})
|
||||||
|
document.querySelectorAll('.with-url-inner').forEach(e => {
|
||||||
|
e.innerHTML = e.innerHTML.replace('%s', baseUrl)
|
||||||
|
})
|
||||||
|
document.querySelectorAll('.with-url-inner-no-scheme').forEach(e => {
|
||||||
|
const strippedUrl = baseUrl.replace(/https?:\/\//, '')
|
||||||
|
e.innerHTML = e.innerHTML.replace('%s', strippedUrl)
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
{{ template "foot.tpl.html" . }}
|
{{ template "foot.tpl.html" . }}
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user