lib/html/source/javascripts/websocket.coffee in flammarion-0.1.6 vs lib/html/source/javascripts/websocket.coffee in flammarion-0.1.7pre
- old
+ new
@@ -1,7 +1,9 @@
#= require vendor/jquery.js
#= require status.coffee
+#= require fontawesome.js
+#= require vendor/emojione.min.js
class WSClient
constructor: ->
host = $qs.get("host") || "localhost"
console.log "Path: #{$qs.get("path")}, Port: #{$qs.get("port")}, Host: #{host}"
@@ -73,12 +75,14 @@
$.extend(options, input_options)
return text if options.raw
text = "#{text}"
text = ansi_up.escape_for_html(text) if options.escape_html
text = ansi_up.ansi_to_html(text, {use_classes:true}) if options.colorize
- # text = @relink(text)
- text = text.replace(/:[\w-]+:/g, (match) ->
- "<i class='fa fa-#{match[1..-2]}'></i>") if options.escape_icons
+ if options.escape_icons
+ text = text.replace /:[\w-]+:/g, (match) ->
+ if font_awesome_list.includes(match[1..-2]) then "<i class='fa fa-#{match[1..-2]}'></i>" else match
+ emojione.imagePathPNG = '/images/emoji/'
+ text = emojione.toImage(text) if options.escape_icons
text = $("<div>#{text}</div>")
text.find("a[href^='http']").attr('target','_blank')
return text.html()
add: (object, target, data) ->