1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 01:36:22 +00:00

Merge branch 'fence-attrs' into chart-yaml

This commit is contained in:
Baptiste Augrain
2018-09-30 21:46:09 +02:00
78 changed files with 2321 additions and 589 deletions

View File

@@ -78,9 +78,11 @@ app.on('ready', function () {
var template = require('./main-menu')
var menu = Menu.buildFromTemplate(template)
var touchBarMenu = require('./touchbar-menu')
switch (process.platform) {
case 'darwin':
Menu.setApplicationMenu(menu)
mainWindow.setTouchBar(touchBarMenu)
break
case 'win32':
mainWindow.setMenu(menu)

View File

@@ -145,6 +145,16 @@ const file = {
{
type: 'separator'
},
{
label: 'Generate/Update Markdown TOC',
accelerator: 'Shift+Ctrl+T',
click () {
mainWindow.webContents.send('code:generate-toc')
}
},
{
type: 'separator'
},
{
label: 'Print',
accelerator: 'CommandOrControl+P',

View File

@@ -10,6 +10,7 @@
<link rel="stylesheet" href="../node_modules/codemirror/lib/codemirror.css">
<link rel="stylesheet" href="../node_modules/katex/dist/katex.min.css">
<link rel="stylesheet" href="../node_modules/codemirror/addon/dialog/dialog.css">
<title>Boostnote</title>
<style>
@@ -101,6 +102,7 @@
<script src="../extra_scripts/boost/boostNewLineIndentContinueMarkdownList.js"></script>
<script src="../extra_scripts/codemirror/mode/bfm/bfm.js"></script>
<script src="../extra_scripts/codemirror/addon/hyperlink/hyperlink.js"></script>
<script src="../node_modules/codemirror/addon/edit/closebrackets.js"></script>
<script src="../node_modules/codemirror/addon/edit/matchbrackets.js"></script>

41
lib/touchbar-menu.js Normal file
View File

@@ -0,0 +1,41 @@
const {TouchBar} = require('electron')
const {TouchBarButton, TouchBarSpacer} = TouchBar
const mainWindow = require('./main-window')
const allNotes = new TouchBarButton({
label: '📒',
click: () => {
mainWindow.webContents.send('list:navigate', '/home')
}
})
const starredNotes = new TouchBarButton({
label: '⭐️',
click: () => {
mainWindow.webContents.send('list:navigate', '/starred')
}
})
const trash = new TouchBarButton({
label: '🗑',
click: () => {
mainWindow.webContents.send('list:navigate', '/trashed')
}
})
const newNote = new TouchBarButton({
label: '✎',
click: () => {
mainWindow.webContents.send('list:navigate', '/home')
mainWindow.webContents.send('top:new-note')
}
})
module.exports = new TouchBar([
allNotes,
starredNotes,
trash,
new TouchBarSpacer({size: 'small'}),
newNote
])