Changeset 47d3547


Ignore:
Timestamp:
Oct 25, 2017 9:33:20 AM (3 years ago)
Author:
str4d <str4d@…>
Branches:
master
Children:
df95e29
Parents:
b54a5c5
Message:

/configui: Add option to embed Susimail and I2PSnark in console

Files:
9 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/java/src/net/i2p/router/web/CSSHelper.java

    rb54a5c5 r47d3547  
    2727    private static final String PROP_XFRAME = "routerconsole.disableXFrame";
    2828    public static final String PROP_FORCE_MOBILE_CONSOLE = "routerconsole.forceMobileConsole";
     29    public static final String PROP_EMBED_APPS = "routerconsole.embedApps";
    2930
    3031    private static final String _consoleNonce = Long.toString(RandomSource.getInstance().nextLong());
     
    5051        }
    5152        return url;
     53    }
     54
     55    /**
     56     * Returns whether app embedding is enabled or disabled
     57     * @since 0.9.32
     58     */
     59    public boolean embedApps() {
     60        return _context.getBooleanProperty(PROP_EMBED_APPS);
    5261    }
    5362
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigUIHandler.java

    rb54a5c5 r47d3547  
    1313    private boolean _universalTheming;
    1414    private boolean _forceMobileConsole;
     15    private boolean _embedApps;
    1516    private String _config;
    16    
     17
    1718    @Override
    1819    protected void processForm() {
     
    2526        }
    2627    }
    27    
     28
    2829    public void setShouldsave(String moo) { _shouldSave = true; }
    2930
     
    3233    public void setForceMobileConsole(String baa) { _forceMobileConsole = true; }
    3334
     35    public void setEmbedApps(String baa) { _embedApps = true; }
     36
    3437    public void setTheme(String val) {
    3538        _config = val;
    3639    }
    37    
     40
    3841    /** note - lang change is handled in CSSHelper but we still need to save it here */
    3942    private void saveChanges() {
     
    6063        else
    6164            removes.add(CSSHelper.PROP_FORCE_MOBILE_CONSOLE);
     65        if (_embedApps)
     66            changes.put(CSSHelper.PROP_EMBED_APPS, "true");
     67        else
     68            removes.add(CSSHelper.PROP_EMBED_APPS);
    6269        boolean ok = _context.router().saveConfig(changes, removes);
    6370        if (ok) {
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigUIHelper.java

    rb54a5c5 r47d3547  
    4444        buf.append("value=\"1\">")
    4545           .append(_t("Force the mobile console to be used"))
     46           .append("</label></br>\n");
     47        boolean embedApps = _context.getBooleanProperty(CSSHelper.PROP_EMBED_APPS);
     48        buf.append("<label title=\"")
     49           .append(_t("Enabling the Universal Themeing option is recommended when embedding these applications"))
     50           .append("\"><input type=\"checkbox\" name=\"embedApps\" ");
     51        if (embedApps)
     52            buf.append(CHECKED);
     53        buf.append("value=\"1\">")
     54           .append(_t("Embed I2PSnark and I2PMail in the console"))
    4655           .append("</label></div>\n");
    4756        return buf.toString();
  • apps/routerconsole/java/src/net/i2p/router/web/HomeHelper.java

    rb54a5c5 r47d3547  
    1818 */
    1919public class HomeHelper extends HelperBase {
    20    
     20
    2121    private static final char S = ',';
    2222    private static final String I = "/themes/console/images/";
     
    3434        _x("Customize Home Page") + S + _x("I2P Home Page Configuration") + S + "/confighome" + S + I + "home_page.png" + S +
    3535        _x("Customize Sidebar") + S + _x("Customize the sidebar by adding or removing or repositioning elements") + S + "/configsidebar" + S + I + "info/sidebar.png" + S +
    36         _x("Email") + S + _x("Anonymous webmail client") + S + "/susimail/susimail" + S + I + "email.png" + S +
     36        _x("Email") + S + _x("Anonymous webmail client") + S + "/webmail" + S + I + "email.png" + S +
    3737        _x("Help") + S + _x("I2P Router Help") + S + "/help" + S + I + "support.png" + S +
    3838        _x("Manage Plugins") + S + _x("Install and configure I2P plugins") + S + "/configplugins" + S + I + "plugin.png" + S +
    3939        _x("Router Console") + S + _x("I2P Router Console") + S + "/console" + S + I + "info/console.png" + S +
    40         _x("Torrents") + S + _x("Built-in anonymous BitTorrent Client") + S + "/i2psnark/" + S + I + "i2psnark.png" + S +
     40        _x("Torrents") + S + _x("Built-in anonymous BitTorrent Client") + S + "/torrents" + S + I + "i2psnark.png" + S +
    4141        _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 +
    4242        "";
  • apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java

    rb54a5c5 r47d3547  
    209209                   "<hr class=\"b\"><table id=\"sb_services\"><tr><td>" +
    210210
    211                    "<a href=\"/susimail/susimail\" target=\"_blank\" title=\"")
     211                   "<a href=\"/webmail\" target=\"_top\" title=\"")
    212212           .append(_t("Anonymous webmail client"))
    213213           .append("\">")
     
    215215           .append("</a>\n" +
    216216
    217                    "<a href=\"/i2psnark/\" target=\"_blank\" title=\"")
     217                   "<a href=\"/torrents\" target=\"_top\" title=\"")
    218218           .append(_t("Built-in anonymous BitTorrent Client"))
    219219           .append("\">")
  • apps/routerconsole/jsp/torrents.jsp

    rb54a5c5 r47d3547  
    77    // CSSHelper is also pulled in by css.jsi below...
    88    boolean testIFrame = tester.allowIFrame(request.getHeader("User-Agent"));
    9     if (!testIFrame) {
     9    boolean embedApp = tester.embedApps();
     10    if (!testIFrame || !embedApp) {
    1011        response.setStatus(302);
    1112        response.setHeader("Location", "/i2psnark/");
  • apps/routerconsole/jsp/webmail.jsp

    rb54a5c5 r47d3547  
    77    // CSSHelper is also pulled in by css.jsi below...
    88    boolean testIFrame = tester.allowIFrame(request.getHeader("User-Agent"));
    9     if (!testIFrame) {
     9    boolean embedApp = tester.embedApps();
     10    if (!testIFrame || !embedApp) {
    1011        response.setStatus(302);
    1112        response.setHeader("Location", "/susimail/susimail");
  • history.txt

    rb54a5c5 r47d3547  
    2323   - Homepage: Add 'Customize Sidebar' link to signpost the feature now that
    2424     there are more optional sections available (ticket #1996)
     25   - /configui: Add option to embed Susimail and I2PSnark in console
    2526 * I2PTunnel: Add hostname / destination (b32) information to server section on
    2627   index page (for parity with client tunnels section)
  • installer/resources/themes/console/light/console.css

    rb54a5c5 r47d3547  
    689689}
    690690
    691 #sb_services a[href="/susimail/susimail"] {
     691#sb_services a[href="/susimail/susimail"], #sb_services a[href="/webmail"] {
    692692     background: #f8f8ff url(images/inbox.png) 3px center no-repeat;
    693693     background: rgba(248, 248, 255, 0.8) url(images/inbox.png) 3px center no-repeat;
    694694}
    695695
    696 #sb_services a[href="/susimail/susimail"]:hover {
     696#sb_services a[href="/susimail/susimail"]:hover, #sb_services a[href="/webmail"]:hover {
    697697     background: #ffe url(images/inbox.png) 3px center no-repeat;
    698698}
    699699
    700 #sb_services a[href="/i2psnark/"] {
     700#sb_services a[href="/i2psnark/"], #sb_services a[href="/torrents"] {
    701701     background: #f8f8ff url(/themes/console/images/i2psnark.png) 3px center no-repeat;
    702702     background: rgba(248, 248, 255, 0.8) url(/themes/console/images/i2psnark.png) 3px center no-repeat;
    703703}
    704704
    705 #sb_services a[href="/i2psnark/"]:hover {
     705#sb_services a[href="/i2psnark/"]:hover, #sb_services a[href="/torrents"]:hover {
    706706     background: #ffe url(/themes/console/images/i2psnark.png) 3px center no-repeat;
    707707}
Note: See TracChangeset for help on using the changeset viewer.