1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-01-11 18:24:43 +02:00

Minor fixing on note rendering

This commit is contained in:
Laurent Cozic 2017-11-21 19:47:29 +00:00
parent 48b648e656
commit 6283bf6190
6 changed files with 9 additions and 4 deletions

View File

@ -345,6 +345,8 @@ class Application extends BaseApplication {
// For those who leave the app always open // For those who leave the app always open
setInterval(() => { runAutoUpdateCheck() }, 2 * 60 * 60 * 1000); setInterval(() => { runAutoUpdateCheck() }, 2 * 60 * 60 * 1000);
} }
reg.scheduleSync();
} }
} }

View File

@ -238,6 +238,7 @@ class MdToHtml {
render(body, style, options = null) { render(body, style, options = null) {
if (!options) options = {}; if (!options) options = {};
if (!options.postMessageSyntax) options.postMessageSyntax = 'postMessage'; if (!options.postMessageSyntax) options.postMessageSyntax = 'postMessage';
if (!options.paddingBottom) options.paddingBottom = '0';
const cacheKey = this.makeContentKey(this.loadedResources_, body, style, options); const cacheKey = this.makeContentKey(this.loadedResources_, body, style, options);
if (this.cachedContentKey_ === cacheKey) return this.cachedContent_; if (this.cachedContentKey_ === cacheKey) return this.cachedContent_;
@ -298,6 +299,7 @@ class MdToHtml {
line-height: ` + style.htmlLineHeight + `; line-height: ` + style.htmlLineHeight + `;
background-color: ` + style.htmlBackgroundColor + `; background-color: ` + style.htmlBackgroundColor + `;
font-family: sans-serif; font-family: sans-serif;
padding-bottom: ` + options.paddingBottom + `;
} }
p, h1, h2, h3, h4, ul, table { p, h1, h2, h3, h4, ul, table {
margin-top: 0; margin-top: 0;

View File

@ -48,6 +48,7 @@ class NoteBodyViewer extends Component {
onResourceLoaded: () => { onResourceLoaded: () => {
this.forceUpdate(); this.forceUpdate();
}, },
paddingBottom: '3.8em', // Extra bottom padding to make it possible to scroll past the action button (so that it doesn't overlap the text)
}; };
const html = this.mdToHtml_.render(note ? note.body : '', this.props.webViewStyle, mdOptions); const html = this.mdToHtml_.render(note ? note.body : '', this.props.webViewStyle, mdOptions);
@ -79,7 +80,10 @@ class NoteBodyViewer extends Component {
// So we use scalesPageToFix=false on iOS along with that CSS rule. // So we use scalesPageToFix=false on iOS along with that CSS rule.
// `baseUrl` is where the images will be loaded from. So images must use a path relative to resourceDir. // `baseUrl` is where the images will be loaded from. So images must use a path relative to resourceDir.
const source = { html: html, baseUrl: 'file://' + Setting.value('resourceDir') + '/' }; const source = {
html: html,
baseUrl: 'file://' + Setting.value('resourceDir') + '/',
};
return ( return (
<View style={style}> <View style={style}>

View File

@ -1,6 +1,5 @@
const { BaseItem } = require('lib/models/base-item.js'); const { BaseItem } = require('lib/models/base-item.js');
const { BaseModel } = require('lib/base-model.js'); const { BaseModel } = require('lib/base-model.js');
const lodash = require('lodash');
class NoteTag extends BaseItem { class NoteTag extends BaseItem {

View File

@ -5,7 +5,6 @@ const { mime } = require('lib/mime-utils.js');
const { filename } = require('lib/path-utils.js'); const { filename } = require('lib/path-utils.js');
const { FsDriverDummy } = require('lib/fs-driver-dummy.js'); const { FsDriverDummy } = require('lib/fs-driver-dummy.js');
const { markdownUtils } = require('lib/markdown-utils.js'); const { markdownUtils } = require('lib/markdown-utils.js');
const lodash = require('lodash');
class Resource extends BaseItem { class Resource extends BaseItem {

View File

@ -3,7 +3,6 @@ const { BaseItem } = require('lib/models/base-item.js');
const { NoteTag } = require('lib/models/note-tag.js'); const { NoteTag } = require('lib/models/note-tag.js');
const { Note } = require('lib/models/note.js'); const { Note } = require('lib/models/note.js');
const { time } = require('lib/time-utils.js'); const { time } = require('lib/time-utils.js');
const lodash = require('lodash');
class Tag extends BaseItem { class Tag extends BaseItem {