<commit_before>import $ from 'jquery';
import 'bootstrap';
import { icsGenerate } from './lib/utils';

$(document).ready(() => {
	$('form').submit(e => {
		// prevent form submitting, we'll use ajax instead
		e.preventDefault();

		$('#ics-anchor button').removeClass('btn-danger').text('請稍等');

		// TODO: different school would have different regex
		//       regex should be put in a seperate file
		var course_datas = [];
		var course_codes = $('form #raw-input-textarea').val().match(/[A-Z\d]{9}/g);

		if (!course_codes) {
			$('#ics-anchor button').addClass('btn-danger').text('課程代碼錯誤');
			return;
		}

		var done = 0; // jquery ajax parallel job workaround
		var jobCount = course_codes.length;<commit_msg>make sure disabled step 3 button in start<commit_after>import $ from 'jquery';
import 'bootstrap';
import { icsGenerate } from './lib/utils';

$(document).ready(() => {
	$('form').submit(e => {
		// prevent form submitting, we'll use ajax instead
		e.preventDefault();

		$('#ics-anchor button').attr('disabled', '').removeClass('btn-success').removeClass('btn-danger').text('請稍等');

		// TODO: different school would have different regex
		//       regex should be put in a seperate file
		var course_datas = [];
		var course_codes = $('form #raw-input-textarea').val().match(/[A-Z\d]{9}/g);

		if (!course_codes) {
			$('#ics-anchor button').addClass('btn-danger').text('課程代碼錯誤');
			return;
		}

		var done = 0; // jquery ajax parallel job workaround
		var jobCount = course_codes.length;
{'fraction_non_alphanumeric': 0.18193891102257637, 'fraction_numerical': 0.0033200531208499337, 'mean_word_length': 3.9572368421052633, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2670054', 'n_tokens_mistral': 523, 'n_tokens_neox': 475, 'n_words': 123}