mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 10:22:29 +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.
|
||||
# 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
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
|
@ -6,11 +6,16 @@
|
||||
<title><%= t("login.title") %></title>
|
||||
<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="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>
|
||||
<body>
|
||||
<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;">
|
||||
<h1><%= t("login.heading") %></h1>
|
||||
<div class="col-xs-12 col-sm-10 col-md-6 col-lg-4 col-xl-4 mx-auto pt-4">
|
||||
<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) { %>
|
||||
<div class="alert alert-warning">
|
||||
@ -43,20 +48,8 @@
|
||||
// Required for correct loading of scripts in Electron
|
||||
if (typeof module === 'object') {window.module = module; module = undefined;}
|
||||
|
||||
let device;
|
||||
|
||||
if (window.location.search === '?desktop') {
|
||||
device = "desktop";
|
||||
}
|
||||
else if (window.location.search === '?mobile') {
|
||||
device = "mobile";
|
||||
}
|
||||
else {
|
||||
device = isMobile() ? "mobile" : "desktop";
|
||||
}
|
||||
|
||||
const device = getDeviceType()
|
||||
console.log("Setting device cookie to:", device);
|
||||
|
||||
setCookie("trilium-device", device);
|
||||
|
||||
function setCookie(name, value) {
|
||||
@ -66,21 +59,21 @@
|
||||
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
|
||||
function isMobile() {
|
||||
const mQ = matchMedia?.('(pointer:coarse)');
|
||||
if (mQ?.media === '(pointer:coarse)') return !!mQ.matches;
|
||||
|
||||
if ('orientation' in window) return true;
|
||||
|
||||
return /\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(navigator.userAgent) ||
|
||||
/\b(Android|Windows Phone|iPad|iPod)\b/i.test(navigator.userAgent);
|
||||
const userAgentsRegEx = /\b(Android|iPhone|iPad|iPod|Windows Phone|BlackBerry|webOS|IEMobile)\b/i
|
||||
return userAgentsRegEx.test(navigator.userAgent)
|
||||
}
|
||||
</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>
|
||||
</html>
|
||||
|
@ -94,7 +94,7 @@
|
||||
},
|
||||
"login": {
|
||||
"title": "Login",
|
||||
"heading": "Trilium login",
|
||||
"heading": "Trilium Login",
|
||||
"incorrect-password": "Password is incorrect. Please try again.",
|
||||
"password": "Password",
|
||||
"remember-me": "Remember me",
|
||||
|
Loading…
x
Reference in New Issue
Block a user