From 37f1e132127dd959467f44d450788baf7ddd913b Mon Sep 17 00:00:00 2001
From: Elke Kreim <elke.kreim@hs-hannover.de>
Date: Thu, 22 Dec 2022 11:36:02 +0100
Subject: [PATCH] Remove javascript file
---
javascript/listselect.js | 79 ----------------------------------------
1 file changed, 79 deletions(-)
delete mode 100644 javascript/listselect.js
diff --git a/javascript/listselect.js b/javascript/listselect.js
deleted file mode 100644
index cb0b737..0000000
--- a/javascript/listselect.js
+++ /dev/null
@@ -1,79 +0,0 @@
-/*(function($) {
- function changeActionString(current) {
- var actionString = getRootWebSitePath() + '/course/view.php?id=' + current.val();
- $('#hshcourseform').attr('action', actionString);
- }
-
- function setInactive(target) {
- target.removeClass('active');
- target.removeClass('activeCourseSearch');
- }
-
- function setActive(target) {
- target.addClass('active');
- target.addClass('activeCourseSearch');
- }
-
- function getRootWebSitePath() {
- var _location = document.location.toString();
- var applicationNameIndex = _location.indexOf('/', _location.indexOf('://') + 3);
- var applicationName = _location.substring(0, applicationNameIndex) + '/';
- var webFolderIndex = _location.indexOf('/', _location.indexOf(applicationName) + applicationName.length);
- return _location.substring(0, webFolderIndex);
- }
-
- function scrollIntoViewIfNeeded(element) {
- var windowSize = window.innerHeight;
- var elementPosition = element.getBoundingClientRect();
- var elementBottom = elementPosition.bottom;
- var elementTop = elementPosition.top;
-
- if (elementBottom > windowSize) {
- // Scroll an den unteren Rand des Bildes
- element.scrollIntoView({block: "end", behavior: "smooth"});
- }
- if (elementTop < 0) {
- // Scroll an den oberen Rand des Bildes
- element.scrollIntoView({block: "start", behavior: "smooth"});
- }
- }
-
- $('input').keydown(function(e) {
- var $listItems = $('.hshcoursesearchlistitem');
- var key = e.keyCode;
- var $selected = $listItems.filter('.activeCourseSearch');
- var $current;
-
- if (key !== 40 && key !== 38 && key !== 13) {
- return;
- }
-
- setInactive($listItems);
-
- if (key === 38) { // KEY UP
- if (!$selected.length || $selected.is(':first-child')) {
- $current = $listItems.last();
- } else {
- $current = $selected.prev();
- }
- changeActionString($current);
- } else if (key === 40) { // KEY DOWN
- if (!$selected.length || $selected.is(':last-child')) {
- $current = $listItems.eq(0);
- } else {
- $current = $selected.next();
- }
- changeActionString($current);
- } else if (key === 13) { // KEY ENTER
- $current = $selected;
- if (isNaN($current.val())) {
- $current = $listItems.eq(0);
- }
- changeActionString($current);
- }
-
- setActive($current);
- scrollIntoViewIfNeeded($current[0]);
- });
-}(jQuery));
-*/
\ No newline at end of file
--
GitLab