Commit 7e58cdfc authored by Alexandre Bailly's avatar Alexandre Bailly

Removal of the dead code and change on an untranslated comment.

parent 4ea879ef
Pipeline #8346 passed with stage
in 28 seconds
......@@ -8,7 +8,6 @@ let showR18 = (window.location.toString().indexOf('r18') >= 0);
if (!(HTMLCollection.prototype[Symbol.iterator])) HTMLCollection.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator];
addEventListener("load", setup);
//addEventListener("pageshow", search);
function setup() {
// get list of series elements and set their id
......@@ -16,17 +15,8 @@ function setup() {
for (let series of list)
series.id = series.childNodes[0].nodeValue.normalize("NFKD").replace(/[\u0300-\u036f]/g, "");
// set search box toggle RegEx event
//document.getElementById("searchbox").addEventListener("keydown", toggleRegEx);
document.getElementById("searchbox").addEventListener("keydown", timerSearchBox);
// set search box search event
//document.getElementById("searchbox").addEventListener("keyup", search);
// get search string from url
/*
if (location.search.indexOf("=") > -1)
document.getElementById("searchbox").value = decodeURIComponent(location.search.substring(location.search.indexOf("=")+1));
*/
// add onclick(addVideoToPlaylist) to fa-plus elements
const addVideoButtons = document.getElementsByClassName("fa-plus");
for (let addVideoButton of addVideoButtons) {
......@@ -66,60 +56,13 @@ function setup() {
document.getElementById("searchbox").value = val; //set that value back.
}
/*
function toggleRegEx(event) {
if (event.keyCode == 9) {
RegExEnabled = !RegExEnabled;
document.getElementById("regex").children[0].innerHTML = "(press tab while typing to " + (RegExEnabled ? "disable" : "enable") + " RegEx in search)";
if (event.preventDefault) event.preventDefault();
return false;
}
}
*/
/*
function search() {
let sVal = document.getElementById("searchbox").value.trim();
const query = (sVal == "" ? location.pathname + (showR18 ? "?r18" : ""): (showR18 ? "?r18&" : "?") + "s=" + sVal);
sVal = sVal.normalize("NFKD").replace(/[\u0300-\u036f]/g, "");
document.getElementById("searchURL").href = query;
history.replaceState("list", document.title, query);
let UseRegEx = RegExEnabled, toFind;
if (UseRegEx) {
try { toFind = new RegExp(sVal, "i");
} catch (e) { UseRegEx = false; }
}
if (!UseRegEx)
toFind = new RegExp("^(?=.*" + sVal.split(" ").map(str => str.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&")).join(")(?=.*") + ").*$", "i");
let anyResults = false;
for (let series of list) {
if (toFind.test(series.id)) {
series.removeAttribute("hidden");
anyResults = true;
} else series.setAttribute("hidden", "");
}
if (anyResults) document.getElementById("NoResultsMessage").setAttribute("hidden","");
else document.getElementById("NoResultsMessage").removeAttribute("hidden");
}
*/
let timerVar;
/**
* Timer sur champ de saisie.
* Si aucune saisie pendant 3 secondes, on valide le formulaire.
*/
// if no entry is made in the search box for 3 seconds, we submit it.
function timerSearchBox() {
clearTimeout(timerVar);
timerVar = setTimeout(function() { document.forms["fmSearch"].submit(); } , 3000);
}
function playlistAdd() {
let video;
if(window.config.USE_UID_AS_IDENTIFIER)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment