# HG changeset patch # User Dan # Date 1229919543 18000 # Node ID c9c49ce179e91cbed779947aa2ea335ec1dca3dd # Parent 4d19ad17b07cae13927f51966bb5e9a651c85a5c Minor change to JS code: runs as soon as available, not onload anymore diff -r 4d19ad17b07c -r c9c49ce179e9 Floodlight.php --- a/Floodlight.php Sun Dec 21 23:10:15 2008 -0500 +++ b/Floodlight.php Sun Dec 21 23:19:03 2008 -0500 @@ -98,34 +98,31 @@ $aggressive_optimize_html = false; echo << ' + type + ''; - html += '
' + \$lang.get('floodlight_lbl_score') + row.score + '% | ' + row.size + ''; - return html; - }, - tableHeader: '' + \$lang.get('floodlight_table_heading') + '', - showWhenNoResults: true, - onItemSelect: function(li) - { - window.location = makeUrl(li.selectValue.replace(/^go:/, '')); - }, - width: 300, - noResultsHTML: '' + \$lang.get('floodlight_msg_no_results') + '', - }); - } - }; -}); +var autofill_schemas = window.autofill_schemas || {}; +autofill_schemas.floodlight = { + init: function(element, fillclass, params) + { + params = params || {}; + $(element).autocomplete(makeUrlNS('Special', 'Autofill', 'type=' + fillclass) + '&userinput=', { + minChars: 3, + formatItem: function(row, _, __) + { + var type = ( typeof(row.type) == 'string' ) ? row.type : ''; + var html = '' + row.title + ' ' + type + ''; + html += '
' + \$lang.get('floodlight_lbl_score') + row.score + '% | ' + row.size + ''; + return html; + }, + tableHeader: '' + \$lang.get('floodlight_table_heading') + '', + showWhenNoResults: true, + onItemSelect: function(li) + { + window.location = makeUrl(li.selectValue.replace(/^go:/, '')); + }, + width: 300, + noResultsHTML: '' + \$lang.get('floodlight_msg_no_results') + '', + }); + } +}; EOF; }