git ssb

16+

Dominic / patchbay



Commit 32a28daa63eadf650dd8fdd3dd5140aa9d8e6538

Merge branch 'master' into refactor_hypertabs

mix irving committed on 2/3/2017, 5:25:25 AM
Parent: 32aba29b1bd68e4ba002781ccc56db127018f545
Parent: 0132c055406a2cc025989cea9154fea161b776c9

Files changed

modules_core/tabs.jschanged
package.jsonchanged
modules_core/tabs.jsView
@@ -1,8 +1,9 @@
1-var Tabs = require('hypertabs')
2-var h = require('../h')
3-var keyscroll = require('../keyscroll')
4-var open = require('open-external')
1 +const Tabs = require('hypertabs')
2 +const h = require('../h')
3 +const keyscroll = require('../keyscroll')
4 +const open = require('open-external')
5 +const { webFrame, remote } = require('electron')
56
67 function ancestor (el) {
78 if(!el) return
89 if(el.tagName !== 'A') return ancestor(el.parentElement)
@@ -183,31 +184,41 @@
183184 delete window.onError
184185 }
185186
186187 // put errors in a tab
187- window.addEventListener('error', function (ev) {
188- var err = ev.error || ev
188 + window.addEventListener('error', ev => {
189 + const err = ev.error || ev
189190 if(!tabs.has('errors'))
190191 tabs.add(errors, false)
191- var el = h('div.message',
192 + const el = h('div.message', [
192193 h('strong', err.message),
193- h('pre', err.stack))
194 + h('pre', err.stack)
195 + ])
194196 if (errorsContent.firstChild)
195197 errorsContent.insertBefore(el, errorsContent.firstChild)
196198 else
197199 errorsContent.appendChild(el)
198200 })
199201
200202 if (process.versions.electron) {
201- window.addEventListener('contextmenu', function (ev) {
203 +
204 + window.addEventListener('mousewheel', ev => {
205 + const { ctrlKey, deltaY } = ev
206 + if (ctrlKey) {
207 + const direction = (deltaY / Math.abs(deltaY))
208 + const currentZoom = webFrame.getZoomLevel()
209 + webFrame.setZoomLevel(currentZoom - direction)
210 + }
211 + })
212 +
213 + window.addEventListener('contextmenu', ev => {
202214 ev.preventDefault()
203- var remote = require('electron').remote
204- var Menu = remote.Menu
205- var MenuItem = remote.MenuItem
206- var menu = new Menu()
215 + const Menu = remote.Menu
216 + const MenuItem = remote.MenuItem
217 + const menu = new Menu()
207218 menu.append(new MenuItem({
208219 label: 'Inspect Element',
209- click: function () {
220 + click: () => {
210221 remote.getCurrentWindow().inspectElement(ev.x, ev.y)
211222 }
212223 }))
213224 menu.popup(remote.getCurrentWindow())
package.jsonView
@@ -1,8 +1,8 @@
11 {
22 "name": "patchbay",
33 "description": "a pluggable patchwork",
4- "version": "6.6.2",
4 + "version": "6.6.3",
55 "homepage": "https://github.com/ssbc/patchbay",
66 "repository": {
77 "type": "git",
88 "url": "git://github.com/ssbc/patchbay.git"

Built with git-ssb-web