hgweb: remove unused second argument of nextPageVarGet()
nextPageVarGet is a function that's used in ajaxScrollInit() to produce URL of
the next page. Before
f84b01257e06, its second argument previousVal was a
number on /graph pages, and the code was simply adding 60 to it and returning
the resulting value. Now previousVal can only be a string containing changeset
hash, which can't be used the same way (and in fact isn't used in any way).
--- a/mercurial/templates/gitweb/graph.tmpl Sun Jan 14 20:06:56 2018 -0800
+++ b/mercurial/templates/gitweb/graph.tmpl Mon Jan 15 19:44:18 2018 +0800
@@ -57,7 +57,7 @@
ajaxScrollInit(
'{url|urlescape}graph/%next%{graphvars%urlparameter}',
'{nextentry%"{node}"}', <!-- NEXTHASH
- function (htmlText, previousVal) \{
+ function (htmlText) \{
var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
return m ? m[1] : null;
},
--- a/mercurial/templates/gitweb/shortlog.tmpl Sun Jan 14 20:06:56 2018 -0800
+++ b/mercurial/templates/gitweb/shortlog.tmpl Mon Jan 15 19:44:18 2018 +0800
@@ -41,7 +41,7 @@
ajaxScrollInit(
'{url|urlescape}shortlog/%next%{sessionvars%urlparameter}',
'{nextentry%"{node}"}', <!-- NEXTHASH
- function (htmlText, previousVal) \{
+ function (htmlText) \{
var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
return m ? m[1] : null;
},
--- a/mercurial/templates/monoblue/graph.tmpl Sun Jan 14 20:06:56 2018 -0800
+++ b/mercurial/templates/monoblue/graph.tmpl Mon Jan 15 19:44:18 2018 +0800
@@ -51,7 +51,7 @@
ajaxScrollInit(
'{url|urlescape}graph/%next%{graphvars%urlparameter}',
'{nextentry%"{node}"}', <!-- NEXTHASH
- function (htmlText, previousVal) \{
+ function (htmlText) \{
var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
return m ? m[1] : null;
},
--- a/mercurial/templates/monoblue/shortlog.tmpl Sun Jan 14 20:06:56 2018 -0800
+++ b/mercurial/templates/monoblue/shortlog.tmpl Mon Jan 15 19:44:18 2018 +0800
@@ -39,7 +39,7 @@
ajaxScrollInit(
'{url|urlescape}shortlog/%next%{sessionvars%urlparameter}',
'{nextentry%"{node}"}', <!-- NEXTHASH
- function (htmlText, previousVal) \{
+ function (htmlText) \{
var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
return m ? m[1] : null;
},
--- a/mercurial/templates/paper/graph.tmpl Sun Jan 14 20:06:56 2018 -0800
+++ b/mercurial/templates/paper/graph.tmpl Mon Jan 15 19:44:18 2018 +0800
@@ -70,7 +70,7 @@
ajaxScrollInit(
'{url|urlescape}graph/%next%{graphvars%urlparameter}',
'{nextentry%"{node}"}', <!-- NEXTHASH
- function (htmlText, previousVal) \{
+ function (htmlText) \{
var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
return m ? m[1] : null;
},
--- a/mercurial/templates/paper/shortlog.tmpl Sun Jan 14 20:06:56 2018 -0800
+++ b/mercurial/templates/paper/shortlog.tmpl Mon Jan 15 19:44:18 2018 +0800
@@ -72,7 +72,7 @@
ajaxScrollInit(
'{url|urlescape}shortlog/%next%{sessionvars%urlparameter}',
'{nextentry%"{node}"}', <!-- NEXTHASH
- function (htmlText, previousVal) \{
+ function (htmlText) \{
var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
return m ? m[1] : null;
},
--- a/mercurial/templates/static/mercurial.js Sun Jan 14 20:06:56 2018 -0800
+++ b/mercurial/templates/static/mercurial.js Mon Jan 15 19:44:18 2018 +0800
@@ -471,9 +471,6 @@
var graph = window.graph;
var dataStr = htmlText.match(/^\s*var data = (.*);$/m)[1];
var data = JSON.parse(dataStr);
- if (data.length < nextPageVar) {
- nextPageVar = undefined;
- }
graph.reset();
adoptChildren(doc.querySelector('#graphnodes'), container.querySelector('#graphnodes'));
graph.render(data);
@@ -481,7 +478,7 @@
adoptChildren(doc.querySelector(containerSelector), container);
}
- nextPageVar = nextPageVarGet(htmlText, nextPageVar);
+ nextPageVar = nextPageVarGet(htmlText);
},
function onerror(errorText) {
var message = {
--- a/tests/test-hgweb-commands.t Sun Jan 14 20:06:56 2018 -0800
+++ b/tests/test-hgweb-commands.t Mon Jan 15 19:44:18 2018 +0800
@@ -816,7 +816,7 @@
ajaxScrollInit(
'/shortlog/%next%',
'', <!-- NEXTHASH
- function (htmlText, previousVal) {
+ function (htmlText) {
var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
return m ? m[1] : null;
},
@@ -1837,7 +1837,7 @@
ajaxScrollInit(
'/graph/%next%?graphtop=cad8025a2e87f88c06259790adfa15acb4080123&style=gitweb',
'', <!-- NEXTHASH
- function (htmlText, previousVal) {
+ function (htmlText) {
var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
return m ? m[1] : null;
},
--- a/tests/test-hgweb-empty.t Sun Jan 14 20:06:56 2018 -0800
+++ b/tests/test-hgweb-empty.t Mon Jan 15 19:44:18 2018 +0800
@@ -96,7 +96,7 @@
ajaxScrollInit(
'/shortlog/%next%',
'', <!-- NEXTHASH
- function (htmlText, previousVal) {
+ function (htmlText) {
var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
return m ? m[1] : null;
},
@@ -207,7 +207,7 @@
ajaxScrollInit(
'/shortlog/%next%',
'', <!-- NEXTHASH
- function (htmlText, previousVal) {
+ function (htmlText) {
var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
return m ? m[1] : null;
},
@@ -314,7 +314,7 @@
ajaxScrollInit(
'/graph/%next%?graphtop=0000000000000000000000000000000000000000',
'', <!-- NEXTHASH
- function (htmlText, previousVal) {
+ function (htmlText) {
var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
return m ? m[1] : null;
},