Changeset 51 for branches

Show
Ignore:
Timestamp:
02/15/09 20:13:19 (3 years ago)
Author:
daris
Message:

quick search: fixed bug when enter hides form instead of submitting it + release 1.0.1

Location:
branches/quick_search
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/quick_search/manifest.xml

    r47 r51  
    44        <id>quick_search</id> 
    55        <title>Quick Search</title> 
    6         <version>1.0</version> 
     6        <version>1.0.1</version> 
    77        <description>Allows quickly search for topics and posts</description> 
    88        <author>daris</author> 
     
    1212 
    1313                <hook id="hd_head"><![CDATA[ 
    14  
     14global $lang_search; 
    1515require_once FORUM_ROOT.'lang/'.$forum_user['language'].'/search.php'; 
    1616$language_js = 'var lang_search = {\'Display results\' : \''.$lang_search['Display results'].'\', \'Show as topics\' : \''.$lang_search['Show as topics'].'\', \'Show as posts\' : \''.$lang_search['Show as posts'].'\', \'Submit search\' : \''.$lang_search['Submit search'].'\', \'Perform new search\' : \''.$lang_search['Perform new search'].'\'};'; 
  • branches/quick_search/scripts.js

    r47 r51  
    1010 
    1111/* 
    12         Shows popup popup 
     12        Shows popup 
    1313*/ 
    1414function quick_search() 
     
    2828        popup.onmouseout = function () {quick_search_popup_hovered = false} 
    2929 
    30         popup.innerHTML = '<form action="' + url_search + '" method="get"><div>' + 
     30        popup.innerHTML = '<form id="quick_search_form" action="' + url_search + '" method="get"><div>' + 
    3131                        '<input type="hidden" name="action" value="search" />' +  
    32                         '<input type="text" size="20" id="quick_search" name="keywords" /><input type="submit" value="' + lang_search['Submit search'] + '" name="search" />' + 
     32                        '<input type="text" size="20" id="quick_search" name="keywords" onkeypress="quick_search_onchange(event)" /><input type="submit" value="' + lang_search['Submit search'] + '" name="search" />' + 
    3333                        '</div><div>' + lang_search['Display results'] + ': ' +  
    3434                        '<input type="radio" id="show_as_topics" name="show_as" value="topics" checked="checked" /><label for="show_as_topics">' + lang_search['Show as topics'] + '</label> ' +  
     
    5454 
    5555/* 
    56         Hides popup popup 
     56        Hides popup 
    5757*/ 
    5858function hide_quick_search_popup() 
     
    6666 
    6767 
     68 
     69function quick_search_onchange(e) 
     70{ 
     71        if (e.keyCode == 13) 
     72                document.getElementById('quick_search_form').submit(); 
     73} 
    6874 
    6975/*