1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-21 23:17:42 +02:00

Mobile: Improved loading of images. Added privacy policy url.

This commit is contained in:
Laurent Cozic
2017-11-20 18:25:23 +00:00
parent e2cbef1538
commit 37de5fd4b3
6 changed files with 42 additions and 31 deletions

View File

@ -2,6 +2,7 @@ const React = require('react'); const Component = React.Component;
const { Platform, WebView, View, Linking } = require('react-native');
const { globalStyle } = require('lib/components/global-style.js');
const { Resource } = require('lib/models/resource.js');
const { Setting } = require('lib/models/setting.js');
const { reg } = require('lib/registry.js');
const MdToHtml = require('lib/MdToHtml.js');
@ -82,7 +83,8 @@ class NoteBodyViewer extends Component {
<WebView
scalesPageToFit={Platform.OS !== 'ios'}
style={webViewStyle}
source={{ html: html }}
{/* baseUrl is where the images will be loaded from. So images must use a path relative to resourceDir. */}
source={{ html: html, baseUrl: 'file://' + Setting.value('resourceDir') + '/' }}
onLoadEnd={() => this.onLoadEnd()}
onError={(e) => reg.logger().error('WebView error', e) }
onMessage={(event) => {