From 51d8ba1680b6f38c8a03a2547e1410b2b8879eae Mon Sep 17 00:00:00 2001 From: MayaWolf Date: Tue, 17 Oct 2017 01:58:57 +0200 Subject: [PATCH] 0.2.1 - Open beta --- chat/CharacterSearch.vue | 57 ++++++++++++--- chat/Chat.vue | 7 +- chat/ChatView.vue | 6 ++ chat/ConversationView.vue | 29 ++++---- chat/UserMenu.vue | 29 +++++--- chat/common.ts | 3 +- chat/conversations.ts | 9 ++- chat/localize.ts | 3 + components/FilterableSelect.vue | 5 ++ cordova/Index.vue | 20 ++++-- cordova/chat.ts | 2 +- cordova/package.json | 2 +- cordova/webpack.config.js | 5 +- electron/Index.vue | 12 ++-- electron/application.json | 2 +- electron/build/tray.png | Bin 0 -> 2587 bytes electron/chat.ts | 20 ++++-- electron/common.ts | 4 +- electron/package.json | 2 +- electron/webpack.config.js | 5 +- electron/window_state.ts | 4 +- fchat/channels.ts | 43 +++++------ fchat/connection.ts | 6 +- fchat/interfaces.ts | 2 +- less/themes/chat/default.less | 20 +++--- less/themes/chat/light.less | 2 +- less/themes/variables/dark.less | 21 +++--- less/themes/variables/default.less | 112 ++++++++++++++++++++++++++++- less/themes/variables/light.less | 3 +- 29 files changed, 313 insertions(+), 122 deletions(-) create mode 100644 electron/build/tray.png diff --git a/chat/CharacterSearch.vue b/chat/CharacterSearch.vue index 8adc553..d5ee622 100644 --- a/chat/CharacterSearch.vue +++ b/chat/CharacterSearch.vue @@ -12,10 +12,15 @@
{{l('characterSearch.kinkNotice')}}
-
-
{{l('characterSearch.results')}}
-
- +
+

{{l('characterSearch.results')}}

+
+ +
@@ -27,6 +32,8 @@ import CustomDialog from '../components/custom_dialog'; import FilterableSelect from '../components/FilterableSelect.vue'; import Modal from '../components/Modal.vue'; + import {BBCodeView} from './bbcode'; + import {characterImage} from './common'; import core from './core'; import {Character, Connection} from './interfaces'; import l from './localize'; @@ -41,8 +48,16 @@ type Kink = {id: number, name: string, description: string}; + function sort(x: Character, y: Character): number { + if(x.status === 'looking' && y.status !== 'looking') return -1; + if(x.status !== 'looking' && y.status === 'looking') return 1; + if(x.name < y.name) return -1; + if(x.name > y.name) return 1; + return 0; + } + @Component({ - components: {modal: Modal, user: UserView, 'filterable-select': FilterableSelect} + components: {modal: Modal, user: UserView, 'filterable-select': FilterableSelect, bbcode: BBCodeView} }) export default class CharacterSearch extends CustomDialog { //tslint:disable:no-null-keyword @@ -50,6 +65,7 @@ kinksFilter = ''; error = ''; results: Character[] | null = null; + characterImage = characterImage; options: { kinks: Kink[] genders: string[] @@ -82,7 +98,6 @@ roles: options.listitems.filter((x) => x.name === 'subdom').map((x) => x.value), positions: options.listitems.filter((x) => x.name === 'position').map((x) => x.value) }; - this.$nextTick(() => (this.$children[0]).fixDropdowns()); } mounted(): void { @@ -98,7 +113,8 @@ this.error = l('characterSearch.error.tooManyResults'); } }); - core.connection.onMessage('FKS', (data) => this.results = data.characters.map((x: string) => core.characters.get(x))); + core.connection.onMessage('FKS', (data) => this.results = data.characters.map((x: string) => core.characters.get(x)).sort(sort)); + (this.$children[0]).fixDropdowns(); } filterKink(filter: RegExp, kink: Kink): boolean { @@ -107,6 +123,10 @@ return filter.test(kink.name); } + get showAvatars(): boolean { + return core.state.settings.showAvatars; + } + submit(): void { if(this.results !== null) { this.results = null; @@ -122,8 +142,25 @@ } - \ No newline at end of file diff --git a/chat/Chat.vue b/chat/Chat.vue index 9e6a244..2d97f7a 100644 --- a/chat/Chat.vue +++ b/chat/Chat.vue @@ -84,7 +84,12 @@ connect(): void { this.connecting = true; - core.connection.connect(this.selectedCharacter); + try { + core.connection.connect(this.selectedCharacter); + } catch(e) { + if(e.request !== undefined) this.error = l('login.connectError'); //catch axios network errors + else throw e; + } } } \ No newline at end of file diff --git a/chat/ChatView.vue b/chat/ChatView.vue index 447fce0..3eb063e 100644 --- a/chat/ChatView.vue +++ b/chat/ChatView.vue @@ -169,6 +169,12 @@ core.connection.send('STA', {status: 'idle', statusmsg: ownCharacter.statusText}); }, core.state.settings.idleTimer * 60000); }; + core.connection.onEvent('closed', () => { + if(idleTimer !== undefined) { + window.clearTimeout(idleTimer); + idleTimer = undefined; + } + }); } logOut(): void { diff --git a/chat/ConversationView.vue b/chat/ConversationView.vue index bd92934..1a762b8 100644 --- a/chat/ConversationView.vue +++ b/chat/ConversationView.vue @@ -42,7 +42,7 @@
-
@@ -53,21 +53,18 @@
-