Fix indent and space
This commit is contained in:
parent
112e2f0ca9
commit
c3169839d7
|
@ -13,15 +13,15 @@ browser.runtime.onInstalled.addListener(function () {
|
||||||
let S = new settingsObj()
|
let S = new settingsObj()
|
||||||
browser.storage.onChanged.addListener(showMenu);
|
browser.storage.onChanged.addListener(showMenu);
|
||||||
|
|
||||||
S.init().then(function(){
|
S.init().then(function () {
|
||||||
showMenu();
|
showMenu();
|
||||||
});
|
});
|
||||||
function showMenu(){
|
|
||||||
if(S.get().ifShowMenu){
|
function showMenu() {
|
||||||
|
if (S.get().ifShowMenu) {
|
||||||
menuRemove();
|
menuRemove();
|
||||||
menuCreate();
|
menuCreate();
|
||||||
}
|
} else menuRemove();
|
||||||
else menuRemove();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function initialSetting() {
|
function initialSetting() {
|
||||||
|
@ -32,13 +32,13 @@ function initialSetting() {
|
||||||
case "ko":
|
case "ko":
|
||||||
case "ru":
|
case "ru":
|
||||||
targetLang = browser.i18n.getUILanguage();
|
targetLang = browser.i18n.getUILanguage();
|
||||||
secondTargetLang="en";
|
secondTargetLang = "en";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
targetLang = "en";
|
targetLang = "en";
|
||||||
secondTargetLang="ja";
|
secondTargetLang = "ja";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//メニューを表示
|
//メニューを表示
|
||||||
|
@ -48,7 +48,7 @@ function menuCreate() {
|
||||||
title: browser.i18n.getMessage("translatePageMenu"),
|
title: browser.i18n.getMessage("translatePageMenu"),
|
||||||
contexts: ["all"],
|
contexts: ["all"],
|
||||||
});
|
});
|
||||||
|
|
||||||
browser.contextMenus.create({
|
browser.contextMenus.create({
|
||||||
id: "translateText",
|
id: "translateText",
|
||||||
title: browser.i18n.getMessage("translateTextMenu"),
|
title: browser.i18n.getMessage("translateTextMenu"),
|
||||||
|
|
|
@ -2,17 +2,17 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* 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;
|
defaultTargetLang = value.targetLang;
|
||||||
targetLang = value.targetLang;
|
targetLang = value.targetLang;
|
||||||
secondTargetLang = value.secondTargetLang;
|
secondTargetLang = value.secondTargetLang;
|
||||||
ifChangeSecondLang=value.ifChangeSecondLang;
|
ifChangeSecondLang = value.ifChangeSecondLang;
|
||||||
langList.value = targetLang; //リスト初期値をセット
|
langList.value = targetLang; //リスト初期値をセット
|
||||||
langList.addEventListener("change", changeLang);
|
langList.addEventListener("change", changeLang);
|
||||||
|
|
||||||
document.body.style.fontSize=value.fontSize;
|
document.body.style.fontSize = value.fontSize;
|
||||||
})
|
})
|
||||||
|
|
||||||
let target = document.getElementById("target");
|
let target = document.getElementById("target");
|
||||||
|
@ -21,7 +21,7 @@ let textarea = document.getElementById("textarea");
|
||||||
|
|
||||||
langList.innerHTML = browser.i18n.getMessage("langList");
|
langList.innerHTML = browser.i18n.getMessage("langList");
|
||||||
const initialText = browser.i18n.getMessage("initialTextArea");
|
const initialText = browser.i18n.getMessage("initialTextArea");
|
||||||
textarea.placeholder= initialText;
|
textarea.placeholder = initialText;
|
||||||
|
|
||||||
let targetLang;
|
let targetLang;
|
||||||
let secondTargetLang;
|
let secondTargetLang;
|
||||||
|
|
Loading…
Reference in a new issue