Anonymous

MediaWiki:Common.js: Difference between revisions

From Melvor Idle
no edit summary
No edit summary
No edit summary
Line 844: Line 844:
     return true;
     return true;
   }
   }
}
function showIOSAppDownloadLink() {
    // JavaScript code to check if the user is on a mobile device and not using the iOS app
    // If the conditions are met, populate the 'ios-app-download' div with a link to the iOS app.
    var iOSAppURL = 'YOUR_IOS_APP_URL';
    if (window.navigator.userAgent.match(/iPhone|iPad|iPod/i) && !window.navigator.userAgent.match(/Your iOS App User-Agent String/i)) {
        var downloadLink = '<a href="' + iOSAppURL + '">Download the iOS App</a>';
        const el = document.getElementById('ios-app-download');
        if(el !== null) el.innerHTML = downloadLink;
    }
}
}


Line 851: Line 863:
// Wiki app native navigation
// Wiki app native navigation
initWikiAppSidebar();
initWikiAppSidebar();
// Show iOS App download link
showIOSAppDownloadLink();
});
});