missed a file while removing viewers

This commit is contained in:
Chad Pilkey 2013-05-15 08:05:46 -07:00
parent 355334a6c5
commit bfdefeff8d

View File

@ -1,319 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
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/>.
-->
<viewer:MDIWindow xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:viewer="flexlib.mdi.containers.*"
implements="org.bigbluebutton.common.IBbbModuleWindow"
xmlns:mate="http://mate.asfusion.com/"
title="{windowTitle}" visible="false"
initialize="init()"
creationComplete="onCreationComplete()"
showCloseButton="false">
<mate:Listener type="{ConferenceCreatedEvent.CONFERENCE_CREATED_EVENT}" method="conferenceStarted" />
<mate:Listener type="{LocaleChangeEvent.LOCALE_CHANGED}" method="localeChanged" />
<mate:Listener type="{ShortcutEvent.RAISE_HAND}" method="remoteRaiseHand" />
<mate:Listener type="{ShortcutEvent.MINIMIZE_USERS}" method="remoteMinimize" />
<mate:Listener type="{ShortcutEvent.MAXIMIZE_USERS}" method="remoteMaximize" />
<mx:Script>
<![CDATA[
import com.asfusion.mate.events.Dispatcher;
import flexlib.mdi.events.MDIWindowEvent;
import mx.binding.utils.BindingUtils;
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.controls.listClasses.IListItemRenderer;
import mx.events.DataGridEvent;
import mx.events.ListEvent;
import org.bigbluebutton.main.events.ShortcutEvent;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.common.Images;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.common.Role;
import org.bigbluebutton.common.events.LocaleChangeEvent;
import org.bigbluebutton.core.EventConstants;
import org.bigbluebutton.core.events.CoreEvent;
import org.bigbluebutton.core.managers.UserManager;
import org.bigbluebutton.main.model.users.BBBUser;
import org.bigbluebutton.main.model.users.Conference;
import org.bigbluebutton.main.model.users.events.ConferenceCreatedEvent;
import org.bigbluebutton.main.model.users.events.KickUserEvent;
import org.bigbluebutton.main.model.users.events.RaiseHandEvent;
import org.bigbluebutton.main.model.users.events.RoleChangeEvent;
import org.bigbluebutton.main.views.MainCanvas;
import org.bigbluebutton.modules.viewers.events.ChangeStatusEvent;
import org.bigbluebutton.modules.viewers.model.ViewerOptions;
import org.bigbluebutton.util.i18n.ResourceUtil;
[Bindable] private var windowTitle:String = ResourceUtil.getInstance().getString('bbb.viewers.title',["", ""]);
[Bindable] public var participants:ArrayCollection = new ArrayCollection();
private var conference:Conference;
[Bindable] public var isModerator:Boolean = false;
//private var isPresenter:Boolean = false;
private var handRaised:Boolean = false;
//private var showingWebcam:Boolean = false;
public var images:Images = new Images();
[Bindable] public var presenterIcon : Class = images.presenter;
[Bindable] public var handIcon:Class = images.raisehand;
private var dispatcher:Dispatcher;
private var keyCombos:Object;
[Bindable] public var viewerOptions:ViewerOptions;
[Bindable] private var baseIndex:int;
private function init():void {
baseIndex = viewerOptions.baseTabIndex;
}
private function onCreationComplete():void {
conference = UserManager.getInstance().getConference();
participants = conference.users;
this.isModerator = UserManager.getInstance().getConference().amIModerator();
//this.isPresenter = UserManager.getInstance().getConference().amIPresenter();
BindingUtils.bindSetter(updateNumberOfViewers, participants, "length");
dispatcher = new Dispatcher();
this.visible = viewerOptions.windowVisible;
hotkeyCapture();
resourcesChanged();
titleBarOverlay.tabIndex = baseIndex;
minimizeBtn.tabIndex = baseIndex+1;
maximizeRestoreBtn.tabIndex = baseIndex+2;
closeBtn.tabIndex = baseIndex+3;
}
private function remoteMinimize(e:ShortcutEvent):void{
if (!minimized){
this.minimize();
}
}
private function remoteMaximize(e:ShortcutEvent):void{
if (!maximized && !minimized){
this.maximize();
}
else{
this.restore();
}
}
private function loadKeyCombos(modifier:String):void {
keyCombos = new Object(); // always start with a fresh array
keyCombos[modifier+(ResourceUtil.getInstance().getString('bbb.shortcutkey.general.maximize') as String)] = ShortcutEvent.MAXIMIZE_USERS;
keyCombos[modifier+(ResourceUtil.getInstance().getString('bbb.shortcutkey.general.minimize') as String)] = ShortcutEvent.MINIMIZE_USERS;
}
private function hotkeyCapture():void{
this.addEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown);
ResourceUtil.getInstance().addEventListener(Event.CHANGE, localeChanged); // Listen for locale changing
}
// Handle general-access hotkeys, regardless of what window the user is focused in
private function handleKeyDown(e:KeyboardEvent) :void {
var modifier:String = ExternalInterface.call("determineModifier");
loadKeyCombos(modifier);
var keyPress:String = (e.ctrlKey ? "control+" : "") + (e.shiftKey ? "shift+" : "") +
(e.altKey ? "alt+" : "") + e.keyCode;
if (keyCombos[keyPress]) {
dispatcher.dispatchEvent(new ShortcutEvent(keyCombos[keyPress]));
}
}
private function focusWindow(e:ShortcutEvent):void{
focusManager.setFocus(titleBarOverlay);
}
private function updateNumberOfViewers(numViewers:int):void {
if (numViewers > 4)
windowTitle = ResourceUtil.getInstance().getString('bbb.viewers.title', [":", numViewers]);
else
windowTitle = ResourceUtil.getInstance().getString('bbb.viewers.title', ["", ""]);
}
public function getPrefferedPosition():String{
return MainCanvas.TOP_LEFT;
}
public function changeStatus(status:ArrayCollection):void {
dispatchEvent(new ChangeStatusEvent(status));
}
private function viewerSelectEvent(event:ListEvent):void {
if (isModerator) {
presentBtn.enabled = true;
presentBtn.toolTip = "Make selected web participant the presenter.";
}
if (viewersGrid.selectedItem.presenter) presentBtn.enabled = false;
else presentBtn.enabled = true;
}
public function remoteMakePresenter(e:ShortcutEvent):void{
assignPresenterClicked();
}
public function remoteFocusUsers(e:ShortcutEvent):void{
focusManager.setFocus(viewersGrid);
}
private function assignPresenterClicked():void {
// Ignore if the selected user is already the presenter.
if (viewersGrid.selectedItem == null || viewersGrid.selectedItem.presenter) return;
var e:RoleChangeEvent = new RoleChangeEvent(RoleChangeEvent.ASSIGN_PRESENTER);
e.userid = viewersGrid.selectedItem.userID;
e.username = viewersGrid.selectedItem.name;
dispatchEvent(e);
presentBtn.enabled = false;
}
public function remoteRaiseHand(e:ShortcutEvent):void{
raiseHand();
}
private function raiseHand():void{
handRaised = !handRaised;
var e:RaiseHandEvent = new RaiseHandEvent(RaiseHandEvent.RAISE_HAND);
e.raised = handRaised;
dispatchEvent(e);
}
private function conferenceStarted(e:ConferenceCreatedEvent):void{
this.participants = e.conference.users;
this.isModerator = UserManager.getInstance().getConference().amIModerator();
}
override protected function resourcesChanged():void{
super.resourcesChanged();
if (participants.length > 4)
windowTitle = ResourceUtil.getInstance().getString('bbb.viewers.title', [":", participants.length]);
else
windowTitle = ResourceUtil.getInstance().getString('bbb.viewers.title', ["", ""]);
if (titleBarOverlay != null) {
titleBarOverlay.accessibilityName = ResourceUtil.getInstance().getString('bbb.viewers.titleBar');
}
if (windowControls != null) {
minimizeBtn.toolTip = ResourceUtil.getInstance().getString("bbb.window.minimizeBtn.toolTip");
minimizeBtn.accessibilityName = ResourceUtil.getInstance().getString("bbb.viewers.minimizeBtn.accessibilityName");
maximizeRestoreBtn.toolTip = ResourceUtil.getInstance().getString("bbb.window.maximizeRestoreBtn.toolTip");
maximizeRestoreBtn.accessibilityName = ResourceUtil.getInstance().getString("bbb.viewers.maximizeRestoreBtn.accessibilityName");
closeBtn.toolTip = ResourceUtil.getInstance().getString("bbb.window.closeBtn.toolTip");
closeBtn.accessibilityName = ResourceUtil.getInstance().getString("bbb.viewers.closeBtn.accessibilityName");
}
}
private function localeChanged(e:Event):void{
resourcesChanged();
}
private function onItemRollOver(event:ListEvent):void{
var item:IListItemRenderer = event.itemRenderer;
var user:BBBUser = item.data as BBBUser;
var rollEvent:ViewersRollEvent = new ViewersRollEvent(ViewersRollEvent.VIEWERS_ROLL_OVER);
rollEvent.userID = user.userID;
dispatcher.dispatchEvent(rollEvent);
}
private function onItemRollOut(event:ListEvent):void{
var item:IListItemRenderer = event.itemRenderer;
var user:BBBUser = item.data as BBBUser;
var rollEvent:ViewersRollEvent = new ViewersRollEvent(ViewersRollEvent.VIEWERS_ROLL_OUT);
rollEvent.userID = user.userID;
dispatcher.dispatchEvent(rollEvent);
}
override protected function hideAllChildren():void {
viewersGrid.visible=false;
}
override protected function showAllChildren():void {
viewersGrid.visible=true;
}
]]>
</mx:Script>
<mx:DataGrid id="viewersGrid" dataProvider="{participants}" editable="false"
dragEnabled="false" itemClick="viewerSelectEvent(event);" width="100%" height="100%"
itemRollOver="onItemRollOver(event)"
itemRollOut="onItemRollOut(event)"
tabIndex="{baseIndex+4}"
accessibilityName="{ResourceUtil.getInstance().getString('bbb.viewers.userList')}">
<mx:columns>
<mx:DataGridColumn dataField="role"
headerText="{ResourceUtil.getInstance().getString('bbb.viewers.viewersGrid.roleItemRenderer')}"
dataTipField="Role"
editable="false"
width="35"
itemRenderer="org.bigbluebutton.modules.viewers.views.RoleItemRenderer"
sortable="false"
id="roleField"/>
<mx:DataGridColumn dataField="name"
headerText="{ResourceUtil.getInstance().getString('bbb.viewers.viewersGrid.nameItemRenderer')}"
editable="true"
width="100"
sortable="false"
itemRenderer="org.bigbluebutton.modules.viewers.views.NameItemRenderer"/>
<!--mx:DataGridColumn dataField="status"
headerText="{ResourceUtil.getInstance().getString('bbb.viewers.viewersGrid.statusItemRenderer')}"
dataTipField="Status"
editable="false"
itemRenderer="org.bigbluebutton.modules.viewers.views.StatusItemRenderer"
sortable="false"
id="statusField"/-->
<mx:DataGridColumn dataField="status"
headerText="{ResourceUtil.getInstance().getString('bbb.viewers.viewersGrid.statusItemRenderer')}"
dataTipField="Status"
id="statusField"
sortable="false"
itemRenderer="org.bigbluebutton.modules.viewers.views.StatusItemRenderer"/>
</mx:columns>
</mx:DataGrid>
<mx:ControlBar width="100%">
<!-- Switch Presenter Button -->
<mx:Button id="presentBtn" label="{ResourceUtil.getInstance().getString('bbb.viewers.presentBtn.label')}" visible="{isModerator}"
width="130" height="20" styleName="switchPresenterButtonStyle"
toolTip="{ResourceUtil.getInstance().getString('bbb.viewers.presentBtn.toolTip')}"
click="assignPresenterClicked()"
tabIndex="{baseIndex+5}"
accessibilityName="{ResourceUtil.getInstance().getString('bbb.viewers.presentBtn.accessibilityName')}"
/>
<mx:Spacer width="100%"/>
<mx:Button id="raiseHandImage" icon="{handIcon}" toggle="true"
width="20" height="20"
toolTip="{ResourceUtil.getInstance().getString('bbb.viewers.raiseHandBtn.toolTip')}"
click="raiseHand()"
tabIndex="{baseIndex+6}"/>
</mx:ControlBar>
</viewer:MDIWindow>