- add timestamps on notes
This commit is contained in:
parent
92d483eae1
commit
7b94a1885f
@ -7,6 +7,7 @@ package org.bigbluebutton.modules.notes.events
|
||||
public static const NOTE_SAVE_SUCCESS:String = "note save success event";
|
||||
|
||||
public var noteID:String;
|
||||
public var timestamp:String;
|
||||
|
||||
public function SaveSuccessEvent(bubbles:Boolean=true, cancelable:Boolean=false)
|
||||
{
|
||||
|
@ -24,8 +24,7 @@
|
||||
xmlns="http://mate.asfusion.com/">
|
||||
<mx:Script>
|
||||
<![CDATA[
|
||||
import mx.events.FlexEvent;
|
||||
|
||||
import mx.events.FlexEvent;
|
||||
import org.bigbluebutton.modules.notes.events.NotesModuleStartEvent;
|
||||
import org.bigbluebutton.modules.notes.events.RetrieveNotesEvent;
|
||||
import org.bigbluebutton.modules.notes.events.RetrieveNotesSuccessEvent;
|
||||
@ -59,7 +58,7 @@
|
||||
</EventHandlers>
|
||||
|
||||
<EventHandlers type="{SaveSuccessEvent.NOTE_SAVE_SUCCESS}">
|
||||
<MethodInvoker generator="{NotesMessageService}" method="saveSuccess" arguments="{event.noteID}" />
|
||||
<MethodInvoker generator="{NotesMessageService}" method="saveSuccess" arguments="{event}" />
|
||||
</EventHandlers>
|
||||
|
||||
<EventHandlers type="{SaveErrorEvent.FAILED_TO_SAVE}">
|
||||
|
@ -1,10 +1,11 @@
|
||||
package org.bigbluebutton.modules.notes.models
|
||||
{
|
||||
[Bindable]
|
||||
public class Note
|
||||
{
|
||||
public var noteID:String;
|
||||
public var note:String;
|
||||
public var saved:Boolean = false;
|
||||
|
||||
public var timestamp:String = "";
|
||||
}
|
||||
}
|
@ -11,11 +11,12 @@ package org.bigbluebutton.modules.notes.models
|
||||
notes.addItem(n);
|
||||
}
|
||||
|
||||
public function noteSaved(noteID:String):void {
|
||||
public function noteSaved(noteID:String, timestamp:String):void {
|
||||
for (var i:int = 0; i < notes.length; i++){
|
||||
var item:Note = notes.getItemAt(i) as Note;
|
||||
if (item.noteID == noteID) {
|
||||
item.saved = true;
|
||||
item.timestamp = timestamp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -54,6 +54,7 @@ package org.bigbluebutton.modules.notes.services
|
||||
_request.method = URLRequestMethod.GET;
|
||||
|
||||
_vars = new URLVariables();
|
||||
_vars.saveNote = "";
|
||||
_vars.noteID = _note.noteID;
|
||||
_vars.text = base64Encode(_note.note);
|
||||
_vars.externalMeetingID = UsersUtil.getExternalMeetingID();
|
||||
@ -89,9 +90,10 @@ package org.bigbluebutton.modules.notes.services
|
||||
var xml:XML = new XML(event.target.data);
|
||||
|
||||
if (saveSuccess(xml)) {
|
||||
trace("SAVED");
|
||||
trace("SAVED noteID [" + _note.noteID + "] on [" + xml.timestamp + "]");
|
||||
var successEvent:SaveSuccessEvent = new SaveSuccessEvent();
|
||||
successEvent.noteID = _note.noteID;
|
||||
successEvent.timestamp = xml.timestamp;
|
||||
_dispatcher.dispatchEvent(successEvent);
|
||||
} else {
|
||||
trace("NOT SAVED");
|
||||
|
@ -5,6 +5,7 @@ package org.bigbluebutton.modules.notes.services
|
||||
import mx.collections.ArrayCollection;
|
||||
|
||||
import org.bigbluebutton.modules.notes.events.SaveErrorEvent;
|
||||
import org.bigbluebutton.modules.notes.events.SaveSuccessEvent;
|
||||
import org.bigbluebutton.modules.notes.models.Note;
|
||||
import org.bigbluebutton.modules.notes.models.NotesModel;
|
||||
import org.bigbluebutton.modules.notes.models.NotesOptions;
|
||||
@ -42,8 +43,8 @@ package org.bigbluebutton.modules.notes.services
|
||||
// TODO: Re-save?
|
||||
}
|
||||
|
||||
public function saveSuccess(noteID:String):void {
|
||||
notesModel.noteSaved(noteID);
|
||||
public function saveSuccess(event:SaveSuccessEvent):void {
|
||||
notesModel.noteSaved(event.noteID, event.timestamp);
|
||||
}
|
||||
|
||||
private function generateRandomString(strlen:Number):String{
|
||||
|
@ -48,8 +48,9 @@ package org.bigbluebutton.modules.notes.services
|
||||
_request.method = URLRequestMethod.GET;
|
||||
|
||||
_vars = new URLVariables();
|
||||
_vars.retrieveNotes = "";
|
||||
_vars.meetingID = UsersUtil.getExternalMeetingID();
|
||||
_vars.userId = UsersUtil.internalUserIDToExternalUserID(UsersUtil.getMyUserID());
|
||||
_vars.userID = UsersUtil.internalUserIDToExternalUserID(UsersUtil.getMyUserID());
|
||||
|
||||
try {
|
||||
_loader.load(_request);
|
||||
@ -91,6 +92,7 @@ package org.bigbluebutton.modules.notes.services
|
||||
note.note = decNote;
|
||||
note.noteID = item.noteID;
|
||||
note.saved = true;
|
||||
note.timestamp = item.timestamp;
|
||||
notes.addItem(note);
|
||||
}
|
||||
return notes;
|
||||
|
@ -20,7 +20,7 @@
|
||||
$Id: $
|
||||
-->
|
||||
|
||||
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" verticalAlign="top"
|
||||
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" verticalAlign="top" styleName="noteRendererStyle"
|
||||
verticalScrollPolicy="off" xmlns:common="org.bigbluebutton.common.*" dataChange="validateNow()"
|
||||
creationComplete="onCreationComplete()">
|
||||
|
||||
@ -62,8 +62,11 @@
|
||||
]]>
|
||||
</mx:Script>
|
||||
|
||||
<mx:HBox width="100%">
|
||||
<mx:Text id="lblTime" htmlText="{note.note}" textAlign="left"
|
||||
color="gray" width="100%"/>
|
||||
<mx:HBox width="100%" height="15" styleName="noteRendererTimestampStyle">
|
||||
<mx:Text id="timestamp" htmlText="{note.timestamp}" textAlign="left" color="gray" width="100%"/>
|
||||
</mx:HBox>
|
||||
<mx:HBox width="100%" styleName="noteRendererTextStyle">
|
||||
<mx:Spacer width="5"/>
|
||||
<mx:Text id="lblTime" htmlText="{note.note}" textAlign="left" color="gray" width="100%"/>
|
||||
</mx:HBox>
|
||||
</mx:VBox>
|
||||
|
@ -67,6 +67,7 @@
|
||||
txtMsgArea.text = "";
|
||||
}
|
||||
|
||||
//color="{cmpColorPicker.selectedColor}"
|
||||
]]>
|
||||
|
||||
</mx:Script>
|
||||
@ -81,7 +82,7 @@
|
||||
|
||||
<mx:HBox id="notesCtrlBar" width="100%" height="55" styleName="notesControlBarStyle"
|
||||
paddingLeft="5" paddingRight="5" verticalScrollPolicy="off">
|
||||
<mx:TextArea id="txtMsgArea" width="100%" color="{cmpColorPicker.selectedColor}"
|
||||
<mx:TextArea id="txtMsgArea" width="100%"
|
||||
styleName="notesControlBarTextMsgStyle"
|
||||
toolTip="{ResourceUtil.getInstance().getString('bbb.accessibility.notes.notesview.input')}"/>
|
||||
<mx:VBox verticalScrollPolicy="off">
|
||||
@ -89,9 +90,11 @@
|
||||
styleName="notesControlBarSendButtonStyle"
|
||||
toolTip="{ResourceUtil.getInstance().getString('bbb.notes.saveBtn.toolTip')}"
|
||||
click="saveNote()"/>
|
||||
<!--
|
||||
<mx:ColorPicker id="cmpColorPicker" showTextField="false"
|
||||
toolTip="{ResourceUtil.getInstance().getString('bbb.notes.cmpColorPicker.toolTip')}"
|
||||
selectedColor="0x000000" dataProvider="{colorPickerColours}" swatchPanelStyleName="notesColorPickerStyle"/>
|
||||
-->
|
||||
</mx:VBox>
|
||||
</mx:HBox>
|
||||
</mx:VBox>
|
||||
|
Loading…
Reference in New Issue
Block a user