summaryrefslogtreecommitdiff
path: root/doc/lib/template.js
blob: 2f5efb1ede38eaa876170e0e6c88982845392ee0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
$(document).ready(function(){
	var prefilters = $("#ancestors > ol > li").filter(function(){
		var name = $(this).attr("name");
		return name == "scala.Any" || name == "scala.AnyRef";
	});
	prefilters.removeClass("in");
	prefilters.addClass("out");
	filterInherit();
	$("#ancestors > ol > li").click(function(){
		if ($(this).hasClass("in")) {
			$(this).removeClass("in");
			$(this).addClass("out");
		}
		else if ($(this).hasClass("out")) {
			$(this).removeClass("out");
			$(this).addClass("in");
		};
		filterInherit();
	});
	$(".signature .symbol .extype").hover(
		function(){
			var full = $(this).attr("name");
			var short = $(this).text();
			$(this).attr("name", short);
			$(this).text(full);
		},
		function(){
			var short = $(this).attr("name");
			var full = $(this).text();
			$(this).attr("name", full);
			$(this).text(short);
		}
	);
	$("#template div.fullcomment").hide();
	var docAllSigs = $("#template .signature");
	function commentShowFct(fullComment){
		var vis = $(":visible", fullComment);
		if (vis.length > 0) {
			fullComment.slideUp(100);
		}
		else {
			fullComment.slideDown(100);
		}
	};
	var docShowSigs = docAllSigs.filter(function(){
		return $("+ div.fullcomment", $(this)).length > 0;
	});
	docShowSigs.css("cursor", "help");
	docShowSigs.click(function(){
		commentShowFct($("+ div.fullcomment", $(this)));
	});
	function commentToggleFct(shortComment){
		var vis = $("~ div.fullcomment:visible", shortComment);
		if (vis.length > 0) {
			shortComment.slideDown(100);
			vis.slideUp(100);
		}
		else {
			var hid = $("~ div.fullcomment:hidden", shortComment);
			hid.slideDown(100);
			shortComment.slideUp(100);
		}
	};
	var docToggleSigs = docAllSigs.filter(function(){
		return $("+ p.shortcomment", $(this)).length > 0;
	});
	docToggleSigs.css("cursor", "help");
	docToggleSigs.click(function(){
		commentToggleFct($("+ p.shortcomment", $(this)));
	});
	$("p.shortcomment").click(function(){
		commentToggleFct($(this));
	});
});

function filterInherit() {
	$("#mbrsel > div > ol > li.in").each(function(){
		findMembersByOwner($(this).attr("name")).show();
	});
	$("#mbrsel > div > ol > li.out").each(function(){
		findMembersByOwner($(this).attr("name")).hide();
	});
	return false;
};

function findMembersByOwner(owner0) {
	return $(".members > ol > li").filter(function(){
		var qualName1 = $(this).attr("name");
		if (qualName1 == undefined) return false;
		return owner0 == qualName1.slice(0, qualName1.indexOf("#"));
	});
};

function findMemberByName(name0) {
	return $(".members > ol > li").filter(function(){
		var qualName1 = $(this).attr("name");
		if (qualName1 == undefined) return false;
		return name0 == qualName1.slice(qualName1.indexOf("#") + 1);
	}).eq(0);
};