Changeset 2982


Ignore:
Timestamp:
06/30/10 10:17:50 (14 years ago)
Author:
amuller
Message:

Ticket #1121 - Implementando teclado virtual no login para quem quer usar

Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/templates/default/config.tpl

    r2876 r2982  
    8585      <option value="">{lang_No}</option> 
    8686      <option value="True"{selected_login_show_language_selection_True}>{lang_Yes}</option> 
     87     </select> 
     88    </td> 
     89   </tr> 
     90   <tr class="row_on"> 
     91    <td>{lang_enable_virtual_keyboard_on_login}:</td> 
     92    <td> 
     93     <select name="newsettings[login_virtual_keyboard]"> 
     94      <option value="">{lang_No}</option> 
     95      <option value="True"{selected_login_virtual_keyboard_True}>{lang_Yes}</option> 
    8796     </select> 
    8897    </td> 
  • trunk/phpgwapi/templates/default/login.tpl

    r2265 r2982  
    4242                Window1=window.open(link,'',"width="+newWidth+",height="+newHeight+",screenX="+newScreenX+",left="+newScreenX+",screenY="+newScreenY+",top="+newScreenY+",toolbar=no,scrollbars=yes,resizable=no");                              
    4343        }        
     44 
     45        var opened = false, vkb = null, text = null; 
     46        var userstr = navigator.userAgent.toLowerCase(); 
     47        var safari = (userstr.indexOf('applewebkit') != -1); 
     48        var gecko  = (userstr.indexOf('gecko') != -1) && !safari; 
     49        function loadvkbd(){ 
     50                if(typeof(VKeyboard) == 'function') 
     51                        keyb_change(); 
     52                else 
     53                { 
     54                        vkbdscript=document.createElement('SCRIPT'); 
     55                        vkbdscript.src="phpgwapi/js/expressoAjax/vkboards.js"; 
     56                        vkbdscript.onload = keyb_change; 
     57                        if(gecko || window.opera || safari) 
     58                                vkbdscript.onload = keyb_change; 
     59                        else 
     60                                setTimeout('keyb_change()',3000);  
     61                        document.body.appendChild(vkbdscript); 
     62                } 
     63        } 
     64 
     65   var opened = false, vkb = null, text = null; 
     66 
     67   function keyb_change() 
     68   { 
     69     opened = !opened; 
     70 
     71     if(opened && !vkb) 
     72     { 
     73       vkb = new VKeyboard("keyboard",    // container's id 
     74                           keyb_callback, // reference to the callback function 
     75                           false,          // create the arrow keys or not? (this and the following params are optional) 
     76                           false,          // create up and down arrow keys?  
     77                           false,         // reserved 
     78                           false,          // create the numpad or not? 
     79                           "",            // font name ("" == system default) 
     80                           "14px",        // font size in px 
     81                           "#FFF",        // font color 
     82                           "#F00",        // font color for the dead keys 
     83                           "#83a6ce",        // keyboard base background color 
     84                           "#28599e",        // keys' background color 
     85                           "#DDD",        // background color of switched/selected item 
     86                           "#777",        // border color 
     87                           "#CCC",        // border/font color of "inactive" key (key with no value/disabled) 
     88                           "#83a6ce",        // background color of "inactive" key (key with no value/disabled) 
     89                           "#F77",        // border color of the language selector's cell 
     90                           true,          // show key flash on click? (false by default) 
     91                           "#CC3300",     // font color during flash 
     92                           "#FF9966",     // key background color during flash 
     93                           "#CC3300",     // key border color during flash 
     94                           false,         // embed VKeyboard into the page? 
     95                           true,          // use 1-pixel gap between the keys? 
     96                           0);            // index(0-based) of the initial layout 
     97     } 
     98     else 
     99       vkb.Show(opened); 
     100 
     101     text = document.getElementById("passwd"); 
     102     text.focus(); 
     103     if (!(gecko || window.opera || safari)) 
     104     { 
     105        document.getElementById('keyboard').style.left = "0px"; 
     106        document.getElementById('rodape').style.zIndex="-100"; 
     107     } 
     108 
     109   } 
     110   // Callback function: 
     111   function keyb_callback(ch) 
     112   { 
     113     var val = text.value; 
     114 
     115     switch(ch) 
     116     { 
     117       case "BackSpace": 
     118         var min = (val.charCodeAt(val.length - 1) == 10) ? 2 : 1; 
     119         text.value = val.substr(0, val.length - min); 
     120         break; 
     121 
     122       case "Enter": 
     123         document.getElementById('loginForm').submit(); 
     124         break; 
     125 
     126       default: 
     127         text.value += ch; 
     128     } 
     129   } 
     130 function setRange(ctrl, start, end){ 
     131 } 
    44132        --> 
    45133</script> 
    46134</HEAD> 
    47135<body scroll="no"  style="overflow:hidden" onLoad="javascript:getLogin()" bgcolor="#ffffff"> 
    48 <form name="flogin" method="post" action="{login_url}" {autocomplete}> 
     136<form id="loginForm" name="flogin" method="post" action="{login_url}" {autocomplete}> 
    49137<div id="conteudo"> 
    50138<div style="position: absolute; top:0px; right: 10px;"><span class="login_label">{lang_language}&nbsp;&nbsp;</span>{select_language}</div> 
     
    73161                <br /> 
    74162                <input class="input" type="password" maxlength="50" size="20" name="passwd" id="passwd" value=""> 
     163              <div id="keyboard"></div> 
    75164              </div> 
    76                 {captcha} 
    77        
     165                {captcha}  
    78166              <input value="{lang_login}" name="submitit" class="button" onclick="javascript:setLogin()" type="submit" style="margin-top:10px"/> 
     167              <img style="display:{show_kbd};" src="phpgwapi/templates/default/images/keyboard.png" alt="virtualkeyboard" title="virtualkeyboard" onclick="loadvkbd()" /> 
     168 
    79169            </div>  
    80170<div style="margin-top:5px"> 
  • trunk/phpgwapi/templates/default/login_default.php

    r2849 r2982  
    371371        $var['logo_title'] = $GLOBALS['phpgw_info']['server']['login_logo_title']?$GLOBALS['phpgw_info']['server']['login_logo_title']:'www.eGroupWare.org'; 
    372372        $tmpl->set_var($var); 
     373         
     374        if (!@$GLOBALS['phpgw_info']['server']['login_virtual_keyboard']) 
     375                $tmpl->set_var('show_kbd','none'); 
     376 
    373377 
    374378        if (@$GLOBALS['phpgw_info']['server']['login_show_language_selection']) 
Note: See TracChangeset for help on using the changeset viewer.