openmeetings-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From solo...@apache.org
Subject openmeetings git commit: Hand-made delayed-load is removed
Date Fri, 05 Jan 2018 18:25:41 GMT
Repository: openmeetings
Updated Branches:
  refs/heads/wicket-defer-all [created] e6eddcbaf


Hand-made delayed-load is removed


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

Branch: refs/heads/wicket-defer-all
Commit: e6eddcbaf13425cc56b243b576f3521d6148aa07
Parents: e4847e6
Author: Maxim Solodovnik <solomax666@gmail.com>
Authored: Sat Jan 6 01:25:22 2018 +0700
Committer: Maxim Solodovnik <solomax666@gmail.com>
Committed: Sat Jan 6 01:25:22 2018 +0700

----------------------------------------------------------------------
 .../openmeetings/web/common/MainPanel.html      | 25 +++++++++------
 .../apache/openmeetings/web/pages/MainPage.java | 32 ++------------------
 .../openmeetings/web/pages/auth/SignInPage.html | 13 ++++++--
 3 files changed, 29 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/openmeetings/blob/e6eddcba/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/MainPanel.html
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/MainPanel.html
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/MainPanel.html
index a0f8232..e13f121 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/MainPanel.html
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/MainPanel.html
@@ -30,15 +30,22 @@
 </wicket:head>
 <wicket:panel>
 	<script type="text/javascript">
-		$(function() {
-			Wicket.Event.subscribe(Wicket.Event.Topic.AJAX_CALL_FAILURE, hideBusyIndicator);
-			Wicket.Event.subscribe(Wicket.Event.Topic.AJAX_CALL_BEFORE, showBusyIndicator);
-			Wicket.Event.subscribe(Wicket.Event.Topic.AJAX_CALL_SUCCESS, hideBusyIndicator);
-			Wicket.Event.subscribe(Wicket.Event.Topic.AJAX_CALL_COMPLETE, hideBusyIndicator);
-			Wicket.Event.subscribe(Wicket.Event.Topic.WebSocket.Opened, function() {
-				Wicket.WebSocket.send("socketConnected");
-			});
-		});
+		(function () {
+			const f = function() {
+				Wicket.Event.subscribe(Wicket.Event.Topic.AJAX_CALL_FAILURE, hideBusyIndicator);
+				Wicket.Event.subscribe(Wicket.Event.Topic.AJAX_CALL_BEFORE, showBusyIndicator);
+				Wicket.Event.subscribe(Wicket.Event.Topic.AJAX_CALL_SUCCESS, hideBusyIndicator);
+				Wicket.Event.subscribe(Wicket.Event.Topic.AJAX_CALL_COMPLETE, hideBusyIndicator);
+				Wicket.Event.subscribe(Wicket.Event.Topic.WebSocket.Opened, function() {
+					Wicket.WebSocket.send("socketConnected");
+				});
+			};
+			if ('complete' === document.readyState) {
+				f();
+			} else {
+				window.addEventListener('load', f);
+			}
+		})();
 	</script>
 	<div wicket:id="topControls">
 		<div wicket:id="topLinks"><span

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/e6eddcba/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 92db807..dba29a5 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
@@ -22,15 +22,10 @@ import org.apache.openmeetings.web.app.WebSession;
 import org.apache.openmeetings.web.common.MainPanel;
 import org.apache.openmeetings.web.util.OmUrlFragment;
 import org.apache.wicket.ajax.AbstractAjaxTimerBehavior;
-import org.apache.wicket.ajax.AbstractDefaultAjaxBehavior;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.authroles.authorization.strategies.role.annotations.AuthorizeInstantiation;
-import org.apache.wicket.behavior.Behavior;
 import org.apache.wicket.core.request.handler.IPartialPageRequestHandler;
-import org.apache.wicket.markup.head.IHeaderResponse;
-import org.apache.wicket.markup.head.OnDomReadyHeaderItem;
 import org.apache.wicket.markup.html.WebMarkupContainer;
-import org.apache.wicket.markup.html.panel.EmptyPanel;
 import org.apache.wicket.request.IRequestParameters;
 import org.apache.wicket.util.time.Duration;
 
@@ -51,29 +46,13 @@ public class MainPage extends BaseInitedPage {
 		}
 	};
 	private final MainPanel main = new MainPanel(MAIN_PANEL_ID);
-	private final AbstractDefaultAjaxBehavior delayedLoad = new AbstractDefaultAjaxBehavior()
{
-		private static final long serialVersionUID = 1L;
-
-		@Override
-		protected void respond(AjaxRequestTarget target) {
-			target.add(
-				mainContainer.replace(main)
-				.add(areaBehavior, new Behavior() {
-					private static final long serialVersionUID = 1L;
-
-					@Override
-					public void renderHead(org.apache.wicket.Component component, IHeaderResponse response)
{
-						internalRenderHead(response);
-					}
-				}));
-		}
-	};
 
 	public MainPage() {
 		super();
 		getHeader().setVisible(false);
-		add(mainContainer.add(new EmptyPanel(MAIN_PANEL_ID)).setOutputMarkupId(true));
-		add(delayedLoad);
+		add(mainContainer.add(main).setOutputMarkupId(true));
+		//add(delayedLoad);
+		add(areaBehavior);
 	}
 
 	public void updateContents(OmUrlFragment f, IPartialPageRequestHandler handler) {
@@ -93,9 +72,4 @@ public class MainPage extends BaseInitedPage {
 			main.updateContents(uf, target, false);
 		}
 	}
-
-	@Override
-	public void renderHead(IHeaderResponse response) {
-		response.render(OnDomReadyHeaderItem.forScript(delayedLoad.getCallbackScript()));
-	}
 }

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/e6eddcba/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/auth/SignInPage.html
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/auth/SignInPage.html
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/auth/SignInPage.html
index 42b1893..276fedf 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/auth/SignInPage.html
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/auth/SignInPage.html
@@ -31,9 +31,16 @@
 	</wicket:head>
 	<wicket:extend>
 		<script type="text/javascript">
-			$(function(){
-				$('#area').val(location.hash);
-			});
+			(function () {
+				const f = function() {
+					$('#area').val(location.hash);
+				};
+				if ('complete' === document.readyState) {
+					f();
+				} else {
+					window.addEventListener('load', f);
+				}
+			})();
 		</script>
 		<div wicket:id="signin"></div>
 		<div wicket:id="register"></div>


Mime
View raw message