Użytkownik:Vae/monobook.js: Różnice pomiędzy wersjami

Z Nonsensopedii, polskiej encyklopedii humoru
M
M
Linia 9: Linia 9:
if(odp2.childNodes[0].nodeName == '#text')
if(odp2.childNodes[0].nodeName == '#text')
{
{
odp2.removeElement(odp2.childNodes[0]);
odp2.removeChild(odp2.childNodes[0]);
odp2.appendChild(document.createTextNode(s2));
odp2.appendChild(document.createTextNode(s2));
}
}
else if(odp2.childNodes[1].nodeName == '#text')
else if(odp2.childNodes[1].nodeName == '#text')
{
{
odp2.removeElement(odp2.childNodes[1]);
odp2.removeChild(odp2.childNodes[1]);
odp2.insertBefore(document.createTextNode(s2), odp2.childNodes[0]);
odp2.insertBefore(document.createTextNode(s2), odp2.childNodes[0]);
}
}

Wersja z 21:11, 21 sty 2012

s2 = 'Jasne, kocham kucyki!';
hash = '33DE0F8E6A9247CD76EBD7D785FD0C97'

YAHOO.util.Event.onContentReady('ajax-poll-'+hash, function(){
    var ankieta = document.getElementById('ajax-poll-'+hash);
    var odp2=document.getElementById('wpPollVote'+hash+'-2').parentNode.previousSibling.childNodes[0].childNodes[0];
    odp2.addEventListener('mouseover', function(){
        var odp2 = document.getElementById('wpPollVote'+hash+'-2').parentNode.previousSibling.childNodes[0];
        if(odp2.childNodes[0].nodeName == '#text')
        {
            odp2.removeChild(odp2.childNodes[0]);
            odp2.appendChild(document.createTextNode(s2));
        }
        else if(odp2.childNodes[1].nodeName == '#text')
        {
            odp2.removeChild(odp2.childNodes[1]);
            odp2.insertBefore(document.createTextNode(s2), odp2.childNodes[0]);
        }
    });
});