generator-white-label 3.2.0 → 5.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.
- package/README.md +140 -81
- package/app/README.md +19 -0
- package/app/assets/font/opensans/stylesheet.css +20 -60
- package/app/assets/image/demo/fallback.avif +0 -0
- package/app/assets/image/demo/fallback.jpg +0 -0
- package/app/assets/image/demo/fallback.webp +0 -0
- package/app/assets/image/demo/large.avif +0 -0
- package/app/assets/image/demo/large.webp +0 -0
- package/app/assets/image/demo/small.avif +0 -0
- package/app/assets/image/demo/small.webp +0 -0
- package/app/assets/markup/element/iframe.hbs +4 -1
- package/app/assets/markup/element/img.hbs +16 -1
- package/app/assets/markup/element/picture.hbs +30 -0
- package/app/assets/markup/modal/modal-example-1.handlebars +1 -1
- package/app/assets/script/api/{facebook.js → facebook.ts} +17 -12
- package/app/assets/script/api/youtube.ts +22 -0
- package/app/assets/script/index.ts +2 -0
- package/app/assets/script/mediator/global.ts +4 -0
- package/app/assets/script/model/singletons/countries.ts +5 -0
- package/app/assets/script/model/singletons/global.ts +5 -0
- package/app/assets/script/model/singletons/states.ts +5 -0
- package/app/assets/script/model/user.ts +4 -0
- package/app/assets/script/toolkit.ts +11 -0
- package/app/assets/script/types.d.ts +16 -0
- package/app/assets/script/utility/ajax.ts +15 -0
- package/app/assets/script/utility/form.ts +119 -0
- package/app/assets/script/utility/{regex.js → regex.ts} +15 -6
- package/app/assets/script/utility/share.ts +77 -0
- package/app/assets/script/utility/string.ts +148 -0
- package/app/assets/script/view/default.tsx +14 -0
- package/app/assets/script/view/toolkit/youtube-player-1.ts +31 -0
- package/app/assets/style/base/_toolkit.scss +25 -25
- package/app/assets/style/base/components/_modal-1.scss +8 -3
- package/app/assets/style/base/components/_tabpanel-1.scss +21 -16
- package/app/assets/style/base/components/_tabpanel-2.scss +11 -6
- package/app/assets/style/base/components/_youtube-player-1.scss +3 -2
- package/app/assets/style/base/elements/_anchors.scss +2 -0
- package/app/assets/style/base/elements/_buttons.scss +7 -3
- package/app/assets/style/base/elements/_fieldsets.scss +2 -0
- package/app/assets/style/base/elements/_inputs.scss +6 -2
- package/app/assets/style/base/elements/_labels.scss +2 -0
- package/app/assets/style/base/elements/_legends.scss +2 -0
- package/app/assets/style/base/elements/_lists.scss +2 -0
- package/app/assets/style/base/elements/_tables.scss +10 -6
- package/app/assets/style/base/layouts/_staggered-1.scss +4 -1
- package/app/assets/style/base/type/_fonts.scss +4 -1
- package/app/assets/style/base/type/_headings.scss +3 -0
- package/app/assets/style/base/type/_text.scss +2 -0
- package/app/assets/style/base/utilities/_accessibility.scss +5 -2
- package/app/assets/style/base/utilities/_functions.scss +62 -9
- package/app/assets/style/global.scss +4 -11
- package/app/assets/style/print.scss +1 -4
- package/app/assets/style/toolkit.scss +37 -37
- package/app/package.json +1 -0
- package/app/toolkit/colors.hbs +11 -11
- package/app/toolkit/components.hbs +16 -16
- package/app/toolkit/elements.hbs +52 -43
- package/app/toolkit/grids.hbs +111 -111
- package/app/toolkit/icons.hbs +2 -2
- package/app/toolkit/index.hbs +6 -6
- package/app/toolkit/type.hbs +4 -4
- package/dist/app/assets/data/coutries.json +992 -0
- package/dist/app/assets/data/states.json +204 -0
- package/dist/app/assets/script/api/facebook.d.ts +8 -0
- package/dist/app/assets/script/api/facebook.js +42 -0
- package/dist/app/assets/script/api/facebook.js.map +1 -0
- package/dist/app/assets/script/api/youtube.d.ts +8 -0
- package/dist/app/assets/script/api/youtube.js +22 -0
- package/dist/app/assets/script/api/youtube.js.map +1 -0
- package/dist/app/assets/script/index.d.ts +2 -0
- package/dist/app/assets/script/index.js +2 -0
- package/dist/app/assets/script/index.js.map +1 -0
- package/dist/app/assets/script/mediator/global.d.ts +4 -0
- package/dist/app/assets/script/mediator/global.js +4 -0
- package/dist/app/assets/script/mediator/global.js.map +1 -0
- package/dist/app/assets/script/model/singletons/countries.d.ts +20 -0
- package/dist/app/assets/script/model/singletons/countries.js +5 -0
- package/dist/app/assets/script/model/singletons/countries.js.map +1 -0
- package/dist/app/assets/script/model/singletons/global.d.ts +20 -0
- package/dist/app/assets/script/model/singletons/global.js +5 -0
- package/dist/app/assets/script/model/singletons/global.js.map +1 -0
- package/dist/app/assets/script/model/singletons/states.d.ts +20 -0
- package/dist/app/assets/script/model/singletons/states.js +5 -0
- package/dist/app/assets/script/model/singletons/states.js.map +1 -0
- package/dist/app/assets/script/model/user.d.ts +4 -0
- package/dist/app/assets/script/model/user.js +6 -0
- package/dist/app/assets/script/model/user.js.map +1 -0
- package/dist/app/assets/script/toolkit.d.ts +1 -0
- package/dist/app/assets/script/toolkit.js +7 -0
- package/dist/app/assets/script/toolkit.js.map +1 -0
- package/dist/app/assets/script/utility/ajax.d.ts +8 -0
- package/dist/app/assets/script/utility/ajax.js +17 -0
- package/dist/app/assets/script/utility/ajax.js.map +1 -0
- package/dist/app/assets/script/utility/form.d.ts +64 -0
- package/dist/app/assets/script/utility/form.js +111 -0
- package/dist/app/assets/script/utility/form.js.map +1 -0
- package/dist/app/assets/script/utility/regex.d.ts +14 -0
- package/dist/app/assets/script/utility/regex.js +27 -0
- package/dist/app/assets/script/utility/regex.js.map +1 -0
- package/dist/app/assets/script/utility/share.d.ts +68 -0
- package/dist/app/assets/script/utility/share.js +81 -0
- package/dist/app/assets/script/utility/share.js.map +1 -0
- package/dist/app/assets/script/utility/string.d.ts +64 -0
- package/dist/app/assets/script/utility/string.js +135 -0
- package/dist/app/assets/script/utility/string.js.map +1 -0
- package/dist/app/assets/script/view/default.d.ts +11 -0
- package/dist/app/assets/script/view/default.js +15 -0
- package/dist/app/assets/script/view/default.js.map +1 -0
- package/dist/app/assets/script/view/toolkit/youtube-player-1.d.ts +23 -0
- package/dist/app/assets/script/view/toolkit/youtube-player-1.js +32 -0
- package/dist/app/assets/script/view/toolkit/youtube-player-1.js.map +1 -0
- package/dist/generators/app/index.d.ts +18 -0
- package/dist/generators/app/index.js +59 -0
- package/dist/generators/app/index.js.map +1 -0
- package/dist/scripts/build.d.ts +22 -0
- package/dist/scripts/build.js +158 -0
- package/dist/scripts/build.js.map +1 -0
- package/generators/app/index.js +2 -43
- package/generators/app/index.ts +61 -0
- package/package.json +79 -129
- package/scripts/build.ts +175 -0
- package/tsconfig.site.json +26 -0
- package/.babelrc +0 -14
- package/.editorconfig +0 -13
- package/.eslintrc +0 -64
- package/.htmllintrc +0 -6
- package/.sass-lint.yml +0 -16
- package/.travis.yml +0 -18
- package/app/assets/font/opensans/generator_config.txt +0 -5
- package/app/assets/font/opensans/opensans-bold-webfont.eot +0 -0
- package/app/assets/font/opensans/opensans-bold-webfont.svg +0 -1824
- package/app/assets/font/opensans/opensans-bold-webfont.ttf +0 -0
- package/app/assets/font/opensans/opensans-bold-webfont.woff +0 -0
- package/app/assets/font/opensans/opensans-bolditalic-webfont.eot +0 -0
- package/app/assets/font/opensans/opensans-bolditalic-webfont.svg +0 -1824
- package/app/assets/font/opensans/opensans-bolditalic-webfont.ttf +0 -0
- package/app/assets/font/opensans/opensans-bolditalic-webfont.woff +0 -0
- package/app/assets/font/opensans/opensans-extrabold-webfont.eot +0 -0
- package/app/assets/font/opensans/opensans-extrabold-webfont.svg +0 -1824
- package/app/assets/font/opensans/opensans-extrabold-webfont.ttf +0 -0
- package/app/assets/font/opensans/opensans-extrabold-webfont.woff +0 -0
- package/app/assets/font/opensans/opensans-extrabolditalic-webfont.eot +0 -0
- package/app/assets/font/opensans/opensans-extrabolditalic-webfont.svg +0 -1824
- package/app/assets/font/opensans/opensans-extrabolditalic-webfont.ttf +0 -0
- package/app/assets/font/opensans/opensans-extrabolditalic-webfont.woff +0 -0
- package/app/assets/font/opensans/opensans-italic-webfont.eot +0 -0
- package/app/assets/font/opensans/opensans-italic-webfont.svg +0 -1824
- package/app/assets/font/opensans/opensans-italic-webfont.ttf +0 -0
- package/app/assets/font/opensans/opensans-italic-webfont.woff +0 -0
- package/app/assets/font/opensans/opensans-light-webfont.eot +0 -0
- package/app/assets/font/opensans/opensans-light-webfont.svg +0 -1824
- package/app/assets/font/opensans/opensans-light-webfont.ttf +0 -0
- package/app/assets/font/opensans/opensans-light-webfont.woff +0 -0
- package/app/assets/font/opensans/opensans-lightitalic-webfont.eot +0 -0
- package/app/assets/font/opensans/opensans-lightitalic-webfont.svg +0 -1824
- package/app/assets/font/opensans/opensans-lightitalic-webfont.ttf +0 -0
- package/app/assets/font/opensans/opensans-lightitalic-webfont.woff +0 -0
- package/app/assets/font/opensans/opensans-regular-webfont.eot +0 -0
- package/app/assets/font/opensans/opensans-regular-webfont.svg +0 -1824
- package/app/assets/font/opensans/opensans-regular-webfont.ttf +0 -0
- package/app/assets/font/opensans/opensans-regular-webfont.woff +0 -0
- package/app/assets/font/opensans/opensans-semibold-webfont.eot +0 -0
- package/app/assets/font/opensans/opensans-semibold-webfont.svg +0 -1824
- package/app/assets/font/opensans/opensans-semibold-webfont.ttf +0 -0
- package/app/assets/font/opensans/opensans-semibold-webfont.woff +0 -0
- package/app/assets/font/opensans/opensans-semibolditalic-webfont.eot +0 -0
- package/app/assets/font/opensans/opensans-semibolditalic-webfont.svg +0 -1824
- package/app/assets/font/opensans/opensans-semibolditalic-webfont.ttf +0 -0
- package/app/assets/font/opensans/opensans-semibolditalic-webfont.woff +0 -0
- package/app/assets/font/opensans/specimen_files/grid_12-825-55-15.css +0 -129
- package/app/assets/font/opensans/specimen_files/specimen_stylesheet.css +0 -396
- package/app/assets/image/demo/large.jpg +0 -0
- package/app/assets/image/demo/medium.jpg +0 -0
- package/app/assets/image/demo/small.jpg +0 -0
- package/app/assets/image/demo/xlarge.jpg +0 -0
- package/app/assets/image/demo/xxlarge.jpg +0 -0
- package/app/assets/script/api/youtube.js +0 -18
- package/app/assets/script/index.js +0 -6
- package/app/assets/script/mediator/global.js +0 -5
- package/app/assets/script/model/singletons/countries.js +0 -6
- package/app/assets/script/model/singletons/global.js +0 -6
- package/app/assets/script/model/singletons/states.js +0 -6
- package/app/assets/script/model/user.js +0 -5
- package/app/assets/script/toolkit.js +0 -12
- package/app/assets/script/utility/ajax.js +0 -11
- package/app/assets/script/utility/form.js +0 -86
- package/app/assets/script/utility/share.js +0 -52
- package/app/assets/script/utility/string.js +0 -70
- package/app/assets/script/view/default.js +0 -11
- package/app/assets/script/view/toolkit/youtube-player-1.js +0 -17
- package/app/assets/style/base/vendor/_foundation.scss +0 -2
- package/app/assets/test/spec/shareSpec.js +0 -137
- package/app/index.html +0 -40
- package/app/report/istanbul/base.css +0 -213
- package/app/report/istanbul/prettify.css +0 -1
- package/app/report/istanbul/prettify.js +0 -1
- package/app/report/istanbul/sort-arrow-sprite.png +0 -0
- package/app/report/istanbul/sorter.js +0 -158
- package/app/report/jsdoc/fonts/glyphicons-halflings-regular.eot +0 -0
- package/app/report/jsdoc/fonts/glyphicons-halflings-regular.svg +0 -288
- package/app/report/jsdoc/fonts/glyphicons-halflings-regular.ttf +0 -0
- package/app/report/jsdoc/fonts/glyphicons-halflings-regular.woff +0 -0
- package/app/report/jsdoc/fonts/glyphicons-halflings-regular.woff2 +0 -0
- package/app/report/jsdoc/img/glyphicons-halflings-white.png +0 -0
- package/app/report/jsdoc/img/glyphicons-halflings.png +0 -0
- package/app/report/jsdoc/scripts/docstrap.lib.js +0 -11
- package/app/report/jsdoc/scripts/fulltext-search-ui.js +0 -89
- package/app/report/jsdoc/scripts/fulltext-search.js +0 -36
- package/app/report/jsdoc/scripts/lunr.min.js +0 -6
- package/app/report/jsdoc/scripts/prettify/Apache-License-2.0.txt +0 -202
- package/app/report/jsdoc/scripts/prettify/jquery.min.js +0 -6
- package/app/report/jsdoc/scripts/prettify/lang-css.js +0 -21
- package/app/report/jsdoc/scripts/prettify/prettify.js +0 -496
- package/app/report/jsdoc/scripts/sunlight.js +0 -1157
- package/app/report/jsdoc/scripts/toc.js +0 -203
- package/app/report/jsdoc/styles/darkstrap.css +0 -960
- package/app/report/jsdoc/styles/prettify-tomorrow.css +0 -132
- package/app/report/jsdoc/styles/site.cerulean.css +0 -7008
- package/app/report/jsdoc/styles/site.cosmo.css +0 -7061
- package/app/report/jsdoc/styles/site.cyborg.css +0 -7048
- package/app/report/jsdoc/styles/site.darkly.css +0 -7171
- package/app/report/jsdoc/styles/site.darkstrap.css +0 -5638
- package/app/report/jsdoc/styles/site.dibs-bootstrap.css +0 -5899
- package/app/report/jsdoc/styles/site.flatly.css +0 -7147
- package/app/report/jsdoc/styles/site.journal.css +0 -6973
- package/app/report/jsdoc/styles/site.lumen.css +0 -7298
- package/app/report/jsdoc/styles/site.paper.css +0 -7623
- package/app/report/jsdoc/styles/site.readable.css +0 -6997
- package/app/report/jsdoc/styles/site.sandstone.css +0 -7035
- package/app/report/jsdoc/styles/site.simplex.css +0 -7023
- package/app/report/jsdoc/styles/site.slate.css +0 -7343
- package/app/report/jsdoc/styles/site.spacelab.css +0 -7055
- package/app/report/jsdoc/styles/site.superhero.css +0 -7131
- package/app/report/jsdoc/styles/site.united.css +0 -6895
- package/app/report/jsdoc/styles/site.yeti.css +0 -7195
- package/app/report/jsdoc/styles/sunlight.dark.css +0 -345
- package/app/report/jsdoc/styles/sunlight.default.css +0 -344
- package/gulp/config.js +0 -224
- package/gulp/tasks/accessibility.js +0 -34
- package/gulp/tasks/build.js +0 -19
- package/gulp/tasks/clean.js +0 -34
- package/gulp/tasks/data.js +0 -22
- package/gulp/tasks/default.js +0 -9
- package/gulp/tasks/deploy.js +0 -225
- package/gulp/tasks/documentation.js +0 -25
- package/gulp/tasks/markup.js +0 -121
- package/gulp/tasks/script.js +0 -92
- package/gulp/tasks/style.js +0 -42
- package/gulp/tasks/unit.js +0 -38
- package/gulp/tasks/watch.js +0 -83
- package/gulpfile.js +0 -8
- package/jsdoc.json +0 -23
- package/karma.conf.js +0 -58
package/README.md
CHANGED
|
@@ -1,136 +1,195 @@
|
|
|
1
|
-
# white
|
|
1
|
+
# white-label
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`white-label` is a Yeoman generator and build system for creating static websites. It provides a working project structure with Handlebars templates, Sass styles, Bootstrap, responsive images, and TypeScript sources compiled to bundled JavaScript.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Use it when you want a small, understandable static-site foundation that you can brand and extend without adopting a full application framework.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## What it builds
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
- Foundation
|
|
11
|
-
- Browserify
|
|
12
|
-
- Browsersync
|
|
13
|
-
- Gulp
|
|
14
|
-
- Handlebars
|
|
15
|
-
- Jasmine
|
|
16
|
-
- Modernizr
|
|
17
|
-
- Node Events
|
|
18
|
-
- Karma
|
|
19
|
-
- ReactJS
|
|
20
|
-
- SCSS
|
|
21
|
-
- [White Label Model](https://github.com/bshack/white-label-model)
|
|
9
|
+
The project separates source files by responsibility:
|
|
22
10
|
|
|
23
|
-
|
|
11
|
+
- `app/*.hbs` contains pages.
|
|
12
|
+
- `app/assets/markup` contains reusable Handlebars partials.
|
|
13
|
+
- `app/assets/data/view` contains global and page-specific JSON data.
|
|
14
|
+
- `app/assets/style` contains Sass entry points and partials.
|
|
15
|
+
- `app/assets/script` contains TypeScript and TSX entry points.
|
|
16
|
+
- `app/assets/image` and `app/assets/font` contain static assets.
|
|
17
|
+
- `scripts/build.ts` turns those sources into a deployable `_deploy` directory.
|
|
24
18
|
|
|
25
|
-
|
|
19
|
+
The build renders Handlebars pages, compiles Sass, bundles JavaScript with esbuild, copies static assets, and writes the deployment configuration to `assets/data/config.json`. `global.css` includes the complete compiled Bootstrap CSS followed by the project's styles.
|
|
26
20
|
|
|
27
|
-
|
|
21
|
+
Generated formatting utilities use native `Intl` and `Date` APIs, so new projects do not need Lodash, Moment, or Numeral for the included examples.
|
|
28
22
|
|
|
29
|
-
|
|
23
|
+
## Requirements
|
|
30
24
|
|
|
31
|
-
|
|
25
|
+
- Node.js 20 or newer
|
|
26
|
+
- npm 10 or newer
|
|
32
27
|
|
|
33
|
-
|
|
28
|
+
## Generate a new site
|
|
34
29
|
|
|
35
|
-
|
|
30
|
+
Install Yeoman and the generator, then run it in an empty project directory:
|
|
36
31
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
32
|
+
```sh
|
|
33
|
+
npm install --global yo generator-white-label
|
|
34
|
+
mkdir my-site
|
|
35
|
+
cd my-site
|
|
36
|
+
yo white-label
|
|
37
|
+
```
|
|
41
38
|
|
|
42
|
-
|
|
39
|
+
The generator copies the `app` and `scripts` directories and creates a project `package.json`. It intentionally does not install dependencies automatically, so you can review that manifest first:
|
|
43
40
|
|
|
44
|
-
```
|
|
45
|
-
npm install
|
|
41
|
+
```sh
|
|
42
|
+
npm install
|
|
43
|
+
npm test
|
|
46
44
|
```
|
|
47
45
|
|
|
48
|
-
|
|
46
|
+
## Build the site
|
|
49
47
|
|
|
50
|
-
|
|
48
|
+
A build with defaults is enough for local inspection:
|
|
51
49
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
```sh
|
|
51
|
+
npm run build
|
|
52
|
+
```
|
|
55
53
|
|
|
56
|
-
|
|
54
|
+
The generated site is written to `_deploy`. Each asset build is placed under `_deploy/release/<version>/assets`; when no version is supplied, the build uses the current Unix timestamp.
|
|
57
55
|
|
|
58
|
-
|
|
56
|
+
For a deployment build, pass explicit values after `--`:
|
|
59
57
|
|
|
60
|
-
```
|
|
61
|
-
|
|
58
|
+
```sh
|
|
59
|
+
npm run build -- \
|
|
60
|
+
--www=https://www.example.com \
|
|
61
|
+
--cdn=https://cdn.example.com \
|
|
62
|
+
--service=https://api.example.com \
|
|
63
|
+
--version=2026.09.06 \
|
|
64
|
+
--production=true
|
|
62
65
|
```
|
|
63
66
|
|
|
64
|
-
|
|
67
|
+
| Option | Default | Purpose |
|
|
68
|
+
| --- | --- | --- |
|
|
69
|
+
| `--www` | `/` | Public website base URL exposed to templates and configuration. |
|
|
70
|
+
| `--cdn` | `/` | Asset base URL exposed to templates and configuration. |
|
|
71
|
+
| `--service` | `/service-endpoint` | Backend service URL exposed to the site. |
|
|
72
|
+
| `--version` | Current Unix timestamp | Directory name used for versioned assets. |
|
|
73
|
+
| `--production` | `false` | Minifies CSS and JavaScript when set to `true`. |
|
|
65
74
|
|
|
66
|
-
|
|
75
|
+
The version may contain only letters, numbers, dots, underscores, and hyphens. This prevents it from escaping the deployment directory.
|
|
67
76
|
|
|
68
|
-
|
|
77
|
+
## Add a page
|
|
69
78
|
|
|
70
|
-
|
|
79
|
+
Create `app/about.hbs`:
|
|
71
80
|
|
|
81
|
+
```handlebars
|
|
82
|
+
{{> element/head}}
|
|
83
|
+
<main>
|
|
84
|
+
<h1>{{title}}</h1>
|
|
85
|
+
<p>{{introduction}}</p>
|
|
86
|
+
</main>
|
|
72
87
|
```
|
|
73
|
-
|
|
88
|
+
|
|
89
|
+
Then create matching data at `app/assets/data/view/about.json`:
|
|
90
|
+
|
|
91
|
+
```json
|
|
92
|
+
{
|
|
93
|
+
"title": "About us",
|
|
94
|
+
"introduction": "A short description of the organization."
|
|
95
|
+
}
|
|
74
96
|
```
|
|
75
97
|
|
|
76
|
-
|
|
98
|
+
Global data from `app/assets/data/view/global.json`, page data, and build options are merged before the template is rendered. Page-specific values take precedence over global values, and build options take precedence over both.
|
|
77
99
|
|
|
78
|
-
|
|
100
|
+
## Responsive images
|
|
79
101
|
|
|
80
|
-
|
|
81
|
-
|
|
102
|
+
The included `picture` partial supports AVIF and WebP sources at each responsive breakpoint, with an ordinary image as the final fallback:
|
|
103
|
+
|
|
104
|
+
```handlebars
|
|
105
|
+
{{> element/picture
|
|
106
|
+
imageFallback='assets/image/hero/fallback.jpg'
|
|
107
|
+
imageSmallAvif='assets/image/hero/small.avif'
|
|
108
|
+
imageSmallWebp='assets/image/hero/small.webp'
|
|
109
|
+
imageLargeAvif='assets/image/hero/large.avif'
|
|
110
|
+
imageLargeWebp='assets/image/hero/large.webp'
|
|
111
|
+
width='2048'
|
|
112
|
+
height='1600'
|
|
113
|
+
loading='lazy'
|
|
114
|
+
decoding='async'
|
|
115
|
+
alt='A human-readable description of the image'
|
|
116
|
+
}}
|
|
82
117
|
```
|
|
83
118
|
|
|
84
|
-
|
|
119
|
+
Browsers choose the first supported source whose media query matches. Browsers without AVIF or WebP support use `imageFallback`. Supplying width and height also reserves layout space and helps avoid content movement while the image loads.
|
|
85
120
|
|
|
86
|
-
|
|
121
|
+
## Development checks
|
|
87
122
|
|
|
88
|
-
|
|
89
|
-
|
|
123
|
+
Run the same basic checks before proposing a change:
|
|
124
|
+
|
|
125
|
+
```sh
|
|
126
|
+
npm run build
|
|
127
|
+
npm run typecheck
|
|
128
|
+
npm test
|
|
129
|
+
npm run coverage
|
|
130
|
+
npm run audit
|
|
90
131
|
```
|
|
91
132
|
|
|
92
|
-
|
|
133
|
+
## Version 4 migration notes
|
|
93
134
|
|
|
94
|
-
|
|
95
|
-
gulp unit;
|
|
96
|
-
```
|
|
135
|
+
Version 4 intentionally replaced the unsupported Gulp 3, Babel 6, PhantomJS, Karma, Bower, and legacy plugin pipeline. It also replaced Foundation with Bootstrap 5.3.8 and migrated the grid markup to Bootstrap `row` and responsive `col-*` classes. Projects upgrading from an older major version should treat the build tooling, supported Node.js versions, CSS framework, and generated markup as breaking changes.
|
|
97
136
|
|
|
98
|
-
|
|
137
|
+
Version 4.1 removes Lodash, Moment, and Numeral from generated projects. If application code added its own imports from those packages, either retain the dependency in that application or migrate those calls before upgrading.
|
|
99
138
|
|
|
100
|
-
|
|
139
|
+
## Related packages
|
|
101
140
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
gulp documentation;
|
|
108
|
-
```
|
|
141
|
+
- [`white-label-model`](https://github.com/bshack/white-label-model) provides event-emitting models and collections.
|
|
142
|
+
- [`white-label-view`](https://github.com/bshack/white-label-view) renders templates and manages delegated DOM events.
|
|
143
|
+
- [`white-label-router`](https://github.com/bshack/white-label-router) provides History API navigation.
|
|
144
|
+
- [`white-label-mediator`](https://github.com/bshack/white-label-mediator) provides shared application messaging.
|
|
145
|
+
- [`white-label-service`](https://github.com/bshack/white-label-service) provides an authenticated JSON service backed by MySQL.
|
|
109
146
|
|
|
110
|
-
##
|
|
147
|
+
## TypeScript development and version 5.0.0 migration
|
|
111
148
|
|
|
112
|
-
|
|
149
|
+
Implementation code now uses strict TypeScript. Builds emit JavaScript, source maps with embedded source, and `.d.ts` declarations into `dist`. JavaScript callers can still use the package without compiling TypeScript themselves. JSDoc comments describe parameters, return values, lifecycle behavior, and validation at the implementation, and are retained in declarations.
|
|
113
150
|
|
|
114
|
-
```
|
|
115
|
-
|
|
151
|
+
```ts
|
|
152
|
+
// app/assets/script/profile.ts
|
|
153
|
+
import User from './model/user.js';
|
|
154
|
+
|
|
155
|
+
const profile = new User({name: 'Ada'});
|
|
156
|
+
console.log(profile.get().name);
|
|
116
157
|
```
|
|
117
158
|
|
|
118
|
-
|
|
159
|
+
Write implementation files as `.ts`, or `.tsx` for React markup. Keep `.js` extensions on relative imports: TypeScript resolves them to source files and emits imports usable by Node. Every top-level script entry is bundled, except declaration-only `.d.ts` files. The build checks all sample modules, including modules not imported by an entry point.
|
|
119
160
|
|
|
120
|
-
|
|
161
|
+
The `types.d.ts` file documents the subset of older published white-label dependencies used by the scaffold. It also declares optional SDK callbacks on `window`. These are explicit compatibility declarations, not unrestricted `any` modules. New releases of the related packages are not required from npm until they are actually published.
|
|
121
162
|
|
|
122
|
-
|
|
163
|
+
Version 5 is a major release because generated projects now contain TypeScript and use a two-stage TypeScript/esbuild pipeline. Use Node.js 24 for development and CI. Existing generated sites are not changed automatically: migrate their script files, copy the new build configuration, and resolve strict type errors before deploying. The small `generators/app/index.js` file is only Yeoman's discovery bridge to compiled TypeScript.
|
|
123
164
|
|
|
124
|
-
|
|
165
|
+
The generated project includes its own README. Full Bootstrap CSS remains included. Old inactive Gulp and Karma configuration has been removed; all historical share-URL assertions now run in the active Node test suite.
|
|
125
166
|
|
|
126
|
-
|
|
127
|
-
npm install generator-white-label -g;
|
|
128
|
-
```
|
|
167
|
+
### Sample utility reference
|
|
129
168
|
|
|
130
|
-
|
|
169
|
+
| Module | Functionality and example |
|
|
170
|
+
| --- | --- |
|
|
171
|
+
| `utility/ajax.ts` | `getScript('/sdk.js')` appends an asynchronous script; call it only when needed. |
|
|
172
|
+
| `utility/form.ts` | Read multiselect values, select or find an option, decorate/split metadata, and build named options: `buildOptions([{id: 1, name: 'Ada'}], 1)`. Metadata helpers mutate their supplied arrays. |
|
|
173
|
+
| `utility/string.ts` | Parse trusted HTML, read query values, format local dates, numbers and USD currency, and create phone/email links: `formatCurrency(12.5)` returns `$12.50`. `getQueryStringParamater` retains its historical spelling. |
|
|
174
|
+
| `utility/share.ts` | Construct encoded Facebook, Twitter, LinkedIn and email URLs. Missing required values return `false`. Twitter retains its legacy 140-character rule; Google Plus support is a deprecated URL formatter for a discontinued service. |
|
|
175
|
+
| `utility/regex.ts` | Legacy presentation-validation expressions for dates, passwords, phone numbers, ZIP codes, length and currency. These are not substitutes for server validation or a modern password policy. |
|
|
176
|
+
| `model/user.ts` | An extendable observable object model. Country/state singletons contain the bundled JSON data. The global model starts with local URL defaults; the build separately writes deployment settings to `assets/data/config.json`. |
|
|
177
|
+
| `api/facebook.ts`, `api/youtube.ts` | Optional SDK adapters that emit readiness events through the shared mediator. They are tested with local browser doubles, not live provider accounts. Review provider configuration before enabling them in a real site. |
|
|
178
|
+
| `view/default.tsx` | A React greeting component: `<HelloMessage name="Ada" />`. |
|
|
179
|
+
| `view/toolkit/youtube-player-1.ts` | An extension skeleton for a concrete player, with the legacy `removeListners` hook retained. |
|
|
131
180
|
|
|
181
|
+
### Verification and coverage
|
|
182
|
+
|
|
183
|
+
```sh
|
|
184
|
+
npm ci --ignore-scripts
|
|
185
|
+
npm run typecheck
|
|
186
|
+
npm test
|
|
187
|
+
npm run coverage
|
|
188
|
+
npm pack --dry-run
|
|
132
189
|
```
|
|
133
|
-
yo white-label;
|
|
134
|
-
```
|
|
135
190
|
|
|
136
|
-
|
|
191
|
+
`npm test` builds the code, checks TypeScript consumer examples against the emitted declarations, and runs the tests. `npm run coverage` additionally enforces **100% statements, branches, functions, and lines for each implementation file**. Unexecuted implementation files count toward the result; declaration-only files contain no executable code and are excluded. Reports are written to `coverage`, including `lcov.info` for coverage viewers. CI runs the same gate and checks committed build output for drift.
|
|
192
|
+
|
|
193
|
+
Tests exercise the compiled JavaScript interface used by downstream callers. Coverage is an execution metric, not proof that all possible inputs or external integrations are correct. Tests for third-party SDKs use local doubles. No live provider requests are needed.
|
|
194
|
+
|
|
195
|
+
To undo this migration, revert its commit and run `npm ci` from the restored lockfile. No npm release, database migration, or production deployment is performed by these development changes.
|
package/app/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Your white-label site
|
|
2
|
+
|
|
3
|
+
This site uses TypeScript for application code, Handlebars for pages, and Sass plus full Bootstrap CSS for styling.
|
|
4
|
+
|
|
5
|
+
## Start developing
|
|
6
|
+
|
|
7
|
+
Use Node.js 24. Run `npm install`, then `npm run typecheck` and `npm run build`. The build output is `_deploy`; serve that directory with your preferred static server. `npm test` runs the generated site's build check. The generator repository has the broader unit and coverage suites; add application-specific tests as your site grows.
|
|
8
|
+
|
|
9
|
+
Edit `.ts` files under `app/assets/script`, and use `.tsx` for React components. Keep `.js` extensions in relative imports, for example `import User from './model/user.js'`. TypeScript resolves the source and emits valid JavaScript imports. Do not edit `dist`, which is generated by the compiler.
|
|
10
|
+
|
|
11
|
+
Pages live in `app/*.hbs`, partials in `app/assets/markup`, and page data in `app/assets/data/view`. Add shared styles in `app/assets/style`. The full Bootstrap stylesheet is included before the project styles.
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
npm run build -- --version=release-1 --production=true
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Optional flags are `--www`, `--cdn`, and `--service`. Their defaults are `/`, `/`, and `/service-endpoint`. The version selects `_deploy/release/<version>/assets`; without a version, the current timestamp is used. Each build replaces `_deploy`.
|
|
18
|
+
|
|
19
|
+
Document new functions with JSDoc comments explaining behavior, parameters, return values, and meaningful errors. Keep strict type checking enabled. Templates accept trusted HTML, so validate or escape external content before rendering it. Optional SDK adapters need real provider configuration before use.
|
|
@@ -4,12 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
@font-face {
|
|
6
6
|
font-family: 'open_sansbold';
|
|
7
|
-
src: url('../font/opensans/opensans-bold-webfont.
|
|
8
|
-
|
|
9
|
-
url('../font/opensans/opensans-bold-webfont.woff2') format('woff2'),
|
|
10
|
-
url('../font/opensans/opensans-bold-webfont.woff') format('woff'),
|
|
11
|
-
url('../font/opensans/opensans-bold-webfont.ttf') format('truetype'),
|
|
12
|
-
url('../font/opensans/opensans-bold-webfont.svg#open_sansbold') format('svg');
|
|
7
|
+
src: url('../font/opensans/opensans-bold-webfont.woff2') format('woff2');
|
|
8
|
+
font-display: swap;
|
|
13
9
|
font-weight: normal;
|
|
14
10
|
font-style: normal;
|
|
15
11
|
|
|
@@ -20,12 +16,8 @@
|
|
|
20
16
|
|
|
21
17
|
@font-face {
|
|
22
18
|
font-family: 'open_sansbold_italic';
|
|
23
|
-
src: url('../font/opensans/opensans-bolditalic-webfont.
|
|
24
|
-
|
|
25
|
-
url('../font/opensans/opensans-bolditalic-webfont.woff2') format('woff2'),
|
|
26
|
-
url('../font/opensans/opensans-bolditalic-webfont.woff') format('woff'),
|
|
27
|
-
url('../font/opensans/opensans-bolditalic-webfont.ttf') format('truetype'),
|
|
28
|
-
url('../font/opensans/opensans-bolditalic-webfont.svg#open_sansbold_italic') format('svg');
|
|
19
|
+
src: url('../font/opensans/opensans-bolditalic-webfont.woff2') format('woff2');
|
|
20
|
+
font-display: swap;
|
|
29
21
|
font-weight: normal;
|
|
30
22
|
font-style: normal;
|
|
31
23
|
|
|
@@ -36,12 +28,8 @@
|
|
|
36
28
|
|
|
37
29
|
@font-face {
|
|
38
30
|
font-family: 'open_sansextrabold';
|
|
39
|
-
src: url('../font/opensans/opensans-extrabold-webfont.
|
|
40
|
-
|
|
41
|
-
url('../font/opensans/opensans-extrabold-webfont.woff2') format('woff2'),
|
|
42
|
-
url('../font/opensans/opensans-extrabold-webfont.woff') format('woff'),
|
|
43
|
-
url('../font/opensans/opensans-extrabold-webfont.ttf') format('truetype'),
|
|
44
|
-
url('../font/opensans/opensans-extrabold-webfont.svg#open_sansextrabold') format('svg');
|
|
31
|
+
src: url('../font/opensans/opensans-extrabold-webfont.woff2') format('woff2');
|
|
32
|
+
font-display: swap;
|
|
45
33
|
font-weight: normal;
|
|
46
34
|
font-style: normal;
|
|
47
35
|
|
|
@@ -52,12 +40,8 @@
|
|
|
52
40
|
|
|
53
41
|
@font-face {
|
|
54
42
|
font-family: 'open_sansextrabold_italic';
|
|
55
|
-
src: url('../font/opensans/opensans-extrabolditalic-webfont.
|
|
56
|
-
|
|
57
|
-
url('../font/opensans/opensans-extrabolditalic-webfont.woff2') format('woff2'),
|
|
58
|
-
url('../font/opensans/opensans-extrabolditalic-webfont.woff') format('woff'),
|
|
59
|
-
url('../font/opensans/opensans-extrabolditalic-webfont.ttf') format('truetype'),
|
|
60
|
-
url('../font/opensans/opensans-extrabolditalic-webfont.svg#open_sansextrabold_italic') format('svg');
|
|
43
|
+
src: url('../font/opensans/opensans-extrabolditalic-webfont.woff2') format('woff2');
|
|
44
|
+
font-display: swap;
|
|
61
45
|
font-weight: normal;
|
|
62
46
|
font-style: normal;
|
|
63
47
|
|
|
@@ -68,12 +52,8 @@
|
|
|
68
52
|
|
|
69
53
|
@font-face {
|
|
70
54
|
font-family: 'open_sansitalic';
|
|
71
|
-
src: url('../font/opensans/opensans-italic-webfont.
|
|
72
|
-
|
|
73
|
-
url('../font/opensans/opensans-italic-webfont.woff2') format('woff2'),
|
|
74
|
-
url('../font/opensans/opensans-italic-webfont.woff') format('woff'),
|
|
75
|
-
url('../font/opensans/opensans-italic-webfont.ttf') format('truetype'),
|
|
76
|
-
url('../font/opensans/opensans-italic-webfont.svg#open_sansitalic') format('svg');
|
|
55
|
+
src: url('../font/opensans/opensans-italic-webfont.woff2') format('woff2');
|
|
56
|
+
font-display: swap;
|
|
77
57
|
font-weight: normal;
|
|
78
58
|
font-style: normal;
|
|
79
59
|
|
|
@@ -84,12 +64,8 @@
|
|
|
84
64
|
|
|
85
65
|
@font-face {
|
|
86
66
|
font-family: 'open_sanslight';
|
|
87
|
-
src: url('../font/opensans/opensans-light-webfont.
|
|
88
|
-
|
|
89
|
-
url('../font/opensans/opensans-light-webfont.woff2') format('woff2'),
|
|
90
|
-
url('../font/opensans/opensans-light-webfont.woff') format('woff'),
|
|
91
|
-
url('../font/opensans/opensans-light-webfont.ttf') format('truetype'),
|
|
92
|
-
url('../font/opensans/opensans-light-webfont.svg#open_sanslight') format('svg');
|
|
67
|
+
src: url('../font/opensans/opensans-light-webfont.woff2') format('woff2');
|
|
68
|
+
font-display: swap;
|
|
93
69
|
font-weight: normal;
|
|
94
70
|
font-style: normal;
|
|
95
71
|
|
|
@@ -100,12 +76,8 @@
|
|
|
100
76
|
|
|
101
77
|
@font-face {
|
|
102
78
|
font-family: 'open_sanslight_italic';
|
|
103
|
-
src: url('../font/opensans/opensans-lightitalic-webfont.
|
|
104
|
-
|
|
105
|
-
url('../font/opensans/opensans-lightitalic-webfont.woff2') format('woff2'),
|
|
106
|
-
url('../font/opensans/opensans-lightitalic-webfont.woff') format('woff'),
|
|
107
|
-
url('../font/opensans/opensans-lightitalic-webfont.ttf') format('truetype'),
|
|
108
|
-
url('../font/opensans/opensans-lightitalic-webfont.svg#open_sanslight_italic') format('svg');
|
|
79
|
+
src: url('../font/opensans/opensans-lightitalic-webfont.woff2') format('woff2');
|
|
80
|
+
font-display: swap;
|
|
109
81
|
font-weight: normal;
|
|
110
82
|
font-style: normal;
|
|
111
83
|
|
|
@@ -116,12 +88,8 @@
|
|
|
116
88
|
|
|
117
89
|
@font-face {
|
|
118
90
|
font-family: 'open_sansregular';
|
|
119
|
-
src: url('../font/opensans/opensans-regular-webfont.
|
|
120
|
-
|
|
121
|
-
url('../font/opensans/opensans-regular-webfont.woff2') format('woff2'),
|
|
122
|
-
url('../font/opensans/opensans-regular-webfont.woff') format('woff'),
|
|
123
|
-
url('../font/opensans/opensans-regular-webfont.ttf') format('truetype'),
|
|
124
|
-
url('../font/opensans/opensans-regular-webfont.svg#open_sansregular') format('svg');
|
|
91
|
+
src: url('../font/opensans/opensans-regular-webfont.woff2') format('woff2');
|
|
92
|
+
font-display: swap;
|
|
125
93
|
font-weight: normal;
|
|
126
94
|
font-style: normal;
|
|
127
95
|
|
|
@@ -132,12 +100,8 @@
|
|
|
132
100
|
|
|
133
101
|
@font-face {
|
|
134
102
|
font-family: 'open_sanssemibold';
|
|
135
|
-
src: url('../font/opensans/opensans-semibold-webfont.
|
|
136
|
-
|
|
137
|
-
url('../font/opensans/opensans-semibold-webfont.woff2') format('woff2'),
|
|
138
|
-
url('../font/opensans/opensans-semibold-webfont.woff') format('woff'),
|
|
139
|
-
url('../font/opensans/opensans-semibold-webfont.ttf') format('truetype'),
|
|
140
|
-
url('../font/opensans/opensans-semibold-webfont.svg#open_sanssemibold') format('svg');
|
|
103
|
+
src: url('../font/opensans/opensans-semibold-webfont.woff2') format('woff2');
|
|
104
|
+
font-display: swap;
|
|
141
105
|
font-weight: normal;
|
|
142
106
|
font-style: normal;
|
|
143
107
|
|
|
@@ -148,12 +112,8 @@
|
|
|
148
112
|
|
|
149
113
|
@font-face {
|
|
150
114
|
font-family: 'open_sanssemibold_italic';
|
|
151
|
-
src: url('../font/opensans/opensans-semibolditalic-webfont.
|
|
152
|
-
|
|
153
|
-
url('../font/opensans/opensans-semibolditalic-webfont.woff2') format('woff2'),
|
|
154
|
-
url('../font/opensans/opensans-semibolditalic-webfont.woff') format('woff'),
|
|
155
|
-
url('../font/opensans/opensans-semibolditalic-webfont.ttf') format('truetype'),
|
|
156
|
-
url('../font/opensans/opensans-semibolditalic-webfont.svg#open_sanssemibold_italic') format('svg');
|
|
115
|
+
src: url('../font/opensans/opensans-semibolditalic-webfont.woff2') format('woff2');
|
|
116
|
+
font-display: swap;
|
|
157
117
|
font-weight: normal;
|
|
158
118
|
font-style: normal;
|
|
159
119
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -11,5 +11,20 @@
|
|
|
11
11
|
{{#if this.image}}
|
|
12
12
|
src="{{#unless this.external}}{{this.cdn}}{{/unless}}{{this.image}}"
|
|
13
13
|
{{/if}}
|
|
14
|
+
{{#if this.width}}
|
|
15
|
+
width="{{this.width}}"
|
|
16
|
+
{{/if}}
|
|
17
|
+
{{#if this.height}}
|
|
18
|
+
height="{{this.height}}"
|
|
19
|
+
{{/if}}
|
|
20
|
+
{{#if this.loading}}
|
|
21
|
+
loading="{{this.loading}}"
|
|
22
|
+
{{/if}}
|
|
23
|
+
{{#if this.decoding}}
|
|
24
|
+
decoding="{{this.decoding}}"
|
|
25
|
+
{{/if}}
|
|
26
|
+
{{#if this.fetchpriority}}
|
|
27
|
+
fetchpriority="{{this.fetchpriority}}"
|
|
28
|
+
{{/if}}
|
|
14
29
|
alt="{{#if this.alt}}{{this.alt}}{{/if}}"
|
|
15
|
-
>
|
|
30
|
+
>
|
|
@@ -9,18 +9,48 @@
|
|
|
9
9
|
{{/if}}
|
|
10
10
|
alt="{{#if this.alt}}{{this.alt}}{{/if}}"
|
|
11
11
|
>
|
|
12
|
+
{{#if this.imageSmallAvif}}
|
|
13
|
+
<source type="image/avif" media="(max-width: 40rem)" srcset="{{#unless this.external}}{{this.cdn}}{{/unless}}{{this.imageSmallAvif}}">
|
|
14
|
+
{{/if}}
|
|
15
|
+
{{#if this.imageSmallWebp}}
|
|
16
|
+
<source type="image/webp" media="(max-width: 40rem)" srcset="{{#unless this.external}}{{this.cdn}}{{/unless}}{{this.imageSmallWebp}}">
|
|
17
|
+
{{/if}}
|
|
12
18
|
{{#if this.imageSmall}}
|
|
13
19
|
<source media="(max-width: 40rem)" srcset="{{#unless this.external}}{{this.cdn}}{{/unless}}{{this.imageSmall}}">
|
|
14
20
|
{{/if}}
|
|
21
|
+
{{#if this.imageMediumAvif}}
|
|
22
|
+
<source type="image/avif" media="(max-width: 64rem)" srcset="{{#unless this.external}}{{this.cdn}}{{/unless}}{{this.imageMediumAvif}}">
|
|
23
|
+
{{/if}}
|
|
24
|
+
{{#if this.imageMediumWebp}}
|
|
25
|
+
<source type="image/webp" media="(max-width: 64rem)" srcset="{{#unless this.external}}{{this.cdn}}{{/unless}}{{this.imageMediumWebp}}">
|
|
26
|
+
{{/if}}
|
|
15
27
|
{{#if this.imageMedium}}
|
|
16
28
|
<source media="(max-width: 64rem)" srcset="{{#unless this.external}}{{this.cdn}}{{/unless}}{{this.imageMedium}}">
|
|
17
29
|
{{/if}}
|
|
30
|
+
{{#if this.imageLargeAvif}}
|
|
31
|
+
<source type="image/avif" media="(max-width: 75rem)" srcset="{{#unless this.external}}{{this.cdn}}{{/unless}}{{this.imageLargeAvif}}">
|
|
32
|
+
{{/if}}
|
|
33
|
+
{{#if this.imageLargeWebp}}
|
|
34
|
+
<source type="image/webp" media="(max-width: 75rem)" srcset="{{#unless this.external}}{{this.cdn}}{{/unless}}{{this.imageLargeWebp}}">
|
|
35
|
+
{{/if}}
|
|
18
36
|
{{#if this.imageLarge}}
|
|
19
37
|
<source media="(max-width: 75rem)" srcset="{{#unless this.external}}{{this.cdn}}{{/unless}}{{this.imageLarge}}">
|
|
20
38
|
{{/if}}
|
|
39
|
+
{{#if this.imageXLargeAvif}}
|
|
40
|
+
<source type="image/avif" media="(max-width: 90rem)" srcset="{{#unless this.external}}{{this.cdn}}{{/unless}}{{this.imageXLargeAvif}}">
|
|
41
|
+
{{/if}}
|
|
42
|
+
{{#if this.imageXLargeWebp}}
|
|
43
|
+
<source type="image/webp" media="(max-width: 90rem)" srcset="{{#unless this.external}}{{this.cdn}}{{/unless}}{{this.imageXLargeWebp}}">
|
|
44
|
+
{{/if}}
|
|
21
45
|
{{#if this.imageXLarge}}
|
|
22
46
|
<source media="(max-width: 90rem)" srcset="{{#unless this.external}}{{this.cdn}}{{/unless}}{{this.imageXLarge}}">
|
|
23
47
|
{{/if}}
|
|
48
|
+
{{#if this.imageXXLargeAvif}}
|
|
49
|
+
<source type="image/avif" media="(min-width: 90.001rem)" srcset="{{#unless this.external}}{{this.cdn}}{{/unless}}{{this.imageXXLargeAvif}}">
|
|
50
|
+
{{/if}}
|
|
51
|
+
{{#if this.imageXXLargeWebp}}
|
|
52
|
+
<source type="image/webp" media="(min-width: 90.001rem)" srcset="{{#unless this.external}}{{this.cdn}}{{/unless}}{{this.imageXXLargeWebp}}">
|
|
53
|
+
{{/if}}
|
|
24
54
|
{{#if this.imageXXLarge}}
|
|
25
55
|
<source media="(min-width: 90.001rem)" srcset="{{#unless this.external}}{{this.cdn}}{{/unless}}{{this.imageXXLarge}}">
|
|
26
56
|
{{/if}}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
/** @module app/assets/script/api/facebook */
|
|
1
2
|
import mediator from '../mediator/global.js';
|
|
2
|
-
import modelGlobal from '../model/singletons/global';
|
|
3
|
-
import UtilityAjax from '../utility/ajax';
|
|
3
|
+
import modelGlobal from '../model/singletons/global.js';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
'use strict';
|
|
6
|
+
export default class {
|
|
7
|
+
/**
|
|
8
|
+
* Load the optional SDK and emit a mediator notification from its readiness callback.
|
|
9
|
+
* @param url - URL or optional adapter argument.
|
|
10
|
+
* @returns No value.
|
|
11
|
+
*/
|
|
12
|
+
initialize(url?: string) {
|
|
13
|
+
window.fbAsyncInit = function(e?: Event) {
|
|
12
14
|
window.FB.init({
|
|
13
15
|
appId: modelGlobal.get().appId || null,
|
|
14
16
|
autoLogAppEvents: true,
|
|
@@ -26,11 +28,14 @@ const utilityAjax = new UtilityAjax();
|
|
|
26
28
|
if (d.getElementById(id)) {
|
|
27
29
|
return;
|
|
28
30
|
}
|
|
29
|
-
js = d.createElement(
|
|
31
|
+
js = d.createElement('script');
|
|
30
32
|
js.id = id;
|
|
31
33
|
js.src = '//connect.facebook.net/en_US/sdk.js';
|
|
32
|
-
fjs
|
|
34
|
+
if (fjs?.parentNode) {
|
|
35
|
+
fjs.parentNode.insertBefore(js, fjs);
|
|
36
|
+
} else {
|
|
37
|
+
d.head.appendChild(js);
|
|
38
|
+
}
|
|
33
39
|
}(document, 'script', 'facebook-jssdk'));
|
|
34
40
|
}
|
|
35
41
|
};
|
|
36
|
-
})();
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** @module app/assets/script/api/youtube */
|
|
2
|
+
import mediator from '../mediator/global.js';
|
|
3
|
+
import UtilityAjax from '../utility/ajax.js';
|
|
4
|
+
|
|
5
|
+
const utilityAjax = new UtilityAjax();
|
|
6
|
+
|
|
7
|
+
'use strict';
|
|
8
|
+
export default class {
|
|
9
|
+
/**
|
|
10
|
+
* Load the optional SDK and emit a mediator notification from its readiness callback.
|
|
11
|
+
* @param url - URL or optional adapter argument.
|
|
12
|
+
* @returns No value.
|
|
13
|
+
*/
|
|
14
|
+
initialize(url?: string) {
|
|
15
|
+
utilityAjax.getScript('//www.youtube.com/iframe_api');
|
|
16
|
+
window.onYouTubeIframeAPIReady = (e?: Event) => {
|
|
17
|
+
mediator.emit('youtube-api-1:state:ready', {
|
|
18
|
+
event: e
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
};
|