Skip to content

Commit

Permalink
Renamed variables on hex plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
gabceb committed Feb 8, 2013
1 parent bcc6829 commit fe683a8
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -3,14 +3,14 @@ class Kandan.Plugins.HexColorEmbed
regex: /#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/

template: _.template '''
<span class="color-preview" style="background-color:<%= rgb %>;"/>
<span class="color-preview" style="background-color:<%= hex %>;"/>
'''

@init: ()->
Kandan.Modifiers.register @options.regex, (message, state) =>
rgb = message.content.match(@options.regex)[0]
replacement = @options.template({rgb: rgb}) + rgb
hex = message.content.match(@options.regex)[0]
replacement = @options.template({hex: hex}) + hex

message.content = message.content.replace(rgb, replacement)
message.content = message.content.replace(hex, replacement)

return Kandan.Helpers.Activities.buildFromMessageTemplate(message)

0 comments on commit fe683a8

Please sign in to comment.