MediaWiki:Common.js: Difference between revisions

From Wittgenstein Nachlass Graphics
(Created page with "→‎Any JavaScript here will be loaded for all users on every page load.: document.getElementById('toggle-switch').innerHTML = '<label class="switch"> <input type="checkbox" onclick="toggleListTable()"> <span class="slider-alt"></span> </label>';")
 
No edit summary
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
/* Any JavaScript here will be loaded for all users on every page load. */
document.getElementById('toggle-switch').innerHTML = '<label class="switch">
var toggleStatus = 'no';
   <input type="checkbox" onclick="toggleListTable()">
 
  <span class="slider-alt"></span>
function toggleView() {
</label>';
  if (toggleStatus == 'no') {
    document.getElementById('slider').classList.add("slider-alt");
    toggleStatus = 'yes';
   } else {
    document.getElementById('slider').classList.remove("slider-alt");
    toggleStatus = 'no';
  }
}

Revision as of 11:10, 12 May 2024

/* Any JavaScript here will be loaded for all users on every page load. */
var toggleStatus = 'no';

function toggleView() {
  if (toggleStatus == 'no') {
    document.getElementById('slider').classList.add("slider-alt");
    toggleStatus = 'yes';
  } else {
    document.getElementById('slider').classList.remove("slider-alt");
    toggleStatus = 'no';
  }
}