Changeset 3191


Ignore:
Timestamp:
09/01/10 10:48:46 (14 years ago)
Author:
amuller
Message:

Ticket #1121 - Implementação do teclado virtual no login do branches 22

Location:
branches/2.2
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/admin/templates/default/config.tpl

    r3052 r3191  
    7777    <td colspan="2">&nbsp;<b>{lang_security}</b></td> 
    7878   </tr> 
    79  
    80    <tr class="row_off"> 
     79   <tr class="row_on">  
     80        <td>{lang_enable_virtual_keyboard_on_login}:</td>  
     81        <td> 
     82           <select name="newsettings[login_virtual_keyboard]">  
     83           <option value="">{lang_No}</option>  
     84           <option value="True"{selected_login_virtual_keyboard_True}>{lang_Yes}</option>  
     85           </select>  
     86        </td>  
     87   </tr> 
     88<tr class="row_off"> 
    8189    <td valign="top"> 
    8290Nome, um ponto-e-virgula como separador, e o caminho completo para os drivers dos tokens  
  • branches/2.2/phpgwapi/templates/default/login.tpl

    r1860 r3191  
    4141                newScreenY  = 0;                 
    4242                Window1=window.open(link,'',"width="+newWidth+",height="+newHeight+",screenX="+newScreenX+",left="+newScreenX+",screenY="+newScreenY+",top="+newScreenY+",toolbar=no,scrollbars=yes,resizable=no");                              
    43         }        
     43        } 
     44        var opened = false, vkb = null, text = null;  
     45        var userstr = navigator.userAgent.toLowerCase();  
     46        var safari = (userstr.indexOf('applewebkit') != -1);  
     47        var gecko  = (userstr.indexOf('gecko') != -1) && !safari;  
     48        function loadvkbd(){  
     49                if(typeof(VKeyboard) == 'function')  
     50                        keyb_change();  
     51                else  
     52                {  
     53                        vkbdscript=document.createElement('SCRIPT');  
     54                        vkbdscript.src="phpgwapi/js/jscode/vkboards.js";  
     55                        vkbdscript.onload = keyb_change;  
     56                        if(gecko || window.opera || safari)  
     57                                vkbdscript.onload = keyb_change;  
     58                        else  
     59                                setTimeout('keyb_change()',3000);   
     60                        document.body.appendChild(vkbdscript);  
     61                }  
     62        }  
     63  
     64   var opened = false, vkb = null, text = null;  
     65  
     66   function keyb_change()  
     67   {  
     68     opened = !opened;  
     69  
     70     if(opened && !vkb)  
     71     {  
     72       vkb = new VKeyboard("keyboard",    // container's id  
     73                           keyb_callback, // reference to the callback function  
     74                           false,          // create the arrow keys or not? (this and the following params are optional)  
     75                           false,          // create up and down arrow keys?   
     76                           false,         // reserved  
     77                           false,          // create the numpad or not?  
     78                           "",            // font name ("" == system default)  
     79                           "14px",        // font size in px  
     80                           "#FFF",        // font color  
     81                           "#F00",        // font color for the dead keys  
     82                           "#83a6ce",        // keyboard base background color  
     83                           "#28599e",        // keys' background color  
     84                           "#DDD",        // background color of switched/selected item  
     85                           "#777",        // border color  
     86                           "#CCC",        // border/font color of "inactive" key (key with no value/disabled)  
     87                           "#83a6ce",        // background color of "inactive" key (key with no value/disabled)  
     88                           "#F77",        // border color of the language selector's cell  
     89                           true,          // show key flash on click? (false by default)  
     90                           "#CC3300",     // font color during flash  
     91                           "#FF9966",     // key background color during flash  
     92                           "#CC3300",     // key border color during flash  
     93                           false,         // embed VKeyboard into the page?  
     94                           true,          // use 1-pixel gap between the keys?  
     95                           0);            // index(0-based) of the initial layout  
     96     }  
     97     else  
     98       vkb.Show(opened);  
     99  
     100     text = document.getElementById("passwd");  
     101     text.focus();  
     102     if (!(gecko || window.opera || safari))  
     103     {  
     104        document.getElementById('keyboard').style.left = "0px";  
     105        document.getElementById('rodape').style.zIndex="-100";  
     106     }  
     107  
     108   }  
     109   // Callback function:  
     110   function keyb_callback(ch)  
     111   {  
     112     var val = text.value;  
     113  
     114     switch(ch)  
     115     {  
     116       case "BackSpace":  
     117         var min = (val.charCodeAt(val.length - 1) == 10) ? 2 : 1;  
     118         text.value = val.substr(0, val.length - min);  
     119         break;  
     120  
     121       case "Enter":  
     122         document.getElementById('loginForm').submit();  
     123         break;  
     124  
     125       default:  
     126         text.value += ch;  
     127     }  
     128   }  
     129 function setRange(ctrl, start, end){  
     130 }       
    44131        --> 
    45132</script> 
     
    53140                <div id="login"> 
    54141      <div align="center"> 
    55 <form name="flogin" method="post" action="{login_url}" {autocomplete}> 
     142<form id="loginForm" name="flogin" method="post" action="{login_url}" {autocomplete}>  
    56143<input type="hidden" name="passwd_type" value="text"> 
    57144<input type="hidden" name="account type" value="u"> 
     
    73160                <br /> 
    74161                <input class="input" type="password" maxlength="50" size="20" name="passwd" id="passwd" value=""> 
     162                <div id="keyboard"></div> 
    75163              </div> 
    76164                {captcha} 
    77165       
    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()" />  
    79168            </div>  
    80169<div style="margin-top:5px"> 
  • branches/2.2/phpgwapi/templates/default/login_default.php

    r3018 r3191  
    375375        $var['logo_title'] = $GLOBALS['phpgw_info']['server']['login_logo_title']?$GLOBALS['phpgw_info']['server']['login_logo_title']:'www.eGroupWare.org'; 
    376376        $tmpl->set_var($var); 
     377 
     378        if (!@$GLOBALS['phpgw_info']['server']['login_virtual_keyboard'])  
     379                $tmpl->set_var('show_kbd','none');  
    377380 
    378381        if (@$GLOBALS['phpgw_info']['server']['login_show_language_selection']) 
Note: See TracChangeset for help on using the changeset viewer.