diff options
-rw-r--r-- | app/assets/images/ajax-loader-facebook.gif | bin | 0 -> 723 bytes | |||
-rw-r--r-- | app/assets/javascripts/loader.js | 11 | ||||
-rw-r--r-- | app/assets/stylesheets/projects.css.scss | 6 | ||||
-rw-r--r-- | app/views/dashboard/_menu.html.haml | 12 | ||||
-rw-r--r-- | app/views/refs/_tree.html.haml | 7 |
5 files changed, 32 insertions, 4 deletions
diff --git a/app/assets/images/ajax-loader-facebook.gif b/app/assets/images/ajax-loader-facebook.gif Binary files differnew file mode 100644 index 00000000000..6350e5f45b6 --- /dev/null +++ b/app/assets/images/ajax-loader-facebook.gif diff --git a/app/assets/javascripts/loader.js b/app/assets/javascripts/loader.js new file mode 100644 index 00000000000..6fa0b525814 --- /dev/null +++ b/app/assets/javascripts/loader.js @@ -0,0 +1,11 @@ +var Loader = { + img_src: "/assets/ajax-loader.gif", + + html: + function(width) { + img = $("<img>"); + img.attr("width", width); + img.attr("src", this.img_src); + return img; + } +} diff --git a/app/assets/stylesheets/projects.css.scss b/app/assets/stylesheets/projects.css.scss index dd897ed39bb..f923deb2126 100644 --- a/app/assets/stylesheets/projects.css.scss +++ b/app/assets/stylesheets/projects.css.scss @@ -581,3 +581,9 @@ h4.middle-panel { } } } + +.dashboard-loader { + float:right; + margin-right:30px; + display:none; +} diff --git a/app/views/dashboard/_menu.html.haml b/app/views/dashboard/_menu.html.haml index 2cb45fa7e61..0d04899c37d 100644 --- a/app/views/dashboard/_menu.html.haml +++ b/app/views/dashboard/_menu.html.haml @@ -2,12 +2,20 @@ = 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" = link_to "Issues", dashboard_issues_path, :remote => true, :class => "button-small dash-button #{"active" if current_page?(dashboard_issues_path)}", :id => "issues_slide" = 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" - + %img{:src => "/assets/ajax-loader-facebook.gif", :class => "dashboard-loader"} :javascript $(function(){ $(".dash-button").live("click", function() { $(".dash-button").removeClass("active"); $(this).addClass("active"); - }) + }); + + $(".dash-button").live("ajax:before", function() { + $(".dashboard-loader").show(); + }); + + $(".dash-button").live("ajax:complete", function() { + $(".dashboard-loader").hide(); + }); }); diff --git a/app/views/refs/_tree.html.haml b/app/views/refs/_tree.html.haml index 0c44df58948..07bab2129dc 100644 --- a/app/views/refs/_tree.html.haml +++ b/app/views/refs/_tree.html.haml @@ -35,11 +35,14 @@ - contents.select{ |i| i.is_a?(Grit::Blob)}.each do |content| = render :partial => "refs/tree_item", :locals => { :content => content } - - if content = contents.select{ |c| c.is_a?(Grit::Blob) and c.name =~ /^readme\.(md|markdown)$/i }.first + - if content = contents.select{ |c| c.is_a?(Grit::Blob) and c.name =~ /^readme/i }.first #tree-readme-holder %h3= content.name .readme - = markdown(encode content.data) + - if content.name =~ /\.(md|markdown)$/i + = markdown(encode content.data) + - else + = simple_format(encode content.data) :javascript $(function(){ |