1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-09-16 08:56:40 +02:00

Various improvements on mobile app

This commit is contained in:
Laurent Cozic
2017-08-21 20:32:43 +02:00
parent 97c73b22d1
commit 1da06734f1
7 changed files with 27 additions and 17 deletions

View File

@@ -28,6 +28,7 @@ class Application {
this.commandMetadata_ = null; this.commandMetadata_ = null;
this.activeCommand_ = null; this.activeCommand_ = null;
this.allCommandsLoaded_ = false; this.allCommandsLoaded_ = false;
this.showStackTraces_ = false;
} }
currentFolder() { currentFolder() {
@@ -129,7 +130,7 @@ class Application {
} }
if (arg == '--stack-trace-enabled') { if (arg == '--stack-trace-enabled') {
//vorpalUtils.setStackTraceEnabled(true); this.showStackTraces_ = true;
argv.splice(0, 1); argv.splice(0, 1);
continue; continue;
} }
@@ -428,7 +429,11 @@ class Application {
try { try {
await this.execCommand(argv); await this.execCommand(argv);
} catch (error) { } catch (error) {
if (this.showStackTraces_) {
console.info(error); console.info(error);
} else {
console.info(error.message);
}
} }
} }

View File

@@ -7,7 +7,7 @@
"url": "https://github.com/laurent22/joplin" "url": "https://github.com/laurent22/joplin"
}, },
"url": "git://github.com/laurent22/joplin.git", "url": "git://github.com/laurent22/joplin.git",
"version": "0.9.10", "version": "0.9.11",
"bin": { "bin": {
"joplin": "./main.js" "joplin": "./main.js"
}, },

View File

@@ -1 +1 @@
6aa2be3698aa3b5cf8e0875bf37c7851 7863f7005a6fd4ec83c3b2a8df8a5f60

View File

@@ -51,7 +51,7 @@ class LogScreenComponent extends BaseScreenComponent {
styles.rowTextError = Object.assign({}, styles.rowText); styles.rowTextError = Object.assign({}, styles.rowText);
styles.rowTextError.color = theme.colorError; styles.rowTextError.color = theme.colorError;
styles.rowTextWarn = Object.assign({}, styles.rowWarn); styles.rowTextWarn = Object.assign({}, styles.rowText);
styles.rowTextWarn.color = theme.colorWarn; styles.rowTextWarn.color = theme.colorWarn;
this.styles_[this.props.theme] = StyleSheet.create(styles); this.styles_[this.props.theme] = StyleSheet.create(styles);

View File

@@ -76,14 +76,6 @@ class NoteScreenComponent extends BaseScreenComponent {
this.styles_ = {}; this.styles_ = {};
let styles = { let styles = {
// titleTextInput: {
// flex: 1,
// paddingLeft: 0,
// color: theme.color,
// backgroundColor: theme.backgroundColor,
// fontWeight: 'bold',
// fontSize: theme.fontSize,
// },
bodyTextInput: { bodyTextInput: {
flex: 1, flex: 1,
paddingLeft: theme.marginLeft, paddingLeft: theme.marginLeft,
@@ -117,6 +109,7 @@ class NoteScreenComponent extends BaseScreenComponent {
}; };
styles.titleContainerTodo = Object.assign({}, styles.titleContainer); styles.titleContainerTodo = Object.assign({}, styles.titleContainer);
styles.titleContainerTodo.paddingLeft = 0;
this.styles_[themeId] = StyleSheet.create(styles); this.styles_[themeId] = StyleSheet.create(styles);
return this.styles_[themeId]; return this.styles_[themeId];
@@ -459,9 +452,15 @@ class NoteScreenComponent extends BaseScreenComponent {
titleTextInputStyle.height = this.state.titleTextInputHeight; titleTextInputStyle.height = this.state.titleTextInputHeight;
let checkboxStyle = {
color: theme.color,
paddingRight: 10,
paddingLeft: theme.marginLeft,
}
const titleComp = ( const titleComp = (
<View style={titleContainerStyle}> <View style={titleContainerStyle}>
{ isTodo && <Checkbox style={{ color: theme.color }} checked={!!Number(note.todo_completed)} onChange={(checked) => { this.todoCheckbox_change(checked) }} /> } { isTodo && <Checkbox style={checkboxStyle} checked={!!Number(note.todo_completed)} onChange={(checked) => { this.todoCheckbox_change(checked) }} /> }
<TextInput <TextInput
onContentSizeChange={(event) => this.titleTextInput_contentSizeChange(event)} onContentSizeChange={(event) => this.titleTextInput_contentSizeChange(event)}
autoFocus={isNew} autoFocus={isNew}

View File

@@ -57,7 +57,7 @@ class Synchronizer {
if (report.deleteLocal) lines.push(_('Deleted local items: %d.', report.deleteLocal)); if (report.deleteLocal) lines.push(_('Deleted local items: %d.', report.deleteLocal));
if (report.deleteRemote) lines.push(_('Deleted remote items: %d.', report.deleteRemote)); if (report.deleteRemote) lines.push(_('Deleted remote items: %d.', report.deleteRemote));
if (!report.completedTime && report.state) lines.push(_('State: "%s".', report.state)); if (!report.completedTime && report.state) lines.push(_('State: "%s".', report.state));
if (report.errors && report.errors.length) lines.push(_('Last error: %s (stacktrace in log).', report.errors[report.errors.length-1].message)); //if (report.errors && report.errors.length) lines.push(_('Last error: %s (stacktrace in log).', report.errors[report.errors.length-1].message));
if (report.cancelling && !report.completedTime) lines.push(_('Cancelling...')); if (report.cancelling && !report.completedTime) lines.push(_('Cancelling...'));
if (report.completedTime) lines.push(_('Completed: %s', time.unixMsToLocalDateTime(report.completedTime))); if (report.completedTime) lines.push(_('Completed: %s', time.unixMsToLocalDateTime(report.completedTime)));

View File

@@ -218,7 +218,7 @@ const reducer = (state = defaultState, action) => {
const modNote = action.note; const modNote = action.note;
let newNotes = state.notes.splice(0); let newNotes = state.notes.slice();
var found = false; var found = false;
for (let i = 0; i < newNotes.length; i++) { for (let i = 0; i < newNotes.length; i++) {
let n = newNotes[i]; let n = newNotes[i];
@@ -227,7 +227,13 @@ const reducer = (state = defaultState, action) => {
if (!('parent_id' in modNote) || modNote.parent_id == n.parent_id) { if (!('parent_id' in modNote) || modNote.parent_id == n.parent_id) {
// Merge the properties that have changed (in modNote) into // Merge the properties that have changed (in modNote) into
// the object we already have. // the object we already have.
newNotes[i] = Object.assign(newNotes[i], action.note); newNotes[i] = Object.assign({}, newNotes[i]);
for (let n in modNote) {
if (!modNote.hasOwnProperty(n)) continue;
newNotes[i][n] = modNote[n];
}
} else { } else {
newNotes.splice(i, 1); newNotes.splice(i, 1);
} }