<commit_before><!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="../../build/aui-css/css/bootstrap.css">
    <script src="../../build/aui/aui.js"></script>
</head>
<body>
    <h1>AlloyUI - Form Validator</h1>
    <h2>Rules extracted from HTML markup</h2>
    <form action="" id="fm1" name="fm1">
        <div class="aui-control-group">
            <label class="aui-control-label" for="digit1">Digit (required)</label>
            <div class="aui-controls">
                <input name="digit1" id="digit1" class="aui-field-required aui-field-digits" type="text">
            </div>
        </div>
        <div class="aui-control-group">
            <label class="aui-control-label" for="email1">E-Mail</label>
            <div class="aui-controls">
                <input name="email1" id="email1" class="aui-field-email" type="text">
            </div>
        </div>
    </form>
    <h2>Rules passed from JavaScript</h2>
    <form action="" id="fm2" name="fm2">
        <div class="aui-control-group">
            <label class="aui-control-label" for="digit2">Digit (required)</label>
            <div class="aui-controls">
                <input name="digit2" id="digit2" type="text">
            </div>
        </div>
        <div class="aui-control-group">
            <label class="aui-control-label" for="email2">E-Mail</label>
            <div class="aui-controls">
                <input name="email2" id="email2" type="text">
            </div>
        </div>
        <div class="aui-control-group">
            <label class="aui-control-label" for="custom">Custom rule (digit >= 50)</label>
            <div class="aui-controls">
                <input name="custom" id="custom" type="text">
            </div>
        </div>
    </form>
    <script>
    YUI({ filter:'raw' }).use('aui-form-validator', function(A) {

        new A.FormValidator({
            boundingBox: A.one('#fm1'),
            showAllMessages: true
        });

        YUI.defaults.FormValidator.STRINGS.gt50 = 'The digit should be >= 50.';
        YUI.defaults.FormValidator.RULES.gt50 = function(val, fieldNode, ruleValue) {
            return (val >= 50);
        };
        new A.FormValidator({
            boundingBox: A.one('#fm2'),
            showAllMessages: true,
            rules: {
                digit2: {
                    digits: true,
                    required: true
                },
                email2: {
                    email: true
                },
                custom: {
                    digits: true,
                    gt50: true
                }
            }
        });

    });<commit_msg>Update Y.config on demos<commit_after><!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="../../build/aui-css/css/bootstrap.css">
    <script src="../../build/aui/aui.js"></script>
</head>
<body>
    <h1>AlloyUI - Form Validator</h1>
    <h2>Rules extracted from HTML markup</h2>
    <form action="" id="fm1" name="fm1">
        <div class="aui-control-group">
            <label class="aui-control-label" for="digit1">Digit (required)</label>
            <div class="aui-controls">
                <input name="digit1" id="digit1" class="aui-field-required aui-field-digits" type="text">
            </div>
        </div>
        <div class="aui-control-group">
            <label class="aui-control-label" for="email1">E-Mail</label>
            <div class="aui-controls">
                <input name="email1" id="email1" class="aui-field-email" type="text">
            </div>
        </div>
    </form>
    <h2>Rules passed from JavaScript</h2>
    <form action="" id="fm2" name="fm2">
        <div class="aui-control-group">
            <label class="aui-control-label" for="digit2">Digit (required)</label>
            <div class="aui-controls">
                <input name="digit2" id="digit2" type="text">
            </div>
        </div>
        <div class="aui-control-group">
            <label class="aui-control-label" for="email2">E-Mail</label>
            <div class="aui-controls">
                <input name="email2" id="email2" type="text">
            </div>
        </div>
        <div class="aui-control-group">
            <label class="aui-control-label" for="custom">Custom rule (digit >= 50)</label>
            <div class="aui-controls">
                <input name="custom" id="custom" type="text">
            </div>
        </div>
    </form>
    <script>
    YUI({ filter:'raw' }).use('aui-form-validator', function(A) {

        new A.FormValidator({
            boundingBox: A.one('#fm1'),
            showAllMessages: true
        });

        A.config.FormValidator.STRINGS.gt50 = 'The digit should be >= 50.';
        A.config.FormValidator.RULES.gt50 = function(val, fieldNode, ruleValue) {
            return (val >= 50);
        };
        new A.FormValidator({
            boundingBox: A.one('#fm2'),
            showAllMessages: true,
            rules: {
                digit2: {
                    digits: true,
                    required: true
                },
                email2: {
                    email: true
                },
                custom: {
                    digits: true,
                    gt50: true
                }
            }
        });

    });
{'fraction_non_alphanumeric': 0.16614187812557882, 'fraction_numerical': 0.014447119837006852, 'mean_word_length': 1.6879044300647088, 'pattern_counts': {'":': 0, '<': 117, '<?xml version=': 0, '>': 123, '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': '1055124', 'n_tokens_mistral': 1699, 'n_tokens_neox': 1622, 'n_words': 311}