Skip to content

Commit e2a0f17

Browse files
committed
Fix copyToClipboard
1 parent 5d05f89 commit e2a0f17

File tree

1 file changed

+37
-36
lines changed

1 file changed

+37
-36
lines changed

acknowledging.html

+37-36
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,19 @@
2626
<div id="navbar-placeholder"></div>
2727

2828
<script>
29-
function copyToClipboard(element) {
30-
var $temp = $("<textarea>");
31-
$("body").append($temp);
32-
var x = $(element).text().trim().replace(/<br>/g, '\n').replace(/<\/?[^>]+>/g, '');
33-
$temp.val(x).select();
34-
document.execCommand("copy");
35-
$temp.remove();
36-
}
29+
function copyToClipboard(elementId) {
30+
// Selection of the input element l'élément input
31+
let text = document.getElementById(elementId).innerText;
32+
33+
// Copy le text in clipboard
34+
navigator.clipboard.writeText(text)
35+
.then(() => {
36+
let message = document.getElementById("confirmationMessage");
37+
message.style.display = "block"; // Print message
38+
setTimeout(() => message.style.display = "none", 2000); // Caching after 2 sec
39+
})
40+
.catch(err => console.error("Copy error :", err));
41+
}
3742
</script>
3843

3944
<p id="bibtex-proc" style="display:none;">
@@ -65,27 +70,27 @@
6570
</p>
6671

6772
<p id="bibtex-paper" style="display:none;">
68-
@article{gammapy:2023,
69-
author = {{Donath}, Axel and {Terrier}, R\'egis and {Remy}, Quentin and {Sinha}, Atreyee and {Nigro}, Cosimo and
70-
{Pintore}, Fabio and {Kh\'elifi}, Bruno and {Olivera-Nieto}, Laura and {Ruiz}, Jose Enrique and
71-
{Br\"ugge}, Kai and {Linhoff}, Maximilian and {Contreras}, Jose Luis and {Acero}, Fabio and
72-
{Aguasca-Cabot}, Arnau and {Berge}, David and {Bhattacharjee}, Pooja and {Buchner}, Johannes and
73-
{Boisson}, Catherine and {Carreto Fidalgo}, David and {Chen}, Andrew and {de Bony de Lavergne}, Mathieu and
74-
{de Miranda Cardoso}, Jos\'e Vinicius and {Deil}, Christoph and {F\"u\ss{}ling}, Matthias and
75-
{Funk}, Stefan and {Giunti}, Luca and {Hinton}, Jim and {Jouvin}, L\'ea and {King}, Johannes and
76-
{Lefaucheur}, Julien and {Lemoine-Goumard}, Marianne and {Lenain}, Jean-Philippe and {L\'opez-Coto}, Rub\'en
77-
and {Mohrmann}, Lars and {Morcuende}, Daniel and {Panny}, Sebastian and {Regeard}, Maxime and {Saha}, Lab
78-
and {Siejkowski}, Hubert and {Siemiginowska}, Aneta and {Sip"ocz}, Brigitta M. and {Unbehaun}, Tim
79-
and {van Eldik}, Christopher and {Vuillaume}, Thomas and {Zanin}, Roberta},
80-
title = {Gammapy: A Python package for gamma-ray astronomy},
81-
DOI= "10.1051/0004-6361/202346488",
82-
url= "https://doi.org/10.1051/0004-6361/202346488",
83-
journal = {A&A},
84-
year = 2023,
85-
volume = 678,
86-
pages = "A157",
87-
}
88-
</p>
73+
@article{gammapy:2023,
74+
author = {{Donath}, Axel and {Terrier}, R\'egis and {Remy}, Quentin and {Sinha}, Atreyee and {Nigro}, Cosimo and
75+
{Pintore}, Fabio and {Kh\'elifi}, Bruno and {Olivera-Nieto}, Laura and {Ruiz}, Jose Enrique and
76+
{Br\"ugge}, Kai and {Linhoff}, Maximilian and {Contreras}, Jose Luis and {Acero}, Fabio and
77+
{Aguasca-Cabot}, Arnau and {Berge}, David and {Bhattacharjee}, Pooja and {Buchner}, Johannes and
78+
{Boisson}, Catherine and {Carreto Fidalgo}, David and {Chen}, Andrew and {de Bony de Lavergne}, Mathieu and
79+
{de Miranda Cardoso}, Jos\'e Vinicius and {Deil}, Christoph and {F\"u\ss{}ling}, Matthias and
80+
{Funk}, Stefan and {Giunti}, Luca and {Hinton}, Jim and {Jouvin}, L\'ea and {King}, Johannes and
81+
{Lefaucheur}, Julien and {Lemoine-Goumard}, Marianne and {Lenain}, Jean-Philippe and {L\'opez-Coto}, Rub\'en
82+
and {Mohrmann}, Lars and {Morcuende}, Daniel and {Panny}, Sebastian and {Regeard}, Maxime and {Saha}, Lab
83+
and {Siejkowski}, Hubert and {Siemiginowska}, Aneta and {Sip"ocz}, Brigitta M. and {Unbehaun}, Tim
84+
and {van Eldik}, Christopher and {Vuillaume}, Thomas and {Zanin}, Roberta},
85+
title = {Gammapy: A Python package for gamma-ray astronomy},
86+
DOI= "10.1051/0004-6361/202346488",
87+
url= "https://doi.org/10.1051/0004-6361/202346488",
88+
journal = {A&A},
89+
year = 2023,
90+
volume = 678,
91+
pages = "A157",
92+
}
93+
</p>
8994

9095
<p id="bibtex-zenodo-11" style="display:none;">
9196
@software{gammapy:zenodo-1.1,
@@ -221,16 +226,12 @@ <h2 id="publication"><a href="#pub">In publications</a></h2>
221226
<ul>
222227
<li><a href="https://www.aanda.org/component/article?access=doi&doi=10.1051/0004-6361/202346488">Gammapy paper in A&amp;A</a>
223228
(as a general citation) &nbsp; &nbsp;
224-
<button class="button-fancy"
225-
onclick="copyToClipboard('#bibtex-paper'); alert('A&amp;A BibTeX copied!');">
226-
<small>Copy BibTeX to clipboard</small>
227-
</button>
229+
<button class="button-fancy" onclick="copyToClipboard('bibtex-paper'); alert('A&amp;A BibTeX copied!');">
230+
<small>Copy BibTeX to clipboard</small></button>
228231
</li>
229-
<!-- <li><a href="https://arxiv.org/abs/1709.01751">Gammapy paper</a>
230-
(<a href="https://ui.adsabs.harvard.edu/abs/2017ICRC...35..766D/abstract">ADS</a>) (as a general citation)</li> -->
231232
<li><a href="https://doi.org/10.5281/zenodo.4701488">Gammapy on Zenodo</a> (with the specific version used) &nbsp; &nbsp; &nbsp;
232233
- &nbsp; &nbsp;e.g. for the v1.3: &nbsp; <button class="button-fancy"
233-
onclick="copyToClipboard('#bibtex-zenodo-13'); alert('Zenodo v1.3 BibTeX copied!');">
234+
onclick="copyToClipboard('bibtex-zenodo-13'); alert('Zenodo v1.3 BibTeX copied!');">
234235
<small>Copy BibTeX to clipboard</small>
235236
</button>
236237
</li>

0 commit comments

Comments
 (0)