MediaWiki:Gadget-libSensitiveIPs.js
Appearance
![]() | This page is loaded as a part of the libSensitiveIPs gadget, a hidden gadget. |
( function ( $, mw, undefined ) {
'use strict';
var sensitiveIPs;
sensitiveIPs = mw.libs.sensitiveips = {
query: function ( args ) {
if ( !( args instanceof Object ) ) {
throw new TypeError( "type error in arg #1 to 'query' (object expected)" );
}
return mw.libs.lua.call( {
format: 'json',
module: 'Sensitive IP addresses/API',
func: 'query',
args: args
} );
},
isSensitive: function ( s ) {
return sensitiveIPs.query( { test: [ s ] } ).then( function ( data ) {
return data.ips.length > 0;
} );
}
};
} )( jQuery, mediaWiki );