diff --git a/src/web/app/common/scripts/gcd.js b/src/web/app/common/scripts/gcd.js new file mode 100644 index 0000000000..43bfbc57ae --- /dev/null +++ b/src/web/app/common/scripts/gcd.js @@ -0,0 +1,2 @@ +const gcd = (a, b) => !b ? a : gcd(b, a % b); +module.exports = gcd; diff --git a/src/web/app/common/tags/file-type-icon.tag b/src/web/app/common/tags/file-type-icon.tag index 054457bf03..b4b0c88d66 100644 --- a/src/web/app/common/tags/file-type-icon.tag +++ b/src/web/app/common/tags/file-type-icon.tag @@ -1,11 +1,10 @@ - + + diff --git a/src/web/app/mobile/tags/drive.tag b/src/web/app/mobile/tags/drive.tag index 903a660173..c4e7c0e6d7 100644 --- a/src/web/app/mobile/tags/drive.tag +++ b/src/web/app/mobile/tags/drive.tag @@ -5,8 +5,14 @@

{ folder.name }

- -

{ folder.name }

+ + +

{ folder.name }

+
+ + +

{ file.name }

+
0 }> @@ -150,6 +156,8 @@ #if @opts.folder? if @opts.folder? and @opts.folder != '' @cd @opts.folder + else if @opts.file? and @opts.file != '' + @cf @opts.file else @load! @@ -186,6 +194,8 @@ @cd target-folder, true @cd = (target-folder, is-move) ~> + @file = null + if target-folder? and typeof target-folder == \object target-folder = target-folder.id @@ -263,7 +273,8 @@ @update! @go-root = ~> - if @folder != null + if @folder != null or @file != null + @file = null @folder = null @hierarchy-folders = [] @update! @@ -337,7 +348,30 @@ @update! @trigger \change-selected @selected-files else + @cf file + + @cf = (file) ~> + if typeof file == \object + file = file.id + + @loading = true + @update! + + @api \drive/files/show do + file_id: file + .then (file) ~> @file = file + @folder = null + @hierarchy-folders = [] + + x = (f) ~> + @hierarchy-folders.unshift f + if f.parent? + x f.parent + + if file.folder? + x file.folder + @update! @trigger \open-file @file diff --git a/src/web/app/mobile/tags/drive/file-viewer.tag b/src/web/app/mobile/tags/drive/file-viewer.tag index ac426278b3..406f2f09fb 100644 --- a/src/web/app/mobile/tags/drive/file-viewer.tag +++ b/src/web/app/mobile/tags/drive/file-viewer.tag @@ -1,9 +1,189 @@ -

{ file.name }

+
+ { + +
+ + { file.properties.width } + × + { file.properties.height } + px + + + + { file.properties.width / getGcd(file.properties.width, file.properties.height) } + : + { file.properties.height / getGcd(file.properties.width, file.properties.height) } + +
+
+
+
+ { file.type } + + { bytesToSize(file.datasize) } + + +
+
+ +
+
+

+ ファイルのハッシュ値 +

+ { file.hash } +
+
- +
diff --git a/src/web/app/mobile/tags/drive/file.tag b/src/web/app/mobile/tags/drive/file.tag index 1ce8297ea3..7a4d444693 100644 --- a/src/web/app/mobile/tags/drive/file.tag +++ b/src/web/app/mobile/tags/drive/file.tag @@ -11,7 +11,7 @@ -->