diff --git a/bin/copy-dist.ts b/bin/copy-dist.ts index bdb4e311e..6ffc2cf98 100644 --- a/bin/copy-dist.ts +++ b/bin/copy-dist.ts @@ -81,7 +81,6 @@ const copy = async () => { "node_modules/mermaid/dist/", "node_modules/jquery/dist/", "node_modules/jquery-hotkeys/", - "node_modules/print-this/", "node_modules/split.js/dist/", "node_modules/panzoom/dist/", "node_modules/i18next/", diff --git a/package-lock.json b/package-lock.json index da8a3c313..49e028734 100644 --- a/package-lock.json +++ b/package-lock.json @@ -78,7 +78,6 @@ "normalize-strings": "1.1.1", "normalize.css": "8.0.1", "panzoom": "9.4.3", - "print-this": "2.0.0", "rand-token": "1.0.1", "react": "18.3.1", "react-dom": "18.3.1", @@ -12681,15 +12680,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/opencollective-postinstall": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz", - "integrity": "sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==", - "license": "MIT", - "bin": { - "opencollective-postinstall": "index.js" - } - }, "node_modules/ora": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", @@ -13495,17 +13485,6 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, - "node_modules/print-this": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/print-this/-/print-this-2.0.0.tgz", - "integrity": "sha512-/v1/tXs4BQGpEF7OYKe05h4xiQR09Q4HgASL28pngx6aedCQaB1OlHs8t9RDVgUayXHDWHG9V5EBjPlXb46k4w==", - "hasInstallScript": true, - "license": "MIT", - "dependencies": { - "jquery": ">=1.11", - "opencollective-postinstall": "^2.0.2" - } - }, "node_modules/proc-log": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-2.0.1.tgz", diff --git a/package.json b/package.json index c84735495..4216a3d26 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,6 @@ "normalize-strings": "1.1.1", "normalize.css": "8.0.1", "panzoom": "9.4.3", - "print-this": "2.0.0", "rand-token": "1.0.1", "react": "18.3.1", "react-dom": "18.3.1", diff --git a/src/public/app/services/library_loader.ts b/src/public/app/services/library_loader.ts index f8b363302..0cb836f39 100644 --- a/src/public/app/services/library_loader.ts +++ b/src/public/app/services/library_loader.ts @@ -51,10 +51,6 @@ const RELATION_MAP: Library = { css: ["stylesheets/relation_map.css"] }; -const PRINT_THIS: Library = { - js: ["node_modules/print-this/printThis.js"] -}; - const CALENDAR_WIDGET: Library = { css: ["stylesheets/calendar.css"] }; @@ -193,7 +189,6 @@ export default { CODE_MIRROR, ESLINT, RELATION_MAP, - PRINT_THIS, CALENDAR_WIDGET, KATEX, WHEEL_ZOOM, diff --git a/src/public/app/widgets/note_detail.js b/src/public/app/widgets/note_detail.js index 7c3de4426..21f84dbc1 100644 --- a/src/public/app/widgets/note_detail.js +++ b/src/public/app/widgets/note_detail.js @@ -250,46 +250,7 @@ export default class NoteDetailWidget extends NoteContextAwareWidget { return; } - await libraryLoader.requireLibrary(libraryLoader.PRINT_THIS); - - let $promotedAttributes = $(""); - - if (this.note.getPromotedDefinitionAttributes().length > 0) { - $promotedAttributes = (await attributeRenderer.renderNormalAttributes(this.note)).$renderedAttributes; - } - - const { assetPath } = window.glob; - const cssToLoad = [ - `${assetPath}/node_modules/codemirror/lib/codemirror.css`, - `${assetPath}/libraries/ckeditor/ckeditor-content.css`, - `${assetPath}/node_modules/bootstrap/dist/css/bootstrap.min.css`, - `${assetPath}/node_modules/katex/dist/katex.min.css`, - `${assetPath}/stylesheets/print.css`, - `${assetPath}/stylesheets/relation_map.css`, - `${assetPath}/stylesheets/ckeditor-theme.css` - ]; - - if (isSyntaxHighlightEnabled()) { - cssToLoad.push(getStylesheetUrl("default:vs")); - } - - this.$widget.find(".note-detail-printable:visible").printThis({ - header: $("
").append($("

").text(this.note.title)).append($promotedAttributes).prop("outerHTML"), - - footer: ` - - - - -`, - importCSS: false, - loadCSS: cssToLoad, - debug: true - }); + window.print(); } async exportAsPdfEvent() { diff --git a/src/routes/assets.ts b/src/routes/assets.ts index c20c468d0..959de788b 100644 --- a/src/routes/assets.ts +++ b/src/routes/assets.ts @@ -66,8 +66,6 @@ async function register(app: express.Application) { app.use(`/${assetPath}/node_modules/jquery-hotkeys/`, persistentCacheStatic(path.join(srcRoot, "..", "node_modules/jquery-hotkeys/"))); - app.use(`/${assetPath}/node_modules/print-this/`, persistentCacheStatic(path.join(srcRoot, "..", "node_modules/print-this/"))); - app.use(`/${assetPath}/node_modules/split.js/dist/`, persistentCacheStatic(path.join(srcRoot, "..", "node_modules/split.js/dist/"))); app.use(`/${assetPath}/node_modules/panzoom/dist/`, persistentCacheStatic(path.join(srcRoot, "..", "node_modules/panzoom/dist/")));