From ba2f00a09a866ba9627b899dec7507ff25ed13aa Mon Sep 17 00:00:00 2001 From: Mathias Meyer Date: Mon, 19 May 2014 13:15:56 +0200 Subject: [PATCH] URL-encode branch name for status images. Camelcased all entries in the status image selection menu for consistency. Fixes travis-ci/travis-ci#2265 --- assets/scripts/app/helpers/status_image_formatter.coffee | 6 +++--- assets/scripts/app/helpers/urls.coffee | 2 +- assets/scripts/app/views/status_images.coffee | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/assets/scripts/app/helpers/status_image_formatter.coffee b/assets/scripts/app/helpers/status_image_formatter.coffee index c5ff775e..348346bc 100644 --- a/assets/scripts/app/helpers/status_image_formatter.coffee +++ b/assets/scripts/app/helpers/status_image_formatter.coffee @@ -12,11 +12,11 @@ when 'Image URL' then @statusImageUrl() when 'Markdown' then @markdownStatusImage() when 'Textile' then @textileStatusImage() - when 'RDOC' then @rdocStatusImage() + when 'Rdoc' then @rdocStatusImage() when 'AsciiDoc' then @asciidocStatusImage() when 'Rst' then @rstStatusImage() - when 'POD' then @podStatusImage() - when 'cc.xml' then @ccxmlStatusUrl() + when 'Pod' then @podStatusImage() + when 'CCTray' then @ccxmlStatusUrl() urlRepo: (-> "https://#{location.host}/#{@slug}" diff --git a/assets/scripts/app/helpers/urls.coffee b/assets/scripts/app/helpers/urls.coffee index 3abf42ec..ab6f606f 100644 --- a/assets/scripts/app/helpers/urls.coffee +++ b/assets/scripts/app/helpers/urls.coffee @@ -21,7 +21,7 @@ "https://github.com/#{slug}/settings/hooks#travis_minibucket" statusImage: (slug, branch) -> - "#{location.protocol}//#{location.host}/#{slug}.svg" + if branch then "?branch=#{branch}" else '' + "#{location.protocol}//#{location.host}/#{slug}.svg" + if branch then "?branch=#{encodeURIComponent(branch)}" else '' ccXml: (slug) -> "#{Travis.config.api_endpoint}/repos/#{slug}/cc.xml" diff --git a/assets/scripts/app/views/status_images.coffee b/assets/scripts/app/views/status_images.coffee index cf574cb5..a1a89e3c 100644 --- a/assets/scripts/app/views/status_images.coffee +++ b/assets/scripts/app/views/status_images.coffee @@ -13,11 +13,11 @@ Travis.StatusImagesView = Em.View.extend 'Image URL', 'Markdown', 'Textile', - 'RDOC', + 'Rdoc', 'AsciiDoc', 'Rst', - 'POD', - 'cc.xml' + 'Pod', + 'CCTray' ] didInsertElement: ->