Skip to content

Commit

Permalink
Merge branch 'develop' of ssh://github.com/TriliumNext/Notes into dev…
Browse files Browse the repository at this point in the history
…elop
  • Loading branch information
eliandoran committed Jan 8, 2025
2 parents 2e1b472 + 564f1b9 commit 88c7a92
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 24 deletions.
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
39 changes: 16 additions & 23 deletions src/views/login.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down Expand Up @@ -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) {
Expand All @@ -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>
2 changes: 1 addition & 1 deletion translations/en/server.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 88c7a92

Please sign in to comment.