<commit_before>$(function() {
    window.requestAnimationFrame = (function() {
        return window.requestAnimationFrame ||
            window.webkitRequestAnimationFrame ||
            window.mozRequestAnimationFrame ||
            function(callback) {
                window.setTimeout(callback, 1000 / 60);
            };
    })();

    var obj = {
        init: function() {
            var ua = navigator.userAgent.toLowerCase();
            if (ua.match(/MicroMessenger/i) == "micromessenger") {
                this.hideHeadView();
            }
            this.loadData();
        },

        loadData: function() {
            $.ajax({
                url: 'js/city.json',
                dataType: 'json',
                success: function(data) {
                    this.applyHtml(data)
                }.bind(this),
                error: function() {
                    //
                }
            })
        },

        scroller: null,

        scrollTop: 0,

        applyHtml: function(data) {
            var citys = document.querySelector('#citys');

            var html = "";
            var letters = [];
            data.forEach(function(obj) {
                html += [
                    '<li>',
                    '<dl>',
                    '<dt id="' + obj.Index + '" class="title">', obj.Index, '</dt>',
                    (function() {
                        var temp = "";
                        obj.Citys = obj.Citys.slice(0, parseInt(Math.random() * 10) + 5);
                        obj.Citys.forEach(function(o) {
                            temp += '<dd class="data">' + o.Name + '</dd>'
                        });
                        return temp;
                    })(),
                    '</dl>',
                    '</li>'
                ].join('');
                letters.push()
            });
            citys.innerHTML = html;
            var li = document.createElement('li');
            li.style.cssText = "text-align: center;font-size: 0.9em;color: #717171;padding: 10px 0 60px";
            li.innerText = "没有更多数据！";
            citys.appendChild(li);

            var bar = document.querySelector('.bar');
            var barHtml = '';
            data.forEach(function(obj) {
                barHtml += [
                    '<li class="item">', obj.Index, '</li>'
                ].join('')
            });

            bar.innerHTML = barHtml;

            this.initNavLetter();
            this.initScrollBar();
            this.iOSOverflowScroll(citys);
        },

        hideHeadView: function() {
            document.querySelector('header').style.display = "none";
            document.querySelector('section').style.height = "100%";
        },

        render: function() {
            console.log('xxxx');
            var nowTop = this.scroller.scrollTop;
            if (nowTop != this.scrollTop) {
                this.scrollTop = nowTop;
                requestAnimationFrame(this.render)
            }
        },

        initNavLetter: function() {
            var scope = this;
            var citys = document.querySelector('#citys');
            this.scroller = citys;
            var letters = document.querySelectorAll('.title');
            var fixed = document.querySelector('.fixed');
            fixed.innerText = letters[0].innerText;
            var timer = null;

            var isFirst = true;

            citys.addEventListener('scroll', function(e) {
                var self = this;
                if (isFirst) {
                    requestAnimationFrame(scope.render.bind(scope));
                    isFirst = false;
                }

                requestAnimationFrame(function() {
                    var current = letters[0];<commit_msg>Update index.js<commit_after>$(function() {
    window.requestAnimationFrame = (function() {
        return window.requestAnimationFrame ||
            window.webkitRequestAnimationFrame ||
            window.mozRequestAnimationFrame ||
            function(callback) {
                window.setTimeout(callback, 1000 / 60);
            };
    })();

    var obj = {
        init: function() {
            var ua = navigator.userAgent.toLowerCase();
            if (ua.match(/MicroMessenger/i) == "micromessenger") {
                this.hideHeadView();
            }
            this.loadData();
        },

        loadData: function() {
            $.ajax({
                url: 'js/city.json',
                dataType: 'json',
                success: function(data) {
                    this.applyHtml(data)
                }.bind(this),
                error: function() {
                    //
                }
            })
        },

        scroller: null,

        scrollTop: 0,

        applyHtml: function(data) {
            var citys = document.querySelector('#citys');

            var html = "";
            var letters = [];
            data.forEach(function(obj) {
                html += [
                    '<li>',
                    '<dl>',
                    '<dt id="' + obj.Index + '" class="title">', obj.Index, '</dt>',
                    (function() {
                        var temp = "";
                        obj.Citys = obj.Citys.slice(0, parseInt(Math.random() * 10) + 5);
                        obj.Citys.forEach(function(o) {
                            temp += '<dd class="data">' + o.Name + '</dd>'
                        });
                        return temp;
                    })(),
                    '</dl>',
                    '</li>'
                ].join('');
                letters.push()
            });
            citys.innerHTML = html;
            var li = document.createElement('li');
            li.style.cssText = "text-align: center;font-size: 0.9em;color: #717171;padding: 10px 0 60px";
            li.innerText = "没有更多数据！";
            citys.appendChild(li);

            var bar = document.querySelector('.bar');
            var barHtml = '';
            data.forEach(function(obj) {
                barHtml += [
                    '<li class="item">', obj.Index, '</li>'
                ].join('')
            });

            bar.innerHTML = barHtml;

            this.initNavLetter();
            this.initScrollBar();
            this.iOSOverflowScroll(citys);
        },

        hideHeadView: function() {
            document.querySelector('header').style.display = "none";
            document.querySelector('section').style.height = "100%";
        },

        render: function() {
            console.log('xxxx');
            var nowTop = this.scroller.scrollTop;
            if (nowTop != this.scrollTop) {
                this.scrollTop = nowTop;
                requestAnimationFrame(this.render.bind(this))
            }
        },

        initNavLetter: function() {
            var scope = this;
            var citys = document.querySelector('#citys');
            this.scroller = citys;
            var letters = document.querySelectorAll('.title');
            var fixed = document.querySelector('.fixed');
            fixed.innerText = letters[0].innerText;
            var timer = null;

            var isFirst = true;

            citys.addEventListener('scroll', function(e) {
                var self = this;
                if (isFirst) {
                    requestAnimationFrame(scope.render.bind(scope));
                    isFirst = false;
                }

                requestAnimationFrame(function() {
                    var current = letters[0];
{'fraction_non_alphanumeric': 0.1306946473635277, 'fraction_numerical': 0.007703546287687608, 'mean_word_length': 1.2082111436950147, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '3454693', 'n_tokens_mistral': 1948, 'n_tokens_neox': 1823, 'n_words': 336}