Ero sivun ”Järjestelmäviesti:Common.js” versioiden välillä

Praedor Wikistä
Siirry navigaatioon Siirry hakuun
Ei muokkausyhteenvetoa
Merkkaus: Palautettu
Ei muokkausyhteenvetoa
Merkkaus: Palautettu
Rivi 16: Rivi 16:
}
}


// Get the radio input element by its ID
window.onload = function() {
var radioInput = document.getElementById("citizen-pref-theme__input__dark");
  // Get the radio input element by its ID
  var radioInput = document.getElementById("citizen-pref-theme__input__dark");


// Check if the element exists before manipulating it
  // Check if the element exists before manipulating it
if (radioInput) {
  if (radioInput) {
  // Set the radio input element as checked
    // Set the radio input element as checked
  radioInput.checked = true;
    radioInput.checked = true;
}
  }
};

Versio 21. maaliskuuta 2023 kello 23.25

// Hide page actions from public wiki

// Get the current page URL
var currentUrl = window.location.href;

// Define the base URL to match
var baseUrl = "https://wiki.praedor.net/";

// Check if the current URL matches the base URL
if (currentUrl.indexOf(baseUrl) === 0) {
  // If the URLs match, hide the element with the "page-actions" class
  var elementsToHide = document.getElementsByClassName("page-actions");
  for (var i = 0; i < elementsToHide.length; i++) {
    elementsToHide[i].style.display = "none";
  }
}

window.onload = function() {
  // Get the radio input element by its ID
  var radioInput = document.getElementById("citizen-pref-theme__input__dark");

  // Check if the element exists before manipulating it
  if (radioInput) {
    // Set the radio input element as checked
    radioInput.checked = true;
  }
};