2016-01-30 08:39:07 +08:00
|
|
|
fs = require 'fs'
|
|
|
|
|
|
|
|
style = null
|
|
|
|
|
|
|
|
module.exports =
|
|
|
|
activate: ->
|
2016-04-25 01:16:25 +08:00
|
|
|
NylasEnv.commands.add document.body, "window:toggle-screenshot-mode", ->
|
2016-01-30 08:39:07 +08:00
|
|
|
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: ->
|
2016-01-30 08:59:51 +08:00
|
|
|
if style and style.parentElement
|
2016-01-30 08:39:07 +08:00
|
|
|
document.body.removeChild(style)
|
|
|
|
|
|
|
|
serialize: ->
|