emoticon_fontify 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # Emoticon Fontify
2
+
3
+ Use helper method to convert text emoticons to unicode characters for use with the font included in asset pipeline.
4
+
5
+ See the LICENSE for copyright information.
6
+
7
+
8
+ ## Installation
9
+
10
+ Add `emoticon_fontify` to you Gemfile and bundle.
11
+
12
+ ``` ruby
13
+ gem 'emoticon_fontify'
14
+ ```
15
+
16
+ Then include the stylesheet in your `application.css` manifest.
17
+
18
+ ```
19
+ //= 'emoticon_fontify/emoticons.css'
20
+ ```
21
+
22
+ Finally use the helper to fontify emoticons in a string. This would allow fontifying content such as: `Why hello there good sir :O could I interest you in a cup of coffee? :)~D`
23
+
24
+ ```ruby
25
+ require EmoticonFontify::EmoticonHelper
26
+
27
+ emoticon_fontify(content)
28
+ ```
29
+
30
+
31
+ ## List Of Emoticons
32
+
33
+ [':)', ':-)'] => 'icon-emo-happy',
34
+ [';)', ';-)'] => 'icon-emo-wink',
35
+ [':(', ':-('] => 'icon-emo-unhappy',
36
+ [':|', ':-|'] => 'icon-emo-sleep',
37
+ ['>:)', '>:-)', '}:)', '}:-)'] => 'icon-emo-devil',
38
+ [':O', ':-O', ':0', ':-0'] => 'icon-emo-surprised',
39
+ [':P', ':-P'] => 'icon-emo-tongue',
40
+ [':)~D', ':-)~D'] => 'icon-emo-coffee',
41
+ ['B)', 'B-)'] => 'icon-emo-sunglasses',
42
+ [':/', ':-/', ':\\', ':-\\'] => 'icon-emo-displeased',
43
+ [':D', ':-D'] => 'icon-emo-grin',
44
+ ['>(', '>-('] => 'icon-emo-angry',
45
+ ['O:)', 'O:-)', '0:)', '0:-)'] => 'icon-emo-saint',
46
+ [';(', ';-(', ":'(", ":'-("] => 'icon-emo-cry',
47
+ ['8)', '8-)'] => 'icon-emo-laugh'
@@ -0,0 +1,87 @@
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>
5
+ Created by FontForge 20100429 at Thu Dec 27 15:27:14 2012
6
+ By root
7
+ Copyright (C) 2012 by original authors @ fontello.com
8
+ </metadata>
9
+ <defs>
10
+ <font id="emoticons" horiz-adv-x="1029" >
11
+ <font-face
12
+ font-family="emoticons"
13
+ font-weight="500"
14
+ font-stretch="normal"
15
+ units-per-em="1000"
16
+ panose-1="2 0 6 3 0 0 0 0 0 0"
17
+ ascent="850"
18
+ descent="-150"
19
+ bbox="14.2857 -154 1640 849.667"
20
+ underline-thickness="50"
21
+ underline-position="-100"
22
+ unicode-range="U+E800-E812"
23
+ />
24
+ <missing-glyph horiz-adv-x="364"
25
+ d="M33 0v666h265v-666h-265zM66 33h199v600h-199v-600z" />
26
+ <glyph glyph-name=".notdef" horiz-adv-x="364"
27
+ d="M33 0v666h265v-666h-265zM66 33h199v600h-199v-600z" />
28
+ <glyph glyph-name=".null" horiz-adv-x="0"
29
+ />
30
+ <glyph glyph-name="nonmarkingreturn" horiz-adv-x="333"
31
+ />
32
+ <glyph glyph-name="uniE800" unicode="&#xe800;"
33
+ d="M276 800q46 0 78 -42t32 -102t-32 -102.5t-78 -42.5t-77.5 42.5t-31.5 102.5t31.5 102t77.5 42zM924 185q15 16 36.5 16.5t37.5 -15.5t16 -38.5t-15 -38.5q-125 -131 -296 -181.5t-346 -10t-309 166.5l-17 17q-16 16 -16 38t15 38t37 16.5t38 -15.5l12 -12l3 -3
34
+ q114 -107 262.5 -140.5t292.5 9.5t249 153zM753 800q46 0 77.5 -42t31.5 -102t-31.5 -102.5t-77.5 -42.5t-78 42.5t-32 102.5t32 102t78 42z" />
35
+ <glyph glyph-name="uniE801" unicode="&#xe801;"
36
+ d="M276 800q46 0 78 -42t32 -102t-32 -102.5t-78 -42.5t-77.5 42.5t-31.5 102.5t31.5 102t77.5 42zM924 185q15 16 36.5 16.5t37.5 -15.5t16 -38.5t-15 -38.5q-125 -131 -296 -181.5t-346 -10t-309 166.5l-17 17q-16 16 -16 38t15 38t37 16.5t38 -15.5l12 -12l3 -3
37
+ q114 -107 262.5 -140.5t292.5 9.5t249 153zM619 594q-23 0 -38.5 16t-15.5 38t15.5 38t38.5 16h267q22 0 38 -16t16 -38t-16 -38t-38 -16h-267z" />
38
+ <glyph glyph-name="uniE802" unicode="&#xe802;"
39
+ d="M276 800q46 0 78 -42t32 -102t-32 -102.5t-78 -42.5t-77.5 42.5t-31.5 102.5t31.5 102t77.5 42zM924 -84q-106 111 -250 154t-292 9t-262 -141l-15 -15q-16 -16 -38 -15.5t-37 16.5t-15 38t16 38q129 130 302 177t347 2.5t305 -173.5l14 -14q15 -16 15 -38.5t-16 -38.5
40
+ t-37.5 -15.5t-36.5 16.5zM753 800q46 0 77.5 -42t31.5 -102t-31.5 -102.5t-77.5 -42.5t-78 42.5t-32 102.5t32 102t78 42z" />
41
+ <glyph glyph-name="uniE803" unicode="&#xe803;" horiz-adv-x="918"
42
+ d="M322 659q15 18 37.5 20t40.5 -13q17 -15 18 -36.5t-14 -38.5q-34 -40 -82.5 -62.5t-100.5 -22.5q-58 0 -110 27t-86 75q-13 18 -9 40t22 35t40 9t35 -22q32 -46 87 -55t99 23q13 10 23 21zM807 659q15 18 37.5 20t40.5 -13q17 -15 18.5 -36.5t-13.5 -38.5
43
+ q-34 -40 -83 -62.5t-101 -22.5q-58 0 -110 27t-86 75q-13 18 -9 40t22 35t40 9t35 -22q32 -46 87 -55t99 23q13 10 23 21zM118 7q-22 0 -38 15.5t-16 38.5q0 22 15.5 37.5t38.5 15.5h682q23 0 38.5 -15.5t15.5 -37.5q0 -23 -16 -38.5t-38 -15.5h-682z" />
44
+ <glyph glyph-name="uniE805" unicode="&#xe805;" horiz-adv-x="1030"
45
+ d="M515 702zM515 702zM515 702zM515 702zM515 702zM515 702zM515 702zM515 702zM254 668q1 0 2.5 -1t2.5 -2q8 -6 11 -11q6 -13 2 -24.5t-14 -16.5q-62 -34 -106 -81q-8 -8 -20 -22l-14 -19q-11 -12 -25 -11q-13 2 -20 10q-35 41 -50.5 108.5t0.5 130.5q16 60 58 101
46
+ q18 16 37 19q14 2 23 -2q16 -6 22 -23l3 -9q1 -8 -0.5 -26.5t0.5 -27.5q7 -41 40 -67q10 -8 21 -14q15 -8 27 -12zM776 668q12 4 27 12q11 6 21 14q48 38 40 95q-2 15 0 26q0 1 1 4t1 5q6 16 23 23q9 4 23 2q39 -7 74 -67q12 -19 21 -53q15 -69 0 -133.5t-50 -105.5
47
+ q-7 -8 -20 -10q-14 -1 -25 11l-14 19q-12 14 -20 22q-47 50 -107 82q-10 6 -14 16.5t2 23.5q3 5 11 11zM792 462q35 -47 35.5 -114t-34.5 -115q-36 -49 -87 -49q-57 0 -89.5 51.5t-32.5 110.5v1q0 3 0.5 8.5t0.5 7.5q1 1 3 2t3 2zM237 462l201 -95q1 -1 3.5 -2t3.5 -2
48
+ q0 -2 0.5 -7.5t0.5 -8.5v-1q0 -59 -32.5 -110.5t-89.5 -51.5q-56 5 -88 49q-35 48 -35 115.5t36 113.5zM852 73q16 -15 16 -36.5t-15 -37.5q-42 -45 -85 -73q-124 -82 -273 -76v1q-97 4 -179 44.5t-140 103.5q-15 16 -14 38t17 37t38 14t37 -17q99 -108 245 -115v1
49
+ q79 -4 153.5 28t122.5 85q14 17 37 18t40 -15z" />
50
+ <glyph glyph-name="uniE806" unicode="&#xe806;" horiz-adv-x="726"
51
+ d="M380 310h-34q-39 0 -67.5 -28.5t-28.5 -67.5v-162q0 -39 28.5 -67.5t67.5 -28.5v1h34v-1q39 0 67.5 28.5t28.5 67.5v162q0 39 -28.5 67.5t-67.5 28.5zM143 214q0 84 59.5 143.5t143.5 59.5h34q84 0 143.5 -59.5t59.5 -143.5v-162q0 -84 -59.5 -143.5t-143.5 -59.5h-34
52
+ q-84 0 -143.5 59.5t-59.5 143.5v162zM125 849q46 0 77.5 -42.5t31.5 -102.5t-31.5 -102t-77.5 -42t-78 42t-32 102t32 102.5t78 42.5zM601 849q46 0 78 -42.5t32 -102.5t-32 -102t-78 -42t-78 42t-32 102t32 102.5t78 42.5z" />
53
+ <glyph glyph-name="uniE807" unicode="&#xe807;" horiz-adv-x="854"
54
+ d="M539 59v72h-224v-73q0 -45 28 -73q29 -29 84 -29t84 29q28 28 28 74zM68 132q-22 0 -37.5 15.5t-15.5 37.5t15.5 38t37.5 16q120 0 359 0.5t359 0.5q22 0 37.5 -16t15.5 -38t-15.5 -37.5t-37.5 -15.5h-140v-74q0 -89 -60 -149t-153 -60q-107 0 -166 60q-59 59 -59 148v74
55
+ h-140zM189 800q46 0 78 -42t32 -102t-32 -102.5t-78 -42.5t-78 42.5t-32 102.5t32 102t78 42zM665 800q46 0 78 -42t32 -102t-32 -102.5t-78 -42.5t-77.5 42.5t-31.5 102.5t31.5 102t77.5 42z" />
56
+ <glyph glyph-name="uniE808" unicode="&#xe808;" horiz-adv-x="1655"
57
+ d="M1068 -154q-84 0 -144 60t-60 145v267v4q0 17 13 29.5t30 12.5h605q52 0 90 -38t38 -90v-115q0 -52 -37.5 -89.5t-90.5 -37.5h-30q-19 -63 -70.5 -105.5t-124.5 -42.5h-219zM1493 266h-522v-211q0 -49 33 -79q32 -32 78 -32h202h3q44 1 73.5 31t33.5 70q1 15 12.5 25
58
+ t26.5 10h60q17 0 28.5 12t11.5 28v106q0 14 -12 29q-11 11 -28 11zM1413 120v93h32q15 0 26 -11t11 -26v-19q0 -15 -11 -26t-26 -11h-32zM1171 795q12 18 32.5 21.5t38.5 -8.5t22 -32.5t-8 -38.5q-7 -10 -9 -21.5t2 -26.5t7 -23l12 -26q13 -28 18 -41t10.5 -37.5t1.5 -40
59
+ t-17.5 -36.5t-38.5 -40q-17 -13 -38 -10t-34 20t-10.5 38t19.5 34q9 7 10 19.5t-3 22.5t-12 28q-13 28 -19.5 45.5t-11.5 45t2 54t26 53.5zM315 95q-22 0 -37.5 15.5t-15.5 37.5t15.5 37.5t37.5 15.5h288q22 0 37.5 -15.5t15.5 -37.5t-15.5 -37.5t-37.5 -15.5h-288zM400 540
60
+ q-17 -15 -40 -13t-37 19q-10 12 -24 22q-44 32 -99 23t-87 -55q-13 -18 -35 -22t-40 9t-22 35t9 40q34 48 86 75t110 27q53 0 101 -22t82 -62q15 -17 14 -39t-18 -37zM885 540q-17 -16 -40 -13.5t-37 19.5q-37 47 -104.5 45.5t-105.5 -55.5q-13 -18 -35 -22t-40 9t-22 35
61
+ t9 40q34 48 86 75t110 27q53 0 101.5 -22t82.5 -62q15 -17 13.5 -39t-18.5 -37z" />
62
+ <glyph glyph-name="uniE809" unicode="&#xe809;" horiz-adv-x="1020"
63
+ d="M47 745h926q13 0 22.5 -9.5t9.5 -23.5q-1 -76 -38.5 -146.5t-101 -116t-135.5 -46.5q-62 -1 -119.5 24.5t-99.5 70.5q-42 -45 -99 -70.5t-119 -24.5q-110 2 -193 97t-85 212q0 14 9.5 23.5t22.5 9.5zM857 228q19 -11 24 -32.5t-6 -40.5q-31 -52 -73 -92
64
+ q-116 -108 -275 -108q-93 0 -170 37q-20 9 -27 30t2 41t29.5 27.5t40.5 -1.5q58 -28 125 -28q81 0 149 41.5t108 107.5q11 19 32.5 24t40.5 -6z" />
65
+ <glyph glyph-name="uniE80A" unicode="&#xe80a;" horiz-adv-x="847"
66
+ d="M186 800q46 0 77.5 -42t31.5 -102t-31.5 -102.5t-77.5 -42.5t-78 42.5t-32 102.5t32 102t78 42zM662 800q46 0 78 -42t32 -102t-32 -102.5t-78 -42.5t-78 42.5t-32 102.5t32 102t78 42zM805 -33q20 -11 25.5 -32.5t-5.5 -41.5t-32.5 -25.5t-41.5 5.5l-709 379
67
+ q-20 11 -25.5 32.5t5.5 41.5t32.5 25.5t41.5 -5.5z" />
68
+ <glyph glyph-name="uniE80C" unicode="&#xe80c;" horiz-adv-x="900"
69
+ d="M132 215q43 -86 125 -140t178 -57q104 -3 194.5 51.5t136.5 145.5h-634zM437 -87q-69 1 -143 29t-135.5 73.5t-102 112.5t-41.5 139q0 22 15 38t37 16h765q22 0 37.5 -15.5t15.5 -37.5q-2 -72 -46 -139.5t-110 -114t-144 -74.5t-148 -27zM212 801q46 0 77.5 -42
70
+ t31.5 -102t-31.5 -102t-77.5 -42t-78 42t-32 102t32 102t78 42zM688 801q46 0 78 -42t32 -102t-32 -102t-78 -42t-78 42t-32 102t32 102t78 42z" />
71
+ <glyph glyph-name="uniE80D" unicode="&#xe80d;" horiz-adv-x="1030"
72
+ d="M318 380q-58 0 -91.5 55.5t-29.5 121.5l-152 80q-20 10 -27.5 30.5t2.5 40.5t30.5 27.5t40.5 -2.5l108 -55l131 -67q56 -28 110 -52q4 -63 -28 -121t-94 -58zM833 557q4 -66 -30 -121.5t-92 -55.5q-62 0 -93.5 58t-27.5 121q54 24 110 52l131 67l108 55q20 10 40.5 2.5
73
+ t30.5 -27.5t2 -40.5t-28 -30.5zM924 -84q-106 111 -250 154t-292 9t-262 -141l-15 -15q-16 -16 -38 -15.5t-37 16.5t-15 38t16 38q129 130 302 177t347 2.5t305 -173.5l14 -14q15 -16 15.5 -38.5t-15.5 -38.5t-38 -15.5t-37 16.5z" />
74
+ <glyph glyph-name="uniE80E" unicode="&#xe80e;"
75
+ d="M15 709q0 66 167 102q142 30 332 30t333 -30q167 -36 167 -102t-167 -102q-143 -30 -333 -30t-332 30q-167 36 -167 102zM515 752q-145 0 -248 -12.5t-103 -30.5t103 -30.5t248 -12.5t247.5 12.5t102.5 30.5t-102.5 30.5t-247.5 12.5zM663 285q-23 0 -38.5 15.5
76
+ t-15.5 38.5t15.5 38.5t38.5 15.5h186q23 0 38.5 -15.5t15.5 -38.5t-15.5 -38.5t-38.5 -15.5h-186zM181 285q-23 0 -38.5 15.5t-15.5 38.5t15.5 38.5t38.5 15.5h186q23 0 38.5 -15.5t15.5 -38.5t-15.5 -38.5t-38.5 -15.5h-186zM852 76q16 -15 16 -36.5t-15 -37.5
77
+ q-42 -45 -85 -73q-124 -82 -273 -76v1q-97 4 -179 44.5t-140 103.5q-15 16 -14 38t17 37t38 14t37 -17q99 -108 245 -115v1q79 -4 153.5 28t122.5 85q14 17 37 18t40 -15z" />
78
+ <glyph glyph-name="uniE80F" unicode="&#xe80f;" horiz-adv-x="881"
79
+ d="M806 471q23 -31 39 -74.5t21 -85.5t-14 -71.5t-62 -29.5t-61.5 29.5t-14 73t18 85t30.5 71.5q11 16 22.5 15.5t20.5 -13.5zM272 241q-95 0 -182 -41v1q-19 -9 -39.5 -1.5t-30.5 26.5q-10 20 -2 41t28 30q109 50 226 50q134 0 253 -64q86 -46 151 -120.5t99 -167.5
80
+ q8 -21 -1.5 -41t-30.5 -27q-21 -8 -41 1t-27 30q-33 90 -99 156.5t-156 99.5q-75 27 -148 27zM482 685q-20 10 -27.5 30.5t2.5 40.5t30.5 28t40.5 -2l68 -32l79 -40l68 -31q0 -3 0.5 -8t0.5 -8v-1q0 -59 -32.5 -111t-89.5 -52q-55 5 -88 50q-39 52 -34 128zM298 677
81
+ q4 -66 -30 -122t-91 -56h-1q-57 0 -89 52t-32 111v1q0 3 0.5 8t0.5 8l6 3l112 54l96 46q20 10 40.5 2t30.5 -28t2.5 -40.5t-27.5 -30.5z" />
82
+ <glyph glyph-name="uniE812" unicode="&#xe812;" horiz-adv-x="923"
83
+ d="M400 581q-17 -16 -40 -13.5t-37 19.5q-37 47 -104.5 46t-105.5 -55q-13 -18 -35 -22t-40 9t-22 34.5t9 39.5q34 48 86 75t110 27q53 0 101 -22t82 -62q15 -17 14 -39t-18 -37zM885 581q-17 -16 -40 -13.5t-37 19.5q-37 47 -104.5 46t-105.5 -55q-13 -18 -35 -22t-40 9
84
+ t-22 34.5t9 39.5q34 48 86 75t111 27q53 0 101 -22t82 -62q15 -17 13.5 -39t-18.5 -37zM155 215q43 -86 125 -140t178 -57q104 -3 194.5 51.5t136.5 145.5h-634zM460 -87q-69 1 -143 29t-135.5 73.5t-102 112.5t-41.5 139q0 22 15 38t37 16h765q22 0 37.5 -15.5t15.5 -37.5
85
+ q-2 -72 -46 -139.5t-110 -114t-144 -74.5t-148 -27z" />
86
+ </font>
87
+ </defs></svg>
@@ -0,0 +1,4 @@
1
+ /*
2
+ *= require_self
3
+ *= require emoticons
4
+ */
@@ -0,0 +1,16 @@
1
+
2
+ .icon-emo-happy:before { content: '\e800'; } /* '' */
3
+ .icon-emo-wink:before { content: '\e801'; } /* '' */
4
+ .icon-emo-unhappy:before { content: '\e802'; } /* '' */
5
+ .icon-emo-sleep:before { content: '\e803'; } /* '' */
6
+ .icon-emo-devil:before { content: '\e805'; } /* '' */
7
+ .icon-emo-surprised:before { content: '\e806'; } /* '' */
8
+ .icon-emo-tongue:before { content: '\e807'; } /* '' */
9
+ .icon-emo-coffee:before { content: '\e808'; } /* '' */
10
+ .icon-emo-sunglasses:before { content: '\e809'; } /* '' */
11
+ .icon-emo-displeased:before { content: '\e80a'; } /* '' */
12
+ .icon-emo-grin:before { content: '\e80c'; } /* '' */
13
+ .icon-emo-angry:before { content: '\e80d'; } /* '' */
14
+ .icon-emo-saint:before { content: '\e80e'; } /* '' */
15
+ .icon-emo-cry:before { content: '\e80f'; } /* '' */
16
+ .icon-emo-laugh:before { content: '\e812'; } /* '' */
@@ -0,0 +1,16 @@
1
+
2
+ .icon-emo-happy { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe800;&nbsp;'); }
3
+ .icon-emo-wink { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe801;&nbsp;'); }
4
+ .icon-emo-unhappy { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe802;&nbsp;'); }
5
+ .icon-emo-sleep { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe803;&nbsp;'); }
6
+ .icon-emo-devil { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe805;&nbsp;'); }
7
+ .icon-emo-surprised { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe806;&nbsp;'); }
8
+ .icon-emo-tongue { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe807;&nbsp;'); }
9
+ .icon-emo-coffee { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe808;&nbsp;'); }
10
+ .icon-emo-sunglasses { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe809;&nbsp;'); }
11
+ .icon-emo-displeased { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80a;&nbsp;'); }
12
+ .icon-emo-grin { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80c;&nbsp;'); }
13
+ .icon-emo-angry { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80d;&nbsp;'); }
14
+ .icon-emo-saint { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80e;&nbsp;'); }
15
+ .icon-emo-cry { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80f;&nbsp;'); }
16
+ .icon-emo-laugh { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe812;&nbsp;'); }
@@ -0,0 +1,26 @@
1
+ [class^="icon-"],
2
+ [class*=" icon-"] {
3
+ font-family: 'emoticons';
4
+ font-style: normal;
5
+ font-weight: normal;
6
+ /* fix buttons height */
7
+ line-height: 1em;
8
+ /* you can be more comfortable with increased icons size */
9
+ /* font-size: 120%; */
10
+ }
11
+
12
+ .icon-emo-happy { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe800;&nbsp;'); }
13
+ .icon-emo-wink { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe801;&nbsp;'); }
14
+ .icon-emo-unhappy { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe802;&nbsp;'); }
15
+ .icon-emo-sleep { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe803;&nbsp;'); }
16
+ .icon-emo-devil { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe805;&nbsp;'); }
17
+ .icon-emo-surprised { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe806;&nbsp;'); }
18
+ .icon-emo-tongue { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe807;&nbsp;'); }
19
+ .icon-emo-coffee { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe808;&nbsp;'); }
20
+ .icon-emo-sunglasses { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe809;&nbsp;'); }
21
+ .icon-emo-displeased { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80a;&nbsp;'); }
22
+ .icon-emo-grin { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80c;&nbsp;'); }
23
+ .icon-emo-angry { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80d;&nbsp;'); }
24
+ .icon-emo-saint { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80e;&nbsp;'); }
25
+ .icon-emo-cry { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80f;&nbsp;'); }
26
+ .icon-emo-laugh { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe812;&nbsp;'); }
@@ -0,0 +1,45 @@
1
+ @font-face {
2
+ font-family: 'emoticons';
3
+ src: url(asset_path('emoticon_fontify/emoticons.eot'));
4
+ src: url(asset_path('emoticon_fontify/emoticons.eot?#iefix')) format('embedded-opentype'), url(asset_path('emoticon_fontify/emoticons.woff')) format('woff'), url(asset_path('emoticon_fontify/emoticons.ttf')) format('truetype'), url(asset_path('emoticon_fontify/emoticons.svg#emoticons')) format('svg');
5
+ font-weight: normal;
6
+ font-style: normal;
7
+ }
8
+ [class^="icon-"]:before,
9
+ [class*=" icon-"]:before {
10
+ font-family: 'emoticons';
11
+ font-style: normal;
12
+ font-weight: normal;
13
+ speak: none;
14
+ display: inline-block;
15
+ text-decoration: inherit;
16
+ width: 1em;
17
+ margin-right: 0.2em;
18
+ text-align: center;
19
+ opacity: 0.8;
20
+ /* fix buttons height, for twitter bootstrap */
21
+ line-height: 1em;
22
+ /* Animation center compensation - magrins should be symmetric */
23
+ /* remove if not needed */
24
+ margin-left: 0.2em;
25
+ /* you can be more comfortable with increased icons size */
26
+ /* font-size: 120%; */
27
+ /* Uncomment for 3D effect */
28
+ /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
29
+ }
30
+
31
+ .icon-emo-happy:before { content: '\e800'; } /* '' */
32
+ .icon-emo-wink:before { content: '\e801'; } /* '' */
33
+ .icon-emo-unhappy:before { content: '\e802'; } /* '' */
34
+ .icon-emo-sleep:before { content: '\e803'; } /* '' */
35
+ .icon-emo-devil:before { content: '\e805'; } /* '' */
36
+ .icon-emo-surprised:before { content: '\e806'; } /* '' */
37
+ .icon-emo-tongue:before { content: '\e807'; } /* '' */
38
+ .icon-emo-coffee:before { content: '\e808'; } /* '' */
39
+ .icon-emo-sunglasses:before { content: '\e809'; } /* '' */
40
+ .icon-emo-displeased:before { content: '\e80a'; } /* '' */
41
+ .icon-emo-grin:before { content: '\e80c'; } /* '' */
42
+ .icon-emo-angry:before { content: '\e80d'; } /* '' */
43
+ .icon-emo-saint:before { content: '\e80e'; } /* '' */
44
+ .icon-emo-cry:before { content: '\e80f'; } /* '' */
45
+ .icon-emo-laugh:before { content: '\e812'; } /* '' */
@@ -0,0 +1,9 @@
1
+ module EmoticonFontify
2
+ module EmoticonHelper
3
+ def emoticon_fontify(content)
4
+ h(content).to_str.gsub(/(#{EmoticonFontify.emoticons.join('|')})/) do |match|
5
+ '<span class="' + EmoticonFontify.emoticon_to_class(match) + '">' + match + '</span>'
6
+ end.html_safe if content.present?
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ module EmoticonFontify
2
+ class Engine < Rails::Engine
3
+ isolate_namespace EmoticonFontify
4
+ end
5
+ end
@@ -0,0 +1,35 @@
1
+ require "emoticon_fontify/engine"
2
+
3
+ module EmoticonFontify
4
+ def self.emoticons_to_classes
5
+ @emoticons_to_classes ||= {
6
+ [':)', ':-)'] => 'icon-emo-happy',
7
+ [';)', ';-)'] => 'icon-emo-wink',
8
+ [':(', ':-('] => 'icon-emo-unhappy',
9
+ [':|', ':-|'] => 'icon-emo-sleep',
10
+ ['>:)', '>:-)', '}:)', '}:-)'] => 'icon-emo-devil',
11
+ [':O', ':-O', ':0', ':-0'] => 'icon-emo-surprised',
12
+ [':P', ':-P'] => 'icon-emo-tongue',
13
+ [':)~D', ':-)~D'] => 'icon-emo-coffee',
14
+ ['B)', 'B-)'] => 'icon-emo-sunglasses',
15
+ [':/', ':-/', ':\\', ':-\\'] => 'icon-emo-displeased',
16
+ [':D', ':-D'] => 'icon-emo-grin',
17
+ ['>(', '>-('] => 'icon-emo-angry',
18
+ ['O:)', 'O:-)', '0:)', '0:-)'] => 'icon-emo-saint',
19
+ [';(', ';-(', ":'(", ":'-("] => 'icon-emo-cry',
20
+ ['8)', '8-)'] => 'icon-emo-laugh'
21
+ }
22
+ end
23
+
24
+ def self.emoticons
25
+ emoticons_to_classes.keys.flatten
26
+ end
27
+
28
+ def self.emoticon_to_class(emote)
29
+ emote_variations = emoticons_to_classes.keys.select do |emotes|
30
+ emotes.include? emote
31
+ end
32
+
33
+ emoticons_to_classes[emote_variations.flatten]
34
+ end
35
+ end
metadata ADDED
@@ -0,0 +1,57 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: emoticon_fontify
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - sfcgeorge
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-12-27 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: Add emoticon font to assets and convert text to unicode symbols.
15
+ email: simon@sfcgeorge.co.uk
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - README.md
21
+ - app/helpers/emoticon_fontify/emoticon_helper.rb
22
+ - lib/emoticon_fontify/engine.rb
23
+ - lib/emoticon_fontify.rb
24
+ - app/assets/fonts/emoticon_fontify/emoticons.eot
25
+ - app/assets/fonts/emoticon_fontify/emoticons.svg
26
+ - app/assets/fonts/emoticon_fontify/emoticons.ttf
27
+ - app/assets/fonts/emoticon_fontify/emoticons.woff
28
+ - app/assets/stylesheets/emoticon_fontify/application.css
29
+ - app/assets/stylesheets/emoticon_fontify/emoticons-codes.css
30
+ - app/assets/stylesheets/emoticon_fontify/emoticons-ie7-codes.css
31
+ - app/assets/stylesheets/emoticon_fontify/emoticons-ie7.css
32
+ - app/assets/stylesheets/emoticon_fontify/emoticons.css
33
+ homepage: https://github.com/sfcgeorge/emoticon_fontify
34
+ licenses: []
35
+ post_install_message:
36
+ rdoc_options: []
37
+ require_paths:
38
+ - lib
39
+ required_ruby_version: !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ! '>='
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
45
+ required_rubygems_version: !ruby/object:Gem::Requirement
46
+ none: false
47
+ requirements:
48
+ - - ! '>='
49
+ - !ruby/object:Gem::Version
50
+ version: '0'
51
+ requirements: []
52
+ rubyforge_project:
53
+ rubygems_version: 1.8.23
54
+ signing_key:
55
+ specification_version: 3
56
+ summary: Emoticon font assets
57
+ test_files: []