Skip to content

Commit

Permalink
2.2.1 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Kajitsy authored Jan 5, 2024
1 parent 1cf2c92 commit c56e676
Show file tree
Hide file tree
Showing 16 changed files with 42 additions and 92 deletions.
2 changes: 1 addition & 1 deletion chromium/_locales/en/messages.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extensionDescription": {
"message": "With Genshin/Star Rail CodeEntter, you can quickly input promo codes for Genshin Impact and Honkai Star Rail, and also share a link to this tool :) ChromiumVersion 2.2.0"
"message": "With Genshin/Star Rail CodeEntter, you can quickly input promo codes for Genshin Impact and Honkai Star Rail, and also share a link to this tool :) ChromiumVersion 2.2.1"
},
"submit": {
"message": "Submit"
Expand Down
2 changes: 1 addition & 1 deletion chromium/_locales/es/messages.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extensionDescription": {
"message": "Con Genshin/Star Rail CodeEntter, puedes ingresar rápidamente códigos promocionales para Genshin Impact y Honkai Star Rail, ¡y también compartir un enlace a esta herramienta :) ChromiumVersion 2.2.0"
"message": "Con Genshin/Star Rail CodeEntter, puedes ingresar rápidamente códigos promocionales para Genshin Impact y Honkai Star Rail, ¡y también compartir un enlace a esta herramienta :) ChromiumVersion 2.2.1"
},
"submit": {
"message": "Enviar"
Expand Down
2 changes: 1 addition & 1 deletion chromium/_locales/jp/messages.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extensionDescription": {
"message": "Genshin/Star Rail CodeEntterを使用すると、Genshin ImpactおよびHonkai Star Railのプロモコードを素早く入力でき、またこのツールのリンクを共有することもできます :) ChromiumVersion 2.2.0"
"message": "Genshin/Star Rail CodeEntterを使用すると、Genshin ImpactおよびHonkai Star Railのプロモコードを素早く入力でき、またこのツールのリンクを共有することもできます :) ChromiumVersion 2.2.1"
},
"submit": {
"message": "送信"
Expand Down
2 changes: 1 addition & 1 deletion chromium/_locales/ru/messages.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extensionDescription": {
"message": "Благодаря Genshin/Star Rail CodeEntter вы сможете быстро вводить промокоды для Genshin Impact и Honkai Star Rail, a также можете поделиться ссылкой на этот кодик :) ChromiumVersion 2.2.0"
"message": "Благодаря Genshin/Star Rail CodeEntter вы сможете быстро вводить промокоды для Genshin Impact и Honkai Star Rail, a также можете поделиться ссылкой на этот кодик :) ChromiumVersion 2.2.1"
},
"submit": {
"message": "Ввести"
Expand Down
2 changes: 1 addition & 1 deletion chromium/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Genshin/Star Rail CodeEntter",
"version": "2.2.0",
"version": "2.2.1",
"description": "__MSG_extensionDescription__",
"default_locale": "en",
"icons": {
Expand Down
2 changes: 1 addition & 1 deletion chromium/onlyGi.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ browser.storage.local.get(['buttonColorGi', 'buttonTextColorGi', 'BackgroundGi',
document.body.style.background = result.BackgroundColorGi;
}
else {
document.body.style.background = 'url("/pictures/backgroundGi.png")';
document.body.style.background = 'url("/pictures/backgroundGI.png")';
document.body.style.backgroundSize = 'cover';
document.body.style.backgroundRepeat = 'no-repeat';
document.body.style.backgroundPosition = 'center';
Expand Down
2 changes: 1 addition & 1 deletion chromium/onlyHsr.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ browser.storage.local.get(['buttonColorHsr', 'buttonTextColorHsr', 'BackgroundHs
document.body.style.background = result.BackgroundColorHsr;
}
else {
document.body.style.background = 'url("/pictures/BackgroundHsr.png")';
document.body.style.background = 'url("/pictures/backgroundHSR.png")';
document.body.style.backgroundSize = 'cover';
document.body.style.backgroundRepeat = 'no-repeat';
document.body.style.backgroundPosition = 'center';
Expand Down
53 changes: 14 additions & 39 deletions chromium/options_background.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,15 @@ if (typeof browser === "undefined") {
browser = chrome;
browser.browserAction = chrome.action;
}
browser.storage.onChanged.addListener(function(changes, areaName) {
if (areaName === 'local' && 'onlyGi' in changes) {
if (changes.onlyGi.newValue) {
browser.browserAction.setPopup({
popup: 'onlyGi.html'
});
} else {
browser.browserAction.setPopup({
popup: 'popup.html'
});
}
}
});

browser.storage.onChanged.addListener(function(changes, areaName) {
if (areaName === 'local' && 'onlyHsr' in changes) {
if (changes.onlyHsr.newValue) {
browser.browserAction.setPopup({
popup: 'onlyHsr.html'
});
} else {
browser.browserAction.setPopup({
popup: 'popup.html'
});
}
}
});
async function updatePopup() {
const resultGi = await browser.storage.local.get('onlyGi');
const resultHsr = await browser.storage.local.get('onlyHsr');

browser.storage.local.get('onlyGi', function(result) {
if (result.onlyGi) {
if (resultGi.onlyGi) {
browser.browserAction.setPopup({
popup: 'onlyGi.html'
});
} else {
browser.browserAction.setPopup({
popup: 'popup.html'
});
}
});

browser.storage.local.get('onlyHsr', function(result) {
if (result.onlyHsr) {
} else if (resultHsr.onlyHsr) {
browser.browserAction.setPopup({
popup: 'onlyHsr.html'
});
Expand All @@ -52,4 +19,12 @@ browser.storage.local.get('onlyHsr', function(result) {
popup: 'popup.html'
});
}
});
}

browser.storage.onChanged.addListener(async function(changes, areaName) {
if (areaName === 'local' && ('onlyGi' in changes || 'onlyHsr' in changes)) {
await updatePopup();
}
});

updatePopup();
2 changes: 1 addition & 1 deletion firefox/_locales/en/messages.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extensionDescription": {
"message": "With Genshin/Star Rail CodeEnter, you can quickly input promo codes for Genshin Impact and Honkai Star Rail, and also share a link to this tool :) Firefox Version 2.2.0"
"message": "With Genshin/Star Rail CodeEnter, you can quickly input promo codes for Genshin Impact and Honkai Star Rail, and also share a link to this tool :) FirefoxVersion 2.2.1"
},
"submit": {
"message": "Submit"
Expand Down
2 changes: 1 addition & 1 deletion firefox/_locales/es/messages.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extensionDescription": {
"message": "Con Genshin/Star Rail CodeEnter, puedes ingresar rápidamente códigos promocionales para Genshin Impact y Honkai Star Rail, ¡y también compartir un enlace a esta herramienta :) Versión de Firefox 2.2.0"
"message": "Con Genshin/Star Rail CodeEnter, puedes ingresar rápidamente códigos promocionales para Genshin Impact y Honkai Star Rail, ¡y también compartir un enlace a esta herramienta :) FirefoxVersion 2.2.1"
},
"submit": {
"message": "Enviar"
Expand Down
2 changes: 1 addition & 1 deletion firefox/_locales/jp/messages.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extensionDescription": {
"message": "Genshin/Star Rail CodeEnterを使用すると、Genshin ImpactおよびHonkai Star Railのプロモコードを素早く入力でき、またこのツールのリンクを共有することもできます :) FirefoxVersion 2.2.0"
"message": "Genshin/Star Rail CodeEnterを使用すると、Genshin ImpactおよびHonkai Star Railのプロモコードを素早く入力でき、またこのツールのリンクを共有することもできます :) FirefoxVersion 2.2.1"
},
"submit": {
"message": "送信"
Expand Down
2 changes: 1 addition & 1 deletion firefox/_locales/ru/messages.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extensionDescription": {
"message": "Благодаря Genshin/Star Rail CodeEntter вы сможете быстро вводить промокоды для Genshin Impact и Honkai Star Rail, a также можете поделиться ссылкой на этот кодик :) FirefoxVersion 2.2.0"
"message": "Благодаря Genshin/Star Rail CodeEntter вы сможете быстро вводить промокоды для Genshin Impact и Honkai Star Rail, a также можете поделиться ссылкой на этот кодик :) FirefoxVersion 2.2.1"
},
"submit": {
"message": "Ввести"
Expand Down
2 changes: 1 addition & 1 deletion firefox/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Genshin/Star Rail CodeEntter",
"version": "2.2.0",
"version": "2.2.1",
"description": "__MSG_extensionDescription__",
"default_locale": "en",
"icons": {
Expand Down
2 changes: 1 addition & 1 deletion firefox/onlyGi.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ browser.storage.local.get(['buttonColorGi', 'buttonTextColorGi', 'BackgroundGi',
document.body.style.background = result.BackgroundColorGi;
}
else {
document.body.style.background = 'url("/pictures/backgroundGi.png")';
document.body.style.background = 'url("/pictures/backgroundGI.png")';
document.body.style.backgroundSize = 'cover';
document.body.style.backgroundRepeat = 'no-repeat';
document.body.style.backgroundPosition = 'center';
Expand Down
2 changes: 1 addition & 1 deletion firefox/onlyHsr.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ browser.storage.local.get(['buttonColorHsr', 'buttonTextColorHsr', 'BackgroundHs
document.body.style.background = result.BackgroundColorHsr;
}
else {
document.body.style.background = 'url("/pictures/BackgroundHsr.png")';
document.body.style.background = 'url("/pictures/backgroundHSR.png")';
document.body.style.backgroundSize = 'cover';
document.body.style.backgroundRepeat = 'no-repeat';
document.body.style.backgroundPosition = 'center';
Expand Down
53 changes: 14 additions & 39 deletions firefox/options_background.js
Original file line number Diff line number Diff line change
@@ -1,45 +1,12 @@
browser.storage.onChanged.addListener(function(changes, areaName) {
if (areaName === 'local' && 'onlyGi' in changes) {
if (changes.onlyGi.newValue) {
browser.browserAction.setPopup({
popup: 'onlyGi.html'
});
} else {
browser.browserAction.setPopup({
popup: 'popup.html'
});
}
}
});

browser.storage.onChanged.addListener(function(changes, areaName) {
if (areaName === 'local' && 'onlyHsr' in changes) {
if (changes.onlyHsr.newValue) {
browser.browserAction.setPopup({
popup: 'onlyHsr.html'
});
} else {
browser.browserAction.setPopup({
popup: 'popup.html'
});
}
}
});
async function updatePopup() {
const resultGi = await browser.storage.local.get('onlyGi');
const resultHsr = await browser.storage.local.get('onlyHsr');

browser.storage.local.get('onlyGi', function(result) {
if (result.onlyGi) {
if (resultGi.onlyGi) {
browser.browserAction.setPopup({
popup: 'onlyGi.html'
});
} else {
browser.browserAction.setPopup({
popup: 'popup.html'
});
}
});

browser.storage.local.get('onlyHsr', function(result) {
if (result.onlyHsr) {
} else if (resultHsr.onlyHsr) {
browser.browserAction.setPopup({
popup: 'onlyHsr.html'
});
Expand All @@ -48,4 +15,12 @@ browser.storage.local.get('onlyHsr', function(result) {
popup: 'popup.html'
});
}
});
}

browser.storage.onChanged.addListener(async function(changes, areaName) {
if (areaName === 'local' && ('onlyGi' in changes || 'onlyHsr' in changes)) {
await updatePopup();
}
});

updatePopup();

0 comments on commit c56e676

Please sign in to comment.