diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 68503425a..5492a4da0 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1239,6 +1239,8 @@ mobile/views/components/drive.file-detail.vue: hash: "ハッシュ (md5)" exif: "EXIF" nsfw: "閲覧注意" + mark-as-sensitive: "閲覧注意に設定" + unmark-as-sensitive: "閲覧注意を解除" mobile/views/components/media-image.vue: sensitive: "閲覧注意" diff --git a/src/client/app/mobile/views/components/drive.file-detail.vue b/src/client/app/mobile/views/components/drive.file-detail.vue index 7425afe1e..872f2f59b 100644 --- a/src/client/app/mobile/views/components/drive.file-detail.vue +++ b/src/client/app/mobile/views/components/drive.file-detail.vue @@ -41,6 +41,8 @@ %fa:download% %i18n:@download% %fa:pencil-alt% %i18n:@rename% %fa:R folder-open% %i18n:@move% + %fa:R eye% %i18n:@unmark-as-sensitive% + %fa:R eye-slash% %i18n:@mark-as-sensitive% %fa:trash-alt R% %i18n:@delete% @@ -71,25 +73,30 @@ import { gcd } from '../../../../../prelude/math'; export default Vue.extend({ props: ['file'], + data() { return { gcd, exif: null }; }, + computed: { browser(): any { return this.$parent; }, + kind(): string { return this.file.type.split('/')[0]; }, + style(): any { return this.file.properties.avgColor && this.file.properties.avgColor.length == 3 ? { 'background-color': `rgb(${ this.file.properties.avgColor.join(',') })` } : {}; } }, + methods: { rename() { const name = window.prompt('%i18n:@rename%', this.file.name); @@ -101,6 +108,7 @@ export default Vue.extend({ this.browser.cf(this.file, true); }); }, + move() { (this as any).apis.chooseDriveFolder().then(folder => { (this as any).api('drive/files/update', { @@ -111,6 +119,7 @@ export default Vue.extend({ }); }); }, + del() { (this as any).api('drive/files/delete', { fileId: this.file.id @@ -118,9 +127,20 @@ export default Vue.extend({ this.browser.cd(this.file.folderId, true); }); }, + + toggleSensitive() { + (this as any).api('drive/files/update', { + fileId: this.file.id, + isSensitive: !this.file.isSensitive + }); + + this.file.isSensitive = !this.file.isSensitive; + }, + showCreatedAt() { alert(new Date(this.file.createdAt).toLocaleString()); }, + onImageLoaded() { const self = this; EXIF.getData(this.$refs.img, function(this: any) {