-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-es.html
229 lines (198 loc) · 7.8 KB
/
test-es.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>get-details: Test</title>
<!-- Bootstrap CSS -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.2/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container py-4">
<h1 class="display-4 mb-4">get-details</h1>
<h2 class="mb-4">Test Page - ES Module</h2>
<p><a href="./index.html">Back to Index</a></p>
<div class="card mb-4">
<div class="card-header">
<h4 class="mb-0">report test</h4>
</div>
<div class="card-body">
<div data-get-details="html-base,,,{%year - %copy %name, %last-update, %version %description ! %homepage, %author %license}" class="alert alert-secondary">Loading...</div>
<p class="mb-0">Case: custom <code>id</code> + hosted <code>data-get-details</code></p>
</div>
</div>
<div class="card mb-4">
<div class="card-header">
<h4 class="mb-0">npm</h4>
</div>
<div class="card-body">
<div data-get-details="npm" class="alert alert-secondary">Loading...</div>
<p class="mb-0">hosted <code>data-get-details</code></p>
</div>
</div>
<div class="card mb-4">
<div class="card-header">
<h4 class="mb-0">bootstrap</h4>
</div>
<div class="card-body">
<div id="ver_bootstrap" class="alert alert-secondary">Loading...</div>
<div data-get-details="bootstrap,#ver_bootstrap"></div>
<p class="mb-0">helper with <code>data-get-details</code> and custom <code>id</code></p>
</div>
</div>
<!-- PyPI Tests -->
<div class="card mb-4">
<div class="card-header">
<h4 class="mb-0">requests</h4>
</div>
<div class="card-body">
<div id="pypi_requests" class="alert alert-secondary">Loading...</div>
<div data-get-details="requests,#pypi_requests,pypi"></div>
<p class="mb-0">Case: Popular package with custom <code>id</code></p>
</div>
</div>
<div class="card mb-4">
<div class="card-header">
<h4 class="mb-0">django</h4>
</div>
<div class="card-body">
<div data-get-details="django,,pypi" class="alert alert-secondary">Loading...</div>
<p class="mb-0">Case: Direct element with source specification</p>
</div>
</div>
<div class="card mb-4">
<div class="card-header">
<h4 class="mb-0">flask</h4>
</div>
<div class="card-body">
<div class="pypi-flask alert alert-secondary">Loading...</div>
<div data-get-details="flask,.pypi-flask,pypi"></div>
<p class="mb-0">Case: Class selector target</p>
</div>
</div>
<!-- GitHub Tests -->
<div class="card mb-4">
<div class="card-header">
<h4 class="mb-0">microsoft/typescript</h4>
</div>
<div class="card-body">
<div id="github_typescript" class="alert alert-secondary">Loading...</div>
<div data-get-details="microsoft/typescript,#github_typescript,github"></div>
<p class="mb-0">Case: Repository with custom <code>id</code></p>
</div>
</div>
<div class="card mb-4">
<div class="card-header">
<h4 class="mb-0">vuejs/vue</h4>
</div>
<div class="card-body">
<div data-get-details="vuejs/vue,,github" class="alert alert-secondary">Loading...</div>
<p class="mb-0">Case: Direct element with source specification</p>
</div>
</div>
<div class="card mb-4">
<div class="card-header">
<h4 class="mb-0">facebook/react</h4>
</div>
<div class="card-body">
<div class="github-react alert alert-secondary">Loading...</div>
<div data-get-details="facebook/react,.github-react,github"></div>
<p class="mb-0">Case: Class selector target</p>
</div>
</div>
<!-- ES6 Integration Tests -->
<!-- ES6 Module Tests -->
<div class="card mb-4">
<div class="card-header bg-light">
<h4 class="mb-0">ES6 Module Tests</h4>
</div>
<div class="card-body">
<!-- NPM via ES6 -->
<div class="card mb-4">
<div class="card-header">
<h5 class="mb-0">NPM Packages</h5>
</div>
<div class="card-body">
<div class="ver_jquery alert alert-secondary">data string output test to console</div>
<p class="mb-0">jquery: ES6 direct call</p>
<div class="ver_lodash alert alert-secondary mt-3">Loading...</div>
<p class="mb-0">lodash: ES6 with class selector</p>
</div>
</div>
<!-- PyPI via ES6 -->
<div class="card mb-4">
<div class="card-header">
<h5 class="mb-0">PyPI Packages</h5>
</div>
<div class="card-body">
<div class="ver_requests alert alert-secondary">Loading...</div>
<p class="mb-0">requests: PyPI package via ES6</p>
<div class="ver_django alert alert-secondary mt-3">Loading...</div>
<p class="mb-0">django: PyPI with class selector</p>
</div>
</div>
<!-- GitHub via ES6 -->
<div class="card mb-4">
<div class="card-header">
<h5 class="mb-0">GitHub Repositories</h5>
</div>
<div class="card-body">
<div class="ver_typescript alert alert-secondary">Loading...</div>
<p class="mb-0">microsoft/typescript: GitHub repo via ES6</p>
<div class="ver_vue alert alert-secondary mt-3">Loading...</div>
<p class="mb-0">vuejs/vue: GitHub with class selector</p>
</div>
</div>
</div>
</div>
<div class="card mb-4">
<div class="card-header">
<h4 class="mb-0">Gitlab</h4>
</div>
<div class="card-body">
<div id="gitlab-version" data-get-details="gitlab-org/gitlab, #gitlab-version, gitlab, {%version - %description}"></div>
</div>
</div>
<div class="card mb-4">
<div class="card-header">
<h4 class="mb-0">Error Test</h4>
</div>
<div class="card-body">
<p class="alert alert-secondary">Browser Console Errors</p>
</div>
</div>
<footer class="footer text-center py-3 border-top">
<p class="text-muted mb-0">MIT © <span class="current-year"></span> get-details <span class="current-version"></span></p>
<p class="text-muted mb-0">MIT © <span class="current-year"></span> get-details <span class="current-version"></span></p>
</footer>
</div>
<!-- Scripts -->
<script src="./index.js" data-get-details="scss-reset"></script>
<script type="module">
/**
* ES6 and Errors Test
*/
import getDetails from './es.js';
let sDetails = await getDetails({ packageName: 'jquery', target: '.ver_jquery', str: true });
console.log(sDetails);
// NPM packages
getDetails({ packageName: 'lodash', target: '.ver_lodash' }, true);
// PyPI packages
getDetails({ packageName: 'requests', target: '.ver_requests', source: 'pypi' });
getDetails({ packageName: 'django', target: '.ver_django', source: 'pypi' });
// GitHub repositories
getDetails({ packageName: 'microsoft/typescript', target: '.ver_typescript', source: 'github' });
getDetails({ packageName: 'vuejs/vue', target: '.ver_vue', source: 'github' });
// Errors Test
getDetails({ packageName: 'get-details', target: '.fake-class' });
getDetails({ packageName: 'fake-package-nnnn122343$$$$' });
getDetails({ packageName: 'get-details', source: 'fake-source' });
/**
* Footer
*/
getDetails({ packageName: 'get-details', target: '.current-version' });
</script>
<script src="https://cdn.jsdelivr.net/npm/get-year"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.2/js/bootstrap.bundle.min.js"></script>
</body>
</html>