Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

YaCy Portal Search Widget - see http://localhost:8080/yacy/ui/yacyui-portaltest.html - two new parameters (logo and link) for yconf as requested at http://forum.yacy-websuche.de/viewtopic.php?f=15&t=1762#p14101

apfelmaennchen675f350d18bb
diff --git a/htroot/yacy/ui/css/yacyui-portalsearch.css b/htroot/yacy/ui/css/yacyui-portalsearch.css
index 5ff8d9499..1c10a2ad3 100644
--- a/htroot/yacy/ui/css/yacyui-portalsearch.css
+++ b/htroot/yacy/ui/css/yacyui-portalsearch.css
@@ -18,6 +18,7 @@
#ypopup .url a {
color:#20A020;
text-decoration:none;
+ margin-top: 10px;
}
#ypopup h3.linktitle {
margin-top: 2px;
@@ -68,6 +69,6 @@ div .ybpane {
}
#ypopup .yloading {
margin-top: 150px;
- margin-left: -10px;
+ margin-left: -12px;
text-align: center;
}
\ No newline at end of file
diff --git a/htroot/yacy/ui/js/yacyui-portalsearch.js b/htroot/yacy/ui/js/yacyui-portalsearch.js
index 7c008d7b1..2c214b992 100644
--- a/htroot/yacy/ui/js/yacyui-portalsearch.js
+++ b/htroot/yacy/ui/js/yacyui-portalsearch.js
@@ -9,16 +9,18 @@ $(document).ready(function() {
startRecord = 0;
maximumRecords = 10;
yconf = $.extend({
- url : 'is a mandatory property - no default',
- theme : 'start',
- title : 'YaCy P2P Web Search',
- width : 420,
- height : 500,
- position: ['top',50],
- modal: false,
+ url : 'is a mandatory property - no default',
+ theme : 'start',
+ title : 'YaCy P2P Web Search',
+ logo : '/yacy/ui/img/yacy-logo.png',
+ link : 'http://www.yacy.net',
+ width : 420,
+ height : 500,
+ position : ['top',50],
+ modal : false,
resizable: true,
- show: '',
- hide: ''
+ show : '',
+ hide : ''
}, yconf);
$('<div id="ypopup" class="classic"></div>').appendTo("#yacy");
@@ -101,19 +103,19 @@ $(document).ready(function() {
param[param.length] = { name : 'startRecord', value : startRecord };
$.getJSON(url, param,
- function(json, status){
+ function(json, status){
if (json[0]) data = json[0];
else data = json;
- $('#ypopup').empty();
-
+ $('#ypopup').empty();
+
var total = data.channels[0].totalResults.replace(/[,.]/,"");
var page = (data.channels[0].startIndex / data.channels[0].itemsPerPage) + 1;
var start = startRecord + 1;
var end = startRecord + maximumRecords;
$("div .ybpane").remove();
- var ylogo = "<div class='ybpane'><a href='http://www.yacy.net' target='_blank'><img src='"+yconf.url+"/yacy/ui/img/yacy-logo.png' alt='www.yacy.net' title='www.yacy.net' /></a></div>";
+ var ylogo = "<div class='ybpane'><a href='"+yconf.link+"' target='_blank'><img src='"+yconf.logo+"' alt='"+yconf.logo+"' title='"+yconf.logo+"' /></a></div>";
var yresult = "<div class='ybpane'><em>Displaying result "+start+" to "+end+"<br/> of "+total+" total results.</em></div>";
$("div .ui-dialog-buttonpane").prepend(ylogo+yresult);
diff --git a/htroot/yacy/ui/yacyui-portaltest.html b/htroot/yacy/ui/yacyui-portaltest.html
index 73c1aa248..f1ffbcc36 100644
--- a/htroot/yacy/ui/yacyui-portaltest.html
+++ b/htroot/yacy/ui/yacyui-portaltest.html
@@ -56,23 +56,29 @@
&lt;/form&gt;
&lt;/div&gt;
</pre>
-<h4>Configuration options and defaults:</h4>
+<h4>Configuration options and defaults for 'yconf':</h4>
<pre>
-url : 'is a mandatory property - no default',
-theme : 'start',
-title : 'YaCy P2P Web Search',
-width : 420,
-height : 500,
-position: ['top',50],
-modal: false,
+url : 'is a mandatory property - no default',
+theme : 'start',
+title : 'YaCy P2P Web Search',
+logo : '/yacy/ui/img/yacy-logo.png',
+link : 'http://www.yacy.net',
+width : 420,
+height : 500,
+position : ['top',50],
+modal : false,
resizable: true,
-show: '',
-hide: ''
+show : '',
+hide : ''
</pre>
<h4>Themes:</h4>
<p>You can <a href="http://jquery-ui.googlecode.com/files/jquery-ui-themes-1.7.zip" target="_blank">
download</a> ready made themes or <a href="http://jqueryui.com/themeroller/" target="_blank">create</a>
-your own custom theme. <br/>Themes are installed into: DATA/HTDOCS/yacy/ui/css/themes/</p>
+your own custom theme. <br/>Themes are installed into: DATA/HTDOCS/yacy/ui/css/themes/</p>
+<h4>Bookmarklet:</h4>
+<p>
+<a href="javascript:q = "" + (window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text); if (!q) q = prompt("You didn&#39;t select any text. Enter a search phrase:", ""); if (q!=null) location="http://localhost:8080/yacysearch.html?display=2&verify=true&query=" + escape(q).replace(/ /g, "+"); void 0" name="yacy">YaCy</a>
+</p>
</body>
</html>