public boolean isInternetExplorer() { return info.getProperties().isBrowserInternetExplorer(); }
/** * creates a browser shortcuts to identify old IE versions. * * @param clientProperties current client properties * @return a set of browser shortcuts */ private Set<String> createBrowserShortcut(final ClientProperties clientProperties) { Set<String> shortcut = new HashSet<>(); if (clientProperties.isBrowserInternetExplorer()) { if (clientProperties.getBrowserVersionMajor() < 9) { shortcut.add("lt-ie9"); if (clientProperties.getBrowserVersionMajor() < 8) { shortcut.add("lt-ie8"); if (clientProperties.getBrowserVersionMajor() < 7) { shortcut.add("lt-ie7"); } } } } return shortcut; }
protected boolean isBrowserInternetExplorer() { return WebSession.get().getClientInfo().getProperties().isBrowserInternetExplorer(); }
private IModel<String> createBrowserShortcut(ClientProperties clientProperties) { String shortcut = ""; if (clientProperties.isBrowserInternetExplorer()) { if (clientProperties.getBrowserVersionMajor() < 9) { shortcut += " lt-ie9"; if (clientProperties.getBrowserVersionMajor() < 8) { shortcut += " lt-ie8"; if (clientProperties.getBrowserVersionMajor() < 7) { shortcut += " lt-ie7"; } } } } return Model.of(shortcut); }
protected Fragment createEditablePreview(String fragmentId) { String event = "onfocus"; WebClientInfo info = (WebClientInfo) RequestCycle.get().getClientInfo(); if (info.getProperties().isBrowserInternetExplorer()) { event = "onactivate"; } add(startEditorBehavior = new AjaxEventBehavior(event) { private static final long serialVersionUID = 1L; @Override protected void onEvent(AjaxRequestTarget target) { configuration.setEditorStarted(true); configuration.setFocusAfterLoad(true); target.addComponent(AbstractXinhaPlugin.this); load(); } }); add(previewStyle = new AttributeAppender("class", true, new Model<String>("rte-preview-area"), " ")); add(tabIndex = new AttributeAppender("tabindex", true, new Model<String>("0"), " ")); return createPreview(fragmentId); }
@Override public void renderHead(Component component, IHeaderResponse response) { WebClientInfo info = new WebClientInfo(RequestCycle.get()); if (info.getProperties().isBrowserInternetExplorer()) { String initJS = "try { document.execCommand('BackgroundImageCache', false, true); } catch (e) {};"; response.render(OnDomReadyHeaderItem.forScript(initJS)); } } }
/** * sets the ie specific properties */ private void setInternetExplorerProperties() { properties.setBrowserInternetExplorer(UserAgent.INTERNET_EXPLORER.matches(getUserAgent())); if (properties.isBrowserInternetExplorer()) { // modern IE browsers (>=IE11) uses new user agent format if (getUserAgentStringLc().contains("like gecko")) { setMajorMinorVersionByPattern("rv:(\\d+)\\.(\\d+)"); } else { setMajorMinorVersionByPattern("msie (\\d+)\\.(\\d+)"); } } }
@Override public void renderHead(Component component, IHeaderResponse response) { WebClientInfo info = new WebClientInfo(RequestCycle.get()); if (info.getProperties().isBrowserInternetExplorer()) { response.render(JavaScriptHeaderItem.forReference(JS)); String initJS = "IECursor.fix();"; response.render(OnDomReadyHeaderItem.forScript(initJS)); } } }
if (ci instanceof WebClientInfo) { ClientProperties properties = ((WebClientInfo)ci).getProperties(); if (properties.isBrowserInternetExplorer()) { if (properties.getBrowserVersionMajor() < 7) browserIsIe56 = true;
if (properties.isBrowserInternetExplorer()) { response.renderCSSReference(new ResourceReference(this.getClass(), "res/stylesheets/tag-ie.css")); } else if (properties.isBrowserSafari()) {
if (ci instanceof WebClientInfo) { ClientProperties properties = ((WebClientInfo) ci).getProperties(); if (properties.isBrowserInternetExplorer()) { if (properties.getBrowserVersionMajor() < 7) { this.browserIsIe56 = true;
"res/scripts/tag.js")); if (properties.isBrowserInternetExplorer())
/** * Contributes dependencies needed for proper behavior in older browsers (IE 6-8) * * @param headerResponse the current {@link IHeaderResponse} */ protected void contributeIE8Dependencies(IHeaderResponse headerResponse) { WebClientInfo clientInfo = WebSession.get().getClientInfo(); ClientProperties properties = clientInfo.getProperties(); if (properties.isBrowserInternetExplorer() && properties.getBrowserVersionMajor() < 9) { headerResponse.render(JavaScriptHeaderItem.forReference(RespondJavaScriptReference.instance())); headerResponse.render(JavaScriptHeaderItem.forReference(Html5ShivJavaScriptReference.instance())); } }
@Override public String getName() { RequestCycle requestCycle = RequestCycle.get(); String name = requestCycle.getMetaData(KEY); if (name == null) { WebClientInfo clientInfo; name = getVersion2(); if (Session.exists()) { WebSession session = WebSession.get(); clientInfo = session.getClientInfo(); } else { clientInfo = new WebClientInfo(requestCycle); } ClientProperties clientProperties = clientInfo.getProperties(); if (clientProperties.isBrowserInternetExplorer() && clientProperties.getBrowserVersionMajor() < 9) { name = getVersion1(); } requestCycle.setMetaData(KEY, name); } return name; }
WebClientInfo clientInfo = (WebClientInfo) WebSession.get().getClientInfo(); ClientProperties clientProperties = clientInfo.getProperties(); if (clientProperties.isBrowserInternetExplorer()) { ClientProperties props = extractIEVersion(clientProperties.getNavigatorUserAgent()); enableCodeMirror =