mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-12 04:25:31 +08:00
a48ddd51f8
Summary: Keymaps & menus CSON => JSON, remove AtomKeymaps, CommandRegistry use of CSS selectors, use Mousetrap instead Important Notes: - The `application:` prefix is reserved for commands which are handled in the application process. Don't use it for other things. You will not receive the events in the window. - Maintaining dynamic menus seems to come with quite an overhead, because Electron updates the entire menu every time. In the future, we'll need https://github.com/electron/electron/issues/528 to really make things nice. I will be tracking this upstream. - The format for keyboard shortcuts has changed. `cmd-X` is now `command+shift+x` Test Plan: Run tests Reviewers: juan, evan Reviewed By: evan Differential Revision: https://phab.nylas.com/D2917
21 lines
554 B
CoffeeScript
21 lines
554 B
CoffeeScript
fs = require 'fs'
|
|
|
|
style = null
|
|
|
|
module.exports =
|
|
activate: ->
|
|
NylasEnv.commands.add document.body, "window:toggle-screenshot-mode", ->
|
|
if not style
|
|
style = document.createElement('style')
|
|
style.innerText = fs.readFileSync(path.join(__dirname, '..', 'assets','font-override.css')).toString()
|
|
|
|
if style.parentElement
|
|
document.body.removeChild(style)
|
|
else
|
|
document.body.appendChild(style)
|
|
|
|
deactivate: ->
|
|
if style and style.parentElement
|
|
document.body.removeChild(style)
|
|
|
|
serialize: ->
|