<commit_before>/*
 * Copyright https://github.com/divio/django-cms
 */

// #############################################################################
// NAMESPACES
/**
 * @module CMS
 */
/* istanbul ignore next */
var CMS = window.CMS || {};

// #############################################################################
// Toolbar
(function ($) {
    'use strict';

    /**
     * The toolbar is the generic element which holds various components
     * together and provides several commonly used API methods such as
     * show/hide, message display or loader indication.
     *
     * @class Toolbar
     * @namespace CMS
     * @uses CMS.API.Helpers
     */
    CMS.Toolbar = new CMS.Class({

        implement: [CMS.API.Helpers],

        options: {
            toolbarDuration: 200
        },

        initialize: function initialize(options) {
            this.options = $.extend(true, {}, this.options, options);

            // elements
            this._setupUI();

            /**
             * @property {CMS.Navigation} navigation
             */
            this.navigation = new CMS.Navigation();

            /**
             * @property {Object} _position
             * @property {Number} _position.top current position of the toolbar
             * @property {Number} _position.top position when toolbar became non-sticky
             * @property {Boolean} _position.isSticky is toolbar sticky?
             * @see _handleLongMenus
             * @private
             */
            this._position = {
                top: 0,
                stickyTop: 0,
                isSticky: true
            };

            // states
            this.click = 'click.cms.toolbar';
            this.touchStart = 'touchstart.cms.toolbar';
            this.pointerUp = 'pointerup.cms.toolbar';
            this.pointerOverOut = 'pointerover.cms.toolbar pointerout.cms.toolbar';
            this.pointerLeave = 'pointerleave.csm.toolbar';
            this.mouseEnter = 'mouseenter.cms.toolbar';
            this.mouseLeave = 'mouseleave.cms.toolbar';
            this.resize = 'resize.cms.toolbar';
            this.scroll = 'scroll.cms.toolbar';
            this.key = 'keydown.cms.toolbar keyup.cms.toolbar';

            // istanbul ignore next: function is always reassigned
            this.timer = function () {};
            this.lockToolbar = false;

            // setup initial stuff
            if (!this.ui.toolbar.data('ready')) {
                this._events();
            }

            // FIXME the general initialization is handled within the toolbar
            // rather than a separate cms.setup or similar. Yet other components
            // are loaded after the toolbar so it can create a clash where
            // CMS.API is not ready. This is a workaround until a proper fix
            // will be released in 3.x
            var that = this;
            setTimeout(function () {
                that._initialStates();
            }, 200);

            // set a state to determine if we need to reinitialize this._events();
            this.ui.toolbar.data('ready', true);<commit_msg>reduce initialization timeout in structureboard;<commit_after>/*
 * Copyright https://github.com/divio/django-cms
 */

// #############################################################################
// NAMESPACES
/**
 * @module CMS
 */
/* istanbul ignore next */
var CMS = window.CMS || {};

// #############################################################################
// Toolbar
(function ($) {
    'use strict';

    /**
     * The toolbar is the generic element which holds various components
     * together and provides several commonly used API methods such as
     * show/hide, message display or loader indication.
     *
     * @class Toolbar
     * @namespace CMS
     * @uses CMS.API.Helpers
     */
    CMS.Toolbar = new CMS.Class({

        implement: [CMS.API.Helpers],

        options: {
            toolbarDuration: 200
        },

        initialize: function initialize(options) {
            this.options = $.extend(true, {}, this.options, options);

            // elements
            this._setupUI();

            /**
             * @property {CMS.Navigation} navigation
             */
            this.navigation = new CMS.Navigation();

            /**
             * @property {Object} _position
             * @property {Number} _position.top current position of the toolbar
             * @property {Number} _position.top position when toolbar became non-sticky
             * @property {Boolean} _position.isSticky is toolbar sticky?
             * @see _handleLongMenus
             * @private
             */
            this._position = {
                top: 0,
                stickyTop: 0,
                isSticky: true
            };

            // states
            this.click = 'click.cms.toolbar';
            this.touchStart = 'touchstart.cms.toolbar';
            this.pointerUp = 'pointerup.cms.toolbar';
            this.pointerOverOut = 'pointerover.cms.toolbar pointerout.cms.toolbar';
            this.pointerLeave = 'pointerleave.csm.toolbar';
            this.mouseEnter = 'mouseenter.cms.toolbar';
            this.mouseLeave = 'mouseleave.cms.toolbar';
            this.resize = 'resize.cms.toolbar';
            this.scroll = 'scroll.cms.toolbar';
            this.key = 'keydown.cms.toolbar keyup.cms.toolbar';

            // istanbul ignore next: function is always reassigned
            this.timer = function () {};
            this.lockToolbar = false;

            // setup initial stuff
            if (!this.ui.toolbar.data('ready')) {
                this._events();
            }

            // FIXME the general initialization is handled within the toolbar
            // rather than a separate cms.setup or similar. Yet other components
            // are loaded after the toolbar so it can create a clash where
            // CMS.API is not ready. This is a workaround until a proper fix
            // will be released in 3.x
            var that = this;
            setTimeout(function () {
                that._initialStates();
            }, 0);

            // set a state to determine if we need to reinitialize this._events();
            this.ui.toolbar.data('ready', true);
{'fraction_non_alphanumeric': 0.1494508992519497, 'fraction_numerical': 0.002546554193856438, 'mean_word_length': 1.7549320473476546, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '118333', 'n_tokens_mistral': 1599, 'n_tokens_neox': 1489, 'n_words': 429}