3048 lines
139 KiB
JavaScript
3048 lines
139 KiB
JavaScript
|
||
|
||
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 = `
|
||
.mb_aform{
|
||
display:none;
|
||
}
|
||
.pos_ter{
|
||
padding:10px;
|
||
}
|
||
.pos_ter>div:nth-child(1) {
|
||
width: 25%;
|
||
}
|
||
.htmlImageNote blue{
|
||
color :#0082AA !important;
|
||
}
|
||
.wenzhang .wen_jian h4 i{
|
||
|
||
font-weight: 500;
|
||
font-weight: bold;
|
||
|
||
|
||
}
|
||
.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>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;
|
||
|
||
}
|
||
|
||
`
|
||
|
||
document.head.appendChild(style);
|
||
function loadMathJax(callback) {
|
||
const script = document.createElement('script');
|
||
|
||
// 可选:配置 MathJax(必须在加载 script 前设置)
|
||
window.MathJax = {
|
||
tex: {
|
||
inlineMath: [['$', '$'], ['\\(', '\\)']],
|
||
displayMath: [['$$', '$$'], ['\\[', '\\]']]
|
||
},
|
||
startup: {
|
||
typeset: false // 不自动 typeset,手动触发更灵活
|
||
}
|
||
};
|
||
|
||
script.src = 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js';
|
||
script.onload = callback;
|
||
document.head.appendChild(script);
|
||
}
|
||
loadMathJax()
|
||
var script = document.createElement('script');
|
||
script.src = '/js/not_map.js';
|
||
var script1 = document.createElement('script');
|
||
script1.src = '/echarts-master/echarts.min.js';
|
||
var script2 = document.createElement('script');
|
||
script2.src = '/echarts-master/world.js';
|
||
|
||
document.head.appendChild(script1);
|
||
document.head.appendChild(script2);
|
||
document.head.appendChild(script);
|
||
|
||
function initStyle() {
|
||
// 找到目标元素
|
||
const navBan = document.querySelector('.nav_ban.rgb_color_background');
|
||
|
||
if (navBan) {
|
||
// 创建一个新的 inner-wrapper div
|
||
const innerWrapper = document.createElement('div');
|
||
innerWrapper.className = 'inner_nav_ban_wrapper';
|
||
|
||
// 把 navBan 中所有子节点移动到 innerWrapper 中
|
||
while (navBan.firstChild) {
|
||
innerWrapper.appendChild(navBan.firstChild);
|
||
}
|
||
|
||
// 再把 innerWrapper 加回 navBan 中
|
||
navBan.appendChild(innerWrapper);
|
||
}
|
||
|
||
|
||
}
|
||
// 列表
|
||
function at_list() {
|
||
|
||
|
||
function adjustNavHeight() {
|
||
var windowHeight = window.innerHeight; // 获取页面高度
|
||
$(".anchor-nav").css("height", windowHeight + "px"); // 设置导航栏高度为页面高度
|
||
}
|
||
|
||
// 页面加载时调整导航栏高度
|
||
adjustNavHeight();
|
||
|
||
// 窗口大小变化时调整导航栏高度
|
||
$(window).resize(function () {
|
||
adjustNavHeight(); // 重新调整导航栏高度
|
||
});
|
||
|
||
// 获取地址栏信息
|
||
function getQueryString(name) {
|
||
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
||
var r = window.location.search.substr(1).match(reg);
|
||
if (r != null) return unescape(r[2]);
|
||
return null;
|
||
}
|
||
}
|
||
|
||
let citationCache = null; // 你可以存在全局变量、Vue data 或其他位置
|
||
|
||
|
||
// 时间戳格式化
|
||
|
||
function timestampToTime(str) {
|
||
//str = str * 1000
|
||
var oDate = new Date(str * 1000),
|
||
oYear = oDate.getFullYear(),
|
||
oMonth = oDate.getMonth() + 1,
|
||
oDay = oDate.getDate(),
|
||
oHour = oDate.getHours(),
|
||
oMin = oDate.getMinutes(),
|
||
oSen = oDate.getSeconds(),
|
||
oTime = oYear + '-' + getzf(oMonth) + '-' + getzf(oDay) + ' ' + getzf(oHour) + ':' +
|
||
getzf(oMin) + ':' + getzf(oSen);//最后拼接时间
|
||
return oTime;
|
||
};
|
||
//补0操作
|
||
function getzf(num) {
|
||
if (parseInt(num) < 10) {
|
||
num = '0' + num;
|
||
}
|
||
return num;
|
||
}
|
||
function fetchCitationsData(doi, a_ID, callback) {
|
||
// doi = '10.53388/TMR20200222165'
|
||
// a_ID = 471
|
||
let citations = {
|
||
wos: [],
|
||
dimensions: 0,
|
||
scite: 0,
|
||
crossref: []
|
||
};
|
||
|
||
let list = [doi];
|
||
let completedRequests = 0;
|
||
|
||
function checkAllDone() {
|
||
completedRequests++;
|
||
if (completedRequests === 4) {
|
||
callback(citations); // 当所有数据加载完成后触发回调
|
||
}
|
||
}
|
||
|
||
// WOS 数据
|
||
$.post(apiUrl + 'api/Article/getArticleCites', { article_id: a_ID }, function (res) {
|
||
citations.wos = res.code === 0 ? res.data.list : [];
|
||
checkAllDone();
|
||
});
|
||
|
||
// Dimensions
|
||
$.get('https://metrics-api.dimensions.ai/doi/' + doi, function (res) {
|
||
citations.dimensions = res.times_cited || 0;
|
||
checkAllDone();
|
||
}).fail(function () {
|
||
citations.dimensions = 0;
|
||
checkAllDone();
|
||
});
|
||
|
||
// Scite
|
||
$.ajax({
|
||
type: 'post',
|
||
url: 'https://api.scite.ai/tallies',
|
||
contentType: "application/json",
|
||
dataType: "json",
|
||
data: JSON.stringify(list),
|
||
success: function (res) {
|
||
for (let key in res.tallies) {
|
||
citations.scite = res.tallies[key]?.citingPublications || 0;
|
||
}
|
||
checkAllDone();
|
||
},
|
||
error: function () {
|
||
citations.scite = 0;
|
||
checkAllDone();
|
||
}
|
||
});
|
||
|
||
// CrossRef
|
||
$.post(apiUrl + 'api/Article/getArticleDetailCites', { article_id: a_ID }, function (res) {
|
||
citations.crossref = res.code === 0 ? res.data : [];
|
||
checkAllDone();
|
||
});
|
||
}
|
||
function renderCitations(citations, doi) {
|
||
console.log('doi at line 479:', citations)
|
||
|
||
|
||
|
||
let wosHtml = '';
|
||
citations.wos.forEach((item, i) => {
|
||
wosHtml += `
|
||
<div style="margin:10px 0;display:flex;">
|
||
<p style="margin-right:10px;">${i + 1}.</p>
|
||
<div>
|
||
<p style="font-size:13px;margin-bottom:3px;">${item.article_name}</p>
|
||
<p>
|
||
<span style="color:#a2b1b6;font-size:13px;">
|
||
${item.journal_name}, ${item.author || ''}, ${item.vol || ''}
|
||
</span>
|
||
<span style="margin-left:5px;color:#205493;">
|
||
<a href="https://doi.org/${item.doi}" target="_blank">https://doi.org/${item.doi}</a>
|
||
</span>
|
||
</p>
|
||
</div>
|
||
</div>`;
|
||
});
|
||
|
||
let crossrefHtml = '';
|
||
if (citations.crossref && citations.crossref.length > 0) {
|
||
citations.crossref.forEach((item, i) => {
|
||
crossrefHtml += `
|
||
<div style="margin:10px 0;display:flex;">
|
||
<p style="margin-right:10px;">${i + 1}.</p>
|
||
<div>
|
||
<p style="font-size:13px;margin-bottom:3px;">${item.article_title}</p>
|
||
<p>
|
||
<span style="color:#a2b1b6;font-size:13px;">
|
||
${item.journal_title}, ${item.year}
|
||
</span>
|
||
<span style="margin-left:5px;color:#205493;">
|
||
<a href="https://doi.org/${item.doi}" target="_blank">https://doi.org/${item.doi}</a>
|
||
</span>
|
||
</p>
|
||
</div>
|
||
</div>`;
|
||
});
|
||
}
|
||
|
||
{/* <div class="core-xlink-crossref"><a href="javascript:void(0)" target="_blank" style="color:#006699;font-size:16px;margin-right:30px;"><span class="title">Wos</span> <span>${citations.wos.length}</span></a></div>
|
||
<div class="core-xlink-crossref"><a href="https://badge.dimensions.ai/details/doi/${doi}" target="_blank" style="color:#006699;font-size:16px;margin-right:30px;"><span class="title">Dimensions Badge</span> <span>${citations.dimensions}</span><i style="margin-left:6px;" class="fa fa-external-link" aria-hidden="true" /></i></a></div>
|
||
<div class="core-xlink-crossref"><a href="https://scite.ai/reports/${doi}" target="_blank" style="color:#006699;font-size:16px;margin-right:30px;"><span class="title">Scite Badge (Wiley)</span> <span>${citations.scite}</span><i class="fa fa-external-link" aria-hidden="true" style="margin-left:6px;" /></i></a></div>
|
||
<div class="core-xlink-crossref"><a href="javascript:void(0)" target="_blank" style="color:#006699;font-size:16px;margin-right:30px;"><span class="title">Crossref</span> <span>${citations.crossref.length}</span></a></div>
|
||
*/}
|
||
const str = `
|
||
<p id="ArticleCitationsBox" class="Ptitle" style="margin-bottom: 22px;
|
||
background: rgb(222, 235, 247);
|
||
color: rgb(210, 90, 90) !important;
|
||
text-align: center !important;
|
||
border: 1px solid rgba(222, 234, 247, 0.1);
|
||
border-radius: 10px;
|
||
font-size: 16px;
|
||
box-shadow: rgba(222, 234, 247, 0.6) 0px 4px 4px;">
|
||
<b style="font-weight: bold !important;">Article Citations</b>
|
||
</p>
|
||
|
||
|
||
<div>
|
||
<ul style="overflow: hidden;padding: 10px 0;border: none;display: flex
|
||
;
|
||
align-items: center;
|
||
justify-content: space-between;">
|
||
<li class="article-quote-box Wos">
|
||
<p class="quote-source">Wos</p>
|
||
<div class="quote-content quote-content1">
|
||
<div class="quoteNumber WosNumber" style="text-align:center;">${citations.wos.length}</div>
|
||
</div>
|
||
</li>
|
||
<li class="article-quote-box DimensionsBadge">
|
||
<a href="https://badge.dimensions.ai/details/doi/${doi}" target="_blank">
|
||
<p class="quote-source">Dimensions Badge</p>
|
||
<div class="quote-content">
|
||
<div class="quoteNumber" style="text-align:center;">${citations.dimensions}</div>
|
||
</div>
|
||
</a>
|
||
</li>
|
||
<li class="article-quote-box SciteBadge">
|
||
<a href="https://scite.ai/reports/${doi}" target="_blank">
|
||
<p class="quote-source">Scite Badge (Wiley)</p>
|
||
<div class="quote-content quote-content1">
|
||
<div class="quoteNumber" style="text-align:center;">${citations.scite}</div>
|
||
</div>
|
||
</a>
|
||
</li>
|
||
<li class="article-quote-box Crossref" style="margin-right: 0;">
|
||
<p class="quote-source">Crossref</p>
|
||
<div class="quote-content quote-content1">
|
||
<div class="quoteNumber crossrefNumber" style="text-align:center;">${citations.crossref && citations.crossref.length > 0 ? citations.crossref.length : 0}</div>
|
||
</div>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
<div id="framed_div" class="in-tab" style="margin-top: 10px; background-color: #fff;">
|
||
<div class="info-box"></div>
|
||
<div style="padding: 10px;" class="quote-content"></div>
|
||
</div>
|
||
|
||
|
||
`;
|
||
|
||
|
||
|
||
|
||
|
||
$('.article-quote').css('display', 'block'); // 设置显示样式
|
||
$('#ArticleCitations').css('display', 'block'); // 设置显示样式
|
||
$('.article-quote').html(str); // 设置 HTML 内容
|
||
|
||
}
|
||
|
||
/* 相关引用次数 */
|
||
// function getCitations(doi, a_ID) {
|
||
|
||
|
||
// // var doi = '10.53388/IMD202408001';
|
||
// $('.article-quote-box').css({
|
||
// width: '25%',
|
||
// 'margin-right': '0px',
|
||
// 'border-right': '1px solid ' + localStorage.Journals_color,
|
||
// })
|
||
// $('.DimensionsBadge .quote-source').html('Dimensions Badge')
|
||
// $('.SciteBadge .quote-source').html('Scite Badge (Wiley)')
|
||
// $('.Crossref .quote-source').html('Crossref')
|
||
// $('.Crossref').css({ 'border-right': 'none' })
|
||
// $('.Wos .quote-source').html('Wos')
|
||
// var list = [doi];
|
||
// $.ajax({
|
||
// type: 'post', url: apiUrl + 'api/Article/getArticleCites',
|
||
// data: {
|
||
// "article_id": 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>`
|
||
// var journalCiteStr = ""
|
||
// $('.Wos .quote-content1').html(str1)
|
||
// var arr = result.data.list
|
||
// for (let i in arr) {
|
||
// journalCiteStr += ` <div style="margin:10px 0;display:flex;"><p style="margin-right:10px;">${Number(i) + 1}.</p>
|
||
// <div>
|
||
// <p style="display: block;
|
||
// font-size: 13px;
|
||
// margin-bottom: 3px;">${arr[i].article_name}</p>
|
||
|
||
// <p>
|
||
// <span style="color: #a2b1b6;
|
||
// font-size: 13px;"> ${arr[i].journal_name},
|
||
// <span style="color: #a2b1b6;
|
||
// font-size: 13px;">${arr[i].author ? `${arr[i].author},` : ''} ${arr[i].journal_name}${arr[i].vol ? `${arr[i].vol},` : ''}
|
||
// </span></span>
|
||
|
||
// <span style="margin-left:5px;color:#205493;">
|
||
// <a
|
||
// target="_blank"
|
||
// href="https://doi.org/${arr[i].doi}">https://doi.org/${arr[i].doi}</a> </span></p></div>
|
||
|
||
// </div>`
|
||
// }
|
||
|
||
// if (result.data.list && result.data.list.length > 0) {
|
||
// $('.WosNumber').click(function () {
|
||
// var infoStr = `Citations registered in Wos`
|
||
// $('#framed_div .info-box').html(infoStr);
|
||
// $('#framed_div .quote-content').html(journalCiteStr);
|
||
// $('#framed_div').addClass('isWos');
|
||
|
||
// if ($('#framed_div').hasClass('openCrossref')) {
|
||
|
||
// if ($('#framed_div').hasClass('isCrossref')) {
|
||
|
||
// $('#framed_div').removeClass('isCrossref');
|
||
// $('#framed_div').removeClass('openCrossref');
|
||
// setTimeout(() => {
|
||
// $('#framed_div').addClass('openCrossref');
|
||
// }, 100)
|
||
|
||
// } else {
|
||
// $('#framed_div').removeClass('openCrossref');
|
||
// $('#framed_div').removeClass('isWos');
|
||
// }
|
||
|
||
// } else {
|
||
// $('#framed_div').addClass('isWos');
|
||
// $('#framed_div').addClass('openCrossref');
|
||
// }
|
||
|
||
|
||
// })
|
||
// }
|
||
|
||
|
||
// }
|
||
// }
|
||
// })
|
||
// //Dimensions Badge
|
||
// $.ajax({
|
||
// type: 'get',
|
||
// url: 'https://metrics-api.dimensions.ai/doi/' + doi,//正式环境
|
||
// success: function (result) {
|
||
// console.log('result at line 212:', result)
|
||
// // var str = `<span class="__dimensions_badge_embed__" data-doi="${doi}" data-legend="always"></span>`
|
||
// $('.DimensionsBadge a').attr('href', 'https://badge.dimensions.ai/details/doi/' + doi)
|
||
// var str = `<div style="text-align:center;" class="quoteNumber"> ${result.times_cited}</div>`
|
||
// $('.DimensionsBadge .quote-content').html(str)
|
||
// },
|
||
// error: function (result) {
|
||
// console.log('result at line 212:', result)
|
||
// // var str = `<span class="__dimensions_badge_embed__" data-doi="${doi}" data-legend="always"></span>`
|
||
|
||
// var str = `<div style="text-align:center;" class="quoteNumber"> 0</div>`
|
||
// $('.DimensionsBadge .quote-content').html(str)
|
||
// }
|
||
// })
|
||
// //Scite Badge (Wiley)
|
||
// $.ajax({
|
||
// type: 'post',
|
||
// url: 'https://api.scite.ai/tallies',//正式环境
|
||
// contentType: "application/json",
|
||
// dataType: "json",
|
||
// data: JSON.stringify(list),
|
||
// success: function (result) {
|
||
// console.log('result at line 212:', result)
|
||
// for (let i in result.tallies) {
|
||
// $('.SciteBadge a').attr('href', 'https://scite.ai/reports/' + i)
|
||
// var str1 = ` <div style="text-align:center;" class="crossrefNumber quoteNumber"> ${result.tallies[i]['citingPublications']}</div>`
|
||
// }
|
||
// $('.SciteBadge .quote-content1').html(str1)
|
||
// },
|
||
// error: function (result) {
|
||
// console.log('result at line 212:', result)
|
||
// var str1 = ` <div style="text-align:center;" class="crossrefNumber quoteNumber"> 0</div>`
|
||
|
||
// $('.SciteBadge .quote-content1').html(str1)
|
||
// }
|
||
// })
|
||
// $.ajax({
|
||
// type: 'post', url: apiUrl + 'api/Article/getArticleDetailCites',
|
||
// data: {
|
||
// "article_id": 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>`
|
||
// var journalCiteStr = ""
|
||
// $('.Crossref .quote-content1').html(str1)
|
||
// var arr = result.data
|
||
// for (let i in arr) {
|
||
// journalCiteStr += ` <div style="margin:10px 0;display:flex;"><p style="margin-right:10px;">${Number(i) + 1}.</p>
|
||
// <div>
|
||
// <p style="display: block;
|
||
// font-size: 13px;
|
||
// margin-bottom: 3px;">${arr[i].article_title}</p>
|
||
|
||
// <p>
|
||
// <span style="color: #a2b1b6;
|
||
// font-size: 13px;"> ${arr[i].journal_title},
|
||
// <span style="margin-left:5px">
|
||
// ${arr[i].year}</span></span>
|
||
|
||
// <span style="margin-left:5px;color:#205493;">
|
||
// <a
|
||
// target="_blank"
|
||
// href="https://doi.org/${arr[i].doi}">https://doi.org/${arr[i].doi}</a> </span></p></div>
|
||
|
||
// </div>`
|
||
// }
|
||
|
||
// if (result.data && result.data.length > 0) {
|
||
|
||
// $('.crossrefNumber').click(function () {
|
||
// var infoStr = `Citations registered in CrossRef`
|
||
// $('#framed_div .info-box').html(infoStr);
|
||
// $('#framed_div .quote-content').html(journalCiteStr); $('#framed_div').addClass('isCrossref');
|
||
// if ($('#framed_div').hasClass('openCrossref')) {
|
||
|
||
// if ($('#framed_div').hasClass('isWos')) {
|
||
|
||
// $('#framed_div').removeClass('isWos');
|
||
// $('#framed_div').removeClass('openCrossref');
|
||
// $('#framed_div').addClass('isCrossref');
|
||
// setTimeout(() => {
|
||
// $('#framed_div').addClass('openCrossref');
|
||
// }, 100)
|
||
// } else {
|
||
// $('#framed_div').removeClass('openCrossref');
|
||
// $('#framed_div').removeClass('isCrossref');
|
||
// }
|
||
|
||
// } else {
|
||
// $('#framed_div').addClass('isCrossref');
|
||
// $('#framed_div').addClass('openCrossref');
|
||
// }
|
||
// })
|
||
// }
|
||
|
||
|
||
// }
|
||
// }
|
||
// })
|
||
|
||
|
||
// }
|
||
|
||
|
||
// 文章内容
|
||
function article_con() {
|
||
$('.wen_jian .left .toggle-btn').html('Author Information ▼')
|
||
|
||
var newBox = document.querySelector('.newBox');
|
||
var commonPopupStr = `
|
||
<div id="common-overlay"></div>
|
||
<div id="common-popup">
|
||
<span class="common-close-btn" onclick="closePopup()">×</span>
|
||
<div style="padding: 30px 30px 20px 30px" class="common-popup-box">
|
||
<h2 class="common-popup-title"></h2>
|
||
<div class="common-popup-content">
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
`;
|
||
|
||
// 将弹窗插入到页面中
|
||
newBox.insertAdjacentHTML('beforeend', commonPopupStr);
|
||
|
||
console.log('js at line 7241:', '是否走了详情js')
|
||
console.log('详情js', localStorage.Journals_title);
|
||
// 获取地址栏信息
|
||
function getQueryString(name) {
|
||
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
||
var r = window.location.search.substr(1).match(reg);
|
||
if (r != null) return unescape(r[2]);
|
||
return null;
|
||
}
|
||
|
||
var a_ID = getQueryString('a_id'); //文章
|
||
var htm_ID = getQueryString('s_htm'); //目前显示html
|
||
const isPre = getQueryString('preview');
|
||
|
||
if (!isPre) {
|
||
initArticleNavList(a_ID)
|
||
}
|
||
|
||
// 增加访问次数
|
||
|
||
|
||
if (isPre) {
|
||
$('#top_bar .top').css('display', 'none')
|
||
|
||
$('.wen_rong .content-box .conthtmn').html(`
|
||
<div class="" style="display: flex;align-items: center;justify-content: center;">接收到来自父页面的数据:
|
||
<div class="loader-01" style="display: flex;align-items: center;justify-content: space-around;"></div></div>`
|
||
);
|
||
$.ajax({
|
||
type: 'post', url: apiUrl + 'api/Article/getHtmlByPAID',
|
||
data: {
|
||
"p_article_id": a_ID
|
||
},
|
||
success: function (res) {
|
||
if (res.code == 0) {
|
||
var arr = res.data.list;
|
||
initArticleHtmlFun(arr, res, 2)
|
||
|
||
|
||
}
|
||
},
|
||
error: function () {
|
||
// ShowDanger("error!");
|
||
}
|
||
|
||
})
|
||
|
||
} else {
|
||
this.initStyle()
|
||
|
||
try {
|
||
console.log('开始详情接口请求')
|
||
$(document).ready(function () {
|
||
|
||
|
||
$.ajax({
|
||
type: 'post', url: apiUrl + 'api/Article/getArticleDetail',
|
||
data: {
|
||
"article_id": a_ID
|
||
},
|
||
timeout: 30000, // 设置超时时间为5秒
|
||
|
||
|
||
success: function (result) {
|
||
// initArticleNavList(a_ID)
|
||
console.log('result at line 7575:', result)
|
||
|
||
|
||
|
||
$('.wenzhang .wen_rong .left').css({
|
||
'background-color': '#f4fafd',
|
||
|
||
})
|
||
$('.wenzhang .wen_rong .left .rong_box').css({
|
||
'background-color': '#fff',
|
||
'margin-top': '0px'
|
||
})
|
||
$('.wenzhang .wen_rong .left .mb_aform').css({
|
||
'background-color': '#fff'
|
||
})
|
||
if (result.code == 0) {
|
||
|
||
|
||
var html_type = result.data.articleInfo.html_type
|
||
var has_html = result.data.articleInfo.has_html
|
||
initMoreButtonTopList(result.data, a_ID)
|
||
|
||
|
||
// 文章Cite this article
|
||
var j_artc = result.data.articleInfo
|
||
if (Jour_num != 13) {
|
||
//获取文章引用
|
||
|
||
|
||
// 点击增加数字
|
||
$('.txt_html').click(function () {
|
||
var num = $(this).next().html();
|
||
$.ajax({
|
||
type: 'post', url: apiUrl + 'yuan/Article/addArticleNum', async: false,
|
||
data: { "article_id": a_ID, "type": 'html' },
|
||
success: function (result) {
|
||
}
|
||
})
|
||
$.ajax({
|
||
type: 'post', url: apiUrl + 'super/Publish/addVisitNum',
|
||
data: { 'type': Jour_num, 'is_detail': '1' },
|
||
success: function (result) {
|
||
}
|
||
});
|
||
$(this).next().html(num);
|
||
})
|
||
|
||
} else {
|
||
$('.article-quote').css('display', 'none');
|
||
$('.mb_aform').css('display', 'none');
|
||
$('.pos_ter').css('display', 'none');
|
||
$('.footer').css('display', 'none');
|
||
$('.wen_rong .right').css('display', 'none');
|
||
$('.wenzhang .wen_rong .left').css('width', '100%');
|
||
}
|
||
|
||
|
||
// 文章路径基本信息
|
||
var j_our = result.data.journalInfo;
|
||
var j_info = result.data.stageInfo;
|
||
// $('.wen_jian .left>span a').html(j_our.title);
|
||
// $('.wen_jian .left>span a').attr('href', '/' + j_our.usx);
|
||
localStorage.setItem("Journals_num", j_our.journal_id);
|
||
if (j_artc.doi == '') {
|
||
var doi_ = ''
|
||
} else {
|
||
var doi_ = 'DOI : <a href="https://doi.org/' + j_artc.doi + '" target="_blank">' + 'https://doi.org/' + j_artc.doi + '</a>'
|
||
}
|
||
if (j_info.stage_no == '0') {
|
||
var stage_ = ''
|
||
} else {
|
||
var stage_ = 'Issue (' + j_info.stage_no + '): '
|
||
}
|
||
if (j_artc.npp == '' || j_artc.npp == ' ') {
|
||
var npp_ = ''
|
||
} else {
|
||
if (j_info.stage_pagename == 'pp.') {
|
||
var npp_ = j_artc.npp + ' '
|
||
} else {
|
||
var npp_ = j_info.stage_pagename + j_artc.npp + ' '
|
||
}
|
||
}
|
||
|
||
if (localStorage.Journals_title == '经典中医研究') {
|
||
if (j_info.stage_vol == '1') {
|
||
j_info.stage_vol = '一'
|
||
}
|
||
if (j_info.stage_vol == '2') {
|
||
j_info.stage_vol = '二'
|
||
}
|
||
if (j_info.stage_vol == '3') {
|
||
j_info.stage_vol = '三'
|
||
}
|
||
if (j_info.stage_vol == '4') {
|
||
j_info.stage_vol = '四'
|
||
}
|
||
if (j_info.stage_vol == '5') {
|
||
j_info.stage_vol = '五'
|
||
}
|
||
if (j_info.stage_vol == '6') {
|
||
j_info.stage_vol = '六'
|
||
}
|
||
var our_time = '' + j_info.stage_year + '年第' + j_info.stage_vol + '卷 | 第' + j_info.stage_no + '期:' + npp_ + doi_;
|
||
} else {
|
||
var our_time = '' + j_info.stage_year + ', Vol. ' + j_info.stage_vol + ' | ' + stage_ + npp_ + doi_;
|
||
}
|
||
|
||
$('.wen_jian .left>span').append(our_time);
|
||
|
||
if (j_artc.other_state == 0) {
|
||
var otStat = ''
|
||
} else if (j_artc.other_state == 1) {
|
||
var otStat = '<span class="otStat">Editorial Expression of Concern</span>'
|
||
} else if (j_artc.other_state == 2) {
|
||
var otStat = '<span class="otStat">Retracted</span>'
|
||
}
|
||
|
||
$('.wen_jian .left>h4').html(otStat + j_artc.title);
|
||
|
||
|
||
// 文章基本作者机构
|
||
var str = '';
|
||
var j_authior = result.data.author.authors;
|
||
var stra = '';
|
||
var Corr_Auth = '';
|
||
var Corr_Emai = '';
|
||
var rep = '';
|
||
var rep_pd = '';
|
||
var ORC_ID = '';
|
||
var report_num = 0;
|
||
|
||
for (var i = 0; i < j_authior.length; i++) {
|
||
rep = '';
|
||
var mes = '';
|
||
if (j_authior[i].is_first == '1') {
|
||
rep = '#'
|
||
rep_pd += '#'
|
||
}
|
||
if (j_authior[i].is_report == '1') {
|
||
rep += '*'
|
||
mes = ' (<a href="mailto:' + j_authior[i].email + '."><img src="img/email.png"></a>) '
|
||
Corr_Auth += ' ' + j_authior[i].author_name + ',';
|
||
Corr_Emai += ' ' + j_authior[i].email + ',';
|
||
report_num += 1;
|
||
}
|
||
if (j_authior[i].orcid == '') {
|
||
ORC_ID = ''
|
||
} else {
|
||
ORC_ID = '<a href="https://orcid.org/' + j_authior[i].orcid + '" target="_blank"><img src="img/or_id.png" alt="" style="width: 15px;margin-left: 3px;"></a>'
|
||
}
|
||
if (i == j_authior.length - 1) {
|
||
stra += j_authior[i].author_name + '<sup>' + j_authior[i].ors + rep + '</sup>' + ORC_ID + mes
|
||
} else {
|
||
stra += j_authior[i].author_name + '<sup>' + j_authior[i].ors + rep + '</sup>' + ORC_ID + mes + ', '
|
||
}
|
||
}
|
||
|
||
str += `<div style="font-size:16px;" class="zuo_zhe_name">${stra}</div>`;
|
||
|
||
var j_organ = result.data.author.organs;
|
||
var strg = '<div class="zuo_zhe_info">';
|
||
for (var i = 0; i < j_organ.length; i++) {
|
||
strg += '<sup>' + j_organ[i].alias + '</sup> ' + j_organ[i].organ_name + '<br/>'
|
||
}
|
||
str += strg + "</div>";
|
||
|
||
$('.wen_jian .left>div.zuo_zhe').html(str);
|
||
$('.wen_jian .left>div.zuo_zhe>sup').css({
|
||
color: commonSupColor,
|
||
});
|
||
document.querySelector('.toggle-btn').addEventListener('click', function () {
|
||
const detail = document.querySelector('.zuo_zhe_info');
|
||
const btn = this;
|
||
const isShown = detail.classList.toggle('show');
|
||
|
||
btn.innerText = isShown
|
||
? 'Affiliations & Notes ▲'
|
||
: 'Affiliations & Notes ▼';
|
||
});
|
||
if (rep_pd == "#") {
|
||
$('.wen_jian .left>div').each(function () {
|
||
$(this).html($(this).html().split("#").join(""));
|
||
});
|
||
}
|
||
|
||
if (report_num != 1) {
|
||
$('.coau b').html('Corresponding authors:');
|
||
}
|
||
|
||
if (Jour_num == 1) {
|
||
j_artc.abstract = j_artc.abstract.replace(new RegExp("0, 102, 204", "g"), "0,102,153")
|
||
}
|
||
|
||
// 文章内容
|
||
Corr_Auth = Corr_Auth.replace(/,$/, "")
|
||
Corr_Emai = Corr_Emai.replace(/,$/, "")
|
||
|
||
$('.wen_rong .content-box .contercon .abst').html(j_artc.abstract);
|
||
let strongElements = document.querySelectorAll('.wen_rong .content-box .contercon .abst strong');
|
||
|
||
// 遍历每个 <strong> 标签
|
||
strongElements.forEach(function (element) {
|
||
// 检查 <strong> 标签内的文本内容是否为 "Background:", "Methods:", "Results:", "Conclusion:"
|
||
|
||
if (element.textContent.includes("Background:") ||
|
||
element.textContent.includes("Methods:") ||
|
||
element.textContent.includes("Method:") ||
|
||
element.textContent.includes("Results:") ||
|
||
element.textContent.includes("Result:") ||
|
||
element.textContent.includes("Conclusion:") ||
|
||
element.textContent.includes("Conclusions:") ||
|
||
element.textContent.includes("Background") ||
|
||
element.textContent.includes("Methods") ||
|
||
element.textContent.includes("Method") ||
|
||
element.textContent.includes("Results") ||
|
||
element.textContent.includes("Result") ||
|
||
element.textContent.includes("Conclusion") ||
|
||
element.textContent.includes("Conclusions")
|
||
|
||
|
||
|
||
) {
|
||
// 修改该 <strong> 标签的样式,改变颜色
|
||
element.style.color = commonSupColor; // 设置颜色为黑色(你可以修改为其他颜色)
|
||
}
|
||
});
|
||
$('.wen_rong .content-box .contercon .keyw span').html(j_artc.keywords);
|
||
$('.wen_rong .content-box .contercon .fund span').html(j_artc.fund);
|
||
$('.wen_rong .content-box .contercon .coau span').html(Corr_Auth);
|
||
$('.wen_rong .content-box .contercon .emai span').html(Corr_Emai);
|
||
$('.wen_rong .content-box .contercon .cite span').html(result.data.cite);
|
||
$('.wen_rong .content-box .contercon .time span').html(j_artc.pub_date);
|
||
$('.wen_rong .content-box .contercon .url span').html('<a target="_blank" href="https://doi.org/' + j_artc.doi + '">https://doi.org/' + j_artc.doi + '</a>');
|
||
|
||
if (j_artc.ordoi == '') {
|
||
$('.wen_rong .content-box .contercon .udr').css('display', 'none')
|
||
} else {
|
||
$('.wen_rong .content-box .contercon .udr span').html('<a target="_blank" href="https://doi.org/' + j_artc.ordoi + '">https://doi.org/' + j_artc.ordoi + '</a>');
|
||
}
|
||
|
||
if (j_artc.abstract == '') {
|
||
$('.wen_rong .content-box .contercon .abst').css('display', 'none')
|
||
}
|
||
if (j_artc.keywords == '') {
|
||
$('.wen_rong .content-box .contercon .keyw').css('display', 'none')
|
||
}
|
||
if (j_artc.fund == '') {
|
||
$('.wen_rong .content-box .contercon .fund').css('display', 'none')
|
||
}
|
||
if (Corr_Auth == '') {
|
||
$('.wen_rong .content-box .contercon .coau').css('display', 'none')
|
||
}
|
||
if (Corr_Emai == '') {
|
||
$('.wen_rong .content-box .contercon .emai').css('display', 'none')
|
||
}
|
||
if (j_artc.pub_date == '') {
|
||
$('.wen_rong .content-box .contercon .time').css('display', 'none')
|
||
}
|
||
if (result.data.cite == '') {
|
||
$('.wen_rong .content-box .contercon .cite').css('display', 'none')
|
||
}
|
||
|
||
|
||
$('.wen_rong .content-box .contemho').html(j_artc.mhoo);
|
||
|
||
// 新的HTML
|
||
|
||
if (html_type == 0) {
|
||
// 原 HTML
|
||
$('.wen_rong .content-box .conthtmn').html(`
|
||
<div class="" style="display: flex;align-items: center;justify-content: center;">
|
||
<div class="loader-01" style="display: flex;align-items: center;justify-content: space-around;"></div></div>`
|
||
);
|
||
$.ajax({
|
||
type: 'post', url: apiUrl + 'api/Article/getArticleDetailHtml',
|
||
data: {
|
||
"article_id": a_ID
|
||
},
|
||
success: function (htmlResult) {
|
||
if (htmlResult.code == 0) {
|
||
|
||
var arr = htmlResult.data.mains;
|
||
var str = '';
|
||
for (var i = 0; i < arr.length; i++) {
|
||
let sectionId = 'section-' + i; // 生成唯一的 ID
|
||
if (arr[i].width == 0) {
|
||
if (arr[i].is_title == 1) {
|
||
if (arr[i].content.indexOf("<p>") >= 0) {
|
||
str += `<div class="Ptitle pMain" id="${sectionId}">${arr[i].content}</div>`
|
||
} else {
|
||
str += `<div class="Ptitle pMain" id="${sectionId}"><p>${arr[i].content}</p></div>`
|
||
}
|
||
} else {
|
||
if (arr[i].content.indexOf("<p>") >= 0) {
|
||
str += arr[i].content.replace("<p>", `<p id="${sectionId}" class="pMain">`);
|
||
} else {
|
||
str += `<p id="${sectionId}" class="pMain">${arr[i].content}</p>`
|
||
}
|
||
}
|
||
} else {
|
||
var picsrc = 'https://submission.tmrjournals.com/public/mainimg/' + arr[i].content;
|
||
var fun = "picPreview('" + picsrc + "');"
|
||
// console.log(fun)
|
||
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>"
|
||
}
|
||
}
|
||
// str = `<div style="margin-left:300px;">${str}</div>`
|
||
// $('.wen_rong .content-box .conthtmn').html(str);
|
||
|
||
|
||
var refersContent = ''
|
||
// 引用
|
||
if (htmlResult.data.refers.length > 0) { // 如果有引用数据
|
||
var refs = '';
|
||
var xuhao = 0;
|
||
for (var rr = 0; rr < htmlResult.data.refers.length; rr++) {
|
||
// 如果格式不正确,或者信息不全
|
||
let item = '';
|
||
if (htmlResult.data.refers[rr].refer_type == 'journal' && htmlResult.data.refers[rr].doilink != '') {
|
||
// journal 类型
|
||
xuhao++;
|
||
item = "<div><p>" + xuhao + '. ' + htmlResult.data.refers[rr].author + ' ' + htmlResult.data.refers[rr].title + ". <i>" + htmlResult.data.refers[rr].joura + ". </i>" + htmlResult.data.refers[rr].dateno + ".";
|
||
// 在 "Available at:" 之前插入 <br/> 标签
|
||
item += "<br/><a class='refsLink' href='" + htmlResult.data.refers[rr].doilink + "' target='_blank' style='color:#006699; word-wrap:break-word;'>Available at: " + htmlResult.data.refers[rr].doilink + "</a></p></div>";
|
||
refs += item;
|
||
} else if (htmlResult.data.refers[rr].refer_type == 'book' && htmlResult.data.refers[rr].isbn != '') {
|
||
// book 类型
|
||
xuhao++;
|
||
item = "<div><p>" + xuhao + '. ' + htmlResult.data.refers[rr].author + ' ' + htmlResult.data.refers[rr].title + ". " + htmlResult.data.refers[rr].dateno + ".";
|
||
// 在 "Available at:" 之前插入 <br/> 标签
|
||
item += "<br/><a target='_blank' style='color:#006699; word-wrap:break-word;' href='" + htmlResult.data.refers[rr].isbn + "'>ISBN: " + htmlResult.data.refers[rr].isbn + "</a></p></div>";
|
||
refs += item;
|
||
} else if (htmlResult.data.refers[rr].refer_type == 'other' && htmlResult.data.refers[rr].refer_frag != '' && htmlResult.data.refers[rr].refer_frag.length > 15) {
|
||
// other 类型,检查 refer_frag 中是否有 "Available at:"
|
||
xuhao++;
|
||
item = "<div><p data-other='1'>" + xuhao + '. ';
|
||
// 如果 refer_frag 包含 "Available at:",在其前面插入 <br/> 标签
|
||
if (htmlResult.data.refers[rr].refer_frag.indexOf('Available at:') !== -1) {
|
||
item += htmlResult.data.refers[rr].refer_frag.replace('Available at:', '<br/>Available at:');
|
||
} else {
|
||
item += htmlResult.data.refers[rr].refer_frag;
|
||
}
|
||
item += ". </p></div>";
|
||
refs += item;
|
||
} else {
|
||
continue;
|
||
}
|
||
}
|
||
// 将生成的所有引用内容插入到页面中
|
||
refersContent = '<div id="ArticleRef" style="" class="ArticleRef"><p id="References" class="Ptitle "><b>References</b></p>' + refs + '</div>';
|
||
}
|
||
initContentHtml({ html: str, refers: refersContent }, arr, htmlResult.data.refers, html_type, { ...result, a_ID: a_ID })
|
||
|
||
// initArticleHtml(arr, result.data.refers, html_type)
|
||
}
|
||
},
|
||
error: function () {
|
||
// ShowDanger("error!");
|
||
}
|
||
|
||
})
|
||
} else if (html_type == 1) {
|
||
// //外链
|
||
// $('.wen_rong #tablist .tarhtmn').css('display', 'none');
|
||
// $('.wen_rong .content-box .conthtmn').css('display', 'none');
|
||
var str = ''
|
||
if (Jour_num == 1) {
|
||
j_artc.abstract = j_artc.abstract.replace(new RegExp("0, 102, 204", "g"), "0,102,153")
|
||
}
|
||
var arr = [
|
||
{
|
||
|
||
|
||
|
||
|
||
content: "<i><b>Abstract</b></i>",
|
||
|
||
is_title: 0,
|
||
},
|
||
{
|
||
|
||
|
||
|
||
content: j_artc.abstract,
|
||
|
||
is_title: 0,
|
||
},
|
||
{
|
||
|
||
|
||
|
||
content: '<b> </b>',
|
||
|
||
is_title: 0,
|
||
},
|
||
{
|
||
|
||
|
||
|
||
content: `<b>Keywords:</b><b> </b>${j_artc.keywords}`,
|
||
|
||
is_title: 0,
|
||
},
|
||
|
||
]
|
||
// $('.wen_rong .content-box .contercon .abst').html(j_artc.abstract);
|
||
// let strongElements = document.querySelectorAll('.wen_rong .content-box .contercon .abst strong');
|
||
|
||
// // 遍历每个 <strong> 标签
|
||
// strongElements.forEach(function (element) {
|
||
// // 检查 <strong> 标签内的文本内容是否为 "Background:", "Methods:", "Results:", "Conclusion:"
|
||
|
||
// if (element.textContent.includes("Background:") ||
|
||
// element.textContent.includes("Methods:") ||
|
||
// element.textContent.includes("Method:") ||
|
||
// element.textContent.includes("Results:") ||
|
||
// element.textContent.includes("Result:") ||
|
||
// element.textContent.includes("Conclusion:") ||
|
||
// element.textContent.includes("Conclusions:") ||
|
||
// element.textContent.includes("Background") ||
|
||
// element.textContent.includes("Methods") ||
|
||
// element.textContent.includes("Method") ||
|
||
// element.textContent.includes("Results") ||
|
||
// element.textContent.includes("Result") ||
|
||
// element.textContent.includes("Conclusion") ||
|
||
// element.textContent.includes("Conclusions")
|
||
|
||
|
||
|
||
// ) {
|
||
// // 修改该 <strong> 标签的样式,改变颜色
|
||
// element.style.color = commonSupColor; // 设置颜色为黑色(你可以修改为其他颜色)
|
||
// }
|
||
// });
|
||
for (var i = 0; i < arr.length; i++) {
|
||
let sectionId = 'section-' + i; // 生成唯一的 ID
|
||
|
||
if (arr[i].is_title == 1) {
|
||
if (arr[i].content.indexOf("<p>") >= 0) {
|
||
str += `<div class="Ptitle pMain" id="${sectionId}">${arr[i].content}</div>`
|
||
} else {
|
||
str += `<div class="Ptitle pMain" id="${sectionId}"><p>${arr[i].content}</p></div>`
|
||
}
|
||
} else {
|
||
if (arr[i].content.indexOf("<p>") >= 0) {
|
||
str += arr[i].content.replace("<p>", `<p id="${sectionId}" class="pMain">`);
|
||
} else {
|
||
str += `<p id="${sectionId}" class="pMain">${arr[i].content}</p>`
|
||
}
|
||
}
|
||
|
||
}
|
||
initContentHtml({ html: str, refers: '' }, arr, [], html_type, { ...result, a_ID: a_ID })
|
||
|
||
} else if (html_type == 2) {
|
||
// 新 HTML
|
||
$('.wen_rong .content-box .conthtmn').html(`
|
||
<div class="" style="display: flex;align-items: center;justify-content: center;">
|
||
<div class="loader-01" style="display: flex;align-items: center;justify-content: space-around;"></div></div>`
|
||
);
|
||
$.ajax({
|
||
type: 'post', url: apiUrl + 'api/Article/getArticleDetailHtmlFor2',
|
||
data: {
|
||
"article_id": a_ID
|
||
},
|
||
success: function (htmlResult) {
|
||
if (htmlResult.code == 0) {
|
||
|
||
var arr = htmlResult.data.mains;
|
||
initArticleHtmlFun(arr, htmlResult, html_type, { ...result, a_ID: a_ID })
|
||
|
||
}
|
||
},
|
||
error: function () {
|
||
// ShowDanger("error!");
|
||
}
|
||
|
||
})
|
||
}
|
||
|
||
|
||
// 稿件跟踪
|
||
// 图标------------
|
||
|
||
// console.log(j_artc)
|
||
// Original data 附加文件
|
||
|
||
|
||
// if (j_artc.file_pdf == '') {
|
||
// $('.wen_rong #tablist .tarfipdf').css('display', 'none');
|
||
// // $('.wen_rong .rong_box .contfdf').css('display','none');
|
||
// } else {
|
||
// $('.wen_rong #tablist .tarfipdf').html('<a href="' + imgFileUrl + 'articlePDF/' + j_artc.file_pdf + '" target="_blank" class="txt_html">PDF</a>');
|
||
// // $('.wen_rong .rong_box .contfdf ul').html('<img src="img/link_3.jpg" width="14" height="16" style="vertical-align: middle;"><a href="'+imgFileUrl+'articlePDF/'+j_artc.file_pdf+'" target="_blank" class="txt_html"><b> PDF</b></a>');
|
||
// }
|
||
if (j_artc.file_html == '') {
|
||
$('.wen_rong #tablist .tarfihml').css('display', 'none');
|
||
// $('.wen_rong .rong_box .contfhml').css('display','none');
|
||
} else {
|
||
$('.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.tradition_tag == '' || j_artc.tradition == '') {
|
||
// $('.wen_rong #tablist .tarad').css('display', 'none');
|
||
// $('.wen_rong .content-box .conterad').css('display', 'none');
|
||
//}
|
||
if (j_artc.mhoo == '' || j_artc.mhoo == null) {
|
||
$('.wen_rong #tablist .tarmho').css('display', 'none');
|
||
$('.wen_rong .content-box .contemho').css('display', 'none');
|
||
}
|
||
|
||
// $('#tablist .tarfipdf a').click(function () {
|
||
// $.ajax({
|
||
// type: 'post', url: apiUrl + 'yuan/Article/addArticleNum', async: false,
|
||
// data: { "article_id": j_artc.article_id, "type": 'pdf' },
|
||
// success: function (result) {
|
||
// }
|
||
// })
|
||
// $.ajax({
|
||
// type: 'post', url: apiUrl + 'super/Publish/addVisitNum',
|
||
// data: { 'type': Jour_num, 'is_detail': '1' },
|
||
// success: function (result) {
|
||
// }
|
||
// });
|
||
// })
|
||
|
||
|
||
|
||
// 首先显示html
|
||
if (htm_ID != null) {
|
||
$("#tablist li.tarhtmn").click()
|
||
}
|
||
|
||
// meta添加
|
||
// j_artc = result.data.articleInfo
|
||
// j_authior = result.data.author.authors;
|
||
// j_our = result.data.journalInfo;
|
||
// j_info = result.data.stageInfo;
|
||
|
||
|
||
$('title').before('<meta name="citation_title" content="' + j_artc.old_title + '">' +
|
||
'<meta name="citation_publication_date" content="' + j_artc.publication + '">' +
|
||
'<meta name="citation_journal_title" content="' + j_our.title + '">' +
|
||
'<meta name="citation_volume" content="' + j_info.stage_vol + '">' +
|
||
'<meta name="citation_issue" content="' + j_info.stage_no + '">' +
|
||
'<meta name="citation_pdf_url" content="' + 'https://www.tmrjournals.com' + imgFileUrl + 'articlePDF/' + j_artc.file_pdf + '">')
|
||
for (var i = 0; i < j_authior.length; i++) {
|
||
$('title').before('<meta name="citation_author" content="' + j_authior[i].author_name + '">')
|
||
}
|
||
if (j_artc.first_page != undefined) {
|
||
$('title').before('<meta name="citation_firstpage" content="' + j_artc.first_page + '">')
|
||
}
|
||
if (j_artc.last_page != undefined) {
|
||
$('title').before('<meta name="citation_lastpage" content="' + j_artc.last_page + '">')
|
||
}
|
||
|
||
|
||
// 右侧引入插件
|
||
// if(result.data.journalInfo.title=='Food Therapy and Health Care'){
|
||
// document.getElementsByTagName('script')[1].setAttribute("data-trendmdconfig","{'website_id':'79603', 'element':'#trendmd-suggestions'}")
|
||
// }
|
||
// if(result.data.journalInfo.title=='Medical Theory and Hypothesis'){
|
||
// document.getElementsByTagName('script')[1].setAttribute("data-trendmdconfig","{'website_id':'79601', 'element':'#trendmd-suggestions'}")
|
||
// }
|
||
// if(result.data.journalInfo.title=='TMR Non-Drug Therapy'){
|
||
// document.getElementsByTagName('script')[1].setAttribute("data-trendmdconfig","{'website_id':'79600', 'element':'#trendmd-suggestions'}")
|
||
// }
|
||
// if(result.data.journalInfo.title=='TMR Modern Herbal Medicine'){
|
||
// document.getElementsByTagName('script')[1].setAttribute("data-trendmdconfig","{'website_id':'79599', 'element':'#trendmd-suggestions'}")
|
||
// }
|
||
// if(result.data.journalInfo.title=='Nursing Communications'){
|
||
// document.getElementsByTagName('script')[1].setAttribute("data-trendmdconfig","{'website_id':'79598', 'element':'#trendmd-suggestions'}")
|
||
// }
|
||
// if(result.data.journalInfo.title=='Integrative Medicine Discovery'){
|
||
// document.getElementsByTagName('script')[1].setAttribute("data-trendmdconfig","{'website_id':'79597', 'element':'#trendmd-suggestions'}")
|
||
// }
|
||
// if(result.data.journalInfo.title=='Clinical Research Communications'){
|
||
// document.getElementsByTagName('script')[1].setAttribute("data-trendmdconfig","{'website_id':'79596', 'element':'#trendmd-suggestions'}")
|
||
// }
|
||
// if(result.data.journalInfo.title=='Psychosomatic Medicine Research'){
|
||
// document.getElementsByTagName('script')[1].setAttribute("data-trendmdconfig","{'website_id':'79595', 'element':'#trendmd-suggestions'}")
|
||
// }
|
||
// if(result.data.journalInfo.title=='Life Research'){
|
||
// document.getElementsByTagName('script')[1].setAttribute("data-trendmdconfig","{'website_id':'79594', 'element':'#trendmd-suggestions'}")
|
||
// }
|
||
// if(result.data.journalInfo.title=='Gastroenterology & Hepatology Research'){
|
||
// document.getElementsByTagName('script')[1].setAttribute("data-trendmdconfig","{'website_id':'79593', 'element':'#trendmd-suggestions'}")
|
||
// }
|
||
// if(result.data.journalInfo.title=='Medical Data Mining'){
|
||
// document.getElementsByTagName('script')[1].setAttribute("data-trendmdconfig","{'website_id':'79592', 'element':'#trendmd-suggestions'}")
|
||
// }
|
||
// if(result.data.journalInfo.title=='Toxicology Communications'){
|
||
// document.getElementsByTagName('script')[1].setAttribute("data-trendmdconfig","{'website_id':'79591', 'element':'#trendmd-suggestions'}")
|
||
// }
|
||
// if(result.data.journalInfo.title=='Tumor Microenvironment Research'){
|
||
// document.getElementsByTagName('script')[1].setAttribute("data-trendmdconfig","{'website_id':'79590', 'element':'#trendmd-suggestions'}")
|
||
// }
|
||
// if(result.data.journalInfo.title=='History and Philosophy of Medicine'){
|
||
// document.getElementsByTagName('script')[1].setAttribute("data-trendmdconfig","{'website_id':'79589', 'element':'#trendmd-suggestions'}")
|
||
// }
|
||
// if(result.data.journalInfo.title=='Precision Medicine Research'){
|
||
// document.getElementsByTagName('script')[1].setAttribute("data-trendmdconfig","{'website_id':'79588', 'element':'#trendmd-suggestions'}")
|
||
// }
|
||
// if(result.data.journalInfo.title=='Drug Combination Therapy'){
|
||
// document.getElementsByTagName('script')[1].setAttribute("data-trendmdconfig","{'website_id':'79587', 'element':'#trendmd-suggestions'}")
|
||
// }
|
||
// if(result.data.journalInfo.title=='tmRxiv'){
|
||
// document.getElementsByTagName('script')[1].setAttribute("data-trendmdconfig","{'website_id':'79586', 'element':'#trendmd-suggestions'}")
|
||
// }
|
||
// if(result.data.journalInfo.title=='Infectious Diseases Research'){
|
||
// document.getElementsByTagName('script')[1].setAttribute("data-trendmdconfig","{'website_id':'79585', 'element':'#trendmd-suggestions'}")
|
||
// }
|
||
// if(result.data.journalInfo.title=='Aging Communications'){
|
||
// document.getElementsByTagName('script')[1].setAttribute("data-trendmdconfig","{'website_id':'79584', 'element':'#trendmd-suggestions'}")
|
||
// }
|
||
// if(result.data.journalInfo.title=='Cancer Advances'){
|
||
// document.getElementsByTagName('script')[1].setAttribute("data-trendmdconfig","{'website_id':'79583', 'element':'#trendmd-suggestions'}")
|
||
// }
|
||
// if(result.data.journalInfo.title=='Traditional Medicine Research'){
|
||
// document.getElementsByTagName('script')[1].setAttribute("data-trendmdconfig","{'journal_id':'79582', 'element':'#trendmd-suggestions'}")
|
||
// }
|
||
|
||
if (Jour_num != '1') {
|
||
$('.wen_rong .right .tmr_doaj').css('display', 'none')
|
||
} else {
|
||
$('.wen_rong .right .tmr_doaj').css('display', 'none')
|
||
}
|
||
|
||
if (Jour_num == '22') {
|
||
$('.wen_jian .right h5').html('引用:');
|
||
$('.wen_jian .right .export .Exc_2').html('<i class="fa fa-download"></i> 下载EndNote格式');
|
||
$('.wen_jian .right .export .Exc_3').html('<i class="fa fa-download"></i> 下载RIS格式');
|
||
$('.wen_jian .right .export .Exc_4').html('<i class="fa fa-download"></i> 下载BibTex格式');
|
||
$('.wen_jian .right .export .Exc_5').html('<i class="fa fa-download"></i> 下载text格式');
|
||
$('.wenzhang .wen_rong .right>p').html('本作品根据“知识共享”国际许可协议4.0进行授权。');
|
||
$('.keyw b').html('关键字:')
|
||
$('.fund b').html('基金项目:')
|
||
$('.coau b').html('通讯作者:')
|
||
$('.emai b').html('邮箱:')
|
||
$('.cite b').html('引用:')
|
||
$('.time b').html('出版时间:')
|
||
$('.url b').html('链接:')
|
||
$('#tablist li').html('')
|
||
$('#tablist .tabin').html('摘要')
|
||
$('.links_').css('font-size', '20px')
|
||
$('.links_ img').css({ 'width': '20px', 'height': '22px' })
|
||
$('.right p').css('font-family', 'Times New Roman')
|
||
$('.cite span').css('font-family', 'Times New Roman')
|
||
}
|
||
|
||
|
||
} else {
|
||
ShowDanger("请求失败!");
|
||
}
|
||
},
|
||
error: function (jqXHR, textStatus, errorThrown) {
|
||
ShowDanger("error!");
|
||
console.log('文章详情error!')
|
||
console.log('AJAX error:', jqXHR, textStatus, errorThrown); // 输出详细的错误信息
|
||
}
|
||
|
||
})
|
||
});
|
||
} catch (error) {
|
||
console.error('JavaScript error:', error);
|
||
}
|
||
|
||
}
|
||
$.ajax({
|
||
type: 'post', url: apiUrl + 'super/Publish/addVisitNum',
|
||
data: { 'type': Jour_num, 'is_detail': '1' },
|
||
success: function (result) {
|
||
if (result.code == 0) {
|
||
|
||
} else {
|
||
// ShowDanger("请求失败!");
|
||
}
|
||
},
|
||
error: function () {
|
||
// ShowDanger("error!");
|
||
}
|
||
});
|
||
$.ajax({
|
||
type: 'post', url: apiUrl + 'yuan/Article/addArticleNum', async: false,
|
||
data: { "article_id": a_ID, "type": 'abs' },
|
||
success: function (result) {
|
||
}
|
||
})
|
||
|
||
|
||
|
||
|
||
// 期刊内搜索
|
||
$('.sfor_btnw').click(function () {
|
||
// console.log($('select[name="cut"] option:selected').val());
|
||
window.open("jour_search.html?J_num=" + Jour_num + "&se_ch=" + $(".sfor_inpw").val());
|
||
})
|
||
// 期刊内订阅
|
||
$('.top .jour_ts input.tishi_author').css('background-color', localStorage.Journals_color);
|
||
$.ajax({
|
||
type: 'post', url: apiUrl + 'api/Journal/getTopicForSubscribe',
|
||
data: {
|
||
"journal_id": Jour_num
|
||
},
|
||
success: function (result) {
|
||
if (result.code == 0) {
|
||
var arr = result.data.topics;
|
||
var data_4 = [];
|
||
for (var i = 0; i < arr.length; i++) {
|
||
data_4.push({
|
||
id: arr[i].journal_topic_id,
|
||
text: arr[i].title
|
||
});
|
||
}
|
||
$("#combox4").combox({
|
||
id: "id",
|
||
name: "text",
|
||
data: data_4,
|
||
valueChange: function (data) {
|
||
// debugger
|
||
//返回data,filterData,selectData
|
||
}
|
||
})
|
||
var cb4 = $("#combox4").data('combox');
|
||
|
||
|
||
// 订阅提交
|
||
$(".yue_addm").click(function () {
|
||
$(".spa").text('');
|
||
|
||
var add_mess = {};
|
||
add_mess.email = $('#emaplm').val();
|
||
add_mess.topic_ids = [];
|
||
var ar_mes = cb4.options.selectData
|
||
for (var i = 0; i < ar_mes.length; i++) {
|
||
add_mess.topic_ids.push(ar_mes[i]['id']);
|
||
}
|
||
|
||
var S_Dan = '0';
|
||
var reg = /^[-.-_A-Za-z0-9]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/
|
||
if (cb4.options.selectData == "") {
|
||
$(".spa111").text('Please choose topic');
|
||
S_Dan = '1';
|
||
} else if ($("#emaplm").val() == "") {
|
||
$(".spa111").text('Please fill in E-mail');
|
||
S_Dan = '1';
|
||
} else if (!(reg.test($("#emaplm").val()))) {
|
||
$(".spa111").text('Please fill in properly formatted E-mail');
|
||
S_Dan = '1';
|
||
}
|
||
|
||
|
||
if (S_Dan == '1') {
|
||
ShowDanger("Incomplete information!");
|
||
} else {
|
||
$(".yue_addm").addClass("disable");
|
||
$.ajax({
|
||
type: 'post', url: apiUrl + 'api/Journal/addSubscribeTopics',
|
||
data: add_mess,
|
||
success: function (result) {
|
||
if (result.code == 0) {
|
||
$(".mb_aform input[type='text']").val('');
|
||
$(".yue_addm").removeClass("disable");
|
||
$(".jour_ts").fadeIn();
|
||
|
||
$(".jour_ts input.tishi_author").click(function () {
|
||
$(".jour_ts").fadeOut();
|
||
});
|
||
|
||
} else {
|
||
ShowDanger(result.msg);
|
||
$(".yue_addm").removeClass("disable");
|
||
}
|
||
},
|
||
error: function () {
|
||
ShowDanger("error!");
|
||
$(".yue_addm").removeClass("disable");
|
||
}
|
||
})
|
||
}
|
||
})
|
||
|
||
} else {
|
||
ShowDanger("请求失败!");
|
||
}
|
||
},
|
||
error: function () {
|
||
ShowDanger("error!");
|
||
}
|
||
});
|
||
|
||
|
||
// 相关文章
|
||
|
||
}
|
||
|
||
function shouldColor(rowIndex, cellIndex, row) {
|
||
// 判断是否是最左侧的单元格
|
||
if (cellIndex === 0 && row[0].rowspan) {
|
||
const rowspan = row[0].rowspan; // 获取最左侧单元格的 `rowspan`
|
||
const startRow = rowIndex; // 当前单元格所在的行
|
||
const endRow = startRow + rowspan - 1; // 跨越的最后一行
|
||
|
||
// 判断当前行是否在 `rowspan` 范围内,并且是奇数行
|
||
return rowIndex >= startRow && rowIndex <= endRow && (rowIndex + 1) % 2 !== 0; // 判断是否为奇数行
|
||
}
|
||
return false;
|
||
}
|
||
function addRowIdToData(content) {
|
||
console.log('每行data数据1', content)
|
||
var data = JSON.parse(JSON.stringify(content))
|
||
const rowIdMap = {};
|
||
const usedRows = new Set();
|
||
let idCounter = 0;
|
||
|
||
for (let i = 0; i < data.length; i++) {
|
||
if (usedRows.has(i)) continue;
|
||
|
||
const rowId = `row-${idCounter++}`;
|
||
rowIdMap[i] = rowId;
|
||
usedRows.add(i);
|
||
|
||
const row = data[i];
|
||
for (let j = 0; j < row.length; j++) {
|
||
const cell = row[j];
|
||
if (cell?.rowspan && cell.rowspan > 1) {
|
||
for (let k = 1; k < cell.rowspan; k++) {
|
||
const nextRowIndex = i + k;
|
||
if (nextRowIndex < data.length && !rowIdMap[nextRowIndex]) {
|
||
rowIdMap[nextRowIndex] = rowId;
|
||
usedRows.add(nextRowIndex);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
// 把 rowId 实际写进每个单元格
|
||
for (let i = 0; i < data.length; i++) {
|
||
const rowId = rowIdMap[i];
|
||
for (let j = 0; j < data[i].length; j++) {
|
||
if (!data[i][j]) data[i][j] = {};
|
||
data[i][j].rowId = rowId;
|
||
}
|
||
}
|
||
console.log('每行data数据111:', JSON.parse(JSON.stringify(data)))
|
||
const seenIds = [];
|
||
|
||
|
||
data.map((row, rowIndex) => {
|
||
// row= row.filter(cell => cell.cellId)
|
||
|
||
row.map((cell, cellIndex) => {
|
||
if (cell.rowId) {
|
||
row.rowId = cell.rowId
|
||
}
|
||
})
|
||
})
|
||
data.forEach(row => {
|
||
if (row.rowId && !seenIds.includes(row.rowId)) {
|
||
seenIds.push(row.rowId); // Mark this rowId as seen
|
||
}
|
||
});
|
||
const rowIds = seenIds.filter((_, index) => index % 2 === 0);
|
||
const rowData = data
|
||
return { rowData, rowIds }
|
||
|
||
}
|
||
|
||
function initRelatedArticles(a_ID,) {
|
||
$.ajax({
|
||
type: 'post',
|
||
url: apiUrl + 'api/Article/getArticleByKeywords',
|
||
data: { article_id: a_ID },
|
||
success: function (result) {
|
||
if (result.code === 0) {
|
||
var relatedarticlesStr = ''
|
||
//Related articles
|
||
if (result.data && result.data.length > 0) {
|
||
arr = result.data
|
||
relatedarticlesStr += `<div id="ArticleCorrLateBox" style="" class="ArticleCorrLateBox">
|
||
<p id="ArticleCorrLate" class="Ptitle " style="margin-bottom: 22px;
|
||
background: rgb(222, 235, 247);
|
||
color: rgb(210, 90, 90) !important;
|
||
text-align: center !important;
|
||
border: 1px solid rgba(222, 234, 247, 0.1);
|
||
border-radius: 10px;
|
||
font-size: 16px;
|
||
box-shadow: rgba(222, 234, 247, 0.6) 0px 4px 4px;"><b style="font-weight: bold !important;">Related Articles</b></p><ul>`;
|
||
|
||
// 使用 map 来遍历并返回 HTML 字符串
|
||
relatedarticlesStr += arr.map((item, linkIndex) => {
|
||
return `<li>
|
||
<a style="color:#006699;" href="article.html?J_num=${item.journal_id}&a_id=${item.article_id}" target="_blank"><b style="color:#006699;">${linkIndex + 1}. </b>${item.title}</a>
|
||
<p style="color:#333;">${item.abbr}, ${item.journal.title}, ${item.stage.stage_year}</p></li>`;
|
||
}).join(''); // 使用 join 来拼接所有的 HTML 字符串
|
||
|
||
relatedarticlesStr += `</ul></div>`;
|
||
$('.corr_late').css('display', 'block'); // 设置显示样式
|
||
$('#ArticleCorrLateNav').css('display', 'block'); // 设置显示样式
|
||
$('.corr_late').html(relatedarticlesStr); // 设置 HTML 内容
|
||
|
||
}
|
||
|
||
//Related articles
|
||
}
|
||
},
|
||
error: function () {
|
||
|
||
}
|
||
});
|
||
}
|
||
function initTopics(a_ID) {
|
||
|
||
// 右侧话题
|
||
$.ajax({
|
||
type: 'post', url: apiUrl + 'api/Article/getTopicsForArticle',
|
||
data: {
|
||
"article_id": a_ID
|
||
},
|
||
success: function (result) {
|
||
if (result.code == 0) {
|
||
var arr = result.data.topics;
|
||
|
||
var TopicsStr = ''
|
||
|
||
if (result.data && arr.length > 0) {
|
||
|
||
TopicsStr += `<div id="ArticleTopicsBox" style="" class="ArticleTopicsBox">
|
||
<p class="Ptitle " style="margin-bottom: 32px;
|
||
background: rgb(222, 235, 247);
|
||
color: rgb(210, 90, 90) !important;
|
||
text-align: center !important;
|
||
border: 1px solid rgba(222, 234, 247, 0.1);
|
||
border-radius: 10px;
|
||
font-size: 16px;
|
||
box-shadow: rgba(222, 234, 247, 0.6) 0px 4px 4px;"><b style="font-weight: bold !important;">Topics</b></p>
|
||
<ul class="pos_topic" style="display: flex
|
||
;
|
||
align-items: center;
|
||
flex-wrap: wrap;">`;
|
||
|
||
// 使用 map 来遍历并返回 HTML 字符串
|
||
TopicsStr += arr.map((item, linkIndex) => {
|
||
return `<li style="margin-right:5px;margin-left:5px;margin-bottom:15px;"><a target="_blank" href="topic_list.html?J_num=${Jour_num}&t_id=${item.journal_topic_id}">
|
||
<img src="${imgtopicUrl + item.icon}" style="border: 1px solid #e0d4d4;width:210px;height:130px"/></a>
|
||
<h6 style="text-align: center;line-height: 18px;
|
||
|
||
margin-top: 10px"><a target="_blank" href="topic_list.html?J_num=${Jour_num}&t_id=${item.journal_topic_id}">
|
||
${item.title}</a></h6></li>`;
|
||
}).join(''); // 使用 join 来拼接所有的 HTML 字符串
|
||
|
||
TopicsStr += `</ul></div>`;
|
||
$('.contnet_Topics').css('display', 'block'); // 设置显示样式
|
||
$('#ArticleTopics').css('display', 'block'); // 设置显示样式
|
||
$('.contnet_Topics').html(TopicsStr); // 设置 HTML 内容
|
||
|
||
}
|
||
|
||
|
||
|
||
} else {
|
||
ShowDanger("请求失败!");
|
||
}
|
||
},
|
||
error: function () {
|
||
ShowDanger("error!");
|
||
}
|
||
});
|
||
|
||
|
||
}
|
||
|
||
|
||
|
||
function initArticleHtmlFun(arr, result, html_type, ArticleData) {
|
||
|
||
console.log('ArticleData at line 1519:', 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%'};
|
||
|
||
font-size: 14px;
|
||
font-family: 'Charis SIL';
|
||
font-weight:normal;
|
||
line-height: 22px;
|
||
text-align:center;" >${item.image.title ? item.image.title : ''
|
||
}</p>
|
||
<p class="font htmlImageNote" style="width: ${item.width ? `${item.width}px` : '100%'};
|
||
|
||
font-size: 14px;
|
||
font-family: 'Charis SIL';
|
||
font-weight:normal;
|
||
line-height: 22px;
|
||
text-align:center;" >${item.image.note ? item.image.note : ''
|
||
}</p>
|
||
</p>
|
||
`;
|
||
} else if (item.type == 2) {
|
||
var tableList = JSON.parse(item.table.table_data);
|
||
|
||
|
||
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 = `
|
||
<div contenteditable="false" data-id="${item.amt_id}" main-state="${item.state}" main-id="${item.am_id
|
||
}" class="thumbnailTableBox wordTableHtml table_Box pMain" style="width: 100%; padding: 8px 15px; box-sizing: border-box; border-radius: 4px; position: relative;" id="${sectionId}">
|
||
|
||
<font class="font tableTitle commonTableTitleColor " style="width:100%;font-family: 'Charis SIL';" >${item.table.title ? item.table.title : ''}</font>
|
||
<table border="1" style="width: 100%; border-collapse: collapse; text-align: center; ">
|
||
${header
|
||
.map((row, i) => {
|
||
return `
|
||
<tr class="table-header-row">
|
||
${row
|
||
.map((cell, cellIndex) => {
|
||
return `
|
||
<td colspan="${cell.colspan || 1}" rowspan="${cell.rowspan || 1}" >
|
||
<span style="font-family: 'Charis SIL';">${cell.text || ''}</span>
|
||
</td>
|
||
`;
|
||
})
|
||
.join('')}
|
||
</tr>
|
||
`;
|
||
})
|
||
.join('')}
|
||
${rowData
|
||
.map((row, i) => {
|
||
return `
|
||
<tr class="table-content-row ${row.rowId && rowIds.includes(row.rowId) ? 'oddColor' : ''}">
|
||
${row
|
||
.map((cell) => {
|
||
if (!cell || !cell.cellId) return '';
|
||
|
||
const content = cell.text || '';
|
||
const isBase64Image = /^<img\s+[^>]*src=["']data:image\//i.test(content);
|
||
|
||
const finalContent = isBase64Image
|
||
? 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}')" />`;
|
||
}
|
||
)
|
||
: content;
|
||
|
||
|
||
return `
|
||
<td colspan="${cell.colspan || 1}" rowspan="${cell.rowspan || 1}">
|
||
<span style="font-family: 'Charis SIL';">${finalContent}</span>
|
||
</td>`;
|
||
})
|
||
.join('')}
|
||
</tr>
|
||
`;
|
||
})
|
||
.join('')}
|
||
</table>
|
||
<p class="font" style="width: ${item.width ? `${item.width}px` : '100%'};
|
||
font-size: 14px;
|
||
font-family: 'Charis SIL';
|
||
font-weight: 500 !important;
|
||
line-height: 22px;
|
||
text-align:left;color:#333;" >${item.table.note ? item.table.note : ''
|
||
}</p>
|
||
</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>`;
|
||
|
||
|
||
|
||
}
|
||
|
||
// 判断是否是表格类型
|
||
|
||
return contentHtml;
|
||
}).join('');
|
||
//文章html内容部分
|
||
htmlContent = `<div class="newHtml2" >${htmlContent}</div>`
|
||
|
||
|
||
|
||
if (result.data.refers.length > 0) { // 如果有引用数据
|
||
var refs = '';
|
||
var xuhao = 0;
|
||
for (var rr = 0; rr < result.data.refers.length; rr++) {
|
||
// 如果格式不正确,或者信息不全
|
||
let item = '';
|
||
if (result.data.refers[rr].refer_type == 'journal' && result.data.refers[rr].doilink != '') {
|
||
// journal 类型
|
||
xuhao++;
|
||
item = "<div><p style='word-wrap: break-word;'>" + `<b style="color:#006699;">${xuhao}</b>. ` + result.data.refers[rr].author + ' ' + result.data.refers[rr].title + ". <i>" + result.data.refers[rr].joura + ". </i>" + result.data.refers[rr].dateno + ".";
|
||
// 在 "Available at:" 之前插入 <br/> 标签
|
||
item += "<br/><a class='refsLink' href='" + result.data.refers[rr].doilink + "' target='_blank' style='color:#006699; word-wrap:break-word;'>Available at: " + result.data.refers[rr].doilink + "</a> </p></div>";
|
||
refs += item;
|
||
} else if (result.data.refers[rr].refer_type == 'book' && result.data.refers[rr].isbn != '') {
|
||
// book 类型
|
||
xuhao++;
|
||
item = "<div><p style='word-wrap: break-word;'>" + `<b style="color:#006699;">${xuhao}</b>. ` + result.data.refers[rr].author + ' ' + result.data.refers[rr].title + ". " + result.data.refers[rr].dateno + ".";
|
||
// 在 "Available at:" 之前插入 <br/> 标签
|
||
item += "<br/><a target='_blank' style='color:#006699; word-wrap:break-word;' href='" + result.data.refers[rr].isbn + "'>ISBN: " + result.data.refers[rr].isbn + "</a></p></div>";
|
||
refs += item;
|
||
} else if (result.data.refers[rr].refer_type == 'other' && result.data.refers[rr].refer_frag != '' && result.data.refers[rr].refer_frag.length > 15) {
|
||
// other 类型,检查 refer_frag 中是否有 "Available at:" 链接
|
||
xuhao++;
|
||
item = "<div><p data-other='1' style='word-wrap: break-word;'>" + `<b style="color:#006699;">${xuhao}</b>. `
|
||
// 检查 refer_frag 中是否包含 "Available at:"
|
||
if (result.data.refers[rr].refer_frag.indexOf('Available at:') !== -1) {
|
||
// 如果包含 "Available at:",则在其前面插入 <br/> 标签
|
||
item += result.data.refers[rr].refer_frag.replace('Available at:', '<br/>Available at:');
|
||
} else {
|
||
item += result.data.refers[rr].refer_frag;
|
||
}
|
||
item += ". </p></div>";
|
||
refs += item;
|
||
} else {
|
||
continue;
|
||
}
|
||
}
|
||
|
||
refersContent = `<div id="ArticleRef" style="" class="ArticleRef"><p id="References" class="Ptitle "><b>References</b></p>${refs}</div>`
|
||
|
||
}
|
||
|
||
initContentHtml({ html: htmlContent, refers: refersContent }, arr, result.data.refers, html_type, { ...ArticleData })
|
||
|
||
|
||
|
||
|
||
}
|
||
|
||
async function initContentHtml(content, arr, refers, html_type, ArticleData) {
|
||
console.log('ArticleData at line 2231:', ArticleData)
|
||
var j_artc = ArticleData.data.articleInfo
|
||
console.log('j_artc at line 2233:', j_artc)
|
||
var pdf_list = ''
|
||
var pdfStr = ''
|
||
if (j_artc.file_sub && j_artc.file_sub != '') {
|
||
var fileType = ''
|
||
var imgLink = ''
|
||
var fileTypeArr = j_artc.file_sub.split('.')
|
||
fileType = fileTypeArr[fileTypeArr.length - 1]
|
||
|
||
switch (fileType) {
|
||
case 'xlsx':
|
||
fileTypeName = 'XLSX'
|
||
imgLink = 'img/xlsx.png'
|
||
break;
|
||
case 'zip':
|
||
fileTypeName = 'ZIP'
|
||
imgLink = 'img/zip.png'
|
||
break;
|
||
case 'rar': fileTypeName = 'RAR'
|
||
imgLink = 'img/zip.png'
|
||
break;
|
||
case 'docx':
|
||
fileTypeName = 'DOCX'
|
||
imgLink = 'img/link_1.png'
|
||
break;
|
||
case 'pdf':
|
||
fileTypeName = 'PDF'
|
||
imgLink = 'img/articlepdf.png'
|
||
break;
|
||
default:
|
||
fileTypeName = 'OTHER'
|
||
imgLink = 'img/otherfile.png'
|
||
break;
|
||
}
|
||
|
||
|
||
pdf_list += '<li class="pdf_item"><div><img src="' + imgLink + '" width="16" height="16"><span class="pdf_file_type">' + fileTypeName + '</span></div>' +
|
||
'<div>Supplementary Material for doi: ' + j_artc.doi + '<a class="download" target="_blank" href="' + apiUrl + 'public/articleSUB/' + j_artc.file_sub + '"><i class="fa fa-download"></i>Download</a></div></li>';
|
||
}
|
||
if (j_artc.file_sub2 && j_artc.file_sub2 != '') {
|
||
pdf_list += '<li class="pdf_item"><div></div>' +
|
||
|
||
'<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 != '') {
|
||
pdfStr = `<div id="ArticlePdfBox" style="" class="ArticlePdfBox"><p id="ArticlePdf" class="Ptitle " style="margin-bottom:22px;"><b>Supplementary Material</b></p>${pdf_list}</div>`
|
||
|
||
}
|
||
|
||
//OriginalDataStr
|
||
var OriginalDataStr = ''
|
||
var OriginalData = ''
|
||
if (j_artc.file_original != '') {
|
||
OriginalData = '<div class="pdf_item" style="justify-content: flex-start;">Original data:<a class="download" target="_blank" href="public' + apiUrl + 'articleOriginal/' + j_artc.file_original + '"><i class="fa fa-download"></i>Download</a></div>';
|
||
OriginalDataStr = `<div id="ArticleOriginalDataBox" style="" class="ArticleOriginalDataBox"><p id="ArticleOriginalData" class="Ptitle " style="margin-bottom:22px;"><b>Original Data</b></p>${OriginalData}</div>`;
|
||
}
|
||
//ManuscriptProcessing
|
||
var detailIcon = ''
|
||
var lis = ''
|
||
var trackStr = ''
|
||
if (ArticleData.data.track && ArticleData.data.track.length > 0) {
|
||
for (var tt = 0; tt < ArticleData.data.track.length; tt++) {
|
||
var ttypeName = ''
|
||
var li = ""
|
||
var ttime = ''
|
||
var typeClass = ''
|
||
switch (ArticleData.data.track[tt].type) {
|
||
case (0):
|
||
ttypeName = 'Received'
|
||
break;
|
||
case (1):
|
||
ttypeName = 'With editor'
|
||
break;
|
||
case (2):
|
||
ttypeName = 'Under review'
|
||
break;
|
||
case (3):
|
||
ttypeName = 'Reject'
|
||
break;
|
||
case (4):
|
||
ttypeName = 'Revision'
|
||
break;
|
||
case (5):
|
||
ttypeName = 'Accept'
|
||
break;
|
||
case (6):
|
||
ttypeName = 'Pre-accept'
|
||
break;
|
||
case (7):
|
||
ttypeName = 'Proof'
|
||
break;
|
||
case (8):
|
||
ttypeName = 'Final decision'
|
||
break;
|
||
case (9):
|
||
ttypeName = 'Online'
|
||
break;
|
||
|
||
}
|
||
// 二级的时间
|
||
var reviewers = ""
|
||
|
||
if (ArticleData.data.track[tt].reviewers && ArticleData.data.track[tt].reviewers.length > 0) {
|
||
shenCode = []
|
||
for (var er = 0; er < ArticleData.data.track[tt].reviewers.length; er++) {
|
||
var neiTag = ''
|
||
var reviewerState = ''
|
||
var reviewerItem = ''
|
||
var time1 = '' // 创建时间
|
||
var time2 = '' // 回应时间
|
||
|
||
// 初审和复审的审核意见
|
||
// var fushenContent = ''
|
||
var chushenContent = ''
|
||
var timess = ''
|
||
// 进入页面前清空
|
||
if (ArticleData.data.track[tt].type == 2 && ArticleData.data.track[tt].reviewers[er].question != null) {
|
||
chushenContent = ''
|
||
timess = ''
|
||
chushenContent = ArticleData.data.track[tt].reviewers[er].question.comments
|
||
timess = timestampToTime(ArticleData.data.track[tt].reviewers[er].question.ctime)
|
||
|
||
shenCode.push("<div class='shenheComments'><p><span>Comments:</span> <br/>" + chushenContent + "</p><p class='time'><span>Review comments received: </span>" + timess + "</p></div>")
|
||
|
||
// detailIcon = '<svg onclick="showComments(' + er + ')" style="vertical-align: middle; cursor: pointer; margin-left: 10px" t="1691720445324" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4032" width="26" height="26"><path d="M512 298.666667c-162.133333 0-285.866667 68.266667-375.466667 213.333333 89.6 145.066667 213.333333 213.333333 375.466667 213.333333s285.866667-68.266667 375.466667-213.333333c-89.6-145.066667-213.333333-213.333333-375.466667-213.333333z m0 469.333333c-183.466667 0-328.533333-85.333333-426.666667-256 98.133333-170.666667 243.2-256 426.666667-256s328.533333 85.333333 426.666667 256c-98.133333 170.666667-243.2 256-426.666667 256z m0-170.666667c46.933333 0 85.333333-38.4 85.333333-85.333333s-38.4-85.333333-85.333333-85.333333-85.333333 38.4-85.333333 85.333333 38.4 85.333333 85.333333 85.333333z m0 42.666667c-72.533333 0-128-55.466667-128-128s55.466667-128 128-128 128 55.466667 128 128-55.466667 128-128 128z" fill="#1296db" p-id="4033"></path></svg>'
|
||
detailIcon = '<i class="detailsBtn" onclick="showComments(' + er + ')">(Detail)</i>'
|
||
}
|
||
switch (ArticleData.data.track[tt].reviewers[er].state) {
|
||
case (1):
|
||
reviewerState = 'Accept with major revision'
|
||
break;
|
||
case (2):
|
||
reviewerState = 'Reject'
|
||
break;
|
||
case (3):
|
||
reviewerState = 'Accept with minor revision'
|
||
break;
|
||
}
|
||
time1 = timestampToTime(ArticleData.data.track[tt].reviewers[er].ctime)
|
||
time2 = timestampToTime(ArticleData.data.track[tt].reviewers[er].qtime)
|
||
reviewerItem = "<div class='reviewerBox'><span class='time1 time'>Invitation time: <br/>" + time1 + "</span><div class='box'><span class='title'>" + reviewerState + detailIcon + "</span><span class='score'>Score: " + ArticleData.data.track[tt].reviewers[er].rated + "</span><span class='reviewer'>reviewer: " + ArticleData.data.track[tt].reviewers[er].reviewer_name + "</span><span class='time2'>Review comments received: " + time2 + "</span></div></div>"
|
||
reviewers += reviewerItem
|
||
}
|
||
}
|
||
var finalStr = ""
|
||
if (ArticleData.data.track[tt].type == 8&&ArticleData.data.track[tt].response && ArticleData.data.track[tt].response.length > 0) {
|
||
|
||
for (var er = 0; er < ArticleData.data.track[tt].response.length; er++) {
|
||
var finalneiTag = ''
|
||
var finalState = ''
|
||
var finalItem = ''
|
||
var finaltime1 = '' // 创建时间
|
||
var finaltime2 = '' // 回应时间
|
||
|
||
// 初审和复审的审核意见
|
||
// var fushenContent = ''
|
||
var finalchushenContent = ''
|
||
var finaltimess = ''
|
||
// 进入页面前清空
|
||
|
||
chushenContent = ''
|
||
timess = ''
|
||
chushenContent = ''
|
||
timess = timestampToTime(ArticleData.data.track[tt].response[er].review_time)
|
||
|
||
// shenCode.push("<div class='shenheComments'><p><span>Comments:</span> <br/>" + chushenContent + "</p><p class='time'><span>Review comments received: </span>" + timess + "</p></div>")
|
||
|
||
// detailIcon = '<svg onclick="showComments(' + er + ')" style="vertical-align: middle; cursor: pointer; margin-left: 10px" t="1691720445324" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4032" width="26" height="26"><path d="M512 298.666667c-162.133333 0-285.866667 68.266667-375.466667 213.333333 89.6 145.066667 213.333333 213.333333 375.466667 213.333333s285.866667-68.266667 375.466667-213.333333c-89.6-145.066667-213.333333-213.333333-375.466667-213.333333z m0 469.333333c-183.466667 0-328.533333-85.333333-426.666667-256 98.133333-170.666667 243.2-256 426.666667-256s328.533333 85.333333 426.666667 256c-98.133333 170.666667-243.2 256-426.666667 256z m0-170.666667c46.933333 0 85.333333-38.4 85.333333-85.333333s-38.4-85.333333-85.333333-85.333333-85.333333 38.4-85.333333 85.333333 38.4 85.333333 85.333333 85.333333z m0 42.666667c-72.533333 0-128-55.466667-128-128s55.466667-128 128-128 128 55.466667 128 128-55.466667 128-128 128z" fill="#1296db" p-id="4033"></path></svg>'
|
||
// detailIcon = '<i class="detailsBtn" onclick="showComments(' + er + ')">(Detail)</i>'
|
||
|
||
switch (ArticleData.data.track[tt].response[er].state) {
|
||
case (1):
|
||
finalState = 'Accept'
|
||
break;
|
||
case (2):
|
||
finalState = 'Reject'
|
||
break;
|
||
case (3):
|
||
finalState = 'Revision'
|
||
break;
|
||
}
|
||
finaltime1 = timestampToTime(ArticleData.data.track[tt].response[er].invited_time)
|
||
finaltime2 = timestampToTime(ArticleData.data.track[tt].response[er].review_time)
|
||
finalItem = "<div class='reviewerBox'><span class='time1 time'>Invitation time: <br/>"
|
||
+ finaltime1 +
|
||
"</span><div class='box'><span class='title'>" + finalState +
|
||
"</span><span class='reviewer'>Editorial Board: " +
|
||
`${ArticleData.data.track[tt].response[er].realname}` + "</span><span class='reviewer'>Final decision time: " + `${finaltime2}` + "</span></div></div>"
|
||
finalStr += finalItem
|
||
}
|
||
}
|
||
// 获得时间
|
||
ttime = timestampToTime(ArticleData.data.track[tt].time)
|
||
|
||
var Revitag = ''
|
||
if (ArticleData.data.track[tt].type == 4 && ArticleData.data.track[tt].response) {
|
||
var title = '<h4>Response to reviewers: </h4>'
|
||
var lisss = ''
|
||
for (var s = 0; s < ArticleData.data.track[tt].response.length; s++) {
|
||
var xuhao = s + 1
|
||
var Revfile_url = ''
|
||
|
||
Revfile_url = '<span><a href="https://submission.tmrjournals.com/public/' + ArticleData.data.track[tt].response[s].file_url + '" target="_blank" class="txt_html">' + xuhao + '. Download</a></span>'
|
||
|
||
lisss += Revfile_url
|
||
}
|
||
Revitag = '<div class="filerev">' + title + lisss + '</div>'
|
||
}
|
||
li = "<div class='trackItem " + typeClass + "'><span class='time'>" + ttime + "</span><div class='type'><span class='title'>" + ttypeName + "</span>" + reviewers + Revitag+finalStr + "</div></div>"
|
||
lis += li
|
||
}
|
||
|
||
trackStr = `<div id="ArticleTrackBox" style="" class="ArticleTrackBox"><p id="ArticleTrack" class="Ptitle " style="margin-bottom:42px;"><b>Manuscript Processing</b></p>${lis}</div>`
|
||
}
|
||
var mhooStr = ''
|
||
if (ArticleData.data.articleInfo.mhoo && ArticleData.data.articleInfo.mhoo != '') {
|
||
|
||
|
||
mhooStr = `<div id="ArticleMhooBox" style="" class="ArticleMhooBox"><p id="ArticleMhoo" class="Ptitle " style="margin-bottom:42px;"><b>Medical history of objective</b></p>${ArticleData.data.articleInfo.mhoo}</div>`
|
||
}
|
||
|
||
//ManuscriptProcessing
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
var str = `
|
||
<div class="conthtmn_right" style="margin-left:300px;padding-top:30px;padding-right:15px;box-sizing:border-box">
|
||
|
||
${content.html ? `<div class="conthtmn_right_html" >${content.html}</div>` : ''}
|
||
${content.refers ? `<div class="conthtmn_right_ref" style="margin-bottom:22px;">${content.refers}</div>` : ''}
|
||
${pdfStr ? `<div class="conthtmn_right_pdf">${pdfStr}</div>` : ''}
|
||
${OriginalDataStr ? `<div class="OriginalData" id="OriginalData" style="margin-top:40px;">${OriginalDataStr}</div>` : ''}
|
||
${trackStr ? `<div class="conterecord" id="conterecord" style="margin-top:40px;">${trackStr}</div>` : ''}
|
||
${mhooStr ? `<div class="" id="" style="margin-top:40px;">${mhooStr}</div>` : ''}
|
||
<div class="corr_late" id="corr_late" style="margin-top:30px;display:none;"></div>
|
||
<div class="contnet_Topics" id="conTopics" style="margin-top:30px;display:none;"></div>
|
||
<div class="article-quote" style="display:none;margin-top:20px"></div>
|
||
|
||
</div>`
|
||
$('.wen_rong .content-box .conthtmn').html(str);
|
||
|
||
|
||
await initArticleHtml(arr, refers, html_type, { OriginalDataStr: OriginalDataStr, pdfStr: pdfStr, trackStr: trackStr, mhooStr: mhooStr })
|
||
await initRelatedArticles(ArticleData.a_ID)
|
||
await initTopics(ArticleData.a_ID)
|
||
console.log('citationCache at line 2137:', citationCache)
|
||
await fetchCitationsData(j_artc.doi, ArticleData.a_ID, async function (data) {
|
||
console.log('data at line 893:', data)
|
||
citationCache = data; // 存好结果,稍后再使用
|
||
await renderCitations(citationCache, j_artc.doi); // 传入上一步保存的数据
|
||
});
|
||
|
||
}
|
||
|
||
function initArticleHtml(htmlData, refs, type, otherList) {
|
||
console.log('otherList at line 2446:', otherList)
|
||
document.querySelectorAll('wmath').forEach(el => {
|
||
const latex = el.getAttribute('data-latex');
|
||
if (latex) {
|
||
el.innerHTML = latex;
|
||
MathJax.typesetPromise([el]);
|
||
}
|
||
});
|
||
$('.wen_rong .content-box .conthtmn .Ptitle').css({
|
||
background: 'rgb(222, 235, 247)',
|
||
'color': commonTableTitleColor, // No !important here
|
||
'text-align': 'center', // No !important here
|
||
'border': '1px solid rgba(222, 234, 247, 0.1)',
|
||
'border-radius': '10px',
|
||
'font-size': '16px',
|
||
'box-shadow': '0 4px 4px rgba(222, 234, 247, 0.6)',
|
||
});
|
||
$('.wen_rong .content-box .conthtmn .oddColor > td').css({
|
||
background: 'rgb(250, 231, 232)',
|
||
|
||
});
|
||
// Apply styles to <i> inside .Ptitle using setProperty with !important
|
||
$('.wen_rong .content-box .conthtmn .Ptitle > b').each(function () {
|
||
this.style.setProperty('font-weight', 'bold', 'important');
|
||
|
||
});
|
||
$('.wen_rong .content-box .conthtmn .Ptitle > i').each(function () {
|
||
this.style.setProperty('font-style', 'normal', 'important');
|
||
this.style.setProperty('color', commonTableTitleColor, 'important');
|
||
});
|
||
$('.wen_rong .content-box .conthtmn .Ptitle p > strong').each(function () {
|
||
this.style.setProperty('font-weight', 'bold', 'important');
|
||
|
||
});
|
||
$('.wen_rong .content-box .conthtmn .Ptitle p').each(function () {
|
||
this.style.setProperty('text-align', 'center', 'important');
|
||
|
||
});
|
||
$('.wen_rong .content-box .conthtmn .Ptitle em').each(function () {
|
||
this.style.setProperty('font-style', 'normal', 'important');
|
||
this.style.setProperty('color', commonTableTitleColor, 'important');
|
||
});
|
||
$('.wen_rong .content-box .conthtmn .commonTableTitleColor').each(function () {
|
||
|
||
this.style.setProperty('color', commonTableTitleColor, 'important');
|
||
});
|
||
|
||
|
||
// 获取所有段落
|
||
const allParagraphs = document.querySelectorAll('.pMain');
|
||
let abstractEndIndex = -1;
|
||
let citationEndIndex = -1;
|
||
|
||
// 查找包含“Abstract”文本的段落(无论被标签包裹多少层)
|
||
allParagraphs.forEach((p, index) => {
|
||
const text = p.innerText.trim().toLowerCase();
|
||
if (text === 'abstract') {
|
||
abstractEndIndex = index;
|
||
}
|
||
if (text === 'citation') {
|
||
citationEndIndex = index;
|
||
console.log('CitationEndIndex at line 8765:', citationEndIndex)
|
||
}
|
||
});
|
||
|
||
// 从 Abstract 段落之后开始查找并高亮标题词
|
||
if (abstractEndIndex !== -1 && abstractEndIndex + 1 < allParagraphs.length) {
|
||
const nextParagraph = allParagraphs[abstractEndIndex + 1];
|
||
const elements = nextParagraph.querySelectorAll('strong, b');
|
||
elements.forEach((element) => {
|
||
const text = element.textContent.trim();
|
||
if (["Background:", "Methods:", "Method:", "Results:", "Result:", "Conclusion:", "Conclusions:"].includes(text) ||
|
||
["Background", "Methods", "Method", "Results", "Result", "Conclusion", "Conclusions"].includes(text)) {
|
||
element.style.color = commonSupColor;
|
||
}
|
||
});
|
||
}
|
||
if (citationEndIndex !== -1 && citationEndIndex + 1 < allParagraphs.length) {
|
||
const nextParagraph = allParagraphs[citationEndIndex + 1];
|
||
nextParagraph.style.color = commonSupColor;
|
||
}
|
||
$('.wen_rong .content-box .conthtmn sup').each(function () {
|
||
var textContent = $(this).text().trim(); // 获取并清理文本内容
|
||
|
||
// 判断文本是否是纯数字
|
||
if (/^\d+$/.test(textContent)) {
|
||
this.style.setProperty('color', commonSupColor, 'important');
|
||
}
|
||
// 判断文本是否包含 "&"
|
||
else if (/&/.test(textContent)) {
|
||
this.style.setProperty('color', commonSupColor, 'important');
|
||
}
|
||
else if (/ỻ/.test(textContent)) {
|
||
this.style.setProperty('color', commonSupColor, 'important');
|
||
}
|
||
// 判断文本是否包含 "*"
|
||
else if (/\*/.test(textContent)) {
|
||
this.style.setProperty('color', commonSupColor, 'important');
|
||
}
|
||
// 判断文本是否包含 "#"
|
||
else if (/#/.test(textContent)) {
|
||
this.style.setProperty('color', commonSupColor, 'important');
|
||
}
|
||
// 判断文本是否为由数字和逗号组成的字符串(例如 "1,2,3")
|
||
// 判断文本是否为由数字和逗号组成,且逗号两边允许有空格(例如 "1, 2, 3")
|
||
else if (/^\d+(\s*,\s*\d+)*$/.test(textContent)) {
|
||
this.style.setProperty('color', commonSupColor, 'important');
|
||
}
|
||
});
|
||
|
||
|
||
$('.wen_rong .content-box .conthtmn b i').each(function () {
|
||
|
||
this.style.setProperty('font-weight', 'bold', 'important');
|
||
});
|
||
// $('.wen_rong .content-box .conthtmn .thumbnailTableBox td sup').each(function () {
|
||
|
||
// this.style.setProperty('color', commonSupColor, 'important');
|
||
// });
|
||
|
||
|
||
$('.wen_rong .content-box .conthtmn .Ptitle').each(function () {
|
||
this.style.setProperty('color', commonTableTitleColor, 'important');
|
||
this.style.setProperty('text-align', 'center', 'important');
|
||
});
|
||
$('.wen_rong .content-box .conthtmn .Ptitle b i').each(function () {
|
||
this.style.setProperty('font-style', 'normal', 'important');
|
||
});
|
||
$('.wen_rong .content-box .conthtmn .Ptitle i b').each(function () {
|
||
this.style.setProperty('font-style', 'normal', 'important');
|
||
});
|
||
|
||
|
||
var navLinks = {
|
||
content: [], // 存放 content 类型的链接
|
||
image: [], // 存放 image 类型的链接
|
||
table: [] // 存放 table 类型的链接
|
||
};
|
||
if (htmlData && htmlData.length > 0) {
|
||
htmlData.forEach((item, index) => {
|
||
|
||
|
||
let sectionId = 'section-' + index; // 生成唯一的 ID
|
||
|
||
if (type == 0) {
|
||
if (item.width == 0) {
|
||
if (item.is_title == 1) {
|
||
var textContent = $('<div>').html(item.content).text(); // 提取纯文本
|
||
navLinks.content.push({ sectionId: sectionId, type: 'content', text: textContent, href: '#' + sectionId, is_h1: item.is_title, });
|
||
|
||
}
|
||
} else {
|
||
var picsrc = 'https://submission.tmrjournals.com/public/mainimg/' + item.content;
|
||
var textContentimg = $('<div>').html(item.note).text(); // 提取纯文本
|
||
navLinks.image.push({ sectionId: sectionId, type: 'image', text: textContentimg || 'Image ' + (index + 1), href: '#' + sectionId, url: picsrc });
|
||
|
||
}
|
||
} 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 });
|
||
} 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 });
|
||
|
||
} else {
|
||
var textContent = $('<div>').html(item.content).text(); // 提取纯文本
|
||
|
||
if (item.is_h1) {
|
||
|
||
navLinks.content.push({ sectionId: sectionId, type: 'content', text: textContent, href: '#' + sectionId, is_h1: item.is_h1, });
|
||
}
|
||
|
||
}
|
||
}
|
||
|
||
})
|
||
}
|
||
|
||
console.log('navLinks.forEach at line 7752:', navLinks)
|
||
// 引用
|
||
var navHtml = `<div class="anchor-nav outline-container is-open" > <div class="outline-toggle">
|
||
|
||
<span class="toggle-text nav_item_title" style="margin-bottom: 6px;font-size:18px !important;">Outline</span>
|
||
<span class="toggle-text1" >Show Outline</span>
|
||
</div><ul class="outline-content">`;
|
||
|
||
// 先添加 content 类型
|
||
if (navLinks.content.length > 0) {
|
||
navLinks.content.forEach(link => {
|
||
navHtml += `<li data-section="${link.sectionId}" class="outiline-item outiline-content ${link.is_h1 ? 'outiline-item-h1' : ''} ${link.is_h2 ? 'outiline-item-h2' : ''}" ><a href="${link.href}" style="font-style: italic;
|
||
|
||
font-weight: bold;"><b>${link.text}</b></a></li>`;
|
||
|
||
});
|
||
}
|
||
|
||
if (navLinks.image.length > 0) {
|
||
navHtml += `<li class="outiline-item outiline-img">
|
||
<h2 style="margin-bottom:15px;">Figures (${navLinks.image.length})</h2>
|
||
<div class="navLinksFigures">`;
|
||
|
||
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}>
|
||
<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>`;
|
||
}).join('');
|
||
|
||
// 添加“显示更多”按钮
|
||
if (navLinks.image.length > 3) {
|
||
const hiddenCount = navLinks.image.length - 3;
|
||
navHtml += `
|
||
<p class="v4-show-hide-icon is-not-active"
|
||
style="margin-bottom: 0; display: flex; align-items: center; justify-content: space-between; width: 98%; font-weight: 600; cursor: pointer; color: #666; font-size: 14px;">
|
||
|
||
<span class="toggle-text" style="font-size:14px !important;color:#006699;">Show all figures</span>
|
||
<i class="fa fa-angle-right toggle-icon" style="font-style:normal !important"></i>
|
||
</p>`;
|
||
}
|
||
|
||
|
||
navHtml += `</div></li>`;
|
||
|
||
$(document).on('click', '.v4-show-hide-icon', function () {
|
||
const $this = $(this);
|
||
const isCollapsed = $this.hasClass('is-not-active');
|
||
const hiddenCount = navLinks.image.length - 3;
|
||
|
||
$('.navLinksFigures .extra-figure').slideToggle(200);
|
||
$this.toggleClass('is-not-active');
|
||
|
||
if (isCollapsed) {
|
||
$this.find('.toggle-text').text(`Hide figures`);
|
||
$this.find('.toggle-icon').removeClass('fa-angle-right').addClass('fa-angle-up');
|
||
} else {
|
||
$this.find('.toggle-text').text(`Show all figures`);
|
||
$this.find('.toggle-icon').removeClass('fa-angle-up').addClass('fa-angle-right');
|
||
}
|
||
});
|
||
|
||
|
||
}
|
||
|
||
if (navLinks.table.length > 0) {
|
||
navHtml += `<li class="outiline-item outiline-img">
|
||
<h2 style="margin-bottom:15px;">Tables (${navLinks.table.length})</h2>
|
||
<div class="navLinksTables" >`;
|
||
|
||
// 使用 map 来遍历并返回 HTML 字符串
|
||
navHtml += navLinks.table.map((link, linkIndex) => {
|
||
|
||
let TableIndex = 'Table ' + (linkIndex + 1);
|
||
|
||
// if (link.text.includes(TableIndex)) {
|
||
// // 使用正则表达式替换 "Table 1" 部分并添加高亮样式
|
||
// link.text = link.text.replace(TableIndex, `<span style="color:#006699;">${TableIndex}</span>`);
|
||
// console.log(link.text, '99999')
|
||
// }
|
||
const isHidden = linkIndex >= 1 ? 'style="display:none;" class="extra-table"' :
|
||
``
|
||
return `<a data-section="${link.sectionId}" ${isHidden} href="${link.href}" style=";
|
||
box-sizing: border-box;
|
||
font-weight: 500 !important;
|
||
padding: 2px 0 0 16px !important;
|
||
width:100%;
|
||
margin-bottom:4px;
|
||
color: #333;
|
||
cursor: pointer;
|
||
color:#006699;
|
||
font-family: 'Charis SIL';
|
||
line-height:18px;min-height: 12px;"
|
||
>
|
||
<div style="display: flex ;align-items: center;"> <i class="fa fa-table" aria-hidden="true"style="font-size:18px;color:#006699;margin-right:8px;margin-top: 2px;" /></i> ${TableIndex}</div>
|
||
|
||
</a>`;
|
||
}).join(''); // 使用 join 来拼接所有的 HTML 字符串
|
||
|
||
|
||
if (navLinks.table.length > 1) {
|
||
const hiddenTableCount = navLinks.table.length - 1;
|
||
navHtml += `
|
||
<p class="v4-show-hide-icon-table is-not-active"
|
||
style="padding-left: 16px; margin-bottom: 0; display: flex; align-items: center; justify-content: space-between;box-sizing:border-box; width: 98%; font-weight: 600; cursor: pointer; color: #666; font-size: 14px;">
|
||
<span class="toggle-text" style="font-size:14px !important;color:#006699;">Show all tables</span>
|
||
<i class="fa fa-angle-right toggle-icon" style="font-style: normal !important;"></i>
|
||
</p>`;
|
||
}
|
||
|
||
$(document).on('click', '.v4-show-hide-icon-table', function () {
|
||
const $this = $(this);
|
||
const isCollapsed = $this.hasClass('is-not-active');
|
||
const hiddenTableCount = navLinks.table.length - 1;
|
||
|
||
$('.navLinksTables .extra-table').slideToggle(200);
|
||
$this.toggleClass('is-not-active');
|
||
|
||
if (isCollapsed) {
|
||
$this.find('.toggle-text').text(`Hide tables`);
|
||
$this.find('.toggle-icon').removeClass('fa-angle-right').addClass('fa-angle-up');
|
||
} else {
|
||
$this.find('.toggle-text').text(`Show all tables`);
|
||
$this.find('.toggle-icon').removeClass('fa-angle-up').addClass('fa-angle-right');
|
||
}
|
||
});
|
||
|
||
|
||
navHtml += `</div></li>`;
|
||
}
|
||
if (refs.length > 0) {
|
||
navHtml += `<li class="outiline-item outiline-img outiline-other" style="margin-top:15px;">
|
||
<h2 style="font-style: italic;"><a href="#References" class="nav_item_title">References</a></h2>
|
||
</li>`;
|
||
}
|
||
|
||
|
||
if (otherList.pdfStr && otherList.pdfStr != '') {
|
||
navHtml += `<li class="outiline-item outiline-img outiline-other">
|
||
<h2 style="font-style: italic;" ><a href="#ArticlePdf" class="nav_item_title">Supplementary Material</a></h2>
|
||
</li>`;
|
||
}
|
||
if (otherList.OriginalDataStr && otherList.OriginalDataStr != '') {
|
||
navHtml += `<li class="outiline-item outiline-img outiline-other">
|
||
<h2 style=""><a href="#ArticleOriginalData" class="nav_item_title">Original Data</a></h2>
|
||
</li>`;
|
||
}
|
||
if (otherList.trackStr && otherList.trackStr != '') {
|
||
navHtml += `<li class="outiline-item outiline-img outiline-other">
|
||
<h2 style="" ><a href="#conterecord" class="nav_item_title">Manuscript Processing</a></h2>
|
||
</li>`;
|
||
}
|
||
if (otherList.mhoo && otherList.mhoo != '') {
|
||
navHtml += `<li class="outiline-item outiline-img outiline-other">
|
||
<h2 style="" ><a href="#ArticleMhoo" class="nav_item_title">Medical history of objective</a></h2>
|
||
</li>`;
|
||
}
|
||
|
||
navHtml += `<li class="outiline-item outiline-img outiline-other" id="ArticleCorrLateNav" style="display:none;">
|
||
<h2 style="" ><a href="#ArticleCorrLate" class="nav_item_title">Related Articles</a></h2>
|
||
</li>`;
|
||
navHtml += `<li class="outiline-item outiline-img outiline-other" id="ArticleTopics" style="display:none;">
|
||
<h2 style="" ><a href="#conTopics" class="nav_item_title">Topics</a></h2>
|
||
</li>`;
|
||
navHtml += `<li class="outiline-item outiline-img outiline-other" id="ArticleCitations" style="display:none;">
|
||
<h2 style="" ><a href="#ArticleCitationsBox" class="nav_item_title">Article Citations</a></h2>
|
||
</li>`;
|
||
|
||
|
||
|
||
navHtml += '</ul></div>';
|
||
$('.wen_rong .content-box .conthtmn').prepend(navHtml);
|
||
// 给导航栏添加固定定位样式
|
||
// 给导航栏添加固定定位样式
|
||
|
||
$('.jo-catalog-title').css({
|
||
'line-height': '40px',
|
||
'font-size': '18px',
|
||
'color': '#333',
|
||
'border-bottom': '1px solid #f0f0f0',
|
||
|
||
});
|
||
$('.outiline-item').css({
|
||
|
||
'box-sizing': 'border-box',
|
||
'font-size': '14px',
|
||
'color': '#454545',
|
||
'cursor': 'pointer',
|
||
});
|
||
$('.outiline-content').css({
|
||
'padding': '4px 0',
|
||
'margin-left': '16px',
|
||
'color': '#333',
|
||
'cursor': 'pointer',
|
||
'font-family': 'Charis SIL',
|
||
|
||
|
||
});
|
||
|
||
$('.outiline-img').css({
|
||
|
||
'margin-top': '20px',
|
||
'margin-bottom': '20px',
|
||
|
||
|
||
});
|
||
$('.outiline-table').css({
|
||
|
||
'margin-top': '20px',
|
||
'margin-bottom': '20px',
|
||
|
||
// 'border-left': '3px solid #efefef',
|
||
|
||
});
|
||
$('.navLinksFigures').css({
|
||
'display': 'flex',
|
||
'flex-wrap': 'wrap',
|
||
'gap': '10px',
|
||
|
||
// 'margin-bottom': '10px',
|
||
'margin-top': '10px',
|
||
|
||
});
|
||
$('.navLinksTables').css({
|
||
'display': 'flex',
|
||
'flex-wrap': 'wrap',
|
||
'gap': '4px',
|
||
|
||
// 'margin-bottom': '10px',
|
||
// 'margin-top': '10px',
|
||
|
||
});
|
||
|
||
// 在滚动时保持导航栏在视口内
|
||
|
||
$(document).ready(function () {
|
||
// 监听右侧滚动区域
|
||
$('.newBox').scroll(function () {
|
||
|
||
|
||
var scrollTop = $(this).scrollTop(); // 获取当前右侧滚动的位置
|
||
|
||
|
||
|
||
|
||
|
||
var scrollHeight = $(this)[0].scrollHeight; // 获取右侧滚动区域的总高度
|
||
var containerHeight = $(this).height(); // 获取右侧容器的高度
|
||
// 获取所有右侧的 .pMain
|
||
var sections = $('.newBox').find('.pMain');
|
||
var navLinks = $('.anchor-nav').find('a'); // 获取所有左侧的导航链接
|
||
|
||
// 初始化清除所有导航链接的高亮
|
||
navLinks.css({
|
||
'color': '', // 恢复默认颜色
|
||
'font-weight': '' // 恢复默认字体粗细
|
||
});
|
||
|
||
// 遍历所有的 section
|
||
sections.each(function (index, section) {
|
||
var sectionTop = $(section).offset().top - $('.newBox').offset().top + scrollTop; // 计算每个 .pMain 相对于 .newBox 的位置
|
||
var sectionBottom = sectionTop + $(section).outerHeight(); // 获取每个 section 的底部位置
|
||
// 判断该 section 是否在可视区域内
|
||
if (scrollTop + containerHeight >= sectionTop && scrollTop <= sectionBottom) {
|
||
// 高亮对应的导航链接
|
||
$(navLinks[index]).css({
|
||
'color': 'rgb(0, 102, 153)', // 激活时颜色变为蓝色
|
||
'font-weight': 'bold' // 激活时加粗
|
||
});
|
||
// 只高亮一个链接,找到第一个符合条件的并停止遍历
|
||
return false; // 结束 .each() 遍历
|
||
}
|
||
});
|
||
});
|
||
$('.wordTableHtml table tr.table-header-row td').each(function () {
|
||
this.style.setProperty('border-bottom', '1px solid #000', 'important');
|
||
|
||
});
|
||
// document.querySelectorAll('.anchor-nav a[href^="#"]').forEach(anchor => {
|
||
// anchor.addEventListener('click', function (e) {
|
||
// const href = this.getAttribute('href');
|
||
// const target = document.querySelector(href);
|
||
|
||
// if (target) {
|
||
// e.preventDefault();
|
||
// const offset = 100; // 调整这里的偏移距离
|
||
|
||
// window.scrollTo({
|
||
// top: target.offsetTop - offset,
|
||
// behavior: 'smooth'
|
||
// });
|
||
// }
|
||
// });
|
||
// });
|
||
|
||
const waitForTop = setInterval(() => {
|
||
const bar = document.querySelector('.v4-art-top');
|
||
if (bar) {
|
||
clearInterval(waitForTop);
|
||
|
||
let lastStatus = false;
|
||
const offsetTop = bar.getBoundingClientRect().top + $('.newBox')[0].scrollTop;
|
||
|
||
$('.newBox').on('scroll', function () {
|
||
const scrollTop = $(this).scrollTop();
|
||
|
||
if (scrollTop >= offsetTop) {
|
||
if (!lastStatus) {
|
||
bar.classList.add('fixed');
|
||
// 加动画类,显示动画
|
||
setTimeout(() => {
|
||
bar.classList.add('show');
|
||
}, 10);
|
||
lastStatus = true;
|
||
}
|
||
} else {
|
||
if (lastStatus) {
|
||
// 先移除动画类,立即移除位置固定
|
||
bar.classList.remove('show');
|
||
|
||
// 直接移除 fixed,不等待动画
|
||
bar.classList.remove('fixed');
|
||
|
||
lastStatus = false;
|
||
}
|
||
}
|
||
});
|
||
}
|
||
}, 100);
|
||
|
||
// $(document).on('click', '.outline-toggle', function () {
|
||
// const $container = $(this).closest('.outline-container');
|
||
// const $icon = $(this).find('i');
|
||
// const $text = $(this).find('.toggle-text');
|
||
// const $panel = $('.conthtmn_right');
|
||
// const isClosed = $container.hasClass('is-closed');
|
||
|
||
// if (isClosed) {
|
||
// $container.removeClass('is-closed').addClass('is-open');
|
||
// $panel.get(0).style.setProperty('margin-left', '300px', 'important');
|
||
|
||
|
||
// } else {
|
||
// $container.removeClass('is-open').addClass('is-closed');
|
||
|
||
|
||
|
||
// $panel.get(0).style.setProperty('margin-left', '40px', 'important');
|
||
// }
|
||
// });
|
||
|
||
|
||
|
||
|
||
|
||
|
||
});
|
||
|
||
|
||
}
|
||
function isHeaderRow(rowIndex, table) {
|
||
|
||
|
||
|
||
var head = table[0]
|
||
|
||
|
||
return rowIndex < head[0].rowspan; // 假设前两行是表头
|
||
}
|
||
function splitTable(tableList) {
|
||
// 获取头部行数
|
||
const headerRowCount = tableList[0][0].rowspan || 1; // 默认第一行是头部行,获取该行的 rowspan
|
||
// 用 isHeaderRow 判断头部行
|
||
const header = [];
|
||
const content = [];
|
||
let cellIdCounter = 0; // 初始化计数器,用于为每个单元格生成唯一的 cellId
|
||
tableList.forEach((row, rowIndex) => {
|
||
row.forEach((cell, cellIndex) => {
|
||
cell.cellId = `cell-${cellIdCounter}`;
|
||
cellIdCounter++;
|
||
});
|
||
if (isHeaderRow(rowIndex, tableList)) {
|
||
header.push(row); // 将头部行添加到 header 数组
|
||
} else {
|
||
content.push(row); // 将内容行添加到 table 数组
|
||
}
|
||
});
|
||
//
|
||
console.log('header:', header); // 打印头部行数据
|
||
console.log('table打印内容行数据:', content); // 打印内容行数据
|
||
|
||
return { header, content };
|
||
}
|
||
// 图片预览
|
||
function picPreview(src) {
|
||
console.log(src)
|
||
$('.PicPreview img').attr('src', src)
|
||
$('.PicPreview').show()
|
||
}
|
||
$('.PicPreview').on('click', function () {
|
||
$('.PicPreview').hide()
|
||
})
|
||
|
||
// 显示审核内容
|
||
function showComments(num) {
|
||
// console.log('显示初审内容',shenCode)
|
||
layer.open({
|
||
type: 1
|
||
, title: false //不显示标题栏
|
||
, closeBtn: true
|
||
, area: '600px;'
|
||
, shade: 0.8
|
||
, id: 'LAY_layuipro' //设定一个id,防止重复弹出
|
||
/// ,btn: ['close']
|
||
, btnAlign: 'c'
|
||
, moveType: 1 //拖拽模式,0或者1
|
||
, content: shenCode[num]
|
||
});
|
||
}
|
||
function getCiteList(a_ID) {
|
||
$('.cite_box .export_cite').html('<div class="loader-01"></div>');
|
||
var journalCiteStr = ''
|
||
$.ajax({
|
||
type: 'post', url: apiUrl + 'api/Article/getArticleCites',
|
||
data: {
|
||
"article_id": a_ID
|
||
},
|
||
success: function (result) {
|
||
if (result.code == 0) {
|
||
|
||
var arr = result.data.list
|
||
for (let i in arr) {
|
||
journalCiteStr += `
|
||
<div class='cite_list_item' style="margin-bottom:10px;podding:10px 0;display:flex;border-bottom: ${i != arr.length - 1 ? '1px solid #ccc' : 'none'};}"><p style="margin-right:10px;">${Number(i) + 1}.</p>
|
||
<div>
|
||
<p style="display: block; line-height: 20px;
|
||
font-size: 13px;
|
||
margin-bottom: 3px;"> <a style="color:#205493 !important;"
|
||
target="_blank"
|
||
href="${arr[i].doi ? 'https://doi.org/' + arr[i].doi : ''}">
|
||
${arr[i].article_name}
|
||
</a></p>
|
||
|
||
<p style="line-height: 14px;margin-bottom: 10px;">
|
||
<span style="color: #a2b1b6;
|
||
font-size: 13px;">${arr[i].author ? `${arr[i].author},` : ''} ${arr[i].journal_name}${arr[i].vol ? `${arr[i].vol},` : ''}
|
||
</span>
|
||
<span style="margin-left:5px;color:#205493 !important;">
|
||
</span></p></div>
|
||
|
||
</div> `
|
||
}
|
||
journalCiteStr += ` <div class="cite_triangle"></div>`
|
||
|
||
$('.cite_box .export_cite').html(journalCiteStr);
|
||
|
||
|
||
|
||
|
||
|
||
}
|
||
}
|
||
})
|
||
}
|
||
|
||
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;
|
||
if ([1, 14, 8].includes(Number(Jour_num))) {
|
||
isShowAuthorship = 1
|
||
}
|
||
// if (a_ID == 4477) {
|
||
const style = document.createElement('style');
|
||
style.innerHTML = `/* 遮罩层 */
|
||
.article_dropbtn:hover {
|
||
color: ${Journals_color};
|
||
|
||
}
|
||
.article_dropdown-list a:hover {
|
||
|
||
border-bottom:2px solid ${Journals_color};
|
||
font-weight:bold;
|
||
color:#333;
|
||
}
|
||
.toggle-btn{
|
||
color: ${Journals_color};
|
||
}
|
||
`;
|
||
document.head.appendChild(style);
|
||
|
||
|
||
// 获取 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>
|
||
<p><a href="/stages.html?J_num=${Jour_num}" target="_blank">Archiving</a></p>
|
||
<p style="${Jour_num == 1 ? 'display:block' : 'display:none'}"><a href="/guest.html?J_num=${Jour_num}" target="_blank">Special Issues</a></p>
|
||
|
||
<p><a href="/article_list.html?J_num=${Jour_num}&top_id=${Jour_num}" target="_blank">Highlights</a></p>
|
||
|
||
`
|
||
var otherStr2 = `<p><a href="/${Journals_usx}" 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 = `
|
||
<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>
|
||
<!--地图弹窗-->
|
||
<div class="Authorship" style="position: relative;z-index:10;cursor: pointer;${isShowAuthorship ? 'display:block' : 'display:none'}">
|
||
|
||
<p class="Authorship_text"><a href="javascript:;" onclick="openAuthorship(${Jour_num},'${Journals_color}')">Authorship</a></p>
|
||
|
||
`
|
||
var str = ` <div class="article_navbar-container" id="article_navbar-container" style="display:block">
|
||
<div style="display: flex
|
||
;
|
||
align-items: center;margin:0 auto">
|
||
<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">
|
||
${otherStr1}
|
||
</div>
|
||
</div>
|
||
<div class="article_dropdown-menu">
|
||
<div class="article_dropbtn">About Journal <i class="fa fa-chevron-down" style="font-size: 14px;margin-left: 6px;"></i></div>
|
||
<div class="article_dropdown-list" style="min-width:180px">
|
||
${otherStr2}
|
||
</div>
|
||
</div>
|
||
<div class="article_dropdown-menu">
|
||
<div class="article_dropbtn">Publish <i class="fa fa-chevron-down" style="font-size: 14px;margin-left: 6px;"></i></div>
|
||
<div class="article_dropdown-list" style="min-width:250px">
|
||
${otherStr3}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>`
|
||
|
||
|
||
|
||
// 使用 insertAdjacentHTML 在 top_bar 后插入新元素
|
||
if (topBar) {
|
||
topBar.insertAdjacentHTML('afterend', str);
|
||
|
||
|
||
|
||
}
|
||
|
||
|
||
// JavaScript to handle dropdown toggle on button click
|
||
|
||
|
||
|
||
// }
|
||
|
||
|
||
|
||
}
|
||
function openPdf(url, j_artc, Jour_num) {
|
||
$.ajax({
|
||
type: 'post', url: apiUrl + 'yuan/Article/addArticleNum', async: false,
|
||
data: { "article_id": j_artc.article_id, "type": 'pdf' },
|
||
success: function (result) {
|
||
}
|
||
})
|
||
$.ajax({
|
||
type: 'post', url: apiUrl + 'super/Publish/addVisitNum',
|
||
data: { 'type': Jour_num, 'is_detail': '1' },
|
||
success: function (result) {
|
||
}
|
||
});
|
||
window.open(url);
|
||
}
|
||
function initMoreButtonTopList(articleInfo, a_ID) {
|
||
console.log('articleInfo at line 2590:', articleInfo)
|
||
|
||
var j_artc = articleInfo.articleInfo
|
||
var Journals_color = localStorage.getItem('Journals_color')
|
||
var journalStageID = localStorage.getItem('journalStageID')
|
||
|
||
|
||
const style = document.createElement('style');
|
||
style.innerHTML = `
|
||
|
||
.v4-art-top-main-m .v4-art-top-item span:hover{
|
||
color: ${Journals_color};
|
||
}
|
||
|
||
`
|
||
|
||
document.head.appendChild(style);
|
||
|
||
// 获取 id 为 top_bar 的元素
|
||
var topBar = document.getElementById("article_base_info_box");
|
||
|
||
var str = `
|
||
<div id="v4_art_top" class="v4-art-top">
|
||
<div id="v4_art_top_main" class="v4-art-top-main" style="position: relative; background-color: transparent;">
|
||
<div class="v4-art-top-main-m">
|
||
${j_artc.file_pdf !== '' ? `
|
||
<div class="v4-art-top-item view-pdf">
|
||
<img src="/img/articlepdf.png" class="icon" />
|
||
<span>Download PDF</span>
|
||
</div>
|
||
` : ''}
|
||
${j_artc.html_type == 1 ? `
|
||
<div class="v4-art-top-item view-html">
|
||
<img src="/img/articlehtml.png" class="icon" />
|
||
<span>HTML</span>
|
||
</div>
|
||
` : ''}
|
||
<div class="v4-art-top-item cite">
|
||
<img src="/img/article_cite.png" class="icon"/>
|
||
<span>Cite</span>
|
||
</div>
|
||
|
||
<div class="v4-art-top-item share-third" style="z-index:0 !important">
|
||
<div class="sharethis-inline-share-buttons"></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
`;
|
||
|
||
// 使用 insertAdjacentHTML 在 top_bar 后插入新元素
|
||
if (topBar) {
|
||
|
||
topBar.insertAdjacentHTML('afterend', str);
|
||
|
||
const citeEl = document.querySelector('.v4-art-top-item.cite');
|
||
if (citeEl) {
|
||
citeEl.onclick = () => {
|
||
openCite(Jour_num, Journals_color, a_ID, j_artc, articleInfo);
|
||
};
|
||
}
|
||
const pdfEl = document.querySelector('.v4-art-top-item.view-pdf');
|
||
if (pdfEl) {
|
||
pdfEl.onclick = () => {
|
||
openPdf(`${imgFileUrl}articlePDF/${j_artc.file_pdf}`, j_artc, Jour_num);
|
||
};
|
||
}
|
||
const htmlEl = document.querySelector('.v4-art-top-item.view-html');
|
||
if (htmlEl) {
|
||
htmlEl.onclick = () => {
|
||
|
||
|
||
window.open(`${imgFileUrl}articleHTML/${j_artc.file_html}`)
|
||
};
|
||
}
|
||
setTimeout(() => {
|
||
if (window.__sharethis__) {
|
||
__sharethis__.initialize();
|
||
}
|
||
|
||
}, 200)
|
||
|
||
}
|
||
}
|
||
function openAbstracting(Jour_num, Journals_color) {
|
||
var list = localStorage.getItem('journalAbs')
|
||
var arr_Abc = JSON.parse(list).filter(e => e.is_show == 1);
|
||
var Abstractingcontent = `<ul style="margin-top:10px;">
|
||
${arr_Abc.map((item, i) => {
|
||
return `<li style="font-weight:700;font-size:14px;"><span style="display:inline-block">» </span><a target="_blank" href="${item.url}" style="font-weight:700;display:inline-block">${item.title}</a></li>`;
|
||
}).join('')}
|
||
</ul>`
|
||
document.querySelector('#common-popup .common-popup-content').classList.add('whitebg');
|
||
showPopup(`<span style="font-weight:bold;color:${Journals_color}">Abstracting & Indexing</span>`, Abstractingcontent)
|
||
|
||
|
||
|
||
|
||
// 5秒后自动关闭
|
||
// setTimeout(closePopup, 5000);
|
||
}
|
||
function openCite(Jour_num, Journals_color, a_ID, j_artc, data) {
|
||
console.log('data at line 2593:', j_artc, data)
|
||
var GoogleScholar = ''
|
||
if ((Math.round(Date.parse(new Date()) / 1000) - j_artc.ctime) / 86400 >= 21) {
|
||
GoogleScholar =
|
||
`<a href="https://scholar.google.com/scholar?&q=${j_artc.title.replace('<i>', '').replace('</i>', '').replace(new RegExp('"', "g"), '')}" target="_blank" style="color:#525252;font-weight: 600;">Google Scholar</a>`
|
||
}
|
||
// var lnk_ = '';
|
||
// if (j_artc.file_pdf != '') {
|
||
// lnk_ += '<img src="img/link_3.jpg" width="14" height="16" style="vertical-align: middle;"><a href="' + imgFileUrl + 'articlePDF/' + j_artc.file_pdf + '" target="_blank" class="txt_pdf"> PDF</a> '
|
||
// }
|
||
|
||
// if (j_artc.file_html != '') {
|
||
// lnk_ += ' <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"> HTML</a>'
|
||
// }
|
||
|
||
// if (j_artc.article_id == '172') {
|
||
// lnk_ += ' <a href="https://youtu.be/3eDbnHRkFKQ" target="_blank"><img src="img/link_5.png" width="50" height="16" style="margin-left: 10px"></a>'
|
||
// }
|
||
var NotTeX_ = ''
|
||
if (j_artc.bibtex != '') {
|
||
NotTeX_ += '<a href="' + apiUrl + 'public/bibTex/' + j_artc.bibtex + '" style="color: #7a2702;" target="_blank">BibTeX</a>'
|
||
}
|
||
var Abstractingcontent = `<div style="width:320px;margin:0;margin-top:15px;padding-bottom:10px"><p style="font-size: 14px;padding-left:0;
|
||
color: #666;margin-bottom:0;
|
||
line-height: 24px;">${data.cite}</p>
|
||
<div style="margin-top:4px;">${GoogleScholar}</div>
|
||
<div class="Note_TeX">
|
||
${NotTeX_}
|
||
</div>
|
||
|
||
<ul class="export" style="padding:0;margin-top:10px;">
|
||
<li class="Exc_2" style="margin-bottom:10px;color:#3573bc"><i class="fa fa-download"></i> Export citation to EndNote</li>
|
||
<li class="Exc_3" style="margin-bottom:10px;color:#3573bc"><i class="fa fa-download"></i> Export citation to RIS</li>
|
||
<li class="Exc_4" style="margin-bottom:10px;color:#3573bc"><i class="fa fa-download"></i> Export citation to BibTex</li>
|
||
<li class="Exc_5" style="margin-bottom:10px;color:#3573bc"><i class="fa fa-download"></i> Export citation to txt</li>
|
||
</ul>
|
||
</div>
|
||
`
|
||
document.querySelector('#common-popup .common-popup-content').classList.add('whitebg');
|
||
showPopup(`<span style="font-weight:bold;color:${Journals_color}">Cite this article</span>`, Abstractingcontent)
|
||
document.getElementById('common-popup').style.width = 'auto';
|
||
document.getElementById('common-popup').style.setProperty('min-height', 'auto', 'important');
|
||
// 点击复制和下载
|
||
$('.Exc_2').click(function () {
|
||
$.ajax({
|
||
type: 'post', url: apiUrl + 'api/Article/getArticleenw', async: false,
|
||
data: { "article_id": a_ID },
|
||
success: function (result) {
|
||
var a = document.createElement('a');
|
||
a.href = result.data.url;
|
||
a.download = ''
|
||
a.click();
|
||
}
|
||
})
|
||
})
|
||
$('.Exc_3').click(function () {
|
||
$.ajax({
|
||
type: 'post', url: apiUrl + 'api/Article/getArticleRis', async: false,
|
||
data: { "article_id": a_ID },
|
||
success: function (result) {
|
||
var a = document.createElement('a');
|
||
a.href = result.data.url;
|
||
a.download = ''
|
||
a.click();
|
||
}
|
||
})
|
||
})
|
||
$('.Exc_4').click(function () {
|
||
var ecx_id = $(this).parents('.links_').siblings('.txt_biaoti').attr('id')
|
||
$.ajax({
|
||
type: 'post', url: apiUrl + 'api/Article/getArticlebib', async: false,
|
||
data: { "article_id": a_ID },
|
||
success: function (result) {
|
||
var a = document.createElement('a');
|
||
a.href = result.data.url;
|
||
a.download = ''
|
||
a.click();
|
||
}
|
||
})
|
||
})
|
||
$('.Exc_5').click(function () {
|
||
$.ajax({
|
||
type: 'post', url: apiUrl + 'api/Article/getArticletext', async: false,
|
||
data: { "article_id": a_ID },
|
||
success: function (result) {
|
||
var a = document.createElement('a');
|
||
a.href = result.data.url;
|
||
a.download = ''
|
||
a.click();
|
||
}
|
||
})
|
||
})
|
||
|
||
|
||
|
||
|
||
|
||
// 5秒后自动关闭
|
||
// setTimeout(closePopup, 5000);
|
||
}
|
||
function openAuthorship(Jour_num, Journals_color) {
|
||
|
||
var Abstractingcontent = `
|
||
<div class="tmr_side_map AuthorshipInfo" style="
|
||
width:300px;margin-top:20px">
|
||
<div id="worldMap" style="width: 100%;height: 140px;margin: 0 auto 10px auto"></div>
|
||
<ul class="map_paiming" style="padding: 0 20px 10px 20px;"></ul>
|
||
</div>
|
||
</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')
|
||
|
||
|
||
|
||
|
||
// 5秒后自动关闭
|
||
// setTimeout(closePopup, 5000);
|
||
}
|
||
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';
|
||
if (type == 'Authorship') {
|
||
document.getElementById('common-popup').style.width = 'auto';
|
||
renderMap(190)
|
||
}
|
||
|
||
document.getElementById('common-popup').style.opacity = '1';
|
||
document.getElementById('common-overlay').style.zIndex = '1000';
|
||
document.getElementById('common-popup').style.zIndex = '1001';
|
||
|
||
// 5秒后自动关闭
|
||
// setTimeout(closePopup, 5000);
|
||
}
|
||
|
||
function closePopup() {
|
||
document.getElementById('common-popup').style.opacity = '0';
|
||
document.getElementById('common-popup').style.zIndex = '-1';
|
||
setTimeout(function () {
|
||
document.getElementById('common-overlay').style.display = 'none';
|
||
$('#common-popup .common-popup-title').html('')
|
||
$('#common-popup .common-popup-content').html('')
|
||
}, 50);
|
||
} |