diff --git a/pages/index.vue b/pages/index.vue index f91db0e46..2c2a6d9e8 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -45,9 +45,11 @@ export default { themeChangeListener: null, mounted() { let afId = this.$route.query['af_id']; + if (afId) { let today = new Date(); let expire = new Date(); + expire.setTime(today.getTime() + 3600000 * 24 * 7); document.cookie = 'primeaffiliateid=' + afId + ';expires=' + expire.toUTCString() + ';path=/; domain:primefaces.org'; } @@ -75,6 +77,7 @@ export default { const newThemeUrl = linkElement.getAttribute('href').replace(currentTableTheme, newTheme); const cloneLinkElement = linkElement.cloneNode(true); + cloneLinkElement.setAttribute('id', elementId + '-clone'); cloneLinkElement.setAttribute('href', newThemeUrl); cloneLinkElement.addEventListener('load', () => { diff --git a/plugins/appState.js b/plugins/appState.js index 56d37e726..d0474b21d 100644 --- a/plugins/appState.js +++ b/plugins/appState.js @@ -3,6 +3,7 @@ const $appState = { Vue.config.globalProperties.$appState = reactive({ theme: 'lara-light-blue', darkTheme: false, codeSandbox: false, sourceType: 'options-api', newsActive: process.env.NODE_ENV === 'production', announcement: {} }); } }; + export default defineNuxtPlugin((nuxtApp) => { nuxtApp.vueApp.use($appState); });