- hopefully a fix for the 'koblenz'-bug

- http://forum.yacy-websuche.de/viewtopic.php?f=6&t=2209#p16005

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6110 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
apfelmaennchen 16 years ago
parent 91785d895c
commit f091ad3e23

@ -1,3 +1,11 @@
function status() {
if(load_status < 6) {
return;
} else {
window.clearInterval(loading);
yrun();
}
}
$(document).ready(function() { $(document).ready(function() {
$.ajaxSetup({ $.ajaxSetup({
timeout: 5000, timeout: 5000,
@ -78,16 +86,6 @@ $(document).ready(function() {
yrun(); yrun();
} }
}); });
function status() {
if(load_status < 6) {
return;
} else {
window.clearInterval(loading);
yrun();
}
}
function yrun() { function yrun() {
$.extend($.ui.accordion.defaults, { $.extend($.ui.accordion.defaults, {
@ -177,11 +175,14 @@ function yrun() {
}); });
$('#ysearch').keyup(function(e) { $('#ysearch').keyup(function(e) {
if(e.which == 27) { // ESC if(ycurr == $("#yquery").getValue()) {
return false;
}
if(e.which == 27) { // ESC
$("#ypopup").dialog('close'); $("#ypopup").dialog('close');
} else if(e.which == 34) { // PageDown } else if(e.which == 34) { // PageDown
startRecord = startRecord + maximumRecords; startRecord = startRecord + maximumRecords;
} else if(e.which == 33) { // PageUp } else if(e.which == 33) { // PageUp
startRecord = startRecord - maximumRecords; startRecord = startRecord - maximumRecords;
if(startRecord < 0) startRecord = 0; if(startRecord < 0) startRecord = 0;
} else { } else {
@ -190,6 +191,7 @@ function yrun() {
if ($("#yquery").getValue() == '') { if ($("#yquery").getValue() == '') {
$("#ypopup").dialog('close'); $("#ypopup").dialog('close');
} else { } else {
ycurr = $("#yquery").getValue();
if(!submit) yacysearch(false); if(!submit) yacysearch(false);
else submit = false; else submit = false;
} }
@ -197,14 +199,16 @@ function yrun() {
}); });
$('#ysearch').submit(function() { $('#ysearch').submit(function() {
submit = true; submit = true;
ycurr = $("#yquery").getValue();
yacysearch(yconf.global); yacysearch(yconf.global);
return false; return false;
}); });
} }
function yacysearch(global) { function yacysearch(global) {
var url = yconf.url + '/yacysearch.json?callback=?' var url = yconf.url + '/yacysearch.json?callback=?'
$('#ypopup').empty(); $('#ypopup').empty();
$('#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>"); $('#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')) if (!$("#ypopup").dialog('isOpen'))
@ -219,15 +223,22 @@ function yacysearch(global) {
if(item.value == 'global') global = true; if(item.value == 'global') global = true;
if(global) item.value = 'global'; if(global) item.value = 'global';
} }
if(item.name == 'query' || item.name == 'search') {
if(item.value != ycurr)
ycurr = item.value;
}
param[i] = item; param[i] = item;
}); });
param[param.length] = { name : 'startRecord', value : startRecord }; param[param.length] = { name : 'startRecord', value : startRecord };
$.getJSON(url, param, $.getJSON(url, param,
function(json, status){ function(json, status) {
ycurr = $("#yquery").getValue();
if (json[0]) data = json[0]; if (json[0]) data = json[0];
else data = json; else data = json;
$('#ypopup').empty(); if(ycurr != data.channels[0].searchTerms)
return false;
if(data.channels[0].searchTerms != ycurr)
return false;
$('#ypopup').empty();
var total = data.channels[0].totalResults.replace(/[,.]/,""); var total = data.channels[0].totalResults.replace(/[,.]/,"");
var page = (data.channels[0].startIndex / data.channels[0].itemsPerPage) + 1; var page = (data.channels[0].startIndex / data.channels[0].itemsPerPage) + 1;
var start = startRecord + 1; var start = startRecord + 1;
@ -294,7 +305,7 @@ function yacysearch(global) {
function autoOpenSidebar() { function autoOpenSidebar() {
window.setTimeout(function() { window.setTimeout(function() {
if( $("#yquery").getValue() == ycurr) { if( $("#yquery").getValue() == ycurr) {
if (!$("#yside").dialog('isOpen')) { if (!$("#yside").dialog('isOpen')) {
$("#yside").dialog('open'); $("#yside").dialog('open');
$('#ynav1').accordion('activate', false); $('#ynav1').accordion('activate', false);
$("#yquery").focus(); $("#yquery").focus();
@ -302,4 +313,5 @@ function yacysearch(global) {
} }
} , 3000); } , 3000);
} }
} }

Loading…
Cancel
Save