Hide menu on connect, remove rounded edges of clipboard, separate menu hide/show...
authorMichael Jumper <zhangmaike@users.sourceforge.net>
Sun, 20 Nov 2011 07:05:12 +0000 (23:05 -0800)
committerMichael Jumper <zhangmaike@users.sourceforge.net>
Sun, 20 Nov 2011 07:05:12 +0000 (23:05 -0800)
src/main/webapp/client.xhtml
src/main/webapp/scripts/interface.js [new file with mode: 0644]
src/main/webapp/styles/client.css

index ad4defc..1a4c082 100644 (file)
@@ -79,6 +79,7 @@
         <script type="text/javascript" src="guacamole-common-js/tunnel.js"></script>
         <script type="text/javascript" src="guacamole-common-js/guacamole.js"></script>
         <script type="text/javascript" src="guacamole-common-js/oskeyboard.js"></script>
+        <script type="text/javascript" src="scripts/interface.js"></script>
 
         <!-- Init -->
         <script type="text/javascript"> /* <![CDATA[ */
                             display.className = display.className.replace(/guac-loading/, '');
                             menu.className = "connected";
                             state.textContent = "Connected.";
+                            shadeMenu();
                             break;
                         case 4:
                             state.textContent = "Disconnecting...";
                 // TODO: Handle exception ...
             }
 
-            var menu_shaded = false;
-
-            var hide_interval = null;
-            var show_interval = null;
-
-            function hideMenu() {
-
-                if (!menu_shaded) {
-
-                    var step = Math.floor(menu.offsetHeight / 5) + 1;
-                    var offset = 0;
-                    menu_shaded = true;
-
-                    window.clearInterval(show_interval);
-                    hide_interval = window.setInterval(function() {
-
-                        offset -= step;
-                        menu.style.top = offset + "px";
-
-                        if (offset <= -menu.offsetHeight) {
-                            window.clearInterval(hide_interval);
-                            menu.style.visiblity = "hidden";
-                        }
-
-                    }, 30);
-                }
-
-            }
-
-            function showMenu() {
-
-                if (menu_shaded) {
-
-                    var step = Math.floor(menu.offsetHeight / 5) + 1;
-                    var offset = -menu.offsetHeight;
-                    menu_shaded = false;
-                    menu.style.visiblity = "";
-
-                    window.clearInterval(hide_interval);
-                    show_interval = window.setInterval(function() {
-
-                        offset += step;
-
-                        if (offset >= 0) {
-                            offset = 0;
-                            window.clearInterval(show_interval);
-                        }
-
-                        menu.style.top = offset + "px";
-
-                    }, 30);
-                }
-
-            }
-
             display.onmouseout = function() {
                 showMenu();
             };
 
             display.onmouseover = function() {
-                hideMenu();
+                shadeMenu();
             };
 
 
diff --git a/src/main/webapp/scripts/interface.js b/src/main/webapp/scripts/interface.js
new file mode 100644 (file)
index 0000000..63cc426
--- /dev/null
@@ -0,0 +1,56 @@
+
+var menu_shaded = false;
+
+var shade_interval = null;
+var show_interval = null;
+
+function shadeMenu() {
+
+    if (!menu_shaded) {
+
+        var step = Math.floor(menu.offsetHeight / 5) + 1;
+        var offset = 0;
+        menu_shaded = true;
+
+        window.clearInterval(show_interval);
+        shade_interval = window.setInterval(function() {
+
+            offset -= step;
+            menu.style.top = offset + "px";
+
+            if (offset <= -menu.offsetHeight) {
+                window.clearInterval(shade_interval);
+                menu.style.visiblity = "hidden";
+            }
+
+        }, 30);
+    }
+
+}
+
+function showMenu() {
+
+    if (menu_shaded) {
+
+        var step = Math.floor(menu.offsetHeight / 5) + 1;
+        var offset = -menu.offsetHeight;
+        menu_shaded = false;
+        menu.style.visiblity = "";
+
+        window.clearInterval(shade_interval);
+        show_interval = window.setInterval(function() {
+
+            offset += step;
+
+            if (offset >= 0) {
+                offset = 0;
+                window.clearInterval(show_interval);
+            }
+
+            menu.style.top = offset + "px";
+
+        }, 30);
+    }
+
+}
+
index 7d99735..3dfe2bf 100644 (file)
@@ -125,10 +125,6 @@ div#clipboardDiv {
     padding: 1em;
 
     border: 1px solid black;
-    -khtml-border-radius: 0.5em;
-    -webkit-border-radius: 0.5em;
-    -moz-border-radius: 0.5em;
-    border-radius: 0.5em;
 
     width: 50em;
     opacity: 0.5;