diff --git a/htroot/env/templates/portalheader.template b/htroot/env/templates/portalheader.template index 0fad3fe83..993ced12b 100644 --- a/htroot/env/templates/portalheader.template +++ b/htroot/env/templates/portalheader.template @@ -6,17 +6,19 @@ \ No newline at end of file diff --git a/htroot/jquery/css/yacy-portalsearch.css b/htroot/jquery/css/yacy-portalsearch.css index e9e462d68..59a880b5e 100644 --- a/htroot/jquery/css/yacy-portalsearch.css +++ b/htroot/jquery/css/yacy-portalsearch.css @@ -10,6 +10,12 @@ overflow-x: hidden; font-size: 1.0em; } +.ynav-cancel { + vertical-align: middle; + margin-left: 5px; + cursor: pointer; +} + .ynav .ui-autocomplete-input { font-size: 14px; padding: 2px; @@ -29,9 +35,9 @@ .yradio { margin-top: 5px; margin-bottom: 10px; - margin-left: 40px; + margin-left: 5px; text-align: left; - font-size: 10px; + font-size: 11px; } #yacylivesearch form * { @@ -52,7 +58,6 @@ } #ypopup * { - inherit: none; margin: 0; padding: 0; font-size: 12px; @@ -127,7 +132,7 @@ .ynav { margin-left: 8px; - margin-roght: 5px; + margin-right: 5px; } #ypopup .yloading { margin-top: 150px; diff --git a/htroot/jquery/css/yacy-ymarks.css b/htroot/jquery/css/yacy-ymarks.css index 81c02396f..64fb95b24 100644 --- a/htroot/jquery/css/yacy-ymarks.css +++ b/htroot/jquery/css/yacy-ymarks.css @@ -75,7 +75,7 @@ #ymarks_body .input { width: 190px; margin-bottom: .5em; - padding: 2px 0px 2px 0px /* top right bottom left */ + padding: 2px 0px 2px 0px; /* top right bottom left */ border: 1px solid #CCCCCC; font-family: "Trebuchet MS", Trebuchet, Verdana, Helvetica, Arial, sans-serif; font-size: 12px; @@ -86,13 +86,10 @@ img.help { padding-bottom:5px; padding-left: 8px; } -.hidden { - display:hidden; -} /* Bookmark Dialogs */ .bm_input, .bm_select { - padding: 2px 0px 2px 0px /* top right bottom left */ + padding: 2px 0px 2px 0px; /* top right bottom left */ border: 1px solid #CCCCCC; margin: 0px 0px 2px 5px; } @@ -195,7 +192,7 @@ img.help { #ymarks_sidebar .ui-tabs-nav li.ui-tabs-selected a:link, #ymarks_sidebar .ui-tabs-nav li.ui-tabs-selected a:visited, #ymarks_sidebar .ui-tabs-nav li.ui-tabs-selected a:hover, -#ymarks_sidebar .ui-tabs-nav li.ui-tabs-selected a:active { font-size: 12px; font-style: bold; padding-left: 5px;} +#ymarks_sidebar .ui-tabs-nav li.ui-tabs-selected a:active { font-size: 12px; padding-left: 5px;} /* overrides for treeview styles diff --git a/htroot/jquery/js/yacy-portalsearch.js b/htroot/jquery/js/yacy-portalsearch.js index d3d0a5021..cd2a0e7f7 100644 --- a/htroot/jquery/js/yacy-portalsearch.js +++ b/htroot/jquery/js/yacy-portalsearch.js @@ -82,7 +82,7 @@ $(document).ready(function() { var script1 = yconf.url + '/jquery/js/jquery-query-2.1.7.js'; var script2 = yconf.url + '/jquery/js/jquery.form-2.73.js'; var script3 = yconf.url + '/jquery/js/jquery.field-0.9.2.min.js'; - var script4 = yconf.url + '/jquery/js/jquery-ui-1.8.13.custom.min.js'; + var script4 = yconf.url + '/jquery/js/jquery-ui-1.8.16.custom.min.js'; var script5 = yconf.url + '/jquery/js/jquery-ui-combobox.js'; $.getScript(script1, function(){ load_status++; }); @@ -94,6 +94,7 @@ $(document).ready(function() { yrun(); } }); + function yrun() { $.extend($.ui.accordion.defaults, { @@ -248,25 +249,36 @@ function yacysearch(global, clear) { param[i] = item; }); param[param.length] = { name : 'startRecord', value : startRecord }; + $.ajaxSetup({ timeout: 10000, - error: function() {if (clear) $('#ypopup').empty();} + error: function() { + if (clear) $('#ypopup').empty(); + } }); + $.getJSON(url, param, function(json, status) { + if (json[0]) data = json[0]; - else data = json; - var searchTerms = data.channels[0].searchTerms.replace(/\+/g," "); - if(ycurr != searchTerms) + else data = json; + + var searchTerms = data.channels[0].searchTerms; + + if(ycurr.replace(/ /g,"+") != searchTerms) { return false; - if(clear) - $('#ypopup').empty(); - var total = data.channels[0].totalResults.replace(/[,.]/,""); + } + if(clear) { + $('#ypopup').empty(); + } + + var total = data.channels[0].totalResults; + if(global) var result = 'global'; else var result = 'local'; - - var count = 0; - $.each ( + + var count = 0; + $.each ( data.channels[0].items, function(i,item) { if (item) { @@ -344,9 +356,9 @@ function yacysearch(global, clear) { } ); $('
').appendTo("#yside"); - $('Get results:
').appendTo('#yside'); - $('Sort by:
').appendTo('#yside'); - $('#yrecent, #yglobal').buttonset(); + var radio1 = ''; + var radio2 = '
Get results:

Sort by:

'; + $(radio1 + radio2).appendTo('#yside'); $('#local, #global, #date, #relevance').change(function() { var query = unescape($("#yquery").getValue()); @@ -365,8 +377,7 @@ function yacysearch(global, clear) { $('
').appendTo("#yside"); var arLen=ynavigators.length; for ( var i=0, len=arLen; i '+ynavigators[i]+'

').appendTo("#yside"); - $('.cancel').button(); + $('

'+ynavigators[i]+'

').appendTo("#yside"); } if(count>0) { autoOpenSidebar(); @@ -376,6 +387,15 @@ function yacysearch(global, clear) { yacysearch(submit, false); } } + $(".ynav-cancel").bind("click", function(event) { + var str = $(event.target).next().text().replace(/^[\s\xA0]+/, "").replace(/[\s\xA0]+$/, ""); + var idx = ynavigators.indexOf(str); + if(idx!=-1) ynavigators.splice(idx, 1); + var regexp = new RegExp(str.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&")); + $("#yquery").setValue(query.replace(regexp,"").replace(/^[\s\xA0]+/, "").replace(/[\s\xA0]+$/, "")); + startRecord = 0; + yacysearch(submit, true); + }); } } }