This commit is contained in:
syuilo 2017-02-22 02:05:44 +09:00
parent 962a166bb2
commit 81164153be
13 changed files with 28 additions and 25 deletions

View File

@ -249,6 +249,7 @@
const strength = this.getPasswordStrength(password); const strength = this.getPasswordStrength(password);
this.passwordStrength = strength > 0.7 ? 'high' : strength > 0.3 ? 'medium' : 'low'; this.passwordStrength = strength > 0.7 ? 'high' : strength > 0.3 ? 'medium' : 'low';
this.update();
this.refs.passwordMetar.style.width = `${strength * 100}%`; this.refs.passwordMetar.style.width = `${strength * 100}%`;
}; };
@ -256,7 +257,7 @@
const password = this.refs.password.value; const password = this.refs.password.value;
const retypedPassword = this.refs.passwordRetype.value; const retypedPassword = this.refs.passwordRetype.value;
if (retyped-password == '') { if (retypedPassword == '') {
this.passwordRetypeState = null; this.passwordRetypeState = null;
return; return;
} }

View File

@ -43,13 +43,13 @@
const uv = new Vec2(Math.sin(angle), -Math.cos(angle)); const uv = new Vec2(Math.sin(angle), -Math.cos(angle));
ctx.beginPath(); ctx.beginPath();
ctx.lineWidth = 1; ctx.lineWidth = 1;
ctx.moveTo((canv-w / 2) + uv.x * lineStart, (canv-h / 2) + uv.y * lineStart); ctx.moveTo((canvW / 2) + uv.x * lineStart, (canvH / 2) + uv.y * lineStart);
if (i % 5 == 0) { if (i % 5 == 0) {
ctx.strokeStyle = 'rgba(255, 255, 255, 0.2)'; ctx.strokeStyle = 'rgba(255, 255, 255, 0.2)';
ctx.lineTo((canv-w / 2) + uv.x * longLineEnd, (canv-h / 2) + uv.y * longLineEnd); ctx.lineTo((canvW / 2) + uv.x * longLineEnd, (canvH / 2) + uv.y * longLineEnd);
} else { } else {
ctx.strokeStyle = 'rgba(255, 255, 255, 0.1)'; ctx.strokeStyle = 'rgba(255, 255, 255, 0.1)';
ctx.lineTo((canv-w / 2) + uv.x * shortLineEnd, (canv-h / 2) + uv.y * shortLineEnd); ctx.lineTo((canvW / 2) + uv.x * shortLineEnd, (canvH / 2) + uv.y * shortLineEnd);
} }
ctx.stroke(); ctx.stroke();
} }
@ -58,7 +58,7 @@
{ // 分 { // 分
const angle = Math.PI * (m + s / 60) / 30; const angle = Math.PI * (m + s / 60) / 30;
const length = Math.min(canvW, canvH) / 2.6; const length = Math.min(canvW, canvH) / 2.6;
const uv = new vec2(Math.sin(angle), -Math.cos(angle)); const uv = new Vec2(Math.sin(angle), -Math.cos(angle));
ctx.beginPath(); ctx.beginPath();
ctx.strokeStyle = '#ffffff'; ctx.strokeStyle = '#ffffff';
ctx.lineWidth = 2; ctx.lineWidth = 2;
@ -70,7 +70,7 @@
{ // 時 { // 時
const angle = Math.PI * (h % 12 + m / 60) / 6; const angle = Math.PI * (h % 12 + m / 60) / 6;
const length = Math.min(canvW, canvH) / 4; const length = Math.min(canvW, canvH) / 4;
const uv = new vec2(Math.sin(angle), -Math.cos(angle)); const uv = new Vec2(Math.sin(angle), -Math.cos(angle));
ctx.beginPath(); ctx.beginPath();
ctx.strokeStyle = CONFIG.themeColor; ctx.strokeStyle = CONFIG.themeColor;
ctx.lineWidth = 2; ctx.lineWidth = 2;
@ -82,7 +82,7 @@
{ // 秒 { // 秒
const angle = Math.PI * s / 30; const angle = Math.PI * s / 30;
const length = Math.min(canvW, canvH) / 2.6; const length = Math.min(canvW, canvH) / 2.6;
const uv = new vec2(Math.sin(angle), -Math.cos(angle)); const uv = new Vec2(Math.sin(angle), -Math.cos(angle));
ctx.beginPath(); ctx.beginPath();
ctx.strokeStyle = 'rgba(255, 255, 255, 0.5)'; ctx.strokeStyle = 'rgba(255, 255, 255, 0.5)';
ctx.lineWidth = 1; ctx.lineWidth = 1;

View File

@ -169,7 +169,7 @@
this.img = this.refs.window.refs.img; this.img = this.refs.window.refs.img;
this.cropper = new this.Cropper(this.img, { this.cropper = new this.Cropper(this.img, {
aspectRatio: this.aspectRatio, aspectRatio: this.aspectRatio,
highlight: no, highlight: false,
viewMode: 1 viewMode: 1
}); });
}); });

View File

@ -659,10 +659,10 @@
}); });
let flag = false; let flag = false;
complete = () => { const complete = () => {
if (flag) { if (flag) {
fetchedFolders.forEach(folder => this.addFolder); fetchedFolders.forEach(this.addFolder);
fetchedFiles.forEach(file => this.addFile); fetchedFiles.forEach(this.addFile);
this.update({ this.update({
fetching: false fetching: false
}); });

View File

@ -39,7 +39,6 @@
this.mixin('i'); this.mixin('i');
this.mixin('update-avatar'); this.mixin('update-avatar');
this.mixin('update-banner'); this.mixin('update-banner');
this.mixin('update-wallpaper');
this.mixin('input-dialog'); this.mixin('input-dialog');
this.mixin('NotImplementedException'); this.mixin('NotImplementedException');

View File

@ -62,7 +62,7 @@
}); });
this.onDocumentKeydown = e => { this.onDocumentKeydown = e => {
if (e.target.tagName != 'INPUT' && tag != 'TEXTAREA') { if (e.target.tagName != 'INPUT' && e.target.tagName != 'TEXTAREA') {
if (e.which == 84) { // t if (e.which == 84) { // t
this.refs.timeline.focus(); this.refs.timeline.focus();
} }

View File

@ -305,7 +305,7 @@
</style> </style>
<script> <script>
getCat = require('../../common/scripts/get-cat'); const getCat = require('../../common/scripts/get-cat');
this.mixin('api'); this.mixin('api');
this.mixin('notify'); this.mixin('notify');
@ -379,7 +379,7 @@
}; };
this.onkeydown = e => { this.onkeydown = e => {
if ((e.which == 10 || e.which == 13) && (e.ctrlKey || e.meta-key)) this.post(); if ((e.which == 10 || e.which == 13) && (e.ctrlKey || e.metaKey)) this.post();
}; };
this.onpaste = e => { this.onpaste = e => {

View File

@ -2,6 +2,7 @@
<div class="header"> <div class="header">
<time ref="time"> <time ref="time">
<span class="yyyymmdd">{ yyyy }/{ mm }/{ dd }</span> <span class="yyyymmdd">{ yyyy }/{ mm }/{ dd }</span>
<br>
<span class="hhnn">{ hh }<span style="visibility:{ now.getSeconds() % 2 == 0 ? 'visible' : 'hidden' }">:</span>{ nn }</span> <span class="hhnn">{ hh }<span style="visibility:{ now.getSeconds() % 2 == 0 ? 'visible' : 'hidden' }">:</span>{ nn }</span>
</time> </time>
</div> </div>
@ -61,8 +62,10 @@
</style> </style>
<script> <script>
this.now = new Date();
this.draw = () => { this.draw = () => {
this.now = new Date(); const now = this.now = new Date();
this.yyyy = now.getFullYear(); this.yyyy = now.getFullYear();
this.mm = ('0' + (now.getMonth() + 1)).slice(-2); this.mm = ('0' + (now.getMonth() + 1)).slice(-2);
this.dd = ('0' + now.getDate()).slice(-2); this.dd = ('0' + now.getDate()).slice(-2);

View File

@ -81,7 +81,7 @@
this.initializing = false; this.initializing = false;
posts.forEach(post => { posts.forEach(post => {
post.media.forEach(media => { post.media.forEach(media => {
if (this.images.length < 9) this.images.push(image); if (this.images.length < 9) this.images.push(media);
}); });
}); });
this.update(); this.update();

View File

@ -198,7 +198,7 @@
}; };
this.move = ev => { this.move = ev => {
this.move(ev.item.folder); this.cd(ev.item.folder);
}; };
this.cd = (target, silent = false) => { this.cd = (target, silent = false) => {
@ -333,10 +333,10 @@
}); });
let flag = false; let flag = false;
complete = () => { const complete = () => {
if (flag) { if (flag) {
fetchedFolders.forEach(folder => this.addFolder); fetchedFolders.forEach(this.addFolder);
fetchedFiles.forEach(file => this.addFile); fetchedFiles.forEach(this.addFile);
this.update({ this.update({
fetching: false fetching: false
}); });

View File

@ -41,7 +41,7 @@
this.folder = this.opts.folder; this.folder = this.opts.folder;
this.onclick = () => { this.onclick = () => {
this.browser.move(this.folder); this.browser.cd(this.folder);
}; };
</script> </script>
</mk-drive-folder> </mk-drive-folder>

View File

@ -182,7 +182,7 @@
</style> </style>
<script> <script>
getCat = require('../../common/scripts/get-cat'); const getCat = require('../../common/scripts/get-cat');
this.mixin('api'); this.mixin('api');
@ -204,7 +204,7 @@
}); });
this.onkeydown = e => { this.onkeydown = e => {
if ((e.which == 10 || e.which == 13) && (e.ctrlKey || e.meta-key)) this.post(); if ((e.which == 10 || e.which == 13) && (e.ctrlKey || e.metaKey)) this.post();
}; };
this.onpaste = e => { this.onpaste = e => {

View File

@ -298,7 +298,7 @@
this.mixin('api'); this.mixin('api');
this.mixin('text'); this.mixin('text');
this.mixin('get-post-summary'); this.mixin('get-post-summary');
this.mixin('openPostForm'); this.mixin('open-post-form');
this.post = this.opts.post; this.post = this.opts.post;
this.isRepost = this.post.repost != null && this.post.text == null; this.isRepost = this.post.repost != null && this.post.text == null;