Compare commits

..

9 Commits

Author SHA1 Message Date
syuilo
d779e18546 10.45.0 2018-11-08 02:10:36 +09:00
syuilo
3261d54cd3 Resolve #2320 2018-11-08 02:09:15 +09:00
syuilo
e0ec56abb5 Fix bug 2018-11-08 01:42:02 +09:00
syuilo
1056a7167d [Client] Improve usabiliy 2018-11-07 23:04:59 +09:00
syuilo
b8e1162e2d Fix test 2018-11-07 21:30:28 +09:00
syuilo
4c81e400c4 [MFM] Fix title parsing 2018-11-07 21:17:27 +09:00
syuilo
a29d7a0475 10.44.2 2018-11-07 21:14:16 +09:00
syuilo
d5408c429b Fix bug 2018-11-07 20:59:40 +09:00
syuilo
501b07c383 [Test] Add MFM test 2018-11-07 19:58:05 +09:00
10 changed files with 39 additions and 20 deletions

View File

@@ -1,8 +1,8 @@
{
"name": "misskey",
"author": "syuilo <i@syuilo.com>",
"version": "10.44.1",
"clientVersion": "1.0.11630",
"version": "10.45.0",
"clientVersion": "1.0.11641",
"codename": "nighthike",
"main": "./built/index.js",
"private": true,

View File

@@ -19,8 +19,8 @@
<section class="fit-bottom">
<header><fa icon="cloud"/> %i18n:@drive-config%</header>
<ui-switch v-model="cacheRemoteFiles">%i18n:@cache-remote-files%<span slot="desc">%i18n:@cache-remote-files-desc%</span></ui-switch>
<ui-input v-model="localDriveCapacityMb">%i18n:@local-drive-capacity-mb%<span slot="suffix">MB</span><span slot="desc">%i18n:@mb%</span></ui-input>
<ui-input v-model="remoteDriveCapacityMb" :disabled="!cacheRemoteFiles">%i18n:@remote-drive-capacity-mb%<span slot="suffix">MB</span><span slot="desc">%i18n:@mb%</span></ui-input>
<ui-input v-model="localDriveCapacityMb" type="number">%i18n:@local-drive-capacity-mb%<span slot="suffix">MB</span><span slot="desc">%i18n:@mb%</span></ui-input>
<ui-input v-model="remoteDriveCapacityMb" type="number" :disabled="!cacheRemoteFiles">%i18n:@remote-drive-capacity-mb%<span slot="suffix">MB</span><span slot="desc">%i18n:@mb%</span></ui-input>
</section>
<section class="fit-bottom">
<header><fa icon="shield-alt"/> %i18n:@recaptcha-config%</header>

View File

@@ -1,5 +1,5 @@
<template>
<div class="mk-media-image-dialog">
<div class="dkjvrdxtkvqrwmhfickhndpmnncsgacq">
<div class="bg" @click="close"></div>
<img :src="image.url" :alt="image.name" :title="image.name" @click="close"/>
</div>
@@ -34,7 +34,7 @@ export default Vue.extend({
</script>
<style lang="stylus" scoped>
.mk-media-image-dialog
.dkjvrdxtkvqrwmhfickhndpmnncsgacq
display block
position fixed
z-index 2048

View File

@@ -10,7 +10,6 @@ import window from './window.vue';
import noteFormWindow from './post-form-window.vue';
import renoteFormWindow from './renote-form-window.vue';
import mediaImage from './media-image.vue';
import mediaImageDialog from './media-image-dialog.vue';
import mediaVideo from './media-video.vue';
import notifications from './notifications.vue';
import noteForm from './post-form.vue';
@@ -39,7 +38,6 @@ Vue.component('mk-window', window);
Vue.component('mk-post-form-window', noteFormWindow);
Vue.component('mk-renote-form-window', renoteFormWindow);
Vue.component('mk-media-image', mediaImage);
Vue.component('mk-media-image-dialog', mediaImageDialog);
Vue.component('mk-media-video', mediaVideo);
Vue.component('mk-notifications', notifications);
Vue.component('mk-post-form', noteForm);

View File

@@ -17,7 +17,7 @@
<script lang="ts">
import Vue from 'vue';
import MkMediaImageDialog from './media-image-dialog.vue';
import ImageViewer from '../../../common/views/components/image-viewer.vue';
export default Vue.extend({
props: {
@@ -58,7 +58,7 @@ export default Vue.extend({
},
onClick() {
(this as any).os.new(MkMediaImageDialog, {
(this as any).os.new(ImageViewer, {
image: this.image
});
}

View File

@@ -5,11 +5,12 @@
<span>%i18n:@click-to-show%</span>
</div>
</div>
<a class="gqnyydlzavusgskkfvwvjiattxdzsqlf" v-else :href="image.url" target="_blank" :style="style" :title="image.name"></a>
<a class="gqnyydlzavusgskkfvwvjiattxdzsqlf" v-else :href="image.url" target="_blank" :style="style" :title="image.name" @click.prevent="onClick"></a>
</template>
<script lang="ts">
import Vue from 'vue';
import ImageViewer from '../../../common/views/components/image-viewer.vue';
export default Vue.extend({
props: {
@@ -41,6 +42,13 @@ export default Vue.extend({
'background-image': url
};
}
},
methods: {
onClick() {
(this as any).os.new(ImageViewer, {
image: this.image
});
}
}
});
</script>

View File

@@ -11,10 +11,9 @@ export type TextElementTitle = {
export default function(text: string, isBegin: boolean) {
const match = isBegin ? text.match(/^(【|\[)(.+?)(】|])\n/) : text.match(/^\n(【|\[)(.+?)(】|])\n/);
if (!match) return null;
const title = match[0];
return {
type: 'title',
content: title,
title: title.substr(1, title.length - 3)
content: match[0],
title: match[2]
} as TextElementTitle;
}

View File

@@ -2,6 +2,7 @@ import Meta, { IMeta } from '../models/meta';
const defaultMeta: any = {
name: 'Misskey',
maintainer: {},
langs: [],
cacheRemoteFiles: true,
localDriveCapacityMb: 256,

View File

@@ -88,6 +88,12 @@ export default define(meta, (ps, me) => new Promise(async (res, rej) => {
response.hidedTags = instance.hidedTags;
response.recaptchaSecretKey = instance.recaptchaSecretKey;
response.proxyAccount = instance.proxyAccount;
response.enableTwitterIntegration = instance.enableTwitterIntegration;
response.twitterConsumerKey = instance.twitterConsumerKey;
response.twitterConsumerSecret = instance.twitterConsumerSecret;
response.enableGithubIntegration = instance.enableGithubIntegration;
response.githubClientId = instance.githubClientId;
response.githubClientSecret = instance.githubClientSecret;
}
res(response);

View File

@@ -213,40 +213,47 @@ describe('Text', () => {
it('search', () => {
const tokens1 = analyze('a b c 検索');
assert.deepEqual([
{ type: 'search', content: 'a b c 検索', query: 'a b c'}
{ type: 'search', content: 'a b c 検索', query: 'a b c' }
], tokens1);
const tokens2 = analyze('a b c Search');
assert.deepEqual([
{ type: 'search', content: 'a b c Search', query: 'a b c'}
{ type: 'search', content: 'a b c Search', query: 'a b c' }
], tokens2);
const tokens3 = analyze('a b c search');
assert.deepEqual([
{ type: 'search', content: 'a b c search', query: 'a b c'}
{ type: 'search', content: 'a b c search', query: 'a b c' }
], tokens3);
const tokens4 = analyze('a b c SEARCH');
assert.deepEqual([
{ type: 'search', content: 'a b c SEARCH', query: 'a b c'}
{ type: 'search', content: 'a b c SEARCH', query: 'a b c' }
], tokens4);
});
it('title', () => {
const tokens1 = analyze('【yee】\nhaw');
assert.deepEqual(
{ type: 'title', content: '【yee】\n', title: 'yee'}
{ type: 'title', content: '【yee】\n', title: 'yee' }
, tokens1[0]);
const tokens2 = analyze('[yee]\nhaw');
assert.deepEqual(
{ type: 'title', content: '[yee]\n', title: 'yee'}
{ type: 'title', content: '[yee]\n', title: 'yee' }
, tokens2[0]);
const tokens3 = analyze('a [a]\nb [b]\nc [c]');
assert.deepEqual(
{ type: 'text', content: 'a [a]\nb [b]\nc [c]' }
, tokens3[0]);
const tokens4 = analyze('foo\n【bar】\nbuzz');
assert.deepEqual([
{ type: 'text', content: 'foo' },
{ type: 'title', content: '\n【bar】\n', title: 'bar' },
{ type: 'text', content: 'buzz' },
], tokens4);
});
});