Content deleted Content added
Joshua Scott (talk | contribs) ipd |
<maintenance> more info TypeError: Cannot read properties of null (reading 'parentNode') Tags: Mobile edit Mobile web edit Advanced mobile edit |
||
(12 intermediate revisions by 4 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";
if (window.___location.toString().search(/diffonly=1/) != -1) {▼
var currURL = window.___location.toString();▼
var newURL=currURL.replace(/diffonly=1/,diffonly=0);▼
console.log(document.getElementById("difference").innerHTML);▼
if (document.getElementById("difference").innerHTML.match(/Show page below diff/) == -1) {▼
document.getElementById("difference").innerHTML += ' (<a href="' + newURL + '">Show page below diff</a>)';▼
}▼
▲addOnloadHook( pendch_init );
/* initalise */
function pendch_init() {
▲ if (window.___location.toString().search(/diffonly=1/) != -1) {
▲ var currURL = window.___location.toString();
▲ var newURL=currURL.replace(/diffonly=1/,diffonly=0);
▲ console.log(document.getElementById("difference").innerHTML);
▲ document.getElementById("difference").innerHTML += ' (<a href="' + newURL + '">Show page below diff</a>)';
}
▲ }
// allow user settings through
if (pendch_enabled == null) {
Line 45 ⟶ 44:
pendch_diffonly = 1;
}
// A few limits to be nice to the servers
if (pendch_num_pages > 50) {
Line 137 ⟶ 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);
}
function pendch_draw_disabled_box() {
if (mw.config.get('skin') == 'vector') {
pendch_draw_disabled_box_vector();
} else {
Line 159 ⟶ 154:
function pendch_ajax_response() {
if (mw.config.get('skin') == 'vector') {
pendch_ajax_response_vector();
} else {
Line 190 ⟶ 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 213 ⟶ 208:
} else {
var node = document.getElementById('p-search');
if ( node && node.parentNode === side_col ) {
side_col.insertBefore(div, node);
}
}
}
Line 219 ⟶ 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 230 ⟶ 228:
// populate the list with 10 links.
for (var i = 0; i < items.length; i++) {
var
var old_id = item.stable_revid;
item_name = item_name.replace(/&/, "%26");
a = document.createElement('a');
Line 248 ⟶ 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 286 ⟶ 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 311 ⟶ 310:
}
if( typeof $
$
if ( event.which == 13 /* Enter */ || event.which == 32 /* Space */ ) {
pendch_toggle( $
}
} )
.mousedown( function() {
pendch_toggle( $
$
return false;
} );
Line 330 ⟶ 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 341:
// populate the list with 10 links.
for (var i = 0; i < items.length; i++) {
var
var old_id = item.stable_revid;
item_name = item_name.replace(/&/, "%26");
a = document.createElement('a');
Line 361 ⟶ 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 387 ⟶ 388:
}
if( typeof $
$
if ( event.which == 13 /* Enter */ || event.which == 32 /* Space */ ) {
pendch_toggle( $
}
} )
.mousedown( function() {
pendch_toggle( $
$
return false;
} );
Line 404 ⟶ 405:
function pendch_toggle( $element ) {
$
if( $element.parent().is('.collapsed') ) {
pendch_enable_box();
|