インスタンス名がブラウザタイトルに反映されないのを修正 (#2668)

* titleが反映されないのを修正

* deckでtitleが反映されるように修正
This commit is contained in:
MeiMei 2018-09-08 21:44:28 +09:00 committed by syuilo
parent 67f60ab307
commit 5a13c38a6d
6 changed files with 10 additions and 5 deletions

View File

@ -5,6 +5,7 @@ declare const _COPYRIGHT_: string;
declare const _VERSION_: string; declare const _VERSION_: string;
declare const _CODENAME_: string; declare const _CODENAME_: string;
declare const _ENV_: string; declare const _ENV_: string;
declare const _NAME_: string;
const address = new URL(location.href); const address = new URL(location.href);
@ -20,3 +21,4 @@ export const copyright = _COPYRIGHT_;
export const version = _VERSION_; export const version = _VERSION_;
export const codename = _CODENAME_; export const codename = _CODENAME_;
export const env = _ENV_; export const env = _ENV_;
export const name = _NAME_;

View File

@ -85,6 +85,7 @@ export default Vue.extend({
}, },
mounted() { mounted() {
document.title = (this as any).os.instanceName;
document.documentElement.style.overflow = 'hidden'; document.documentElement.style.overflow = 'hidden';
}, },

View File

@ -3,7 +3,7 @@ import { EventEmitter } from 'eventemitter3';
import * as uuid from 'uuid'; import * as uuid from 'uuid';
import initStore from './store'; import initStore from './store';
import { apiUrl, version, lang } from './config'; import { apiUrl, version, lang, name } from './config';
import Progress from './common/scripts/loading'; import Progress from './common/scripts/loading';
import Connection from './common/scripts/streaming/stream'; import Connection from './common/scripts/streaming/stream';
import { HomeStreamManager } from './common/scripts/streaming/home'; import { HomeStreamManager } from './common/scripts/streaming/home';
@ -72,7 +72,7 @@ export default class MiOS extends EventEmitter {
}; };
public get instanceName() { public get instanceName() {
return this.meta ? this.meta.data.name : 'Misskey'; return this.meta ? this.meta.data.name : name;
} }
private isMetaFetching = false; private isMetaFetching = false;

View File

@ -6,7 +6,7 @@ block vars
- const url = `${config.url}/notes/${note.id}`; - const url = `${config.url}/notes/${note.id}`;
block title block title
= `${title} | Misskey` = `${title} | ${config.name}`
block desc block desc
meta(name='description' content= summary) meta(name='description' content= summary)

View File

@ -6,7 +6,7 @@ block vars
- const img = user.avatarId ? `${config.drive_url}/${user.avatarId}` : null; - const img = user.avatarId ? `${config.drive_url}/${user.avatarId}` : null;
block title block title
= `${title} | Misskey` = `${title} | ${config.name}`
block desc block desc
meta(name='description' content= user.description) meta(name='description' content= user.description)

View File

@ -22,6 +22,7 @@ const locales = require('./locales');
const meta = require('./package.json'); const meta = require('./package.json');
const version = `${meta.clientVersion}-${rndstr({ length: 8, chars: '0-9a-z' })}`; const version = `${meta.clientVersion}-${rndstr({ length: 8, chars: '0-9a-z' })}`;
const codename = meta.codename; const codename = meta.codename;
import config from './src/config';
declare var global: { declare var global: {
faReplacement: typeof faReplacement; faReplacement: typeof faReplacement;
@ -75,7 +76,8 @@ const consts = {
_CODENAME_: codename, _CODENAME_: codename,
_LANG_: '%lang%', _LANG_: '%lang%',
_LANGS_: Object.keys(locales).map(l => [l, locales[l].meta.lang]), _LANGS_: Object.keys(locales).map(l => [l, locales[l].meta.lang]),
_ENV_: process.env.NODE_ENV _ENV_: process.env.NODE_ENV,
_NAME_: config.name
}; };
const _consts: { [ key: string ]: any } = {}; const _consts: { [ key: string ]: any } = {};