aboutsummaryrefslogtreecommitdiff
path: root/exampleData/ruleSets/trac/navigation.json
blob: f8329ab6c81bd52ee0dc02f44e12c00e2430f3c6 (plain)
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
/*
 * navigation.json
 * Author: Benjamin Jones <bjones@galois.com>
 *
 * Ruleset for checking the consistency of Trac navigation elements
 *
 * Note: the jQuery plugins .linksTo() and .idExists() haven't been
 * written yet (1-31-2013).
 */

{ '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) {
                 report("did not find a link back to homepage", $("body"));
               }
             }
             },
//--------------------------------------------
             { 'name': "Global navigation"
             , 'description': "Global navigation links should appear on every page"
             , 'rule':
             function() {
               if (! $5("div#topbar")) {
                 report("could not find global navigation links", $("body"));
               }
             }
             },
//--------------------------------------------
             { 'name': "Module level navigation"
             , 'description': "Module level navigation links should appear on every page"
             , 'rule':
             function() {
               if ( $5("div#mainnav").length === 0 ) {
                 report("could not find module navigation links", $("body"));
               }
             }
             },
//--------------------------------------------
             { 'name': "Local navigation"
             , 'description': "Local (context dependent) navigation links should appear on every page"
             , 'rule':
             function() {
               if (! $5("div#ctxtnav")) {
                 report("could not find local (context dependent) navigation links", $("body"));
               }
             }
             }
//--------------------------------------------
           ]
}