Reorg and minor fixes to search history

This commit is contained in:
Mr. Stallion 2020-04-03 10:00:38 -05:00
parent 01b92e2415
commit 859151750c
10 changed files with 71 additions and 26 deletions

View File

@ -229,7 +229,23 @@
updateSearch(data?: SearchData): void {
if (data) {
this.data = data;
// this.data = {kinks: [], genders: [], orientations: [], languages: [], furryprefs: [], roles: [], positions: []};
// this.data = data;
this.data = _.mapValues(
data,
(category, categoryName) => (
_.map(
category,
(selection) => {
const jsonSelection = JSON.stringify(selection);
const v = _.find((this.options as any)[categoryName], (op) => (JSON.stringify(op) === jsonSelection));
return v || selection;
}
)
)
) as SearchData;
}
}

View File

@ -184,7 +184,7 @@
import {BBCodeView} from '../bbcode/view';
import {isShowing as anyDialogsShown} from '../components/Modal.vue';
import {Keys} from '../keys';
import AdView from './ads/AdView.vue';
import CharacterAdView from './character/CharacterAdView.vue';
import {Editor} from './bbcode';
import CommandHelp from './CommandHelp.vue';
import { characterImage, getByteLength, getKey } from './common';
@ -199,7 +199,7 @@
import ReportDialog from './ReportDialog.vue';
import {isCommand} from './slash_commands';
import UserView from './UserView.vue';
import UserChannelList from './UserChannelList.vue';
import CharacterChannelList from './character/CharacterChannelList.vue';
import * as _ from 'lodash';
import Dropdown from '../components/Dropdown.vue';
@ -208,7 +208,7 @@
components: {
user: UserView, 'bbcode-editor': Editor, 'manage-channel': ManageChannel, settings: ConversationSettings,
logs: Logs, 'message-view': MessageView, bbcode: BBCodeView(core.bbCodeParser), 'command-help': CommandHelp,
'ad-view': AdView, 'channel-list': UserChannelList, dropdown: Dropdown, adSettings: ConversationAdSettings
'ad-view': CharacterAdView, 'channel-list': CharacterChannelList, dropdown: Dropdown, adSettings: ConversationAdSettings
}
})
export default class ConversationView extends Vue {
@ -481,11 +481,11 @@
}
showAds(): void {
(<AdView>this.$refs['adViewer']).show();
(<CharacterAdView>this.$refs['adViewer']).show();
}
showChannels(): void {
(<UserChannelList>this.$refs['channelList']).show();
(<CharacterChannelList>this.$refs['channelList']).show();
}

View File

@ -48,7 +48,7 @@
import Vue from 'vue';
import {BBCodeView} from '../bbcode/view';
import Modal from '../components/Modal.vue';
import AdView from './ads/AdView.vue';
import CharacterAdView from './character/CharacterAdView.vue';
import {characterImage, errorToString, getByteLength, profileLink} from './common';
import core from './core';
import {Channel, Character} from './interfaces';
@ -56,7 +56,7 @@
import ReportDialog from './ReportDialog.vue';
@Component({
components: {bbcode: BBCodeView(core.bbCodeParser), modal: Modal, 'ad-view': AdView}
components: {bbcode: BBCodeView(core.bbCodeParser), modal: Modal, 'ad-view': CharacterAdView}
})
export default class UserMenu extends Vue {
@Prop({required: true})
@ -131,7 +131,7 @@
return;
}
(<AdView>this.$refs['adViewDialog']).show();
(<CharacterAdView>this.$refs['adViewDialog']).show();
}

View File

@ -14,7 +14,7 @@
</div>
<div class="row ad-viewer" ref="pageBody" v-else>
<i>Character has not posted any ads.</i>
<i><user :character="character">{{character.name}}</user> has not posted any ads on the channels you are on.</i>
</div>
</modal>
@ -37,7 +37,7 @@ import { BBCodeView } from '../../bbcode/view';
@Component({
components: {modal: Modal, user: UserView, bbcode: BBCodeView(core.bbCodeParser)}
})
export default class AdView extends CustomDialog {
export default class CharacterAdView extends CustomDialog {
@Prop({required: true})
readonly character!: Character;

View File

@ -4,12 +4,16 @@
Channels for <user :character="character">{{character.name}}</user>
</template>
<div class="user-channel-list" ref="pageBody">
<div class="user-channel-list" ref="pageBody" v-if="channels.length > 0">
<template v-for="channel in channels">
<h3><a href="#" @click.prevent="jumpToChannel(channel)">#{{channel.name}}</a></h3>
</template>
</div>
<div class="user-channel-list" ref="pageBody" v-else>
<i><user :character="character">{{character.name}}</user> is not on any of the channels you are on.</i>
</div>
</modal>
</template>
@ -18,18 +22,18 @@
import * as _ from 'lodash';
import { Component, Hook, Prop, Watch } from '@f-list/vue-ts';
import CustomDialog from '../components/custom_dialog';
import Modal from '../components/Modal.vue';
import { Character } from '../fchat/interfaces';
import core from './core';
import { Conversation } from './interfaces';
import UserView from './UserView.vue';
import CustomDialog from '../../components/custom_dialog';
import Modal from '../../components/Modal.vue';
import { Character } from '../../fchat/interfaces';
import core from '../core';
import { Conversation } from '../interfaces';
import UserView from '../UserView.vue';
import ChannelConversation = Conversation.ChannelConversation;
@Component({
components: {modal: Modal, user: UserView}
})
export default class UserChannelList extends CustomDialog {
export default class CharacterChannelList extends CustomDialog {
@Prop({required: true})
readonly character!: Character;
@ -73,4 +77,4 @@ export default class UserChannelList extends CustomDialog {
.user-channel-list h3 {
font-size: 120%;
}
</style>
</style>

View File

@ -401,6 +401,7 @@
this.interval = null;
this.visible = true;
this.visibleSince = Date.now();
this.shouldDismiss = false;
this.initialCursorPosition = screen.getCursorScreenPoint();

View File

@ -72,3 +72,7 @@ https://www.youtube.com/watch?v=fk6JtDhA7WI (audio on, video doesn't show, audio
Slow
https://giphy.com/gifs/arianagrande-ariana-grande-thank-u-next-you-uldtLAK6tSOKP5PWw3
http://gfycatporn.com/deepthroat.php
Derpibooru
Pornhub GIFS

View File

@ -2,7 +2,26 @@ import * as _ from 'lodash';
export function getSafeLanguages(langs: string | string[] | undefined): string[] {
return langs ? _.castArray(langs) : [];
const initialLanguages = _.isString(langs)
? ([langs.replace('_', '-')])
: (langs || []);
const initialCount = initialLanguages.length;
const safeLanguages = _.filter(initialLanguages, (il) => (_.indexOf(supportedLanguages, il) >= 0));
if ((initialCount > 0) && (safeLanguages.length)) {
safeLanguages.push('en-GB');
}
return safeLanguages;
}
let supportedLanguages: string[] = [];
export function updateSupportedLanguages(langs: string[]): void {
supportedLanguages = langs;
}
@ -30,7 +49,6 @@ export const knownLanguageNames = {
et: 'Estonian',
fa: 'Persian',
fi: 'Finnish',
fo: 'Faroese',
fr: 'French',
he: 'Hebrew',

View File

@ -41,7 +41,7 @@ import * as path from 'path';
// import * as url from 'url';
import l from '../chat/localize';
import {defaultHost, GeneralSettings} from './common';
import { getSafeLanguages, knownLanguageNames } from './language';
import { getSafeLanguages, knownLanguageNames, updateSupportedLanguages } from './language';
import * as windowState from './window_state';
import BrowserWindow = Electron.BrowserWindow;
import MenuItem = Electron.MenuItem;
@ -271,6 +271,8 @@ function onReady(): void {
log.transports.file.file = path.join(baseDir, 'log.txt');
log.info('Starting application.');
updateSupportedLanguages(electron.session.defaultSession.availableSpellCheckerLanguages);
app.setAppUserModelId('com.squirrel.fchat.F-Chat');
app.on('open-file', createWindow);

View File

@ -52,10 +52,10 @@ This repository contains a heavily customized version of the mainline F-Chat 3.0
* Conversation dialog can be opened by typing in a character name
* Message search matches character names
* PM list shows characters' online status as a colored icon
* Details for Nerds
* Technical Details for Nerds
* Upgraded to Electron 8.x
* Replaced node-spellchecker with the built-in spellchecker of Electron 8
* Multi-language support for spell checking (Windows only language support is fully automatic on MacOS)
* Replaced `node-spellchecker` with the built-in spellchecker that ships with Electron 8
* Multi-language support for spell checking (Windows only language is autodetected on MacOS)
## How to Set Up Ads