diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-11-01 03:31:36 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-11-01 03:31:36 +0900 |
| commit | 3c4719a0b119c78108edeff2ecf7965f1c517237 (patch) | |
| tree | e24cd65cdc5e1e4c7ab74463a36755f18d902161 /src/web | |
| parent | wip (diff) | |
| download | misskey-3c4719a0b119c78108edeff2ecf7965f1c517237.tar.gz misskey-3c4719a0b119c78108edeff2ecf7965f1c517237.tar.bz2 misskey-3c4719a0b119c78108edeff2ecf7965f1c517237.zip | |
wip
Diffstat (limited to 'src/web')
| -rw-r--r-- | src/web/app/ch/tags/channel.tag | 2 | ||||
| -rw-r--r-- | src/web/app/mobile/router.js | 5 | ||||
| -rw-r--r-- | src/web/app/mobile/tags/drive.tag | 6 | ||||
| -rw-r--r-- | src/web/app/mobile/tags/index.js | 1 | ||||
| -rw-r--r-- | src/web/app/mobile/tags/page/selectdrive.tag | 83 |
5 files changed, 95 insertions, 2 deletions
diff --git a/src/web/app/ch/tags/channel.tag b/src/web/app/ch/tags/channel.tag index b16844b8bc..d43113a554 100644 --- a/src/web/app/ch/tags/channel.tag +++ b/src/web/app/ch/tags/channel.tag @@ -11,7 +11,7 @@ </div> <hr> <footer> - <small>Misskey ver { version } (葵 aoi)</small> + <small><a href={ CONFIG.url }>Misskey</a> ver { version } (葵 aoi)</small> </footer> </main> <style> diff --git a/src/web/app/mobile/router.js b/src/web/app/mobile/router.js index d59b2ec3a1..01eb3c8145 100644 --- a/src/web/app/mobile/router.js +++ b/src/web/app/mobile/router.js @@ -8,6 +8,7 @@ let page = null; export default me => { route('/', index); + route('/selectdrive', selectDrive); route('/i/notifications', notifications); route('/i/messaging', messaging); route('/i/messaging/:username', messaging); @@ -122,6 +123,10 @@ export default me => { mount(el); } + function selectDrive() { + mount(document.createElement('mk-selectdrive-page')); + } + function notFound() { mount(document.createElement('mk-not-found')); } diff --git a/src/web/app/mobile/tags/drive.tag b/src/web/app/mobile/tags/drive.tag index 9f3e647735..c17b7ce579 100644 --- a/src/web/app/mobile/tags/drive.tag +++ b/src/web/app/mobile/tags/drive.tag @@ -483,7 +483,7 @@ if (fn == null || fn == '') return; switch (fn) { case '1': - this.refs.file.click(); + this.selectLocalFile(); break; case '2': this.urlUpload(); @@ -503,6 +503,10 @@ } }; + this.selectLocalFile = () => { + this.refs.file.click(); + }; + this.createFolder = () => { const name = window.prompt('フォルダー名'); if (name == null || name == '') return; diff --git a/src/web/app/mobile/tags/index.js b/src/web/app/mobile/tags/index.js index a79f4f7e7e..19952c20cd 100644 --- a/src/web/app/mobile/tags/index.js +++ b/src/web/app/mobile/tags/index.js @@ -19,6 +19,7 @@ require('./page/settings/authorized-apps.tag'); require('./page/settings/twitter.tag'); require('./page/messaging.tag'); require('./page/messaging-room.tag'); +require('./page/selectdrive.tag'); require('./home.tag'); require('./home-timeline.tag'); require('./timeline.tag'); diff --git a/src/web/app/mobile/tags/page/selectdrive.tag b/src/web/app/mobile/tags/page/selectdrive.tag new file mode 100644 index 0000000000..d9e7d95c41 --- /dev/null +++ b/src/web/app/mobile/tags/page/selectdrive.tag @@ -0,0 +1,83 @@ +<mk-selectdrive-page> + <header> + <h1>%i18n:mobile.tags.mk-selectdrive-page.select-file%<span class="count" if={ files.length > 0 }>({ files.length })</span></h1> + <button class="upload" onclick={ upload }><i class="fa fa-upload"></i></button> + <button if={ multiple } class="ok" onclick={ ok }><i class="fa fa-check"></i></button> + </header> + <mk-drive ref="browser" select-file={ true } multiple={ multiple }/> + + <style> + :scope + display block + width 100% + height 100% + background #fff + + > header + border-bottom solid 1px #eee + + > h1 + margin 0 + padding 0 + text-align center + line-height 42px + font-size 1em + font-weight normal + + > .count + margin-left 4px + opacity 0.5 + + > .upload + position absolute + top 0 + left 0 + line-height 42px + width 42px + + > .ok + position absolute + top 0 + right 0 + line-height 42px + width 42px + + > mk-drive + height calc(100% - 42px) + overflow scroll + -webkit-overflow-scrolling touch + + </style> + <script> + const q = (new URL(location)).searchParams; + this.multiple = q.get('multiple') == 'true' ? true : false; + + this.on('mount', () => { + document.documentElement.style.background = '#fff'; + + this.refs.browser.on('selected', file => { + this.files = [file]; + this.ok(); + }); + + this.refs.browser.on('change-selection', files => { + this.update({ + files: files + }); + }); + }); + + this.upload = () => { + this.refs.browser.selectLocalFile(); + }; + + this.close = () => { + window.close(); + }; + + this.ok = () => { + window.opener.cb(this.multiple ? this.files : this.files[0]); + window.close(); + }; + </script> +</mk-selectdrive-page> |