mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-03-01 02:25:45 +08:00
feat(screenshot-mode): Tiny feature for removing PII when taking debug screenshots
This commit is contained in:
parent
459eb26d4f
commit
89a30a058f
7 changed files with 69 additions and 0 deletions
BIN
internal_packages/screenshot-mode/assets/BLOKKNeue-Regular.otf
Normal file
BIN
internal_packages/screenshot-mode/assets/BLOKKNeue-Regular.otf
Normal file
Binary file not shown.
34
internal_packages/screenshot-mode/assets/font-override.css
Normal file
34
internal_packages/screenshot-mode/assets/font-override.css
Normal file
|
@ -0,0 +1,34 @@
|
|||
@font-face {
|
||||
font-family: 'Nylas-Pro';
|
||||
font-style: normal;
|
||||
font-weight: 200;
|
||||
src: url('nylas://screenshot-mode/assets/BLOKKNeue-Regular.otf');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Nylas-Pro';
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
src: url('nylas://screenshot-mode/assets/BLOKKNeue-Regular.otf');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Nylas-Pro';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: url('nylas://screenshot-mode/assets/BLOKKNeue-Regular.otf');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Nylas-Pro';
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
src: url('nylas://screenshot-mode/assets/BLOKKNeue-Regular.otf');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Nylas-Pro';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
src: url('nylas://screenshot-mode/assets/BLOKKNeue-Regular.otf');
|
||||
}
|
21
internal_packages/screenshot-mode/lib/main.coffee
Normal file
21
internal_packages/screenshot-mode/lib/main.coffee
Normal file
|
@ -0,0 +1,21 @@
|
|||
fs = require 'fs'
|
||||
|
||||
style = null
|
||||
|
||||
module.exports =
|
||||
activate: ->
|
||||
NylasEnv.commands.add "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.parentElement
|
||||
document.body.removeChild(style)
|
||||
|
||||
serialize: ->
|
11
internal_packages/screenshot-mode/package.json
Executable file
11
internal_packages/screenshot-mode/package.json
Executable file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"name": "screenshot-mode",
|
||||
"version": "0.1.0",
|
||||
"main": "./lib/main",
|
||||
"description": "Replaces all text with blocks for taking screenshots without PII",
|
||||
"license": "Proprietary",
|
||||
"private": true,
|
||||
"windowTypes": {
|
||||
"all": true
|
||||
}
|
||||
}
|
|
@ -63,6 +63,7 @@
|
|||
{ label: 'Toggle Developer Tools', command: 'window:toggle-dev-tools' }
|
||||
{ label: 'Toggle Component Regions', command: 'window:toggle-component-regions' }
|
||||
{ label: 'Toggle React Remote', command: 'window:toggle-react-remote' }
|
||||
{ label: 'Toggle Screenshot Mode', command: 'window:toggle-screenshot-mode' }
|
||||
{ type: 'separator' }
|
||||
{ label: 'Open Activity Window', command: 'application:show-work-window' }
|
||||
{ type: 'separator' }
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
{ label: 'Toggle Developer &Tools', command: 'window:toggle-dev-tools' }
|
||||
{ label: 'Toggle Component Regions', command: 'window:toggle-component-regions' }
|
||||
{ label: 'Toggle React Remote', command: 'window:toggle-react-remote' }
|
||||
{ label: 'Toggle Screenshot Mode', command: 'window:toggle-screenshot-mode' }
|
||||
{ type: 'separator' }
|
||||
{ label: 'Open Activity Window', command: 'application:show-work-window' }
|
||||
{ type: 'separator' }
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
{ label: 'Toggle Developer &Tools', command: 'window:toggle-dev-tools' }
|
||||
{ label: 'Toggle Component Regions', command: 'window:toggle-component-regions' }
|
||||
{ label: 'Toggle React Remote', command: 'window:toggle-react-remote' }
|
||||
{ label: 'Toggle Screenshot Mode', command: 'window:toggle-screenshot-mode' }
|
||||
{ type: 'separator' }
|
||||
{ label: 'Open Activity Window', command: 'application:show-work-window' }
|
||||
{ type: 'separator' }
|
||||
|
|
Loading…
Reference in a new issue