git ssb

10+

Matt McKegg / patchwork



Commit 903ae57ad0b262c3a6121da6deca07aad6f1ab66

Merge branch 'keyboard-shortcuts--back' of https://github.com/mrchrisadams/patchwork into mrchrisadams-keyboard-shortcuts--back

Matt McKegg committed on 5/14/2018, 12:48:11 AM
Parent: c173c2b41b860fbb9c38b6c51a466f9652d0461f
Parent: b6ad2e7692f72c980a5ef0564f60b049333a9e1e

Files changed

index.jschanged
main-window.jschanged
modules/page/html/render/gatherings.jschanged
modules/page/html/render/public.jschanged
index.jsView
@@ -44,9 +44,31 @@
4444 electron.app.on('ready', () => {
4545 setupContext('ssb', {
4646 server: !(process.argv.includes('-g') || process.argv.includes('--use-global-ssb'))
4747 }, () => {
48 + var browserWindow = openMainWindow()
4849 var menu = defaultMenu(electron.app, electron.shell)
50 +
51 + menu.splice(4, 0, {
52 + label: 'History',
53 + submenu: [
54 + {
55 + label: 'Forward',
56 + accelerator: 'CmdOrCtrl+]',
57 + click: () => {
58 + browserWindow.webContents.send('goForward')
59 + }
60 + },
61 + {
62 + label: 'Back',
63 + accelerator: 'CmdOrCtrl+[',
64 + click: () => {
65 + browserWindow.webContents.send('goBack')
66 + }
67 + }
68 + ]
69 + })
70 +
4971 var view = menu.find(x => x.label === 'View')
5072 view.submenu = [
5173 { role: 'reload' },
5274 { role: 'toggledevtools' },
@@ -73,10 +95,10 @@
7395 { type: 'separator' },
7496 { role: 'front' }
7597 ]
7698 }
99 +
77100 Menu.setApplicationMenu(Menu.buildFromTemplate(menu))
78- openMainWindow()
79101 })
80102
81103 electron.app.on('activate', function (e) {
82104 if (windows.main) {
@@ -126,8 +148,9 @@
126148 windows.main = null
127149 if (process.platform !== 'darwin') electron.app.quit()
128150 })
129151 }
152 + return windows.main
130153 }
131154
132155 function setupContext (appName, opts, cb) {
133156 ssbConfig = require('ssb-config/inject')(appName, extend({
main-window.jsView
@@ -72,8 +72,11 @@
7272 watch(pendingCount, count => {
7373 electron.remote.app.setBadgeCount(count)
7474 })
7575
76 + electron.ipcRenderer.on('goForward', views.goForward)
77 + electron.ipcRenderer.on('goBack', views.goBack)
78 +
7679 document.head.appendChild(
7780 h('style', {
7881 innerHTML: computed(api.settings.obs.get('patchwork.theme', 'light'), themeName => {
7982 return themes[themeName] || themes['light']
@@ -146,9 +149,8 @@
146149 } else {
147150 api.app.navigate(href)
148151 }
149152 })
150-
151153 return [container, previewElement]
152154
153155 // scoped
154156
modules/page/html/render/gatherings.jsView
@@ -70,5 +70,5 @@
7070 }
7171
7272 function isGathering (msg) {
7373 return (msg.value && msg.value.content && msg.value.content.type === 'gathering')
74-}
74 +}
modules/page/html/render/public.jsView
@@ -337,5 +337,5 @@
337337
338338 function isAttendee (msg) {
339339 var content = msg.value && msg.value.content
340340 return (content && content.type === 'about' && content.attendee && !content.attendee.remove)
341-}
341 +}

Built with git-ssb-web