add-to-calendar-button 2.10.0 → 2.11.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/CHANGELOG.md +1 -0
- package/assets/css/atcb-3d.css +1 -1
- package/assets/css/atcb-date.css +1 -1
- package/assets/css/atcb-flat.css +1 -1
- package/assets/css/atcb-neumorphism.css +1 -1
- package/assets/css/atcb-round.css +1 -1
- package/assets/css/atcb-simple.css +1 -1
- package/assets/css/atcb-text.css +1 -1
- package/assets/css/atcb.css +1 -1
- package/dist/atcb-no-pro-unstyle.js +92 -125
- package/dist/atcb-no-pro.js +92 -125
- package/dist/atcb-unstyle.js +92 -125
- package/dist/atcb.js +92 -125
- package/dist/commonjs/index.js +92 -125
- package/dist/commonjs/no-pro/index.js +92 -125
- package/dist/commonjs/no-pro-unstyle/index.js +92 -125
- package/dist/commonjs/unstyle/index.js +92 -125
- package/dist/module/index.js +92 -125
- package/dist/module/no-pro/index.js +92 -125
- package/dist/module/no-pro-unstyle/index.js +92 -125
- package/dist/module/unstyle/index.js +92 -125
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Version 2
|
|
4
4
|
|
|
5
|
+
- v2.11 : ⚠️ Breaking: When setting the dates objects and respective attributes on the root level, root values always override the dates object (except for name in the multi-date case)
|
|
5
6
|
- v2.10 : Hungarian language, no more X cursor, no different button icons for oneOption cases, create 1 ics file if organizer is the same, subtle style updates, allow to override automatic option-cleanup on mobile via mobile Options
|
|
6
7
|
- v2.9 : New style "simple", better ical generation
|
|
7
8
|
- v2.8 : Ukranian language
|
package/assets/css/atcb-3d.css
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Style: 3D
|
|
7
7
|
*
|
|
8
|
-
* Version: 2.
|
|
8
|
+
* Version: 2.11.0
|
|
9
9
|
* Creator: Jens Kuerschner (https://jekuer.com)
|
|
10
10
|
* Project: https://github.com/add2cal/add-to-calendar-button
|
|
11
11
|
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
|
package/assets/css/atcb-date.css
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Style: Date
|
|
7
7
|
*
|
|
8
|
-
* Version: 2.
|
|
8
|
+
* Version: 2.11.0
|
|
9
9
|
* Creator: Jens Kuerschner (https://jekuer.com)
|
|
10
10
|
* Project: https://github.com/add2cal/add-to-calendar-button
|
|
11
11
|
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
|
package/assets/css/atcb-flat.css
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Style: Flat
|
|
7
7
|
*
|
|
8
|
-
* Version: 2.
|
|
8
|
+
* Version: 2.11.0
|
|
9
9
|
* Creator: Jens Kuerschner (https://jekuer.com)
|
|
10
10
|
* Project: https://github.com/add2cal/add-to-calendar-button
|
|
11
11
|
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Style: Neumorphism
|
|
7
7
|
*
|
|
8
|
-
* Version: 2.
|
|
8
|
+
* Version: 2.11.0
|
|
9
9
|
* Creator: Jens Kuerschner (https://jekuer.com)
|
|
10
10
|
* Project: https://github.com/add2cal/add-to-calendar-button
|
|
11
11
|
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Style: Round
|
|
7
7
|
*
|
|
8
|
-
* Version: 2.
|
|
8
|
+
* Version: 2.11.0
|
|
9
9
|
* Creator: Jens Kuerschner (https://jekuer.com)
|
|
10
10
|
* Project: https://github.com/add2cal/add-to-calendar-button
|
|
11
11
|
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Style: Simple
|
|
7
7
|
*
|
|
8
|
-
* Version: 2.
|
|
8
|
+
* Version: 2.11.0
|
|
9
9
|
* Creator: Jens Kuerschner (https://jekuer.com)
|
|
10
10
|
* Project: https://github.com/add2cal/add-to-calendar-button
|
|
11
11
|
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
|
package/assets/css/atcb-text.css
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Style: Text
|
|
7
7
|
*
|
|
8
|
-
* Version: 2.
|
|
8
|
+
* Version: 2.11.0
|
|
9
9
|
* Creator: Jens Kuerschner (https://jekuer.com)
|
|
10
10
|
* Project: https://github.com/add2cal/add-to-calendar-button
|
|
11
11
|
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
|
package/assets/css/atcb.css
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Style: Default
|
|
7
7
|
*
|
|
8
|
-
* Version: 2.
|
|
8
|
+
* Version: 2.11.0
|
|
9
9
|
* Creator: Jens Kuerschner (https://jekuer.com)
|
|
10
10
|
* Project: https://github.com/add2cal/add-to-calendar-button
|
|
11
11
|
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
|
|
@@ -223,14 +223,14 @@ function tzlib_get_timezones(jsonType = false) {
|
|
|
223
223
|
* Add to Calendar Button
|
|
224
224
|
* ++++++++++++++++++++++
|
|
225
225
|
*
|
|
226
|
-
* Version: 2.
|
|
226
|
+
* Version: 2.11.0
|
|
227
227
|
* Creator: Jens Kuerschner (https://jekuer.com)
|
|
228
228
|
* Project: https://github.com/add2cal/add-to-calendar-button
|
|
229
229
|
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
|
|
230
230
|
* Note: DO NOT REMOVE THE COPYRIGHT NOTICE ABOVE!
|
|
231
231
|
*
|
|
232
232
|
*/
|
|
233
|
-
const atcbVersion = '2.
|
|
233
|
+
const atcbVersion = '2.11.0';
|
|
234
234
|
const atcbCssTemplate = {};
|
|
235
235
|
const atcbIsBrowser = () => {
|
|
236
236
|
if (typeof window === 'undefined') {
|
|
@@ -487,7 +487,7 @@ const atcbIcon = {
|
|
|
487
487
|
|
|
488
488
|
async function atcb_decorate_data(data) {
|
|
489
489
|
data = atcb_decorate_data_boolean(data);
|
|
490
|
-
data
|
|
490
|
+
data = atcb_decorate_data_defaults(data);
|
|
491
491
|
data = atcb_decorate_data_rrule(data);
|
|
492
492
|
data = atcb_decorate_data_options(data);
|
|
493
493
|
data = atcb_decorate_data_style(data);
|
|
@@ -495,8 +495,6 @@ async function atcb_decorate_data(data) {
|
|
|
495
495
|
data.lightMode = atcb_decorate_light_mode(data.lightMode);
|
|
496
496
|
data = atcb_decorate_data_i18n(data);
|
|
497
497
|
data = atcb_decorate_data_dates(data);
|
|
498
|
-
data = atcb_decorate_data_meta(data);
|
|
499
|
-
data = atcb_decorate_data_extend(data);
|
|
500
498
|
data = atcb_decorate_data_button_status_handling(data);
|
|
501
499
|
data = await atcb_decorate_data_rsvp(data);
|
|
502
500
|
return data;
|
|
@@ -515,11 +513,20 @@ function atcb_decorate_data_boolean(data) {
|
|
|
515
513
|
}
|
|
516
514
|
return data;
|
|
517
515
|
}
|
|
518
|
-
function
|
|
519
|
-
if (!
|
|
520
|
-
|
|
516
|
+
function atcb_decorate_data_defaults(data) {
|
|
517
|
+
if (!data.timeZone || data.timeZone === '') {
|
|
518
|
+
data.timeZone = 'GMT';
|
|
521
519
|
}
|
|
522
|
-
|
|
520
|
+
if (!data.status || data.status === '') {
|
|
521
|
+
data.status = 'CONFIRMED';
|
|
522
|
+
}
|
|
523
|
+
if (!data.sequence || data.sequence === '') {
|
|
524
|
+
data.sequence = 0;
|
|
525
|
+
}
|
|
526
|
+
if (!data.language || data.language === '' || !availableLanguages.includes(data.language)) {
|
|
527
|
+
data.language = 'en';
|
|
528
|
+
}
|
|
529
|
+
return data;
|
|
523
530
|
}
|
|
524
531
|
function atcb_decorate_data_rrule(data) {
|
|
525
532
|
if (data.recurrence && data.recurrence !== '') {
|
|
@@ -725,9 +732,6 @@ function atcb_decorate_light_mode(lightMode = '') {
|
|
|
725
732
|
return lightMode;
|
|
726
733
|
}
|
|
727
734
|
function atcb_decorate_data_i18n(data) {
|
|
728
|
-
if (!data.language || data.language === '' || !availableLanguages.includes(data.language)) {
|
|
729
|
-
data.language = 'en';
|
|
730
|
-
}
|
|
731
735
|
if (data.language.length > 2) {
|
|
732
736
|
data.language = data.language.substring(0, 2);
|
|
733
737
|
}
|
|
@@ -739,38 +743,20 @@ function atcb_decorate_data_i18n(data) {
|
|
|
739
743
|
return data;
|
|
740
744
|
}
|
|
741
745
|
function atcb_decorate_data_dates(data) {
|
|
742
|
-
if (data.dates
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
data.dates[`${i}`].timestamp = atcb_date_specials_calculation('timestamp', data.dates[`${i}`].startDate, data.dates[`${i}`].startTime, data.dates[`${i}`].timeZone);
|
|
757
|
-
data.dates[`${i}`].overdue = atcb_date_specials_calculation('overdue', data.dates[`${i}`].endDate, data.dates[`${i}`].endTime, data.dates[`${i}`].timeZone);
|
|
758
|
-
}
|
|
759
|
-
} else {
|
|
760
|
-
data.dates = [];
|
|
761
|
-
data.dates[0] = new Object();
|
|
762
|
-
if (data.useUserTZ) data.dates[0].useUserTZ = data.useUserTZ;
|
|
763
|
-
const cleanedUpDates = atcb_date_cleanup(data);
|
|
764
|
-
data.startDate = data.dates[0].startDate = cleanedUpDates.startDate;
|
|
765
|
-
data.endDate = data.dates[0].endDate = cleanedUpDates.endDate;
|
|
766
|
-
data.startTime = data.dates[0].startTime = cleanedUpDates.startTime;
|
|
767
|
-
data.endTime = data.dates[0].endTime = cleanedUpDates.endTime;
|
|
768
|
-
data.timeZone = data.dates[0].timeZone = cleanedUpDates.timeZone;
|
|
769
|
-
if (!data.recurrence) {
|
|
770
|
-
data.dates[0].overdue = atcb_date_specials_calculation('overdue', data.endDate, data.endTime, data.timeZone);
|
|
771
|
-
} else {
|
|
772
|
-
data.dates[0].overdue = false;
|
|
773
|
-
}
|
|
746
|
+
if (!data.dates || !Array.isArray(data.dates)) {
|
|
747
|
+
data.dates = [{ name: data.name }];
|
|
748
|
+
}
|
|
749
|
+
if (data.recurrence && data.recurrence !== '') {
|
|
750
|
+
data.dates[0].recurrence = data.recurrence;
|
|
751
|
+
}
|
|
752
|
+
for (let i = 0; i < data.dates.length; i++) {
|
|
753
|
+
data = atcb_move_root_values_into_dates(data, i);
|
|
754
|
+
data = atcb_dates_cleanup(data, i);
|
|
755
|
+
data = atcb_generate_unique_uid(data, i);
|
|
756
|
+
data = atcb_transform_strings(data, i);
|
|
757
|
+
data = atcb_decorate_data_description(data, i);
|
|
758
|
+
data = atcb_replace_custom_variables(data, i);
|
|
759
|
+
data = atcb_set_online_event_flag(data, i);
|
|
774
760
|
}
|
|
775
761
|
const now = new Date();
|
|
776
762
|
if (!data.created || data.created === '') {
|
|
@@ -779,29 +765,60 @@ function atcb_decorate_data_dates(data) {
|
|
|
779
765
|
if (!data.updated || data.updated === '') {
|
|
780
766
|
data.updated = atcb_format_datetime(now, 'clean', true);
|
|
781
767
|
}
|
|
768
|
+
if (data.dates.length > 1) {
|
|
769
|
+
data.dates.sort((a, b) => a.timestamp - b.timestamp);
|
|
770
|
+
}
|
|
782
771
|
return data;
|
|
783
772
|
}
|
|
784
|
-
function
|
|
785
|
-
|
|
786
|
-
|
|
773
|
+
function atcb_move_root_values_into_dates(data, i) {
|
|
774
|
+
const dateEntry = data.dates[`${i}`];
|
|
775
|
+
const properties = ['description', 'startDate', 'startTime', 'endDate', 'endTime', 'timeZone', 'useUserTZ', 'location', 'status', 'sequence', 'availability', 'organizer', 'attendee'];
|
|
776
|
+
if (data.dates.length === 1) {
|
|
777
|
+
properties.unshift('name');
|
|
787
778
|
}
|
|
788
|
-
|
|
789
|
-
data
|
|
779
|
+
properties.forEach((prop) => {
|
|
780
|
+
if (data[`${prop}`] && data[`${prop}`] !== '') {
|
|
781
|
+
dateEntry[`${prop}`] = data[`${prop}`];
|
|
782
|
+
}
|
|
783
|
+
});
|
|
784
|
+
return data;
|
|
785
|
+
}
|
|
786
|
+
function atcb_dates_cleanup(data, i) {
|
|
787
|
+
const dateEntry = data.dates[`${i}`];
|
|
788
|
+
const cleanedUpDates = atcb_date_cleanup(dateEntry);
|
|
789
|
+
dateEntry.startDate = cleanedUpDates.startDate;
|
|
790
|
+
dateEntry.endDate = cleanedUpDates.endDate;
|
|
791
|
+
dateEntry.startTime = cleanedUpDates.startTime;
|
|
792
|
+
dateEntry.endTime = cleanedUpDates.endTime;
|
|
793
|
+
dateEntry.timeZone = cleanedUpDates.timeZone;
|
|
794
|
+
dateEntry.timestamp = atcb_date_specials_calculation('timestamp', dateEntry.startDate, dateEntry.startTime, dateEntry.timeZone);
|
|
795
|
+
dateEntry.overdue = atcb_date_specials_calculation('overdue', dateEntry.endDate, dateEntry.endTime, dateEntry.timeZone);
|
|
796
|
+
return data;
|
|
797
|
+
}
|
|
798
|
+
function atcb_generate_unique_uid(data, i) {
|
|
799
|
+
const dateEntry = data.dates[`${i}`];
|
|
800
|
+
if (!dateEntry.uid) {
|
|
801
|
+
if (i === 0 && data.uid && data.uid !== '') {
|
|
802
|
+
dateEntry.uid = data.uid;
|
|
803
|
+
} else if (data.uid && data.uid !== '') {
|
|
804
|
+
dateEntry.uid = `${data.uid}-${i + 1}`;
|
|
805
|
+
} else {
|
|
806
|
+
dateEntry.uid = atcb_generate_uuid();
|
|
807
|
+
}
|
|
790
808
|
}
|
|
791
809
|
return data;
|
|
792
810
|
}
|
|
811
|
+
function atcb_transform_strings(data, i) {
|
|
812
|
+
const dateEntry = data.dates[`${i}`];
|
|
813
|
+
dateEntry.status = atcb_apply_transformation(dateEntry.status, 'upper');
|
|
814
|
+
dateEntry.availability = atcb_apply_transformation(dateEntry.availability, 'lower');
|
|
815
|
+
return data;
|
|
816
|
+
}
|
|
793
817
|
function atcb_decorate_data_description(data, i) {
|
|
794
818
|
const cleanDescription = (desc) => desc.replace(/(\\r\\n|\\n|\\r|<br(\s*\/?)>)/g, '');
|
|
795
|
-
let description = data.dates[`${i}`].description
|
|
819
|
+
let description = data.dates[`${i}`].description;
|
|
796
820
|
if (description) {
|
|
797
821
|
description = cleanDescription(description);
|
|
798
|
-
if (data.customVar) {
|
|
799
|
-
for (const key in data.customVar) {
|
|
800
|
-
const sanitizedKey = '%%' + key.replace(/[^\w\-.]/g, '') + '%%';
|
|
801
|
-
// eslint-disable-next-line security/detect-non-literal-regexp
|
|
802
|
-
description = description.replace(new RegExp(sanitizedKey, 'gi'), data.customVar[`${key}`]);
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
822
|
const descriptionHtmlFree = atcb_rewrite_html_elements(description, true);
|
|
806
823
|
const descriptionHtmlFreeICal = atcb_rewrite_html_elements(description, true, true);
|
|
807
824
|
description = atcb_rewrite_html_elements(description);
|
|
@@ -811,78 +828,18 @@ function atcb_decorate_data_description(data, i) {
|
|
|
811
828
|
}
|
|
812
829
|
return data;
|
|
813
830
|
}
|
|
814
|
-
function
|
|
815
|
-
|
|
816
|
-
data = atcb_decorate_data_description(data, i);
|
|
817
|
-
data = atcb_extend_date_with_global_values(data, i);
|
|
818
|
-
data = atcb_set_online_event_flag(data, i);
|
|
819
|
-
data = atcb_generate_unique_uid(data, i);
|
|
820
|
-
data = atcb_replace_custom_variables(data, i);
|
|
821
|
-
}
|
|
822
|
-
if (data.recurrence && data.recurrence !== '') {
|
|
823
|
-
data.dates[0].recurrence = data.recurrence;
|
|
824
|
-
}
|
|
825
|
-
if (data.dates.length > 1) {
|
|
826
|
-
data.dates.sort((a, b) => a.timestamp - b.timestamp);
|
|
827
|
-
}
|
|
828
|
-
return data;
|
|
829
|
-
}
|
|
830
|
-
function atcb_extend_date_with_global_values(data, dateIndex) {
|
|
831
|
-
const dateEntry = data.dates[`${dateIndex}`];
|
|
832
|
-
atcb_copy_global_to_date_entry(dateEntry, 'name', data.name, { allowEmpty: true });
|
|
833
|
-
atcb_copy_global_to_date_entry(dateEntry, 'status', data.status, { transform: 'upper', applyTransformAlways: true });
|
|
834
|
-
atcb_copy_global_to_date_entry(dateEntry, 'sequence', data.sequence);
|
|
835
|
-
atcb_copy_global_to_date_entry(dateEntry, 'organizer', data.organizer);
|
|
836
|
-
atcb_copy_global_to_date_entry(dateEntry, 'attendee', data.attendee);
|
|
837
|
-
atcb_copy_global_to_date_entry(dateEntry, 'availability', data.availability, { transform: 'lower', applyTransformAlways: true });
|
|
838
|
-
atcb_copy_global_to_date_entry(dateEntry, 'location', data.location);
|
|
839
|
-
return data;
|
|
840
|
-
}
|
|
841
|
-
function atcb_copy_global_to_date_entry(dateEntry, property, globalValue, options = {}) {
|
|
842
|
-
const { allowEmpty = false, transform = null, applyTransformAlways = false } = options;
|
|
843
|
-
const shouldCopy = allowEmpty ? (!dateEntry[`${property}`] || dateEntry[`${property}`] === '') && globalValue !== undefined : !dateEntry[`${property}`] && globalValue;
|
|
844
|
-
if (shouldCopy) {
|
|
845
|
-
dateEntry[`${property}`] = atcb_apply_transformation(globalValue, transform);
|
|
846
|
-
} else if (applyTransformAlways && dateEntry[`${property}`]) {
|
|
847
|
-
dateEntry[`${property}`] = atcb_apply_transformation(dateEntry[`${property}`], transform);
|
|
848
|
-
}
|
|
849
|
-
}
|
|
850
|
-
function atcb_apply_transformation(value, transform) {
|
|
851
|
-
if (!transform || !value) return value;
|
|
852
|
-
switch (transform) {
|
|
853
|
-
case 'upper':
|
|
854
|
-
return value.toString().toUpperCase();
|
|
855
|
-
case 'lower':
|
|
856
|
-
return value.toString().toLowerCase();
|
|
857
|
-
default:
|
|
858
|
-
return value;
|
|
859
|
-
}
|
|
860
|
-
}
|
|
861
|
-
function atcb_set_online_event_flag(data, dateIndex) {
|
|
862
|
-
const dateEntry = data.dates[`${dateIndex}`];
|
|
831
|
+
function atcb_set_online_event_flag(data, i) {
|
|
832
|
+
const dateEntry = data.dates[`${i}`];
|
|
863
833
|
if (dateEntry.location && dateEntry.location.startsWith('http')) {
|
|
864
834
|
dateEntry.onlineEvent = true;
|
|
865
835
|
} else {
|
|
866
|
-
dateEntry.
|
|
836
|
+
dateEntry.v = false;
|
|
867
837
|
}
|
|
868
838
|
return data;
|
|
869
839
|
}
|
|
870
|
-
function
|
|
871
|
-
const dateEntry = data.dates[`${dateIndex}`];
|
|
872
|
-
if (!dateEntry.uid) {
|
|
873
|
-
if (dateIndex === 0 && data.uid && data.uid !== '') {
|
|
874
|
-
dateEntry.uid = data.uid;
|
|
875
|
-
} else if (data.uid && data.uid !== '') {
|
|
876
|
-
dateEntry.uid = `${data.uid}-${dateIndex + 1}`;
|
|
877
|
-
} else {
|
|
878
|
-
dateEntry.uid = atcb_generate_uuid();
|
|
879
|
-
}
|
|
880
|
-
}
|
|
881
|
-
return data;
|
|
882
|
-
}
|
|
883
|
-
function atcb_replace_custom_variables(data, dateIndex) {
|
|
840
|
+
function atcb_replace_custom_variables(data, i) {
|
|
884
841
|
if (!data.customVar) return data;
|
|
885
|
-
const dateEntry = data.dates[`${
|
|
842
|
+
const dateEntry = data.dates[`${i}`];
|
|
886
843
|
for (const key in data.customVar) {
|
|
887
844
|
const value = data.customVar[`${key}`];
|
|
888
845
|
dateEntry.name = atcb_replace_placeholder(dateEntry.name, value);
|
|
@@ -3032,8 +2989,7 @@ function atcb_translate_via_time_zone(date, time, baseTimeZone, targetTimeZone)
|
|
|
3032
2989
|
}
|
|
3033
2990
|
function atcb_generate_timestring(dates, language = 'en', subEvent = 'all', decorate = false, browserTimeOverride = false, enforceYear = false, hideTimeZone = false) {
|
|
3034
2991
|
if (decorate) {
|
|
3035
|
-
|
|
3036
|
-
dates = atcb_decorate_data_dates({ dates: dates, timeZone: tmpRootTZ }).dates;
|
|
2992
|
+
dates = atcb_decorate_data_dates({ dates: dates }).dates;
|
|
3037
2993
|
}
|
|
3038
2994
|
let startDateInfo, endDateInfo, timeZoneInfoStart, timeZoneInfoEnd;
|
|
3039
2995
|
let formattedTimeStart = {};
|
|
@@ -3442,6 +3398,17 @@ function atcb_generate_uuid() {
|
|
|
3442
3398
|
const id = ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, (c) => (c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16));
|
|
3443
3399
|
return id;
|
|
3444
3400
|
}
|
|
3401
|
+
function atcb_apply_transformation(value, transform) {
|
|
3402
|
+
if (!transform || !value) return value;
|
|
3403
|
+
switch (transform) {
|
|
3404
|
+
case 'upper':
|
|
3405
|
+
return value.toString().toUpperCase();
|
|
3406
|
+
case 'lower':
|
|
3407
|
+
return value.toString().toLowerCase();
|
|
3408
|
+
default:
|
|
3409
|
+
return value;
|
|
3410
|
+
}
|
|
3411
|
+
}
|
|
3445
3412
|
function atcb_copy_to_clipboard(dataString) {
|
|
3446
3413
|
const tmpInput = document.createElement('input');
|
|
3447
3414
|
document.body.append(tmpInput);
|
|
@@ -5082,7 +5049,7 @@ async function atcb_get_pro_data(licenseKey, el = null, directData = {}) {
|
|
|
5082
5049
|
if (proOverride) {
|
|
5083
5050
|
const hostname = window?.location.hostname || '';
|
|
5084
5051
|
atcbWcParams.forEach((key) => {
|
|
5085
|
-
if ((Object.prototype.hasOwnProperty.call(dataOverrides, key) && ['hideBranding', '
|
|
5052
|
+
if ((Object.prototype.hasOwnProperty.call(dataOverrides, key) && ['hideBranding', 'ty', 'rsvp'].indexOf(key) === -1) || hostname === 'caldn.net') {
|
|
5086
5053
|
data[`${key}`] = dataOverrides[`${key}`];
|
|
5087
5054
|
}
|
|
5088
5055
|
});
|