diff options
| author | apfelmaennchen <apfelmaennchen@6c8d7289-2bf4-0310-a012-ef5d649a1542> | 2011-11-08 23:01:22 +0000 |
|---|---|---|
| committer | apfelmaennchen <apfelmaennchen@6c8d7289-2bf4-0310-a012-ef5d649a1542> | 2011-11-08 23:01:22 +0000 |
| commit | d871812621554588abfc82a3d4087db0f1d4374c (patch) | |
| tree | 11356863b31dab5c4e05d73fb69035d62b7cd809 /htroot/jquery | |
| parent | 3a807e10cf1b91170bde1c02e74468f47701aa9b (diff) | |
fix for http://bugs.yacy.net/view.php?id=68 as well as for a far more serious bug in navigator handling in the portal search widget. Navigators are now quite usable, but the GUI has still some flaws...
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@8019 6c8d7289-2bf4-0310-a012-ef5d649a1542
Diffstat (limited to 'htroot/jquery')
| -rw-r--r-- | htroot/jquery/css/yacy-portalsearch.css | 13 | ||||
| -rw-r--r-- | htroot/jquery/css/yacy-ymarks.css | 9 | ||||
| -rw-r--r-- | htroot/jquery/js/yacy-portalsearch.js | 52 |
3 files changed, 48 insertions, 26 deletions
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) { } ); $('<hr />').appendTo("#yside"); - $('<span class="ynav">Get results: </span><div class="yradio" id="yglobal"><input type="radio" id="local" name="yglobal"" '+sel_local+' /><label for="local">local</label><input type="radio" id="global" name="yglobal" '+sel_global+' /><label for="global">global</label></div>').appendTo('#yside'); - $('<span class="ynav">Sort by: </span><div class="yradio" id="yrecent"><input type="radio" id="relevance" name="yrecent" '+sel_relev+' /><label for="relevance">relevance</label><input type="radio" id="date" name="yrecent" '+sel_date+' /><label for="date">date</label></div>').appendTo('#yside'); - $('#yrecent, #yglobal').buttonset(); + var radio1 = '<table><tr><td><span class="ynav">Get results: </span><div class="yradio" id="yglobal"><input type="radio" id="local" name="yglobal"" '+sel_local+' /><label for="local">local</label><br><input type="radio" id="global" name="yglobal" '+sel_global+' /><label for="global">global</label></div></td>'; + var radio2 = '<td><span class="ynav">Sort by: </span><div class="yradio" id="yrecent"><input type="radio" id="relevance" name="yrecent" '+sel_relev+' /><label for="relevance">relevance</label><br><input type="radio" id="date" name="yrecent" '+sel_date+' /><label for="date">date</label></div></td></tr></table>'; + $(radio1 + radio2).appendTo('#yside'); $('#local, #global, #date, #relevance').change(function() { var query = unescape($("#yquery").getValue()); @@ -365,8 +377,7 @@ function yacysearch(global, clear) { $('<hr />').appendTo("#yside"); var arLen=ynavigators.length; for ( var i=0, len=arLen; i<len; ++i ){ - $('<p><button class="cancel">X</button> '+ynavigators[i]+'</p>').appendTo("#yside"); - $('.cancel').button(); + $('<p><img src="/yacy/ui/img-2/cancel_round.png" class="ynav-cancel" /><span class="ytxt"> '+ynavigators[i]+'</span></p>').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); + }); } } } |
