2018-04-28 17:56:03 -04:00
< template lang = "html" >
< div class = "ffz--widget ffz--chat-actions tw-border-t tw-pd-y-1" >
< div
v - if = "source && source !== profile"
class = "tw-c-background-accent tw-c-text-overlay tw-pd-1 tw-mg-b-1"
>
< span class = "ffz-i-info" / >
{ { t ( 'setting.warn-inheritence' , 'These values are being overridden by another profile and may not take effect.' ) } }
< / div >
2021-02-22 20:11:35 -05:00
< div
v - if = "(item.warn_icons || (has_icons && item.warn_icons !== false)) && context.mod_icons === false"
class = "tw-c-background-accent tw-c-text-overlay tw-pd-1 tw-mg-b-1"
>
< span class = "ffz-i-info" / >
{ { t ( 'setting.actions.warn-hidden' , 'You currently have Mod Icons turned off in your Twitch chat settings, so some actions might be hidden as a result. Use the settings menu in chat to toggle them.' ) } }
< / div >
2018-04-28 17:56:03 -04:00
< div class = "tw-pd-b-1 tw-border-b tw-mg-b-1" >
2019-08-27 16:18:12 -04:00
< div class = "tw-flex tw-flex-wrap tw-align-items-center ffz--inline" >
2018-04-28 17:56:03 -04:00
{ { t ( 'setting.actions.preview' , 'Preview:' ) } }
2021-02-11 19:40:12 -05:00
< div class = "tw-pd-x-1 ffz-checkbox" >
2018-04-28 17:56:03 -04:00
< input
id = "as_mod"
ref = "as_mod"
: checked = "is_moderator"
type = "checkbox"
2021-02-11 19:40:12 -05:00
class = "ffz-checkbox__input"
2018-04-28 17:56:03 -04:00
@ change = "onPreview"
>
2021-02-11 19:40:12 -05:00
< label for = "as_mod" class = "ffz-checkbox__label" >
2020-02-09 15:10:12 -05:00
< span class = "tw-mg-l-1" >
{ { t ( 'setting.actions.preview.mod' , 'As Moderator' ) } }
< / span >
2018-04-28 17:56:03 -04:00
< / label >
< / div >
2021-02-11 19:40:12 -05:00
< div v-if = "has_msg" class="tw-pd-x-1 ffz-checkbox" >
2018-04-28 17:56:03 -04:00
< input
id = "is_deleted"
ref = "is_deleted"
: checked = "is_deleted"
type = "checkbox"
2021-02-11 19:40:12 -05:00
class = "ffz-checkbox__input"
2018-04-28 17:56:03 -04:00
@ change = "onPreview"
>
2021-02-11 19:40:12 -05:00
< label for = "is_deleted" class = "ffz-checkbox__label" >
2020-02-09 15:10:12 -05:00
< span class = "tw-mg-l-1" >
{ { t ( 'setting.actions.preview.deleted' , 'Deleted Message' ) } }
< / span >
2018-04-28 17:56:03 -04:00
< / label >
< / div >
2021-02-11 19:40:12 -05:00
< div v-if = "has_icons" class="tw-pd-x-1 ffz-checkbox" >
2018-04-28 17:56:03 -04:00
< input
id = "with_mod_icons"
ref = "with_mod_icons"
: checked = "with_mod_icons"
type = "checkbox"
2021-02-11 19:40:12 -05:00
class = "ffz-checkbox__input"
2018-04-28 17:56:03 -04:00
@ change = "onPreview"
>
2021-02-11 19:40:12 -05:00
< label for = "with_mod_icons" class = "ffz-checkbox__label" >
2020-02-09 15:10:12 -05:00
< span class = "tw-mg-l-1" >
{ { t ( 'setting.actions.preview.mod_icons' , 'With Mod Icons' ) } }
< / span >
2018-04-28 17:56:03 -04:00
< / label >
< / div >
2021-02-11 19:40:12 -05:00
< div v-if = "has_mode" class="tw-pd-x-1 ffz-checkbox" >
2019-08-12 22:52:57 -04:00
< input
id = "with_slow"
ref = "with_slow"
: checked = "with_slow"
type = "checkbox"
2021-02-11 19:40:12 -05:00
class = "ffz-checkbox__input"
2019-08-12 22:52:57 -04:00
@ change = "onPreview"
>
2021-02-11 19:40:12 -05:00
< label for = "with_slow" class = "ffz-checkbox__label" >
2020-02-09 15:10:12 -05:00
< span class = "tw-mg-l-1" >
{ { t ( 'setting.actions.preview.slow' , 'Slow Mode' ) } }
< / span >
2019-08-12 22:52:57 -04:00
< / label >
< / div >
2021-02-11 19:40:12 -05:00
< div v-if = "has_mode" class="tw-pd-x-1 ffz-checkbox" >
2019-08-12 22:52:57 -04:00
< input
id = "with_emote"
ref = "with_emote"
: checked = "with_emote"
type = "checkbox"
2021-02-11 19:40:12 -05:00
class = "ffz-checkbox__input"
2019-08-12 22:52:57 -04:00
@ change = "onPreview"
>
2021-02-11 19:40:12 -05:00
< label for = "with_emote" class = "ffz-checkbox__label" >
2020-02-09 15:10:12 -05:00
< span class = "tw-mg-l-1" >
{ { t ( 'setting.actions.preview.emote-only' , 'Emote-Only' ) } }
< / span >
2019-08-12 22:52:57 -04:00
< / label >
< / div >
2021-02-11 19:40:12 -05:00
< div v-if = "has_mode" class="tw-pd-x-1 ffz-checkbox" >
2019-08-12 22:52:57 -04:00
< input
id = "with_subs"
ref = "with_subs"
: checked = "with_subs"
type = "checkbox"
2021-02-11 19:40:12 -05:00
class = "ffz-checkbox__input"
2019-08-12 22:52:57 -04:00
@ change = "onPreview"
>
2021-02-11 19:40:12 -05:00
< label for = "with_subs" class = "ffz-checkbox__label" >
2020-02-09 15:10:12 -05:00
< span class = "tw-mg-l-1" >
{ { t ( 'setting.actions.preview.subs' , 'Subs Only' ) } }
< / span >
2019-08-12 22:52:57 -04:00
< / label >
< / div >
2021-02-11 19:40:12 -05:00
< div v-if = "has_mode" class="tw-pd-x-1 ffz-checkbox" >
2019-08-27 16:18:12 -04:00
< input
id = "with_followers"
ref = "with_followers"
: checked = "with_followers"
type = "checkbox"
2021-02-11 19:40:12 -05:00
class = "ffz-checkbox__input"
2019-08-27 16:18:12 -04:00
@ change = "onPreview"
>
2021-02-11 19:40:12 -05:00
< label for = "with_followers" class = "ffz-checkbox__label" >
2020-02-09 15:10:12 -05:00
< span class = "tw-mg-l-1" >
{ { t ( 'setting.actions.preview.followers' , 'Followers-Only' ) } }
< / span >
2019-08-27 16:18:12 -04:00
< / label >
< / div >
2021-02-11 19:40:12 -05:00
< div v-if = "has_mode" class="tw-pd-x-1 ffz-checkbox" >
2019-08-27 16:18:12 -04:00
< input
id = "with_r9k"
ref = "with_r9k"
: checked = "with_r9k"
type = "checkbox"
2021-02-11 19:40:12 -05:00
class = "ffz-checkbox__input"
2019-08-27 16:18:12 -04:00
@ change = "onPreview"
>
2021-02-11 19:40:12 -05:00
< label for = "with_r9k" class = "ffz-checkbox__label" >
2020-02-09 15:10:12 -05:00
< span class = "tw-mg-l-1" >
{ { t ( 'setting.actions.preview.r9k' , 'R9k Mode' ) } }
< / span >
2019-08-27 16:18:12 -04:00
< / label >
< / div >
2021-02-11 19:40:12 -05:00
< div class = "tw-pd-x-1 ffz-checkbox" >
2018-04-28 17:56:03 -04:00
< input
id = "show_all"
ref = "show_all"
: checked = "show_all"
type = "checkbox"
2021-02-11 19:40:12 -05:00
class = "ffz-checkbox__input"
2018-04-28 17:56:03 -04:00
@ change = "onPreview"
>
2021-02-11 19:40:12 -05:00
< label for = "show_all" class = "ffz-checkbox__label" >
2020-02-09 15:10:12 -05:00
< span class = "tw-mg-l-1" >
{ { t ( 'setting.actions.preview.all' , 'Show All' ) } }
< / span >
2018-04-28 17:56:03 -04:00
< / label >
< / div >
< / div >
< div
: data - user = "JSON.stringify(sample_user)"
: data - room = "JSON.stringify(sample_room)"
2019-05-07 15:04:12 -04:00
: data - message = "JSON.stringify(sample_message)"
2018-07-13 14:32:12 -04:00
class = "ffz-action-data tw-pd-t-1"
2018-04-28 17:56:03 -04:00
data - msg - id = "1234-5678"
>
< div
v - if = "! display.length"
2018-07-13 14:32:12 -04:00
class = "tw-align-center tw-c-text-alt-2 tw-pd-05 tw-font-size-4"
2018-04-28 17:56:03 -04:00
>
{ { t ( 'setting.actions.no-visible' , 'no visible actions' ) } }
< / div >
2018-07-13 14:32:12 -04:00
< div
v - for = "(actions, idx) in display"
: key = "idx"
class = "tw-flex tw-align-items-center tw-justify-content-center"
>
< action-preview
v - for = "act in actions"
: key = "act.id"
: act = "act.v"
: color = "color(act.v.appearance.color)"
: renderers = "data.renderers"
tooltip = "true"
pad = "true"
/ >
< / div >
2018-04-28 17:56:03 -04:00
< / div >
< / div >
< div class = "tw-flex tw-align-items-center tw-pd-b-05" >
< div class = "tw-flex-grow-1" >
{ { t ( 'setting.actions.drag' , 'Drag actions to re-order them.' ) } }
< / div >
< div
2019-08-09 14:24:26 -04:00
v - if = "! maybe_clear"
2018-04-28 17:56:03 -04:00
v - on - clickaway = "closeAdd"
class = "tw-relative"
>
< button
class = "tw-mg-l-1 tw-button tw-button--text"
@ click = "toggleAdd"
>
< span class = "tw-button__text ffz-i-plus" >
{ { t ( 'setting.actions.new' , 'New...' ) } }
< / span >
< span class = "tw-button__icon tw-button__icon--right" >
< figure class = "ffz-i-down-dir" / >
< / span >
< / button >
< balloon
v - if = "add_open"
color = "background-alt-2"
dir = "down-right"
2020-05-27 15:44:37 -04:00
: size = "add_pasting ? 'md' : 'sm'"
2018-04-28 17:56:03 -04:00
>
2019-08-09 14:24:26 -04:00
< simplebar classes = "ffz-mh-30" >
2020-05-27 15:44:37 -04:00
< div v-if = "add_pasting" class="tw-pd-1" >
< div class = "tw-flex tw-align-items-center" >
< input
ref = "paste"
: placeholder = "t('setting.paste-json.json', '[json]')"
2021-02-11 19:40:12 -05:00
class = "tw-flex-grow-1 tw-border-radius-medium tw-font-size-6 tw-pd-x-1 tw-pd-y-05 ffz-input"
2020-05-27 15:44:37 -04:00
@ keydown . enter = "addFromJSON"
>
< button
class = "tw-mg-l-05 tw-button"
@ click = "addFromJSON"
>
< span class = "tw-button__text ffz-i-plus" >
{ { t ( 'setting.add' , 'Add' ) } }
< / span >
< / button >
< / div >
< / div >
< div v -else class = "tw-pd-y-1" >
< button
2021-02-11 19:40:12 -05:00
class = "ffz-interactable ffz-interactable--hover-enabled ffz-interactable--default tw-interactive tw-full-width"
2020-05-27 15:44:37 -04:00
@ click = "add_pasting = true"
>
< div class = "tw-flex tw-align-items-center tw-pd-y-05 tw-pd-x-1" >
< div class = "tw-flex-grow-1 tw-mg-r-1" >
{ { t ( 'setting.paste-json' , 'Paste JSON' ) } }
< / div >
< / div >
< / button >
2018-04-28 17:56:03 -04:00
< template v-for = "(preset, idx) in presets" >
< div
v - if = "preset.divider"
: key = "idx"
class = "tw-mg-1 tw-border-b"
/ >
< button
v - else
: key = "idx"
: disabled = "preset.disabled"
2021-02-11 19:40:12 -05:00
class = "ffz-interactable ffz-interactable--hover-enabled ffz-interactable--default tw-interactive tw-full-width"
2018-04-28 17:56:03 -04:00
@ click = "add(preset.value)"
>
< div class = "tw-flex tw-align-items-center tw-pd-y-05 tw-pd-x-1" >
< div class = "tw-flex-grow-1 tw-mg-r-1" >
2019-08-06 15:39:45 -04:00
{ { preset . title _i18n ? t ( preset . title _i18n , preset . title , preset ) : preset . title } }
2018-04-28 17:56:03 -04:00
< / div >
< action-preview v-if = "preset.appearance" :act="preset" :renderers="data.renderers" / >
< / div >
< / button >
< / template >
< / div >
< / simplebar >
< / balloon >
< / div >
< button
2019-08-09 14:24:26 -04:00
v - if = "! maybe_clear && val.length"
2020-12-17 16:51:26 -05:00
class = "tw-mg-l-1 tw-button tw-button--text tw-tooltip__container"
2019-08-09 14:24:26 -04:00
@ click = "maybe_clear = true"
2018-04-28 17:56:03 -04:00
>
< span class = "tw-button__text ffz-i-trash" >
{ { t ( 'setting.delete-all' , 'Delete All' ) } }
< / span >
< span class = "tw-tooltip tw-tooltip--down tw-tooltip--align-right" >
{ { t ( 'setting.actions.delete-all' , "Delete all of this profile's actions." ) } }
< / span >
< / button >
2019-08-09 14:24:26 -04:00
< button
v - if = "maybe_clear"
2020-12-17 16:51:26 -05:00
class = "tw-mg-l-1 tw-button tw-button--text tw-tooltip__container"
2019-08-09 14:24:26 -04:00
@ click = "doClear"
>
< span class = "tw-button__text ffz-i-trash" >
{ { t ( 'setting.delete-all' , 'Delete All' ) } }
< / span >
< span class = "tw-tooltip tw-tooltip--down tw-tooltip--align-right" >
{ { t ( 'setting.actions.delete-all' , "Delete all of this profile's actions." ) } }
< / span >
< / button >
< button
v - if = "maybe_clear"
2020-12-17 16:51:26 -05:00
class = "tw-mg-l-1 tw-button tw-button--text tw-tooltip__container"
2019-08-09 14:24:26 -04:00
@ click = "maybe_clear = false"
>
< span class = "tw-button__text ffz-i-cancel" >
{ { t ( 'setting.cancel' , 'Cancel' ) } }
< / span >
< / button >
2018-04-28 17:56:03 -04:00
< button
2019-05-07 15:04:12 -04:00
v - if = "! val.length && has_default"
2020-12-17 16:51:26 -05:00
class = "tw-mg-l-1 tw-button tw-button--text tw-tooltip__container"
2018-04-28 17:56:03 -04:00
@ click = "populate"
>
< span class = "tw-button__text ffz-i-trash" >
{ { t ( 'setting.actions.add-default' , 'Add Defaults' ) } }
< / span >
< span class = "tw-tooltip tw-tooltip--down tw-tooltip--align-right" >
{ { t ( 'setting.actions.add-default-tip' , 'Add all of the default actions to this profile.' ) } }
< / span >
< / button >
< / div >
< div ref = "list" class = "ffz--action-list" >
< div v-if = "! val.length" class="tw-c-text-alt-2 tw-font-size-4 tw-align-center tw-c-text-alt-2 tw-pd-1" >
{ { t ( 'setting.actions.no-actions' , 'no actions are defined in this profile' ) } }
< / div >
< section v-for = "act in val" :key="act.id" >
< action-editor
: action = "act"
: data = "data"
: inline = "item.inline"
2019-08-06 15:39:45 -04:00
: mod _icons = "has_icons"
2019-05-07 15:04:12 -04:00
: context = "item.context"
2019-05-16 14:46:26 -04:00
: modifiers = "item.modifiers"
2018-04-28 17:56:03 -04:00
@ remove = "remove(act)"
@ save = "save(act, $event)"
/ >
< / section >
< / div >
< / div >
< / template >
< script >
import SettingMixin from '../setting-mixin' ;
import Sortable from 'sortablejs' ;
import { deep _copy } from 'utilities/object' ;
let last _id = 0 ;
export default {
2019-06-09 19:48:26 -04:00
mixins : [ SettingMixin ] ,
2018-04-28 17:56:03 -04:00
props : [ 'item' , 'context' ] ,
data ( ) {
return {
is _moderator : true ,
with _mod _icons : true ,
2019-08-12 22:52:57 -04:00
with _emote : false ,
with _subs : false ,
with _slow : false ,
2019-08-27 16:18:12 -04:00
with _followers : false ,
with _r9k : false ,
2019-08-12 22:52:57 -04:00
2018-04-28 17:56:03 -04:00
is _staff : false ,
is _deleted : false ,
show _all : false ,
2019-08-09 14:24:26 -04:00
maybe _clear : false ,
2018-04-28 17:56:03 -04:00
add _open : false ,
2020-05-27 15:44:37 -04:00
add _pasting : false
2018-04-28 17:56:03 -04:00
}
} ,
computed : {
hasInheritance ( ) {
for ( const val of this . val )
if ( val . t === 'inherit' )
return true ;
2019-06-20 15:15:54 -04:00
return false ;
2018-04-28 17:56:03 -04:00
} ,
2019-05-07 15:04:12 -04:00
sample _user ( ) {
return this . has _user ? {
displayName : 'SirStendec' ,
login : 'sirstendec' ,
id : 49399878 ,
color : '#008000'
} : null
} ,
sample _room ( ) {
return this . has _room ? {
displayName : 'FrankerFaceZ' ,
login : 'frankerfacez' ,
id : 46622312
} : null
} ,
sample _message ( ) {
return this . has _msg ? {
id : '46a473ee-a3c4-4556-a5ca-c0f1eac93ec0' ,
text : 'sirstendec: Please do not do that.'
} : null
} ,
2019-08-06 15:39:45 -04:00
has _icons ( ) {
return this . item . mod _icons || this . item . inline
} ,
2019-05-07 15:04:12 -04:00
has _default ( ) {
return this . default _value && this . default _value . length
} ,
has _user ( ) {
return this . item . context && this . item . context . includes ( 'user' )
} ,
has _room ( ) {
return this . item . context && this . item . context . includes ( 'room' )
} ,
2019-08-12 22:52:57 -04:00
has _mode ( ) {
return this . item . context && this . item . context . includes ( 'room-mode' )
} ,
2019-05-07 15:04:12 -04:00
has _msg ( ) {
return this . item . context && this . item . context . includes ( 'message' )
} ,
2018-04-28 17:56:03 -04:00
presets ( ) {
2018-07-19 22:03:01 -04:00
const out = [ ] ,
contexts = this . item . context || [ ] ;
2018-04-28 17:56:03 -04:00
out . push ( {
disabled : this . hasInheritance ,
title : 'Inheritance Point' ,
title _i18n : 'setting.inheritance' ,
value : { t : 'inherit' }
} ) ;
if ( ! this . item . inline ) {
out . push ( {
title : 'New Line' ,
value : {
v : { type : 'new-line' }
}
} ) ;
out . push ( {
title : 'Space (Small)' ,
value : {
v : { type : 'space-small' }
}
} ) ;
out . push ( {
title : 'Space (Expanding)' ,
value : {
v : { type : 'space' }
}
} ) ;
}
out . push ( { divider : true } ) ;
for ( const key in this . data . actions ) { // eslint-disable-line guard-for-in
const act = this . data . actions [ key ] ;
2018-07-19 22:03:01 -04:00
if ( act && act . presets ) {
if ( act . required _context ) {
let okay = true ;
for ( const ctx of act . required _context )
if ( ! contexts . includes ( ctx ) ) {
okay = false ;
break ;
}
if ( ! okay )
continue ;
}
2018-04-28 17:56:03 -04:00
for ( const preset of act . presets ) {
if ( typeof act . title !== 'string' && ! preset . title )
continue ;
out . push ( Object . assign ( {
action : key ,
title : act . title ,
title _i18n : act . title _i18n || ` chat.actions. ${ key } ` ,
value : {
v : Object . assign ( {
action : key
} , preset )
}
} , preset ) ) ;
}
2018-07-19 22:03:01 -04:00
}
2018-04-28 17:56:03 -04:00
}
return out ;
} ,
display ( ) {
const out = [ ] ;
2018-07-13 14:32:12 -04:00
let current = [ ] ;
2018-04-28 17:56:03 -04:00
if ( this . val )
for ( const val of this . val ) {
2018-07-13 14:32:12 -04:00
if ( ! val . v )
continue ;
const type = val . v . type ;
if ( type === 'new-line' ) {
out . push ( current ) ;
current = [ ] ;
} else if ( this . displayAction ( val . v ) )
current . push ( val ) ;
2018-04-28 17:56:03 -04:00
}
2018-07-13 14:32:12 -04:00
if ( current . length )
out . push ( current ) ;
2018-04-28 17:56:03 -04:00
return out ;
} ,
val ( ) {
if ( ! this . has _value )
return [ ] ;
return this . value . map ( x => {
x . id = x . id || ` ${ Date . now ( ) } - ${ Math . random ( ) } - ${ last _id ++ } ` ;
return x ;
} ) ;
}
} ,
mounted ( ) {
this . _sortable = Sortable . create ( this . $refs . list , {
draggable : 'section' ,
filter : 'button' ,
onUpdate : event => {
if ( event . newIndex === event . oldIndex )
return ;
const new _val = Array . from ( this . val ) ;
new _val . splice ( event . newIndex , 0 , ... new _val . splice ( event . oldIndex , 1 ) ) ;
this . set ( new _val ) ;
}
} ) ;
} ,
beforeDestroy ( ) {
if ( this . _sortable )
this . _sortable . destroy ( ) ;
this . _sortable = null ;
} ,
methods : {
2019-08-09 14:24:26 -04:00
doClear ( ) {
this . maybe _clear = false ;
this . clear ( ) ;
} ,
2018-04-28 17:56:03 -04:00
closeAdd ( ) {
this . add _open = false ;
2020-05-27 15:44:37 -04:00
this . add _pasting = false ;
2018-04-28 17:56:03 -04:00
} ,
toggleAdd ( ) {
this . add _open = ! this . add _open ;
2020-05-27 15:44:37 -04:00
this . add _pasting = false ;
} ,
addFromJSON ( ) {
let value = this . $refs . paste . value ;
this . closeAdd ( ) ;
if ( value ) {
try {
value = JSON . parse ( value ) ;
} catch ( err ) {
alert ( err ) ; // eslint-disable-line no-alert
return ;
}
if ( ! value . appearance )
value . appearance = { } ;
if ( ! value . appearance . type )
value . appearance . type = 'text' ;
if ( value . appearance . type === 'text' && ! value . appearance . text )
value . appearance . text = 'C' ;
if ( value . appearance . type === 'icon' && ! value . appearance . icon )
value . appearance . icon = 'ffz-i-ok' ;
if ( ! value . display )
value . display = { } ;
if ( ! value . action )
value . action = 'chat' ;
this . add ( { v : value } ) ;
}
2018-04-28 17:56:03 -04:00
} ,
populate ( ) {
this . set ( deep _copy ( this . default _value ) ) ;
} ,
add ( val ) {
const vals = Array . from ( this . val ) ;
vals . push ( val ) ;
this . set ( deep _copy ( vals ) ) ;
this . add _open = false ;
} ,
remove ( val ) {
const vals = Array . from ( this . val ) ,
idx = vals . indexOf ( val ) ;
if ( idx !== - 1 ) {
vals . splice ( idx , 1 ) ;
if ( vals . length )
this . set ( vals ) ;
else
this . clear ( ) ;
}
} ,
save ( val , new _val ) {
val . v = new _val ;
this . set ( deep _copy ( this . val ) ) ;
} ,
onPreview ( ) {
this . show _all = this . $refs . show _all . checked ;
this . is _moderator = this . $refs . as _mod . checked ;
this . is _staff = false ; //this.$refs.as_staff.checked;
2019-08-06 15:39:45 -04:00
this . with _mod _icons = this . has _icons && this . $refs . with _mod _icons . checked ;
2019-05-08 22:47:38 -04:00
this . is _deleted = this . has _msg && this . $refs . is _deleted . checked ;
2019-08-12 22:52:57 -04:00
this . with _emote = this . has _mode && this . $refs . with _emote . checked ;
this . with _subs = this . has _mode && this . $refs . with _subs . checked ;
this . with _slow = this . has _mode && this . $refs . with _slow . checked ;
2019-08-27 16:18:12 -04:00
this . with _followers = this . has _mode && this . $refs . with _followers . checked ;
this . with _r9k = this . has _mode && this . $refs . with _r9k . checked ;
2018-04-28 17:56:03 -04:00
} ,
displayAction ( action ) {
if ( ! action . appearance )
return false ;
const disp = action . display ;
if ( ! disp || this . show _all )
return true ;
if ( disp . disable )
return false ;
if ( disp . mod != null && disp . mod !== this . is _moderator )
return false ;
2018-05-10 19:56:39 -04:00
if ( disp . mod _icons != null && disp . mod _icons !== this . with _mod _icons )
2018-04-28 17:56:03 -04:00
return false ;
2018-05-10 19:56:39 -04:00
if ( disp . staff != null && disp . staff !== this . is _staff )
2018-04-28 17:56:03 -04:00
return false ;
if ( disp . deleted != null && disp . deleted !== this . is _deleted )
return false ;
2019-08-12 22:52:57 -04:00
if ( this . has _mode ) {
if ( disp . emoteOnly != null && disp . emoteOnly !== this . with _emote )
return false ;
if ( disp . slowMode != null && disp . slowMode !== this . with _slow )
return false ;
if ( disp . subsMode != null && disp . subsMode !== this . with _subs )
return false ;
2019-08-27 16:18:12 -04:00
if ( disp . r9kMode != null && disp . r9kMode !== this . with _r9k )
return false ;
if ( disp . followersOnly != null && disp . followersOnly !== this . with _followers )
return false ;
2019-08-12 22:52:57 -04:00
}
2018-04-28 17:56:03 -04:00
return true ;
} ,
color ( input ) {
if ( ! input )
return input ;
return this . data . color ( input )
}
}
}
< / script >