[scaladoc] There is a text filter tool for members (searching on member name and comment body). Adds button to reset text filter tool. No review.
Known limitation: filtering of members is blocking on keystroke leading to sluggish performance on large classes. Scheduler from index needs to be used for member filtering. git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@22358 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
parent
d5d44befa1
commit
38ad3e5268
|
@ -59,6 +59,7 @@ class Template(tpl: DocTemplateEntity) extends HtmlPage {
|
|||
<div id="template">
|
||||
|
||||
<div id="mbrsel">
|
||||
<div id='textfilter'><span class='pre'/><input type='text' accesskey='/'/><span class='post'/></div>
|
||||
{ if (tpl.linearization.isEmpty) NodeSeq.Empty else
|
||||
<div id="order">
|
||||
<span class="filtertype">Ordering</span>
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 481 B |
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 533 B |
Binary file not shown.
|
@ -47,30 +47,39 @@ h1 {
|
|||
#textfilter {
|
||||
position: relative;
|
||||
display: block;
|
||||
height: 20px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
#textfilter:before {
|
||||
#textfilter > .pre {
|
||||
display: block;
|
||||
content: url("filter_box_left.png");
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
background: url("filter_box_left.png");
|
||||
}
|
||||
|
||||
#textfilter:after {
|
||||
#textfilter > .post {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
content: url("filter_box_right.png");
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
background: url("filter_box_right.png");
|
||||
}
|
||||
|
||||
#textfilter input {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 32px;
|
||||
right: 16px;
|
||||
height: 22px;
|
||||
width: 232px;
|
||||
padding: 5px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 20px;
|
||||
left: 20px;
|
||||
height: 16px;
|
||||
width: 246px;
|
||||
padding: 2px;
|
||||
font-weight: bold;
|
||||
color: #993300;
|
||||
background-color: white;
|
||||
|
|
|
@ -95,7 +95,7 @@ function prepareEntityList() {
|
|||
/* Configures the text filter */
|
||||
function configureTextFilter() {
|
||||
scheduler.add("init", function() {
|
||||
$("#filter").append("<div id='textfilter'><input type='text' accesskey='/'/></div>");
|
||||
$("#filter").append("<div id='textfilter'><span class='pre'/><input type='text' accesskey='/'/><span class='post'/></div>");
|
||||
var input = $("#textfilter > input");
|
||||
resizeFilterBlock();
|
||||
input.bind("keyup", function(event) {
|
||||
|
@ -106,6 +106,12 @@ function configureTextFilter() {
|
|||
});
|
||||
input.focus(function(event) { input.select(); });
|
||||
});
|
||||
scheduler.add("init", function() {
|
||||
$("#textfilter > .post").click(function(){
|
||||
$("#textfilter > input").attr("value", "");
|
||||
textFilter();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Filters all focused templates and packages. This function should be made less-blocking.
|
||||
|
|
|
@ -376,6 +376,46 @@ div.fullcomment dl.paramcmts > dd + dt + dd {
|
|||
|
||||
/* Members filter tool */
|
||||
|
||||
#textfilter {
|
||||
position: relative;
|
||||
display: block;
|
||||
height: 20px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
#textfilter > .pre {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
background: url("filter_box_left.png");
|
||||
}
|
||||
|
||||
#textfilter > .post {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
background: url("filter_box_right.png");
|
||||
}
|
||||
|
||||
#textfilter input {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 20px;
|
||||
left: 20px;
|
||||
height: 16px;
|
||||
padding: 2px;
|
||||
font-weight: bold;
|
||||
color: #993300;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
#mbrsel {
|
||||
padding: 4px;
|
||||
background-color: #B78E99; /* grayish pink */
|
||||
|
|
|
@ -9,6 +9,20 @@ $(document).ready(function(){
|
|||
prefilters.removeClass("in");
|
||||
prefilters.addClass("out");
|
||||
filter();
|
||||
|
||||
var input = $("#textfilter > input");
|
||||
input.bind("keyup", function(event) {
|
||||
if (event.keyCode == 27) { // escape
|
||||
input.attr("value", "");
|
||||
}
|
||||
filter();
|
||||
});
|
||||
input.focus(function(event) { input.select(); });
|
||||
$("#textfilter > .post").click(function(){
|
||||
$("#textfilter > input").attr("value", "");
|
||||
filter();
|
||||
});
|
||||
|
||||
$("#ancestors > ol > li").click(function(){
|
||||
if ($(this).hasClass("in")) {
|
||||
$(this).removeClass("in");
|
||||
|
@ -174,6 +188,8 @@ function initInherit() {
|
|||
};
|
||||
|
||||
function filter() {
|
||||
var query = $("#textfilter > input").attr("value").toLowerCase();
|
||||
var queryRegExp = new RegExp(query, "i");
|
||||
var inheritHides = null
|
||||
if ($("#order > ol > li.inherit").hasClass("in")) {
|
||||
inheritHides = $("#linearization > li:gt(0)");
|
||||
|
@ -201,11 +217,16 @@ function filter() {
|
|||
};
|
||||
};
|
||||
};
|
||||
var showByVis = true
|
||||
var showByVis = true;
|
||||
if (vis1 == "prt") {
|
||||
showByVis = prtVisbl;
|
||||
};
|
||||
if (showByOwned && showByVis) {
|
||||
var showByName = true;
|
||||
if (query != "") {
|
||||
var content = $(this).attr("name") + $("> .fullcomment .cmt", this).text();
|
||||
showByName = queryRegExp.test(content);
|
||||
};
|
||||
if (showByOwned && showByVis && showByName) {
|
||||
$(this).show();
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Reference in New Issue