JVCare Transform

JVCare Transform nodes list

Ten skrypt nie powinien być instalowany bezpośrednio. Jest to biblioteka dla innych skyptów do włączenia dyrektywą meta // @require https://update.greasyfork.org/scripts/572639/1791073/JVCare%20Transform.js

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)




/* TEST INJECT

document.body.insertAdjacentHTML("beforeend", `
    <button
      class="JvCare 45CBCBC0C22D1F1FCCCCCC194D43C3C5C4464B434F19424F4E1F simpleButton stretched-link"
      data-foo="bar"
      tabindex="0"
      title="Profil"
      style="position:fixed;bottom:24px;right:24px;z-index:99999;padding:10px 20px;cursor:pointer;">
      <span>Mon profil</span>
    </button>
`);

*/

function jvCake(cls) {
    let base16 = '0A12B34C56D78E9F', lien = '', s = cls.split(' ')[1];
    for (let i = 0; i < s.length; i += 2) {
        lien += String.fromCharCode(base16.indexOf(s.charAt(i)) * 16 + base16.indexOf(s.charAt(i + 1)));
    }
    return lien;
}


function fixMessage(nodes) {
    for (const spanJvcare of nodes.querySelectorAll(".JvCare")) {
        const a = document.createElement("a");
        for (const attr of spanJvcare.attributes) {
            a.setAttribute(attr.name, attr.value);
        }
        a.setAttribute("href", jvCake(spanJvcare.className));
        a.className = "xXx " + spanJvcare.className.split(" ").slice(2).join(" ");
        a.append(...spanJvcare.childNodes);
        spanJvcare.replaceWith(a);
    }
}

//fixMessage(document.body);




/* VERSION outerHTML - fallback si replaceWith pose souci
function fixMessage(nodes) {
    for (const spanJvcare of nodes.querySelectorAll(".JvCare")) {
        const a = document.createElement("a");
        for (const attr of spanJvcare.attributes) {
            a.setAttribute(attr.name, attr.value);
        }
        a.setAttribute("href", jvCake(spanJvcare.className));
        a.className = "xXx " + spanJvcare.className.split(" ").slice(2).join(" ");
        a.innerHTML = spanJvcare.innerHTML;
        spanJvcare.outerHTML = a.outerHTML;
    }
}
*/