Page MenuHomeWickedGov Phorge

initOnHook.js
No OneTemporary

Size
774 B
Referenced Files
None
Subscribers
None

initOnHook.js

const ipReveal = require( './ipReveal.js' );
/**
* Add IP reveal functionality to a page that automatically updates.
*
* This is very similar to initOnLoad, except:
* - Multi-reveal functionality is enabled once, on page load.
* - New buttons and new revealed IPs are potentially added each time the page updates.
*
* @param {string|jQuery|*} documentRoot A DOM Element, Document, jQuery or selector
* to use as context
*/
module.exports = function ( documentRoot ) {
if ( !documentRoot ) {
documentRoot = document;
}
mw.hook( 'wikipage.content' ).add( ( $content ) => {
const $ipRevealButtons = ipReveal.addIpRevealButtons( $content );
ipReveal.automaticallyRevealUsers( $ipRevealButtons );
} );
ipReveal.enableMultiReveal( $( documentRoot ) );
};

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 22, 04:24 (1 d, 5 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
36/c8/e2dae442c042a331e48ed818a4d7
Default Alt Text
initOnHook.js (774 B)

Event Timeline