<commit_before>﻿(function($, pubsub, elements, settings) {
    var coreOpen = function (isInit) {
             pubsub.publish('action.shell.opening', {isInit: isInit});
            
            elements.opener().hide(); 
            $.fn.add.call(elements.holder(), elements.pageSpacer())
                .show()
                .animate({ height : settings.local('height') ||300 }, (isInit ? 0 : 'fast'), function () {
                    pubsub.publish('action.shell.opened', {isInit: isInit});
                });            
        },
        wireListeners = function () { 
            elements.opener().click(function () { pubsub.publish('trigger.shell.open'); });
            elements.barHolder().find('.glimpse-minimize').click(function () { pubsub.publish('trigger.shell.minimize'); });
            elements.barHolder().find('.glimpse-close').click(function () { pubsub.publish('trigger.shell.close'); });
        }, 
        ready = function() { 
            if (settings.local('isOpen'))
                coreOpen(true);
        },  
        open = function() {
            settings.local('isOpen', true);
            coreOpen(false);
        },
        minimize = function() {
            settings.local('isOpen', false);
            
            pubsub.publish('action.shell.minimizing');

            var count = 0;
            $.fn.add.call(elements.holder(), elements.pageSpacer())
                .animate({ height : '0' }, 'fast', function() {
                    $(this).hide();
                
                    if (count++ == 1) {
                        elements.opener().show(); 
                        pubsub.publish('action.shell.minimized'); 
                    }
                });
            
        },
        close = function() {
            settings.local('isOpen', false);
            settings.global('glimpseState', null, -1);
            
            pubsub.publish('action.shell.closeing');

            elements.holder().remove();
            elements.pageSpacer().remove();
            elements.opener().remove(); 

            pubsub.publish('action.shell.closeed'); 
        };
    
    pubsub.subscribe('trigger.shell.open', open);
    pubsub.subscribe('trigger.shell.minimize', minimize);
    pubsub.subscribe('trigger.shell.close', close);
    pubsub.subscribe('trigger.shell.listener.subscriptions', wireListeners);
    pubsub.subscribe('trigger.system.ready', ready);
})(jQueryGlimpse, glimpse.pubsub, glimpse.elements, glimpse.settings);<commit_msg>Simplified the controls plugin to the point where it only has one open methods and that it has no knowledges of what needs to happen at startup (*.default.js now does this).<commit_after>﻿(function($, pubsub, elements, settings) {
    var wireListeners = function () { 
            elements.opener().click(function () { pubsub.publish('trigger.shell.open'); });
            elements.barHolder().find('.glimpse-minimize').click(function () { pubsub.publish('trigger.shell.minimize'); });
            elements.barHolder().find('.glimpse-close').click(function () { pubsub.publish('trigger.shell.close'); });
        },  
        open = function(isInit) {
            settings.local('isOpen', true);

            pubsub.publish('action.shell.opening', {isInit: isInit});
            
            elements.opener().hide(); 
            $.fn.add.call(elements.holder(), elements.pageSpacer())
                .show()
                .animate({ height : settings.local('height') ||300 }, (isInit ? 0 : 'fast'), function () {
                    pubsub.publish('action.shell.opened', {isInit: isInit});
                });  
        },
        minimize = function() {
            settings.local('isOpen', false);
            
            pubsub.publish('action.shell.minimizing');

            var count = 0;
            $.fn.add.call(elements.holder(), elements.pageSpacer())
                .animate({ height : '0' }, 'fast', function() {
                    $(this).hide();
                
                    if (count++ == 1) {
                        elements.opener().show(); 
                        pubsub.publish('action.shell.minimized'); 
                    }
                });
            
        },
        close = function() {
            settings.local('isOpen', false);
            settings.global('glimpseState', null, -1);
            
            pubsub.publish('action.shell.closeing');

            elements.holder().remove();
            elements.pageSpacer().remove();
            elements.opener().remove(); 

            pubsub.publish('action.shell.closeed'); 
        };
    
    pubsub.subscribe('trigger.shell.open', open);
    pubsub.subscribe('trigger.shell.minimize', minimize);
    pubsub.subscribe('trigger.shell.close', close);
    pubsub.subscribe('trigger.shell.listener.subscriptions', wireListeners); 
})(jQueryGlimpse, glimpse.pubsub, glimpse.elements, glimpse.settings);
{'fraction_non_alphanumeric': 0.15679087762166566, 'fraction_numerical': 0.003257992262268377, 'mean_word_length': 1.8491879350348028, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '907117', 'n_tokens_mistral': 1302, 'n_tokens_neox': 1251, 'n_words': 200}