add checkmark to max per page

This commit is contained in:
Squidly271 2022-02-26 13:10:14 -05:00
parent e2d591ec0d
commit eb5ea2830a
4 changed files with 24 additions and 13 deletions

View File

@ -171,6 +171,7 @@ var resizeTimer;
var portsInUse = [];
var startupSearch = "<?=$_GET['search']?>";
$(function(){
window.onerror = function(msg,url,lineNo,columnNo, error) {
post({action:'javascriptError',msg:msg,url:url,lineNo:lineNo,columnNo:columnNo,error:error});
@ -236,12 +237,8 @@ $(function(){
context.init({preventDoubleContext:false,left:false,right:false,bottom:true,above:true});
$(".maxPerPage").html(sprintf("<?tr("Results Per Page: %s")?>","<?=$cfg['maxPerPage']?>"));
var opts = [
{text:sprintf("<?tr("%s Results Per Page")?>",24),action:function(){ changeMax(24);}},
{text:sprintf("<?tr("%s Results Per Page")?>",48),action:function(){ changeMax(48);}},
{text:sprintf("<?tr("%s Results Per Page")?>",96),action:function(){ changeMax(96);}}
];
context.attach("#maxPerPage",opts);
context.attach("#maxPerPage",getPerPageOpts(<?=$cfg['maxPerPage']?>));
$(".sidebarClose").on("click",function(e) {
closeSidebar();
@ -1871,11 +1868,6 @@ function postNoSpin(options,callback) {
if ( typeof options === "function" ) {
callback = options;
} else {
<? if ( $cfg['debugging'] == "yes" ):?>
var msg = "No Spin Post: ";
console.log(msg+JSON.stringify(options));
<?endif;?>
}
if ( typeof callback === "function" ) {
$.post(URL,options,function(retval){
@ -2624,6 +2616,8 @@ function dockerConvert(dockerID) {
function changeMax(max) {
$("#maxPerPage").html(sprintf("<?tr("Results Per Page: %s")?>",max));
context.destroy("#maxPerPage");
context.attach("#maxPerPage",getPerPageOpts(max));
post({action:"changeMaxPerPage",max:max},function(done) {
if (done.status == "updated") {
if ( ! $(".startupButton").hasClass("selectedMenu") ) {
@ -2633,6 +2627,20 @@ function changeMax(max) {
}
});
}
function getPerPageOpts(value) {
var perPage = [24,48,96];
var maxPerPageOpts = [];
perPage.forEach(function(entry) {
if ( entry != value ) {
maxPerPageOpts.push({icon:" ",text:sprintf("<?tr("%s Results Per Page")?>",entry),action:function(){ changeMax(entry);}});
} else {
maxPerPageOpts.push({icon:"ca_fa-checkmark",text:"<span class='ca_green'>"+sprintf("<?tr("%s Results Per Page")?>",entry)+"</span>",action:function(){ changeMax(entry);}});
}
});
return maxPerPageOpts;
}
</script>
<?include "/usr/local/emhttp/plugins/$plugin/skins/Narrow/skin.html"?>

View File

@ -1,4 +1,4 @@
3a0bdd2a05376c6501f48b28afcaee85 ./Apps.page
37e661a0dba61f17b1a498cccb779f13 ./Apps.page
4e55f7483b661af21a25b677179baffe ./CA_notices.page
42a1658a916a3a3eed2a9f2af80603c4 ./ca_settings.page
e718d7825dbdc96a17a915079222b098 ./default.cfg
@ -18,6 +18,6 @@ a1401a0bed89c182b69f0c7508282c1f ./scripts/pluginInstall.php
e19c8f05c687dcf03ea0ba2ed7099a6e ./scripts/showStatistics.php
4425f8fd4ef662a7dc65cee01de3e419 ./scripts/updatePLG.sh
34554a56611dfe625889c82afd5138de ./scripts/updatePluginSupport.php
67a365609d47d6c0e41cf30b401b3f77 ./skins/Narrow/css.php
2da35d3042b93459f171595811d534b3 ./skins/Narrow/css.php
e9244df3418ca3e7fa206d9b6e94c6b1 ./skins/Narrow/skin.html
7cbc48b9a57f4bf7bf15690f8f1cf6ce ./skins/Narrow/skin.php

View File

@ -170,6 +170,8 @@ a.ca_categories{text-decoration:none;color:inherit;}
img.ca_displayIcon{height:8rem;width:8rem;}
.ca_fa-additional::before{content:"\f055";font-family:fontAwesome;}
.ca_fa-asterisk::before{content:"\f069";font-family:fontAwesome;}
.ca_fa-checkmark{color:#038503;}
.ca_fa-checkmark::before{content:"\f00c";font-family:fontAwesome;}
.ca_fa-comment::before{content:"\f075";font-family:fontAwesome;}
.ca_fa-delete{color:#882626;}
.ca_fa-delete::before{content:"\f00d";font-family:fontAwesome;}
@ -194,6 +196,7 @@ a.ca_fa-delete{text-decoration:none;margin-left:1rem;font-size:2rem;margin-top:-
.ca_favouriteRepo{margin-right:1rem;margin-bottom:1rem;font-size:1.5rem;line-height:2rem;cursor:pointer;display:inline-block;color:<?=$supportPopupText?>!important;background: -webkit-linear-gradient(top, transparent 0%, rgba(0,0,0,0.4) 100%),-webkit-linear-gradient(left, lighten(<?=$donateBackground?>, 15%) 0%, <?=$donateBackground?> 50%, lighten(<?=$donateBackground?>, 15%) 100%); background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.4) 100%),linear-gradient(to right, lighten(#E68321, 15%) 0%, #E68321 50%, lighten(#E68321, 15%) 100%); background-position: 0 0; background-size: 100% 100%; border-radius: 15px; color: #fff; padding: 1px 10px 1px 10px;}
.ca_favouriteRepo:hover{text-decoration:none;background-color:<?=$unRaid66color?>;}
.ca_forum::before{content:"\f1cd";font-family:fontAwesome;}
.ca_green{color:#038503;}
.ca_holder{background-color:<?=$templateBackground?>;display:inline-block;float:left;height:20rem;min-width:24rem;max-width:24rem;overflow:hidden;padding:20px;margin-top:0px;margin-bottom:1rem;margin-right:1rem;border:1px solid;border-color:<?=$borderColor?>;cursor:pointer;}
.ca_holder:hover{background-color:<?=$templateHoverBackground?>;}
.dockerHubHolder {background-color:<?=$templateBackground?>;display:inline-block;float:left;height:20rem;min-width:24rem;max-width:24rem;overflow:hidden;padding:20px;margin-top:0px;margin-bottom:1rem;margin-right:1rem;border:1px solid;border-color:<?=$borderColor?>;cursor:pointer;}