Skip to content
Browse files

insert smileys

  • Loading branch information...
1 parent cd5841c commit dc52767424af2815260217ae00309f78f97e6d2c @thejh committed Dec 31, 2011
Showing with 35 additions and 0 deletions.
  1. +31 −0 functions.js
  2. BIN static/smileys/Angel.png
  3. BIN static/smileys/Angry.png
  4. BIN static/smileys/Aww.png
  5. BIN static/smileys/Aww_2.png
  6. BIN static/smileys/Blushing.png
  7. BIN static/smileys/Childish.png
  8. BIN static/smileys/Confused.png
  9. BIN static/smileys/Creepy.png
  10. BIN static/smileys/Crying.png
  11. BIN static/smileys/Cthulhu.png
  12. BIN static/smileys/Cute.png
  13. BIN static/smileys/Cute_Winking.png
  14. BIN static/smileys/Devil.png
  15. BIN static/smileys/Gah.png
  16. BIN static/smileys/Gah_2.png
  17. BIN static/smileys/Gasping.png
  18. BIN static/smileys/Greedy.png
  19. BIN static/smileys/Grinning.png
  20. BIN static/smileys/Grinning_Winking.png
  21. BIN static/smileys/Happy.png
  22. BIN static/smileys/Happy_2.png
  23. BIN static/smileys/Happy_3.png
  24. BIN static/smileys/Heart.png
  25. BIN static/smileys/Huh.png
  26. BIN static/smileys/Huh_2.png
  27. BIN static/smileys/Kissing.png
  28. BIN static/smileys/Laughing.png
  29. BIN static/smileys/Lips_Sealed.png
  30. BIN static/smileys/Madness.png
  31. BIN static/smileys/Malicious.png
  32. BIN static/smileys/Sick.png
  33. BIN static/smileys/SimpleSmileys-1.6/Angel.png
  34. BIN static/smileys/SimpleSmileys-1.6/Angry.png
  35. BIN static/smileys/SimpleSmileys-1.6/Aww.png
  36. BIN static/smileys/SimpleSmileys-1.6/Aww_2.png
  37. BIN static/smileys/SimpleSmileys-1.6/Blushing.png
  38. BIN static/smileys/SimpleSmileys-1.6/Childish.png
  39. BIN static/smileys/SimpleSmileys-1.6/Confused.png
  40. BIN static/smileys/SimpleSmileys-1.6/Creepy.png
  41. BIN static/smileys/SimpleSmileys-1.6/Crying.png
  42. BIN static/smileys/SimpleSmileys-1.6/Cthulhu.png
  43. BIN static/smileys/SimpleSmileys-1.6/Cute.png
  44. BIN static/smileys/SimpleSmileys-1.6/Cute_Winking.png
  45. BIN static/smileys/SimpleSmileys-1.6/Devil.png
  46. BIN static/smileys/SimpleSmileys-1.6/Gah.png
  47. BIN static/smileys/SimpleSmileys-1.6/Gah_2.png
  48. BIN static/smileys/SimpleSmileys-1.6/Gasping.png
  49. BIN static/smileys/SimpleSmileys-1.6/Greedy.png
  50. BIN static/smileys/SimpleSmileys-1.6/Grinning.png
  51. BIN static/smileys/SimpleSmileys-1.6/Grinning_Winking.png
  52. BIN static/smileys/SimpleSmileys-1.6/Happy.png
  53. BIN static/smileys/SimpleSmileys-1.6/Happy_2.png
  54. BIN static/smileys/SimpleSmileys-1.6/Happy_3.png
  55. BIN static/smileys/SimpleSmileys-1.6/Heart.png
  56. BIN static/smileys/SimpleSmileys-1.6/Huh.png
  57. BIN static/smileys/SimpleSmileys-1.6/Huh_2.png
  58. BIN static/smileys/SimpleSmileys-1.6/Kissing.png
  59. BIN static/smileys/SimpleSmileys-1.6/Laughing.png
  60. BIN static/smileys/SimpleSmileys-1.6/Lips_Sealed.png
  61. BIN static/smileys/SimpleSmileys-1.6/Madness.png
  62. BIN static/smileys/SimpleSmileys-1.6/Malicious.png
  63. BIN static/smileys/SimpleSmileys-1.6/Sick.png
  64. BIN static/smileys/SimpleSmileys-1.6/Smiling.png
  65. BIN static/smileys/SimpleSmileys-1.6/Speechless.png
  66. BIN static/smileys/SimpleSmileys-1.6/Spiteful.png
  67. BIN static/smileys/SimpleSmileys-1.6/Stupid.png
  68. BIN static/smileys/SimpleSmileys-1.6/Sunglasses.png
  69. BIN static/smileys/SimpleSmileys-1.6/Terrified.png
  70. BIN static/smileys/SimpleSmileys-1.6/Thumb_Down.png
  71. BIN static/smileys/SimpleSmileys-1.6/Thumb_Up.png
  72. BIN static/smileys/SimpleSmileys-1.6/Tired.png
  73. BIN static/smileys/SimpleSmileys-1.6/Tongue_Out.png
  74. BIN static/smileys/SimpleSmileys-1.6/Tongue_Out_Laughing.png
  75. BIN static/smileys/SimpleSmileys-1.6/Tongue_Out_Left.png
  76. BIN static/smileys/SimpleSmileys-1.6/Tongue_Out_Up.png
  77. BIN static/smileys/SimpleSmileys-1.6/Tongue_Out_Up_Left.png
  78. BIN static/smileys/SimpleSmileys-1.6/Tongue_Out_Winking.png
  79. BIN static/smileys/SimpleSmileys-1.6/Uncertain.png
  80. BIN static/smileys/SimpleSmileys-1.6/Uncertain_2.png
  81. BIN static/smileys/SimpleSmileys-1.6/Unhappy.png
  82. BIN static/smileys/SimpleSmileys-1.6/Winking.png
  83. BIN static/smileys/SimpleSmileys-1.6/__MACOSX/._Kissing.png
  84. BIN static/smileys/SimpleSmileys-1.6/__MACOSX/._Thumb_Down.png
  85. BIN static/smileys/SimpleSmileys-1.6/__MACOSX/._Thumb_Up.png
  86. BIN static/smileys/Smiling.png
  87. BIN static/smileys/Speechless.png
  88. BIN static/smileys/Spiteful.png
  89. BIN static/smileys/Stupid.png
  90. BIN static/smileys/Sunglasses.png
  91. BIN static/smileys/Terrified.png
  92. BIN static/smileys/Thumb_Down.png
  93. BIN static/smileys/Thumb_Up.png
  94. BIN static/smileys/Tired.png
  95. BIN static/smileys/Tongue_Out.png
  96. BIN static/smileys/Tongue_Out_Laughing.png
  97. BIN static/smileys/Tongue_Out_Left.png
  98. BIN static/smileys/Tongue_Out_Up.png
  99. BIN static/smileys/Tongue_Out_Up_Left.png
  100. BIN static/smileys/Tongue_Out_Winking.png
  101. BIN static/smileys/Uncertain.png
  102. BIN static/smileys/Uncertain_2.png
  103. BIN static/smileys/Unhappy.png
  104. +4 −0 static/smileys/WHEREFROM
  105. BIN static/smileys/Winking.png
  106. BIN static/smileys/__MACOSX/._Kissing.png
  107. BIN static/smileys/__MACOSX/._Thumb_Down.png
  108. BIN static/smileys/__MACOSX/._Thumb_Up.png
View
31 functions.js
@@ -18,6 +18,36 @@ function renderContent(template, functions, context, chunk, done) {
vacuum.renderTemplate(template, functions, context, chunk, done)
}
+function insertSmileys(text) {
+ var SMILEYS =
+ { ':)': 'Smiling'
+ , ':D': 'Grinning'
+ , ':(': 'Unhappy'
+ , ':/': 'Uncertain'
+ }
+ Object.keys(SMILEYS).forEach(function(needle) {
+ var replacement = '<img src="/static/smileys/'+SMILEYS[needle]+'.png/'+forum.ramstatic.unique+'">'
+ var i = 0
+ while (true) {
+ var nextText = text.slice(i)
+ var nextTagOpen = nextText.indexOf('<')+i
+ var nextSmiley = nextText.indexOf(needle)+i
+ if (nextSmiley === i-1) break
+ if (nextTagOpen !== i-1 && nextTagOpen < nextSmiley) {
+ var nextTagEnd = nextText.indexOf('>')+i
+ if (nextTagEnd !== i-1) {
+ i = nextTagEnd + 1
+ continue
+ }
+ }
+ nextText = nextText.replace(needle, replacement)
+ text = text.slice(0, i) + nextText
+ i = nextSmiley+1
+ }
+ })
+ return text
+}
+
function sanitizeHTML(text) {
text = text.replace(/</g, '&lt;')
text = text.replace(/>/g, '&gt;')
@@ -140,6 +170,7 @@ function escapeText(value, format) {
value = value.replace(/[^0-9a-f]/gi, '')
} else if (format === 'markdown') {
value = marked(value)
+ value = insertSmileys(value)
value = value.replace(/&/g, '&amp;')
value = sanitizeHTML(value)
value = unsanitizeHTML(value)
View
BIN static/smileys/Angel.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN static/smileys/Angry.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN static/smileys/Aww.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN static/smileys/Aww_2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN static/smileys/Blushing.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN static/smileys/Childish.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN static/smileys/Confused.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN static/smileys/Creepy.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN static/smileys/Crying.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN static/smileys/Cthulhu.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN static/smileys/Cute.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN static/smileys/Cute_Winking.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN static/smileys/Devil.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN static/smileys/Gah.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN static/smileys/Gah_2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN static/smileys/Gasping.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN static/smileys/Greedy.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN static/smileys/Grinning.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN static/smileys/Grinning_Winking.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN static/smileys/Happy.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN static/smileys/Happy_2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN static/smileys/Happy_3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN static/smileys/Heart.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN static/smileys/Huh.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN static/smileys/Huh_2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN static/smileys/Kissing.png
Diff not rendered.
View
BIN static/smileys/Laughing.png
Diff not rendered.
View
BIN static/smileys/Lips_Sealed.png
Diff not rendered.
View
BIN static/smileys/Madness.png
Diff not rendered.
View
BIN static/smileys/Malicious.png
Diff not rendered.
View
BIN static/smileys/Sick.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Angel.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Angry.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Aww.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Aww_2.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Blushing.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Childish.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Confused.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Creepy.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Crying.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Cthulhu.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Cute.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Cute_Winking.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Devil.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Gah.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Gah_2.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Gasping.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Greedy.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Grinning.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Grinning_Winking.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Happy.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Happy_2.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Happy_3.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Heart.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Huh.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Huh_2.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Kissing.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Laughing.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Lips_Sealed.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Madness.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Malicious.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Sick.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Smiling.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Speechless.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Spiteful.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Stupid.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Sunglasses.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Terrified.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Thumb_Down.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Thumb_Up.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Tired.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Tongue_Out.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Tongue_Out_Laughing.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Tongue_Out_Left.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Tongue_Out_Up.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Tongue_Out_Up_Left.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Tongue_Out_Winking.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Uncertain.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Uncertain_2.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Unhappy.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/Winking.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/__MACOSX/._Kissing.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/__MACOSX/._Thumb_Down.png
Diff not rendered.
View
BIN static/smileys/SimpleSmileys-1.6/__MACOSX/._Thumb_Up.png
Diff not rendered.
View
BIN static/smileys/Smiling.png
Diff not rendered.
View
BIN static/smileys/Speechless.png
Diff not rendered.
View
BIN static/smileys/Spiteful.png
Diff not rendered.
View
BIN static/smileys/Stupid.png
Diff not rendered.
View
BIN static/smileys/Sunglasses.png
Diff not rendered.
View
BIN static/smileys/Terrified.png
Diff not rendered.
View
BIN static/smileys/Thumb_Down.png
Diff not rendered.
View
BIN static/smileys/Thumb_Up.png
Diff not rendered.
View
BIN static/smileys/Tired.png
Diff not rendered.
View
BIN static/smileys/Tongue_Out.png
Diff not rendered.
View
BIN static/smileys/Tongue_Out_Laughing.png
Diff not rendered.
View
BIN static/smileys/Tongue_Out_Left.png
Diff not rendered.
View
BIN static/smileys/Tongue_Out_Up.png
Diff not rendered.
View
BIN static/smileys/Tongue_Out_Up_Left.png
Diff not rendered.
View
BIN static/smileys/Tongue_Out_Winking.png
Diff not rendered.
View
BIN static/smileys/Uncertain.png
Diff not rendered.
View
BIN static/smileys/Uncertain_2.png
Diff not rendered.
View
BIN static/smileys/Unhappy.png
Diff not rendered.
View
4 static/smileys/WHEREFROM
@@ -0,0 +1,4 @@
+These smileys are from http://simplesmileys.org/ .
+
+Quote:
+A cohesive collection of smileys/emoticons. Public Domain and free for any use. Free as in Freedom. Created by Leo Bolin.
View
BIN static/smileys/Winking.png
Diff not rendered.
View
BIN static/smileys/__MACOSX/._Kissing.png
Diff not rendered.
View
BIN static/smileys/__MACOSX/._Thumb_Down.png
Diff not rendered.
View
BIN static/smileys/__MACOSX/._Thumb_Up.png
Diff not rendered.

0 comments on commit dc52767

Please sign in to comment.
Something went wrong with that request. Please try again.