<commit_before>/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */


wizard = {
    validation: function (step, cid, fpage) {
        $('#courseRegistered').stepy({
            nextLabel: '<a href="javascript:void(0)" class="btn btn-default btn-sm">ต่อไป <i class="fa fa-chevron-right" aria-hidden="true"></i></a>',
            backLabel: '<a href="javascript:void(0)" class="btn btn-default btn-sm"><i class="fa fa-chevron-left" aria-hidden="true"></i> ย้อนกลับ</a>',
            block: true,
            errorImage: true,
            titleClick: false,
            validate: true,
            finishButton: false,
            next: function (step) {
                switch (step) {
                    case 1:
                        break;
                    case 2:
                        break;
                    case 3:
                        break;
                    case 4:
                        break;
                }
            },
            back: function (step) {
                switch (step) {
                    case 1:
                        break;
                    case 2:
                        break;
                    case 3:
                        break;
                    case 4:
                        break;
                }
            }
        });
        stepy_validation = $('#courseRegistered').validate({
            onfocusout: false,
            errorPlacement: function (error, element) {
                error.appendTo(element.closest("div.controls"));
            },
            highlight: function (element) {
                $(element).closest("div.control-group").addClass("error f_error");
                var thisStep = $(element).closest('form').prev('ul').find('.current-step');
                thisStep.addClass('error-image');
            },
            unhighlight: function (element) {
                $(element).closest("div.control-group").removeClass("error f_error");
                if (!$(element).closest('form').find('div.error').length) {
                    var thisStep = $(element).closest('form').prev('ul').find('.current-step');
                    thisStep.removeClass('error-image');
                }

            },
            rules: {
                'courseCate': 'required',
                'courseName': 'required',
                'courseStatus': 'required',
                'courseDuration': 'required'
//                'availableSeat': 'required'
            }, messages: {
                'courseCate': {required: 'Please select category!'},
                'courseName': {required: 'Course Name field is required!'},
                'courseStatus': {required: 'Course Status field is required!'},
                'courseDuration': {required: 'Please fill course duration (days)'}
//                'availableSeat': {required: 'Please fill available seats'}
            },
            ignore: ':hidden'
        });
    },
    //* add numbers to step titles
    steps_nb: function () {
        $('.stepy-titles').each(function () {
            $(this).children('li').each(function (index) {
                var myIndex = index + 1
                $(this).append('<span class="stepNb">' + myIndex + '</span>');
            });
        });
    }
};<commit_msg>update register_wizard<commit_after>/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */


wizard = {
    validation: function (step, cid, fpage) {
        $('#courseRegistered').stepy({
            nextLabel: '<a href="javascript:void(0)" class="btn btn-default btn-sm">ต่อไป <i class="fa fa-chevron-right" aria-hidden="true"></i></a>',
            backLabel: '<a href="javascript:void(0)" class="btn btn-default btn-sm"><i class="fa fa-chevron-left" aria-hidden="true"></i> ย้อนกลับ</a>',
            block: true,
            errorImage: true,
            titleClick: false,
            validate: true,
            finishButton: false,
            next: function (step) {
                switch (step) {
                    case 1:
                        window.location.href = "registrationCourse?cId=" + cid + "&fPage=" + fpage + "&step=" + step;
                        $('#courseRegistered').stepy('destroy');
                        break;
                    case 2:
                        window.location.href = "registrationCourse?cId=" + cid + "&fPage=" + fpage + "&step=" + step;
                        $('#courseRegistered').stepy('destroy');
                        break;
                    case 3:
                        window.location.href = "registrationCourse?cId=" + cid + "&fPage=" + fpage + "&step=" + step;
                        $('#courseRegistered').stepy('destroy');
                        break;
                    case 4:
                        window.location.href = "registrationCourse?cId=" + cid + "&fPage=" + fpage + "&step=" + step;
                        $('#courseRegistered').stepy('destroy');
                        break;
                    default :
                        window.location.href = "registrationCourse?cId=" + cid + "&fPage=" + fpage + "&step=1";
                        $('#courseRegistered').stepy('destroy');
                        break;
                }
            },
            back: function (step) {
                switch (step) {
                    case 1:
                        window.location.href = "registrationCourse?cId=" + cid + "&fPage=" + fpage + "&step=" + step;
                        $('#courseRegistered').stepy('destroy');
                        ;
                        break;
                    case 2:
                        window.location.href = "registrationCourse?cId=" + cid + "&fPage=" + fpage + "&step=" + step;
                        $('#courseRegistered').stepy('destroy');
                        break;
                    case 3:
                        window.location.href = "registrationCourse?cId=" + cid + "&fPage=" + fpage + "&step=" + step;
                        $('#courseRegistered').stepy('destroy');
                        break;
                    case 4:
                        window.location.href = "registrationCourse?cId=" + cid + "&fPage=" + fpage + "&step=" + step;
                        $('#courseRegistered').stepy('destroy');
                        break;
                    default :
                        window.location.href = "registrationCourse?cId=" + cid + "&fPage=" + fpage + "&step=1";
                        $('#courseRegistered').stepy('destroy');
                        break;
                }
            }
        });
        stepy_validation = $('#courseRegistered').validate({
            onfocusout: false,
            errorPlacement: function (error, element) {
                error.appendTo(element.closest("div.controls"));
            },
            highlight: function (element) {
                $(element).closest("div.control-group").addClass("error f_error");
                var thisStep = $(element).closest('form').prev('ul').find('.current-step');
                thisStep.addClass('error-image');
            },
            unhighlight: function (element) {
                $(element).closest("div.control-group").removeClass("error f_error");
                if (!$(element).closest('form').find('div.error').length) {
                    var thisStep = $(element).closest('form').prev('ul').find('.current-step');
                    thisStep.removeClass('error-image');
                }

            },
            rules: {
//                'courseCate': 'required',
//                'courseName': 'required',
//                'courseStatus': 'required',
//                'courseDuration': 'required'
            }, messages: {
//                'courseCate': {required: 'Please select category!'},
//                'courseName': {required: 'Course Name field is required!'},
//                'courseStatus': {required: 'Course Status field is required!'},
//                'courseDuration': {required: 'Please fill course duration (days)'}
            },
            ignore: ':hidden'
        });
        $('#courseRegistered').stepy('step', step);
    },
    //* add numbers to step titles
    steps_nb: function () {
        $('.stepy-titles').each(function () {
            $(this).children('li').each(function (index) {
                var myIndex = index + 1
                $(this).append('<span class="stepNb">' + myIndex + '</span>');
            });
        });
    }
};
{'fraction_non_alphanumeric': 0.145991270388238, 'fraction_numerical': 0.0027567195037904893, 'mean_word_length': 1.4199555308504725, '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': '2471221', 'n_tokens_mistral': 2263, 'n_tokens_neox': 2124, 'n_words': 459}