mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 10:02:59 +08:00
fix(server): missing boxicons in desktop/mobile
This commit is contained in:
parent
4216a71a85
commit
8e73c5906d
@ -1,14 +1,9 @@
|
|||||||
import "normalize.css";
|
import "normalize.css";
|
||||||
|
import "boxicons/css/boxicons.min.css";
|
||||||
import "@triliumnext/ckeditor5/content.css";
|
import "@triliumnext/ckeditor5/content.css";
|
||||||
import "@triliumnext/share-theme/styles/index.css";
|
import "@triliumnext/share-theme/styles/index.css";
|
||||||
import "@triliumnext/share-theme/scripts/index.js";
|
import "@triliumnext/share-theme/scripts/index.js";
|
||||||
|
|
||||||
async function loadIcons() {
|
|
||||||
if (document.getElementById("menu")) {
|
|
||||||
await import("boxicons/css/boxicons.min.css");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function ensureJQuery() {
|
async function ensureJQuery() {
|
||||||
const $ = (await import("jquery")).default;
|
const $ = (await import("jquery")).default;
|
||||||
(window as any).$ = $;
|
(window as any).$ = $;
|
||||||
@ -53,7 +48,6 @@ document.addEventListener(
|
|||||||
"DOMContentLoaded",
|
"DOMContentLoaded",
|
||||||
() => {
|
() => {
|
||||||
formatCodeBlocks();
|
formatCodeBlocks();
|
||||||
loadIcons();
|
|
||||||
applyMath();
|
applyMath();
|
||||||
|
|
||||||
const toggleMenuButton = document.getElementById("toggleMenuButton");
|
const toggleMenuButton = document.getElementById("toggleMenuButton");
|
||||||
|
@ -50,6 +50,7 @@
|
|||||||
<% } %>
|
<% } %>
|
||||||
|
|
||||||
<link href="<%= assetPath %>/stylesheets/style.css" rel="stylesheet">
|
<link href="<%= assetPath %>/stylesheets/style.css" rel="stylesheet">
|
||||||
|
<link href="<%= assetPath %>/src/boxicons.css" rel="stylesheet">
|
||||||
<link href="<%= assetPath %>/stylesheets/print.css" rel="stylesheet" media="print">
|
<link href="<%= assetPath %>/stylesheets/print.css" rel="stylesheet" media="print">
|
||||||
|
|
||||||
<script src="<%= appPath %>/runtime.js" crossorigin type="module"></script>
|
<script src="<%= appPath %>/runtime.js" crossorigin type="module"></script>
|
||||||
|
@ -128,6 +128,7 @@
|
|||||||
<% } %>
|
<% } %>
|
||||||
|
|
||||||
<link href="<%= assetPath %>/stylesheets/style.css" rel="stylesheet">
|
<link href="<%= assetPath %>/stylesheets/style.css" rel="stylesheet">
|
||||||
|
<link href="<%= assetPath %>/src/boxicons.css" rel="stylesheet">
|
||||||
<link href="<%= assetPath %>/stylesheets/print.css" rel="stylesheet" media="print">
|
<link href="<%= assetPath %>/stylesheets/print.css" rel="stylesheet" media="print">
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
<% const hasTree = subRoot.note.hasVisibleChildren(); %>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
||||||
@ -8,6 +9,7 @@
|
|||||||
<script src="<%= appPath %>/share.js" type="module"></script>
|
<script src="<%= appPath %>/share.js" type="module"></script>
|
||||||
<% if (!isDev && !note.isLabelTruthy("shareOmitDefaultCss")) { %>
|
<% if (!isDev && !note.isLabelTruthy("shareOmitDefaultCss")) { %>
|
||||||
<link href="<%= assetPath %>/src/share.css" rel="stylesheet">
|
<link href="<%= assetPath %>/src/share.css" rel="stylesheet">
|
||||||
|
<link href="<%= assetPath %>/src/boxicons.css" rel="stylesheet">
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
||||||
<% for (const cssRelation of note.getRelations("shareCss")) { %>
|
<% for (const cssRelation of note.getRelations("shareCss")) { %>
|
||||||
@ -64,7 +66,6 @@ const themeClass = currentTheme === "light" ? " theme-light" : " theme-dark";
|
|||||||
const headingRe = /(<h[1-6]>)(.+?)(<\/h[1-6]>)/g;
|
const headingRe = /(<h[1-6]>)(.+?)(<\/h[1-6]>)/g;
|
||||||
const headingMatches = [...content.matchAll(headingRe)];
|
const headingMatches = [...content.matchAll(headingRe)];
|
||||||
const slugify = (text) => text.toLowerCase().replace(/[^\w]/g, "-");
|
const slugify = (text) => text.toLowerCase().replace(/[^\w]/g, "-");
|
||||||
const hasTree = subRoot.note.hasVisibleChildren();
|
|
||||||
content = content.replaceAll(headingRe, (...match) => {
|
content = content.replaceAll(headingRe, (...match) => {
|
||||||
match[0] = match[0].replace(match[3], `<a id="${slugify(match[2])}" class="toc-anchor" name="${slugify(match[2])}" href="#${slugify(match[2])}">#</a>${match[3]}`);
|
match[0] = match[0].replace(match[3], `<a id="${slugify(match[2])}" class="toc-anchor" name="${slugify(match[2])}" href="#${slugify(match[2])}">#</a>${match[3]}`);
|
||||||
return match[0];
|
return match[0];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user