summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-02-20 10:34:57 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-02-20 10:34:57 +0900
commit91d8ee5a52ece1cb78e5e3bb74178d41761d540f (patch)
tree0c08cdc5739e7250ab724049ff0a327643ed2be9 /src
parentwip (diff)
downloadsharkey-91d8ee5a52ece1cb78e5e3bb74178d41761d540f.tar.gz
sharkey-91d8ee5a52ece1cb78e5e3bb74178d41761d540f.tar.bz2
sharkey-91d8ee5a52ece1cb78e5e3bb74178d41761d540f.zip
wip
Diffstat (limited to 'src')
-rw-r--r--src/web/app/auth/tags/form.tag4
-rw-r--r--src/web/app/auth/tags/index.tag2
-rw-r--r--src/web/app/common/tags/core-error.tag2
-rw-r--r--src/web/app/common/tags/messaging/form.tag12
-rw-r--r--src/web/app/common/tags/messaging/index.tag6
-rw-r--r--src/web/app/common/tags/messaging/room.tag30
-rw-r--r--src/web/app/common/tags/poll-editor.tag10
-rw-r--r--src/web/app/common/tags/poll.tag4
-rw-r--r--src/web/app/common/tags/signin-history.tag2
-rw-r--r--src/web/app/common/tags/signin.tag4
-rw-r--r--src/web/app/common/tags/signup.tag8
-rw-r--r--src/web/app/common/tags/time.tag2
-rw-r--r--src/web/app/common/tags/uploader.tag2
-rw-r--r--src/web/app/desktop/tags/analog-clock.tag2
-rw-r--r--src/web/app/desktop/tags/autocomplete-suggestion.tag24
-rw-r--r--src/web/app/desktop/tags/big-follow-button.tag6
-rw-r--r--src/web/app/desktop/tags/contextmenu.tag12
-rw-r--r--src/web/app/desktop/tags/crop-window.tag6
-rw-r--r--src/web/app/desktop/tags/dialog.tag4
-rw-r--r--src/web/app/desktop/tags/donation.tag2
-rw-r--r--src/web/app/desktop/tags/drive/base-contextmenu.tag8
-rw-r--r--src/web/app/desktop/tags/drive/browser-window.tag2
-rw-r--r--src/web/app/desktop/tags/drive/browser.tag58
-rw-r--r--src/web/app/desktop/tags/drive/file-contextmenu.tag16
-rw-r--r--src/web/app/desktop/tags/drive/file.tag8
-rw-r--r--src/web/app/desktop/tags/drive/folder-contextmenu.tag12
-rw-r--r--src/web/app/desktop/tags/drive/folder.tag20
-rw-r--r--src/web/app/desktop/tags/drive/nav-folder.tag14
-rw-r--r--src/web/app/desktop/tags/follow-button.tag6
-rw-r--r--src/web/app/desktop/tags/following-setuper.tag6
-rw-r--r--src/web/app/desktop/tags/go-top.tag8
-rw-r--r--src/web/app/desktop/tags/home-widgets/calendar.tag2
-rw-r--r--src/web/app/desktop/tags/home-widgets/mentions.tag18
-rw-r--r--src/web/app/desktop/tags/home-widgets/notifications.tag2
-rw-r--r--src/web/app/desktop/tags/home-widgets/photo-stream.tag2
-rw-r--r--src/web/app/desktop/tags/home-widgets/profile.tag4
-rw-r--r--src/web/app/desktop/tags/home-widgets/rss-reader.tag4
-rw-r--r--src/web/app/desktop/tags/home-widgets/timeline.tag22
-rw-r--r--src/web/app/desktop/tags/home-widgets/tips.tag4
-rw-r--r--src/web/app/desktop/tags/home-widgets/user-recommendation.tag4
-rw-r--r--src/web/app/desktop/tags/image-dialog.tag2
-rw-r--r--src/web/app/desktop/tags/images-viewer.tag4
-rw-r--r--src/web/app/desktop/tags/input-dialog.tag6
-rw-r--r--src/web/app/desktop/tags/notifications.tag2
-rw-r--r--src/web/app/desktop/tags/pages/entrance.tag6
-rw-r--r--src/web/app/desktop/tags/pages/entrance/signin.tag2
-rw-r--r--src/web/app/desktop/tags/pages/home.tag8
-rw-r--r--src/web/app/desktop/tags/post-detail-sub.tag2
-rw-r--r--src/web/app/desktop/tags/post-detail.tag8
-rw-r--r--src/web/app/desktop/tags/post-form.tag34
-rw-r--r--src/web/app/desktop/tags/progress-dialog.tag4
-rw-r--r--src/web/app/desktop/tags/repost-form-window.tag6
-rw-r--r--src/web/app/desktop/tags/repost-form.tag6
-rw-r--r--src/web/app/desktop/tags/search-posts.tag14
-rw-r--r--src/web/app/desktop/tags/select-file-from-drive-window.tag6
-rw-r--r--src/web/app/desktop/tags/set-avatar-suggestion.tag4
-rw-r--r--src/web/app/desktop/tags/set-banner-suggestion.tag4
-rw-r--r--src/web/app/desktop/tags/settings-window.tag2
-rw-r--r--src/web/app/desktop/tags/settings.tag12
-rw-r--r--src/web/app/desktop/tags/timeline-post.tag10
-rw-r--r--src/web/app/desktop/tags/timeline.tag12
-rw-r--r--src/web/app/desktop/tags/ui-header-account.tag16
-rw-r--r--src/web/app/desktop/tags/ui-header-clock.tag2
-rw-r--r--src/web/app/desktop/tags/ui-header-nav.tag6
-rw-r--r--src/web/app/desktop/tags/ui-header-notifications.tag12
-rw-r--r--src/web/app/desktop/tags/ui-header-post-button.tag2
-rw-r--r--src/web/app/desktop/tags/ui-header-search.tag2
-rw-r--r--src/web/app/desktop/tags/ui.tag10
-rw-r--r--src/web/app/desktop/tags/user-followers.tag2
-rw-r--r--src/web/app/desktop/tags/user-following.tag2
-rw-r--r--src/web/app/desktop/tags/user-header.tag16
-rw-r--r--src/web/app/desktop/tags/user-preview.tag2
-rw-r--r--src/web/app/desktop/tags/user-profile.tag4
-rw-r--r--src/web/app/desktop/tags/user-timeline.tag26
-rw-r--r--src/web/app/desktop/tags/users-list.tag6
-rw-r--r--src/web/app/desktop/tags/window.tag62
-rw-r--r--src/web/app/dev/tags/new-app-form.tag4
-rw-r--r--src/web/app/mobile/tags/drive-selector.tag4
-rw-r--r--src/web/app/mobile/tags/drive.tag30
-rw-r--r--src/web/app/mobile/tags/drive/file-viewer.tag2
-rw-r--r--src/web/app/mobile/tags/drive/file.tag2
-rw-r--r--src/web/app/mobile/tags/drive/folder.tag2
-rw-r--r--src/web/app/mobile/tags/follow-button.tag6
-rw-r--r--src/web/app/mobile/tags/home-timeline.tag8
-rw-r--r--src/web/app/mobile/tags/images-viewer.tag2
-rw-r--r--src/web/app/mobile/tags/notifications.tag2
-rw-r--r--src/web/app/mobile/tags/page/entrance.tag6
-rw-r--r--src/web/app/mobile/tags/page/home.tag8
-rw-r--r--src/web/app/mobile/tags/post-detail.tag8
-rw-r--r--src/web/app/mobile/tags/post-form.tag24
-rw-r--r--src/web/app/mobile/tags/search-posts.tag2
-rw-r--r--src/web/app/mobile/tags/timeline-post.tag6
-rw-r--r--src/web/app/mobile/tags/timeline.tag10
-rw-r--r--src/web/app/mobile/tags/ui-header.tag2
-rw-r--r--src/web/app/mobile/tags/ui-nav.tag2
-rw-r--r--src/web/app/mobile/tags/ui.tag8
-rw-r--r--src/web/app/mobile/tags/user-followers.tag2
-rw-r--r--src/web/app/mobile/tags/user-following.tag2
-rw-r--r--src/web/app/mobile/tags/user-timeline.tag2
-rw-r--r--src/web/app/mobile/tags/user.tag8
-rw-r--r--src/web/app/mobile/tags/users-list.tag6
101 files changed, 423 insertions, 423 deletions
diff --git a/src/web/app/auth/tags/form.tag b/src/web/app/auth/tags/form.tag
index b5ace73716..bb424d98c2 100644
--- a/src/web/app/auth/tags/form.tag
+++ b/src/web/app/auth/tags/form.tag
@@ -111,13 +111,13 @@
this.session = this.opts.session
this.app = @session.app
- cancel() {
+ this.cancel = () => {
this.api 'auth/deny' do
token: @session.token
.then =>
this.trigger('denied');
- accept() {
+ this.accept = () => {
this.api 'auth/accept' do
token: @session.token
.then =>
diff --git a/src/web/app/auth/tags/index.tag b/src/web/app/auth/tags/index.tag
index a9f7828b96..0059fef20f 100644
--- a/src/web/app/auth/tags/index.tag
+++ b/src/web/app/auth/tags/index.tag
@@ -127,7 +127,7 @@
this.state = 'fetch-session-error'
this.update();
- accepted() {
+ this.accepted = () => {
this.state = 'accepted'
this.update();
diff --git a/src/web/app/common/tags/core-error.tag b/src/web/app/common/tags/core-error.tag
index b424c8abb7..e74e205afd 100644
--- a/src/web/app/common/tags/core-error.tag
+++ b/src/web/app/common/tags/core-error.tag
@@ -57,7 +57,7 @@
</style>
<script>
- retry() {
+ this.retry = () => {
this.unmount();
this.opts.retry();
}
diff --git a/src/web/app/common/tags/messaging/form.tag b/src/web/app/common/tags/messaging/form.tag
index 4ae1706ff1..8e74fbd350 100644
--- a/src/web/app/common/tags/messaging/form.tag
+++ b/src/web/app/common/tags/messaging/form.tag
@@ -119,7 +119,7 @@
<script>
this.mixin('api');
- onpaste(e) {
+ this.onpaste = (e) => {
const data = e.clipboardData;
const items = data.items;
for (let i = 0; i < items.length; i++) {
@@ -130,17 +130,17 @@
}
}
- onkeypress(e) {
+ this.onkeypress = (e) => {
if ((e.which == 10 || e.which == 13) && e.ctrlKey) {
this.send();
}
}
- selectFile() {
+ this.selectFile = () => {
this.refs.file.click();
}
- selectFileFromDrive() {
+ this.selectFileFromDrive = () => {
const browser = document.body.appendChild(document.createElement('mk-select-file-from-drive-window'));
const event = riot.observable();
riot.mount(browser, {
@@ -152,7 +152,7 @@
});
}
- send() {
+ this.send = () => {
this.sending = true;
this.api('messaging/messages/create', {
user_id: this.opts.user.id,
@@ -166,7 +166,7 @@
this.update();
});
- clear() {
+ this.clear = () => {
this.refs.text.value = '';
this.files = [];
this.update();
diff --git a/src/web/app/common/tags/messaging/index.tag b/src/web/app/common/tags/messaging/index.tag
index e9a031a2bd..e7d110140a 100644
--- a/src/web/app/common/tags/messaging/index.tag
+++ b/src/web/app/common/tags/messaging/index.tag
@@ -305,7 +305,7 @@
});
}
- search() {
+ this.search = () => {
const q = this.refs.search.value;
if (q == '') {
this.searchResult = [];
@@ -323,7 +323,7 @@
.catch (err) =>
console.error err
- on-search-keydown(e) {
+ this.on-search-keydown = (e) => {
key = e.which
switch (key)
| 9, 40 => // Key[TAB] or Key[↓]
@@ -331,7 +331,7 @@
e.stopPropagation();
this.refs.search-result.childNodes[0].focus();
- on-search-result-keydown(i, e) {
+ this.on-search-result-keydown = (i, e) => {
key = e.which
switch (key)
| 10, 13 => // Key[ENTER]
diff --git a/src/web/app/common/tags/messaging/room.tag b/src/web/app/common/tags/messaging/room.tag
index a402585693..f04fd4638d 100644
--- a/src/web/app/common/tags/messaging/room.tag
+++ b/src/web/app/common/tags/messaging/room.tag
@@ -128,18 +128,18 @@
this.mixin('api');
this.mixin('messaging-stream');
- this.user = this.opts.user
- this.init = true
- this.sending = false
- this.messages = []
+ this.user = this.opts.user;
+ this.init = true;
+ this.sending = false;
+ this.messages = [];
- this.connection = new @MessagingStreamConnection this.I, @user.id
+ this.connection = new this.MessagingStreamConnection(this.I, this.user.id);
this.on('mount', () => {
- @connection.event.on 'message' this.on-message
- @connection.event.on 'read' this.on-read
+ this.connection.event.on('message' this.onMessage);
+ this.connection.event.on('read' this.onRead);
- document.add-event-listener 'visibilitychange' this.on-visibilitychange
+ document.addEventListener 'visibilitychange' this.on-visibilitychange
this.api 'messaging/messages' do
user_id: @user.id
@@ -156,7 +156,7 @@
@connection.event.off 'read' this.on-read
@connection.close!
- document.remove-event-listener 'visibilitychange' this.on-visibilitychange
+ document.removeEventListener 'visibilitychange' this.on-visibilitychange
this.on('update', () => {
@messages.for-each (message) =>
@@ -165,7 +165,7 @@
message._date = date
message._datetext = month + '月 ' + date + '日'
- on-message(message) {
+ this.on-message = (message) => {
is-bottom = @is-bottom!
@messages.push message
@@ -182,7 +182,7 @@
// Notify
@notify '新しいメッセージがあります'
- on-read(ids) {
+ this.on-read = (ids) => {
if not Array.isArray ids then ids = [ids]
ids.for-each (id) =>
if (@messages.some (x) => x.id == id)
@@ -190,15 +190,15 @@
@messages[exist].is_read = true
this.update();
- is-bottom() {
+ this.is-bottom = () => {
current = this.root.scroll-top + this.root.offset-height
max = this.root.scroll-height
current > (max - 32)
- scroll-to-bottom() {
+ this.scroll-to-bottom = () => {
this.root.scroll-top = this.root.scroll-height
- notify(message) {
+ this.notify = (message) => {
n = document.createElement 'p'
n.inner-HTML = '<i class="fa fa-arrow-circle-down"></i>' + message
n.onclick = =>
@@ -213,7 +213,7 @@
, 1000ms
, 4000ms
- on-visibilitychange() {
+ this.on-visibilitychange = () => {
if document.hidden then return
@messages.for-each (message) =>
if message.user_id != this.I.id and not message.is_read
diff --git a/src/web/app/common/tags/poll-editor.tag b/src/web/app/common/tags/poll-editor.tag
index e35d8e1369..9d9b28c763 100644
--- a/src/web/app/common/tags/poll-editor.tag
+++ b/src/web/app/common/tags/poll-editor.tag
@@ -88,26 +88,26 @@
<script>
this.choices = ['', ''];
- oninput(i, e) {
+ this.oninput = (i, e) => {
this.choices[i] = e.target.value;
}
- add() {
+ this.add = () => {
this.choices.push('');
this.update();
this.refs.choices.childNodes[this.choices.length - 1].childNodes[0].focus();
}
- remove(i) {
+ this.remove = (i) => {
this.choices = this.choices.filter((_, _i) => _i != i);
this.update();
}
- destroy() {
+ this.destroy = () => {
this.opts.ondestroy();
}
- get() {
+ this.get = () => {
return {
choices: this.choices.filter(choice => choice != '')
}
diff --git a/src/web/app/common/tags/poll.tag b/src/web/app/common/tags/poll.tag
index c9209c3a3b..6ddaf77595 100644
--- a/src/web/app/common/tags/poll.tag
+++ b/src/web/app/common/tags/poll.tag
@@ -76,11 +76,11 @@
this.isVoted = this.poll.choices.some(c => c.is_voted);
this.result = this.isVoted;
- toggleResult() {
+ this.toggleResult = () => {
this.result = !this.result;
}
- vote(id) {
+ this.vote = (id) => {
if (this.poll.choices.some(c => c.is_voted)) return;
this.api('posts/polls/vote', {
post_id: this.post.id,
diff --git a/src/web/app/common/tags/signin-history.tag b/src/web/app/common/tags/signin-history.tag
index 4b5c844b7f..97087e3473 100644
--- a/src/web/app/common/tags/signin-history.tag
+++ b/src/web/app/common/tags/signin-history.tag
@@ -68,7 +68,7 @@
this.on('unmount', () => {
@stream.off 'signin' this.on-signin
- on-signin(signin) {
+ this.on-signin = (signin) => {
@history.unshift signin
this.update();
</script>
diff --git a/src/web/app/common/tags/signin.tag b/src/web/app/common/tags/signin.tag
index 5cb63685fa..e71795708f 100644
--- a/src/web/app/common/tags/signin.tag
+++ b/src/web/app/common/tags/signin.tag
@@ -102,7 +102,7 @@
this.user = null;
this.signing = false;
- oninput() {
+ this.oninput = () => {
this.api 'users/show' do
username: this.refs.username.value
.then (user) =>
@@ -110,7 +110,7 @@
this.trigger 'user' user
this.update();
- onsubmit(e) {
+ this.onsubmit = (e) => {
e.preventDefault();
if this.refs.username.value == ''
diff --git a/src/web/app/common/tags/signup.tag b/src/web/app/common/tags/signup.tag
index 55b1b76138..f8ac1c19cd 100644
--- a/src/web/app/common/tags/signup.tag
+++ b/src/web/app/common/tags/signup.tag
@@ -199,7 +199,7 @@
head.appendChild script
});
- on-change-username() {
+ this.on-change-username = () => {
username = this.refs.username.value
if username == ''
@@ -232,7 +232,7 @@
this.username-state = 'error'
this.update();
- on-change-password() {
+ this.on-change-password = () => {
password = this.refs.password.value
if password == ''
@@ -252,7 +252,7 @@
this.refs.password-metar.style.width = (strength * 100) + '%'
- on-change-password-retype() {
+ this.on-change-password-retype = () => {
password = this.refs.password.value
retyped-password = this.refs.password-retype.value
@@ -265,7 +265,7 @@
else
this.password-retype-state = 'not-match'
- onsubmit(e) {
+ this.onsubmit = (e) => {
e.preventDefault();
username = this.refs.username.value
diff --git a/src/web/app/common/tags/time.tag b/src/web/app/common/tags/time.tag
index 9bdb7f4cd7..1311133539 100644
--- a/src/web/app/common/tags/time.tag
+++ b/src/web/app/common/tags/time.tag
@@ -22,7 +22,7 @@
if @mode == 'relative' or @mode == 'detail'
clear-interval @tickid
- tick() {
+ this.tick = () => {
now = new Date!
ago = (now - @time) / 1000ms
this.relative = switch
diff --git a/src/web/app/common/tags/uploader.tag b/src/web/app/common/tags/uploader.tag
index 72f6eaa224..f6e99892a1 100644
--- a/src/web/app/common/tags/uploader.tag
+++ b/src/web/app/common/tags/uploader.tag
@@ -145,7 +145,7 @@
this.uploads = []
- upload(file, folder) {
+ this.upload = (file, folder) => {
id = Math.random!
ctx =
diff --git a/src/web/app/desktop/tags/analog-clock.tag b/src/web/app/desktop/tags/analog-clock.tag
index 06896fe20b..c1390be649 100644
--- a/src/web/app/desktop/tags/analog-clock.tag
+++ b/src/web/app/desktop/tags/analog-clock.tag
@@ -16,7 +16,7 @@
this.on('unmount', () => {
clear-interval @clock
- draw() {
+ this.draw = () => {
now = new Date!
s = now.get-seconds!
m = now.get-minutes!
diff --git a/src/web/app/desktop/tags/autocomplete-suggestion.tag b/src/web/app/desktop/tags/autocomplete-suggestion.tag
index cf735255bb..29ce938b84 100644
--- a/src/web/app/desktop/tags/autocomplete-suggestion.tag
+++ b/src/web/app/desktop/tags/autocomplete-suggestion.tag
@@ -89,11 +89,11 @@
this.select = -1
this.on('mount', () => {
- @textarea.add-event-listener 'keydown' this.on-keydown
+ @textarea.addEventListener 'keydown' this.on-keydown
all = document.query-selector-all 'body *'
Array.prototype.for-each.call all, (el) =>
- el.add-event-listener 'mousedown' @mousedown
+ el.addEventListener 'mousedown' @mousedown
this.api 'users/search_by_username' do
query: @q
@@ -106,20 +106,20 @@
console.error err
this.on('unmount', () => {
- @textarea.remove-event-listener 'keydown' this.on-keydown
+ @textarea.removeEventListener 'keydown' this.on-keydown
all = document.query-selector-all 'body *'
Array.prototype.for-each.call all, (el) =>
- el.remove-event-listener 'mousedown' @mousedown
+ el.removeEventListener 'mousedown' @mousedown
- mousedown(e) {
+ this.mousedown = (e) => {
if (!contains this.root, e.target) and (this.root != e.target)
@close!
- on-click(e) {
+ this.on-click = (e) => {
@complete e.item
- on-keydown(e) {
+ this.on-keydown = (e) => {
key = e.which
switch (key)
| 10, 13 => // Key[ENTER]
@@ -147,7 +147,7 @@
| _ =>
@close!
- select-next() {
+ this.select-next = () => {
@select++
if @select >= @users.length
@@ -155,7 +155,7 @@
@apply-select!
- select-prev() {
+ this.select-prev = () => {
@select--
if @select < 0
@@ -163,17 +163,17 @@
@apply-select!
- apply-select() {
+ this.apply-select = () => {
this.refs.users.children.for-each (el) =>
el.remove-attribute 'data-selected'
this.refs.users.children[@select].setAttribute 'data-selected' \true
this.refs.users.children[@select].focus();
- complete(user) {
+ this.complete = (user) => {
this.opts.complete user
- close() {
+ this.close = () => {
this.opts.close!
function contains(parent, child)
diff --git a/src/web/app/desktop/tags/big-follow-button.tag b/src/web/app/desktop/tags/big-follow-button.tag
index 6c87e87558..78ecbc2d62 100644
--- a/src/web/app/desktop/tags/big-follow-button.tag
+++ b/src/web/app/desktop/tags/big-follow-button.tag
@@ -91,17 +91,17 @@
@stream.off 'follow' this.on-stream-follow
@stream.off 'unfollow' this.on-stream-unfollow
- on-stream-follow(user) {
+ this.on-stream-follow = (user) => {
if user.id == @user.id
this.user = user
this.update();
- on-stream-unfollow(user) {
+ this.on-stream-unfollow = (user) => {
if user.id == @user.id
this.user = user
this.update();
- onclick() {
+ this.onclick = () => {
this.wait = true
if @user.is_following
this.api 'following/delete' do
diff --git a/src/web/app/desktop/tags/contextmenu.tag b/src/web/app/desktop/tags/contextmenu.tag
index 0d8cb313ac..400090c6c4 100644
--- a/src/web/app/desktop/tags/contextmenu.tag
+++ b/src/web/app/desktop/tags/contextmenu.tag
@@ -94,19 +94,19 @@
</style>
<script>
- this.root.add-event-listener 'contextmenu' (e) =>
+ this.root.addEventListener 'contextmenu' (e) =>
e.preventDefault();
- mousedown(e) {
+ this.mousedown = (e) => {
e.preventDefault();
if (!contains this.root, e.target) and (this.root != e.target)
@close!
return false
- open(pos) {
+ this.open = (pos) => {
all = document.query-selector-all 'body *'
Array.prototype.for-each.call all, (el) =>
- el.add-event-listener 'mousedown' @mousedown
+ el.addEventListener 'mousedown' @mousedown
this.root.style.display = 'block'
this.root.style.left = pos.x + 'px'
this.root.style.top = pos.y + 'px'
@@ -121,10 +121,10 @@
easing: 'linear'
}
- close() {
+ this.close = () => {
all = document.query-selector-all 'body *'
Array.prototype.for-each.call all, (el) =>
- el.remove-event-listener 'mousedown' @mousedown
+ el.removeEventListener 'mousedown' @mousedown
this.trigger('closed');
this.unmount();
diff --git a/src/web/app/desktop/tags/crop-window.tag b/src/web/app/desktop/tags/crop-window.tag
index e022c76fa7..45704a4b58 100644
--- a/src/web/app/desktop/tags/crop-window.tag
+++ b/src/web/app/desktop/tags/crop-window.tag
@@ -172,16 +172,16 @@
highlight: no
view-mode: 1
- ok() {
+ this.ok = () => {
@cropper.get-cropped-canvas!.to-blob (blob) =>
this.trigger 'cropped' blob
this.refs.window.close!
- skip() {
+ this.skip = () => {
this.trigger('skiped');
this.refs.window.close!
- cancel() {
+ this.cancel = () => {
this.trigger('canceled');
this.refs.window.close!
</script>
diff --git a/src/web/app/desktop/tags/dialog.tag b/src/web/app/desktop/tags/dialog.tag
index a444ac18f6..f163f99b81 100644
--- a/src/web/app/desktop/tags/dialog.tag
+++ b/src/web/app/desktop/tags/dialog.tag
@@ -114,7 +114,7 @@
easing: [ 0, 0.5, 0.5, 1 ]
}
- close() {
+ this.close = () => {
this.refs.bg.style.pointer-events = 'none'
Velocity this.refs.bg, 'finish' true
Velocity this.refs.bg, {
@@ -138,7 +138,7 @@
this.unmount();
}
- bg-click() {
+ this.bg-click = () => {
if @can-through
if this.opts.on-through?
this.opts.on-through!
diff --git a/src/web/app/desktop/tags/donation.tag b/src/web/app/desktop/tags/donation.tag
index 9ce2ed819f..0946e430da 100644
--- a/src/web/app/desktop/tags/donation.tag
+++ b/src/web/app/desktop/tags/donation.tag
@@ -50,7 +50,7 @@
this.mixin('api');
this.mixin('i');
- close(e) {
+ this.close = (e) => {
e.preventDefault();
e.stopPropagation();
diff --git a/src/web/app/desktop/tags/drive/base-contextmenu.tag b/src/web/app/desktop/tags/drive/base-contextmenu.tag
index 7eb5fd3b98..9503e639d6 100644
--- a/src/web/app/desktop/tags/drive/base-contextmenu.tag
+++ b/src/web/app/desktop/tags/drive/base-contextmenu.tag
@@ -20,18 +20,18 @@
this.trigger('closed');
this.unmount();
- open(pos) {
+ this.open = (pos) => {
this.refs.ctx.open pos
- create-folder() {
+ this.create-folder = () => {
this.browser.create-folder!
this.refs.ctx.close!
- upload() {
+ this.upload = () => {
this.browser.select-local-file!
this.refs.ctx.close!
- url-upload() {
+ this.url-upload = () => {
this.browser.url-upload!
this.refs.ctx.close!
</script>
diff --git a/src/web/app/desktop/tags/drive/browser-window.tag b/src/web/app/desktop/tags/drive/browser-window.tag
index c36726444f..b5b2572d45 100644
--- a/src/web/app/desktop/tags/drive/browser-window.tag
+++ b/src/web/app/desktop/tags/drive/browser-window.tag
@@ -40,7 +40,7 @@
@update do
usage: info.usage / info.capacity * 100
- close() {
+ this.close = () => {
this.refs.window.close!
</script>
</mk-drive-browser-window>
diff --git a/src/web/app/desktop/tags/drive/browser.tag b/src/web/app/desktop/tags/drive/browser.tag
index 2a93afbb24..383da90188 100644
--- a/src/web/app/desktop/tags/drive/browser.tag
+++ b/src/web/app/desktop/tags/drive/browser.tag
@@ -289,27 +289,27 @@
@stream.off 'drive_folder_created' this.on-stream-drive-folder-created
@stream.off 'drive_folder_updated' this.on-stream-drive-folder-updated
- on-stream-drive-file-created(file) {
+ this.on-stream-drive-file-created = (file) => {
@add-file file, true
- on-stream-drive-file-updated(file) {
+ this.on-stream-drive-file-updated = (file) => {
current = if this.folder? then this.folder.id else null
if current != file.folder_id
@remove-file file
else
@add-file file, true
- on-stream-drive-folder-created(folder) {
+ this.on-stream-drive-folder-created = (folder) => {
@add-folder folder, true
- on-stream-drive-folder-updated(folder) {
+ this.on-stream-drive-folder-updated = (folder) => {
current = if this.folder? then this.folder.id else null
if current != folder.parent_id
@remove-folder folder
else
@add-folder folder, true
- onmousedown(e) {
+ this.onmousedown = (e) => {
if (contains this.refs.folders-container, e.target) or (contains this.refs.files-container, e.target)
return true
@@ -341,20 +341,20 @@
this.refs.selection.style.top = cursor-y + 'px'
up = (e) =>
- document.document-element.remove-event-listener 'mousemove' move
- document.document-element.remove-event-listener 'mouseup' up
+ document.document-element.removeEventListener 'mousemove' move
+ document.document-element.removeEventListener 'mouseup' up
this.refs.selection.style.display = 'none'
- document.document-element.add-event-listener 'mousemove' move
- document.document-element.add-event-listener 'mouseup' up
+ document.document-element.addEventListener 'mousemove' move
+ document.document-element.addEventListener 'mouseup' up
- path-oncontextmenu(e) {
+ this.path-oncontextmenu = (e) => {
e.preventDefault();
e.stop-immediate-propagation!
return false
- ondragover(e) {
+ this.ondragover = (e) => {
e.preventDefault();
e.stopPropagation();
@@ -371,15 +371,15 @@
e.dataTransfer.dropEffect = 'none'
return false
- ondragenter(e) {
+ this.ondragenter = (e) => {
e.preventDefault();
if !@is-drag-source
this.draghover = true
- ondragleave(e) {
+ this.ondragleave = (e) => {
this.draghover = false
- ondrop(e) {
+ this.ondrop = (e) => {
e.preventDefault();
e.stopPropagation();
@@ -438,7 +438,7 @@
return false
- oncontextmenu(e) {
+ this.oncontextmenu = (e) => {
e.preventDefault();
e.stop-immediate-propagation!
@@ -452,10 +452,10 @@
return false
- select-local-file() {
+ this.select-local-file = () => {
this.refs.file-input.click!
- url-upload() {
+ this.url-upload = () => {
url <~ @input-dialog do
'URLアップロード'
'アップロードしたいファイルのURL'
@@ -473,7 +473,7 @@
text: 'OK'
]
- create-folder() {
+ this.create-folder = () => {
name <~ @input-dialog do
'フォルダー作成'
'フォルダー名'
@@ -488,26 +488,26 @@
.catch (err) =>
console.error err
- change-file-input() {
+ this.change-file-input = () => {
files = this.refs.file-input.files
for i from 0 to files.length - 1
file = files.item i
@upload file, this.folder
- upload(file, folder) {
+ this.upload = (file, folder) => {
if folder? and typeof folder == 'object'
folder = folder.id
this.refs.uploader.upload file, folder
- get-selection() {
+ this.get-selection = () => {
this.files.filter (file) -> file._selected
- new-window(folder-id) {
+ this.new-window = (folder-id) => {
browser = document.body.appendChild document.createElement 'mk-drive-browser-window'
riot.mount browser, do
folder: folder-id
- move(target-folder) {
+ this.move = (target-folder) => {
if target-folder? and typeof target-folder == 'object'
target-folder = target-folder.id
@@ -537,7 +537,7 @@
.catch (err, text-status) ->
console.error err
- add-folder(folder, unshift = false) {
+ this.add-folder = (folder, unshift = false) => {
current = if this.folder? then this.folder.id else null
if current != folder.parent_id
return
@@ -555,7 +555,7 @@
this.update();
- add-file(file, unshift = false) {
+ this.add-file = (file, unshift = false) => {
current = if this.folder? then this.folder.id else null
if current != file.folder_id
return
@@ -573,26 +573,26 @@
this.update();
- remove-folder(folder) {
+ this.remove-folder = (folder) => {
if typeof folder == 'object'
folder = folder.id
this.folders = this.folders.filter (f) -> f.id != folder
this.update();
- remove-file(file) {
+ this.remove-file = (file) => {
if typeof file == 'object'
file = file.id
this.files = this.files.filter (f) -> f.id != file
this.update();
- go-root() {
+ this.go-root = () => {
if this.folder != null
this.folder = null
this.hierarchy-folders = []
this.update();
@load!
- load() {
+ this.load = () => {
this.folders = []
this.files = []
this.more-folders = false
diff --git a/src/web/app/desktop/tags/drive/file-contextmenu.tag b/src/web/app/desktop/tags/drive/file-contextmenu.tag
index 06e7085621..e8d75ccd4d 100644
--- a/src/web/app/desktop/tags/drive/file-contextmenu.tag
+++ b/src/web/app/desktop/tags/drive/file-contextmenu.tag
@@ -54,10 +54,10 @@
this.trigger('closed');
this.unmount();
- open(pos) {
+ this.open = (pos) => {
this.refs.ctx.open pos
- rename() {
+ this.rename = () => {
this.refs.ctx.close!
name <~ @input-dialog do
@@ -73,25 +73,25 @@
.catch (err) =>
console.error err
- copy-url() {
+ this.copy-url = () => {
@NotImplementedException!
- download() {
+ this.download = () => {
this.refs.ctx.close!
- set-avatar() {
+ this.set-avatar = () => {
this.refs.ctx.close!
@update-avatar this.I, null, this.file
- set-banner() {
+ this.set-banner = () => {
this.refs.ctx.close!
@update-banner this.I, null, this.file
- set-wallpaper() {
+ this.set-wallpaper = () => {
this.refs.ctx.close!
@update-wallpaper this.I, null, this.file
- add-app() {
+ this.add-app = () => {
@NotImplementedException!
</script>
</mk-drive-browser-file-contextmenu>
diff --git a/src/web/app/desktop/tags/drive/file.tag b/src/web/app/desktop/tags/drive/file.tag
index d41c5279fc..e0e9beb217 100644
--- a/src/web/app/desktop/tags/drive/file.tag
+++ b/src/web/app/desktop/tags/drive/file.tag
@@ -155,7 +155,7 @@
this.is-contextmenu-showing = false
- onclick() {
+ this.onclick = () => {
if this.browser.multiple
if this.file._selected?
this.file._selected = !this.file._selected
@@ -171,7 +171,7 @@
this.file._selected = true
this.browser.trigger 'change-selection' this.file
- oncontextmenu(e) {
+ this.oncontextmenu = (e) => {
e.preventDefault();
e.stop-immediate-propagation!
@@ -190,7 +190,7 @@
this.update();
return false
- ondragstart(e) {
+ this.ondragstart = (e) => {
e.dataTransfer.effect-allowed = 'move'
e.dataTransfer.set-data 'text' JSON.stringify do
type: 'file'
@@ -202,7 +202,7 @@
// (=あなたの子供が、ドラッグを開始しましたよ)
this.browser.is-drag-source = true
- ondragend(e) {
+ this.ondragend = (e) => {
this.is-dragging = false
this.browser.is-drag-source = false
</script>
diff --git a/src/web/app/desktop/tags/drive/folder-contextmenu.tag b/src/web/app/desktop/tags/drive/folder-contextmenu.tag
index df094d0bc7..92fb5457c2 100644
--- a/src/web/app/desktop/tags/drive/folder-contextmenu.tag
+++ b/src/web/app/desktop/tags/drive/folder-contextmenu.tag
@@ -24,30 +24,30 @@
this.browser = this.opts.browser
this.folder = this.opts.folder
- open(pos) {
+ this.open = (pos) => {
this.refs.ctx.open pos
this.refs.ctx.on('closed', () => {
this.trigger('closed');
this.unmount();
- move() {
+ this.move = () => {
this.browser.move this.folder.id
this.refs.ctx.close!
- new-window() {
+ this.new-window = () => {
this.browser.new-window this.folder.id
this.refs.ctx.close!
- create-folder() {
+ this.create-folder = () => {
this.browser.create-folder!
this.refs.ctx.close!
- upload() {
+ this.upload = () => {
this.browser.select-lcoal-file!
this.refs.ctx.close!
- rename() {
+ this.rename = () => {
this.refs.ctx.close!
name <~ @input-dialog do
diff --git a/src/web/app/desktop/tags/drive/folder.tag b/src/web/app/desktop/tags/drive/folder.tag
index 2d58ddefc7..25524a80d6 100644
--- a/src/web/app/desktop/tags/drive/folder.tag
+++ b/src/web/app/desktop/tags/drive/folder.tag
@@ -61,16 +61,16 @@
this.draghover = false
this.is-contextmenu-showing = false
- onclick() {
+ this.onclick = () => {
this.browser.move this.folder
- onmouseover() {
+ this.onmouseover = () => {
this.hover = true
- onmouseout() {
+ this.onmouseout = () => {
this.hover = false
- ondragover(e) {
+ this.ondragover = (e) => {
e.preventDefault();
e.stopPropagation();
@@ -86,14 +86,14 @@
e.dataTransfer.dropEffect = 'none'
return false
- ondragenter() {
+ this.ondragenter = () => {
if !@is-dragging
this.draghover = true
- ondragleave() {
+ this.ondragleave = () => {
this.draghover = false
- ondrop(e) {
+ this.ondrop = (e) => {
e.stopPropagation();
this.draghover = false
@@ -146,7 +146,7 @@
return false
- ondragstart(e) {
+ this.ondragstart = (e) => {
e.dataTransfer.effect-allowed = 'move'
e.dataTransfer.set-data 'text' JSON.stringify do
type: 'folder'
@@ -157,11 +157,11 @@
// (=あなたの子供が、ドラッグを開始しましたよ)
this.browser.is-drag-source = true
- ondragend(e) {
+ this.ondragend = (e) => {
this.is-dragging = false
this.browser.is-drag-source = false
- oncontextmenu(e) {
+ this.oncontextmenu = (e) => {
e.preventDefault();
e.stop-immediate-propagation!
diff --git a/src/web/app/desktop/tags/drive/nav-folder.tag b/src/web/app/desktop/tags/drive/nav-folder.tag
index 8f8f00783a..5a620d76c8 100644
--- a/src/web/app/desktop/tags/drive/nav-folder.tag
+++ b/src/web/app/desktop/tags/drive/nav-folder.tag
@@ -16,16 +16,16 @@
this.hover = false
- onclick() {
+ this.onclick = () => {
this.browser.move this.folder
- onmouseover() {
+ this.onmouseover = () => {
this.hover = true
- onmouseout() {
+ this.onmouseout = () => {
this.hover = false
- ondragover(e) {
+ this.ondragover = (e) => {
e.preventDefault();
e.stopPropagation();
@@ -39,15 +39,15 @@
e.dataTransfer.dropEffect = 'move'
return false
- ondragenter() {
+ this.ondragenter = () => {
if this.folder != null or this.browser.folder != null
this.draghover = true
- ondragleave() {
+ this.ondragleave = () => {
if this.folder != null or this.browser.folder != null
this.draghover = false
- ondrop(e) {
+ this.ondrop = (e) => {
e.stopPropagation();
this.draghover = false
diff --git a/src/web/app/desktop/tags/follow-button.tag b/src/web/app/desktop/tags/follow-button.tag
index 575c99c700..87284cbc04 100644
--- a/src/web/app/desktop/tags/follow-button.tag
+++ b/src/web/app/desktop/tags/follow-button.tag
@@ -88,17 +88,17 @@
@stream.off 'follow' this.on-stream-follow
@stream.off 'unfollow' this.on-stream-unfollow
- on-stream-follow(user) {
+ this.on-stream-follow = (user) => {
if user.id == @user.id
this.user = user
this.update();
- on-stream-unfollow(user) {
+ this.on-stream-unfollow = (user) => {
if user.id == @user.id
this.user = user
this.update();
- onclick() {
+ this.onclick = () => {
this.wait = true
if @user.is_following
this.api 'following/delete' do
diff --git a/src/web/app/desktop/tags/following-setuper.tag b/src/web/app/desktop/tags/following-setuper.tag
index 5faba3e653..fd1aa4bc88 100644
--- a/src/web/app/desktop/tags/following-setuper.tag
+++ b/src/web/app/desktop/tags/following-setuper.tag
@@ -135,7 +135,7 @@
this.on('mount', () => {
@load!
- load() {
+ this.load = () => {
this.loading = true
this.users = null
this.update();
@@ -150,14 +150,14 @@
.catch (err, text-status) ->
console.error err
- refresh() {
+ this.refresh = () => {
if @users.length < @limit
this.page = 0
else
@page++
@load!
- close() {
+ this.close = () => {
this.unmount();
</script>
</mk-following-setuper>
diff --git a/src/web/app/desktop/tags/go-top.tag b/src/web/app/desktop/tags/go-top.tag
index 42efaf2f2a..cb75c04807 100644
--- a/src/web/app/desktop/tags/go-top.tag
+++ b/src/web/app/desktop/tags/go-top.tag
@@ -1,11 +1,11 @@
<mk-go-top>
<button class="hidden" title="一番上へ"><i class="fa fa-angle-up"></i></button>
<script>
- window.add-event-listener 'load' this.on-scroll
- window.add-event-listener 'scroll' this.on-scroll
- window.add-event-listener 'resize' this.on-scroll
+ window.addEventListener 'load' this.on-scroll
+ window.addEventListener 'scroll' this.on-scroll
+ window.addEventListener 'resize' this.on-scroll
- on-scroll() {
+ this.on-scroll = () => {
if $ window .scroll-top! > 500px
@remove-class 'hidden'
else
diff --git a/src/web/app/desktop/tags/home-widgets/calendar.tag b/src/web/app/desktop/tags/home-widgets/calendar.tag
index 81378b8a7c..fb8d889629 100644
--- a/src/web/app/desktop/tags/home-widgets/calendar.tag
+++ b/src/web/app/desktop/tags/home-widgets/calendar.tag
@@ -106,7 +106,7 @@
</style>
<script>
- draw() {
+ this.draw = () => {
now = new Date!
nd = now.get-date!
nm = now.get-month!
diff --git a/src/web/app/desktop/tags/home-widgets/mentions.tag b/src/web/app/desktop/tags/home-widgets/mentions.tag
index 149a302386..492eacb177 100644
--- a/src/web/app/desktop/tags/home-widgets/mentions.tag
+++ b/src/web/app/desktop/tags/home-widgets/mentions.tag
@@ -55,23 +55,23 @@
this.mode = 'all'
this.on('mount', () => {
- document.add-event-listener 'keydown' this.on-document-keydown
- window.add-event-listener 'scroll' this.on-scroll
+ document.addEventListener 'keydown' this.on-document-keydown
+ window.addEventListener 'scroll' this.on-scroll
@fetch =>
this.trigger('loaded');
this.on('unmount', () => {
- document.remove-event-listener 'keydown' this.on-document-keydown
- window.remove-event-listener 'scroll' this.on-scroll
+ document.removeEventListener 'keydown' this.on-document-keydown
+ window.removeEventListener 'scroll' this.on-scroll
- on-document-keydown(e) {
+ this.on-document-keydown = (e) => {
tag = e.target.tag-name.to-lower-case!
if tag != 'input' and tag != 'textarea'
if e.which == 84 // t
this.refs.timeline.focus();
- fetch(cb) {
+ this.fetch = (cb) => {
this.api 'posts/mentions' do
following: @mode == 'following'
.then (posts) =>
@@ -84,7 +84,7 @@
console.error err
if cb? then cb!
- more() {
+ this.more = () => {
if @more-loading or @is-loading or this.refs.timeline.posts.length == 0
return
this.more-loading = true
@@ -99,12 +99,12 @@
.catch (err) =>
console.error err
- on-scroll() {
+ this.on-scroll = () => {
current = window.scroll-y + window.inner-height
if current > document.body.offset-height - 8
@more!
- set-mode(mode) {
+ this.set-mode = (mode) => {
@update do
mode: mode
@fetch!
diff --git a/src/web/app/desktop/tags/home-widgets/notifications.tag b/src/web/app/desktop/tags/home-widgets/notifications.tag
index 4ed7f63782..12520e95a3 100644
--- a/src/web/app/desktop/tags/home-widgets/notifications.tag
+++ b/src/web/app/desktop/tags/home-widgets/notifications.tag
@@ -43,7 +43,7 @@
</style>
<script>
- settings() {
+ this.settings = () => {
w = riot.mount document.body.appendChild document.createElement 'mk-settings-window' .0
w.switch 'notification'
</script>
diff --git a/src/web/app/desktop/tags/home-widgets/photo-stream.tag b/src/web/app/desktop/tags/home-widgets/photo-stream.tag
index 9b7756108e..f7a80f40a9 100644
--- a/src/web/app/desktop/tags/home-widgets/photo-stream.tag
+++ b/src/web/app/desktop/tags/home-widgets/photo-stream.tag
@@ -77,7 +77,7 @@
this.on('unmount', () => {
@stream.off 'drive_file_created' this.on-stream-drive-file-created
- on-stream-drive-file-created(file) {
+ this.on-stream-drive-file-created = (file) => {
if /^image\/.+$/.test file.type
@images.unshift file
if @images.length > 9
diff --git a/src/web/app/desktop/tags/home-widgets/profile.tag b/src/web/app/desktop/tags/home-widgets/profile.tag
index 3cff6b682c..72b2c18c38 100644
--- a/src/web/app/desktop/tags/home-widgets/profile.tag
+++ b/src/web/app/desktop/tags/home-widgets/profile.tag
@@ -46,10 +46,10 @@
this.mixin('update-avatar');
this.mixin('update-banner');
- set-avatar() {
+ this.set-avatar = () => {
@update-avatar this.I
- set-banner() {
+ this.set-banner = () => {
@update-banner this.I
</script>
</mk-profile-home-widget>
diff --git a/src/web/app/desktop/tags/home-widgets/rss-reader.tag b/src/web/app/desktop/tags/home-widgets/rss-reader.tag
index 6778ea3bbb..2ced342a43 100644
--- a/src/web/app/desktop/tags/home-widgets/rss-reader.tag
+++ b/src/web/app/desktop/tags/home-widgets/rss-reader.tag
@@ -78,7 +78,7 @@
this.on('unmount', () => {
clear-interval @clock
- fetch() {
+ this.fetch = () => {
this.api CONFIG.url + '/api:rss' do
url: @url
.then (feed) =>
@@ -88,7 +88,7 @@
.catch (err) ->
console.error err
- settings() {
+ this.settings = () => {
@NotImplementedException!
</script>
</mk-rss-reader-home-widget>
diff --git a/src/web/app/desktop/tags/home-widgets/timeline.tag b/src/web/app/desktop/tags/home-widgets/timeline.tag
index 1fcf4ab572..dbeac5eaf8 100644
--- a/src/web/app/desktop/tags/home-widgets/timeline.tag
+++ b/src/web/app/desktop/tags/home-widgets/timeline.tag
@@ -46,8 +46,8 @@
@stream.on 'follow' this.on-stream-follow
@stream.on 'unfollow' this.on-stream-unfollow
- document.add-event-listener 'keydown' this.on-document-keydown
- window.add-event-listener 'scroll' this.on-scroll
+ document.addEventListener 'keydown' this.on-document-keydown
+ window.addEventListener 'scroll' this.on-scroll
@load =>
this.trigger('loaded');
@@ -57,16 +57,16 @@
@stream.off 'follow' this.on-stream-follow
@stream.off 'unfollow' this.on-stream-unfollow
- document.remove-event-listener 'keydown' this.on-document-keydown
- window.remove-event-listener 'scroll' this.on-scroll
+ document.removeEventListener 'keydown' this.on-document-keydown
+ window.removeEventListener 'scroll' this.on-scroll
- on-document-keydown(e) {
+ this.on-document-keydown = (e) => {
tag = e.target.tag-name.to-lower-case!
if tag != 'input' and tag != 'textarea'
if e.which == 84 // t
this.refs.timeline.focus();
- load(cb) {
+ this.load = (cb) => {
this.api 'posts/timeline'
.then (posts) =>
this.is-loading = false
@@ -78,7 +78,7 @@
console.error err
if cb? then cb!
- more() {
+ this.more = () => {
if @more-loading or @is-loading or this.refs.timeline.posts.length == 0
return
this.more-loading = true
@@ -92,18 +92,18 @@
.catch (err) =>
console.error err
- on-stream-post(post) {
+ this.on-stream-post = (post) => {
this.is-empty = false
this.update();
this.refs.timeline.add-post post
- on-stream-follow() {
+ this.on-stream-follow = () => {
@load!
- on-stream-unfollow() {
+ this.on-stream-unfollow = () => {
@load!
- on-scroll() {
+ this.on-scroll = () => {
current = window.scroll-y + window.inner-height
if current > document.body.offset-height - 8
@more!
diff --git a/src/web/app/desktop/tags/home-widgets/tips.tag b/src/web/app/desktop/tags/home-widgets/tips.tag
index c28514bbf2..08e1b1737e 100644
--- a/src/web/app/desktop/tags/home-widgets/tips.tag
+++ b/src/web/app/desktop/tags/home-widgets/tips.tag
@@ -48,11 +48,11 @@
this.on('unmount', () => {
clear-interval @clock
- set() {
+ this.set = () => {
this.refs.text.innerHTML = @tips[Math.floor Math.random! * @tips.length]
this.update();
- change() {
+ this.change = () => {
Velocity this.refs.tip, {
opacity: 0
} {
diff --git a/src/web/app/desktop/tags/home-widgets/user-recommendation.tag b/src/web/app/desktop/tags/home-widgets/user-recommendation.tag
index b2ec4ba888..f2a8a7476d 100644
--- a/src/web/app/desktop/tags/home-widgets/user-recommendation.tag
+++ b/src/web/app/desktop/tags/home-widgets/user-recommendation.tag
@@ -128,7 +128,7 @@
this.on('unmount', () => {
clear-interval @clock
- fetch(quiet = false) {
+ this.fetch = (quiet = false) => {
this.loading = true
this.users = null
if not quiet then this.update();
@@ -142,7 +142,7 @@
.catch (err, text-status) ->
console.error err
- refresh() {
+ this.refresh = () => {
if @users.length < @limit
this.page = 0
else
diff --git a/src/web/app/desktop/tags/image-dialog.tag b/src/web/app/desktop/tags/image-dialog.tag
index ae42a968bd..9a8a0e3b75 100644
--- a/src/web/app/desktop/tags/image-dialog.tag
+++ b/src/web/app/desktop/tags/image-dialog.tag
@@ -53,7 +53,7 @@
// easing: 'ease-out'
#}
- close() {
+ this.close = () => {
Velocity this.root, {
opacity: 0
} {
diff --git a/src/web/app/desktop/tags/images-viewer.tag b/src/web/app/desktop/tags/images-viewer.tag
index 7d552bc9ff..84190d34db 100644
--- a/src/web/app/desktop/tags/images-viewer.tag
+++ b/src/web/app/desktop/tags/images-viewer.tag
@@ -29,7 +29,7 @@
this.images = this.opts.images
this.image = @images.0
- mousemove(e) {
+ this.mousemove = (e) => {
rect = this.refs.view.get-bounding-client-rect!
mouse-x = e.client-x - rect.left
mouse-y = e.client-y - rect.top
@@ -37,7 +37,7 @@
yp = mouse-y / this.refs.view.offset-height * 100
this.refs.view.style.background-position = xp + '% ' + yp + '%'
- click() {
+ this.click = () => {
dialog = document.body.appendChild document.createElement 'mk-image-dialog'
riot.mount dialog, do
image: @image
diff --git a/src/web/app/desktop/tags/input-dialog.tag b/src/web/app/desktop/tags/input-dialog.tag
index c2cf093304..b5aefcd164 100644
--- a/src/web/app/desktop/tags/input-dialog.tag
+++ b/src/web/app/desktop/tags/input-dialog.tag
@@ -139,16 +139,16 @@
this.refs.window.on('closed', () => {
this.unmount();
- cancel() {
+ this.cancel = () => {
this.done = false
this.refs.window.close!
- ok() {
+ this.ok = () => {
if not @allow-empty and @text.value == '' then return
this.done = true
this.refs.window.close!
- on-keydown(e) {
+ this.on-keydown = (e) => {
if e.which == 13 // Enter
e.preventDefault();
e.stopPropagation();
diff --git a/src/web/app/desktop/tags/notifications.tag b/src/web/app/desktop/tags/notifications.tag
index 7ef13ad7eb..39a33e4102 100644
--- a/src/web/app/desktop/tags/notifications.tag
+++ b/src/web/app/desktop/tags/notifications.tag
@@ -199,7 +199,7 @@
this.on('unmount', () => {
@stream.off 'notification' this.on-notification
- on-notification(notification) {
+ this.on-notification = (notification) => {
@notifications.unshift notification
this.update();
diff --git a/src/web/app/desktop/tags/pages/entrance.tag b/src/web/app/desktop/tags/pages/entrance.tag
index 227aec3885..486f83f9dd 100644
--- a/src/web/app/desktop/tags/pages/entrance.tag
+++ b/src/web/app/desktop/tags/pages/entrance.tag
@@ -65,15 +65,15 @@
<script>
this.mode = 'signin'
- signup() {
+ this.signup = () => {
this.mode = 'signup'
this.update();
- signin() {
+ this.signin = () => {
this.mode = 'signin'
this.update();
- introduction() {
+ this.introduction = () => {
this.mode = 'introduction'
this.update();
</script>
diff --git a/src/web/app/desktop/tags/pages/entrance/signin.tag b/src/web/app/desktop/tags/pages/entrance/signin.tag
index 67a449a73d..b620c88b88 100644
--- a/src/web/app/desktop/tags/pages/entrance/signin.tag
+++ b/src/web/app/desktop/tags/pages/entrance/signin.tag
@@ -124,7 +124,7 @@
@update do
user: user
- introduction() {
+ this.introduction = () => {
this.parent.introduction!
</script>
</mk-entrance-signin>
diff --git a/src/web/app/desktop/tags/pages/home.tag b/src/web/app/desktop/tags/pages/home.tag
index 0f0bc4e378..3dd0b69d83 100644
--- a/src/web/app/desktop/tags/pages/home.tag
+++ b/src/web/app/desktop/tags/pages/home.tag
@@ -28,18 +28,18 @@
document.title = 'Misskey'
this.Progress.start();
@stream.on 'post' this.on-stream-post
- document.add-event-listener 'visibilitychange' @window-on-visibilitychange, false
+ document.addEventListener 'visibilitychange' @window-on-visibilitychange, false
this.on('unmount', () => {
@stream.off 'post' this.on-stream-post
- document.remove-event-listener 'visibilitychange' @window-on-visibilitychange
+ document.removeEventListener 'visibilitychange' @window-on-visibilitychange
- on-stream-post(post) {
+ this.on-stream-post = (post) => {
if document.hidden and post.user_id !== this.I.id
@unread-count++
document.title = '(' + @unread-count + ') ' + @get-post-summary post
- window-on-visibilitychange() {
+ this.window-on-visibilitychange = () => {
if !document.hidden
this.unread-count = 0
document.title = 'Misskey'
diff --git a/src/web/app/desktop/tags/post-detail-sub.tag b/src/web/app/desktop/tags/post-detail-sub.tag
index ccb475c768..1a6dbe0699 100644
--- a/src/web/app/desktop/tags/post-detail-sub.tag
+++ b/src/web/app/desktop/tags/post-detail-sub.tag
@@ -123,7 +123,7 @@
if e.tag-name == 'MK-URL'
riot.mount e
- like() {
+ this.like = () => {
if @post.is_liked
this.api 'posts/likes/delete' do
post_id: @post.id
diff --git a/src/web/app/desktop/tags/post-detail.tag b/src/web/app/desktop/tags/post-detail.tag
index 0443ff8836..c835521ad5 100644
--- a/src/web/app/desktop/tags/post-detail.tag
+++ b/src/web/app/desktop/tags/post-detail.tag
@@ -398,17 +398,17 @@
this.update();
- reply() {
+ this.reply = () => {
form = document.body.appendChild document.createElement 'mk-post-form-window'
riot.mount form, do
reply: @p
- repost() {
+ this.repost = () => {
form = document.body.appendChild document.createElement 'mk-repost-form-window'
riot.mount form, do
post: @p
- like() {
+ this.like = () => {
if @p.is_liked
this.api 'posts/likes/delete' do
post_id: @p.id
@@ -422,7 +422,7 @@
@p.is_liked = true
this.update();
- load-context() {
+ this.load-context = () => {
this.loading-context = true
// Get context
diff --git a/src/web/app/desktop/tags/post-form.tag b/src/web/app/desktop/tags/post-form.tag
index b1c06143bc..d49feba144 100644
--- a/src/web/app/desktop/tags/post-form.tag
+++ b/src/web/app/desktop/tags/post-form.tag
@@ -335,16 +335,16 @@
this.on('unmount', () => {
@autocomplete.detach!
- focus() {
+ this.focus = () => {
this.refs.text.focus();
- clear() {
+ this.clear = () => {
this.refs.text.value = ''
this.files = []
this.trigger('change-files');
this.update();
- ondragover(e) {
+ this.ondragover = (e) => {
e.stopPropagation();
this.draghover = true
// ドラッグされてきたものがファイルだったら
@@ -354,13 +354,13 @@
e.dataTransfer.dropEffect = 'move'
return false
- ondragenter(e) {
+ this.ondragenter = (e) => {
this.draghover = true
- ondragleave(e) {
+ this.ondragleave = (e) => {
this.draghover = false
- ondrop(e) {
+ this.ondrop = (e) => {
e.preventDefault();
e.stopPropagation();
this.draghover = false
@@ -388,11 +388,11 @@
return false
- onkeydown(e) {
+ this.onkeydown = (e) => {
if (e.which == 10 || e.which == 13) && (e.ctrlKey || e.meta-key)
@post!
- onpaste(e) {
+ this.onpaste = (e) => {
data = e.clipboardData
items = data.items
for i from 0 to items.length - 1
@@ -401,26 +401,26 @@
| 'file' =>
@upload item.getAsFile();
- select-file() {
+ this.select-file = () => {
this.refs.file.click!
- select-file-from-drive() {
+ this.select-file-from-drive = () => {
browser = document.body.appendChild document.createElement 'mk-select-file-from-drive-window'
i = riot.mount browser, do
multiple: true
i[0].one 'selected' (files) =>
files.for-each @add-file
- change-file() {
+ this.change-file = () => {
files = this.refs.file.files
for i from 0 to files.length - 1
file = files.item i
@upload file
- upload(file) {
+ this.upload = (file) => {
this.refs.uploader.upload file
- add-file(file) {
+ this.add-file = (file) => {
file._remove = =>
this.files = this.files.filter (x) -> x.id != file.id
this.trigger 'change-files' this.files
@@ -430,14 +430,14 @@
this.trigger 'change-files' this.files
this.update();
- add-poll() {
+ this.add-poll = () => {
this.poll = true
- on-poll-destroyed() {
+ this.on-poll-destroyed = () => {
@update do
poll: false
- post(e) {
+ this.post = (e) => {
this.wait = true
files = if this.files? and this.files.length > 0
@@ -459,7 +459,7 @@
this.wait = false
this.update();
- cat() {
+ this.cat = () => {
this.refs.text.value = this.refs.text.value + get-cat!
</script>
</mk-post-form>
diff --git a/src/web/app/desktop/tags/progress-dialog.tag b/src/web/app/desktop/tags/progress-dialog.tag
index bb5dea8b43..da0ed16d78 100644
--- a/src/web/app/desktop/tags/progress-dialog.tag
+++ b/src/web/app/desktop/tags/progress-dialog.tag
@@ -83,12 +83,12 @@
this.refs.window.on('closed', () => {
this.unmount();
- update-progress(value, max) {
+ this.update-progress = (value, max) => {
this.value = parse-int value, 10
this.max = parse-int max, 10
this.update();
- close() {
+ this.close = () => {
this.refs.window.close!
</script>
</mk-progress-dialog>
diff --git a/src/web/app/desktop/tags/repost-form-window.tag b/src/web/app/desktop/tags/repost-form-window.tag
index d66f98bb85..7af67094b0 100644
--- a/src/web/app/desktop/tags/repost-form-window.tag
+++ b/src/web/app/desktop/tags/repost-form-window.tag
@@ -12,7 +12,7 @@
</style>
<script>
- on-document-keydown(e) {
+ this.on-document-keydown = (e) => {
tag = e.target.tag-name.to-lower-case!
if tag != 'input' and tag != 'textarea'
if e.which == 27 // Esc
@@ -25,12 +25,12 @@
this.refs.window.refs.form.on('posted', () => {
this.refs.window.close!
- document.add-event-listener 'keydown' this.on-document-keydown
+ document.addEventListener 'keydown' this.on-document-keydown
this.refs.window.on('closed', () => {
this.unmount();
this.on('unmount', () => {
- document.remove-event-listener 'keydown' this.on-document-keydown
+ document.removeEventListener 'keydown' this.on-document-keydown
</script>
</mk-repost-form-window>
diff --git a/src/web/app/desktop/tags/repost-form.tag b/src/web/app/desktop/tags/repost-form.tag
index 58ef564bac..319b42dd01 100644
--- a/src/web/app/desktop/tags/repost-form.tag
+++ b/src/web/app/desktop/tags/repost-form.tag
@@ -120,10 +120,10 @@
this.wait = false
this.quote = false
- cancel() {
+ this.cancel = () => {
this.trigger('cancel');
- ok() {
+ this.ok = () => {
this.wait = true
this.api 'posts/create' do
repost_id: this.opts.post.id
@@ -138,7 +138,7 @@
this.wait = false
this.update();
- onquote() {
+ this.onquote = () => {
this.quote = true
</script>
</mk-repost-form>
diff --git a/src/web/app/desktop/tags/search-posts.tag b/src/web/app/desktop/tags/search-posts.tag
index a61a0a0614..a450e8a02c 100644
--- a/src/web/app/desktop/tags/search-posts.tag
+++ b/src/web/app/desktop/tags/search-posts.tag
@@ -38,8 +38,8 @@
this.page = 0
this.on('mount', () => {
- document.add-event-listener 'keydown' this.on-document-keydown
- window.add-event-listener 'scroll' this.on-scroll
+ document.addEventListener 'keydown' this.on-document-keydown
+ window.addEventListener 'scroll' this.on-scroll
this.api 'posts/search' do
query: @query
@@ -53,16 +53,16 @@
console.error err
this.on('unmount', () => {
- document.remove-event-listener 'keydown' this.on-document-keydown
- window.remove-event-listener 'scroll' this.on-scroll
+ document.removeEventListener 'keydown' this.on-document-keydown
+ window.removeEventListener 'scroll' this.on-scroll
- on-document-keydown(e) {
+ this.on-document-keydown = (e) => {
tag = e.target.tag-name.to-lower-case!
if tag != 'input' and tag != 'textarea'
if e.which == 84 // t
this.refs.timeline.focus();
- more() {
+ this.more = () => {
if @more-loading or @is-loading or @timeline.posts.length == 0
return
this.more-loading = true
@@ -78,7 +78,7 @@
.catch (err) =>
console.error err
- on-scroll() {
+ this.on-scroll = () => {
current = window.scroll-y + window.inner-height
if current > document.body.offset-height - 16 // 遊び
@more!
diff --git a/src/web/app/desktop/tags/select-file-from-drive-window.tag b/src/web/app/desktop/tags/select-file-from-drive-window.tag
index c8fc02d223..6979a55211 100644
--- a/src/web/app/desktop/tags/select-file-from-drive-window.tag
+++ b/src/web/app/desktop/tags/select-file-from-drive-window.tag
@@ -148,13 +148,13 @@
this.refs.window.on('closed', () => {
this.unmount();
- close() {
+ this.close = () => {
this.refs.window.close!
- upload() {
+ this.upload = () => {
this.refs.window.refs.browser.select-local-file!
- ok() {
+ this.ok = () => {
this.trigger 'selected' this.file
this.refs.window.close!
</script>
diff --git a/src/web/app/desktop/tags/set-avatar-suggestion.tag b/src/web/app/desktop/tags/set-avatar-suggestion.tag
index e398a6ed29..ba44a7a33d 100644
--- a/src/web/app/desktop/tags/set-avatar-suggestion.tag
+++ b/src/web/app/desktop/tags/set-avatar-suggestion.tag
@@ -34,10 +34,10 @@
this.mixin('i');
this.mixin('update-avatar');
- set() {
+ this.set = () => {
@update-avatar this.I
- close(e) {
+ this.close = (e) => {
e.preventDefault();
e.stopPropagation();
this.unmount();
diff --git a/src/web/app/desktop/tags/set-banner-suggestion.tag b/src/web/app/desktop/tags/set-banner-suggestion.tag
index 73c67a02bd..fa735e4e42 100644
--- a/src/web/app/desktop/tags/set-banner-suggestion.tag
+++ b/src/web/app/desktop/tags/set-banner-suggestion.tag
@@ -34,10 +34,10 @@
this.mixin('i');
this.mixin('update-banner');
- set() {
+ this.set = () => {
@update-banner this.I
- close(e) {
+ this.close = (e) => {
e.preventDefault();
e.stopPropagation();
this.unmount();
diff --git a/src/web/app/desktop/tags/settings-window.tag b/src/web/app/desktop/tags/settings-window.tag
index 4ffc5f2250..89219fccf8 100644
--- a/src/web/app/desktop/tags/settings-window.tag
+++ b/src/web/app/desktop/tags/settings-window.tag
@@ -19,7 +19,7 @@
this.refs.window.on('closed', () => {
this.unmount();
- close() {
+ this.close = () => {
this.refs.window.close!
</script>
</mk-settings-window>
diff --git a/src/web/app/desktop/tags/settings.tag b/src/web/app/desktop/tags/settings.tag
index e67a1b11a6..e4a83738e6 100644
--- a/src/web/app/desktop/tags/settings.tag
+++ b/src/web/app/desktop/tags/settings.tag
@@ -205,13 +205,13 @@
this.page = 'account'
- set-page(page) {
+ this.set-page = (page) => {
this.page = page
- avatar() {
+ this.avatar = () => {
@update-avatar this.I
- update-account() {
+ this.update-account = () => {
this.api 'i/update' do
name: this.refs.account-name.value
location: this.refs.account-location.value
@@ -222,19 +222,19 @@
.catch (err) =>
console.error err
- update-cache() {
+ this.update-cache = () => {
this.I.data.cache = !this.I.data.cache
this.api 'i/appdata/set' do
data: JSON.stringify do
cache: this.I.data.cache
- update-debug() {
+ this.update-debug = () => {
this.I.data.debug = !this.I.data.debug
this.api 'i/appdata/set' do
data: JSON.stringify do
debug: this.I.data.debug
- update-nya() {
+ this.update-nya = () => {
this.I.data.nya = !this.I.data.nya
this.api 'i/appdata/set' do
data: JSON.stringify do
diff --git a/src/web/app/desktop/tags/timeline-post.tag b/src/web/app/desktop/tags/timeline-post.tag
index ea1bed257b..5efc050638 100644
--- a/src/web/app/desktop/tags/timeline-post.tag
+++ b/src/web/app/desktop/tags/timeline-post.tag
@@ -349,17 +349,17 @@
riot.mount @preview, do
url: t.content
- reply() {
+ this.reply = () => {
form = document.body.appendChild document.createElement 'mk-post-form-window'
riot.mount form, do
reply: @p
- repost() {
+ this.repost = () => {
form = document.body.appendChild document.createElement 'mk-repost-form-window'
riot.mount form, do
post: @p
- like() {
+ this.like = () => {
if @p.is_liked
this.api 'posts/likes/delete' do
post_id: @p.id
@@ -373,11 +373,11 @@
@p.is_liked = true
this.update();
- toggle-detail() {
+ this.toggle-detail = () => {
this.is-detail-opened = !@is-detail-opened
this.update();
- on-key-down(e) {
+ this.on-key-down = (e) => {
should-be-cancel = true
switch
| e.which == 38 or e.which == 74 or (e.which == 9 and e.shift-key) => // ↑, j or Shift+Tab
diff --git a/src/web/app/desktop/tags/timeline.tag b/src/web/app/desktop/tags/timeline.tag
index 5967c2efdd..ebc6249c6b 100644
--- a/src/web/app/desktop/tags/timeline.tag
+++ b/src/web/app/desktop/tags/timeline.tag
@@ -46,24 +46,24 @@
<script>
this.posts = []
- set-posts(posts) {
+ this.set-posts = (posts) => {
this.posts = posts
this.update();
- prepend-posts(posts) {
+ this.prepend-posts = (posts) => {
posts.for-each (post) =>
@posts.push post
this.update();
- add-post(post) {
+ this.add-post = (post) => {
@posts.unshift post
this.update();
- clear() {
+ this.clear = () => {
this.posts = []
this.update();
- focus() {
+ this.focus = () => {
this.root.children.0.focus();
this.on('update', () => {
@@ -73,7 +73,7 @@
post._date = date
post._datetext = month + '月 ' + date + '日'
- tail() {
+ this.tail = () => {
@posts[@posts.length - 1]
</script>
</mk-timeline>
diff --git a/src/web/app/desktop/tags/ui-header-account.tag b/src/web/app/desktop/tags/ui-header-account.tag
index fa3f60a618..e6ededc750 100644
--- a/src/web/app/desktop/tags/ui-header-account.tag
+++ b/src/web/app/desktop/tags/ui-header-account.tag
@@ -167,37 +167,37 @@
this.on('before-unmount', () => {
@close!
- toggle() {
+ this.toggle = () => {
if @is-open
@close!
else
@open!
- open() {
+ this.open = () => {
this.is-open = true
this.update();
all = document.query-selector-all 'body *'
Array.prototype.for-each.call all, (el) =>
- el.add-event-listener 'mousedown' @mousedown
+ el.addEventListener 'mousedown' @mousedown
- close() {
+ this.close = () => {
this.is-open = false
this.update();
all = document.query-selector-all 'body *'
Array.prototype.for-each.call all, (el) =>
- el.remove-event-listener 'mousedown' @mousedown
+ el.removeEventListener 'mousedown' @mousedown
- mousedown(e) {
+ this.mousedown = (e) => {
e.preventDefault();
if (!contains this.root, e.target) and (this.root != e.target)
@close!
return false
- drive() {
+ this.drive = () => {
@close!
riot.mount document.body.appendChild document.createElement 'mk-drive-browser-window'
- settings() {
+ this.settings = () => {
@close!
riot.mount document.body.appendChild document.createElement 'mk-settings-window'
diff --git a/src/web/app/desktop/tags/ui-header-clock.tag b/src/web/app/desktop/tags/ui-header-clock.tag
index 339951fb6f..5b42cefbbf 100644
--- a/src/web/app/desktop/tags/ui-header-clock.tag
+++ b/src/web/app/desktop/tags/ui-header-clock.tag
@@ -58,7 +58,7 @@
</style>
<script>
- draw() {
+ this.draw = () => {
now = new Date!
yyyy = now.get-full-year!
diff --git a/src/web/app/desktop/tags/ui-header-nav.tag b/src/web/app/desktop/tags/ui-header-nav.tag
index 8f710600f9..88607d6a5b 100644
--- a/src/web/app/desktop/tags/ui-header-nav.tag
+++ b/src/web/app/desktop/tags/ui-header-nav.tag
@@ -98,15 +98,15 @@
@stream.off 'read_all_messaging_messages' this.on-read-all-messaging-messages
@stream.off 'unread_messaging_message' this.on-unread-messaging-message
- on-read-all-messaging-messages() {
+ this.on-read-all-messaging-messages = () => {
this.has-unread-messaging-messages = false
this.update();
- on-unread-messaging-message() {
+ this.on-unread-messaging-message = () => {
this.has-unread-messaging-messages = true
this.update();
- messaging() {
+ this.messaging = () => {
riot.mount document.body.appendChild document.createElement 'mk-messaging-window'
</script>
</ul>
diff --git a/src/web/app/desktop/tags/ui-header-notifications.tag b/src/web/app/desktop/tags/ui-header-notifications.tag
index 1768f915e5..0a355e022a 100644
--- a/src/web/app/desktop/tags/ui-header-notifications.tag
+++ b/src/web/app/desktop/tags/ui-header-notifications.tag
@@ -77,27 +77,27 @@
<script>
this.is-open = false
- toggle() {
+ this.toggle = () => {
if @is-open
@close!
else
@open!
- open() {
+ this.open = () => {
this.is-open = true
this.update();
all = document.query-selector-all 'body *'
Array.prototype.for-each.call all, (el) =>
- el.add-event-listener 'mousedown' @mousedown
+ el.addEventListener 'mousedown' @mousedown
- close() {
+ this.close = () => {
this.is-open = false
this.update();
all = document.query-selector-all 'body *'
Array.prototype.for-each.call all, (el) =>
- el.remove-event-listener 'mousedown' @mousedown
+ el.removeEventListener 'mousedown' @mousedown
- mousedown(e) {
+ this.mousedown = (e) => {
e.preventDefault();
if (!contains this.root, e.target) and (this.root != e.target)
@close!
diff --git a/src/web/app/desktop/tags/ui-header-post-button.tag b/src/web/app/desktop/tags/ui-header-post-button.tag
index 3d391ed2e9..3f339beb63 100644
--- a/src/web/app/desktop/tags/ui-header-post-button.tag
+++ b/src/web/app/desktop/tags/ui-header-post-button.tag
@@ -35,7 +35,7 @@
</style>
<script>
- post(e) {
+ this.post = (e) => {
this.parent.parent.open-post-form!
</script>
</mk-ui-header-post-button>
diff --git a/src/web/app/desktop/tags/ui-header-search.tag b/src/web/app/desktop/tags/ui-header-search.tag
index 69d2dd7324..cc8ca2ae02 100644
--- a/src/web/app/desktop/tags/ui-header-search.tag
+++ b/src/web/app/desktop/tags/ui-header-search.tag
@@ -34,7 +34,7 @@
<script>
this.mixin('page');
- onsubmit(e) {
+ this.onsubmit = (e) => {
e.preventDefault();
@page '/search:' + this.refs.q.value
</script>
diff --git a/src/web/app/desktop/tags/ui.tag b/src/web/app/desktop/tags/ui.tag
index 1ecb0f5706..1e2cba35be 100644
--- a/src/web/app/desktop/tags/ui.tag
+++ b/src/web/app/desktop/tags/ui.tag
@@ -14,20 +14,20 @@
<script>
this.mixin('i');
- open-post-form() {
+ this.open-post-form = () => {
riot.mount document.body.appendChild document.createElement 'mk-post-form-window'
- set-root-layout() {
+ this.set-root-layout = () => {
this.root.style.padding-top = this.refs.header.root.client-height + 'px'
this.on('mount', () => {
@set-root-layout!
- document.add-event-listener 'keydown' this.onkeydown
+ document.addEventListener 'keydown' this.onkeydown
this.on('unmount', () => {
- document.remove-event-listener 'keydown' this.onkeydown
+ document.removeEventListener 'keydown' this.onkeydown
- onkeydown(e) {
+ this.onkeydown = (e) => {
tag = e.target.tag-name.to-lower-case!
if tag != 'input' and tag != 'textarea'
if e.which == 80 or e.which == 78 // p or n
diff --git a/src/web/app/desktop/tags/user-followers.tag b/src/web/app/desktop/tags/user-followers.tag
index 0ae29a2099..53c3c89858 100644
--- a/src/web/app/desktop/tags/user-followers.tag
+++ b/src/web/app/desktop/tags/user-followers.tag
@@ -11,7 +11,7 @@
this.user = this.opts.user
- fetch(iknow, limit, cursor, cb) {
+ this.fetch = (iknow, limit, cursor, cb) => {
this.api 'users/followers' do
user_id: @user.id
iknow: iknow
diff --git a/src/web/app/desktop/tags/user-following.tag b/src/web/app/desktop/tags/user-following.tag
index f640ee7b62..a8f9ccb896 100644
--- a/src/web/app/desktop/tags/user-following.tag
+++ b/src/web/app/desktop/tags/user-following.tag
@@ -11,7 +11,7 @@
this.user = this.opts.user
- fetch(iknow, limit, cursor, cb) {
+ this.fetch = (iknow, limit, cursor, cb) => {
this.api 'users/following' do
user_id: @user.id
iknow: iknow
diff --git a/src/web/app/desktop/tags/user-header.tag b/src/web/app/desktop/tags/user-header.tag
index a2ed28b4f8..ff37b334e2 100644
--- a/src/web/app/desktop/tags/user-header.tag
+++ b/src/web/app/desktop/tags/user-header.tag
@@ -111,16 +111,16 @@
this.user = this.opts.user
this.on('mount', () => {
- window.add-event-listener 'load' @scroll
- window.add-event-listener 'scroll' @scroll
- window.add-event-listener 'resize' @scroll
+ window.addEventListener 'load' @scroll
+ window.addEventListener 'scroll' @scroll
+ window.addEventListener 'resize' @scroll
this.on('unmount', () => {
- window.remove-event-listener 'load' @scroll
- window.remove-event-listener 'scroll' @scroll
- window.remove-event-listener 'resize' @scroll
+ window.removeEventListener 'load' @scroll
+ window.removeEventListener 'scroll' @scroll
+ window.removeEventListener 'resize' @scroll
- scroll() {
+ this.scroll = () => {
top = window.scroll-y
height = 280px
@@ -131,7 +131,7 @@
if blur <= 10
this.refs.banner.style.filter = 'blur(' + blur + 'px)'
- on-update-banner() {
+ this.on-update-banner = () => {
if not @SIGNIN or this.I.id != @user.id
return
diff --git a/src/web/app/desktop/tags/user-preview.tag b/src/web/app/desktop/tags/user-preview.tag
index d17f7557d2..00da1d8f11 100644
--- a/src/web/app/desktop/tags/user-preview.tag
+++ b/src/web/app/desktop/tags/user-preview.tag
@@ -130,7 +130,7 @@
easing: 'ease-out'
}
- close() {
+ this.close = () => {
Velocity this.root, {
opacity: 0
'margin-top': '-8px'
diff --git a/src/web/app/desktop/tags/user-profile.tag b/src/web/app/desktop/tags/user-profile.tag
index a94f50c7bf..b613aa968a 100644
--- a/src/web/app/desktop/tags/user-profile.tag
+++ b/src/web/app/desktop/tags/user-profile.tag
@@ -86,12 +86,12 @@
this.user = this.opts.user
- show-following() {
+ this.show-following = () => {
window = document.body.appendChild document.createElement 'mk-user-following-window'
riot.mount window, do
user: @user
- show-followers() {
+ this.show-followers = () => {
window = document.body.appendChild document.createElement 'mk-user-followers-window'
riot.mount window, do
user: @user
diff --git a/src/web/app/desktop/tags/user-timeline.tag b/src/web/app/desktop/tags/user-timeline.tag
index b8e39b7307..ab82b2677f 100644
--- a/src/web/app/desktop/tags/user-timeline.tag
+++ b/src/web/app/desktop/tags/user-timeline.tag
@@ -59,9 +59,9 @@
this.mode = 'default'
this.on('mount', () => {
- document.add-event-listener 'visibilitychange' @window-on-visibilitychange, false
- document.add-event-listener 'keydown' this.on-document-keydown
- window.add-event-listener 'scroll' this.on-scroll
+ document.addEventListener 'visibilitychange' @window-on-visibilitychange, false
+ document.addEventListener 'keydown' this.on-document-keydown
+ window.addEventListener 'scroll' this.on-scroll
@user-promise.then (user) =>
this.user = user
@@ -71,17 +71,17 @@
this.trigger('loaded');
this.on('unmount', () => {
- document.remove-event-listener 'visibilitychange' @window-on-visibilitychange
- document.remove-event-listener 'keydown' this.on-document-keydown
- window.remove-event-listener 'scroll' this.on-scroll
+ document.removeEventListener 'visibilitychange' @window-on-visibilitychange
+ document.removeEventListener 'keydown' this.on-document-keydown
+ window.removeEventListener 'scroll' this.on-scroll
- on-document-keydown(e) {
+ this.on-document-keydown = (e) => {
tag = e.target.tag-name.to-lower-case!
if tag != 'input' and tag != 'textarea'
if e.which == 84 // t
this.refs.timeline.focus();
- fetch(cb) {
+ this.fetch = (cb) => {
this.api 'users/posts' do
user_id: @user.id
with_replies: @mode == 'with-replies'
@@ -95,7 +95,7 @@
console.error err
if cb? then cb!
- more() {
+ this.more = () => {
if @more-loading or @is-loading or this.refs.timeline.posts.length == 0
return
this.more-loading = true
@@ -111,7 +111,7 @@
.catch (err) =>
console.error err
- on-stream-post(post) {
+ this.on-stream-post = (post) => {
this.is-empty = false
this.update();
this.refs.timeline.add-post post
@@ -120,17 +120,17 @@
@unread-count++
document.title = '(' + @unread-count + ') ' + @get-post-summary post
- window-on-visibilitychange() {
+ this.window-on-visibilitychange = () => {
if !document.hidden
this.unread-count = 0
document.title = 'Misskey'
- on-scroll() {
+ this.on-scroll = () => {
current = window.scroll-y + window.inner-height
if current > document.body.offset-height - 16 // 遊び
@more!
- set-mode(mode) {
+ this.set-mode = (mode) => {
@update do
mode: mode
@fetch!
diff --git a/src/web/app/desktop/tags/users-list.tag b/src/web/app/desktop/tags/users-list.tag
index af0f35d634..9fd1239526 100644
--- a/src/web/app/desktop/tags/users-list.tag
+++ b/src/web/app/desktop/tags/users-list.tag
@@ -100,7 +100,7 @@
@fetch =>
this.trigger('loaded');
- fetch(cb) {
+ this.fetch = (cb) => {
this.fetching = true
this.update();
obj <~ this.opts.fetch do
@@ -113,7 +113,7 @@
this.update();
if cb? then cb!
- more() {
+ this.more = () => {
this.more-fetching = true
this.update();
obj <~ this.opts.fetch do
@@ -125,7 +125,7 @@
this.more-fetching = false
this.update();
- set-mode(mode) {
+ this.set-mode = (mode) => {
@update do
mode: mode
diff --git a/src/web/app/desktop/tags/window.tag b/src/web/app/desktop/tags/window.tag
index 71084f8b54..81011e9f50 100644
--- a/src/web/app/desktop/tags/window.tag
+++ b/src/web/app/desktop/tags/window.tag
@@ -207,17 +207,17 @@
this.refs.main.style.top = '15%'
this.refs.main.style.left = (window.inner-width / 2) - (this.refs.main.offset-width / 2) + 'px'
- this.refs.header.add-event-listener 'contextmenu' (e) =>
+ this.refs.header.addEventListener 'contextmenu' (e) =>
e.preventDefault();
- window.add-event-listener 'resize' this.on-browser-resize
+ window.addEventListener 'resize' this.on-browser-resize
@open!
this.on('unmount', () => {
- window.remove-event-listener 'resize' this.on-browser-resize
+ window.removeEventListener 'resize' this.on-browser-resize
- on-browser-resize() {
+ this.on-browser-resize = () => {
position = this.refs.main.get-bounding-client-rect!
browser-width = window.inner-width
browser-height = window.inner-height
@@ -236,7 +236,7 @@
if position.top + window-height > browser-height
this.refs.main.style.top = browser-height - window-height + 'px'
- open() {
+ this.open = () => {
this.trigger('opening');
@top!
@@ -270,7 +270,7 @@
this.trigger('opened');
, 300ms
- close() {
+ this.close = () => {
this.trigger('closing');
if @is-modal
@@ -300,7 +300,7 @@
, 300ms
// 最前面へ移動します
- top() {
+ this.top = () => {
z = 0
ws = document.query-selector-all 'mk-window'
@@ -314,20 +314,20 @@
this.refs.main.style.z-index = z + 1
if @is-modal then this.refs.bg.style.z-index = z + 1
- repel-move(e) {
+ this.repel-move = (e) => {
e.stopPropagation();
return true
- bg-click() {
+ this.bg-click = () => {
if @can-close
@close!
- on-body-mousedown(e) {
+ this.on-body-mousedown = (e) => {
@top!
true
// ヘッダー掴み時
- on-header-mousedown(e) {
+ this.on-header-mousedown = (e) => {
e.preventDefault();
if not contains this.refs.main, document.active-element
@@ -369,7 +369,7 @@
this.refs.main.style.top = move-top + 'px'
// 上ハンドル掴み時
- on-top-handle-mousedown(e) {
+ this.on-top-handle-mousedown = (e) => {
e.preventDefault();
base = e.client-y
@@ -391,7 +391,7 @@
@apply-transform-top 0
// 右ハンドル掴み時
- on-right-handle-mousedown(e) {
+ this.on-right-handle-mousedown = (e) => {
e.preventDefault();
base = e.client-x
@@ -411,7 +411,7 @@
@apply-transform-width browser-width - left
// 下ハンドル掴み時
- on-bottom-handle-mousedown(e) {
+ this.on-bottom-handle-mousedown = (e) => {
e.preventDefault();
base = e.client-y
@@ -431,7 +431,7 @@
@apply-transform-height browser-height - top
// 左ハンドル掴み時
- on-left-handle-mousedown(e) {
+ this.on-left-handle-mousedown = (e) => {
e.preventDefault();
base = e.client-x
@@ -453,55 +453,55 @@
@apply-transform-left 0
// 左上ハンドル掴み時
- on-top-left-handle-mousedown(e) {
+ this.on-top-left-handle-mousedown = (e) => {
this.on-top-handle-mousedown e
this.on-left-handle-mousedown e
// 右上ハンドル掴み時
- on-top-right-handle-mousedown(e) {
+ this.on-top-right-handle-mousedown = (e) => {
this.on-top-handle-mousedown e
this.on-right-handle-mousedown e
// 右下ハンドル掴み時
- on-bottom-right-handle-mousedown(e) {
+ this.on-bottom-right-handle-mousedown = (e) => {
this.on-bottom-handle-mousedown e
this.on-right-handle-mousedown e
// 左下ハンドル掴み時
- on-bottom-left-handle-mousedown(e) {
+ this.on-bottom-left-handle-mousedown = (e) => {
this.on-bottom-handle-mousedown e
this.on-left-handle-mousedown e
// 高さを適用
- apply-transform-height(height) {
+ this.apply-transform-height = (height) => {
this.refs.main.style.height = height + 'px'
// 幅を適用
- apply-transform-width(width) {
+ this.apply-transform-width = (width) => {
this.refs.main.style.width = width + 'px'
// Y座標を適用
- apply-transform-top(top) {
+ this.apply-transform-top = (top) => {
this.refs.main.style.top = top + 'px'
// X座標を適用
- apply-transform-left(left) {
+ this.apply-transform-left = (left) => {
this.refs.main.style.left = left + 'px'
function drag-listen fn
- window.add-event-listener 'mousemove' fn
- window.add-event-listener 'mouseleave' drag-clear.bind null fn
- window.add-event-listener 'mouseup' drag-clear.bind null fn
+ window.addEventListener 'mousemove' fn
+ window.addEventListener 'mouseleave' drag-clear.bind null fn
+ window.addEventListener 'mouseup' drag-clear.bind null fn
function drag-clear fn
- window.remove-event-listener 'mousemove' fn
- window.remove-event-listener 'mouseleave' drag-clear
- window.remove-event-listener 'mouseup' drag-clear
+ window.removeEventListener 'mousemove' fn
+ window.removeEventListener 'mouseleave' drag-clear
+ window.removeEventListener 'mouseup' drag-clear
- ondragover(e) {
+ this.ondragover = (e) => {
e.dataTransfer.dropEffect = 'none'
- on-keydown(e) {
+ this.on-keydown = (e) => {
if e.which == 27 // Esc
if @can-close
e.preventDefault();
diff --git a/src/web/app/dev/tags/new-app-form.tag b/src/web/app/dev/tags/new-app-form.tag
index 84e099612a..2718bcd5d0 100644
--- a/src/web/app/dev/tags/new-app-form.tag
+++ b/src/web/app/dev/tags/new-app-form.tag
@@ -182,7 +182,7 @@
this.nid-state = null
- on-change-nid() {
+ this.on-change-nid = () => {
nid = this.refs.nid.value
if nid == ''
@@ -215,7 +215,7 @@
this.nid-state = 'error'
this.update();
- onsubmit() {
+ this.onsubmit = () => {
name = this.refs.name.value
nid = this.refs.nid.value
description = this.refs.description.value
diff --git a/src/web/app/mobile/tags/drive-selector.tag b/src/web/app/mobile/tags/drive-selector.tag
index ce9bdd2b56..873c491542 100644
--- a/src/web/app/mobile/tags/drive-selector.tag
+++ b/src/web/app/mobile/tags/drive-selector.tag
@@ -63,11 +63,11 @@
this.files = files
this.update();
- cancel() {
+ this.cancel = () => {
this.trigger('canceled');
this.unmount();
- ok() {
+ this.ok = () => {
this.trigger 'selected' this.files
this.unmount();
</script>
diff --git a/src/web/app/mobile/tags/drive.tag b/src/web/app/mobile/tags/drive.tag
index ddaf600619..6daa50c26d 100644
--- a/src/web/app/mobile/tags/drive.tag
+++ b/src/web/app/mobile/tags/drive.tag
@@ -167,20 +167,20 @@
@stream.off 'drive_folder_created' this.on-stream-drive-folder-created
@stream.off 'drive_folder_updated' this.on-stream-drive-folder-updated
- on-stream-drive-file-created(file) {
+ this.on-stream-drive-file-created = (file) => {
@add-file file, true
- on-stream-drive-file-updated(file) {
+ this.on-stream-drive-file-updated = (file) => {
current = if this.folder? then this.folder.id else null
if current != file.folder_id
@remove-file file
else
@add-file file, true
- on-stream-drive-folder-created(folder) {
+ this.on-stream-drive-folder-created = (folder) => {
@add-folder folder, true
- on-stream-drive-folder-updated(folder) {
+ this.on-stream-drive-folder-updated = (folder) => {
current = if this.folder? then this.folder.id else null
if current != folder.parent_id
@remove-folder folder
@@ -190,10 +190,10 @@
@_move = (ev) =>
@move ev.item.folder
- move(target-folder) {
+ this.move = (target-folder) => {
@cd target-folder
- cd(target-folder, silent = false) {
+ this.cd = (target-folder, silent = false) => {
this.file = null
if target-folder? and typeof target-folder == 'object'
@@ -226,7 +226,7 @@
.catch (err, text-status) ->
console.error err
- add-folder(folder, unshift = false) {
+ this.add-folder = (folder, unshift = false) => {
current = if this.folder? then this.folder.id else null
if current != folder.parent_id
return
@@ -241,7 +241,7 @@
this.update();
- add-file(file, unshift = false) {
+ this.add-file = (file, unshift = false) => {
current = if this.folder? then this.folder.id else null
if current != file.folder_id
return
@@ -259,19 +259,19 @@
this.update();
- remove-folder(folder) {
+ this.remove-folder = (folder) => {
if typeof folder == 'object'
folder = folder.id
this.folders = this.folders.filter (f) -> f.id != folder
this.update();
- remove-file(file) {
+ this.remove-file = (file) => {
if typeof file == 'object'
file = file.id
this.files = this.files.filter (f) -> f.id != file
this.update();
- go-root() {
+ this.go-root = () => {
if this.folder != null or this.file != null
this.file = null
this.folder = null
@@ -280,7 +280,7 @@
this.trigger('move-root');
@load!
- load() {
+ this.load = () => {
this.folders = []
this.files = []
this.more-folders = false
@@ -337,11 +337,11 @@
flag := true
this.trigger('load-mid');
- choose-file(file) {
+ this.choose-file = (file) => {
if @is-select-mode
exist = @selected-files.some (f) => f.id == file.id
if exist
- selected-files(@selected-files.filter (f) { f.id != file.id)
+ this.selected-files = (@selected-files.filter (f) => { f.id != file.id)
else
@selected-files.push file
this.update();
@@ -349,7 +349,7 @@
else
@cf file
- cf(file, silent = false) {
+ this.cf = (file, silent = false) => {
if typeof file == 'object'
file = file.id
diff --git a/src/web/app/mobile/tags/drive/file-viewer.tag b/src/web/app/mobile/tags/drive/file-viewer.tag
index eff41ab85f..5f1380ae80 100644
--- a/src/web/app/mobile/tags/drive/file-viewer.tag
+++ b/src/web/app/mobile/tags/drive/file-viewer.tag
@@ -188,7 +188,7 @@
this.file = this.opts.file
this.kind = this.file.type.split '/' .0
- rename() {
+ this.rename = () => {
name = window.prompt '名前を変更' this.file.name
if name? and name != '' and name != this.file.name
this.api 'drive/files/update' do
diff --git a/src/web/app/mobile/tags/drive/file.tag b/src/web/app/mobile/tags/drive/file.tag
index c831349197..77b5b220ad 100644
--- a/src/web/app/mobile/tags/drive/file.tag
+++ b/src/web/app/mobile/tags/drive/file.tag
@@ -131,7 +131,7 @@
this.browser.on('change-selected', (selects) => {
this.is-selected = selects.some (f) => f.id == this.file.id
- onclick() {
+ this.onclick = () => {
this.browser.choose-file this.file
</script>
</mk-drive-file>
diff --git a/src/web/app/mobile/tags/drive/folder.tag b/src/web/app/mobile/tags/drive/folder.tag
index c536fed9d9..4c4727a308 100644
--- a/src/web/app/mobile/tags/drive/folder.tag
+++ b/src/web/app/mobile/tags/drive/folder.tag
@@ -40,7 +40,7 @@
this.browser = this.parent
this.folder = this.opts.folder
- onclick() {
+ this.onclick = () => {
this.browser.move this.folder
</script>
</mk-drive-folder>
diff --git a/src/web/app/mobile/tags/follow-button.tag b/src/web/app/mobile/tags/follow-button.tag
index 99936530c8..36447f3acd 100644
--- a/src/web/app/mobile/tags/follow-button.tag
+++ b/src/web/app/mobile/tags/follow-button.tag
@@ -69,17 +69,17 @@
@stream.off 'follow' this.on-stream-follow
@stream.off 'unfollow' this.on-stream-unfollow
- on-stream-follow(user) {
+ this.on-stream-follow = (user) => {
if user.id == @user.id
this.user = user
this.update();
- on-stream-unfollow(user) {
+ this.on-stream-unfollow = (user) => {
if user.id == @user.id
this.user = user
this.update();
- onclick() {
+ this.onclick = () => {
this.wait = true
if @user.is_following
this.api 'following/delete' do
diff --git a/src/web/app/mobile/tags/home-timeline.tag b/src/web/app/mobile/tags/home-timeline.tag
index 98c3a08215..322ba8f932 100644
--- a/src/web/app/mobile/tags/home-timeline.tag
+++ b/src/web/app/mobile/tags/home-timeline.tag
@@ -25,19 +25,19 @@
@stream.off 'follow' this.on-stream-follow
@stream.off 'unfollow' this.on-stream-unfollow
- more() {
+ this.more = () => {
this.api 'posts/timeline' do
max_id: this.refs.timeline.tail!.id
- on-stream-post(post) {
+ this.on-stream-post = (post) => {
this.is-empty = false
this.update();
this.refs.timeline.add-post post
- on-stream-follow() {
+ this.on-stream-follow = () => {
@fetch!
- on-stream-unfollow() {
+ this.on-stream-unfollow = () => {
@fetch!
</script>
</mk-home-timeline>
diff --git a/src/web/app/mobile/tags/images-viewer.tag b/src/web/app/mobile/tags/images-viewer.tag
index 6ff03ba637..ad02850e30 100644
--- a/src/web/app/mobile/tags/images-viewer.tag
+++ b/src/web/app/mobile/tags/images-viewer.tag
@@ -21,7 +21,7 @@
this.images = this.opts.images
this.image = @images.0
- click() {
+ this.click = () => {
window.open @image.url
</script>
</mk-images-viewer>
diff --git a/src/web/app/mobile/tags/notifications.tag b/src/web/app/mobile/tags/notifications.tag
index 59bcebaa40..9d665ec93e 100644
--- a/src/web/app/mobile/tags/notifications.tag
+++ b/src/web/app/mobile/tags/notifications.tag
@@ -79,7 +79,7 @@
this.on('unmount', () => {
@stream.off 'notification' this.on-notification
- on-notification(notification) {
+ this.on-notification = (notification) => {
@notifications.unshift notification
this.update();
diff --git a/src/web/app/mobile/tags/page/entrance.tag b/src/web/app/mobile/tags/page/entrance.tag
index 3ec43f0f61..1197d0578e 100644
--- a/src/web/app/mobile/tags/page/entrance.tag
+++ b/src/web/app/mobile/tags/page/entrance.tag
@@ -45,15 +45,15 @@
<script>
this.mode = 'signin'
- signup() {
+ this.signup = () => {
this.mode = 'signup'
this.update();
- signin() {
+ this.signin = () => {
this.mode = 'signin'
this.update();
- introduction() {
+ this.introduction = () => {
this.mode = 'introduction'
this.update();
</script>
diff --git a/src/web/app/mobile/tags/page/home.tag b/src/web/app/mobile/tags/page/home.tag
index cfa6d55dac..d46e834746 100644
--- a/src/web/app/mobile/tags/page/home.tag
+++ b/src/web/app/mobile/tags/page/home.tag
@@ -23,21 +23,21 @@
this.Progress.start();
@stream.on 'post' this.on-stream-post
- document.add-event-listener 'visibilitychange' @window-on-visibilitychange, false
+ document.addEventListener 'visibilitychange' @window-on-visibilitychange, false
this.refs.ui.refs.home.on('loaded', () => {
this.Progress.done();
this.on('unmount', () => {
@stream.off 'post' this.on-stream-post
- document.remove-event-listener 'visibilitychange' @window-on-visibilitychange
+ document.removeEventListener 'visibilitychange' @window-on-visibilitychange
- on-stream-post(post) {
+ this.on-stream-post = (post) => {
if document.hidden and post.user_id !== this.I.id
@unread-count++
document.title = '(' + @unread-count + ') ' + @get-post-summary post
- window-on-visibilitychange() {
+ this.window-on-visibilitychange = () => {
if !document.hidden
this.unread-count = 0
document.title = 'Misskey'
diff --git a/src/web/app/mobile/tags/post-detail.tag b/src/web/app/mobile/tags/post-detail.tag
index 7d19a96d54..9319cfe68e 100644
--- a/src/web/app/mobile/tags/post-detail.tag
+++ b/src/web/app/mobile/tags/post-detail.tag
@@ -391,18 +391,18 @@
this.replies = replies
this.update();
- reply() {
+ this.reply = () => {
@open-post-form do
reply: @p
- repost() {
+ this.repost = () => {
text = window.prompt '「' + @summary + '」をRepost'
if text?
this.api 'posts/create' do
repost_id: @p.id
text: if text == '' then undefined else text
- like() {
+ this.like = () => {
if @p.is_liked
this.api 'posts/likes/delete' do
post_id: @p.id
@@ -416,7 +416,7 @@
@p.is_liked = true
this.update();
- load-context() {
+ this.load-context = () => {
this.loading-context = true
// Get context
diff --git a/src/web/app/mobile/tags/post-form.tag b/src/web/app/mobile/tags/post-form.tag
index 72778f3b40..7b7243cf06 100644
--- a/src/web/app/mobile/tags/post-form.tag
+++ b/src/web/app/mobile/tags/post-form.tag
@@ -200,13 +200,13 @@
this.refs.text.focus();
- onkeypress(e) {
+ this.onkeypress = (e) => {
if (e.char-code == 10 || e.char-code == 13) && e.ctrlKey
@post!
else
return true
- onpaste(e) {
+ this.onpaste = (e) => {
data = e.clipboardData
items = data.items
for i from 0 to items.length - 1
@@ -216,10 +216,10 @@
@upload item.getAsFile();
return true
- select-file() {
+ this.select-file = () => {
this.refs.file.click!
- select-file-from-drive() {
+ this.select-file-from-drive = () => {
browser = document.body.appendChild document.createElement 'mk-drive-selector'
browser = riot.mount browser, do
multiple: true
@@ -227,16 +227,16 @@
browser.on('selected', (files) => {
files.for-each @add-file
- change-file() {
+ this.change-file = () => {
files = this.refs.file.files
for i from 0 to files.length - 1
file = files.item i
@upload file
- upload(file) {
+ this.upload = (file) => {
this.refs.uploader.upload file
- add-file(file) {
+ this.add-file = (file) => {
file._remove = =>
this.files = this.files.filter (x) -> x.id != file.id
this.trigger 'change-files' this.files
@@ -246,14 +246,14 @@
this.trigger 'change-files' this.files
this.update();
- add-poll() {
+ this.add-poll = () => {
this.poll = true
- on-poll-destroyed() {
+ this.on-poll-destroyed = () => {
@update do
poll: false
- post() {
+ this.post = () => {
this.wait = true
files = if this.files? and this.files.length > 0
@@ -274,11 +274,11 @@
this.wait = false
this.update();
- cancel() {
+ this.cancel = () => {
this.trigger('cancel');
this.unmount();
- cat() {
+ this.cat = () => {
this.refs.text.value = this.refs.text.value + get-cat!
</script>
</mk-post-form>
diff --git a/src/web/app/mobile/tags/search-posts.tag b/src/web/app/mobile/tags/search-posts.tag
index 120df41407..caa0af4be3 100644
--- a/src/web/app/mobile/tags/search-posts.tag
+++ b/src/web/app/mobile/tags/search-posts.tag
@@ -22,7 +22,7 @@
res posts
this.trigger('loaded');
- more() {
+ this.more = () => {
@offset += @max
this.api 'posts/search' do
query: @query
diff --git a/src/web/app/mobile/tags/timeline-post.tag b/src/web/app/mobile/tags/timeline-post.tag
index faa05ec7a9..9cc6a088b5 100644
--- a/src/web/app/mobile/tags/timeline-post.tag
+++ b/src/web/app/mobile/tags/timeline-post.tag
@@ -319,18 +319,18 @@
riot.mount @preview, do
url: t.content
- reply() {
+ this.reply = () => {
@open-post-form do
reply: @p
- repost() {
+ this.repost = () => {
text = window.prompt '「' + @summary + '」をRepost'
if text?
this.api 'posts/create' do
repost_id: @p.id
text: if text == '' then undefined else text
- like() {
+ this.like = () => {
if @p.is_liked
this.api 'posts/likes/delete' do
post_id: @p.id
diff --git a/src/web/app/mobile/tags/timeline.tag b/src/web/app/mobile/tags/timeline.tag
index 156c4e4294..c6ae414556 100644
--- a/src/web/app/mobile/tags/timeline.tag
+++ b/src/web/app/mobile/tags/timeline.tag
@@ -91,7 +91,7 @@
post._date = date
post._datetext = month + '月 ' + date + '日'
- more() {
+ this.more = () => {
if @init or @fetching or @posts.length == 0 then return
this.fetching = true
this.update();
@@ -99,20 +99,20 @@
this.fetching = false
@prepend-posts posts
- set-posts(posts) {
+ this.set-posts = (posts) => {
this.posts = posts
this.update();
- prepend-posts(posts) {
+ this.prepend-posts = (posts) => {
posts.for-each (post) =>
@posts.push post
this.update();
- add-post(post) {
+ this.add-post = (post) => {
@posts.unshift post
this.update();
- tail() {
+ this.tail = () => {
@posts[@posts.length - 1]
</script>
</mk-timeline>
diff --git a/src/web/app/mobile/tags/ui-header.tag b/src/web/app/mobile/tags/ui-header.tag
index f4f44e972a..6a7ec8ec54 100644
--- a/src/web/app/mobile/tags/ui-header.tag
+++ b/src/web/app/mobile/tags/ui-header.tag
@@ -98,7 +98,7 @@
if this.refs.title?
this.refs.title.innerHTML = title
- post() {
+ this.post = () => {
@open-post-form!
</script>
</mk-ui-header>
diff --git a/src/web/app/mobile/tags/ui-nav.tag b/src/web/app/mobile/tags/ui-nav.tag
index efdec8e14d..67fbeefd15 100644
--- a/src/web/app/mobile/tags/ui-nav.tag
+++ b/src/web/app/mobile/tags/ui-nav.tag
@@ -123,7 +123,7 @@
this.on('mount', () => {
this.opts.ready!
- search() {
+ this.search = () => {
query = window.prompt '検索'
if query? and query != ''
@page '/search:' + query
diff --git a/src/web/app/mobile/tags/ui.tag b/src/web/app/mobile/tags/ui.tag
index cb87469c01..3913de7546 100644
--- a/src/web/app/mobile/tags/ui.tag
+++ b/src/web/app/mobile/tags/ui.tag
@@ -29,21 +29,21 @@
this.on('unmount', () => {
@stream.off 'notification' this.on-stream-notification
- ready() {
+ this.ready = () => {
@ready-count++
if @ready-count == 2
@init-view-position!
- init-view-position() {
+ this.init-view-position = () => {
top = this.refs.header.root.offset-height
this.refs.main.style.padding-top = top + 'px'
- toggle-drawer() {
+ this.toggle-drawer = () => {
this.is-drawer-opening = !@is-drawer-opening
this.refs.nav.root.style.display = if @is-drawer-opening then 'block' else 'none'
- on-stream-notification(notification) {
+ this.on-stream-notification = (notification) => {
el = document.body.appendChild document.createElement 'mk-notify'
riot.mount el, do
notification: notification
diff --git a/src/web/app/mobile/tags/user-followers.tag b/src/web/app/mobile/tags/user-followers.tag
index 49091421eb..4eafb1ed90 100644
--- a/src/web/app/mobile/tags/user-followers.tag
+++ b/src/web/app/mobile/tags/user-followers.tag
@@ -10,7 +10,7 @@
this.user = this.opts.user
- fetch(iknow, limit, cursor, cb) {
+ this.fetch = (iknow, limit, cursor, cb) => {
this.api 'users/followers' do
user_id: @user.id
iknow: iknow
diff --git a/src/web/app/mobile/tags/user-following.tag b/src/web/app/mobile/tags/user-following.tag
index c00894a4c0..25d3c9926e 100644
--- a/src/web/app/mobile/tags/user-following.tag
+++ b/src/web/app/mobile/tags/user-following.tag
@@ -10,7 +10,7 @@
this.user = this.opts.user
- fetch(iknow, limit, cursor, cb) {
+ this.fetch = (iknow, limit, cursor, cb) => {
this.api 'users/following' do
user_id: @user.id
iknow: iknow
diff --git a/src/web/app/mobile/tags/user-timeline.tag b/src/web/app/mobile/tags/user-timeline.tag
index a05fd84228..82a6413546 100644
--- a/src/web/app/mobile/tags/user-timeline.tag
+++ b/src/web/app/mobile/tags/user-timeline.tag
@@ -22,7 +22,7 @@
res posts
this.trigger('loaded');
- more() {
+ this.more = () => {
this.api 'users/posts' do
user_id: @user.id
with_media: @with-media
diff --git a/src/web/app/mobile/tags/user.tag b/src/web/app/mobile/tags/user.tag
index 6cd815a37f..d36455e6e9 100644
--- a/src/web/app/mobile/tags/user.tag
+++ b/src/web/app/mobile/tags/user.tag
@@ -172,19 +172,19 @@
this.trigger 'loaded' user
this.update();
- go-posts() {
+ this.go-posts = () => {
this.page = 'posts'
this.update();
- go-media() {
+ this.go-media = () => {
this.page = 'media'
this.update();
- go-graphs() {
+ this.go-graphs = () => {
this.page = 'graphs'
this.update();
- go-likes() {
+ this.go-likes = () => {
this.page = 'likes'
this.update();
</script>
diff --git a/src/web/app/mobile/tags/users-list.tag b/src/web/app/mobile/tags/users-list.tag
index 6d45c32c31..b0f7f73ff5 100644
--- a/src/web/app/mobile/tags/users-list.tag
+++ b/src/web/app/mobile/tags/users-list.tag
@@ -82,7 +82,7 @@
@fetch =>
this.trigger('loaded');
- fetch(cb) {
+ this.fetch = (cb) => {
this.fetching = true
this.update();
obj <~ this.opts.fetch do
@@ -95,7 +95,7 @@
this.update();
if cb? then cb!
- more() {
+ this.more = () => {
this.more-fetching = true
this.update();
obj <~ this.opts.fetch do
@@ -107,7 +107,7 @@
this.more-fetching = false
this.update();
- set-mode(mode) {
+ this.set-mode = (mode) => {
@update do
mode: mode