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
|
/*
* navigation.json
* Author: Benjamin Jones <bjones@galois.com>
*
* Ruleset for checking the consistency of Trac navigation elements
*/
{ 'name': "Trac Navigation Guidelines"
, 'description': "Guidelines for checking the consistency of Trac navigation elements"
, 'rules': [
//--------------------------------------------
{ 'name': "Homepage link"
, 'description': "all pages should link back to the homepage"
, 'rule':
function() {
if ($5("a").linksTo("http://wiki.galois.com").length === 0) {
var elt = $("body");
report("did not find a link back to homepage", elt);
}
}
},
//--------------------------------------------
{ 'name': "Global navigation"
, 'description': "Global navigation links should appear on every page"
, 'rule':
function() {
if (! $5("div").idExists("topbar")) {
var elt = $("body");
report("could not find global navigation links", elt);
}
}
},
//--------------------------------------------
{ 'name': "Module level navigation"
, 'description': "Module level navigation links should appear on every page"
, 'rule':
function() {
if (! $5("div").idExists("mainnav")) {
var elt = $("body");
report("could not find module navigation links", elt);
}
}
},
//--------------------------------------------
{ 'name': "Local navigation"
, 'description': "Local (context dependent) navigation links should appear on every page"
, 'rule':
function() {
if (! $5("div").idExists("ctxtnav")) {
var elt = $("body");
report("could not find local (context dependent) navigation links", elt);
}
}
}//,
//--------------------------------------------
]
}
|