diff --git a/package-lock.json b/package-lock.json index 07976f6..bc87a5b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "Blink", - "version": "1.2.4", + "version": "1.2.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 3e28198..c23c965 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Blink", - "version": "1.2.4", + "version": "1.2.5", "description": "Blink", "license": "GPL-3.0", "main": "main.js", diff --git a/src/app/chat.service.ts b/src/app/chat.service.ts index 488e1e0..66706ff 100644 --- a/src/app/chat.service.ts +++ b/src/app/chat.service.ts @@ -18,7 +18,7 @@ import { MessagesComponent } from './messages/messages.component'; -import { WebApiService as WebApiService } from './web-api.service'; +import { FfzBttvService } from './ffz-bttv.service'; import { SettingsService } from './settings.service'; import { ElectronService } from './electron.service'; import { Message } from './message'; @@ -195,7 +195,7 @@ export class ChatService { } private updateFFZ() { - WebApiService.getFfzEmotes(this.channel).then(emotes => { + FfzBttvService.getFfzEmotes(this.channel).then(emotes => { this.emotes.ffz.channel = emotes[0]; this.emotes.ffz.global = emotes[1]; this.emotes.ffz.lookup = emotes.flat().reduce((obj, item) => { @@ -209,7 +209,7 @@ export class ChatService { } private updateBTTV() { - WebApiService.getBttvEmotes(this.channel).then(emotes => { + FfzBttvService.getBttvEmotes(this.channel).then(emotes => { this.emotes.bttv.channel = emotes[0]; this.emotes.bttv.global = emotes[1]; this.emotes.bttv.lookup = emotes.flat().reduce((obj, item) => { diff --git a/src/app/emote-menu/emote-menu.component.ts b/src/app/emote-menu/emote-menu.component.ts index 3b2ad3e..fd283a1 100644 --- a/src/app/emote-menu/emote-menu.component.ts +++ b/src/app/emote-menu/emote-menu.component.ts @@ -1,3 +1,20 @@ +/* + Blink, a chat client for Twitch + Copyright (C) 2019 cairthenn + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ import { Component, OnInit, Input } from '@angular/core'; @Component({ diff --git a/src/app/web-api.service.ts b/src/app/ffz-bttv.service.ts similarity index 99% rename from src/app/web-api.service.ts rename to src/app/ffz-bttv.service.ts index 4547aff..5bcceb6 100644 --- a/src/app/web-api.service.ts +++ b/src/app/ffz-bttv.service.ts @@ -23,12 +23,11 @@ const bttvChannelUrl = 'https://api.betterttv.net/2/channels/'; const ffzGlobalUrl = 'https://api.frankerfacez.com/v1/set/global'; const ffzChannelUrl = 'https://api.frankerfacez.com/v1/room/'; -export class WebApiService { +export class FfzBttvService { public static ffz: any = {}; public static bttv: any = {}; - public static getBttvGlobal(update: boolean = false) { return !update && this.bttv._global || Web.get(bttvGlobalUrl).then(global => { return this.bttv._global = global.emotes; diff --git a/src/app/messages/messages.component.ts b/src/app/messages/messages.component.ts index c9ae07c..09a913b 100644 --- a/src/app/messages/messages.component.ts +++ b/src/app/messages/messages.component.ts @@ -101,7 +101,7 @@ export class MessagesComponent implements OnInit, AfterViewInit, OnDestroy { } public openUserCard(name: string, event: MouseEvent) { - event.stopPropagation(); + this.closeUserCard(event); this.service.twitch.getChannel(name).then(channel => { const overhang = event.offsetX + this.userCard.width - this.el.nativeElement.clientWidth; this.userCard.left = overhang > 0 ? event.offsetX - overhang : event.offsetX; diff --git a/src/app/settings.service.ts b/src/app/settings.service.ts index 1519319..cb493fd 100644 --- a/src/app/settings.service.ts +++ b/src/app/settings.service.ts @@ -103,34 +103,34 @@ export class SettingsService { public load() { const settings = ElectronService.settings; - this.drawer = settings.get('drawer'); - this.lightTheme = settings.get('lightTheme'); + if(settings.has('drawer')) { this.drawer = settings.get('drawer'); } + if(settings.has('lightTheme')) { this.lightTheme = settings.get('lightTheme'); } this.lightThemeView = this.lightTheme; - this.alternate = settings.get('alternate'); - this.separators = settings.get('separators'); - this.flash = settings.get('flash'); - this.timestamps = settings.get('timestamps'); - this.modIcons = settings.get('modIcons'); - this.banIcon = settings.get('banIcon'); - this.purgeIcon = settings.get('purgeIcon'); - this.timeoutIcon = settings.get('timeoutIcon'); - this.deleteIcon = settings.get('deleteIcon'); - this.timeoutTime = settings.get('timeoutTime'); - this.subs = settings.get('subs'); - this.bits = settings.get('bits'); - this.badges = settings.get('badges'); - this.twitchEmotes = settings.get('twitchEmotes'); - this.bttvEmotes = settings.get('bttvEmotes'); - this.ffzEmotes = settings.get('ffzEmotes'); - this.duplicates = settings.get('duplicates'); - this.emotePriority = settings.get('emotePriority'); - this.anonymous = settings.get('anonymous'); - this.maxHistory = settings.get('maxHistory'); - this.highlightName = settings.get('highlightName'); - this.highlight = settings.get('highlight'); - this.blacklist = settings.get('blacklist'); - this.friends = settings.get('friends'); - this.ignored = settings.get('ignored'); + if(settings.has('alternate')) { this.alternate = settings.get('alternate'); } + if(settings.has('separators')) { this.separators = settings.get('separators'); } + if(settings.has('flash')) { this.flash = settings.get('flash'); } + if(settings.has('timestamps')) { this.timestamps = settings.get('timestamps'); } + if(settings.has('modIcons')) { this.modIcons = settings.get('modIcons'); } + if(settings.has('banIcon')) { this.banIcon = settings.get('banIcon'); } + if(settings.has('purgeIcon')) { this.purgeIcon = settings.get('purgeIcon'); } + if(settings.has('timeoutIcon')) { this.timeoutIcon = settings.get('timeoutIcon'); } + if(settings.has('deleteIcon')) { this.deleteIcon = settings.get('deleteIcon'); } + if(settings.has('timeoutTime')) { this.timeoutTime = settings.get('timeoutTime'); } + if(settings.has('subs')) { this.subs = settings.get('subs'); } + if(settings.has('bits')) { this.bits = settings.get('bits'); } + if(settings.has('badges')) { this.badges = settings.get('badges'); } + if(settings.has('twitchEmotes')) { this.twitchEmotes = settings.get('twitchEmotes'); } + if(settings.has('bttvEmotes')) { this.bttvEmotes = settings.get('bttvEmotes'); } + if(settings.has('ffzEmotes')) { this.ffzEmotes = settings.get('ffzEmotes'); } + if(settings.has('duplicates')) { this.duplicates = settings.get('duplicates'); } + if(settings.has('emotePriority')) { this.emotePriority = settings.get('emotePriority'); } + if(settings.has('anonymous')) { this.anonymous = settings.get('anonymous'); } + if(settings.has('maxHistory')) { this.maxHistory = settings.get('maxHistory'); } + if(settings.has('highlightName')) { this.highlightName = settings.get('highlightName'); } + if(settings.has('highlight')) { this.highlight = settings.get('highlight'); } + if(settings.has('blacklist')) { this.blacklist = settings.get('blacklist'); } + if(settings.has('friends')) { this.friends = settings.get('friends'); } + if(settings.has('ignored')) { this.ignored = settings.get('ignored'); } } save() { diff --git a/src/assets/emoji/LICENSE b/src/assets/emoji/LICENSE new file mode 100644 index 0000000..1aa7624 --- /dev/null +++ b/src/assets/emoji/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2018 Twitter, Inc and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE.