Improve file upload and download features and UI.

This commit is contained in:
Ghazi Triki 2017-08-17 18:37:20 +01:00
parent 0e342c08bb
commit 1c6abe4ae7
8 changed files with 28 additions and 47 deletions

View File

@ -971,9 +971,8 @@ mx|Panel {
//------------------------------
*/
presentation|UploadedPresentationRenderer {
iconSave : Embed(source="assets/swf/v2_skin.swf", symbol="Icon_Save_File");
iconSaveWhite : Embed(source="assets/swf/v2_skin.swf", symbol="Icon_Save_File_White");
.presentationUploadDownloadButtonStyle {
icon : Embed(source="assets/swf/v2_skin.swf", symbol="Icon_Save_File");
}
.presentationWindowControlsStyle {
@ -993,7 +992,6 @@ presentation|UploadedPresentationRenderer {
textRollOverColor : #3F3F41;
textSelectedColor : #3F3F41;
borderColor : #B9BABC;
cornerRadius : 5;
icon : Embed(source="assets/swf/v2_skin.swf", symbol="Icon_Trash");
}
@ -1066,12 +1064,7 @@ presentation|UploadedPresentationRenderer {
disabledIcon : Embed(source="assets/swf/v2_skin.swf", symbol="Icon_Go_Disabled");
}
.presentationNameLabelOver {
color : #FFFFFF;
fontSize : 14;
}
.presentationNameLabelUp {
.presentationNameLabel {
color : #05172A;
fontSize : 14;
}

View File

@ -29,7 +29,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
resizable="false"
showCloseButton="true"
implements="org.bigbluebutton.common.IBbbModuleWindow"
width="210" height="220" minWidth="0"
width="210" height="224" minWidth="0"
resize="onResize()">
<fx:Script>

View File

@ -24,8 +24,6 @@ package org.bigbluebutton.modules.present.events {
public static const PRESENTATION_ROLL_OUT:String = "PresentationRollOut";
public static const PRESENTATION_SELECT:String = "PresentationSelect";
public var presentationId:String;
public function PresentationRollEvent(type:String, p:String) {

View File

@ -341,14 +341,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
dispatcher.dispatchEvent(rollEvent);
}
protected function onItemClick(event:ListEvent):void
{
var item:IListItemRenderer = event.itemRenderer;
var presentation:Presentation = item.data as Presentation;
var rollEvent:PresentationRollEvent = new PresentationRollEvent(PresentationRollEvent.PRESENTATION_SELECT, presentation.id);
dispatcher.dispatchEvent(rollEvent);
}
]]>
</fx:Script>
@ -386,7 +378,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mx:Canvas width="100%" height="145" verticalScrollPolicy="off">
<mx:List height="142" left="5" top="5" right="5" bottom="5" id="uploadedFilesList" allowMultipleSelection="false"
itemRenderer="org.bigbluebutton.modules.present.ui.views.UploadedPresentationRenderer"
itemRollOver="onItemRollOver(event)" itemRollOut="onItemRollOut(event)" itemClick="onItemClick(event)"
itemRollOver="onItemRollOver(event)" itemRollOut="onItemRollOut(event)"
dragEnabled="false" dataProvider="{presentationNamesAC}">
</mx:List>
</mx:Canvas>

View File

@ -326,7 +326,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
private function setupPresenter(isPresenter:Boolean):void {
uploadPres.visible = isPresenter;
uploadPres.visible = isPresenter;
downloadPres.visible = !isPresenter;
var page:Page = PresentationModel.getInstance().getCurrentPage();
if (page != null) {
displaySlideNumber(page.num);
@ -719,7 +721,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
pollVoteBox.includeInLayout = true;
downloadPres.visible = false;
} else if (state == "presenter" && UsersUtil.amIPresenter()) {
downloadPres.visible = true;
downloadPres.visible = false;
pollStartBtn.visible = true;
presenterControls.visible = true;
presenterControls.includeInLayout = true;
@ -762,7 +764,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
var downloadablePresentations:ArrayCollection = PresentationModel.getInstance().getDownloadablePresentations();
if (presentOptions.enableDownload && downloadablePresentations.length > 0) {
if (presentOptions.enableDownload && downloadablePresentations.length > 0 && !UsersUtil.amIPresenter()) {
LOGGER.debug("Enabling download presentation button. There are {0} presentations available for downloading.", [downloadablePresentations.length]);
downloadPres.visible = true;
} else {

View File

@ -15,8 +15,6 @@
method="onRollOver" />
<mate:Listener type="{PresentationRollEvent.PRESENTATION_ROLL_OUT}"
method="onRollOut" />
<mate:Listener type="{PresentationRollEvent.PRESENTATION_SELECT}"
method="onSelect" />
</fx:Declarations>
<fx:Script>
@ -26,11 +24,13 @@
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.modules.present.commands.ChangePresentationCommand;
import org.bigbluebutton.modules.present.events.DownloadEvent;
import org.bigbluebutton.modules.present.events.PresentationRollEvent;
import org.bigbluebutton.modules.present.events.RemovePresentationEvent;
import org.bigbluebutton.modules.present.events.UploadEvent;
import org.bigbluebutton.util.i18n.ResourceUtil;
private static const LOGGER:ILogger = getClassLogger(UploadedPresentationRenderer);
private var globalDispatch:Dispatcher = new Dispatcher();
@ -38,10 +38,6 @@
[Bindable]
private var rolledOver:Boolean = false;
[Bindable]
private var selected:Boolean = false;
private function showPresentation():void {
var changePresCommand:ChangePresentationCommand = new ChangePresentationCommand(data.id);
globalDispatch.dispatchEvent(changePresCommand);
@ -69,33 +65,33 @@
rolledOver = false;
}
private function onSelect(e:PresentationRollEvent):void {
if (e.presentationId == data.id) {
selected = true;
} else {
selected = false;
}
private function downloadPresentation():void {
var downloadEvent:DownloadEvent = new DownloadEvent(DownloadEvent.DOWNLOAD_PRESENTATION);
downloadEvent.fileNameToDownload = data.id as String;
globalDispatch.dispatchEvent(downloadEvent);
}
]]>
</fx:Script>
<mx:Label id="presentationNameLabel"
width="{this.width-isDownloadable.width-showBtn.width-deleteBtn.width-30}"
text="{data.name as String}"
styleName="{rolledOver || selected ? 'presentationNameLabelOver' : 'presentationNameLabelUp'}" />
<mx:Image id="isDownloadable"
visible="{data.downloadable as Boolean}"
source="{rolledOver || selected ? getStyle('iconSaveWhite') : getStyle('iconSave')}"
toolTip="{ResourceUtil.getInstance().getString('bbb.filedownload.thisFileIsDownloadable')}"
verticalAlign="middle" />
width="{this.width-downloadButton.width-showBtn.width-deleteBtn.width-50}"
truncateToFit="true"
styleName="presentationNameLabel"
text="{data.name as String}" />
<mx:Button id="downloadButton"
height="32"
visible="{data.downloadable as Boolean}"
styleName="presentationUploadDownloadButtonStyle"
click="downloadPresentation()"
toolTip="{ResourceUtil.getInstance().getString('bbb.filedownload.thisFileIsDownloadable')}" />
<mx:Button id="showBtn"
height="32"
label="{ResourceUtil.getInstance().getString('bbb.fileupload.showBtn')}"
toolTip="{ResourceUtil.getInstance().getString('bbb.fileupload.showBtn.toolTip')}"
styleName="presentationUploadShowButtonStyle"
height="26"
click="showPresentation()"
enabled="{!data.current}" />
<mx:Button id="deleteBtn"
label=""
height="32"
toolTip="{ResourceUtil.getInstance().getString('bbb.fileupload.deleteBtn.toolTip')}"
styleName="presentationUploadDeleteButtonStyle"
click="deletePresentation()"