diff --git a/js/article.js b/js/article.js index c6b5310..98039cc 100644 --- a/js/article.js +++ b/js/article.js @@ -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 = "

" + xuhao + '. ' + result.data.refers[rr].author + ' ' + result.data.refers[rr].title + ". " + result.data.refers[rr].dateno + "."; // 在 "Available at:" 之前插入
标签 - item += "
Available at: 

"; + item += "
ISBN: " + result.data.refers[rr].isbn + "

"; 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('

References

' + refs + '
'); } - - + + } }, 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 = `

- -

${ - item.image.note ? item.image.note : '' - }
+ text-align:center;" >${item.image.note ? item.image.note : '' + }

`; - + } else if (item.type == 2) { var tableList = JSON.parse(item.table.table_data); - + contentHtml = ` -
+
${item.table.title ? item.table.title : ''} ${tableList - .map((row,i) => { - return ` - - ${row - .map((cell) => { + .map((row, i) => { return ` + + ${row + .map((cell) => { + return ` `; - }) - .join('')} + }) + .join('')} `; - }) - .join('')} + }) + .join('')}
${cell.text || ''}
-
${ - item.table.note ? item.table.note : '' - }
+ text-align:center;" >${item.table.note ? item.table.note : '' + }

`; } else { - contentHtml = `

${item.content}

`; + item.content + console.log('item.content at line 7740:', item.am_id, item.content) + contentHtml = `

${item.content}

`; } - + // 判断是否是表格类型 - + return contentHtml; }).join(''); - htmlContent=`
${htmlContent}
` + htmlContent = `
${htmlContent}
` $('.wen_rong .content-box .conthtmn').html(htmlContent); // 引用 if (result.data.refers.length > 0) { // 如果有引用数据 @@ -7765,7 +7762,7 @@ var htmlContent='' xuhao++; item = "

" + xuhao + '. ' + result.data.refers[rr].author + ' ' + result.data.refers[rr].title + ". " + result.data.refers[rr].dateno + "."; // 在 "Available at:" 之前插入
标签 - item += "
Available at: 

"; + item += "
ISBN: " + result.data.refers[rr].isbn + "

"; 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('

References

' + refs + '
'); } - + } }, 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) diff --git a/js/journal.js b/js/journal.js index e1d825d..ada46d6 100644 --- a/js/journal.js +++ b/js/journal.js @@ -209,8 +209,10 @@ function bf_list() { if (arr[i].icon == '') { var person_img = '' + var person_img1 = '' } else { - var person_img = '' + var person_img = '' + var person_img1 = '
' } if (arr[i].journal_id == 22) { @@ -261,36 +263,69 @@ function bf_list() { } else { var trad_tion = '
' + arr[i].tradition_tag + ': ' + arr[i].tradition + '
' } - 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 = '' + arr[i].tradition_tag + ': ' + arr[i].tradition; + } + + var maxHeight = 240; // 最大高度 + + trad_tion1 = `
+
${textContent}
+
`; + + + + + + + // 17 2 18 cancer 整合 护理 都是连续出刊 ,首页都需要改 2025-03-02 + if (Jour_num == 17 || Jour_num == 2 || Jour_num == 18) { sim_1 += '
  • ' + arr[i].type + pub_date + '
    ' + lr_top + '
    ' + '' + otStat + arr[i].title + '' + '
    ' + arr[i].authortitle + '
    ' + arr[i].journal_title + '.' + act_year + npp_ + '' + doi_ + '' + - '
    ' + person_img + '
    ' + - trad_tion + '

  • ' - } else if (i == 3 || i == 4) { - sim_2 += '
  • ' + arr[i].type + pub_date + - '
    ' + lr_top + '
    ' + - '' + otStat + arr[i].title + '' + - '
    ' + arr[i].authortitle + '
    ' - + arr[i].journal_title + '.' + act_year + npp_ + - '
    ' + doi_ + '' + - '
    ' + person_img + '
    ' + - '
    ' + arr[i].abstract + '
  • ' + '
    ' + person_img1 + '
    ' + + trad_tion1 + '

    ' } else { - sim_3 += '
  • ' + arr[i].type + pub_date + - '
    ' + lr_top + '
    ' + - '
    ' + otStat + arr[i].title + '' + - '
    ' + arr[i].authortitle + '
    ' - + arr[i].journal_title + '.' + act_year + npp_ + - '
    ' + doi_ + '' + - '
    ' + - '
  • ' + if (i == 0 || i == 1 || i == 2) { + sim_1 += '
  • ' + arr[i].type + pub_date + + '
    ' + lr_top + '
    ' + + '' + otStat + arr[i].title + '' + + '
    ' + arr[i].authortitle + '
    ' + + arr[i].journal_title + '.' + act_year + npp_ + + '' + doi_ + '' + + '
    ' + person_img1 + '
    ' + + trad_tion1 + '

  • ' + } else if (i == 3 || i == 4) { + sim_2 += '
  • ' + arr[i].type + pub_date + + '
    ' + lr_top + '
    ' + + '' + otStat + arr[i].title + '' + + '
    ' + arr[i].authortitle + '
    ' + + arr[i].journal_title + '.' + act_year + npp_ + + '
    ' + doi_ + '' + + '
    ' + person_img + '
    ' + + '
    ' + arr[i].abstract + '
  • ' + } else { + sim_3 += '
  • ' + arr[i].type + pub_date + + '
    ' + lr_top + '
    ' + + '
    ' + otStat + arr[i].title + '' + + '
    ' + arr[i].authortitle + '
    ' + + arr[i].journal_title + '.' + act_year + npp_ + + '
    ' + doi_ + '' + + '
    ' + + '
  • ' + } } + } diff --git a/js/js.js b/js/js.js index ab7e78b..6b1113e 100644 --- a/js/js.js +++ b/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;">'); $('body').append($tiq); } - $tiq.stop(true).html(''+tiq).css({'margin-left': -$tiq.outerWidth() / 2,'color':'#444','background-color':'#fff'}).fadeIn(500).delay(1500).fadeOut(500); + $tiq.stop(true).html('' + 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;">'); $('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;">'); $('body').append($tiq); } - $tiq.stop(true).html(''+tiq).css({'margin-left': -$tiq.outerWidth() / 2,'color':'#444','background-color':'#fff'}).fadeIn(500); + $tiq.stop(true).html('' + 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(""); - $('#bigimg>img').css('margin-top',-$('#bigimg>img').height()/2); - $('body').css({"overflow-x":"hidden","overflow-y":"hidden"}); + $("#bigimg").css("display", "block"); + $("#bigimg").html(""); + $('#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 "); + 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(""); + $('#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; diff --git a/js/side.js b/js/side.js index c1e5971..422f95e 100644 --- a/js/side.js +++ b/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('

    CiteScore (Scopus): 0.1

    '); - } - + if (Jour_num == 11) { + $('.edit_board_tmr').after('

    CiteScore (Scopus): 0.1

    '); + } + //bmec + if (Jour_num == 25) { + $('.edit_board_tmr').after('

    CiteScore (Scopus): 1.3

    '); + } + //$('.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'); + } } // 待审稿件 diff --git a/jstmr/journal.js b/jstmr/journal.js index 422813f..cd50678 100644 --- a/jstmr/journal.js +++ b/jstmr/journal.js @@ -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 = '' + var person_img1 = '' } else { - var person_img = '' + var person_img = '' + + var person_img1 = '
    ' + } @@ -265,17 +269,41 @@ function bf_list() { if (arr[i].tradition_tag == '') { - var trad_tion = '' + var trad_tion = ''; } else { - var trad_tion = '
    ' + arr[i].tradition_tag + ': ' + arr[i].tradition + '
    ' + var traditionText = arr[i].tradition; + var maxTradHeight = 220; // 设置最大高度 + + trad_tion = `
    +
    ${arr[i].tradition_tag}: ${traditionText}
    +
    `; + + 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 += '
  • ' + arr[i].type + '
    ' + lr_top + '
    ' + '
    ' + otStat + arr[i].title + '' + '
    ' + arr[i].authortitle + '
    ' + localStorage.getItem("Journals_title") + '.' + act_year + npp_ + '' + doi_ + '' + - '
    ' + person_img + '' + + '
    ' + person_img1 + '' + trad_tion + '
  • ' }