mirror of
https://mirror.ghproxy.com/https://github.com/StarCitizenToolBox/StarCitizenBoxBrowserEx.git
synced 2024-12-22 19:33:43 +08:00
upgrade
This commit is contained in:
parent
1704c19331
commit
7de69b958b
@ -86,7 +86,7 @@ async function _initLocalization(url) {
|
||||
|
||||
function getLocalizationResource(localizationResource, key) {
|
||||
const localizations = [];
|
||||
const dict = localizationResource[key]?.["dict"];
|
||||
const dict = localizationResource[key];
|
||||
if (typeof dict === "object") {
|
||||
for (const [k, v] of Object.entries(dict)) {
|
||||
const trimmedKey = k
|
||||
@ -102,7 +102,7 @@ function getLocalizationResource(localizationResource, key) {
|
||||
}
|
||||
|
||||
async function _getJsonData(fileName, { cacheKey = "", version = null } = {}) {
|
||||
url = "https://ch.citizenwiki.cn/json-files/" + fileName;
|
||||
url = "https://ch.citizenwiki.cn/json-files/locales/" + fileName;
|
||||
const box = await getLocalStorage();
|
||||
if (cacheKey && cacheKey !== "") {
|
||||
const localVersion = await getLocalData(`${cacheKey}_version`);
|
||||
|
@ -1,16 +1,7 @@
|
||||
let replaceLocalesMap = { "k": "v" };
|
||||
let replaceLocalesMap = {};
|
||||
|
||||
function InitWebLocalization() {
|
||||
// init script
|
||||
let scriptTimeAgo = document.createElement('script');
|
||||
scriptTimeAgo.src = 'https://cdn.bootcdn.net/ajax/libs/timeago.js/4.0.2/timeago.full.min.js';
|
||||
document.head.appendChild(scriptTimeAgo);
|
||||
if (window.location.hostname.includes("erkul.games") || window.location.hostname.includes("ccugame.app")) {
|
||||
console.log("loading JQ");
|
||||
let scriptJquery = document.createElement('script');
|
||||
scriptJquery.src = 'https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js';
|
||||
document.head.appendChild(scriptJquery);
|
||||
}
|
||||
LocalizationWatchUpdate();
|
||||
// load Data
|
||||
_loadLocalizationData();
|
||||
|
@ -23,12 +23,23 @@
|
||||
{
|
||||
"matches": [
|
||||
"https://robertsspaceindustries.com/*",
|
||||
"https://*.robertsspaceindustries.com/*",
|
||||
"https://www.erkul.games/*",
|
||||
"https://uexcorp.space/*",
|
||||
"https://ccugame.app/*"
|
||||
],
|
||||
"js": [
|
||||
"core.js"
|
||||
"core.js",
|
||||
"thirdparty/timeago.full.min.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
"matches": [
|
||||
"https://www.erkul.games/*",
|
||||
"https://ccugame.app/*"
|
||||
],
|
||||
"js": [
|
||||
"thirdparty/jquery.min.js"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
2
StarCitizenBoxBrowserEx/thirdparty/jquery.min.js
vendored
Normal file
2
StarCitizenBoxBrowserEx/thirdparty/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
StarCitizenBoxBrowserEx/thirdparty/timeago.full.min.js
vendored
Normal file
1
StarCitizenBoxBrowserEx/thirdparty/timeago.full.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user