Skip to content
This repository has been archived by the owner on Feb 11, 2020. It is now read-only.

Commit

Permalink
feat(clipboard): write emoji pattern to clipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
sanemat committed Jul 17, 2015
1 parent 64ea6eb commit 0f2c134
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/actions/EmojiActions.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import * as types from '../constants/ActionTypes';
import EmojiMaster from '../utils/emojiMaster';
import writeClipboard from '../utils/writeClipboard';
import isNwjs from '../utils/isNwjs';

export function addHistory (name) {
const master = new EmojiMaster();
const emoji = master.findByName(name);
if (isNwjs) {
writeClipboard(window.gui, emoji.pattern);
}
return {
type: types.ADD_HISTORY,
emoji
Expand Down
5 changes: 5 additions & 0 deletions lib/utils/writeClipboard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// https://github.com/nwjs/nw.js/wiki/Clipboard
export default function (gui, text) {
let clipboard = gui.Clipboard.get();
clipboard.set(text, 'text');
}

0 comments on commit 0f2c134

Please sign in to comment.