Commit 97b42396 authored by echel0n's avatar echel0n

Misc code corrections and cleanups

parent e1ea56c4
......@@ -14,7 +14,7 @@
},
"parser": "babel-eslint",
"plugins": [],
//"extends": "eslint:recommended",
"extends": "eslint:recommended",
"rules": {
//
}
......
......@@ -34,12 +34,12 @@
<div class="row">
<div class="col-md-12 mt-1">
<div id="rootDirsControls" class="rootdir-controls">
<input class="sickrage-btn m-1" type="button" id="addRootDir" value="${_('New')}"/>
<input class="sickrage-btn m-1" type="button" id="editRootDir" value="${_('Edit')}"/>
<input class="sickrage-btn m-1" type="button" id="deleteRootDir" value="${_('Delete')}"/>
<input class="sickrage-btn m-1" type="button" id="defaultRootDir" value="${_('Set as Default *')}"/>
<input class="btn btn-primary btn-sm m-1" type="button" id="addRootDir" value="${_('New')}"/>
<input class="btn btn-primary btn-sm m-1" type="button" id="editRootDir" value="${_('Edit')}"/>
<input class="btn btn-primary btn-sm m-1" type="button" id="deleteRootDir" value="${_('Delete')}"/>
<input class="btn btn-primary btn-sm m-1" type="button" id="defaultRootDir" value="${_('Set as Default *')}"/>
</div>
<input type="text" style="display: none" id="rootDirText" autocapitalize="off" title=""/>
<input type="text" class="d-none" id="rootDirText" autocapitalize="off" title=""/>
</div>
</div>
......@@ -250,7 +250,7 @@
<span class="d-sm-none d-md-block">
<img class="rounded-circle shadow" style="width: 40px;height: 40px;"
src="https://gravatar.com/avatar/${md5(current_user['email']).hexdigest()}?&d=404">
${toolsBadge}
${toolsBadge}
</span>
</a>
......@@ -347,7 +347,7 @@
</div>
<div class="container-fluid">
<%block name="content" />
<%block name="content" />
</div>
<div class="container-fluid">
......@@ -410,5 +410,11 @@
<div id="mainModal"></div>
${mainModals()}
</div>
<a id="back-to-top" href="#" class="btn btn-primary back-to-top" role="button"
title="Click to return on the top page" data-toggle="tooltip" data-placement="left">
<span class="fas fa-chevron-up"></span>
</a>
</body>
</html>
......@@ -25,9 +25,7 @@
<div class="card-body">
<form action="massEditSubmit" method="post">
<input type="hidden" name="toEdit" value="${showList}"/>
<p>
<u>
${_('Changing any settings marked with')}
......@@ -61,7 +59,7 @@
<tbody>
% for cur_dir in root_dir_list:
<% cur_index = root_dir_list.index(cur_dir) %>
<tr class="listing-default">
<tr>
<td align="center">
${cur_dir}
</td>
......@@ -69,12 +67,12 @@
${cur_dir}
</td>
<td>
<a href="#" class="sickrage-btn edit_root_dir"
<a href="#" class="btn btn-primary btn-sm edit_root_dir"
class="edit_root_dir"
id="edit_root_dir_${cur_index}">
${_('Edit')}
</a>
<a href="#" class="sickrage-btn delete_root_dir"
<a href="#" class="btn btn-primary btn-sm delete_root_dir"
class="delete_root_dir"
id="delete_root_dir_${cur_index}">
${_('Delete')}
......
......@@ -12,7 +12,6 @@ import 'pnotify/dist/es/PNotifyButtons';
import 'pnotify/dist/es/PNotifyDesktop';
import {gettext, addLocale, useLocale} from 'ttag';
import {po} from 'gettext-parser'
import scrollUp from 'scrollup';
import jconfirm from 'jquery-confirm';
import PNotify from 'pnotify/dist/es/PNotify';
import jQueryBridget from 'jquery-bridget';
......@@ -157,18 +156,27 @@ $(document).ready(function ($) {
}
});
$(window).scroll(function () {
if ($(this).scrollTop() > 50) {
$('#back-to-top').fadeIn();
} else {
$('#back-to-top').fadeOut();
}
});
// scroll body to 0px on click
$('#back-to-top').click(function () {
$('#back-to-top').tooltip('hide');
$('body,html').animate({
scrollTop: 0
}, 800);
return false;
});
// tooltips
$('[title!=""]').tooltipster();
// init scrollUp
scrollUp({
animation: 'fade',
scrollImg: {
active: true,
type: 'background',
src: SICKRAGE.srWebRoot + '/images/top.png'
}
});
var imgDefer = document.getElementsByTagName('img');
for (var i = 0; i < imgDefer.length; i++) {
......@@ -1261,7 +1269,6 @@ $(document).ready(function ($) {
$('.show-grid').isotope({
filter: function () {
var name = $('.show-container', this).data('name').trim().toLowerCase();
console.log(name);
return name.indexOf($('#filterShowName').val().toLowerCase()) > -1;
}
});
......@@ -1874,16 +1881,14 @@ $(document).ready(function ($) {
$('#showsortdirection').val('asc');
function resizePosters(newSize) {
var fontSize, spriteScale, borderRadius;
var fontSize, borderRadius;
if (newSize < 125) { // small
borderRadius = 3;
} else if (newSize < 175) { // medium
fontSize = 9;
spriteScale = .6;
borderRadius = 4;
} else { // large
fontSize = 11;
spriteScale = 1;
borderRadius = 6;
}
......@@ -1980,16 +1985,14 @@ $(document).ready(function ($) {
popular_shows: function () {
function resizePosters(newSize) {
var fontSize, spriteScale, borderRadius;
var fontSize, borderRadius;
if (newSize < 125) { // small
borderRadius = 3;
} else if (newSize < 175) { // medium
fontSize = 9;
spriteScale = .6;
borderRadius = 4;
} else { // large
fontSize = 11;
spriteScale = 1;
borderRadius = 6;
}
......@@ -2121,26 +2124,23 @@ $(document).ready(function ($) {
init: function () {
var navListItems = $('div.setup-panel div a'),
allWells = $('.setup-content'),
allNextBtn = $('.nextBtn'),
step1 = $('.setup-content #step-1'),
step2 = $('.setup-content #step-2'),
step3 = $('.setup-content #step-3');
allNextBtn = $('.nextBtn');
allWells.hide();
if ($('input:hidden[name=whichSeries]').length && $('#fullShowPath').length) {
step1.hide();
step2.show();
$('.setup-content #step-1').hide();
$('.setup-content #step-2').show();
}
$('#searchName').click(function() {
$('#searchName').click(function () {
if ($('#addShowForm')[0].checkValidity() === true) {
$('#addShowForm')[0].classList.add('was-validated');
$(".nextBtn").removeClass('disabled');
}
});
$('#addShowForm').submit(function() {
$('#addShowForm').submit(function () {
SICKRAGE.home.generate_bwlist();
})
......
......@@ -224,6 +224,14 @@ span.snatched b {
width: 1%;
}
.back-to-top {
cursor: pointer;
position: fixed;
bottom: 20px;
right: 20px;
display:none;
}
// Stepper
.sickrage-stepper {
.stepwizard-step p {
......
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