From 2a829df9875b047b5efb59a8d2bbd4721bdb470e Mon Sep 17 00:00:00 2001 From: RamithaHeshan33 Date: Mon, 8 Apr 2024 20:02:09 +0530 Subject: [PATCH 1/5] Fix the Learn More button link on the Join Us page opening in the same page --- join-us.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/join-us.html b/join-us.html index 04ede31c..5036388d 100644 --- a/join-us.html +++ b/join-us.html @@ -56,7 +56,7 @@

Join the Tea
  • Business Communication
  • Programming
  • - + From 841e3365a79a285aab034b26f02beea0010c9d8f Mon Sep 17 00:00:00 2001 From: RamithaHeshan33 Date: Wed, 24 Apr 2024 18:42:57 +0530 Subject: [PATCH 2/5] Justifying the content --- scholarx/2023/index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scholarx/2023/index.html b/scholarx/2023/index.html index 0627b922..28ae9b42 100644 --- a/scholarx/2023/index.html +++ b/scholarx/2023/index.html @@ -52,7 +52,7 @@
    -

    ScholarX intends to deliver free premium mentoring assistance for the elite undergraduate +

    ScholarX intends to deliver free premium mentoring assistance for the elite undergraduate students based in Sri Lanka, through the means of a Sri Lankan expatriate presently involved with one of the world’s most renowned universities or Fortune 500 companies. This program strives to create a sustainable education structure within Sri Lanka by drawing knowledge @@ -167,11 +167,11 @@

    Program Timeline

    Be a mentor for ScholarX23

    -

    +

    Do you consider yourself a qualified professional with a knack for mentoring? Now you can share your knowledge with budding young talent of Sri Lanka. - Reach us via sustainableedufoundation@gmail.com + Reach us via
    + sustainableedufoundation@gmail.com

    From e6ad56f09f7411840e93bed39df2427d013592ad Mon Sep 17 00:00:00 2001 From: RamithaHeshan33 Date: Sat, 27 Apr 2024 22:16:06 +0530 Subject: [PATCH 3/5] stop repetion of mentors profiles --- scholarx/archive/functions.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/scholarx/archive/functions.js b/scholarx/archive/functions.js index b4a55fb9..cd283d60 100644 --- a/scholarx/archive/functions.js +++ b/scholarx/archive/functions.js @@ -60,16 +60,22 @@ async function getData() { async function loadData() { const { data } = await getData(); + const mentorNames = new Set(); // Set to store unique mentor names for (let i = 0; i < data.length; i++) { - years.push(data[i].year) - industries.push(data[i].fields) + years.push(data[i].year); + industries.push(data[i].fields); if (data[i].type == "mentor") { - mentors.push(data[i]) + // Check if the mentor's name is already in the Set + if (!mentorNames.has(data[i].name)) { + mentorNames.add(data[i].name); // Add the mentor's name to the Set + mentors.push(data[i]); // Add the mentor to the mentors array + } } else { - mentees.push(data[i]) - universities.push(data[i].university) + mentees.push(data[i]); + universities.push(data[i].university); } } + //add index for all the items mentors.forEach(function (mentors, index) { mentors.index = index; From 9241de041b2cdd8da151d25ced9dfed125fbf62f Mon Sep 17 00:00:00 2001 From: RamithaHeshan33 Date: Sun, 28 Apr 2024 20:30:14 +0530 Subject: [PATCH 4/5] stopping profile repetition --- scholarx/archive/functions.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scholarx/archive/functions.js b/scholarx/archive/functions.js index cd283d60..f86934ed 100644 --- a/scholarx/archive/functions.js +++ b/scholarx/archive/functions.js @@ -60,14 +60,14 @@ async function getData() { async function loadData() { const { data } = await getData(); - const mentorNames = new Set(); // Set to store unique mentor names + const mentorName = new Set(); // Set to store unique mentor names for (let i = 0; i < data.length; i++) { years.push(data[i].year); industries.push(data[i].fields); if (data[i].type == "mentor") { - // Check if the mentor's name is already in the Set - if (!mentorNames.has(data[i].name)) { - mentorNames.add(data[i].name); // Add the mentor's name to the Set + // Check if the mentor's name is already in the Set using the title + if (!mentorName.has(data[i].title)) { + mentorName.add(data[i].title); // Add the mentor's title to the Set mentors.push(data[i]); // Add the mentor to the mentors array } } else { From e0664b54906a4574a645d9d45751f3736c31ea6e Mon Sep 17 00:00:00 2001 From: RamithaHeshan33 Date: Sun, 12 May 2024 14:36:33 +0530 Subject: [PATCH 5/5] Update SEE MORE button --- irc.html | 66 ++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 26 deletions(-) diff --git a/irc.html b/irc.html index 4e9f80b7..bc4d54c6 100644 --- a/irc.html +++ b/irc.html @@ -427,37 +427,51 @@
    dataType: 'json', success: function (data) { - //slice array to two parts - if (data.length >= 8) { - let partOne = data.slice(0, 8); - let partTwo = data.slice(8); + // Define global variable to keep track of displayed profiles + let displayedProfiles = 8; - //mustache render - part one - let contentPartOne = Mustache.render($("#templateTeam").html(), {"data": partOne}); + // Function to display profiles based on the number to show + function displayProfiles(numToShow) { + // Slice the data array based on the number to show + let profilesToShow = data.slice(0, numToShow); + // Render the profiles using Mustache + let content = Mustache.render($("#templateTeam").html(), {"data": profilesToShow}); + // Display the rendered profiles + $("#teamContent").html(content); + } - //display first 8 profiles - $("#teamContent").html(contentPartOne); - $("#btnShowLess").hide(); - //hide button - $("#btnShowMore").click(function () { - let contentPartTwo = Mustache.render($("#templateTeam").html(), {"data": partTwo}); - $("#teamContent").append(contentPartTwo); + // Displaying first 8 profiles + displayProfiles(displayedProfiles); + $("#btnShowLess").hide(); + + + // Show More button click event + $("#btnShowMore").click(function () { + // Increment the number of displayed profiles + displayedProfiles += 8; + // Display profiles based on the updated count + displayProfiles(displayedProfiles); + // Hide or show appropriate buttons + if (displayedProfiles >= data.length) { $("#btnShowMore").hide(); - $("#btnShowLess").show(); - }); - $("#btnShowLess").click(function () { - $("#teamContent").html(contentPartOne); - $("#btnShowMore").show(); - $("#btnShowLess").hide(); - }); - } else { - //mustache render - let content = Mustache.render($("#templateTeam").html(), {"data": data}); + } + $("#btnShowLess").show(); + }); - //display first 8 profiles - $("#teamContent").html(content); + // Show Less button click event + $("#btnShowLess").click(function () { + // Reset the displayed profiles count to 8 + displayedProfiles = 8; + // Display the initial 8 profiles + displayProfiles(displayedProfiles); + // Hide the Show Less button + $("#btnShowLess").hide(); + // Show the Show More button + $("#btnShowMore").show(); + }); - //hide button + // Hide buttons if there are no more than 8 profiles + if (data.length <= 8) { $("#btnShowMore").hide(); $("#btnShowLess").hide(); }