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