1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-08-24 20:19:10 +02:00

Compare commits

...

5 Commits

Author SHA1 Message Date
Laurent Cozic
971b20062f Electron release v1.0.103 2018-06-21 19:13:10 +01:00
Laurent Cozic
936f334b61 Electron: Remove 'New notebook' shortcut 2018-06-21 19:12:08 +01:00
Laurent Cozic
7e3a290939 Merge pull request #628 from Abijeet/master
Adds a shortcut to insert the date and time.
2018-06-21 19:09:36 +01:00
Abijeet Patro
01d032261c Merge branch 'master' into master 2018-06-18 23:32:10 +05:30
Abijeet
07b85388fc Adds a shortcut to insert the date and time.
Closes #521
2018-06-16 20:46:27 +05:30
4 changed files with 31 additions and 13 deletions

View File

@@ -183,7 +183,7 @@ class Application extends BaseApplication {
if (action.type == 'SETTING_UPDATE_ONE' && action.key == 'locale' || action.type == 'SETTING_UPDATE_ALL') {
setLocale(Setting.value('locale'));
// The bridge runs within the main process, with its own instance of locale.js
// so it needs to be set too here.
// so it needs to be set too here.
bridge().setLocale(Setting.value('locale'));
this.refreshMenu();
}
@@ -362,7 +362,6 @@ class Application extends BaseApplication {
}
}, {
label: _('New notebook'),
accelerator: 'CommandOrControl+B',
screens: ['Main'],
click: () => {
this.dispatch({
@@ -442,6 +441,17 @@ class Application extends BaseApplication {
name: 'textItalic',
});
},
}, {
label: _('Insert Date Time'),
screens: ['Main'],
visible: false,
accelerator: 'CommandOrControl+Shift+T',
click: () => {
this.dispatch({
type: 'WINDOW_COMMAND',
name: 'insertDateTime',
});
},
}, {
type: 'separator',
screens: ['Main'],

View File

@@ -187,7 +187,7 @@ class NoteTextComponent extends React.Component {
}
}
return pos;
return pos;
}
textOffsetToCursorPosition(offset, body) {
@@ -597,8 +597,8 @@ class NoteTextComponent extends React.Component {
const letters = ['F', 'T', 'P', 'Q', 'L', ','];
for (let i = 0; i < letters.length; i++) {
const l = letters[i];
cancelledKeys.push('Ctrl+' + l);
cancelledKeys.push('Command+' + l);
cancelledKeys.push('Ctrl+' + l);
cancelledKeys.push('Command+' + l);
}
for (let i = 0; i < cancelledKeys.length; i++) {
@@ -751,6 +751,8 @@ class NoteTextComponent extends React.Component {
this.commandTextBold();
} else if (command.name === 'textItalic') {
this.commandTextItalic();
} else if (command.name === 'insertDateTime' ) {
this.commandDateTime();
} else if (command.name === 'commandStartExternalEditing') {
this.commandStartExternalEditing();
} else {
@@ -828,8 +830,6 @@ class NoteTextComponent extends React.Component {
destroyExternalEditWatcher() {
if (!this.externalEditWatcher_) return;
console.info(this.externalEditWatcher_);
this.externalEditWatcher_.off('noteChange', this.externalEditWatcher_noteChange);
this.externalEditWatcher_.stopWatchingAll();
this.externalEditWatcher_ = null;
@@ -924,8 +924,6 @@ class NoteTextComponent extends React.Component {
end: { row: p.row, column: p.column + defaultText.length },
};
console.info('DDDDD', defaultText, newRange);
this.updateEditorWithDelay((editor) => {
if (defaultText && newRange) {
const range = this.selectionRange_;
@@ -954,6 +952,10 @@ class NoteTextComponent extends React.Component {
this.wrapSelectionWithStrings('*', '*', _('emphasized text'));
}
commandDateTime() {
this.wrapSelectionWithStrings(time.formatMsToLocal(new Date().getTime()));
}
commandTextCode() {
this.wrapSelectionWithStrings('`', '`');
}
@@ -1046,7 +1048,7 @@ class NoteTextComponent extends React.Component {
tooltip: _('Hyperlink'),
iconName: 'fa-link',
onClick: () => { return this.commandTextLink(); },
});
});
toolbarItems.push({
tooltip: _('Code'),
@@ -1094,6 +1096,12 @@ class NoteTextComponent extends React.Component {
onClick: () => { return this.commandTextHorizontalRule(); },
});
toolbarItems.push({
tooltip: _('Insert Date Time'),
iconName: 'fa-calendar-plus-o',
onClick: () => { return this.commandDateTime(); },
});
toolbarItems.push({
type: 'separator',
});
@@ -1325,7 +1333,7 @@ class NoteTextComponent extends React.Component {
editorProps={{$blockScrolling: true}}
// This is buggy (gets outside the container)
highlightActiveLine={false}
highlightActiveLine={false}
/>
return (

View File

@@ -1,6 +1,6 @@
{
"name": "Joplin",
"version": "1.0.102",
"version": "1.0.103",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "Joplin",
"version": "1.0.102",
"version": "1.0.103",
"description": "Joplin for Desktop",
"main": "main.js",
"scripts": {