You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by so...@apache.org on 2018/07/15 09:35:41 UTC

[openmeetings] 02/07: [OPENMEETINGS-1142] additional work on drag-n-drop

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

commit 77f7b85677704e5e13d74acc90389e94fb3087b6
Author: Maxim Solodovnik <so...@gmail.com>
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 | 38 ++++-------------
 .../openmeetings/web/room/wb/interview-area.js     | 47 ++++++++++++++++++++--
 .../org/apache/openmeetings/web/room/wb/wb-area.js |  1 +
 pom.xml                                            |  4 +-
 5 files changed, 56 insertions(+), 37 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 126feb4..e4b071f 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
@@ -167,8 +167,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 499f15f..034aac8 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() {
@@ -89,35 +92,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';
 		}
@@ -142,7 +120,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 b2029bc..9d5458d 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
@@ -22,10 +22,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({
@@ -35,6 +44,7 @@ var InterviewWbArea = function() {
 				console.log('changed');
 			}
 		});
+		_updateAreaClass();
 		_inited = true;
 	}
 	function _setRole(_role) {
@@ -64,6 +74,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() {
@@ -75,5 +113,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 dff9e3a..3c34203 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
@@ -338,5 +338,6 @@ var DrawWbArea = function() {
 	self.removeDeleteHandler = function() {
 		$(window).off('keyup', _deleteHandler);
 	};
+	self.updateAreaClass = function() {};
 	return self;
 };
diff --git a/pom.xml b/pom.xml
index 1f6203a..35d9a99 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>
@@ -932,7 +932,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>