This commit is contained in:
syuilo 2017-12-11 03:38:31 +09:00
parent f849dcb7b9
commit 845dc26184
5 changed files with 36 additions and 19 deletions

View File

@ -365,6 +365,8 @@ desktop:
security: "Security"
password: "Password"
2fa: "Two-factor authentication"
other: "Other"
license: "License"
mk-timeline-post:
reposted-by: "Reposted by {}"

View File

@ -365,6 +365,8 @@ desktop:
security: "セキュリティ"
password: "パスワード"
2fa: "二段階認証"
other: "その他"
license: "ライセンス"
mk-timeline-post:
reposted-by: "{}がRepost"

View File

@ -8,6 +8,7 @@
<p class={ active: page == 'twitter' } onmousedown={ setPage.bind(null, 'twitter') }>%fa:B twitter .fw%Twitter</p>
<p class={ active: page == 'security' } onmousedown={ setPage.bind(null, 'security') }>%fa:unlock-alt .fw%%i18n:desktop.tags.mk-settings.security%</p>
<p class={ active: page == 'api' } onmousedown={ setPage.bind(null, 'api') }>%fa:key .fw%API</p>
<p class={ active: page == 'other' } onmousedown={ setPage.bind(null, 'other') }>%fa:cogs .fw%%i18n:desktop.tags.mk-settings.other%</p>
</div>
<div class="pages">
<section class="profile" show={ page == 'profile' }>
@ -54,6 +55,11 @@
<h1>API</h1>
<mk-api-info/>
</section>
<section class="other" show={ page == 'other' }>
<h1>%i18n:desktop.tags.mk-settings.license%</h1>
%license%
</section>
</div>
<style>
:scope
@ -96,8 +102,9 @@
> section
margin 32px
color #4a535a
h1
> h1
display block
margin 0 0 1em 0
padding 0 0 8px 0
@ -105,24 +112,6 @@
color #555
border-bottom solid 1px #eee
label.checkbox
> input
position absolute
top 0
left 0
&:checked + p
color $theme-color
> p
width calc(100% - 32px)
margin 0 0 0 32px
font-weight bold
&:last-child
font-weight normal
color #999
</style>
<script>
this.page = 'profile';

View File

@ -1,4 +1,5 @@
import i18n from './i18n';
import license from './license';
import fa from './fa';
import base64 from './base64';
import themeColor from './theme-color';
@ -8,6 +9,7 @@ import typescript from './typescript';
export default (lang, locale) => [
i18n(lang, locale),
license(),
fa(),
base64(),
themeColor(),

View File

@ -0,0 +1,22 @@
/**
* Inject license
*/
import * as fs from 'fs';
const StringReplacePlugin = require('string-replace-webpack-plugin');
const license = fs.readFileSync(__dirname + '/../../../LICENSE', 'utf-8')
.replace(/\r\n/g, '\n')
.replace(/(.)\n(.)/g, '$1 $2')
.replace(/(^|\n)(.*?)($|\n)/g, '<p>$2</p>');
export default () => ({
enforce: 'pre',
test: /\.(tag|js)$/,
exclude: /node_modules/,
loader: StringReplacePlugin.replace({
replacements: [{
pattern: '%license%', replacement: () => license
}]
})
});