<commit_before>define('app/views/machine_shell', ['app/views/popup', 'ember'],
    //
    //  Machine Shell View
    //
    //  @returns Class
    //
    function(PopupView) {

        'use strict';

        return PopupView.extend({


            //
            //
            //  Methods
            //
            //


            open: function () {

                $('#machine-shell').on('popupafteropen',
                    function(){
                        $('#machine-shell').off('blur');
                        $(document).off('focusin');
                    }
                ).popup( "option", "dismissible", false );

                this._super();

                $('.ui-footer').hide(500);

                $(window).on('resize', function(){
                    var w, h, // Estimated width & height
                        wc, hc;  // Width - Height constrained
                    var fontSize=18; // Initial font size before adjustment

                    while (true){
                        wc = hc = false;
                        $('.fontSizeTest').css('font-size', fontSize + 'px');

                        w = $('.fontSizeTest').width() * 80;
                        h = $('.fontSizeTest').height() * 24;

                        if (w > window.innerWidth - 46){
                            // log('width constrained');
                            wc = true;
                        }

                        if (h > window.innerHeight-virtualKeyboardHeight() - 135){ //42.4 + 16 + 8 + 1 + 11.2 + 20 + 11.2 + 1 + 8 + 16  // Serously?
                            // log('height constrained');
                            hc = true;
                        }

                        if ((!wc && !hc) || fontSize <= 6){
                            break;
                        }

                        fontSize -= 1;
                    }

                    $('#shell-return').css('font-size', fontSize + 'px');

                    // Put popup it in the center
                    $('#machine-shell-popup').css('left', ((window.innerWidth - $('#machine-shell-popup').width())/2)+'px');

                    if (!Terminal._textarea)
                        $('.terminal').focus();

                    // Make the hidden textfield focusable on android
                    if (Mist.term && Mist.term.isAndroid){
                        $(Terminal._textarea).width('100%');
                        $(Terminal._textarea).height($('#shell-return').height() + 60);
                    }

                    return true;
                });
            },


            close: function () {

                this._super();
                $('.ui-footer').show(500);
            },


            clear: function () {

            },

            //
            //
            //  Actions
            //
            //

            actions: {

                backClicked: function() {
                    Mist.machineShellController.close();
                }
            }
        });
    }
);<commit_msg>Use slide up/down to show/hide the footer<commit_after>define('app/views/machine_shell', ['app/views/popup', 'ember'],
    //
    //  Machine Shell View
    //
    //  @returns Class
    //
    function(PopupView) {

        'use strict';

        return PopupView.extend({


            //
            //
            //  Methods
            //
            //


            open: function () {

                $('#machine-shell').on('popupafteropen',
                    function(){
                        $('#machine-shell').off('blur');
                        $(document).off('focusin');
                    }
                ).popup( "option", "dismissible", false );

                this._super();

                $('.ui-footer').slideUp(500);

                $(window).on('resize', function(){
                    var w, h, // Estimated width & height
                        wc, hc;  // Width - Height constrained
                    var fontSize=18; // Initial font size before adjustment

                    while (true){
                        wc = hc = false;
                        $('.fontSizeTest').css('font-size', fontSize + 'px');

                        w = $('.fontSizeTest').width() * 80;
                        h = $('.fontSizeTest').height() * 24;

                        if (w > window.innerWidth - 46){
                            // log('width constrained');
                            wc = true;
                        }

                        if (h > window.innerHeight-virtualKeyboardHeight() - 135){ //42.4 + 16 + 8 + 1 + 11.2 + 20 + 11.2 + 1 + 8 + 16  // Serously?
                            // log('height constrained');
                            hc = true;
                        }

                        if ((!wc && !hc) || fontSize <= 6){
                            break;
                        }

                        fontSize -= 1;
                    }

                    $('#shell-return').css('font-size', fontSize + 'px');

                    // Put popup it in the center
                    $('#machine-shell-popup').css('left', ((window.innerWidth - $('#machine-shell-popup').width())/2)+'px');

                    if (!Terminal._textarea)
                        $('.terminal').focus();

                    // Make the hidden textfield focusable on android
                    if (Mist.term && Mist.term.isAndroid){
                        $(Terminal._textarea).width('100%');
                        $(Terminal._textarea).height($('#shell-return').height() + 60);
                    }

                    return true;
                });
            },


            close: function () {

                this._super();
                $('.ui-footer').slideDown(500);
            },


            clear: function () {

            },

            //
            //
            //  Actions
            //
            //

            actions: {

                backClicked: function() {
                    Mist.machineShellController.close();
                }
            }
        });
    }
);
{'fraction_non_alphanumeric': 0.14201570680628273, 'fraction_numerical': 0.014397905759162303, 'mean_word_length': 0.860882800608828, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '6432602', 'n_tokens_mistral': 1602, 'n_tokens_neox': 1358, 'n_words': 278}