tijiao
This commit is contained in:
@@ -7232,7 +7232,7 @@ function article_con() {
|
||||
if (result.code == 0) {
|
||||
var html_type = result.data.articleInfo.html_type
|
||||
var has_html = result.data.articleInfo.has_html
|
||||
if(has_html==0){
|
||||
if (has_html == 0) {
|
||||
$('.wen_rong #tablist .tarhtmn').css('display', 'none');
|
||||
$('.wen_rong #tablist .tarfihml').css('display', 'none');
|
||||
$('.wen_rong .content-box .conthtmn').css('display', 'none');
|
||||
@@ -7610,7 +7610,7 @@ function article_con() {
|
||||
xuhao++;
|
||||
item = "<div><p>" + xuhao + '. ' + 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 + "'>Available at: </a></p></div>";
|
||||
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:"
|
||||
@@ -7631,8 +7631,8 @@ function article_con() {
|
||||
// 将生成的所有引用内容插入到页面中
|
||||
$('.wen_rong .content-box .conthtmn').append('<div id="ArticleRef" class="ArticleRef"><p><b>References</b></p>' + refs + '</div>');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
@@ -7661,90 +7661,87 @@ function article_con() {
|
||||
|
||||
var arr = result.data.mains;
|
||||
var str = '';
|
||||
|
||||
|
||||
|
||||
var htmlContent=''
|
||||
|
||||
var htmlContent = ''
|
||||
|
||||
htmlContent += arr.map((item) => {
|
||||
//批注
|
||||
let contentHtml = '';
|
||||
|
||||
|
||||
// 判断是否是图片
|
||||
if (item.type == 1) {
|
||||
var picsrc = 'https://submission.tmrjournals.com/public/articleImage/' + item.image.url;
|
||||
var fun = "picPreview('" + picsrc + "');"
|
||||
// console.log(fun)
|
||||
|
||||
contentHtml = `
|
||||
|
||||
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
|
||||
justify-content: center;" class="MaxPicture pMain" data-id="${item.ami_id
|
||||
}" main-id="${item.am_id}">
|
||||
|
||||
<img src="${picsrc}" onclick="${fun}" style="width: ${
|
||||
item.width ? `${item.width}px` : '80%'
|
||||
<img src="${picsrc}" onclick="${fun}" style="width: ${item.width ? `${item.width}px` : '80%'
|
||||
}" />
|
||||
<div class="font" style="width: ${item.width ? `${item.width}px` : '100%'};
|
||||
<p class="font" 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 : ''
|
||||
}</div>
|
||||
text-align:center;" >${item.image.note ? item.image.note : ''
|
||||
}</p>
|
||||
</p>
|
||||
`;
|
||||
|
||||
|
||||
} else if (item.type == 2) {
|
||||
var tableList = JSON.parse(item.table.table_data);
|
||||
|
||||
|
||||
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;">
|
||||
<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;">
|
||||
|
||||
<font class="font tableTitle" 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; ">
|
||||
${tableList
|
||||
.map((row,i) => {
|
||||
return `
|
||||
<tr class="${isHeaderRow(i,tableList)?'table-header-row':''}">
|
||||
${row
|
||||
.map((cell) => {
|
||||
.map((row, i) => {
|
||||
return `
|
||||
<tr class="${isHeaderRow(i, tableList) ? 'table-header-row' : ''}">
|
||||
${row
|
||||
.map((cell) => {
|
||||
return `
|
||||
<td colspan="${cell.colspan || 1}" rowspan="${cell.rowspan || 1}">
|
||||
<span style="font-family: 'Charis SIL';">${cell.text || ''}</span>
|
||||
</td>
|
||||
`;
|
||||
})
|
||||
.join('')}
|
||||
})
|
||||
.join('')}
|
||||
</tr>
|
||||
`;
|
||||
})
|
||||
.join('')}
|
||||
})
|
||||
.join('')}
|
||||
</table>
|
||||
<div class="font" style="width: ${item.width ? `${item.width}px` : '100%'};
|
||||
<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:center;" >${
|
||||
item.table.note ? item.table.note : ''
|
||||
}</div>
|
||||
text-align:center;" >${item.table.note ? item.table.note : ''
|
||||
}</p>
|
||||
</div>
|
||||
`;
|
||||
} else {
|
||||
contentHtml = `<p class="${item.is_h1?'Ptitle pMain':'pMain' } " style="font-family: 'Charis SIL';" main-state="${item.state}" contenteditable="false" data-id="${item.am_id}" main-id="${item.am_id}">${item.content}</p>`;
|
||||
item.content
|
||||
console.log('item.content at line 7740:', item.am_id, item.content)
|
||||
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}">${item.content}</p>`;
|
||||
}
|
||||
|
||||
|
||||
// 判断是否是表格类型
|
||||
|
||||
|
||||
return contentHtml;
|
||||
}).join('');
|
||||
htmlContent=`<div class="newHtml2">${htmlContent}</div>`
|
||||
htmlContent = `<div class="newHtml2">${htmlContent}</div>`
|
||||
$('.wen_rong .content-box .conthtmn').html(htmlContent);
|
||||
// 引用
|
||||
if (result.data.refers.length > 0) { // 如果有引用数据
|
||||
@@ -7765,7 +7762,7 @@ var htmlContent=''
|
||||
xuhao++;
|
||||
item = "<div><p>" + xuhao + '. ' + 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 + "'>Available at: </a></p></div>";
|
||||
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:" 链接
|
||||
@@ -7787,7 +7784,7 @@ var htmlContent=''
|
||||
// 将生成的所有引用内容插入到页面中
|
||||
$('.wen_rong .content-box .conthtmn').append('<div id="ArticleRef" class="ArticleRef"><p><b>References</b></p>' + refs + '</div>');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
@@ -8297,15 +8294,15 @@ var htmlContent=''
|
||||
}
|
||||
})
|
||||
}
|
||||
function isHeaderRow(rowIndex,table) {
|
||||
|
||||
|
||||
console.log('table at line 697:', table)
|
||||
var head=table[0]
|
||||
console.log('head at line 699:', head[0].rowspan)
|
||||
|
||||
return rowIndex < head[0].rowspan; // 假设前两行是表头
|
||||
}
|
||||
function isHeaderRow(rowIndex, table) {
|
||||
|
||||
|
||||
console.log('table at line 697:', table)
|
||||
var head = table[0]
|
||||
console.log('head at line 699:', head[0].rowspan)
|
||||
|
||||
return rowIndex < head[0].rowspan; // 假设前两行是表头
|
||||
}
|
||||
// 图片预览
|
||||
function picPreview(src) {
|
||||
console.log(src)
|
||||
|
||||
@@ -209,8 +209,10 @@ function bf_list() {
|
||||
|
||||
if (arr[i].icon == '') {
|
||||
var person_img = ''
|
||||
var person_img1 = ''
|
||||
} else {
|
||||
var person_img = '<a onclick="imgbig(this)" class="imgdiv"><img src="' + imgarticleUrl + arr[i].icon + '"></a>'
|
||||
var person_img = '<a onclick="imgbig(this)" class="imgdiv" ><img style="height:345px;object-fit: cover;" src="' + imgarticleUrl + arr[i].icon + '"></a>'
|
||||
var person_img1 = '<a onclick="imgbig1(this)" class="imgdiv" style="width:100%" ><div style="height: 240px;background-image: url('+imgarticleUrl + arr[i].icon+');background-size:cover;background-position:top;background-repeat:no-repeat;"></div></a>'
|
||||
}
|
||||
|
||||
if (arr[i].journal_id == 22) {
|
||||
@@ -261,36 +263,69 @@ function bf_list() {
|
||||
} else {
|
||||
var trad_tion = '<div><b style="color: ' + localStorage.Journals_color + '">' + arr[i].tradition_tag + ': </b>' + arr[i].tradition + '</div>'
|
||||
}
|
||||
if (i == 0 || i == 1 || i == 2) {
|
||||
|
||||
|
||||
|
||||
if (arr[i].tradition_tag == '' || arr[i].tradition_tag == null) {
|
||||
var textContent = arr[i].abstract;
|
||||
} else {
|
||||
var textContent = '<b style="color: ' + localStorage.Journals_color + '">' + arr[i].tradition_tag + ':</b> ' + arr[i].tradition;
|
||||
}
|
||||
|
||||
var maxHeight = 240; // 最大高度
|
||||
|
||||
trad_tion1 = `<div class="tradition-box" style="width:100%; max-height:${maxHeight}px; line-height:20px; overflow:hidden;">
|
||||
<div class="tradition-text">${textContent}</div>
|
||||
</div>`;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 17 2 18 cancer 整合 护理 都是连续出刊 ,首页都需要改 2025-03-02
|
||||
if (Jour_num == 17 || Jour_num == 2 || Jour_num == 18) {
|
||||
sim_1 += '<li><div class="dbt_header">' + arr[i].type + pub_date
|
||||
+ '<div class="url_top">' + lr_top + '</div></div>' +
|
||||
'<a id="' + arr[i].article_id + '" target="_blank" href="article.html?J_num=' + Jour_num + '&a_id=' + arr[i].article_id + '" class="txt_biaoti">' + otStat + arr[i].title + '</a>' +
|
||||
'<div class="authorList"><span class="fo_fam">' + arr[i].authortitle + ' </span><br>'
|
||||
+ arr[i].journal_title + '.' + act_year + npp_ +
|
||||
'<a target="_blank" href="https://doi.org/' + arr[i].doi + '">' + doi_ + '</a>' +
|
||||
'</div><div class="links_">' + link_ + '</div><div class="apwrap">' + person_img + '<div>' +
|
||||
trad_tion + '</div><br clear="both"></div></li>'
|
||||
} else if (i == 3 || i == 4) {
|
||||
sim_2 += '<li class="pai_two"><div class="dbt_header">' + arr[i].type + pub_date +
|
||||
'<div class="url_top">' + lr_top + '</div></div>' +
|
||||
'<a id="' + arr[i].article_id + '" target="_blank" href="article.html?J_num=' + Jour_num + '&a_id=' + arr[i].article_id + '" class="txt_biaoti">' + otStat + arr[i].title + '</a>' +
|
||||
'<div class="authorList"><span class="fo_fam">' + arr[i].authortitle + ' </span><br>'
|
||||
+ arr[i].journal_title + '.' + act_year + npp_ +
|
||||
'<br/><a target="_blank" href="https://doi.org/' + arr[i].doi + '">' + doi_ + '</a>' +
|
||||
'</div><div class="links_">' + link_ + '</div><div class="apwrap"><a onclick="imgbig(this)" class="imgdiv">' + person_img + '</a><div>' +
|
||||
'<div>' + arr[i].abstract + '</div></div></div></li>'
|
||||
'</div><div class="links_">' + link_ + '</div><div class="apwrap" style="display: grid;grid-template-columns: 1fr 1fr;">' + person_img1 + '<div style="width:100%;height:240px;line-height:20px;">' +
|
||||
trad_tion1 + '</div><br clear="both"></div></li>'
|
||||
} else {
|
||||
sim_3 += '<li style="position: relative"><div class="dbt_header">' + arr[i].type + pub_date +
|
||||
'<div class="url_top">' + lr_top + '</div></div>' +
|
||||
'<div style="float: left"><a id="' + arr[i].article_id + '" target="_blank" href="article.html?J_num=' + Jour_num + '&a_id=' + arr[i].article_id + '" class="txt_biaoti"' +
|
||||
' style="width: 520px;display: block">' + otStat + arr[i].title + '</a>' +
|
||||
'<div class="authorList"><span class="fo_fam">' + arr[i].authortitle + ' </span><br>'
|
||||
+ arr[i].journal_title + '.' + act_year + npp_ +
|
||||
'<br/><a target="_blank" href="https://doi.org/' + arr[i].doi + '">' + doi_ + '</a>' +
|
||||
'</div><div class="links_">' + link_ + '</div></div><a onclick="imgbig(this)" class="imgdiv" style="float: right;">' +
|
||||
'<img src="' + img_i + '" style="width: 170px;"></a><br clear="both"/></li>'
|
||||
if (i == 0 || i == 1 || i == 2) {
|
||||
sim_1 += '<li><div class="dbt_header">' + arr[i].type + pub_date
|
||||
+ '<div class="url_top">' + lr_top + '</div></div>' +
|
||||
'<a id="' + arr[i].article_id + '" target="_blank" href="article.html?J_num=' + Jour_num + '&a_id=' + arr[i].article_id + '" class="txt_biaoti">' + otStat + arr[i].title + '</a>' +
|
||||
'<div class="authorList"><span class="fo_fam">' + arr[i].authortitle + ' </span><br>'
|
||||
+ arr[i].journal_title + '.' + act_year + npp_ +
|
||||
'<a target="_blank" href="https://doi.org/' + arr[i].doi + '">' + doi_ + '</a>' +
|
||||
'</div><div class="links_">' + link_ + '</div><div class="apwrap" style="display: grid;grid-template-columns: 1fr 1fr;">' + person_img1 + '<div style="width:100%;height:240px;line-height:20px;">' +
|
||||
trad_tion1 + '</div><br clear="both"></div></li>'
|
||||
} else if (i == 3 || i == 4) {
|
||||
sim_2 += '<li class="pai_two"><div class="dbt_header">' + arr[i].type + pub_date +
|
||||
'<div class="url_top">' + lr_top + '</div></div>' +
|
||||
'<a id="' + arr[i].article_id + '" target="_blank" href="article.html?J_num=' + Jour_num + '&a_id=' + arr[i].article_id + '" class="txt_biaoti">' + otStat + arr[i].title + '</a>' +
|
||||
'<div class="authorList"><span class="fo_fam">' + arr[i].authortitle + ' </span><br>'
|
||||
+ arr[i].journal_title + '.' + act_year + npp_ +
|
||||
'<br/><a target="_blank" href="https://doi.org/' + arr[i].doi + '">' + doi_ + '</a>' +
|
||||
'</div><div class="links_">' + link_ + '</div><div class="apwrap"><a onclick="imgbig(this)" class="imgdiv">' + person_img + '</a><div>' +
|
||||
'<div>' + arr[i].abstract + '</div></div></div></li>'
|
||||
} else {
|
||||
sim_3 += '<li style="position: relative"><div class="dbt_header">' + arr[i].type + pub_date +
|
||||
'<div class="url_top">' + lr_top + '</div></div>' +
|
||||
'<div style="float: left"><a id="' + arr[i].article_id + '" target="_blank" href="article.html?J_num=' + Jour_num + '&a_id=' + arr[i].article_id + '" class="txt_biaoti"' +
|
||||
' style="width: 520px;display: block">' + otStat + arr[i].title + '</a>' +
|
||||
'<div class="authorList"><span class="fo_fam">' + arr[i].authortitle + ' </span><br>'
|
||||
+ arr[i].journal_title + '.' + act_year + npp_ +
|
||||
'<br/><a target="_blank" href="https://doi.org/' + arr[i].doi + '">' + doi_ + '</a>' +
|
||||
'</div><div class="links_">' + link_ + '</div></div><a onclick="imgbig(this)" class="imgdiv" style="float: right;">' +
|
||||
'<img src="' + img_i + '" style="width: 170px;"></a><br clear="both"/></li>'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
122
js/js.js
122
js/js.js
@@ -39,7 +39,7 @@ function getQueryString(name) {
|
||||
}
|
||||
|
||||
|
||||
localStorage.setItem("Journals_num",getQueryString('J_num'));
|
||||
localStorage.setItem("Journals_num", getQueryString('J_num'));
|
||||
// localStorage.setItem("Journals_num",'1');
|
||||
// 获取缓存期刊id
|
||||
var Jour_num = localStorage.Journals_num;
|
||||
@@ -49,9 +49,9 @@ var Jour_num = localStorage.Journals_num;
|
||||
|
||||
|
||||
// tab选项卡
|
||||
$(document).ready(function() {
|
||||
$("#tablist li").each(function(index) {
|
||||
$(this).click(function() {
|
||||
$(document).ready(function () {
|
||||
$("#tablist li").each(function (index) {
|
||||
$(this).click(function () {
|
||||
$(".contentin").removeClass("contentin");
|
||||
$(".tabin").removeClass("tabin");
|
||||
$(".content-box>div").eq(index).addClass("contentin");
|
||||
@@ -81,7 +81,7 @@ function ShowSuccess(tiq) {
|
||||
';border: 1px solid #ddd;"></span>');
|
||||
$('body').append($tiq);
|
||||
}
|
||||
$tiq.stop(true).html('<i class="fa fa-check-circle-o" style="margin-right: 10px;color: #009f95;font-size: 20px"></i>'+tiq).css({'margin-left': -$tiq.outerWidth() / 2,'color':'#444','background-color':'#fff'}).fadeIn(500).delay(1500).fadeOut(500);
|
||||
$tiq.stop(true).html('<i class="fa fa-check-circle-o" style="margin-right: 10px;color: #009f95;font-size: 20px"></i>' + tiq).css({ 'margin-left': -$tiq.outerWidth() / 2, 'color': '#444', 'background-color': '#fff' }).fadeIn(500).delay(1500).fadeOut(500);
|
||||
}
|
||||
function ShowDanger(tip) {
|
||||
var $tip = $('#tip');
|
||||
@@ -92,7 +92,7 @@ function ShowDanger(tip) {
|
||||
';border: 1px solid #a94442;"><i class="fa fa-times-circle-o"></i></span>');
|
||||
$('body').append($tip);
|
||||
}
|
||||
$tip.stop(true).text(tip).css({'margin-left': -$tip.outerWidth() / 2,'color':'#a94442','background-color':'#fff'}).fadeIn(500).delay(1000).fadeOut(500);
|
||||
$tip.stop(true).text(tip).css({ 'margin-left': -$tip.outerWidth() / 2, 'color': '#a94442', 'background-color': '#fff' }).fadeIn(500).delay(1000).fadeOut(500);
|
||||
}
|
||||
function ShowSubmit(tiq) {
|
||||
var $tiq = $('#tir');
|
||||
@@ -103,7 +103,7 @@ function ShowSubmit(tiq) {
|
||||
';border: 1px solid #ddd;"></span>');
|
||||
$('body').append($tiq);
|
||||
}
|
||||
$tiq.stop(true).html('<img src="img/loading.gif" style="margin-top: -7px;margin-right: 15px;vertical-align: middle;"/>'+tiq).css({'margin-left': -$tiq.outerWidth() / 2,'color':'#444','background-color':'#fff'}).fadeIn(500);
|
||||
$tiq.stop(true).html('<img src="img/loading.gif" style="margin-top: -7px;margin-right: 15px;vertical-align: middle;"/>' + tiq).css({ 'margin-left': -$tiq.outerWidth() / 2, 'color': '#444', 'background-color': '#fff' }).fadeIn(500);
|
||||
}
|
||||
|
||||
// 点击复制内容
|
||||
@@ -121,22 +121,22 @@ function ShowSubmit(tiq) {
|
||||
|
||||
|
||||
//时间
|
||||
var formatTimeToDate1 = function(time){
|
||||
var formatTimeToDate1 = function (time) {
|
||||
return new Date(time).format("yyyy");
|
||||
};
|
||||
|
||||
var formatTimeToDate2 = function(time){
|
||||
var formatTimeToDate2 = function (time) {
|
||||
return new Date(time).format("dd/MM/yyyy");
|
||||
};
|
||||
|
||||
var formatTimeToDate3 = function(time){
|
||||
var formatTimeToDate3 = function (time) {
|
||||
return new Date(time).format("yyyy-MM-dd hh:mm:ss");
|
||||
};
|
||||
var formatTimeToDate4 = function(time){
|
||||
var formatTimeToDate4 = function (time) {
|
||||
return new Date(time).format("yyyy-MM-dd");
|
||||
};
|
||||
|
||||
Date.prototype.format = function(format) {
|
||||
Date.prototype.format = function (format) {
|
||||
var date = {
|
||||
"M+": this.getMonth() + 1,
|
||||
"d+": this.getDate(),
|
||||
@@ -175,36 +175,108 @@ function whit_color() {
|
||||
}
|
||||
|
||||
// 图片放大
|
||||
function imgbig(which){
|
||||
function imgbig(which) {
|
||||
var imgsrc = $(which).find('img').attr('src');
|
||||
$("#bigimg").css("display","block");
|
||||
$("#bigimg").html("<img src="+imgsrc+" onmousewheel='return rollImg(this)'/>");
|
||||
$('#bigimg>img').css('margin-top',-$('#bigimg>img').height()/2);
|
||||
$('body').css({"overflow-x":"hidden","overflow-y":"hidden"});
|
||||
$("#bigimg").css("display", "block");
|
||||
$("#bigimg").html("<img src=" + imgsrc + " onmousewheel='return rollImg(this)'/>");
|
||||
$('#bigimg>img').css('margin-top', -$('#bigimg>img').height() / 2);
|
||||
$('body').css({ "overflow-x": "hidden", "overflow-y": "hidden" });
|
||||
}
|
||||
|
||||
function imgbig1(which) {
|
||||
console.log('which at line 186:', which);
|
||||
|
||||
// 查找 `a` 内部是否有 `div` 并获取其背景图
|
||||
var targetDiv = $(which).find('div').first(); // 获取 `a` 内的第一个 `div`
|
||||
if (targetDiv.length === 0) {
|
||||
console.warn("No div found inside <a>");
|
||||
return;
|
||||
}
|
||||
|
||||
var imgsrc = targetDiv.css("background-image"); // 获取 `div` 的背景图片
|
||||
console.log('imgsrc at line 187:', imgsrc);
|
||||
|
||||
if (!imgsrc || imgsrc === "none") {
|
||||
console.warn("No background-image found on the div");
|
||||
return;
|
||||
}
|
||||
|
||||
imgsrc = imgsrc.replace(/^url\(["']?/, '').replace(/["']?\)$/, ''); // 处理 URL 去掉多余字符
|
||||
|
||||
|
||||
$("#bigimg").css("display", "block");
|
||||
$("#bigimg").html("<img src=" + imgsrc + " onmousewheel='return rollImg(this)'/>");
|
||||
$('#bigimg>img').css('margin-top', -$('#bigimg>img').height() / 2);
|
||||
$('body').css({ "overflow-x": "hidden", "overflow-y": "hidden" });
|
||||
}
|
||||
|
||||
|
||||
|
||||
function truncateTextToHeight(element, maxHeight) {
|
||||
const originalText = element.innerText.trim();
|
||||
const words = originalText.split(' ');
|
||||
let truncatedText = '';
|
||||
let low = 0;
|
||||
let high = words.length - 1;
|
||||
let bestFit = 0;
|
||||
|
||||
// 设置元素样式以确保正确计算高度
|
||||
element.style.whiteSpace = 'normal';
|
||||
element.style.wordBreak = 'break-word';
|
||||
element.style.display = 'block';
|
||||
element.style.overflow = 'hidden';
|
||||
|
||||
// 二分查找以确定最佳截断点
|
||||
while (low <= high) {
|
||||
const mid = Math.floor((low + high) / 2);
|
||||
const testText = words.slice(0, mid + 1).join(' ') + '...';
|
||||
element.innerText = testText;
|
||||
|
||||
if (element.scrollHeight > maxHeight) {
|
||||
high = mid - 1;
|
||||
} else {
|
||||
bestFit = mid;
|
||||
low = mid + 1;
|
||||
}
|
||||
}
|
||||
|
||||
// 最终截断文本并添加省略号
|
||||
truncatedText = words.slice(0, bestFit + 1).join(' ') + '...';
|
||||
element.innerText = truncatedText;
|
||||
}
|
||||
|
||||
// 使用示例
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const traditionElements = document.querySelectorAll('.tradition-text');
|
||||
traditionElements.forEach(element => {
|
||||
truncateTextToHeight(element, 240); // 240px 为最大高度
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
function closeimg() {
|
||||
$("#bigimg").css("display","none");
|
||||
$("#bigimg").css("display", "none");
|
||||
$('html,body').removeClass('ovfHiden');
|
||||
$('body').css({"overflow-x":"auto","overflow-y":"auto"});
|
||||
$('body').css({ "overflow-x": "auto", "overflow-y": "auto" });
|
||||
}
|
||||
|
||||
function rollImg(o){
|
||||
function rollImg(o) {
|
||||
/* 获取当前页面的缩放比
|
||||
若未设置zoom缩放比,则为默认100%,即1,原图大小
|
||||
*/
|
||||
var zoom=parseInt(o.style.zoom)||100;
|
||||
var zoom = parseInt(o.style.zoom) || 100;
|
||||
/* event.wheelDelta 获取滚轮滚动值并将滚动值叠加给缩放比zoom
|
||||
wheelDelta统一为±120,其中正数表示为向上滚动,负数表示向下滚动
|
||||
*/
|
||||
zoom+=event.wheelDelta/12;
|
||||
zoom += event.wheelDelta / 12;
|
||||
/* 如果缩放比大于0,则将缩放比加载到页面元素 */
|
||||
if (zoom>0) o.style.zoom=zoom+'%';
|
||||
if (zoom > 0) o.style.zoom = zoom + '%';
|
||||
/* 如果缩放比不大于0,则返回false,不执行操作 */
|
||||
return false;
|
||||
}
|
||||
|
||||
var pan_type =function pan_type(e) {
|
||||
var pan_type = function pan_type(e) {
|
||||
if (e == 'A') {
|
||||
var typ_tet = 'ARTICLE'
|
||||
} else if (e == 'B') {
|
||||
@@ -241,7 +313,7 @@ var pan_type =function pan_type(e) {
|
||||
var typ_tet = 'PROTOCOL';
|
||||
} else if (e == 'CS') {
|
||||
var typ_tet = 'CASE SERIES';
|
||||
}else{
|
||||
} else {
|
||||
var typ_tet = 'OTHER';
|
||||
}
|
||||
return typ_tet;
|
||||
|
||||
32
js/side.js
32
js/side.js
@@ -248,10 +248,14 @@ function side_list() {
|
||||
$('.Join_Bord2').attr('href', 'z_f11-1.html?J_num=' + Jour_num);
|
||||
|
||||
$('.edit_board_tmr>a').attr('href', arr_jour.board_url);
|
||||
if(Jour_num==11){
|
||||
$('.edit_board_tmr').after('<p><b>CiteScore (Scopus):</b> <span>0.1</span></p>');
|
||||
}
|
||||
|
||||
if (Jour_num == 11) {
|
||||
$('.edit_board_tmr').after('<p><b>CiteScore (Scopus):</b> <span>0.1</span></p>');
|
||||
}
|
||||
//bmec
|
||||
if (Jour_num == 25) {
|
||||
$('.edit_board_tmr').after('<p><b>CiteScore (Scopus):</b> <span>1.3</span></p>');
|
||||
}
|
||||
|
||||
//$('.edit_board_tmr>a').attr('href', 'notice.html?J_num=' + Jour_num + '&footer_id=' + arr_jour.board_url);
|
||||
|
||||
// 外链信息
|
||||
@@ -300,18 +304,18 @@ function side_list() {
|
||||
$('#top_bar .top').css('display', 'none');
|
||||
$('sharethis_tmr').css('display', 'none');
|
||||
const artSide = document.querySelector('.art_side');
|
||||
const elements = artSide.children;
|
||||
const elements = artSide.children;
|
||||
|
||||
// 隐藏 art_side 中的所有元素
|
||||
for (let i = 0; i < elements.length; i++) {
|
||||
elements[i].classList.add('hidden');
|
||||
}
|
||||
// 隐藏 art_side 中的所有元素
|
||||
for (let i = 0; i < elements.length; i++) {
|
||||
elements[i].classList.add('hidden');
|
||||
}
|
||||
|
||||
// 显示 jour_message 元素
|
||||
const jourMessage = artSide.querySelector('.jour_message');
|
||||
if (jourMessage) {
|
||||
jourMessage.classList.remove('hidden');
|
||||
}
|
||||
// 显示 jour_message 元素
|
||||
const jourMessage = artSide.querySelector('.jour_message');
|
||||
if (jourMessage) {
|
||||
jourMessage.classList.remove('hidden');
|
||||
}
|
||||
}
|
||||
|
||||
// 待审稿件
|
||||
|
||||
@@ -244,8 +244,12 @@ function bf_list() {
|
||||
|
||||
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="">'
|
||||
var person_img = '<img src="' + img_i + '" alt="" style="height:300px;object-fit: cover;">'
|
||||
|
||||
var person_img1 = '<div style="height: 240px;background-image: url('+img_i+');background-size:cover;background-position:top;background-repeat:no-repeat;"></div>'
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -265,17 +269,41 @@ function bf_list() {
|
||||
|
||||
|
||||
if (arr[i].tradition_tag == '') {
|
||||
var trad_tion = ''
|
||||
var trad_tion = '';
|
||||
} else {
|
||||
var trad_tion = '<div><div><font>' + arr[i].tradition_tag + ': </font>' + arr[i].tradition + '</div></div>'
|
||||
var traditionText = arr[i].tradition;
|
||||
var maxTradHeight = 220; // 设置最大高度
|
||||
|
||||
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.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 渲染完成
|
||||
}
|
||||
|
||||
|
||||
str += '<li><div class="dbt_header">' + arr[i].type + '<div class="url_top">' + lr_top + '</div></div>' +
|
||||
'<a id="' + arr[i].article_id + '" target="_blank" href="article.html?J_num=' + Jour_num + '&a_id=' + arr[i].article_id + '" class="txt_biaoti">' + otStat + arr[i].title + '</a>' +
|
||||
'<div class="authorList"><span class="fo_fam">' + arr[i].authortitle + ' </span><br>'
|
||||
+ localStorage.getItem("Journals_title") + '.' + act_year + npp_ +
|
||||
'<a target="_blank" href="https://doi.org/' + arr[i].doi + '">' + doi_ + '</a>' +
|
||||
'</div><div class="links_">' + link_ + '</div><div class="apwrap"><a onclick="imgbig(this)" class="imgdiv">' + person_img + '</a>' +
|
||||
'</div><div class="links_">' + link_ + '</div><div class="apwrap" style="display: grid;grid-template-columns: 1fr 1fr;"><a onclick="imgbig1(this)" class="imgdiv" style="width:100%" >' + person_img1 + '</a>' +
|
||||
trad_tion + '<br clear="both"></div></li>'
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user