show mailto links in ViewFile.html linklist

pull/37/head
reger 9 years ago
parent 6b7c10cef8
commit 71c416f383

@ -34,6 +34,7 @@ import java.util.Collection;
import java.util.Date;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import net.yacy.cora.document.encoding.ASCII;
import net.yacy.cora.document.encoding.UTF8;
@ -325,6 +326,24 @@ public class ViewFile {
prop.put("viewMode", VIEW_MODE_AS_LINKLIST);
boolean dark = true;
int i = 0;
if (document.getEmaillinks() != null) {
Iterator<Entry<String, String>> emailit = document.getEmaillinks().entrySet().iterator();
while (emailit.hasNext()) {
Entry<String, String> eentry = emailit.next();
prop.put("viewMode_links_" + i + "_nr", i);
prop.put("viewMode_links_" + i + "_dark", dark ? "1" : "0");
prop.put("viewMode_links_" + i + "_type", "email");
prop.put("viewMode_links_" + i + "_text", (eentry.getValue().isEmpty()) ? "&nbsp;" : eentry.getValue());
prop.put("viewMode_links_" + i + "_url", "#");
prop.put("viewMode_links_" + i + "_link", eentry.getKey());
prop.put("viewMode_links_" + i + "_rel", "");
prop.put("viewMode_links_" + i + "_name", "");
dark = !dark;
i++;
}
}
i += putMediaInfo(prop, wordArray, i, document.getVideolinks(), "video", (i % 2 == 0));
i += putMediaInfo(prop, wordArray, i, document.getAudiolinks(), "audio", (i % 2 == 0));
dark = (i % 2 == 0);

@ -102,8 +102,8 @@ public class AnchorURL extends DigestURL {
isHTTPS(relPath) ||
isFTP(relPath) ||
isFile(relPath) ||
isSMB(relPath)/*||
relPath.contains(":") && patternMail.matcher(relPath.toLowerCase()).find()*/) {
isSMB(relPath) ||
relPath.startsWith("mailto:")) {
return new AnchorURL(relPath);
}
return new AnchorURL(baseURL, relPath);

@ -258,7 +258,7 @@ public class MultiProtocolURL implements Serializable, Comparable<MultiProtocolU
}
this.userInfo = url.substring(p + 1, q);
this.host = url.substring(q + 1);
this.path = null;
this.path = ""; // TODO: quick fix, as not always checked for path != null
this.port = -1;
this.searchpart = null;
this.anchor = null;

Loading…
Cancel
Save