Skip to content

Commit

Permalink
fixes and upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
jekuer committed Aug 19, 2024
1 parent f700b62 commit bdb5aef
Show file tree
Hide file tree
Showing 31 changed files with 93 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
]
},

"extends": ["plugin:@typescript-eslint/recommended", "eslint:recommended", "plugin:security/recommended-legacy", "plugin:prettier/recommended"],
"extends": ["plugin:@typescript-eslint/recommended", "eslint:recommended", "plugin:security/recommended-legacy", "plugin:prettier/recommended", "plugin:wc/recommended"],

"plugins": ["@typescript-eslint", "prettier"],

Expand Down
2 changes: 1 addition & 1 deletion assets/css/atcb-3d.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* Style: 3D
*
* Version: 2.6.18
* Version: 2.6.19
* Creator: Jens Kuerschner (https://jekuer.com)
* Project: https://github.com/add2cal/add-to-calendar-button
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
Expand Down
2 changes: 1 addition & 1 deletion assets/css/atcb-date.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* Style: Date
*
* Version: 2.6.18
* Version: 2.6.19
* Creator: Jens Kuerschner (https://jekuer.com)
* Project: https://github.com/add2cal/add-to-calendar-button
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
Expand Down
2 changes: 1 addition & 1 deletion assets/css/atcb-flat.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* Style: Flat
*
* Version: 2.6.18
* Version: 2.6.19
* Creator: Jens Kuerschner (https://jekuer.com)
* Project: https://github.com/add2cal/add-to-calendar-button
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
Expand Down
2 changes: 1 addition & 1 deletion assets/css/atcb-neumorphism.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* Style: Neumorphism
*
* Version: 2.6.18
* Version: 2.6.19
* Creator: Jens Kuerschner (https://jekuer.com)
* Project: https://github.com/add2cal/add-to-calendar-button
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
Expand Down
2 changes: 1 addition & 1 deletion assets/css/atcb-round.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* Style: Round
*
* Version: 2.6.18
* Version: 2.6.19
* Creator: Jens Kuerschner (https://jekuer.com)
* Project: https://github.com/add2cal/add-to-calendar-button
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
Expand Down
2 changes: 1 addition & 1 deletion assets/css/atcb-text.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* Style: Text
*
* Version: 2.6.18
* Version: 2.6.19
* Creator: Jens Kuerschner (https://jekuer.com)
* Project: https://github.com/add2cal/add-to-calendar-button
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
Expand Down
2 changes: 1 addition & 1 deletion assets/css/atcb.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* Style: Default
*
* Version: 2.6.18
* Version: 2.6.19
* Creator: Jens Kuerschner (https://jekuer.com)
* Project: https://github.com/add2cal/add-to-calendar-button
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
Expand Down
4 changes: 2 additions & 2 deletions demo/components/controls/configSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ onMounted(() => {
onSubmit: (value: string) => {
if (value !== undefined) {
const goTo = value.toLowerCase();
searchInput.value && searchInput.value.blur();
if (searchInput.value) searchInput.value.blur();
searchInput.value.value = '';
// push the route, but add some delay to work around some android soft keyboard issues
setTimeout( () => navigateTo({path: localePath('configuration'), hash: '#' + goTo}), 200);
Expand All @@ -138,7 +138,7 @@ onMounted(() => {
const onSearchInputFocus = () => {
isInputFocused.value = true;
searchInput.value && searchInput.value.select();
if (searchInput.value) searchInput.value.select();
}
const onSearchInputBlur = () => {
Expand Down
8 changes: 4 additions & 4 deletions demo/components/controls/timezoneAutocomplete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const elNoResultsID = (function() {
onMounted(() => {
if (props.modelValue && getFilteredTimezoneOptions().includes(props.modelValue.toString())) {
searchInput.value && (searchInput.value.value = props.modelValue)
if (searchInput.value) searchInput.value.value = props.modelValue;
}
if (import.meta.client) {
Expand All @@ -76,7 +76,7 @@ onMounted(() => {
onSubmit: (value: string) => {
if (value !== undefined) {
emit('update:modelValue', value);
searchInput.value && searchInput.value.blur();
if (searchInput.value) searchInput.value.blur();
}
},
autoSelect: true,
Expand All @@ -87,7 +87,7 @@ onMounted(() => {
const onSearchInputFocus = () => {
isInputFocused.value = true;
searchInput.value && searchInput.value.select();
if (searchInput.value) searchInput.value.select();
}
const onSearchInputBlur = () => {
Expand All @@ -107,7 +107,7 @@ const onSearchInputBlur = () => {
// watch props changes to synch mobile and desktop field here
if (import.meta.client) {
watch(props, () => {
searchInput.value && (searchInput.value.value = props.modelValue);
if (searchInput.value) searchInput.value.value = props.modelValue;
});
}
</script>
Expand Down
2 changes: 1 addition & 1 deletion demo/components/footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function topFunction() {
</span>
<div class="mt-6 text-xs sm:mt-5 md:mt-3">
<span class="font-semibold text-zinc-500 dark:text-zinc-400"> &copy; {{new Date().getFullYear()}} </span>
<span class="lowercase text-zinc-400 dark:text-zinc-500"> , Current Version: 2.6.18 </span>
<span class="lowercase text-zinc-400 dark:text-zinc-500"> , Current Version: 2.6.19 </span>
</div>
</div>
<div class="hidden self-center sm:block">
Expand Down
4 changes: 2 additions & 2 deletions demo/components/statsBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const loadGitHubRepoData = async () => {
if (response.ok) {
const json = await response.json();
json?.stargazers_count && (data.value.github.stars = json.stargazers_count);
if (json?.stargazers_count) data.value.github.stars = json.stargazers_count;
}
}
Expand Down Expand Up @@ -120,7 +120,7 @@ const loadJsdelivrStats = async () => {
const response = await fetch(jsdelivrStatsUrl);
if (response.ok) {
const json = await response.json();
json?.hits.total && (data.value.jsdelivr.montlyHits = json.hits.total);
if (json?.hits.total) data.value.jsdelivr.montlyHits = json.hits.total;
}
};
</script>
Expand Down
2 changes: 1 addition & 1 deletion demo/public/atcb.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* Style: Default
*
* Version: 2.6.18
* Version: 2.6.19
* Creator: Jens Kuerschner (https://jekuer.com)
* Project: https://github.com/add2cal/add-to-calendar-button
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
Expand Down
1 change: 1 addition & 0 deletions demo/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ module.exports = {
},
},
},
// eslint-disable @typescript-eslint/no-require-imports
// eslint-disable-next-line @typescript-eslint/no-var-requires
plugins: [require('@headlessui/tailwindcss')({ prefix: 'ui' })],
};
43 changes: 41 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "add-to-calendar-button",
"version": "2.6.18",
"version": "2.6.19",
"engines": {
"node": ">=18.17.0",
"npm": ">=9.6.7"
Expand Down Expand Up @@ -108,6 +108,7 @@
"eslint-plugin-commonjs": "^1.0.2",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-security": "^3.0.1",
"eslint-plugin-wc": "^2.1.0",
"grunt": ">=1.6.1",
"grunt-contrib-clean": "^2.0.1",
"grunt-contrib-concat": "^2.1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/atcb-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Add to Calendar Button
* ++++++++++++++++++++++
*
* Version: 2.6.18
* Version: 2.6.19
* Creator: Jens Kuerschner (https://jekuer.com)
* Project: https://github.com/add2cal/add-to-calendar-button
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
Expand Down
6 changes: 3 additions & 3 deletions src/atcb-decorate.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Add to Calendar Button
* ++++++++++++++++++++++
*
* Version: 2.6.18
* Version: 2.6.19
* Creator: Jens Kuerschner (https://jekuer.com)
* Project: https://github.com/add2cal/add-to-calendar-button
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
Expand Down Expand Up @@ -525,7 +525,7 @@ function atcb_date_specials_calculation(type, dateString, timeString = null, tim
}
const currentUtcDate = new Date().toISOString();
return tmpDate.getTime() < new Date(currentUtcDate).getTime();
} catch (e) {
} catch {
// we will catch the detailed problem on validation at the next step
return false;
}
Expand All @@ -551,7 +551,7 @@ function atcb_date_calculation(dateString) {
}
try {
return newDate.toISOString().replace(/T(\d{2}:\d{2}:\d{2}\.\d{3})Z/g, '');
} catch (e) {
} catch {
// we will catch the detailed problem on validation at the next step
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/atcb-event.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Add to Calendar Button
* ++++++++++++++++++++++
*
* Version: 2.6.18
* Version: 2.6.19
* Creator: Jens Kuerschner (https://jekuer.com)
* Project: https://github.com/add2cal/add-to-calendar-button
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
Expand Down
28 changes: 14 additions & 14 deletions src/atcb-generate-pro.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Add to Calendar Button
* ++++++++++++++++++++++
*
* Version: 2.6.18
* Version: 2.6.19
* Creator: Jens Kuerschner (https://jekuer.com)
* Project: https://github.com/add2cal/add-to-calendar-button
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
Expand Down Expand Up @@ -291,19 +291,19 @@ async function atcb_generate_rsvp_form(host, data, hostEl, keyboardTrigger = fal
rsvpContent += '<div class="pro-field"><label for="' + data.identifier + '-rsvp-amount">' + atcb_translate_hook('form.amount', data) + ' (' + atcb_translate_hook('form.max', data) + ' ' + maxAmount + ')<span>*</span></label>';
rsvpContent += '<input type="number" name="' + staticID + '-amount" min="1" max="' + maxAmount + '" id="' + data.identifier + '-rsvp-amount" ' + (data.disabled && 'disabled') + ' aria-label="' + atcb_translate_hook('form.amount', data) + '" value="1" /></div>';
}
const attendee = (function () {
if (data.attendee && data.attendee !== '') {
const attendeeParts = data.attendee.split('|');
if (attendeeParts.length > 1) {
return attendeeParts[1];
}
return attendeeParts[0];
}
return null;
})();
const customEmailField = rsvpData.fields?.find((field) => field.name === 'email');
if (!customEmailField) {
const attendee = (function () {
if (data.attendee && data.attendee !== '') {
const attendeeParts = data.attendee.split('|');
if (attendeeParts.length > 1) {
return attendeeParts[1];
}
return attendeeParts[0];
}
return '';
})();
if (attendee !== '') {
if (attendee) {
hiddenContent += '<input type="hidden" name="email" id="' + data.identifier + '-rsvp-email" value="' + attendee + '" />';
} else {
rsvpContent += '<div class="pro-field"><label for="' + data.identifier + '-rsvp-email">' + atcb_translate_hook('form.email', data) + '<span>*</span></label>';
Expand All @@ -312,7 +312,7 @@ async function atcb_generate_rsvp_form(host, data, hostEl, keyboardTrigger = fal
} else {
rsvpData.fields = rsvpData.fields.map((field) => {
if (field.name === 'email') {
return { ...field, required: true };
return { ...field, required: true, type: 'email', default: attendee !== '' && attendee || field.default };
}
return field;
});
Expand Down Expand Up @@ -669,7 +669,7 @@ function atcb_build_form(fields, identifier = '', disabled = false) {
function atcb_create_field_html(type, name, fieldLabel, fieldId, required = false, fieldValue, defaultVal = null, fieldPlaceholder = '', disabled = false) {
let fieldHtml = '';
// add label
if ((type === 'text' || type === 'number') && fieldLabel !== '') {
if ((type === 'text' || type === 'email' || type === 'number') && fieldLabel !== '') {
fieldHtml += '<label for="' + fieldId + '">' + fieldLabel + (required ? '<span>*</span>' : '') + '</label>';
}
// add input
Expand Down
2 changes: 1 addition & 1 deletion src/atcb-generate-rich-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Add to Calendar Button
* ++++++++++++++++++++++
*
* Version: 2.6.18
* Version: 2.6.19
* Creator: Jens Kuerschner (https://jekuer.com)
* Project: https://github.com/add2cal/add-to-calendar-button
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
Expand Down
2 changes: 1 addition & 1 deletion src/atcb-generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Add to Calendar Button
* ++++++++++++++++++++++
*
* Version: 2.6.18
* Version: 2.6.19
* Creator: Jens Kuerschner (https://jekuer.com)
* Project: https://github.com/add2cal/add-to-calendar-button
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
Expand Down
Loading

0 comments on commit bdb5aef

Please sign in to comment.