Untitled

 avatar
unknown
plain_text
3 months ago
2.6 kB
5
Indexable
(function () {
  try {
    /* main variables */
    var debug = 0;
    var variation_name = "";
    var $;
    /* all Pure helper functions */

    function waitForElement(selector, trigger, delayInterval, delayTimeout) {
      var interval = setInterval(function () {
        if (
          document &&
          document.querySelector(selector) &&
          document.querySelectorAll(selector).length > 0
        ) {
          clearInterval(interval);
          trigger();
        }
      }, delayInterval);
      setTimeout(function () {
        clearInterval(interval);
      }, delayTimeout);
    }

    /* Variation Init */
    function courseOverviewSection() {
      var newOverviewContent = `
        <div class="eg-newOverview-content">
          <p class="eg-overview-content-intro">Swinburne Online's Bachelor of Accounting gives you the expertise to help individuals and businesses achieve their financial goals.</p>
          <ul class="eg-overview-content-list">
            <li>Learn with industry-leading software like Tableau and Xero.</li>
            <li>Work on real-world projects with clients like Acrodyne, NAB, and World Vision.</li>
            <li>Hear from industry experts and build valuable professional networks.</li>
            <li>Get accredited by CAANZ and CPA Australia.</li>
          </ul>
          <span class="eg-overview-graduate">Graduate ready to step into your dream accounting role!</span>
        </div>`;
        
      const courseOverview = document.querySelector('.course-overview');
      if (courseOverview) {
        courseOverview.classList.add('eg-courseOverview');
        
        const overviewTitle = courseOverview.querySelector('.container > div > div:first-child');
        if (overviewTitle) {
          overviewTitle.innerHTML = '<p class="eg-overviewTitle">Overview</p>';
        }

        const whatlearnTitle = courseOverview.querySelector('.container > div > div:last-child h2');
        if(whatlearnTitle) {
          whatlearnTitle.innerText = 'What you’ll learn ';
        }

        const overviewContent = document.querySelector('.course-overview .container > div > div:nth-child(2) h2');
        if (overviewContent && !document.querySelector('.eg-newOverview-content')) {
          overviewContent.insertAdjacentHTML('afterend', newOverviewContent);
        }
      }
    }
    

    /* Initialize variation */
    waitForElement('.course-overview', courseOverviewSection, 50, 15000);
  } catch (e) {
    if (debug) console.log(e, "error in Test" + variation_name);
  }
})();


Editor is loading...
Leave a Comment