@icvdeveloper/common-module 0.0.52 → 0.0.54
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/dist/module.json +1 -1
- package/dist/runtime/composables/useAdobeLaunch.d.ts +7 -0
- package/dist/runtime/composables/useAdobeLaunch.mjs +19 -0
- package/dist/runtime/composables/useConferenceHelpers.d.ts +1 -1
- package/dist/runtime/composables/useConferenceHelpers.mjs +46 -23
- package/dist/runtime/plugin.mjs +10 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useRouter } from "vue-router";
|
|
2
|
+
import { get } from "lodash-es";
|
|
3
|
+
export const useAdobeLaunch = () => {
|
|
4
|
+
const router = useRouter();
|
|
5
|
+
const loadAdobeLaunch = (scriptSrc) => {
|
|
6
|
+
let adtm = document.createElement("script");
|
|
7
|
+
adtm.setAttribute("src", scriptSrc);
|
|
8
|
+
document.head.appendChild(adtm);
|
|
9
|
+
router.afterEach((to, from) => {
|
|
10
|
+
if (get(window, "_satellite.track", false)) {
|
|
11
|
+
window._satellite.setDebug(true);
|
|
12
|
+
window._satellite.track("spaPageView");
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
return {
|
|
17
|
+
loadAdobeLaunch
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -20,7 +20,7 @@ export type UseConferenceHelpersMethods = {
|
|
|
20
20
|
/**
|
|
21
21
|
* Get conference display date.
|
|
22
22
|
*/
|
|
23
|
-
getConferenceDisplayDate: (_conference?: Conference) => string;
|
|
23
|
+
getConferenceDisplayDate: (_conference?: Conference, showDate: boolean, showTime: boolean, showEndTime: boolean) => string;
|
|
24
24
|
/**
|
|
25
25
|
* Determine if show view archive button should be shown
|
|
26
26
|
*/
|
|
@@ -66,38 +66,61 @@ export const useConferenceHelpers = (conference) => {
|
|
|
66
66
|
const viewNowAliasText = globalConfigValue.value("view_now_button_alias");
|
|
67
67
|
return viewNowAliasText || "View Now";
|
|
68
68
|
};
|
|
69
|
-
const getConferenceDisplayDate = (_conference) => {
|
|
69
|
+
const getConferenceDisplayDate = (_conference, showDate = true, showTime = false, showEndTime = false) => {
|
|
70
70
|
const _selectedConference = _getSelectedConference(_conference);
|
|
71
71
|
const startDate = _selectedConference.start_date;
|
|
72
72
|
const endDate = _selectedConference.end_date;
|
|
73
|
+
let returnDate = "";
|
|
73
74
|
const tzFormat = pagesConfigValue.value("main.use_event_text_tz") ? " zzz" : "";
|
|
74
75
|
if (isSingleDayEvent()) {
|
|
75
|
-
const
|
|
76
|
-
|
|
76
|
+
const startFormat = "MMMM do, yyyy ";
|
|
77
|
+
if (showDate) {
|
|
78
|
+
returnDate += formatTimezoneToLocal(
|
|
79
|
+
startDate,
|
|
80
|
+
startFormat,
|
|
81
|
+
_selectedConference.timezone
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
if (showTime) {
|
|
85
|
+
returnDate += formatTimezoneToLocal(
|
|
86
|
+
startDate,
|
|
87
|
+
"h:mm a",
|
|
88
|
+
_selectedConference.timezone
|
|
89
|
+
);
|
|
90
|
+
if (showEndTime) {
|
|
91
|
+
returnDate += " - " + formatTimezoneToLocal(
|
|
92
|
+
endDate,
|
|
93
|
+
"h:mm a",
|
|
94
|
+
_selectedConference.timezone
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
returnDate += formatTimezoneToLocal(
|
|
98
|
+
startDate,
|
|
99
|
+
tzFormat,
|
|
100
|
+
_selectedConference.timezone
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
} else if (showDate) {
|
|
104
|
+
let startFormat = "MMMM do";
|
|
105
|
+
if (format(parseISO(startDate), "yyyy") !== format(parseISO(endDate), "yyyy")) {
|
|
106
|
+
startFormat += ", yyyy";
|
|
107
|
+
}
|
|
108
|
+
returnDate += formatTimezoneToLocal(
|
|
77
109
|
startDate,
|
|
78
|
-
|
|
110
|
+
startFormat,
|
|
111
|
+
_selectedConference.timezone
|
|
112
|
+
);
|
|
113
|
+
returnDate += " - ";
|
|
114
|
+
let endFormat = "do, yyyy" + tzFormat;
|
|
115
|
+
if (format(parseISO(startDate), "MMMM") !== format(parseISO(endDate), "MMMM") || format(parseISO(startDate), "yyyy") !== format(parseISO(endDate), "yyyy")) {
|
|
116
|
+
endFormat = "MMMM " + endFormat;
|
|
117
|
+
}
|
|
118
|
+
returnDate += formatTimezoneToLocal(
|
|
119
|
+
endDate,
|
|
120
|
+
endFormat,
|
|
79
121
|
_selectedConference.timezone
|
|
80
122
|
);
|
|
81
123
|
}
|
|
82
|
-
let startFormat = "MMMM d";
|
|
83
|
-
if (format(parseISO(startDate), "yyyy") !== format(parseISO(endDate), "yyyy")) {
|
|
84
|
-
startFormat += ", yyyy";
|
|
85
|
-
}
|
|
86
|
-
let returnDate = formatTimezoneToLocal(
|
|
87
|
-
startDate,
|
|
88
|
-
startFormat,
|
|
89
|
-
_selectedConference.timezone
|
|
90
|
-
);
|
|
91
|
-
returnDate += " - ";
|
|
92
|
-
let endFormat = "d, yyyy" + tzFormat;
|
|
93
|
-
if (format(parseISO(startDate), "MMMM") !== format(parseISO(endDate), "MMMM") || format(parseISO(startDate), "yyyy") !== format(parseISO(endDate), "yyyy")) {
|
|
94
|
-
endFormat = "MMMM " + endFormat;
|
|
95
|
-
}
|
|
96
|
-
returnDate += formatTimezoneToLocal(
|
|
97
|
-
endDate,
|
|
98
|
-
endFormat,
|
|
99
|
-
_selectedConference.timezone
|
|
100
|
-
);
|
|
101
124
|
return returnDate;
|
|
102
125
|
};
|
|
103
126
|
const showViewArchiveButton = (_conference) => {
|
package/dist/runtime/plugin.mjs
CHANGED
|
@@ -5,6 +5,7 @@ import NProgress from "nprogress";
|
|
|
5
5
|
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";
|
|
6
6
|
import { createV3plusCommonPlugin } from "./v3plusCommonPlugin.mjs";
|
|
7
7
|
import { usePortalStore } from "./store/portal.mjs";
|
|
8
|
+
import { useTemplateConfigsStore } from "./store/templateConfigs.mjs";
|
|
8
9
|
import { useConferencesStore } from "./store/conferences.mjs";
|
|
9
10
|
export default defineNuxtPlugin((nuxtApp) => {
|
|
10
11
|
const { version, portalHash, apiUrl } = nuxtApp.payload.config.public.v3plusCommonModule;
|
|
@@ -37,6 +38,9 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
37
38
|
});
|
|
38
39
|
nuxtApp.hook("app:created", (app) => {
|
|
39
40
|
const { data } = storeToRefs(usePortalStore());
|
|
41
|
+
const { globalConfigValue } = useTemplateConfigsStore();
|
|
42
|
+
let customCss = globalConfigValue("custom_css");
|
|
43
|
+
customCss = customCss.length > 0 ? customCss.replace(/\n/g, "") : "";
|
|
40
44
|
if (data.value) {
|
|
41
45
|
app.config.globalProperties.$head.addHeadObjs(
|
|
42
46
|
computed(() => {
|
|
@@ -48,6 +52,12 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
48
52
|
type: "image/x-icon",
|
|
49
53
|
href: data.value.favicon
|
|
50
54
|
}
|
|
55
|
+
],
|
|
56
|
+
style: [
|
|
57
|
+
{
|
|
58
|
+
type: "text/css",
|
|
59
|
+
children: customCss
|
|
60
|
+
}
|
|
51
61
|
]
|
|
52
62
|
};
|
|
53
63
|
})
|