-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstyle.js
executable file
·102 lines (82 loc) · 1.95 KB
/
style.js
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
101
102
// css constants
var colors = { nav: {
bg: '#ace'
,over: '#89b'
}
}
// helper methods
function showContent(content) {
$('.contentDiv:not('+content+')').hide();
$(content).show();
}
// properties set after document loaded:
$(function() {
/* Nav Bar */
$('#navBar ul li').bind('click',
function(e) {
showContent('#'+e.target.id.replace('nav','content'));
}
);
$('#navBar ul li').bind('mouseover',
function(e) {
$(e.target).css('background',colors.nav.over);
}
);
$('#navBar ul li').bind('mouseleave',
function(e) {
$(e.target).css('background',colors.nav.bg);
}
);
/* Browser */
$('#homelink').click(
function(e) {
callBrowseAPI(homelink);
}
);
$('#backlink').click(
function(e) {
if (APICalls.length > 0 && APIPos > 0) {
APIPos--; // one gets added on call
callBrowseAPI(APICalls[APIPos],true);
}
}
);
$('#refreshlink').click(
function(e) {
if (APICalls.length > 0 && APIPos > 0) {
callBrowseAPI(APICalls[APIPos],true);
}
}
);
$('#fwdlink').click(
function(e) {
if (APICalls.length > 0 && APIPos > 0) {
if (APIPos+1 < APICalls.length)
callBrowseAPI(APICalls[++APIPos],true);
}
}
);
$('#browseBodyDiv div').live('mouseover',
function(e) {
var me = e.target;
while ($(me).parents('.instanceNode').length>0) me=$(me).parent()[0];
$(me).css('background','#eea');
}
);
$('#browseBodyDiv div').live('mouseout',
function(e) {
var me = e.target;
while ($(me).parents('.instanceNode').length>0) me=$(me).parent()[0];
$(me).css('background','#eee');
}
);
var service = homelink;
var i = window.location.toString().indexOf('apiurl=');
if (0 <= i) {
service = unescape(window.location.toString().substring(i+7));
service += '&jsoncallback=?';
}
callBrowseAPI(service);
$('#navBrowse').click();
$('#homelink').click();
});