Package net.i2p.router.web
Class CSSHelper
java.lang.Object
net.i2p.router.web.HelperBase
net.i2p.router.web.CSSHelper
Copied and modded from I2PTunnel IndexBean (GPL)
- Author:
- zzz
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final booleanstatic final Stringstatic final Stringstatic final intstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class net.i2p.router.web.HelperBase
_context, _out, CHECKED, PROP_ADVANCED, SELECTED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanallowIFrame(String ua) Should we allow a refreshing IFrame?booleanReturns whether app embedding is enabled or disabledbooleangetLang()needed for conditional css loads for zhstatic StringgetNonce(HttpSession session) Replaces static consoleNonce, updateNonce, reseedNonce, systemNoncevoidchange disable refresh boolean and save itvoidchange default language for the router AND save itvoidShow / hide news on home pagevoidsetRefresh(String r) change refresh and save itvoidSo we don't have to refresh after saving.booleanShould we send X_Frame_Options=SAMEORIGIN Default truetranslate the title and display consistentlystatic booleanvalidateNonce(HttpSession session, String nonce) Replaces static consoleNonce, updateNonce, reseedNonce, systemNoncestatic booleanvalidateNonce(HttpSession session, String nonce, boolean preserve) Replaces static consoleNonce, updateNonce, reseedNonce, systemNonceMethods inherited from class net.i2p.router.web.HelperBase
_t, _t, _t, _x, getChecked, isAdvanced, ngettext, setContextId, storeWriter
-
Field Details
-
PROP_UNIVERSAL_THEMING
- See Also:
-
PROP_THEME_NAME
- See Also:
-
PROP_THEME_PFX
- Since:
- 0.9.33 moved from ConfigUIHelper
- See Also:
-
DEFAULT_THEME
- See Also:
-
ALT_THEME
- See Also:
-
BASE_THEME_PATH
- See Also:
-
PROP_REFRESH
- See Also:
-
DEFAULT_REFRESH
- See Also:
-
MIN_REFRESH
public static final int MIN_REFRESH- See Also:
-
PROP_DISABLE_REFRESH
- See Also:
-
PROP_FORCE_MOBILE_CONSOLE
- See Also:
-
PROP_EMBED_APPS
- Since:
- 0.9.32
- See Also:
-
PROP_DISABLE_OLD
- Since:
- 0.9.36
- See Also:
-
DEFAULT_DISABLE_OLD
public static final boolean DEFAULT_DISABLE_OLD- See Also:
-
-
Constructor Details
-
CSSHelper
public CSSHelper()
-
-
Method Details
-
getNonce
Replaces static consoleNonce, updateNonce, reseedNonce, systemNonce- Parameters:
session- returns an invalid nonce if null- Returns:
- a new nonce for each call
- Since:
- 0.9.70
-
validateNonce
Replaces static consoleNonce, updateNonce, reseedNonce, systemNonce- Parameters:
session- returns false if nullnonce- returns false if null- Returns:
- true if valid
- Since:
- 0.9.70
-
validateNonce
Replaces static consoleNonce, updateNonce, reseedNonce, systemNonce- Parameters:
session- returns false if nullnonce- returns false if nullpreserve- if true, do not delete the nonce. Use for early checks in jsps.- Returns:
- true if valid
- Since:
- 0.9.70
-
getTheme
-
setTheme
So we don't have to refresh after saving. Called from css.jsi.- Since:
- 0.9.52
-
embedApps
public boolean embedApps()Returns whether app embedding is enabled or disabled- Since:
- 0.9.32
-
setLang
change default language for the router AND save it- Parameters:
lang- xx OR xx_XX OR xxx OR xxx_XX
-
getLang
needed for conditional css loads for zh- Returns:
- two-letter only, lower-case
-
setNews
Show / hide news on home page- Parameters:
val- if non-null, "1" to show, else hide- Since:
- 0.8.12
-
shouldSendXFrame
public boolean shouldSendXFrame()Should we send X_Frame_Options=SAMEORIGIN Default true- Since:
- 0.9.1
-
setRefresh
change refresh and save it -
getRefresh
- Returns:
- refresh time in seconds, as a string
-
setDisableRefresh
change disable refresh boolean and save it- Since:
- 0.9.1
-
getDisableRefresh
public boolean getDisableRefresh()- Returns:
- true if refresh is disabled
- Since:
- 0.9.1
-
title
translate the title and display consistently -
allowIFrame
Should we allow a refreshing IFrame?- Since:
- 0.8.5
-