diff --git a/app/assets/javascripts/app/controllers/chat.coffee b/app/assets/javascripts/app/controllers/chat.coffee index 702908b3a..da34f17da 100644 --- a/app/assets/javascripts/app/controllers/chat.coffee +++ b/app/assets/javascripts/app/controllers/chat.coffee @@ -294,6 +294,12 @@ class ChatWindow extends App.Controller if event.data and event.data.callback event.data.callback() + @$('.js-customerChatInput').ce({ + mode: 'richtext' + multiline: true + maxlength: 40000 + }) + close: => @el.one 'transitionend', { callback: @release }, @onTransitionend @el.removeClass('is-open') diff --git a/app/assets/javascripts/app/lib/app_post/utils.coffee b/app/assets/javascripts/app/lib/app_post/utils.coffee index 787cf2397..01520a2ad 100644 --- a/app/assets/javascripts/app/lib/app_post/utils.coffee +++ b/app/assets/javascripts/app/lib/app_post/utils.coffee @@ -116,7 +116,7 @@ class App.Utils ) # remove tags & content - html.find('div, span, p, li, ul, ol, a, b, u, i, label, small, strong, strike, pre, code, center, blockquote, form, textarea, font, table, thead, tbody, tr, td, h1, h2, h3, h4, h5, h6, br, hr, img, input, select, button, style, applet, embed, noframes, canvas, script, frame, iframe').remove() + html.find('div, span, p, li, ul, ol, a, b, u, i, label, small, strong, strike, pre, code, center, blockquote, form, textarea, font, table, thead, tbody, tr, td, h1, h2, h3, h4, h5, h6, br, hr, img, svg, input, select, button, style, applet, embed, noframes, canvas, script, frame, iframe').remove() html @@ -138,7 +138,7 @@ class App.Utils ) # remove tags & content - html.find('li, ul, ol, a, b, u, i, label, small, strong, strike, pre, code, center, blockquote, form, textarea, font, address, table, thead, tbody, tr, td, h1, h2, h3, h4, h5, h6, hr, img, input, select, button, style, applet, embed, noframes, canvas, script, frame, iframe').remove() + html.find('li, ul, ol, a, b, u, i, label, small, strong, strike, pre, code, center, blockquote, form, textarea, font, address, table, thead, tbody, tr, td, h1, h2, h3, h4, h5, h6, hr, img, svg, input, select, button, style, applet, embed, noframes, canvas, script, frame, iframe').remove() html @@ -155,7 +155,7 @@ class App.Utils @_removeWordMarkup(html) # remove tags, keep content - html.find('a, font, small, time').replaceWith( -> + html.find('a, font, small, time, form').replaceWith( -> $(@).contents() ) @@ -179,7 +179,7 @@ class App.Utils ) # remove tags & content - html.find('form, font, hr, img, input, select, button, style, applet, embed, noframes, canvas, script, frame, iframe').remove() + html.find('font, hr, img, svg, input, select, button, style, applet, embed, noframes, canvas, script, frame, iframe').remove() html diff --git a/app/models/chat.rb b/app/models/chat.rb index dc2704c97..ccc9b47c3 100644 --- a/app/models/chat.rb +++ b/app/models/chat.rb @@ -5,7 +5,6 @@ class Chat < ApplicationModel store :preferences def customer_state(session_id = nil) - return { state: 'chat_disabled' } if !Setting.get('chat') # reconnect if session_id @@ -63,7 +62,6 @@ class Chat < ApplicationModel end def self.agent_state(user_id) - return { state: 'chat_disabled' } if !Setting.get('chat') assets = {} Chat.where(active: true).each {|chat| assets = chat.assets(assets) diff --git a/public/assets/tests/html-utils.js b/public/assets/tests/html-utils.js index 2d190d843..385ddcde7 100644 --- a/public/assets/tests/html-utils.js +++ b/public/assets/tests/html-utils.js @@ -246,7 +246,7 @@ test("htmlRemoveTags", function() { result = App.Utils.htmlRemoveTags($(source)) equal(result.html(), should, source) - source = "
" + source = "" //should = "some link to somewhere from word