Merge pull request #585 from capilkey/fix-three-whiteboard-bugs
Fix some whiteboard annoyances
This commit is contained in:
commit
3f4bec3333
@ -372,6 +372,8 @@ ltbcustom.bbb.highlighter.toolbar.text.accessibilityName = Switch whiteboard cur
|
|||||||
ltbcustom.bbb.highlighter.texttoolbar.textColorPicker = Text color
|
ltbcustom.bbb.highlighter.texttoolbar.textColorPicker = Text color
|
||||||
ltbcustom.bbb.highlighter.texttoolbar.textSizeMenu = Font size
|
ltbcustom.bbb.highlighter.texttoolbar.textSizeMenu = Font size
|
||||||
|
|
||||||
|
bbb.accessibility.clientReady = Ready
|
||||||
|
|
||||||
bbb.accessibility.chat.chatBox.reachedFirst = You have reached the first message.
|
bbb.accessibility.chat.chatBox.reachedFirst = You have reached the first message.
|
||||||
bbb.accessibility.chat.chatBox.reachedLatest = You have reached the latest message.
|
bbb.accessibility.chat.chatBox.reachedLatest = You have reached the latest message.
|
||||||
bbb.accessibility.chat.chatBox.navigatedFirst = You have navigated to the first message.
|
bbb.accessibility.chat.chatBox.navigatedFirst = You have navigated to the first message.
|
||||||
|
@ -28,6 +28,7 @@ package org.bigbluebutton.modules.chat.services
|
|||||||
import org.bigbluebutton.modules.chat.ChatConstants;
|
import org.bigbluebutton.modules.chat.ChatConstants;
|
||||||
import org.bigbluebutton.modules.chat.events.PublicChatMessageEvent;
|
import org.bigbluebutton.modules.chat.events.PublicChatMessageEvent;
|
||||||
import org.bigbluebutton.modules.chat.vo.ChatMessageVO;
|
import org.bigbluebutton.modules.chat.vo.ChatMessageVO;
|
||||||
|
import org.bigbluebutton.util.i18n.ResourceUtil;
|
||||||
|
|
||||||
public class ChatMessageService
|
public class ChatMessageService
|
||||||
{
|
{
|
||||||
@ -108,7 +109,7 @@ package org.bigbluebutton.modules.chat.services
|
|||||||
dispatcher.dispatchEvent(welcomeMsgEvent);
|
dispatcher.dispatchEvent(welcomeMsgEvent);
|
||||||
|
|
||||||
//Say that client is ready when sending the welcome message
|
//Say that client is ready when sending the welcome message
|
||||||
ExternalInterface.call("clientReady", "Ready");
|
ExternalInterface.call("clientReady", ResourceUtil.getInstance().getString('bbb.accessibility.clientReady'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UsersUtil.amIModerator()) {
|
if (UsersUtil.amIModerator()) {
|
||||||
|
@ -175,10 +175,11 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
|||||||
/**
|
/**
|
||||||
* Triggered when the presenter clicks on the slides with the intent of moving it.
|
* Triggered when the presenter clicks on the slides with the intent of moving it.
|
||||||
*/
|
*/
|
||||||
private function onMouseDown(e:MouseEvent):void {
|
private function onMouseDown(e:MouseEvent):void {
|
||||||
prevMouseX = this.mouseX;
|
prevMouseX = this.mouseX;
|
||||||
prevMouseY = this.mouseY;
|
prevMouseY = this.mouseY;
|
||||||
addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
|
stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
|
||||||
|
stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -201,14 +202,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
|||||||
* Triggered when the presenter releases the mouse button.
|
* Triggered when the presenter releases the mouse button.
|
||||||
*/
|
*/
|
||||||
private function onMouseUp(e:MouseEvent):void{
|
private function onMouseUp(e:MouseEvent):void{
|
||||||
removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
|
stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
|
||||||
}
|
stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
|
||||||
|
|
||||||
/**
|
|
||||||
* Triggered when the presenter has dragged the cursor outside the presetation window.
|
|
||||||
*/
|
|
||||||
private function onMouseOut(e:MouseEvent):void{
|
|
||||||
removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onParentResized(parentWidth:Number, parentHeight:Number):void {
|
public function onParentResized(parentWidth:Number, parentHeight:Number):void {
|
||||||
@ -340,9 +335,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
|||||||
|
|
||||||
private function becomeViewer():void {
|
private function becomeViewer():void {
|
||||||
removeEventListener(MouseEvent.MOUSE_WHEEL, onMouseWheelZoomEvent);
|
removeEventListener(MouseEvent.MOUSE_WHEEL, onMouseWheelZoomEvent);
|
||||||
slideLoader.removeEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
|
this.removeEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
|
||||||
slideLoader.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
|
|
||||||
slideLoader.removeEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
|
|
||||||
_sendCurrentMouseLocTimer.stop();
|
_sendCurrentMouseLocTimer.stop();
|
||||||
_sendCurrentMouseLocTimer.removeEventListener(TimerEvent.TIMER, mouseCursorUpdateTimerListener);
|
_sendCurrentMouseLocTimer.removeEventListener(TimerEvent.TIMER, mouseCursorUpdateTimerListener);
|
||||||
}
|
}
|
||||||
@ -363,9 +356,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
|||||||
zoomPercentage = (SlideViewModel.HUNDRED_PERCENT / slideModel.viewedRegionW) * SlideViewModel.HUNDRED_PERCENT;
|
zoomPercentage = (SlideViewModel.HUNDRED_PERCENT / slideModel.viewedRegionW) * SlideViewModel.HUNDRED_PERCENT;
|
||||||
|
|
||||||
addEventListener(MouseEvent.MOUSE_WHEEL, onMouseWheelZoomEvent);
|
addEventListener(MouseEvent.MOUSE_WHEEL, onMouseWheelZoomEvent);
|
||||||
slideLoader.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
|
this.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
|
||||||
slideLoader.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
|
|
||||||
slideLoader.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
|
|
||||||
_sendCurrentMouseLocTimer.addEventListener(TimerEvent.TIMER, mouseCursorUpdateTimerListener);
|
_sendCurrentMouseLocTimer.addEventListener(TimerEvent.TIMER, mouseCursorUpdateTimerListener);
|
||||||
_sendCurrentMouseLocTimer.start();
|
_sendCurrentMouseLocTimer.start();
|
||||||
notifyOthersOfZoomEvent();
|
notifyOthersOfZoomEvent();
|
||||||
|
@ -51,7 +51,6 @@ package org.bigbluebutton.modules.whiteboard
|
|||||||
import org.bigbluebutton.modules.whiteboard.business.shapes.Pencil;
|
import org.bigbluebutton.modules.whiteboard.business.shapes.Pencil;
|
||||||
import org.bigbluebutton.modules.whiteboard.business.shapes.ShapeFactory;
|
import org.bigbluebutton.modules.whiteboard.business.shapes.ShapeFactory;
|
||||||
import org.bigbluebutton.modules.whiteboard.business.shapes.TextDrawAnnotation;
|
import org.bigbluebutton.modules.whiteboard.business.shapes.TextDrawAnnotation;
|
||||||
import org.bigbluebutton.modules.whiteboard.business.shapes.TextDrawObject;
|
|
||||||
import org.bigbluebutton.modules.whiteboard.business.shapes.TextObject;
|
import org.bigbluebutton.modules.whiteboard.business.shapes.TextObject;
|
||||||
import org.bigbluebutton.modules.whiteboard.business.shapes.WhiteboardConstants;
|
import org.bigbluebutton.modules.whiteboard.business.shapes.WhiteboardConstants;
|
||||||
import org.bigbluebutton.modules.whiteboard.events.GraphicObjectFocusEvent;
|
import org.bigbluebutton.modules.whiteboard.events.GraphicObjectFocusEvent;
|
||||||
|
@ -64,8 +64,6 @@ package org.bigbluebutton.modules.whiteboard.business.shapes
|
|||||||
return new Line(a.id, a.type, a.status);
|
return new Line(a.id, a.type, a.status);
|
||||||
} else if (a.type == DrawObject.TRIANGLE) {
|
} else if (a.type == DrawObject.TRIANGLE) {
|
||||||
return new Triangle(a.id, a.type, a.status);
|
return new Triangle(a.id, a.type, a.status);
|
||||||
} else if (a.type == DrawObject.TEXT) {
|
|
||||||
return new TextDrawObject(a.id, a.type, a.status);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@ -1,184 +0,0 @@
|
|||||||
/**
|
|
||||||
* 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/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
package org.bigbluebutton.modules.whiteboard.business.shapes
|
|
||||||
{
|
|
||||||
import com.asfusion.mate.core.GlobalDispatcher;
|
|
||||||
|
|
||||||
import flash.display.DisplayObject;
|
|
||||||
import flash.display.Shape;
|
|
||||||
import flash.display.Stage;
|
|
||||||
import flash.events.Event;
|
|
||||||
import flash.events.FocusEvent;
|
|
||||||
import flash.events.KeyboardEvent;
|
|
||||||
import flash.events.MouseEvent;
|
|
||||||
import flash.events.TextEvent;
|
|
||||||
import flash.text.AntiAliasType;
|
|
||||||
import flash.text.TextField;
|
|
||||||
import flash.text.TextFieldType;
|
|
||||||
import flash.text.TextFormat;
|
|
||||||
|
|
||||||
import flashx.textLayout.edit.SelectionManager;
|
|
||||||
|
|
||||||
import flexlib.scheduling.scheduleClasses.utils.Selection;
|
|
||||||
|
|
||||||
import mx.controls.Text;
|
|
||||||
|
|
||||||
import org.bigbluebutton.common.LogUtil;
|
|
||||||
import org.bigbluebutton.modules.whiteboard.WhiteboardCanvasModel;
|
|
||||||
import org.bigbluebutton.modules.whiteboard.models.Annotation;
|
|
||||||
|
|
||||||
public class TextDrawObject extends DrawObject implements GraphicObject {
|
|
||||||
public static const TYPE_NOT_EDITABLE:String = "dynamic";
|
|
||||||
public static const TYPE_EDITABLE:String = "editable";
|
|
||||||
|
|
||||||
public static const TEXT_CREATED:String = "textCreated";
|
|
||||||
public static const TEXT_UPDATED:String = "textEdited";
|
|
||||||
public static const TEXT_PUBLISHED:String = "textPublished";
|
|
||||||
|
|
||||||
public static const TEXT_TOOL:String = "textTool";
|
|
||||||
|
|
||||||
private var _editable:Boolean;
|
|
||||||
|
|
||||||
private var _type:String = DrawObject.TEXT;
|
|
||||||
|
|
||||||
|
|
||||||
private var _origParentWidth:Number = 0;
|
|
||||||
private var _origParentHeight:Number = 0;
|
|
||||||
|
|
||||||
private var _textField:TextField = new TextField();
|
|
||||||
|
|
||||||
public function TextDrawObject(id:String, type:String, status:String) {
|
|
||||||
super(id, type, status);
|
|
||||||
|
|
||||||
addChild(_textField);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function get origParentWidth():Number {
|
|
||||||
return _origParentWidth;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function get origParentHeight():Number {
|
|
||||||
return _origParentHeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function get textField():TextField {
|
|
||||||
return _textField;
|
|
||||||
}
|
|
||||||
|
|
||||||
override public function draw(a:Annotation, parentWidth:Number, parentHeight:Number, zoom:Number):void {
|
|
||||||
LogUtil.debug("Drawing TEXT");
|
|
||||||
|
|
||||||
this.x = denormalize(a.annotation.x, parentWidth);
|
|
||||||
this.y = denormalize(a.annotation.y, parentHeight);
|
|
||||||
|
|
||||||
var newFontSize:Number = a.annotation.fontSize;
|
|
||||||
|
|
||||||
if (_origParentHeight == 0 && _origParentWidth == 0) {
|
|
||||||
// LogUtil.debug("Old parent dim [" + _origParentWidth + "," + _origParentHeight + "]");
|
|
||||||
newFontSize = a.annotation.fontSize;
|
|
||||||
_origParentHeight = parentHeight;
|
|
||||||
_origParentWidth = parentWidth;
|
|
||||||
} else {
|
|
||||||
newFontSize = (parentHeight/_origParentHeight) * a.annotation.fontSize;
|
|
||||||
// LogUtil.debug("2 Old parent dim [" + _origParentWidth + "," + _origParentHeight + "] newFontSize=" + newFontSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
_textField.text = a.annotation.text;
|
|
||||||
_textField.antiAliasType = AntiAliasType.ADVANCED;
|
|
||||||
var format:TextFormat = new TextFormat();
|
|
||||||
format.size = newFontSize;
|
|
||||||
format.font = "arial";
|
|
||||||
_textField.defaultTextFormat = format;
|
|
||||||
_textField.setTextFormat(format);
|
|
||||||
|
|
||||||
this.width = denormalize(a.annotation.textBoxWidth, parentWidth);
|
|
||||||
this.height = denormalize(a.annotation.textBoxHeight, parentHeight);
|
|
||||||
|
|
||||||
LogUtil.debug("2 Old parent dim [" + _origParentWidth + "," + _origParentHeight + "][" + width + "," + height + "] newFontSize=" + newFontSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function redrawText(a:Annotation, origParentWidth:Number, origParentHeight:Number, parentWidth:Number, parentHeight:Number):void {
|
|
||||||
this.x = denormalize(a.annotation.x, parentWidth);
|
|
||||||
this.y = denormalize(a.annotation.y, parentHeight);
|
|
||||||
|
|
||||||
var newFontSize:Number = a.annotation.fontSize;
|
|
||||||
newFontSize = (parentHeight/origParentHeight) * a.annotation.fontSize;
|
|
||||||
|
|
||||||
/** Pass around the original parent width and height when this text was drawn.
|
|
||||||
* We need this to redraw the the text to the proper size properly.
|
|
||||||
* **/
|
|
||||||
_origParentHeight = origParentHeight;
|
|
||||||
_origParentWidth = origParentWidth;
|
|
||||||
|
|
||||||
_textField.text = a.annotation.text;
|
|
||||||
_textField.antiAliasType = AntiAliasType.ADVANCED;
|
|
||||||
var format:TextFormat = new TextFormat();
|
|
||||||
format.size = newFontSize;
|
|
||||||
format.font = "arial";
|
|
||||||
_textField.defaultTextFormat = format;
|
|
||||||
_textField.setTextFormat(format);
|
|
||||||
|
|
||||||
this.width = denormalize(a.annotation.textBoxWidth, parentWidth);
|
|
||||||
this.height = denormalize(a.annotation.textBoxHeight, parentHeight);
|
|
||||||
|
|
||||||
LogUtil.debug("Redraw dim [" + _origParentWidth + "," + _origParentHeight + "][" + width + "," + height + "] newFontSize=" + newFontSize);
|
|
||||||
|
|
||||||
// LogUtil.debug("Redraw 2 Old parent dim [" + this.width + "," + this.height + "] newFontSize=" + newFontSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function displayForPresenter():void {
|
|
||||||
_textField.multiline = true;
|
|
||||||
_textField.wordWrap = true;
|
|
||||||
_textField.type = TextFieldType.INPUT;
|
|
||||||
_textField.border = true;
|
|
||||||
_textField.background = true;
|
|
||||||
_textField.backgroundColor = 0xFFFFFF;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function displayNormally():void {
|
|
||||||
_textField.multiline = true;
|
|
||||||
_textField.wordWrap = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function makeEditable(editable:Boolean):void {
|
|
||||||
if(editable) {
|
|
||||||
_textField.type = TextFieldType.INPUT;
|
|
||||||
} else {
|
|
||||||
_textField.type = TextFieldType.DYNAMIC;
|
|
||||||
}
|
|
||||||
this._editable = editable;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function registerListeners(textObjGainedFocus:Function, textObjLostFocus:Function, textObjTextListener:Function, textObjDeleteListener:Function):void {
|
|
||||||
_textField.addEventListener(FocusEvent.FOCUS_IN, textObjGainedFocus);
|
|
||||||
_textField.addEventListener(FocusEvent.FOCUS_OUT, textObjLostFocus);
|
|
||||||
_textField.addEventListener(TextEvent.TEXT_INPUT, textObjTextListener);
|
|
||||||
_textField.addEventListener(KeyboardEvent.KEY_DOWN, textObjDeleteListener);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function deregisterListeners(textObjGainedFocus:Function, textObjLostFocus:Function, textObjTextListener:Function, textObjDeleteListener:Function):void {
|
|
||||||
_textField.removeEventListener(FocusEvent.FOCUS_IN, textObjGainedFocus);
|
|
||||||
_textField.removeEventListener(FocusEvent.FOCUS_OUT, textObjLostFocus);
|
|
||||||
_textField.removeEventListener(TextEvent.TEXT_INPUT, textObjTextListener);
|
|
||||||
_textField.removeEventListener(KeyboardEvent.KEY_DOWN, textObjDeleteListener);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -87,6 +87,9 @@ package org.bigbluebutton.modules.whiteboard.business.shapes
|
|||||||
_textBoxHeight = boxHeight;
|
_textBoxHeight = boxHeight;
|
||||||
this.textSize = textSize;
|
this.textSize = textSize;
|
||||||
_calcedFontSize = calcedFontSize;
|
_calcedFontSize = calcedFontSize;
|
||||||
|
|
||||||
|
this.mouseEnabled = false;
|
||||||
|
this.mouseWheelEnabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function get id():String {
|
public function get id():String {
|
||||||
|
@ -0,0 +1,31 @@
|
|||||||
|
package org.bigbluebutton.modules.whiteboard.views
|
||||||
|
{
|
||||||
|
import flash.events.Event;
|
||||||
|
import flash.events.FocusEvent;
|
||||||
|
|
||||||
|
import mx.controls.ComboBox;
|
||||||
|
|
||||||
|
public class CustomComboBox extends ComboBox
|
||||||
|
{
|
||||||
|
private var _allowClose:Boolean = true;
|
||||||
|
|
||||||
|
public function CustomComboBox()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
override protected function focusOutHandler(event:FocusEvent):void {
|
||||||
|
_allowClose = false;
|
||||||
|
|
||||||
|
super.focusOutHandler(event);
|
||||||
|
|
||||||
|
_allowClose = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
override public function close(trigger:Event=null):void {
|
||||||
|
if (_allowClose) {
|
||||||
|
super.close(trigger);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,201 +0,0 @@
|
|||||||
/**
|
|
||||||
* 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/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
package org.bigbluebutton.modules.whiteboard.views
|
|
||||||
{
|
|
||||||
import flash.display.DisplayObject;
|
|
||||||
import flash.events.KeyboardEvent;
|
|
||||||
import flash.events.MouseEvent;
|
|
||||||
import flash.geom.Point;
|
|
||||||
import flash.geom.Rectangle;
|
|
||||||
import flash.ui.Keyboard;
|
|
||||||
|
|
||||||
import mx.controls.PopUpButton;
|
|
||||||
import mx.core.UIComponent;
|
|
||||||
import mx.core.UIComponentGlobals;
|
|
||||||
import mx.core.mx_internal;
|
|
||||||
import mx.effects.Tween;
|
|
||||||
import mx.events.InterManagerRequest;
|
|
||||||
import mx.managers.ISystemManager;
|
|
||||||
import mx.managers.PopUpManager;
|
|
||||||
|
|
||||||
use namespace mx_internal;
|
|
||||||
|
|
||||||
public class PopUpCombo extends PopUpButton
|
|
||||||
{
|
|
||||||
public var isOpen:Boolean = false;
|
|
||||||
protected var _inTween:Boolean = false;
|
|
||||||
protected var _tween:Tween;
|
|
||||||
|
|
||||||
private var _specificOpenDirection:String;
|
|
||||||
|
|
||||||
public static const OPEN_UP:String = "OPEN_UP";
|
|
||||||
public static const OPEN_DOWN:String = "OPEN_DOWN";
|
|
||||||
|
|
||||||
public function PopUpCombo()
|
|
||||||
{
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function get specificOpenDirection():String
|
|
||||||
{
|
|
||||||
if(!_specificOpenDirection) _specificOpenDirection = PopUpCombo.OPEN_DOWN;
|
|
||||||
return _specificOpenDirection;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function set specificOpenDirection(value:String):void
|
|
||||||
{
|
|
||||||
_specificOpenDirection = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
override protected function clickHandler(event:MouseEvent):void
|
|
||||||
{
|
|
||||||
event.stopImmediatePropagation();
|
|
||||||
displayPopUp();
|
|
||||||
}
|
|
||||||
|
|
||||||
override protected function keyDownHandler(event:KeyboardEvent):void
|
|
||||||
{
|
|
||||||
super.keyDownHandler(event);
|
|
||||||
|
|
||||||
if (event.ctrlKey && event.keyCode == Keyboard.DOWN)
|
|
||||||
{
|
|
||||||
event.stopImmediatePropagation();
|
|
||||||
displayPopUp();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function displayPopUp():void
|
|
||||||
{
|
|
||||||
var show:Boolean = !isOpen;
|
|
||||||
|
|
||||||
var popUpGap:Number = getStyle("popUpGap");
|
|
||||||
var point:Point = new Point(0, unscaledHeight + popUpGap);
|
|
||||||
point = localToGlobal(point);
|
|
||||||
|
|
||||||
var initY:Number;
|
|
||||||
var endY:Number;
|
|
||||||
var easingFunction:Function;
|
|
||||||
var duration:Number;
|
|
||||||
|
|
||||||
if (popUp.parent == null)
|
|
||||||
{
|
|
||||||
PopUpManager.addPopUp(popUp, this, false);
|
|
||||||
popUp.owner = this;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
PopUpManager.bringToFront(popUp);
|
|
||||||
|
|
||||||
if(show)
|
|
||||||
{
|
|
||||||
|
|
||||||
if(specificOpenDirection == PopUpCombo.OPEN_UP)
|
|
||||||
{
|
|
||||||
point.y -= (unscaledHeight + popUp.height + 2*popUpGap);
|
|
||||||
initY = -popUp.height;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
initY = popUp.height;
|
|
||||||
}
|
|
||||||
|
|
||||||
point.x = Math.min( point.x, visibleScreen.right - popUp.getExplicitOrMeasuredWidth());
|
|
||||||
point.x = Math.max( point.x, 0);
|
|
||||||
point = popUp.parent.globalToLocal(point);
|
|
||||||
if (popUp.x != point.x || popUp.y != point.y)
|
|
||||||
popUp.move(point.x, point.y);
|
|
||||||
|
|
||||||
popUp.scrollRect = new Rectangle(0, initY,
|
|
||||||
popUp.width, popUp.height);
|
|
||||||
|
|
||||||
if (!popUp.visible)
|
|
||||||
popUp.visible = true;
|
|
||||||
|
|
||||||
endY = 0;
|
|
||||||
isOpen = show;
|
|
||||||
duration = getStyle("openDuration");
|
|
||||||
easingFunction = getStyle("openEasingFunction") as Function;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
isOpen = show;
|
|
||||||
|
|
||||||
if (popUp.parent == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
point = popUp.parent.globalToLocal(point);
|
|
||||||
|
|
||||||
endY = (specificOpenDirection == PopUpCombo.OPEN_UP) ? -popUp.height - 2 : popUp.height + 2;
|
|
||||||
initY = 0;
|
|
||||||
duration = getStyle("closeDuration")
|
|
||||||
easingFunction = getStyle("closeEasingFunction") as Function;
|
|
||||||
}
|
|
||||||
|
|
||||||
_inTween = true;
|
|
||||||
UIComponentGlobals.layoutManager.validateNow();
|
|
||||||
|
|
||||||
// Block all layout, responses from web service, and other background
|
|
||||||
// processing until the tween finishes executing.
|
|
||||||
UIComponent.suspendBackgroundProcessing();
|
|
||||||
|
|
||||||
_tween = new Tween(this, initY, endY, duration);
|
|
||||||
if (easingFunction != null)
|
|
||||||
_tween.easingFunction = easingFunction;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function get visibleScreen():Rectangle
|
|
||||||
{
|
|
||||||
var sm:ISystemManager = systemManager.topLevelSystemManager;
|
|
||||||
var sbRoot:DisplayObject = sm.getSandboxRoot();
|
|
||||||
var _screen:Rectangle;
|
|
||||||
if (sm != sbRoot)
|
|
||||||
{
|
|
||||||
var request:InterManagerRequest = new InterManagerRequest(InterManagerRequest.SYSTEM_MANAGER_REQUEST,
|
|
||||||
false, false,
|
|
||||||
"getVisibleApplicationRect");
|
|
||||||
sbRoot.dispatchEvent(request);
|
|
||||||
_screen = Rectangle(request.value);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
_screen = sm.getVisibleApplicationRect();
|
|
||||||
|
|
||||||
return _screen;
|
|
||||||
}
|
|
||||||
|
|
||||||
override mx_internal function onTweenUpdate(value:Number):void
|
|
||||||
{
|
|
||||||
popUp.scrollRect =
|
|
||||||
new Rectangle(0, value, popUp.width, popUp.height);
|
|
||||||
}
|
|
||||||
|
|
||||||
override mx_internal function onTweenEnd(value:Number):void
|
|
||||||
{
|
|
||||||
popUp.scrollRect =
|
|
||||||
new Rectangle(0, value, popUp.width, popUp.height);
|
|
||||||
|
|
||||||
_inTween = false;
|
|
||||||
UIComponent.resumeBackgroundProcessing();
|
|
||||||
|
|
||||||
if (!isOpen)
|
|
||||||
{
|
|
||||||
popUp.visible = false;
|
|
||||||
popUp.scrollRect = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -36,6 +36,8 @@ package org.bigbluebutton.modules.whiteboard.views
|
|||||||
private var _textStatus:String = TextObject.TEXT_CREATED;
|
private var _textStatus:String = TextObject.TEXT_CREATED;
|
||||||
private var _mouseXDown:Number = 0;
|
private var _mouseXDown:Number = 0;
|
||||||
private var _mouseYDown:Number = 0;
|
private var _mouseYDown:Number = 0;
|
||||||
|
private var _mouseXMove:Number = 0;
|
||||||
|
private var _mouseYMove:Number = 0;
|
||||||
private var _idGenerator:AnnotationIDGenerator;
|
private var _idGenerator:AnnotationIDGenerator;
|
||||||
private var _mousedDown:Boolean = false;
|
private var _mousedDown:Boolean = false;
|
||||||
private var _curID:String;
|
private var _curID:String;
|
||||||
@ -62,9 +64,9 @@ package org.bigbluebutton.modules.whiteboard.views
|
|||||||
public function onMouseDown(mouseX:Number, mouseY:Number, tool:WhiteboardTool):void
|
public function onMouseDown(mouseX:Number, mouseY:Number, tool:WhiteboardTool):void
|
||||||
{
|
{
|
||||||
if (tool.graphicType == WhiteboardConstants.TYPE_TEXT) {
|
if (tool.graphicType == WhiteboardConstants.TYPE_TEXT) {
|
||||||
_mouseXDown = mouseX;
|
_mouseXDown = _mouseXMove = mouseX;
|
||||||
_mouseYDown = mouseY;
|
_mouseYDown = _mouseYMove = mouseY;
|
||||||
|
|
||||||
// We have to keep track if the user has pressed the mouse. A mouseup event is
|
// We have to keep track if the user has pressed the mouse. A mouseup event is
|
||||||
// dispatched when the mouse goes out of the canvas, theu we end up sending a new text
|
// dispatched when the mouse goes out of the canvas, theu we end up sending a new text
|
||||||
// even if the user has mousedDown yet.
|
// even if the user has mousedDown yet.
|
||||||
@ -75,6 +77,9 @@ package org.bigbluebutton.modules.whiteboard.views
|
|||||||
public function onMouseMove(mouseX:Number, mouseY:Number, tool:WhiteboardTool):void
|
public function onMouseMove(mouseX:Number, mouseY:Number, tool:WhiteboardTool):void
|
||||||
{
|
{
|
||||||
if (tool.graphicType == WhiteboardConstants.TYPE_TEXT && _mousedDown) {
|
if (tool.graphicType == WhiteboardConstants.TYPE_TEXT && _mousedDown) {
|
||||||
|
_mouseXMove = mouseX;
|
||||||
|
_mouseYMove = mouseY;
|
||||||
|
|
||||||
if (_wbCanvas.contains(feedback)) {
|
if (_wbCanvas.contains(feedback)) {
|
||||||
_wbCanvas.removeRawChild(feedback);
|
_wbCanvas.removeRawChild(feedback);
|
||||||
}
|
}
|
||||||
@ -87,6 +92,9 @@ package org.bigbluebutton.modules.whiteboard.views
|
|||||||
|
|
||||||
public function onMouseUp(mouseX:Number, mouseY:Number, tool:WhiteboardTool):void
|
public function onMouseUp(mouseX:Number, mouseY:Number, tool:WhiteboardTool):void
|
||||||
{
|
{
|
||||||
|
// We have to use the saved X and Y from the last mouse move rather than the X and
|
||||||
|
// Y from MouseUp because the latter might be outside the bounds of the area.
|
||||||
|
|
||||||
if (tool.graphicType == WhiteboardConstants.TYPE_TEXT && _mousedDown) {
|
if (tool.graphicType == WhiteboardConstants.TYPE_TEXT && _mousedDown) {
|
||||||
feedback.clear();
|
feedback.clear();
|
||||||
if (_wbCanvas.contains(feedback)) {
|
if (_wbCanvas.contains(feedback)) {
|
||||||
@ -95,12 +103,12 @@ package org.bigbluebutton.modules.whiteboard.views
|
|||||||
|
|
||||||
_mousedDown = false;
|
_mousedDown = false;
|
||||||
|
|
||||||
var tbWidth:Number = Math.abs(mouseX - _mouseXDown);
|
var tbWidth:Number = Math.abs(_mouseXMove - _mouseXDown);
|
||||||
var tbHeight:Number = Math.abs(mouseY - _mouseYDown);
|
var tbHeight:Number = Math.abs(_mouseYMove - _mouseYDown);
|
||||||
|
|
||||||
if (tbHeight < 15 || tbWidth < 50) return;
|
if (tbHeight < 15 || tbWidth < 50) return;
|
||||||
|
|
||||||
var tobj:TextDrawAnnotation = _shapeFactory.createTextObject("", 0x000000, Math.min(_mouseXDown, mouseX), Math.min(_mouseYDown, mouseY), tbWidth, tbHeight, 18);
|
var tobj:TextDrawAnnotation = _shapeFactory.createTextObject("", 0x000000, Math.min(_mouseXDown, _mouseXMove), Math.min(_mouseYDown, _mouseYMove), tbWidth, tbHeight, 18);
|
||||||
|
|
||||||
sendTextToServer(TextObject.TEXT_CREATED, tobj);
|
sendTextToServer(TextObject.TEXT_CREATED, tobj);
|
||||||
}
|
}
|
||||||
|
@ -106,6 +106,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
|||||||
private function doMouseDown(event:Event):void {
|
private function doMouseDown(event:Event):void {
|
||||||
displayModel.doMouseDown(this.mouseX, this.mouseY);
|
displayModel.doMouseDown(this.mouseX, this.mouseY);
|
||||||
model.doMouseDown(this.mouseX, this.mouseY);
|
model.doMouseDown(this.mouseX, this.mouseY);
|
||||||
|
event.stopPropagation(); // we want to stop the bubbling so slide doesn't move
|
||||||
}
|
}
|
||||||
|
|
||||||
private function doMouseMove(event:Event):void {
|
private function doMouseMove(event:Event):void {
|
||||||
|
@ -38,7 +38,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
|||||||
import mx.events.MenuEvent;
|
import mx.events.MenuEvent;
|
||||||
import mx.events.MoveEvent;
|
import mx.events.MoveEvent;
|
||||||
import mx.events.ResizeEvent;
|
import mx.events.ResizeEvent;
|
||||||
import mx.managers.FocusManager;
|
import mx.managers.FocusManager;
|
||||||
|
|
||||||
import org.bigbluebutton.common.Images;
|
import org.bigbluebutton.common.Images;
|
||||||
import org.bigbluebutton.common.LogUtil;
|
import org.bigbluebutton.common.LogUtil;
|
||||||
import org.bigbluebutton.main.events.MadePresenterEvent;
|
import org.bigbluebutton.main.events.MadePresenterEvent;
|
||||||
@ -65,6 +66,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
|||||||
private var normalAlpha:Number = 0.55;
|
private var normalAlpha:Number = 0.55;
|
||||||
private var focusedAlpha:Number = 1.0;
|
private var focusedAlpha:Number = 1.0;
|
||||||
private var hasFocus:Boolean;
|
private var hasFocus:Boolean;
|
||||||
|
private var fontSizes:Array = ["12", "14", "16", "18", "22", "24", "32", "36"];
|
||||||
|
|
||||||
public function init():void {
|
public function init():void {
|
||||||
this.alpha = normalAlpha;
|
this.alpha = normalAlpha;
|
||||||
@ -92,23 +94,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
|||||||
this.alpha = focusedAlpha;
|
this.alpha = focusedAlpha;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function initTextSizeMenu(): void {
|
private function onFontSizeChange():void {
|
||||||
var m:Menu = new Menu();
|
setTextSize(Number(textSizeMenu.selectedItem));
|
||||||
m.variableRowHeight = true;
|
|
||||||
var textSizeMenuData:Object = [{label: "12"}, {label: "14"}, {label: "16"},
|
|
||||||
{label: "18"}, {label: "22"}, {label: "24"}, {label: "32"}, {label: "36"}];
|
|
||||||
m.dataProvider = textSizeMenuData;
|
|
||||||
m.addEventListener(MenuEvent.CHANGE, textSizeMenuClick);
|
|
||||||
m.showRoot = false;
|
|
||||||
textSizeMenu.popUp = m;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Define the event listener for the Menu control's change event.
|
|
||||||
private function textSizeMenuClick(event:MenuEvent):void {
|
|
||||||
enableTextToolbar();
|
|
||||||
textSizeMenu.displayPopUp();
|
|
||||||
var newTextSize:Number = Number(event.label);
|
|
||||||
setTextSize(newTextSize);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -156,7 +143,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
|||||||
enableTextToolbar();
|
enableTextToolbar();
|
||||||
this.textSize = size;
|
this.textSize = size;
|
||||||
LogUtil.debug("Text size set to: " + size);
|
LogUtil.debug("Text size set to: " + size);
|
||||||
textSizeMenu.label = String(this.textSize);
|
|
||||||
canvas.modifySelectedTextObject(textColor, backgroundVisible, bgColor, textSize);
|
canvas.modifySelectedTextObject(textColor, backgroundVisible, bgColor, textSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -182,7 +168,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
|||||||
this.textColor = ctextpik.selectedColor = tobj.textColor;
|
this.textColor = ctextpik.selectedColor = tobj.textColor;
|
||||||
// this.bgColor = cbackpik.selectedColor = tobj.backgroundColor;
|
// this.bgColor = cbackpik.selectedColor = tobj.backgroundColor;
|
||||||
// this.backgroundVisible = btnToggleBackground.selected = tobj.background;
|
// this.backgroundVisible = btnToggleBackground.selected = tobj.background;
|
||||||
this.textSizeMenu.label = String(tobj.textSize);
|
this.textSizeMenu.selectedItem = String(tobj.textSize);
|
||||||
this.textSize = tobj.textSize;
|
this.textSize = tobj.textSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -210,12 +196,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
|||||||
// translate TextObject's coords to stage coords because TextToolbar is added to stage
|
// translate TextObject's coords to stage coords because TextToolbar is added to stage
|
||||||
|
|
||||||
if (tobj == null) tobj = currentlySelectedTextObject;
|
if (tobj == null) tobj = currentlySelectedTextObject;
|
||||||
|
|
||||||
if (textSizeMenu.isOpen) {
|
|
||||||
LogUtil.debug("Text size menu is open...trying to close");
|
|
||||||
textSizeMenu.displayPopUp();
|
|
||||||
}
|
|
||||||
|
|
||||||
var loc:Point = canvas.localToGlobal(new Point(tobj.x, tobj.y));
|
var loc:Point = canvas.localToGlobal(new Point(tobj.x, tobj.y));
|
||||||
this.x = loc.x;
|
this.x = loc.x;
|
||||||
this.y = loc.y - this.height - 45;
|
this.y = loc.y - this.height - 45;
|
||||||
@ -272,7 +253,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
|||||||
<mx:ColorPicker width="20" height="20" change="setTextColor(event)" id="ctextpik" selectedColor="0x000000"
|
<mx:ColorPicker width="20" height="20" change="setTextColor(event)" id="ctextpik" selectedColor="0x000000"
|
||||||
toolTip="{ResourceUtil.getInstance().getString('ltbcustom.bbb.highlighter.texttoolbar.textColorPicker')}"/>
|
toolTip="{ResourceUtil.getInstance().getString('ltbcustom.bbb.highlighter.texttoolbar.textColorPicker')}"/>
|
||||||
|
|
||||||
<views:PopUpCombo id="textSizeMenu" creationComplete="initTextSizeMenu()"
|
<views:CustomComboBox id="textSizeMenu" dataProvider="{fontSizes}" change="onFontSizeChange()" rowCount="8"
|
||||||
toolTip="{ResourceUtil.getInstance().getString('ltbcustom.bbb.highlighter.texttoolbar.textSizeMenu')}"
|
toolTip="{ResourceUtil.getInstance().getString('ltbcustom.bbb.highlighter.texttoolbar.textSizeMenu')}" />
|
||||||
openAlways="true" specificOpenDirection="{PopUpCombo.OPEN_UP}" />
|
|
||||||
</mx:HBox>
|
</mx:HBox>
|
||||||
|
Loading…
Reference in New Issue
Block a user