20260304临时补救article_list

This commit is contained in:
2026-03-24 09:51:18 +08:00
parent 8da302f382
commit 9dd44cc165
34 changed files with 5827 additions and 2066 deletions

View File

@@ -3,6 +3,21 @@ var commonTableTitleColor = 'rgb(210,90,90)'//上角标颜色
var commonSupFontColor = 'color:rgb(0,112,192);'//上角标字体颜色
const style = document.createElement('style');
style.innerHTML = `
wmath[data-wrap="inline"] {
display: inline-block !important;
width: auto !important;
}
.outiline-item-h1,.outiline-item-h1 *{
font-weight: bold;
}
.wen_rong .content-box .conthtmn .Ptitle *{
font-weight: bold !important;
font-style: normal !important;
}
.Subtitle,.Subtitle *{
font-weight: bold;
}
.mb_aform{
display:none;
}
@@ -15,12 +30,22 @@ style.innerHTML = `
.htmlImageNote blue{
color :#0082AA !important;
}
.htmlImageNote blue *{
color :#0082AA !important;
}
.wenzhang .wen_jian h4 i{
font-weight: 500;
font-weight: bold;
}
mytable,mytable *,myfigure,myfigure *{
color :#0082AA !important;
cursor: pointer;
}
myh3,myh3 *{
font-weight: bold !important;
}
.v4-art-top #st-2 .st-btn > img{
@@ -61,7 +86,12 @@ margin-left: calc((100% - 190px - 65px)/2) !important;
width: 26% !important;
}
.conthtmn_right_html .newHtml2 .pMain b *{
font-weight: bold;
}
.MaxPicture,.table_Box {
scroll-margin-top: 100px;
}
`
document.head.appendChild(style);
@@ -227,7 +257,7 @@ function fetchCitationsData(doi, a_ID, callback) {
});
}
function renderCitations(citations, doi) {
let wosHtml = '';
citations.wos.forEach((item, i) => {
@@ -460,7 +490,7 @@ function article_con() {
// 将弹窗插入到页面中
newBox.insertAdjacentHTML('beforeend', commonPopupStr);
// 获取地址栏信息
function getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
@@ -522,7 +552,7 @@ function article_con() {
success: function (result) {
// initArticleNavList(a_ID)
$('.wenzhang .wen_rong .left').css({
'background-color': '#f4fafd',
@@ -536,6 +566,8 @@ function article_con() {
'background-color': '#fff'
})
if (result.code == 0) {
localStorage.setItem("Journals_usx", result.data.journalInfo.usx);
$('.nav_ban h1 a').attr('href', '/' + result.data.journalInfo.usx);
var html_type = result.data.articleInfo.html_type
var has_html = result.data.articleInfo.has_html
initMoreButtonTopList(result.data, a_ID)
@@ -820,7 +852,7 @@ function article_con() {
} else {
var picsrc = 'https://submission.tmrjournals.com/public/mainimg/' + arr[i].content;
var fun = "picPreview('" + picsrc + "');"
str += `<div class='imgHnkl' id="${sectionId}">` + "<img class='mainPicItem' style='max-width:500px;' onclick=" + fun + " src='https://submission.tmrjournals.com/public/mainimg/"
+ arr[i].content + "' width='" + arr[i].width + `"'/><p class='' style='font-size: 14px;font-family: 'Charis SIL';'>` + arr[i].note + "</p></div>"
}
@@ -881,7 +913,7 @@ function article_con() {
})
} else if (html_type == 1) {
var str = ''
if (Jour_num == 1) {
j_artc.abstract = j_artc.abstract.replace(new RegExp("0, 102, 204", "g"), "0,102,153")
@@ -913,7 +945,7 @@ function article_con() {
},
]
for (var i = 0; i < arr.length; i++) {
let sectionId = 'section-' + i; // 生成唯一的 ID
@@ -961,7 +993,7 @@ function article_con() {
}
if (j_artc.file_html == '') {
$('.wen_rong #tablist .tarfihml').css('display', 'none');
// $('.wen_rong .rong_box .contfhml').css('display','none');
@@ -969,7 +1001,7 @@ function article_con() {
$('.wen_rong #tablist .tarfihml').html('<a href="' + imgFileUrl + 'articleHTML/' + j_artc.file_html + '" target="_blank" class="txt_html">HTML</a>');
$('.wen_rong .rong_box .contfhml ul').html('<img src="img/link_2.png" width="14" height="16" style="vertical-align: middle;"><a href="' + imgFileUrl + 'articleHTML/' + j_artc.file_html + '" target="_blank" class="txt_html"><b> HTML</b></a>');
}
if (j_artc.mhoo == '' || j_artc.mhoo == null) {
$('.wen_rong #tablist .tarmho').css('display', 'none');
$('.wen_rong .content-box .contemho').css('display', 'none');
@@ -1097,13 +1129,13 @@ function article_con() {
},
error: function (jqXHR, textStatus, errorThrown) {
ShowDanger("error");
细的错误信息
细的错误信息
}
})
});
} catch (error) {
}
}
@@ -1248,7 +1280,7 @@ function shouldColor(rowIndex, cellIndex, row) {
return false;
}
function addRowIdToData(content) {
var data = JSON.parse(JSON.stringify(content))
const rowIdMap = {};
const usedRows = new Set();
@@ -1284,7 +1316,7 @@ function addRowIdToData(content) {
data[i][j].rowId = rowId;
}
}
const seenIds = [];
@@ -1411,25 +1443,20 @@ function initTopics(a_ID) {
}
function initArticleHtmlFun(arr, result, html_type, ArticleData) {
var refersContent = '';
var htmlContent = ''
htmlContent += arr.map((item, index) => {
//批注
let contentHtml = '';
let sectionId = 'section-' + index; // 生成唯一的 ID
// 判断是否是图片
if (item.type == 1) {
var picsrc = 'https://submission.tmrjournals.com/public/articleImage/' + item.image.url;
var fun = "picPreview('" + picsrc + "');"
contentHtml = `
<p contenteditable="false" main-state="${item.state}" style="display:flex;align-items: center;
justify-content: center;" class="MaxPicture pMain" data-id="${item.ami_id
}" main-id="${item.am_id}" id="${sectionId}">
<img src="${picsrc}" onclick="${fun}" style="width: ${item.width ? `${item.width}px` : '80%'
};max-width:580px;" />
<p class="font htmlImageTitle commonTableTitleColor" style="width: ${item.width ? `${item.width}px` : '100%'};
@@ -1455,9 +1482,9 @@ function initArticleHtmlFun(arr, result, html_type, ArticleData) {
const { header, content } = splitTable(tableList);
var { rowData, rowIds } = addRowIdToData(JSON.parse(JSON.stringify(content)))
contentHtml = `
<div contenteditable="false" data-id="${item.amt_id}" main-state="${item.state}" main-id="${item.am_id
@@ -1491,17 +1518,35 @@ ${header
if (!cell || !cell.cellId) return '';
const content = cell.text || '';
const isBase64Image = /^<img\s+[^>]*src=["']data:image\//i.test(content);
const finalContent = isBase64Image
? content.replace(
// 1. 判断是否是 Base64 图片 (用于点击预览逻辑)
const isBase64Image = /^<img\s+[^>]*src=["']data:image\//i.test(content);
// 2. 判断是否是服务器特定的图片路径 (用于拼接域名)
const isServerPathImage = /src=["']\/public\/articleTableImage/i.test(content);
let finalContent = content;
if (isBase64Image) {
// 处理 Base64注入点击预览 picPreview
finalContent = content.replace(
/<img\s+([^>]*?)src=["'](data:image\/[^"']+)["']([^>]*)>/gi,
(match, preAttrs, src, postAttrs) => {
const safeSrc = src.replace(/'/g, "\\'");
return `<img ${preAttrs}src="${src}"${postAttrs} style="cursor:pointer;" style="max-width:500px;" onclick="picPreview('${safeSrc}')" />`;
return `<img ${preAttrs}src="${src}"${postAttrs} style="cursor:pointer; max-width:500px;" onclick="picPreview('${safeSrc}')" />`;
}
)
: content;
);
} else if (isServerPathImage) {
// 处理特定路径:拼接域名 https://submission.tmrjournals.com
finalContent = content.replace(
/<img\s+([^>]*?)src=["'](\/public\/articleTableImage[^"']+)["']([^>]*)>/gi,
(match, preAttrs, src, postAttrs) => {
const fullUrl = `https://submission.tmrjournals.com${src}`;
// 建议这里也加上 max-width 兼容性更好
return `<img ${preAttrs}src="${fullUrl}"${postAttrs} style="max-width:500px;" onclick="picPreview('${fullUrl}')" />`;
}
);
}
return `
@@ -1525,7 +1570,11 @@ text-align:left;color:#333;" >${item.table.note ? item.table.note : ''
</div>
`;
} else {
contentHtml = `<p class="${item.is_h1 ? 'Ptitle pMain' : 'pMain'} " style="font-family: 'Charis SIL';min-height:12px;" main-state="${item.state}" contenteditable="false" data-id="${item.am_id}" main-id="${item.am_id}" id="${sectionId}">${item.content}</p>`;
contentHtml = `<p class="${[
'pMain',
item.is_h1 ? 'Ptitle' : null,
item.is_h2 ? 'Subtitle' : null
].filter(Boolean).join(' ')}" style="font-family: 'Charis SIL';min-height:12px;" main-state="${item.state}" contenteditable="false" data-id="${item.am_id}" main-id="${item.am_id}" id="${sectionId}">${item.content}</p>`;
}
@@ -1579,9 +1628,9 @@ text-align:left;color:#333;" >${item.table.note ? item.table.note : ''
initContentHtml({ html: htmlContent, refers: refersContent }, arr, result.data.refers, html_type, { ...ArticleData })
}
async function initContentHtml(content, arr, refers, html_type, ArticleData) {
var j_artc = ArticleData.data.articleInfo
var pdf_list = ''
var pdfStr = ''
if (j_artc.file_sub && j_artc.file_sub != '') {
@@ -1625,7 +1674,12 @@ async function initContentHtml(content, arr, refers, html_type, ArticleData) {
'<div>Supplementary Material for doi: ' + j_artc.doi + '<a class="download" target="_blank" href="' + apiUrl + 'public/articleSUB2/' + j_artc.file_sub2 + '"><i class="fa fa-download"></i>Download</a></div></li>';
}
if (pdf_list != '') {
if (j_artc.file_sub_table && j_artc.file_sub_table != '') {
pdf_list += '<li class="pdf_item"><div></div>' +
'<div>Supplementary Material for doi: ' + j_artc.doi + '<a class="download" target="_blank" href="' + apiUrl + 'public/articleSUBTAB/' + j_artc.file_sub_table + '"><i class="fa fa-download"></i>Download</a></div></li>';
}
if (pdf_list != '') {
pdfStr = `<div id="ArticlePdfBox" style="" class="ArticlePdfBox"><p id="ArticlePdf" class="Ptitle " style="margin-bottom:22px;"><b>Supplementary Material</b></p>${pdf_list}</div>`
}
@@ -1809,9 +1863,9 @@ async function initContentHtml(content, arr, refers, html_type, ArticleData) {
await initArticleHtml(arr, refers, html_type, { OriginalDataStr: OriginalDataStr, pdfStr: pdfStr, trackStr: trackStr, mhooStr: mhooStr })
await initRelatedArticles(ArticleData.a_ID)
await initTopics(ArticleData.a_ID)
await fetchCitationsData(j_artc.doi, ArticleData.a_ID, async function (data) {
citationCache = data; // 存好结果,稍后再使用
await renderCitations(citationCache, j_artc.doi); // 传入上一步保存的数据
});
@@ -1819,7 +1873,7 @@ async function initContentHtml(content, arr, refers, html_type, ArticleData) {
}
function initArticleHtml(htmlData, refs, type, otherList) {
document.querySelectorAll('wmath').forEach(el => {
const latex = el.getAttribute('data-latex');
if (latex) {
@@ -1880,7 +1934,7 @@ function initArticleHtml(htmlData, refs, type, otherList) {
}
if (text === 'citation') {
citationEndIndex = index;
}
});
@@ -1903,6 +1957,10 @@ function initArticleHtml(htmlData, refs, type, otherList) {
$('.wen_rong .content-box .conthtmn sup').each(function () {
var textContent = $(this).text().trim(); // 获取并清理文本内容
// 如果包含 + 或 - (离子的特征),直接跳过,不执行后面的标蓝逻辑
if (/[+\-]/.test(textContent)) {
return; // 结束当前循环,进入下一个 sup
}
// 判断文本是否是纯数字
if (/^\d+$/.test(textContent)) {
this.style.setProperty('color', commonSupColor, 'important');
@@ -1982,10 +2040,10 @@ function initArticleHtml(htmlData, refs, type, otherList) {
var picsrc = 'https://submission.tmrjournals.com/public/articleImage/' + item.image.url;
var textContentimg = $('<div>').html(item.note).text(); // 提取纯文本
navLinks.image.push({ sectionId: sectionId, type: 'image', text: textContentimg || 'Image ' + (index + 1), href: '#' + sectionId, url: picsrc });
navLinks.image.push({ sectionId: sectionId, data_id: item.ami_id, type: 'image', text: textContentimg || 'Image ' + (index + 1), href: '#' + sectionId, url: picsrc });
} else if (item.type == 2) {
var textContentTable = $('<div>').html(item.table.title).text(); // 提取纯文本
navLinks.table.push({ sectionId: sectionId, type: 'table', text: textContentTable || 'Table ' + (index + 1), href: '#' + sectionId });
navLinks.table.push({ sectionId: sectionId, data_id: item.amt_id, type: 'table', text: textContentTable || 'Table ' + (index + 1), href: '#' + sectionId });
} else {
var textContent = $('<div>').html(item.content).text(); // 提取纯文本
@@ -2001,7 +2059,7 @@ function initArticleHtml(htmlData, refs, type, otherList) {
})
}
// 引用
var navHtml = `<div class="anchor-nav outline-container is-open" > <div class="outline-toggle">
@@ -2026,7 +2084,7 @@ function initArticleHtml(htmlData, refs, type, otherList) {
navHtml += navLinks.image.map((link, linkIndex) => {
const isHidden = linkIndex >= 3 ? 'style="display:none;" class="extra-figure"' : '';
return `<a href="${link.href}" data-section="${link.sectionId}" ${isHidden}>
return `<a href="${link.href}" data-section="${link.sectionId}" nav-data-id="${link.data_id}" ${isHidden}>
<img src="${link.url}" style="object-fit: scale-down;width: 74px; height: 74px;border-radius:2px;border:1px solid #e0d4d4" />
<p style="margin-bottom:0; color: #333; cursor: pointer;font-family: 'Charis SIL';"></p>
</a>`;
@@ -2084,7 +2142,7 @@ function initArticleHtml(htmlData, refs, type, otherList) {
// }
const isHidden = linkIndex >= 1 ? 'style="display:none;" class="extra-table"' :
``
return `<a data-section="${link.sectionId}" ${isHidden} href="${link.href}" style=";
return `<a data-section="${link.sectionId}" nav-data-id="${link.data_id}" ${isHidden} href="${link.href}" style=";
box-sizing: border-box;
font-weight: 500 !important;
padding: 2px 0 0 16px !important;
@@ -2274,7 +2332,7 @@ function initArticleHtml(htmlData, refs, type, otherList) {
this.style.setProperty('border-bottom', '1px solid #000', 'important');
});
const waitForTop = setInterval(() => {
const bar = document.querySelector('.v4-art-top');
if (bar) {
@@ -2309,9 +2367,51 @@ function initArticleHtml(htmlData, refs, type, otherList) {
});
}
}, 500);
const triggerElements = document.querySelectorAll('mytable, myfigure');
triggerElements.forEach(el => {
// 1. 获取当前触发元素的 data-id (对应 nav-data-id)
const dataIndex = el.getAttribute('data-id');
if (dataIndex) {
// 2. 查找中间导航元素
const navElement = document.querySelector(`[nav-data-id="${dataIndex}"]`);
if (navElement) {
// 3. 从导航元素中提取目标 section 的 ID
const targetSectionId = navElement.getAttribute('data-section');
// 4. 绑定点击事件
el.addEventListener('click', (e) => {
e.preventDefault();
if (targetSectionId) {
// 5. 查找最终跳转的目标段落 (假设 data-section 的值就是元素的 ID)
const finalTarget = document.getElementById(targetSectionId);
if (finalTarget) {
console.log(`正在跳转至: #${targetSectionId}`);
finalTarget.scrollIntoView({
behavior: 'smooth',
block: 'start'
});
// 可选:添加临时高亮提示用户
// highlightElement(finalTarget);
} else {
console.warn(`未找到 ID 为 "${targetSectionId}" 的目标元素`);
}
} else {
console.warn(`元素 [nav-data-id="${dataIndex}"] 上未找到 data-section 属性`);
}
});
}
}
});
});
}
@@ -2343,16 +2443,16 @@ function splitTable(tableList) {
}
});
//
return { header, content };
}
// 图片预览
function picPreview(src) {
$('.PicPreview img').attr('src', src)
$('.PicPreview').show()
}
@@ -2373,8 +2473,24 @@ function showComments(num) {
/// ,btn: ['close']
, btnAlign: 'c'
, moveType: 1 //拖拽模式0或者1
, content: shenCode[num]
, content: shenCode[num],
success: function(layero, index) {
// success 会在弹窗 DOM 准备就绪后立即触发
const wmathElements = layero[0].querySelectorAll('wmath');
wmathElements.forEach(el => {
const latex = el.getAttribute('data-latex');
if (latex) {
el.innerHTML = latex;
}
});
// 批量渲染该弹窗内的公式
if (window.MathJax && MathJax.typesetPromise) {
MathJax.typesetPromise([layero[0]]).catch((err) => console.log(err));
}
}
});
}
function getCiteList(a_ID) {
$('.cite_box .export_cite').html('<div class="loader-01"></div>');
@@ -2424,8 +2540,8 @@ function getCiteList(a_ID) {
function initArticleNavList(a_ID) {
var Journals_color = localStorage.getItem('Journals_color')
var Journals_usx = localStorage.getItem('Journals_usx')
$('.nav_ban h1 a').attr('href', '/' + Journals_usx);
var journalStageID = localStorage.getItem('journalStageID')
//是否显示地图
var isShowAuthorship = 0;
@@ -2532,7 +2648,7 @@ function openPdf(url, j_artc, Jour_num) {
window.open(url);
}
function initMoreButtonTopList(articleInfo, a_ID) {
var j_artc = articleInfo.articleInfo
var Journals_color = localStorage.getItem('Journals_color')
var journalStageID = localStorage.getItem('journalStageID')
@@ -2619,7 +2735,7 @@ function openAbstracting(Jour_num, Journals_color) {
}
function openCite(Jour_num, Journals_color, a_ID, j_artc, data) {
var GoogleScholar = ''
if ((Math.round(Date.parse(new Date()) / 1000) - j_artc.ctime) / 86400 >= 21) {
GoogleScholar =
@@ -2723,7 +2839,7 @@ function openAuthorship(Jour_num, Journals_color) {
</div>
`
document.querySelector('#common-popup .common-popup-content').classList.add('whitebg');
showPopup(`<span style="font-weight:bold;color:${Journals_color}">Abstracting & Indexing</span>`, Abstractingcontent, 'Authorship')
showPopup(`<span style="font-weight:bold;color:${Journals_color}">The Past Three Years</span>`, Abstractingcontent, 'Authorship')
}