Files
journal_com/js/gue_cont_v1.js
2025-09-28 18:00:16 +08:00

1089 lines
47 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var Journals_color = '#006699'
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 = `
.article{
padding-top:0 !important;
}
.whitebg>div p{
margin-bottom:0px !important;
}
.article .art_main{
width: 100%;
}
.guest_content{
padding:0;
}
.gue_content{
width: 100%;
margin-left:0;
}
.jour_base_info{
padding:10px !important;
border:none !important;
background-color: #f4fafd;
padding-bottom: 0px !important;
}
.gue_title{
color: #222;
font-weight: bold;
font-family: "Helvetica Neue", Helvetica, Georgia, sans-serif;
font-size: 20px;
}
.short-content-1 {
max-height: 120px;
display: -webkit-box;
-webkit-line-clamp: 5; /* 设置显示的行数 */
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
.short-content-2 {
max-height: 174px;
display: -webkit-box;
-webkit-line-clamp: 7; /* 设置显示的行数 */
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
.guest_content h3{
margin-top: 0 !important;
}
.jour_base_info .guest_content{
width: calc(100% - 230px);
padding-left: 20px !important;
}
.jour_base_info .gue_content{
margin-bottom:0px !important;
}
.back_fff .guest_content{
padding:15px 10px !important;
padding-top:0 !important;
}
.Submission_information span:hover{
text-decoration: underline;
cursor: pointer;
}
.jour_base_info_center{
margin: 0 !important;
padding: 10px !important;
background-color: #fff;
align-items: flex-start;
}
.whitebg .qk_img{
width:230px !important;
height:290px !important;
margin-bottom: 0px !important;
}
.gue_editor{
padding:0px !important;
margin:0px !important;
margin-top:0px !important;
display: flex;
align-items: center;
justify-content: space-around;
}
.mb_aform{
display:none;
}
.pos_ter{
padding:10px;
}
.pos_ter>div:nth-child(1) {
width: 25%;
}
.pos_ter>a {
width: 23%;
}
.pos_ter>div:nth-child(3) {
width: 23%;
}
.pos_ter>div:nth-child(4) {
width: 23%;
}
.whitebg #abstract-content p{
padding-left:0 !important;
}
.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 guest_title() {
var special_id = '';
// 获取地址栏信息
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 Gu_Num = getQueryString('Gu_num'); //客座信息
var Jour_num = getQueryString('J_num'); //
// 相关期刊,过往分期
$.ajax({
type: 'post', url: apiUrl + 'api/Journal/getJournal',
data: {
"journal_id": Jour_num
},
success: function (result) {
console.log('result at line 194:', result)
if (result.code == 0) {
Journals_color = result.data.journal.system_color
$('.border_title').css({
'border-bottom': `1px solid ${Journals_color}`,
})
$('.border_title_top').css({
'border-top': `3px solid ${Journals_color}`,
})
$('.article_info_box .tradition-box .tradition-text .article_info_Highlights').css({
'color': `${Journals_color} !important`,
})
//
// initJournalBaseInfo(result)
}
}
})
$.ajax({
type: 'post', url: apiUrl + 'subscribe/Special/getSpecialDetail',
data: { 'journal_special_id': Gu_Num },
success: function (result) {
if (result.code == 0) {
var edit = result.data.editors;
var spe = result.data.special;
var jour = result.data.journal;
var keyw = result.data.keywords;
special_id = spe.journal_special_id
// 客座文章内容
var ISSNDirection = 'left';
var ISSNColor = '#7a2702';
var ISSNBottom = '6px';
if ([14, 11, 17].includes(Number(Jour_num))) {
ISSNDirection = 'right'
ISSNColor = '#e9e9e9'
}
else if ([18].includes(Number(Jour_num))) {
ISSNDirection = 'right'
ISSNColor = '#fff'
} else
//hpm
if ([8].includes(Number(Jour_num))) {
ISSNDirection = 'right'
ISSNColor = '#333'
ISSNBottom = '4px'
} else if ([2].includes(Number(Jour_num))) {
ISSNColor = '#e9e9e9'
} else if ([4].includes(Number(Jour_num))) {
ISSNColor = '#fff'
}
var leftStr = `
<a href="javascript:void(0);" class="qk_img">
<img src="${imgjourUrl + spe.icon}"alt="">
</a>
`
$('.jour_base_info .jour_base_info_center .jour_base_info_center_left').html(leftStr);
if (Jour_num == '22') {
$('.gue_title').html(spe.title + '专刊');
$('.gue_editor_title').html('专刊编辑');
$('.gue_Infor_title').html('专刊征稿通知');
$('.gue_word_title').html('关键词');
$('.gue_system>a').html('提交稿件');
$('.gue_author>a').html('客座编辑申请');
var g_c = '<a target="_blank" href="/' + jour.usx + '">' + jour.title + '</a> ' +
'(ISSN ' + jour.issn + '). ' +
'<br/>投稿截止日期: ' + spe.deadline.substring(0, 4) + '.' + spe.deadline.substring(5, 7) + '.' + spe.deadline.substring(8, 10);
} else {
if (spe.deadline.substring(5, 7) == '01') {
var data_month = 'Jan'
}
if (spe.deadline.substring(5, 7) == '02') {
var data_month = 'Feb'
}
if (spe.deadline.substring(5, 7) == '03') {
var data_month = 'Mar'
}
if (spe.deadline.substring(5, 7) == '04') {
var data_month = 'Apr'
}
if (spe.deadline.substring(5, 7) == '05') {
var data_month = 'May'
}
if (spe.deadline.substring(5, 7) == '06') {
var data_month = 'Jun'
}
if (spe.deadline.substring(5, 7) == '07') {
var data_month = 'Jul'
}
if (spe.deadline.substring(5, 7) == '08') {
var data_month = 'Aug'
}
if (spe.deadline.substring(5, 7) == '09') {
var data_month = 'Sep'
}
if (spe.deadline.substring(5, 7) == '10') {
var data_month = 'Oct'
}
if (spe.deadline.substring(5, 7) == '11') {
var data_month = 'Nov'
}
if (spe.deadline.substring(5, 7) == '12') {
var data_month = 'Dec'
}
$('.guest_content h3 .gue_title').html(`<span style="font-size: 24px;font-weight: bold;">${spe.title}</span>`);
var url = ''
if ($.cookie("username") != undefined && $.cookie("user_id") != undefined) {
url = 'contribu_list.html?J_num=' + Jour_num + '&&special_id=' + spe.journal_special_id;
} else {
url = 'contribu_login.html?J_num=' + Jour_num + '&&special_id=' + spe.journal_special_id;
}
var g_c = `
<div><span style="color:#7a2702;font-size: 15px;font-weight: bold;">Submission deadline: </span><span style="color: '">${spe.deadline.substring(8, 10)} ${data_month} ${spe.deadline.substring(0, 4)}</span></div>
<div class="Submission_information "><span style="color:#7a2702;font-size: 15px;font-weight: bold;">Submission information: </span><span style="color:${Journals_color}">
<i class="fa fa-upload" style="font-size: 15px;font-weight: bolder;"></i>
</span></div>
<div class="Guest_Editor"><span style="color:#7a2702;font-size: 15px;font-weight: bold;">Special issue Information: </span></div>
<div class="short-content-2 " id="abstract-content" style="line-height: 22px;
color: #888;
text-align: justify;">
${spe.abstract}<div class="gue_word" style="margin-left:0;margin-bottom:0px;"></div>
</div>
<div class="toggle-btn1" style="color: ${Journals_color};font-size: 12px;"
data-id="abstract" >Show more ▼</div>
`;
}
$('.gue_content .gue_content_top').html(g_c);
// 循环外添加事件监听器(事件委托)
document.addEventListener('click', function (e) {
// 检查点击的是否是切换按钮
if (e.target.classList.contains('toggle-btn1')) {
const btn = e.target;
const detail = document.getElementById(`abstract-content`);
const isShown = detail.classList.toggle('short-content-2');
btn.innerText = isShown
? 'Show more ▼'
: 'Show less ▲';
}
});
var str = '';
for (var i = 0; i < keyw.length; i++) {
str += keyw[i] + '&nbsp;&nbsp;&nbsp;'
}
$('.gue_word').html(`<span style="color:#444;font-weight:700;">Keywords</span> : ${str}`);
// 判断按钮是否要隐藏
if (spe.deadline.substring(0, 4) < 2022) {
$('.gue_system').css('display', 'none');
$('.gue_author').css('display', 'none');
$('.Submission_information').css('display', 'none');
}
$('.Submission_information').click(function () {
// 判断是否有身份
if ($.cookie("username") != undefined && $.cookie("user_id") != undefined) {
window.open('contribu_list.html?J_num=' + Jour_num + '&&special_id=' + spe.journal_special_id);
} else {
window.open('contribu_login.html?J_num=' + Jour_num + '&&special_id=' + spe.journal_special_id);
}
})
$('.gue_content a').css('color', Journals_color);
// $('.jour_base_info_center').css('border-color', Journals_color);
var str = '';
for (let i in edit) {
if (edit[i].interests == '') {
var int_ = ''
} else {
var int_ = edit[i].interests
}
if (edit[i].email == '') {
var email_ = ''
} else {
var email_ = edit[i].email
}
if (edit[i].orcid == '') {
var or_cid = ''
} else {
var or_cid = '<a href="https://orcid.org/' + edit[i].orcid + '" target="_blank" style="margin-left: 5px;">' +
'<img src="img/or_id.png" style="width: 13px;"></a>'
}
str += `
<div style="width:100%;display: flex;align-items: flex-start;justify-content: space-between;margin-top:20px;">
<div style="width:140px;">
<div style="display: flex;justify-content: center;">
${edit[i].icon ? `<img src="${imgFileUrl + edit[i].icon}"
style="border:0;width: 115px;height: 120px;border-radius: 20px;margin:0 auto" />`: `<div
style="border:0;width: 115px;height: 120px;border-radius: 20px;margin:0 auto;background-color: #f0f0f0b5;">
</div>`}
</div>
<div style="display:flex;justify-content: center;margin-top:2px;">
<span style="font-weight:700;color:${Journals_color};font-size: 14px;"
class="author-name"
data-website="${edit[i].website}">
${edit[i].first_name} ${edit[i].last_name}
</span>
</div>
</div>
<!-- 可展开/折叠的内容 -->
<div style="width: calc(100% - 150px);">
<div style="padding-right:20px;position: relative;box-sizing:border-box;">
<div class="short-content-1 " id="editor-${i}-content">
<div><span style="font-weight: bold;">Introduction: </span>
</div>
<div style="color:#888;">${edit[i].address}</div>
</div> <span class="toggle-btn" style="position: absolute;right: 0;bottom: 0;margin-top:0;"
data-editor-id="editor-${i}">▼</span>
</div>
<div><span style="font-weight: bold;">Interests: </span>${int_}</div>
<div><span style="font-weight: bold;">Email: </span>${email_}</div>
</div>
</div>
`
}
$('.guest_content_info').html(`
<h3 class="rgb_color" style="line-height:22px;margin-bottom:8px;border-top: 1px solid #f1f1f1;padding-top:18px">
<b class="gue_title" style="color:${Journals_color}">${Jour_num == '22' ? '客座编辑' : 'Guest Editor'}</b>
</h3>
<div class="Guest_Editor_box" style="">${str}</div>
`);
$('.author-name').click(function () {
// 通过当前元素获取对应的website
const website = $(this).data('website');
if (website && website !== '') {
window.open(website);
}
});
// 循环外添加事件监听器(事件委托)
document.addEventListener('click', function (e) {
// 检查点击的是否是切换按钮
if (e.target.classList.contains('toggle-btn')) {
const btn = e.target;
const editorId = btn.getAttribute('data-editor-id');
const detail = document.getElementById(`${editorId}-content`);
const isShown = detail.classList.toggle('short-content-1');
btn.innerText = isShown
? '▼'
: '▲';
}
});
} else {
ShowDanger("请求失败!");
}
},
error: function () {
ShowDanger("error");
}
})
$.ajax({
type: 'post', url: apiUrl + 'subscribe/Special/getSpecialArticles',
data: {
"journal_special_id": Gu_Num
},
success: function (result) {
if (result.code == 0) {
var arr = result.data.articles;
var str = "";
var sth = "";
var stj = "";
if (arr.length > 0) {
const ulElement = document.getElementsByClassName('current_list')[0];
// 创建要插入的新标签(这里以 div 为例)
const newElement = document.createElement('div');
newElement.className = 'inserted-content'; // 可以添加类名
newElement.innerHTML = `
<h3 class="rgb_color" style="line-height:22px;margin-bottom:0px;border-top: 1px solid ${Journals_color};padding-top:12px">
<b class="gue_title" style="color:${Journals_color}">Published Articles</b>
</h3>
`;
// 在 ul 前面插入新元素
ulElement.parentNode.insertBefore(newElement, ulElement);
}
for (var i = 0; i < arr.length; i++) {
if (arr[i].doi == '') {
var doi_ = ''
} else {
var doi_ = 'https://doi.org/' + arr[i].doi
}
if (arr[i].npp == '') {
var npp_ = ''
} else {
var npp_ = ':&nbsp;' + arr[i].npp + '.&nbsp;&nbsp;'
}
if (arr[i].has_html == 0) {
if (arr[i].file_html == '') {
var html_ = ''
} else {
var html_ = '<img src="img/link_2.png" width="14" height="16"><a href="' + imgFileUrl + 'articleHTML/' + arr[i].file_html + '" target="_blank" class="txt_html" alt="' + arr[i].article_id + '">HTML</a>&nbsp;(&nbsp;<span style="color: red">' + arr[i].html_num + '</span>&nbsp;)&nbsp;&nbsp;'
}
} else {
var html_ = '<img src="img/link_2.png" width="14" height="16"><a href="article.html?J_num=' + Jour_num + '&a_id=' + arr[i].article_id + '&s_htm=1" target="_blank" class="txt_html" alt="' + arr[i].article_id + '">HTML</a>&nbsp;(&nbsp;<span style="color: red">' + arr[i].html_num + '</span>&nbsp;)&nbsp;&nbsp;'
}
if (arr[i].file_pdf == '') {
var pdf_ = ''
} else {
var pdf_ = '<img src="img/link_3.jpg" width="14" height="16"><a href="' + imgFileUrl + 'articlePDF/' + arr[i].file_pdf + '" target="_blank" class="txt_pdf" alt="' + arr[i].article_id + '">PDF</a>&nbsp;(&nbsp;<span style="color: red">' + arr[i].pdf_num + '</span>&nbsp;)'
}
if (arr[i].cite_num == 0) {
var cite_ = ''
} else {
var cite_ = `<span article_id="${arr[i].article_id}" class="cite_box" style="color: #7a2702;"> <img src="img/link_6.jpg" width="14" height="16">WOS Citations&nbsp;(&nbsp;<span style="color: red">${arr[i].cite_num} </span>&nbsp;)
<ul class="export_cite "> </ul></span>`
}
if ((Math.round(Date.parse(new Date()) / 1000) - arr[i].ctime) / 86400 >= 21) {
var tong_geogle = '<a href = "https://scholar.google.com/scholar?&q=' + arr[i].title.replace('<i>', '').replace('</i>', '').replace(new RegExp('"', "g"), '') + '"' +
'target = "_blank" style="color:#006699;margin-left: 10px;font-weight: 600;"> ' +
'Google Scholar</a>' //搜索引用次数
} else {
var tong_geogle = '' //少于21天隐藏
}
if ((Math.round(Date.parse(new Date()) / 1000) - arr[i].ctime) / 86400 >= 21) {
var tong_geogle_2_1 = '<a href = "https://scholar.google.com/scholar?&q=' + arr[i].title.replace('<i>', '').replace('</i>', '').replace(new RegExp('"', "g"), '') + '"' +
'target = "_blank" style="color: ' + localStorage.Journals_color + ';margin:5px 31px 0 0;font-weight: 600;display: inline-block;"> ' +
'Google Scholar</a>' //搜索引用次数
} else {
var tong_geogle_2_1 = '' //少于21天隐藏
}
if ((Math.round(Date.parse(new Date()) / 1000) - arr[i].ctime) / 86400 >= 21) {
var tong_geogle_2_2 = '<a href = "https://scholar.google.com/scholar?&q=' + arr[i].title.replace('<i>', '').replace('</i>', '').replace(new RegExp('"', "g"), '') + '"' +
'target = "_blank" style="color: #7a2702;margin:5px 37px 0 0;font-weight: 600;display: inline-block;"> ' +
'Google Scholar</a>' //搜索引用次数
} else {
var tong_geogle_2_2 = '' //少于21天隐藏
}
if (arr[i].article_id == '172') {
var mp4_ = '<a href="https://youtu.be/3eDbnHRkFKQ" target="_blank"><img src="img/link_5.png" width="50" height="16" style="margin-left: 10px"></a>'
} else {
var mp4_ = ''
}
if (arr[i].icon == '') {
var img_i = ''
} else {
var img_i = imgarticleUrl + arr[i].icon
}
if (arr[i].other_state == 0) {
var otStat = ''
} else if (arr[i].other_state == 1) {
var otStat = '<span class="otStat">Editorial Expression of Concern</span>'
} else if (arr[i].other_state == 2) {
var otStat = '<span class="otStat">Retracted</span>'
}
if (arr[i].article_id == '86' || arr[i].article_id == '176' || arr[i].article_id == '455' || arr[i].article_id == '400' || arr[i].article_id == '145' || arr[i].article_id == '116' || arr[i].article_id == '717' || arr[i].article_id == '632' || arr[i].article_id == '24') {
var person_img = '<img src="' + img_i + '" alt="" style="width: 120px">'
var person_img1 = '<img src="' + img_i + '" alt="" style="width: 120px">'
} else {
var person_img = '<img src="' + img_i + '" alt="" style="height:300px;object-fit: cover;">'
if (img_i && img_i != '') {
var person_img1 = '<div style="height: 220px;background-image: url(' + img_i + ');background-size:cover;background-position:top;background-repeat:no-repeat;"></div>'
} else {
var person_img1 = '<div style="height: auto;background-image: url(' + img_i + ');background-size:cover;background-position:top;background-repeat:no-repeat;"></div>'
}
}
arr[i].abstract = arr[i].abstract.replace(new RegExp("0, 102, 204", "g"), "0,102,153")
var c_t_a = '<button class="txt_copy cite_txt_button">&nbsp;<img src="img/link_7.jpg" width="14" height="16">Cite this article<ul class="export"><li id="txt_copy_' + i + '" class="Exc_1">>> Copy citation information</li><li class="Exc_2"><i class="fa fa-download"></i> Export citation to EndNote</li><li class="Exc_3"><i class="fa fa-download"></i> Export citation to RIS</li><li class="Exc_4"><i class="fa fa-download"></i> Export citation to BibTex</li><li class="Exc_5"><i class="fa fa-download"></i> Export citation to txt</li><div class="triangle"></div></ul></button>'
var link_ = '<img src="img/link_1.png" width="14" height="16"><a class="txt_zhaiyao" alt="' + arr[i].article_id + '">Abstract</a>&nbsp;(&nbsp;<span style="color: red">' + arr[i].abs_num + '</span>&nbsp;)&nbsp;&nbsp;&nbsp;' +
html_ + pdf_ + mp4_ + c_t_a + cite_ + tong_geogle
+ '<p class="txt_content">' + arr[i].cite + '</p><div>' + arr[i].abstract + '</div>';
var lr_top = ''
if (arr[i].topic && arr[i].topic.length > 0) {
for (var t = 0; t < arr[i].topic.length; t++) {
lr_top += '<a href="topic_list.html?J_num=' + Jour_num + '&t_id=' + arr[i].topic[t].journal_topic_id + '" target="_blank">' + arr[i].topic[t].title + '</a>'
}
}
var trad_tion = '';
var maxTradHeight = 220; // 设置最大高度
if (Jour_num == 1) {
if (arr[i].tradition_tag == '') {
} else {
var traditionText = arr[i].tradition;
trad_tion = `<div class="tradition-box" style="width:100%;height:auto;line-height:20px;overflow:hidden;">
<div class="tradition-text">${arr[i].tradition_tag}: ${traditionText}</div>
</div>`;
setTimeout(() => {
let traditionElement = document.querySelector('.tradition-text:last-of-type');
if (traditionElement && traditionElement.scrollHeight > maxTradHeight) {
let words = traditionText.split(" ");
let truncatedText = "";
for (let j = 0; j < words.length; j++) {
truncatedText += words[j] + " ";
traditionElement.innerText = truncatedText + "...";
if (traditionElement.scrollHeight > maxTradHeight) {
truncatedText = truncatedText.trim().split(" ").slice(0, -1).join(" ");
traditionElement.innerText = truncatedText + " ...";
break;
}
}
}
}, 100); // 确保 DOM 渲染完成
}
} else {
if (arr[i].tradition_tag == '' || arr[i].tradition_tag == null) {
var textContent = arr[i].abstract;
} else {
var textContent = '<b style="color: ' + Journals_color + '">' + arr[i].tradition_tag + ':</b> ' + arr[i].tradition;
}
trad_tion = `<div class="tradition-box" style="width:100%; max-height:${maxTradHeight}px; line-height:20px; overflow:hidden;">
<div class="tradition-text">${textContent}</div>
</div>`;
}
{/* <br clear="both"></br> */ }
str += `<li>
<div class="dbt_header">
${arr[i].type}
<div class="url_top">${lr_top}</div>
</div>
<div class="apwrap" style="display: grid;grid-template-columns: 370px 1fr;">
<a onclick="imgbig1(this)" class="imgdiv" style="width:100%" >${person_img1}</a>
<div class="article_info_box" style="box-sizing:border-box;padding-right:4px !important;">
<a id="${arr[i].article_id}" target="_blank" href="article.html?J_num=${Jour_num}&a_id=${arr[i].article_id}" style="font-size:18px;" class="txt_biaoti">
${otStat}${arr[i].title}</a>
<div class="authorList"><span class="fo_fam">${processAuthors(arr[i].authortitle)}</span><br/></div>
<div class="links_">${link_}</div>
${trad_tion}
</div>
</div>
</li>`
}
$('.current_list>ul').html(str);
const style = document.createElement('style');
style.innerHTML = `/* 遮罩层 */
.article_box .current_list ul li{
border-bottom:1px solid ${Journals_color} !important;
padding-right:0 !important;
}
.article_box .article{
padding-bottom:0 !important;
}
.article_box ul li:last-child {
border-bottom: none !important;
}
`;
document.head.appendChild(style);
$('.links_ .txt_copy').css('background', localStorage.Journals_color);
$('.url_top a').css('margin-right', '0');
$(".current_list ul>li .apwrap>div>div>p").each(function () {
var maxwidth = 335;//显示多少字符
if ($(this).text().length > maxwidth) {
$(this).text($(this).text().substring(0, maxwidth));
$(this).text($(this).text().substring(0, maxwidth - $(this).text().split(" ").pop().length));
$(this).html($(this).html() + '...');
}
});
$(".current_list ul li.pai_two .apwrap>div>div>p").each(function () {
var maxwidth = 140;//显示多少字符
if ($(this).text().length > maxwidth) {
$(this).text($(this).text().substring(0, maxwidth));
$(this).text($(this).text().substring(0, maxwidth - $(this).text().split(" ").pop().length));
$(this).html($(this).html() + '...');
}
});
// 点击read more效果
// $('.current_list li .apwrap>div>b').click(function () {
// if($(this).html()=='read more <i class="fa fa-long-arrow-down"></i>'){
// $(this).siblings('div').css('display', 'block');
// $(this).html('read more <i class="fa fa-long-arrow-up"></i>');
// }else{
// $(this).siblings('div').css('display', '-webkit-box');
// $(this).html('read more <i class="fa fa-long-arrow-down"></i>')
// }
// })
// 点击Abstract显示隐藏
$('.current_list .txt_zhaiyao').click(function () {
$(this).nextAll('div').toggle();
if ($(this).nextAll('div').css("display") == 'block') {
var num = $(this).next().html();
$.ajax({
type: 'post', url: apiUrl + 'yuan/Article/addArticleNum', async: false,
data: { "article_id": $(this).attr('alt'), "type": 'abs' },
success: function (result) {
if (result.code == 0) {
num = num * 1 + 1 * 1
}
}
})
$.ajax({
type: 'post', url: apiUrl + 'super/Publish/addVisitNum',
data: { 'type': Jour_num, 'is_detail': '1' },
success: function (result) {
}
});
$(this).next().html(num);
}
})
$('.current_list .txt_html').click(function () {
var num = $(this).next().html();
$.ajax({
type: 'post', url: apiUrl + 'yuan/Article/addArticleNum', async: false,
data: { "article_id": $(this).attr('alt'), "type": 'html' },
success: function (result) {
if (result.code == 0) {
num = num * 1 + 1 * 1
}
}
})
$.ajax({
type: 'post', url: apiUrl + 'super/Publish/addVisitNum',
data: { 'type': Jour_num, 'is_detail': '1' },
success: function (result) {
}
});
$(this).next().html(num);
})
$('.current_list .txt_pdf').click(function () {
var num = $(this).next().html();
$.ajax({
type: 'post', url: apiUrl + 'yuan/Article/addArticleNum', async: false,
data: { "article_id": $(this).attr('alt'), "type": 'pdf' },
success: function (result) {
if (result.code == 0) {
num = num * 1 + 1 * 1
}
}
})
$.ajax({
type: 'post', url: apiUrl + 'super/Publish/addVisitNum',
data: { 'type': Jour_num, 'is_detail': '1' },
success: function (result) {
}
});
$(this).next().html(num);
})
$('.current_list .export_cite').css('display', 'none');
$(document).click(function (e) {
if (!$(e.target).is('.export_cite') && !$(e.target).is('.cite_box')) {
$('.export_cite').hide();
}
})
$('.current_list .cite_box').click(function () {
$('.export_cite').css('display', 'none');
getCiteList($(this).attr('article_id'))
$(this).find('.export_cite').fadeIn(200);
})
$('.export_cite').click(function (e) { e.stopPropagation() })
// 点击弹窗出现 复制和下载
$('.current_list .txt_content').css('display', 'none');
$('.current_list .export').css('display', 'none');
$(document).click(function (e) {
if (!$(e.target).is('.export') && !$(e.target).is('.txt_copy')) {
$('.export').hide();
}
})
$('.current_list .txt_copy').click(function () {
$('.export').css('display', 'none');
$(this).find('.export').fadeIn(200);
})
$('.current_list .Exc_1').click(function () {
var content_ = $(this).parents('.txt_copy').nextAll('.txt_content').text();
var clipboard = new Clipboard('#' + $(this).attr('id'), {
text: function () {
return content_;
}
})
clipboard.on('success', function (e) {
ShowSuccess("Citation information has been copied!");
});
})
$('.current_list .Exc_2').click(function () {
var ecx_id = $(this).parents('.links_').siblings('.txt_biaoti').attr('id')
$.ajax({
type: 'post', url: apiUrl + 'api/Article/getArticleenw', async: false,
data: { "article_id": ecx_id },
success: function (result) {
var a = document.createElement('a');
a.href = result.data.url;
a.download = ''
a.click();
}
})
})
$('.current_list .Exc_3').click(function () {
var ecx_id = $(this).parents('.links_').siblings('.txt_biaoti').attr('id')
$.ajax({
type: 'post', url: apiUrl + 'api/Article/getArticleRis', async: false,
data: { "article_id": ecx_id },
success: function (result) {
var a = document.createElement('a');
a.href = result.data.url;
a.download = ''
a.click();
}
})
})
$('.current_list .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": ecx_id },
success: function (result) {
var a = document.createElement('a');
a.href = result.data.url;
a.download = ''
a.click();
}
})
})
$('.current_list .Exc_5').click(function () {
var ecx_id = $(this).parents('.links_').siblings('.txt_biaoti').attr('id')
$.ajax({
type: 'post', url: apiUrl + 'api/Article/getArticletext', async: false,
data: { "article_id": ecx_id },
success: function (result) {
var a = document.createElement('a');
a.href = result.data.url;
a.download = ''
a.click();
}
})
})
// 订阅期刊
$('.top .top_sea .b_Sub').css('color', localStorage.Journals_color)
$('.top .top_sea .search_for select').css('border-color', localStorage.Journals_color)
$('.top .dingyue input.yue_add').css('background-color', localStorage.Journals_color);
$('.top .dingyue p b').html(localStorage.Journals_title);
$('.top .jour_ts input.tishi_author').css('background-color', localStorage.Journals_color);
// 添加订阅按钮点击弹出
// $('.top .top_sea .b_Sub').click(function () {
// $("#mask").css("height",$(document).height());
// $("#mask").css("width",$(document).width());
// $("#mask").show();
// $(".dingyue").fadeIn();
// document.body.addEventListener('touchmove',bodyScroll,false);
// $('body').css({'position':'fixed',"width":"100%"});
// })
$(".top .dingyue .mb_close").click(function () {
$("#mask").hide();
$(".dingyue").fadeOut();
document.body.removeEventListener('touchmove', bodyScroll, false);
$("body").css({ "position": "initial", "height": "auto" });
});
$(".top .dingyue input.yue_close").click(function () {
$("#mask").hide();
$(".dingyue").fadeOut();
document.body.removeEventListener('touchmove', bodyScroll, false);
$("body").css({ "position": "initial", "height": "auto" });
});
$(".top .jour_ts input.tishi_author").click(function () {
$("#mask").hide();
$(".jour_ts").fadeOut();
document.body.removeEventListener('touchmove', bodyScroll, false);
$("body").css({ "position": "initial", "height": "auto" });
});
function bodyScroll(event) {
event.preventDefault();
}
// 订阅提交
$(".yue_add").click(function () {
$(".spa").text('');
var add_mess = {};
add_mess.journal_id = localStorage.Journals_num;
add_mess.email = $('#emapl').val();
var S_Dan = '0';
var reg = /^[-.-_A-Za-z0-9]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/
if ($("#emapl").val() == "") {
$(".spa1").text('Please fill in E-mail');
S_Dan = '1';
} else if (!(reg.test($("#emapl").val()))) {
$(".spa1").text('Please fill in properly formatted E-mail');
S_Dan = '1';
}
if (S_Dan == '1') {
ShowDanger("Incomplete information");
} else {
$(".yue_add").addClass("disable");
$.ajax({
type: 'post', url: apiUrl + 'subscribe/Journal/addSubscribeJournal',
data: add_mess,
success: function (result) {
if (result.code == 0) {
$(".dingyue").fadeOut();
$(".dingyue input[type='text']").val('');
$(".yue_add").removeClass("disable");
$(".jour_ts").fadeIn();
} else {
ShowDanger(result.msg);
$(".yue_add").removeClass("disable");
}
},
error: function () {
ShowDanger("error");
$(".yue_add").removeClass("disable");
}
})
}
})
} else {
// ShowDanger("请求失败!");
}
},
error: function () {
ShowDanger("error");
}
})
}
function processAuthors(authors) {
var authorArray = authors.split(","); // 将作者按逗号分割为数组
if (authorArray.length > 6) {
return authorArray.slice(0, 3).join(", ") + ", et al"; // 如果超过6个作者显示前三个并加上 "et al."
} else {
return authorArray.join(", "); // 如果6个或更少作者直接显示所有
}
}
function initJournalBaseInfo(result) {
//头部左侧期刊信息issn+img
var arr_jour = result.data.journal;
console.log('arr_jour at line 1409:', arr_jour)
//是否显示地图
//头部左侧期刊其他信息
// $('.jour_base_info .jour_base_info_center .mes_all .mes_all_section').html();
// setTimeout(() => {
// if (window.__sharethis__) {
// __sharethis__.initialize();
// }
// }, 50)
// $('#st-2 .st-btn > img').css({
// 'top': '0 !important'
// })
}
// 列表
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 picPreview(src) {
console.log(src)
$('.PicPreview img').attr('src', src)
$('.PicPreview').show()
}
$('.PicPreview').on('click', function () {
$('.PicPreview').hide()
})
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);
}