Merge branch 'pedrobmarin-2.0-shared-notes-fixes' into bbb-2x-mconf

This commit is contained in:
Richard Alam 2017-08-21 13:19:40 -07:00
commit bd42ec4141
7 changed files with 40 additions and 4 deletions

View File

@ -530,6 +530,7 @@ bbb.sharedNotes.redo.toolTip = Redo modification
bbb.sharedNotes.toolbar.toolTip = Text formatting toolbar bbb.sharedNotes.toolbar.toolTip = Text formatting toolbar
bbb.sharedNotes.additionalNotes.closeWarning.title = Closing shared notes bbb.sharedNotes.additionalNotes.closeWarning.title = Closing shared notes
bbb.sharedNotes.additionalNotes.closeWarning.message = This action will destroy the notes on this window for everyone, and there's no way to undo. Are you sure you want to close these notes? bbb.sharedNotes.additionalNotes.closeWarning.message = This action will destroy the notes on this window for everyone, and there's no way to undo. Are you sure you want to close these notes?
bbb.sharedNotes.pastewarning.title = Shared Notes Paste Warning
bbb.settings.deskshare.instructions = Choose Allow on the prompt that pops up to check that desktop sharing is working properly for you bbb.settings.deskshare.instructions = Choose Allow on the prompt that pops up to check that desktop sharing is working properly for you
bbb.settings.deskshare.start = Check Desktop Sharing bbb.settings.deskshare.start = Check Desktop Sharing
bbb.settings.voice.volume = Microphone Activity bbb.settings.voice.volume = Microphone Activity

View File

@ -131,6 +131,8 @@
toolbarVisibleByDefault="false" toolbarVisibleByDefault="false"
showToolbarButton="true" showToolbarButton="true"
fontSize="12" fontSize="12"
maxPasteLength="1024"
maxNoteLenght="5120"
/> />
<!-- <!--

View File

@ -6,7 +6,7 @@ package org.bigbluebutton.core.model.users
public var intId: String; public var intId: String;
public var extId: String; public var extId: String;
public var name: String; public var name: String;
public var role: String; [Bindable] public var role: String;
public var guest: Boolean; public var guest: Boolean;
public var authed: Boolean; public var authed: Boolean;
public var waitingForAcceptance: Boolean; public var waitingForAcceptance: Boolean;

View File

@ -18,6 +18,12 @@ package org.bigbluebutton.modules.sharednotes {
[Bindable] [Bindable]
public var fontSize:int = 10; public var fontSize:int = 10;
[Bindable]
public var maxPasteLength:int = 1024;
[Bindable]
public var maxNoteLength:int = 10240;
public function SharedNotesOptions() { public function SharedNotesOptions() {
name = "SharedNotesModule"; name = "SharedNotesModule";
} }

View File

@ -28,8 +28,6 @@ package org.bigbluebutton.modules.sharednotes.views
//showCloseButton = UsersUtil.amIModerator(); //showCloseButton = UsersUtil.amIModerator();
width = 240; width = 240;
height = 240; height = 240;
closeBtn.addEventListener(MouseEvent.CLICK, onCloseBtnClick);
} }
public function get windowName():String { public function get windowName():String {
@ -46,6 +44,7 @@ package org.bigbluebutton.modules.sharednotes.views
LOGGER.debug("AdditionalSharedNotesWindow: [2] in-constructor additional notes " + noteId); LOGGER.debug("AdditionalSharedNotesWindow: [2] in-constructor additional notes " + noteId);
btnNew.visible = btnNew.includeInLayout = false; btnNew.visible = btnNew.includeInLayout = false;
closeBtn.addEventListener(MouseEvent.CLICK, onCloseBtnClick);
} }
private function onCloseBtnClick(e:MouseEvent):void { private function onCloseBtnClick(e:MouseEvent):void {

View File

@ -145,6 +145,8 @@
richTextEditor.bulletButton.visible = false; richTextEditor.bulletButton.visible = false;
richTextEditor.bulletButton.height = 0; richTextEditor.bulletButton.height = 0;
richTextEditor.bulletButton.width = 0; richTextEditor.bulletButton.width = 0;
richTextEditor.textArea.maxChars = options.maxNoteLength;
} }
private function updateRoleDependentProperties(role:String):void { private function updateRoleDependentProperties(role:String):void {
@ -207,10 +209,11 @@
_document = result; _document = result;
// LOGGER.debug("SharedNotes: patching local with server modifications"); // LOGGER.debug("SharedNotes: patching local with server modifications");
richTextEditor.patch(e.patch); richTextEditor.patch(e.patch);
/* This code is forcing resync and causing more problems then resolving
if (possiblePatchError()) { if (possiblePatchError()) {
syncNote(); syncNote();
return; return;
} }*/
} }
_lastPatch = e.patchId; _lastPatch = e.patchId;
updateUndoRedoButtons(e.undo, e.redo); updateUndoRedoButtons(e.undo, e.redo);
@ -422,6 +425,10 @@
return true; return true;
} }
public function throwPasteWarning(pasteLength:int):void {
Alert.show(ResourceUtil.getInstance().getString("bbb.caption.transcript.pastewarning.text", [options.maxPasteLength, pasteLength]), ResourceUtil.getInstance().getString("bbb.sharedNotes.pastewarning.title"), Alert.OK);
}
protected function btnToolbar_clickHandler(event:MouseEvent):void { protected function btnToolbar_clickHandler(event:MouseEvent):void {
richTextEditor.showControlBar = !richTextEditor.showControlBar; richTextEditor.showControlBar = !richTextEditor.showControlBar;
} }
@ -491,6 +498,10 @@
enabled="false" visible="true"/> enabled="false" visible="true"/>
</mx:HBox> </mx:HBox>
<mx:HBox width="100%" horizontalAlign="right" paddingTop="0"> <mx:HBox width="100%" horizontalAlign="right" paddingTop="0">
<mx:Label id="charRemain"
includeInLayout="true"
visible="{(options.maxNoteLength - richTextEditor.text.length) &lt; (options.maxNoteLength / 8)}"
text="{options.maxNoteLength - richTextEditor.text.length}"/>
<mx:Button id="btnNew" <mx:Button id="btnNew"
styleName="sharedNotesNewButtonStyle" styleName="sharedNotesNewButtonStyle"
width="26" width="26"

View File

@ -991,6 +991,17 @@
private var shiftPressed:Boolean = false; private var shiftPressed:Boolean = false;
private var ctrlPressed:Boolean = false; private var ctrlPressed:Boolean = false;
private var preventTextInput:Boolean = false; private var preventTextInput:Boolean = false;
private var _maxPasteLength:int = 1024;
public function set maxPasteLength(value:int):void
{
_maxPasteLength = value;
}
public function get maxPasteLength():int
{
return _maxPasteLength;
}
public function restoreVerticalScroll(oldVerticalScroll:Number):void public function restoreVerticalScroll(oldVerticalScroll:Number):void
{ {
@ -1216,6 +1227,12 @@
{ {
if (e.text.length > 0) refreshSelection = true; if (e.text.length > 0) refreshSelection = true;
if (e.text.length > maxPasteLength)
{
e.preventDefault();
parentDocument.throwPasteWarning(e.text.length);
}
if (preventTextInput) e.preventDefault(); if (preventTextInput) e.preventDefault();
} }