From 6d9f73eef76391b1dc1796f05e4c699913778c0b Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Mon, 30 Dec 2019 21:54:13 +0100 Subject: [PATCH] Improved integration of external renderer --- ElectronClient/app/InteropServiceHelper.js | 1 - ElectronClient/app/gui/NoteText.jsx | 3 +- ElectronClient/app/gui/note-viewer/index.html | 30 +- ElectronClient/app/package-lock.json | 11 +- ElectronClient/app/package.json | 3 +- .../lib/components/note-body-viewer.js | 16 +- .../lib/services/InteropService.js | 1 + .../services/InteropService_Exporter_Html.js | 39 +-- ReactNativeClient/package-lock.json | 6 +- ReactNativeClient/package.json | 2 +- package-lock.json | 317 +++++++++++++++++- package.json | 3 + 12 files changed, 333 insertions(+), 99 deletions(-) diff --git a/ElectronClient/app/InteropServiceHelper.js b/ElectronClient/app/InteropServiceHelper.js index 4a8dde2d1..0e9314cce 100644 --- a/ElectronClient/app/InteropServiceHelper.js +++ b/ElectronClient/app/InteropServiceHelper.js @@ -5,7 +5,6 @@ const Setting = require('lib/models/Setting'); const md5 = require('md5'); const url = require('url'); const { shim } = require('lib/shim'); -// const { BrowserWindow } = require('electron'); class InteropServiceHelper { diff --git a/ElectronClient/app/gui/NoteText.jsx b/ElectronClient/app/gui/NoteText.jsx index 00cba4dce..bc045827d 100644 --- a/ElectronClient/app/gui/NoteText.jsx +++ b/ElectronClient/app/gui/NoteText.jsx @@ -15,7 +15,7 @@ const TagList = require('./TagList.min.js'); const { connect } = require('react-redux'); const { _ } = require('lib/locale.js'); const { reg } = require('lib/registry.js'); -const { MarkupToHtml } = require('joplin-renderer'); +const { MarkupToHtml, assetsToHeaders } = require('joplin-renderer'); const shared = require('lib/components/shared/note-screen-shared.js'); const { bridge } = require('electron').remote.require('./bridge'); const { themeStyle } = require('../theme.js'); @@ -2004,6 +2004,7 @@ class NoteTextComponent extends React.Component { if (htmlHasChanged) { let options = { pluginAssets: this.state.lastRenderPluginAssets, + pluginAssetsHeadersHtml: assetsToHeaders(this.state.lastRenderPluginAssets), downloadResources: Setting.value('sync.resourceDownloadMode'), }; this.webviewRef_.current.wrappedInstance.send('setHtml', html, options); diff --git a/ElectronClient/app/gui/note-viewer/index.html b/ElectronClient/app/gui/note-viewer/index.html index 0addb403b..25fa2ed81 100644 --- a/ElectronClient/app/gui/note-viewer/index.html +++ b/ElectronClient/app/gui/note-viewer/index.html @@ -1,6 +1,6 @@ - +