Sprite the emoticon images
authorJack Allnutt <jack@allnutt.eu>
Fri, 13 Sep 2013 09:26:01 +0000 (10:26 +0100)
committerJack Allnutt <jack@allnutt.eu>
Fri, 13 Sep 2013 21:56:12 +0000 (22:56 +0100)
53 files changed:
client/assets/css/style.css
client/assets/img/emoticons.png [new file with mode: 0755]
client/assets/img/emoticons/angel.png [deleted file]
client/assets/img/emoticons/angry.png [deleted file]
client/assets/img/emoticons/aww.png [deleted file]
client/assets/img/emoticons/blushing.png [deleted file]
client/assets/img/emoticons/confused.png [deleted file]
client/assets/img/emoticons/cool.png [deleted file]
client/assets/img/emoticons/creepy.png [deleted file]
client/assets/img/emoticons/crying.png [deleted file]
client/assets/img/emoticons/cthulhu.png [deleted file]
client/assets/img/emoticons/cute.png [deleted file]
client/assets/img/emoticons/cute_winking.png [deleted file]
client/assets/img/emoticons/devil.png [deleted file]
client/assets/img/emoticons/frowning.png [deleted file]
client/assets/img/emoticons/gasping.png [deleted file]
client/assets/img/emoticons/greedy.png [deleted file]
client/assets/img/emoticons/grinning.png [deleted file]
client/assets/img/emoticons/happy.png [deleted file]
client/assets/img/emoticons/happy_smiling.png [deleted file]
client/assets/img/emoticons/heart.png [deleted file]
client/assets/img/emoticons/irritated.png [deleted file]
client/assets/img/emoticons/irritated_2.png [deleted file]
client/assets/img/emoticons/kissing.png [deleted file]
client/assets/img/emoticons/laughing.png [deleted file]
client/assets/img/emoticons/lips_sealed.png [deleted file]
client/assets/img/emoticons/madness.png [deleted file]
client/assets/img/emoticons/malicious.png [deleted file]
client/assets/img/emoticons/naww.png [deleted file]
client/assets/img/emoticons/pouting.png [deleted file]
client/assets/img/emoticons/shy.png [deleted file]
client/assets/img/emoticons/sick.png [deleted file]
client/assets/img/emoticons/smiling.png [deleted file]
client/assets/img/emoticons/speechless.png [deleted file]
client/assets/img/emoticons/spiteful.png [deleted file]
client/assets/img/emoticons/stupid.png [deleted file]
client/assets/img/emoticons/surprised.png [deleted file]
client/assets/img/emoticons/surprised_2.png [deleted file]
client/assets/img/emoticons/terrified.png [deleted file]
client/assets/img/emoticons/thumbs_down.png [deleted file]
client/assets/img/emoticons/thumbs_up.png [deleted file]
client/assets/img/emoticons/tired.png [deleted file]
client/assets/img/emoticons/tongue_out.png [deleted file]
client/assets/img/emoticons/tongue_out_laughing.png [deleted file]
client/assets/img/emoticons/tongue_out_left.png [deleted file]
client/assets/img/emoticons/tongue_out_up.png [deleted file]
client/assets/img/emoticons/tongue_out_up_left.png [deleted file]
client/assets/img/emoticons/unsure.png [deleted file]
client/assets/img/emoticons/unsure_2.png [deleted file]
client/assets/img/emoticons/winking.png [deleted file]
client/assets/img/emoticons/winking_grinning.png [deleted file]
client/assets/img/emoticons/winking_tongue_out.png [deleted file]
client/assets/src/helpers/utils.js

index f223001615467b8b4c65aa3dbced6bbf915ebd7b..15f88f81889a8f65749d8a643f1a92db1ff678a4 100644 (file)
@@ -115,6 +115,9 @@ html, body { height:100%; }
 #kiwi .userbox a i { }
 
 
+/* Emoticons */
+#kiwi .emoticon { display: inline-block; height: 15px; width: 17px; overflow: hidden; font-size: 0; background-repeat: no-repeat; }
+
 
 /**
  * Control box
diff --git a/client/assets/img/emoticons.png b/client/assets/img/emoticons.png
new file mode 100755 (executable)
index 0000000..7681437
Binary files /dev/null and b/client/assets/img/emoticons.png differ
diff --git a/client/assets/img/emoticons/angel.png b/client/assets/img/emoticons/angel.png
deleted file mode 100644 (file)
index 0cf707b..0000000
Binary files a/client/assets/img/emoticons/angel.png and /dev/null differ
diff --git a/client/assets/img/emoticons/angry.png b/client/assets/img/emoticons/angry.png
deleted file mode 100644 (file)
index 9ae5d18..0000000
Binary files a/client/assets/img/emoticons/angry.png and /dev/null differ
diff --git a/client/assets/img/emoticons/aww.png b/client/assets/img/emoticons/aww.png
deleted file mode 100644 (file)
index 60510bb..0000000
Binary files a/client/assets/img/emoticons/aww.png and /dev/null differ
diff --git a/client/assets/img/emoticons/blushing.png b/client/assets/img/emoticons/blushing.png
deleted file mode 100644 (file)
index ab03ee8..0000000
Binary files a/client/assets/img/emoticons/blushing.png and /dev/null differ
diff --git a/client/assets/img/emoticons/confused.png b/client/assets/img/emoticons/confused.png
deleted file mode 100644 (file)
index 08ba7d3..0000000
Binary files a/client/assets/img/emoticons/confused.png and /dev/null differ
diff --git a/client/assets/img/emoticons/cool.png b/client/assets/img/emoticons/cool.png
deleted file mode 100644 (file)
index cad8379..0000000
Binary files a/client/assets/img/emoticons/cool.png and /dev/null differ
diff --git a/client/assets/img/emoticons/creepy.png b/client/assets/img/emoticons/creepy.png
deleted file mode 100644 (file)
index 5615058..0000000
Binary files a/client/assets/img/emoticons/creepy.png and /dev/null differ
diff --git a/client/assets/img/emoticons/crying.png b/client/assets/img/emoticons/crying.png
deleted file mode 100644 (file)
index 2532976..0000000
Binary files a/client/assets/img/emoticons/crying.png and /dev/null differ
diff --git a/client/assets/img/emoticons/cthulhu.png b/client/assets/img/emoticons/cthulhu.png
deleted file mode 100644 (file)
index fafc4b3..0000000
Binary files a/client/assets/img/emoticons/cthulhu.png and /dev/null differ
diff --git a/client/assets/img/emoticons/cute.png b/client/assets/img/emoticons/cute.png
deleted file mode 100644 (file)
index a883ac3..0000000
Binary files a/client/assets/img/emoticons/cute.png and /dev/null differ
diff --git a/client/assets/img/emoticons/cute_winking.png b/client/assets/img/emoticons/cute_winking.png
deleted file mode 100644 (file)
index ad3383d..0000000
Binary files a/client/assets/img/emoticons/cute_winking.png and /dev/null differ
diff --git a/client/assets/img/emoticons/devil.png b/client/assets/img/emoticons/devil.png
deleted file mode 100644 (file)
index afc5c2c..0000000
Binary files a/client/assets/img/emoticons/devil.png and /dev/null differ
diff --git a/client/assets/img/emoticons/frowning.png b/client/assets/img/emoticons/frowning.png
deleted file mode 100644 (file)
index 79fc0c0..0000000
Binary files a/client/assets/img/emoticons/frowning.png and /dev/null differ
diff --git a/client/assets/img/emoticons/gasping.png b/client/assets/img/emoticons/gasping.png
deleted file mode 100644 (file)
index b6655ce..0000000
Binary files a/client/assets/img/emoticons/gasping.png and /dev/null differ
diff --git a/client/assets/img/emoticons/greedy.png b/client/assets/img/emoticons/greedy.png
deleted file mode 100644 (file)
index a179638..0000000
Binary files a/client/assets/img/emoticons/greedy.png and /dev/null differ
diff --git a/client/assets/img/emoticons/grinning.png b/client/assets/img/emoticons/grinning.png
deleted file mode 100644 (file)
index 85ff915..0000000
Binary files a/client/assets/img/emoticons/grinning.png and /dev/null differ
diff --git a/client/assets/img/emoticons/happy.png b/client/assets/img/emoticons/happy.png
deleted file mode 100644 (file)
index 51cf1a2..0000000
Binary files a/client/assets/img/emoticons/happy.png and /dev/null differ
diff --git a/client/assets/img/emoticons/happy_smiling.png b/client/assets/img/emoticons/happy_smiling.png
deleted file mode 100644 (file)
index 1332686..0000000
Binary files a/client/assets/img/emoticons/happy_smiling.png and /dev/null differ
diff --git a/client/assets/img/emoticons/heart.png b/client/assets/img/emoticons/heart.png
deleted file mode 100644 (file)
index dcd28b9..0000000
Binary files a/client/assets/img/emoticons/heart.png and /dev/null differ
diff --git a/client/assets/img/emoticons/irritated.png b/client/assets/img/emoticons/irritated.png
deleted file mode 100644 (file)
index b03ee1b..0000000
Binary files a/client/assets/img/emoticons/irritated.png and /dev/null differ
diff --git a/client/assets/img/emoticons/irritated_2.png b/client/assets/img/emoticons/irritated_2.png
deleted file mode 100644 (file)
index b682458..0000000
Binary files a/client/assets/img/emoticons/irritated_2.png and /dev/null differ
diff --git a/client/assets/img/emoticons/kissing.png b/client/assets/img/emoticons/kissing.png
deleted file mode 100644 (file)
index 05509de..0000000
Binary files a/client/assets/img/emoticons/kissing.png and /dev/null differ
diff --git a/client/assets/img/emoticons/laughing.png b/client/assets/img/emoticons/laughing.png
deleted file mode 100644 (file)
index edefc95..0000000
Binary files a/client/assets/img/emoticons/laughing.png and /dev/null differ
diff --git a/client/assets/img/emoticons/lips_sealed.png b/client/assets/img/emoticons/lips_sealed.png
deleted file mode 100644 (file)
index 46e4701..0000000
Binary files a/client/assets/img/emoticons/lips_sealed.png and /dev/null differ
diff --git a/client/assets/img/emoticons/madness.png b/client/assets/img/emoticons/madness.png
deleted file mode 100644 (file)
index 1c0946c..0000000
Binary files a/client/assets/img/emoticons/madness.png and /dev/null differ
diff --git a/client/assets/img/emoticons/malicious.png b/client/assets/img/emoticons/malicious.png
deleted file mode 100644 (file)
index 23f2579..0000000
Binary files a/client/assets/img/emoticons/malicious.png and /dev/null differ
diff --git a/client/assets/img/emoticons/naww.png b/client/assets/img/emoticons/naww.png
deleted file mode 100644 (file)
index 3512863..0000000
Binary files a/client/assets/img/emoticons/naww.png and /dev/null differ
diff --git a/client/assets/img/emoticons/pouting.png b/client/assets/img/emoticons/pouting.png
deleted file mode 100644 (file)
index 1a31c50..0000000
Binary files a/client/assets/img/emoticons/pouting.png and /dev/null differ
diff --git a/client/assets/img/emoticons/shy.png b/client/assets/img/emoticons/shy.png
deleted file mode 100644 (file)
index be79df0..0000000
Binary files a/client/assets/img/emoticons/shy.png and /dev/null differ
diff --git a/client/assets/img/emoticons/sick.png b/client/assets/img/emoticons/sick.png
deleted file mode 100644 (file)
index 6f73e2f..0000000
Binary files a/client/assets/img/emoticons/sick.png and /dev/null differ
diff --git a/client/assets/img/emoticons/smiling.png b/client/assets/img/emoticons/smiling.png
deleted file mode 100644 (file)
index 725eef5..0000000
Binary files a/client/assets/img/emoticons/smiling.png and /dev/null differ
diff --git a/client/assets/img/emoticons/speechless.png b/client/assets/img/emoticons/speechless.png
deleted file mode 100644 (file)
index 4fc4246..0000000
Binary files a/client/assets/img/emoticons/speechless.png and /dev/null differ
diff --git a/client/assets/img/emoticons/spiteful.png b/client/assets/img/emoticons/spiteful.png
deleted file mode 100644 (file)
index 195ced8..0000000
Binary files a/client/assets/img/emoticons/spiteful.png and /dev/null differ
diff --git a/client/assets/img/emoticons/stupid.png b/client/assets/img/emoticons/stupid.png
deleted file mode 100644 (file)
index 3fcea49..0000000
Binary files a/client/assets/img/emoticons/stupid.png and /dev/null differ
diff --git a/client/assets/img/emoticons/surprised.png b/client/assets/img/emoticons/surprised.png
deleted file mode 100644 (file)
index 241f50f..0000000
Binary files a/client/assets/img/emoticons/surprised.png and /dev/null differ
diff --git a/client/assets/img/emoticons/surprised_2.png b/client/assets/img/emoticons/surprised_2.png
deleted file mode 100644 (file)
index a1a54e4..0000000
Binary files a/client/assets/img/emoticons/surprised_2.png and /dev/null differ
diff --git a/client/assets/img/emoticons/terrified.png b/client/assets/img/emoticons/terrified.png
deleted file mode 100644 (file)
index fad2e06..0000000
Binary files a/client/assets/img/emoticons/terrified.png and /dev/null differ
diff --git a/client/assets/img/emoticons/thumbs_down.png b/client/assets/img/emoticons/thumbs_down.png
deleted file mode 100644 (file)
index 4f70696..0000000
Binary files a/client/assets/img/emoticons/thumbs_down.png and /dev/null differ
diff --git a/client/assets/img/emoticons/thumbs_up.png b/client/assets/img/emoticons/thumbs_up.png
deleted file mode 100644 (file)
index 2ca0e0d..0000000
Binary files a/client/assets/img/emoticons/thumbs_up.png and /dev/null differ
diff --git a/client/assets/img/emoticons/tired.png b/client/assets/img/emoticons/tired.png
deleted file mode 100644 (file)
index 13f7d12..0000000
Binary files a/client/assets/img/emoticons/tired.png and /dev/null differ
diff --git a/client/assets/img/emoticons/tongue_out.png b/client/assets/img/emoticons/tongue_out.png
deleted file mode 100644 (file)
index 3d154f9..0000000
Binary files a/client/assets/img/emoticons/tongue_out.png and /dev/null differ
diff --git a/client/assets/img/emoticons/tongue_out_laughing.png b/client/assets/img/emoticons/tongue_out_laughing.png
deleted file mode 100644 (file)
index fba5d75..0000000
Binary files a/client/assets/img/emoticons/tongue_out_laughing.png and /dev/null differ
diff --git a/client/assets/img/emoticons/tongue_out_left.png b/client/assets/img/emoticons/tongue_out_left.png
deleted file mode 100644 (file)
index 8015de7..0000000
Binary files a/client/assets/img/emoticons/tongue_out_left.png and /dev/null differ
diff --git a/client/assets/img/emoticons/tongue_out_up.png b/client/assets/img/emoticons/tongue_out_up.png
deleted file mode 100644 (file)
index 46328fb..0000000
Binary files a/client/assets/img/emoticons/tongue_out_up.png and /dev/null differ
diff --git a/client/assets/img/emoticons/tongue_out_up_left.png b/client/assets/img/emoticons/tongue_out_up_left.png
deleted file mode 100644 (file)
index b67b69f..0000000
Binary files a/client/assets/img/emoticons/tongue_out_up_left.png and /dev/null differ
diff --git a/client/assets/img/emoticons/unsure.png b/client/assets/img/emoticons/unsure.png
deleted file mode 100644 (file)
index 7176856..0000000
Binary files a/client/assets/img/emoticons/unsure.png and /dev/null differ
diff --git a/client/assets/img/emoticons/unsure_2.png b/client/assets/img/emoticons/unsure_2.png
deleted file mode 100644 (file)
index a7f5370..0000000
Binary files a/client/assets/img/emoticons/unsure_2.png and /dev/null differ
diff --git a/client/assets/img/emoticons/winking.png b/client/assets/img/emoticons/winking.png
deleted file mode 100644 (file)
index 1e01f94..0000000
Binary files a/client/assets/img/emoticons/winking.png and /dev/null differ
diff --git a/client/assets/img/emoticons/winking_grinning.png b/client/assets/img/emoticons/winking_grinning.png
deleted file mode 100644 (file)
index 5b1d5b7..0000000
Binary files a/client/assets/img/emoticons/winking_grinning.png and /dev/null differ
diff --git a/client/assets/img/emoticons/winking_tongue_out.png b/client/assets/img/emoticons/winking_tongue_out.png
deleted file mode 100644 (file)
index 2a22cf6..0000000
Binary files a/client/assets/img/emoticons/winking_tongue_out.png and /dev/null differ
index 99378bc50e45baeabb9186a39a3c81995537e000..7590785859eea356e31819331e9e5cc94542561d 100644 (file)
@@ -367,78 +367,77 @@ function emoticonFromText(str) {
     var words_in = str.split(' '),
         words_out = [],
         i,
-        pushEmoticon = function (alt, img) {
-            words_out.push('<img src="' + _kiwi.app.get('base_path') + '/assets/img/emoticons/' + img + '" alt="' + alt + ' " />');
+        emoticon_location = _kiwi.app.get('base_path') + '/assets/img/emoticons.png',
+        pushEmoticon = function (alt, offset) {
+            words_out.push('<i class="emoticon" style="background-image:url(' + emoticon_location + '); background-position:-' + offset+ 'px 0px">' + alt + '</i>');
         };
 
     for (i = 0; i < words_in.length; i++) {
         switch(words_in[i]) {
         case ':)':
-            pushEmoticon(':)', 'smiling.png');
+            pushEmoticon(':)', 0);
             break;
         case ':(':
-            pushEmoticon(':(', 'frowning.png');
+            pushEmoticon(':(', 25);
             break;
         case ':3':
-            pushEmoticon(':3', 'cute.png');
+            pushEmoticon(':3', 50);
             break;
         case ';3':
-            pushEmoticon(';3', 'cute_winking.png');
+            pushEmoticon(';3', 75);
             break;
         case ':s':
-            pushEmoticon(':s', 'confused.png');
+            pushEmoticon(':s', 100);
             break;
         case ';(':
-            pushEmoticon(';(', 'crying.png');
+            pushEmoticon(';(', 125);
             break;
         case ';)':
-            pushEmoticon(';)', 'winking.png');
+            pushEmoticon(';)', 150);
             break;
         case ';D':
-            pushEmoticon(';D"', 'winking_grinning.png');
+            pushEmoticon(';D"', 175);
             break;
         case ':P':
-            pushEmoticon(':P', 'tongue_out.png');
+            pushEmoticon(':P', 200);
             break;
         case 'xP':
-            pushEmoticon('xP', 'tongue_out_laughing.png');
+            pushEmoticon('xP', 225);
             break;
         case ':o':
         case ':O':
-            pushEmoticon(':o', 'gasping.png');
+            pushEmoticon(':o', 250);
             break;
         case ':D':
-            pushEmoticon(':D', 'grinning.png');
+            pushEmoticon(':D', 275);
             break;
         case '^^,':
-            pushEmoticon('^^,', 'happy.png');
+            pushEmoticon('^^,', 300);
             break;
         case '&lt;3':
-            pushEmoticon('<3', 'heart.png');
+            pushEmoticon('<3', 325);
             break;
         case '&gt;.&lt;':
-            pushEmoticon('>.<', 'irritated_2.png');
+            pushEmoticon('>.<', 348);
             break;
         case '&gt;_&lt;':
-            pushEmoticon('>_<', 'irritated.png');
+            pushEmoticon('>_<', 373);
             break;
         case 'XD':
         case 'xD':
-            pushEmoticon('xD', 'laughing.png');
+            pushEmoticon('xD', 398);
             break;
         case 'o.0':
-            pushEmoticon('o.0', 'surprised.png');
+            pushEmoticon('o.0', 423);
             break;
         case '0.o':
-            pushEmoticon('0.o', 'surprised_2.png');
+            pushEmoticon('0.o', 448);
             break;
         case ':\\':
         case '=\\':
-            pushEmoticon(':\\', 'unsure.png');
-            break;
         case ':/':
         case '=/':
-            pushEmoticon(':/', 'unsure_2.png');
+            pushEmoticon(':\\', 473);
             break;
         default:
             words_out.push(words_in[i]);