Commit d567b23bf053cee78fb7218cbe6d15d615fea582

Authored by Jeremy Mack
2 parents 3a144328 713802fd

Merge branch 'master' into bulk_repo_import

Conflicts:
	app/views/refs/_tree.html.haml
app/assets/images/ajax-loader-facebook.gif 0 → 100644

723 Bytes

app/assets/javascripts/loader.js 0 → 100644
... ... @@ -0,0 +1,11 @@
  1 +var Loader = {
  2 + img_src: "/assets/ajax-loader.gif",
  3 +
  4 + html:
  5 + function(width) {
  6 + img = $("<img>");
  7 + img.attr("width", width);
  8 + img.attr("src", this.img_src);
  9 + return img;
  10 + }
  11 +}
... ...
app/assets/stylesheets/projects.css.scss
... ... @@ -581,3 +581,9 @@ h4.middle-panel {
581 581 }
582 582 }
583 583 }
  584 +
  585 +.dashboard-loader {
  586 + float:right;
  587 + margin-right:30px;
  588 + display:none;
  589 +}
... ...
app/views/dashboard/_menu.html.haml
... ... @@ -2,12 +2,20 @@
2 2 = link_to "Activities", dashboard_path, :remote => true, :class => "button-small dash-button #{"active" if current_page?(dashboard_path) || current_page?(root_path) }", :id => "activities_slide"
3 3 = link_to "Issues", dashboard_issues_path, :remote => true, :class => "button-small dash-button #{"active" if current_page?(dashboard_issues_path)}", :id => "issues_slide"
4 4 = link_to "Merge Requests", dashboard_merge_requests_path, :remote => true, :class => "button-small dash-button #{"active" if current_page?(dashboard_merge_requests_path)}", :id => "merge_requests_slide"
5   -
  5 + %img{:src => "/assets/ajax-loader-facebook.gif", :class => "dashboard-loader"}
6 6  
7 7 :javascript
8 8 $(function(){
9 9 $(".dash-button").live("click", function() {
10 10 $(".dash-button").removeClass("active");
11 11 $(this).addClass("active");
12   - })
  12 + });
  13 +
  14 + $(".dash-button").live("ajax:before", function() {
  15 + $(".dashboard-loader").show();
  16 + });
  17 +
  18 + $(".dash-button").live("ajax:complete", function() {
  19 + $(".dashboard-loader").hide();
  20 + });
13 21 });
... ...
app/views/refs/_tree.html.haml
... ... @@ -35,11 +35,14 @@
35 35 - contents.select{ |i| i.is_a?(Grit::Blob)}.each do |content|
36 36 = render :partial => "refs/tree_item", :locals => { :content => content }
37 37  
38   - - if content = contents.select{ |c| c.is_a?(Grit::Blob) and c.name =~ /^readme\.(md|markdown)$/i }.first
  38 + - if content = contents.select{ |c| c.is_a?(Grit::Blob) and c.name =~ /^readme/i }.first
39 39 #tree-readme-holder
40 40 %h3= content.name
41 41 .readme
42   - = markdown(encode content.data)
  42 + - if content.name =~ /\.(md|markdown)$/i
  43 + = markdown(encode content.data)
  44 + - else
  45 + = simple_format(encode content.data)
43 46  
44 47 :javascript
45 48 $(function(){
... ...