Skip to content
Permalink
Fetching contributors…
Cannot retrieve contributors at this time
77 lines (68 sloc) 3.93 KB
<%@ include file="/init.jsp" %>
<%@ page import="com.liferay.portal.kernel.servlet.BrowserSnifferUtil" %>
<%@ page import="com.liferay.portal.kernel.util.SessionParamUtil" %>
<%@ page import="com.liferay.portal.kernel.theme.ThemeDisplay" %>
<%@ page import="com.liferay.portal.kernel.util.WebKeys" %>
<%@ page import="com.liferay.portal.kernel.util.PortalUtil" %>
<%@ page import="com.liferay.portal.kernel.util.ParamUtil" %>
<%
String browser = BrowserSnifferUtil.getBrowserId(request);
float version = BrowserSnifferUtil.getMajorVersion(request);
boolean isWebkit = BrowserSnifferUtil.isWebKit(request);
boolean isSafari = BrowserSnifferUtil.isSafari(request);
boolean hasModule = ( version >= 16 && BrowserSnifferUtil.isEdge (request) )
|| ( version >= 60 && BrowserSnifferUtil.isFirefox (request) )
|| ( version >= 61 && BrowserSnifferUtil.isChrome (request) )
|| ( version >= 11 && BrowserSnifferUtil.isSafari (request) )
|| ( version >= 48 && BrowserSnifferUtil.isOpera (request) )
;
boolean hasWebComponent
= ( version >= 75 && BrowserSnifferUtil.isEdge (request) )
|| ( version >= 63 && BrowserSnifferUtil.isFirefox (request) )
|| ( version >= 67 && BrowserSnifferUtil.isChrome (request) )
|| ( version >= 12.1 && BrowserSnifferUtil.isSafari (request) )
|| ( version >= 58 && BrowserSnifferUtil.isOpera (request) )
;
String jsProfile = (hasModule && hasWebComponent) ? "esm-bundled" : hasWebComponent? "es6-bundled": "es5-bundled";
boolean themeJsFastLoad = themeDisplay.isThemeJsFastLoad();// SessionParamUtil.getBoolean( request, "js_fast_load", false );
if( !themeJsFastLoad && hasModule && hasWebComponent )
jsProfile = "esm-unbundled";
String jsBundle = ParamUtil.getString(PortalUtil.getOriginalServletRequest(request), "jsBundle");
if( null!= jsBundle && jsBundle.length()>0 )
jsProfile = jsBundle;
%>
<script src="<%= request.getContextPath() %>/js/main.js" type="text/javascript"></script>
<link href="<%= request.getContextPath() %>/css/main.css" rel="stylesheet">
<p class="polymer-portlet">
<img src="<%= request.getContextPath() %>/image/p-logo.svg" />
<b><liferay-ui:message key="polymer.caption"/></b>
<img src="<%= request.getContextPath() %>/image/logoLiferay.svg" />
</p>
Browser: <%=browser%> <%=version%> <%=isWebkit?"Webkit":""%> <%=isSafari?"Safari":""%> &bull;
Selected bundle: <b><%=jsProfile%></b>
| <a href="./?jsBundle=esm-unbundled">esm-unbundled</a>
| <a href="./?jsBundle=esm-bundled">esm-bundled</a>
| <a href="./?jsBundle=es6-bundled">es6-bundled</a>
| <a href="./?jsBundle=es5-bundled">es5-bundled</a>
&bull; Debug: <a href="./?js_fast_load=0&css_fast_load=0&strip=0">js_fast_load=0</a>
<%--<base href="<%=currentURL%>"/>--%>
<%--<j sp:include page="/polymer3-demo/build/${ jsProfile }/index.html" flush="true" />--%>
<%--<j sp:include page="/polymer3-demo/build/<%= jsProfile %>/index.html" flush="true" />--%>
<% if( !hasModule ) { %><script src="<%=request.getContextPath()%>/polymer3-demo/build/<%=jsProfile%>/node_modules/@babel/polyfill/dist/polyfill.min.js"></script><% }%>
<% if("esm-unbundled".equals(jsProfile) ) { %><jsp:include page="/polymer3-demo/build/esm-unbundled/index.html" /><% }%>
<% if("esm-bundled" .equals(jsProfile) ) { %><jsp:include page="/polymer3-demo/build/esm-bundled/index.html" /><% }%>
<% if("es6-bundled" .equals(jsProfile) ) { %><jsp:include page="/polymer3-demo/build/es6-bundled/index.html" /><% }%>
<% if("es5-bundled" .equals(jsProfile) ) { %><jsp:include page="/polymer3-demo/build/es5-bundled/index.html" /><% }%>
<% if( hasModule ) { %>
<script>
$( function()
{ $( 'script[type="module"]' ).each( function(n,el)
{ el.injected || $('<'+'script type="module"><'+'/script>')
.prop('injected', el.injected =1 )
.attr('src', el.src )
.insertAfter( el );
});
});
</script>
<% }%>
<polymer3-demo-app root-path="<%= request.getContextPath() %>/polymer3-demo/"></polymer3-demo-app>
You can’t perform that action at this time.