mirror of
https://github.com/ae-utbm/sith.git
synced 2025-01-11 09:31:12 +00:00
Remove some jquery
This commit is contained in:
parent
429df81ec9
commit
2db3290bed
@ -125,15 +125,14 @@
|
|||||||
navbar.style.setProperty("display", current === "none" ? "block" : "none");
|
navbar.style.setProperty("display", current === "none" ? "block" : "none");
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).keydown(function (e) {
|
document.addEventListener("keydown", (e) => {
|
||||||
if ($(e.target).is('input')) { return }
|
// Looking at the `s` key when not typing in a form
|
||||||
if ($(e.target).is('textarea')) { return }
|
if (e.keyCode !== 83 || ["INPUT", "TEXTAREA", "SELECT"].includes(e.target.nodeName)) {
|
||||||
if ($(e.target).is('select')) { return }
|
return;
|
||||||
if (e.keyCode === 83) {
|
|
||||||
$("#search").focus();
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
});
|
document.getElementById("search").focus();
|
||||||
|
e.preventDefault(); // Don't type the character in the focused search input
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</body>
|
</body>
|
||||||
|
@ -57,13 +57,4 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% block script %}
|
|
||||||
{{ super() }}
|
|
||||||
{% if popup %}
|
|
||||||
<script>
|
|
||||||
parent.$(".choose_file_widget").css("height", "75%");
|
|
||||||
</script>
|
|
||||||
{% endif %}
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -244,27 +244,30 @@
|
|||||||
{% block script %}
|
{% block script %}
|
||||||
{{ super() }}
|
{{ super() }}
|
||||||
<script>
|
<script>
|
||||||
$(function () {
|
// Image selection
|
||||||
var keys = [];
|
for (const img of document.querySelectorAll("#small_pictures img")){
|
||||||
var pattern = "71,85,89,71,85,89";
|
img.addEventListener("click", (e) => {
|
||||||
$(document).keydown(function (e) {
|
const displayed = document.querySelector("#big_picture img");
|
||||||
keys.push(e.keyCode);
|
displayed.src = e.target.src;
|
||||||
if (keys.toString() == pattern) {
|
displayed.alt = e.target.alt;
|
||||||
keys = [];
|
displayed.title = e.target.title;
|
||||||
$("#big_picture img").attr("src", "{{ static('core/img/yug.jpg') }}");
|
})
|
||||||
}
|
}
|
||||||
if (keys.length == 6) {
|
|
||||||
|
let keys = [];
|
||||||
|
const pattern = "71,85,89,71,85,89";
|
||||||
|
|
||||||
|
document.addEventListener("keydown", (e) => {
|
||||||
|
keys.push(e.keyCode);
|
||||||
|
if (keys.toString() === pattern) {
|
||||||
|
keys = [];
|
||||||
|
document.querySelector("#big_picture img").src = "{{ static('core/img/yug.jpg') }}";
|
||||||
|
}
|
||||||
|
if (keys.length === 6) {
|
||||||
keys.shift();
|
keys.shift();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
|
||||||
$(function () {
|
|
||||||
$("#small_pictures img").click(function () {
|
|
||||||
$("#big_picture img").attr("src", $(this)[0].src);
|
|
||||||
$("#big_picture img").attr("alt", $(this)[0].alt);
|
|
||||||
$("#big_picture img").attr("title", $(this)[0].title);
|
|
||||||
})
|
|
||||||
});
|
|
||||||
$(function () {
|
$(function () {
|
||||||
$("#drop_gifts").accordion({
|
$("#drop_gifts").accordion({
|
||||||
heightStyle: "content",
|
heightStyle: "content",
|
||||||
|
Loading…
Reference in New Issue
Block a user