mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-28 07:23:59 +00:00
revert: feat(ngDocs): add links to source for API
This reverts commit 61fb5863df.
This commit is contained in:
parent
3b898664ee
commit
2c0753225a
3 changed files with 3 additions and 42 deletions
|
|
@ -1,29 +0,0 @@
|
||||||
var ngdoc = require('../src/ngdoc.js');
|
|
||||||
var gruntUtil = require('../../lib/grunt/utils.js');
|
|
||||||
|
|
||||||
describe('Docs Links', function() {
|
|
||||||
|
|
||||||
describe('links', function() {
|
|
||||||
var doc;
|
|
||||||
|
|
||||||
beforeEach(function() {
|
|
||||||
doc = new ngdoc.Doc("@ngdoc function\n@name ng.filter:a\n@function");
|
|
||||||
doc.section = 'api';
|
|
||||||
doc.file = 'test.js';
|
|
||||||
doc.line = 42;
|
|
||||||
doc.parse();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have an "improve this doc" button', function() {
|
|
||||||
expect(doc.html()).
|
|
||||||
toContain('<a href="http://github.com/angular/angular.js/edit/master/test.js" class="improve-docs btn btn-primary"><i class="icon-edit"> </i> Improve this doc</a>');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have an "view source" button', function() {
|
|
||||||
expect(doc.html()).
|
|
||||||
toContain('<a href="http://github.com/angular/angular.js/tree/v' + gruntUtil.getVersion().number + '/test.js#L42" class="view-source btn btn-action"><i class="icon-zoom-in"> </i> View source</a>');
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
@ -274,16 +274,7 @@ Doc.prototype = {
|
||||||
dom.h(title(this.name), function() {
|
dom.h(title(this.name), function() {
|
||||||
|
|
||||||
notice('deprecated', 'Deprecated API', self.deprecated);
|
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'}, function(dom) {
|
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('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') {
|
if (self.ngdoc != 'overview') {
|
||||||
dom.h('Description', self.description, dom.html);
|
dom.h('Description', self.description, dom.html);
|
||||||
}
|
}
|
||||||
|
|
@ -306,7 +297,7 @@ Doc.prototype = {
|
||||||
//////////////////////////
|
//////////////////////////
|
||||||
|
|
||||||
function notice(name, legend, msg){
|
function notice(name, legend, msg){
|
||||||
if (self[name] === undefined) return;
|
if (self[name] == undefined) return;
|
||||||
dom.tag('fieldset', {'class':name}, function(dom){
|
dom.tag('fieldset', {'class':name}, function(dom){
|
||||||
dom.tag('legend', legend);
|
dom.tag('legend', legend);
|
||||||
dom.text(msg);
|
dom.text(msg);
|
||||||
|
|
|
||||||
|
|
@ -86,9 +86,8 @@ img.AngularJS-small {
|
||||||
/* Content */
|
/* Content */
|
||||||
/* =============================== */
|
/* =============================== */
|
||||||
|
|
||||||
.improve-docs, .view-source {
|
.improve-docs {
|
||||||
float: right;
|
float: right;
|
||||||
margin: 0 5px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.hint {
|
.hint {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue