On Tuesday 29 July 2008 14:38, bo-le at web.de wrote: > Am Dienstag, 29. Juli 2008 14:34 schrieb Florent Daigni?re: > > * saces at freenetproject.org <saces at freenetproject.org> [2008-07-27 11:02:41]: > > > Author: saces > > > Date: 2008-07-27 11:02:41 +0000 (Sun, 27 Jul 2008) > > > New Revision: 21435 > > > > > > Modified: > > > trunk/freenet/src/freenet/clients/http/FProxyToadlet.java > > > trunk/freenet/src/freenet/clients/http/QueueToadlet.java > > > trunk/freenet/src/freenet/l10n/freenet.l10n.en.properties > > > trunk/freenet/src/freenet/pluginmanager/PluginManager.java > > > Log: > > > if the ThawIndexBrowser plugin is installed provide a "open with" link on > > > the warning page > > > > > > Modified: trunk/freenet/src/freenet/clients/http/FProxyToadlet.java > > > =================================================================== > > > --- trunk/freenet/src/freenet/clients/http/FProxyToadlet.java > > > 2008-07-27 > > > 09:16:02 UTC (rev 21434) +++ > > > trunk/freenet/src/freenet/clients/http/FProxyToadlet.java 2008-07-27 > > > 11:02:41 UTC (rev 21435) @@ -109,7 +109,7 @@ > > > > > > } > > > > > > - public static void handleDownload(ToadletContext context, Bucket data, > > > BucketFactory bucketFactory, String mimeType, String requestedMimeType, > > > String forceString, boolean forceDownload, String basePath, FreenetURI > > > key, String extras, String referrer, boolean downloadLink, ToadletContext > > > ctx) throws ToadletContextClosedException, IOException { + public > > > static > > > void handleDownload(ToadletContext context, Bucket data, BucketFactory > > > bucketFactory, String mimeType, String requestedMimeType, String > > > forceString, boolean forceDownload, String basePath, FreenetURI key, > > > String extras, String referrer, boolean downloadLink, ToadletContext ctx, > > > NodeClientCore core) throws ToadletContextClosedException, IOException { > > > if(Logger.shouldLog(Logger.MINOR, FProxyToadlet.class)) > > > Logger.minor(FProxyToadlet.class, > > > "handleDownload(data.size="+data.size()+", mimeType="+mimeType+", > > > requestedMimeType="+requestedMimeType+", forceDownload="+forceDownload+", > > > basePath="+basePath+", key="+key); String extrasNoMime = extras; // > > > extras will not include MIME type to start with - REDFLAG maybe it should > > > be an array @@ -224,6 +224,11 @@ > > > HTMLNode option = optionList.addChild("li"); > > > L10n.addL10nSubstitution(option, > > > "FProxyToadlet.openAsText", new > > > String[] { "link", "/link" }, new String[] { "<a > > > href=\""+basePath+key.toString()+"?type=text/plain"+extrasNoMime+"\">", > > > "</a>" }); // FIXME: is this safe? See bug #131 > > > + > > > + if((mimeType.equals("application/x-freenet-index")) && > > > (core.node.pluginManager.isPluginLoaded("plugins.ThawIndexBrowser.ThawInd > > >exBrowser"))) { + option = > > >optionList.addChild("li"); > > > + L10n.addL10nSubstitution(option, > > > "FProxyToadlet.openAsThawIndex", > > > new String[] { "link", "/link" }, new String[] { "<a href=\""+basePath + > > > "plugins/plugins.ThawIndexBrowser.ThawIndexBrowser/?key=" + > > > key.toString() + "\">", "</a>" }); + } > > > option = optionList.addChild("li"); > > > L10n.addL10nSubstitution(option, > > > "FProxyToadlet.openForceDisk", new > > > String[] { "link", "/link" }, new String[] { "<a > > > href=\""+basePath+key.toString()+"?forcedownload"+extras+"\">", "</a>" > > > }); if(!(mimeType.equals("application/octet-stream") || > > > mimeType.equals("application/x-msdownload"))) { @@ -436,8 +441,9 @@ > > > > Heh! you should have moved the comment here! > > > > On a side note: what about drilling a hole in the content filter too so > > that it works even when the request isn't made from the QueueToadlet?
> you meant a callback for plugins to register content handlers/filters? Yes. That's exactly the idea. Assuming we make a different MIME type for searchable indexes, we'd have at least two plugins using this straight off. And I don't see any reason to warn the user. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: <https://emu.freenetproject.org/pipermail/devl/attachments/20080802/897f7a5d/attachment.pgp>