# HG changeset patch # User Anton Shestakov # Date 1511357538 -28800 # Node ID 018aac6d7cb0f0db46a8665f28dfedb38f012c99 # Parent 241da2de0e9ff76e6b26bfdb692aef713562ee1a hgweb: rename an instance of XMLHttpRequest to xhr in mercurial.js "xhr" is a really widespread name for this kind of things, no idea where did "xfr" come from (the original 2228bd109706 doesn't explain that). Let's just change one letter so the name makes more sense. diff -r 241da2de0e9f -r 018aac6d7cb0 mercurial/templates/static/mercurial.js --- a/mercurial/templates/static/mercurial.js Wed Nov 22 21:15:44 2017 +0800 +++ b/mercurial/templates/static/mercurial.js Wed Nov 22 21:32:18 2017 +0800 @@ -297,12 +297,12 @@ } function makeRequest(url, method, onstart, onsuccess, onerror, oncomplete) { - xfr = new XMLHttpRequest(); - xfr.onreadystatechange = function() { - if (xfr.readyState === 4) { + xhr = new XMLHttpRequest(); + xhr.onreadystatechange = function() { + if (xhr.readyState === 4) { try { - if (xfr.status === 200) { - onsuccess(xfr.responseText); + if (xhr.status === 200) { + onsuccess(xhr.responseText); } else { throw 'server error'; } @@ -314,11 +314,11 @@ } }; - xfr.open(method, url); - xfr.overrideMimeType("text/xhtml; charset=" + document.characterSet.toLowerCase()); - xfr.send(); + xhr.open(method, url); + xhr.overrideMimeType("text/xhtml; charset=" + document.characterSet.toLowerCase()); + xhr.send(); onstart(); - return xfr; + return xhr; } function removeByClassName(className) {