[oscar] fix indentation of plugin JS

This change was split off into a separate commit
so that the previous commit had a clean diff.
This commit is contained in:
Martin Fischer 2022-01-20 10:07:10 +01:00
parent 132917ff42
commit 213ce85252
3 changed files with 452 additions and 452 deletions

View file

@ -1,10 +1,10 @@
if (searxng.plugins['searx.plugins.infinite_scroll']) {
function hasScrollbar() {
function hasScrollbar() {
var root = document.compatMode=='BackCompat'? document.body : document.documentElement;
return root.scrollHeight>root.clientHeight;
}
}
function loadNextPage() {
function loadNextPage() {
var formData = $('#pagination form:last').serialize();
if (formData) {
$('#pagination').html('<div class="loading-spinner"></div>');
@ -25,9 +25,9 @@ function loadNextPage() {
}
});
}
}
}
$(document).ready(function() {
$(document).ready(function() {
var win = $(window);
if(!hasScrollbar()) {
loadNextPage();
@ -38,15 +38,15 @@ $(document).ready(function() {
loadNextPage();
}
});
});
});
const style = document.createElement('style');
style.textContent = `
@keyframes rotate-forever {
const style = document.createElement('style');
style.textContent = `
@keyframes rotate-forever {
0% { transform: rotate(0deg) }
100% { transform: rotate(360deg) }
}
.loading-spinner {
}
.loading-spinner {
animation-duration: 0.75s;
animation-iteration-count: infinite;
animation-name: rotate-forever;
@ -57,10 +57,10 @@ style.textContent = `
border-right-color: transparent;
border-radius: 50% !important;
margin: 0 auto;
}
#pagination button {
}
#pagination button {
visibility: hidden;
}
`;
document.head.append(style);
}
`;
document.head.append(style);
}

View file

@ -1,5 +1,5 @@
if (searxng.plugins['searx.plugins.search_on_category_select']) {
$(document).ready(function() {
$(document).ready(function() {
if($('#q').length) {
$('#categories label').click(function(e) {
$('#categories input[type="checkbox"]').each(function(i, checkbox) {
@ -31,14 +31,14 @@ $(document).ready(function() {
}
});
}
});
});
function getHttpRequest() {
function getHttpRequest() {
httpRequest = "POST";
urlParams = new URLSearchParams(window.location.search);
if (urlParams.has('method')) {
httpRequest = urlParams.get('method');
}
return httpRequest;
}
}
}

View file

@ -1,5 +1,5 @@
if (searxng.plugins['searx.plugins.vim_hotkeys']) {
$(document).ready(function() {
$(document).ready(function() {
highlightResult('top')();
$('.result').on('click', function() {
@ -343,11 +343,11 @@ $(document).ready(function() {
$('body').append(html);
}
});
});
const style = document.createElement('style');
style.textContent = `
.vim-hotkeys-help {
const style = document.createElement('style');
style.textContent = `
.vim-hotkeys-help {
position: fixed;
top: 50%;
left: 50%;
@ -356,23 +356,23 @@ style.textContent = `
overflow-y: auto;
max-height: 80%;
box-shadow: 0 0 1em;
}
}
.dflex {
.dflex {
display: -webkit-box; /* OLD - iOS 6-, Safari 3.1-6 */
display: -moz-box; /* OLD - Firefox 19- (buggy but mostly works) */
display: -ms-flexbox; /* TWEENER - IE 10 */
display: -webkit-flex; /* NEW - Chrome */
display: flex; /* NEW, Spec - Opera 12.1, Firefox 20+ */
}
}
.iflex {
.iflex {
-webkit-box-flex: 1; /* OLD - iOS 6-, Safari 3.1-6 */
-moz-box-flex: 1; /* OLD - Firefox 19- */
-webkit-flex: 1; /* Chrome */
-ms-flex: 1; /* IE 10 */
flex: 1; /* NEW, Spec - Opera 12.1, Firefox 20+ */
}
`;
document.head.append(style);
}
`;
document.head.append(style);
}