diff --git a/index.html b/index.html
index 85e3ca1..9e2aba7 100644
--- a/index.html
+++ b/index.html
@@ -116,10 +116,10 @@
Dates to Note:
diff --git a/script/scriptEventLists.js b/script/scriptEventLists.js
index 2bc53f2..3d767b5 100644
--- a/script/scriptEventLists.js
+++ b/script/scriptEventLists.js
@@ -99,6 +99,20 @@ $(document).ready(function () {
});
});
+// Function to convert URLs to linked HTML text
+function convertUrlsToLinks(text) {
+ // Regular expression to find URLs
+ var urlPattern = /(https?:\/\/[^\s]+)/g;
+
+ // Replace URLs with HTML links
+ var newText = text.replace(
+ urlPattern,
+ 'Learn more.'
+ );
+
+ return newText;
+}
+
// Show upcoming events on the page
function showEvents(eventsArray) {
// modify formatting of the events
@@ -109,6 +123,10 @@ function showEvents(eventsArray) {
/<[^>]*>/g,
" "
);
+ // convert urls to links
+ eventsArray[i].description = convertUrlsToLinks(
+ eventsArray[i].description
+ );
// add spaces after ':' (except '://')
eventsArray[i].description = eventsArray[i].description.replace(
/\:(?!\s|\/\/\b)/g,
@@ -119,9 +137,9 @@ function showEvents(eventsArray) {
if (eventsArray[i].name.length > 17) {
eventsArray[i].name = eventsArray[i].name.substring(0, 17) + "..";
}
- if (eventsArray[i].description.length > 101) {
+ if (eventsArray[i].description.length > 170) {
eventsArray[i].description =
- eventsArray[i].description.substring(0, 101) + " ...";
+ eventsArray[i].description.substring(0, 170) + "...";
}
}
// separate the events into arrays by type
diff --git a/style/style.css b/style/style.css
index 3c768a4..b414c18 100644
--- a/style/style.css
+++ b/style/style.css
@@ -122,6 +122,11 @@ iframe {
#events ul {
padding: 0;
}
+
+.event-link {
+ color: inherit;
+ text-decoration: underline;
+}
.event-date {
font-size: small;
background-color: rgba(255, 255, 255, 0.2);
@@ -148,7 +153,7 @@ iframe {
#events-student-non-holiday .event-item:nth-child(-n + 5) {
display: list-item;
}
-#events-student-opps .event-item:nth-child(-n + 3) {
+#events-student-opps .event-item:nth-child(-n + 13) {
display: list-item;
}
.event-item-desc {