<commit_before>import React from 'react';

export default ( props ) => (

Tables

        // TODO

);
<commit_msg>Tables<commit_after>import React from 'react';

import Example from './Example';
import DataTable from '../../src/DataTable';

export default ( props ) => (

Data Tables

Demo

        <Example>
        <DataTable
            selectable
            style={{margin: 'auto'}}
            columns={[
                {name: 'material', label: 'Material'},
                {name: 'quantity', label: 'Quantity', numeric: true},
                {name: 'price', label: 'Unit Price', numeric: true}
            ]}
            data={[
                {material: 'Acrylic (Transparent)', quantity: 25, price: '$2.90'},
                {material: 'Plywood (Birch)', quantity: 50, price: '$1.25'},
                {material: 'Laminate (Gold on Blue)', quantity: 10, price: '$2.35'}
            ]}
        />
        </Example>

Configuration

        <DataTable
            style={{margin: 'auto'}}
            columns={[
                { name: 'prop',  label: 'Prop' },
                { name: 'type',  label: 'Type' },
                { name: 'effect',  label: 'Effect' },
                { name: 'remarks',  label: 'Remarks' }
            ]}
            data={[
                { prop: 'columns', type: 'Array of {label, name, numeric}', effect: 'Set the columns', remarks: 'Required' },
                { prop: 'data', type: 'Array of object', effect: 'Set the rows data', remarks: 'Required. The properties of each object should be the "name" of each column' },
                { prop: 'selected', type: 'Boolean', effect: 'Adds a checkbox in front of each row', remarks: 'Optional' }
            ]}
        />

);
<|endoftext|>


<commit_before>/* global partywallStyler */
var styler = partywallStyler();

// layout

styler.addStyle([
  ['.slack-message','#source-area'],
  ['.slack-message','#source-details']],
    'flex: none; display: flex; flex-flow: column;');
styler.addStyle([
  ['.slack-message','#description-line']],
    'flex: none; display: flex; flex-flow: row; '+
    'justify-content: space-between;');
styler.addStyle([
  ['.dingroll-message','select'],
  ['.dingroll-message','button']],
    'flex: none;');
styler.addStyle([['.dingroll-message','#message-tags']],
    'flex: 1;');
styler.addStyle([
  ['.slack-message','#description-line']],
    'margin: 4px 8px 0;');

// style

styler.addStyle([
  ['.slack-message','#username'],
  ['.slack-message','#timestamp']],
    'color: white;');
<commit_msg>Make "show opacity" half-transparent<commit_after>/* global partywallStyler */
var styler = partywallStyler();

// layout

styler.addStyle([
  ['.slack-message','#source-area'],
  ['.slack-message','#source-details']],
    'flex: none; display: flex; flex-flow: column;');
styler.addStyle([
  ['.slack-message','#description-line']],
    'flex: none; display: flex; flex-flow: row; '+
    'justify-content: space-between;');
styler.addStyle([
  ['.dingroll-message','select'],
  ['.dingroll-message','button']],
    'flex: none;');
styler.addStyle([['.dingroll-message','#message-tags']],
    'flex: 1;');
styler.addStyle([
  ['.slack-message','#description-line']],
    'margin: 4px 8px 0;');

// style

styler.addStyle([
  ['.slack-message','#show-source']],
    'opacity: 0.5;');

styler.addStyle([
  ['.slack-message','#username'],
  ['.slack-message','#timestamp']],
    'color: white;');
<|endoftext|>


<commit_before>/*
Case Conductor is a Test Case Management system.
Copyright (C) 2011-2012 Mozilla

This file is part of Case Conductor.

Case Conductor is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Case Conductor is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Case Conductor.  If not, see <http://www.gnu.org/licenses/>.
*/
/*jslint    browser:    true,
            indent:     4 */
/*global    ich, jQuery */

var CC = (function (CC, $) {

    'use strict';

    $(function () {
        // plugins
        $('.details:not(html)').html5accordion();
        $('#messages').messages({
            handleAjax: true,
            closeLink: '.message'
        });
        $('input[placeholder], textarea[placeholder]').placeholder();
        $('#suite-form .caseselect').multiselect();
        $('#filter').customAutocomplete({
            textbox: '#text-filter',
            inputList: '.visual .filter-group:not(.keyword)',
            newInputList: '.visual .filter-group.keyword',
            multipleCategories: true,
            allowNew: true,
            autoSubmit: true,
            newInputTextbox: 'input[type="text"]',
            fakePlaceholder: true,
            initialFocus: true,
            inputsNeverRemoved: true,
            prefix: 'filter'
        });
        $('.tagging').customAutocomplete({
            textbox: '#id_add_tags',
            ajax: true,
            url: $('#id_add_tags').data('autocomplete-url'),
            extraDataName: 'product-id',
            extraDataFn: function () {
                var product = $('#id_product'),
                    selectedIndex = product.prop('selectedIndex'),
                    productID;
                if (selectedIndex && selectedIndex !== 0) {
                    productID = product.find('option:selected').data('product-id');
                }
                return productID;
            },
            inputList: '.taglist',
            triggerSubmit: null,
            allowNew: true,
            restrictAllowNew: true,
            inputType: 'tag',
            noInputsNote: true,
            prefix: 'tag'
        });
        $('#editprofile .add-item').customAutocomplete({
            textbox: '#env-elements-input',
            inputList: '.env-element-list',
            ajax: true,
            url: $('#env-elements-input').data('autocomplete-url'),
            hideFormActions: true,
            expiredList: '.env-element-list',
            inputType: 'element',
            caseSensitive: true,
            prefix: 'element'
        });
        $('#suite-form .caseselect .multiunselected .selectsearch').customAutocomplete({
            textbox: '#search-add',
            inputList: '.groups .filter-group:not(.keyword)',
            newInputList: '.groups .filter-group.keyword',
            multipleCategories: true,
            allowNew: true,
            triggerSubmit: null,
            inputsNeverRemoved: true,
            prefix: 'filter'
        });
        $('.runsdrill').html5finder({
            loading: true,
            headerSelector: '.listordering',
            sectionSelector: '.col',
            sectionContentSelector: '.colcontent',
            callback: function () {
                $('.runsdrill .drillenv').slideUp('fast');
            },
            lastChildCallback: function (choice) {
                var environments = $('.runsdrill .drillenv').css('min-height', '169px').slideDown('fast'),
                    ajaxUrl = $(choice).data('sub-url');
                environments.loadingOverlay();
                $.get(ajaxUrl, function (data) {
                    environments.loadingOverlay('remove');
                    environments.replaceWith(data.html);
                    CC.filterEnvironments('#runtests-environment-form');
                });
            }
        });
        $('.managedrill').html5finder({
            loading: true,
            horizontalScroll: true,
            scrollContainer: '.finder',
            headerSelector: '.listordering',
            sectionSelector: '.col',
            sectionContentSelector: '.colcontent',
            numberCols: 4
        });
        $('.resultsdrill').html5finder({
            loading: true,
            horizontalScroll: true,
            scrollContainer: '.finder',
            headerSelector: '.listordering',
            sectionSelector: '.col',
            sectionContentSelector: '.colcontent',
            sectionClasses: [
                'products',
                'cycles',
                'runs',
                'cases'
            ],
            sectionItemSelectors: [
                'input[name="product"]',
                'input[name="testcycle"]',
                'input[name="testrun"]',
                'input[name="testrunincludedtestcase"]'
            ]
        });

        // local.js
        CC.inputHadFocus();

        // manage-results.js
        CC.toggleAdvancedFiltering('#filter');
        CC.loadListItemDetails();
        CC.manageActionsAjax();
        CC.directFilterLinks();
        CC.filterFormAjax('.listpage');

        // manage-products.js
        CC.formOptionsFilter({
            container: '#addsuite',
            trigger_sel: '#id_product',
            target_sel: '.multiunselected .select',
            option_sel: '.selectitem',
            multiselect_widget_bool: true
        });
        CC.formOptionsFilter({
            container: '#addrun',
            trigger_sel: '#id_test_cycle',
            target_sel: '#id_suites'
        });
        CC.formOptionsFilter({
            container: '#single-case-add',
            trigger_sel: '#id_product',
            target_sel: '#id_productversion'
        });
        CC.formOptionsFilter({
            container: '#single-case-add',
            trigger_sel: '#id_product',
            target_sel: '#id_initial_suite',
            optional: true
        });
        CC.formOptionsFilter({
            container: '#bulk-case-add',
            trigger_sel: '#id_product',
            target_sel: '#id_productversion'
        });
        CC.formOptionsFilter({
            container: '#bulk-case-add',
            trigger_sel: '#id_product',
            target_sel: '#id_initial_suite',
            optional: true
        });
        CC.filterProductTags('#single-case-add, #bulk-case-add');
        CC.testcaseAttachments('.attach');
        CC.testcaseVersioning('#addcase');
        CC.envNarrowing('#envnarrowlist');

        // manage-env.js
        CC.createEnvProfile();
        CC.editEnvProfile();

        // manage-tags.js
        CC.manageTags('#managetags');

        // runtests.js
        CC.hideEmptyRuntestsEnv();
        CC.autoFocus('.details.stepfail > .summary', '#run');
        CC.autoFocus('.details.testinvalid > .summary', '#run');
        CC.runTests('#run');
        CC.breadcrumb('.runsdrill');
        CC.failedTestBug('#run');
        CC.filterEnvironments('#runtests-environment-form');
    });

    $(window).load(function () {
        // manage-results.js
        CC.openListItemDetails();
    });

    return CC;

}(CC || {}, jQuery));
<commit_msg>js product-specific tags for case-edit<commit_after>/*
Case Conductor is a Test Case Management system.
Copyright (C) 2011-2012 Mozilla

This file is part of Case Conductor.

Case Conductor is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Case Conductor is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Case Conductor.  If not, see <http://www.gnu.org/licenses/>.
*/
/*jslint    browser:    true,
            indent:     4 */
/*global    ich, jQuery */

var CC = (function (CC, $) {

    'use strict';

    $(function () {
        // plugins
        $('.details:not(html)').html5accordion();
        $('#messages').messages({
            handleAjax: true,
            closeLink: '.message'
        });
        $('input[placeholder], textarea[placeholder]').placeholder();
        $('#suite-form .caseselect').multiselect();
        $('#filter').customAutocomplete({
            textbox: '#text-filter',
            inputList: '.visual .filter-group:not(.keyword)',
            newInputList: '.visual .filter-group.keyword',
            multipleCategories: true,
            allowNew: true,
            autoSubmit: true,
            newInputTextbox: 'input[type="text"]',
            fakePlaceholder: true,
            initialFocus: true,
            inputsNeverRemoved: true,
            prefix: 'filter'
        });
        $('.tagging').customAutocomplete({
            textbox: '#id_add_tags',
            ajax: true,
            url: $('#id_add_tags').data('autocomplete-url'),
            extraDataName: 'product-id',
            extraDataFn: function () {
                var product_sel = $('#id_product'),
                    selectedIndex = product_sel.prop('selectedIndex'),
                    tagging_container = $('.case-form .tagging'),
                    productID;
                if (tagging_container.data('product-id')) {
                    productID = tagging_container.data('product-id');
                } else if (selectedIndex && selectedIndex !== 0) {
                    productID = product.find('option:selected').data('product-id');
                }
                return productID;
            },
            inputList: '.taglist',
            triggerSubmit: null,
            allowNew: true,
            restrictAllowNew: true,
            inputType: 'tag',
            noInputsNote: true,
            prefix: 'tag'
        });
        $('#editprofile .add-item').customAutocomplete({
            textbox: '#env-elements-input',
            inputList: '.env-element-list',
            ajax: true,
            url: $('#env-elements-input').data('autocomplete-url'),
            hideFormActions: true,
            expiredList: '.env-element-list',
            inputType: 'element',
            caseSensitive: true,
            prefix: 'element'
        });
        $('#suite-form .caseselect .multiunselected .selectsearch').customAutocomplete({
            textbox: '#search-add',
            inputList: '.groups .filter-group:not(.keyword)',
            newInputList: '.groups .filter-group.keyword',
            multipleCategories: true,
            allowNew: true,
            triggerSubmit: null,
            inputsNeverRemoved: true,
            prefix: 'filter'
        });
        $('.runsdrill').html5finder({
            loading: true,
            headerSelector: '.listordering',
            sectionSelector: '.col',
            sectionContentSelector: '.colcontent',
            callback: function () {
                $('.runsdrill .drillenv').slideUp('fast');
            },
            lastChildCallback: function (choice) {
                var environments = $('.runsdrill .drillenv').css('min-height', '169px').slideDown('fast'),
                    ajaxUrl = $(choice).data('sub-url');
                environments.loadingOverlay();
                $.get(ajaxUrl, function (data) {
                    environments.loadingOverlay('remove');
                    environments.replaceWith(data.html);
                    CC.filterEnvironments('#runtests-environment-form');
                });
            }
        });
        $('.managedrill').html5finder({
            loading: true,
            horizontalScroll: true,
            scrollContainer: '.finder',
            headerSelector: '.listordering',
            sectionSelector: '.col',
            sectionContentSelector: '.colcontent',
            numberCols: 4
        });
        $('.resultsdrill').html5finder({
            loading: true,
            horizontalScroll: true,
            scrollContainer: '.finder',
            headerSelector: '.listordering',
            sectionSelector: '.col',
            sectionContentSelector: '.colcontent',
            sectionClasses: [
                'products',
                'cycles',
                'runs',
                'cases'
            ],
            sectionItemSelectors: [
                'input[name="product"]',
                'input[name="testcycle"]',
                'input[name="testrun"]',
                'input[name="testrunincludedtestcase"]'
            ]
        });

        // local.js
        CC.inputHadFocus();

        // manage-results.js
        CC.toggleAdvancedFiltering('#filter');
        CC.loadListItemDetails();
        CC.manageActionsAjax();
        CC.directFilterLinks();
        CC.filterFormAjax('.listpage');

        // manage-products.js
        CC.formOptionsFilter({
            container: '#addsuite',
            trigger_sel: '#id_product',
            target_sel: '.multiunselected .select',
            option_sel: '.selectitem',
            multiselect_widget_bool: true
        });
        CC.formOptionsFilter({
            container: '#addrun',
            trigger_sel: '#id_test_cycle',
            target_sel: '#id_suites'
        });
        CC.formOptionsFilter({
            container: '#single-case-add',
            trigger_sel: '#id_product',
            target_sel: '#id_productversion'
        });
        CC.formOptionsFilter({
            container: '#single-case-add',
            trigger_sel: '#id_product',
            target_sel: '#id_initial_suite',
            optional: true
        });
        CC.formOptionsFilter({
            container: '#bulk-case-add',
            trigger_sel: '#id_product',
            target_sel: '#id_productversion'
        });
        CC.formOptionsFilter({
            container: '#bulk-case-add',
            trigger_sel: '#id_product',
            target_sel: '#id_initial_suite',
            optional: true
        });
        CC.filterProductTags('#single-case-add, #bulk-case-add');
        CC.testcaseAttachments('.attach');
        CC.testcaseVersioning('#addcase');
        CC.envNarrowing('#envnarrowlist');

        // manage-env.js
        CC.createEnvProfile();
        CC.editEnvProfile();

        // manage-tags.js
        CC.manageTags('#managetags');

        // runtests.js
        CC.hideEmptyRuntestsEnv();
        CC.autoFocus('.details.stepfail > .summary', '#run');
        CC.autoFocus('.details.testinvalid > .summary', '#run');
        CC.runTests('#run');
        CC.breadcrumb('.runsdrill');
        CC.failedTestBug('#run');
        CC.filterEnvironments('#runtests-environment-form');
    });

    $(window).load(function () {
        // manage-results.js
        CC.openListItemDetails();
    });

    return CC;

}(CC || {}, jQuery));
<|endoftext|>


<commit_before>/* eslint-disable no-underscore-dangle */

import React, { Component, PropTypes } from 'react';
import invariant from 'invariant';
import hoistStatics from 'hoist-non-react-statics';
import getDisplayName from '../utilities/get-display-name';
import Spinner from './spinner';
import Glitch from './glitch';

const storePropTypes = PropTypes.shape({
  subscribe: PropTypes.func.isRequired,
  dispatch: PropTypes.func.isRequired,
  getState: PropTypes.func.isRequired,
});

export default function fetch(getAsyncState, options = {}) {
  return function wrapWithFetch(WrappedComponent) {
    const displayName = `Fetch(${getDisplayName(WrappedComponent)})`;

    class Fetch extends Component {
      static displayName = displayName;

      static contextTypes = {
        store: storePropTypes,
      };

      static propTypes = {
        store: storePropTypes,
      }

      static getAsyncState = getAsyncState;

      constructor(props, context) {
        super(props, context);

        this.store = props.store || context.store;
        this.settings = Object.assign({}, fetch.settings, options);

        invariant(this.store,
          `Could not find "store" in either the context or props of "${displayName}". ` +
          'Either wrap the root component in a `<Provider>`, ' +
          `or explicitly pass "store" as a prop to "${displayName}".`
        );
      }

      state = {
        error: null,
        hasError: false,
        isFetching: false,
      };

      componentWillMount() {
        const dispatch = this.store.dispatch;
        const state = this.store.getState();
        const ownProps = this.props;

        if (this.settings.shouldFetchOnMount(state, ownProps)) {
          this.fetchData(dispatch, state, ownProps);
        }
      }

      componentWillReceiveProps(nextProps) {
        const dispatch = this.store.dispatch;
        const state = this.store.getState();
        const prevProps = this.props;

        if (this.settings.shouldFetchOnUpdate(state, prevProps, nextProps)) {
          this.fetchData(dispatch, state, nextProps);
        }
      }

      componentWillUnmount() {
        this.ignoreLastFetch = true;
      }

      fetchData(dispatch, state, props) {
        this.setState({ isFetching: true, hasError: false, error: null });

        getAsyncState(dispatch, state, props).then(() => {
          if (!this.ignoreLastFetch) this.setState({ isFetching: false });
        }).catch((error) => {
          if (!this.ignoreLastFetch) this.setState({ isFetching: false, hasError: true, error });
        });
      }

      render() {
        if (this.state.isFetching) {
          return this.settings.renderLoading();
        }

        if (this.state.hasError) {
          return this.settings.renderFailure(this.state.error);
        }

        return <WrappedComponent {...this.props} />;
      }
    }

    return hoistStatics(Fetch, WrappedComponent);
  };
}

fetch.settings = {
  renderFailure: () => <Glitch />,
  renderLoading: () => <Spinner />,
  shouldFetchOnMount: () => true,
  shouldFetchOnUpdate: () => true,
};

fetch.setup = (options) => {
  Object.assign(fetch.settings, options);
};
<commit_msg>Fix issue where duplicate data fetching occurs between route transition<commit_after>/* eslint-disable no-underscore-dangle */

import React, { Component, PropTypes } from 'react';
import invariant from 'invariant';
import hoistStatics from 'hoist-non-react-statics';
import getDisplayName from '../utilities/get-display-name';
import Spinner from './spinner';
import Glitch from './glitch';

const storePropTypes = PropTypes.shape({
  subscribe: PropTypes.func.isRequired,
  dispatch: PropTypes.func.isRequired,
  getState: PropTypes.func.isRequired,
});

export default function fetch(getAsyncState, options = {}) {
  return function wrapWithFetch(WrappedComponent) {
    const displayName = `Fetch(${getDisplayName(WrappedComponent)})`;

    class Fetch extends Component {
      static displayName = displayName;

      static contextTypes = {
        store: storePropTypes,
      };

      static propTypes = {
        store: storePropTypes,
      }

      static getAsyncState = getAsyncState;

      constructor(props, context) {
        super(props, context);

        this.store = props.store || context.store;
        this.settings = Object.assign({}, fetch.settings, options);

        invariant(this.store,
          `Could not find "store" in either the context or props of "${displayName}". ` +
          'Either wrap the root component in a `<Provider>`, ' +
          `or explicitly pass "store" as a prop to "${displayName}".`
        );
      }

      state = {
        error: null,
        hasError: false,
        isFetching: false,
      };

      componentWillMount() {
        const dispatch = this.store.dispatch;
        const state = this.store.getState();
        const ownProps = this.props;

        if (this.settings.shouldFetchOnMount(state, ownProps)) {
          this.fetchData(dispatch, state, ownProps);
        }
      }

      componentWillReceiveProps(nextProps) {
        const dispatch = this.store.dispatch;
        const state = this.store.getState();
        const prevProps = this.props;

        if (this.settings.shouldFetchOnUpdate(state, prevProps, nextProps)) {
          this.fetchData(dispatch, state, nextProps);
        }
      }

      componentWillUnmount() {
        this.ignoreLastFetch = true;
      }

      fetchData(dispatch, state, props) {
        this.setState({ isFetching: true, hasError: false, error: null });

        getAsyncState(dispatch, state, props).then(() => {
          if (!this.ignoreLastFetch) this.setState({ isFetching: false });
        }).catch((error) => {
          if (!this.ignoreLastFetch) this.setState({ isFetching: false, hasError: true, error });
        });
      }

      render() {
        if (this.state.isFetching) {
          return this.settings.renderLoading();
        }

        if (this.state.hasError) {
          return this.settings.renderFailure(this.state.error);
        }

        return <WrappedComponent {...this.props} />;
      }
    }

    return hoistStatics(Fetch, WrappedComponent);
  };
}

fetch.settings = {
  renderFailure: () => <Glitch />,
  renderLoading: () => <Spinner />,
  shouldFetchOnMount: () => true,
  // Compare `location.key` to prevent fetching data when the location is the same.
  shouldFetchOnUpdate: (state, prevProps, nextProps) =>
    prevProps.location.key !== nextProps.location.key,
};

fetch.setup = (options) => {
  Object.assign(fetch.settings, options);
};
<|endoftext|>


<commit_before><commit_msg>Fix for #803 (#820)<commit_after><|endoftext|>


<commit_before>ig.module('game.entities.level2Logic').requires('game.entities.levelLogic').defines(function() {
	EntityLevel2Logic = EntityLevelLogic.extend({
		init: function(x,y,settings) {
			this.parent(x,y,settings);
			if (!ig.global.wm) {
			}
		},

		bindKeys: function() {
			ig.input.bind( ig.KEY.A, 'left' );
			ig.input.bind( ig.KEY.D, 'right' );
			ig.input.bind( ig.KEY.W, 'up');
			ig.input.bind (ig.KEY.S, 'down');
			ig.input.bind(ig.KEY.ESC, 'pause');
		},

		updateScreenPos: function() {
			var player = ig.game.getEntitiesByType( EntityPlayerL2 )[0];
			if( player ) {
				//ig.game.screen.x = player.pos.x - ig.system.width/2;
				ig.game.screen.x= player.pos.x - ig.system.width/2 - player.size.x/2;
			}
		}
	});
});<commit_msg>Fixed camera on L2<commit_after>ig.module('game.entities.level2Logic').requires('game.entities.levelLogic').defines(function() {
	EntityLevel2Logic = EntityLevelLogic.extend({
		init: function(x,y,settings) {
			this.parent(x,y,settings);
			if (!ig.global.wm) {
			}
		},

		bindKeys: function() {
			ig.input.bind( ig.KEY.A, 'left' );
			ig.input.bind( ig.KEY.D, 'right' );
			ig.input.bind( ig.KEY.W, 'up');
			ig.input.bind (ig.KEY.S, 'down');
			ig.input.bind(ig.KEY.ESC, 'pause');
		},

		updateScreenPos: function() {
			var player = ig.game.getEntitiesByType( EntityPlayerL2 )[0];
			if( player ) {
				//ig.game.screen.x = player.pos.x - ig.system.width/2;
				ig.game.screen.x = player.pos.x;
			}
		}
	});
});<|endoftext|>


<commit_before>import React, { Component } from 'react'
import { connect } from 'react-redux'
import throttle from 'react-throttle-render'

import { Card, CardHeader, CardText } from 'material-ui/Card'

import { getRole } from 'util/index'

const User = ({ id, role, money, bid, bidded, dealt, deal }) => (

    {id}
    {getRole(role)}
    {money}
    {
      dealt
        ? deal + "で成立"
        : bidded
          ? bid + "を入札"
          : "未入札"
    }

)

const mapStateToProps = ({ users }) => ({ users })

const Users = ({ users }) => (
  <Card initiallyExpanded={false}>
    <CardHeader
      title={"登録者 " + Object.keys(users).length + "人"}
      actAsExpander={true}
      showExpandableButton={true}
    />
    <CardText expandable={true}>

            id
            役割
            お金
            状態

          {
            Object.keys(users).map(id => (
              <User
                key={id}
                id={id}
                role={users[id].role}
                money={users[id].money}
                bid={users[id].bid}
                bidded={users[id].bidded}
                dealt={users[id].dealt}
                deal={users[id].deal}
              />
              ))
          }

    </CardText>
  </Card>
)

export default connect(mapStateToProps)(throttle(Users, 500))
<commit_msg>Change text.<commit_after>import React, { Component } from 'react'
import { connect } from 'react-redux'
import throttle from 'react-throttle-render'

import { Card, CardHeader, CardText } from 'material-ui/Card'

import { getRole } from 'util/index'

const User = ({ id, role, money, bid, bidded, dealt, deal }) => (

    {id}
    {getRole(role)}
    {money}
    {
      dealt
        ? deal + "で成立"
        : bidded
          ? bid + "を入札"
          : "未入札"
    }

)

const mapStateToProps = ({ users }) => ({ users })

const Users = ({ users }) => (
  <Card initiallyExpanded={false}>
    <CardHeader
      title={"登録者 " + Object.keys(users).length + "人"}
      actAsExpander={true}
      showExpandableButton={true}
    />
    <CardText expandable={true}>

            id
            役割
            価格
            状態

          {
            Object.keys(users).map(id => (
              <User
                key={id}
                id={id}
                role={users[id].role}
                money={users[id].money}
                bid={users[id].bid}
                bidded={users[id].bidded}
                dealt={users[id].dealt}
                deal={users[id].deal}
              />
              ))
          }

    </CardText>
  </Card>
)

export default connect(mapStateToProps)(throttle(Users, 500))
<|endoftext|>


<commit_before>import CssModulesBuildPlugin from './css-modules-build-plugin';
import pluginOptionsWrapper from './options';

const pluginOptions = pluginOptionsWrapper.options;

ImportPathHelpers.init(Plugin);

if (pluginOptions.extensions.indexOf('css') === -1)
	registerCompiler();
else
	monkeyPatchToHandleCssExtension();

function registerCompiler() {
	Plugin.registerCompiler({
		extensions: pluginOptions.extensions,
		archMatching: pluginOptions.specificArchitecture,
		filenames: pluginOptions.filenames
	}, function () {
		return new CssModulesBuildPlugin(Plugin);
	});
}

/**
 * Monkey patch _registerSourceProcessor and SourceProcessorSet.merge so we can block the default CSS compiler
 */
function monkeyPatchToHandleCssExtension() {
	const registerSourceProcessor = Plugin._registerSourceProcessor;
	Plugin._registerSourceProcessor = function (options, factory, {sourceProcessorSet, methodName, featurePackage}) {
		const buildPluginMerge = sourceProcessorSet.constructor.prototype.merge;
		sourceProcessorSet.constructor.prototype.merge = function (otherSet, options) {
			/**
			 * If a css plugin handler has already been added,
			 * don't merge the meteor package, which only includes the 'css' package
			 */
			if (otherSet._myPackageDisplayName !== 'meteor' || !('css' in this._byExtension)) {
				/* If we're using CSS modules inside of a package, it's possible that Meteor's CSS build plugin got merged
				 * before we could block it. In that case, unregister the Meteor CSS processor.
				 */
				if (('css' in this._byExtension) && 'css' in otherSet._byExtension) {// && sp.isopack.displayName() === 'meteor')
					const previouslyRegisteredSourceProcessor = this._byExtension.css[0];
					if (previouslyRegisteredSourceProcessor.isopack.displayName() === 'meteor' && otherSet._myPackageDisplayName === 'nathantreid:css-modules') {
						this.allSourceProcessors.splice(this.allSourceProcessors.indexOf(previouslyRegisteredSourceProcessor), 1)
						delete this._byExtension.css;
					}
				}
				buildPluginMerge.call(this, ...arguments);
				return;
			}
		};
		registerSourceProcessor(options, factory, {sourceProcessorSet, methodName, featurePackage});
	};

	registerCompiler();

	Plugin._registerSourceProcessor = registerSourceProcessor;
}
<commit_msg>clean up<commit_after>import CssModulesBuildPlugin from './css-modules-build-plugin';
import pluginOptionsWrapper from './options';

const pluginOptions = pluginOptionsWrapper.options;

ImportPathHelpers.init(Plugin);

if (pluginOptions.extensions.indexOf('css') === -1)
	registerCompiler();
else
	monkeyPatchToHandleCssExtension();

function registerCompiler () {
	Plugin.registerCompiler({
		extensions: pluginOptions.extensions,
		archMatching: pluginOptions.specificArchitecture,
		filenames: pluginOptions.filenames
	}, function () {
		return new CssModulesBuildPlugin(Plugin);
	});
}

/**
 * Monkey patch _registerSourceProcessor and SourceProcessorSet.merge so we can block the default CSS compiler
 */
function monkeyPatchToHandleCssExtension () {
	const registerSourceProcessor = Plugin._registerSourceProcessor;
	Plugin._registerSourceProcessor = function (options, factory, { sourceProcessorSet, methodName, featurePackage }) {
		const buildPluginMerge = sourceProcessorSet.constructor.prototype.merge;
		sourceProcessorSet.constructor.prototype.merge = function (otherSet, options) {
			/* If a css plugin handler has already been added,
			 * don't merge the meteor package, which only includes the 'css' package
			 */
			if (otherSet._myPackageDisplayName !== 'meteor' || !('css' in this._byExtension)) {
				/* If we're using CSS modules inside of a package, it's possible that Meteor's CSS build plugin got merged
				 * before we could block it. In that case, unregister the Meteor CSS processor.
				 */
				if (('css' in this._byExtension) && 'css' in otherSet._byExtension) {// && sp.isopack.displayName() === 'meteor')
					const previouslyRegisteredSourceProcessor = this._byExtension.css[0];
					if (previouslyRegisteredSourceProcessor.isopack.displayName() === 'meteor' && otherSet._myPackageDisplayName === 'nathantreid:css-modules') {
						this.allSourceProcessors.splice(this.allSourceProcessors.indexOf(previouslyRegisteredSourceProcessor), 1)
						delete this._byExtension.css;
					}
				}
				buildPluginMerge.call(this, ...arguments);
			}
		};
		registerSourceProcessor(options, factory, { sourceProcessorSet, methodName, featurePackage });
	};

	registerCompiler();

	Plugin._registerSourceProcessor = registerSourceProcessor;
}
<|endoftext|>


<commit_before>const fs = require('fs');
const path = require('path');
const Datastore = require('nedb');
const walk = require('walk');
const mm = require('musicmetadata');

import { Song } from './song';

export class Database {
  constructor(rootPath) {
    this.loaded = false;

    this.paths = {
      root: rootPath,
      databaseDir: path.join(rootPath, '.oudjo'),
      libraryDbFile: path.join(rootPath, '.oudjo', 'library.db'),
      albumsDbFile: path.join(rootPath, '.oudjo', 'albums.db'),
      artistsDbFile: path.join(rootPath, '.oudjo', 'artists.db')
    };

    this.storage = {
      library: null,
      albums: null,
      artists: null
    };

    this.scanningStatus = {
      isScanning: false,
      currentFile: 0,
      filesToScan: 0
    };
  }

  load() {
    return new Promise((resolve, reject) => {
      this.loaded = false;

      // Create database directory if it doesn't exist.
      try {
        fs.statSync(this.paths.databaseDir);
      } catch (err) {
        fs.mkdirSync(this.paths.databaseDir);
        console.info('Created database directory (.oudjo)');
      }

      this.storage.library = new Datastore(this.paths.libraryDbFile);
      this.storage.albums = new Datastore(this.paths.albumsDbFile);
      this.storage.artists = new Datastore(this.paths.artistsDbFile);

      this._loadLibraryDatastore()
        .then(this._loadAlbumsDatastore.bind(this))
        .then(this._loadArtistsDatastore.bind(this))
        .then(() => {
          this.loaded = true;
          console.info('Database loaded');
          resolve();
        })
        .catch((err) => {
          console.error(err);
          reject(err);
        });
    });
  }

  scan() {
    if (!this.loaded) {
      throw new Error('Cannot scan database, because it isn\'t loaded!');
    }

    this.scanningStatus.isScanning = true;

    console.info('Staring library scan');

    // Count the amount of files in the directory
    let fileCount = 0;
    let walkOptions = {
      listeners: {
        file: () => {
          fileCount++;
        }
      }
    };

    walk.walkSync(this.paths.root, walkOptions);
    this.scanningStatus.filesToScan = fileCount;
    console.log(`Files to scan: ${fileCount}`);

    // Scanning
    walkOptions = {
      listeners: {
        file: this._scanOnFile.bind(this),
        end: () => {
          this.scanningStatus.isScanning = false;
          console.info('Library scanning completed');
        }
      }
    };

    walk.walk(this.paths.root, walkOptions);
  }

  _loadLibraryDatastore() {
    return new Promise((resolve, reject) => {
      this.storage.library.loadDatabase((err) => {
        if (err) {
          reject(err);
        } else {
          console.info('Loaded library datastore');
          resolve();
        }
      });
    });
  }

  _loadAlbumsDatastore() {
    return new Promise((resolve, reject) => {
      this.storage.albums.loadDatabase((err) => {
        if (err) {
          reject(err);
        } else {
          console.info('Loaded albums datastore');
          resolve();
        }
      });
    });
  }

  _loadArtistsDatastore() {
    return new Promise((resolve, reject) => {
      this.storage.artists.loadDatabase((err) => {
        if (err) {
          reject(err);
        } else {
          console.info('Loaded artists datastore');
          resolve();
        }
      });
    });
  }

  _scanOnFile(root, fileStat, next) {
    let filePath = path.resolve(root, fileStat.name);
    let extension = path.extname(filePath).toLowerCase();

    let nextFile = () => {
      this.scanningStatus.currentFile++;
      next();
    };

    // TODO: Enable different file extensions.
    if (extension !== '.mp3') {
      nextFile();
      return;
    }

    mm(fs.createReadStream(filePath), { duration: true }, (err, metadata) => {
      if (err) {
        console.error(err);
        nextFile();
        return;
      }

      let relativePath = filePath.slice(
        this.paths.root.length,
        filePath.length
      );

      // TODO: Instead of skipping the song, show appropriate message to the
      //       user, after the scan is completed.
      // TODO: This is propably buggy, database scanning has to be tested using
      //       not tagged songs.
      if (metadata.title === '' ||
          metadata.artist === undefined ||
          metadata.artist.length === 0 ||
          metadata.album === '') {

        console.warn(`Rejected ${relativePath}, because of missing metadata`);
        console.log(metadata);
        nextFile();
        return;
      }

      let genre = metadata.genre === undefined ? undefined : metadata.genre[0];
      let length = parseInt(metadata.duration);

      let song = new Song(
        metadata.title,
        metadata.artist[0],
        metadata.album,
        metadata.year,
        metadata.track,
        genre,
        length,
        relativePath
      );

      let addArtistId = () => {
        return new Promise((fulfill, reject) => {
          this.storage.artists.find({ name: song.artist }, (err, docs) => {
            if (err) {
              reject(err);
            }

            if (docs.length === 1) {
              song.artistId = docs[0]._id;
              fulfill();
            } else {
              this.storage.artists.insert({ name: song.artist }, (er, doc) => {
                if (er) {
                  reject(er);
                }

                song.artistId = doc._id;
                fulfill();
              });
            }
          });
        });
      };

      let addAlbumId = () => {
        return new Promise((fulfill, reject) => {
          this.storage.albums.find({ name: song.album }, (err, docs) => {
            if (err) {
              reject(err);
            }

            if (docs.length === 1) {
              song.albumId = docs[0]._id;
              fulfill();
            } else {
              this.storage.albums.insert({ name: song.album }, (er, doc) => {
                if (er) {
                  reject(er);
                }

                song.albumId = doc._id;
                fulfill();
              });
            }
          });
        });
      };

      let insertSong = () => {
        return new Promise((fulfill, reject) => {
          this.storage.library.insert(song, (err) => {
            if (err) {
              reject(err);
            }

            fulfill();
          });
        });
      };

      // TODO: Add error logging that is visible to the user.
      addArtistId()
        .then(addAlbumId)
        .then(insertSong)
        .then(() => nextFile())
        .catch((err) => {
          console.error(err);
          nextFile();
        });
    });
  }

  getAlbumArt(sid) {
    return new Promise((fulfill, reject) => {
      this.storage.library.find({ _id: sid }, (err, docs) => {
        if (err) {
          reject(err);
        }

        if (docs.length === 0) {
          reject(new Error('No song with such ID'));
        }

        var song = docs[0];
        mm(fs.createReadStream(this.paths.root + song.path), (err, metadata) => {
          if (err) {
            reject(err);
          }

          if (metadata.picture.length === 0) {
            reject(new Error('Requested song has no album art'));
          } else {
            fulfill(metadata.picture[0]);
          }
        });
      });
    });
  }
}
<commit_msg>Enabled file formats different than mp3 Closes #26<commit_after>const fs = require('fs');
const path = require('path');
const Datastore = require('nedb');
const walk = require('walk');
const mm = require('musicmetadata');

import { Song } from './song';

export class Database {
  constructor(rootPath) {
    this.loaded = false;

    this.paths = {
      root: rootPath,
      databaseDir: path.join(rootPath, '.oudjo'),
      libraryDbFile: path.join(rootPath, '.oudjo', 'library.db'),
      albumsDbFile: path.join(rootPath, '.oudjo', 'albums.db'),
      artistsDbFile: path.join(rootPath, '.oudjo', 'artists.db')
    };

    this.storage = {
      library: null,
      albums: null,
      artists: null
    };

    this.scanningStatus = {
      isScanning: false,
      currentFile: 0,
      filesToScan: 0
    };
  }

  load() {
    return new Promise((resolve, reject) => {
      this.loaded = false;

      // Create database directory if it doesn't exist.
      try {
        fs.statSync(this.paths.databaseDir);
      } catch (err) {
        fs.mkdirSync(this.paths.databaseDir);
        console.info('Created database directory (.oudjo)');
      }

      this.storage.library = new Datastore(this.paths.libraryDbFile);
      this.storage.albums = new Datastore(this.paths.albumsDbFile);
      this.storage.artists = new Datastore(this.paths.artistsDbFile);

      this._loadLibraryDatastore()
        .then(this._loadAlbumsDatastore.bind(this))
        .then(this._loadArtistsDatastore.bind(this))
        .then(() => {
          this.loaded = true;
          console.info('Database loaded');
          resolve();
        })
        .catch((err) => {
          console.error(err);
          reject(err);
        });
    });
  }

  scan() {
    if (!this.loaded) {
      throw new Error('Cannot scan database, because it isn\'t loaded!');
    }

    this.scanningStatus.isScanning = true;

    console.info('Staring library scan');

    // Count the amount of files in the directory
    let fileCount = 0;
    let walkOptions = {
      listeners: {
        file: () => {
          fileCount++;
        }
      }
    };

    walk.walkSync(this.paths.root, walkOptions);
    this.scanningStatus.filesToScan = fileCount;
    console.log(`Files to scan: ${fileCount}`);

    // Scanning
    walkOptions = {
      listeners: {
        file: this._scanOnFile.bind(this),
        end: () => {
          this.scanningStatus.isScanning = false;
          console.info('Library scanning completed');
        }
      }
    };

    walk.walk(this.paths.root, walkOptions);
  }

  _loadLibraryDatastore() {
    return new Promise((resolve, reject) => {
      this.storage.library.loadDatabase((err) => {
        if (err) {
          reject(err);
        } else {
          console.info('Loaded library datastore');
          resolve();
        }
      });
    });
  }

  _loadAlbumsDatastore() {
    return new Promise((resolve, reject) => {
      this.storage.albums.loadDatabase((err) => {
        if (err) {
          reject(err);
        } else {
          console.info('Loaded albums datastore');
          resolve();
        }
      });
    });
  }

  _loadArtistsDatastore() {
    return new Promise((resolve, reject) => {
      this.storage.artists.loadDatabase((err) => {
        if (err) {
          reject(err);
        } else {
          console.info('Loaded artists datastore');
          resolve();
        }
      });
    });
  }

  _scanOnFile(root, fileStat, next) {
    let filePath = path.resolve(root, fileStat.name);
    let extension = path.extname(filePath).toLowerCase();

    let nextFile = () => {
      this.scanningStatus.currentFile++;
      next();
    };

    if (extension !== '.mp3' &&
        extension !== '.m4a' &&
        extension !== '.mp4' &&
        extension !== '.ogg') {
      nextFile();
      return;
    }

    mm(fs.createReadStream(filePath), { duration: true }, (err, metadata) => {
      if (err) {
        console.error(err);
        nextFile();
        return;
      }

      let relativePath = filePath.slice(
        this.paths.root.length,
        filePath.length
      );

      // TODO: Instead of skipping the song, show appropriate message to the
      //       user, after the scan is completed.
      // TODO: This is propably buggy, database scanning has to be tested using
      //       not tagged songs.
      if (metadata.title === '' ||
          metadata.artist === undefined ||
          metadata.artist.length === 0 ||
          metadata.album === '') {

        console.warn(`Rejected ${relativePath}, because of missing metadata`);
        console.log(metadata);
        nextFile();
        return;
      }

      let genre = metadata.genre === undefined ? undefined : metadata.genre[0];
      let length = parseInt(metadata.duration);

      let song = new Song(
        metadata.title,
        metadata.artist[0],
        metadata.album,
        metadata.year,
        metadata.track,
        genre,
        length,
        relativePath
      );

      let addArtistId = () => {
        return new Promise((fulfill, reject) => {
          this.storage.artists.find({ name: song.artist }, (err, docs) => {
            if (err) {
              reject(err);
            }

            if (docs.length === 1) {
              song.artistId = docs[0]._id;
              fulfill();
            } else {
              this.storage.artists.insert({ name: song.artist }, (er, doc) => {
                if (er) {
                  reject(er);
                }

                song.artistId = doc._id;
                fulfill();
              });
            }
          });
        });
      };

      let addAlbumId = () => {
        return new Promise((fulfill, reject) => {
          this.storage.albums.find({ name: song.album }, (err, docs) => {
            if (err) {
              reject(err);
            }

            if (docs.length === 1) {
              song.albumId = docs[0]._id;
              fulfill();
            } else {
              this.storage.albums.insert({ name: song.album }, (er, doc) => {
                if (er) {
                  reject(er);
                }

                song.albumId = doc._id;
                fulfill();
              });
            }
          });
        });
      };

      let insertSong = () => {
        return new Promise((fulfill, reject) => {
          this.storage.library.insert(song, (err) => {
            if (err) {
              reject(err);
            }

            fulfill();
          });
        });
      };

      // TODO: Add error logging that is visible to the user.
      addArtistId()
        .then(addAlbumId)
        .then(insertSong)
        .then(() => nextFile())
        .catch((err) => {
          console.error(err);
          nextFile();
        });
    });
  }

  getAlbumArt(sid) {
    return new Promise((fulfill, reject) => {
      this.storage.library.find({ _id: sid }, (err, docs) => {
        if (err) {
          reject(err);
        }

        if (docs.length === 0) {
          reject(new Error('No song with such ID'));
        }

        var song = docs[0];
        mm(fs.createReadStream(this.paths.root + song.path), (err, metadata) => {
          if (err) {
            reject(err);
          }

          if (metadata.picture.length === 0) {
            reject(new Error('Requested song has no album art'));
          } else {
            fulfill(metadata.picture[0]);
          }
        });
      });
    });
  }
}
<|endoftext|>


<commit_before>$('table').each(function(){
  var table = $(this);
  var headers = [];
  table.find('th').each(function(){
    headers.push( $(this).text() );
  });

  var cells = table.find('tbody tr td');
  var cellsCount = table.find('thead th').length - 1;
  var a = 0;
  for (var i = 0; i < cells.length; i += 1) {
    cells[i].setAttribute('data-header', headers[a]);
    if (a === cellsCount) {
      a = 0;
    } else {
      a++;
    }
  }
});
<commit_msg>Wrap code in document.ready and add js to create table headers<commit_after>$(function(){

  $('table').each(function(){
    if (!$(this).find('thead').length) {

      var headers = [];

      $(this).find('tbody tr').first().find('td').each(function(){
        headers.push($(this).text());
      }).parents('tr').remove();

      $(this).prepend('

');

      for (var i = headers.length - 1; i >= 0; i--) {
        $(this).find('thead tr').append('' + headers[i] + '	');
      };

    }
  });

  $('table').each(function(){
    var table = $(this);
    var headers = [];
    table.find('th').each(function(){
      headers.push( $(this).text() );
    });

    var cells = table.find('tbody tr td');
    var cellsCount = table.find('thead th').length - 1;
    var a = 0;
    for (var i = 0; i < cells.length; i += 1) {
      cells[i].setAttribute('data-header', headers[a]);
      if (a === cellsCount) {
        a = 0;
      } else {
        a++;
      }
    }
  });

});
<|endoftext|>


<commit_before>var en_US_trans = {
	// aggregates - keys should match Kaltura server
	"audience": "Audience",
	"plays" : "Plays",
	"seconds_viewed": "Minutes Viewed", // text should read minutes, not seconds
	"buffertime": "Average Buffering Time per Minute (seconds)",
	"bitrate": "Average Bitrate (kbps)",
	"agg_audience_tt": "Number of viewers at the moment",
	"agg_plays_tt": "Number of plays by viewers",
	"agg_secs_tt":"Sum of minutes viewed by all viewers so far",
	"agg_buffer_tt":"Average time per minute that viewers experienced buffering",
	"agg_bitrate_tt":"The average bitrate viewers are consuming",
	"export_to_csv": "Export To CSV",

	"dashboard" : {
		"Live_Content_36": "Live Content (in past 36 hours)",
		"Show_All_Entries": "Show All Entries",
		"Show_Kaltura": "Show Kaltura Live Now Only",
		"Audience": "Audience",
		"Plays": "Plays",
		"Peak_Audience": "Peak Audience",
		"Minutes_Viewed": "Minutes Viewed",
		"Buffer_Time": "Buffering Time",
		"Avg_Bitrate": "Average Bitrate",
		"Investigate": "Details",
		"first_broadcast_tt": "First broadcast start time",
		"export_success": "Success - check your inbox",
		"export_fail": "Ooops, this didn\'t play out well"
	},

	"entry" : {
		"ID": "Entry ID",
		"Live_Content": "Live Content",
		"Audience": "Audience",
		"Location": "Location",
		"Location_tt": "Audience change based on geography and time",
		"Top_referals": "Top Referrers",
		"Top_referals_tt": "Top HTTP referrers that most viewers visited to view the live media",
		"Domain": "Referrer",
		"Visits": "Visits",
		"of_total": "% of total",
		"export_success": "Success - check your inbox",
		"export_fail": "Ooops, this didn\'t play out well",
		"report_timeline": "Audience",
		"report_location": "Location",
		"report_syndication": "Top Referrers"
	},

	"main" : {
		// tab names (translations) should match names in KMC analytics
		"Content_Reports": "Content Reports",
		"Community_Reports": "Users & Community Reports",
		"Storage_Reports": "Bandwidth & Storage Reports",
		"System_Reports": "System Reports",
		"Live_Reports": "Live Reports",
		"Real_Time_Reports": "Live Real-Time Dashboard"
	}
};
<commit_msg>PLAT-2020 texts<commit_after>var en_US_trans = {
	// aggregates - keys should match Kaltura server
	"audience": "Audience",
	"plays" : "Plays",
	"seconds_viewed": "Minutes Viewed", // text should read minutes, not seconds
	"buffertime": "Average Buffering Time per Minute (seconds)",
	"bitrate": "Average Bitrate (kbps)",
	"agg_audience_tt": "Number of viewers at the moment",
	"agg_plays_tt": "Number of plays by viewers",
	"agg_secs_tt":"Sum of minutes viewed by all viewers so far",
	"agg_buffer_tt":"Average time per minute that viewers experienced buffering",
	"agg_bitrate_tt":"The average bitrate viewers are consuming",
	"export_to_csv": "Export To CSV",

	"dashboard" : {
		"Live_Content_36": "Live Content (in past 36 hours)",
		"Show_All_Entries": "Show All Entries",
		"Show_Kaltura": "Show Kaltura Live Now Only",
		"Audience": "Audience",
		"Plays": "Plays",
		"Peak_Audience": "Peak Audience",
		"Minutes_Viewed": "Minutes Viewed",
		"Buffer_Time": "Buffering Time",
		"Avg_Bitrate": "Average Bitrate",
		"Investigate": "Details",
		"first_broadcast_tt": "First broadcast start time",
		"export_success": "Your download request is being processed. A download link will be sent to {0} once processing is completed.",
		"export_fail": "Oooops, this didn\'t play out well. Please try again later."
	},

	"entry" : {
		"ID": "Entry ID",
		"Live_Content": "Live Content",
		"Audience": "Audience",
		"Location": "Location",
		"Location_tt": "Audience change based on geography and time",
		"Top_referals": "Top Referrers",
		"Top_referals_tt": "Top HTTP referrers that most viewers visited to view the live media",
		"Domain": "Referrer",
		"Visits": "Visits",
		"of_total": "% of total",
		"export_success": "Your download request is being processed. A download link will be sent to {0} once processing is completed.",
		"export_fail": "Oooops, this didn\'t play out well. Please try again later.",
		"report_timeline": "Audience",
		"report_location": "Location",
		"report_syndication": "Top Referrers"
	},

	"main" : {
		// tab names (translations) should match names in KMC analytics
		"Content_Reports": "Content Reports",
		"Community_Reports": "Users & Community Reports",
		"Storage_Reports": "Bandwidth & Storage Reports",
		"System_Reports": "System Reports",
		"Live_Reports": "Live Reports",
		"Real_Time_Reports": "Live Real-Time Dashboard"
	}
};
<|endoftext|>


<commit_before>$(function() {
    $("input[name='twtype']").change(function() {
        show_tweets({
            twtype: $(":input[name='twtype']:checked").val(),
            params: {count: 100}
        });
    });

        });
    });
});

function show_tweets(data){
    console.log("show_tweets");
    console.log(data);
    $('.content').html("");

    get_tweets(data).done(function(result) {
        $('.content').html(result);
        console.log("get_tweets")
    }).fail(function(result) {
        $('.content').html("
" + result.statusText + "
");
        console.log("error");
        console.log(result);
    });
}

function get_tweets(data){
    return $.ajax({
        url: '_get_tweets',
        type: 'post',
        data: JSON.stringify(data),
        contentType: 'application/json',
        dataType: 'html',
    });
}
<commit_msg>ログイン時に timeline を表示<commit_after>$(function() {
    $('#timeline-radio').attr('checked', true);
    show_tweets({
        twtype: $(":input[name='twtype']:checked").val(),
        params: {count: 200}
    });

    $("input[name='twtype']").change(function() {
        show_tweets({
            twtype: $(":input[name='twtype']:checked").val(),
            params: {count: 100}
        });
    });

        });
    });
});

function show_tweets(data){
    console.log("show_tweets");
    console.log(data);
    $('.content').html("");

    get_tweets(data).done(function(result) {
        $('.content').html(result);
        console.log("get_tweets")
    }).fail(function(result) {
        $('.content').html("
" + result.statusText + "
");
        console.log("error");
        console.log(result);
    });
}

function get_tweets(data){
    return $.ajax({
        url: '_get_tweets',
        type: 'post',
        data: JSON.stringify(data),
        contentType: 'application/json',
        dataType: 'html',
    });
}
<|endoftext|>


<commit_before>/**
 *  Copyright (C) 2014 3D Repo Ltd
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Affero General Public License as
 *  published by the Free Software Foundation, either version 3 of the
 *  License, or (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Affero General Public License for more details.
 *
 *  You should have received a copy of the GNU Affero General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

module.exports.createApp = function (serverConfig) {
	"use strict";

	let sharedSession = serverConfig.session;

	let log_iface = require("../logger.js");

	let express = require("express");
	let routes = require("../routes/routes.js")();
	let config = require("../config.js");
	let compress = require("compression");
	let responseCodes = require("../response_codes");

	let C = require("../constants");

	//let systemLogger = log_iface.systemLogger;
	// Attach the encoders to the router
	require("../encoders/x3dom_encoder.js").route(routes);
	require("../encoders/json_encoder.js").route(routes);
	//require("../encoders/html_encoder.js").route(routes);
	//require("../encoders/src_encoder.js").route(routes);
	require("../encoders/img_encoder.js").route(routes);
    require("../encoders/bin_encoder.js").route(routes);
    require("../encoders/gltf_encoder.js").route(routes);

	let bodyParser = require("body-parser");
	let app = express();

	// put logger in req object
	app.use(log_iface.startRequest);

	// init the singleton db connection for modelFactory
	app.use((req, res, next) => {
		// init the singleton db connection
		let DB = require("../db/db")(req[C.REQ_REPO].logger);

		DB.getDB("default").then( db => {
			// set db to singleton modelFactory class
			require("../models/factory/modelFactory").setDB(db);
			next();
		}).catch( err => {
			responseCodes.respond("Express Middleware", req, res, next, responseCodes.DB_ERROR(err), err);
		});
	});

	app.use(bodyParser.urlencoded({
		extended: true
	}));

	app.set("views", "./jade");
	app.set("view_engine", "jade");
	app.use(bodyParser.json());

	app.use(sharedSession);

	app.use(compress());

	// Allow cross origin requests to the API server
	if (serverConfig.allowedOrigins)
	{
		let allowCrossDomain = function(req, res, next) {

			var origin = req.headers.origin;

			if (serverConfig.allowedOrigins.indexOf(origin) > -1) {
				res.header("Access-Control-Allow-Origin", origin);
				res.header("Access-Control-Allow-Methods", "GET,PUT,POST,DELETE,OPTIONS");
				res.header("Access-Control-Allow-Headers", "Content-Type, Authorization, Content-Length, X-Requested-With");
				res.header("Access-Control-Allow-Credentials", true);
				//res.header("Cache-Control", "public, max-age=3600");
			}

			next();
		};

		app.use(allowCrossDomain);
	}

	//auth handler
	app.use('/', require('../routes/auth'));
	// os api handler
	app.use('/os',require('../routes/osBuilding'));
	//project setting handler
	app.use('/:account/:project', require('../routes/projectSetting'));

	app.use(function(req, res, next) {
		// intercept OPTIONS method
		if ("OPTIONS" === req.method) {
			res.sendStatus(200);
		} else {
			next();
		}
	});

	if(config.test_helper_api){
		// test helpers
		app.use("/tests", require("../js/core/handlers/testHelper"));
		// api doc console
		app.use(express.static("doc"));
	}

	//project handlers
	app.use("/:account/:project", require("../routes/project"));
	// project package handlers
	app.use("/:account/:project", require("../routes/projectPackage"));
	// bid hanlders
	app.use('/:account/:project/packages/:packageName', require('../routes/bid'));
	//groups handler
	app.use('/:account/:project/groups', require('../routes/group'));

	//issues handler
	app.use("/:account/:project", require("../routes/issue"));
	//mesh handler
	app.use("/:account/:project", require("../routes/mesh"));
	//texture handler
	app.use("/:account/:project", require("../routes/texture"));

	app.use("/", routes.router);

	return app;
};
<commit_msg>ISSUE #190 - Deal with wildcard domain name in allowed origins<commit_after>/**
 *  Copyright (C) 2014 3D Repo Ltd
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Affero General Public License as
 *  published by the Free Software Foundation, either version 3 of the
 *  License, or (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Affero General Public License for more details.
 *
 *  You should have received a copy of the GNU Affero General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

module.exports.createApp = function (serverConfig) {
	"use strict";

	let sharedSession = serverConfig.session;

	let log_iface = require("../logger.js");

	let express = require("express");
	let routes = require("../routes/routes.js")();
	let config = require("../config.js");
	let compress = require("compression");
	let responseCodes = require("../response_codes");

	let C = require("../constants");

	//let systemLogger = log_iface.systemLogger;
	// Attach the encoders to the router
	require("../encoders/x3dom_encoder.js").route(routes);
	require("../encoders/json_encoder.js").route(routes);
	//require("../encoders/html_encoder.js").route(routes);
	//require("../encoders/src_encoder.js").route(routes);
	require("../encoders/img_encoder.js").route(routes);
    require("../encoders/bin_encoder.js").route(routes);
    require("../encoders/gltf_encoder.js").route(routes);

	let bodyParser = require("body-parser");
	let app = express();

	// put logger in req object
	app.use(log_iface.startRequest);

	// init the singleton db connection for modelFactory
	app.use((req, res, next) => {
		// init the singleton db connection
		let DB = require("../db/db")(req[C.REQ_REPO].logger);

		DB.getDB("default").then( db => {
			// set db to singleton modelFactory class
			require("../models/factory/modelFactory").setDB(db);
			next();
		}).catch( err => {
			responseCodes.respond("Express Middleware", req, res, next, responseCodes.DB_ERROR(err), err);
		});
	});

	app.use(bodyParser.urlencoded({
		extended: true
	}));

	app.set("views", "./jade");
	app.set("view_engine", "jade");
	app.use(bodyParser.json());

	app.use(sharedSession);

	app.use(compress());

	// Allow cross origin requests to the API server
	if (serverConfig.allowedOrigins)
	{
		let allowCrossDomain = function(req, res, next) {

			var origin = req.headers.origin;

			if ((serverConfig.allowedOrigins.indexOf("*") > -1) || (serverConfig.allowedOrigins.indexOf(origin) > -1)) {
				res.header("Access-Control-Allow-Origin", origin);
				res.header("Access-Control-Allow-Methods", "GET,PUT,POST,DELETE,OPTIONS");
				res.header("Access-Control-Allow-Headers", "Content-Type, Authorization, Content-Length, X-Requested-With");
				res.header("Access-Control-Allow-Credentials", true);
				//res.header("Cache-Control", "public, max-age=3600");
			}

			next();
		};

		app.use(allowCrossDomain);
	}

	//auth handler
	app.use('/', require('../routes/auth'));
	// os api handler
	app.use('/os',require('../routes/osBuilding'));
	//project setting handler
	app.use('/:account/:project', require('../routes/projectSetting'));

	app.use(function(req, res, next) {
		// intercept OPTIONS method
		if ("OPTIONS" === req.method) {
			res.sendStatus(200);
		} else {
			next();
		}
	});

	if(config.test_helper_api){
		// test helpers
		app.use("/tests", require("../js/core/handlers/testHelper"));
		// api doc console
		app.use(express.static("doc"));
	}

	//project handlers
	app.use("/:account/:project", require("../routes/project"));
	// project package handlers
	app.use("/:account/:project", require("../routes/projectPackage"));
	// bid hanlders
	app.use('/:account/:project/packages/:packageName', require('../routes/bid'));
	//groups handler
	app.use('/:account/:project/groups', require('../routes/group'));

	//issues handler
	app.use("/:account/:project", require("../routes/issue"));
	//mesh handler
	app.use("/:account/:project", require("../routes/mesh"));
	//texture handler
	app.use("/:account/:project", require("../routes/texture"));

	app.use("/", routes.router);

	return app;
};
<|endoftext|>


<commit_before>import React                from 'react';
import {
  createStore,
  applyMiddleware,
}                           from 'redux';
import thunk                from 'redux-thunk';
import {
  merge,
  updateIn,
  set as timmSet,
}                           from 'timm';
import HintScreen           from './hintScreen';
import { localGet, localSet } from '../gral/storage';

/* --
**Include the `<Hints />` component at (or near)
the root level of your React tree**. No props are required.
Here's an example on how you would define a hint screen and show it
afterwards:

```js
import { hintShow, Button } from 'giu';
class HintExample extends React.Component {
  componentWillMount() {
    hintDefine('hintExample', {
      elements: [
        {
          type: 'LABEL', x: 200, y: 50,
          children: <span>A label with an icon <Icon icon="ambulance" /></span>,
        },
        { type: 'ARROW', from: { x: 200, y: 50 }, to: { x: 50, y: 50 }, counterclockwise: true }
      ],
    });
  }

  render() {
    <Button onClick={() => hintShow('hintExample')}>Show hint</Button>
  }
}
```

The first time you click on the button, the hint screen will appear.
After that, the `hintExample` screen will be disabled (unless `hintReset()`
is called or the `force` argument of `hintShow()` is used, see below).
The list of disabled hint screens is stored in LocalStorage.

API reference:

* **hintDefine()**: defines a hint screen:
  - **id** *string*: ID of the hint to be created
  - **pars** *object*: hint parameters:
    + **elements** *array(object)|function?*: either an array of elements,
      or a function returning such an element (for dynamic positioning).
      Elements have these attributes:
      - **type** *string(`LABEL` | `ARROW`)*
      - Arrows:
        - **from** *object*: coordinates, e.g. `{ x: 5, y: 10 }`
        - **to** *object*: coordinates
        - **counterclockwise** *boolean*
      - Labels:
        - **x** and **y** *number*: coordinates
        - **align** *string(`left` | `center` | `right`)? = `left`*
        - **children** *any*: React elements that comprise the label
    + **closeLabel** *string? = `Got it!`*: label of the close button
    + **onClose** *function?*: called when the hint screen is closed
* **hintDisableAll()**: disables all hints
* **hintReset()**: clears the list of disabled hints
* **hintShow()**: shows a hint
  - **id** *string*: ID of the hint to be shown
  - **force** *boolean?*: if not enabled, the hint will only be shown if
    hints are enabled (no previous call to `hintDisableAll()` and it has not
    already been shown)
* **hintHide()**: hides the currently shown hint, if any
-- */

// ==========================================
// Store, reducer
// ==========================================
let store = null;

const INITIAL_STATE = {
  fDisableAll: false,
  disabled: [],
  shown: null,
  catalogue: {},
};
const NAMESPACE = 'giu';

function initStore() {
  const storeEnhancers = applyMiddleware(thunk);
  const initialState = merge({}, INITIAL_STATE);
  try {
    initialState.fDisableAll = localGet('hints.fDisableAll');
  } catch (err) { /* discard */ }
  try {
    initialState.disabled = localGet('hints.disabled');
  } catch (err) { /* discard */ }
  store = createStore(reducer, initialState, storeEnhancers);
}

function reducer(state0 = INITIAL_STATE, action) {
  let state = state0;
  let id;
  switch (action.type) {
    case 'HINT_DEFINE':
      state = updateIn(state, ['catalogue'], catalogue =>
        timmSet(catalogue, action.id, action.pars));
      break;
    case 'HINT_DISABLE_ALL':
      state = timmSet(state, 'fDisableAll', true);
      state = timmSet(state, 'shown', null);
      break;
    case 'HINT_RESET':
      state = merge(state, {
        fDisableAll: false,
        disabled: [],
      });
      break;
    case 'HINT_SHOW':
      id = action.id;
      if (action.force ||
          (!state.fDisableAll && state.disabled.indexOf(id) < 0)) {
        state = timmSet(state, 'shown', id);
        if (state.disabled.indexOf(id) < 0) {
          state = timmSet(state, 'disabled', state.disabled.concat(id));
        }
      }
      break;
    case 'HINT_HIDE':
      state = timmSet(state, 'shown', null);
      break;
    default:
      break;
  }
  return state;
}

// ==========================================
// Action creators
// ==========================================
const actions = {
  hintDefine: (id, pars) => ({ type: 'HINT_DEFINE', id, pars }),
  hintDisableAll: () => (dispatch, getState) => {
    dispatch({ type: 'HINT_DISABLE_ALL' });
    const { fDisableAll } = getState();
    localSet('hints.fDisableAll', fDisableAll);
  },
  hintReset: () => (dispatch, getState) => {
    dispatch({ type: 'HINT_RESET' });
    const { fDisableAll, disabled } = getState();
    localSet('hints.fDisableAll', fDisableAll);
    localSet('hints.disabled', disabled);
  },
  hintShow: (id, force) => (dispatch, getState) => {
    dispatch({ type: 'HINT_SHOW', id, force });
    const { disabled } = getState();
    localSet('hints.disabled', disabled);
  },
  hintHide: () => ({ type: 'HINT_HIDE' }),
};

// Imperative dispatching
const hintDefine = (id, pars) => store.dispatch(actions.hintDefine(id, pars));
const hintDisableAll = () => store.dispatch(actions.hintDisableAll());
const hintReset = () => store.dispatch(actions.hintReset());
const hintShow = (id, force) => store.dispatch(actions.hintShow(id, force));
const hintHide = () => store.dispatch(actions.hintHide());

// ==========================================
// Hints component
// ==========================================
class Hints extends React.PureComponent {
  static propTypes = {
    storeState:             React.PropTypes.object,
  };

  constructor(props) {
    super(props);
    if (props.storeState == null) {
      if (!store) initStore();
      this.storeUnsubscribe = store.subscribe(this.forceUpdate.bind(this));
    }
  }

  componentWillUnmount() { if (this.storeUnsubscribe) this.storeUnsubscribe(); }

  // ==========================================
  render() {
    this.storeState = this.props.storeState || store.getState();
    return (

        {this.renderHint()}

    );
  }

  renderHint() {
    const { shown, catalogue } = this.storeState;
    if (!shown) return null;
    const pars = catalogue[shown];
    return <HintScreen {...pars} onClose={hintHide} />;
  }
}

// ==========================================
// Public API
// ==========================================
const isHintShown = () => store.getState().shown != null;

export {
  Hints,
  reducer,
  actions,
  hintDefine, hintDisableAll, hintReset, hintShow, hintHide, isHintShown,
};
<commit_msg>Minor<commit_after>import React                from 'react';
import {
  createStore,
  applyMiddleware,
}                           from 'redux';
import thunk                from 'redux-thunk';
import {
  merge,
  updateIn,
  set as timmSet,
}                           from 'timm';
import HintScreen           from './hintScreen';
import { localGet, localSet } from '../gral/storage';

/* --
**Include the `<Hints />` component at (or near)
the root level of your React tree**. No props are required.
Here's an example on how you would define a hint screen and show it
afterwards:

```js
import { hintShow, Button } from 'giu';
class HintExample extends React.Component {
  componentWillMount() {
    hintDefine('hintExample', {
      elements: [
        {
          type: 'LABEL', x: 200, y: 50,
          children: <span>A label with an icon <Icon icon="ambulance" /></span>,
        },
        { type: 'ARROW', from: { x: 200, y: 50 }, to: { x: 50, y: 50 }, counterclockwise: true }
      ],
    });
  }

  render() {
    <Button onClick={() => hintShow('hintExample')}>Show hint</Button>
  }
}
```

The first time you click on the button, the hint screen will appear.
After that, the `hintExample` screen will be disabled (unless `hintReset()`
is called or the `force` argument of `hintShow()` is used, see below).
The list of disabled hint screens is stored in LocalStorage.

API reference:

* **hintDefine()**: defines a hint screen:
  - **id** *string*: ID of the hint to be created
  - **pars** *object*: hint parameters:
    + **elements** *array(object)|function?*: either an array of elements,
      or a function returning such an element (for dynamic positioning).
      Elements have these attributes:
      - **type** *string(`LABEL` | `ARROW`)*
      - Arrows:
        - **from** *object*: coordinates, e.g. `{ x: 5, y: 10 }`
        - **to** *object*: coordinates
        - **counterclockwise** *boolean*
      - Labels:
        - **x** and **y** *number*: coordinates
        - **align** *string(`left` | `center` | `right`)? = `left`*
        - **children** *any*: React elements that comprise the label
    + **closeLabel** *string? = `Got it!`*: label of the close button
    + **onClose** *function?*: called when the hint screen is closed
* **hintDisableAll()**: disables all hints
* **hintReset()**: clears the list of disabled hints
* **hintShow()**: shows a hint
  - **id** *string*: ID of the hint to be shown
  - **force** *boolean?*: if not enabled, the hint will only be shown if
    hints are enabled (no previous call to `hintDisableAll()` and it has not
    already been shown)
* **hintHide()**: hides the currently shown hint, if any
-- */

// ==========================================
// Store, reducer
// ==========================================
let store = null;

const INITIAL_STATE = {
  fDisableAll: false,
  disabled: [],
  shown: null,
  catalogue: {},
};

function initStore() {
  const storeEnhancers = applyMiddleware(thunk);
  const initialState = merge({}, INITIAL_STATE);
  try {
    initialState.fDisableAll = localGet('hints.fDisableAll');
  } catch (err) { /* discard */ }
  try {
    initialState.disabled = localGet('hints.disabled');
  } catch (err) { /* discard */ }
  store = createStore(reducer, initialState, storeEnhancers);
}

function reducer(state0 = INITIAL_STATE, action) {
  let state = state0;
  let id;
  switch (action.type) {
    case 'HINT_DEFINE':
      state = updateIn(state, ['catalogue'], catalogue =>
        timmSet(catalogue, action.id, action.pars));
      break;
    case 'HINT_DISABLE_ALL':
      state = timmSet(state, 'fDisableAll', true);
      state = timmSet(state, 'shown', null);
      break;
    case 'HINT_RESET':
      state = merge(state, {
        fDisableAll: false,
        disabled: [],
      });
      break;
    case 'HINT_SHOW':
      id = action.id;
      if (action.force ||
          (!state.fDisableAll && state.disabled.indexOf(id) < 0)) {
        state = timmSet(state, 'shown', id);
        if (state.disabled.indexOf(id) < 0) {
          state = timmSet(state, 'disabled', state.disabled.concat(id));
        }
      }
      break;
    case 'HINT_HIDE':
      state = timmSet(state, 'shown', null);
      break;
    default:
      break;
  }
  return state;
}

// ==========================================
// Action creators
// ==========================================
const actions = {
  hintDefine: (id, pars) => ({ type: 'HINT_DEFINE', id, pars }),
  hintDisableAll: () => (dispatch, getState) => {
    dispatch({ type: 'HINT_DISABLE_ALL' });
    const { fDisableAll } = getState();
    localSet('hints.fDisableAll', fDisableAll);
  },
  hintReset: () => (dispatch, getState) => {
    dispatch({ type: 'HINT_RESET' });
    const { fDisableAll, disabled } = getState();
    localSet('hints.fDisableAll', fDisableAll);
    localSet('hints.disabled', disabled);
  },
  hintShow: (id, force) => (dispatch, getState) => {
    dispatch({ type: 'HINT_SHOW', id, force });
    const { disabled } = getState();
    localSet('hints.disabled', disabled);
  },
  hintHide: () => ({ type: 'HINT_HIDE' }),
};

// Imperative dispatching
const hintDefine = (id, pars) => store.dispatch(actions.hintDefine(id, pars));
const hintDisableAll = () => store.dispatch(actions.hintDisableAll());
const hintReset = () => store.dispatch(actions.hintReset());
const hintShow = (id, force) => store.dispatch(actions.hintShow(id, force));
const hintHide = () => store.dispatch(actions.hintHide());

// ==========================================
// Hints component
// ==========================================
class Hints extends React.PureComponent {
  static propTypes = {
    storeState:             React.PropTypes.object,
  };

  constructor(props) {
    super(props);
    if (props.storeState == null) {
      if (!store) initStore();
      this.storeUnsubscribe = store.subscribe(this.forceUpdate.bind(this));
    }
  }

  componentWillUnmount() { if (this.storeUnsubscribe) this.storeUnsubscribe(); }

  // ==========================================
  render() {
    this.storeState = this.props.storeState || store.getState();
    return (

        {this.renderHint()}

    );
  }

  renderHint() {
    const { shown, catalogue } = this.storeState;
    if (!shown) return null;
    const pars = catalogue[shown];
    return <HintScreen {...pars} onClose={hintHide} />;
  }
}

// ==========================================
// Public API
// ==========================================
const isHintShown = () => store.getState().shown != null;

export {
  Hints,
  reducer,
  actions,
  hintDefine, hintDisableAll, hintReset, hintShow, hintHide, isHintShown,
};
<|endoftext|>


<commit_before>/*! anim-js | Banjo Mofesola Paul | 2017-03-01 */
$(function(){$(".anim-js").each(function(){var a=$(this).data();a.ajsDuration&&$(this).css({animationDuration:a.ajsDuration}),a.ajsLoop&&$(this).css({animationIterationCount:a.ajsLoop}),a.ajsDelay&&$(this).css({animationDelay:a.ajsDelay}),$(this).removeClass("anim-js").addClass("animated")})});
<commit_msg>Regenerated output<commit_after>/*! anim-js | Banjo Mofesola Paul | 2017-03-05 */
$(function(){$(".anim-js").each(function(){var a=$(this).data();a.ajsDuration&&$(this).css({animationDuration:a.ajsDuration}),a.ajsLoop&&$(this).css({animationIterationCount:a.ajsLoop}),a.ajsDelay&&$(this).css({animationDelay:a.ajsDelay}),$(this).removeClass("anim-js").addClass("animated")})});
<|endoftext|>


<commit_before>import Ember from 'ember';
import config from './config/environment';

var Router = Ember.Router.extend({
  location: config.locationType
});

Router.map(function() {
  this.route('user');
  this.route('sign-in');
  this.route('taskList');
});

export default Router;
<commit_msg>feat(router): add 404 route<commit_after>import Ember from 'ember';
import config from './config/environment';

var Router = Ember.Router.extend({
  location: config.locationType
});

Router.map(function() {
  this.route('user');
  this.route('sign-in');
  this.route('taskList');

  this.route('404', { path: '/*404' } );
});

export default Router;
<|endoftext|>


<commit_before><commit_msg>lazy eval original path after path change<commit_after><|endoftext|>