<commit_before>(function ($) {
    $.fn.carouselBox = function (options) {
        var infoArr  = options.infoArr, // 图片提示信息
            inOut    = options.inOut, // 图片切换效果
            prevNext = options.prevNext, // 左右切换键是否显示
            duration = (options.duration == "default" ? 2500 : options.duration), // 图片轮播间隔时间
            caroselBoxWidth  = $(".caroselBox").width(), // 盒子的宽度
            caroselBoxHeight = $(".caroselBox").height(), // 盒子的高度
            curIndex = 0,
            imgLen   = $('.img').length;

        // 当设置的盒子高度小于180px时不显示提示信息
        if (caroselBoxHeight < 180) {
            infoArr = [];
        }

        //根据获取到的盒子宽度高度设置盒子内的图片、提示信息的大小及位置
        $(".caroselBox").css({"height":caroselBoxHeight,"width":caroselBoxWidth});
        $(".imgList").css({"width": caroselBoxWidth, "height": caroselBoxHeight});
        $(".imgList img").css({"width": caroselBoxWidth, "height": caroselBoxHeight});

        // 图片切换左右键
        var addCtrlHtml = '<div class="addCtrl">'
                        + '<div class="prev"></div>'
                        + '<div class="next"></div></div>';
        // + '<div id="prev"><img class="arrowBtn" src="img/iconfont-arrowleftwhite.png" alt=""></div>'
        // + '<div id="next"><img class="arrowBtn" src="img/iconfont-arrowrightwhite.png" alt=""></div></div>';

        var footerHtml = '<div class="footer"></div>';
        
        $(".caroselBox").append(addCtrlHtml,footerHtml);

        if(prevNext == false){//关闭左右切换键
          $(".addCtrl").hide();
        }
        var infoListSize  = imgLen,
            footerInfoLi  = '<ul class="infoList">',
            footerIndexLi = '<ul class="indexList">';

        for( var i = 0; i < imgLen; i ++ ) {
            if (i == 0) {                    
                footerInfoLi += '<li class="infoOn">' + ( infoArr[i] == null ? "" : infoArr[i] ) + '</li>';
                footerIndexLi +='<li class="indexOn"></li>';
            }else{
                footerInfoLi += '<li>' + ( infoArr[i] == null ? "" : infoArr[i] ) + '</li>';
                footerIndexLi +='<li></li>';                   
            }
        }

        footerIndexLi += '</ul>';
        footerIndexLi += '</ul>';

        $(".infoList").append(footerInfoLi);
        $(".indexList").append(footerIndexLi);
        $(".footer").append(footerInfoLi, footerIndexLi); 

        $(".prev").css({"top": caroselBoxHeight/2.5});
        $(".next").css({"top": caroselBoxHeight/2.5});

        $(".arrowBtn").css({
            "top": caroselBoxHeight/400,
            "position": "absolute"
        })

        var footerH = caroselBoxHeight*0.2 > 50 ? "50" : caroselBoxHeight*0.2;
        $(".footer").css({ "height": footerH});

        //var infoListH = caroselBoxHeight*0.1 > 50 ? "50" ：caroselBoxHeight*0.1; 
        $(".infoList").css({"height": footerH-20});

        $(".indexList").css({ "height": footerH});
<commit_msg>优化代码<commit_after>(function ($) {
    $.fn.carouselBox = function (options) {
        var infoArr  = options.infoArr, // 图片提示信息
            inOut    = options.inOut, // 图片切换效果
            prevNext = options.prevNext, // 左右切换键是否显示
            duration = (options.duration == "default" ? 2500 : options.duration), // 图片轮播间隔时间
            caroselBoxWidth  = $(".caroselBox").width(), // 盒子的宽度
            caroselBoxHeight = $(".caroselBox").height(), // 盒子的高度
            curIndex = 0,
            imgLen   = $('.img').length;

        // 当设置的盒子高度小于180px时不显示提示信息
        if (caroselBoxHeight < 180) {
            infoArr = [];
        }

        //根据获取到的盒子宽度高度设置盒子内的图片、提示信息的大小及位置 
        $(".caroselBox, .imgList, .imgList img").css({"height":caroselBoxHeight,"width":caroselBoxWidth});
        //$(".imgList").css({"width": caroselBoxWidth, "height": caroselBoxHeight});
        //$(".imgList img").css({"width": caroselBoxWidth, "height": caroselBoxHeight});

        // 图片切换左右键
        var addCtrlHtml = '<div class="addCtrl"> \
                          <div class="prev"></div> \
                          <div class="next"></div></div>';

        var footerHtml = '<div class="footer"></div>';
        
        $(".caroselBox").append(addCtrlHtml,footerHtml);

        if(prevNext == false){//关闭左右切换键
          $(".addCtrl").hide();
        }
        var infoListSize  = imgLen,
            footerInfoLi  = '<ul class="infoList">',
            footerIndexLi = '<ul class="indexList">';

        for( var i = 0; i < imgLen; i ++ ) {
            if (i == 0) {                    
                footerInfoLi += '<li class="infoOn">' + ( infoArr[i] == null ? "" : infoArr[i] ) + '</li>';
                footerIndexLi +='<li class="indexOn"></li>';
            }else{
                footerInfoLi += '<li>' + ( infoArr[i] == null ? "" : infoArr[i] ) + '</li>';
                footerIndexLi +='<li></li>';                   
            }
        }

        footerInfoLi += '</ul>';
        footerIndexLi += '</ul>';

        $(".infoList").append(footerInfoLi);
        $(".indexList").append(footerIndexLi);
        $(".footer").append(footerInfoLi, footerIndexLi); 

        $(".prev").css({"top": caroselBoxHeight/2.5});
        $(".next").css({"top": caroselBoxHeight/2.5});

        $(".arrowBtn").css({
            "top": caroselBoxHeight/400,
            "position": "absolute"
        })

        var footerH = caroselBoxHeight*0.2 > 50 ? "50" : caroselBoxHeight*0.2;
        $(".footer").css({ "height": footerH});

        //var infoListH = caroselBoxHeight*0.1 > 50 ? "50" ：caroselBoxHeight*0.1; 
        $(".infoList").css({"height": footerH-20});

        $(".indexList").css({ "height": footerH});

{'fraction_non_alphanumeric': 0.19477519104318464, 'fraction_numerical': 0.01350630886795806, 'mean_word_length': 1.9589905362776026, 'pattern_counts': {'":': 26, '<': 54, '<?xml version=': 0, '>': 54, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '461791', 'n_tokens_mistral': 1985, 'n_tokens_neox': 1928, 'n_words': 289}