net.i2p.router.web

## Class CSSHelper

- java.lang.Object
- - net.i2p.router.web.HelperBase
  - - net.i2p.router.web.CSSHelper

-     public class CSSHelper
      extends HelperBase

  Copied and modded from I2PTunnel IndexBean (GPL)

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `CSSHelper.StringFormatter` Capitalize first letter of each word of string https://www.javatpoint.com/java-program-to-capitalize-each-word-in-string

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `BASE_THEME_PATH`
    `static boolean` | `DEFAULT_ENABLE_SORA_FONT`
    `static String` | `DEFAULT_REFRESH`
    `static boolean` | `DEFAULT_STICKY_SIDEBAR`
    `static String` | `DEFAULT_THEME`
    `static boolean` | `DEFAULT_UNIFIED_SIDEBAR`
    `static int` | `MIN_REFRESH`
    `static String` | `PROP_DISABLE_REFRESH`
    `static String` | `PROP_EMBED_APPS`
    `static String` | `PROP_ENABLE_SORA_FONT`
    `static String` | `PROP_FORCE_MOBILE_CONSOLE`
    `static String` | `PROP_REFRESH`
    `static String` | `PROP_STICKY_SIDEBAR`
    `static String` | `PROP_THEME_NAME`
    `static String` | `PROP_THEME_PFX`
    `static String` | `PROP_UNIFIED_SIDEBAR`
    `static String` | `PROP_UNIVERSAL_THEMING`

    - ### Fields inherited from class net.i2p.router.web.HelperBase

      `_context, _out, CHECKED, PROP_ADVANCED, SELECTED`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CSSHelper()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `allowIFrame(String ua)` Should we allow a refreshing IFrame?
    `boolean` | `embedApps()` Returns whether app embedding is enabled or disabled
    `boolean` | `enableStickySidebar()` Returns whether we should use a unified sidebar
    `boolean` | `enableUnifiedSidebar()` Returns whether we should use a unified sidebar
    `boolean` | `getDisableRefresh()`
    `String` | `getLang()` needed for conditional css loads for zh
    `static String` | `getNonce()` formerly stored in System.getProperty("router.consoleNonce")
    `String` | `getRefresh()`
    `String` | `getTheme(String userAgent)`
    `boolean` | `isAdvancedMode()`
    `void` | `setDisableRefresh(String r)` change disable refresh boolean and save it
    `void` | `setLang(String lang)` change default language for the router AND save it
    `void` | `setNews(String val)` Show / hide news on home page
    `void` | `setRefresh(String r)` change refresh and save it
    `void` | `setSoraDisplayFont()` Save config for alternative display font if enabled
    `boolean` | `shouldSendXFrame()` Should we send X_Frame_Options=SAMEORIGIN Default true
    `String` | `title(String s)` translate the title and display consistently
    `boolean` | `useSoraDisplayFont()` Returns whether we should use Sora display font
    `boolean` | `useStickySidebar()` Returns whether we should use a sticky sidebar when the sidebar height is less than the height of the viewport
    `boolean` | `useUnifiedSidebar()` Returns whether we should use a unified sidebar

    - ### Methods inherited from class net.i2p.router.web.HelperBase

      `_t, _t, _t, _x, getChecked, isAdvanced, ngettext, setContextId, storeWriter`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### BASE_THEME_PATH

          public static final String BASE_THEME_PATH

      See Also:
        Constant Field Values

    - #### DEFAULT_ENABLE_SORA_FONT

          public static final boolean DEFAULT_ENABLE_SORA_FONT

      See Also:
        Constant Field Values

    - #### DEFAULT_REFRESH

          public static final String DEFAULT_REFRESH

      See Also:
        Constant Field Values

    - #### DEFAULT_STICKY_SIDEBAR

          public static final boolean DEFAULT_STICKY_SIDEBAR

      See Also:
        Constant Field Values

    - #### DEFAULT_THEME

          public static final String DEFAULT_THEME

      See Also:
        Constant Field Values

    - #### DEFAULT_UNIFIED_SIDEBAR

          public static final boolean DEFAULT_UNIFIED_SIDEBAR

      See Also:
        Constant Field Values

    - #### MIN_REFRESH

          public static final int MIN_REFRESH

      See Also:
        Constant Field Values

    - #### PROP_DISABLE_REFRESH

          public static final String PROP_DISABLE_REFRESH

      See Also:
        Constant Field Values

    - #### PROP_EMBED_APPS

          public static final String PROP_EMBED_APPS

      See Also:
        Constant Field Values

    - #### PROP_ENABLE_SORA_FONT

          public static final String PROP_ENABLE_SORA_FONT

      See Also:
        Constant Field Values

    - #### PROP_FORCE_MOBILE_CONSOLE

          public static final String PROP_FORCE_MOBILE_CONSOLE

      See Also:
        Constant Field Values

    - #### PROP_REFRESH

          public static final String PROP_REFRESH

      See Also:
        Constant Field Values

    - #### PROP_STICKY_SIDEBAR

          public static final String PROP_STICKY_SIDEBAR

      See Also:
        Constant Field Values

    - #### PROP_THEME_NAME

          public static final String PROP_THEME_NAME

      See Also:
        Constant Field Values

    - #### PROP_THEME_PFX

          public static final String PROP_THEME_PFX

      See Also:
        Constant Field Values

    - #### PROP_UNIFIED_SIDEBAR

          public static final String PROP_UNIFIED_SIDEBAR

      See Also:
        Constant Field Values

    - #### PROP_UNIVERSAL_THEMING

          public static final String PROP_UNIVERSAL_THEMING

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### CSSHelper

          public CSSHelper()

  - ### Method Detail

    - #### allowIFrame

          public boolean allowIFrame(String ua)

      Should we allow a refreshing IFrame?

    - #### embedApps

          public boolean embedApps()

      Returns whether app embedding is enabled or disabled

    - #### enableStickySidebar

          public boolean enableStickySidebar()

      Returns whether we should use a unified sidebar

    - #### enableUnifiedSidebar

          public boolean enableUnifiedSidebar()

      Returns whether we should use a unified sidebar

    - #### getDisableRefresh

          public boolean getDisableRefresh()

      Returns:
        true if refresh is disabled

    - #### getLang

          public String getLang()

      needed for conditional css loads for zh
      Returns:
        two-letter only, lower-case

    - #### getNonce

          public static String getNonce()

      formerly stored in System.getProperty("router.consoleNonce")

    - #### getRefresh

          public String getRefresh()

      Returns:
        refresh time in seconds, as a string

    - #### getTheme

          public String getTheme(String userAgent)

    - #### isAdvancedMode

          public boolean isAdvancedMode()

    - #### setDisableRefresh

          public void setDisableRefresh(String r)

      change disable refresh boolean and save it

    - #### setLang

          public void setLang(String lang)

      change default language for the router AND save it
      Parameters:
        `lang` - xx OR xx_XX OR xxx OR xxx_XX

    - #### setNews

          public void setNews(String val)

      Show / hide news on home page
      Parameters:
        `val` - if non-null, "1" to show, else hide

    - #### setRefresh

          public void setRefresh(String r)

      change refresh and save it

    - #### setSoraDisplayFont

          public void setSoraDisplayFont()

      Save config for alternative display font if enabled

    - #### shouldSendXFrame

          public boolean shouldSendXFrame()

      Should we send X_Frame_Options=SAMEORIGIN Default true

    - #### title

          public String title(String s)

      translate the title and display consistently

    - #### useSoraDisplayFont

          public boolean useSoraDisplayFont()

      Returns whether we should use Sora display font

    - #### useStickySidebar

          public boolean useStickySidebar()

      Returns whether we should use a sticky sidebar when the sidebar height is less than the height of the viewport

    - #### useUnifiedSidebar

          public boolean useUnifiedSidebar()

      Returns whether we should use a unified sidebar