On Tuesday 23 December 2008 08:54, Daniel Cheng wrote: > On Tue, Dec 23, 2008 at 3:01 PM, <juiceman at freenetproject.org> wrote: > > Author: juiceman > > Date: 2008-12-23 07:01:00 +0000 (Tue, 23 Dec 2008) > > New Revision: 24756 > > > > Added: > > trunk/freenet/src/freenet/clients/http/SimpleHelpToadlet.java > > Modified: > > trunk/freenet/src/freenet/clients/http/FProxyToadlet.java > > trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties > > Log: > > Initial commit of a simple in Fproxy help page. Content needs to be added still and then this can be wired into side menu. To access in the meantime go to http://127.0.0.1:8888/help/ > > Shouldn't we have a official freesite first/instead?
An official freesite requires we implement RSKs. If you want to I can explain how. But even then we'd want to bundle it as a binary blob so it can be accessed even on nodes that haven't connected yet. So IMHO a help bundle built in to the node is a good start. I'm assuming this will work by pulling it from the jar, like with the themes etc? > > > > > Modified: trunk/freenet/src/freenet/clients/http/FProxyToadlet.java > > =================================================================== > > --- trunk/freenet/src/freenet/clients/http/FProxyToadlet.java 2008-12-23 04:17:38 UTC (rev 24755) > > +++ trunk/freenet/src/freenet/clients/http/FProxyToadlet.java 2008-12-23 07:01:00 UTC (rev 24756) > > @@ -715,6 +715,9 @@ > > BrowserTestToadlet browsertTestToadlet = new BrowserTestToadlet(client, core); > > server.register(browsertTestToadlet, "/test/", true, false); > > > > + SimpleHelpToadlet simpleHelpToadlet = new SimpleHelpToadlet(client, core); > > + server.register(simpleHelpToadlet, "/help/", true, false); > > + > > ConnectivityToadlet connectivityToadlet = new ConnectivityToadlet(client, node, core); > > server.register(connectivityToadlet, "/connectivity/", true, "ConnectivityToadlet.connectivityTitle", "ConnectivityToadlet.connectivity", true, null); > > > > > > Added: trunk/freenet/src/freenet/clients/http/SimpleHelpToadlet.java > > =================================================================== > > --- trunk/freenet/src/freenet/clients/http/SimpleHelpToadlet.java > > (rev 0) > > +++ trunk/freenet/src/freenet/clients/http/SimpleHelpToadlet.java 2008-12-23 07:01:00 UTC (rev 24756) > > @@ -0,0 +1,52 @@ > > +/* This code is part of Freenet. It is distributed under the GNU General > > + * Public License, version 2 (or at your option any later version). See > > + * http://www.gnu.org/ for further details of the GPL. */ > > +package freenet.clients.http; > > + > > +import java.io.IOException; > > +import java.net.URI; > > + > > +import freenet.client.HighLevelSimpleClient; > > +import freenet.node.NodeClientCore; > > +import freenet.support.HTMLNode; > > +import freenet.support.api.HTTPRequest; > > +import freenet.l10n.L10n; > > + > > +/** > > + * Simple Help Toadlet. Provides an offline means of looking up some basic info, howtos, and FAQ > > + * Likely to be superceded someday by an offical Freesite and binary blob included in install package. > > + * @author Juiceman > > + */ > > +public class SimpleHelpToadlet extends Toadlet { > > + SimpleHelpToadlet(HighLevelSimpleClient client, NodeClientCore c) { > > + super(client); > > + this.core=c; > > + } > > + > > + final NodeClientCore core; > > + > > + @Override > > + public void handleGet(URI uri, HTTPRequest request, ToadletContext ctx) throws ToadletContextClosedException, IOException { > > + > > + > > + > > + HTMLNode pageNode = ctx.getPageMaker().getPageNode("Freenet " + L10n.getString("SimpleHelpToadlet.help"), ctx); > > + HTMLNode contentNode = ctx.getPageMaker().getContentNode(pageNode); > > + > > + if(ctx.isAllowedFullAccess()) > > + contentNode.addChild(core.alerts.createSummary()); > > + > > + HTMLNode helpScreenBox = contentNode.addChild(ctx.getPageMaker().getInfobox("infobox-content", L10n.getString("SimpleHelpToadlet.connectivityTitle"))); > > + HTMLNode helpScreenContent = ctx.getPageMaker().getContentNode(helpScreenBox); > > + HTMLNode p = helpScreenContent.addChild("p"); > > + L10n.addL10nSubstitution(p, "SimpleHelpToadlet.connectivityText", new String[] { "p", "/p", "bold", "/bold" }, new String[] { "<p>", "</p>", "<b>", "</b>" }); > > + > > + this.writeHTMLReply(ctx, 200, "OK", pageNode.generate()); > > + } > > + > > + @Override > > + public String supportedMethods() { > > + return "GET"; > > + } > > + > > +} > > > > Modified: trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties > > =================================================================== > > --- trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties 2008-12-23 04:17:38 UTC (rev 24755) > > +++ trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties 2008-12-23 07:01:00 UTC (rev 24756) > > @@ -1116,6 +1116,9 @@ > > SecurityLevels.userAlertExtro=You can change these settings on ${link}the config page${/link}. > > ShortOption.parseError=Cannot parse value as a string array: ${error} > > ShortOption.parseError=The value specified can't be parsed as a 16-bit integer : ${val} > > +SimpleHelpToadlet.connectivityText=${bold}Testing. ${/bold}${/p}${p}Test${p} > > +SimpleHelpToadlet.connectivityTitle=Connectivity > > +SimpleHelpToadlet.help=Help > > SimpleToadletServer.advancedMode=Enable Advanced Mode? > > SimpleToadletServer.advancedModeLong=Enables display of advanced options and information in the web interface by default. This setting should be turned to false in most cases. > > SimpleToadletServer.allowedFullAccess=Hosts having a full access to FProxy (read warning) > > > > _______________________________________________ > > cvs mailing list > > cvs at freenetproject.org > > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs > > > _______________________________________________ > Devl mailing list > Devl at freenetproject.org > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl > > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 827 bytes Desc: not available URL: <https://emu.freenetproject.org/pipermail/devl/attachments/20081223/bf03cd0e/attachment.pgp>