travis-web/assets/scripts/app/helpers/urls.coffee
Mathias Meyer ba2f00a09a URL-encode branch name for status images.
Camelcased all entries in the status image selection menu for
consistency.

Fixes travis-ci/travis-ci#2265
2014-05-19 13:15:56 +02:00

34 lines
1016 B
CoffeeScript

@Travis.Urls =
plainTextLog: (id) ->
"#{Travis.config.api_endpoint}/jobs/#{id}/log.txt?deansi=true"
githubPullRequest: (slug, pullRequestNumber) ->
"https://github.com/#{slug}/pull/#{pullRequestNumber}"
githubCommit: (slug, sha) ->
"https://github.com/#{slug}/commit/#{sha}"
githubRepo: (slug) ->
"https://github.com/#{slug}"
githubWatchers: (slug) ->
"https://github.com/#{slug}/watchers"
githubNetwork: (slug) ->
"https://github.com/#{slug}/network"
githubAdmin: (slug) ->
"https://github.com/#{slug}/settings/hooks#travis_minibucket"
statusImage: (slug, branch) ->
"#{location.protocol}//#{location.host}/#{slug}.svg" + if branch then "?branch=#{encodeURIComponent(branch)}" else ''
ccXml: (slug) ->
"#{Travis.config.api_endpoint}/repos/#{slug}/cc.xml"
email: (email) ->
"mailto:#{email}"
gravatarImage: (email, size) ->
"https://www.gravatar.com/avatar/#{md5(email)}?s=#{size}&d=#{encodeURIComponent(Travis.config.avatar_default_url)}"