@wwawing/serve-index 0.0.0-exe-chousa.based-on.3.12.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/LICENSE +26 -0
  2. package/README.md +11 -0
  3. package/index.js +710 -0
  4. package/package.json +47 -0
  5. package/public/directory.html +82 -0
  6. package/public/icons/application_xp.png +0 -0
  7. package/public/icons/application_xp_terminal.png +0 -0
  8. package/public/icons/box.png +0 -0
  9. package/public/icons/cd.png +0 -0
  10. package/public/icons/controller.png +0 -0
  11. package/public/icons/drive.png +0 -0
  12. package/public/icons/film.png +0 -0
  13. package/public/icons/folder.png +0 -0
  14. package/public/icons/font.png +0 -0
  15. package/public/icons/image.png +0 -0
  16. package/public/icons/map.png +0 -0
  17. package/public/icons/page.png +0 -0
  18. package/public/icons/page_add.png +0 -0
  19. package/public/icons/page_attach.png +0 -0
  20. package/public/icons/page_code.png +0 -0
  21. package/public/icons/page_copy.png +0 -0
  22. package/public/icons/page_delete.png +0 -0
  23. package/public/icons/page_edit.png +0 -0
  24. package/public/icons/page_error.png +0 -0
  25. package/public/icons/page_excel.png +0 -0
  26. package/public/icons/page_find.png +0 -0
  27. package/public/icons/page_gear.png +0 -0
  28. package/public/icons/page_go.png +0 -0
  29. package/public/icons/page_green.png +0 -0
  30. package/public/icons/page_key.png +0 -0
  31. package/public/icons/page_lightning.png +0 -0
  32. package/public/icons/page_link.png +0 -0
  33. package/public/icons/page_paintbrush.png +0 -0
  34. package/public/icons/page_paste.png +0 -0
  35. package/public/icons/page_red.png +0 -0
  36. package/public/icons/page_refresh.png +0 -0
  37. package/public/icons/page_save.png +0 -0
  38. package/public/icons/page_white.png +0 -0
  39. package/public/icons/page_white_acrobat.png +0 -0
  40. package/public/icons/page_white_actionscript.png +0 -0
  41. package/public/icons/page_white_add.png +0 -0
  42. package/public/icons/page_white_c.png +0 -0
  43. package/public/icons/page_white_camera.png +0 -0
  44. package/public/icons/page_white_cd.png +0 -0
  45. package/public/icons/page_white_code.png +0 -0
  46. package/public/icons/page_white_code_red.png +0 -0
  47. package/public/icons/page_white_coldfusion.png +0 -0
  48. package/public/icons/page_white_compressed.png +0 -0
  49. package/public/icons/page_white_copy.png +0 -0
  50. package/public/icons/page_white_cplusplus.png +0 -0
  51. package/public/icons/page_white_csharp.png +0 -0
  52. package/public/icons/page_white_cup.png +0 -0
  53. package/public/icons/page_white_database.png +0 -0
  54. package/public/icons/page_white_delete.png +0 -0
  55. package/public/icons/page_white_dvd.png +0 -0
  56. package/public/icons/page_white_edit.png +0 -0
  57. package/public/icons/page_white_error.png +0 -0
  58. package/public/icons/page_white_excel.png +0 -0
  59. package/public/icons/page_white_find.png +0 -0
  60. package/public/icons/page_white_flash.png +0 -0
  61. package/public/icons/page_white_freehand.png +0 -0
  62. package/public/icons/page_white_gear.png +0 -0
  63. package/public/icons/page_white_get.png +0 -0
  64. package/public/icons/page_white_go.png +0 -0
  65. package/public/icons/page_white_h.png +0 -0
  66. package/public/icons/page_white_horizontal.png +0 -0
  67. package/public/icons/page_white_key.png +0 -0
  68. package/public/icons/page_white_lightning.png +0 -0
  69. package/public/icons/page_white_link.png +0 -0
  70. package/public/icons/page_white_magnify.png +0 -0
  71. package/public/icons/page_white_medal.png +0 -0
  72. package/public/icons/page_white_office.png +0 -0
  73. package/public/icons/page_white_paint.png +0 -0
  74. package/public/icons/page_white_paintbrush.png +0 -0
  75. package/public/icons/page_white_paste.png +0 -0
  76. package/public/icons/page_white_php.png +0 -0
  77. package/public/icons/page_white_picture.png +0 -0
  78. package/public/icons/page_white_powerpoint.png +0 -0
  79. package/public/icons/page_white_put.png +0 -0
  80. package/public/icons/page_white_ruby.png +0 -0
  81. package/public/icons/page_white_stack.png +0 -0
  82. package/public/icons/page_white_star.png +0 -0
  83. package/public/icons/page_white_swoosh.png +0 -0
  84. package/public/icons/page_white_text.png +0 -0
  85. package/public/icons/page_white_text_width.png +0 -0
  86. package/public/icons/page_white_tux.png +0 -0
  87. package/public/icons/page_white_vector.png +0 -0
  88. package/public/icons/page_white_visualstudio.png +0 -0
  89. package/public/icons/page_white_width.png +0 -0
  90. package/public/icons/page_white_word.png +0 -0
  91. package/public/icons/page_white_world.png +0 -0
  92. package/public/icons/page_white_wrench.png +0 -0
  93. package/public/icons/page_white_zip.png +0 -0
  94. package/public/icons/page_word.png +0 -0
  95. package/public/icons/page_world.png +0 -0
  96. package/public/style.css +257 -0
  97. package/types/LICENSE +21 -0
  98. package/types/index.d.ts +44 -0
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@wwawing/serve-index",
3
+ "description": "Serve directory listings",
4
+ "version": "0.0.0-exe-chousa.based-on.3.12.21",
5
+ "author": "Douglas Christopher Wilson <doug@somethingdoug.com>, WWA Wing Team",
6
+ "license": "MIT",
7
+ "types": "./types/index.d.ts",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/WWAWing/WWAWing.git",
11
+ "directory": "packages/serve-index"
12
+ },
13
+ "files": [
14
+ "public/",
15
+ "types/",
16
+ "LICENSE",
17
+ "index.js"
18
+ ],
19
+ "scripts": {
20
+ "lint": "eslint .",
21
+ "test": "jest"
22
+ },
23
+ "dependencies": {
24
+ "accepts": "~1.3.7",
25
+ "batch": "0.6.1",
26
+ "css.escape": "^1.5.1",
27
+ "debug": "2.6.9",
28
+ "escape-html": "~1.0.3",
29
+ "http-errors": "~1.8.0",
30
+ "mime-types": "~2.1.29",
31
+ "parseurl": "~1.3.3"
32
+ },
33
+ "devDependencies": {
34
+ "after": "0.8.2",
35
+ "eslint": "9.17.0",
36
+ "eslint-plugin-markdown": "5.1.0",
37
+ "supertest": "7.0.0"
38
+ },
39
+ "publishConfig": {
40
+ "access": "public"
41
+ },
42
+ "engines": {
43
+ "node": ">=22",
44
+ "npm": ">=11"
45
+ },
46
+ "gitHead": "b52982378576ed3ef7223fae8457a7923eba7ace"
47
+ }
@@ -0,0 +1,82 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset='utf-8'>
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
6
+ <title>listing directory {directory}</title>
7
+ <style>{style}</style>
8
+ <script>
9
+ function $(id){
10
+ var el = 'string' == typeof id
11
+ ? document.getElementById(id)
12
+ : id;
13
+
14
+ el.on = function(event, fn){
15
+ if ('content loaded' == event) {
16
+ event = window.attachEvent ? "load" : "DOMContentLoaded";
17
+ }
18
+ el.addEventListener
19
+ ? el.addEventListener(event, fn, false)
20
+ : el.attachEvent("on" + event, fn);
21
+ };
22
+
23
+ el.all = function(selector){
24
+ return $(el.querySelectorAll(selector));
25
+ };
26
+
27
+ el.each = function(fn){
28
+ for (var i = 0, len = el.length; i < len; ++i) {
29
+ fn($(el[i]), i);
30
+ }
31
+ };
32
+
33
+ el.getClasses = function(){
34
+ return this.getAttribute('class').split(/\s+/);
35
+ };
36
+
37
+ el.addClass = function(name){
38
+ var classes = this.getAttribute('class');
39
+ el.setAttribute('class', classes
40
+ ? classes + ' ' + name
41
+ : name);
42
+ };
43
+
44
+ el.removeClass = function(name){
45
+ var classes = this.getClasses().filter(function(curr){
46
+ return curr != name;
47
+ });
48
+ this.setAttribute('class', classes.join(' '));
49
+ };
50
+
51
+ return el;
52
+ }
53
+
54
+ function search() {
55
+ var str = $('search').value.toLowerCase();
56
+ var links = $('files').all('a');
57
+
58
+ links.each(function(link){
59
+ var text = link.textContent.toLowerCase();
60
+
61
+ if ('..' == text) return;
62
+ if (str.length && ~text.indexOf(str)) {
63
+ link.addClass('highlight');
64
+ } else {
65
+ link.removeClass('highlight');
66
+ }
67
+ });
68
+ }
69
+
70
+ $(window).on('content loaded', function(){
71
+ $('search').on('keyup', search);
72
+ });
73
+ </script>
74
+ </head>
75
+ <body class="directory">
76
+ <input id="search" type="text" placeholder="Search" autocomplete="off" />
77
+ <div id="wrapper">
78
+ <h1><a href="/">~</a>{linked-path}</h1>
79
+ {files}
80
+ </div>
81
+ </body>
82
+ </html>
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,257 @@
1
+ * {
2
+ margin: 0;
3
+ padding: 0;
4
+ outline: 0;
5
+ }
6
+
7
+ body {
8
+ padding: 80px 100px;
9
+ font: 13px "Helvetica Neue", "Lucida Grande", "Arial";
10
+ background: #ECE9E9 -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to(#ECE9E9));
11
+ background: #ECE9E9 -moz-linear-gradient(top, #fff, #ECE9E9);
12
+ background-repeat: no-repeat;
13
+ color: #555;
14
+ -webkit-font-smoothing: antialiased;
15
+ }
16
+ h1, h2, h3 {
17
+ font-size: 22px;
18
+ color: #343434;
19
+ }
20
+ h1 em, h2 em {
21
+ padding: 0 5px;
22
+ font-weight: normal;
23
+ }
24
+ h1 {
25
+ font-size: 60px;
26
+ }
27
+ h2 {
28
+ margin-top: 10px;
29
+ }
30
+ h3 {
31
+ margin: 5px 0 10px 0;
32
+ padding-bottom: 5px;
33
+ border-bottom: 1px solid #eee;
34
+ font-size: 18px;
35
+ }
36
+ ul li {
37
+ list-style: none;
38
+ }
39
+ ul li:hover {
40
+ cursor: pointer;
41
+ color: #2e2e2e;
42
+ }
43
+ ul li .path {
44
+ padding-left: 5px;
45
+ font-weight: bold;
46
+ }
47
+ ul li .line {
48
+ padding-right: 5px;
49
+ font-style: italic;
50
+ }
51
+ ul li:first-child .path {
52
+ padding-left: 0;
53
+ }
54
+ p {
55
+ line-height: 1.5;
56
+ }
57
+ a {
58
+ color: #555;
59
+ text-decoration: none;
60
+ }
61
+ a:hover {
62
+ color: #303030;
63
+ }
64
+ #stacktrace {
65
+ margin-top: 15px;
66
+ }
67
+ .directory h1 {
68
+ margin-bottom: 15px;
69
+ font-size: 18px;
70
+ }
71
+ ul#files {
72
+ width: 100%;
73
+ height: 100%;
74
+ overflow: hidden;
75
+ }
76
+ ul#files li {
77
+ float: left;
78
+ width: 30%;
79
+ line-height: 25px;
80
+ margin: 1px;
81
+ }
82
+ ul#files li a {
83
+ display: block;
84
+ height: 25px;
85
+ border: 1px solid transparent;
86
+ -webkit-border-radius: 5px;
87
+ -moz-border-radius: 5px;
88
+ border-radius: 5px;
89
+ overflow: hidden;
90
+ white-space: nowrap;
91
+ }
92
+ ul#files li a:focus,
93
+ ul#files li a:hover {
94
+ background: rgba(255,255,255,0.65);
95
+ border: 1px solid #ececec;
96
+ }
97
+ ul#files li a.highlight {
98
+ -webkit-transition: background .4s ease-in-out;
99
+ background: #ffff4f;
100
+ border-color: #E9DC51;
101
+ }
102
+ #search {
103
+ display: block;
104
+ position: fixed;
105
+ top: 20px;
106
+ right: 20px;
107
+ width: 90px;
108
+ -webkit-transition: width ease 0.2s, opacity ease 0.4s;
109
+ -moz-transition: width ease 0.2s, opacity ease 0.4s;
110
+ -webkit-border-radius: 32px;
111
+ -moz-border-radius: 32px;
112
+ -webkit-box-shadow: inset 0px 0px 3px rgba(0, 0, 0, 0.25), inset 0px 1px 3px rgba(0, 0, 0, 0.7), 0px 1px 0px rgba(255, 255, 255, 0.03);
113
+ -moz-box-shadow: inset 0px 0px 3px rgba(0, 0, 0, 0.25), inset 0px 1px 3px rgba(0, 0, 0, 0.7), 0px 1px 0px rgba(255, 255, 255, 0.03);
114
+ -webkit-font-smoothing: antialiased;
115
+ text-align: left;
116
+ font: 13px "Helvetica Neue", Arial, sans-serif;
117
+ padding: 4px 10px;
118
+ border: none;
119
+ background: transparent;
120
+ margin-bottom: 0;
121
+ outline: none;
122
+ opacity: 0.7;
123
+ color: #888;
124
+ }
125
+ #search:focus {
126
+ width: 120px;
127
+ opacity: 1.0;
128
+ }
129
+
130
+ /*views*/
131
+ #files span {
132
+ display: inline-block;
133
+ overflow: hidden;
134
+ text-overflow: ellipsis;
135
+ text-indent: 10px;
136
+ }
137
+ #files .name {
138
+ background-repeat: no-repeat;
139
+ }
140
+ #files .icon .name {
141
+ text-indent: 28px;
142
+ }
143
+
144
+ /*tiles*/
145
+ .view-tiles .name {
146
+ width: 100%;
147
+ background-position: 8px 5px;
148
+ }
149
+ .view-tiles .size,
150
+ .view-tiles .date {
151
+ display: none;
152
+ }
153
+
154
+ /*details*/
155
+ ul#files.view-details li {
156
+ float: none;
157
+ display: block;
158
+ width: 90%;
159
+ }
160
+ ul#files.view-details li.header {
161
+ height: 25px;
162
+ background: #000;
163
+ color: #fff;
164
+ font-weight: bold;
165
+ }
166
+ .view-details .header {
167
+ border-radius: 5px;
168
+ }
169
+ .view-details .name {
170
+ width: 60%;
171
+ background-position: 8px 5px;
172
+ }
173
+ .view-details .size {
174
+ width: 10%;
175
+ }
176
+ .view-details .date {
177
+ width: 30%;
178
+ }
179
+ .view-details .size,
180
+ .view-details .date {
181
+ text-align: right;
182
+ direction: rtl;
183
+ }
184
+
185
+ /*mobile*/
186
+ @media (max-width: 768px) {
187
+ body {
188
+ font-size: 13px;
189
+ line-height: 16px;
190
+ padding: 0;
191
+ }
192
+ #search {
193
+ position: static;
194
+ width: 100%;
195
+ font-size: 2em;
196
+ line-height: 1.8em;
197
+ text-indent: 10px;
198
+ border: 0;
199
+ border-radius: 0;
200
+ padding: 10px 0;
201
+ margin: 0;
202
+ }
203
+ #search:focus {
204
+ width: 100%;
205
+ border: 0;
206
+ opacity: 1;
207
+ }
208
+ .directory h1 {
209
+ font-size: 2em;
210
+ line-height: 1.5em;
211
+ color: #fff;
212
+ background: #000;
213
+ padding: 15px 10px;
214
+ margin: 0;
215
+ }
216
+ ul#files {
217
+ border-top: 1px solid #cacaca;
218
+ }
219
+ ul#files li {
220
+ float: none;
221
+ width: auto !important;
222
+ display: block;
223
+ border-bottom: 1px solid #cacaca;
224
+ font-size: 2em;
225
+ line-height: 1.2em;
226
+ text-indent: 0;
227
+ margin: 0;
228
+ }
229
+ ul#files li:nth-child(odd) {
230
+ background: #e0e0e0;
231
+ }
232
+ ul#files li a {
233
+ height: auto;
234
+ border: 0;
235
+ border-radius: 0;
236
+ padding: 15px 10px;
237
+ }
238
+ ul#files li a:focus,
239
+ ul#files li a:hover {
240
+ border: 0;
241
+ }
242
+ #files .header,
243
+ #files .size,
244
+ #files .date {
245
+ display: none !important;
246
+ }
247
+ #files .name {
248
+ float: none;
249
+ display: inline-block;
250
+ width: 100%;
251
+ text-indent: 0;
252
+ background-position: 0 50%;
253
+ }
254
+ #files .icon .name {
255
+ text-indent: 41px;
256
+ }
257
+ }
package/types/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Microsoft Corporation.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE