Compare commits

...

7 Commits

Author SHA1 Message Date
Trevor Turk
1ebc4b1f74 Emoji 0.3.4 2012-08-01 12:01:37 -05:00
Trevor Turk
a2e1d15d13 notes and todos 2012-08-01 11:53:38 -05:00
Trevor Turk
ffaef44107 use replace for sprite and emojify for images 2012-08-01 11:45:06 -05:00
Joshua Peek
10a29606b6 Emoji 0.3.3 2012-08-01 11:43:56 -05:00
Joshua Peek
2f1da81b8c Fix dir again 2012-08-01 11:43:43 -05:00
Joshua Peek
65616aa784 Emoji 0.3.2 2012-08-01 11:39:57 -05:00
Joshua Peek
092e292fd5 Use real images dir for names listing 2012-08-01 11:39:30 -05:00
4 changed files with 15 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
Emoji
=====
Shared Emoji assets between GitHub, Campfire, and BCX.
Shared Emoji assets between GitHub, Campfire, and BCX.
Contributing
------------
@@ -33,3 +33,14 @@ Deploying
1. Push changes to 37signals/emoji
2. Run `bundle update emoji` in app root
Notes
-----
Use `replace` for the sprite and `emojify` for individual images.
Todo
----
- Make all apps use lib/assets versions
- Move the sprite img/css into CF/BCX and remove from the gem

View File

@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = "emoji"
s.version = "0.3.1"
s.version = "0.3.4"
s.summary = "Emoji Assets"
s.description = "Shared Emoji assets between GitHub, Campfire, and BCX."

View File

@@ -2,7 +2,7 @@ var Emoji = {
names: <%= Emoji.names.to_json %>,
paths: <%= Emoji.names.inject({}) { |h, n| h[n] = asset_path("emoji/#{n}.png"); h }.to_json %>,
replace: function(string) {
emojify: function(string) {
return string.replace(/:([a-z0-9\+\-_]+):/g, function(match, $1) {
if (Emoji.names.indexOf($1) >= 0) {
return '<img alt="' + $1 + '" height="20" src="' + Emoji.paths[$1] + '" style="vertical-align:middle" width="20" />';

View File

@@ -9,7 +9,7 @@ module Emoji
end
def self.names
@names ||= Dir["#{PATH}/assets/images/emoji/*.png"].sort.map { |fn| File.basename(fn, '.png') }
@names ||= Dir["#{PATH}/../images/*.png"].sort.map { |fn| File.basename(fn, '.png') }
end
def self.replace(string)