MediaWiki:Timeless.js: Difference between revisions

From Tardis Wiki, the free Doctor Who reference
(log statement)
Tag: Reverted
(let's try this per https://www.site24x7.com/tools/javascript-validator.html)
Tag: Reverted
Line 4: Line 4:


/* Gadget-pullout_move.js */
/* Gadget-pullout_move.js */
const elementToMove = document.querySelector('.pullout-wrapper ~ #subpage-article');
var elementToMove1 = document.querySelector('.pullout-wrapper ~ #subpage-article');
const parentElement = elementToMove.parentNode;
var parentElement1 = elementToMove1.parentNode;
const siblingElement = parentElement.querySelector('.pullout-wrapper');
var siblingElement1 = parentElement1.querySelector('.pullout-wrapper');
parentElement.insertBefore(elementToMove, siblingElement);
parentElement.insertBefore(elementToMove1, siblingElement1);


const elementToMove = document.querySelector('#article-type ~ #subpage-article');
var elementToMove2 = document.querySelector('#article-type ~ #subpage-article');
const parentElement = elementToMove.parentNode;
var parentElement2 = elementToMove2.parentNode;
const siblingElement = parentElement.querySelector('#article-type');
var siblingElement2 = parentElement2.querySelector('#article-type');
parentElement.insertBefore(elementToMove, siblingElement);
parentElement.insertBefore(elementToMove2, siblingElement2);


/* Gadget-page_size.js */
/* Gadget-page_size.js */

Revision as of 23:53, 5 April 2024

console.log("js is running");

/* All JavaScript here will be loaded for users of the Timeless skin */

/* Gadget-pullout_move.js */
	var elementToMove1 = document.querySelector('.pullout-wrapper ~ #subpage-article');
	var parentElement1 = elementToMove1.parentNode;
	var siblingElement1 = parentElement1.querySelector('.pullout-wrapper');
	parentElement.insertBefore(elementToMove1, siblingElement1);

	var elementToMove2 = document.querySelector('#article-type ~ #subpage-article');
	var parentElement2 = elementToMove2.parentNode;
	var siblingElement2 = parentElement2.querySelector('#article-type');
	parentElement.insertBefore(elementToMove2, siblingElement2);

/* Gadget-page_size.js */

	var scrollHeight = $('.client-js').height();
    if( scrollHeight > 1589 ) {
       	$('.mediawiki').addClass('long-page');
       	$('.mediawiki').removeClass('short-page');
    } else{
       	$('.mediawiki').addClass('short-page');
       	$('.mediawiki').removeClass('long-page');
    }