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

Z Nonsensopedii, polskiej encyklopedii humoru
M
M
Linia 1: Linia 1:
s2 = 'Jasne, kocham kucyki!';
s2 = 'No chyba was pogrzało!';
hash = '33DE0F8E6A9247CD76EBD7D785FD0C97'
hash = '33DE0F8E6A9247CD76EBD7D785FD0C97'


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

Wersja z 21:12, 21 sty 2012

s2 = 'No chyba was pogrzało!';
hash = '33DE0F8E6A9247CD76EBD7D785FD0C97'

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