summaryrefslogtreecommitdiff
path: root/src/web/app/desktop
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-11-01 03:17:14 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-11-01 03:17:14 +0900
commitf37fb38640a31c4b8865a5562628197ff21f3cce (patch)
treec68d1b73aeb8c0c61d6a76ed4577036d4c3c04a5 /src/web/app/desktop
parentwip (diff)
downloadmisskey-f37fb38640a31c4b8865a5562628197ff21f3cce.tar.gz
misskey-f37fb38640a31c4b8865a5562628197ff21f3cce.tar.bz2
misskey-f37fb38640a31c4b8865a5562628197ff21f3cce.zip
wip
Diffstat (limited to 'src/web/app/desktop')
-rw-r--r--src/web/app/desktop/router.js12
-rw-r--r--src/web/app/desktop/tags/index.js2
-rw-r--r--src/web/app/desktop/tags/pages/channel.tag184
-rw-r--r--src/web/app/desktop/tags/pages/channels.tag28
-rw-r--r--src/web/app/desktop/tags/timeline.tag2
-rw-r--r--src/web/app/desktop/tags/ui.tag6
6 files changed, 4 insertions, 230 deletions
diff --git a/src/web/app/desktop/router.js b/src/web/app/desktop/router.js
index df67bb7b7c..977e3fa9a6 100644
--- a/src/web/app/desktop/router.js
+++ b/src/web/app/desktop/router.js
@@ -10,8 +10,6 @@ export default me => {
route('/', index);
route('/selectdrive', selectDrive);
route('/i>mentions', mentions);
- route('/channel', channels);
- route('/channel/:channel', channel);
route('/post::post', post);
route('/search::query', search);
route('/:user', user.bind(null, 'home'));
@@ -57,16 +55,6 @@ export default me => {
mount(el);
}
- function channel(ctx) {
- const el = document.createElement('mk-channel-page');
- el.setAttribute('id', ctx.params.channel);
- mount(el);
- }
-
- function channels() {
- mount(document.createElement('mk-channels-page'));
- }
-
function selectDrive() {
mount(document.createElement('mk-selectdrive-page'));
}
diff --git a/src/web/app/desktop/tags/index.js b/src/web/app/desktop/tags/index.js
index 0b92d8c236..37fdfe37e4 100644
--- a/src/web/app/desktop/tags/index.js
+++ b/src/web/app/desktop/tags/index.js
@@ -61,8 +61,6 @@ require('./pages/user.tag');
require('./pages/post.tag');
require('./pages/search.tag');
require('./pages/not-found.tag');
-require('./pages/channel.tag');
-require('./pages/channels.tag');
require('./pages/selectdrive.tag');
require('./autocomplete-suggestion.tag');
require('./progress-dialog.tag');
diff --git a/src/web/app/desktop/tags/pages/channel.tag b/src/web/app/desktop/tags/pages/channel.tag
deleted file mode 100644
index a14c0648c4..0000000000
--- a/src/web/app/desktop/tags/pages/channel.tag
+++ /dev/null
@@ -1,184 +0,0 @@
-<mk-channel-page>
- <mk-ui ref="ui">
- <main if={ !parent.fetching }>
- <h1>{ parent.channel.title }</h1>
- <virtual if={ parent.posts }>
- <mk-channel-post each={ parent.posts.reverse() } post={ this } form={ parent.refs.form }/>
- </virtual>
- <hr>
- <mk-channel-form channel={ parent.channel } ref="form"/>
- </main>
- </mk-ui>
- <style>
- :scope
- display block
-
- main
- padding 8px
-
- > h1
- color #f00
- </style>
- <script>
- import Progress from '../../../common/scripts/loading';
- import ChannelStream from '../../../common/scripts/channel-stream';
-
- this.mixin('api');
-
- this.id = this.opts.id;
- this.fetching = true;
- this.channel = null;
- this.posts = null;
- this.connection = new ChannelStream();
-
- 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({
- posts: posts
- });
- });
- });
- </script>
-</mk-channel-page>
-
-<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 } 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
-
- > 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/desktop/tags/pages/channels.tag b/src/web/app/desktop/tags/pages/channels.tag
deleted file mode 100644
index 220f1ca50e..0000000000
--- a/src/web/app/desktop/tags/pages/channels.tag
+++ /dev/null
@@ -1,28 +0,0 @@
-<mk-channels-page>
- <mk-ui ref="ui">
- <main>
- <button onclick={ parent.new }>%i18n:desktop.tags.mk-channels-page.new%</button>
- </main>
- </mk-ui>
- <style>
- :scope
- display block
-
- </style>
- <script>
- this.mixin('api');
-
- this.on('mount', () => {
- });
-
- this.new = () => {
- const title = window.prompt('%i18n:desktop.tags.mk-channels-page.channel-title%');
-
- this.api('channels/create', {
- title: title
- }).then(channel => {
- location.href = '/channel/' + channel.id;
- });
- };
- </script>
-</mk-channels-page>
diff --git a/src/web/app/desktop/tags/timeline.tag b/src/web/app/desktop/tags/timeline.tag
index 17b2c66dc8..64b64f902f 100644
--- a/src/web/app/desktop/tags/timeline.tag
+++ b/src/web/app/desktop/tags/timeline.tag
@@ -112,7 +112,7 @@
</header>
<div class="body">
<div class="text" ref="text">
- <p class="channel" if={ p.channel != null }><a href={ '/channel/' + p.channel.id }>{ p.channel.title }</a>:</p>
+ <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>
diff --git a/src/web/app/desktop/tags/ui.tag b/src/web/app/desktop/tags/ui.tag
index 7527358dce..3123c34f4f 100644
--- a/src/web/app/desktop/tags/ui.tag
+++ b/src/web/app/desktop/tags/ui.tag
@@ -335,10 +335,10 @@
</a>
</li>
</virtual>
- <li class="channels">
- <a href={ CONFIG.url + '/channel' }>
+ <li class="ch">
+ <a href={ CONFIG.chUrl } target="_blank">
<i class="fa fa-television"></i>
- <p>%i18n:desktop.tags.mk-ui-header-nav.channels%</p>
+ <p>%i18n:desktop.tags.mk-ui-header-nav.ch%</p>
</a>
</li>
<li class="info">