fix: 文件主题修复

This commit is contained in:
weifashi 2023-12-10 18:42:49 +08:00
parent e712b99287
commit 5760d3ef0f
17 changed files with 80 additions and 34 deletions

View File

@ -1431,6 +1431,8 @@ APP推送
状态
协助人
未变更移动项
接龙
参与接龙
发起接龙
发起接龙,参与接龙目前共(*)人

View File

@ -19171,5 +19171,27 @@
"de": "Sie haben eine neue nachricht",
"fr": "Voici les nouveaux messages",
"id": "Berikut ini untuk informasi baru"
},
{
"key": "接龙",
"zh": "",
"zh-CHT": "接龍",
"en": "Solitaire",
"ko": "다이 크",
"ja": "しりとりです",
"de": "Schnappt euch den drachen!",
"fr": "Mines",
"id": "JieLong"
},
{
"key": "参与接龙",
"zh": "",
"zh-CHT": "參與接龍",
"en": "Participate in the solitaire",
"ko": "릴레이 작업에 참여하다.",
"ja": "しりとりに参加します",
"de": "Ich übernehme die verantwortung.",
"fr": "Participez à solitaire",
"id": "Berpartisipasi dalam tangkapan"
}
]

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
if(typeof window.LANGUAGE_DATA==="undefined")window.LANGUAGE_DATA={};window.LANGUAGE_DATA["zh"]=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""]
if(typeof window.LANGUAGE_DATA==="undefined")window.LANGUAGE_DATA={};window.LANGUAGE_DATA["zh"]=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""]

View File

@ -2,7 +2,7 @@ const isElectron = !!(window && window.process && window.process.type);
const isEEUiApp = window && window.navigator && /eeui/i.test(window.navigator.userAgent);
import microappInit from "./microapp"
import {switchLanguage as $L} from "./language";
import {switchLanguage as $L, setLanguage, getLanguage} from "./language";
import './functions/common'
import './functions/eeui'
@ -91,17 +91,18 @@ if (!isElectron && !isEEUiApp) {
ViewUI.LoadingBar._load = true;
ViewUI.LoadingBar.start();
}, 300)
//
if (to.query?.theme) {
store.dispatch("setTheme", typeof to.query?.theme == 'string' ? to.query?.theme : to.query?.theme[0])
}
if (to.query?.lang) {
let lang = typeof to.query?.lang == 'string' ? to.query?.lang : to.query?.lang[0]
if (window.localStorage.getItem("__language:type__") != lang) {
window.localStorage.setItem("__language:type__", to.query?.lang);
window.location.reload();
return false;
if(lang && lang != getLanguage()){
setLanguage(lang, true)
return;
}
}
//
next();
});
router.afterEach(() => {
@ -157,6 +158,7 @@ $A.Platform = "web";
$A.isMainElectron = false;
$A.isSubElectron = false;
$A.isEEUiApp = isEEUiApp;
$A.isElectron = isElectron;
$A.openLog = false;
if (isElectron) {
$A.Electron = electron;

View File

@ -154,7 +154,6 @@ export default {
route: this.$route,
callback: (appName, isAccept) => {
if(isAccept){
console.log(1)
microAppIsAccept = true;
}
}

View File

@ -735,8 +735,9 @@
// 处理内容连接
if (/https*:\/\//.test(text)) {
const urlMatch = $.apiUrl('../').match(/^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:\/\n]+)/im);
// const theme = window.localStorage.getItem("__theme:mode__")
// const lang = window.localStorage.getItem("__language:type__")
const isMentionFile = text.indexOf('class="mention file"') !== -1 && ($A.isEEUiApp || $A.isElectron)
const theme = isMentionFile ? $A.dark.isDarkEnabled() ? 'dark' : 'light' : '';
const lang = isMentionFile ? window.localStorage.getItem("__language:type__") : ''
text = text.split(/(<[^>]*>)/g).map(string => {
if (string && !/<[^>]*>/.test(string)) {
string = string.replace(/(^|[^'"])((https*:\/\/)((\w|=|\?|\.|\/|&|-|:|\+|%|;|#|@|,|!)+))/g, "$1<a href=\"$2\" target=\"_blank\">$2</a>")
@ -745,8 +746,8 @@
const href = string.match(/href="([^"]+)"/)?.[1] || ''
if (urlMatch?.[1] && href.indexOf(urlMatch[1]) !== -1) {
const searchParams = new URLSearchParams()
// href.indexOf("theme=") === -1 && searchParams.append('theme', theme);
// href.indexOf("lang=") === -1 && searchParams.append('lang', lang);
theme && href.indexOf("theme=") === -1 && searchParams.append('theme', theme);
lang && href.indexOf("lang=") === -1 && searchParams.append('lang', lang);
const prefix = searchParams.toString() ? (href.indexOf("?") === -1 ? '?' : '&') : '';
string = string.replace(/(href="[^"]*)/g, '$1' + prefix + searchParams.toString())
}

View File

@ -30,20 +30,33 @@ function addLanguage(data) {
/**
* 设置语言
* @param language
* @param silence
*/
function setLanguage(language) {
function setLanguage(language, silence = false) {
if (language === undefined) {
return
}
$A.modalConfirm({
content: '切换语言需要刷新后生效,是否确定刷新?',
cancelText: '取消',
okText: '确定',
onOk: () => {
window.localStorage.setItem("__language:type__", language)
$A.reloadUrl()
}
})
if(silence){
window.localStorage.setItem("__language:type__", language)
$A.reloadUrl()
}else{
$A.modalConfirm({
content: '切换语言需要刷新后生效,是否确定刷新?',
cancelText: '取消',
okText: '确定',
onOk: () => {
window.localStorage.setItem("__language:type__", language)
$A.reloadUrl()
}
})
}
}
/**
* 获取最新语言
*/
function getLanguage() {
return utils.getLanguage();
}
/**
@ -111,4 +124,4 @@ function switchLanguage(text) {
return text
}
export { languageType, languageList, addLanguage, setLanguage, switchLanguage }
export { languageType, languageList, addLanguage, setLanguage, getLanguage, switchLanguage }

View File

@ -74,7 +74,7 @@ export default {
show: false,
createId: 0,
value: "#接龙 \n",
value: "#" + this.$L('接龙') + " \n",
list: [],
oldData: '',
@ -120,7 +120,7 @@ export default {
watch: {
show(val){
if(!val){
this.value = "#接龙 \n";
this.value = "#" + this.$L('接龙') + " \n";
this.list = [];
}else{
if(this.dialogDroupWordChain.type == 'create'){

View File

@ -2433,14 +2433,21 @@ export default {
value: $A.thumbRestore(event.target.currentSrc),
})
} else if (event.target.nodeName === 'A') {
let href = event.target.href;
if (event.target.classList.contains("mention") && event.target.classList.contains("file")) {
this.findOperateFile(this.operateItem.id, event.target.href)
if(this.isEEUiApp || this.$Electron){
const url = new URL(href);
const params = new URLSearchParams(url.search);
params.delete('theme'); params.delete('lang');
href = url.origin + url.pathname + (params.toString() ? ('?' + params.toString()) : '');
}
this.findOperateFile(this.operateItem.id, href)
}
this.operateCopys.push({
type: 'link',
icon: '&#xe7cb;',
label: '复制链接',
value: event.target.href,
value: href,
})
}
if (msgData.type === 'text') {