-
diff --git a/public/friends/santaFriends.js b/public/friends/santaFriends.js
index 865ef33..27c5307 100644
--- a/public/friends/santaFriends.js
+++ b/public/friends/santaFriends.js
@@ -16,7 +16,7 @@ $(async () => {
$.each(result, (i, userData) => {
const friendElement = $.parseHTML(friendTemplate);
$(friendElement)
- .find('#name')
+ .find('[data-id="name"]')
.text(userData.name || userData.email);
if (userData.imageUploaded) {
lazyLoadImage(userData._id, $(friendElement).find('img')).then(
@@ -31,16 +31,16 @@ $(async () => {
$(friendElement).find('img').removeClass('loading-image');
}
$(friendElement)
- .find('#street')
+ .find('[data-id="street"]')
.text(userData.address?.street || 'N/A');
$(friendElement)
- .find('#postalCode')
+ .find('[data-id="postalCode"]')
.text(userData.address?.postalCode || '(N/A)');
$(friendElement)
- .find('#city')
+ .find('[data-id="city"]')
.text(userData.address?.city || 'N/A');
$(friendElement)
- .find('#state')
+ .find('[data-id="state"]')
.text(userData.address?.state || 'N/A');
$(friendElement).on('click', function () {
window.location.href = `/profile?id=${userData._id}`;
diff --git a/public/history/santaHistory.js b/public/history/santaHistory.js
index f21a88a..473fe77 100644
--- a/public/history/santaHistory.js
+++ b/public/history/santaHistory.js
@@ -19,21 +19,21 @@ $(async () => {
function listYears(year) {
const yearElement = $.parseHTML(yearTemplate);
- $(yearElement).find('#yearTitle').text(year.year);
+ $(yearElement).find('[data-id="yearTitle"]').text(year.year);
if (year.location === null) {
year.location = 'N/A';
}
- $(yearElement).find('#yearLocation').text(year.location);
+ $(yearElement).find('[data-id="yearLocation"]').text(year.location);
if (year.imageUploaded) {
lazyLoadImage(year._id, $(yearElement).find('img')).then((image) => {
$(yearElement)
- .find('#locationImage')
+ .find('[data-id="locationImage"]')
.attr('src', image.src)
.attr('hidden', false);
- $(yearElement).find('#locationIcon').attr('hidden', true);
+ $(yearElement).find('[data-id="locationIcon"]').attr('hidden', true);
});
} else {
- $(yearElement).find('#locationIcon').removeClass('loading-image');
+ $(yearElement).find('[data-id="locationIcon"]').removeClass('loading-image');
}
$(yearElement).on('click', function () {
window.location.href = `/history/year?id=${year._id}`;
diff --git a/public/history/year.html b/public/history/year.html
index b84d75f..004ecd9 100644
--- a/public/history/year.html
+++ b/public/history/year.html
@@ -1,21 +1,21 @@
-
+
-
+
diff --git a/public/history/year/gift.html b/public/history/year/gift.html
index 442fa52..370dc3f 100644
--- a/public/history/year/gift.html
+++ b/public/history/year/gift.html
@@ -1,16 +1,16 @@
- |
- |
+ |
+ |
-
-
+
+
|
-
+
{
if (gift.child === '') {
childName = gift.childEmail;
}
- $(giftElement).find('#santa').text(santaName);
- $(giftElement).find('#child').text(childName);
+ $(giftElement).find('[data-id="santa"]').text(santaName);
+ $(giftElement).find('[data-id="child"]').text(childName);
if (gift.gift === null) {
gift.gift = 'N/A';
}
- $(giftElement).find('#giftText').text(gift.gift);
+ $(giftElement).find('[data-id="giftText"]').text(gift.gift);
$(giftElement)
.find('#descriptionEdit')
@@ -81,16 +81,16 @@ $(async () => {
.attr('data-id', gift.giftId)
.attr('data-type', 'gift')
.val(gift.gift);
- descriptionEditElement = $(giftElement).find('#giftText');
+ descriptionEditElement = $(giftElement).find('[data-id="giftText"]');
editDescriptionModal.show();
});
$(giftElement)
- .find('#giftIcon, #giftImage')
+ .find('[data-id="giftIcon"], [data-id="giftImage"]')
.on('click', (e) => {
uploadEndpoint = `gift-image?yearId=${searchParams.get('id')}&giftId=${gift.giftId}`;
- imageElement = $(giftElement).find('#giftImage');
- iconElement = $(giftElement).find('#giftIcon');
+ imageElement = $(giftElement).find('[data-id="giftImage"]');
+ iconElement = $(giftElement).find('[data-id="giftIcon"]');
if (e.currentTarget.src === undefined) {
$('#imagePopup').attr('src', '');
@@ -102,15 +102,15 @@ $(async () => {
$(giftElement).find('#giftImageUpload').on('change', showCroppie);
if (gift.imageUploaded !== undefined) {
- lazyLoadImage(gift.giftId, $(giftElement).find('#giftImage')).then(
+ lazyLoadImage(gift.giftId, $(giftElement).find('[data-id="giftImage"]')).then(
(image) => {
- $(giftElement).find('#giftImage').attr('src', image.src);
- $(giftElement).find('#giftIcon').attr('hidden', true);
- $(giftElement).find('#giftImage').attr('hidden', false);
+ $(giftElement).find('[data-id="giftImage"]').attr('src', image.src);
+ $(giftElement).find('[data-id="giftIcon"]').attr('hidden', true);
+ $(giftElement).find('[data-id="giftImage"]').attr('hidden', false);
}
);
} else {
- $(giftElement).find('#giftIcon').removeClass('loading-image');
+ $(giftElement).find('[data-id="giftIcon"]').removeClass('loading-image');
}
$('tbody').append(giftElement);
}
diff --git a/public/modules/santa.html b/public/modules/santa.html
deleted file mode 100644
index 4b1a8b0..0000000
--- a/public/modules/santa.html
+++ /dev/null
@@ -1,14 +0,0 @@
-
|