Content deleted Content added
Writ Keeper (talk | contribs) wow, they didn't half fuck up the edit screen. |
Writ Keeper (talk | contribs) in theory this should still work... |
||
Line 3:
if(mw.config.get("wgAction") === "edit" || mw.config.get("wgAction") === "submit" )
{
if(/previewanddiff=true/.test(window.___location.href))
mw.loader.load('mediawiki.action.history.diff');
$("#wikiPreview").after('<h2></h2><h2>Your changes</h2><table class="diff" id="ajaxDiff"><colgroup><col class="diff-marker"><col class="diff-content"><col class="diff-marker"><col class="diff-content"></colgroup></table>');
var requestString="/w/api.php";
var requestData = {action:"query", prop:"revisions", format:"json", rvcontentformat:"text/x-wiki", revids:$("input[name='baseRevId']").attr("value"), rvdifftotext:$("textarea#wpTextbox1").text()};
if($("input[name='wpSection']").attr("value") !== "")
requestData.rvsection = $("input[name='wpSection']").attr("value");
}
$.post(requestString, requestData, function(response, status)
{
$("#ajaxDiff").append(response.query.pages[Object.keys(response.query.pages)[0]].revisions[0].diff["*"]);
});
}
var previewDiffButton = new OO.ui.ButtonWidget();
previewDiffButton.setLabel("Show preview and changes");
Line 10 ⟶ 25:
previewDiffButton.$element.children("a").click(function()
{
$("#editform").attr("action", formAction+"&previewanddiff=true");
▲ {
▲ }
});
}
|