<commit_before><%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form"%>

<html>
<head>
    <title>Assign Participant Coordinators</title>
    <tags:includeScriptaculous/>
    <style type="text/css">
        div.label {
            width: 35%;
        }

        div.submit {
            text-align: right;
        }

        form {
            width: 20em;
        }
    </style>
    <script type="text/javascript">

        function registerSiteSelector() {
            Event.observe("siteSelector", "change", function() {
                $('site-indicator').reveal();
                SC.slideAndHide("assignmentForm", {
                    afterFinish: function() {
                        var siteId = $("siteSelector").options[$("siteSelector").selectedIndex].value
                        if (siteId) {
                            SC.asyncSubmit("siteSelectorForm", {
                                onComplete: function() {
                                    $('site-indicator').conceal();
                                }
                            })
                        } else {
                            $('site-indicator').conceal();
                        }
                    }
                })
            })
        }

        function moveSelected(src, dst) {
            for (var i = 0; i < src.options.length; i++) {
                var srcOpt = src.options[i];
                if (srcOpt.selected) {
                    dst.options[dst.length] = new Option(srcOpt.text, srcOpt.value)
                    src.options[i] = null;
                    i--
                }
            }
            if (src.options[0]) {
                src.options[0].selected = true;
            }
        }

        Event.observe(window, "load", registerSiteSelector)
        Event.observe(window, "load", function() {
            Event.observe("assign-button", "click", function() {
                moveSelected($('availableCoordinators'), $('assignedCoordinators'))
            })
            Event.observe("remove-button", "click", function() {
                moveSelected($('assignedCoordinators'), $('availableCoordinators'))
            })
        })

    </script>
</head>
<body><commit_msg>Javascript to do select all before submitting<commit_after><%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form"%>

<html>
<head>
    <title>Assign Participant Coordinators</title>
    <tags:includeScriptaculous/>
    <style type="text/css">
        div.label {
            width: 35%;
        }

        div.submit {
            text-align: right;
        }

        form {
            width: 20em;
        }
    </style>
    <script type="text/javascript">

        function registerSiteSelector() {
            Event.observe("siteSelector", "change", function() {
                $('site-indicator').reveal();
                SC.slideAndHide("assignmentForm", {
                    afterFinish: function() {
                        var siteId = $("siteSelector").options[$("siteSelector").selectedIndex].value
                        if (siteId) {
                            SC.asyncSubmit("siteSelectorForm", {
                                onComplete: function() {
                                    $('site-indicator').conceal();
                                }
                            })
                        } else {
                            $('site-indicator').conceal();
                        }
                    }
                })
            })
        }

        function moveSelected(src, dst) {
            for (var i = 0; i < src.options.length; i++) {
                var srcOpt = src.options[i];
                if (srcOpt.selected) {
                    dst.options[dst.length] = new Option(srcOpt.text, srcOpt.value)
                    src.options[i] = null;
                    i--
                }
            }
            if (src.options[0]) {
                src.options[0].selected = true;
            }
        }

        function selectAll(selector) {
            var sel = $(selector)
            $A(sel.options).each(function(opt) {
                opt.selected = true;
            })
        }

        Event.observe(window, "load", registerSiteSelector)
        Event.observe(window, "load", function() {
            Event.observe("assign-button", "click", function() {
                moveSelected($('availableCoordinators'), $('assignedCoordinators'))
            })
            Event.observe("remove-button", "click", function() {
                moveSelected($('assignedCoordinators'), $('availableCoordinators'))
            })
        })

        Event.observe(window, "load", function() {
            Event.observe("assignmentForm", "submit", function() {
                selectAll("assignedCoordinators")
                selectAll("availableCoordinators")
            })
        })

    </script>
</head>
<body>
{'fraction_non_alphanumeric': 0.14472472841097403, 'fraction_numerical': 0.0025777941447247283, 'mean_word_length': 1.4228367528991972, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6031901', 'n_tokens_mistral': 1502, 'n_tokens_neox': 1410, 'n_words': 223}