Content deleted Content added
Joshua Scott (talk | contribs) m Reverted edits by Joshua Scott (talk) to last version by He7d3r |
<maintenance> more info TypeError: Cannot read properties of null (reading 'parentNode') Tags: Mobile edit Mobile web edit Advanced mobile edit |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 7:
var pendch_diffonly;
var pendch_str_no_ajax = "There seems to be a problem using the
var pendch_str_box_title = "Pending changes";
var pendch_str_box_title_updating = "Pending
var pendch_str_box_title_failed = "Pending changes (update failed)";
var pendch_str_enable = "Enable this box";
var pendch_str_disable = "Disable this box";
$(document).ready( pendch_init );
/* initalise */
Line 27:
}
}
// allow user settings through
if (pendch_enabled == null) {
Line 43 ⟶ 44:
pendch_diffonly = 1;
}
// A few limits to be nice to the servers
if (pendch_num_pages > 50) {
Line 135:
}
}
// Get the current time
var dateobj = new Date();
var now = Math.floor(dateobj.getTime() / 1000.0);
// Then make the request
pendch_http.open("GET", "/w/api.php?action=query&format=
pendch_http.send(null);
}
Line 188 ⟶ 185:
var div = document.createElement('div');
div.setAttribute('id', 'p-pendingchanges');
div.className = '
var heading = document.createElement('
heading.appendChild(document.createTextNode(pendch_str_box_title));
div.appendChild(heading);
Line 211 ⟶ 208:
} else {
var node = document.getElementById('p-search');
if ( node && node.parentNode === side_col ) {
side_col.insertBefore(div, node);
}
}
Line 217 ⟶ 216:
/* Draw response (monobook) */
function pendch_ajax_response_monobook() {
var resp = JSON.parse(pendch_http.responseText);
var items = resp.query.oldreviewedpages;
// create the div that holds all the
var link_div = document.createElement('div');
link_div.className = 'pBody';
Line 228:
// populate the list with 10 links.
for (var i = 0; i < items.length; i++) {
var
var
item_name = item_name.replace(/&/, "%26");
a = document.createElement('a');
Line 241:
var li = document.createElement('li');
li.appendChild(a);
▲ }
list.appendChild(li);
}
Line 250 ⟶ 247:
var div = document.createElement('div');
div.setAttribute('id', 'p-pendingchanges');
div.className = '
var heading = document.createElement('
heading.appendChild(document.createTextNode(pendch_str_box_title));
div.appendChild(heading);
Line 288 ⟶ 285:
div.setAttribute('id', 'p-pendingchanges');
div.className = 'portal collapsed';
var heading = document.createElement('
heading.appendChild(document.createTextNode(pendch_str_box_title));
div.appendChild(heading);
Line 313 ⟶ 310:
}
if( typeof $
$('#p-pendingchanges >
if ( event.which == 13 /* Enter */ || event.which == 32 /* Space */ ) {
pendch_toggle( $(this) );
Line 332 ⟶ 329:
function pendch_ajax_response_vector() {
var resp = JSON.parse(pendch_http.responseText);
var items = resp.query.oldreviewedpages;
// create the div that holds all the
var link_div = document.createElement('div');
link_div.className = 'body';
Line 343 ⟶ 341:
// populate the list with 10 links.
for (var i = 0; i < items.length; i++) {
var
var
item_name = item_name.replace(/&/, "%26");
a = document.createElement('a');
Line 357 ⟶ 355:
var li = document.createElement('li');
li.appendChild(a);
list.appendChild(li);
}
Line 367 ⟶ 362:
div.setAttribute('id', 'p-pendingchanges');
div.className = 'portal expanded';
var heading = document.createElement('
heading.appendChild(document.createTextNode(pendch_str_box_title));
div.appendChild(heading);
Line 393 ⟶ 388:
}
if( typeof $
$('#p-pendingchanges >
if ( event.which == 13 /* Enter */ || event.which == 32 /* Space */ ) {
pendch_toggle( $(this) );
Line 410 ⟶ 405:
function pendch_toggle( $element ) {
$
if( $element.parent().is('.collapsed') ) {
pendch_enable_box();
|