Changeset 49 for branches/go_to_page

Show
Ignore:
Timestamp:
02/15/09 12:18:29 (3 years ago)
Author:
daris
Message:

go to page: fixed closing popup when user press enter and mouse is outside popup + releasing 1.1 version

Location:
branches/go_to_page
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/go_to_page/manifest.xml

    r45 r49  
    44        <id>go_to_page</id> 
    55        <title>Go To Page</title> 
    6         <version>1.0</version> 
     6        <version>1.1</version> 
    77        <description>Allows quickly go to the specified page</description> 
    88        <author>daris</author> 
     
    2727        $forum_head['go_to_page_js'] = '<script type="text/javascript" src="'.$ext_info['url'].'/scripts.js"></script>'; 
    2828        $forum_head['go_to_page_js2'] = '<script type="text/javascript"">var current_url = "'.get_current_url().'"; '.$get.' var lang_common_go = \''.$lang_common['Go'].'\'; var url_page = \''.$forum_url['page'].'\';</script>'; 
    29         $forum_head['ape_css'] = '<link rel="stylesheet" type="text/css" media="screen" href="'.$ext_info['url'].'/style.css" />'; 
     29        $forum_head['go_to_page_css'] = '<link rel="stylesheet" type="text/css" media="screen" href="'.$ext_info['url'].'/style.css" />'; 
    3030 
    3131                                             ]]></hook> 
  • branches/go_to_page/scripts.js

    r46 r49  
    33 
    44/* 
    5         Shows popup popup 
     5        Shows popup 
    66*/ 
    77function go_to_page(element, link) 
    88{ 
     9        if (document.getElementById('go_to_page_popup')) 
     10        { 
     11                hide_go_to_page_popup(); 
     12                return; 
     13        } 
     14 
    915        var pos = findPos(element); 
    1016        pos[1] += element.offsetHeight + 3; 
     
    3036        } 
    3137 
    32         popup.innerHTML = '<form action="' + link + '" method="get">' + hidden + '<input type="text" size="3" id="go_to_page" name="p"' + (page != 0 ? ' value="' + page + '"' : '') +'/><input type="submit" value="' + lang_common_go + '" /></form>'; 
     38        popup.innerHTML = '<form id="go_to_page_form" action="' + link + '" method="get">' + hidden + '<input type="text" size="3" id="go_to_page" name="p"' + (page != 0 ? ' value="' + page + '"' : '') +' onkeypress="go_to_page_onkeypress(event)" /><input type="submit" value="' + lang_common_go + '" /></form>'; 
    3339 
    3440        document.body.appendChild(popup); 
     
    4753 
    4854/* 
    49         Hides popup popup 
     55        Hides popup 
    5056*/ 
    5157function hide_go_to_page_popup() 
     
    5662} 
    5763 
     64 
     65/* 
     66        Workaround for closing popup when user press Enter and mouse is outside popup 
     67*/ 
     68function go_to_page_onkeypress(e) 
     69{ 
     70        if (e.keyCode == 13) 
     71                document.getElementById('go_to_page_form').submit(); 
     72} 
    5873 
    5974