Content deleted Content added
Writ Keeper (talk | contribs) test |
Writ Keeper (talk | contribs) fx |
||
(9 intermediate revisions by the same user not shown) | |||
Line 1:
diffRequestLocked = "f";
if(mw.config.get("wgCanonicalSpecialPageName") == "Contributions")
{
Line 8:
$("#mw-content-text ul").children("li").each(function(index, element)
{
if($(element).children('[href*="diff=prev"]').length > 0 && !(/(\.js|\.css)$/.test($(element).children('.mw-changeslist-date').attr('title'))))
{
var diffURL = $(element).children('.mw-changeslist-date').attr("href");
var regex = /
var
var
if(typeof inlineDiffSmallUI != "undefined")
var inlineDiffButton = document.createElement("input");▼
{
inlineDiffButton.type = "button";▼
inlineDiffButton.
inlineDiffButton.innerHTML = '<b><span style="color:black;">[</span><span style="color:MidnightBlue;">inspect diff</span><span style="color:black;">]</span></b>';
$(inlineDiffButton).click(function(){ inspectContribsDiff(this);});▼
}
else
{
▲ inlineDiffButton.type = "button";
inlineDiffButton.value = "Inspect edit";
}
inlineDiffButton.id = diffID;
▲ $(inlineDiffButton).click(function(){ return inspectContribsDiff(this);});
element.appendChild(inlineDiffButton);
}
Line 31 ⟶ 40:
{
alert("An old request is still being processed, please wait...");
return false;
}
else
{
diffRequestLocked = "t";
$.getJSON("/w/api.php?action=query&prop=revisions&format=json&rvprop=timestamp
▲ $.getJSON("/w/api.php?action=query&prop=revisions&format=json&rvprop=timestamp&rvlimit=1&rvstartid="+diffID+"&rvendid="+diffID+"&rvtoken=rollback&rvdiffto=prev&titles="+diffPage, function(response, status){
var diffString = response.query.pages[Object.keys(response.query.pages)[0]].revisions[0].diff["*"];
Line 72 ⟶ 78:
newTable.id = button.id + "display";
$(button).attr("value","Hide edit");▼
$(button).unbind("click");
if(typeof inlineDiffSmallUI != "undefined")
$(button).click(function(){ hideEditInspection(this);});▼
{
$(button).html('<b><span style="color:black;">[</span><span style="color:MidnightBlue;">hide diff</span><span style="color:black;">]</span></b>');
$(button).click(function(){ return hideSmallEditInspection(this);});
}
else
{
}
diffRequestLocked = "f";
Line 81 ⟶ 94:
}
return false;
}
Line 88 ⟶ 102:
$(button).attr("value","Hide edit");
$(button).unbind("click");
$(button).click(function(){ return hideEditInspection(this);});
return false;
}
function hideEditInspection( button)
{
return false;
}
function showSmallEditInspection( button)
{
$("#"+button.id+"display").css("display", "");
$(button).html('<b><span style="color:black;">[</span><span style="color:MidnightBlue;">hide diff</span><span style="color:black;">]</span></b>');
$(button).unbind("click");
$(button).click(function(){ return hideSmallEditInspection(this);});
return false;
}
function hideSmallEditInspection( button)
{
$("#"+button.id+"display").css("display", "none");
$(button).html('<b><span style="color:black;">[</span><span style="color:MidnightBlue;">show diff</span><span style="color:black;">]</span></b>');
$(button).unbind("click");
$(button).click(function(){ return showSmallEditInspection(this);});
return false;
}
$(document).ready(addContribsInspectionBoxes);
}
|