use of org.apache.wicket.protocol.http.request.WebClientInfo in project webanno by webanno.
the class ApplicationPageBase method isBrowserWarningVisible.
private boolean isBrowserWarningVisible(Properties settings) {
RequestCycle requestCycle = RequestCycle.get();
WebClientInfo clientInfo;
if (Session.exists()) {
WebSession session = WebSession.get();
clientInfo = session.getClientInfo();
} else {
clientInfo = new WebClientInfo(requestCycle);
}
ClientProperties clientProperties = clientInfo.getProperties();
boolean isUsingUnsupportedBrowser = !clientProperties.isBrowserSafari() && !clientProperties.isBrowserChrome();
boolean ignoreWarning = "false".equalsIgnoreCase(settings.getProperty(SettingsUtil.CFG_WARNINGS_UNSUPPORTED_BROWSER));
return isUsingUnsupportedBrowser && !ignoreWarning;
}
use of org.apache.wicket.protocol.http.request.WebClientInfo in project wicket by apache.
the class AjaxHelloBrowser method getClientProperties.
/**
* A helper function that makes sure that gathering of extended browser info
* is not enabled when reading the ClientInfo's properties
*
* @return the currently available client info
*/
private ClientProperties getClientProperties() {
RequestCycleSettings requestCycleSettings = getApplication().getRequestCycleSettings();
boolean gatherExtendedBrowserInfo = requestCycleSettings.getGatherExtendedBrowserInfo();
ClientProperties properties = null;
try {
requestCycleSettings.setGatherExtendedBrowserInfo(false);
WebClientInfo clientInfo = (WebClientInfo) getSession().getClientInfo();
properties = clientInfo.getProperties();
} finally {
requestCycleSettings.setGatherExtendedBrowserInfo(gatherExtendedBrowserInfo);
}
return properties;
}
use of org.apache.wicket.protocol.http.request.WebClientInfo in project wicket by apache.
the class AjaxClientInfoBehavior method onTimer.
@Override
protected final void onTimer(AjaxRequestTarget target) {
stop(target);
RequestCycle requestCycle = RequestCycle.get();
IRequestParameters requestParameters = requestCycle.getRequest().getRequestParameters();
WebClientInfo clientInfo = newWebClientInfo(requestCycle);
clientInfo.getProperties().read(requestParameters);
Session.get().setClientInfo(clientInfo);
onClientInfo(target, clientInfo);
}
use of org.apache.wicket.protocol.http.request.WebClientInfo in project openmeetings by apache.
the class NetTestPanel method onInitialize.
@Override
protected void onInitialize() {
super.onInitialize();
add(new OmAjaxClientInfoBehavior() {
private static final long serialVersionUID = 1L;
@Override
protected void onClientInfo(AjaxRequestTarget target, WebClientInfo info) {
super.onClientInfo(target, info);
target.appendJavaScript(String.format("NetTest.init(%s);", getStringLabels("network.test.ms", "network.test.mb", "network.test.sec", "network.test.click.play", "network.test.copy.log", "network.test.report", "network.test.report.start", "network.test.report.error", "network.test.report.con.err", "network.test.ping", "network.test.ping.avg", "network.test.ping.rcv", "network.test.ping.lost", "network.test.ping.load", "network.test.port", "network.test.port.avail", "network.test.port.stopped", "network.test.jitter", "network.test.jitter.avg", "network.test.jitter.min", "network.test.jitter.max", "network.test.dwn", "network.test.dwn.bytes", "network.test.dwn.time", "network.test.dwn.speed", "network.test.upl", "network.test.upl.bytes", "network.test.upl.time", "network.test.upl.speed")));
}
});
}
Aggregations