hgweb: rename an instance of XMLHttpRequest to xhr in mercurial.js
authorAnton Shestakov <av6@dwimlabs.net>
Wed, 22 Nov 2017 21:32:18 +0800
changeset 35159 018aac6d7cb0
parent 35158 241da2de0e9f
child 35160 69a865dc2ada
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.
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) {