Floodlight.php
changeset 2 8d081d3128a2
parent 1 c9c49ce179e9
child 3 45a2d33c0d1b
equal deleted inserted replaced
1:c9c49ce179e9 2:8d081d3128a2
    28   }
    28   }
    29   else
    29   else
    30   {
    30   {
    31     return;
    31     return;
    32   }
    32   }
    33   $hackme = str_replace('<input name="q"', '<input name="q" autocomplete="off" onkeyup="this.onkeyup = null; this.className = \'autofill floodlight\'; autofill_init_element(this, {});"', $hackme);
    33   $hackme = str_replace('<input name="q"', '<input name="q" autocomplete="off" onkeyup="this.setAttribute(\'autocomplete\', \'off\'); this.onkeyup = null; this.className = \'autofill floodlight\'; autofill_init_element(this, {});"', $hackme);
    34 }
    34 }
    35 
    35 
    36 function floodlight_perform_search(&$dataset)
    36 function floodlight_perform_search(&$dataset)
    37 {
    37 {
    38   global $db, $session, $paths, $template, $plugins; // Common objects
    38   global $db, $session, $paths, $template, $plugins; // Common objects
   116         showWhenNoResults: true,
   116         showWhenNoResults: true,
   117         onItemSelect: function(li)
   117         onItemSelect: function(li)
   118         {
   118         {
   119           window.location = makeUrl(li.selectValue.replace(/^go:/, ''));
   119           window.location = makeUrl(li.selectValue.replace(/^go:/, ''));
   120         },
   120         },
   121         width: 300,
   121         width: 180,
   122         noResultsHTML: '<tr><td class="row1" style="font-size: smaller;">' + \$lang.get('floodlight_msg_no_results') + '</td></tr>',
   122         noResultsHTML: '<tr><td class="row1" style="font-size: smaller;">' + \$lang.get('floodlight_msg_no_results') + '</td></tr>',
   123     });
   123     });
   124   }
   124   }
   125 };
   125 };
       
   126 
       
   127 function AutofillFloodlight(el, p)
       
   128 {
       
   129   p = p || {};
       
   130   var cn_append = ( el.className ) ? ' ' + el.className : '';
       
   131   el.className = 'autofill floodlight' + cn_append;
       
   132   el.onkeyup = null;
       
   133   autofill_init_element(el, p);
       
   134 }
       
   135 
       
   136 addOnloadHook(function()
       
   137   {
       
   138     if ( document.forms[0] && document.forms[0].q )
       
   139     {
       
   140       document.forms[0].q.onkeyup = function() {
       
   141         new AutofillFloodlight(this);
       
   142       };
       
   143     }
       
   144   });
   126 EOF;
   145 EOF;
   127 }
   146 }
   128 
   147 
   129 /**!language**
   148 /**!language**
   130 
   149