Commit cbdb8c12c457b8329344816a5746c52abe296b16

Authored by Caio Salgado + Jefferson Fernandes
Committed by Paulo Meireles
1 parent c32aa8a5

[mezuro] Now project page processing has loading animation

plugins/mezuro/public/javascripts/project_content.js
1 var processingTree = false; 1 var processingTree = false;
2 jQuery(function (){ 2 jQuery(function (){
3 jQuery('.source-tree-link').live("click", reloadModule); 3 jQuery('.source-tree-link').live("click", reloadModule);
  4 + showLoadingProcess(true);
4 showProjectContent(); 5 showProjectContent();
5 }); 6 });
6 7
@@ -10,7 +11,7 @@ function showProjectContent() { @@ -10,7 +11,7 @@ function showProjectContent() {
10 11
11 function reloadModule(){ 12 function reloadModule(){
12 var module_name = jQuery(this).attr('data-module-name'); 13 var module_name = jQuery(this).attr('data-module-name');
13 - showLoadingProcess(); 14 + showLoadingProcess(false);
14 processingTree = true; 15 processingTree = true;
15 callAction('project_tree', {module_name: module_name }, showProjectTree); 16 callAction('project_tree', {module_name: module_name }, showProjectTree);
16 callAction('module_result', {module_name: module_name}, showModuleResult); 17 callAction('module_result', {module_name: module_name}, showModuleResult);
@@ -31,10 +32,8 @@ function showProjectContentFor(state){ @@ -31,10 +32,8 @@ function showProjectContentFor(state){
31 32
32 function showProjectContentAfter(seconds){ 33 function showProjectContentAfter(seconds){
33 if (seconds > 0){ 34 if (seconds > 0){
34 - alert("Not ready. Trying again in " + seconds + " seconds");  
35 setTimeout(function() { showProjectContentAfter(seconds - 10);}, 10000); 35 setTimeout(function() { showProjectContentAfter(seconds - 10);}, 10000);
36 } else { 36 } else {
37 - alert("Trying now...");  
38 showProjectContent(); 37 showProjectContent();
39 } 38 }
40 } 39 }
@@ -65,7 +64,10 @@ function projectContentData(data){ @@ -65,7 +64,10 @@ function projectContentData(data){
65 return jQuery('#project-result').attr('data-' + data); 64 return jQuery('#project-result').attr('data-' + data);
66 } 65 }
67 66
68 -function showLoadingProcess(){ 67 +function showLoadingProcess(firstLoad){
  68 + if(firstLoad)
  69 + showProjectResult("<img src='/images/loading-small.gif'/>");
  70 +
69 showProjectTree("<img src='/images/loading-small.gif'/>"); 71 showProjectTree("<img src='/images/loading-small.gif'/>");
70 showModuleResult("<img src='/images/loading-small.gif'/>"); 72 showModuleResult("<img src='/images/loading-small.gif'/>");
71 } 73 }
plugins/mezuro/views/content_viewer/show_project.rhtml
@@ -34,5 +34,4 @@ @@ -34,5 +34,4 @@
34 </div> 34 </div>
35 <div id="project-tree"></div> 35 <div id="project-tree"></div>
36 <div id="module-result"> 36 <div id="module-result">
37 - <h3><%= _('Processing ') + @project.name + '...' %></h3>  
38 </div> 37 </div>