20260304临时补救article_list
This commit is contained in:
237
js/article.js
237
js/article.js
@@ -2,7 +2,103 @@
|
||||
var commonSupColor = 'rgb(0,112,192)'//上角标颜色
|
||||
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;
|
||||
}
|
||||
.pos_ter{
|
||||
padding:10px;
|
||||
}
|
||||
.pos_ter>div:nth-child(1) {
|
||||
width: 25%;
|
||||
}
|
||||
.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{
|
||||
|
||||
width:16px !important;
|
||||
height: 16px !important;
|
||||
}
|
||||
.pos_ter>a {
|
||||
width: 23%;
|
||||
}
|
||||
.pos_ter>div:nth-child(3) {
|
||||
width: 23%;
|
||||
}
|
||||
.pos_ter>a {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.pos_ter>a>img {
|
||||
min-width: 260px;
|
||||
margin-top: -10px;
|
||||
}
|
||||
.pos_ter>div:nth-child(3)>a:nth-child(1){
|
||||
margin-left: calc((100% - 160px - 55px - 20px)/2);
|
||||
}
|
||||
.pos_ter>div:nth-child(1)>div:nth-child(1){
|
||||
margin-left: calc((100% - 190px - 65px)/2) !important;
|
||||
}
|
||||
|
||||
.pos_ter>div:nth-child(4) {
|
||||
width: 23%; overflow:hidden;
|
||||
|
||||
}
|
||||
.pos_ter>div:nth-child(4) img{
|
||||
position: relative;
|
||||
top: -16px;
|
||||
}
|
||||
.footer .daohang ul{
|
||||
width: 26% !important;
|
||||
|
||||
}
|
||||
.footer .daohang ul:nth-child(4) {
|
||||
width: 12% !important;
|
||||
}
|
||||
.conthtmn_right_html .newHtml2 .pMain b *{
|
||||
font-weight: bold;
|
||||
}
|
||||
.MaxPicture,.table_Box {
|
||||
scroll-margin-top: 100px;
|
||||
}
|
||||
`
|
||||
|
||||
document.head.appendChild(style);
|
||||
function loadMathJax(callback) {
|
||||
const script = document.createElement('script');
|
||||
|
||||
@@ -24,11 +120,11 @@ function loadMathJax(callback) {
|
||||
loadMathJax()
|
||||
|
||||
var script = document.createElement('script');
|
||||
script.src = '/js/not_map.js';
|
||||
script.src = '/js/not_map.js';
|
||||
var script1 = document.createElement('script');
|
||||
script1.src = '/echarts-master/echarts.min.js';
|
||||
script1.src = '/echarts-master/echarts.min.js';
|
||||
var script2 = document.createElement('script');
|
||||
script2.src = '/echarts-master/world.js';
|
||||
script2.src = '/echarts-master/world.js';
|
||||
|
||||
document.head.appendChild(script1);
|
||||
document.head.appendChild(script2);
|
||||
@@ -36,7 +132,7 @@ document.head.appendChild(script);
|
||||
// 列表
|
||||
function at_list() {
|
||||
|
||||
|
||||
|
||||
function adjustNavHeight() {
|
||||
var windowHeight = window.innerHeight; // 获取页面高度
|
||||
$(".anchor-nav").css("height", windowHeight + "px"); // 设置导航栏高度为页面高度
|
||||
@@ -7076,8 +7172,8 @@ function getCitations(doi, a_ID) {
|
||||
success: function (result) {
|
||||
if (result.code == 0) {
|
||||
var str1 = `<div style="text-align:center;" class="WosNumber quoteNumber"> ${result.data.list && result.data.list.length > 0 ? result.data.list.length : 0}</div>`
|
||||
|
||||
$('.Wos .quote-content1').html(str1)
|
||||
|
||||
$('.Wos .quote-content1').html(str1)
|
||||
var journalCiteStr = ""
|
||||
var arr = result.data.list
|
||||
for (let i in arr) {
|
||||
@@ -7186,9 +7282,9 @@ function getCitations(doi, a_ID) {
|
||||
success: function (result) {
|
||||
if (result.code == 0) {
|
||||
var str1 = `<div style="text-align:center;" class="crossrefNumber quoteNumber"> ${result.data && result.data.length > 0 ? result.data.length : 0}</div>`
|
||||
|
||||
|
||||
$('.Crossref .quote-content1').html(str1)
|
||||
var arr = result.data
|
||||
var arr = result.data
|
||||
var journalCiteStr = ""
|
||||
for (let i in arr) {
|
||||
journalCiteStr += ` <div style="margin:10px 0;display:flex;"><p style="margin-right:10px;">${Number(i) + 1}.</p>
|
||||
@@ -7249,7 +7345,7 @@ function getCitations(doi, a_ID) {
|
||||
|
||||
// 文章内容
|
||||
function article_con() {
|
||||
|
||||
|
||||
|
||||
var newBox = document.querySelector('.newBox');
|
||||
var commonPopupStr = `
|
||||
@@ -7281,24 +7377,24 @@ function article_con() {
|
||||
var a_ID = getQueryString('a_id'); //文章
|
||||
var htm_ID = getQueryString('s_htm'); //目前显示html
|
||||
const isPre = getQueryString('preview');
|
||||
if(!isPre){
|
||||
initArticleNavList(a_ID)
|
||||
if (!isPre) {
|
||||
initArticleNavList(a_ID)
|
||||
}
|
||||
|
||||
|
||||
// 增加访问次数
|
||||
|
||||
if (Jour_num == 1 || Jour_num == 11 || Jour_num == 25) {
|
||||
var CiteScoreStr = ''
|
||||
var marginLeft = 20
|
||||
if (Jour_num == 1) {
|
||||
CiteScoreStr = '2.2';
|
||||
CiteScoreStr = '2.5';
|
||||
marginLeft = 10
|
||||
} else
|
||||
if (Jour_num == 11) {
|
||||
CiteScoreStr = '0.4';
|
||||
}
|
||||
else if (Jour_num == 25) {
|
||||
CiteScoreStr = '1.7';
|
||||
CiteScoreStr = '1.8';
|
||||
}
|
||||
if (Jour_num == 1) {
|
||||
// $('#top_bar .nav_ban h2 img').css('zoom','0.75')
|
||||
@@ -8672,7 +8768,7 @@ function addRowIdToData(content) {
|
||||
data[i][j].rowId = rowId;
|
||||
}
|
||||
}
|
||||
console.log('每行data数据111:', JSON.parse(JSON.stringify(data)))
|
||||
|
||||
const seenIds = [];
|
||||
|
||||
|
||||
@@ -8746,9 +8842,9 @@ function initArticleHtmlFun(arr, result, html_type) {
|
||||
|
||||
|
||||
const { header, content } = splitTable(tableList);
|
||||
console.log('content at line 8641:', content); // 打印深拷贝的内容
|
||||
// 打印深拷贝的内容
|
||||
var { rowData, rowIds } = addRowIdToData(JSON.parse(JSON.stringify(content)))
|
||||
console.log('content at line 8542:', rowIds, rowData)
|
||||
|
||||
// console.log('contentList at line 8571:', contentList)
|
||||
|
||||
contentHtml = `
|
||||
@@ -8830,8 +8926,8 @@ text-align:left;color:#333;" >${item.table.note ? item.table.note : ''
|
||||
}).join('');
|
||||
htmlContent = `<div class="newHtml2" style="margin-left:300px;">${htmlContent}</div>`
|
||||
$('.wen_rong .content-box .conthtmn').html(htmlContent);
|
||||
|
||||
|
||||
|
||||
|
||||
if (result.data.refers.length > 0) { // 如果有引用数据
|
||||
var refs = '';
|
||||
var xuhao = 0;
|
||||
@@ -8960,6 +9056,10 @@ function initArticleHtml(htmlData, refs, type) {
|
||||
$('.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');
|
||||
@@ -8987,6 +9087,7 @@ function initArticleHtml(htmlData, refs, type) {
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('.wen_rong .content-box .conthtmn b i').each(function () {
|
||||
|
||||
this.style.setProperty('font-weight', 'bold', 'important');
|
||||
@@ -9018,6 +9119,8 @@ function initArticleHtml(htmlData, refs, type) {
|
||||
htmlData.forEach((item, index) => {
|
||||
|
||||
|
||||
|
||||
|
||||
let sectionId = 'section-' + index; // 生成唯一的 ID
|
||||
|
||||
if (type == 0) {
|
||||
@@ -9036,13 +9139,14 @@ function initArticleHtml(htmlData, refs, type) {
|
||||
} else {
|
||||
// 判断是否是图片
|
||||
if (item.type == 1) {
|
||||
|
||||
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(); // 提取纯文本
|
||||
@@ -9074,7 +9178,7 @@ function initArticleHtml(htmlData, refs, type) {
|
||||
|
||||
// 使用 map 来遍历并返回 HTML 字符串
|
||||
navHtml += navLinks.image.map((link, linkIndex) => {
|
||||
return `<a href="${link.href}" data-section="${link.sectionId}">
|
||||
return `<a href="${link.href}" data-section="${link.sectionId}" nav-data-id="${link.data_id}">
|
||||
|
||||
<img src="${link.url}" style="object-fit: scale-down;width: 80px; height: 80px;border-radius:2px;border:1px solid #e0d4d4" />
|
||||
<p style="margin-bottom:0; color: #333; cursor: pointer;font-family: 'Charis SIL';">Figure${linkIndex + 1}
|
||||
@@ -9100,7 +9204,7 @@ function initArticleHtml(htmlData, refs, type) {
|
||||
console.log(link.text, '99999')
|
||||
}
|
||||
|
||||
return `<a data-section="${link.sectionId}" href="${link.href}" style="border-bottom: 1px solid rgb(255, 255, 255);
|
||||
return `<a data-section="${link.sectionId}" href="${link.href}" nav-data-id="${link.data_id}" style="border-bottom: 1px solid rgb(255, 255, 255);
|
||||
box-sizing: border-box;
|
||||
font-weight: 500 !important;
|
||||
padding: 2px 0 0 16px;
|
||||
@@ -9241,7 +9345,49 @@ function initArticleHtml(htmlData, refs, type) {
|
||||
});
|
||||
$('.wordTableHtml table tr.table-header-row td').each(function () {
|
||||
this.style.setProperty('border-bottom', '1px solid #000', 'important');
|
||||
|
||||
|
||||
});
|
||||
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 属性`);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -9275,8 +9421,7 @@ function splitTable(tableList) {
|
||||
}
|
||||
});
|
||||
//
|
||||
console.log('header:', header); // 打印头部行数据
|
||||
console.log('table打印内容行数据:', content); // 打印内容行数据
|
||||
|
||||
|
||||
return { header, content };
|
||||
}
|
||||
@@ -9361,8 +9506,8 @@ function initArticleNavList(a_ID) {
|
||||
isShowAuthorship = 1
|
||||
}
|
||||
// if (a_ID == 4477) {
|
||||
const style = document.createElement('style');
|
||||
style.innerHTML = `/* 遮罩层 */
|
||||
const style = document.createElement('style');
|
||||
style.innerHTML = `/* 遮罩层 */
|
||||
.article_dropbtn:hover {
|
||||
color: ${Journals_color};
|
||||
|
||||
@@ -9375,12 +9520,12 @@ function initArticleNavList(a_ID) {
|
||||
}
|
||||
|
||||
`;
|
||||
document.head.appendChild(style);
|
||||
|
||||
document.head.appendChild(style);
|
||||
|
||||
// 获取 id 为 top_bar 的元素
|
||||
var topBar = document.getElementById("top_bar");
|
||||
var otherStr1 = `
|
||||
|
||||
// 获取 id 为 top_bar 的元素
|
||||
var topBar = document.getElementById("top_bar");
|
||||
var otherStr1 = `
|
||||
|
||||
<p class=""><a href="/article_list.html?J_num=${Jour_num}&y_id=${journalStageID}" target="_blank">Current Issue</a></p>
|
||||
<p class="mes_all_section_other_online"><a href="/article_list.html?J_num=${Jour_num}&o_id=${Jour_num}" target="_blank">Online First</a></p>
|
||||
@@ -9390,15 +9535,15 @@ function initArticleNavList(a_ID) {
|
||||
<p><a href="/article_list.html?J_num=${Jour_num}&top_id=${Jour_num}" target="_blank">Highlights</a></p>
|
||||
|
||||
`
|
||||
var otherStr2 = `<p><a href="/tmr" target="_blank">Journal Information</a></p>
|
||||
var otherStr2 = `<p><a href="/tmr" target="_blank">Journal Information</a></p>
|
||||
|
||||
<p><a href="/for_author.html?J_num=${Jour_num}" target="_blank">Guide for Authors</a></p>
|
||||
<p><a href="javascript:;" onclick="openAbstracting(${Jour_num},'${Journals_color}')">Abstracting & Indexing</a></p>
|
||||
|
||||
|
||||
`
|
||||
// Abstracting & Indexing
|
||||
var otherStr3 = `
|
||||
// Abstracting & Indexing
|
||||
var otherStr3 = `
|
||||
<p ><a href="/afoor_text.html?footer_id=37" target="_blank">Peer-review process</a></p>
|
||||
<p><a href="${localStorage.getItem('submission_url')}" target="_blank">Submission System</a></p>
|
||||
<p><a href="/z_f11-1.html?J_num=${Jour_num}" target="_blank">Ethics and Malpractice Statement</a></p>
|
||||
@@ -9408,7 +9553,7 @@ function initArticleNavList(a_ID) {
|
||||
<p class="Authorship_text"><a href="javascript:;" onclick="openAuthorship(${Jour_num},'${Journals_color}')">Authorship</a></p>
|
||||
|
||||
`
|
||||
var str = ` <div class="article_navbar-container">
|
||||
var str = ` <div class="article_navbar-container">
|
||||
<div class="article_dropdown-menu">
|
||||
<div class="article_dropbtn">Articles & Issues <i class="fa fa-chevron-down" style="font-size: 14px;margin-left: 6px;"></i></div>
|
||||
<div class="article_dropdown-list">
|
||||
@@ -9428,13 +9573,13 @@ function initArticleNavList(a_ID) {
|
||||
</div>
|
||||
</div>
|
||||
</div>`
|
||||
// 使用 insertAdjacentHTML 在 top_bar 后插入新元素
|
||||
if(topBar){
|
||||
topBar.insertAdjacentHTML('afterend', str);
|
||||
}
|
||||
|
||||
// 使用 insertAdjacentHTML 在 top_bar 后插入新元素
|
||||
if (topBar) {
|
||||
topBar.insertAdjacentHTML('afterend', str);
|
||||
}
|
||||
|
||||
// JavaScript to handle dropdown toggle on button click
|
||||
|
||||
// JavaScript to handle dropdown toggle on button click
|
||||
|
||||
|
||||
|
||||
@@ -9482,8 +9627,8 @@ function openAuthorship(Jour_num, Journals_color) {
|
||||
function showPopup(title, content, type) {
|
||||
$('#common-popup .common-popup-title').html(title)
|
||||
$('#common-popup .common-popup-content').html(content)
|
||||
|
||||
document.getElementById('common-overlay').style.display = 'block';
|
||||
|
||||
document.getElementById('common-overlay').style.display = 'block';
|
||||
if (type == 'Authorship') {
|
||||
document.getElementById('common-popup').style.width = 'auto';
|
||||
renderMap(190)
|
||||
@@ -9491,7 +9636,7 @@ function showPopup(title, content, type) {
|
||||
|
||||
document.getElementById('common-popup').style.opacity = '1';
|
||||
document.getElementById('common-popup').style.zIndex = '101';
|
||||
|
||||
|
||||
// 5秒后自动关闭
|
||||
// setTimeout(closePopup, 5000);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user