diff --git a/package.json b/package.json index 3973a186..d7a4749e 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "frankerfacez", "author": "Dan Salvato LLC", - "version": "4.18.5", + "version": "4.18.6", "description": "FrankerFaceZ is a Twitch enhancement suite.", "license": "Apache-2.0", "scripts": { diff --git a/src/modules/main_menu/components/profile-editor.vue b/src/modules/main_menu/components/profile-editor.vue index ba385d65..09bdf89d 100644 --- a/src/modules/main_menu/components/profile-editor.vue +++ b/src/modules/main_menu/components/profile-editor.vue @@ -122,7 +122,7 @@
{{ t('setting.data_management.profiles.edit.rules.description', - 'Rules allows you to define a series of conditions under which this profile will be active.') + 'Rules allows you to define a series of conditions under which this profile will be active. When there are multiple rules, they must all match for the profile to activate. Please use an `Or` rule to create a profile that activates by matching one of several rules.') }}
diff --git a/src/modules/main_menu/components/socket-info.vue b/src/modules/main_menu/components/socket-info.vue new file mode 100644 index 00000000..e769342a --- /dev/null +++ b/src/modules/main_menu/components/socket-info.vue @@ -0,0 +1,339 @@ + + + \ No newline at end of file diff --git a/src/socket.js b/src/socket.js index 4edd8156..4a271438 100644 --- a/src/socket.js +++ b/src/socket.js @@ -25,6 +25,15 @@ export default class SocketClient extends Module { this.inject('settings'); + this.settings.addUI('socket.info', { + path: 'Debugging > Socket >> Info @{"sort": -1000}', + force_seen: true, + no_filter: true, + component: 'socket-info', + + getSocket: () => this, + }); + this.settings.add('socket.use-cluster', { default: 'Production', @@ -412,6 +421,7 @@ export default class SocketClient extends Module { this._socket = null; this._state = State.DISCONNECTED; + this.emit(':disconnected'); } @@ -445,6 +455,8 @@ export default class SocketClient extends Module { this.log.warn('Local time differs from server time by more than 5 minutes.'); } } + + this.emit(':pong'); } @@ -476,6 +488,8 @@ export default class SocketClient extends Module { send(command, ...args) { if ( args.length === 1 ) args = args[0]; + else if ( ! args.length ) + args = undefined; if ( ! this.connected ) this._pending.push([command, args]); @@ -487,6 +501,8 @@ export default class SocketClient extends Module { call(command, ...args) { if ( args.length === 1 ) args = args[0]; + else if ( ! args.length ) + args = undefined; return new Promise((resolve, reject) => { if ( ! this.connected ) @@ -503,22 +519,28 @@ export default class SocketClient extends Module { subscribe(referrer, ...topics) { const t = this._topics; + let changed = false; for(const topic of topics) { if ( ! t.has(topic) ) { if ( this.connected ) this._send('sub', topic); t.set(topic, new Set); + changed = true; } const tp = t.get(topic); tp.add(referrer); } + + if ( changed ) + this.emit(':sub-change'); } unsubscribe(referrer, ...topics) { const t = this._topics; + let changed = false; for(const topic of topics) { if ( ! t.has(topic) ) continue; @@ -527,11 +549,15 @@ export default class SocketClient extends Module { tp.delete(referrer); if ( ! tp.size ) { + changed = true; t.delete(topic); if ( this.connected ) this._send('unsub', topic); } } + + if ( changed ) + this.emit(':sub-change'); } diff --git a/src/utilities/vue.js b/src/utilities/vue.js index 08877d92..887f994c 100644 --- a/src/utilities/vue.js +++ b/src/utilities/vue.js @@ -82,6 +82,26 @@ export class Vue extends Module { }, methods: { + tNumber_(val, format) { + this.locale; + return t.i18n.formatNumber(val, format); + }, + + tDate_(val, format) { + this.locale; + return t.i18n.formatDate(val, format); + }, + + tTime_(val, format) { + this.locale; + return t.i18n.formatTime(val, format); + }, + + tDateTime_(val, format) { + this.locale; + return t.i18n.formatDateTime(val, format); + }, + t_(key, phrase, options) { this.locale && this.phrases[key]; return t.i18n.t(key, phrase, options); @@ -182,6 +202,18 @@ export class Vue extends Module { }, tNode(node, data) { return this.$i18n.tNode_(node, data); + }, + tNumber(val, format) { + return this.$i18n.tNumber_(val, format); + }, + tDate(val, format) { + return this.$i18n.tDate_(val, format); + }, + tTime(val, format) { + return this.$i18n.tTime_(val, format); + }, + tDateTime(val, format) { + return this.$i18n.tDateTime_(val, format); } } }); diff --git a/styles/widgets.scss b/styles/widgets.scss index f76b47f5..5396dbab 100644 --- a/styles/widgets.scss +++ b/styles/widgets.scss @@ -206,6 +206,11 @@ textarea.tw-input { } +.ffz--cursor { + cursor: pointer; +} + + .ffz--home { h2, p { margin-bottom: 1rem;