diff --git a/bigbluebutton-html5/imports/api/slides/server/methods/zoomSlide.js b/bigbluebutton-html5/imports/api/slides/server/methods/zoomSlide.js index c546a88af87a3abf577c76a23a9ee7111ab48091..54826f9056a8038b3b10eccfaa1cfb3ec4678090 100644 --- a/bigbluebutton-html5/imports/api/slides/server/methods/zoomSlide.js +++ b/bigbluebutton-html5/imports/api/slides/server/methods/zoomSlide.js @@ -4,7 +4,7 @@ import { Meteor } from 'meteor/meteor'; import { check } from 'meteor/check'; import RedisPubSub from '/imports/startup/server/redis'; -export default function switchSlide(credentials, slideNumber, podId, widthRatio, heightRatio, x, y) { +export default function zoomSlide(credentials, slideNumber, podId, widthRatio, heightRatio, x, y) { const REDIS_CONFIG = Meteor.settings.private.redis; const CHANNEL = REDIS_CONFIG.channels.toAkkaApps; diff --git a/bigbluebutton-html5/imports/ui/components/presentation/component.jsx b/bigbluebutton-html5/imports/ui/components/presentation/component.jsx index 38fa1e20a18c248266c70077cc244f21cd1cb0fc..c412e44201b2a4d68c51890523c91204e5739fe2 100644 --- a/bigbluebutton-html5/imports/ui/components/presentation/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/presentation/component.jsx @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import { TransitionGroup, CSSTransition } from 'react-transition-group'; import WhiteboardOverlayContainer from '/imports/ui/components/whiteboard/whiteboard-overlay/container'; import WhiteboardToolbarContainer from '/imports/ui/components/whiteboard/whiteboard-toolbar/container'; +import { HUNDRED_PERCENT, MAX_PERCENT } from '/imports/utils/slideCalcUtils'; import CursorWrapperContainer from './cursor/cursor-wrapper-container/container'; import AnnotationGroupContainer from '../whiteboard/annotation-group/container'; import PresentationToolbarContainer from './presentation-toolbar/container'; @@ -10,9 +11,6 @@ import PresentationOverlayContainer from './presentation-overlay/container'; import Slide from './slide/component'; import { styles } from './styles.scss'; -const HUNDRED_PERCENT = 100; -const MAX_PERCENT = 400; - export default class PresentationArea extends Component { constructor() { super(); diff --git a/bigbluebutton-html5/imports/ui/components/presentation/presentation-overlay/component.jsx b/bigbluebutton-html5/imports/ui/components/presentation/presentation-overlay/component.jsx index 0b78549aad24a7f7d0375fc51a5d75662b5f1c75..492d446c53251e1fbb6f77391470174d2fdffa30 100755 --- a/bigbluebutton-html5/imports/ui/components/presentation/presentation-overlay/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/presentation/presentation-overlay/component.jsx @@ -1,13 +1,11 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import SlideCalcUtil from '/imports/utils/slideCalcUtils'; +import SlideCalcUtil, { HUNDRED_PERCENT, MAX_PERCENT, MYSTERY_NUM, STEP } from '/imports/utils/slideCalcUtils'; // After lots of trial and error on why synching doesn't work properly, I found I had to // multiply the coordinates by 2. There's something I don't understand probably on the // canvas coordinate system. (ralam feb 22, 2012) -const MYSTERY_NUM = 2; + const CURSOR_INTERVAL = 16; -const HUNDRED_PERCENT = 100; -const MAX_PERCENT = 400; export default class PresentationOverlay extends Component { constructor(props) { @@ -338,10 +336,10 @@ export default class PresentationOverlay extends Component { let newZoom = zoom; if (e.deltaY < 0) { - newZoom += 5; + newZoom += STEP; } if (e.deltaY > 0) { - newZoom -= 5; + newZoom -= STEP; } if (newZoom <= HUNDRED_PERCENT) { newZoom = HUNDRED_PERCENT; diff --git a/bigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/component.jsx b/bigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/component.jsx index e0eae079190897c60771a179262b83ff847ca075..123b2fda29413bd9f3caf5bb893863c9c2c1ce19 100644 --- a/bigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/component.jsx @@ -4,12 +4,10 @@ import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import browser from 'browser-detect'; import injectWbResizeEvent from '/imports/ui/components/presentation/resize-wrapper/component'; import Button from '/imports/ui/components/button/component'; +import { HUNDRED_PERCENT, MAX_PERCENT, STEP } from '/imports/utils/slideCalcUtils'; import { styles } from './styles.scss'; import ZoomTool from './zoom-tool/component'; -const STEP = 5; -const HUNDRED_PERCENT = 100; -const MAX_PERCENT = 400; const intlMessages = defineMessages({ previousSlideLabel: { @@ -242,8 +240,8 @@ class PresentationToolbar extends Component { } { !isMobileBrowser ? - <span className={styles.zoomWrapper}> - <ZoomTool + <span className={styles.zoomWrapper}> + <ZoomTool value={zoom} change={this.change} minBound={HUNDRED_PERCENT} diff --git a/bigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/service.js b/bigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/service.js index a9c98a1c1ea011ea430ce08fc74f1b263a258208..6fade29e30d47e6014e8df0011bd18ff4a4d3852 100644 --- a/bigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/service.js +++ b/bigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/service.js @@ -6,15 +6,6 @@ import { makeCall } from '/imports/ui/services/api'; const getSlideData = (podId, presentationId) => { // Get meetingId and userId const meetingId = Auth.meetingID; - const userId = Auth.userID; - - // fetching the presentation pod in order to see who owns it - const selector = { - meetingId, - podId, - }; - const pod = PresentationPods.findOne(selector); - const userIsPresenter = pod.currentPresenterId === userId; // Get total number of slides in this presentation const numberOfSlides = Slides.find({ diff --git a/bigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/zoom-tool/component.jsx b/bigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/zoom-tool/component.jsx index 4a936a15e58aeebf9b88e248cfec0d2d87d08b8e..bccaba920aa0ad1ebe350db6f5c177d57dba5a85 100644 --- a/bigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/zoom-tool/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/zoom-tool/component.jsx @@ -12,42 +12,39 @@ export default class ZoomTool extends Component { static renderAriaLabelsDescs() { return ( <div hidden key="hidden-div"> - {/* Zoom in button aria */} <div id="zoomInLabel"> <FormattedMessage id="app.presentation.presentationToolbar.zoomInLabel" - description="Aria label for when switching to previous slide" - defaultMessage="Previous slide" + description="Aria label for increment zoom level" + defaultMessage="Increment zoom" /> </div> <div id="zoomInDesc"> <FormattedMessage id="app.presentation.presentationToolbar.zoomInDesc" - description="Aria description for when switching to previous slide" - defaultMessage="Change the presentation to the previous slide" + description="Aria description for increment zoom level" + defaultMessage="Increment zoom" /> </div> - {/* Zoom out button aria */} <div id="zoomOutLabel"> <FormattedMessage id="app.presentation.presentationToolbar.zoomOutLabel" - description="Aria label for when switching to next slide" - defaultMessage="Next slide" + description="Aria label for decrement zoom level" + defaultMessage="Decrement zoom" /> </div> <div id="zoomOutDesc"> <FormattedMessage id="app.presentation.presentationToolbar.zoomOutDesc" - description="Aria description for when switching to next slide" - defaultMessage="Change the presentation to the next slide" + description="Aria description for decrement zoom level" + defaultMessage="Decrement zoom" /> </div> - {/* Zoom indicator aria */} <div id="zoomIndicator"> <FormattedMessage id="app.presentation.presentationToolbar.zoomIndicator" - description="Aria label for when switching to a specific slide" - defaultMessage="Skip slide" + description="Aria label for current zoom level" + defaultMessage="Current zoom level" /> </div> </div> @@ -160,8 +157,8 @@ export default class ZoomTool extends Component { > <Button key="zoom-tool-1" - aria-labelledby="zoomInLabel" - aria-describedby="zoomInDesc" + aria-labelledby="zoomOutLabel" + aria-describedby="zoomOutDesc" role="button" label="-" icon="minus" @@ -175,7 +172,7 @@ export default class ZoomTool extends Component { ( <span key="zoom-tool-2" - aria-labelledby="prevSlideLabel" + aria-labelledby="zoomIndicator" aria-describedby={this.state.value} className={styles.zoomPercentageDisplay} > @@ -191,8 +188,8 @@ export default class ZoomTool extends Component { > <Button key="zoom-tool-3" - aria-labelledby="zoomOutLabel" - aria-describedby="zoomOutDesc" + aria-labelledby="zoomInLabel" + aria-describedby="zoomInDesc" role="button" label="+" icon="plus" diff --git a/bigbluebutton-html5/imports/utils/slideCalcUtils.js b/bigbluebutton-html5/imports/utils/slideCalcUtils.js index b136f8c1dbda839878e5e09c20377574754a83c8..153e55f498b69aad09229bf73a4d8ce8bb2a8280 100644 --- a/bigbluebutton-html5/imports/utils/slideCalcUtils.js +++ b/bigbluebutton-html5/imports/utils/slideCalcUtils.js @@ -1,5 +1,8 @@ -const HUNDRED_PERCENT = 100; -const MYSTERY_NUM = 2; +export const HUNDRED_PERCENT = 100; +export const MAX_PERCENT = 400; +export const MYSTERY_NUM = 2; +export const STEP = 25; + export default class SlideCalcUtil { // After lots of trial and error on why synching doesn't work properly, I found I had to // multiply the coordinates by 2. There's something I don't understand probably on the