openmeetings-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From solo...@apache.org
Subject openmeetings git commit: no jira: multiuser room enter is improved, hidden WB is displayed as expected
Date Wed, 05 Jul 2017 08:49:45 GMT
Repository: openmeetings
Updated Branches:
  refs/heads/master 29274d1dd -> dd6fddbf1


no jira: multiuser room enter is improved, hidden WB is displayed as expected


Project: http://git-wip-us.apache.org/repos/asf/openmeetings/repo
Commit: http://git-wip-us.apache.org/repos/asf/openmeetings/commit/dd6fddbf
Tree: http://git-wip-us.apache.org/repos/asf/openmeetings/tree/dd6fddbf
Diff: http://git-wip-us.apache.org/repos/asf/openmeetings/diff/dd6fddbf

Branch: refs/heads/master
Commit: dd6fddbf1a8b76d10c806802029663289dd2bdbc
Parents: 29274d1
Author: Maxim Solodovnik <solomax666@gmail.com>
Authored: Wed Jul 5 15:49:37 2017 +0700
Committer: Maxim Solodovnik <solomax666@gmail.com>
Committed: Wed Jul 5 15:49:37 2017 +0700

----------------------------------------------------------------------
 .../openmeetings/web/common/MainPanel.java      | 57 ++++++++++----------
 .../apache/openmeetings/web/pages/MainPage.java |  9 ++--
 .../apache/openmeetings/web/room/RoomPanel.java |  2 +
 .../openmeetings/web/room/wb/WbPanel.java       |  8 ++-
 .../org/apache/openmeetings/web/room/wb/wb.js   | 17 +++++-
 5 files changed, 56 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/openmeetings/blob/dd6fddbf/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/MainPanel.java
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/MainPanel.java
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/MainPanel.java
index edd8c9f..3202b79 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/MainPanel.java
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/MainPanel.java
@@ -102,11 +102,11 @@ public class MainPanel extends Panel {
 	private static final WebMarkupContainer EMPTY = new WebMarkupContainer(CHILD_ID);
 	public static final String PARAM_USER_ID = "userId";
 	private String uid = null;
-	private final MenuPanel menu = new MenuPanel("menu", getMainMenu());
+	private final MenuPanel menu;
 	private final WebMarkupContainer topControls = new WebMarkupContainer("topControls");
 	private final WebMarkupContainer topLinks = new WebMarkupContainer("topLinks");
-	private final MarkupContainer contents = new WebMarkupContainer("contents");
-	private final ChatPanel chat = new ChatPanel("chatPanel");
+	private final MarkupContainer contents;
+	private final ChatPanel chat;
 	private final MessageDialog newMessage;
 	private final UserInfoDialog userInfo;
 	private BasePanel panel;
@@ -128,27 +128,10 @@ public class MainPanel extends Panel {
 		super(id);
 		this.panel = _panel;
 		setOutputMarkupId(true);
-		add(chat);
-		add(newMessage = new MessageDialog("newMessageDialog", new CompoundPropertyModel<>(new
PrivateMessage())) {
-			private static final long serialVersionUID = 1L;
-
-			@Override
-			public void onClose(IPartialPageRequestHandler handler, DialogButton button) {
-				BasePanel bp = getCurrentPanel();
-				if (send.equals(button) && bp != null) {
-					bp.onNewMessageClose(handler);
-				}
-			}
-		});
-		add(userInfo = new UserInfoDialog("userInfoDialog", newMessage));
-		add(new OmAjaxClientInfoBehavior());
-	}
-
-	@Override
-	protected void onInitialize() {
-		super.onInitialize();
 		add(topControls.setOutputMarkupPlaceholderTag(true).setMarkupId("topControls"));
-		add(contents.add(getClient() == null ? EMPTY : panel).setOutputMarkupId(true).setMarkupId("contents"));
+		menu = new MenuPanel("menu", getMainMenu());
+		contents = new WebMarkupContainer("contents");
+		add(contents.add(getClient() == null || _panel == null ? EMPTY : _panel).setOutputMarkupId(true).setMarkupId("contents"));
 		topControls.add(menu.setVisible(false), topLinks.setVisible(false).setOutputMarkupPlaceholderTag(true).setMarkupId("topLinks"));
 		topLinks.add(new AjaxLink<Void>("messages") {
 			private static final long serialVersionUID = 1L;
@@ -175,21 +158,24 @@ public class MainPanel extends Panel {
 				about.open(target);
 			}
 		});
-		add(about);
 		if (getApplication().getDebugSettings().isDevelopmentUtilitiesEnabled()) {
 			add(new DebugBar("dev").setOutputMarkupId(true));
 		} else {
 			add(new EmptyPanel("dev").setVisible(false));
 		}
-		topLinks.add(new ConfirmableAjaxBorder("logout", getString("310"), getString("634")) {
+		add(about, chat = new ChatPanel("chatPanel"));
+		add(newMessage = new MessageDialog("newMessageDialog", new CompoundPropertyModel<>(new
PrivateMessage())) {
 			private static final long serialVersionUID = 1L;
 
 			@Override
-			protected void onSubmit(AjaxRequestTarget target) {
-				getSession().invalidate();
-				setResponsePage(Application.get().getSignInPageClass());
+			public void onClose(IPartialPageRequestHandler handler, DialogButton button) {
+				BasePanel bp = getCurrentPanel();
+				if (send.equals(button) && bp != null) {
+					bp.onNewMessageClose(handler);
+				}
 			}
 		});
+		add(userInfo = new UserInfoDialog("userInfoDialog", newMessage));
 		add(new AbstractDefaultAjaxBehavior() {
 			private static final long serialVersionUID = 1L;
 
@@ -284,6 +270,21 @@ public class MainPanel extends Panel {
 				}
 			}
 		});
+		add(new OmAjaxClientInfoBehavior());
+	}
+
+	@Override
+	protected void onInitialize() {
+		super.onInitialize();
+		topLinks.add(new ConfirmableAjaxBorder("logout", getString("310"), getString("634")) {
+			private static final long serialVersionUID = 1L;
+
+			@Override
+			protected void onSubmit(AjaxRequestTarget target) {
+				getSession().invalidate();
+				setResponsePage(Application.get().getSignInPageClass());
+			}
+		});
 	}
 
 	private static int getLevel() {

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/dd6fddbf/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/MainPage.java
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/MainPage.java
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/MainPage.java
index cdbd0e0..12f8b8f 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/MainPage.java
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/MainPage.java
@@ -41,13 +41,12 @@ import org.apache.wicket.util.time.Duration;
 @AuthorizeInstantiation({"Admin", "Dashboard", "Room"})
 public class MainPage extends BaseInitedPage {
 	private static final long serialVersionUID = 1L;
-	private AbstractAjaxTimerBehavior areaBehavior;
+	private final AbstractAjaxTimerBehavior areaBehavior;
 	private final MainPanel main = new MainPanel("main");
-	private InviteUserToRoomDialog inviteUser;
+	private final InviteUserToRoomDialog inviteUser;
 
-	@Override
-	protected void onInitialize() {
-		super.onInitialize();
+	public MainPage() {
+		super();
 		getHeader().setVisible(false);
 		add(main, inviteUser = new InviteUserToRoomDialog("invite-to-room"));
 		//load preselected content

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/dd6fddbf/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
index f3550ac..f64d9f6 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/RoomPanel.java
@@ -27,6 +27,7 @@ import static org.apache.openmeetings.web.app.Application.getOnlineClient;
 import static org.apache.openmeetings.web.app.Application.getRoomClients;
 import static org.apache.openmeetings.web.app.WebSession.getDateFormat;
 import static org.apache.openmeetings.web.app.WebSession.getUserId;
+import static org.apache.openmeetings.web.room.wb.WbPanel.WB_JS_REFERENCE;
 
 import java.util.Calendar;
 import java.util.List;
@@ -581,6 +582,7 @@ public class RoomPanel extends BasePanel {
 		super.renderHead(response);
 		response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forReference(new JavaScriptResourceReference(RoomPanel.class,
"jquery.dialogextend.js"))));
 		response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forReference(new JavaScriptResourceReference(RoomPanel.class,
"room.js"))));
+		response.render(JavaScriptHeaderItem.forReference(WB_JS_REFERENCE));
 		WebSession ws = WebSession.get();
 		if (!Strings.isEmpty(r.getRedirectURL()) && (ws.getSoapLogin() != null || ws.getInvitation()
!= null)) {
 			response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forScript(

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/dd6fddbf/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/WbPanel.java
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/WbPanel.java
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/WbPanel.java
index 85424fb..d542e45 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/WbPanel.java
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/WbPanel.java
@@ -95,11 +95,12 @@ public class WbPanel extends Panel {
 	public static final String FUNC_ACTION = "wbAction";
 	public static final String PARAM_ACTION = "action";
 	public static final String PARAM_OBJ = "obj";
-	private final static ResourceReference WB_JS_REFERENCE = new JavaScriptResourceReference(WbPanel.class,
"wb.js");
+	public final static ResourceReference WB_JS_REFERENCE = new JavaScriptResourceReference(WbPanel.class,
"wb.js");
 	private final static ResourceReference FABRIC_JS_REFERENCE = new JavaScriptResourceReference(WbPanel.class,
"fabric.js");
 	private final Long roomId;
 	private final RoomPanel rp;
 	private long wb2save = -1;
+	private boolean inited = false;
 	private enum Action {
 		createWb
 		, removeWb
@@ -125,6 +126,9 @@ public class WbPanel extends Panel {
 
 		@Override
 		protected void respond(AjaxRequestTarget target) {
+			if (!inited) {
+				return;
+			}
 			try {
 				Action a = Action.valueOf(getRequest().getRequestParameters().getParameterValue(PARAM_ACTION).toString());
 				StringValue sv = getRequest().getRequestParameters().getParameterValue(PARAM_OBJ);
@@ -335,6 +339,7 @@ public class WbPanel extends Panel {
 			}
 			sb.append("WbArea.activateWb({wbId: ").append(wbs.getActiveWb()).append("});");
 			target.appendJavaScript(sb);
+			inited = true;
 		}
 	};
 
@@ -365,7 +370,6 @@ public class WbPanel extends Panel {
 	public void renderHead(IHeaderResponse response) {
 		super.renderHead(response);
 		response.render(JavaScriptHeaderItem.forReference(FABRIC_JS_REFERENCE));
-		response.render(JavaScriptHeaderItem.forReference(WB_JS_REFERENCE));
 		response.render(new PriorityHeaderItem(getNamedFunction(FUNC_ACTION, wbAction, explicit(PARAM_ACTION),
explicit(PARAM_OBJ))));
 		response.render(OnDomReadyHeaderItem.forScript(wbLoad.getCallbackScript()));
 	}

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/dd6fddbf/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/wb.js
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/wb.js b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/wb.js
index 4cf6481..d10581c 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/wb.js
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/wb.js
@@ -1103,7 +1103,7 @@ var Wb = function() {
 	return wb;
 };
 var WbArea = (function() {
-	var container, area, tabs, scroll, role = NONE, self = {};
+	var container, area, tabs, scroll, role = NONE, self = {}, _inited = false;
 
 	function refreshTabs() {
 		tabs.tabs("refresh").find('ul').removeClass('ui-corner-all').removeClass('ui-widget-header');
@@ -1192,6 +1192,7 @@ var WbArea = (function() {
 		return self.getWb(id).getCanvas();
 	};
 	self.setRole = function(_role) {
+		if (!_inited) return;
 		role = _role;
 		var tabsNav = tabs.find(".ui-tabs-nav");
 		tabsNav.sortable(role === PRESENTER ? "enable" : "disable");
@@ -1251,12 +1252,14 @@ var WbArea = (function() {
 				refreshTabs();
 			}
 		});
+		_inited = true;
 		self.setRole(role);
 	};
 	self.destroy = function() {
 		$(window).off('keyup', deleteHandler);
 	};
 	self.create = function(obj) {
+		if (!_inited) return;
 		var tid = self.getWbTabId(obj.wbId)
 			, li = $('#wb-area-tab').clone().attr('id', '').data('wb-id', obj.wbId)
 			, wb = $('#wb-area').clone().attr('id', tid);
@@ -1273,43 +1276,53 @@ var WbArea = (function() {
 		_resizeWbs();
 	}
 	self.createWb = function(obj) {
+		if (!_inited) return;
 		self.create(obj);
 		self.setRole(role);
 		_activateTab(obj.wbId);
 	};
 	self.activateWb = function(obj) {
+		if (!_inited) return;
 		_activateTab(obj.wbId);
 	}
 	self.load = function(json) {
+		if (!_inited) return;
 		self.getWb(json.wbId).load(json.obj);
 	};
 	self.setSlide = function(json) {
+		if (!_inited) return;
 		self.getWb(json.wbId).setSlide(json.slide);
 	};
 	self.createObj = function(json) {
+		if (!_inited) return;
 		self.getWb(json.wbId).createObj(json.obj);
 	};
 	self.modifyObj = function(json) {
+		if (!_inited) return;
 		self.getWb(json.wbId).modifyObj(json.obj);
 	};
 	self.deleteObj = function(json) {
+		if (!_inited) return;
 		self.getWb(json.wbId).removeObj(json.obj);
 	};
 	self.clearAll = function(json) {
+		if (!_inited) return;
 		self.getWb(json.wbId).clearAll();
 		setRoomSizes();
 	};
 	self.clearSlide = function(json) {
+		if (!_inited) return;
 		self.getWb(json.wbId).clearSlide(json.slide);
 	};
 	self.removeWb = function(obj) {
+		if (!_inited) return;
 		var tabId = self.getWbTabId(obj.wbId);
 		tabs.find('li[aria-controls="' + tabId + '"]').remove();
 		$("#" + tabId).remove();
 		refreshTabs();
 	};
 	self.resize = function(posX, w, h) {
-		if (!container) return;
+		if (!container || !_inited) return;
 		var hh = h - 5;
 		container.width(w).height(h).css('left', posX + "px");
 		area.width(w).height(hh);


Mime
View raw message