comparison mercurial/templates/static/followlines.js @ 31940:6ce09d2cc2db

hgweb: add a link to followlines in descending direction We change the content of the followlines popup to display two links inviting to follow the history of selected lines in ascending (as before) and descending directions. The popup now renders as: follow history of lines <fromline>:<toline>: <a href=...>ascending</a> / <a href=...>descending</a>
author Denis Laxalde <denis.laxalde@logilab.fr>
date Mon, 10 Apr 2017 17:36:40 +0200
parents 5c1abb4bd3ee
children a298f5c61b34
comparison
equal deleted inserted replaced
31939:604d31507f86 31940:6ce09d2cc2db
202 div.appendChild(buttonDiv); 202 div.appendChild(buttonDiv);
203 203
204 // <div class="followlines-link"> 204 // <div class="followlines-link">
205 var aDiv = document.createElement('div'); 205 var aDiv = document.createElement('div');
206 aDiv.classList.add('followlines-link'); 206 aDiv.classList.add('followlines-link');
207 207 aDiv.textContent = 'follow history of lines ' + fromline + ':' + toline + ':';
208 // <a href="/log/<rev>/<file>?patch=&linerange=..."> 208 var linesep = document.createElement('br');
209 var a = document.createElement('a'); 209 aDiv.appendChild(linesep);
210 // link to "ascending" followlines
211 var aAsc = document.createElement('a');
210 var url = targetUri + '?patch=&linerange=' + fromline + ':' + toline; 212 var url = targetUri + '?patch=&linerange=' + fromline + ':' + toline;
211 a.setAttribute('href', url); 213 aAsc.setAttribute('href', url);
212 a.textContent = 'follow lines ' + fromline + ':' + toline; 214 aAsc.textContent = 'ascending';
213 aDiv.appendChild(a); 215 aDiv.appendChild(aAsc);
216 var sep = document.createTextNode(' / ');
217 aDiv.appendChild(sep);
218 // link to "descending" followlines
219 var aDesc = document.createElement('a');
220 aDesc.setAttribute('href', url + '&descend=');
221 aDesc.textContent = 'descending';
222 aDiv.appendChild(aDesc);
223
214 div.appendChild(aDiv); 224 div.appendChild(aDiv);
215 225
216 return [div, button]; 226 return [div, button];
217 } 227 }
218 228