Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

- some small changes to highslide integration to get it working... (does not work yet) - performance enhancement for url list parser

orbiter3441ec3928dd
diff --git a/.classpath b/.classpath
index e9f4050d3..f12631ede 100644
--- a/.classpath
+++ b/.classpath
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry excluding="env/|htdocsdefault/|proxymsg/|yacy/|env/|yacy/user/" kind="src" path="htroot"/>
- <classpathentry excluding="user/" kind="src" path="htroot/yacy"/>
+ <classpathentry excluding="env/|htdocsdefault/|proxymsg/|yacy/|env/|yacy/user/|yacy/user/" kind="src" path="htroot"/>
+ <classpathentry excluding="user/|user/" kind="src" path="htroot/yacy"/>
<classpathentry kind="src" path="htroot/env"/>
<classpathentry kind="src" path="source"/>
+ <classpathentry kind="src" path="htroot/yacy/user"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="lib/tar.jar"/>
<classpathentry kind="lib" path="libx/axis-ant.jar"/>
diff --git a/htroot/env/highslide.css b/htroot/env/highslide.css
index 2df28018b..6a49c4faf 100644
--- a/htroot/env/highslide.css
+++ b/htroot/env/highslide.css
@@ -1,20 +1,20 @@
/* highslide styles for rounded boxes, taken from highslide demo page */
.highslide {
- cursor: url(highslide/graphics/zoomin.cur), pointer;
+ cursor: pointer;
outline: none;
}
.highslide-active-anchor img {
- visibility: hidden;
+ visibility: hidden;
}
.highslide img {
border: 2px solid gray;
}
.highslide:hover img {
- border: 2px solid white;
+ border: 2px solid white;
}
.highslide-wrapper {
- background: white;
+ background: white;
}
.highslide-image {
border: 2px solid white;
@@ -43,7 +43,6 @@
background-color: white;
padding-left: 22px;
- background-image: url(highslide/graphics/loader.white.gif);
background-repeat: no-repeat;
background-position: 3px 1px;
}
@@ -61,11 +60,10 @@ a.highslide-credits:hover i {
}
a.highslide-full-expand {
- background: url(highslide/graphics/fullexpand.gif) no-repeat;
- display: block;
- margin: 0 10px 10px 0;
- width: 34px;
- height: 34px;
+ display: block;
+ margin: 0 10px 10px 0;
+ width: 34px;
+ height: 34px;
}
/* These must always be last */
diff --git a/htroot/js/highslide.js b/htroot/js/highslide.js
index 079beeb67..60b043856 100755
--- a/htroot/js/highslide.js
+++ b/htroot/js/highslide.js
@@ -1,4 +1,4 @@
- /******************************************************************************
+/******************************************************************************
Name: Highslide JS
Version: 3.3.9 (February 15 2008)
Config: default +positioning +events +unobtrusive +transitions +inline +ajax +iframe +flash
@@ -28,8 +28,7 @@ Your fair use and other rights are in no way affected by the above.
var hs = {
-// Apply your own settings here, or override them in the html file.
-graphicsDir : '/env/grafics/highslide/',
+// Apply your own settings here, or override them in the html file.
restoreCursor : 'zoomout.cur', // necessary for preload
expandSteps : 10, // number of steps in zoom. Each step lasts for duration/step milliseconds.
expandDuration : 250, // milliseconds
@@ -64,7 +63,6 @@ transitions : [],
dimmingOpacity: 0, // Lightbox style dimming background
dimmingDuration: 50, // 0 for instant dimming
-
// HTML extension
previousText : 'Previous',
@@ -438,10 +436,7 @@ dim : function(exp) {
hs.dimmer.style.display = '';
hs.setDimmerSize();
hs.dimmer.owner = exp.key;
- if (hs.geckoMac && hs.dimmingGeckoFix)
- hs.dimmer.style.background = 'url('+ hs.graphicsDir + 'geckodimmer.png)';
- else
- hs.fade(hs.dimmer, 0, exp.dimmingOpacity, hs.dimmingDuration);
+ hs.fade(hs.dimmer, 0, exp.dimmingOpacity, hs.dimmingDuration);
},
unDim : function(key) {
if (!hs.dimmer) return;
@@ -708,10 +703,6 @@ preloadImages : function (number) {
// preload outlines
new hs.Outline(hs.outlineType, function () { hs.preloadFullImage(0)} );
-
-
- // preload cursor
- var cur = hs.createElement('img', { src: hs.graphicsDir + hs.restoreCursor });
},
@@ -824,17 +815,13 @@ hs.Outline = function (outlineType, onLoad) {
};
hs.Outline.prototype = {
-preloadGraphic : function () {
- var src = hs.graphicsDir + (hs.outlinesDir || "outlines/")+ this.outlineType +".png";
-
+preloadGraphic : function () {
var appendTo = hs.safari ? hs.container : null;
this.graphic = hs.createElement('img', null, { position: 'absolute', left: '-9999px',
top: '-9999px' }, appendTo, true); // for onload trigger
var pThis = this;
this.graphic.onload = function() { pThis.onGraphicLoad(); };
-
- this.graphic.src = src;
},
onGraphicLoad : function () {
@@ -857,8 +844,6 @@ onGraphicLoad : function () {
},
div,
true);
- } else {
- hs.setStyles(this.td[i], { background: 'url('+ this.graphic.src +') '+ (pos[i][0]*o)+'px '+(pos[i][1]*o)+'px'});
}
if (window.opera && (i == 3 || i ==5))
@@ -1884,7 +1869,7 @@ focus : function() {
if (this.isImage) {
this.content.title = hs.restoreTitle;
- hs.styleRestoreCursor = window.opera ? 'pointer' : 'url('+ hs.graphicsDir + hs.restoreCursor +'), pointer';
+ hs.styleRestoreCursor = 'pointer';
if (hs.ie && hs.ieVersion() < 6) hs.styleRestoreCursor = 'hand';
this.content.style.cursor = hs.styleRestoreCursor;
}
diff --git a/htroot/yacy/user/default.css b/htroot/yacy/user/default.css
index 7e46dfed3..98792ea45 100755
--- a/htroot/yacy/user/default.css
+++ b/htroot/yacy/user/default.css
@@ -528,3 +528,24 @@ div.ProgressBarFill {
left: 0px;
top: 0px;
}
+
+.thumbcontainer {
+ margin: 2px;
+ width: 100px;
+ height: 160px; /* 96px thumbnail + some lines of text */
+ float: left;
+}
+
+a.thumblink {
+ display:block;
+ width: 96px;
+ height: 96px;
+ margin: 2px;
+ line-height: 96px;
+ text-align: center;
+ overflow: hidden;
+}
+
+.thumblink img {
+ vertical-align: bottom;
+}
diff --git a/htroot/yacy/user/ysearch.html b/htroot/yacy/user/ysearch.html
index bd1f99b7b..5a2d2af9e 100755
--- a/htroot/yacy/user/ysearch.html
+++ b/htroot/yacy/user/ysearch.html
@@ -11,12 +11,11 @@ Released for free under a Creative Commons Attribution 2.5 License
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="default.css" rel="stylesheet" type="text/css" />
-
<script type="text/javascript" src="/js/ajax.js"></script>
<script type="text/javascript" src="/js/xml.js"></script>
<script type="text/javascript" src="/js/yacysearch.js"></script>
<script type="text/javascript" src="/js/highslide.js"></script>
- <link rel="stylesheet" type="text/css" media="screen" href="env/highslide.css" />
+ <link rel="stylesheet" type="text/css" media="screen" href="/env/highslide.css" />
<script type="text/javascript">hs.outlineType = 'rounded-white';</script>
</head>
<body>
diff --git a/htroot/yacy/user/ysearchitem.html b/htroot/yacy/user/ysearchitem.html
index b3a2406cf..a210af865 100644
--- a/htroot/yacy/user/ysearchitem.html
+++ b/htroot/yacy/user/ysearchitem.html
@@ -12,8 +12,8 @@
<a href="#[href]#" class="thumblink" onclick="return hs.expand(this)">
<img src="/ViewImage.png?maxwidth=96&maxheight=96&code=#[code]#" alt="#[name]#">
</a>
- <div class="highslide-caption">#[name]#</div>
- <div class="TableCellDark"><a href="#[href]#">#[name]#</a></div>
+ <div class="highslide-caption"><a href="#[href]#">#[name]#</a></div>
+ <div class="snippet"><a href="#[href]#">#[name]#</a></div>
</div>
#{/items}#
::
diff --git a/htroot/yacysearch.html b/htroot/yacysearch.html
index ff4a1f501..755f3bebc 100644
--- a/htroot/yacysearch.html
+++ b/htroot/yacysearch.html
@@ -8,7 +8,7 @@
<script type="text/javascript" src="/js/xml.js"></script>
<script type="text/javascript" src="/js/yacysearch.js"></script>
<script type="text/javascript" src="/js/highslide.js"></script>
- <link rel="stylesheet" type="text/css" media="screen" href="env/highslide.css" />
+ <link rel="stylesheet" type="text/css" media="screen" href="/env/highslide.css" />
<script type="text/javascript">hs.outlineType = 'rounded-white';</script>
</head>
<body id="yacysearch"#(input)#:: onload="document.getElementById('search').focus()":: onload="document.getElementById('search').focus()"#(/input)#>
diff --git a/htroot/yacysearchitem.html b/htroot/yacysearchitem.html
index 17174de11..da06f31e5 100644
--- a/htroot/yacysearchitem.html
+++ b/htroot/yacysearchitem.html
@@ -25,8 +25,8 @@
<a href="#[href]#" class="thumblink" onclick="return hs.expand(this)">
<img src="/ViewImage.png?maxwidth=96&maxheight=96&code=#[code]#" alt="#[name]#">
</a>
- <div class="highslide-caption">#[name]#</div>
- <div class="TableCellDark"><a href="#[href]#">#[name]#</a></div>
+ <div class="highslide-caption"><a href="#[href]#">#[name]#</a></div>
+ <div class="TableCellDark"><a href="#[href]#">#[name]#</a></div>
</div>
#{/items}#
::
diff --git a/source/de/anomic/plasma/plasmaParser.java b/source/de/anomic/plasma/plasmaParser.java
index c4f8dca6b..a7001118e 100644
--- a/source/de/anomic/plasma/plasmaParser.java
+++ b/source/de/anomic/plasma/plasmaParser.java
@@ -788,12 +788,13 @@ public final class plasmaParser {
static Map<yacyURL, String> allSubpaths(Set<?> links) {
// links is either a Set of Strings (urls) or a Set of htmlFilterImageEntries
- HashMap<yacyURL, String> v = new HashMap<yacyURL, String>();
+ HashSet<String> h = new HashSet<String>();
Iterator<?> i = links.iterator();
Object o;
yacyURL url;
String u;
int pos;
+ int l;
while (i.hasNext()) try {
o = i.next();
if (o instanceof yacyURL) url = (yacyURL) o;
@@ -805,15 +806,26 @@ public final class plasmaParser {
}
u = url.toNormalform(true, true);
if (u.endsWith("/")) u = u.substring(0, u.length() - 1);
- pos = u.lastIndexOf("/");
+ pos = u.lastIndexOf('/');
while (pos > 8) {
+ l = u.length();
u = u.substring(0, pos + 1);
- url = new yacyURL(u, null);
- if (!(v.containsKey(url))) v.put(url, "sub");
+ h.add(u);
u = u.substring(0, pos);
- pos = u.lastIndexOf("/");
+ assert (u.length() < l) : "u = " + u;
+ pos = u.lastIndexOf('/');
}
} catch (MalformedURLException e) {}
+ // now convert the strings to yacyURLs
+ i = h.iterator();
+ HashMap<yacyURL, String> v = new HashMap<yacyURL, String>();
+ while (i.hasNext()) {
+ u = (String) i.next();
+ try {
+ url = new yacyURL(u, null);
+ v.put(url, "sub");
+ } catch (MalformedURLException e) {}
+ }
return v;
}