mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Tidy turbo long lines for scroll-less readability
This commit is contained in:
parent
fd906d56e8
commit
eaf5ae3664
@ -114,10 +114,8 @@
|
||||
console.log("ready!");
|
||||
get_server_log();
|
||||
populateWords();
|
||||
|
||||
});
|
||||
|
||||
|
||||
function scroll() {
|
||||
var logview = $('#virt_console');
|
||||
if (logview.length)
|
||||
@ -177,30 +175,39 @@
|
||||
return;
|
||||
}
|
||||
|
||||
// Display filtered word
|
||||
words.push(word);
|
||||
$("#ignored-words").append("<li id=" + safe_word.replaceAll(" ", "-") + "><div class='card-header header-sm d-flex justify-content-between align-items-center'>" + word + " <button class='btn btn-danger' onclick='deleteItem(" + '"' + word + '"' + ")' ><i class='fas fa-trash'></i></button></div></li>")
|
||||
$("#ignored-words").append(
|
||||
`<li id=${safe_word.replaceAll(" ", "-")}>` +
|
||||
"<div class='card-header header-sm d-flex justify-content-between align-items-center'>" +
|
||||
`${word} <button class='btn btn-danger' onclick='deleteItem("${word}")' >` +
|
||||
"<i class='fas fa-trash'></i></button></div></li>"
|
||||
);
|
||||
|
||||
// Set word filters in browser cache
|
||||
localStorage.setItem("words", JSON.stringify(words))
|
||||
localStorage.setItem("words", JSON.stringify(words));
|
||||
});
|
||||
|
||||
function deleteItem(item) {
|
||||
let safe_item = sanitize(item);
|
||||
words.splice(words.indexOf(item), 1);
|
||||
if (safe_item) {
|
||||
$("#" + safe_item.replaceAll(" ", "-")).remove();
|
||||
}
|
||||
if (safe_item) $("#" + safe_item.replaceAll(" ", "-")).remove();
|
||||
|
||||
liveSearch();
|
||||
localStorage.setItem("words", JSON.stringify(words))
|
||||
localStorage.setItem("words", JSON.stringify(words));
|
||||
}
|
||||
|
||||
function populateWords() {
|
||||
for (let i = 0; i < words.length; i++) {
|
||||
let safe_word = sanitize(words[i]);
|
||||
$("#ignored-words").append("<li id=" + safe_word.replaceAll(" ", "-") + "><div class='card-header header-sm d-flex justify-content-between align-items-center'>" + words[i] + " <button class='btn btn-danger' onclick='deleteItem(" + '"' + words[i] + '"' + ")' ><i class='fas fa-trash'></i></button></div></li > ")
|
||||
|
||||
$("#ignored-words").append(
|
||||
`<li id=${safe_word.replaceAll(" ", "-")}>` +
|
||||
"<div class='card-header header-sm d-flex justify-content-between align-items-center'>" +
|
||||
`${word} <button class='btn btn-danger' onclick='deleteItem("${word}")' >` +
|
||||
"<i class='fas fa-trash'></i></button></div></li>"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
{% end %}
|
||||
|
Loading…
Reference in New Issue
Block a user