You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-16 00:14:34 +02:00
Doc: Added new website front page and moved doc under /help (#5169)
This commit is contained in:
@ -1,8 +1,50 @@
|
||||
function getOs() {
|
||||
if (navigator.appVersion.indexOf("Win")!=-1) return "windows";
|
||||
if (navigator.appVersion.indexOf("Mac")!=-1) return "macOs";
|
||||
if (navigator.appVersion.indexOf("X11")!=-1) return "linux";
|
||||
if (navigator.appVersion.indexOf("Linux")!=-1) return "linux";
|
||||
return null;
|
||||
}
|
||||
|
||||
function setupMobileMenu() {
|
||||
$("#open-menu-mobile").click(function () {
|
||||
$("#menu-mobile").animate({ "margin-right": "0px" }, 300);
|
||||
});
|
||||
|
||||
$("#close-menu-mobile").click(function () {
|
||||
$("#menu-mobile").animate({ "margin-right": "-300px" }, 300);
|
||||
});
|
||||
}
|
||||
|
||||
function setupDownloadPage() {
|
||||
if (!$('.page-download').length) return;
|
||||
|
||||
const downloadLinks = {};
|
||||
|
||||
$('.page-download .get-it-desktop a').each(function() {
|
||||
const href = $(this).attr('href');
|
||||
|
||||
if (href.indexOf('-Setup') > 0) downloadLinks['windows'] = href;
|
||||
if (href.indexOf('.dmg') > 0) downloadLinks['macOs'] = href;
|
||||
if (href.indexOf('.AppImage') > 0) downloadLinks['linux'] = href;
|
||||
});
|
||||
|
||||
$('.page-download .get-it-desktop').hide();
|
||||
|
||||
$('.page-download .download-click-here').click((event) => {
|
||||
event.preventDefault();
|
||||
$('.page-download .get-it-desktop').show(500);
|
||||
});
|
||||
|
||||
const os = getOs();
|
||||
if (!os || !downloadLinks[os]) {
|
||||
$('.page-download .get-it-desktop').show();
|
||||
} else {
|
||||
window.location = downloadLinks[os];
|
||||
}
|
||||
}
|
||||
|
||||
$(function () {
|
||||
$("#open-menu-mobile").click(function () {
|
||||
$("#menu-mobile").animate({ "margin-right": "0px" }, 300);
|
||||
});
|
||||
$("#close-menu-mobile").click(function () {
|
||||
$("#menu-mobile").animate({ "margin-right": "-300px" }, 300);
|
||||
});
|
||||
setupMobileMenu();
|
||||
setupDownloadPage();
|
||||
});
|
||||
|
Reference in New Issue
Block a user