Lines 27-32
function paramOfUrl( url, param ) {
Link Here
|
27 |
} |
27 |
} |
28 |
|
28 |
|
29 |
function addBibToContext( bibnum ) { |
29 |
function addBibToContext( bibnum ) { |
|
|
30 |
if ( ! global_pref_BrowseResultSelection ) return; |
30 |
bibnum = parseInt(bibnum, 10); |
31 |
bibnum = parseInt(bibnum, 10); |
31 |
var bibnums = getContextBiblioNumbers(); |
32 |
var bibnums = getContextBiblioNumbers(); |
32 |
bibnums.push(bibnum); |
33 |
bibnums.push(bibnum); |
Lines 35-46
function addBibToContext( bibnum ) {
Link Here
|
35 |
} |
36 |
} |
36 |
|
37 |
|
37 |
function delBibToContext( bibnum ) { |
38 |
function delBibToContext( bibnum ) { |
|
|
39 |
if ( ! global_pref_BrowseResultSelection ) return; |
38 |
var bibnums = getContextBiblioNumbers(); |
40 |
var bibnums = getContextBiblioNumbers(); |
39 |
removeByValue( bibnums, bibnum ); |
41 |
removeByValue( bibnums, bibnum ); |
40 |
setContextBiblioNumbers( $.uniqueArray( bibnums ) ); |
42 |
setContextBiblioNumbers( $.uniqueArray( bibnums ) ); |
41 |
} |
43 |
} |
42 |
|
44 |
|
43 |
function setContextBiblioNumbers( bibnums ) { |
45 |
function setContextBiblioNumbers( bibnums ) { |
|
|
46 |
if ( ! global_pref_BrowseResultSelection ) return; |
47 |
|
44 |
$.cookie('bibs_selected', JSON.stringify( bibnums )); |
48 |
$.cookie('bibs_selected', JSON.stringify( bibnums )); |
45 |
} |
49 |
} |
46 |
|
50 |
|
Lines 54-73
function getContextBiblioNumbers() {
Link Here
|
54 |
} |
58 |
} |
55 |
|
59 |
|
56 |
function resetSearchContext() { |
60 |
function resetSearchContext() { |
57 |
setContextBiblioNumbers( new Array() ); |
61 |
if ( global_pref_BrowseResultSelection ) { |
|
|
62 |
setContextBiblioNumbers( new Array() ); |
63 |
} else { |
64 |
$.cookie('bibs_selected', '', { 'path': '/', 'expires': -1 }); |
65 |
} |
58 |
} |
66 |
} |
59 |
|
67 |
|
60 |
$(document).ready(function(){ |
68 |
$(document).ready(function(){ |
61 |
// forms with action leading to search |
69 |
|
62 |
$("form[action*='search.pl']").submit(function(){ |
70 |
if ( ! global_pref_BrowseResultSelection ) { |
63 |
resetSearchContext(); |
71 |
// forms with action leading to search |
64 |
}); |
72 |
$("form[action*='search.pl']").submit(function(){ |
65 |
// any link to launch a search except navigation links |
73 |
resetSearchContext(); |
66 |
$("[href*='search.pl?']").not(".nav").not('.searchwithcontext').click(function(){ |
74 |
}); |
67 |
resetSearchContext(); |
75 |
// any link to launch a search except navigation links |
68 |
}); |
76 |
$("[href*='search.pl?']").not(".nav").not('.searchwithcontext').click(function(){ |
69 |
// any link to a detail page from the results page. |
77 |
resetSearchContext(); |
70 |
$("#bookbag_form a[href*='detail.pl?']").click(function(){ |
78 |
}); |
71 |
resetSearchContext(); |
79 |
// any link to a detail page from the results page. |
72 |
}); |
80 |
$("#bookbag_form a[href*='detail.pl?']").click(function(){ |
|
|
81 |
resetSearchContext(); |
82 |
}); |
83 |
} |
73 |
}); |
84 |
}); |
74 |
- |
|
|