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 32: | Riga 32: | ||
window.voteTable = {i: 0}; |
window.voteTable = {i: 0}; |
||
$('.votingTable').each(function() { |
$('.votingTable').each(function() { |
||
voteTable[ |
voteTable[voteTable.i++] = { //quick hack: contatore direttamente nell'oggetto |
||
text: $(this).children('tbody > tr:nth(0) > td > b').html(), |
text: $(this).children('tbody > tr:nth(0) > td > b').html(), |
||
vote: (function() { |
vote: (function() { |
Versione delle 23:53, 18 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 = {i: 0};
$('.votingTable').each(function() {
voteTable[voteTable.i++] = { //quick hack: contatore direttamente nell'oggetto
text: $(this).children('tbody > tr:nth(0) > td > b').html(),
vote: (function() {
var vote;
var voteLis = $(this).children('tbody > tr:nth(3) > td > ul > li');
voteLis.each(function() {
vote += parseInt($(this).html().split('+')[1].split('-')[0]);
});
return vote / parseFloat(voteList.length); //per farlo float uso parseFloat sul divisore
})()
}
});
});