tijiao
This commit is contained in:
@@ -7232,7 +7232,7 @@ function article_con() {
|
|||||||
if (result.code == 0) {
|
if (result.code == 0) {
|
||||||
var html_type = result.data.articleInfo.html_type
|
var html_type = result.data.articleInfo.html_type
|
||||||
var has_html = result.data.articleInfo.has_html
|
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 .tarhtmn').css('display', 'none');
|
||||||
$('.wen_rong #tablist .tarfihml').css('display', 'none');
|
$('.wen_rong #tablist .tarfihml').css('display', 'none');
|
||||||
$('.wen_rong .content-box .conthtmn').css('display', 'none');
|
$('.wen_rong .content-box .conthtmn').css('display', 'none');
|
||||||
@@ -7610,7 +7610,7 @@ function article_con() {
|
|||||||
xuhao++;
|
xuhao++;
|
||||||
item = "<div><p>" + xuhao + '. ' + result.data.refers[rr].author + ' ' + result.data.refers[rr].title + ". " + result.data.refers[rr].dateno + ".";
|
item = "<div><p>" + xuhao + '. ' + result.data.refers[rr].author + ' ' + result.data.refers[rr].title + ". " + result.data.refers[rr].dateno + ".";
|
||||||
// 在 "Available at:" 之前插入 <br/> 标签
|
// 在 "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;
|
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) {
|
} 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:"
|
// other 类型,检查 refer_frag 中是否有 "Available at:"
|
||||||
@@ -7664,7 +7664,7 @@ function article_con() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
var htmlContent=''
|
var htmlContent = ''
|
||||||
|
|
||||||
htmlContent += arr.map((item) => {
|
htmlContent += arr.map((item) => {
|
||||||
//批注
|
//批注
|
||||||
@@ -7678,22 +7678,19 @@ var htmlContent=''
|
|||||||
|
|
||||||
contentHtml = `
|
contentHtml = `
|
||||||
<p contenteditable="false" main-state="${item.state}" style="display:flex;align-items: center;
|
<p contenteditable="false" main-state="${item.state}" style="display:flex;align-items: center;
|
||||||
justify-content: center;" class="MaxPicture pMain" data-id="${
|
justify-content: center;" class="MaxPicture pMain" data-id="${item.ami_id
|
||||||
item.ami_id
|
|
||||||
}" main-id="${item.am_id}">
|
}" main-id="${item.am_id}">
|
||||||
|
|
||||||
<img src="${picsrc}" onclick="${fun}" style="width: ${
|
<img src="${picsrc}" onclick="${fun}" style="width: ${item.width ? `${item.width}px` : '80%'
|
||||||
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-size: 14px;
|
||||||
font-family: 'Charis SIL';
|
font-family: 'Charis SIL';
|
||||||
font-weight:normal;
|
font-weight:normal;
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
text-align:center;" >${
|
text-align:center;" >${item.image.note ? item.image.note : ''
|
||||||
item.image.note ? item.image.note : ''
|
}</p>
|
||||||
}</div>
|
|
||||||
</p>
|
</p>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
@@ -7701,16 +7698,15 @@ var htmlContent=''
|
|||||||
var tableList = JSON.parse(item.table.table_data);
|
var tableList = JSON.parse(item.table.table_data);
|
||||||
|
|
||||||
contentHtml = `
|
contentHtml = `
|
||||||
<div contenteditable="false" data-id="${item.amt_id}" main-state="${item.state}" main-id="${
|
<div contenteditable="false" data-id="${item.amt_id}" main-state="${item.state}" main-id="${item.am_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;">
|
}" 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>
|
<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; ">
|
<table border="1" style="width: 100%; border-collapse: collapse; text-align: center; ">
|
||||||
${tableList
|
${tableList
|
||||||
.map((row,i) => {
|
.map((row, i) => {
|
||||||
return `
|
return `
|
||||||
<tr class="${isHeaderRow(i,tableList)?'table-header-row':''}">
|
<tr class="${isHeaderRow(i, tableList) ? 'table-header-row' : ''}">
|
||||||
${row
|
${row
|
||||||
.map((cell) => {
|
.map((cell) => {
|
||||||
return `
|
return `
|
||||||
@@ -7725,26 +7721,27 @@ var htmlContent=''
|
|||||||
})
|
})
|
||||||
.join('')}
|
.join('')}
|
||||||
</table>
|
</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-size: 14px;
|
||||||
font-family: 'Charis SIL';
|
font-family: 'Charis SIL';
|
||||||
font-weight: 500 !important;
|
font-weight: 500 !important;
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
text-align:center;" >${
|
text-align:center;" >${item.table.note ? item.table.note : ''
|
||||||
item.table.note ? item.table.note : ''
|
}</p>
|
||||||
}</div>
|
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
} else {
|
} 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;
|
return contentHtml;
|
||||||
}).join('');
|
}).join('');
|
||||||
htmlContent=`<div class="newHtml2">${htmlContent}</div>`
|
htmlContent = `<div class="newHtml2">${htmlContent}</div>`
|
||||||
$('.wen_rong .content-box .conthtmn').html(htmlContent);
|
$('.wen_rong .content-box .conthtmn').html(htmlContent);
|
||||||
// 引用
|
// 引用
|
||||||
if (result.data.refers.length > 0) { // 如果有引用数据
|
if (result.data.refers.length > 0) { // 如果有引用数据
|
||||||
@@ -7765,7 +7762,7 @@ var htmlContent=''
|
|||||||
xuhao++;
|
xuhao++;
|
||||||
item = "<div><p>" + xuhao + '. ' + result.data.refers[rr].author + ' ' + result.data.refers[rr].title + ". " + result.data.refers[rr].dateno + ".";
|
item = "<div><p>" + xuhao + '. ' + result.data.refers[rr].author + ' ' + result.data.refers[rr].title + ". " + result.data.refers[rr].dateno + ".";
|
||||||
// 在 "Available at:" 之前插入 <br/> 标签
|
// 在 "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;
|
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) {
|
} 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:" 链接
|
// other 类型,检查 refer_frag 中是否有 "Available at:" 链接
|
||||||
@@ -8297,15 +8294,15 @@ var htmlContent=''
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
function isHeaderRow(rowIndex,table) {
|
function isHeaderRow(rowIndex, table) {
|
||||||
|
|
||||||
|
|
||||||
console.log('table at line 697:', table)
|
console.log('table at line 697:', table)
|
||||||
var head=table[0]
|
var head = table[0]
|
||||||
console.log('head at line 699:', head[0].rowspan)
|
console.log('head at line 699:', head[0].rowspan)
|
||||||
|
|
||||||
return rowIndex < head[0].rowspan; // 假设前两行是表头
|
return rowIndex < head[0].rowspan; // 假设前两行是表头
|
||||||
}
|
}
|
||||||
// 图片预览
|
// 图片预览
|
||||||
function picPreview(src) {
|
function picPreview(src) {
|
||||||
console.log(src)
|
console.log(src)
|
||||||
|
|||||||
@@ -209,8 +209,10 @@ function bf_list() {
|
|||||||
|
|
||||||
if (arr[i].icon == '') {
|
if (arr[i].icon == '') {
|
||||||
var person_img = ''
|
var person_img = ''
|
||||||
|
var person_img1 = ''
|
||||||
} else {
|
} 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) {
|
if (arr[i].journal_id == 22) {
|
||||||
@@ -261,6 +263,37 @@ function bf_list() {
|
|||||||
} else {
|
} else {
|
||||||
var trad_tion = '<div><b style="color: ' + localStorage.Journals_color + '">' + arr[i].tradition_tag + ': </b>' + arr[i].tradition + '</div>'
|
var trad_tion = '<div><b style="color: ' + localStorage.Journals_color + '">' + arr[i].tradition_tag + ': </b>' + arr[i].tradition + '</div>'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
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" 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 == 0 || i == 1 || i == 2) {
|
if (i == 0 || i == 1 || i == 2) {
|
||||||
sim_1 += '<li><div class="dbt_header">' + arr[i].type + pub_date
|
sim_1 += '<li><div class="dbt_header">' + arr[i].type + pub_date
|
||||||
+ '<div class="url_top">' + lr_top + '</div></div>' +
|
+ '<div class="url_top">' + lr_top + '</div></div>' +
|
||||||
@@ -268,8 +301,8 @@ function bf_list() {
|
|||||||
'<div class="authorList"><span class="fo_fam">' + arr[i].authortitle + ' </span><br>'
|
'<div class="authorList"><span class="fo_fam">' + arr[i].authortitle + ' </span><br>'
|
||||||
+ arr[i].journal_title + '.' + act_year + npp_ +
|
+ arr[i].journal_title + '.' + act_year + npp_ +
|
||||||
'<a target="_blank" href="https://doi.org/' + arr[i].doi + '">' + doi_ + '</a>' +
|
'<a target="_blank" href="https://doi.org/' + arr[i].doi + '">' + doi_ + '</a>' +
|
||||||
'</div><div class="links_">' + link_ + '</div><div class="apwrap">' + person_img + '<div>' +
|
'</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_tion + '</div><br clear="both"></div></li>'
|
trad_tion1 + '</div><br clear="both"></div></li>'
|
||||||
} else if (i == 3 || i == 4) {
|
} else if (i == 3 || i == 4) {
|
||||||
sim_2 += '<li class="pai_two"><div class="dbt_header">' + arr[i].type + pub_date +
|
sim_2 += '<li class="pai_two"><div class="dbt_header">' + arr[i].type + pub_date +
|
||||||
'<div class="url_top">' + lr_top + '</div></div>' +
|
'<div class="url_top">' + lr_top + '</div></div>' +
|
||||||
@@ -290,6 +323,8 @@ function bf_list() {
|
|||||||
'</div><div class="links_">' + link_ + '</div></div><a onclick="imgbig(this)" class="imgdiv" style="float: right;">' +
|
'</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>'
|
'<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');
|
// localStorage.setItem("Journals_num",'1');
|
||||||
// 获取缓存期刊id
|
// 获取缓存期刊id
|
||||||
var Jour_num = localStorage.Journals_num;
|
var Jour_num = localStorage.Journals_num;
|
||||||
@@ -49,9 +49,9 @@ var Jour_num = localStorage.Journals_num;
|
|||||||
|
|
||||||
|
|
||||||
// tab选项卡
|
// tab选项卡
|
||||||
$(document).ready(function() {
|
$(document).ready(function () {
|
||||||
$("#tablist li").each(function(index) {
|
$("#tablist li").each(function (index) {
|
||||||
$(this).click(function() {
|
$(this).click(function () {
|
||||||
$(".contentin").removeClass("contentin");
|
$(".contentin").removeClass("contentin");
|
||||||
$(".tabin").removeClass("tabin");
|
$(".tabin").removeClass("tabin");
|
||||||
$(".content-box>div").eq(index).addClass("contentin");
|
$(".content-box>div").eq(index).addClass("contentin");
|
||||||
@@ -81,7 +81,7 @@ function ShowSuccess(tiq) {
|
|||||||
';border: 1px solid #ddd;"></span>');
|
';border: 1px solid #ddd;"></span>');
|
||||||
$('body').append($tiq);
|
$('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) {
|
function ShowDanger(tip) {
|
||||||
var $tip = $('#tip');
|
var $tip = $('#tip');
|
||||||
@@ -92,7 +92,7 @@ function ShowDanger(tip) {
|
|||||||
';border: 1px solid #a94442;"><i class="fa fa-times-circle-o"></i></span>');
|
';border: 1px solid #a94442;"><i class="fa fa-times-circle-o"></i></span>');
|
||||||
$('body').append($tip);
|
$('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) {
|
function ShowSubmit(tiq) {
|
||||||
var $tiq = $('#tir');
|
var $tiq = $('#tir');
|
||||||
@@ -103,7 +103,7 @@ function ShowSubmit(tiq) {
|
|||||||
';border: 1px solid #ddd;"></span>');
|
';border: 1px solid #ddd;"></span>');
|
||||||
$('body').append($tiq);
|
$('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");
|
return new Date(time).format("yyyy");
|
||||||
};
|
};
|
||||||
|
|
||||||
var formatTimeToDate2 = function(time){
|
var formatTimeToDate2 = function (time) {
|
||||||
return new Date(time).format("dd/MM/yyyy");
|
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");
|
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");
|
return new Date(time).format("yyyy-MM-dd");
|
||||||
};
|
};
|
||||||
|
|
||||||
Date.prototype.format = function(format) {
|
Date.prototype.format = function (format) {
|
||||||
var date = {
|
var date = {
|
||||||
"M+": this.getMonth() + 1,
|
"M+": this.getMonth() + 1,
|
||||||
"d+": this.getDate(),
|
"d+": this.getDate(),
|
||||||
@@ -175,36 +175,108 @@ function whit_color() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 图片放大
|
// 图片放大
|
||||||
function imgbig(which){
|
function imgbig(which) {
|
||||||
var imgsrc = $(which).find('img').attr('src');
|
var imgsrc = $(which).find('img').attr('src');
|
||||||
$("#bigimg").css("display","block");
|
$("#bigimg").css("display", "block");
|
||||||
$("#bigimg").html("<img src="+imgsrc+" onmousewheel='return rollImg(this)'/>");
|
$("#bigimg").html("<img src=" + imgsrc + " onmousewheel='return rollImg(this)'/>");
|
||||||
$('#bigimg>img').css('margin-top',-$('#bigimg>img').height()/2);
|
$('#bigimg>img').css('margin-top', -$('#bigimg>img').height() / 2);
|
||||||
$('body').css({"overflow-x":"hidden","overflow-y":"hidden"});
|
$('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() {
|
function closeimg() {
|
||||||
$("#bigimg").css("display","none");
|
$("#bigimg").css("display", "none");
|
||||||
$('html,body').removeClass('ovfHiden');
|
$('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,原图大小
|
若未设置zoom缩放比,则为默认100%,即1,原图大小
|
||||||
*/
|
*/
|
||||||
var zoom=parseInt(o.style.zoom)||100;
|
var zoom = parseInt(o.style.zoom) || 100;
|
||||||
/* event.wheelDelta 获取滚轮滚动值并将滚动值叠加给缩放比zoom
|
/* event.wheelDelta 获取滚轮滚动值并将滚动值叠加给缩放比zoom
|
||||||
wheelDelta统一为±120,其中正数表示为向上滚动,负数表示向下滚动
|
wheelDelta统一为±120,其中正数表示为向上滚动,负数表示向下滚动
|
||||||
*/
|
*/
|
||||||
zoom+=event.wheelDelta/12;
|
zoom += event.wheelDelta / 12;
|
||||||
/* 如果缩放比大于0,则将缩放比加载到页面元素 */
|
/* 如果缩放比大于0,则将缩放比加载到页面元素 */
|
||||||
if (zoom>0) o.style.zoom=zoom+'%';
|
if (zoom > 0) o.style.zoom = zoom + '%';
|
||||||
/* 如果缩放比不大于0,则返回false,不执行操作 */
|
/* 如果缩放比不大于0,则返回false,不执行操作 */
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var pan_type =function pan_type(e) {
|
var pan_type = function pan_type(e) {
|
||||||
if (e == 'A') {
|
if (e == 'A') {
|
||||||
var typ_tet = 'ARTICLE'
|
var typ_tet = 'ARTICLE'
|
||||||
} else if (e == 'B') {
|
} else if (e == 'B') {
|
||||||
@@ -241,7 +313,7 @@ var pan_type =function pan_type(e) {
|
|||||||
var typ_tet = 'PROTOCOL';
|
var typ_tet = 'PROTOCOL';
|
||||||
} else if (e == 'CS') {
|
} else if (e == 'CS') {
|
||||||
var typ_tet = 'CASE SERIES';
|
var typ_tet = 'CASE SERIES';
|
||||||
}else{
|
} else {
|
||||||
var typ_tet = 'OTHER';
|
var typ_tet = 'OTHER';
|
||||||
}
|
}
|
||||||
return typ_tet;
|
return typ_tet;
|
||||||
|
|||||||
@@ -248,9 +248,13 @@ function side_list() {
|
|||||||
$('.Join_Bord2').attr('href', 'z_f11-1.html?J_num=' + Jour_num);
|
$('.Join_Bord2').attr('href', 'z_f11-1.html?J_num=' + Jour_num);
|
||||||
|
|
||||||
$('.edit_board_tmr>a').attr('href', arr_jour.board_url);
|
$('.edit_board_tmr>a').attr('href', arr_jour.board_url);
|
||||||
if(Jour_num==11){
|
if (Jour_num == 11) {
|
||||||
$('.edit_board_tmr').after('<p><b>CiteScore (Scopus):</b> <span>0.1</span></p>');
|
$('.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);
|
//$('.edit_board_tmr>a').attr('href', 'notice.html?J_num=' + Jour_num + '&footer_id=' + arr_jour.board_url);
|
||||||
|
|
||||||
|
|||||||
@@ -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') {
|
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_img = '<img src="' + img_i + '" alt="" style="width: 120px">'
|
||||||
|
var person_img1 = '<img src="' + img_i + '" alt="" style="width: 120px">'
|
||||||
} else {
|
} 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 == '') {
|
if (arr[i].tradition_tag == '') {
|
||||||
var trad_tion = ''
|
var trad_tion = '';
|
||||||
} else {
|
} 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>' +
|
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>' +
|
'<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>'
|
'<div class="authorList"><span class="fo_fam">' + arr[i].authortitle + ' </span><br>'
|
||||||
+ localStorage.getItem("Journals_title") + '.' + act_year + npp_ +
|
+ localStorage.getItem("Journals_title") + '.' + act_year + npp_ +
|
||||||
'<a target="_blank" href="https://doi.org/' + arr[i].doi + '">' + doi_ + '</a>' +
|
'<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>'
|
trad_tion + '<br clear="both"></div></li>'
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user