diff --git a/article.html b/article.html index c0c8b6d..c8257df 100644 --- a/article.html +++ b/article.html @@ -71,6 +71,7 @@ line-height: 22px; margin-bottom: 10px; color: #666; + text-align: justify; } .conthtmn>p { @@ -220,15 +221,17 @@ animation: fadeInAndGrow 0.5s forwards; } + .font { display: block; margin: 0 auto; font-size: 14px; - color: #006699; - font-weight: bold; - line-height: 22px; - text-align:center; - } + /* color: #006699; */ + font-weight: bold; + line-height: 22px; + text-align: center; + } + @keyframes fadeInAndGrow { 0% { opacity: 0; @@ -245,122 +248,150 @@ transform: scale(1); } } + + + .wordTableHtml b span { - font-weight: bold !important; -} - .wordTableHtml i span { - font-style: italic !important; -} - .wordTableHtml sub span { - vertical-align: sub; -} -.wordTableHtml sup span { - vertical-align: super; -} - .wordTableHtml sub { - vertical-align: sub !important; -} - .wordTableHtml sup { - vertical-align: super !important; -} - .wordTableHtml span[style*='vertical-align: super'] { - vertical-align: super !important; -} - .wordTableHtml span[style*='vertical-align: sub'] { - vertical-align: sub !important; -} -.wordTableHtml table { - border: 0px !important; - border-collapse: collapse; /* 去除单元格间隙 */ - width: auto; - margin: 0 auto !important; - table-layout: auto; /* 自动调整列宽 */ - text-align: left; - font-family: 'Charis SIL' !important; - font-size: 7.5pt !important; - mso-font-kerning: 1pt !important; - line-height: 10pt !important; - mos-line-height: 10pt !important; -} -.wordTableHtml table td, -.wordTableHtml table th{ - padding: 5px; - text-align: left !important; - - word-wrap: break-word; /* 长单词自动换行 */ - word-break: break-word; - font-family: 'Charis SIL' !important; - font-size: 7.5pt !important; - mso-font-kerning: 1pt !important; - line-height: 10pt !important; - mos-line-height: 10pt !important; -} -.wordTableHtml table tbody tr td { - text-align: left !important; - border-left: none !important; - mso-border-left-alt: none !important; - border-right: none !important; - mso-border-right-alt: none !important; - border-top: none; - mso-border-top-alt: none !important; - border-bottom: none !important; - mso-border-bottom-alt: none !important; - border: 1px dashed #dcdfe6 !important; - border-left: 1px dashed #dcdfe6 !important; - border-right: 1px dashed #dcdfe6 !important; - word-break: keep-all !important; - /* text-align: justify !important; */ -} -.wordTableHtml table tr td p { - display: flex; - text-align: left !important; - align-items: center; - margin: 0; - font-family: 'Charis SIL' !important; - font-size: 7.5pt !important; - mso-font-kerning: 1pt !important; - line-height: 10pt !important; - mos-line-height: 10pt !important; -} -.wordTableHtml table span { - color: #000000; - text-align: left !important; - font-family: 'Charis SIL' !important; - font-size: 7.5pt !important; - mso-font-kerning: 1pt !important; - line-height: 10pt !important; - mos-line-height: 10pt !important; -} -.wordTableHtml table .color-highlight { - color: rgb(0, 130, 170) !important; - font-family: 'Charis SIL' !important; - font-size: 7.5pt !important; - mso-font-kerning: 1pt !important; - line-height: 10pt !important; - mos-line-height: 10pt !important; -} -.wordTableHtml table blue { - color: rgb(0, 130, 170) !important; - font-family: 'Charis SIL' !important; - font-size: 7.5pt !important; - mso-font-kerning: 1pt !important; - line-height: 10pt !important; - mos-line-height: 10pt !important; -} - .wordTableHtml table tr:first-child td { - border-top: 1px solid #000 !important; - + font-weight: bold !important; + } + + .wordTableHtml i span { + font-style: italic !important; + } + + .wordTableHtml sub span { + vertical-align: sub; + } + + .wordTableHtml sup span { + vertical-align: super; + } + + .wordTableHtml sub { + vertical-align: sub !important; + } + + .wordTableHtml sup { + vertical-align: super !important; + } + + .wordTableHtml span[style*='vertical-align: super'] { + vertical-align: super !important; + } + + .wordTableHtml span[style*='vertical-align: sub'] { + vertical-align: sub !important; + } + + .wordTableHtml table { + border: 0px !important; + border-bottom: 1px solid #000!important; + border-collapse: collapse; + /* 去除单元格间隙 */ + width: 100%; + margin: 0 auto !important; + table-layout: auto; + /* 自动调整列宽 */ + text-align: left; + font-family: 'Charis SIL' !important; + font-size: 7.5pt !important; + mso-font-kerning: 1pt !important; + line-height: 10pt !important; + mos-line-height: 10pt !important; + } + + .wordTableHtml table td, + .wordTableHtml table th { + padding: 5px; + text-align: left !important; + + word-wrap: break-word; + /* 长单词自动换行 */ + word-break: break-word; + font-family: 'Charis SIL' !important; + font-size: 7.5pt !important; + mso-font-kerning: 1pt !important; + line-height: 10pt !important; + mos-line-height: 10pt !important; + } + + .wordTableHtml table tbody tr td { + text-align: center !important; + border-left: none !important; + mso-border-left-alt: none !important; + border-right: none !important; + mso-border-right-alt: none !important; + border-top: none; + mso-border-top-alt: none !important; + border-bottom: none !important; + mso-border-bottom-alt: none !important; + /* border: 1px dashed #dcdfe6 !important; + border-left: 1px dashed #dcdfe6 !important; + border-right: 1px dashed #dcdfe6 !important; */ + word-break: keep-all !important; + /* text-align: justify !important; */ + } + + .wordTableHtml table tr td p { + display: flex; + text-align: left !important; + align-items: center; + margin: 0; + font-family: 'Charis SIL' !important; + font-size: 7.5pt !important; + mso-font-kerning: 1pt !important; + line-height: 10pt !important; + mos-line-height: 10pt !important; + } + + .wordTableHtml table span { + color: #000000; + text-align: left !important; + font-family: 'Charis SIL' !important; + font-size: 7.5pt !important; + mso-font-kerning: 1pt !important; + line-height: 10pt !important; + mos-line-height: 10pt !important; + white-space: pre-wrap !important; + } + + .wordTableHtml table .color-highlight { + color: rgb(0, 130, 170) !important; + font-family: 'Charis SIL' !important; + font-size: 7.5pt !important; + mso-font-kerning: 1pt !important; + line-height: 10pt !important; + mos-line-height: 10pt !important; + } + + .wordTableHtml table blue { + color: rgb(0, 130, 170) !important; + font-family: 'Charis SIL' !important; + font-size: 7.5pt !important; + mso-font-kerning: 1pt !important; + line-height: 10pt !important; + mos-line-height: 10pt !important; + } + + .wordTableHtml table tr:first-child td { + border-top: 1px solid #000 !important; + + border-bottom: 1px solid #000 !important; + + } + + .wordTableHtml table tr:last-of-type td { + border-bottom: 1px solid #000 !important; + + } + .wordTableHtml table tr.table-header-row:nth-of-type(2) td { border-bottom: 1px solid #000 !important; - -} - .wordTableHtml table tr:last-of-type td { - border-bottom: 1px solid #000 !important; - -} -.pMain blue { - color: rgb(0, 130, 170) !important; - } + .pMain blue { + color: rgb(0, 130, 170) !important; + + } + /* 相关引用次数 */ @@ -500,7 +531,7 @@
" } } $('.wen_rong .content-box .conthtmn').html(str); // 引用 if (result.data.refers.length > 0) { // 如果有引用数据 - var refs = '' - var xuhao = 0 + var refs = ''; + var xuhao = 0; for (var rr = 0; rr < result.data.refers.length; rr++) { // 如果格式不正确,或者信息不全 - let item = '' + let item = ''; if (result.data.refers[rr].refer_type == 'journal' && result.data.refers[rr].doilink != '') { - // journal - xuhao++ - item = "

" + xuhao + '. ' + result.data.refers[rr].author + ' ' + result.data.refers[rr].title + ". " + result.data.refers[rr].joura + "" + result.data.refers[rr].dateno + ".  Available at: " + result.data.refers[rr].doilink + " 

" - refs += item + // journal 类型 + xuhao++; + item = "

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

"; + refs += item; } else if (result.data.refers[rr].refer_type == 'book' && result.data.refers[rr].isbn != '') { - // book - xuhao++ - item = "

" + xuhao + '. ' + result.data.refers[rr].author + ' ' + result.data.refers[rr].title + ". " + result.data.refers[rr].dateno + ".  
Available at: 

" - refs += item + // book 类型 + xuhao++; + item = "

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

"; + 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 - xuhao++ - item = "

" + xuhao + '. ' + result.data.refers[rr].refer_frag + ". 

" - refs += item + // other 类型,检查 refer_frag 中是否有 "Available at:" + xuhao++; + item = "

" + xuhao + '. '; + // 如果 refer_frag 包含 "Available at:",在其前面插入
标签 + if (result.data.refers[rr].refer_frag.indexOf('Available at:') !== -1) { + item += result.data.refers[rr].refer_frag.replace('Available at:', '
Available at:'); + } else { + item += result.data.refers[rr].refer_frag; + } + item += ". 

"; + refs += item; } else { continue; } } - // console.log(refs) - $('.wen_rong .content-box .conthtmn').append('

References

' + refs + '
') + // 将生成的所有引用内容插入到页面中 + $('.wen_rong .content-box .conthtmn').append('

References

' + refs + '
'); } + + } }, error: function () { @@ -7664,18 +7677,19 @@ var htmlContent='' // console.log(fun) contentHtml = ` -

${ item.image.note ? item.image.note : '' @@ -7691,17 +7705,17 @@ var htmlContent='' item.am_id }" class="thumbnailTableBox wordTableHtml table_Box pMain" style="width: 100%; padding: 8px 15px; box-sizing: border-box; border-radius: 4px; position: relative;"> - ${item.table.title ? item.table.title : ''} - + ${item.table.title ? item.table.title : ''} +
${tableList - .map((row) => { + .map((row,i) => { return ` - + ${row .map((cell) => { return ` `; }) @@ -7714,8 +7728,8 @@ var htmlContent=''
${ item.table.note ? item.table.note : '' @@ -7723,44 +7737,57 @@ var htmlContent=''
`; } else { - contentHtml = `

${item.content}

`; + contentHtml = `

${item.content}

`; } // 判断是否是表格类型 return contentHtml; }).join(''); - + htmlContent=`
${htmlContent}
` $('.wen_rong .content-box .conthtmn').html(htmlContent); // 引用 if (result.data.refers.length > 0) { // 如果有引用数据 - var refs = '' - var xuhao = 0 + var refs = ''; + var xuhao = 0; for (var rr = 0; rr < result.data.refers.length; rr++) { // 如果格式不正确,或者信息不全 - let item = '' + let item = ''; if (result.data.refers[rr].refer_type == 'journal' && result.data.refers[rr].doilink != '') { - // journal - xuhao++ - item = "

" + xuhao + '. ' + result.data.refers[rr].author + ' ' + result.data.refers[rr].title + ". " + result.data.refers[rr].joura + "" + result.data.refers[rr].dateno + ".  Available at: " + result.data.refers[rr].doilink + " 

" - refs += item + // journal 类型 + xuhao++; + item = "

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

"; + refs += item; } else if (result.data.refers[rr].refer_type == 'book' && result.data.refers[rr].isbn != '') { - // book - xuhao++ - item = "

" + xuhao + '. ' + result.data.refers[rr].author + ' ' + result.data.refers[rr].title + ". " + result.data.refers[rr].dateno + ".  
Available at: 

" - refs += item + // book 类型 + xuhao++; + item = "

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

"; + 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 - xuhao++ - item = "

" + xuhao + '. ' + result.data.refers[rr].refer_frag + ". 

" - refs += item + // other 类型,检查 refer_frag 中是否有 "Available at:" 链接 + xuhao++; + item = "

" + xuhao + '. '; + // 检查 refer_frag 中是否包含 "Available at:" + if (result.data.refers[rr].refer_frag.indexOf('Available at:') !== -1) { + // 如果包含 "Available at:",则在其前面插入
标签 + item += result.data.refers[rr].refer_frag.replace('Available at:', '
Available at:'); + } else { + item += result.data.refers[rr].refer_frag; + } + item += ". 

"; + refs += item; } else { continue; } } - // console.log(refs) - $('.wen_rong .content-box .conthtmn').append('

References

' + refs + '
') + // 将生成的所有引用内容插入到页面中 + $('.wen_rong .content-box .conthtmn').append('

References

' + refs + '
'); } + } }, error: function () { @@ -8270,7 +8297,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 picPreview(src) { console.log(src) diff --git a/js/articleJS/article_n.js b/js/articleJS/article_n.js index c66d28c..0c4c9d9 100644 --- a/js/articleJS/article_n.js +++ b/js/articleJS/article_n.js @@ -143,8 +143,7 @@ function initArticleN() { ${baseInfo.otStat}${arr[i].title} -
${arr[i].authortitle}
${localStorage.getItem("Journals_title")} - . ${arr[i].stage_year}, ${arr[i].stage_vol}${baseInfo.stage_}${baseInfo.npp_}${arr[i].authortitle}
${localStorage.getItem("Journals_title")}. ${arr[i].stage_year}, ${arr[i].stage_vol}${baseInfo.stage_}${baseInfo.npp_}
${baseInfo.doi_}
${baseInfo.person_img}${baseInfo.trad_tion}
${baseInfo.otStat}${arr[i].title} -
${arr[i].authortitle}
${localStorage.getItem("Journals_title")} - . ${arr[i].stage_year}, ${arr[i].stage_vol}${baseInfo.stage_}${baseInfo.npp_}${arr[i].authortitle}
${localStorage.getItem("Journals_title")}. ${arr[i].stage_year}, ${arr[i].stage_vol}${baseInfo.stage_}${baseInfo.npp_}
${baseInfo.doi_}
${baseInfo.person_img}${baseInfo.trad_tion}
- ${cell.text || ''} + ${cell.text || ''}