Commit 86d9a42295266184ccbe3ebd9c6ee17b3faed5f7

Authored by Rafael Manzo
Committed by Rafael Manzo
1 parent 677a9558

[Mezuro] processing.js reviwed (only comments removed)

Showing 1 changed file with 8 additions and 26 deletions   Show diff stats
plugins/mezuro/public/javascripts/processing.js
@@ -2,9 +2,9 @@ var processingTree = false; @@ -2,9 +2,9 @@ var processingTree = false;
2 var metricName; 2 var metricName;
3 jQuery(function (){ 3 jQuery(function (){
4 jQuery('.source-tree-link').live("click", reloadModule); 4 jQuery('.source-tree-link').live("click", reloadModule);
5 - jQuery('[show-metric-history]').live("click", display_metric_history); //TODO review for project history  
6 - jQuery('[show-grade-history]').live("click", display_grade_history); //TODO review for project history  
7 - jQuery('#project_date_submit').live("click", reloadProcessingWithDate); //TODO review for project history 5 + jQuery('[show-metric-history]').live("click", display_metric_history);
  6 + jQuery('[show-grade-history]').live("click", display_grade_history);
  7 + jQuery('#project_date_submit').live("click", reloadProcessingWithDate);
8 showLoadingProcess(true); 8 showLoadingProcess(true);
9 showProcessing(); 9 showProcessing();
10 }); 10 });
@@ -14,7 +14,6 @@ function showProcessing() { @@ -14,7 +14,6 @@ function showProcessing() {
14 callAction('processing', 'state', {repository_id: repository_id}, showProcessingFor); 14 callAction('processing', 'state', {repository_id: repository_id}, showProcessingFor);
15 } 15 }
16 16
17 -//TODO review for project history  
18 function display_metric_history() { 17 function display_metric_history() {
19 var module_result_id = jQuery(this).attr('data-module-id'); 18 var module_result_id = jQuery(this).attr('data-module-id');
20 var formatted_name = jQuery(this).attr('show-metric-history'); 19 var formatted_name = jQuery(this).attr('show-metric-history');
@@ -25,7 +24,6 @@ function display_metric_history() { @@ -25,7 +24,6 @@ function display_metric_history() {
25 return false; 24 return false;
26 } 25 }
27 26
28 -//TODO review for project history  
29 function display_grade_history() { 27 function display_grade_history() {
30 var module_result_id = jQuery(this).attr('data-module-id'); 28 var module_result_id = jQuery(this).attr('data-module-id');
31 toggle_mezuro("#historical-grade"); 29 toggle_mezuro("#historical-grade");
@@ -33,12 +31,10 @@ function display_grade_history() { @@ -33,12 +31,10 @@ function display_grade_history() {
33 return false; 31 return false;
34 } 32 }
35 33
36 -//TODO review for project history  
37 function show_metrics(content) { 34 function show_metrics(content) {
38 jQuery('#historical-' + metricName).html(content); 35 jQuery('#historical-' + metricName).html(content);
39 } 36 }
40 37
41 -//TODO review for project history  
42 function show_grades(content) { 38 function show_grades(content) {
43 jQuery('#historical-grade').html(content); 39 jQuery('#historical-grade').html(content);
44 } 40 }
@@ -48,31 +44,27 @@ function toggle_mezuro(element){ @@ -48,31 +44,27 @@ function toggle_mezuro(element){
48 return false; 44 return false;
49 } 45 }
50 46
51 -//TODO Waiting for ModuleResultController refactoring  
52 function reloadModule(){ 47 function reloadModule(){
53 var module_result_id = jQuery(this).attr('data-module-id'); 48 var module_result_id = jQuery(this).attr('data-module-id');
54 showLoadingProcess(false); 49 showLoadingProcess(false);
55 processingTree = true; 50 processingTree = true;
56 -// callAction('module_result', 'project_tree', {results_root_id: results_root_id }, showProjectTree);  
57 callAction('module_result', 'module_result', {module_result_id: module_result_id}, showModuleResult); 51 callAction('module_result', 'module_result', {module_result_id: module_result_id}, showModuleResult);
58 return false; 52 return false;
59 } 53 }
60 54
61 -//TODO review for project history  
62 function reloadProcessingWithDate(date){ 55 function reloadProcessingWithDate(date){
63 reloadProcessing(date + "T00:00:00+00:00"); 56 reloadProcessing(date + "T00:00:00+00:00");
64 return false; 57 return false;
65 } 58 }
66 59
67 -//TODO review for project history  
68 function reloadProcessing(date){ 60 function reloadProcessing(date){
69 repository_id = processingData('repository-id'); 61 repository_id = processingData('repository-id');
70 showLoadingProcess(true); 62 showLoadingProcess(true);
71 63
72 callAction('processing', 'processing', {date: date, repository_id: repository_id}, function(content){ 64 callAction('processing', 'processing', {date: date, repository_id: repository_id}, function(content){
73 showReadyProcessing(content); 65 showReadyProcessing(content);
74 - var module_result_id = jQuery("#module_result_root_id").attr('module_result_root_id'); //TODO Waiting for ModuleResultController refactoring  
75 - callAction('module_result', 'module_result', {module_result_id: module_result_id}, showModuleResult); //TODO Waiting for ModuleResultController refactoring 66 + var module_result_id = jQuery("#module_result_root_id").attr('module_result_root_id');
  67 + callAction('module_result', 'module_result', {module_result_id: module_result_id}, showModuleResult);
76 } 68 }
77 ); 69 );
78 } 70 }
@@ -88,8 +80,8 @@ function showProcessingFor(state){ @@ -88,8 +80,8 @@ function showProcessingFor(state){
88 jQuery('#processing-state').html('<div style="color:Green">READY</div>'); 80 jQuery('#processing-state').html('<div style="color:Green">READY</div>');
89 callAction('processing', 'processing', {repository_id: repository_id}, function(content){ 81 callAction('processing', 'processing', {repository_id: repository_id}, function(content){
90 showReadyProcessing(content); 82 showReadyProcessing(content);
91 - var module_result_id = jQuery("#module_result_root_id").attr('module_result_root_id'); //TODO Waiting for ModuleResultController refactoring  
92 - callAction('module_result', 'module_result', {module_result_id: module_result_id}, showModuleResult); //TODO Waiting for ModuleResultController refactoring 83 + var module_result_id = jQuery("#module_result_root_id").attr('module_result_root_id');
  84 + callAction('module_result', 'module_result', {module_result_id: module_result_id}, showModuleResult);
93 } 85 }
94 ); 86 );
95 } 87 }
@@ -112,18 +104,8 @@ function showReadyProcessing(content) { @@ -112,18 +104,8 @@ function showReadyProcessing(content) {
112 jQuery('#processing').html(content); 104 jQuery('#processing').html(content);
113 } 105 }
114 106
115 -//function showProjectTree(content){  
116 -// processingTree = false;  
117 -// jQuery('#project-tree').html(content);  
118 -// return false;  
119 -//}  
120 -  
121 -//TODO Waiting for ModuleResultController refactoring  
122 function showModuleResult(content){ 107 function showModuleResult(content){
123 -// if (processingTree != true){  
124 jQuery('#module-result').html(content); 108 jQuery('#module-result').html(content);
125 -// }  
126 -// return false;  
127 } 109 }
128 110
129 function callAction(controller, action, params, callback){ 111 function callAction(controller, action, params, callback){
@@ -147,4 +129,4 @@ function sourceNodeToggle(id){ @@ -147,4 +129,4 @@ function sourceNodeToggle(id){
147 var suffixes = ['_hidden', '_plus', '_minus']; 129 var suffixes = ['_hidden', '_plus', '_minus'];
148 for (var i in suffixes) 130 for (var i in suffixes)
149 jQuery('#' + id + suffixes[i]).toggle(); 131 jQuery('#' + id + suffixes[i]).toggle();
150 -} 132 -}
  133 +}
151 \ No newline at end of file 134 \ No newline at end of file