- major rework on YaCy-UI

- search results are retrieved from rss/xml, no other servlet needed
- added double accordion sidebar menus

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4718 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
apfelmaennchen 17 years ago
parent c270d02176
commit 2149728227

@ -1,5 +1,34 @@
/* Search */
/* Main */
div.main {
float:left;
width:100%;
}
div.top {
float:left;
width:75%;
margin-top: -1.0em;
}
/* Searchbox */
.searchbox {
float:left;
width:800px;
}
.searchbox .boxed h3 {
font-family: Helvetica,Arial,sans-serif;
display:block;
padding:5px 15px;
margin-top: 0;
margin-bottom: 0px;
text-decoration: none;
font-weight: bold;
font-size: 14px;
color: black;
border-top: 1px solid #FFFFFF;
border-bottom: 1px solid #999;
background: url(../img/box800.png) no-repeat;
}
#searchtext {
width: 280px;
margin-top: 1em;
@ -9,8 +38,7 @@
font: normal small Arial, Helvetica, sans-serif;
color: #999999;
}
#searchbutton {
#searchbutton, .selectbox {
width: 100px;
margin-top: 1em;
margin-bottom: .5em;
@ -19,60 +47,69 @@
font: normal small Arial, Helvetica, sans-serif;
color: #999999;
}
/* Main */
div.main {
float:left;
width:70%;
.filter {
width: 180px;
margin-bottom: .5em;
padding: 2px 5px;
border: 1px solid #CCCCCC;
font: normal small Arial, Helvetica, sans-serif;
color: #999999;
}
.selector {
width: 100px;
margin-bottom: .5em;
padding: 2px 5px;
border: 1px solid #CCCCCC;
font: normal small Arial, Helvetica, sans-serif;
color: #999999;
}
.small {
font: normal Arial, Helvetica, sans-serif;
font-size: 9px;
}
.normal {
font: normal small Arial, Helvetica, sans-serif;
}
/* Sidebar */
div.sidebar {
margin-top: 1.5em;
margin-left: 2em;
float:left;
margin-left: 1em;
margin-right: 1em;
float:right;
width:250px;
}
/* Boxed Style */
.searchbox {
float:left;
width:600px;
.menu img {
width: 32px;
height: 32px;
padding: 2px 16px 2px 8px;
vertical-align: middle;
}
.boxed{
margin-bottom: 1em;
img {
vertical-align: top;
}
.boxed .title {
display: block;
height: 25px;
padding: 5px 0 0 10px;
font-weight: bold;
.sidebar .boxed h3 {
font-family: Helvetica,Arial,sans-serif;
background: url(../img/tab.png) no-repeat;
}
.sidebar .boxed .title {
display: block;
height: 25px;
padding: 5px 0 0 10px;
display:block;
padding:5px 15px;
margin-top: 0;
margin-bottom: 0px;
text-decoration: none;
font-weight: bold;
font-family: Helvetica,Arial,sans-serif;
font-size: 14px;
color: black;
background: url(../img/box250.png) no-repeat;
border-top: 1px solid #FFFFFF;
border-bottom: 1px solid #999;
}
.searchbox .boxed .title {
display: block;
height: 25px;
padding: 5px 0 0 10px;
font-weight: bold;
font-family: Helvetica,Arial,sans-serif;
background: url(../img/box600.png) no-repeat;
}
/* Boxed Style */
.boxed{
margin-top: 1em;
margin-bottom: 1em;
}
.boxed .content {
font-family: Helvetica,Arial,sans-serif;
border: 1px solid #000000;
@ -122,6 +159,24 @@ table.ytable thead tr .headerSortDown {
table.ytable thead tr .headerSortDown, table.ytable thead tr .headerSortUp {
background-color: #8dbdd8;
}
table.ytable img {
border:0;
padding-top:6px;
}
table.ystat {
text-align: left;
height: 75px;
margin-left: 10px;
width: 200px;
padding-bottom: 5px;
}
table.ystat td {
vertical-align: middle;
width: 100px;
font-family: Courier New,Courier,monospace;
font-size: 10px;
}
/* YaCy Bookmarks ---------------------------*/
.url {
@ -153,14 +208,21 @@ h3.linktitle {
div.searchresults {
width:100%;
margin-top: 1.5em;
margin-top: 1.0em;
margin-left: 5px;
}
div.searchselect {
width:100%;
margin-top: 1.0em;
margin-left: 5px;
background-color:#F0F0F6;
}
div.searchresults.hidden {
display:none;
}
.searchresults h3.linktitle {
.searchresults h3.linktitle, .searchselect h3.linktitle {
margin:2px;
padding-left: 20px;
margin-bottom: -0.5em;
@ -178,24 +240,77 @@ div.searchresults.hidden {
.snippet b {
color: black;
}
.searchresults .linktitle a {
.searchresults .linktitle a, .searchselect .linktitle a {
color:#239AFF;
text-decoration:none;
}
.searchresults .url {
.searchresults .url, .searchselect .url {
font-size: 0.9em;
line-height: 1.2em;
margin-bottom:0.6em;
margin-left:22px;
}
.searchresults .url a {
.searchresults .url a,. searchselect .url a {
color:#20A020;
text-decoration:none;
}
img.favicon{
margin: 0px 4px 0px -20px;
width: 16px;
width: 16px;pagesize
height: 16px;
float: left;
vertical-align: middle;
margin-left: -20px;
}
/* <dl>, <dd>, <dt> */
dl.pairs dd {
float:right;
padding: 2px;
margin-right:15px;
}
dl.pairs dt {
float:left;
text-align:left;
padding: 5px;
}
/* jQuery Accordion */
.basic {
font-family: Helvetica,Arial,sans-serif;
width: 250px;
}
.basic div {
background-color: white;
margin-bottom : 10px;
border: none;
margin: 0px;
padding: 10px;
border: 1px solid black;
text-decoration: none;
font-size: 12px;
}
.basic p {
}
.basic h3 {
cursor:pointer;
display:block;
padding:5px 15px;
margin-top: 0;
margin-bottom: 0px;
text-decoration: none;
font-weight: bold;
font-size: 14px;
color: black;
background: url(../img/box250.png) no-repeat;
border-top: 1px solid #FFFFFF;
border-bottom: 1px solid #999;
}
.basic h3:hover {
}
.basic h3.selected {
}

@ -1,7 +1,8 @@
.pagination {
font-size: 1em;
margin-left: 26px;
margin-top: 25px;
margin-top: 20px;
margin-left: 10px;
float:left;
}
.pagination a {
@ -29,3 +30,5 @@
border-color:#999;
background:#fff;
}

@ -30,7 +30,9 @@ div.tablesorterPager select {
font: normal small Arial, Helvetica, sans-serif;
color: #999999;
}
div.tablesorterPager img{
vertical-align: middle;
}

@ -1,16 +1,16 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta content="text/css" http-equiv="Content-Style-Type">
<meta content="text/javascript" http-equiv="Content-Script-Type">
<title>YaCy - Peer-to-Peer Search Network</title>
<link media="screen" type="text/css" href="css/base.css" rel="stylesheet">
<link media="screen" type="text/css" href="css/ui.tabs.css" rel="stylesheet">
<link media="screen" type="text/css" href="css/jquery.tablesorter.pager.css" rel="stylesheet">
<link media="screen" type="text/css" href="css/jquery.pagination.css" rel="stylesheet">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="Content-Language" content="English, Englisch" />
<link media="screen" type="text/css" href="css/base.css" rel="stylesheet" />
<link media="screen" type="text/css" href="css/ui.tabs.css" rel="stylesheet" />
<link media="screen" type="text/css" href="css/jquery.tablesorter.pager.css" rel="stylesheet" />
<link media="screen" type="text/css" href="css/jquery.pagination.css" rel="stylesheet" />
<link media="screen" type="text/css" href="css/jquery.accordion.css" rel="stylesheet" />
<script src="js/jquery-1.2.3.min.js" type="text/javascript"></script>
<script src="js/jquery.tablesorter.min.js" type="text/javascript"></script>
@ -19,95 +19,147 @@
<script src="js/jquery.metadata.min.js" type="text/javascript"></script>
<script src="js/jquery.form.js" type="text/javascript"></script>
<script src="js/jquery.field.min.js" type="text/javascript"></script>
<script src="js/jquery.accordion.js" type="text/javascript"></script>
<script src="js/jquery.pagination.js" type="text/javascript"></script>
<script src="js/jquery-faviconize-1.0.js" type="text/javascript"></script>
<script src="js/ui.tabs.min.js" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
$(function() {
/* Initialize Tabs and set up close function */
var $tabs = $('#container ul').tabs()
.bind('add.ui-tabs', function(e, ui) {
var li = $(ui.tab).parents('li:eq(0)')[0];
$('<img class="close" src="/yacy/ui/img/cancel.png" border="0"/>').appendTo(li)
$('<img class="close" alt="close" src="/yacy/ui/img/cancel.png" border="0"/>')
.appendTo(li)
.bind('click', function() {
$tabs.tabs('remove', $('li', $tabs).index(li));
});
$tabs.tabs('remove', $('li', $tabs).index(li));
});
/* save search options from form to tab attributes*/
var search = $("input[@name='search']").getValue();
var contentdom = $("select[@name='contentdom']").getValue();
var count = $("select[@name='itemsPerPage']").getValue();
var offset = 0;
var resource = $("select[@name='resource']").getValue();
var constraint= $("select[@name='constraint']").getValue();
var prefermaskfilter = $("input[@name='prefermaskfilter']").getValue();
var urlmaskfilter = $("input[@name='urlmaskfilter']").getValue();
$('#' + ui.panel.id).attr('search', search);
$('#' + ui.panel.id).attr('contentdom', contentdom);
$('#' + ui.panel.id).attr('count', count);
$('#' + ui.panel.id).attr('offset', offset);
$('#' + ui.panel.id).attr('resource', resource);
$('#' + ui.panel.id).attr('constraint', constraint);
$('#' + ui.panel.id).attr('prefermaskfilter', prefermaskfilter);
$('#' + ui.panel.id).attr('urlmaskfilter', urlmaskfilter);
});
/* Insert Sidebar */
$('<div id="pager" class="boxed"></div>').appendTo('#sidebar')
$("#pager").load("sidebar/sidebar_pager.html");
$('<div id="example" class="boxed"></div>').appendTo('#sidebar')
$("#example").load("sidebar/sidebar.html");
$tabs.tabs()
.bind('select.ui-tabs', function(e, ui) {
/* set global variable tabid */
tabid = '#' + ui.panel.id;
/* set query string */
var search = $(tabid).attr('search');
var contentdom = $(tabid).attr('contentdom');
var count = $(tabid).attr('count');
var offset = $(tabid).attr('offset');
var resource = $(tabid).attr('resource');
var constraint= $(tabid).attr('constraint');
var prefermaskfilter = $(tabid).attr('prefermaskfilter');
var urlmaskfilter = $(tabid).attr('urlmaskfilter');
query = $(tabid).attr('resource')
+"&search="+search
+"&contentdom="+contentdom
+"&count="+count
+"&offset="+offset
+"&constraint="+constraint
+"&prefermaskfilter="+prefermaskfilter
+"&urlmaskfilter="+urlmaskfilter;
$("input[@name='search']").setValue(search);
$("select[@name='itemsPerPage']").setValue(count);
$("select[@name='contentdom']").setValue(contentdom);
$("select[@name='constraint']").setValue(constraint);
$("input[@name='prefermaskfilter']").setValue(prefermaskfilter);
$("input[@name='urlmaskfilter']").setValue(urlmaskfilter);
$('#yoptions').trigger('update');
});
/* Load Sidebar */
$("#side1").load("sidebar/sidebar_admin.html");
/* $("#side2").load("sidebar/sidebar_pager.html"); */
$("#side3").load("sidebar/sidebar.html");
/* Load Search Result into new Tab */
$('#searchbox').submit(function() {
var tabnr = $('#container > ul').tabs('length');
var result = "result.html?" + $('#searchbox').formSerialize();
var tabname = $("input[@name='search']").getValue();
$tabs.tabs('add', result, '*' + tabname);
$tabs.tabs('add', "ysearch.html", '*' + tabname);
$tabs.tabs('select',tabnr);
return false;
});
$("#searchtext").click(function () {
$("#side3").accordion("activate", 0);
});
});
//]]>
</script>
</head>
<body>
<div class="searchbox">
<div id="menu" class="boxed">
<div class="title">
YaCy Search
</div>
<div class="content">
<table style="text-align: left; width: 600px;" border="0" cellpadding="2" cellspacing="2">
<div class="top">
<div class="searchbox">
<div id="ysearch" class="boxed">
<h3>YaCy Search</h3>
<div class="content">
<table style="text-align: left; width: 800px;" border="0" cellpadding="2" cellspacing="2" summary="">
<tr>
<td style="height: 85px; text-align: left; width: 160px;">
<img style="width: 150px; height: 75px;" alt="YaCy" title="YaCy" src="img/kaskelix.png">
<td style="height: 60px; text-align: left; width: 140px;">
<img style="width: 120px; height: 60px;" alt="YaCy" title="YaCy" src="img/kaskelix.png"/>
</td>
<td style="text-align: left; vertical-align: middle; width: 440px;">
<form id="searchbox" class="search small" method="get" accept-charset="UTF-8">
<small>
<td style="text-align: left; vertical-align: middle; width: 660px;">
<form id="searchbox" method="get" accept-charset="UTF-8" action="">
<p>
<input id="searchtext" name="search" type="text" size="50" maxlength="80" value=""/>
<input id="searchbutton" type="submit" name="Enter" value="Search" />
<div class="ysearch">
<input type="radio" id="text" name="contentdom" value="text" checked="checked"/>
<label for="text">Text</label>&nbsp;&nbsp;
<input type="radio" id="images" name="contentdom" value="image"/>
<label for="images">Images</label>&nbsp;&nbsp;
<input type="radio" id="audio" name="contentdom" value="audio"/>
<label for="audio">Audio</label>&nbsp;&nbsp;
<input type="radio" id="video" name="contentdom" value="video"/>
<label for="video">Video</label>&nbsp;&nbsp;
<input type="radio" id="appl" name="contentdom" value="app"/>
<label for="appl">Applications</label>
</div>
<input type="hidden" name="former" value="" />
<input type="hidden" name="count" value="10" />
<input type="hidden" name="offset" value="0" />
<input type="hidden" name="resource" value="global" />
<input type="hidden" name="urlmaskfilter" value=".*" />
<input type="hidden" name="prefermaskfilter" value="" />
<input type="hidden" name="depth" value="0" />
<input type="hidden" name="cat" value="href" />
<input type="hidden" name="display" value="1" />
<input type="hidden" name="input" value="1" />
<input type="hidden" name="constraint" value="" />
</small>
<select name="contentdom" class="selectbox">
<option selected="selected" value="text">text</option>
<option value="image">image</option>
<option value="audio">audio</option>
<option value="video">video</option>
<option value="app">application</option>
</select>
<select name="resource" class="selectbox">
<option value="/yacysearch.rss?resource=global" selected="selected">freeworld</option>
<option value="/yacysearch.rss?resource=local" >local peer</option>
<option value="ymarks" >bookmarks</option>
<option value="http://sciencenet.fzk.de:8080/yacysearch.rss?resource=global" >sciencenet</option>
</select>
</p>
</form>
</td>
</tr>
</table>
</tr>
</table>
</div>
</div>
</div>
<div id="container" class="main">
<ul>
<!-- initial tabs only, dynamic tabs are loaded via jQuery -->
<li><a href="welcome.html" title="Welcome"><span>Welcome</span></a></li>
<li><a href="ranking.html" title="Ranking"><span>Ranking</span></a></li>
<li><a href="ymarks.html" title="Bookmarks"><span>Bookmarks</span></a></li>
</ul>
</div>
</div>
<div id="container" class="main">
<ul>
<li><a href="welcome.html" title="Welcome"><span>Welcome</span></a></li>
<li><a href="ymarks.html" title="Ymarks"><span>Y-Marks</span></a></li>
</ul>
<div id="sidebar" class="sidebar">
<div class="basic" id="side1"></div>
<div class="boxed" id="side2"></div>
<div class="basic" id="side3"></div>
</div>
<div id="sidebar" class="sidebar"><!-- Sidebar wird dynamisch geladen --></div>
</body>
</html>

@ -0,0 +1,44 @@
/**
* Faviconize (http://www.babylon-design.com/share/faviconize/)
* A jQuery plugin for displaying a favicon on an external link.
*
* Version 1.0
* March 4th, 2008
*
* Author : Samuel Le Morvan (http://www.babylon-design.com/)
*
* Inspired by:
* Ask the CSS Guy (http://www.askthecssguy.com/2006/12/hyperlink_cues_with_favicons.html)
*
*
**/
(function($){
$.fn.faviconize = function(e) {
var e = $.extend({position:'before', linkable:false, exceptions: new Array()}, e);
function faviconizePlace(a, h) {
switch(e.position) {
case "before" : a.before(h+'&nbsp;'); break;
case "after" : a.after('&nbsp;'+h); break;
default : break;
}
}
$(this).each(function() {
var a = $(this);
var r = a.attr("href").match(/http:\/\/[a-z0-9.-]*(\/)?/i);
var r = r[0] + ((r[1] == null) ? "/" : "");
if(r) {
if($.grep(e.exceptions, function(x) {x = (x.match(/\/$/) == null) ? x+"/" : x; return (x == r);}).length == 0) {
var f = r + 'favicon.ico';
var i = new Image(); $(i).attr("src", f);
var h = '<img src="'+f+'" alt="'+ ((e.linkable) ? a.text() : '') +'" '+ ((e.className) ? 'class="'+e.className+'"' : '') +' />';
h = (e.linkable) ? '<a href="'+a.attr("href")+'">'+h+'</a>' : h;
$(i).load(function() {faviconizePlace(a, h);});
$(i).error(function() {if(e.defaultImage) {faviconizePlace(a, h.replace(/src="(.*?)"/i, 'src="'+e.defaultImage+'"')); }});
}
}
});
}
})(jQuery);

@ -0,0 +1,311 @@
/*
* jQuery UI Accordion 1.6
*
* Copyright (c) 2007 Jörn Zaefferer
*
* http://docs.jquery.com/UI/Accordion
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* Revision: $Id: jquery.accordion.js 4876 2008-03-08 11:49:04Z joern.zaefferer $
*
*/
;(function($) {
// If the UI scope is not available, add it
$.ui = $.ui || {};
$.fn.extend({
accordion: function(options, data) {
var args = Array.prototype.slice.call(arguments, 1);
return this.each(function() {
if (typeof options == "string") {
var accordion = $.data(this, "ui-accordion");
accordion[options].apply(accordion, args);
// INIT with optional options
} else if (!$(this).is(".ui-accordion"))
$.data(this, "ui-accordion", new $.ui.accordion(this, options));
});
},
// deprecated, use accordion("activate", index) instead
activate: function(index) {
return this.accordion("activate", index);
}
});
$.ui.accordion = function(container, options) {
// setup configuration
this.options = options = $.extend({}, $.ui.accordion.defaults, options);
this.element = container;
$(container).addClass("ui-accordion");
if ( options.navigation ) {
var current = $(container).find("a").filter(options.navigationFilter);
if ( current.length ) {
if ( current.filter(options.header).length ) {
options.active = current;
} else {
options.active = current.parent().parent().prev();
current.addClass("current");
}
}
}
// calculate active if not specified, using the first header
options.headers = $(container).find(options.header);
options.active = findActive(options.headers, options.active);
if ( options.fillSpace ) {
var maxHeight = $(container).parent().height();
options.headers.each(function() {
maxHeight -= $(this).outerHeight();
});
var maxPadding = 0;
options.headers.next().each(function() {
maxPadding = Math.max(maxPadding, $(this).innerHeight() - $(this).height());
}).height(maxHeight - maxPadding);
} else if ( options.autoheight ) {
var maxHeight = 0;
options.headers.next().each(function() {
maxHeight = Math.max(maxHeight, $(this).outerHeight());
}).height(maxHeight);
}
options.headers
.not(options.active || "")
.next()
.hide();
options.active.parent().andSelf().addClass(options.selectedClass);
if (options.event)
$(container).bind((options.event) + ".ui-accordion", clickHandler);
};
$.ui.accordion.prototype = {
activate: function(index) {
// call clickHandler with custom event
clickHandler.call(this.element, {
target: findActive( this.options.headers, index )[0]
});
},
enable: function() {
this.options.disabled = false;
},
disable: function() {
this.options.disabled = true;
},
destroy: function() {
this.options.headers.next().css("display", "");
if ( this.options.fillSpace || this.options.autoheight ) {
this.options.headers.next().css("height", "");
}
$.removeData(this.element, "ui-accordion");
$(this.element).removeClass("ui-accordion").unbind(".ui-accordion");
}
}
function scopeCallback(callback, scope) {
return function() {
return callback.apply(scope, arguments);
};
}
function completed(cancel) {
// if removed while animated data can be empty
if (!$.data(this, "ui-accordion"))
return;
var instance = $.data(this, "ui-accordion");
var options = instance.options;
options.running = cancel ? 0 : --options.running;
if ( options.running )
return;
if ( options.clearStyle ) {
options.toShow.add(options.toHide).css({
height: "",
overflow: ""
});
}
$(this).triggerHandler("change.ui-accordion", [options.data], options.change);
}
function toggle(toShow, toHide, data, clickedActive, down) {
var options = $.data(this, "ui-accordion").options;
options.toShow = toShow;
options.toHide = toHide;
options.data = data;
var complete = scopeCallback(completed, this);
// count elements to animate
options.running = toHide.size() == 0 ? toShow.size() : toHide.size();
if ( options.animated ) {
if ( !options.alwaysOpen && clickedActive ) {
$.ui.accordion.animations[options.animated]({
toShow: jQuery([]),
toHide: toHide,
complete: complete,
down: down,
autoheight: options.autoheight
});
} else {
$.ui.accordion.animations[options.animated]({
toShow: toShow,
toHide: toHide,
complete: complete,
down: down,
autoheight: options.autoheight
});
}
} else {
if ( !options.alwaysOpen && clickedActive ) {
toShow.toggle();
} else {
toHide.hide();
toShow.show();
}
complete(true);
}
}
function clickHandler(event) {
var options = $.data(this, "ui-accordion").options;
if (options.disabled)
return false;
// called only when using activate(false) to close all parts programmatically
if ( !event.target && !options.alwaysOpen ) {
options.active.parent().andSelf().toggleClass(options.selectedClass);
var toHide = options.active.next(),
data = {
instance: this,
options: options,
newHeader: jQuery([]),
oldHeader: options.active,
newContent: jQuery([]),
oldContent: toHide
},
toShow = options.active = $([]);
toggle.call(this, toShow, toHide, data );
return false;
}
// get the click target
var clicked = $(event.target);
// due to the event delegation model, we have to check if one
// of the parent elements is our actual header, and find that
if ( clicked.parents(options.header).length )
while ( !clicked.is(options.header) )
clicked = clicked.parent();
var clickedActive = clicked[0] == options.active[0];
// if animations are still active, or the active header is the target, ignore click
if (options.running || (options.alwaysOpen && clickedActive))
return false;
if (!clicked.is(options.header))
return;
// switch classes
options.active.parent().andSelf().toggleClass(options.selectedClass);
if ( !clickedActive ) {
clicked.parent().andSelf().addClass(options.selectedClass);
}
// find elements to show and hide
var toShow = clicked.next(),
toHide = options.active.next(),
//data = [clicked, options.active, toShow, toHide],
data = {
instance: this,
options: options,
newHeader: clicked,
oldHeader: options.active,
newContent: toShow,
oldContent: toHide
},
down = options.headers.index( options.active[0] ) > options.headers.index( clicked[0] );
options.active = clickedActive ? $([]) : clicked;
toggle.call(this, toShow, toHide, data, clickedActive, down );
return false;
};
function findActive(headers, selector) {
return selector != undefined
? typeof selector == "number"
? headers.filter(":eq(" + selector + ")")
: headers.not(headers.not(selector))
: selector === false
? $([])
: headers.filter(":eq(0)");
}
$.extend($.ui.accordion, {
defaults: {
selectedClass: "selected",
alwaysOpen: true,
animated: 'slide',
event: "click",
header: "a",
autoheight: true,
running: 0,
navigationFilter: function() {
return this.href.toLowerCase() == location.href.toLowerCase();
}
},
animations: {
slide: function(options, additions) {
options = $.extend({
easing: "swing",
duration: 300
}, options, additions);
if ( !options.toHide.size() ) {
options.toShow.animate({height: "show"}, options);
return;
}
var hideHeight = options.toHide.height(),
showHeight = options.toShow.height(),
difference = showHeight / hideHeight;
options.toShow.css({ height: 0, overflow: 'hidden' }).show();
options.toHide.filter(":hidden").each(options.complete).end().filter(":visible").animate({height:"hide"},{
step: function(now) {
var current = (hideHeight - now) * difference;
if ($.browser.msie || $.browser.opera) {
current = Math.ceil(current);
}
options.toShow.height( current );
},
duration: options.duration,
easing: options.easing,
complete: function() {
if ( !options.autoheight ) {
options.toShow.css("height", "auto");
}
options.complete();
}
});
},
bounceslide: function(options) {
this.slide(options, {
easing: options.down ? "bounceout" : "swing",
duration: options.down ? 1000 : 200
});
},
easeslide: function(options) {
this.slide(options, {
easing: "easeinout",
duration: 700
})
}
}
});
})(jQuery);

@ -0,0 +1,200 @@
/*
* jQuery Keyboard Navigation Plugin - Current
* http://www.amountaintop.com/projects/keynav/
*
* To use, download this file to your server, save as keynav.js,
* and add this HTML into the <head>...</head> of your web page:
* <script type="text/javascript" src="keynav.js"></script>
*
* Copyright (c) 2006 Mike Hostetler <http://www.amountaintop.com/>
* Licensed under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*/
$.keynav = new Object();
$.fn.keynav = function (onClass,offClass) {
//Initialization
var kn = $.keynav;
if(!kn.init) {
kn.el = new Array();
$(document).keydown(function(e) {
var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0;
switch(key) {
case 37:
$.keynav.goLeft();
break;
case 38:
$.keynav.goUp();
break;
case 39:
$.keynav.goRight();
break;
case 40:
$.keynav.goDown();
break;
case 13:
$.keynav.activate();
break;
}
});
kn.init = true;
}
return this.each(function() {
$.keynav.reg(this,onClass,offClass);
});
}
$.fn.keynav_sethover = function(onClass,offClass) {
return this.each(function() {
this.onClass = onClass;
this.offClass = offClass;
});
}
$.keynav.reset = function() {
var kn = $.keynav;
kn.el = new Array();
}
$.keynav.reg = function(e,onClass,offClass) {
var kn = $.keynav;
e.pos = $.keynav.getPos(e);
e.onClass = onClass;
e.offClass = offClass;
e.onmouseover = function (e) { $.keynav.setActive(this); };
kn.el.push(e);
}
$.keynav.setActive = function(e) {
var kn = $.keynav;
var cur = $.keynav.getCurrent();
$(cur).trigger('blur');
for(var i=0;i<kn.el.length;i++) {
var tmp = kn.el[i];
$(tmp).removeClass().addClass(tmp.offClass);
}
$(e).removeClass().addClass(e.onClass);
$(e).trigger('focus');
kn.currentEl = e;
}
$.keynav.getCurrent = function () {
var kn = $.keynav;
if(kn.currentEl) {
var cur = kn.currentEl;
}
else {
var cur = kn.el[0];
}
return cur;
}
$.keynav.quad = function(cur,fQuad) {
var kn = $.keynav;
var quad = Array();
for(i=0;i<kn.el.length;i++) {
var el = kn.el[i];
if(cur == el) continue;
if(fQuad((cur.pos.cx - el.pos.cx),(cur.pos.cy - el.pos.cy)))
quad.push(el);
}
return quad;
}
$.keynav.activateClosest = function(cur,quad) {
var closest;
var od = 1000000;
var nd = 0;
var found = false;
for(i=0;i<quad.length;i++) {
var e = quad[i];
nd = Math.sqrt(Math.pow(cur.pos.cx-e.pos.cx,2)+Math.pow(cur.pos.cy-e.pos.cy,2));
if(nd < od) {
closest = e;
od = nd;
found = true;
}
}
if(found)
$.keynav.setActive(closest);
}
$.keynav.goLeft = function () {
var cur = $.keynav.getCurrent();
var quad = $.keynav.quad(cur,function (dx,dy) {
if((dy >= 0) && (Math.abs(dx) - dy) <= 0)
return true;
else
return false;
});
$.keynav.activateClosest(cur,quad);
}
$.keynav.goRight = function () {
var cur = $.keynav.getCurrent();
var quad = $.keynav.quad(cur,function (dx,dy) {
if((dy <= 0) && (Math.abs(dx) + dy) <= 0)
return true;
else
return false;
});
$.keynav.activateClosest(cur,quad);
}
$.keynav.goUp = function () {
var cur = $.keynav.getCurrent();
var quad = $.keynav.quad(cur,function (dx,dy) {
if((dx >= 0) && (Math.abs(dy) - dx) <= 0)
return true;
else
return false;
});
$.keynav.activateClosest(cur,quad);
}
$.keynav.goDown = function () {
var cur = $.keynav.getCurrent();
var quad = $.keynav.quad(cur,function (dx,dy) {
if((dx <= 0) && (Math.abs(dy) + dx) <= 0)
return true;
else
return false;
});
$.keynav.activateClosest(cur,quad);
}
$.keynav.activate = function () {
var kn = $.keynav;
$(kn.currentEl).trigger('click');
}
/**
* This function was taken from Stefan's exellent interface plugin
* http://www.eyecon.ro/interface/
*
* I included it in this library's namespace because the functions aren't
* quite the same.
*/
$.keynav.getPos = function (e)
{
var l = 0;
var t = 0;
var w = $.intval($.css(e,'width'));
var h = $.intval($.css(e,'height'));
while (e.offsetParent){
l += e.offsetLeft + (e.currentStyle?$.intval(e.currentStyle.borderLeftWidth):0);
t += e.offsetTop + (e.currentStyle?$.intval(e.currentStyle.borderTopWidth):0);
e = e.offsetParent;
}
l += e.offsetLeft + (e.currentStyle?$.intval(e.currentStyle.borderLeftWidth):0);
t += e.offsetTop + (e.currentStyle?$.intval(e.currentStyle.borderTopWidth):0);
var cx = Math.round(t+(h/2));
var cy = Math.round(l+(w/2));
return {x:l, y:t, w:w, h:h, cx:cx, cy:cy};
};
/**
* This function was taken from Stefan's exellent interface plugin
* http://www.eyecon.ro/interface/
*/
$.intval = function (v)
{
v = parseInt(v);
return isNaN(v) ? 0 : v;
};

@ -0,0 +1,16 @@
<script type="text/javascript">
$(document).ready(function() {
$("#side3").accordion("activate", 1);
});
</script>
<h3>Ranking</h3>
<p>
One of the most cited reasons for YaCy is the freely configurable ranking system. The ranking settings have a major impact on
the displayed search results, so it is worthwhile looking at them. For example searching for current news you might
want to give pages with a more recent date a higher rank, whereas searching for a rare documentation other ranking factors are
more helpful. As YaCy knows over 30 ranking factors, YaCy-UI will offer for the ease of use ranking pre-sets (most relevant, most popular,
most recent) to choose from. Currently you can set the <a href="http://localhost:8080/Ranking_p.html">default ranking</a>
via the existing user interface.
</p>

@ -1,15 +1,85 @@
<div class="title">Sidebar:</div>
<div class="content">
<ul id="test">
<li>Sidebar Example</li>
<li>Sidebar Example</li>
<li>Sidebar Example</li>
<li>Sidebar Example</li>
<li>Sidebar Example</li>
</ul>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
$("#side3").accordion({
autoheight: false,
header: "h3"
});
});
//]]>
</script>
<h3>Search Options</h3> <!-- 0 -->
<div>
<form id="yoptions" class="small" method="get" action="" accept-charset="UTF-8">
<p>
<label for="itemsPerPage">Items per page: </label>
<br />
<select class="selector" name="itemsPerPage">
<option selected="selected" value="5">5</option>
<option value="10">10</option>
<option value="25">25</option>
<option value="50">50</option>
</select>
<br />
<label for="constraint">Constraint:</label>
<br />
<select class="selector" id="constraint" name="constraint">
<option value="&nbsp;" selected="selected">all pages</option>
<option value="AQAAAA" >index pages</option>
</select>
<br />
<label for="urlmaskfilter">URL mask:</label>
<br />
<input class="filter" name="urlmaskfilter" value=".*" type="text" size="12" maxlength="80" />
<img src="img-2/question_blue.png" alt="help" title="help" />
<br />
<label for="prefermaskfilter">Prefer mask:</label>
<br />
<input class="filter" name="prefermaskfilter" value="&nbsp;" type="text" size="12" maxlength="80" />
<img src="img-2/question_blue.png" alt="help" title="help" />
<br />
<label for="resource">Language:</label>
<br />
<select class="filter" id="language" name="language">
<option value="any" selected="selected">any language</option>
<option value="ger" >German</option>
<option value="eng" >English</option>
</select>
</p>
</form>
</div>
<h3>Ranking</h3> <!-- 1 -->
<div>
Some easy to use ranking controlls....
</div>
<h3>Bookmark Navigation</h3> <!-- 2 -->
<div id="pager" class="tablesorterPager">
<form action="">
<p>
<img src="img/first.png" class="first" alt="first" />
<img src="img/prev.png" class="prev" alt="prev" />
<input type="text" class="pagedisplay" alt="pagedisplay" name="pagedisplay" />
<img src="img/next.png" class="next" alt="next" />
<img src="img/last.png" class="last" alt="last" />
<select class="pagesize" name="pagesize">
<option selected="selected" value="5">5</option>
<option value="10">10</option>
<option value="25">25</option>
<option value="50">50</option>
</select>
</p>
</form>
</div>

@ -0,0 +1,43 @@
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
$("#side1").accordion({
autoheight: false,
header: "h3"
});
$("#side1").accordion("activate", 2);
$('a').faviconize({
position: "before"
});
});
//]]>
</script>
<h3>YaCy Project</h3><!-- 0 -->
<div class="menu">
<img alt="YaCy Project Home" title="YaCy Project Home" src="img-1/home.png" />
<a href="http://www.yacy.net" >YaCy Home</a><br />
<img alt="YaCy Statistics" title="YaCy Statistics" src="img-2/bar_graph.png" />
<a href="http://www.yacystats.de" >YaCy Statistics</a><br />
<img alt="YaCy Forum" title="YaCy Forum" src="img-1/Discussion.png" />
<a href="http://forum.yacy-websuche.de/" >YaCy Forum</a><br />
<img alt="Help" title="YaCy Wiki" src="img-1/Help%20Blue%20Button.png" />
<a href="http://yacy-websuche.de/wiki/index.php/Hauptseite" />YaCy Wiki</a><br />
</div>
<h3>YaCy Bookmarks</h3> <!-- 1 -->
<div class="menu">
<img alt="Add " title="Add " src="img-1/New%20Document.png" />Add<br />
<img alt="Edit " title="Edit " src="img-1/Write%20Document.png" />Edit<br />
<img alt="Crawl " title="Crawl " src="img-1/Fullscreen.png" />Crawl <br />
<img alt="Remove " title="Remove " src="img-1/Remove%20Document.png" />Remove <br />
<img alt="Import " title="Import " src="img-1/Get%20Document.png" />Import <br />
<img alt="Export " title="Export " src="img-1/Send%20Document.png" />Export
</div>
<h3>YaCy Peer Admin</h3><!-- 2 -->
<div class="menu">
<img alt="login" title="Login" src="img-1/User.png" />Login<br />
<img alt="contact" title="Contact" src="img-1/New%20Mail.png" />Contact<br />
<img alt="peer-admin" title="Peer administration" src="img-1/Run.png" />Administration
</div>

@ -1,20 +1,25 @@
<div class="sidebar">
<div id="menu" class="boxed">
<div class="title">Peer-Menu</div>
<div class="content">
<img style="width: 32px; height: 32px;" alt="login" title="Login" src="img-1/User.png" align="absmiddle" hspace="3" vspace="3"/>Login<br>
<img style="width: 32px; height: 32px;" alt="contact" title="Contact" src="img-1/New%20Mail.png" align="absmiddle" hspace="3" vspace="3"/>Contact<br>
<img style="width: 32px; height: 32px;" alt="peer-admin" title="Peer administration" src="img-1/Run.png" align="absmiddle" hspace="3" vspace="3"/>Administration
</div>
</div>
</div>
<div class="sidebar">
<div id="menu" class="boxed">
<div class="title">YaCy Project</div>
<div class="content"><img style="width: 32px; height: 32px;" alt="YaCy Project Home" title="YaCy Project Home" src="img-1/home.png" align="absmiddle" hspace="3" vspace="3"/>Home<br>
<img style="width: 32px; height: 32px;" alt="YaCy Statistics" title="YaCy Statistics" src="img-2/bar_graph.png" align="absmiddle" hspace="3" vspace="3"/>Statistics<br>
<img style="width: 32px; height: 32px;" alt="YaCy Forum" title="YaCy Forum" src="img-1/Discussion.png" align="absmiddle" hspace="3" vspace="3"/>Forum<br>
<img style="width: 32px; height: 32px;" alt="Help" title="YaCy Wiki" src="img-1/Help%20Blue%20Button.png" align="absmiddle" hspace="3" vspace="3"/>Wiki<br>
</div>
</div>
</div>
<h3>Overview</h3>
<p>
YaCy-UI is going to be a rich client for YaCy attempting to provide a new, more functional and easier search interface.
Unlike the current server based interface YaCy-UI makes heavy use of jQuery, JavaScript, Ajax, XML and XSLT. This
approach offers some neat advantages, one example could be the integration of sciencenet via opensearch. The overall
idea is to integrate functionallity on a modular basis (e.g. a webshot function could be integrated by linking to
another, even local web service without the need to further extend YaCy's functionallity). Currently YaCy-UI is at most
alpha status, so I would be very greatful for feedback and bug reports!
</p>
apfelmaennchen
<h3>Change Log</h3>
<ul>
<li>19-04-2007: new double-accordion sidebar menu is up and running (I am open for suggestions on how to populate the menus).</li>
<li>19-04-2007: search results are now retrieved from yacysearch.rss (XML) and does no longer need a seperate servlet</li>
</ul>
<h3>Bug Tracker</h3>
<ul>
<li>Please report bugs in the official <a href="http://forum.yacy-websuche.de/">YaCy-Forum</a> - thanks!</li>
<li>19-04-2007: if you open more than one search tab, only the first result item is shown. I would be greatful for any hint...</li>
<li>19-04-2007: resource types 'sciencenet' and 'bookmarks' doen't work yet. For 'sciencenet' we have to solve the Ajax cross domain restriction.</li>
<li>19-04-2007: currently only contentdom="text" is working, all others will fail...</li>
<li>19-04-2007: language selection is not yet supported</li>
</ul>

@ -1,14 +1,19 @@
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
$('#ymarks')
.tablesorter({widgets: ['zebra']})
.tablesorterPager({container: $('#pager'), size: 5, positionFixed: false});
$("#side1").accordion("activate", 1);
$("#side3").accordion("activate", 2);
$('#yoptions').resetForm();
});
//]]>
</script>
<!-- Table -->
<table class="ytable" id="ymarks">
<table class="ytable" id="ymarks" summary="YaCy Bookmarks">
<colgroup>
<col width="25"/>
<col width="25"/>
@ -51,7 +56,7 @@
</td>
<td>
<a href="Bookmarks.html?edit=#[hash]#">
<img src="img-2/pencil.png" alt="edit bookmark" title="edit bookmark" border="0" />
<img src="img-2/pencil.png" alt="edit bookmark" title="edit bookmark" />
</a>
<img src="img-2/cancel.png" alt="delete bookmark" title="delete bookmark"/>
</td>

@ -0,0 +1,73 @@
<script type="application/javascript">
//<![CDATA[
$(function() {
$("#side3").accordion("activate", 0);
$.ajax({
type: "GET",
url: query,
dataType: "xml",
success: function(xml) {
var totalResults = parseInt($(xml).find('totalResults').text().replace(".",""));
var startIndex = parseInt($(xml).find('startIndex').text());
var itemsPerPage = parseInt($(xml).find('itemsPerPage').text());
var query = $(xml).find('Query').attr('searchTerms');
var endIndex = startIndex+itemsPerPage;
if (endIndex > totalResults) {
endIndex = totalResults;
}
var totalPages = (totalResults/itemsPerPage)|0;
if (startIndex != 0) {
var currentPage = ((startIndex-1)/itemsPerPage);
} else {
var currentPage = 0;
}
$("#pagination").pagination(totalResults, {
current_page:currentPage,
items_per_page:itemsPerPage,
num_edge_entries:1,
num_display_entries:10,
callback: loadContents
});
$(xml).find('item').each(function(){
var title = $(this).find('title').text();
var link = $(this).find('link').text();
var desc = $(this).find('description').text();
var guid = $(this).find('guid').text();
$('<div class="searchresults"></div>')
.html('<h3 class="linktitle"><a href="' +link+ '">' +title+ '</a></h3><p class="snippet">' +desc+ '</p><p class="url"><a href="' +link+ '" id="' +guid+ '" >' +link+ '</a></p>')
.prependTo(tabid);
$(".linktitle a").faviconize({
position: "before",
defaultImage: "img-2/article.png",
className: "favicon"
});
}); //close each(
}
}); //close $.ajax(
function loadContents(page_id, jq) {
var $tabs = $('#container ul');
var count = $(tabid).attr('count');
var offset = ((page_id*count)+1);
$(tabid).attr('offset', offset);
query = $(tabid).attr('resource')
+"&search="+$(tabid).attr('search')
+"&contentdom="+$(tabid).attr('contentdom')
+"&count="+$(tabid).attr('count')
+"&offset="+$(tabid).attr('offset')
+"&constraint="+$(tabid).attr('constraint')
+"&prefermaskfilter="+$(tabid).attr('prefermaskfilter')
+"&urlmaskfilter="+$(tabid).attr('urlmaskfilter');
var selected = $('#container ul').data('selected.ui-tabs');
$tabs.tabs("load", selected);
$('#pagination').trigger("update");
return false;
}
}); //close $(
//]]>
</script>
<div id="pagination" class="pagination">[loading...]</div>
Loading…
Cancel
Save