470
edits
No edit summary |
No edit summary |
||
(11 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
$( function(){ | $( function(){ | ||
if (window.matchMedia("(max-width: 768px)").matches) { | |||
if( mw.config.get("skin") !== "minerva" ){ | |||
const currWikiUrl = new URL(window.location.href); | |||
currWikiUrl.searchParams.set('mobileaction', 'toggle_view_mobile'); | |||
window.location.replace(currWikiUrl); | |||
} | |||
} else { | |||
if( mw.config.get("skin") !== "vector" ){ | |||
const currWikiUrl = new URL(window.location.href); | |||
currWikiUrl.searchParams.set('mobileaction', 'toggle_view_desktop'); | |||
window.location.replace(currWikiUrl); | |||
} | |||
} | |||
if( mw.config.get('wgIsMainPage') ){ | if( mw.config.get('wgIsMainPage') ){ | ||
$('#firstHeading').remove(); | $('#firstHeading').remove(); | ||
var mainpageLeft = $(".mainpage-left"); | |||
var mainpageRight = $(".mainpage-right"); | |||
mainpageLeft.css("position", "relative"); | |||
mainpageRight.css("position", "relative"); | |||
function animateLeft(){ | |||
mainpageRight.animate({'left': '15px'}, 1000, function(){ | |||
mainpageRight.animate( {"left": "0px" }, 1000, animateLeft() ); | |||
}); | |||
} | |||
animateLeft(); | |||
function animateRight(){ | |||
mainpageLeft.animate({'left': '-15px'}, 1000, function(){ | |||
mainpageLeft.animate( {"left": "0px" }, 1000, animateRight() ); | |||
}); | |||
} | |||
animateRight(); | |||
} | } | ||
Line 19: | Line 56: | ||
mw.loader.load( '/index.php?title=MediaWiki:OCR.js&action=raw&ctype=text/javascript'); | mw.loader.load( '/index.php?title=MediaWiki:OCR.js&action=raw&ctype=text/javascript'); | ||
mw.loader.load( '/index.php?title=MediaWiki:PoemButtons.js&action=raw&ctype=text/javascript'); | |||
} | |||
if( $(".wikiaudioplayer").length ){ | |||
mw.loader.load( '/index.php?title=MediaWiki:Green-audio-player.min.css&action=raw&ctype=text/css', 'text/css'); | |||
$.when( | |||
mw.loader.getScript( 'https://wiki.ekatrafoundation.org/index.php?title=MediaWiki:Green-audio-player.min.js&action=raw&ctype=text/javascript' ) | |||
) | |||
.then( | |||
function () { | |||
GreenAudioPlayer.init({ | |||
selector: '.wikiaudioplayer', | |||
stopOthersOnPlay: true | |||
}); | |||
$( ".wikiaudioplayer > audio").css("display", "none"); | |||
}, | |||
function ( e ) { | |||
mw.log.error( e.message ); | |||
} | |||
); | |||
} | } | ||
Line 94: | Line 151: | ||
$( document ).ready( function(){ | $( document ).ready( function(){ | ||
var longList = $("#longList").addClass(" | var longList = $("#longList").addClass("grid_row"), | ||
dlElements = longList.children().filter("dl"), | dlElements = longList.children().filter("dl"), | ||
dlElementsLength = dlElements.length; | dlElementsLength = dlElements.length; | ||
Line 115: | Line 172: | ||
longList.empty(); | longList.empty(); | ||
var leftDiv = $("<div/>").addClass(" | var leftDiv = $("<div/>").addClass("grid_col"); | ||
list1.forEach( function(value, index){ | list1.forEach( function(value, index){ | ||
leftDiv.append(value); | leftDiv.append(value); | ||
Line 121: | Line 178: | ||
var rightDiv = $("<div/>").addClass(" | var rightDiv = $("<div/>").addClass("grid_col"); | ||
list2.forEach( function(value, index){ | list2.forEach( function(value, index){ | ||
rightDiv.append(value); | rightDiv.append(value); |