2015-05-17 19:02:57 -04:00
var FFZ = window . FrankerFaceZ ,
2015-02-10 01:34:23 -05:00
utils = require ( "../utils" ) ,
2016-03-23 19:28:22 -04:00
constants = require ( "../constants" ) ;
2015-02-08 02:01:09 -05:00
2015-05-17 19:02:57 -04:00
// ---------------------
// Settings
// ---------------------
2016-03-23 19:28:22 -04:00
FFZ . settings _info . alias _italics = {
type : "boolean" ,
value : true ,
category : "Chat Appearance" ,
no _bttv : true ,
name : "Display Aliases in Italics" ,
help : "Format the names of users that have aliases with italics to make it obvious at a glance that they have been renamed." ,
on _update : function ( val ) {
document . body . classList . toggle ( 'ffz-alias-italics' , val ) ;
}
} ;
2015-07-06 00:09:21 -04:00
FFZ . settings _info . room _status = {
type : "boolean" ,
value : true ,
2015-07-13 21:52:44 -04:00
category : "Chat Appearance" ,
2015-07-06 00:09:21 -04:00
no _bttv : true ,
name : "Room Status Indicators" ,
help : "Display the current room state (slow mode, sub mode, and r9k mode) next to the Chat button." ,
on _update : function ( ) {
if ( this . _roomv )
this . _roomv . ffzUpdateStatus ( ) ;
}
} ;
FFZ . settings _info . replace _bad _emotes = {
type : "boolean" ,
value : true ,
2015-08-02 02:41:03 -04:00
2015-07-13 21:52:44 -04:00
category : "Chat Appearance" ,
2016-03-23 19:28:22 -04:00
warn _bttv : "Only affects Whispers when BetterTTV is enabled." ,
2015-08-02 02:41:03 -04:00
2015-07-06 00:09:21 -04:00
name : "Fix Low Quality Twitch Global Emoticons" ,
help : "Replace emoticons such as DansGame and RedCoat with cleaned up versions that don't have pixels around the edges or white backgrounds for nicer display on dark chat."
2015-08-04 01:43:08 -04:00
} ;
2015-07-06 00:09:21 -04:00
2015-07-04 17:06:36 -04:00
FFZ . settings _info . parse _emoji = {
2015-08-28 22:54:12 -04:00
type : "select" ,
options : {
0 : "No Images / Font Only" ,
1 : "Twitter Emoji Images" ,
2016-03-23 19:28:22 -04:00
2 : "Google Noto Images" ,
3 : "EmojiOne Images"
2015-08-28 22:54:12 -04:00
} ,
value : 1 ,
process _value : function ( val ) {
if ( val === false )
return 0 ;
if ( val === true )
return 1 ;
if ( typeof val === "string" )
return parseInt ( val || "0" ) ;
return val ;
} ,
2015-07-04 17:06:36 -04:00
2015-07-13 21:52:44 -04:00
category : "Chat Appearance" ,
2015-07-04 17:06:36 -04:00
2015-08-28 22:54:12 -04:00
name : "Emoji Display" ,
help : "Replace emoji in chat messages with nicer looking images from either Twitter or Google."
2016-03-23 19:28:22 -04:00
} ;
2015-07-04 17:06:36 -04:00
FFZ . settings _info . scrollback _length = {
type : "button" ,
value : 150 ,
2015-07-13 21:52:44 -04:00
category : "Chat Appearance" ,
2015-07-04 17:06:36 -04:00
no _bttv : true ,
name : "Scrollback Length" ,
help : "Set the maximum number of lines to keep in chat." ,
method : function ( ) {
2016-03-23 19:28:22 -04:00
var f = this ;
utils . prompt (
"Scrollback Length" ,
"Please enter a new maximum length for the chat scrollback. Please note that setting this too high may cause your computer to begin lagging as chat messages accumulate.</p><p><b>Default:</b> 150" ,
this . settings . scrollback _length ,
function ( new _val ) {
if ( new _val === null || new _val === undefined )
return ;
new _val = parseInt ( new _val ) ;
if ( Number . isNaN ( new _val ) || ! Number . isFinite ( new _val ) )
new _val = 150 ;
new _val = Math . max ( 10 , new _val ) ;
f . settings . set ( "scrollback_length" , new _val ) ;
// Update our everything.
2016-03-23 20:23:04 -04:00
var Chat = utils . ember _lookup ( 'controller:chat' ) ,
2016-03-23 19:28:22 -04:00
current _id = Chat && Chat . get ( 'currentRoom.id' ) ;
for ( var room _id in f . rooms ) {
var room = f . rooms [ room _id ] ;
room . room && room . room . set ( 'messageBufferSize' , new _val + ( ( f . _roomv && ! f . _roomv . get ( 'stuckToBottom' ) && current _id === room _id ) ? 150 : 0 ) ) ;
}
} ) ;
2015-07-04 17:06:36 -04:00
}
} ;
2015-07-29 01:03:10 -04:00
FFZ . settings _info . hosted _sub _notices = {
type : "boolean" ,
value : true ,
category : "Chat Filtering" ,
no _bttv : true ,
name : "Show Hosted Channel Subscriber Notices" ,
2016-03-23 19:28:22 -04:00
help : "Display (or more specifically <i>hides</i> when disabled) notices in chat when someone subscribes to the hosted channel."
2015-07-29 01:03:10 -04:00
} ;
2016-03-23 19:28:22 -04:00
FFZ . settings _info . filter _whispered _links = {
2015-08-21 19:00:48 -04:00
type : "boolean" ,
value : true ,
category : "Chat Filtering" ,
2016-03-23 19:28:22 -04:00
warn _bttv : "Only affects Whispers when BetterTTV is enabled." ,
2015-08-21 19:00:48 -04:00
2016-03-23 19:28:22 -04:00
name : "Auto-Hide Potentially Dangerous Whispered Links" ,
help : "Removes whispered links and displays a placeholder, with a warning that the link has not been approved by moderation or staff. Links remain accessible with an additional click."
2015-08-21 19:00:48 -04:00
} ;
2015-02-24 00:33:29 -05:00
FFZ . settings _info . banned _words = {
type : "button" ,
value : [ ] ,
2015-07-13 21:52:44 -04:00
category : "Chat Filtering" ,
2016-03-23 19:28:22 -04:00
warn _bttv : "Only affects Whispers when BetterTTV is enabled." ,
2015-02-24 00:33:29 -05:00
name : "Banned Words" ,
help : "Set a list of words that will be locally removed from chat messages." ,
method : function ( ) {
2016-03-23 19:28:22 -04:00
var f = this ,
old _val = this . settings . banned _words . join ( ", " ) ;
2015-02-24 00:33:29 -05:00
2016-03-23 19:28:22 -04:00
utils . prompt (
"Banned Words" ,
"Please enter a comma-separated list of words that you would like to have removed from chat messages." ,
old _val ,
function ( new _val ) {
if ( new _val === null || new _val === undefined )
return ;
2015-02-24 00:33:29 -05:00
2016-03-23 19:28:22 -04:00
new _val = new _val . trim ( ) . split ( constants . SPLITTER ) ;
var vals = [ ] ;
2015-02-24 00:33:29 -05:00
2016-03-23 19:28:22 -04:00
for ( var i = 0 ; i < new _val . length ; i ++ )
new _val [ i ] && vals . push ( new _val [ i ] ) ;
2015-02-24 00:33:29 -05:00
2016-03-23 19:28:22 -04:00
if ( vals . length == 1 && vals [ 0 ] == "disable" )
vals = [ ] ;
2015-02-24 00:33:29 -05:00
2016-03-23 19:28:22 -04:00
f . settings . set ( "banned_words" , vals ) ;
} ) ;
2015-02-24 00:33:29 -05:00
}
} ;
2015-02-08 02:01:09 -05:00
FFZ . settings _info . keywords = {
type : "button" ,
value : [ ] ,
2015-07-13 21:52:44 -04:00
category : "Chat Filtering" ,
2016-03-23 19:28:22 -04:00
warn _bttv : "Only affects Whispers when BetterTTV is enabled." ,
2015-02-08 02:01:09 -05:00
name : "Highlight Keywords" ,
help : "Set additional keywords that will be highlighted in chat." ,
method : function ( ) {
2016-03-23 19:28:22 -04:00
var f = this ,
old _val = this . settings . keywords . join ( ", " ) ;
2015-02-08 02:01:09 -05:00
2016-03-23 19:28:22 -04:00
utils . prompt (
"Highlight Keywords" ,
"Please enter a comma-separated list of words that you would like to be highlighted in chat." ,
old _val ,
function ( new _val ) {
if ( new _val === null || new _val === undefined )
return ;
2015-02-08 02:01:09 -05:00
2016-03-23 19:28:22 -04:00
// Split them up.
new _val = new _val . trim ( ) . split ( constants . SPLITTER ) ;
var vals = [ ] ;
2015-02-24 00:33:29 -05:00
2016-03-23 19:28:22 -04:00
for ( var i = 0 ; i < new _val . length ; i ++ )
new _val [ i ] && vals . push ( new _val [ i ] ) ;
2015-02-08 02:01:09 -05:00
2016-03-23 19:28:22 -04:00
if ( vals . length == 1 && vals [ 0 ] == "disable" )
vals = [ ] ;
2015-02-08 02:01:09 -05:00
2016-03-23 19:28:22 -04:00
f . settings . set ( "keywords" , vals ) ;
} ) ;
2015-02-08 02:01:09 -05:00
}
} ;
2015-07-31 17:44:20 -04:00
FFZ . settings _info . clickable _emoticons = {
type : "boolean" ,
value : false ,
category : "Chat Tooltips" ,
2016-03-23 19:28:22 -04:00
warn _bttv : "Only affects Whispers when BetterTTV is enabled." ,
2015-07-31 17:44:20 -04:00
no _mobile : true ,
name : "Emoticon Information Pages" ,
help : "When enabled, holding shift and clicking on an emoticon will open it on the FrankerFaceZ website or Twitch Emotes."
} ;
2015-07-18 21:10:27 -04:00
FFZ . settings _info . link _info = {
2015-02-10 01:34:23 -05:00
type : "boolean" ,
2015-02-26 00:42:11 -05:00
value : true ,
2015-02-10 01:34:23 -05:00
2015-07-18 21:10:27 -04:00
category : "Chat Tooltips" ,
2015-05-17 19:02:57 -04:00
no _bttv : true ,
2015-02-10 01:34:23 -05:00
2015-07-18 21:10:27 -04:00
name : "Link Information <span>Beta</span>" ,
help : "Check links against known bad websites, unshorten URLs, and show YouTube info."
2015-02-10 01:34:23 -05:00
} ;
2015-07-18 21:10:27 -04:00
FFZ . settings _info . link _image _hover = {
2015-05-17 19:02:57 -04:00
type : "boolean" ,
2015-07-18 21:10:27 -04:00
value : false ,
2015-05-17 19:02:57 -04:00
2015-07-18 21:10:27 -04:00
category : "Chat Tooltips" ,
2015-05-17 19:02:57 -04:00
no _bttv : true ,
2015-07-18 21:10:27 -04:00
no _mobile : true ,
2015-05-17 19:02:57 -04:00
2015-07-18 21:10:27 -04:00
name : "Image Preview" ,
help : "Display image thumbnails for links to Imgur and YouTube."
} ;
2015-11-14 23:52:49 -05:00
FFZ . settings _info . emote _image _hover = {
type : "boolean" ,
value : false ,
category : "Chat Tooltips" ,
no _mobile : true ,
name : "Emote Preview" ,
help : "Display scaled up high-DPI emoticon images in tooltips to help see details on low-resolution monitors." ,
on _update : function ( val ) {
this . _reset _tooltips ( ) ;
}
} ;
2015-07-18 21:10:27 -04:00
FFZ . settings _info . image _hover _all _domains = {
type : "boolean" ,
value : false ,
2015-08-02 02:41:03 -04:00
2015-07-18 21:10:27 -04:00
category : "Chat Tooltips" ,
no _bttv : true ,
no _mobile : true ,
2015-08-02 02:41:03 -04:00
2015-07-18 21:10:27 -04:00
name : "Image Preview - All Domains" ,
help : "<i>Requires Image Preview.</i> Attempt to show an image preview for any URL ending in the appropriate extension. <b>Warning: This may be used to leak your IP address to malicious users.</b>"
2015-05-17 19:02:57 -04:00
} ;
2015-02-08 02:01:09 -05:00
FFZ . settings _info . chat _rows = {
type : "boolean" ,
value : false ,
2015-07-13 21:52:44 -04:00
category : "Chat Appearance" ,
2015-05-17 19:02:57 -04:00
no _bttv : true ,
2015-02-08 02:01:09 -05:00
name : "Chat Line Backgrounds" ,
help : "Display alternating background colors for lines in chat." ,
2015-11-11 02:06:02 -05:00
on _update : function ( val ) {
this . toggle _style ( 'chat-background' , ! this . has _bttv && val ) ;
this . toggle _style ( 'chat-setup' , ! this . has _bttv && ( val || this . settings . chat _separators ) ) ;
}
2015-07-13 21:52:44 -04:00
} ;
FFZ . settings _info . chat _separators = {
2015-07-18 21:10:27 -04:00
type : "select" ,
options : {
0 : "Disabled" ,
1 : "Basic Line (1px solid)" ,
2015-10-17 18:05:44 -04:00
2 : "3D Line (2px groove)" ,
3 : "3D Line (2px groove inset)" ,
4 : "Wide Line (2px solid)"
2015-07-18 21:10:27 -04:00
} ,
2015-10-17 18:05:44 -04:00
value : 0 ,
2015-07-13 21:52:44 -04:00
category : "Chat Appearance" ,
no _bttv : true ,
2015-08-02 02:41:03 -04:00
2015-07-18 21:10:27 -04:00
process _value : function ( val ) {
if ( val === false )
2015-10-17 18:05:44 -04:00
return 0 ;
2015-07-18 21:10:27 -04:00
else if ( val === true )
2015-10-17 18:05:44 -04:00
return 1 ;
else if ( typeof val === "string" )
return parseInt ( val ) || 0 ;
2015-07-18 21:10:27 -04:00
return val ;
} ,
2015-07-13 21:52:44 -04:00
name : "Chat Line Separators" ,
help : "Display thin lines between chat messages for further visual separation." ,
2015-07-18 21:10:27 -04:00
on _update : function ( val ) {
2015-11-11 02:06:02 -05:00
this . toggle _style ( 'chat-setup' , ! this . has _bttv && ( val || this . settings . chat _rows ) ) ;
this . toggle _style ( 'chat-separator' , ! this . has _bttv && val ) ;
this . toggle _style ( 'chat-separator-3d' , ! this . has _bttv && val === 2 ) ;
this . toggle _style ( 'chat-separator-3d-inset' , ! this . has _bttv && val === 3 ) ;
this . toggle _style ( 'chat-separator-wide' , ! this . has _bttv && val === 4 ) ;
2015-07-18 21:10:27 -04:00
}
2015-07-13 21:52:44 -04:00
} ;
2015-08-02 02:41:03 -04:00
2015-07-13 21:52:44 -04:00
FFZ . settings _info . chat _padding = {
type : "boolean" ,
value : false ,
category : "Chat Appearance" ,
no _bttv : true ,
name : "Reduced Chat Line Padding" ,
help : "Reduce the amount of padding around chat messages to fit more on-screen at once." ,
2015-11-11 02:06:02 -05:00
on _update : function ( val ) { this . toggle _style ( 'chat-padding' , ! this . has _bttv && val ) ; }
2015-07-13 21:52:44 -04:00
} ;
FFZ . settings _info . high _contrast _chat = {
2015-07-31 17:44:20 -04:00
type : "select" ,
options : {
'222' : "Disabled" ,
'212' : "Bold" ,
'221' : "Text" ,
'211' : "Text + Bold" ,
'122' : "Background" ,
'121' : "Background + Text" ,
'112' : "Background + Bold" ,
'111' : 'All'
} ,
2015-08-04 01:43:08 -04:00
value : '222' ,
2015-07-13 21:52:44 -04:00
category : "Chat Appearance" ,
no _bttv : true ,
name : "High Contrast" ,
help : "Display chat using white and black for maximum contrast. This is suitable for capturing and chroma keying chat to display on stream." ,
2015-07-31 17:44:20 -04:00
process _value : function ( val ) {
if ( val === false )
2015-08-04 01:43:08 -04:00
return '222' ;
2015-07-31 17:44:20 -04:00
else if ( val === true )
return '111' ;
return val ;
} ,
on _update : function ( val ) {
2015-11-11 02:06:02 -05:00
this . toggle _style ( 'chat-hc-text' , ! this . has _bttv && val [ 2 ] === '1' ) ;
this . toggle _style ( 'chat-hc-bold' , ! this . has _bttv && val [ 1 ] === '1' ) ;
this . toggle _style ( 'chat-hc-background' , ! this . has _bttv && val [ 0 ] === '1' ) ;
2015-07-31 17:44:20 -04:00
}
2015-07-13 21:52:44 -04:00
} ;
2015-08-28 22:54:12 -04:00
FFZ . settings _info . chat _font _family = {
type : "button" ,
value : null ,
category : "Chat Appearance" ,
no _bttv : true ,
name : "Font Family" ,
help : "Change the font used for rendering chat messages." ,
method : function ( ) {
2016-03-23 19:28:22 -04:00
var f = this ,
old _val = this . settings . chat _font _family || "" ;
utils . prompt (
"Chat Font Family" ,
"Please enter a font family to use rendering chat. Leave this blank to use the default." ,
old _val ,
function ( new _val ) {
if ( new _val === null || new _val === undefined )
return ;
// Should we wrap this with quotes?
if ( ! new _val )
new _val = null ;
f . settings . set ( "chat_font_family" , new _val ) ;
} ) ;
2015-08-28 22:54:12 -04:00
} ,
on _update : function ( val ) {
if ( this . has _bttv || ! this . _chat _style )
return ;
var css ;
if ( ! val )
css = "" ;
else {
// Let's escape this to avoid goofing anything up if there's bad user input.
if ( val . indexOf ( ' ' ) !== - 1 && val . indexOf ( ',' ) === - 1 && val . indexOf ( '"' ) === - 1 && val . indexOf ( "'" ) === - 1 )
val = '"' + val + '"' ;
var span = document . createElement ( 'span' ) ;
span . style . fontFamily = val ;
2015-11-14 23:52:49 -05:00
css = ".timestamp-line,.conversation-chat-line,.conversation-system-messages,.chat-history,.ember-chat .chat-messages {" + span . style . cssText + "}" ;
2015-08-28 22:54:12 -04:00
}
utils . update _css ( this . _chat _style , "chat_font_family" , css ) ;
}
} ;
2015-07-13 21:52:44 -04:00
FFZ . settings _info . chat _font _size = {
type : "button" ,
value : 12 ,
category : "Chat Appearance" ,
no _bttv : true ,
name : "Font Size" ,
help : "Make the chat font bigger or smaller." ,
method : function ( ) {
2016-03-23 19:28:22 -04:00
var f = this ,
old _val = this . settings . chat _font _size ;
utils . prompt (
"Chat Font Size" ,
"Please enter a new size for the chat font.</p><p><b>Default:</b> 12" ,
old _val ,
function ( new _val ) {
if ( new _val === null || new _val === undefined )
return ;
var parsed = parseInt ( new _val ) ;
if ( ! parsed || Number . isNaN ( parsed ) || parsed < 1 )
parsed = 12 ;
f . settings . set ( "chat_font_size" , parsed ) ;
} ) ;
2015-07-13 21:52:44 -04:00
} ,
on _update : function ( val ) {
if ( this . has _bttv || ! this . _chat _style )
return ;
var css ;
2015-07-29 01:03:10 -04:00
if ( val === 12 || ! val )
2015-07-13 21:52:44 -04:00
css = "" ;
else {
var lh = Math . max ( 20 , Math . round ( ( 20 / 12 ) * val ) ) ,
pd = Math . floor ( ( lh - 20 ) / 2 ) ;
2015-11-14 23:52:49 -05:00
css = ".timestamp-line,.conversation-chat-line,.conversation-system-messages,.chat-history .chat-line,.ember-chat .chat-messages .chat-line { font-size: " + val + "px !important; line-height: " + lh + "px !important; }" ;
2015-07-13 21:52:44 -04:00
if ( pd )
css += ".ember-chat .chat-messages .chat-line .mod-icons, .ember-chat .chat-messages .chat-line .badges { padding-top: " + pd + "px; }" ;
}
utils . update _css ( this . _chat _style , "chat_font_size" , css ) ;
2016-03-23 19:28:22 -04:00
FFZ . settings _info . chat _ts _size . on _update . call ( this , this . settings . chat _ts _size ) ;
2015-07-18 21:10:27 -04:00
}
} ;
FFZ . settings _info . chat _ts _size = {
type : "button" ,
value : null ,
category : "Chat Appearance" ,
no _bttv : true ,
name : "Timestamp Font Size" ,
help : "Make the chat timestamp font bigger or smaller." ,
method : function ( ) {
2016-03-23 19:28:22 -04:00
var f = this ,
old _val = this . settings . chat _ts _size ;
2015-08-02 02:41:03 -04:00
2015-07-29 01:03:10 -04:00
if ( ! old _val )
2015-07-18 21:10:27 -04:00
old _val = this . settings . chat _font _size ;
2015-08-02 02:41:03 -04:00
2016-03-23 19:28:22 -04:00
utils . prompt (
"Chat Timestamp Font Size" ,
"Please enter a new size for the chat timestamp font. The default is to match the regular chat font size." ,
old _val ,
function ( new _val ) {
if ( new _val === null || new _val === undefined )
return ;
2015-07-18 21:10:27 -04:00
2016-03-23 19:28:22 -04:00
var parsed = parseInt ( new _val ) ;
if ( parsed < 1 || Number . isNaN ( parsed ) || ! Number . isFinite ( parsed ) )
parsed = null ;
2015-07-18 21:10:27 -04:00
2016-03-23 19:28:22 -04:00
f . settings . set ( "chat_ts_size" , parsed ) ;
} ) ;
2015-07-18 21:10:27 -04:00
} ,
on _update : function ( val ) {
if ( this . has _bttv || ! this . _chat _style )
return ;
var css ;
if ( val === null )
css = "" ;
else {
var lh = Math . max ( 20 , Math . round ( ( 20 / 12 ) * val ) , Math . round ( ( 20 / 12 ) * this . settings . chat _font _size ) ) ;
2015-11-19 02:45:56 -05:00
css = ".ember-chat .chat-messages .timestamp { font-size: " + val + "px !important; line-height: " + lh + "px !important; }" ;
2015-07-18 21:10:27 -04:00
}
utils . update _css ( this . _chat _style , "chat_ts_font_size" , css ) ;
2015-02-08 02:01:09 -05:00
}
} ;
2015-01-20 01:53:18 -05:00
// ---------------------
// Initialization
// ---------------------
FFZ . prototype . setup _line = function ( ) {
2015-07-13 21:52:44 -04:00
// Tipsy Handler
jQuery ( document . body ) . on ( "mouseleave" , ".tipsy" , function ( ) {
this . parentElement . removeChild ( this ) ;
} ) ;
2015-08-02 02:41:03 -04:00
2015-07-29 01:03:10 -04:00
// Aliases
try {
this . aliases = JSON . parse ( localStorage . ffz _aliases || '{}' ) ;
} catch ( err ) {
this . log ( "Error Loading Aliases: " + err ) ;
this . aliases = { } ;
}
2015-08-02 02:41:03 -04:00
2015-07-13 21:52:44 -04:00
// Chat Style
var s = this . _chat _style = document . createElement ( 'style' ) ;
s . id = "ffz-style-chat" ;
s . type = 'text/css' ;
2015-08-02 02:41:03 -04:00
document . head . appendChild ( s ) ;
2015-07-13 21:52:44 -04:00
// Initial calculation.
2016-03-23 19:28:22 -04:00
FFZ . settings _info . chat _font _size . on _update . call ( this , this . settings . chat _font _size ) ;
FFZ . settings _info . chat _font _family . on _update . call ( this , this . settings . chat _font _family ) ;
2015-07-18 21:10:27 -04:00
2015-08-02 02:41:03 -04:00
2015-02-10 01:34:23 -05:00
// Chat Enhancements
2016-03-23 19:28:22 -04:00
document . body . classList . toggle ( 'ffz-alias-italics' , this . settings . alias _italics ) ;
2015-11-11 02:06:02 -05:00
this . toggle _style ( 'chat-setup' , ! this . has _bttv && ( this . settings . chat _rows || this . settings . chat _separators ) ) ;
this . toggle _style ( 'chat-padding' , ! this . has _bttv && this . settings . chat _padding ) ;
this . toggle _style ( 'chat-background' , ! this . has _bttv && this . settings . chat _rows ) ;
2015-08-02 02:41:03 -04:00
2015-11-11 02:06:02 -05:00
this . toggle _style ( 'chat-separator' , ! this . has _bttv && this . settings . chat _separators ) ;
this . toggle _style ( 'chat-separator-3d' , ! this . has _bttv && this . settings . chat _separators === 2 ) ;
this . toggle _style ( 'chat-separator-3d-inset' , ! this . has _bttv && this . settings . chat _separators === 3 ) ;
this . toggle _style ( 'chat-separator-wide' , ! this . has _bttv && this . settings . chat _separators === 4 ) ;
2015-08-02 02:41:03 -04:00
2015-11-11 02:06:02 -05:00
this . toggle _style ( 'chat-hc-text' , ! this . has _bttv && this . settings . high _contrast _chat [ 2 ] === '1' ) ;
this . toggle _style ( 'chat-hc-bold' , ! this . has _bttv && this . settings . high _contrast _chat [ 1 ] === '1' ) ;
this . toggle _style ( 'chat-hc-background' , ! this . has _bttv && this . settings . high _contrast _chat [ 0 ] === '1' ) ;
2015-02-10 01:34:23 -05:00
2015-02-08 02:01:09 -05:00
this . _last _row = { } ;
2016-03-23 19:28:22 -04:00
this . log ( "Hooking the Ember Chat Line component." ) ;
2016-03-23 20:23:04 -04:00
var Line = utils . ember _resolve ( 'component:chat-line' ) ;
2016-03-23 19:28:22 -04:00
if ( Line )
this . _modify _chat _line ( Line ) ;
this . log ( "Hooking the Ember VOD Chat Line component." ) ;
2016-03-23 20:23:04 -04:00
var VOD = utils . ember _resolve ( 'component:vod-chat-line' ) ;
2016-03-23 19:28:22 -04:00
if ( VOD )
this . _modify _vod _line ( VOD ) ;
else
this . log ( "Couldn't find VOD Chat Line component." ) ;
2015-01-20 01:53:18 -05:00
2016-03-24 14:48:53 -04:00
var other _lines = [ 'message-line' , 'whisper-line' ] ;
for ( var i = 0 ; i < other _lines . length ; i ++ ) {
var component = utils . ember _resolve ( 'component:' + other _lines [ i ] ) ;
if ( component )
component . reopen ( {
didUpdate : function ( ) { } ,
didInsertElement : function ( ) { }
} ) ;
}
2015-06-10 18:46:04 -04:00
// Store the capitalization of our own name.
var user = this . get _user ( ) ;
if ( user && user . name )
FFZ . capitalization [ user . login ] = [ user . name , Date . now ( ) ] ;
}
2015-07-29 01:03:10 -04:00
FFZ . prototype . save _aliases = function ( ) {
this . log ( "Saving " + Object . keys ( this . aliases ) . length + " aliases to local storage." ) ;
localStorage . ffz _aliases = JSON . stringify ( this . aliases ) ;
}
2016-03-23 19:28:22 -04:00
FFZ . prototype . _modify _chat _line = function ( component , is _vod ) {
var f = this ,
2016-03-23 20:23:04 -04:00
Layout = utils . ember _lookup ( 'controller:layout' ) ,
Settings = utils . ember _lookup ( 'controller:settings' ) ;
2015-11-07 22:56:15 -05:00
2016-03-23 19:28:22 -04:00
component . reopen ( {
tokenizedMessage : function ( ) {
2015-11-07 22:56:15 -05:00
try {
return f . tokenize _chat _line ( this . get ( 'msgObject' ) ) ;
} catch ( err ) {
f . error ( "chat-line tokenizedMessage: " + err ) ;
return this . _super ( ) ;
}
2015-06-05 03:59:28 -04:00
} . property ( "msgObject.message" , "isChannelLinksDisabled" , "currentUserNick" , "msgObject.from" , "msgObject.tags.emotes" ) ,
2015-01-20 01:53:18 -05:00
2016-03-23 19:28:22 -04:00
lineChanged : Ember . observer ( "msgObject.deleted" , "isModeratorOrHigher" , "msgObject.ffz_old_messages" , function ( ) {
this . $ ( ".mod-icons" ) . replaceWith ( this . buildModIconsHTML ( ) ) ;
if ( this . get ( "msgObject.deleted" ) ) {
this . $ ( ".message" ) . replaceWith ( this . buildDeletedMessageHTML ( ) ) ;
} else
this . $ ( ".deleted,.message" ) . replaceWith ( this . buildMessageHTML ( ) ) ;
} ) ,
2015-08-02 02:41:03 -04:00
2016-03-23 19:28:22 -04:00
ffzUserLevel : function ( ) {
2015-07-29 01:03:10 -04:00
if ( this . get ( 'isStaff' ) )
return 5 ;
else if ( this . get ( 'isAdmin' ) )
return 4 ;
else if ( this . get ( 'isBroadcaster' ) )
return 3 ;
2015-10-17 18:05:44 -04:00
else if ( this . get ( 'isGlobalMod' ) )
2015-07-29 01:03:10 -04:00
return 2 ;
else if ( this . get ( 'isModerator' ) )
return 1 ;
return 0 ;
} . property ( 'msgObject.labels.[]' ) ,
2015-08-02 02:41:03 -04:00
2016-03-23 19:28:22 -04:00
buildModIconsHTML : function ( ) {
var user = this . get ( 'msgObject.from' ) ,
room _id = this . get ( 'msgObject.room' ) ,
room = f . rooms && f . rooms [ room _id ] ,
2015-08-02 02:41:03 -04:00
2016-03-23 19:28:22 -04:00
deleted = this . get ( 'msgObject.deleted' ) ,
2015-08-02 02:41:03 -04:00
2016-03-23 19:28:22 -04:00
recipient = this . get ( 'msgObject.to' ) ,
is _whisper = recipient && recipient . length ,
2015-08-02 02:41:03 -04:00
2016-03-23 19:28:22 -04:00
this _ul = this . get ( 'ffzUserLevel' ) ,
other _ul = room && room . room && room . room . get ( 'ffzUserLevel' ) || 0 ,
2015-05-17 19:02:57 -04:00
2016-03-23 19:28:22 -04:00
output ;
2015-08-02 02:41:03 -04:00
2016-03-23 19:28:22 -04:00
if ( is _whisper || this _ul >= other _ul || f . settings . mod _buttons . length === 0 )
return '' ;
2015-07-31 17:44:20 -04:00
2016-03-23 19:28:22 -04:00
output = '<span class="mod-icons float-left">' ;
2015-02-24 00:33:29 -05:00
2016-03-23 19:28:22 -04:00
for ( var i = 0 , l = f . settings . mod _buttons . length ; i < l ; i ++ ) {
var pair = f . settings . mod _buttons [ i ] ,
prefix = pair [ 0 ] , btn = pair [ 1 ] ,
2015-08-02 02:41:03 -04:00
2016-03-23 19:28:22 -04:00
cmd , tip ;
2015-11-19 02:45:56 -05:00
2016-03-23 19:28:22 -04:00
if ( btn === false ) {
if ( deleted )
output += '<a class="mod-icon float-left tooltip unban" title="Unban User" href="#">Unban</a>' ;
else
output += '<a class="mod-icon float-left tooltip ban" title="Ban User" href="#">Ban</a>' ;
2015-10-17 18:05:44 -04:00
2016-03-23 19:28:22 -04:00
} else if ( btn === 600 )
output += '<a class="mod-icon float-left tooltip timeout" title="Timeout User (10m)" href="#">Timeout</a>' ;
2015-10-17 18:05:44 -04:00
2016-03-23 19:28:22 -04:00
else {
if ( typeof btn === "string" ) {
cmd = btn . replace ( /{user}/g , user ) . replace ( / *<LINE> */ , "\n" ) ;
tip = "Custom Command" + ( cmd . indexOf ( "\n" ) !== - 1 ? 's' : '' ) + '\n' + cmd ;
} else {
cmd = "/timeout " + user + " " + btn ;
tip = "Timeout User (" + utils . duration _string ( btn ) + ")" ;
}
output += '<a class="mod-icon float-left tooltip' + ( cmd . substr ( 0 , 9 ) === '/timeout' ? ' is-timeout' : '' ) + ' custom" data-cmd="' + utils . quote _attr ( cmd ) + '" title="' + utils . quote _attr ( tip ) + '" href="#">' + prefix + '</a>' ;
}
}
2015-10-17 18:05:44 -04:00
2016-03-23 19:28:22 -04:00
return output + '</span>' ;
} ,
2015-10-17 18:05:44 -04:00
2016-03-23 19:28:22 -04:00
buildSenderHTML : function ( ) {
var user = this . get ( 'msgObject.from' ) ,
room _id = this . get ( 'msgObject.room' ) ,
room = f . rooms && f . rooms [ room _id ] ,
2015-10-17 18:05:44 -04:00
2016-03-23 19:28:22 -04:00
deleted = this . get ( 'msgObject.deleted' ) ,
r = this ,
recipient = this . get ( 'msgObject.to' ) ,
is _whisper = recipient && recipient . length ,
is _replay = this . get ( 'ffz_is_replay' ) ,
this _ul = this . get ( 'ffzUserLevel' ) ,
other _ul = room && room . room && room . room . get ( 'ffzUserLevel' ) || 0 ,
raw _color = this . get ( 'msgObject.color' ) ,
colors = raw _color && f . _handle _color ( raw _color ) ,
is _dark = ( Layout && Layout . get ( 'isTheatreMode' ) ) || ( is _replay ? f . settings . dark _twitch : ( Settings && Settings . get ( 'settings.darkMode' ) ) ) ,
output = '' ;
output = '<div class="indicator"></div><span class="timestamp float-left">' + this . get ( 'timestamp' ) + '</span> ' ;
// Moderator Actions
output += this . buildModIconsHTML ( ) ;
// Badges
output += '<span class="badges float-left">' + f . render _badges ( f . get _line _badges ( this . get ( 'msgObject' ) , is _whisper ) ) + '</span>' ;
// Alias Support
var alias = f . aliases [ user ] ,
name = this . get ( 'msgObject.tags.display-name' ) || ( user && user . capitalize ( ) ) || "unknown user" ,
style = colors && 'color:' + ( is _dark ? colors [ 1 ] : colors [ 0 ] ) || '' ,
colored = style ? ' has-color' + ( is _replay ? ' replay-color' : '' ) : '' ;
output += '<span class="from' + ( alias ? ' ffz-alias tooltip' : '' ) + colored + '" style="' + style + ( colors ? '" data-color="' + raw _color : '' ) ;
if ( alias )
output += '" title="' + utils . sanitize ( name ) + '">' + utils . sanitize ( alias ) ;
else
output += '">' + utils . sanitize ( name ) ;
// Whisper Legacy Sucks
if ( is _whisper ) {
var to _alias = f . aliases [ recipient ] ,
to _name = this . get ( 'msgObject.tags.recipient-display-name' ) || ( recipient && recipient . capitalize ( ) ) || "unknown user" ,
to _color = this . get ( 'msgObject.toColor' ) ,
to _colors = to _color && f . _handle _color ( to _color ) ,
to _style = to _color ? 'color:' + ( is _dark ? to _colors [ 1 ] : to _colors [ 0 ] ) : '' ,
to _colored = to _style ? ' has-color' : '' ;
output += "</span><svg class='svg-whisper-arrow' height='10px' version='1.1' width='16px'><polyline points='6 2, 10 6, 6 10, 6 2' /></svg>" ;
output += '<span class="to' + ( to _alias ? ' ffz-alias tooltip' : '' ) + to _colored + '" style="' + to _style + ( to _colors ? '" data=color="' + to _color : '' ) ;
if ( to _alias )
output += '" title="' + utils . sanitize ( to _name ) + '">' + utils . sanitize ( to _alias ) ;
else
output += '">' + utils . sanitize ( to _name ) ;
}
return output + '</span><span class="colon">:</span> ' ;
} ,
buildDeletedMessageHTML : function ( ) {
return '<span class="deleted"><a class="undelete" href=#"><message deleted></a></span>' ;
} ,
buildMessageHTML : function ( ) {
var output ,
recipient = this . get ( 'msgObject.to' ) ,
is _whisper = recipient && recipient . length ;
if ( this . get ( 'msgObject.style' ) === 'action' ) {
var raw _color = this . get ( 'msgObject.color' ) ,
colors = raw _color && f . _handle _color ( raw _color ) ,
is _replay = this . get ( 'ffz_is_replay' ) ,
is _dark = ( Layout && Layout . get ( 'isTheatreMode' ) ) || ( is _replay ? f . settings . dark _twitch : ( Settings && Settings . get ( 'settings.darkMode' ) ) ) ;
if ( raw _color )
output = '<span class="message has-color' + ( is _replay ? ' replay-color' : '' ) + '" style="color:' + ( is _dark ? colors [ 1 ] : colors [ 0 ] ) + '" data-color="' + raw _color + '">' ;
else
output = '<span class="message">' ;
} else
output = '<span class="message">' ;
output += f . render _tokens ( this . get ( 'tokenizedMessage' ) , true , is _whisper && f . settings . filter _whispered _links && this . get ( "ffzUserLevel" ) < 4 ) ;
var old _messages = this . get ( 'msgObject.ffz_old_messages' ) ;
if ( old _messages && old _messages . length )
output += '<div class="button primary float-right ffz-old-messages">Show ' + utils . number _commas ( old _messages . length ) + ' Old</div>' ;
return output + '</span>' ;
} ,
tagName : "li" ,
classNameBindings : is _vod ? [ "msgObject.ffz_has_mention:ffz-mentioned" ] : [ ":message-line" , ":chat-line" , "msgObject.style" , "msgObject.ffz_has_mention:ffz-mentioned" , "ffzWasDeleted:ffz-deleted" , "ffzHasOldMessages:clearfix" , "ffzHasOldMessages:ffz-has-deleted" ] ,
attributeBindings : [ "msgObject.room:data-room" , "msgObject.from:data-sender" , "msgObject.deleted:data-deleted" ] ,
2016-03-24 14:48:53 -04:00
didUpdate : function ( ) {
this . ffzRender ( ) ;
} ,
didInsertElement : function ( ) {
this . ffzRender ( ) ;
} ,
ffzRender : function ( ) {
var el = this . get ( 'element' ) ,
output = this . buildSenderHTML ( ) ;
if ( this . get ( 'msgObject.deleted' ) )
output += this . buildDeletedMessageHTML ( )
2016-03-23 19:28:22 -04:00
else
2016-03-24 14:48:53 -04:00
output += this . buildMessageHTML ( ) ;
el . innerHTML = output ;
2016-03-23 19:28:22 -04:00
} ,
ffzWasDeleted : function ( ) {
return f . settings . prevent _clear && this . get ( "msgObject.ffz_deleted" )
} . property ( "msgObject.ffz_deleted" ) ,
ffzHasOldMessages : function ( ) {
var old _messages = this . get ( "msgObject.ffz_old_messages" ) ;
return old _messages && old _messages . length ;
} . property ( "msgObject.ffz_old_messages" ) ,
click : function ( e ) {
if ( ! e . target )
return ;
var cl = e . target . classList ,
from = this . get ( "msgObject.from" ) ;
if ( cl . contains ( 'ffz-old-messages' ) )
return f . _show _deleted ( this . get ( 'msgObject.room' ) ) ;
else if ( cl . contains ( 'deleted-word' ) ) {
jQuery ( e . target ) . trigger ( 'mouseout' ) ;
e . target . outerHTML = e . target . getAttribute ( 'data-text' ) ;
} else if ( cl . contains ( 'deleted-link' ) )
return f . _deleted _link _click . call ( e . target , e ) ;
else if ( cl . contains ( 'mod-icon' ) ) {
jQuery ( e . target ) . trigger ( 'mouseout' ) ;
e . preventDefault ( ) ;
if ( cl . contains ( 'custom' ) ) {
var room _id = this . get ( 'msgObject.room' ) ,
room = room _id && f . rooms [ room _id ] && f . rooms [ room _id ] . room ,
cmd = e . target . getAttribute ( 'data-cmd' ) ;
if ( room ) {
var lines = cmd . split ( "\n" ) ;
for ( var i = 0 ; i < lines . length ; i ++ )
room . send ( lines [ i ] , true ) ;
if ( cl . contains ( 'is-timeout' ) )
room . clearMessages ( from ) ;
2015-10-17 18:05:44 -04:00
}
2016-03-23 19:28:22 -04:00
return ;
2015-08-02 02:41:03 -04:00
2016-03-23 19:28:22 -04:00
} else if ( cl . contains ( 'ban' ) )
this . sendAction ( "banUser" , { user : from } ) ;
else if ( cl . contains ( 'unban' ) )
this . sendAction ( "unbanUser" , { user : from } ) ;
else if ( cl . contains ( 'timeout' ) )
this . sendAction ( "timeoutUser" , { user : from } ) ;
2015-08-02 02:41:03 -04:00
2016-03-23 19:28:22 -04:00
} else if ( cl . contains ( 'badge' ) ) {
if ( cl . contains ( 'turbo' ) )
window . open ( "/products/turbo?ref=chat_badge" , "_blank" ) ;
2015-07-04 17:06:36 -04:00
2016-03-23 19:28:22 -04:00
else if ( cl . contains ( 'subscriber' ) )
this . sendAction ( "clickSubscriber" ) ;
2015-08-02 02:41:03 -04:00
2016-03-23 19:28:22 -04:00
} else if ( f . _click _emote ( e . target , e ) )
return ;
2015-11-19 02:45:56 -05:00
2016-03-23 19:28:22 -04:00
else if ( e . target . classList . contains ( 'from' ) ) {
var n = this . $ ( ) ;
this . sendAction ( "showModOverlay" , {
left : n . offset ( ) . left ,
top : n . offset ( ) . top + n . height ( ) ,
sender : from
} ) ;
2015-02-24 00:33:29 -05:00
2016-03-23 19:28:22 -04:00
} else if ( e . target . classList . contains ( 'undelete' ) )
this . set ( "msgObject.deleted" , false ) ;
}
} ) ;
}
2015-02-24 00:33:29 -05:00
2015-11-19 02:45:56 -05:00
2016-03-23 19:28:22 -04:00
FFZ . prototype . _modify _vod _line = function ( component ) {
var f = this ;
// We need to override a few things.
this . _modify _chat _line ( component , true ) ;
component . reopen ( {
ffz _is _replay : true ,
/ * l i n e C h a n g e d : E m b e r . o b s e r v e r ( " m s g O b j e c t . d e l e t e d " , " i s M o d e r a t o r O r H i g h e r " , f u n c t i o n ( ) {
this . $ ( ".mod-icons" ) . replaceWith ( this . buildModIconsHTML ( ) ) ;
if ( this . get ( "msgObject.deleted" ) )
this . $ ( ".message" ) . replaceWith ( this . buildMessageHTML ( ) ) ;
else
this . $ ( ".deleted" ) . replaceWith ( this . buildMessageHTML ( ) ) ;
} ) , * /
2016-03-24 15:30:43 -04:00
tokenizedMessage : function ( ) {
try {
return f . tokenize _vod _line ( this . get ( 'msgObject' ) , ! ( this . get ( 'enableLinkification' ) || this . get ( 'isModeratorOrHigher' ) ) ) ;
} catch ( err ) {
f . error ( "vod-chat-line tokenizedMessage: " + err ) ;
return this . _super ( ) ;
}
} . property ( "msgObject.message" , "currentUserNick" , "msgObject.from" , "msgObject.tags.emotes" ) ,
buildHorizontalLineHTML : function ( ) {
return '<div class="horizontal-line"><span>' + this . get ( 'msgObject.timestamp' ) + '</span></div>' ;
} ,
2016-03-23 19:28:22 -04:00
buildModIconsHTML : function ( ) {
if ( ! this . get ( "isViewerModeratorOrHigher" ) || this . get ( "isModeratorOrHigher" ) )
return "" ;
return '<span class="mod-icons float-left">' +
( this . get ( 'msgObject.deleted' ) ?
'<em class="mod-icon float-left unban"></em>' :
'<a class="mod-icon float-left tooltip delete" title="Delete Message" href="#">Delete</a>' ) + '</span>' ;
} ,
buildDeletedMesageHTML : function ( ) {
return '<span clas="deleted"><message deleted></span>' ;
} ,
2016-03-24 15:30:43 -04:00
didUpdate : function ( ) { this . ffzRender ( ) } ,
didInsertElement : function ( ) { this . ffzRender ( ) } ,
ffzRender : function ( ) {
var el = this . get ( 'element' ) , output ;
2016-03-23 19:28:22 -04:00
if ( this . get ( 'msgObject.isHorizontalLine' ) )
2016-03-24 15:30:43 -04:00
output = this . buildHorizontalLineHTML ( ) ;
2016-03-23 19:28:22 -04:00
else {
2016-03-24 15:30:43 -04:00
output = this . buildSenderHTML ( ) ;
if ( this . get ( 'msgObject.deleted' ) )
output += this . buildDeletedMessageHTML ( )
2016-03-23 19:28:22 -04:00
else
2016-03-24 15:30:43 -04:00
output += this . buildMessageHTML ( ) ;
2016-03-23 19:28:22 -04:00
}
2016-03-24 15:30:43 -04:00
el . innerHTML = output ;
2016-03-23 19:28:22 -04:00
} ,
click : function ( e ) {
if ( e . target . classList . contains ( 'delete' ) ) {
e . preventDefault ( ) ;
this . sendAction ( "timeoutUser" , this . get ( "msgObject.id" ) ) ;
}
}
} ) ;
}
2015-08-02 02:41:03 -04:00
2015-01-20 01:53:18 -05:00
// ---------------------
// Capitalization
// ---------------------
FFZ . capitalization = { } ;
FFZ . _cap _fetching = 0 ;
FFZ . get _capitalization = function ( name , callback ) {
2015-02-08 02:59:20 -05:00
if ( ! name )
return name ;
2015-01-20 01:53:18 -05:00
name = name . toLowerCase ( ) ;
if ( name == "jtv" || name == "twitchnotify" )
return name ;
var old _data = FFZ . capitalization [ name ] ;
if ( old _data ) {
if ( Date . now ( ) - old _data [ 1 ] < 3600000 )
return old _data [ 0 ] ;
}
2015-02-24 00:33:29 -05:00
if ( FFZ . _cap _fetching < 25 ) {
2015-01-20 01:53:18 -05:00
FFZ . _cap _fetching ++ ;
2015-02-24 00:33:29 -05:00
FFZ . get ( ) . ws _send ( "get_display_name" , name , function ( success , data ) {
var cap _name = success ? data : name ;
FFZ . capitalization [ name ] = [ cap _name , Date . now ( ) ] ;
FFZ . _cap _fetching -- ;
typeof callback === "function" && callback ( cap _name ) ;
} ) ;
2015-01-20 01:53:18 -05:00
}
return old _data ? old _data [ 0 ] : name ;
}
2015-02-24 00:33:29 -05:00
// ---------------------
// Banned Words
// ---------------------
FFZ . prototype . _remove _banned = function ( tokens ) {
2016-03-23 19:28:22 -04:00
var banned _words = this . settings . banned _words ;
if ( ! banned _words || ! banned _words . length )
2015-02-24 00:33:29 -05:00
return tokens ;
if ( typeof tokens == "string" )
tokens = [ tokens ] ;
var regex = FFZ . _words _to _regex ( banned _words ) ,
new _tokens = [ ] ;
2015-08-21 19:00:48 -04:00
for ( var i = 0 , l = tokens . length ; i < l ; i ++ ) {
2015-02-24 00:33:29 -05:00
var token = tokens [ i ] ;
2016-03-23 19:28:22 -04:00
if ( typeof token === "string" )
token = { type : "text" , text : token } ;
if ( token . type === "text" && regex . test ( token . text ) ) {
token = token . text . replace ( regex , function ( all , prefix , match ) {
if ( prefix . length )
new _tokens . push ( { type : "text" , text : prefix } ) ;
new _tokens . push ( {
type : "deleted" ,
length : match . length ,
text : match
} ) ;
return "" ;
} ) ;
if ( token )
new _tokens . push ( { type : "text" , text : token } ) ;
} else if ( token . type === "emoticon" && regex . test ( token . altText ) ) {
token = token . altText . replace ( regex , function ( all , prefix , match ) {
if ( prefix . length )
new _tokens . push ( { type : "text" , text : prefix } ) ;
new _tokens . push ( {
type : "deleted" ,
length : match . length ,
text : match
} ) ;
return "" ;
} ) ;
if ( token )
new _tokens . push ( { type : "text" , text : token } ) ;
} else if ( token . type === "link" && regex . test ( token . text ) )
new _tokens . push ( {
type : "link" ,
isDeleted : true ,
isMailTo : token . isMailTo ,
isLong : false ,
length : token . text . length ,
censoredLink : token . text . replace ( regex , "$1***" ) ,
link : token . link ,
text : token . text
} ) ;
else
new _tokens . push ( token ) ;
2015-02-24 00:33:29 -05:00
}
return new _tokens ;
2015-01-20 20:25:26 -05:00
}
2015-01-20 01:53:18 -05:00
// ---------------------
// Emoticon Replacement
// ---------------------
2015-06-05 03:59:28 -04:00
FFZ . prototype . _emoticonize = function ( component , tokens ) {
2015-06-10 18:46:04 -04:00
var room _id = component . get ( "msgObject.room" ) ,
2015-06-05 03:59:28 -04:00
user _id = component . get ( "msgObject.from" ) ;
2015-01-20 01:53:18 -05:00
2015-06-05 03:59:28 -04:00
return this . tokenize _emotes ( user _id , room _id , tokens ) ;
2015-01-12 17:58:07 -05:00
}