|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
|
|
|
|
|
|
<link media="screen" type="text/css" href="css/widget.css" rel="stylesheet" />
|
|
|
|
<link media="screen" type="text/css" href="css/themes/start/ui.all.css" rel="stylesheet" title="start"/>
|
|
|
|
<link media="screen" type="text/css" href="css/themes/base/ui.all.css" rel="alternate stylesheet" title="base"/>
|
|
|
|
<link media="screen" type="text/css" href="css/themes/humanity/ui.all.css" rel="alternate stylesheet" title="humanity"/>
|
|
|
|
<link media="screen" type="text/css" href="css/themes/cupertino/ui.all.css" rel="alternate stylesheet" title="cupertino"/>
|
|
|
|
<link media="screen" type="text/css" href="css/themes/redmond/ui.all.css" rel="alternate stylesheet" title="redmond"/>
|
|
|
|
<link media="screen" type="text/css" href="css/themes/smoothness/ui.all.css" rel="alternate stylesheet" title="smoothness"/>
|
|
|
|
<link media="screen" type="text/css" href="css/themes/darkness/ui.all.css" rel="alternate stylesheet" title="darkness"/>
|
|
|
|
|
|
|
|
<script src="js/jquery-1.3.1.min.js" type="text/javascript"></script>
|
|
|
|
<script src="js/jquery.ui.all.min.js" type="text/javascript"></script>
|
|
|
|
<script src="js/jquery.query.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-faviconize-1.0.js" type="text/javascript"></script>
|
|
|
|
<script src="js/jquery.serialScroll-min.js" type="text/javascript"></script>
|
|
|
|
<script src="js/jquery.scrollTo-min.js" type="text/javascript"></script>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
//<![CDATA[
|
|
|
|
$(document).ready(function() {
|
|
|
|
|
|
|
|
var style = $.query.get('style');
|
|
|
|
if (style) { switchStylestyle(style); }
|
|
|
|
|
|
|
|
var height = $.query.get('height');
|
|
|
|
if (!height) { height = 600; }
|
|
|
|
|
|
|
|
var width = $.query.get('width');
|
|
|
|
if (!width) { width = 400; }
|
|
|
|
|
|
|
|
var size = $.query.get('fontsize');
|
|
|
|
if (size) {
|
|
|
|
$('body').removeClass();
|
|
|
|
switch(size) {
|
|
|
|
case 'normal':
|
|
|
|
$('body').addClass('normal');
|
|
|
|
break;
|
|
|
|
case 'small':
|
|
|
|
$('body').addClass('small');
|
|
|
|
break;
|
|
|
|
case 'big':
|
|
|
|
$('body').addClass('big');
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$("#yresult").dialog({
|
|
|
|
autoOpen: false,
|
|
|
|
height: height,
|
|
|
|
width: width,
|
|
|
|
position: ['top',50],
|
|
|
|
modal: false,
|
|
|
|
resizable: true,
|
|
|
|
buttons: {
|
|
|
|
Close: function() { $("#yresult").dialog("close"); }
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#yresult').serialScroll({
|
|
|
|
items:'div',
|
|
|
|
force:true,
|
|
|
|
cycle:true,
|
|
|
|
axis:'y',
|
|
|
|
easing:'linear',
|
|
|
|
lazy:true,
|
|
|
|
interval:1500,
|
|
|
|
step:1
|
|
|
|
});
|
|
|
|
|
|
|
|
/* Load Search Result */
|
|
|
|
$('#searchbox').keyup(function() {
|
|
|
|
if (!$("#yresult").dialog('isOpen')) {
|
|
|
|
$("#yresult").dialog('open');
|
|
|
|
}
|
|
|
|
$("#search").focus();
|
|
|
|
|
|
|
|
var param = [
|
|
|
|
{ name : 'maximumRecords', value : '100' }
|
|
|
|
,{ name : 'verify', value : 'false' }
|
|
|
|
,{ name : 'resource', value : 'local' }
|
|
|
|
,{ name : 'search', value : $("#searchbox input[name='search']").getValue()}
|
|
|
|
];
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
type: 'GET',
|
|
|
|
url: '/yacysearch.json',
|
|
|
|
data: param,
|
|
|
|
dataType: 'json',
|
|
|
|
success: function(data){
|
|
|
|
$("#yresult").empty();
|
|
|
|
$.each (
|
|
|
|
data.channels[0].items,
|
|
|
|
function(i,item) {
|
|
|
|
if (item) {
|
|
|
|
$("#yresult").append("<div><a class='favicon' target='_blank' href='"+item.link+"'><p class='linktitle'>"+item.title+"</p><p class='url'>"+item.link+"</p></a></div>")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
$("a.favicon").faviconize({
|
|
|
|
position: "before",
|
|
|
|
defaultImage: "img-2/article.png",
|
|
|
|
className: "favicon"
|
|
|
|
});
|
|
|
|
$("#yresult").trigger('start');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
$('#searchbox').submit(function() {
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
function switchStylestyle(styleName) {
|
|
|
|
$('link[rel*=style][title]').each(function(i)
|
|
|
|
{
|
|
|
|
this.disabled = true;
|
|
|
|
if (this.getAttribute('title') == styleName) this.disabled = false;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
//]]>
|
|
|
|
</script>
|
|
|
|
<title>YaCy-UI Widget</title>
|
|
|
|
</head>
|
|
|
|
<body class="normal">
|
|
|
|
<div class="yform">
|
|
|
|
<form id="searchbox" class="small" method="get" accept-charset="UTF-8" action="jQuery">
|
|
|
|
<input id="search" name="search" type="text" size="15" maxlength="80" value=""/>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
<!-- Search Result -->
|
|
|
|
<div id="yresult" title="YaCy P2P Web Search" style="overflow: hidden;">
|
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html>
|