Bruger:Christian75/Scripts/NewPagePatrol.js: Forskelle mellem versioner

Content deleted Content added
m en --> da (i http://)
 
Linje 15:
var npp_str_disable = "disable this box";
 
addOnloadHook$( npp_init );
 
/* initalise */
function npp_init() {
 
// allow user settings through
if (npp_enabled == null) {
Linje 54:
if (document.cookie.length > 0) {
var c_start = document.cookie.indexOf("npp_show_box=");
if (c_start != -1) {
c_start = c_start + 13;
var c_end = document.cookie.indexOf(";", c_start);
if (c_end == -1) {
c_end = document.cookie.length;
}
 
if (document.cookie.substring(c_start, c_end) == "yes") {
npp_enabled = true;
Linje 66:
npp_enabled = false;
}
}
}
 
// Either make a request or show nothing
npp_curr_idle_req = 0;
Linje 77:
}
}
 
/* init ajax */
function npp_create_request() {
try {
npp_http = new XMLHttpRequest();
 
} catch (e) {
try {
Linje 94:
}
}
 
npp_http.onreadystatechange = function() {
if(npp_http.readyState == 4) npp_ajax_response();
}
 
return true;
}
 
/* make a request */
function npp_ajax_request() {
Linje 118:
cur_box.firstChild.firstChild.data = npp_str_box_title_updating;
}
 
if (npp_create_request () == false) {
if (cur_box != null) {
Linje 126:
}
}
 
// 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&rclimit=" + npp_num_pages, true);
Linje 133:
 
function npp_draw_disabled_box() {
if (mw.config.get('skin') == 'vector') {
npp_draw_disabled_box_vector();
} else {
Linje 141:
 
function npp_ajax_response() {
if (mw.config.get('skin') == 'vector') {
npp_ajax_response_vector();
} else {
Linje 156:
document.cookie = "npp_show_box=no; path=/";
}
 
function npp_enable_box() {
npp_enabled = true;
Linje 177:
div.appendChild(heading);
div.appendChild(link_div);
 
// enable link
var p = document.createElement('p');
Linje 187:
p.appendChild(a);
link_div.appendChild(p);
 
// now replace the div
var old_div = document.getElementById('p-newpages');
Linje 201:
/* Draw response (monobook) */
function npp_ajax_response_monobook() {
 
var items = npp_http.responseXML.getElementsByTagName('rc');
 
// create the div that holds all the newpage links
var link_div = document.createElement('div');
Linje 209:
var list = document.createElement('ul');
link_div.appendChild(list);
 
// populate the list with 10 links.
for (var i = 0; i < items.length; i++) {
Linje 215:
var rcid = items[i].getAttribute('rcid');
var patrolled = items[i].getAttribute('patrolled') != null;
 
item_name = item_name.replace(/&/, "%26");
var item_url = 'http://da.wikipedia.org/w/index.php?title=' + item_name + '&rcid=' + rcid + '&redirect=no';
 
a = document.createElement('a');
a.setAttribute('href', item_url);
Linje 230:
list.appendChild(li);
}
 
// Container div
var div = document.createElement('div');
Linje 239:
div.appendChild(heading);
div.appendChild(link_div);
 
// disable link
var p = document.createElement('p');
Linje 250:
p.appendChild(a);
link_div.appendChild(p);
 
// now replace the div
var old_div = document.getElementById('p-newpages');
Linje 275:
div.appendChild(heading);
div.appendChild(link_div);
 
// enable link
var p = document.createElement('p');
Linje 285:
p.appendChild(a);
link_div.appendChild(p);
 
// now replace the div
var old_div = document.getElementById('p-newpages');
Linje 299:
/* Draw response (vector skin) */
function npp_ajax_response_vector() {
 
var items = npp_http.responseXML.getElementsByTagName('rc');
 
// create the div that holds all the newpage links
var link_div = document.createElement('div');
Linje 307:
var list = document.createElement('ul');
link_div.appendChild(list);
 
// populate the list with 10 links.
for (var i = 0; i < items.length; i++) {
Linje 313:
var rcid = items[i].getAttribute('rcid');
var patrolled = items[i].getAttribute('patrolled') != null;
 
item_name = item_name.replace(/&/, "%26");
var item_url = 'http://da.wikipedia.org/w/index.php?title=' + item_name + '&rcid=' + rcid + '&redirect=no';
 
a = document.createElement('a');
a.setAttribute('href', item_url);
//a.style.fontSize = 'x-small';
a.appendChild(document.createTextNode(item_name));
 
var li = document.createElement('li');
li.appendChild(a);
Linje 332:
list.appendChild(li);
}
 
// Container div
var div = document.createElement('div');
Linje 341:
div.appendChild(heading);
div.appendChild(link_div);
 
// disable link
var p = document.createElement('p');
Linje 352:
p.appendChild(a);
link_div.appendChild(p);
 
// now replace the div
var old_div = document.getElementById('p-newpages');