<commit_before>'use strict';

var jsxTask = require('./grunt/tasks/jsx');
var browserifyTask = require('./grunt/tasks/browserify');
var populistTask = require('./grunt/tasks/populist');
var webdriverPhantomJSTask = require('./grunt/tasks/webdriver-phantomjs');
var webdriverJasmineTasks = require('./grunt/tasks/webdriver-jasmine');
var sauceTunnelTask = require('./grunt/tasks/sauce-tunnel');
var npmTask = require('./grunt/tasks/npm');
var releaseTasks = require('./grunt/tasks/release');
var npmReactTasks = require('./grunt/tasks/npm-react');
var npmReactToolsTasks = require('./grunt/tasks/npm-react-tools');
var versionCheckTask = require('./grunt/tasks/version-check');
var gemReactSourceTasks = require('./grunt/tasks/gem-react-source');
var eslintTask = require('./grunt/tasks/eslint');
var testEslintRulesTask = require('./grunt/tasks/test-eslint-rules');

module.exports = function(grunt) {

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    jsx: require('./grunt/config/jsx'),
    browserify: require('./grunt/config/browserify'),
    populist: require('./grunt/config/populist')(grunt),
    connect: require('./grunt/config/server')(grunt),
    'webdriver-jasmine': require('./grunt/config/webdriver-jasmine'),
    npm: require('./grunt/config/npm'),
    clean: [
      './build',
      './*.gem',
      './docs/_site',
      './examples/shared/*.js',
      '.module-cache',
    ],
    /*eslint-disable camelcase */
    compare_size: require('./grunt/config/compare_size'),
    /*eslint-enable camelcase */
  });

  grunt.config.set('compress', require('./grunt/config/compress'));

  Object.keys(grunt.file.readJSON('package.json').devDependencies)
    .filter(function(npmTaskName) {
      return npmTaskName.indexOf('grunt-') === 0;
    })
    .filter(function(npmTaskName) {
      return npmTaskName !== 'grunt-cli';
    })
    .forEach(function(npmTaskName) {
      grunt.loadNpmTasks(npmTaskName);
    });

  grunt.registerTask('eslint', eslintTask);

  grunt.registerTask('lint', ['eslint']);

  grunt.registerTask(
    'download-previous-version',
    require('./grunt/tasks/download-previous-version.js')
  );

  grunt.registerTask('delete-build-modules', function() {
    if (grunt.file.exists('build/modules')) {
      grunt.file.delete('build/modules');
    }
  });

  // Register jsx:normal and :release tasks.
  grunt.registerMultiTask('jsx', jsxTask);

  // Our own browserify-based tasks to build a single JS file build.
  grunt.registerMultiTask('browserify', browserifyTask);

  grunt.registerMultiTask('populist', populistTask);

  grunt.registerTask('sauce-tunnel', sauceTunnelTask);

  grunt.registerMultiTask('webdriver-jasmine', webdriverJasmineTasks);

  grunt.registerMultiTask('npm', npmTask);

  grunt.registerTask('npm-react:release', npmReactTasks.buildRelease);
  grunt.registerTask('npm-react:pack', npmReactTasks.packRelease);
  grunt.registerTask('npm-react-tools:release', npmReactToolsTasks.buildRelease);
  grunt.registerTask('npm-react-tools:pack', npmReactToolsTasks.packRelease);
  grunt.registerTask('gem-react-source:release', gemReactSourceTasks.buildRelease);
  grunt.registerTask('gem-react-source:pack', gemReactSourceTasks.packRelease);

  grunt.registerTask('version-check', versionCheckTask);

  grunt.registerTask('build:basic', [
    'jsx:normal',
    'version-check',
    'browserify:basic',
  ]);
  grunt.registerTask('build:addons', [
    'jsx:normal',
    'browserify:addons',
  ]);
  grunt.registerTask('build:transformer', [
    'jsx:normal',
    'browserify:transformer',
  ]);
  grunt.registerTask('build:min', [
    'jsx:normal',
    'version-check',
    'browserify:min',
  ]);
  grunt.registerTask('build:addons-min', [
    'jsx:normal',
    'browserify:addonsMin',
  ]);
  grunt.registerTask('build:withCodeCoverageLogging', [
    'jsx:normal',
    'version-check',
    'browserify:withCodeCoverageLogging',
  ]);
  grunt.registerTask('build:test', [
    'delete-build-modules',
    'test:eslint-rules',
    'jsx:test',
    'version-check',
    'populist:test',
  ]);
  grunt.registerTask('build:npm-react', [
    'version-check',
    'jsx:normal',
    'npm-react:release',
  ]);
  grunt.registerTask('build:gem-react-source', [
    'build',
    'gem-react-source:release',
  ]);

  grunt.registerTask('webdriver-phantomjs', webdriverPhantomJSTask);

  grunt.registerTask('coverage:parse', require('./grunt/tasks/coverage-parse'));

  grunt.registerTask('test:eslint-rules', testEslintRulesTask);

  grunt.registerTask('test:webdriver:phantomjs', [
    'connect',
    'webdriver-phantomjs',
    'webdriver-jasmine:local',
  ]);

  grunt.registerTask('test:full', [
    'build:test',
    'build:basic',

    'connect',
    'webdriver-phantomjs',
    'webdriver-jasmine:local',

    'sauce-tunnel',
    'webdriver-jasmine:saucelabs_android',
    'webdriver-jasmine:saucelabs_firefox',
    'webdriver-jasmine:saucelabs_chrome',
  ]);

  grunt.registerTask('test:webdriver:saucelabs', [
    'build:test',
    'build:basic',

    'connect',
    'sauce-tunnel',
    'webdriver-jasmine:saucelabs_' + (process.env.BROWSER_NAME || 'ie8'),
  ]);

  grunt.registerTask('test:webdriver:saucelabs:modern', [
    'build:test',
    'build:basic',

    'connect',
    'sauce-tunnel',
    'webdriver-jasmine:saucelabs_android',
    'webdriver-jasmine:saucelabs_firefox',
    'webdriver-jasmine:saucelabs_chrome',
    'webdriver-jasmine:saucelabs_ie11',
  ]);

  grunt.registerTask('test:webdriver:saucelabs:ie', [
    'build:test',
    'build:basic',

    'connect',
    'sauce-tunnel',
    'webdriver-jasmine:saucelabs_ie8',
    'webdriver-jasmine:saucelabs_ie9',
    'webdriver-jasmine:saucelabs_ie10',
    'webdriver-jasmine:saucelabs_ie11',
  ]);

  grunt.registerTask('test:webdriver:saucelabs:ios', [
    'build:test',
    'build:basic',

    'connect',
    'sauce-tunnel',
    'webdriver-jasmine:saucelabs_ios6_1',
    'webdriver-jasmine:saucelabs_ios5_1',
    'webdriver-jasmine:saucelabs_ios4',
  ]);

  grunt.registerTask('test:coverage', [
    'build:withCodeCoverageLogging',
    'test:webdriver:phantomjs',
    'coverage:parse',
  ]);
  grunt.registerTask('fasttest', function() {
    grunt.task.run('test');
  });
  grunt.registerTask('test', function() {
    if (grunt.option('debug')) {
      grunt.task.run('build:test', 'connect:server:keepalive');
    } else {
      grunt.task.run('build:test', 'test:webdriver:phantomjs');
    }
  });
  grunt.registerTask('npm:test', ['build', 'npm:pack']);

  // Optimized build task that does all of our builds. The subtasks will be run
  // in order so we can take advantage of that and only run jsx:normal once.
  grunt.registerTask('build', [
    'delete-build-modules',
    'jsx:normal',
    'version-check',
    'browserify:basic',
    'browserify:transformer',
    'browserify:addons',
    'browserify:min',
    'browserify:addonsMin',
    'npm-react:release',
    'npm-react:pack',
    'npm-react-tools:release',
    'npm-react-tools:pack',
    'compare_size',
  ]);

  // Automate the release!
  grunt.registerTask('release:setup', releaseTasks.setup);
  grunt.registerTask('release:bower', releaseTasks.bower);
  grunt.registerTask('release:docs', releaseTasks.docs);
  grunt.registerTask('release:msg', releaseTasks.msg);
  grunt.registerTask('release:starter', releaseTasks.starter);

  grunt.registerTask('release', [
    'release:setup',
    'clean',
    'build',
    'gem-react-source:release',
    'gem-react-source:pack',
    'release:bower',
    'release:starter',
    'compress',
    'release:docs',
    'release:msg',
  ]);

  // The default task - build - to keep setup easy.
  grunt.registerTask('default', ['build']);
};
<commit_msg>Inline requires in Gruntfile<commit_after>'use strict';

module.exports = function(grunt) {

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    jsx: require('./grunt/config/jsx'),
    browserify: require('./grunt/config/browserify'),
    populist: require('./grunt/config/populist')(grunt),
    connect: require('./grunt/config/server')(grunt),
    'webdriver-jasmine': require('./grunt/config/webdriver-jasmine'),
    npm: require('./grunt/config/npm'),
    clean: [
      './build',
      './*.gem',
      './docs/_site',
      './examples/shared/*.js',
      '.module-cache',
    ],
    /*eslint-disable camelcase */
    compare_size: require('./grunt/config/compare_size'),
    /*eslint-enable camelcase */
  });

  grunt.config.set('compress', require('./grunt/config/compress'));

  Object.keys(grunt.file.readJSON('package.json').devDependencies)
    .filter(function(npmTaskName) {
      return npmTaskName.indexOf('grunt-') === 0;
    })
    .filter(function(npmTaskName) {
      return npmTaskName !== 'grunt-cli';
    })
    .forEach(function(npmTaskName) {
      grunt.loadNpmTasks(npmTaskName);
    });

  grunt.registerTask('eslint', require('./grunt/tasks/eslint'));

  grunt.registerTask('lint', ['eslint']);

  grunt.registerTask(
    'download-previous-version',
    require('./grunt/tasks/download-previous-version.js')
  );

  grunt.registerTask('delete-build-modules', function() {
    if (grunt.file.exists('build/modules')) {
      grunt.file.delete('build/modules');
    }
  });

  // Register jsx:normal and :release tasks.
  grunt.registerMultiTask('jsx', require('./grunt/tasks/jsx'));

  // Our own browserify-based tasks to build a single JS file build.
  grunt.registerMultiTask('browserify', require('./grunt/tasks/browserify'));

  grunt.registerMultiTask('populist', require('./grunt/tasks/populist'));

  grunt.registerTask('sauce-tunnel', require('./grunt/tasks/sauce-tunnel'));

  grunt.registerMultiTask('webdriver-jasmine', require('./grunt/tasks/webdriver-jasmine'));

  grunt.registerMultiTask('npm', require('./grunt/tasks/npm'));

  var npmReactTasks = require('./grunt/tasks/npm-react');
  grunt.registerTask('npm-react:release', npmReactTasks.buildRelease);
  grunt.registerTask('npm-react:pack', npmReactTasks.packRelease);

  var npmReactToolsTasks = require('./grunt/tasks/npm-react-tools');
  grunt.registerTask('npm-react-tools:release', npmReactToolsTasks.buildRelease);
  grunt.registerTask('npm-react-tools:pack', npmReactToolsTasks.packRelease);

  var gemReactSourceTasks = require('./grunt/tasks/gem-react-source');
  grunt.registerTask('gem-react-source:release', gemReactSourceTasks.buildRelease);
  grunt.registerTask('gem-react-source:pack', gemReactSourceTasks.packRelease);

  grunt.registerTask('version-check', require('./grunt/tasks/version-check'));

  grunt.registerTask('build:basic', [
    'jsx:normal',
    'version-check',
    'browserify:basic',
  ]);
  grunt.registerTask('build:addons', [
    'jsx:normal',
    'browserify:addons',
  ]);
  grunt.registerTask('build:transformer', [
    'jsx:normal',
    'browserify:transformer',
  ]);
  grunt.registerTask('build:min', [
    'jsx:normal',
    'version-check',
    'browserify:min',
  ]);
  grunt.registerTask('build:addons-min', [
    'jsx:normal',
    'browserify:addonsMin',
  ]);
  grunt.registerTask('build:withCodeCoverageLogging', [
    'jsx:normal',
    'version-check',
    'browserify:withCodeCoverageLogging',
  ]);
  grunt.registerTask('build:test', [
    'delete-build-modules',
    'test:eslint-rules',
    'jsx:test',
    'version-check',
    'populist:test',
  ]);
  grunt.registerTask('build:npm-react', [
    'version-check',
    'jsx:normal',
    'npm-react:release',
  ]);
  grunt.registerTask('build:gem-react-source', [
    'build',
    'gem-react-source:release',
  ]);

  grunt.registerTask('webdriver-phantomjs', require('./grunt/tasks/webdriver-phantomjs'));

  grunt.registerTask('coverage:parse', require('./grunt/tasks/coverage-parse'));

  grunt.registerTask('test:eslint-rules', require('./grunt/tasks/test-eslint-rules'));

  grunt.registerTask('test:webdriver:phantomjs', [
    'connect',
    'webdriver-phantomjs',
    'webdriver-jasmine:local',
  ]);

  grunt.registerTask('test:full', [
    'build:test',
    'build:basic',

    'connect',
    'webdriver-phantomjs',
    'webdriver-jasmine:local',

    'sauce-tunnel',
    'webdriver-jasmine:saucelabs_android',
    'webdriver-jasmine:saucelabs_firefox',
    'webdriver-jasmine:saucelabs_chrome',
  ]);

  grunt.registerTask('test:webdriver:saucelabs', [
    'build:test',
    'build:basic',

    'connect',
    'sauce-tunnel',
    'webdriver-jasmine:saucelabs_' + (process.env.BROWSER_NAME || 'ie8'),
  ]);

  grunt.registerTask('test:webdriver:saucelabs:modern', [
    'build:test',
    'build:basic',

    'connect',
    'sauce-tunnel',
    'webdriver-jasmine:saucelabs_android',
    'webdriver-jasmine:saucelabs_firefox',
    'webdriver-jasmine:saucelabs_chrome',
    'webdriver-jasmine:saucelabs_ie11',
  ]);

  grunt.registerTask('test:webdriver:saucelabs:ie', [
    'build:test',
    'build:basic',

    'connect',
    'sauce-tunnel',
    'webdriver-jasmine:saucelabs_ie8',
    'webdriver-jasmine:saucelabs_ie9',
    'webdriver-jasmine:saucelabs_ie10',
    'webdriver-jasmine:saucelabs_ie11',
  ]);

  grunt.registerTask('test:webdriver:saucelabs:ios', [
    'build:test',
    'build:basic',

    'connect',
    'sauce-tunnel',
    'webdriver-jasmine:saucelabs_ios6_1',
    'webdriver-jasmine:saucelabs_ios5_1',
    'webdriver-jasmine:saucelabs_ios4',
  ]);

  grunt.registerTask('test:coverage', [
    'build:withCodeCoverageLogging',
    'test:webdriver:phantomjs',
    'coverage:parse',
  ]);
  grunt.registerTask('fasttest', function() {
    grunt.task.run('test');
  });
  grunt.registerTask('test', function() {
    if (grunt.option('debug')) {
      grunt.task.run('build:test', 'connect:server:keepalive');
    } else {
      grunt.task.run('build:test', 'test:webdriver:phantomjs');
    }
  });
  grunt.registerTask('npm:test', ['build', 'npm:pack']);

  // Optimized build task that does all of our builds. The subtasks will be run
  // in order so we can take advantage of that and only run jsx:normal once.
  grunt.registerTask('build', [
    'delete-build-modules',
    'jsx:normal',
    'version-check',
    'browserify:basic',
    'browserify:transformer',
    'browserify:addons',
    'browserify:min',
    'browserify:addonsMin',
    'npm-react:release',
    'npm-react:pack',
    'npm-react-tools:release',
    'npm-react-tools:pack',
    'compare_size',
  ]);

  // Automate the release!
  var releaseTasks = require('./grunt/tasks/release');
  grunt.registerTask('release:setup', releaseTasks.setup);
  grunt.registerTask('release:bower', releaseTasks.bower);
  grunt.registerTask('release:docs', releaseTasks.docs);
  grunt.registerTask('release:msg', releaseTasks.msg);
  grunt.registerTask('release:starter', releaseTasks.starter);

  grunt.registerTask('release', [
    'release:setup',
    'clean',
    'build',
    'gem-react-source:release',
    'gem-react-source:pack',
    'release:bower',
    'release:starter',
    'compress',
    'release:docs',
    'release:msg',
  ]);

  // The default task - build - to keep setup easy.
  grunt.registerTask('default', ['build']);
};
<|endoftext|>


<commit_before>import React from 'react'
import PropTypes from 'prop-types'

import { WindowControls } from './window-controls'
import { MenuBar } from './menu'

export const TitleBar = ({ icon, menu, disableMinimize, disableMaximize, className }) => (
  <div id="electron-app-title-bar" className={`electron-app-title-bar ${className || ''}`}>

    <MenuBar menu={menu} />
    <WindowControls disableMinimize={disableMinimize} disableMaximize={disableMaximize} />

)

TitleBar.propTypes = {
  icon: PropTypes.string,
  disableMinimize: PropTypes.bool,
  disableMaximize: PropTypes.bool,
  menu: PropTypes.array,
}
<commit_msg>Don't render the image if icon prop is not supplied<commit_after>import React from 'react'
import PropTypes from 'prop-types'

import { WindowControls } from './window-controls'
import { MenuBar } from './menu'

export const TitleBar = ({ icon, menu, disableMinimize, disableMaximize, className }) => (
  <div id="electron-app-title-bar" className={`electron-app-title-bar ${className || ''}`}>

    {typeof icon !== 'undefined' && }
    <MenuBar menu={menu} />
    <WindowControls disableMinimize={disableMinimize} disableMaximize={disableMaximize} />

)

TitleBar.propTypes = {
  icon: PropTypes.string,
  disableMinimize: PropTypes.bool,
  disableMaximize: PropTypes.bool,
  menu: PropTypes.array,
}
<|endoftext|>


<commit_before>var React = require('react');
var globals = require('./globals');
var Panel = require('react-bootstrap').Panel;
//var SubIPanel = require('./item').SubIPanel; //For some reason this doesn't work but the below does...
import { SubIPanel } from './item';

/**
 * Entire ExperimentSet page view.
 */

var ExperimentSetView = module.exports.ExperimentSetView = React.createClass({

    render: function() {
        var itemClass = globals.itemClass(this.props.context, 'view-detail panel');
        //var tips = tipsFromSchema(this.props.schemas, context);

        return (

Experiment Set

                <ExperimentSetHeader {...this.props} />

                <Panel className="data-display panel-body-with-header">

                        {Object.keys(this.props.context).sort().map((ikey, idx) =>

{ ikey }

{ formValue(this.props.schemas, this.props.context[ikey]) }

                        )}

                </Panel>

        );
    }

});

var ExperimentSetHeader = React.createClass({

    parsedCreationDate(){
        if (!('date_created' in this.props.context)) return null;
        return (

             { (new Date(this.props.context.date_created)).toLocaleString(undefined, {
                year : "numeric",
                month : "long",
                day : "numeric",
                hour : "numeric",
                minute : "numeric"
            })}

        );
    },

    parsedStatus(){
        if (!('status' in this.props.context)) return null;
        var iconClass = null;
        switch (this.props.context.status){

            case 'in review by lab':
            case 'in review by project':
                iconClass = 'icon ss-stopwatch';
                break;

        }
        return  { this.props.context.status };
    },

    parsedExperimentSetType(){
        if (!('experimentset_type' in this.props.context)) return null;
        return (

                { this.props.context.experimentset_type }

        );
    },

    render: function() {
        var title = globals.listing_titles.lookup(this.props.context)({context: this.props.context});
        return (

                        { /* PLACEHOLDER / TEMP-EMPTY */ }

                        { this.parsedStatus() }

Accession  { title }

{ this.parsedExperimentSetType() }

{ this.parsedCreationDate() }

        );
    }
});

globals.panel_views.register(ExperimentSetView, 'ExperimentSet');

var formValue = function (schemas, item) {
    var toReturn = [];
    if(Array.isArray(item)) {
        for (var i=0; i < item.length; i++){
            toReturn.push(formValue(schemas, item[i]));
        }
    }else if (typeof item === 'object') {
        //console.log(item);
        toReturn.push(<SubIPanel schemas={schemas} content={item}/>);
    }else{
        if (typeof item === 'string' && item.charAt(0) === '/') {
            toReturn.push({item});
        }else{
            toReturn.push(item);
        }
    }
    return(

{toReturn}

    );
};
<commit_msg>Comment edit before merging in master<commit_after>var React = require('react');
var globals = require('./globals');
var Panel = require('react-bootstrap').Panel;
//var SubIPanel = require('./item').SubIPanel;
//For some reason the above doesn't work but the below does...
import { SubIPanel } from './item';

/**
 * Entire ExperimentSet page view.
 */

var ExperimentSetView = module.exports.ExperimentSetView = React.createClass({

    render: function() {
        var itemClass = globals.itemClass(this.props.context, 'view-detail panel');
        //var tips = tipsFromSchema(this.props.schemas, context);

        return (

Experiment Set

                <ExperimentSetHeader {...this.props} />

                <Panel className="data-display panel-body-with-header">

                        {Object.keys(this.props.context).sort().map((ikey, idx) =>

{ ikey }

{ formValue(this.props.schemas, this.props.context[ikey]) }

                        )}

                </Panel>

        );
    }

});

var ExperimentSetHeader = React.createClass({

    parsedCreationDate(){
        if (!('date_created' in this.props.context)) return null;
        return (

             { (new Date(this.props.context.date_created)).toLocaleString(undefined, {
                year : "numeric",
                month : "long",
                day : "numeric",
                hour : "numeric",
                minute : "numeric"
            })}

        );
    },

    parsedStatus(){
        if (!('status' in this.props.context)) return null;
        var iconClass = null;
        switch (this.props.context.status){

            case 'in review by lab':
            case 'in review by project':
                iconClass = 'icon ss-stopwatch';
                break;

        }
        return  { this.props.context.status };
    },

    parsedExperimentSetType(){
        if (!('experimentset_type' in this.props.context)) return null;
        return (

                { this.props.context.experimentset_type }

        );
    },

    render: function() {
        var title = globals.listing_titles.lookup(this.props.context)({context: this.props.context});
        return (

                        { /* PLACEHOLDER / TEMP-EMPTY */ }

                        { this.parsedStatus() }

Accession  { title }

{ this.parsedExperimentSetType() }

{ this.parsedCreationDate() }

        );
    }
});

globals.panel_views.register(ExperimentSetView, 'ExperimentSet');

var formValue = function (schemas, item) {
    var toReturn = [];
    if(Array.isArray(item)) {
        for (var i=0; i < item.length; i++){
            toReturn.push(formValue(schemas, item[i]));
        }
    }else if (typeof item === 'object') {
        //console.log(item);
        toReturn.push(<SubIPanel schemas={schemas} content={item}/>);
    }else{
        if (typeof item === 'string' && item.charAt(0) === '/') {
            toReturn.push({item});
        }else{
            toReturn.push(item);
        }
    }
    return(

{toReturn}

    );
};
<|endoftext|>


<commit_before>/**
 * Main user interface for viewing, creating and editing DatasetGroups. Three panes.
 *
 * At the top, the available ExpressionExperimentSets are shown. At the bottom left, searching for experiments; at the
 * bottom right, the experiments that are in the set. If the user is authenticated, they can save new DatasetGroups to
 * the database.
 *
 * @author Paul
 *
 * @version $Id$
 *
 *
 * @class Gemma.DatasetGroupEditor
 * @extends Ext.Window
 */

/*
 * get width and height of viewport to use for sizing the parent and children panels
 */
var windowWidth = Ext.getBody().getViewSize().width * 0.9;
var westWidth = windowWidth* 0.33;
var eastWidth = windowWidth* 0.33;
var centreWidth = windowWidth-westWidth-eastWidth;

Gemma.DatasetGroupEditor = Ext.extend(Ext.Window, {

			id : 'dataset-chooser',
			name : 'datasetchooser',
			layout : 'border',
			width : windowWidth,
			height : 500,
			closeAction : 'hide',
			constrainHeader : false,
			title : "Dataset Group Editor ",
			isLoggedIn : false,
			maximizable : false,

			/**
			 *
			 */
			initComponent : function() {

				Ext.apply(this, {
							buttons : [{
										id : 'done-selecting-button',
										text : "Done",
										handler : this.onCommit,
										scope : this
									}, {
										id : 'help-selecting-button',
										text : "Help",
										handler : this.onHelp,
										scope : this
									}]
						});

				Gemma.DatasetGroupEditor.superclass.initComponent.call(this);

				this.isLoggedIn = Ext.get('loggedIn').getValue();

				/**
				 * Plain grid for displaying datasets in the current set. Editable.
				 */
				this.datasetGroupMembersGrid = new Gemma.ExpressionExperimentGrid({
							isLoggedIn : this.isLoggedIn,
							region : 'east',
							title : "Datasets in current set",
							showAnalysisInfo : true,
							loadMask : {
								msg : 'Loading datasets ...'
							},
							tbar : ['->', {
										text : "Delete selected",
										handler : this.removeSelectedFromdatasetGroupMembersGrid,
										scope : this
									}],
							split : true,
							height : 200,
							width : eastWidth,
							minWidth : 200
						});

				/*
				 * Space to show the details about the currently selected expression experiment
				 */
				this.dataSetDetailsPanel = new Ext.Panel({
							region : 'south',
							split : true,
							bodyStyle : 'padding:8px',
							height : 200
						});

				/**
				 * Datasets that can be added to the current set.
				 */
				this.sourceDatasetsGrid = new Gemma.ExpressionExperimentGrid({
							editable : false,
							isLoggedIn : this.isLoggedIn,
							title : "Dataset locator",
							region : 'center',
							split : true,
							showAnalysisInfo : true,
							height : 200,
							loadMask : {
								msg : 'Searching ...'
							},
							minWidth : centreWidth,
							tbar : new Gemma.DataSetSearchAndGrabToolbar({
										taxonSearch : true,
										targetGrid : this.datasetGroupMembersGrid

									})

						});

				/*
				 * Top grid for showing the datasetGroups
				 */
				this.datasetGroupGrid = new Gemma.DatasetGroupGridPanel({
							store : this.datasetGroupStore,
							region : 'west',
							layout : 'fit',
							split : true,
							collapsible : true,
							collapseMode : 'mini',
							height : 200,
							width : westWidth,
							title : "Available expression experiment sets",
							displayGrid : this.datasetGroupMembersGrid,
							tbar : new Gemma.DatasetGroupEditToolbar()
						});

				this.add(this.datasetGroupGrid);
				this.add(this.datasetGroupMembersGrid);
				this.add(this.sourceDatasetsGrid);
				this.add(this.dataSetDetailsPanel);

				/*
				 * filter so we only see data sets that are NOT in the GroupMembersGrid - Remove datasets that are in
				 * the other grid.
				 */
				this.sourceDatasetsGrid.getStore().on('load', function(idsFound) {
					this.sourceDatasetsGrid.getStore().filterBy(function(record, id) {
								var rid = record.get('id');
								return this.datasetGroupMembersGrid.getStore().find('id', rid) < 0;
							}, this);

					this.sourceDatasetsGrid.setTitle(this.sourceDatasetsGrid.title + ", " +
							this.sourceDatasetsGrid.getStore().getCount() + " addable");

				}.createDelegate(this));

				this.datasetGroupGrid.getTopToolbar().on("delete-set", function(rec) {
							this.clearDisplay();
							this.fireEvent('delete-set');
						}.createDelegate(this));

				this.datasetGroupMembersGrid.getStore().on('remove', function(store, record, index) {
							this.dirtySet(store);
						}, this);
				this.datasetGroupMembersGrid.getStore().on('add', function(store, records, index) {
							this.dirtySet(store);
						}, this);

				this.datasetGroupGrid.getSelectionModel().on('rowselect', function(model, rowindex, record) {
							this.display(record);
						}, this);

				this.sourceDatasetsGrid.getSelectionModel().on('rowselect', this.showEEDetails, this, {
					buffer : 100
						// keep from firing too many times at once
					});
				this.datasetGroupMembersGrid.getSelectionModel().on('rowselect', this.showEEDetails, this, {
					buffer : 100
						// keep from firing too many times at once
					});

				this.on('show', function(panel) {
							var r = this.datasetGroupGrid.getStore().getSelected();
							if (r) {
								this.datasetGroupGrid.getSelectionModel().selectRecords([r], false);
								this.datasetGroupGrid.getView().focusRow(this.datasetGroupGrid.getStore().indexOf(r));
							}

						}, this, {
							delay : 100,
							single : true
						});

				this.addEvents({
							"select" : true,
							"commit" : true,
							'delete-set' : true
						});

			},

			showEEDetails : function(model, rowindex, record) {

				if (this.detailsmask === null) {
					this.detailsmask = new Ext.LoadMask(this.dataSetDetailsPanel.body, {
								msg : "Loading details ..."
							});
				}

				this.detailsmask.show();
				ExpressionExperimentController.getDescription(record.id, {
							callback : function(data) {
								Ext.DomHelper.overwrite(this.dataSetDetailsPanel.body, "
" +
												record.get('shortName') + "

" + record.get('name') +
												"

" + data + "
");
								this.detailsmask.hide();
							}.createDelegate(this)
						});

			},

			dirtySet : function(store) {
				store.clearFilter(false);
				// collect current ids from store
				var currentIds = [];
				store.each(function(r) {
							currentIds.push(r.get('id'));
						}, this);

				var rec = this.datasetGroupGrid.getSelectionModel().getSelected();

				if (rec) {
					rec.set('expressionExperimentIds', currentIds);
					rec.set('numExperiments', currentIds.length);
				}
			},

			/**
			 * Show the selected eeset members in the lower right-hand grid, if it exists
			 */

			display : function(record) {
				if (record && this.datasetGroupMembersGrid) {
					this.datasetGroupMembersGrid.getStore().removeAll();
					this.datasetGroupMembersGrid.getStore().load({
								params : [record.get("expressionExperimentIds")]
							});
					this.datasetGroupMembersGrid.setTitle(record.get("name"));
				}

				if (record && this.sourceDatasetsGrid) {
					this.sourceDatasetsGrid.getTopToolbar().setTaxon(record.get("taxonId"));
					this.sourceDatasetsGrid.getTopToolbar().taxonCombo.disable();
				}
			},

			/**
			 * Clear the lower right grid
			 */
			clearDisplay : function() {
				this.datasetGroupMembersGrid.getStore().removeAll();
				this.datasetGroupMembersGrid.setTitle('Set members');
				this.sourceDatasetsGrid.getTopToolbar().taxonCombo.enable();
			},

			removeSelectedFromdatasetGroupMembersGrid : function() {
				this.datasetGroupMembersGrid.removeSelected();
			},

			/**
			 * When a edit is completed and we're closing the window.
			 */
			onCommit : function() {
				var rec = this.datasetGroupGrid.getStore().getSelected();

				/*
				 * If any are dirty, and if any of the modified records are saveable by this user, then prompt for save.
				 */
				var numModified = this.datasetGroupStore.getModifiedRecords().length;

				var canSave = this.isLoggedIn;
				for (var i = 0; i < numModified; i++) {
					var r = this.datasetGroupStore.getModifiedRecords()[i];
					if (r.get('currentUserHasWritePermission')) {
						canSave = true;
						break;
					}
				}

				if (numModified > 0 && canSave) {
					Ext.Msg.show({
								animEl : this.getEl(),
								title : 'Save Changes?',
								msg : 'You have unsaved changes. Would you like to save them?',
								buttons : {
									ok : 'Yes',
									cancel : 'No'
								},
								fn : function(btn, text) {
									if (btn === 'ok') {
										this.datasetGroupStore.commitChanges();
									}
									if (rec) {
										this.datasetGroupStore.setSelected(rec);
										this.fireEvent("select", rec);
										this.fireEvent("commit", rec);
									}
									this.hide();
								}.createDelegate(this),
								scope : this,
								icon : Ext.MessageBox.QUESTION
							});
				} else {
					this.hide();
					if (rec) {
						this.datasetGroupStore.setSelected(rec);
						this.fireEvent("select", rec);
					}
					this.fireEvent("commit", rec);
				}

			},

			onHelp : function() {
				window.open(Gemma.HOST + 'faculty/pavlidis/wiki/display/gemma/Dataset+chooser', 'DataSetChooserHelp');
			}

		});<commit_msg>fixed bug that prevented experiment summaries from being displayed.<commit_after>/**
 * Main user interface for viewing, creating and editing DatasetGroups. Three panes.
 *
 * At the top, the available ExpressionExperimentSets are shown. At the bottom left, searching for experiments; at the
 * bottom right, the experiments that are in the set. If the user is authenticated, they can save new DatasetGroups to
 * the database.
 *
 * @author Paul
 *
 * @version $Id$
 *
 *
 * @class Gemma.DatasetGroupEditor
 * @extends Ext.Window
 */

/*
 * get width and height of viewport to use for sizing the parent and children panels
 */
var windowWidth = Ext.getBody().getViewSize().width * 0.9;
var westWidth = windowWidth* 0.33;
var eastWidth = windowWidth* 0.33;
var centreWidth = windowWidth-westWidth-eastWidth;

Gemma.DatasetGroupEditor = Ext.extend(Ext.Window, {

			id : 'dataset-chooser',
			name : 'datasetchooser',
			layout : 'border',
			width : windowWidth,
			height : 500,
			closeAction : 'hide',
			constrainHeader : false,
			title : "Dataset Group Editor ",
			isLoggedIn : false,
			maximizable : false,

			/**
			 *
			 */
			initComponent : function() {

				Ext.apply(this, {
							buttons : [{
										id : 'done-selecting-button',
										text : "Done",
										handler : this.onCommit,
										scope : this
									}, {
										id : 'help-selecting-button',
										text : "Help",
										handler : this.onHelp,
										scope : this
									}]
						});

				Gemma.DatasetGroupEditor.superclass.initComponent.call(this);

				this.isLoggedIn = Ext.get('loggedIn').getValue();

				/**
				 * Plain grid for displaying datasets in the current set. Editable.
				 */
				this.datasetGroupMembersGrid = new Gemma.ExpressionExperimentGrid({
							isLoggedIn : this.isLoggedIn,
							region : 'east',
							title : "Datasets in current set",
							showAnalysisInfo : true,
							loadMask : {
								msg : 'Loading datasets ...'
							},
							tbar : ['->', {
										text : "Delete selected",
										handler : this.removeSelectedFromdatasetGroupMembersGrid,
										scope : this
									}],
							split : true,
							height : 200,
							width : eastWidth,
							minWidth : 200
						});

				/*
				 * Space to show the details about the currently selected expression experiment
				 */
				this.dataSetDetailsPanel = new Ext.Panel({
							region : 'south',
							split : true,
							bodyStyle : 'padding:8px',
							height : 200
						});

				/**
				 * Datasets that can be added to the current set.
				 */
				this.sourceDatasetsGrid = new Gemma.ExpressionExperimentGrid({
							editable : false,
							isLoggedIn : this.isLoggedIn,
							title : "Dataset locator",
							region : 'center',
							split : true,
							showAnalysisInfo : true,
							height : 200,
							loadMask : {
								msg : 'Searching ...'
							},
							minWidth : centreWidth,
							tbar : new Gemma.DataSetSearchAndGrabToolbar({
										taxonSearch : true,
										targetGrid : this.datasetGroupMembersGrid

									})

						});

				/*
				 * Top grid for showing the datasetGroups
				 */
				this.datasetGroupGrid = new Gemma.DatasetGroupGridPanel({
							store : this.datasetGroupStore,
							region : 'west',
							layout : 'fit',
							split : true,
							collapsible : true,
							collapseMode : 'mini',
							height : 200,
							width : westWidth,
							title : "Available expression experiment sets",
							displayGrid : this.datasetGroupMembersGrid,
							tbar : new Gemma.DatasetGroupEditToolbar()
						});

				this.add(this.datasetGroupGrid);
				this.add(this.datasetGroupMembersGrid);
				this.add(this.sourceDatasetsGrid);
				this.add(this.dataSetDetailsPanel);

				/*
				 * filter so we only see data sets that are NOT in the GroupMembersGrid - Remove datasets that are in
				 * the other grid.
				 */
				this.sourceDatasetsGrid.getStore().on('load', function(idsFound) {
					this.sourceDatasetsGrid.getStore().filterBy(function(record, id) {
								var rid = record.get('id');
								return this.datasetGroupMembersGrid.getStore().find('id', rid) < 0;
							}, this);

					this.sourceDatasetsGrid.setTitle(this.sourceDatasetsGrid.title + ", " +
							this.sourceDatasetsGrid.getStore().getCount() + " addable");

				}.createDelegate(this));

				this.datasetGroupGrid.getTopToolbar().on("delete-set", function(rec) {
							this.clearDisplay();
							this.fireEvent('delete-set');
						}.createDelegate(this));

				this.datasetGroupMembersGrid.getStore().on('remove', function(store, record, index) {
							this.dirtySet(store);
						}, this);
				this.datasetGroupMembersGrid.getStore().on('add', function(store, records, index) {
							this.dirtySet(store);
						}, this);

				this.datasetGroupGrid.getSelectionModel().on('rowselect', function(model, rowindex, record) {
							this.display(record);
						}, this);

				this.sourceDatasetsGrid.getSelectionModel().on('rowselect', this.showEEDetails, this, {
					buffer : 100
						// keep from firing too many times at once
					});
				this.datasetGroupMembersGrid.getSelectionModel().on('rowselect', this.showEEDetails, this, {
					buffer : 100
						// keep from firing too many times at once
					});

				this.on('show', function(panel) {
							var r = this.datasetGroupGrid.getStore().getSelected();
							if (r) {
								this.datasetGroupGrid.getSelectionModel().selectRecords([r], false);
								this.datasetGroupGrid.getView().focusRow(this.datasetGroupGrid.getStore().indexOf(r));
							}

						}, this, {
							delay : 100,
							single : true
						});

				this.addEvents({
							"select" : true,
							"commit" : true,
							'delete-set' : true
						});

			},

			showEEDetails : function(model, rowindex, record) {

				if (typeof this.detailsmask == 'undefined' || this.detailsmask === null) {
					this.detailsmask = new Ext.LoadMask(this.dataSetDetailsPanel.body, {
								msg : "Loading details ..."
							});
				}

				this.detailsmask.show();
				ExpressionExperimentController.getDescription(record.id, {
							callback : function(data) {
								Ext.DomHelper.overwrite(this.dataSetDetailsPanel.body, "
" +
												record.get('shortName') + "

" + record.get('name') +
												"

" + data + "
");
								this.detailsmask.hide();
							}.createDelegate(this)
						});

			},

			dirtySet : function(store) {
				store.clearFilter(false);
				// collect current ids from store
				var currentIds = [];
				store.each(function(r) {
							currentIds.push(r.get('id'));
						}, this);

				var rec = this.datasetGroupGrid.getSelectionModel().getSelected();

				if (rec) {
					rec.set('expressionExperimentIds', currentIds);
					rec.set('numExperiments', currentIds.length);
				}
			},

			/**
			 * Show the selected eeset members in the lower right-hand grid, if it exists
			 */

			display : function(record) {
				if (record && this.datasetGroupMembersGrid) {
					this.datasetGroupMembersGrid.getStore().removeAll();
					this.datasetGroupMembersGrid.getStore().load({
								params : [record.get("expressionExperimentIds")]
							});
					this.datasetGroupMembersGrid.setTitle(record.get("name"));
				}

				if (record && this.sourceDatasetsGrid) {
					this.sourceDatasetsGrid.getTopToolbar().setTaxon(record.get("taxonId"));
					this.sourceDatasetsGrid.getTopToolbar().taxonCombo.disable();
				}
			},

			/**
			 * Clear the lower right grid
			 */
			clearDisplay : function() {
				this.datasetGroupMembersGrid.getStore().removeAll();
				this.datasetGroupMembersGrid.setTitle('Set members');
				this.sourceDatasetsGrid.getTopToolbar().taxonCombo.enable();
			},

			removeSelectedFromdatasetGroupMembersGrid : function() {
				this.datasetGroupMembersGrid.removeSelected();
			},

			/**
			 * When a edit is completed and we're closing the window.
			 */
			onCommit : function() {
				var rec = this.datasetGroupGrid.getStore().getSelected();

				/*
				 * If any are dirty, and if any of the modified records are saveable by this user, then prompt for save.
				 */
				var numModified = this.datasetGroupStore.getModifiedRecords().length;

				var canSave = this.isLoggedIn;
				for (var i = 0; i < numModified; i++) {
					var r = this.datasetGroupStore.getModifiedRecords()[i];
					if (r.get('currentUserHasWritePermission')) {
						canSave = true;
						break;
					}
				}

				if (numModified > 0 && canSave) {
					Ext.Msg.show({
								animEl : this.getEl(),
								title : 'Save Changes?',
								msg : 'You have unsaved changes. Would you like to save them?',
								buttons : {
									ok : 'Yes',
									cancel : 'No'
								},
								fn : function(btn, text) {
									if (btn === 'ok') {
										this.datasetGroupStore.commitChanges();
									}
									if (rec) {
										this.datasetGroupStore.setSelected(rec);
										this.fireEvent("select", rec);
										this.fireEvent("commit", rec);
									}
									this.hide();
								}.createDelegate(this),
								scope : this,
								icon : Ext.MessageBox.QUESTION
							});
				} else {
					this.hide();
					if (rec) {
						this.datasetGroupStore.setSelected(rec);
						this.fireEvent("select", rec);
					}
					this.fireEvent("commit", rec);
				}

			},

			onHelp : function() {
				window.open(Gemma.HOST + 'faculty/pavlidis/wiki/display/gemma/Dataset+chooser', 'DataSetChooserHelp');
			}

		});<|endoftext|>


<commit_before>module.exports = function (grunt) {
    'use strict';

    var env = grunt.option('env') || 'ui',
        lib = {
            'mobile': 'Zepto',
            'ui': 'jQuery'
        },
        files = require('./libs/files/' + env);

    // Project configuration.
    grunt.initConfig({
        'pkg': grunt.file.readJSON('package.json'),

        'banner': {
            'full': [
                '/*!',
                ' * Chico UI v<%= pkg.version %>',
                ' * http://chico-ui.com.ar/',
                ' *',
                ' * Copyright (c) <%= grunt.template.today("yyyy") %>, MercadoLibre.com',
                ' * Released under the MIT license.',
                ' * http://chico-ui.com.ar/license',
                ' */\n'
            ].join('\n'),
            'min': '/*! Chico UI v<%= pkg.version %> chico-ui.com.ar | chico-ui.com.ar/license */'
        },

        'concat': {
            'options': {
                'stripBanners': {
                    'options': {
                        'block': true,
                        'line': true
                    }
                }
            },

            'core': {
                'options': {
                    'banner': '<%= banner.full %>' + "\n\n(function (window, $) {\n\t'use strict';\n\n",
                    'footer': '\n\twindow.ch = ch;\n}(this, ' + lib[env] + '));'
                },
                'src': files.JS.core,
                'dest': 'temp/' + env + '/core.tmp.js'
            },

            'js': {
                'src': ['temp/' + env + '/core.tmp.js'].concat(files.JS.abilities).concat(files.JS.widgets),
                'dest':'temp/' + env + '/chico.js'
            },

            'css': {
                'options': {
                    'banner': '<%= banner.full %>'
                },
                'src': files.CSS.resetML.concat(files.CSS.core).concat(files.CSS.widgets),
                'dest':'temp/' + env + '/chico.css'
            }
        },

        'uglify': {
            'options': {
                'mangle': false,
                'banner': '<%= banner.min %>' + "(function(window,$){'use strict';",
                'footer': 'window.ch = ch;}(this, ' + lib[env] + '));'
            },

            'min': {
                'src': ['<%= concat.js.dest %>'],
                'dest':'temp/' + env + '/chico.min.js'
            }
        },

        'cssmin': {
            'options': {
                'banner': '<%= banner.min %>',
                'keepSpecialComments': 0
            },

            'ui-css': {
                'src': ['<%= concat.css.dest %>'],
                'dest': 'temp/' + env + '/chico.min.css'
            }
        },

        'clean': ["temp/**/*.tmp.js"],

        'jslint': { // configure the task
            'files': files.JS.abilities.concat(files.JS.widgets),
            'directives': {
                'nomen': true,
                'todo': true
            },
            'options': {
                'errorsOnly': true, // only display errors
                'failOnError': false, // defaults to true
                'shebang': true, // ignore shebang lines
            }
        },

        'jsdoc': {
            'dist': {
                'src': [
                    "src/shared/js/ch.helpers.js",
                    "src/shared/js/ch.util.js",
                    "src/shared/js/ch.support.js",
                    "src/shared/js/ch.events.js",
                    "src/ui/js/ch.events.js",
                    "src/shared/js/ch.factory.js",
                    "src/ui/js/ch.shortcuts.js",
                    "src/ui/js/ch.init.js",

                    "src/shared/js/ch.EventEmitter.js",
                    "src/shared/js/ch.Content.js",
                    "src/shared/js/ch.Closable.js",
                    "src/shared/js/ch.Collapsible.js",
                    "src/shared/js/ch.Viewport.js",
                    "src/shared/js/ch.Positioner.js",

                    "src/shared/js/ch.Widget.js",
                    "src/shared/js/ch.Expandable.js"

                ],
                'options': {
                    'destination': './doc',
                    'private': false
                }
            }
        }
    });

    // Load plugins
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-cssmin');
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-jslint');
    grunt.loadNpmTasks('grunt-jsdoc');

    // Resgister task(s).
    grunt.registerTask('default', []);
    grunt.registerTask('lint', ['jslint']);
    grunt.registerTask('doc', ['jsdoc']);
    grunt.registerTask('dev', ['concat', 'clean']);
    grunt.registerTask('prod', ['concat', 'uglify', 'cssmin', 'clean']);
};<commit_msg>Add new files on jsdoc task.<commit_after>module.exports = function (grunt) {
    'use strict';

    var env = grunt.option('env') || 'ui',
        lib = {
            'mobile': 'Zepto',
            'ui': 'jQuery'
        },
        files = require('./libs/files/' + env);

    // Project configuration.
    grunt.initConfig({
        'pkg': grunt.file.readJSON('package.json'),

        'banner': {
            'full': [
                '/*!',
                ' * Chico UI v<%= pkg.version %>',
                ' * http://chico-ui.com.ar/',
                ' *',
                ' * Copyright (c) <%= grunt.template.today("yyyy") %>, MercadoLibre.com',
                ' * Released under the MIT license.',
                ' * http://chico-ui.com.ar/license',
                ' */\n'
            ].join('\n'),
            'min': '/*! Chico UI v<%= pkg.version %> chico-ui.com.ar | chico-ui.com.ar/license */'
        },

        'concat': {
            'options': {
                'stripBanners': {
                    'options': {
                        'block': true,
                        'line': true
                    }
                }
            },

            'core': {
                'options': {
                    'banner': '<%= banner.full %>' + "\n\n(function (window, $) {\n\t'use strict';\n\n",
                    'footer': '\n\twindow.ch = ch;\n}(this, ' + lib[env] + '));'
                },
                'src': files.JS.core,
                'dest': 'temp/' + env + '/core.tmp.js'
            },

            'js': {
                'src': ['temp/' + env + '/core.tmp.js'].concat(files.JS.abilities).concat(files.JS.widgets),
                'dest':'temp/' + env + '/chico.js'
            },

            'css': {
                'options': {
                    'banner': '<%= banner.full %>'
                },
                'src': files.CSS.resetML.concat(files.CSS.core).concat(files.CSS.widgets),
                'dest':'temp/' + env + '/chico.css'
            }
        },

        'uglify': {
            'options': {
                'mangle': false,
                'banner': '<%= banner.min %>' + "(function(window,$){'use strict';",
                'footer': 'window.ch = ch;}(this, ' + lib[env] + '));'
            },

            'min': {
                'src': ['<%= concat.js.dest %>'],
                'dest':'temp/' + env + '/chico.min.js'
            }
        },

        'cssmin': {
            'options': {
                'banner': '<%= banner.min %>',
                'keepSpecialComments': 0
            },

            'ui-css': {
                'src': ['<%= concat.css.dest %>'],
                'dest': 'temp/' + env + '/chico.min.css'
            }
        },

        'clean': ["temp/**/*.tmp.js"],

        'jslint': { // configure the task
            'files': files.JS.abilities.concat(files.JS.widgets),
            'directives': {
                'nomen': true,
                'todo': true
            },
            'options': {
                'errorsOnly': true, // only display errors
                'failOnError': false, // defaults to true
                'shebang': true, // ignore shebang lines
            }
        },

        'jsdoc': {
            'dist': {
                'src': [
                    "src/shared/js/ch.helpers.js",
                    "src/shared/js/ch.util.js",
                    "src/shared/js/ch.support.js",
                    "src/shared/js/ch.events.js",
                    "src/ui/js/ch.events.js",
                    "src/shared/js/ch.factory.js",
                    "src/ui/js/ch.init.js",

                    "src/shared/js/ch.EventEmitter.js",
                    "src/shared/js/ch.Content.js",
                    "src/shared/js/ch.Closable.js",
                    "src/shared/js/ch.Collapsible.js",
                    "src/shared/js/ch.Viewport.js",
                    "src/shared/js/ch.Positioner.js",
                    "src/ui/js/ch.shortcuts.js",

                    "src/shared/js/ch.Widget.js",
                    "src/shared/js/ch.Expandable.js"

                ],
                'options': {
                    'destination': './doc',
                    'private': false
                }
            }
        }
    });

    // Load plugins
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-cssmin');
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-jslint');
    grunt.loadNpmTasks('grunt-jsdoc');

    // Resgister task(s).
    grunt.registerTask('default', []);
    grunt.registerTask('lint', ['jslint']);
    grunt.registerTask('doc', ['jsdoc']);
    grunt.registerTask('dev', ['concat', 'clean']);
    grunt.registerTask('prod', ['concat', 'uglify', 'cssmin', 'clean']);
};<|endoftext|>


<commit_before>/**
 * @author zhixin wen <wenzhixin2010@gmail.com>
 * extensions: https://github.com/vitalets/x-editable
 */

!function ($) {

    'use strict';

    $.extend($.fn.bootstrapTable.defaults, {
        editable: true,
        onEditableInit: function () {
            return false;
        },
        onEditableSave: function (field, row, oldValue, $el) {
            return false;
        },
        onEditableShown: function (field, row, $el, editable) {
            return false;
        },
        onEditableHidden: function (field, row, $el, reason) {
            return false;
        }
    });

    $.extend($.fn.bootstrapTable.Constructor.EVENTS, {
        'editable-init.bs.table': 'onEditableInit',
        'editable-save.bs.table': 'onEditableSave',
        'editable-shown.bs.table': 'onEditableShown',
        'editable-hidden.bs.table': 'onEditableHidden'
    });

    var BootstrapTable = $.fn.bootstrapTable.Constructor,
        _initTable = BootstrapTable.prototype.initTable,
        _initBody = BootstrapTable.prototype.initBody;

    BootstrapTable.prototype.initTable = function () {
        var that = this;
        _initTable.apply(this, Array.prototype.slice.apply(arguments));

        if (!this.options.editable) {
            return;
        }

        $.each(this.columns, function (i, column) {
            if (!column.editable) {
                return;
            }

            var _formatter = column.formatter;
            column.formatter = function (value, row, index) {
                var result = _formatter ? _formatter(value, row, index) : value;

                return ['' + ''
                ].join('');
            };
        });
    };

    BootstrapTable.prototype.initBody = function () {
        var that = this;
        _initBody.apply(this, Array.prototype.slice.apply(arguments));

        if (!this.options.editable) {
            return;
        }

        $.each(this.columns, function (i, column) {
            if (!column.editable) {
                return;
            }

            that.$body.find('a[data-name="' + column.field + '"]').editable(column.editable)
                .off('save').on('save', function (e, params) {
                    var data = that.getData(),
                        index = $(this).parents('tr[data-index]').data('index'),
                        row = data[index],
                        oldValue = row[column.field];

                    $(this).data('value', params.submitValue);
                    row[column.field] = params.submitValue;
                    that.trigger('editable-save', column.field, row, oldValue, $(this));
                });
            that.$body.find('a[data-name="' + column.field + '"]').editable(column.editable)
                .off('shown').on('shown', function (e, editable) {
                    var data = that.getData(),
                        index = $(this).parents('tr[data-index]').data('index'),
                        row = data[index];

                    that.trigger('editable-shown', column.field, row, $(this), editable);
                });
            that.$body.find('a[data-name="' + column.field + '"]').editable(column.editable)
                .off('hidden').on('hidden', function (e, reason) {
                    var data = that.getData(),
                        index = $(this).parents('tr[data-index]').data('index'),
                        row = data[index];

                    that.trigger('editable-hidden', column.field, row, $(this), reason);
                });
        });
        this.trigger('editable-init');
    };

}(jQuery);
<commit_msg>Enabled data attributes for editable column.<commit_after>/**
 * @author zhixin wen <wenzhixin2010@gmail.com>
 * extensions: https://github.com/vitalets/x-editable
 */

!function ($) {

    'use strict';

    $.extend($.fn.bootstrapTable.defaults, {
        editable: true,
        onEditableInit: function () {
            return false;
        },
        onEditableSave: function (field, row, oldValue, $el) {
            return false;
        },
        onEditableShown: function (field, row, $el, editable) {
            return false;
        },
        onEditableHidden: function (field, row, $el, reason) {
            return false;
        }
    });

    $.extend($.fn.bootstrapTable.Constructor.EVENTS, {
        'editable-init.bs.table': 'onEditableInit',
        'editable-save.bs.table': 'onEditableSave',
        'editable-shown.bs.table': 'onEditableShown',
        'editable-hidden.bs.table': 'onEditableHidden'
    });

    var BootstrapTable = $.fn.bootstrapTable.Constructor,
        _initTable = BootstrapTable.prototype.initTable,
        _initBody = BootstrapTable.prototype.initBody;

    BootstrapTable.prototype.initTable = function () {
        var that = this;
        _initTable.apply(this, Array.prototype.slice.apply(arguments));

        if (!this.options.editable) {
            return;
        }

        $.each(this.columns, function (i, column) {
            if (!column.editable) {
                return;
            }

            var editableOptions = {}, editableDataMarkup = [], editableDataPrefix = 'editable-';

            var processDataOptions = function(key, value) {
              // Replace camel case with dashes.
              var dashKey = key.replace(/([A-Z])/g, function($1){return "-"+$1.toLowerCase();});
              if (dashKey.slice(0, editableDataPrefix.length) == editableDataPrefix) {
                var dataKey = dashKey.replace(editableDataPrefix, 'data-');
                editableOptions[dataKey] = value;
              }
            };

            $.each(that.options, processDataOptions);

            var _formatter = column.formatter;
            column.formatter = function (value, row, index) {
                var result = _formatter ? _formatter(value, row, index) : value;

                $.each(column, processDataOptions);

                $.each(editableOptions, function (key, value) {
                    editableDataMarkup.push(' ' + key + '="' + value + '"');
                });

                return ['' + ''
                ].join('');
            };
        });
    };

    BootstrapTable.prototype.initBody = function () {
        var that = this;
        _initBody.apply(this, Array.prototype.slice.apply(arguments));

        if (!this.options.editable) {
            return;
        }

        $.each(this.columns, function (i, column) {
            if (!column.editable) {
                return;
            }

            that.$body.find('a[data-name="' + column.field + '"]').editable(column.editable)
                .off('save').on('save', function (e, params) {
                    var data = that.getData(),
                        index = $(this).parents('tr[data-index]').data('index'),
                        row = data[index],
                        oldValue = row[column.field];

                    $(this).data('value', params.submitValue);
                    row[column.field] = params.submitValue;
                    that.trigger('editable-save', column.field, row, oldValue, $(this));
                });
            that.$body.find('a[data-name="' + column.field + '"]').editable(column.editable)
                .off('shown').on('shown', function (e, editable) {
                    var data = that.getData(),
                        index = $(this).parents('tr[data-index]').data('index'),
                        row = data[index];

                    that.trigger('editable-shown', column.field, row, $(this), editable);
                });
            that.$body.find('a[data-name="' + column.field + '"]').editable(column.editable)
                .off('hidden').on('hidden', function (e, reason) {
                    var data = that.getData(),
                        index = $(this).parents('tr[data-index]').data('index'),
                        row = data[index];

                    that.trigger('editable-hidden', column.field, row, $(this), reason);
                });
        });
        this.trigger('editable-init');
    };

}(jQuery);
<|endoftext|>


<commit_before>module.exports = function(grunt) {

	// I don't know if this is important
	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
	});

	// Loads the different modules used by this gruntfile
	// release
	grunt.loadNpmTasks('grunt-contrib-concat');
	grunt.loadNpmTasks('grunt-contrib-copy');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-sass');
	grunt.loadNpmTasks('grunt-ts');
	grunt.loadNpmTasks('grunt-angular-templates');

	// debug
	grunt.loadNpmTasks('grunt-concurrent');
	grunt.loadNpmTasks('grunt-contrib-connect');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-karma');
	grunt.loadNpmTasks('grunt-protractor-runner');
	grunt.loadNpmTasks('grunt-tslint');

	// load the configs of all tasks defined under /config
	var configs = require('load-grunt-configs')(grunt);
	grunt.initConfig(configs);

	// this task updates all distributions - launch it once before each release
	grunt.registerTask('dist', ["ts:dist", "ts:distspe", "ngtemplates:dist", 'concat:spe', 'uglify:spe', 'concat:standard', 'uglify:standard', 'sass:dist', "copy:tsdefinitions"]);

	// use this tasks when you are developping
	grunt.registerTask('debug', ["dist", "ts:test", "connect:server", 'concurrent:debug']);
	// // use this one when you're coding e2e tests
	grunt.registerTask('e2e', ["dist", "ts:e2e", "connect", "protractor:singlerun", 'concurrent:e2e']);
	// this updates the dists and tests it, creates karma coverage
	grunt.registerTask('test', ['dist', "ts:test", 'karma:debug', 'karma:coverage', "connect:server", 'protractor:singlerun', 'jshint']);

	// used for travis integration
	grunt.registerTask('travis-karma', ["ts:test", 'karma:travis']);
	// grunt.registerTask('travis-protractor', ["ts:e2e", "connect", "protractor:saucelab"]);
	grunt.registerTask('jenkins-karma', ["ts:test", "karma:coverage"]);
	grunt.registerTask('jenkins-protractor', ["ts:e2e", "connect", "protractor:singlerun"]);
};
<commit_msg>grunt [FIX] Grunt debug now transpiles demo's scss<commit_after>module.exports = function(grunt) {

	// I don't know if this is important
	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
	});

	// Loads the different modules used by this gruntfile
	// release
	grunt.loadNpmTasks('grunt-contrib-concat');
	grunt.loadNpmTasks('grunt-contrib-copy');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-sass');
	grunt.loadNpmTasks('grunt-ts');
	grunt.loadNpmTasks('grunt-angular-templates');

	// debug
	grunt.loadNpmTasks('grunt-concurrent');
	grunt.loadNpmTasks('grunt-contrib-connect');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-karma');
	grunt.loadNpmTasks('grunt-protractor-runner');
	grunt.loadNpmTasks('grunt-tslint');

	// load the configs of all tasks defined under /config
	var configs = require('load-grunt-configs')(grunt);
	grunt.initConfig(configs);

	// this task updates all distributions - launch it once before each release
	grunt.registerTask('dist', ["ts:dist", "ts:distspe", "ngtemplates:dist", 'concat:spe', 'uglify:spe', 'concat:standard', 'uglify:standard', 'sass:dist', "copy:tsdefinitions"]);

	// use this tasks when you are developping
	grunt.registerTask('debug', ["dist", "sass:demo", "ts:test", "connect:server", 'concurrent:debug']);
	// // use this one when you're coding e2e tests
	grunt.registerTask('e2e', ["dist", "ts:e2e", "connect", "protractor:singlerun", 'concurrent:e2e']);
	// this updates the dists and tests it, creates karma coverage
	grunt.registerTask('test', ['dist', "ts:test", 'karma:debug', 'karma:coverage', "connect:server", 'protractor:singlerun', 'jshint']);

	// used for travis integration
	grunt.registerTask('travis-karma', ["ts:test", 'karma:travis']);
	// grunt.registerTask('travis-protractor', ["ts:e2e", "connect", "protractor:saucelab"]);
	grunt.registerTask('jenkins-karma', ["ts:test", "karma:coverage"]);
	grunt.registerTask('jenkins-protractor', ["ts:e2e", "connect", "protractor:singlerun"]);
};
<|endoftext|>


<commit_before>import React, { PureComponent } from 'react'
import { FormattedMessage } from 'react-intl'
import PropTypes from 'prop-types'
import muiThemeable from 'material-ui/styles/muiThemeable'
import Chip from 'material-ui/Chip'
import Facebook from 'components/SocialLogin/icons/svg/facebook'
import GitHub from 'components/SocialLogin/icons/svg/github'
import YouTube from 'components/SocialLogin/icons/svg/youtube'
import { IMAGES_URL } from 'services/config'
import { DEFAULT_PROFILE_PICTURE } from 'utils'
import WebIcon from 'material-ui/svg-icons/social/public'
import Twitter from 'components/SocialLogin/icons/svg/twitter'
import Instagram from 'components/SocialLogin/icons/svg/instagram'
import StyledPaper from './StyledPaper'
import H3 from 'components/H3'
import P from 'components/P'
import Image from 'components/PictogramSnippet/Image'
import langMessages from 'components/LanguageSelector/messages'
import FormatCard from './FormatCard'
// import liWrapper from './liWrapper'
import messages from './messages'

class CollaboratorSnippet extends PureComponent {
  state = {
    zDepth: 1,
    isFlipped: false
  };

  styles = {
    icon: {
      width: 48,
      height: 48
    },
    cardTitle: {
      textAlign: 'center',
      fontSize: '1.1 rem',
      textTransform: 'uppercase',
      marginTop: 10,
      marginBottom: 0
    },
    icon: {
      width: 40,
      height: 40,
    },
    a: {
      margin: 10,
      marginTop: 0
    }
  };

  handleMouseEnter = () => {
    this.setState({
      zDepth: 3,
      isFlipped: true
    })
  };

  handleMouseLeave = () => {
    this.setState({
      zDepth: 1,
      isFlipped: false
    })
  };

  handleClick = () => this.setState({ isFlipped: !this.state.isFlipped })

  render() {
    const { collaborator } = this.props
    const collaboratorImage = collaborator.image ?
      `${IMAGES_URL}/collaborators/${collaborator.image}`
      : DEFAULT_PROFILE_PICTURE
    return (

    )
  }
}

CollaboratorSnippet.propTypes = {
  muiTheme: PropTypes.object,
  collaborator: PropTypes.object.isRequired,
}

export default muiThemeable()(CollaboratorSnippet)
<commit_msg>fix name position to top<commit_after>import React, { PureComponent } from 'react'
import { FormattedMessage } from 'react-intl'
import PropTypes from 'prop-types'
import muiThemeable from 'material-ui/styles/muiThemeable'
import Chip from 'material-ui/Chip'
import Facebook from 'components/SocialLogin/icons/svg/facebook'
import GitHub from 'components/SocialLogin/icons/svg/github'
import YouTube from 'components/SocialLogin/icons/svg/youtube'
import { IMAGES_URL } from 'services/config'
import { DEFAULT_PROFILE_PICTURE } from 'utils'
import WebIcon from 'material-ui/svg-icons/social/public'
import Twitter from 'components/SocialLogin/icons/svg/twitter'
import Instagram from 'components/SocialLogin/icons/svg/instagram'
import StyledPaper from './StyledPaper'
import H3 from 'components/H3'
import P from 'components/P'
import Image from 'components/PictogramSnippet/Image'
import langMessages from 'components/LanguageSelector/messages'
import FormatCard from './FormatCard'
// import liWrapper from './liWrapper'
import messages from './messages'

class CollaboratorSnippet extends PureComponent {
  state = {
    zDepth: 1,
    isFlipped: false
  };

  styles = {
    icon: {
      width: 48,
      height: 48
    },
    cardTitle: {
      textAlign: 'center',
      fontSize: '1.1 rem',
      textTransform: 'uppercase',
      marginTop: 10,
      marginBottom: 0
    },
    icon: {
      width: 40,
      height: 40,
    },
    a: {
      margin: 10,
      marginTop: 0
    }
  };

  handleMouseEnter = () => {
    this.setState({
      zDepth: 3,
      isFlipped: true
    })
  };

  handleMouseLeave = () => {
    this.setState({
      zDepth: 1,
      isFlipped: false
    })
  };

  handleClick = () => this.setState({ isFlipped: !this.state.isFlipped })

  render() {
    const { collaborator } = this.props
    const collaboratorImage = collaborator.image ?
      `${IMAGES_URL}/collaborators/${collaborator.image}`
      : DEFAULT_PROFILE_PICTURE
    return (

    )
  }
}

CollaboratorSnippet.propTypes = {
  muiTheme: PropTypes.object,
  collaborator: PropTypes.object.isRequired,
}

export default muiThemeable()(CollaboratorSnippet)
<|endoftext|>


<commit_before>#!/usr/bin/env node

/*!
 * MeltXpert®
 * Improved Nucleic Acid homo & hetero duplexes thermal behavior analysis program.
 * ________________________________________________________________________________
 *
 * Grunt, http://gruntjs.com/.
 * The JavaScript Task Runner.
 * ________________________________________________________________________________
 *
 * Architecture and Code Handcrafted by Prabhat Kumar.
 * Architectuur en Code handgemaakt door Prabhat Kumar.
 * @author    : Prabhat Kumar [http://prabhatkumar.org/].
 * @copyright : Prabhat Kumar [http://prabhatkumar.org/].
 * @copyright : Sequømics Research [http://research.sequomics.com/].
 * @copyright : Sequømics Corporation [http://sequomics.com/].
 * ________________________________________________________________________________
 *
 * @date      : 11-Nov-2016
 * @license   : Apache, version 2.0
 * @require   : Node.js®
 * @require   : NPM
 * @require   : grunt-cli
 * @build     : SEED™ — Umeå
 *              └────── A Sequømics Product — http://sequomics.com/.
 * ________________________________________________________________________________
 *
 * --/The Heart of Build System/-- of "MeltXpert®".
 * ________________________________________________________________________________
 */

// "disallowMultipleSpaces": {"allowEOLComments": true}
// "disallowSemicolons": false
// "requireSemicolons": true
// "requireSpaceAfterLineComment": { "allExcept": ["#", "="] }

// global __dirname: true
// global require: true

//# Usage: $ node -v
//# Usage: $ npm -v
//# Usage: $ grunt -version

// Invoking strict mode.
// @purpose: Strict mode applies to entire scripts or to individual functions.
"use strict";

// To load required Node module.
//=-----------------------------
var fs          = require('fs');
var os          = require('os');
var path        = require('path');

// To load required NPM modules.
//=-----------------------------
var chalk       = require('chalk');
// Check if our code is running on Travis.
var isTravis    = require('is-travis');

// Global variables.
//=~~~~~~~~~~~~~~~~~
var rootPath    = './';
var appsPath    = './app/';
var docsPath    = './docs/';
var libsPath    = './libs/';
// A destination directory.
var buildPath   = './build/';

// Default color defined.
//=----------------------
var noop        = chalk.red;
var yeep        = chalk.green;
var okay        = chalk.blue;
var boop        = chalk.gray;

var message     = "SEED™ — Supported under Mac OS X and Linux only!";
// To use inside grunt task.
var pkg         = require('./package.json');
var bkg         = require('./bower.json');
var version     = process.env.VERSION || require('./package.json').version;

// ----------------------------------------------------------------------------------------------------------
var banner      =
    '/*!\n' +
    ' * ———————————\n' +
    ' * MeltXpert®: v' + version + '\n' +
    ' * ———————————\n' +
    ' * Improved Nucleic Acid homo & hetero duplexes thermal behavior analysis program.\n' +
    ' * Copyright © 2006 - ' + new Date().getFullYear() + ', Prabhat Kumar, All rights reserved.\n' +
    ' * Copyright © 2014 - ' + new Date().getFullYear() + ', Sequømics Corporation, All rights reserved.\n' +
    ' * Released under the Apache License (http://www.apache.org/licenses/).\n' +
    ' */';
// ----------------------------------------------------------------------------------------------------------
// All Grunt Operations Defined... |--------------------------------------------| 11/Nov/2016 | SEED™ — Umeå.
// ----------------------------------------------------------------------------------------------------------

module.exports = function(grunt) {

    // Force use of Unix newlines.
    grunt.util.linefeed = '\n';

    // A regular expression.
    RegExp.quote = function(string) {
        return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&');
    };

    // Date objects.
    var today    = new Date();
    var timems   = Date.now();
<commit_msg>Initial commit<commit_after>#!/usr/bin/env node

/*!
 * MeltXpert®
 * Improved Nucleic Acid homo & hetero duplexes thermal behavior analysis program.
 * ________________________________________________________________________________
 *
 * Grunt, http://gruntjs.com/.
 * The JavaScript Task Runner.
 * ________________________________________________________________________________
 *
 * Architecture and Code Handcrafted by Prabhat Kumar.
 * Architectuur en Code handgemaakt door Prabhat Kumar.
 * @author    : Prabhat Kumar [http://prabhatkumar.org/].
 * @copyright : Prabhat Kumar [http://prabhatkumar.org/].
 * @copyright : Sequømics Research [http://research.sequomics.com/].
 * @copyright : Sequømics Corporation [http://sequomics.com/].
 * ________________________________________________________________________________
 *
 * @date      : 11-Nov-2016
 * @license   : Apache, version 2.0
 * @require   : Node.js®
 * @require   : NPM
 * @require   : grunt-cli
 * @build     : SEED™ — Umeå
 *              └────── A Sequømics Product — http://sequomics.com/.
 * ________________________________________________________________________________
 *
 * --/The Heart of Build System/-- of "MeltXpert®".
 * ________________________________________________________________________________
 */

// "disallowMultipleSpaces": {"allowEOLComments": true}
// "disallowSemicolons": false
// "requireSemicolons": true
// "requireSpaceAfterLineComment": { "allExcept": ["#", "="] }

// global __dirname: true
// global require: true

//# Usage: $ node -v
//# Usage: $ npm -v
//# Usage: $ grunt -version

// Invoking strict mode.
// @purpose: Strict mode applies to entire scripts or to individual functions.
"use strict";

// To load required Node module.
//=-----------------------------
var fs          = require('fs');
var os          = require('os');
var path        = require('path');

// To load required NPM modules.
//=-----------------------------
var chalk       = require('chalk');
// Check if our code is running on Travis.
var isTravis    = require('is-travis');

// Global variables.
//=~~~~~~~~~~~~~~~~~
var rootPath    = './';
var appsPath    = './app/';
var docsPath    = './docs/';
var libsPath    = './libs/';
// A destination directory.
var buildPath   = './build/';

// Default color defined.
//=----------------------
var noop        = chalk.red;
var yeep        = chalk.green;
var okay        = chalk.blue;
var boop        = chalk.gray;

var message     = "SEED™ — Supported under Mac OS X and Linux only!";
// To use inside grunt task.
var pkg         = require('./package.json');
var bkg         = require('./bower.json');
var version     = process.env.VERSION || require('./package.json').version;

// ----------------------------------------------------------------------------------------------------------
var banner      =
    '/*!\n' +
    ' * ———————————\n' +
    ' * MeltXpert®: v' + version + '\n' +
    ' * ———————————\n' +
    ' * Improved Nucleic Acid homo & hetero duplexes thermal behavior analysis program.\n' +
    ' * Copyright © 2006 - ' + new Date().getFullYear() + ', Prabhat Kumar, All rights reserved.\n' +
    ' * Copyright © 2014 - ' + new Date().getFullYear() + ', Sequømics Corporation, All rights reserved.\n' +
    ' * Released under the Apache License (http://www.apache.org/licenses/).\n' +
    ' */';
// ----------------------------------------------------------------------------------------------------------
// All Grunt Operations Defined... |--------------------------------------------| 11/Nov/2016 | SEED™ — Umeå.
// ----------------------------------------------------------------------------------------------------------

module.exports = function(grunt) {

    // Force use of Unix newlines.
    grunt.util.linefeed = '\n';

    // A regular expression.
    RegExp.quote = function(string) {
        return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&');
    };

    // Date objects.
    var today    = new Date();
    var timems   = Date.now();

    // Advanced Grunt API.
    /// -->> A mode defaults to `0777`.
    var mode     = '0777';
<|endoftext|>


<commit_before>import ReactDOM from 'react-dom';
import React from 'react';
import { Router, Route, browserHistory } from 'react-router';
import NoMatch from './components/NoMatch';
import About from './components/About';
import App from './components/App';
import Post from './containers/Post';
import Posts from './containers/Posts';
import Home from './containers/Home';
import postReducer from './reducers/posts';
import { createStore, combineReducers } from 'redux';
import { Provider } from 'react-redux';
import { syncHistoryWithStore, routerReducer } from 'react-router-redux';

import './styles/main.scss';

const rootReducer = combineReducers({ postReducer, routing: routerReducer });

const store = createStore(rootReducer,
  window.devToolsExtension ? window.devToolsExtension() : undefined
);

const history = syncHistoryWithStore(browserHistory, store);

const container = document.getElementById('root');

export function __unload() {
  ReactDOM.unmountComponentAtNode(container);
}

const renderAll = () => {
  ReactDOM.render(
    (
      <Provider store={store}>
        <Router history={history}>
          <Route path="/" component={App}>
            <Route path="about" component={About} />
            <Route path="posts" component={Posts} />
            <Route path="home" component={Home} />
            <Route path="/post/:nr" component={Post} />
            <Route path="*" component={NoMatch} />
          </Route>
        </Router>
      </Provider>
    ), container
  );
};

store.subscribe(renderAll);
renderAll();

<commit_msg>[fix] - react router issue with hot reload<commit_after>import ReactDOM from 'react-dom';
import React from 'react';
import { Router, browserHistory } from 'react-router';
import NoMatch from './components/NoMatch';
import About from './components/About';
import App from './components/App';
import Post from './containers/Post';
import Posts from './containers/Posts';
import Home from './containers/Home';
import postReducer from './reducers/posts';
import { createStore, combineReducers } from 'redux';
import { Provider } from 'react-redux';
import { syncHistoryWithStore, routerReducer } from 'react-router-redux';

import './styles/main.scss';

const rootReducer = combineReducers({ postReducer, routing: routerReducer });

const store = createStore(rootReducer,
  window.devToolsExtension ? window.devToolsExtension() : undefined
);

const history = syncHistoryWithStore(browserHistory, store);

const container = document.getElementById('root');

export function __unload() {
  ReactDOM.unmountComponentAtNode(container);
}

const routes = {
    path: '/',
    component: App,
    childRoutes: [
        { path: '/about', component: About },
        {
            path: '/posts',
            component: Posts,
            childRoutes: [ { path: '/post/:nr', component: Post } ]
        },
        { path: '/home', component: Home },
        { path: '*', component: NoMatch}
    ]
};

const renderAll = () => {
  ReactDOM.render(
    (
      <Provider store={store}>
        <Router history={history} routes={routes} />
      </Provider>
    ), container
  );
};

store.subscribe(renderAll);
renderAll();

<|endoftext|>


<commit_before>'use strict'
const slapp = require('../slackSetup.js').slapp
const getRadius = require('../radius.js').getRadius
const tinyurl = require('tinyurl');
const request = require('request')
const where = require('node-where')

// route functions
const snapsByGeo = require('./routes/snapsByGeoRoute.js').snapsByGeo
const routeFuncs = require('./routes/routesIndex.js')
const yes = require('./routes/yes.js').yes
const addressToGeo = require('./routes/addressToGeo.js').addressToGeo
const appDl = require('./routes/appDlRoute.js').appDl
const teamSettings = require('../teamSettings.js').teamSettings

const notify = require('./notifySlash.js').notify

//db imports
const firebase    = require('../firebaseSetup.js'),
      db = firebase.db,
      snaps = firebase.snaps,
      tags = firebase.tags,
      users = firebase.users,
      slackDb = firebase.slackDb

let jayBtns={
  text: "",
  attachments: [{
    text: 'How can I help?',
    fallback: 'Where to today?',
    callback_id: 'jaywalk_callback',
    color: 'good',
    actions: [
      {
        name: 'answer',
        text: 'Find deals',
        type: 'button',
        value: 'address'
      },{
        name: 'answer',
        text: 'Settings',
        type: 'button',
        value: 'settings'
      },{
        name: 'answer',
        text: 'Download app',
        type: 'button',
        value: 'app'
      }
    ]
  }]
}

const jaywalk = function() {
  let state = { requested: Date.now() }
  let teamId = ''
  let teamInfo = {}
  let answer

  slapp.command('/jaywalk', (msg, text) => {
    teamInfo = slackDb
      .child(msg.body.team_id)
      .once("value")
      .then(function(obj){
        if(obj.val().lat){
          teamInfo = obj.val()
            msg
              .say(jayBtns)
              .route('requestToDatabase', state, 60)
        } else{
          msg
          .say({text:`Welcome to Jaywalk! To get better results, please enter the address or your buisness name and city.`})
          .route('new_address', state, 60)
        }
      })

  })

// slapp.action('jaywalk_callback', 'answer', (msg, value) => {

  .route('requestToDatabase', (msg, state) => {
    if(msg.body.actions==undefined){      // try callback then remove this
      msg.route('requestToDatabase', state, 60)
    }else{
      answer = msg.body.actions[0].value
      if(answer == 'app'){
        appDl(teamInfo,msg,state)
      }else if(answer == 'address'){
        yes(teamInfo,msg,state)
        //https://jaywalk-geo.herokuapp.com/geoloc.htm
        // .route('handleGeoLoc', state, 60)
      }else if(answer == 'settings'){
        teamSettings(teamInfo,msg,state)
      }else if(answer == 'notifications'){
        notify(teamInfo,msg,state)
      }else{ //handle error
        return msg
          .say("Whoops, you just have to pick a button...")
          .say('Click a button!')
          .route('requestToDatabase', state, 60)
      }
    } //end else(actions undefined checker)
  }) //end .route('requestToDatabase')
  // }) //end callback
  .route('relaventAsk', (msg,state) => {
    routeFuncs.relaventAsk(msg,state)
  })//end .route(relaventAsk)
  .route('address_geo', (msg,state) => {
    let text = (msg.body.event && msg.body.event.text) || ''
    where.is(text,function(err,result){
      /*
        result.get('')=>
        address,streetNumber, street,streetAddress,city,region,
        regionCode, postalCode, country, countryCode, lat, lng
      */
      if (result) {
        let lat = result.get('lat')
        let lng = result.get('lng')
        snapsByGeo(lat,lng,msg,state)
      }
    })
  })
  .route('new_address', (msg,state) => {
    let text = (msg.body.event && msg.body.event.text) || ''
    console.log(text)
  })
}
module.exports = {
  jaywalk:jaywalk(),
  jayBtns:jayBtns
}

<commit_msg>new team setup<commit_after>'use strict'
const slapp = require('../slackSetup.js').slapp
const getRadius = require('../radius.js').getRadius
const tinyurl = require('tinyurl');
const request = require('request')
const where = require('node-where')

// route functions
const snapsByGeo = require('./routes/snapsByGeoRoute.js').snapsByGeo
const routeFuncs = require('./routes/routesIndex.js')
const yes = require('./routes/yes.js').yes
const addressToGeo = require('./routes/addressToGeo.js').addressToGeo
const appDl = require('./routes/appDlRoute.js').appDl
const teamSettings = require('../teamSettings.js').teamSettings

const notify = require('./notifySlash.js').notify

//db imports
const firebase    = require('../firebaseSetup.js'),
      db = firebase.db,
      snaps = firebase.snaps,
      tags = firebase.tags,
      users = firebase.users,
      slackDb = firebase.slackDb

let jayBtns={
  text: "",
  attachments: [{
    text: 'How can I help?',
    fallback: 'Where to today?',
    callback_id: 'jaywalk_callback',
    color: 'good',
    actions: [
      {
        name: 'answer',
        text: 'Find deals',
        type: 'button',
        value: 'address'
      },{
        name: 'answer',
        text: 'Settings',
        type: 'button',
        value: 'settings'
      },{
        name: 'answer',
        text: 'Download app',
        type: 'button',
        value: 'app'
      }
    ]
  }]
}

const jaywalk = function() {
  let state = { requested: Date.now() }
  let teamId = ''
  let teamInfo = {}
  let answer

  slapp.command('/jaywalk', (msg, text) => {
    teamInfo = slackDb
      .child(msg.body.team_id)
      .once("value")
      .then(function(obj){
        if(!obj.val()){
          msg
            .say({text:`Welcome to Jaywalk! To get better results, please enter the address or your buisness name and city.`})
            .route('new_address', state, 60)
        } else{
          teamInfo = obj.val()
            msg
              .say(jayBtns)
              .route('requestToDatabase', state, 60)
        }
      })

  })

// slapp.action('jaywalk_callback', 'answer', (msg, value) => {

  .route('requestToDatabase', (msg, state) => {
    if(msg.body.actions==undefined){      // try callback then remove this
      msg.route('requestToDatabase', state, 60)
    }else{
      answer = msg.body.actions[0].value
      if(answer == 'app'){
        appDl(teamInfo,msg,state)
      }else if(answer == 'address'){
        yes(teamInfo,msg,state)
        //https://jaywalk-geo.herokuapp.com/geoloc.htm
        // .route('handleGeoLoc', state, 60)
      }else if(answer == 'settings'){
        teamSettings(teamInfo,msg,state)
      }else if(answer == 'notifications'){
        notify(teamInfo,msg,state)
      }else{ //handle error
        return msg
          .say("Whoops, you just have to pick a button...")
          .say('Click a button!')
          .route('requestToDatabase', state, 60)
      }
    } //end else(actions undefined checker)
  }) //end .route('requestToDatabase')
  // }) //end callback
  .route('relaventAsk', (msg,state) => {
    routeFuncs.relaventAsk(msg,state)
  })//end .route(relaventAsk)
  .route('address_geo', (msg,state) => {
    let text = (msg.body.event && msg.body.event.text) || ''
    where.is(text,function(err,result){
      /*
        result.get('')=>
        address,streetNumber, street,streetAddress,city,region,
        regionCode, postalCode, country, countryCode, lat, lng
      */
      if (result) {
        let lat = result.get('lat')
        let lng = result.get('lng')
        snapsByGeo(lat,lng,msg,state)
      }
    })
  })
  .route('new_address', (msg,state) => {
    let text = (msg.body.event && msg.body.event.text) || ''
    console.log(text)
  })
}
module.exports = {
  jaywalk:jaywalk(),
  jayBtns:jayBtns
}

<|endoftext|>


<commit_before>/**
 * Created by Aaron on 7/9/2015.
 */

module.exports = function( grunt ) {

    grunt.loadNpmTasks( 'grunt-babel' );
    grunt.loadNpmTasks( 'grunt-contrib-clean' );
    grunt.loadNpmTasks( 'grunt-banner' );

    var LICENSE = '/****\n * ' +
                  grunt.file.read( './LICENSE', {encoding: 'utf-8'} ).replace( /\n/ig, '\n * ' ) +
                  '\n ****/';

    grunt.initConfig( {
        babel:     {
            options: {
                ast:          false,
                sourceMaps:   false,
                nonStandard:  false,
                compact:      "false",
                modules:      "common",
                experimental: true
            },
            build:   {
                options: {
                    loose:     "all",
                    blacklist: [
                        'es3.memberExpressionLiterals',
                        'es3.propertyLiterals',
                        'regenerator' //es6.generators
                    ],
                    optional:  [
                        'spec.undefinedToVoid',
                        'minification.constantFolding',
                        'minification.propertyLiterals',
                        'bluebirdCoroutines'
                    ]
                },
                files:   [{
                    expand: true,
                    cwd:    './src/',
                    src:    './**/*.js',
                    dest:   './build/'
                }]
            },
            tests:   {
                loose:   "all",
                options: {
                    blacklist: [
                        'es3.memberExpressionLiterals',
                        'es3.propertyLiterals',
                        'regenerator', //es6.generators
                        'es6.properties.shorthand'
                    ],
                    optional:  [
                        'runtime',
                        'spec.undefinedToVoid',
                        'minification.constantFolding',
                        'minification.propertyLiterals'
                    ]
                },
                files:   [{
                    expand: true,
                    cwd:    './test/src/',
                    src:    './**/*.js',
                    dest:   './test/build/'
                }]
            }
        },
        usebanner: {
            license: {
                options: {
                    position:  'top',
                    banner:    LICENSE,
                    linebreak: true
                },
                files:   {
                    src: ['./build/**/*.js']
                }
            }
        },
        clean:     {
            build: {
                src: ['./build']
            },
            tests: {
                src: ['./test/build']
            }
        }
    } );

    grunt.registerTask( 'build', ['clean:build', 'babel:build', 'usebanner:license'] );

    grunt.registerTask( 'build-tests', ['clean:tests', 'babel:tests'] );

    grunt.registerTask( 'default', ['build', 'build-tests'] );
};
<commit_msg>Gruntfile: Add bluebird coroutine transform for tests.<commit_after>/**
 * Created by Aaron on 7/9/2015.
 */

module.exports = function( grunt ) {

    grunt.loadNpmTasks( 'grunt-babel' );
    grunt.loadNpmTasks( 'grunt-contrib-clean' );
    grunt.loadNpmTasks( 'grunt-banner' );

    var LICENSE = '/****\n * ' +
                  grunt.file.read( './LICENSE', {encoding: 'utf-8'} ).replace( /\n/ig, '\n * ' ) +
                  '\n ****/';

    grunt.initConfig( {
        babel:     {
            options: {
                ast:          false,
                sourceMaps:   false,
                nonStandard:  false,
                compact:      "false",
                modules:      "common",
                experimental: true
            },
            build:   {
                options: {
                    loose:     "all",
                    blacklist: [
                        'es3.memberExpressionLiterals',
                        'es3.propertyLiterals',
                        'regenerator' //es6.generators
                    ],
                    optional:  [
                        'spec.undefinedToVoid',
                        'minification.constantFolding',
                        'minification.propertyLiterals'
                    ]
                },
                files:   [{
                    expand: true,
                    cwd:    './src/',
                    src:    './**/*.js',
                    dest:   './build/'
                }]
            },
            tests:   {
                loose:   "all",
                options: {
                    blacklist: [
                        'es3.memberExpressionLiterals',
                        'es3.propertyLiterals',
                        'regenerator', //es6.generators
                        'es6.properties.shorthand'
                    ],
                    optional:  [
                        'runtime',
                        'spec.undefinedToVoid',
                        'minification.constantFolding',
                        'minification.propertyLiterals',
                        'bluebirdCoroutines'
                    ]
                },
                files:   [{
                    expand: true,
                    cwd:    './test/src/',
                    src:    './**/*.js',
                    dest:   './test/build/'
                }]
            }
        },
        usebanner: {
            license: {
                options: {
                    position:  'top',
                    banner:    LICENSE,
                    linebreak: true
                },
                files:   {
                    src: ['./build/**/*.js']
                }
            }
        },
        clean:     {
            build: {
                src: ['./build']
            },
            tests: {
                src: ['./test/build']
            }
        }
    } );

    grunt.registerTask( 'build', ['clean:build', 'babel:build', 'usebanner:license'] );

    grunt.registerTask( 'build-tests', ['clean:tests', 'babel:tests'] );

    grunt.registerTask( 'default', ['build', 'build-tests'] );
};
<|endoftext|>


<commit_before>'use strict';

var mongoose = require('mongoose'),
  GitDev = mongoose.model('GitDev'),
  request = require('request'),
  async = require('async'),
  gitapi = require('../config/git_api');

exports.ajax_test = function(req, res) {

  var json_response = {'status': 'success', 'msg': 'A json object just for you!'};

  res.json(json_response);

};

exports.git_developer_lookup = function(req, res) {

  var gitdev = new GitDev(req.body),
    developer = gitdev.username;

  console.log(developer);

  console.log(gitapi.git_base_url);

  // Should probably upsert here instead...
  gitdev.save(function(err) {
    if (err) {
      return res.status(500).json({
        error: 'Cannot create Git Developer'
      });
    }
    res.json(gitdev);
  });
};<commit_msg>add git request basics<commit_after>'use strict';

var mongoose = require('mongoose'),
  GitDev = mongoose.model('GitDev'),
  request = require('request'),
  /*async = require('async'),*/
  gitapi = require('../config/git_api');

exports.ajax_test = function(req, res) {

  var json_response = {'status': 'success', 'msg': 'A json object just for you!'};

  res.json(json_response);

};

exports.git_developer_lookup = function(req, res) {

  var gitdev = new GitDev(req.body),
    developer = gitdev.username;

  console.log(developer);

  console.log(gitapi.git_base_url);

  var query_string = {
    client_id: gitapi.client_id,
    client_secret: gitapi.client_secret
  };

  request({url:gitapi.git_base_url + '/users/' + developer, qs:query_string, headers:{'User-Agent':gitapi.user_agent}}, function(err, response, body) {
    if (err) {
      console.log(err);
    } else {
      console.log(response.headers);
      console.log(body);
    }

    res.json({status: 'Good'});

  });

  /*
  // Should probably upsert here instead...
  gitdev.save(function(err) {
    if (err) {
      return res.status(500).json({
        error: 'Cannot create Git Developer'
      });
    }
    res.json(gitdev);
  }); */
};<|endoftext|>