Changeset ad10112 in guacamole


Ignore:
Timestamp:
04/08/12 18:56:11 (13 months ago)
Author:
zhangmaike
Branches:
master, guacamole-debian-parent, rpm, unstable, unstable-websocket
Children:
fae5867
Parents:
32a768a
git-author:
Michael Jumper <zhangmaike@…> (04/08/12 18:56:11)
git-committer:
Michael Jumper <zhangmaike@…> (04/08/12 18:56:11)
Message:

Implement touch-specific menu.

Location:
src/main/webapp
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • src/main/webapp/client.xhtml

    r32a768a rad10112  
    8585        </div> 
    8686 
     87        <!-- Touch-specific menu --> 
     88        <div class="dialogOuter"> 
     89            <div class="dialogMiddle"> 
     90 
     91                <div id="touchMenu"> 
     92                    <img id="touchShowClipboard" src="images/menu-icons/tango/edit-paste.png"/> 
     93                    <img id="touchShowKeyboard" src="images/menu-icons/tango/input-keyboard.png"/> 
     94                    <img id="touchLogout" src="images/menu-icons/tango/system-log-out.png"/> 
     95                </div> 
     96 
     97            </div> 
     98        </div> 
     99 
    87100        <!-- guacamole-common-js scripts --> 
    88101        <script type="text/javascript" src="guacamole-common-js/keyboard.js"></script> 
  • src/main/webapp/scripts/interface.js

    r32a768a rad10112  
    3838        "ctrlAltDelete": document.getElementById("ctrlAltDelete"), 
    3939        "reconnect"    : document.getElementById("reconnect"), 
    40         "logout"       : document.getElementById("logout") 
     40        "logout"       : document.getElementById("logout"), 
     41 
     42        "touchShowClipboard" : document.getElementById("touchShowClipboard"), 
     43        "touchShowKeyboard"  : document.getElementById("touchShowKeyboard"), 
     44        "touchLogout"        : document.getElementById("touchLogout") 
    4145 
    4246    }, 
     
    134138    }; 
    135139 
     140    GuacamoleUI.hideTouchMenu = function() { 
     141        GuacamoleUI.touchMenu.style.visibility = "hidden"; 
     142    }; 
     143     
     144    GuacamoleUI.showTouchMenu = function() { 
     145        GuacamoleUI.touchMenu.style.visibility = "visible"; 
     146    }; 
     147 
    136148    GuacamoleUI.shadeMenu = function() { 
    137149 
     
    213225    }; 
    214226 
    215     // Assume no native OSK by default 
    216     GuacamoleUI.oskMode = GuacamoleUI.OSK_MODE_GUAC; 
     227    GuacamoleUI.buttons.touchShowClipboard.onclick = function() { 
     228        // FIXME: Implement 
     229        alert("Not yet implemented... Sorry."); 
     230    }; 
    217231 
    218232    // Show/Hide keyboard 
     
    229243            window.clearInterval(keyboardResizeInterval); 
    230244        } 
    231          
    232         // If not shown ... action depends on OSK mode. 
     245 
     246        // Otherwise, show it 
    233247        else { 
    234  
    235             // If we think the platform has a native OSK, use the event target to 
    236             // cause it to display. 
    237             if (GuacamoleUI.oskMode == GuacamoleUI.OSK_MODE_NATIVE) { 
    238  
    239                 // ...but use the Guac OSK if clicked again 
    240                 GuacamoleUI.oskMode = GuacamoleUI.OSK_MODE_GUAC; 
    241  
    242                 // Try to show native OSK by focusing eventTarget. 
    243                 GuacamoleUI.eventTarget.focus(); 
    244                 return; 
    245  
    246             } 
    247248 
    248249            // Ensure event target is NOT focused if we are using the Guac OSK. 
     
    254255            // Automatically update size 
    255256            window.onresize = updateKeyboardSize; 
    256             keyboardResizeInterval = window.setInterval(updateKeyboardSize, GuacamoleUI.KEYBOARD_AUTO_RESIZE_INTERVAL); 
     257            keyboardResizeInterval = window.setInterval(updateKeyboardSize, 
     258                GuacamoleUI.KEYBOARD_AUTO_RESIZE_INTERVAL); 
    257259 
    258260            updateKeyboardSize(); 
    259         } 
    260          
    261  
    262     }; 
     261 
     262        } 
     263 
     264    }; 
     265 
     266    // Touch-specific keyboard show 
     267    GuacamoleUI.buttons.touchShowKeyboard.ontouchstart =  
     268    GuacamoleUI.buttons.touchShowKeyboard.onclick =  
     269        function(e) { 
     270            GuacamoleUI.eventTarget.focus(); 
     271            GuacamoleUI.hideTouchMenu(); 
     272            e.preventDefault(); 
     273        }; 
    263274 
    264275    // Logout 
    265     GuacamoleUI.buttons.logout.onclick = function() { 
    266         window.location.href = "logout"; 
    267     }; 
     276    GuacamoleUI.buttons.logout.onclick = 
     277    GuacamoleUI.buttons.touchLogout.onclick = 
     278        function() { 
     279            window.location.href = "logout"; 
     280        }; 
    268281 
    269282    // Timeouts for detecting if users wants menu to open or close 
     
    351364                // Assume native OSK if menu shown via long-press 
    352365                GuacamoleUI.oskMode = GuacamoleUI.OSK_MODE_NATIVE; 
    353                 GuacamoleUI.showMenu(); 
     366                GuacamoleUI.showTouchMenu(); 
    354367 
    355368            }, GuacamoleUI.LONG_PRESS_DETECT_TIMEOUT); 
     
    368381        // Close menu if shown 
    369382        GuacamoleUI.shadeMenu(); 
     383        GuacamoleUI.hideTouchMenu(); 
    370384         
    371385        // Record touch location 
  • src/main/webapp/styles/client.css

    r32a768a rad10112  
    257257    overflow: hidden; 
    258258} 
     259 
     260/* Touch-specific menu */ 
     261 
     262div#touchMenu { 
     263    display: inline-block; 
     264    background: black; 
     265    border: 1px solid silver; 
     266    padding: 1em; 
     267    opacity: 0.8; 
     268} 
Note: See TracChangeset for help on using the changeset viewer.