96 |
96 |
97 global $aggressive_optimize_html; |
97 global $aggressive_optimize_html; |
98 $aggressive_optimize_html = false; |
98 $aggressive_optimize_html = false; |
99 |
99 |
100 echo <<<EOF |
100 echo <<<EOF |
101 addOnloadHook(function() |
101 var autofill_schemas = window.autofill_schemas || {}; |
102 { |
102 autofill_schemas.floodlight = { |
103 var autofill_schemas = window.autofill_schemas || {}; |
103 init: function(element, fillclass, params) |
104 autofill_schemas.floodlight = { |
104 { |
105 init: function(element, fillclass, params) |
105 params = params || {}; |
106 { |
106 $(element).autocomplete(makeUrlNS('Special', 'Autofill', 'type=' + fillclass) + '&userinput=', { |
107 params = params || {}; |
107 minChars: 3, |
108 $(element).autocomplete(makeUrlNS('Special', 'Autofill', 'type=' + fillclass) + '&userinput=', { |
108 formatItem: function(row, _, __) |
109 minChars: 3, |
109 { |
110 formatItem: function(row, _, __) |
110 var type = ( typeof(row.type) == 'string' ) ? row.type : ''; |
111 { |
111 var html = '<big>' + row.title + '</big> <small>' + type + '</small>'; |
112 var type = ( typeof(row.type) == 'string' ) ? row.type : ''; |
112 html += '<br /><small>' + \$lang.get('floodlight_lbl_score') + row.score + '% | ' + row.size + '</small>'; |
113 var html = '<big>' + row.title + '</big> <small>' + type + '</small>'; |
113 return html; |
114 html += '<br /><small>' + \$lang.get('floodlight_lbl_score') + row.score + '% | ' + row.size + '</small>'; |
114 }, |
115 return html; |
115 tableHeader: '<tr><th>' + \$lang.get('floodlight_table_heading') + '</th></tr>', |
116 }, |
116 showWhenNoResults: true, |
117 tableHeader: '<tr><th>' + \$lang.get('floodlight_table_heading') + '</th></tr>', |
117 onItemSelect: function(li) |
118 showWhenNoResults: true, |
118 { |
119 onItemSelect: function(li) |
119 window.location = makeUrl(li.selectValue.replace(/^go:/, '')); |
120 { |
120 }, |
121 window.location = makeUrl(li.selectValue.replace(/^go:/, '')); |
121 width: 300, |
122 }, |
122 noResultsHTML: '<tr><td class="row1" style="font-size: smaller;">' + \$lang.get('floodlight_msg_no_results') + '</td></tr>', |
123 width: 300, |
123 }); |
124 noResultsHTML: '<tr><td class="row1" style="font-size: smaller;">' + \$lang.get('floodlight_msg_no_results') + '</td></tr>', |
124 } |
125 }); |
125 }; |
126 } |
|
127 }; |
|
128 }); |
|
129 EOF; |
126 EOF; |
130 } |
127 } |
131 |
128 |
132 /**!language** |
129 /**!language** |
133 |
130 |