Minor
This commit is contained in:
parent
9ff0d2210f
commit
f2b6d8b8b1
|
@ -2,7 +2,7 @@
|
|||
|
||||
## Canary
|
||||
* Show number of unread notes and messages in the bottom right corner
|
||||
* Fixed max ad length for automated ads to 50,000 characters
|
||||
* Fixed max ad length for automated ads
|
||||
* Fixed 'unsure' sexual orientation to display correctly in character preview
|
||||
|
||||
|
||||
|
|
|
@ -140,6 +140,8 @@ import {InlineDisplayMode} from '../interfaces';
|
|||
|
||||
AdManager.onConnectionClosed();
|
||||
core.adCoordinator.clear();
|
||||
|
||||
// tslint:disable-next-line:no-floating-promises
|
||||
core.siteSession.onConnectionClosed();
|
||||
|
||||
document.title = l('title');
|
||||
|
@ -174,6 +176,8 @@ import {InlineDisplayMode} from '../interfaces';
|
|||
this.connected = true;
|
||||
core.notifications.playSound('login');
|
||||
document.title = l('title.connected', core.connection.character);
|
||||
|
||||
// tslint:disable-next-line:no-floating-promises
|
||||
core.siteSession.onConnectionEstablished();
|
||||
});
|
||||
core.watch(() => core.conversations.hasNew, (hasNew) => {
|
||||
|
|
|
@ -98,7 +98,7 @@
|
|||
<recent-conversations ref="recentDialog"></recent-conversations>
|
||||
<image-preview ref="imagePreview"></image-preview>
|
||||
<add-pm-partner ref="addPmPartnerDialog"></add-pm-partner>
|
||||
<note-status></note-status>
|
||||
<note-status v-if="coreState.settings.risingShowUnreadOfflineCount"></note-status>
|
||||
</div>
|
||||
</template>/me
|
||||
|
||||
|
@ -152,6 +152,7 @@
|
|||
characterImage = characterImage;
|
||||
conversations = core.conversations;
|
||||
getStatusIcon = getStatusIcon;
|
||||
coreState = core.state;
|
||||
keydownListener!: (e: KeyboardEvent) => void;
|
||||
focusListener!: () => void;
|
||||
blurListener!: () => void;
|
||||
|
|
|
@ -183,6 +183,15 @@
|
|||
</label>
|
||||
</div>
|
||||
|
||||
<h5>Misc</h5>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="risingShowUnreadOfflineCount">
|
||||
<input type="checkbox" id="risingShowUnreadOfflineCount" v-model="risingShowUnreadOfflineCount"/>
|
||||
Show unread note and offline message counts at the bottom right corner
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div v-show="selectedTab === '3'">
|
||||
<template v-if="hidden.length">
|
||||
|
@ -250,6 +259,8 @@
|
|||
risingComparisonInUserMenu!: boolean;
|
||||
risingComparisonInSearch!: boolean;
|
||||
|
||||
risingShowUnreadOfflineCount!: boolean;
|
||||
|
||||
|
||||
async load(): Promise<void> {
|
||||
const settings = core.state.settings;
|
||||
|
@ -283,6 +294,7 @@
|
|||
this.risingCharacterPreview = settings.risingCharacterPreview;
|
||||
this.risingComparisonInUserMenu = settings.risingComparisonInUserMenu;
|
||||
this.risingComparisonInSearch = settings.risingComparisonInSearch;
|
||||
this.risingShowUnreadOfflineCount = settings.risingShowUnreadOfflineCount;
|
||||
}
|
||||
|
||||
async doImport(): Promise<void> {
|
||||
|
@ -334,7 +346,8 @@
|
|||
risingAutoExpandCustomKinks: this.risingAutoExpandCustomKinks,
|
||||
risingCharacterPreview: this.risingCharacterPreview,
|
||||
risingComparisonInUserMenu: this.risingComparisonInUserMenu,
|
||||
risingComparisonInSearch: this.risingComparisonInSearch
|
||||
risingComparisonInSearch: this.risingComparisonInSearch,
|
||||
risingShowUnreadOfflineCount: this.risingShowUnreadOfflineCount
|
||||
};
|
||||
if(this.notifications) await core.notifications.requestPermission();
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<a @click="removeAd(index)" title="Remove Ad"><i class="fas fa-times-circle"></i></a>
|
||||
</label>
|
||||
|
||||
<editor :id="'ad' + conversation.key + '-' + index" v-model="ads[index]" :hasToolbar="true" class="form-control" :maxlength="50000">
|
||||
<editor :id="'ad' + conversation.key + '-' + index" v-model="ads[index]" :hasToolbar="true" class="form-control" :maxlength="core.connection.vars.lfrp_max">
|
||||
</editor>
|
||||
</div>
|
||||
<button class="btn btn-outline-secondary" @click="addAd()">Add Another</button>
|
||||
|
@ -28,6 +28,7 @@
|
|||
import {Conversation} from '../interfaces';
|
||||
import l from '../localize';
|
||||
import {Editor} from '../bbcode';
|
||||
import core from '../core';
|
||||
|
||||
@Component({
|
||||
components: {modal: Modal, editor: Editor}
|
||||
|
@ -38,6 +39,7 @@
|
|||
l = l;
|
||||
setting = Conversation.Setting;
|
||||
ads!: string[];
|
||||
core = core;
|
||||
|
||||
load(): void {
|
||||
const settings = this.conversation.settings;
|
||||
|
|
|
@ -51,6 +51,8 @@ export class Settings implements ISettings {
|
|||
risingCharacterPreview = true;
|
||||
risingComparisonInUserMenu = true;
|
||||
risingComparisonInSearch = true;
|
||||
|
||||
risingShowUnreadOfflineCount = true;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -823,9 +823,13 @@ export default function(this: any): Interfaces.State {
|
|||
text = l(key, `[user]${data.name}[/user]`, l(`events.rtbComment_${data.target_type}`), `[url=${url}]${data.target}[/url]`);
|
||||
character = data.name;
|
||||
} else if(data.type === 'note') {
|
||||
// tslint:disable-next-line:no-unsafe-any
|
||||
core.siteSession.interfaces.notes.incrementNotes();
|
||||
text = l('events.rtb_note', `[user]${data.sender}[/user]`, `[url=${url}view_note.php?note_id=${data.id}]${data.subject}[/url]`);
|
||||
character = data.sender;
|
||||
} else if(data.type === 'friendrequest') {
|
||||
// tslint:disable-next-line:no-unsafe-any
|
||||
core.siteSession.interfaces.notes.incrementMessages();
|
||||
text = l(`events.rtb_friendrequest`, `[user]${data.name}[/user]`);
|
||||
character = data.name;
|
||||
} else {
|
||||
|
|
|
@ -216,6 +216,8 @@ export namespace Settings {
|
|||
readonly risingCharacterPreview: boolean;
|
||||
readonly risingComparisonInUserMenu: boolean;
|
||||
readonly risingComparisonInSearch: boolean;
|
||||
|
||||
readonly risingShowUnreadOfflineCount: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
<div id="note-status" :class="{active: hasReports()}">
|
||||
|
||||
<div v-for="(report, index) in reports" :key="`report-${index}`" :class="`status-report ${report.type} ${(report.count > 0) && (report.count !== report.dismissedCount) ? 'active': ''}`">
|
||||
<a :href="report.url">
|
||||
<a :href="report.url" @click="dismissReport(report)">
|
||||
<span class="count">{{report.count}}</span>
|
||||
{{ report.title }}
|
||||
{{ `${report.count !== 1 ? report.title : report.title.substr(0, report.title.length - 1)}` }}
|
||||
|
||||
</a>
|
||||
<a @click="dismissReport(report)" class="dismiss"><i class="fas fa-times-circle"></i></a>
|
||||
|
@ -44,17 +44,16 @@ export default class NoteStatus extends Vue {
|
|||
dismissedCount: 0,
|
||||
url: 'https://www.f-list.net/read_notes.php'
|
||||
}
|
||||
]
|
||||
];
|
||||
|
||||
interval?: any;
|
||||
callback?: any;
|
||||
callback?: () => void;
|
||||
|
||||
|
||||
@Hook('mounted')
|
||||
mounted(): void {
|
||||
this.processCounts();
|
||||
this.updateCounts();
|
||||
|
||||
this.callback = () => this.processCounts();
|
||||
this.callback = () => this.updateCounts();
|
||||
|
||||
EventBus.$on('note-counts-update', this.callback);
|
||||
}
|
||||
|
@ -76,13 +75,13 @@ export default class NoteStatus extends Vue {
|
|||
}
|
||||
|
||||
|
||||
processCounts() {
|
||||
updateCounts(): void {
|
||||
const v = core.siteSession.interfaces.notes.getCounts();
|
||||
|
||||
const mapper = {
|
||||
message: 'unreadMessages',
|
||||
note: 'unreadNotes'
|
||||
}
|
||||
};
|
||||
|
||||
_.each(
|
||||
mapper,
|
||||
|
@ -104,7 +103,6 @@ export default class NoteStatus extends Vue {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<style lang="scss">
|
||||
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import { SiteSession, SiteSessionInterface } from './site-session';
|
||||
import log from 'electron-log';
|
||||
import log from 'electron-log'; //tslint:disable-line:match-default-export-name
|
||||
import { EventBus } from '../chat/preview/event-bus';
|
||||
|
||||
/* tslint:disable:no-unsafe-any */
|
||||
|
||||
export interface NoteCheckerCount {
|
||||
unreadNotes: number;
|
||||
unreadMessages: number;
|
||||
|
@ -10,7 +12,7 @@ export interface NoteCheckerCount {
|
|||
|
||||
|
||||
export class NoteChecker implements SiteSessionInterface {
|
||||
private static readonly CHECK_FREQUENCY = 10 * 60 * 1000;
|
||||
private static readonly CHECK_FREQUENCY = 15 * 60 * 1000;
|
||||
|
||||
private latestCount: NoteCheckerCount = { unreadNotes: 0, unreadMessages: 0, onlineUsers: 0 };
|
||||
private timer?: any;
|
||||
|
@ -78,6 +80,18 @@ export class NoteChecker implements SiteSessionInterface {
|
|||
}
|
||||
|
||||
|
||||
incrementMessages(): void {
|
||||
this.latestCount.unreadMessages++;
|
||||
EventBus.$emit('note-counts-update', this.latestCount);
|
||||
}
|
||||
|
||||
|
||||
incrementNotes(): void {
|
||||
this.latestCount.unreadNotes++;
|
||||
EventBus.$emit('note-counts-update', this.latestCount);
|
||||
}
|
||||
|
||||
|
||||
getCounts(): NoteCheckerCount {
|
||||
return this.latestCount;
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
// import qs from 'qs';
|
||||
import _ from 'lodash';
|
||||
import log from 'electron-log';
|
||||
import throat from 'throat'; //tslint:disable-line:match-default-export-name
|
||||
import log from 'electron-log'; //tslint:disable-line:match-default-export-name
|
||||
import throat from 'throat';
|
||||
import { NoteChecker } from './note-checker';
|
||||
|
||||
import request from 'request-promise';
|
||||
import request from 'request-promise'; //tslint:disable-line:match-default-export-name
|
||||
|
||||
/* tslint:disable:no-unsafe-any */
|
||||
|
||||
export interface SiteSessionInterface {
|
||||
start(): Promise<void>;
|
||||
|
@ -160,15 +160,13 @@ export class SiteSession {
|
|||
|
||||
|
||||
async get(uri: string, mustBeLoggedIn: boolean = false, config: Partial<request.Options> = {}): Promise<request.RequestPromise> {
|
||||
const res = await this.sessionThroat(
|
||||
return this.sessionThroat(
|
||||
async() => {
|
||||
const finalConfig = await this.prepareRequest('get', uri, mustBeLoggedIn, config);
|
||||
|
||||
return this.request(finalConfig);
|
||||
}
|
||||
);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
@ -178,15 +176,13 @@ export class SiteSession {
|
|||
mustBeLoggedIn: boolean = false,
|
||||
config: Partial<request.Options> = {}
|
||||
): Promise<request.RequestPromise> {
|
||||
const res = await this.sessionThroat(
|
||||
return this.sessionThroat(
|
||||
async() => {
|
||||
const finalConfig = await this.prepareRequest('post', uri, mustBeLoggedIn, _.merge({ form: data }, config));
|
||||
|
||||
return this.request(finalConfig);
|
||||
}
|
||||
);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue