Skip to content

Commit

Permalink
Merge pull request #31 from johannhof/v1.0
Browse files Browse the repository at this point in the history
1.0
  • Loading branch information
Johann Hofmann committed Mar 22, 2015
2 parents a6f44c8 + 514d7f2 commit 90b9f35
Show file tree
Hide file tree
Showing 35 changed files with 1,552 additions and 718 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
V=0.6.0
V=1.0.0

release: build
rm -rf release/latest
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
Emoji Helper [![](https://travis-ci.org/johannhof/emoji-helper.svg?branch=master)](https://travis-ci.org/johannhof/emoji-helper) [![](https://img.shields.io/github/release/johannhof/emoji-helper.svg?style=flat)](https://github.com/johannhof/emoji-helper/releases)
============


An Emoji cheat sheet extension for Chrome, Firefox and Safari. Also a Bookmarklet. Built because I like spamming my coworkers with :mushroom: :pig: :rocket: :snail: but fortunately have more important things to keep in mind than the name for :moyai:

Visit http://johannhof.github.io/emoji-helper for download links from the official stores.

![](https://raw.githubusercontent.com/johannhof/emoji-helper/master/resources/firefox/firefox-1.png)
![](https://raw.githubusercontent.com/johannhof/emoji-helper/master/resources/tile1.png)


## Development
Expand Down
14 changes: 3 additions & 11 deletions bookmarklet/Gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var gulp = require('gulp'),
common = require('../gulp-common'),
connect = require('connect'),
path = require('path'),
rename = require("gulp-rename"),
Expand Down Expand Up @@ -32,18 +33,9 @@ gulp.task('popup', function() {
});

gulp.task('emoji', function () {
return gulp.src([
'../shared/img/emoji/clock9.png',
'../shared/img/emoji/smiley.png',
'../shared/img/emoji/cherry_blossom.png',
'../shared/img/emoji/bell.png',
'../shared/img/emoji/oncoming_automobile.png',
'../shared/img/emoji/symbols.png',
'../shared/img/emoji/hatched_chick.png',
'../shared/img/emoji/snake.png',
'../shared/img/emoji/heart.png',
return gulp.src(common.emoji.concat([
'../shared/img/emoji/heavy_multiplication_x.png'
]).pipe(newer(build + 'img/emoji/'))
])).pipe(newer(build + 'img/emoji/'))
.pipe(imageResize({
width : 30,
height : 30
Expand Down
13 changes: 2 additions & 11 deletions chrome/Gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var gulp = require('gulp'),
common = require('../gulp-common'),
zip = require('gulp-zip'),
jade = require('gulp-jade');

Expand Down Expand Up @@ -26,17 +27,7 @@ gulp.task('vendor', function() {
});

gulp.task('emoji', function () {
return gulp.src([
'../shared/img/emoji/clock9.png',
'../shared/img/emoji/smiley.png',
'../shared/img/emoji/cherry_blossom.png',
'../shared/img/emoji/bell.png',
'../shared/img/emoji/oncoming_automobile.png',
'../shared/img/emoji/symbols.png',
'../shared/img/emoji/hatched_chick.png',
'../shared/img/emoji/snake.png',
'../shared/img/emoji/heart.png'
]).pipe(gulp.dest(build + 'img/emoji/'));
return gulp.src(common.emoji).pipe(gulp.dest(build + 'img/emoji/'));
});

gulp.task('shared', function() {
Expand Down
3 changes: 2 additions & 1 deletion chrome/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "Emoji Cheatsheet for GitHub, Basecamp etc.",
"short_name": "Emoji Helper",
"description": "A very simple and useful reference for the codes that can be used to generate Emojis on popular sites like GitHub or Basecamp.",
"version": "0.6.0",
"version": "1.0.0",
"icons": { "128": "icon.png" },

"author" : "Johann Hofmann",
Expand All @@ -13,6 +13,7 @@

"permissions":[
"clipboardWrite",
"activeTab",
"storage"
],

Expand Down
10 changes: 9 additions & 1 deletion chrome/vendor.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,18 @@
};

exports.copyToClipboard = function(domElement) {
domElement.focus();
if(domElement){
domElement.focus();
}
document.execCommand('SelectAll');
document.execCommand('copy');
};

exports.insertToActive = function (text) {
chrome.tabs.executeScript({
code: 'document.activeElement.value += "' + (text || "") + '"'
});
};

window.vendor = exports;
}());
13 changes: 2 additions & 11 deletions firefox/Gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var gulp = require('gulp'),
common = require('../gulp-common'),
shell = require('gulp-shell'),
jade = require('gulp-jade');

Expand All @@ -24,17 +25,7 @@ gulp.task('js', function() {
});

gulp.task('emoji', function () {
return gulp.src([
'../shared/img/emoji/clock9.png',
'../shared/img/emoji/smiley.png',
'../shared/img/emoji/cherry_blossom.png',
'../shared/img/emoji/bell.png',
'../shared/img/emoji/oncoming_automobile.png',
'../shared/img/emoji/symbols.png',
'../shared/img/emoji/hatched_chick.png',
'../shared/img/emoji/snake.png',
'../shared/img/emoji/heart.png'
]).pipe(gulp.dest(build + 'data/img/emoji/'));
return gulp.src(common.emoji).pipe(gulp.dest(build + 'data/img/emoji/'));
});

gulp.task('shared', function() {
Expand Down
10 changes: 10 additions & 0 deletions firefox/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
// and the plugin main script, routing low-level requests like copy to clipboard
// back and forth

// TODO make more DRY

window.addEventListener("combo", function(event) {
self.port.emit("combo", event.detail);
}, false);

window.addEventListener("insert", function(event) {
self.port.emit("insert", event.detail);
}, false);

window.addEventListener("copy", function(event) {
self.port.emit("copy", event.detail);
}, false);
Expand Down
96 changes: 74 additions & 22 deletions firefox/main.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,91 @@
var data = require("sdk/self").data;
var ss = require("sdk/simple-storage");
var clipboard = require("sdk/clipboard");
var data = require("sdk/self").data;
var ss = require("sdk/simple-storage");
var clipboard = require("sdk/clipboard");
var Panel = require("sdk/panel").Panel;
var ToggleButton = require('sdk/ui/button/toggle').ToggleButton;
var Hotkey = require("sdk/hotkeys").Hotkey;
var tabs = require("sdk/tabs");

var text_entry = require("sdk/panel").Panel({
var panel, button, hotkey;

panel = Panel({
width: 510,
height: 370,
contentURL: data.url("popup.html"),
contentScriptFile: data.url("helper.js")
contentScriptFile: data.url("helper.js"),
onShow: function() {
button.state('window', {checked: true});
},
onHide: function() {
button.state('window', {checked: false});
}
});

text_entry.port.on("copy", function(text) {
// Create a button
button = ToggleButton({
id: "show-emoji-panel",
label: "Show Emoji Helper",
icon: {
"16": "./icon.png",
"32": "./icon.png",
"64": "./icon.png"
},
onChange: function (state) {
if (state.checked) {
panel.show({
position: button
});
}
}
});

function createHotkey(combo) {
ss.storage.combo = combo;
if(combo === 'none'){
return;
}

// create a keyboard shortcut
hotkey = Hotkey({
combo: combo,
onPress: function() {
if (panel.isShowing) {
panel.hide();
}else{
panel.show({
position: button
});
}
}
});
}

createHotkey(ss.storage.combo || "accel-e");

panel.port.on("combo", function(combo) {
hotkey.destroy();
createHotkey(combo);
});

panel.port.on("insert", function(text) {
tabs.activeTab.attach({
contentScript: 'document.activeElement.value += "' + (text || "") + '"'
});
});

panel.port.on("copy", function(text) {
clipboard.set(text);
});

text_entry.port.on("set", function(item) {
panel.port.on("set", function(item) {
ss.storage[item.key] = item.value;
});

text_entry.port.on("get", function(key) {
text_entry.port.emit("send", {
panel.port.on("get", function(key) {
panel.port.emit("send", {
key: key,
value: ss.storage[key]
});
});

// Create a button
require("sdk/ui/button/action").ActionButton({
id: "show-panel",
label: "Show Emoji Helper",
icon: {
"16": "./icon.png",
"32": "./icon.png",
"64": "./icon.png"
},
onClick: function() {
text_entry.show();
}
});

16 changes: 13 additions & 3 deletions firefox/vendor.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,19 @@
};

exports.copyToClipboard = function(domElement) {
domElement.focus();
domElement.select();
send("copy", domElement.value);
if(domElement){
domElement.focus();
domElement.select();
send("copy", domElement.value);
}
};

exports.insertToActive = function (text) {
send("insert", text);
};

exports.setHotkey = function (combo) {
send("combo", combo);
};

window.vendor = exports;
Expand Down
11 changes: 11 additions & 0 deletions gulp-common.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
exports.emoji = [
'../shared/img/emoji/clock9.png',
'../shared/img/emoji/smiley.png',
'../shared/img/emoji/cherry_blossom.png',
'../shared/img/emoji/bell.png',
'../shared/img/emoji/oncoming_automobile.png',
'../shared/img/emoji/symbols.png',
'../shared/img/emoji/hatched_chick.png',
'../shared/img/emoji/whale.png',
'../shared/img/emoji/heart.png'
];
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "emoji-helper",
"title": "Emoji Cheatsheet for GitHub, Basecamp etc.",
"version": "0.6.0",
"version": "1.0.0",
"description": "A very simple and useful reference for the codes that can be used to generate Emojis on popular sites like GitHub or Basecamp.",
"id": "jid1-Xo5SuA6qc1DFpw",
"main": "main",
Expand All @@ -12,7 +12,7 @@
"license": "MIT",
"devDependencies": {
"connect": "^2.14.5",
"gulp": "^3.8.6",
"gulp": "^3.8.10",
"gulp-clean": "^0.3.0",
"gulp-image-resize": "^0.5.0",
"gulp-jade": "^0.5.0",
Expand Down
Binary file removed resources/chrome/chrome-1.png
Binary file not shown.
Binary file removed resources/chrome/chrome-2.png
Binary file not shown.
Binary file removed resources/chrome/chrome-3.png
Binary file not shown.
Binary file removed resources/firefox/firefox-1.png
Binary file not shown.
Binary file removed resources/firefox/firefox-2.png
Binary file not shown.
Binary file removed resources/firefox/firefox-3.png
Binary file not shown.
Binary file added resources/tile1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/tile2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/tile3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 2 additions & 11 deletions safari/Gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var gulp = require('gulp'),
common = require('../gulp-common'),
jade = require('gulp-jade');

var emojis = require('../shared/data/sprite.json');
Expand All @@ -25,17 +26,7 @@ gulp.task('vendor', function() {
});

gulp.task('emoji', function () {
return gulp.src([
'../shared/img/emoji/clock9.png',
'../shared/img/emoji/smiley.png',
'../shared/img/emoji/cherry_blossom.png',
'../shared/img/emoji/bell.png',
'../shared/img/emoji/oncoming_automobile.png',
'../shared/img/emoji/symbols.png',
'../shared/img/emoji/hatched_chick.png',
'../shared/img/emoji/snake.png',
'../shared/img/emoji/heart.png'
]).pipe(gulp.dest(build + 'img/emoji/'));
return gulp.src(common.emoji).pipe(gulp.dest(build + 'img/emoji/'));
});

gulp.task('shared', function() {
Expand Down
4 changes: 2 additions & 2 deletions safari/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleShortVersionString</key>
<string>0.6.0</string>
<string>1.0.0</string>
<key>CFBundleVersion</key>
<string>0.6.0</string>
<string>1.0.0</string>
<key>Chrome</key>
<dict>
<key>Database Quota</key>
Expand Down
4 changes: 2 additions & 2 deletions safari/Update.plist
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<key>Developer Identifier</key>
<string>VQE5S3G4ED</string>
<key>CFBundleVersion</key>
<string>0.6.0</string>
<string>1.0.0</string>
<key>CFBundleShortVersionString</key>
<string>0.6.0</string>
<string>1.0.0</string>
<key>URL</key>
<string>http://spaeti.pavo.uberspace.de/emoji.safariextz</string>
</dict>
Expand Down
Empty file modified shared/data/sprite.json
100755 → 100644
Empty file.
Binary file modified shared/fonts/ionicons.eot
Binary file not shown.
Loading

0 comments on commit 90b9f35

Please sign in to comment.