summaryrefslogtreecommitdiff
path: root/htroot/jquery
diff options
context:
space:
mode:
authorapfelmaennchen <apfelmaennchen@6c8d7289-2bf4-0310-a012-ef5d649a1542>2011-11-09 21:01:38 +0000
committerapfelmaennchen <apfelmaennchen@6c8d7289-2bf4-0310-a012-ef5d649a1542>2011-11-09 21:01:38 +0000
commita425fbd8d64364eca9fcda8d761fa12096e73cf4 (patch)
treef26af21b9485ea976954e592dcc4ce3fc27987c6 /htroot/jquery
parent42425c800362e36bb59e501adbc214dd405a8b67 (diff)
- created new target 'portalsearch' in build.xml to generate yacy-portalsearch.tar.gz for static hosting
- some refactoring for search widget and jquery - update for ConfigLiveSearch.html to refelct latest changes git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@8023 6c8d7289-2bf4-0310-a012-ef5d649a1542
Diffstat (limited to 'htroot/jquery')
-rw-r--r--htroot/jquery/css/yacy-portalsearch.css141
-rw-r--r--htroot/jquery/css/yacy-ymarks.css212
-rw-r--r--htroot/jquery/js/yacy-portalsearch.js411
3 files changed, 0 insertions, 764 deletions
diff --git a/htroot/jquery/css/yacy-portalsearch.css b/htroot/jquery/css/yacy-portalsearch.css
deleted file mode 100644
index 59a880b5e..000000000
--- a/htroot/jquery/css/yacy-portalsearch.css
+++ /dev/null
@@ -1,141 +0,0 @@
-.ui-dialog .ui-dialog-title {
- font-size: 14px;
-}
-.ui-dialog .ui-dialog-buttonpane button {
- font-size: 14px;
-}
-.ui-autocomplete {
- max-height: 350px;
- overflow-y: auto;
- 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;
- width: 150px;
- margin-bottom: 10px;
-}
-.ynav {
- font-size: 12px;
-}
-.ynav label {
- font-size: 12px;
-}
-.ynav .ui-button {
- vertical-align: top;
- font-size: 10px;
-}
-.yradio {
- margin-top: 5px;
- margin-bottom: 10px;
- margin-left: 5px;
- text-align: left;
- font-size: 11px;
-}
-
-#yacylivesearch form * {
- display: inline;
-}
-#ysearch .fancy {
- height:18px;
- background: white;
- background-image: url(/yacy/ui/img-2/magnify.png);
- background-repeat: no-repeat;
- background-position: 2px 1px;
- padding-left: 20px;
- border-width: thin;
- border-color: #239AFF;
- border-style: solid;
- -moz-border-radius: 5px;
- -webkit-border-radius: 5px;
-}
-
-#ypopup * {
- margin: 0;
- padding: 0;
- font-size: 12px;
- text-align: left;
- font-family:Verdana,Arial,sans-serif;
-}
-#ypopup .url {
- padding-top: 1px;
- font-size: 0.9em;
- line-height: 1.2em;
- padding-left: 18px;
-}
-#ypopup .date {
- font-size: 0.9em;
- line-height: 1.2em;
- margin-bottom: 0.8em;
- padding-left: 18px;
-}
-#ypopup .url a {
- color:#20A020;
- text-decoration:none;
-}
-#ypopup h3.linktitle {
- font-size: 1.0em;
- line-height: 1.2em;
- color:#239AFF;
- padding-left: 18px;
- border-bottom: none;
-}
-#ypopup h3.linktitle a {
- text-decoration:none;
- color:#239AFF;
-}
-#ypopup .desc {
- font-style:italic;
- font-size: 0.9em;
- color: #808080;
- line-height: 1.2em;
- padding-left: 18px;
-}
-#ypopup .favicon {
- width: 16px;
- height: 16px;
- vertical-align: middle;
- margin-left: -24px;
-}
-.classic {
- font-size: 12px;
- text-align: left;
-}
-.classic .linktitle, .classic .url, .classic .date, .classic .desc {
- margin-left: 40px;
-}
-.ymsg {
- margin-top: 10px;
- margin-bottom: 20px;
- margin-left: -20px;
- color:#239AFF;
-}
-.ymsg img {
- width: 50px;
- height: 32px;
- vertical-align: middle;
- border: 0;
-}
-.ytxt {
- font-size: 12px;
- margin-left: 8px;
- margin-right: 5px;
- margin-bottom: 20px;
-}
-
-.ynav {
- margin-left: 8px;
- margin-right: 5px;
-}
-#ypopup .yloading {
- margin-top: 150px;
- margin-left: -12px;
- text-align: center;
-}
diff --git a/htroot/jquery/css/yacy-ymarks.css b/htroot/jquery/css/yacy-ymarks.css
deleted file mode 100644
index 64fb95b24..000000000
--- a/htroot/jquery/css/yacy-ymarks.css
+++ /dev/null
@@ -1,212 +0,0 @@
-/* Body */
-#ymarks_body {
-
-}
-
-/* Main */
-#ymarks_body div.main {
- margin-top: 7px;
-}
-
-/* Sidebar */
-#ymarks_body div.sidebar {
- width:250px;
- float:right;
- margin-right: 10px;
- margin-left:10px;
- margin-top:5px;
- padding-top:2px;
-}
-#ymarks_folders_tab {
- margin-left: -5px;
- margin-right: -5px;
-}
-
-/* YaCy Bookmarks ---------------------------*/
-#ymarks_flexigrid .url {
- padding-top: 1px;
- font-size: 0.9em;
- line-height: 1.2em;
- margin-bottom:0.6em;
-}
-#ymarks_flexigrid h3.linktitle {
- margin-top:2px;
- margin-bottom: -0.5em;
- font-size: 1.0em;
- line-height: 1.2em;
- color:#239AFF;
-}
-#ymarks_flexigrid h3.linktitle a {
- color:#239AFF;
- text-decoration:none;
-}
-#ymarks_flexigrid p.url a {
- color:#20A020;
- text-decoration:none;
-}
-#ymarks_flexigrid .tag {
- font-size: 1.1em;
- line-height: 1.3em;
- color:#20A020;
-}
-#ymarks_flexigrid .desc {
- font-style:italic;
- font-size: 0.9em;
- color: #808080;
- line-height: 1.2em;
- margin-bottom:-1em;
-}
-
-#ymarks_treeview {
- overflow-x: hidden;
- overflow-y: auto;
-}
-#ymarks_tagcloud {
- margin: 10px 5px 10px 5px; /* top right bottom left */
- text-align: justify;
- line-height: 1.2em;
-}
-#ymarks_tagcloud a {
- cursor:pointer;
-}
-#ymarks_tagcloud a:hover {
- background-color:#e6EEEE;
-}
-#ymarks_body .input {
- width: 190px;
- margin-bottom: .5em;
- 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;
- /* color: #999999; */
-}
-img.help {
- vertical-align: middle;
- padding-bottom:5px;
- padding-left: 8px;
-}
-
-/* Bookmark Dialogs */
-.bm_input, .bm_select {
- padding: 2px 0px 2px 0px; /* top right bottom left */
- border: 1px solid #CCCCCC;
- margin: 0px 0px 2px 5px;
-}
-.bm_input {
- width: 280px;
-}
-.bm_select {
- width: 60px;
-}
-.bm_dialog label {
- margin: 6px 0px 2px 5px;
- font-size: 0.8em;
-}
-.bm_dialog {
- margin: 5px 5px 5px 5px;
-}
-
-
-/* YaCy Flexigrid ---------------------------*/
-.flexigrid div.fbutton .burst {
- background: url(../../yacy/ui/img-2/burst.png) no-repeat center left;
-}
-.flexigrid div.fbutton .pictures {
- background: url(../../yacy/ui/img-2/pictures.png) no-repeat center left;
-}
-.flexigrid div.fbutton .help {
- background: url(../../yacy/ui/img-2/question_blue.png) no-repeat center left;
-}
-.flexigrid div.fbutton .delete {
- background: url(../../yacy/ui/img-2/cancel.png) no-repeat center left;
-}
-.flexigrid div.fbutton .edit {
- background: url(../../yacy/ui/img-2/pencil.png) no-repeat center left;
-}
-.flexigrid div.fbutton .import {
- background: url(../../yacy/ui/img-2/download.png) no-repeat center left;
-}
-.flexigrid div.fbutton .rss {
- background: url(../../yacy/ui/img-2/rss_round.png) no-repeat center left;
-}
-.flexigrid div.fbutton .xml {
- background: url(../../yacy/ui/img-2/code.png) no-repeat center left;
-}
-.flexigrid div.fbutton .bookmark {
- border-bottom: 0px;
- background: url(../../yacy/ui/img/bookmark.png) no-repeat center left;
-}
-.flexigrid div.fbutton .blacklist {
- background: url(../../yacy/ui/img/blacklist.png) no-repeat center left;
-}
-.flexigrid div.fbutton .crawl {
- background: url(../../yacy/ui/img/crawl.png) no-repeat center left;
-}
-.flexigrid div.fbutton .next {
- background: url(../../yacy/ui/img/next.png) no-repeat center left;
-}
-.flexigrid div.fbutton .prev {
- background: url(../../yacy/ui/img/prev.png) no-repeat center left;
-}
-.flexigrid div.fbutton .load {
- background: url(../../yacy/ui/img/flexigrid/load.png) no-repeat center left;
-}
-.flexigrid div.fbutton .addTag {
- background: url(../../yacy/ui/img/tags/tag_blue_add.png) no-repeat center left;
-}
-.flexigrid div.fbutton .editTag {
- background: url(../../yacy/ui/img/tags/tag_blue_edit.png) no-repeat center left;
-}
-.flexigrid div.fbutton .deleteTag {
- background: url(../../yacy/ui/img/tags/tag_blue_delete.png) no-repeat center left;
-}
-.flexigrid div.fbutton .log-debug {
- background: url(../../yacy/ui/img-2/magnify.png) no-repeat center left;
-}
-.flexigrid div.fbutton .log-info {
- background: url(../../yacy/ui/img-2/info.png) no-repeat center left;
-}
-.flexigrid div.fbutton .log-system {
- background: url(../../yacy/ui/img-2/accept_green.png) no-repeat center left;
-}
-.flexigrid div.fbutton .log-warning {
- background: url(../../yacy/ui/img/blacklist.png) no-repeat center left;
-}
-.flexigrid div.fbutton .log-error {
- background: url(../../yacy/ui/img-2/stop.png) no-repeat center left;
-}
-.flexigrid div.fbutton .log-new {
- background: url(../../yacy/ui/img-2/new.png) no-repeat center left;
-}
-.flexigrid div.fbutton .log-more {
- /* background: url(../img/flexigrid/uup.png) no-repeat center left; */
- margin-left: -20px;
-}
-/* overrides for ui-tab styles
--------------------------------------*/
-#ymarks_sidebar .ui-tabs-nav li a:link,
-#ymarks_sidebar .ui-tabs-nav li a:visited,
-#ymarks_sidebar .ui-tabs-nav li a:hover,
-#ymarks_sidebar .ui-tabs-nav li a:active,
-#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; padding-left: 5px;}
-
-
-/* overrides for treeview styles
--------------------------------------*/
-.filetree span.tag {
- background: url(../img/tags/tag_blue.png) 0 0 no-repeat;
- padding: 1px 0px 0px 18px;
- display: block;
-}
-.filetree span.topword {
- background: url(../img/flexigrid/magnifier.png) 0 0 no-repeat;
- padding: 1px 0px 0px 18px;
- display: block;
-}
-.filetree ul, .filetree li {
- background-color: transparent;
-} \ No newline at end of file
diff --git a/htroot/jquery/js/yacy-portalsearch.js b/htroot/jquery/js/yacy-portalsearch.js
deleted file mode 100644
index cd2a0e7f7..000000000
--- a/htroot/jquery/js/yacy-portalsearch.js
+++ /dev/null
@@ -1,411 +0,0 @@
-/*
- * YaCy Portalsearch
- *
- * @author Stefan Förster (apfelmaennchen)
- * @version 1.1
- *
- * @requires jquery-1.6.1
- * @requires jquery-ui-1.8.13
- * @requires jquery-query-2.1.7
- * @requires jquery.form-2.73
- * @requires jquery.field-0.9.2.min
- *
- * Dual licensed under the MIT and GPL licenses:
- * http://www.opensource.org/licenses/mit-license.php
- * http://www.gnu.org/licenses/gpl.html
- *
- * Date: 19-MAY-2011
- *
- */
-
-function statuscheck() {
- if(load_status < 4) {
- return;
- } else {
- window.clearInterval(loading);
- yrun();
- }
-}
-
-$(document).ready(function() {
- ynavigators = new Array();
- $.ajaxSetup({
- timeout: 5000,
- cache: true
- })
- // apply default properties
- ycurr = '';
- startRecord = 0;
- maximumRecords = 10;
- submit = false;
- yconf = $.extend({
- url : 'is a mandatory property - no default',
- 'global' : false,
- theme : 'start',
- title : 'YaCy P2P Web Search',
- logo : yconf.url + '/yacy/ui/img/yacy-logo.png',
- link : 'http://yacy.net',
- width : 640,
- height : 640,
- position : [150,50],
- modal : false,
- resizable: true,
- show : '',
- hide : '',
- load_js : true,
- load_css : true
- }, yconf);
-
- $('<div id="ypopup" class="classic"></div>').appendTo("#yacylivesearch");
-
- if(yconf.load_css) {
- var style1 = yconf.url + '/jquery/css/yacy-portalsearch.css';
- var style2 = yconf.url + '/jquery/themes/'+yconf.theme+'/ui.all.css';
- var style3 = yconf.url + '/jquery/css/jquery-ui-combobox.css';
-
- var head = document.getElementsByTagName('head')[0];
-
- $(document.createElement('link'))
- .attr({type:'text/css', href: style1, rel:'stylesheet', media:'screen'})
- .appendTo(head);
- $(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);
- }
-
- load_status = 0;
- loading = window.setInterval("statuscheck()", 200);
- if(yconf.load_js) {
- 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.16.custom.min.js';
- var script5 = yconf.url + '/jquery/js/jquery-ui-combobox.js';
-
- $.getScript(script1, function(){ load_status++; });
- $.getScript(script2, function(){ load_status++; });
- $.getScript(script3, function(){ load_status++; });
- $.getScript(script4, function(){ load_status++; });
- $.getScript(script5, function(){ load_status++; });
- } else {
- yrun();
- }
-});
-
-function yrun() {
-
- $.extend($.ui.accordion.defaults, {
- autoHeight: false,
- clearStyle: true,
- collapsible: true,
- header: "h3"
- });
-
- maximumRecords = parseInt($("#ysearch input[name='maximumRecords']").getValue());
-
- $("#ypopup").dialog({
- autoOpen: false,
- height: yconf.height,
- width: yconf.width,
- minWidth: yconf.width,
- position: yconf.position,
- modal: yconf.modal,
- resizable: yconf.resizable,
- title: yconf.title,
- show: yconf.show,
- hide: yconf.hide,
- close: function(event, ui) {
- $("#yquery").setValue('');
- },
- drag: function(event, ui) {
- var position = $("#ypopup").parent(".ui-dialog").position();
- var left = $("#ypopup").parent(".ui-dialog").width()+5+position.left;
- $("#yside").dialog('option', 'position', [left,position.top+32]);
- },
- dragStop: function(event, ui) {
- var position = $("#ypopup").parent(".ui-dialog").position();
- var left = $("#ypopup").parent(".ui-dialog").width()+5+position.left;
- $("#yside").dialog('option', 'position', [left,position.top+32]);
- },
- resizeStop: function(event, ui) {
- var position = $("#ypopup").parent(".ui-dialog").position();
- var height = $("#ypopup").parent(".ui-dialog").height()-55;
- var left = $("#ypopup").parent(".ui-dialog").width()+5+position.left;
- $("#yside").dialog('option', 'height', height);
- $("#yside").dialog('option', 'position', [left,position.top+32]);
- },
- close: function(event, ui) {
- $("#yside").dialog('destroy');
- $('#yside').remove();
- },
- open: function(event, ui) {
- $('<div id="yside" style="padding:0px;"></div>').insertAfter("#ypopup").parent(".ui-dialog-content");
- var position = $("#ypopup").parent(".ui-dialog").position();
- $("#yside").dialog({
- title: 'Navigation',
- autoOpen: false,
- draggable: false,
- resizable: false,
- width: 220,
- height: $("#ypopup").parent(".ui-dialog").height()-55,
- minHeight: $("#ypopup").parent(".ui-dialog").height()-55,
- show: 'slide',
- hide: 'slide',
- position : [position.left+$("#ypopup").parent(".ui-dialog").width()+5,position.top+32],
- open: function(event, ui) {
- $('div.ui-widget-shadow').remove();
- $('#ypopup').dialog( 'moveToTop' );
- }
- });
- $('.ui-widget-shadow').remove();
- $('div[aria-labelledby="ui-dialog-title-yside"] div.ui-dialog-titlebar').remove();
-
- $("#ypopup").bind("scroll", function(e){
- p1 = $("#ypopup h3 :last").position().top;
- if(p1-$("#ypopup").dialog( "option", "height" ) < 0) {
- startRecord = startRecord + maximumRecords;
- yacysearch(submit, false);
- }
- });
-
-
- }
- });
-
- $('#ysearch').keyup(function(e) {
-
- if(e.which == 27) { // ESC
- $("#ypopup").dialog('close');
- $("#yquery").setValue("");
- } else if(e.which == 39) { // Right
- startRecord = startRecord + maximumRecords;
- yacysearch(submit, false);
- }
- if(ycurr == $("#yquery").getValue()) {
- return false;
- }
-
- if ($("#yquery").getValue() == '') {
- if($("#ypopup").dialog('isOpen'))
- $("#ypopup").dialog('close');
- } else {
- ycurr = $("#yquery").getValue();
- if(!submit) yacysearch(false, true);
- else submit = false;
- }
- return false;
- });
-
- $('#ysearch').submit(function() {
- submit = true;
- ycurr = $("#yquery").getValue();
-
- if (!$("#ypopup").dialog('isOpen'))
- $("#ypopup").dialog('open');
- else
- if ($("#yside").dialog('isOpen'))
- $("#yside").dialog('close');
-
- $("#yquery").focus();
-
- yacysearch(yconf.global, true);
- return false;
- });
-}
-
-function yacysearch(global, clear) {
- var url = yconf.url + '/yacysearch.json?callback=?'
-
- if(clear) {
- $('#ypopup').empty();
-
- var loading = "<div class='yloading'><h3 class='linktitle'><em>Loading: "+yconf.url+"</em><br/>";
- var loadimg = "<img src='"+yconf.url+"/yacy/ui/img/loading2.gif' align='absmiddle'/></h3></div>";
- $('#ypopup').append(loading+loadimg);
-
- if (!$("#ypopup").dialog('isOpen'))
- $("#ypopup").dialog('open');
- else
- if ($("#yside").dialog('isOpen'))
- $("#yside").dialog('close');
-
- $("#yquery").focus();
- }
-
- var param = [];
- $("#ysearch input").each(function(i){
- var item = { name : $(this).attr('name'), value : $(this).attr('value') };
- if(item.name == 'resource') {
- if(item.value == 'global') global = true;
- if(global) item.value = 'global';
- }
- if(item.name == 'query' || item.name == 'search') {
- if(item.value != ycurr)
- ycurr = item.value;
- }
- param[i] = item;
- });
- param[param.length] = { name : 'startRecord', value : startRecord };
-
- $.ajaxSetup({
- timeout: 10000,
- 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;
-
- if(ycurr.replace(/ /g,"+") != searchTerms) {
- return false;
- }
- if(clear) {
- $('#ypopup').empty();
- }
-
- var total = data.channels[0].totalResults;
-
- if(global) var result = 'global';
- else var result = 'local';
-
- var count = 0;
- $.each (
- data.channels[0].items,
- function(i,item) {
- if (item) {
- var favicon = "<img src='"+yconf.url+"/ViewImage.png?width=16&amp;height=16&amp;code="+item.faviconCode+"' class='favicon'/>";
- var title = "<h3 class='linktitle'>"+favicon+"<a href='"+item.link+"' target='_blank'>"+item.title+"</a></h3>";
- var url = "<p class='url'><a href='"+item.link+"' target='_blank'>"+item.link+"</a></p>"
- var desc = "<p class='desc'>"+item.description+"</p>";
- var date = "<p class='date'>"+item.pubDate.substring(0,16);
- var size = " | "+item.sizename+"</p>";
- $(title+desc+url+date+size).appendTo("#ypopup");
- }
- count++;
- }
- );
- if(clear) {
- $('#yside').empty();
- var query = unescape($("#yquery").getValue());
- var yglobal = "local";
- var sel_date = "";
- var sel_relev = "";
- var sel_local = "";
- var sel_global = "";
- if(query.indexOf("/date") != -1)
- sel_date = 'checked="checked"';
- else
- sel_relev = 'checked="checked"';
-
- if(global) {
- sel_global = 'checked="checked"';
- yglobal = "global";
- }
- else
- sel_local = 'checked="checked"';
-
- var ylogo = "<a href='"+yconf.link+"' target='_blank'><img style='padding-left: 24px;' src='"+yconf.logo+"' alt='"+yconf.logo+"' title='"+yconf.logo+"' /></a>";
- var ymsg= "Total "+yglobal+" results: "+total;
- $("<div class='ymsg'><table><tr><td width='55px'>"+ylogo+"</td><td id='yresult'>"+ymsg+"</td></tr></div").appendTo('#yside');
- $('<hr />').appendTo("#yside");
-
- $("<p class='ytxt'>You can narrow down your search by selecting one of the below navigators:</p>").appendTo('#yside');
- var label = '<label for="ylang">Language:</label><br />';
- var select = '<select class="selector" id="ylang"><option value="">Select one...</option><option value="en" >en-English</option><option value="fr" >fr-French</option><option value="es" >es-Spanish</option><option value="de" >de-German</option><option value="zh" >zh-Chinese</option></select>';
- $('<div class="ui-widget ynav">'+label+select+'</div>').appendTo('#yside');
- $("#ylang").combobox({
- selected: function(event, ui) {
- var query = unescape($("#yquery").getValue() + " /language/" +ui.item.value);
- $("#yquery").setValue(query);
- $("#yquery").trigger('keyup');
- }
- });
- $.each (
- data.channels[0].navigation,
- function(i,facet) {
- if (facet) {
- var id = "#y"+facet.facetname;
- var label = '<label for="y' +facet.facetname+ '">' +facet.displayname+ ': </label><br />';
- var select = '<select id="y' +facet.facetname+ '"><option value="">Select one...</option></select>';
- $('<div class="ui-widget ynav">'+label+select+'</div>').appendTo('#yside');
- $.each (
- facet.elements,
- function(j,element) {
- var mod = '<option value="'+element.modifier +'">'+element.name+ ' (' +element.count+ ')</option>';
- $(mod).appendTo(id);
- }
- )
- $(id).combobox({
- selected: function(event, ui) {
- var query = unescape($("#yquery").getValue() + " " +ui.item.value);
- $("#yquery").setValue(query);
- $("#yquery").trigger('keyup');
- ynavigators.push(ui.item.value);
- }
- });
- }
- }
- );
- $('<hr />').appendTo("#yside");
- 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());
- if (this.id == "date") {
- $("#yquery").setValue(query + " /date");
- } else if (this.id == "relevance") {
- $("#yquery").setValue(query.replace(/ \/date/g,""));
- } else if (this.id == "global") {
- global = true;
- } else if (this.id == "local") {
- global = false;
- }
- yacysearch(global, true);
- });
-
- $('<hr />').appendTo("#yside");
- var arLen=ynavigators.length;
- for ( var i=0, len=arLen; i<len; ++i ){
- $('<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();
- if ($("#ypopup").dialog('isOpen')) {
- if($("#ypopup h3 :last").position().top < $("#ypopup").dialog( "option", "height" )) {
- startRecord = startRecord + maximumRecords;
- 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);
- });
- }
- }
- }
- );
- function autoOpenSidebar() {
- window.setTimeout(function() {
- if( $("#yquery").getValue() == ycurr) {
- $("#yside").dialog('open');
- $("#yquery").focus();
- }
- } , 1500);
- }
-} \ No newline at end of file