<commit_before>var jQuery = jQuery,
    $ = jQuery,
    DO = DO;

(function ($namespace) {

    var setButtonsAction = function () {
        $(document).keydown(function (e) {
            if (e.keyCode === 27) {
                $namespace.modal.hide();
            }
        });

        $("body").on("click", "a.do-ui-modal-btn-close", function () {
            $namespace.modal.hide();
        });

        // $(".do-ui-modal-mask").click ->
        //   minimize()

    };

    $namespace.modal = {
        create: function (params) {
            var
                body = $("body"),
                wrapperModal,
                modalMask,
                modal,
                header,
                btnClose,
                content;

            if ($(".do-ui-wrapper-modal").length < 1) {

                wrapperModal = $("<div></div>")
                    .addClass("do-ui-wrapper-modal");
                modalMask = $("<div></div>")
                    .addClass("do-ui-modal-mask basicss-fixed basicss-transparent");
                modal = $("<div></div>").addClass("do-ui-modal");
                header = $("<div></div>").addClass("do-ui-modal-header");
                btnClose = $("<a href=\"#\"></a>")
                    .addClass("do-ui-modal-btn-close button");
                content = $("<div></div>").addClass("do-ui-modal-content");

                body.append(wrapperModal);

                wrapperModal
                .append(modalMask)
                .append(modal);

                modal
                .append(header)
                .css({
                    "max-height": $(document).height(),
                    "max-width": $(window).width()
                });

                header.append(btnClose);
                modal.append(content);

                setButtonsAction();

            } else {
                wrapperModal = $(".do-ui-wrapper-modal");
                modal = wrapperModal.find(".do-ui-modal");
                modalMask = wrapperModal.find(".do-ui-modal-mask");

                wrapperModal.show();
                modal.show();
            }

            // todas as linhas de um bloco function são executadas
            // numa porrada só executa somente quando estiver visível
            if (wrapperModal.is(":visible")) {
                modalMask
                    .replaceToggleClass("basicss-transparent",
                                        "basicss-opacity-transition");
            }

            modal.centralizeOnScreen();

            if (params.load) {
                params.load(modal);
            }

        },

        hide: function () {
            var
               wrapperModal = $(".do-ui-wrapper-modal"),
               mask = wrapperModal.find(".do-ui-modal-mask"),
               time = 0;

            $(".modal").hide();

            mask.replaceToggleClass("transparent", "basicss-opacity-transition");

            time = parseFloat(mask.css("transition-duration")) * 1000;
            setTimeout(function () {
                $(".do-ui-wrapper-modal").hide();
            }, time);
        }

    };

}(DO.ui));


//var maximizeModal = function () {
    //do-ui-wrapper-modal e modal ficam hide
    //trocar transparencia de wrapperModal
//};

// minimize = ->
  // atribuir classe
  // colocar left: 0; bottom: 0 e mostrar só o header


// afterLoad = (url, execute)->
//   $(".modal").load url, ->
//     $(this).find(".do-ui-modal-content").load url, ->
//       execute.each<commit_msg>ajusta 99% do problema com o modal<commit_after>var jQuery = jQuery,
    $ = jQuery,
    DO = DO;

(function ($namespace) {

    var setButtonsAction = function () {

        var
            modalMask = $(".do-ui-wrapper-modal"),
            time;

        $(document).keydown(function (e) {
            // time = parseFloat(modalMask.css("transition-duration")) * 1000;
            // setTimeout(function () {
            //     e.stopPropagation();
            // }, time);

            if (e.keyCode === 27) {
                $namespace.modal.minimize();
            }
        });

        $("body").on("click", "a.do-ui-modal-btn-close", function (e) {
            $namespace.modal.close();
        });

    };

    $namespace.modal = {
        create: function (params) {
            var
                body = $("body"),
                wrapperModal,
                modalMask,
                modal,
                header,
                btnClose,
                content;

            if ($(".do-ui-wrapper-modal").length < 1) {

                wrapperModal = $("<div></div>")
                    .addClass("do-ui-wrapper-modal");
                modalMask = $("<div></div>")
                    .addClass("do-ui-modal-mask basicss-fixed basicss-transparent");
                modal = $("<div></div>").addClass("do-ui-modal");
                header = $("<div></div>").addClass("do-ui-modal-header");
                btnClose = $("<a href=\"#\"></a>")
                    .addClass("do-ui-modal-btn-close button");
                content = $("<div></div>").addClass("do-ui-modal-content");

                body.append(wrapperModal);

                wrapperModal
                .append(modalMask)
                .append(modal);

                modal
                .append(header)
                .css({
                    "max-height": $(document).height(),
                    "max-width": $(window).width()
                });

                header.append(btnClose);
                modal.append(content);

                setButtonsAction();

            } else {
                wrapperModal = $(".do-ui-wrapper-modal");
                modal = wrapperModal.find(".do-ui-modal");
                modalMask = wrapperModal.find(".do-ui-modal-mask");

                wrapperModal.show();
                modal.show();
            }

            // todas as linhas de um bloco function são executadas
            // numa porrada só executa somente quando estiver visível
            if (wrapperModal.is(":visible")) {
                modalMask
                    .replaceToggleClass("basicss-transparent",
                                        "basicss-opacity-transition");
            }

            modal.centralizeOnScreen();

            if (params.load) {
                params.load(modal);
            }

        },

        minimize: function () {
            var
               wrapperModal = $(".do-ui-wrapper-modal"),
               modalMask = wrapperModal.find(".do-ui-modal-mask"),
               time = 0;

            $(".do-ui-modal").hide();

            modalMask.replaceToggleClass("basicss-transparent", "basicss-opacity-transition");

            time = parseFloat(modalMask.css("transition-duration")) * 1000;
            setTimeout(function () {
                $(".do-ui-wrapper-modal").hide();
            }, time);
        },

        close: function () {
            var
               wrapperModal = $(".do-ui-wrapper-modal"),
               modalMask = wrapperModal.find(".do-ui-modal-mask"),
               time = 0;

            $(".do-ui-modal").hide();

            modalMask.replaceToggleClass("basicss-transparent", "basicss-opacity-transition");

            time = parseFloat(modalMask.css("transition-duration")) * 1000;
            setTimeout(function () {
                $(".do-ui-wrapper-modal").remove();
            }, time);
        }

    };

}(DO.ui));


//var maximizeModal = function () {
    //do-ui-wrapper-modal e modal ficam hide
    //trocar transparencia de wrapperModal
//};

// minimize = ->
  // atribuir classe
  // colocar left: 0; bottom: 0 e mostrar só o header


// afterLoad = (url, execute)->
//   $(".modal").load url, ->
//     $(this).find(".do-ui-modal-content").load url, ->
//       execute.each
{'fraction_non_alphanumeric': 0.1565986918045402, 'fraction_numerical': 0.003975888162113634, 'mean_word_length': 1.3249850924269528, 'pattern_counts': {'":': 6, '<': 29, '<?xml version=': 0, '>': 36, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '1204388', 'n_tokens_mistral': 2151, 'n_tokens_neox': 1995, 'n_words': 350}