File tree 3 files changed +18
-3
lines changed
3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -9,4 +9,18 @@ angular.module('gcloud.docs')
9
9
} , true ) ;
10
10
}
11
11
} ;
12
+ } )
13
+
14
+ . directive ( 'docsCodeLink' , function ( $compile ) {
15
+ 'use strict' ;
16
+
17
+ var GITHUB_BASE = 'https://github.com/GoogleCloudPlatform/gcloud-node/blob/' ;
18
+
19
+ return {
20
+ template : '<a href="' + GITHUB_BASE + '{{version}}/lib/' +
21
+ '{{module ? module + \'/\' : \'\'}}{{class}}.js' +
22
+ '{{method.lineNumLink}}">' +
23
+ '(code on GitHub)' +
24
+ '</a>'
25
+ } ;
12
26
} ) ;
Original file line number Diff line number Diff line change @@ -120,6 +120,7 @@ <h4>ACLs</h4>
120
120
ng-hide ="singleMethod && method.name !== singleMethod ">
121
121
< h2 ng-if ="method.name[0].toUpperCase() === method.name[0] ">
122
122
{{method.name}}
123
+ < span class ="view-code-link " docs-code-link > </ span >
123
124
</ h2 >
124
125
< h3
125
126
class ="method-heading "
@@ -128,6 +129,7 @@ <h2 ng-if="method.name[0].toUpperCase() === method.name[0]">
128
129
class ="permalink "
129
130
ng-href ="{{activeUrl + '?method=' + method.name}} "> #</ a >
130
131
{{method.name}}
132
+ < span class ="view-code-link " docs-code-link > </ span >
131
133
</ h3 >
132
134
< p ng-if ="method.description " ng-bind-html ="method.description "> </ p >
133
135
< h4 ng-show ="method.params "> Parameters</ h4 >
@@ -147,8 +149,6 @@ <h4 ng-show="method.returns">Returns</h4>
147
149
< h4 ng-show ="method.example "> Example</ h4 >
148
150
< div docs-example ng-repeat-end
149
151
ng-show ="method.example " ng-bind-html ="method.example "> </ div >
150
- < div class ="view-code-link "> View the code
151
- < a href ="https://github.com/GoogleCloudPlatform/gcloud-node/blob/{{version}}/lib/{{module ? module + '/' : ''}}{{class}}.js{{method.lineNumLink}} "> on GitHub</ a > .</ div >
152
152
< hr ng-if ="$index < methods.length - 1 ">
153
153
</ article >
154
154
</ article >
Original file line number Diff line number Diff line change 732
732
background : # F8F8F8 ;
733
733
}
734
734
735
- .view-code-link {
735
+ .view-code-link > a {
736
+ font-size : 80% ;
736
737
color : # 888 ;
737
738
}
738
739
You can’t perform that action at this time.
0 commit comments