diff options
| author | Julien Bouquillon | 2013-05-10 23:06:18 +0200 |
|---|---|---|
| committer | Brian Ford | 2013-07-11 14:40:06 -0700 |
| commit | 61fb5863df4afe0fad688a44ff78b245b8439db2 (patch) | |
| tree | 67b40d4347d3f394681aaa1c671758d5b7708774 /docs/src | |
| parent | a4ec297925f052bf9ea1aba9f584eaaf7472fb93 (diff) | |
| download | angular.js-61fb5863df4afe0fad688a44ff78b245b8439db2.tar.bz2 | |
feat(ngDocs): add links to source for API
- add tests
- the link points to the gruntUtil.getVersion().number tree on github
Diffstat (limited to 'docs/src')
| -rw-r--r-- | docs/src/ngdoc.js | 13 | ||||
| -rw-r--r-- | docs/src/templates/css/docs.css | 3 |
2 files changed, 13 insertions, 3 deletions
diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js index 84a165f2..d1ebb388 100644 --- a/docs/src/ngdoc.js +++ b/docs/src/ngdoc.js @@ -274,7 +274,16 @@ Doc.prototype = { dom.h(title(this.name), function() { notice('deprecated', 'Deprecated API', self.deprecated); - dom.tag('a', {href: 'http://github.com/angular/angular.js/edit/master/' + self.file, class: 'improve-docs btn btn-primary'}, 'Improve this doc'); + dom.tag('a', {href: 'http://github.com/angular/angular.js/edit/master/' + self.file, class: 'improve-docs btn btn-primary'}, function(dom) { + dom.tag('i', {class:'icon-edit'}, ' '); + dom.text(' Improve this doc'); + }); + if (self.section === 'api') { + dom.tag('a', {href: 'http://github.com/angular/angular.js/tree/v' + gruntUtil.getVersion().number + '/' + self.file + '#L' + self.line, class: 'view-source btn btn-action'}, function(dom) { + dom.tag('i', {class:'icon-zoom-in'}, ' '); + dom.text(' View source'); + }); + } if (self.ngdoc != 'overview') { dom.h('Description', self.description, dom.html); } @@ -297,7 +306,7 @@ Doc.prototype = { ////////////////////////// function notice(name, legend, msg){ - if (self[name] == undefined) return; + if (self[name] === undefined) return; dom.tag('fieldset', {'class':name}, function(dom){ dom.tag('legend', legend); dom.text(msg); diff --git a/docs/src/templates/css/docs.css b/docs/src/templates/css/docs.css index 0bb631d8..27d2bcd3 100644 --- a/docs/src/templates/css/docs.css +++ b/docs/src/templates/css/docs.css @@ -86,8 +86,9 @@ img.AngularJS-small { /* Content */ /* =============================== */ -.improve-docs { +.improve-docs, .view-source { float: right; + margin: 0 5px; } .hint { |
