mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-10 07:44:43 +00:00
parent
40e34a924b
commit
f4fcaa8757
1 changed files with 14 additions and 2 deletions
|
|
@ -547,10 +547,22 @@ Doc.prototype = {
|
||||||
self = this,
|
self = this,
|
||||||
minerrMsg;
|
minerrMsg;
|
||||||
|
|
||||||
|
var gitTagFromFullVersion = function(version) {
|
||||||
|
var match = version.match(/-(\w{7})/);
|
||||||
|
|
||||||
|
if (match) {
|
||||||
|
// git sha
|
||||||
|
return match[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
// git tag
|
||||||
|
return 'v' + version;
|
||||||
|
};
|
||||||
|
|
||||||
if (this.section === 'api') {
|
if (this.section === 'api') {
|
||||||
dom.tag('a', {
|
dom.tag('a', {
|
||||||
href: 'http://github.com/angular/angular.js/tree/v' +
|
href: 'http://github.com/angular/angular.js/tree/' +
|
||||||
gruntUtil.getVersion().cdn + '/' + self.file + '#L' + self.line,
|
gitTagFromFullVersion(gruntUtil.getVersion().full) + '/' + self.file + '#L' + self.line,
|
||||||
class: 'view-source btn btn-action' }, function(dom) {
|
class: 'view-source btn btn-action' }, function(dom) {
|
||||||
dom.tag('i', {class:'icon-zoom-in'}, ' ');
|
dom.tag('i', {class:'icon-zoom-in'}, ' ');
|
||||||
dom.text(' View source');
|
dom.text(' View source');
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue