Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
… into redis-pubsub-keepalive
  • Loading branch information
ritzalam committed Aug 21, 2015
2 parents 46ba98f + c70dcfe commit 39baece
Show file tree
Hide file tree
Showing 27 changed files with 875 additions and 96 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,11 @@ trait PollApp {
// Hardcode poll result display location for now to display result
// in bottom-right corner.
val display = new ArrayList[Double]()
val shapeHeight = 6.66 * answers.size
display.add(66.0)
display.add(60.0)
display.add(100 - shapeHeight)
display.add(34.0)
display.add(40.0)
display.add(shapeHeight)

shape += "points" -> display
shape.toMap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -877,4 +877,10 @@ Alert {
.statusTimeStyle {
fontSize: 10;
paddingTop: 0;
}

PollChoicesModal {
fontSize: 14;
paddingLeft: 16;
paddingRight: 16;
}
2 changes: 2 additions & 0 deletions bigbluebutton-client/locale/en_US/bbbResources.properties
Original file line number Diff line number Diff line change
Expand Up @@ -499,9 +499,11 @@ bbb.shortcutkey.chat.chatbox.debug = 71
bbb.shortcutkey.chat.chatbox.debug.function = Temporary debug hotkey
bbb.polling.startButton.tooltip = Start a poll
bbb.polling.startButton.label = Start Poll
bbb.polling.publishButton.label = Publish
bbb.polling.closeButton.label = Close
bbb.polling.pollModal.title = Live Poll Results
bbb.polling.customChoices.title = Enter Polling Choices
bbb.polling.respondersLabel.novotes = Waiting for responses
bbb.polling.respondersLabel.text = {0} Users Responded
bbb.polling.respondersLabel.finished = Done
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
Copyright (c) 2015 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/>.
-->
<mx:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
width="350" layout="vertical"
show="{focusManager.setFocus(choiceFirst)}">
<fx:Script>
<![CDATA[
import com.asfusion.mate.events.Dispatcher;
import mx.managers.PopUpManager;
import org.as3commons.lang.ArrayUtils;
import org.as3commons.lang.StringUtils;
import org.bigbluebutton.modules.polling.events.StartCustomPollEvent;
import org.bigbluebutton.modules.present.ui.views.PresentationWindow;
import org.bigbluebutton.util.i18n.ResourceUtil;
private var _presentationWindow : PresentationWindow;
public function setPresentationWindow(window:PresentationWindow):void {
_presentationWindow = window;
}
protected function publishButton_clickHandler(event:MouseEvent):void {
var answers : Array = buildAnswsers();
if (ArrayUtils.isNotEmpty(answers)) {
_presentationWindow.slideView.onZoomSlide(100);
var dispatcher:Dispatcher = new Dispatcher();
dispatchEvent(new StartCustomPollEvent("Custom", answers));
PopUpManager.removePopUp(this);
}
}
private function buildAnswsers():Array {
var result : Array = [];
for each( var choice : String in [choiceFirst.text, choiceSecond.text, choiceThird.text, choiceFourth.text, choiceFifth.text, choiceSixth.text]) {
if(!StringUtils.isBlank(StringUtils.trim(choice))) {
result.push(StringUtils.trim(choice));
}
}
return result;
}
]]>
</fx:Script>

<mx:Label id="modalTitle" styleName="micSettingsWindowTitleStyle"
text="{ResourceUtil.getInstance().getString('bbb.polling.customChoices.title')}" width="100%"/>

<mx:HRule width="100%"/>

<mx:VBox width="100%" paddingTop="20" paddingBottom="20" paddingLeft="16" paddingRight="16">
<mx:TextInput id="choiceFirst" width="100%"/>
<mx:TextInput id="choiceSecond" width="100%"/>
<mx:TextInput id="choiceThird" width="100%"/>
<mx:TextInput id="choiceFourth" width="100%"/>
<mx:TextInput id="choiceFifth" width="100%"/>
<mx:TextInput id="choiceSixth" width="100%"/>
</mx:VBox>

<mx:HRule width="100%"/>

<mx:HBox width="100%" horizontalGap="10" horizontalAlign="right">
<mx:Button id="publishButton" click="publishButton_clickHandler(event)"
label="{ResourceUtil.getInstance().getString('bbb.polling.startButton.label')}"/>
<mx:Button id="closeButton" click="PopUpManager.removePopUp(this)"
label="{ResourceUtil.getInstance().getString('bbb.polling.closeButton.label')}"/>
</mx:HBox>

</mx:TitleWindow>
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ package org.bigbluebutton.modules.polling.views
//private const h:uint = 100;
//private const w:uint = 280;
private const bgFill:uint = 0xFFFFFF;
private const colFill:uint = 0x000000;
private const colFill:uint = 0x333333;
private const vPaddingPercent:Number = 0.25;
private const hPaddingPercent:Number = 0.1;
private const labelWidthPercent:Number = 0.3;
private const labelMaxWidthInPixels:int = 40;
private const labelMaxWidthInPixels:int = 100;

private var sampledata:Array = [{a:"A", v:3},
{a:"B", v:1},
Expand Down Expand Up @@ -89,7 +89,7 @@ package org.bigbluebutton.modules.polling.views
graphics.clear();

if (_data != null && _data.length > 0) {
graphics.lineStyle(2);
graphics.lineStyle(2, colFill);
graphics.beginFill(bgFill, 1.0);
graphics.drawRect(sx, sy, unscaledWidth, unscaledHeight);
graphics.endFill();
Expand Down Expand Up @@ -117,12 +117,13 @@ package org.bigbluebutton.modules.polling.views
var percentText:TextField;
var answerArray:Array = new Array();
var percentArray:Array = new Array();
var minFontSize:int = 20;
var minFontSize:int = 30;
var currFontSize:int;

var startingLabelWidth:Number = Math.min(labelWidthPercent*unscaledWidth, labelMaxWidthInPixels);
//var startingLabelWidth:Number = Math.min(labelWidthPercent*unscaledWidth, labelMaxWidthInPixels);
var startingLabelWidth:Number = labelWidthPercent*unscaledWidth;

graphics.lineStyle(2);
graphics.lineStyle(2, colFill);
graphics.beginFill(colFill, 1.0);
for (var j:int=0, vp:int=extraVPixels, ry:int=0, curRowHeight:int=0; j<_data.length; j++) {
ry += Math.round(curRowHeight/2)+vpadding; // add the last row's height plus padding
Expand All @@ -143,7 +144,7 @@ package org.bigbluebutton.modules.polling.views
answerText.selectable = false;
//addChild(answerText);
answerArray.push(answerText);
currFontSize = findFontSize(answerText, 20);
currFontSize = findFontSize(answerText, minFontSize);
if (currFontSize < minFontSize) minFontSize = currFontSize;
//rowText.height = rowText.textHeight;
answerText.x = hpadding;
Expand All @@ -158,7 +159,7 @@ package org.bigbluebutton.modules.polling.views
percentText.selectable = false;
//addChild(percentText);
percentArray.push(percentText);
currFontSize = findFontSize(percentText, 20);
currFontSize = findFontSize(percentText, minFontSize);
if (currFontSize < minFontSize) minFontSize = currFontSize;
//percentText.height = percentText.textHeight;
//percentText.x = unscaledWidth-percentStartWidth/2-percentText.width/2;
Expand Down Expand Up @@ -219,16 +220,21 @@ package org.bigbluebutton.modules.polling.views
// add vote count in middle of rect
countText = _textFields[currTFIdx++]; // new TextField();
countText.text = _data[j].v;
countText.width = rectWidth;
countText.width = startingLabelWidth;
countText.height = curRowHeight;
countText.textColor = 0xFFFFFF;
countText.selectable = false;
//addChild(countText);
findFontSize(countText, minFontSize);
countText.width = countText.textWidth+4;
countText.height = countText.textHeight+4;
countText.x = barStartX+rectWidth/2-countText.width/2;
countText.y = ry-countText.height/2;
if (countText.width > rectWidth) {
countText.x = barStartX + rectWidth + hpadding/2;
countText.textColor = colFill;
} else {
countText.x = barStartX + rectWidth/2 - countText.width/2;
countText.textColor = bgFill;
}
}

graphics.endFill();
Expand Down
Loading

0 comments on commit 39baece

Please sign in to comment.