git ssb

10+

Matt McKegg / patchwork



Commit 20e56e6bb267f73d48091b7c9576ae3f9bab0bee

WIP - Rough sketch for adding forward and back button

Chris Adams committed on 5/11/2018, 8:44:09 AM
Parent: ac4142da16c5834e703d5723d94c3b3035a34ae0

Files changed

main-window.jschanged
package.jsonchanged
main-window.jsView
@@ -11,9 +11,11 @@
1111 var LatestUpdate = require('./lib/latest-update')
1212 var ref = require('ssb-ref')
1313 var setupContextMenuAndSpellCheck = require('./lib/context-menu-and-spellcheck')
1414 var watch = require('mutant/watch')
15 +var mousetrap = require("mousetrap")
1516
17 +
1618 module.exports = function (config) {
1719 var sockets = combine(
1820 overrideConfig(config),
1921 addCommand('app.navigate', navigate),
@@ -72,8 +74,11 @@
7274 watch(pendingCount, count => {
7375 electron.remote.app.setBadgeCount(count)
7476 })
7577
78 +
79 +
80 +
7681 document.head.appendChild(
7782 h('style', {
7883 innerHTML: computed(api.settings.obs.get('patchwork.theme', 'light'), themeName => {
7984 return themes[themeName] || themes['light']
@@ -147,8 +152,16 @@
147152 api.app.navigate(href)
148153 }
149154 })
150155
156 +
157 + // TODO - should this be in a separate file instead?
158 + // And should we be using the Electron MenuItem API over mousetrap?
159 +
160 + mousetrap.bind(["command+[", "command+left"], views.goBack)
161 + mousetrap.bind(["command+]", "command+right"], views.goForward)
162 +
163 +
151164 return [container, previewElement]
152165
153166 // scoped
154167
package.jsonView
@@ -38,8 +38,9 @@
3838 "level": "~1.7.0",
3939 "lrucache": "^1.0.2",
4040 "micro-css": "^2.0.1",
4141 "moment": "^2.18.1",
42 + "mousetrap": "^1.6.1",
4243 "mutant": "^3.21.2",
4344 "mutant-pull-reduce": "^1.1.0",
4445 "obv": "0.0.1",
4546 "patch-settings": "~1.1.0",

Built with git-ssb-web