From 4990909178b15243e2a8f994c9411d6f50391725 Mon Sep 17 00:00:00 2001 From: michitux Date: Thu, 12 Apr 2007 18:21:17 +0000 Subject: [PATCH] Some bugfixes, new layout/style for image search results: * removed divide by zero bug when 20_dhtdistribution_busysleep is 0 * replaced German comment with wrong charset in source/de/anomic/plasma/plasmaCrawlBalancer.java by an English one * replaced the table-fix for floating behind snipped images by a br with clear * removed unnecessary old xhtml-files (were not in use, they were created when we weren't having xhtml for testing) * new layout for image-search results: replaced the old one with spans and tables inside (not valid) with new divs, now each image snippet container has the same size TODO: * the ids of the snippetLoading-divs aren't valid because ids must start with an alphabetic letter or an underscore, they have to be prefixed * in the returned snippet-xml is an unresolved pattern for status (the status is only set for text snippets) git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3566 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/env/base.css | 21 +- htroot/env/templates/xhtml-footer.template | 1 - htroot/env/templates/xhtml-header.template | 68 ---- htroot/env/templates/xhtml-metas.template | 8 - htroot/env/xhtml-style.css | 337 ------------------ htroot/js/yacysearch.js | 46 +-- htroot/yacysearch.html | 5 +- .../de/anomic/plasma/plasmaCrawlBalancer.java | 2 +- .../de/anomic/plasma/plasmaSwitchboard.java | 5 +- 9 files changed, 42 insertions(+), 451 deletions(-) delete mode 100644 htroot/env/templates/xhtml-footer.template delete mode 100644 htroot/env/templates/xhtml-header.template delete mode 100644 htroot/env/templates/xhtml-metas.template delete mode 100644 htroot/env/xhtml-style.css diff --git a/htroot/env/base.css b/htroot/env/base.css index 60557d662..561ee346c 100644 --- a/htroot/env/base.css +++ b/htroot/env/base.css @@ -194,14 +194,27 @@ tt, *.tt { .diff .added { font-family: monospace; } .diff .deleted { font-family: monospace; text-decoration: line-through; } -.imgtable { - margin: 1px; - padding: 1px; +.thumbcontainer { + margin: 2px; width: 100px; - border: 0px solid #aaaaaa; + height: 160px; /* 96px thumbnail + some lines of text */ float: left; } +.thumblink { + display:block; + width: 96px; + height: 96px; + margin: 2px; + line-height: 96px; + text-align: center; + overflow: hidden; +} + +.thumblink img { + vertical-align: bottom; +} + .hides .hoverShow { display: none; } diff --git a/htroot/env/templates/xhtml-footer.template b/htroot/env/templates/xhtml-footer.template deleted file mode 100644 index 0c2eddc2b..000000000 --- a/htroot/env/templates/xhtml-footer.template +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htroot/env/templates/xhtml-header.template b/htroot/env/templates/xhtml-header.template deleted file mode 100644 index 09bd18fa3..000000000 --- a/htroot/env/templates/xhtml-header.template +++ /dev/null @@ -1,68 +0,0 @@ -
-

YaCy - Distributed Web Indexing - Administration

-
- -
diff --git a/htroot/env/templates/xhtml-metas.template b/htroot/env/templates/xhtml-metas.template deleted file mode 100644 index 98b7c2624..000000000 --- a/htroot/env/templates/xhtml-metas.template +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/htroot/env/xhtml-style.css b/htroot/env/xhtml-style.css deleted file mode 100644 index 153f4e220..000000000 --- a/htroot/env/xhtml-style.css +++ /dev/null @@ -1,337 +0,0 @@ -body { -background-color:#FFFFFF; -margin:0; -} -* { -font-family:Helvetica, Arial, sans-serif; -} -img { -border:0; -} -h1 { -font-size:2em; -font-style:normal; -margin-top:0pt; -margin-bottom:0pt; -} -h2 { -font-size:1.6em; -font-style:normal; -margin-top:0pt; -margin-bottom:0pt; -} -h3 { -font-size:1.4em; -font-style:normal; -margin-top:0pt; -margin-bottom:0pt; -} -h4 { -font-size:1.2em; -font-style:normal; -margin-top:0pt; -margin-bottom:0pt; -} -a, body, div, li, ol, span, table, td, tr, ul { -color:#000000; -font-style:normal; -margin-top:0px; -margin-bottom:0px; -} - -*.small { -font-size:1em; -font-style:normal; -margin-top:0px; -margin-bottom:0px; -} -body, div, li, ol, span, table, td, tr, ul { - -text-decoration:none; -} -a:hover { -color:#0000FF; -} -a.unknown { -color:#990000; -} -a.known { -color:#009900; -} -a, a.extern { -color:#000099; -} -*.xxxyellow { -color:#0000FF; -font-weight:bold; -text-decoration:none; -font-size:1.2em; -} -*.xxxblue { -color:#556699; -font-weight:bold; -text-decoration:none; -font-size:1.2em; -} -*.tt { -font-family:Courier,Terminal,sans-serif; -font-size:1em; -} - -div.menugroup h3, .MenuHeader { -background-color: #4070a0; -color:white; -font-size:1em; -font-weight:bold; -margin-top:10px; -padding:1px 10px; -} -ul.menu li a { -display:block; -background-color: #bdcdd4; -text-decoration:none; -margin-top:1px; -margin-bottom:1px; -padding:2px 10px; -font-size:1em; -} -ul.menu li a:hover { -color:#0088BB; -} -ul.menu li a.lock { -background:#bdcdd4 url(/env/grafics/lock.gif) 2px center no-repeat; -padding-left:15px; -} -.MenuTopItem { -background-color: #bdcdd4; -font-weight:bold; -text-decoration:none; -padding-top: 3; -font-size:1em; -padding-bottom: 3; -} -.MenuSubItem { -background-color: #bdcdd4; -font-weight:bold; -text-decoration:none; -font-size:1em; -padding-top: 3; -padding-bottom: 3; -} -a.MenuItemLink { -color: black; -font-weight:bold; -font-size:1em; -text-decoration:none; -} -a.MenuItemLink:hover { -color:#0088BB; -font-weight:bold; -text-decoration:none; -} -.MenuSubSpacer { -padding-left: 2; -padding-right: 2; -background-color: #ffffff; -} -div.head h1 { -padding:4px; -background:#4070a0 url(/env/grafics/yacy.gif) 10px center no-repeat; -color: white; -font-weight: bold; -font-size: 1.6em; -text-align: center; -margin:0; -} -.TableHeader { -background-color: #88aaaa; -} -.TableCellDark { -background-color: #bbcccc; -} -.TableCellLight { -background-color: #ddeeee; -} -.TableCellSummary { -background-color: #ffbbaa; -} -.TableCellPassive { -background-color: lightgrey; -} -.WikiBackground, .MessageBackground { -background-color: #eeeeee; -} -.WikiTOCBox { -border: 1px solid #aaa; -background-color: #F8F8FF; -padding: 8px; -} -.WikiTOC { -color:#0000FF; -font-size: 10px; -text-decoration:underline; -} -form.search { -width:35em; -text-align:center; -margin:0 auto; -} -.bookmarkTags{ -color: #007050; -font-weight:bold; -text-decoration:none; -white-space:nowrap; -} -.bookmarkTitle{ -line-height: 120%; -color: #4070a0; -font-size:17px; -font-weight:bold; -text-decoration:none; -} -.bookmarkDescription{ -font-style:normal; -} -.bookmarkAction{ -color: #999999; -text-decoration:none; -} -img.bookmarkIcon, img.deleteIcon, img.recommendIcon { -height: 16px; -width: 16px; -} -form.search fieldset { -border:0; -padding:0; -margin:2px; -} - -form.search table { -margin:0 auto; -text-align:left; -} - -div.menu { -padding:0; -margin:0; -position:absolute; -top:3em; -left:0; -width:11em; -} - -ul.menu { -padding:0; -margin:0; -} - -ul.menu li { -list-style:none; -margin:0; -padding:0; -background-color: #bdcdd4; -border:1px solid white; -} - -div.content { -position:absolute; -top:3em; -left:12em; -right:10px; -margin:0; -} - -h2.yacy { -margin:10px auto; -text-align:center; -padding-top:130px; -width:256px; -min-width:256px; -background:url(/env/grafics/kaskelix.png) top center no-repeat; -} - -div.urlactions { -float:left; -} - -div.urlactions a { -display:block; -} - -a.deletelink:hover { -background:url(/env/grafics/minus.gif) center center no-repeat; -} - -a.bookmarklink:hover { -background:url(/env/grafics/plus.gif) center center no-repeat; -} - -p.info { -margin-top:5em; -border-top:1px solid gray; -padding-top:5px; -text-align:center; -} - -div.searchresults p.url a { -color:#008000; -} - -div.searchresults p, div.searchresults h4 { -margin:2px 2px 2px 22px; -} - -.snippetLoading { -color:#999999; -} - -.snippetLoaded { -color:black; -font-style:italic; -} - -.snippetError { -color:red; -font-style:italic; -} - -.settingsValue { -color:#556699; -font-weight:bold; -} - -div.searchresults { -padding-top:1em; -margin-bottom:1em; -border-top:1px #000 dashed; -} - -div.searchresults a { -color:#000099; -text-decoration:none; -} - -div.searchresults a:hover { -color:#0000FF; -text-decoration:underline; -} -div.menugroup { -margin-left:5px; -margin-bottom:10px; -clear:left; -} - -.Headline { -color: white; -font-weight: bold; -font-size: 160%; -text-align: center; -background-color: #4070a0; -height: 36px; -width:100%; -} - -.Heading { -background-color: #4070a0; -height: 36px; -} \ No newline at end of file diff --git a/htroot/js/yacysearch.js b/htroot/js/yacysearch.js index ef5487a5f..ce20a6403 100644 --- a/htroot/js/yacysearch.js +++ b/htroot/js/yacysearch.js @@ -25,10 +25,10 @@ function AllMediaSnippets(mediatype) { function AllImageSnippets() { var query = document.getElementsByName("former")[0].value; - var span = document.getElementsByTagName("span"); - for(var x=0;x 0) { - span.className = "snippetLoaded"; + div.className = "snippetLoaded"; for (i = 0; i < links; i++) { var type = response.getElementsByTagName("type")[i].firstChild.data; var href = response.getElementsByTagName("href")[i].firstChild.data; @@ -177,38 +177,28 @@ function handleImageState(req) { var imganchor = document.createElement("a"); imganchor.setAttribute("href", href); + imganchor.setAttribute("class", "thumblink") imganchor.appendChild(img); var nameanchor = document.createElement("a"); nameanchor.setAttribute("href", href); nameanchor.appendChild(document.createTextNode(name)); - var col1 = document.createElement("td"); - col1.setAttribute("width", "100"); - col1.appendChild(imganchor); - var row1 = document.createElement("tr"); - //row1.setAttribute("class", "TableCellLight"); - row1.appendChild(col1); + var textcontainer = document.createElement("div"); + textcontainer.setAttribute("class", "TableCellDark"); + textcontainer.appendChild(nameanchor); - var col2 = document.createElement("td"); - col2.setAttribute("width", "100"); - col2.appendChild(nameanchor); - - var row2 = document.createElement("tr"); - row2.setAttribute("class", "TableCellDark"); - row2.appendChild(col2); - - var table = document.createElement("table"); - table.setAttribute("class", "imgtable"); - table.appendChild(row1); - table.appendChild(row2); - span.appendChild(table); + var thumbcontainer = document.createElement("div"); + thumbcontainer.setAttribute("class", "thumbcontainer"); + thumbcontainer.appendChild(imganchor); + thumbcontainer.appendChild(textcontainer); + div.appendChild(thumbcontainer); //span.appendChild(imganchor); } } else { - span.className = "snippetError"; - span.appendChild(document.createTextNode("")); + div.className = "snippetError"; + div.appendChild(document.createTextNode("")); } } diff --git a/htroot/yacysearch.html b/htroot/yacysearch.html index 386a2ad5d..4d3dd4dd6 100644 --- a/htroot/yacysearch.html +++ b/htroot/yacysearch.html @@ -195,11 +195,10 @@ document.getElementById("Enter").value = "search again - catch up more links"; :: -
#{results}# - loading snippet from #[urlname]# +
loading snippet from #[urlname]#
#{/results}# -
+
:: #{results}# diff --git a/source/de/anomic/plasma/plasmaCrawlBalancer.java b/source/de/anomic/plasma/plasmaCrawlBalancer.java index f4a256ff5..b70f34995 100644 --- a/source/de/anomic/plasma/plasmaCrawlBalancer.java +++ b/source/de/anomic/plasma/plasmaCrawlBalancer.java @@ -189,7 +189,7 @@ public class plasmaCrawlBalancer { int componentsize = urlFileStack.size() + urlRAMStack.size() + sizeDomainStacks(); try { if (componentsize != urlFileIndex.size()) { - // hier ist urlIndexFile.size() immer grš§er. warum? + // here is urlIndexFile.size() always bigger. why? if (kelondroRecords.debugmode) { serverLog.logWarning("PLASMA BALANCER", "size operation wrong in " + stackname + " - componentsize = " + componentsize + ", urlFileIndex.size() = " + urlFileIndex.size()); } diff --git a/source/de/anomic/plasma/plasmaSwitchboard.java b/source/de/anomic/plasma/plasmaSwitchboard.java index 2b6144cf3..c32c8a95b 100644 --- a/source/de/anomic/plasma/plasmaSwitchboard.java +++ b/source/de/anomic/plasma/plasmaSwitchboard.java @@ -1647,7 +1647,10 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser return false; } - if ((sbQueue.size() == 0) && ((getThread(CRAWLJOB_LOCAL_CRAWL).getJobCount() == 0))) setPerformance((int) Math.max(120, 60000 / getConfigLong(INDEX_DIST_BUSYSLEEP, 6000))); // if there is no activity, set low performance + if ((sbQueue.size() == 0) && ((getThread(CRAWLJOB_LOCAL_CRAWL).getJobCount() == 0))) { + long sleep = getConfigLong(INDEX_DIST_BUSYSLEEP, 6000); + setPerformance((int) Math.max(120, 60000 / (sleep==0?1:sleep))); // if there is no activity, set low performance + } // flush some entries from the RAM cache if (sbQueue.size() == 0) wordIndex.flushCacheSome(); // permanent flushing only if we are not busy