130 |
load record nr in some template |
load record nr in some template |
131 |
*/ |
*/ |
132 |
|
|
133 |
function load_rec(nr, tmp_template_filename) { |
function load_rec(record_uri, tmp_template_filename) { |
134 |
if (! tmp_template_filename) tmp_template_filename = template_filename; |
if (! tmp_template_filename) tmp_template_filename = template_filename; |
135 |
Logger.info('load_rec '+nr+' in '+tmp_template_filename); |
Logger.info('load_rec '+record_uri+' in '+tmp_template_filename); |
136 |
|
|
137 |
var results_form = $('results_form'); |
var results_form = $('results_form'); |
138 |
|
|
139 |
if (results_form) { |
if (results_form) { |
140 |
var args = '?mfn='+nr+'&template_filename='+tmp_template_filename; |
var args = '?record_uri='+record_uri+'&template_filename='+tmp_template_filename; |
141 |
Logger.debug('Ajax.Updater(results,/search/record) '+args); |
Logger.debug('Ajax.Updater(results,/search/record) '+args); |
142 |
|
|
143 |
new Ajax.Updater( 'results', '/search/record'+args, { |
new Ajax.Updater( 'results', '/search/record'+args, { |
167 |
hopefully, this implementation won't break when I update prototype next time :-) |
hopefully, this implementation won't break when I update prototype next time :-) |
168 |
*/ |
*/ |
169 |
|
|
170 |
Object.extend(Object.extend(Ajax.Autocompleter.prototype, Autocompleter.Base.prototype), { |
|
171 |
|
Ajax.Suggest = Class.create(); |
172 |
|
Logger.debug('Created Ajax.Suggest Class'); |
173 |
|
Object.extend(Object.extend(Ajax.Suggest.prototype, Ajax.Autocompleter.prototype), { |
174 |
initialize: function(element, update, url, options) { |
initialize: function(element, update, url, options) { |
175 |
this.baseInitialize(element, update, options); |
this.baseInitialize(element, update, options); |
176 |
this.options.asynchronous = true; |
this.options.asynchronous = true; |
179 |
this.url = url; |
this.url = url; |
180 |
this.ignoreReturn = true; |
this.ignoreReturn = true; |
181 |
|
|
182 |
|
Logger.debug('Ajax.Sugget initialize '+element+','+update+','+url); |
183 |
|
|
184 |
this.options.onShow = function(element, update) { |
this.options.onShow = function(element, update) { |
185 |
if(!update.style.position || update.style.position=='absolute') { |
if(!update.style.position || update.style.position=='absolute') { |
186 |
update.style.position = 'absolute'; |
update.style.position = 'absolute'; |
223 |
markNext: function() { |
markNext: function() { |
224 |
if(this.index < this.entryCount-1) this.index++ |
if(this.index < this.entryCount-1) this.index++ |
225 |
// else this.index = 0; |
// else this.index = 0; |
226 |
}, |
} |
227 |
|
|
228 |
}); |
}); |
229 |
|
|
230 |
|
|