diff --git a/bigbluebutton-html5/Gruntfile.js b/bigbluebutton-html5/Gruntfile.js
index 97d77c742a..4ba47feb5e 100755
--- a/bigbluebutton-html5/Gruntfile.js
+++ b/bigbluebutton-html5/Gruntfile.js
@@ -14,7 +14,7 @@ module.exports = function (grunt) {
tasks: ['force:jscs:check'],
options: {
event: ['all'],
- spawn: true
+ spawn: true,
},
},
},
@@ -28,7 +28,7 @@ module.exports = function (grunt) {
esnext: true,
},
},
- fix: {
+ autofix: {
src: ['**/*.js', '**/*.jsx'],
options: {
config: '.jscsrc',
@@ -51,13 +51,11 @@ module.exports = function (grunt) {
limit: 3,
},
meteor_watch: {
- tasks: ['shell:start_meteor', 'watch']
+ tasks: ['shell:start_meteor', 'watch'],
},
- }
+ },
});
- grunt.loadNpmTasks('grunt-contrib-jshint');
- grunt.loadNpmTasks('grunt-coffeelint');
grunt.loadNpmTasks('grunt-jscs');
grunt.loadNpmTasks('grunt-force-task');
grunt.loadNpmTasks('grunt-contrib-watch');
diff --git a/bigbluebutton-html5/client/MainContainer.jsx b/bigbluebutton-html5/client/MainContainer.jsx
index 3f627d2c95..bd2d3ac9cb 100755
--- a/bigbluebutton-html5/client/MainContainer.jsx
+++ b/bigbluebutton-html5/client/MainContainer.jsx
@@ -5,20 +5,21 @@ import {Chat} from '/imports/ui/chat/Chat.jsx';
MainContainer = React.createClass({
handleShield() {
- $(".tooltip").hide();
+ $('.tooltip').hide();
toggleShield();
return closeMenus();
},
+
render() {
return (
-
-
-
+
);
- }
+ },
});
diff --git a/bigbluebutton-html5/client/globals.js b/bigbluebutton-html5/client/globals.js
index 29eca7f824..7ddded1d08 100755
--- a/bigbluebutton-html5/client/globals.js
+++ b/bigbluebutton-html5/client/globals.js
@@ -119,7 +119,6 @@ Handlebars.registerHelper('isCurrentUser', userId => {
return userId === null || userId === ((ref = BBB.getCurrentUser()) != null ? ref.userId : void 0);
});
-
//Retreives a username for a private chat tab from the database if it exists
Handlebars.registerHelper('privateChatName', () => {
let obj, ref;
@@ -139,7 +138,7 @@ Handlebars.registerHelper('isCurrentUserSharingVideo', () => {
return BBB.amISharingVideo();
});
-Handlebars.registerHelper("isCurrentUserPresenter", () => {
+Handlebars.registerHelper('isCurrentUserPresenter', () => {
return BBB.isUserPresenter(getInSession('userId'));
});
@@ -194,7 +193,7 @@ Handlebars.registerHelper('messageFontSize', () => {
});
//#TODO REMOVE
-Handlebars.registerHelper("pointerLocation", () => {
+Handlebars.registerHelper('pointerLocation', () => {
let currentPresentation, currentSlideDoc, pointer, presentationId, ref;
currentPresentation = Meteor.Presentations.findOne({
'presentation.current': true,
@@ -235,19 +234,19 @@ Handlebars.registerHelper('containerPosition', section => {
Template.registerHelper('emojiIcons', function () {
return [
{ name: 'sad', icon: 'sad-face', title: '' },
- { name: 'happy', icon: 'happy-face', title: ''},
- { name: 'confused', icon: 'confused-face', title: ''},
- { name: 'neutral', icon: 'neutral-face', title: ''},
- { name: 'away', icon: 'clock', title: ''},
- { name: 'raiseHand', icon: 'hand', title: 'Lower your Hand'}
+ { name: 'happy', icon: 'happy-face', title: '' },
+ { name: 'confused', icon: 'confused-face', title: '' },
+ { name: 'neutral', icon: 'neutral-face', title: '' },
+ { name: 'away', icon: 'clock', title: '' },
+ { name: 'raiseHand', icon: 'hand', title: 'Lower your Hand' },
];
});
// scale the whiteboard to adapt to the resized window
-this.scaleWhiteboard = function(whiteboardPaperModel) {
+this.scaleWhiteboard = function (whiteboardPaperModel) {
let adjustedDimensions;
adjustedDimensions = scaleSlide(getInSession('slideOriginalWidth'), getInSession('slideOriginalHeight'));
- if(typeof whiteboardPaperModel !== "undefined" && whiteboardPaperModel !== null) {
+ if (typeof whiteboardPaperModel !== 'undefined' && whiteboardPaperModel !== null) {
whiteboardPaperModel.scale(adjustedDimensions.width, adjustedDimensions.height);
}
/* if(callback) {
diff --git a/bigbluebutton-html5/client/main.jsx b/bigbluebutton-html5/client/main.jsx
index 3410fb7637..5d93dad744 100755
--- a/bigbluebutton-html5/client/main.jsx
+++ b/bigbluebutton-html5/client/main.jsx
@@ -13,12 +13,14 @@ import '/imports/ui/stylesheets/whiteboard.less';
let loadLib;
// Helper to load javascript libraries from the BBB server
-loadLib = function(libname) {
+loadLib = function (libname) {
let retryMessageCallback, successCallback;
- successCallback = function() {};
- retryMessageCallback = function(param) {
- return console.log("Failed to load library", param);
+ successCallback = function () {};
+
+ retryMessageCallback = function (param) {
+ return console.log('Failed to load library', param);
};
+
return Meteor.Loader.loadJs(`${window.location.origin}/client/lib/${libname}`, successCallback, 10000).fail(retryMessageCallback);
};
@@ -35,7 +37,7 @@ Meteor.startup(() => {
set(key, value) {
Session.set.apply(this, arguments);
amplify.store.sessionStorage(key, value);
- }
+ },
});
});
@@ -45,17 +47,18 @@ Template.menu.events({
toggleSettingsMenu();
return $('.slideButton').blur();
},
+
'click .toggleChatButton'(event) {
return toggleChatbar();
- }
+ },
});
-Template.main.rendered = function() {
- ReactDOM.render(
, document.getElementById("main"));
+Template.main.rendered = function () {
+ ReactDOM.render(
, document.getElementById('main'));
ReactDOM.render(
, document.getElementById('user-contents'));
let lastOrientationWasLandscape;
- $("#dialog").dialog({
+ $('#dialog').dialog({
modal: true,
draggable: false,
resizable: false,
@@ -64,42 +67,45 @@ Template.main.rendered = function() {
buttons: [
{
text: 'Yes',
- click: function() {
- userLogout(BBB.getMeetingId(), getInSession("userId"), true);
- return $(this).dialog("close");
+ click: function () {
+ userLogout(BBB.getMeetingId(), getInSession('userId'), true);
+ return $(this).dialog('close');
},
- "class": 'btn btn-xs btn-primary active'
+
+ class: 'btn btn-xs btn-primary active',
}, {
text: 'No',
- click: function() {
- $(this).dialog("close");
- return $(".tooltip").hide();
+ click: function () {
+ $(this).dialog('close');
+ return $('.tooltip').hide();
},
- "class": 'btn btn-xs btn-default'
- }
+
+ class: 'btn btn-xs btn-default',
+ },
],
open(event, ui) {
return $('.ui-widget-overlay').bind('click', () => {
- if(isMobile()) {
- return $("#dialog").dialog('close');
+ if (isMobile()) {
+ return $('#dialog').dialog('close');
}
});
},
+
position: {
my: 'right top',
at: 'right bottom',
- of: '.signOutIcon'
- }
+ of: '.signOutIcon',
+ },
});
lastOrientationWasLandscape = isLandscape();
$(window).resize(() => {
$('#dialog').dialog('close');
// when the orientation switches call the handler
- if(isLandscape() && !lastOrientationWasLandscape) {
+ if (isLandscape() && !lastOrientationWasLandscape) {
orientationBecameLandscape();
return lastOrientationWasLandscape = true;
- } else if(isPortrait() && lastOrientationWasLandscape) {
+ } else if (isPortrait() && lastOrientationWasLandscape) {
orientationBecamePortrait();
return lastOrientationWasLandscape = false;
}
@@ -107,14 +113,14 @@ Template.main.rendered = function() {
$('#shield').click(() => {
return toggleSlidingMenu();
});
- if(Meteor.config.app.autoJoinAudio) {
- if(Meteor.config.app.skipCheck) {
+ if (Meteor.config.app.autoJoinAudio) {
+ if (Meteor.config.app.skipCheck) {
return joinVoiceCall(this, {
- isListenOnly: Meteor.config.app.listenOnly
+ isListenOnly: Meteor.config.app.listenOnly,
});
} else {
- $("#settingsModal").foundation('reveal', 'open');
- if(Meteor.config.app.listenOnly) {
+ $('#settingsModal').foundation('reveal', 'open');
+ if (Meteor.config.app.listenOnly) {
return $('#joinMicrophone').prop('disabled', true);
}
}
@@ -124,29 +130,30 @@ Template.main.rendered = function() {
Template.main.gestures({
'panstart #container'(event, template) {
let initTransformValue, menuPanned, panIsValid, screenWidth;
- if(isPortraitMobile() && isPanHorizontal(event)) {
+ if (isPortraitMobile() && isPanHorizontal(event)) {
panIsValid = getInSession('panIsValid');
initTransformValue = getInSession('initTransform');
menuPanned = getInSession('menuPanned');
screenWidth = $('#container').width();
setInSession('panStarted', true);
- if(panIsValid && menuPanned === 'left' && initTransformValue + event.deltaX >= 0 && initTransformValue + event.deltaX <= $('.left-drawer').width()) {
+ if (panIsValid && menuPanned === 'left' && initTransformValue + event.deltaX >= 0 && initTransformValue + event.deltaX <= $('.left-drawer').width()) {
return $('.left-drawer').css('transform', `translateX(${initTransformValue + event.deltaX}px)`);
- } else if(panIsValid && menuPanned === 'right' && initTransformValue + event.deltaX >= screenWidth - $('.right-drawer').width() && initTransformValue + event.deltaX <= screenWidth) {
+ } else if (panIsValid && menuPanned === 'right' && initTransformValue + event.deltaX >= screenWidth - $('.right-drawer').width() && initTransformValue + event.deltaX <= screenWidth) {
return $('.right-drawer').css('transform', `translateX(${initTransformValue + event.deltaX}px)`);
}
}
},
+
'panend #container'(event, template) {
let leftDrawerWidth, menuPanned, panIsValid, screenWidth;
- if(isPortraitMobile()) {
+ if (isPortraitMobile()) {
panIsValid = getInSession('panIsValid');
menuPanned = getInSession('menuPanned');
leftDrawerWidth = $('.left-drawer').width();
screenWidth = $('#container').width();
setInSession('panStarted', false);
- if(panIsValid && menuPanned === 'left' && $('.left-drawer').css('transform') !== 'none') {
- if(parseInt($('.left-drawer').css('transform').split(',')[4]) < leftDrawerWidth / 2) {
+ if (panIsValid && menuPanned === 'left' && $('.left-drawer').css('transform') !== 'none') {
+ if (parseInt($('.left-drawer').css('transform').split(',')[4]) < leftDrawerWidth / 2) {
$('.shield').removeClass('animatedShield');
$('.shield').css('opacity', '');
$('.left-drawer').removeClass('menuOut');
@@ -161,8 +168,9 @@ Template.main.gestures({
$('.toggleUserlistButton').addClass('menuToggledOn');
}
}
- if(panIsValid && menuPanned === 'right' && parseInt($('.right-drawer').css('transform').split(',')[4]) !== leftDrawerWidth) {
- if(parseInt($('.right-drawer').css('transform').split(',')[4]) > screenWidth - $('.right-drawer').width() / 2) {
+
+ if (panIsValid && menuPanned === 'right' && parseInt($('.right-drawer').css('transform').split(',')[4]) !== leftDrawerWidth) {
+ if (parseInt($('.right-drawer').css('transform').split(',')[4]) > screenWidth - $('.right-drawer').width() / 2) {
$('.shield').removeClass('animatedShield');
$('.shield').css('opacity', '');
$('.right-drawer').css('transform', `translateX(${screenWidth}px)`);
@@ -178,70 +186,76 @@ Template.main.gestures({
$('.toggleMenuButton').addClass('menuToggledOn');
}
}
+
$('.left-drawer').addClass('userlistMenu');
$('.userlistMenu').removeClass('left-drawer');
$('.right-drawer').addClass('settingsMenu');
return $('.settingsMenu').removeClass('right-drawer');
}
},
+
'panright #container, panleft #container'(event, template) {
let initTransformValue, leftDrawerWidth, menuPanned, panIsValid, rightDrawerWidth, screenWidth;
- if(isPortraitMobile() && isPanHorizontal(event)) {
+ if (isPortraitMobile() && isPanHorizontal(event)) {
// panright/panleft is always triggered once right before panstart
- if(!getInSession('panStarted')) {
+ if (!getInSession('panStarted')) {
// opening the left-hand menu
- if(event.type === 'panright' && event.center.x <= $('#container').width() * 0.1) {
+ if (event.type === 'panright' && event.center.x <= $('#container').width() * 0.1) {
setInSession('panIsValid', true);
setInSession('menuPanned', 'left');
// closing the left-hand menu
- } else if(event.type === 'panleft' && event.center.x < $('#container').width() * 0.9) {
+ } else if (event.type === 'panleft' && event.center.x < $('#container').width() * 0.9) {
setInSession('panIsValid', true);
setInSession('menuPanned', 'left');
// opening the right-hand menu
- } else if(event.type === 'panleft' && event.center.x >= $('#container').width() * 0.9) {
+ } else if (event.type === 'panleft' && event.center.x >= $('#container').width() * 0.9) {
setInSession('panIsValid', true);
setInSession('menuPanned', 'right');
// closing the right-hand menu
- } else if(event.type === 'panright' && event.center.x > $('#container').width() * 0.1) {
+ } else if (event.type === 'panright' && event.center.x > $('#container').width() * 0.1) {
setInSession('panIsValid', true);
setInSession('menuPanned', 'right');
} else {
setInSession('panIsValid', false);
}
+
setInSession('eventType', event.type);
- if(getInSession('menuPanned') === 'left') {
- if($('.userlistMenu').css('transform') !== 'none') { // menu is already transformed
+ if (getInSession('menuPanned') === 'left') {
+ if ($('.userlistMenu').css('transform') !== 'none') { // menu is already transformed
setInSession(
'initTransform',
parseInt($('.userlistMenu').css('transform').split(',')[4])
); // translateX value
- } else if($('.userlistMenu').hasClass('menuOut')) {
+ } else if ($('.userlistMenu').hasClass('menuOut')) {
setInSession('initTransform', $('.userlistMenu').width());
} else {
setInSession('initTransform', 0);
}
+
$('.userlistMenu').addClass('left-drawer');
$('.left-drawer').removeClass('userlistMenu');
- } else if(getInSession('menuPanned') === 'right') {
- if($('.settingsMenu').css('transform') !== 'none') { // menu is already transformed
+ } else if (getInSession('menuPanned') === 'right') {
+ if ($('.settingsMenu').css('transform') !== 'none') { // menu is already transformed
setInSession(
'initTransform',
parseInt($('.settingsMenu').css('transform').split(',')[4])
); // translateX value
- } else if($('.settingsMenu').hasClass('menuOut')) {
+ } else if ($('.settingsMenu').hasClass('menuOut')) {
setInSession('initTransform', $('.settingsMenu').width());
} else {
setInSession('initTransform', 0);
}
+
$('.settingsMenu').addClass('right-drawer');
$('.right-drawer').removeClass('settingsMenu');
}
}
+
initTransformValue = getInSession('initTransform');
panIsValid = getInSession('panIsValid');
menuPanned = getInSession('menuPanned');
@@ -250,35 +264,39 @@ Template.main.gestures({
screenWidth = $('#container').width();
// moving the left-hand menu
- if(panIsValid &&
+ if (panIsValid &&
menuPanned === 'left' &&
initTransformValue + event.deltaX >= 0 &&
initTransformValue + event.deltaX <= leftDrawerWidth) {
- if($('.settingsMenu').hasClass('menuOut')) {
+ if ($('.settingsMenu').hasClass('menuOut')) {
toggleSettingsMenu();
}
+
$('.left-drawer').css('transform', `translateX(${initTransformValue + event.deltaX}px)`);
- if(!getInSession('panStarted')) {
+ if (!getInSession('panStarted')) {
$('.shield').addClass('animatedShield');
}
+
return $('.shield').css('opacity', 0.5 * (initTransformValue + event.deltaX) / leftDrawerWidth);
- } else if(panIsValid &&
+ } else if (panIsValid &&
menuPanned === 'right' &&
initTransformValue + event.deltaX >= screenWidth - rightDrawerWidth &&
initTransformValue + event.deltaX <= screenWidth) { // moving the right-hand menu
- if($('.userlistMenu').hasClass('menuOut')) {
+ if ($('.userlistMenu').hasClass('menuOut')) {
toggleUserlistMenu();
}
+
$('.right-drawer').css('transform', `translateX(${initTransformValue + event.deltaX}px)`);
- if(!getInSession('panStarted')) {
+ if (!getInSession('panStarted')) {
$('.shield').addClass('animatedShield');
}
+
return $('.shield').css('opacity', 0.5 * (screenWidth - initTransformValue - event.deltaX) / rightDrawerWidth);
}
}
- }
+ },
});
-Template.makeButton.rendered = function() {
+Template.makeButton.rendered = function () {
return $('button[rel=tooltip]').tooltip();
};
diff --git a/bigbluebutton-html5/imports/ui/EmojiIcon.jsx b/bigbluebutton-html5/imports/ui/EmojiIcon.jsx
index 264019b199..08681f4cd5 100755
--- a/bigbluebutton-html5/imports/ui/EmojiIcon.jsx
+++ b/bigbluebutton-html5/imports/ui/EmojiIcon.jsx
@@ -13,10 +13,9 @@ export let EmojiIcon = React.createClass({
},
renderIcon() {
- if(this.props.iconName === 'raiseHand') {
+ if (this.props.iconName === 'raiseHand') {
return (
);
- }
- else if(this.props.iconName === 'happy') {
+ } else if (this.props.iconName === 'happy') {
return (
- )
- }
- else if(this.props.iconName === 'neutral') {
+ );
+ } else if (this.props.iconName === 'neutral') {
return (
- )
- }
- else if(this.props.iconName === 'confused') {
+ );
+ } else if (this.props.iconName === 'confused') {
return (
- )
- }
- else if(this.props.iconName === 'sad') {
+ );
+ } else if (this.props.iconName === 'sad') {
return (
- )
- }
- else if(this.props.iconName === 'away') {
+ );
+ } else if (this.props.iconName === 'away') {
return (
- )
- }
- else if(this.props.iconName === 'plus') {
+ );
+ } else if (this.props.iconName === 'plus') {
return (
- )
+ );
}
},
});
diff --git a/bigbluebutton-html5/imports/ui/chat/Chat.jsx b/bigbluebutton-html5/imports/ui/chat/Chat.jsx
index 9069846135..9bdc48cbc2 100755
--- a/bigbluebutton-html5/imports/ui/chat/Chat.jsx
+++ b/bigbluebutton-html5/imports/ui/chat/Chat.jsx
@@ -8,22 +8,23 @@ export let Chat = React.createClass({
getMeteorData() {
let chatMessages, privateChatName, chattingWith, user, messageFontSize, temp, user_exists;
- messageFontSize = { fontSize: getInSession("messageFontSize") + 'px' };
+ messageFontSize = { fontSize: getInSession('messageFontSize') + 'px' };
chattingWith = getInSession('inChatWith');
- if(chattingWith === 'PUBLIC_CHAT') { // find all public and system messages
- chatMessages = Meteor.Chat.find({ 'message.chat_type': { $in: ["SYSTEM_MESSAGE", "PUBLIC_CHAT"] }},
- { sort: { 'message.from_time': 1 }}).fetch();
+ if (chattingWith === 'PUBLIC_CHAT') { // find all public and system messages
+ chatMessages = Meteor.Chat.find({ 'message.chat_type': { $in: ['SYSTEM_MESSAGE', 'PUBLIC_CHAT'] } },
+ { sort: { 'message.from_time': 1 } }).fetch();
} else {
- chatMessages = Meteor.Chat.find({ 'message.chat_type': 'PRIVATE_CHAT', $or: [{ 'message.to_userid': chattingWith },
- { 'message.from_userid': chattingWith }]}).fetch();
- }
+ chatMessages = Meteor.Chat.find({ 'message.chat_type': 'PRIVATE_CHAT', $or: [{ 'message.to_userid': chattingWith },
+ { 'message.from_userid': chattingWith }, ], }).fetch();
+ }
+
user = Meteor.Users.findOne({ userId: chattingWith });
- if(user != null) {
+ if (user != null) {
privateChatName = user.user.name;
}
- if(getInSession('inChatWith') === "PUBLIC_CHAT" || Meteor.Users.findOne({
- userId: getInSession('inChatWith')
+ if (getInSession('inChatWith') === 'PUBLIC_CHAT' || Meteor.Users.findOne({
+ userId: getInSession('inChatWith'),
}) != null) {
user_exists = true;
} else {
@@ -34,48 +35,51 @@ export let Chat = React.createClass({
chatMessages: chatMessages,
privateChatName: privateChatName,
messageFontSize: messageFontSize,
- user_exists: user_exists
- };
+ user_exists: user_exists,
+ };
},
- detectUnreadChat: function() {
+ detectUnreadChat: function () {
//if the current tab is not the same as the tab we just published in
return Meteor.Chat.find({}).observe({
added: (_this => {
- return function(chatMessage) {
+ return function (chatMessage) {
let findDestinationTab;
- findDestinationTab = function() {
+ findDestinationTab = function () {
let ref, ref1;
- if(((ref = chatMessage.message) != null ? ref.chat_type : void 0) === "PUBLIC_CHAT") {
- return "PUBLIC_CHAT";
+ if (((ref = chatMessage.message) != null ? ref.chat_type : void 0) === 'PUBLIC_CHAT') {
+ return 'PUBLIC_CHAT';
} else {
return (ref1 = chatMessage.message) != null ? ref1.from_userid : void 0;
}
};
+
return Tracker.autorun(comp => {
let destinationTab, tabsTime;
tabsTime = getInSession('userListRenderedTime');
- if((tabsTime != null) && chatMessage.message.from_userid !== "SYSTEM_MESSAGE" && chatMessage.message.from_time - tabsTime > 0) {
+ if ((tabsTime != null) && chatMessage.message.from_userid !== 'SYSTEM_MESSAGE' && chatMessage.message.from_time - tabsTime > 0) {
populateNotifications(chatMessage); // check if we need to show a new notification
destinationTab = findDestinationTab();
- if(destinationTab !== getInSession("inChatWith")) {
+ if (destinationTab !== getInSession('inChatWith')) {
setInSession('chats', getInSession('chats').map(tab => {
- if(tab.userId === destinationTab) {
+ if (tab.userId === destinationTab) {
tab.gotMail = true;
tab.number++;
}
+
return tab;
}));
}
}
+
return comp.stop();
});
};
- })(this)
+ })(this),
});
},
- componentDidMount: function(){
+ componentDidMount: function () {
this.detectUnreadChat();
},
@@ -83,17 +87,18 @@ export let Chat = React.createClass({
let deleted, i, j, len;
len = msgs != null ? msgs.length : void 0; // get length of messages
i = 0;
- while(i < len) { // Must be a do while, for loop compiles and stores the length of array which can change inside the loop!
- if(msgs[i].message.from_userid !== 'System') { // skip system messages
+ while (i < len) { // Must be a do while, for loop compiles and stores the length of array which can change inside the loop!
+ if (msgs[i].message.from_userid !== 'System') { // skip system messages
j = i + 1; // Start looking at messages right after the current one
- while(j < len) {
+ while (j < len) {
deleted = false;
- if(msgs[j].message.from_userid !== 'System') { // Ignore system messages
+ if (msgs[j].message.from_userid !== 'System') { // Ignore system messages
// Check if the time discrepancy between the two messages exceeds window for grouping
- if((parseFloat(msgs[j].message.from_time) - parseFloat(msgs[i].message.from_time)) >= 60000) { // 60 seconds/1 minute
+ if ((parseFloat(msgs[j].message.from_time) - parseFloat(msgs[i].message.from_time)) >= 60000) { // 60 seconds/1 minute
break; // Messages are too far between, so them seperated and stop joining here
}
- if(msgs[i].message.from_userid === msgs[j].message.from_userid) { // Both messages are from the same user
+
+ if (msgs[i].message.from_userid === msgs[j].message.from_userid) { // Both messages are from the same user
// insert a '\r' carriage return character between messages to put them on a new line
msgs[i].message.message += `${CARRIAGE_RETURN}${msgs[j].message.message}`; // Combine the messages
msgs.splice(j, 1); // Delete the message from the collection
@@ -104,44 +109,47 @@ export let Chat = React.createClass({
} else {
break; // This is the break point in the chat, don't merge
}
+
len = msgs.length;
- if(!deleted) {
+ if (!deleted) {
++j;
}
}
}
+
++i;
len = msgs.length;
}
+
return msgs;
},
- inPrivateChat(){
+ inPrivateChat() {
return (getInSession('inChatWith') !== 'PUBLIC_CHAT');
},
- render(){
+ render() {
return (
-
-
- {this.inPrivateChat() ?
+
+
+ {this.inPrivateChat() ?
- : null }
-
-
+ : null }
+
+
{this.getCombinedMessagesForChat(this.data.chatMessages).map((message) =>
- )}
- {this.data.user_exists ? null : - The user has left
}
-
-
-
+ )}
+ {this.data.user_exists ? null : The user has left }
+
+
+
{this.data.user_exists ?
-
-
+
+
- : null }
+ : null }
);
- }
+ },
});
diff --git a/bigbluebutton-html5/imports/ui/chat/ChatInputControls.jsx b/bigbluebutton-html5/imports/ui/chat/ChatInputControls.jsx
index 863fe1d142..7ef61b6de5 100755
--- a/bigbluebutton-html5/imports/ui/chat/ChatInputControls.jsx
+++ b/bigbluebutton-html5/imports/ui/chat/ChatInputControls.jsx
@@ -2,27 +2,30 @@ import React from 'react';
export let ChatInputControls = React.createClass({
//#TODO MessageFontSize dynamic change
- componentDidMount: function() {
+ componentDidMount: function () {
$('.panel-footer').resizable({
- handles: 'n',
- minHeight: 70,
- resize(event, ui) {
+ handles: 'n',
+ minHeight: 70,
+ resize(event, ui) {
let ref;
- if($('.panel-footer').css('top') === '0px') {
+ if ($('.panel-footer').css('top') === '0px') {
$('.panel-footer').height(70); // prevents the element from shrinking vertically for 1-2 px
} else {
$('.panel-footer').css('top', `${parseInt($('.panel-footer').css('top'))}${1}px`);
}
+
$('#chatbody').height($('#chat').height() - $('.panel-footer').height() - 45);
return $('#chatbody').scrollTop((ref = $('#chatbody')[0]) != null ? ref.scrollHeight : void 0);
},
- start(event, ui) {
+
+ start(event, ui) {
$('#newMessageInput').css('overflow', '');
return $('.panel-footer').resizable('option', 'maxHeight', Math.max($('.panel-footer').height(), $('#chat').height() / 2));
},
- stop(event, ui) {
+
+ stop(event, ui) {
return setInSession('chatInputMinHeight', $('.panel-footer').height() + 1);
- }
+ },
});
$('#newMessageInput').on('keydown paste cut', () => {
@@ -31,30 +34,33 @@ export let ChatInputControls = React.createClass({
}, 0);
});
},
- sendMessage: function() {
+
+ sendMessage: function () {
let chattingWith, color, message, ref, toUsername;
message = linkify($('#newMessageInput').val()); // get the message from the input box
- if(!((message != null ? message.length : void 0) > 0 && (/\S/.test(message)))) { // check the message has content and it is not whitespace
+ if (!((message != null ? message.length : void 0) > 0 && (/\S/.test(message)))) { // check the message has content and it is not whitespace
return; // do nothing if invalid message
}
- color = "0x000000"; //"0x#{getInSession("messageColor")}"
- if((chattingWith = getInSession('inChatWith')) !== "PUBLIC_CHAT") {
+
+ color = '0x000000'; //"0x#{getInSession("messageColor")}"
+ if ((chattingWith = getInSession('inChatWith')) !== 'PUBLIC_CHAT') {
toUsername = (ref = Meteor.Users.findOne({
- userId: chattingWith
+ userId: chattingWith,
})) != null ? ref.user.name : void 0;
- BBB.sendPrivateChatMessage(color, "en", message, chattingWith, toUsername);
+ BBB.sendPrivateChatMessage(color, 'en', message, chattingWith, toUsername);
} else {
- BBB.sendPublicChatMessage(color, "en", message);
+ BBB.sendPublicChatMessage(color, 'en', message);
}
+
return $('#newMessageInput').val(''); // Clear message box
},
- adjustChatInputHeight: function() {
+ adjustChatInputHeight: function () {
let projectedHeight, ref;
- if(isLandscape()) {
+ if (isLandscape()) {
$('#newMessageInput').css('height', 'auto');
projectedHeight = $('#newMessageInput')[0].scrollHeight + 23;
- if(projectedHeight !== $('.panel-footer').height() && projectedHeight >= getInSession('chatInputMinHeight')) {
+ if (projectedHeight !== $('.panel-footer').height() && projectedHeight >= getInSession('chatInputMinHeight')) {
$('#newMessageInput').css('overflow', 'hidden'); // prevents a scroll bar
// resizes the chat input area
@@ -67,83 +73,86 @@ export let ChatInputControls = React.createClass({
$('#chatbody').height($('#chat').height() - projectedHeight - 45);
$('#chatbody').scrollTop((ref = $('#chatbody')[0]) != null ? ref.scrollHeight : void 0);
}
+
return $('#newMessageInput').css('height', '');
- } else if(isPortrait()) {
+ } else if (isPortrait()) {
$('.panel-footer').attr('style', '');
$('#chatbody').attr('style', '');
return $('#newMessageInput').attr('style', '');
}
},
- handleClick: function() {
+ handleClick: function () {
$('#sendMessageButton').blur();
this.sendMessage();
return this.adjustChatInputHeight();
},
// user pressed a button inside the chatbox
- keyPressedHandler: function(event) {
+ keyPressedHandler: function (event) {
let key;
key = event.charCode ? event.charCode : (event.keyCode ? event.keyCode : 0);
- if(event.shiftKey && (key === 13)) {
+ if (event.shiftKey && (key === 13)) {
event.preventDefault();
+
// append a '\r' carriage return character to the input box dropping the cursor to a new line
- document.getElementById("newMessageInput").value += CARRIAGE_RETURN; // Change newline character
+ document.getElementById('newMessageInput').value += CARRIAGE_RETURN; // Change newline character
return;
}
- if(key === 13) { // Check for pressing enter to submit message
+
+ if (key === 13) { // Check for pressing enter to submit message
event.preventDefault();
this.sendMessage();
- $('#newMessageInput').val("");
+ $('#newMessageInput').val('');
return false;
}
},
- publicChatDisabled: function() {
+ publicChatDisabled: function () {
let presenter, publicChatIsDisabled, ref, ref1, ref2, userIsLocked;
userIsLocked = (ref = Meteor.Users.findOne({
- userId: getInSession('userId')
+ userId: getInSession('userId'),
})) != null ? ref.user.locked : void 0;
publicChatIsDisabled = (ref1 = Meteor.Meetings.findOne({})) != null ? ref1.roomLockSettings.disablePublicChat : void 0;
presenter = (ref2 = Meteor.Users.findOne({
- userId: getInSession('userId')
+ userId: getInSession('userId'),
})) != null ? ref2.user.presenter : void 0;
return userIsLocked && publicChatIsDisabled && !presenter;
},
- privateChatDisabled: function() {
+ privateChatDisabled: function () {
let presenter, privateChatIsDisabled, ref, ref1, ref2, userIsLocked;
userIsLocked = (ref = Meteor.Users.findOne({
- userId: getInSession('userId')
+ userId: getInSession('userId'),
})) != null ? ref.user.locked : void 0;
privateChatIsDisabled = (ref1 = Meteor.Meetings.findOne({})) != null ? ref1.roomLockSettings.disablePrivateChat : void 0;
presenter = (ref2 = Meteor.Users.findOne({
- userId: getInSession('userId')
+ userId: getInSession('userId'),
})) != null ? ref2.user.presenter : void 0;
return userIsLocked && privateChatIsDisabled && !presenter;
},
- getInputControls: function() {
- if(this.props.inPrivateChat && this.privateChatDisabled() || !this.props.inPrivateChat && this.publicChatDisabled()){
+ getInputControls: function () {
+ if (this.props.inPrivateChat && this.privateChatDisabled() || !this.props.inPrivateChat && this.publicChatDisabled()) {
return (
-
);
} else {
return (
-
-
-
+
+
+
);
}
},
- render(){
+ render() {
return (
-