Add support for deprecated plugin tag

This commit is contained in:
JannisX11 2022-02-10 19:21:50 +01:00
parent f80f95edce
commit c6c596bed9
2 changed files with 12 additions and 4 deletions

View File

@ -999,6 +999,7 @@
height: 48px;
}
#plugin_list > li .title i {
width: 22px;
font-size: 0.9em;
padding: 3px;
float: left;
@ -1065,6 +1066,10 @@
background-color: #73e473;
color: #111625;
}
.plugin_tag_list li.plugin_tag_deprecated {
background-color: #ff3467;
color: #000000;
}
.no_plugin_message {
text-align: center;
margin-top: 30px;

View File

@ -18,7 +18,9 @@ const Plugins = {
console.log('Reloaded '+reloads+ ' plugin'+pluralS(reloads))
},
sort() {
Plugins.all.sort(function(a,b) {
Plugins.all.sort((a, b) => {
if (a.tags.find(tag => tag.match(/deprecated/i))) return 1;
if (b.tags.find(tag => tag.match(/deprecated/i))) return -1;
let download_difference = (Plugins.download_stats[b.id] || 0) - (Plugins.download_stats[a.id] || 0);
if (download_difference) {
return download_difference
@ -542,11 +544,12 @@ BARS.defineActions(function() {
},
methods: {
getTagClass(tag) {
let lowercase = tag.toLowerCase();
if (lowercase == 'local' || lowercase == 'remote') {
if (tag.match(/^(local|remote)$/i)) {
return 'plugin_tag_source'
} else if (lowercase.substr(0, 9) == 'minecraft') {
} else if (tag.match(/^minecraft/i)) {
return 'plugin_tag_mc'
} else if (tag.match(/^deprecated/i)) {
return 'plugin_tag_deprecated'
}
},
getIconNode: Blockbench.getIconNode,