mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 23:07:18 +03:00
hgweb: avoid invalid infinity scroll request when overwritten web.style
Infinity scroll is broken when you override the web.style in the following ways: $ hg --config='web.style=gitweb' serve $ open http://localhost:8080/shortlog?style=paper ajaxScrollInit should use http://localhost:8080/shortlog/%next%?style=paper. however, http://localhost:8080/shortlog/%next% is used actually. It is missing style parameter. This patch add style parameter to request url.
This commit is contained in:
parent
96e1c44734
commit
db72b3b5e8
@ -373,6 +373,7 @@ class hgweb(object):
|
||||
"motd": motd,
|
||||
"sessionvars": sessionvars,
|
||||
"pathdef": makebreadcrumb(req.url),
|
||||
"style": style,
|
||||
})
|
||||
return tmpl
|
||||
|
||||
|
@ -448,7 +448,9 @@ class hgwebdir(object):
|
||||
"logourl": logourl,
|
||||
"logoimg": logoimg,
|
||||
"staticurl": staticurl,
|
||||
"sessionvars": sessionvars})
|
||||
"sessionvars": sessionvars,
|
||||
"style": style,
|
||||
})
|
||||
return tmpl
|
||||
|
||||
def updatereqenv(self, env):
|
||||
|
@ -124,7 +124,7 @@ graph.render(data);
|
||||
|
||||
<script type="text/javascript">
|
||||
ajaxScrollInit(
|
||||
'{url|urlescape}graph/{rev}?revcount=%next%',
|
||||
'{url|urlescape}graph/{rev}?revcount=%next%&style={style}',
|
||||
{revcount}+60,
|
||||
function (htmlText, previousVal) \{ return previousVal + 60; },
|
||||
'#wrapper',
|
||||
|
@ -73,7 +73,7 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
ajaxScrollInit(
|
||||
'{url|urlescape}shortlog/%next%',
|
||||
'{url|urlescape}shortlog/%next%{sessionvars%urlparameter}',
|
||||
'{nextentry%"{node}"}', <!-- NEXTHASH
|
||||
function (htmlText, previousVal) \{
|
||||
var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
|
||||
|
@ -361,7 +361,7 @@ Some tests for hgweb in an empty repository
|
||||
|
||||
<script type="text/javascript">
|
||||
ajaxScrollInit(
|
||||
'/graph/-1?revcount=%next%',
|
||||
'/graph/-1?revcount=%next%&style=paper',
|
||||
60+60,
|
||||
function (htmlText, previousVal) { return previousVal + 60; },
|
||||
'#wrapper',
|
||||
|
Loading…
Reference in New Issue
Block a user