<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">var pageTypeDefault = "en";
$(function () {
    /*
    if($("#articleId").length &gt; 0){
        var articleId =  $("#articleId").val();
        //citation显示
        //showCitation();
        //currentAllTextHtml();
        //关系图
        //getRelationship();
        //cited by 被引信息
        loadCitedByInfo();
        loadRelativeArticles();
        var viewType = getUrlParam("viewType");
        //访问记录
        //通栏做法,不通栏时需要调整
        getVisitInfo(articleId,3);
    }
    */
})


/**
 * 如果viewType=="HTML",默认当前显示全文内容
 * @return
 */
function currentAllTextHtml() {
    var viewType = getUrlParam("viewType");
    if (viewType &amp;&amp; "HTML" == viewType) {
        // 获取全文数据
        var articleId = $("#articleId").val();
        $.ajax({
            url: basePath + 'en/article/htmlContent',
            type: 'post',
            dataType: 'json',
            async: false,
            data: { 'id': articleId },
            success: function (data) {
                if (data.access == false) {
                    window.location.href = basePath + 'member/login';
                    //alert(data.message);
                } else {
                    $('#htmlContent').html(data.htmlContent);
                    $('#htmlContent1').html(data.htmlContent);
                    //创建文档结构树
                    currentTab = "html";
                    catalogTree();
                    //重置表格图片路径
                    setTableImg();
                    //重置全文中的公式是图片的路径
                    resetFormulaSrc();
                    //图表链接点击跳转大图
                    //showBigFigTable();
                    $(".group3").colorbox({
                        rel: 'group3', width: '90%', height: "75%", opacity: '0.8',
                        onComplete: function () {
                            $("#cboxTitle").niceScroll({
                                cursorcolor: "transparent",
                                cursoropacitymax: 1,
                                touchbehavior: false,
                                cursorwidth: "5px",
                                cursorborder: "0",
                                cursorborderradius: "5px"
                            });
                            //渲染数学公式
                            if (window.MathJax &amp;&amp; MathJax.Hub || (document.addEventListener('mathjaxLoaded', function () {
                                MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
                            }))) {
                                MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
                            }
                        }
                    });
                    $(".group4").colorbox({
                        rel: 'group4', width: '90%', height: "75%", opacity: '0.8', inline: true,
                        onComplete: function () {
                            removeTableBorder();
                            $("#cboxTitle").niceScroll({
                                cursorcolor: "transparent",
                                cursoropacitymax: 1,
                                touchbehavior: false,
                                cursorwidth: "5px",
                                cursorborder: "0",
                                cursorborderradius: "5px"
                            });
                            //渲染数学公式
                            if (window.MathJax &amp;&amp; MathJax.Hub || (document.addEventListener('mathjaxLoaded', function () {
                                MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
                            }))) {
                                MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
                            }
                        }
                    });
                }
            }
        })
        //渲染数学公式
        if (window.MathJax &amp;&amp; MathJax.Hub || (document.addEventListener('mathjaxLoaded', function () {
            MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
        }))) {
            MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
        }
    }
}

//下载pdf
function downloadpdf(articleId) {
    var url = basePath + "article/checkArticlePdf?id=" + articleId;
    $.ajax({
        type: "post",
        url: url,
        dataType: "json",
        success: function (data) {
            if (data.access != "true") {
                if (_language == "cn" || _language == "") {
                    alert(message[data.access].cn);
                } else if (_language == "en") {
                    alert(message[data.access].en);
                }
                $.ajax({
                    type: "post",
                    async: false,
                    url: basePath + "user/nowUser",
                    dataType: "text",
                    success: function (data) {
                        data = $.parseJSON(data);
                        if (isNull(data.data)) {
                            window.location.href = basePath + 'login_en.htm';
                        } else {
                            window.location.href = basePath + 'article_buy_en.htm?id=' + articleId;
                        }
                    }
                })
            } else if (data.result == 'true') {

                var url = basePath + "article/exportPdf";
                var form = $("&lt;form&gt;");   //定义一个form表单
                form.attr('style', 'display:none');   //在form表单中添加查询参数
                form.attr('target', '');
                //form.attr('method', 'post');
                form.attr('action', url);

                var input1 = $('&lt;input&gt;');
                input1.attr('type', 'hidden');
                input1.attr('name', 'id');
                input1.attr('value', articleId);

                var input2 = $('&lt;input&gt;');
                input2.attr('type', 'hidden');
                input2.attr('name', 'language');
                input2.attr('value', "en");
                $('body').append(form);  //将表单放置在web中
                form.append(input1);   //将查询参数控件提交到表单上
                form.append(input2);   //将查询参数控件提交到表单上
                form.submit();

                //添加文章PDF访问记录
                getVisitInfo(articleId, 2);
            } else if (data.result == 'false') {
                var url = window.location.href;
                var pageType = getUrlParam("pageType") || pageTypeDefault;
                if (url.indexOf("_en.htm") &gt; 0 || pageType == "en") {
                    alert("PDF not found!")
                } else {
                    alert("该文章没有PDF");
                }
            }
        },
        error: function () {
            alert("Download error, please contact the administrator!");
        }
    });
}

// pdf预览记录pdf下载量
function previewPdf(previewPdfPath, articleId) {
    var url = basePath + "article/checkArticlePdf?id=" + articleId;
    $.ajax({
        type: "post",
        url: url,
        dataType: "json",
        success: function (data) {
            if (data.access != "true") {
                if (_language == "cn" || _language == "") {
                    alert(message[data.access].cn);
                } else if (_language == "en") {
                    alert(message[data.access].en);
                }
                $.ajax({
                    type: "post",
                    async: false,
                    url: basePath + "user/nowUser",
                    dataType: "text",
                    success: function (data) {
                        data = $.parseJSON(data);
                        if (isNull(data.data)) {
                            window.location.href = basePath + 'login_en.htm';
                        } else {
                            window.location.href = basePath + 'article_buy_en.htm?id=' + articleId;
                        }
                    }
                })
            } else if (data.result == 'true') {
                window.open(previewPdfPath, '_blank');
            } else if (data.result == 'false') {
                var url = window.location.href;
                var pageType = getUrlParam("pageType") || pageTypeDefault;
                if (url.indexOf("_en.htm") &gt; 0 || pageType == "en") {
                    alert("PDF not found!")
                } else {
                    alert("该文章没有PDF");
                }
            }
        },
        error: function () {
            alert("Download error, please contact the administrator!");
        }
    });
}

//下载pdf
/**
 * 下载pdf
 * 计划整合中文的pdf下载，待优化，待处理
 * TODO:
 * @param {*} articleId 
 */
function downloadEntireIssuepdf(articleId) {
    var url = basePath + "article/checkArticlePdf?id=" + articleId;
    $.ajax({
        type: "post",
        url: url,
        dataType: "json",
        success: function (data) {
            if (data.access == false) {
                window.location.href = basePath + 'member/login';
                //alert(data.message);
            } else if (data.result == 'true') {

                var url = basePath + "article/exportEntireIssuePdf";
                var form = $("&lt;form&gt;");   //定义一个form表单
                form.attr('style', 'display:none');   //在form表单中添加查询参数
                form.attr('target', '');
                form.attr('method', 'post');
                form.attr('action', url);

                var input1 = $('&lt;input&gt;');
                input1.attr('type', 'hidden');
                input1.attr('name', 'id');
                input1.attr('value', articleId);
                $('body').append(form);  //将表单放置在web中
                form.append(input1);   //将查询参数控件提交到表单上
                form.submit();


            } else if (data.result == 'false') {
                var url = window.location.href;
                var pageType = getUrlParam("pageType") || pageTypeDefault;
                if (url.indexOf("_en.htm") &gt; 0 || pageType == "en") {
                    alert("PDF not found!")
                } else {
                    alert("该文章没有PDF");
                }
                //$(".icon-user").click();
            }
        },
        error: function () {
            alert("Download error, please contact the administrator!");
        }
    });
}

/**
 * ajax增加文章HTML浏览次数
 * @return
 */
var currentState = 0;	//当前页面不刷新只记录一次
function ajaxCountHtmlView(articleId) {
    // 获取全文数据
    var contentHtml = cacheObj.get('htmlContent', articleId) || $.ajax({
        url: basePath + 'en/article/htmlContent',
        type: 'post',
        async: false,
        dataType: 'json',
        data: { 'id': articleId },
        success: function (data) {
            if (data.access == false) {
                window.location.href = basePath + 'member/login';
                //alert(data.message);
            } else {
                data.htmlContent &amp;&amp; $('#htmlContent').html(data.htmlContent);
                data.htmlContent &amp;&amp; $('#htmlContent1').html(data.htmlContent);
                cacheObj.set('htmlContent', articleId, true)
            }
        }
    });
    $(".group3").colorbox({
        rel: 'group3', width: '90%', height: "75%", opacity: '0.8',
        onComplete: function () {
            $("#cboxTitle").niceScroll({
                cursorcolor: "transparent",
                cursoropacitymax: 1,
                touchbehavior: false,
                cursorwidth: "5px",
                cursorborder: "0",
                cursorborderradius: "5px"
            });
            //渲染数学公式
            if (window.MathJax &amp;&amp; MathJax.Hub || (document.addEventListener('mathjaxLoaded', function () {
                MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
            }))) {
                MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
            }
        }
    });
    $(".group4").colorbox({
        rel: 'group4', width: '90%', height: "75%", opacity: '0.8', inline: true,
        onComplete: function () {
            removeTableBorder();
            $("#cboxTitle").niceScroll({
                cursorcolor: "transparent",
                cursoropacitymax: 1,
                touchbehavior: false,
                cursorwidth: "5px",
                cursorborder: "0",
                cursorborderradius: "5px"
            });
            //渲染数学公式
            if (window.MathJax &amp;&amp; MathJax.Hub || (document.addEventListener('mathjaxLoaded', function () {
                MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
            }))) {
                MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
            }
        }
    });
    //重置图表中table是图片的路径
    setTableImg();
    //重置全文中的公式是图片的路径
    resetFormulaSrc();
}

//loadArticleMetricCount($("#articleId").val());
/**
 * 单篇论文查询cnki被引信息
 * @return
 */
function loadCitedByInfo() {
    var id = $("#articleId").val();
    var ajaxArg = {
        url: basePath + "article/getArticleCitedBy",
        data: { 'articleIds': id },
        returnFun: outCitedByInfo
    };
    ajaxPost(ajaxArg);
}

function showSupplementary(id) {
    $('#file_' + id).toggle();
}
$(function () {
    if ($('.supp-preview')) {
        $('.supp-preview').click(function () {
            $(this).toggleClass('show');
        })
    }
})

/**
 * 输出列表中的文章citedBy引证文献信息
 * @param data
 * @param indexArray
 * @return
 */
function outCitedByInfo(data) {
    if (typeof (data) != "undefined") {
        data = jQuery.parseJSON(data);
        console.log("citedBy  data", data);
        allData.allCitedBy = data;
        console.log(allData);
        $.each(allData.allCitedBy, function (i, e) {
            if (e.citedCount &gt; 0) {
                $(".citedByCount").html(e.citedCount);
                $(".citedByCount").parent().show();
                var jnum = 0;
                $.each(e.citedByArticles, function (i, v) {
                    if (v.articleType == "journal") {
                        jnum++;
                    }
                })
                var qtnum = e.citedCount - jnum;
                allData.jnum = jnum;
                allData.qtnum = qtnum;
            }
        })

        // $("#citedByNode").html(template("citedByTpl", allData));
        renderTpl($("#citedby-info"), "citedByTpl", allData);
    }
}

/**
 * 输出相关文章
 */
function loadRelativeArticles() {
    var id = $("#articleId").val();
    var ajaxArg = {
        url: basePath + "data/article/relativeArticles",
        data: {
            'id': id,
            'language': 'en'
        },
        returnFun: outRelativeArticles
    };
    ajaxPost(ajaxArg);
}


function outRelativeArticles(data) {
    if (typeof (data) != "undefined") {
        //		console.log("aaa");
        //		var type=$("#journalreferenceCodeType").val();
        console.log("retativeArticlesList", data.data);
        allData.retativeArticlesList = data.data.list;
        var html = '';
        //html += '&lt;h3 class="navTitle" id="relative-article"&gt;Relative Articles&lt;/h3&gt;';
        //		
        //		$.each(data,function(x,y){
        //			$.each(y,function(i,e){
        //				html+='&lt;tr class="document-box"&gt;';
        //				html+='&lt;td valign="top" class="td1"&gt;['+(i+1)+']&lt;/td&gt;';
        //				html+='&lt;td class="td2"&gt;';
        //				if(type=='2'){
        //					var size=e.authorEnList.length;
        //					$.each(e.authorEnList,function(a,b){
        //						if(a&lt;size-1){
        //							html+=b+', ';
        //						}else{
        //							html+=b+', ';
        //						}
        //					})
        //					html+=e.year+': ';
        //					if(!isNull(e.doi)){
        //						html+='&lt;a class="relative-title" target="_blank" href="'+basePath+'/en/article/doi/'+e.doi+'"  class="mainColor"&gt;'+e.titleEn+',&lt;/a&gt; '+e.journalTitleEn;
        //					}else{
        //						html+='&lt;a class="relative-title" target="_blank" href="'+basePath+'/en/article/id/'+e.id+'"  class="mainColor"&gt;'+e.titleEn+',&lt;/a&gt; '+e.journalTitleEn;
        //					}
        //					if(!isNull(e.articleState)){
        //						html+='.';
        //					}else{
        //						html+=', '+e.volume+', '+e.fpage+'-'+e.lpage+'.';
        //					}
        //				}else{
        //					var size=e.authorEnList.length;
        //					$.each(e.authorEnList,function(a,b){
        //						if(a&lt;size-1){
        //							html+=b+', ';
        //						}else{
        //							html+=b+'. ';
        //						}
        //					})
        //					if(!isNull(e.doi)){
        //						html+='&lt;a class="relative-title" target="_blank" href="'+basePath+'/en/article/doi/'+e.doi+'"  class="mainColor"&gt;'+e.titleEn+',&lt;/a&gt; '+e.journalTitleEn+'. ';
        //					}else{
        //						html+='&lt;a class="relative-title" target="_blank" href="'+basePath+'/en/article/id/'+e.id+'"  class="mainColor"&gt;'+e.titleEn+',&lt;/a&gt; '+e.journalTitleEn+'. ';
        //					}
        //					if(isNull(e.articleState)){
        //						html+=e.year+', '+e.volume+', '+e.fpage+'-'+e.lpage+'.';
        //					}
        //					
        //						
        //				}
        //				if(!isNull(e.doi)){
        //					html+='&lt;b style="display:inline-block; font-weight:normal;"&gt;';
        //					html+='doi: &lt;a class="mainColor doi" target="_blank" href="'+basePath+'/en/article/doi/'+e.doi+'"&gt;'+e.doi+'&lt;/a&gt;&lt;/b&gt;';
        //				}
        //				html+='&lt;/td&gt;&lt;/tr&gt;';
        //			})
        //		})
        //		html+='&lt;/table&gt;';
        $("#RelatedPages").html(html + template("articleEnRelativeArticlesTpl", allData));
        //相关文章
        $(".relative-left-list a").html($("#relative-article").text());
        $(".relative-left-list a").attr({ "href": '#' + $("#relative-article").attr("id") });
        if (window.MathJax &amp;&amp; MathJax.Hub || (document.addEventListener('mathjaxLoaded', function () {
            MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
        }))) {
            MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
        }
    }
}





</pre></body></html>