From 4cf8b08eecae3acfc9ae9503bae42cd269d315db Mon Sep 17 00:00:00 2001 From: apfelmaennchen Date: Sun, 26 Apr 2009 17:44:11 +0000 Subject: [PATCH] Portal Search: - request: http://forum.yacy-websuche.de/viewtopic.php?f=15&t=1762&start=50#p14350 - window closes for empty query - example for fancy input field git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5884 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/yacy/ui/css/yacyui-portalsearch.css | 11 +++++++++++ htroot/yacy/ui/js/yacyui-portalsearch.js | 8 ++++++-- htroot/yacy/ui/yacyui-portaltest.html | 7 +++---- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/htroot/yacy/ui/css/yacyui-portalsearch.css b/htroot/yacy/ui/css/yacyui-portalsearch.css index 14bd965ae..c5426d7d0 100644 --- a/htroot/yacy/ui/css/yacyui-portalsearch.css +++ b/htroot/yacy/ui/css/yacyui-portalsearch.css @@ -4,6 +4,17 @@ .ui-dialog .ui-dialog-buttonpane button { font-size: 14px; } +#ysearch .fancy { + background-image: url(/yacy/ui/img-2/magnify.png); + background-repeat: no-repeat; + background-position: 2px 1px; + padding-left: 20px; + border-width: small; + border-color: #239AFF; + border-style: solid; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; +} #ypopup * { margin: 0; padding: 0; diff --git a/htroot/yacy/ui/js/yacyui-portalsearch.js b/htroot/yacy/ui/js/yacyui-portalsearch.js index 1057e7072..29f5fb52f 100644 --- a/htroot/yacy/ui/js/yacyui-portalsearch.js +++ b/htroot/yacy/ui/js/yacyui-portalsearch.js @@ -78,8 +78,12 @@ $(document).ready(function() { }); $('#ysearch').keyup(function() { startRecord = 0; - if(!submit) yacysearch(false); - else submit = false; + if ($("#yquery").getValue() == '') { + $("#ypopup").dialog('close'); + } else { + if(!submit) yacysearch(false); + else submit = false; + } return false; }); $('#ysearch').submit(function() { diff --git a/htroot/yacy/ui/yacyui-portaltest.html b/htroot/yacy/ui/yacyui-portaltest.html index ead108f33..375ec4062 100644 --- a/htroot/yacy/ui/yacyui-portaltest.html +++ b/htroot/yacy/ui/yacyui-portaltest.html @@ -15,11 +15,11 @@ }; $.getScript(yconf.url+'/yacy/ui/js/yacyui-portalsearch.js', function(){}); }); - +

YaCy Portal Search:

- + @@ -46,7 +46,7 @@ </script> <div id="yacy"> <form id="ysearch" method="get" accept-charset="UTF-8" action="http://localhost:8080/yacysearch.html"> - <input name="query" id="yquery" type="text" size="15" maxlength="80" value=""/> + <input name="query" id="yquery" class="fancy" type="text" size="15" maxlength="80" value=""/> <input type="hidden" name="verify" value="true" /> <input type="hidden" name="maximumRecords" value="10" /> <input type="hidden" name="resource" value="local" /> @@ -93,4 +93,3 @@ your own custom theme.
Themes are installed into: DATA/HTDOCS/yacy/ui/css/t

-