Compare commits

..

18 Commits

Author SHA1 Message Date
syuilo 359da9a5a1 8.17.0 2018-09-01 09:44:15 +09:00
syuilo 2a235151ed #2236 #2237 2018-09-01 09:42:25 +09:00
syuilo 9e318d5ebc Fix bug 2018-09-01 09:29:59 +09:00
syuilo 6819eb3b4d Improve usability 2018-09-01 09:16:25 +09:00
syuilo 4c6fb60dd2 #2541 2018-09-01 08:13:18 +09:00
syuilo bffb9a5c45 #2447 #1958 2018-09-01 08:09:21 +09:00
syuilo dca4053a67 Merge branch 'master' into develop 2018-09-01 07:33:34 +09:00
syuilo fd07f00d14 #2551 2018-09-01 07:33:04 +09:00
syuilo bbeb6d534e Merge pull request #2557 from Hiramiya/darkmode
Fix darkmode on followers-you-may-know
2018-09-01 07:15:22 +09:00
Nasha Hiramiya 63b8af4531 Fix darkmode on followers-you-may-know 2018-08-31 20:42:20 +01:00
syuilo e89e76076a Merge pull request #2555 from mei23/mei-0831-vali3
HTTP Signature ホスト検証エラーメッセージの調整
2018-08-31 18:07:08 +09:00
mei23 18b4f74cdb Improve validation error message 2018-08-31 16:46:24 +09:00
syuilo e53dde385c Merge pull request #2549 from syuilo/greenkeeper/@types/node-10.9.4
Update @types/node to the latest version 🚀
2018-08-31 07:00:46 +09:00
syuilo 6a7a4c20e6 Merge pull request #2550 from Hiramiya/fix-invalidfiletype
Fix broken invalid-filetype behaviour
2018-08-31 07:00:31 +09:00
Nasha Hiramiya 6434dac04d Add return for invalid filetypes, fixes wrong behaviour 2018-08-30 21:04:20 +01:00
Nasha Hiramiya 5deb1bf40e Merge remote-tracking branch 'upstream/develop' into develop 2018-08-30 21:03:00 +01:00
greenkeeper[bot] 9cd334576c fix(package): update @types/node to version 10.9.4 2018-08-30 16:41:33 +00:00
Hiramiya 85188b5de2 Merge pull request #3 from syuilo/develop
match main repo
2018-08-28 09:08:15 +01:00
21 changed files with 168 additions and 74 deletions
+2
View File
@@ -285,6 +285,8 @@ common/views/components/nav.vue:
feedback: "フィードバック"
common/views/components/note-menu.vue:
detail: "詳細"
copy-link: "リンクをコピー"
favorite: "お気に入り"
pin: "ピン留め"
delete: "削除"
+4 -3
View File
@@ -1,8 +1,8 @@
{
"name": "misskey",
"author": "syuilo <i@syuilo.com>",
"version": "8.16.0",
"clientVersion": "1.0.9191",
"version": "8.17.0",
"clientVersion": "1.0.9212",
"codename": "nighthike",
"main": "./built/index.js",
"private": true,
@@ -60,7 +60,7 @@
"@types/mocha": "5.2.3",
"@types/mongodb": "3.1.4",
"@types/ms": "0.7.30",
"@types/node": "10.9.3",
"@types/node": "10.9.4",
"@types/portscanner": "2.1.0",
"@types/pug": "2.0.4",
"@types/qrcode": "1.2.0",
@@ -216,6 +216,7 @@
"vue-router": "3.0.1",
"vue-style-loader": "4.1.2",
"vue-template-compiler": "2.5.17",
"vue-thin-modal": "1.1.1",
"vuedraggable": "2.16.0",
"vuex": "3.0.1",
"vuex-persistedstate": "2.5.4",
+4 -1
View File
@@ -1,3 +1,6 @@
<template>
<router-view id="app"></router-view>
<div>
<router-view id="app"></router-view>
<modal-portal/>
</div>
</template>
@@ -3,7 +3,7 @@
@dragover.prevent.stop="onDragover"
@drop.prevent.stop="onDrop"
>
<div class="stream">
<div class="body">
<p class="init" v-if="init">%fa:spinner .spin%%i18n:common.loading%</p>
<p class="empty" v-if="!init && messages.length == 0">%fa:info-circle%%i18n:@empty%</p>
<p class="no-history" v-if="!init && messages.length > 0 && !existMoreMessages">%fa:flag%%i18n:@no-history%</p>
@@ -77,6 +77,12 @@ export default Vue.extend({
this.connection.on('message', this.onMessage);
this.connection.on('read', this.onRead);
if (this.isNaked) {
window.addEventListener('scroll', this.onScroll, { passive: true });
} else {
this.$el.addEventListener('scroll', this.onScroll, { passive: true });
}
document.addEventListener('visibilitychange', this.onVisibilitychange);
this.fetchMessages().then(() => {
@@ -90,6 +96,12 @@ export default Vue.extend({
this.connection.off('read', this.onRead);
this.connection.close();
if (this.isNaked) {
window.removeEventListener('scroll', this.onScroll);
} else {
this.$el.removeEventListener('scroll', this.onScroll);
}
document.removeEventListener('visibilitychange', this.onVisibilitychange);
},
@@ -226,6 +238,14 @@ export default Vue.extend({
}, 4000);
},
onScroll() {
const el = this.isNaked ? window.document.documentElement : this.$el;
const current = el.scrollTop + el.clientHeight;
if (current > el.scrollHeight - 1) {
this.showIndicator = false;
}
},
onVisibilitychange() {
if (document.hidden) return;
this.messages.forEach(message => {
@@ -251,7 +271,7 @@ root(isDark)
height 100%
background isDark ? #191b22 : #fff
> .stream
> .body
width 100%
max-width 600px
margin 0 auto
@@ -6,17 +6,27 @@
<script lang="ts">
import Vue from 'vue';
import { url } from '../../../config';
import copyToClipboard from '../../../common/scripts/copy-to-clipboard';
export default Vue.extend({
props: ['note', 'source', 'compact'],
computed: {
items() {
const items = [];
items.push({
const items = [{
icon: '%fa:info-circle%',
text: '%i18n:@detail%',
action: this.detail
}, {
icon: '%fa:link%',
text: '%i18n:@copy-link%',
action: this.copyLink
}, null, {
icon: '%fa:star%',
text: '%i18n:@favorite%',
action: this.favorite
});
}];
if (this.note.userId == this.$store.state.i.id) {
items.push({
icon: '%fa:thumbtack%',
@@ -42,6 +52,14 @@ export default Vue.extend({
}
},
methods: {
detail() {
this.$router.push(`/notes/${ this.note.id }`);
},
copyLink() {
copyToClipboard(`${url}/notes/${ this.note.id }`);
},
pin() {
(this as any).api('i/pin', {
noteId: this.note.id
+1 -1
View File
@@ -16,7 +16,7 @@ export default (os: OS) => {
text: '%i18n:common.got-it%'
}]
});
reject();
return reject('invalid-filetype');
}
const w = os.new(CropWindow, {
+1 -1
View File
@@ -16,7 +16,7 @@ export default (os: OS) => {
text: '%i18n:common.got-it%'
}]
});
reject();
return reject('invalid-filetype');
}
const w = os.new(CropWindow, {
@@ -3,18 +3,20 @@
@dragover.prevent.stop="onDragover"
@dragenter.prevent="onDragenter"
@dragleave="onDragleave"
@drop.prevent.stop="onDrop"
>
@drop.prevent.stop="onDrop">
<header :class="{ indicate: count > 0 }"
draggable="true"
@click="toggleActive"
@click="goTop"
@dragstart="onDragstart"
@dragend="onDragend"
@contextmenu.prevent.stop="onContextmenu"
>
@contextmenu.prevent.stop="onContextmenu">
<button class="toggleActive" @click="toggleActive" v-if="isStacked">
<template v-if="active">%fa:angle-up%</template>
<template v-else>%fa:angle-down%</template>
</button>
<slot name="header"></slot>
<span class="count" v-if="count > 0">({{ count }})</span>
<button ref="menu" @click.stop="showMenu">%fa:caret-down%</button>
<button class="menu" ref="menu" @click.stop="showMenu">%fa:caret-down%</button>
</header>
<div ref="body" v-show="active">
<slot></slot>
@@ -211,6 +213,13 @@ export default Vue.extend({
});
},
goTop() {
this.$refs.body.scrollTo({
top: 0,
behavior: 'smooth'
});
},
onDragstart(e) {
e.dataTransfer.effectAllowed = 'move';
e.dataTransfer.setData('mk-deck-column', this.column.id);
@@ -302,6 +311,7 @@ root(isDark)
color #bbb
> header
display flex
z-index 1
line-height $header-height
padding 0 16px
@@ -328,10 +338,8 @@ root(isDark)
margin-left 4px
opacity 0.5
> button
position absolute
top 0
right 0
> .toggleActive
> .menu
width $header-height
line-height $header-height
font-size 16px
@@ -343,6 +351,13 @@ root(isDark)
&:active
color isDark ? #b2c1d5 : #999
> .toggleActive
margin-left -16px
> .menu
margin-left auto
margin-right -16px
> div
height "calc(100% - %s)" % $header-height
overflow auto
@@ -36,8 +36,9 @@ export default Vue.extend({
</script>
<style lang="stylus" scoped>
root(isDark)
.followers-you-know
background #fff
background isDark ? #282C37 : #fff
border solid 1px rgba(#000, 0.075)
border-radius 6px
@@ -48,7 +49,7 @@ export default Vue.extend({
line-height 42px
font-size 0.9em
font-weight bold
color #888
color isDark ? #e3e5e8 : #888
box-shadow 0 1px rgba(#000, 0.07)
> i
+5
View File
@@ -11,6 +11,8 @@ import VAnimateCss from 'v-animate-css';
import Element from 'element-ui';
import ElementLocaleEn from 'element-ui/lib/locale/lang/en';
import ElementLocaleJa from 'element-ui/lib/locale/lang/ja';
import VueThinModal from 'vue-thin-modal';
import 'vue-thin-modal/dist/vue-thin-modal.css';
import App from './app.vue';
import checkForUpdate from './common/scripts/check-for-update';
@@ -30,6 +32,9 @@ Vue.use(VModal);
Vue.use(TreeView);
Vue.use(VAnimateCss);
Vue.use(Element, { locale: elementLocale });
Vue.use(VueThinModal, {
autoMountPortal: false
});
// Register global directives
require('./common/views/directives');
-24
View File
@@ -1,24 +0,0 @@
import PostForm from '../views/components/post-form.vue';
export default (os) => (opts) => {
const o = opts || {};
const app = document.getElementById('app');
app.style.display = 'none';
function recover() {
app.style.display = 'block';
}
const vm = new PostForm({
parent: os.app,
propsData: {
reply: o.reply,
renote: o.renote
}
}).$mount();
vm.$once('cancel', recover);
vm.$once('posted', recover);
document.body.appendChild(vm.$el);
(vm as any).focus();
};
+1 -2
View File
@@ -14,7 +14,6 @@ import chooseDriveFolder from './api/choose-drive-folder';
import chooseDriveFile from './api/choose-drive-file';
import dialog from './api/dialog';
import input from './api/input';
import post from './api/post';
import notify from './api/notify';
import MkIndex from './views/pages/index.vue';
@@ -91,7 +90,7 @@ init((launch) => {
chooseDriveFile,
dialog: dialog(os),
input,
post: post(os),
post: () => alert('deprecated'),
notify
}));
}, true);
+10
View File
@@ -17,3 +17,13 @@ body
display flex
flex-direction column
min-height 100%
.modal-backdrop
z-index 10000 !important
.modal-content-wrapper
z-index 10001 !important
.modal-content
padding 0 !important
background-color transparent !important
@@ -48,7 +48,7 @@ export default Vue.extend({
<style lang="stylus" scoped>
.mk-drive-file-chooser
position fixed
z-index 2048
z-index 20000
top 0
left 0
width 100%
@@ -75,6 +75,13 @@
<div class="replies" v-if="!compact">
<x-sub v-for="note in replies" :key="note.id" :note="note"/>
</div>
<modal name="replyForm">
<mk-post-form @posted="replyFormClosed" @cancel="replyFormClosed" :reply="p"/>
</modal>
<modal name="renoteForm">
<mk-post-form @posted="renoteFormClosed" @cancel="renoteFormClosed" :renote="p"/>
</modal>
</div>
</template>
@@ -116,9 +123,11 @@ export default Vue.extend({
this.note.mediaIds.length == 0 &&
this.note.poll == null);
},
p(): any {
return this.isRenote ? this.note.renote : this.note;
},
reactionsCount(): number {
return this.p.reactionCounts
? Object.keys(this.p.reactionCounts)
@@ -126,6 +135,7 @@ export default Vue.extend({
.reduce((a, b) => a + b)
: 0;
},
urls(): string[] {
if (this.p.text) {
const ast = parse(this.p.text);
@@ -180,16 +190,23 @@ export default Vue.extend({
this.conversation = conversation.reverse();
});
},
reply() {
(this as any).apis.post({
reply: this.p
});
this.$modal.push('replyForm');
},
replyFormClosed() {
this.$modal.pop();
},
renote() {
(this as any).apis.post({
renote: this.p
});
this.$modal.push('renoteForm');
},
renoteFormClosed() {
this.$modal.pop();
},
react() {
(this as any).os.new(MkReactionPicker, {
source: this.$refs.reactButton,
@@ -198,6 +215,7 @@ export default Vue.extend({
big: true
});
},
menu() {
(this as any).os.new(MkNoteMenu, {
source: this.$refs.menuButton,
@@ -60,6 +60,13 @@
</footer>
</div>
</article>
<modal name="replyForm">
<mk-post-form @posted="replyFormClosed" @cancel="replyFormClosed" :reply="p"/>
</modal>
<modal name="renoteForm">
<mk-post-form @posted="renoteFormClosed" @cancel="renoteFormClosed" :renote="p"/>
</modal>
</div>
</template>
@@ -195,15 +202,19 @@ export default Vue.extend({
},
reply() {
(this as any).apis.post({
reply: this.p
});
this.$modal.push('replyForm');
},
replyFormClosed() {
this.$modal.pop();
},
renote() {
(this as any).apis.post({
renote: this.p
});
this.$modal.push('renoteForm');
},
renoteFormClosed() {
this.$modal.pop();
},
react() {
@@ -293,9 +293,6 @@ export default Vue.extend({
viaMobile: viaMobile
}).then(data => {
this.$emit('posted');
this.$nextTick(() => {
this.$destroy();
});
}).catch(err => {
this.posting = false;
});
@@ -309,7 +306,6 @@ export default Vue.extend({
cancel() {
this.$emit('cancel');
this.$destroy();
},
kao() {
+9 -1
View File
@@ -42,6 +42,10 @@
<mk-user-list-timeline v-if="src == 'list'" ref="tl" :key="list.id" :list="list"/>
</div>
</main>
<modal name="postForm">
<mk-post-form @posted="postFormClosed" @cancel="postFormClosed"/>
</modal>
</mk-ui>
</template>
@@ -107,7 +111,11 @@ export default Vue.extend({
methods: {
fn() {
(this as any).apis.post();
this.$modal.push('postForm');
},
postFormClosed() {
this.$modal.pop();
},
saveSrc() {
+6 -3
View File
@@ -38,7 +38,7 @@ export default async (job: bq.Job, done: any): Promise<void> => {
try {
ValidateActivity(activity, host);
} catch (e) {
console.warn(e);
console.warn(e.message);
done();
return;
}
@@ -55,7 +55,7 @@ export default async (job: bq.Job, done: any): Promise<void> => {
try {
ValidateActivity(activity, host);
} catch (e) {
console.warn(e);
console.warn(e.message);
done();
return;
}
@@ -100,7 +100,10 @@ function ValidateActivity(activity: any, host: string) {
// id (if exists)
if (typeof activity.id === 'string') {
const uriHost = toUnicode(new URL(activity.id).hostname.toLowerCase());
if (host !== uriHost) throw new Error('activity.id has different host');
if (host !== uriHost) {
const diag = activity.signature ? '. Has LD-Signature. Forwarded?' : '';
throw new Error(`activity.id(${activity.id}) has different host(${host})${diag}`);
}
}
// actor (if exists)
+10 -3
View File
@@ -1,6 +1,7 @@
import $ from 'cafy';
import Subscription from '../../../../models/sw-subscription';
import { ILocalUser } from '../../../../models/user';
import config from '../../../../config';
export const meta = {
requireCredential: true
@@ -31,8 +32,11 @@ export default async (params: any, user: ILocalUser) => new Promise(async (res,
deletedAt: { $exists: false }
});
if (exist !== null) {
return res();
if (exist != null) {
return res({
state: 'already-subscribed',
key: config.sw.public_key
});
}
await Subscription.insert({
@@ -42,5 +46,8 @@ export default async (params: any, user: ILocalUser) => new Promise(async (res,
publickey: publickey
});
res();
res({
state: 'subscribed',
key: config.sw.public_key
});
});
+2 -1
View File
@@ -5,6 +5,7 @@
import * as fs from 'fs';
import * as webpack from 'webpack';
import chalk from 'chalk';
import rndstr from 'rndstr';
const { VueLoaderPlugin } = require('vue-loader');
const jsonImporter = require('node-sass-json-importer');
const minifyHtml = require('html-minifier').minify;
@@ -19,7 +20,7 @@ const constants = require('./src/const.json');
const locales = require('./locales');
const meta = require('./package.json');
const version = meta.clientVersion;
const version = meta.clientVersion + '-' + rndstr({ length: 8, chars: '0-9a-z' });
const codename = meta.codename;
declare var global: {