Open
Description
I like Heimdall but i want to like have direct access to tags if I'm in category mode. I wrote a small script, but i feel to start a discussion that it maybe make more sense to implement this into the custom app.js.
` $(document).ready(function() {
function getParameterByName(tag, url) {
if (!url) url = window.location.href;
tag = encodeURIComponent(tag).replace(/[\[\]]/g, "\$&");
var regex = new RegExp("[?&]" + tag + "(=([^&#]*)|&|#|$)"), results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
function hideShowBlocks(tag) {
$('section.item-container').hide();
$('.tag[data-tag="all"]').removeClass('current');
$('.tag.link.white[data-tag="tag-' + tag + '"]').addClass('current');
$('section.item-container.tag-' + tag).show();
}
let tag = getParameterByName('tag');
if(tag === "Home Dashboard"){
console.log("Home Dashboard new into");
tag = "0-dash";
}
if (tag) {
tag = tag.replace(/_/g, '-').toLowerCase();
setTimeout(function() { hideShowBlocks(tag); }, 200);
}
$('body').on('click', '[data-tag]', function() {
const tagText = $(this).text().trim();
const newUrl = window.location.origin + window.location.pathname + '?tag=' + encodeURIComponent(tagText);
history.pushState(null, '', newUrl);
});
});`
Short explanation:
If you click on a category in header, you get the URL like ?tag=cat1 . Now you can choose exactly this URL and you get this page with this category directly. I like it very much. But it's more a hack.
Maybe you are interested in this.
Metadata
Assignees
Type
Projects
Status
Non-Docker Issues
Activity