URL-encode branch name for status images.

Camelcased all entries in the status image selection menu for
consistency.

Fixes travis-ci/travis-ci#2265
This commit is contained in:
Mathias Meyer 2014-05-19 13:15:56 +02:00
parent 1a0344eeed
commit ba2f00a09a
3 changed files with 7 additions and 7 deletions

View File

@ -12,11 +12,11 @@
when 'Image URL' then @statusImageUrl() when 'Image URL' then @statusImageUrl()
when 'Markdown' then @markdownStatusImage() when 'Markdown' then @markdownStatusImage()
when 'Textile' then @textileStatusImage() when 'Textile' then @textileStatusImage()
when 'RDOC' then @rdocStatusImage() when 'Rdoc' then @rdocStatusImage()
when 'AsciiDoc' then @asciidocStatusImage() when 'AsciiDoc' then @asciidocStatusImage()
when 'Rst' then @rstStatusImage() when 'Rst' then @rstStatusImage()
when 'POD' then @podStatusImage() when 'Pod' then @podStatusImage()
when 'cc.xml' then @ccxmlStatusUrl() when 'CCTray' then @ccxmlStatusUrl()
urlRepo: (-> urlRepo: (->
"https://#{location.host}/#{@slug}" "https://#{location.host}/#{@slug}"

View File

@ -21,7 +21,7 @@
"https://github.com/#{slug}/settings/hooks#travis_minibucket" "https://github.com/#{slug}/settings/hooks#travis_minibucket"
statusImage: (slug, branch) -> 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) -> ccXml: (slug) ->
"#{Travis.config.api_endpoint}/repos/#{slug}/cc.xml" "#{Travis.config.api_endpoint}/repos/#{slug}/cc.xml"

View File

@ -13,11 +13,11 @@ Travis.StatusImagesView = Em.View.extend
'Image URL', 'Image URL',
'Markdown', 'Markdown',
'Textile', 'Textile',
'RDOC', 'Rdoc',
'AsciiDoc', 'AsciiDoc',
'Rst', 'Rst',
'POD', 'Pod',
'cc.xml' 'CCTray'
] ]
didInsertElement: -> didInsertElement: ->