git ssb

0+

alanz / patchwork



forked from Matt McKegg / patchwork

Commit a5da1caabea6be5eed8baecd05ca37431e9ed9eb

add "Inspect Server Process" to right click menu

Matt McKegg committed on 11/2/2016, 3:41:40 AM
Parent: b6089670d854fcefa6bc5ca05636a801707deb30

Files changed

index.jschanged
lib/context-menu.jschanged
index.jsView
@@ -28,8 +28,14 @@
2828
2929 electron.app.on('activate', function (e) {
3030 openMainWindow()
3131 })
32+
33+ electron.ipcMain.on('open-background-devtools', function (ev, config) {
34+ if (windows.background) {
35+ windows.background.webContents.openDevTools({detach: true})
36+ }
37+ })
3238 })
3339
3440 function openMainWindow () {
3541 if (!windows.main) {
@@ -82,6 +88,10 @@
8288 title: 'patchwork-server',
8389 useContentSize: true,
8490 width: 150
8591 })
92+ windows.background.on('close', (ev) => {
93+ ev.preventDefault()
94+ windows.background.hide()
95+ })
8696 }
8797 }
lib/context-menu.jsView
@@ -29,11 +29,19 @@
2929 var y = ev.clientY
3030 BrowserWindow.getFocusedWindow().inspectElement(x, y)
3131 }
3232 }))
33-
33+ menu.append(new MenuItem({
34+ label: 'Inspect Server Process',
35+ click: function () {
36+ electron.ipcRenderer.send('open-background-devtools')
37+ }
38+ }))
3439 if (item && item.key) {
3540 menu.append(new MenuItem({
41+ type: 'separator'
42+ }))
43+ menu.append(new MenuItem({
3644 label: 'Copy Message ID',
3745 click: function () {
3846 electron.clipboard.writeText(item.key)
3947 }

Built with git-ssb-web