Skip to content
This repository was archived by the owner on Jun 25, 2020. It is now read-only.

Commit e6889b0

Browse files
committed
add option to disable emote autocomplete
1 parent d567fb1 commit e6889b0

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

src/injected-content/mixrelixr.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,8 +1242,6 @@ $(() => {
12421242
return;
12431243
}
12441244

1245-
1246-
12471245
messageContainer.attr('elixrfied', 'true');
12481246

12491247
// Give chat messages a chat message class for easier targeting.

src/injected-content/vue-apps/emote-autocomplete/emote-autocomplete-binder.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,24 @@ import Vue from "vue";
22
import AutocompleteApp from "./emote-autocomplete";
33
import { waitForElementAvailablity, debounce } from "../../utils";
44

5+
56
let app = null;
67
export function bindEmoteAutocompleteApp(options, globalEmotesCache, channelEmotesCache, currentStreamerId) {
78

8-
//remove previous
9+
//clean up any previous
910
if ($("#me-emote-autocomplete").length > 0) {
1011
$("#me-emote-autocomplete").remove();
1112
}
1213

14+
let keyupListenerFunc = debounce(keyupListener, 100);
15+
16+
$("#chat-input").children("textarea").off("keyup", keyupListenerFunc);
17+
$("#chat-input").children("textarea").off("keydown", keydownListenerFunc);
18+
19+
if (options.enableEmoteAutocomplete === false) {
20+
return;
21+
}
22+
1323
let showGlobalEmotes =
1424
options.customEmotes !== false &&
1525
options.globalEmotes !== false &&
@@ -54,13 +64,9 @@ export function bindEmoteAutocompleteApp(options, globalEmotesCache, channelEmot
5464

5565
child.currentStreamerId = currentStreamerId;
5666

57-
let keyupListenerFunc = debounce(keyupListener, 100);
5867
let keydownListenerFunc = keydownListener;
5968

60-
$("#chat-input").children("textarea").off("keyup", keyupListenerFunc);
6169
$("#chat-input").children("textarea").on("keyup", keyupListenerFunc);
62-
63-
$("#chat-input").children("textarea").off("keydown", keydownListenerFunc);
6470
$("#chat-input").children("textarea").on("keydown", keydownListenerFunc);
6571

6672
const chatSendBtnListener = function() {

src/popup/components/streamerPageOptions.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<div v-show="customEmotes" class="option-wrapper suboption">
2424
<checkbox-toggle :value.sync="globalEmotes" label="Enable Global Emotes" @changed="saveSettings()" tooltip="Global emotes are a set of emotes curated by the MixrElixr team that are available in all channels."></checkbox-toggle>
2525
<checkbox-toggle :value.sync="channelEmotes" label="Enable Channel Emotes" @changed="saveSettings()" tooltip="Channel emotes are set by the channel owner and reviewed by the MixrElixr team. They are only available in the given channel."></checkbox-toggle>
26+
<checkbox-toggle :value.sync="enableEmoteAutocomplete" label="Enable Emote Autocomplete Menu" @changed="saveSettings()" tooltip="Enables the emote autocomplete menu when typing in the chat textbox."></checkbox-toggle>
2627
</div>
2728

2829
<span class="setting-subcategory">Chat</span>

src/popup/mixins/settingsStorage.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ global.settingsStorage = {
7070
customEmotes: true,
7171
globalEmotes: true,
7272
channelEmotes: true,
73+
enableEmoteAutocomplete: true,
7374
hideChatAvatars: false,
7475
hideChannelProgression: false,
7576
hideChatHeaders: false,

0 commit comments

Comments
 (0)