From 56fabf776a9f64807e675204e03b1795015cdca5 Mon Sep 17 00:00:00 2001 From: Benjamin Jones Date: Wed, 2 Jan 2013 13:14:18 -0800 Subject: added work in progress on trac guidelines --- exampleData/ruleSets/trac/navigation.json | 57 +++++++++++++++++++++++++++++++ exampleData/ruleSets/trac/structure.json | 29 ++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 exampleData/ruleSets/trac/navigation.json create mode 100644 exampleData/ruleSets/trac/structure.json (limited to 'exampleData') diff --git a/exampleData/ruleSets/trac/navigation.json b/exampleData/ruleSets/trac/navigation.json new file mode 100644 index 0000000..bda8dab --- /dev/null +++ b/exampleData/ruleSets/trac/navigation.json @@ -0,0 +1,57 @@ +/* + * navigation.json + * Author: Benjamin Jones + * + * 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); + } + } + }//, +//-------------------------------------------- + ] +} diff --git a/exampleData/ruleSets/trac/structure.json b/exampleData/ruleSets/trac/structure.json new file mode 100644 index 0000000..1207241 --- /dev/null +++ b/exampleData/ruleSets/trac/structure.json @@ -0,0 +1,29 @@ +/* + * structure.json + * Author: Benjamin Jones + * + * Guidelines relating to structure (headings, layout, ...) of pages + */ + +{ 'name': "Structure Guidelines" +, 'description': "Guidelines relating to structure (headings, layout, ...) of pages" +, 'rules': [ +//-------------------------------------------- + { 'name': "Headings exist" + , 'description': "every page should include at least one heading" + , 'rule': + function() { + if (! $5(":heading").nonEmpty().exists()) { + var elt = $5("body"); + report("could not find any (non-empty) headings on the page", elt); + } + }, +//-------------------------------------------- + { 'name': "Fluid Layouts" + , 'description': "pages should not use a fluid layout" + , 'rule': + function() { + }//, +//-------------------------------------------- + ] +} -- cgit v1.2.3