Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
2.5 kB
1
Indexable
Never
javascript: (() => {
    let divs = ['editable-1', 'editable-2', 'editable-2174', 'editable-2175', 'editable-118', 'editable-82', 'editable-28', 'editable-2150', 'editable-2004'];

    let matches = ['these', 'they', 'the', 'she', 'her', 'his', 'he', 'it'];
    let selectedText = '';

    if(window.getSelection !== null && window.getSelection().type === 'Range'){
        selectedText = window.getSelection().toString();
    }

    divs.forEach((element) => document.getElementById(element.toString()).style.display = 'none');
    
    document.querySelector('.ewok-rater-header').style.cssText = `position: sticky; top: 0`; 
    document.querySelector('.container').style.position ='static';
    
    document.querySelector('#editable-56_sentence_html1').querySelectorAll('p, li').forEach((m) => {
        let innerText = m.innerText.toString().replace(/'/g, '');
        if(selectedText !== ''){
            let tokenized = innerText.toLowerCase().split(' ');
            matches.forEach((item) => {
                if(tokenized.includes(item.toString().toLowerCase())){
                    let re = new RegExp(`${item.toString()}`, 'i');
                    innerText = innerText.replace(re, selectedText);
                }
            });
        }
        m.innerHTML =`<a href='https://www.google.com/search?q=${encodeURIComponent(innerText)}' target='_blank'>${innerText}</a>`;
    });
    
    let nodes = [...document.querySelectorAll('.ewok-editor-editable-columngroup input')];
    nodes[0].click();
    nodes[3].click();
    nodes[5].click();
    nodes[6].click();

    let disclaimers = ['This is for informational purposes only', 
    'This information does not constitute medical advice or diagnosis', 
    'Your medical provider can give guidance on what is best for your situation', 
    'You can consult a licensed therapist for advice', 
    'A medical professional is best able to provide information about your particular circumstances',
    'This is for informational purposes and is not intended as financial advice',
    'Consulting a financial advisor about your particular circumstances is best',
    'A medical expert, like a doctor, is best able to help you find the information and care you need.',
    'If you need immediate assistance, please call emergency services.'];

    if(disclaimers.some(ts => document.querySelector('#editable-57_sentence_html1')?.innerText.includes(ts))) {
        nodes[12].click();
    } else {
        nodes[11].click();
    }

})();
Leave a Comment