Upgrade tlačítka na aktualizaci korektur.
This commit is contained in:
parent
392e345802
commit
c125d7a62b
4 changed files with 24 additions and 30 deletions
10
korektury/static/korektury/imgs/reload.svg
Normal file
10
korektury/static/korektury/imgs/reload.svg
Normal file
|
@ -0,0 +1,10 @@
|
|||
<svg id="icon-reload" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 120 120" xml:space="preserve">
|
||||
<g>
|
||||
<path d="M60,95.5c-19.575,0-35.5-15.926-35.5-35.5c0-19.575,15.925-35.5,35.5-35.5c13.62,0,25.467,7.714,31.418,19h22.627
|
||||
C106.984,20.347,85.462,3.5,60,3.5C28.796,3.5,3.5,28.796,3.5,60c0,31.203,25.296,56.5,56.5,56.5
|
||||
c16.264,0,30.911-6.882,41.221-17.88L85.889,84.255C79.406,91.168,70.201,95.5,60,95.5z"/>
|
||||
</g>
|
||||
<line fill="none" x1="120" y1="0" x2="120" y2="45.336"/>
|
||||
<line fill="none" x1="91.418" y1="43.5" x2="114.045" y2="43.5"/>
|
||||
<polygon points="120,21.832 119.992,68.842 74.827,55.811 "/>
|
||||
</svg>
|
After Width: | Height: | Size: 712 B |
|
@ -55,31 +55,6 @@ img{background:white;}
|
|||
.toggle-button { transform: rotate(180deg); }
|
||||
}
|
||||
|
||||
/* Tlačítko na aktualizaci */
|
||||
|
||||
#korektury-aktualizace {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 10px;
|
||||
|
||||
border-radius: 10px;
|
||||
|
||||
|
||||
/* copy-paste .button */
|
||||
margin: 10px 0 10px 0;
|
||||
padding: 4px 0; /*vertikální centování textu*/
|
||||
text-align: center;
|
||||
background-color: #e84e10;
|
||||
color: #fffbf6;
|
||||
font-size: 150%;
|
||||
font-weight: bold;
|
||||
font-variant: small-caps;
|
||||
filter: drop-shadow(0px 5px 5px rgba(0, 0, 0, 0.4));
|
||||
|
||||
&:hover {
|
||||
background-color: #df490e;
|
||||
}
|
||||
}
|
||||
|
||||
/* Čára od textu k místu korektury */
|
||||
.pointer{
|
||||
|
@ -205,6 +180,11 @@ form {
|
|||
#predchozi-korektura-k-zaneseni, #dalsi-korektura-k-zaneseni {
|
||||
background-color: #00FF00;
|
||||
}
|
||||
|
||||
/* Tlačítko na aktualizaci */
|
||||
#korektury-aktualizace {
|
||||
background-color: #e84e10;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -20,6 +20,12 @@
|
|||
<button type='button' id="dalsi-korektura-k-zaneseni" title='Další korektura k zaneseni'>
|
||||
<img class='toggle-button' src='{% static "korektury/imgs/hide.png" %}' alt='⬇' style="transform: rotate(180deg);"/>
|
||||
</button>
|
||||
<button type='button' id='korektury-aktualizace'
|
||||
title='Aktualizuj korektury
|
||||
Nemusíš mačkat, pokud ti stačí, že se korektury aktualizují samy každé 2 minuty a při každém přidání korektury/komentáře.'
|
||||
>
|
||||
<img class='toggle-button' src='{% static "korektury/imgs/reload.svg" %}' alt='↻' style="width: 15px"/>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
@ -64,4 +70,7 @@
|
|||
dalsi_k_o.addEventListener('click', _ => { dalsi_nebo_predchozi_korektura(true, "k_oprave") });
|
||||
predchozi_k_z.addEventListener('click', _ => { dalsi_nebo_predchozi_korektura(false, "k_zaneseni") });
|
||||
dalsi_k_z.addEventListener('click', _ => { dalsi_nebo_predchozi_korektura(true, "k_zaneseni") });
|
||||
|
||||
// FIXME není mi jasné, zda v {} nemá být `cache: "no-store"`, aby prohlížeč necachoval GET.
|
||||
document.getElementById("korektury-aktualizace").addEventListener("click", _ => update_all({}, false));
|
||||
</script>
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
|
||||
{% include "korektury/korekturovatko/__dalsi_korektura.html" %}
|
||||
|
||||
<button type="button" id="korektury-aktualizace" title="Nemusíš mačkat, pokud ti stačí, že se korektury aktualizují samy každé 2 minuty a při každém přidání korektury/komentáře.">Aktualizuj korektury.</button>
|
||||
|
||||
<script>
|
||||
/**
|
||||
*
|
||||
|
@ -44,9 +42,6 @@
|
|||
});
|
||||
});
|
||||
|
||||
// FIXME není mi jasné, zda v {} nemá být `cache: "no-store"`, aby prohlížeč necachoval GET.
|
||||
document.getElementById("korektury-aktualizace").addEventListener("click", _ => update_all({}, false));
|
||||
|
||||
// FIXME není mi jasné, zda v {} nemá být `cache: "no-store"`, aby prohlížeč necachoval GET.
|
||||
setInterval(() => update_all({}, false), 120000); // Každý dvě minuty fetchni korektury
|
||||
</script>
|
||||
|
|
Loading…
Reference in a new issue