<commit_before>/**
 * Setup functions
 *
 * This Source Code Form is subject to the terms of the Mozilla Public License,
 * v. 2.0. If a copy of the MPL was not distributed with this file, You can
 * obtain one at http://mozilla.org/MPL/2.0/.
 *
 * @category  phpMyFAQ
 * @package   JavaScript
 * @author    <NAME> <<EMAIL>>
 * @copyright 2015-2016 phpMyFAQ Team
 * @license   http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
 * @link      http://www.phpmyfaq.de
 * @since     2015-12-24
 */

/*global $: false */

$(document).ready(function() {

    'use strict';

    var setupForm = $('.form-horizontal');
    var setupType = $('#sql_type');

    var addInput = function (event) {

        var current = $(event.currentTarget);
        var tag = current.parent().parent();

        if ('add' === current.attr('data-action')) {
            tag.after(tag.clone().find('input').val('').find('span.input-group-addon').remove().end());
        }

        return false;
    };

    var selectDatabaseSetup = function (field) {

        switch ($(this).val()) {
            case 'sqlite3':
                $('#dbsqlite').show().removeClass('hide');
                $('#dbdatafull').hide();
                break;
            default:
                $('#dbsqlite').hide();
                $('#dbdatafull').show();
                break;
        }
    };


    setupForm.find('a').on('click', addInput);
    setupType.on('change', selectDatabaseSetup);

});<commit_msg>Enabling SQLite-specific install fields, when installing on a machine that only supports SQLite (and therefore there are no other RDBMS listed). For issue #1194.<commit_after>/**
 * Setup functions
 *
 * This Source Code Form is subject to the terms of the Mozilla Public License,
 * v. 2.0. If a copy of the MPL was not distributed with this file, You can
 * obtain one at http://mozilla.org/MPL/2.0/.
 *
 * @category  phpMyFAQ
 * @package   JavaScript
 * @author    <NAME> <<EMAIL>>
 * @copyright 2015-2016 phpMyFAQ Team
 * @license   http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
 * @link      http://www.phpmyfaq.de
 * @since     2015-12-24
 */

/*global $: false */

$(document).ready(function() {

    'use strict';

    var setupForm = $('.form-horizontal');
    var setupType = $('#sql_type');

    var addInput = function (event) {

        var current = $(event.currentTarget);
        var tag = current.parent().parent();

        if ('add' === current.attr('data-action')) {
            tag.after(tag.clone().find('input').val('').find('span.input-group-addon').remove().end());
        }

        return false;
    };

    var selectDatabaseSetup = function (field) {

        switch ($(this).val()) {
            case 'sqlite3':
                $('#dbsqlite').show().removeClass('hide');
                $('#dbdatafull').hide();
                break;
            default:
                $('#dbsqlite').hide();
                $('#dbdatafull').show();
                break;
        }
    };


    setupForm.find('a').on('click', addInput);
    setupType.on('change', selectDatabaseSetup);
    var setupTypeOptions= $('#sql_type option');
    if( setupTypeOptions.length===1 ) {
        $('#dbsqlite').show().removeClass('hide');
        $('#dbdatafull').hide();
    }

});
{'fraction_non_alphanumeric': 0.1701610452749924, 'fraction_numerical': 0.01671224551807961, 'mean_word_length': 2.3052208835341363, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '4122429', 'n_tokens_mistral': 1023, 'n_tokens_neox': 952, 'n_words': 241}