Compare commits

...

11 Commits

Author SHA1 Message Date
syuilo
a23b8cebbc 8.54.0 2018-09-19 02:41:09 +09:00
greenkeeper[bot]
89f6b03cd6 fix(package): update web-push to version 3.3.3 (#2733) 2018-09-19 02:39:57 +09:00
greenkeeper[bot]
7bc9de03a6 fix(package): update webpack to version 4.19.1 (#2732) 2018-09-19 02:39:15 +09:00
syuilo
3c865d6054 Add new shortcut 2018-09-19 02:35:32 +09:00
syuilo
fd770b008e Add new shortcut 2018-09-19 02:32:44 +09:00
syuilo
b0d60ef2c2 Add new shortcut 2018-09-19 02:27:19 +09:00
syuilo
7b9cea06ef Fix 2018-09-19 02:26:06 +09:00
syuilo
30608d3e22 8.53.0 2018-09-18 16:45:55 +09:00
syuilo
8bf4e55338 Improve keyboard shortcuts 2018-09-18 16:45:20 +09:00
syuilo
6ead1de383 Improve readability 2018-09-18 15:02:26 +09:00
syuilo
3b628ec3c4 将来的にバグに繋がりかねない挙動を修正 2018-09-18 15:02:15 +09:00
7 changed files with 39 additions and 20 deletions

View File

@@ -1,8 +1,8 @@
{
"name": "misskey",
"author": "syuilo <i@syuilo.com>",
"version": "8.52.0",
"clientVersion": "1.0.9894",
"version": "8.54.0",
"clientVersion": "1.0.9905",
"codename": "nighthike",
"main": "./built/index.js",
"private": true,
@@ -217,9 +217,9 @@
"vuewordcloud": "18.7.11",
"vuex": "3.0.1",
"vuex-persistedstate": "2.5.4",
"web-push": "3.3.2",
"web-push": "3.3.3",
"webfinger.js": "2.6.6",
"webpack": "4.19.0",
"webpack": "4.19.1",
"webpack-cli": "3.1.0",
"websocket": "1.0.26",
"ws": "6.0.0",

View File

@@ -22,7 +22,10 @@ const getKeyMap = keymap => Object.entries(keymap).map(([patterns, callback]): a
result.patterns = patterns.split('|').map(part => {
const pattern = {
which: []
which: [],
ctrl: false,
alt: false,
shift: false
} as pattern;
part.trim().split('+').forEach(key => {
@@ -66,10 +69,10 @@ export default {
if (el._hotkey_global && targetReservedKeys.includes(`'${key}'`)) break;
const matched = action.patterns.some(pattern => {
let matched = pattern.which.includes(key);
if (pattern.ctrl && !e.ctrlKey) matched = false;
if (pattern.shift && !e.shiftKey) matched = false;
if (pattern.alt && !e.altKey) matched = false;
const matched = pattern.which.includes(key) &&
pattern.ctrl == e.ctrlKey &&
pattern.shift == e.shiftKey &&
pattern.alt == e.altKey;
if (matched) {
e.preventDefault();

View File

@@ -2,9 +2,9 @@
<div class="onchrpzrvnoruiaenfcqvccjfuupzzwv">
<div class="backdrop" ref="backdrop" @click="close"></div>
<div class="popover" :class="{ hukidasi }" ref="popover">
<template v-for="item in items">
<template v-for="item, i in items">
<div v-if="item === null"></div>
<button v-if="item" @click="clicked(item.action)" v-html="item.icon ? item.icon + ' ' + item.text : item.text"></button>
<button v-if="item" @click="clicked(item.action)" v-html="item.icon ? item.icon + ' ' + item.text : item.text" :tabindex="i"></button>
</template>
</div>
</div>

View File

@@ -97,10 +97,10 @@ export default Vue.extend({
watch: {
focus(i) {
this.$refs.buttons.childNodes[i].focus();
this.$refs.buttons.children[i].focus();
if (this.showFocus) {
this.title = this.$refs.buttons.childNodes[i].title;
this.title = this.$refs.buttons.children[i].title;
}
}
},

View File

@@ -51,7 +51,7 @@
<button class="reactionButton" :class="{ reacted: p.myReaction != null }" @click="react()" ref="reactButton" title="%i18n:@add-reaction%">
%fa:plus%<p class="count" v-if="p.reactions_count > 0">{{ p.reactions_count }}</p>
</button>
<button @click="menu" ref="menuButton">
<button @click="menu()" ref="menuButton">
%fa:ellipsis-h%
</button>
<!-- <button title="%i18n:@detail">
@@ -114,11 +114,14 @@ export default Vue.extend({
keymap(): any {
return {
'r|left': () => this.reply(true),
'a|plus': () => this.react(true),
'ctrl+q|ctrl+right': this.renoteDirectly,
'e|a|plus': () => this.react(true),
'q|right': () => this.renote(true),
'ctrl+q|ctrl+right': this.renoteDirectly,
'up|k|shift+tab': this.focusBefore,
'down|j|tab': this.focusAfter,
'esc': this.blur,
'm|o': () => this.menu(true),
's': this.toggleShowContent,
'1': () => this.reactDirectly('like'),
'2': () => this.reactDirectly('love'),
'3': () => this.reactDirectly('laugh'),
@@ -278,13 +281,18 @@ export default Vue.extend({
});
},
menu() {
menu(viaKeyboard = false) {
(this as any).os.new(MkNoteMenu, {
source: this.$refs.menuButton,
note: this.p
note: this.p,
animation: !viaKeyboard
}).$once('closed', this.focus);
},
toggleShowContent() {
this.showContent = !this.showContent;
},
focus() {
this.$el.focus();
},

View File

@@ -28,7 +28,7 @@ export default Vue.extend({
props: {
reply: {
type: Object,
required: true
required: false
},
animation: {

View File

@@ -1,5 +1,5 @@
<template>
<div class="notifications">
<div class="notifications" v-hotkey.global="keymap">
<button :data-active="isOpen" @click="toggle" title="%i18n:@title%">
%fa:R bell%<template v-if="hasUnreadNotification">%fa:circle%</template>
</button>
@@ -19,11 +19,19 @@ export default Vue.extend({
isOpen: false
};
},
computed: {
hasUnreadNotification(): boolean {
return this.$store.getters.isSignedIn && this.$store.state.i.hasUnreadNotification;
},
keymap(): any {
return {
'shift+n': this.toggle
};
}
},
methods: {
toggle() {
this.isOpen ? this.close() : this.open();