<commit_before>/**
 * Created with JetBrains RubyMine.
 * User: teamco
 * Date: 11/24/12
 * Time: 10:13 PM
 * To change this template use File | Settings | File Templates.
 */

define(
    [
        'modules/View',
        'plugins/preferences/preferences',
        'element/header.element',
        'element/footer.element',
        'plugins/workspace.data/element/workspace.data.content.element',
        'plugins/workspace.data/element/workspace.data.preferences.element',
        'plugins/workspace.data/element/workspace.data.add.page.element',
        'plugins/workspace.data/element/workspace.data.element'
    ],

    /**
     * Define WorkspaceDataView
     * @param {BaseView} BaseView
     * @param {BasePreferences} BasePreferencesElement
     * @param {BaseView} Header
     * @param {BaseView} Footer
     * @param {WorkspaceDataContentElement} WorkspaceDataContentElement
     * @param {WorkspaceDataPreferencesElement} WorkspaceDataPreferencesElement
     * @param {WorkspaceDataAddPageElement} WorkspaceDataAddPageElement
     * @param {WorkspaceDataElement} WorkspaceDataElement
     * @returns {*}
     */
    function defineWorkspaceDataView(BaseView, BasePreferencesElement, Header, Footer, WorkspaceDataContentElement, WorkspaceDataPreferencesElement, WorkspaceDataAddPageElement, WorkspaceDataElement) {

        /**
         * Define view
         * @class WorkspaceDataView
         * @extends BaseView
         * @extends BasePreferencesElement
         * @constructor
         */
        var WorkspaceDataView = function WorkspaceDataView() {
        };

        return WorkspaceDataView.extend(
            'WorkspaceDataView', {

                /**
                 * Render WorkspaceData
                 * @memberOf WorkspaceDataView
                 * @returns {boolean}
                 */
                renderWorkspaceData: function renderWorkspaceData() {

                    if (this.isCached('$workspacedata', WorkspaceDataElement)) {
                        return false;
                    }

                    /**
                     * Define WorkspaceData element
                     * @type {WorkspaceDataElement}
                     */
                    this.elements.$workspacedata = new WorkspaceDataElement(this, {
                        id: this.createUUID(),
                        $container: this.elements.$container.$
                    });
                },

                /**
                 * Render workspace.data content
                 * @memberOf WorkspaceDataView
                 * @param data
                 * @returns {boolean}
                 */
                renderContent: function renderContent(data) {

                    /**
                     * Define content
                     * @type {{}}
                     */
                    this.elements.items = {};

                    this.elements.$workspacedata.empty();
                    this.renderCreatePage();

                    this.renderFilter(
                        this.updateFooterContent.bind(this)
                    );

                    /**
                     * Get current page
                     * @type {Page}
                     */
                    var page = this.controller.getPage();

                    var i = 0, l = data.length,
                        show, current;

                    for (i; i < l; i++) {

                        if (!data[i]) {
                            this.scope.logger.warn('Undefined item', data, i);
                            return false;
                        }

                        /**
                         * Show in tabs
                         * @type {string}
                         */
                        show = this.controller.checkShowInTabs(data[i]) ? '' : ' hide';

                        /**
                         * Define current page style
                         * @type {string}
                         */
                        current = page === data[i] ? ' current' : '';

                        /**
                         * Render item
                         * @type {WorkspaceDataContentElement}
                         */
                        var $item = new WorkspaceDataContentElement(this, {
                            style: 'page content' + current + show,
                            id: [
                                data[i].model.getConfig('uuid'),
                                'workspace-data-view'
                            ].join('-'),
                            $container: this.elements.$workspacedata.$,
                            data: data[i],
                            counter: i + 1
                        });

                        this.elements.items[$item.id] = $item;
                    }

                    this.elements.$workspacedata.scrollCover(
                        this.elements.$container.$<commit_msg>fix uuid<commit_after>/**
 * Created with JetBrains RubyMine.
 * User: teamco
 * Date: 11/24/12
 * Time: 10:13 PM
 * To change this template use File | Settings | File Templates.
 */

define(
    [
        'modules/View',
        'plugins/preferences/preferences',
        'element/header.element',
        'element/footer.element',
        'plugins/workspace.data/element/workspace.data.content.element',
        'plugins/workspace.data/element/workspace.data.preferences.element',
        'plugins/workspace.data/element/workspace.data.add.page.element',
        'plugins/workspace.data/element/workspace.data.element'
    ],

    /**
     * Define WorkspaceDataView
     * @param {BaseView} BaseView
     * @param {BasePreferences} BasePreferencesElement
     * @param {BaseView} Header
     * @param {BaseView} Footer
     * @param {WorkspaceDataContentElement} WorkspaceDataContentElement
     * @param {WorkspaceDataPreferencesElement} WorkspaceDataPreferencesElement
     * @param {WorkspaceDataAddPageElement} WorkspaceDataAddPageElement
     * @param {WorkspaceDataElement} WorkspaceDataElement
     * @returns {*}
     */
    function defineWorkspaceDataView(BaseView, BasePreferencesElement, Header, Footer, WorkspaceDataContentElement, WorkspaceDataPreferencesElement, WorkspaceDataAddPageElement, WorkspaceDataElement) {

        /**
         * Define view
         * @class WorkspaceDataView
         * @extends BaseView
         * @extends BasePreferencesElement
         * @constructor
         */
        var WorkspaceDataView = function WorkspaceDataView() {
        };

        return WorkspaceDataView.extend(
            'WorkspaceDataView', {

                /**
                 * Render WorkspaceData
                 * @memberOf WorkspaceDataView
                 * @returns {boolean}
                 */
                renderWorkspaceData: function renderWorkspaceData() {

                    if (this.isCached('$workspacedata', WorkspaceDataElement)) {
                        return false;
                    }

                    /**
                     * Define WorkspaceData element
                     * @type {WorkspaceDataElement}
                     */
                    this.elements.$workspacedata = new WorkspaceDataElement(this, {
                        id: this.createUUID(),
                        $container: this.elements.$container.$
                    });
                },

                /**
                 * Render workspace.data content
                 * @memberOf WorkspaceDataView
                 * @param data
                 * @returns {boolean}
                 */
                renderContent: function renderContent(data) {

                    /**
                     * Define content
                     * @type {{}}
                     */
                    this.elements.items = {};

                    this.elements.$workspacedata.empty();
                    this.renderCreatePage();

                    this.renderFilter(
                        this.updateFooterContent.bind(this)
                    );

                    /**
                     * Get current page
                     * @type {Page}
                     */
                    var page = this.controller.getPage();

                    var i = 0, l = data.length,
                        show, current;

                    for (i; i < l; i++) {

                        if (!data[i]) {
                            this.scope.logger.warn('Undefined item', data, i);
                            return false;
                        }

                        /**
                         * Show in tabs
                         * @type {string}
                         */
                        show = this.controller.checkShowInTabs(data[i]) ? '' : ' hide';

                        /**
                         * Define current page style
                         * @type {string}
                         */
                        current = page === data[i] ? ' current' : '';

                        /**
                         * Render item
                         * @type {WorkspaceDataContentElement}
                         */
                        var $item = new WorkspaceDataContentElement(this, {
                            style: 'page content' + current + show,
                            uuid: [
                                data[i].model.getConfig('uuid'),
                                'workspace-data-view'
                            ].join('-'),
                            $container: this.elements.$workspacedata.$,
                            data: data[i],
                            counter: i + 1
                        });

                        this.elements.items[$item.id] = $item;
                    }

                    this.elements.$workspacedata.scrollCover(
                        this.elements.$container.$
{'fraction_non_alphanumeric': 0.09307512927101287, 'fraction_numerical': 0.002433336712967657, 'mean_word_length': 1.1131105398457584, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6650779', 'n_tokens_mistral': 2292, 'n_tokens_neox': 2136, 'n_words': 404}