hexsha string | size int64 | ext string | lang string | max_stars_repo_path string | max_stars_repo_name string | max_stars_repo_head_hexsha string | max_stars_repo_licenses list | max_stars_count int64 | max_stars_repo_stars_event_min_datetime string | max_stars_repo_stars_event_max_datetime string | max_issues_repo_path string | max_issues_repo_name string | max_issues_repo_head_hexsha string | max_issues_repo_licenses list | max_issues_count int64 | max_issues_repo_issues_event_min_datetime string | max_issues_repo_issues_event_max_datetime string | max_forks_repo_path string | max_forks_repo_name string | max_forks_repo_head_hexsha string | max_forks_repo_licenses list | max_forks_count int64 | max_forks_repo_forks_event_min_datetime string | max_forks_repo_forks_event_max_datetime string | content string | avg_line_length float64 | max_line_length int64 | alphanum_fraction float64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1e36da6e76774121780ce556ba73bf7cb7de93f7 | 859 | js | JavaScript | www/assets/datepicker/ui/minified/i18n/jquery.ui.datepicker-lt.min.js | zenfikry/Gowash | 2cde5e1327d6537836e906316b3636eba45ad389 | [
"BSD-3-Clause"
] | null | null | null | www/assets/datepicker/ui/minified/i18n/jquery.ui.datepicker-lt.min.js | zenfikry/Gowash | 2cde5e1327d6537836e906316b3636eba45ad389 | [
"BSD-3-Clause"
] | null | null | null | www/assets/datepicker/ui/minified/i18n/jquery.ui.datepicker-lt.min.js | zenfikry/Gowash | 2cde5e1327d6537836e906316b3636eba45ad389 | [
"BSD-3-Clause"
] | null | null | null | /*! jQuery UI - v1.9.2 - 2017-05-12
* http://jqueryui.com
* Copyright jQuery Foundation and other contributors; Licensed MIT */
jQuery(function(t){t.datepicker.regional.lt={closeText:"Uždaryti",prevText:"<Atgal",nextText:"Pirmyn>",currentText:"Šiandien",monthNames:["Sausis","Vasaris","Kovas","Balandis","Gegužė","Birželis","Liepa","Rugpjūtis","Rugsėjis","Spalis","Lapkritis","Gruodis"],monthNamesShort:["Sau","Vas","Kov","Bal","Geg","Bir","Lie","Rugp","Rugs","Spa","Lap","Gru"],dayNames:["sekmadienis","pirmadienis","antradienis","trečiadienis","ketvirtadienis","penktadienis","šeštadienis"],dayNamesShort:["sek","pir","ant","tre","ket","pen","šeš"],dayNamesMin:["Se","Pr","An","Tr","Ke","Pe","Še"],weekHeader:"Wk",dateFormat:"yy-mm-dd",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},t.datepicker.setDefaults(t.datepicker.regional.lt)}); | 171.8 | 730 | 0.706636 |
1e372c61be2e566f1dc714c8958cbbab22319e19 | 4,598 | js | JavaScript | node_modules/react-bootstrap/lib/TabContainer.js | b0bbybaldi/chicken | af5e547f624183d5bf3e45a83b725cdf8c4eeae7 | [
"MIT"
] | 243 | 2018-06-12T17:58:28.000Z | 2022-01-07T19:21:53.000Z | node_modules/react-bootstrap/lib/TabContainer.js | b0bbybaldi/chicken | af5e547f624183d5bf3e45a83b725cdf8c4eeae7 | [
"MIT"
] | 12 | 2018-04-08T15:12:27.000Z | 2018-05-08T09:37:03.000Z | node_modules/react-bootstrap/lib/TabContainer.js | b0bbybaldi/chicken | af5e547f624183d5bf3e45a83b725cdf8c4eeae7 | [
"MIT"
] | 26 | 2018-06-07T23:46:49.000Z | 2020-08-31T16:23:19.000Z | 'use strict';
exports.__esModule = true;
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = require('babel-runtime/helpers/inherits');
var _inherits3 = _interopRequireDefault(_inherits2);
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _uncontrollable = require('uncontrollable');
var _uncontrollable2 = _interopRequireDefault(_uncontrollable);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var TAB = 'tab';
var PANE = 'pane';
var idPropType = _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]);
var propTypes = {
/**
* HTML id attribute, required if no `generateChildId` prop
* is specified.
*/
id: function id(props) {
var error = null;
if (!props.generateChildId) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
error = idPropType.apply(undefined, [props].concat(args));
if (!error && !props.id) {
error = new Error('In order to properly initialize Tabs in a way that is accessible ' + 'to assistive technologies (such as screen readers) an `id` or a ' + '`generateChildId` prop to TabContainer is required');
}
}
return error;
},
/**
* A function that takes an `eventKey` and `type` and returns a unique id for
* child tab `<NavItem>`s and `<TabPane>`s. The function _must_ be a pure
* function, meaning it should always return the _same_ id for the same set
* of inputs. The default value requires that an `id` to be set for the
* `<TabContainer>`.
*
* The `type` argument will either be `"tab"` or `"pane"`.
*
* @defaultValue (eventKey, type) => `${this.props.id}-${type}-${key}`
*/
generateChildId: _propTypes2.default.func,
/**
* A callback fired when a tab is selected.
*
* @controllable activeKey
*/
onSelect: _propTypes2.default.func,
/**
* The `eventKey` of the currently active tab.
*
* @controllable onSelect
*/
activeKey: _propTypes2.default.any
};
var childContextTypes = {
$bs_tabContainer: _propTypes2.default.shape({
activeKey: _propTypes2.default.any,
onSelect: _propTypes2.default.func.isRequired,
getTabId: _propTypes2.default.func.isRequired,
getPaneId: _propTypes2.default.func.isRequired
})
};
var TabContainer = function (_React$Component) {
(0, _inherits3.default)(TabContainer, _React$Component);
function TabContainer() {
(0, _classCallCheck3.default)(this, TabContainer);
return (0, _possibleConstructorReturn3.default)(this, _React$Component.apply(this, arguments));
}
TabContainer.prototype.getChildContext = function getChildContext() {
var _props = this.props,
activeKey = _props.activeKey,
onSelect = _props.onSelect,
generateChildId = _props.generateChildId,
id = _props.id;
var getId = generateChildId || function (key, type) {
return id ? id + '-' + type + '-' + key : null;
};
return {
$bs_tabContainer: {
activeKey: activeKey,
onSelect: onSelect,
getTabId: function getTabId(key) {
return getId(key, TAB);
},
getPaneId: function getPaneId(key) {
return getId(key, PANE);
}
}
};
};
TabContainer.prototype.render = function render() {
var _props2 = this.props,
children = _props2.children,
props = (0, _objectWithoutProperties3.default)(_props2, ['children']);
delete props.generateChildId;
delete props.onSelect;
delete props.activeKey;
return _react2.default.cloneElement(_react2.default.Children.only(children), props);
};
return TabContainer;
}(_react2.default.Component);
TabContainer.propTypes = propTypes;
TabContainer.childContextTypes = childContextTypes;
exports.default = (0, _uncontrollable2.default)(TabContainer, { activeKey: 'onSelect' });
module.exports = exports['default']; | 29.664516 | 219 | 0.69291 |
1e3758fabfb8fd44a449588185adac24d55745f1 | 1,162 | js | JavaScript | test/fixtures/configSchemaExtensions/test-plugin.js | A-5ingh/serverless | 9346016eb41342917edc0214944fad0994249412 | [
"MIT"
] | null | null | null | test/fixtures/configSchemaExtensions/test-plugin.js | A-5ingh/serverless | 9346016eb41342917edc0214944fad0994249412 | [
"MIT"
] | null | null | null | test/fixtures/configSchemaExtensions/test-plugin.js | A-5ingh/serverless | 9346016eb41342917edc0214944fad0994249412 | [
"MIT"
] | null | null | null | 'use strict';
class TestPlugin {
constructor(serverless) {
serverless.configSchemaHandler.defineProvider('someProvider', {
function: {
properties: {
handler: { type: 'string' },
},
},
});
serverless.configSchemaHandler.defineCustomProperties({
properties: {
someCustomStringProp: { type: 'string' },
},
required: ['someCustomStringProp'],
});
serverless.configSchemaHandler.defineFunctionEvent('someProvider', 'someEvent', {
type: 'object',
properties: {
someRequiredStringProp: { type: 'string' },
someNumberProp: { type: 'number' },
},
required: ['someRequiredStringProp'],
additionalProperties: false,
});
serverless.configSchemaHandler.defineFunctionProperties('someProvider', {
properties: {
someFunctionStringProp: { type: 'string' },
someRequiredFunctionNumberProp: { type: 'number' },
},
required: ['someRequiredFunctionNumberProp'],
});
serverless.configSchemaHandler.defineTopLevelProperty('top', {
type: 'string',
});
}
}
module.exports = TestPlugin;
| 25.822222 | 85 | 0.624785 |
1e3779fcb3ea6688f21f59233eda5f42f299d733 | 601 | js | JavaScript | src/index.js | nmkridler/pyxleyJS | 188e7ec889caf0f932825f17d988b1def55ab321 | [
"MIT"
] | null | null | null | src/index.js | nmkridler/pyxleyJS | 188e7ec889caf0f932825f17d988b1def55ab321 | [
"MIT"
] | null | null | null | src/index.js | nmkridler/pyxleyJS | 188e7ec889caf0f932825f17d988b1def55ab321 | [
"MIT"
] | null | null | null | export {ChartFactory} from './charts/factory.js';
export {FilterFactory} from './filters/factory.js';
export {LayoutFactory, Layout} from './layouts/factory.js';
export {AntHeader} from './layouts/AntLayout.js';
export {AntSidebar} from './layouts/AntSidebar.js';
export {Filter} from './filters/factory.js';
export {reducers} from './reducers/index';
export {actions} from './actions/index';
export {Chart} from './charts/factory.js';
export {AntTable, makeHeader} from './charts/antdesign/base.js';
export {fetchData, postData, deleteData} from './utils/fetch'
export {utils} from './layouts/utils'
| 46.230769 | 64 | 0.735441 |
1e37e15153e130e35e64cb9a175dff804ddd5192 | 2,793 | js | JavaScript | src/components/key-indicator.js | ekmixon/OpenHealthDashboard | ef70688ae2e9ba54bd791abf57e4951db8775481 | [
"Apache-2.0"
] | 15 | 2019-09-17T00:46:00.000Z | 2022-02-18T03:38:34.000Z | src/components/key-indicator.js | mitre/OpenHealthDashboard | ef70688ae2e9ba54bd791abf57e4951db8775481 | [
"Apache-2.0"
] | 9 | 2019-11-25T14:31:38.000Z | 2022-02-18T15:35:14.000Z | src/components/key-indicator.js | ekmixon/OpenHealthDashboard | ef70688ae2e9ba54bd791abf57e4951db8775481 | [
"Apache-2.0"
] | 8 | 2019-11-07T08:31:53.000Z | 2021-05-29T23:32:58.000Z | import React, { Component } from 'react';
import Stat from './stat';
import Button from './button';
import { ReactComponent as IconGraph } from '../images/icons/graph.svg';
import { ReactComponent as IconMap } from '../images/icons/map.svg';
import { ReactComponent as IconNumbers } from '../images/icons/numbers.svg';
class KeyIndicator extends Component {
static defaultProps = {
displayTitle: true
}
render() {
const selectedColor = this.props.selected === 'color' || this.props.selected === 'both';
const selectedCircle = this.props.selected === 'circle' || this.props.selected === 'both';
return (
<div className="key-indicator">
<div className={`key-indicator__indicator ${this.props.selected ? 'selected' : ''} ${this.props.mapButtons ? 'key-indicator__indicator--map-buttons' : ''}`}
onClick={() => this.props.mapButtons ? null : this.props.onClick(this.props.data)}>
<div className={`key-indicator__indicator__bar ${this.props.selected ? 'selected' : ''}`}/>
{
this.props.mapButtons ?
<div className="key-indicator__buttons key-indicator__buttons--fixed button-group">
<Button selected={selectedColor}
onClick={() => this.props.onClick(this.props.data, 'color')}
className="button--center">
<IconMap className={`icon ${selectedColor ? 'icon--blue' : ''}`} />
</Button>
<Button selected={selectedCircle}
onClick={() => this.props.onClick(this.props.data, 'circle')}
className="button--center">
<IconNumbers className={`icon ${selectedCircle ? 'icon--blue' : ''}`} />
</Button>
</div>
: null
}
{
!this.props.mapButtons ?
<div className="key-indicator__buttons key-indicator__buttons--fixed button-group">
<Button selected={this.props.selected}
onClick={() => this.props.onClick(this.props.data)}
className="button--center">
<IconGraph className={`icon ${this.props.selected ? 'icon--blue' : ''}`} />
</Button>
</div>
: null
}
<div>
{
this.props.displayTitle ?
<p className="key-indicator__title">{ this.props.data.title }</p>
: null
}
<Stat data={this.props.data} />
</div>
</div>
{
this.props.children ?
<div className="key-indicator__supporting-data">
{ this.props.children}
</div>
: null
}
</div>
)
}
}
export default KeyIndicator;
| 38.260274 | 164 | 0.543502 |
1e37ec4e2a30c90f2b63a6f28db7a59071345173 | 1,959 | js | JavaScript | themes/docsy/assets/vendor/Font-Awesome/js-packages/@fortawesome/free-regular-svg-icons/faHandPointer.js | huangjunxin/jyutping.org | 346ac740614fe4635164b868548bc2ee8f184609 | [
"CC0-1.0"
] | 29 | 2020-09-29T14:47:32.000Z | 2022-02-22T12:05:10.000Z | themes/docsy/assets/vendor/Font-Awesome/js-packages/@fortawesome/free-regular-svg-icons/faHandPointer.js | huangjunxin/jyutping.org | 346ac740614fe4635164b868548bc2ee8f184609 | [
"CC0-1.0"
] | 7 | 2019-12-22T14:36:04.000Z | 2022-02-18T08:55:18.000Z | bower_components/font-awesome/js-packages/@fortawesome/free-regular-svg-icons/faHandPointer.js | zutheme/dichvu | be7cddb02d39511ddecde3c50f54f3ecf581e1dc | [
"MIT"
] | 12 | 2020-07-29T10:26:48.000Z | 2022-03-14T02:38:38.000Z | 'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var prefix = 'far';
var iconName = 'hand-pointer';
var width = 448;
var height = 512;
var ligatures = [];
var unicode = 'f25a';
var svgPathData = 'M358.182 179.361c-19.493-24.768-52.679-31.945-79.872-19.098-15.127-15.687-36.182-22.487-56.595-19.629V67c0-36.944-29.736-67-66.286-67S89.143 30.056 89.143 67v161.129c-19.909-7.41-43.272-5.094-62.083 8.872-29.355 21.795-35.793 63.333-14.55 93.152l109.699 154.001C134.632 501.59 154.741 512 176 512h178.286c30.802 0 57.574-21.5 64.557-51.797l27.429-118.999A67.873 67.873 0 0 0 448 326v-84c0-46.844-46.625-79.273-89.818-62.639zM80.985 279.697l27.126 38.079c8.995 12.626 29.031 6.287 29.031-9.283V67c0-25.12 36.571-25.16 36.571 0v175c0 8.836 7.163 16 16 16h6.857c8.837 0 16-7.164 16-16v-35c0-25.12 36.571-25.16 36.571 0v35c0 8.836 7.163 16 16 16H272c8.837 0 16-7.164 16-16v-21c0-25.12 36.571-25.16 36.571 0v21c0 8.836 7.163 16 16 16h6.857c8.837 0 16-7.164 16-16 0-25.121 36.571-25.16 36.571 0v84c0 1.488-.169 2.977-.502 4.423l-27.43 119.001c-1.978 8.582-9.29 14.576-17.782 14.576H176c-5.769 0-11.263-2.878-14.697-7.697l-109.712-154c-14.406-20.223 14.994-42.818 29.394-22.606zM176.143 400v-96c0-8.837 6.268-16 14-16h6c7.732 0 14 7.163 14 16v96c0 8.837-6.268 16-14 16h-6c-7.733 0-14-7.163-14-16zm75.428 0v-96c0-8.837 6.268-16 14-16h6c7.732 0 14 7.163 14 16v96c0 8.837-6.268 16-14 16h-6c-7.732 0-14-7.163-14-16zM327 400v-96c0-8.837 6.268-16 14-16h6c7.732 0 14 7.163 14 16v96c0 8.837-6.268 16-14 16h-6c-7.732 0-14-7.163-14-16z';
exports.definition = {
prefix: prefix,
iconName: iconName,
icon: [
width,
height,
ligatures,
unicode,
svgPathData
]};
exports.faHandPointer = exports.definition;
exports.prefix = prefix;
exports.iconName = iconName;
exports.width = width;
exports.height = height;
exports.ligatures = ligatures;
exports.unicode = unicode;
exports.svgPathData = svgPathData; | 67.551724 | 1,340 | 0.708014 |
1e3869f6e766c1855bbb87eb1347adfe30526ca5 | 255 | js | JavaScript | assets/js/initialize.js | Interna1ta/jquery-cheat-sheet | 3f73303380d0138bffe885429f7720c3079c01b3 | [
"MIT"
] | null | null | null | assets/js/initialize.js | Interna1ta/jquery-cheat-sheet | 3f73303380d0138bffe885429f7720c3079c01b3 | [
"MIT"
] | null | null | null | assets/js/initialize.js | Interna1ta/jquery-cheat-sheet | 3f73303380d0138bffe885429f7720c3079c01b3 | [
"MIT"
] | null | null | null | 'use strict';
renderSection(arrayEvents, 'events');
renderSection(arrayFunctions, 'functions');
renderSection(arraySelectors, 'selectors');
renderNav(arrayEvents, 'events')
renderNav(arrayFunctions, 'functions');
renderNav(arraySelectors, 'selectors');
| 25.5 | 43 | 0.788235 |
1e394bc7b895f2fde2fceaef8f19a66b3a00925c | 14,977 | js | JavaScript | src/pages/Register.js | DeepikaMarkam/correctheader | 967bac1409b5ef6cfb053ec1eaf3e113764602b1 | [
"Xnet",
"X11"
] | null | null | null | src/pages/Register.js | DeepikaMarkam/correctheader | 967bac1409b5ef6cfb053ec1eaf3e113764602b1 | [
"Xnet",
"X11"
] | null | null | null | src/pages/Register.js | DeepikaMarkam/correctheader | 967bac1409b5ef6cfb053ec1eaf3e113764602b1 | [
"Xnet",
"X11"
] | null | null | null | import React from 'react';
//import Footer1 from '../components/global_footer';
import NavBar from '../components/NavBar';
import Footer from '../components/Footer';
// Header from '../components/foot';
// reactstrap components
import {
Button,
FormGroup,
Form,
Input,
InputGroupAddon,
InputGroupText,
InputGroup,
Container,
Row,
Col,
Alert,
ButtonGroup
} from 'reactstrap';
import { Link } from 'react-router-dom';
import axios from 'axios';
import backgroundImage from '../assets/img/icons/common/4.svg';
import {Card, CardBody,CardText, FormControl, FormLabel,FormCheck } from 'react-bootstrap';
class Register extends React.Component {
componentDidMount() {
document.documentElement.scrollTop = 0;
document.scrollingElement.scrollTop = 0;
this.refs.main.scrollTop = 0;
}
constructor(props) {
super(props);
this.state = {
email: '',
password: '',
confirm_password: '',
buttonDisabled: false,
message: '',
isError: '',
visible: false,
fields: {},
errors: {}
}
this.handleChange = this.handleChange.bind(this);
this.onDismiss = this.onDismiss.bind(this);
// this.handleSubmit=this.handleChange.bind(this);
this.validateEmail = this.validateEmail.bind(this);
this.validatePassword = this.validatePassword.bind(this);
this.validateConfirmPassword=this.validateConfirmPassword.bind(this);
this.clearEmailError = this.clearEmailError.bind(this);
this.clearPasswordError = this.clearPasswordError.bind(this);
this.clearConfirmPasswordError=this.clearConfirmPasswordError.bind(this);
this.onSubmitHandler=this.onSubmitHandler.bind(this);
};
onDismiss() {
this.setState({ visible: false, isLogin: '' });
}
handleChange = e => {
let fields = this.state.fields;
fields[e.target.name] = e.target.value;
this.setState({
fields
});
}
clearEmailError = e => {
let fields = this.state.fields;
let errors = this.state.errors;
let formIsValid = true;
//alert("Field name: "+e.target.name)
if(e.target.name=="email"){
errors["email"] = "";
this.setState({
errors: errors
});
return formIsValid;
}
}
clearPasswordError = e => {
let fields = this.state.fields;
let errors = this.state.errors;
let formIsValid = true;
//alert("Field name: "+e.target.name)
if(e.target.name=="password"){
errors["password"] = "";
this.setState({
errors: errors
});
return formIsValid;
}}
clearConfirmPasswordError = e =>{
let fields = this.state.fields;
let errors = this.state.errors;
let formIsValid = true;
if(e.target.name=="confirm_password"){
errors["confirm_password"]= "";
this.setState({
errors:errors
});
return formIsValid;
}
}
validateEmail = e => {
let fields = this.state.fields;
let errors = this.state.errors;
let formIsValid = true;
//alert("Validate Email: "+fields["email"])
if (!fields["email"]) {
//alert("Enter email")
formIsValid = false;
errors["email"] = "Please enter your email-ID.";
this.setState({
errors: errors
});
return formIsValid;
}
if (typeof fields["email"] !== "undefined") {
//alert("Enter valid email")
//Production
//var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
//Development
var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
if (!pattern.test(fields["email"])) {
formIsValid = false;
errors["email"] = "Please enter valid email-ID.";
}
this.setState({
errors: errors
});
return formIsValid;
}
}
validatePassword = e => {
let fields = this.state.fields;
let errors = this.state.errors;
let formIsValid = true;
//alert("Password: "+fields["password"])
if (!fields["password"]) {
//alert("Enter valid password")
formIsValid = false;
errors["password"] = "Please enter your password.";
this.setState({
errors: errors
});
return formIsValid;
}
if (typeof fields["password"] !== "undefined") {
//alert("Enter valid password")
//alert("Password: "+fields["password"])
//Production
//if (!fields["password"].match(/^.*(?=.{8,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).*$/)) {
//Development
if (!fields["password"].match(/^.*(?=.{2,}).*$/)) {
formIsValid = false;
errors["password"] = "Please enter secure and strong password .";
}
this.setState({
errors: errors
});
return formIsValid;
}}
validateConfirmPassword = e => {
let fields = this.state.fields;
let errors = this.state.errors;
let formIsValid = true;
if (fields["password"]!==(fields["confirm_password"])){
formIsValid=false;
errors["confirm_password"]= "Passwords don't match";
}
this.setState({
errors:errors
});
return formIsValid;
}
registerInvalid = () => {
if (this.state.isError === true) {
return (
<Alert
color="danger"
isOpen={this.state.visible}
toggle={this.onDismiss}
style={{ textAlign: 'center' }}
>
{this.state.message}
</Alert>
);
} else {
return (
<>
<Alert
color="success"
isOpen={this.state.visible}
toggle={this.onDismiss}
>
{this.state.message}{' '}
<Link className="mr-7" to="/login">
Login
</Link>
</Alert>
{/* <Redirect to="/dashboard" />; */}
</>
);
}
};
onSubmitHandler = e => {
e.preventDefault();
var validationResult;
validationResult=true;
//this.setState({ buttonDisabled: true });
if (validationResult) {
let fields = this.state.fields
var url =
'https://e9b18385-28b5-414f-b976-a6ea8fdb783a.mock.pstmn.io/api/v1/users/register';
var payload = {
gts_user_email :fields["email"],
gts_user_password :fields["password"],
};
axios
.post(url, payload)
.then(response => {
console.log(response);
let message = response.message;
if (
this.state.message === 'Username already exist.' ||
this.state.message === 'Register failed.'
) {
this.setState({
buttonDisabled: true,
message,
visible: true
});
} else {
this.setState({
buttonDisabled: false,
isError: false,
message: 'Register Success',
visible: true
});
}
})
.catch(error => {
/*
let message = response.message;
console.log("message: "+message);
console.log(error);
if (error.response.data.error === true) {
this.setState({
message: message,
isError: true,
visible: true
});
}
*/
});
}
}
render() {
const errorMessageStyles = {
//backgroundColor: "#f0f",
//fontSize: someSize,
color: "#ff4d4d",
//padding: paddings
}
return (
<>
{/* <DemoNavbar /> */}
<main ref="main">
<section className="section section-shaped section-lg">
<div className="shape shape-style-1 bg-gradient-default">
<span />
<span />
<span />
<span />
<span />
<span />
<span />
<span />
</div>
<NavBar />
<div class="d-flex justify-content-around">
<div Align="left">
<Card border="primary" style={{ width: '18rem' }}>
<Card.Body>
<Card.Text>
<dl>
<dd> By Registering, you are getting:</dd>
<dd> * Access to contact with Trainers and Recruiters</dd>
<dd> * 24*7 Customer Care Support</dd>
<dd> * Message board communication</dd></dl>
</Card.Text>
</Card.Body>
</Card></div>
<Container className="pt-lg-md">
<Row className="justify-content-center mt-7">
<Col lg="5">
<div className="text-center text-muted mb-4">
<h1>Register Below</h1>
</div>
<Form method="post" name="handler" onSubmit={this.onSubmitHandler}>
<FormGroup className="mb-3" controlId="formBasicEmail">
<FormLabel>Enter Email</FormLabel>
<FormControl
type="text"
name="email"
id="email"
className="form-control"
placeholder="John Doe"
value={this.state.fields.email}
onChange={this.handleChange}
onBlur={this.validateEmail}
onFocus={this.clearEmailError}>
</FormControl>
</FormGroup>
<FormGroup className="mb-3">
<div divID="emailError" style={errorMessageStyles}>{this.state.errors.email}</div>
</FormGroup>
<FormGroup className="mb-3" controlId="formBasicPassword">
<FormLabel>Enter Password</FormLabel>
<FormControl
type="password"
name="password"
id="password"
className="form-control"
placeholder="**********"
value={this.state.fields.password}
onChange={this.handleChange}
onBlur={this.validatePassword}
onFocus={this.clearPasswordError} ></FormControl>
</FormGroup >
<FormGroup className="mb-3">
<div divID="passwordError" style={errorMessageStyles}>{this.state.errors.password}</div>
</FormGroup>
<FormGroup className="mb-3" controlId="formBasicPassword">
<FormLabel>Re-enter Password</FormLabel>
<FormControl
type="password"
name="confirm_password"
id="confirm_password"
className="form-control"
placeholder="**********"
value={this.state.fields.confirm_password}
onChange={this.handleChange}
onBlur={this.validateConfirmPassword}
onFocus={this.clearConfirmPasswordError}></FormControl>
</FormGroup>
<FormGroup className="mb-3">
<div divID="confirmpasswordError" style={errorMessageStyles}>{this.state.errors.confirm_password}</div>
</FormGroup>
<div className="text-center">
<Button className="mt-4" color="info" type="submit">
Register
</Button>
</div>
<div>
<Col>
<div>{this.registerInvalid()}</div>
</Col>
</div>
</Form>
</Col>
</Row>
</Container>
<div Align="right">
<dl>
<dd>Select Role(You can have multiple, but please state one role as your default as well):</dd>
</dl>
<div class="wrapper">
<FormGroup>
<ButtonGroup>
<div className=" checkbox">
<label>
<input type="checkbox" value="option1" checked={true} />
JobSeeker
</label>
</div>
<br/>
<div className="checkbox">
<label>
<input type="checkbox" value="option1" />
Employer
</label>
</div>
<br/>
<div className="checkbox">
<label>
<input type="checkbox" value="option1" />
Recruiter
</label>
</div>
<br/>
<div className="checkbox">
<label>
<input type="checkbox" value="option1" />
Trainer
</label>
</div></ButtonGroup></FormGroup></div>
<div class="wrapper">
<FormGroup>
<ButtonGroup>
<div className="radio">
<label>
<input type="radio" value="option1" checked={true} />
default
</label>
</div>
<div className="radio">
<div className="column">
<label>
<input type="radio" value="option1" />
default
</label>
</div></div>
<div className="radio">
<label>
<input type="radio" value="option1" />
default
</label>
</div>
<div className="radio">
<label>
<input type="radio" value="option1" />
default
</label>
</div>
</ButtonGroup>
</FormGroup>
</div>
</div>
</div>
{/* <Footer1 /> */}
</section>
</main>
{/* <SimpleFooter /> */}
<Footer/>
</>
);
}
}
const bgImage = {
backgroundSize: 'contain',
backgroundPosition: 'center',
backgroundRepeat: 'no-repeat',
backgroundImage: `url(${backgroundImage})`
};
export default Register;
| 28.311909 | 324 | 0.473993 |
1e3951d9436755c35d53c759f5a5264a3b005981 | 1,774 | js | JavaScript | hispanoFail/node_modules/ionic-native/dist/esm/plugins/filepath.js | Relabtive/hispanoFail | e24961fa14cdeffdabcafcb272adc75126b8349a | [
"MIT"
] | 7 | 2017-05-22T13:46:06.000Z | 2021-02-21T12:13:38.000Z | hispanoFail/node_modules/ionic-native/dist/esm/plugins/filepath.js | Relabtive/hispanoFail | e24961fa14cdeffdabcafcb272adc75126b8349a | [
"MIT"
] | null | null | null | hispanoFail/node_modules/ionic-native/dist/esm/plugins/filepath.js | Relabtive/hispanoFail | e24961fa14cdeffdabcafcb272adc75126b8349a | [
"MIT"
] | 4 | 2017-01-23T17:07:00.000Z | 2017-04-24T14:24:21.000Z | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { Plugin, Cordova } from './plugin';
/**
* @name FilePath
* @description
*
* This plugin allows you to resolve the native filesystem path for Android content URIs and is based on code in the aFileChooser library.
*
* @usage
* ```
* import {FilePath} from 'ionic-native';
*
* FilePath.resolveNativePath(path)
* .then(filePath => console.log(filePath);
* .catch(err => console.log(err);
*
* ```
*/
export var FilePath = (function () {
function FilePath() {
}
/**
* Resolve native path for given content URL/path.
* @param {String} path Content URL/path.
* @returns {Promise<string>}
*/
FilePath.resolveNativePath = function (path) { return; };
__decorate([
Cordova()
], FilePath, "resolveNativePath", null);
FilePath = __decorate([
Plugin({
pluginName: 'FilePath',
plugin: 'cordova-plugin-filepath',
pluginRef: 'window.FilePath',
repo: 'https://github.com/hiddentao/cordova-plugin-filepath',
platforms: ['Android']
})
], FilePath);
return FilePath;
}());
//# sourceMappingURL=filepath.js.map | 37.744681 | 151 | 0.59301 |
1e399e082e63b7e9f97d2be04bae0e9b3063f671 | 558 | js | JavaScript | web/src/pages/projects/projects.test.js | danggrianto/testoment | d0ab8aa23a4bc87e79cb98a1e5a63ad32d9ed3fe | [
"MIT"
] | null | null | null | web/src/pages/projects/projects.test.js | danggrianto/testoment | d0ab8aa23a4bc87e79cb98a1e5a63ad32d9ed3fe | [
"MIT"
] | 3 | 2021-03-10T12:07:36.000Z | 2022-02-18T23:33:27.000Z | web/src/pages/projects/projects.test.js | danggrianto/testoment | d0ab8aa23a4bc87e79cb98a1e5a63ad32d9ed3fe | [
"MIT"
] | null | null | null | import React from 'react';
import {shallow} from 'enzyme';
import Projects from './projects';
describe('Projects Page', () => {
let wrapper;
beforeEach(() => (wrapper = shallow(<Projects />)));
it('should render title Projects', function() {
expect(wrapper.find('h1').text()).toEqual('Projects');
});
it('should render Projects component', function() {
expect(wrapper.find('projects').length).toEqual(1);
});
it('should render addProject component', function() {
expect(wrapper.find('addProject').length).toEqual(1);
});
});
| 25.363636 | 58 | 0.65233 |
1e39a8c4aa385e339cd739ef8de6f5236c6cabe2 | 385 | js | JavaScript | config/helpers/environmentConfigResolver.js | aol/aol-hb.js | 28b6554af72a32ea11096b662b513a9b2aa638d1 | [
"BSD-3-Clause"
] | 5 | 2016-12-01T15:19:26.000Z | 2021-03-26T04:23:13.000Z | config/helpers/environmentConfigResolver.js | ConnectionMaster/aol-hb.js | 28b6554af72a32ea11096b662b513a9b2aa638d1 | [
"BSD-3-Clause"
] | 7 | 2016-12-01T11:18:28.000Z | 2017-03-20T14:30:31.000Z | config/helpers/environmentConfigResolver.js | ConnectionMaster/aol-hb.js | 28b6554af72a32ea11096b662b513a9b2aa638d1 | [
"BSD-3-Clause"
] | 2 | 2016-12-15T21:48:32.000Z | 2019-04-25T18:06:20.000Z | const resolver = {
resolveKarmaBrowsers: function() {
return resolver.isTravisEnvironment() ? ['CHROME_TRAVIS_CI'] : ['Chrome'];
},
resolveNightWatchConfig: function() {
return 'nightwatch.' + (resolver.isTravisEnvironment() ? 'config.travis' : 'config.default');
},
isTravisEnvironment: function() {
return process.env.TRAVIS;
}
};
module.exports = resolver;
| 27.5 | 97 | 0.688312 |
1e39b5d78b18f6878dc6482c026441d8e25d3094 | 4,146 | js | JavaScript | jstests/sharding/libs/sharded_index_util.js | benety/mongo | 203430ac9559f82ca01e3cbb3b0e09149fec0835 | [
"Apache-2.0"
] | null | null | null | jstests/sharding/libs/sharded_index_util.js | benety/mongo | 203430ac9559f82ca01e3cbb3b0e09149fec0835 | [
"Apache-2.0"
] | null | null | null | jstests/sharding/libs/sharded_index_util.js | benety/mongo | 203430ac9559f82ca01e3cbb3b0e09149fec0835 | [
"Apache-2.0"
] | null | null | null | /*
* Utilities for checking indexes on shards.
*/
var ShardedIndexUtil = (function() {
/*
* Asserts that the shard has an index for the collection with the given index key.
*/
let assertIndexExistsOnShard = function(shard, dbName, collName, targetIndexKey) {
let res = shard.getDB(dbName).runCommand({listIndexes: collName});
assert.commandWorked(res);
let indexesOnShard = res.cursor.firstBatch;
const isTargetIndex = (index) => bsonWoCompare(index.key, targetIndexKey) === 0;
assert(indexesOnShard.some(isTargetIndex),
`expected shard ${shard.shardName} to have the index ${tojson(targetIndexKey)}`);
};
/*
* Asserts that the shard does not have an index for the collection with the given index key.
*/
let assertIndexDoesNotExistOnShard = function(shard, dbName, collName, targetIndexKey) {
let res = shard.getDB(dbName).runCommand({listIndexes: collName});
if (!res.ok && res.code === ErrorCodes.NamespaceNotFound) {
// The collection does not exist on the shard, neither does the target index.
return;
}
assert.commandWorked(res);
let indexesOnShard = res.cursor.firstBatch;
indexesOnShard.forEach(function(index) {
assert.neq(0,
bsonWoCompare(index.key, targetIndexKey),
`expected shard ${shard.shardName} to not have the index ${
tojson(targetIndexKey)}`);
});
};
/*
* Returns true if the array contains the given BSON object, ignoring the field order
*/
let containsBSONIgnoreFieldsOrder = function(arr, targetObj) {
for (const obj of arr) {
if (bsonUnorderedFieldsCompare(obj, targetObj) === 0) {
return true;
}
}
return false;
};
let getPerShardIndexes = function(coll) {
return coll
.aggregate(
[
{$indexStats: {}},
{$group: {_id: "$shard", indexes: {$push: {spec: "$spec"}}}},
{$project: {_id: 0, shard: "$_id", indexes: 1}}
],
{readConcern: {level: "local"}})
.toArray();
};
/*
* Given an array of objects which contain a shard name and a list of indexes belonging to
* that shard (see example below), returns a map of shards to a list of their inconsistent
* indexes, that is, any indexes which do not exist on all other shards.
*
* For example:
* [{"shard" : "rs0",
* "indexes" : [{"spec" : {"v" : 2, "key" : {"_id" : 1}, "name" : "_id_"}},
* {"spec" : {"v" : 2, "key" : {"x" : 1}, "name" : "x_1"}}]},
* {"shard" : "rs1",
* "indexes" : [{"spec" : {"v" : 2, "key" : {"_id" :1}, "name" : "_id_"}}]}];
*/
let findInconsistentIndexesAcrossShards = function(indexDocs) {
// Find indexes that exist on all shards. For the example above:
// [{"spec" : {"v" : 2, "key" : {"_id" : 1}, "name" : "_id_"}}];
let consistentIndexes = indexDocs[0].indexes;
for (let i = 1; i < indexDocs.length; i++) {
consistentIndexes = consistentIndexes.filter(
index => this.containsBSONIgnoreFieldsOrder(indexDocs[i].indexes, index));
}
// Find inconsistent indexes. For the example above:
// {"rs0": [{"spec" : {"v" : 2, "key" : {"x" : 1}, "name" : "x_1"}}], "rs1" : []};
const inconsistentIndexesOnShard = {};
for (const indexDoc of indexDocs) {
const inconsistentIndexes = indexDoc.indexes.filter(
index => !this.containsBSONIgnoreFieldsOrder(consistentIndexes, index));
inconsistentIndexesOnShard[indexDoc.shard] = inconsistentIndexes;
}
return inconsistentIndexesOnShard;
};
return {
assertIndexExistsOnShard,
assertIndexDoesNotExistOnShard,
containsBSONIgnoreFieldsOrder,
getPerShardIndexes,
findInconsistentIndexesAcrossShards
};
})();
| 40.252427 | 97 | 0.568017 |
1e39bd514f9d4076eea70cd97d5dc674a42388f2 | 138 | js | JavaScript | doxygen/html/search/functions_62.js | mikewolfli/workflow | 98ad4a2a822aae774355c03cb1eea5cc97d986b8 | [
"Unlicense"
] | 3 | 2016-05-30T05:39:52.000Z | 2017-11-10T07:26:53.000Z | doxygen/html/search/functions_62.js | mikewolfli/workflow | 98ad4a2a822aae774355c03cb1eea5cc97d986b8 | [
"Unlicense"
] | null | null | null | doxygen/html/search/functions_62.js | mikewolfli/workflow | 98ad4a2a822aae774355c03cb1eea5cc97d986b8 | [
"Unlicense"
] | 1 | 2020-01-02T01:05:01.000Z | 2020-01-02T01:05:01.000Z | var searchData=
[
['backendpid',['BackendPID',['../classwx_postgre_s_q_l.html#ae24ee99a34b56b495f6ba4ef441ae5a9',1,'wxPostgreSQL']]]
];
| 27.6 | 116 | 0.753623 |
1e39d32654dcc031528066c859bd71f44f16eb07 | 2,412 | js | JavaScript | webpack.prod.config.js | edil3ra/spherebreak | 1db522ce10562250a3c11ec7385ff1b0e55fd218 | [
"MIT"
] | null | null | null | webpack.prod.config.js | edil3ra/spherebreak | 1db522ce10562250a3c11ec7385ff1b0e55fd218 | [
"MIT"
] | null | null | null | webpack.prod.config.js | edil3ra/spherebreak | 1db522ce10562250a3c11ec7385ff1b0e55fd218 | [
"MIT"
] | null | null | null | const webpack = require('webpack')
const path = require('path')
const TerserPlugin = require('terser-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const pathToPhaser = path.join(__dirname, "/node_modules/phaser/")
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const phaser = path.join(pathToPhaser, "dist/phaser.js")
module.exports = {
mode: 'production',
entry: {
'js/app': [
path.resolve(__dirname, 'src/main.ts')
],
},
output: {
path: path.resolve(__dirname, 'public'),
publicPath: '',
filename: '[name].[hash].js',
chunkFilename: '[name].[hash].js'
},
resolve: {
extensions: ['.ts', '.js'],
alias: {
phaser: phaser,
"~": path.resolve(__dirname, 'src'),
}
},
module: {
rules: [{
test: /\.ts?$/,
use: {
loader: 'ts-loader',
options: {
configFile: "tsconfig.json"
},
},
exclude: [
path.resolve(__dirname, "typings"),
path.resolve(__dirname, "node_modules"),
],
}, {
test: /\.scss$/,
use: [
MiniCssExtractPlugin.loader,
{
loader: 'css-loader'
},
{
loader: 'sass-loader',
options: {
sourceMap: false,
}
}
]
}]
},
optimization: {
minimize: true,
minimizer: [new TerserPlugin()],
splitChunks: {
cacheGroups: {
'js/vendor': {
test: /[\\/]node_modules[\\/]/,
name: "js/vendor",
chunks: "all"
}
}
}
},
plugins: [
new HtmlWebpackPlugin({
title: 'Spherebreak',
template: 'src/index.ejs',
filename: 'index.html',
scriptLoading: 'defer',
}),
new webpack.EnvironmentPlugin({
DEBUG: process.env.DEBUG || false
}),
new MiniCssExtractPlugin({filename: 'css/mystyles.css'}),
]
}
| 28.046512 | 85 | 0.454395 |
1e39e20b01da203041b806d96640323b3d86857a | 39 | js | JavaScript | ui/src/pages/Player/AddPlayer/index.js | kidrecursive/astra-sketch | c846745e0be76819ddf98ba81f1f196e99fed2d9 | [
"Apache-2.0"
] | null | null | null | ui/src/pages/Player/AddPlayer/index.js | kidrecursive/astra-sketch | c846745e0be76819ddf98ba81f1f196e99fed2d9 | [
"Apache-2.0"
] | 7 | 2021-11-16T17:50:23.000Z | 2021-12-01T13:27:18.000Z | ui/src/pages/Player/AddPlayer/index.js | kidrecursive/astra-sketch | c846745e0be76819ddf98ba81f1f196e99fed2d9 | [
"Apache-2.0"
] | 1 | 2021-11-19T21:53:40.000Z | 2021-11-19T21:53:40.000Z | export { default } from "./AddPlayer";
| 19.5 | 38 | 0.666667 |
1e3a63be060fe9511f12709d4efcbe6dc581bb43 | 261 | js | JavaScript | blog-sys-research/amdxg-blog/amdxg.config.js | amano--/examples | 02f9fe2af87b7fd808a671bc6dfde78046ab8451 | [
"Apache-2.0"
] | null | null | null | blog-sys-research/amdxg-blog/amdxg.config.js | amano--/examples | 02f9fe2af87b7fd808a671bc6dfde78046ab8451 | [
"Apache-2.0"
] | 6 | 2020-12-20T08:48:56.000Z | 2022-02-17T20:58:17.000Z | blog-sys-research/amdxg-blog/amdxg.config.js | amano--/sandbox | 02f9fe2af87b7fd808a671bc6dfde78046ab8451 | [
"Apache-2.0"
] | null | null | null | module.exports = {
host: "https://amano--.github.io/blog",
siteName: "mytest-blog",
author: "amano--",
authorLink: "https://twitter.com",
lang: "ja",
repository: "",
socialShare: {
twitter: true,
hatena: false,
facebook: true,
},
};
| 18.642857 | 41 | 0.590038 |
1e3ab0cbe7e602337b661f129a50c9f16551edb0 | 4,736 | js | JavaScript | node_modules/@tensorflow/tfjs-core/dist/test_util.js | ofuen/TensorFlowJSExample | 9377837f1773f4e289f22a522f89d69eb395258a | [
"MIT"
] | 2 | 2020-09-03T01:37:57.000Z | 2020-09-03T01:38:15.000Z | node_modules/@tensorflow/tfjs-core/dist/test_util.js | ofuen/TensorFlowJSExample | 9377837f1773f4e289f22a522f89d69eb395258a | [
"MIT"
] | null | null | null | node_modules/@tensorflow/tfjs-core/dist/test_util.js | ofuen/TensorFlowJSExample | 9377837f1773f4e289f22a522f89d69eb395258a | [
"MIT"
] | 2 | 2019-03-24T10:59:11.000Z | 2021-05-14T01:34:37.000Z | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var environment_1 = require("./environment");
var tensor_1 = require("./tensor");
var util = require("./util");
var util_1 = require("./util");
exports.WEBGL_ENVS = {
'HAS_WEBGL': true
};
exports.NODE_ENVS = {
'IS_NODE': true
};
exports.CHROME_ENVS = {
'IS_CHROME': true
};
exports.BROWSER_ENVS = {
'IS_BROWSER': true
};
exports.CPU_ENVS = {
'HAS_WEBGL': false
};
exports.ALL_ENVS = {};
function expectArraysClose(actual, expected, epsilon) {
if (epsilon == null) {
epsilon = environment_1.ENV.get('TEST_EPSILON');
}
return expectArraysPredicate(actual, expected, function (a, b) { return areClose(a, Number(b), epsilon); });
}
exports.expectArraysClose = expectArraysClose;
function expectArraysPredicate(actual, expected, predicate) {
if (!(actual instanceof tensor_1.Tensor) && !(expected instanceof tensor_1.Tensor)) {
var aType = actual.constructor.name;
var bType = expected.constructor.name;
if (aType !== bType) {
throw new Error("Arrays are of different type actual: " + aType + " " +
("vs expected: " + bType));
}
}
else if (actual instanceof tensor_1.Tensor && expected instanceof tensor_1.Tensor) {
if (actual.dtype !== expected.dtype) {
throw new Error("Arrays are of different type actual: " + actual.dtype + " " +
("vs expected: " + expected.dtype + "."));
}
if (!util.arraysEqual(actual.shape, expected.shape)) {
throw new Error("Arrays are of different shape actual: " + actual.shape + " " +
("vs expected: " + expected.shape + "."));
}
}
var actualValues;
var expectedValues;
if (actual instanceof tensor_1.Tensor) {
actualValues = actual.dataSync();
}
else {
actualValues = actual;
}
if (expected instanceof tensor_1.Tensor) {
expectedValues = expected.dataSync();
}
else {
expectedValues = expected;
}
if (actualValues.length !== expectedValues.length) {
throw new Error("Arrays have different lengths actual: " + actualValues.length + " vs " +
("expected: " + expectedValues.length + ".\n") +
("Actual: " + actualValues + ".\n") +
("Expected: " + expectedValues + "."));
}
for (var i = 0; i < expectedValues.length; ++i) {
var a = actualValues[i];
var e = expectedValues[i];
if (!predicate(a, e)) {
throw new Error("Arrays differ: actual[" + i + "] = " + a + ", expected[" + i + "] = " + e + ".\n" +
("Actual: " + actualValues + ".\n") +
("Expected: " + expectedValues + "."));
}
}
}
function expectPromiseToFail(fn, done) {
fn().then(function () { return done.fail(); }, function () { return done(); });
}
exports.expectPromiseToFail = expectPromiseToFail;
function expectArraysEqual(actual, expected) {
if (actual instanceof tensor_1.Tensor && actual.dtype === 'string' ||
expected instanceof tensor_1.Tensor && expected.dtype === 'string' ||
actual instanceof Array && util_1.isString(actual[0]) ||
expected instanceof Array && util_1.isString(expected[0])) {
return expectArraysPredicate(actual, expected, function (a, b) { return a == b; });
}
return expectArraysClose(actual, expected, 0);
}
exports.expectArraysEqual = expectArraysEqual;
function expectNumbersClose(a, e, epsilon) {
if (epsilon == null) {
epsilon = environment_1.ENV.get('TEST_EPSILON');
}
if (!areClose(a, e, epsilon)) {
throw new Error("Numbers differ: actual === " + a + ", expected === " + e);
}
}
exports.expectNumbersClose = expectNumbersClose;
function areClose(a, e, epsilon) {
if (isNaN(a) && isNaN(e)) {
return true;
}
if (isNaN(a) || isNaN(e) || Math.abs(a - e) > epsilon) {
return false;
}
return true;
}
function expectValuesInRange(actual, low, high) {
var actualVals;
if (actual instanceof tensor_1.Tensor) {
actualVals = actual.dataSync();
}
else {
actualVals = actual;
}
for (var i = 0; i < actualVals.length; i++) {
if (actualVals[i] < low || actualVals[i] > high) {
throw new Error("Value out of range:" + actualVals[i] + " low: " + low + ", high: " + high);
}
}
}
exports.expectValuesInRange = expectValuesInRange;
function expectArrayBuffersEqual(actual, expected) {
expect(new Float32Array(actual)).toEqual(new Float32Array(expected));
}
exports.expectArrayBuffersEqual = expectArrayBuffersEqual;
//# sourceMappingURL=test_util.js.map | 36.430769 | 112 | 0.60473 |
1e3ab4848d60117db3b6f90f1170323cd7509488 | 552 | js | JavaScript | ExperimentC/trial-2/purchase/config/webpack.prod.js | awarenessxz/react-micro-frontend | 81398c0671e76bec5d543cc691b0826ff56e70b2 | [
"MIT"
] | null | null | null | ExperimentC/trial-2/purchase/config/webpack.prod.js | awarenessxz/react-micro-frontend | 81398c0671e76bec5d543cc691b0826ff56e70b2 | [
"MIT"
] | null | null | null | ExperimentC/trial-2/purchase/config/webpack.prod.js | awarenessxz/react-micro-frontend | 81398c0671e76bec5d543cc691b0826ff56e70b2 | [
"MIT"
] | null | null | null | const { merge } = require("webpack-merge");
const app = require('./wp-config');
const util = require('./wp-config-util');
const baseConfig = require('./webpack.common');
module.exports = merge([
baseConfig,
{
mode: "production",
output: {
path: app.paths.build,
//chunkFilename: '[name].[chunkhash].js',
//filename: '[name][chunkhash].js'
},
},
util.clean(app.paths.build),
util.minifyCSS(),
util.generateSourceMap({ type: 'source-map' }),
util.loadCSS(true)
]);
| 26.285714 | 53 | 0.570652 |
1e3ba50145f6589cf9120887550588b1886ad8ad | 472 | js | JavaScript | manager-frontend/src/pages/Orders/styles.js | henriquecouto/pack-food | 7375df0927417fc60e5c0304601d139689cb154f | [
"MIT"
] | 1 | 2022-02-21T13:51:39.000Z | 2022-02-21T13:51:39.000Z | manager-frontend/src/pages/Orders/styles.js | henriquecouto/pack-food | 7375df0927417fc60e5c0304601d139689cb154f | [
"MIT"
] | 1 | 2022-03-04T18:34:38.000Z | 2022-03-04T18:34:38.000Z | manager-frontend/src/pages/Orders/styles.js | henriquecouto/pack-food | 7375df0927417fc60e5c0304601d139689cb154f | [
"MIT"
] | 1 | 2021-11-26T23:04:11.000Z | 2021-11-26T23:04:11.000Z | import styled from 'styled-components';
export const TitleSection = styled.div`
max-width: 1300px;
margin: 2% auto;
padding: 0 15px;
`;
export const OrdersContainer = styled.div`
max-width: 1300px;
margin: 2% auto;
display: flex;
flex-direction: row;
flex-wrap: wrap;
/* justify-content: center; */
background-color: white;
/* .order-container {
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
grid-template-rows: auto;
} */
`;
| 18.88 | 42 | 0.669492 |
1e3dc80c12fe475622d9f7b33c1b8a7b331511d5 | 13,912 | js | JavaScript | public/component---node-modules-vtex-gatsby-theme-vtex-src-templates-product-tsx-185ac4d14aab5bb2a4be.js | vwraposo/netlify-test | 9ed15a816c7e2b97c9d7d941e2c182ad112863ef | [
"MIT"
] | null | null | null | public/component---node-modules-vtex-gatsby-theme-vtex-src-templates-product-tsx-185ac4d14aab5bb2a4be.js | vwraposo/netlify-test | 9ed15a816c7e2b97c9d7d941e2c182ad112863ef | [
"MIT"
] | null | null | null | public/component---node-modules-vtex-gatsby-theme-vtex-src-templates-product-tsx-185ac4d14aab5bb2a4be.js | vwraposo/netlify-test | 9ed15a816c7e2b97c9d7d941e2c182ad112863ef | [
"MIT"
] | 1 | 2020-11-14T17:18:05.000Z | 2020-11-14T17:18:05.000Z | (window.webpackJsonp=window.webpackJsonp||[]).push([[12],{"4H2T":function(e,t,a){"use strict";var n=a("q1tI"),r=a.n(n),i=a("izhR"),c={fill:"none",width:"25",height:"25",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"};t.a=function(e){return r.a.createElement(i.d,Object.assign({},e,{as:"button",variant:e.variant+".arrow.right.button"}),r.a.createElement(i.d,Object.assign({as:"svg"},c,{variant:e.variant+".arrow.right.svg"}),r.a.createElement("use",{href:"#nav-thin-caret--right",xlinkHref:"#nav-thin-caret--right"},r.a.createElement("g",{id:"nav-thin-caret--right"},r.a.createElement("path",{d:"M5 15L12 8L5 1",stroke:"currentColor",strokeWidth:"2",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"})))))}},L2eo:function(e,t,a){"use strict";var n=a("q1tI"),r=a("2A+t"),i=a("izhR");t.a=function(e){var t=e.variant,a=e.onSelect,c=e.totalPages,l=e.selectedPage,o=Object(n.useMemo)((function(){return Array.from(Array(c).keys())}),[c]);return Object(r.b)(i.d,{variant:t+".paginationDots.container",role:"group","aria-label":"Slider pagination dots"},o.map((function(e){var n=e===l;return Object(r.b)(i.d,{variant:t+".paginationDots."+(n?"activeDot":"dot"),key:e,tabIndex:0,onKeyDown:function(){return a(e)},onClick:function(){return a(e)},role:"button","aria-label":"Dot "+(e+1)+" of "+c,"data-testid":"paginationDot"})})))}},lEwM:function(e,t,a){"use strict";a.r(t),a.d(t,"query",(function(){return pe}));var n=a("q1tI"),r=a.n(n),i=a("4hiV"),c=a("yq/Q"),l=a("rulN"),o=a("R0sn"),u=a("zvcV"),s=a("2A+t"),m=a("izhR"),d=a("vEvf"),p=function(e){return Object(s.b)(d.a,Object.assign({backgroundColor:"transparent",color:"black","aria-label":"Previous Product Image"},e))},g=a("4H2T"),f=function(e){return Object(s.b)(g.a,Object.assign({backgroundColor:"transparent",color:"black","aria-label":"Next Product Image"},e))},v=a("L2eo").a,h=a("zLVn"),b=function(e){var t=e.targetProps,a=e.placeholderProps,i=e.as,c=void 0===i?"img":i,l=Object(h.a)(e,["targetProps","placeholderProps","as"]),o=Object(n.useState)(a),u=o[0],s=o[1];return Object(n.useEffect)((function(){return s(a)}),[a]),Object(n.useEffect)((function(){if(u.sizes!==t.sizes||u.srcSet!==t.srcSet||u.src!==t.src){var e=new Image;e.onload=function(){return s(t)};for(var a=0,n=["sizes","srcSet","src"];a<n.length;a++){var r=n[a];r in t&&e.setAttribute(r.toLowerCase(),t[r])}}}),[u,t]),r.a.createElement(c,Object.assign({},l,u))},E=function(e){var t=e.match(/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*).*/);return t&&11===t[7].length?t[7]:null},j=function(e){var t,a,n,i,c,l,o=(a=(t=e).loop,n=t.autoplay,i=t.title,c=t.url,l="autoplay="+n+"&loop="+a+"&title="+i+"&enablejsapi=1&iv_load_policy=3&modestbranding=1","https://www.youtube.com/embed/"+E(c)+"?"+l),u=Object.assign({},e,{src:o,frameBorder:0,allowFullScreen:!0});return r.a.createElement(m.d,Object.assign({},u,{as:"iframe"}))},x=function(e){var t=e.variant+".video";return r.a.createElement(m.c,{ratio:1,sx:{paddingTop:"20%"}},r.a.createElement(m.c,{ratio:4/3},r.a.createElement(j,Object.assign({},e,{sx:{width:"100%",height:"100%"},variant:t}))))},w=function(e){var t=e.item,a=e.variant;return"image"===t.type?r.a.createElement(b,Object.assign({},t.props,{variant:a+".img",ratio:1,as:m.b})):r.a.createElement(x,Object.assign({},t.props,{variant:a,url:t.props.src}))},O=function(e){var t=e.allItems,a=e.showArrows,n=void 0===a||a,r=e.showDots,i=void 0===r||r,c=e.autoplay,l=e.autoplayTimeout,o=Object(u.a)({allItems:t,pageSize:1,autoplay:c,autoplayTimeout:l}),d=o.page,g=o.items,h=o.totalPages,b=o.setPage,E=o.setNextPage,j=o.setPreviousPage,x=g[0];return Object(s.b)(m.d,{variant:"productImageGallery"},Object(s.b)(m.d,{variant:"productImageGallery.group"},n&&Object(s.b)(p,{variant:"productImageGallery",onClick:function(){return j()}}),Object(s.b)(w,{variant:"productImageGallery",item:x}),n&&Object(s.b)(f,{variant:"productImageGallery",onClick:function(){return E()}})),i&&Object(s.b)(v,{variant:"productImageGallery",onSelect:b,selectedPage:d,totalPages:h}))},y=a("Cj0F"),P=function(e){var t=e.variant,a=e.children;return r.a.createElement(m.d,{variant:"productDetails."+t+".title",as:"h1"},a)},k=function(e){var t=e.variant,a=e.children;return r.a.createElement(m.d,{variant:"productDetails."+t+".reference"},a)},I=a("YwZP"),S=a("pusE"),C=a("DGpi"),D=[{imageUrl:C.b,imageText:"Product Image"}],z=C.a[C.a.length-1].widthStr,T=C.a[C.a.length-1].heightStr,L=C.a.map((function(e){return e.media})).join(", "),_=a("cmrU"),M=a("KQm4"),U=function(e){var t=e.children;return Object(s.b)(m.d,{sx:{borderColor:"#f3f3f3",borderStyle:"solid",borderWidth:"1px",minWidth:"250px",minHeight:"600px",padding:4}},t)},N=a("gmmj"),q=function(){return r.a.createElement(r.a.Fragment,null,r.a.createElement(N.a,{height:"23px"}),r.a.createElement(N.a,{height:"50px"}),r.a.createElement(N.a,{height:"23px"}),r.a.createElement(N.a,{height:"100px"}),r.a.createElement(N.a,{height:"50px"}),r.a.createElement(N.a,{height:"23px"}),r.a.createElement(N.a,{height:"50px"}),r.a.createElement(N.a,{height:"23px"}))},R=a("6mPD"),V=a("QNvf"),A=function(e){var t=e.variant,a=void 0===t?"productDescription":t,n=e.children;return r.a.createElement(m.k,{variant:a+".title"},n)},H=function(e){var t=e.data,a=e.variant,n=void 0===a?"productDescription":a;return Object(s.b)("div",{dangerouslySetInnerHTML:{__html:t},sx:{variant:n+".description"}})},Q=function(e){var t=e.product.description,a=Object(V.useIntl)().formatMessage;return null==t||""===t?null:r.a.createElement(n.Fragment,null,r.a.createElement(m.i,{variant:"productDescription.container"},r.a.createElement(m.l,{width:"36px",height:"36px",loading:"lazy",src:"https://marinbrasil.myvtexdev.com/assets/faststore/images/product-description___ce58032835db06b74c144ac20449249f.png",alt:"Product Description"}),r.a.createElement(A,null,a({id:"product.description.title"}))),r.a.createElement(H,{data:t}))},G=function(){return Object(s.b)("img",{alt:"logo tramontina",srcSet:"https://marinbrasil.vtexassets.com/assets/faststore/images/tramontina-logo___d264c78c1f9e404a64ce4ac6e38f0205.png 130w, https://marinbrasil.vtexassets.com/assets/faststore/images/tramontina-logo___d264c78c1f9e404a64ce4ac6e38f0205.png?width=342&height=69 342w",src:"https://marinbrasil.vtexassets.com/assets/faststore/images/tramontina-logo___d264c78c1f9e404a64ce4ac6e38f0205.png",height:"26px",width:"130px",loading:"lazy",sx:{my:3}})},B=a("Psuc"),F=a("aZdg"),W=Object(n.lazy)((function(){return Promise.all([a.e(1),a.e(2),a.e(34)]).then(a.bind(null,"LbPh"))})),$=function(e){var t=e.data.vtex.product,a=e.slug,i=t,c=i.productId,l=i.productReference,u=i.productClusters,s=i.productName,d=i.categoryTree,p=void 0===d?[]:d,g=i.items[0],f=g.images,v=g.videos,h=function(e,t,a){return Object(n.useMemo)((function(){var n=e.map((function(e){return{type:"image",props:e}})),r=t.map((function(e){return{type:"video",props:{src:e.videoUrl,title:a}}}));return[].concat(Object(M.a)(n),Object(M.a)(r))}),[e,t])}(function(e){var t=Object(I.useLocation)().state,a=null!=e?e:D;return Object(n.useMemo)((function(){return a.map((function(e,a){var n=e.imageUrl,r=e.imageText,i=null!=n?n:C.b,c=(null==t?void 0:t.fromSummary)&&0===a,l=C.a.map((function(e){var t=e.width,a=e.height;return Object(S.a)(i,t,a)+" "+t+"w"})).join(", "),o=c?Object(S.a)(i,C.c.width,C.c.height):l;return{targetProps:{sizes:L,srcSet:l},placeholderProps:{sizes:c?"(minWidth: 0px) 100vw":L,srcSet:o},src:n,alt:r,loading:"eager",width:z,height:T}}))}),[a])}(f),v,s);return r.a.createElement(o.a,null,r.a.createElement(y.a,{breadcrumb:p,type:"PRODUCT"}),r.a.createElement(m.d,{variant:"productDetails.default.container"},r.a.createElement(G,null),r.a.createElement(P,{variant:"default"},s),r.a.createElement(B.a,{productId:c}),r.a.createElement(m.i,{sx:{justifyContent:"space-between",my:4}},r.a.createElement(k,{variant:"default"},"Cod.: ",l),r.a.createElement(R.a,{productClusters:u})),r.a.createElement(m.j,{my:4,mx:"auto",gap:[0,3],columns:[1,2]},r.a.createElement(O,{allItems:h}),r.a.createElement(U,null,r.a.createElement(_.a,{fallback:r.a.createElement(q,null)},r.a.createElement(W,{slug:a}))))),r.a.createElement(Q,{product:t}))},J=function(){return r.a.createElement(o.a,null,r.a.createElement(m.i,{variant:"productPage.container"},r.a.createElement(N.a,{width:"500px",height:"45px"}),r.a.createElement(m.j,{my:4,mx:"auto",gap:[0,3],columns:[1,2]},r.a.createElement(N.a,{width:"500px",height:"500px"}),r.a.createElement(m.f,null,r.a.createElement(N.a,{width:"500px",height:"20px"}),r.a.createElement(N.a,{width:"500px",height:"20px"}),r.a.createElement(N.a,{width:"500px",height:"20px"}),r.a.createElement(N.a,{width:"500px",height:"20px"})))))},K=function(){return r.a.createElement(F.a,{height:"500px"},r.a.createElement(m.q,null))},X=a("p9/g"),Z=a("GgDe"),Y={query:"query ProductPageQuery($slug: String, $staticPath: Boolean!) {\n vtex {\n product(slug: $slug) @include(if: $staticPath) {\n productReference\n productName\n linkText\n items {\n images {\n imageUrl\n imageText\n }\n videos {\n videoUrl\n }\n itemId\n sellers {\n commercialOffer: commertialOffer {\n price: Price\n availableQuantity: AvailableQuantity\n priceValidUntil: PriceValidUntil\n }\n }\n }\n productClusters {\n name\n }\n description\n brand\n productId\n categoryTree {\n name\n href\n }\n }\n }\n}\n",sha256Hash:"911cda4b215f8e520c356a7fd5f86bcd28039742c9cd2383aa9ecaa23e965b9f",operationName:"ProductPageQuery"},ee=a("8RKT"),te=a("hB3p"),ae=a("jy8r"),ne=a("rid2"),re=a("iTBd"),ie=function(e){var t=function(e,t){return Object(n.useMemo)((function(){if(null===e)return"";var a=e.productName,n=e.items,r=e.description,i=e.brand,c=n[0],l=c.images.map((function(e){return e.imageUrl})),o=function(e,t){var a;return null===(a=e.sellers)||void 0===a?void 0:a.map((function(e){return{"@type":"Offer",price:e.commercialOffer.price,priceCurrency:t,priceValidUntil:""+e.commercialOffer.priceValidUntil,availability:e.commercialOffer.availableQuantity>0?"http://schema.org/InStock":"http://schema.org/OutOfStock"}}))}(c,t);return c&&l&&o&&0!==o.length&&i?{"@context":"https://schema.org/","@type":"Product",name:a,image:l,offers:o,sku:c.itemId,brand:{"@type":"Brand",name:i},description:r}:null}),[e,t])}(e.data.vtex.product,Object(re.a)()[0]);return null==t?null:r.a.createElement(ne.Helmet,{defer:!1,async:!1,script:[{type:"application/ld+json",innerHTML:JSON.stringify(t)}]})},ce=te.a||te.b,le=function(e){var t=Object(n.useState)(ce),a=t[0],i=t[1];return Object(ee.a)((function(){return i(!0)}),[]),a?r.a.createElement(r.a.Fragment,null,r.a.createElement(ae.a,e),r.a.createElement(ie,e)):null},oe=a("A5AQ"),ue=a("WkUc"),se=function(){return Promise.all([a.e(1),a.e(3),a.e(45)]).then(a.bind(null,"hN+9"))},me=Object(n.lazy)(se),de=function(e){var t,a,i,c=e.data,l=e.pageContext,o=e.slug,u=l.staticPath,s=null!==(t=l.slug)&&void 0!==t?t:o,m=Object(Z.a)(Object.assign({},Y,{variables:{slug:s,staticPath:!0},suspense:!0,initialData:u?c:void 0})).data;Object(ue.b)((function(){return[{type:"vtex:pageView",data:{pageUrl:window.location.href,pageTitle:document.title,referrer:document.referrer,accountName:"marinbrasil"}},{type:"vtex:productView",data:{product:null==m?void 0:m.vtex.product}}]}),null!==(a=null==m||null===(i=m.vtex.product)||void 0===i?void 0:i.productId)&&void 0!==a?a:"");var d=Object.assign({},e,{data:m,slug:s});return r.a.createElement(n.Fragment,null,r.a.createElement($,d),r.a.createElement(le,d),r.a.createElement(X.a,{fallback:r.a.createElement(K,null),preloader:se},r.a.createElement(me,d)))},pe="3834292091";t.default=function(e){var t=e.pageContext.staticPath;return r.a.createElement(l.a,null,r.a.createElement(c.a,{isPrerendered:t,fallback:r.a.createElement(J,null)},r.a.createElement(i.a,{fallback:function(e){return r.a.createElement(oe.a,{error:e})}},r.a.createElement(de,e))))}},vEvf:function(e,t,a){"use strict";var n=a("q1tI"),r=a.n(n),i=a("izhR"),c={fill:"none",width:"25",height:"25",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"};t.a=function(e){return r.a.createElement(i.d,Object.assign({},e,{as:"button",variant:e.variant+".arrow.left.button"}),r.a.createElement(i.d,Object.assign({as:"svg"},c,{variant:e.variant+".arrow.left.svg"}),r.a.createElement("use",{href:"#nav-thin-caret--left",xlinkHref:"#nav-thin-caret--left"},r.a.createElement("g",{id:"nav-thin-caret--left"},r.a.createElement("path",{d:"M11 1L4 8L11 15",stroke:"currentColor",strokeWidth:"2",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"})))))}},zvcV:function(e,t,a){"use strict";a.d(t,"a",(function(){return r}));var n=a("q1tI"),r=function(e){var t=e.allItems,a=e.pageSize,r=void 0===a?1:a,i=e.autoplay,c=void 0!==i&&i,l=e.autoplayTimeout,o=void 0===l?1e6:l,u=Math.ceil(t.length/r),s=Object(n.useState)(0),m=s[0],d=s[1],p=m<t.length?m:0;Object(n.useEffect)((function(){return d(0)}),[t.length]);var g,f,v,h=Object(n.useMemo)((function(){return t.slice(p*r,(p+1)*r)}),[t,p,r]),b=Object(n.useCallback)((function(){return d((function(e){return(e+1)%u}))}),[u]),E=Object(n.useCallback)((function(){return d((function(e){return((t=u)-(t-e+1)%t)%t;var t}))}),[u]);return g=function(){c&&b()},f=o,v=Object(n.useRef)(),Object(n.useEffect)((function(){v.current=g}),[g]),Object(n.useEffect)((function(){if(null!==f){var e=setInterval((function(){var e;return null==v||null===(e=v.current)||void 0===e?void 0:e.call(v)}),f);return function(){return clearInterval(e)}}return function(){}}),[f]),{totalPages:u,items:h,page:p,setPage:d,setNextPage:b,setPreviousPage:E}}}}]);
//# sourceMappingURL=component---node-modules-vtex-gatsby-theme-vtex-src-templates-product-tsx-185ac4d14aab5bb2a4be.js.map | 6,956 | 13,789 | 0.690339 |
1e3e7f04d195e029020c59735ecfd1312c102838 | 12,462 | js | JavaScript | website/index.js | mustakimkr/react-nice-dates | 8595d3cd306f7e5821c6ee90241c0189294df450 | [
"MIT"
] | 1,108 | 2020-01-21T17:34:06.000Z | 2022-03-30T18:45:40.000Z | website/index.js | mustakimkr/react-nice-dates | 8595d3cd306f7e5821c6ee90241c0189294df450 | [
"MIT"
] | 64 | 2020-01-21T21:04:05.000Z | 2022-03-21T08:23:34.000Z | website/index.js | mustakimkr/react-nice-dates | 8595d3cd306f7e5821c6ee90241c0189294df450 | [
"MIT"
] | 83 | 2020-01-21T22:54:23.000Z | 2022-03-21T21:11:12.000Z | import React from 'react'
import { render } from 'react-dom'
import DatePickerExample from './examples/DatePickerExample'
import DateRangePickerExample from './examples/DateRangePickerExample'
import DatePickerCalendarExample from './examples/DatePickerCalendarExample'
import DateRangePickerCalendarExample from './examples/DateRangePickerCalendarExample'
import StandaloneInputExample from './examples/StandaloneInputExample'
import DatePickerCalendarWithInputExample from './examples/DatePickerCalendarWithInputExample'
import ModifiersExample from './examples/ModifiersExample'
import LocalesExample from './examples/LocalesExample'
import CalendarExample from './examples/CalendarExample'
import CodeBlock from './CodeBlock'
import DatePickerWithTimeInputExample from './examples/DatePickerWithTimeInputExample'
import DatePickerWithTimeExample from './examples/DatePickerWithTimeExample'
function App() {
return (
<div className='container'>
<h1>React Nice Dates</h1>
<p className='tagline'>A responsive, touch-friendly, and modular date picker library.</p>
<nav className='nav'>
<a href='#overview'>Overview</a>
<a href='#installation'>Installation</a>
<a href='#api-reference'>API Reference</a>
<a href='https://github.com/hernansartorio/react-nice-dates'>GitHub</a>
</nav>
<h2 id='overview'>Overview</h2>
<p>
React Nice Dates is composed of a set of components and utilities with different levels of abstraction that you
can use to build your own date pickers.
</p>
<p>
At the top level, you have <code>DatePicker</code> and <code>DateRangePicker</code>. These are
slightly-opinionated components that should cover the most common use-cases. They allow displaying date inputs
with a calendar popover below. They make no assumptions about how your inputs should look. Instead, they provide
all the necessary props so you can render them yourself.
</p>
<p>
Here’s the most basic example using the <code>DatePicker</code> component:
</p>
<DatePickerExample />
<p>
<em>
Hint: If you are using a touch device, you can also change the current month by dragging the calendar grid up
or down.
</em>
</p>
<p>
Here’s a more complete example, this time using the <code>DateRangePicker</code> component:
</p>
<DateRangePickerExample />
<h3>Customizing how the calendar appears</h3>
<p>
Next, you have <code>DatePickerCalendar</code> and <code>DateRangePickerCalendar</code>, the calendar-only date
picker components (used by <code>DatePicker</code> and <code>DateRangePicker</code>). Use these if you want to
display the calendars inline or implement your own popover component, for example.
</p>
<p>
<code>DatePickerCalendar</code> example:
</p>
<DatePickerCalendarExample />
<p>
<code>DateRangePickerCalendar</code> example:
</p>
<DateRangePickerCalendarExample />
<h3>Customizing days</h3>
<p>
Modifiers define what CSS classes are applied to each calendar day. All the components accept a{' '}
<code>modifiers</code>
prop—an object where each key corresponds to the modifier name, and each value corresponds to a function that
receives a <code>date</code> parameter and must return a <code>boolean</code> determining whether that modifier
class should apply to that particular day.
</p>
<p>
The default modifiers are <code>disabled</code>, <code>selected</code>, and <code>today</code>. You can also
create your own modifiers by passing a <code>modifiersClassNames</code> which will be matched to the{' '}
<code>modifiers</code> object.
</p>
<ModifiersExample />
<h3>Implementing your own date-picking behavior</h3>
<p>
If you need to implement a date-picking behavior not covered by the previous components, you can use the{' '}
<code>Calendar</code> component directly (<code>DatePickerCalendar</code> and
<code>DateRangePickerCalendar</code> are themselves wrappers around this component). It accepts callbacks for
when a day is clicked or hovered, which you can then use to create modifiers to control which days are selected.
</p>
<CalendarExample />
<h3>Parsing text inputs</h3>
<p>
You can also use the <code>useDateInput</code> hook if you want to have the same date-parsing functionality on
text inputs in your custom implementation.
</p>
<p>Here’s an example using it on a standalone input:</p>
<StandaloneInputExample />
<p>
And here it is paired with <code>DatePickerCalendar</code>:
</p>
<DatePickerCalendarWithInputExample />
<h3>Time-picking</h3>
<p>
While there’s no custom time-picking user interface, you can use an input format that includes the time, and the
selected time will get carried over when the selected date changes.
</p>
<DatePickerWithTimeExample />
<p>
You can also use separate input for the time of the date, using the <code>useDateInput</code> hook.
</p>
<DatePickerWithTimeInputExample />
<h3>Localization</h3>
<p>
As you might have noticed, React Nice Dates relies of the awesome <a href='https://date-fns.org/'>date-fns</a>{' '}
library as a peer dependency. All components require a <code>locale</code> prop, which must be a{' '}
<a href='https://date-fns.org/v2.9.0/docs/I18n'>date-fns locale object</a> of your desired language.
</p>
<LocalesExample />
<h2 id='installation'>Installation</h2>
<p>
1. Add the <code>react-nice-dates</code> and <code>date-fns</code> packages to your dependencies.
</p>
<p>With NPM:</p>
<CodeBlock code={'npm install react-nice-dates date-fns --save'} language='bash' />
<p>Or with Yarn:</p>
<CodeBlock code={'yarn add react-nice-dates date-fns'} language='bash' />
<p>2. Import the desired components, a date-fns locale object of your language, and the CSS:</p>
<CodeBlock
code={`import { enGB } from 'date-fns/locale'
import { DatePickerCalendar } from 'react-nice-dates'
import 'react-nice-dates/build/style.css'
//...
<DatePickerCalendar locale={enGB} />`}
/>
<h3>Style customization</h3>
<p>You can use and override the compiled CSS on your project:</p>
<CodeBlock
code={`
.nice-dates-navigation, .nice-dates-day {
color: #111;
}
.nice-dates-popover {
box-shadow: none;
border: 1px solid #ddd;
border-radius: 2px;
max-width: 480px;
transition: none;
}`}
language='css'
/>
<p>Or, if you’re using SASS, import the original SASS file for easier customization:</p>
<CodeBlock
code={`
// Existing variables and their defaults
$nice-dates-color-gray-dark: #333;
$nice-dates-color-gray: #999;
$nice-dates-color-gray-light: #ddd;
$nice-dates-color-accent: $nice-dates-color-gray-dark;
$nice-dates-font-size-small: 12px;
$nice-dates-font-size-base: 14px;
$nice-dates-font-size-big: 16px;
@import 'react-nice-dates/src/style.scss';
// Other overrides...
`}
language='scss'
/>
<h2 id='api-reference'>API Reference</h2>
<h3>
<code>DatePicker</code> props
</h3>
<CodeBlock
code={`
children: func.isRequired, // ({ inputProps, focused }) => {}
locale: object.isRequired,
date: instanceOf(Date),
onDateChange: func,
format: string, // Default: locale.formatLong.date({ width: 'short' })
minimumDate: instanceOf(Date), // See Calendar props
maximumDate: instanceOf(Date), // See Calendar props
modifiers: objectOf(func),
modifiersClassNames: objectOf(string),
weekdayFormat: string, // See Calendar props
touchDragEnabled: bool // See Calendar props `}
/>
<p>
<code>inputProps</code> properties:
</p>
<CodeBlock
code={`
onBlur,
onChange,
onFocus,
placeholder, // Default: format.toLowerCase()
readOnly, // Default: true for touch devices to avoid triggering the on-screen keyboard
ref,
type, // Default: 'text'
value
`}
/>
<h3>
<code>DateRangePicker</code> props
</h3>
<CodeBlock
code={`children: func.isRequired, // ({ startDateInputProps, endDateInputProps, focus }) => {}
locale: object.isRequired,
startDate: instanceOf(Date),
endDate: instanceOf(Date),
onStartDateChange: func,
onEndDateChange: func,
format: string, // Default: locale.formatLong.date({ width: 'short' })
minimumDate: instanceOf(Date), // See Calendar props
maximumDate: instanceOf(Date), // See Calendar props
minimumLength: number, // See DateRangePickerCalendar props
maximumLength: number, // See DateRangePickerCalendar props
modifiers: objectOf(func),
modifiersClassNames: objectOf(string),
weekdayFormat: string, // See Calendar props
touchDragEnabled: bool // See Calendar props `}
/>
<p>
<code>startDateInputProps</code> and <code>endDateInputProps</code> properties:
</p>
<CodeBlock
code={`
onBlur,
onChange,
onFocus,
placeholder, // Default: format.toLowerCase()
readOnly, // Default: true for touch devices to avoid triggering the on-screen keyboard
ref,
type, // Default: 'text'
value
`}
/>
<h3>
<code>DatePickerCalendar</code> props
</h3>
<CodeBlock
code={`
locale: object.isRequired,
date: instanceOf(Date),
month: instanceOf(Date), // See Calendar props
onDateChange: func,
onMonthChange: func, // See Calendar props
minimumDate: instanceOf(Date), // See Calendar props
maximumDate: instanceOf(Date), // See Calendar props
modifiers: objectOf(func),
modifiersClassNames: objectOf(string),
weekdayFormat: string, // See Calendar props
touchDragEnabled: bool // See Calendar props`}
/>
<h3>
<code>DateRangePickerCalendar</code> props
</h3>
<CodeBlock
code={`
locale: object.isRequired,
startDate: instanceOf(Date),
endDate: instanceOf(Date),
focus: oneOf([START_DATE, END_DATE]),
month: instanceOf(Date), // See Calendar props
onStartDateChange: func.isRequired,
onEndDateChange: func.isRequired,
onFocusChange: func.isRequired,
onMonthChange: func, // See Calendar props
minimumDate: instanceOf(Date), // See Calendar props
maximumDate: instanceOf(Date), // See Calendar props
minimumLength: number, // Minimum range selection length, defaults to 0
maximumLength: number, // Maximum range selection length, defaults to null
modifiers: objectOf(func),
modifiersClassNames: objectOf(string),
weekdayFormat: string, // See Calendar props
touchDragEnabled: bool // See Calendar props `}
/>
<h3>
<code>Calendar</code> props
</h3>
<CodeBlock
code={`
locale: object.isRequired,
minimumDate: instanceOf(Date), // Days before minimumDate will be disabled
maximumDate: instanceOf(Date), // Days after maximumDate will be disabled
modifiers: objectOf(func),
modifiersClassNames: objectOf(string),
month: instanceOf(Date), // Optional: Turns current month into a controlled prop
onMonthChange: func, // Optional: Turns current month into a controlled prop
onDayHover: func,
onDayClick: func,
weekdayFormat: string, // Optional: allows weekday to be dynamically formatted (ex. "EEEEE")
touchDragEnabled: bool // Default: true`}
/>
<h3>
<code>useDateInput</code>
</h3>
<CodeBlock
code={`
const {
onBlur
onChange
onFocus
placeholder // Default: format.toLowerCase(),
type // 'text'
value
} = useDateInput({
date, // Current date
format, // Default: locale.formatLong.date({ width: 'short' })
locale, // date-fns locale object
minimumDate, // Dates before minimumDate won’t be valid
maximumDate, // Dates after maximumDate won’t be valid
onDateChange, // Function to call when a valid date is typed
validate // Custom date validation function. Recieves a date and must return a boolean.
})`}
/>
<footer>
<span className='text-light'>
Made by <a href='https://hernansartorio.com/'>Hernán Sartorio</a>
</span>
</footer>
</div>
)
}
if (module.hot) {
module.hot.accept()
}
render(<App />, document.getElementById('root'))
| 31.390428 | 123 | 0.679024 |
1e3ea0e74b5b9ca0d85ff5816f9f3cb36528695d | 9,107 | js | JavaScript | fact-bounty-client/src/shared/components/TopNavBar.js | Anmolbansal1/fact-Bounty | 9ba59a193bf09e8f051426ee47319504f104b5a6 | [
"Apache-2.0"
] | 2 | 2019-02-14T14:03:58.000Z | 2019-03-24T23:49:53.000Z | fact-bounty-client/src/shared/components/TopNavBar.js | Tushar19varshney/fact-Bounty | 9ba59a193bf09e8f051426ee47319504f104b5a6 | [
"Apache-2.0"
] | 238 | 2019-06-02T17:30:45.000Z | 2021-07-26T23:14:54.000Z | fact-bounty-client/src/shared/components/TopNavBar.js | Anmolbansal1/fact-Bounty | 9ba59a193bf09e8f051426ee47319504f104b5a6 | [
"Apache-2.0"
] | null | null | null | import React, { Component, Fragment } from "react";
import { connect } from "react-redux";
import PropTypes from "prop-types";
import Button from "@material-ui/core/Button";
import AppBar from "@material-ui/core/AppBar";
import Toolbar from "@material-ui/core/Toolbar";
import Typography from "@material-ui/core/Typography";
import { Menu, MenuItem } from "@material-ui/core";
import Snackbar from "@material-ui/core/Snackbar";
import { Link } from "react-router-dom";
import Avatar from "@material-ui/core/Avatar";
import IconButton from "@material-ui/core/IconButton";
import CloseIcon from "@material-ui/icons/Close";
import ListItemIcon from "@material-ui/core/ListItemIcon";
import ListItemText from "@material-ui/core/ListItemText";
import { logoutUser } from "../../pages/dashboard/actions/dashboardActions";
import "../navbar.css";
const breakpoints = {
desktop: 1040,
tablet: 840,
mobile: 540
};
const styles = {
navbar: {
backgroundColor: "#fafafa",
zIndex: "15",
display: window.innerWidth > breakpoints.mobile ? "block" : "none",
position: "fixed",
top: 0
},
navbarTitle: {
flexGrow: 2,
MozUserSelect: "none",
WebkitUserSelect: "none",
msUserSelect: "none",
textDecoration: "none"
},
headingTitle: {
marginLeft: window.innerWidth > breakpoints.mobile ? 0 : "15px",
padding: window.innerWidth > breakpoints.mobile ? 0 : "13px 0",
fontSize: window.innerWidth > breakpoints.mobile ? "auto" : "1.5rem",
position: "relative",
zIndex: 6
},
navbarLinks: {
letterSpacing: "1px",
fontWeight: "500",
marginLeft: "24px"
// fontSize: "1rem"
},
link: {
textDecoration: "none"
},
avatar: {
background: "#0388A6"
},
menu: {
marginTop: "6vh"
}
};
class TopNavBar extends Component {
componentDidMount() {
let menuIcon = document.querySelector(".menuIcon");
let menuItems = document.querySelector("#menu");
let nav = document.querySelector(".overlay-menu");
menuIcon.addEventListener("click", () => {
if (nav.style.transform !== "translateX(0%)") {
nav.style.transform = "translateX(0%)";
nav.style.transition = "transform 0.2s ease-out";
} else {
nav.style.transform = "translateX(-200%)";
nav.style.transition = "transform 0.2s ease-out";
}
});
// Toggle Menu Icon ========================================
let toggleIcon = document.querySelector(".menuIcon");
toggleIcon.addEventListener("click", () => {
if (toggleIcon.className !== "menuIcon toggle") {
toggleIcon.className += " toggle";
} else {
toggleIcon.className = "menuIcon";
}
});
menuItems.addEventListener("click", () => {
nav.style.transform = "translateX(-200%)";
nav.style.transition = "transform 0.2s ease-out";
toggleIcon.className = "menuIcon";
});
}
state = {
anchorEl: null,
open: false,
vertical: "top",
horizontal: "center"
};
handleClose = () => {
this.setState({ open: false });
};
openMenu = event => {
this.setState({ anchorEl: event.currentTarget });
};
closeMenu = () => {
this.setState(state => ({
anchorEl: null
}));
};
handleLogout = () => {
this.closeMenu();
this.setState({ open: true, vertical: "top", horizontal: "center" });
this.props.logoutUser();
};
render() {
const { anchorEl, vertical, horizontal, open } = this.state;
const { auth } = this.props;
const NotAuthenticated = (
<Fragment>
<Link to="/register" style={styles.link}>
<Button color="primary" style={styles.navbarLinks}>
Sign Up
</Button>
</Link>
<Link to="/login" style={styles.link}>
<Button color="primary" style={styles.navbarLinks}>
Login
</Button>
</Link>
</Fragment>
);
const Authenticated = name => {
return (
<Fragment>
<IconButton onClick={this.openMenu} style={styles.navbarLinks}>
<Avatar style={styles.avatar}>{name[0]}</Avatar>
</IconButton>
<Menu
anchorEl={anchorEl}
open={Boolean(anchorEl)}
onClose={this.closeMenu}
style={styles.menu}
>
<MenuItem>
<ListItemIcon>
<Avatar style={styles.avatar}>{name[0]}</Avatar>
</ListItemIcon>
<ListItemText inset primary={name} />
</MenuItem>
<Link onClick={this.closeMenu} to="/dashboard" style={styles.link}>
<MenuItem>Profile</MenuItem>
</Link>
<MenuItem onClick={this.handleLogout}>Logout</MenuItem>
</Menu>
</Fragment>
);
};
const AuthenticatedMob = name => {
return (
<Fragment>
<Link to="/profile" style={styles.link}>
<Button color="primary" style={styles.navbarLinks}>
Profile
</Button>
</Link>
<Link to="/login" style={styles.link}>
<Button
onClick={this.handleLogout}
color="primary"
style={styles.navbarLinks}
>
Logout
</Button>
</Link>
</Fragment>
);
};
return (
<div>
<AppBar position="static" color="default" style={styles.navbar}>
<Toolbar>
<Link to="/" style={styles.navbarTitle}>
<Typography
variant="h4"
color="primary"
style={styles.headingTitle}
>
Fact Bounty
</Typography>
</Link>
<Link to="/" style={styles.link}>
<Button color="primary" style={styles.navbarLinks}>
HOME
</Button>
</Link>
<Link to="/about" style={styles.link}>
<Button color="primary" style={styles.navbarLinks}>
ABOUT
</Button>
</Link>
{auth.isAuthenticated
? Authenticated(auth.user.name)
: NotAuthenticated}
</Toolbar>
</AppBar>
<div
style={{
padding: "5px 0",
boxShadow: "rgba(136, 136, 136, 0.72) 0px -3px 13px 0px",
backgroundColor: "white",
top: 0,
width: "100vw",
position: "fixed",
display: window.innerWidth > breakpoints.mobile ? "none" : "block",
zIndex: 6
}}
>
<div
className="menuIcon"
style={{
display: window.innerWidth > breakpoints.mobile ? "none" : "block"
}}
>
<span className="icon icon-bars" />
<span className="icon icon-bars overlay" />
</div>
<Link to="/" style={styles.navbarTitle}>
<Typography
variant="h4"
color="primary"
style={styles.headingTitle}
>
Fact Bounty
</Typography>
</Link>
</div>
<div
className="overlay-menu"
style={{
fontFamily: "Open Sans, sans-serif",
fontWeight: 600,
backgroundColor: "white",
zIndex: 5,
display: window.innerWidth > breakpoints.mobile ? "none" : "block"
}}
>
<ul id="menu">
<Link to="/" style={styles.link}>
<Button color="primary" style={styles.navbarLinks}>
HOME
</Button>
</Link>
<Link to="/about" style={styles.link}>
<Button color="primary" style={styles.navbarLinks}>
ABOUT
</Button>
</Link>
{auth.isAuthenticated
? AuthenticatedMob(auth.user.name)
: NotAuthenticated}
</ul>
</div>
<Snackbar
anchorOrigin={{ vertical, horizontal }}
open={open}
onClose={this.handleClose}
ContentProps={{
"aria-describedby": "message-id"
}}
message={
<span id="message-id">
You have been logged out.
<Link to="/login" style={styles.link}>
<Button onClick={this.handleClose} style={{ color: "red" }}>
LOGIN again!
</Button>
</Link>
</span>
}
action={[
<IconButton
key="close"
aria-label="Close"
color="inherit"
onClick={this.handleClose}
>
<CloseIcon />
</IconButton>
]}
/>
</div>
);
}
}
TopNavBar.propTypes = {
logoutUser: PropTypes.func.isRequired,
auth: PropTypes.object.isRequired
};
const mapStateToProps = state => ({
auth: state.auth
});
export default connect(
mapStateToProps,
{ logoutUser }
)(TopNavBar);
| 28.195046 | 80 | 0.521028 |
1e3ec30c10a44bb4947587307b9b3f4946f6d018 | 9,861 | js | JavaScript | webapp/src/components/Schedule/Schedule.js | hackshields/lifebank | f4204edf4667dac3265dbf157dd9ec45e9fffb57 | [
"MIT"
] | 12 | 2020-06-12T01:06:25.000Z | 2022-03-25T05:02:19.000Z | webapp/src/components/Schedule/Schedule.js | hackshields/lifebank | f4204edf4667dac3265dbf157dd9ec45e9fffb57 | [
"MIT"
] | 479 | 2020-06-01T20:09:42.000Z | 2021-11-01T11:26:11.000Z | webapp/src/components/Schedule/Schedule.js | hackshields/lifebank | f4204edf4667dac3265dbf157dd9ec45e9fffb57 | [
"MIT"
] | 18 | 2020-06-16T13:58:34.000Z | 2022-02-18T11:17:56.000Z | import React, { useState, useEffect } from 'react'
import PropTypes from 'prop-types'
import { makeStyles, useTheme } from '@material-ui/core/styles'
import useMediaQuery from '@material-ui/core/useMediaQuery'
import TextField from '@material-ui/core/TextField'
import MenuItem from '@material-ui/core/MenuItem'
import Typography from '@material-ui/core/Typography'
import Box from '@material-ui/core/Box'
import Button from '@material-ui/core/Button'
import List from '@material-ui/core/List'
import ListItem from '@material-ui/core/ListItem'
import ListItemText from '@material-ui/core/ListItemText'
import ListItemAvatar from '@material-ui/core/ListItemAvatar'
import Avatar from '@material-ui/core/Avatar'
import IconButton from '@material-ui/core/IconButton'
import Divider from '@material-ui/core/Divider'
import DeleteIcon from '@material-ui/icons/Delete'
import ScheduleIcon from '@material-ui/icons/Schedule'
import Dialog from '@material-ui/core/Dialog'
import CloseIcon from '@material-ui/icons/Close'
import { useTranslation } from 'react-i18next'
import styles from './styles'
const useStyles = makeStyles(styles)
const AMPM = ['am', 'pm']
const getWeekDaysSorted = (data) => {
const sorter = {
sunday: 0,
monday: 1,
tuesday: 2,
wednesday: 3,
thursday: 4,
friday: 5,
saturday: 6
}
return data.sort((a, b) => {
const day1 = a.day.toLowerCase()
const day2 = b.day.toLowerCase()
return sorter[day1] - sorter[day2]
})
}
const getHours = () => {
const times = []
for (let s = 6; s < 24; s++) {
const hour = s % 12
times.push({
label: (hour || '12') + ':00' + AMPM[Math.floor(s / 12)],
value: ('0' + s).slice(-2) + ':00'
})
}
return times
}
const convertHour = (time) => {
const hour = time % 12
return (hour || '12') + ':00' + AMPM[Math.floor(time / 12)]
}
const Schedule = ({
handleOnAddSchedule,
scheduleLoad,
data,
loading,
showSchedule,
showButton
}) => {
const { t } = useTranslation('translations')
const classes = useStyles()
const [open, setOpen] = useState('06:00')
const [close, setClose] = useState('16:00')
const [day, setDay] = useState('Sunday')
const theme = useTheme()
const [scheduleList, setscheduleList] = useState([])
const [schedule, setSchedule] = useState([])
const [openModal, setOpenModal] = useState(false)
const days = [
{ value: 'Sunday', label: t('schedule.sunday') },
{ value: 'Monday', label: t('schedule.monday') },
{ value: 'Tuesday', label: t('schedule.tuesday') },
{ value: 'Wednesday', label: t('schedule.wednesday') },
{ value: 'Thursday', label: t('schedule.thursday') },
{ value: 'Friday', label: t('schedule.friday') },
{ value: 'Saturday', label: t('schedule.saturday') }
]
const hours = getHours()
const handleChangeOpen = (event) => {
setOpen(event.target.value)
}
const isDesktop = useMediaQuery(theme.breakpoints.up('md'), {
defaultMatches: true
})
const handleChangeClose = (event) => {
setClose(event.target.value)
}
const handleChangeDay = (event) => {
setDay(event.target.value)
}
const handleAddSchedulePerDay = () => {
const isRepeated = schedule.some((item) => item.day === day)
!isRepeated && setSchedule([...schedule, { day, open, close }])
}
const loadSchedule = () => {
if (scheduleLoad) setSchedule(JSON.parse(scheduleLoad))
}
const handleDeleteSchedulePerDay = (item) => {
const newSchedule = schedule.filter(({ day }) => day !== item)
setSchedule(newSchedule)
}
const handleOpen = () => {
setOpenModal(!openModal)
if (loading) loadSchedule(scheduleLoad)
}
const onHandleOnAddSchedule = () => {
handleOnAddSchedule(schedule)
setOpenModal(false)
}
useEffect(() => {
if (data) showSchedule && setscheduleList(getWeekDaysSorted(data))
}, [showSchedule, data])
return (
<>
{showButton && (
<Button
variant="outlined"
color="primary"
onClick={handleOpen}
fullWidth
className={classes.addBtn}
>
{t('schedule.addSchedule')}
</Button>
)}
{showSchedule &&
scheduleList.map((scheduleItem) => (
<Box key={scheduleItem.day} className={classes.resultList}>
<List>
<ListItem>
<Box className={classes.boxDivider}>
<Divider />
</Box>
<Box className={classes.scheduleListResult}>
<Typography variant="h6">{scheduleItem.day}</Typography>
<Typography variant="body1">
{`${convertHour(
scheduleItem.open.split(':')[0]
)} - ${convertHour(scheduleItem.close.split(':')[0])}`}
</Typography>
</Box>
<Box className={classes.boxDivider}>
<Divider />
</Box>
</ListItem>
</List>
</Box>
))}
<Dialog
aria-labelledby="transition-modal-title"
aria-describedby="transition-modal-description"
open={openModal}
onClose={() => { }}
fullScreen={!isDesktop}
maxWidth='xs'
fullWidth
closeAfterTransition
BackdropProps={{
timeout: 500
}}
>
<Box className={classes.dialog}>
<Box className={classes.closeIcon}>
<IconButton
aria-label="close"
color="inherit"
size="small"
onClick={handleOpen}
>
<CloseIcon fontSize="inherit" />
</IconButton>
</Box>
<Box className={classes.root}>
<Typography variant="h3">
{t('schedule.chooseYourSchedule')}
</Typography>
<TextField
id="outlined-select-currency"
select
fullWidth
label={t('schedule.day')}
value={day}
onChange={handleChangeDay}
variant="outlined"
>
{days.map((option) => {
const isSelected = schedule.some(
({ day }) => day === option.value
)
return (
<MenuItem
key={option.value}
value={option.value}
disabled={isSelected}
selected={isSelected}
>
{option.label}
</MenuItem>
)
})}
</TextField>
<Box className={classes.componentBox}>
<TextField
id="outlined-select-currency"
select
label={t('schedule.open')}
value={open}
onChange={handleChangeOpen}
variant="outlined"
>
{hours.map((option) => (
<MenuItem key={option.value} value={option.value}>
{option.label}
</MenuItem>
))}
</TextField>
<Typography>{t('offerView.to')}</Typography>
<TextField
id="outlined-select-currency"
select
label={t('schedule.close')}
value={close}
onChange={handleChangeClose}
variant="outlined"
>
{hours.map((option) => (
<MenuItem key={option.value} value={option.value}>
{option.label}
</MenuItem>
))}
</TextField>
</Box>
<Button
className={classes.addBtn}
variant="contained"
color="default"
onClick={handleAddSchedulePerDay}
>
{t('miscellaneous.add')}
</Button>
<Box className={classes.list}>
<List className={classes.scheduleList}>
{schedule.map((item) => (
<div key={item.day}>
<ListItem>
<ListItemAvatar>
<Avatar>
<ScheduleIcon />
</Avatar>
</ListItemAvatar>
<ListItemText
primary={t(`schedule.${item.day.toLowerCase()}`)}
secondary={`${convertHour(
item.open.split(':')[0]
)} to ${convertHour(item.close.split(':')[0])}`}
/>
<IconButton
onClick={() => handleDeleteSchedulePerDay(item.day)}
>
<DeleteIcon color="secondary" />
</IconButton>
</ListItem>
<Divider />
</div>
))}
</List>
</Box>
{Boolean(schedule.length) && (
<Button
className={classes.saveBtn}
variant="contained"
color="primary"
onClick={onHandleOnAddSchedule}
>
{t('common.save')}
</Button>
)}
</Box>
</Box>
</Dialog>
</>
)
}
Schedule.propTypes = {
handleOnAddSchedule: PropTypes.func,
scheduleLoad: PropTypes.string,
data: PropTypes.array,
loading: PropTypes.bool,
showSchedule: PropTypes.bool,
showButton: PropTypes.bool
}
Schedule.defaultProps = {
handleOnAddSchedule: () => { },
scheduleLoad: '',
data: null,
loading: false,
showSchedule: false,
showButton: true
}
export default Schedule
| 29.881818 | 76 | 0.516073 |
1e3f1c0e26fa76cbba7a19ecbc1378b501a0de56 | 4,646 | js | JavaScript | themes/frontend/js/demos/demo-real-estate.js | nittinbushari/ci3_hmvc_auth | 15a06f6c6f28660ba1a4e70278301e0205e384c5 | [
"Apache-2.0"
] | null | null | null | themes/frontend/js/demos/demo-real-estate.js | nittinbushari/ci3_hmvc_auth | 15a06f6c6f28660ba1a4e70278301e0205e384c5 | [
"Apache-2.0"
] | null | null | null | themes/frontend/js/demos/demo-real-estate.js | nittinbushari/ci3_hmvc_auth | 15a06f6c6f28660ba1a4e70278301e0205e384c5 | [
"Apache-2.0"
] | null | null | null | /*
Name: RealEstate
Written by: Okler Themes - (http://www.okler.net)
Theme Version: 8.2.0
*/
'use strict';
/*
Header
*/
// Search Properties
var $headerWrapper = $('#headerSearchProperties'),
$window = $(window);
$headerWrapper.on('click', function() {
if ($window.width() > 992) {
$headerWrapper.addClass('open');
}
});
$(document).mouseup(function(e) {
if (!$headerWrapper.is(e.target) && $headerWrapper.has(e.target).length === 0) {
$headerWrapper.removeClass('open');
}
});
$('#propertiesFormHeader').validate({
onkeyup: false,
onclick: false,
onfocusout: false,
errorPlacement: function(error, element) {
if (element.attr('type') == 'radio' || element.attr('type') == 'checkbox') {
error.appendTo(element.parent().parent());
} else {
error.insertAfter(element);
}
}
});
/*
Custom Rev Slider Numbers
*/
// Check and show total
$('#revolutionSlider').bind("revolution.slide.onloaded",function (e) {
var max_slides = $(this).revmaxslide();
$('.slides-number .total').text( max_slides );
});
// Show current slide number
$('#revolutionSlider').bind("revolution.slide.onchange",function (e,data) {
var atual_slide = $(this).revcurrentslide();
$('.slides-number .atual').text( atual_slide );
});
/*
* Isotope
*/
var $wrapper = $('.properties-listing');
if( $wrapper.get(0) ) {
$wrapper.waitForImages(function() {
$wrapper.isotope({
itemSelector: '.isotope-item'
});
});
}
/*
Custom Listing Load More
*/
var listingLoadMore = {
pages: 0,
currentPage: 0,
$wrapper: $('#listingLoadMoreWrapper'),
$btn: $('#listingLoadMore'),
$btnWrapper: $('#listingLoadMoreBtnWrapper'),
$loader: $('#listingLoadMoreLoader'),
build: function() {
var self = this
self.pages = self.$wrapper.data('total-pages');
if(self.pages <= 1) {
self.$btnWrapper.remove();
return;
} else {
// init isotope
self.$wrapper.isotope();
self.$btn.on('click', function() {
self.loadMore();
});
// Lazy Load
if(self.$btn.hasClass('btn-listing-lazy-load')) {
self.$btn.appear(function() {
self.$btn.trigger('click');
}, {
data: undefined,
one: false,
accX: 0,
accY: 0
});
}
// Relayout Isotope on resize
var $grid = self.$wrapper;
$(window).on('resize', function() {
setTimeout(function() {
$grid.isotope('layout');
}, 300);
});
}
},
loadMore: function() {
var self = this;
self.$btn.hide();
self.$loader.show();
// Ajax
$.ajax({
url: 'demo-real-estate-ajax-load-more.html',
complete: function(data) {
var $items = $(data.responseText);
setTimeout(function() {
self.$wrapper.append($items)
self.$wrapper.isotope('appended', $items);
self.currentPage++;
if(self.currentPage < self.pages) {
self.$btn.show().blur();
} else {
self.$btnWrapper.remove();
}
// Carousel
$(function() {
$('[data-plugin-carousel]:not(.manual), .owl-carousel:not(.manual)').each(function() {
var $this = $(this),
opts;
var pluginOptions = theme.fn.getOptions($this.data('plugin-options'));
if (pluginOptions)
opts = pluginOptions;
$this.themePluginCarousel(opts);
});
});
self.$loader.hide();
}, 1000);
}
});
}
}
$window.on('load', function() {
if($('#listingLoadMoreWrapper').get(0)) {
listingLoadMore.build();
}
});
// Thumb Gallery
var $thumbGalleryDetail1 = $('#thumbGalleryDetail'),
$thumbGalleryThumbs1 = $('#thumbGalleryThumbs'),
flag = false,
duration = 300;
$thumbGalleryDetail1
.owlCarousel({
items: 1,
margin: 10,
nav: true,
dots: false,
loop: false,
navText: [],
rtl: ( $('html').attr('dir') == 'rtl' ) ? true : false
})
.on('changed.owl.carousel', function(e) {
if (!flag) {
flag = true;
$thumbGalleryThumbs1.trigger('to.owl.carousel', [e.item.index-1, duration, true]);
flag = false;
}
});
$thumbGalleryThumbs1
.owlCarousel({
margin: 15,
items: 4,
nav: false,
center: false,
dots: false,
rtl: ( $('html').attr('dir') == 'rtl' ) ? true : false
})
.on('click', '.owl-item', function() {
$thumbGalleryDetail1.trigger('to.owl.carousel', [$(this).index(), duration, true]);
})
.on('changed.owl.carousel', function(e) {
if (!flag) {
flag = true;
$thumbGalleryDetail1.trigger('to.owl.carousel', [e.item.index, duration, true]);
flag = false;
}
});
| 20.112554 | 93 | 0.574473 |
1e3f2dfd8f5553874fd0dfd4b9007d7aa73c1141 | 560 | js | JavaScript | server/src/settings/index.js | usagi-murasaki/Usagi-no-k-do | 33bebe8daa65ef957e58456de315c48d98fdb2e2 | [
"MIT"
] | null | null | null | server/src/settings/index.js | usagi-murasaki/Usagi-no-k-do | 33bebe8daa65ef957e58456de315c48d98fdb2e2 | [
"MIT"
] | null | null | null | server/src/settings/index.js | usagi-murasaki/Usagi-no-k-do | 33bebe8daa65ef957e58456de315c48d98fdb2e2 | [
"MIT"
] | null | null | null | const env = require('./production')
const envSettings = {
HTTPS: (env.https.toLowerCase() === 'true')?true:false,
PORT: Number(env.port),
HTTP_ERROR_CODE: Number(env.http_error_code),
HTTP_ERROR_TEXT: env.http_error_text,
MONGO_URI: 'mongodb://' + ((env.mongo_login !== null && env.mongo_pwd !== null) ? (env.mongo_login + ':' + env.mongo_pwd + '@') : '') + env.mongo_url + ':' + env.mongo_port + '/' + env.mongo_base,
BROKER_URI: 'mqtt://' + env.broker_url + ':' + env.broker_port
}
module.exports = function(prop) {
return envSettings[prop]
} | 40 | 198 | 0.657143 |
1e3f38285a4fe1b3eabfdaae112683e0cb5d95a9 | 5,096 | js | JavaScript | src/clone.js | nonoll/html2canvas-modify | 3a4c6171effb4cbb970196e46dd246ac6697439d | [
"MIT"
] | 5 | 2015-11-07T11:41:14.000Z | 2017-03-22T02:35:32.000Z | src/clone.js | nonoll/html2canvas-modify | 3a4c6171effb4cbb970196e46dd246ac6697439d | [
"MIT"
] | null | null | null | src/clone.js | nonoll/html2canvas-modify | 3a4c6171effb4cbb970196e46dd246ac6697439d | [
"MIT"
] | null | null | null | var log = require('./log');
var Promise = require('./promise');
var html2canvasCanvasCloneAttribute = "data-html2canvas-canvas-clone";
var html2canvasCanvasCloneIndex = 0;
function cloneNodeValues(document, clone, nodeName) {
var originalNodes = document.getElementsByTagName(nodeName);
var clonedNodes = clone.getElementsByTagName(nodeName);
var count = originalNodes.length;
for (var i = 0; i < count; i++) {
clonedNodes[i].value = originalNodes[i].value;
}
}
function restoreOwnerScroll(ownerDocument, x, y) {
if (ownerDocument.defaultView && (x !== ownerDocument.defaultView.pageXOffset || y !== ownerDocument.defaultView.pageYOffset)) {
ownerDocument.defaultView.scrollTo(x, y);
}
}
function labelCanvasElements(ownerDocument) {
[].slice.call(ownerDocument.querySelectorAll("canvas"), 0).forEach(function(canvas) {
canvas.setAttribute(html2canvasCanvasCloneAttribute, "canvas-" + html2canvasCanvasCloneIndex++);
});
}
function cloneCanvasContents(ownerDocument, documentClone) {
[].slice.call(ownerDocument.querySelectorAll("[" + html2canvasCanvasCloneAttribute + "]"), 0).forEach(function(canvas) {
try {
var clonedCanvas = documentClone.querySelector('[' + html2canvasCanvasCloneAttribute + '="' + canvas.getAttribute(html2canvasCanvasCloneAttribute) + '"]');
if (clonedCanvas) {
clonedCanvas.width = canvas.width;
clonedCanvas.height = canvas.height;
clonedCanvas.getContext("2d").putImageData(canvas.getContext("2d").getImageData(0, 0, canvas.width, canvas.height), 0, 0);
}
} catch(e) {
log("Unable to copy canvas content from", canvas, e);
}
canvas.removeAttribute(html2canvasCanvasCloneAttribute);
});
}
function removeScriptNodes(parent) {
[].slice.call(parent.childNodes, 0).filter(isElementNode).forEach(function(node) {
if (node.tagName === "SCRIPT") {
parent.removeChild(node);
} else {
removeScriptNodes(node);
}
});
return parent;
}
function isIE9() {
return document.documentMode && document.documentMode <= 9;
}
// https://github.com/niklasvh/html2canvas/issues/503
function cloneNodeIE9(node, javascriptEnabled) {
var clone = node.nodeType === 3 ? document.createTextNode(node.nodeValue) : node.cloneNode(false);
var child = node.firstChild;
while(child) {
if (javascriptEnabled === true || child.nodeType !== 1 || child.nodeName !== 'SCRIPT') {
clone.appendChild(cloneNodeIE9(child, javascriptEnabled));
}
child = child.nextSibling;
}
return clone;
}
function isElementNode(node) {
return node.nodeType === Node.ELEMENT_NODE;
}
module.exports = function(ownerDocument, containerDocument, width, height, options, x ,y) {
labelCanvasElements(ownerDocument);
var documentElement = isIE9() ? cloneNodeIE9(ownerDocument.documentElement, options.javascriptEnabled) : ownerDocument.documentElement.cloneNode(true);
var container = containerDocument.createElement("iframe");
container.className = "html2canvas-container";
container.style.visibility = "hidden";
container.style.position = "fixed";
container.style.left = "-10000px";
container.style.top = "0px";
container.style.border = "0";
container.width = width;
container.height = height;
container.scrolling = "no"; // ios won't scroll without it
containerDocument.body.appendChild(container);
return new Promise(function(resolve) {
var documentClone = container.contentWindow.document;
cloneNodeValues(ownerDocument.documentElement, documentElement, "textarea");
cloneNodeValues(ownerDocument.documentElement, documentElement, "select");
/* Chrome doesn't detect relative background-images assigned in inline <style> sheets when fetched through getComputedStyle
if window url is about:blank, we can assign the url to current by writing onto the document
*/
container.contentWindow.onload = container.onload = function() {
var interval = setInterval(function() {
if (documentClone.body.childNodes.length > 0) {
cloneCanvasContents(ownerDocument, documentClone);
clearInterval(interval);
if (options.type === "view") {
container.contentWindow.scrollTo(x, y);
}
resolve(container);
}
}, 50);
};
documentClone.open();
documentClone.write("<!DOCTYPE html><html></html>");
// Chrome scrolls the parent document for some reason after the write to the cloned window???
restoreOwnerScroll(ownerDocument, x, y);
documentClone.replaceChild(options.javascriptEnabled === true ? documentClone.adoptNode(documentElement) : removeScriptNodes(documentClone.adoptNode(documentElement)), documentClone.documentElement);
documentClone.close();
});
};
| 40.444444 | 207 | 0.668564 |
1e3f690ae9ed8d8297c3da1b92fea7b664048c61 | 4,328 | js | JavaScript | esm2015/lib/modules/app/assets/goodbye.component.js | PlusOneManagement/pop3-library-latest | 6e7f20589289364e48d78942f27bd2c6005a238d | [
"Apache-2.0"
] | null | null | null | esm2015/lib/modules/app/assets/goodbye.component.js | PlusOneManagement/pop3-library-latest | 6e7f20589289364e48d78942f27bd2c6005a238d | [
"Apache-2.0"
] | null | null | null | esm2015/lib/modules/app/assets/goodbye.component.js | PlusOneManagement/pop3-library-latest | 6e7f20589289364e48d78942f27bd2c6005a238d | [
"Apache-2.0"
] | null | null | null | import { Component } from '@angular/core';
import { ServiceInjector } from '../../../pop-common.model';
import { PopBaseService } from '../../../services/pop-base.service';
import { RandomArrayElement } from '../../../pop-common-utility';
export class PopTemplateGoodByeComponent {
constructor() {
const name = ServiceInjector.get(PopBaseService).getAuthPrimeUser().first_name;
const greetings = [
`Audios Amigo`,
`See Ya Later, ${name}`,
`Hasta la vista`,
`Later Hater`,
`Done so soon?`,
`GoodBye`,
`Thanks for all you have done, ${name}`
];
this.expression = RandomArrayElement(greetings);
}
}
PopTemplateGoodByeComponent.decorators = [
{ type: Component, args: [{
template: `
<div class="pop-template-goodbye">
<div class="pop-template-goodbye-row">
<h4>{{expression}}</h4>
</div>
</div>
`,
styles: [`
.pop-template-goodbye {
display: flex;
flex-direction: column;
width: 100%;
min-height: 30px;
justify-content: center;
align-items: center;
font-size: 1.5em;
}
.pop-template-goodbye-row {
display: flex;
width: 100%;
min-height: 30px;
justify-content: center;
align-items: center;
clear: both;
}
`]
},] }
];
PopTemplateGoodByeComponent.ctorParameters = () => [];
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ29vZGJ5ZS5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wb3AzLVNoYXJlZE1vZHVsZXMvcHJvamVjdHMvcG9wLWNvbW1vbi9zcmMvbGliL21vZHVsZXMvYXBwL2Fzc2V0cy9nb29kYnllLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFVLE1BQU0sZUFBZSxDQUFDO0FBQ2xELE9BQU8sRUFBRSxlQUFlLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUM1RCxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sb0NBQW9DLENBQUM7QUFDcEUsT0FBTyxFQUFFLGtCQUFrQixFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFnQ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BUaGFua3MgZm9yIGFsbCB5b3UgaGF2ZSBkb25lLCAke25hbWV9YFxuICAgIF07XG4gICAgdGhpcy5leHByZXNzaW9uID0gUmFuZG9tQXJyYXlFbGVtZW50KGdyZWV0aW5ncyk7XG5cbiAgfVxufVxuIl19 | 83.230769 | 2,862 | 0.847736 |
1e3fe94136c4902e5b7bc71ed0bc40deab85d282 | 239 | js | JavaScript | vue.config.js | kerimoyle/vue-sphinx-xml | 796438ee8d8576ecc8f1f814a7e76a1a9dee916b | [
"Apache-2.0"
] | null | null | null | vue.config.js | kerimoyle/vue-sphinx-xml | 796438ee8d8576ecc8f1f814a7e76a1a9dee916b | [
"Apache-2.0"
] | 13 | 2020-12-15T22:11:08.000Z | 2021-03-02T22:49:52.000Z | vue.config.js | kerimoyle/vue-sphinx-xml | 796438ee8d8576ecc8f1f814a7e76a1a9dee916b | [
"Apache-2.0"
] | 1 | 2020-12-02T19:45:29.000Z | 2020-12-02T19:45:29.000Z | function getProdExternals() {
return {
axios: 'axios',
}
}
module.exports = {
devServer: {
host: 'localhost',
},
configureWebpack: {
externals: process.env.NODE_ENV === 'production' ? getProdExternals() : {},
},
}
| 15.933333 | 79 | 0.60251 |
1e4026ccf8b3030f118b652d5d2a1a1d98678b91 | 4,668 | js | JavaScript | build/web-auth.bundle.js | amaury-tobias/front-auth-handler | 5bce76052241042fcfcc0089ad8ac922de4f5528 | [
"Apache-2.0"
] | null | null | null | build/web-auth.bundle.js | amaury-tobias/front-auth-handler | 5bce76052241042fcfcc0089ad8ac922de4f5528 | [
"Apache-2.0"
] | null | null | null | build/web-auth.bundle.js | amaury-tobias/front-auth-handler | 5bce76052241042fcfcc0089ad8ac922de4f5528 | [
"Apache-2.0"
] | null | null | null | !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.WebAuth=t():e.WebAuth=t()}(window,function(){return function(e){var t={};function o(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t,o){"use strict";var n,r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),a=o(1),u=(n=a)&&n.__esModule?n:{default:n};var c=function(){function e(t){var o=t.key,n=t.jwt,r=t.debug,i=t.remember;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.token=n,this.payload=null,this.key=o||"auth-key",this.debug=r||!1,this.remember=i||!1}return i(e,[{key:"init",value:function(e){var t=this,o=window[this.checkStorage()].getItem(this.key);this.token=this.token||o,this.setup(function(o){if(o)throw new Error("Token cannot be empty");t.setPayload(),t.checkExpiration(function(o){o&&"function"==typeof e?e({valid:!0,token:t.token,payload:t.payload}):"function"==typeof e?e({valid:!1,token:t.token,payload:t.payload}):t.Debug("info",{valid:!1,token:t.token,payload:t.payload})})})}},{key:"setup",value:function(e){var t=!1,o=this.remember?"localStorage":"sessionStorage";this.cleanTokens(),this.token?window[o].setItem(this.key,this.token):t=!0,"function"==typeof e&&e(t)}},{key:"checkExpiration",value:function(e){e(1e3*this.payload.exp>=(new Date).getTime())}},{key:"setPayload",value:function(){var e=this,t=(0,u.default)(this.token);this.Debug("info",t),this.payload="object"===(void 0===t?"undefined":r(t))?t:(e.Debug("error",{token:e.token,payload:e.payload}),e.Debug("error",new Error("Payload isn't an object")),{})}},{key:"checkStorage",value:function(){return window.localStorage.getItem(this.key)?"localStorage":"sessionStorage"}},{key:"cleanTokens",value:function(){window.localStorage.removeItem(this.key),window.sessionStorage.removeItem(this.key)}},{key:"Debug",value:function(e,t){var o="string"==typeof e?e:"info";this.debug&&console[o](t)}}]),e}();e.exports=c},function(e,t,o){"use strict";var n=o(2);function r(e){this.message=e}r.prototype=new Error,r.prototype.name="InvalidTokenError",e.exports=function(e,t){if("string"!=typeof e)throw new r("Invalid token specified");var o=!0===(t=t||{}).header?0:1;try{return JSON.parse(n(e.split(".")[o]))}catch(e){throw new r("Invalid token specified: "+e.message)}},e.exports.InvalidTokenError=r},function(e,t,o){"use strict";var n=o(3);e.exports=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(n(e).replace(/(.)/g,function(e,t){var o=t.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o}))}(t)}catch(e){return n(t)}}},function(e,t,o){"use strict";var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function r(e){this.message=e}r.prototype=new Error,r.prototype.name="InvalidCharacterError",e.exports="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new r("'atob' failed: The string to be decoded is not correctly encoded.");for(var o,i,a=0,u=0,c="";i=t.charAt(u++);~i&&(o=a%4?64*o+i:i,a++%4)?c+=String.fromCharCode(255&o>>(-2*a&6)):0)i=n.indexOf(i);return c}}])});
//# sourceMappingURL=web-auth.bundle.js.map | 2,334 | 4,624 | 0.704799 |
1e40808708aa6c41e9891f69554d6c0fa2d6a746 | 440 | js | JavaScript | tradeintel/src/App.js | Jesukavem/TradeIntel | b35a1c09d371b9755dad9ceed1e297aaca80550d | [
"Apache-2.0"
] | null | null | null | tradeintel/src/App.js | Jesukavem/TradeIntel | b35a1c09d371b9755dad9ceed1e297aaca80550d | [
"Apache-2.0"
] | null | null | null | tradeintel/src/App.js | Jesukavem/TradeIntel | b35a1c09d371b9755dad9ceed1e297aaca80550d | [
"Apache-2.0"
] | null | null | null | import React from 'react';
import CssBaseline from '@material-ui/core/CssBaseline';
import Container from '@material-ui/core/Container';
import Sidebar from "./Sidebar";
function App() {
return (
<React.Fragment>
<CssBaseline />
<Container fixed>
<Sidebar component="div" style={{ backgroundColor: '#cfe8fc', height: '100vh' }}>
</Sidebar>
</Container>
</React.Fragment>
);
}
export default App;
| 23.157895 | 87 | 0.654545 |
1e40c58a64befbf0c04f05762578114555e8b9ba | 1,893 | js | JavaScript | scripts/api_requests.js | kak79/js_project_frontend | 6a46fd9dac63b2e808321586f354acba86eadcd9 | [
"Unlicense"
] | null | null | null | scripts/api_requests.js | kak79/js_project_frontend | 6a46fd9dac63b2e808321586f354acba86eadcd9 | [
"Unlicense"
] | null | null | null | scripts/api_requests.js | kak79/js_project_frontend | 6a46fd9dac63b2e808321586f354acba86eadcd9 | [
"Unlicense"
] | 1 | 2021-04-23T16:01:12.000Z | 2021-04-23T16:01:12.000Z | class Api{
//READ -- fetch a recipe and it's ingredients
static fetchRecipes() {
fetch(BASE_URL)
.then(resp => resp.json())
.then(recipes => {
for( const recipe of recipes) {
let r = new Recipe(recipe.id, recipe.title, recipe.instructions, recipe.ingredients);
r.renderRecipe();
recipe.ingredients.forEach(
ingredient => {
let i = new Ingredient(ingredient.id, ingredient.name, ingredient.measurement);
i.renderIngredient(r);
})
}
})
}
//CREATE -- add a new recipe
static makeNewRecipe(e) {
e.preventDefault();
fetch(BASE_URL, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify(recipe)
})
.then(resp => resp.json())
.then(recipe => {
let r = new Recipe(recipe.id, recipe.title, recipe.instructions, recipe.ingredients);
r.renderRecipe();
})
let newRecipeForm = document.getElementById("new-recipe-form");
newRecipeForm.reset();
}
//EDIT -- add a new ingredients to a recipe by editing a recipe
static createAnIngredient(e) {
e.preventDefault()
fetch(`${BASE_URL}/${recipe2.id}`, {
method: 'PATCH',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify(recipe2)
})
.then(resp => resp.json())
.then(recipe => {
let ingredient = recipe.ingredients[recipe.ingredients.length - 1 ]
let i = new Ingredient(ingredient.id, ingredient.name, ingredient.measurement);
i.renderIngredient(recipe);
Recipe.mostIngs()
})
let newIngForm = document.getElementById("new-ing-frm");
newIngForm.reset();
}
}
| 28.253731 | 93 | 0.573164 |
1e40d60eac07feb9a4b1d1a119dd9bc76f5aae9e | 1,704 | js | JavaScript | staticfiles/jmol/jsmol/j2s/J/jvxl/readers/CifDensityReader.js | madettmann/DCS-Discover | 2706145f30bec95ab14ee0b0c13d380657cbcc23 | [
"MIT"
] | 103 | 2015-02-13T16:51:59.000Z | 2022-03-24T22:08:54.000Z | staticfiles/jmol/jsmol/j2s/J/jvxl/readers/CifDensityReader.js | madettmann/DCS-Discover | 2706145f30bec95ab14ee0b0c13d380657cbcc23 | [
"MIT"
] | 59 | 2015-12-02T22:43:21.000Z | 2022-03-28T03:54:44.000Z | staticfiles/jmol/jsmol/j2s/J/jvxl/readers/CifDensityReader.js | madettmann/DCS-Discover | 2706145f30bec95ab14ee0b0c13d380657cbcc23 | [
"MIT"
] | 62 | 2015-02-24T21:58:59.000Z | 2022-03-21T16:49:09.000Z | Clazz.declarePackage ("J.jvxl.readers");
Clazz.load (["J.jvxl.readers.BCifDensityReader"], "J.jvxl.readers.CifDensityReader", ["java.lang.Float", "$.Number", "JU.P3", "$.PT"], function () {
c$ = Clazz.declareType (J.jvxl.readers, "CifDensityReader", J.jvxl.readers.BCifDensityReader);
Clazz.makeConstructor (c$,
function () {
Clazz.superConstructor (this, J.jvxl.readers.CifDensityReader, []);
});
Clazz.overrideMethod (c$, "getCifData",
function (fileName, data) {
this.cifData = this.sg.atomDataServer.readCifData (fileName, data, "CIF");
}, "~S,~O");
Clazz.overrideMethod (c$, "readCifP3",
function (key, p3) {
if (p3 == null) p3 = new JU.P3 ();
var x = this.getCifFloat (key + "[0]");
if (Float.isNaN (x)) {
p3.x = NaN;
} else {
p3.x = x;
p3.y = this.getCifFloat (key + "[1]");
p3.z = this.getCifFloat (key + "[2]");
}return p3;
}, "~S,JU.P3");
Clazz.overrideMethod (c$, "getCifMap",
function (type) {
type = "data_" + type;
var list = this.cifData.get ("models");
for (var i = 0; i < list.size (); i++) {
var map = list.get (i);
if (type.equalsIgnoreCase (map.get ("name").toString ())) return this.thisData = map;
}
return null;
}, "~S");
Clazz.overrideMethod (c$, "getCifFloat",
function (key) {
var o = this.thisData.get (key);
var x = NaN;
if (o != null) {
if (Clazz.instanceOf (o, String)) {
x = JU.PT.parseFloat (o);
} else if (Clazz.instanceOf (o, Number)) {
x = (o).floatValue ();
}}return x;
}, "~S");
Clazz.overrideMethod (c$, "readCifFloats",
function (key, values) {
var list = this.thisData.get (key);
for (var i = 0, n = values.length; i < n; i++) values[i] = JU.PT.parseFloat (list.get (i));
return values;
}, "~S,~A");
});
| 32.150943 | 149 | 0.618545 |
1e4120bb4a01f0aaf1c5f145db6e1753f73e66a6 | 348 | js | JavaScript | src/ui/Elements/Misc/Avatar.js | moshemo/fresh-ui-2 | 99e82d586e44c8616479d0fa836bf92ca939e448 | [
"MIT"
] | null | null | null | src/ui/Elements/Misc/Avatar.js | moshemo/fresh-ui-2 | 99e82d586e44c8616479d0fa836bf92ca939e448 | [
"MIT"
] | 1 | 2021-05-10T14:46:19.000Z | 2021-05-10T14:46:19.000Z | src/ui/Elements/Misc/Avatar.js | moshemo/fresh-ui-2 | 99e82d586e44c8616479d0fa836bf92ca939e448 | [
"MIT"
] | null | null | null | import styled from 'styled-components'
export const Avatar = styled.div`
align-items: center;
border-radius: 50%;
display: inline-flex;
justify-content: center;
position: relative;
text-align: center;
vertical-align: middle;
& img {
border-radius: 50%;
display: inline-flex;
height: inherit;
width: inherit;
}
`
| 18.315789 | 38 | 0.672414 |
1e412f5931d8e5561a63a5544b18ea716b40137a | 11,324 | js | JavaScript | src/main/webapp/js/lor.js | rekcuFniarB/lorsource | 02ab569216ed8078f3cebb8f0641de377bd3c96e | [
"Apache-2.0"
] | null | null | null | src/main/webapp/js/lor.js | rekcuFniarB/lorsource | 02ab569216ed8078f3cebb8f0641de377bd3c96e | [
"Apache-2.0"
] | null | null | null | src/main/webapp/js/lor.js | rekcuFniarB/lorsource | 02ab569216ed8078f3cebb8f0641de377bd3c96e | [
"Apache-2.0"
] | null | null | null | /*
* Copyright 1998-2015 Linux.org.ru
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function initNextPrevKeys() {
$script.ready('plugins', function () {
$(function () {
function jump(link) {
if (link && link.href) {
document.location = link.href;
}
}
if (typeof jQuery.hotkeys !== 'undefined') {
$(document).bind('keydown', {combi: 'Ctrl+left', disableInInput: true}, function () {
jump(document.getElementById('PrevLink'))
});
$(document).bind('keydown', {combi: 'Ctrl+right', disableInInput: true}, function () {
jump(document.getElementById('NextLink'))
});
}
})
});
}
function initStarPopovers() {
$script.ready('plugins', function () {
$(function () {
$("#favs_button").click(function (event) {
event.preventDefault();
event.stopPropagation();
$("#memories_button").popover('hide');
$("#favs_button").popover('show');
});
$("#favs_button").popover({
content: "Для добавления в избранное надо залогиниться!",
autoReposition: false,
trigger: 'manual'
});
$("#memories_button").click(function (event) {
event.preventDefault();
event.stopPropagation();
$("#favs_button").popover('hide');
$("#memories_button").popover('show');
});
$("#memories_button").popover({
content: "Для добавления в отслеживаемое надо залогиниться!",
autoReposition: false,
trigger: 'manual'
});
})
});
}
function init_interpage_adv(ads) {
$(function() {
var ad = ads[Math.floor(Math.random() * ads.length)];
if (ad.type==='flash') {
$script('/js/jquery.swfobject.1-1-1.min.js', function() {
$('#interpage').flash({
"swf": ad.src,
"width": 728,
"height": 90
});
});
}
if (ad.type==='img') {
var anchor = $('<a>');
anchor.attr('href', ad.href);
anchor.attr('target', '_blank');
var img = $('<img>');
img.attr('src', ad.src);
if ('width' in ad) {
img.attr('width', ad.width);
} else {
img.attr('width', 728);
}
if ('height' in ad) {
img.attr('height', ad.height);
} else {
img.attr('height', 90);
}
anchor.append(img);
$('#interpage').append(anchor);
}
if (ad.type==='rimg') {
var anchor = $('<a>');
anchor.attr('href', ad.href);
anchor.attr('target', '_blank');
var img = $('<img>');
if (window.matchMedia("(min-width: 768px)").matches) {
// img.attr('width', 728);
img.attr('height', 90);
img.attr('src', ad.img730);
} else {
img.attr('width', 320);
img.attr('height', 100);
img.attr('src', ad.img320);
}
anchor.append(img);
$('#interpage').append(anchor);
}
});
}
function topic_memories_form_setup(memId, watch, msgid, csrf) {
function memories_add(event) {
event.preventDefault();
$.ajax({
url: "/memories.jsp",
type: "POST",
data: { msgid : msgid, add: "add", watch: event.data.watch, csrf: csrf }
}).done(function(t) {
form_setup(t['id'], event.data.watch);
if (event.data.watch) {
$('#memories_count').text(t['count']);
} else {
$('#favs_count').text(t['count']);
}
});
}
function memories_remove(event) {
event.preventDefault();
$.ajax({
url: "/memories.jsp",
type: "POST",
data: { id : event.data.id, remove: "remove", csrf: csrf }
}).done(function(t) {
form_setup(0, event.data.watch);
if (t>=0) {
if (event.data.watch) {
$('#memories_count').text(t);
} else {
$('#favs_count').text(t);
}
}
});
}
function form_setup(memId, watch) {
var el;
if (watch) {
el = $('#memories_button');
} else {
el = $('#favs_button');
}
if (memId==0) {
el.removeClass('selected');
el.attr('title', watch?"Отслеживать":"В избранное");
el.unbind("click", memories_remove);
el.bind("click", {watch: watch}, memories_add);
} else {
el.addClass('selected');
el.attr('title', watch?"Не отслеживать":"Удалить из избранного");
el.unbind("click", memories_add);
el.bind("click", {watch: watch, id: memId}, memories_remove);
}
}
$(function () {
form_setup(memId, watch);
});
}
function tag_memories_form_setup(tag, csrf_token) {
$script.ready('plugins', function() {
$(function() {
$("#tagFavNoth").click(function(event) {
event.preventDefault();
event.stopPropagation();
$("#tagFavNoth").popover('show');
}).popover({
content: "Для добавления в избранное надо залогиниться!"
});
$("#tagIgnNoth").click(function(event) {
event.preventDefault();
event.stopPropagation();
$("#tagIgnNoth").popover('show');
}).popover({
content: "Для добавления в список игнорирования надо залогиниться!"
});
});
});
$(function() {
function tag_filter(event) {
event.preventDefault();
var data = { tagName: tag};
var el = $('#tagFavAdd');
var add = !el.hasClass("selected");
if (add) {
data['add'] = 'add';
} else {
data['del'] = 'del';
}
data['csrf'] = csrf_token;
$.ajax({
url: "/user-filter/favorite-tag",
type: "POST",
dataType: "json",
data: data
}).done(function (t) {
if (t.error) {
alert(t.error);
} else {
el.attr('title', add ? "Удалить из избранного" : "В избранное");
$('#favsCount').text(t['count']);
if (add) {
el.addClass("selected");
} else {
el.removeClass("selected");
}
}
});
}
$("#tagFavAdd").bind("click", tag_filter);
});
$(function() {
function tag_ignore(event) {
event.preventDefault();
var data = { tagName: tag};
var el = $('#tagIgnore');
var add = !el.hasClass("selected");
if (add) {
data['add'] = 'add';
} else {
data['del'] = 'del';
}
data['csrf'] = csrf_token;
$.ajax({
url: "/user-filter/ignore-tag",
type: "POST",
dataType: "json",
data: data
}).done(function (t) {
if (t.error) {
alert(t.error);
} else {
el.attr('title', add ? "Перестать игнорировать" : "Игнорировать");
$('#ignoreCount').text(t['count']);
if (add) {
el.addClass("selected");
} else {
el.removeClass("selected");
}
}
});
}
$("#tagIgnore").bind("click", tag_ignore);
});
}
function replace_state() {
if (typeof(history.replaceState) !== 'function') return;
if (document.location.hash.indexOf('#comment-') == 0) {
// Yes, we are viewing a comment
// exit if no such target
if (document.querySelector('article.msg:target') === null) return;
var hash = document.location.hash.split('-');
if (parseInt(hash[1]) > 0) {
// OK, comment ID is valid
var p = document.location.pathname.split('/');
// make sure that path doesn't contain /pagex or other parts
var pathname = [p[0], p[1], p[2], p[3]].join('/');
// now replace state
history.replaceState(null, document.title, pathname + '?cid=' + hash[1]);
}
}
}
$script.ready('plugins', function() {
function initLoginForm() {
var options = {
type:"post",
dataType:"json",
xhrFields: {
withCredentials: true
},
success:function (response, status) {
if (response.loggedIn) {
window.location.reload();
} else {
alert("Ошибка авторизации. Неправильное имя пользователя, e-mail или пароль.");
window.location = "/login.jsp";
}
},
error:function (response, status) {
alert("Ошибка авторизации. Неправильное имя пользователя, e-mail или пароль.");
window.location = "/login.jsp";
}
};
if (location.protocol === 'https:') {
$('#regform').ajaxForm(options);
$('#loginbutton').bind('click', function(e) {
$("#regmenu").fadeOut("fast", function() {
$("#regform").fadeIn("fast", function() {
$("#regform input[name='nick']").focus();
});
});
return false;
});
$('#hide_loginbutton').bind('click', function(e) {
$("#regform").fadeOut("fast", function() {
$("#regmenu").fadeIn("fast");
});
return false;
});
}
}
$(function() {
initLoginForm();
});
});
$(document).ready(function() {
function initCtrlEnter() {
function ctrl_enter(e, form) {
if (((e.keyCode == 13) || (e.keyCode == 10)) && (e.ctrlKey||e.metaKey)) {
window.onbeforeunload = null;
$(form).submit();
return false;
}
}
$('textarea').bind('keypress', function(e) {
ctrl_enter(e, e.target.form);
});
}
function initSamepageCommentNavigation() {
$("article.msg .title a[data-samepage]").click(function(event) {
event.preventDefault();
location.hash = "comment-" + this.search.substr(5);
})
}
function initScollupButton() {
var backButton = $('<button id="ft-back-button">');
backButton.text("Вверх");
backButton.click(function() {
$("html, body").animate({ scrollTop: 0 });
});
$('#ft').prepend(backButton);
}
function initUpdateEventsCount() {
function update_count() {
$.ajax({
url: "/notifications-count",
cache: false
}).success(function(data) {
var value = data==0 ? "" : ("("+data+")" );
$('#main_events_count').text(value);
});
}
$(function() {
if ($('#main_events_count').length>0) {
update_count();
}
});
}
initCtrlEnter();
initUpdateEventsCount();
initSamepageCommentNavigation();
initScollupButton();
replace_state()
$(window).bind('hashchange', replace_state);
});
| 26.152425 | 94 | 0.507683 |
1e42cd22fa35c6e801d9a03cd9a0d972026e27cb | 1,378 | js | JavaScript | assets/js/run_time.js | xeonds/xdu-ncov-check-in | 0a400579b7764cabfa2ef0fd62909eb2fa9948c2 | [
"MIT"
] | 1 | 2022-02-27T09:29:09.000Z | 2022-02-27T09:29:09.000Z | assets/js/run_time.js | xeonds/xdu-ncov-check-in | 0a400579b7764cabfa2ef0fd62909eb2fa9948c2 | [
"MIT"
] | null | null | null | assets/js/run_time.js | xeonds/xdu-ncov-check-in | 0a400579b7764cabfa2ef0fd62909eb2fa9948c2 | [
"MIT"
] | null | null | null | /* filename:run_time.js */
function time_calc(Y, M, D, h, m, s) {
var seconds = 1000;
var minutes = seconds * 60;
var hours = minutes * 60;
var days = hours * 24;
var years = days * 365;
var today = new Date();
var time = Date.UTC(today.getFullYear(), today.getMonth() + 1, today.getDate(), today.getHours(), today.getMinutes(), today.getSeconds()) - Date.UTC(Y, M, D, h, m, s);
var year = Math.floor(time / years)
var day = Math.floor((time / days) - year * 365);
var hour = Math.floor((time - (year * 365 + day) * days) / hours);
var minute = Math.floor((time - (year * 365 + day) * days - hour * hours) / minutes);
var second = Math.floor((time - (year * 365 + day) * days - hour * hours - minute * minutes) / seconds);
return { "year": year, "day": day, "hour": hour, "minute": minute, "second": second };
}
function site_run_time(Y,M,D,h,m,s)
{
window.setInterval(function() {
var time = time_calc(Y,M,D,h,m,s);
document.getElementById('time_year').innerText = time.year;
document.getElementById('time_day').innerText = time.day;
document.getElementById('time_hour').innerText = time.hour;
document.getElementById('time_minute').innerText = time.minute;
document.getElementById('time_second').innerText = time.second;
}, 1000);
} | 43.0625 | 172 | 0.605225 |
1e42dd5fa62a159cc6c1021f57b5a2b61eb56b9a | 4,160 | js | JavaScript | dist/packages/material/menu/menu-content.js | ttestman4/material2 | c7a467df82d2870ddaeda24f4b065e26011b7e6d | [
"MIT"
] | null | null | null | dist/packages/material/menu/menu-content.js | ttestman4/material2 | c7a467df82d2870ddaeda24f4b065e26011b7e6d | [
"MIT"
] | null | null | null | dist/packages/material/menu/menu-content.js | ttestman4/material2 | c7a467df82d2870ddaeda24f4b065e26011b7e6d | [
"MIT"
] | null | null | null | /**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { Directive, TemplateRef, ComponentFactoryResolver, ApplicationRef, Injector, ViewContainerRef, Inject, } from '@angular/core';
import { TemplatePortal, DomPortalOutlet } from '@angular/cdk/portal';
import { DOCUMENT } from '@angular/common';
import { Subject } from 'rxjs';
/**
* Menu content that will be rendered lazily once the menu is opened.
*/
export class MatMenuContent {
/**
* @param {?} _template
* @param {?} _componentFactoryResolver
* @param {?} _appRef
* @param {?} _injector
* @param {?} _viewContainerRef
* @param {?} _document
*/
constructor(_template, _componentFactoryResolver, _appRef, _injector, _viewContainerRef, _document) {
this._template = _template;
this._componentFactoryResolver = _componentFactoryResolver;
this._appRef = _appRef;
this._injector = _injector;
this._viewContainerRef = _viewContainerRef;
this._document = _document;
/**
* Emits when the menu content has been attached.
*/
this._attached = new Subject();
}
/**
* Attaches the content with a particular context.
* \@docs-private
* @param {?=} context
* @return {?}
*/
attach(context = {}) {
if (!this._portal) {
this._portal = new TemplatePortal(this._template, this._viewContainerRef);
}
this.detach();
if (!this._outlet) {
this._outlet = new DomPortalOutlet(this._document.createElement('div'), this._componentFactoryResolver, this._appRef, this._injector);
}
/** @type {?} */
const element = this._template.elementRef.nativeElement;
// Because we support opening the same menu from different triggers (which in turn have their
// own `OverlayRef` panel), we have to re-insert the host element every time, otherwise we
// risk it staying attached to a pane that's no longer in the DOM.
(/** @type {?} */ (element.parentNode)).insertBefore(this._outlet.outletElement, element);
this._portal.attach(this._outlet, context);
this._attached.next();
}
/**
* Detaches the content.
* \@docs-private
* @return {?}
*/
detach() {
if (this._portal.isAttached) {
this._portal.detach();
}
}
/**
* @return {?}
*/
ngOnDestroy() {
if (this._outlet) {
this._outlet.dispose();
}
}
}
MatMenuContent.decorators = [
{ type: Directive, args: [{
selector: 'ng-template[matMenuContent]'
},] },
];
/** @nocollapse */
MatMenuContent.ctorParameters = () => [
{ type: TemplateRef },
{ type: ComponentFactoryResolver },
{ type: ApplicationRef },
{ type: Injector },
{ type: ViewContainerRef },
{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
];
if (false) {
/**
* @type {?}
* @private
*/
MatMenuContent.prototype._portal;
/**
* @type {?}
* @private
*/
MatMenuContent.prototype._outlet;
/**
* Emits when the menu content has been attached.
* @type {?}
*/
MatMenuContent.prototype._attached;
/**
* @type {?}
* @private
*/
MatMenuContent.prototype._template;
/**
* @type {?}
* @private
*/
MatMenuContent.prototype._componentFactoryResolver;
/**
* @type {?}
* @private
*/
MatMenuContent.prototype._appRef;
/**
* @type {?}
* @private
*/
MatMenuContent.prototype._injector;
/**
* @type {?}
* @private
*/
MatMenuContent.prototype._viewContainerRef;
/**
* @type {?}
* @private
*/
MatMenuContent.prototype._document;
}
//# sourceMappingURL=menu-content.js.map | 29.090909 | 146 | 0.597115 |
1e43decb5837f89e80244dc8fe3a2f3823823a88 | 9,281 | js | JavaScript | intive-studio/assets/plugins/bower_components/moment/test/moment/diff.js | Krisnasw/Intive-Studio | 9b53d3dac3fb0bd19c8ab149c35c966bc690df77 | [
"Apache-2.0"
] | 1 | 2016-04-21T11:20:58.000Z | 2016-04-21T11:20:58.000Z | intive-studio/assets/plugins/bower_components/moment/test/moment/diff.js | Krisnasw/Intive-Studio | 9b53d3dac3fb0bd19c8ab149c35c966bc690df77 | [
"Apache-2.0"
] | null | null | null | intive-studio/assets/plugins/bower_components/moment/test/moment/diff.js | Krisnasw/Intive-Studio | 9b53d3dac3fb0bd19c8ab149c35c966bc690df77 | [
"Apache-2.0"
] | 2 | 2016-04-21T13:16:56.000Z | 2018-05-01T06:57:40.000Z | var moment = require("../../moment");
function equal(test, a, b, message) {
test.ok(Math.abs(a - b) < 0.00000001, "(" + a + " === " + b + ") " + message);
}
exports.diff = {
"diff" : function(test) {
test.expect(5);
test.equal(moment(1000).diff(0), 1000, "1 second - 0 = 1000");
test.equal(moment(1000).diff(500), 500, "1 second - 0.5 seconds = 500");
test.equal(moment(0).diff(1000), -1000, "0 - 1 second = -1000");
test.equal(moment(new Date(1000)).diff(1000), 0, "1 second - 1 second = 0");
var oneHourDate = new Date(),
nowDate = new Date(oneHourDate);
oneHourDate.setHours(oneHourDate.getHours() + 1);
test.equal(moment(oneHourDate).diff(nowDate), 60 * 60 * 1000, "1 hour from now = 360000");
test.done();
},
"diff key after" : function(test) {
test.expect(10);
test.equal(moment([2010]).diff([2011], 'years'), -1, "year diff");
test.equal(moment([2010]).diff([2010, 2], 'months'), -2, "month diff");
test.equal(moment([2010]).diff([2010, 0, 7], 'weeks'), 0, "week diff");
test.equal(moment([2010]).diff([2010, 0, 8], 'weeks'), -1, "week diff");
test.equal(moment([2010]).diff([2010, 0, 21], 'weeks'), -2, "week diff");
test.equal(moment([2010]).diff([2010, 0, 22], 'weeks'), -3, "week diff");
test.equal(moment([2010]).diff([2010, 0, 4], 'days'), -3, "day diff");
test.equal(moment([2010]).diff([2010, 0, 1, 4], 'hours'), -4, "hour diff");
test.equal(moment([2010]).diff([2010, 0, 1, 0, 5], 'minutes'), -5, "minute diff");
test.equal(moment([2010]).diff([2010, 0, 1, 0, 0, 6], 'seconds'), -6, "second diff");
test.done();
},
"diff key before" : function(test) {
test.expect(10);
test.equal(moment([2011]).diff([2010], 'years'), 1, "year diff");
test.equal(moment([2010, 2]).diff([2010], 'months'), 2, "month diff");
test.equal(moment([2010, 0, 4]).diff([2010], 'days'), 3, "day diff");
test.equal(moment([2010, 0, 7]).diff([2010], 'weeks'), 0, "week diff");
test.equal(moment([2010, 0, 8]).diff([2010], 'weeks'), 1, "week diff");
test.equal(moment([2010, 0, 21]).diff([2010], 'weeks'), 2, "week diff");
test.equal(moment([2010, 0, 22]).diff([2010], 'weeks'), 3, "week diff");
test.equal(moment([2010, 0, 1, 4]).diff([2010], 'hours'), 4, "hour diff");
test.equal(moment([2010, 0, 1, 0, 5]).diff([2010], 'minutes'), 5, "minute diff");
test.equal(moment([2010, 0, 1, 0, 0, 6]).diff([2010], 'seconds'), 6, "second diff");
test.done();
},
"diff key before singular" : function(test) {
test.expect(10);
test.equal(moment([2011]).diff([2010], 'year'), 1, "year diff singular");
test.equal(moment([2010, 2]).diff([2010], 'month'), 2, "month diff singular");
test.equal(moment([2010, 0, 4]).diff([2010], 'day'), 3, "day diff singular");
test.equal(moment([2010, 0, 7]).diff([2010], 'week'), 0, "week diff singular");
test.equal(moment([2010, 0, 8]).diff([2010], 'week'), 1, "week diff singular");
test.equal(moment([2010, 0, 21]).diff([2010], 'week'), 2, "week diff singular");
test.equal(moment([2010, 0, 22]).diff([2010], 'week'), 3, "week diff singular");
test.equal(moment([2010, 0, 1, 4]).diff([2010], 'hour'), 4, "hour diff singular");
test.equal(moment([2010, 0, 1, 0, 5]).diff([2010], 'minute'), 5, "minute diff singular");
test.equal(moment([2010, 0, 1, 0, 0, 6]).diff([2010], 'second'), 6, "second diff singular");
test.done();
},
"diff month" : function(test) {
test.expect(1);
test.equal(moment([2011, 0, 31]).diff([2011, 2, 1], 'months'), -1, "month diff");
test.done();
},
"diff across DST" : function(test) {
test.expect(2);
test.equal(moment([2012, 2, 24]).diff([2012, 2, 10], 'weeks', true), 2, "diff weeks across DST");
test.equal(moment([2012, 2, 24]).diff([2012, 2, 10], 'days', true), 14, "diff weeks across DST");
test.done();
},
"diff overflow" : function(test) {
test.expect(4);
test.equal(moment([2011]).diff([2010], 'months'), 12, "month diff");
test.equal(moment([2010, 0, 2]).diff([2010], 'hours'), 24, "hour diff");
test.equal(moment([2010, 0, 1, 2]).diff([2010], 'minutes'), 120, "minute diff");
test.equal(moment([2010, 0, 1, 0, 4]).diff([2010], 'seconds'), 240, "second diff");
test.done();
},
"diff between utc and local" : function(test) {
test.expect(7);
test.equal(moment([2011]).utc().diff([2010], 'years'), 1, "year diff");
test.equal(moment([2010, 2]).utc().diff([2010], 'months'), 2, "month diff");
test.equal(moment([2010, 0, 4]).utc().diff([2010], 'days'), 3, "day diff");
test.equal(moment([2010, 0, 22]).utc().diff([2010], 'weeks'), 3, "week diff");
test.equal(moment([2010, 0, 1, 4]).utc().diff([2010], 'hours'), 4, "hour diff");
test.equal(moment([2010, 0, 1, 0, 5]).utc().diff([2010], 'minutes'), 5, "minute diff");
test.equal(moment([2010, 0, 1, 0, 0, 6]).utc().diff([2010], 'seconds'), 6, "second diff");
test.done();
},
"diff floored" : function(test) {
test.expect(7);
test.equal(moment([2010, 0, 1, 23]).diff([2010], 'day'), 0, "23 hours = 0 days");
test.equal(moment([2010, 0, 1, 23, 59]).diff([2010], 'day'), 0, "23:59 hours = 0 days");
test.equal(moment([2010, 0, 1, 24]).diff([2010], 'day'), 1, "24 hours = 1 day");
test.equal(moment([2010, 0, 2]).diff([2011, 0, 1], 'year'), 0, "year rounded down");
test.equal(moment([2011, 0, 1]).diff([2010, 0, 2], 'year'), 0, "year rounded down");
test.equal(moment([2010, 0, 2]).diff([2011, 0, 2], 'year'), -1, "year rounded down");
test.equal(moment([2011, 0, 2]).diff([2010, 0, 2], 'year'), 1, "year rounded down");
test.done();
},
"year diffs include dates" : function(test) {
test.expect(1);
test.ok(moment([2012, 1, 19]).diff(moment([2002, 1, 20]), 'years', true) < 10, "year diff should include date of month");
test.done();
},
"month diffs" : function (test) {
test.expect(8);
// due to floating point math errors, these tests just need to be accurate within 0.00000001
equal(test, moment([2012, 0, 1]).diff([2012, 1, 1], 'months', true), -1, 'Jan 1 to Feb 1 should be 1 month');
equal(test, moment([2012, 0, 1]).diff([2012, 0, 1, 12], 'months', true), -0.5/31, 'Jan 1 to Jan 1 noon should be 0.5/31 months');
equal(test, moment([2012, 0, 15]).diff([2012, 1, 15], 'months', true), -1, 'Jan 15 to Feb 15 should be 1 month');
equal(test, moment([2012, 0, 28]).diff([2012, 1, 28], 'months', true), -1, 'Jan 28 to Feb 28 should be 1 month');
equal(test, moment([2012, 0, 31]).diff([2012, 1, 29], 'months', true), -1 + (2/30), 'Jan 31 to Feb 29 should be 1 - (2/30) months');
equal(test, moment([2012, 0, 31]).diff([2012, 2, 1], 'months', true), -2 + (30/31), 'Jan 31 to Mar 1 should be 2 - (30/31) months');
equal(test, moment([2012, 0, 31]).diff([2012, 2, 1, 12], 'months', true), -2 + (29.5/31), 'Jan 31 to Mar 1 should be 2 - (29.5/31) months');
equal(test, moment([2012, 0, 1]).diff([2012, 0, 31], 'months', true), -(30 / 31), 'Jan 1 to Jan 31 should be 30/31 months');
test.done();
},
"year diffs" : function (test) {
test.expect(10);
// due to floating point math errors, these tests just need to be accurate within 0.00000001
equal(test, moment([2012, 0, 1]).diff([2013, 0, 1], 'years', true), -1, 'Jan 1 2012 to Jan 1 2013 should be 1 year');
equal(test, moment([2012, 1, 28]).diff([2013, 1, 28], 'years', true), -1, 'Feb 28 2012 to Feb 28 2013 should be 1 year');
equal(test, moment([2012, 2, 1]).diff([2013, 2, 1], 'years', true), -1, 'Mar 1 2012 to Mar 1 2013 should be 1 year');
equal(test, moment([2012, 11, 1]).diff([2013, 11, 1], 'years', true), -1, 'Dec 1 2012 to Dec 1 2013 should be 1 year');
equal(test, moment([2012, 11, 31]).diff([2013, 11, 31], 'years', true), -1, 'Dec 31 2012 to Dec 31 2013 should be 1 year');
equal(test, moment([2012, 0, 1]).diff([2013, 6, 1], 'years', true), -1.5, 'Jan 1 2012 to Jul 1 2013 should be 1.5 years');
equal(test, moment([2012, 0, 31]).diff([2013, 6, 31], 'years', true), -1.5, 'Jan 31 2012 to Jul 31 2013 should be 1.5 years');
equal(test, moment([2012, 0, 1]).diff([2013, 0, 1, 12], 'years', true), -1-(0.5/31)/12, 'Jan 1 2012 to Jan 1 2013 noon should be 1+(0.5/31)/12 years');
equal(test, moment([2012, 0, 1]).diff([2013, 6, 1, 12], 'years', true), -1.5-(0.5/31)/12, 'Jan 1 2012 to Jul 1 2013 noon should be 1.5+(0.5/31)/12 years');
equal(test, moment([2012, 1, 29]).diff([2013, 1, 28], 'years', true), -1 + (1/28.5)/12, 'Feb 29 2012 to Feb 28 2013 should be 1-(1/28.5)/12 years');
test.done();
}
};
| 56.248485 | 164 | 0.539813 |
1e451663798039720800758f79859cf9021f4890 | 298 | js | JavaScript | jest.config.js | oslabs-beta/Boost | 2d6ffdad1592a7ac2d43408db071030d6c34e218 | [
"MIT"
] | 3 | 2022-03-21T17:00:44.000Z | 2022-03-26T20:00:45.000Z | jest.config.js | oslabs-beta/Boost | 2d6ffdad1592a7ac2d43408db071030d6c34e218 | [
"MIT"
] | 3 | 2022-03-23T15:48:09.000Z | 2022-03-23T17:14:48.000Z | jest.config.js | oslabs-beta/Boost | 2d6ffdad1592a7ac2d43408db071030d6c34e218 | [
"MIT"
] | 4 | 2022-03-21T17:09:15.000Z | 2022-03-22T15:13:24.000Z | /* global module */
module.exports = {
preset: "ts-jest/presets/default-esm",
testEnvironment: "jsdom",
globals: {
"ts-jest": {
useESM: true,
},
moduleNameMapper: {
"^(\\.{1,2}/.*)\\.js$": "$1",
"^.+\\.(css|less)$": "<rootDir>/config/CSSStub.js",
},
},
};
| 19.866667 | 57 | 0.493289 |
1e45188e760af1d57536daecec0b4a1e050dd976 | 12,088 | js | JavaScript | src/router/index.js | marceloatg/vuetning | 20bbd1c540d00dd4084455872ff2f75ca7136b24 | [
"MIT"
] | 15 | 2020-01-30T18:41:50.000Z | 2021-12-09T17:52:14.000Z | src/router/index.js | marceloatg/vuetning | 20bbd1c540d00dd4084455872ff2f75ca7136b24 | [
"MIT"
] | 13 | 2020-08-16T14:50:30.000Z | 2020-12-02T16:20:06.000Z | src/router/index.js | marceloatg/vuetning | 20bbd1c540d00dd4084455872ff2f75ca7136b24 | [
"MIT"
] | 4 | 2020-08-16T18:37:04.000Z | 2022-01-18T18:28:15.000Z | import Vue from 'vue'
import VueRouter from 'vue-router'
import Accordion from '../views/components/Accordion'
import ActivityTimeline from '../views/components/ActivityTimeline'
import Alert from '../views/components/Alert'
import AppLauncher from '../views/components/AppLauncher'
import Avatar from '../views/components/Avatar'
import AvatarGroup from '../views/components/AvatarGroup'
import Badge from '../views/components/Badge'
import BrandBand from '../views/components/BrandBand'
import Breadcrumbs from '../views/components/Breadcrumbs'
import BuilderHeader from '../views/components/BuilderHeader'
import Button from '../views/components/Button'
import ButtonGroup from '../views/components/ButtonGroup'
import ButtonIcon from '../views/components/ButtonIcon'
import Card from '../views/components/Card'
import Carousel from '../views/components/Carousel'
import Chat from '../views/components/Chat'
import Checkbox from '../views/components/Checkbox'
import CheckboxButton from '../views/components/CheckboxButton'
import CheckboxButtonGroup from '../views/components/CheckboxButtonGroup'
import CheckboxGroup from '../views/components/CheckboxGroup'
import CheckboxToggle from '../views/components/CheckboxToggle'
import CodeBlock from '../views/components/CodeBlock'
import ColorPicker from '../views/components/ColorPicker'
import Combobox from '../views/components/Combobox'
import Counter from '../views/components/Counter'
import DataTable from '../views/components/DataTable'
import DatePicker from '../views/components/DatePicker'
import DatetimePicker from '../views/components/DatetimePicker'
import DockedComposer from '../views/components/DockedComposer'
import DockedFormFooter from '../views/components/DockedFormFooter'
import DockedUtilityBar from '../views/components/DockedUtilityBar'
import DropZone from '../views/components/DropZone'
import DuelingPicklist from '../views/components/DuelingPicklist'
import DynamicIcon from '../views/components/DynamicIcon'
import DynamicMenu from '../views/components/DynamicMenu'
import ExpandableSection from '../views/components/ExpandableSection'
import Expression from '../views/components/Expression'
import Feed from '../views/components/Feed'
import File from '../views/components/File'
import FileSelector from '../views/components/FileSelector'
import GlobalHeader from '../views/components/GlobalHeader'
import GlobalNavigation from '../views/components/GlobalNavigation'
import Home from '../views/Home.vue'
import Icon from '../views/components/Icon'
import Illustration from '../views/components/Illustration'
import Input from '../views/components/Input'
import ListBuilder from '../views/components/ListBuilder'
import Lookup from '../views/components/Lookup'
import Map from '../views/components/Map'
import Menu from '../views/components/Menu'
import Modal from '../views/components/Modal'
import Notifications from '../views/components/Notifications'
import PageHeader from '../views/components/PageHeader'
import Panel from '../views/components/Panel'
import Path from '../views/components/Path'
import Picklist from '../views/components/Picklist'
import Pill from '../views/components/Pill'
import Popover from '../views/components/Popover'
import ProgressBar from '../views/components/ProgressBar'
import ProgressIndicator from '../views/components/ProgressIndicator'
import ProgressRing from '../views/components/ProgressRing'
import Prompt from '../views/components/Prompt'
import Publisher from '../views/components/Publisher'
import RadioButtonGroup from '../views/components/RadioButtonGroup'
import RadioGroup from '../views/components/RadioGroup'
import RichTextEditor from '../views/components/RichTextEditor'
import ScopedNotification from '../views/components/ScopedNotification'
import ScopedTabs from '../views/components/ScopedTabs'
import SetupAssistant from '../views/components/SetupAssistant'
import Slider from '../views/components/Slider'
import Spinner from '../views/components/Spinner'
import SplitView from '../views/components/SplitView'
import SummaryDetail from '../views/components/SummaryDetail'
import Tabs from '../views/components/Tabs'
import TextArea from '../views/components/TextArea'
import Tile from '../views/components/Tile'
import TimePicker from '../views/components/TimePicker'
import Toasts from '../views/components/Toasts'
import Tooltip from '../views/components/Tooltip'
import Tree from '../views/components/Tree'
import TreeGrid from '../views/components/TreeGrid'
import TrialBar from '../views/components/TrialBar'
import VerticalNavigation from '../views/components/VerticalNavigation'
import VerticalTabs from '../views/components/VerticalTabs'
import VisualPicker from '../views/components/VisualPicker'
import WelcomeMat from '../views/components/WelcomeMat'
Vue.use(VueRouter)
const routes = [
{
path: '/',
name: 'Home',
component: Home
},
{
path: '/Accordion',
name: 'Accordion',
component: Accordion
},
{
path: '/ActivityTimeline',
name: 'ActivityTimeline',
component: ActivityTimeline
},
{
path: '/Alert',
name: 'Alert',
component: Alert
},
{
path: '/AppLauncher',
name: 'AppLauncher',
component: AppLauncher
},
{
path: '/Avatar',
name: 'Avatar',
component: Avatar
},
{
path: '/AvatarGroup',
name: 'AvatarGroup',
component: AvatarGroup
},
{
path: '/Badge',
name: 'Badge',
component: Badge
},
{
path: '/BrandBand',
name: 'BrandBand',
component: BrandBand
},
{
path: '/Breadcrumbs',
name: 'Breadcrumbs',
component: Breadcrumbs
},
{
path: '/BuilderHeader',
name: 'BuilderHeader',
component: BuilderHeader
},
{
path: '/Button',
name: 'Button',
component: Button
},
{
path: '/ButtonGroup',
name: 'ButtonGroup',
component: ButtonGroup
},
{
path: '/ButtonIcon',
name: 'ButtonIcon',
component: ButtonIcon
},
{
path: '/Card',
name: 'Card',
component: Card
},
{
path: '/Carousel',
name: 'Carousel',
component: Carousel
},
{
path: '/Chat',
name: 'Chat',
component: Chat
},
{
path: '/CheckboxButton',
name: 'CheckboxButton',
component: CheckboxButton
},
{
path: '/CheckboxButtonGroup',
name: 'CheckboxButtonGroup',
component: CheckboxButtonGroup
},
{
path: '/Checkbox',
name: 'Checkbox',
component: Checkbox
},
{
path: '/CheckboxGroup',
name: 'CheckboxGroup',
component: CheckboxGroup
},
{
path: '/CheckboxToggle',
name: 'CheckboxToggle',
component: CheckboxToggle
},
{
path: '/CodeBlock',
name: 'CodeBlock',
component: CodeBlock
},
{
path: '/ColorPicker',
name: 'ColorPicker',
component: ColorPicker
},
{
path: '/Combobox',
name: 'Combobox',
component: Combobox
},
{
path: '/Counter',
name: 'Counter',
component: Counter
},
{
path: '/DataTable',
name: 'DataTable',
component: DataTable
},
{
path: '/DatePicker',
name: 'DatePicker',
component: DatePicker
},
{
path: '/DatetimePicker',
name: 'DatetimePicker',
component: DatetimePicker
},
{
path: '/DockedComposer',
name: 'DockedComposer',
component: DockedComposer
},
{
path: '/DockedFormFooter',
name: 'DockedFormFooter',
component: DockedFormFooter
},
{
path: '/DockedUtilityBar',
name: 'DockedUtilityBar',
component: DockedUtilityBar
},
{
path: '/DropZone',
name: 'DropZone',
component: DropZone
},
{
path: '/DuelingPicklist',
name: 'DuelingPicklist',
component: DuelingPicklist
},
{
path: '/DynamicIcon',
name: 'DynamicIcon',
component: DynamicIcon
},
{
path: '/DynamicMenu',
name: 'DynamicMenu',
component: DynamicMenu
},
{
path: '/ExpandableSection',
name: 'ExpandableSection',
component: ExpandableSection
},
{
path: '/Expression',
name: 'Expression',
component: Expression
},
{
path: '/Feed',
name: 'Feed',
component: Feed
},
{
path: '/File',
name: 'File',
component: File
},
{
path: '/FileSelector',
name: 'FileSelector',
component: FileSelector
},
{
path: '/GlobalHeader',
name: 'GlobalHeader',
component: GlobalHeader
},
{
path: '/GlobalNavigation',
name: 'GlobalNavigation',
component: GlobalNavigation
},
{
path: '/Icon',
name: 'Icon',
component: Icon
},
{
path: '/Illustration',
name: 'Illustration',
component: Illustration
},
{
path: '/Input',
name: 'Input',
component: Input
},
{
path: '/ListBuilder',
name: 'ListBuilder',
component: ListBuilder
},
{
path: '/Lookup',
name: 'Lookup',
component: Lookup
},
{
path: '/Map',
name: 'Map',
component: Map
},
{
path: '/Menu',
name: 'Menu',
component: Menu
},
{
path: '/Modal',
name: 'Modal',
component: Modal
},
{
path: '/Notifications',
name: 'Notifications',
component: Notifications
},
{
path: '/PageHeader',
name: 'PageHeader',
component: PageHeader
},
{
path: '/Panel',
name: 'Panel',
component: Panel
},
{
path: '/Path',
name: 'Path',
component: Path
},
{
path: '/Picklist',
name: 'Picklist',
component: Picklist
},
{
path: '/Pill',
name: 'Pill',
component: Pill
},
{
path: '/Popover',
name: 'Popover',
component: Popover
},
{
path: '/ProgressBar',
name: 'ProgressBar',
component: ProgressBar
},
{
path: '/ProgressIndicator',
name: 'ProgressIndicator',
component: ProgressIndicator
},
{
path: '/ProgressRing',
name: 'ProgressRing',
component: ProgressRing
},
{
path: '/Prompt',
name: 'Prompt',
component: Prompt
},
{
path: '/Publisher',
name: 'Publisher',
component: Publisher
},
{
path: '/RadioButtonGroup',
name: 'RadioButtonGroup',
component: RadioButtonGroup
},
{
path: '/RadioGroup',
name: 'RadioGroup',
component: RadioGroup
},
{
path: '/RichTextEditor',
name: 'RichTextEditor',
component: RichTextEditor
},
{
path: '/ScopedNotification',
name: 'ScopedNotification',
component: ScopedNotification
},
{
path: '/ScopedTabs',
name: 'ScopedTabs',
component: ScopedTabs
},
{
path: '/SetupAssistant',
name: 'SetupAssistant',
component: SetupAssistant
},
{
path: '/Slider',
name: 'Slider',
component: Slider
},
{
path: '/Spinner',
name: 'Spinner',
component: Spinner
},
{
path: '/SplitView',
name: 'SplitView',
component: SplitView
},
{
path: '/SummaryDetail',
name: 'SummaryDetail',
component: SummaryDetail
},
{
path: '/Tabs',
name: 'Tabs',
component: Tabs
},
{
path: '/TextArea',
name: 'TextArea',
component: TextArea
},
{
path: '/Tile',
name: 'Tile',
component: Tile
},
{
path: '/TimePicker',
name: 'TimePicker',
component: TimePicker
},
{
path: '/Toasts',
name: 'Toasts',
component: Toasts
},
{
path: '/Tooltip',
name: 'Tooltip',
component: Tooltip
},
{
path: '/Tree',
name: 'Tree',
component: Tree
},
{
path: '/TreeGrid',
name: 'TreeGrid',
component: TreeGrid
},
{
path: '/TrialBar',
name: 'TrialBar',
component: TrialBar
},
{
path: '/VerticalNavigation',
name: 'VerticalNavigation',
component: VerticalNavigation
},
{
path: '/VerticalTabs',
name: 'VerticalTabs',
component: VerticalTabs
},
{
path: '/VisualPicker',
name: 'VisualPicker',
component: VisualPicker
},
{
path: '/WelcomeMat',
name: 'WelcomeMat',
component: WelcomeMat
},
]
const router = new VueRouter({
mode: 'history',
base: process.env.BASE_URL,
routes
})
export default router
| 22.679174 | 73 | 0.653293 |
1e45224cf1a55e03bb11cb543f2c3d858c3e4e87 | 7,074 | js | JavaScript | Public/admin/js/outlib.js | 181675232/building | dd3e3b3fda374e9d68df94bc2837d8ecdaa53b4c | [
"BSD-2-Clause"
] | null | null | null | Public/admin/js/outlib.js | 181675232/building | dd3e3b3fda374e9d68df94bc2837d8ecdaa53b4c | [
"BSD-2-Clause"
] | null | null | null | Public/admin/js/outlib.js | 181675232/building | dd3e3b3fda374e9d68df94bc2837d8ecdaa53b4c | [
"BSD-2-Clause"
] | null | null | null | /**
* Created by ASUS on 2016/1/3.
*/
$(function () {
$('#outlib').datagrid({
url : ThinkPHP['MODULE'] + '/Outlib/getList',
fit : true,
fitColumns : true,
striped : true,
rownumbers : true,
border : false,
pagination : true,
pageSize : 20,
pageList : [10, 20, 30, 40, 50],
pageNumber : 1,
sortName : 'create_time',
sortOrder : 'DESC',
toolbar : '#outlib-tool',
columns : [[
{
field : 'id',
title : '编号',
width : 60,
checkbox : true
},
{
field : 'sn',
title : '产品编号',
width : 60
},
{
field : 'name',
title : '产品名称',
width : 120
},
{
field : 'sell_price',
title : '销售价格',
width : 60
},
{
field : 'number',
title : '出货量',
width : 40
},
{
field : 'order_sn',
title : '所属订单',
width : 80
},
{
field : 'clerk',
title : '发货员',
width : 60
},
{
field : 'keyboarder',
title : '录入员',
width : 60
},
{
field : 'state',
title : '状态',
width : 60
},
{
field : 'dispose_time',
title : '出库时间',
width : 100,
sortable : true
},
{
field : 'create_time',
title : '创建时间',
width : 100,
sortable : true
}
]],
onClickCell : function (index, field) {
if (field == 'state' || field == 'details') {
$('#product').datagrid('selectRow', index);
}
}
});
//时间搜索
$('#outlib-search-date').combobox({
width : 90,
data : [{
id : 'create_time',
text : '创建时间'
}],
editable : false,
valueField : 'id',
textField : 'text',
required : true,
missingMessage : '选择时间类型',
panelHeight : 'auto',
tipPosition : 'left',
novalidate : true
});
//选择时间触发验证
$('#outlib-search-date-from, #outlib-search-date-to').datebox({
onSelect : function () {
if ($('#outlib-search-date').combobox('enableValidation').combobox('isValid') == false) {
$('#outlib-search-date').combobox('showPanel');
}
}
});
});
//工具栏操作模块
var outlib_tool = {
search : function () {
if ($('#outlib-tool').form('validate')) {
$('#outlib').datagrid('load', {
keywords: $.trim($('input[name="outlib_search_keywords"]').val()),
date: $('input[name="outlib_search_date"]').val(),
date_from: $('input[name="outlib_search_date_from"]').val(),
date_to: $('input[name="outlib_search_date_to"]').val()
});
} else {
$('#outlib-search-date').combobox('showPanel');
}
},
details : function (id) {
$('#details-dialog').
dialog('open').
dialog('setTitle', '产品信息详情').
dialog('refresh', ThinkPHP['MODULE'] + '/Outlib/getDetails/?id=' + id);
},
deliver : function () {
var rows = $('#outlib').datagrid('getSelections');
if (rows.length > 0) {
$.messager.confirm('确认操作', '您要批量发货 <strong>' + rows.length + '</strong> 件产品吗?', function (flag) {
if (flag) {
var ids = [];
for (var i = 0; i < rows.length; i ++) {
ids.push(rows[i].id);
}
$.ajax({
url : ThinkPHP['MODULE'] + '/Outlib/deliver',
type : 'POST',
data : {
ids : ids.join(',')
},
beforeSend : function () {
$('#outlib').datagrid('loading');
},
success : function(data, response, status) {
if (data) {
$('#outlib').datagrid('loaded');
$('#outlib').datagrid('reload');
$.messager.show({
title : '操作提醒',
msg : data + '件产品成功出库!'
});
}
}
});
}
});
} else {
$.messager.alert('警告操作', '批量发货最少需要指定一件!', 'warning');
}
},
repeal : function () {
var rows = $('#outlib').datagrid('getSelections');
if (rows.length > 0) {
$.messager.confirm('确认操作', '您要批量撤销发货 <strong>' + rows.length + '</strong> 件产品吗?', function (flag) {
if (flag) {
var ids = [];
for (var i = 0; i < rows.length; i ++) {
ids.push(rows[i].id);
}
$.ajax({
url : ThinkPHP['MODULE'] + '/Outlib/repeal',
type : 'POST',
data : {
ids : ids.join(',')
},
beforeSend : function () {
$('#outlib').datagrid('loading');
},
success : function(data, response, status) {
if (data) {
$('#outlib').datagrid('loaded');
$('#outlib').datagrid('reload');
$.messager.show({
title : '操作提醒',
msg : data + '件产品成功撤销出库!'
});
}
}
});
}
});
} else {
$.messager.alert('警告操作', '批量发货最少需要指定一件!', 'warning');
}
},
reload : function () {
$('#outlib').datagrid('reload');
},
reset : function () {
$('#outlib-search-keywords').textbox('clear');
$('#outlib-search-date').combobox('clear').combobox('disableValidation');
$('#outlib-search-date-from').datebox('clear');
$('#outlib-search-date-to').datebox('clear');
$('#outlib').datagrid('resetSort', {
sortName : 'create_time',
sortOrder : 'desc'
});
this.search();
}
};
| 30.89083 | 111 | 0.351145 |
1e45445f2967d743e3b0644a87c00ce8876fd1b9 | 2,255 | js | JavaScript | src/api/NewHitsPlaylistFetcher.js | PeterDaveHelloKitchen/OpenAPI-JavaScript | ca2cbd287851de2aa95833eb62db110858eaf4a1 | [
"Apache-2.0"
] | null | null | null | src/api/NewHitsPlaylistFetcher.js | PeterDaveHelloKitchen/OpenAPI-JavaScript | ca2cbd287851de2aa95833eb62db110858eaf4a1 | [
"Apache-2.0"
] | 2 | 2021-09-02T19:16:37.000Z | 2022-02-13T23:49:03.000Z | src/api/NewHitsPlaylistFetcher.js | PeterDaveHelloKitchen/OpenAPI-JavaScript | ca2cbd287851de2aa95833eb62db110858eaf4a1 | [
"Apache-2.0"
] | null | null | null | import { NEW_HITS_PLAYLISTS as ENDPOINT } from '../Endpoint';
import Fetcher from './Fetcher';
/**
* List new hits playlists.
* @see https://docs-en.kkbox.codes/v1.1/reference#new-hits-playlists
*/
export default class NewHitsPlaylistFetcher extends Fetcher {
/**
* @ignore
*/
constructor(http, territory = 'TW') {
super(http, territory);
/**
* @ignore
*/
this.playlistID = undefined;
}
/**
* Fetch all new hits playlists.
*
* @param {number} [limit] - The size of one page.
* @param {number} [offset] - The offset index for first element.
* @return {Promise}
* @example api.newHitsPlaylistFetcher.fetchAllNewHitsPlaylists();
* @see https://docs-en.kkbox.codes/v1.1/reference#newhitsplaylists
*/
fetchAllNewHitsPlaylists(limit = undefined, offset = undefined) {
return this.http.get(ENDPOINT, {
territory: this.territory
});
}
/**
* Init the new hits playlist fetcher.
*
* @param {string} playlistID - The playlist ID.
* @return {NewHitsPlaylistFetcher}
* @see https://docs-en.kkbox.codes/v1.1/reference#newhitsplaylists-playlist_id
*/
setPlaylistID(playlistID) {
this.playlistID = playlistID;
return this;
}
/**
* Fetch metadata of the new hits playlist you set.
*
* @return {Promise}
* @example api.newHitsPlaylistFetcher.setPlaylistID('DZrC8m29ciOFY2JAm3').fetchMetadata();
* @see https://docs-en.kkbox.codes/v1.1/reference#newhitsplaylists-playlist_id
*/
fetchMetadata() {
return this.http.get(ENDPOINT + '/' + this.playlistID, {
territory: this.territory
});
}
/**
* Fetch tracks of the new hits playlist you set. Result will be paged.
*
* @param {number} [limit] - The size of one page.
* @param {number} [offset] - The offset index for first element.
* @return {Promise}
* @example api.newHitsPlaylistFetcher.setPlaylistID('DZrC8m29ciOFY2JAm3').fetchTracks();
* @see https://docs-en.kkbox.codes/v1.1/reference#newhitsplaylists-playlist_id-tracks
*/
fetchTracks(limit = undefined, offset = undefined) {
return this.http.get(ENDPOINT + '/' + this.playlistID + '/tracks', {
territory: this.territory,
limit: limit,
offset: offset
});
}
}
| 28.910256 | 93 | 0.661197 |
1e45ce3acca90560dbb6165dbc9c27ab886348a9 | 292 | js | JavaScript | js-iniciante/tudo-e-objeto/scripts-aula.js | Robert-Marchinhaki/JS_Completo_ES6-_Origamid | 4193909739d457eb9a1a85772d10e7642c5bb400 | [
"MIT"
] | null | null | null | js-iniciante/tudo-e-objeto/scripts-aula.js | Robert-Marchinhaki/JS_Completo_ES6-_Origamid | 4193909739d457eb9a1a85772d10e7642c5bb400 | [
"MIT"
] | null | null | null | js-iniciante/tudo-e-objeto/scripts-aula.js | Robert-Marchinhaki/JS_Completo_ES6-_Origamid | 4193909739d457eb9a1a85772d10e7642c5bb400 | [
"MIT"
] | null | null | null | nome = 'Robert'
nomeMinusculo = nome.toLowerCase()
nomeMaisculo = nome.toUpperCase()
console.log(nomeMinusculo)
console.log(nomeMaisculo)
var btn = document.querySelector('.btn');
btn.classList.add('azul');
btn.innerText;
btn.addEventListener('click', function() {
console.log('clicou')
}) | 24.333333 | 42 | 0.75 |
1e45e1e0a599c2e1e1f8393fad9a0e667ebda547 | 5,295 | js | JavaScript | public/scripts/index.js | ca2los/notegen | 69f24f67c348e72e24aaedf2babe66362bd32675 | [
"MIT"
] | null | null | null | public/scripts/index.js | ca2los/notegen | 69f24f67c348e72e24aaedf2babe66362bd32675 | [
"MIT"
] | null | null | null | public/scripts/index.js | ca2los/notegen | 69f24f67c348e72e24aaedf2babe66362bd32675 | [
"MIT"
] | null | null | null | // 07. CREATE HTML ON LOAD
const note_form = document.getElementById('note_form');
const note_container = document.getElementById('note_container');
// CREATE CARDS: Shows the 'rendered' and 'created' cards.
const createCard = (note) => {
// DIV: CARD (CREATE)
const cardEl = document.createElement('div');
cardEl.classList.add('card');
cardEl.setAttribute('key', note.note_id);
// DIV: CARD -> H4 (CREATE)
const cardHeaderEl = document.createElement('h4');
cardHeaderEl.classList.add('card-header');
cardHeaderEl.innerHTML = `${note.username} </br>`;
// DIV: CARD -> BODY P
const cardBodyEl = document.createElement('div');
cardBodyEl.classList.add('card-body');
cardBodyEl.innerHTML = `<p>${note.note}</p>`;
// DIV: CARD -> DELETE BTN
const cardButton = document.createElement('button');
cardButton.classList.add('card-button');
cardButton.setAttribute('type','button');
cardButton.innerHTML = '❌';
cardButton.addEventListener('click', function() {
cardEl.style.display = 'none';
})
// DIVS: APPEND -> INSIDE HTML
cardEl.appendChild(cardHeaderEl);
cardEl.appendChild(cardBodyEl);
cardEl.appendChild(cardButton);
// APPEND: CARD INSIDE DOM
note_container.appendChild(cardEl);
};
// GET: Obtaining the data from the API as JSON
const get_notes = () =>
fetch('/api/notes', {
method: 'GET', // or 'PUT'
headers: {
'Content-Type': 'application/json',
},
// body: JSON.stringify(data),
})
.then((response) => response.json())
.then((data) => data)
.catch((error) => {
console.error('Error:', error);
});
// POST: Adding a new note inside the API as JSON
const post_note = (note) =>
fetch('/api/notes', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(note),
})
.then((response) => response.json())
.then((data) => {
alert(data);
createCard(note);
})
.catch((error) => {
console.error('Error:', error);
});
// ON LOAD: Webpage shows data on load
get_notes().then((data) => data.forEach((note) => createCard(note)));
// VALIDATION: For created notes
const validatenote = (newnote) => {
const { username, topic, note } = newnote;
// ERROR: Hold messages until they are ready
const errorState = {
username: '',
note: '',
topic: '',
};
// ERROR: User length < 4
const utest = username.length >= 4;
if (!utest) {
errorState.username = 'Invalid username!';
}
// ERROR: Content length < 15
const noteContentCheck = note.length > 15;
if (!noteContentCheck) {
errorState.note = 'note must be at least 15 characters';
}
// ERROR: Topic is not UX or UI
const topicCheck = topic.includes('UX' || 'UI');
if (!topicCheck) {
errorState.topic = 'Topic not relevant to UX or UI';
}
const result = {
isValid: !!(utest && noteContentCheck && topicCheck),
errors: errorState,
};
return result;
};
// HELPER: Errors from the result
const showErrors = (errorObj) => {
const errors = Object.values(errorObj);
errors.forEach((error) => {
if (error.length > 0) {
alert(error);
}
});
};
// HELPER: Post request to validate data
const submitDiagnostics = (submissionObj) => {
fetch('/api/validation', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(submissionObj),
})
.then((response) => response.json())
.then(() => showErrors(submissionObj.errors))
.catch((error) => {
console.error('Error:', error);
});
};
// WHEN the form is submitted
const handleFormSubmit = (e) => {
e.preventDefault();
console.log('Form submit invoked');
// GET the value of the note and save it to a variable
const noteContent = document.getElementById('note_text').value;
// GET the value of the username and save it to a variable
const note_user = document.getElementById('note_user').value.trim();
// CREATE an object with the note and username
const newnote = {
username: note_user,
topic: 'UX',
note: noteContent,
};
// Run the note object through our validator function
const submission = validatenote(newnote);
// VALID: Post the note || INVALID: Send error
return submission.isValid ? post_note(newnote) : submitDiagnostics(submission);
};
note_form.addEventListener('submit', handleFormSubmit); | 31.89759 | 87 | 0.534844 |
1e468610263cdfba5f61fa352d0e8c12ea2350d0 | 28,008 | js | JavaScript | web3.js/module.flow.js | TheLoneRonin/solana | bb9c04895bad74e6ea8cd9d4027c15459638cbab | [
"Apache-2.0"
] | null | null | null | web3.js/module.flow.js | TheLoneRonin/solana | bb9c04895bad74e6ea8cd9d4027c15459638cbab | [
"Apache-2.0"
] | null | null | null | web3.js/module.flow.js | TheLoneRonin/solana | bb9c04895bad74e6ea8cd9d4027c15459638cbab | [
"Apache-2.0"
] | null | null | null | /**
* Flow Library definition for @solana/web3.js
*
* This file is manually maintained
*
* Usage: add the following line under the [libs] section of your project's
* .flowconfig:
* [libs]
* node_modules/@solana/web3.js/module.flow.js
*
*/
import {Buffer} from 'buffer';
import * as BufferLayout from 'buffer-layout';
import {PublicKey} from './src/publickey';
declare module '@solana/web3.js' {
// === src/publickey.js ===
declare export type PublicKeyNonce = [PublicKey, number];
declare export class PublicKey {
constructor(
value: number | string | Buffer | Uint8Array | Array<number>,
): PublicKey;
static createWithSeed(
fromPublicKey: PublicKey,
seed: string,
programId: PublicKey,
): Promise<PublicKey>;
static createProgramAddress(
seeds: Array<Buffer | Uint8Array>,
programId: PublicKey,
): Promise<PublicKey>;
static findProgramAddress(
seeds: Array<Buffer | Uint8Array>,
programId: PublicKey,
): Promise<PublicKeyNonce>;
equals(publickey: PublicKey): boolean;
toBase58(): string;
toBuffer(): Buffer;
toString(): string;
}
// === src/blockhash.js ===
declare export type Blockhash = string;
// === src/account.js ===
declare export class Account {
constructor(secretKey?: Buffer | Uint8Array | Array<number>): Account;
publicKey: PublicKey;
secretKey: Buffer;
}
// === src/fee-calculator.js ===
declare export type FeeCalculator = {
lamportsPerSignature: number,
};
// === src/connection.js ===
declare export type Context = {
slot: number,
};
declare export type SendOptions = {
skipPreflight: ?boolean,
};
declare export type ConfirmOptions = {
commitment: ?Commitment,
skipPreflight: ?boolean,
};
declare export type ConfirmedSignaturesForAddress2Options = {
before?: TransactionSignature,
limit?: number,
};
declare export type TokenAccountsFilter =
| {
mint: PublicKey,
}
| {
programId: PublicKey,
};
declare export type RpcResponseAndContext<T> = {
context: Context,
value: T,
};
declare export type Commitment =
| 'max'
| 'recent'
| 'root'
| 'single'
| 'singleGossip';
declare export type LargestAccountsFilter = 'circulating' | 'nonCirculating';
declare export type GetLargestAccountsConfig = {
commitment: ?Commitment,
filter: ?LargestAccountsFilter,
};
declare export type SignatureStatusConfig = {
searchTransactionHistory: boolean,
};
declare export type SignatureStatus = {
slot: number,
err: TransactionError | null,
confirmations: number | null,
};
declare export type ConfirmedSignatureInfo = {
signature: string,
slot: number,
err: TransactionError | null,
memo: string | null,
};
declare export type BlockhashAndFeeCalculator = {
blockhash: Blockhash,
feeCalculator: FeeCalculator,
};
declare export type PublicKeyAndAccount<T> = {
pubkey: PublicKey,
account: AccountInfo<T>,
};
declare export type AccountInfo<T> = {
executable: boolean,
owner: PublicKey,
lamports: number,
data: T,
rentEpoch: number | null,
};
declare export type ContactInfo = {
pubkey: string,
gossip: string | null,
tpu: string | null,
rpc: string | null,
version: string | null,
};
declare export type SimulatedTransactionResponse = {
err: TransactionError | string | null,
logs: Array<string> | null,
};
declare export type ConfirmedTransactionMeta = {
fee: number,
preBalances: Array<number>,
postBalances: Array<number>,
err: TransactionError | null,
};
declare export type ConfirmedBlock = {
blockhash: Blockhash,
previousBlockhash: Blockhash,
parentSlot: number,
transactions: Array<{
transaction: Transaction,
meta: ConfirmedTransactionMeta | null,
}>,
};
declare export type ConfirmedTransaction = {
slot: number,
transaction: Transaction,
meta: ConfirmedTransactionMeta | null,
};
declare export type ParsedAccountData = {
program: string,
parsed: any,
space: number,
};
declare export type ParsedMessageAccount = {
pubkey: PublicKey,
signer: boolean,
writable: boolean,
};
declare export type ParsedInstruction = {|
programId: PublicKey,
program: string,
parsed: string,
|};
declare export type PartiallyDecodedInstruction = {|
programId: PublicKey,
accounts: Array<PublicKey>,
data: string,
|};
declare export type ParsedTransaction = {
signatures: Array<string>,
message: {
accountKeys: ParsedMessageAccount[],
instructions: (ParsedInstruction | PartiallyDecodedInstruction)[],
recentBlockhash: string,
},
};
declare export type ParsedConfirmedTransaction = {
slot: number,
transaction: ParsedTransaction,
meta: ConfirmedTransactionMeta | null,
};
declare export type KeyedAccountInfo = {
accountId: PublicKey,
accountInfo: AccountInfo<Buffer>,
};
declare export type Version = {
'solana-core': string,
};
declare export type VoteAccountInfo = {
votePubkey: string,
nodePubkey: string,
stake: number,
commission: number,
};
declare export type SlotInfo = {
parent: number,
slot: number,
root: number,
};
declare export type TokenAmount = {
uiAmount: number,
decimals: number,
amount: string,
};
declare export type TokenAccountBalancePair = {
address: PublicKey,
amount: string,
decimals: number,
uiAmount: number,
};
declare type AccountChangeCallback = (
accountInfo: AccountInfo<Buffer>,
context: Context,
) => void;
declare type ProgramAccountChangeCallback = (
keyedAccountInfo: KeyedAccountInfo,
context: Context,
) => void;
declare type SlotChangeCallback = (slotInfo: SlotInfo) => void;
declare type SignatureResultCallback = (
signatureResult: SignatureResult,
context: Context,
) => void;
declare type RootChangeCallback = (root: number) => void;
declare export type TransactionError = {};
declare export type SignatureResult = {|
err: TransactionError | null,
|};
declare export type InflationGovernor = {
foundation: number,
foundationTerm: number,
initial: number,
taper: number,
terminal: number,
};
declare export type EpochSchedule = {
slotsPerEpoch: number,
leaderScheduleSlotOffset: number,
warmup: boolean,
firstNormalEpoch: number,
firstNormalSlot: number,
};
declare export type EpochInfo = {
epoch: number,
slotIndex: number,
slotsInEpoch: number,
absoluteSlot: number,
blockHeight: ?number,
};
declare export type LeaderSchedule = {
[address: string]: number[],
};
declare export type Supply = {
total: number,
circulating: number,
nonCirculating: number,
nonCirculatingAccounts: Array<PublicKey>,
};
declare export type AccountBalancePair = {
address: PublicKey,
lamports: number,
};
declare export type VoteAccountStatus = {
current: Array<VoteAccountInfo>,
delinquent: Array<VoteAccountInfo>,
};
declare export class Connection {
constructor(endpoint: string, commitment: ?Commitment): Connection;
commitment: ?Commitment;
getAccountInfoAndContext(
publicKey: PublicKey,
commitment: ?Commitment,
): Promise<RpcResponseAndContext<AccountInfo<Buffer> | null>>;
getAccountInfo(
publicKey: PublicKey,
commitment: ?Commitment,
): Promise<AccountInfo<Buffer> | null>;
getParsedAccountInfo(
publicKey: PublicKey,
commitment: ?Commitment,
): Promise<
RpcResponseAndContext<AccountInfo<Buffer | ParsedAccountData> | null>,
>;
getProgramAccounts(
programId: PublicKey,
commitment: ?Commitment,
): Promise<Array<PublicKeyAndAccount<Buffer>>>;
getParsedProgramAccounts(
programId: PublicKey,
commitment: ?Commitment,
): Promise<Array<PublicKeyAndAccount<Buffer | ParsedAccountData>>>;
getBalanceAndContext(
publicKey: PublicKey,
commitment: ?Commitment,
): Promise<RpcResponseAndContext<number>>;
getBalance(publicKey: PublicKey, commitment: ?Commitment): Promise<number>;
getBlockTime(slot: number): Promise<number | null>;
getMinimumLedgerSlot(): Promise<number>;
getFirstAvailableBlock(): Promise<number>;
getSupply(commitment: ?Commitment): Promise<RpcResponseAndContext<Supply>>;
getTokenSupply(
tokenMintAddress: PublicKey,
commitment: ?Commitment,
): Promise<RpcResponseAndContext<TokenAmount>>;
getTokenAccountBalance(
tokenAddress: PublicKey,
commitment: ?Commitment,
): Promise<RpcResponseAndContext<TokenAmount>>;
getTokenAccountsByOwner(
ownerAddress: PublicKey,
filter: TokenAccountsFilter,
commitment: ?Commitment,
): Promise<
RpcResponseAndContext<
Array<{pubkey: PublicKey, account: AccountInfo<Buffer>}>,
>,
>;
getLargestAccounts(
config: ?GetLargestAccountsConfig,
): Promise<RpcResponseAndContext<Array<AccountBalancePair>>>;
getTokenLargestAccounts(
mintAddress: PublicKey,
commitment: ?Commitment,
): Promise<RpcResponseAndContext<Array<TokenAccountBalancePair>>>;
getClusterNodes(): Promise<Array<ContactInfo>>;
getConfirmedBlock(slot: number): Promise<ConfirmedBlock>;
getConfirmedTransaction(
signature: TransactionSignature,
): Promise<ConfirmedTransaction | null>;
getParsedConfirmedTransaction(
signature: TransactionSignature,
): Promise<ParsedConfirmedTransaction | null>;
getConfirmedSignaturesForAddress(
address: PublicKey,
startSlot: number,
endSlot: number,
): Promise<Array<TransactionSignature>>;
getConfirmedSignaturesForAddress2(
address: PublicKey,
options: ?ConfirmedSignaturesForAddress2Options,
): Promise<Array<ConfirmedSignatureInfo>>;
getVoteAccounts(commitment: ?Commitment): Promise<VoteAccountStatus>;
confirmTransaction(
signature: TransactionSignature,
commitment: ?Commitment,
): Promise<RpcResponseAndContext<SignatureResult>>;
getSlot(commitment: ?Commitment): Promise<number>;
getSlotLeader(commitment: ?Commitment): Promise<string>;
getSignatureStatus(
signature: TransactionSignature,
config: ?SignatureStatusConfig,
): Promise<RpcResponseAndContext<SignatureStatus | null>>;
getSignatureStatuses(
signatures: Array<TransactionSignature>,
config: ?SignatureStatusConfig,
): Promise<RpcResponseAndContext<Array<SignatureStatus | null>>>;
getTransactionCount(commitment: ?Commitment): Promise<number>;
getTotalSupply(commitment: ?Commitment): Promise<number>;
getVersion(): Promise<Version>;
getInflationGovernor(commitment: ?Commitment): Promise<InflationGovernor>;
getLeaderSchedule(): Promise<LeaderSchedule>;
getEpochSchedule(): Promise<EpochSchedule>;
getEpochInfo(commitment: ?Commitment): Promise<EpochInfo>;
getRecentBlockhashAndContext(
commitment: ?Commitment,
): Promise<RpcResponseAndContext<BlockhashAndFeeCalculator>>;
getFeeCalculatorForBlockhash(
blockhash: Blockhash,
commitment: ?Commitment,
): Promise<RpcResponseAndContext<FeeCalculator | null>>;
getRecentBlockhash(
commitment: ?Commitment,
): Promise<BlockhashAndFeeCalculator>;
requestAirdrop(
to: PublicKey,
amount: number,
): Promise<TransactionSignature>;
sendTransaction(
transaction: Transaction,
signers: Array<Account>,
options?: SendOptions,
): Promise<TransactionSignature>;
sendEncodedTransaction(
encodedTransaction: string,
options?: SendOptions,
): Promise<TransactionSignature>;
sendRawTransaction(
wireTransaction: Buffer | Uint8Array | Array<number>,
options?: SendOptions,
): Promise<TransactionSignature>;
simulateTransaction(
transaction: Transaction,
signers?: Array<Account>,
): Promise<RpcResponseAndContext<SimulatedTransactionResponse>>;
onAccountChange(
publickey: PublicKey,
callback: AccountChangeCallback,
commitment: ?Commitment,
): number;
removeAccountChangeListener(id: number): Promise<void>;
onProgramAccountChange(
programId: PublicKey,
callback: ProgramAccountChangeCallback,
commitment: ?Commitment,
): number;
removeProgramAccountChangeListener(id: number): Promise<void>;
onSlotChange(callback: SlotChangeCallback): number;
removeSlotChangeListener(id: number): Promise<void>;
onSignature(
signature: TransactionSignature,
callback: SignatureResultCallback,
commitment: ?Commitment,
): number;
removeSignatureListener(id: number): Promise<void>;
onRootChange(callback: RootChangeCallback): number;
removeRootChangeListener(id: number): Promise<void>;
validatorExit(): Promise<boolean>;
getMinimumBalanceForRentExemption(
dataLength: number,
commitment: ?Commitment,
): Promise<number>;
getNonce(
nonceAccount: PublicKey,
commitment: ?Commitment,
): Promise<NonceAccount>;
getNonceAndContext(
nonceAccount: PublicKey,
commitment: ?Commitment,
): Promise<RpcResponseAndContext<NonceAccount>>;
}
// === src/nonce-account.js ===
declare export class NonceAccount {
authorizedPubkey: PublicKey;
nonce: Blockhash;
feeCalculator: FeeCalculator;
static fromAccountData(
buffer: Buffer | Uint8Array | Array<number>,
): NonceAccount;
}
declare export var NONCE_ACCOUNT_LENGTH: number;
// === src/validator-info.js ===
declare export var VALIDATOR_INFO_KEY;
declare export type Info = {|
name: string,
website?: string,
details?: string,
keybaseUsername?: string,
|};
declare export class ValidatorInfo {
key: PublicKey;
info: Info;
constructor(key: PublicKey, info: Info): ValidatorInfo;
static fromConfigData(
buffer: Buffer | Uint8Array | Array<number>,
): ValidatorInfo | null;
}
// === src/sysvar.js ===
declare export var SYSVAR_CLOCK_PUBKEY;
declare export var SYSVAR_RENT_PUBKEY;
declare export var SYSVAR_REWARDS_PUBKEY;
declare export var SYSVAR_STAKE_HISTORY_PUBKEY;
// === src/vote-account.js ===
declare export var VOTE_PROGRAM_ID;
declare export type Lockout = {|
slot: number,
confirmationCount: number,
|};
declare export type EpochCredits = {|
epoch: number,
credits: number,
prevCredits: number,
|};
declare export class VoteAccount {
votes: Array<Lockout>;
nodePubkey: PublicKey;
authorizedVoterPubkey: PublicKey;
commission: number;
rootSlot: number | null;
epoch: number;
credits: number;
lastEpochCredits: number;
epochCredits: Array<EpochCredits>;
static fromAccountData(
buffer: Buffer | Uint8Array | Array<number>,
): VoteAccount;
}
// === src/instruction.js ===
declare export type InstructionType = {|
index: number,
layout: typeof BufferLayout,
|};
declare export function encodeData(type: InstructionType, fields: {}): Buffer;
// === src/message.js ===
declare export type MessageHeader = {
numRequiredSignatures: number,
numReadonlySignedAccounts: number,
numReadonlyUnsignedAccounts: number,
};
declare export type CompiledInstruction = {
programIdIndex: number,
accounts: number[],
data: string,
};
declare export type MessageArgs = {
header: MessageHeader,
accountKeys: string[],
recentBlockhash: Blockhash,
instructions: CompiledInstruction[],
};
declare export class Message {
header: MessageHeader;
accountKeys: PublicKey[];
recentBlockhash: Blockhash;
instructions: CompiledInstruction[];
constructor(args: MessageArgs): Message;
isAccountWritable(index: number): boolean;
serialize(): Buffer;
}
// === src/transaction.js ===
declare export type TransactionSignature = string;
declare export type AccountMeta = {
pubkey: PublicKey,
isSigner: boolean,
isWritable: boolean,
};
declare type TransactionInstructionCtorFields = {|
keys: ?Array<AccountMeta>,
programId?: PublicKey,
data?: Buffer,
|};
declare export class TransactionInstruction {
keys: Array<AccountMeta>;
programId: PublicKey;
data: Buffer;
constructor(
opts?: TransactionInstructionCtorFields,
): TransactionInstruction;
}
declare type SignaturePubkeyPair = {|
signature: Buffer | null,
publicKey: PublicKey,
|};
declare type NonceInformation = {|
nonce: Blockhash,
nonceInstruction: TransactionInstruction,
|};
declare type TransactionCtorFields = {|
recentBlockhash?: Blockhash,
nonceInfo?: NonceInformation,
signatures?: Array<SignaturePubkeyPair>,
|};
declare export type SerializeConfig = {
requireAllSignatures?: boolean,
verifySignatures?: boolean,
};
declare export class Transaction {
signatures: Array<SignaturePubkeyPair>;
signature: ?Buffer;
instructions: Array<TransactionInstruction>;
recentBlockhash: ?Blockhash;
nonceInfo: ?NonceInformation;
feePayer: PublicKey | null;
constructor(opts?: TransactionCtorFields): Transaction;
static from(buffer: Buffer | Uint8Array | Array<number>): Transaction;
static populate(message: Message, signatures: Array<string>): Transaction;
add(
...items: Array<
Transaction | TransactionInstruction | TransactionInstructionCtorFields,
>
): Transaction;
compileMessage(): Message;
serializeMessage(): Buffer;
sign(...signers: Array<Account>): void;
partialSign(...partialSigners: Array<Account>): void;
addSignature(pubkey: PublicKey, signature: Buffer): void;
setSigners(...signers: Array<PublicKey>): void;
verifySignatures(): boolean;
serialize(config?: SerializeConfig): Buffer;
}
// === src/stake-program.js ===
declare export type StakeAuthorizationType = {|
index: number,
|};
declare export class Authorized {
staker: PublicKey;
withdrawer: PublicKey;
constructor(staker: PublicKey, withdrawer: PublicKey): Authorized;
}
declare export class Lockup {
unixTimestamp: number;
epoch: number;
custodian: PublicKey;
constructor(
unixTimestamp: number,
epoch: number,
custodian: PublicKey,
): Lockup;
}
declare export type CreateStakeAccountParams = {|
fromPubkey: PublicKey,
stakePubkey: PublicKey,
authorized: Authorized,
lockup: Lockup,
lamports: number,
|};
declare export type CreateStakeAccountWithSeedParams = {|
fromPubkey: PublicKey,
stakePubkey: PublicKey,
basePubkey: PublicKey,
seed: string,
authorized: Authorized,
lockup: Lockup,
lamports: number,
|};
declare export type InitializeStakeParams = {|
stakePubkey: PublicKey,
authorized: Authorized,
lockup: Lockup,
|};
declare export type DelegateStakeParams = {|
stakePubkey: PublicKey,
authorizedPubkey: PublicKey,
votePubkey: PublicKey,
|};
declare export type AuthorizeStakeParams = {|
stakePubkey: PublicKey,
authorizedPubkey: PublicKey,
newAuthorizedPubkey: PublicKey,
stakeAuthorizationType: StakeAuthorizationType,
|};
declare export type AuthorizeWithSeedStakeParams = {|
stakePubkey: PublicKey,
authorityBase: PublicKey,
authoritySeed: string,
authorityOwner: PublicKey,
newAuthorizedPubkey: PublicKey,
stakeAuthorizationType: StakeAuthorizationType,
|};
declare export type SplitStakeParams = {|
stakePubkey: PublicKey,
authorizedPubkey: PublicKey,
splitStakePubkey: PublicKey,
lamports: number,
|};
declare export type WithdrawStakeParams = {|
stakePubkey: PublicKey,
authorizedPubkey: PublicKey,
toPubkey: PublicKey,
lamports: number,
|};
declare export type DeactivateStakeParams = {|
stakePubkey: PublicKey,
authorizedPubkey: PublicKey,
|};
declare export class StakeProgram {
static programId: PublicKey;
static space: number;
static createAccount(params: CreateStakeAccountParams): Transaction;
static createAccountWithSeed(
params: CreateStakeAccountWithSeedParams,
): Transaction;
static delegate(params: DelegateStakeParams): Transaction;
static authorize(params: AuthorizeStakeParams): Transaction;
static split(params: SplitStakeParams): Transaction;
static withdraw(params: WithdrawStakeParams): Transaction;
static deactivate(params: DeactivateStakeParams): Transaction;
}
declare export type StakeInstructionType =
| 'Initialize'
| 'Authorize'
| 'AuthorizeWithSeed'
| 'Delegate'
| 'Split'
| 'Withdraw'
| 'Deactivate';
declare export var STAKE_INSTRUCTION_LAYOUTS: {
[StakeInstructionType]: InstructionType,
};
declare export class StakeInstruction {
static decodeInstructionType(
instruction: TransactionInstruction,
): StakeInstructionType;
static decodeInitialize(
instruction: TransactionInstruction,
): InitializeStakeParams;
static decodeDelegate(
instruction: TransactionInstruction,
): DelegateStakeParams;
static decodeAuthorize(
instruction: TransactionInstruction,
): AuthorizeStakeParams;
static decodeSplit(instruction: TransactionInstruction): SplitStakeParams;
static decodeWithdraw(
instruction: TransactionInstruction,
): WithdrawStakeParams;
static decodeDeactivate(
instruction: TransactionInstruction,
): DeactivateStakeParams;
}
// === src/system-program.js ===
declare export type CreateAccountParams = {|
fromPubkey: PublicKey,
newAccountPubkey: PublicKey,
lamports: number,
space: number,
programId: PublicKey,
|};
declare export type CreateAccountWithSeedParams = {|
fromPubkey: PublicKey,
newAccountPubkey: PublicKey,
basePubkey: PublicKey,
seed: string,
lamports: number,
space: number,
programId: PublicKey,
|};
declare export type AllocateParams = {|
accountPubkey: PublicKey,
space: number,
|};
declare export type AllocateWithSeedParams = {|
accountPubkey: PublicKey,
basePubkey: PublicKey,
seed: string,
space: number,
programId: PublicKey,
|};
declare export type AssignParams = {|
accountPubkey: PublicKey,
programId: PublicKey,
|};
declare export type AssignWithSeedParams = {|
accountPubkey: PublicKey,
basePubkey: PublicKey,
seed: string,
programId: PublicKey,
|};
declare export type TransferParams = {|
fromPubkey: PublicKey,
toPubkey: PublicKey,
lamports: number,
|};
declare export type CreateNonceAccountParams = {|
fromPubkey: PublicKey,
noncePubkey: PublicKey,
authorizedPubkey: PublicKey,
lamports: number,
|};
declare export type CreateNonceAccountWithSeedParams = {|
fromPubkey: PublicKey,
noncePubkey: PublicKey,
authorizedPubkey: PublicKey,
lamports: number,
basePubkey: PublicKey,
seed: string,
|};
declare export type InitializeNonceParams = {|
noncePubkey: PublicKey,
authorizedPubkey: PublicKey,
|};
declare export type AdvanceNonceParams = {|
noncePubkey: PublicKey,
authorizedPubkey: PublicKey,
|};
declare export type WithdrawNonceParams = {|
noncePubkey: PublicKey,
authorizedPubkey: PublicKey,
toPubkey: PublicKey,
lamports: number,
|};
declare export type AuthorizeNonceParams = {|
noncePubkey: PublicKey,
authorizedPubkey: PublicKey,
newAuthorizedPubkey: PublicKey,
|};
declare export class SystemProgram {
static programId: PublicKey;
static createAccount(params: CreateAccountParams): TransactionInstruction;
static createAccountWithSeed(
params: CreateAccountWithSeedParams,
): TransactionInstruction;
static allocate(
params: AllocateParams | AllocateWithSeedParams,
): TransactionInstruction;
static assign(
params: AssignParams | AssignWithSeedParams,
): TransactionInstruction;
static transfer(params: TransferParams): TransactionInstruction;
static createNonceAccount(
params: CreateNonceAccountParams | CreateNonceAccountWithSeedParams,
): Transaction;
static nonceAdvance(params: AdvanceNonceParams): TransactionInstruction;
static nonceWithdraw(params: WithdrawNonceParams): TransactionInstruction;
static nonceAuthorize(params: AuthorizeNonceParams): TransactionInstruction;
}
declare export type SystemInstructionType =
| 'Create'
| 'CreateWithSeed'
| 'Allocate'
| 'AllocateWithSeed'
| 'Assign'
| 'AssignWithSeed'
| 'Transfer'
| 'AdvanceNonceAccount'
| 'WithdrawNonceAccount'
| 'InitializeNonceAccount'
| 'AuthorizeNonceAccount';
declare export var SYSTEM_INSTRUCTION_LAYOUTS: {
[SystemInstructionType]: InstructionType,
};
declare export class SystemInstruction {
static decodeInstructionType(
instruction: TransactionInstruction,
): SystemInstructionType;
static decodeCreateAccount(
instruction: TransactionInstruction,
): CreateAccountParams;
static decodeCreateWithSeed(
instruction: TransactionInstruction,
): CreateAccountWithSeedParams;
static decodeAllocate(instruction: TransactionInstruction): AllocateParams;
static decodeAllocateWithSeed(
instruction: TransactionInstruction,
): AllocateWithSeedParams;
static decodeAssign(instruction: TransactionInstruction): AssignParams;
static decodeAssignWithSeed(
instruction: TransactionInstruction,
): AssignWithSeedParams;
static decodeTransfer(instruction: TransactionInstruction): TransferParams;
static decodeNonceInitialize(
instruction: TransactionInstruction,
): InitializeNonceParams;
static decodeNonceAdvance(
instruction: TransactionInstruction,
): AdvanceNonceParams;
static decodeNonceWithdraw(
instruction: TransactionInstruction,
): WithdrawNonceParams;
static decodeNonceAuthorize(
instruction: TransactionInstruction,
): AuthorizeNonceParams;
}
// === src/loader.js ===
declare export class Loader {
static getMinNumSignatures(dataLength: number): number;
static load(
connection: Connection,
payer: Account,
program: Account,
programId: PublicKey,
data: Buffer | Uint8Array | Array<number>,
): Promise<PublicKey>;
}
// === src/bpf-loader.js ===
declare export var BPF_LOADER_PROGRAM_ID;
declare export class BpfLoader {
static getMinNumSignatures(dataLength: number): number;
static load(
connection: Connection,
payer: Account,
program: Account,
elfBytes: Buffer | Uint8Array | Array<number>,
loaderProgramId: PublicKey,
): Promise<PublicKey>;
}
// === src/bpf-loader-deprecated.js ===
declare export var BPF_LOADER_DEPRECATED_PROGRAM_ID;
// === src/util/send-and-confirm-transaction.js ===
declare export function sendAndConfirmTransaction(
connection: Connection,
transaction: Transaction,
signers: Array<Account>,
options: ?ConfirmOptions,
): Promise<TransactionSignature>;
// === src/util/send-and-confirm-raw-transaction.js ===
declare export function sendAndConfirmRawTransaction(
connection: Connection,
wireTransaction: Buffer,
options: ?ConfirmOptions,
): Promise<TransactionSignature>;
// === src/util/cluster.js ===
declare export type Cluster = 'devnet' | 'testnet' | 'mainnet-beta';
declare export function clusterApiUrl(
cluster?: Cluster,
tls?: boolean,
): string;
// === src/index.js ===
declare export var LAMPORTS_PER_SOL: number;
}
| 27.840954 | 80 | 0.698336 |
1e46f45183b6381cc0a98ce89df3659c45987e07 | 2,955 | js | JavaScript | backend/config.js | akinsella/commuter | 6f3651527d8d37926971c59d317ad64839690f59 | [
"BSD-3-Clause"
] | null | null | null | backend/config.js | akinsella/commuter | 6f3651527d8d37926971c59d317ad64839690f59 | [
"BSD-3-Clause"
] | null | null | null | backend/config.js | akinsella/commuter | 6f3651527d8d37926971c59d317ad64839690f59 | [
"BSD-3-Clause"
] | null | null | null | // @flow
function deprecate(env: Object, oldVar: string, newVar: string) {
if (env[oldVar]) {
console.warn(`${oldVar} is deprecated, please use ${newVar}`);
}
}
// eslint-disable-next-line no-unused-vars
function populateLocalStorageOptions(env): Object {
let baseDirectory = process.env.COMMUTER_LOCAL_STORAGE_BASEDIRECTORY;
if (!baseDirectory) {
baseDirectory = process.cwd();
console.warn("Running in the current working directory, ", baseDirectory);
}
return {
local: {
baseDirectory
}
};
}
function populateS3Options(env): Object {
deprecate(env, "COMMUTER_BASEPATH", "COMMUTER_S3_BASE_PREFIX");
deprecate(env, "COMMUTER_PATH_DELIMITER", "COMMUTER_S3_PATH_DELIMITER");
if (!env.COMMUTER_BUCKET) {
throw "S3 Bucket Name Missing";
}
const s3PathDelimiter =
env.COMMUTER_S3_PATH_DELIMITER || env.COMMUTER_PATH_DELIMITER || "/";
const s3BasePrefix = (
env.COMMUTER_S3_BASE_PREFIX ||
env.COMMUTER_BASEPATH || // deprecated
""
)
// trim off trailing slashes
.replace(/\/+$/, "");
const s3Endpoint =
env.COMMUTER_S3_ENDPOINT || "";
const config = {
s3: {
params: {
// required s3 bucket name
Bucket: env.COMMUTER_BUCKET
},
// required key
accessKeyId: env.COMMUTER_S3_KEY,
// required secret
secretAccessKey: env.COMMUTER_S3_SECRET,
endpoint: s3Endpoint
},
s3PathDelimiter,
s3BasePrefix
};
return config;
}
function instantiate() {
const storageBackend = (
process.env.COMMUTER_STORAGE_BACKEND || "local"
).toLowerCase();
if (storageBackend !== "local" && storageBackend !== "s3") {
throw new Error(`Unknown storageBackend ${storageBackend}`);
}
let discoveryBackend = process.env.COMMUTER_DISCOVERY_BACKEND || "none";
// NOTE: The automatic assumption of using elasticsearch could be deprecated
// in favor of selecting it here. Not sure which way to go.
// Deferring that decision to later!
if (discoveryBackend === "none" && process.env.COMMUTER_ES_HOST) {
discoveryBackend = "elasticsearch";
}
console.log("CONFIGURED DISCOVERY", discoveryBackend);
const config = {};
switch (storageBackend) {
case "s3":
config.storage = populateS3Options(process.env);
break;
case "local":
default:
config.storage = populateLocalStorageOptions(process.env);
}
config.storageBackend = storageBackend;
switch (discoveryBackend) {
case "elasticsearch":
config.discovery = {
elasticsearch: {
host: process.env.COMMUTER_ES_HOST || "",
log: "debug"
}
};
config.discoveryBackend = "elasticsearch";
break;
default:
config.discoveryBackend = "none";
}
config.nodeEnv = process.env.NODE_ENV || "test";
config.port = process.env.PORT || process.env.COMMUTER_PORT || 4000;
return config;
}
module.exports = instantiate();
| 24.831933 | 78 | 0.661591 |
1e4741f1f63f678b0f2fa33a1217d1cb36269288 | 11,812 | js | JavaScript | examples/browser/src/sudoku.js | MaxDBenson/nools-sandbox | 5c8e49f128bf04c24100b97dc09b05c1787ff1e1 | [
"MIT"
] | 317 | 2017-04-25T14:10:21.000Z | 2022-03-18T03:35:00.000Z | examples/browser/src/sudoku.js | MaxDBenson/nools-sandbox | 5c8e49f128bf04c24100b97dc09b05c1787ff1e1 | [
"MIT"
] | 14 | 2017-04-27T02:40:57.000Z | 2020-09-05T00:20:56.000Z | examples/browser/src/sudoku.js | MaxDBenson/nools-sandbox | 5c8e49f128bf04c24100b97dc09b05c1787ff1e1 | [
"MIT"
] | 61 | 2017-05-12T01:41:41.000Z | 2022-03-18T04:33:36.000Z | (function () {
/*global $:true*/
var declare = this.declare,
arr = this.arrayExtended,
unique = arr.unique;
var allNine = [1, 2, 3, 4, 5, 6, 7, 8, 9];
if (typeof console === 'undefined') {
console = {
log: function () {
}
};
}
var SetOfNine = declare({
instance: {
free: null,
count: 0,
constructor: function () {
this.count = (this.free = allNine.slice()).length;
},
blockValue: function (value) {
var index = arr.indexOf(this.free, value);
if (index !== -1) {
this.free.splice(index, 1);
this.count = this.free.length;
}
return this;
},
blockExcept: function (values) {
this.free = values || [];
this.count = this.free.length;
return this;
},
freeValue: function () {
return this.free[0];
}
}
}).as(this, "SetOfNine");
var CellGroup = SetOfNine.extend({
instance: {
cells: null,
constructor: function () {
this._super(arguments);
this.cells = [];
},
addCell: function (cell) {
this.cells.push(cell);
}
}
}).as(this, "CellGroup");
var CellFile = CellGroup.extend({
instance: {
number: null,
constructor: function (number) {
this._super(arguments);
this.number = number;
},
toString: function () {
var ret = [], cells = this.cells;
for (var i = 0, l = cells.length; i < l; i++) {
ret.push(cells[i].toString());
}
return ret.join(", ");
}
}
}).as(this, "CellFile");
var Cell = SetOfNine.extend({
instance: {
value: null,
cellRow: null,
cellCol: null,
cellSqr: null,
exCells: null,
el: null,
constructor: function () {
this._super(arguments);
this.exCells = [];
},
makeReferences: function (cr, col, sqr) {
this.cellRow = cr;
this.cellCol = col;
this.cellSqr = sqr;
this.colNo = col.number;
this.rowNo = cr.number;
this.exCells = unique(this.exCells.concat(cr.cells).concat(col.cells).concat(sqr.cells));
this.exCells.splice(this.exCells.indexOf(this), 1);
return this;
},
toString: function () {
return [this.posAsString(), this.valueAsString()].join(": ");
},
valueAsString: function () {
return this.value === null ? " " : this.value;
},
posAsString: function () {
return ["[", this.cellRow.number, ",", this.cellCol.number, "]"].join("");
}
}
}).as(this, "Cell");
var CellCol = CellFile.extend({
instance: {
toString: function () {
return ["Column ", this.number, ": ", this._super(arguments)];
}
}
}).as(this, "CellCol");
var CellRow = CellFile.extend({
instance: {
toString: function () {
return ["Row ", this.number, ": ", this._super(arguments)];
}
}
}).as(this, "CellRow");
var CellSqr = CellGroup.extend({
instance: {
constructor: function (cr1, cr2, cr3, cc1, cc2, cc3) {
this._super(arguments);
for (var i = cr1.number; i <= cr3.number; i++) {
this.addCell(cc1.cells[i]);
this.addCell(cc2.cells[i]);
this.addCell(cc3.cells[i]);
}
}
}
}).as(this, "CellSqr");
var Counter = declare({
instance: {
count: 0,
constructor: function (count) {
this.count = count;
}
}
}).as(this, "Counter");
var Setting = declare({
instance: {
rowNo: null,
colNo: null,
value: null,
constructor: function (row, col, value) {
this.rowNo = row;
this.colNo = col;
this.value = value;
},
toString: function () {
return "Setting [" + this.rowNo + "," + this.colNo + "] : " + this.value;
}
}
}).as(this, "Setting");
var Stepping = declare({
instance: {
emergency: false
}
}).as(this, "Stepping");
var Sudoku = declare({
instance: {
constructor: function (flow, statsListener) {
this.rows = [];
this.cols = [];
this.sqrs = [];
this.cells = [];
this.flow = flow;
this.statsListener = statsListener;
this.session = null;
this.stepping = null;
},
stop: function () {
if (this.session) {
this.session.halt();
this.session.dispose();
}
return this;
},
clear: function () {
this.stop();
this.setCellValues([]);
},
step: function () {
if (!this.invalid) {
this.session.modify(this.counter, function () {
this.count = 1;
});
if (!this.stepping) {
this.session.assert(new Stepping());
}
return this.session.matchUntilHalt(function (err) {
if (err) {
console.log(err);
}
});
}
},
solve: function () {
if (!this.invalid) {
this.session.modify(this.counter, function () {
this.count = Infinity;
});
if (this.stepping) {
this.session.retract(this.stepping);
}
return this.session.match(function (err) {
if (err) {
console.log(err);
}
});
}
},
setCellValue: function setCellValue(cell) {
cell.el.text(cell.value ? cell.value : "");
return cell;
},
create: function () {
var grid;
(grid = $("#grid")).empty();
var rows = this.rows, cols = this.cols, sqrs = this.sqrs, session = this.session;
for (var i = 0; i < 9; i++) {
session.assert(i + 1);
rows[i] = new CellRow(i);
cols[i] = new CellCol(i);
}
var cells = this.cells = [], iCol;
for (var iRow = 0; iRow < 9; iRow++) {
var rowDom = $("<div/>").addClass("row").appendTo(grid);
cells[iRow] = [];
for (iCol = 0; iCol < 9; iCol++) {
var cell = cells[iRow][iCol] = new Cell();
cell.el = $("<div class='col'></div>").appendTo(rowDom);
rows[iRow].addCell(cell);
cols[iCol].addCell(cell);
}
}
for (i = 0; i < 3; i++) {
sqrs[i] = [];
for (var j = 0; j < 3; j++) {
sqrs[i][j] = new CellSqr(rows[i * 3], rows[i * 3 + 1], rows[i * 3 + 2],
cols[j * 3], cols[j * 3 + 1], cols[j * 3 + 2]);
}
}
for (iRow = 0; iRow < 9; iRow++) {
for (iCol = 0; iCol < 9; iCol++) {
session.assert(cells[iRow][iCol].makeReferences(rows[iRow], cols[iCol], sqrs[Math.floor(iRow / 3)][Math.floor(iCol / 3)]));
}
session.assert(rows[iRow]);
session.assert(cols[iRow]);
session.assert(sqrs[Math.floor(iRow / 3)][iRow % 3]);
}
return this;
},
setCellValues: function (cellValues) {
this.stop();
var session = (this.session = this.statsListener.listen(this.flow.getSession()))
.on("set-value", this.setCellValue);
var s000 = new Setting(0, 0, 0);
this.session.assert(s000);
this.create();
var initial = 0;
for (var iRow = 0; iRow < 9; iRow++) {
var row = cellValues[iRow] || [];
for (var iCol = 0; iCol < 9; iCol++) {
var value = row[iCol] || null;
if (value) {
session.assert(new Setting(iRow, iCol, value));
initial++;
}
}
}
var counter = this.counter = new Counter(initial);
this.session.assert(counter);
this.session.retract(s000);
return this.session.matchUntilHalt(function (err) {
if (err) {
console.log(err);
}
this.dumpGrid();
}.bind(this));
},
dumpGrid: function () {
var cells = this.cells;
var print = [" "];
for (var iCol = 0; iCol < 9; iCol++) {
print.push("Col: " + iCol + " ");
}
console.log(print.join(""));
for (var iRow = 0; iRow < 9; iRow++) {
print = ["Row " + (iRow) + ": "];
for (iCol = 0; iCol < 9; iCol++) {
if (cells[iRow][iCol].value !== null) {
print.push(" --- " + cells[iRow][iCol].value + " --- ");
} else {
var perms = cells[iRow][iCol].free, sb = [];
for (var i = 1; i <= 9; i++) {
if (perms.indexOf(i) !== -1) {
sb.push(i);
} else {
sb.push(' ');
}
}
print.push(" % " + sb.join(""));
}
}
console.log(print.join(""));
}
},
setInvalidCellValue: function setCellValue(cell) {
this.invalid = true;
cell.el.addClass("error");
return cell;
},
validate: function () {
this.invalid = false;
this.session.assert("validate");
return this.session.focus("validate")
.on("invalid", this.setInvalidCellValue)
.matchUntilHalt();
}
}
});
this.Sudoku = Sudoku;
}).call(this);
| 31.002625 | 147 | 0.375804 |
1e4750c901e7d56dab107b65e700df91e1adee61 | 385 | js | JavaScript | src/scripts/App.js | floriankittelmann/matter-dashboard | df99620966d8cf81b088876979de3bb5e3c8bcca | [
"MIT"
] | 11 | 2020-01-24T09:58:30.000Z | 2022-03-07T08:18:37.000Z | src/scripts/App.js | floriankittelmann/matter-dashboard | df99620966d8cf81b088876979de3bb5e3c8bcca | [
"MIT"
] | 8 | 2020-09-07T07:35:20.000Z | 2022-02-26T17:44:33.000Z | src/scripts/App.js | floriankittelmann/matter-dashboard | df99620966d8cf81b088876979de3bb5e3c8bcca | [
"MIT"
] | 11 | 2019-10-17T15:01:18.000Z | 2022-03-09T17:44:21.000Z | import Navigation from './Navigation';
import ScrollableComponents from './ScrollableComponents';
import Charts from './Charts';
class App {
static init () {
const nav = new Navigation();
const scrollableComponents = new ScrollableComponents();
const charts = new Charts();
nav.init();
scrollableComponents.init();
charts.init();
}
}
export default App;
| 21.388889 | 60 | 0.690909 |
1e48839eff536258b360330da5a7f1ce4c9d6537 | 733 | js | JavaScript | src/actions/arbitrage/validate.js | epg323/Contract-Butler | 61a15659a6ac1e038e75cd153e6031342de29f6e | [
"MIT"
] | 1 | 2021-03-01T19:36:50.000Z | 2021-03-01T19:36:50.000Z | src/actions/arbitrage/validate.js | epg323/Contract-Butler | 61a15659a6ac1e038e75cd153e6031342de29f6e | [
"MIT"
] | null | null | null | src/actions/arbitrage/validate.js | epg323/Contract-Butler | 61a15659a6ac1e038e75cd153e6031342de29f6e | [
"MIT"
] | 1 | 2021-03-09T08:50:13.000Z | 2021-03-09T08:50:13.000Z | const arbordtrade = async (
api,
contract,
accnt,
type,
amt,
tokenContract,
recipient
) => {
await api.transact(
{
actions: [
{
account: contract,
name: "validate",
authorization: [
{
actor: process.env.BOT_WALLET_KYLIN,
permission: "active",
},
],
data: {
account: accnt,
type: type,
expected_balance: {
contract: tokenContract,
quantity: amt,
},
recipient: recipient,
},
},
],
},
{
blocksBehind: 3,
expireSeconds: 30,
}
);
};
module.exports = arbordtrade;
| 17.452381 | 50 | 0.433834 |
1e4941db174941bd379848af343e0e6095018837 | 986 | js | JavaScript | game-server/node_modules/pomelo-sync-plugin/node_modules/pomelo-sync/test/sync.js | fjytzh/pomeframe | 2a0e15a45606eeef5a9bba9fb1b38433d96f51b2 | [
"MIT"
] | null | null | null | game-server/node_modules/pomelo-sync-plugin/node_modules/pomelo-sync/test/sync.js | fjytzh/pomeframe | 2a0e15a45606eeef5a9bba9fb1b38433d96f51b2 | [
"MIT"
] | null | null | null | game-server/node_modules/pomelo-sync-plugin/node_modules/pomelo-sync/test/sync.js | fjytzh/pomeframe | 2a0e15a45606eeef5a9bba9fb1b38433d96f51b2 | [
"MIT"
] | null | null | null | var DataSync = require('../');
var dbclient = require('./lib/mysql').client;
var opt = {};
var mappingPath = __dirname+ '/mapping';
opt.client = dbclient;
opt.interval = 1000 * 10;
opt.aof = false;
var sync = new DataSync(opt);
console.log('before loading ')
sync.mapping = sync.loadMapping(mappingPath);
console.log(sync.mapping);
var key = 'user_key';
var User = function User(name){
this.name = name;
};
var user1 = new User('hello');
user1.x = user1.y = 999;
user1.uid = 10003;
user1.sceneId = 1;
var resp = sync.set(key,user1);
console.log('resp %j' , sync.get(key));
sync.execSync('bag.selectUser',10004,function(err,data){
console.log(err + ' select data ' + data);
});
user1.x = 888;
user1.y = 777;
console.log(' count ' + sync.rewriter.count);
sync.exec('player.updateUser',10003,user1);
user1.x = 999;
sync.flush('player.updateUser',10003,user1);
setInterval(function(){
console.log(' count:' + sync.rewriter.count + ' isDone: ' + sync.isDone());
},1000);
| 20.122449 | 76 | 0.670385 |
1e49c00a3e70c40ab0b126e2a4bc9f7db3c2419d | 505 | js | JavaScript | prompts.js | caidewu/vue-cli-plugin-boilerplate | 8b740631dc84ffa884b18d87f66dee280578f2b0 | [
"MIT"
] | null | null | null | prompts.js | caidewu/vue-cli-plugin-boilerplate | 8b740631dc84ffa884b18d87f66dee280578f2b0 | [
"MIT"
] | null | null | null | prompts.js | caidewu/vue-cli-plugin-boilerplate | 8b740631dc84ffa884b18d87f66dee280578f2b0 | [
"MIT"
] | null | null | null | module.exports = [
// {
// type: 'list',
// name: 'import',
// message: 'How do you want to import Element?',
// choices: [
// { name: 'Fully import', value: 'full' },
// { name: 'Import on demand', value: 'partial' }
// ],
// default: 'full',
// },
// {
// when: answers => answers.import === 'full',
// type: 'confirm',
// name: 'customTheme',
// message: 'Do you wish to overwrite Element\'s SCSS variables?',
// default: false,
// },
];
| 25.25 | 70 | 0.49703 |
1e49e2ab10ad13e0fad7c084c31a99684f422b0e | 36,953 | js | JavaScript | static/js/weui.js | tenbamboo/wxFETemplateForWeUI | d0122b4a389815868a387c89820c801581a1f314 | [
"MIT"
] | 11 | 2017-12-28T00:59:43.000Z | 2021-05-23T05:48:13.000Z | static/js/weui.js | tenbamboo/wxFETemplateForWeUI | d0122b4a389815868a387c89820c801581a1f314 | [
"MIT"
] | 9 | 2021-03-08T21:00:46.000Z | 2022-02-26T04:56:47.000Z | static/js/weui.js | tenbamboo/wxFETemplateForWeUI | d0122b4a389815868a387c89820c801581a1f314 | [
"MIT"
] | 3 | 2018-08-24T15:31:29.000Z | 2019-10-19T14:06:31.000Z | /*!
* weui.js v1.1.4 (https://weui.io)
* Copyright 2018, wechat ui team
* MIT license
*/
/* eslint-disable */
/*!
* weui.js v1.1.4 (https://weui.io)
* Copyright 2018, wechat ui team
* MIT license
*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.weui=t():e.weui=t()}(this,function(){return function(e){function t(i){if(n[i])return n[i].exports;var o=n[i]={exports:{},id:i,loaded:!1};return e[i].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),a=i(o),r=n(7),u=i(r),l=n(8),s=i(l),d=n(9),f=i(d),c=n(11),p=i(c),h=n(13),v=i(h),m=n(15),y=i(m),w=n(17),g=i(w),_=n(18),b=i(_),k=n(19),x=i(k),M=n(20),C=i(M),j=n(24),E=n(30),S=i(E),O=n(32),P=i(O);t.default={dialog:a.default,alert:u.default,confirm:s.default,toast:f.default,loading:p.default,actionSheet:v.default,topTips:y.default,searchBar:g.default,tab:b.default,form:x.default,uploader:C.default,picker:j.picker,datePicker:j.datePicker,gallery:S.default,slider:P.default},e.exports=t.default},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(){function e(t){e=r.default.noop,u.addClass("weui-animate-fade-out"),a.addClass("weui-animate-fade-out").on("animationend webkitAnimationEnd",function(){o.remove(),s=!1,t&&t()})}function t(t){e(t)}var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(s)return s;var i=r.default.os.android;n=r.default.extend({title:null,content:"",className:"",buttons:[{label:"确定",type:"primary",onClick:r.default.noop}],isAndroid:i},n);var o=(0,r.default)(r.default.render(l.default,n)),a=o.find(".weui-dialog"),u=o.find(".weui-mask");return(0,r.default)("body").append(o),u.addClass("weui-animate-fade-in"),a.addClass("weui-animate-fade-in"),o.on("click",".weui-dialog__btn",function(e){var i=(0,r.default)(this).index();n.buttons[i].onClick?n.buttons[i].onClick.call(this,e)!==!1&&t():t()}).on("touchmove",function(e){e.stopPropagation(),e.preventDefault()}),s=o[0],s.hide=t,s}Object.defineProperty(t,"__esModule",{value:!0});var a=n(2),r=i(a),u=n(6),l=i(u),s=void 0;t.default=o,e.exports=t.default},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=this.os={},n=e.match(/(Android);?[\s\/]+([\d.]+)?/);n&&(t.android=!0,t.version=n[2])}Object.defineProperty(t,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};n(3);var r=n(4),u=i(r),l=n(5),s=i(l);o.call(s.default,navigator.userAgent),(0,u.default)(s.default.fn,{append:function(e){return e instanceof HTMLElement||(e=e[0]),this.forEach(function(t){t.appendChild(e)}),this},remove:function(){return this.forEach(function(e){e.parentNode.removeChild(e)}),this},find:function(e){return(0,s.default)(e,this)},addClass:function(e){return this.forEach(function(t){t.classList.add(e)}),this},removeClass:function(e){return this.forEach(function(t){t.classList.remove(e)}),this},eq:function(e){return(0,s.default)(this[e])},show:function(){return this.forEach(function(e){e.style.display="block"}),this},hide:function(){return this.forEach(function(e){e.style.display="none"}),this},html:function(e){return this.forEach(function(t){t.innerHTML=e}),this},css:function(e){var t=this;return Object.keys(e).forEach(function(n){t.forEach(function(t){t.style[n]=e[n]})}),this},on:function(e,t,n){var i="string"==typeof t&&"function"==typeof n;return i||(n=t),this.forEach(function(o){e.split(" ").forEach(function(e){o.addEventListener(e,function(e){i?this.contains(e.target.closest(t))&&n.call(e.target,e):n.call(this,e)})})}),this},off:function(e,t,n){return"function"==typeof t&&(n=t,t=null),this.forEach(function(i){e.split(" ").forEach(function(e){"string"==typeof t?i.querySelectorAll(t).forEach(function(t){t.removeEventListener(e,n)}):i.removeEventListener(e,n)})}),this},index:function(){var e=this[0],t=e.parentNode;return Array.prototype.indexOf.call(t.children,e)},offAll:function(){var e=this;return this.forEach(function(t,n){var i=t.cloneNode(!0);t.parentNode.replaceChild(i,t),e[n]=i}),this},val:function(){var e=arguments;return arguments.length?(this.forEach(function(t){t.value=e[0]}),this):this[0].value},attr:function(){var e=arguments,t=this;if("object"==a(arguments[0])){var n=function(){var n=e[0],i=t;return Object.keys(n).forEach(function(e){i.forEach(function(t){t.setAttribute(e,n[e])})}),{v:t}}();if("object"===("undefined"==typeof n?"undefined":a(n)))return n.v}return"string"==typeof arguments[0]&&arguments.length<2?this[0].getAttribute(arguments[0]):(this.forEach(function(t){t.setAttribute(e[0],e[1])}),this)}}),(0,u.default)(s.default,{extend:u.default,noop:function(){},render:function(e,t){var n="var p=[];with(this){p.push('"+e.replace(/[\r\t\n]/g," ").split("<%").join("\t").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split("\t").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');";return new Function(n).apply(t)},getStyle:function(e,t){var n,i=(e.ownerDocument||document).defaultView;return i&&i.getComputedStyle?(t=t.replace(/([A-Z])/g,"-$1").toLowerCase(),i.getComputedStyle(e,null).getPropertyValue(t)):e.currentStyle?(t=t.replace(/\-(\w)/g,function(e,t){return t.toUpperCase()}),n=e.currentStyle[t],/^\d+(em|pt|%|ex)?$/i.test(n)?function(t){var n=e.style.left,i=e.runtimeStyle.left;return e.runtimeStyle.left=e.currentStyle.left,e.style.left=t||0,t=e.style.pixelLeft+"px",e.style.left=n,e.runtimeStyle.left=i,t}(n):n):void 0}}),t.default=s.default,e.exports=t.default},function(e,t){!function(e){"function"!=typeof e.matches&&(e.matches=e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||function(e){for(var t=this,n=(t.document||t.ownerDocument).querySelectorAll(e),i=0;n[i]&&n[i]!==t;)++i;return Boolean(n[i])}),"function"!=typeof e.closest&&(e.closest=function(e){for(var t=this;t&&1===t.nodeType;){if(t.matches(e))return t;t=t.parentNode}return null})}(window.Element.prototype)},function(e,t){"use strict";function n(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function i(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var i=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==i.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}var o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=i()?Object.assign:function(e,t){for(var i,r,u=n(e),l=1;l<arguments.length;l++){i=Object(arguments[l]);for(var s in i)o.call(i,s)&&(u[s]=i[s]);if(Object.getOwnPropertySymbols){r=Object.getOwnPropertySymbols(i);for(var d=0;d<r.length;d++)a.call(i,r[d])&&(u[r[d]]=i[r[d]])}}return u}},function(e,t,n){var i,o;!function(n,a){a=function(e,t,n){function i(o,a,r){return r=Object.create(i.fn),o&&r.push.apply(r,o[t]?[o]:""+o===o?/</.test(o)?((a=e.createElement(a||t)).innerHTML=o,a.children):a?(a=i(a)[0])?a[n](o):r:e[n](o):"function"==typeof o?e.readyState[7]?o():e[t]("DOMContentLoaded",o):o),r}return i.fn=[],i.one=function(e,t){return i(e,t)[0]||null},i}(document,"addEventListener","querySelectorAll"),i=[],o=function(){return a}.apply(t,i),!(void 0!==o&&(e.exports=o))}(this)},function(e,t){e.exports='<div class="<%=className%>"> <div class=weui-mask></div> <div class="weui-dialog <% if(isAndroid){ %> weui-skin_android <% } %>"> <% if(title){ %> <div class=weui-dialog__hd><strong class=weui-dialog__title><%=title%></strong></div> <% } %> <div class=weui-dialog__bd><%=content%></div> <div class=weui-dialog__ft> <% for(var i = 0; i < buttons.length; i++){ %> <a href=javascript:; class="weui-dialog__btn weui-dialog__btn_<%=buttons[i][\'type\']%>"><%=buttons[i][\'label\']%></a> <% } %> </div> </div> </div> '},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.noop,n=arguments[2];return"object"===("undefined"==typeof t?"undefined":a(t))&&(n=t,t=u.default.noop),n=u.default.extend({content:e,buttons:[{label:"确定",type:"primary",onClick:t}]},n),(0,s.default)(n)}Object.defineProperty(t,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r=n(2),u=i(r),l=n(1),s=i(l);t.default=o,e.exports=t.default},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.default.noop,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.default.noop,i=arguments[3];return"object"===("undefined"==typeof t?"undefined":a(t))?(i=t,t=u.default.noop):"object"===("undefined"==typeof n?"undefined":a(n))&&(i=n,n=u.default.noop),i=u.default.extend({content:e,buttons:[{label:"取消",type:"default",onClick:n},{label:"确定",type:"primary",onClick:t}]},i),(0,s.default)(i)}Object.defineProperty(t,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r=n(2),u=i(r),l=n(1),s=i(l);t.default=o,e.exports=t.default},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(s)return s;"number"==typeof t&&(t={duration:t}),"function"==typeof t&&(t={callback:t}),t=r.default.extend({content:e,duration:3e3,callback:r.default.noop,className:""},t);var n=(0,r.default)(r.default.render(l.default,t)),i=n.find(".weui-toast"),o=n.find(".weui-mask");return(0,r.default)("body").append(n),i.addClass("weui-animate-fade-in"),o.addClass("weui-animate-fade-in"),setTimeout(function(){o.addClass("weui-animate-fade-out"),i.addClass("weui-animate-fade-out").on("animationend webkitAnimationEnd",function(){n.remove(),s=!1,t.callback()})},t.duration),s=n[0],n[0]}Object.defineProperty(t,"__esModule",{value:!0});var a=n(2),r=i(a),u=n(10),l=i(u),s=void 0;t.default=o,e.exports=t.default},function(e,t){e.exports='<div class="<%= className %>"> <div class=weui-mask_transparent></div> <div class=weui-toast> <i class="weui-icon_toast weui-icon-success-no-circle"></i> <p class=weui-toast__content><%=content%></p> </div> </div> '},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(){function e(t){e=r.default.noop,u.addClass("weui-animate-fade-out"),a.addClass("weui-animate-fade-out").on("animationend webkitAnimationEnd",function(){o.remove(),s=!1,t&&t()})}function t(t){e(t)}var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(s)return s;i=r.default.extend({content:n,className:""},i);var o=(0,r.default)(r.default.render(l.default,i)),a=o.find(".weui-toast"),u=o.find(".weui-mask");return(0,r.default)("body").append(o),a.addClass("weui-animate-fade-in"),u.addClass("weui-animate-fade-in"),s=o[0],s.hide=t,s}Object.defineProperty(t,"__esModule",{value:!0});var a=n(2),r=i(a),u=n(12),l=i(u),s=void 0;t.default=o,e.exports=t.default},function(e,t){e.exports='<div class="weui-loading_toast <%= className %>"> <div class=weui-mask_transparent></div> <div class=weui-toast> <i class="weui-loading weui-icon_toast"></i> <p class=weui-toast__content><%=content%></p> </div> </div> '},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(){function e(t){e=r.default.noop,d.addClass(o.isAndroid?"weui-animate-fade-out":"weui-animate-slide-down"),f.addClass("weui-animate-fade-out").on("animationend webkitAnimationEnd",function(){u.remove(),s=!1,o.onClose(),t&&t()})}function t(t){e(t)}var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(s)return s;var a=r.default.os.android;o=r.default.extend({menus:n,actions:i,title:"",className:"",isAndroid:a,onClose:r.default.noop},o);var u=(0,r.default)(r.default.render(l.default,o)),d=u.find(".weui-actionsheet"),f=u.find(".weui-mask");return(0,r.default)("body").append(u),r.default.getStyle(d[0],"transform"),d.addClass(o.isAndroid?"weui-animate-fade-in":"weui-animate-slide-up"),f.addClass("weui-animate-fade-in").on("click",function(){t()}),u.find(".weui-actionsheet__menu").on("click",".weui-actionsheet__cell",function(e){var i=(0,r.default)(this).index();n[i].onClick.call(this,e),t()}),u.find(".weui-actionsheet__action").on("click",".weui-actionsheet__cell",function(e){var n=(0,r.default)(this).index();i[n].onClick.call(this,e),t()}),s=u[0],s.hide=t,s}Object.defineProperty(t,"__esModule",{value:!0});var a=n(2),r=i(a),u=n(14),l=i(u),s=void 0;t.default=o,e.exports=t.default},function(e,t){e.exports='<div class="<% if(isAndroid){ %>weui-skin_android <% } %><%= className %>"> <div class=weui-mask></div> <div class=weui-actionsheet> <% if(!isAndroid && title){ %> <div class=weui-actionsheet__title> <p class=weui-actionsheet__title-text><%= title %></p> </div> <% } %> <div class=weui-actionsheet__menu> <% for(var i = 0; i < menus.length; i++){ %> <div class=weui-actionsheet__cell><%= menus[i].label %></div> <% } %> </div> <div class=weui-actionsheet__action> <% for(var j = 0; j < actions.length; j++){ %> <div class=weui-actionsheet__cell><%= actions[j].label %></div> <% } %> </div> </div> </div> '},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e){function t(e){t=r.default.noop,o.remove(),e&&e(),i.callback(),s=null}function n(e){t(e)}var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"number"==typeof i&&(i={duration:i}),"function"==typeof i&&(i={callback:i}),i=r.default.extend({content:e,duration:3e3,callback:r.default.noop,className:""},i);var o=(0,r.default)(r.default.render(l.default,i));return(0,r.default)("body").append(o),s&&(clearTimeout(s.timeout),s.hide()),s={hide:n},s.timeout=setTimeout(n,i.duration),o[0].hide=n,o[0]}Object.defineProperty(t,"__esModule",{value:!0});var a=n(2),r=i(a),u=n(16),l=i(u),s=null;t.default=o,e.exports=t.default},function(e,t){e.exports='<div class="weui-toptips weui-toptips_warn <%= className %>" style=display:block><%= content %></div> '},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=(0,r.default)(e);return t.forEach(function(e){function t(){o.val(""),n.removeClass("weui-search-bar_focusing")}var n=(0,r.default)(e),i=n.find(".weui-search-bar__label"),o=n.find(".weui-search-bar__input"),a=n.find(".weui-icon-clear"),u=n.find(".weui-search-bar__cancel-btn");i.on("click",function(){n.addClass("weui-search-bar_focusing"),o[0].focus()}),o.on("blur",function(){this.value.length||t()}),a.on("click",function(){o.val(""),o[0].focus()}),u.on("click",function(){t(),o[0].blur()})}),t}Object.defineProperty(t,"__esModule",{value:!0});var a=n(2),r=i(a);t.default=o,e.exports=t.default},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,r.default)(e);return t=r.default.extend({defaultIndex:0,onChange:r.default.noop},t),n.forEach(function(e){var n=(0,r.default)(e),i=n.find(".weui-navbar__item, .weui-tabbar__item"),o=n.find(".weui-tab__content");i.eq(t.defaultIndex).addClass("weui-bar__item_on"),o.eq(t.defaultIndex).show(),i.on("click",function(){var e=(0,r.default)(this),n=e.index();i.removeClass("weui-bar__item_on"),e.addClass("weui-bar__item_on"),o.hide(),o.eq(n).show(),t.onChange.call(this,n)})}),this}Object.defineProperty(t,"__esModule",{value:!0});var a=n(2),r=i(a);t.default=o,e.exports=t.default},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e){return e&&e.classList?e.classList.contains("weui-cell")?e:o(e.parentNode):null}function a(e,t,n){var i=e[0],o=e.val();if("INPUT"==i.tagName||"TEXTAREA"==i.tagName){var a=i.getAttribute("pattern")||"";if("radio"==i.type){for(var r=t.find('input[type="radio"][name="'+i.name+'"]'),u=0,l=r.length;u<l;++u)if(r[u].checked)return null;return"empty"}if("checkbox"!=i.type){if(a){if(/^REG_/.test(a)){if(!n)throw"RegExp "+a+" is empty.";if(a=a.replace(/^REG_/,""),!n[a])throw"RegExp "+a+" has not found.";a=n[a]}return new RegExp(a).test(o)?null:e.val().length?"notMatch":"empty"}return e.val().length?null:"empty"}if(!a)return i.checked?null:"empty";var s=function(){var e=t.find('input[type="checkbox"][name="'+i.name+'"]'),n=a.replace(/[{\s}]/g,"").split(","),o=0;if(2!=n.length)throw i.outerHTML+" regexp is wrong.";return e.forEach(function(e){e.checked&&++o}),""===n[1]?o>=parseInt(n[0])?{v:null}:{v:0==o?"empty":"notMatch"}:parseInt(n[0])<=o&&o<=parseInt(n[1])?{v:null}:{v:0==o?"empty":"notMatch"}}();if("object"===("undefined"==typeof s?"undefined":d(s)))return s.v}else if(o.length)return null;return"empty"}function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c.default.noop,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=(0,c.default)(e);return i.forEach(function(e){var i=(0,c.default)(e),o=i.find("[required]");"function"!=typeof t&&(t=l);for(var r=0,u=o.length;r<u;++r){var s=o.eq(r),d=a(s,i,n.regexp),f={ele:s[0],msg:d};if(d)return void(t(f)||l(f))}t(null)}),this}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,c.default)(e);return n.forEach(function(e){var n=(0,c.default)(e);n.find("[required]").on("blur",function(){if("checkbox"!=this.type&&"radio"!=this.type){var e=(0,c.default)(this);if(!(e.val().length<1)){var i=a(e,n,t.regexp);i&&l({ele:e[0],msg:i})}}}).on("focus",function(){s(this)})}),this}function l(e){if(e){var t=(0,c.default)(e.ele),n=e.msg,i=t.attr(n+"Tips")||t.attr("tips")||t.attr("placeholder");if(i&&(0,h.default)(i),"checkbox"==e.ele.type||"radio"==e.ele.type)return;var a=o(e.ele);a&&a.classList.add("weui-cell_warn")}}function s(e){var t=o(e);t&&t.classList.remove("weui-cell_warn")}Object.defineProperty(t,"__esModule",{value:!0});var d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f=n(2),c=i(f),p=n(15),h=i(p);t.default={showErrorTips:l,hideErrorTips:s,validate:r,checkIfBlur:u},e.exports=t.default},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){function n(e,t){var n=e.find('[data-id="'+t+'"]'),i=n.find(".weui-uploader__file-content");return i.length||(i=(0,r.default)('<div class="weui-uploader__file-content"></div>'),n.append(i)),n.addClass("weui-uploader__file_status"),i}function i(e,t){var n=e.find('[data-id="'+t+'"]').removeClass("weui-uploader__file_status");n.find(".weui-uploader__file-content").remove()}function o(e){e.url=u.createObjectURL(e),e.status="ready",e.upload=function(){(0,f.default)(r.default.extend({$uploader:a,file:e},t))},e.stop=function(){this.xhr.abort()},t.onQueued(e),t.auto&&e.upload()}var a=(0,r.default)(e),u=window.URL||window.webkitURL||window.mozURL;t=r.default.extend({url:"",auto:!0,type:"file",fileVal:"file",xhrFields:{},onBeforeQueued:r.default.noop,onQueued:r.default.noop,onBeforeSend:r.default.noop,onSuccess:r.default.noop,onProgress:r.default.noop,onError:r.default.noop},t),t.compress!==!1&&(t.compress=r.default.extend({width:1600,height:1600,quality:.8},t.compress)),t.onBeforeQueued&&!function(){var e=t.onBeforeQueued;t.onBeforeQueued=function(t,n){var i=e.call(t,n);if(i===!1)return!1;if(i!==!0){var o=(0,r.default)(r.default.render(l.default,{id:t.id}));a.find(".weui-uploader__files").append(o)}}}(),t.onQueued&&!function(){var e=t.onQueued;t.onQueued=function(n){if(!e.call(n)){var o=a.find('[data-id="'+n.id+'"]');o.css({backgroundImage:'url("'+(n.base64||n.url)+'")'}),t.auto||i(a,n.id)}}}(),t.onBeforeSend&&!function(){var e=t.onBeforeSend;t.onBeforeSend=function(t,n,i){var o=e.call(t,n,i);if(o===!1)return!1}}(),t.onSuccess&&!function(){var e=t.onSuccess;t.onSuccess=function(t,n){t.status="success",e.call(t,n)||i(a,t.id)}}(),t.onProgress&&!function(){var e=t.onProgress;t.onProgress=function(t,i){e.call(t,i)||n(a,t.id).html(i+"%")}}(),t.onError&&!function(){var e=t.onError;t.onError=function(t,i){t.status="fail",e.call(t,i)||n(a,t.id).html('<i class="weui-icon-warn"></i>')}}(),a.find('input[type="file"]').on("change",function(e){var n=e.target.files;0!==n.length&&(t.compress===!1&&"file"==t.type?Array.prototype.forEach.call(n,function(e){e.id=++c,t.onBeforeQueued(e,n)!==!1&&o(e)}):Array.prototype.forEach.call(n,function(e){e.id=++c,t.onBeforeQueued(e,n)!==!1&&(0,s.compress)(e,t,function(e){e&&o(e)})}),this.value="")})}Object.defineProperty(t,"__esModule",{value:!0});var a=n(2),r=i(a),u=n(21),l=i(u),s=n(22),d=n(23),f=i(d),c=0;t.default=o,e.exports=t.default},function(e,t){e.exports='<li class="weui-uploader__file weui-uploader__file_status" data-id="<%= id %>"> <div class=weui-uploader__file-content> <i class=weui-loading style=width:30px;height:30px></i> </div> </li> '},function(e,t){"use strict";function n(e){var t,n=e.naturalHeight,i=document.createElement("canvas");i.width=1,i.height=n;var o=i.getContext("2d");o.drawImage(e,0,0);try{t=o.getImageData(0,0,1,n).data}catch(e){return 1}for(var a=0,r=n,u=n;u>a;){var l=t[4*(u-1)+3];0===l?r=u:a=u,u=r+a>>1}var s=u/n;return 0===s?1:s}function i(e){for(var t=atob(e.split(",")[1]),n=new ArrayBuffer(t.length),i=new Uint8Array(n),o=0;o<t.length;o++)i[o]=t.charCodeAt(o);return n}function o(e){var t=e.split(",")[0].split(":")[1].split(";")[0],n=i(e);return new Blob([n],{type:t})}function a(e){var t=new DataView(e);if(65496!=t.getUint16(0,!1))return-2;for(var n=t.byteLength,i=2;i<n;){var o=t.getUint16(i,!1);if(i+=2,65505==o){if(1165519206!=t.getUint32(i+=2,!1))return-1;var a=18761==t.getUint16(i+=6,!1);i+=t.getUint32(i+4,a);var r=t.getUint16(i,a);i+=2;for(var u=0;u<r;u++)if(274==t.getUint16(i+12*u,a))return t.getUint16(i+12*u+8,a)}else{if(65280!=(65280&o))break;i+=t.getUint16(i,!1)}}return-1}function r(e,t,n){var i=e.width,o=e.height;switch(n>4&&(e.width=o,e.height=i),n){case 2:t.translate(i,0),t.scale(-1,1);break;case 3:t.translate(i,o),t.rotate(Math.PI);break;case 4:t.translate(0,o),t.scale(1,-1);break;case 5:t.rotate(.5*Math.PI),t.scale(1,-1);break;case 6:t.rotate(.5*Math.PI),t.translate(0,-o);break;case 7:t.rotate(.5*Math.PI),t.translate(i,-o),t.scale(-1,1);break;case 8:t.rotate(-.5*Math.PI),t.translate(-i,0)}}function u(e,t,u){var l=new FileReader;l.onload=function(l){if(t.compress===!1)return e.base64=l.target.result,void u(e);var s=new Image;s.onload=function(){var l=n(s),d=a(i(s.src)),f=document.createElement("canvas"),c=f.getContext("2d"),p=t.compress.width,h=t.compress.height,v=s.width,m=s.height,y=void 0;if(v<m&&m>h?(v=parseInt(h*s.width/s.height),m=h):v>=m&&v>p&&(m=parseInt(p*s.height/s.width),v=p),f.width=v,f.height=m,d>0&&r(f,c,d),c.drawImage(s,0,0,v,m/l),y=/image\/jpeg/.test(e.type)||/image\/jpg/.test(e.type)?f.toDataURL("image/jpeg",t.compress.quality):f.toDataURL(e.type),"file"==t.type)if(/;base64,null/.test(y)||/;base64,$/.test(y))u(e);else{var w=o(y);w.id=e.id,w.name=e.name,w.lastModified=e.lastModified,w.lastModifiedDate=e.lastModifiedDate,u(w)}else/;base64,null/.test(y)||/;base64,$/.test(y)?(t.onError(e,new Error("Compress fail, dataURL is "+y+".")),u()):(e.base64=y,u(e))},s.src=l.target.result},l.readAsDataURL(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default={compress:u},e.exports=t.default},function(e,t){"use strict";function n(e){var t=e.url,n=e.file,i=e.fileVal,o=e.onBeforeSend,a=e.onProgress,r=e.onError,u=e.onSuccess,l=e.xhrFields,s=n.name,d=n.type,f=n.lastModifiedDate,c={name:s,type:d,size:"file"==e.type?n.size:n.base64.length,lastModifiedDate:f},p={};if(o(n,c,p)!==!1){n.status="progress",a(n,0);var h=new FormData,v=new XMLHttpRequest;n.xhr=v,Object.keys(c).forEach(function(e){h.append(e,c[e])}),"file"==e.type?h.append(i,n,s):h.append(i,n.base64),v.onreadystatechange=function(){if(4==v.readyState)if(200==v.status)try{var e=JSON.parse(v.responseText);u(n,e)}catch(e){r(n,e)}else r(n,new Error("XMLHttpRequest response status is "+v.status))},v.upload.addEventListener("progress",function(e){if(0!=e.total){var t=100*Math.ceil(e.loaded/e.total);a(n,t)}},!1),v.open("POST",t),Object.keys(l).forEach(function(e){v[e]=l[e]}),Object.keys(p).forEach(function(e){v.setRequestHeader(e,p[e])}),v.send(h)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default},function(e,t,n){"use strict";function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function o(e){return e&&e.__esModule?e:{default:e}}function a(e){"object"!=("undefined"==typeof e?"undefined":l(e))&&(e={label:e,value:e}),d.default.extend(this,e)}function r(){function e(){(0,d.default)(r.container).append(v),d.default.getStyle(v[0],"transform"),v.find(".weui-mask").addClass("weui-animate-fade-in"),v.find(".weui-picker").addClass("weui-animate-slide-up")}function t(e){t=d.default.noop,v.find(".weui-mask").addClass("weui-animate-fade-out"),v.find(".weui-picker").addClass("weui-animate-slide-down").on("animationend webkitAnimationEnd",function(){v.remove(),g=!1,r.onClose(),e&&e()})}function n(e){t(e)}function i(e,t){if(void 0===p[t]&&r.defaultValue&&void 0!==r.defaultValue[t]){var n=r.defaultValue[t],o=0,u=e.length;if("object"==l(e[o]))for(;o<u&&n!=e[o].value;++o);else for(;o<u&&n!=e[o];++o);o<u&&(p[t]=o)}v.find(".weui-picker__group").eq(t).scroll({items:e,temp:p[t],onChange:function(e,n){if(e?c[t]=new a(e):c[t]=null,p[t]=n,s)c.length==y&&r.onChange(c);else if(e.children&&e.children.length>0)v.find(".weui-picker__group").eq(t+1).show(),!s&&i(e.children,t+1);else{var o=v.find(".weui-picker__group");o.forEach(function(e,n){n>t&&(0,d.default)(e).hide()}),c.splice(t+1),r.onChange(c)}},onConfirm:r.onConfirm})}if(g)return g;var o=arguments[arguments.length-1],r=d.default.extend({id:"default",className:"",container:"body",onChange:d.default.noop,onConfirm:d.default.noop,onClose:d.default.noop},o),u=void 0,s=!1;if(arguments.length>2){var f=0;for(u=[];f<arguments.length-1;)u.push(arguments[f++]);s=!0}else u=arguments[0];_[r.id]=_[r.id]||[];for(var c=[],p=_[r.id],v=(0,d.default)(d.default.render(m.default,r)),y=o.depth||(s?u.length:h.depthOf(u[0])),b="",k=y;k--;)b+=w.default;return v.find(".weui-picker__bd").html(b),e(),s?u.forEach(function(e,t){i(e,t)}):i(u,0),v.on("click",".weui-mask",function(){n()}).on("click",".weui-picker__action",function(){n()}).on("click","#weui-picker-confirm",function(){r.onConfirm(c)}),g=v[0],g.hide=n,g}function u(e){var t=new Date,n=d.default.extend({id:"datePicker",onChange:d.default.noop,onConfirm:d.default.noop,start:t.getFullYear()-20,end:t.getFullYear()+20,defaultValue:[t.getFullYear(),t.getMonth()+1,t.getDate()],cron:"* * *"},e);"number"==typeof n.start?n.start=new Date(n.start+"/01/01"):"string"==typeof n.start&&(n.start=new Date(n.start.replace(/-/g,"/"))),"number"==typeof n.end?n.end=new Date(n.end+"/12/31"):"string"==typeof n.end&&(n.end=new Date(n.end.replace(/-/g,"/")));var i=function(e,t,n){for(var i=0,o=e.length;i<o;i++){var a=e[i];if(a[t]==n)return a}},o=[],a=c.default.parse(n.cron,n.start,n.end),u=void 0;do{u=a.next();var l=u.value.getFullYear(),s=u.value.getMonth()+1,f=u.value.getDate(),p=i(o,"value",l);p||(p={label:l+"年",value:l,children:[]},o.push(p));var h=i(p.children,"value",s);h||(h={label:s+"月",value:s,children:[]},p.children.push(h)),h.children.push({label:f+"日",value:f})}while(!u.done);return r(o,n)}Object.defineProperty(t,"__esModule",{value:!0});var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=n(2),d=o(s),f=n(25),c=o(f);n(26);var p=n(27),h=i(p),v=n(28),m=o(v),y=n(29),w=o(y);a.prototype.toString=function(){return this.value},a.prototype.valueOf=function(){return this.value};var g=void 0,_={};t.default={picker:r,datePicker:u},e.exports=t.default},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){var n=t[0],i=t[1],o=[],a=void 0;e=e.replace(/\*/g,n+"-"+i);for(var u=e.split(","),l=0,s=u.length;l<s;l++){var d=u[l];d.match(r)&&d.replace(r,function(e,t,r,u){u=parseInt(u)||1,t=Math.min(Math.max(n,~~Math.abs(t)),i),r=r?Math.min(i,~~Math.abs(r)):t,a=t;do o.push(a),a+=u;while(a<=r)})}return o}function o(e,t,n){var o=e.replace(/^\s\s*|\s\s*$/g,"").split(/\s+/),a=[];return o.forEach(function(e,t){var n=u[t];a.push(i(e,n))}),new l(a,t,n)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=/^(\d+)(?:-(\d+))?(?:\/(\d+))?$/g,u=[[1,31],[1,12],[0,6]],l=function(){function e(t,i,o){n(this,e),this._dates=t[0],this._months=t[1],this._days=t[2],this._start=i,this._end=o,this._pointer=i}return a(e,[{key:"_findNext",value:function(){for(var e=void 0;;){if(this._end.getTime()-this._pointer.getTime()<0)throw new Error("out of range, end is "+this._end+", current is "+this._pointer);var t=this._pointer.getMonth(),n=this._pointer.getDate(),i=this._pointer.getDay();if(this._months.indexOf(t+1)!==-1)if(this._dates.indexOf(n)!==-1){if(this._days.indexOf(i)!==-1){e=new Date(this._pointer);break}this._pointer.setDate(n+1)}else this._pointer.setDate(n+1);else this._pointer.setMonth(t+1),this._pointer.setDate(1)}return e}},{key:"next",value:function(){var e=this._findNext();return this._pointer.setDate(this._pointer.getDate()+1),{value:e,done:!this.hasNext()}}},{key:"hasNext",value:function(){try{return this._findNext(),!0}catch(e){return!1}}}]),e}();t.default={parse:o},e.exports=t.default},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=n(2),r=i(a),u=function(e,t){return e.css({"-webkit-transition":"all "+t+"s",transition:"all "+t+"s"})},l=function(e,t){return e.css({"-webkit-transform":"translate3d(0, "+t+"px, 0)",transform:"translate3d(0, "+t+"px, 0)"})},s=function(e){for(var t=Math.floor(e.length/2),n=0;e[t]&&e[t].disabled;)if(t=++t%e.length,n++,n>e.length)throw new Error("No selectable item.");return t},d=function(e,t,n){var i=s(n);return(e-i)*t},f=function(e,t){return e*t},c=function(e,t,n){return-(t*(n-e-1))};r.default.fn.scroll=function(e){function t(e){y=e,g=+new Date}function n(e){w=e;var t=w-y;u(m,0),l(m,_+t),g=+new Date,b.push({time:g,y:w}),b.length>40&&b.shift()}function i(e){if(y){var t=(new Date).getTime(),n=k-p.bodyHeight/2;if(w=e,t-g>100)C(Math.abs(w-y)>10?w-y:n-w);else if(Math.abs(w-y)>10){for(var i=b.length-1,o=i,a=i;a>0&&g-b[a].time<100;a--)o=a;if(o!==i){var r=b[i],u=b[o],l=r.time-u.time,s=r.y-u.y,d=s/l,f=150*d+(w-y);C(f)}else C(0)}else C(n-w);y=null}}var a=this,p=r.default.extend({items:[],scrollable:".weui-picker__content",offset:3,rowHeight:34,onChange:r.default.noop,
temp:null,bodyHeight:238},e),h=p.items.map(function(e){return'<div class="weui-picker__item'+(e.disabled?" weui-picker__item_disabled":"")+'">'+("object"==("undefined"==typeof e?"undefined":o(e))?e.label:e)+"</div>"}).join(""),v=(0,r.default)(this);v.find(".weui-picker__content").html(h);var m=v.find(p.scrollable),y=void 0,w=void 0,g=void 0,_=void 0,b=[],k=window.innerHeight;if(null!==p.temp&&p.temp<p.items.length){var x=p.temp;p.onChange.call(this,p.items[x],x),_=(p.offset-x)*p.rowHeight}else{var M=s(p.items);p.onChange.call(this,p.items[M],M),_=d(p.offset,p.rowHeight,p.items)}l(m,_);var C=function(e){_+=e,_=Math.round(_/p.rowHeight)*p.rowHeight;var t=f(p.offset,p.rowHeight),n=c(p.offset,p.rowHeight,p.items.length);_>t&&(_=t),_<n&&(_=n);for(var i=p.offset-_/p.rowHeight;p.items[i]&&p.items[i].disabled;)e>0?++i:--i;_=(p.offset-i)*p.rowHeight,u(m,.3),l(m,_),p.onChange.call(a,p.items[i],i)};m=v.offAll().on("touchstart",function(e){t(e.changedTouches[0].pageY)}).on("touchmove",function(e){n(e.changedTouches[0].pageY),e.preventDefault()}).on("touchend",function(e){i(e.changedTouches[0].pageY)}).find(p.scrollable);var j="ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch;j||v.on("mousedown",function(e){t(e.pageY),e.stopPropagation(),e.preventDefault()}).on("mousemove",function(e){y&&(n(e.pageY),e.stopPropagation(),e.preventDefault())}).on("mouseup mouseleave",function(e){i(e.pageY),e.stopPropagation(),e.preventDefault()})}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.depthOf=function e(t){var n=1;return t.children&&t.children[0]&&(n=e(t.children[0])+1),n}},function(e,t){e.exports='<div class="<%= className %>"> <div class=weui-mask></div> <div class=weui-picker> <div class=weui-picker__hd> <a href=javascript:; data-action=cancel class=weui-picker__action>取消</a> <a href=javascript:; data-action=select class=weui-picker__action id=weui-picker-confirm>确定</a> </div> <div class=weui-picker__bd></div> </div> </div> '},function(e,t){e.exports="<div class=weui-picker__group> <div class=weui-picker__mask></div> <div class=weui-picker__indicator></div> <div class=weui-picker__content></div> </div>"},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e){function t(e){t=r.default.noop,o.addClass("weui-animate-fade-out").on("animationend webkitAnimationEnd",function(){o.remove(),s=!1,e&&e()})}function n(e){t(e)}var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(s)return s;i=r.default.extend({className:"",onDelete:r.default.noop},i);var o=(0,r.default)(r.default.render(l.default,r.default.extend({url:e},i)));return(0,r.default)("body").append(o),o.find(".weui-gallery__img").on("click",function(){n()}),o.find(".weui-gallery__del").on("click",function(){i.onDelete.call(this,e)}),o.show().addClass("weui-animate-fade-in"),s=o[0],s.hide=n,s}Object.defineProperty(t,"__esModule",{value:!0});var a=n(2),r=i(a),u=n(31),l=i(u),s=void 0;t.default=o,e.exports=t.default},function(e,t){e.exports='<div class="weui-gallery <%= className %>"> <span class=weui-gallery__img style="background-image:url(<%= url %>)"></span> <div class=weui-gallery__opr> <a href=javascript: class=weui-gallery__del> <i class="weui-icon-delete weui-icon_gallery-delete"></i> </a> </div> </div> '},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,r.default)(e);if(t=r.default.extend({step:void 0,defaultValue:0,onChange:r.default.noop},t),void 0!==t.step&&(t.step=parseFloat(t.step),!t.step||t.step<0))throw new Error("Slider step must be a positive number.");if(void 0!==t.defaultValue&&t.defaultValue<0||t.defaultValue>100)throw new Error("Slider defaultValue must be >= 0 and <= 100.");return n.forEach(function(e){function n(){var e=r.default.getStyle(l[0],"left");return e=/%/.test(e)?s*parseFloat(e)/100:parseFloat(e)}function i(n){var i=void 0,o=void 0;t.step&&(n=Math.round(n/p)*p),i=f+n,i=i<0?0:i>s?s:i,o=100*i/s,u.css({width:o+"%"}),l.css({left:o+"%"}),t.onChange.call(e,o)}var o=(0,r.default)(e),a=o.find(".weui-slider__inner"),u=o.find(".weui-slider__track"),l=o.find(".weui-slider__handler"),s=parseInt(r.default.getStyle(a[0],"width")),d=a[0].offsetLeft,f=0,c=0,p=void 0;t.step&&(p=s*t.step/100),t.defaultValue&&i(s*t.defaultValue/100),o.on("click",function(e){e.preventDefault(),f=n(),i(e.pageX-d-f)}),l.on("touchstart",function(e){f=n(),c=e.changedTouches[0].clientX}).on("touchmove",function(e){e.preventDefault(),i(e.changedTouches[0].clientX-c)})}),this}Object.defineProperty(t,"__esModule",{value:!0});var a=n(2),r=i(a);t.default=o,e.exports=t.default}])});
/* eslint-enable */
| 2,463.533333 | 32,012 | 0.685384 |
1e4a00c63bfd4f53ebc01147b11f970dc9af4136 | 258 | js | JavaScript | test/unit/test1.js | dgleghorne/autopowerpoint | 46f0b844a360d0301e795a8d12fafb71f4209d08 | [
"MIT"
] | null | null | null | test/unit/test1.js | dgleghorne/autopowerpoint | 46f0b844a360d0301e795a8d12fafb71f4209d08 | [
"MIT"
] | 3 | 2021-03-08T23:19:53.000Z | 2022-02-12T04:36:42.000Z | test/unit/test1.js | dgleghorne/autopowerpoint | 46f0b844a360d0301e795a8d12fafb71f4209d08 | [
"MIT"
] | null | null | null | 'use strict'
// var chai = require("chai")
// var expect = chai.expect
import {expect} from 'chai'
describe("Given", () => {
describe("When", () => {
it("Then true equals true", () => {
expect(true).to.eql(true)
})
})
}) | 19.846154 | 43 | 0.503876 |
1e4a23ced56e1fb2afaa42426b9ef3965372bbe5 | 180 | js | JavaScript | src/index.js | maxnope/reverse-int | fdcf4d45b184f7ca40d2f9afc23d409d02b4ab93 | [
"MIT"
] | null | null | null | src/index.js | maxnope/reverse-int | fdcf4d45b184f7ca40d2f9afc23d409d02b4ab93 | [
"MIT"
] | null | null | null | src/index.js | maxnope/reverse-int | fdcf4d45b184f7ca40d2f9afc23d409d02b4ab93 | [
"MIT"
] | null | null | null | module.exports = function reverse (n) {
let n_positive = Math.abs(n)
let n_string = n_positive.toString()
return n_string.split('').reverse().join('');
}
| 25.714286 | 50 | 0.605556 |
1e4ab3b850384cad07935f2152c47331ef1e0fe0 | 113 | js | JavaScript | src/components/Sidebar/index.js | rntjr/react-dashboard-template | c059ca7c601474745c4ddd5e4c0aefa8ed04f2a5 | [
"MIT"
] | null | null | null | src/components/Sidebar/index.js | rntjr/react-dashboard-template | c059ca7c601474745c4ddd5e4c0aefa8ed04f2a5 | [
"MIT"
] | null | null | null | src/components/Sidebar/index.js | rntjr/react-dashboard-template | c059ca7c601474745c4ddd5e4c0aefa8ed04f2a5 | [
"MIT"
] | null | null | null | export { default as MainSidebar } from './MainSidebar'
export { default as DrawerSidebar } from './DrawerSidebar' | 56.5 | 58 | 0.761062 |
1e4ac684956f82cfd9813f161aa0fff809bafc59 | 1,006 | js | JavaScript | core-site/js/custom.js | Web-Dev-Collaborative/Web-Dev-Hub | 16ad7cfbeb97b31c8510605033b91d75b63e527e | [
"MIT"
] | null | null | null | core-site/js/custom.js | Web-Dev-Collaborative/Web-Dev-Hub | 16ad7cfbeb97b31c8510605033b91d75b63e527e | [
"MIT"
] | null | null | null | core-site/js/custom.js | Web-Dev-Collaborative/Web-Dev-Hub | 16ad7cfbeb97b31c8510605033b91d75b63e527e | [
"MIT"
] | null | null | null | $( ".js-height-full" ).height( $( window ).height() );
$( ".js-height-parent" ).each( function () {
$( this ).height( $( this ).parent().first().height() );
} );
// Fun Facts
function count ( $this ) {
var current = parseInt( $this.html(), 10 );
current = current + 1; /* Where 50 is increment */
$this.html( ++current );
if ( current > $this.data( "count" ) ) {
$this.html( $this.data( "count" ) );
} else {
setTimeout( function () {
count( $this );
}, 50 );
}
}
$( ".stat-timer" ).each( function () {
$( this ).data( "count", parseInt( $( this ).html(), 10 ) );
$( this ).html( "0" );
count( $( this ) );
} );
$( ".header" ).affix( {
offset: {
top: 100,
bottom: function () {
return ( this.bottom = $( ".footer" ).outerHeight( true ) );
},
},
} );
$( window ).load( function () {
$( "#preloader" ).on( 500 ).fadeOut();
$( ".preloader" ).on( 600 ).fadeOut( "slow" );
} );
| 25.15 | 72 | 0.469185 |
1e4ad1ccf0ba67c3a78d33a8586280e04f446610 | 968 | js | JavaScript | app/utils/tests/checkStore.test.js | McBenny/test-react-boilerplate | c62f70c5f0bef137351288272db7e9de76688933 | [
"MIT"
] | null | null | null | app/utils/tests/checkStore.test.js | McBenny/test-react-boilerplate | c62f70c5f0bef137351288272db7e9de76688933 | [
"MIT"
] | 7 | 2020-04-07T06:57:16.000Z | 2020-12-01T09:25:50.000Z | app/utils/tests/checkStore.test.js | McBenny/test-react-boilerplate | c62f70c5f0bef137351288272db7e9de76688933 | [
"MIT"
] | null | null | null | /**
* Test injectors
*/
import checkStore from '../checkStore';
describe('checkStore', () => {
let store;
beforeEach(() => {
store = {
dispatch: () => {},
subscribe: () => {},
getState: () => {},
replaceReducer: () => {},
runSaga: () => {},
injectedReducers: {},
injectedSagas: {}
};
});
it('should not throw if passed valid store shape', () => {
expect(() => checkStore(store)).not.toThrow();
});
it('should throw if passed invalid store shape', () => {
expect(() => checkStore({})).toThrow();
expect(() => checkStore({ ...store, injectedSagas: null })).toThrow();
expect(() => checkStore({ ...store, injectedReducers: null })).toThrow();
expect(() => checkStore({ ...store, runSaga: null })).toThrow();
expect(() => checkStore({ ...store, replaceReducer: null })).toThrow();
});
});
| 28.470588 | 81 | 0.483471 |
1e4ae88b49525a1e41b74372d63c41eac05d7011 | 1,974 | js | JavaScript | examples/generated/test/sketchJs/layouts/MultipleFlexText.js | thierryc/Lona | 8fff21e66b7a973b3ecaf4cdbae1c8cdb189d922 | [
"MIT"
] | null | null | null | examples/generated/test/sketchJs/layouts/MultipleFlexText.js | thierryc/Lona | 8fff21e66b7a973b3ecaf4cdbae1c8cdb189d922 | [
"MIT"
] | null | null | null | examples/generated/test/sketchJs/layouts/MultipleFlexText.js | thierryc/Lona | 8fff21e66b7a973b3ecaf4cdbae1c8cdb189d922 | [
"MIT"
] | null | null | null | import React from "react"
import { Text, View, StyleSheet, TextStyles } from
"@mathieudutour/react-sketchapp"
import colors from "../colors"
import shadows from "../shadows"
import textStyles from "../textStyles"
export default class MultipleFlexText extends React.Component {
render() {
return (
<View style={styles.view}>
<View style={styles.view1}>
<View style={styles.view3}>
<Text style={styles.text}>
{"Some long text (currently LS lays out incorrectly)"}
</Text>
</View>
</View>
<View style={styles.view2}>
<View style={styles.view4}>
<Text style={styles.text1}>
{"Short"}
</Text>
</View>
</View>
</View>
);
}
};
let styles = StyleSheet.create({
view: {
alignItems: "flex-start",
alignSelf: "stretch",
flex: 0,
flexDirection: "row",
justifyContent: "flex-start"
},
view1: {
alignItems: "flex-start",
backgroundColor: colors.red50,
flex: 1,
flexDirection: "column",
justifyContent: "flex-start",
height: 100
},
view2: {
alignItems: "flex-start",
backgroundColor: colors.blue50,
flex: 1,
flexDirection: "column",
justifyContent: "flex-start",
height: 100
},
view3: {
alignItems: "flex-start",
alignSelf: "stretch",
flex: 1,
flexDirection: "column",
justifyContent: "flex-start"
},
text: {
...TextStyles.get("body1"),
alignItems: "flex-start",
alignSelf: "stretch",
flex: 0,
flexDirection: "column",
justifyContent: "flex-start"
},
view4: {
alignItems: "flex-start",
alignSelf: "stretch",
flex: 1,
flexDirection: "column",
justifyContent: "flex-start"
},
text1: {
...TextStyles.get("body1"),
alignItems: "flex-start",
alignSelf: "stretch",
flex: 0,
flexDirection: "column",
justifyContent: "flex-start"
}
}) | 22.431818 | 68 | 0.579534 |
1e4b1d96ab7a36c4be6466145abbd2b7f65b8d3b | 581 | js | JavaScript | day7/1-wheather-app/src/components/Header/index.js | meseven/kodluyoruz-react-bootcamp | 0e26722a3d4868941a9eb556d033a01339ea31d7 | [
"MIT"
] | 18 | 2020-12-19T10:41:24.000Z | 2020-12-20T13:37:10.000Z | day7/1-wheather-app/src/components/Header/index.js | tubake/sources | 98d4e077e06f16eb913865081df6a021eea9ca70 | [
"MIT"
] | null | null | null | day7/1-wheather-app/src/components/Header/index.js | tubake/sources | 98d4e077e06f16eb913865081df6a021eea9ca70 | [
"MIT"
] | 17 | 2020-12-21T11:10:53.000Z | 2021-02-01T08:02:17.000Z | import { useContext } from "react";
import { cities } from "../../constants";
import WeatherContext from "../../contexts/WeatherContext";
function Header() {
const { selected, setSelected } = useContext(WeatherContext);
const handleOnChange = (e) => {
setSelected(e.target.value);
};
return (
<div>
<select
style={{ padding: 10 }}
onChange={handleOnChange}
defaultValue={selected}
>
{cities.map((city) => (
<option key={city.id} value={city.name}>
{city.name}
</option>
))}
</select>
</div>
);
}
export default Header;
| 18.15625 | 62 | 0.611015 |
1e4b9f8a1fe3240295f9fd64a01c704630caaebd | 68 | js | JavaScript | SQL_DateTime.js | mycloudrevolution/VMware-vRO-Snippets | 037966b9a0ec893bdc5e8cde8b16e62d7fdb1acd | [
"MIT"
] | 1 | 2019-05-09T06:40:02.000Z | 2019-05-09T06:40:02.000Z | SQL_DateTime.js | mycloudrevolution/VMware-vRO-Snippets | 037966b9a0ec893bdc5e8cde8b16e62d7fdb1acd | [
"MIT"
] | null | null | null | SQL_DateTime.js | mycloudrevolution/VMware-vRO-Snippets | 037966b9a0ec893bdc5e8cde8b16e62d7fdb1acd | [
"MIT"
] | null | null | null | var date = new Date().toISOString().slice(0, 19).replace('T', ' ');
| 34 | 67 | 0.602941 |
1e4c5524780bd7d82c14d413be458583de0a6ea6 | 26,955 | js | JavaScript | src/views/TrainingsEdit/TrainingsEdit.js | johnstewart0820/react_front_pfron | 0d283d7dea2e126d5fa2c27413245e86c09b38e1 | [
"MIT"
] | null | null | null | src/views/TrainingsEdit/TrainingsEdit.js | johnstewart0820/react_front_pfron | 0d283d7dea2e126d5fa2c27413245e86c09b38e1 | [
"MIT"
] | null | null | null | src/views/TrainingsEdit/TrainingsEdit.js | johnstewart0820/react_front_pfron | 0d283d7dea2e126d5fa2c27413245e86c09b38e1 | [
"MIT"
] | null | null | null | import React, { useState, useEffect } from 'react';
import useStyles from './style';
import { Alert } from 'components';
import {
Button, Grid, Card, TextField, CircularProgress, IconButton, TextareaAutosize, Typography, Chip
} from '@material-ui/core';
import CloseIcon from '@material-ui/icons/Close';
import { Autocomplete } from '@material-ui/lab';
import { Breadcrumb, SingleSelect, MultiSelect } from 'components';
import training_api from '../../apis/training';
import clsx from 'clsx';
import MaskedInput from 'react-text-mask';
import {
KeyboardDatePicker, MuiPickersUtilsProvider,
} from '@material-ui/pickers';
import DateFnsUtils from '@date-io/date-fns';
import { pl } from 'date-fns/locale'
import DeleteOutlineOutlinedIcon from '@material-ui/icons/DeleteOutlineOutlined';
import AddIcon from '@material-ui/icons/Add';
import EXCEL from 'js-export-xlsx';
import { DeleteModal } from '../Trainings/components';
import DeleteIcon from '@material-ui/icons/Delete';
import storage from 'utils/storage';
const TrainingsEdit = props => {
const { history } = props;
const id = props.match.params.id;
const classes = useStyles();
const breadcrumbs = [{ active: true, label: 'Usługi', href: '/service_list' }, { active: true, label: 'Szkolenia', href: '/trainings' }, { active: false, label: 'Edytuj szkolenie' }];
const [training, setTraining] = useState({ name: '', number: '', rehabitation_center: 0, service: 0, participant: [{}], comment: '', training_status: 2 });
const [training_class, setTrainingClass] = useState([{ name: '', date: null, start_hour: '', end_hour: '', break_amount: '', total_hour: '', ork_team: [] }]);
const [trainingStatusList, setTrainingStatusList] = useState([{ id: 1, name: 'TAK' }, { id: 2, name: 'NIE' }]);
const [rehabitationCenterList, setRehabitationCenterList] = useState([]);
const [orkTeamList, setOrkTeamList] = useState([]);
const [serviceList, setServiceList] = useState([]);
const [participantList, setParticipantList] = useState([]);
const [hasAlert, setHasAlert] = useState(false);
const [isSuccess, setIsSuccess] = useState(false);
const [message, setMessage] = useState('');
const [progressStatus, setProgressStatus] = useState(false);
const [error, setError] = useState({ participant: [true] });
const [error_class, setErrorClass] = useState([{}]);
const [openModal, setOpenModal] = useState(false);
useEffect(() => {
training_api.getInfo()
.then(response => {
if (response.code === 401) {
history.push('/login');
} else {
setParticipantList(response.data.participant);
setRehabitationCenterList(response.data.rehabitation_center);
setServiceList(response.data.service_list);
}
})
}, []);
useEffect(() => {
training_api.get(id)
.then(response => {
if (response.code === 401) {
history.push('/login');
} else {
let arr_participant = response.data.training.participant.split(',');
let list_participant = [];
let _error = { participant: [] };
arr_participant.map((item, index) => {
for (let i = 0; i < participantList.length; i++) {
if (parseInt(item) === parseInt(participantList[i].id))
list_participant.push(participantList[i]);
}
_error.participant.push({});
})
setError(_error);
response.data.training.participant = list_participant;
response.data.training.comment = '';
setTraining(response.data.training);
let _error_class = [];
for (let j = 0; j < response.data.training_class.length; j++) {
let list = response.data.training_class[j].ork_team ? response.data.training_class[j].ork_team.split(',') : [];
let ork_team_list = [];
response.data.ork_team.map((item, index) => {
for (let i = 0; i < list.length; i++) {
if (parseInt(list[i]) === parseInt(item.id)) {
ork_team_list.push(item);
}
}
})
response.data.training_class[j].ork_team = ork_team_list;
_error_class.push({});
}
setErrorClass(_error_class);
setTrainingClass(response.data.training_class);
}
})
}, [serviceList]);
const getRemainParticipantNumber = () => {
let _arr = [];
participantList.map((item, index) => {
let count = 0;
for (let i = 0; i < training.participant.length; i++) {
if (parseInt(item.id) === parseInt(training.participant[i].id)) {
count++;
}
}
if (count === 0) {
_arr.push(item);
}
})
return _arr;
}
const handleError = () => {
let _error = { participant: [] }
_error.name = (training.name.length === 0);
_error.number = (training.number.length === 0);
_error.rehabitation_center = (parseInt(training.rehabitation_center) === 0);
_error.service = (parseInt(training.service) === 0);
for (let i = 0; i < training.participant.length; i++) {
_error.participant.push(true);
_error.participant[i] = !(training.participant[i].id > 0);
}
_error.comment = (training.comment.length === 0);
_error.training_status = (parseInt(training.training_status) === 0);
setError(_error);
let _error_class = []
for (let i = 0; i < training_class.length; i++) {
_error_class.push({});
_error_class[i].name = (training_class[i].name.length === 0);
_error_class[i].date = (!training_class[i].date || training_class[i].date.length === 0);
_error_class[i].start_hour = (training_class[i].start_hour.length === 0);
_error_class[i].end_hour = (training_class[i].end_hour.length === 0);
_error_class[i].break_amount = (training_class[i].break_amount.length === 0);
_error_class[i].total_hour = (training_class[i].total_hour.length === 0);
_error_class[i].ork_team = (training_class[i].ork_team.length === 0);
}
setErrorClass(_error_class);
};
const handleDelete = () => {
setProgressStatus(true);
training_api
.delete(id)
.then(response => {
if (response.code === 401) {
history.push('/login');
} else {
setHasAlert(true);
setMessage(response.message);
setIsSuccess(response.code === 200);
if (response.code === 200) {
setTimeout(function () { history.push('/trainings'); }, 1000);
}
setProgressStatus(false);
}
})
}
const handleCloseModal = () => {
setOpenModal(false);
}
const handleChangeName = (value) => {
let _training = JSON.parse(JSON.stringify(training));
_training.name = value;
setTraining(_training);
let _error = JSON.parse(JSON.stringify(error));
_error.name = (value.length === 0);
setError(_error);
}
const handleChangeNumber = (value) => {
let _training = JSON.parse(JSON.stringify(training));
_training.number = value;
setTraining(_training);
let _error = JSON.parse(JSON.stringify(error));
_error.number = (value.length === 0);
setError(_error);
}
const handleChangeRehabitationCenter = (value) => {
let _training = JSON.parse(JSON.stringify(training));
_training.rehabitation_center = value;
setTraining(_training);
let _error = JSON.parse(JSON.stringify(error));
_error.rehabitation_center = (parseInt(value) === 0);
setError(_error);
}
useEffect(() => {
training_api.getOrkTeam(training.rehabitation_center)
.then(response => {
if (response.code === 401) {
} else {
setOrkTeamList(response.data.ork_team);
}
})
}, [training.rehabitation_center]);
const handleChangeService = (value) => {
let _training = JSON.parse(JSON.stringify(training));
_training.service = value;
setTraining(_training);
let _error = JSON.parse(JSON.stringify(error));
_error.service = (parseInt(value) === 0);
setError(_error);
}
const handleChangeParticipant = (value, index) => {
let _training = JSON.parse(JSON.stringify(training));
_training.participant[index] = value;
setTraining(_training);
let _error = JSON.parse(JSON.stringify(error));
_error.participant[index] = !training.participant[index].id > 0;
setError(_error);
}
const handleDeleteParticipant = (index) => {
let _training = JSON.parse(JSON.stringify(training));
let _error = JSON.parse(JSON.stringify(error));
_error.participant.splice(index, 1);
_training.participant.splice(index, 1);
setTraining(_training);
setError(_error);
}
const handleCreateParticipant = () => {
let _training = JSON.parse(JSON.stringify(training));
let _error = JSON.parse(JSON.stringify(error));
_training.participant.push({});
_error.participant.push(true);
setTraining(_training);
setError(_error);
}
const handleChangeComment = (value) => {
let _training = JSON.parse(JSON.stringify(training));
_training.comment = value;
setTraining(_training);
let _error = JSON.parse(JSON.stringify(error));
_error.comment = (value.length === 0);
setError(_error);
}
const handleChangeTrainingStatus = (value) => {
let _training = JSON.parse(JSON.stringify(training));
_training.training_status = value;
setTraining(_training);
let _error = JSON.parse(JSON.stringify(error));
_error.training_status = (parseInt(value) === 0);
setError(_error);
}
const handleChangeClassName = (value, index) => {
let _training_class = JSON.parse(JSON.stringify(training_class));
_training_class[index].name = value;
setTrainingClass(_training_class);
let _error_class = JSON.parse(JSON.stringify(error_class));
_error_class[index].name = (parseInt(value) === 0);
setErrorClass(_error_class);
}
const handleChangeClassDate = (value, index) => {
let _training_class = JSON.parse(JSON.stringify(training_class));
_training_class[index].date = value;
setTrainingClass(_training_class);
let _error_class = JSON.parse(JSON.stringify(error_class));
_error_class[index].date = (parseInt(value) === 0);
setErrorClass(_error_class);
}
const handleDeleteClass = (index) => {
let _training_class = JSON.parse(JSON.stringify(training_class));
let _error_class = JSON.parse(JSON.stringify(error_class));
_error_class.splice(index, 1);
_training_class.splice(index, 1);
setTrainingClass(_training_class);
setErrorClass(_error_class);
}
const handleCreateClass = () => {
let _training_class = JSON.parse(JSON.stringify(training_class));
let _error_class = JSON.parse(JSON.stringify(error_class));
_training_class.push({ name: '', date: null, start_hour: '', end_hour: '', break_amount: '', total_hour: '', ork_team: '' });
_error_class.push({ name: true, date: true, start_hour: true, end_hour: true, break_amount: true, total_hour: true, ork_team: true });
setTrainingClass(_training_class);
setErrorClass(_error_class);
}
const handleChangeStartHour = (value, index) => {
let _training_class = JSON.parse(JSON.stringify(training_class));
_training_class[index].start_hour = value;
setTrainingClass(_training_class);
let _error_class = JSON.parse(JSON.stringify(error_class));
_error_class[index].start_hour = (parseInt(value) === 0);
setErrorClass(_error_class);
}
const handleChangeEndHour = (value, index) => {
let _training_class = JSON.parse(JSON.stringify(training_class));
_training_class[index].end_hour = value;
setTrainingClass(_training_class);
let _error_class = JSON.parse(JSON.stringify(error_class));
_error_class[index].end_hour = (parseInt(value) === 0);
setErrorClass(_error_class);
}
const handleChangeClassBreakAmount = (value, index) => {
let _training_class = JSON.parse(JSON.stringify(training_class));
_training_class[index].break_amount = value;
setTrainingClass(_training_class);
let _error_class = JSON.parse(JSON.stringify(error_class));
_error_class[index].break_amount = (parseInt(value) === 0);
setErrorClass(_error_class);
}
const handleChangeClassTotalHour = (value, index) => {
let _training_class = JSON.parse(JSON.stringify(training_class));
_training_class[index].total_hour = value;
setTrainingClass(_training_class);
let _error_class = JSON.parse(JSON.stringify(error_class));
_error_class[index].total_hour = (parseInt(value) === 0);
setErrorClass(_error_class);
}
const handleChangeOrkTeam = (value, index) => {
let _training_class = JSON.parse(JSON.stringify(training_class));
_training_class[index].ork_team = value;
setTrainingClass(_training_class);
let _error_class = JSON.parse(JSON.stringify(error_class));
_error_class[index].ork_team = (parseInt(value) === 0);
setErrorClass(_error_class);
}
const handleExportClass = () => {
let export_data = [];
for (let i = 0; i < training_class.length; i++) {
let item = [];
item.push(training_class[i].name);
item.push(training_class[i].date);
item.push(training_class[i].start_hour);
item.push(training_class[i].end_hour);
item.push(training_class[i].break_amount);
item.push(training_class[i].total_hour);
export_data.push(item);
}
EXCEL.outPut({
header: ['Nazwa zajęć', 'Data zajęć', 'Godzina rozpoczęcia', 'Godzina zakończenia', 'Czas przerw(w minutach)', 'Czas trwania(w godzinach)'],
data: export_data,
name: 'download'
})
}
const checkError = () => {
let result = (training.name.length === 0) ||
(training.number.length === 0) ||
(parseInt(training.rehabitation_center) === 0) ||
(parseInt(training.service) === 0) ||
(training.comment.length === 0) ||
(parseInt(training.training_status) === 0);
for (let i = 0; i < training.participant.length; i++) {
result = result || !training.participant[i].id > 0;
}
for (let i = 0; i < training_class.length; i++) {
result = result || (training_class[i].name.length === 0)
|| (!training_class[i].date || training_class[i].date.length === 0)
|| (training_class[i].start_hour.length === 0)
|| (training_class[i].end_hour.length === 0)
|| (training_class[i].break_amount.length === 0)
|| (training_class[i].total_hour.length === 0)
|| (training_class[i].ork_team.length === 0);
}
return result;
}
const handleBack = () => {
history.push('/trainings');
}
const handleSave = () => {
if (checkError()) {
setHasAlert(true);
setMessage('Proszę wypełnić wszystkie wymagane pola.');
setIsSuccess(false);
handleError();
} else {
setProgressStatus(true);
let participant_arr = [];
training.participant.map((item, index) => {
participant_arr.push(item.id);
})
let participant_str = participant_arr.join(',');
for (let i = 0; i < training_class.length; i++) {
let ork_team_arr = []
for (let j = 0; j < training_class[i].ork_team.length; j++) {
ork_team_arr.push(training_class[i].ork_team[j].id);
}
training_class[i].ork_team_str = ork_team_arr.join(',');
}
training_api.update(training, participant_str, training_class, id)
.then(response => {
if (response.code === 401) {
history.push('/login');
} else {
setHasAlert(true);
setMessage(response.message);
setIsSuccess(response.code === 200);
if (response.code === 200) {
setTimeout(function () { history.push('/trainings'); }, 1000);
}
setProgressStatus(false);
}
})
}
}
const handleExportParticipants = () => {
let export_data = [];
for (let i = 0; i < training.participant.length; i++) {
let item = [];
item.push(training.participant[i].id);
item.push(training.participant[i].name);
item.push(training.participant[i].participant_number);
export_data.push(item);
}
EXCEL.outPut({
header: ['ID', 'Nazwisko', 'Numer'],
data: export_data,
name: 'download'
})
}
return (
<MuiPickersUtilsProvider utils={DateFnsUtils} locale={pl}>
<div className={classes.public}>
<div className={classes.controlBlock}>
<Breadcrumb list={breadcrumbs} />
<Button variant="outlined" color="secondary" id="main" className={classes.btnBack} onClick={handleBack}> Wróć do listy szkoleń
</Button>
</div>
<Alert
hasAlert={hasAlert}
setHasAlert={setHasAlert}
isSuccess={isSuccess}
message={message}
/>
<Grid container spacing={3} className={classes.formBlock}>
<Grid item md={9} xs={12}>
<Card className={classes.form}>
<Grid container spacing={3}>
<Grid item md={3} xs={12}>
<Typography variant="h2" className={classes.form_title}>
Dane podstawowe
</Typography>
</Grid>
<Grid item md={9} xs={12}>
<div className={classes.top_label}><label htmlFor="name">Nazwa</label></div>
<input className={clsx({ [classes.input_box]: true, [classes.error]: error.name })} id="name" type="name" value={training.name} name="name" onChange={(e) => handleChangeName(e.target.value)} />
<div className={classes.input_box_label}><label htmlFor="number">Numer szkolenia</label></div>
<input className={clsx({ [classes.input_box]: true, [classes.error]: error.number })} id="number" type="name" value={training.number} name="name" onChange={(e) => handleChangeNumber(e.target.value)} />
<div className={classes.input_box_label}><label htmlFor="rehabitation_center">ORK</label></div>
<SingleSelect value={training.rehabitation_center} id="rehabitation_center" handleChange={(value) => handleChangeRehabitationCenter(value)} list={rehabitationCenterList} error={error.rehabitation_center} />
<div className={classes.input_box_label}><label htmlFor="service">Usługa, do której jest przypisane szkolenie</label></div>
<SingleSelect value={training.service} handleChange={(value) => handleChangeService(value)} list={serviceList} error={error.service} id="service" />
</Grid>
</Grid>
<div className={classes.divide} />
<Grid container spacing={3}>
<Grid item md={3} xs={0} />
<Grid item md={9} xs={12}>
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '10px' }}>
<div className={classes.top_label}>
Uczestnicy
</div>
<Button variant="outlined" color="secondary" className={classes.btnBack} onClick={handleExportParticipants}>
Eksportuj listę do XLS
</Button>
</div>
{
training.participant.map((item, index) => (
<Grid container spacing={2}>
<Grid item xs={1}></Grid>
<Grid item xs={1} className={classes.input_box_label}>{index + 1}.</Grid>
<Grid item xs={6}>
<Autocomplete
className={classes.name_select_box}
onChange={(event, value) => handleChangeParticipant(value ? value : [], index)}
options={getRemainParticipantNumber()}
value={item.name ? item : ''}
getOptionLabel={(option) => participantList && option && (`${option.name} (${option.participant_number}) `)}
renderInput={(params) => <TextField {...params} variant="outlined" InputLabelProps={{ shrink: false }} />}
/>
</Grid>
{
index == 0 && training.participant.length === 1 ?
<Grid item xs={1} />
:
<Grid item xs={1}>
<IconButton variant="outlined" aria-label="Usuń uczestnika" component="span" className={classes.iconButton} onClick={() => handleDeleteParticipant(index)}>
<DeleteOutlineOutlinedIcon className={classes.icon} />
</IconButton>
</Grid>
}
{
index == training.participant.length - 1 ?
<Grid item xs={3}>
<Button variant="contained" color="secondary" className={classes.btnAdd} onClick={handleCreateParticipant}>
<AddIcon style={{ marginRight: '20px' }} />
Dodaj
</Button>
</Grid>
:
<></>
}
</Grid>
))
}
</Grid>
</Grid>
<div className={classes.divide} />
<Grid container spacing={3}>
<Grid item md={3} xs={12}>
<Typography variant="h2" className={classes.form_title}>
Harmonogram
</Typography>
</Grid>
<Grid item md={6} xs={12}>
{
training_class.map((item, index) => (
<Grid container spacing={2}>
<Grid item xs={index == 0 && training_class.length === 1 ? 12 : 11}>
<div className={classes.input_box_label}><label htmlFor="item_name">Nazwa zajęć</label></div>
<input className={classes.input_box} type="name" value={item.name} id="item_name" name="name" onChange={(e) => handleChangeClassName(e.target.value, index)} />
</Grid>
{
index == 0 && training_class.length === 1 ?
<></>
:
<Grid item xs={1} style={{ marginTop: '35px' }}>
<IconButton variant="outlined" aria-label="Usuń zajęcia" component="span" className={classes.iconButton} onClick={() => handleDeleteClass(index)}>
<DeleteOutlineOutlinedIcon className={classes.icon} />
</IconButton>
</Grid>
}
<Grid item xs={4}>
<div className={classes.input_box_label}><label htmlFor="class_date">Data zajęć</label></div>
<KeyboardDatePicker
disableToolbar
variant="inline"
format="dd.MM.yyyy"
aria-label="Data zajęć - Format wprowadzania daty DD.MM.RRRR"
margin="normal"
id="class_date"
value={item.date}
onChange={(value) => handleChangeClassDate(value, index)}
KeyboardButtonProps={{
'aria-label': 'Zmień datę',
}}
className={classes.date_picker}
/>
</Grid>
<Grid item xs={4}>
<div className={classes.input_box_label}><label htmlFor="start_hoour">Godzina rozpoczęcia</label></div>
<MaskedInput
className={classes.input_box}
mask={[/\d/, /\d/, ':', /\d/, /\d/]}
value={training_class[index].start_hour}
onChange={(e) => handleChangeStartHour(e.target.value, index)}
id="start_hoour"
/>
</Grid>
<Grid item xs={4}>
<div className={classes.input_box_label}><label htmlFor="end_hour">Godzina zakończenia</label></div>
<MaskedInput
className={classes.input_box}
mask={[/\d/, /\d/, ':', /\d/, /\d/]}
value={training_class[index].end_hour}
onChange={(e) => handleChangeEndHour(e.target.value, index)}
id="end_hour"
/>
</Grid>
<Grid item xs={6}>
<div className={classes.input_box_label}><label htmlFor="break_amount">Czas przerw(w minutach)</label></div>
<input className={classes.input_box} type="name" value={item.break_amount} name="name" id="break_amount" onChange={(e) => handleChangeClassBreakAmount(e.target.value, index)} />
</Grid>
<Grid item xs={6}>
<div className={classes.input_box_label}><label htmlFor="total_hour">Czas trwania(w godzinach)</label></div>
<input className={classes.input_box} type="name" id="total_hour" value={item.total_hour} name="name" onChange={(e) => handleChangeClassTotalHour(e.target.value, index)} />
</Grid>
<Grid item xs={12}>
<div className={classes.input_box_label}><label htmlFor="ork_team">Prowadzący</label></div>
<Autocomplete
multiple
id="ork_team"
className={classes.name_select_box}
onChange={(event, value) => handleChangeOrkTeam(value ? value : [], index)}
options={orkTeamList}
value={item.ork_team ? item.ork_team : []}
getOptionLabel={(option) => orkTeamList && option && (option.name)}
renderTags={(value, getTagProps) =>
value.map((option, index) => (
<Chip variant="outlined" label={option.name} {...getTagProps({ index })} deleteIcon={<CloseIcon aria-label="Wyczyść wartość"/>}/>
))
}
renderInput={(params) => <TextField {...params} variant="outlined" InputLabelProps={{ shrink: false }} />}
/>
</Grid>
{
index !== training_class.length - 1 ?
<div className={classes.divide_small} />
:
<></>
}
</Grid>
))
}
</Grid>
<Grid item md={3} xs={12}>
<div style={{ display: 'flex', justifyContent: 'flex-end', marginBottom: '10px' }}>
<Button variant="outlined" color="secondary" className={classes.btnExport} onClick={handleExportClass}>
Eksportuj harmonogram do XLS
</Button>
</div>
</Grid>
</Grid>
</Card>
<div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '10px' }}>
<Button variant="outlined" color="secondary" className={classes.btnBack} onClick={handleCreateClass}>
Dodaj kolejne zajęcia
</Button>
</div>
</Grid>
<Grid item md={3} xs={12}>
<Card className={classes.form}>
<Grid container spacing={3}>
<Grid item xs={12}>
{
storage.getStorage('role').includes(1) ?
<>
<div className={classes.top_label}>Zaakceptowane</div>
<SingleSelect value={training.training_status} handleChange={(value) => handleChangeTrainingStatus(value)} list={trainingStatusList} error={error.training_status} />
</>
:
<></>
}
<div className={classes.input_box_label} htmlFor="name">Komentarz dotyczący edycji (max 100 znaków)</div>
<TextareaAutosize className={clsx({ [classes.textArea]: true, [classes.error]: error.comment })} value={training.comment} rowsMin={10} onChange={(e) => handleChangeComment(e.target.value)} placeholder="Utworzenie profilu uczestnika" />
<Grid container spacing={2}>
<Grid item xs={6}>
<Button aria-label="Usuń" variant="outlined" color="secondary" className={classes.btnOption} onClick={handleDelete}>
<DeleteIcon />
</Button>
</Grid>
<Grid item xs={6}>
<Button variant="outlined" color="secondary" className={classes.btnSave} onClick={handleSave}>
Zapisz
</Button>
</Grid>
</Grid>
</Grid>
</Grid>
</Card>
</Grid>
</Grid>
</div>
{
progressStatus ?
<>
<div className={classes.progressContainer}>
<CircularProgress className={classes.progress} />
</div>
</>
:
<></>
}
<DeleteModal
openModal={openModal}
handleClose={handleCloseModal}
handleDelete={handleDelete}
selectedIndex={id}
/>
</MuiPickersUtilsProvider>
);
};
export default TrainingsEdit;
| 38.617479 | 244 | 0.627527 |
1e4c6ca3d59f327ff1f56691247a5a0a4605b2cd | 323 | js | JavaScript | node_modules/@iconify/icons-mdi/src/settings-bluetooth.js | FAD95/NEXT.JS-Course | 5177872c4045945f3e952d8b59c99dfa21fff5ef | [
"MIT"
] | 1 | 2021-05-15T00:26:49.000Z | 2021-05-15T00:26:49.000Z | node_modules/@iconify/icons-mdi/src/settings-bluetooth.js | rydockman/YouPick | ad902eafb876ac425baeaef4ec066d335025c5bb | [
"Apache-2.0"
] | 1 | 2021-12-09T01:30:41.000Z | 2021-12-09T01:30:41.000Z | node_modules/@iconify/icons-mdi/src/settings-bluetooth.js | rydockman/YouPick | ad902eafb876ac425baeaef4ec066d335025c5bb | [
"Apache-2.0"
] | null | null | null | let data = {
"body": "<path d=\"M14.88 14.29L13 16.17v-3.76l1.88 1.88M13 3.83l1.88 1.88L13 7.59m4.71-1.88L12 0h-1v7.59L6.41 3L5 4.41L10.59 10L5 15.59L6.41 17L11 12.41V20h1l5.71-5.71l-4.3-4.29l4.3-4.29M15 24h2v-2h-2m-8 2h2v-2H7m4 2h2v-2h-2v2z\" fill=\"currentColor\"/>",
"width": 24,
"height": 24
};
export default data;
| 46.142857 | 257 | 0.678019 |
1e4cb20b5368c585ec858f850881d5fd3ba32249 | 1,847 | js | JavaScript | sapper-example/webpack.config.js | moovweb/xdn-examples | dca787891ad60cf60e8451e770c5cbf0e4caa4d2 | [
"Apache-2.0"
] | 1 | 2020-07-27T04:29:37.000Z | 2020-07-27T04:29:37.000Z | sapper-example/webpack.config.js | moovweb/xdn-examples | dca787891ad60cf60e8451e770c5cbf0e4caa4d2 | [
"Apache-2.0"
] | 31 | 2020-05-14T17:22:19.000Z | 2022-02-19T06:29:34.000Z | ad-hoc-example/webpack.config.js | moovweb/xdn-examples | dca787891ad60cf60e8451e770c5cbf0e4caa4d2 | [
"Apache-2.0"
] | 2 | 2020-12-01T16:18:27.000Z | 2021-04-04T22:54:12.000Z | const webpack = require('webpack');
const WebpackModules = require('webpack-modules');
const path = require('path');
const config = require('sapper/config/webpack.js');
const pkg = require('./package.json');
const mode = process.env.NODE_ENV;
const dev = mode === 'development';
const alias = { svelte: path.resolve('node_modules', 'svelte') };
const extensions = ['.mjs', '.js', '.json', '.svelte', '.html'];
const mainFields = ['svelte', 'module', 'browser', 'main'];
module.exports = {
client: {
entry: config.client.entry(),
output: config.client.output(),
resolve: { alias, extensions, mainFields },
module: {
rules: [
{
test: /\.(svelte|html)$/,
use: {
loader: 'svelte-loader',
options: {
dev,
hydratable: true,
hotReload: false // pending https://github.com/sveltejs/svelte/issues/2377
}
}
}
]
},
mode,
plugins: [
// pending https://github.com/sveltejs/svelte/issues/2377
// dev && new webpack.HotModuleReplacementPlugin(),
new webpack.DefinePlugin({
'process.browser': true,
'process.env.NODE_ENV': JSON.stringify(mode)
}),
].filter(Boolean),
devtool: dev && 'inline-source-map'
},
server: {
entry: config.server.entry(),
output: config.server.output(),
target: 'node',
resolve: { alias, extensions, mainFields },
externals: ['encoding'],
module: {
rules: [
{
test: /\.(svelte|html)$/,
use: {
loader: 'svelte-loader',
options: {
css: false,
generate: 'ssr',
hydratable: true,
dev
}
}
}
]
},
mode,
plugins: [
new WebpackModules()
],
performance: {
hints: false // it doesn't matter if server.js is large
}
},
serviceworker: {
entry: config.serviceworker.entry(),
output: config.serviceworker.output(),
mode
}
};
| 22.253012 | 81 | 0.600433 |
1e4cb4face527bbbd20b32f26f549a4d0471c4ad | 187 | js | JavaScript | src/components/Footer/Footer.js | melissarburnham/Clicky-Game-Gosling-Style | 9fe20e95ad0d97714d1b772ec306d5cb47ac85a9 | [
"MIT"
] | null | null | null | src/components/Footer/Footer.js | melissarburnham/Clicky-Game-Gosling-Style | 9fe20e95ad0d97714d1b772ec306d5cb47ac85a9 | [
"MIT"
] | null | null | null | src/components/Footer/Footer.js | melissarburnham/Clicky-Game-Gosling-Style | 9fe20e95ad0d97714d1b772ec306d5cb47ac85a9 | [
"MIT"
] | null | null | null | import React from "react";
import "./Footer.css";
const Footer = () => (
<header className = "footer">
<p>Created by Melissa R. Burnham @2018</p>
</header>
);
export default Footer; | 18.7 | 44 | 0.652406 |
1e4ccd2e671c86ca28b9e39f4b681cf600304b5d | 849 | js | JavaScript | src/index.js | jlieb10/datasheet-server | 965482633bf2637145e803e4ff55157cc4239d95 | [
"MIT"
] | null | null | null | src/index.js | jlieb10/datasheet-server | 965482633bf2637145e803e4ff55157cc4239d95 | [
"MIT"
] | null | null | null | src/index.js | jlieb10/datasheet-server | 965482633bf2637145e803e4ff55157cc4239d95 | [
"MIT"
] | null | null | null | import http from 'http'
import express from 'express'
import initialize from './initialize'
import middleware from './middleware'
import api from './api'
// import config from './sheets_config'
import dotenv from 'dotenv'
dotenv.config()
let app = express()
app.server = http.createServer(app)
// enable cross origin requests explicitly in development
if (process.env.NODE_ENV === 'development') {
const cors = require('cors')
console.log('Enabling CORS in development...')
app.use(cors())
}
const config = process.env
initialize(controller => {
app.use(
middleware({
config,
controller
})
)
app.use(
'/api',
api({
config,
controller
})
)
app.server.listen(process.env.PORT || 4040, () => {
console.log(`Started on port ${app.server.address().port}`)
})
})
export default app
| 19.295455 | 63 | 0.658422 |
1e4cd922532821e521a63a39db403864a4477862 | 1,141 | js | JavaScript | vendor/johnhearfield/flarum-ext-oauth-google/js/forum/dist/extension.js | baonguyenyam/fs-forum | 9627baeb9a5112db9ef230c0425cb0c5efe834b2 | [
"MIT"
] | null | null | null | vendor/johnhearfield/flarum-ext-oauth-google/js/forum/dist/extension.js | baonguyenyam/fs-forum | 9627baeb9a5112db9ef230c0425cb0c5efe834b2 | [
"MIT"
] | null | null | null | vendor/johnhearfield/flarum-ext-oauth-google/js/forum/dist/extension.js | baonguyenyam/fs-forum | 9627baeb9a5112db9ef230c0425cb0c5efe834b2 | [
"MIT"
] | null | null | null | 'use strict';
System.register('johnhearfield/auth-google/main', ['flarum/extend', 'flarum/app', 'flarum/components/LogInButtons', 'flarum/components/LogInButton'], function (_export, _context) {
"use strict";
var extend, app, LogInButtons, LogInButton;
return {
setters: [function (_flarumExtend) {
extend = _flarumExtend.extend;
}, function (_flarumApp) {
app = _flarumApp.default;
}, function (_flarumComponentsLogInButtons) {
LogInButtons = _flarumComponentsLogInButtons.default;
}, function (_flarumComponentsLogInButton) {
LogInButton = _flarumComponentsLogInButton.default;
}],
execute: function () {
app.initializers.add('johnhearfield/auth-google', function () {
extend(LogInButtons.prototype, 'items', function (items) {
items.add('google', m(
LogInButton,
{
className: 'Button LogInButton--google',
icon: 'google',
path: '/auth/google' },
app.translator.trans('johnhearfield-oauth-google.forum.log_in.with_google_button')
));
});
});
}
};
}); | 34.575758 | 180 | 0.630149 |
1e4d2817be1a5903cc2b44efc13e7eb5ec88a729 | 2,128 | js | JavaScript | WyFramework/Docs/html/namespace_game_framework_1_1_game_structure_1_1_game_1_1_editor_1_1_game_conditions_1_1_common.js | nwy140/TheWYGameDevelopmentFramework | 5ab47b9dc2554a3d73e07d19a27a97969c9b6479 | [
"Apache-2.0"
] | null | null | null | WyFramework/Docs/html/namespace_game_framework_1_1_game_structure_1_1_game_1_1_editor_1_1_game_conditions_1_1_common.js | nwy140/TheWYGameDevelopmentFramework | 5ab47b9dc2554a3d73e07d19a27a97969c9b6479 | [
"Apache-2.0"
] | 1 | 2019-06-24T03:04:20.000Z | 2019-06-24T03:04:20.000Z | WyFramework/Docs/html/namespace_game_framework_1_1_game_structure_1_1_game_1_1_editor_1_1_game_conditions_1_1_common.js | nwy140/TheWYGameDevelopmentFramework | 5ab47b9dc2554a3d73e07d19a27a97969c9b6479 | [
"Apache-2.0"
] | null | null | null | var namespace_game_framework_1_1_game_structure_1_1_game_1_1_editor_1_1_game_conditions_1_1_common =
[
[ "Abstract", "namespace_game_framework_1_1_game_structure_1_1_game_1_1_editor_1_1_game_conditions_1_1_common_1_1_abstract.html", "namespace_game_framework_1_1_game_structure_1_1_game_1_1_editor_1_1_game_conditions_1_1_common_1_1_abstract" ],
[ "GameConditionBoolEditor", "class_game_framework_1_1_game_structure_1_1_game_1_1_editor_1_1_game_conditions_1_1_common_1_1_game_condition_bool_editor.html", "class_game_framework_1_1_game_structure_1_1_game_1_1_editor_1_1_game_conditions_1_1_common_1_1_game_condition_bool_editor" ],
[ "GameConditionEditor", "class_game_framework_1_1_game_structure_1_1_game_1_1_editor_1_1_game_conditions_1_1_common_1_1_game_condition_editor.html", "class_game_framework_1_1_game_structure_1_1_game_1_1_editor_1_1_game_conditions_1_1_common_1_1_game_condition_editor" ],
[ "GameConditionFloatEditor", "class_game_framework_1_1_game_structure_1_1_game_1_1_editor_1_1_game_conditions_1_1_common_1_1_game_condition_float_editor.html", null ],
[ "GameConditionGameItemContextSelectedTypeBoolEditor", "class_game_framework_1_1_game_structure_1_1_game_1_1_editor_1_1_game_conditions_1_1_common_1_1_g01085ecf0e1650899336b177995575e1.html", "class_game_framework_1_1_game_structure_1_1_game_1_1_editor_1_1_game_conditions_1_1_common_1_1_g01085ecf0e1650899336b177995575e1" ],
[ "GameConditionGameItemContextSelectedTypeCounterEditor", "class_game_framework_1_1_game_structure_1_1_game_1_1_editor_1_1_game_conditions_1_1_common_1_1_g634de7ff523fda06b263be8b0c3caad0.html", "class_game_framework_1_1_game_structure_1_1_game_1_1_editor_1_1_game_conditions_1_1_common_1_1_g634de7ff523fda06b263be8b0c3caad0" ],
[ "GameConditionGameItemContextSelectedTypeIntEditor", "class_game_framework_1_1_game_structure_1_1_game_1_1_editor_1_1_game_conditions_1_1_common_1_1_g89534ac3bc7af5c42140dc6c2940f49f.html", null ],
[ "GameConditionIntEditor", "class_game_framework_1_1_game_structure_1_1_game_1_1_editor_1_1_game_conditions_1_1_common_1_1_game_condition_int_editor.html", null ]
]; | 193.454545 | 333 | 0.920583 |
1e4d4f04bb16b0c1badcda472c32c085f14c2d26 | 1,592 | js | JavaScript | lib/server/game/utils/sprint.js | chaos-adept/monkey-bar-game | 849a88f0db8f1dcf6c219930f1b151eeb58b8405 | [
"Apache-2.0"
] | 2 | 2016-11-04T13:22:48.000Z | 2017-02-23T07:41:12.000Z | lib/server/game/utils/sprint.js | chaos-adept/monkey-bar-game | 849a88f0db8f1dcf6c219930f1b151eeb58b8405 | [
"Apache-2.0"
] | 27 | 2016-08-12T05:32:27.000Z | 2017-07-25T10:20:30.000Z | lib/server/game/utils/sprint.js | chaos-adept/monkey-bar-game | 849a88f0db8f1dcf6c219930f1b151eeb58b8405 | [
"Apache-2.0"
] | null | null | null | /**
* Created by drykovanov on 27.03.2017.
*/
import moment from 'moment';
import _ from 'lodash';
export const calcStatistic = (attempts, limitMinutes) => {
const sortedAttempts = _.orderBy(attempts, 'time');
const playerInfos = new Map();
const collectAttempt = (attempt) => {
const playerId = attempt.playerId;
let playerInfo = playerInfos.get(playerId);
if (!playerInfo) {
playerInfo = { playerId, allAttempts: [attempt]};
playerInfos.set(playerId, playerInfo);
} else {
playerInfo.allAttempts.push(attempt);
}
const isInitSprintAttempt = !(playerInfo.initAttempt) && (attempt.value === 1);
const isSprintAttempt = playerInfo.initAttempt && (attempt.time.isSameOrAfter(playerInfo.startTime) &&
attempt.time.isSameOrBefore(playerInfo.finishTime));
if (isInitSprintAttempt) {
playerInfo.initAttempt = attempt;
playerInfo.attempts = [attempt];
playerInfo.startTime = attempt.time;
playerInfo.finishTime = attempt.time.clone();
playerInfo.finishTime.add(limitMinutes, 'm');
} else if (isSprintAttempt) {
playerInfo.attempts.push(attempt);
}
};
sortedAttempts.forEach(collectAttempt);
for (let playerInfo of playerInfos.values()) {
playerInfo.sum = _.sumBy(playerInfo.attempts, 'value')
}
const order = _.sortBy([...playerInfos.values()], 'sum').reverse();
return { players: playerInfos, order };
};
| 37.023256 | 111 | 0.613065 |
1e4dd3124d713140479132158af436ec6796f9e3 | 5,622 | js | JavaScript | ui/Post/Detail/Detail.native.js | odanang/app | a64baef2074a860372441a4de139e1356cbfed72 | [
"MIT"
] | null | null | null | ui/Post/Detail/Detail.native.js | odanang/app | a64baef2074a860372441a4de139e1356cbfed72 | [
"MIT"
] | null | null | null | ui/Post/Detail/Detail.native.js | odanang/app | a64baef2074a860372441a4de139e1356cbfed72 | [
"MIT"
] | null | null | null | import React, { useState, useContext } from "react";
import {
Box,
Stack,
HStack,
Image,
Text,
Button,
VStack,
Divider,
} from "native-base";
import PostDeleteText from "../Delete/Text";
import PostUpdateText from "../Update/Text";
import { UploadImageListCarousel } from "../../Upload/Image";
import InteractiveItemSimple from "../../Interactive/Item/Simple";
import PostDetail from "./Controller";
import { AuthContext } from "../../Provider/Native";
import { Link } from "@react-navigation/native";
import {
ScrollView,
Keyboard,
TouchableWithoutFeedback,
Text as RNText,
} from "react-native";
import Entypo from "react-native-vector-icons/Entypo";
import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
Entypo.loadFont();
function formatTimeCreate(createdAt) {
var dayjs = require("dayjs");
let stringTime = "";
const createdTime = dayjs(createdAt);
const now = dayjs();
if (now.format("DD-MM-YYYY") === createdTime.format("DD-MM-YYYY")) {
if (Number(now.get("hour")) - Number(createdTime.get("hour")) === 0)
stringTime =
Number(now.get("minute")) -
Number(createdTime.get("minute")) +
" phút trước";
else
stringTime =
Number(now.get("hour")) -
Number(createdTime.get("hour")) +
" giờ trước";
} else stringTime = createdTime.format("DD-MM-YYYY");
return stringTime;
}
function UI({ loading, error, post, refetch }) {
const [isModalOpen, setIsModalOpen] = useState(false);
const currentUser = useContext(AuthContext).user;
const stringCreatedAt = formatTimeCreate(post?.createdAt);
const toggleModal = () => {
setIsModalOpen((prev) => !prev);
console.log(isModalOpen);
};
if (loading) {
return <Text></Text>;
}
return (
<Stack direction="column" mx="auto" w="full">
<KeyboardAwareScrollView style={{ width: "100%" }} extraHeight={100}>
<ScrollView>
<TouchableWithoutFeedback onPress={Keyboard.dismiss}>
<>
<Box w="full">
<UploadImageListCarousel
urls={post?.images?.map(
(image) => "https://odanang.net" + image?.file?.publicUrl
)}
/>
</Box>
<VStack maxW="full" py="3">
<HStack
space="3"
display="flex"
flexDirection="row"
w="full"
px="3"
alignItems="center"
position="relative"
zIndex="1"
>
<Image
source={{
uri:
"https://odanang.net" +
(post?.createdBy?.avatar?.publicUrl ||
"/upload/img/no-image.png"),
}}
alt="Profile image"
size="8"
rounded="100"
/>
<Link
to={{
screen: "users",
params: { id: post?.createdBy?.id },
}}
>
<RNText
style={{
fontWeight: "500",
color: "#18181b",
fontFamily: "Lexend_500Medium",
}}
>
{post?.createdBy?.name}
</RNText>
</Link>
<Text color="gray.400" fontSize="12">
{stringCreatedAt}
</Text>
{isModalOpen && post?.createdBy?.id === currentUser?.id && (
<VStack
position="absolute"
right="3"
top="8"
borderColor="gray.100"
borderWidth="1"
bgColor="white"
rounded="10"
space="1"
p="2"
>
<PostUpdateText id={post?.id} />
<Divider w="full" bgColor="gray.100" />
<PostDeleteText id={post?.id} page="detailPost" />
</VStack>
)}
{post?.createdBy?.id === currentUser?.id && (
<Button
bgColor="transparent"
p="1"
color="gray.500"
ml="auto"
onPress={toggleModal}
>
<Entypo
name="dots-three-horizontal"
color="#a1a1aa"
size={18}
style={{ marginTop: -2 }}
/>
</Button>
)}
</HStack>
<Text px="3" my="2">
{post.content}
</Text>
<Box>
{/* INTERACTABLE GROUNP */}
{post?.interactive && (
<InteractiveItemSimple
id={post?.interactive?.id}
sortBy="createdAt_DESC"
/>
)}
</Box>
</VStack>
</>
</TouchableWithoutFeedback>
</ScrollView>
</KeyboardAwareScrollView>
</Stack>
);
}
export default function PostDetailSimple(props) {
return <PostDetail {...props} UI={UI} />;
}
| 32.310345 | 82 | 0.434721 |
1e4e5a94a5f545fdd4c616f6f23de697d52658e1 | 4,138 | js | JavaScript | lib/fetcher/features/fetch-games/queries.js | musps/twitch-predictions-stats | db2fb2ae1c8e68ed4716a4d32ee325153d2d23be | [
"MIT"
] | 4 | 2021-06-02T16:42:15.000Z | 2021-08-29T19:20:13.000Z | lib/fetcher/features/fetch-games/queries.js | musps/twitch-predictions-stats | db2fb2ae1c8e68ed4716a4d32ee325153d2d23be | [
"MIT"
] | null | null | null | lib/fetcher/features/fetch-games/queries.js | musps/twitch-predictions-stats | db2fb2ae1c8e68ed4716a4d32ee325153d2d23be | [
"MIT"
] | null | null | null | import ChannelPredictions from '../../../data/models/ChannelPredictions'
import GameSchema from '../../../data/models/Games'
export const queryUpsertGames = (games) => {
return GameSchema.bulkWrite(
games.map((game) => ({
updateOne: {
filter: {
id: game.id,
},
update: {
$set: game,
},
upsert: true,
},
}))
)
}
export const queryGetPredictionsGameNotInDB = () => {
return ChannelPredictions.aggregate([
{
$group: {
_id: null,
games: {
$addToSet: '$game',
},
},
},
{
$project: {
games: {
$filter: {
input: '$games',
as: 'game',
cond: {
$ne: ['$$game', null],
},
},
},
},
},
{
$unwind: {
path: '$games',
},
},
{
$lookup: {
from: 'games',
localField: 'games',
foreignField: 'id',
as: 'data',
},
},
{
$match: {
data: [],
},
},
])
}
export const queryGeneratePredictionWithHisGame = (
channelId,
ignoreExisting = true
) => {
return ChannelPredictions.aggregate([
{
$match: {
channel: channelId,
...(ignoreExisting && {
game: null,
}),
},
},
{
$addFields: {
createdAtTimestamp: {
$toLong: {
$dateFromString: {
dateString: {
$substr: ['$createdAt', 0, 23],
},
},
},
},
},
},
{
$lookup: {
from: 'channels_videos',
let: {
channel: '$channel',
createdAtTimestamp: '$createdAtTimestamp',
},
pipeline: [
{
$match: {
$expr: {
$eq: ['$channel', '$$channel'],
},
},
},
{
$addFields: {
createdAtTimestamp: {
$toLong: {
$dateFromString: {
dateString: {
$substr: ['$createdAt', 0, 23],
},
},
},
},
endAtTimestamp: {
$add: [
{
$toLong: {
$dateFromString: {
dateString: {
$substr: ['$createdAt', 0, 23],
},
},
},
},
{
$multiply: ['$lengthSeconds', 1000],
},
],
},
},
},
{
$match: {
$and: [
{
$expr: {
$gte: ['$$createdAtTimestamp', '$createdAtTimestamp'],
},
},
{
$expr: {
$lte: ['$$createdAtTimestamp', '$endAtTimestamp'],
},
},
],
},
},
],
as: 'videos',
},
},
{
$project: {
prediction: '$id',
createdAt: 1,
createdAtTimestamp: 1,
video: {
$last: '$videos',
},
},
},
{
$addFields: {
game: {
$filter: {
input: '$video.moments',
as: 'moment',
cond: {
$gte: [
'$createdAtTimestamp',
{
$add: [
'$video.createdAtTimestamp',
'$$moment.positionMilliseconds',
],
},
],
},
},
},
},
},
{
$project: {
game: {
$last: '$game.game',
},
},
},
{
$merge: {
into: 'channels_predictions',
on: '_id',
whenMatched: 'merge',
whenNotMatched: 'insert',
},
},
])
}
| 20.485149 | 74 | 0.31537 |
1e4edbc9391f3f8c486df3d60198241a51ccefd0 | 32,782 | js | JavaScript | node_modules/ng-zorro-antd/esm2015/form/form-control.component.js | Bhumikansara/angulatdata | 1578fa6172ba85b5e6f045b2cca7b4c580164129 | [
"MIT"
] | null | null | null | node_modules/ng-zorro-antd/esm2015/form/form-control.component.js | Bhumikansara/angulatdata | 1578fa6172ba85b5e6f045b2cca7b4c580164129 | [
"MIT"
] | null | null | null | node_modules/ng-zorro-antd/esm2015/form/form-control.component.js | Bhumikansara/angulatdata | 1578fa6172ba85b5e6f045b2cca7b4c580164129 | [
"MIT"
] | 1 | 2020-08-19T03:45:16.000Z | 2020-08-19T03:45:16.000Z | /**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChild, ElementRef, Host, Input, Optional, Renderer2, ViewEncapsulation } from '@angular/core';
import { AbstractControl, FormControlDirective, FormControlName, NgControl, NgModel } from '@angular/forms';
import { helpMotion } from 'ng-zorro-antd/core/animation';
import { toBoolean } from 'ng-zorro-antd/core/util';
import { NzI18nService } from 'ng-zorro-antd/i18n';
import { Subject, Subscription } from 'rxjs';
import { filter, startWith, takeUntil, tap } from 'rxjs/operators';
import { NzFormDirective } from './form.directive';
import { NzFormItemComponent } from './form-item.component';
const iconTypeMap = {
error: 'close-circle-fill',
validating: 'loading',
success: 'check-circle-fill',
warning: 'exclamation-circle-fill'
};
export class NzFormControlComponent {
constructor(elementRef, nzFormItemComponent, cdr, renderer, i18n, nzFormDirective) {
var _a, _b;
this.nzFormItemComponent = nzFormItemComponent;
this.cdr = cdr;
this.nzFormDirective = nzFormDirective;
this._hasFeedback = false;
this.validateChanges = Subscription.EMPTY;
this.validateString = null;
this.destroyed$ = new Subject();
this.status = null;
this.validateControl = null;
this.iconType = null;
this.innerTip = null;
this.nzAutoTips = {};
this.nzDisableAutoTips = 'default';
renderer.addClass(elementRef.nativeElement, 'ant-form-item-control');
this.subscribeAutoTips(i18n.localeChange.pipe(tap(locale => (this.localeId = locale.locale))));
this.subscribeAutoTips((_a = this.nzFormDirective) === null || _a === void 0 ? void 0 : _a.getInputObservable('nzAutoTips'));
this.subscribeAutoTips((_b = this.nzFormDirective) === null || _b === void 0 ? void 0 : _b.getInputObservable('nzDisableAutoTips').pipe(filter(() => this.nzDisableAutoTips === 'default')));
}
get disableAutoTips() {
var _a;
return this.nzDisableAutoTips !== 'default' ? toBoolean(this.nzDisableAutoTips) : (_a = this.nzFormDirective) === null || _a === void 0 ? void 0 : _a.nzDisableAutoTips;
}
set nzHasFeedback(value) {
this._hasFeedback = toBoolean(value);
if (this.nzFormItemComponent) {
this.nzFormItemComponent.setHasFeedback(this._hasFeedback);
}
}
get nzHasFeedback() {
return this._hasFeedback;
}
set nzValidateStatus(value) {
if (value instanceof AbstractControl || value instanceof NgModel) {
this.validateControl = value;
this.validateString = null;
this.watchControl();
}
else if (value instanceof FormControlName) {
this.validateControl = value.control;
this.validateString = null;
this.watchControl();
}
else {
this.validateString = value;
this.validateControl = null;
this.setStatus();
}
}
watchControl() {
this.validateChanges.unsubscribe();
/** miss detect https://github.com/angular/angular/issues/10887 **/
if (this.validateControl && this.validateControl.statusChanges) {
this.validateChanges = this.validateControl.statusChanges.pipe(startWith(null), takeUntil(this.destroyed$)).subscribe(_ => {
if (!this.disableAutoTips) {
this.updateAutoErrorTip();
}
this.setStatus();
this.cdr.markForCheck();
});
}
}
setStatus() {
this.status = this.getControlStatus(this.validateString);
this.iconType = this.status ? iconTypeMap[this.status] : null;
this.innerTip = this.getInnerTip(this.status);
if (this.nzFormItemComponent) {
this.nzFormItemComponent.setWithHelpViaTips(!!this.innerTip);
this.nzFormItemComponent.setStatus(this.status);
}
}
getControlStatus(validateString) {
let status;
if (validateString === 'warning' || this.validateControlStatus('INVALID', 'warning')) {
status = 'warning';
}
else if (validateString === 'error' || this.validateControlStatus('INVALID')) {
status = 'error';
}
else if (validateString === 'validating' || validateString === 'pending' || this.validateControlStatus('PENDING')) {
status = 'validating';
}
else if (validateString === 'success' || this.validateControlStatus('VALID')) {
status = 'success';
}
else {
status = null;
}
return status;
}
validateControlStatus(validStatus, statusType) {
if (!this.validateControl) {
return false;
}
else {
const { dirty, touched, status } = this.validateControl;
return (!!dirty || !!touched) && (statusType ? this.validateControl.hasError(statusType) : status === validStatus);
}
}
getInnerTip(status) {
switch (status) {
case 'error':
return (!this.disableAutoTips && this.autoErrorTip) || this.nzErrorTip || null;
case 'validating':
return this.nzValidatingTip || null;
case 'success':
return this.nzSuccessTip || null;
case 'warning':
return this.nzWarningTip || null;
default:
return null;
}
}
updateAutoErrorTip() {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
if (this.validateControl) {
const errors = this.validateControl.errors || {};
let autoErrorTip = '';
for (const key in errors) {
if (errors.hasOwnProperty(key)) {
autoErrorTip = (_l = (_g = (_e = (_b = (_a = errors[key]) === null || _a === void 0 ? void 0 : _a[this.localeId]) !== null && _b !== void 0 ? _b : (_d = (_c = this.nzAutoTips) === null || _c === void 0 ? void 0 : _c[this.localeId]) === null || _d === void 0 ? void 0 : _d[key]) !== null && _e !== void 0 ? _e : (_f = this.nzAutoTips.default) === null || _f === void 0 ? void 0 : _f[key]) !== null && _g !== void 0 ? _g : (_k = (_j = (_h = this.nzFormDirective) === null || _h === void 0 ? void 0 : _h.nzAutoTips) === null || _j === void 0 ? void 0 : _j[this.localeId]) === null || _k === void 0 ? void 0 : _k[key]) !== null && _l !== void 0 ? _l : (_o = (_m = this.nzFormDirective) === null || _m === void 0 ? void 0 : _m.nzAutoTips.default) === null || _o === void 0 ? void 0 : _o[key];
}
if (!!autoErrorTip) {
break;
}
}
this.autoErrorTip = autoErrorTip;
}
}
subscribeAutoTips(observable) {
observable === null || observable === void 0 ? void 0 : observable.pipe(takeUntil(this.destroyed$)).subscribe(() => {
if (!this.disableAutoTips) {
this.updateAutoErrorTip();
this.setStatus();
this.cdr.markForCheck();
}
});
}
ngOnChanges(changes) {
const { nzDisableAutoTips, nzAutoTips, nzSuccessTip, nzWarningTip, nzErrorTip, nzValidatingTip } = changes;
if (nzDisableAutoTips || nzAutoTips) {
this.updateAutoErrorTip();
this.setStatus();
}
else if (nzSuccessTip || nzWarningTip || nzErrorTip || nzValidatingTip) {
this.setStatus();
}
}
ngOnInit() {
this.setStatus();
}
ngOnDestroy() {
this.destroyed$.next();
this.destroyed$.complete();
}
ngAfterContentInit() {
if (!this.validateControl && !this.validateString) {
if (this.defaultValidateControl instanceof FormControlDirective) {
this.nzValidateStatus = this.defaultValidateControl.control;
}
else {
this.nzValidateStatus = this.defaultValidateControl;
}
}
}
}
NzFormControlComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-form-control',
exportAs: 'nzFormControl',
preserveWhitespaces: false,
animations: [helpMotion],
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<div class="ant-form-item-control-input">
<div class="ant-form-item-control-input-content">
<ng-content></ng-content>
</div>
<span class="ant-form-item-children-icon">
<i *ngIf="nzHasFeedback && iconType" nz-icon [nzType]="iconType"></i>
</span>
</div>
<div [ngClass]="['ant-form-item-explain', 'ant-form-item-explain-' + status]" *ngIf="innerTip">
<div @helpMotion>
<ng-container *nzStringTemplateOutlet="innerTip; context: { $implicit: validateControl }">{{ innerTip }}</ng-container>
</div>
</div>
<div class="ant-form-item-extra" *ngIf="nzExtra">
<ng-container *nzStringTemplateOutlet="nzExtra">{{ nzExtra }}</ng-container>
</div>
`
},] }
];
NzFormControlComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: NzFormItemComponent, decorators: [{ type: Optional }, { type: Host }] },
{ type: ChangeDetectorRef },
{ type: Renderer2 },
{ type: NzI18nService },
{ type: NzFormDirective, decorators: [{ type: Optional }] }
];
NzFormControlComponent.propDecorators = {
defaultValidateControl: [{ type: ContentChild, args: [NgControl, { static: false },] }],
nzSuccessTip: [{ type: Input }],
nzWarningTip: [{ type: Input }],
nzErrorTip: [{ type: Input }],
nzValidatingTip: [{ type: Input }],
nzExtra: [{ type: Input }],
nzAutoTips: [{ type: Input }],
nzDisableAutoTips: [{ type: Input }],
nzHasFeedback: [{ type: Input }],
nzValidateStatus: [{ type: Input }]
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybS1jb250cm9sLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2NvbXBvbmVudHMvZm9ybS9mb3JtLWNvbnRyb2wuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7R0FHRztBQUVILE9BQU8sRUFFTCx1QkFBdUIsRUFDdkIsaUJBQWlCLEVBQ2pCLFNBQVMsRUFDVCxZQUFZLEVBQ1osVUFBVSxFQUNWLElBQUksRUFDSixLQUFLLEVBSUwsUUFBUSxFQUNSLFNBQVMsRUFHVCxpQkFBaUIsRUFDbEIsTUFBTSxlQUFlLENBQUM7QUFDdkIsT0FBTyxFQUFFLGVBQWUsRUFBRSxvQkFBb0IsRUFBRSxlQUFlLEVBQUUsU0FBUyxFQUFFLE9BQU8sRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQzVHLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSw4QkFBOEIsQ0FBQztBQUcxRCxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFDcEQsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBQ25ELE9BQU8sRUFBYyxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sTUFBTSxDQUFDO0FBQ3pELE9BQU8sRUFBRSxNQUFNLE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GlkYXRlQ29udHJvbCBpbnN0YW5jZW9mIEZvcm1Db250cm9sRGlyZWN0aXZlKSB7XG4gICAgICAgIHRoaXMubnpWYWxpZGF0ZVN0YXR1cyA9IHRoaXMuZGVmYXVsdFZhbGlkYXRlQ29udHJvbC5jb250cm9sO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgdGhpcy5uelZhbGlkYXRlU3RhdHVzID0gdGhpcy5kZWZhdWx0VmFsaWRhdGVDb250cm9sITtcbiAgICAgIH1cbiAgICB9XG4gIH1cbn1cbiJdfQ== | 138.90678 | 22,554 | 0.869715 |
1e4f2f2184c57bbfe814fddf0e8d07ff8bd00a08 | 878 | js | JavaScript | taxcalc-ui/src/api/tax/feedback.js | junditech/tax-calculator | d0b2451c454850f1358ef89a83a51236e1bda3c7 | [
"MIT"
] | 2 | 2021-04-27T04:25:12.000Z | 2021-06-01T02:29:00.000Z | taxcalc-ui/src/api/tax/feedback.js | jundeeliu/91Calc | d0b2451c454850f1358ef89a83a51236e1bda3c7 | [
"MIT"
] | 2 | 2021-11-02T02:44:26.000Z | 2021-11-10T08:16:25.000Z | taxcalc-ui/src/api/tax/feedback.js | junditech/tax-calculator | d0b2451c454850f1358ef89a83a51236e1bda3c7 | [
"MIT"
] | 1 | 2022-03-11T07:08:17.000Z | 2022-03-11T07:08:17.000Z | import request from '@/utils/request'
// 查询问题反馈列表
export function listFeedback(query) {
return request({
url: '/tax/feedback/list',
method: 'get',
params: query
})
}
// 查询问题反馈详细
export function getFeedback(feedbackId) {
return request({
url: '/tax/feedback/' + feedbackId,
method: 'get'
})
}
// 新增问题反馈
export function addFeedback(data) {
return request({
url: '/tax/feedback',
method: 'post',
data: data
})
}
// 修改问题反馈
export function updateFeedback(data) {
return request({
url: '/tax/feedback',
method: 'put',
data: data
})
}
// 删除问题反馈
export function delFeedback(feedbackId) {
return request({
url: '/tax/feedback/' + feedbackId,
method: 'delete'
})
}
// 导出问题反馈
export function exportFeedback(query) {
return request({
url: '/tax/feedback/export',
method: 'get',
params: query
})
} | 16.566038 | 41 | 0.628702 |
1e4fb1b69ed30a8c587193333a61b51d4a3c3f35 | 5,493 | js | JavaScript | MMM-MQTT.js | adi-miller/MMM-MQTT | b038f630589b96252db558c96baf79654c31336b | [
"MIT"
] | null | null | null | MMM-MQTT.js | adi-miller/MMM-MQTT | b038f630589b96252db558c96baf79654c31336b | [
"MIT"
] | null | null | null | MMM-MQTT.js | adi-miller/MMM-MQTT | b038f630589b96252db558c96baf79654c31336b | [
"MIT"
] | null | null | null |
Module.register("MMM-MQTT", {
log: function (...args) {
if (this.config.logging) {
console.log(args);
}
},
getScripts: function () {
return [
this.file('node_modules/jsonpointer/jsonpointer.js'),
'topics_match.js'
];
},
// Default module config
defaults: {
mqttServers: [],
logging: false,
useWildcards: false
},
makeServerKey: function (server) {
return '' + server.address + ':' + (server.port | '1883' + server.user);
},
start: function () {
console.log(this.name + ' started.');
this.subscriptions = [];
console.log(this.name + ': Setting up connection to ' + this.config.mqttServers.length + ' servers');
for (i = 0; i < this.config.mqttServers.length; i++) {
var s = this.config.mqttServers[i];
var serverKey = this.makeServerKey(s);
console.log(this.name + ': Adding config for ' + s.address + ' port ' + s.port + ' user ' + s.user);
for (j = 0; j < s.subscriptions.length; j++) {
var sub = s.subscriptions[j];
this.subscriptions.push({
serverKey: serverKey,
label: sub.label,
topic: sub.topic,
decimals: sub.decimals,
jsonpointer: sub.jsonpointer,
suffix: typeof (sub.suffix) == 'undefined' ? '' : sub.suffix,
value: '',
time: Date.now(),
maxAgeSeconds: sub.maxAgeSeconds,
sortOrder: sub.sortOrder | i * 100 + j
});
}
}
this.openMqttConnection();
var self = this;
setInterval(function () {
self.updateDom(100);
}, 5000);
},
openMqttConnection: function () {
this.sendSocketNotification('MQTT_CONFIG', this.config);
},
socketNotificationReceived: function (notification, payload) {
if (notification === 'MQTT_PAYLOAD') {
if (payload != null) {
for (i = 0; i < this.subscriptions.length; i++) {
sub = this.subscriptions[i];
if (sub.serverKey == payload.serverKey &&
this.config.useWildcards
? topicsMatch(sub.topic, payload.topic)
: sub.topic == payload.topic) {
var value = payload.value;
// Extract value if JSON Pointer is configured
if (sub.jsonpointer) {
value = get(JSON.parse(value), sub.jsonpointer);
}
// Round if decimals is configured
if (isNaN(sub.decimals) == false) {
if (isNaN(value) == false) {
value = Number(value).toFixed(sub.decimals);
}
}
sub.value = value;
sub.time = payload.time;
}
}
this.updateDom();
} else {
console.log(this.name + ': MQTT_PAYLOAD - No payload');
}
}
},
getStyles: function () {
return [
'MQTT.css'
];
},
isValueTooOld: function (maxAgeSeconds, updatedTime) {
// console.log(this.name + ': maxAgeSeconds = ', maxAgeSeconds);
// console.log(this.name + ': updatedTime = ', updatedTime);
// console.log(this.name + ': Date.now() = ', Date.now());
if (maxAgeSeconds) {
if ((updatedTime + maxAgeSeconds * 1000) < Date.now()) {
return true;
}
}
return false;
},
getDom: function () {
self = this;
var wrapper = document.createElement("table");
wrapper.className = "small";
var first = true;
if (self.subscriptions.length === 0) {
wrapper.innerHTML = (self.loaded) ? self.translate("EMPTY") : self.translate("LOADING");
wrapper.className = "small dimmed";
console.log(self.name + ': No values');
return wrapper;
}
self.subscriptions.sort((a, b) => {
return a.sortOrder - b.sortOrder;
}).forEach(function (sub) {
var subWrapper = document.createElement("tr");
// Label
var labelWrapper = document.createElement("td");
labelWrapper.innerHTML = sub.label;
labelWrapper.className = "align-left mqtt-label";
subWrapper.appendChild(labelWrapper);
// Value
tooOld = self.isValueTooOld(sub.maxAgeSeconds, sub.time);
var valueWrapper = document.createElement("td");
valueWrapper.innerHTML = sub.value;
valueWrapper.className = "align-right medium mqtt-value " + (tooOld ? "dimmed" : "bright");
subWrapper.appendChild(valueWrapper);
// Suffix
var suffixWrapper = document.createElement("td");
suffixWrapper.innerHTML = sub.suffix;
suffixWrapper.className = "align-left mqtt-suffix";
subWrapper.appendChild(suffixWrapper);
wrapper.appendChild(subWrapper);
});
return wrapper;
}
});
| 34.765823 | 112 | 0.488804 |
1e51102d99b1e3277bee7d304a7e8ea539afb625 | 13,091 | js | JavaScript | spinners.js | LaboratorioInternacionalWeb/Multispinners | 3a799998deb4b3804dc7e44c7e60e6e65fe0dc6a | [
"MIT"
] | 2 | 2021-12-17T09:45:16.000Z | 2022-01-30T18:58:19.000Z | spinners.js | LaboratorioInternacionalWeb/Multispinners | 3a799998deb4b3804dc7e44c7e60e6e65fe0dc6a | [
"MIT"
] | null | null | null | spinners.js | LaboratorioInternacionalWeb/Multispinners | 3a799998deb4b3804dc7e44c7e60e6e65fe0dc6a | [
"MIT"
] | null | null | null | module.exports = spinners = {
subtext: {
frames: [" |_ _ _ _ "],
},
succed: {
frames: [" ✔️ "],
},
warn: {
frames: [" ⚠️ "],
},
info: {
frames: ["\x1b[34m ℹ \x1b[0m"],
},
fail: {
frames: ["\x1b[31m ✖ \x1b[0m"],
},
dots: {
frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"],
},
dots2: {
frames: ["⣾", "⣽", "⣻", "⢿", "⡿", "⣟", "⣯", "⣷"],
},
dots3: {
frames: ["⠋", "⠙", "⠚", "⠞", "⠖", "⠦", "⠴", "⠲", "⠳", "⠓"],
},
dots4: {
frames: [
"⠄",
"⠆",
"⠇",
"⠋",
"⠙",
"⠸",
"⠰",
"⠠",
"⠰",
"⠸",
"⠙",
"⠋",
"⠇",
"⠆",
],
},
dots5: {
frames: [
"⠋",
"⠙",
"⠚",
"⠒",
"⠂",
"⠂",
"⠒",
"⠲",
"⠴",
"⠦",
"⠖",
"⠒",
"⠐",
"⠐",
"⠒",
"⠓",
"⠋",
],
},
dots6: {
frames: [
"⠁",
"⠉",
"⠙",
"⠚",
"⠒",
"⠂",
"⠂",
"⠒",
"⠲",
"⠴",
"⠤",
"⠄",
"⠄",
"⠤",
"⠴",
"⠲",
"⠒",
"⠂",
"⠂",
"⠒",
"⠚",
"⠙",
"⠉",
"⠁",
],
},
dots7: {
frames: [
"⠈",
"⠉",
"⠋",
"⠓",
"⠒",
"⠐",
"⠐",
"⠒",
"⠖",
"⠦",
"⠤",
"⠠",
"⠠",
"⠤",
"⠦",
"⠖",
"⠒",
"⠐",
"⠐",
"⠒",
"⠓",
"⠋",
"⠉",
"⠈",
],
},
dots8: {
frames: [
"⠁",
"⠁",
"⠉",
"⠙",
"⠚",
"⠒",
"⠂",
"⠂",
"⠒",
"⠲",
"⠴",
"⠤",
"⠄",
"⠄",
"⠤",
"⠠",
"⠠",
"⠤",
"⠦",
"⠖",
"⠒",
"⠐",
"⠐",
"⠒",
"⠓",
"⠋",
"⠉",
"⠈",
"⠈",
],
},
dots9: {
frames: ["⢹", "⢺", "⢼", "⣸", "⣇", "⡧", "⡗", "⡏"],
},
dots10: {
frames: ["⢄", "⢂", "⢁", "⡁", "⡈", "⡐", "⡠"],
},
dots11: {
frames: ["⠁", "⠂", "⠄", "⡀", "⢀", "⠠", "⠐", "⠈"],
},
dots12: {
frames: [
"⢀⠀",
"⡀⠀",
"⠄⠀",
"⢂⠀",
"⡂⠀",
"⠅⠀",
"⢃⠀",
"⡃⠀",
"⠍⠀",
"⢋⠀",
"⡋⠀",
"⠍⠁",
"⢋⠁",
"⡋⠁",
"⠍⠉",
"⠋⠉",
"⠋⠉",
"⠉⠙",
"⠉⠙",
"⠉⠩",
"⠈⢙",
"⠈⡙",
"⢈⠩",
"⡀⢙",
"⠄⡙",
"⢂⠩",
"⡂⢘",
"⠅⡘",
"⢃⠨",
"⡃⢐",
"⠍⡐",
"⢋⠠",
"⡋⢀",
"⠍⡁",
"⢋⠁",
"⡋⠁",
"⠍⠉",
"⠋⠉",
"⠋⠉",
"⠉⠙",
"⠉⠙",
"⠉⠩",
"⠈⢙",
"⠈⡙",
"⠈⠩",
"⠀⢙",
"⠀⡙",
"⠀⠩",
"⠀⢘",
"⠀⡘",
"⠀⠨",
"⠀⢐",
"⠀⡐",
"⠀⠠",
"⠀⢀",
"⠀⡀",
],
},
dots8Bit: {
frames: [
"⠀",
"⠁",
"⠂",
"⠃",
"⠄",
"⠅",
"⠆",
"⠇",
"⡀",
"⡁",
"⡂",
"⡃",
"⡄",
"⡅",
"⡆",
"⡇",
"⠈",
"⠉",
"⠊",
"⠋",
"⠌",
"⠍",
"⠎",
"⠏",
"⡈",
"⡉",
"⡊",
"⡋",
"⡌",
"⡍",
"⡎",
"⡏",
"⠐",
"⠑",
"⠒",
"⠓",
"⠔",
"⠕",
"⠖",
"⠗",
"⡐",
"⡑",
"⡒",
"⡓",
"⡔",
"⡕",
"⡖",
"⡗",
"⠘",
"⠙",
"⠚",
"⠛",
"⠜",
"⠝",
"⠞",
"⠟",
"⡘",
"⡙",
"⡚",
"⡛",
"⡜",
"⡝",
"⡞",
"⡟",
"⠠",
"⠡",
"⠢",
"⠣",
"⠤",
"⠥",
"⠦",
"⠧",
"⡠",
"⡡",
"⡢",
"⡣",
"⡤",
"⡥",
"⡦",
"⡧",
"⠨",
"⠩",
"⠪",
"⠫",
"⠬",
"⠭",
"⠮",
"⠯",
"⡨",
"⡩",
"⡪",
"⡫",
"⡬",
"⡭",
"⡮",
"⡯",
"⠰",
"⠱",
"⠲",
"⠳",
"⠴",
"⠵",
"⠶",
"⠷",
"⡰",
"⡱",
"⡲",
"⡳",
"⡴",
"⡵",
"⡶",
"⡷",
"⠸",
"⠹",
"⠺",
"⠻",
"⠼",
"⠽",
"⠾",
"⠿",
"⡸",
"⡹",
"⡺",
"⡻",
"⡼",
"⡽",
"⡾",
"⡿",
"⢀",
"⢁",
"⢂",
"⢃",
"⢄",
"⢅",
"⢆",
"⢇",
"⣀",
"⣁",
"⣂",
"⣃",
"⣄",
"⣅",
"⣆",
"⣇",
"⢈",
"⢉",
"⢊",
"⢋",
"⢌",
"⢍",
"⢎",
"⢏",
"⣈",
"⣉",
"⣊",
"⣋",
"⣌",
"⣍",
"⣎",
"⣏",
"⢐",
"⢑",
"⢒",
"⢓",
"⢔",
"⢕",
"⢖",
"⢗",
"⣐",
"⣑",
"⣒",
"⣓",
"⣔",
"⣕",
"⣖",
"⣗",
"⢘",
"⢙",
"⢚",
"⢛",
"⢜",
"⢝",
"⢞",
"⢟",
"⣘",
"⣙",
"⣚",
"⣛",
"⣜",
"⣝",
"⣞",
"⣟",
"⢠",
"⢡",
"⢢",
"⢣",
"⢤",
"⢥",
"⢦",
"⢧",
"⣠",
"⣡",
"⣢",
"⣣",
"⣤",
"⣥",
"⣦",
"⣧",
"⢨",
"⢩",
"⢪",
"⢫",
"⢬",
"⢭",
"⢮",
"⢯",
"⣨",
"⣩",
"⣪",
"⣫",
"⣬",
"⣭",
"⣮",
"⣯",
"⢰",
"⢱",
"⢲",
"⢳",
"⢴",
"⢵",
"⢶",
"⢷",
"⣰",
"⣱",
"⣲",
"⣳",
"⣴",
"⣵",
"⣶",
"⣷",
"⢸",
"⢹",
"⢺",
"⢻",
"⢼",
"⢽",
"⢾",
"⢿",
"⣸",
"⣹",
"⣺",
"⣻",
"⣼",
"⣽",
"⣾",
"⣿",
],
},
line: {
frames: ["-", "\\", "|", "/"],
},
line2: {
frames: ["⠂", "-", "–", "—", "–", "-"],
},
pipe: {
frames: ["┤", "┘", "┴", "└", "├", "┌", "┬", "┐"],
},
simpleDots: {
frames: [". ", ".. ", "...", " "],
},
simpleDotsScrolling: {
frames: [". ", ".. ", "...", " ..", " .", " "],
},
star: {
frames: ["✶", "✸", "✹", "✺", "✹", "✷"],
},
star2: {
frames: ["+", "x", "*"],
},
flip: {
frames: ["_", "_", "_", "-", "`", "`", "'", "´", "-", "_", "_", "_"],
},
hamburger: {
frames: ["☱", "☲", "☴"],
},
growVertical: {
frames: ["▁", "▃", "▄", "▅", "▆", "▇", "▆", "▅", "▄", "▃"],
},
growHorizontal: {
frames: ["▏", "▎", "▍", "▌", "▋", "▊", "▉", "▊", "▋", "▌", "▍", "▎"],
},
balloon: {
frames: [" ", ".", "o", "O", "@", "*", " "],
},
balloon2: {
frames: [".", "o", "O", "°", "O", "o", "."],
},
noise: {
frames: ["▓", "▒", "░"],
},
bounce: {
frames: ["⠁", "⠂", "⠄", "⠂"],
},
boxBounce: {
frames: ["▖", "▘", "▝", "▗"],
},
boxBounce2: {
frames: ["▌", "▀", "▐", "▄"],
},
triangle: {
frames: ["◢", "◣", "◤", "◥"],
},
arc: {
frames: ["◜", "◠", "◝", "◞", "◡", "◟"],
},
circle: {
frames: ["◡", "⊙", "◠"],
},
squareCorners: {
frames: ["◰", "◳", "◲", "◱"],
},
circleQuarters: {
frames: ["◴", "◷", "◶", "◵"],
},
circleHalves: {
frames: ["◐", "◓", "◑", "◒"],
},
squish: {
frames: ["╫", "╪"],
},
toggle: {
frames: ["⊶", "⊷"],
},
toggle2: {
frames: ["▫", "▪"],
},
toggle3: {
frames: ["□", "■"],
},
toggle4: {
frames: ["■", "□", "▪", "▫"],
},
toggle5: {
frames: ["▮", "▯"],
},
toggle6: {
frames: ["ဝ", "၀"],
},
toggle7: {
frames: ["⦾", "⦿"],
},
toggle8: {
frames: ["◍", "◌"],
},
toggle9: {
frames: ["◉", "◎"],
},
toggle10: {
frames: ["㊂", "㊀", "㊁"],
},
toggle11: {
frames: ["⧇", "⧆"],
},
toggle12: {
frames: ["☗", "☖"],
},
toggle13: {
frames: ["=", "*", "-"],
},
arrow: {
frames: ["←", "↖", "↑", "↗", "→", "↘", "↓", "↙"],
},
arrow2: {
frames: ["⬆️ ", "↗️ ", "➡️ ", "↘️ ", "⬇️ ", "↙️ ", "⬅️ ", "↖️ "],
},
arrow3: {
frames: ["▹▹▹▹▹", "▸▹▹▹▹", "▹▸▹▹▹", "▹▹▸▹▹", "▹▹▹▸▹", "▹▹▹▹▸"],
},
bouncingBar: {
frames: [
"[ ]",
"[= ]",
"[== ]",
"[=== ]",
"[ ===]",
"[ ==]",
"[ =]",
"[ ]",
"[ =]",
"[ ==]",
"[ ===]",
"[====]",
"[=== ]",
"[== ]",
"[= ]",
],
},
bouncingBall: {
frames: [
"( ● )",
"( ● )",
"( ● )",
"( ● )",
"( ●)",
"( ● )",
"( ● )",
"( ● )",
"( ● )",
"(● )",
],
},
smiley: {
frames: ["😄 ", "😝 "],
},
monkey: {
frames: ["🙈 ", "🙈 ", "🙉 ", "🙊 "],
},
hearts: {
frames: ["💛 ", "💙 ", "💜 ", "💚 ", "❤️ "],
},
clock: {
frames: [
"🕛 ",
"🕐 ",
"🕑 ",
"🕒 ",
"🕓 ",
"🕔 ",
"🕕 ",
"🕖 ",
"🕗 ",
"🕘 ",
"🕙 ",
"🕚 ",
],
},
earth: {
frames: ["🌍 ", "🌎 ", "🌏 "],
},
material: {
frames: [
"█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁",
"██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁",
"███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁",
"████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁",
"██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁",
"██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁",
"███████▁▁▁▁▁▁▁▁▁▁▁▁▁",
"████████▁▁▁▁▁▁▁▁▁▁▁▁",
"█████████▁▁▁▁▁▁▁▁▁▁▁",
"█████████▁▁▁▁▁▁▁▁▁▁▁",
"██████████▁▁▁▁▁▁▁▁▁▁",
"███████████▁▁▁▁▁▁▁▁▁",
"█████████████▁▁▁▁▁▁▁",
"██████████████▁▁▁▁▁▁",
"██████████████▁▁▁▁▁▁",
"▁██████████████▁▁▁▁▁",
"▁██████████████▁▁▁▁▁",
"▁██████████████▁▁▁▁▁",
"▁▁██████████████▁▁▁▁",
"▁▁▁██████████████▁▁▁",
"▁▁▁▁█████████████▁▁▁",
"▁▁▁▁██████████████▁▁",
"▁▁▁▁██████████████▁▁",
"▁▁▁▁▁██████████████▁",
"▁▁▁▁▁██████████████▁",
"▁▁▁▁▁██████████████▁",
"▁▁▁▁▁▁██████████████",
"▁▁▁▁▁▁██████████████",
"▁▁▁▁▁▁▁█████████████",
"▁▁▁▁▁▁▁█████████████",
"▁▁▁▁▁▁▁▁████████████",
"▁▁▁▁▁▁▁▁████████████",
"▁▁▁▁▁▁▁▁▁███████████",
"▁▁▁▁▁▁▁▁▁███████████",
"▁▁▁▁▁▁▁▁▁▁██████████",
"▁▁▁▁▁▁▁▁▁▁██████████",
"▁▁▁▁▁▁▁▁▁▁▁▁████████",
"▁▁▁▁▁▁▁▁▁▁▁▁▁███████",
"▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████",
"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████",
"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████",
"█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████",
"██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███",
"██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███",
"███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███",
"████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██",
"█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█",
"█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█",
"██████▁▁▁▁▁▁▁▁▁▁▁▁▁█",
"████████▁▁▁▁▁▁▁▁▁▁▁▁",
"█████████▁▁▁▁▁▁▁▁▁▁▁",
"█████████▁▁▁▁▁▁▁▁▁▁▁",
"█████████▁▁▁▁▁▁▁▁▁▁▁",
"█████████▁▁▁▁▁▁▁▁▁▁▁",
"███████████▁▁▁▁▁▁▁▁▁",
"████████████▁▁▁▁▁▁▁▁",
"████████████▁▁▁▁▁▁▁▁",
"██████████████▁▁▁▁▁▁",
"██████████████▁▁▁▁▁▁",
"▁██████████████▁▁▁▁▁",
"▁██████████████▁▁▁▁▁",
"▁▁▁█████████████▁▁▁▁",
"▁▁▁▁▁████████████▁▁▁",
"▁▁▁▁▁████████████▁▁▁",
"▁▁▁▁▁▁███████████▁▁▁",
"▁▁▁▁▁▁▁▁█████████▁▁▁",
"▁▁▁▁▁▁▁▁█████████▁▁▁",
"▁▁▁▁▁▁▁▁▁█████████▁▁",
"▁▁▁▁▁▁▁▁▁█████████▁▁",
"▁▁▁▁▁▁▁▁▁▁█████████▁",
"▁▁▁▁▁▁▁▁▁▁▁████████▁",
"▁▁▁▁▁▁▁▁▁▁▁████████▁",
"▁▁▁▁▁▁▁▁▁▁▁▁███████▁",
"▁▁▁▁▁▁▁▁▁▁▁▁███████▁",
"▁▁▁▁▁▁▁▁▁▁▁▁▁███████",
"▁▁▁▁▁▁▁▁▁▁▁▁▁███████",
"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████",
"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████",
"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████",
"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████",
"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███",
"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███",
"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██",
"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██",
"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██",
"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█",
"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█",
"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█",
"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁",
"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁",
"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁",
"▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁",
],
},
moon: {
frames: ["🌑 ", "🌒 ", "🌓 ", "🌔 ", "🌕 ", "🌖 ", "🌗 ", "🌘 "],
},
runner: {
frames: ["🚶 ", "🏃 "],
},
pong: {
frames: [
"▐⠂ ▌",
"▐⠈ ▌",
"▐ ⠂ ▌",
"▐ ⠠ ▌",
"▐ ⡀ ▌",
"▐ ⠠ ▌",
"▐ ⠂ ▌",
"▐ ⠈ ▌",
"▐ ⠂ ▌",
"▐ ⠠ ▌",
"▐ ⡀ ▌",
"▐ ⠠ ▌",
"▐ ⠂ ▌",
"▐ ⠈ ▌",
"▐ ⠂▌",
"▐ ⠠▌",
"▐ ⡀▌",
"▐ ⠠ ▌",
"▐ ⠂ ▌",
"▐ ⠈ ▌",
"▐ ⠂ ▌",
"▐ ⠠ ▌",
"▐ ⡀ ▌",
"▐ ⠠ ▌",
"▐ ⠂ ▌",
"▐ ⠈ ▌",
"▐ ⠂ ▌",
"▐ ⠠ ▌",
"▐ ⡀ ▌",
"▐⠠ ▌",
],
},
shark: {
frames: [
"▐|\\____________▌",
"▐_|\\___________▌",
"▐__|\\__________▌",
"▐___|\\_________▌",
"▐____|\\________▌",
"▐_____|\\_______▌",
"▐______|\\______▌",
"▐_______|\\_____▌",
"▐________|\\____▌",
"▐_________|\\___▌",
"▐__________|\\__▌",
"▐___________|\\_▌",
"▐____________|\\▌",
"▐____________/|▌",
"▐___________/|_▌",
"▐__________/|__▌",
"▐_________/|___▌",
"▐________/|____▌",
"▐_______/|_____▌",
"▐______/|______▌",
"▐_____/|_______▌",
"▐____/|________▌",
"▐___/|_________▌",
"▐__/|__________▌",
"▐_/|___________▌",
"▐/|____________▌",
],
},
dqpb: {
frames: ["d", "q", "p", "b"],
},
weather: {
frames: [
"☀️ ",
"☀️ ",
"☀️ ",
"🌤 ",
"⛅️ ",
"🌥 ",
"☁️ ",
"🌧 ",
"🌨 ",
"🌧 ",
"🌨 ",
"🌧 ",
"🌨 ",
"⛈ ",
"🌨 ",
"🌧 ",
"🌨 ",
"☁️ ",
"🌥 ",
"⛅️ ",
"🌤 ",
"☀️ ",
"☀️ ",
],
},
christmas: {
frames: ["🌲", "🎄"],
},
grenade: {
frames: [
"، ",
"′ ",
" ´ ",
" ‾ ",
" ⸌",
" ⸊",
" |",
" ⁎",
" ⁕",
" ෴ ",
" ⁓",
" ",
" ",
" ",
],
},
point: {
frames: ["∙∙∙", "●∙∙", "∙●∙", "∙∙●", "∙∙∙"],
},
layer: {
frames: ["-", "=", "≡"],
},
betaWave: {
frames: [
"ρββββββ",
"βρβββββ",
"ββρββββ",
"βββρβββ",
"ββββρββ",
"βββββρβ",
"ββββββρ",
],
},
fingerDance: {
frames: ["🤘 ", "🤟 ", "🖖 ", "✋ ", "🤚 ", "👆 "],
},
fistBump: {
frames: [
"🤜\u3000\u3000\u3000\u3000🤛 ",
"🤜\u3000\u3000\u3000\u3000🤛 ",
"🤜\u3000\u3000\u3000\u3000🤛 ",
"\u3000🤜\u3000\u3000🤛\u3000 ",
"\u3000\u3000🤜🤛\u3000\u3000 ",
"\u3000🤜✨🤛\u3000\u3000 ",
"🤜\u3000✨\u3000🤛\u3000 ",
],
},
soccerHeader: {
frames: [
" 🧑⚽️ 🧑 ",
"🧑 ⚽️ 🧑 ",
"🧑 ⚽️ 🧑 ",
"🧑 ⚽️ 🧑 ",
"🧑 ⚽️ 🧑 ",
"🧑 ⚽️ 🧑 ",
"🧑 ⚽️🧑 ",
"🧑 ⚽️ 🧑 ",
"🧑 ⚽️ 🧑 ",
"🧑 ⚽️ 🧑 ",
"🧑 ⚽️ 🧑 ",
"🧑 ⚽️ 🧑 ",
],
},
mindblown: {
frames: [
"😐 ",
"😐 ",
"😮 ",
"😮 ",
"😦 ",
"😦 ",
"😧 ",
"😧 ",
"🤯 ",
"💥 ",
"✨ ",
"\u3000 ",
"\u3000 ",
"\u3000 ",
],
},
speaker: {
frames: ["🔈 ", "🔉 ", "🔊 ", "🔉 "],
},
orangePulse: {
frames: ["🔸 ", "🔶 ", "🟠 ", "🟠 ", "🔶 "],
},
bluePulse: {
frames: ["🔹 ", "🔷 ", "🔵 ", "🔵 ", "🔷 "],
},
orangeBluePulse: {
frames: [
"🔸 ",
"🔶 ",
"🟠 ",
"🟠 ",
"🔶 ",
"🔹 ",
"🔷 ",
"🔵 ",
"🔵 ",
"🔷 ",
],
},
timeTravel: {
frames: [
"🕛 ",
"🕚 ",
"🕙 ",
"🕘 ",
"🕗 ",
"🕖 ",
"🕕 ",
"🕔 ",
"🕓 ",
"🕒 ",
"🕑 ",
"🕐 ",
],
},
aesthetic: {
frames: [
"▰▱▱▱▱▱▱",
"▰▰▱▱▱▱▱",
"▰▰▰▱▱▱▱",
"▰▰▰▰▱▱▱",
"▰▰▰▰▰▱▱",
"▰▰▰▰▰▰▱",
"▰▰▰▰▰▰▰",
"▰▱▱▱▱▱▱",
],
},
};
| 13.117234 | 71 | 0.13177 |
1e51c553a69837c3e13cdfe8ae4eeaff294d1bf7 | 3,107 | js | JavaScript | private-provisioning/lib/ethereumMgr.js | subhodi/uport-private-network | 802fcfbac83382c12e62377e38d79341abdd4628 | [
"Apache-2.0"
] | null | null | null | private-provisioning/lib/ethereumMgr.js | subhodi/uport-private-network | 802fcfbac83382c12e62377e38d79341abdd4628 | [
"Apache-2.0"
] | null | null | null | private-provisioning/lib/ethereumMgr.js | subhodi/uport-private-network | 802fcfbac83382c12e62377e38d79341abdd4628 | [
"Apache-2.0"
] | null | null | null | var networks = require('./networks');
var Web3 = require('web3');
var Promise = require('bluebird');
var generators = require('eth-signer').generators;
var signers = require('eth-signer').signers;
var Transaction = require('ethereumjs-tx');
var { Client } = require('pg');
var SignerProvider = require('ethjs-provider-signer');
const HDSigner = signers.HDSigner
const DEFAULT_GAS_PRICE = 20000000000 // 20 Gwei
class EthereumMgr {
constructor() {
this.pgUrl = null
this.seed = null
this.web3s = {}
this.gasPrices = {}
this.setSecrets();
}
setSecrets() {
this.seed = ''; // 12 word seed to create account and please fund the account created
const hdPrivKey = generators.Phrase.toHDPrivateKey(this.seed)
this.signer = new HDSigner(hdPrivKey)
const txSigner = {
signTransaction: (tx_params, cb) => {
let tx = new Transaction(tx_params)
let rawTx = tx.serialize().toString('hex')
this.signer.signRawTx(rawTx, (err, signedRawTx) => {
cb(err, '0x' + signedRawTx)
})
},
accounts: (cb) => cb(null, [this.signer.getAddress()]),
}
for (const network in networks) {
let provider = new SignerProvider(networks[network].rpcUrl, txSigner);
let web3 = new Web3(provider)
web3.eth = Promise.promisifyAll(web3.eth)
this.web3s[network] = web3
this.gasPrices[network] = DEFAULT_GAS_PRICE;
}
}
getProvider(networkName) {
if (!this.web3s[networkName]) return null;
return this.web3s[networkName].currentProvider
}
getAddress() {
return this.signer.getAddress()
}
getNetworkId(networkName) {
if (!networkName) throw ('no networkName')
console.log(networks);
return networks[networkName].id
}
getContract(abi, networkName) {
if (!abi) throw ('no abi')
if (!networkName) throw ('no networkName')
if (!this.web3s[networkName]) throw ('no web3 for networkName')
return this.web3s[networkName].eth.contract(abi)
}
async getTransactionReceipt(txHash, networkName) {
if (!txHash) throw ('no txHash')
if (!networkName) throw ('no networkName')
if (!this.web3s[networkName]) throw ('no web3 for networkName')
return await this.web3s[networkName].eth.getTransactionReceiptAsync(txHash)
}
async getBalance(address, networkName) {
if (!address) throw ('no address')
if (!networkName) throw ('no networkName')
if (!this.web3s[networkName]) throw ('no web3 for networkName')
return await this.web3s[networkName].eth.getBalanceAsync(address)
}
async getGasPrice(networkName) {
if (!networkName) throw ('no networkName')
try {
this.gasPrices[networkName] = (await this.web3s[networkName].eth.getGasPriceAsync()).toNumber()
} catch (e) {
console.log(e)
}
return this.gasPrices[networkName]
}
async getNonce(address, networkName) {
if (!address) throw ('no address')
if (!networkName) throw ('no networkName')
let nonce = this.web3s[networkName].eth.getTransactionCount(address);
return nonce;
}
}
module.exports = EthereumMgr
| 28.245455 | 101 | 0.667847 |
1e523bd420ca2ddac8ffc5a8f588eb108acf2d50 | 3,031 | js | JavaScript | assets/js/highlight/es/languages/gams.min.js | sebastien-d-me/nice-looking-select | 8ba952894474bf5784a49d7be441528b2ca3e7f4 | [
"MIT"
] | 1 | 2021-11-18T09:49:58.000Z | 2021-11-18T09:49:58.000Z | assets/js/highlight/es/languages/gams.min.js | sebastien-d-me/nice-looking-select | 8ba952894474bf5784a49d7be441528b2ca3e7f4 | [
"MIT"
] | null | null | null | assets/js/highlight/es/languages/gams.min.js | sebastien-d-me/nice-looking-select | 8ba952894474bf5784a49d7be441528b2ca3e7f4 | [
"MIT"
] | null | null | null | /*! `gams` grammar compiled for Highlight.js 11.3.1 */
var hljsGrammar=(()=>{"use strict";return e=>{const a=e.regex,n={
keyword:"abort acronym acronyms alias all and assign binary card diag display else eq file files for free ge gt if integer le loop lt maximizing minimizing model models ne negative no not option options or ord positive prod put putpage puttl repeat sameas semicont semiint smax smin solve sos1 sos2 sum system table then until using while xor yes",
literal:"eps inf na",
built_in:"abs arccos arcsin arctan arctan2 Beta betaReg binomial ceil centropy cos cosh cvPower div div0 eDist entropy errorf execSeed exp fact floor frac gamma gammaReg log logBeta logGamma log10 log2 mapVal max min mod ncpCM ncpF ncpVUpow ncpVUsin normal pi poly power randBinomial randLinear randTriangle round rPower sigmoid sign signPower sin sinh slexp sllog10 slrec sqexp sqlog10 sqr sqrec sqrt tan tanh trunc uniform uniformInt vcPower bool_and bool_eqv bool_imp bool_not bool_or bool_xor ifThen rel_eq rel_ge rel_gt rel_le rel_lt rel_ne gday gdow ghour gleap gmillisec gminute gmonth gsecond gyear jdate jnow jstart jtime errorLevel execError gamsRelease gamsVersion handleCollect handleDelete handleStatus handleSubmit heapFree heapLimit heapSize jobHandle jobKill jobStatus jobTerminate licenseLevel licenseStatus maxExecError sleep timeClose timeComp timeElapsed timeExec timeStart"
},i={className:"symbol",variants:[{begin:/=[lgenxc]=/},{begin:/\$/}]},s={
className:"comment",variants:[{begin:"'",end:"'"},{begin:'"',end:'"'}],
illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},o={begin:"/",end:"/",keywords:n,
contains:[s,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,e.C_NUMBER_MODE]
},r=/[a-z0-9&#*=?@\\><:,()$[\]_.{}!+%^-]+/,t={
begin:/[a-z][a-z0-9_]*(\([a-z0-9_, ]*\))?[ \t]+/,excludeBegin:!0,end:"$",
endsWithParent:!0,contains:[s,o,{className:"comment",
begin:a.concat(r,a.anyNumberOfTimes(a.concat(/[ ]+/,r))),relevance:0}]};return{
name:"GAMS",aliases:["gms"],case_insensitive:!0,keywords:n,
contains:[e.COMMENT(/^\$ontext/,/^\$offtext/),{className:"meta",
begin:"^\\$[a-z0-9]+",end:"$",returnBegin:!0,contains:[{className:"keyword",
begin:"^\\$[a-z0-9]+"}]
},e.COMMENT("^\\*","$"),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{
beginKeywords:"set sets parameter parameters variable variables scalar scalars equation equations",
end:";",
contains:[e.COMMENT("^\\*","$"),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,o,t]
},{beginKeywords:"table",end:";",returnBegin:!0,contains:[{
beginKeywords:"table",end:"$",contains:[t]
},e.COMMENT("^\\*","$"),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,e.C_NUMBER_MODE]
},{className:"function",begin:/^[a-z][a-z0-9_,\-+' ()$]+\.{2}/,returnBegin:!0,
contains:[{className:"title",begin:/^[a-z0-9_]+/},{className:"params",
begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0},i]},e.C_NUMBER_MODE,i]}}})()
;export default hljsGrammar; | 108.25 | 894 | 0.746948 |
1e52548ce0aa17e57cfab533cb57bcf8b7bfeeb9 | 43,882 | js | JavaScript | node_modules/googleapis/build/src/apis/toolresults/v1beta3.js | DeMaiz/googlesheet | 89d311df1762ed75d78a1ff466d2277cb6928a4d | [
"MIT"
] | 16 | 2019-06-04T08:29:02.000Z | 2021-12-14T15:08:28.000Z | node_modules/googleapis/build/src/apis/toolresults/v1beta3.js | DeMaiz/googlesheet | 89d311df1762ed75d78a1ff466d2277cb6928a4d | [
"MIT"
] | 49 | 2017-12-06T15:27:25.000Z | 2018-06-14T20:00:57.000Z | public/js/googleapis/build/src/apis/toolresults/v1beta3.js | zxcv1884/laravel_smartmirror | 17ad26cffda5e15011f88bef60272e4f5b16840c | [
"MIT"
] | 9 | 2019-08-24T03:02:58.000Z | 2021-06-25T02:02:56.000Z | "use strict";
/**
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var apirequest_1 = require("../../lib/apirequest");
/**
* Cloud Tool Results API
*
* Reads and publishes results from Firebase Test Lab.
*
* @example
* const google = require('googleapis');
* const toolresults = google.toolresults('v1beta3');
*
* @namespace toolresults
* @type {Function}
* @version v1beta3
* @variation v1beta3
* @param {object=} options Options for Toolresults
*/
function Toolresults(options) {
var self = this;
self._options = options || {};
self.projects = {
/**
* toolresults.projects.getSettings
* @desc Gets the Tool Results settings for a project. May return any of
* the following canonical error codes: - PERMISSION_DENIED - if the user
* is not authorized to read from project
* @alias toolresults.projects.getSettings
* @memberOf! toolresults(v1beta3)
*
* @param {object} params Parameters for request
* @param {string} params.projectId A Project id. Required.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
getSettings: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/toolresults/v1beta3/projects/{projectId}/settings')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['projectId'],
pathParams: ['projectId'],
context: self
};
return apirequest_1.createAPIRequest(parameters, callback);
},
initializeSettings: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/toolresults/v1beta3/projects/{projectId}:initializeSettings')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['projectId'],
pathParams: ['projectId'],
context: self
};
return apirequest_1.createAPIRequest(parameters, callback);
},
histories: {
/**
* toolresults.projects.histories.create
* @desc Creates a History. The returned History will have the id set.
* May return any of the following canonical error codes: -
* PERMISSION_DENIED - if the user is not authorized to write to project -
* INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if the
* containing project does not exist
* @alias toolresults.projects.histories.create
* @memberOf! toolresults(v1beta3)
*
* @param {object} params Parameters for request
* @param {string} params.projectId A Project id. Required.
* @param {string=} params.requestId A unique request ID for server to detect duplicated requests. For example, a UUID. Optional, but strongly recommended.
* @param {toolresults(v1beta3).History} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
create: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/toolresults/v1beta3/projects/{projectId}/histories')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['projectId'],
pathParams: ['projectId'],
context: self
};
return apirequest_1.createAPIRequest(parameters, callback);
},
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/toolresults/v1beta3/projects/{projectId}/histories/{historyId}')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['projectId', 'historyId'],
pathParams: ['historyId', 'projectId'],
context: self
};
return apirequest_1.createAPIRequest(parameters, callback);
},
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/toolresults/v1beta3/projects/{projectId}/histories')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['projectId'],
pathParams: ['projectId'],
context: self
};
return apirequest_1.createAPIRequest(parameters, callback);
},
executions: {
/**
* toolresults.projects.histories.executions.create
* @desc Creates an Execution. The returned Execution will have the id
* set. May return any of the following canonical error codes: -
* PERMISSION_DENIED - if the user is not authorized to write to project
* - INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if the
* containing History does not exist
* @alias toolresults.projects.histories.executions.create
* @memberOf! toolresults(v1beta3)
*
* @param {object} params Parameters for request
* @param {string} params.historyId A History id. Required.
* @param {string} params.projectId A Project id. Required.
* @param {string=} params.requestId A unique request ID for server to detect duplicated requests. For example, a UUID. Optional, but strongly recommended.
* @param {toolresults(v1beta3).Execution} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
create: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['projectId', 'historyId'],
pathParams: ['historyId', 'projectId'],
context: self
};
return apirequest_1.createAPIRequest(parameters, callback);
},
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['projectId', 'historyId', 'executionId'],
pathParams: ['executionId', 'historyId', 'projectId'],
context: self
};
return apirequest_1.createAPIRequest(parameters, callback);
},
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['projectId', 'historyId'],
pathParams: ['historyId', 'projectId'],
context: self
};
return apirequest_1.createAPIRequest(parameters, callback);
},
patch: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'PATCH'
}, options),
params: params,
requiredParams: ['projectId', 'historyId', 'executionId'],
pathParams: ['executionId', 'historyId', 'projectId'],
context: self
};
return apirequest_1.createAPIRequest(parameters, callback);
},
clusters: {
/**
* toolresults.projects.histories.executions.clusters.get
* @desc Retrieves a single screenshot cluster by its ID
* @alias toolresults.projects.histories.executions.clusters.get
* @memberOf! toolresults(v1beta3)
*
* @param {object} params Parameters for request
* @param {string} params.clusterId A Cluster id Required.
* @param {string} params.executionId An Execution id. Required.
* @param {string} params.historyId A History id. Required.
* @param {string} params.projectId A Project id. Required.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/clusters/{clusterId}')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['projectId', 'historyId', 'executionId', 'clusterId'],
pathParams: ['clusterId', 'executionId', 'historyId', 'projectId'],
context: self
};
return apirequest_1.createAPIRequest(parameters, callback);
},
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/clusters')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['projectId', 'historyId', 'executionId'],
pathParams: ['executionId', 'historyId', 'projectId'],
context: self
};
return apirequest_1.createAPIRequest(parameters, callback);
}
},
steps: {
/**
* toolresults.projects.histories.executions.steps.create
* @desc Creates a Step. The returned Step will have the id set. May
* return any of the following canonical error codes: -
* PERMISSION_DENIED - if the user is not authorized to write to
* project - INVALID_ARGUMENT - if the request is malformed -
* FAILED_PRECONDITION - if the step is too large (more than 10Mib) -
* NOT_FOUND - if the containing Execution does not exist
* @alias toolresults.projects.histories.executions.steps.create
* @memberOf! toolresults(v1beta3)
*
* @param {object} params Parameters for request
* @param {string} params.executionId A Execution id. Required.
* @param {string} params.historyId A History id. Required.
* @param {string} params.projectId A Project id. Required.
* @param {string=} params.requestId A unique request ID for server to detect duplicated requests. For example, a UUID. Optional, but strongly recommended.
* @param {toolresults(v1beta3).Step} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
create: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['projectId', 'historyId', 'executionId'],
pathParams: ['executionId', 'historyId', 'projectId'],
context: self
};
return apirequest_1.createAPIRequest(parameters, callback);
},
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['projectId', 'historyId', 'executionId', 'stepId'],
pathParams: ['executionId', 'historyId', 'projectId', 'stepId'],
context: self
};
return apirequest_1.createAPIRequest(parameters, callback);
},
getPerfMetricsSummary: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfMetricsSummary')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['projectId', 'historyId', 'executionId', 'stepId'],
pathParams: ['executionId', 'historyId', 'projectId', 'stepId'],
context: self
};
return apirequest_1.createAPIRequest(parameters, callback);
},
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['projectId', 'historyId', 'executionId'],
pathParams: ['executionId', 'historyId', 'projectId'],
context: self
};
return apirequest_1.createAPIRequest(parameters, callback);
},
patch: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'PATCH'
}, options),
params: params,
requiredParams: ['projectId', 'historyId', 'executionId', 'stepId'],
pathParams: ['executionId', 'historyId', 'projectId', 'stepId'],
context: self
};
return apirequest_1.createAPIRequest(parameters, callback);
},
publishXunitXmlFiles: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}:publishXunitXmlFiles')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['projectId', 'historyId', 'executionId', 'stepId'],
pathParams: ['executionId', 'historyId', 'projectId', 'stepId'],
context: self
};
return apirequest_1.createAPIRequest(parameters, callback);
},
perfMetricsSummary: {
/**
* toolresults.projects.histories.executions.steps.perfMetricsSummary.create
* @desc Creates a PerfMetricsSummary resource. Returns the existing
* one if it has already been created. May return any of the
* following error code(s): - NOT_FOUND - The containing Step does
* not exist
* @alias
* toolresults.projects.histories.executions.steps.perfMetricsSummary.create
* @memberOf! toolresults(v1beta3)
*
* @param {object} params Parameters for request
* @param {string} params.executionId A tool results execution ID.
* @param {string} params.historyId A tool results history ID.
* @param {string} params.projectId The cloud project
* @param {string} params.stepId A tool results step ID.
* @param {toolresults(v1beta3).PerfMetricsSummary} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
create: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfMetricsSummary')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['projectId', 'historyId', 'executionId', 'stepId'],
pathParams: ['executionId', 'historyId', 'projectId', 'stepId'],
context: self
};
return apirequest_1.createAPIRequest(parameters, callback);
}
},
perfSampleSeries: {
/**
* toolresults.projects.histories.executions.steps.perfSampleSeries.create
* @desc Creates a PerfSampleSeries. May return any of the
* following error code(s): - ALREADY_EXISTS - PerfMetricSummary
* already exists for the given Step - NOT_FOUND - The containing
* Step does not exist
* @alias
* toolresults.projects.histories.executions.steps.perfSampleSeries.create
* @memberOf! toolresults(v1beta3)
*
* @param {object} params Parameters for request
* @param {string} params.executionId A tool results execution ID.
* @param {string} params.historyId A tool results history ID.
* @param {string} params.projectId The cloud project
* @param {string} params.stepId A tool results step ID.
* @param {toolresults(v1beta3).PerfSampleSeries} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
create: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfSampleSeries')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: ['projectId', 'historyId', 'executionId', 'stepId'],
pathParams: ['executionId', 'historyId', 'projectId', 'stepId'],
context: self
};
return apirequest_1.createAPIRequest(parameters, callback);
},
get: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfSampleSeries/{sampleSeriesId}')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: [
'projectId', 'historyId', 'executionId', 'stepId',
'sampleSeriesId'
],
pathParams: [
'executionId', 'historyId', 'projectId', 'sampleSeriesId',
'stepId'
],
context: self
};
return apirequest_1.createAPIRequest(parameters, callback);
},
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfSampleSeries')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['projectId', 'historyId', 'executionId', 'stepId'],
pathParams: ['executionId', 'historyId', 'projectId', 'stepId'],
context: self
};
return apirequest_1.createAPIRequest(parameters, callback);
},
samples: {
/**
* toolresults.projects.histories.executions.steps.perfSampleSeries.samples.batchCreate
* @desc Creates a batch of PerfSamples - a client can submit
* multiple batches of Perf Samples through repeated calls to
* this method in order to split up a large request payload -
* duplicates and existing timestamp entries will be ignored.
* - the batch operation may partially succeed - the set of
* elements successfully inserted is returned in the response
* (omits items which already existed in the database). May
* return any of the following canonical error codes: -
* NOT_FOUND - The containing PerfSampleSeries does not exist
* @alias
* toolresults.projects.histories.executions.steps.perfSampleSeries.samples.batchCreate
* @memberOf! toolresults(v1beta3)
*
* @param {object} params Parameters for request
* @param {string} params.executionId A tool results execution ID.
* @param {string} params.historyId A tool results history ID.
* @param {string} params.projectId The cloud project
* @param {string} params.sampleSeriesId A sample series id
* @param {string} params.stepId A tool results step ID.
* @param {toolresults(v1beta3).BatchCreatePerfSamplesRequest} params.resource Request body data
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
batchCreate: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfSampleSeries/{sampleSeriesId}/samples:batchCreate')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'POST'
}, options),
params: params,
requiredParams: [
'projectId', 'historyId', 'executionId', 'stepId',
'sampleSeriesId'
],
pathParams: [
'executionId', 'historyId', 'projectId',
'sampleSeriesId', 'stepId'
],
context: self
};
return apirequest_1.createAPIRequest(parameters, callback);
},
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfSampleSeries/{sampleSeriesId}/samples')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: [
'projectId', 'historyId', 'executionId', 'stepId',
'sampleSeriesId'
],
pathParams: [
'executionId', 'historyId', 'projectId',
'sampleSeriesId', 'stepId'
],
context: self
};
return apirequest_1.createAPIRequest(parameters, callback);
}
}
},
thumbnails: {
/**
* toolresults.projects.histories.executions.steps.thumbnails.list
* @desc Lists thumbnails of images attached to a step. May return
* any of the following canonical error codes: - PERMISSION_DENIED -
* if the user is not authorized to read from the project, or from
* any of the images - INVALID_ARGUMENT - if the request is
* malformed - NOT_FOUND - if the step does not exist, or if any of
* the images do not exist
* @alias
* toolresults.projects.histories.executions.steps.thumbnails.list
* @memberOf! toolresults(v1beta3)
*
* @param {object} params Parameters for request
* @param {string} params.executionId An Execution id. Required.
* @param {string} params.historyId A History id. Required.
* @param {integer=} params.pageSize The maximum number of thumbnails to fetch. Default value: 50. The server will use this default if the field is not set or has a value of 0. Optional.
* @param {string=} params.pageToken A continuation token to resume the query at the next item. Optional.
* @param {string} params.projectId A Project id. Required.
* @param {string} params.stepId A Step id. Required.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list: function (params, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
options = options || {};
var rootUrl = options.rootUrl || 'https://www.googleapis.com/';
var parameters = {
options: Object.assign({
url: (rootUrl +
'/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/thumbnails')
.replace(/([^:]\/)\/+/g, '$1'),
method: 'GET'
}, options),
params: params,
requiredParams: ['projectId', 'historyId', 'executionId', 'stepId'],
pathParams: ['executionId', 'historyId', 'projectId', 'stepId'],
context: self
};
return apirequest_1.createAPIRequest(parameters, callback);
}
}
}
}
}
};
}
module.exports = Toolresults;
//# sourceMappingURL=v1beta3.js.map | 58.198939 | 212 | 0.429105 |
1e52c185dbe3e2a8dfcfddda497a54b727c28a2f | 652 | js | JavaScript | src/utils/Callable.js | Voltra/lightquery | 567a8595a6025358755a813119ebca15ba3fa4ef | [
"MIT"
] | 3 | 2017-08-30T18:54:30.000Z | 2018-06-07T12:43:21.000Z | src/utils/Callable.js | Voltra/lightquery | 567a8595a6025358755a813119ebca15ba3fa4ef | [
"MIT"
] | 4 | 2020-08-20T07:38:09.000Z | 2020-10-06T16:32:08.000Z | src/utils/Callable.js | Voltra/lightquery | 567a8595a6025358755a813119ebca15ba3fa4ef | [
"MIT"
] | null | null | null | import UnimplementedError from "../errors/UnimplementedError"
//cf. https://hackernoon.com/creating-callable-objects-in-javascript-d21l3te1
class Callable extends Function{
constructor(){
super("return this.__bound.__call.apply(this.__bound, arguments)");
this.__bound = this.bind(this);
return this.__bound; // important to make it work
}
/**
* Code to execute when the callable is invoked
* @private
* @param {...any} ...args - The invokation arguments
* @throws {UnimplementedError} If not implemented
*/
__call(...args){
throw new UnimplementedError("Unimplemented Callable#__call(...args)");
}
}
export default Callable | 28.347826 | 77 | 0.726994 |
1e5345262a006bb237f93a007f464d4796536fee | 36,217 | js | JavaScript | out/_next/static/webpack/pages/index.1e43f16ad2f25d37ed62.hot-update.js | sharath218/sri-global-repo | 475156f7f3d4d8b989d080e428e01b274cd701fd | [
"MIT"
] | null | null | null | out/_next/static/webpack/pages/index.1e43f16ad2f25d37ed62.hot-update.js | sharath218/sri-global-repo | 475156f7f3d4d8b989d080e428e01b274cd701fd | [
"MIT"
] | null | null | null | out/_next/static/webpack/pages/index.1e43f16ad2f25d37ed62.hot-update.js | sharath218/sri-global-repo | 475156f7f3d4d8b989d080e428e01b274cd701fd | [
"MIT"
] | null | null | null | webpackHotUpdate_N_E("pages/index",{
/***/ "./node_modules/css-loader/dist/cjs.js?!./node_modules/next/dist/compiled/postcss-loader/index.js?!./styles/Services.module.css":
/*!***************************************************************************************************************************************************************!*\
!*** ./node_modules/css-loader/dist/cjs.js??ref--5-oneOf-2-1!./node_modules/next/dist/compiled/postcss-loader??__nextjs_postcss!./styles/Services.module.css ***!
\***************************************************************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// Imports
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
exports = ___CSS_LOADER_API_IMPORT___(true);
// Module
exports.push([module.i, ".Services_serviceWrapper__On7G3{\r\n position: relative;\r\n width: 100%;\r\n margin: 0 0;\r\n display: -moz-box;\r\n display: flex;\r\n -moz-box-orient: vertical;\r\n -moz-box-direction: normal;\r\n flex-direction: column;\r\n background-color: #dbebf5;\r\n font-family: 'RobotoDraft', 'Roboto', sans-serif;\r\n -webkit-font-smoothing: antialiased;\r\n text-align: left;\r\n -moz-box-align: center;\r\n align-items: center;\r\n padding: 20px 0px;\r\n overflow: hidden;\r\n border-radius: 4px;\r\n}\r\n.Services_main__2RqhV{\r\n width: 100%;\r\n padding: 20px 20px;\r\n display: grid;\r\n grid-gap: 1em;\r\n grid-template-columns: repeat(auto-fit , 12em);\r\n -moz-box-pack: center;\r\n justify-content: center;\r\n \r\n \r\n overflow: show;\r\n border-radius: 4px;\r\n margin-top: 20px;\r\n \r\n}\r\n.Services_title__2UY7_{\r\n margin: 0;\r\n line-height: 1.15;\r\n font-size: 3rem;\r\n \r\n}\r\n/* .box{\r\n margin-left: 30px;\r\n width: 170px;\r\n height: 180px;\r\n background-color: black;\r\n} */\r\n\r\n\r\n .Services_gradient1__3Ot4Y {\r\n position: absolute;\r\n background: #999955;\r\n background-image: linear-gradient(#DAB046 20%, #D73B25 20%, #D73B25 40%, #C71B25 40%, #C71B25 60%, #961A39 60%, #961A39 80%, #601035 80%);\r\n width: 100%;\r\n height: 90px;\r\n z-index: 0;\r\n transform: rotate(0deg);\r\n margin-top: 10%;\r\n left: -50%;\r\n } \r\n\r\n .Services_gradient2__13oEG {\r\n position: absolute;\r\n background: #999955;\r\n background-image: linear-gradient(#bbe1fa 20%, #3282b8 20%, #3282b8 40%, rgb(7, 93, 160) 40%, rgb(7, 93, 160) 60% , #0f4c75 60%, #0f4c75 80% ,#1b262c 80%);\r\n width: 100%;\r\n height: 90px;\r\n z-index: 0;\r\n transform: rotate(0deg);\r\n margin-top: 25%;\r\n right: -50%;\r\n } \r\n\r\n.Services_h5__1IXhL{\r\n margin-top: 0.5em;\r\n font-size: 1em;\r\n}\r\n.Services_p__3Ybed\r\n{\r\n font-size: 12px;\r\n}\r\n\r\n.Services_center__2E4nb\r\n{\r\n width: 11em;\r\n border-radius: 4px;\r\n margin-top: 10px;\r\n}\r\n\r\n/* End Non-Essential */\r\n\r\n.Services_propertycard__hXNxL\r\n{\r\n height:12em;\r\n width: 100%;\r\n display:-moz-box;\r\n display:flex;\r\n -moz-box-orient:vertical;\r\n -moz-box-direction:normal;\r\n flex-direction:column;\r\n position:relative;\r\n border-radius: 4px;\r\n overflow:hidden;\r\n \r\n}\r\n/* ^-- The margin bottom is necessary for the drop shadow otherwise it gets clipped in certain cases. */\r\n\r\n/* Top Half of card, image. */\r\n\r\n.Services_propertyimage__wJrEY\r\n{\r\n height:14em;\r\n width:12em;\r\n position:Absolute;\r\n top: 0;\r\n left: 0;\r\n transition:all 0.4s cubic-bezier(0.645, 0.045, 0.355, 1);\r\n background-size:cover;\r\n background-repeat:no-repeat;\r\n border-radius: 4px;\r\n}\r\n/* Bottom Card Section */\r\n\r\n.Services_propertydescription__SpBsE\r\n{\r\n background-color: rgb(255, 255, 255);\r\n height:3em;\r\n width:100%;\r\n position:absolute;\r\n bottom:0em;\r\n transition:all 0.4s cubic-bezier(0.645, 0.045, 0.355, 1);\r\n text-align:center;\r\n border-radius: 4px;\r\n border: 0.5px solid rgb(179, 167, 167);\r\n}\r\n\r\n\r\n\r\n/* Property Cards Hover States */\r\n.Services_propertycard__hXNxL:hover{\r\n box-shadow: 0 10px 20px #ccc;\r\n transition:all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);\r\n \r\n}\r\n\r\n\r\n.Services_propertycard__hXNxL:hover .Services_propertydescription__SpBsE\r\n{\r\n height:100%;\r\n width: 100%;\r\n padding:0px 1em;\r\n background-color: white; \r\n border-radius: 4px;\r\n color: black;\r\n font-weight: 700;\r\n \r\n}\r\n.Services_propertycard__hXNxL:hover .Services_propertyimage__wJrEY\r\n{\r\n height:15em;\r\n width: 14em;\r\n filter: blur(7px);\r\n opacity: 0.3;\r\n}\r\n\r\n.Services_propertyimagetitle__2wVUY\r\n{\r\ntext-align:center;\r\nposition:Relative;\r\nopacity:1;\r\ntransition:all 0.4s cubic-bezier(0.645, 0.045, 0.355, 1) 0.2s;\r\ncolor:black;\r\nfont-size:2em;\r\n}\r\n\r\n.Services_propertycard__hXNxL:hover .Services_propertyimagetitle__2wVUY\r\n{\r\nopacity:0;\r\n}\r\n\r\n@media only screen and (max-width: 450px){\r\n .Services_main__2RqhV{\r\n width: 90%;\r\n \r\n grid-template-columns: repeat(auto-fit , 90%);\r\n padding: 25px 0;\r\n }\r\n\r\n .Services_title__2UY7_{\r\n font-size: 2em;\r\n }\r\n .Services_serviceWrapper__On7G3{\r\n text-align: center;\r\n \r\n }\r\n .Services_propertycard__hXNxL{\r\n height: 3em;\r\n width: 100%;\r\n margin-top: 0px;\r\n }\r\n .Services_propertyimage__wJrEY{\r\n width: 100%;\r\n height: 10em;\r\n padding: 0 0;\r\n display: none;\r\n }\r\n .Services_center__2E4nb{\r\n background-color: yellowgreen;\r\n width: 100%;\r\n margin: 0 0;\r\n }\r\n\r\n .Services_h5__1IXhL{\r\n font-size: 1em;\r\n font-weight: normal;\r\n }\r\n}", "",{"version":3,"sources":["D:/Sharath_Code/next/sri-global/styles/Services.module.css"],"names":[],"mappings":"AAAA;EACE,kBAAkB;IAChB,WAAW;IACX,WAAW;IACX,iBAAa;IAAb,aAAa;IACb,yBAAsB;IAAtB,0BAAsB;SAAtB,sBAAsB;IACtB,yBAAyB;IACzB,gDAAgD;IAChD,mCAAmC;IACnC,gBAAgB;IAChB,sBAAmB;SAAnB,mBAAmB;IACnB,iBAAiB;IACjB,gBAAgB;IAChB,kBAAkB;AACtB;AACA;IACI,WAAW;IACX,kBAAkB;IAClB,aAAa;IACb,aAAa;IACb,8CAA8C;IAC9C,qBAAuB;SAAvB,uBAAuB;;;IAGvB,cAAc;IACd,kBAAkB;IAClB,gBAAgB;;AAEpB;AACA;EACE,SAAS;EACT,iBAAiB;EACjB,eAAe;;AAEjB;AACA;;;;;GAKG;;;EAGD;IACE,kBAAkB;IAClB,mBAAmB;IACnB,yIAAyI;IACzI,WAAW;IACX,YAAY;IACZ,UAAU;IACV,uBAAuB;IACvB,eAAe;IACf,UAAU;EACZ;;EAEA;IACE,kBAAkB;IAClB,mBAAmB;IACnB,2JAA2J;IAC3J,WAAW;IACX,YAAY;IACZ,UAAU;IACV,uBAAuB;IACvB,eAAe;IACf,WAAW;EACb;;AAEF;EACE,iBAAiB;EACjB,cAAc;AAChB;AACA;;EAEE,eAAe;AACjB;;AAEA;;EAEE,WAAW;EACX,kBAAkB;EAClB,gBAAgB;AAClB;;AAEA,uBAAuB;;AAEvB;;EAEE,WAAW;EACX,WAAW;EAGX,gBAAY;EAAZ,YAAY;EAIZ,wBAAqB;EAArB,yBAAqB;OAArB,qBAAqB;EACrB,iBAAiB;EACjB,kBAAkB;EAClB,eAAe;;AAEjB;AACA,uGAAuG;;AAEvG,6BAA6B;;AAE7B;;EAEE,WAAW;EACX,UAAU;EACV,iBAAiB;EACjB,MAAM;EACN,OAAO;EAGP,wDAAwD;EACxD,qBAAqB;EACrB,2BAA2B;EAC3B,kBAAkB;AACpB;AACA,wBAAwB;;AAExB;;EAEE,oCAAoC;EACpC,UAAU;EACV,UAAU;EACV,iBAAiB;EACjB,UAAU;EAGV,wDAAwD;EACxD,iBAAiB;EACjB,kBAAkB;EAClB,sCAAsC;AACxC;;;;AAIA,gCAAgC;AAChC;IAEI,6BAA6B;EAG/B,wDAAwD;;AAE1D;;;AAGA;;EAEE,WAAW;EACX,WAAW;EACX,eAAe;EACf,uBAAuB;EACvB,kBAAkB;EAClB,YAAY;EACZ,gBAAgB;;AAElB;AACA;;EAEE,WAAW;EACX,WAAW;EACX,iBAAiB;EACjB,YAAY;AACd;;AAEA;;AAEA,iBAAiB;AACjB,iBAAiB;AACjB,SAAS;AACT,6DAA6D;AAC7D,WAAW;AACX,aAAa;AACb;;AAEA;;AAEA,SAAS;AACT;;AAEA;EACE;IACE,UAAU;;IAEV,6CAA6C;IAC7C,eAAe;EACjB;;EAEA;IACE,cAAc;EAChB;EACA;IACE,kBAAkB;;EAEpB;EACA;IACE,WAAW;IACX,WAAW;IACX,eAAe;EACjB;EACA;IACE,WAAW;IACX,YAAY;IACZ,YAAY;IACZ,aAAa;EACf;EACA;KACG,6BAA6B;IAC9B,WAAW;IACX,WAAW;EACb;;EAEA;KACG,cAAc;KACd,mBAAmB;EACtB;AACF","file":"Services.module.css","sourcesContent":[".serviceWrapper{\r\n position: relative;\r\n width: 100%;\r\n margin: 0 0;\r\n display: flex;\r\n flex-direction: column;\r\n background-color: #dbebf5;\r\n font-family: 'RobotoDraft', 'Roboto', sans-serif;\r\n -webkit-font-smoothing: antialiased;\r\n text-align: left;\r\n align-items: center;\r\n padding: 20px 0px;\r\n overflow: hidden;\r\n border-radius: 4px;\r\n}\r\n.main{\r\n width: 100%;\r\n padding: 20px 20px;\r\n display: grid;\r\n grid-gap: 1em;\r\n grid-template-columns: repeat(auto-fit , 12em);\r\n justify-content: center;\r\n \r\n \r\n overflow: show;\r\n border-radius: 4px;\r\n margin-top: 20px;\r\n \r\n}\r\n.title{\r\n margin: 0;\r\n line-height: 1.15;\r\n font-size: 3rem;\r\n \r\n}\r\n/* .box{\r\n margin-left: 30px;\r\n width: 170px;\r\n height: 180px;\r\n background-color: black;\r\n} */\r\n\r\n\r\n .gradient1 {\r\n position: absolute;\r\n background: #999955;\r\n background-image: linear-gradient(#DAB046 20%, #D73B25 20%, #D73B25 40%, #C71B25 40%, #C71B25 60%, #961A39 60%, #961A39 80%, #601035 80%);\r\n width: 100%;\r\n height: 90px;\r\n z-index: 0;\r\n transform: rotate(0deg);\r\n margin-top: 10%;\r\n left: -50%;\r\n } \r\n\r\n .gradient2 {\r\n position: absolute;\r\n background: #999955;\r\n background-image: linear-gradient(#bbe1fa 20%, #3282b8 20%, #3282b8 40%, rgb(7, 93, 160) 40%, rgb(7, 93, 160) 60% , #0f4c75 60%, #0f4c75 80% ,#1b262c 80%);\r\n width: 100%;\r\n height: 90px;\r\n z-index: 0;\r\n transform: rotate(0deg);\r\n margin-top: 25%;\r\n right: -50%;\r\n } \r\n\r\n.h5{\r\n margin-top: 0.5em;\r\n font-size: 1em;\r\n}\r\n.p\r\n{\r\n font-size: 12px;\r\n}\r\n\r\n.center\r\n{\r\n width: 11em;\r\n border-radius: 4px;\r\n margin-top: 10px;\r\n}\r\n\r\n/* End Non-Essential */\r\n\r\n.propertycard\r\n{\r\n height:12em;\r\n width: 100%;\r\n display:-webkit-box;\r\n display:-ms-flexbox;\r\n display:flex;\r\n -webkit-box-orient:vertical;\r\n -webkit-box-direction:normal;\r\n -ms-flex-direction:column;\r\n flex-direction:column;\r\n position:relative;\r\n border-radius: 4px;\r\n overflow:hidden;\r\n \r\n}\r\n/* ^-- The margin bottom is necessary for the drop shadow otherwise it gets clipped in certain cases. */\r\n\r\n/* Top Half of card, image. */\r\n\r\n.propertyimage\r\n{\r\n height:14em;\r\n width:12em;\r\n position:Absolute;\r\n top: 0;\r\n left: 0;\r\n -webkit-transition:all 0.4s cubic-bezier(0.645, 0.045, 0.355, 1);\r\n -o-transition:all 0.4s cubic-bezier(0.645, 0.045, 0.355, 1);\r\n transition:all 0.4s cubic-bezier(0.645, 0.045, 0.355, 1);\r\n background-size:cover;\r\n background-repeat:no-repeat;\r\n border-radius: 4px;\r\n}\r\n/* Bottom Card Section */\r\n\r\n.propertydescription\r\n{\r\n background-color: rgb(255, 255, 255);\r\n height:3em;\r\n width:100%;\r\n position:absolute;\r\n bottom:0em;\r\n -webkit-transition:all 0.4s cubic-bezier(0.645, 0.045, 0.355, 1);\r\n -o-transition:all 0.4s cubic-bezier(0.645, 0.045, 0.355, 1);\r\n transition:all 0.4s cubic-bezier(0.645, 0.045, 0.355, 1);\r\n text-align:center;\r\n border-radius: 4px;\r\n border: 0.5px solid rgb(179, 167, 167);\r\n}\r\n\r\n\r\n\r\n/* Property Cards Hover States */\r\n.propertycard:hover{\r\n -webkit-box-shadow: 0 10px 20px #ccc;\r\n box-shadow: 0 10px 20px #ccc;\r\n -webkit-transition:all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);\r\n -o-transition:all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);\r\n transition:all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);\r\n \r\n}\r\n\r\n\r\n.propertycard:hover .propertydescription\r\n{\r\n height:100%;\r\n width: 100%;\r\n padding:0px 1em;\r\n background-color: white; \r\n border-radius: 4px;\r\n color: black;\r\n font-weight: 700;\r\n \r\n}\r\n.propertycard:hover .propertyimage\r\n{\r\n height:15em;\r\n width: 14em;\r\n filter: blur(7px);\r\n opacity: 0.3;\r\n}\r\n\r\n.propertyimagetitle\r\n{\r\ntext-align:center;\r\nposition:Relative;\r\nopacity:1;\r\ntransition:all 0.4s cubic-bezier(0.645, 0.045, 0.355, 1) 0.2s;\r\ncolor:black;\r\nfont-size:2em;\r\n}\r\n\r\n.propertycard:hover .propertyimagetitle\r\n{\r\nopacity:0;\r\n}\r\n\r\n@media only screen and (max-width: 450px){\r\n .main{\r\n width: 90%;\r\n \r\n grid-template-columns: repeat(auto-fit , 90%);\r\n padding: 25px 0;\r\n }\r\n\r\n .title{\r\n font-size: 2em;\r\n }\r\n .serviceWrapper{\r\n text-align: center;\r\n \r\n }\r\n .propertycard{\r\n height: 3em;\r\n width: 100%;\r\n margin-top: 0px;\r\n }\r\n .propertyimage{\r\n width: 100%;\r\n height: 10em;\r\n padding: 0 0;\r\n display: none;\r\n }\r\n .center{\r\n background-color: yellowgreen;\r\n width: 100%;\r\n margin: 0 0;\r\n }\r\n\r\n .h5{\r\n font-size: 1em;\r\n font-weight: normal;\r\n }\r\n}"]}]);
// Exports
exports.locals = {
"serviceWrapper": "Services_serviceWrapper__On7G3",
"main": "Services_main__2RqhV",
"title": "Services_title__2UY7_",
"gradient1": "Services_gradient1__3Ot4Y",
"gradient2": "Services_gradient2__13oEG",
"h5": "Services_h5__1IXhL",
"p": "Services_p__3Ybed",
"center": "Services_center__2E4nb",
"propertycard": "Services_propertycard__hXNxL",
"propertyimage": "Services_propertyimage__wJrEY",
"propertydescription": "Services_propertydescription__SpBsE",
"propertyimagetitle": "Services_propertyimagetitle__2wVUY"
};
module.exports = exports;
/***/ })
})
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9fTl9FLy4vc3R5bGVzL1NlcnZpY2VzLm1vZ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BcIlNlcnZpY2VzX3Byb3BlcnR5ZGVzY3JpcHRpb25fX1NwQnNFXCIsXG5cdFwicHJvcGVydHlpbWFnZXRpdGxlXCI6IFwiU2VydmljZXNfcHJvcGVydHlpbWFnZXRpdGxlX18yd1ZVWVwiXG59O1xubW9kdWxlLmV4cG9ydHMgPSBleHBvcnRzO1xuIl0sInNvdXJjZVJvb3QiOiIifQ== | 1,006.027778 | 22,832 | 0.874617 |
1e536705b6b2e47e9d5ca6223cc8233c9f48df56 | 450 | js | JavaScript | src/app.js | AustinArrington87/aws-lambda-graphql | 211e1fadddb5bf1019690ac77d6b9a552cb24fe4 | [
"MIT"
] | null | null | null | src/app.js | AustinArrington87/aws-lambda-graphql | 211e1fadddb5bf1019690ac77d6b9a552cb24fe4 | [
"MIT"
] | null | null | null | src/app.js | AustinArrington87/aws-lambda-graphql | 211e1fadddb5bf1019690ac77d6b9a552cb24fe4 | [
"MIT"
] | null | null | null | 'use strict';
const express = require('express');
const body_parser = require('body-parser');
const expressGraphQL = require('express-graphql');
// let's import the schema file we just created
const GraphQLSchema = require('./graphql/schema');
const app = express();
app.use( body_parser.json({ limit: '50mb' }) );
app.use(
'/',
expressGraphQL( () => {
return {
graphiql: true,
schema: GraphQLSchema
}
})
);
module.exports = app; | 17.307692 | 50 | 0.666667 |
1e53c9f0f6a23f9ac58045c7aae6180d86152ca7 | 144 | js | JavaScript | src/Components/TitlesHomePage/TitlePrimary.js | AhmadRFC/Pingy | 3708bdfc569e898d72409fb54290645326e2a0ea | [
"MIT"
] | null | null | null | src/Components/TitlesHomePage/TitlePrimary.js | AhmadRFC/Pingy | 3708bdfc569e898d72409fb54290645326e2a0ea | [
"MIT"
] | null | null | null | src/Components/TitlesHomePage/TitlePrimary.js | AhmadRFC/Pingy | 3708bdfc569e898d72409fb54290645326e2a0ea | [
"MIT"
] | null | null | null | const TitlePrimary = () => {
return (
<h1 className="title title--primary">Welcome to Pingy</h1>
);
}
export default TitlePrimary;
| 18 | 66 | 0.638889 |
1e53f741993123650fbb9dfc7c66c14ead04d2f7 | 491 | js | JavaScript | site/static/build/paths.js | cjdibbs/Blog | bf4da12f014e788d3c4366de44812d9bdc4761ef | [
"BSD-3-Clause"
] | null | null | null | site/static/build/paths.js | cjdibbs/Blog | bf4da12f014e788d3c4366de44812d9bdc4761ef | [
"BSD-3-Clause"
] | 3 | 2016-06-02T00:00:40.000Z | 2016-09-22T14:58:40.000Z | site/static/build/paths.js | cjdibbs/Blog | bf4da12f014e788d3c4366de44812d9bdc4761ef | [
"BSD-3-Clause"
] | null | null | null | var appRoot = 'src/';
var outputRoot = 'dist/';
var exporSrvtRoot = 'export/'
module.exports = {
root: appRoot,
source: appRoot + '**/*.ts',
html: appRoot + '**/*.html',
css: 'styles/**/*.scss',
style: 'styles/**/*.scss',
output: outputRoot,
exportSrv: exporSrvtRoot,
doc: './doc',
e2eSpecsSrc: 'test/e2e/src/**/*.ts',
e2eSpecsDist: 'test/e2e/dist/',
dtsSrc: [
'./typings/browser/**/*.d.ts',
'./custom_typings/**/*.d.ts',
'./jspm_packages/**/*.d.ts'
]
}
| 22.318182 | 38 | 0.570265 |
1e5415e2927e83ed6c8a09dfdeda5de97b538a00 | 487 | js | JavaScript | src/tests/components/ExpenseList.test.js | protatodev/expensify-app | d9f79d632cfaf4040253b9aa2640f061876186fb | [
"MIT"
] | null | null | null | src/tests/components/ExpenseList.test.js | protatodev/expensify-app | d9f79d632cfaf4040253b9aa2640f061876186fb | [
"MIT"
] | null | null | null | src/tests/components/ExpenseList.test.js | protatodev/expensify-app | d9f79d632cfaf4040253b9aa2640f061876186fb | [
"MIT"
] | null | null | null | import React from 'react';
import { shallow } from 'enzyme';
import { ExpenseList } from '../../components/ExpenseList';
import expenses from '../fixtures/expenses';
test('should render ExpenseList with expenses', () => {
const wrapper = shallow(<ExpenseList expenses={expenses} />);
expect(wrapper).toMatchSnapshot();
});
test('should render ExpenseList with empty message', () => {
const wrapper = shallow(<ExpenseList expenses={[]}/>);
expect(wrapper).toMatchSnapshot();
}); | 34.785714 | 63 | 0.700205 |
1e54d2e5695482b1554fed80f1842538bfc00b65 | 772 | js | JavaScript | src/components/Column/index.js | andrey-gnl/mkdev | 2474e74857336bb4609fa90712a57d806ac21fb7 | [
"MIT"
] | 1 | 2017-08-25T11:50:52.000Z | 2017-08-25T11:50:52.000Z | src/components/Column/index.js | andrey-gnl/mkdev | 2474e74857336bb4609fa90712a57d806ac21fb7 | [
"MIT"
] | null | null | null | src/components/Column/index.js | andrey-gnl/mkdev | 2474e74857336bb4609fa90712a57d806ac21fb7 | [
"MIT"
] | null | null | null | import React, { Component } from 'react'
import { DropTarget } from 'react-dnd'
import { TYPES } from '../../constants'
import ColumnClean from './columClean'
const columnTarget = {
drop(props, monitor) {
const item = monitor.getItem()
if (Number(item.status) !== Number(props.status)) {
props.onDrop(item.id, props.status)
}
}
}
function collect(connect, monitor) {
return {
connectDropTarget: connect.dropTarget(),
isOver: monitor.isOver()
}
}
@DropTarget(TYPES.CARD, columnTarget, collect)
export default class Column extends Component {
render() {
const { connectDropTarget, ...rest } = this.props
return connectDropTarget(
<div className="column-wrap">
<ColumnClean {...rest} />
</div>
)
}
}
| 22.057143 | 55 | 0.648964 |
1e5550c9e38d7a205c06819ce68f716f6a2db959 | 56,385 | js | JavaScript | nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-table.js | trkurc/nifi | ba5b1d837ce57f14a13dcd9cd0a18575bca79bd4 | [
"Apache-2.0"
] | null | null | null | nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-table.js | trkurc/nifi | ba5b1d837ce57f14a13dcd9cd0a18575bca79bd4 | [
"Apache-2.0"
] | null | null | null | nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/provenance/nf-provenance-table.js | trkurc/nifi | ba5b1d837ce57f14a13dcd9cd0a18575bca79bd4 | [
"Apache-2.0"
] | 4 | 2015-12-01T15:23:21.000Z | 2021-12-30T04:34:09.000Z | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* global nf, top, Slick */
nf.ProvenanceTable = (function () {
/**
* Configuration object used to hold a number of configuration items.
*/
var config = {
maxResults: 1000,
defaultStartTime: '00:00:00',
defaultEndTime: '23:59:59',
filterText: 'Filter',
styles: {
filterList: 'provenance-filter-list',
hidden: 'hidden'
},
urls: {
searchOptions: '../nifi-api/controller/provenance/search-options',
replays: '../nifi-api/controller/provenance/replays',
provenance: '../nifi-api/controller/provenance',
cluster: '../nifi-api/cluster',
d3Script: 'js/d3/d3.min.js',
lineageScript: 'js/nf/provenance/nf-provenance-lineage.js'
}
};
/**
* The last search performed
*/
var cachedQuery = {};
/**
* Loads the lineage capabilities when the current browser supports SVG.
*/
var loadLineageCapabilities = function () {
return $.Deferred(function (deferred) {
if (nf.Common.SUPPORTS_SVG) {
nf.Common.cachedScript(config.urls.d3Script).done(function () {
nf.Common.cachedScript(config.urls.lineageScript).done(function () {
// initialize the lineage graph
nf.ProvenanceLineage.init();
deferred.resolve();
}).fail(function () {
deferred.reject();
});
}).fail(function () {
deferred.reject();
});
} else {
deferred.resolve();
}
}).promise();
};
/**
* Returns whether a content viewer has been configured.
*
* @returns {boolean}
*/
var isContentViewConfigured = function () {
var contentViewerUrl = $('#nifi-content-viewer-url').text();
return !nf.Common.isBlank(contentViewerUrl);
};
/**
* Downloads the content for the provenance event that is currently loaded in the specified direction.
*
* @param {string} direction
*/
var downloadContent = function (direction) {
var eventId = $('#provenance-event-id').text();
// build the url
var url = config.urls.provenance + '/events/' + encodeURIComponent(eventId) + '/content/' + encodeURIComponent(direction);
// conditionally include the cluster node id
var clusterNodeId = $('#provenance-event-cluster-node-id').text();
if (!nf.Common.isBlank(clusterNodeId)) {
window.open(url + '?' + $.param({
'clusterNodeId': clusterNodeId
}));
} else {
window.open(url);
}
};
/**
* Views the content for the provenance event that is currently loaded in the specified direction.
*
* @param {string} direction
*/
var viewContent = function (direction) {
var controllerUri = $('#nifi-controller-uri').text();
var eventId = $('#provenance-event-id').text();
// build the uri to the data
var dataUri = controllerUri + '/provenance/events/' + encodeURIComponent(eventId) + '/content/' + encodeURIComponent(direction);
// conditionally include the cluster node id
var clusterNodeId = $('#provenance-event-cluster-node-id').text();
if (!nf.Common.isBlank(clusterNodeId)) {
var parameters = {
'clusterNodeId': clusterNodeId
};
dataUri = dataUri + '?' + $.param(parameters);
}
// open the content viewer
var contentViewerUrl = $('#nifi-content-viewer-url').text();
// if there's already a query string don't add another ?... this assumes valid
// input meaning that if the url has already included a ? it also contains at
// least one query parameter
if (contentViewerUrl.indexOf('?') === -1) {
contentViewerUrl += '?';
} else {
contentViewerUrl += '&';
}
// open the content viewer
window.open(contentViewerUrl + $.param({
'ref': dataUri
}));
};
/**
* Initializes the details dialog.
*/
var initDetailsDialog = function () {
// initialize the properties tabs
$('#event-details-tabs').tabbs({
tabStyle: 'tab',
selectedTabStyle: 'selected-tab',
tabs: [{
name: 'Details',
tabContentId: 'event-details-tab-content'
}, {
name: 'Attributes',
tabContentId: 'attributes-tab-content'
}, {
name: 'Content',
tabContentId: 'content-tab-content'
}]
});
$('#event-details-dialog').modal({
headerText: 'Provenance Event',
overlayBackground: false,
buttons: [{
buttonText: 'Ok',
handler: {
click: function () {
$('#event-details-dialog').modal('hide');
}
}
}],
handler: {
close: function () {
// clear the details
$('#additional-provenance-details').empty();
$('#attributes-container').empty();
$('#parent-flowfiles-container').empty();
$('#child-flowfiles-container').empty();
$('#provenance-event-cluster-node-id').text('');
$('#modified-attribute-toggle').removeClass('checkbox-checked').addClass('checkbox-unchecked');
}
}
});
// toggle which attributes are visible
$('#modified-attribute-toggle').on('click', function () {
var unmodifiedAttributes = $('#attributes-container div.attribute-unmodified');
if (unmodifiedAttributes.is(':visible')) {
$('#attributes-container div.attribute-unmodified').hide();
} else {
$('#attributes-container div.attribute-unmodified').show();
}
});
// input download
$('#input-content-download').on('click', function () {
downloadContent('input');
});
// output download
$('#output-content-download').on('click', function () {
downloadContent('output');
});
// if a content viewer url is specified, use it
if (isContentViewConfigured()) {
// input view
$('#input-content-view').on('click', function () {
viewContent('input');
});
// output view
$('#output-content-view').on('click', function () {
viewContent('output');
});
}
// handle the replay and downloading
if (nf.Common.isDFM()) {
// replay
$('#replay-content').on('click', function () {
var parameters = {
eventId: $('#provenance-event-id').text()
};
// conditionally include the cluster node id
var clusterNodeId = $('#provenance-event-cluster-node-id').text();
if (!nf.Common.isBlank(clusterNodeId)) {
parameters['clusterNodeId'] = clusterNodeId;
}
$.ajax({
type: 'POST',
url: config.urls.replays,
data: parameters,
dataType: 'json'
}).done(function (response) {
nf.Dialog.showOkDialog({
dialogContent: 'Successfully submitted replay request.',
overlayBackground: false
});
}).fail(nf.Common.handleAjaxError);
$('#event-details-dialog').modal('hide');
});
// show the replay panel
$('#replay-details').show();
}
};
/**
* Initializes the search dialog.
*
* @param {boolean} isClustered Whether or not this NiFi clustered
*/
var initSearchDialog = function (isClustered) {
// configure the start and end date picker
$('#provenance-search-start-date, #provenance-search-end-date').datepicker({
showAnim: '',
showOtherMonths: true,
selectOtherMonths: true
});
// initialize the default start date/time
$('#provenance-search-start-date').datepicker('setDate', '+0d');
$('#provenance-search-end-date').datepicker('setDate', '+0d');
$('#provenance-search-start-time').val('00:00:00');
$('#provenance-search-end-time').val('23:59:59');
// initialize the default file sizes
$('#provenance-search-minimum-file-size').val('');
$('#provenance-search-maximum-file-size').val('');
// allow users to be able to search a specific node
if (isClustered) {
// make the dialog larger to support the select location
$('#provenance-search-dialog').height(575);
// get the nodes in the cluster
$.ajax({
type: 'GET',
url: config.urls.cluster,
dataType: 'json'
}).done(function (response) {
var cluster = response.cluster;
var nodes = cluster.nodes;
// create the searchable options
var searchableOptions = [{
text: 'cluster',
value: null
}];
// sort the nodes
nodes.sort(function (a, b) {
var compA = (a.address + ':' + a.apiPort).toUpperCase();
var compB = (b.address + ':' + b.apiPort).toUpperCase();
return (compA < compB) ? -1 : (compA > compB) ? 1 : 0;
});
// add each node
$.each(nodes, function (_, node) {
searchableOptions.push({
text: node.address + ':' + node.apiPort,
value: node.nodeId
});
});
// populate the combo
$('#provenance-search-location').combo({
options: searchableOptions
});
}).fail(nf.Common.handleAjaxError);
// show the node search combo
$('#provenance-search-location-container').show();
}
// configure the search dialog
$('#provenance-search-dialog').modal({
headerText: 'Search Events',
overlayBackground: false,
buttons: [{
buttonText: 'Search',
handler: {
click: function () {
$('#provenance-search-dialog').modal('hide');
var search = {};
// extract the start date time
var startDate = $.trim($('#provenance-search-start-date').val());
var startTime = $.trim($('#provenance-search-start-time').val());
if (startDate !== '') {
if (startTime === '') {
startTime = config.defaultStartTime;
$('#provenance-search-start-time').val(startTime);
}
search['startDate'] = startDate + ' ' + startTime;
}
// extract the end date time
var endDate = $.trim($('#provenance-search-end-date').val());
var endTime = $.trim($('#provenance-search-end-time').val());
if (endDate !== '') {
if (endTime === '') {
endTime = config.defaultEndTime;
$('#provenance-search-end-time').val(endTime);
}
search['endDate'] = endDate + ' ' + endTime;
}
// extract the min/max file size
var minFileSize = $.trim($('#provenance-search-minimum-file-size').val());
if (minFileSize !== '') {
search['minimumFileSize'] = minFileSize;
}
var maxFileSize = $.trim($('#provenance-search-maximum-file-size').val());
if (maxFileSize !== '') {
search['maximumFileSize'] = maxFileSize;
}
// limit search to a specific node
if (isClustered) {
var searchLocation = $('#provenance-search-location').combo('getSelectedOption');
if (searchLocation.value !== null) {
search['clusterNodeId'] = searchLocation.value;
}
}
// add the search criteria
search = $.extend(getSearchCriteria(), search);
// reload the table
nf.ProvenanceTable.loadProvenanceTable(search);
}
}
}, {
buttonText: 'Cancel',
handler: {
click: function () {
$('#provenance-search-dialog').modal('hide');
}
}
}]
});
return $.ajax({
type: 'GET',
url: config.urls.searchOptions,
dataType: 'json'
}).done(function (response) {
var provenanceOptions = response.provenanceOptions;
// load all searchable fields
$.each(provenanceOptions.searchableFields, function (_, field) {
appendSearchableField(field);
});
});
};
/**
* Initializes the provenance query dialog.
*/
var initProvenanceQueryDialog = function () {
// initialize the progress bar
$('#provenance-percent-complete').progressbar();
// initialize the dialog
$('#provenance-query-dialog').modal({
headerText: 'Searching provenance events...',
overlayBackground: false,
handler: {
close: function () {
// reset the progress bar
var provenanceProgressBar = $('#provenance-percent-complete');
provenanceProgressBar.find('div.progress-label').remove();
// update the progress bar
var label = $('<div class="progress-label"></div>').text('0%');
provenanceProgressBar.progressbar('value', 0).append(label);
}
}
});
};
/**
* Appends the specified searchable field to the search dialog.
*
* @param {type} field The searchable field
*/
var appendSearchableField = function (field) {
var searchableField = $('<div class="searchable-field"></div>').appendTo('#searchable-fields-container');
$('<span class="searchable-field-id hidden"></span>').text(field.id).appendTo(searchableField);
$('<div class="searchable-field-name"></div>').text(field.label).appendTo(searchableField);
$('<div class="searchable-field-value"><input type="text" class="searchable-field-input"/></div>').appendTo(searchableField);
$('<div class="clear"></div>').appendTo(searchableField);
// make the component id accessible for populating
if (field.id === 'ProcessorID') {
searchableField.find('input').addClass('searchable-component-id');
}
// ensure the no searchable fields message is hidden
$('#no-searchable-fields').hide();
};
/**
* Gets the search criteria that the user has specified.
*/
var getSearchCriteria = function () {
var searchCriteria = {};
$('#searchable-fields-container').children('div.searchable-field').each(function () {
var searchableField = $(this);
var fieldId = searchableField.children('span.searchable-field-id').text();
var searchValue = $.trim(searchableField.find('input.searchable-field-input').val());
// if the field isn't blank include it in the search
if (!nf.Common.isBlank(searchValue)) {
searchCriteria['search[' + fieldId + ']'] = searchValue;
}
});
return searchCriteria;
};
/**
* Initializes the provenance table.
*
* @param {boolean} isClustered Whether or not this instance is clustered
*/
var initProvenanceTable = function (isClustered) {
// define the function for filtering the list
$('#provenance-filter').keyup(function () {
applyFilter();
}).focus(function () {
if ($(this).hasClass(config.styles.filterList)) {
$(this).removeClass(config.styles.filterList).val('');
}
}).blur(function () {
if ($(this).val() === '') {
$(this).addClass(config.styles.filterList).val(config.filterText);
}
}).addClass(config.styles.filterList).val(config.filterText);
// filter options
var filterOptions = [{
text: 'by component name',
value: 'componentName'
}, {
text: 'by component type',
value: 'componentType'
}, {
text: 'by type',
value: 'eventType'
}];
// if clustered, allowing filtering by node id
if (isClustered) {
filterOptions.push({
text: 'by node',
value: 'clusterNodeAddress'
});
}
// initialize the filter combo
$('#provenance-filter-type').combo({
options: filterOptions,
select: function (option) {
applyFilter();
}
});
// listen for browser resize events to update the page size
$(window).resize(function () {
nf.ProvenanceTable.resetTableSize();
});
// clear the current search
$('#clear-provenance-search').click(function () {
// clear each searchable field
$('#searchable-fields-container').find('input.searchable-field-input').each(function () {
$(this).val('');
});
// reset the default start date/time
$('#provenance-search-start-date').datepicker('setDate', '+0d');
$('#provenance-search-end-date').datepicker('setDate', '+0d');
$('#provenance-search-start-time').val('00:00:00');
$('#provenance-search-end-time').val('23:59:59');
// reset the minimum and maximum file size
$('#provenance-search-minimum-file-size').val('');
$('#provenance-search-maximum-file-size').val('');
// if we are clustered reset the selected option
if (isClustered) {
$('#provenance-search-location').combo('setSelectedOption', {
text: 'cluster'
});
}
// reset the stored query
cachedQuery = {};
// reload the table
nf.ProvenanceTable.loadProvenanceTable();
});
// add hover effect and click handler for opening the dialog
nf.Common.addHoverEffect('#provenance-search-button', 'button-normal', 'button-over').click(function () {
$('#provenance-search-dialog').modal('show');
// adjust the field width for a potential scrollbar
var searchFieldContainer = $('#searchable-fields-container');
if (searchFieldContainer.get(0).scrollHeight > searchFieldContainer.innerHeight()) {
$('input.searchable-field-input').width(245);
} else {
$('input.searchable-field-input').width(260);
}
});
// define a custom formatter for the more details column
var moreDetailsFormatter = function (row, cell, value, columnDef, dataContext) {
return '<img src="images/iconDetails.png" title="View Details" class="pointer show-event-details" style="margin-top: 4px;"/>';
};
// define how general values are formatted
var valueFormatter = function (row, cell, value, columnDef, dataContext) {
return nf.Common.formatValue(value);
};
// determine if the this page is in the shell
var isInShell = (top !== window);
// define how the column is formatted
var showLineageFormatter = function (row, cell, value, columnDef, dataContext) {
var markup = '';
// conditionally include the cluster node id
if (nf.Common.SUPPORTS_SVG) {
markup += '<img src="images/iconLineage.png" title="Show Lineage" class="pointer show-lineage" style="margin-top: 2px;"/>';
}
// conditionally support going to the component
if (isInShell && nf.Common.isDefinedAndNotNull(dataContext.groupId)) {
markup += ' <img src="images/iconGoTo.png" title="Go To" class="pointer go-to" style="margin-top: 2px;"/>';
}
return markup;
};
// initialize the provenance table
var provenanceColumns = [
{id: 'moreDetails', name: ' ', sortable: false, resizable: false, formatter: moreDetailsFormatter, width: 50, maxWidth: 50},
{id: 'eventTime', name: 'Date/Time', field: 'eventTime', sortable: true, defaultSortAsc: false, resizable: true},
{id: 'eventType', name: 'Type', field: 'eventType', sortable: true, resizable: true},
{id: 'flowFileUuid', name: 'FlowFile Uuid', field: 'flowFileUuid', sortable: true, resizable: true},
{id: 'fileSize', name: 'Size', field: 'fileSize', sortable: true, defaultSortAsc: false, resizable: true},
{id: 'componentName', name: 'Component Name', field: 'componentName', sortable: true, resizable: true, formatter: valueFormatter},
{id: 'componentType', name: 'Component Type', field: 'componentType', sortable: true, resizable: true}
];
// conditionally show the cluster node identifier
if (isClustered) {
provenanceColumns.push({id: 'clusterNodeAddress', name: 'Node', field: 'clusterNodeAddress', sortable: true, resizable: true});
}
// conditionally show the action column
if (nf.Common.SUPPORTS_SVG || isInShell) {
provenanceColumns.push({id: 'actions', name: ' ', formatter: showLineageFormatter, resizable: false, sortable: false, width: 50, maxWidth: 50});
}
var provenanceOptions = {
forceFitColumns: true,
enableTextSelectionOnCells: true,
enableCellNavigation: true,
enableColumnReorder: false,
autoEdit: false,
multiSelect: false
};
// create the remote model
var provenanceData = new Slick.Data.DataView({
inlineFilters: false
});
provenanceData.setItems([]);
provenanceData.setFilterArgs({
searchString: '',
property: 'name'
});
provenanceData.setFilter(filter);
// initialize the sort
sort({
columnId: 'eventTime',
sortAsc: false
}, provenanceData);
// initialize the grid
var provenanceGrid = new Slick.Grid('#provenance-table', provenanceData, provenanceColumns, provenanceOptions);
provenanceGrid.setSelectionModel(new Slick.RowSelectionModel());
provenanceGrid.registerPlugin(new Slick.AutoTooltips());
// initialize the grid sorting
provenanceGrid.setSortColumn('eventTime', false);
provenanceGrid.onSort.subscribe(function (e, args) {
sort({
columnId: args.sortCol.field,
sortAsc: args.sortAsc
}, provenanceData);
});
// configure a click listener
provenanceGrid.onClick.subscribe(function (e, args) {
var target = $(e.target);
// get the node at this row
var item = provenanceData.getItem(args.row);
// determine the desired action
if (provenanceGrid.getColumns()[args.cell].id === 'actions') {
if (target.hasClass('show-lineage')) {
nf.ProvenanceLineage.showLineage(item.flowFileUuid, item.eventId.toString(), item.clusterNodeId);
} else if (target.hasClass('go-to')) {
goTo(item);
}
} else if (provenanceGrid.getColumns()[args.cell].id === 'moreDetails') {
if (target.hasClass('show-event-details')) {
nf.ProvenanceTable.showEventDetails(item);
}
}
});
// wire up the dataview to the grid
provenanceData.onRowCountChanged.subscribe(function (e, args) {
provenanceGrid.updateRowCount();
provenanceGrid.render();
// update the total number of displayed events if necessary
$('#displayed-events').text(nf.Common.formatInteger(args.current));
});
provenanceData.onRowsChanged.subscribe(function (e, args) {
provenanceGrid.invalidateRows(args.rows);
provenanceGrid.render();
});
// hold onto an instance of the grid
$('#provenance-table').data('gridInstance', provenanceGrid);
// initialize the number of displayed items
$('#displayed-events').text('0');
$('#total-events').text('0');
};
/**
* Applies the filter found in the filter expression text field.
*/
var applyFilter = function () {
// get the dataview
var provenanceGrid = $('#provenance-table').data('gridInstance');
// ensure the grid has been initialized
if (nf.Common.isDefinedAndNotNull(provenanceGrid)) {
var provenanceData = provenanceGrid.getData();
// update the search criteria
provenanceData.setFilterArgs({
searchString: getFilterText(),
property: $('#provenance-filter-type').combo('getSelectedOption').value
});
provenanceData.refresh();
}
};
/**
* Get the text out of the filter field. If the filter field doesn't
* have any text it will contain the text 'filter list' so this method
* accounts for that.
*/
var getFilterText = function () {
var filterText = '';
var filterField = $('#provenance-filter');
if (!filterField.hasClass(config.styles.filterList)) {
filterText = filterField.val();
}
return filterText;
};
/**
* Performs the provenance filtering.
*
* @param {object} item The item subject to filtering
* @param {object} args Filter arguments
* @returns {Boolean} Whether or not to include the item
*/
var filter = function (item, args) {
if (args.searchString === '') {
return true;
}
try {
// perform the row filtering
var filterExp = new RegExp(args.searchString, 'i');
} catch (e) {
// invalid regex
return false;
}
return item[args.property].search(filterExp) >= 0;
};
/**
* Sorts the data according to the sort details.
*
* @param {type} sortDetails
* @param {type} data
*/
var sort = function (sortDetails, data) {
// defines a function for sorting
var comparer = function (a, b) {
if (sortDetails.columnId === 'eventTime') {
var aTime = nf.Common.parseDateTime(a[sortDetails.columnId]).getTime();
var bTime = nf.Common.parseDateTime(b[sortDetails.columnId]).getTime();
if (aTime === bTime) {
return a['id'] - b['id'];
} else {
return aTime - bTime;
}
} else if (sortDetails.columnId === 'fileSize') {
var aSize = nf.Common.parseSize(a[sortDetails.columnId]);
var bSize = nf.Common.parseSize(b[sortDetails.columnId]);
if (aSize === bSize) {
return a['id'] - b['id'];
} else {
return aSize - bSize;
}
} else {
var aString = nf.Common.isDefinedAndNotNull(a[sortDetails.columnId]) ? a[sortDetails.columnId] : '';
var bString = nf.Common.isDefinedAndNotNull(b[sortDetails.columnId]) ? b[sortDetails.columnId] : '';
if (aString === bString) {
return a['id'] - b['id'];
} else {
return aString === bString ? 0 : aString > bString ? 1 : -1;
}
}
};
// perform the sort
data.sort(comparer, sortDetails.sortAsc);
};
/**
* Submits a new provenance query.
*
* @argument {object} provenance The provenance query
* @returns {deferred}
*/
var submitProvenance = function (provenance) {
return $.ajax({
type: 'POST',
url: config.urls.provenance,
data: $.extend({
maxResults: config.maxResults
}, provenance),
dataType: 'json'
}).fail(nf.Common.handleAjaxError);
};
/**
* Gets the results from the provenance query for the specified id.
*
* @param {object} provenance
* @returns {deferred}
*/
var getProvenance = function (provenance) {
var url = provenance.uri;
if (nf.Common.isDefinedAndNotNull(provenance.clusterNodeId)) {
url += '?' + $.param({
clusterNodeId: provenance.clusterNodeId
});
}
return $.ajax({
type: 'GET',
url: url,
dataType: 'json'
}).fail(nf.Common.handleAjaxError);
};
/**
* Cancels the specified provenance query.
*
* @param {object} provenance
* @return {deferred}
*/
var cancelProvenance = function (provenance) {
var url = provenance.uri;
if (nf.Common.isDefinedAndNotNull(provenance.clusterNodeId)) {
url += '?' + $.param({
clusterNodeId: provenance.clusterNodeId
});
}
return $.ajax({
type: 'DELETE',
url: url,
dataType: 'json'
}).fail(nf.Common.handleAjaxError);
};
/**
* Checks the results of the specified provenance.
*
* @param {object} provenance
*/
var loadProvenanceResults = function (provenance) {
var provenanceRequest = provenance.request;
var provenanceResults = provenance.results;
// ensure there are groups specified
if (nf.Common.isDefinedAndNotNull(provenanceResults.provenanceEvents)) {
var provenanceTable = $('#provenance-table').data('gridInstance');
var provenanceData = provenanceTable.getData();
// set the items
provenanceData.setItems(provenanceResults.provenanceEvents);
provenanceData.reSort();
provenanceTable.invalidate();
// update the stats last refreshed timestamp
$('#provenance-last-refreshed').text(provenanceResults.generated);
// update the oldest event available
$('#oldest-event').html(nf.Common.formatValue(provenanceResults.oldestEvent));
$('#oldest-event-message').show();
// set the timezone for the start and end time
$('.timezone').text(nf.Common.substringAfterLast(provenanceResults.generated, ' '));
// record the server offset
nf.ProvenanceTable.serverTimeOffset = provenanceResults.timeOffset;
// determines if the specified query is blank (no search terms, start or end date)
var isBlankQuery = function (query) {
return nf.Common.isUndefinedOrNull(query.startDate) && nf.Common.isUndefinedOrNull(query.endDate) && $.isEmptyObject(query.searchTerms);
};
// update the filter message based on the request
if (isBlankQuery(provenanceRequest)) {
var message = 'Showing the most recent ';
if (provenanceResults.totalCount > config.maxResults) {
message += (nf.Common.formatInteger(config.maxResults) + ' of ' + provenanceResults.total + ' events, please refine the search.');
} else {
message += ('events.');
}
$('#provenance-query-message').text(message);
$('#clear-provenance-search').hide();
} else {
var message = 'Showing ';
if (provenanceResults.totalCount > config.maxResults) {
message += (nf.Common.formatInteger(config.maxResults) + ' of ' + provenanceResults.total + ' events that match the specified query, please refine the search.');
} else {
message += ('the events that match the specified query.');
}
$('#provenance-query-message').text(message);
$('#clear-provenance-search').show();
}
// update the total number of events
$('#total-events').text(nf.Common.formatInteger(provenanceResults.provenanceEvents.length));
} else {
$('#total-events').text('0');
}
};
/**
* Goes to the specified component if possible.
*
* @argument {object} item The event it
*/
var goTo = function (item) {
// ensure the component is still present in the flow
if (nf.Common.isDefinedAndNotNull(item.groupId)) {
// only attempt this if we're within a frame
if (top !== window) {
// and our parent has canvas utils and shell defined
if (nf.Common.isDefinedAndNotNull(parent.nf) && nf.Common.isDefinedAndNotNull(parent.nf.CanvasUtils) && nf.Common.isDefinedAndNotNull(parent.nf.Shell)) {
parent.nf.CanvasUtils.showComponent(item.groupId, item.componentId);
parent.$('#shell-close-button').click();
}
}
}
};
return {
/**
* The max delay between requests.
*/
MAX_DELAY: 4,
/**
* The server time offset
*/
serverTimeOffset: null,
/**
* Initializes the provenance table. Returns a deferred that will indicate when/if the table has initialized successfully.
*
* @param {boolean} isClustered Whether or not this instance is clustered
*/
init: function (isClustered) {
return $.Deferred(function (deferred) {
// handles init failure
var failure = function (xhr, status, error) {
deferred.reject();
nf.Common.handleAjaxError(xhr, status, error);
};
// load the lineage capabilities
loadLineageCapabilities().done(function () {
initDetailsDialog();
initProvenanceQueryDialog();
initProvenanceTable(isClustered);
initSearchDialog(isClustered).done(function () {
deferred.resolve();
}).fail(failure);
}).fail(failure);
}).promise();
},
/**
* Update the size of the grid based on its container's current size.
*/
resetTableSize: function () {
var provenanceGrid = $('#provenance-table').data('gridInstance');
if (nf.Common.isDefinedAndNotNull(provenanceGrid)) {
provenanceGrid.resizeCanvas();
}
},
/**
* Updates the value of the specified progress bar.
*
* @param {jQuery} progressBar
* @param {integer} value
* @returns {undefined}
*/
updateProgress: function (progressBar, value) {
// remove existing labels
progressBar.find('div.progress-label').remove();
// update the progress bar
var label = $('<div class="progress-label"></div>').text(value + '%');
if (value > 0) {
label.css('margin-top', '-19px');
}
progressBar.progressbar('value', value).append(label);
},
/**
* Loads the provenance table with events according to the specified optional
* query. If not query is specified or it is empty, the most recent entries will
* be returned.
*
* @param {type} query
*/
loadProvenanceTable: function (query) {
var provenanceProgress = $('#provenance-percent-complete');
// add support to cancel outstanding requests - when the button is pressed we
// could be in one of two stages, 1) waiting to GET the status or 2)
// in the process of GETting the status. Handle both cases by cancelling
// the setTimeout (1) and by setting a flag to indicate that a request has
// been request so we can ignore the results (2).
var cancelled = false;
var provenance = null;
var provenanceTimer = null;
// update the progress bar value
nf.ProvenanceTable.updateProgress(provenanceProgress, 0);
// show the 'searching...' dialog
$('#provenance-query-dialog').modal('setButtonModel', [{
buttonText: 'Cancel',
handler: {
click: function () {
cancelled = true;
// we are waiting for the next poll attempt
if (provenanceTimer !== null) {
// cancel it
clearTimeout(provenanceTimer);
// cancel the provenance
closeDialog();
}
}
}
}]).modal('show');
// -----------------------------
// determine the provenance query
// -----------------------------
// handle the specified query appropriately
if (nf.Common.isDefinedAndNotNull(query)) {
// store the last query performed
cachedQuery = query;
} else if (!$.isEmptyObject(cachedQuery)) {
// use the last query performed
query = cachedQuery;
} else {
// don't use a query
query = {};
}
// closes the searching dialog and cancels the query on the server
var closeDialog = function () {
// cancel the provenance results since we've successfully processed the results
if (nf.Common.isDefinedAndNotNull(provenance)) {
cancelProvenance(provenance);
}
// close the dialog
$('#provenance-query-dialog').modal('hide');
};
// polls the server for the status of the provenance, if the provenance is not
// done wait nextDelay seconds before trying again
var pollProvenance = function (nextDelay) {
getProvenance(provenance).done(function (response) {
// update the provenance
provenance = response.provenance;
// process the provenance
processProvenanceResponse(nextDelay);
}).fail(closeDialog);
};
// processes the provenance, if the provenance is not done wait delay
// before polling again
var processProvenanceResponse = function (delay) {
// if the request was cancelled just ignore the current response
if (cancelled === true) {
closeDialog();
return;
}
// update the percent complete
nf.ProvenanceTable.updateProgress(provenanceProgress, provenance.percentCompleted);
// process the results if they are finished
if (provenance.finished === true) {
// show any errors when the query finishes
if (!nf.Common.isEmpty(provenance.results.errors)) {
var errors = provenance.results.errors;
nf.Dialog.showOkDialog({
dialogContent: nf.Common.formatUnorderedList(errors),
overlayBackground: false
});
}
// process the results
loadProvenanceResults(provenance);
// hide the dialog
closeDialog();
} else {
// start the wait to poll again
provenanceTimer = setTimeout(function () {
// clear the timer since we've been invoked
provenanceTimer = null;
// calculate the next delay (back off)
var backoff = delay * 2;
var nextDelay = backoff > nf.ProvenanceTable.MAX_DELAY ? nf.ProvenanceTable.MAX_DELAY : backoff;
// poll provenance
pollProvenance(nextDelay);
}, delay * 1000);
}
};
// once the query is submitted wait until its finished
submitProvenance(query).done(function (response) {
// update the provenance
provenance = response.provenance;
// process the results, if they are not done wait 1 second before trying again
processProvenanceResponse(1);
}).fail(closeDialog);
},
/**
* Shows the details for the specified action.
*
* @param {object} event
*/
showEventDetails: function (event) {
// update the event details
$('#provenance-event-id').text(event.eventId);
$('#provenance-event-time').html(nf.Common.formatValue(event.eventTime)).ellipsis();
$('#provenance-event-type').html(nf.Common.formatValue(event.eventType)).ellipsis();
$('#provenance-event-flowfile-uuid').html(nf.Common.formatValue(event.flowFileUuid)).ellipsis();
$('#provenance-event-component-id').html(nf.Common.formatValue(event.componentId)).ellipsis();
$('#provenance-event-component-name').html(nf.Common.formatValue(event.componentName)).ellipsis();
$('#provenance-event-component-type').html(nf.Common.formatValue(event.componentType)).ellipsis();
$('#provenance-event-details').html(nf.Common.formatValue(event.details)).ellipsis();
// over the default tooltip with the actual byte count
var fileSize = $('#provenance-event-file-size').html(nf.Common.formatValue(event.fileSize)).ellipsis();
fileSize.attr('title', nf.Common.formatInteger(event.fileSizeBytes) + ' bytes');
// sets an duration
var setDuration = function (field, value) {
if (nf.Common.isDefinedAndNotNull(value)) {
if (value === 0) {
field.text('< 1ms');
} else {
field.text(nf.Common.formatDuration(value));
}
} else {
field.html('<span class="unset">No value set</span>');
}
};
// handle durations
setDuration($('#provenance-event-duration'), event.eventDuration);
setDuration($('#provenance-lineage-duration'), event.lineageDuration);
// formats an event detail
var formatEventDetail = function (label, value) {
$('<div class="event-detail"></div>').append(
$('<div class="detail-name"></div>').text(label)).append(
$('<div class="detail-value">' + nf.Common.formatValue(value) + '</div>').ellipsis()).append(
$('<div class="clear"></div>')).appendTo('#additional-provenance-details');
};
// conditionally show RECEIVE details
if (event.eventType === 'RECEIVE') {
formatEventDetail('Source FlowFile Id', event.sourceSystemFlowFileId);
formatEventDetail('Transit Uri', event.transitUri);
}
// conditionally show SEND details
if (event.eventType === 'SEND') {
formatEventDetail('Transit Uri', event.transitUri);
}
// conditionally show ADDINFO details
if (event.eventType === 'ADDINFO') {
formatEventDetail('Alternate Identifier Uri', event.alternateIdentifierUri);
}
// conditionally show ROUTE details
if (event.eventType === 'ROUTE') {
formatEventDetail('Relationship', event.relationship);
}
// conditionally show the cluster node identifier
if (nf.Common.isDefinedAndNotNull(event.clusterNodeId)) {
// save the cluster node id
$('#provenance-event-cluster-node-id').text(event.clusterNodeId);
// render the cluster node address
formatEventDetail('Node Address', event.clusterNodeAddress);
}
// populate the parent/child flowfile uuids
var parentUuids = $('#parent-flowfiles-container');
var childUuids = $('#child-flowfiles-container');
// handle parent flowfiles
if (nf.Common.isEmpty(event.parentUuids)) {
$('#parent-flowfile-count').text(0);
parentUuids.append('<span class="unset">No parents</span>');
} else {
$('#parent-flowfile-count').text(event.parentUuids.length);
$.each(event.parentUuids, function (_, uuid) {
$('<div></div>').text(uuid).appendTo(parentUuids);
});
}
// handle child flowfiles
if (nf.Common.isEmpty(event.childUuids)) {
$('#child-flowfile-count').text(0);
childUuids.append('<span class="unset">No children</span>');
} else {
$('#child-flowfile-count').text(event.childUuids.length);
$.each(event.childUuids, function (_, uuid) {
$('<div></div>').text(uuid).appendTo(childUuids);
});
}
// get the attributes container
var attributesContainer = $('#attributes-container');
// get any action details
$.each(event.attributes, function (_, attribute) {
// create the attribute record
var attributeRecord = $('<div class="attribute-detail"></div>')
.append($('<div class="attribute-name">' + nf.Common.formatValue(attribute.name) + '</div>').ellipsis())
.appendTo(attributesContainer);
// add the current value
attributeRecord
.append($('<div class="attribute-value">' + nf.Common.formatValue(attribute.value) + '</div>').ellipsis())
.append('<div class="clear"></div>');
// show the previous value if the property has changed
if (attribute.value !== attribute.previousValue) {
attributeRecord
.append('<div class="modified-attribute-label">previous</div>')
.append($('<div class="modified-attribute-value">' + nf.Common.formatValue(attribute.previousValue) + '</div>').ellipsis())
.append('<div class="clear"></div>');
} else {
// mark this attribute as not modified
attributeRecord.addClass('attribute-unmodified');
}
});
var formatContentValue = function (element, value) {
if (nf.Common.isDefinedAndNotNull(value)) {
element.removeClass('unset').text(value);
} else {
element.addClass('unset').text('No value set');
}
};
// content
if (event.contentEqual === true) {
$('#output-content-details').hide();
$('#input-content-header').text('Claim');
formatContentValue($('#input-content-container'), event.inputContentClaimContainer);
formatContentValue($('#input-content-section'), event.inputContentClaimSection);
formatContentValue($('#input-content-identifier'), event.inputContentClaimIdentifier);
formatContentValue($('#input-content-offset'), event.inputContentClaimOffset);
formatContentValue($('#input-content-bytes'), event.inputContentClaimFileSizeBytes);
// input content file size
var inputContentSize = $('#input-content-size');
formatContentValue(inputContentSize, event.inputContentClaimFileSize);
if (nf.Common.isDefinedAndNotNull(event.inputContentClaimFileSize)) {
// over the default tooltip with the actual byte count
inputContentSize.attr('title', nf.Common.formatInteger(event.inputContentClaimFileSizeBytes) + ' bytes');
}
$('#output-content-download').hide();
if (event.inputContentAvailable === true) {
$('#input-content-download').show();
if (isContentViewConfigured()) {
$('#input-content-view').show();
} else {
$('#input-content-view').hide();
}
} else {
$('#input-content-download').hide();
$('#input-content-view').hide();
}
} else {
$('#output-content-details').show();
$('#input-content-header').text('Input Claim');
formatContentValue($('#input-content-container'), event.inputContentClaimContainer);
formatContentValue($('#input-content-section'), event.inputContentClaimSection);
formatContentValue($('#input-content-identifier'), event.inputContentClaimIdentifier);
formatContentValue($('#input-content-offset'), event.inputContentClaimOffset);
formatContentValue($('#input-content-bytes'), event.inputContentClaimFileSizeBytes);
// input content file size
var inputContentSize = $('#input-content-size');
formatContentValue(inputContentSize, event.inputContentClaimFileSize);
if (nf.Common.isDefinedAndNotNull(event.inputContentClaimFileSize)) {
// over the default tooltip with the actual byte count
inputContentSize.attr('title', nf.Common.formatInteger(event.inputContentClaimFileSizeBytes) + ' bytes');
}
formatContentValue($('#output-content-container'), event.outputContentClaimContainer);
formatContentValue($('#output-content-section'), event.outputContentClaimSection);
formatContentValue($('#output-content-identifier'), event.outputContentClaimIdentifier);
formatContentValue($('#output-content-offset'), event.outputContentClaimOffset);
formatContentValue($('#output-content-bytes'), event.outputContentClaimFileSizeBytes);
// output content file size
var outputContentSize = $('#output-content-size');
formatContentValue(outputContentSize, event.outputContentClaimFileSize);
if (nf.Common.isDefinedAndNotNull(event.outputContentClaimFileSize)) {
// over the default tooltip with the actual byte count
outputContentSize.attr('title', nf.Common.formatInteger(event.outputContentClaimFileSizeBytes) + ' bytes');
}
if (event.inputContentAvailable === true) {
$('#input-content-download').show();
if (isContentViewConfigured()) {
$('#input-content-view').show();
} else {
$('#input-content-view').hide();
}
} else {
$('#input-content-download').hide();
$('#input-content-view').hide();
}
if (event.outputContentAvailable === true) {
$('#output-content-download').show();
if (isContentViewConfigured()) {
$('#output-content-view').show();
} else {
$('#output-content-view').hide();
}
} else {
$('#output-content-download').hide();
$('#output-content-view').hide();
}
}
if (nf.Common.isDFM()) {
if (event.replayAvailable === true) {
$('#replay-content, #replay-content-connection').show();
formatContentValue($('#replay-connection-id'), event.sourceConnectionIdentifier);
$('#replay-content-message').hide();
} else {
$('#replay-content, #replay-content-connection').hide();
$('#replay-content-message').text(event.replayExplanation).show();
}
}
// show the dialog
$('#event-details-dialog').modal('show');
}
};
}()); | 40.770065 | 181 | 0.520564 |
1e5565ce79558b6d5ec3506ad103b1a2c977492e | 975 | js | JavaScript | demos/src/SampleDialog.js | rperki8/elix | 3b88856ff245c839431ad575b50e52d181a8a13a | [
"MIT"
] | null | null | null | demos/src/SampleDialog.js | rperki8/elix | 3b88856ff245c839431ad575b50e52d181a8a13a | [
"MIT"
] | null | null | null | demos/src/SampleDialog.js | rperki8/elix | 3b88856ff245c839431ad575b50e52d181a8a13a | [
"MIT"
] | null | null | null | import * as internal from "../../src/internal.js";
import CustomBackdrop from "./CustomBackdrop.js";
import CustomOverlayFrame from "./CustomOverlayFrame.js";
import Dialog from "../../src/Dialog.js";
class SampleDialog extends Dialog {
get [internal.defaultState]() {
return Object.assign(super[internal.defaultState], {
backdropPartType: CustomBackdrop,
framePartType: CustomOverlayFrame
});
}
[internal.render](/** @type {PlainObject} */ changed) {
if (super[internal.render]) {
super[internal.render](changed);
}
if (changed.framePartType) {
// Have the dialog close itself when the user clicks anywhere within it. In
// many cases, you'll want to have a button ("OK", "Close", etc.) that
// performs this action.
this[internal.ids].frame.addEventListener("click", () => {
this.close();
});
}
}
}
customElements.define("sample-dialog", SampleDialog);
export default SampleDialog;
| 31.451613 | 81 | 0.667692 |
1e568d4adbf5d7002238d11eea4f0ba5d8802344 | 7,345 | js | JavaScript | assets/lib/mapbox-gl/mapbox-gl-language.js | tomaja-linuxo/LoveIt | 4d1f33c66c52a206f35a9661e1d257b83e451f47 | [
"MIT"
] | 1 | 2022-03-03T04:24:09.000Z | 2022-03-03T04:24:09.000Z | assets/lib/mapbox-gl/mapbox-gl-language.js | tomaja-linuxo/LoveIt | 4d1f33c66c52a206f35a9661e1d257b83e451f47 | [
"MIT"
] | null | null | null | assets/lib/mapbox-gl/mapbox-gl-language.js | tomaja-linuxo/LoveIt | 4d1f33c66c52a206f35a9661e1d257b83e451f47 | [
"MIT"
] | null | null | null | /**
* Create a new [Mapbox GL JS plugin](https://www.mapbox.com/blog/build-mapbox-gl-js-plugins/) that
* modifies the layers of the map style to use the `text-field` that matches the browser language.
* As of Mapbox GL Language v1.0.0, this plugin no longer supports token values (e.g. `{name}`). v1.0+ expects the `text-field`
* property of a style to use an [expression](https://docs.mapbox.com/mapbox-gl-js/style-spec/expressions/) of the form `['get', 'name_en']` or `['get', 'name']`; these expressions can be nested. Note that `get` expressions used as inputs to other expressions may not be handled by this plugin. For example:
* ```
* ["match",
* ["get", "name"],
* "California",
* "Golden State",
* ["coalesce",
* ["get", "name_en"],
* ["get", "name"]
* ]
* ]
* ```
* Only styles based on [Mapbox v8 styles](https://docs.mapbox.com/help/troubleshooting/streets-v8-migration-guide/) are supported.
*
* @constructor
* @param {object} options - Options to configure the plugin.
* @param {string[]} [options.supportedLanguages] - List of supported languages
* @param {Function} [options.languageTransform] - Custom style transformation to apply
* @param {RegExp} [options.languageField=/^name_/] - RegExp to match if a text-field is a language field
* @param {Function} [options.getLanguageField] - Given a language choose the field in the vector tiles
* @param {string} [options.languageSource] - Name of the source that contains the different languages.
* @param {string} [options.defaultLanguage] - Name of the default language to initialize style after loading.
* @param {string[]} [options.excludedLayerIds] - Name of the layers that should be excluded from translation.
*/
function MapboxLanguage(options) {
options = Object.assign({}, options);
if (!(this instanceof MapboxLanguage)) {
throw new Error('MapboxLanguage needs to be called with the new keyword');
}
this.setLanguage = this.setLanguage.bind(this);
this._initialStyleUpdate = this._initialStyleUpdate.bind(this);
this._defaultLanguage = options.defaultLanguage;
this._isLanguageField = options.languageField || /^name_/;
this._getLanguageField = options.getLanguageField || function nameField(language) {
return language === 'mul' ? 'name' : `name_${language}`;
};
this._languageSource = options.languageSource || null;
this._languageTransform = options.languageTransform;
this._excludedLayerIds = options.excludedLayerIds || [];
this.supportedLanguages = options.supportedLanguages || ['ar', 'de', 'en', 'es', 'fr', 'it', 'ja', 'ko', 'mul', 'pt', 'ru', 'vi', 'zh-Hans', 'zh-Hant'];
}
const isTokenField = /^\{name/;
function isFlatExpressionField(isLangField, property) {
const isGetExpression = Array.isArray(property) && property[0] === 'get';
if (isGetExpression && isTokenField.test(property[1])) {
console.warn('This plugin no longer supports the use of token syntax (e.g. {name}). Please use a get expression. See https://docs.mapbox.com/mapbox-gl-js/style-spec/expressions/ for more details.');
}
return isGetExpression && isLangField.test(property[1]);
}
function adaptNestedExpressionField(isLangField, property, languageFieldName) {
if (Array.isArray(property)) {
for (let i = 1; i < property.length; i++) {
if (Array.isArray(property[i])) {
if (isFlatExpressionField(isLangField, property[i])) {
property[i][1] = languageFieldName;
}
adaptNestedExpressionField(isLangField, property[i], languageFieldName);
}
}
}
}
function adaptPropertyLanguage(isLangField, property, languageFieldName) {
if (isFlatExpressionField(isLangField, property)) {
property[1] = languageFieldName;
}
adaptNestedExpressionField(isLangField, property, languageFieldName);
// handle special case of bare ['get', 'name'] expression by wrapping it in a coalesce statement
if (property[0] === 'get' && property[1] === 'name') {
const defaultProp = property.slice();
const adaptedProp = ['get', languageFieldName];
property = ['coalesce', adaptedProp, defaultProp];
}
return property;
}
function changeLayerTextProperty(isLangField, layer, languageFieldName, excludedLayerIds) {
if (layer.layout && layer.layout['text-field'] && excludedLayerIds.indexOf(layer.id) === -1) {
return Object.assign({}, layer, {
layout: Object.assign({}, layer.layout, {
'text-field': adaptPropertyLanguage(isLangField, layer.layout['text-field'], languageFieldName)
})
});
}
return layer;
}
function findStreetsSource(style) {
const sources = Object.keys(style.sources).filter((sourceName) => {
const url = style.sources[sourceName].url;
// the source URL can reference the source version or the style version
// this check and the error forces users to migrate to styles using source version 8
return url && url.indexOf('mapbox.mapbox-streets-v8') > -1 || /mapbox-streets-v[1-9][1-9]/.test(url);
});
if (!sources.length) throw new Error('If using MapboxLanguage with a Mapbox style, the style must be based on vector tile version 8, e.g. "streets-v11"');
return sources[0];
}
/**
* Explicitly change the language for a style.
* @param {object} style - Mapbox GL style to modify
* @param {string} language - The language iso code
* @returns {object} the modified style
*/
MapboxLanguage.prototype.setLanguage = function (style, language) {
if (this.supportedLanguages.indexOf(language) < 0) throw new Error(`Language ${ language } is not supported`);
const streetsSource = this._languageSource || findStreetsSource(style);
if (!streetsSource) return style;
const field = this._getLanguageField(language);
const isLangField = this._isLanguageField;
const excludedLayerIds = this._excludedLayerIds;
const changedLayers = style.layers.map((layer) => {
if (layer.source === streetsSource) return changeLayerTextProperty(isLangField, layer, field, excludedLayerIds);
return layer;
});
const languageStyle = Object.assign({}, style, {
layers: changedLayers
});
return this._languageTransform ? this._languageTransform(languageStyle, language) : languageStyle;
};
MapboxLanguage.prototype._initialStyleUpdate = function () {
const style = this._map.getStyle();
const language = this._defaultLanguage || browserLanguage(this.supportedLanguages);
this._map.setStyle(this.setLanguage(style, language));
};
function browserLanguage(supportedLanguages) {
const language = navigator.languages ? navigator.languages[0] : (navigator.language || navigator.userLanguage);
const parts = language && language.split('-');
let languageCode = language;
if (parts.length > 1) {
languageCode = parts[0];
}
if (supportedLanguages.indexOf(languageCode) > -1) {
return languageCode;
}
return null;
}
MapboxLanguage.prototype.onAdd = function (map) {
this._map = map;
this._map.on('style.load', this._initialStyleUpdate);
this._container = document.createElement('div');
return this._container;
};
MapboxLanguage.prototype.onRemove = function () {
this._map.off('style.load', this._initialStyleUpdate);
this._map = undefined;
};
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
module.exports = MapboxLanguage;
} else {
window.MapboxLanguage = MapboxLanguage;
}
| 42.212644 | 307 | 0.709871 |
1e568de18b1e9219a313737809869c15b37883c7 | 3,219 | js | JavaScript | app.js | 1self/cardapp | 8ead14698c464e7e160503f967653a6e1ec924f6 | [
"Apache-2.0"
] | null | null | null | app.js | 1self/cardapp | 8ead14698c464e7e160503f967653a6e1ec924f6 | [
"Apache-2.0"
] | null | null | null | app.js | 1self/cardapp | 8ead14698c464e7e160503f967653a6e1ec924f6 | [
"Apache-2.0"
] | null | null | null | var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var morgan = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var swig = require('swig');
var winston = require('winston');
var session = require('express-session');
var FileStore = require('session-file-store')(session);
var index = require('./routes/index');
var auth = require('./routes/auth');
var app = express();
var env = process.env.NODE_ENV || 'development';
app.locals.ENV = env;
app.locals.ENV_DEVELOPMENT = env == 'development';
app.locals.SESSION_SECRET = process.env.SESSION_SECRET || 'development';
app.locals.AUTH_CLIENT_ID = process.env.AUTH_CLIENT_ID;
app.locals.AUTH_CLIENT_SECRET = process.env.AUTH_CLIENT_SECRET;
app.locals.AUTH_AUTHCODE_URL = process.env.AUTH_AUTHCODE_URL;
app.locals.AUTH_TOKEN_URL = process.env.AUTH_TOKEN_URL;
app.locals.API_URL = process.env.API_URL;
app.locals.APP_URL = process.env.APP_URL;
app.locals.DASHBOARD_URL = process.env.DASHBOARD_URL;
app.locals.USERNAME_EXISTS_TOKEN = process.env.USERNAME_EXISTS_TOKEN;
app.locals.LOGFILE = process.env.LOGGINGDIR + '/cardapp.log';
app.locals.OFFLINE = process.env.OFFLINE;
// logging setup
winston.add(winston.transports.File, { filename: app.locals.LOGFILE, level: 'debug', json: false, prettyPrint: false });
winston.error("Errors will be logged here");
winston.warn("Warns will be logged here");
winston.info("Info will be logged here");
winston.debug("Debug will be logged here");
winston.silly("Silly will be logged here");
app.locals.logger = winston;
process.on('uncaughtException', function(err) {
winston.error('Caught exception: ' + err);
throw err;
});
// view engine setup
app.engine('swig', swig.renderFile);
app.set('view cache', false);
swig.setDefaults({ cache: false });
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'swig');
app.set('trust proxy', true);
// app.use(favicon(__dirname + '/public/img/favicon.ico'));
app.use(morgan('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({
extended: true
}));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));
app.use(session({
store: new FileStore(),
secret: app.locals.SESSION_SECRET,
resave: true,
saveUninitialized: true
}));
app.use('/', index);
app.use('/auth', auth);
app.use('/analytics', require('./routes/analytics/index.js'));
/// catch 404 and forward to error handler
app.use(function(req, res, next) {
var err = new Error('Not Found');
err.status = 404;
next(err);
});
/// error handlers
// development error handler
// will print stacktrace
if (app.get('env') === 'development') {
app.use(function(err, req, res, next) {
res.status(err.status || 500);
res.render('error', {
message: err.message,
error: err,
title: 'error'
});
});
}
// production error handler
// no stacktraces leaked to user
app.use(function(err, req, res, next) {
res.status(err.status || 500);
res.render('error', {
message: err.message,
error: {},
title: 'error'
});
});
module.exports = app;
| 29 | 120 | 0.688723 |
1e56de2cf51634e652bbd41260ea4b73d5496c12 | 216 | js | JavaScript | aula-js/for-in.js | felipeneves2022/portfolio | 0eb3222c9af079e812009ee6515d39c48492d677 | [
"MIT"
] | null | null | null | aula-js/for-in.js | felipeneves2022/portfolio | 0eb3222c9af079e812009ee6515d39c48492d677 | [
"MIT"
] | null | null | null | aula-js/for-in.js | felipeneves2022/portfolio | 0eb3222c9af079e812009ee6515d39c48492d677 | [
"MIT"
] | null | null | null | let pessoa = {
nome: "Felipe",
idade:"38",
sexo: "masc",
peso: "74"
}
for (let p in pessoa) {
console.log('dados da pessoa', p)
console.log('dados da pessoa', pessoa[p])
} | 19.636364 | 49 | 0.50463 |
1e56f19f4b5d03fab2d6999306d885fc9f33e7c0 | 298 | js | JavaScript | cypress/integration/dashboard.spec.js | lucazweb/transactions-manager-app | f7847e2b5634370440a77940edc1a1bf7fe1c6a2 | [
"MIT"
] | null | null | null | cypress/integration/dashboard.spec.js | lucazweb/transactions-manager-app | f7847e2b5634370440a77940edc1a1bf7fe1c6a2 | [
"MIT"
] | 4 | 2021-03-09T19:58:42.000Z | 2022-02-18T12:37:32.000Z | cypress/integration/dashboard.spec.js | lucazweb/transactions-manager-app | f7847e2b5634370440a77940edc1a1bf7fe1c6a2 | [
"MIT"
] | null | null | null | describe('Transactions Form type test', () => {
beforeEach(() => {
cy.visit('http://localhost:3000/')
});
it('Visit application without transactions', () => {
cy.contains('Começar');
cy.get('[data-test="startbtn"]').click();
cy.contains('Cadastre uma transação');
});
});
| 22.923077 | 54 | 0.590604 |
1e575c6a351e25fab27dd04f83d10c41d0afdf62 | 59,420 | js | JavaScript | test/api/auth.js | el-tu/citizenos-api | c796be98f4fcf2fbde418a91c0e1e93c36a4cb51 | [
"Apache-2.0"
] | null | null | null | test/api/auth.js | el-tu/citizenos-api | c796be98f4fcf2fbde418a91c0e1e93c36a4cb51 | [
"Apache-2.0"
] | null | null | null | test/api/auth.js | el-tu/citizenos-api | c796be98f4fcf2fbde418a91c0e1e93c36a4cb51 | [
"Apache-2.0"
] | null | null | null | 'use strict';
/**
* Log in - call '/api/auth/login' API endpoint
*
* @param {object} agent SuperAgent is in the interface so other tests preparing data could provide their agent. Useful when agent holds a state (for ex session).
* @param {string} email E-mail
* @param {string} password Password
* @param {string} expectedHttpCode Expected HTTP code
*
* @returns {Promise<Object>} SuperAgent response object
*
* @private
*/
const _login = async function (agent, email, password, expectedHttpCode) {
const path = '/api/auth/login';
const a = agent
.post(path)
.set('Content-Type', 'application/json')
.send({
email: email,
password: password
})
.expect(expectedHttpCode)
.expect('Content-Type', /json/);
if (expectedHttpCode === 200) {
a.expect('set-cookie', /.*\.sid=.*; Path=\/api; Expires=.*; HttpOnly/);
}
return a;
};
const login = async function (agent, email, password) {
return _login(agent, email, password, 200);
};
const _loginId = async function (agent, token, clientCert, expectedHttpCode) {
const path = '/api/auth/id';
const a = agent
.post(path)
.set('Content-Type', 'application/json');
if (clientCert) {
a.set('X-SSL-Client-Cert', clientCert);
}
if (token) {
a.send({token: token});
}
return a.expect(expectedHttpCode)
.expect('Content-Type', /json/)
.then(function (res, err) {
if (err) return err;
const data = res.body.data;
if (data && !data.token && !data.hash) {
a.expect('set-cookie', /.*\.sid=.*; Path=\/api; Expires=.*; HttpOnly/);
}
});
}
/**
* Initialize Mobiil-ID login - call '/api/auth/mobile/init' API endpoint
*
* @param {object} agent SuperAgent is in the interface so other tests preparing data could provide their agent. Useful when agent holds a state (for ex session).
* @param {string} pid Personal identification number
* @param {string} phoneNumber Phone number
* @param {number} expectedHttpCode Expected HTTP response code
*
* @return {void}
*
* @private
*/
const _loginMobileInit = async function (agent, pid, phoneNumber, expectedHttpCode) {
const path = '/api/auth/mobile/init';
return agent
.post(path)
.set('Content-Type', 'application/json')
.send({
pid: pid,
phoneNumber: phoneNumber
})
.expect(expectedHttpCode)
.expect('Content-Type', /json/);
};
const loginMobileInit = async function (agent, pid, phoneNumber) {
return _loginMobileInit(agent, pid, phoneNumber, 200);
};
/**
* Initialize Smart-ID login - call '/api/auth/smartid/init' API endpoint
*
* @param {object} agent SuperAgent is in the interface so other tests preparing data could provide their agent. Useful when agent holds a state (for ex session).
* @param {string} pid Personal identification number
* @param {number} expectedHttpCode Expected HTTP response code
*
* @return {void}
*
* @private
*/
const _loginSmartIdInit = async function (agent, pid, expectedHttpCode) {
const path = '/api/auth/smartid/init';
return agent
.post(path)
.set('Content-Type', 'application/json')
.send({pid: pid})
.expect(expectedHttpCode)
.expect('Content-Type', /json/);
};
const loginSmartIdInit = async function (agent, pid) {
return _loginSmartIdInit(agent, pid, 200);
};
/**
* Check mobile authentication status - call '/api/auth/mobile/status'
*
* @param {object} agent SuperAgent is in the interface so other tests preparing data could provide their agent. Useful when agent holds a state (for ex session).
* @param {string} token JWT token issued when login was initiated
* @param {number} expectedHttpCode Expected HTTP response code
*
* @return {void}
*
* @private
*/
const _loginMobilestatus = async function (agent, token, expectedHttpCode) {
const path = '/api/auth/mobile/status';
return agent
.get(path)
.query({
token: token
})
.expect(expectedHttpCode)
.expect('Content-Type', /json/)
};
const loginMobilestatus = async function (agent, token) {
return new Promise(function (resolve, reject) {
const maxRetries = 20;
const retryInterval = 1000; // milliseconds;
let retries = 0;
const statusInterval = setInterval(async function () {
try {
if (retries < maxRetries) {
retries++;
const loginMobileStatusResponse = await _loginMobilestatus(agent, token, 200);
if (loginMobileStatusResponse.body.status.code !== 20001) {
clearInterval(statusInterval);
return resolve(loginMobileStatusResponse);
}
} else {
clearInterval(statusInterval);
return reject(new Error(`loginMobileStatus maximum retry limit ${maxRetries} reached!`));
}
} catch (err) {
// Whatever blows, stop polling
clearInterval(statusInterval);
return reject(err);
}
}, retryInterval);
});
};
/**
* Check smart-ID authentication status - call '/api/auth/smartid/status'
*
* @param {object} agent SuperAgent is in the interface so other tests preparing data could provide their agent. Useful when agent holds a state (for ex session).
* @param {string} token JWT token that was issued when flow was initiated
*
* @return {void}
*
* @private
*/
const _loginSmartIdstatus = async function (agent, token) {
const path = '/api/auth/smartid/status';
return agent
.get(path)
.query({
token: token
})
.expect('Content-Type', /json/);
};
const loginSmartIdstatus = async function (agent, token, interval) {
return new Promise(function (resolve, reject) {
const maxRetries = 20;
const retryInterval = interval || 1000; // milliseconds;
let retries = 0;
const statusInterval = setInterval(async function () {
try {
if (retries < maxRetries) {
retries++;
const loginSmartIdStatusResponse = await _loginSmartIdstatus(agent, token, 200);
if (loginSmartIdStatusResponse.body.status.code !== 20001) {
clearInterval(statusInterval);
return resolve(loginSmartIdStatusResponse);
}
} else {
clearInterval(statusInterval);
return reject(new Error(`loginSmartIdStatus maximum retry limit ${maxRetries} reached!`));
}
} catch (err) {
// Whatever blows, stop polling
clearInterval(statusInterval);
return reject(err);
}
}, retryInterval);
});
};
/**
* Log out - call '/api/auth/logout' API endpoint
*
* @param {object} agent SuperAgent is in the interface so other tests preparing data could provide their agent. Useful when agent holds a state (for ex session).
*
* @return {void}
*/
const logout = async function (agent) {
const path = '/api/auth/logout';
return agent
.post(path)
.set('Content-Type', 'application/json')
.expect(200)
.expect('Content-Type', /json/)
};
/**
* Sign up - call '/api/auth/signup' API endpoint
*
* @param {object} agent SuperAgent is in the interface so other tests preparing data could provide their agent. Useful when agent holds a state (for ex session).
* @param {string} email E-mail
* @param {string} password Password
* @param {string} language Users preferred language ISO 2 char language code
*
* @return {void}
*/
const _signup = async function (agent, email, password, language, expectedHttpCode) {
const path = '/api/auth/signup';
return agent
.post(path)
.set('Content-Type', 'application/json')
.send({
email: email,
password: password,
language: language
})
.expect(expectedHttpCode)
.expect('Content-Type', /json/);
};
const signup = async function (agent, email, password, language) {
return _signup(agent, email, password, language, 200);
};
/**
* Set password - call '/api/auth/password' API endpoint
*
* @param {object} agent SuperAgent is in the interface so other tests preparing data could provide their agent. Useful when agent holds a state (for ex session).
* @param {string} currentPassword Current password
* @param {string} newPassword New password
* @param {number} expectedHttpCode Expected HTTP response code
*
* @return {void}
*
* @private
*/
const _passwordSet = async function (agent, currentPassword, newPassword, expectedHttpCode) {
const path = '/api/auth/password';
return agent
.post(path)
.set('Content-Type', 'application/json')
.send({
currentPassword: currentPassword,
newPassword: newPassword
})
.expect(expectedHttpCode)
.expect('Content-Type', /json/);
};
/**
* Set password - call '/api/auth/password' API endpoint
*
* @param {object} agent SuperAgent is in the interface so other tests preparing data could provide their agent. Useful when agent holds a state (for ex session).
* @param {string} currentPassword Current password
* @param {string} newPassword New password
*
* @return {void}
*/
const passwordSet = async function (agent, currentPassword, newPassword) {
return _passwordSet(agent, currentPassword, newPassword, 200);
};
/**
* Send user password reset email with reset code - call '/api/auth/password/reset' API endpoint
*
* @param {object} agent SuperAgent is in the interface so other tests preparing data could provide their agent. Useful when agent holds a state (for ex session).
* @param {string} email E-mail of the user who's password is to be reset
* @param {number} expectedHttpCode Expected HTTP response code
*
* @return {void}
*
* @private
*/
const _passwordResetSend = async function (agent, email, expectedHttpCode) {
const path = '/api/auth/password/reset/send';
return agent
.post(path)
.set('Content-Type', 'application/json')
.send({email: email})
.expect(expectedHttpCode)
.expect('Content-Type', /json/);
};
const passwordResetSend = function (agent, email) {
return _passwordResetSend(agent, email, 200);
};
const _passwordResetComplete = async function (agent, email, password, passwordResetCode, expectedHttpCode) {
const path = '/api/auth/password/reset';
return agent
.post(path)
.set('Content-Type', 'application/json')
.send({
email: email,
password: password,
passwordResetCode: passwordResetCode
})
.expect(expectedHttpCode)
.expect('Content-Type', /json/);
};
const passwordResetComplete = async function (agent, email, password, passwordResetCode) {
return _passwordResetComplete(agent, email, password, passwordResetCode, 200);
};
/**
* Verify e-mail - call '/api/auth/verify/:code'
*
* @param {object} agent SuperAgent is in the interface so other tests preparing data could provide their agent. Useful when agent holds a state (for ex session).
* @param {string} emailVerificationCode Verification code e-mailed to the user.
*
* @return {void}
*/
const verify = async function (agent, emailVerificationCode) {
const path = '/api/auth/verify/:code'.replace(':code', emailVerificationCode);
return agent
.get(path)
.expect(302)
.expect('Location', /\/account\/login\?email=.*/);
};
/**
* Check auth status - call '/api/auth/status'
*
* @param {object} agent SuperAgent is in the interface so other tests preparing data could provide their agent. Useful when agent holds a state (for ex session).
* @param {number} expectedHttpCode Expected HTTP response code
*
* @return {void}
*
* @private
*/
const _status = async function (agent, expectedHttpCode) {
const path = '/api/auth/status';
return agent
.get(path)
.set('Content-Type', 'application/json')
.expect(expectedHttpCode)
.expect('Content-Type', /json/);
};
/**
* Check auth status - call '/api/auth/status'
*
* @param {object} agent SuperAgent is in the interface so other tests preparing data could provide their agent. Useful when agent holds a state (for ex session).
*
* @return {void}
*/
const status = async function (agent) {
return _status(agent, 200);
};
const _openIdAuthorize = async function (agent, responseType, clientId, redirectUri, nonce, scope, state, expectedHttpCode) {
const path = '/api/auth/openid/authorize';
return agent
.get(path)
.query({
response_type: responseType,
client_id: clientId,
redirect_uri: redirectUri,
nonce: nonce,
scope: scope,
state: state
})
.expect(expectedHttpCode);
};
const openIdAuthorize = async function (agent, responseType, clientId, redirectUri, scope, state, nonce) {
return _openIdAuthorize(agent, responseType, clientId, redirectUri, nonce, scope, state, 302);
};
//Export the above function call so that other tests could use it to prepare data.
module.exports.login = login;
module.exports.login = login;
module.exports.logout = logout;
module.exports.logout = logout;
module.exports.signup = signup;
module.exports.signup = signup;
module.exports.verify = verify;
module.exports.status = status;
module.exports._status = _status;
module.exports.status = status;
module.exports._status = _status;
const request = require('supertest');
const app = require('../../app');
const models = app.get('models');
const uuid = require('uuid');
const fs = require('fs');
const assert = require('chai').assert;
const config = app.get('config');
const jwt = app.get('jwt');
const urlLib = app.get('urlLib');
const objectEncrypter = app.get('objectEncrypter');
const shared = require('../utils/shared');
const userLib = require('./lib/user')(app);
const User = models.User;
const UserConnection = models.UserConnection;
const UserConsent = models.UserConsent;
const Partner = models.Partner;
const db = models.sequelize;
suite('Auth', function () {
suiteSetup(async function () {
return shared
.syncDb();
});
suite('Login', function () {
suite('Username & password', function () {
const agent = request.agent(app);
const email = 'test_' + new Date().getTime() + '@test.ee';
const password = 'Test123';
suiteSetup(async function () {
await userLib.createUser(agent, email, password, null);
});
test('Success', async function () {
const res = await login(agent, email, password);
const user = res.body.data;
assert.equal(user.email, email);
assert.property(user, 'id');
assert.notProperty(res.body, 'name'); //TODO: would be nice if null values were not returned in the response
assert.notProperty(user, 'password');
assert.notProperty(user, 'emailIsVerified');
assert.notProperty(user, 'emailVerificationCode');
assert.notProperty(user, 'createdAt');
assert.notProperty(user, 'updatedAt');
assert.notProperty(user, 'deletedAt');
});
test('Fail - 40001 - account does not exist', async function () {
const res = await agent
.post('/api/auth/login')
.set('Content-Type', 'application/json')
.send({
email: 'test_nonexistent_' + new Date().getTime() + '@test.ee',
password: password
})
.expect(400)
.expect('Content-Type', /json/);
const status = res.body.status;
assert.equal(status.code, 40001);
assert.equal(status.message, 'The account does not exists.');
});
test('Fail - 40002 - account has not been verified', async function () {
const agent = request.agent(app);
const email = 'test_notverif_' + new Date().getTime() + '@test.ee';
const password = 'Test123';
await signup(agent, email, password, null);
const res = await _login(agent, email, password, 400);
const status = res.body.status;
assert.equal(status.code, 40002);
assert.equal(status.message, 'The account verification has not been completed. Please check your e-mail.');
});
test('Fail - 40003 - wrong password', async function () {
const res = await agent
.post('/api/auth/login')
.set('Content-Type', 'application/json')
.send({
email: email,
password: 'thisinvalidpassword'
})
.expect(400)
.expect('Content-Type', /json/);
const status = res.body.status;
assert.equal(status.code, 40003);
assert.equal(res.body.errors.password, 'Invalid password');
});
});
suite('ID-card', function () {
teardown(async function () {
return UserConnection
.destroy({
where: {
connectionId: UserConnection.CONNECTION_IDS.esteid,
connectionUserId: ['PNOEE-37101010021']
},
force: true
});
});
test('Success - client certificate in X-SSL-Client-Cert header', async function () {
this.timeout(5000); //eslint-disable-line no-invalid-this
const agent = request.agent(app);
const cert = fs.readFileSync('./test/resources/certificates/good-jaak-kristjan_jõeorg_esteid_sign.pem', {encoding: 'utf8'}).replace(/\n/g, ''); //eslint-disable-line no-sync
await _loginId(agent, null, cert, 200);
});
test('Fail - no token or client certificate in header', async function () {
await _loginId(request.agent(app), null, null, 400);
});
});
suite('Mobiil-ID', function () {
suite('Init', function () {
setup(async function () {
await UserConnection
.destroy({
where: {
connectionId: UserConnection.CONNECTION_IDS.esteid,
connectionUserId: ['PNOEE-60001019906']
},
force: true
});
});
test('Success - 20001 - Estonian mobile number and PID', async function () {
this.timeout(15000); //eslint-disable-line no-invalid-this
const phoneNumber = '+37200000766';
const pid = '60001019906';
const response = (await loginMobileInit(request.agent(app), pid, phoneNumber)).body;
assert.equal(response.status.code, 20001);
assert.match(response.data.challengeID, /[0-9]{4}/);
const tokenData = jwt.verify(response.data.token, config.session.publicKey, {algorithms: [config.session.algorithm]});
const loginMobileFlowData = objectEncrypter(config.session.secret).decrypt(tokenData.sessionDataEncrypted);
assert.property(loginMobileFlowData, 'sessionHash');
const responseData = (await loginMobilestatus(request.agent(app), response.data.token)).body.data;
assert.property(responseData, 'id');
delete responseData.id;
assert.deepEqual(responseData, {
name: 'Mary Änn O’Connež-Šuslik Testnumber',
company: null,
language: 'en',
email: null,
imageUrl: null,
termsVersion: null,
termsAcceptedAt: null
});
});
test('Fail - 40021 - Invalid phone number', async function () {
const phoneNumber = '+372519';
const pid = '51001091072';
const response = (await _loginMobileInit(request.agent(app), pid, phoneNumber, 400)).body;
assert.equal(response.status.code, 40000);
const expectedResponse = {
status: {
code: 40000,
message: 'phoneNumber must contain of + and numbers(8-30)'
}
};
assert.deepEqual(response, expectedResponse);
});
test('Fail - 40021 - Invalid PID', async function () {
const phoneNumber = '+37260000007';
const pid = '1072';
const response = (await _loginMobileInit(request.agent(app), pid, phoneNumber, 400)).body;
const expectedResponse = {
status: {
code: 40000,
message: 'nationalIdentityNumber must contain of 11 digits'
}
};
assert.deepEqual(response, expectedResponse);
});
test('Fail - 40022 - Mobile-ID user certificates are revoked or suspended for Estonian citizen', async function () {
const phoneNumber = '+37200000266';
const pid = '60001019939';
const response = (await loginMobileInit(request.agent(app), pid, phoneNumber)).body.data;
const responseData = (await _loginMobilestatus(request.agent(app), response.token, 400)).body;
const expectedResponse = {
status: {
code: 40013,
message: 'Mobile-ID functionality of the phone is not yet ready'
}
};
assert.deepEqual(responseData, expectedResponse);
});
test('Fail - 40022 - Mobile-ID user certificates are revoked or suspended for Lithuanian citizen', async function () {
const phoneNumber = '+37060000266';
const pid = '50001018832';
const response = (await loginMobileInit(request.agent(app), pid, phoneNumber)).body.data;
const responseData = (await _loginMobilestatus(request.agent(app), response.token, 400)).body;
const expectedResponse = {
status: {
code: 40013,
message: 'Mobile-ID functionality of the phone is not yet ready'
}
};
assert.deepEqual(responseData, expectedResponse);
});
test('Fail - 40023 - User certificate is not activated for Estonian citizen.', async function () {
const phoneNumber = '+37200001';
const pid = '38002240211';
const response = (await loginMobileInit(request.agent(app), pid, phoneNumber)).body.data;
const responseData = (await _loginMobilestatus(request.agent(app), response.token, 400)).body;
const expectedResponse = {
status: {
code: 40013,
message: 'Mobile-ID functionality of the phone is not yet ready'
}
};
assert.deepEqual(responseData, expectedResponse);
});
test('Fail - 40023 - Mobile-ID is not activated for Lithuanian citizen', async function () {
const phoneNumber = '+37060000001';
const pid = '51001091006';
const response = (await loginMobileInit(request.agent(app), pid, phoneNumber)).body.data;
const responseData = (await _loginMobilestatus(request.agent(app), response.token, 400)).body;
const expectedResponse = {
status: {
code: 40013,
message: 'Mobile-ID functionality of the phone is not yet ready'
}
};
assert.deepEqual(responseData, expectedResponse);
});
test.skip('Fail - 40024 - User certificate is suspended', async function () {
//TODO: No test phone numbers available for errorcode = 304 - http://id.ee/?id=36373
});
test.skip('Fail - 40025 - User certificate is expired', async function () {
//TODO: No test phone numbers available for errorcode = 305 - http://id.ee/?id=36373
});
});
suite('Status', function () {
const phoneNumber = '+37200000766';
const pid = '60001019906';
suite('New User', function () {
setup(async function () {
return UserConnection
.destroy({
where: {
connectionId: UserConnection.CONNECTION_IDS.esteid,
connectionUserId: ['PNOEE-' + pid]
},
force: true
});
});
test('Success - 20003 - created', async function () {
this.timeout(35000); //eslint-disable-line no-invalid-this
const agent = request.agent(app);
const response = (await loginMobileInit(agent, pid, phoneNumber)).body.data;
const userInfoFromMobiilIdStatusResponse = (await loginMobilestatus(agent, response.token)).body;
assert.equal(userInfoFromMobiilIdStatusResponse.status.code, 20003);
const userFromStatus = (await status(agent)).body.data;
// Makes sure login succeeded AND consistency between /auth/status and /auth/mobile/status endpoints
assert.deepEqual(userFromStatus, userInfoFromMobiilIdStatusResponse.data);
assert.equal(userInfoFromMobiilIdStatusResponse.data.name, 'Mary Änn O’Connež-Šuslik Testnumber'); // Special check for encoding issues
});
});
suite('Existing User', function () {
const agent2 = request.agent(app);
setup(async function () {
const user = await userLib.createUser(agent2, null, null, null);
return UserConnection
.findOrCreate({
where: {
connectionId: UserConnection.CONNECTION_IDS.esteid,
connectionUserId: 'PNOEE-'+pid
},
defaults: {
userId: user.id,
connectionId: UserConnection.CONNECTION_IDS.esteid,
connectionUserId: 'PNOEE-'+pid
}
});
});
teardown(async function () {
return UserConnection
.destroy({
where: {
connectionId: UserConnection.CONNECTION_IDS.esteid,
connectionUserId: ['PNOEE-60001019906']
},
force: true
});
});
test('Success - 20002 - existing User', async function () {
this.timeout(35000); //eslint-disable-line no-invalid-this
const response = (await loginMobileInit(agent2, pid, phoneNumber)).body.data;
const userInfoFromMobiilIdStatusResponse = (await loginMobilestatus(agent2, response.token)).body;
assert.equal(userInfoFromMobiilIdStatusResponse.status.code, 20002);
const userFromStatus = (await status(agent2)).body.data;
assert.deepEqual(userFromStatus, userInfoFromMobiilIdStatusResponse.data);
});
});
});
});
suite('Smart-ID', function () {
suite('Init', function () {
let pid = '30303039914';
teardown(async function () {
return UserConnection
.destroy({
where: {
connectionId: UserConnection.CONNECTION_IDS.smartid,
connectionUserId: ['PNOEE-' + pid] // Remove the good user so that test would run multiple times. Also other tests use same numbers
},
force: true
});
});
test('Success - 20001 - Estonian PID', async function () {
this.timeout(5000); //eslint-disable-line no-invalid-this
const response = (await loginSmartIdInit(request.agent(app), pid)).body;
assert.equal(response.status.code, 20001);
assert.match(response.data.challengeID, /[0-9]{4}/);
const token = response.data.token;
assert.isNotNull(token);
const tokenData = jwt.verify(token, config.session.publicKey, {algorithms: [config.session.algorithm]});
const loginMobileFlowData = objectEncrypter(config.session.secret).decrypt(tokenData.sessionDataEncrypted);
assert.property(loginMobileFlowData, 'sessionId');
assert.property(loginMobileFlowData, 'sessionHash');
assert.property(loginMobileFlowData, 'challengeID');
assert.equal(loginMobileFlowData.challengeID, response.data.challengeID);
});
test('Fail - 40400 - Invalid PID', async function () {
pid = '1010101';
const response = (await _loginSmartIdInit(request.agent(app), pid, 404)).body;
const expectedResponse = {
status: {
code: 40400,
message: 'Not Found'
}
};
assert.deepEqual(response, expectedResponse);
});
});
suite('Status', function () {
let pid = '30303039914';
suite('New User', function () {
teardown(async function () {
return UserConnection
.destroy({
where: {
connectionId: UserConnection.CONNECTION_IDS.smartid,
connectionUserId: ['PNOEE-' + pid] // Remove the good user so that test would run multiple times. Also other tests use same numbers
},
force: true
});
});
test('Success - 20003 - created', async function () {
this.timeout(40000); //eslint-disable-line no-invalid-this
const agent = request.agent(app);
const initResponse = (await loginSmartIdInit(agent, pid)).body.data;
const userInfoFromSmartIdStatusResponse = (await loginSmartIdstatus(agent, initResponse.token)).body;
assert.equal(userInfoFromSmartIdStatusResponse.status.code, 20003);
const userFromStatus = (await status(agent)).body.data;
assert.deepEqual(userFromStatus, userInfoFromSmartIdStatusResponse.data);
assert.equal('Qualified Ok1 Testnumber', userInfoFromSmartIdStatusResponse.data.name); // Special check for encoding issues
});
test('Fail - 40010 - User refused', async function () {
this.timeout(40000); //eslint-disable-line no-invalid-this
pid = '30403039939';
const agent = request.agent(app);
const initResponse = (await loginSmartIdInit(agent, pid)).body.data;
const smartIdStatusResponse = (await loginSmartIdstatus(agent, initResponse.token, 2000)).body;
const expectedResponse = {
status: {
code: 40010,
message: 'User refused'
}
};
assert.deepEqual(expectedResponse, smartIdStatusResponse);
});
test('Fail - 40011 - Timeout', async function () {
this.timeout(120000); //eslint-disable-line no-invalid-this
pid = '30403039983'
const agent = request.agent(app);
const initResponse = (await loginSmartIdInit(agent, pid)).body.data;
const smartIdStatusResponse = (await loginSmartIdstatus(agent, initResponse.token, 5000)).body;
const expectedResponse = {
status: {
code: 40011,
message: 'The transaction has expired'
}
};
assert.deepEqual(expectedResponse, smartIdStatusResponse);
});
});
suite('Existing User', function () {
const agent2 = request.agent(app);
test('Success - 20002 - existing User', async function () {
this.timeout(30000); //eslint-disable-line no-invalid-this
pid = '30303039914';
const user = await userLib.createUser(agent2, null, null, null);
await UserConnection
.findOrCreate({
where: {
connectionId: UserConnection.CONNECTION_IDS.smartid,
connectionUserId: 'PNOEE-'+pid
},
defaults: {
userId: user.id,
connectionId: UserConnection.CONNECTION_IDS.smartid,
connectionUserId: 'PNOEE-'+pid
}
});
const initResponse = (await loginSmartIdInit(agent2, pid)).body.data;
const smartIdStatusResponse = (await loginSmartIdstatus(agent2, initResponse.token, 5000)).body;
assert.equal(smartIdStatusResponse.status.code, 20002);
const userFromStatus = (await status(agent2)).body.data;
assert.deepEqual(userFromStatus, smartIdStatusResponse.data);
});
});
});
});
});
suite('Logout', function () {
test('Success', async function () {
const agent = request.agent(app);
const email = 'test_' + new Date().getTime() + '@test.ee';
const password = 'Test123';
const user = await userLib.createUserAndLogin(agent, email, password, null);
const userFromStatus = (await status(agent)).body.data;
let expectedUser = user.toJSON();
expectedUser.termsVersion = user.termsVersion;
expectedUser.termsAcceptedAt = user.termsAcceptedAt;
assert.deepEqual(expectedUser, userFromStatus);
await logout(agent);
const statusResponse = (await _status(agent, 401)).body;
const expectedBody = {
status: {
code: 40100,
message: 'Unauthorized'
}
};
assert.deepEqual(statusResponse, expectedBody);
});
});
suite('Signup', function () {
const agent = request.agent(app);
test('Success', async function () {
const email = 'test_' + new Date().getTime() + '@test.ee';
const password = 'Test123';
const user = (await signup(agent, email, password, null)).body.data;
assert.equal(user.email, email);
assert.property(user, 'id');
assert.notProperty(user, 'password');
assert.notProperty(user, 'emailIsVerified');
assert.notProperty(user, 'emailVerificationCode');
assert.notProperty(user, 'passwordResetCode');
assert.notProperty(user, 'createdAt');
assert.notProperty(user, 'updatedAt');
assert.notProperty(user, 'deletedAt');
});
test('Success - invited user - User with NULL password in DB should be able to sign up', async function () {
// Users with NULL password are created on User invite
const agent = request.agent(app);
const email = 'test_' + new Date().getTime() + '_invited@test.ee';
const password = 'Test123';
const language = 'et';
const user = await User.create({
email: email,
password: null,
name: email,
source: User.SOURCES.citizenos
});
const userSignedup = (await signup(agent, user.email, password, language)).body.data;
assert.equal(userSignedup.email, email);
assert.equal(userSignedup.language, user.language);
});
test('Fail - 40000 - email cannot be null', async function () {
const email = null;
const password = 'Test123';
const signupResult = (await _signup(agent, email, password, null, 400)).body;
const expected = {
status: {
code: 40000
},
errors: {
email: 'Invalid email.'
}
};
assert.deepEqual(signupResult, expected);
});
test('Fail - 40000 - invalid email', async function () {
const email = 'this is an invalid email';
const password = 'Test123';
const signupResult = (await _signup(agent, email, password, null, 400)).body;
const expected = {
status: {
code: 40000
},
errors: {
email: 'Invalid email.'
}
};
assert.deepEqual(signupResult, expected);
});
test('Fail - 40000 - missing password', async function () {
const email = 'test_' + new Date().getTime() + '@test.ee';
const password = null;
const signupResult = (await _signup(agent, email, password, null, 400)).body;
const expected = {
status: {
code: 40000
},
errors: {
password: 'Password must be at least 6 character long, containing at least 1 digit, 1 lower and upper case character.'
}
};
assert.deepEqual(signupResult, expected);
});
test('Fail - 40000 - invalid password', async function () {
const email = 'test_' + new Date().getTime() + '@test.ee';
const password = 'nonumbersoruppercase';
const signupResult = (await _signup(agent, email, password, null, 400)).body;
const expected = {
status: {
code: 40000
},
errors: {
password: 'Password must be at least 6 character long, containing at least 1 digit, 1 lower and upper case character.'
}
};
assert.deepEqual(signupResult, expected);
});
test('Fail - 40000 - invalid password and invalid email', async function () {
const email = 'notvalidatall';
const password = 'nonumbersoruppercase';
const signupResult = (await _signup(agent, email, password, null, 400)).body;
const expected = {
status: {
code: 40000
},
errors: {
email: "Invalid email.",
password: 'Password must be at least 6 character long, containing at least 1 digit, 1 lower and upper case character.'
}
};
assert.deepEqual(signupResult, expected);
});
test('Fail - 40001 - email already in use', async function () {
const email = 'test_emailinuse_' + new Date().getTime() + '@test.ee';
const password = 'Test123';
await signup(agent, email, password, null);
const signupResult = (await _signup(agent, email, password, null, 400)).body;
const expected = {
status: {
code: 40001
},
errors: {
email: 'The email address is already in use.'
}
};
assert.deepEqual(signupResult, expected);
});
});
suite('Verify', function () {
const agent = request.agent(app);
// Success is already tested as a part of 'Login' suite.
test.skip('Success - signup sets redirectSuccess and verify should redirect to it', async function () {
});
test('Fail - invalid emailVerificationCode', async function () {
return agent
.get('/api/auth/verify/thisCodeDoesNotExist')
.expect(302)
.expect('Location', urlLib.getFe('/', null, {error: 'emailVerificationFailed'}));
});
});
suite('Password', function () {
suite('Set', function () {
const agent = request.agent(app);
const email = 'test_' + new Date().getTime() + '@test.ee';
const password = 'testPassword123';
const newPassword = 'newPassword123';
suiteSetup(async function () {
return userLib.createUserAndLogin(agent, email, password, null);
});
test('Success', async function () {
await passwordSet(agent, password, newPassword);
const loginResult = (await login(request.agent(app), email, newPassword)).body;
assert.equal(loginResult.status.code, 20000);
assert.equal(loginResult.data.email, email);
});
test('Fail - invalid new password which does not contain special characters needed', async function () {
const currentPassword = newPassword;
const invalidNewPassword = 'nospecialchars';
const resultBody = (await _passwordSet(agent, currentPassword, invalidNewPassword, 400)).body;
const expected = {
status: {
code: 40000
},
errors: {
password: 'Password must be at least 6 character long, containing at least 1 digit, 1 lower and upper case character.'
}
};
assert.deepEqual(resultBody, expected);
});
test('Fail - invalid old password', async function () {
const invalidCurrentPassword = 'thiscannotbevalid';
const validNewPassword = 'Test123ASD';
const resultBody = (await _passwordSet(agent, invalidCurrentPassword, validNewPassword, 400)).body;
assert.equal(resultBody.status.message, 'Invalid email or new password.');
});
test('Fail - Unauthorized', async function () {
const agent = request.agent(app);
await _passwordSet(agent, 'oldPassSomething', 'newPassSomething', 401);
});
});
suite('Reset', function () {
const agent = request.agent(app);
const email = 'test_reset_' + new Date().getTime() + '@test.ee';
const password = 'testPassword123';
const language = 'et';
suiteSetup(async function () {
return userLib.createUser(agent, email, password, language);
});
suite('Send', function () {
test('Success', async function () {
await passwordResetSend(agent, email);
const user = await User.findOne({
where: db.where(db.fn('lower', db.col('email')), db.fn('lower', email))
});
const passwordResetCode = user.passwordResetCode;
assert.property(user, 'passwordResetCode');
assert.isNotNull(passwordResetCode);
assert.lengthOf(passwordResetCode, 36);
});
test('Fail - 40000 - missing email', async function () {
const resetBody = (await _passwordResetSend(agent, null, 400)).body;
const expectedBody = {
status: {
code: 40000
},
errors: {
email: 'Invalid email'
}
};
assert.deepEqual(resetBody, expectedBody);
});
test('Fail - 40001 - non existent email', async function () {
const resetBody = (await _passwordResetSend(agent, 'test_this_user_we_dont_have@test.com', 400)).body;
const expectedBody = {
status: {
code: 40002
},
errors: {
email: 'Account with this email does not exist.'
}
};
assert.deepEqual(resetBody, expectedBody);
});
});
suite('Complete', function () {
let passwordResetCode;
suiteSetup(async function () {
await passwordResetSend(agent, email);
const user = await User.findOne({
where: db.where(db.fn('lower', db.col('email')), db.fn('lower', email))
});
passwordResetCode = user.passwordResetCode;
});
test('Fail - invalid reset code', async function () {
const resBody = (await _passwordResetComplete(agent, email, password, uuid.v4(), 400)).body
assert.equal(resBody.status.message, 'Invalid email, password or password reset code.');
});
test('Fail - missing reset code', async function () {
const resBody = (await _passwordResetComplete(agent, email, password, null, 400)).body
assert.equal(resBody.status.message, 'Invalid email, password or password reset code.');
});
test('Fail - invalid password', async function () {
const resBody = (await _passwordResetComplete(agent, email, 'thispassisnotinvalidformat', passwordResetCode, 400)).body
const expected = {
status: {
code: 40000
},
errors: {
password: 'Password must be at least 6 character long, containing at least 1 digit, 1 lower and upper case character.'
}
};
assert.deepEqual(resBody, expected);
});
test('Fail - invalid email', async function () {
const resBody = (await _passwordResetComplete(agent, 'test_invalidemail@test.com', password, passwordResetCode, 400)).body
assert.equal(resBody.status.message, 'Invalid email, password or password reset code.');
});
test('Fail - no password reset has been requested by user (passwordResetCode is null)', async function () {
const agent = request.agent(app);
const email = 'test_' + new Date().getTime() + '@test.ee';
const password = 'testPassword123';
await signup(agent, email, password, null);
const resBody = (await _passwordResetComplete(agent, email, password, null, 400)).body
assert.equal(resBody.status.message, 'Invalid email, password or password reset code.');
});
test('Success', async function () {
await passwordResetComplete(agent, email, password, passwordResetCode);
const loginRes = await login(agent, email, password);
assert.equal(email, loginRes.body.data.email);
const user = await User.findOne({
where: db.where(db.fn('lower', db.col('email')), db.fn('lower', email))
});
assert.notEqual(user.passwordResetCode, passwordResetCode);
});
});
});
});
suite('Status', function () {
const agent = request.agent(app);
const email = 'test_status_' + new Date().getTime() + '@test.ee';
const password = 'testPassword123';
suiteSetup(async function () {
return userLib.createUser(agent, email, password, null);
});
test('Success', async function () {
await login(agent, email, password);
const user = (await status(agent)).body.data;
assert.equal(user.email, email);
});
test('Fail - Unauthorized', async function () {
await _status(request.agent(app), 401);
});
test('Fail - Unauthorized - JWT token expired', async function () {
const agent = request.agent(app);
const path = '/api/auth/status';
const token = jwt.sign({
id: 'notimportantinthistest',
scope: 'all'
}, config.session.privateKey, {
expiresIn: '.1ms',
algorithm: config.session.algorithm
});
const res = await agent
.get(path)
.set('Content-Type', 'application/json')
.set('Authorization', 'Bearer ' + token)
.expect(401)
.expect('Content-Type', /json/);
const expectedResponse = {
status: {
code: 40100,
message: 'JWT token has expired'
}
};
assert.deepEqual(res.body, expectedResponse);
});
});
suite('Open ID', function () {
const TEST_RESPONSE_TYPE = 'id_token token';
const TEST_PARTNER = {
id: 'e5fcb764-a635-4858-a496-e43079c7326b',
website: 'https://citizenospartner.ee',
redirectUriRegexp: '^https:\\/\\/([^\\.]*\\.)?citizenospartner.ee(:[0-9]{2,5})?\\/.*'
};
const TEST_CALLBACK_URI = 'https://dev.citizenospartner.ee/callback';
const agent = request.agent(app);
suiteSetup(async function () {
return shared
.syncDb();
});
suite('Authorize', function () {
suiteSetup(async function () {
return Partner
.upsert(TEST_PARTNER);
});
test('Success - 302 - User is logged in to CitizenOS AND has agreed before -> redirect_uri', async function () {
const agent = request.agent(app);
const user = await userLib.createUserAndLogin(agent, null, null, null);
await UserConsent.create({
userId: user.id,
partnerId: TEST_PARTNER.id
});
const state = '123213asdasas1231';
const authRes = await openIdAuthorize(agent, TEST_RESPONSE_TYPE, TEST_PARTNER.id, TEST_CALLBACK_URI, 'openid', state, 'dasd12312sdasAA');
const uriParts = authRes.headers.location.split('#');
assert.equal(uriParts[0], TEST_CALLBACK_URI);
const hashParams = uriParts[1];
const matchExp = new RegExp('^access_token=[^&]*&id_token=[^&]*&state=' + state + '$');
assert.match(hashParams, matchExp);
});
test('Success - 302 - User is logged in to CitizenOS AND has NOT agreed before -> /consent -> redirect_uri', async function () {
const agent = request.agent(app);
await userLib.createUserAndLogin(agent, null, null, null);
const authRes = await openIdAuthorize(agent, TEST_RESPONSE_TYPE, TEST_PARTNER.id, TEST_CALLBACK_URI, 'openid', '123213asdasas1231', 'dasd12312sdasAA');
const expectedUrl = urlLib.getFe('/:language/partners/:partnerId/consent', {
partnerId: TEST_PARTNER.id,
language: 'en'
});
assert.equal(authRes.headers.location, expectedUrl);
});
test.skip('Success - 302 - User is NOT logged in AND has agreed before -> /login -> redirect_uri', async function () {
});
test.skip('Success - 302 - User is NOT logged in AND has not agreed before -> /login -> /consent -> redirect_uri', async function () {
});
test.skip('Success - 302 - User is NOT registered -> /register -> /verify -> /consent -> redirect_uri', async function () {
});
test('Fail - 400 - Invalid or missing "client_id" parameter value', async function () {
const authRes = await _openIdAuthorize(agent, null, null, null, null, null, null, 400);
assert.equal(authRes.text, 'Invalid or missing "client_id" parameter value.');
});
test('Fail - 400 - Invalid partner configuration. Please contact system administrator.', async function () {
const authRes = await _openIdAuthorize(agent, null, uuid.v4(), null, null, null, null, 400);
assert.equal(authRes.text, 'Invalid partner configuration. Please contact system administrator.');
});
test('Fail - 400 - Invalid referer. Referer header does not match expected partner URI scheme.', async function () {
const res = await agent
.get('/api/auth/openid/authorize')
.set('Referer', 'https://invalidtest.ee/invalid/referer')
.query({
client_id: TEST_PARTNER.id
})
.expect(400);
assert.equal(res.text, 'Invalid referer. Referer header does not match expected partner URI scheme.');
});
test('Fail - 400 - Invalid or missing "redirect_uri" parameter value.', async function () {
const authRes = await _openIdAuthorize(agent, null, TEST_PARTNER.id, 'https://invalidtest.ee/callback', null, null, null, 400);
assert.equal(authRes.text, 'Invalid or missing "redirect_uri" parameter value.');
});
test('Fail - 400 - Invalid "redirect_uri". Cannot contain fragment component "#".', async function () {
const authRes = await _openIdAuthorize(agent, null, TEST_PARTNER.id, TEST_CALLBACK_URI + '#', null, null, null, 400);
assert.equal(authRes.text, 'Invalid "redirect_uri". Cannot contain fragment component "#".');
});
test('Fail - 302 - Unsupported "response_type" parameter value. Only "token id_token" is supported.', async function () {
const authRes = await openIdAuthorize(agent, 'code', TEST_PARTNER.id, TEST_CALLBACK_URI, null, null, null);
assert.equal(authRes.headers.location, TEST_CALLBACK_URI + '#error=unsupported_response_type&error_description=Unsupported%20%22response_type%22%20parameter%20value.%20Only%20%22token%20id_token%22%20is%20supported.');
});
test('Fail - 302 - Unsupported "scope" parameter value. Only "openid" is supported.', async function () {
const authRes = await openIdAuthorize(agent, TEST_RESPONSE_TYPE, TEST_PARTNER.id, TEST_CALLBACK_URI, 'invalid', null, null);
assert.equal(authRes.headers.location, TEST_CALLBACK_URI + '#error=invalid_scope&error_description=Unsupported%20%22scope%22%20parameter%20value.%20Only%20%22openid%22%20is%20supported.');
});
test('Fail - 302 - Invalid or missing "nonce" parameter value. "nonce" must be a random string with at least 14 characters of length.', async function () {
const authRes = await openIdAuthorize(agent, TEST_RESPONSE_TYPE, TEST_PARTNER.id, TEST_CALLBACK_URI, 'openid', null, null);
assert.equal(authRes.headers.location, TEST_CALLBACK_URI + '#error=invalid_request&error_description=Invalid%20or%20missing%20%22nonce%22%20parameter%20value.%20%22nonce%22%20must%20be%20a%20random%20string%20with%20at%20least%2014%20characters%20of%20length.&error_uri=http%3A%2F%2Fopenid.net%2Fspecs%2Fopenid-connect-implicit-1_0.html%23RequestParameters');
});
});
});
});
| 40.39429 | 375 | 0.534601 |
1e57e3b7e45c09104aae27c3fc8e085b115391b6 | 747 | js | JavaScript | cli.js | i4h/yaml-compose | c805e19e89878bcffd44d4b7b18603de60304305 | [
"MIT"
] | null | null | null | cli.js | i4h/yaml-compose | c805e19e89878bcffd44d4b7b18603de60304305 | [
"MIT"
] | null | null | null | cli.js | i4h/yaml-compose | c805e19e89878bcffd44d4b7b18603de60304305 | [
"MIT"
] | null | null | null | #!/usr/bin/env node
const fs = require('fs')
const path = require('path')
const meow = require('meow')
const { build } = require('./lib/yaml-compose')
const cli = meow(`
Usage
$ yaml-compose <source>
Options
--output, -o Output directory
Examples
$ yaml-compose source
$ yaml-compose source -o dist
`)
const source = cli.input[0]
const distDir = cli.flags.o || ''
if (!source) {
console.log('Missing source')
process.exit(1)
}
try {
const yaml = build(source)
if (distDir && !fs.existsSync(distDir)) {
fs.mkdirSync(distDir)
}
fs.writeFileSync(path.join(process.cwd(), distDir, path.basename(source)), yaml)
} catch (err) {
console.log('Failed to compose YAML file', err.message)
process.exit(1)
}
| 19.153846 | 82 | 0.65328 |
1e5814cef35c9ebf97ed490a28f01c8c57dfafb8 | 1,962 | js | JavaScript | docs/html/search/enumvalues_2.js | Connax-Oy/Bleam-Scanner-3 | 97004e3de2dfba5e8d9dec64214682e62619aa7e | [
"MIT"
] | 4 | 2021-06-01T11:23:39.000Z | 2021-07-23T18:49:50.000Z | docs/html/search/enumvalues_2.js | Connax-Oy/Bleam-Scanner-3 | 97004e3de2dfba5e8d9dec64214682e62619aa7e | [
"MIT"
] | null | null | null | docs/html/search/enumvalues_2.js | Connax-Oy/Bleam-Scanner-3 | 97004e3de2dfba5e8d9dec64214682e62619aa7e | [
"MIT"
] | 1 | 2021-06-02T07:42:58.000Z | 2021-06-02T07:42:58.000Z | var searchData=
[
['nrf_5fble_5fscan_5fevt_5fconnected_1165',['NRF_BLE_SCAN_EVT_CONNECTED',['../group___n_r_f___b_l_e___s_c_a_n___f_i_l_t_e_r___m_o_d_e.html#gga7b8b9be133ad06a1fab37ab63ac8037dab8b7a5edc7ca7d6afcc8e1e41075a34e',1,'task_scan.h']]],
['nrf_5fble_5fscan_5fevt_5fconnecting_5ferror_1166',['NRF_BLE_SCAN_EVT_CONNECTING_ERROR',['../group___n_r_f___b_l_e___s_c_a_n___f_i_l_t_e_r___m_o_d_e.html#gga7b8b9be133ad06a1fab37ab63ac8037da235459a29e8b2f33a30551d912fff014',1,'task_scan.h']]],
['nrf_5fble_5fscan_5fevt_5ffilter_5fmatch_1167',['NRF_BLE_SCAN_EVT_FILTER_MATCH',['../group___n_r_f___b_l_e___s_c_a_n___f_i_l_t_e_r___m_o_d_e.html#gga7b8b9be133ad06a1fab37ab63ac8037da5583c9bfadab473ec744ffd213458e68',1,'task_scan.h']]],
['nrf_5fble_5fscan_5fevt_5fnot_5ffound_1168',['NRF_BLE_SCAN_EVT_NOT_FOUND',['../group___n_r_f___b_l_e___s_c_a_n___f_i_l_t_e_r___m_o_d_e.html#gga7b8b9be133ad06a1fab37ab63ac8037dab9c71c1d8f62fd9938069a9409e4205a',1,'task_scan.h']]],
['nrf_5fble_5fscan_5fevt_5fscan_5freq_5freport_1169',['NRF_BLE_SCAN_EVT_SCAN_REQ_REPORT',['../group___n_r_f___b_l_e___s_c_a_n___f_i_l_t_e_r___m_o_d_e.html#gga7b8b9be133ad06a1fab37ab63ac8037da004cc551d70b7707201f1ed078d6264a',1,'task_scan.h']]],
['nrf_5fble_5fscan_5fevt_5fscan_5ftimeout_1170',['NRF_BLE_SCAN_EVT_SCAN_TIMEOUT',['../group___n_r_f___b_l_e___s_c_a_n___f_i_l_t_e_r___m_o_d_e.html#gga7b8b9be133ad06a1fab37ab63ac8037da70399a83bfc742f9d7895a8af3862fde',1,'task_scan.h']]],
['nrf_5fble_5fscan_5fevt_5fwhitelist_5fadv_5freport_1171',['NRF_BLE_SCAN_EVT_WHITELIST_ADV_REPORT',['../group___n_r_f___b_l_e___s_c_a_n___f_i_l_t_e_r___m_o_d_e.html#gga7b8b9be133ad06a1fab37ab63ac8037da5fca669cb089398f6061f39289af8d48',1,'task_scan.h']]],
['nrf_5fble_5fscan_5fevt_5fwhitelist_5frequest_1172',['NRF_BLE_SCAN_EVT_WHITELIST_REQUEST',['../group___n_r_f___b_l_e___s_c_a_n___f_i_l_t_e_r___m_o_d_e.html#gga7b8b9be133ad06a1fab37ab63ac8037da9b27f153c654f7112f078e88b2e14ef5',1,'task_scan.h']]]
];
| 163.5 | 256 | 0.882263 |
1e58d3547242ef1420201027dd715a2b9f3480d0 | 4,437 | js | JavaScript | tasklist/app.js | nigel-riss/js-es6-traning | 93185565c01bba4dd0d6b4321a1d6eaad5d696ef | [
"MIT"
] | null | null | null | tasklist/app.js | nigel-riss/js-es6-traning | 93185565c01bba4dd0d6b4321a1d6eaad5d696ef | [
"MIT"
] | null | null | null | tasklist/app.js | nigel-riss/js-es6-traning | 93185565c01bba4dd0d6b4321a1d6eaad5d696ef | [
"MIT"
] | null | null | null | // Define UI variables
const form = document.querySelector('#task-form');
const taskList = document.querySelector('.collection');
const clearBtn = document.querySelector('.clear-tasks');
const filter = document.querySelector('#filter');
const taskInput = document.querySelector('#task');
// Load all event listeners
loadEventListeners();
// Load all event listeners
function loadEventListeners() {
// DOM load event
document.addEventListener('DOMContentLoaded', getTasks);
// Add task event
form.addEventListener('submit', addTask);
// Remove task event
taskList.addEventListener('click', removeTask);
// Clear task event
clearBtn.addEventListener('click', clearTasks);
// Filter tasks event
filter.addEventListener('keyup', filterTasks);
}
// Get tasks from localStorage
function getTasks() {
let tasks;
if (localStorage.getItem('tasks') === null) {
tasks = [];
} else {
tasks = JSON.parse(localStorage.getItem('tasks'));
}
tasks.forEach(function(task) {
// Create li element
const li = document.createElement('li');
// Add class
li.className = 'collection-item';
// Create text node and append to li
li.appendChild(document.createTextNode(task));
// Create new link element
const link = document.createElement('a');
// Add class
link.className = 'delete-item secondary-content';
// Add icon html
link.innerHTML = '<i class="fa fa-remove"></i>'
// Append the link to li
li.appendChild(link);
// Append li to ul
taskList.appendChild(li);
});
}
// Add task
function addTask(event) {
if (taskInput.value === '') {
alert('Add a task');
event.preventDefault();
return;
}
// Create li element
const li = document.createElement('li');
// Add class
li.className = 'collection-item';
// Create text node and append to li
li.appendChild(document.createTextNode(taskInput.value));
// Create new link element
const link = document.createElement('a');
// Add class
link.className = 'delete-item secondary-content';
// Add icon html
link.innerHTML = '<i class="fa fa-remove"></i>'
// Append the link to li
li.appendChild(link);
// Append li to ul
taskList.appendChild(li);
// Store in LocalStorage
storeTaskInLocalStorage(taskInput.value);
// Clear input
taskInput.value = '';
event.preventDefault();
}
// Store task
function storeTaskInLocalStorage(task) {
let tasks;
if (localStorage.getItem('tasks') === null) {
tasks = [];
} else {
tasks = JSON.parse(localStorage.getItem('tasks'));
}
tasks.push(task);
localStorage.setItem('tasks', JSON.stringify(tasks));
}
// Remove task
function removeTask(event) {
if(event.target.parentElement.classList.contains('delete-item')) {
if (confirm('Are you sure?')) {
event.target.parentElement.parentElement.remove();
// Remove from localStorage
removeTaskFromLocalStorage(event.target.parentElement.parentElement);
}
}
}
// Remove from localStorage
function removeTaskFromLocalStorage(taskItem) {
let tasks;
if (localStorage.getItem('tasks') === null) {
tasks = [];
} else {
tasks = JSON.parse(localStorage.getItem('tasks'));
}
tasks.forEach(function(task, index) {
if (taskItem.textContent === task) {
tasks.splice(index, 1)
}
});
localStorage.setItem('tasks', JSON.stringify(tasks));
}
// Clear tasks
function clearTasks(event) {
// Way 1
// taskList.innerHTML = '';
// Way 2 (faster)
while (taskList.firstChild) {
taskList.removeChild(taskList.firstChild);
}
// Clear from localStorage
clearTasksFromLocalStorage();
}
// Clear tasks from localStorage
function clearTasksFromLocalStorage() {
localStorage.removeItem('tasks');
}
// Filter tasks
function filterTasks(event) {
const text = event.target.value.toLowerCase();
document.querySelectorAll('.collection-item').forEach(function(task) {
const item = task.firstChild.textContent;
if (item.toLowerCase().indexOf(text) != -1) {
task.style.display = 'block';
} else {
task.style.display = 'none';
}
});
console.log(text);
} | 26.568862 | 81 | 0.630606 |
1e58f9db01c9c972f5a9a05a91f54cac1e5c8d96 | 4,582 | js | JavaScript | www/47-es2015.508021c44952ce37fb60.js | kapsner/Riskestimator | ac6bcb84044147897581ee39c9c9bad7b2625270 | [
"Unlicense"
] | null | null | null | www/47-es2015.508021c44952ce37fb60.js | kapsner/Riskestimator | ac6bcb84044147897581ee39c9c9bad7b2625270 | [
"Unlicense"
] | null | null | null | www/47-es2015.508021c44952ce37fb60.js | kapsner/Riskestimator | ac6bcb84044147897581ee39c9c9bad7b2625270 | [
"Unlicense"
] | null | null | null | (window.webpackJsonp=window.webpackJsonp||[]).push([[47],{"lg/V":function(i,t,n){"use strict";n.r(t),n.d(t,"ion_infinite_scroll",(function(){return o})),n.d(t,"ion_infinite_scroll_content",(function(){return r}));var e=n("c1op"),s=n("AfW+"),l=n("YtD4");const o=class{constructor(i){Object(e.l)(this,i),this.thrPx=0,this.thrPc=0,this.didFire=!1,this.isBusy=!1,this.isLoading=!1,this.threshold="15%",this.disabled=!1,this.position="bottom",this.onScroll=()=>{const i=this.scrollEl;if(!i||!this.canStart())return 1;const t=this.el.offsetHeight;if(0===t)return 2;const n=i.scrollTop,e=i.offsetHeight,s=0!==this.thrPc?e*this.thrPc:this.thrPx;if(("bottom"===this.position?i.scrollHeight-t-n-s-e:n-t-s)<0){if(!this.didFire)return this.isLoading=!0,this.didFire=!0,this.ionInfinite.emit(),3}else this.didFire=!1;return 4},this.ionInfinite=Object(e.e)(this,"ionInfinite",7)}thresholdChanged(){const i=this.threshold;i.lastIndexOf("%")>-1?(this.thrPx=0,this.thrPc=parseFloat(i)/100):(this.thrPx=parseFloat(i),this.thrPc=0)}disabledChanged(){const i=this.disabled;i&&(this.isLoading=!1,this.isBusy=!1),this.enableScrollEvents(!i)}async connectedCallback(){const i=this.el.closest("ion-content");i?(this.scrollEl=await i.getScrollElement(),this.thresholdChanged(),this.disabledChanged(),"top"===this.position&&Object(e.m)(()=>{this.scrollEl&&(this.scrollEl.scrollTop=this.scrollEl.scrollHeight-this.scrollEl.clientHeight)})):console.error("<ion-infinite-scroll> must be used inside an <ion-content>")}disconnectedCallback(){this.enableScrollEvents(!1),this.scrollEl=void 0}async complete(){const i=this.scrollEl;if(this.isLoading&&i&&(this.isLoading=!1,"top"===this.position)){this.isBusy=!0;const t=i.scrollHeight-i.scrollTop;requestAnimationFrame(()=>{Object(e.g)(()=>{const n=i.scrollHeight-t;requestAnimationFrame(()=>{Object(e.m)(()=>{i.scrollTop=n,this.isBusy=!1})})})})}}canStart(){return!(this.disabled||this.isBusy||!this.scrollEl||this.isLoading)}enableScrollEvents(i){this.scrollEl&&(i?this.scrollEl.addEventListener("scroll",this.onScroll):this.scrollEl.removeEventListener("scroll",this.onScroll))}render(){const i=Object(e.d)(this),t=this.disabled;return Object(e.i)(e.a,{class:{[i]:!0,"infinite-scroll-loading":this.isLoading,"infinite-scroll-enabled":!t}})}get el(){return Object(e.f)(this)}static get watchers(){return{threshold:["thresholdChanged"],disabled:["disabledChanged"]}}static get style(){return"ion-infinite-scroll{display:none;width:100%}.infinite-scroll-enabled{display:block}"}},r=class{constructor(i){Object(e.l)(this,i)}componentDidLoad(){if(void 0===this.loadingSpinner){const i=Object(e.d)(this);this.loadingSpinner=s.b.get("infiniteLoadingSpinner",s.b.get("spinner","ios"===i?"lines":"crescent"))}}render(){const i=Object(e.d)(this);return Object(e.i)(e.a,{class:{[i]:!0,["infinite-scroll-content-"+i]:!0}},Object(e.i)("div",{class:"infinite-loading"},this.loadingSpinner&&Object(e.i)("div",{class:"infinite-loading-spinner"},Object(e.i)("ion-spinner",{name:this.loadingSpinner})),this.loadingText&&Object(e.i)("div",{class:"infinite-loading-text",innerHTML:Object(l.a)(this.loadingText)})))}static get style(){return"ion-infinite-scroll-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;min-height:84px;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.infinite-loading{margin-left:0;margin-right:0;margin-top:0;margin-bottom:32px;display:none;width:100%}.infinite-loading-text{margin-left:32px;margin-right:32px;margin-top:4px;margin-bottom:0}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.infinite-loading-text{margin-left:unset;margin-right:unset;-webkit-margin-start:32px;margin-inline-start:32px;-webkit-margin-end:32px;margin-inline-end:32px}}.infinite-scroll-loading ion-infinite-scroll-content>.infinite-loading{display:block}.infinite-scroll-content-md .infinite-loading-text{color:var(--ion-color-step-600,#666)}.infinite-scroll-content-md .infinite-loading-spinner .spinner-crescent circle,.infinite-scroll-content-md .infinite-loading-spinner .spinner-lines-md line,.infinite-scroll-content-md .infinite-loading-spinner .spinner-lines-small-md line{stroke:var(--ion-color-step-600,#666)}.infinite-scroll-content-md .infinite-loading-spinner .spinner-bubbles circle,.infinite-scroll-content-md .infinite-loading-spinner .spinner-circles circle,.infinite-scroll-content-md .infinite-loading-spinner .spinner-dots circle{fill:var(--ion-color-step-600,#666)}"}}}}]); | 4,582 | 4,582 | 0.760367 |
1e593367128cdcba26d891bfb80dd16d8355a034 | 1,279 | js | JavaScript | src/data/defaultValidationErrors.js | RomSem/portfolio | a67af0ace7b79a27909a1dfef6c90c9ac5a7ff6a | [
"MIT"
] | 2 | 2018-10-25T12:08:34.000Z | 2019-03-09T21:07:04.000Z | src/data/defaultValidationErrors.js | RomSem/portfolio | a67af0ace7b79a27909a1dfef6c90c9ac5a7ff6a | [
"MIT"
] | 13 | 2020-09-14T20:00:43.000Z | 2022-02-26T04:10:32.000Z | src/data/defaultValidationErrors.js | rosemdev/portfolio | 7decd9dd2dc124e12d86177df8016e043a445006 | [
"MIT"
] | null | null | null | export let defaultValidationErrors = {
valueMissing: () => 'This field is required, please fill it!',
typeMismatch: field => `Please, input data in correct format for required type ${field.getAttribute('type')} `,
tooShort: field => `Please enter minimum ${field.getAttribute('minLength')} symbols`,
tooLong: field => `Please enter maximum ${field.getAttribute('maxLength')} symbols`,
stepMismatch: field => `Please follow step ${field.getAttribute('step')}`,
rangeOverflow: field => `Please use number that no more than ${field.getAttribute('max')}`,
rangeUnderflow: field => `Please use number that no less than ${field.getAttribute('min')}`,
patternMismatch: field => `Please follow requested format: ${field.getAttribute('title')}`,
badInput: () => 'Please enter a number.',
//advanced messages
passwordSecurity: () => 'Minimum eight characters, at least one letter and one number',
passwordCoincidence: () => 'The password doesn\'t match! Please enter the same',
invalidEmail: () => 'Please use standard email format e.g. jon.doe@mail.com',
invalidNumberField: () => 'Please, input only numbers',
noTitle: () => 'Please, use correct format',
general: () => 'The value you entered for this field is invalid.'
}; | 71.055556 | 115 | 0.688038 |
1e59501236fd9604733063b3a88bf724d4428f40 | 1,206 | js | JavaScript | src/public/js/controllers/clientMenuController.js | auromota/easy-pizza-api | 7c0db7ecdca91f366a8fd619a129c5d1f80a413f | [
"MIT"
] | null | null | null | src/public/js/controllers/clientMenuController.js | auromota/easy-pizza-api | 7c0db7ecdca91f366a8fd619a129c5d1f80a413f | [
"MIT"
] | null | null | null | src/public/js/controllers/clientMenuController.js | auromota/easy-pizza-api | 7c0db7ecdca91f366a8fd619a129c5d1f80a413f | [
"MIT"
] | null | null | null | app.controller('clientMenuController', ['$scope', '$rootScope', '$state', 'LoginService', 'Order',
function ($scope, $rootScope, $state, LoginService, Order) {
processState($state.current.name);
function processState(stateName) {
switch (stateName) {
case 'client.orders':
$scope.isOrders = true;
$scope.isDrinks = false;
$scope.isPizzas = false;
break;
case 'client.drinks':
$scope.isOrders = false;
$scope.isDrinks = true;
$scope.isPizzas = false;
break;
case 'client.pizzas':
$scope.isOrders = false;
$scope.isDrinks = false;
$scope.isPizzas = true;
break;
default: break;
}
}
$rootScope.$on('$stateChangeStart', function (event, toState) {
processState(toState.name);
});
$scope.logout = function () {
LoginService.unregisterClient();
$state.go('login.client');
}
}
]); | 32.594595 | 98 | 0.45937 |
1e5aaf64100cf5826246e8d8dfa4a026a8b7ff12 | 558 | js | JavaScript | gatsby-config.js | soohjay/gatsby | 37e29d71f6fd4d041c648ecc8dc8727395de5e18 | [
"RSA-MD"
] | null | null | null | gatsby-config.js | soohjay/gatsby | 37e29d71f6fd4d041c648ecc8dc8727395de5e18 | [
"RSA-MD"
] | 4 | 2021-09-02T09:29:40.000Z | 2022-02-27T07:56:29.000Z | gatsby-config.js | soohjay/gatsby | 37e29d71f6fd4d041c648ecc8dc8727395de5e18 | [
"RSA-MD"
] | null | null | null | /**
* Configure your Gatsby site with this file.
*
* See: https://www.gatsbyjs.org/docs/gatsby-config/
*/
module.exports = {
/* Your site config here */
siteMetadata: {
title: "Gatsby Project",
description: "Practice Gatsby",
url: "https://www.something.com", // No trailing slash allowed!
image: "/images/snape.jpg", // Path to your image you placed in the 'static' folder
},
plugins: [
{
resolve: `gatsby-plugin-typography`,
options: {
pathToConfigModule: `src/utils/typography`,
},
},
],
}
| 23.25 | 87 | 0.614695 |
1e5b9f7e37f7116628648326d615bfd924e5e2b4 | 876 | js | JavaScript | react/synzi/virtual-care/src/organisms/PatientCareTeamAssignments/PatientAssignmentRows.js | jcalderaio/synzi-mobile-web-app | d7ca860c8e86c9ee8962efe22f3a3f758a740a3e | [
"Apache-2.0"
] | null | null | null | react/synzi/virtual-care/src/organisms/PatientCareTeamAssignments/PatientAssignmentRows.js | jcalderaio/synzi-mobile-web-app | d7ca860c8e86c9ee8962efe22f3a3f758a740a3e | [
"Apache-2.0"
] | null | null | null | react/synzi/virtual-care/src/organisms/PatientCareTeamAssignments/PatientAssignmentRows.js | jcalderaio/synzi-mobile-web-app | d7ca860c8e86c9ee8962efe22f3a3f758a740a3e | [
"Apache-2.0"
] | null | null | null | import React, { Component } from 'react'
import {
View,
Text,
TouchableOpacity
} from 'react-native';
//Styles
import styles from './styles'
export default class PatientProgramRows extends Component {
render() {
const { assignmentText, addCareTeam } = this.props
return (
<View>
<TouchableOpacity onPress={() => addCareTeam()}>
<View style={{flexDirection:'row', alignItems:'center', height: 60, justifyContent:'space-between', paddingLeft:10, paddingRight:10, backgroundColor:'black'}}>
<Text style={{ color: 'white' , fontSize: 16}}>
{assignmentText}
</Text>
</View>
</TouchableOpacity>
<View style={styles.sepViewStyle}/>
</View>
)
}
} | 29.2 | 180 | 0.528539 |
1e5bb2a5a312d88f26bf892d36cab03310c8f311 | 55 | js | JavaScript | src/components/about/index.js | since92x/my-react-app | 5ca3065e9df485ae0fc5d725dcaa0fc449374530 | [
"MIT"
] | null | null | null | src/components/about/index.js | since92x/my-react-app | 5ca3065e9df485ae0fc5d725dcaa0fc449374530 | [
"MIT"
] | null | null | null | src/components/about/index.js | since92x/my-react-app | 5ca3065e9df485ae0fc5d725dcaa0fc449374530 | [
"MIT"
] | null | null | null | import { About } from './about.jsx';
export { About };
| 18.333333 | 36 | 0.618182 |
1e5c3440698545f6ba35f905caa6b237ee96ed05 | 533 | js | JavaScript | example/src/store/sagas/usersSaga.js | rasha08/redux-saga-combine-watchers | 7ee8b5e970b9970f1d82624a0f0b243c4cdd5583 | [
"MIT"
] | null | null | null | example/src/store/sagas/usersSaga.js | rasha08/redux-saga-combine-watchers | 7ee8b5e970b9970f1d82624a0f0b243c4cdd5583 | [
"MIT"
] | null | null | null | example/src/store/sagas/usersSaga.js | rasha08/redux-saga-combine-watchers | 7ee8b5e970b9970f1d82624a0f0b243c4cdd5583 | [
"MIT"
] | null | null | null | import { put, takeLatest } from 'redux-saga/effects';
import {setUsers} from "../actions";
import {GET_USERS} from "../types";
import {apiUrl} from "../../config";
const usersEndpoint = 'users?_format=json&access-token=gnmLS6D7LX03eiadumz5CsMRQq5HR0PUa5VZ'
function* fetchUsers() {
const users = yield fetch(`${apiUrl}/${usersEndpoint}`).then(res => res.json());
yield put(setUsers(users.result))
}
function* getUsersWatcher() {
yield takeLatest(GET_USERS, fetchUsers)
}
export const userWatchers = [getUsersWatcher]
| 29.611111 | 92 | 0.72045 |