User:Jorgenev/AJAXSectionEditor.js: Difference between revisions

Content deleted Content added
No edit summary
m Maintenance: Replacing addOnloadHook with native jQuery (mw:ResourceLoader/Migration_guide_(users)#addOnloadHook - phab:T130879)
 
(2 intermediate revisions by one other user not shown)
Line 29:
if ( data.edit && data.edit.result == 'Success' ) {
cancel();
window.___location.reload(); // reload page if edit was successful
 
$.get('http://en.wikipedia.org/w/index.php?action=render&title='+PageName, function(data) {
document.getElementById("bodyContent").innerHTML = document.getElementById("bodyContent").innerHTML.split("<!-- bodytext -->")[0] + data;
});
 
} else if ( data.error ) {
alert( 'Error: API returned error code' + data.error.code + ' with info ' + data.error.info );
Line 96 ⟶ 92:
if(!h1 || h < sh)
{
document.getElementById("thesectiondata").style.height = 10+"px";
document.getElementById("thesectiondata").style.height = (25+document.getElementById("thesectiondata").scrollHeight)+"px";
}
}
 
addOnloadHook$(function (){
var i = 0;