Changeset 2617 for trunk/phpgwapi


Ignore:
Timestamp:
04/22/10 14:00:41 (14 years ago)
Author:
amuller
Message:

Ticket #911 - Aproveitamento de funções comuns do navbar

Location:
trunk/phpgwapi
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpgwapi/js/expressoAjax/dom.js

    r2616 r2617  
    4747 
    4848 
    49 // Make decimal round, using in size message 
     49/* Make decimal round, using in size message 
    5050function round(value, decimal){ 
    5151        var return_value = Math.round( value * Math.pow( 10 , decimal ) ) / Math.pow( 10 , decimal ); 
    5252        return( return_value ); 
    53 } 
     53}*/ 
    5454 
    5555function removeAll(id){ 
     
    8181 
    8282function trim(inputString) { 
    83    if (typeof inputString != "string")  
     83   if (typeof inputString != "string") 
    8484        return inputString; 
    85        
     85 
    8686   var retValue = inputString; 
    8787   var ch = retValue.substring(0, 1); 
    88    while (ch == " ") {  
     88   while (ch == " ") { 
    8989          retValue = retValue.substring(1, retValue.length); 
    9090          ch = retValue.substring(0, 1); 
    9191   } 
    9292   ch = retValue.substring(retValue.length-1, retValue.length); 
    93    while (ch == " ") {  
     93   while (ch == " ") { 
    9494          retValue = retValue.substring(0, retValue.length-1); 
    9595          ch = retValue.substring(retValue.length-1, retValue.length); 
    9696   } 
    97    while (retValue.indexOf("  ") != -1) {  
     97   while (retValue.indexOf("  ") != -1) { 
    9898          retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length);  
    9999   } 
    100    return retValue;  
     100   return retValue; 
    101101} 
    102102 
     
    164164            return false; 
    165165        } 
     166} 
     167 
     168function showBar(){ 
     169        bar = document.getElementById("toolbar"); 
     170        bar.style.visibility = ""; 
     171        bar.style.position ="static"; 
     172        but = document.getElementById("hiddenButton"); 
     173        but.style.visibility = ""; 
     174        but.style.position = "absolute"; 
     175        but.style.top = "55px"; 
     176        but.style.left = "2px"; 
     177        title = "{hide_bar_txt}"; 
     178        extra = document.getElementById("extraButton"); 
     179        extra.style.visibility = "hidden"; 
     180        but.innerHTML="<a title='"+title+"' onClick='javascript:changeBar()'><img src="+URL_SERVER+"'/phpgwapi/templates/default/images/up.button.png'></a>"; 
     181        var neverExpires = new Date("January 01, 2100 00:00:00"); 
     182        document.cookie = "showHeader=true"+ 
     183                ";expires=" + neverExpires.toGMTString()+ 
     184                ";path=/"; 
     185} 
     186 
     187function hideBar(){ 
     188        bar = document.getElementById("toolbar"); 
     189        bar.style.position ="absolute"; 
     190        bar.style.visibility = "hidden"; 
     191        but = document.getElementById("hiddenButton"); 
     192        but.style.visibility = "hidden"; 
     193        title = "{show_bar_txt}"; 
     194        extra = document.getElementById("extraButton"); 
     195        extra.style.visibility = "" 
     196                extra.style.top = "-11px"; 
     197        extra.style.left = "-10px"; 
     198        var neverExpires = new Date("January 01, 2100 00:00:00"); 
     199        document.cookie = "showHeader=false"+ 
     200                ";expires=" + neverExpires.toGMTString()+ 
     201                ";path=/"; 
     202} 
     203function changeBar(){ 
     204        bar = document.getElementById("toolbar"); 
     205        if(bar.style.visibility == "hidden") 
     206                showBar(); 
     207        else 
     208                hideBar(); 
     209} 
     210function initBar(val){ 
     211 
     212        if(val == 'true') 
     213                showBar(); 
     214        else 
     215                hideBar(); 
     216} 
     217var zoominTimer = new Array(); 
     218var zoomoutTimer = new Array(); 
     219function zoom_in(id) 
     220{ 
     221        clearTimeout(zoomoutTimer[id]); 
     222        var elem = document.getElementById(id); 
     223        if (elem.height > 34) 
     224        { 
     225                clearTimeout(zoominTimer[id]); 
     226                return false; 
     227        } 
     228        elem.height += 4; 
     229        elem.width += 4; 
     230        zoominTimer[id] = setTimeout('zoom_in("'+id+'");',30); 
     231} 
     232function zoom_out(id) 
     233{ 
     234        clearTimeout(zoominTimer[id]); 
     235        var elem = document.getElementById(id); 
     236        if ( ! elem ) 
     237                return; 
     238        if (elem.height < 24) 
     239        { 
     240                clearTimeout(zoomoutTimer[id]); 
     241                return false; 
     242        } 
     243        elem.height -= 2; 
     244        elem.width -= 2; 
     245        zoomoutTimer[id] = setTimeout('zoom_out("'+id+'");',30); 
    166246}; 
    167247 
  • trunk/phpgwapi/templates/default/navbar.tpl

    r2578 r2617  
    66</div> 
    77{app_extra_icons_div} 
    8 <script language="Javascript">    
    9         function showBar(){ 
    10                 bar = document.getElementById("toolbar");        
    11                 bar.style.visibility = ""; 
    12                 bar.style.position ="static"; 
    13                 but = document.getElementById("hiddenButton");           
    14                 but.style.visibility = ""; 
    15                 but.style.position = "absolute";                 
    16                 but.style.top = "55px";          
    17                 but.style.left = "2px";          
    18                 title = "{hide_bar_txt}"; 
    19                 extra = document.getElementById("extraButton"); 
    20                 extra.style.visibility = "hidden";               
    21                 but.innerHTML="<a title='"+title+"' onClick='javascript:changeBar()'><img src='{img_root}/up.button.png'></a>"; 
    22                 var neverExpires = new Date("January 01, 2100 00:00:00"); 
    23                 document.cookie = "showHeader=true"+ 
    24                                                   ";expires=" + neverExpires.toGMTString()+ 
    25                                                   ";path=/"; 
    26         } 
    27  
    28         function hideBar(){ 
    29                 bar = document.getElementById("toolbar");        
    30                 bar.style.position ="absolute"; 
    31                 bar.style.visibility = "hidden"; 
    32                 but = document.getElementById("hiddenButton");           
    33                 but.style.visibility = "hidden"; 
    34                 title = "{show_bar_txt}"; 
    35                 extra = document.getElementById("extraButton"); 
    36                 extra.style.visibility = "" 
    37                 extra.style.top = "-11px";               
    38                 extra.style.left = "-10px";              
    39                 var neverExpires = new Date("January 01, 2100 00:00:00"); 
    40                 document.cookie = "showHeader=false"+ 
    41                                                   ";expires=" + neverExpires.toGMTString()+ 
    42                                                   ";path=/"; 
    43         } 
    44         function changeBar(){ 
    45                 bar = document.getElementById("toolbar");                        
    46                 if(bar.style.visibility == "hidden") 
    47                         showBar();               
    48                 else 
    49                         hideBar(); 
    50         } 
    51         function initBar(val){ 
    52  
    53                 if(val == 'true') 
    54                         showBar();               
    55                 else 
    56                         hideBar();               
    57         } 
    58 var zoominTimer = new Array(); 
    59 var zoomoutTimer = new Array(); 
    60 function zoom_in(id) 
    61 { 
    62         clearTimeout(zoomoutTimer[id]); 
    63         var elem = document.getElementById(id); 
    64         if (elem.height > 34) 
    65         { 
    66                 clearTimeout(zoominTimer[id]); 
    67                 return false; 
    68         }        
    69         elem.height += 4; 
    70         elem.width += 4; 
    71         zoominTimer[id] = setTimeout('zoom_in("'+id+'");',30); 
    72 } 
    73 function zoom_out(id) 
    74 { 
    75         clearTimeout(zoominTimer[id]);           
    76         var elem = document.getElementById(id); 
    77         if ( ! elem ) 
    78                 return; 
    79         if (elem.height < 24) 
    80         { 
    81                 clearTimeout(zoomoutTimer[id]); 
    82                 return false; 
    83         }        
    84         elem.height -= 2; 
    85         elem.width -= 2; 
    86         zoomoutTimer[id] = setTimeout('zoom_out("'+id+'");',30); 
    87 } 
    88 </script> 
    898 
    909<div class="toolbar" id="toolbar" style="visibility:hidden"> 
Note: See TracChangeset for help on using the changeset viewer.