Content deleted Content added
m I hate popups |
change 'expand all' to 'toggle all', shows/hides based on the state of the first div. Improve &ucstart and &ucend logic by overriding UI form parameter if present, and using ucdir=newer (logical++) |
||
Line 1:
/* Special:Contributions Wildcard/CIDR lookup, version [0.2.
Originally from: http://en.wikipedia.org/wiki/User:Splarka/contribsrange.js
Line 9:
** Checks namespace and date options in form.
** Also utilizes &ucstart and &ucend date parameters if supplied manually (not supported in the UI atm).
*** These parameter soverride the form date options.
* Uses: Submit any IP CIDR range /16 or from /24 to /32. Submit any string (at least 3 characters) with a suffixed asterisk.
** eg: [123.123.123.0/24 ] or [123.123.123.* ] or [Willy* ].
Line 45 ⟶ 46:
if(y > 2000 && y < 2100) opt_ts = '&ucstart=' + y + '-' + m + '-01T00:00:00Z'
var opts_se = '';
if(queryString('ucstart')) opts_se += '&ucstart=' + encodeURIComponent(queryString('ucstart'))
if(queryString('ucend')) opts_se += '&ucend=' + encodeURIComponent(queryString('ucend'))
if(opts_se == '') {
var options = opt_ns + opt_ts
} else {
var options = opt_ns + opts_se + '&ucdir=newer';
}
var patternCIDR = /(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/(2[7-9]|3[0-2]|24|16)/i ;
Line 90 ⟶ 95:
var res = document.createElement('div');
res.setAttribute('id','results-from-CIDR');
addlinkchild(res,'javascript:
var spin = document.createElement('span');
spin.setAttribute('id','prefixcontribs-prog')
Line 179 ⟶ 184:
}
function
if(lsts.length == 0) return
▲ var lsts = getElementsByClassName(document,'ul','cr-list');
var togglefrom = lsts[0].style.display;
for(var i=0;i<lsts.length;i++) prefixContribsToggleDiv(lsts[i].id,true)▼
for(var i=0;i<lsts.length;i++) {
▲
}
}
function prefixContribsToggleDiv(id) {
var i = document.getElementById(id);
var m = document.getElementById('m-' + id);
if(!i || !m) return
if(i.style.display == 'none'
i.style.display = 'block';
m.className = 'cr-toggle-shown'
|