mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-19 00:01:41 +02:00
- removed usage of jquery and yacy/ui in standard search interfaces as
possible - re-implemented formerly jquery-based tagcloud with simple html - fixed minimized menu for mobile/minimized view (try that: make window very narrow...)
This commit is contained in:
parent
dbd7f77568
commit
ab0e6ba9a6
2
htroot/env/base.css
vendored
2
htroot/env/base.css
vendored
|
@ -156,7 +156,7 @@ tt, *.tt {
|
|||
}
|
||||
|
||||
.hidden {
|
||||
display:hidden;
|
||||
display:none;
|
||||
}
|
||||
|
||||
.listing {
|
||||
|
|
16
htroot/env/bootstrap-base.css
vendored
16
htroot/env/bootstrap-base.css
vendored
|
@ -4,7 +4,7 @@
|
|||
|
||||
/* Move down content because we have a fixed navbar that is 50px tall */
|
||||
body {
|
||||
padding-top: 59px;
|
||||
padding-top: 57px;
|
||||
}
|
||||
|
||||
|
||||
|
@ -23,7 +23,7 @@ body {
|
|||
/* Hide for mobile, show later */
|
||||
.sidebar {
|
||||
display: none;
|
||||
margin-top: -12px;
|
||||
margin-top: -14px;
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.sidebar {
|
||||
|
@ -46,15 +46,15 @@ body {
|
|||
margin-left: -20px;
|
||||
}
|
||||
.nav-sidebar > li > a {
|
||||
padding-right: 20px;
|
||||
padding-left: 20px;
|
||||
padding-right: 10px;
|
||||
padding-left: 16px;
|
||||
padding-top: 0px;
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
.nav-sidebar > li {
|
||||
padding: 0px;
|
||||
margin-left: 8px;
|
||||
margin-right: 8px;
|
||||
margin-left: 6px;
|
||||
margin-right: 6px;
|
||||
}
|
||||
.nav-sidebar > .active > a,
|
||||
.nav-sidebar > .active > a:hover,
|
||||
|
@ -63,8 +63,8 @@ body {
|
|||
background-color: #428bca;
|
||||
}
|
||||
.nav-sidebar h3 {
|
||||
padding-right: 20px;
|
||||
padding-left: 20px;
|
||||
padding-right: 10px;
|
||||
padding-left: 16px;
|
||||
padding-top: 4px;
|
||||
padding-bottom: 1px;
|
||||
margin: 0px;
|
||||
|
|
4
htroot/env/bootstrap/js/jquery.min.js
vendored
Normal file
4
htroot/env/bootstrap/js/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
5
htroot/env/templates/embeddedfooter.template
vendored
5
htroot/env/templates/embeddedfooter.template
vendored
|
@ -1 +1,6 @@
|
|||
</div>
|
||||
|
||||
<!-- Bootstrap core JavaScript, Placed at the end of the document so the pages load faster -->
|
||||
<script src="env/bootstrap/js/jquery.min.js"></script>
|
||||
<script src="/env/bootstrap/js/bootstrap.min.js"></script>
|
||||
<script src="/env/bootstrap/js/docs.min.js"></script>
|
||||
|
|
1
htroot/env/templates/footer.template
vendored
1
htroot/env/templates/footer.template
vendored
|
@ -3,5 +3,6 @@
|
|||
</div>
|
||||
|
||||
<!-- Bootstrap core JavaScript, Placed at the end of the document so the pages load faster -->
|
||||
<script src="env/bootstrap/js/jquery.min.js"></script>
|
||||
<script src="/env/bootstrap/js/bootstrap.min.js"></script>
|
||||
<script src="/env/bootstrap/js/docs.min.js"></script>
|
||||
|
|
1
htroot/env/templates/metas.template
vendored
1
htroot/env/templates/metas.template
vendored
|
@ -29,5 +29,4 @@
|
|||
<!--[if lte IE 7.0]>
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="/env/ie7.css" />
|
||||
<![endif]-->
|
||||
#%env/templates/jqueryheader.template%#
|
||||
<!-- (C), Architecture: Michael Peter Christen; Contact: mc <at> yacy.net -->
|
||||
|
|
5
htroot/env/templates/simplefooter.template
vendored
5
htroot/env/templates/simplefooter.template
vendored
|
@ -1 +1,6 @@
|
|||
</div>
|
||||
|
||||
<!-- Bootstrap core JavaScript, Placed at the end of the document so the pages load faster -->
|
||||
<script src="env/bootstrap/js/jquery.min.js"></script>
|
||||
<script src="/env/bootstrap/js/bootstrap.min.js"></script>
|
||||
<script src="/env/bootstrap/js/docs.min.js"></script>
|
||||
|
|
|
@ -9,8 +9,6 @@
|
|||
<link rel="stylesheet" type="text/css" media="screen" href="env/highslide.css" />
|
||||
<script type="text/javascript" src="js/highslide/highslide.js"></script>
|
||||
<script type="text/javascript">hs.outlineType = 'rounded-white';</script>
|
||||
<script src="yacy/ui/js/jquery-1.3.2.min.js" type="text/javascript"></script>
|
||||
<script src="yacy/ui/js/jquery-ui-1.7.2.min.js" type="text/javascript"></script>
|
||||
<link media="screen" type="text/css" href="yacy/ui/css/autocomplete.css" rel="stylesheet" />
|
||||
<script type="text/javascript" src="js/html.js"></script>
|
||||
<script type="text/javascript" src="yacy/ui/js/jquery.autocomplete.yacy.js"></script>
|
||||
|
|
|
@ -10,21 +10,20 @@
|
|||
<title>Dashboard Template for Bootstrap</title>
|
||||
|
||||
<!-- Bootstrap core CSS -->
|
||||
<link href="/env/bootstrap/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="env/bootstrap/css/bootstrap.min.css" rel="stylesheet">
|
||||
|
||||
<!-- Custom styles for this template -->
|
||||
<link href="/env/bootstrap-base.css" rel="stylesheet">
|
||||
|
||||
<link href="env/bootstrap-base.css" rel="stylesheet">
|
||||
|
||||
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="/env/bootstrap/js/html5shiv.js"></script>
|
||||
<script src="/env/bootstrap/js/respond.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!-- top navigation -->
|
||||
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
|
||||
<div class="container-fluid">
|
||||
<div class="navbar-header">
|
||||
|
@ -50,18 +49,15 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- left navigation -->
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-sm-3 col-md-2 sidebar">
|
||||
<h3>Section 1</h3>
|
||||
<ul class="nav nav-sidebar">
|
||||
<li class="active"><a href="#">Overview</a></li>
|
||||
<li><a href="#">Reports</a></li>
|
||||
<li><a href="#">Analytics</a></li>
|
||||
<li><a href="#">Export</a></li>
|
||||
</ul>
|
||||
<h3>Section 2</h3>
|
||||
<ul class="nav nav-sidebar">
|
||||
<li><a href="">Nav item</a></li>
|
||||
<li><a href="">Nav item again</a></li>
|
||||
|
@ -69,15 +65,12 @@
|
|||
<li><a href="">Another nav item</a></li>
|
||||
<li><a href="">More navigation</a></li>
|
||||
</ul>
|
||||
<h3>Section 3</h3>
|
||||
<ul class="nav nav-sidebar">
|
||||
<li><a href="">Nav item again</a></li>
|
||||
<li><a href="">One more nav</a></li>
|
||||
<li><a href="">Another nav item</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- content -->
|
||||
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
|
||||
<h1 class="page-header">Dashboard</h1>
|
||||
|
||||
|
@ -236,8 +229,11 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Bootstrap core JavaScript, Placed at the end of the document so the pages load faster -->
|
||||
<script src="/env/bootstrap/js/bootstrap.min.js"></script>
|
||||
<script src="/env/bootstrap/js/docs.min.js"></script>
|
||||
<!-- Bootstrap core JavaScript
|
||||
================================================== -->
|
||||
<!-- Placed at the end of the document so the pages load faster -->
|
||||
<script src="env/bootstrap/js/jquery.min.js"></script>
|
||||
<script src="env/bootstrap/js/bootstrap.min.js"></script>
|
||||
<script src="env/bootstrap/js/docs.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
<head>
|
||||
<title>YaCy Interactive Search</title>
|
||||
#%env/templates/metas.template%#
|
||||
<script src="yacy/ui/js/jquery-1.3.2.min.js" type="text/javascript"></script>
|
||||
<script type="text/javascript" src="js/yacyinteractive.js"></script>
|
||||
<script type="text/javascript" src="js/sorttable.js"></script>
|
||||
<link media="screen" type="text/css" href="yacy/ui/css/autocomplete.css" rel="stylesheet" />
|
||||
|
|
|
@ -11,13 +11,6 @@
|
|||
<script type="text/javascript" src="js/yacysearch.js"></script>
|
||||
<script type="text/javascript" src="js/highslide/highslide.js"></script>
|
||||
<script type="text/javascript">hs.outlineType = 'rounded-white';</script>
|
||||
<script src="yacy/ui/js/jquery-1.3.2.min.js" type="text/javascript"></script>
|
||||
<script src="yacy/ui/js/jquery-ui-1.7.2.min.js" type="text/javascript"></script>
|
||||
<script src="yacy/ui/js/jquery.tagcloud.js" type="text/javascript"></script>
|
||||
<script src="yacy/ui/js/jquery.tinysort.min.js" type="text/javascript"></script>
|
||||
<link media="screen" type="text/css" href="yacy/ui/css/themes/start/ui.base.css" rel="stylesheet" />
|
||||
<link media="screen" type="text/css" href="yacy/ui/css/themes/start/ui.theme.css" rel="stylesheet" />
|
||||
<link media="screen" type="text/css" href="yacy/ui/css/autocomplete.css" rel="stylesheet" />
|
||||
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
|
@ -265,5 +258,6 @@ window.setTimeout('latestinfo();',10000);
|
|||
*/
|
||||
</script>
|
||||
|
||||
#%env/templates/footer.template%#
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -7,17 +7,9 @@
|
|||
|
||||
#(nav-topics)#::
|
||||
<div id="tagcloud" style="text-align:justify">#{element}#
|
||||
<a rel="#[count]#" href="#[url]#" style="text-decoration: none;">#[name]#</a>
|
||||
<a rel="#[count]#" href="#[url]#" style="text-decoration: none;font-size:#[size]#px;">#[name]#</a>
|
||||
#{/element}#</div>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
$.fn.tagcloud.defaults = {
|
||||
size: {start: 8, end: 16, unit: 'pt'},
|
||||
color: {start: '#c08080', end: '#2200CC'}
|
||||
};
|
||||
$(document).ready(function(){
|
||||
$("#tagcloud a").tagcloud();
|
||||
return false;
|
||||
})
|
||||
</script>
|
||||
#(/nav-topics)#
|
||||
|
||||
|
|
|
@ -49,7 +49,9 @@ import net.yacy.server.serverSwitch;
|
|||
|
||||
public class yacysearchtrailer {
|
||||
|
||||
private static final int MAX_TOPWORDS = 16;
|
||||
private static final int TOPWORDS_MAXCOUNT = 16;
|
||||
private static final int TOPWORDS_MINSIZE = 8;
|
||||
private static final int TOPWORDS_MAXSIZE = 20;
|
||||
private static final int MAXLIMIT_NAV_LOW = 5;
|
||||
private static final int MAXLIMIT_NAV_HIGH = 20;
|
||||
|
||||
|
@ -239,7 +241,7 @@ public class yacysearchtrailer {
|
|||
}
|
||||
|
||||
// topics navigator
|
||||
final ScoreMap<String> topicNavigator = sb.index.connectedRWI() ? theSearch.getTopicNavigator(MAX_TOPWORDS) : null;
|
||||
final ScoreMap<String> topicNavigator = sb.index.connectedRWI() ? theSearch.getTopicNavigator(TOPWORDS_MAXCOUNT) : null;
|
||||
if (topicNavigator == null || topicNavigator.isEmpty()) {
|
||||
prop.put("nav-topics", "0");
|
||||
} else {
|
||||
|
@ -248,12 +250,16 @@ public class yacysearchtrailer {
|
|||
int i = 0;
|
||||
// first sort the list to a form where the greatest element is in the middle
|
||||
LinkedList<Map.Entry<String, Integer>> cloud = new LinkedList<Map.Entry<String, Integer>>();
|
||||
while (i < MAX_TOPWORDS && navigatorIterator.hasNext()) {
|
||||
int mincount = Integer.MAX_VALUE; int maxcount = 0;
|
||||
while (i < TOPWORDS_MAXCOUNT && navigatorIterator.hasNext()) {
|
||||
name = navigatorIterator.next();
|
||||
count = topicNavigator.get(name);
|
||||
if (count == 0) break;
|
||||
if (name == null) continue;
|
||||
Map.Entry<String, Integer> entry = new AbstractMap.SimpleEntry<String, Integer>(name, (count + MAX_TOPWORDS - i) / 2);
|
||||
int normcount = (count + TOPWORDS_MAXCOUNT - i) / 2;
|
||||
if (normcount > maxcount) maxcount = normcount;
|
||||
if (normcount < mincount) mincount = normcount;
|
||||
Map.Entry<String, Integer> entry = new AbstractMap.SimpleEntry<String, Integer>(name, normcount);
|
||||
if (cloud.size() % 2 == 0) cloud.addFirst(entry); else cloud.addLast(entry); // alternating add entry to first or last position.
|
||||
i++;
|
||||
}
|
||||
|
@ -266,6 +272,9 @@ public class yacysearchtrailer {
|
|||
prop.put(fileType, "nav-topics_element_" + i + "_name", name);
|
||||
prop.put(fileType, "nav-topics_element_" + i + "_url", QueryParams.navurl(fileType.name().toLowerCase(), 0, theSearch.query, name).toString());
|
||||
prop.put("nav-topics_element_" + i + "_count", count);
|
||||
int fontsize = TOPWORDS_MINSIZE + (TOPWORDS_MAXSIZE - TOPWORDS_MINSIZE) * (count - mincount) / (maxcount / mincount);
|
||||
fontsize = Math.max(TOPWORDS_MINSIZE, fontsize - (name.length() - 5));
|
||||
prop.put("nav-topics_element_" + i + "_size", fontsize); // font size in pixel
|
||||
prop.put("nav-topics_element_" + i + "_nl", 1);
|
||||
i++;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user