-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathindex.html
147 lines (131 loc) · 6.5 KB
/
index.html
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
<!doctype html>
<html ng-app="myApp">
<head>
<meta charset="utf-8">
<!-- TODO: dynamic title -->
<title>Material Swagger UI Demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<!-- styles CDN -->
<link rel="stylesheet" href="//fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic">
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/angular_material/1.0.5/angular-material.min.css">
<!-- inject:css -->
<link rel="stylesheet" href="../bower_components/github-markdown-css/github-markdown.css">
<link rel="stylesheet" href="./styles/swagger-ui-material.css">
<link rel="stylesheet" href="./directives/toolbar-search/toolbar-search.css">
<link rel="stylesheet" href="./directives/toolbar-edit/toolbar-edit.css">
<!-- endinject -->
<style>
.ng-cloak {
display: none;
}
</style>
</head>
<body ng-controller="DetailController as vm" layout="row" class="ng-cloak sw-ui-md"
ng-include="'views/app.layout.html'">
<!-- scripts CDN -->
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular-animate.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular-aria.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular-messages.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angular_material/1.0.5/angular-material.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular-sanitize.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/showdown/1.3.0/showdown.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/js-yaml/3.5.3/js-yaml.min.js"></script>
<!-- inject:js -->
<script src="sw.ui/sw.ui.module.js"></script>
<script src="sw.ui/client.js"></script>
<script src="sw.ui/data.js"></script>
<script src="sw.ui/format.js"></script>
<script src="sw.ui/model.js"></script>
<script src="sw.ui.md/sw.ui.md.module.js"></script>
<script src="sw.ui.md/http-data.js"></script>
<script src="sw.ui.md/dialog.js"></script>
<script src="sw.ui.md/theme.js"></script>
<script src="sw.ui.md/style.js"></script>
<script src="sw.ui.md/display.js"></script>
<script src="sw.ui.md/utils.js"></script>
<script src="sw.ui.md/syntax.js"></script>
<script src="sw.ui.md/security.js"></script>
<script src="sw.ui.md/tools.js"></script>
<script src="plugins/plugins.js"></script>
<script src="plugins/after-explorer/xml-formatter.js"></script>
<!--<script src="plugins/before-explorer/auth.sample.js"></script>-->
<script src="plugins/before-display/sort.js"></script>
<script src="plugins/before-display/markdown.js"></script>
<script src="plugins/before-load/yaml.js"></script>
<script src="plugins/before-parse/base.js"></script>
<script src="plugins/before-parse/split.js"></script>
<script src="plugins/before-explorer/transform.js"></script>
<script src="plugins/before-display/operations.js"></script>
<script src="plugins/before-parse/external-references.js"></script>
<script src="plugins/before-parse/swagger-1-to-2.js"></script>
<script src="plugins/parse/parser.core.js "></script>
<script src="./directives/directives.module.js"></script>
<!--<script src="./directives/file-input/file-input.js"></script>-->
<script src="./directives/toolbar-search/toolbar-search.js"></script>
<script src="./directives/toolbar-edit/toolbar-edit.js"></script>
<script src="./directives/truncate/truncate.js"></script>
<script src="modules/toolbar/toolbar.ctrl.js"></script>
<script src="modules/meta/meta.ctrl.js"></script>
<script src="modules/description/description.ctrl.js"></script>
<script src="modules/content/content.ctrl.js"></script>
<script src="modules/detail/detail.ctrl.js"></script>
<!-- endinject -->
<script type="text/javascript">
angular.module('myApp', [
'sw.ui.md',
// 'sw.plugin.auth',
'sw.plugin.markdown',
// 'sw.plugin.xmlFormater',
'sw.plugin.operations',
'sw.plugin.sort',
'sw.plugin.parser',
'sw.plugin.base',
'sw.plugin.split',
'sw.plugin.transform',
'sw.plugin.yaml'
// 'sw.plugin.externalReferences'
])
.config(function ($mdThemingProvider, $logProvider, $windowProvider) {
var $window = $windowProvider.$get();
var search = {};
var query = $window.location.search.substring(1);
var vars = query.split('&');
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split('=');
search[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);
}
$mdThemingProvider.definePalette('accent', $mdThemingProvider.extendPalette(search.accent || 'grey', {
// tweaking md-button.md-accent.md-focused background-color
'700': 'dadada'
}));
//noinspection JSUnresolvedFunction
$mdThemingProvider
.theme('default')
.primaryPalette(search.primary || 'teal')
.accentPalette('accent')
.warnPalette(search.warn || 'amber')
.foregroundPalette[3] = 'rgba(0, 0, 0, 0.4)';
if ($window.location.hostname !== 'localhost') {
$logProvider.debugEnabled(false);
}
})
.run(function ($location, $mdToast, $log, $window, data) {
//noinspection JSCheckFunctionSignatures
var swaggerUrl = $location.search()['url'] ||
(/^\/explorer/.test($window.location.pathname) ? './swagger.json' :
'http://petstore.swagger.io/v2/swagger.json');
data.setUrl(swaggerUrl);
// data.validatorUrl = 'http://online.swagger.io/validator';
// error management
function myErrorHandler (error) {
var e = error || {};
var m = 'Something is wrong';
$mdToast.show($mdToast.simple().textContent(e.statusText || e.message || m));
$log.error(error || m);
}
});
</script>
</body>
</html>