mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-09 08:45:55 +02:00
ee106105d8
* Added support for the dark mode on desktop * Add dark highlighting to the code tags * Update app/theme.js to be more clear and more easily support additional themes Update more files to conform to theming
34 lines
613 B
JavaScript
34 lines
613 B
JavaScript
const smalltalk = require('smalltalk');
|
|
|
|
class Dialogs {
|
|
|
|
async alert(message, title = '') {
|
|
await smalltalk.alert(title, message);
|
|
}
|
|
|
|
async confirm(message, title = '') {
|
|
try {
|
|
await smalltalk.confirm(title, message);
|
|
return true;
|
|
} catch (error) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
async prompt(message, title = '', defaultValue = '', options = null) {
|
|
if (options === null) options = {};
|
|
|
|
try {
|
|
const answer = await smalltalk.prompt(title, message, defaultValue, options);
|
|
return answer;
|
|
} catch (error) {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
const dialogs = new Dialogs();
|
|
|
|
module.exports = dialogs;
|