diff options
Diffstat (limited to 'app/assets/javascripts/api.js.coffee')
-rw-r--r-- | app/assets/javascripts/api.js.coffee | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/assets/javascripts/api.js.coffee b/app/assets/javascripts/api.js.coffee index dd1bbb37551..c654f8de208 100644 --- a/app/assets/javascripts/api.js.coffee +++ b/app/assets/javascripts/api.js.coffee @@ -6,6 +6,7 @@ projects_path: "/api/:version/projects.json" labels_path: "/api/:version/projects/:id/labels" license_path: "/api/:version/licenses/:key" + gitignoretext_path: "/api/:version/gitignores/:key" group: (group_id, callback) -> url = Api.buildUrl(Api.group_path) @@ -103,6 +104,12 @@ ).done (license) -> callback(license) + gitIgnoreText: (key, callback) -> + url = Api.buildUrl(Api.gitignoretext_path).replace(':key', key) + + $.get url, (gitignore) -> + callback(gitignore) + buildUrl: (url) -> url = gon.relative_url_root + url if gon.relative_url_root? return url.replace(':version', gon.api_version) |