JVCare Transform

JVCare Transform nodes list

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greasyfork.org/scripts/572639/1791073/JVCare%20Transform.js

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)




/* 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;
    }
}
*/