forked from I2P_Developers/i2p.i2p
/configui: Add option to embed Susimail and I2PSnark in console
This commit is contained in:
@ -26,6 +26,7 @@ public class CSSHelper extends HelperBase {
|
||||
public static final String PROP_DISABLE_REFRESH = "routerconsole.summaryDisableRefresh";
|
||||
private static final String PROP_XFRAME = "routerconsole.disableXFrame";
|
||||
public static final String PROP_FORCE_MOBILE_CONSOLE = "routerconsole.forceMobileConsole";
|
||||
public static final String PROP_EMBED_APPS = "routerconsole.embedApps";
|
||||
|
||||
private static final String _consoleNonce = Long.toString(RandomSource.getInstance().nextLong());
|
||||
|
||||
@ -51,6 +52,14 @@ public class CSSHelper extends HelperBase {
|
||||
return url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether app embedding is enabled or disabled
|
||||
* @since 0.9.32
|
||||
*/
|
||||
public boolean embedApps() {
|
||||
return _context.getBooleanProperty(PROP_EMBED_APPS);
|
||||
}
|
||||
|
||||
/**
|
||||
* change default language for the router AND save it
|
||||
* @param lang xx OR xx_XX OR xxx OR xxx_XX
|
||||
|
@ -12,6 +12,7 @@ public class ConfigUIHandler extends FormHandler {
|
||||
private boolean _shouldSave;
|
||||
private boolean _universalTheming;
|
||||
private boolean _forceMobileConsole;
|
||||
private boolean _embedApps;
|
||||
private String _config;
|
||||
|
||||
@Override
|
||||
@ -31,6 +32,8 @@ public class ConfigUIHandler extends FormHandler {
|
||||
|
||||
public void setForceMobileConsole(String baa) { _forceMobileConsole = true; }
|
||||
|
||||
public void setEmbedApps(String baa) { _embedApps = true; }
|
||||
|
||||
public void setTheme(String val) {
|
||||
_config = val;
|
||||
}
|
||||
@ -59,6 +62,10 @@ public class ConfigUIHandler extends FormHandler {
|
||||
changes.put(CSSHelper.PROP_FORCE_MOBILE_CONSOLE, "true");
|
||||
else
|
||||
removes.add(CSSHelper.PROP_FORCE_MOBILE_CONSOLE);
|
||||
if (_embedApps)
|
||||
changes.put(CSSHelper.PROP_EMBED_APPS, "true");
|
||||
else
|
||||
removes.add(CSSHelper.PROP_EMBED_APPS);
|
||||
boolean ok = _context.router().saveConfig(changes, removes);
|
||||
if (ok) {
|
||||
if (!oldTheme.equals(_config))
|
||||
|
@ -43,6 +43,15 @@ public class ConfigUIHelper extends HelperBase {
|
||||
buf.append(CHECKED);
|
||||
buf.append("value=\"1\">")
|
||||
.append(_t("Force the mobile console to be used"))
|
||||
.append("</label></br>\n");
|
||||
boolean embedApps = _context.getBooleanProperty(CSSHelper.PROP_EMBED_APPS);
|
||||
buf.append("<label title=\"")
|
||||
.append(_t("Enabling the Universal Themeing option is recommended when embedding these applications"))
|
||||
.append("\"><input type=\"checkbox\" name=\"embedApps\" ");
|
||||
if (embedApps)
|
||||
buf.append(CHECKED);
|
||||
buf.append("value=\"1\">")
|
||||
.append(_t("Embed I2PSnark and I2PMail in the console"))
|
||||
.append("</label></div>\n");
|
||||
return buf.toString();
|
||||
}
|
||||
|
@ -33,11 +33,11 @@ public class HomeHelper extends HelperBase {
|
||||
_x("Configure UI") + S + _x("Select console theme & language & set optional console password").replace("&", "&") + S + "/configui" + S + I + "info/ui.png" + S +
|
||||
_x("Customize Home Page") + S + _x("I2P Home Page Configuration") + S + "/confighome" + S + I + "home_page.png" + S +
|
||||
_x("Customize Sidebar") + S + _x("Customize the sidebar by adding or removing or repositioning elements") + S + "/configsidebar" + S + I + "info/sidebar.png" + S +
|
||||
_x("Email") + S + _x("Anonymous webmail client") + S + "/susimail/susimail" + S + I + "email.png" + S +
|
||||
_x("Email") + S + _x("Anonymous webmail client") + S + "/webmail" + S + I + "email.png" + S +
|
||||
_x("Help") + S + _x("I2P Router Help") + S + "/help" + S + I + "support.png" + S +
|
||||
_x("Manage Plugins") + S + _x("Install and configure I2P plugins") + S + "/configplugins" + S + I + "plugin.png" + S +
|
||||
_x("Router Console") + S + _x("I2P Router Console") + S + "/console" + S + I + "info/console.png" + S +
|
||||
_x("Torrents") + S + _x("Built-in anonymous BitTorrent Client") + S + "/i2psnark/" + S + I + "i2psnark.png" + S +
|
||||
_x("Torrents") + S + _x("Built-in anonymous BitTorrent Client") + S + "/torrents" + S + I + "i2psnark.png" + S +
|
||||
_x("Web Server") + S + _x("Local web server for hosting your own content on I2P") + S + "http://127.0.0.1:7658/" + S + I + "server_32x32.png" + S +
|
||||
"";
|
||||
|
||||
|
@ -208,13 +208,13 @@ class SummaryBarRenderer {
|
||||
|
||||
"<hr class=\"b\"><table id=\"sb_services\"><tr><td>" +
|
||||
|
||||
"<a href=\"/susimail/susimail\" target=\"_blank\" title=\"")
|
||||
"<a href=\"/webmail\" target=\"_top\" title=\"")
|
||||
.append(_t("Anonymous webmail client"))
|
||||
.append("\">")
|
||||
.append(nbsp(_t("Email")))
|
||||
.append("</a>\n" +
|
||||
|
||||
"<a href=\"/i2psnark/\" target=\"_blank\" title=\"")
|
||||
"<a href=\"/torrents\" target=\"_top\" title=\"")
|
||||
.append(_t("Built-in anonymous BitTorrent Client"))
|
||||
.append("\">")
|
||||
.append(nbsp(_t("Torrents")))
|
||||
|
@ -6,7 +6,8 @@
|
||||
<%
|
||||
// CSSHelper is also pulled in by css.jsi below...
|
||||
boolean testIFrame = tester.allowIFrame(request.getHeader("User-Agent"));
|
||||
if (!testIFrame) {
|
||||
boolean embedApp = tester.embedApps();
|
||||
if (!testIFrame || !embedApp) {
|
||||
response.setStatus(302);
|
||||
response.setHeader("Location", "/i2psnark/");
|
||||
} else {
|
||||
|
@ -6,7 +6,8 @@
|
||||
<%
|
||||
// CSSHelper is also pulled in by css.jsi below...
|
||||
boolean testIFrame = tester.allowIFrame(request.getHeader("User-Agent"));
|
||||
if (!testIFrame) {
|
||||
boolean embedApp = tester.embedApps();
|
||||
if (!testIFrame || !embedApp) {
|
||||
response.setStatus(302);
|
||||
response.setHeader("Location", "/susimail/susimail");
|
||||
} else {
|
||||
|
@ -22,6 +22,7 @@
|
||||
- Add additional reachability states for clockskew and vmcomm (with icons)
|
||||
- Homepage: Add 'Customize Sidebar' link to signpost the feature now that
|
||||
there are more optional sections available (ticket #1996)
|
||||
- /configui: Add option to embed Susimail and I2PSnark in console
|
||||
* I2PTunnel: Add hostname / destination (b32) information to server section on
|
||||
index page (for parity with client tunnels section)
|
||||
* SusiDNS:
|
||||
|
@ -688,21 +688,21 @@ p:empty + .sb_notice {
|
||||
background-color: #ffe;
|
||||
}
|
||||
|
||||
#sb_services a[href="/susimail/susimail"] {
|
||||
#sb_services a[href="/susimail/susimail"], #sb_services a[href="/webmail"] {
|
||||
background: #f8f8ff url(images/inbox.png) 3px center no-repeat;
|
||||
background: rgba(248, 248, 255, 0.8) url(images/inbox.png) 3px center no-repeat;
|
||||
}
|
||||
|
||||
#sb_services a[href="/susimail/susimail"]:hover {
|
||||
#sb_services a[href="/susimail/susimail"]:hover, #sb_services a[href="/webmail"]:hover {
|
||||
background: #ffe url(images/inbox.png) 3px center no-repeat;
|
||||
}
|
||||
|
||||
#sb_services a[href="/i2psnark/"] {
|
||||
#sb_services a[href="/i2psnark/"], #sb_services a[href="/torrents"] {
|
||||
background: #f8f8ff url(/themes/console/images/i2psnark.png) 3px center no-repeat;
|
||||
background: rgba(248, 248, 255, 0.8) url(/themes/console/images/i2psnark.png) 3px center no-repeat;
|
||||
}
|
||||
|
||||
#sb_services a[href="/i2psnark/"]:hover {
|
||||
#sb_services a[href="/i2psnark/"]:hover, #sb_services a[href="/torrents"]:hover {
|
||||
background: #ffe url(/themes/console/images/i2psnark.png) 3px center no-repeat;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user