@qld-gov-au/qgds-bootstrap5 2.0.6 → 2.0.8
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/.esbuild/plugins/qgds-plugin-build-log.js +2 -2
- package/.esbuild/plugins/qgds-plugin-copy-assets.js +0 -3
- package/.esbuild/plugins/qgds-plugin-handlebar-partial-builder.js +76 -66
- package/.storybook/README.md +10 -0
- package/.storybook/{main.js → main.mjs} +4 -5
- package/.storybook/modes.js +3 -12
- package/.storybook/preview.js +14 -11
- package/dist/assets/components/bs5/footer/footer.hbs +20 -18
- package/dist/assets/components/bs5/head/head.hbs +1 -1
- package/dist/assets/components/bs5/header/header.hbs +40 -52
- package/dist/assets/components/bs5/header/headerBrand.hbs +9 -10
- package/dist/assets/components/bs5/logo/logo.hbs +2 -0
- package/dist/assets/components/bs5/logo/logoCOADeliveringForQLD.hbs +49 -0
- package/dist/assets/components/bs5/logo/logoCOALandscape.hbs +55 -109
- package/dist/assets/components/bs5/logo/logoCOALandscape2Lines.hbs +55 -55
- package/dist/assets/components/bs5/searchInput/searchInput.hbs +5 -5
- package/dist/assets/css/qld.bootstrap.css +1 -1
- package/dist/assets/css/qld.bootstrap.css.map +3 -3
- package/dist/assets/css/qld.bootstrap.legacy.css +1 -1
- package/dist/assets/css/qld.bootstrap.legacy.css.map +3 -3
- package/dist/assets/img/coa-delivering-for-qld.svg +47 -0
- package/dist/assets/img/coa-delivering-for-qld.svg.old +58 -0
- package/dist/assets/img/coa-landscape-2lines.svg +63 -0
- package/dist/assets/img/coa-landscape-web.svg +56 -0
- package/dist/assets/js/handlebars.helpers.bundle.js +1 -1
- package/dist/assets/js/handlebars.helpers.bundle.js.map +3 -3
- package/dist/assets/js/handlebars.init.min.js +1329 -1344
- package/dist/assets/js/handlebars.init.min.js.map +4 -4
- package/dist/assets/js/handlebars.partials.js +2383 -136
- package/dist/assets/js/handlebars.partials.js.map +7 -0
- package/dist/assets/js/qld.bootstrap.min.js +3 -3
- package/dist/assets/js/qld.bootstrap.min.js.map +3 -3
- package/dist/assets/node/handlebars.init.min.js +219 -198
- package/dist/assets/node/handlebars.init.min.js.map +3 -3
- package/dist/components/bs5/footer/footer.hbs +20 -18
- package/dist/components/bs5/head/head.hbs +1 -1
- package/dist/components/bs5/header/header.hbs +40 -52
- package/dist/components/bs5/header/headerBrand.hbs +9 -10
- package/dist/components/bs5/logo/logo.hbs +2 -0
- package/dist/components/bs5/logo/logoCOADeliveringForQLD.hbs +49 -0
- package/dist/components/bs5/logo/logoCOALandscape.hbs +55 -109
- package/dist/components/bs5/logo/logoCOALandscape2Lines.hbs +55 -55
- package/dist/components/bs5/searchInput/searchInput.hbs +5 -5
- package/dist/package.json +27 -29
- package/dist/sample-data/correctincorrect/correctincorrect.data.json +1 -0
- package/dist/sample-data/header/header.variant.coBrand.data.json +5 -8
- package/dist/sample-data/header/header.variant.endorsed.data.json +3 -6
- package/dist/sample-data/header/header.variant.masterBrand.data.json +1 -6
- package/dist/sample-data/header/header.variant.standAlone.data.json +3 -6
- package/dist/sample-data/header/header.variant.subBrand.data.json +5 -8
- package/dist/sample-data/tabs/tabs.data.json +1 -2
- package/dist/sample-data/typography/typography.data.json +1 -0
- package/esbuild.js +16 -4
- package/package.json +27 -29
- package/pom.xml +3 -3
- package/src/components/bs5/accordion/Accordion.mdx +1 -1
- package/src/components/bs5/accordion/accordion.stories.js +17 -22
- package/src/components/bs5/backToTop/backToTop.mdx +1 -1
- package/src/components/bs5/banner/Banner.mdx +1 -1
- package/src/components/bs5/banner/banner.scss +2 -2
- package/src/components/bs5/blockquote/Blockquote.mdx +1 -1
- package/src/components/bs5/blockquote/manifest.json +1 -0
- package/src/components/bs5/breadcrumbs/Breadcrumbs.mdx +1 -1
- package/src/components/bs5/breadcrumbs/breadcrumbs.scss +7 -2
- package/src/components/bs5/breadcrumbs/breadcrumbs.stories.js +19 -10
- package/src/components/bs5/breadcrumbs/manifest.json +1 -0
- package/src/components/bs5/breadcumbsWrapper/manifest.json +1 -0
- package/src/components/bs5/button/Button.mdx +1 -1
- package/src/components/bs5/button/manifest.json +1 -0
- package/src/components/bs5/callToAction/callToAction.mdx +1 -1
- package/src/components/bs5/callToAction/callToAction.stories.js +15 -50
- package/src/components/bs5/callout/Callout.mdx +1 -1
- package/src/components/bs5/callout/callout.stories.js +7 -26
- package/src/components/bs5/callout/manifest.json +1 -0
- package/src/components/bs5/card/Card.mdx +1 -1
- package/src/components/bs5/card/card.scss +1 -1
- package/src/components/bs5/card/manifest.json +1 -0
- package/src/components/bs5/contentFooter/manifest.json +1 -0
- package/src/components/bs5/contentFooterWrapper/manifest.json +1 -0
- package/src/components/bs5/contentWrapper/manifest.json +1 -0
- package/src/components/bs5/correctincorrect/correctincorrect.data.json +1 -0
- package/src/components/bs5/correctincorrect/manifest.json +1 -0
- package/src/components/bs5/dateinput/Dateinput.stories.js +23 -31
- package/src/components/bs5/dateinput/manifest.json +1 -0
- package/src/components/bs5/directionLinks/DirectionLinks.mdx +1 -1
- package/src/components/bs5/directionLinks/directionLinks.stories.js +14 -12
- package/src/components/bs5/footer/Footer.mdx +1 -1
- package/src/components/bs5/footer/footer.hbs +20 -18
- package/src/components/bs5/footer/footer.scss +7 -5
- package/src/components/bs5/formcheck/manifest.json +1 -0
- package/src/components/bs5/formcheck/stories/checkbox/Checkbox.mdx +1 -1
- package/src/components/bs5/formcheck/stories/checkbox/checkbox.stories.js +44 -87
- package/src/components/bs5/formcheck/stories/radio/Radio.mdx +1 -1
- package/src/components/bs5/formcheck/stories/radio/radio.stories.js +9 -36
- package/src/components/bs5/fullPageWrapper/manifest.json +1 -0
- package/src/components/bs5/globalAlert/GlobalAlert.mdx +1 -1
- package/src/components/bs5/globalAlert/globalAlert.test.js +3 -3
- package/src/components/bs5/globalAlert/manifest.json +1 -0
- package/src/components/bs5/head/manifest.json +1 -0
- package/src/components/bs5/header/Header.js +25 -0
- package/src/components/bs5/header/Header.mdx +1 -1
- package/src/components/bs5/header/_header-variables.scss +61 -247
- package/src/components/bs5/header/header.functions.js +10 -15
- package/src/components/bs5/header/header.hbs +40 -52
- package/src/components/bs5/header/header.scss +166 -158
- package/src/components/bs5/header/header.stories.js +35 -233
- package/src/components/bs5/header/header.variant.coBrand.data.json +5 -8
- package/src/components/bs5/header/header.variant.endorsed.data.json +3 -6
- package/src/components/bs5/header/header.variant.masterBrand.data.json +1 -6
- package/src/components/bs5/header/header.variant.standAlone.data.json +3 -6
- package/src/components/bs5/header/header.variant.subBrand.data.json +5 -8
- package/src/components/bs5/header/headerBrand.hbs +9 -10
- package/src/components/bs5/header/manifest.json +1 -0
- package/src/components/bs5/icons/Icons.mdx +1 -1
- package/src/components/bs5/icons/manifest.json +1 -0
- package/src/components/bs5/icons/mdx/_IconsSizes.mdx +1 -1
- package/src/components/bs5/image/Image.mdx +1 -1
- package/src/components/bs5/inpageAlert/InpageAlert.mdx +1 -1
- package/src/components/bs5/inpageAlert/inpageAlert.scss +107 -120
- package/src/components/bs5/inpageAlert/inpageAlert.stories.js +7 -23
- package/src/components/bs5/inpageAlert/manifest.json +1 -0
- package/src/components/bs5/inpagenav/Inpagenav.mdx +1 -1
- package/src/components/bs5/inpagenav/inpagenav.stories.js +4 -6
- package/src/components/bs5/inpagenav/manifest.json +1 -0
- package/src/components/bs5/link/link.mdx +1 -1
- package/src/components/bs5/link/link.stories.js +4 -6
- package/src/components/bs5/linkColumns/linkColumns.mdx +1 -1
- package/src/components/bs5/linkColumns/linkColumns.scss +18 -25
- package/src/components/bs5/logo/Logo.mdx +1 -1
- package/src/components/bs5/logo/logo.hbs +2 -0
- package/src/components/bs5/logo/logoCOADeliveringForQLD.hbs +49 -0
- package/src/components/bs5/logo/logoCOALandscape.hbs +55 -109
- package/src/components/bs5/logo/logoCOALandscape2Lines.hbs +55 -55
- package/src/components/bs5/mainContainerWrapper/manifest.json +1 -0
- package/src/components/bs5/metaDcTerms/manifest.json +1 -0
- package/src/components/bs5/metaOpenGraph/manifest.json +1 -0
- package/src/components/bs5/modal/Modal.mdx +1 -1
- package/src/components/bs5/modal/manifest.json +1 -0
- package/src/components/bs5/navbar/navbar.scss +36 -14
- package/src/components/bs5/pagination/Pagination.mdx +1 -1
- package/src/components/bs5/pagination/manifest.json +1 -0
- package/src/components/bs5/pagination/pagination.stories.js +12 -21
- package/src/components/bs5/promotionalPanel/PromotionalPanel.mdx +1 -1
- package/src/components/bs5/quickexit/manifest.json +1 -0
- package/src/components/bs5/searchInput/SearchInput.js +3 -5
- package/src/components/bs5/searchInput/SearchInput.mdx +1 -1
- package/src/components/bs5/searchInput/__snapshots__/searchInput.test.js.snap +5 -5
- package/src/components/bs5/searchInput/manifest.json +1 -0
- package/src/components/bs5/searchInput/searchInput.hbs +5 -5
- package/src/components/bs5/searchInput/searchInput.scss +13 -0
- package/src/components/bs5/searchInput/searchInput.stories.js +10 -12
- package/src/components/bs5/select/manifest.json +1 -0
- package/src/components/bs5/sidenav/Sidenav.mdx +1 -1
- package/src/components/bs5/sidenav/manifest.json +1 -0
- package/src/components/bs5/sidenav/sidenav.stories.js +4 -7
- package/src/components/bs5/sidenavWrapper/manifest.json +1 -0
- package/src/components/bs5/skiplinks/SkipLinks.mdx +1 -1
- package/src/components/bs5/spinner/manifest.json +1 -0
- package/src/components/bs5/table/Table.mdx +1 -1
- package/src/components/bs5/table/manifest.json +1 -0
- package/src/components/bs5/tabs/Tabs.mdx +1 -1
- package/src/components/bs5/tabs/tabs.data.json +1 -2
- package/src/components/bs5/tabs/tabs.stories.js +38 -215
- package/src/components/bs5/tag/Tag.mdx +1 -1
- package/src/components/bs5/tag/manifest.json +1 -0
- package/src/components/bs5/tag/tag--large.stories.js +53 -0
- package/src/components/bs5/tag/tag--standard.stories.js +39 -0
- package/src/components/bs5/tag/tag--status.stories.js +97 -0
- package/src/components/bs5/tag/tag.scss +67 -36
- package/src/components/bs5/tag/tag.stories.js +69 -106
- package/src/components/bs5/textarea/manifest.json +1 -0
- package/src/components/bs5/textbox/manifest.json +1 -0
- package/src/components/bs5/typography/Typography.mdx +1 -1
- package/src/components/bs5/typography/manifest.json +1 -0
- package/src/components/bs5/typography/typography.data.json +1 -0
- package/src/components/bs5/typography/typography.stories.js +6 -24
- package/src/components/bs5/video/Video.mdx +1 -1
- package/src/components/bs5/video/manifest.json +1 -0
- package/src/components/bs5/video/video.stories.js +6 -24
- package/src/css/main.scss +2 -2
- package/src/css/mixins/_index.scss +1 -0
- package/src/css/mixins/focusable.scss +6 -5
- package/src/css/mixins/make-link.scss +40 -0
- package/src/css/qld-print.scss +426 -304
- package/src/css/qld-theme.scss +16 -8
- package/src/css/qld-type.scss +3 -73
- package/src/css/variables/animation.scss +5 -0
- package/src/img/coa-delivering-for-qld.svg +47 -0
- package/src/img/coa-delivering-for-qld.svg.old +58 -0
- package/src/img/coa-landscape-2lines.svg +63 -0
- package/src/img/coa-landscape-web.svg +56 -0
- package/src/js/handlebars.helpers.js +51 -38
- package/src/js/handlebars.partials.js +12 -10
- package/src/stories/Introduction.mdx +1 -1
- package/vite.config.js +17 -0
- package/.eslintrc.cjs +0 -52
- package/dist/assets/img/_coa_header-logo-qgov--stacked.svg +0 -171
- package/dist/assets/img/_coa_header-logo-qgov-masterbrand.svg +0 -56
- package/dist/assets/img/_coa_preheader-logo-qgov.svg +0 -56
- package/dist/assets/js/bootstrap.js +0 -6312
- package/dist/assets/js/handlebars.helpers.js +0 -292
- package/dist/assets/js/handlebars.init.cjs +0 -6
- package/dist/assets/js/handlebars.init.js +0 -34
- package/dist/components/handlebars.helpers.js +0 -292
- package/dist/components/handlebars.init.cjs +0 -6
- package/dist/components/handlebars.init.js +0 -34
- package/dist/components/handlebars.partials.js +0 -136
- package/src/img/_coa_header-logo-qgov--stacked.svg +0 -171
- package/src/img/_coa_header-logo-qgov-masterbrand.svg +0 -56
- package/src/img/_coa_preheader-logo-qgov.svg +0 -56
|
@@ -1,292 +0,0 @@
|
|
|
1
|
-
/* global Handlebars */
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @param {*} v1 The left value
|
|
6
|
-
* @param { "==" | "===" | "!=" | "!==" | "<" | "<=" | ">" | ">=" | "&&" | "||" | "contains"} operator the operator to handle comparison
|
|
7
|
-
* @param {*} v2 The right value
|
|
8
|
-
* @param {Object} options handlebars-provided options object
|
|
9
|
-
* @returns {string} handlebars template block string
|
|
10
|
-
* @example
|
|
11
|
-
* {{#ifCond value1 "===" value2}}
|
|
12
|
-
* <!-- Content to render if condition is true -->
|
|
13
|
-
* <p>Value1 is strictly equal to Value2</p>
|
|
14
|
-
* {{else}}
|
|
15
|
-
* <!-- Content to render if condition is false -->
|
|
16
|
-
* <p>Value1 is not strictly equal to Value2</p>
|
|
17
|
-
* {{/ifCond}}
|
|
18
|
-
*/
|
|
19
|
-
function ifCond(v1, operator, v2, options) {
|
|
20
|
-
switch (operator) {
|
|
21
|
-
case "==":
|
|
22
|
-
return v1 == v2 ? options.fn(this) : options.inverse(this);
|
|
23
|
-
case "===":
|
|
24
|
-
return v1 === v2 ? options.fn(this) : options.inverse(this);
|
|
25
|
-
case "!=":
|
|
26
|
-
return v1 != v2 ? options.fn(this) : options.inverse(this);
|
|
27
|
-
case "!==":
|
|
28
|
-
return v1 !== v2 ? options.fn(this) : options.inverse(this);
|
|
29
|
-
case "<":
|
|
30
|
-
return v1 < v2 ? options.fn(this) : options.inverse(this);
|
|
31
|
-
case "<=":
|
|
32
|
-
return v1 <= v2 ? options.fn(this) : options.inverse(this);
|
|
33
|
-
case ">":
|
|
34
|
-
return v1 > v2 ? options.fn(this) : options.inverse(this);
|
|
35
|
-
case ">=":
|
|
36
|
-
return v1 >= v2 ? options.fn(this) : options.inverse(this);
|
|
37
|
-
case "&&":
|
|
38
|
-
return v1 && v2 ? options.fn(this) : options.inverse(this);
|
|
39
|
-
case "||":
|
|
40
|
-
return v1 || v2 ? options.fn(this) : options.inverse(this);
|
|
41
|
-
case "contains":
|
|
42
|
-
if (typeof v1 == "string" && typeof v2 == "string") {
|
|
43
|
-
return v1.toLowerCase().indexOf(v2.toLowerCase()) >= 0
|
|
44
|
-
? options.fn(this)
|
|
45
|
-
: options.inverse(this);
|
|
46
|
-
} else return options.inverse(this);
|
|
47
|
-
default:
|
|
48
|
-
return options.inverse(this);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Registers Handlebars Helpers
|
|
53
|
-
* @param {Handlebars} handlebars Templating engine
|
|
54
|
-
* @returns {void} Result of the helper operation
|
|
55
|
-
*/
|
|
56
|
-
|
|
57
|
-
export default function handlebarsHelpers(handlebars) {
|
|
58
|
-
// contains - if first object is in collection (second object) to return true
|
|
59
|
-
handlebars.registerHelper("contains", function (needle, haystack, options) {
|
|
60
|
-
needle = handlebars.escapeExpression(needle);
|
|
61
|
-
haystack = handlebars.escapeExpression(haystack);
|
|
62
|
-
return haystack.indexOf(needle) > -1
|
|
63
|
-
? options.fn(this)
|
|
64
|
-
: options.inverse(this);
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
handlebars.registerHelper("ifCond", ifCond);
|
|
68
|
-
|
|
69
|
-
// isType - Checks is expected type
|
|
70
|
-
handlebars.registerHelper("isType", function (value, expected, options) {
|
|
71
|
-
if (value === expected) {
|
|
72
|
-
return options.fn(this); // Render the block if condition is true
|
|
73
|
-
} else {
|
|
74
|
-
return options.inverse(this); // Render the else block if present
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
// ifAny - {{{#ifAny variable1 variable2 variable3 variable4 etc}}, if any set then return true
|
|
78
|
-
handlebars.registerHelper("ifAny", function (...args) {
|
|
79
|
-
const options = args.pop(); // The last argument is the options object
|
|
80
|
-
return args.some((arg) => !!arg) ? options.fn(this) : options.inverse(this);
|
|
81
|
-
});
|
|
82
|
-
// now - return current timestamp i.e {{now}}
|
|
83
|
-
handlebars.registerHelper("now", function () {
|
|
84
|
-
return new Date().toISOString();
|
|
85
|
-
});
|
|
86
|
-
// formatDate - Format Date, for footer meta data i.e {{formatDate '2023-06-23'}}
|
|
87
|
-
handlebars.registerHelper(
|
|
88
|
-
"formatDate",
|
|
89
|
-
function (dateString, defaultDate, format) {
|
|
90
|
-
// Use the dateString if provided, otherwise use the defaultDate, otherwise error
|
|
91
|
-
let date;
|
|
92
|
-
if (dateString) {
|
|
93
|
-
date = new Date(dateString);
|
|
94
|
-
}
|
|
95
|
-
if (isNaN(date) && defaultDate) {
|
|
96
|
-
date = new Date(defaultDate);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// Check if the date is valid
|
|
100
|
-
if (isNaN(date)) {
|
|
101
|
-
return "Invalid Date";
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
var monthNames = [
|
|
105
|
-
"January",
|
|
106
|
-
"February",
|
|
107
|
-
"March",
|
|
108
|
-
"April",
|
|
109
|
-
"May",
|
|
110
|
-
"June",
|
|
111
|
-
"July",
|
|
112
|
-
"August",
|
|
113
|
-
"September",
|
|
114
|
-
"October",
|
|
115
|
-
"November",
|
|
116
|
-
"December",
|
|
117
|
-
];
|
|
118
|
-
var day = date.getDate();
|
|
119
|
-
var month = monthNames[date.getMonth()];
|
|
120
|
-
var year = date.getFullYear();
|
|
121
|
-
// Format date based on the format string
|
|
122
|
-
switch (format) {
|
|
123
|
-
case "YYYY":
|
|
124
|
-
return `${year}`;
|
|
125
|
-
case "MMMM YYYY":
|
|
126
|
-
return `${month} ${year}`;
|
|
127
|
-
default:
|
|
128
|
-
return `${day} ${month} ${year}`;
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
);
|
|
132
|
-
|
|
133
|
-
// formatDateOrToday - Format Date if passed or today i.e. {{formatDateOrToday '2023-06-23'}} or {{formatDateOrToday}} <!-- This will use the current date -->
|
|
134
|
-
handlebars.registerHelper("formatDateOrToday", function (dateString, format) {
|
|
135
|
-
// Use the current date if dateString is missing or invalid
|
|
136
|
-
const dateToFormat = dateString || new Date().toISOString();
|
|
137
|
-
// Call the formatDate helper with the determined date and format
|
|
138
|
-
return handlebars.helpers.formatDate(dateString, dateToFormat, format);
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Format time duration into a string.
|
|
143
|
-
*
|
|
144
|
-
* Supports two formats: "short" and "long".
|
|
145
|
-
* - Short format: Display the duration in simplified format of "HH:MM:SS". It is the default format.
|
|
146
|
-
* - Long format: Display the duration in descriptive format of "X hours Y minutes Z seconds".
|
|
147
|
-
*
|
|
148
|
-
* @param {Object | String} duration - Duration object with properties: 'hours', 'minutes', and 'seconds'. Duration string: "HH:MM:SS".
|
|
149
|
-
* @param {String} format - Option for format type 'short' or 'long'. If none provided, 'short' is the defaut value.
|
|
150
|
-
*
|
|
151
|
-
* @returns {String} Formatted duration
|
|
152
|
-
* Examples:
|
|
153
|
-
* - 03:00:00 - 3 hours
|
|
154
|
-
* - 03:15:00 - 3 hours 15 minutes
|
|
155
|
-
* - 01:30:45 - 1 hour 30 minutes 45 seconds
|
|
156
|
-
* - 02:00:45 - 2 hours 45 seconds
|
|
157
|
-
* - 07:12 - 7 minutes 12 seconds
|
|
158
|
-
* - 00:45 - 45 seconds
|
|
159
|
-
*
|
|
160
|
-
* Usage:
|
|
161
|
-
* {{formatDuration duration}}
|
|
162
|
-
* {{formatDuration duration "long"}}
|
|
163
|
-
*/
|
|
164
|
-
handlebars.registerHelper("formatDuration", function (duration, format) {
|
|
165
|
-
// Return empty string when there is no duration.
|
|
166
|
-
if (!duration) {
|
|
167
|
-
return "";
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
// Nothing to process here when the duration is already in short format string
|
|
171
|
-
// (to support existing CMS metadata).
|
|
172
|
-
if (typeof duration === "string" && format !== "long") {
|
|
173
|
-
return duration;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
let durationString = "";
|
|
177
|
-
let parts = [];
|
|
178
|
-
let hours, minutes, seconds;
|
|
179
|
-
|
|
180
|
-
// Support for string type 'duration'.
|
|
181
|
-
if (typeof duration === "string") {
|
|
182
|
-
const durationSplit = duration.split(":");
|
|
183
|
-
seconds = durationSplit[0];
|
|
184
|
-
if (durationSplit.length == 2) {
|
|
185
|
-
[minutes = "", seconds = ""] = durationSplit;
|
|
186
|
-
} else if (durationSplit.length == 3) {
|
|
187
|
-
[hours = "", minutes = "", seconds = ""] = durationSplit;
|
|
188
|
-
}
|
|
189
|
-
} else {
|
|
190
|
-
// Support for object type 'duration'.
|
|
191
|
-
[hours = "", minutes = "", seconds = ""] = duration;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
// Long format: "X hours Y minutes Z seconds"
|
|
195
|
-
if (format === "long") {
|
|
196
|
-
if (hours > 0) {
|
|
197
|
-
parts.push(`${hours} hour${hours > 1 ? "s" : ""}`);
|
|
198
|
-
}
|
|
199
|
-
if (minutes > 0) {
|
|
200
|
-
parts.push(`${minutes} minute${minutes > 1 ? "s" : ""}`);
|
|
201
|
-
}
|
|
202
|
-
if (seconds > 0) {
|
|
203
|
-
parts.push(`${seconds} second${seconds > 1 ? "s" : ""}`);
|
|
204
|
-
}
|
|
205
|
-
durationString = parts.join(" ");
|
|
206
|
-
|
|
207
|
-
// Short format: "HH:MM:SS"
|
|
208
|
-
} else {
|
|
209
|
-
// Omitting hours when zero
|
|
210
|
-
if (hours > 0) {
|
|
211
|
-
parts.push(hours.toString().padStart(2, 0));
|
|
212
|
-
}
|
|
213
|
-
parts.push(minutes.toString().padStart(2, 0));
|
|
214
|
-
parts.push(seconds.toString().padStart(2, 0));
|
|
215
|
-
durationString = parts.join(":");
|
|
216
|
-
}
|
|
217
|
-
return durationString;
|
|
218
|
-
});
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* Helper for extending components to set overridable data values
|
|
222
|
-
* If the value is not set in the component data.json, it will use the hds data value
|
|
223
|
-
*
|
|
224
|
-
* @param {string} value - The value to check if it is defined
|
|
225
|
-
* @param {string} defaultValue - The default value to return if value is not defined
|
|
226
|
-
* @returns {string} - The value if it is defined, otherwise the default value
|
|
227
|
-
*/
|
|
228
|
-
handlebars.registerHelper("isdefined", function (value, defaultValue) {
|
|
229
|
-
return value !== undefined && value !== "" ? value : defaultValue;
|
|
230
|
-
});
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* Used to get class names added to an element based on their boolean values in an array
|
|
234
|
-
*
|
|
235
|
-
* @param {string} names - Comma-separated list of class names to check for
|
|
236
|
-
* @param {array} array - Array of objects to check for true values
|
|
237
|
-
* @returns {string} - Space-separated list of class names that have true values
|
|
238
|
-
*/
|
|
239
|
-
handlebars.registerHelper("getClassNames", function (names, array) {
|
|
240
|
-
// Split the comma-separated string of names into an array
|
|
241
|
-
let nameList = names.split(",").map((name) => name.trim());
|
|
242
|
-
|
|
243
|
-
// Create an array to hold the names that have true values
|
|
244
|
-
let matchedItems = [];
|
|
245
|
-
|
|
246
|
-
for (let i = 0; i < nameList.length; i++) {
|
|
247
|
-
let name = nameList[i];
|
|
248
|
-
// Check if any item in the array matches the name and is true
|
|
249
|
-
if (array) {
|
|
250
|
-
for (let j = 0; j < array.length; j++) {
|
|
251
|
-
if (array[j][name] === true) {
|
|
252
|
-
matchedItems.push(name); // Add to matchedItems if found and true
|
|
253
|
-
break;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
// If we found any matched items, return them as a space-separated string
|
|
260
|
-
if (matchedItems.length > 0) {
|
|
261
|
-
return matchedItems.join(" ");
|
|
262
|
-
} else {
|
|
263
|
-
return "";
|
|
264
|
-
}
|
|
265
|
-
});
|
|
266
|
-
|
|
267
|
-
handlebars.registerHelper("join", function (theArray, separator) {
|
|
268
|
-
// Handle if a separator is not provided
|
|
269
|
-
if (!separator || typeof separator !== "string") {
|
|
270
|
-
separator = " ";
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
// If theArray is not an array, return it as is, otherwise join it
|
|
274
|
-
return !Array.isArray(theArray) ? theArray : theArray.join(separator);
|
|
275
|
-
});
|
|
276
|
-
|
|
277
|
-
handlebars.registerHelper("toCamelCase", function (text) {
|
|
278
|
-
if (typeof text !== "string") return text;
|
|
279
|
-
|
|
280
|
-
// Remove whitespace and convert to camelCase
|
|
281
|
-
return text
|
|
282
|
-
.toLowerCase()
|
|
283
|
-
.replace(/(?:^\w|[A-Z]|\b\w|\s+)/g, (match, index) =>
|
|
284
|
-
index === 0 ? match.toLowerCase() : match.toUpperCase(),
|
|
285
|
-
)
|
|
286
|
-
.replace(/\s+/g, ""); // Remove all spaces
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
if (typeof Handlebars !== "undefined") {
|
|
291
|
-
handlebarsHelpers(Handlebars);
|
|
292
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/* global Handlebars */
|
|
2
|
-
import handlebarsHelpers from "./handlebars.helpers.js";
|
|
3
|
-
import handlebarsPartials from "./handlebars.partials.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
let isHandlebarsHelpersAndPartialsRegistered = false;
|
|
7
|
-
|
|
8
|
-
/*
|
|
9
|
-
* init function to load all HandleBar partials and helpers into passed in handlebars
|
|
10
|
-
* by default the helpers and partials will autoload if handleBars is found in environment
|
|
11
|
-
*
|
|
12
|
-
* @param {Handlebars} handlebars
|
|
13
|
-
*/
|
|
14
|
-
export default function init(handlebars) {
|
|
15
|
-
if (typeof(handlebars) === 'undefined') {
|
|
16
|
-
console.error("Handlebars.init requires HandleBars");
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
if(typeof(handlebars) !== 'undefined') {
|
|
20
|
-
if (!isHandlebarsHelpersAndPartialsRegistered) {
|
|
21
|
-
isHandlebarsHelpersAndPartialsRegistered = true;
|
|
22
|
-
} else {
|
|
23
|
-
console.log("HandleBars Helpers And Partials already loaded, loading again")
|
|
24
|
-
}
|
|
25
|
-
handlebarsHelpers(handlebars);
|
|
26
|
-
|
|
27
|
-
handlebarsPartials(handlebars);
|
|
28
|
-
} else {
|
|
29
|
-
console.log("Handlebars not found, init failed");
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
if(typeof(Handlebars) !== 'undefined') {
|
|
33
|
-
init(Handlebars);
|
|
34
|
-
}
|
|
@@ -1,292 +0,0 @@
|
|
|
1
|
-
/* global Handlebars */
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @param {*} v1 The left value
|
|
6
|
-
* @param { "==" | "===" | "!=" | "!==" | "<" | "<=" | ">" | ">=" | "&&" | "||" | "contains"} operator the operator to handle comparison
|
|
7
|
-
* @param {*} v2 The right value
|
|
8
|
-
* @param {Object} options handlebars-provided options object
|
|
9
|
-
* @returns {string} handlebars template block string
|
|
10
|
-
* @example
|
|
11
|
-
* {{#ifCond value1 "===" value2}}
|
|
12
|
-
* <!-- Content to render if condition is true -->
|
|
13
|
-
* <p>Value1 is strictly equal to Value2</p>
|
|
14
|
-
* {{else}}
|
|
15
|
-
* <!-- Content to render if condition is false -->
|
|
16
|
-
* <p>Value1 is not strictly equal to Value2</p>
|
|
17
|
-
* {{/ifCond}}
|
|
18
|
-
*/
|
|
19
|
-
function ifCond(v1, operator, v2, options) {
|
|
20
|
-
switch (operator) {
|
|
21
|
-
case "==":
|
|
22
|
-
return v1 == v2 ? options.fn(this) : options.inverse(this);
|
|
23
|
-
case "===":
|
|
24
|
-
return v1 === v2 ? options.fn(this) : options.inverse(this);
|
|
25
|
-
case "!=":
|
|
26
|
-
return v1 != v2 ? options.fn(this) : options.inverse(this);
|
|
27
|
-
case "!==":
|
|
28
|
-
return v1 !== v2 ? options.fn(this) : options.inverse(this);
|
|
29
|
-
case "<":
|
|
30
|
-
return v1 < v2 ? options.fn(this) : options.inverse(this);
|
|
31
|
-
case "<=":
|
|
32
|
-
return v1 <= v2 ? options.fn(this) : options.inverse(this);
|
|
33
|
-
case ">":
|
|
34
|
-
return v1 > v2 ? options.fn(this) : options.inverse(this);
|
|
35
|
-
case ">=":
|
|
36
|
-
return v1 >= v2 ? options.fn(this) : options.inverse(this);
|
|
37
|
-
case "&&":
|
|
38
|
-
return v1 && v2 ? options.fn(this) : options.inverse(this);
|
|
39
|
-
case "||":
|
|
40
|
-
return v1 || v2 ? options.fn(this) : options.inverse(this);
|
|
41
|
-
case "contains":
|
|
42
|
-
if (typeof v1 == "string" && typeof v2 == "string") {
|
|
43
|
-
return v1.toLowerCase().indexOf(v2.toLowerCase()) >= 0
|
|
44
|
-
? options.fn(this)
|
|
45
|
-
: options.inverse(this);
|
|
46
|
-
} else return options.inverse(this);
|
|
47
|
-
default:
|
|
48
|
-
return options.inverse(this);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Registers Handlebars Helpers
|
|
53
|
-
* @param {Handlebars} handlebars Templating engine
|
|
54
|
-
* @returns {void} Result of the helper operation
|
|
55
|
-
*/
|
|
56
|
-
|
|
57
|
-
export default function handlebarsHelpers(handlebars) {
|
|
58
|
-
// contains - if first object is in collection (second object) to return true
|
|
59
|
-
handlebars.registerHelper("contains", function (needle, haystack, options) {
|
|
60
|
-
needle = handlebars.escapeExpression(needle);
|
|
61
|
-
haystack = handlebars.escapeExpression(haystack);
|
|
62
|
-
return haystack.indexOf(needle) > -1
|
|
63
|
-
? options.fn(this)
|
|
64
|
-
: options.inverse(this);
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
handlebars.registerHelper("ifCond", ifCond);
|
|
68
|
-
|
|
69
|
-
// isType - Checks is expected type
|
|
70
|
-
handlebars.registerHelper("isType", function (value, expected, options) {
|
|
71
|
-
if (value === expected) {
|
|
72
|
-
return options.fn(this); // Render the block if condition is true
|
|
73
|
-
} else {
|
|
74
|
-
return options.inverse(this); // Render the else block if present
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
// ifAny - {{{#ifAny variable1 variable2 variable3 variable4 etc}}, if any set then return true
|
|
78
|
-
handlebars.registerHelper("ifAny", function (...args) {
|
|
79
|
-
const options = args.pop(); // The last argument is the options object
|
|
80
|
-
return args.some((arg) => !!arg) ? options.fn(this) : options.inverse(this);
|
|
81
|
-
});
|
|
82
|
-
// now - return current timestamp i.e {{now}}
|
|
83
|
-
handlebars.registerHelper("now", function () {
|
|
84
|
-
return new Date().toISOString();
|
|
85
|
-
});
|
|
86
|
-
// formatDate - Format Date, for footer meta data i.e {{formatDate '2023-06-23'}}
|
|
87
|
-
handlebars.registerHelper(
|
|
88
|
-
"formatDate",
|
|
89
|
-
function (dateString, defaultDate, format) {
|
|
90
|
-
// Use the dateString if provided, otherwise use the defaultDate, otherwise error
|
|
91
|
-
let date;
|
|
92
|
-
if (dateString) {
|
|
93
|
-
date = new Date(dateString);
|
|
94
|
-
}
|
|
95
|
-
if (isNaN(date) && defaultDate) {
|
|
96
|
-
date = new Date(defaultDate);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// Check if the date is valid
|
|
100
|
-
if (isNaN(date)) {
|
|
101
|
-
return "Invalid Date";
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
var monthNames = [
|
|
105
|
-
"January",
|
|
106
|
-
"February",
|
|
107
|
-
"March",
|
|
108
|
-
"April",
|
|
109
|
-
"May",
|
|
110
|
-
"June",
|
|
111
|
-
"July",
|
|
112
|
-
"August",
|
|
113
|
-
"September",
|
|
114
|
-
"October",
|
|
115
|
-
"November",
|
|
116
|
-
"December",
|
|
117
|
-
];
|
|
118
|
-
var day = date.getDate();
|
|
119
|
-
var month = monthNames[date.getMonth()];
|
|
120
|
-
var year = date.getFullYear();
|
|
121
|
-
// Format date based on the format string
|
|
122
|
-
switch (format) {
|
|
123
|
-
case "YYYY":
|
|
124
|
-
return `${year}`;
|
|
125
|
-
case "MMMM YYYY":
|
|
126
|
-
return `${month} ${year}`;
|
|
127
|
-
default:
|
|
128
|
-
return `${day} ${month} ${year}`;
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
);
|
|
132
|
-
|
|
133
|
-
// formatDateOrToday - Format Date if passed or today i.e. {{formatDateOrToday '2023-06-23'}} or {{formatDateOrToday}} <!-- This will use the current date -->
|
|
134
|
-
handlebars.registerHelper("formatDateOrToday", function (dateString, format) {
|
|
135
|
-
// Use the current date if dateString is missing or invalid
|
|
136
|
-
const dateToFormat = dateString || new Date().toISOString();
|
|
137
|
-
// Call the formatDate helper with the determined date and format
|
|
138
|
-
return handlebars.helpers.formatDate(dateString, dateToFormat, format);
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Format time duration into a string.
|
|
143
|
-
*
|
|
144
|
-
* Supports two formats: "short" and "long".
|
|
145
|
-
* - Short format: Display the duration in simplified format of "HH:MM:SS". It is the default format.
|
|
146
|
-
* - Long format: Display the duration in descriptive format of "X hours Y minutes Z seconds".
|
|
147
|
-
*
|
|
148
|
-
* @param {Object | String} duration - Duration object with properties: 'hours', 'minutes', and 'seconds'. Duration string: "HH:MM:SS".
|
|
149
|
-
* @param {String} format - Option for format type 'short' or 'long'. If none provided, 'short' is the defaut value.
|
|
150
|
-
*
|
|
151
|
-
* @returns {String} Formatted duration
|
|
152
|
-
* Examples:
|
|
153
|
-
* - 03:00:00 - 3 hours
|
|
154
|
-
* - 03:15:00 - 3 hours 15 minutes
|
|
155
|
-
* - 01:30:45 - 1 hour 30 minutes 45 seconds
|
|
156
|
-
* - 02:00:45 - 2 hours 45 seconds
|
|
157
|
-
* - 07:12 - 7 minutes 12 seconds
|
|
158
|
-
* - 00:45 - 45 seconds
|
|
159
|
-
*
|
|
160
|
-
* Usage:
|
|
161
|
-
* {{formatDuration duration}}
|
|
162
|
-
* {{formatDuration duration "long"}}
|
|
163
|
-
*/
|
|
164
|
-
handlebars.registerHelper("formatDuration", function (duration, format) {
|
|
165
|
-
// Return empty string when there is no duration.
|
|
166
|
-
if (!duration) {
|
|
167
|
-
return "";
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
// Nothing to process here when the duration is already in short format string
|
|
171
|
-
// (to support existing CMS metadata).
|
|
172
|
-
if (typeof duration === "string" && format !== "long") {
|
|
173
|
-
return duration;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
let durationString = "";
|
|
177
|
-
let parts = [];
|
|
178
|
-
let hours, minutes, seconds;
|
|
179
|
-
|
|
180
|
-
// Support for string type 'duration'.
|
|
181
|
-
if (typeof duration === "string") {
|
|
182
|
-
const durationSplit = duration.split(":");
|
|
183
|
-
seconds = durationSplit[0];
|
|
184
|
-
if (durationSplit.length == 2) {
|
|
185
|
-
[minutes = "", seconds = ""] = durationSplit;
|
|
186
|
-
} else if (durationSplit.length == 3) {
|
|
187
|
-
[hours = "", minutes = "", seconds = ""] = durationSplit;
|
|
188
|
-
}
|
|
189
|
-
} else {
|
|
190
|
-
// Support for object type 'duration'.
|
|
191
|
-
[hours = "", minutes = "", seconds = ""] = duration;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
// Long format: "X hours Y minutes Z seconds"
|
|
195
|
-
if (format === "long") {
|
|
196
|
-
if (hours > 0) {
|
|
197
|
-
parts.push(`${hours} hour${hours > 1 ? "s" : ""}`);
|
|
198
|
-
}
|
|
199
|
-
if (minutes > 0) {
|
|
200
|
-
parts.push(`${minutes} minute${minutes > 1 ? "s" : ""}`);
|
|
201
|
-
}
|
|
202
|
-
if (seconds > 0) {
|
|
203
|
-
parts.push(`${seconds} second${seconds > 1 ? "s" : ""}`);
|
|
204
|
-
}
|
|
205
|
-
durationString = parts.join(" ");
|
|
206
|
-
|
|
207
|
-
// Short format: "HH:MM:SS"
|
|
208
|
-
} else {
|
|
209
|
-
// Omitting hours when zero
|
|
210
|
-
if (hours > 0) {
|
|
211
|
-
parts.push(hours.toString().padStart(2, 0));
|
|
212
|
-
}
|
|
213
|
-
parts.push(minutes.toString().padStart(2, 0));
|
|
214
|
-
parts.push(seconds.toString().padStart(2, 0));
|
|
215
|
-
durationString = parts.join(":");
|
|
216
|
-
}
|
|
217
|
-
return durationString;
|
|
218
|
-
});
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* Helper for extending components to set overridable data values
|
|
222
|
-
* If the value is not set in the component data.json, it will use the hds data value
|
|
223
|
-
*
|
|
224
|
-
* @param {string} value - The value to check if it is defined
|
|
225
|
-
* @param {string} defaultValue - The default value to return if value is not defined
|
|
226
|
-
* @returns {string} - The value if it is defined, otherwise the default value
|
|
227
|
-
*/
|
|
228
|
-
handlebars.registerHelper("isdefined", function (value, defaultValue) {
|
|
229
|
-
return value !== undefined && value !== "" ? value : defaultValue;
|
|
230
|
-
});
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* Used to get class names added to an element based on their boolean values in an array
|
|
234
|
-
*
|
|
235
|
-
* @param {string} names - Comma-separated list of class names to check for
|
|
236
|
-
* @param {array} array - Array of objects to check for true values
|
|
237
|
-
* @returns {string} - Space-separated list of class names that have true values
|
|
238
|
-
*/
|
|
239
|
-
handlebars.registerHelper("getClassNames", function (names, array) {
|
|
240
|
-
// Split the comma-separated string of names into an array
|
|
241
|
-
let nameList = names.split(",").map((name) => name.trim());
|
|
242
|
-
|
|
243
|
-
// Create an array to hold the names that have true values
|
|
244
|
-
let matchedItems = [];
|
|
245
|
-
|
|
246
|
-
for (let i = 0; i < nameList.length; i++) {
|
|
247
|
-
let name = nameList[i];
|
|
248
|
-
// Check if any item in the array matches the name and is true
|
|
249
|
-
if (array) {
|
|
250
|
-
for (let j = 0; j < array.length; j++) {
|
|
251
|
-
if (array[j][name] === true) {
|
|
252
|
-
matchedItems.push(name); // Add to matchedItems if found and true
|
|
253
|
-
break;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
// If we found any matched items, return them as a space-separated string
|
|
260
|
-
if (matchedItems.length > 0) {
|
|
261
|
-
return matchedItems.join(" ");
|
|
262
|
-
} else {
|
|
263
|
-
return "";
|
|
264
|
-
}
|
|
265
|
-
});
|
|
266
|
-
|
|
267
|
-
handlebars.registerHelper("join", function (theArray, separator) {
|
|
268
|
-
// Handle if a separator is not provided
|
|
269
|
-
if (!separator || typeof separator !== "string") {
|
|
270
|
-
separator = " ";
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
// If theArray is not an array, return it as is, otherwise join it
|
|
274
|
-
return !Array.isArray(theArray) ? theArray : theArray.join(separator);
|
|
275
|
-
});
|
|
276
|
-
|
|
277
|
-
handlebars.registerHelper("toCamelCase", function (text) {
|
|
278
|
-
if (typeof text !== "string") return text;
|
|
279
|
-
|
|
280
|
-
// Remove whitespace and convert to camelCase
|
|
281
|
-
return text
|
|
282
|
-
.toLowerCase()
|
|
283
|
-
.replace(/(?:^\w|[A-Z]|\b\w|\s+)/g, (match, index) =>
|
|
284
|
-
index === 0 ? match.toLowerCase() : match.toUpperCase(),
|
|
285
|
-
)
|
|
286
|
-
.replace(/\s+/g, ""); // Remove all spaces
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
if (typeof Handlebars !== "undefined") {
|
|
291
|
-
handlebarsHelpers(Handlebars);
|
|
292
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/* global Handlebars */
|
|
2
|
-
import handlebarsHelpers from "./handlebars.helpers.js";
|
|
3
|
-
import handlebarsPartials from "./handlebars.partials.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
let isHandlebarsHelpersAndPartialsRegistered = false;
|
|
7
|
-
|
|
8
|
-
/*
|
|
9
|
-
* init function to load all HandleBar partials and helpers into passed in handlebars
|
|
10
|
-
* by default the helpers and partials will autoload if handleBars is found in environment
|
|
11
|
-
*
|
|
12
|
-
* @param {Handlebars} handlebars
|
|
13
|
-
*/
|
|
14
|
-
export default function init(handlebars) {
|
|
15
|
-
if (typeof(handlebars) === 'undefined') {
|
|
16
|
-
console.error("Handlebars.init requires HandleBars");
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
if(typeof(handlebars) !== 'undefined') {
|
|
20
|
-
if (!isHandlebarsHelpersAndPartialsRegistered) {
|
|
21
|
-
isHandlebarsHelpersAndPartialsRegistered = true;
|
|
22
|
-
} else {
|
|
23
|
-
console.log("HandleBars Helpers And Partials already loaded, loading again")
|
|
24
|
-
}
|
|
25
|
-
handlebarsHelpers(handlebars);
|
|
26
|
-
|
|
27
|
-
handlebarsPartials(handlebars);
|
|
28
|
-
} else {
|
|
29
|
-
console.log("Handlebars not found, init failed");
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
if(typeof(Handlebars) !== 'undefined') {
|
|
33
|
-
init(Handlebars);
|
|
34
|
-
}
|