diff --git a/bigbluebutton-html5/imports/api/captions/server/modifiers/updateCaptionsCollection.js b/bigbluebutton-html5/imports/api/captions/server/modifiers/updateCaptionsCollection.js index c351d55ce9daf9647c4c933c21442933cbd41d45..a05a5dff28002acf9debd90a7b37c9c5e34ca0d1 100755 --- a/bigbluebutton-html5/imports/api/captions/server/modifiers/updateCaptionsCollection.js +++ b/bigbluebutton-html5/imports/api/captions/server/modifiers/updateCaptionsCollection.js @@ -20,27 +20,40 @@ export function updateCaptionsCollection(meetingId, locale, payload) { let length = 0; let current = captionsObjects[0]; - //looking for a start index and end index (in case if they are in the same block) + //looking for a start index and end index + //(end index only for the case when they are in the same block) while (current != null) { length += current.captionHistory.captions.length; + + //if length is bigger than start index - we found our start index if (length >= payload.start_index && startIndex == undefined) { - //checking if it's a new character somewhere in the middle of captions + //check if it's a new character somewhere in the middle of captions text if (length - 1 >= payload.start_index) { startIndex = payload.start_index - (length - current.captionHistory.captions.length); + + //check to see if the end_index is in the same object as start_index if (length - 1 >= payload.end_index) { endIndex = payload.end_index - (length - current.captionHistory.captions.length); let _captions = current.captionHistory.captions; - current.captionHistory.captions = _captions.slice(0, startIndex) + payload.text + _captions.slice(endIndex); + current.captionHistory.captions = _captions.slice(0, startIndex) + + payload.text + + _captions.slice(endIndex); objectsToUpdate.push(current); break; + + //end index is not in the same object as start_index, we will find it later } else { - current.captionHistory.captions = current.captionHistory.captions.slice(0, startIndex) + payload.text; + current.captionHistory.captions = current.captionHistory.captions.slice(0, startIndex) + + payload.text; objectsToUpdate.push(current); break; } - //separate case for appending new characters - } else if (current.captionHistory.next == null && length == payload.start_index && length == payload.start_index) { + //separate case for appending new characters to the very end of the string + } else if (current.captionHistory.next == null && + length == payload.start_index && + length == payload.start_index) { + startIndex = 1; endIndex = 1; current.captionHistory.captions += payload.text; @@ -56,6 +69,8 @@ export function updateCaptionsCollection(meetingId, locale, payload) { current = captionsObjects[current.captionHistory.next]; while (current != null) { length += current.captionHistory.captions.length; + + //check to see if the end_index is in the current object if (length - 1 >= payload.end_index) { endIndex = payload.end_index - (length - current.captionHistory.captions.length); @@ -63,6 +78,9 @@ export function updateCaptionsCollection(meetingId, locale, payload) { objectsToUpdate.push(current); break; + + //if end_index wasn't in the current object, that means this whole object was deleted + //initializing string to '' } else { current.captionHistory.captions = ''; objectsToUpdate.push(current); @@ -72,35 +90,47 @@ export function updateCaptionsCollection(meetingId, locale, payload) { } } + //looking for the strings which exceed the limit and split them into multiple objects let maxIndex = captionsObjects.length - 1; - for (i = 0; i < objectsToUpdate.length; i++) { if (objectsToUpdate[i].captionHistory.captions.length > 100) { - //string is too large. Check if there is a next object and if it can + //string is too large. Check if the next object exists and if it can //accomodate the part of the string that exceeds the limits - if (objectsToUpdate[i].captionHistory.next != null && - captionsObjects[objectsToUpdate[i].captionHistory.next].captionHistory.captions.length < 100) { + let _nextIndex = objectsToUpdate[i].captionHistory.next; + if (_nextIndex != null && + captionsObjects[_nextIndex].captionHistory.captions.length < 100) { let extraString = objectsToUpdate[i].captionHistory.captions.slice(100); - objectsToUpdate[i].captionHistory.captions = objectsToUpdate[i].captionHistory.captions.slice(0, 100); + + //could assign it directly, but our linter complained + let _captions = objectsToUpdate[i].captionHistory.captions; + _captions = _captions.slice(0, 100); + objectsToUpdate[i].captionHistory.captions = _captions; + + //check to see if the next object was added to objectsToUpdate array if (objectsToUpdate[i + 1] != null && objectsToUpdate[i].captionHistory.next == objectsToUpdate[i + 1].captionHistory.index) { - objectsToUpdate[i + 1].captionHistory.captions = extraString + objectsToUpdate[i + 1].captionHistory.captions; + objectsToUpdate[i + 1].captionHistory.captions = extraString + + objectsToUpdate[i + 1].captionHistory.captions; + + //next object wasn't added to objectsToUpdate array, adding it from captionsObjects array. } else { let nextObj = captionsObjects[objectsToUpdate[i].captionHistory.next]; nextObj.captionHistory.captions = extraString + nextObj.captionHistory.captions; objectsToUpdate.push(nextObj); } - //next object was full already, so we create one ant insert it in between them + //next object was full already, so we create another and insert it in between them } else { - let tempObject = objectsToUpdate.splice(i, 1); - let extraString = tempObject[0].captionHistory.captions.slice(100); - tempObject[0].captionHistory.captions = tempObject[0].captionHistory.captions.slice(0, 100); + //need to take a current object out of the objectsToUpdate and add it back after + //every other object, so that Captions collection could be updated in a proper order + let tempObj = objectsToUpdate.splice(i, 1); + let extraString = tempObj[0].captionHistory.captions.slice(100); + tempObj[0].captionHistory.captions = tempObj[0].captionHistory.captions.slice(0, 100); maxIndex += 1; - let tempIndex = tempObject[0].captionHistory.next; - tempObject[0].captionHistory.next = maxIndex; + let tempIndex = tempObj[0].captionHistory.next; + tempObj[0].captionHistory.next = maxIndex; while (extraString.length != 0) { let entry = { @@ -108,7 +138,7 @@ export function updateCaptionsCollection(meetingId, locale, payload) { locale: locale, captionHistory: { locale: locale, - ownerId: tempObject[0].captionHistory.ownerId, + ownerId: tempObj[0].captionHistory.ownerId, captions: extraString.slice(0, 100), index: maxIndex, next: null, @@ -125,12 +155,13 @@ export function updateCaptionsCollection(meetingId, locale, payload) { objectsToUpdate.push(entry); } - objectsToUpdate.push(tempObject[0]); + objectsToUpdate.push(tempObj[0]); } } } } + //updating the database for (i = 0; i < objectsToUpdate.length; i++) { Captions.upsert( { diff --git a/bigbluebutton-html5/imports/api/slides/server/modifiers/addSlideToCollection.js b/bigbluebutton-html5/imports/api/slides/server/modifiers/addSlideToCollection.js index 8d91b41ce3443b0faf4f923e846ffa3f4134fe5f..149add0ae940ad8965cab050b15cbf283cc7240e 100755 --- a/bigbluebutton-html5/imports/api/slides/server/modifiers/addSlideToCollection.js +++ b/bigbluebutton-html5/imports/api/slides/server/modifiers/addSlideToCollection.js @@ -15,38 +15,38 @@ export function addSlideToCollection(meetingId, presentationId, slideObject) { let addSlideHelper = function (response) { let contentType = response.headers['content-type']; - if (contentType.match(/svg/gi) || contentType.match(/png/gi)) { - let chunks = []; - response.on('data', Meteor.bindEnvironment(function (chunk) { - chunks.push(chunk); - })).on('end', Meteor.bindEnvironment(function () { - let buffer = Buffer.concat(chunks); - const dimensions = sizeOf(buffer); - const entry = { - meetingId: meetingId, - presentationId: presentationId, - slide: { - height_ratio: slideObject.height_ratio, - y_offset: slideObject.y_offset, - num: slideObject.num, - x_offset: slideObject.x_offset, - current: slideObject.current, - img_uri: slideObject.svg_uri != null ? slideObject.svg_uri : slideObject.png_uri, - txt_uri: slideObject.txt_uri, - id: slideObject.id, - width_ratio: slideObject.width_ratio, - swf_uri: slideObject.swf_uri, - thumb_uri: slideObject.thumb_uri, - width: dimensions.width, - height: dimensions.height, - }, - }; - Slides.insert(entry); - })); - } else { - console.log(`Slide file is not accessible or not ready yet`); - console.log(`response content-type`, response.headers['content-type']); - } + if (contentType.match(/svg/gi) || contentType.match(/png/gi)) { + let chunks = []; + response.on('data', Meteor.bindEnvironment(function (chunk) { + chunks.push(chunk); + })).on('end', Meteor.bindEnvironment(function () { + let buffer = Buffer.concat(chunks); + const dimensions = sizeOf(buffer); + const entry = { + meetingId: meetingId, + presentationId: presentationId, + slide: { + height_ratio: slideObject.height_ratio, + y_offset: slideObject.y_offset, + num: slideObject.num, + x_offset: slideObject.x_offset, + current: slideObject.current, + img_uri: slideObject.svg_uri != null ? slideObject.svg_uri : slideObject.png_uri, + txt_uri: slideObject.txt_uri, + id: slideObject.id, + width_ratio: slideObject.width_ratio, + swf_uri: slideObject.swf_uri, + thumb_uri: slideObject.thumb_uri, + width: dimensions.width, + height: dimensions.height, + }, + }; + Slides.insert(entry); + })); + } else { + console.log(`Slide file is not accessible or not ready yet`); + console.log(`response content-type`, response.headers['content-type']); + } }; // HTTPS connection diff --git a/bigbluebutton-html5/imports/startup/server/index.js b/bigbluebutton-html5/imports/startup/server/index.js old mode 100644 new mode 100755 index 06ebbbb497f6bba5434b0343df38479a65f5ac91..35329899ef9c984707e46efd85f3a4b666680c12 --- a/bigbluebutton-html5/imports/startup/server/index.js +++ b/bigbluebutton-html5/imports/startup/server/index.js @@ -7,13 +7,15 @@ import { clientConfig } from '/config'; Meteor.startup(function () { clearCollections(); - let determineConnectionType = function() { + let determineConnectionType = function () { let baseConnection = 'HTTP'; - if(clientConfig.app.httpsConnection) { + if (clientConfig.app.httpsConnection) { baseConnection += ('S'); } + return baseConnection; }; + logger.info(`server start. Connection type:${determineConnectionType()}`); }); diff --git a/bigbluebutton-html5/imports/ui/components/actions-bar/component.jsx b/bigbluebutton-html5/imports/ui/components/actions-bar/component.jsx old mode 100644 new mode 100755 index 9089fd5358b5d2b29de612880559c7415ecaee11..6ce573d9050e7f22dcdefb2387fd324f4e0bc77d --- a/bigbluebutton-html5/imports/ui/components/actions-bar/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/actions-bar/component.jsx @@ -10,6 +10,7 @@ export default class ActionsBar extends Component { handleClick() { } + render() { return ( <div className={styles.actionsbar}> diff --git a/bigbluebutton-html5/imports/ui/components/app/container.jsx b/bigbluebutton-html5/imports/ui/components/app/container.jsx index f48f8a9e3d128f8380cea949213d3ad836db5bb1..de8433292e21a6c7bda525bf18199b11e66eebe3 100755 --- a/bigbluebutton-html5/imports/ui/components/app/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/app/container.jsx @@ -13,7 +13,9 @@ const defaultProps = { actionsbar: <ActionsBarContainer />, media: <MediaContainer />, settings: <SettingsModal />, - captions: <ClosedCaptionsContainer />, + + //CCs UI is commented till the next pull request + //captions: <ClosedCaptionsContainer />, }; class AppContainer extends Component { diff --git a/bigbluebutton-html5/imports/ui/components/chat/message-list/component.jsx b/bigbluebutton-html5/imports/ui/components/chat/message-list/component.jsx old mode 100644 new mode 100755 index c48c552bb28869620eadda626ba4133faab89f8a..c7f9288bee969449251eafd9be7b0121fba14f7a --- a/bigbluebutton-html5/imports/ui/components/chat/message-list/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/chat/message-list/component.jsx @@ -77,7 +77,9 @@ class MessageList extends Component { } const { scrollArea } = this.refs; - this.shouldScrollBottom = scrollArea.scrollTop + scrollArea.offsetHeight === scrollArea.scrollHeight; + this.shouldScrollBottom = scrollArea.scrollTop + + scrollArea.offsetHeight === + scrollArea.scrollHeight; const d = document; const isDocumentHidden = d.hidden || d.mozHidden || d.msHidden || d.webkitHidden; diff --git a/bigbluebutton-html5/imports/ui/components/chat/message-list/message-list-item/message/component.jsx b/bigbluebutton-html5/imports/ui/components/chat/message-list/message-list-item/message/component.jsx old mode 100644 new mode 100755 index 9eaee53e8da9857f8e6056114fb24727dbbd81db..6b866420a6068d110a5ddc9867e64743846f233d --- a/bigbluebutton-html5/imports/ui/components/chat/message-list/message-list-item/message/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/chat/message-list/message-list-item/message/component.jsx @@ -44,7 +44,9 @@ export default class MessageListItem extends Component { if (isElementInViewport(node)) { this.props.handleReadMessage(this.props.time); - eventsToBeBound.forEach(e => scrollArea.removeEventListener(e, this.handleMessageInViewport)); + eventsToBeBound.forEach( + e => scrollArea.removeEventListener(e, this.handleMessageInViewport) + ); } this.ticking = false; @@ -65,7 +67,9 @@ export default class MessageListItem extends Component { this.props.handleReadMessage(this.props.time); } else { const scrollArea = document.getElementById(this.props.chatAreaId); - eventsToBeBound.forEach(e => scrollArea.addEventListener(e, this.handleMessageInViewport, false)); + eventsToBeBound.forEach( + e => scrollArea.addEventListener(e, this.handleMessageInViewport, false) + ); } } @@ -75,7 +79,9 @@ export default class MessageListItem extends Component { } const scrollArea = document.getElementById(this.props.chatAreaId); - eventsToBeBound.forEach(e => scrollArea.removeEventListener(e, this.handleMessageInViewport, false)); + eventsToBeBound.forEach( + e => scrollArea.removeEventListener(e, this.handleMessageInViewport, false) + ); } render() { diff --git a/bigbluebutton-html5/imports/ui/components/closed-captions/component.jsx b/bigbluebutton-html5/imports/ui/components/closed-captions/component.jsx index 0bc984024f6e4df768d6a9d269a1e85ec19e6ab2..3741109579a97c4f6ee9fdf4203068254c485df8 100755 --- a/bigbluebutton-html5/imports/ui/components/closed-captions/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/closed-captions/component.jsx @@ -18,7 +18,6 @@ export default class ClosedCaptions extends React.Component { } render() { - console.log(this.props.captions); return ( <div disabled className={styles.ccbox}> {this.props.captions.English ? this.props.captions.English.captions.map((caption) => ( diff --git a/bigbluebutton-html5/imports/ui/components/notifications-bar/styles.scss b/bigbluebutton-html5/imports/ui/components/notifications-bar/styles.scss old mode 100644 new mode 100755 index 75c140e73313668290da109b4cd092b6b2d4b20a..70d7f7071ac0dde82e11524ebc7ca6e47766993a --- a/bigbluebutton-html5/imports/ui/components/notifications-bar/styles.scss +++ b/bigbluebutton-html5/imports/ui/components/notifications-bar/styles.scss @@ -1,4 +1,4 @@ -@import "imports/ui/stylesheets/variables/_all"; +@import "../../stylesheets/variables/_all"; $nb-default-color: $color-gray; $nb-default-bg: $color-white; diff --git a/bigbluebutton-html5/imports/ui/components/user-avatar/component.jsx b/bigbluebutton-html5/imports/ui/components/user-avatar/component.jsx old mode 100644 new mode 100755 index 7b5c14dadf8e5a415be848d57bc38137764eb303..b108becf15fdbcc463c56ad15ad8bab03012e374 --- a/bigbluebutton-html5/imports/ui/components/user-avatar/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/user-avatar/component.jsx @@ -20,11 +20,11 @@ const defaultProps = { export default class UserAvatar extends Component { render() { const { - user + user, } = this.props; let avatarStyles = { - 'backgroundColor': getColor(user.name), + backgroundColor: getColor(user.name), }; return ( @@ -43,8 +43,8 @@ export default class UserAvatar extends Component { let content = user.name.slice(0, 2); - if (user.emoji.status !== "none") { - content = <Icon iconName={user.emoji.status}/> + if (user.emoji.status !== 'none') { + content = <Icon iconName={user.emoji.status}/>; } return content; diff --git a/bigbluebutton-html5/imports/ui/components/whiteboard/slide-controls/styles.scss b/bigbluebutton-html5/imports/ui/components/whiteboard/slide-controls/styles.scss index 2ce4128f80b65919deb72bdd4b821384d5a53b23..f5777c2ccde652f4d6466830230ddec678778923 100755 --- a/bigbluebutton-html5/imports/ui/components/whiteboard/slide-controls/styles.scss +++ b/bigbluebutton-html5/imports/ui/components/whiteboard/slide-controls/styles.scss @@ -1,5 +1,5 @@ -@import "imports/ui/components/button/styles.scss"; -@import "imports/ui/stylesheets/variables/_all"; +@import "../../button/styles.scss"; +@import "../../../stylesheets/variables/_all"; $controls-color: #212121 !default; $controls-background: #F0F2F6 !default; diff --git a/bigbluebutton-html5/package.json b/bigbluebutton-html5/package.json index 02f060ace620e465b2451bc70f80d2a79cc2a953..5a1f3f21995625c2c5c34092cf8abcf5bc2e394f 100755 --- a/bigbluebutton-html5/package.json +++ b/bigbluebutton-html5/package.json @@ -12,18 +12,18 @@ "classnames": "^2.2.3", "grunt-cli": "~1.2.0", "hiredis": "^0.5.0", - "history": "^2.1.1", + "history": "^2.1.2", "image-size": "~0.5.0", "meteor-node-stubs": "^0.2.3", "node-sass": "^3.8.0", - "react": "~15.2.1", - "react-addons-css-transition-group": "~15.2.1", - "react-addons-pure-render-mixin": "~15.2.1", - "react-autosize-textarea": "~0.3.1", - "react-dom": "~15.2.1", + "react": "~15.3.1", + "react-addons-css-transition-group": "~15.3.1", + "react-addons-pure-render-mixin": "~15.3.1", + "react-autosize-textarea": "~0.3.2", + "react-dom": "~15.3.1", "react-intl": "~2.1.3", "react-modal": "~1.4.0", - "react-router": "~2.5.2", + "react-router": "~2.7.0", "redis": "^2.6.2", "underscore": "~1.8.3" },