MediaWiki:Common.js: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 768: Line 768:
function showIOSAppDownloadLink() {
function showIOSAppDownloadLink() {
     var shouldShowDownload = /iPhone|iPad|iPod/i.test(window.navigator.userAgent) && window.navigator.userAgent.indexOf('gonative melvorwiki') === -1;
     var shouldShowDownload = /iPhone|iPad|iPod/i.test(window.navigator.userAgent) && window.navigator.userAgent.indexOf('gonative melvorwiki') === -1;
     var els = document.getElementsByClassName('ios-app-download');
     if (shouldShowDownload) {
    for (var i = 0; i < els.length; i++) {
    $('.ios-app-download').removeClass('d-none');
        if (shouldShowDownload) {
    } else {
            els[i].classList.remove('d-none');
    $('.ios-app-download').addClass('d-none');
        } else {
            els[i].classList.add('d-none');
        }
     }
     }
}
}