Sha256: 51705ce4a44bd176e80395d6e30324266f246cac498d31ec1643c4c09e68c0cb
Contents?: true
Size: 905 Bytes
Versions: 26
Compression:
Stored size: 905 Bytes
Contents
module ForumRedCloth3 def smilies(text) emoticons = { ':)' => 'happy', ':|' => 'neutral', ':(' => 'sad', ':D' => 'grin', ':O' => 'surprised', ';)' => 'wink', '}:)' => 'devil', ':P' => 'tongue', ':[' => 'mad', '8|' => 'shocked', ':@' => 'lol', 'B]' => 'cool' } # old syntax carried over from vanilla text.gsub!(/\:(angry|smile|bigsmile|confused|cool|cry|devil|neutral|sad|shamed|shocked|surprised|tongue|wink)\:/) do |w| %{<img src="/images/emoticons/#{$1}.gif" alt="(#{$1})" title="#{$1}" class="smiley" />} end # these are generally put in by the punymce toolbar, so we use their nasty but effective combination of blank image with sprite background text.gsub!(/(\}\:\)|\:\)|\:\||\:\(|\:D|\:O|\;\)|\:P|\:\@|8\||\:\[|B\])/) do |w| %{<img src="/images/furniture/blank.png" class="emoticon #{emoticons[w]}" />}; end end end
Version data entries
26 entries across 26 versions & 1 rubygems