adding csp

This commit is contained in:
2021-04-30 19:37:56 +01:00
parent 5eecbf1075
commit d21ec61f06
10 changed files with 71 additions and 67 deletions

View File

@@ -1,46 +1,14 @@
/*.navbar {*/
/* margin: 0px;*/
/*}*/
/*.starter-template {*/
/* padding: 40px 15px;*/
/* text-align: center;*/
/*}*/
/*!* Sticky footer styles*/
/*-------------------------------------------------- *!*/
/*html {*/
/* position: relative;*/
/* min-height: 100%;*/
/*}*/
/*body {*/
/* !* Margin bottom by footer height *!*/
/* margin-bottom: 80px;*/
/*}*/
/*.footer {*/
/* position: absolute;*/
/* bottom: 0;*/
/* width: 100%;*/
/* !* Set the fixed height of the footer here *!*/
/* height: 80px;*/
/* background-color: #f5f5f5;*/
/*}*/
/*.comic_box {*/
/* width: 100%;*/
/*}*/
/*#dropdown-list{*/
/* max-height: 300px;*/
/* overflow: auto;*/
/* box-shadow: none;*/
/* }*/
/* td a {*/
/* display:block;*/
/* width:100%;*/
/* }*/
/* tr.clickable-row {*/
/* cursor: pointer;*/
/* }*/
#comic_list caption {
caption-side: top;
}
.card_list_card {
width: 200px;
}
.card .card-badge {
position:absolute;
top:10px;
left:10px;
padding:5px;
color:white;
}

1
static/css/base.min.css vendored Normal file
View File

@@ -0,0 +1 @@
#comic_list caption{caption-side:top}.card_list_card{width:200px}.card .card-badge{position:absolute;top:10px;left:10px;padding:5px;color:#fff}

BIN
static/img/ccbysa.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -11,9 +11,13 @@ var buttonFilter;
}
});
$('#filters').on( 'click', 'button', function() {
buttonFilter = $( this ).attr('data-filter');
sessionStorage.setItem(window.location.href+"button", buttonFilter);
$grid.isotope();
if (typeof $( this ).attr('data-filter') === "undefined") {
}else {
buttonFilter = $( this ).attr('data-filter');
sessionStorage.setItem(window.location.href+"button", buttonFilter);
$grid.isotope();
}
});
var $quicksearch = $('#quicksearch').keyup( debounce( function() {
@@ -65,3 +69,18 @@ function comic_action(selector, item_type, action) {
})
}
$( ".progress-bar" ).each(function( index ) {
let bar = $(this)
bar.css('width', bar.attr('aria-valuenow') + '%')
});
let comic_action_elements = document.getElementsByClassName('comic_action')
comic_action_elements.forEach(el => el.addEventListener('click', event => {
let target = $(event.target).closest('button')
let selector = target.attr('selector')
let item_type = target.attr('itemtype')
let action = target.attr('comic_action')
comic_action(selector, item_type, action)
}));

View File

@@ -1 +1 @@
var qsRegex;var buttonFilter;var $grid=$(".comic-container").isotope({itemSelector:".grid-item",layoutMode:"fitRows",filter:function(){var $this=$(this);var searchResult=qsRegex?$this.text().match(qsRegex):true;var buttonResult=buttonFilter?$this.is(buttonFilter):true;return searchResult&&buttonResult}});$("#filters").on("click","button",function(){buttonFilter=$(this).attr("data-filter");sessionStorage.setItem(window.location.href+"button",buttonFilter);$grid.isotope()});var $quicksearch=$("#quicksearch").keyup(debounce(function(){qsRegex=new RegExp($quicksearch.val(),"gi");sessionStorage.setItem(window.location.href+"text",$quicksearch.val());$grid.isotope()}));function debounce(fn,threshold){var timeout;threshold=threshold||100;return function debounced(){clearTimeout(timeout);var args=arguments;var _this=this;function delayed(){fn.apply(_this,args)}timeout=setTimeout(delayed,threshold)}}setInterval(function(){$grid.isotope()},1e3);let field=document.getElementById("quicksearch");if(sessionStorage.getItem(window.location.href+"text")||sessionStorage.getItem(window.location.href+"button")){field.value=sessionStorage.getItem(window.location.href+"text");qsRegex=new RegExp($quicksearch.val(),"gi");buttonFilter=sessionStorage.getItem(window.location.href+"button");$grid.isotope()}field.addEventListener("change",function(){});function comic_action(selector,item_type,action){$.ajax({url:"/comic/action/"+action+"/"+item_type+"/"+selector+"/",success:function(){window.location.reload()}})}
var qsRegex;var buttonFilter;var $grid=$(".comic-container").isotope({itemSelector:".grid-item",layoutMode:"fitRows",filter:function(){var $this=$(this);var searchResult=qsRegex?$this.text().match(qsRegex):true;var buttonResult=buttonFilter?$this.is(buttonFilter):true;return searchResult&&buttonResult}});$("#filters").on("click","button",function(){if(typeof $(this).attr("data-filter")==="undefined"){}else{buttonFilter=$(this).attr("data-filter");sessionStorage.setItem(window.location.href+"button",buttonFilter);$grid.isotope()}});var $quicksearch=$("#quicksearch").keyup(debounce(function(){qsRegex=new RegExp($quicksearch.val(),"gi");sessionStorage.setItem(window.location.href+"text",$quicksearch.val());$grid.isotope()}));function debounce(fn,threshold){var timeout;threshold=threshold||100;return function debounced(){clearTimeout(timeout);var args=arguments;var _this=this;function delayed(){fn.apply(_this,args)}timeout=setTimeout(delayed,threshold)}}setInterval(function(){$grid.isotope()},1e3);let field=document.getElementById("quicksearch");if(sessionStorage.getItem(window.location.href+"text")||sessionStorage.getItem(window.location.href+"button")){field.value=sessionStorage.getItem(window.location.href+"text");qsRegex=new RegExp($quicksearch.val(),"gi");buttonFilter=sessionStorage.getItem(window.location.href+"button");$grid.isotope()}field.addEventListener("change",function(){});function comic_action(selector,item_type,action){$.ajax({url:"/comic/action/"+action+"/"+item_type+"/"+selector+"/",success:function(){window.location.reload()}})}$(".progress-bar").each(function(index){let bar=$(this);bar.css("width",bar.attr("aria-valuenow")+"%")});let comic_action_elements=document.getElementsByClassName("comic_action");comic_action_elements.forEach(el=>el.addEventListener("click",event=>{let target=$(event.target).closest("button");let selector=target.attr("selector");let item_type=target.attr("itemtype");let action=target.attr("comic_action");comic_action(selector,item_type,action)}));