<commit_before>var WorkbenchLogin = new function() {

    var form = document.getElementById('login_form');

    this.initializeForm = function(loginType) {
        var loginTypeElem = form['loginType_' + loginType];
        if (loginTypeElem === undefined) {
            alert("Unknown login type '" + loginType + "'. Check configuration!");
            return;
        }
        switchLoginTypeTo(loginTypeElem);

        if (wbLoginConfig.customServerUrl === "") {
            buildServerUrl();
        } else {
            form.serverUrl.value = wbLoginConfig.customServerUrl;
        }

        bindEvent(form.loginType_std, "click", function () {switchLoginTypeTo(this)});
        bindEvent(form.loginType_adv, "click", function () {switchLoginTypeTo(this)});
        bindEvent(form.loginType_oauth, "click", function () {switchLoginTypeTo(this)});

        bindEvent(form.un, "keyup", toggleUsernamePasswordSessionDisabled);
        bindEvent(form.pw, "keyup", toggleUsernamePasswordSessionDisabled);
        bindEvent(form.sid, "keyup", toggleUsernamePasswordSessionDisabled);<commit_msg>Issue 511: 	WorkbenchLogin.initialzeForm() is failing if oauth is not enabled<commit_after>var WorkbenchLogin = new function() {

    var form = document.getElementById('login_form');

    this.initializeForm = function(loginType) {
        var loginTypeElem = form['loginType_' + loginType];
        if (loginTypeElem === undefined) {
            alert("Unknown login type '" + loginType + "'. Check configuration!");
            return;
        }
        switchLoginTypeTo(loginTypeElem);

        if (wbLoginConfig.customServerUrl === "") {
            buildServerUrl();
        } else {
            form.serverUrl.value = wbLoginConfig.customServerUrl;
        }

        // add listeners to the loginType radio buttons
        var loginTypes = document.getElementsByName("loginType");
        for (var i = 0; i < loginTypes.length; i++) {
            bindEvent(loginTypes[i], "click", function () {switchLoginTypeTo(this)});
        }

        bindEvent(form.un, "keyup", toggleUsernamePasswordSessionDisabled);
        bindEvent(form.pw, "keyup", toggleUsernamePasswordSessionDisabled);
        bindEvent(form.sid, "keyup", toggleUsernamePasswordSessionDisabled);
{'fraction_non_alphanumeric': 0.11876379690949228, 'fraction_numerical': 0.0017660044150110375, 'mean_word_length': 3.12, 'pattern_counts': {'":': 0, '<': 4, '<?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': '5447422', 'n_tokens_mistral': 605, 'n_tokens_neox': 590, 'n_words': 119}