<commit_before>/**
 * Created by caoyawen on 16/1/7.
 */
$(
    function(){
        console.log("TW-2-1");

        //视图数据定义区
        window.primary_list = [
            // button的id名,button名称,是否被选中,是否可以显示
            ["primary_one", "小学一年级", false, true],
            ["primary_two", "小学二年级", false, true],
            ["primary_three", "小学三年级", false, true],
            ["primary_four", "小学四年级", false, true],
            ["primary_five", "小学五年级", false, true],
            ["primary_six", "小学六年级", false, true]];
        window.junior_list = [
            ["junior_one", "初一", false, true],
            ["junior_two", "初二", false, true],
            ["junior_three", "初三", false, true]];
        window.high_list = [
            ["high_one", "高一", false, true],
            ["high_two", "高二", false, true],
            ["high_three", "高三", false, true]
        ];
        var set_grade_select_by_html = function(grade_select_in_html, grade_list){
            for(i = 0; i < grade_select_in_html.length; i++){
                grade_list[i][2] = grade_select_in_html[i];
            }
        };
        if (window.grade_select_by_html != undefined){
            set_grade_select_by_html(window.grade_select_by_html[0], window.primary_list);
            set_grade_select_by_html(window.grade_select_by_html[1], window.junior_list);
            set_grade_select_by_html(window.grade_select_by_html[2], window.high_list);
        }

        //过滤看看哪些科目有哪些年级[名称, [小学], [初中], [高中]]
        window.subclass_mask_list = [
            ["数学", [[1,1,1,1,1,1], [1,1,1], [1,1,1]]],
            ["英语", [[1,1,1,1,1,1], [1,1,1], [1,1,1]]],
            ["语文", [[1,1,1,1,1,1], [1,1,1], [1,1,1]]],
            ["物理", [[0,0,0,0,0,0], [1,1,1], [1,1,1]]],
            ["化学", [[0,0,0,0,0,0], [1,1,1], [1,1,1]]],
            ["地理", [[0,0,0,0,0,0], [1,1,1], [1,1,1]]],
            ["历史", [[0,0,0,0,0,0], [1,1,1], [1,1,1]]],
            ["政治", [[0,0,0,0,0,0], [1,1,1], [1,1,1]]],
            ["生物", [[0,0,0,0,0,0], [1,1,1], [1,1,1]]]
        ];
        window.grand_mask = [];
        if ($("#subclass_input").val() == ""){
            window.need_select_subclass = true;
        }else{
            window.need_select_subclass = false;
        }


        //视图绘制区
        render_with_template_and_data("subclass_down_list",
        "subclass_template", ['数学', '英语', '语文',
            '物理', '化学', '地理',
            '历史', '政治', '生物']);
        render_with_template_and_data("city_down_list", "city_template",
        ["许昌市", "其他"]);
        render_grand_button_list();
        render_grand_select_button_group();

        $('#realName').bind("input propertychange change keyup blur", function(e){
            validate_ui();
        });

        $("#submit_page").click(function(eventObject){
            //console.log("submit_page");
            eventObject.preventDefault();
            if ($(this).hasClass('disabled')) {
                return;
            }
            var name = $("#realName").val();
            var gender = $("#gender-input").val();
            var region = $("#city_input").val();
            var subclass = $("#subclass_input").val();
            var grade = selected_grand();
            if (!is_all_filled()) return;
            var post_url = window.location.href;
            //关闭 beforeunload 监听
            $(window).off('beforeunload');
            malaAjaxPost(post_url,
                {
                    name:name, gender:gender, region:region, subclass:subclass, grade:JSON.stringify(grade)<commit_msg>SERVER-224: city change<commit_after>/**
 * Created by caoyawen on 16/1/7.
 */
$(
    function(){
        console.log("TW-2-1");

        //视图数据定义区
        window.primary_list = [
            // button的id名,button名称,是否被选中,是否可以显示
            ["primary_one", "小学一年级", false, true],
            ["primary_two", "小学二年级", false, true],
            ["primary_three", "小学三年级", false, true],
            ["primary_four", "小学四年级", false, true],
            ["primary_five", "小学五年级", false, true],
            ["primary_six", "小学六年级", false, true]];
        window.junior_list = [
            ["junior_one", "初一", false, true],
            ["junior_two", "初二", false, true],
            ["junior_three", "初三", false, true]];
        window.high_list = [
            ["high_one", "高一", false, true],
            ["high_two", "高二", false, true],
            ["high_three", "高三", false, true]
        ];
        var set_grade_select_by_html = function(grade_select_in_html, grade_list){
            for(i = 0; i < grade_select_in_html.length; i++){
                grade_list[i][2] = grade_select_in_html[i];
            }
        };
        if (window.grade_select_by_html != undefined){
            set_grade_select_by_html(window.grade_select_by_html[0], window.primary_list);
            set_grade_select_by_html(window.grade_select_by_html[1], window.junior_list);
            set_grade_select_by_html(window.grade_select_by_html[2], window.high_list);
        }

        //过滤看看哪些科目有哪些年级[名称, [小学], [初中], [高中]]
        window.subclass_mask_list = [
            ["数学", [[1,1,1,1,1,1], [1,1,1], [1,1,1]]],
            ["英语", [[1,1,1,1,1,1], [1,1,1], [1,1,1]]],
            ["语文", [[1,1,1,1,1,1], [1,1,1], [1,1,1]]],
            ["物理", [[0,0,0,0,0,0], [1,1,1], [1,1,1]]],
            ["化学", [[0,0,0,0,0,0], [1,1,1], [1,1,1]]],
            ["地理", [[0,0,0,0,0,0], [1,1,1], [1,1,1]]],
            ["历史", [[0,0,0,0,0,0], [1,1,1], [1,1,1]]],
            ["政治", [[0,0,0,0,0,0], [1,1,1], [1,1,1]]],
            ["生物", [[0,0,0,0,0,0], [1,1,1], [1,1,1]]]
        ];
        window.grand_mask = [];
        if ($("#subclass_input").val() == ""){
            window.need_select_subclass = true;
        }else{
            window.need_select_subclass = false;
        }


        //视图绘制区
        render_with_template_and_data("subclass_down_list",
        "subclass_template", ['数学', '英语', '语文',
            '物理', '化学', '地理',
            '历史', '政治', '生物']);
        render_with_template_and_data("city_down_list", "city_template",
        ["郑州市", "其他"]);
        render_grand_button_list();
        render_grand_select_button_group();

        $('#realName').bind("input propertychange change keyup blur", function(e){
            validate_ui();
        });

        $("#submit_page").click(function(eventObject){
            //console.log("submit_page");
            eventObject.preventDefault();
            if ($(this).hasClass('disabled')) {
                return;
            }
            var name = $("#realName").val();
            var gender = $("#gender-input").val();
            var region = $("#city_input").val();
            var subclass = $("#subclass_input").val();
            var grade = selected_grand();
            if (!is_all_filled()) return;
            var post_url = window.location.href;
            //关闭 beforeunload 监听
            $(window).off('beforeunload');
            malaAjaxPost(post_url,
                {
                    name:name, gender:gender, region:region, subclass:subclass, grade:JSON.stringify(grade)
{'fraction_non_alphanumeric': 0.19755889866590973, 'fraction_numerical': 0.034203803576497306, 'mean_word_length': 2.118141592920354, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '4362633', 'n_tokens_mistral': 2586, 'n_tokens_neox': 2622, 'n_words': 385}