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 2bc893d [OPENMEETINGS-2167] bottom-to-top arrange is implemented
2bc893d is described below
commit 2bc893d99aa6341413059a67ba877560a12e88e7
Author: Maxim Solodovnik <[email protected]>
AuthorDate: Sun Mar 29 22:06:32 2020 +0700
[OPENMEETINGS-2167] bottom-to-top arrange is implemented
---
.../apache/openmeetings/web/room/raw-video-util.js | 122 +++++++++++++++------
.../apache/openmeetings/web/room/wb/WbPanel.html | 4 +-
openmeetings-web/src/main/webapp/css/raw-room.css | 1 +
3 files changed, 89 insertions(+), 38 deletions(-)
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 293bd8a..40c1203 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
@@ -48,33 +48,10 @@ var VideoUtil = (function() {
const c = a.find('.wb-area .tabs .wb-tab-content');
return c.length > 0 ? $(WBA_WB_SEL) : a;
}
- function _getPos(list, w, h) {
- if (Room.getOptions().interview) {
- return {left: 0, top: 0};
- }
- const wba = _container(), woffset = wba.offset()
- , offsetX = 20, offsetY = 10
- , area = {left: woffset.left, top: woffset.top, right:
woffset.left + wba.width(), bottom: woffset.top + wba.height()};
- const rectNew = {
- _left: area.left
- , _top: area.top
- , right: area.left + w
- , bottom: area.top + h
- , get left() {
- return this._left
- }
- , set left(l) {
- this._left = l;
- this.right = l + w;
- }
- , get top() {
- return this._top
- }
- , set top(t) {
- this._top = t;
- this.bottom = t + h;
- }
- };
+ function __processTopToBottom(area, rectNew, list) {
+ const offsetX = 20
+ , offsetY = 10;
+
let minY = area.bottom, posFound;
do {
posFound = true;
@@ -100,21 +77,94 @@ var VideoUtil = (function() {
} while (!posFound);
return {left: rectNew.left, top: rectNew.top};
}
+ function __processEqualsBottomToTop(area, rectNew, list) {
+ const offsetX = 20
+ , offsetY = 10;
+
+ rectNew.bottom = area.bottom;
+ let minY = area.bottom, posFound;
+ do {
+ posFound = true;
+ for (let i = 0; i < list.length; ++i) {
+ const rect = list[i];
+ minY = Math.min(minY, rect.top);
+
+ if (rectNew.left < rect.right && rectNew.right
> rect.left && rectNew.top < rect.bottom && rectNew.bottom > rect.top) {
+ rectNew.left = rect.right + offsetX;
+ posFound = false;
+ }
+ if (rectNew.right >= area.right) {
+ rectNew.left = area.left;
+ rectNew.bottom = Math.min(minY,
rectNew.top) - offsetY;
+ posFound = false;
+ }
+ if (rectNew.top <= area.top) {
+ rectNew.top = area.top;
+ posFound = true;
+ break;
+ }
+ }
+ } while (!posFound);
+ return {left: rectNew.left, top: rectNew.top};
+ }
+ function _getPos(list, w, h, _processor) {
+ if (Room.getOptions().interview) {
+ return {left: 0, top: 0};
+ }
+ const wba = _container()
+ , woffset = wba.offset()
+ , area = {left: woffset.left, top: woffset.top, right:
woffset.left + wba.width(), bottom: woffset.top + wba.height()}
+ , rectNew = {
+ _left: area.left
+ , _top: area.top
+ , _right: area.left + w
+ , _bottom: area.top + h
+ , get left() {
+ return this._left;
+ }
+ , set left(l) {
+ this._left = l;
+ this._right = l + w;
+ }
+ , get right() {
+ return this._right;
+ }
+ , get top() {
+ return this._top;
+ }
+ , set top(t) {
+ this._top = t;
+ this._bottom = t + h;
+ }
+ , set bottom(b) {
+ this._bottom = b;
+ this._top = b - h;
+ }
+ , get bottom() {
+ return this._bottom;
+ }
+ };
+ const processor = _processor || __processTopToBottom;
+ return processor(area, rectNew, list);
+ }
function _arrange() {
- const list = [], elems = $(VIDWIN_SEL);
- for (let i = 0; i < elems.length; ++i) {
- const v = $(elems[i]);
+ const list = [];
+ $(VIDWIN_SEL).each(function() {
+ const v = $(this);
v.css(_getPos(list, v.width(), v.height()));
list.push(_getRect(v));
- }
+ });
}
function _arrangeResize() {
- const list = [], elems = $(VIDWIN_SEL);
- for (let i = 0; i < elems.length; ++i) {
- const v = $(elems[i]);
- v.css(_getPos(list, v.width(), v.height()));
+ const list = [];
+ $(VIDWIN_SEL).each(function() {
+ const v = $(this);
+ v.find('.video-container.ui-dialog-content')
+ .dialog('option', 'width', 120)
+ .dialog('option', 'height', 90);
+ v.css(_getPos(list, v.width(), v.height(),
__processEqualsBottomToTop));
list.push(_getRect(v));
- }
+ });
}
function _cleanStream(stream) {
if (!!stream) {
diff --git
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/WbPanel.html
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/WbPanel.html
index b2acfce..e17da64 100644
---
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/WbPanel.html
+++
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/WbPanel.html
@@ -160,8 +160,8 @@
<div id="wb-tools-readonly">
<div wicket:message="title:557" class="clickable
om-icon big apointer"></div>
</div>
- <div id="wb-tool-settings" class="wb-tool-settings
ui-corner-all ui-widget-content">
- <div wicket:message="title:843" class="header
ui-dialog-titlebar ui-corner-all ui-widget-header ui-helper-clearfix
ui-draggable-handle">
+ <div id="wb-tool-settings" class="wb-tool-settings
ui-widget-content">
+ <div wicket:message="title:843" class="header
ui-dialog-titlebar ui-widget-header ui-helper-clearfix ui-draggable-handle">
<span class="ui-dialog-title"><wicket:message
key="843"/></span>
<button type="button" class="ui-button
ui-corner-all ui-widget ui-button-icon-only ui-dialog-titlebar-close"
wicket:message="title:85">
<span class="ui-button-icon ui-icon
ui-icon-closethick"></span>
diff --git a/openmeetings-web/src/main/webapp/css/raw-room.css
b/openmeetings-web/src/main/webapp/css/raw-room.css
index c9a8e45..cc88030 100644
--- a/openmeetings-web/src/main/webapp/css/raw-room.css
+++ b/openmeetings-web/src/main/webapp/css/raw-room.css
@@ -415,6 +415,7 @@ html[dir="rtl"] .room-block .sidebar {
}
.user-video .ui-dialog-titlebar
, .sharer .ui-dialog-titlebar
+, .wb-tool-settings .ui-dialog-titlebar
, .user-video .ui-dialog-titlebar .buttonpane
{
background-color: var(--white);