package org.sagebionetworks.web.client;

import org.gwtbootstrap3.extras.bootbox.client.Bootbox;
import org.gwtbootstrap3.extras.bootbox.client.options.DialogOptions;

public class GlobalApplicationStateViewImpl implements
		GlobalApplicationStateView {
	private static final int UNLIMITED_TIME = 0;
	
	@Override
	public void showVersionOutOfDateGlobalMessage() {
		DisplayUtils.showError(DisplayConstants.NEW_VERSION_AVAILABLE, DisplayConstants.NEW_VERSION_INSTRUCTIONS, UNLIMITED_TIME);
	}
	
	@Override
	public void initGlobalViewProperties() {
		DialogOptions options = DialogOptions.newOptions("");
		options.setAnimate(false);
		Bootbox.setDefaults(options);
	}
}

@@ -161,16 +161,151 @@
 tions;%0A%0A
+import com.google.gwt.user.client.Window;%0Aimport com.google.gwt.user.client.ui.Frame;%0Aimport com.google.gwt.user.client.ui.RootPanel;%0A%0A
 public c
@@ -429,16 +429,29 @@
 E = 0;%0A%09
+Frame iframe;
 %0A%09@Overr
@@ -630,16 +630,39 @@
 _TIME);%0A
+%09%09preloadNewVersion();%0A
 %09%7D%0A%09%0A%09@O
@@ -796,16 +796,16 @@
 false);%0A
-
 %09%09Bootbo
@@ -831,10 +831,282 @@
 ns);%0A%09%7D%0A
+%09%0A%09public void preloadNewVersion() %7B%0A%09%09if (iframe == null) %7B%0A%09%09%09String currentURL = Window.Location.getHref();%0A%09%09%09iframe = new Frame(currentURL);%0A%09%09%09iframe.setWidth(%221px%22);%0A%09%09%09iframe.setHeight(%221px%22);%0A%09%09%09RootPanel.getBodyElement().appendChild(iframe.getElement());%0A%09%09%7D%0A%09%7D%0A
 %7D%0A

load current url in iframe if version changes