summaryrefslogtreecommitdiff
path: root/src/web
diff options
context:
space:
mode:
authorこぴなたみぽ <Syuilotan@yahoo.co.jp>2017-11-01 04:18:32 +0900
committerGitHub <noreply@github.com>2017-11-01 04:18:32 +0900
commit2a00930150207c983a2f6e111d03f2db33b897b9 (patch)
treef41dc9bcc5498ac89839057e07910b9c2d81fed3 /src/web
parentv2752 (diff)
parentv2769 (diff)
downloadmisskey-2a00930150207c983a2f6e111d03f2db33b897b9.tar.gz
misskey-2a00930150207c983a2f6e111d03f2db33b897b9.tar.bz2
misskey-2a00930150207c983a2f6e111d03f2db33b897b9.zip
Merge pull request #854 from syuilo/bbs
Bbs
Diffstat (limited to 'src/web')
-rw-r--r--src/web/app/ch/router.js32
-rw-r--r--src/web/app/ch/script.js18
-rw-r--r--src/web/app/ch/style.styl4
-rw-r--r--src/web/app/ch/tags/channel.tag223
-rw-r--r--src/web/app/ch/tags/index.js2
-rw-r--r--src/web/app/ch/tags/index.tag33
-rw-r--r--src/web/app/common/scripts/channel-stream.js16
-rw-r--r--src/web/app/common/scripts/config.js2
-rw-r--r--src/web/app/desktop/router.js22
-rw-r--r--src/web/app/desktop/tags/index.js1
-rw-r--r--src/web/app/desktop/tags/pages/selectdrive.tag159
-rw-r--r--src/web/app/desktop/tags/pages/user.tag2
-rw-r--r--src/web/app/desktop/tags/timeline.tag4
-rw-r--r--src/web/app/desktop/tags/ui.tag32
-rw-r--r--src/web/app/mobile/router.js5
-rw-r--r--src/web/app/mobile/tags/drive.tag6
-rw-r--r--src/web/app/mobile/tags/index.js1
-rw-r--r--src/web/app/mobile/tags/page/selectdrive.tag83
-rw-r--r--src/web/app/mobile/tags/timeline.tag4
-rw-r--r--src/web/app/mobile/tags/ui.tag5
20 files changed, 630 insertions, 24 deletions
diff --git a/src/web/app/ch/router.js b/src/web/app/ch/router.js
new file mode 100644
index 0000000000..424158f403
--- /dev/null
+++ b/src/web/app/ch/router.js
@@ -0,0 +1,32 @@
+import * as riot from 'riot';
+const route = require('page');
+let page = null;
+
+export default me => {
+ route('/', index);
+ route('/:channel', channel);
+ route('*', notFound);
+
+ function index() {
+ mount(document.createElement('mk-index'));
+ }
+
+ function channel(ctx) {
+ const el = document.createElement('mk-channel');
+ el.setAttribute('id', ctx.params.channel);
+ mount(el);
+ }
+
+ function notFound() {
+ mount(document.createElement('mk-not-found'));
+ }
+
+ // EXEC
+ route();
+};
+
+function mount(content) {
+ if (page) page.unmount();
+ const body = document.getElementById('app');
+ page = riot.mount(body.appendChild(content))[0];
+}
diff --git a/src/web/app/ch/script.js b/src/web/app/ch/script.js
new file mode 100644
index 0000000000..760d405c52
--- /dev/null
+++ b/src/web/app/ch/script.js
@@ -0,0 +1,18 @@
+/**
+ * Channels
+ */
+
+// Style
+import './style.styl';
+
+require('./tags');
+import init from '../init';
+import route from './router';
+
+/**
+ * init
+ */
+init(me => {
+ // Start routing
+ route(me);
+});
diff --git a/src/web/app/ch/style.styl b/src/web/app/ch/style.styl
new file mode 100644
index 0000000000..2fc3ac3fca
--- /dev/null
+++ b/src/web/app/ch/style.styl
@@ -0,0 +1,4 @@
+@import "../base"
+
+html
+ background #efefef
diff --git a/src/web/app/ch/tags/channel.tag b/src/web/app/ch/tags/channel.tag
new file mode 100644
index 0000000000..12a6b5a3b9
--- /dev/null
+++ b/src/web/app/ch/tags/channel.tag
@@ -0,0 +1,223 @@
+<mk-channel>
+ <header><a href={ CONFIG.chUrl }>Misskey Channels</a></header>
+ <hr>
+ <main if={ !fetching }>
+ <h1>{ channel.title }</h1>
+ <p if={ postsFetching }>読み込み中<mk-ellipsis/></p>
+ <div if={ !postsFetching }>
+ <p if={ posts == null }>まだ投稿がありません</p>
+ <virtual if={ posts != null }>
+ <mk-channel-post each={ posts.slice().reverse() } post={ this } form={ parent.refs.form }/>
+ </virtual>
+ </div>
+ <hr>
+ <mk-channel-form if={ SIGNIN } channel={ channel } ref="form"/>
+ <div if={ !SIGNIN }>
+ <p>参加するには<a href={ CONFIG.url }>ログインまたは新規登録</a>してください</p>
+ </div>
+ <hr>
+ <footer>
+ <small><a href={ CONFIG.url }>Misskey</a> ver { version } (葵 aoi)</small>
+ </footer>
+ </main>
+ <style>
+ :scope
+ display block
+ padding 8px
+
+ > main
+ > h1
+ color #f00
+ </style>
+ <script>
+ import Progress from '../../common/scripts/loading';
+ import ChannelStream from '../../common/scripts/channel-stream';
+
+ this.mixin('i');
+ this.mixin('api');
+
+ this.id = this.opts.id;
+ this.fetching = true;
+ this.postsFetching = true;
+ this.channel = null;
+ this.posts = null;
+ this.connection = new ChannelStream(this.id);
+ this.version = VERSION;
+
+ this.on('mount', () => {
+ document.documentElement.style.background = '#efefef';
+
+ Progress.start();
+
+ this.api('channels/show', {
+ channel_id: this.id
+ }).then(channel => {
+ Progress.done();
+
+ this.update({
+ fetching: false,
+ channel: channel
+ });
+
+ document.title = channel.title + ' | Misskey'
+ });
+
+ this.api('channels/posts', {
+ channel_id: this.id
+ }).then(posts => {
+ this.update({
+ postsFetching: false,
+ posts: posts
+ });
+ });
+
+ this.connection.on('post', this.onPost);
+ });
+
+ this.on('unmount', () => {
+ this.connection.off('post', this.onPost);
+ this.connection.close();
+ });
+
+ this.onPost = post => {
+ this.posts.unshift(post);
+ this.update();
+ };
+
+ </script>
+</mk-channel>
+
+<mk-channel-post>
+ <header>
+ <a class="index" onclick={ reply }>{ post.index }:</a>
+ <a class="name" href={ '/' + post.user.username }><b>{ post.user.name }</b></a>
+ <mk-time time={ post.created_at }/>
+ <mk-time time={ post.created_at } mode="detail"/>
+ <span>ID:<i>{ post.user.username }</i></span>
+ </header>
+ <div>
+ <a if={ post.reply_to }>&gt;&gt;{ post.reply_to.index }</a>
+ { post.text }
+ <div class="media" if={ post.media }>
+ <virtual each={ file in post.media }>
+ <img src={ file.url + '?thumbnail&size=512' } alt={ file.name } title={ file.name }/>
+ </virtual>
+ </div>
+ </div>
+ <style>
+ :scope
+ display block
+ margin 0
+ padding 0
+
+ > header
+ > .index
+ margin-right 0.25em
+ color #000
+
+ > .name
+ margin-right 0.5em
+ color #008000
+
+ > mk-time
+ margin-right 0.5em
+
+ &:first-of-type
+ display none
+
+ @media (max-width 600px)
+ > mk-time
+ &:first-of-type
+ display initial
+
+ &:last-of-type
+ display none
+
+ > div
+ padding 0 0 1em 2em
+
+ </style>
+ <script>
+ this.post = this.opts.post;
+ this.form = this.opts.form;
+
+ this.reply = () => {
+ this.form.update({
+ reply: this.post
+ });
+ };
+ </script>
+</mk-channel-post>
+
+<mk-channel-form>
+ <p if={ reply }><b>&gt;&gt;{ reply.index }</b> ({ reply.user.name }): <a onclick={ clearReply }>[x]</a></p>
+ <textarea ref="text" disabled={ wait }></textarea>
+ <button class={ wait: wait } ref="submit" disabled={ wait || (refs.text.value.length == 0) } onclick={ post }>
+ { wait ? 'やってます' : 'やる' }<mk-ellipsis if={ wait }/>
+ </button>
+ <br>
+ <button onclick={ drive }>ドライブ</button>
+ <ol if={ files }>
+ <li each={ files }>{ name }</li>
+ </ol>
+ <style>
+ :scope
+ display block
+
+ </style>
+ <script>
+ import CONFIG from '../../common/scripts/config';
+
+ this.mixin('api');
+
+ this.channel = this.opts.channel;
+
+ this.clearReply = () => {
+ this.update({
+ reply: null
+ });
+ };
+
+ this.clear = () => {
+ this.clearReply();
+ this.update({
+ files: null
+ });
+ this.refs.text.value = '';
+ };
+
+ this.post = e => {
+ this.update({
+ wait: true
+ });
+
+ const files = this.files && this.files.length > 0
+ ? this.files.map(f => f.id)
+ : undefined;
+
+ this.api('posts/create', {
+ text: this.refs.text.value,
+ media_ids: files,
+ reply_to_id: this.reply ? this.reply.id : undefined,
+ channel_id: this.channel.id
+ }).then(data => {
+ this.clear();
+ }).catch(err => {
+ alert('失敗した');
+ }).then(() => {
+ this.update({
+ wait: false
+ });
+ });
+ };
+
+ this.drive = () => {
+ window['cb'] = files => {
+ this.update({
+ files: files
+ });
+ };
+ window.open(CONFIG.url + '/selectdrive?multiple=true', '_blank');
+ };
+ </script>
+</mk-channel-form>
diff --git a/src/web/app/ch/tags/index.js b/src/web/app/ch/tags/index.js
new file mode 100644
index 0000000000..1e99ccd43e
--- /dev/null
+++ b/src/web/app/ch/tags/index.js
@@ -0,0 +1,2 @@
+require('./index.tag');
+require('./channel.tag');
diff --git a/src/web/app/ch/tags/index.tag b/src/web/app/ch/tags/index.tag
new file mode 100644
index 0000000000..a64ddb6ccd
--- /dev/null
+++ b/src/web/app/ch/tags/index.tag
@@ -0,0 +1,33 @@
+<mk-index>
+ <button onclick={ n }>%i18n:ch.tags.mk-index.new%</button>
+ <hr>
+ <ul if={ channels }>
+ <li each={ channels }><a href={ '/' + this.id }>{ this.title }</a></li>
+ </ul>
+ <style>
+ :scope
+ display block
+
+ </style>
+ <script>
+ this.mixin('api');
+
+ this.on('mount', () => {
+ this.api('channels').then(channels => {
+ this.update({
+ channels: channels
+ });
+ });
+ });
+
+ this.n = () => {
+ const title = window.prompt('%i18n:ch.tags.mk-index.channel-title%');
+
+ this.api('channels/create', {
+ title: title
+ }).then(channel => {
+ location.href = '/' + channel.id;
+ });
+ };
+ </script>
+</mk-index>
diff --git a/src/web/app/common/scripts/channel-stream.js b/src/web/app/common/scripts/channel-stream.js
new file mode 100644
index 0000000000..17944dbe45
--- /dev/null
+++ b/src/web/app/common/scripts/channel-stream.js
@@ -0,0 +1,16 @@
+'use strict';
+
+import Stream from './stream';
+
+/**
+ * Channel stream connection
+ */
+class Connection extends Stream {
+ constructor(channelId) {
+ super('channel', {
+ channel: channelId
+ });
+ }
+}
+
+export default Connection;
diff --git a/src/web/app/common/scripts/config.js b/src/web/app/common/scripts/config.js
index 75a7abba29..c5015622f0 100644
--- a/src/web/app/common/scripts/config.js
+++ b/src/web/app/common/scripts/config.js
@@ -6,6 +6,7 @@ const host = isRoot ? Url.host : Url.host.substring(Url.host.indexOf('.') + 1, U
const scheme = Url.protocol;
const url = `${scheme}//${host}`;
const apiUrl = `${scheme}//api.${host}`;
+const chUrl = `${scheme}//ch.${host}`;
const devUrl = `${scheme}//dev.${host}`;
const aboutUrl = `${scheme}//about.${host}`;
const statsUrl = `${scheme}//stats.${host}`;
@@ -16,6 +17,7 @@ export default {
scheme,
url,
apiUrl,
+ chUrl,
devUrl,
aboutUrl,
statsUrl,
diff --git a/src/web/app/desktop/router.js b/src/web/app/desktop/router.js
index afa8a2dce3..977e3fa9a6 100644
--- a/src/web/app/desktop/router.js
+++ b/src/web/app/desktop/router.js
@@ -7,14 +7,15 @@ const route = require('page');
let page = null;
export default me => {
- route('/', index);
- route('/i>mentions', mentions);
- route('/post::post', post);
- route('/search::query', search);
- route('/:user', user.bind(null, 'home'));
- route('/:user/graphs', user.bind(null, 'graphs'));
- route('/:user/:post', post);
- route('*', notFound);
+ route('/', index);
+ route('/selectdrive', selectDrive);
+ route('/i>mentions', mentions);
+ route('/post::post', post);
+ route('/search::query', search);
+ route('/:user', user.bind(null, 'home'));
+ route('/:user/graphs', user.bind(null, 'graphs'));
+ route('/:user/:post', post);
+ route('*', notFound);
function index() {
me ? home() : entrance();
@@ -54,6 +55,10 @@ export default me => {
mount(el);
}
+ function selectDrive() {
+ mount(document.createElement('mk-selectdrive-page'));
+ }
+
function notFound() {
mount(document.createElement('mk-not-found'));
}
@@ -67,6 +72,7 @@ export default me => {
};
function mount(content) {
+ document.documentElement.style.background = '#313a42';
document.documentElement.removeAttribute('data-page');
if (page) page.unmount();
const body = document.getElementById('app');
diff --git a/src/web/app/desktop/tags/index.js b/src/web/app/desktop/tags/index.js
index 4e286013a1..37fdfe37e4 100644
--- a/src/web/app/desktop/tags/index.js
+++ b/src/web/app/desktop/tags/index.js
@@ -61,6 +61,7 @@ require('./pages/user.tag');
require('./pages/post.tag');
require('./pages/search.tag');
require('./pages/not-found.tag');
+require('./pages/selectdrive.tag');
require('./autocomplete-suggestion.tag');
require('./progress-dialog.tag');
require('./user-preview.tag');
diff --git a/src/web/app/desktop/tags/pages/selectdrive.tag b/src/web/app/desktop/tags/pages/selectdrive.tag
new file mode 100644
index 0000000000..b196357d85
--- /dev/null
+++ b/src/web/app/desktop/tags/pages/selectdrive.tag
@@ -0,0 +1,159 @@
+<mk-selectdrive-page>
+ <mk-drive-browser ref="browser" multiple={ multiple }/>
+ <div>
+ <button class="upload" title="PCからドライブにファイルをアップロード" onclick={ upload }><i class="fa fa-upload"></i></button>
+ <button class="cancel" onclick={ close }>キャンセル</button>
+ <button class="ok" onclick={ ok }>決定</button>
+ </div>
+
+ <style>
+ :scope
+ display block
+ height 100%
+ background #fff
+
+ > mk-drive-browser
+ height calc(100% - 72px)
+
+ > div
+ position fixed
+ bottom 0
+ left 0
+ width 100%
+ height 72px
+ background lighten($theme-color, 95%)
+
+ .upload
+ display inline-block
+ position absolute
+ top 8px
+ left 16px
+ cursor pointer
+ padding 0
+ margin 8px 4px 0 0
+ width 40px
+ height 40px
+ font-size 1em
+ color rgba($theme-color, 0.5)
+ background transparent
+ outline none
+ border solid 1px transparent
+ border-radius 4px
+
+ &:hover
+ background transparent
+ border-color rgba($theme-color, 0.3)
+
+ &:active
+ color rgba($theme-color, 0.6)
+ background transparent
+ border-color rgba($theme-color, 0.5)
+ box-shadow 0 2px 4px rgba(darken($theme-color, 50%), 0.15) inset
+
+ &:focus
+ &:after
+ content ""
+ pointer-events none
+ position absolute
+ top -5px
+ right -5px
+ bottom -5px
+ left -5px
+ border 2px solid rgba($theme-color, 0.3)
+ border-radius 8px
+
+ .ok
+ .cancel
+ display block
+ position absolute
+ bottom 16px
+ cursor pointer
+ padding 0
+ margin 0
+ width 120px
+ height 40px
+ font-size 1em
+ outline none
+ border-radius 4px
+
+ &:focus
+ &:after
+ content ""
+ pointer-events none
+ position absolute
+ top -5px
+ right -5px
+ bottom -5px
+ left -5px
+ border 2px solid rgba($theme-color, 0.3)
+ border-radius 8px
+
+ &:disabled
+ opacity 0.7
+ cursor default
+
+ .ok
+ right 16px
+ color $theme-color-foreground
+ background linear-gradient(to bottom, lighten($theme-color, 25%) 0%, lighten($theme-color, 10%) 100%)
+ border solid 1px lighten($theme-color, 15%)
+
+ &:not(:disabled)
+ font-weight bold
+
+ &:hover:not(:disabled)
+ background linear-gradient(to bottom, lighten($theme-color, 8%) 0%, darken($theme-color, 8%) 100%)
+ border-color $theme-color
+
+ &:active:not(:disabled)
+ background $theme-color
+ border-color $theme-color
+
+ .cancel
+ right 148px
+ color #888
+ background linear-gradient(to bottom, #ffffff 0%, #f5f5f5 100%)
+ border solid 1px #e2e2e2
+
+ &:hover
+ background linear-gradient(to bottom, #f9f9f9 0%, #ececec 100%)
+ border-color #dcdcdc
+
+ &:active
+ background #ececec
+ border-color #dcdcdc
+
+ </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>
diff --git a/src/web/app/desktop/tags/pages/user.tag b/src/web/app/desktop/tags/pages/user.tag
index 864fe22735..811ca5c0fd 100644
--- a/src/web/app/desktop/tags/pages/user.tag
+++ b/src/web/app/desktop/tags/pages/user.tag
@@ -16,7 +16,7 @@
this.refs.ui.refs.user.on('user-fetched', user => {
Progress.set(0.5);
- document.title = user.name + ' | Misskey'
+ document.title = user.name + ' | Misskey';
});
this.refs.ui.refs.user.on('loaded', () => {
diff --git a/src/web/app/desktop/tags/timeline.tag b/src/web/app/desktop/tags/timeline.tag
index 2d6b439e38..64b64f902f 100644
--- a/src/web/app/desktop/tags/timeline.tag
+++ b/src/web/app/desktop/tags/timeline.tag
@@ -112,6 +112,7 @@
</header>
<div class="body">
<div class="text" ref="text">
+ <p class="channel" if={ p.channel != null }><a href={ CONFIG.chUrl + '/' + p.channel.id } target="_blank">{ p.channel.title }</a>:</p>
<a class="reply" if={ p.reply_to }>
<i class="fa fa-reply"></i>
</a>
@@ -333,6 +334,9 @@
font-weight 400
font-style normal
+ > .channel
+ margin 0
+
> .reply
margin-right 8px
color #717171
diff --git a/src/web/app/desktop/tags/ui.tag b/src/web/app/desktop/tags/ui.tag
index e0d7393b08..3123c34f4f 100644
--- a/src/web/app/desktop/tags/ui.tag
+++ b/src/web/app/desktop/tags/ui.tag
@@ -319,18 +319,26 @@
</mk-ui-header-notifications>
<mk-ui-header-nav>
- <ul if={ SIGNIN }>
- <li class="home { active: page == 'home' }">
- <a href={ CONFIG.url }>
- <i class="fa fa-home"></i>
- <p>%i18n:desktop.tags.mk-ui-header-nav.home%</p>
- </a>
- </li>
- <li class="messaging">
- <a onclick={ messaging }>
- <i class="fa fa-comments"></i>
- <p>%i18n:desktop.tags.mk-ui-header-nav.messaging%</p>
- <i class="fa fa-circle" if={ hasUnreadMessagingMessages }></i>
+ <ul>
+ <virtual if={ SIGNIN }>
+ <li class="home { active: page == 'home' }">
+ <a href={ CONFIG.url }>
+ <i class="fa fa-home"></i>
+ <p>%i18n:desktop.tags.mk-ui-header-nav.home%</p>
+ </a>
+ </li>
+ <li class="messaging">
+ <a onclick={ messaging }>
+ <i class="fa fa-comments"></i>
+ <p>%i18n:desktop.tags.mk-ui-header-nav.messaging%</p>
+ <i class="fa fa-circle" if={ hasUnreadMessagingMessages }></i>
+ </a>
+ </li>
+ </virtual>
+ <li class="ch">
+ <a href={ CONFIG.chUrl } target="_blank">
+ <i class="fa fa-television"></i>
+ <p>%i18n:desktop.tags.mk-ui-header-nav.ch%</p>
</a>
</li>
<li class="info">
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>
diff --git a/src/web/app/mobile/tags/timeline.tag b/src/web/app/mobile/tags/timeline.tag
index c7f5bfd681..ad18521df6 100644
--- a/src/web/app/mobile/tags/timeline.tag
+++ b/src/web/app/mobile/tags/timeline.tag
@@ -164,6 +164,7 @@
</header>
<div class="body">
<div class="text" ref="text">
+ <p class="channel" if={ p.channel != null }><a href={ CONFIG.chUrl + '/' + p.channel.id } target="_blank">{ p.channel.title }</a>:</p>
<a class="reply" if={ p.reply_to }>
<i class="fa fa-reply"></i>
</a>
@@ -373,6 +374,9 @@
mk-url-preview
margin-top 8px
+ > .channel
+ margin 0
+
> .reply
margin-right 8px
color #717171
diff --git a/src/web/app/mobile/tags/ui.tag b/src/web/app/mobile/tags/ui.tag
index fb8cbcdbd2..b2d96f6b8b 100644
--- a/src/web/app/mobile/tags/ui.tag
+++ b/src/web/app/mobile/tags/ui.tag
@@ -231,10 +231,11 @@
<li><a href="/i/messaging"><i class="fa fa-comments-o"></i>%i18n:mobile.tags.mk-ui-nav.messaging%<i class="i fa fa-circle" if={ hasUnreadMessagingMessages }></i><i class="fa fa-angle-right"></i></a></li>
</ul>
<ul>
- <li><a onclick={ search }><i class="fa fa-search"></i>%i18n:mobile.tags.mk-ui-nav.search%<i class="fa fa-angle-right"></i></a></li>
+ <li><a href={ CONFIG.chUrl } target="_blank"><i class="fa fa-television"></i>%i18n:mobile.tags.mk-ui-nav.ch%<i class="fa fa-angle-right"></i></a></li>
+ <li><a href="/i/drive"><i class="fa fa-cloud"></i>%i18n:mobile.tags.mk-ui-nav.drive%<i class="fa fa-angle-right"></i></a></li>
</ul>
<ul>
- <li><a href="/i/drive"><i class="fa fa-cloud"></i>%i18n:mobile.tags.mk-ui-nav.drive%<i class="fa fa-angle-right"></i></a></li>
+ <li><a onclick={ search }><i class="fa fa-search"></i>%i18n:mobile.tags.mk-ui-nav.search%<i class="fa fa-angle-right"></i></a></li>
</ul>
<ul>
<li><a href="/i/settings"><i class="fa fa-cog"></i>%i18n:mobile.tags.mk-ui-nav.settings%<i class="fa fa-angle-right"></i></a></li>