This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Trends buttons
#3
Hi, thanks!
As I don't need it using cloud I've solved using .lp file in the link you shared and this javascript:
Code:
  // Llistat d'usuaris que han de tenir hide
  var usuarisAmbHide = [
    'usuari',
    'visualitzacio',
    'demo'
  ];

  var xhttp = new XMLHttpRequest();

  xhttp.onreadystatechange = function () {
    if (xhttp.readyState === 4 && xhttp.status === 200) {

      var res = xhttp.responseText;
      res = res.trim();

      if (res !== undefined && res !== null) {

        // Comprovar si l'usuari està dins del llistat
        if (usuarisAmbHide.indexOf(res) !== -1) {

          document
            .querySelectorAll('.trends .btn-group, .trends .show-export')
            .forEach(function (el) {
              el.classList.add('hide');
            });

          console.log('hide aplicat a l’usuari:', res);
        }
      }
    }
  };

  xhttp.open('GET', '/user/user.lp', true);
  xhttp.send();
Reply


Messages In This Thread
Trends buttons - by jmir - 20.01.2026, 08:43
RE: Tends buttons - by admin - 20.01.2026, 09:00
RE: Tends buttons - by jmir - 20.01.2026, 09:18

Forum Jump: