<commit_before>/* contains random bits and pieces we neede to make the U6 UI behave */

(function ($) {

    $(document).ready(function () {
        scaleScrollables("body");

        $(window).bind("resize", function () {
            scaleScrollables("body");
        });

        $("body").click(function (event) {
            var el = event.target.nodeName;
            var els = ["INPUT","A","BUTTON"];

            if(els.indexOf(el) >= 0){return;}

            var parents = $(event.target).parents("a,button");
            if(parents.length > 0){
                return;
            }

            var click = $(event.target).attr('onClick');
            if(click){
                return;
            }


            UmbClientMgr.closeModalWindow(undefined);
        });
    });     

    function scaleScrollables(selector) {
        $(".umb-scrollable").each(function() {
            var el = jQuery(this);
            var totalOffset = 0;
            var offsety = el.data("offset-y");

            if (offsety != undefined)
                totalOffset += offsety;

            el.height($(window).height() - (el.offset().top + totalOffset));
        });
    }
    
})(jQuery);<commit_msg>adds suport for ctrl+s in legacy editors<commit_after>/* contains random bits and pieces we neede to make the U6 UI behave */

(function ($) {

    $(document).ready(function () {
        scaleScrollables("body");

        $(window).bind("resize", function () {
            scaleScrollables("body");
        });

        $("body").click(function (event) {
            var el = event.target.nodeName;
            var els = ["INPUT","A","BUTTON"];

            if(els.indexOf(el) >= 0){return;}

            var parents = $(event.target).parents("a,button");
            if(parents.length > 0){
                return;
            }

            var click = $(event.target).attr('onClick');
            if(click){
                return;
            }


            UmbClientMgr.closeModalWindow(undefined);
        });

        $.ctrl("S", function(){
            $(".umb-panel-header .btn-primary").click();
        });

    });     

    function scaleScrollables(selector) {
        $(".umb-scrollable").each(function() {
            var el = jQuery(this);
            var totalOffset = 0;
            var offsety = el.data("offset-y");

            if (offsety != undefined)
                totalOffset += offsety;

            el.height($(window).height() - (el.offset().top + totalOffset));
        });
    }
    
    $.ctrl = function(key, callback, args) {
        var isMac = navigator.platform.toUpperCase().indexOf('MAC')>=0;
        var isCtrl = false;
        $(document).keydown(function(e) {
            if(!args) args=[]; // IE barks when args is null
            var modKey = isMac ? e.metaKey : e.ctrlKey;
            if(modKey){
              isCtrl = true;  
            } 

            if(isCtrl && e.keyCode == key.charCodeAt(0)) {
                callback.apply(this, args);
                return false;
            }

        }).keyup(function(e) {
            var modKey = isMac ? e.metaKey : e.ctrlKey;
            if(modKey){
                isCtrl = false;
            }
        });        
    };
})(jQuery);
{'fraction_non_alphanumeric': 0.15353722582638246, 'fraction_numerical': 0.0030892801977139327, 'mean_word_length': 1.5678033306899286, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '1880356', 'n_tokens_mistral': 912, 'n_tokens_neox': 872, 'n_words': 178}