public static void checkForMaximumCSSResources (final int nCSSExternals) { // Sources: // http://acidmartin.wordpress.com/2008/11/25/the-32-external-css-files-limitation-of-internet-explorer-and-more/ // http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/thread/ad1b6e88-bbfa-4cc4-9e95-3889b82a7c1d if (nCSSExternals > MAX_CSS_IE) consistencyError ("You are including more than 31 CSS files (" + nCSSExternals + ") in your request, which will be ignored by Internet Explorer (at least up to version 8)!"); } }
/** * Constructor * * @param eHTMLVersion * The HTML version to use. May not be <code>null</code>. */ public HCConversionSettings (@Nonnull final EHTMLVersion eHTMLVersion) { setHTMLVersion (eHTMLVersion); setToDefault (); }
@Override @OverrideOnDemand @OverridingMethodsMustInvokeSuper public void after () { HCSettings.setOnDocumentReadyProvider (new DefaultHCOnDocumentReadyProvider ()); HCSettings.getMutableConversionSettings ().setToDefault (); } }
@Override @OverrideOnDemand @OverridingMethodsMustInvokeSuper public void before () { HCSettings.setDefaultHTMLVersion (EHTMLVersion.XHTML11); HCSettings.getMutableConversionSettings ().setToOptimized (); HCSettings.setOnDocumentReadyProvider (aJSCodeProvider -> new UnparsedJSCodeProvider ("$(document).ready(function(){" + aJSCodeProvider.getJSCode () + "});")); }
@OverridingMethodsMustInvokeSuper public HCConversionSettings setToOptimized () { setXMLWriterSettingsOptimized (true); setCSSWriterSettingsOptimized (true); setJSWriterSettingsOptimized (true); m_bConsistencyChecksEnabled = false; return this; }
/** * @return The global read-only non-<code>null</code> conversion settings with * XML namespaces disabled */ @Nonnull public static HCConversionSettings getConversionSettingsWithoutNamespaces () { // Create a copy!! final HCConversionSettings aCS = getMutableConversionSettings ().getClone (); // And modify the copied XML settings aCS.getXMLWriterSettings ().setEmitNamespaces (false); return aCS; }
/** * Convert the passed HC node to an HTML string using the default conversion * settings. * * @param aHCNode * The node to be converted. May not be <code>null</code>. * @return The node as XML with or without indentation. */ @Nonnull public static String getAsHTMLString (@Nonnull final IHCNode aHCNode) { return getAsHTMLString (aHCNode, HCSettings.getConversionSettings ()); }
/** * @return The global read-only non-<code>null</code> conversion settings */ @Nonnull public static IHCConversionSettings getConversionSettings () { return getMutableConversionSettings (); }
@OverridingMethodsMustInvokeSuper @Nonnull public HCConversionSettings setToDefault () { // There is no such thing as a default HTML version m_aXMLWriterSettings = createDefaultXMLWriterSettings (m_eHTMLVersion); m_aCSSWriterSettings = createDefaultCSSWriterSettings (); m_aJSWriterSettings = createDefaultJSWriterSettings (); m_bConsistencyChecksEnabled = DEFAULT_CONSISTENCY_CHECKS; m_bExtractOutOfBandNodes = DEFAULT_EXTRACT_OUT_OF_BAND_NODES; m_aCustomizer = createDefaultCustomizer (); return this; }
@Nonnull public HCScriptInlineOnDocumentReady setOnDocumentReadyCode (@Nonnull final IHasJSCode aOnDocumentReadyCode) { return setOnDocumentReadyCode (HCSettings.getOnDocumentReadyProvider (), aOnDocumentReadyCode); }
public void initHCSettings () { HCSettings.setOnDocumentReadyProvider (new JQueryOnDocumentReadyProvider ()); } }
public HCEditPassword () { super (EHCInputType.PASSWORD); if (HCSettings.isAutoCompleteOffForPasswordEdits ()) setAutoComplete (false); }
@Nonnull public HCConversionSettings getCloneIfNecessary (@Nonnull final EHTMLVersion eHTMLVersion) { return m_eHTMLVersion.equals (eHTMLVersion) ? this : getClone (eHTMLVersion); }
@Nonnull public HCConversionSettings getClone () { return new HCConversionSettings (this); }
@Override @OverrideOnDemand @OverridingMethodsMustInvokeSuper public void after () { // Reset to old version HCSettings.setDefaultHTMLVersion (m_ePrevHTMLVersion); } }
/** * Get the {@link Charset} that is used to create the HTML code. * * @return The non-<code>null</code> Charset object */ @Nonnull public static Charset getHTMLCharset () { return getConversionSettings ().getXMLWriterSettings ().getCharsetObj (); }
@Override protected void onConsistencyCheck (@Nonnull final IHCConversionSettingsToNode aConversionSettings) { super.onConsistencyCheck (aConversionSettings); if (m_aData == null && m_aType == null) HCConsistencyChecker.consistencyError ("OBJECT contains neither type nor data"); }
public void initHCSettings () { HCSettings.setOnDocumentReadyProvider (new JQueryOnDocumentReadyProvider ()); } }
@Nonnull public HCConversionSettings getClone (@Nonnull final EHTMLVersion eHTMLVersion) { return new HCConversionSettings (this, eHTMLVersion); }
private final void _ensureNodeState (@Nonnull final EHCNodeState eNodeState) { ValueEnforcer.notNull (eNodeState, "NodeState"); if (false) if (!m_eNodeState.equals (eNodeState)) HCConsistencyChecker.consistencyError ("Expected node state " + eNodeState + " but having node state " + m_eNodeState + " in " + toString ()); }