User:KurwaAntics/sandbox

undefined

/* ********** Edit summary warning ********** */ $('#wpSave').click(function {   if (wgNamespaceNumber === 0 && !$('#wpSummary').val) {        $.showCustomModal('Edit summary', 'You left the edit summary blank. Please help other contributors pick up where you left off by writing edit summaries. Thank you.', { id: 'edit-summary-error', width: 400, buttons: [{ message: 'OK', defaultButton: true, handler: function { $('#edit-summary-error').closeModal; }           }]        });        return false;    } });

/* ********** Notimodule ********** */ var notimoduleTitle = window.notimoduleTitle || 'Notifications'; var notimodulePagename = window.notimodulePagename || 'Template:Notimodule';

$('#WikiaRail').prepend(' '+ notimoduleTitle +' ');

if ( wgUserGroups.indexOf("sysop") >= 0 ) { $('#notimodule h2').append(''); }

$('#notimodule > div').load('/wiki/'+ notimodulePagename +'?action=render');

/* ********** Live subscriber count ********** */ $('.LiveSubsCount').each(function {   var lsc = $(this).data('name');    $('#WikiaRail').prepend(' ').show;    $(this).remove; });

/* ********** Second rail ********** */ var hpwrail = window.hpwrail || 'Template:Hpwrail';

$('#WikiaRailWrapper').append(' ') .prepend('Main rail | Custom rail ');

$('#HPWrail').load('/wiki/'+ hpwrail +'?action=render');

if ( wgUserGroups.indexOf("sysop") >= 0 ) { $('#WikiaRailWrapper aside').append(''); }

$('.toggle-hpw').click(function{   if (!$(this).hasClass('active')) {        $('#WikiaRail').toggle;        $('#HPWrail').toggle;        $('#edit-rail').toggle;        $('.toggle-hpw.active').removeClass('active');        $(this).addClass('active');    } });

/* ********** Live subscriber count ********** */ $('.LiveSubsCount').each(function {   var lsc = $(this).data('name');    $('#WikiaRail').prepend(' ').show;    $(this).remove; });

$("#HPWrail").ready(function {   // call the function after the element has been loaded here    console.log("HPWrail loaded!"); });

/* ********** Average rating score ********** */ $(document).ready(function { $('.rate-poll').each(function{ var weight = 5 * parseInt( $('.pollAnswer:nth-child(1) span').text ) + 4 * parseInt( $('.pollAnswer:nth-child(2) span').text ) + 3 * parseInt( $('.pollAnswer:nth-child(3) span').text ) + 2 * parseInt( $('.pollAnswer:nth-child(4) span').text ) + parseInt( $('.pollAnswer:nth-child(5) span').text ); var total = parseInt( $('.pollAnswer:nth-child(1) span').text ) + parseInt( $('.pollAnswer:nth-child(2) span').text ) + parseInt( $('.pollAnswer:nth-child(3) span').text ) + parseInt( $('.pollAnswer:nth-child(4) span').text ) + parseInt( $('.pollAnswer:nth-child(5) span').text ); if (total !== 0) { var average = ( weight / total ).toFixed(2); $('Average: ' + average + ' ').insertAfter('#ajax-poll-area'); } }); }); Something

undefined

/* ********** Edit summary warning ********** */ $('#wpSave').click(function {   if (wgNamespaceNumber === 0 && !$('#wpSummary').val) {        $.showCustomModal('Edit summary', 'You left the edit summary blank. Please help other contributors pick up where you left off by writing edit summaries. Thank you.', { id: 'edit-summary-error', width: 400, buttons: [{ message: 'OK', defaultButton: true, handler: function { $('#edit-summary-error').closeModal; }           }]        });        return false;    } });

/* ********** Notimodule ********** */ var notimoduleTitle = window.notimoduleTitle || 'Notifications'; var notimodulePagename = window.notimodulePagename || 'Template:Notimodule';

$('#WikiaRail').prepend(' '+ notimoduleTitle +' ');

if ( wgUserGroups.indexOf("sysop") >= 0 ) { $('#notimodule h2').append('<img src="data:image/gif;base64,R0lGODlhAQABAIABAAAAAP///yH5BAEAAAEALAAAAAABAAEAQAICTAEAOw%3D%3D" class="sprite edit-pencil"></a>'); }

$('#notimodule > div').load('/wiki/'+ notimodulePagename +'?action=render');

/* ********** Live subscriber count ********** */ $('.LiveSubsCount').each(function {   var lsc = $(this).data('name');    $('#WikiaRail').prepend('<iframe height="80px" width="300px" frameborder="0" src="https://akshatmittal.com/youtube-realtime/embed/#!/' + lsc + '" style="border: 0; width:300px; height:80px; background-color: #FFF; margin-bottom: 8px;"> ').show;    $(this).remove; });

/* ********** Second rail ********** */ var hpwrail = window.hpwrail || 'Template:Hpwrail';

$('#WikiaRailWrapper').append(' ') .prepend('Main rail</a> | Custom rail</a> ');

$('#HPWrail').load('/wiki/'+ hpwrail +'?action=render');

if ( wgUserGroups.indexOf("sysop") >= 0 ) { $('#WikiaRailWrapper aside').append('<img src="data:image/gif;base64,R0lGODlhAQABAIABAAAAAP///yH5BAEAAAEALAAAAAABAAEAQAICTAEAOw%3D%3D" class="sprite edit-pencil"></a>'); }

$('.toggle-hpw').click(function{   if (!$(this).hasClass('active')) {        $('#WikiaRail').toggle;        $('#HPWrail').toggle;        $('#edit-rail').toggle;        $('.toggle-hpw.active').removeClass('active');        $(this).addClass('active');    } });

/* ********** Live subscriber count ********** */ $('.LiveSubsCount').each(function {   var lsc = $(this).data('name');    $('#WikiaRail').prepend('<iframe height="80px" width="300px" frameborder="0" src="https://akshatmittal.com/youtube-realtime/embed/#!/' + lsc + '" style="border: 0; width:300px; height:80px; background-color: #FFF; margin-bottom: 8px;"> ').show;    $(this).remove; });

$("#HPWrail").ready(function {   // call the function after the element has been loaded here    console.log("HPWrail loaded!"); });

/* ********** Average rating score ********** */ $(document).ready(function { $('.rate-poll').each(function{ var weight = 5 * parseInt( $('.pollAnswer:nth-child(1) span').text ) + 4 * parseInt( $('.pollAnswer:nth-child(2) span').text ) + 3 * parseInt( $('.pollAnswer:nth-child(3) span').text ) + 2 * parseInt( $('.pollAnswer:nth-child(4) span').text ) + parseInt( $('.pollAnswer:nth-child(5) span').text ); var total = parseInt( $('.pollAnswer:nth-child(1) span').text ) + parseInt( $('.pollAnswer:nth-child(2) span').text ) + parseInt( $('.pollAnswer:nth-child(3) span').text ) + parseInt( $('.pollAnswer:nth-child(4) span').text ) + parseInt( $('.pollAnswer:nth-child(5) span').text ); if (total !== 0) { var average = ( weight / total ).toFixed(2); $('Average: ' + average + ' ').insertAfter('#ajax-poll-area'); } }); });