From 8dd9ee08e0698aa95596d28987595dce6a5c5fe5 Mon Sep 17 00:00:00 2001 From: Felipe Cecagno Date: Thu, 9 Apr 2015 17:21:37 -0300 Subject: [PATCH 1/3] created a new class CustomMdiWindow to proper handle the context menu --- .../src/SharedNotesModule.mxml | 4 +- .../bigbluebutton/common/CustomMdiWindow.as | 91 +++++++++++++++++++ .../bigbluebutton/main/views/LogWindow.mxml | 4 +- .../main/views/MainApplicationShell.mxml | 1 - .../main/views/NetworkStatsWindow.mxml | 4 +- .../main/views/ShortcutHelpWindow.mxml | 4 +- .../broadcast/views/BroadcastWindow.mxml | 7 +- .../modules/chat/views/ChatView.mxml | 1 - .../modules/chat/views/ChatWindow.mxml | 5 +- .../view/components/DesktopPublishWindow.mxml | 7 +- .../view/components/DesktopViewWindow.mxml | 4 +- .../modules/example/ExampleChatWindow.mxml | 6 +- .../modules/layout/views/LayoutsCombo.mxml | 2 - .../modules/notes/views/NotesWindow.mxml | 6 +- .../polling/views/CreatePollWindow.mxml | 4 +- .../polling/views/DisplayResultWindow.mxml | 4 +- .../polling/views/PollCreateWindow.mxml | 6 +- .../modules/polling/views/PollMainWindow.mxml | 4 +- .../modules/polling/views/TakePollWindow.mxml | 4 +- .../polling/views/UpdatePollWindow.mxml | 4 +- .../present/ui/views/PresentationWindow.mxml | 18 ++-- .../sharednotes/SharedNotesWindow.mxml | 4 +- .../modules/users/views/UsersWindow.mxml | 6 +- .../videoconf/business/VideoWindowItf.as | 6 +- .../modules/videodock/views/VideoDock.mxml | 8 +- .../whiteboard/views/WhiteboardToolbar.mxml | 1 - 26 files changed, 146 insertions(+), 69 deletions(-) create mode 100644 bigbluebutton-client/src/org/bigbluebutton/common/CustomMdiWindow.as diff --git a/bigbluebutton-client/src/SharedNotesModule.mxml b/bigbluebutton-client/src/SharedNotesModule.mxml index 3011c8dc67..013bbadb9f 100755 --- a/bigbluebutton-client/src/SharedNotesModule.mxml +++ b/bigbluebutton-client/src/SharedNotesModule.mxml @@ -25,8 +25,6 @@ with BigBlueButton; if not, see . . public function stop():void {} ]]> - \ No newline at end of file + diff --git a/bigbluebutton-client/src/org/bigbluebutton/common/CustomMdiWindow.as b/bigbluebutton-client/src/org/bigbluebutton/common/CustomMdiWindow.as new file mode 100644 index 0000000000..2454ba9a20 --- /dev/null +++ b/bigbluebutton-client/src/org/bigbluebutton/common/CustomMdiWindow.as @@ -0,0 +1,91 @@ +/** +* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ +* +* Copyright (c) 2015 BigBlueButton Inc. and by respective authors (see below). +* +* This program is free software; you can redistribute it and/or modify it under the +* terms of the GNU Lesser General Public License as published by the Free Software +* Foundation; either version 3.0 of the License, or (at your option) any later +* version. +* +* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY +* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public License along +* with BigBlueButton; if not, see . +* +*/ +package org.bigbluebutton.common +{ + import flash.ui.ContextMenu; + + import flexlib.mdi.containers.MDIWindow; + import flexlib.mdi.managers.MDIManager; + + import mx.utils.ObjectUtil; + + /** + * This class exists so we can properly handle context menus on MDIWindow + * instances. Also, we'll be able in the future to properly handle shortcuts + * such as SHIFT + LEFT/RIGHT ARROW while in a text area (today, besides + * selecting the text, it will move the window). + */ + public class CustomMdiWindow extends MDIWindow { + + private static const IGNORED_MENU_ITEMS:Array = new Array( + MDIWindow.CONTEXT_MENU_LABEL_CLOSE, + MDIManager.CONTEXT_MENU_LABEL_TILE, + MDIManager.CONTEXT_MENU_LABEL_TILE_FILL, + MDIManager.CONTEXT_MENU_LABEL_CASCADE, + MDIManager.CONTEXT_MENU_LABEL_SHOW_ALL ); + + private var _customContextMenuItems:Array = null; + + private function filterContextMenu(item:*, index:int, array:Array):Boolean { + return IGNORED_MENU_ITEMS.indexOf(item.caption) < 0; + } + + override public function updateContextMenu():void { + super.updateContextMenu(); + + var modifiedContextMenuItems:Array = new Array(); + + if (customContextMenuItems != null) { + if (modifiedContextMenuItems.length > 0 && customContextMenuItems.length > 0) { + modifiedContextMenuItems[0].separatorBefore = true; + } + modifiedContextMenuItems = customContextMenuItems.concat(modifiedContextMenuItems); + } + + if (this.contextMenu != null) { + var filteredMenu:Array = this.contextMenu.customItems.filter(filterContextMenu); + if (modifiedContextMenuItems.length > 0 && filteredMenu.length > 0) { + filteredMenu[0].separatorBefore = true; + } + modifiedContextMenuItems = modifiedContextMenuItems.concat(filteredMenu); + } + + var modifiedContextMenu:ContextMenu = new ContextMenu(); + modifiedContextMenu.hideBuiltInItems(); + modifiedContextMenu.customItems = modifiedContextMenuItems; + this.contextMenu = modifiedContextMenu; + } + + override public function set showCloseButton(value:Boolean):void { + super.showCloseButton = value; + + updateContextMenu(); + } + + public function get customContextMenuItems():Array { + return _customContextMenuItems; + } + + public function set customContextMenuItems(value:Array):void { + _customContextMenuItems = value; + + updateContextMenu(); + } + } +} diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/LogWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/LogWindow.mxml index a1ce7af674..b51e551c2a 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/LogWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/LogWindow.mxml @@ -20,7 +20,7 @@ with BigBlueButton; if not, see . --> - @@ -88,4 +88,4 @@ with BigBlueButton; if not, see . - + diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml index 9bc4caf5a0..f394047cce 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/MainApplicationShell.mxml @@ -65,7 +65,6 @@ with BigBlueButton; if not, see . import flash.events.MouseEvent; import flash.geom.Point; - import flexlib.mdi.containers.MDIWindow; import flexlib.mdi.effects.effectsLib.MDIVistaEffects; import mx.collections.ArrayCollection; diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/NetworkStatsWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/NetworkStatsWindow.mxml index 24e10968bd..8eeb5600c8 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/NetworkStatsWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/NetworkStatsWindow.mxml @@ -20,7 +20,7 @@ with BigBlueButton; if not, see . --> -. - + diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/views/ShortcutHelpWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/main/views/ShortcutHelpWindow.mxml index c58dfbccba..f0f0a61e31 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/views/ShortcutHelpWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/main/views/ShortcutHelpWindow.mxml @@ -20,7 +20,7 @@ with BigBlueButton; if not, see . --> -. - \ No newline at end of file + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/broadcast/views/BroadcastWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/broadcast/views/BroadcastWindow.mxml index ee181b4151..8b2c7e7a19 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/broadcast/views/BroadcastWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/broadcast/views/BroadcastWindow.mxml @@ -18,8 +18,8 @@ You should have received a copy of the GNU Lesser General Public License along with BigBlueButton; if not, see . --> -. . - + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatView.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatView.mxml index 6407208e3a..c69f2ffc1f 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatView.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatView.mxml @@ -45,7 +45,6 @@ with BigBlueButton; if not, see . import flexlib.controls.tabBarClasses.SuperTab; import flexlib.controls.textClasses.StringBoundaries; import flexlib.events.SuperTabEvent; - import flexlib.mdi.containers.MDIWindow; import mx.collections.ArrayCollection; import mx.containers.ControlBar; import mx.controls.Button; diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatWindow.mxml index 8f1b8615be..a3e33189b3 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/chat/views/ChatWindow.mxml @@ -20,7 +20,7 @@ with BigBlueButton; if not, see . --> -. . - + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/deskshare/view/components/DesktopPublishWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/deskshare/view/components/DesktopPublishWindow.mxml index 07dd924462..52b332f3f3 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/deskshare/view/components/DesktopPublishWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/deskshare/view/components/DesktopPublishWindow.mxml @@ -20,11 +20,11 @@ with BigBlueButton; if not, see . --> -. . - + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/deskshare/view/components/DesktopViewWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/deskshare/view/components/DesktopViewWindow.mxml index da4bed5198..d17a955645 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/deskshare/view/components/DesktopViewWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/deskshare/view/components/DesktopViewWindow.mxml @@ -20,7 +20,7 @@ with BigBlueButton; if not, see . --> -. toolTip="{btnActualSize.selected ? ResourceUtil.getInstance().getString('bbb.desktopView.fitToWindow') : ResourceUtil.getInstance().getString('bbb.desktopView.actualSize')}" tabIndex="{baseIndex+4}"/> - + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/example/ExampleChatWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/example/ExampleChatWindow.mxml index 44190340a1..440cd20ba3 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/example/ExampleChatWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/example/ExampleChatWindow.mxml @@ -23,15 +23,13 @@ with BigBlueButton; if not, see . - - + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/views/LayoutsCombo.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/views/LayoutsCombo.mxml index bb44f9832b..d7e6cf4377 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/layout/views/LayoutsCombo.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/layout/views/LayoutsCombo.mxml @@ -42,9 +42,7 @@ with BigBlueButton; if not, see . import flash.net.FileReference; import flexlib.mdi.containers.MDICanvas; - import flexlib.mdi.containers.MDIWindow; import flexlib.mdi.events.MDIManagerEvent; - import flexlib.mdi.events.MDIWindowEvent; import flexlib.mdi.managers.MDIManager; import mx.collections.ArrayCollection; diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/notes/views/NotesWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/notes/views/NotesWindow.mxml index 5ce874e19e..aee2c3212b 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/notes/views/NotesWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/notes/views/NotesWindow.mxml @@ -18,8 +18,8 @@ You should have received a copy of the GNU Lesser General Public License along with BigBlueButton; if not, see . --> -. - + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/CreatePollWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/CreatePollWindow.mxml index 6a19993906..154ac2fe2c 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/CreatePollWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/CreatePollWindow.mxml @@ -18,7 +18,7 @@ $Id: $ - - + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/DisplayResultWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/DisplayResultWindow.mxml index 2aefa685ec..27feb48dbf 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/DisplayResultWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/DisplayResultWindow.mxml @@ -20,7 +20,7 @@ $Id: $ --> - - + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollCreateWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollCreateWindow.mxml index 943591a93a..5b0ed2d6ad 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollCreateWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollCreateWindow.mxml @@ -18,7 +18,7 @@ $Id: $ - - + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollMainWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollMainWindow.mxml index 3c32c6c309..1a4c1e8555 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollMainWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollMainWindow.mxml @@ -18,7 +18,7 @@ $Id: $ - - + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/TakePollWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/TakePollWindow.mxml index 35ebc69901..0e30c15256 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/TakePollWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/TakePollWindow.mxml @@ -18,7 +18,7 @@ $Id: $ - - + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/UpdatePollWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/UpdatePollWindow.mxml index 43b7208b3d..e5d17be480 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/UpdatePollWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/UpdatePollWindow.mxml @@ -18,7 +18,7 @@ $Id: $ - - + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml index 25bc78db74..d13f1a63d9 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml @@ -21,9 +21,9 @@ with BigBlueButton; if not, see . --> -. private function becomeViewer():void{ setupPresenter(false); dispatchEvent(new UploadEvent(UploadEvent.CLOSE_UPLOAD_WINDOW)); - this.contextMenu = new ContextMenu(); - this.contextMenu.hideBuiltInItems(); + this.customContextMenuItems = new Array(); if (slideView.thumbnailView.visible) showThumbnails(); } @@ -402,18 +401,17 @@ with BigBlueButton; if not, see . } private function addContextMenuItems():void{ - var contextMenu:ContextMenu = new ContextMenu(); - contextMenu.hideBuiltInItems(); + var contextMenuItems:Array = new Array(); var nextButton:ContextMenuItem = new ContextMenuItem(NEXT_BUTTON); nextButton.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, menuItemHandler); - contextMenu.customItems.push(nextButton); + contextMenuItems.push(nextButton); var previousButton:ContextMenuItem = new ContextMenuItem(PREVIOUS_BUTTON); previousButton.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, menuItemHandler); - contextMenu.customItems.push(previousButton); + contextMenuItems.push(previousButton); - this.contextMenu = contextMenu; + this.customContextMenuItems = contextMenuItems; } private function menuItemHandler(e:ContextMenuEvent):void{ @@ -648,4 +646,4 @@ with BigBlueButton; if not, see . - + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/sharednotes/SharedNotesWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/sharednotes/SharedNotesWindow.mxml index 523dbcf754..81499a413f 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/sharednotes/SharedNotesWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/sharednotes/SharedNotesWindow.mxml @@ -17,7 +17,7 @@ You should have received a copy of the GNU Lesser General Public License along with BigBlueButton; if not, see . --> - @@ -216,4 +216,4 @@ with BigBlueButton; if not, see . - \ No newline at end of file + 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 eb52839007..a11278057e 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/users/views/UsersWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/users/views/UsersWindow.mxml @@ -20,8 +20,8 @@ $Id: $ --> - - + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/business/VideoWindowItf.as b/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/business/VideoWindowItf.as index dbd3a7b333..406746bd2a 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/business/VideoWindowItf.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/business/VideoWindowItf.as @@ -25,13 +25,13 @@ package org.bigbluebutton.modules.videoconf.business import flash.geom.Point; import flash.media.Video; - import flexlib.mdi.containers.MDIWindow; import flexlib.mdi.events.MDIWindowEvent; import mx.containers.Panel; import mx.controls.Button; import mx.core.UIComponent; + import org.bigbluebutton.common.CustomMdiWindow; import org.bigbluebutton.common.IBbbModuleWindow; import org.bigbluebutton.common.Images; import org.bigbluebutton.common.LogUtil; @@ -50,7 +50,7 @@ package org.bigbluebutton.modules.videoconf.business import org.bigbluebutton.modules.videoconf.views.ControlButtons; import org.bigbluebutton.util.i18n.ResourceUtil; - public class VideoWindowItf extends MDIWindow implements IBbbModuleWindow + public class VideoWindowItf extends CustomMdiWindow implements IBbbModuleWindow { protected var _video:Video; protected var _videoHolder:UIComponent; @@ -316,4 +316,4 @@ package org.bigbluebutton.modules.videoconf.business } } } -} \ No newline at end of file +} diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/videodock/views/VideoDock.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/videodock/views/VideoDock.mxml index fc5548adcc..636cafc245 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/videodock/views/VideoDock.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/videodock/views/VideoDock.mxml @@ -20,7 +20,7 @@ with BigBlueButton; if not, see . --> -. import org.bigbluebutton.main.events.ShortcutEvent; import com.asfusion.mate.events.Dispatcher; + import flexlib.mdi.containers.MDIWindow; + import mx.events.ChildExistenceChangedEvent; import org.bigbluebutton.common.Images; - + import org.bigbluebutton.common.LogUtil; import org.bigbluebutton.common.events.CloseWindowEvent; import org.bigbluebutton.common.events.DragWindowEvent; @@ -486,4 +488,4 @@ with BigBlueButton; if not, see . - \ No newline at end of file + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/whiteboard/views/WhiteboardToolbar.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/whiteboard/views/WhiteboardToolbar.mxml index 082b8c9691..7eefe580a6 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/whiteboard/views/WhiteboardToolbar.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/whiteboard/views/WhiteboardToolbar.mxml @@ -64,7 +64,6 @@ with BigBlueButton; if not, see . Date: Thu, 9 Apr 2015 17:45:19 -0300 Subject: [PATCH 2/3] keep custom context menu items in the users window when the window is minimized or maximized; translate the context menu items when the localization is changed --- .../bigbluebutton/modules/users/views/UsersWindow.mxml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 20bee3da35..f6e081075b 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/users/views/UsersWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/users/views/UsersWindow.mxml @@ -144,14 +144,13 @@ } private function addContextMenuItems():void { - var contextMenu:ContextMenu = new ContextMenu(); - contextMenu.hideBuiltInItems(); + var contextMenuItems:Array = new Array(); var exportUsersItem:ContextMenuItem = new ContextMenuItem(ResourceUtil.getInstance().getString("bbb.users.usersGrid.contextmenu.exportusers")); exportUsersItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, exportUsersItemHandler); - contextMenu.customItems.push(exportUsersItem); + contextMenuItems.push(exportUsersItem); - this.contextMenu = contextMenu; + this.customContextMenuItems = contextMenuItems; } private function exportUsersItemHandler(e:ContextMenuEvent):void{ @@ -387,6 +386,8 @@ raiseHandBtn.accessibilityName = ResourceUtil.getInstance().getString('bbb.users.raiseHandBtn.toolTip'); } } + + addContextMenuItems(); } private function loadKeyCombos(modifier:String):void { From aa4ec0c1a8de6518d22241bcb7ee2f0af00b1982 Mon Sep 17 00:00:00 2001 From: Felipe Cecagno Date: Thu, 9 Apr 2015 17:57:08 -0300 Subject: [PATCH 3/3] fixed localization for context menu items on presentation window, using the same text as the buttons tooltip --- .../present/ui/views/PresentationWindow.mxml | 23 +++++-------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml index 892c6be134..1207f993e8 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml @@ -103,8 +103,6 @@ with BigBlueButton; if not, see . private static const LOG:String = "Present::PresentationWindow - "; public static const TITLE:String = "Presentation"; - private static const NEXT_BUTTON:String = "Next"; - private static const PREVIOUS_BUTTON:String = "Previous"; private static const GOTO_PAGE_BUTTON:String = "Go to Page..."; [Bindable] @@ -400,28 +398,17 @@ with BigBlueButton; if not, see . private function addContextMenuItems():void{ var contextMenuItems:Array = new Array(); - var nextButton:ContextMenuItem = new ContextMenuItem(NEXT_BUTTON); - nextButton.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, menuItemHandler); + var nextButton:ContextMenuItem = new ContextMenuItem(ResourceUtil.getInstance().getString('bbb.presentation.forwardBtn.toolTip')); + nextButton.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, function(e:ContextMenuEvent):void { gotoNextSlide(); }); contextMenuItems.push(nextButton); - var previousButton:ContextMenuItem = new ContextMenuItem(PREVIOUS_BUTTON); - previousButton.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, menuItemHandler); + var previousButton:ContextMenuItem = new ContextMenuItem(ResourceUtil.getInstance().getString('bbb.presentation.backBtn.toolTip')); + previousButton.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, function(e:ContextMenuEvent):void { gotoPreviousSlide(); }); contextMenuItems.push(previousButton); this.customContextMenuItems = contextMenuItems; } - private function menuItemHandler(e:ContextMenuEvent):void{ - switch(e.target.caption){ - case NEXT_BUTTON: - gotoNextSlide(); - break; - case PREVIOUS_BUTTON: - gotoPreviousSlide(); - break; - } - } - private function notifyOthersOfSharingPresentation(presentationName:String):void { var shareEvent:PresenterCommands = new PresenterCommands(PresenterCommands.SHARE_PRESENTATION_COMMAND); shareEvent.presentationName = presentationName; @@ -526,6 +513,8 @@ with BigBlueButton; if not, see . if(Capabilities.hasAccessibility) Accessibility.updateProperties(); + + addContextMenuItems(); } private function localeChanged(e:Event):void{