Skip to content

Commit

Permalink
Revert "MFMの検索エンジンをユーザー設定で変える" (#616)
Browse files Browse the repository at this point in the history
  • Loading branch information
kozakura913 authored Jan 16, 2025
1 parent 19a0caf commit 73a9056
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 31 deletions.
4 changes: 0 additions & 4 deletions locales/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4215,10 +4215,6 @@ export interface Locale extends ILocale {
* CWを維持する
*/
"keepCw": string;
/**
* %sが検索語句に置き換えられます
*/
"searchEngineDescription": string;
/**
* Pub/Subのアカウント
*/
Expand Down
1 change: 0 additions & 1 deletion locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,6 @@ usernameInfo: "サーバー上であなたのアカウントを一意に識別
aiChanMode: "藍モード"
devMode: "開発者モード"
keepCw: "CWを維持する"
searchEngineDescription: "%sが検索語句に置き換えられます"
pubSub: "Pub/Subのアカウント"
lastCommunication: "直近の通信"
resolved: "解決済み"
Expand Down
15 changes: 3 additions & 12 deletions packages/frontend/src/components/MkGoogle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@ SPDX-License-Identifier: AGPL-3.0-only

<script lang="ts" setup>
import { ref } from 'vue';
import { url as local } from '@@/js/config.js';
import { i18n } from '@/i18n.js';
import { defaultStore } from '@/store.js';
import { useRouter } from '@/router/supplier.js';

const router = useRouter();

const props = defineProps<{
q: string;
Expand All @@ -26,13 +21,9 @@ const props = defineProps<{
const query = ref(props.q);

const search = () => {
const searchUrl = String(defaultStore.state.searchEngine).replaceAll('%s', encodeURIComponent(query.value));
const url = new URL(searchUrl, local);
if (url.origin === local) {
router.push(url.toString().substring(local.length));
} else {
window.open(searchUrl, '_blank', 'noopener');
}
const sp = new URLSearchParams();
sp.append('q', query.value);
window.open(`https://www.google.com/search?${sp.toString()}`, '_blank', 'noopener');
};
</script>

Expand Down
6 changes: 0 additions & 6 deletions packages/frontend/src/pages/settings/general.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkSwitch v-model="disableNyaize">{{ i18n.ts.noNyaization }} <span class="_beta">CherryPick</span></MkSwitch>
<MkSwitch v-model="checkMultipleRenote">{{ i18n.ts.showMultipleRenoteWarning }} <span class="_beta">yojo-art</span></MkSwitch>
</div>
<MkInput v-model="searchEngine" manualSave :spellcheck="false">
<template #label>{{ i18n.ts.search }}<span class="_beta" style="vertical-align: middle;">yojo-art</span></template>
<template #caption>{{ i18n.ts.searchEngineDescription }}</template>
</MkInput>
<MkSelect v-model="serverDisconnectedBehavior">
<template #label>{{ i18n.ts.whenServerDisconnected }} <span class="_beta" style="vertical-align: middle;">CherryPick</span></template>
<option value="reload">{{ i18n.ts._serverDisconnectedBehavior.reload }}</option>
Expand Down Expand Up @@ -136,7 +132,6 @@ import FormSection from '@/components/form/section.vue';
import FormLink from '@/components/form/link.vue';
import MkLink from '@/components/MkLink.vue';
import MkInfo from '@/components/MkInfo.vue';
import MkInput from '@/components/MkInput.vue';
import { defaultStore } from '@/store.js';
import * as os from '@/os.js';
import { misskeyApi } from '@/scripts/misskey-api.js';
Expand Down Expand Up @@ -176,7 +171,6 @@ const useAutoTranslate = computed(defaultStore.makeGetterSetter('useAutoTranslat
const welcomeBackToast = computed(defaultStore.makeGetterSetter('welcomeBackToast'));
const disableNyaize = computed(defaultStore.makeGetterSetter('disableNyaize'));
const checkMultipleRenote = computed(defaultStore.makeGetterSetter('checkMultipleRenote'));
const searchEngine = computed(defaultStore.makeGetterSetter('searchEngine'));

watch(lang, () => {
miLocalStorage.setItem('lang', lang.value as string);
Expand Down
4 changes: 0 additions & 4 deletions packages/frontend/src/pages/settings/preferences-backups.vue
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,6 @@ const defaultStoreSaveKeys: (keyof typeof defaultStore['state'])[] = [
'showMoreButtonInNoteFooter',
'selectReaction',
// #endregion CherryPick
// #region yojo-art
'checkMultipleRenote',
'searchEngine',
// #endregion yojo-art
];
const coldDeviceStorageSaveKeys: (keyof typeof ColdDeviceStorage.default)[] = [
'lightTheme',
Expand Down
4 changes: 0 additions & 4 deletions packages/frontend/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,6 @@ export const defaultStore = markRaw(new Storage('base', {
where: 'account',
default: [] as string[],
},
searchEngine: {
where: 'account',
default: 'https://www.google.com/search?q=%s',
},

menu: {
where: 'deviceAccount',
Expand Down

0 comments on commit 73a9056

Please sign in to comment.