Skip to content

Commit 46c6555

Browse files
committed
FinderからCopyした時、通知を出す
1 parent 3e980fd commit 46c6555

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

browser/finder/index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ import remote from 'remote'
1414
var hideFinder = remote.getGlobal('hideFinder')
1515
import clipboard from 'clipboard'
1616

17+
var notifier = require('node-notifier')
18+
var path = require('path')
19+
function getIconPath () {
20+
return path.resolve(global.__dirname, '../../resources/favicon-230x230.png')
21+
}
22+
1723
require('../styles/finder/index.styl')
1824

1925
const FOLDER_FILTER = 'FOLDER_FILTER'
@@ -58,6 +64,12 @@ class FinderMain extends React.Component {
5864
let { activeArticle } = this.props
5965
clipboard.writeText(activeArticle.content)
6066
activityRecord.emit('FINDER_COPY')
67+
68+
notifier.notify({
69+
icon: getIconPath(),
70+
'title': 'Saved to Clipboard!',
71+
'message': 'Paste it wherever you want!'
72+
})
6173
hideFinder()
6274
}
6375

webpack.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ var config = {
6868
'superagent-promise',
6969
'lodash',
7070
'markdown-it',
71-
'moment'
71+
'moment',
72+
'node-notifier'
7273
]
7374
}
7475

webpack.config.production.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ module.exports = {
4545
'superagent-promise',
4646
'lodash',
4747
'markdown-it',
48-
'moment'
48+
'moment',
49+
'node-notifier'
4950
],
5051
resolve: {
5152
extensions: ['', '.js', '.jsx', 'styl']

0 commit comments

Comments
 (0)