1 $(document).ready(function() {
2 $('a.navigator-link').click(function() {
3 // Extract the panel for this link
4 var panel = getPanelName($(this));
6 // Mark this link as currently selected
7 $('.navigator-link').parent().removeClass('navigator-selected');
8 $(this).parent().addClass('navigator-selected');
13 installMethodHandlers('failed');
14 installMethodHandlers('skipped');
15 installMethodHandlers('passed', true); // hide passed methods by default
17 $('a.method').click(function() {
22 // Hide all the panels and display the first one (do this last
23 // to make sure the click() will invoke the listeners)
25 $('.navigator-link').first().click();
27 // Collapse/expand the suites
28 $('a.collapse-all-link').click(function() {
29 var contents = $('.navigator-suite-content');
30 if (contents.css('display') == 'none') {
38 // The handlers that take care of showing/hiding the methods
39 function installMethodHandlers(name, hide) {
40 function getContent(t) {
41 return $('.method-list-content.' + name + "." + t.attr('panel-name'));
44 function getHideLink(t, name) {
45 var s = 'a.hide-methods.' + name + "." + t.attr('panel-name');
49 function getShowLink(t, name) {
50 return $('a.show-methods.' + name + "." + t.attr('panel-name'));
53 function getMethodPanelClassSel(element, name) {
54 var panelName = getPanelName(element);
55 var sel = '.' + panelName + "-class-" + name;
59 $('a.hide-methods.' + name).click(function() {
60 var w = getContent($(this));
62 getHideLink($(this), name).hide();
63 getShowLink($(this), name).show();
64 getMethodPanelClassSel($(this), name).hide();
67 $('a.show-methods.' + name).click(function() {
68 var w = getContent($(this));
70 getHideLink($(this), name).show();
71 getShowLink($(this), name).hide();
72 showPanel(getPanelName($(this)));
73 getMethodPanelClassSel($(this), name).show();
77 $('a.hide-methods.' + name).click();
79 $('a.show-methods.' + name).click();
83 function getHashForMethod(element) {
84 return element.attr('hash-for-method');
87 function getPanelName(element) {
88 return element.attr('panel-name');
91 function showPanel(panelName) {
93 var panel = $('.panel[panel-name="' + panelName + '"]');
97 function showMethod(element) {
98 var hashTag = getHashForMethod(element);
99 var panelName = getPanelName(element);
100 showPanel(panelName);
101 var current = document.location.href;
102 var base = current.substring(0, current.indexOf('#'))
103 document.location.href = base + '#' + hashTag;
104 var newPosition = $(document).scrollTop() - 65;
105 $(document).scrollTop(newPosition);
108 function drawTable() {
109 for (var i = 0; i < suiteTableInitFunctions.length; i++) {
110 window[suiteTableInitFunctions[i]]();
113 for (var k in window.suiteTableData) {
114 var v = window.suiteTableData[k];
115 var div = v.tableDiv;
116 var data = v.tableData
117 var table = new google.visualization.Table(document.getElementById(div));
119 showRowNumber : false