2013-09-17 01:50:15 +08:00
<?xml version="1.0" encoding="utf-8"?>
2013-09-17 04:57:06 +08:00
<!--
BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
Copyright (c) 2012 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 <http://www.gnu.org/licenses/>.
-->
2017-05-29 20:58:18 +08:00
<mx:Canvas xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:fx="http://ns.adobe.com/mxml/2009"
2013-09-17 01:50:15 +08:00
xmlns:views="org.bigbluebutton.main.views.*"
xmlns:maps="org.bigbluebutton.main.maps.*"
2014-05-24 04:24:01 +08:00
xmlns:userMap="org.bigbluebutton.modules.users.maps.*"
2013-09-17 01:50:15 +08:00
xmlns:apimap="org.bigbluebutton.main.api.maps.*"
xmlns:coreMap="org.bigbluebutton.core.controllers.maps.*"
2018-05-28 22:24:29 +08:00
xmlns:toaster="org.bigbluebutton.common.toaster.*"
2013-09-17 02:07:59 +08:00
xmlns:mate="http://mate.asfusion.com/"
2013-09-17 01:50:15 +08:00
width="100%" height="100%"
2014-10-16 01:52:18 +08:00
backgroundColor="white"
2014-08-29 06:25:16 +08:00
horizontalScrollPolicy="off"
verticalScrollPolicy="off"
2015-01-30 02:03:13 +08:00
creationComplete="init()"
addedToStage="onAddedToStage()">
2013-09-17 01:50:15 +08:00
2017-05-29 20:58:18 +08:00
<fx:Script>
2013-09-17 01:50:15 +08:00
<![CDATA[
2017-02-13 17:28:51 +08:00
import com.asfusion.mate.events.Dispatcher;
import flash.events.Event;
2014-08-14 06:31:29 +08:00
import mx.managers.HistoryManager;
2015-07-20 23:51:04 +08:00
import mx.managers.IDragManager;
2014-08-14 06:31:29 +08:00
import mx.managers.ToolTipManager;
2017-02-13 17:28:51 +08:00
2015-07-20 23:51:04 +08:00
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
2017-11-03 17:43:15 +08:00
import org.bigbluebutton.common.events.LocaleChangeEvent;
2014-08-14 06:31:29 +08:00
import org.bigbluebutton.core.BBB;
2017-02-13 17:28:51 +08:00
import org.bigbluebutton.core.KeyboardUtil;
2014-08-14 06:31:29 +08:00
import org.bigbluebutton.main.api.ExternalApiCallbacks;
2017-11-03 17:43:15 +08:00
import org.bigbluebutton.main.events.ConfigLoadedEvent;
2014-08-14 06:31:29 +08:00
import org.bigbluebutton.main.events.ShortcutEvent;
import org.bigbluebutton.main.model.ShortcutOptions;
2017-11-03 17:43:15 +08:00
import org.bigbluebutton.main.views.MainApplicationShell;
2014-08-14 06:31:29 +08:00
import org.bigbluebutton.util.i18n.ResourceUtil;
2015-07-20 23:51:04 +08:00
private static const LOGGER:ILogger = getClassLogger(BigBlueButtonMainContainer);
2013-09-17 02:07:59 +08:00
private var globalModifier:String;
/**
* Thse two lines are workaround for this. (ralam - Nov 8, 2008)
* http://gregjessup.com/flex-3-advanceddatagrid-cannot-convert-mxmanagersdragmanagerimpl-to-mxmanagersidragmanager/
* http://butterfliesandbugs.wordpress.com/2007/10/25/workaround-for-error-when-loading-popups-from-modules/
*/
private var iDragManager:IDragManager;
/** another workaround - for this issue: https://bugs.adobe.com/jira/browse/SDK-13121*/
private var hist:HistoryManager
private var globalDispatcher:Dispatcher = new Dispatcher();
2015-10-05 23:22:39 +08:00
private var _timer:Timer;
2015-07-20 23:51:04 +08:00
protected function init():void {
2014-08-14 06:31:29 +08:00
setupTooltips();
2013-09-17 02:07:59 +08:00
globalModifier = ExternalInterface.call("determineGlobalModifier");
}
2015-10-05 23:22:39 +08:00
private function queryForSessionToken():void {
2015-10-07 05:08:01 +08:00
/** We attempt to query several times to try to get the sessionToken from the browser url.
* (ralam oct 6, 2015)
*/
_timer = new Timer(500, 6);
2015-10-05 23:22:39 +08:00
_timer.addEventListener(TimerEvent.TIMER, timerHandler);
_timer.addEventListener(TimerEvent.TIMER_COMPLETE, completeHandler);
_timer.start();
}
private function getSessionToken():String {
2018-01-18 03:17:32 +08:00
return BBB.getQueryStringParameters().getSessionToken();
2015-10-05 23:22:39 +08:00
}
private function timerHandler(e:TimerEvent):void{
if (getSessionToken() != "") {
_timer.stop();
2015-10-06 04:06:35 +08:00
BBB.getConfigManager().loadConfig();
2015-10-08 00:09:31 +08:00
}
2015-10-05 23:22:39 +08:00
}
private function completeHandler(e:TimerEvent):void {
2015-10-06 04:06:35 +08:00
trace("Failed to get session token.");
2015-10-05 23:22:39 +08:00
}
2015-10-07 05:08:01 +08:00
2013-09-17 02:07:59 +08:00
private var api:ExternalApiCallbacks;
private function setupAPI():void {
api = new ExternalApiCallbacks();
2017-10-31 05:28:32 +08:00
Security.allowDomain("*");
LOGGER.debug("Security.allowDomain({0});", ["*"]);
2013-09-17 02:07:59 +08:00
}
2014-08-14 06:31:29 +08:00
/**
* Tooltip effect
*/
private function setupTooltips() : void {
ToolTipManager.scrubDelay = 50;
ToolTipManager.showDelay = 50;
ToolTipManager.hideDelay = 3000;
ToolTipManager.showEffect = fadeIn;
ToolTipManager.hideEffect = fadeOut;
}
2013-09-17 02:07:59 +08:00
/**
* Shortcut Keys
*/
2015-01-30 02:03:13 +08:00
private function onAddedToStage():void {
2015-10-05 23:22:39 +08:00
queryForSessionToken();
2015-01-30 02:03:13 +08:00
}
2013-09-17 02:07:59 +08:00
private function localeChanged(e:Event):void{
loadKeyCombos(globalModifier);
}
private var keyCombos:Object;
private function loadKeyCombos(globalModifier:String):void {
keyCombos = new Object(); // always start with a fresh array
// Module-independent keys
keyCombos[globalModifier+(ResourceUtil.getInstance().getString('bbb.shortcutkey.flash.exit') as String)] = ShortcutEvent.FOCUS_AWAY_EVENT;
keyCombos[globalModifier+(ResourceUtil.getInstance().getString('bbb.shortcutkey.shortcutWindow') as String)] = ShortcutEvent.REMOTE_OPEN_SHORTCUT_WIN;
keyCombos[globalModifier+(ResourceUtil.getInstance().getString('bbb.shortcutkey.logout') as String)] = ShortcutEvent.LOGOUT;
// Module-dependent keys
if (ShortcutOptions.usersActive){
keyCombos[globalModifier+(ResourceUtil.getInstance().getString('bbb.shortcutkey.focus.users') as String)] = ShortcutEvent.FOCUS_USERS_WINDOW;
keyCombos[globalModifier+(ResourceUtil.getInstance().getString('bbb.shortcutkey.raiseHand') as String)] = ShortcutEvent.RAISE_HAND;
keyCombos[globalModifier+(ResourceUtil.getInstance().getString('bbb.shortcutkey.users.muteme') as String)] = ShortcutEvent.MUTE_ME_EVENT;
keyCombos[globalModifier+(ResourceUtil.getInstance().getString('bbb.shortcutkey.users.muteAllButPres') as String)] = ShortcutEvent.MUTE_ALL_BUT_PRES;
2017-02-14 17:34:01 +08:00
keyCombos[globalModifier+(ResourceUtil.getInstance().getString('bbb.shortcutkey.users.breakoutRooms') as String)] = ShortcutEvent.OPEN_BREAKOUT_ROOMS;
2013-09-17 02:07:59 +08:00
}
if (ShortcutOptions.presentationActive){
keyCombos[globalModifier+(ResourceUtil.getInstance().getString('bbb.shortcutkey.focus.presentation') as String)] = ShortcutEvent.FOCUS_PRESENTATION_WINDOW;
}
if (ShortcutOptions.chatActive){
keyCombos[globalModifier+(ResourceUtil.getInstance().getString('bbb.shortcutkey.focus.chat') as String)] = ShortcutEvent.FOCUS_CHAT_WINDOW;
keyCombos[globalModifier+(ResourceUtil.getInstance().getString('bbb.shortcutkey.chat.chatinput') as String)] = ShortcutEvent.FOCUS_CHAT_INPUT;
}
if (ShortcutOptions.pollingActive){
keyCombos[globalModifier+(ResourceUtil.getInstance().getString('bbb.shortcutkey.focus.pollingCreate') as String)] = ShortcutEvent.FOCUS_POLLING_WINDOW_CREATE;
keyCombos[globalModifier+(ResourceUtil.getInstance().getString('bbb.shortcutkey.focus.pollingStats') as String)] = ShortcutEvent.FOCUS_POLLING_WINDOW_STATS;
keyCombos[globalModifier+(ResourceUtil.getInstance().getString('bbb.shortcutkey.focus.voting') as String)] = ShortcutEvent.FOCUS_VOTING_WINDOW;
keyCombos[globalModifier+(ResourceUtil.getInstance().getString('bbb.shortcutkey.polling.buttonClick') as String)] = ShortcutEvent.POLL_BUTTON_CLICK;
}
if (ShortcutOptions.webcamActive){
2017-02-13 22:13:02 +08:00
keyCombos[globalModifier+(ResourceUtil.getInstance().getString('bbb.shortcutkey.focus.video') as String)] = ShortcutEvent.FOCUS_VIDEO_WINDOW;
keyCombos[globalModifier+(ResourceUtil.getInstance().getString('bbb.shortcutkey.share.webcam') as String)] = ShortcutEvent.SHARE_WEBCAM;
2013-09-17 02:07:59 +08:00
}
2017-02-13 21:50:48 +08:00
if (ShortcutOptions.closedCaptionActive){
keyCombos[globalModifier+(ResourceUtil.getInstance().getString('bbb.shortcutkey.focus.caption') as String)] = ShortcutEvent.FOCUS_CAPTION_WINDOW;
}
2013-09-17 02:07:59 +08:00
if (ShortcutOptions.deskshareActive){
keyCombos[globalModifier+(ResourceUtil.getInstance().getString('bbb.shortcutkey.share.desktop') as String)] = ShortcutEvent.SHARE_DESKTOP;
}
}
public function hotkeyCapture():void{
2015-07-20 23:51:04 +08:00
LOGGER.debug("Entering hotkeyCapture");
2013-09-17 02:07:59 +08:00
stage.addEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown);
ResourceUtil.getInstance().addEventListener(Event.CHANGE, localeChanged); // Listen for locale changing
2015-07-20 23:51:04 +08:00
LOGGER.debug("Leaving hotkeyCapture");
2013-09-17 02:07:59 +08:00
}
// Handle general-access hotkeys, regardless of what window the user is focused in
private function handleKeyDown(e:KeyboardEvent) :void {
2017-02-14 17:34:01 +08:00
if (keyCombos == null) loadKeyCombos(globalModifier);
2013-09-17 02:07:59 +08:00
2017-02-13 17:28:51 +08:00
var keyPress:String = KeyboardUtil.buildPressedKeys(e);
2013-09-17 02:07:59 +08:00
if (e.keyCode < 64 || e.keyCode > 90){
2015-07-20 23:51:04 +08:00
LOGGER.debug("Keypress debugging: KeyCode {0} is nonalphabetic (probably)", [e.keyCode]);
2013-09-17 02:07:59 +08:00
}
if (keyCombos[keyPress]) {
//LogUtil.debug("Caught shortcut: " + keyCombos[keyPress]);
globalDispatcher.dispatchEvent(new ShortcutEvent(keyCombos[keyPress]));
}
}
2017-11-03 17:43:15 +08:00
private function handleConfigLoaded(e:ConfigLoadedEvent):void {
setupAPI();
ResourceUtil.getInstance().initialize();
}
private function handleLocaleInit(e:LocaleChangeEvent):void {
BBB.initVideoProfileManager();
hotkeyCapture();
var mainShell : MainApplicationShell = new MainApplicationShell();
mainShell.id = "mainShell";
this.addChild(mainShell);
}
2013-09-17 02:07:59 +08:00
// Moves page focus outside and past the Flash content
private function loseFocusFromApp(e:Event):void {
ExternalInterface.call("stopFlashFocus");
2013-09-17 01:50:15 +08:00
}
]]>
2017-05-29 20:58:18 +08:00
</fx:Script>
2013-09-17 01:50:15 +08:00
2017-05-29 20:58:18 +08:00
<fx:Declarations>
<mx:Fade id="fadeIn" alphaFrom="0" alphaTo="1" duration="250"/>
<mx:Fade id="fadeOut" alphaFrom="1" alphaTo="0" duration="250"/>
<apimap:ExternalApiEventMap/>
<coreMap:BbbCoreEventMap/>
<userMap:UsersMainEventMap />
<maps:ApplicationEventMap />
<mate:Listener type="{ShortcutEvent.FOCUS_AWAY_EVENT}" method="loseFocusFromApp" />
2017-11-03 17:43:15 +08:00
<mate:Listener type="{ConfigLoadedEvent.CONFIG_LOADED_EVENT}" method="handleConfigLoaded"/>
<mate:Listener type="{LocaleChangeEvent.LOCALE_INIT}" method="handleLocaleInit"/>
2017-05-29 20:58:18 +08:00
</fx:Declarations>
2014-05-24 04:24:01 +08:00
2018-05-31 05:59:37 +08:00
<!--
2018-05-28 22:24:29 +08:00
<toaster:Toaster id="toasterContainer" width="100%" height="100%"/>
2018-05-31 05:59:37 +08:00
-->
2018-06-06 23:23:13 +08:00
2014-08-29 06:25:16 +08:00
</mx:Canvas>