Page MenuHomeWickedGov Phorge

initOnLoad.js
No OneTemporary

Size
935 B
Referenced Files
None
Subscribers
None

initOnLoad.js

const ipReveal = require( './ipReveal.js' );
const ipRevealUtils = require( './ipRevealUtils.js' );
/**
* Run code when the page loads.
*
* @param {string|*} documentRoot A Document or selector to use as the root of the
* search for elements
*/
module.exports = function ( documentRoot ) {
if ( !documentRoot ) {
documentRoot = document;
}
ipReveal.addButton( $( '#bodyContent', documentRoot ) );
ipReveal.enableMultiReveal( $( documentRoot ) );
// Check which users have been revealed recently, and reveal them on load.
const recentUsers = [];
$( '.mw-tempuserlink', documentRoot ).each( function () {
const target = $( this ).text();
// Trigger a lookup for one of each revealed user
if ( ipRevealUtils.getRevealedStatus( target ) && recentUsers.indexOf( target ) < 0 ) {
$( this ).next( '.ext-checkuser-tempaccount-reveal-ip-button' ).trigger( 'revealIp' );
recentUsers.push( target );
}
} );
};

File Metadata

Mime Type
text/plain
Expires
Sat, Oct 3, 12:51 (2 d, 12 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
3d/7d/3e03c59a00a5437593550ff0c97f
Default Alt Text
initOnLoad.js (935 B)

Event Timeline