<commit_before>/*
 * Copyright (C) 2013 Vanderbilt University, All rights reserved.
 * 
 * Author: <NAME>
 */

"use strict";

define(['js/Dialogs/Projects/ProjectsDialog',
    'js/Dialogs/Commit/CommitDialog',
    'js/Dialogs/ProjectRepository/ProjectRepositoryDialog'], function (ProjectsDialog,
                                                                       CommitDialog,
                                                                        ProjectRepositoryDialog) {

    var DefaultToolbar;

    DefaultToolbar = function (client) {
        this._client = client;

        this._initialize();
    };

    DefaultToolbar.prototype._initialize = function () {
        var toolbar = WebGMEGlobal.Toolbar;

        var self = this;

        //#1: Projects
        toolbar.addButton({ "title": "Projects...",
            "icon": "icon-folder-open",
            "clickFn": function (/*data*/) {
                var pd = new ProjectsDialog(self._client);
                pd.show();
            }});

        //#2: Project repository...
        toolbar.addButton({ "title": "Project repository...",
            "icon": "icon-road",
            "clickFn": function (/*data*/) {
                var prd = new ProjectRepositoryDialog(self._client);
                prd.show();
            } });

        toolbar.addButton({ "title": "Commit...",
            "icon": "icon-share-alt",
            "clickFn": function (/*data*/) {
                var cd = new CommitDialog(self._client);
                cd.show();
            } });

        //TODO: remove
        //this._createDummyControls();
    };

    DefaultToolbar.prototype._createDummyControls = function () {
        var toolbar = WebGMEGlobal.Toolbar;

        toolbar.addSeparator();

        //DEMO controls
        var btnCommit1 = toolbar.addButton({ "title": "Commit1...",
            "icon": "icon-share",
            "clickFn": function () {
                console.log('Commit1...');
            }});

        var radioButtonGroup = toolbar.addRadioButtonGroup(function (data) {
            console.log(JSON.stringify(data));
        });

        radioButtonGroup.addButton({ "title": "Radio button 1",
            "icon": "icon-align-left",<commit_msg>don's show Projects... toolbarbutton in VehicleForgeLayout<commit_after>/*
 * Copyright (C) 2013 Vanderbilt University, All rights reserved.
 * 
 * Author: <NAME>
 */

"use strict";

define(['clientUtil',
    'js/Dialogs/Projects/ProjectsDialog',
    'js/Dialogs/Commit/CommitDialog',
    'js/Dialogs/ProjectRepository/ProjectRepositoryDialog'], function (util,
                                                                       ProjectsDialog,
                                                                       CommitDialog,
                                                                        ProjectRepositoryDialog) {

    var DefaultToolbar;

    DefaultToolbar = function (client) {
        this._client = client;

        this._initialize();
    };

    DefaultToolbar.prototype._initialize = function () {
        var toolbar = WebGMEGlobal.Toolbar,
            layoutToLoad = util.getURLParameterByName('layout'),
            _client = this._client,
            projectsButtonDisabledForLayouts = ['VehicleForgeLayout'];

        //#1: Projects
        if (projectsButtonDisabledForLayouts.indexOf(layoutToLoad) === -1) {
            toolbar.addButton({ "title": "Projects...",
                "icon": "icon-folder-open",
                "clickFn": function (/*data*/) {
                    var pd = new ProjectsDialog(_client);
                    pd.show();
                }});
        }

        //#2: Project repository...
        toolbar.addButton({ "title": "Project repository...",
            "icon": "icon-road",
            "clickFn": function (/*data*/) {
                var prd = new ProjectRepositoryDialog(_client);
                prd.show();
            } });

        toolbar.addButton({ "title": "Commit...",
            "icon": "icon-share-alt",
            "clickFn": function (/*data*/) {
                var cd = new CommitDialog(_client);
                cd.show();
            } });

        //TODO: remove
        //this._createDummyControls();
    };

    DefaultToolbar.prototype._createDummyControls = function () {
        var toolbar = WebGMEGlobal.Toolbar;

        toolbar.addSeparator();

        //DEMO controls
        var btnCommit1 = toolbar.addButton({ "title": "Commit1...",
            "icon": "icon-share",
            "clickFn": function () {
                console.log('Commit1...');
            }});

        var radioButtonGroup = toolbar.addRadioButtonGroup(function (data) {
            console.log(JSON.stringify(data));
        });

        radioButtonGroup.addButton({ "title": "Radio button 1",
            "icon": "icon-align-left",
{'fraction_non_alphanumeric': 0.13369205298013245, 'fraction_numerical': 0.004346026490066225, 'mean_word_length': 1.5942028985507246, 'pattern_counts': {'":': 28, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 15, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3387627', 'n_tokens_mistral': 1249, 'n_tokens_neox': 1191, 'n_words': 240}