This is an automated email from the ASF dual-hosted git repository.

solomax pushed a commit to branch OPENMEETINGS-1142-new-look
in repository https://gitbox.apache.org/repos/asf/openmeetings.git


The following commit(s) were added to refs/heads/OPENMEETINGS-1142-new-look by 
this push:
     new ce09c95  [OPENMEETINGS-1142] additional work on drag-n-drop
ce09c95 is described below

commit ce09c954b1150df6dadd84baa1610a4b3cbd80fc
Author: Maxim Solodovnik <[email protected]>
AuthorDate: Wed Jun 27 16:31:54 2018 +0700

    [OPENMEETINGS-1142] additional work on drag-n-drop
---
 .../apache/openmeetings/web/room/video-manager.js  |  3 +-
 .../java/org/apache/openmeetings/web/room/video.js | 44 +++++---------------
 .../openmeetings/web/room/wb/interview-area.js     | 47 ++++++++++++++++++++--
 .../org/apache/openmeetings/web/room/wb/wb-area.js |  1 +
 pom.xml                                            |  4 +-
 5 files changed, 59 insertions(+), 40 deletions(-)

diff --git 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/video-manager.js
 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/video-manager.js
index aa4d58d..dc8573c 100644
--- 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/video-manager.js
+++ 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/video-manager.js
@@ -72,8 +72,9 @@ var VideoManager = (function() {
                if (v.dialog('instance') !== undefined) {
                        v.dialog('destroy');
                }
-               v.parent('.pod').remove();
+               v.parents('.pod').remove();
                v.remove();
+               WbArea.updateAreaClass();
        }
        function _play(c) {
                if (!inited) {
diff --git 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/video.js 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/video.js
index 4eeeb5d..7d0dd64 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/video.js
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/video.js
@@ -15,15 +15,18 @@ var Video = (function() {
                _resizeDlgArea(_w, h);
                return h;
        }
+       function _vidResize(_w, _h) {
+               try {
+                       swf[0].vidResize(Math.floor(_w), Math.floor(_h));
+               } catch (err) {}
+       }
        function _resizeDlgArea(_w, _h) {
                v.dialog('option', 'width', _w).dialog('option', 'height', _h);
                const h = _h - _getExtra();
                _resize(_w, h);
                if (Room.getOptions().interview) {
                        v.dialog('widget').css(VideoUtil.getPos());
-                       try {
-                               swf[0].vidResize(Math.floor(_w), Math.floor(h));
-                       } catch (err) {}
+                       _vidResize(_w, h);
                }
        }
        function _resizePod() {
@@ -41,10 +44,10 @@ var Video = (function() {
        }
        function _securityMode() {
                if (Room.getOptions().interview) {
-                       swf[0].vidResize(swf.attr('width'), swf.attr('height'));
-                       return;
+                       _resizeDlgArea(Math.max(300, swf.attr('width')), 
Math.max(200, swf.attr('height')));
+               } else {
+                       v.dialog('option', 'position', {my: 'center', at: 
'center', of: VideoUtil.container()});
                }
-               v.dialog('option', 'position', {my: 'center', at: 'center', of: 
VideoUtil.container()});
        }
        function _resize(w, h) {
                vc.width(w).height(h);
@@ -102,35 +105,10 @@ var Video = (function() {
                let contSel;
                if (opts.interview) {
                        const area = $('.pod-area');
-                       let count = area.find('.video.user-video').length;
-                       const empt = area.find('.empty');
-                       if (count == 0) {
-                               empt.length == 0 && area.append($('<div 
class="empty"></div>'));
-                       } else {
-                               empt.remove();
-                       }
-                       //FIXME TODO add 'pod-big' logic
                        const contId = UUID.generate();
                        contSel = '#' + contId;
                        area.append($('<div class="pod"></div>').attr('id', 
contId));
-                       count++; //FIXME TODO conditional 'pod-big' logic
-                       if (count < 3) {
-                               area.attr('class', 'pod-area max2');
-                       } else if (count < 4) {
-                               area.attr('class', 'pod-area max3');
-                       } else if (count < 6) {
-                               area.attr('class', 'pod-area max5');
-                       } else if (count < 10) {
-                               area.attr('class', 'pod-area max9');
-                       } else if (count < 14) {
-                               area.attr('class', 'pod-area max13');
-                       } else if (count < 18) {
-                               area.attr('class', 'pod-area max17');
-                       } else if (count < 26) {
-                               area.attr('class', 'pod-area max25');
-                       } else if (count < 34) {
-                               area.attr('class', 'pod-area max33');
-                       }
+                       WbArea.updateAreaClass();
                } else {
                        contSel = '.room.box';
                }
@@ -155,7 +133,7 @@ var Video = (function() {
                                const w = ui.size.width - 2
                                        , h = ui.size.height - t.height() - 4 - 
(f.is(':visible') ? f.height() : 0);
                                _resize(w, h);
-                               swf[0].vidResize(w, h);
+                               vidResize(w, h);
                        });
                        if (VideoUtil.isSharing(c)) {
                                v.on('dialogclose', function() {
diff --git 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/interview-area.js
 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/interview-area.js
index 4b8bf38..984a66a 100644
--- 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/interview-area.js
+++ 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/interview-area.js
@@ -21,10 +21,19 @@ var InterviewWbArea = function() {
                        accept: '.pod'
                        , activeClass: 'ui-hightlight'
                        , drop: function(event, ui) {
-                               const vid = 
ui.draggable.find('.ui-dialog-content');
-                               vid.dialog('option', 'appendTo', $(this));
-                               ui.draggable.remove();
-                               _resizePod($(this));
+                               const big = $(this)
+                                       , vid = 
ui.draggable.find('.ui-dialog-content')
+                                       , cvid = big.find('.ui-dialog-content');
+                               if (cvid.length === 0) {
+                                       vid.dialog('option', 'appendTo', big);
+                                       ui.draggable.remove();
+                                       _resizePod(big);
+                               } else {
+                                       cvid.dialog('option', 'appendTo', 
ui.draggable);
+                                       vid.dialog('option', 'appendTo', big);
+                                       _resizePod();
+                               }
+                               _updateAreaClass();
                        }
                });
                pArea.sortable({
@@ -34,6 +43,7 @@ var InterviewWbArea = function() {
                                console.log('changed');
                        }
                });
+               _updateAreaClass();
                _inited = true;
        }
        function _setRole(_role) {
@@ -63,6 +73,34 @@ var InterviewWbArea = function() {
                        .attr('title', rec.data(started ? 'title-stop' : 
'title-start'))
                        .button('option', {icon: started ? 'ui-icon-stop' : 
'ui-icon-play'});
        }
+       function _updateAreaClass() {
+               const count = 
pArea.find('.pod:not(.ui-helper,.ui-sortable-placeholder)').length
+                       , empt = pArea.find('.empty');
+               if (count < 2) {
+                       empt.length == 0 && pArea.append($('<div 
class="empty"></div>'));
+               } else {
+                       empt.remove();
+               }
+               let cls = 'pod-area ';
+               if (count < 2) {
+                       cls +='max2';
+               } else if (count < 3) {
+                       cls +='max3';
+               } else if (count < 5) {
+                       cls +='max5';
+               } else if (count < 9) {
+                       cls +='max9';
+               } else if (count < 13) {
+                       cls +='max13';
+               } else if (count < 17) {
+                       cls +='max17';
+               } else if (count < 25) {
+                       cls +='max25';
+               } else if (count < 33) {
+                       cls +='max33';
+               }
+               pArea.attr('class', cls);
+       }
 
        self.init = _init;
        self.destroy = function() {};
@@ -72,5 +110,6 @@ var InterviewWbArea = function() {
        self.setRecStarted = _setRecStarted;
        self.addDeleteHandler = function() {};
        self.removeDeleteHandler = function() {};
+       self.updateAreaClass = _updateAreaClass;
        return self;
 };
diff --git 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/wb-area.js 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/wb-area.js
index 4539086..43fb480 100644
--- 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/wb-area.js
+++ 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/wb-area.js
@@ -336,6 +336,7 @@ var DrawWbArea = function() {
        self.removeDeleteHandler = function() {
                $(window).off('keyup', _deleteHandler);
        };
+       self.updateAreaClass = function() {};
        return self;
 };
 $(function() {
diff --git a/pom.xml b/pom.xml
index 8bd7b39..c035c95 100644
--- a/pom.xml
+++ b/pom.xml
@@ -38,7 +38,7 @@
                <db>derby</db>
                <jdk.version>1.8</jdk.version>
                <!-- plugin versions -->
-               
<maven-javadoc-plugin.version>3.0.0</maven-javadoc-plugin.version>
+               
<maven-javadoc-plugin.version>3.0.1</maven-javadoc-plugin.version>
                
<maven-surefire-plugin.version>2.22.0</maven-surefire-plugin.version>
                <maven-site-plugin.version>3.7.1</maven-site-plugin.version>
                <exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
@@ -935,7 +935,7 @@
                                        
<artifactId>maven-javadoc-plugin</artifactId>
                                        
<version>${maven-javadoc-plugin.version}</version>
                                        <configuration>
-                                               
<additionalparam>-Xdoclint:none</additionalparam>
+                                               <additionalparam>-Xdoclint:none 
-html5</additionalparam>
                                                <source>${jdk.version}</source>
                                                
<javadocVersion>${jdk.version}</javadocVersion>
                                        </configuration>

Reply via email to