1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

FinderからCopyした時、通知を出す

This commit is contained in:
Rokt33r
2015-11-15 01:39:40 +09:00
parent 3e980fd2d4
commit 46c6555f94
3 changed files with 16 additions and 2 deletions

View File

@@ -14,6 +14,12 @@ import remote from 'remote'
var hideFinder = remote.getGlobal('hideFinder') var hideFinder = remote.getGlobal('hideFinder')
import clipboard from 'clipboard' import clipboard from 'clipboard'
var notifier = require('node-notifier')
var path = require('path')
function getIconPath () {
return path.resolve(global.__dirname, '../../resources/favicon-230x230.png')
}
require('../styles/finder/index.styl') require('../styles/finder/index.styl')
const FOLDER_FILTER = 'FOLDER_FILTER' const FOLDER_FILTER = 'FOLDER_FILTER'
@@ -58,6 +64,12 @@ class FinderMain extends React.Component {
let { activeArticle } = this.props let { activeArticle } = this.props
clipboard.writeText(activeArticle.content) clipboard.writeText(activeArticle.content)
activityRecord.emit('FINDER_COPY') activityRecord.emit('FINDER_COPY')
notifier.notify({
icon: getIconPath(),
'title': 'Saved to Clipboard!',
'message': 'Paste it wherever you want!'
})
hideFinder() hideFinder()
} }

View File

@@ -68,7 +68,8 @@ var config = {
'superagent-promise', 'superagent-promise',
'lodash', 'lodash',
'markdown-it', 'markdown-it',
'moment' 'moment',
'node-notifier'
] ]
} }

View File

@@ -45,7 +45,8 @@ module.exports = {
'superagent-promise', 'superagent-promise',
'lodash', 'lodash',
'markdown-it', 'markdown-it',
'moment' 'moment',
'node-notifier'
], ],
resolve: { resolve: {
extensions: ['', '.js', '.jsx', 'styl'] extensions: ['', '.js', '.jsx', 'styl']