Feature / Configurable web search engine (#3406)

* configurable web search engine

* add webSearchEngine config in mobile ui

* add webSearchEngine config in desktop ui

* add webSearchEngine config

* add messages for web search engine config

* correct locale
This commit is contained in:
Hakaba Hitoyo
2018-11-29 11:05:17 +09:00
committed by syuilo
parent 0ce64f8c33
commit afdb23ff57
5 changed files with 29 additions and 1 deletions

View File

@ -22,7 +22,10 @@ export default Vue.extend({
},
methods: {
search() {
window.open(`https://www.google.com/?#q=${this.query}`, '_blank');
const engine = this.$store.state.settings.webSearchEngine ||
'https://www.google.com/?#q={{query}}';
const url = engine.replace('{{query}}', this.query)
window.open(url, '_blank');
}
}
});