diff --git a/src/config/locales/de/translation.json b/src/config/locales/de/translation.json
index 6e267681..0cdbc286 100644
--- a/src/config/locales/de/translation.json
+++ b/src/config/locales/de/translation.json
@@ -274,7 +274,8 @@
"search": {
"search": "Suche",
"account": "Konto",
- "keyword": "stichwort"
+ "keyword": "stichwort",
+ "toot": "Toot"
},
"lists": {
"index": {
diff --git a/src/config/locales/en/translation.json b/src/config/locales/en/translation.json
index 198be689..20b897ed 100644
--- a/src/config/locales/en/translation.json
+++ b/src/config/locales/en/translation.json
@@ -295,7 +295,8 @@
"search": "Search",
"account": "Account",
"tag": "Hashtag",
- "keyword": "keyword"
+ "keyword": "keyword",
+ "toot": "Toot"
},
"lists": {
"index": {
diff --git a/src/config/locales/fr/translation.json b/src/config/locales/fr/translation.json
index 20be1d6e..1aed7496 100644
--- a/src/config/locales/fr/translation.json
+++ b/src/config/locales/fr/translation.json
@@ -274,7 +274,8 @@
"search": {
"search": "Rechercher",
"account": "Compte",
- "keyword": "mot clé"
+ "keyword": "mot clé",
+ "toot": "Pouets"
},
"lists": {
"index": {
diff --git a/src/config/locales/ja/translation.json b/src/config/locales/ja/translation.json
index e926f999..c0a286bc 100644
--- a/src/config/locales/ja/translation.json
+++ b/src/config/locales/ja/translation.json
@@ -288,7 +288,8 @@
"search": "検索",
"account": "アカウント",
"tag": "ハッシュタグ",
- "keyword": "キーワード"
+ "keyword": "キーワード",
+ "toot": "トゥート時"
},
"lists": {
"index": {
diff --git a/src/config/locales/ko/translation.json b/src/config/locales/ko/translation.json
index 75ef353a..8566b87a 100644
--- a/src/config/locales/ko/translation.json
+++ b/src/config/locales/ko/translation.json
@@ -274,7 +274,8 @@
"search": {
"search": "검색",
"account": "계정",
- "keyword": "키워드"
+ "keyword": "키워드",
+ "toot": "툿"
},
"lists": {
"index": {
diff --git a/src/config/locales/pl/translation.json b/src/config/locales/pl/translation.json
index 11dade85..b70bacb2 100644
--- a/src/config/locales/pl/translation.json
+++ b/src/config/locales/pl/translation.json
@@ -274,7 +274,8 @@
"search": {
"search": "Szukaj",
"account": "Konta",
- "keyword": "Słowo kluczowe"
+ "keyword": "Słowo kluczowe",
+ "toot": "Wpisy"
},
"lists": {
"index": {
diff --git a/src/renderer/components/TimelineSpace/Contents/Search.vue b/src/renderer/components/TimelineSpace/Contents/Search.vue
index 0e2e4321..3524b970 100644
--- a/src/renderer/components/TimelineSpace/Contents/Search.vue
+++ b/src/renderer/components/TimelineSpace/Contents/Search.vue
@@ -17,6 +17,7 @@
+
@@ -25,10 +26,11 @@
import { mapState } from 'vuex'
import SearchAccount from './Search/Account'
import SearchTag from './Search/Tag'
+import SearchToots from './Search/Toots'
export default {
name: 'search',
- components: { SearchAccount, SearchTag },
+ components: { SearchAccount, SearchTag, SearchToots },
data () {
return {
target: 'account',
@@ -50,6 +52,10 @@ export default {
{
target: 'tag',
label: this.$t('search.tag')
+ },
+ {
+ target: 'toot',
+ label: this.$t('search.toot')
}
]
}
@@ -76,6 +82,15 @@ export default {
})
})
break
+ case 'toot':
+ this.$store.dispatch('TimelineSpace/Contents/Search/Toots/search', this.query)
+ .catch(() => {
+ this.$message({
+ message: this.$t('message.search_error'),
+ type: 'error'
+ })
+ })
+ break
default:
break
}
diff --git a/src/renderer/components/TimelineSpace/Contents/Search/Toots.vue b/src/renderer/components/TimelineSpace/Contents/Search/Toots.vue
new file mode 100644
index 00000000..130de11d
--- /dev/null
+++ b/src/renderer/components/TimelineSpace/Contents/Search/Toots.vue
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
diff --git a/src/renderer/store/TimelineSpace/Contents/Search.js b/src/renderer/store/TimelineSpace/Contents/Search.js
index c6d2a03e..9bead2c5 100644
--- a/src/renderer/store/TimelineSpace/Contents/Search.js
+++ b/src/renderer/store/TimelineSpace/Contents/Search.js
@@ -1,9 +1,10 @@
import Account from './Search/Account'
import Tag from './Search/Tag'
+import Toots from './Search/Toots'
const Search = {
namespaced: true,
- modules: { Account, Tag },
+ modules: { Account, Tag, Toots },
state: {
loading: false
},
diff --git a/src/renderer/store/TimelineSpace/Contents/Search/Toots.js b/src/renderer/store/TimelineSpace/Contents/Search/Toots.js
new file mode 100644
index 00000000..f3ca029d
--- /dev/null
+++ b/src/renderer/store/TimelineSpace/Contents/Search/Toots.js
@@ -0,0 +1,32 @@
+import Mastodon from 'megalodon'
+
+const Toots = {
+ namespaced: true,
+ state: {
+ results: []
+ },
+ mutations: {
+ updateResults (state, results) {
+ state.results = results
+ }
+ },
+ actions: {
+ search ({ state, commit, rootState }, query) {
+ commit('TimelineSpace/Contents/Search/changeLoading', true, { root: true })
+ const client = new Mastodon(
+ rootState.TimelineSpace.account.accessToken,
+ rootState.TimelineSpace.account.baseURL + '/api/v1'
+ )
+ return client.get('/search', { q: query, resolve: true })
+ .then(res => {
+ commit('updateResults', res.data.statuses)
+ return res.data
+ })
+ .finally(() => {
+ commit('TimelineSpace/Contents/Search/changeLoading', false, { root: true })
+ })
+ }
+ }
+}
+
+export default Toots