Compare commits

...

11 Commits

Author SHA1 Message Date
syuilo
3e146d5f94 2.16.5 2018-05-24 06:09:24 +09:00
syuilo
cb5c0ac2f5 Fix bug 2018-05-24 06:08:23 +09:00
syuilo
4798657b70 Refactor 2018-05-24 05:57:27 +09:00
syuilo
f565e60bcf Darken 2018-05-24 05:46:09 +09:00
syuilo
89461c598f Refactor 2018-05-24 05:28:46 +09:00
syuilo
b320d08a5e 🎨 2018-05-24 04:56:58 +09:00
syuilo
a930d4fc7b Fix bug 2018-05-24 04:55:29 +09:00
syuilo
d42197fc2e Merge pull request #1642 from syuilo/l10n_master
New Crowdin translations
2018-05-23 20:52:32 +09:00
syuilo
2d3138af76 New translations ja.yml (English) 2018-05-23 20:51:44 +09:00
syuilo
4ee4b6f332 Update docs 2018-05-23 19:03:25 +09:00
syuilo
fc6c048fad Update setup.ja.md 2018-05-23 19:00:23 +09:00
21 changed files with 198 additions and 139 deletions

View File

@@ -43,13 +43,7 @@ Please install and setup these softwares:
*4.* Prepare configuration
----------------------------------------------------------------
1. Copy `example.yml` of `.config` directory
2. Rename it to `default.yml`
3. Edit it
---
Or you can generate config file via `npm run config` command.
You need to generate config file via `npm run config` command.
*5.* Build Misskey
----------------------------------------------------------------

View File

@@ -43,18 +43,14 @@ web-push generate-vapid-keys
*4.* 設定ファイルを用意する
----------------------------------------------------------------
1. `.config`ディレクトリ内の`example.yml`をコピー
2. `default.yml`にリネーム
3. 編集する
---
または、`npm run config`コマンドを利用して、ガイドに従って情報を
入力して設定ファイルを生成することもできます。
`npm run config`コマンドを利用して、ガイドに従って情報を入力してください。
*5.* Misskeyのビルド
----------------------------------------------------------------
1. `npm run build`
1. `npm install -g node-gyp`
2. `node-gyp configure`
3. `node-gyp build`
4. `npm run build`
*6.* 以上です!
----------------------------------------------------------------
@@ -78,4 +74,4 @@ VPSなどでビルドする時は、もしかしたらメモリが足りなく
3. npm run webpack
4. built/client をサーバーにアップロードする
5. サーバー上で、npm run gulp
6. 完了
6. 完了

View File

@@ -56,9 +56,9 @@ common/views/components/connect-failed.troubleshooter.vue:
no-network-desc: "Please make sure you are connected to the Network."
no-internet: "There is no Internet connection"
no-internet-desc: "Please make sure you are connected to the Internet."
no-server: "Unable to connect to the server"
no-server-desc: "The network connection of your PC is normal, but you could not connect to Misskey's server. There is a possibility that the server is either down or under maintenance, please try again later."
success: "Successfully connected to Misskey's server"
no-server: "Unable to connect to the Misskey server"
no-server-desc: "The network connection of your PC is normal, but you could not connect to the Misskey server. There is a possibility that the server is either down or under maintenance, please try again later."
success: "Successfully connected to the Misskey server"
success-desc: "It seems to be able to connect. Please reload the page."
flush: "Clean cache"
set-version: "Specify version"
@@ -417,7 +417,7 @@ desktop/views/components/settings.vue:
update-checking: "Checking for updates"
do-update: "Check for update"
update-settings: "Advanced settings"
prevent-update: "アップデートを延期する(非推奨)"
prevent-update: "Postpone updates (not recommended)"
prevent-update-desc: "You may reflect updates even if you select this setting. This setting is valid only this device."
no-updates: "No updates available"
no-updates-desc: "Your Misskey is up to date."

View File

@@ -1,8 +1,8 @@
{
"name": "misskey",
"author": "syuilo <i@syuilo.com>",
"version": "2.16.4",
"clientVersion": "1.0.5673",
"version": "2.16.5",
"clientVersion": "1.0.5684",
"codename": "nighthike",
"main": "./built/index.js",
"private": true,

View File

@@ -18,6 +18,14 @@
return;
}
//#region Load settings
let settings = null;
const vuex = localStorage.getItem('vuex');
if (vuex) {
settings = JSON.parse(vuex);
}
//#endregion
// Get the current url information
const url = new URL(location.href);
@@ -35,10 +43,8 @@
// The default language is English
if (!LANGS.includes(lang)) lang = 'en';
const vuex = localStorage.getItem('vuex');
if (vuex) {
const data = JSON.parse(vuex);
if (data.device.lang) lang = data.device.lang;
if (settings) {
if (settings.device.lang) lang = settings.device.lang;
}
//#endregion
@@ -68,8 +74,10 @@
}
// Dark/Light
if (localStorage.getItem('darkmode') == 'true') {
document.documentElement.setAttribute('data-darkmode', 'true');
if (settings) {
if (settings.device.darkmode) {
document.documentElement.setAttribute('data-darkmode', 'true');
}
}
// Script version

View File

@@ -197,7 +197,7 @@ export default Vue.extend({
<style lang="stylus" scoped>
@import '~const.styl'
.mk-messaging-form
root(isDark)
> textarea
cursor auto
display block
@@ -209,10 +209,10 @@ export default Vue.extend({
padding 8px
resize none
font-size 1em
color #000
color isDark ? #fff : #000
outline none
border none
border-top solid 1px #eee
border-top solid 1px isDark ? #4b5056 : #eee
border-radius 0
box-shadow none
background transparent
@@ -302,4 +302,10 @@ export default Vue.extend({
input[type=file]
display none
.mk-messaging-form[data-darkmode]
root(true)
.mk-messaging-form:not([data-darkmode])
root(false)
</style>

View File

@@ -59,8 +59,10 @@ export default Vue.extend({
</script>
<style lang="stylus" scoped>
.message
$me-balloon-color = #23A7B6
@import '~const.styl'
root(isDark)
$me-balloon-color = $theme-color
padding 10px 12px 10px 12px
background-color transparent
@@ -126,7 +128,7 @@ export default Vue.extend({
bottom -4px
left -12px
margin 0
color rgba(#000, 0.5)
color isDark ? rgba(#fff, 0.5) : rgba(#000, 0.5)
font-size 11px
> .content
@@ -187,7 +189,7 @@ export default Vue.extend({
display block
margin 2px 0 0 0
font-size 10px
color rgba(#000, 0.4)
color isDark ? rgba(#fff, 0.4) : rgba(#000, 0.4)
> [data-fa]
margin-left 4px
@@ -200,8 +202,9 @@ export default Vue.extend({
padding-left 66px
> .balloon
$color = isDark ? #2d3338 : #eee
float left
background #eee
background $color
&[data-no-text]
background transparent
@@ -209,10 +212,15 @@ export default Vue.extend({
&:not([data-no-text]):before
left -14px
border-top solid 8px transparent
border-right solid 8px #eee
border-right solid 8px $color
border-bottom solid 8px transparent
border-left solid 8px transparent
> .content
> .text
if isDark
color #fff
> footer
text-align left
@@ -241,7 +249,7 @@ export default Vue.extend({
> .content
> p.is-deleted
color rgba(255, 255, 255, 0.5)
color rgba(#fff, 0.5)
> .text >>>
&, *
@@ -254,4 +262,10 @@ export default Vue.extend({
> .baloon
opacity 0.5
.message[data-darkmode]
root(true)
.message:not([data-darkmode])
root(false)
</style>

View File

@@ -18,7 +18,11 @@
</template>
</div>
<footer>
<div ref="notifications" class="notifications"></div>
<transition name="fade">
<div class="new-message" v-show="showIndicator">
<button @click="onIndicatorClick">%fa:arrow-circle-down%%i18n:@new-message%</button>
</div>
</transition>
<x-form :user="user" ref="form"/>
</footer>
</div>
@@ -45,7 +49,9 @@ export default Vue.extend({
fetchingMoreMessages: false,
messages: [],
existMoreMessages: false,
connection: null
connection: null,
showIndicator: false,
timer: null
};
},
@@ -172,7 +178,7 @@ export default Vue.extend({
});
} else if (message.userId != (this as any).os.i.id) {
// Notify
this.notify('%i18n:@new-message%');
this.notifyNewMessage();
}
},
@@ -205,18 +211,18 @@ export default Vue.extend({
}
},
notify(message) {
const n = document.createElement('p') as any;
n.innerHTML = '%fa:arrow-circle-down%' + message;
n.onclick = () => {
this.scrollToBottom();
n.parentNode.removeChild(n);
};
(this.$refs.notifications as any).appendChild(n);
onIndicatorClick() {
this.showIndicator = false;
this.scrollToBottom();
},
setTimeout(() => {
n.style.opacity = 0;
setTimeout(() => n.parentNode.removeChild(n), 1000);
notifyNewMessage() {
this.showIndicator = true;
if (this.timer) clearTimeout(this.timer);
this.timer = setTimeout(() => {
this.showIndicator = false;
}, 4000);
},
@@ -238,11 +244,12 @@ export default Vue.extend({
<style lang="stylus" scoped>
@import '~const.styl'
.mk-messaging-room
root(isDark)
display flex
flex 1
flex-direction column
height 100%
background isDark ? #191b22 : #fff
> .stream
width 100%
@@ -267,7 +274,7 @@ export default Vue.extend({
padding 16px 8px 8px 8px
text-align center
font-size 0.8em
color rgba(#000, 0.4)
color rgba(isDark ? #fff : #000, 0.4)
[data-fa]
margin-right 4px
@@ -278,7 +285,7 @@ export default Vue.extend({
padding 16px
text-align center
font-size 0.8em
color rgba(#000, 0.4)
color rgba(isDark ? #fff : #000, 0.4)
[data-fa]
margin-right 4px
@@ -322,7 +329,7 @@ export default Vue.extend({
left 0
right 0
margin 0 auto
background rgba(#000, 0.1)
background rgba(isDark ? #fff : #000, 0.1)
> span
display inline-block
@@ -331,7 +338,7 @@ export default Vue.extend({
//font-weight bold
line-height 32px
color rgba(#000, 0.3)
background #fff
background isDark ? #191b22 : #fff
> footer
position -webkit-sticky
@@ -342,30 +349,32 @@ export default Vue.extend({
max-width 600px
margin 0 auto
padding 0
background rgba(255, 255, 255, 0.95)
background rgba(isDark ? #282c37 : #fff, 0.95)
background-clip content-box
> .notifications
> .new-message
position absolute
top -48px
width 100%
padding 8px 0
text-align center
&:empty
display none
> p
> button
display inline-block
margin 0
padding 0 12px 0 28px
padding 0 12px 0 30px
cursor pointer
line-height 32px
font-size 12px
color $theme-color-foreground
background $theme-color
border-radius 16px
transition opacity 1s ease
&:hover
background lighten($theme-color, 10%)
&:active
background darken($theme-color, 10%)
> [data-fa]
position absolute
@@ -374,4 +383,17 @@ export default Vue.extend({
line-height 32px
font-size 16px
.fade-enter-active, .fade-leave-active
transition opacity 0.1s
.fade-enter, .fade-leave-to
transition opacity 0.5s
opacity 0
.mk-messaging-room[data-darkmode]
root(true)
.mk-messaging-room:not([data-darkmode])
root(false)
</style>

View File

@@ -227,8 +227,7 @@ export default Vue.extend({
version,
langs,
latestVersion: undefined,
checkingForUpdate: false,
darkmode: localStorage.getItem('darkmode') == 'true'
checkingForUpdate: false
};
},
computed: {
@@ -246,6 +245,11 @@ export default Vue.extend({
set(value) { this.$store.commit('device/set', { key: 'autoPopout', value }); }
},
darkmode: {
get() { return this.$store.state.device.darkmode; },
set(value) { this.$store.commit('device/set', { key: 'darkmode', value }); }
},
enableSounds: {
get() { return this.$store.state.device.enableSounds; },
set(value) { this.$store.commit('device/set', { key: 'enableSounds', value }); }
@@ -276,11 +280,6 @@ export default Vue.extend({
set(value) { this.$store.commit('device/set', { key: 'enableExperimentalFeatures', value }); }
}
},
watch: {
darkmode() {
(this as any)._updateDarkmode_(this.darkmode);
}
},
created() {
(this as any).os.getMeta().then(meta => {
this.meta = meta;

View File

@@ -35,7 +35,7 @@
</ul>
<ul>
<li @click="dark">
<p><span>%i18n:@dark%</span><template v-if="_darkmode_">%fa:moon%</template><template v-else>%fa:R moon%</template></p>
<p><span>%i18n:@dark%</span><template v-if="$store.state.device.darkmode">%fa:moon%</template><template v-else>%fa:R moon%</template></p>
</li>
</ul>
</div>
@@ -99,7 +99,10 @@ export default Vue.extend({
(this as any).os.signout();
},
dark() {
(this as any)._updateDarkmode_(!(this as any)._darkmode_);
this.$store.commit('device/set', {
key: 'darkmode',
value: !this.$store.state.device.darkmode
});
}
}
});

View File

@@ -2,7 +2,7 @@
<mk-window ref="window" is-modal width="450px" height="500px" @closed="$destroy">
<span slot="header">%fa:list% リスト</span>
<div data-id="6e4caea3-d8f9-4ab7-96de-ab67fe8d5c82" :data-darkmode="_darkmode_">
<div data-id="6e4caea3-d8f9-4ab7-96de-ab67fe8d5c82" :data-darkmode="$store.state.device.darkmode">
<button class="ui" @click="add">%i18n:@create-list%</button>
<a v-for="list in lists" :key="list.id" @click="choice(list)">{{ list.title }}</a>
</div>

View File

@@ -21,10 +21,20 @@ export default Vue.extend({
$route: 'fetch'
},
created() {
const applyBg = v =>
document.documentElement.style.setProperty('background', v ? '#191b22' : '#fff', 'important');
applyBg(this.$store.state.device.darkmode);
this.unwatchDarkmode = this.$store.watch(s => {
return s.device.darkmode;
}, applyBg);
this.fetch();
},
mounted() {
document.documentElement.style.background = '#fff';
beforeDestroy() {
document.documentElement.style.removeProperty('background');
this.unwatchDarkmode();
},
methods: {
fetch() {
@@ -50,6 +60,5 @@ export default Vue.extend({
flex 1
flex-direction column
min-height 100%
background #fff
</style>

View File

@@ -1,11 +1,11 @@
<template>
<div class="mk-welcome">
<button @click="dark">
<template v-if="_darkmode_">%fa:moon%</template>
<template v-if="$store.state.device.darkmode">%fa:moon%</template>
<template v-else>%fa:R moon%</template>
</button>
<main>
<img :src="_darkmode_ ? 'assets/title-dark.svg' : 'assets/title.svg'" alt="Misskey">
<img :src="$store.state.device.darkmode ? 'assets/title-dark.svg' : 'assets/title.svg'" alt="Misskey">
<p><button class="signup" @click="signup">%i18n:@signup-button%</button><button class="signin" @click="signin">%i18n:@signin-button%</button></p>
<div class="tl">
@@ -50,7 +50,6 @@ export default Vue.extend({
this.$modal.show('signin');
},
dark() {
(this as any)._updateDarkmode_(!(this as any)._darkmode_);
}
}
});

View File

@@ -4,7 +4,7 @@
<template slot="header">%fa:chart-pie%%i18n:@title%</template>
<button slot="func" title="%i18n:@refresh%" @click="fetch">%fa:sync%</button>
<div class="mkw-polls--body" :data-darkmode="_darkmode_">
<div class="mkw-polls--body" :data-darkmode="$store.state.device.darkmode">
<div class="poll" v-if="!fetching && poll != null">
<p v-if="poll.text"><router-link to="poll | notePage">{{ poll.text }}</router-link></p>
<p v-if="!poll.text"><router-link to="poll | notePage">%fa:link%</router-link></p>

View File

@@ -49,48 +49,6 @@ Vue.mixin({
}
});
// Dark/Light
const bus = new Vue();
Vue.mixin({
data() {
return {
_darkmode_: localStorage.getItem('darkmode') == 'true'
};
},
beforeCreate() {
// なぜか警告が出るので
this._darkmode_ = localStorage.getItem('darkmode') == 'true';
},
beforeDestroy() {
bus.$off('updated', this._onDarkmodeUpdated_);
},
mounted() {
this._onDarkmodeUpdated_(this._darkmode_);
bus.$on('updated', this._onDarkmodeUpdated_);
},
methods: {
_updateDarkmode_(v) {
localStorage.setItem('darkmode', v.toString());
if (v) {
document.documentElement.setAttribute('data-darkmode', 'true');
} else {
document.documentElement.removeAttribute('data-darkmode');
}
bus.$emit('updated', v);
},
_onDarkmodeUpdated_(v) {
if (!this.$el || !this.$el.setAttribute) return;
if (v) {
this.$el.setAttribute('data-darkmode', 'true');
} else {
this.$el.removeAttribute('data-darkmode');
}
this._darkmode_ = v;
this.$forceUpdate();
}
}
});
/**
* APP ENTRY POINT!
*/
@@ -141,6 +99,43 @@ export default (callback: (launch: (router: VueRouter, api?: (os: MiOS) => API)
const launch = (router: VueRouter, api?: (os: MiOS) => API) => {
os.apis = api ? api(os) : null;
//#region Dark/Light
Vue.mixin({
data() {
_unwatchDarkmode_: null
},
created() {
const apply = v => {
if (this.$el.setAttribute == null) return;
if (v) {
this.$el.setAttribute('data-darkmode', 'true');
} else {
this.$el.removeAttribute('data-darkmode');
}
};
this.$nextTick(() => apply(os.store.state.device.darkmode));
this._unwatchDarkmode_ = os.store.watch(s => {
return s.device.darkmode;
}, apply);
},
beforeDestroy() {
this._unwatchDarkmode_();
}
});
os.store.watch(s => {
return s.device.darkmode;
}, v => {
if (v) {
document.documentElement.setAttribute('data-darkmode', 'true');
} else {
document.documentElement.removeAttribute('data-darkmode');
}
});
//#endregion
Vue.mixin({
data() {
return {

View File

@@ -29,7 +29,7 @@
</ul>
<ul>
<li><router-link to="/i/settings" :data-active="$route.name == 'settings'">%fa:cog%%i18n:@settings%%fa:angle-right%</router-link></li>
<li @click="dark"><p><template v-if="_darkmode_">%fa:moon%</template><template v-else>%fa:R moon%</template><span>ダークモード</span></p></li>
<li @click="dark"><p><template v-if="$store.state.device.darkmode">%fa:moon%</template><template v-else>%fa:R moon%</template><span>ダークモード</span></p></li>
</ul>
</div>
<a :href="aboutUrl"><p class="about">%i18n:@about%</p></a>
@@ -117,7 +117,10 @@ export default Vue.extend({
this.hasGameInvitations = false;
},
dark() {
(this as any)._updateDarkmode_(!(this as any)._darkmode_);
this.$store.commit('device/set', {
key: 'darkmode',
value: !this.$store.state.device.darkmode
});
}
}
});

View File

@@ -17,7 +17,7 @@
<button @click="fn">%fa:pencil-alt%</button>
</template>
<main :data-darkmode="_darkmode_">
<main :data-darkmode="$store.state.device.darkmode">
<div class="nav" v-if="showNav">
<div class="bg" @click="showNav = false"></div>
<div class="body">

View File

@@ -16,16 +16,29 @@ export default Vue.extend({
data() {
return {
fetching: true,
user: null
user: null,
unwatchDarkmode: null
};
},
watch: {
$route: 'fetch'
},
created() {
document.documentElement.style.background = '#fff';
const applyBg = v =>
document.documentElement.style.setProperty('background', v ? '#191b22' : '#fff', 'important');
applyBg(this.$store.state.device.darkmode);
this.unwatchDarkmode = this.$store.watch(s => {
return s.device.darkmode;
}, applyBg);
this.fetch();
},
beforeDestroy() {
document.documentElement.style.removeProperty('background');
this.unwatchDarkmode();
},
methods: {
fetch() {
this.fetching = true;
@@ -39,4 +52,3 @@ export default Vue.extend({
}
});
</script>

View File

@@ -141,7 +141,6 @@ export default Vue.extend({
version,
codename,
langs,
darkmode: localStorage.getItem('darkmode') == 'true',
latestVersion: undefined,
checkingForUpdate: false
};
@@ -152,6 +151,11 @@ export default Vue.extend({
return Vue.filter('userName')((this as any).os.i);
},
darkmode: {
get() { return this.$store.state.device.darkmode; },
set(value) { this.$store.commit('device/set', { key: 'darkmode', value }); }
},
postStyle: {
get() { return this.$store.state.device.postStyle; },
set(value) { this.$store.commit('device/set', { key: 'postStyle', value }); }
@@ -168,12 +172,6 @@ export default Vue.extend({
},
},
watch: {
darkmode() {
(this as any)._updateDarkmode_(this.darkmode);
}
},
mounted() {
document.title = 'Misskey | %i18n:@settings%';
},

View File

@@ -1,7 +1,7 @@
<template>
<mk-ui>
<template slot="header" v-if="!fetching"><img :src="`${user.avatarUrl}?thumbnail&size=64`" alt="">{{ user | userName }}</template>
<main v-if="!fetching" :data-darkmode="_darkmode_">
<main v-if="!fetching" :data-darkmode="$store.state.device.darkmode">
<div class="is-suspended" v-if="user.isSuspended"><p>%fa:exclamation-triangle% %i18n:@is-suspended%</p></div>
<div class="is-remote" v-if="user.host != null"><p>%fa:exclamation-triangle% %i18n:@is-remote%<a :href="user.url || user.uri" target="_blank">%i18n:@view-remote%</a></p></div>
<header>

View File

@@ -19,6 +19,7 @@ const defaultSettings = {
const defaultDeviceSettings = {
apiViaStream: true,
autoPopout: false,
darkmode: false,
enableSounds: true,
soundVolume: 0.5,
lang: null,