summaryrefslogtreecommitdiff
path: root/src/web
diff options
context:
space:
mode:
Diffstat (limited to 'src/web')
-rw-r--r--src/web/app/boot.js2
-rw-r--r--src/web/app/common/scripts/date-stringify.ls2
-rw-r--r--src/web/app/common/scripts/messaging-stream.ls2
-rw-r--r--src/web/app/common/scripts/stream.ls5
-rw-r--r--src/web/app/common/scripts/text-compiler.js6
-rw-r--r--src/web/app/common/tags/time.tag2
-rw-r--r--src/web/app/desktop/script.js5
-rw-r--r--src/web/app/desktop/tags.ls2
-rw-r--r--src/web/app/desktop/tags/log-window.tag20
-rw-r--r--src/web/app/desktop/tags/log.tag62
-rw-r--r--src/web/app/mobile/tags/user-preview.tag49
11 files changed, 27 insertions, 130 deletions
diff --git a/src/web/app/boot.js b/src/web/app/boot.js
index 5067600c6c..e8e504c2bb 100644
--- a/src/web/app/boot.js
+++ b/src/web/app/boot.js
@@ -39,7 +39,7 @@ try {
checkForUpdate();
// Get token from cookie
-const i = (document.cookie.match(/i=(\w+)/) || [null, null])[1];
+const i = (document.cookie.match(/i=(!\w+)/) || [null, null])[1];
// ユーザーをフェッチしてコールバックする
module.exports = callback => {
diff --git a/src/web/app/common/scripts/date-stringify.ls b/src/web/app/common/scripts/date-stringify.ls
index 9aa8b3e6c5..7e85192ce7 100644
--- a/src/web/app/common/scripts/date-stringify.ls
+++ b/src/web/app/common/scripts/date-stringify.ls
@@ -3,7 +3,7 @@ module.exports = (date) ->
text =
date.get-full-year! + \年 +
- date.get-month! + \月 +
+ date.get-month! + 1 + \月 +
date.get-date! + \日 +
' ' +
date.get-hours! + \時 +
diff --git a/src/web/app/common/scripts/messaging-stream.ls b/src/web/app/common/scripts/messaging-stream.ls
index 298285dc93..ac3e74f1f5 100644
--- a/src/web/app/common/scripts/messaging-stream.ls
+++ b/src/web/app/common/scripts/messaging-stream.ls
@@ -9,7 +9,7 @@ class Connection
@event = riot.observable!
@me = me
host = CONFIG.api.url.replace \http \ws
- @socket = new ReconnectingWebSocket "#{host}/messaging?otherparty=#{otherparty}"
+ @socket = new ReconnectingWebSocket "#{host}/messaging?i=#{me.token}&otherparty=#{otherparty}"
@socket.add-event-listener \open @on-open
@socket.add-event-listener \message @on-message
diff --git a/src/web/app/common/scripts/stream.ls b/src/web/app/common/scripts/stream.ls
index 534048248f..64ae03817a 100644
--- a/src/web/app/common/scripts/stream.ls
+++ b/src/web/app/common/scripts/stream.ls
@@ -9,13 +9,12 @@ module.exports = (me) ~>
state-ev = riot.observable!
event = riot.observable!
- socket = new ReconnectingWebSocket CONFIG.api.url.replace \http \ws
+ host = CONFIG.api.url.replace \http \ws
+ socket = new ReconnectingWebSocket "#{host}?i=#{me.token}"
socket.onopen = ~>
state := \connected
state-ev.trigger \connected
- socket.send JSON.stringify do
- i: me.token
socket.onclose = ~>
state := \reconnecting
diff --git a/src/web/app/common/scripts/text-compiler.js b/src/web/app/common/scripts/text-compiler.js
index f6c531c6ce..8ea2361b87 100644
--- a/src/web/app/common/scripts/text-compiler.js
+++ b/src/web/app/common/scripts/text-compiler.js
@@ -1,4 +1,5 @@
const riot = require('riot');
+const nyaize = require('nyaize').default;
module.exports = function(tokens, shouldBreak, escape) {
if (shouldBreak == null) {
@@ -34,10 +35,7 @@ module.exports = function(tokens, shouldBreak, escape) {
}).join('');
if (me && me.data && me.data.nya) {
- text = text.replace(/な/g, 'にゃ')
- .replace(/ニャ/g, 'にゃ')
- .replace(/にゃでにゃで/g, 'なでなで')
- .replace(/ニャデニャデ/g, 'ナデナデ');
+ text = nyaize(text);
}
return text;
diff --git a/src/web/app/common/tags/time.tag b/src/web/app/common/tags/time.tag
index 56c3b8ecc3..52ad89a44f 100644
--- a/src/web/app/common/tags/time.tag
+++ b/src/web/app/common/tags/time.tag
@@ -11,7 +11,7 @@ script.
@absolute =
@time.get-full-year! + \年 +
- @time.get-month! + \月 +
+ @time.get-month! + 1 + \月 +
@time.get-date! + \日 +
' ' +
@time.get-hours! + \時 +
diff --git a/src/web/app/desktop/script.js b/src/web/app/desktop/script.js
index 179cfa332a..980ae9772d 100644
--- a/src/web/app/desktop/script.js
+++ b/src/web/app/desktop/script.js
@@ -32,11 +32,6 @@ boot(me => {
// Register mixins
mixins(me);
- // Debug
- if (me != null && me.data.debug) {
- riot.mount(document.body.appendChild(document.createElement('mk-log-window')));
- }
-
// Start routing
route(me);
});
diff --git a/src/web/app/desktop/tags.ls b/src/web/app/desktop/tags.ls
index f78d367341..90e888ee9a 100644
--- a/src/web/app/desktop/tags.ls
+++ b/src/web/app/desktop/tags.ls
@@ -99,5 +99,3 @@ require './tags/user-followers-window.tag'
require './tags/list-user.tag'
require './tags/ui-notification.tag'
require './tags/signin-history.tag'
-require './tags/log.tag'
-require './tags/log-window.tag'
diff --git a/src/web/app/desktop/tags/log-window.tag b/src/web/app/desktop/tags/log-window.tag
deleted file mode 100644
index 6dabc4de34..0000000000
--- a/src/web/app/desktop/tags/log-window.tag
+++ /dev/null
@@ -1,20 +0,0 @@
-mk-log-window
- mk-window@window(width={ '600px' }, height={ '400px' })
- <yield to="header">
- i.fa.fa-terminal
- | Log
- </yield>
- <yield to="content">
- mk-log
- </yield>
-
-style.
- > mk-window
- [data-yield='header']
- > i
- margin-right 4px
-
-script.
- @on \mount ~>
- @refs.window.on \closed ~>
- @unmount!
diff --git a/src/web/app/desktop/tags/log.tag b/src/web/app/desktop/tags/log.tag
deleted file mode 100644
index 20e5f8f699..0000000000
--- a/src/web/app/desktop/tags/log.tag
+++ /dev/null
@@ -1,62 +0,0 @@
-mk-log
- header
- button.follow(class={ following: following }, onclick={ follow }) Follow
- div.logs@logs
- code(each={ logs })
- span.date { date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds() }
- span.message { message }
-
-style.
- display block
- height 100%
- color #fff
- background #000
-
- > header
- height 32px
- background #343a42
-
- > button
- line-height 32px
-
- > .follow
- position absolute
- top 0
- right 0
-
- &.following
- color #ff0
-
- > .logs
- height calc(100% - 32px)
- overflow auto
-
- > code
- display block
- padding 4px 8px
-
- &:hover
- background rgba(#fff, 0.15)
-
- > .date
- margin-right 8px
- opacity 0.5
-
-script.
- @mixin \log
-
- @following = true
-
- @on \mount ~>
- @log-event.on \log @on-log
-
- @on \unmount ~>
- @log-event.off \log @on-log
-
- @follow = ~>
- @following = true
-
- @on-log = ~>
- @update!
- if @following
- @refs.logs.scroll-top = @refs.logs.scroll-height
diff --git a/src/web/app/mobile/tags/user-preview.tag b/src/web/app/mobile/tags/user-preview.tag
index 4f5fbc1520..56bd93825c 100644
--- a/src/web/app/mobile/tags/user-preview.tag
+++ b/src/web/app/mobile/tags/user-preview.tag
@@ -3,11 +3,10 @@ mk-user-preview
img.avatar(src={ user.avatar_url + '?thumbnail&size=64' }, alt='avatar')
div.main
header
- div.left
- a.name(href={ CONFIG.url + '/' + user.username })
- | { user.name }
- span.username
- | @{ user.username }
+ a.name(href={ CONFIG.url + '/' + user.username })
+ | { user.name }
+ span.username
+ | @{ user.username }
div.body
div.bio { user.bio }
@@ -57,36 +56,26 @@ style.
width calc(100% - 74px)
> header
- white-space nowrap
-
@media (min-width 500px)
margin-bottom 2px
- &:after
- content ""
- display block
- clear both
-
- > .left
- float left
-
- > .name
- display inline
- margin 0
- padding 0
- color #777
- font-size 1em
- font-weight 700
- text-align left
- text-decoration none
+ > .name
+ display inline
+ margin 0
+ padding 0
+ color #777
+ font-size 1em
+ font-weight 700
+ text-align left
+ text-decoration none
- &:hover
- text-decoration underline
+ &:hover
+ text-decoration underline
- > .username
- text-align left
- margin 0 0 0 8px
- color #ccc
+ > .username
+ text-align left
+ margin 0 0 0 8px
+ color #ccc
> .body