This article will address the topic of
User:Technical 13/Scripts/Jobs.js from a broad and varied perspective, exploring different aspects and points of view related to this topic. From its origin to its relevance today, through its implications in various areas, this article will seek to provide a complete and detailed vision of
User:Technical 13/Scripts/Jobs.js. Through a thorough and rigorous analysis, the aim is to offer the reader a complete overview that allows them to understand the importance and scope of
User:Technical 13/Scripts/Jobs.js in today's society. In addition, possible challenges and opportunities related to this topic will be addressed, as well as recommendations and perspectives for the future.
var oldUsers = -1, oldPages = -1, oldJobs = -1, oldMms = -1;
function stopRefreshing() {
clearInterval( refreshStats );
$( '#stopButton' ).replaceWith( '<b>Last updated</b>' );
}
function updateResults() {
new mw.Api().get( {
action: 'query',
meta: 'siteinfo',
siprop: 'statistics'
} ).done( function( siteStats ) {
var statPath = siteStats.query.statistics;
if ( oldUsers === -1 ) { oldUsers = statPath.users; }
if ( oldPages === -1 ) { oldPages = statPath.pages; }
if ( oldJobs === -1 ) { oldJobs = statPath.jobs; }
if ( oldMms === -1 ) { oldMms = statPath; }
var userInfo = '<tr><td>Total users</td><td style="text-align: right;">' +
statPath.users.toLocaleString() +
'</td><td style="text-align: right;">' + ( statPath.users -oldUsers ).toLocaleString() + '</td></tr>';
userInfo += '<tr><td>Active users</td><td colspan="2" style="text-align: center;">' +
( Math.round( statPath.activeusers / statPath.users * 1000000 ) / 10000 ) + '%</td></tr>';
userInfo += '<tr><td>Admins</td><td colspan="2" style="text-align: center;">' +
( Math.round( statPath.admins / statPath.users * 1000000 ) / 10000 ) + '%</td></tr>';
var pageInfo = '<tr><td>Total pages</td><td style="text-align: right;">' +
statPath.pages.toLocaleString() +
'</td><td style="text-align: right;">' + ( statPath.pages - oldPages ).toLocaleString() + '</td></tr>';
pageInfo += '<tr><td>Articles</td><td colspan="2" style="text-align: center;">' +
( Math.round( statPath.articles / statPath.pages * 1000000 ) / 10000 ) + '%</td></tr>';
pageInfo += '<tr><td>Images</td><td colspan="2" style="text-align: center;">' +
( Math.round( statPath.images / statPath.pages * 1000000 ) / 10000 ) + '%</td></tr>';
var jobInfo = '<tr><td>Queued jobs</td><td style="text-align: right;">' +
statPath.jobs.toLocaleString() +
'</td><td style="text-align: right;">' + ( statPath.jobs - oldJobs ).toLocaleString() + '</td></tr>';
var mmsInfo = '<tr><td>MMS Queue</td><td style="text-align: right;">' +
statPath +
'</td><td style="text-align: right;">' + ( statPath - oldMms ).toLocaleString() + '</td></tr>';
var displayInfo = '<table style="width: 100%;" border="1">';
displayInfo += '<tr><th style="font-variant: small-caps; font-size: 14px;">stat</th>' +
'<th style="font-variant: small-caps; font-size: 14px;">value</th>' +
'<th style="font-variant: small-caps; font-size: 14px;">change</th></tr>';
displayInfo += userInfo;
displayInfo += pageInfo;
displayInfo += jobInfo;
displayInfo += mmsInfo;
var nowTimeDate = new Date( Date.now() );
displayInfo += '<tr><td colspan="3" style="font-size: larger; text-align: center;"><a id="stopButton" href="#stopUpdating" onClick="stopRefreshing();">Stop updating</a>: ' + nowTimeDate.toLocaleTimeString() + '</td></tr>';
displayInfo += '<tr><td colspan="3" style="font-size: larger; text-align: center;">' +
'<a href="https://wikifreehand.com/en/User:Technical_13/Scripts/Jobs" title="User:Technical 13/Scripts/Jobs">Documentation</a>' +
'</td></tr></table>';
mw.notify( $( displayInfo ), { title: 'Current enwp statistics:', tag: 'siteInfo', autoHide: false } );
oldUsers = statPath.users;
oldJobs = statPath.jobs;
oldMms = statPath;
} );
};
updateResults();
var refreshStats = window.setInterval( updateResults, 15000 );