<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">

$(function () {

    $('.index-articles #current .article-list').each(function (i, e) {
        if ((i + 1) % 2 == 0) {
            $(this).after("&lt;div  class='borderp' style='clear:both;width:100%;'&gt;&lt;/div&gt;");
        }

        if ((i + 1) == $('.index-articles #current  .article-list').length) {
            $(".index-articles #current  .borderp").each(function (i, e) {
                var temp = [];
                var temp1 = $(this).prev();
                var temp2 = temp1.prev();
                temp.push(temp1.outerHeight(), temp2.outerHeight());
                var maxHeight = Math.max.apply(null, temp);
                $(temp1).css("min-height", maxHeight);
                $(temp2).css("min-height", maxHeight);
            })
        }
    })
    $('.index-articles #onlineFirst .article-list').each(function (i, e) {
        if ((i + 1) % 2 == 0) {
            $(this).after("&lt;div  class='borderp' style='clear:both;width:100%;'&gt;&lt;/div&gt;");
        }

    })
    $(".current_  a[href='#onlineFirst']").parent('li').click(function () {
        $('#onlineFirst').addClass('active in')
        comHeight('onlineFirst')
    })
    $(".current_  a[href='#accepted']").parent('li').click(function () {
        comHeight('accepted');
    })







})



$(document).scroll(function () {
    if ($("#pageViewId").val() == "shouye" || $("#pageViewId").val() == "Home") {
        var _t = $(document).scrollTop();
        var mainToTop = $('.index-main').offset().top;
        if (_t &gt; mainToTop) {
            $('.left-float-box').addClass('ac');
            $('.rightOut').addClass('ac');
        } else {
            $('.left-float-box').removeClass('ac');
            $('.rightOut').removeClass('ac');
        }
    }
})

function comHeight(t) {
    $('.index-articles #' + t + ' .article-list').each(function (i, e) {
        //console.log(e,$(e).height(),'a')
        if ((i + 1) == $('.index-articles #' + t + '  .article-list').length) {
            $('.index-articles #' + t + '  .borderp').each(function (i, e) {
                var temp = [];
                var temp1 = $(this).prev();
                var temp2 = temp1.prev();
                temp.push(temp1.outerHeight(), temp2.outerHeight());
                var maxHeight = Math.max.apply(null, temp);
                $(temp1).css("min-height", maxHeight);
                $(temp2).css("min-height", maxHeight);
            })
        }
    })
}







if ($("#tjwzOutput").length &gt; 0) {
    getRecommendList(null, '2', _language, '3', 1, function () {
        renderTpl($("#tjwzOutput"), "tjwzTpl", allData, function () {
            head.ready(function () {


            })
        })
    });
}

if ($("#tjwzenOutput").length &gt; 0) {
    getRecommendList(null, '2', _language, '2', 1, function () {
        renderTpl($("#tjwzenOutput"), "tjwzenTpl", allData, function () {
            head.ready(function () {


            })
        })
    });
}


//首页过刊浏览
if ($('#indexarchiveList').length &gt; 0) {
    getArchiveData(0, $("#indexarchiveList"), function (archiveData) {
        console.log(archiveData, "archiveData")
        archiveData.reverseKey.forEach(function (i, e) {
            archiveData.reverseArchiveData[i] = archiveData.archive_list[i].reverse();
            customConsole("reverseArchiveData----------", archiveData.reverseArchiveData);
        })
        $("#indexarchiveList").html(template("indexarchiveListTpl", archiveData));
        $('.year-list li').first().addClass('active');
        $('.issue-list ul').first().addClass('active');
        $('.year-list li').click(function (e) {
            var index = $(this).index();
            $(this).addClass('active').siblings().removeClass('active');
            $('.issue-list ul').removeClass('active');
            $('.issue-list ul').eq(index).addClass('active').siblings().removeClass('active');
        })

    })
}
/**
 * 默认的轮播推荐渲染
 */
function renderRecommendBanner() {
    renderTpl($("#recommendBanner"), "recommendBannerTpl", allData, function () {
        head.ready(function () {
            var bannerSwiper = new Swiper('.banner-swiper', {
                // loop: true,//可选选项，开启循环
                watchActiveIndex: true,
                onSlideChangeEnd: function (swiper) {
                    var activeIndex = bannerSwiper.activeLoopIndex;
                    changeBannerLi(activeIndex);
                }
            });
            if ($('.banner-ul li').length &gt; 0) {
                changeBannerLi(0);
            }
            $('.banner-ul li').hover(function () {
                var index = $(this).index();
                changeBannerLi(index);
                bannerSwiper.slideTo(index);
            })
        })
    });
}
function changeBannerLi(index) {
    $('.banner-ul li').eq(index).addClass('active').siblings().removeClass('active');
}

/**
 * 通过自动渲染或者renderTpl渲染的模板，可在此根据模板id执行后续的操作
 * @param id 渲染模板的id
 */
function afterRender(id) {
    if (id == "notice") {
        console.log("37新闻公告栏目渲染完毕");
    } else if (id == "qkryTpl") {
        var i = 0;
        //要循环的数量
        var num = $(".planting1 li").length;
        //求总宽度
        var widths = 1735;
        // $(".planting1 &gt; li").each(function () {
        //     var num_i = Number($(this).outerWidth(true));
        //     widths += num_i;

        // })
        $('.planting1').css({ 'width': widths });
        $('.planting2').css({ 'width': widths })
        $('.planting-box').css({ 'width': widths * 2 })
        var clone = $(".planting1").html();
        $(".planting2").html(clone);


        //鼠标放上暂停播放事件
        //if($('.planting1').width() &gt; $('.plantCon').width() + 30){
        var t = setInterval(moveL, 30);
        $('.plantCon').hover(function () {
            clearInterval(t)
        }, function () {
            t = setInterval(moveL, 30);
        })
        //}else{
        //$('.links .planting2').hide();
        //}

        function moveL() {
            i++;
            var sizess = $(".planting1 li").length;
            if (i &gt; widths) {
                $(".planting-box").css({ left: 0 });
                i = 0
            }
            $(".planting-box").css({ left: -i + 'px' });
        }
    }
}
/**
 * 页面上所有的文章列表渲染完后会执行此一次方法
 */
function customArticleListHandle() {

    /**
     * 图片懒加载初始化
     */
    head.ready(function () {
        var observer = lozad(); // lazy loads elements with default selector as '.lozad'
        observer.observe();
    })
}
/**
 * 目次文章渲染完毕后执行
 */
function currentIssueRenderCallBack() {
    console.log("currentIssueRender done");
}
function afterArticleMetric() {
    pdfSize2Mb();


}
function pdfSize2Mb() {
    $('.pdf-size').each(function (i, e) {
        var kbValue = Number($(this).text());
        $(this).text(kb2Mb(kbValue) + 'M');
    })

}

function kb2Mb(value, n = 1) {
    if (typeof value === 'number' &amp;&amp; !isNaN(value) &amp;&amp; value != 0) {
        return Math.round(value / 1024 * Math.pow(10, n)) / Math.pow(10, n);
    } else {
        return 0;
    }
}

/**
 * 首页或左右侧推荐栏目渲染
 */
/*
if ($("#currentCoverArticles").length &gt; 0) {
    getRecommendList(null, '2', _language, '9', 1, function () {
        renderTpl($("#currentCoverArticles"), "currentCoverArticlesTpl", allData, afterRender)
    });
}
*/

/**
 * 首页或左右侧特刊列表渲染
 */
/*
if ($("#specialSections").length &gt; 0) {
    getTopicList(_language, "0", 5, 1, function () {
        renderTpl($("#specialSections"), "specialSectionsTpl", allData.topicListData[0]);
    })
}
*/
/**
 * 首页或左右侧排行数据渲染
 */
/*
if ($("#topread").length &gt; 0) {
    getTopArticleList({ type: "top_view", max: 5, dayString: 30, currentpage: 1 }, "other", function () {
        renderTpl($("#topread"), "topreadTpl", allData);
    })
}
*/


if ($("#pageViewId").val() != 'shouye' &amp;&amp; $("#pageViewId").val() != "Home") {
    $(".main").css({ "min-height": $(window).height() - $(".footer").outerHeight() - $(".top").outerHeight() });
}


function refreshCustomAfterAjaxLoad() {
    $(function () {

        $('.swiper-title').subTextMax({
            keep_len: 55,
            add_title: false
        });

        $('.common-article-item-title').subTextMax({
            keep_len: 65,
            add_title: false
        });


    })
}

/**
 * 所有通过headjs加载的js加载完毕后调用
 */
head.ready(function () {
    $("#subscribeFormCN").validate({
        debug: true, 							//调试模式取消submit的默认提交功能   
        focusInvalid: false, 					//当为false时，验证无效时，没有焦点响应  
        onkeyup: false,
        submitHandler: function (form) {   		//表单提交句柄,为一回调函数，带一个参数：form   
            //alert("提交表单");   
            $.post(local_host + $(form).attr('action'), $(form).serialize(), function (result) {
                if ("1" == result.message) {
                    $("#submit").attr("disabled", "disabled");
                    alert("订阅成功！");
                } else {
                    alert("系统繁忙，请稍后再试！");
                }
            }, 'json');
        },
        rules: {
            type: {
                required: true
            },
            keyword: {
                required: true,
            },
            name: {
                required: true,
                minlength: 2
            },
            email: {
                required: true,
                email: true
            }
        },
        messages: {
            keyword: "请输入订阅信息！",
            type: "至少选择一种订阅类型！",
            name: {
                required: "请输入用户名！",
                minlength: "至少2个字符！"
            },
            email: "邮箱输入错误！"
        }
    });
    $("#subscribeFormEN").validate({
        debug: true, 							//调试模式取消submit的默认提交功能   
        focusInvalid: false, 					//当为false时，验证无效时，没有焦点响应  
        onkeyup: false,
        submitHandler: function (form) {   		//表单提交句柄,为一回调函数，带一个参数：form   
            //alert("提交表单");   
            $.post(local_host + $(form).attr('action'), $(form).serialize(), function (result) {
                if ("1" == result.message) {
                    $("#submit").attr("disabled", "disabled");
                    alert("Subscription success!");
                } else {
                    alert("The system is busy. Please try again later!");
                }
            }, 'json');
        },
        rules: {
            type: {
                required: true
            },
            keyword: {
                required: true,
            },
            name: {
                required: true,
                minlength: 2
            },
            email: {
                required: true,
                email: true
            }
        },
        messages: {
            keyword: "Please enter a subscription information!",
            type: "Select at least one subscription type!",
            name: {
                required: "Please enter your user name!",
                minlength: "At least 2 characters!"
            },
            email: "Mailbox input error!"
        }
    });

})


function checkSearchAlert(obj) {
    //alert($(obj).is(':checked'));
    if ($(obj).is(':checked')) {
        $("div.keyword input").prop("name", "keyword");
        $("div.keyword").show();
    } else {
        $("div.keyword input").prop("name", "");
        $("div.keyword").hide();
    }
}

//邮件退订
function doUnsubscribeCn() {
    var email = $("input[name='email']").val();
    if (!isNull(email)) {
        $.post(local_host + '/unsubscribe', { 'email': email }, function (result) {
            if ("1" == result.message) {
                $("#submit").attr("disabled", "disabled");
                alert("退订成功！");
            } else {
                alert("系统繁忙，请稍后再试！");
            }
        }, 'json');
    } else {
        alert("请输入邮箱！");
        return;
    }
}


function checkSearchAlert(obj) {
    //alert($(obj).is(':checked'));
    if ($(obj).is(':checked')) {
        $("div.keyword input").prop("name", "keyword");
        $("div.keyword").show();
    } else {
        $("div.keyword input").prop("name", "");
        $("div.keyword").hide();
    }
}

//邮件退订
function doUnsubscribeEn() {
    var email = $("input[name='email']").val();
    if (!isNull(email)) {
        $.post(local_host + '/unsubscribe', { 'email': email }, function (result) {
            if ("1" == result.message) {
                $("#submit").attr("disabled", "disabled");
                alert("Unsubscribe success!");
            } else {
                alert("The system is busy. Please try again later!");
            }
        }, 'json');
    } else {
        alert("Please enter the mailbox!");
        return;
    }
}

/**
 * 校验检索词输入状态
 * @return
 */
function checkSearch(form) {
    var searchText = $(form).find("input[name='q']").val().replace(" ", "");
    if (isNull($("#language").val()) || $("#language").val() == "cn") {
        if (typeof (searchText) == "undefined" || searchText == "" || searchText == "请输入检索词！") {
            alert("请输入检索词！");
            return false;
        }
    } else if ($("#language").val() == "en") {
        if (typeof (searchText) == "undefined" || searchText == "" || searchText == "Please enter the search word") {
            alert("Please enter the search word");
            return false;
        }
    }

    return true;
}

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