summaryrefslogtreecommitdiff
path: root/src/web/app/desktop
diff options
context:
space:
mode:
authorこぴなたみぽ <syuilotan@yahoo.co.jp>2018-02-07 18:17:59 +0900
committerこぴなたみぽ <syuilotan@yahoo.co.jp>2018-02-07 18:17:59 +0900
commit07efc8e1504450b4eb6bc29f43986a9d538d0680 (patch)
tree8faf4958438cfad54383fc2df06bd2496e7acdc1 /src/web/app/desktop
parentwip (diff)
downloadmisskey-07efc8e1504450b4eb6bc29f43986a9d538d0680.tar.gz
misskey-07efc8e1504450b4eb6bc29f43986a9d538d0680.tar.bz2
misskey-07efc8e1504450b4eb6bc29f43986a9d538d0680.zip
wip
Diffstat (limited to 'src/web/app/desktop')
-rw-r--r--src/web/app/desktop/tags/analog-clock.tag6
-rw-r--r--src/web/app/desktop/tags/autocomplete-suggestion.tag6
-rw-r--r--src/web/app/desktop/tags/crop-window.tag8
-rw-r--r--src/web/app/desktop/tags/detailed-post-window.tag4
-rw-r--r--src/web/app/desktop/tags/dialog.tag18
-rw-r--r--src/web/app/desktop/tags/drive/base-contextmenu.tag10
-rw-r--r--src/web/app/desktop/tags/drive/browser-window.tag6
-rw-r--r--src/web/app/desktop/tags/drive/browser.tag42
-rw-r--r--src/web/app/desktop/tags/drive/file-contextmenu.tag14
-rw-r--r--src/web/app/desktop/tags/drive/file.tag2
-rw-r--r--src/web/app/desktop/tags/drive/folder-contextmenu.tag12
-rw-r--r--src/web/app/desktop/tags/home-widgets/access-log.tag2
-rw-r--r--src/web/app/desktop/tags/home-widgets/activity.tag4
-rw-r--r--src/web/app/desktop/tags/home-widgets/channel.tag8
-rw-r--r--src/web/app/desktop/tags/home-widgets/mentions.tag10
-rw-r--r--src/web/app/desktop/tags/home-widgets/messaging.tag2
-rw-r--r--src/web/app/desktop/tags/home-widgets/post-form.tag4
-rw-r--r--src/web/app/desktop/tags/home-widgets/server.tag6
-rw-r--r--src/web/app/desktop/tags/home-widgets/slideshow.tag12
-rw-r--r--src/web/app/desktop/tags/home-widgets/timeline.tag12
-rw-r--r--src/web/app/desktop/tags/home-widgets/tips.tag6
-rw-r--r--src/web/app/desktop/tags/home.tag44
-rw-r--r--src/web/app/desktop/tags/images.tag12
-rw-r--r--src/web/app/desktop/tags/input-dialog.tag10
-rw-r--r--src/web/app/desktop/tags/messaging/room-window.tag2
-rw-r--r--src/web/app/desktop/tags/messaging/window.tag4
-rw-r--r--src/web/app/desktop/tags/pages/drive.tag4
-rw-r--r--src/web/app/desktop/tags/pages/entrance.tag2
-rw-r--r--src/web/app/desktop/tags/pages/home.tag2
-rw-r--r--src/web/app/desktop/tags/pages/search.tag2
-rw-r--r--src/web/app/desktop/tags/pages/selectdrive.tag6
-rw-r--r--src/web/app/desktop/tags/pages/user.tag4
-rw-r--r--src/web/app/desktop/tags/post-detail-sub.tag4
-rw-r--r--src/web/app/desktop/tags/post-detail.tag10
-rw-r--r--src/web/app/desktop/tags/post-form-window.tag12
-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.tag12
-rw-r--r--src/web/app/desktop/tags/repost-form.tag4
-rw-r--r--src/web/app/desktop/tags/search-posts.tag6
-rw-r--r--src/web/app/desktop/tags/search.tag2
-rw-r--r--src/web/app/desktop/tags/select-file-from-drive-window.tag12
-rw-r--r--src/web/app/desktop/tags/select-folder-from-drive-window.tag8
-rw-r--r--src/web/app/desktop/tags/settings-window.tag4
-rw-r--r--src/web/app/desktop/tags/settings.tag10
-rw-r--r--src/web/app/desktop/tags/sub-post-content.tag4
-rw-r--r--src/web/app/desktop/tags/timeline.tag14
-rw-r--r--src/web/app/desktop/tags/ui.tag2
-rw-r--r--src/web/app/desktop/tags/user-timeline.tag10
-rw-r--r--src/web/app/desktop/tags/user.tag12
-rw-r--r--src/web/app/desktop/tags/window.tag88
51 files changed, 269 insertions, 269 deletions
diff --git a/src/web/app/desktop/tags/analog-clock.tag b/src/web/app/desktop/tags/analog-clock.tag
index c0489d3feb..35661405db 100644
--- a/src/web/app/desktop/tags/analog-clock.tag
+++ b/src/web/app/desktop/tags/analog-clock.tag
@@ -28,9 +28,9 @@
const m = now.getMinutes();
const h = now.getHours();
- const ctx = this.refs.canvas.getContext('2d');
- const canvW = this.refs.canvas.width;
- const canvH = this.refs.canvas.height;
+ const ctx = this.$refs.canvas.getContext('2d');
+ const canvW = this.$refs.canvas.width;
+ const canvH = this.$refs.canvas.height;
ctx.clearRect(0, 0, canvW, canvH);
{ // 背景
diff --git a/src/web/app/desktop/tags/autocomplete-suggestion.tag b/src/web/app/desktop/tags/autocomplete-suggestion.tag
index 5304875c17..cf22f3a275 100644
--- a/src/web/app/desktop/tags/autocomplete-suggestion.tag
+++ b/src/web/app/desktop/tags/autocomplete-suggestion.tag
@@ -177,12 +177,12 @@
};
this.applySelect = () => {
- Array.from(this.refs.users.children).forEach(el => {
+ Array.from(this.$refs.users.children).forEach(el => {
el.removeAttribute('data-selected');
});
- this.refs.users.children[this.select].setAttribute('data-selected', 'true');
- this.refs.users.children[this.select].focus();
+ this.$refs.users.children[this.select].setAttribute('data-selected', 'true');
+ this.$refs.users.children[this.select].focus();
};
this.complete = user => {
diff --git a/src/web/app/desktop/tags/crop-window.tag b/src/web/app/desktop/tags/crop-window.tag
index b74b46b77e..80f3f4657a 100644
--- a/src/web/app/desktop/tags/crop-window.tag
+++ b/src/web/app/desktop/tags/crop-window.tag
@@ -168,7 +168,7 @@
this.cropper = null;
this.on('mount', () => {
- this.img = this.refs.window.refs.img;
+ this.img = this.$refs.window.refs.img;
this.cropper = new Cropper(this.img, {
aspectRatio: this.aspectRatio,
highlight: false,
@@ -179,18 +179,18 @@
this.ok = () => {
this.cropper.getCroppedCanvas().toBlob(blob => {
this.trigger('cropped', blob);
- this.refs.window.close();
+ this.$refs.window.close();
});
};
this.skip = () => {
this.trigger('skipped');
- this.refs.window.close();
+ this.$refs.window.close();
};
this.cancel = () => {
this.trigger('canceled');
- this.refs.window.close();
+ this.$refs.window.close();
};
</script>
</mk-crop-window>
diff --git a/src/web/app/desktop/tags/detailed-post-window.tag b/src/web/app/desktop/tags/detailed-post-window.tag
index a0bcdc79ac..93df377c4f 100644
--- a/src/web/app/desktop/tags/detailed-post-window.tag
+++ b/src/web/app/desktop/tags/detailed-post-window.tag
@@ -62,8 +62,8 @@
});
this.close = () => {
- this.refs.bg.style.pointerEvents = 'none';
- this.refs.main.style.pointerEvents = 'none';
+ this.$refs.bg.style.pointerEvents = 'none';
+ this.$refs.main.style.pointerEvents = 'none';
anime({
targets: this.root,
opacity: 0,
diff --git a/src/web/app/desktop/tags/dialog.tag b/src/web/app/desktop/tags/dialog.tag
index f213211730..9299e97334 100644
--- a/src/web/app/desktop/tags/dialog.tag
+++ b/src/web/app/desktop/tags/dialog.tag
@@ -94,19 +94,19 @@
});
this.on('mount', () => {
- this.refs.header.innerHTML = this.opts.title;
- this.refs.body.innerHTML = this.opts.text;
+ this.$refs.header.innerHTML = this.opts.title;
+ this.$refs.body.innerHTML = this.opts.text;
- this.refs.bg.style.pointerEvents = 'auto';
+ this.$refs.bg.style.pointerEvents = 'auto';
anime({
- targets: this.refs.bg,
+ targets: this.$refs.bg,
opacity: 1,
duration: 100,
easing: 'linear'
});
anime({
- targets: this.refs.main,
+ targets: this.$refs.main,
opacity: 1,
scale: [1.2, 1],
duration: 300,
@@ -115,17 +115,17 @@
});
this.close = () => {
- this.refs.bg.style.pointerEvents = 'none';
+ this.$refs.bg.style.pointerEvents = 'none';
anime({
- targets: this.refs.bg,
+ targets: this.$refs.bg,
opacity: 0,
duration: 300,
easing: 'linear'
});
- this.refs.main.style.pointerEvents = 'none';
+ this.$refs.main.style.pointerEvents = 'none';
anime({
- targets: this.refs.main,
+ targets: this.$refs.main,
opacity: 0,
scale: 0.8,
duration: 300,
diff --git a/src/web/app/desktop/tags/drive/base-contextmenu.tag b/src/web/app/desktop/tags/drive/base-contextmenu.tag
index 2d7796c682..eb97ccccc1 100644
--- a/src/web/app/desktop/tags/drive/base-contextmenu.tag
+++ b/src/web/app/desktop/tags/drive/base-contextmenu.tag
@@ -16,29 +16,29 @@
this.browser = this.opts.browser;
this.on('mount', () => {
- this.refs.ctx.on('closed', () => {
+ this.$refs.ctx.on('closed', () => {
this.trigger('closed');
this.unmount();
});
});
this.open = pos => {
- this.refs.ctx.open(pos);
+ this.$refs.ctx.open(pos);
};
this.createFolder = () => {
this.browser.createFolder();
- this.refs.ctx.close();
+ this.$refs.ctx.close();
};
this.upload = () => {
this.browser.selectLocalFile();
- this.refs.ctx.close();
+ this.$refs.ctx.close();
};
this.urlUpload = () => {
this.browser.urlUpload();
- this.refs.ctx.close();
+ this.$refs.ctx.close();
};
</script>
</mk-drive-browser-base-contextmenu>
diff --git a/src/web/app/desktop/tags/drive/browser-window.tag b/src/web/app/desktop/tags/drive/browser-window.tag
index 57042f0163..01cb4b1af8 100644
--- a/src/web/app/desktop/tags/drive/browser-window.tag
+++ b/src/web/app/desktop/tags/drive/browser-window.tag
@@ -33,7 +33,7 @@
this.folder = this.opts.folder ? this.opts.folder : null;
this.popout = () => {
- const folder = this.refs.window.refs.browser.folder;
+ const folder = this.$refs.window.refs.browser.folder;
if (folder) {
return `${_URL_}/i/drive/folder/${folder.id}`;
} else {
@@ -42,7 +42,7 @@
};
this.on('mount', () => {
- this.refs.window.on('closed', () => {
+ this.$refs.window.on('closed', () => {
this.unmount();
});
@@ -54,7 +54,7 @@
});
this.close = () => {
- this.refs.window.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 f9dea51271..7e9f4662fe 100644
--- a/src/web/app/desktop/tags/drive/browser.tag
+++ b/src/web/app/desktop/tags/drive/browser.tag
@@ -275,11 +275,11 @@
this.isDragSource = false;
this.on('mount', () => {
- this.refs.uploader.on('uploaded', file => {
+ this.$refs.uploader.on('uploaded', file => {
this.addFile(file, true);
});
- this.refs.uploader.on('change-uploads', uploads => {
+ this.$refs.uploader.on('change-uploads', uploads => {
this.update({
uploads: uploads
});
@@ -332,35 +332,35 @@
};
this.onmousedown = e => {
- if (contains(this.refs.foldersContainer, e.target) || contains(this.refs.filesContainer, e.target)) return true;
+ if (contains(this.$refs.foldersContainer, e.target) || contains(this.$refs.filesContainer, e.target)) return true;
- const rect = this.refs.main.getBoundingClientRect();
+ const rect = this.$refs.main.getBoundingClientRect();
- const left = e.pageX + this.refs.main.scrollLeft - rect.left - window.pageXOffset
- const top = e.pageY + this.refs.main.scrollTop - rect.top - window.pageYOffset
+ const left = e.pageX + this.$refs.main.scrollLeft - rect.left - window.pageXOffset
+ const top = e.pageY + this.$refs.main.scrollTop - rect.top - window.pageYOffset
const move = e => {
- this.refs.selection.style.display = 'block';
+ this.$refs.selection.style.display = 'block';
- const cursorX = e.pageX + this.refs.main.scrollLeft - rect.left - window.pageXOffset;
- const cursorY = e.pageY + this.refs.main.scrollTop - rect.top - window.pageYOffset;
+ const cursorX = e.pageX + this.$refs.main.scrollLeft - rect.left - window.pageXOffset;
+ const cursorY = e.pageY + this.$refs.main.scrollTop - rect.top - window.pageYOffset;
const w = cursorX - left;
const h = cursorY - top;
if (w > 0) {
- this.refs.selection.style.width = w + 'px';
- this.refs.selection.style.left = left + 'px';
+ this.$refs.selection.style.width = w + 'px';
+ this.$refs.selection.style.left = left + 'px';
} else {
- this.refs.selection.style.width = -w + 'px';
- this.refs.selection.style.left = cursorX + 'px';
+ this.$refs.selection.style.width = -w + 'px';
+ this.$refs.selection.style.left = cursorX + 'px';
}
if (h > 0) {
- this.refs.selection.style.height = h + 'px';
- this.refs.selection.style.top = top + 'px';
+ this.$refs.selection.style.height = h + 'px';
+ this.$refs.selection.style.top = top + 'px';
} else {
- this.refs.selection.style.height = -h + 'px';
- this.refs.selection.style.top = cursorY + 'px';
+ this.$refs.selection.style.height = -h + 'px';
+ this.$refs.selection.style.top = cursorY + 'px';
}
};
@@ -368,7 +368,7 @@
document.documentElement.removeEventListener('mousemove', move);
document.documentElement.removeEventListener('mouseup', up);
- this.refs.selection.style.display = 'none';
+ this.$refs.selection.style.display = 'none';
};
document.documentElement.addEventListener('mousemove', move);
@@ -482,7 +482,7 @@
};
this.selectLocalFile = () => {
- this.refs.fileInput.click();
+ this.$refs.fileInput.click();
};
this.urlUpload = () => {
@@ -516,14 +516,14 @@
};
this.changeFileInput = () => {
- Array.from(this.refs.fileInput.files).forEach(file => {
+ Array.from(this.$refs.fileInput.files).forEach(file => {
this.upload(file, this.folder);
});
};
this.upload = (file, folder) => {
if (folder && typeof folder == 'object') folder = folder.id;
- this.refs.uploader.upload(file, folder);
+ this.$refs.uploader.upload(file, folder);
};
this.chooseFile = file => {
diff --git a/src/web/app/desktop/tags/drive/file-contextmenu.tag b/src/web/app/desktop/tags/drive/file-contextmenu.tag
index 31ab05c23b..25721372b7 100644
--- a/src/web/app/desktop/tags/drive/file-contextmenu.tag
+++ b/src/web/app/desktop/tags/drive/file-contextmenu.tag
@@ -48,18 +48,18 @@
this.file = this.opts.file;
this.on('mount', () => {
- this.refs.ctx.on('closed', () => {
+ this.$refs.ctx.on('closed', () => {
this.trigger('closed');
this.unmount();
});
});
this.open = pos => {
- this.refs.ctx.open(pos);
+ this.$refs.ctx.open(pos);
};
this.rename = () => {
- this.refs.ctx.close();
+ this.$refs.ctx.close();
inputDialog('%i18n:desktop.tags.mk-drive-browser-file-contextmenu.rename-file%', '%i18n:desktop.tags.mk-drive-browser-file-contextmenu.input-new-file-name%', this.file.name, name => {
this.api('drive/files/update', {
@@ -71,7 +71,7 @@
this.copyUrl = () => {
copyToClipboard(this.file.url);
- this.refs.ctx.close();
+ this.$refs.ctx.close();
dialog('%fa:check%%i18n:desktop.tags.mk-drive-browser-file-contextmenu.copied%',
'%i18n:desktop.tags.mk-drive-browser-file-contextmenu.copied-url-to-clipboard%', [{
text: '%i18n:common.ok%'
@@ -79,16 +79,16 @@
};
this.download = () => {
- this.refs.ctx.close();
+ this.$refs.ctx.close();
};
this.setAvatar = () => {
- this.refs.ctx.close();
+ this.$refs.ctx.close();
updateAvatar(this.I, null, this.file);
};
this.setBanner = () => {
- this.refs.ctx.close();
+ this.$refs.ctx.close();
updateBanner(this.I, null, this.file);
};
diff --git a/src/web/app/desktop/tags/drive/file.tag b/src/web/app/desktop/tags/drive/file.tag
index 2a1519dc7e..467768db1e 100644
--- a/src/web/app/desktop/tags/drive/file.tag
+++ b/src/web/app/desktop/tags/drive/file.tag
@@ -206,7 +206,7 @@
this.onload = () => {
if (this.file.properties.average_color) {
anime({
- targets: this.refs.thumbnail,
+ targets: this.$refs.thumbnail,
backgroundColor: `rgba(${this.file.properties.average_color.join(',')}, 0)`,
duration: 100,
easing: 'linear'
diff --git a/src/web/app/desktop/tags/drive/folder-contextmenu.tag b/src/web/app/desktop/tags/drive/folder-contextmenu.tag
index eb8cad52a7..d424482faa 100644
--- a/src/web/app/desktop/tags/drive/folder-contextmenu.tag
+++ b/src/web/app/desktop/tags/drive/folder-contextmenu.tag
@@ -26,9 +26,9 @@
this.folder = this.opts.folder;
this.open = pos => {
- this.refs.ctx.open(pos);
+ this.$refs.ctx.open(pos);
- this.refs.ctx.on('closed', () => {
+ this.$refs.ctx.on('closed', () => {
this.trigger('closed');
this.unmount();
});
@@ -36,21 +36,21 @@
this.move = () => {
this.browser.move(this.folder.id);
- this.refs.ctx.close();
+ this.$refs.ctx.close();
};
this.newWindow = () => {
this.browser.newWindow(this.folder.id);
- this.refs.ctx.close();
+ this.$refs.ctx.close();
};
this.createFolder = () => {
this.browser.createFolder();
- this.refs.ctx.close();
+ this.$refs.ctx.close();
};
this.rename = () => {
- this.refs.ctx.close();
+ this.$refs.ctx.close();
inputDialog('%i18n:desktop.tags.mk-drive-browser-folder-contextmenu.rename-folder%', '%i18n:desktop.tags.mk-drive-browser-folder-contextmenu.input-new-folder-name%', this.folder.name, name => {
this.api('drive/folders/update', {
diff --git a/src/web/app/desktop/tags/home-widgets/access-log.tag b/src/web/app/desktop/tags/home-widgets/access-log.tag
index 91a71022a7..ecf121d58f 100644
--- a/src/web/app/desktop/tags/home-widgets/access-log.tag
+++ b/src/web/app/desktop/tags/home-widgets/access-log.tag
@@ -84,7 +84,7 @@
if (this.requests.length > 30) this.requests.shift();
this.update();
- this.refs.log.scrollTop = this.refs.log.scrollHeight;
+ this.$refs.log.scrollTop = this.$refs.log.scrollHeight;
};
this.func = () => {
diff --git a/src/web/app/desktop/tags/home-widgets/activity.tag b/src/web/app/desktop/tags/home-widgets/activity.tag
index 2274e84162..f2e9cf8246 100644
--- a/src/web/app/desktop/tags/home-widgets/activity.tag
+++ b/src/web/app/desktop/tags/home-widgets/activity.tag
@@ -15,7 +15,7 @@
this.initializing = true;
this.on('mount', () => {
- this.refs.activity.on('view-changed', view => {
+ this.$refs.activity.on('view-changed', view => {
this.data.view = view;
this.save();
});
@@ -23,7 +23,7 @@
this.func = () => {
if (++this.data.design == 3) this.data.design = 0;
- this.refs.activity.update({
+ this.$refs.activity.update({
design: this.data.design
});
this.save();
diff --git a/src/web/app/desktop/tags/home-widgets/channel.tag b/src/web/app/desktop/tags/home-widgets/channel.tag
index 0e40caa1e2..c51ca07524 100644
--- a/src/web/app/desktop/tags/home-widgets/channel.tag
+++ b/src/web/app/desktop/tags/home-widgets/channel.tag
@@ -82,7 +82,7 @@
channel: channel
});
- this.refs.channel.zap(channel);
+ this.$refs.channel.zap(channel);
});
};
@@ -185,7 +185,7 @@
};
this.scrollToBottom = () => {
- this.refs.posts.scrollTop = this.refs.posts.scrollHeight;
+ this.$refs.posts.scrollTop = this.$refs.posts.scrollHeight;
};
</script>
</mk-channel>
@@ -279,7 +279,7 @@
this.mixin('api');
this.clear = () => {
- this.refs.text.value = '';
+ this.$refs.text.value = '';
};
this.onkeydown = e => {
@@ -291,7 +291,7 @@
wait: true
});
- let text = this.refs.text.value;
+ let text = this.$refs.text.value;
let reply = null;
if (/^>>([0-9]+) /.test(text)) {
diff --git a/src/web/app/desktop/tags/home-widgets/mentions.tag b/src/web/app/desktop/tags/home-widgets/mentions.tag
index 94329f0304..5177b2db1f 100644
--- a/src/web/app/desktop/tags/home-widgets/mentions.tag
+++ b/src/web/app/desktop/tags/home-widgets/mentions.tag
@@ -76,7 +76,7 @@
this.onDocumentKeydown = e => {
if (e.target.tagName != 'INPUT' && tag != 'TEXTAREA') {
if (e.which == 84) { // t
- this.refs.timeline.focus();
+ this.$refs.timeline.focus();
}
}
};
@@ -89,24 +89,24 @@
isLoading: false,
isEmpty: posts.length == 0
});
- this.refs.timeline.setPosts(posts);
+ this.$refs.timeline.setPosts(posts);
if (cb) cb();
});
};
this.more = () => {
- if (this.moreLoading || this.isLoading || this.refs.timeline.posts.length == 0) return;
+ if (this.moreLoading || this.isLoading || this.$refs.timeline.posts.length == 0) return;
this.update({
moreLoading: true
});
this.api('posts/mentions', {
following: this.mode == 'following',
- until_id: this.refs.timeline.tail().id
+ until_id: this.$refs.timeline.tail().id
}).then(posts => {
this.update({
moreLoading: false
});
- this.refs.timeline.prependPosts(posts);
+ this.$refs.timeline.prependPosts(posts);
});
};
diff --git a/src/web/app/desktop/tags/home-widgets/messaging.tag b/src/web/app/desktop/tags/home-widgets/messaging.tag
index f2c7c35896..695e1babfc 100644
--- a/src/web/app/desktop/tags/home-widgets/messaging.tag
+++ b/src/web/app/desktop/tags/home-widgets/messaging.tag
@@ -37,7 +37,7 @@
this.mixin('widget');
this.on('mount', () => {
- this.refs.index.on('navigate-user', user => {
+ this.$refs.index.on('navigate-user', user => {
riot.mount(document.body.appendChild(document.createElement('mk-messaging-room-window')), {
user: user
});
diff --git a/src/web/app/desktop/tags/home-widgets/post-form.tag b/src/web/app/desktop/tags/home-widgets/post-form.tag
index b6310d6aa3..bf6374dd3c 100644
--- a/src/web/app/desktop/tags/home-widgets/post-form.tag
+++ b/src/web/app/desktop/tags/home-widgets/post-form.tag
@@ -84,7 +84,7 @@
});
this.api('posts/create', {
- text: this.refs.text.value
+ text: this.$refs.text.value
}).then(data => {
this.clear();
}).catch(err => {
@@ -97,7 +97,7 @@
};
this.clear = () => {
- this.refs.text.value = '';
+ this.$refs.text.value = '';
};
</script>
</mk-post-form-home-widget>
diff --git a/src/web/app/desktop/tags/home-widgets/server.tag b/src/web/app/desktop/tags/home-widgets/server.tag
index 6eb4ce15b7..6749a46b1a 100644
--- a/src/web/app/desktop/tags/home-widgets/server.tag
+++ b/src/web/app/desktop/tags/home-widgets/server.tag
@@ -284,7 +284,7 @@
});
this.onStats = stats => {
- this.refs.pie.render(stats.cpu_usage);
+ this.$refs.pie.render(stats.cpu_usage);
};
</script>
</mk-server-home-widget-cpu>
@@ -344,7 +344,7 @@
this.onStats = stats => {
stats.mem.used = stats.mem.total - stats.mem.free;
- this.refs.pie.render(stats.mem.used / stats.mem.total);
+ this.$refs.pie.render(stats.mem.used / stats.mem.total);
this.update({
total: stats.mem.total,
@@ -411,7 +411,7 @@
this.onStats = stats => {
stats.disk.used = stats.disk.total - stats.disk.free;
- this.refs.pie.render(stats.disk.used / stats.disk.total);
+ this.$refs.pie.render(stats.disk.used / stats.disk.total);
this.update({
total: stats.disk.total,
diff --git a/src/web/app/desktop/tags/home-widgets/slideshow.tag b/src/web/app/desktop/tags/home-widgets/slideshow.tag
index af54fd893d..21b778bae7 100644
--- a/src/web/app/desktop/tags/home-widgets/slideshow.tag
+++ b/src/web/app/desktop/tags/home-widgets/slideshow.tag
@@ -101,17 +101,17 @@
const index = Math.floor(Math.random() * this.images.length);
const img = `url(${ this.images[index].url }?thumbnail&size=1024)`;
- this.refs.slideB.style.backgroundImage = img;
+ this.$refs.slideB.style.backgroundImage = img;
anime({
- targets: this.refs.slideB,
+ targets: this.$refs.slideB,
opacity: 1,
duration: 1000,
easing: 'linear',
complete: () => {
- this.refs.slideA.style.backgroundImage = img;
+ this.$refs.slideA.style.backgroundImage = img;
anime({
- targets: this.refs.slideB,
+ targets: this.$refs.slideB,
opacity: 0,
duration: 0
});
@@ -133,8 +133,8 @@
fetching: false,
images: images
});
- this.refs.slideA.style.backgroundImage = '';
- this.refs.slideB.style.backgroundImage = '';
+ this.$refs.slideA.style.backgroundImage = '';
+ this.$refs.slideB.style.backgroundImage = '';
this.change();
});
};
diff --git a/src/web/app/desktop/tags/home-widgets/timeline.tag b/src/web/app/desktop/tags/home-widgets/timeline.tag
index 9571b09f34..f44023daa7 100644
--- a/src/web/app/desktop/tags/home-widgets/timeline.tag
+++ b/src/web/app/desktop/tags/home-widgets/timeline.tag
@@ -75,7 +75,7 @@
this.onDocumentKeydown = e => {
if (e.target.tagName != 'INPUT' && e.target.tagName != 'TEXTAREA') {
if (e.which == 84) { // t
- this.refs.timeline.focus();
+ this.$refs.timeline.focus();
}
}
};
@@ -92,23 +92,23 @@
isLoading: false,
isEmpty: posts.length == 0
});
- this.refs.timeline.setPosts(posts);
+ this.$refs.timeline.setPosts(posts);
if (cb) cb();
});
};
this.more = () => {
- if (this.moreLoading || this.isLoading || this.refs.timeline.posts.length == 0) return;
+ if (this.moreLoading || this.isLoading || this.$refs.timeline.posts.length == 0) return;
this.update({
moreLoading: true
});
this.api('posts/timeline', {
- until_id: this.refs.timeline.tail().id
+ until_id: this.$refs.timeline.tail().id
}).then(posts => {
this.update({
moreLoading: false
});
- this.refs.timeline.prependPosts(posts);
+ this.$refs.timeline.prependPosts(posts);
});
};
@@ -116,7 +116,7 @@
this.update({
isEmpty: false
});
- this.refs.timeline.addPost(post);
+ this.$refs.timeline.addPost(post);
};
this.onStreamFollow = () => {
diff --git a/src/web/app/desktop/tags/home-widgets/tips.tag b/src/web/app/desktop/tags/home-widgets/tips.tag
index 53b61dca91..9246d0e10c 100644
--- a/src/web/app/desktop/tags/home-widgets/tips.tag
+++ b/src/web/app/desktop/tags/home-widgets/tips.tag
@@ -69,12 +69,12 @@
});
this.set = () => {
- this.refs.text.innerHTML = this.tips[Math.floor(Math.random() * this.tips.length)];
+ this.$refs.text.innerHTML = this.tips[Math.floor(Math.random() * this.tips.length)];
};
this.change = () => {
anime({
- targets: this.refs.tip,
+ targets: this.$refs.tip,
opacity: 0,
duration: 500,
easing: 'linear',
@@ -83,7 +83,7 @@
setTimeout(() => {
anime({
- targets: this.refs.tip,
+ targets: this.$refs.tip,
opacity: 1,
duration: 500,
easing: 'linear'
diff --git a/src/web/app/desktop/tags/home.tag b/src/web/app/desktop/tags/home.tag
index 90486f7d2b..2047607960 100644
--- a/src/web/app/desktop/tags/home.tag
+++ b/src/web/app/desktop/tags/home.tag
@@ -197,7 +197,7 @@
this.bakedHomeData = this.bakeHomeData();
this.on('mount', () => {
- this.refs.tl.on('loaded', () => {
+ this.$refs.tl.on('loaded', () => {
this.trigger('loaded');
});
@@ -212,11 +212,11 @@
});
if (!this.opts.customize) {
- if (this.refs.left.children.length == 0) {
- this.refs.left.parentNode.removeChild(this.refs.left);
+ if (this.$refs.left.children.length == 0) {
+ this.$refs.left.parentNode.removeChild(this.$refs.left);
}
- if (this.refs.right.children.length == 0) {
- this.refs.right.parentNode.removeChild(this.refs.right);
+ if (this.$refs.right.children.length == 0) {
+ this.$refs.right.parentNode.removeChild(this.$refs.right);
}
}
@@ -242,10 +242,10 @@
}
};
- new Sortable(this.refs.left, sortableOption);
- new Sortable(this.refs.right, sortableOption);
- new Sortable(this.refs.maintop, sortableOption);
- new Sortable(this.refs.trash, Object.assign({}, sortableOption, {
+ new Sortable(this.$refs.left, sortableOption);
+ new Sortable(this.$refs.right, sortableOption);
+ new Sortable(this.$refs.maintop, sortableOption);
+ new Sortable(this.$refs.trash, Object.assign({}, sortableOption, {
onAdd: evt => {
const el = evt.item;
const id = el.getAttribute('data-widget-id');
@@ -257,8 +257,8 @@
}
if (!this.opts.customize) {
- this.scrollFollowerLeft = this.refs.left.parentNode ? new ScrollFollower(this.refs.left, this.root.getBoundingClientRect().top) : null;
- this.scrollFollowerRight = this.refs.right.parentNode ? new ScrollFollower(this.refs.right, this.root.getBoundingClientRect().top) : null;
+ this.scrollFollowerLeft = this.$refs.left.parentNode ? new ScrollFollower(this.$refs.left, this.root.getBoundingClientRect().top) : null;
+ this.scrollFollowerRight = this.$refs.right.parentNode ? new ScrollFollower(this.$refs.right, this.root.getBoundingClientRect().top) : null;
}
});
@@ -299,23 +299,23 @@
switch (widget.place) {
case 'left':
if (prepend) {
- this.refs.left.insertBefore(actualEl, this.refs.left.firstChild);
+ this.$refs.left.insertBefore(actualEl, this.$refs.left.firstChild);
} else {
- this.refs.left.appendChild(actualEl);
+ this.$refs.left.appendChild(actualEl);
}
break;
case 'right':
if (prepend) {
- this.refs.right.insertBefore(actualEl, this.refs.right.firstChild);
+ this.$refs.right.insertBefore(actualEl, this.$refs.right.firstChild);
} else {
- this.refs.right.appendChild(actualEl);
+ this.$refs.right.appendChild(actualEl);
}
break;
case 'main':
if (this.opts.customize) {
- this.refs.maintop.appendChild(actualEl);
+ this.$refs.maintop.appendChild(actualEl);
} else {
- this.refs.main.insertBefore(actualEl, this.refs.tl.root);
+ this.$refs.main.insertBefore(actualEl, this.$refs.tl.root);
}
break;
}
@@ -324,7 +324,7 @@
id: widget.id,
data: widget.data,
place: widget.place,
- tl: this.refs.tl
+ tl: this.$refs.tl
})[0];
this.home.push(tag);
@@ -341,7 +341,7 @@
this.addWidget = () => {
const widget = {
- name: this.refs.widgetSelector.options[this.refs.widgetSelector.selectedIndex].value,
+ name: this.$refs.widgetSelector.options[this.$refs.widgetSelector.selectedIndex].value,
id: uuid(),
place: 'left',
data: {}
@@ -357,21 +357,21 @@
this.saveHome = () => {
const data = [];
- Array.from(this.refs.left.children).forEach(el => {
+ Array.from(this.$refs.left.children).forEach(el => {
const id = el.getAttribute('data-widget-id');
const widget = this.I.client_settings.home.find(w => w.id == id);
widget.place = 'left';
data.push(widget);
});
- Array.from(this.refs.right.children).forEach(el => {
+ Array.from(this.$refs.right.children).forEach(el => {
const id = el.getAttribute('data-widget-id');
const widget = this.I.client_settings.home.find(w => w.id == id);
widget.place = 'right';
data.push(widget);
});
- Array.from(this.refs.maintop.children).forEach(el => {
+ Array.from(this.$refs.maintop.children).forEach(el => {
const id = el.getAttribute('data-widget-id');
const widget = this.I.client_settings.home.find(w => w.id == id);
widget.place = 'main';
diff --git a/src/web/app/desktop/tags/images.tag b/src/web/app/desktop/tags/images.tag
index 1c81af3d08..dcd664e722 100644
--- a/src/web/app/desktop/tags/images.tag
+++ b/src/web/app/desktop/tags/images.tag
@@ -86,17 +86,17 @@
};
this.mousemove = e => {
- const rect = this.refs.view.getBoundingClientRect();
+ const rect = this.$refs.view.getBoundingClientRect();
const mouseX = e.clientX - rect.left;
const mouseY = e.clientY - rect.top;
- const xp = mouseX / this.refs.view.offsetWidth * 100;
- const yp = mouseY / this.refs.view.offsetHeight * 100;
- this.refs.view.style.backgroundPosition = xp + '% ' + yp + '%';
- this.refs.view.style.backgroundImage = 'url("' + this.image.url + '?thumbnail")';
+ const xp = mouseX / this.$refs.view.offsetWidth * 100;
+ const yp = mouseY / this.$refs.view.offsetHeight * 100;
+ this.$refs.view.style.backgroundPosition = xp + '% ' + yp + '%';
+ this.$refs.view.style.backgroundImage = 'url("' + this.image.url + '?thumbnail")';
};
this.mouseleave = () => {
- this.refs.view.style.backgroundPosition = '';
+ this.$refs.view.style.backgroundPosition = '';
};
this.click = ev => {
diff --git a/src/web/app/desktop/tags/input-dialog.tag b/src/web/app/desktop/tags/input-dialog.tag
index 84dcedf935..bea8c2c22b 100644
--- a/src/web/app/desktop/tags/input-dialog.tag
+++ b/src/web/app/desktop/tags/input-dialog.tag
@@ -129,11 +129,11 @@
this.type = this.opts.type ? this.opts.type : 'text';
this.on('mount', () => {
- this.text = this.refs.window.refs.text;
+ this.text = this.$refs.window.refs.text;
if (this.default) this.text.value = this.default;
this.text.focus();
- this.refs.window.on('closing', () => {
+ this.$refs.window.on('closing', () => {
if (this.done) {
this.opts.onOk(this.text.value);
} else {
@@ -141,20 +141,20 @@
}
});
- this.refs.window.on('closed', () => {
+ this.$refs.window.on('closed', () => {
this.unmount();
});
});
this.cancel = () => {
this.done = false;
- this.refs.window.close();
+ this.$refs.window.close();
};
this.ok = () => {
if (!this.allowEmpty && this.text.value == '') return;
this.done = true;
- this.refs.window.close();
+ this.$refs.window.close();
};
this.onInput = () => {
diff --git a/src/web/app/desktop/tags/messaging/room-window.tag b/src/web/app/desktop/tags/messaging/room-window.tag
index 7c0bb0d76e..bae456200e 100644
--- a/src/web/app/desktop/tags/messaging/room-window.tag
+++ b/src/web/app/desktop/tags/messaging/room-window.tag
@@ -24,7 +24,7 @@
this.popout = `${_URL_}/i/messaging/${this.user.username}`;
this.on('mount', () => {
- this.refs.window.on('closed', () => {
+ this.$refs.window.on('closed', () => {
this.unmount();
});
});
diff --git a/src/web/app/desktop/tags/messaging/window.tag b/src/web/app/desktop/tags/messaging/window.tag
index 529db11af1..afe01c53e1 100644
--- a/src/web/app/desktop/tags/messaging/window.tag
+++ b/src/web/app/desktop/tags/messaging/window.tag
@@ -20,11 +20,11 @@
</style>
<script>
this.on('mount', () => {
- this.refs.window.on('closed', () => {
+ this.$refs.window.on('closed', () => {
this.unmount();
});
- this.refs.window.refs.index.on('navigate-user', user => {
+ this.$refs.window.refs.index.on('navigate-user', user => {
riot.mount(document.body.appendChild(document.createElement('mk-messaging-room-window')), {
user: user
});
diff --git a/src/web/app/desktop/tags/pages/drive.tag b/src/web/app/desktop/tags/pages/drive.tag
index 9f3e75ab21..1cd5ca1279 100644
--- a/src/web/app/desktop/tags/pages/drive.tag
+++ b/src/web/app/desktop/tags/pages/drive.tag
@@ -15,7 +15,7 @@
this.on('mount', () => {
document.title = 'Misskey Drive';
- this.refs.browser.on('move-root', () => {
+ this.$refs.browser.on('move-root', () => {
const title = 'Misskey Drive';
// Rewrite URL
@@ -24,7 +24,7 @@
document.title = title;
});
- this.refs.browser.on('open-folder', folder => {
+ this.$refs.browser.on('open-folder', folder => {
const title = folder.name + ' | Misskey Drive';
// Rewrite URL
diff --git a/src/web/app/desktop/tags/pages/entrance.tag b/src/web/app/desktop/tags/pages/entrance.tag
index d3807a1e7f..95acbc9101 100644
--- a/src/web/app/desktop/tags/pages/entrance.tag
+++ b/src/web/app/desktop/tags/pages/entrance.tag
@@ -280,7 +280,7 @@
</style>
<script>
this.on('mount', () => {
- this.refs.signin.on('user', user => {
+ this.$refs.signin.on('user', user => {
this.update({
user: user
});
diff --git a/src/web/app/desktop/tags/pages/home.tag b/src/web/app/desktop/tags/pages/home.tag
index 3c8f4ec570..62df62a484 100644
--- a/src/web/app/desktop/tags/pages/home.tag
+++ b/src/web/app/desktop/tags/pages/home.tag
@@ -21,7 +21,7 @@
this.page = this.opts.mode || 'timeline';
this.on('mount', () => {
- this.refs.ui.refs.home.on('loaded', () => {
+ this.$refs.ui.refs.home.on('loaded', () => {
Progress.done();
});
document.title = 'Misskey';
diff --git a/src/web/app/desktop/tags/pages/search.tag b/src/web/app/desktop/tags/pages/search.tag
index 4f5867bdb9..ac93fdaea5 100644
--- a/src/web/app/desktop/tags/pages/search.tag
+++ b/src/web/app/desktop/tags/pages/search.tag
@@ -12,7 +12,7 @@
this.on('mount', () => {
Progress.start();
- this.refs.ui.refs.search.on('loaded', () => {
+ this.$refs.ui.refs.search.on('loaded', () => {
Progress.done();
});
});
diff --git a/src/web/app/desktop/tags/pages/selectdrive.tag b/src/web/app/desktop/tags/pages/selectdrive.tag
index 993df680f5..d497a47c00 100644
--- a/src/web/app/desktop/tags/pages/selectdrive.tag
+++ b/src/web/app/desktop/tags/pages/selectdrive.tag
@@ -133,12 +133,12 @@
this.on('mount', () => {
document.title = '%i18n:desktop.tags.mk-selectdrive-page.title%';
- this.refs.browser.on('selected', file => {
+ this.$refs.browser.on('selected', file => {
this.files = [file];
this.ok();
});
- this.refs.browser.on('change-selection', files => {
+ this.$refs.browser.on('change-selection', files => {
this.update({
files: files
});
@@ -146,7 +146,7 @@
});
this.upload = () => {
- this.refs.browser.selectLocalFile();
+ this.$refs.browser.selectLocalFile();
};
this.close = () => {
diff --git a/src/web/app/desktop/tags/pages/user.tag b/src/web/app/desktop/tags/pages/user.tag
index 811ca5c0fd..7bad034958 100644
--- a/src/web/app/desktop/tags/pages/user.tag
+++ b/src/web/app/desktop/tags/pages/user.tag
@@ -14,12 +14,12 @@
this.on('mount', () => {
Progress.start();
- this.refs.ui.refs.user.on('user-fetched', user => {
+ this.$refs.ui.refs.user.on('user-fetched', user => {
Progress.set(0.5);
document.title = user.name + ' | Misskey';
});
- this.refs.ui.refs.user.on('loaded', () => {
+ this.$refs.ui.refs.user.on('loaded', () => {
Progress.done();
});
});
diff --git a/src/web/app/desktop/tags/post-detail-sub.tag b/src/web/app/desktop/tags/post-detail-sub.tag
index cccd85c474..2d79ddd1e7 100644
--- a/src/web/app/desktop/tags/post-detail-sub.tag
+++ b/src/web/app/desktop/tags/post-detail-sub.tag
@@ -120,9 +120,9 @@
if (this.post.text) {
const tokens = this.post.ast;
- this.refs.text.innerHTML = compile(tokens);
+ this.$refs.text.innerHTML = compile(tokens);
- Array.from(this.refs.text.children).forEach(e => {
+ Array.from(this.$refs.text.children).forEach(e => {
if (e.tagName == 'MK-URL') riot.mount(e);
});
}
diff --git a/src/web/app/desktop/tags/post-detail.tag b/src/web/app/desktop/tags/post-detail.tag
index 6177f24eee..73ba930c74 100644
--- a/src/web/app/desktop/tags/post-detail.tag
+++ b/src/web/app/desktop/tags/post-detail.tag
@@ -256,9 +256,9 @@
if (this.p.text) {
const tokens = this.p.ast;
- this.refs.text.innerHTML = compile(tokens);
+ this.$refs.text.innerHTML = compile(tokens);
- Array.from(this.refs.text.children).forEach(e => {
+ Array.from(this.$refs.text.children).forEach(e => {
if (e.tagName == 'MK-URL') riot.mount(e);
});
@@ -266,7 +266,7 @@
tokens
.filter(t => (t.type == 'url' || t.type == 'link') && !t.silent)
.map(t => {
- riot.mount(this.refs.text.appendChild(document.createElement('mk-url-preview')), {
+ riot.mount(this.$refs.text.appendChild(document.createElement('mk-url-preview')), {
url: t.url
});
});
@@ -299,14 +299,14 @@
this.react = () => {
riot.mount(document.body.appendChild(document.createElement('mk-reaction-picker')), {
- source: this.refs.reactButton,
+ source: this.$refs.reactButton,
post: this.p
});
};
this.menu = () => {
riot.mount(document.body.appendChild(document.createElement('mk-post-menu')), {
- source: this.refs.menuButton,
+ source: this.$refs.menuButton,
post: this.p
});
};
diff --git a/src/web/app/desktop/tags/post-form-window.tag b/src/web/app/desktop/tags/post-form-window.tag
index 05a09b7803..de349badae 100644
--- a/src/web/app/desktop/tags/post-form-window.tag
+++ b/src/web/app/desktop/tags/post-form-window.tag
@@ -42,23 +42,23 @@
this.files = [];
this.on('mount', () => {
- this.refs.window.refs.form.focus();
+ this.$refs.window.refs.form.focus();
- this.refs.window.on('closed', () => {
+ this.$refs.window.on('closed', () => {
this.unmount();
});
- this.refs.window.refs.form.on('post', () => {
- this.refs.window.close();
+ this.$refs.window.refs.form.on('post', () => {
+ this.$refs.window.close();
});
- this.refs.window.refs.form.on('change-uploading-files', files => {
+ this.$refs.window.refs.form.on('change-uploading-files', files => {
this.update({
uploadingFiles: files || []
});
});
- this.refs.window.refs.form.on('change-files', files => {
+ this.$refs.window.refs.form.on('change-files', files => {
this.update({
files: files || []
});
diff --git a/src/web/app/desktop/tags/post-form.tag b/src/web/app/desktop/tags/post-form.tag
index 23434a8241..4dbc69e4e9 100644
--- a/src/web/app/desktop/tags/post-form.tag
+++ b/src/web/app/desktop/tags/post-form.tag
@@ -319,32 +319,32 @@
: 'post';
this.on('mount', () => {
- this.refs.uploader.on('uploaded', file => {
+ this.$refs.uploader.on('uploaded', file => {
this.addFile(file);
});
- this.refs.uploader.on('change-uploads', uploads => {
+ this.$refs.uploader.on('change-uploads', uploads => {
this.trigger('change-uploading-files', uploads);
});
- this.autocomplete = new Autocomplete(this.refs.text);
+ this.autocomplete = new Autocomplete(this.$refs.text);
this.autocomplete.attach();
// 書きかけの投稿を復元
const draft = JSON.parse(localStorage.getItem('drafts') || '{}')[this.draftId];
if (draft) {
- this.refs.text.value = draft.data.text;
+ this.$refs.text.value = draft.data.text;
this.files = draft.data.files;
if (draft.data.poll) {
this.poll = true;
this.update();
- this.refs.poll.set(draft.data.poll);
+ this.$refs.poll.set(draft.data.poll);
}
this.trigger('change-files', this.files);
this.update();
}
- new Sortable(this.refs.media, {
+ new Sortable(this.$refs.media, {
animation: 150
});
});
@@ -354,11 +354,11 @@
});
this.focus = () => {
- this.refs.text.focus();
+ this.$refs.text.focus();
};
this.clear = () => {
- this.refs.text.value = '';
+ this.$refs.text.value = '';
this.files = [];
this.poll = false;
this.trigger('change-files');
@@ -422,7 +422,7 @@
};
this.selectFile = () => {
- this.refs.file.click();
+ this.$refs.file.click();
};
this.selectFileFromDrive = () => {
@@ -435,11 +435,11 @@
};
this.changeFile = () => {
- Array.from(this.refs.file.files).forEach(this.upload);
+ Array.from(this.$refs.file.files).forEach(this.upload);
};
this.upload = file => {
- this.refs.uploader.upload(file);
+ this.$refs.uploader.upload(file);
};
this.addFile = file => {
@@ -471,7 +471,7 @@
const files = [];
if (this.files.length > 0) {
- Array.from(this.refs.media.children).forEach(el => {
+ Array.from(this.$refs.media.children).forEach(el => {
const id = el.getAttribute('data-id');
const file = this.files.find(f => f.id == id);
files.push(file);
@@ -479,11 +479,11 @@
}
this.api('posts/create', {
- text: this.refs.text.value == '' ? undefined : this.refs.text.value,
+ text: this.$refs.text.value == '' ? undefined : this.$refs.text.value,
media_ids: this.files.length > 0 ? files.map(f => f.id) : undefined,
reply_id: this.inReplyToPost ? this.inReplyToPost.id : undefined,
repost_id: this.repost ? this.repost.id : undefined,
- poll: this.poll ? this.refs.poll.get() : undefined
+ poll: this.poll ? this.$refs.poll.get() : undefined
}).then(data => {
this.clear();
this.removeDraft();
@@ -507,7 +507,7 @@
};
this.kao = () => {
- this.refs.text.value += getKao();
+ this.$refs.text.value += getKao();
};
this.on('update', () => {
@@ -520,9 +520,9 @@
data[this.draftId] = {
updated_at: new Date(),
data: {
- text: this.refs.text.value,
+ text: this.$refs.text.value,
files: this.files,
- poll: this.poll && this.refs.poll ? this.refs.poll.get() : undefined
+ poll: this.poll && this.$refs.poll ? this.$refs.poll.get() : undefined
}
}
diff --git a/src/web/app/desktop/tags/progress-dialog.tag b/src/web/app/desktop/tags/progress-dialog.tag
index a0ac51b2f4..94e7f8af46 100644
--- a/src/web/app/desktop/tags/progress-dialog.tag
+++ b/src/web/app/desktop/tags/progress-dialog.tag
@@ -78,7 +78,7 @@
this.max = parseInt(this.opts.max, 10);
this.on('mount', () => {
- this.refs.window.on('closed', () => {
+ this.$refs.window.on('closed', () => {
this.unmount();
});
});
@@ -91,7 +91,7 @@
};
this.close = () => {
- this.refs.window.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 dbc3f5a3c5..939ff4e383 100644
--- a/src/web/app/desktop/tags/repost-form-window.tag
+++ b/src/web/app/desktop/tags/repost-form-window.tag
@@ -19,23 +19,23 @@
this.onDocumentKeydown = e => {
if (e.target.tagName != 'INPUT' && e.target.tagName != 'TEXTAREA') {
if (e.which == 27) { // Esc
- this.refs.window.close();
+ this.$refs.window.close();
}
}
};
this.on('mount', () => {
- this.refs.window.refs.form.on('cancel', () => {
- this.refs.window.close();
+ this.$refs.window.refs.form.on('cancel', () => {
+ this.$refs.window.close();
});
- this.refs.window.refs.form.on('posted', () => {
- this.refs.window.close();
+ this.$refs.window.refs.form.on('posted', () => {
+ this.$refs.window.close();
});
document.addEventListener('keydown', this.onDocumentKeydown);
- this.refs.window.on('closed', () => {
+ this.$refs.window.on('closed', () => {
this.unmount();
});
});
diff --git a/src/web/app/desktop/tags/repost-form.tag b/src/web/app/desktop/tags/repost-form.tag
index 946871765b..b2ebbf4c46 100644
--- a/src/web/app/desktop/tags/repost-form.tag
+++ b/src/web/app/desktop/tags/repost-form.tag
@@ -117,11 +117,11 @@
quote: true
});
- this.refs.form.on('post', () => {
+ this.$refs.form.on('post', () => {
this.trigger('posted');
});
- this.refs.form.focus();
+ this.$refs.form.focus();
};
</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 f7ec85a4fe..0c8dbcbf63 100644
--- a/src/web/app/desktop/tags/search-posts.tag
+++ b/src/web/app/desktop/tags/search-posts.tag
@@ -53,7 +53,7 @@
isLoading: false,
isEmpty: posts.length == 0
});
- this.refs.timeline.setPosts(posts);
+ this.$refs.timeline.setPosts(posts);
this.trigger('loaded');
});
});
@@ -66,7 +66,7 @@
this.onDocumentKeydown = e => {
if (e.target.tagName != 'INPUT' && e.target.tagName != 'TEXTAREA') {
if (e.which == 84) { // t
- this.refs.timeline.focus();
+ this.$refs.timeline.focus();
}
}
};
@@ -84,7 +84,7 @@
this.update({
moreLoading: false
});
- this.refs.timeline.prependPosts(posts);
+ this.$refs.timeline.prependPosts(posts);
});
};
diff --git a/src/web/app/desktop/tags/search.tag b/src/web/app/desktop/tags/search.tag
index d5159fe4e9..e29a2b2737 100644
--- a/src/web/app/desktop/tags/search.tag
+++ b/src/web/app/desktop/tags/search.tag
@@ -26,7 +26,7 @@
this.query = this.opts.query;
this.on('mount', () => {
- this.refs.posts.on('loaded', () => {
+ this.$refs.posts.on('loaded', () => {
this.trigger('loaded');
});
});
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 6225145589..6d1e59413d 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
@@ -141,33 +141,33 @@
this.title = this.opts.title || '%fa:R file%ファイルを選択';
this.on('mount', () => {
- this.refs.window.refs.browser.on('selected', file => {
+ this.$refs.window.refs.browser.on('selected', file => {
this.files = [file];
this.ok();
});
- this.refs.window.refs.browser.on('change-selection', files => {
+ this.$refs.window.refs.browser.on('change-selection', files => {
this.update({
files: files
});
});
- this.refs.window.on('closed', () => {
+ this.$refs.window.on('closed', () => {
this.unmount();
});
});
this.close = () => {
- this.refs.window.close();
+ this.$refs.window.close();
};
this.upload = () => {
- this.refs.window.refs.browser.selectLocalFile();
+ this.$refs.window.refs.browser.selectLocalFile();
};
this.ok = () => {
this.trigger('selected', this.multiple ? this.files : this.files[0]);
- this.refs.window.close();
+ this.$refs.window.close();
};
</script>
</mk-select-file-from-drive-window>
diff --git a/src/web/app/desktop/tags/select-folder-from-drive-window.tag b/src/web/app/desktop/tags/select-folder-from-drive-window.tag
index 45700420cc..7bfe5af357 100644
--- a/src/web/app/desktop/tags/select-folder-from-drive-window.tag
+++ b/src/web/app/desktop/tags/select-folder-from-drive-window.tag
@@ -95,18 +95,18 @@
this.title = this.opts.title || '%fa:R folder%フォルダを選択';
this.on('mount', () => {
- this.refs.window.on('closed', () => {
+ this.$refs.window.on('closed', () => {
this.unmount();
});
});
this.close = () => {
- this.refs.window.close();
+ this.$refs.window.close();
};
this.ok = () => {
- this.trigger('selected', this.refs.window.refs.browser.folder);
- this.refs.window.close();
+ this.trigger('selected', this.$refs.window.refs.browser.folder);
+ this.$refs.window.close();
};
</script>
</mk-select-folder-from-drive-window>
diff --git a/src/web/app/desktop/tags/settings-window.tag b/src/web/app/desktop/tags/settings-window.tag
index 5a725af51e..e68a44a4f6 100644
--- a/src/web/app/desktop/tags/settings-window.tag
+++ b/src/web/app/desktop/tags/settings-window.tag
@@ -18,13 +18,13 @@
</style>
<script>
this.on('mount', () => {
- this.refs.window.on('closed', () => {
+ this.$refs.window.on('closed', () => {
this.unmount();
});
});
this.close = () => {
- this.refs.window.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 efc5da83f1..084bde0095 100644
--- a/src/web/app/desktop/tags/settings.tag
+++ b/src/web/app/desktop/tags/settings.tag
@@ -179,10 +179,10 @@
this.updateAccount = () => {
this.api('i/update', {
- name: this.refs.accountName.value,
- location: this.refs.accountLocation.value || null,
- description: this.refs.accountDescription.value || null,
- birthday: this.refs.accountBirthday.value || null
+ name: this.$refs.accountName.value,
+ location: this.$refs.accountLocation.value || null,
+ description: this.$refs.accountDescription.value || null,
+ birthday: this.$refs.accountBirthday.value || null
}).then(() => {
notify('プロフィールを更新しました');
});
@@ -320,7 +320,7 @@
this.submit = () => {
this.api('i/2fa/done', {
- token: this.refs.token.value
+ token: this.$refs.token.value
}).then(() => {
notify('%i18n:desktop.tags.mk-2fa-setting.success%');
this.I.two_factor_enabled = true;
diff --git a/src/web/app/desktop/tags/sub-post-content.tag b/src/web/app/desktop/tags/sub-post-content.tag
index 1a81b545b6..01e1fdb31e 100644
--- a/src/web/app/desktop/tags/sub-post-content.tag
+++ b/src/web/app/desktop/tags/sub-post-content.tag
@@ -43,9 +43,9 @@
this.on('mount', () => {
if (this.post.text) {
const tokens = this.post.ast;
- this.refs.text.innerHTML = compile(tokens, false);
+ this.$refs.text.innerHTML = compile(tokens, false);
- Array.from(this.refs.text.children).forEach(e => {
+ Array.from(this.$refs.text.children).forEach(e => {
if (e.tagName == 'MK-URL') riot.mount(e);
});
}
diff --git a/src/web/app/desktop/tags/timeline.tag b/src/web/app/desktop/tags/timeline.tag
index 0616a95f99..115b22c862 100644
--- a/src/web/app/desktop/tags/timeline.tag
+++ b/src/web/app/desktop/tags/timeline.tag
@@ -437,10 +437,10 @@
this.refresh = post => {
this.set(post);
this.update();
- if (this.refs.reactionsViewer) this.refs.reactionsViewer.update({
+ if (this.$refs.reactionsViewer) this.$refs.reactionsViewer.update({
post
});
- if (this.refs.pollViewer) this.refs.pollViewer.init(post);
+ if (this.$refs.pollViewer) this.$refs.pollViewer.init(post);
};
this.onStreamPostUpdated = data => {
@@ -484,9 +484,9 @@
if (this.p.text) {
const tokens = this.p.ast;
- this.refs.text.innerHTML = this.refs.text.innerHTML.replace('<p class="dummy"></p>', compile(tokens));
+ this.$refs.text.innerHTML = this.$refs.text.innerHTML.replace('<p class="dummy"></p>', compile(tokens));
- Array.from(this.refs.text.children).forEach(e => {
+ Array.from(this.$refs.text.children).forEach(e => {
if (e.tagName == 'MK-URL') riot.mount(e);
});
@@ -494,7 +494,7 @@
tokens
.filter(t => (t.type == 'url' || t.type == 'link') && !t.silent)
.map(t => {
- riot.mount(this.refs.text.appendChild(document.createElement('mk-url-preview')), {
+ riot.mount(this.$refs.text.appendChild(document.createElement('mk-url-preview')), {
url: t.url
});
});
@@ -521,14 +521,14 @@
this.react = () => {
riot.mount(document.body.appendChild(document.createElement('mk-reaction-picker')), {
- source: this.refs.reactButton,
+ source: this.$refs.reactButton,
post: this.p
});
};
this.menu = () => {
riot.mount(document.body.appendChild(document.createElement('mk-post-menu')), {
- source: this.refs.menuButton,
+ source: this.$refs.menuButton,
post: this.p
});
};
diff --git a/src/web/app/desktop/tags/ui.tag b/src/web/app/desktop/tags/ui.tag
index 3e7b5c2eca..777624d7ba 100644
--- a/src/web/app/desktop/tags/ui.tag
+++ b/src/web/app/desktop/tags/ui.tag
@@ -180,7 +180,7 @@
this.onsubmit = e => {
e.preventDefault();
- this.page('/search?q=' + encodeURIComponent(this.refs.q.value));
+ this.page('/search?q=' + encodeURIComponent(this.$refs.q.value));
};
</script>
</mk-ui-header-search>
diff --git a/src/web/app/desktop/tags/user-timeline.tag b/src/web/app/desktop/tags/user-timeline.tag
index 19ee2f3284..0bfad05c27 100644
--- a/src/web/app/desktop/tags/user-timeline.tag
+++ b/src/web/app/desktop/tags/user-timeline.tag
@@ -88,7 +88,7 @@
this.onDocumentKeydown = e => {
if (e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA') {
if (e.which == 84) { // [t]
- this.refs.timeline.focus();
+ this.$refs.timeline.focus();
}
}
};
@@ -103,25 +103,25 @@
isLoading: false,
isEmpty: posts.length == 0
});
- this.refs.timeline.setPosts(posts);
+ this.$refs.timeline.setPosts(posts);
if (cb) cb();
});
};
this.more = () => {
- if (this.moreLoading || this.isLoading || this.refs.timeline.posts.length == 0) return;
+ if (this.moreLoading || this.isLoading || this.$refs.timeline.posts.length == 0) return;
this.update({
moreLoading: true
});
this.api('users/posts', {
user_id: this.user.id,
with_replies: this.mode == 'with-replies',
- until_id: this.refs.timeline.tail().id
+ until_id: this.$refs.timeline.tail().id
}).then(posts => {
this.update({
moreLoading: false
});
- this.refs.timeline.prependPosts(posts);
+ this.$refs.timeline.prependPosts(posts);
});
};
diff --git a/src/web/app/desktop/tags/user.tag b/src/web/app/desktop/tags/user.tag
index 5dc4175cf9..8eca3caaa3 100644
--- a/src/web/app/desktop/tags/user.tag
+++ b/src/web/app/desktop/tags/user.tag
@@ -206,10 +206,10 @@
const z = 1.25; // 奥行き(小さいほど奥)
const pos = -(top / z);
- this.refs.banner.style.backgroundPosition = `center calc(50% - ${pos}px)`;
+ this.$refs.banner.style.backgroundPosition = `center calc(50% - ${pos}px)`;
const blur = top / 32
- if (blur <= 10) this.refs.banner.style.filter = `blur(${blur}px)`;
+ if (blur <= 10) this.$refs.banner.style.filter = `blur(${blur}px)`;
};
this.onUpdateBanner = () => {
@@ -715,12 +715,12 @@
this.user = this.opts.user;
this.on('mount', () => {
- this.refs.tl.on('loaded', () => {
+ this.$refs.tl.on('loaded', () => {
this.trigger('loaded');
});
- this.scrollFollowerLeft = new ScrollFollower(this.refs.left, this.parent.root.getBoundingClientRect().top);
- this.scrollFollowerRight = new ScrollFollower(this.refs.right, this.parent.root.getBoundingClientRect().top);
+ this.scrollFollowerLeft = new ScrollFollower(this.$refs.left, this.parent.root.getBoundingClientRect().top);
+ this.scrollFollowerRight = new ScrollFollower(this.$refs.right, this.parent.root.getBoundingClientRect().top);
});
this.on('unmount', () => {
@@ -729,7 +729,7 @@
});
this.warp = date => {
- this.refs.tl.warp(date);
+ this.$refs.tl.warp(date);
};
</script>
</mk-user-home>
diff --git a/src/web/app/desktop/tags/window.tag b/src/web/app/desktop/tags/window.tag
index ebc7382d5a..31830d9078 100644
--- a/src/web/app/desktop/tags/window.tag
+++ b/src/web/app/desktop/tags/window.tag
@@ -199,13 +199,13 @@
this.canResize = !this.isFlexible;
this.on('mount', () => {
- this.refs.main.style.width = this.opts.width || '530px';
- this.refs.main.style.height = this.opts.height || 'auto';
+ this.$refs.main.style.width = this.opts.width || '530px';
+ this.$refs.main.style.height = this.opts.height || 'auto';
- this.refs.main.style.top = '15%';
- this.refs.main.style.left = (window.innerWidth / 2) - (this.refs.main.offsetWidth / 2) + 'px';
+ this.$refs.main.style.top = '15%';
+ this.$refs.main.style.left = (window.innerWidth / 2) - (this.$refs.main.offsetWidth / 2) + 'px';
- this.refs.header.addEventListener('contextmenu', e => {
+ this.$refs.header.addEventListener('contextmenu', e => {
e.preventDefault();
});
@@ -219,15 +219,15 @@
});
this.onBrowserResize = () => {
- const position = this.refs.main.getBoundingClientRect();
+ const position = this.$refs.main.getBoundingClientRect();
const browserWidth = window.innerWidth;
const browserHeight = window.innerHeight;
- const windowWidth = this.refs.main.offsetWidth;
- const windowHeight = this.refs.main.offsetHeight;
- if (position.left < 0) this.refs.main.style.left = 0;
- if (position.top < 0) this.refs.main.style.top = 0;
- if (position.left + windowWidth > browserWidth) this.refs.main.style.left = browserWidth - windowWidth + 'px';
- if (position.top + windowHeight > browserHeight) this.refs.main.style.top = browserHeight - windowHeight + 'px';
+ const windowWidth = this.$refs.main.offsetWidth;
+ const windowHeight = this.$refs.main.offsetHeight;
+ if (position.left < 0) this.$refs.main.style.left = 0;
+ if (position.top < 0) this.$refs.main.style.top = 0;
+ if (position.left + windowWidth > browserWidth) this.$refs.main.style.left = browserWidth - windowWidth + 'px';
+ if (position.top + windowHeight > browserHeight) this.$refs.main.style.top = browserHeight - windowHeight + 'px';
};
this.open = () => {
@@ -236,25 +236,25 @@
this.top();
if (this.isModal) {
- this.refs.bg.style.pointerEvents = 'auto';
+ this.$refs.bg.style.pointerEvents = 'auto';
anime({
- targets: this.refs.bg,
+ targets: this.$refs.bg,
opacity: 1,
duration: 100,
easing: 'linear'
});
}
- this.refs.main.style.pointerEvents = 'auto';
+ this.$refs.main.style.pointerEvents = 'auto';
anime({
- targets: this.refs.main,
+ targets: this.$refs.main,
opacity: 1,
scale: [1.1, 1],
duration: 200,
easing: 'easeOutQuad'
});
- //this.refs.main.focus();
+ //this.$refs.main.focus();
setTimeout(() => {
this.trigger('opened');
@@ -262,10 +262,10 @@
};
this.popout = () => {
- const position = this.refs.main.getBoundingClientRect();
+ const position = this.$refs.main.getBoundingClientRect();
- const width = parseInt(getComputedStyle(this.refs.main, '').width, 10);
- const height = parseInt(getComputedStyle(this.refs.main, '').height, 10);
+ const width = parseInt(getComputedStyle(this.$refs.main, '').width, 10);
+ const height = parseInt(getComputedStyle(this.$refs.main, '').height, 10);
const x = window.screenX + position.left;
const y = window.screenY + position.top;
@@ -281,19 +281,19 @@
this.trigger('closing');
if (this.isModal) {
- this.refs.bg.style.pointerEvents = 'none';
+ this.$refs.bg.style.pointerEvents = 'none';
anime({
- targets: this.refs.bg,
+ targets: this.$refs.bg,
opacity: 0,
duration: 300,
easing: 'linear'
});
}
- this.refs.main.style.pointerEvents = 'none';
+ this.$refs.main.style.pointerEvents = 'none';
anime({
- targets: this.refs.main,
+ targets: this.$refs.main,
opacity: 0,
scale: 0.8,
duration: 300,
@@ -318,8 +318,8 @@
});
if (z > 0) {
- this.refs.main.style.zIndex = z + 1;
- if (this.isModal) this.refs.bg.style.zIndex = z + 1;
+ this.$refs.main.style.zIndex = z + 1;
+ if (this.isModal) this.$refs.bg.style.zIndex = z + 1;
}
};
@@ -340,9 +340,9 @@
this.onHeaderMousedown = e => {
e.preventDefault();
- if (!contains(this.refs.main, document.activeElement)) this.refs.main.focus();
+ if (!contains(this.$refs.main, document.activeElement)) this.$refs.main.focus();
- const position = this.refs.main.getBoundingClientRect();
+ const position = this.$refs.main.getBoundingClientRect();
const clickX = e.clientX;
const clickY = e.clientY;
@@ -350,8 +350,8 @@
const moveBaseY = clickY - position.top;
const browserWidth = window.innerWidth;
const browserHeight = window.innerHeight;
- const windowWidth = this.refs.main.offsetWidth;
- const windowHeight = this.refs.main.offsetHeight;
+ const windowWidth = this.$refs.main.offsetWidth;
+ const windowHeight = this.$refs.main.offsetHeight;
// 動かした時
dragListen(me => {
@@ -370,8 +370,8 @@
// 右はみ出し
if (moveLeft + windowWidth > browserWidth) moveLeft = browserWidth - windowWidth;
- this.refs.main.style.left = moveLeft + 'px';
- this.refs.main.style.top = moveTop + 'px';
+ this.$refs.main.style.left = moveLeft + 'px';
+ this.$refs.main.style.top = moveTop + 'px';
});
};
@@ -380,8 +380,8 @@
e.preventDefault();
const base = e.clientY;
- const height = parseInt(getComputedStyle(this.refs.main, '').height, 10);
- const top = parseInt(getComputedStyle(this.refs.main, '').top, 10);
+ const height = parseInt(getComputedStyle(this.$refs.main, '').height, 10);
+ const top = parseInt(getComputedStyle(this.$refs.main, '').top, 10);
// 動かした時
dragListen(me => {
@@ -406,8 +406,8 @@
e.preventDefault();
const base = e.clientX;
- const width = parseInt(getComputedStyle(this.refs.main, '').width, 10);
- const left = parseInt(getComputedStyle(this.refs.main, '').left, 10);
+ const width = parseInt(getComputedStyle(this.$refs.main, '').width, 10);
+ const left = parseInt(getComputedStyle(this.$refs.main, '').left, 10);
const browserWidth = window.innerWidth;
// 動かした時
@@ -430,8 +430,8 @@
e.preventDefault();
const base = e.clientY;
- const height = parseInt(getComputedStyle(this.refs.main, '').height, 10);
- const top = parseInt(getComputedStyle(this.refs.main, '').top, 10);
+ const height = parseInt(getComputedStyle(this.$refs.main, '').height, 10);
+ const top = parseInt(getComputedStyle(this.$refs.main, '').top, 10);
const browserHeight = window.innerHeight;
// 動かした時
@@ -454,8 +454,8 @@
e.preventDefault();
const base = e.clientX;
- const width = parseInt(getComputedStyle(this.refs.main, '').width, 10);
- const left = parseInt(getComputedStyle(this.refs.main, '').left, 10);
+ const width = parseInt(getComputedStyle(this.$refs.main, '').width, 10);
+ const left = parseInt(getComputedStyle(this.$refs.main, '').left, 10);
// 動かした時
dragListen(me => {
@@ -501,22 +501,22 @@
// 高さを適用
this.applyTransformHeight = height => {
- this.refs.main.style.height = height + 'px';
+ this.$refs.main.style.height = height + 'px';
};
// 幅を適用
this.applyTransformWidth = width => {
- this.refs.main.style.width = width + 'px';
+ this.$refs.main.style.width = width + 'px';
};
// Y座標を適用
this.applyTransformTop = top => {
- this.refs.main.style.top = top + 'px';
+ this.$refs.main.style.top = top + 'px';
};
// X座標を適用
this.applyTransformLeft = left => {
- this.refs.main.style.left = left + 'px';
+ this.$refs.main.style.left = left + 'px';
};
function dragListen(fn) {