mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-12 20:02:28 +08:00
Merge branch 'develop' of ssh://github.com/TriliumNext/Notes into develop
This commit is contained in:
commit
88c7a928cc
@ -21,3 +21,5 @@ services:
|
|||||||
# Unless TRILIUM_DATA_DIR is set, the data will be stored in the "trilium-data" directory in the home directory.
|
# Unless TRILIUM_DATA_DIR is set, the data will be stored in the "trilium-data" directory in the home directory.
|
||||||
# This can also be changed with by replacing the line below with `- /path/of/your/choice:/home/node/trilium-data
|
# This can also be changed with by replacing the line below with `- /path/of/your/choice:/home/node/trilium-data
|
||||||
- ${TRILIUM_DATA_DIR:-~/trilium-data}:/home/node/trilium-data
|
- ${TRILIUM_DATA_DIR:-~/trilium-data}:/home/node/trilium-data
|
||||||
|
- /etc/timezone:/etc/timezone:ro
|
||||||
|
- /etc/localtime:/etc/localtime:ro
|
||||||
|
@ -6,11 +6,16 @@
|
|||||||
<title><%= t("login.title") %></title>
|
<title><%= t("login.title") %></title>
|
||||||
<link rel="apple-touch-icon" sizes="180x180" href="<%= assetPath %>/images/app-icons/ios/apple-touch-icon.png">
|
<link rel="apple-touch-icon" sizes="180x180" href="<%= assetPath %>/images/app-icons/ios/apple-touch-icon.png">
|
||||||
<link rel="shortcut icon" href="favicon.ico">
|
<link rel="shortcut icon" href="favicon.ico">
|
||||||
|
<link rel="stylesheet" href="<%= assetPath %>/node_modules/bootstrap/dist/css/bootstrap.min.css">
|
||||||
|
<link rel="stylesheet" href="<%= assetPath %>/stylesheets/theme-light.css">
|
||||||
|
<link rel="stylesheet" href="<%= assetPath %>/stylesheets/theme-next.css">
|
||||||
|
<link rel="stylesheet" href="<%= assetPath %>/stylesheets/style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="col-xs-12 col-sm-10 col-md-6 col-lg-4 col-xl-4 mx-auto" style="padding-top: 25px;">
|
<div class="col-xs-12 col-sm-10 col-md-6 col-lg-4 col-xl-4 mx-auto pt-4">
|
||||||
<h1><%= t("login.heading") %></h1>
|
<img class="img-fluid d-block mx-auto" style="height: 8rem;" src="<%= assetPath %>/images/icon-color.svg" aria-hidden="true">
|
||||||
|
<h1 class="text-center"><%= t("login.heading") %></h1>
|
||||||
|
|
||||||
<% if (failedAuth) { %>
|
<% if (failedAuth) { %>
|
||||||
<div class="alert alert-warning">
|
<div class="alert alert-warning">
|
||||||
@ -43,20 +48,8 @@
|
|||||||
// Required for correct loading of scripts in Electron
|
// Required for correct loading of scripts in Electron
|
||||||
if (typeof module === 'object') {window.module = module; module = undefined;}
|
if (typeof module === 'object') {window.module = module; module = undefined;}
|
||||||
|
|
||||||
let device;
|
const device = getDeviceType()
|
||||||
|
|
||||||
if (window.location.search === '?desktop') {
|
|
||||||
device = "desktop";
|
|
||||||
}
|
|
||||||
else if (window.location.search === '?mobile') {
|
|
||||||
device = "mobile";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
device = isMobile() ? "mobile" : "desktop";
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log("Setting device cookie to:", device);
|
console.log("Setting device cookie to:", device);
|
||||||
|
|
||||||
setCookie("trilium-device", device);
|
setCookie("trilium-device", device);
|
||||||
|
|
||||||
function setCookie(name, value) {
|
function setCookie(name, value) {
|
||||||
@ -66,21 +59,21 @@
|
|||||||
document.cookie = name + "=" + (value || "") + expires + "; path=/";
|
document.cookie = name + "=" + (value || "") + expires + "; path=/";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getDeviceType() {
|
||||||
|
if (window.location.search === '?desktop') return "desktop";
|
||||||
|
if (window.location.search === '?mobile') return "mobile";
|
||||||
|
return isMobile() ? "mobile" : "desktop";
|
||||||
|
}
|
||||||
|
|
||||||
// https://stackoverflow.com/a/73731646/944162
|
// https://stackoverflow.com/a/73731646/944162
|
||||||
function isMobile() {
|
function isMobile() {
|
||||||
const mQ = matchMedia?.('(pointer:coarse)');
|
const mQ = matchMedia?.('(pointer:coarse)');
|
||||||
if (mQ?.media === '(pointer:coarse)') return !!mQ.matches;
|
if (mQ?.media === '(pointer:coarse)') return !!mQ.matches;
|
||||||
|
|
||||||
if ('orientation' in window) return true;
|
if ('orientation' in window) return true;
|
||||||
|
const userAgentsRegEx = /\b(Android|iPhone|iPad|iPod|Windows Phone|BlackBerry|webOS|IEMobile)\b/i
|
||||||
return /\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(navigator.userAgent) ||
|
return userAgentsRegEx.test(navigator.userAgent)
|
||||||
/\b(Android|Windows Phone|iPad|iPod)\b/i.test(navigator.userAgent);
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<link href="<%= assetPath %>/node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
||||||
<link href="<%= assetPath %>/stylesheets/theme-light.css" rel="stylesheet" />
|
|
||||||
<link href="<%= assetPath %>/stylesheets/theme-next.css" rel="stylesheet" />
|
|
||||||
<link href="<%= assetPath %>/stylesheets/style.css" rel="stylesheet">
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -94,7 +94,7 @@
|
|||||||
},
|
},
|
||||||
"login": {
|
"login": {
|
||||||
"title": "Login",
|
"title": "Login",
|
||||||
"heading": "Trilium login",
|
"heading": "Trilium Login",
|
||||||
"incorrect-password": "Password is incorrect. Please try again.",
|
"incorrect-password": "Password is incorrect. Please try again.",
|
||||||
"password": "Password",
|
"password": "Password",
|
||||||
"remember-me": "Remember me",
|
"remember-me": "Remember me",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user