Utente:Genuzzu/monobook.js: differenze tra le versioni
Vai alla navigazione
Vai alla ricerca
Contenuto aggiunto Contenuto cancellato
Genuzzu (rosica | curriculum) Nessun oggetto della modifica |
Genuzzu (rosica | curriculum) Nessun oggetto della modifica |
||
Riga 30: | Riga 30: | ||
if(wgPageName == 'Nonciclopedia:Walk_of_Shame/NonNotizie/Votazioni2012/Votazioni_Flash') $(function() { |
if(wgPageName == 'Nonciclopedia:Walk_of_Shame/NonNotizie/Votazioni2012/Votazioni_Flash') $(function() { |
||
window.voteTable = { |
window.voteTable = {length: 0}; |
||
$('.VotingTable').each(function() { |
$('.VotingTable').each(function() { |
||
voteTable[voteTable. |
voteTable[voteTable.length++] = { //quick hack: contatore direttamente nell'oggetto |
||
text: $(this).find('tbody > tr:nth(0) > td > b').html(), |
text: $(this).find('tbody > tr:nth(0) > td > b').html(), |
||
vote: (function($_this) { |
vote: (function($_this) { |
||
Riga 44: | Riga 44: | ||
} |
} |
||
}); |
}); |
||
voteTable.i--; //ok faccio schifo |
|||
voteTable = $.makeArray(voteTable); //che cazzo sto facendo??? |
voteTable = $.makeArray(voteTable); //che cazzo sto facendo??? |
||
voteTable.sort(function(a,b) {return (a.vote > b.vote) ? 1 : ((b.vote > a.vote) ? -1 : 0);} ); |
voteTable.sort(function(a,b) {return (a.vote > b.vote) ? 1 : ((b.vote > a.vote) ? -1 : 0);} ); |
Versione delle 00:24, 19 gen 2013
//YEAH
/* Trib plus */
function tribPlusInit() {
var $processingArticles = $('.LightVotingTable');
$processingArticles.each(function() {
var forDelete = $('tr:eq(4) td:eq(0) ol li', this).length;
var forRestwat = $('tr:eq(4) td:eq(1) ol li', this).length;
var forSave = $('tr:eq(6) td ol li', this).length;
var total = forDelete + forRestwat + forSave;
$('tr:eq(3) td:eq(0) span b', this).append(' <i>(' + forDelete + ')</i>');
$('tr:eq(3) td:eq(1) span b', this).append(' <i>(' + forRestwat + ')</i>');
$('tr:eq(5) td span b', this).append(' <i>(' + forSave + ')</i>');
var results = $('<div></div>');
$('tr:eq(0) td', this).append(results);
results.append('<div>Cancellazione: ' + (100 * forDelete / total) + '% (67% richiesto)</div>');
results.append('<div>Restauro: ' + (100 * forRestwat / total) + '% (50% richiesto)</div>');
});
}
if (wgPageName == 'Nonciclopedia:Tribunale') {
$(document).ready(tribPlusInit);
}
//NONCIO_TI_GIURO_SEI_IMPEDITO_v2.JS
if(wgAction == 'edit') $(function() {location.hash = 'toolbar';});
if(wgPageName == 'Nonciclopedia:Walk_of_Shame/NonNotizie/Votazioni2012/Votazioni_Flash') $(function() {
window.voteTable = {length: 0};
$('.VotingTable').each(function() {
voteTable[voteTable.length++] = { //quick hack: contatore direttamente nell'oggetto
text: $(this).find('tbody > tr:nth(0) > td > b').html(),
vote: (function($_this) {
var vote = 0;
var voteLis = $_this.find('tbody > tr:nth(3) > td > ul > li');
voteLis.each(function() {
vote += parseInt($(this).html().split('+')[1].split('-')[0]);
});
return vote / parseFloat(voteLis.length); //per farlo float uso parseFloat sul divisore
})($(this))
}
});
voteTable = $.makeArray(voteTable); //che cazzo sto facendo???
voteTable.sort(function(a,b) {return (a.vote > b.vote) ? 1 : ((b.vote > a.vote) ? -1 : 0);} );
});