This is an automated email from the ASF dual-hosted git repository.
solomax pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openmeetings.git
The following commit(s) were added to refs/heads/master by this push:
new 8ab8274 [OPENMEETINGS-2167] arrange is implemented
8ab8274 is described below
commit 8ab82747f891138051703fc631fe17ff9aabfa7e
Author: Maxim Solodovnik <[email protected]>
AuthorDate: Sat Apr 4 15:34:14 2020 +0700
[OPENMEETINGS-2167] arrange is implemented
---
.../org/apache/openmeetings/web/room/raw-room.js | 11 +++++----
.../apache/openmeetings/web/room/raw-video-util.js | 26 +++++++++++++++++++---
2 files changed, 30 insertions(+), 7 deletions(-)
diff --git
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/raw-room.js
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/raw-room.js
index bd1b971..6f64354 100644
---
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/raw-room.js
+++
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/raw-room.js
@@ -350,7 +350,7 @@ var Room = (function() {
const clients = Array.isArray(_clients) ? _clients : [_clients];
clients.forEach(c => {
const self = c.uid === options.uid;
- let le = $('#user' + c.uid);
+ let le = Room.getClient(c.uid);
if (le.length === 0) {
le = OmUtil.tmpl('#user-entry-stub', 'user' +
c.uid);
le.attr('id', 'user' + c.uid)
@@ -368,7 +368,7 @@ var Room = (function() {
}
function _updateClient(c) {
const self = c.uid === options.uid
- , le = $('#user' + c.uid)
+ , le = Room.getClient(c.uid)
, hasAudio = VideoUtil.hasMic(c)
, hasVideo = VideoUtil.hasCam(c)
, speaks = le.find('.audio-activity');
@@ -431,7 +431,7 @@ var Room = (function() {
VideoManager.update(c)
}
function _removeClient(uid) {
- $('#user' + uid).remove();
+ Room.getClient(uid).remove();
__updateCount();
}
@@ -449,6 +449,9 @@ var Room = (function() {
self.addClient = _addClient;
self.updateClient = _updateClient;
self.removeClient = _removeClient;
+ self.getClient = function(uid) {
+ return $('#user' + uid);
+ };
return self;
})();
/***** functions required by SIP ******/
@@ -486,7 +489,7 @@ function sipKeyUp(evt) {
}
}
function typingActivity(uid, active) {
- const u = $('#user' + uid + ' .typing-activity');
+ const u = Room.getClient(uid).find('.typing-activity');
if (active) {
u.addClass("typing");
} else {
diff --git
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/raw-video-util.js
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/raw-video-util.js
index 40c1203..12b8939 100644
---
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/raw-video-util.js
+++
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/raw-video-util.js
@@ -157,9 +157,29 @@ var VideoUtil = (function() {
}
function _arrangeResize() {
const list = [];
- $(VIDWIN_SEL).each(function() {
- const v = $(this);
- v.find('.video-container.ui-dialog-content')
+ function __getDialog(_v) {
+ return $(_v).find('.video-container.ui-dialog-content');
+ }
+ function __getClient(_v) {
+ return
Room.getClient(__getDialog(_v).data('clientUid'));
+ }
+ function __getClient(_v) {
+ return
Room.getClient(__getDialog(_v).data('clientUid'));
+ }
+ function __getMod(c) {
+ return c.find('.user-status').hasClass('mod') ? 1 : 0;
+ }
+ $(VIDWIN_SEL).toArray().sort((v1, v2) => {
+ const c1 = __getClient(v1)
+ , c2 = __getClient(v2)
+ , m1 = __getMod(c1)
+ , m2 = __getMod(c2)
+ , name1 = c1.attr('title')
+ , name2 = c2.attr('title');
+ return m1 - m2 || name1.localeCompare(name2);
+ }).forEach(_v => {
+ const v = $(_v);
+ __getDialog(v)
.dialog('option', 'width', 120)
.dialog('option', 'height', 90);
v.css(_getPos(list, v.width(), v.height(),
__processEqualsBottomToTop));