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.
--- 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) {