Lines 5-22
KOHA.browser = function (searchid, biblionumber) {
Link Here
|
5 |
this.searchid = searchid; |
5 |
this.searchid = searchid; |
6 |
|
6 |
|
7 |
if (me.searchid) { |
7 |
if (me.searchid) { |
8 |
var cookie = $.cookie(searchid) |
8 |
var cookie = $.cookie(me.searchid) |
9 |
if (cookie) { |
9 |
if (cookie) { |
10 |
me.searchCookie = JSON.parse(cookie); |
10 |
me.searchCookie = JSON.parse(cookie); |
11 |
} |
11 |
} |
12 |
} |
12 |
} |
13 |
|
13 |
|
14 |
var browseRecords = function (searchid, movement) { |
14 |
var browseRecords = function (movement) { |
15 |
var newSearchPos = me.curPos + movement; |
15 |
var newSearchPos = me.curPos + movement; |
16 |
if (newSearchPos > me.searchCookie.results.length - 1) { |
16 |
if (newSearchPos > me.searchCookie.results.length - 1) { |
17 |
window.location = '/cgi-bin/koha/catalogue/search.pl?' + decodeURIComponent(me.searchCookie.query) + '&limit=' + decodeURIComponent(me.searchCookie.limit) + '&sort=' + me.searchCookie.sort + '&gotoPage=detail.pl&gotoNumber=first&searchid=' + searchid + '&offset=' + newSearchPos; |
17 |
window.location = '/cgi-bin/koha/catalogue/search.pl?' + decodeURIComponent(me.searchCookie.query) + '&limit=' + decodeURIComponent(me.searchCookie.limit) + '&sort=' + me.searchCookie.sort + '&gotoPage=detail.pl&gotoNumber=first&searchid=' + me.searchid + '&offset=' + newSearchPos; |
18 |
} else if (newSearchPos < 0) { |
18 |
} else if (newSearchPos < 0) { |
19 |
window.location = '/cgi-bin/koha/catalogue/search.pl?' + decodeURIComponent(me.searchCookie.query) + '&limit=' + decodeURIComponent(me.searchCookie.limit) + '&sort=' + me.searchCookie.sort + '&gotoPage=detail.pl&gotoNumber=last&searchid=' + searchid + '&offset=' + (me.offset - me.searchCookie.pagelen); |
19 |
window.location = '/cgi-bin/koha/catalogue/search.pl?' + decodeURIComponent(me.searchCookie.query) + '&limit=' + decodeURIComponent(me.searchCookie.limit) + '&sort=' + me.searchCookie.sort + '&gotoPage=detail.pl&gotoNumber=last&searchid=' + me.searchid + '&offset=' + (me.offset - me.searchCookie.pagelen); |
20 |
} else { |
20 |
} else { |
21 |
window.location = window.location.href.replace('biblionumber=' + biblionumber, 'biblionumber=' + me.searchCookie.results[newSearchPos]); |
21 |
window.location = window.location.href.replace('biblionumber=' + biblionumber, 'biblionumber=' + me.searchCookie.results[newSearchPos]); |
22 |
} |
22 |
} |
Lines 86-96
KOHA.browser = function (searchid, biblionumber) {
Link Here
|
86 |
$('#menu').before('<div class="browse-controls"><div class="browse-controls-inner"><div class="browse-label"><a href="' + searchURL + '" id="browse-return-to-results" class="browse-button">' + BROWSER_RETURN_TO_SEARCH + '</a></div><div class="browse-prev-next">' + prevbutton + nextbutton + '</div></div></div>'); |
86 |
$('#menu').before('<div class="browse-controls"><div class="browse-controls-inner"><div class="browse-label"><a href="' + searchURL + '" id="browse-return-to-results" class="browse-button">' + BROWSER_RETURN_TO_SEARCH + '</a></div><div class="browse-prev-next">' + prevbutton + nextbutton + '</div></div></div>'); |
87 |
$('a#browse-previous').click(function (ev) { |
87 |
$('a#browse-previous').click(function (ev) { |
88 |
ev.preventDefault(); |
88 |
ev.preventDefault(); |
89 |
browseRecords(searchid, -1); |
89 |
browseRecords(-1); |
90 |
}); |
90 |
}); |
91 |
$('a#browse-next').click(function (ev) { |
91 |
$('a#browse-next').click(function (ev) { |
92 |
ev.preventDefault(); |
92 |
ev.preventDefault(); |
93 |
browseRecords(me.searchid, 1); |
93 |
browseRecords(1); |
94 |
}); |
94 |
}); |
95 |
$('a[href*="biblionumber="]').click(function (ev) { |
95 |
$('a[href*="biblionumber="]').click(function (ev) { |
96 |
ev.preventDefault(); |
96 |
ev.preventDefault(); |
97 |
- |
|
|