<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">if ($("#recommendBanner2").length &gt; 0) {
    getRecommendList(null, 0, _language, '5', 1, function () {
        renderTpl($("#recommendBanner2"), "recommendBannerTpl2", allData, function(){
        $('.banner #myCarousel').carousel();
        })
    });
}

if ($("#tyzsCon").length &gt; 0) {
    getRecommendList(null, 2, _language, '4', 1, function () {
        renderTpl($("#tyzsCon"), "tyzsTpl", allData, function(){
        
        })
    });
}
$('#rightTab &gt; li').click(function(){
    var index = $(this).index();
    //alert(index);
    $('.nav .right-tab-more').eq(index).addClass('cur').siblings().removeClass('cur');
})

//精品专题
if ($("#jpzt").length &gt; 0) {
    getTopicList(_language, "3", 4, 1, function () {
        renderTpl($("#jpzt"), "jpztTpl", allData.topicListData[3]);
    })
}
//虚拟专题
if ($("#xnzt").length &gt; 0) {
    getTopicList(_language, "2", 4, 1, function () {
        renderTpl($("#xnzt"), "xnztTpl", allData.topicListData[2]);
    })
}



/**
 * 默认的轮播推荐渲染
 */
function renderRecommendBanner() {
/*
    renderTpl($("#recommendBanner"), "recommendBannerTpl", allData, function () {
        head.ready(function () {
            var bannerSwiper = new Swiper(".swiper-container", {
                loop: true,
                pagination: '.main-pagination',
                paginationClickable: true,
                autoplay: true,
                speed: 1500,
            })
            $('.swiper-button-prev').click(function () {
                bannerSwiper.slidePrev();
            })
            $('.swiper-button-next').click(function () {
                bannerSwiper.slideNext();
            })
        })
    });
    */
}

/**
 * 通过自动渲染或者renderTpl渲染的模板，可在此根据模板id执行后续的操作
 * @param id 渲染模板的id
 */
function afterRender(id) {
    if (id == "hzhbTpl") {
       $('#partners-owl').owlCarousel({
	      items: 6,
	      itemsDesktop: [1200, 6],
	      itemsDesktopSmall: [992, 3],
	      itemsTablet: [768, 3],
	      itemsTabletSmall: [450, 2],
	      itemsMobile: [360, 2],
	      navigation: true,
	      navigationText: ["", ""],
	      autoPlay: true,
	      rewindSpeed: 300,
          loop:true,
          autoplayTimeout: 3000,
        })
    }
}
/**
 * 页面上所有的文章列表渲染完后会执行此一次方法
 */
function customArticleListHandle() {

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

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

/**
 * 首页或左右侧特刊列表渲染
 */
//所有特刊
if ($("#specialSections").length &gt; 0) {
    getTopicList(_language, "", 4, 1, function () {
        renderTpl($("#specialSections"), "specialSectionsTpl", allData.topicListData['']);
    })
}

/**
 * 首页或左右侧排行数据渲染
 */
/*
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;
    }
}
</pre></body></html>