diff --git a/simple-translate/background.js b/simple-translate/background.js index 9d6f1e1..eea7abf 100644 --- a/simple-translate/background.js +++ b/simple-translate/background.js @@ -13,15 +13,15 @@ browser.runtime.onInstalled.addListener(function () { let S = new settingsObj() browser.storage.onChanged.addListener(showMenu); -S.init().then(function(){ +S.init().then(function () { showMenu(); }); -function showMenu(){ - if(S.get().ifShowMenu){ + +function showMenu() { + if (S.get().ifShowMenu) { menuRemove(); menuCreate(); - } - else menuRemove(); + } else menuRemove(); } function initialSetting() { @@ -32,13 +32,13 @@ function initialSetting() { case "ko": case "ru": targetLang = browser.i18n.getUILanguage(); - secondTargetLang="en"; + secondTargetLang = "en"; break; default: targetLang = "en"; - secondTargetLang="ja"; + secondTargetLang = "ja"; break; - } + } } //メニューを表示 @@ -48,7 +48,7 @@ function menuCreate() { title: browser.i18n.getMessage("translatePageMenu"), contexts: ["all"], }); - + browser.contextMenus.create({ id: "translateText", title: browser.i18n.getMessage("translateTextMenu"), diff --git a/simple-translate/popup/popup.js b/simple-translate/popup/popup.js index 920cf0c..d658d4a 100644 --- a/simple-translate/popup/popup.js +++ b/simple-translate/popup/popup.js @@ -2,17 +2,17 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -let S=new settingsObj(); +let S = new settingsObj(); //設定を読み出し -S.init().then(function(value){ +S.init().then(function (value) { defaultTargetLang = value.targetLang; targetLang = value.targetLang; secondTargetLang = value.secondTargetLang; - ifChangeSecondLang=value.ifChangeSecondLang; + ifChangeSecondLang = value.ifChangeSecondLang; langList.value = targetLang; //リスト初期値をセット langList.addEventListener("change", changeLang); - - document.body.style.fontSize=value.fontSize; + + document.body.style.fontSize = value.fontSize; }) let target = document.getElementById("target"); @@ -21,7 +21,7 @@ let textarea = document.getElementById("textarea"); langList.innerHTML = browser.i18n.getMessage("langList"); const initialText = browser.i18n.getMessage("initialTextArea"); -textarea.placeholder= initialText; +textarea.placeholder = initialText; let targetLang; let secondTargetLang;