@@ -195,10 +195,10 @@ include file="/minisearch.jspf"
195
195
196
196
Format df = new SimpleDateFormat (" dd-MMM-yyyy" );
197
197
198
- int revision2 = Math . max(cfg. getIntParam(QueryParameters . REVISION_2_PARAM , - 1 ), 0 );
199
- int revision1 = cfg. getIntParam(QueryParameters . REVISION_1_PARAM , - 1 ) < revision2 ?
200
- revision2 + 1 : cfg. getIntParam(QueryParameters . REVISION_1_PARAM , - 1 );
201
- revision2 = revision2 >= hist. getHistoryEntries(). size() ? hist. getHistoryEntries(). size() - 1 : revision2 ;
198
+ int revision2Index = Math . max(cfg. getIntParam(QueryParameters . REVISION_2_PARAM , - 1 ), 0 );
199
+ int revision1Index = cfg. getIntParam(QueryParameters . REVISION_1_PARAM , - 1 ) < revision2Index ?
200
+ revision2Index + 1 : cfg. getIntParam(QueryParameters . REVISION_1_PARAM , - 1 );
201
+ revision2Index = revision2Index >= hist. getHistoryEntries(). size() ? hist. getHistoryEntries(). size() - 1 : revision2Index ;
202
202
203
203
int startIndex = cfg. getStartIndex();
204
204
int maxItems = cfg. getMaxItems();
@@ -229,13 +229,13 @@ document.domReady.push(function() {domReadyHistory();});
229
229
if (! cfg. isDir()) {
230
230
% >
231
231
<th ><input type =" submit" value =" Compare " />
232
- <% if (hist. getHistoryEntries(). size() > revision1 && revision1 >= 0 ) { % >
232
+ <% if (hist. getHistoryEntries(). size() > revision1Index && revision1Index >= 0 ) { % >
233
233
<input type =" hidden" id =" input_r1" name =" <%= QueryParameters . REVISION_1_PARAM % >"
234
- value =" <%= path + ' @' + hist. getHistoryEntries(). get(revision1 ). getRevision() % >" />
234
+ value =" <%= path + ' @' + hist. getHistoryEntries(). get(revision1Index ). getRevision() % >" />
235
235
<% } % >
236
- <% if (hist. getHistoryEntries(). size() > revision2 && revision2 >= 0 ) { % >
236
+ <% if (hist. getHistoryEntries(). size() > revision2Index && revision2Index >= 0 ) { % >
237
237
<input type =" hidden" id =" input_r2" name =" <%= QueryParameters . REVISION_2_PARAM % >"
238
- value =" <%= path + ' @' + hist. getHistoryEntries(). get(revision2 ). getRevision() % >" />
238
+ value =" <%= path + ' @' + hist. getHistoryEntries(). get(revision2Index ). getRevision() % >" />
239
239
<% } % >
240
240
</th ><%
241
241
}
@@ -299,34 +299,34 @@ document.domReady.push(function() {domReadyHistory();});
299
299
% > <input type =" radio"
300
300
aria-label =" From"
301
301
data-revision-1 =" <%= (startIndex + count) % >"
302
- data-revision-2 =" <%= revision2 % >"
302
+ data-revision-2 =" <%= revision2Index % >"
303
303
data-diff-revision =" <%= QueryParameters . REVISION_1_PARAM % >"
304
304
data-revision-path =" <%= path + ' @' + hist. getHistoryEntries(). get(startIndex + count). getRevision() % >"
305
305
<%
306
- if (count + startIndex > revision1 || (count + startIndex > revision2 && count + startIndex <= revision1 - 1)) {
306
+ if (count + startIndex > revision1Index || (count + startIndex > revision2Index && count + startIndex <= revision1Index - 1)) {
307
307
// revision1 enabled
308
- } else if (count + startIndex == revision1 ) {
308
+ } else if (count + startIndex == revision1Index ) {
309
309
// revision1 selected
310
310
%> checked="checked"<%
311
- } else if (count + startIndex <= revision2 ) {
311
+ } else if (count + startIndex <= revision2Index ) {
312
312
// revision1 disabled
313
313
% > disabled="disabled" <%
314
314
}
315
315
% > /><%
316
316
317
317
% > <input type =" radio"
318
318
aria-label =" To"
319
- data-revision-1 =" <%= revision1 % >"
319
+ data-revision-1 =" <%= revision1Index % >"
320
320
data-revision-2 =" <%= (startIndex + count) % >"
321
321
data-diff-revision =" <%= QueryParameters . REVISION_2_PARAM % >"
322
322
data-revision-path =" <%= path + ' @' + hist. getHistoryEntries(). get(startIndex + count). getRevision() % >"
323
323
<%
324
- if (count + startIndex < revision2 || (count + startIndex > revision2 && count + startIndex <= revision1 - 1)) {
324
+ if (count + startIndex < revision2Index || (count + startIndex > revision2Index && count + startIndex <= revision1Index - 1)) {
325
325
// revision2 enabled
326
- } else if (count + startIndex == revision2 ) {
326
+ } else if (count + startIndex == revision2Index ) {
327
327
// revision2 selected
328
328
%> checked="checked" <%
329
- } else if (count + startIndex >= revision1 ) {
329
+ } else if (count + startIndex >= revision1Index ) {
330
330
// revision2 disabled
331
331
% > disabled="disabled" <%
332
332
}
0 commit comments