summaryrefslogtreecommitdiff
path: root/src/web
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-02-01 04:49:23 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-02-01 04:49:23 +0900
commit23810d0ce57d69ba73ae693ec2e0e179a0f3879f (patch)
treeb72dce23426e107cdd449ac61dafde978866a482 /src/web
parent[Client:Mobile] Add the 'Insert The Cat' button (diff)
downloadmisskey-23810d0ce57d69ba73ae693ec2e0e179a0f3879f.tar.gz
misskey-23810d0ce57d69ba73ae693ec2e0e179a0f3879f.tar.bz2
misskey-23810d0ce57d69ba73ae693ec2e0e179a0f3879f.zip
Refactor: Extract the cat generator
Diffstat (limited to 'src/web')
-rw-r--r--src/web/app/common/scripts/get-cat.js3
-rw-r--r--src/web/app/desktop/tags/post-form.tag4
-rw-r--r--src/web/app/mobile/tags/post-form.tag4
3 files changed, 9 insertions, 2 deletions
diff --git a/src/web/app/common/scripts/get-cat.js b/src/web/app/common/scripts/get-cat.js
new file mode 100644
index 0000000000..799f31b9c3
--- /dev/null
+++ b/src/web/app/common/scripts/get-cat.js
@@ -0,0 +1,3 @@
+module.exports = function() {
+ return '(=^・・^=)'
+};
diff --git a/src/web/app/desktop/tags/post-form.tag b/src/web/app/desktop/tags/post-form.tag
index c5cf094034..cc9764e6f6 100644
--- a/src/web/app/desktop/tags/post-form.tag
+++ b/src/web/app/desktop/tags/post-form.tag
@@ -285,6 +285,8 @@
</style>
<script>
+ get-cat = require '../../common/scripts/get-cat'
+
@mixin \api
@mixin \notify
@mixin \autocomplete
@@ -429,6 +431,6 @@
@update!
@cat = ~>
- @refs.text.value = @refs.text.value + '(=^・・^=)'
+ @refs.text.value = @refs.text.value + get-cat!
</script>
</mk-post-form>
diff --git a/src/web/app/mobile/tags/post-form.tag b/src/web/app/mobile/tags/post-form.tag
index c501994cdf..312046363c 100644
--- a/src/web/app/mobile/tags/post-form.tag
+++ b/src/web/app/mobile/tags/post-form.tag
@@ -178,6 +178,8 @@
</style>
<script>
+ get-cat = require '../../common/scripts/get-cat'
+
@mixin \api
@wait = false
@@ -264,6 +266,6 @@
@unmount!
@cat = ~>
- @refs.text.value = @refs.text.value + '(=^・・^=)'
+ @refs.text.value = @refs.text.value + get-cat!
</script>
</mk-post-form>