- made image search in interactive search using the ViewImage servlet -

that enables viewing of images for intranet SMB servers.
- added a filter search for protocol, tld and ext again; otherwise p2p
search produces a lot of rubbish
pull/1/head
Michael Peter Christen 12 years ago
parent 8f3bd0c387
commit e1f89efd0d

@ -78,7 +78,7 @@ function preparepage(str) {
if (modifier != "") modifiertype = modifier.substring(modifier.length - 3)
if (modifiertype == "png" || modifiertype == "gif" || modifiertype == "jpg") {
if (modifiertype == "png" || modifiertype == "gif" || modifiertype == "jpg" || modifiertype == "PNG" || modifiertype == "GIF" || modifiertype == "JPG") {
var tt = resultImages();
document.getElementById("searchresults").innerHTML = tt;
} else {
@ -220,8 +220,8 @@ function resultLine(type, item, linenumber) {
if (type == "image") {
html += "<div style=\"float:left\">";
html += "<a href=\"" + item.link + "\" class=\"thumblink\" onclick=\"return hs.expand(this)\">";
//html += "<img src=\"/ViewImage.png?maxwidth=96&amp;maxheight=96&amp;code=" + item.code + "\" alt=\"" + title + "\" />";
html += "<img src=\"" + item.link + "\" width=\"96\" height=\"96\" alt=\"" + title + "\" />";
html += "<img src=\"/ViewImage.png?maxwidth=96&amp;maxheight=96&amp;code=" + item.code + "\" alt=\"" + title + "\" />";
//html += "<img src=\"" + item.link + "\" width=\"96\" height=\"96\" alt=\"" + title + "\" />";
html += "</a>";
var name = title;
while ((p = name.indexOf("/")) >= 0) { name = name.substring(p + 1); }

@ -111,9 +111,11 @@ public final class QueryParams {
private final QueryGoal queryGoal;
public int itemsPerPage;
public int offset;
public final Pattern urlMask, prefer;
public Pattern urlMask;
public final Pattern prefer;
public final String protocol, tld, ext;
final boolean urlMask_isCatchall;
boolean urlMask_isCatchall;
public final Classification.ContentDomain contentdom;
public final String targetlang;
protected final Collection<Tagging.Metatag> metatags;
@ -246,6 +248,20 @@ public final class QueryParams {
throw new IllegalArgumentException("Not a valid regular expression: " + urlMask, ex);
}
this.urlMask_isCatchall = this.urlMask.toString().equals(catchall_pattern.toString());
if (this.urlMask_isCatchall) {
if (protocol != null) {
this.urlMask = Pattern.compile(protocol + ".*");
this.urlMask_isCatchall = false;
}
if (tld != null) {
this.urlMask = Pattern.compile(".*" + tld + ".*");
this.urlMask_isCatchall = false;
}
if (ext != null) {
this.urlMask = Pattern.compile(".*" + ext + ".*");
this.urlMask_isCatchall = false;
}
}
this.protocol = protocol;
this.tld = tld;
this.ext = ext;

Loading…
Cancel
Save