1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +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

@@ -105,8 +105,8 @@ class Dropdown extends React.Component {
return (
<View style={{flex: 1, flexDirection: 'column' }}>
<TouchableOpacity style={headerWrapperStyle} ref={(ref) => this.headerRef_ = ref} onPress={() => { this.setState({ listVisible: true }) }}>
<Text style={headerArrowStyle}>{'▼'}</Text>
<Text ellipsizeMode="tail" numberOfLines={1} style={headerStyle}>{headerLabel}</Text>
<Text style={headerArrowStyle}>{'▼'}</Text>
</TouchableOpacity>
<Modal transparent={true} visible={this.state.listVisible} onRequestClose={() => { closeList(); }} >
<TouchableWithoutFeedback onPressOut={() => { closeList() }}>

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) => {

View File

@@ -1,5 +1,5 @@
const React = require('react'); const Component = React.Component;
const { View, Switch, Slider, StyleSheet, Text, Button, ScrollView } = require('react-native');
const { TouchableOpacity, Linking, View, Switch, Slider, StyleSheet, Text, Button, ScrollView } = require('react-native');
const { connect } = require('react-redux');
const { ScreenHeader } = require('lib/components/screen-header.js');
const { _, setLocale } = require('lib/locale.js');
@@ -62,6 +62,12 @@ class ConfigScreenComponent extends BaseScreenComponent {
styles.switchSettingContainer.flexDirection = 'row';
styles.switchSettingContainer.justifyContent = 'space-between';
styles.linkText = Object.assign({}, styles.settingText);
styles.linkText.borderBottomWidth = 1;
styles.linkText.borderBottomColor = theme.color;
styles.linkText.flex = 0;
styles.linkText.fontWeight = 'normal';
styles.switchSettingControl = Object.assign({}, styles.settingControl);
delete styles.switchSettingControl.color;
//styles.switchSettingControl.width = '20%';
@@ -149,6 +155,22 @@ class ConfigScreenComponent extends BaseScreenComponent {
if (!comp) continue;
settingComps.push(comp);
}
settingComps.push(
<View key="website_link" style={this.styles().settingContainer}>
<TouchableOpacity onPress={() => { Linking.openURL('http://joplin.cozic.net/') }}>
<Text key="label" style={this.styles().linkText}>Joplin Website</Text>
</TouchableOpacity>
</View>
);
settingComps.push(
<View key="privacy_link" style={this.styles().settingContainer}>
<TouchableOpacity onPress={() => { Linking.openURL('http://joplin.cozic.net/privacy/') }}>
<Text key="label" style={this.styles().linkText}>Privacy Policy</Text>
</TouchableOpacity>
</View>
);
//style={this.styles().body}