You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by jm...@apache.org on 2016/08/02 22:56:53 UTC

[1/7] incubator-guacamole-client git commit: GUACAMOLE-5: Separate menu semantics from guacUserMenu into own guacMenu directive.

Repository: incubator-guacamole-client
Updated Branches:
  refs/heads/master 468a5526f -> 841bc4761


GUACAMOLE-5: Separate menu semantics from guacUserMenu into own guacMenu directive.


Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/commit/8b193ad8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/8b193ad8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/8b193ad8

Branch: refs/heads/master
Commit: 8b193ad89adf7ddba5afbda6f25a5c49149d84cc
Parents: 468a552
Author: Michael Jumper <mj...@apache.org>
Authored: Mon Jul 25 01:08:16 2016 -0700
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Aug 2 13:25:09 2016 -0700

----------------------------------------------------------------------
 .../app/navigation/directives/guacMenu.js       |  91 +++++++++++
 .../app/navigation/directives/guacUserMenu.js   |  44 +-----
 .../main/webapp/app/navigation/styles/menu.css  | 155 +++++++++++++++++++
 .../webapp/app/navigation/styles/user-menu.css  | 145 +----------------
 .../app/navigation/templates/guacMenu.html      |   7 +
 .../app/navigation/templates/guacUserMenu.html  |  50 +++---
 6 files changed, 284 insertions(+), 208 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/8b193ad8/guacamole/src/main/webapp/app/navigation/directives/guacMenu.js
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/navigation/directives/guacMenu.js b/guacamole/src/main/webapp/app/navigation/directives/guacMenu.js
new file mode 100644
index 0000000..e00cc1c
--- /dev/null
+++ b/guacamole/src/main/webapp/app/navigation/directives/guacMenu.js
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * A directive which provides an arbitrary menu-style container. The contents
+ * of the directive are displayed only when the menu is open.
+ */
+angular.module('navigation').directive('guacMenu', [function guacMenu() {
+
+    return {
+        restrict: 'E',
+        transclude: true,
+        replace: true,
+        scope: {
+
+            /**
+             * The string which should be rendered as the menu title.
+             *
+             * @type String
+             */
+            menuTitle : '='
+
+        },
+
+        templateUrl: 'app/navigation/templates/guacMenu.html',
+        controller: ['$scope', '$injector', '$element',
+            function guacMenuController($scope, $injector, $element) {
+
+            // Get required services
+            var $document = $injector.get('$document');
+
+            /**
+             * The outermost element of the guacMenu directive.
+             *
+             * @type Element
+             */
+            var element = $element[0];
+
+            /**
+             * The main document object.
+             *
+             * @type Document
+             */
+            var document = $document[0];
+
+            /**
+             * Whether the contents of the menu are currently shown.
+             *
+             * @type Boolean
+             */
+            $scope.menuShown = false;
+
+            /**
+             * Toggles visibility of the menu contents.
+             */
+            $scope.toggleMenu = function toggleMenu() {
+                $scope.menuShown = !$scope.menuShown;
+            };
+
+            // Close menu when use clicks anywhere else
+            document.body.addEventListener('click', function clickOutsideMenu() {
+                $scope.$apply(function closeMenu() {
+                    $scope.menuShown = false;
+                });
+            }, false);
+
+            // Prevent click within menu from triggering the outside-menu handler
+            element.addEventListener('click', function clickInsideMenu(e) {
+                e.stopPropagation();
+            }, false);
+
+        }] // end controller
+
+    };
+}]);

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/8b193ad8/guacamole/src/main/webapp/app/navigation/directives/guacUserMenu.js
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/navigation/directives/guacUserMenu.js b/guacamole/src/main/webapp/app/navigation/directives/guacUserMenu.js
index aed7b7c..249f217 100644
--- a/guacamole/src/main/webapp/app/navigation/directives/guacUserMenu.js
+++ b/guacamole/src/main/webapp/app/navigation/directives/guacUserMenu.js
@@ -40,37 +40,16 @@ angular.module('navigation').directive('guacUserMenu', [function guacUserMenu()
         },
 
         templateUrl: 'app/navigation/templates/guacUserMenu.html',
-        controller: ['$scope', '$injector', '$element', function guacUserMenuController($scope, $injector, $element) {
+        controller: ['$scope', '$injector',
+            function guacUserMenuController($scope, $injector) {
 
             // Get required services
-            var $document             = $injector.get('$document');
             var $location             = $injector.get('$location');
             var $route                = $injector.get('$route');
             var authenticationService = $injector.get('authenticationService');
             var userPageService       = $injector.get('userPageService');
 
             /**
-             * The outermost element of the user menu directive.
-             *
-             * @type Element
-             */
-            var element = $element[0];
-
-            /**
-             * The main document object.
-             *
-             * @type Document
-             */
-            var document = $document[0];
-
-            /**
-             * Whether the contents of the user menu are currently shown.
-             *
-             * @type Boolean
-             */
-            $scope.menuShown = false;
-
-            /**
              * The username of the current user.
              *
              * @type String
@@ -91,13 +70,6 @@ angular.module('navigation').directive('guacUserMenu', [function guacUserMenu()
             });
             
             /**
-             * Toggles visibility of the user menu.
-             */
-            $scope.toggleMenu = function toggleMenu() {
-                $scope.menuShown = !$scope.menuShown;
-            };
-
-            /**
              * Logs out the current user, redirecting them to back to the root
              * after logout completes.
              */
@@ -125,18 +97,6 @@ angular.module('navigation').directive('guacUserMenu', [function guacUserMenu()
              */
             $scope.actions = [ LOGOUT_ACTION ];
 
-            // Close menu when use clicks anywhere else
-            document.body.addEventListener('click', function clickOutsideMenu() {
-                $scope.$apply(function closeMenu() {
-                    $scope.menuShown = false;
-                });
-            }, false);
-
-            // Prevent click within menu from triggering the outside-menu handler
-            element.addEventListener('click', function clickInsideMenu(e) {
-                e.stopPropagation();
-            }, false);
-
         }] // end controller
 
     };

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/8b193ad8/guacamole/src/main/webapp/app/navigation/styles/menu.css
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/navigation/styles/menu.css b/guacamole/src/main/webapp/app/navigation/styles/menu.css
new file mode 100644
index 0000000..c402158
--- /dev/null
+++ b/guacamole/src/main/webapp/app/navigation/styles/menu.css
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+.menu-dropdown {
+
+    /* IE10 */
+    display: -ms-flexbox;
+    -ms-flex-align: center;
+    -ms-flex-direction: row;
+
+    /* Ancient Mozilla */
+    display: -moz-box;
+    -moz-box-align: center;
+    -moz-box-orient: horizontal;
+    
+    /* Ancient WebKit */
+    display: -webkit-box;
+    -webkit-box-align: center;
+    -webkit-box-orient: horizontal;
+
+    /* Old WebKit */
+    display: -webkit-flex;
+    -webkit-align-items: center;
+    -webkit-flex-direction: row;
+
+    /* W3C */
+    display: flex;
+    align-items: center;
+    flex-direction: row;
+
+}
+
+.menu-dropdown {
+    position: relative;
+    border-left: 1px solid rgba(0,0,0,0.125);
+    background: rgba(0,0,0,0.04);
+}
+
+.menu-dropdown:hover {
+    background: rgba(0,0,0,0.01);
+}
+
+.menu-dropdown.open,
+.menu-dropdown.open:hover {
+    background: rgba(0,0,0,0.3);
+}
+
+.menu-dropdown .menu-title {
+
+    cursor: default;
+    margin: 0;
+    min-width: 2in;
+    padding: 0.5em;
+
+    -ms-flex: 0 0 auto;
+    -moz-box-flex: 0;
+    -webkit-box-flex: 0;
+    -webkit-flex: 0 0 auto;
+    flex: 0 0 auto;
+   
+}
+
+.menu-dropdown .menu-indicator {
+
+    position: absolute;
+    right: 0;
+    top: 0;
+    bottom: 0;
+
+    width: 2em;
+    background-repeat: no-repeat;
+    background-size: 1em;
+    background-position: center center;
+    background-image: url('images/arrows/down.png');
+
+}
+
+.menu-dropdown .options {
+
+    visibility: hidden;
+
+    position: absolute;
+    top: 100%;
+    right: 0;
+    left: -1px;
+
+    background: #EEE;
+    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.125);
+    border-left: 1px solid rgba(0,0,0,0.125);
+    border-bottom: 1px solid rgba(0,0,0,0.125);
+
+    z-index: 5;
+    
+}
+
+.menu-dropdown .options ul {
+    margin: 0;
+    padding: 0;
+}
+
+.menu-dropdown.open .options {
+    visibility: visible;
+}
+
+.menu-dropdown .options li {
+    padding: 0;
+    list-style-type: none;
+}
+
+.menu-dropdown .options li a {
+
+    display: block;
+    cursor: pointer;
+    color: black;
+    text-decoration: none;
+    padding: 0.75em;
+
+}
+
+.menu-dropdown .options li a:hover {
+    background-color: #CDA;
+}
+
+.menu-dropdown .options li a.current,
+.menu-dropdown .options li a.current:hover {
+    background-color: transparent;
+    cursor: default;
+    opacity: 0.25;
+}
+
+.menu-dropdown .options li a.danger {
+    color: white;
+    font-weight: bold;
+    background-color: #A43;
+}
+
+.menu-dropdown .options li a.danger:hover {
+    background-color: #C54;
+}

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/8b193ad8/guacamole/src/main/webapp/app/navigation/styles/user-menu.css
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/navigation/styles/user-menu.css b/guacamole/src/main/webapp/app/navigation/styles/user-menu.css
index 2d8ae51..7d679ed 100644
--- a/guacamole/src/main/webapp/app/navigation/styles/user-menu.css
+++ b/guacamole/src/main/webapp/app/navigation/styles/user-menu.css
@@ -46,55 +46,7 @@
 
 }
 
-.user-menu .user-menu-dropdown {
-
-    /* IE10 */
-    display: -ms-flexbox;
-    -ms-flex-align: center;
-    -ms-flex-direction: row;
-
-    /* Ancient Mozilla */
-    display: -moz-box;
-    -moz-box-align: center;
-    -moz-box-orient: horizontal;
-    
-    /* Ancient WebKit */
-    display: -webkit-box;
-    -webkit-box-align: center;
-    -webkit-box-orient: horizontal;
-
-    /* Old WebKit */
-    display: -webkit-flex;
-    -webkit-align-items: center;
-    -webkit-flex-direction: row;
-
-    /* W3C */
-    display: flex;
-    align-items: center;
-    flex-direction: row;
-
-}
-
-.user-menu .user-menu-dropdown {
-    position: relative;
-    border-left: 1px solid rgba(0,0,0,0.125);
-    background: rgba(0,0,0,0.04);
-}
-
-.user-menu .user-menu-dropdown:hover {
-    background: rgba(0,0,0,0.01);
-}
-
-.user-menu .user-menu-dropdown.open,
-.user-menu .user-menu-dropdown.open:hover {
-    background: rgba(0,0,0,0.3);
-}
-
-.user-menu .username {
-
-    cursor: default;
-    margin: 0;
-    min-width: 2in;
+.user-menu .menu-dropdown .menu-title {
 
     font-size: 1.25em;
     font-weight: bold;
@@ -105,68 +57,9 @@
     background-position: 0.5em center;
     background-image: url('images/user-icons/guac-user.png');
 
-    -ms-flex: 0 0 auto;
-    -moz-box-flex: 0;
-    -webkit-box-flex: 0;
-    -webkit-flex: 0 0 auto;
-    flex: 0 0 auto;
-   
 }
 
-.user-menu .menu-indicator {
-
-    position: absolute;
-    right: 0;
-    top: 0;
-    bottom: 0;
-
-    width: 2em;
-    background-repeat: no-repeat;
-    background-size: 1em;
-    background-position: center center;
-    background-image: url('images/arrows/down.png');
-
-}
-
-.user-menu .options {
-
-    visibility: hidden;
-
-    position: absolute;
-    top: 100%;
-    right: 0;
-    left: -1px;
-
-    background: #EEE;
-    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.125);
-    border-left: 1px solid rgba(0,0,0,0.125);
-    border-bottom: 1px solid rgba(0,0,0,0.125);
-
-    z-index: 5;
-    
-}
-
-.user-menu .options ul {
-    margin: 0;
-    padding: 0;
-}
-
-.user-menu .user-menu-dropdown.open .options {
-    visibility: visible;
-}
-
-.user-menu .options li {
-    padding: 0;
-    list-style-type: none;
-}
-
-.user-menu .options li a {
-
-    display: block;
-    cursor: pointer;
-    color: black;
-    text-decoration: none;
-    padding: 0.75em;
+.user-menu .menu-dropdown .options li a {
 
     background-repeat: no-repeat;
     background-size: 1em;
@@ -175,39 +68,17 @@
     background-image: url('images/protocol-icons/guac-monitor.png');
 
 }
-
-.user-menu .options li a:hover {
-    background-color: #CDA;
-}
-
-.user-menu .options li a.current,
-.user-menu .options li a.current:hover {
-    background-color: transparent;
-    cursor: default;
-    opacity: 0.25;
-}
-
-.user-menu .options li a[href="#/"] {
+.user-menu .menu-dropdown .options li a[href="#/"] {
     background-image: url('images/action-icons/guac-home-dark.png');
 }
 
-.user-menu .options li a[href="#/settings/users"],
-.user-menu .options li a[href="#/settings/connections"],
-.user-menu .options li a[href="#/settings/sessions"],
-.user-menu .options li a[href="#/settings/preferences"] {
+.user-menu .menu-dropdown .options li a[href="#/settings/users"],
+.user-menu .menu-dropdown .options li a[href="#/settings/connections"],
+.user-menu .menu-dropdown .options li a[href="#/settings/sessions"],
+.user-menu .menu-dropdown .options li a[href="#/settings/preferences"] {
     background-image: url('images/action-icons/guac-config-dark.png');
 }
 
-.user-menu .options li a.logout {
+.user-menu .menu-dropdown .options li a.logout {
     background-image: url('images/action-icons/guac-logout-dark.png');
 }
-
-.user-menu .options li a.danger {
-    color: white;
-    font-weight: bold;
-    background-color: #A43;
-}
-
-.user-menu .options li a.danger:hover {
-    background-color: #C54;
-}

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/8b193ad8/guacamole/src/main/webapp/app/navigation/templates/guacMenu.html
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/navigation/templates/guacMenu.html b/guacamole/src/main/webapp/app/navigation/templates/guacMenu.html
new file mode 100644
index 0000000..f1785cd
--- /dev/null
+++ b/guacamole/src/main/webapp/app/navigation/templates/guacMenu.html
@@ -0,0 +1,7 @@
+<div class="menu-dropdown" ng-class="{open: menuShown}" ng-click="toggleMenu()">
+    <div class="menu-title">{{menuTitle}}</div>
+    <div class="menu-indicator"></div>
+
+    <!-- Menu options -->
+    <div class="options" ng-transclude></div>
+</div>

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/8b193ad8/guacamole/src/main/webapp/app/navigation/templates/guacUserMenu.html
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/navigation/templates/guacUserMenu.html b/guacamole/src/main/webapp/app/navigation/templates/guacUserMenu.html
index 4acd474..351da0f 100644
--- a/guacamole/src/main/webapp/app/navigation/templates/guacUserMenu.html
+++ b/guacamole/src/main/webapp/app/navigation/templates/guacUserMenu.html
@@ -1,34 +1,26 @@
 <div class="user-menu">
+    <guac-menu menu-title="username">
+           
+        <!-- Local actions -->
+        <ul class="action-list">
+            <li ng-repeat="action in localActions">
+                <a ng-class="action.className" ng-click="action.callback()">
+                    {{action.name | translate}}
+                </a>
+            </li>
+        </ul>
 
-    <div class="user-menu-dropdown" ng-class="{open: menuShown}" ng-click="toggleMenu()">
-        <div class="username">{{username}}</div>
-        <div class="menu-indicator"></div>
-        
-        <!-- Menu options -->
-        <div class="options">
-            
-            <!-- Local actions -->
-            <ul class="action-list">
-                <li ng-repeat="action in localActions">
-                    <a ng-class="action.className" ng-click="action.callback()">
-                        {{action.name | translate}}
-                    </a>
-                </li>
-            </ul>
+        <!-- Navigation links -->
+        <guac-page-list pages="pages"></guac-page-list>
 
-            <!-- Navigation links -->
-            <guac-page-list pages="pages"></guac-page-list>
-
-            <!-- Actions -->
-            <ul class="action-list">
-                <li ng-repeat="action in actions">
-                    <a ng-class="action.className" ng-click="action.callback()">
-                        {{action.name | translate}}
-                    </a>
-                </li>
-            </ul>
-
-        </div>
-    </div>
+        <!-- Actions -->
+        <ul class="action-list">
+            <li ng-repeat="action in actions">
+                <a ng-class="action.className" ng-click="action.callback()">
+                    {{action.name | translate}}
+                </a>
+            </li>
+        </ul>
 
+    </guac-menu>
 </div>


[2/7] incubator-guacamole-client git commit: GUACAMOLE-5: Add share icon.

Posted by jm...@apache.org.
GUACAMOLE-5: Add share icon.

Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/commit/e1cf5821
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/e1cf5821
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/e1cf5821

Branch: refs/heads/master
Commit: e1cf5821fc526113e13f09ee6dd62a5d179e2553
Parents: 91254f7
Author: Michael Jumper <mj...@apache.org>
Authored: Tue Aug 2 11:50:32 2016 -0700
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Aug 2 13:25:15 2016 -0700

----------------------------------------------------------------------
 .../webapp/app/client/styles/share-menu.css     |  58 +++++++++++++++++++
 .../webapp/app/client/templates/client.html     |  12 ++--
 guacamole/src/main/webapp/images/share.png      | Bin 0 -> 1112 bytes
 3 files changed, 65 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/e1cf5821/guacamole/src/main/webapp/app/client/styles/share-menu.css
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/client/styles/share-menu.css b/guacamole/src/main/webapp/app/client/styles/share-menu.css
new file mode 100644
index 0000000..6d6659b
--- /dev/null
+++ b/guacamole/src/main/webapp/app/client/styles/share-menu.css
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+.share-menu {
+
+    /* IE10 */
+    display: -ms-flexbox;
+    -ms-flex-align: stretch;
+    -ms-flex-direction: row;
+
+    /* Ancient Mozilla */
+    display: -moz-box;
+    -moz-box-align: stretch;
+    -moz-box-orient: horizontal;
+
+    /* Ancient WebKit */
+    display: -webkit-box;
+    -webkit-box-align: stretch;
+    -webkit-box-orient: horizontal;
+
+    /* Old WebKit */
+    display: -webkit-flex;
+    -webkit-align-items: stretch;
+    -webkit-flex-direction: row;
+
+    /* W3C */
+    display: flex;
+    align-items: stretch;
+    flex-direction: row;
+
+}
+
+.share-menu .menu-dropdown .menu-title {
+
+    padding-left: 2em;
+
+    background-repeat: no-repeat;
+    background-size: 1em;
+    background-position: 0.5em center;
+    background-image: url('images/share.png');
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/e1cf5821/guacamole/src/main/webapp/app/client/templates/client.html
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/client/templates/client.html b/guacamole/src/main/webapp/app/client/templates/client.html
index 8b55838..2214d58 100644
--- a/guacamole/src/main/webapp/app/client/templates/client.html
+++ b/guacamole/src/main/webapp/app/client/templates/client.html
@@ -43,11 +43,13 @@
             <!-- Stationary header -->
             <div class="header">
                 <h2>{{client.name}}</h2>
-                <guac-menu title="'CLIENT.ACTION_SHARE' | translate" ng-show="canShareConnection()">
-                    <ul ng-repeat="sharingProfile in sharingProfiles">
-                        <li><a ng-click="share(sharingProfile)">{{sharingProfile.name}}</a></li>
-                    </ul>
-                </guac-menu>
+                <div class="share-menu" ng-show="canShareConnection()">
+                    <guac-menu title="'CLIENT.ACTION_SHARE' | translate">
+                        <ul ng-repeat="sharingProfile in sharingProfiles">
+                            <li><a ng-click="share(sharingProfile)">{{sharingProfile.name}}</a></li>
+                        </ul>
+                    </guac-menu>
+                </div>
                 <guac-user-menu local-actions="clientMenuActions"></guac-user-menu>
             </div>
 

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/e1cf5821/guacamole/src/main/webapp/images/share.png
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/images/share.png b/guacamole/src/main/webapp/images/share.png
new file mode 100644
index 0000000..75dfde0
Binary files /dev/null and b/guacamole/src/main/webapp/images/share.png differ


[5/7] incubator-guacamole-client git commit: GUACAMOLE-5: Display share links within Guacamole menu. Persist within ManagedClient.

Posted by jm...@apache.org.
GUACAMOLE-5: Display share links within Guacamole menu. Persist within ManagedClient.


Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/commit/73c2e689
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/73c2e689
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/73c2e689

Branch: refs/heads/master
Commit: 73c2e68922a7c99883d4a6002871f98e84b06e74
Parents: e1cf582
Author: Michael Jumper <mj...@apache.org>
Authored: Tue Aug 2 13:08:04 2016 -0700
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Aug 2 13:25:38 2016 -0700

----------------------------------------------------------------------
 .../app/client/controllers/clientController.js  |  41 +++++---
 .../main/webapp/app/client/styles/guac-menu.css |  28 +++++
 .../webapp/app/client/templates/client.html     |  18 +++-
 .../webapp/app/client/types/ManagedClient.js    |  66 ++++++++++++
 .../webapp/app/client/types/ManagedShareLink.js | 105 +++++++++++++++++++
 guacamole/src/main/webapp/translations/en.json  |   2 +
 6 files changed, 246 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/73c2e689/guacamole/src/main/webapp/app/client/controllers/clientController.js
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/client/controllers/clientController.js b/guacamole/src/main/webapp/app/client/controllers/clientController.js
index d2f9d26..b522568 100644
--- a/guacamole/src/main/webapp/app/client/controllers/clientController.js
+++ b/guacamole/src/main/webapp/app/client/controllers/clientController.js
@@ -28,7 +28,6 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
     var ManagedClientState = $injector.get('ManagedClientState');
     var ManagedFilesystem  = $injector.get('ManagedFilesystem');
     var ScrollState        = $injector.get('ScrollState');
-    var UserCredentials    = $injector.get('UserCredentials');
 
     // Required services
     var $location             = $injector.get('$location');
@@ -435,26 +434,42 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
     /**
      * Produces a sharing link for the current connection using the given
      * sharing profile. The resulting sharing link, and any required login
-     * information, will be displayed to the user once the various underlying
-     * service calls succeed.
+     * information, will be displayed to the user within the Guacamole menu.
      *
      * @param {SharingProfile} sharingProfile
      *     The sharing profile to use to generate the sharing link.
      */
     $scope.share = function share(sharingProfile) {
+        ManagedClient.createShareLink($scope.client, sharingProfile);
+    };
+
+    /**
+     * Returns whether the current connection has any associated share links.
+     *
+     * @returns {Boolean}
+     *     true if the current connection has at least one associated share
+     *     link, false otherwise.
+     */
+    $scope.isShared = function isShared() {
+        return ManagedClient.isShared($scope.client);
+    };
 
-        // Retrieve sharing credentials for the sake of generating a share link
-        tunnelService.getSharingCredentials($scope.client.tunnel.uuid, sharingProfile.identifier)
-        .success(function sharingCredentialsReceived(sharingCredentials) {
+    /**
+     * Returns the total number of share links associated with the current
+     * connection.
+     *
+     * @returns {Number}
+     *     The total number of share links associated with the current
+     *     connection.
+     */
+    $scope.getShareLinkCount = function getShareLinkCount() {
 
-            // TODONT: COMPLETE HACK: Shove the share link into the clipboard
-            var href = UserCredentials.getLink(sharingCredentials);
-            $scope.client.clipboardData = {
-                'type' : 'text/plain',
-                'data' : href
-            };
+        // Count total number of links within the ManagedClient's share link map
+        var linkCount = 0;
+        for (var dummy in $scope.client.shareLinks)
+            linkCount++;
 
-        });
+        return linkCount;
 
     };
 

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/73c2e689/guacamole/src/main/webapp/app/client/styles/guac-menu.css
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/client/styles/guac-menu.css b/guacamole/src/main/webapp/app/client/styles/guac-menu.css
index bc96eb9..9e0fb7c 100644
--- a/guacamole/src/main/webapp/app/client/styles/guac-menu.css
+++ b/guacamole/src/main/webapp/app/client/styles/guac-menu.css
@@ -171,3 +171,31 @@
 #guac-menu #devices .device.filesystem {
     background-image: url('images/drive.png');
 }
+
+#guac-menu #share-links {
+
+    padding: 1em;
+    border: 1px solid rgba(0, 0, 0, 0.125);
+    background: rgba(0, 0, 0, 0.04);
+
+    font-size: 0.8em;
+
+}
+
+#guac-menu #share-links h3 {
+    padding-bottom: 0;
+}
+
+#guac-menu #share-links th {
+    white-space: nowrap;
+}
+
+#guac-menu #share-links a[href] {
+
+    display: block;
+    padding: 0 1em;
+
+    font-family: monospace;
+    font-weight: bold;
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/73c2e689/guacamole/src/main/webapp/app/client/templates/client.html
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/client/templates/client.html b/guacamole/src/main/webapp/app/client/templates/client.html
index 2214d58..0580c8b 100644
--- a/guacamole/src/main/webapp/app/client/templates/client.html
+++ b/guacamole/src/main/webapp/app/client/templates/client.html
@@ -44,7 +44,7 @@
             <div class="header">
                 <h2>{{client.name}}</h2>
                 <div class="share-menu" ng-show="canShareConnection()">
-                    <guac-menu title="'CLIENT.ACTION_SHARE' | translate">
+                    <guac-menu menu-title="'CLIENT.ACTION_SHARE' | translate">
                         <ul ng-repeat="sharingProfile in sharingProfiles">
                             <li><a ng-click="share(sharingProfile)">{{sharingProfile.name}}</a></li>
                         </ul>
@@ -56,6 +56,22 @@
             <!-- Scrollable body -->
             <div class="menu-body" guac-touch-drag="menuDrag" guac-scroll="menu.scrollState">
 
+                <!-- Connection sharing -->
+                <div class="menu-section" id="share-links" ng-show="isShared()">
+                    <div class="content">
+                        <h3>{{'CLIENT.INFO_CONNECTION_SHARED' | translate}}</h3>
+                        <p class="description"
+                           translate="CLIENT.HELP_SHARE_LINK"
+                           translate-values="{LINKS : getShareLinkCount()}"></p>
+                        <table>
+                            <tr ng-repeat="link in client.shareLinks | orderBy: name">
+                                <th>{{link.name}}</th>
+                                <td><a href="{{link.href}}" target="_blank">{{link.href}}</a></td>
+                            </tr>
+                        </table>
+                    </div>
+                </div>
+
                 <!-- Clipboard -->
                 <div class="menu-section" id="clipboard-settings">
                     <h3>{{'CLIENT.SECTION_HEADER_CLIPBOARD' | translate}}</h3>

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/73c2e689/guacamole/src/main/webapp/app/client/types/ManagedClient.js
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/client/types/ManagedClient.js b/guacamole/src/main/webapp/app/client/types/ManagedClient.js
index 7b1d588..213a42e 100644
--- a/guacamole/src/main/webapp/app/client/types/ManagedClient.js
+++ b/guacamole/src/main/webapp/app/client/types/ManagedClient.js
@@ -31,6 +31,7 @@ angular.module('client').factory('ManagedClient', ['$rootScope', '$injector',
     var ManagedDisplay       = $injector.get('ManagedDisplay');
     var ManagedFilesystem    = $injector.get('ManagedFilesystem');
     var ManagedFileUpload    = $injector.get('ManagedFileUpload');
+    var ManagedShareLink     = $injector.get('ManagedShareLink');
 
     // Required services
     var $document              = $injector.get('$document');
@@ -126,6 +127,15 @@ angular.module('client').factory('ManagedClient', ['$rootScope', '$injector',
         this.filesystems = template.filesystems || [];
 
         /**
+         * All available share links generated for the this ManagedClient via
+         * ManagedClient.createShareLink(). Each resulting share link is stored
+         * under the identifier of its corresponding SharingProfile.
+         *
+         * @type Object.<String, ManagedShareLink>
+         */
+        this.shareLinks = template.shareLinks || {};
+
+        /**
          * The current state of the Guacamole client (idle, connecting,
          * connected, terminated with error, etc.).
          * 
@@ -585,6 +595,62 @@ angular.module('client').factory('ManagedClient', ['$rootScope', '$injector',
 
     };
 
+    /**
+     * Produces a sharing link for the given ManagedClient using the given
+     * sharing profile. The resulting sharing link, and any required login
+     * information, can be retrieved from the <code>shareLinks</code> property
+     * of the given ManagedClient once the various underlying service calls
+     * succeed.
+     *
+     * @param {ManagedClient} client
+     *     The ManagedClient which will be shared via the generated sharing
+     *     link.
+     *
+     * @param {SharingProfile} sharingProfile
+     *     The sharing profile to use to generate the sharing link.
+     *
+     * @returns {Promise}
+     *     A Promise which is resolved once the sharing link has been
+     *     successfully generated, and rejected if generating the link fails.
+     */
+    ManagedClient.createShareLink = function createShareLink(client, sharingProfile) {
+
+        // Retrieve sharing credentials for the sake of generating a share link
+        var credentialRequest = tunnelService.getSharingCredentials(
+                client.tunnel.uuid, sharingProfile.identifier);
+
+        // Add a new share link once the credentials are ready
+        credentialRequest.success(function sharingCredentialsReceived(sharingCredentials) {
+            client.shareLinks[sharingProfile.identifier] =
+                ManagedShareLink.getInstance(sharingProfile, sharingCredentials);
+        });
+
+        return credentialRequest;
+
+    };
+
+    /**
+     * Returns whether the given ManagedClient is being shared. A ManagedClient
+     * is shared if it has any associated share links.
+     *
+     * @param {ManagedClient} client
+     *     The ManagedClient to check.
+     *
+     * @returns {Boolean}
+     *     true if the ManagedClient has at least one associated share link,
+     *     false otherwise.
+     */
+    ManagedClient.isShared = function isShared(client) {
+
+        // The connection is shared if at least one share link exists
+        for (var dummy in client.shareLinks)
+            return true;
+
+        // No share links currently exist
+        return false;
+
+    };
+
     return ManagedClient;
 
 }]);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/73c2e689/guacamole/src/main/webapp/app/client/types/ManagedShareLink.js
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/client/types/ManagedShareLink.js b/guacamole/src/main/webapp/app/client/types/ManagedShareLink.js
new file mode 100644
index 0000000..6afa93d
--- /dev/null
+++ b/guacamole/src/main/webapp/app/client/types/ManagedShareLink.js
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Provides the ManagedShareLink class used by ManagedClient to represent
+ * generated connection sharing links.
+ */
+angular.module('client').factory('ManagedShareLink', ['$injector',
+    function defineManagedShareLink($injector) {
+
+    // Required types
+    var UserCredentials = $injector.get('UserCredentials');
+
+    /**
+     * Object which represents a link which can be used to gain access to an
+     * active Guacamole connection.
+     * 
+     * @constructor
+     * @param {ManagedShareLink|Object} [template={}]
+     *     The object whose properties should be copied within the new
+     *     ManagedShareLink.
+     */
+    var ManagedShareLink = function ManagedShareLink(template) {
+
+        // Use empty object by default
+        template = template || {};
+
+        /**
+         * The human-readable display name of this share link.
+         *
+         * @type String
+         */
+        this.name = template.name;
+
+        /**
+         * The actual URL of the link which can be used to access the shared
+         * connection.
+         *
+         * @type String
+         */
+        this.href = template.href;
+
+        /**
+         * The sharing profile which was used to generate the share link.
+         *
+         * @type SharingProfile
+         */
+        this.sharingProfile = template.sharingProfile;
+
+        /**
+         * The credentials from which the share link was derived.
+         *
+         * @type UserCredentials
+         */
+        this.sharingCredentials = template.sharingCredentials;
+
+    };
+
+    /**
+     * Creates a new ManagedShareLink from a set of UserCredentials and the
+     * SharingProfile which was used to generate those UserCredentials.
+     * 
+     * @param {SharingProfile} sharingProfile
+     *     The SharingProfile which was used, via the REST API, to generate the
+     *     given UserCredentials.
+     * 
+     * @param {UserCredentials} sharingCredentials
+     *     The UserCredentials object returned by the REST API in response to a
+     *     request to share a connection using the given SharingProfile.
+     *
+     * @return {ManagedShareLink}
+     *     A new ManagedShareLink object can be used to access the connection
+     *     shared via the given SharingProfile and resulting UserCredentials.
+     */
+    ManagedShareLink.getInstance = function getInstance(sharingProfile, sharingCredentials) {
+
+        // Generate new share link using the given profile and credentials
+        return new ManagedShareLink({
+            'name'               : sharingProfile.name,
+            'href'               : UserCredentials.getLink(sharingCredentials),
+            'sharingProfile'     : sharingProfile,
+            'sharingCredentials' : sharingCredentials
+        });
+
+    };
+
+    return ManagedShareLink;
+
+}]);

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/73c2e689/guacamole/src/main/webapp/translations/en.json
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/translations/en.json b/guacamole/src/main/webapp/translations/en.json
index 9e65d20..3c9ce9c 100644
--- a/guacamole/src/main/webapp/translations/en.json
+++ b/guacamole/src/main/webapp/translations/en.json
@@ -103,7 +103,9 @@
         "HELP_MOUSE_MODE"          : "Determines how the remote mouse behaves with respect to touches.",
         "HELP_MOUSE_MODE_ABSOLUTE" : "Tap to click. The click occurs at the location of the touch.",
         "HELP_MOUSE_MODE_RELATIVE" : "Drag to move the mouse pointer and tap to click. The click occurs at the location of the pointer.",
+        "HELP_SHARE_LINK"          : "The current connection is being shared, and can be accessed by anyone with the following {LINKS, plural, one{link} other{links}}:",
 
+        "INFO_CONNECTION_SHARED" : "This connection is now shared.",
         "INFO_NO_FILE_TRANSFERS" : "No file transfers.",
 
         "NAME_INPUT_METHOD_NONE"   : "None",


[3/7] incubator-guacamole-client git commit: GUACAMOLE-5: Clean up header and dropdown style.

Posted by jm...@apache.org.
GUACAMOLE-5: Clean up header and dropdown style.


Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/commit/3484d323
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/3484d323
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/3484d323

Branch: refs/heads/master
Commit: 3484d323020ef0b1d3a6f773db3fa345ed5d25f7
Parents: 8b193ad
Author: Michael Jumper <mj...@apache.org>
Authored: Mon Jul 25 01:54:04 2016 -0700
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Aug 2 13:25:15 2016 -0700

----------------------------------------------------------------------
 guacamole/src/main/webapp/app/client/styles/client.css        | 4 ++++
 guacamole/src/main/webapp/app/index/styles/headers.css        | 4 ++--
 guacamole/src/main/webapp/app/manage/styles/attributes.css    | 2 +-
 guacamole/src/main/webapp/app/navigation/styles/menu.css      | 5 +++--
 guacamole/src/main/webapp/app/navigation/styles/user-menu.css | 3 +--
 5 files changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/3484d323/guacamole/src/main/webapp/app/client/styles/client.css
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/client/styles/client.css b/guacamole/src/main/webapp/app/client/styles/client.css
index c110948..17c7bf8 100644
--- a/guacamole/src/main/webapp/app/client/styles/client.css
+++ b/guacamole/src/main/webapp/app/client/styles/client.css
@@ -116,6 +116,10 @@ body.client {
 
 }
 
+.client .menu .header h2 {
+    text-transform: none;
+}
+
 .client .user-menu .options li a.disconnect {
     background-repeat: no-repeat;
     background-size: 1em;

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/3484d323/guacamole/src/main/webapp/app/index/styles/headers.css
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/index/styles/headers.css b/guacamole/src/main/webapp/app/index/styles/headers.css
index a99364a..2e813f4 100644
--- a/guacamole/src/main/webapp/app/index/styles/headers.css
+++ b/guacamole/src/main/webapp/app/index/styles/headers.css
@@ -32,7 +32,7 @@ h2 {
     font-size: 1.25em;
     font-weight: bold;
     text-transform: uppercase;
-    padding: 0.75em 0.5em;
+    padding: 0.5em;
     margin: 0;
 }
 
@@ -90,7 +90,7 @@ h2 {
 
 .header .filter {
     margin: 0;
-    padding: 0.75em 0.5em;
+    padding: 0.5em;
 }
 
 .header .filter input {

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/3484d323/guacamole/src/main/webapp/app/manage/styles/attributes.css
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/manage/styles/attributes.css b/guacamole/src/main/webapp/app/manage/styles/attributes.css
index 70871b0..136ec5d 100644
--- a/guacamole/src/main/webapp/app/manage/styles/attributes.css
+++ b/guacamole/src/main/webapp/app/manage/styles/attributes.css
@@ -49,7 +49,7 @@
     font-size: 1.25em;
     font-weight: bold;
     text-transform: uppercase;
-    padding: 0.75em 0.5em;
+    padding: 0.5em;
     margin: 1em 0;
 
     border-bottom: 1px solid rgba(0, 0, 0, 0.125);

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/3484d323/guacamole/src/main/webapp/app/navigation/styles/menu.css
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/navigation/styles/menu.css b/guacamole/src/main/webapp/app/navigation/styles/menu.css
index c402158..4a7c134 100644
--- a/guacamole/src/main/webapp/app/navigation/styles/menu.css
+++ b/guacamole/src/main/webapp/app/navigation/styles/menu.css
@@ -65,8 +65,8 @@
 
     cursor: default;
     margin: 0;
-    min-width: 2in;
     padding: 0.5em;
+    padding-right: 2em;
 
     -ms-flex: 0 0 auto;
     -moz-box-flex: 0;
@@ -98,7 +98,8 @@
     position: absolute;
     top: 100%;
     right: 0;
-    left: -1px;
+    min-width: 100%;
+    white-space: nowrap;
 
     background: #EEE;
     box-shadow: 0 2px 2px rgba(0, 0, 0, 0.125);

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/3484d323/guacamole/src/main/webapp/app/navigation/styles/user-menu.css
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/navigation/styles/user-menu.css b/guacamole/src/main/webapp/app/navigation/styles/user-menu.css
index 7d679ed..9acecc8 100644
--- a/guacamole/src/main/webapp/app/navigation/styles/user-menu.css
+++ b/guacamole/src/main/webapp/app/navigation/styles/user-menu.css
@@ -48,9 +48,8 @@
 
 .user-menu .menu-dropdown .menu-title {
 
-    font-size: 1.25em;
     font-weight: bold;
-    padding: 0.5em 2em;
+    padding-left: 2em;
 
     background-repeat: no-repeat;
     background-size: 1em;


[4/7] incubator-guacamole-client git commit: GUACAMOLE-5: Add sharing support to the Guacamole client UI.

Posted by jm...@apache.org.
GUACAMOLE-5: Add sharing support to the Guacamole client UI.


Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/commit/91254f7f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/91254f7f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/91254f7f

Branch: refs/heads/master
Commit: 91254f7f982eed8b322c32b4f675bfbeec134e94
Parents: 3484d32
Author: Michael Jumper <mj...@apache.org>
Authored: Mon Jul 25 02:28:56 2016 -0700
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Aug 2 13:25:15 2016 -0700

----------------------------------------------------------------------
 .../app/client/controllers/clientController.js  | 72 ++++++++++++++++++++
 .../webapp/app/client/templates/client.html     |  5 ++
 guacamole/src/main/webapp/translations/en.json  |  2 +
 3 files changed, 79 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/91254f7f/guacamole/src/main/webapp/app/client/controllers/clientController.js
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/client/controllers/clientController.js b/guacamole/src/main/webapp/app/client/controllers/clientController.js
index 74aea62..d2f9d26 100644
--- a/guacamole/src/main/webapp/app/client/controllers/clientController.js
+++ b/guacamole/src/main/webapp/app/client/controllers/clientController.js
@@ -28,6 +28,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
     var ManagedClientState = $injector.get('ManagedClientState');
     var ManagedFilesystem  = $injector.get('ManagedFilesystem');
     var ScrollState        = $injector.get('ScrollState');
+    var UserCredentials    = $injector.get('UserCredentials');
 
     // Required services
     var $location             = $injector.get('$location');
@@ -36,6 +37,7 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
     var guacClientManager     = $injector.get('guacClientManager');
     var guacNotification      = $injector.get('guacNotification');
     var preferenceService     = $injector.get('preferenceService');
+    var tunnelService         = $injector.get('tunnelService');
     var userPageService       = $injector.get('userPageService');
 
     /**
@@ -236,6 +238,15 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
     $scope.client = guacClientManager.getManagedClient($routeParams.id, $routeParams.params);
 
     /**
+     * Map of all available sharing profiles for the current connection by
+     * their identifiers. If this information is not yet available, or no such
+     * sharing profiles exist, this will be an empty object.
+     *
+     * @type Object.<String, SharingProfile>
+     */
+    $scope.sharingProfiles = {};
+
+    /**
      * Map of all currently pressed keys by keysym. If a particular key is
      * currently pressed, the value stored under that key's keysym within this
      * map will be true. All keys not currently pressed will not have entries
@@ -406,6 +417,47 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
 
     });
 
+    // Pull sharing profiles once the tunnel UUID is known
+    $scope.$watch('client.tunnel.uuid', function retrieveSharingProfiles(uuid) {
+
+        // Only pull sharing profiles if tunnel UUID is actually available
+        if (!uuid)
+            return;
+
+        // Pull sharing profiles for the current connection
+        tunnelService.getSharingProfiles(uuid)
+        .success(function sharingProfilesRetrieved(sharingProfiles) {
+            $scope.sharingProfiles = sharingProfiles;
+        });
+
+    });
+
+    /**
+     * Produces a sharing link for the current connection using the given
+     * sharing profile. The resulting sharing link, and any required login
+     * information, will be displayed to the user once the various underlying
+     * service calls succeed.
+     *
+     * @param {SharingProfile} sharingProfile
+     *     The sharing profile to use to generate the sharing link.
+     */
+    $scope.share = function share(sharingProfile) {
+
+        // Retrieve sharing credentials for the sake of generating a share link
+        tunnelService.getSharingCredentials($scope.client.tunnel.uuid, sharingProfile.identifier)
+        .success(function sharingCredentialsReceived(sharingCredentials) {
+
+            // TODONT: COMPLETE HACK: Shove the share link into the clipboard
+            var href = UserCredentials.getLink(sharingCredentials);
+            $scope.client.clipboardData = {
+                'type' : 'text/plain',
+                'data' : href
+            };
+
+        });
+
+    };
+
     // Track pressed keys, opening the Guacamole menu after Ctrl+Alt+Shift
     $scope.$on('guacKeydown', function keydownListener(event, keysym, keyboard) {
 
@@ -762,6 +814,26 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
 
     };
 
+    /**
+     * Returns whether the current user can share the current connection with
+     * other users. A connection can be shared if and only if there is at least
+     * one associated sharing profile.
+     *
+     * @returns {Boolean}
+     *     true if the current user can share the current connection with other
+     *     users, false otherwise.
+     */
+    $scope.canShareConnection = function canShareConnection() {
+
+        // If there is at least one sharing profile, the connection can be shared
+        for (var dummy in $scope.sharingProfiles)
+            return true;
+
+        // Otherwise, sharing is not possible
+        return false;
+
+    };
+
     // Clean up when view destroyed
     $scope.$on('$destroy', function clientViewDestroyed() {
 

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/91254f7f/guacamole/src/main/webapp/app/client/templates/client.html
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/client/templates/client.html b/guacamole/src/main/webapp/app/client/templates/client.html
index 8a4e7fe..8b55838 100644
--- a/guacamole/src/main/webapp/app/client/templates/client.html
+++ b/guacamole/src/main/webapp/app/client/templates/client.html
@@ -43,6 +43,11 @@
             <!-- Stationary header -->
             <div class="header">
                 <h2>{{client.name}}</h2>
+                <guac-menu title="'CLIENT.ACTION_SHARE' | translate" ng-show="canShareConnection()">
+                    <ul ng-repeat="sharingProfile in sharingProfiles">
+                        <li><a ng-click="share(sharingProfile)">{{sharingProfile.name}}</a></li>
+                    </ul>
+                </guac-menu>
                 <guac-user-menu local-actions="clientMenuActions"></guac-user-menu>
             </div>
 

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/91254f7f/guacamole/src/main/webapp/translations/en.json
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/translations/en.json b/guacamole/src/main/webapp/translations/en.json
index 66ad359..9e65d20 100644
--- a/guacamole/src/main/webapp/translations/en.json
+++ b/guacamole/src/main/webapp/translations/en.json
@@ -24,6 +24,7 @@
         "ACTION_NAVIGATE_HOME"      : "Home",
         "ACTION_SAVE"               : "Save",
         "ACTION_SEARCH"             : "Search",
+        "ACTION_SHARE"              : "Share",
         "ACTION_UPDATE_PASSWORD"    : "Update Password",
         "ACTION_VIEW_HISTORY"       : "History",
 
@@ -55,6 +56,7 @@
         "ACTION_NAVIGATE_HOME"             : "@:APP.ACTION_NAVIGATE_HOME",
         "ACTION_RECONNECT"                 : "Reconnect",
         "ACTION_SAVE_FILE"                 : "@:APP.ACTION_SAVE",
+        "ACTION_SHARE"                     : "@:APP.ACTION_SHARE",
         "ACTION_UPLOAD_FILES"              : "Upload Files",
 
         "DIALOG_HEADER_CONNECTING"       : "Connecting",


[6/7] incubator-guacamole-client git commit: GUACAMOLE-5: Use more semantically-sound "menu-contents" class.

Posted by jm...@apache.org.
GUACAMOLE-5: Use more semantically-sound "menu-contents" class.

Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/commit/3f22d1d0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/3f22d1d0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/3f22d1d0

Branch: refs/heads/master
Commit: 3f22d1d09ab0caf7f1d836ea7d63ed729e79fc75
Parents: 73c2e68
Author: Michael Jumper <mj...@apache.org>
Authored: Tue Aug 2 14:24:37 2016 -0700
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Aug 2 14:24:37 2016 -0700

----------------------------------------------------------------------
 .../main/webapp/app/client/styles/client.css    |  2 +-
 .../main/webapp/app/navigation/styles/menu.css  | 20 ++++++++++----------
 .../webapp/app/navigation/styles/user-menu.css  | 15 ++++++++-------
 .../app/navigation/templates/guacMenu.html      |  4 ++--
 4 files changed, 21 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/3f22d1d0/guacamole/src/main/webapp/app/client/styles/client.css
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/client/styles/client.css b/guacamole/src/main/webapp/app/client/styles/client.css
index 17c7bf8..9ec74b6 100644
--- a/guacamole/src/main/webapp/app/client/styles/client.css
+++ b/guacamole/src/main/webapp/app/client/styles/client.css
@@ -120,7 +120,7 @@ body.client {
     text-transform: none;
 }
 
-.client .user-menu .options li a.disconnect {
+.client .user-menu .menu-contents li a.disconnect {
     background-repeat: no-repeat;
     background-size: 1em;
     background-position: 0.75em center;

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/3f22d1d0/guacamole/src/main/webapp/app/navigation/styles/menu.css
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/navigation/styles/menu.css b/guacamole/src/main/webapp/app/navigation/styles/menu.css
index 4a7c134..1e4e75e 100644
--- a/guacamole/src/main/webapp/app/navigation/styles/menu.css
+++ b/guacamole/src/main/webapp/app/navigation/styles/menu.css
@@ -91,7 +91,7 @@
 
 }
 
-.menu-dropdown .options {
+.menu-dropdown .menu-contents {
 
     visibility: hidden;
 
@@ -110,21 +110,21 @@
     
 }
 
-.menu-dropdown .options ul {
+.menu-dropdown .menu-contents ul {
     margin: 0;
     padding: 0;
 }
 
-.menu-dropdown.open .options {
+.menu-dropdown.open .menu-contents {
     visibility: visible;
 }
 
-.menu-dropdown .options li {
+.menu-dropdown .menu-contents li {
     padding: 0;
     list-style-type: none;
 }
 
-.menu-dropdown .options li a {
+.menu-dropdown .menu-contents li a {
 
     display: block;
     cursor: pointer;
@@ -134,23 +134,23 @@
 
 }
 
-.menu-dropdown .options li a:hover {
+.menu-dropdown .menu-contents li a:hover {
     background-color: #CDA;
 }
 
-.menu-dropdown .options li a.current,
-.menu-dropdown .options li a.current:hover {
+.menu-dropdown .menu-contents li a.current,
+.menu-dropdown .menu-contents li a.current:hover {
     background-color: transparent;
     cursor: default;
     opacity: 0.25;
 }
 
-.menu-dropdown .options li a.danger {
+.menu-dropdown .menu-contents li a.danger {
     color: white;
     font-weight: bold;
     background-color: #A43;
 }
 
-.menu-dropdown .options li a.danger:hover {
+.menu-dropdown .menu-contents li a.danger:hover {
     background-color: #C54;
 }

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/3f22d1d0/guacamole/src/main/webapp/app/navigation/styles/user-menu.css
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/navigation/styles/user-menu.css b/guacamole/src/main/webapp/app/navigation/styles/user-menu.css
index 9acecc8..b7fce98 100644
--- a/guacamole/src/main/webapp/app/navigation/styles/user-menu.css
+++ b/guacamole/src/main/webapp/app/navigation/styles/user-menu.css
@@ -58,7 +58,7 @@
 
 }
 
-.user-menu .menu-dropdown .options li a {
+.user-menu .menu-dropdown .menu-contents li a {
 
     background-repeat: no-repeat;
     background-size: 1em;
@@ -67,17 +67,18 @@
     background-image: url('images/protocol-icons/guac-monitor.png');
 
 }
-.user-menu .menu-dropdown .options li a[href="#/"] {
+
+.user-menu .menu-dropdown .menu-contents li a[href="#/"] {
     background-image: url('images/action-icons/guac-home-dark.png');
 }
 
-.user-menu .menu-dropdown .options li a[href="#/settings/users"],
-.user-menu .menu-dropdown .options li a[href="#/settings/connections"],
-.user-menu .menu-dropdown .options li a[href="#/settings/sessions"],
-.user-menu .menu-dropdown .options li a[href="#/settings/preferences"] {
+.user-menu .menu-dropdown .menu-contents li a[href="#/settings/users"],
+.user-menu .menu-dropdown .menu-contents li a[href="#/settings/connections"],
+.user-menu .menu-dropdown .menu-contents li a[href="#/settings/sessions"],
+.user-menu .menu-dropdown .menu-contents li a[href="#/settings/preferences"] {
     background-image: url('images/action-icons/guac-config-dark.png');
 }
 
-.user-menu .menu-dropdown .options li a.logout {
+.user-menu .menu-dropdown .menu-contents li a.logout {
     background-image: url('images/action-icons/guac-logout-dark.png');
 }

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/3f22d1d0/guacamole/src/main/webapp/app/navigation/templates/guacMenu.html
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/navigation/templates/guacMenu.html b/guacamole/src/main/webapp/app/navigation/templates/guacMenu.html
index f1785cd..f7ddee9 100644
--- a/guacamole/src/main/webapp/app/navigation/templates/guacMenu.html
+++ b/guacamole/src/main/webapp/app/navigation/templates/guacMenu.html
@@ -2,6 +2,6 @@
     <div class="menu-title">{{menuTitle}}</div>
     <div class="menu-indicator"></div>
 
-    <!-- Menu options -->
-    <div class="options" ng-transclude></div>
+    <!-- Menu contents -->
+    <div class="menu-contents" ng-transclude></div>
 </div>


[7/7] incubator-guacamole-client git commit: GUACAMOLE-5: Merge new connection sharing UI.

Posted by jm...@apache.org.
GUACAMOLE-5: Merge new connection sharing UI.


Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/commit/841bc476
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/841bc476
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/841bc476

Branch: refs/heads/master
Commit: 841bc4761aaac8b186da77cdf5ce2c3415e2e87a
Parents: 468a552 3f22d1d
Author: James Muehlner <ja...@guac-dev.org>
Authored: Tue Aug 2 15:56:17 2016 -0700
Committer: James Muehlner <ja...@guac-dev.org>
Committed: Tue Aug 2 15:56:17 2016 -0700

----------------------------------------------------------------------
 .../app/client/controllers/clientController.js  |  87 +++++++++++
 .../main/webapp/app/client/styles/client.css    |   6 +-
 .../main/webapp/app/client/styles/guac-menu.css |  28 ++++
 .../webapp/app/client/styles/share-menu.css     |  58 +++++++
 .../webapp/app/client/templates/client.html     |  23 +++
 .../webapp/app/client/types/ManagedClient.js    |  66 ++++++++
 .../webapp/app/client/types/ManagedShareLink.js | 105 +++++++++++++
 .../main/webapp/app/index/styles/headers.css    |   4 +-
 .../webapp/app/manage/styles/attributes.css     |   2 +-
 .../app/navigation/directives/guacMenu.js       |  91 +++++++++++
 .../app/navigation/directives/guacUserMenu.js   |  44 +-----
 .../main/webapp/app/navigation/styles/menu.css  | 156 +++++++++++++++++++
 .../webapp/app/navigation/styles/user-menu.css  | 147 ++---------------
 .../app/navigation/templates/guacMenu.html      |   7 +
 .../app/navigation/templates/guacUserMenu.html  |  50 +++---
 guacamole/src/main/webapp/images/share.png      | Bin 0 -> 1112 bytes
 guacamole/src/main/webapp/translations/en.json  |   4 +
 17 files changed, 665 insertions(+), 213 deletions(-)
----------------------------------------------------------------------