Content deleted Content added
TeaLover1996 (talk | contribs) No edit summary |
m Maintenance: Global identifier "$j" has been deprecated mw:ResourceLoader/Migration_guide_(users)#MediaWiki_1.17 |
||
(14 intermediate revisions by 2 users not shown) | |||
Line 6:
var npp_num_idle_req;
var npp_curr_idle_req;
var npp_str_no_ajax = "There seems to be a problem using the NewPagePatrol script. Your browser is not supported. God Bless!";
var npp_str_box_title = "New pages";
Line 13:
var npp_str_enable = "Enable this box";
var npp_str_disable = "Disable this box";
$( npp_init );
Line 32:
npp_num_idle_req = 60;
}
// A few limits to be nice to the servers
if (npp_num_pages > 50) {
Line 49:
npp_num_idle_req = 5;
}
// get our cookie
if (document.cookie.length > 0) {
Line 108:
npp_disable_box();
}
// check we are enabled
if (npp_enabled == false) return;
// firstly, inform the user
var cur_box = document.getElementById('p-newpages');
Line 125:
}
}
// Get the current time
var dateobj = new Date();
var now = Math.floor(dateobj.getTime() / 1000.0);
// Go back 5 mins in time
now -= (60 * 5);
// Then make the request
npp_http.open("GET", "/w/api.php?action=query&format=xml&list=recentchanges&rcshow=!bot|!redirect&rctype=new&rcnamespace=0&rcprop=title|timestamp|ids|patrolled&rcstart=" + now + "&rclimit=" + npp_num_pages, true);
npp_http.send(null);
}
function npp_draw_disabled_box() {
if (mw.config.get('skin') == 'vector') {
Line 145:
}
}
function npp_ajax_response() {
if (mw.config.get('skin') == 'vector') {
Line 152:
npp_ajax_response_monobook();
}
// and do it again in 5 secs
setTimeout("npp_ajax_request()", npp_refresh * 1000);
}
function npp_disable_box() {
npp_enabled = false;
Line 169:
npp_ajax_request();
}
/* Draw disabled (monobook) */
function npp_draw_disabled_box_monobook() {
Line 204:
}
}
/* Draw response (monobook) */
function npp_ajax_response_monobook() {
Line 228:
a.setAttribute('href', item_url);
a.appendChild(document.createTextNode(item_name));
var li = document.createElement('li');
li.appendChild(a);
Line 267:
}
}
/* Draw disabled box (vector skin) */
function npp_draw_disabled_box_vector() {
Line 302:
side_col.insertBefore(div, node);
}
if( typeof $
$('#p-newpages > h3').keydown( function( event ) {
if ( event.which == 13 /* Enter */ || event.which == 32 /* Space */ ) {
Line 318:
}
}
/* Draw response (vector skin) */
function npp_ajax_response_vector() {
Line 351:
li.setAttribute('style','background-color: #e7e7e7');
//li.style.color = '#555555';
}
list.appendChild(li);
Line 364:
div.appendChild(heading);
div.appendChild(link_div);
// disable link
var p = document.createElement('p');
Line 375:
p.appendChild(a);
// add later
// now replace the div
var old_div = document.getElementById('p-newpages');
Line 385:
side_col.insertBefore(div, node);
}
if( typeof $
$('#p-newpages > h5').keydown( function( event ) {
if ( event.which == 13 /* Enter */ || event.which == 32 /* Space */ ) {
Line 401:
}
}
function npp_toggle( $element ) {
$
if( $element.parent().is('.collapsed') ) {
npp_enable_box();
|