forked from patternfly/angular-patternfly
-
Notifications
You must be signed in to change notification settings - Fork 1
/
grunt-ngdocs-index.tmpl
264 lines (233 loc) · 11.9 KB
/
grunt-ngdocs-index.tmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" <% if(!deferLoad) { %>ng-app="docsApp" <% } %> lang="en" ng-controller="DocsController"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" <% if(!deferLoad) { %>ng-app="docsApp" <% } %> lang="en" ng-controller="DocsController"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" <% if(!deferLoad) { %>ng-app="docsApp" <% } %> lang="en" ng-controller="DocsController"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" <% if(!deferLoad) { %>ng-app="docsApp" <% } %> lang="en" ng-controller="DocsController"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="Description"
content="AngularJS is what HTML would have been, had it been designed for building web-apps.
Declarative templates with data-binding, MVC, dependency injection and great
testability story all implemented with pure client-side JavaScript!">
<meta name="fragment" content="!">
<title ng-bind-template="<%= title || 'Doc' %>: {{partialTitle}}">Docs</title>
<script type="text/javascript">
// dynamically add base tag as well as css and javascript files.
// we can't add css/js the usual way, because some browsers (FF) eagerly prefetch resources
// before the base attribute is added, causing 404 and terribly slow loading of the docs app.
(function() {
var indexFile = (location.pathname.match(/\/(index[^\.]*\.html)/) || ['', ''])[1],
origin, baseUrl, rUrl = /(\/?#!\/.*|\/(<%= sections %>)\/?(\?.*)*|\/index[^\.]*\.html.*)$/,
headEl = document.getElementsByTagName('head')[0],
sync = true;
if (location.href.slice(0, 7) == 'file://') {
baseUrl = location.href.replace(rUrl, '/' + indexFile);
} else {
origin = location.origin || (window.location.protocol + "//" + window.location.hostname +
(window.location.port ? ':' + window.location.port: ''));
baseUrl = origin + location.href.substr(origin.length).replace(rUrl, '/' + indexFile);
}
addTag('base', {href: baseUrl});
// Comment out the use of prettify.css as it changes some sizing which disrupts patternfly styling
// addTag('link', {rel: 'stylesheet', href: 'css/prettify.css', type: 'text/css'});
// Comment out the use of grunt-ngdoc's docs.css as it disrupts patternfly styling
// customized version in misc/pf-docs.css
// addTag('link', {rel: 'stylesheet', href: 'css/docs.css', type: 'text/css'});
addTag('link', {rel: 'stylesheet', href: 'css/animations.css', type: 'text/css'});
<% _.forEach(styles, function(url) { %>
addTag('link', {rel: 'stylesheet', href: '<%= url %>', type: 'text/css'}, sync);
<% }); %>
addTag('script', {src: 'js/google-code-prettify.js'}, sync);
addTag('script', {src: 'js/marked.js'}, sync);
<% _.forEach(scripts, function(url) { %>
addTag('script', {src: '<%= url %>'}, sync);
<% }); %>
<% if(!deferLoad) { %>
addTag('script', {src: 'js/angular-bootstrap.js'}, sync);
addTag('script', {src: 'js/docs-setup.js'}, sync);
addTag('script', {src: 'js/docs.js'}, sync);
<% } %>
function addTag(name, attributes, sync) {
var el = document.createElement(name),
attrName;
for (attrName in attributes) {
el.setAttribute(attrName, attributes[attrName]);
}
sync ? document.write(outerHTML(el)) : headEl.appendChild(el);
}
function outerHTML(node){
// if IE, Chrome take the internal method otherwise build one
return node.outerHTML || (
function(n){
var div = document.createElement('div'), h;
div.appendChild(n);
h = div.innerHTML;
div = null;
return h;
})(node);
}
})();
<% if (analytics) { %>
// GA asynchronous tracker
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '<%= analytics.account %>', 'auto');
ga('send', 'pageview');
<% } %>
</script>
</head>
<body>
<header class="header">
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid navbar-inverse">
<% if (image) { %>
<% if (imageLink) { %>
<a href="<%= imageLink %>">
<% } %>
<img class="pull-left" src="<%= image %>">
<% if (imageLink) { %>
</a>
<% } %>
<% } %>
<% if (title) {%>
<% if (imageLink) { %>
<img class="pull-left" src="<%= imageLink %>">
<% } %>
<a <% if (titleLink) { %> href="<%= titleLink %>" <% } %> class="navbar-brand"><%= title %></a>
<% } %>
<%= navContent %>
</div>
</div>
</div>
</header>
<div role="main" class="container-fluid">
<div class="row clear-navbar"></div>
<div class="row">
<div class="col-md-12">
<!--[if lt IE 7]>
<p class="alert alert-error">Your browser is <em>ancient!</em>
<a href="http://browsehappy.com/">Upgrade to a different browser</a> or
<a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to
experience this site.
</p>
<![endif]-->
<!--[if lt IE 9]>
<div class="alert">
You are using an old version of Internet Explorer.
For better and safer browsing experience please <a href="http://www.microsoft.com/IE9">upgrade IE</a>
or install <a href="http://google.com/chrome">Google Chrome browser</a>.
</div>
<![endif]-->
</div>
</div>
<div class="row">
<div class="col-md-3">
<form class="form-search" ng-submit="submitForm()">
<% if (bestMatch) { %>
<div class="dropdown search docs-search"
ng-class="{open: focused && bestMatch.rank > 0 && bestMatch.page != currentPage}">
<span class="fa fa-search search-icon"></span>
<input type="text" ng-model="search" placeholder="search the docs"
tabindex="1" accesskey="s" class="search-query" focused="focused">
<ul class="dropdown-menu">
<li>
<a href="{{bestMatch.page.url}}">{{bestMatch.page.shortName}}</a>
</li>
</ul>
</div>
<% } else { %>
<div class="docs-search">
<span class="fa fa-search search-icon"></span>
<input type="text" ng-model="search" placeholder="search the docs"
tabindex="1" accesskey="s" class="search-query">
</div>
<% } %>
<div class="spacer"></div>
<ul class="nav nav-list well" ng-show="pages.length">
<li ng-repeat="page in pages track by page.url" ng-class="navClass(page)" class="api-list-item expand">
<a href="{{page.url}}" tabindex="2">{{page.shortName}}</a>
</li>
</ul>
<ul class="nav nav-list well" ng-repeat="module in modules track by module.url" class="api-list-item">
<li class="nav-header module">
<a class="guide">module</a>
<a class="code" href="{{module.url}}" title="{{module.name}}">{{module.name}}</a>
</li>
<li ng-repeat="page in module.others track by page.url" ng-class="navClass(page)" class="api-list-item expand">
<a href="{{page.url}}" tabindex="2">{{page.shortName}}</a>
</li>
<li class="nav-header section" ng-show="module.directives.length">
<a class="guide">directive</a>
</li>
<li ng-repeat="page in module.directives track by page.url" ng-class="navClass(page)" class="api-list-item expand">
<a href="{{page.url}}" tabindex="2">{{page.shortName}}</a>
</li>
<li class="nav-header section" ng-show="module.controllers.length">
<a class="guide">controller</a>
</li>
<li ng-repeat="page in module.controllers track by page.url" ng-class="navClass(page)" class="api-list-item expand">
<a href="{{page.url}}" tabindex="2">{{page.shortName}}</a>
</li>
<li class="nav-header section" ng-show="module.filters.length">
<a class="guide">filter</a>
</li>
<li ng-repeat="page in module.filters track by page.url" ng-class="navClass(page)" class="api-list-item expand">
<a href="{{page.url}}" tabindex="2">{{page.shortName}}</a>
</li>
<li class="nav-header section" ng-show="module.services.length">
<a class="guide">service</a>
</li>
<li ng-repeat="service in module.services track by (service.instance.url || service.provider.url)" ng-class="navClass(service.instance, service.provider)" class="api-list-item expand">
<a ng-show="service.provider" class="pull-right" href="{{service.provider.url}}" tabindex="2"><i class="icon-cog"></i></a>
<a href="{{service.instance ? service.instance.url : service.provider.url}}" tabindex="2">{{service.name}}</a>
</li>
<li class="nav-header section" ng-show="module.types.length">
<a class="guide">Types</a>
</li>
<li ng-repeat="page in module.types track by page.url" ng-class="navClass(page)" class="api-list-item expand">
<a href="{{page.url}}" tabindex="2">{{page.shortName}}</a>
</li>
<li class="nav-header section" ng-show="module.globals.length">
<a class="global guide">global APIs</a>
</li>
<li ng-repeat="page in module.globals track by page.url" ng-class="navClass(page)" class="api-list-item expand">
<a href="{{page.url}}" tabindex="2">{{page.id}}</a>
</li>
</ul>
</form>
</div>
<div class="col-md-9">
<ol class="breadcrumb">
<li ng-repeat="crumb in breadcrumb" ng-class="{'active': !crumb.url}">
<span ng-hide="crumb.url">{{crumb.name}}</span>
<a ng-show="crumb.url" href="{{crumb.url}}">{{crumb.name}}</a>
</li>
</ol>
<div id="loading" ng-show="loading">Loading...</div>
<div class="home" ng-show="breadcrumb[breadcrumb.length-1].name === 'API Documentation'">
<h1>Welcome to Angular PatternFly!<h1>
<img src="img/patternfly-orb.svg" alt="PatternFly logo" />
<h3>Angular PatternFly contains custom AngularJS directives which utilize the PatternFly Refererence Implementation.<br/>PatternFly is a community of designers and developers collaborating to build a UI framework for enterprise web applications.</h3>
<ul>
<li><a href="https://www.patternfly.org/">More About PatternFly</a></li>
<li><a href="https://github.com/patternfly/angular-patternfly/issues/">Report an issue on Github</a></li>
<li><a href="https://patternfly.atlassian.net/secure/RapidBoard.jspa?rapidView=4&projectKey=PTNFLY&view=planning.nodetail">View the Implementation Roadmap</a></li>
</ul>
</div>
<div ng-hide="loading" ng-include src="currentPage.partialUrl" onload="afterPartialLoaded()" autoscroll class="content slide-reveal"></div>
<% if (discussions) { %>
<div id="disqus" class="disqus">
<h2>Discussion</h2>
<div id="disqus_thread" class="content-panel-content"></div>
</div>
<% } %>
</div>
</div>
</div>
</body>
</html>