From ac220162dd6d9ac64e71cfb120b80beb6c1aa635 Mon Sep 17 00:00:00 2001 From: Chad Pilkey Date: Wed, 4 Feb 2015 12:33:08 -0800 Subject: [PATCH] add a context menu item to UserGrid to export user names --- .../locale/en_US/bbbResources.properties | 1 + .../modules/chat/model/ChatConversation.as | 5 +++- .../modules/users/views/UsersWindow.mxml | 23 +++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/bigbluebutton-client/locale/en_US/bbbResources.properties b/bigbluebutton-client/locale/en_US/bbbResources.properties index 7fb5ce9c6b..bc55ecb214 100755 --- a/bigbluebutton-client/locale/en_US/bbbResources.properties +++ b/bigbluebutton-client/locale/en_US/bbbResources.properties @@ -137,6 +137,7 @@ bbb.users.muteMeBtnTxt.talk = Unmute bbb.users.muteMeBtnTxt.mute = Mute bbb.users.muteMeBtnTxt.muted = Muted bbb.users.muteMeBtnTxt.unmuted = Unmuted +bbb.users.usersGrid.contextmenu.exportusers = Copy User Names bbb.users.usersGrid.accessibilityName = Users List. Use the arrow keys to navigate. bbb.users.usersGrid.nameItemRenderer = Name bbb.users.usersGrid.nameItemRenderer.youIdentifier = you diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/model/ChatConversation.as b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/model/ChatConversation.as index 7e600a2651..1fc9c8422e 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/model/ChatConversation.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/model/ChatConversation.as @@ -18,6 +18,8 @@ */ package org.bigbluebutton.modules.chat.model { + import flash.system.Capabilities; + import mx.collections.ArrayCollection; import org.bigbluebutton.common.LogUtil; @@ -62,9 +64,10 @@ package org.bigbluebutton.modules.chat.model public function getAllMessageAsString():String{ var allText:String = ""; + var returnStr:String = (Capabilities.os.indexOf("Windows") >= 0 ? "\r\n" : "\r"); for (var i:int = 0; i < messages.length; i++){ var item:ChatMessage = messages.getItemAt(i) as ChatMessage; - allText += "\n" + item.name + " - " + item.time + " : " + item.text; + allText += item.name + " - " + item.time + " : " + item.text + returnStr; } return allText; } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/users/views/UsersWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/users/views/UsersWindow.mxml index d85d0321ca..605a7f02a9 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/users/views/UsersWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/users/views/UsersWindow.mxml @@ -135,12 +135,35 @@ stage.addEventListener(MouseEvent.MOUSE_OVER, handleStageMouseOver); usersGrid.addEventListener(MouseEvent.MOUSE_OVER, handleUsersGridMouseOver); + + addContextMenuItems(); } public function getPrefferedPosition():String{ return MainCanvas.TOP_LEFT; } + private function addContextMenuItems():void { + var contextMenu:ContextMenu = new ContextMenu(); + contextMenu.hideBuiltInItems(); + + var exportUsersItem:ContextMenuItem = new ContextMenuItem(ResourceUtil.getInstance().getString("bbb.users.usersGrid.contextmenu.exportusers")); + exportUsersItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, exportUsersItemHandler); + contextMenu.customItems.push(exportUsersItem); + + this.contextMenu = contextMenu; + } + + private function exportUsersItemHandler(e:ContextMenuEvent):void{ + if (e.target.caption == ResourceUtil.getInstance().getString("bbb.users.usersGrid.contextmenu.exportusers")) { + var userNames:String = ""; + var returnStr:String = (Capabilities.os.indexOf("Windows") >= 0 ? "\r\n" : "\r"); + for (var i:int = 0; i < users.length; i++) { + userNames += users[i].name + returnStr; + } + System.setClipboard(userNames); + } + } private function updateNumberofUsers(numUsers:int):void { if (numUsers > 8)