|
|
|
@ -7,11 +7,8 @@ $(document).ready(function() {
|
|
|
|
|
|
|
|
|
|
$('<div id="ypopup" class="classic"></div>').appendTo("#yacy");
|
|
|
|
|
|
|
|
|
|
startRecord = 0;
|
|
|
|
|
|
|
|
|
|
var style1 = yurl + '/yacy/ui/css/yacyui-portalsearch.css';
|
|
|
|
|
var style2 = yurl + '/yacy/ui/css/themes/'+ytheme+'/ui.base.css';
|
|
|
|
|
var style3 = yurl + '/yacy/ui/css/themes/'+ytheme+'/ui.theme.css';
|
|
|
|
|
var style1 = yconf.url + '/yacy/ui/css/yacyui-portalsearch.css';
|
|
|
|
|
var style2 = yconf.url + '/yacy/ui/css/themes/'+yconf.theme+'/ui.all.css';
|
|
|
|
|
|
|
|
|
|
var head = document.getElementsByTagName('head')[0];
|
|
|
|
|
|
|
|
|
@ -21,37 +18,38 @@ $(document).ready(function() {
|
|
|
|
|
$(document.createElement('link'))
|
|
|
|
|
.attr({type:'text/css', href: style2, rel:'stylesheet', media:'screen'})
|
|
|
|
|
.appendTo(head);
|
|
|
|
|
$(document.createElement('link'))
|
|
|
|
|
.attr({type:'text/css', href: style3, rel:'stylesheet', media:'screen'})
|
|
|
|
|
.appendTo(head);
|
|
|
|
|
|
|
|
|
|
var script1 = yurl + '/yacy/ui/js/jquery.query.js';
|
|
|
|
|
var script2 = yurl + '/yacy/ui/js/jquery.form.js';
|
|
|
|
|
var script3 = yurl + '/yacy/ui/js/jquery.field.min.js';
|
|
|
|
|
var script4 = yurl + '/yacy/ui/js/jquery-faviconize-1.0.js';
|
|
|
|
|
var script5 = yurl + '/yacy/ui/js/jquery.ui.all.min.js';
|
|
|
|
|
var script1 = yconf.url + '/yacy/ui/js/jquery.query.js';
|
|
|
|
|
var script2 = yconf.url + '/yacy/ui/js/jquery.form.js';
|
|
|
|
|
var script3 = yconf.url + '/yacy/ui/js/jquery.field.min.js';
|
|
|
|
|
var script4 = yconf.url + '/yacy/ui/js/jquery-faviconize-1.0.js';
|
|
|
|
|
var script5 = yconf.url + '/yacy/ui/js/jquery.ui.all.min.js';
|
|
|
|
|
|
|
|
|
|
$.getScript(script1, function(){});
|
|
|
|
|
$.getScript(script2, function(){});
|
|
|
|
|
$.getScript(script3, function(){});
|
|
|
|
|
$.getScript(script4, function(){});
|
|
|
|
|
|
|
|
|
|
$.getScript(script5, function(){
|
|
|
|
|
startRecord = 0;
|
|
|
|
|
maximumRecords = parseInt($("#ysearch input[name='maximumRecords']").getValue());
|
|
|
|
|
|
|
|
|
|
$("#ypopup").dialog({
|
|
|
|
|
autoOpen: false,
|
|
|
|
|
height: 500,
|
|
|
|
|
width: 420,
|
|
|
|
|
minWidth: 420,
|
|
|
|
|
height: yconf.height,
|
|
|
|
|
width: yconf.width,
|
|
|
|
|
minWidth: yconf.width,
|
|
|
|
|
position: ['top',50],
|
|
|
|
|
modal: false,
|
|
|
|
|
resizable: true,
|
|
|
|
|
title: "YaCy P2P Web Search",
|
|
|
|
|
title: yconf.title,
|
|
|
|
|
buttons: {
|
|
|
|
|
Next: function() {
|
|
|
|
|
startRecord = startRecord + 10;
|
|
|
|
|
startRecord = startRecord + maximumRecords;
|
|
|
|
|
$('#ysearch').trigger('submit');
|
|
|
|
|
},
|
|
|
|
|
Prev: function() {
|
|
|
|
|
startRecord = startRecord - 10;
|
|
|
|
|
startRecord = startRecord - maximumRecords;
|
|
|
|
|
if(startRecord < 0) startRecord = 0;
|
|
|
|
|
$('#ysearch').trigger('submit');
|
|
|
|
|
}
|
|
|
|
@ -68,25 +66,21 @@ $(document).ready(function() {
|
|
|
|
|
$('#ysearch').submit(function() {
|
|
|
|
|
|
|
|
|
|
var query = $('#yquery').getValue();
|
|
|
|
|
var url = yurl + '/yacysearch.json?callback=?'
|
|
|
|
|
var url = yconf.url + '/yacysearch.json?callback=?'
|
|
|
|
|
|
|
|
|
|
$('#ypopup').empty();
|
|
|
|
|
$('#ypopup').append("<div class='yloading'><h3 class='linktitle'><em>Loading: "+yurl+"</em><br/><img src='"+yurl+"/yacy/ui/img/loading2.gif' align='absmiddle'/></h3></div>");
|
|
|
|
|
$('#ypopup').append("<div class='yloading'><h3 class='linktitle'><em>Loading: "+yconf.url+"</em><br/><img src='"+yconf.url+"/yacy/ui/img/loading2.gif' align='absmiddle'/></h3></div>");
|
|
|
|
|
|
|
|
|
|
if (!$("#ypopup").dialog('isOpen')) {
|
|
|
|
|
$("#ypopup").dialog('open');
|
|
|
|
|
}
|
|
|
|
|
$("#yquery").focus();
|
|
|
|
|
|
|
|
|
|
var param = [
|
|
|
|
|
{ name : 'startRecord', value : startRecord }
|
|
|
|
|
,{ name : 'maximumRecords', value : 10 }
|
|
|
|
|
,{ name : 'query', value : query}
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
if (yparam) {
|
|
|
|
|
for (var pi = 0; pi < yparam.length; pi++) param[param.length] = yparam[pi];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var param = [];
|
|
|
|
|
$("#ysearch input").each(function(i){
|
|
|
|
|
var item = { name : $(this).attr('name'), value : $(this).attr('value') };
|
|
|
|
|
param[i] = item;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$.getJSON(url, param,
|
|
|
|
|
function(json, status){
|
|
|
|
@ -98,10 +92,10 @@ $(document).ready(function() {
|
|
|
|
|
var total = data.channels[0].totalResults.replace(/[,.]/,"");
|
|
|
|
|
var page = (data.channels[0].startIndex / data.channels[0].itemsPerPage) + 1;
|
|
|
|
|
var start = startRecord + 1;
|
|
|
|
|
var end = startRecord + 10;
|
|
|
|
|
var end = startRecord + maximumRecords;
|
|
|
|
|
|
|
|
|
|
$("div .ybpane").remove();
|
|
|
|
|
var ylogo = "<div class='ybpane'><a href='http://www.yacy.net' target='_blank'><img src='"+yurl+"/yacy/ui/img/yacy-logo.png' alt='www.yacy.net' title='www.yacy.net' /></a></div>";
|
|
|
|
|
var ylogo = "<div class='ybpane'><a href='http://www.yacy.net' target='_blank'><img src='"+yconf.url+"/yacy/ui/img/yacy-logo.png' alt='www.yacy.net' title='www.yacy.net' /></a></div>";
|
|
|
|
|
var yresult = "<div class='ybpane'><em>Displaying result "+start+" to "+end+"<br/> of "+total+" total results.</em></div>";
|
|
|
|
|
$("div .ui-dialog-buttonpane").prepend(ylogo+yresult);
|
|
|
|
|
|
|
|
|
@ -120,7 +114,7 @@ $(document).ready(function() {
|
|
|
|
|
);
|
|
|
|
|
$(".linktitle a").faviconize({
|
|
|
|
|
position: "before",
|
|
|
|
|
defaultImage: yurl + "/yacy/ui/img-2/article.png",
|
|
|
|
|
defaultImage: yconf.url + "/yacy/ui/img-2/article.png",
|
|
|
|
|
className: "favicon"
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|