Skip to content

Commit

Permalink
Merge pull request #694 from koedame/release/v1.13.0
Browse files Browse the repository at this point in the history
Release/v1.13.0
  • Loading branch information
unchidev authored Jun 8, 2021
2 parents c74f68c + 681ed29 commit 9de2661
Show file tree
Hide file tree
Showing 9 changed files with 502 additions and 269 deletions.
23 changes: 23 additions & 0 deletions CHANGELOGS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,30 @@
# CHANGELOGS

## v1.13.0

### 変更

- パスワード保存機能追加

### 依存パッケージ

- @babel/preset-env from 7.14.2 to 7.14.4
- @types/node from 15.6.1 to 15.12.0
- @vue/composition-api from 1.0.0-rc.9 to 1.0.0-rc.10
- core-js from 3.12.1 to 3.13.1
- eslint-plugin-import from 2.23.3 to 2.23.4
- eslint-plugin-vue from 7.9.0 to 7.10.0
- sass from 1.34.0 to 1.34.1
- sass-loader from 11.1.1 to 12.0.0
- twemoji from 13.0.2 to 13.1.0
- typescript from 4.2.4 to 4.3.2
- vue and vue-template-compiler
- webpack from 5.37.1 to 5.38.1

## v1.12.0

### 変更

- 絵文字をTwemojiに置き換え

### 依存パッケージ
Expand Down
488 changes: 247 additions & 241 deletions package-lock.json

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "syncroom-plus",
"version": "1.12.0",
"version": "1.13.0",
"author": "",
"engines": {
"node": ">=10"
Expand All @@ -20,58 +20,58 @@
"@fortawesome/fontawesome-svg-core": "^1.2.35",
"@fortawesome/free-solid-svg-icons": "^5.15.3",
"@fortawesome/vue-fontawesome": "^2.0.0",
"@vue/composition-api": "^1.0.0-rc.9",
"@vue/composition-api": "^1.0.0-rc.10",
"axios": "^0.21.1",
"buefy": "^0.9.7",
"twemoji": "^13.0.2",
"vue": "^2.6.12",
"twemoji": "^13.1.0",
"vue": "^2.6.13",
"vue-i18n": "^8.24.4",
"vue-moment": "^4.1.0",
"vuex": "^3.6.2"
},
"devDependencies": {
"@babel/core": "^7.14.3",
"@babel/plugin-proposal-optional-chaining": "^7.13.12",
"@babel/preset-env": "^7.14.2",
"@babel/preset-env": "^7.14.4",
"@babel/runtime-corejs3": "^7.14.0",
"@types/node": "^15.6.1",
"@types/node": "^15.12.0",
"@types/webpack": "^5.28.0",
"archiver": "^5.3.0",
"babel-eslint": "^10.0.3",
"babel-loader": "^8.2.2",
"copy-webpack-plugin": "^9.0.0",
"core-js": "^3.12.1",
"core-js": "^3.13.1",
"cross-env": "^7.0.3",
"css-loader": "^5.2.6",
"eslint": "^7.27.0",
"eslint-config-prettier": "^8.3.0",
"eslint-config-standard": "^16.0.3",
"eslint-friendly-formatter": "^4.0.1",
"eslint-loader": "^4.0.2",
"eslint-plugin-import": "^2.23.3",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-standard": "^5.0.0",
"eslint-plugin-vue": "^7.9.0",
"eslint-plugin-vue": "^7.10.0",
"fibers": "^5.0.0",
"file-loader": "^6.2.0",
"mini-css-extract-plugin": "^1.6.0",
"prettier": "^2.3.0",
"pretty-quick": "^3.1.0",
"pug": "^3.0.2",
"pug-plain-loader": "^1.1.0",
"sass": "^1.34.0",
"sass-loader": "^11.1.1",
"sass": "^1.34.1",
"sass-loader": "^12.0.0",
"ts-loader": "^8.1.0",
"ts-node": "^10.0.0",
"tslint": "^6.1.3",
"typescript": "^4.2.4",
"typescript": "^4.3.2",
"vue-loader": "^15.9.7",
"vue-template-compiler": "^2.6.12",
"vue-template-compiler": "^2.6.13",
"web-ext-types": "^3.2.1",
"webextension-polyfill-ts": "^0.25.0",
"webpack": "^5.37.1",
"webpack": "^5.38.1",
"webpack-cli": "^4.7.0",
"webpack-extension-reloader": "^1.1.0"
}
Expand Down
39 changes: 39 additions & 0 deletions src/content_script/components/Config.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
b-switch(v-model="configAnimation", type="is-info", @input="onInputAnimation")
| {{ translate('animation') }}

b-switch(v-model="configRememberPassword", type="is-info", @input="onInputRememberPassword")
| {{ translate('remember_password') }}

hr

.subtitle
Expand Down Expand Up @@ -63,6 +66,16 @@
b-table-column(:label="translate('action')", v-slot="props")
b-button(type="is-danger", size="is-small", icon-left="trash", @click="confirmRemoveNotification(props.row.memberName)")
| {{ translate("remove") }}

hr
.subtitle
b-icon(icon="info-circle")
|
| {{ translate("other") }}

b-button(type="is-danger", icon-left="trash", @click="onResetPasswords")
| {{ translate("remove_remember_passwords") }}

.modal-card-foot
b-button(@click="$emit('close')", icon-left="times") {{ translate("close") }}
</template>
Expand All @@ -83,6 +96,10 @@ export default defineComponent({
store.dispatch('config/setAnimation', value);
};
const onInputRememberPassword = (value: boolean) => {
store.dispatch('config/setRememberPassword', value);
};
const confirmRemoveFavorite = (memberName: string) => {
Dialog.confirm({
title: translate('unfavorite_user?'),
Expand Down Expand Up @@ -129,16 +146,38 @@ export default defineComponent({
return store.getters['notificationOnlineMembers/members'];
});
const onResetPasswords = () => {
Dialog.confirm({
title: translate('do_you_want_to_remove_the_passwords'),
message: translate('remove_the_saved_password_this_operation_cannot_be_undone'),
confirmText: translate('remove'),
cancelText: translate('close'),
type: 'is-danger',
hasIcon: true,
onConfirm: async () => {
store.dispatch('config/resetRememberPasswords').then((res) => {
Toast.open({
message: translate('password_has_been_deleted'),
type: 'is-success',
});
});
},
});
};
return {
configAutoReload: store.getters['config/autoReload'],
configAnimation: store.getters['config/animation'],
configRememberPassword: store.getters['config/rememberPassword'],
onInputAutoReload,
onInputAnimation,
onInputRememberPassword,
confirmRemoveFavorite,
confirmRemoveNotification,
favoriteMembers,
notificationOnlineMembers,
translate,
onResetPasswords,
};
},
});
Expand Down
106 changes: 106 additions & 0 deletions src/content_script/components/PasswordPrompt.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
<template lang="pug">
.modal-card
.modal-card-head
.modal-card-title
b-icon.mr-1(icon="lock")
| {{translate('please_enter_room_password')}}
.modal-card-body
b-field(:label="translate('room_name')")
b-input(:placeholder="translate('room_name')", readonly, :value="roomName", disabled)

form(@submit.prevent="onJoin")
b-field.mb-5(
:label="translate('password')",
:type="{ 'is-danger': hasError }",
)
b-input.password(v-model="password", type="is-info", :placeholder="translate('password')", ref="passwordElement", minlength="1", required, @input="savePassword")

.level
.level-left
b-button(@click="$emit('close')", icon-left="times") {{ translate("close") }}
.level-right
b-button(@click="onJoin", type="is-info", :disabled="hasError")
template(v-if="temporaly")
| {{translate('temporary_entry')}}
template(v-else)
| {{translate('join')}}
</template>

<script lang="ts">
import { defineComponent, ref, onMounted, SetupContext, computed } from '@vue/composition-api';
import { translate } from '../../lib/i18n';
import makeJoinUri from '../../lib/make_join_uri';
import store from '../../store';
import { browser } from 'webextension-polyfill-ts';
type Props = {
roomName: string;
temporaly: boolean;
};
export default defineComponent({
props: {
roomName: {
type: String,
required: true,
},
temporaly: {
type: Boolean,
required: true,
},
},
setup(props: Props, context: SetupContext) {
const passwordElement = ref(null);
onMounted(() => {
passwordElement.value.focus();
});
const password = ref('');
if (store.getters['config/rememberPassword']) {
browser.storage.local.get('roomPasswords').then(({ roomPasswords }) => {
if (typeof roomPasswords !== 'undefined' && roomPasswords[props.roomName]) {
password.value = roomPasswords[props.roomName];
}
});
}
const savePassword = () => {
if (store.getters['config/rememberPassword']) {
browser.storage.local.get('roomPasswords').then(({ roomPasswords }) => {
if (typeof roomPasswords === 'undefined') {
roomPasswords = {};
}
roomPasswords[props.roomName] = password.value;
browser.storage.local.set({
roomPasswords: roomPasswords,
});
});
}
};
const onJoin = () => {
savePassword();
location.href = makeJoinUri(props.roomName, password.value, props.temporaly);
context.emit('close');
};
const hasError = computed(() => {
return password.value.length < 1;
});
return {
hasError,
translate,
password,
onJoin,
passwordElement,
savePassword,
};
},
});
</script>
30 changes: 19 additions & 11 deletions src/content_script/components/RoomCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
.level
.level-left
b-button(type="is-light" @click="onOpenTentativeSyncroom")
| {{translate("take_a_peek")}}
| {{translate("temporary_entry")}}

.level-right
b-button.card__body__buttons__entry-button(v-if="needPasswd", type="is-dark" @click="onOpenSyncroom", icon-left="lock")
Expand All @@ -47,10 +47,12 @@ import { defineComponent, computed } from '@vue/composition-api';
import twemoji from 'twemoji';
import Members from './Members';
import PasswordPrompt from './PasswordPrompt';
import store from '../../store';
import makeJoinUri from '../../lib/make_join_uri';
import { translate } from '../../lib/i18n';
import { ModalProgrammatic as Modal } from 'buefy';
type Props = {
createTime: string;
Expand Down Expand Up @@ -114,23 +116,29 @@ export default defineComponent({
const onOpenSyncroom = () => {
if (props.needPasswd) {
const pwPrompt = window.prompt(translate('please_enter_room_password'), '');
if (pwPrompt) {
location.href = makeJoinUri(props.roomName, pwPrompt, false);
}
Modal.open({
component: PasswordPrompt,
props: {
roomName: props.roomName,
temporaly: false,
},
hasModalCard: true,
});
} else {
location.href = makeJoinUri(props.roomName, '', false);
}
};
const onOpenTentativeSyncroom = () => {
if (props.needPasswd) {
const pwPrompt = window.prompt(translate('please_enter_room_password'), '');
if (pwPrompt) {
location.href = makeJoinUri(props.roomName, pwPrompt, true);
}
Modal.open({
component: PasswordPrompt,
props: {
roomName: props.roomName,
temporaly: true,
},
hasModalCard: true,
});
} else {
location.href = makeJoinUri(props.roomName, '', true);
}
Expand Down
Loading

0 comments on commit 9de2661

Please sign in to comment.