Search in sources :

Example 6 with WebClientInfo

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;
}
Also used : WebClientInfo(org.apache.wicket.protocol.http.request.WebClientInfo) ClientProperties(org.apache.wicket.protocol.http.ClientProperties) WebSession(org.apache.wicket.protocol.http.WebSession) RequestCycle(org.apache.wicket.request.cycle.RequestCycle)

Example 7 with WebClientInfo

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;
}
Also used : WebClientInfo(org.apache.wicket.protocol.http.request.WebClientInfo) ClientProperties(org.apache.wicket.protocol.http.ClientProperties) RequestCycleSettings(org.apache.wicket.settings.RequestCycleSettings)

Example 8 with WebClientInfo

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);
}
Also used : WebClientInfo(org.apache.wicket.protocol.http.request.WebClientInfo) RequestCycle(org.apache.wicket.request.cycle.RequestCycle) IRequestParameters(org.apache.wicket.request.IRequestParameters)

Example 9 with WebClientInfo

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")));
        }
    });
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) WebClientInfo(org.apache.wicket.protocol.http.request.WebClientInfo) OmAjaxClientInfoBehavior(org.apache.openmeetings.web.common.OmAjaxClientInfoBehavior)

Aggregations

WebClientInfo (org.apache.wicket.protocol.http.request.WebClientInfo)9 RequestCycle (org.apache.wicket.request.cycle.RequestCycle)4 ClientProperties (org.apache.wicket.protocol.http.ClientProperties)3 OmAjaxClientInfoBehavior (org.apache.openmeetings.web.common.OmAjaxClientInfoBehavior)2 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)2 WebSession (org.apache.wicket.protocol.http.WebSession)2 GitClientApplication (com.gitblit.models.GitClientApplication)1 RepositoryUrl (com.gitblit.models.RepositoryUrl)1 ExternalImage (com.gitblit.wicket.ExternalImage)1 JQueryBehavior (com.googlecode.wicket.jquery.core.JQueryBehavior)1 DialogButton (com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton)1 MessageDialog (com.googlecode.wicket.jquery.ui.widget.dialog.MessageDialog)1 ArrayList (java.util.ArrayList)1 FastDateFormat (org.apache.commons.lang3.time.FastDateFormat)1 IWsClient (org.apache.openmeetings.db.entity.basic.IWsClient)1 WsClient (org.apache.openmeetings.db.entity.basic.WsClient)1 Recording (org.apache.openmeetings.db.entity.record.Recording)1 Invitation (org.apache.openmeetings.db.entity.room.Invitation)1 Room (org.apache.openmeetings.db.entity.room.Room)1 WebSession (org.apache.openmeetings.web.app.WebSession)1