Merge branch 'develop'

This commit is contained in:
syuilo 2018-08-26 02:33:29 +09:00
commit 9c32118b77
21 changed files with 54 additions and 21 deletions

View file

@ -138,3 +138,6 @@ drive:
# Clustering # Clustering
# clusterLimit: 1 # clusterLimit: 1
# Summaly proxy
# summalyProxy: "http://example.com"

View file

@ -732,6 +732,7 @@ desktop/views/components/settings.vue:
gradient-window-header: "ウィンドウのタイトルバーにグラデーションを使用" gradient-window-header: "ウィンドウのタイトルバーにグラデーションを使用"
post-form-on-timeline: "タイムライン上部に投稿フォームを表示する" post-form-on-timeline: "タイムライン上部に投稿フォームを表示する"
suggest-recent-hashtags: "最近のハッシュタグを投稿フォームに表示する" suggest-recent-hashtags: "最近のハッシュタグを投稿フォームに表示する"
show-clock-on-header: "右上に時計を表示する"
show-reply-target: "リプライ先を表示する" show-reply-target: "リプライ先を表示する"
show-my-renotes: "自分の行ったRenoteをタイムラインに表示する" show-my-renotes: "自分の行ったRenoteをタイムラインに表示する"
show-renoted-my-notes: "自分の投稿のRenoteをタイムラインに表示する" show-renoted-my-notes: "自分の投稿のRenoteをタイムラインに表示する"

View file

@ -1,8 +1,8 @@
{ {
"name": "misskey", "name": "misskey",
"author": "syuilo <i@syuilo.com>", "author": "syuilo <i@syuilo.com>",
"version": "8.13.0", "version": "8.14.0",
"clientVersion": "1.0.9001", "clientVersion": "1.0.9022",
"codename": "nighthike", "codename": "nighthike",
"main": "./built/index.js", "main": "./built/index.js",
"private": true, "private": true,

View file

@ -26,8 +26,8 @@ export default Vue.extend({
}, },
created() { created() {
(this as any).os.getMeta().then(meta => { (this as any).os.getMeta().then(meta => {
if (meta.repositoryUrl) this.repositoryUrl = meta.repositoryUrl; if (meta.maintainer.repository_url) this.repositoryUrl = meta.maintainer.repository_url;
if (meta.feedbackUrl) this.feedbackUrl = meta.feedbackUrl; if (meta.maintainer.feedback_url) this.feedbackUrl = meta.maintainer.feedback_url;
}); });
} }
}); });

View file

@ -49,6 +49,7 @@
</div> </div>
<mk-switch v-model="$store.state.settings.showPostFormOnTopOfTl" @change="onChangeShowPostFormOnTopOfTl" text="%i18n:@post-form-on-timeline%"/> <mk-switch v-model="$store.state.settings.showPostFormOnTopOfTl" @change="onChangeShowPostFormOnTopOfTl" text="%i18n:@post-form-on-timeline%"/>
<mk-switch v-model="$store.state.settings.suggestRecentHashtags" @change="onChangeSuggestRecentHashtags" text="%i18n:@suggest-recent-hashtags%"/> <mk-switch v-model="$store.state.settings.suggestRecentHashtags" @change="onChangeSuggestRecentHashtags" text="%i18n:@suggest-recent-hashtags%"/>
<mk-switch v-model="$store.state.settings.showClockOnHeader" @change="onChangeShowClockOnHeader" text="%i18n:@show-clock-on-header%"/>
<mk-switch v-model="$store.state.settings.showReplyTarget" @change="onChangeShowReplyTarget" text="%i18n:@show-reply-target%"/> <mk-switch v-model="$store.state.settings.showReplyTarget" @change="onChangeShowReplyTarget" text="%i18n:@show-reply-target%"/>
<mk-switch v-model="$store.state.settings.showMyRenotes" @change="onChangeShowMyRenotes" text="%i18n:@show-my-renotes%"/> <mk-switch v-model="$store.state.settings.showMyRenotes" @change="onChangeShowMyRenotes" text="%i18n:@show-my-renotes%"/>
<mk-switch v-model="$store.state.settings.showRenotedMyNotes" @change="onChangeShowRenotedMyNotes" text="%i18n:@show-renoted-my-notes%"/> <mk-switch v-model="$store.state.settings.showRenotedMyNotes" @change="onChangeShowRenotedMyNotes" text="%i18n:@show-renoted-my-notes%"/>
@ -333,6 +334,12 @@ export default Vue.extend({
value: v value: v
}); });
}, },
onChangeShowClockOnHeader(v) {
this.$store.dispatch('settings/set', {
key: 'showClockOnHeader',
value: v
});
},
onChangeShowReplyTarget(v) { onChangeShowReplyTarget(v) {
this.$store.dispatch('settings/set', { this.$store.dispatch('settings/set', {
key: 'showReplyTarget', key: 'showReplyTarget',

View file

@ -17,7 +17,7 @@
<x-account v-if="$store.getters.isSignedIn"/> <x-account v-if="$store.getters.isSignedIn"/>
<x-notifications v-if="$store.getters.isSignedIn"/> <x-notifications v-if="$store.getters.isSignedIn"/>
<x-post v-if="$store.getters.isSignedIn"/> <x-post v-if="$store.getters.isSignedIn"/>
<x-clock/> <x-clock v-if="$store.state.settings.showClockOnHeader"/>
</div> </div>
</div> </div>
</div> </div>

View file

@ -48,7 +48,7 @@ export default Vue.extend({
this.open(); this.open();
}); });
} else { } else {
const query = this.user[0] == '@' ? const query = this.user.startsWith('@') ?
parseAcct(this.user.substr(1)) : parseAcct(this.user.substr(1)) :
{ userId: this.user }; { userId: this.user };

View file

@ -4,8 +4,8 @@
<div v-if="stats" class="stats"> <div v-if="stats" class="stats">
<div><b>%fa:user% {{ stats.originalUsersCount | number }}</b><span>%i18n:@original-users%</span></div> <div><b>%fa:user% {{ stats.originalUsersCount | number }}</b><span>%i18n:@original-users%</span></div>
<div><span>%fa:user% {{ stats.usersCount | number }}</span><span>%i18n:@all-users%</span></div> <div><span>%fa:user% {{ stats.usersCount | number }}</span><span>%i18n:@all-users%</span></div>
<div><b>%fa:pen% {{ stats.originalNotesCount | number }}</b><span>%i18n:@original-notes%</span></div> <div><b>%fa:pencil-alt% {{ stats.originalNotesCount | number }}</b><span>%i18n:@original-notes%</span></div>
<div><span>%fa:pen% {{ stats.notesCount | number }}</span><span>%i18n:@all-notes%</span></div> <div><span>%fa:pencil-alt% {{ stats.notesCount | number }}</span><span>%i18n:@all-notes%</span></div>
</div> </div>
<div class="cpu-memory"> <div class="cpu-memory">
<x-cpu-memory :connection="connection"/> <x-cpu-memory :connection="connection"/>

View file

@ -16,7 +16,7 @@ import Vue from 'vue';
export default Vue.extend({ export default Vue.extend({
data() { data() {
return { return {
name: (this as any).os.instanceName, name: null,
posted: false, posted: false,
text: new URLSearchParams(location.search).get('text') text: new URLSearchParams(location.search).get('text')
}; };
@ -25,6 +25,11 @@ export default Vue.extend({
close() { close() {
window.close(); window.close();
} }
},
mounted() {
(this as any).os.getMeta().then(meta => {
this.name = meta.name;
});
} }
}); });
</script> </script>

View file

@ -3,8 +3,8 @@
<div v-if="stats" class="stats"> <div v-if="stats" class="stats">
<div><b>%fa:user% {{ stats.originalUsersCount | number }}</b><span>%i18n:@original-users%</span></div> <div><b>%fa:user% {{ stats.originalUsersCount | number }}</b><span>%i18n:@original-users%</span></div>
<div><span>%fa:user% {{ stats.usersCount | number }}</span><span>%i18n:@all-users%</span></div> <div><span>%fa:user% {{ stats.usersCount | number }}</span><span>%i18n:@all-users%</span></div>
<div><b>%fa:pen% {{ stats.originalNotesCount | number }}</b><span>%i18n:@original-notes%</span></div> <div><b>%fa:pencil-alt% {{ stats.originalNotesCount | number }}</b><span>%i18n:@original-notes%</span></div>
<div><span>%fa:pen% {{ stats.notesCount | number }}</span><span>%i18n:@all-notes%</span></div> <div><span>%fa:pencil-alt% {{ stats.notesCount | number }}</span><span>%i18n:@all-notes%</span></div>
</div> </div>
<div> <div>
<x-charts/> <x-charts/>

View file

@ -16,7 +16,7 @@ import Vue from 'vue';
export default Vue.extend({ export default Vue.extend({
data() { data() {
return { return {
name: (this as any).os.instanceName, name: null,
posted: false, posted: false,
text: new URLSearchParams(location.search).get('text') text: new URLSearchParams(location.search).get('text')
}; };
@ -25,6 +25,11 @@ export default Vue.extend({
close() { close() {
window.close(); window.close();
} }
},
mounted() {
(this as any).os.getMeta().then(meta => {
this.name = meta.name;
});
} }
}); });
</script> </script>

View file

@ -13,6 +13,7 @@ const defaultSettings = {
showMaps: true, showMaps: true,
showPostFormOnTopOfTl: false, showPostFormOnTopOfTl: false,
suggestRecentHashtags: true, suggestRecentHashtags: true,
showClockOnHeader: false,
circleIcons: true, circleIcons: true,
gradientWindowHeader: false, gradientWindowHeader: false,
showReplyTarget: true, showReplyTarget: true,

View file

@ -62,6 +62,8 @@ export type Source = {
*/ */
ghost?: string; ghost?: string;
summalyProxy?: string;
accesslog?: string; accesslog?: string;
twitter?: { twitter?: {
consumer_key: string; consumer_key: string;

View file

@ -197,7 +197,7 @@ const elements: Element[] = [
if (thisIsNotARegexp) return null; if (thisIsNotARegexp) return null;
if (regexp == '') return null; if (regexp == '') return null;
if (regexp[0] == ' ' && regexp[regexp.length - 1] == ' ') return null; if (regexp.startsWith(' ') && regexp.endsWith(' ')) return null;
return { return {
html: `<span class="regexp">/${escape(regexp)}/</span>`, html: `<span class="regexp">/${escape(regexp)}/</span>`,

View file

@ -10,7 +10,7 @@ export type TextElementHashtag = {
export default function(text: string, i: number) { export default function(text: string, i: number) {
if (!(/^\s#[^\s]+/.test(text) || (i == 0 && /^#[^\s]+/.test(text)))) return null; if (!(/^\s#[^\s]+/.test(text) || (i == 0 && /^#[^\s]+/.test(text)))) return null;
const isHead = text[0] == '#'; const isHead = text.startsWith('#');
const hashtag = text.match(/^\s?#[^\s]+/)[0]; const hashtag = text.match(/^\s?#[^\s]+/)[0];
const res: any[] = !isHead ? [{ const res: any[] = !isHead ? [{
type: 'text', type: 'text',

View file

@ -13,7 +13,7 @@ export type TextElementLink = {
export default function(text: string) { export default function(text: string) {
const match = text.match(/^\??\[([^\[\]]+?)\]\((https?:\/\/[\w\/:%#@\$&\?!\(\)\[\]~\.=\+\-]+?)\)/); const match = text.match(/^\??\[([^\[\]]+?)\]\((https?:\/\/[\w\/:%#@\$&\?!\(\)\[\]~\.=\+\-]+?)\)/);
if (!match) return null; if (!match) return null;
const silent = text[0] == '?'; const silent = text.startsWith('?');
const link = match[0]; const link = match[0];
const title = match[1]; const title = match[1];
const url = match[2]; const url = match[2];

View file

@ -25,9 +25,9 @@ export const replacement = (match: string, key: string) => {
arg == 'S' ? 'fas' : arg == 'S' ? 'fas' :
arg == 'B' ? 'fab' : arg == 'B' ? 'fab' :
''; '';
} else if (arg[0] == '.') { } else if (arg.startsWith('.')) {
classes.push('fa-' + arg.substr(1)); classes.push('fa-' + arg.substr(1));
} else if (arg[0] == '-') { } else if (arg.startsWith('-')) {
transform = arg.substr(1).split('|').join(' '); transform = arg.substr(1).split('|').join(' ');
} else { } else {
name = arg; name = arg;

View file

@ -46,7 +46,7 @@ export default async (job: bq.Job, done: any): Promise<void> => {
// アクティビティを送信してきたユーザーがまだMisskeyサーバーに登録されていなかったら登録する // アクティビティを送信してきたユーザーがまだMisskeyサーバーに登録されていなかったら登録する
if (user === null) { if (user === null) {
user = await resolvePerson(signature.keyId) as IRemoteUser; user = await resolvePerson(activity.actor) as IRemoteUser;
} }
} }

View file

@ -1 +1 @@
export default (token: string) => token[0] == '!'; export default (token: string) => token.startsWith('!');

View file

@ -1,11 +1,20 @@
import * as Koa from 'koa'; import * as Koa from 'koa';
import * as request from 'request-promise-native';
import summaly from 'summaly'; import summaly from 'summaly';
import config from '../../config';
module.exports = async (ctx: Koa.Context) => { module.exports = async (ctx: Koa.Context) => {
try { try {
const summary = await summaly(ctx.query.url, { const summary = config.summalyProxy ? await request.get({
url: config.summalyProxy,
qs: {
url: ctx.query.url
},
json: true
}) : await summaly(ctx.query.url, {
followRedirects: false followRedirects: false
}); });
summary.icon = wrap(summary.icon); summary.icon = wrap(summary.icon);
summary.thumbnail = wrap(summary.thumbnail); summary.thumbnail = wrap(summary.thumbnail);

View file

@ -8,7 +8,7 @@ export const replacement = (ctx: any, _: any, key: string) => {
const client = '/src/client/app/'; const client = '/src/client/app/';
let name = null; let name = null;
if (key[0] == '@') { if (key.startsWith('@')) {
name = ctx.src.substr(ctx.src.indexOf(client) + client.length); name = ctx.src.substr(ctx.src.indexOf(client) + client.length);
key = key.substr(1); key = key.substr(1);
} }