Author: toad
Date: 2009-01-21 14:40:31 +0000 (Wed, 21 Jan 2009)
New Revision: 25192

Modified:
   trunk/plugins/KeyExplorer/KeyExplorer.java
Log:
KeyExplorer: history cloaking revert: revert 25103


Modified: trunk/plugins/KeyExplorer/KeyExplorer.java
===================================================================
--- trunk/plugins/KeyExplorer/KeyExplorer.java  2009-01-21 14:39:31 UTC (rev 
25191)
+++ trunk/plugins/KeyExplorer/KeyExplorer.java  2009-01-21 14:40:31 UTC (rev 
25192)
@@ -22,7 +22,6 @@
 import freenet.client.HighLevelSimpleClient;
 import freenet.client.Metadata;
 import freenet.client.MetadataParseException;
-import freenet.clients.http.LinkFixer;
 import freenet.clients.http.PageMaker;
 import freenet.keys.BaseClientKey;
 import freenet.keys.ClientKey;
@@ -54,30 +53,25 @@
 
        private PluginRespirator m_pr;
        private PageMaker m_pm;
-       
-       public LinkFixer getFixer() {
-               return m_pr.getNode().getLinkFilter();
-       }
 
        public String handleHTTPGet(HTTPRequest request) throws 
PluginHTTPException {
                String uri = request.getParam("key");
                String type = request.getParam("type");
-               LinkFixer fixer = getFixer();
                if ("ZIPmanifest".equals(type)) {
-                       return makeManifestPage(uri, true, false, fixer);
+                       return makeManifestPage(uri, true, false);
                }
                if ("TARmanifest".equals(type)) {
-                       return makeManifestPage(uri, false, true, fixer);
+                       return makeManifestPage(uri, false, true);
                }
                if ("simplemanifest".equals(type)) {
-                       return makeManifestPage(uri, false, false, fixer);
+                       return makeManifestPage(uri, false, false);
                }
-               return makeMainPage(uri, fixer);
+               return makeMainPage(uri);
        }
 
        public String handleHTTPPost(HTTPRequest request) throws 
PluginHTTPException {
                String uri = request.getPartAsString("key", 1024);
-               return makeMainPage(uri, getFixer());
+               return makeMainPage(uri);
        }
 
        public void handle(PluginReplySender replysender, SimpleFieldSet 
params, Bucket data, int accesstype) {
@@ -166,7 +160,7 @@
                replysender.send(sfs);
        }
 
-       private String makeMainPage(String key, LinkFixer fixer) {
+       private String makeMainPage(String key) {
                HTMLNode pageNode = m_pm.getPageNode("KeyExplorer", null);
                HTMLNode contentNode = m_pm.getContentNode(pageNode);
 
@@ -270,7 +264,7 @@
                                        if (md.isSimpleManifest()) {
                                                metaBox.addChild("#", "Document 
type: SimpleManifest");
                                                metaBox.addChild("#", "\u00a0");
-                                               metaBox.addChild(new 
HTMLNode("a", "href", 
fixer.fixLink("/plugins/plugins.KeyExplorer.KeyExplorer/?type=simplemanifest&key="
 + furi),
+                                               metaBox.addChild(new 
HTMLNode("a", "href", 
"/plugins/plugins.KeyExplorer.KeyExplorer/?type=simplemanifest&key=" + furi,
                                                "reopen as manifest"));
                                                metaBox.addChild("%", "<BR />");
                                        }
@@ -293,12 +287,12 @@
                                                        String sfrUri = 
md.getSingleTarget().toString();
                                                        metaBox.addChild("#", 
sfrUri);
                                                        metaBox.addChild("#", 
"\u00a0");
-                                                       metaBox.addChild(new 
HTMLNode("a", "href", fixer.fixLink("/?key=" + sfrUri), "open"));
+                                                       metaBox.addChild(new 
HTMLNode("a", "href", "/?key=" + sfrUri, "open"));
                                                        metaBox.addChild("#", 
"\u00a0");
-                                                       metaBox.addChild(new 
HTMLNode("a", "href", 
fixer.fixLink("/plugins/plugins.KeyExplorer.KeyExplorer/?key=" + sfrUri),
+                                                       metaBox.addChild(new 
HTMLNode("a", "href", "/plugins/plugins.KeyExplorer.KeyExplorer/?key=" + sfrUri,
                                                                        
"explore"));
                                                } else {
-                                                       metaBox.addChild(new 
HTMLNode("a", "href", fixer.fixLink("/?key=" + furi), "reopen normal"));        
                                           
+                                                       metaBox.addChild(new 
HTMLNode("a", "href", "/?key=" + furi, "reopen normal"));                       
                           
                                                }
                                                metaBox.addChild("%", "<BR />");
                                        }
@@ -311,7 +305,7 @@
                                        if (md.isArchiveManifest()) {
                                                metaBox.addChild("#", "Document 
type: ArchiveManifest");
                                                metaBox.addChild("#", "\u00a0");
-                                               metaBox.addChild(new 
HTMLNode("a", "href", 
fixer.fixLink("/plugins/plugins.KeyExplorer.KeyExplorer/?type="+md.getArchiveType().name()+"manifest&key="
 + furi),
+                                               metaBox.addChild(new 
HTMLNode("a", "href", 
"/plugins/plugins.KeyExplorer.KeyExplorer/?type="+md.getArchiveType().name()+"manifest&key="
 + furi,
                                                "reopen as manifest"));
                                                metaBox.addChild("%", "<BR />");
                                        }
@@ -342,7 +336,7 @@
                return pageNode.generate();
        }
        
-       private String makeManifestPage(String key, boolean zip, boolean tar, 
LinkFixer fixer) {
+       private String makeManifestPage(String key, boolean zip, boolean tar) {
                HTMLNode pageNode = m_pm.getPageNode("KeyExplorer", null);
                HTMLNode contentNode = m_pm.getContentNode(pageNode);
 
@@ -390,13 +384,13 @@
                
                HashMap<String, Metadata> docs = metadata.getDocuments();
 
-               parseMetadata(listBox, docs, "", furi.toString(), fixer);
+               parseMetadata(listBox, docs, "", furi.toString());
 
                return pageNode.generate();
 
        }
        
-       private void parseMetadata(HTMLNode htmlnode, HashMap<String, Metadata> 
docs, String prefix, String furi, LinkFixer fixer) {
+       private void parseMetadata(HTMLNode htmlnode, HashMap<String, Metadata> 
docs, String prefix, String furi) {
                Set<String> s = docs.keySet();
                Iterator<String> i = s.iterator();
                while (i.hasNext()) {
@@ -405,24 +399,24 @@
                        String fname = prefix + name;
                        if (md.isArchiveInternalRedirect()) {
                                htmlnode.addChild("#", "(container)\u00a0");
-                               htmlnode.addChild(new HTMLNode("a", "href", 
fixer.fixLink("/?key=" + furi + "/" + fname), fname));
+                               htmlnode.addChild(new HTMLNode("a", "href", 
"/?key=" + furi + "/" + fname, fname));
                                htmlnode.addChild("%", "<BR />");
                } else if (md.isSingleFileRedirect()) {
                        htmlnode.addChild("#", "(extern)\u00a0");
-                       htmlnode.addChild(new HTMLNode("a", "href", 
fixer.fixLink("/?key=" + furi + "/" + fname), fname));
+                       htmlnode.addChild(new HTMLNode("a", "href", "/?key=" + 
furi + "/" + fname, fname));
                        htmlnode.addChild("#", "\u00a0");
                                if (md.getSingleTarget() != null) // why null?
-                                       htmlnode.addChild(new HTMLNode("a", 
"href", fixer.fixLink("/plugins/plugins.KeyExplorer.KeyExplorer/?key=" + 
md.getSingleTarget().toString()), "explore"));
+                                       htmlnode.addChild(new HTMLNode("a", 
"href", "/plugins/plugins.KeyExplorer.KeyExplorer/?key=" + 
md.getSingleTarget().toString(), "explore"));
                                htmlnode.addChild("%", "<BR />");
                } else if (md.isSplitfile()) {
                        htmlnode.addChild("#", "(extern, splitf)\u00a0");
-                       htmlnode.addChild(new HTMLNode("a", "href", 
fixer.fixLink("/?key=" + furi + "/" + fname), fname));
+                       htmlnode.addChild(new HTMLNode("a", "href", "/?key=" + 
furi + "/" + fname, fname));
                                htmlnode.addChild("%", "<BR />");
                } else {
                        htmlnode.addChild("#", "(dir)\u00a0");
                        htmlnode.addChild("#", fname);
                                htmlnode.addChild("%", "<BR />");
-                               parseMetadata(htmlnode, md.getDocuments(), 
fname + "/", furi, fixer);
+                               parseMetadata(htmlnode, md.getDocuments(), 
fname + "/", furi);
                }
        }
                

_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to