// Javascript functionality for settings on the posts & pages

// Article schema tab heading
const essdrs_article_schema_tab_heading = document.getElementById('essdrs_article_tab_heading');
// Article schema main tab
const essdrs_article_schema_tab_main = document.getElementById('essdrs_metabox_main_article_schema');
// Recipe schema tab heading
const essdrs_recipe_schema_tab_heading = document.getElementById('essdrs_recipe_tab_heading');
// Recipe schema main tab
const essdrs_recipe_schema_tab_main = document.getElementById('essdrs_metabox_main_recipe_schema');
// Video object schema tab heading
const essdrs_video_schema_tab_heading = document.getElementById('essdrs_video_tab_heading');
// Video schema main tab
const essdrs_video_schema_tab_main = document.getElementById('essdrs_metabox_main_video_schema');
// Software app schema tab heading
const essdrs_software_schema_tab_heading = document.getElementById('essdrs_software_tab_heading');
// Software app schema main tab
const essdrs_software_schema_tab_main = document.getElementById('essdrs_metabox_main_software_schema');
// Events schema tab heading
const essdrs_events_schema_tab_heading = document.getElementById('essdrs_events_tab_heading');
// Events schema main tab
const essdrs_events_schema_tab_main = document.getElementById('essdrs_metabox_main_events_schema');
// Job posting schema tab heading
const essdrs_job_schema_tab_heading = document.getElementById('essdrs_job_tab_heading');
// Job posting schema main tab
const essdrs_job_schema_tab_main = document.getElementById('essdrs_metabox_main_job_schema');
// Person schema tab heading
const essdrs_person_schema_tab_heading = document.getElementById('essdrs_person_tab_heading');
// Person schema main tab
const essdrs_person_schema_tab_main = document.getElementById('essdrs_metabox_main_person_schema');
// Course schema tab heading
const essdrs_course_schema_tab_heading = document.getElementById('essdrs_course_tab_heading');
// Course schema main tab
const essdrs_course_schema_tab_main = document.getElementById('essdrs_metabox_main_course_schema');
// Getting started tab heading
const essdrs_getting_started_tab_heading = document.getElementById('essdrs_getting_started_tab_heading');
// Getting started main tab
const essdrs_getting_started_tab_main = document.getElementById('essdrs_metabox_main_getting_started_schema');

// Show getting started onclick
essdrs_getting_started_tab_heading.addEventListener('click', function handleClick() {
  if (essdrs_getting_started_tab_main.style.display === 'none') {
      
    // Make article schema visible
    essdrs_getting_started_tab_main.style.display = 'block';
    
    // Make all other tabs display none
    essdrs_article_schema_tab_main.style.display = 'none';
    essdrs_recipe_schema_tab_main.style.display = 'none';
    essdrs_video_schema_tab_main.style.display = 'none';
    essdrs_software_schema_tab_main.style.display = 'none';
    essdrs_events_schema_tab_main.style.display = 'none';
    essdrs_job_schema_tab_main.style.display = 'none';
    essdrs_person_schema_tab_main.style.display = 'none';
    essdrs_course_schema_tab_main.style.display = 'none';

    // Make tab stand out
    essdrs_getting_started_tab_heading.classList.add('active')
    
    // reset other tabs
    essdrs_article_schema_tab_heading.classList.remove('active');
    essdrs_recipe_schema_tab_heading.classList.remove('active');
    essdrs_video_schema_tab_heading.classList.remove('active');
    essdrs_software_schema_tab_heading.classList.remove('active');
    essdrs_events_schema_tab_heading.classList.remove('active');
    essdrs_job_schema_tab_heading.classList.remove('active');
    essdrs_person_schema_tab_heading.classList.remove('active');
    essdrs_course_schema_tab_heading.classList.remove('active');

  } 
});

// Show article schema onclick
essdrs_article_schema_tab_heading.addEventListener('click', function handleClick() {
  if (essdrs_article_schema_tab_main.style.display === 'none') {
      
    // Make article schema visible
    essdrs_article_schema_tab_main.style.display = 'block';
    
    // Make all other tabs display none
    essdrs_recipe_schema_tab_main.style.display = 'none';
    essdrs_video_schema_tab_main.style.display = 'none';
    essdrs_software_schema_tab_main.style.display = 'none';
    essdrs_events_schema_tab_main.style.display = 'none';
    essdrs_job_schema_tab_main.style.display = 'none';
    essdrs_person_schema_tab_main.style.display = 'none';
    essdrs_course_schema_tab_main.style.display = 'none';
    essdrs_getting_started_tab_main.style.display = 'none';

    // Make tab stand out
    essdrs_article_schema_tab_heading.classList.add('active')
    
    // reset other tabs
    essdrs_recipe_schema_tab_heading.classList.remove('active');
    essdrs_video_schema_tab_heading.classList.remove('active');
    essdrs_software_schema_tab_heading.classList.remove('active');
    essdrs_events_schema_tab_heading.classList.remove('active');
    essdrs_job_schema_tab_heading.classList.remove('active');
    essdrs_person_schema_tab_heading.classList.remove('active');
    essdrs_course_schema_tab_heading.classList.remove('active');
    essdrs_getting_started_tab_heading.classList.remove('active');
    
  } 
});

// Show recipe schema onclick
essdrs_recipe_schema_tab_heading.addEventListener('click', function handleClick() {
  if (essdrs_recipe_schema_tab_main.style.display === 'none') {
      
    // Make recipe schema visible
    essdrs_recipe_schema_tab_main.style.display = 'block';
    
    // Make all other tabs display none
    essdrs_article_schema_tab_main.style.display = 'none';
    essdrs_video_schema_tab_main.style.display = 'none';
    essdrs_software_schema_tab_main.style.display = 'none';
    essdrs_events_schema_tab_main.style.display = 'none';
    essdrs_job_schema_tab_main.style.display = 'none';
    essdrs_person_schema_tab_main.style.display = 'none';
    essdrs_course_schema_tab_main.style.display = 'none';
    essdrs_getting_started_tab_main.style.display = 'none';
    
    // Make tab stand out
    essdrs_recipe_schema_tab_heading.classList.add('active')
    
    // reset other tabs
    essdrs_article_schema_tab_heading.classList.remove('active');
    essdrs_video_schema_tab_heading.classList.remove('active');
    essdrs_software_schema_tab_heading.classList.remove('active');
    essdrs_events_schema_tab_heading.classList.remove('active');
    essdrs_job_schema_tab_heading.classList.remove('active');
    essdrs_person_schema_tab_heading.classList.remove('active');
    essdrs_course_schema_tab_heading.classList.remove('active');
    essdrs_getting_started_tab_heading.classList.remove('active');

  } 
});

// Show video object schema onclick
essdrs_video_schema_tab_heading.addEventListener('click', function handleClick() {
  if (essdrs_video_schema_tab_main.style.display === 'none') {
      
    // Make recipe schema visible
    essdrs_video_schema_tab_main.style.display = 'block';
    
    // Make all other tabs display none
    essdrs_article_schema_tab_main.style.display = 'none';
    essdrs_recipe_schema_tab_main.style.display = 'none';
    essdrs_software_schema_tab_main.style.display = 'none';
    essdrs_events_schema_tab_main.style.display = 'none';
    essdrs_job_schema_tab_main.style.display = 'none';
    essdrs_person_schema_tab_main.style.display = 'none';
    essdrs_course_schema_tab_main.style.display = 'none';
    essdrs_getting_started_tab_main.style.display = 'none';

    // Make tab stand out
    essdrs_video_schema_tab_heading.classList.add('active')
    
    // reset other tabs
    essdrs_recipe_schema_tab_heading.classList.remove('active');
    essdrs_article_schema_tab_heading.classList.remove('active');
    essdrs_software_schema_tab_heading.classList.remove('active');
    essdrs_events_schema_tab_heading.classList.remove('active');
    essdrs_job_schema_tab_heading.classList.remove('active');
    essdrs_person_schema_tab_heading.classList.remove('active');
    essdrs_course_schema_tab_heading.classList.remove('active');
    essdrs_getting_started_tab_heading.classList.remove('active');

  } 
});

// Show software app schema onclick
essdrs_software_schema_tab_heading.addEventListener('click', function handleClick() {
  if (essdrs_software_schema_tab_main.style.display === 'none') {
      
    // Make software schema visible
    essdrs_software_schema_tab_main.style.display = 'block';
    
    // Make all other tabs display none
    essdrs_article_schema_tab_main.style.display = 'none';
    essdrs_recipe_schema_tab_main.style.display = 'none';
    essdrs_video_schema_tab_main.style.display = 'none';
    essdrs_events_schema_tab_main.style.display = 'none';
    essdrs_job_schema_tab_main.style.display = 'none';
    essdrs_person_schema_tab_main.style.display = 'none';
    essdrs_course_schema_tab_main.style.display = 'none';
    essdrs_getting_started_tab_main.style.display = 'none';

    // Make tab stand out
    essdrs_software_schema_tab_heading.classList.add('active')
    
    // reset other tabs
    essdrs_recipe_schema_tab_heading.classList.remove('active');
    essdrs_article_schema_tab_heading.classList.remove('active');
    essdrs_video_schema_tab_heading.classList.remove('active');
    essdrs_events_schema_tab_heading.classList.remove('active');
    essdrs_job_schema_tab_heading.classList.remove('active');
    essdrs_person_schema_tab_heading.classList.remove('active');
    essdrs_course_schema_tab_heading.classList.remove('active');
    essdrs_getting_started_tab_heading.classList.remove('active');

  } 
});

// Show events schema onclick
essdrs_events_schema_tab_heading.addEventListener('click', function handleClick() {
  if (essdrs_events_schema_tab_main.style.display === 'none') {
      
    // Make events schema visible
    essdrs_events_schema_tab_main.style.display = 'block';
    
    // Make all other tabs display none
    essdrs_recipe_schema_tab_main.style.display = 'none';
    essdrs_video_schema_tab_main.style.display = 'none';
    essdrs_software_schema_tab_main.style.display = 'none';
    essdrs_article_schema_tab_main.style.display = 'none';
    essdrs_job_schema_tab_main.style.display = 'none';
    essdrs_person_schema_tab_main.style.display = 'none';
    essdrs_course_schema_tab_main.style.display = 'none';
    essdrs_getting_started_tab_main.style.display = 'none';

    // Make tab stand out
    essdrs_events_schema_tab_heading.classList.add('active')
    
    // reset other tabs
    essdrs_recipe_schema_tab_heading.classList.remove('active');
    essdrs_video_schema_tab_heading.classList.remove('active');
    essdrs_software_schema_tab_heading.classList.remove('active');
    essdrs_article_schema_tab_heading.classList.remove('active');
    essdrs_job_schema_tab_heading.classList.remove('active');
    essdrs_person_schema_tab_heading.classList.remove('active');
    essdrs_course_schema_tab_heading.classList.remove('active');
    essdrs_getting_started_tab_heading.classList.remove('active');

  } 
});

// Show job posting schema onclick
essdrs_job_schema_tab_heading.addEventListener('click', function handleClick() {
  if (essdrs_job_schema_tab_main.style.display === 'none') {
      
    // Make job schema visible
    essdrs_job_schema_tab_main.style.display = 'block';
    
    // Make all other tabs display none
    essdrs_recipe_schema_tab_main.style.display = 'none';
    essdrs_video_schema_tab_main.style.display = 'none';
    essdrs_software_schema_tab_main.style.display = 'none';
    essdrs_events_schema_tab_main.style.display = 'none';
    essdrs_article_schema_tab_main.style.display = 'none';
    essdrs_person_schema_tab_main.style.display = 'none';
    essdrs_course_schema_tab_main.style.display = 'none';
    essdrs_getting_started_tab_main.style.display = 'none';
    
    // Make tab stand out
    essdrs_job_schema_tab_heading.classList.add('active')
    
    // reset other tabs
    essdrs_recipe_schema_tab_heading.classList.remove('active');
    essdrs_video_schema_tab_heading.classList.remove('active');
    essdrs_software_schema_tab_heading.classList.remove('active');
    essdrs_events_schema_tab_heading.classList.remove('active');
    essdrs_article_schema_tab_heading.classList.remove('active');
    essdrs_person_schema_tab_heading.classList.remove('active');
    essdrs_course_schema_tab_heading.classList.remove('active');
    essdrs_getting_started_tab_heading.classList.remove('active');

  } 
});

// Show person schema onclick
essdrs_person_schema_tab_heading.addEventListener('click', function handleClick() {
  if (essdrs_person_schema_tab_main.style.display === 'none') {
      
    // Make person schema visible
    essdrs_person_schema_tab_main.style.display = 'block';
    
    // Make all other tabs display none
    essdrs_recipe_schema_tab_main.style.display = 'none';
    essdrs_video_schema_tab_main.style.display = 'none';
    essdrs_software_schema_tab_main.style.display = 'none';
    essdrs_events_schema_tab_main.style.display = 'none';
    essdrs_job_schema_tab_main.style.display = 'none';
    essdrs_article_schema_tab_main.style.display = 'none';
    essdrs_course_schema_tab_main.style.display = 'none';
    essdrs_getting_started_tab_main.style.display = 'none';
    
    // Make tab stand out
    essdrs_person_schema_tab_heading.classList.add('active')
    
    // reset other tabs
    essdrs_recipe_schema_tab_heading.classList.remove('active');
    essdrs_video_schema_tab_heading.classList.remove('active');
    essdrs_software_schema_tab_heading.classList.remove('active');
    essdrs_events_schema_tab_heading.classList.remove('active');
    essdrs_job_schema_tab_heading.classList.remove('active');
    essdrs_article_schema_tab_heading.classList.remove('active');
    essdrs_course_schema_tab_heading.classList.remove('active');
    essdrs_getting_started_tab_heading.classList.remove('active');


  } 
});

// Show course schema onclick
essdrs_course_schema_tab_heading.addEventListener('click', function handleClick() {
  if (essdrs_course_schema_tab_main.style.display === 'none') {
      
    // Make course schema visible
    essdrs_course_schema_tab_main.style.display = 'block';
    
    // Make all other tabs display none
    essdrs_recipe_schema_tab_main.style.display = 'none';
    essdrs_video_schema_tab_main.style.display = 'none';
    essdrs_software_schema_tab_main.style.display = 'none';
    essdrs_events_schema_tab_main.style.display = 'none';
    essdrs_job_schema_tab_main.style.display = 'none';
    essdrs_person_schema_tab_main.style.display = 'none';
    essdrs_article_schema_tab_main.style.display = 'none';
    essdrs_getting_started_tab_main.style.display = 'none';
    
    // Make tab stand out
    essdrs_course_schema_tab_heading.classList.add('active')
    
    // reset other tabs
    essdrs_recipe_schema_tab_heading.classList.remove('active');
    essdrs_video_schema_tab_heading.classList.remove('active');
    essdrs_software_schema_tab_heading.classList.remove('active');
    essdrs_events_schema_tab_heading.classList.remove('active');
    essdrs_job_schema_tab_heading.classList.remove('active');
    essdrs_person_schema_tab_heading.classList.remove('active');
    essdrs_article_schema_tab_heading.classList.remove('active');
    essdrs_getting_started_tab_heading.classList.remove('active');

  } 
});