@nebularstreams/statify 3.0.0

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 (193) hide show
  1. package/dist/.DS_Store +0 -0
  2. package/dist/website.simple/webfonts/fa-brands-400.woff2 +0 -0
  3. package/dist/website.simple/webfonts/fa-solid-900.eot +0 -0
  4. package/dist/website.simple/webfonts/fa-solid-900.svg +4649 -0
  5. package/dist/website.simple/webfonts/fa-solid-900.ttf +0 -0
  6. package/dist/website.simple/webfonts/fa-solid-900.woff +0 -0
  7. package/dist/website.simple/webfonts/fa-solid-900.woff2 +0 -0
  8. package/dist/website.simple/website.css +32 -0
  9. package/dist/website.simple/website.min.js +6 -0
  10. package/dist/website.software/webfonts/fa-brands-400.woff2 +0 -0
  11. package/dist/website.software/webfonts/fa-solid-900.eot +0 -0
  12. package/dist/website.software/webfonts/fa-solid-900.svg +4649 -0
  13. package/dist/website.software/webfonts/fa-solid-900.ttf +0 -0
  14. package/dist/website.software/webfonts/fa-solid-900.woff +0 -0
  15. package/dist/website.software/webfonts/fa-solid-900.woff2 +0 -0
  16. package/dist/website.software/website.css +32 -0
  17. package/dist/website.software/website.min.js +6 -0
  18. package/dist/website.worlds/webfonts/fa-brands-400.woff2 +0 -0
  19. package/dist/website.worlds/webfonts/fa-solid-900.eot +0 -0
  20. package/dist/website.worlds/webfonts/fa-solid-900.svg +4649 -0
  21. package/dist/website.worlds/webfonts/fa-solid-900.ttf +0 -0
  22. package/dist/website.worlds/webfonts/fa-solid-900.woff +0 -0
  23. package/dist/website.worlds/webfonts/fa-solid-900.woff2 +0 -0
  24. package/dist/website.worlds/website.css +32 -0
  25. package/dist/website.worlds/website.min.js +6 -0
  26. package/package.json +49 -0
  27. package/readme.md +105 -0
  28. package/src/publisher-lib.js +179 -0
  29. package/src/publisher-list.js +91 -0
  30. package/src/publisher.js +38 -0
  31. package/src/util/cdn/nobj.cdn.js +88 -0
  32. package/src/util/htmlroute.js +39 -0
  33. package/src/util/markdown/lib.showdown.icon.js +62 -0
  34. package/src/util/markdown/lib.showdown.yt.js +54 -0
  35. package/src/util/markdown/markdown.js +144 -0
  36. package/src/util/navibar/util.navibar.js +63 -0
  37. package/src/util/sha.js +20 -0
  38. package/src/util/tokenizer.js +234 -0
  39. package/src/util/widgets/NoticeWidget.js +30 -0
  40. package/src/util/widgets/app.widgets.js +70 -0
  41. package/src/util/widgets/util.definewidget.js +14 -0
  42. package/src/widgets/Cookies.js +55 -0
  43. package/src/widgets/Frameset-simple.js +114 -0
  44. package/src/widgets/Frameset.js +124 -0
  45. package/src/widgets/Page.js +356 -0
  46. package/src/widgets/RightSide.js +93 -0
  47. package/src/widgets/Snippets.js +75 -0
  48. package/src/widgets/Tail.js +11 -0
  49. package/src/widgets/Widgets.js +10 -0
  50. package/src/widgets.client/Client.js +22 -0
  51. package/src/widgets.features/FeatureList.js +364 -0
  52. package/src/widgets.features/Youtube.js +23 -0
  53. package/src/widgets.features/bootcol.js +29 -0
  54. package/src/widgets.features/css/feature.css +112 -0
  55. package/src/widgets.features/css/tail.css +4 -0
  56. package/src/widgets.howto/Faq.js +201 -0
  57. package/src/widgets.howto/HowTo.js +419 -0
  58. package/src/widgets.howto/Tiles.js +51 -0
  59. package/src/widgets.howto/script-contractable.js +31 -0
  60. package/src/widgets.markdown/Document.js +84 -0
  61. package/src/widgets.market/MarketItem.js +278 -0
  62. package/src/widgets.market/MarketItem.orig.js +268 -0
  63. package/src/widgets.market/MarketItem.strips.js +276 -0
  64. package/src/widgets.market/StoryLicenseWIdget.js +45 -0
  65. package/src/widgets.market/app.utils.js +238 -0
  66. package/src.website/css/app/animations.css +27 -0
  67. package/src.website/css/app/ismobile.css +7 -0
  68. package/src.website/css/app/style.css +51 -0
  69. package/src.website/css/app/style.fullheight.css +9 -0
  70. package/src.website/css/app/style.mdblocks.css +59 -0
  71. package/src.website/css/app/style.putosafari.css +3 -0
  72. package/src.website/css/bootstrap/bootstrap-tiny-core.css +47 -0
  73. package/src.website/css/bootstrap/bootstrap-tiny-media-columns.css +1276 -0
  74. package/src.website/css/bootstrap/bootstrap-tiny-media-custom.css +59 -0
  75. package/src.website/css/bootstrap/bootstrap-tiny-media-display.css +279 -0
  76. package/src.website/css/bootstrap/bootstrap-tiny-media-flex.css +881 -0
  77. package/src.website/css/bootstrap/bootstrap-tiny-media-fonts.css +39 -0
  78. package/src.website/css/bootstrap/bootstrap-tiny-media-paddings.css +1348 -0
  79. package/src.website/css/css-core/core.ext.css +65 -0
  80. package/src.website/css/css-core/frontpage.css +28 -0
  81. package/src.website/css/css-core/root.css +34 -0
  82. package/src.website/css/css-core/root.fullheight.css +12 -0
  83. package/src.website/css/css-core/ui.dialog.round.css +14 -0
  84. package/src.website/css/css-core/ui.navibar.css +28 -0
  85. package/src.website/css/css-core/ui.notifications.css +12 -0
  86. package/src.website/css/css-featurelist/feature.css +196 -0
  87. package/src.website/css/css-featurelist/tail.css +4 -0
  88. package/src.website/css/css-screens/doc.css +22 -0
  89. package/src.website/css/css-screens/screens-meta.css +3 -0
  90. package/src.website/css/css-unsplash/unsplash.css +32 -0
  91. package/src.website/css/css-videos/youtube.css +28 -0
  92. package/src.website/css/css-wiki/wiki.css +206 -0
  93. package/src.website/css/css-wiki/wiki.sidepane.css +16 -0
  94. package/src.website/css/fontawesome/fa-brands.css +18 -0
  95. package/src.website/css/fontawesome/fa-solid.css +16 -0
  96. package/src.website/css/fontawesome/fa.css +4359 -0
  97. package/src.website/css/skin/mierda.css +15 -0
  98. package/src.website/css/skin/skin.dark.css +85 -0
  99. package/src.website/css/skin/skin.light.css +27 -0
  100. package/src.website/css/skin/vars.font.css +8 -0
  101. package/src.website/css/skin/vars.sizes.css +4 -0
  102. package/src.website/package-lock.json +2160 -0
  103. package/src.website/package.json +28 -0
  104. package/src.website/public/webfonts/fa-brands-400.woff2 +0 -0
  105. package/src.website/public/webfonts/fa-solid-900.eot +0 -0
  106. package/src.website/public/webfonts/fa-solid-900.svg +4649 -0
  107. package/src.website/public/webfonts/fa-solid-900.ttf +0 -0
  108. package/src.website/public/webfonts/fa-solid-900.woff +0 -0
  109. package/src.website/public/webfonts/fa-solid-900.woff2 +0 -0
  110. package/src.website/rollup.simple.mjs +36 -0
  111. package/src.website/rollup.software.mjs +36 -0
  112. package/src.website/rollup.terser.mjs +24 -0
  113. package/src.website/rollup.worlds.mjs +36 -0
  114. package/src.website/src/app/app.style.mjs +36 -0
  115. package/src.website/src/app/index.mjs +118 -0
  116. package/src.website/src/config.js +8 -0
  117. package/src.website/src/core/cdnmodel.mjs +7 -0
  118. package/src.website/src/core/clientruntime.mjs +41 -0
  119. package/src.website/src/core.cookies/analytics.mjs +96 -0
  120. package/src.website/src/core.cookies/cookiemanager.mjs +128 -0
  121. package/src.website/src/core.cookies/css/cookies.css +80 -0
  122. package/src.website/src/core.cookies/css/nocookies.css +48 -0
  123. package/src.website/src/core.extra/css/contractable.css +12 -0
  124. package/src.website/src/core.extra/css/faq.css +42 -0
  125. package/src.website/src/core.extra/css/howto.css +81 -0
  126. package/src.website/src/core.extra/extra.document.mjs +83 -0
  127. package/src.website/src/core.extra/extra.faq.mjs +30 -0
  128. package/src.website/src/core.extra/extra.mjs +62 -0
  129. package/src.website/src/main.simple.mjs +4 -0
  130. package/src.website/src/main.software.mjs +10 -0
  131. package/src.website/src/main.worlds.mjs +9 -0
  132. package/src.website/src/support/ismobile.mjs +4 -0
  133. package/src.website/src/support/nonce.mjs +4 -0
  134. package/src.website/src/support/persistsettings.mjs +41 -0
  135. package/src.website/src/support/qrcode.mjs +1269 -0
  136. package/src.website/src/support/timeutils.mjs +237 -0
  137. package/src.website/src/widgets/index.mjs +22 -0
  138. package/src.website/src.widgets/widgets.market/index.mjs +11 -0
  139. package/src.website/src.widgets/widgets.market/widgets/market/DiscoverWidget.mjs +401 -0
  140. package/src.website/src.widgets/widgets.market/widgets/market/EmptyNew.mjs +28 -0
  141. package/src.website/src.widgets/widgets.market/widgets/market/MarketDetail.mjs +78 -0
  142. package/src.website/src.widgets/widgets.market/widgets/market/MarketItem.mjs +349 -0
  143. package/src.website/src.widgets/widgets.market/widgets/market/MarketWidget.mjs +437 -0
  144. package/src.website/src.widgets/widgets.market/widgets/market/StoryLicenseWidget.mjs +34 -0
  145. package/src.website/src.widgets/widgets.market/widgets/market/css/market.css +394 -0
  146. package/src.website/src.widgets/widgets.market/widgets/market/css/notice.css +6 -0
  147. package/src.website/src.widgets/widgets.market/widgets/navibar/NaviBarWidget.mjs +58 -0
  148. package/src.website/src.widgets/widgets.market/widgets/navibar/css/titlebar.css +68 -0
  149. package/src.website/src.widgets/widgets.market/widgets/navibar/css/ui.navibar.css +28 -0
  150. package/src.website/src.widgets/widgets.software/index.mjs +9 -0
  151. package/src.website/src.widgets/widgets.software/widgets/BootStrapColumnWidget.mjs +17 -0
  152. package/src.website/src.widgets/widgets.software/widgets/DownloadWidget.mjs +210 -0
  153. package/src.website/src.widgets/widgets.software/widgets/LicenseWidget.js +103 -0
  154. package/src.website/src.widgets/widgets.software/widgets/css/download/download.css +110 -0
  155. package/src.website/src.widgets/widgets.software/widgets/css/license/beta.css +28 -0
  156. package/src.website/src.widgets/widgets.software/widgets/css/license/button.css +30 -0
  157. package/src.website/src.widgets/widgets.software/widgets/css/license/front.css +46 -0
  158. package/src.website/src.widgets/widgets.software/widgets/css/license/licenses.css +13 -0
  159. package/src.website/src.widgets/widgets.software/widgets/css/license/overstate.css +15 -0
  160. package/src.website/src.widgets/widgets.software/widgets/css/license/story.css +8 -0
  161. package/src.website/src.widgets/widgets.software/widgets/css/license/toolbar.css +9 -0
  162. package/src.website/src.widgets/widgets.software/widgets/support/version.mjs +88 -0
  163. package/src.website/src.widgets/widgets.worlds/index.mjs +11 -0
  164. package/src.website/src.widgets/widgets.worlds/widgets/LocalBrowser.mjs +386 -0
  165. package/src.website/src.widgets/widgets.worlds/widgets/LocalLauncher.code.mjs +247 -0
  166. package/src.website/src.widgets/widgets.worlds/widgets/LocalLauncher.mjs +239 -0
  167. package/src.website/src.widgets/widgets.worlds/widgets/css/input.css +32 -0
  168. package/src.website/src.widgets/widgets.worlds/widgets/css/localprojects.css +188 -0
  169. package/templates/documentation/assets/docs.css +7 -0
  170. package/templates/documentation/assets/images/right.webp +0 -0
  171. package/templates/documentation/images.json +12 -0
  172. package/templates/documentation/metadata.json +120 -0
  173. package/templates/documentation/pages/cookies.md +25 -0
  174. package/templates/documentation/pages/index.md +13 -0
  175. package/templates/documentation/pages/privacy.md +50 -0
  176. package/templates/documentation/pages/tos.md +49 -0
  177. package/templates/landing/assets/res/carousel/image-1.webp +0 -0
  178. package/templates/landing/assets/res/carousel/image-2.webp +0 -0
  179. package/templates/landing/assets/res/carousel/image-3.webp +0 -0
  180. package/templates/landing/assets/res/custom.css +122 -0
  181. package/templates/landing/assets/res/logos/favicon.ico +0 -0
  182. package/templates/landing/assets/res/logos/favicon.png +0 -0
  183. package/templates/landing/assets/res/logos/logo.medallion.png +0 -0
  184. package/templates/landing/assets/res/logos/logo.white.png +0 -0
  185. package/templates/landing/assets/res/proj/banda-tech-client.webp +0 -0
  186. package/templates/landing/assets/res/proj/banda-tech-server.webp +0 -0
  187. package/templates/landing/assets/res/proj/proj-common-ground.webp +0 -0
  188. package/templates/landing/assets/res/proj/proj-fieldnote.webp +0 -0
  189. package/templates/landing/assets/res/proj/proj-tribes.webp +0 -0
  190. package/templates/landing/images.json +932 -0
  191. package/templates/landing/metadata.json +115 -0
  192. package/templates/landing/pages/index.json +268 -0
  193. package/tool/cli.js +183 -0
@@ -0,0 +1,276 @@
1
+ const
2
+ m = require("mithril"),
3
+ { Button, Icon } = require("../util/widgets/app.widgets"),
4
+ defineWidget = require("../util/widgets/util.definewidget"),
5
+ { YouTube } = require("../widgets.features/Youtube"),
6
+ StoryLicenseWidget = require("./StoryLicenseWIdget"),
7
+
8
+ SCENE_STRIPS = false,
9
+ TEMPLATE_STRIPS = false;
10
+
11
+ const
12
+
13
+ Attributions = defineWidget(
14
+ ({ attrs }) => {
15
+
16
+ const
17
+ { attributions } = attrs,
18
+ sources = {};
19
+
20
+ attributions.reduce((all, item) => {
21
+ sources[item.source] = true;
22
+ return all;
23
+ });
24
+
25
+ return [
26
+ m(
27
+ ".flexcol.attribution.pad-3.pad-v.bg-accent-hi",
28
+ m("h2", "Content Attribution"),
29
+ m("div", "Template references or includes resources from " + (Object.keys(sources)
30
+ .join(", ")))
31
+ ),
32
+ m(StoryLicenseWidget, { attributions })
33
+ ];
34
+ }
35
+ ),
36
+
37
+ Strip = defineWidget(
38
+ ({ attrs }) => {
39
+ const
40
+ {
41
+ entityPath, item, scenes, max, state, label, itemType = "Scene"
42
+ } = attrs,
43
+ { id_channel, type, id } = item;
44
+
45
+ return m(
46
+ "ul.scenesel.flexrow",
47
+ {
48
+ class: max > 5 ? "wrap" : "",
49
+ "aria-label": label || "List of Items"
50
+ },
51
+ scenes.map(
52
+ ({ title, image }, index) => (
53
+ index < max
54
+ ? m(
55
+ "li.thumbnail.flexcol",
56
+ {
57
+ title: title || (itemType + " " + index),
58
+ class: state.image === image ? "current" : "",
59
+ "data-type": itemType,
60
+ "data-title": title
61
+ ? title.split("-")
62
+ .join(" ")
63
+ : (itemType + " " + index)
64
+ },
65
+ m("img", {
66
+ src: entityPath(id_channel, type, id, image),
67
+ alt: itemType + " " + title
68
+ })
69
+ )
70
+ : m(".d-none", { role: "presentation" }))
71
+ )
72
+ );
73
+ }
74
+ ),
75
+
76
+ TemplateItem = defineWidget(
77
+ ({ attrs, state }) => {
78
+
79
+ const
80
+ ICONS = {
81
+ template: "star",
82
+ accessory: "fan",
83
+ tatoo: "mask",
84
+ "3d": "cube",
85
+ facekit: "theater-masks",
86
+ room: "border-all"
87
+ },
88
+ { item, scenes, templates, maximized, featured, cdnModel } = attrs,
89
+ { channel } = cdnModel,
90
+ { entityPath, path } = channel,
91
+ { ext, id_channel, type, id, creationTime, meta } = item,
92
+ { title = id, description = "legacy story", ytref, image } = (meta || {}),
93
+ { icon = ICONS[type] } = ext,
94
+ imageEntity = image || entityPath(id_channel, type, id, state.image || "logo.jpg");
95
+
96
+ return m(
97
+ "li.templateitem.flexcol.pointer.grows.ohidden",
98
+ {
99
+ class: attrs.class,
100
+ "aria-label": title
101
+ },
102
+ m(
103
+ ".inner.flexcol.pointer.bg-window-hi.relative",
104
+ { class: attrs.innerClass },
105
+ [
106
+ ...ytref
107
+ ? [
108
+ m(YouTube, { class: "", videoItem: { ref: ytref } })
109
+ ]
110
+ : [
111
+ m(
112
+ ".image.divimage.relative.img169.coverimage",
113
+ {
114
+ class: attrs.imageClass || "asp169",
115
+ style: {
116
+ backgroundImage: "url(" + imageEntity + ")"
117
+ }
118
+ }
119
+ )
120
+ ],
121
+
122
+ m(".flexrow.pad-2.titlestrip", [
123
+ m(Icon, {
124
+ icon,
125
+ size: 2,
126
+ iconClass: "unitsize"
127
+ }),
128
+ m(".flexcol.grows.flex-place-center.ohidden", [
129
+ m(".title", title),
130
+ m("h6.diffdate", { "data-timems": creationTime }, `By ${id_channel}`)
131
+ ]),
132
+
133
+ ...featured || maximized
134
+ ? [
135
+ ...ext.scenes
136
+ ? [
137
+ m(
138
+ ".unitheight.metric.fa-object-ungroup",
139
+ {
140
+ class: scenes && attrs.maximized ? "accent" : "",
141
+ title: "Scenes contained in the template",
142
+ "data-metric": "scenes",
143
+ "data-num": String(ext.scenes.length)
144
+ }
145
+ )
146
+ ] : [],
147
+
148
+ ...state.has
149
+ ? [
150
+ m(
151
+ ".unitheight.metric.fa-object-group",
152
+ {
153
+ class: templates && attrs.maximized ? "accent" : "",
154
+ title: "Template Scenes contained in the template",
155
+ "data-metric": "templates",
156
+ "data-num": String(ext.templates.length)
157
+ }
158
+ )
159
+ ] : []
160
+ ] : [],
161
+
162
+ m(".unitsize.image.avatar.noshrink", {
163
+ style: { backgroundImage: "url(" + path(id_channel, "logo.jpg") + ")" },
164
+ title: id_channel
165
+ })
166
+ ]),
167
+
168
+ ...maximized && description
169
+ ? [
170
+ m(".descriptionstrip", description)
171
+ ] : [],
172
+ ...SCENE_STRIPS && scenes && ext.scenes && ext.scenes.length
173
+ ? [
174
+ m(Strip, { entityPath, itemType: "Scene", item, scenes: ext.scenes, max: scenes, state, label: "List of Scenes" })
175
+ ]
176
+ : [],
177
+ ...TEMPLATE_STRIPS && templates && ext.templates && ext.templates.length
178
+ ? [
179
+ m(Strip, { entityPath, itemType: "Scene Template", item, scenes: ext.templates, max: templates, state, label: "List of Templates" })
180
+ ]
181
+ : []
182
+ ]
183
+ )
184
+ );
185
+ },
186
+ ({ attrs, state }) => {
187
+ const { templates = [] } = attrs.item.ext;
188
+ Object.assign(state, {
189
+ ytref: attrs.item.ytref || null,
190
+ images: templates.map((t) => t.image),
191
+ has: templates.length,
192
+ index: 0
193
+ });
194
+
195
+ if (state.images.length === 1) {
196
+ delete state.images;
197
+ }
198
+ }
199
+ ),
200
+
201
+ TemplateInstall = defineWidget(
202
+ ({ attrs, state }) => {
203
+
204
+ const
205
+ { item, cdnModel, pageMetadata } = attrs,
206
+ { ext } = item;
207
+
208
+ return m(".flexcol.flex-lg-grows.h-100.fadein.flex-lg-row.scrolly.bg-accent-light", { role: "presentation" }, [
209
+
210
+ m(
211
+ ".flexcol.maxcontainer.ohidden.col-12.col-lg-8.col-xl-6",
212
+ { role: "presentation" },
213
+ m(TemplateItem, {
214
+ ...state.templates ? { templates: 10000 } : { scenes: 10000 },
215
+ item,
216
+ cdnModel,
217
+ class: "pad-2 w-100 max",
218
+ imageClass: "grows",
219
+ showattrib: false,
220
+ maximized: true,
221
+ onView: (what) => {
222
+ if (what === "templates" && !state.templates) {
223
+ state.templates = true;
224
+ m.redraw();
225
+ } else if (what === "scenes" && state.templates) {
226
+ state.templates = false;
227
+ m.redraw();
228
+ }
229
+ }
230
+ })
231
+ ),
232
+ m(".flexcol.pad-2.col-lg-4.col-xl-6", { role: "presentation" }, [
233
+ m(".flexcol.grows.col-12.howto", [
234
+
235
+ m(".flexrow.w-100.buttoncontainer.no-mobile", [
236
+ m(Button, {
237
+ link: ext.url,
238
+ target: "_blank",
239
+ download: ext.url.substring(ext.url.lastIndexOf("/") + 1),
240
+ icon: "download",
241
+ text: "Download Bundle",
242
+ class: "button-accent grows unitheight"
243
+ })
244
+ ]),
245
+ m("h2", "How to install Obscene Studio " + pageMetadata.title + "?"),
246
+ m("ol", { "aria-label": "How to install Downloaded Obscene Studio " + pageMetadata.title }, [
247
+ m("li.pad-2.pad-v.no-mobile", "Download the Bundle to your computer"),
248
+ m("li.pad-2.pad-v.no-desktop", "Visit this page from a computer and download the Package"),
249
+ m("li.pad-2.pad-v", "Drag and drop the file just downloaded from your Downloads folder into the running Obscene Studio Application"),
250
+ m("li.pad-2.pad-v", "The list of " + pageMetadata.title + " in Obscene Studio will show the new item. It is ready to use !")
251
+ ]),
252
+
253
+ m(
254
+ "a",
255
+ { class: "pad-2 pad-v", target: "manual", href: "/doc/manual/app-storyboard-create.html#installing-a-new-template" },
256
+ "Check out Obscene Studio Manual for further instructions"
257
+ )
258
+
259
+ ]),
260
+ ...(ext.attributions && ext.attributions.length)
261
+ ? [
262
+ m(".flexcol.grows-col-12.attrib", [
263
+ m(Attributions, { attributions: ext.attributions })
264
+ ])
265
+ ] : []
266
+ ])
267
+ ]);
268
+ }
269
+ );
270
+
271
+ const
272
+ TemplateInstallDynamic = defineWidget(
273
+ ({ attrs }) => m(TemplateInstall, { cdnModel: attrs.cdnModel, item: attrs.dynamicData.item, pageMetadata: attrs.pageMetadata })
274
+ );
275
+
276
+ module.exports = TemplateInstallDynamic;
@@ -0,0 +1,45 @@
1
+ const
2
+ m = require("mithril"),
3
+ defineWidget = require("../util/widgets/util.definewidget"),
4
+ { Icon } = require("../util/widgets/app.widgets"),
5
+ ICONS = {
6
+ image: "image",
7
+ audio: "music",
8
+ video: "film",
9
+ youtube: "film",
10
+ "3d": "cubes"
11
+ },
12
+ StoryLicenseItem = defineWidget(
13
+ ({ attrs }) => ((attrs.title && attrs.source)
14
+ ? m("li.flexrow.col-6.col-xl-4", {
15
+ ...attrs.type && { class: "type_" + attrs.type }
16
+ }, [
17
+ m(Icon, {
18
+ iconClass: "unitsizesmall round",
19
+ icon: ICONS[attrs.type || "image"]
20
+ }),
21
+ m(".flexcol.grows", [
22
+ m("h4", attrs.title),
23
+ ...attrs.author ? [m("div", "Copyright " + attrs.author)] : [],
24
+ ...attrs.source ? [m("i", "source: " + attrs.source)] : []
25
+ ])
26
+ ])
27
+ : m(".nothing.d-none"))
28
+ ),
29
+
30
+ TemplateLicenseWidget = defineWidget(
31
+ ({ attrs }) => m(
32
+ "ul.flexrow.wrap.liclist",
33
+ [
34
+ ...attrs.attributions
35
+ .map((item) => m(StoryLicenseItem, item)),
36
+ ...attrs.attributions.length
37
+ ? [
38
+ // last so can use grows
39
+ m("li.flexrow.col-6.col-xl-4", "")
40
+ ] : []
41
+ ]
42
+ )
43
+ );
44
+
45
+ module.exports = TemplateLicenseWidget;
@@ -0,0 +1,238 @@
1
+ /* eslint-disable no-nested-ternary */
2
+ /**
3
+ * Miscellaneous Time related utils
4
+ * @module app.utils
5
+ */
6
+
7
+ // noinspection NpmUsedModulesInstalled
8
+ const
9
+ m = require("mithril");
10
+
11
+ function decodeTimeInterval(datems) {
12
+ const date = new Date(datems);
13
+ let seconds = Math.floor((Date.now() - date) / 1000);
14
+ let unit = "second";
15
+ let direction = "ago";
16
+ if (seconds < 0) {
17
+ seconds = -seconds;
18
+ direction = "from now";
19
+ }
20
+ let value = seconds;
21
+ if (seconds >= 31536000) {
22
+ value = Math.floor(seconds / 31536000);
23
+ unit = "year";
24
+ } else if (seconds >= 86400) {
25
+ value = Math.floor(seconds / 86400);
26
+ unit = "day";
27
+ } else if (seconds >= 3600) {
28
+ value = Math.floor(seconds / 3600);
29
+ unit = "hour";
30
+ } else if (seconds >= 60) {
31
+ value = Math.floor(seconds / 60);
32
+ unit = "minute";
33
+ }
34
+ if (value !== 1) {
35
+ unit += "s";
36
+ }
37
+ return {
38
+ value, unit, direction, future: direction !== "ago"
39
+ };
40
+ }
41
+
42
+ /**
43
+ * Gets an english expression for a date difference
44
+ * @param {number} datems Date in ms
45
+ * @param options
46
+ * @return {string} Expression of difference from now ("5 minutes ago")
47
+ * @public
48
+ * @static
49
+ */
50
+
51
+ function getTimeInterval(datems, options = {}) {
52
+
53
+ const {
54
+ direction, value, unit, future
55
+ } = decodeTimeInterval(datems);
56
+
57
+ const lit = `${value} ${unit}`;
58
+
59
+ return options.short
60
+ ? `${value} ${unit}`
61
+ : (
62
+ options.onlyfuture
63
+ ? (
64
+ future
65
+ ? (options.prefixFuture || "in ") + lit
66
+ : options.pastMessage
67
+ )
68
+ : `${value} ${unit} ${direction}`
69
+ );
70
+ }
71
+
72
+ function splitDuration(ms, len = 3) {
73
+
74
+ let offsecs = Math.floor(ms / 1000);
75
+ if (offsecs < 60 || len < 1) return { secs: offsecs };
76
+
77
+ let mins = Math.floor(offsecs / 60);
78
+
79
+ let
80
+ days = 0,
81
+ hours = 0;
82
+
83
+ offsecs %= 60;
84
+
85
+ if (mins >= 60 && len > 1) {
86
+ hours = Math.floor(mins / 60);
87
+ if (hours >= 24 && len > 2) {
88
+ days = Math.floor(hours / 24);
89
+ hours %= 24;
90
+ }
91
+ mins %= 60;
92
+ }
93
+ return {
94
+ days,
95
+ hours,
96
+ mins,
97
+ secs: offsecs
98
+ };
99
+ }
100
+
101
+ /**
102
+ * Gets a hours, muinutes, seconds expression
103
+ * @param {number} ms Date in ms
104
+ * @param {Array=} separators Separators to use
105
+ * @public
106
+ * @static
107
+ * @return {string} The expression, like 10h15m10s
108
+ */
109
+
110
+ function getDuration(ms, separators) {
111
+
112
+ separators = separators || ["s", "m ", "h ", "d "];
113
+
114
+ const
115
+ [ss, sm, sh, sd] = separators,
116
+ len = separators.length,
117
+
118
+ {
119
+ days, hours, mins, secs
120
+ } = splitDuration(ms, len > 0 ? len - 1 : 0);
121
+
122
+ return [
123
+ ...days ? [days + sd] : [],
124
+ ...(hours || days) ? [hours + sh] : [],
125
+ ...(mins || hours || days) ? [mins + sm] : [],
126
+ (secs + ss)
127
+ ].join(" ");
128
+
129
+ }
130
+
131
+ /**
132
+ * Gets the system time string for a Date
133
+ * @param {number} ms Date in ms
134
+ * @public
135
+ * @static
136
+ * @return {string} System Locale time expression
137
+ */
138
+
139
+ function getTime(ms) {
140
+ const d = new Date(ms);
141
+ return d.toLocaleTimeString("de"); // TODO
142
+ }
143
+
144
+ function getFormattedTime(startTime, asWidget, widgetTitle, classe) {
145
+ // decide what to print in starttime cell
146
+ const measure = getTimeInterval(startTime);
147
+
148
+ // scheduled processes will print the finish time as the start time, and the start time as "expected"
149
+ return asWidget
150
+ ? m("span.padh.numsmall" + (classe || ""), { "data-title": widgetTitle }, measure)
151
+ : measure;
152
+ }
153
+
154
+ function getStartTime(process, asWidget, ProcessListData) {
155
+ // decide what to print in starttime cell
156
+ const measure = getTime(process.startTime);
157
+ let widgetTitle;
158
+
159
+ if (asWidget) {
160
+ switch (process.status) {
161
+ case ProcessListData.ST_SCHEDULED:
162
+ widgetTitle = "scheduled at";
163
+ break;
164
+ default:
165
+ widgetTitle = "started at";
166
+ }
167
+ }
168
+
169
+ // scheduled processes will print the finish time as the start time, and the start time as "expected"
170
+ return asWidget
171
+ ? m("span.padh.numsmall", { "data-title": widgetTitle }, measure)
172
+ : measure;
173
+ }
174
+
175
+ // decide what to print in finishtime cell
176
+ function getFinishTime(process, asWidget, ProcessListData) {
177
+
178
+ let measure;
179
+ let widgetTitle;
180
+
181
+ switch (process.status) {
182
+ case ProcessListData.ST_SCHEDULED:
183
+ measure = getTime(process.startTime);
184
+ widgetTitle = "scheduled at";
185
+ break;
186
+ case ProcessListData.ST_TERMINATED:
187
+ widgetTitle = "finish time";
188
+ measure = "---";
189
+ break;
190
+ default:
191
+ measure = process.status !== ProcessListData.ST_RUNNING
192
+ ? getDuration(process.finishTime - process.startTime)
193
+ : getDuration(new Date().valueOf() - process.startTime);
194
+ widgetTitle = process.status !== ProcessListData.ST_RUNNING ? "ran for" : "running for";
195
+ }
196
+ return asWidget
197
+ ? m("span.padh.numsmall", { "data-title": widgetTitle }, measure)
198
+ : measure;
199
+
200
+ }
201
+
202
+ const REGEXP = /^[A-Za-z0-9_-]+$/;
203
+
204
+ /**
205
+ * Whether a string is alphanumeric
206
+ * @param {string} str string to check
207
+ * @public
208
+ * @static
209
+ * @return {boolean} Whether
210
+ */
211
+
212
+ function isAlphanumeric(str) {
213
+ return !!(str.match(REGEXP));
214
+ }
215
+
216
+ // noinspection JSUnusedGlobalSymbols
217
+ Object.assign(exports, {
218
+ /**
219
+ * Time Utilities Library
220
+ */
221
+ TimeUtils: {
222
+ getTimeInterval,
223
+ decodeTimeInterval,
224
+ getDuration,
225
+ splitDuration,
226
+ getFormattedTime,
227
+ getFinishTime,
228
+ getStartTime,
229
+ getTime
230
+ },
231
+ /**
232
+ * String Utilities
233
+ */
234
+ StringUtils: {
235
+ isAlphanumeric
236
+ }
237
+
238
+ });
@@ -0,0 +1,27 @@
1
+ @keyframes fadein {
2
+ from {
3
+ opacity: 0;
4
+ }
5
+ to {
6
+ opacity: 1;
7
+ }
8
+ }
9
+
10
+ @keyframes fadeout {
11
+ from {
12
+ opacity: 1;
13
+ }
14
+ to {
15
+ opacity: 0;
16
+ }
17
+ }
18
+
19
+ .fadein {
20
+ animation: fadein 0.5s;
21
+ animation-fill-mode: forwards;
22
+ }
23
+
24
+ .fadeout {
25
+ animation: fadeout 0.5s;
26
+ animation-fill-mode: forwards;
27
+ }
@@ -0,0 +1,7 @@
1
+ .ismobile .no-mobile {
2
+ display: none;
3
+ }
4
+
5
+ html:not(.ismobile) .no-desktop {
6
+ display: none;
7
+ }
@@ -0,0 +1,51 @@
1
+ body {
2
+ font-family: sans-serif;
3
+ background: var(--window-background);
4
+ margin: 0;
5
+ padding: 0;
6
+ color: var(--text);
7
+ height: auto !important;
8
+ }
9
+
10
+ .bold {
11
+ font-weight: bold;
12
+ }
13
+
14
+ .rootlink {
15
+ margin-left: -0.5rem;
16
+ cursor: pointer;
17
+ }
18
+
19
+
20
+ .rootlink i {
21
+ width: 2rem;
22
+ }
23
+
24
+ .rootlink span {
25
+ padding-left: 0.5rem;
26
+ }
27
+
28
+ .rootlink button {
29
+ border: 0;
30
+ background: 0;
31
+ }
32
+
33
+ .tab-menu button {
34
+ border: 0;
35
+ background: 0;
36
+ }
37
+
38
+
39
+ button, a {
40
+ outline: none !important;
41
+ }
42
+
43
+ .ellipsis {
44
+ overflow: hidden;
45
+ text-overflow: ellipsis;
46
+ white-space: nowrap;
47
+ }
48
+
49
+ .fullheight {
50
+ height: -webkit-fill-available;
51
+ }
@@ -0,0 +1,9 @@
1
+ html {
2
+ overflow-y: auto;
3
+ overscroll-behavior: contain;
4
+ }
5
+
6
+ #main {
7
+ height: 100vh !important;
8
+ }
9
+
@@ -0,0 +1,59 @@
1
+ md-notice {
2
+ background: var(--accent-light);
3
+ border-radius: 0.25rem;
4
+ position: relative;
5
+ border: solid 1px var(--border-color);
6
+ padding: 0.75rem 0.75rem 0.75rem 2.75rem;
7
+ display: inline-block;
8
+ }
9
+
10
+ md-notice:before {
11
+ font-family: "Font Awesome 5 Free";
12
+ position: absolute;
13
+ top: 0;
14
+ left: 0;
15
+ padding: 0.6rem 0.75rem;
16
+ }
17
+
18
+ md-yt {
19
+ width: 100%;
20
+ height: auto;
21
+ padding-top: 56.25%;
22
+ position: relative;
23
+ display: block;
24
+ border-radius: 0.25rem;
25
+ overflow: hidden;
26
+ background-size: cover;
27
+ background-position: center;
28
+ color: white;
29
+ }
30
+
31
+ md-yt iframe {
32
+ border: 0;
33
+ margin: 0;
34
+ padding: 0;
35
+ position: absolute;
36
+ width: 100%;
37
+ height: 100%;
38
+ top: 0;
39
+ }
40
+
41
+ md-flex {
42
+ display: flex;
43
+ flex-wrap: wrap;
44
+ width: 100%;
45
+ border: solid 1px var(--border-color);
46
+ border-radius: 0.25rem;
47
+ padding: 0.25rem;
48
+ }
49
+
50
+ md-flex md-wrap {
51
+ flex-grow: 1;
52
+ min-width: 320px;
53
+ width: 50%;
54
+ padding: 0.25rem;
55
+ }
56
+
57
+ .tablecontainer {
58
+ overflow-x: auto !important;
59
+ }