/** * Factory method for CSS resources. * * @param aPP * The path provider. * @param bRegular * <code>true</code> for regular version, <code>false</code> for the * minified/optimized version. * @return New {@link WebSiteResourceWithCondition} object. Never * <code>null</code>. */ @Nonnull public static WebSiteResourceWithCondition createForCSS (@Nonnull final ICSSPathProvider aPP, final boolean bRegular) { return createForCSS (aPP.getCSSItemPath (bRegular), aPP.getConditionalComment (), aPP.isBundlable (), aPP.getMediaList ()); }
@Nonnull public static IHCNode getCSSNode (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope, @Nonnull final ICSSPathProvider aCSS, final boolean bRegular) { final HCLink aLink = HCLink.createCSSLink (PhotonHTMLSettings.getCSSPath (aRequestScope, aCSS, bRegular)) .setMedia (aCSS.getMediaList ()) .setPathProvider (aCSS); final String sConditionalComment = aCSS.getConditionalComment (); if (StringHelper.hasText (sConditionalComment)) return new HCConditionalCommentNode (sConditionalComment, aLink); return aLink; }
@Nonnull public static ISimpleURL getCSSPath (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope, @Nonnull final ICSSPathProvider aCSS, final boolean bRegular) { final String sPath = aCSS.getCSSItemPath (bRegular); return getURIToURLConverter ().getAsURL (aRequestScope, sPath); }
public static void addCSSAndJS (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope, @Nonnull final HCSpecialNodes aSpecialNodes) { ValueEnforcer.notNull (aRequestScope, "RequestScope"); // Grab per-request CSS/JS only in success case! // Grab all CSS/JS independent of conditional comment :( final boolean bRegular = HCSettings.isUseRegularResources (); for (final ICSSPathProvider aCSS : PhotonCSS.getAllRegisteredCSSIncludesForThisRequest ()) aSpecialNodes.addExternalCSS (aCSS.getMediaList (), PhotonHTMLSettings.getCSSPath (aRequestScope, aCSS, bRegular) .getAsStringWithEncodedParameters ()); for (final IJSPathProvider aJS : PhotonJS.getAllRegisteredJSIncludesForThisRequest ()) aSpecialNodes.addExternalJS (PhotonHTMLSettings.getJSPath (aRequestScope, aJS, bRegular) .getAsStringWithEncodedParameters ()); }