Uporabnik:Dbc334/inlinediff.js: Razlika med redakcijama

posodobitev
m (posodobitev)
(posodobitev)
var loadingImage = new Image();
loadingImage.src = "http://upload.wikimedia.org/wikipedia/commons/4/42/Loading.gif";
 
function NZS_run() {
var rcList = document.getElementsByTagName('ul')[0].getElementsByTagName('li');
for(i = 0; i < rcList.length; i++) {
var rcCurrent = rcList[i].getElementsByTagName('a')[0];
if(rcCurrent.href.indexOf("'&diff="') != -1) {
var rcDiff = rcCurrent.href.substring(rcCurrent.href.indexOf("'&diff="')+6, rcCurrent.href.indexOf("'&oldid="'));
var rcOldid = rcCurrent.href.substring(rcCurrent.href.indexOf("'&oldid="')+7);
NZS_makeClick(rcDiff, rcOldid, i);
}
}
 
importStylesheetURI('//bits.wikimedia.org/sl.wikipedia.org/load.php?debug=false&lang=sl&modules=mediawiki.action.history.diff&only=styles&skin=monobook&*');
var tagHead = document.getElementsByTagName('head')[0];
var tagLink = document.createElement("link");
tagLink.rel = "stylesheet";
tagLink.href = "/skins-1.5/common/diff.css?100";
tagHead.insertBefore(tagLink, tagHead.firstChild);
 
var tagLink2 = document.createElement("link");
tagLink2.rel = "stylesheet";
tagLink2.href = "/w/index.php?title=MediaWiki:Monobook.css&usemsgcache=yes&action=raw&ctype=text/css&smaxage=2678400";
tagHead.insertBefore(tagLink2, tagHead.lastChild);
}
 
function NZS_makeClick(diff, oldid, i) {
var entryDOM = document.getElementsByTagName('ul')[0].getElementsByTagName('li')[i].id = "rcChange" + diff;
entryDOM.id = 'rcChange' + diff;
document.getElementsByTagName('ul')[0].getElementsByTagName('li')[i]entryDOM.getElementsByTagName('a')[0].onclick = function() {return NZS_diff(diff, oldid);};
}
 
function NZS_diff(diff, oldid) {
if(buttonCtrldocument.getElementById('rcDiff' ==+ 0diff)) {
if(var rcDiffTag = document.getElementById('rcDiff' + diff)) {;
default: rcDiffTag.style.display = "(rcDiffTag.style.display=='none'?'':'none"');
var rcDiffTag = document.getElementById('rcDiff' + diff);
} else {
switch(rcDiffTag.style.display) {
var rcDiffTagrcLink = document.getElementById('rcDiffrcChange' + diff);
case "none": rcDiffTag.style.display = ""; break;
var tagLinkrcLinkResult = document.createElement("link"'li');
default: rcDiffTag.style.display = "none";
rcLinkResult.style.widthid = "100%"'rcDiff' + diff;
}
rcLinkResult.style.textAlign = "'center"';
} else {
rcLinkResult.style.width = '100%';
var rcLink = document.getElementById('rcChange' + diff);
 
var rcLinkResult = document.createElement("li");
var rcLinkResult.idloadingImage = "rcDiff"new +Image(18, diff18);
loadingImage.src = "http:'//upload.wikimedia.org/wikipedia/commons/4/42/Loading.gif"';
rcLinkResult.style.textAlign = "center";
var loadingImage.title = new Image()'Nalaganje';
rcLinkResult.style.width = "100%";
loadingImage.id = 'rc2Diff' + diff;
rcLinkResult.innerHTML = '<img src="http://upload.wikimedia.org/wikipedia/commons/4/42/Loading.gif" id="rc2Diff' + diff + '" alt="Nalaganje" width="18" height="18" />';
rcLinkResult.appendChild(loadingImage);
var rcList = document.getElementsByTagName('ul')[0];
 
rcList.replaceChild(rcLinkResult, rcLink);
var rcList = document.insertBeforegetElementsByTagName(rcLink, rcLinkResult'ul')[0];
rcList.replaceChild(rcLinkResult, rcLink);
NZS_showDiff(diff, oldid);
rcList.insertBefore(rcLink, rcLinkResult);
}
NZS_showDiff(diff, oldid);
return false;
}
return false;
}
 
function NZS_showDiff(diff, oldid) {
document.getElementsByTagName('html')[0].style.cursor = "'wait"';
 
$.ajax({
url: "'/w/index.php?action=render&diffonly=yes&diff="'+diff+"'&oldid="'+oldid,
success: function(returnData) {
document.getElementsByTagName('html')[0].style.cursor = "'auto"';
document.getElementById('rcDiff' + diff).style.textAlign = ""'';
document.getElementById('rcDiff' + diff).innerHTML = returnData;
window.location.hash = "'#rcChange"' + diff;
}
});
}
 
if(wgCanonicalSpecialPageName == "'Recentchanges"') {
buttonCtrl = 0;
addOnloadHook(NZS_run);
function NZS_checkKeyDown(e) {if(!e) {e = window.event;} if(e.keyCode == 17 && buttonCtrl == 0) {buttonCtrl = 1;}}
function NZS_checkKeyUp(e) {if(!e) {e = window.event;} if(e.keyCode == 17 && buttonCtrl == 1) {buttonCtrl = 0;}}
 
if(wgCanonicalSpecialPageName == "Recentchanges") {
document.onkeydown = NZS_checkKeyDown;
document.onkeyup = NZS_checkKeyUp;
window.onload = NZS_run;
}
19.279

urejanj