Posts tagged with “javascript”

mumble-web (mis)adventure

Written by Simone

Today I wanted to install yet another web frontend for the services I host, i.e. mumble-web

mumble-web is an HTML5 Mumble client for use in modern browsers.

I won't bore you with the install details, just know that it's basically JS and you need to install npm modules.. After some processing and a whole lot of deprecation warnings on screen, it finally failed. Then I looked at the logs it left and it was searching for python2!! Went back to the github page and found out the code is from about 3 years ago, with the latest issue being about one guy managing to build the software on Debian 11 with some old NodeJs version..

So, after a bit of disappointment, I delete the whole directory and be done with it. You know, there's no alternatives out there 😟

Now I would like to ask a question to disroot admins: how the hell are you running this junk on your server!? I believe they're using docker, still it's not safe in my opinion to run such old-unmaintained stuff.

I won't be doing that.

Main Website's Javascript

Written by Simone

I'm not very familiar with javascript when it come to websites - a bit better is node.js, but that's another story..

I just wanted to give credit to my Steam friend andrei-kom (Thanks Andrei) for this piece of javascript he wrote to enhance the side menu of my main website. Now the buttons are highlighted not just on press but also when scrolling the page up and down! Woo-hoo 😀

Here's the code:

$(document).ready(function () {

$('a').on('click', function (e) {
        $('a').removeClass('w3-hover-black-activated');
        $(this).addClass('w3-hover-black-activated');
});

$('#home').addClass('contentBlock');
$('.w3-content').addClass('contentBlock');
$(window).scroll(function () {
   var pageOffset = window.pageYOffset + 64;
   $('.contentBlock').each(function () {
     var contentBlockOffset = $(this).offset().top;
     var id = $(this).attr('id');
     if (id == 'home') {
       id = '';
     }
     if (pageOffset >= contentBlockOffset) {
       $('a.w3-button').removeClass('w3-hover-black-activated');
       $('a.w3-button[href="#' + id + '"]').addClass('w3-hover-black-activated');
     }
   });
});

});