1 function getScrollTop() {
5 function f_scrollTop() {
6 return f_filterResults($(window) ? $(window).scrollTop() : 0,
7 document.documentElement ? document.documentElement.scrollTop : 0,
8 document.body ? document.body.scrollTop : 0);
10 function f_filterResults(n_win, n_docel, n_body) {
11 var n_result = n_win ? n_win : 0;
12 if (n_docel && (!n_result || (n_result > n_docel)))
14 return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
17 function setScrollTop() {
18 $(window) ? $(window).scrollTop(0) : 0;
19 document.documentElement ? document.documentElement.scrollTop = 0 : 0;
20 document.body ? document.body.scrollTop = 0 : 0;
24 $node = $('#goTopBtn');
25 if (getScrollTop() > 0) {
31 $(window).scroll(function() {
32 if (getScrollTop() > 0) {
39 $node.click(function() {
44 function drawRatio() {
45 $('.suite_item').each(function(i, node) {
50 $(".see_all").click(function(){
52 $("#see_fail").hide();
53 $("#see_block").hide();
59 $(".see_failed").click(function(){
61 $("#see_fail").show();
62 $("#see_block").hide();
68 $(".see_blocked").click(function(){
70 $("#see_fail").hide();
71 $("#see_block").show();
77 $(".see_na").click(function(){
79 $("#see_fail").hide();
80 $("#see_block").hide();
86 $("a.test_case_popup").click(function(){
88 Popup.show($this.attr('id'));
92 $(".see_capabilities").click(function(){
93 if ($('#capability_table').css('display') == 'none') {
94 $("#capability_table").show();
96 $("#capability_table").hide();
101 function drawSuiteRatio(node) {
102 arrTitle = new Array("Passed", "Failed", "Blocked", "Not Executed");
104 var $total = $node.find('.total');
105 var $pass = $node.find('.pass');
106 var $fail = $node.find('.fail');
107 var $block = $node.find('.block');
108 var $na = $node.find('.na');
109 var $div = $node.find('.RatioGraphic');
111 var total_int = parseInt($total.text());
112 var pass_int = parseInt($pass.text());
113 var fail_int = parseInt($fail.text());
114 var block_int = parseInt($block.text());
115 var na_int = parseInt($na.text());
117 var pass_rate = pass_int * 100 / total_int;
118 var fail_rate = fail_int * 100 / total_int;
119 var block_rate = block_int * 100 / total_int;
120 var na_rate = na_int * 100 / total_int;
124 var pass_width = areaWidth * pass_rate / 100;
125 var fail_width = areaWidth * fail_rate / 100;
126 var block_width = areaWidth * block_rate / 100;
127 var na_width = areaWidth * na_rate / 100;
129 pass_rate = pass_rate.toFixed(2);
130 fail_rate = fail_rate.toFixed(2);
131 block_rate = block_rate.toFixed(2);
132 na_rate = na_rate.toFixed(2);
134 var pass_style = "padding:3px 0px 0px 0px;font-size:9pt;height:17px;text-align:center;color:white;font-weight:bold;background:url("./style/blue.jpg");"
135 var fail_style = "padding:3px 0px 0px 0px;font-size:9pt;height:17px;text-align:center;color:white;font-weight:bold;background:url("./style/red.jpg");"
136 var block_style = "padding:3px 0px 0px 0px;font-size:9pt;height:17px;text-align:center;color:white;font-weight:bold;background:url("./style/orange.jpg");"
137 var na_style = "padding:3px 0px 0px 0px;font-size:9pt;height:17px;text-align:center;color:white;font-weight:bold;background:url("./style/gray.jpg");"
139 var html = "<table width=\"380.68\" align=\"center\"><tbody><tr>";
141 html += "<td width=\""
145 + "\" title=\"Passed :"
148 if (pass_width > 20){
149 html += pass_rate + "%"
154 html += "<td width=\""
158 + "\" title=\"Failed :"
161 if (fail_width > 20){
162 html += fail_rate + "%"
166 if (block_width > 0){
167 html += "<td width=\""
171 + "\" title=\"Blocked :"
174 if (block_width > 20){
175 html += block_rate + "%"
180 html += "<td width=\""
184 + "\" title=\"Blocked :"
188 html += na_rate + "%"
192 html += "</tr></tbody></table>";