82 |
/* toggle visibility and replace text with something else */ |
/* toggle visibility and replace text with something else */ |
83 |
function toggleLinkAndElement ( link, elementID, text ) { |
function toggleLinkAndElement ( link, elementID, text ) { |
84 |
|
|
|
Element.toggle( elementID ); // toggle the element |
|
|
|
|
85 |
if ( link.innerHTML != text ) { |
if ( link.innerHTML != text ) { |
86 |
// change link text |
// change link text |
87 |
link.oldInnerHTML = link.innerHTML; |
link.oldInnerHTML = link.innerHTML; |
91 |
link.innerHTML = link.oldInnerHTML; |
link.innerHTML = link.oldInnerHTML; |
92 |
} |
} |
93 |
|
|
94 |
|
Logger.debug('toggleLinkAndElement '+elementID+': '+Element.visible( elementID )+' text: '+text); |
95 |
|
|
96 |
|
Element.toggle( elementID ); |
97 |
|
|
98 |
|
// why is this needed, Firefox 1.5? |
99 |
|
if (Element.visible( elementID )) $( elementID ).style.display = 'block'; |
100 |
|
|
101 |
return false; |
return false; |
102 |
} |
} |
103 |
|
|
111 |
if (results_form) { |
if (results_form) { |
112 |
var form_params = Form.serialize( results_form ); |
var form_params = Form.serialize( results_form ); |
113 |
|
|
114 |
Logger.debug('Ajax.Updater(results,/results) '+form_params); |
Logger.debug('Ajax.Updater(results,/results/ajax) '+form_params); |
115 |
|
|
116 |
new Ajax.Updater( 'results', '/search/results', { |
new Ajax.Updater( 'results', '/search/results/ajax', { |
117 |
parameters: form_params, |
parameters: form_params, |
118 |
asynchronous: 1, |
asynchronous: 1, |
119 |
onLoading: function(request) { |
onLoading: function(request) { |
262 |
Object.extend(WebPAC.Updater.prototype, { |
Object.extend(WebPAC.Updater.prototype, { |
263 |
initialize: function(container, url, options) { |
initialize: function(container, url, options) { |
264 |
Logger.debug('WebPAC.Updater initialize '+container+','+url+','+options); |
Logger.debug('WebPAC.Updater initialize '+container+','+url+','+options); |
265 |
|
url += '/ajax'; |
266 |
this.updater = new Ajax.Updater(container, url, options); |
this.updater = new Ajax.Updater(container, url, options); |
267 |
$('_ajax').value = 1; |
$('_ajax').value = 1; |
268 |
if ($('_ajax').value) Logger.info("using AJAX"); |
if ($('_ajax').value) Logger.info("using AJAX"); |