$(function () {

    $("#global-loader").hide()
    // first tab
    $("input[name=chart_type]").on("click", function (e) {
        e.preventDefault();
        alertify.error("Available only in full version");
        return false;
    });

    var currentWidgetSize = $("select[name=widget_size] option:selected");
    $("select[name=widget_size]").on("change", function (e) {

        currentWidgetSize.prop("selected", true);
        alertify.error("Available only in full version");
    });


    var currentColorPalette = $("select[name=sections_color_palette] option:selected");
    $("select[name=widget_size]").on("change", function (e) {

        currentColorPalette.prop("selected", true);
        alertify.error("Available only in full version");
    });

    // second tab

    $("input[name=name]").on("keydown", function (e) {
        e.preventDefault();
        alertify.error("Available only in full version");
        return false;
    });


    $("input[name=title]").on("keydown", function (e) {
        e.preventDefault();
        alertify.error("Available only in full version");
        return false;
    });

    var chartCategory = $("select[name=category] option:selected");
    $("select[name=category]").on("change", function (e) {

        chartCategory.prop("selected", true);
        alertify.error("Available only in full version");
    });

    var securityType = $("select[name=security_type] option:selected");
    $("select[name=security_type]").on("change", function (e) {

        if (securityType == "public") {
            $("#groups").prop("disabled", true);
        } else {
            $("#groups").prop("disabled", false);

        }

        securityType.prop("selected", true);
        alertify.error("Available only in full version");
    });

    $("#groups").on("change", function (e) {
        e.preventDefault();
        alertify.error("Available only in full version");
        return false;

    });

    $("input[name=chart_link]").on("click", function (e) {
        e.preventDefault();
        alertify.error("Available only in full version");
        return false;
    });


    // third tab


    var xAxisTable = $("select[name=x_table] option:selected");
    $("select[name=x_table]").on("change", function (e) {
        xAxisTable.prop("selected", true);
        alertify.error("Available only in full version");
    });

    var xAxisColumn = $("select[name=x_axis_column] option:selected");
    $("select[name=x_axis_column]").on("change", function (e) {
        xAxisColumn.prop("selected", true);
        alertify.error("Available only in full version");
    });


    var dateRange = $("select[name=date_range] option:selected");
    $("select[name=date_range]").on("change", function (e) {
        dateRange.prop("selected", true);
        alertify.error("Available only in full version");
    });

    var timeScale = $("select[name=date_time_scale] option:selected");
    $("select[name=date_time_scale]").on("change", function (e) {
        timeScale.prop("selected", true);
        alertify.error("Available only in full version");
    });


    $("input[name='data_filter_columns[]']").on("click", function (e) {
        e.preventDefault();
        alertify.error("Available only in full version");
        return false;
    });


    var yAxisTable = $("select[name=y_table] option:selected");
    $("select[name=y_table]").on("change", function (e) {
        yAxisTable.prop("selected", true);
        alertify.error("Available only in full version");
    });

    var yAxisColumn = $("select[name=y_axis_column] option:selected");
    $("select[name=y_axis_column]").on("change", function (e) {
        yAxisColumn.prop("selected", true);
        alertify.error("Available only in full version");
    });

    $("input[name=label]").on("keydown", function (e) {
        e.preventDefault();
        alertify.error("Available only in full version");
        return false;
    });

    var functionColumn = $("select[name=function] option:selected");
    $("select[name=function]").on("change", function (e) {
        functionColumn.prop("selected", true);
        alertify.error("Available only in full version");
    });


    $("input[name=drill_down]").on("click", function (e) {
        e.preventDefault();
        alertify.error("Available only in full version");
        return false;
    });

    var drillDownColumn = $("select[name='drill_down_columns[]'] option:selected");
    $("select[name='drill_down_columns[]']").on("change", function (e) {
        drillDownColumn.prop("selected", true);
        alertify.error("Available only in full version");
    });

    $("input[name=finish]").on("click", function (e) {
        window.parent.$("#add-chart-modal").modal('hide');
        window.parent.$("#edit-chart-modal").modal('hide');
    });

});
