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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6f9f76332f24f02a6ac1785a1a81cafe7388a50a | 21,668 | js | JavaScript | node_modules/baseui/esm/popover/popover.js | krsonuC2od/swtportfolio | 37a071bb48ef878c4a1124d3500adda317e40381 | [
"MIT"
] | 1 | 2021-12-28T18:19:41.000Z | 2021-12-28T18:19:41.000Z | node_modules/baseui/esm/popover/popover.js | krsonuC2od/swtportfolio | 37a071bb48ef878c4a1124d3500adda317e40381 | [
"MIT"
] | null | null | null | node_modules/baseui/esm/popover/popover.js | krsonuC2od/swtportfolio | 37a071bb48ef878c4a1124d3500adda317e40381 | [
"MIT"
] | null | null | null | function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
/*
Copyright (c) 2018-2020 Uber Technologies, Inc.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
/* eslint-disable react/no-find-dom-node */
/* eslint-disable cup/no-undef */
import * as React from 'react';
import FocusLock from 'react-focus-lock';
import { getOverride, getOverrideProps } from '../helpers/overrides.js';
import getBuiId from '../utils/get-bui-id.js';
import { ACCESSIBILITY_TYPE, PLACEMENT, TRIGGER_TYPE, ANIMATE_OUT_TIME, ANIMATE_IN_TIME, POPOVER_MARGIN } from './constants.js';
import { Layer, TetherBehavior } from '../layer/index.js';
import { Arrow as StyledArrow, Body as StyledBody, Inner as StyledInner, Hidden } from './styled-components.js';
import { fromPopperPlacement } from './utils.js';
import defaultProps from './default-props.js';
var Popover = /*#__PURE__*/function (_React$Component) {
_inherits(Popover, _React$Component);
var _super = _createSuper(Popover);
function Popover() {
var _this;
_classCallCheck(this, Popover);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _super.call.apply(_super, [this].concat(args));
_defineProperty(_assertThisInitialized(_this), "animateInTimer", void 0);
_defineProperty(_assertThisInitialized(_this), "animateOutTimer", void 0);
_defineProperty(_assertThisInitialized(_this), "animateOutCompleteTimer", void 0);
_defineProperty(_assertThisInitialized(_this), "onMouseEnterTimer", void 0);
_defineProperty(_assertThisInitialized(_this), "onMouseLeaveTimer", void 0);
_defineProperty(_assertThisInitialized(_this), "generatedId", '');
_defineProperty(_assertThisInitialized(_this), "anchorRef", /*#__PURE__*/React.createRef());
_defineProperty(_assertThisInitialized(_this), "popperRef", /*#__PURE__*/React.createRef());
_defineProperty(_assertThisInitialized(_this), "arrowRef", /*#__PURE__*/React.createRef());
_defineProperty(_assertThisInitialized(_this), "state", _this.getDefaultState(_this.props));
_defineProperty(_assertThisInitialized(_this), "animateIn", function () {
if (_this.props.isOpen) {
_this.setState({
isAnimating: true
});
}
});
_defineProperty(_assertThisInitialized(_this), "animateOut", function () {
if (!_this.props.isOpen) {
_this.setState({
isAnimating: true
}); // Remove the popover from the DOM after animation finishes
_this.animateOutCompleteTimer = setTimeout(function () {
_this.setState({
isAnimating: false,
// Reset to ideal placement specified in props
placement: _this.props.placement
});
}, _this.props.animateOutTime || ANIMATE_OUT_TIME);
}
});
_defineProperty(_assertThisInitialized(_this), "onAnchorClick", function (e) {
if (_this.props.onClick) {
_this.props.onClick(e);
}
});
_defineProperty(_assertThisInitialized(_this), "onAnchorMouseEnter", function (e) {
// First clear any existing close timers, this ensures that the user can
// move their mouse from the popover back to anchor without it hiding
if (_this.onMouseLeaveTimer) {
clearTimeout(_this.onMouseLeaveTimer);
}
_this.triggerOnMouseEnterWithDelay(e);
});
_defineProperty(_assertThisInitialized(_this), "onAnchorMouseLeave", function (e) {
// Clear any existing open timer, otherwise popover could be stuck open
if (_this.onMouseEnterTimer) {
clearTimeout(_this.onMouseEnterTimer);
}
_this.triggerOnMouseLeaveWithDelay(e);
});
_defineProperty(_assertThisInitialized(_this), "onPopoverMouseEnter", function () {
if (_this.onMouseLeaveTimer) {
clearTimeout(_this.onMouseLeaveTimer);
}
});
_defineProperty(_assertThisInitialized(_this), "onPopoverMouseLeave", function (e) {
_this.triggerOnMouseLeaveWithDelay(e);
});
_defineProperty(_assertThisInitialized(_this), "onPopperUpdate", function (normalizedOffsets, data) {
var placement = fromPopperPlacement(data.placement) || PLACEMENT.top;
_this.setState({
arrowOffset: normalizedOffsets.arrow,
popoverOffset: normalizedOffsets.popper,
placement: placement
}); // Now that element has been positioned, we can animate it in
_this.animateInTimer = setTimeout(_this.animateIn, ANIMATE_IN_TIME);
return data;
});
_defineProperty(_assertThisInitialized(_this), "triggerOnMouseLeave", function (e) {
if (_this.props.onMouseLeave) {
_this.props.onMouseLeave(e);
}
});
_defineProperty(_assertThisInitialized(_this), "triggerOnMouseEnter", function (e) {
if (_this.props.onMouseEnter) {
_this.props.onMouseEnter(e);
}
});
_defineProperty(_assertThisInitialized(_this), "onDocumentClick", function (evt) {
var target = evt.target;
var popper = _this.popperRef.current;
var anchor = _this.anchorRef.current; // Ignore document click if it came from popover or anchor
if (!popper || popper === target || popper.contains(target)) {
return;
}
if (!anchor || anchor === target || anchor.contains(target)) {
return;
}
if (_this.props.onClickOutside) {
_this.props.onClickOutside(evt);
}
});
return _this;
}
_createClass(Popover, [{
key: "componentDidMount",
value: function componentDidMount() {
this.generatedId = getBuiId();
this.setState({
isMounted: true
});
}
}, {
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps, prevState) {
this.init(prevProps, prevState);
if (this.props.autoFocus && this.props.focusLock && !this.state.autoFocusAfterPositioning && this.popperRef.current !== null && this.popperRef.current.getBoundingClientRect().top > 0) {
this.setState({
autoFocusAfterPositioning: true
});
}
if (process.env.NODE_ENV !== "production") {
if (!this.anchorRef.current) {
// eslint-disable-next-line no-console
console.warn("[baseui][Popover] ref has not been passed to the Popper's anchor element.\n See how to pass the ref to an anchor element in the Popover example\n http://baseui.design/components/popover#anchor-ref-handling-example");
}
}
}
}, {
key: "init",
value: function init(prevProps, prevState) {
if (this.props.isOpen !== prevProps.isOpen || this.state.isMounted !== prevState.isMounted || this.state.isLayerMounted !== prevState.isLayerMounted) {
// Transition from closed to open.
if (this.props.isOpen && this.state.isLayerMounted) {
// Clear any existing timers (like previous animateOutCompleteTimer)
this.clearTimers();
return;
} // Transition from open to closed.
if (!this.props.isOpen && prevProps.isOpen) {
this.animateOutTimer = setTimeout(this.animateOut, 20);
return;
}
}
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.clearTimers();
}
}, {
key: "getDefaultState",
value: function getDefaultState(props) {
return {
isAnimating: false,
arrowOffset: {
left: 0,
top: 0
},
popoverOffset: {
left: 0,
top: 0
},
placement: props.placement,
isMounted: false,
isLayerMounted: false,
autoFocusAfterPositioning: false
};
}
}, {
key: "clearTimers",
value: function clearTimers() {
[this.animateInTimer, this.animateOutTimer, this.animateOutCompleteTimer, this.onMouseEnterTimer, this.onMouseLeaveTimer].forEach(function (timerId) {
if (timerId) {
clearTimeout(timerId);
}
});
}
}, {
key: "triggerOnMouseLeaveWithDelay",
value: function triggerOnMouseLeaveWithDelay(e) {
var _this2 = this;
var onMouseLeaveDelay = this.props.onMouseLeaveDelay;
if (onMouseLeaveDelay) {
this.onMouseLeaveTimer = setTimeout(function () {
return _this2.triggerOnMouseLeave(e);
}, onMouseLeaveDelay);
return;
}
this.triggerOnMouseLeave(e);
}
}, {
key: "triggerOnMouseEnterWithDelay",
value: function triggerOnMouseEnterWithDelay(e) {
var _this3 = this;
var onMouseEnterDelay = this.props.onMouseEnterDelay;
if (onMouseEnterDelay) {
this.onMouseEnterTimer = setTimeout(function () {
return _this3.triggerOnMouseEnter(e);
}, onMouseEnterDelay);
return;
}
this.triggerOnMouseEnter(e);
}
}, {
key: "isClickTrigger",
value: function isClickTrigger() {
return this.props.triggerType === TRIGGER_TYPE.click;
}
}, {
key: "isHoverTrigger",
value: function isHoverTrigger() {
return this.props.triggerType === TRIGGER_TYPE.hover;
}
}, {
key: "isAccessibilityTypeMenu",
value: function isAccessibilityTypeMenu() {
return this.props.accessibilityType === ACCESSIBILITY_TYPE.menu;
}
}, {
key: "isAccessibilityTypeTooltip",
value: function isAccessibilityTypeTooltip() {
return this.props.accessibilityType === ACCESSIBILITY_TYPE.tooltip;
}
}, {
key: "getAnchorIdAttr",
value: function getAnchorIdAttr() {
var popoverId = this.getPopoverIdAttr();
return popoverId ? "".concat(popoverId, "__anchor") : null;
}
}, {
key: "getPopoverIdAttr",
value: function getPopoverIdAttr() {
return this.props.id || this.generatedId || null;
}
}, {
key: "getAnchorProps",
value: function getAnchorProps() {
var isOpen = this.props.isOpen;
var anchorProps = {
'aria-haspopup': 'true',
'aria-expanded': isOpen ? 'true' : 'false',
key: 'popover-anchor',
ref: this.anchorRef
};
var popoverId = this.getPopoverIdAttr();
if (this.isAccessibilityTypeMenu()) {
var relationAttr = this.isClickTrigger() ? 'aria-controls' : 'aria-owns';
anchorProps[relationAttr] = isOpen ? popoverId : null;
} else if (this.isAccessibilityTypeTooltip()) {
anchorProps.id = this.getAnchorIdAttr();
anchorProps['aria-describedby'] = isOpen ? popoverId : null;
}
if (this.isHoverTrigger()) {
anchorProps.onMouseEnter = this.onAnchorMouseEnter;
anchorProps.onMouseLeave = this.onAnchorMouseLeave; // Make it focusable too
anchorProps.onBlur = this.props.onBlur;
anchorProps.onFocus = this.props.onFocus;
} else {
anchorProps.onClick = this.onAnchorClick;
}
return anchorProps;
}
}, {
key: "getPopoverBodyProps",
value: function getPopoverBodyProps() {
var bodyProps = {};
var popoverId = this.getPopoverIdAttr();
if (this.isAccessibilityTypeMenu()) {
bodyProps.id = popoverId;
} else if (this.isAccessibilityTypeTooltip()) {
bodyProps.id = popoverId;
bodyProps.role = 'tooltip';
}
if (this.isHoverTrigger()) {
bodyProps.onMouseEnter = this.onPopoverMouseEnter;
bodyProps.onMouseLeave = this.onPopoverMouseLeave;
}
return bodyProps;
}
}, {
key: "getSharedProps",
value: function getSharedProps() {
var _this$props = this.props,
isOpen = _this$props.isOpen,
showArrow = _this$props.showArrow,
_this$props$popoverMa = _this$props.popoverMargin,
popoverMargin = _this$props$popoverMa === void 0 ? POPOVER_MARGIN : _this$props$popoverMa;
var _this$state = this.state,
isAnimating = _this$state.isAnimating,
arrowOffset = _this$state.arrowOffset,
popoverOffset = _this$state.popoverOffset,
placement = _this$state.placement;
return {
$showArrow: !!showArrow,
$arrowOffset: arrowOffset,
$popoverOffset: popoverOffset,
$placement: placement,
$isAnimating: isAnimating,
$isOpen: isOpen,
$popoverMargin: popoverMargin
};
}
}, {
key: "getAnchorFromChildren",
value: function getAnchorFromChildren() {
var children = this.props.children;
var childArray = React.Children.toArray(children);
if (childArray.length !== 1) {
// eslint-disable-next-line no-console
console.error("[baseui] Exactly 1 child must be passed to Popover/Tooltip, found ".concat(childArray.length, " children"));
}
return childArray[0];
}
}, {
key: "renderAnchor",
value: function renderAnchor() {
var anchor = this.getAnchorFromChildren();
if (!anchor) {
return null;
}
var isValidElement = /*#__PURE__*/React.isValidElement(anchor);
var anchorProps = this.getAnchorProps();
if (_typeof(anchor) === 'object' && isValidElement) {
return /*#__PURE__*/React.cloneElement(anchor, anchorProps);
}
return /*#__PURE__*/React.createElement("span", anchorProps, anchor);
}
}, {
key: "renderPopover",
value: function renderPopover(renderedContent) {
var _this$props2 = this.props,
showArrow = _this$props2.showArrow,
_this$props2$override = _this$props2.overrides,
overrides = _this$props2$override === void 0 ? {} : _this$props2$override;
var ArrowOverride = overrides.Arrow,
BodyOverride = overrides.Body,
InnerOverride = overrides.Inner;
var Arrow = getOverride(ArrowOverride) || StyledArrow;
var Body = getOverride(BodyOverride) || StyledBody;
var Inner = getOverride(InnerOverride) || StyledInner;
var sharedProps = this.getSharedProps();
var bodyProps = this.getPopoverBodyProps();
return /*#__PURE__*/React.createElement(Body, _extends({
key: "popover-body",
ref: this.popperRef,
"data-baseweb": this.props['data-baseweb'] || 'popover'
}, bodyProps, sharedProps, getOverrideProps(BodyOverride)), showArrow ? /*#__PURE__*/React.createElement(Arrow, _extends({
key: "popover-arrow",
ref: this.arrowRef
}, sharedProps, getOverrideProps(ArrowOverride))) : null, /*#__PURE__*/React.createElement(Inner, _extends({}, sharedProps, getOverrideProps(InnerOverride)), renderedContent));
}
}, {
key: "renderContent",
value: function renderContent() {
var content = this.props.content;
return typeof content === 'function' ? content() : content;
}
}, {
key: "render",
value: function render() {
var _this4 = this;
var mountedAndOpen = this.state.isMounted && this.props.isOpen;
var rendered = [this.renderAnchor()];
var renderedContent = mountedAndOpen || this.props.renderAll ? this.renderContent() : null;
var defaultPopperOptions = {
modifiers: {
preventOverflow: {
enabled: !this.props.ignoreBoundary
}
}
}; // Only render popover on the browser (portals aren't supported server-side)
if (renderedContent) {
if (mountedAndOpen) {
rendered.push( /*#__PURE__*/React.createElement(Layer, {
key: "new-layer",
mountNode: this.props.mountNode,
onEscape: this.props.onEsc,
onDocumentClick: this.onDocumentClick,
onMount: function onMount() {
return _this4.setState({
isLayerMounted: true
});
},
onUnmount: function onUnmount() {
return _this4.setState({
isLayerMounted: false
});
}
}, /*#__PURE__*/React.createElement(TetherBehavior, {
anchorRef: this.anchorRef.current,
arrowRef: this.arrowRef.current,
popperRef: this.popperRef.current // Remove the `ignoreBoundary` prop in the next major version
// and have it replaced with the TetherBehavior props overrides
,
popperOptions: _objectSpread(_objectSpread({}, defaultPopperOptions), this.props.popperOptions),
onPopperUpdate: this.onPopperUpdate,
placement: this.state.placement
}, /*#__PURE__*/React.createElement(FocusLock, {
disabled: !this.props.focusLock,
noFocusGuards: false // see popover-focus-loop.scenario.js for why hover cannot return focus
,
returnFocus: this.props.returnFocus && !this.isHoverTrigger(),
autoFocus: this.state.autoFocusAfterPositioning // eslint-disable-line jsx-a11y/no-autofocus
}, this.renderPopover(renderedContent)))));
} else {
rendered.push( /*#__PURE__*/React.createElement(Hidden, {
key: "hidden-layer"
}, renderedContent));
}
}
return rendered;
}
}]);
return Popover;
}(React.Component);
_defineProperty(Popover, "defaultProps", defaultProps);
export default Popover;
/* eslint-enable react/no-find-dom-node */ | 40.350093 | 534 | 0.657975 |
6f9f80363b86b06c8115f5f0094f43236419fd91 | 399 | js | JavaScript | public/modules/contactos/config/contactos.client.config.js | delangel13/SchoolHeroProyect | d0d7ec191073a8845cd20a51f653997733d9c45b | [
"MIT"
] | null | null | null | public/modules/contactos/config/contactos.client.config.js | delangel13/SchoolHeroProyect | d0d7ec191073a8845cd20a51f653997733d9c45b | [
"MIT"
] | null | null | null | public/modules/contactos/config/contactos.client.config.js | delangel13/SchoolHeroProyect | d0d7ec191073a8845cd20a51f653997733d9c45b | [
"MIT"
] | null | null | null | 'use strict';
// Configuring the Articles module
angular.module('contactos').run(['Menus',
function(Menus) {
// Set top bar menu items
Menus.addMenuItem('topbar', 'Contactos', 'contactos', 'dropdown', '/contactos(/create)?');
Menus.addSubMenuItem('topbar', 'contactos', 'List Contactos', 'contactos');
Menus.addSubMenuItem('topbar', 'contactos', 'New Contacto', 'contactos/create');
}
]); | 36.272727 | 92 | 0.694236 |
6f9fb0575d591b17ba2038b7d875e66eafd4e646 | 809 | js | JavaScript | plugin/js/index.js | txsoura/Ideia | dcaa95cf7a4862f00eae55dd1261f3b23ea4dec2 | [
"Apache-2.0"
] | null | null | null | plugin/js/index.js | txsoura/Ideia | dcaa95cf7a4862f00eae55dd1261f3b23ea4dec2 | [
"Apache-2.0"
] | null | null | null | plugin/js/index.js | txsoura/Ideia | dcaa95cf7a4862f00eae55dd1261f3b23ea4dec2 | [
"Apache-2.0"
] | null | null | null | $(document).ready(function(){
$(".SlickCarousel").slick({
rtl:false, // If RTL Make it true & .slick-slide{float:right;}
autoplay:true,
autoplaySpeed:5000, // Slide Delay
speed:800, // Transition Speed
variableWidth: true,
slidesToShow:4, // Number Of Carousel
slidesToScroll:1, // Slide To Move
pauseOnHover:false,
appendArrows:$(".Container .Head .Arrows"), // Class For Arrows Buttons
prevArrow:'<span class="Slick-Prev"></span>',
nextArrow:'<span class="Slick-Next"></span>',
easing:"linear",
responsive:[
{breakpoint:801,settings:{
slidesToShow:3,
}},
{breakpoint:641,settings:{
slidesToShow:3,
}},
{breakpoint:481,settings:{
slidesToShow:1,
}},
],
})
}) | 29.962963 | 76 | 0.5822 |
6f9fb314b7691f60002de1fe0c8b5700cd0ffb3d | 20,844 | js | JavaScript | lib/runner/browser-job.js | ProdPerfect/testcafe | 35a9a41d954b23f38b4daaf4008bc6765ebccc95 | [
"MIT"
] | null | null | null | lib/runner/browser-job.js | ProdPerfect/testcafe | 35a9a41d954b23f38b4daaf4008bc6765ebccc95 | [
"MIT"
] | 1 | 2018-07-02T19:20:04.000Z | 2018-07-02T19:20:04.000Z | lib/runner/browser-job.js | ProdPerfect/testcafe | 35a9a41d954b23f38b4daaf4008bc6765ebccc95 | [
"MIT"
] | null | null | null | "use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const lodash_1 = require("lodash");
const async_event_emitter_1 = __importDefault(require("../utils/async-event-emitter"));
const test_run_controller_1 = __importDefault(require("./test-run-controller"));
const session_controller_1 = __importDefault(require("../test-run/session-controller"));
const browser_job_result_1 = __importDefault(require("./browser-job-result"));
// Browser job
class BrowserJob extends async_event_emitter_1.default {
constructor(tests, browserConnections, proxy, screenshots, warningLog, fixtureHookController, opts) {
super();
this.started = false;
this.total = 0;
this.passed = 0;
this.opts = opts;
this.proxy = proxy;
this.browserConnections = browserConnections;
this.screenshots = screenshots;
this.warningLog = warningLog;
this.fixtureHookController = fixtureHookController;
this.result = null;
this.testRunControllerQueue = tests.map((test, index) => this._createTestRunController(test, index));
this.completionQueue = [];
this.reportsPending = [];
this.connectionErrorListener = error => this._setResult(browser_job_result_1.default.errored, error);
this.browserConnections.map(bc => bc.once('error', this.connectionErrorListener));
}
_createTestRunController(test, index) {
const testRunController = new test_run_controller_1.default(test, index + 1, this.proxy, this.screenshots, this.warningLog, this.fixtureHookController, this.opts);
testRunController.on('test-run-create', async (testRunInfo) => {
await this.emit('test-run-create', testRunInfo);
});
testRunController.on('test-run-start', async () => {
await this.emit('test-run-start', testRunController.testRun);
});
testRunController.on('test-run-ready', async () => {
await this.emit('test-run-ready', testRunController);
});
testRunController.on('test-run-restart', async () => this._onTestRunRestart(testRunController));
testRunController.on('test-run-before-done', async () => {
await this.emit('test-run-before-done', testRunController);
});
testRunController.on('test-run-done', async () => this._onTestRunDone(testRunController));
testRunController.on('test-action-start', async (args) => {
await this.emit('test-action-start', args);
});
testRunController.on('test-action-done', async (args) => {
await this.emit('test-action-done', args);
});
return testRunController;
}
async _setResult(status, data) {
if (this.result)
return;
this.result = { status, data };
this.browserConnections.forEach(bc => bc.removeListener('error', this.connectionErrorListener));
await Promise.all(this.browserConnections.map(bc => bc.reportJobResult(this.result.status, this.result.data)));
}
_addToCompletionQueue(testRunInfo) {
this.completionQueue.push(testRunInfo);
}
_removeFromCompletionQueue(testRunInfo) {
lodash_1.pull(this.completionQueue, testRunInfo);
}
_onTestRunRestart(testRunController) {
this._removeFromCompletionQueue(testRunController);
this.testRunControllerQueue.unshift(testRunController);
}
async _onTestRunDone(testRunController) {
this.total++;
if (!testRunController.testRun.errs.length)
this.passed++;
while (this.completionQueue.length && this.completionQueue[0].done) {
testRunController = this.completionQueue.shift();
await this.emit('test-run-done', testRunController.testRun);
lodash_1.pull(this.reportsPending, testRunController);
}
if (!this.completionQueue.length && !this.hasQueuedTestRuns) {
if (!this.opts.live)
session_controller_1.default.closeSession(testRunController.testRun);
this
._setResult(browser_job_result_1.default.done, { total: this.total, passed: this.passed })
.then(() => this.emit('done'));
}
}
// API
get hasQueuedTestRuns() {
return !!this.testRunControllerQueue.length;
}
async popNextTestRunUrl(connection) {
while (this.testRunControllerQueue.length) {
// NOTE: before hook for test run fixture is currently
// executing, so test run is temporary blocked
const testRunController = this.testRunControllerQueue[0];
const isBlocked = testRunController.blocked;
const isConcurrency = this.opts.concurrency > 1;
const hasIncompleteTestRuns = this.completionQueue.some(controller => !controller.done);
const needWaitLastTestInFixture = this.reportsPending.some(controller => controller.test.fixture !== testRunController.test.fixture);
if (isBlocked || (hasIncompleteTestRuns || needWaitLastTestInFixture) && !isConcurrency)
break;
this.reportsPending.push(testRunController);
this.testRunControllerQueue.shift();
this._addToCompletionQueue(testRunController);
if (!this.started) {
this.started = true;
await this.emit('start');
}
const testRunUrl = await testRunController.start(connection);
if (testRunUrl)
return testRunUrl;
}
return null;
}
abort() {
this.clearListeners();
this._setResult(browser_job_result_1.default.aborted);
this.browserConnections.map(bc => bc.removeJob(this));
}
}
exports.default = BrowserJob;
module.exports = exports.default;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnJvd3Nlci1qb2IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcnVubmVyL2Jyb3dzZXItam9iLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsbUNBQXdDO0FBQ3hDLHVGQUE2RDtBQUM3RCxnRkFBc0Q7QUFDdEQsd0ZBQStEO0FBQy9ELDhFQUEwQztBQUcxQyxjQUFjO0FBQ2QsTUFBcUIsVUFBVyxTQUFRLDZCQUFpQjtJQUNyRCxZQUFhLEtBQUssRUFBRSxrQkFBa0IsRUFBRSxLQUFLLEVBQUUsV0FBVyxFQUFFLFVBQVUsRUFBRSxxQkFBcUIsRUFBRSxJQUFJO1FBQy9GLEtBQUssRUFBRSxDQUFDO1FBRVIsSUFBSSxDQUFDLE9BQU8sR0FBRyxLQUFLLENBQUM7UUFFckIsSUFBSSxDQUFDLEtBQUssR0FBbUIsQ0FBQyxDQUFDO1FBQy9CLElBQUksQ0FBQyxNQUFNLEdBQWtCLENBQUMsQ0FBQztRQUMvQixJQUFJLENBQUMsSUFBSSxHQUFvQixJQUFJLENBQUM7UUFDbEMsSUFBSSxDQUFDLEtBQUssR0FBbUIsS0FBSyxDQUFDO1FBQ25DLElBQUksQ0FBQyxrQkFBa0IsR0FBTSxrQkFBa0IsQ0FBQztRQUNoRCxJQUFJLENBQUMsV0FBVyxHQUFhLFdBQVcsQ0FBQztRQUN6QyxJQUFJLENBQUMsVUFBVSxHQUFjLFVBQVUsQ0FBQztRQUN4QyxJQUFJLENBQUMscUJBQXFCLEdBQUcscUJBQXFCLENBQUM7UUFDbkQsSUFBSSxDQUFDLE1BQU0sR0FBa0IsSUFBSSxDQUFDO1FBRWxDLElBQUksQ0FBQyxzQkFBc0IsR0FBRyxLQUFLLENBQUMsR0FBRyxDQUFDLENBQUMsSUFBSSxFQUFFLEtBQUssRUFBRSxFQUFFLENBQUMsSUFBSSxDQUFDLHdCQUF3QixDQUFDLElBQUksRUFBRSxLQUFLLENBQUMsQ0FBQyxDQUFDO1FBRXJHLElBQUksQ0FBQyxlQUFlLEdBQUcsRUFBRSxDQUFDO1FBQzFCLElBQUksQ0FBQyxjQUFjLEdBQUksRUFBRSxDQUFDO1FBRTFCLElBQUksQ0FBQyx1QkFBdUIsR0FBRyxLQUFLLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxVQUFVLENBQUMsNEJBQU0sQ0FBQyxPQUFPLEVBQUUsS0FBSyxDQUFDLENBQUM7UUFFL0UsSUFBSSxDQUFDLGtCQUFrQixDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsT0FBTyxFQUFFLElBQUksQ0FBQyx1QkFBdUIsQ0FBQyxDQUFDLENBQUM7SUFDdEYsQ0FBQztJQUVELHdCQUF3QixDQUFFLElBQUksRUFBRSxLQUFLO1FBQ2pDLE1BQU0saUJBQWlCLEdBQUcsSUFBSSw2QkFBaUIsQ0FBQyxJQUFJLEVBQUUsS0FBSyxHQUFHLENBQUMsRUFBRSxJQUFJLENBQUMsS0FBSyxFQUFFLElBQUksQ0FBQyxXQUFXLEVBQUUsSUFBSSxDQUFDLFVBQVUsRUFDMUcsSUFBSSxDQUFDLHFCQUFxQixFQUFFLElBQUksQ0FBQyxJQUFJLENBQUMsQ0FBQztRQUUzQyxpQkFBaUIsQ0FBQyxFQUFFLENBQUMsaUJBQWlCLEVBQUUsS0FBSyxFQUFDLFdBQVcsRUFBQyxFQUFFO1lBQ3hELE1BQU0sSUFBSSxDQUFDLElBQUksQ0FBQyxpQkFBaUIsRUFBRSxXQUFXLENBQUMsQ0FBQztRQUNwRCxDQUFDLENBQUMsQ0FBQztRQUNILGlCQUFpQixDQUFDLEVBQUUsQ0FBQyxnQkFBZ0IsRUFBRSxLQUFLLElBQUksRUFBRTtZQUM5QyxNQUFNLElBQUksQ0FBQyxJQUFJLENBQUMsZ0JBQWdCLEVBQUUsaUJBQWlCLENBQUMsT0FBTyxDQUFDLENBQUM7UUFDakUsQ0FBQyxDQUFDLENBQUM7UUFDSCxpQkFBaUIsQ0FBQyxFQUFFLENBQUMsZ0JBQWdCLEVBQUUsS0FBSyxJQUFJLEVBQUU7WUFDOUMsTUFBTSxJQUFJLENBQUMsSUFBSSxDQUFDLGdCQUFnQixFQUFFLGlCQUFpQixDQUFDLENBQUM7UUFDekQsQ0FBQyxDQUFDLENBQUM7UUFDSCxpQkFBaUIsQ0FBQyxFQUFFLENBQUMsa0JBQWtCLEVBQUUsS0FBSyxJQUFJLEVBQUUsQ0FBQyxJQUFJLENBQUMsaUJBQWlCLENBQUMsaUJBQWlCLENBQUMsQ0FBQyxDQUFDO1FBQ2hHLGlCQUFpQixDQUFDLEVBQUUsQ0FBQyxzQkFBc0IsRUFBRSxLQUFLLElBQUksRUFBRTtZQUNwRCxNQUFNLElBQUksQ0FBQyxJQUFJLENBQUMsc0JBQXNCLEVBQUUsaUJBQWlCLENBQUMsQ0FBQztRQUMvRCxDQUFDLENBQUMsQ0FBQztRQUNILGlCQUFpQixDQUFDLEVBQUUsQ0FBQyxlQUFlLEVBQUUsS0FBSyxJQUFJLEVBQUUsQ0FBQyxJQUFJLENBQUMsY0FBYyxDQUFDLGlCQUFpQixDQUFDLENBQUMsQ0FBQztRQUUxRixpQkFBaUIsQ0FBQyxFQUFFLENBQUMsbUJBQW1CLEVBQUUsS0FBSyxFQUFDLElBQUksRUFBQyxFQUFFO1lBQ25ELE1BQU0sSUFBSSxDQUFDLElBQUksQ0FBQyxtQkFBbUIsRUFBRSxJQUFJLENBQUMsQ0FBQztRQUMvQyxDQUFDLENBQUMsQ0FBQztRQUVILGlCQUFpQixDQUFDLEVBQUUsQ0FBQyxrQkFBa0IsRUFBRSxLQUFLLEVBQUMsSUFBSSxFQUFDLEVBQUU7WUFDbEQsTUFBTSxJQUFJLENBQUMsSUFBSSxDQUFDLGtCQUFrQixFQUFFLElBQUksQ0FBQyxDQUFDO1FBQzlDLENBQUMsQ0FBQyxDQUFDO1FBRUgsT0FBTyxpQkFBaUIsQ0FBQztJQUM3QixDQUFDO0lBRUQsS0FBSyxDQUFDLFVBQVUsQ0FBRSxNQUFNLEVBQUUsSUFBSTtRQUMxQixJQUFJLElBQUksQ0FBQyxNQUFNO1lBQ1gsT0FBTztRQUVYLElBQUksQ0FBQyxNQUFNLEdBQUcsRUFBRSxNQUFNLEVBQUUsSUFBSSxFQUFFLENBQUM7UUFFL0IsSUFBSSxDQUFDLGtCQUFrQixDQUFDLE9BQU8sQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxjQUFjLENBQUMsT0FBTyxFQUFFLElBQUksQ0FBQyx1QkFBdUIsQ0FBQyxDQUFDLENBQUM7UUFFaEcsTUFBTSxPQUFPLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQyxrQkFBa0IsQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsZUFBZSxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsTUFBTSxFQUFFLElBQUksQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDO0lBQ25ILENBQUM7SUFFRCxxQkFBcUIsQ0FBRSxXQUFXO1FBQzlCLElBQUksQ0FBQyxlQUFlLENBQUMsSUFBSSxDQUFDLFdBQVcsQ0FBQyxDQUFDO0lBQzNDLENBQUM7SUFFRCwwQkFBMEIsQ0FBRSxXQUFXO1FBQ25DLGFBQU0sQ0FBQyxJQUFJLENBQUMsZUFBZSxFQUFFLFdBQVcsQ0FBQyxDQUFDO0lBQzlDLENBQUM7SUFFRCxpQkFBaUIsQ0FBRSxpQkFBaUI7UUFDaEMsSUFBSSxDQUFDLDBCQUEwQixDQUFDLGlCQUFpQixDQUFDLENBQUM7UUFDbkQsSUFBSSxDQUFDLHNCQUFzQixDQUFDLE9BQU8sQ0FBQyxpQkFBaUIsQ0FBQyxDQUFDO0lBQzNELENBQUM7SUFFRCxLQUFLLENBQUMsY0FBYyxDQUFFLGlCQUFpQjtRQUNuQyxJQUFJLENBQUMsS0FBSyxFQUFFLENBQUM7UUFFYixJQUFJLENBQUMsaUJBQWlCLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxNQUFNO1lBQ3RDLElBQUksQ0FBQyxNQUFNLEVBQUUsQ0FBQztRQUVsQixPQUFPLElBQUksQ0FBQyxlQUFlLENBQUMsTUFBTSxJQUFJLElBQUksQ0FBQyxlQUFlLENBQUMsQ0FBQyxDQUFDLENBQUMsSUFBSSxFQUFFO1lBQ2hFLGlCQUFpQixHQUFHLElBQUksQ0FBQyxlQUFlLENBQUMsS0FBSyxFQUFFLENBQUM7WUFFakQsTUFBTSxJQUFJLENBQUMsSUFBSSxDQUFDLGVBQWUsRUFBRSxpQkFBaUIsQ0FBQyxPQUFPLENBQUMsQ0FBQztZQUU1RCxhQUFNLENBQUMsSUFBSSxDQUFDLGNBQWMsRUFBRSxpQkFBaUIsQ0FBQyxDQUFDO1NBQ2xEO1FBRUQsSUFBSSxDQUFDLElBQUksQ0FBQyxlQUFlLENBQUMsTUFBTSxJQUFJLENBQUMsSUFBSSxDQUFDLGlCQUFpQixFQUFFO1lBQ3pELElBQUksQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLElBQUk7Z0JBQ2YsNEJBQWlCLENBQUMsWUFBWSxDQUFDLGlCQUFpQixDQUFDLE9BQU8sQ0FBQyxDQUFDO1lBRTlELElBQUk7aUJBQ0MsVUFBVSxDQUFDLDRCQUFNLENBQUMsSUFBSSxFQUFFLEVBQUUsS0FBSyxFQUFFLElBQUksQ0FBQyxLQUFLLEVBQUUsTUFBTSxFQUFFLElBQUksQ0FBQyxNQUFNLEVBQUUsQ0FBQztpQkFDbkUsSUFBSSxDQUFDLEdBQUcsRUFBRSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQztTQUN0QztJQUNMLENBQUM7SUFFRCxNQUFNO0lBQ04sSUFBSSxpQkFBaUI7UUFDakIsT0FBTyxDQUFDLENBQUMsSUFBSSxDQUFDLHNCQUFzQixDQUFDLE1BQU0sQ0FBQztJQUNoRCxDQUFDO0lBRUQsS0FBSyxDQUFDLGlCQUFpQixDQUFFLFVBQVU7UUFDL0IsT0FBTyxJQUFJLENBQUMsc0JBQXNCLENBQUMsTUFBTSxFQUFFO1lBQ3ZDLHNEQUFzRDtZQUN0RCw4Q0FBOEM7WUFDOUMsTUFBTSxpQkFBaUIsR0FBVyxJQUFJLENBQUMsc0JBQXNCLENBQUMsQ0FBQyxDQUFDLENBQUM7WUFDakUsTUFBTSxTQUFTLEdBQW1CLGlCQUFpQixDQUFDLE9BQU8sQ0FBQztZQUM1RCxNQUFNLGFBQWEsR0FBZSxJQUFJLENBQUMsSUFBSSxDQUFDLFdBQVcsR0FBRyxDQUFDLENBQUM7WUFDNUQsTUFBTSxxQkFBcUIsR0FBTyxJQUFJLENBQUMsZUFBZSxDQUFDLElBQUksQ0FBQyxVQUFVLENBQUMsRUFBRSxDQUFDLENBQUMsVUFBVSxDQUFDLElBQUksQ0FBQyxDQUFDO1lBQzVGLE1BQU0seUJBQXlCLEdBQUcsSUFBSSxDQUFDLGNBQWMsQ0FBQyxJQUFJLENBQUMsVUFBVSxDQUFDLEVBQUUsQ0FBQyxVQUFVLENBQUMsSUFBSSxDQUFDLE9BQU8sS0FBSyxpQkFBaUIsQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLENBQUM7WUFFckksSUFBSSxTQUFTLElBQUksQ0FBQyxxQkFBcUIsSUFBSSx5QkFBeUIsQ0FBQyxJQUFJLENBQUMsYUFBYTtnQkFDbkYsTUFBTTtZQUVWLElBQUksQ0FBQyxjQUFjLENBQUMsSUFBSSxDQUFDLGlCQUFpQixDQUFDLENBQUM7WUFDNUMsSUFBSSxDQUFDLHNCQUFzQixDQUFDLEtBQUssRUFBRSxDQUFDO1lBQ3BDLElBQUksQ0FBQyxxQkFBcUIsQ0FBQyxpQkFBaUIsQ0FBQyxDQUFDO1lBRTlDLElBQUksQ0FBQyxJQUFJLENBQUMsT0FBTyxFQUFFO2dCQUNmLElBQUksQ0FBQyxPQUFPLEdBQUcsSUFBSSxDQUFDO2dCQUNwQixNQUFNLElBQUksQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLENBQUM7YUFDNUI7WUFFRCxNQUFNLFVBQVUsR0FBRyxNQUFNLGlCQUFpQixDQUFDLEtBQUssQ0FBQyxVQUFVLENBQUMsQ0FBQztZQUU3RCxJQUFJLFVBQVU7Z0JBQ1YsT0FBTyxVQUFVLENBQUM7U0FDekI7UUFFRCxPQUFPLElBQUksQ0FBQztJQUNoQixDQUFDO0lBRUQsS0FBSztRQUNELElBQUksQ0FBQyxjQUFjLEVBQUUsQ0FBQztRQUN0QixJQUFJLENBQUMsVUFBVSxDQUFDLDRCQUFNLENBQUMsT0FBTyxDQUFDLENBQUM7UUFDaEMsSUFBSSxDQUFDLGtCQUFrQixDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxTQUFTLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQztJQUMxRCxDQUFDO0NBQ0o7QUFqSkQsNkJBaUpDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgcHVsbCBhcyByZW1vdmUgfSBmcm9tICdsb2Rhc2gnO1xuaW1wb3J0IEFzeW5jRXZlbnRFbWl0dGVyIGZyb20gJy4uL3V0aWxzL2FzeW5jLWV2ZW50LWVtaXR0ZXInO1xuaW1wb3J0IFRlc3RSdW5Db250cm9sbGVyIGZyb20gJy4vdGVzdC1ydW4tY29udHJvbGxlcic7XG5pbXBvcnQgU2Vzc2lvbkNvbnRyb2xsZXIgZnJvbSAnLi4vdGVzdC1ydW4vc2Vzc2lvbi1jb250cm9sbGVyJztcbmltcG9ydCBSRVNVTFQgZnJvbSAnLi9icm93c2VyLWpvYi1yZXN1bHQnO1xuXG5cbi8vIEJyb3dzZXIgam9iXG5leHBvcnQgZGVmYXVsdCBjbGFzcyBCcm93c2VySm9iIGV4dGVuZHMgQXN5bmNFdmVudEVtaXR0ZXIge1xuICAgIGNvbnN0cnVjdG9yICh0ZXN0cywgYnJvd3NlckNvbm5lY3Rpb25zLCBwcm94eSwgc2NyZWVuc2hvdHMsIHdhcm5pbmdMb2csIGZpeHR1cmVIb29rQ29udHJvbGxlciwgb3B0cykge1xuICAgICAgICBzdXBlcigpO1xuXG4gICAgICAgIHRoaXMuc3RhcnRlZCA9IGZhbHNlO1xuXG4gICAgICAgIHRoaXMudG90YWwgICAgICAgICAgICAgICAgID0gMDtcbiAgICAgICAgdGhpcy5wYXNzZWQgICAgICAgICAgICAgICAgPSAwO1xuICAgICAgICB0aGlzLm9wdHMgICAgICAgICAgICAgICAgICA9IG9wdHM7XG4gICAgICAgIHRoaXMucHJveHkgICAgICAgICAgICAgICAgID0gcHJveHk7XG4gICAgICAgIHRoaXMuYnJvd3NlckNvbm5lY3Rpb25zICAgID0gYnJvd3NlckNvbm5lY3Rpb25zO1xuICAgICAgICB0aGlzLnNjcmVlbnNob3RzICAgICAgICAgICA9IHNjcmVlbnNob3RzO1xuICAgICAgICB0aGlzLndhcm5pbmdMb2cgICAgICAgICAgICA9IHdhcm5pbmdMb2c7XG4gICAgICAgIHRoaXMuZml4dHVyZUhvb2tDb250cm9sbGVyID0gZml4dHVyZUhvb2tDb250cm9sbGVyO1xuICAgICAgICB0aGlzLnJlc3VsdCAgICAgICAgICAgICAgICA9IG51bGw7XG5cbiAgICAgICAgdGhpcy50ZXN0UnVuQ29udHJvbGxlclF1ZXVlID0gdGVzdHMubWFwKCh0ZXN0LCBpbmRleCkgPT4gdGhpcy5fY3JlYXRlVGVzdFJ1bkNvbnRyb2xsZXIodGVzdCwgaW5kZXgpKTtcblxuICAgICAgICB0aGlzLmNvbXBsZXRpb25RdWV1ZSA9IFtdO1xuICAgICAgICB0aGlzLnJlcG9ydHNQZW5kaW5nICA9IFtdO1xuXG4gICAgICAgIHRoaXMuY29ubmVjdGlvbkVycm9yTGlzdGVuZXIgPSBlcnJvciA9PiB0aGlzLl9zZXRSZXN1bHQoUkVTVUxULmVycm9yZWQsIGVycm9yKTtcblxuICAgICAgICB0aGlzLmJyb3dzZXJDb25uZWN0aW9ucy5tYXAoYmMgPT4gYmMub25jZSgnZXJyb3InLCB0aGlzLmNvbm5lY3Rpb25FcnJvckxpc3RlbmVyKSk7XG4gICAgfVxuXG4gICAgX2NyZWF0ZVRlc3RSdW5Db250cm9sbGVyICh0ZXN0LCBpbmRleCkge1xuICAgICAgICBjb25zdCB0ZXN0UnVuQ29udHJvbGxlciA9IG5ldyBUZXN0UnVuQ29udHJvbGxlcih0ZXN0LCBpbmRleCArIDEsIHRoaXMucHJveHksIHRoaXMuc2NyZWVuc2hvdHMsIHRoaXMud2FybmluZ0xvZyxcbiAgICAgICAgICAgIHRoaXMuZml4dHVyZUhvb2tDb250cm9sbGVyLCB0aGlzLm9wdHMpO1xuXG4gICAgICAgIHRlc3RSdW5Db250cm9sbGVyLm9uKCd0ZXN0LXJ1bi1jcmVhdGUnLCBhc3luYyB0ZXN0UnVuSW5mbyA9PiB7XG4gICAgICAgICAgICBhd2FpdCB0aGlzLmVtaXQoJ3Rlc3QtcnVuLWNyZWF0ZScsIHRlc3RSdW5JbmZvKTtcbiAgICAgICAgfSk7XG4gICAgICAgIHRlc3RSdW5Db250cm9sbGVyLm9uKCd0ZXN0LXJ1bi1zdGFydCcsIGFzeW5jICgpID0+IHtcbiAgICAgICAgICAgIGF3YWl0IHRoaXMuZW1pdCgndGVzdC1ydW4tc3RhcnQnLCB0ZXN0UnVuQ29udHJvbGxlci50ZXN0UnVuKTtcbiAgICAgICAgfSk7XG4gICAgICAgIHRlc3RSdW5Db250cm9sbGVyLm9uKCd0ZXN0LXJ1bi1yZWFkeScsIGFzeW5jICgpID0+IHtcbiAgICAgICAgICAgIGF3YWl0IHRoaXMuZW1pdCgndGVzdC1ydW4tcmVhZHknLCB0ZXN0UnVuQ29udHJvbGxlcik7XG4gICAgICAgIH0pO1xuICAgICAgICB0ZXN0UnVuQ29udHJvbGxlci5vbigndGVzdC1ydW4tcmVzdGFydCcsIGFzeW5jICgpID0+IHRoaXMuX29uVGVzdFJ1blJlc3RhcnQodGVzdFJ1bkNvbnRyb2xsZXIpKTtcbiAgICAgICAgdGVzdFJ1bkNvbnRyb2xsZXIub24oJ3Rlc3QtcnVuLWJlZm9yZS1kb25lJywgYXN5bmMgKCkgPT4ge1xuICAgICAgICAgICAgYXdhaXQgdGhpcy5lbWl0KCd0ZXN0LXJ1bi1iZWZvcmUtZG9uZScsIHRlc3RSdW5Db250cm9sbGVyKTtcbiAgICAgICAgfSk7XG4gICAgICAgIHRlc3RSdW5Db250cm9sbGVyLm9uKCd0ZXN0LXJ1bi1kb25lJywgYXN5bmMgKCkgPT4gdGhpcy5fb25UZXN0UnVuRG9uZSh0ZXN0UnVuQ29udHJvbGxlcikpO1xuXG4gICAgICAgIHRlc3RSdW5Db250cm9sbGVyLm9uKCd0ZXN0LWFjdGlvbi1zdGFydCcsIGFzeW5jIGFyZ3MgPT4ge1xuICAgICAgICAgICAgYXdhaXQgdGhpcy5lbWl0KCd0ZXN0LWFjdGlvbi1zdGFydCcsIGFyZ3MpO1xuICAgICAgICB9KTtcblxuICAgICAgICB0ZXN0UnVuQ29udHJvbGxlci5vbigndGVzdC1hY3Rpb24tZG9uZScsIGFzeW5jIGFyZ3MgPT4ge1xuICAgICAgICAgICAgYXdhaXQgdGhpcy5lbWl0KCd0ZXN0LWFjdGlvbi1kb25lJywgYXJncyk7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIHJldHVybiB0ZXN0UnVuQ29udHJvbGxlcjtcbiAgICB9XG5cbiAgICBhc3luYyBfc2V0UmVzdWx0IChzdGF0dXMsIGRhdGEpIHtcbiAgICAgICAgaWYgKHRoaXMucmVzdWx0KVxuICAgICAgICAgICAgcmV0dXJuO1xuXG4gICAgICAgIHRoaXMucmVzdWx0ID0geyBzdGF0dXMsIGRhdGEgfTtcblxuICAgICAgICB0aGlzLmJyb3dzZXJDb25uZWN0aW9ucy5mb3JFYWNoKGJjID0+IGJjLnJlbW92ZUxpc3RlbmVyKCdlcnJvcicsIHRoaXMuY29ubmVjdGlvbkVycm9yTGlzdGVuZXIpKTtcblxuICAgICAgICBhd2FpdCBQcm9taXNlLmFsbCh0aGlzLmJyb3dzZXJDb25uZWN0aW9ucy5tYXAoYmMgPT4gYmMucmVwb3J0Sm9iUmVzdWx0KHRoaXMucmVzdWx0LnN0YXR1cywgdGhpcy5yZXN1bHQuZGF0YSkpKTtcbiAgICB9XG5cbiAgICBfYWRkVG9Db21wbGV0aW9uUXVldWUgKHRlc3RSdW5JbmZvKSB7XG4gICAgICAgIHRoaXMuY29tcGxldGlvblF1ZXVlLnB1c2godGVzdFJ1bkluZm8pO1xuICAgIH1cblxuICAgIF9yZW1vdmVGcm9tQ29tcGxldGlvblF1ZXVlICh0ZXN0UnVuSW5mbykge1xuICAgICAgICByZW1vdmUodGhpcy5jb21wbGV0aW9uUXVldWUsIHRlc3RSdW5JbmZvKTtcbiAgICB9XG5cbiAgICBfb25UZXN0UnVuUmVzdGFydCAodGVzdFJ1bkNvbnRyb2xsZXIpIHtcbiAgICAgICAgdGhpcy5fcmVtb3ZlRnJvbUNvbXBsZXRpb25RdWV1ZSh0ZXN0UnVuQ29udHJvbGxlcik7XG4gICAgICAgIHRoaXMudGVzdFJ1bkNvbnRyb2xsZXJRdWV1ZS51bnNoaWZ0KHRlc3RSdW5Db250cm9sbGVyKTtcbiAgICB9XG5cbiAgICBhc3luYyBfb25UZXN0UnVuRG9uZSAodGVzdFJ1bkNvbnRyb2xsZXIpIHtcbiAgICAgICAgdGhpcy50b3RhbCsrO1xuXG4gICAgICAgIGlmICghdGVzdFJ1bkNvbnRyb2xsZXIudGVzdFJ1bi5lcnJzLmxlbmd0aClcbiAgICAgICAgICAgIHRoaXMucGFzc2VkKys7XG5cbiAgICAgICAgd2hpbGUgKHRoaXMuY29tcGxldGlvblF1ZXVlLmxlbmd0aCAmJiB0aGlzLmNvbXBsZXRpb25RdWV1ZVswXS5kb25lKSB7XG4gICAgICAgICAgICB0ZXN0UnVuQ29udHJvbGxlciA9IHRoaXMuY29tcGxldGlvblF1ZXVlLnNoaWZ0KCk7XG5cbiAgICAgICAgICAgIGF3YWl0IHRoaXMuZW1pdCgndGVzdC1ydW4tZG9uZScsIHRlc3RSdW5Db250cm9sbGVyLnRlc3RSdW4pO1xuXG4gICAgICAgICAgICByZW1vdmUodGhpcy5yZXBvcnRzUGVuZGluZywgdGVzdFJ1bkNvbnRyb2xsZXIpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCF0aGlzLmNvbXBsZXRpb25RdWV1ZS5sZW5ndGggJiYgIXRoaXMuaGFzUXVldWVkVGVzdFJ1bnMpIHtcbiAgICAgICAgICAgIGlmICghdGhpcy5vcHRzLmxpdmUpXG4gICAgICAgICAgICAgICAgU2Vzc2lvbkNvbnRyb2xsZXIuY2xvc2VTZXNzaW9uKHRlc3RSdW5Db250cm9sbGVyLnRlc3RSdW4pO1xuXG4gICAgICAgICAgICB0aGlzXG4gICAgICAgICAgICAgICAgLl9zZXRSZXN1bHQoUkVTVUxULmRvbmUsIHsgdG90YWw6IHRoaXMudG90YWwsIHBhc3NlZDogdGhpcy5wYXNzZWQgfSlcbiAgICAgICAgICAgICAgICAudGhlbigoKSA9PiB0aGlzLmVtaXQoJ2RvbmUnKSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvLyBBUElcbiAgICBnZXQgaGFzUXVldWVkVGVzdFJ1bnMgKCkge1xuICAgICAgICByZXR1cm4gISF0aGlzLnRlc3RSdW5Db250cm9sbGVyUXVldWUubGVuZ3RoO1xuICAgIH1cblxuICAgIGFzeW5jIHBvcE5leHRUZXN0UnVuVXJsIChjb25uZWN0aW9uKSB7XG4gICAgICAgIHdoaWxlICh0aGlzLnRlc3RSdW5Db250cm9sbGVyUXVldWUubGVuZ3RoKSB7XG4gICAgICAgICAgICAvLyBOT1RFOiBiZWZvcmUgaG9vayBmb3IgdGVzdCBydW4gZml4dHVyZSBpcyBjdXJyZW50bHlcbiAgICAgICAgICAgIC8vIGV4ZWN1dGluZywgc28gdGVzdCBydW4gaXMgdGVtcG9yYXJ5IGJsb2NrZWRcbiAgICAgICAgICAgIGNvbnN0IHRlc3RSdW5Db250cm9sbGVyICAgICAgICAgPSB0aGlzLnRlc3RSdW5Db250cm9sbGVyUXVldWVbMF07XG4gICAgICAgICAgICBjb25zdCBpc0Jsb2NrZWQgICAgICAgICAgICAgICAgID0gdGVzdFJ1bkNvbnRyb2xsZXIuYmxvY2tlZDtcbiAgICAgICAgICAgIGNvbnN0IGlzQ29uY3VycmVuY3kgICAgICAgICAgICAgPSB0aGlzLm9wdHMuY29uY3VycmVuY3kgPiAxO1xuICAgICAgICAgICAgY29uc3QgaGFzSW5jb21wbGV0ZVRlc3RSdW5zICAgICA9IHRoaXMuY29tcGxldGlvblF1ZXVlLnNvbWUoY29udHJvbGxlciA9PiAhY29udHJvbGxlci5kb25lKTtcbiAgICAgICAgICAgIGNvbnN0IG5lZWRXYWl0TGFzdFRlc3RJbkZpeHR1cmUgPSB0aGlzLnJlcG9ydHNQZW5kaW5nLnNvbWUoY29udHJvbGxlciA9PiBjb250cm9sbGVyLnRlc3QuZml4dHVyZSAhPT0gdGVzdFJ1bkNvbnRyb2xsZXIudGVzdC5maXh0dXJlKTtcblxuICAgICAgICAgICAgaWYgKGlzQmxvY2tlZCB8fCAoaGFzSW5jb21wbGV0ZVRlc3RSdW5zIHx8IG5lZWRXYWl0TGFzdFRlc3RJbkZpeHR1cmUpICYmICFpc0NvbmN1cnJlbmN5KVxuICAgICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICB0aGlzLnJlcG9ydHNQZW5kaW5nLnB1c2godGVzdFJ1bkNvbnRyb2xsZXIpO1xuICAgICAgICAgICAgdGhpcy50ZXN0UnVuQ29udHJvbGxlclF1ZXVlLnNoaWZ0KCk7XG4gICAgICAgICAgICB0aGlzLl9hZGRUb0NvbXBsZXRpb25RdWV1ZSh0ZXN0UnVuQ29udHJvbGxlcik7XG5cbiAgICAgICAgICAgIGlmICghdGhpcy5zdGFydGVkKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5zdGFydGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBhd2FpdCB0aGlzLmVtaXQoJ3N0YXJ0Jyk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGNvbnN0IHRlc3RSdW5VcmwgPSBhd2FpdCB0ZXN0UnVuQ29udHJvbGxlci5zdGFydChjb25uZWN0aW9uKTtcblxuICAgICAgICAgICAgaWYgKHRlc3RSdW5VcmwpXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRlc3RSdW5Vcmw7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gbnVsbDtcbiAgICB9XG5cbiAgICBhYm9ydCAoKSB7XG4gICAgICAgIHRoaXMuY2xlYXJMaXN0ZW5lcnMoKTtcbiAgICAgICAgdGhpcy5fc2V0UmVzdWx0KFJFU1VMVC5hYm9ydGVkKTtcbiAgICAgICAgdGhpcy5icm93c2VyQ29ubmVjdGlvbnMubWFwKGJjID0+IGJjLnJlbW92ZUpvYih0aGlzKSk7XG4gICAgfVxufVxuIl19 | 166.752 | 14,874 | 0.899779 |
6fa048bb27a881ba0f1f4a4ac5677239c8780c2b | 187 | js | JavaScript | src/index.js | noderaider/redux-webpack-boilerplate | 8484e18ea9fa76a25edc07e6de06984f5fb783f2 | [
"MIT"
] | 7 | 2016-08-20T17:20:28.000Z | 2017-11-15T14:00:43.000Z | src/index.js | cchamberlain/redux-webpack-boilerplate | 8484e18ea9fa76a25edc07e6de06984f5fb783f2 | [
"MIT"
] | 2 | 2016-04-17T08:01:11.000Z | 2016-04-28T19:06:16.000Z | src/index.js | noderaider/redux-webpack-boilerplate | 8484e18ea9fa76a25edc07e6de06984f5fb783f2 | [
"MIT"
] | 9 | 2016-07-25T06:33:53.000Z | 2018-06-04T18:56:10.000Z | import { getServer } from './lib'
import { configServers, configClients } from './etc'
const lib = { getServer }
const etc = { configServers, configClients }
export { lib, etc }
| 23.375 | 53 | 0.663102 |
6fa0e3be0bcdceaf51c80bbf5060b7f0e03c78aa | 1,937 | js | JavaScript | server/src/instanceConfig/instanceConfigValidator.js | stoizner/yakjs | 25564e8b31d341f4e727be76e114a966bcbb977c | [
"MIT"
] | null | null | null | server/src/instanceConfig/instanceConfigValidator.js | stoizner/yakjs | 25564e8b31d341f4e727be76e114a966bcbb977c | [
"MIT"
] | null | null | null | server/src/instanceConfig/instanceConfigValidator.js | stoizner/yakjs | 25564e8b31d341f4e727be76e114a966bcbb977c | [
"MIT"
] | null | null | null | 'use strict';
const magic = require('../util/magicNumbers');
/**
* Validate properties of {yak.api.InstanceConfig}.
* @constructor
* @param {!yak.api.InstanceConfig} instance
*/
function InstanceConfigValidator(instance) {
/**
* Last or top prio validation error message.
* @type {string}
*/
let errorMessage = '';
/**
* Whether the instance has valid values.
* @type {boolean}
*/
let allValuesValid = true;
/**
* Has instance valid values.
* @returns {boolean} Whether the instance has valid values.
*/
this.isValid = function isValid() {
allValuesValid = true;
validateName();
validatePort();
return allValuesValid;
};
/**
* Get the validation error message.
* @returns {string} The validation error message.
*/
this.getMessage = function getMessage() {
return errorMessage;
};
/**
* Validate name.
*/
function validateName() {
let regex = /^[A-z0-9-_ ]+$/;
let isValid = Boolean(regex.exec(instance.name));
allValuesValid = allValuesValid && isValid;
if (!isValid) {
errorMessage = 'Please correct name. Only use this characters: [A-z0-9_- ]';
}
}
/**
* Validate port number.
*/
function validatePort() {
let regex = /^[0-9]+$/;
let isTextValid = Boolean(regex.exec(instance.port));
let isValueValid = false;
if (isTextValid) {
let value = parseInt(instance.port, 10);
if (value > 0 && value < magic.MAX_PORT_NUMBER) {
isValueValid = true;
}
}
allValuesValid = allValuesValid && isTextValid && isValueValid;
if (!isValueValid) {
errorMessage = 'Please correct port. Valid values are between 1-65535.';
}
}
}
module.exports = InstanceConfigValidator;
| 23.337349 | 88 | 0.568921 |
6fa0ef21882718a0009a91bc40aaccecbced9346 | 3,205 | js | JavaScript | test/bjorlingIntegration.js | bmavity/bjorling-nedb-storage | 1ab06c6fc608bd43735d147870d18fd8c2d0ae0b | [
"MITNFA"
] | null | null | null | test/bjorlingIntegration.js | bmavity/bjorling-nedb-storage | 1ab06c6fc608bd43735d147870d18fd8c2d0ae0b | [
"MITNFA"
] | null | null | null | test/bjorlingIntegration.js | bmavity/bjorling-nedb-storage | 1ab06c6fc608bd43735d147870d18fd8c2d0ae0b | [
"MITNFA"
] | null | null | null | var storage = require('../')
, bjorling = require('bjorling')
, fs = require('fs')
, dbPath = './testdb/bjorlingIntegration.db'
, eb = require('./eb')
describe('bjorling storage integration, when retrieving projection state by id', function() {
var state
before(function(done) {
var s = storage(dbPath + '1')
, b = bjorling(__filename, {
storage: s
, key: 'storageId'
})
b.when({
'$new': function(e) {
return {
storageId: e.storageId
, count: 0
, ids: []
}
}
, 'FirstEvent': function(s, e) {
s.count += 1
s.ids.push(e.eventId)
}
, 'SecondEvent': function(s, e) {
s.count += 2
s.ids.push(e.eventId)
}
})
function getEntry() {
b.get('abcdef', function(err, val) {
if(err) return done(err)
state = val
done()
})
}
function addEvent(evt, cb) {
b.processEvent(evt, cb)
}
setImmediate(function() {
addEvent({
__type: 'SecondEvent'
, data: {
storageId: 'abcdef'
, eventId: 1
}
}, function() {
addEvent({
__type: 'FirstEvent'
, data: {
storageId: 'abcdef'
, eventId: 3
}
}, getEntry)
})
})
})
after(function(done) {
fs.unlink(dbPath + '1', done)
})
it('should have the proper count', function() {
state.count.should.equal(3)
})
it('should contain the first event id', function() {
state.ids.should.include(3)
})
it('should contain the second event id', function() {
state.ids.should.include(1)
})
})
describe('bjorling storage integration, when retrieving projection state by an index', function() {
var state
before(function(done) {
var s = storage(dbPath + '2')
, b = bjorling(__filename, {
storage: s
, key: 'storageId'
})
b.addIndex('lockerId')
b.when({
'$new': function(e) {
return {
storageId: e.storageId
, count: 0
, ids: []
}
}
, 'FirstEvent': function(s, e) {
s.count += 1
s.ids.push(e.eventId)
}
, 'SecondEvent': function(s, e) {
s.count += 2
s.lockerId = e.lockerId
s.ids.push(e.eventId)
}
, 'ThirdEvent': function(s, e) {
s.count += 3
s.ids = []
}
})
function getEntry() {
b.get({ lockerId: 178 }, function(err, val) {
if(err) return done(err)
state = val
done()
})
}
function addEvent(evt, cb) {
b.processEvent(evt, cb)
}
setImmediate(function() {
var e1 = {
__type: 'FirstEvent'
, data: {
storageId: 'abcdef'
, eventId: 3
}
}
, e2 = {
__type: 'SecondEvent'
, data: {
storageId: 'abcdef'
, lockerId: 178
, eventId: 1
}
}
, e3 = {
__type: 'ThirdEvent'
, data: {
lockerId: 178
}
}
addEvent(e1, function() {
addEvent(e2, function() {
addEvent(e3, getEntry)
})
})
})
})
after(function(done) {
fs.unlink(dbPath + '2', done)
})
it('should have the proper count', function() {
state.count.should.equal(6)
})
it('should not contain the first event id', function() {
state.ids.should.not.include(3)
})
it('should contain the second event id', function() {
state.ids.should.not.include(1)
})
})
| 18.314286 | 99 | 0.551326 |
6fa11cfa153e4019af1446c8c03fdd2139807c4b | 812 | js | JavaScript | test/node/basic-node.js | shubhsnov/gonzales-pe | 75d5010a6abdab2ec4fb9edba460d781fa39ff43 | [
"MIT"
] | 293 | 2015-01-05T07:38:56.000Z | 2022-03-25T03:42:36.000Z | test/node/basic-node.js | shubhsnov/gonzales-pe | 75d5010a6abdab2ec4fb9edba460d781fa39ff43 | [
"MIT"
] | 258 | 2015-01-02T17:53:43.000Z | 2022-01-11T15:35:23.000Z | test/node/basic-node.js | shubhsnov/gonzales-pe | 75d5010a6abdab2ec4fb9edba460d781fa39ff43 | [
"MIT"
] | 84 | 2015-02-02T20:33:54.000Z | 2021-08-15T00:48:34.000Z | var assert = require('assert');
var gonzales = require('../../');
describe('Node#contains()', function() {
it('should return true for existing child node', function() {
var ast = gonzales.parse('a{}');
assert.equal(ast.contains('ruleset'), true);
});
it('should return false for nonexisting child node', function() {
var ast = gonzales.parse('a{}');
assert.equal(ast.contains('nani'), false);
});
});
describe('Node#last()', function() {
it('should return null if no node is found', function() {
var ast = gonzales.parse('a{}');
assert.equal(ast.last('declaration'), null);
});
it('should return the node if one is found', function() {
var ast = gonzales.parse('a{}');
assert.equal(ast.last('ruleset'), ast.content[0]);
});
});
| 30.074074 | 69 | 0.594828 |
6fa15cf36e20f690b11bb8273e7f110c85323b4a | 460 | js | JavaScript | main.js | redhat6ddc/webproj8.io | 77125de39732c96d0c6348270e2684d920ae0a78 | [
"MIT"
] | null | null | null | main.js | redhat6ddc/webproj8.io | 77125de39732c96d0c6348270e2684d920ae0a78 | [
"MIT"
] | null | null | null | main.js | redhat6ddc/webproj8.io | 77125de39732c96d0c6348270e2684d920ae0a78 | [
"MIT"
] | null | null | null | const deg = 6;
const hr = document.getElementById('hr');
const mn = document.getElementById('mn');
const sc = document.getElementById('sc');
setInterval(() =>{
let day =new Date();
let hh = day.getHours() *30;
let mm = day.getMinutes() *deg;
let ss = day.getSeconds() *deg;
hr.style.transform = `rotateZ(${(hh)+(mm/12)}deg)`;
mn.style.transform = `rotateZ(${mm}deg)`;
sc.style.transform = `rotateZ(${ss}deg)`;
}) | 27.058824 | 56 | 0.595652 |
6fa1ccc1b09bae5355de6f87fd4c1e17b192e95c | 10,895 | js | JavaScript | node_modules/jqwidgets-scripts/jqwidgets-ng/dist/bundles/jqwidgets-ng-jqxtree.umd.min.js | huzaifah/initiativetracker | 9bce18d44558bcf1ada4487a2772a4dd20d527aa | [
"RSA-MD"
] | null | null | null | node_modules/jqwidgets-scripts/jqwidgets-ng/dist/bundles/jqwidgets-ng-jqxtree.umd.min.js | huzaifah/initiativetracker | 9bce18d44558bcf1ada4487a2772a4dd20d527aa | [
"RSA-MD"
] | 6 | 2021-03-09T13:34:10.000Z | 2022-02-26T15:57:36.000Z | node_modules/jqwidgets-scripts/jqwidgets-ng/dist/bundles/jqwidgets-ng-jqxtree.umd.min.js | huzaifah/initiativetracker | 9bce18d44558bcf1ada4487a2772a4dd20d527aa | [
"RSA-MD"
] | null | null | null | require('../../jqwidgets-scripts/jqwidgets/jqxcore');
require('../../jqwidgets-scripts/jqwidgets/jqxdata');
require('../../jqwidgets-scripts/jqwidgets/jqxbuttons');
require('../../jqwidgets-scripts/jqwidgets/jqxscrollbar');
require('../../jqwidgets-scripts/jqwidgets/jqxpanel');
require('../../jqwidgets-scripts/jqwidgets/jqxdragdrop');
require('../../jqwidgets-scripts/jqwidgets/jqxtree');
require('../../jqwidgets-scripts/jqwidgets/jqxcheckbox');
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core")):"function"==typeof define&&define.amd?define("jqwidgets-ng/jqxtree",["exports","@angular/core"],e):e((t["jqwidgets-ng"]=t["jqwidgets-ng"]||{},t["jqwidgets-ng"].jqxtree={}),t.ng.core)}(this,function(t,e){"use strict";function i(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var r,n,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(r=i.next()).done;)s.push(r.value)}catch(h){n={error:h}}finally{try{r&&!r.done&&(o=i["return"])&&o.call(i)}finally{if(n)throw n.error}}return s}var o=function(){function t(t){this.autoCreate=!0,this.properties=["animationShowDuration","animationHideDuration","allowDrag","allowDrop","checkboxes","dragStart","dragEnd","disabled","easing","enableHover","height","hasThreeStates","incrementalSearch","keyboardNavigation","rtl","source","toggleIndicatorSize","toggleMode","theme","width"],this.onAdded=new e.EventEmitter,this.onCheckChange=new e.EventEmitter,this.onCollapse=new e.EventEmitter,this.onDragStart=new e.EventEmitter,this.onDragEnd=new e.EventEmitter,this.onExpand=new e.EventEmitter,this.onItemClick=new e.EventEmitter,this.onRemoved=new e.EventEmitter,this.onSelect=new e.EventEmitter,this.elementRef=t}return t.prototype.ngOnInit=function(){this.autoCreate&&this.createComponent()},t.prototype.ngOnChanges=function(t){if(this.host)for(var e=0;e<this.properties.length;e++){var o="attr"+this.properties[e].substring(0,1).toUpperCase()+this.properties[e].substring(1),r=!1;if(this[o]!==undefined){if("object"==typeof this[o]){if(this[o]instanceof Array&&(r=this.arraysEqual(this[o],this.host.jqxTree(this.properties[e]))),r)return!1;this.host.jqxTree(this.properties[e],this[o]);continue}this[o]!==this.host.jqxTree(this.properties[e])&&this.host.jqxTree(this.properties[e],this[o])}}},t.prototype.arraysEqual=function(t,e){if(t&&!e||!t&&e)return!1;if(t.length!=e.length)return!1;for(var o=0;o<t.length;o++)if(t[o]!==e[o])return!1;return!0},t.prototype.manageAttributes=function(){for(var t={},e=0;e<this.properties.length;e++){var o="attr"+this.properties[e].substring(0,1).toUpperCase()+this.properties[e].substring(1);this[o]!==undefined&&(t[this.properties[e]]=this[o])}return t},t.prototype.moveClasses=function(t,e){var o,r=t.classList;0<r.length&&(o=e.classList).add.apply(o,function n(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(i(arguments[e]));return t}(r)),t.className=""},t.prototype.moveStyles=function(t,e){var o=t.style.cssText;e.style.cssText=o,t.style.cssText=""},t.prototype.createComponent=function(t){this.host||(t?JQXLite.extend(t,this.manageAttributes()):t=this.manageAttributes(),this.host=JQXLite(this.elementRef.nativeElement.firstChild),this.moveClasses(this.elementRef.nativeElement,this.host[0]),this.moveStyles(this.elementRef.nativeElement,this.host[0]),this.__wireEvents__(),this.widgetObject=jqwidgets.createInstance(this.host,"jqxTree",t))},t.prototype.createWidget=function(t){this.createComponent(t)},t.prototype.__updateRect__=function(){this.host&&this.host.css({width:this.attrWidth,height:this.attrHeight})},t.prototype.setOptions=function(t){this.host.jqxTree("setOptions",t)},t.prototype.animationShowDuration=function(t){if(t===undefined)return this.host.jqxTree("animationShowDuration");this.host.jqxTree("animationShowDuration",t)},t.prototype.animationHideDuration=function(t){if(t===undefined)return this.host.jqxTree("animationHideDuration");this.host.jqxTree("animationHideDuration",t)},t.prototype.allowDrag=function(t){if(t===undefined)return this.host.jqxTree("allowDrag");this.host.jqxTree("allowDrag",t)},t.prototype.allowDrop=function(t){if(t===undefined)return this.host.jqxTree("allowDrop");this.host.jqxTree("allowDrop",t)},t.prototype.checkboxes=function(t){if(t===undefined)return this.host.jqxTree("checkboxes");this.host.jqxTree("checkboxes",t)},t.prototype.dragStart=function(t){if(t===undefined)return this.host.jqxTree("dragStart");this.host.jqxTree("dragStart",t)},t.prototype.dragEnd=function(t){if(t===undefined)return this.host.jqxTree("dragEnd");this.host.jqxTree("dragEnd",t)},t.prototype.disabled=function(t){if(t===undefined)return this.host.jqxTree("disabled");this.host.jqxTree("disabled",t)},t.prototype.easing=function(t){if(t===undefined)return this.host.jqxTree("easing");this.host.jqxTree("easing",t)},t.prototype.enableHover=function(t){if(t===undefined)return this.host.jqxTree("enableHover");this.host.jqxTree("enableHover",t)},t.prototype.height=function(t){if(t===undefined)return this.host.jqxTree("height");this.host.jqxTree("height",t)},t.prototype.hasThreeStates=function(t){if(t===undefined)return this.host.jqxTree("hasThreeStates");this.host.jqxTree("hasThreeStates",t)},t.prototype.incrementalSearch=function(t){if(t===undefined)return this.host.jqxTree("incrementalSearch");this.host.jqxTree("incrementalSearch",t)},t.prototype.keyboardNavigation=function(t){if(t===undefined)return this.host.jqxTree("keyboardNavigation");this.host.jqxTree("keyboardNavigation",t)},t.prototype.rtl=function(t){if(t===undefined)return this.host.jqxTree("rtl");this.host.jqxTree("rtl",t)},t.prototype.source=function(t){if(t===undefined)return this.host.jqxTree("source");this.host.jqxTree("source",t)},t.prototype.toggleIndicatorSize=function(t){if(t===undefined)return this.host.jqxTree("toggleIndicatorSize");this.host.jqxTree("toggleIndicatorSize",t)},t.prototype.toggleMode=function(t){if(t===undefined)return this.host.jqxTree("toggleMode");this.host.jqxTree("toggleMode",t)},t.prototype.theme=function(t){if(t===undefined)return this.host.jqxTree("theme");this.host.jqxTree("theme",t)},t.prototype.width=function(t){if(t===undefined)return this.host.jqxTree("width");this.host.jqxTree("width",t)},t.prototype.addBefore=function(t,e){this.host.jqxTree("addBefore",t,e)},t.prototype.addAfter=function(t,e){this.host.jqxTree("addAfter",t,e)},t.prototype.addTo=function(t,e){this.host.jqxTree("addTo",t,e)},t.prototype.clear=function(){this.host.jqxTree("clear")},t.prototype.checkAll=function(){this.host.jqxTree("checkAll")},t.prototype.checkItem=function(t,e){this.host.jqxTree("checkItem",t,e)},t.prototype.collapseAll=function(){this.host.jqxTree("collapseAll")},t.prototype.collapseItem=function(t){this.host.jqxTree("collapseItem",t)},t.prototype.destroy=function(){this.host.jqxTree("destroy")},t.prototype.disableItem=function(t){this.host.jqxTree("disableItem",t)},t.prototype.ensureVisible=function(t){this.host.jqxTree("ensureVisible",t)},t.prototype.enableItem=function(t){this.host.jqxTree("enableItem",t)},t.prototype.enableAll=function(){this.host.jqxTree("enableAll")},t.prototype.expandAll=function(){this.host.jqxTree("expandAll")},t.prototype.expandItem=function(t){this.host.jqxTree("expandItem",t)},t.prototype.focus=function(){this.host.jqxTree("focus")},t.prototype.getCheckedItems=function(){return this.host.jqxTree("getCheckedItems")},t.prototype.getUncheckedItems=function(){return this.host.jqxTree("getUncheckedItems")},t.prototype.getItems=function(){return this.host.jqxTree("getItems")},t.prototype.getItem=function(t){return this.host.jqxTree("getItem",t)},t.prototype.getSelectedItem=function(){return this.host.jqxTree("getSelectedItem")},t.prototype.getPrevItem=function(t){return this.host.jqxTree("getPrevItem",t)},t.prototype.getNextItem=function(t){return this.host.jqxTree("getNextItem",t)},t.prototype.hitTest=function(t,e){return this.host.jqxTree("hitTest",t,e)},t.prototype.removeItem=function(t){this.host.jqxTree("removeItem",t)},t.prototype.render=function(){this.host.jqxTree("render")},t.prototype.refresh=function(){this.host.jqxTree("refresh")},t.prototype.selectItem=function(t){this.host.jqxTree("selectItem",t)},t.prototype.uncheckAll=function(){this.host.jqxTree("uncheckAll")},t.prototype.uncheckItem=function(t){this.host.jqxTree("uncheckItem",t)},t.prototype.updateItem=function(t,e){this.host.jqxTree("updateItem",t,e)},t.prototype.val=function(t){return t!==undefined?this.host.jqxTree("val",t):this.host.jqxTree("val")},t.prototype.__wireEvents__=function(){var e=this;this.host.on("added",function(t){e.onAdded.emit(t)}),this.host.on("checkChange",function(t){e.onCheckChange.emit(t)}),this.host.on("collapse",function(t){e.onCollapse.emit(t)}),this.host.on("dragStart",function(t){e.onDragStart.emit(t)}),this.host.on("dragEnd",function(t){e.onDragEnd.emit(t)}),this.host.on("expand",function(t){e.onExpand.emit(t)}),this.host.on("itemClick",function(t){e.onItemClick.emit(t)}),this.host.on("removed",function(t){e.onRemoved.emit(t)}),this.host.on("select",function(t){e.onSelect.emit(t)})},t.decorators=[{type:e.Component,args:[{selector:"jqxTree",template:"<div><ng-content></ng-content></div>"}]}],t.ctorParameters=function(){return[{type:e.ElementRef}]},t.propDecorators={attrAnimationShowDuration:[{type:e.Input,args:["animationShowDuration"]}],attrAnimationHideDuration:[{type:e.Input,args:["animationHideDuration"]}],attrAllowDrag:[{type:e.Input,args:["allowDrag"]}],attrAllowDrop:[{type:e.Input,args:["allowDrop"]}],attrCheckboxes:[{type:e.Input,args:["checkboxes"]}],attrDragStart:[{type:e.Input,args:["dragStart"]}],attrDragEnd:[{type:e.Input,args:["dragEnd"]}],attrDisabled:[{type:e.Input,args:["disabled"]}],attrEasing:[{type:e.Input,args:["easing"]}],attrEnableHover:[{type:e.Input,args:["enableHover"]}],attrHasThreeStates:[{type:e.Input,args:["hasThreeStates"]}],attrIncrementalSearch:[{type:e.Input,args:["incrementalSearch"]}],attrKeyboardNavigation:[{type:e.Input,args:["keyboardNavigation"]}],attrRtl:[{type:e.Input,args:["rtl"]}],attrSource:[{type:e.Input,args:["source"]}],attrToggleIndicatorSize:[{type:e.Input,args:["toggleIndicatorSize"]}],attrToggleMode:[{type:e.Input,args:["toggleMode"]}],attrTheme:[{type:e.Input,args:["theme"]}],attrWidth:[{type:e.Input,args:["width"]}],attrHeight:[{type:e.Input,args:["height"]}],autoCreate:[{type:e.Input,args:["auto-create"]}],onAdded:[{type:e.Output}],onCheckChange:[{type:e.Output}],onCollapse:[{type:e.Output}],onDragStart:[{type:e.Output}],onDragEnd:[{type:e.Output}],onExpand:[{type:e.Output}],onItemClick:[{type:e.Output}],onRemoved:[{type:e.Output}],onSelect:[{type:e.Output}]},t}(),r=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{imports:[],declarations:[o],exports:[o]}]}],t}();t.jqxTreeComponent=o,t.jqxTreeModule=r,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=jqwidgets-ng-jqxtree.umd.min.js.map | 1,089.5 | 10,389 | 0.759615 |
6fa2366eefb217e18747548e0352537078499b8b | 2,206 | js | JavaScript | src/pages/about.js | etakgoz/nolletta-gatsby | 0b2b3f4765b2b77d16ff1af671ff90169072a80c | [
"MIT"
] | null | null | null | src/pages/about.js | etakgoz/nolletta-gatsby | 0b2b3f4765b2b77d16ff1af671ff90169072a80c | [
"MIT"
] | null | null | null | src/pages/about.js | etakgoz/nolletta-gatsby | 0b2b3f4765b2b77d16ff1af671ff90169072a80c | [
"MIT"
] | null | null | null | import React from "react";
import Layout from "../components/layout";
import { Container, Row } from 'react-bootstrap';
export default ({ data }) => {
return (
<Layout pageClass="about">
<Container>
<article>
<header>
<h1>About Me</h1>
</header>
<Row>
<div className="col-lg-8 offset-lg-2 col-md-10 offset-md-1">
<p>Benjamin Franklin FRS FRSA FRSE (January 17, 1706 [O.S. January 6, 1705][1] – April 17, 1790) was an American polymath and one of the Founding Fathers of the United States. Franklin was a leading writer, printer, political philosopher, politician, Freemason, postmaster, scientist, inventor, humorist, civic activist, statesman, and diplomat. As a scientist, he was a major figure in the American Enlightenment and the history of physics for his discoveries and theories regarding electricity. As an inventor, he is known for the lightning rod, bifocals, and the Franklin stove, among other inventions.[2] He founded many civic organizations, including the Library Company, Philadelphia's first fire department[3] and the University of Pennsylvania.[4]</p>
<p>Franklin earned the title of "The First American" for his early and indefatigable campaigning for colonial unity, initially as an author and spokesman in London for several colonies. As the first United States Ambassador to France, he exemplified the emerging American nation.[5] Franklin was foundational in defining the American ethos as a marriage of the practical values of thrift, hard work, education, community spirit, self-governing institutions, and opposition to authoritarianism both political and religious, with the scientific and tolerant values of the Enlightenment. In the words of historian Henry Steele Commager, "In a Franklin could be merged the virtues of Puritanism without its defects, the illumination of the Enlightenment without its heat."[6] To Walter Isaacson, this makes Franklin "the most accomplished American of his age and the most influential in inventing the type of society America would become."</p>
</div>
</Row>
</article>
</Container>
</Layout>
)
} | 91.916667 | 955 | 0.733454 |
6fa23a6ee90ec4284f1b39a1f096fa2a5d55a462 | 330 | js | JavaScript | constants/index.js | jbelmont/advanced-tech-in-wilmington-react-app | 87fd6da485b68fe37060716c752dfb94c0aa3702 | [
"MIT"
] | 4 | 2017-02-20T15:28:47.000Z | 2017-09-05T16:13:21.000Z | constants/index.js | jbelmont/continuous-integration-with-jenkins-travis-and-circleci | 8f92119503a40ca3171f01c2310d488095c0ae33 | [
"MIT"
] | null | null | null | constants/index.js | jbelmont/continuous-integration-with-jenkins-travis-and-circleci | 8f92119503a40ca3171f01c2310d488095c0ae33 | [
"MIT"
] | null | null | null | module.exports = {
responseCodes: {
created: 201,
ok: 200,
unauthorized: 401,
found: 302,
nocontent: 204
},
requestURL: 'https://localhost:3000',
endPoints: {
addUserUrl: '/api/v1/users/addUser',
removeUserUrl: '/api/v1/users/removeUser',
indexRouteUrl: '/',
getUserUrl: '/user'
}
};
| 19.411765 | 46 | 0.606061 |
6fa2abce850142574276e9dc3ff71bd39b7fb5e7 | 7,136 | js | JavaScript | test/flow_node_parser/sample_data.js | process-engine/c8_debugging | f4a06664579fc95204bf23c3fc608802463924c1 | [
"MIT"
] | 16 | 2019-02-03T07:30:42.000Z | 2021-03-03T18:15:08.000Z | test/flow_node_parser/sample_data.js | process-engine/c8_debugging | f4a06664579fc95204bf23c3fc608802463924c1 | [
"MIT"
] | 106 | 2017-10-11T15:03:38.000Z | 2018-08-30T13:09:48.000Z | test/flow_node_parser/sample_data.js | process-engine/c8_debugging | f4a06664579fc95204bf23c3fc608802463924c1 | [
"MIT"
] | null | null | null | module.exports.ProcessWithMixedFlowNodes = {
id: 'process_engine_io_release',
name: 'process_engine_io_release',
isExecutable: 'true',
'bpmn:laneSet': {
'bpmn:lane': {
id: 'Lane_1xzf0d3',
name: 'Release Manager',
'bpmn:flowNodeRef': ['release_durchfuehren',
'ExclusiveSplitGateway_1',
'EndEvent_0y6uwzm',
'ParallelJoinGateway_1',
'ParallelSplitGateway_1',
'EndEvent_0eie6q6',
'Task_1tfjjzx',
'Task_0a4b1bm',
'Task_0bbikg1',
'ExclusiveJoinGateway_1',
'ausserordentlicher_start',
'jeden_donnerstag_start'
]
}
},
'bpmn:userTask': {
id: 'release_durchfuehren',
name: 'Release durchführen?',
'camunda:formKey': 'Form Key',
'bpmn:extensionElements': {
'camunda:formData': {
'camunda:formField': {
id: 'release_durchfuehren',
label: 'Soll ein process-engine.io Release erstellt werden? ',
type: 'boolean',
defaultValue: ''
}
},
'camunda:properties': {
'camunda:property': {
name: 'preferredControl',
value: 'confirm'
}
}
},
'bpmn:incoming': 'SequenceFlow_0c373kd',
'bpmn:outgoing': 'SequenceFlow_1oy0eez'
},
'bpmn:exclusiveGateway': [{
id: 'ExclusiveSplitGateway_1',
name: '',
'bpmn:extensionElements': {
'camunda:formData': ''
},
'bpmn:incoming': 'SequenceFlow_1oy0eez',
'bpmn:outgoing': ['SequenceFlow_0qg5z1e', 'SequenceFlow_1ukf8v1']
}, {
id: 'ExclusiveJoinGateway_1',
name: '',
'bpmn:incoming': ['SequenceFlow_0qg5z1e', 'SequenceFlow_0z1m3md'],
'bpmn:outgoing': 'SequenceFlow_07juolu'
}],
'bpmn:endEvent': [{
id: 'EndEvent_0y6uwzm',
name: 'Kein Release',
'bpmn:incoming': 'SequenceFlow_1ukf8v1'
}, {
id: 'EndEvent_0eie6q6',
name: 'Release erstellt',
'bpmn:incoming': 'SequenceFlow_0822sfy'
}],
'bpmn:parallelGateway': [{
id: 'ParallelJoinGateway_1',
name: '',
'bpmn:extensionElements': {
'camunda:formData': ''
},
'bpmn:incoming': ['SequenceFlow_0uaexrv',
'SequenceFlow_10xcr5a',
'SequenceFlow_10lignn'
],
'bpmn:outgoing': 'SequenceFlow_0822sfy'
}, {
id: 'ParallelSplitGateway_1',
name: '',
'bpmn:extensionElements': {
'camunda:formData': ''
},
'bpmn:incoming': 'SequenceFlow_07juolu',
'bpmn:outgoing': ['SequenceFlow_1nt9fw9',
'SequenceFlow_1vprubq',
'SequenceFlow_17awqho'
]
}],
'bpmn:callActivity': [{
id: 'Task_1tfjjzx',
name: 'BPMN-Studio releasen',
calledElement: 'bpmn_studio_release',
'bpmn:incoming': 'SequenceFlow_1nt9fw9',
'bpmn:outgoing': 'SequenceFlow_0uaexrv'
}, {
id: 'Task_0a4b1bm',
name: 'ProcessEngine.ts releasen',
calledElement: 'process_engine_ts_release',
'bpmn:incoming': 'SequenceFlow_1vprubq',
'bpmn:outgoing': 'SequenceFlow_10xcr5a'
}, {
id: 'Task_0bbikg1',
name: 'ProcessEngine.NET releasen',
calledElement: 'process_engine_net_release',
'bpmn:incoming': 'SequenceFlow_17awqho',
'bpmn:outgoing': 'SequenceFlow_10lignn'
}],
'bpmn:startEvent': [{
id: 'ausserordentlicher_start',
name: 'Außerordentliches Release',
'bpmn:outgoing': 'SequenceFlow_0z1m3md'
}, {
id: 'jeden_donnerstag_start',
name: 'Jeden Donnerstag',
'bpmn:outgoing': 'SequenceFlow_0c373kd',
'bpmn:timerEventDefinition': {
'bpmn:timeCycle': {
_: '0 9 * * 4',
'xsi:type': 'bpmn:tFormalExpression'
}
}
}]
};
module.exports.ProcessWithMissingIds = {
id: 'process_engine_io_release',
name: 'process_engine_io_release',
isExecutable: 'true',
'bpmn:laneSet': {
'bpmn:lane': {
id: 'Lane_1xzf0d3',
name: 'Release Manager',
'bpmn:flowNodeRef': ['release_durchfuehren',
'ExclusiveSplitGateway_1',
'EndEvent_0y6uwzm',
'ParallelJoinGateway_1',
'ParallelSplitGateway_1',
'EndEvent_0eie6q6',
'Task_1tfjjzx',
'Task_0a4b1bm',
'Task_0bbikg1',
'ExclusiveJoinGateway_1',
'ausserordentlicher_start',
'jeden_donnerstag_start'
]
}
},
'bpmn:userTask': {
name: 'Release durchführen?',
'camunda:formKey': 'Form Key',
'bpmn:extensionElements': {
'camunda:formData': {
'camunda:formField': {
id: 'release_durchfuehren',
label: 'Soll ein process-engine.io Release erstellt werden? ',
type: 'boolean',
defaultValue: ''
}
},
'camunda:properties': {
'camunda:property': {
name: 'preferredControl',
value: 'confirm'
}
}
},
'bpmn:incoming': 'SequenceFlow_0c373kd',
'bpmn:outgoing': 'SequenceFlow_1oy0eez'
},
'bpmn:exclusiveGateway': [{
id: 'ExclusiveSplitGateway_1',
name: '',
'bpmn:extensionElements': {
'camunda:formData': ''
},
'bpmn:incoming': 'SequenceFlow_1oy0eez',
'bpmn:outgoing': ['SequenceFlow_0qg5z1e', 'SequenceFlow_1ukf8v1']
}, {
id: 'ExclusiveJoinGateway_1',
name: '',
'bpmn:incoming': ['SequenceFlow_0qg5z1e', 'SequenceFlow_0z1m3md'],
'bpmn:outgoing': 'SequenceFlow_07juolu'
}],
'bpmn:endEvent': [{
id: 'EndEvent_0y6uwzm',
name: 'Kein Release',
'bpmn:incoming': 'SequenceFlow_1ukf8v1'
}, {
id: 'EndEvent_0eie6q6',
name: 'Release erstellt',
'bpmn:incoming': 'SequenceFlow_0822sfy'
}],
'bpmn:parallelGateway': [{
id: 'ParallelJoinGateway_1',
name: '',
'bpmn:extensionElements': {
'camunda:formData': ''
},
'bpmn:incoming': ['SequenceFlow_0uaexrv',
'SequenceFlow_10xcr5a',
'SequenceFlow_10lignn'
],
'bpmn:outgoing': 'SequenceFlow_0822sfy'
}, {
id: 'ParallelSplitGateway_1',
name: '',
'bpmn:extensionElements': {
'camunda:formData': ''
},
'bpmn:incoming': 'SequenceFlow_07juolu',
'bpmn:outgoing': ['SequenceFlow_1nt9fw9',
'SequenceFlow_1vprubq',
'SequenceFlow_17awqho'
]
}],
'bpmn:callActivity': [{
id: 'Task_1tfjjzx',
name: 'BPMN-Studio releasen',
calledElement: 'bpmn_studio_release',
'bpmn:incoming': 'SequenceFlow_1nt9fw9',
'bpmn:outgoing': 'SequenceFlow_0uaexrv'
}, {
id: 'Task_0a4b1bm',
name: 'ProcessEngine.ts releasen',
calledElement: 'process_engine_ts_release',
'bpmn:incoming': 'SequenceFlow_1vprubq',
'bpmn:outgoing': 'SequenceFlow_10xcr5a'
}, {
id: 'Task_0bbikg1',
name: 'ProcessEngine.NET releasen',
calledElement: 'process_engine_net_release',
'bpmn:incoming': 'SequenceFlow_17awqho',
'bpmn:outgoing': 'SequenceFlow_10lignn'
}],
'bpmn:startEvent': [{
id: 'ausserordentlicher_start',
name: 'Außerordentliches Release',
'bpmn:outgoing': 'SequenceFlow_0z1m3md'
}, {
id: 'jeden_donnerstag_start',
name: 'Jeden Donnerstag',
'bpmn:outgoing': 'SequenceFlow_0c373kd',
'bpmn:timerEventDefinition': {
'bpmn:timeCycle': {
_: '0 9 * * 4',
'xsi:type': 'bpmn:tFormalExpression'
}
}
}]
};
| 27.875 | 72 | 0.615471 |
6fa31246363b62a1ec692f3c678e2361e0b49043 | 2,719 | js | JavaScript | node_modules/refractor/lang/dhall.js | fgirse/commodore3 | 593894ef469c6130086f98c5404c2b957df93264 | [
"MIT"
] | 452 | 2017-08-02T16:32:35.000Z | 2022-03-27T05:03:06.000Z | node_modules/refractor/lang/dhall.js | fgirse/commodore3 | 593894ef469c6130086f98c5404c2b957df93264 | [
"MIT"
] | 56 | 2017-09-15T14:20:02.000Z | 2022-03-12T16:07:02.000Z | node_modules/refractor/lang/dhall.js | fgirse/commodore3 | 593894ef469c6130086f98c5404c2b957df93264 | [
"MIT"
] | 27 | 2017-09-16T09:30:46.000Z | 2022-01-21T15:50:33.000Z | // @ts-nocheck
dhall.displayName = 'dhall'
dhall.aliases = []
/** @type {import('../core.js').Syntax} */
export default function dhall(Prism) {
// ABNF grammar:
// https://github.com/dhall-lang/dhall-lang/blob/master/standard/dhall.abnf
Prism.languages.dhall = {
// Multi-line comments can be nested. E.g. {- foo {- bar -} -}
// The multi-line pattern is essentially this:
// \{-(?:[^-{]|-(?!\})|\{(?!-)|<SELF>)*-\}
comment:
/--.*|\{-(?:[^-{]|-(?!\})|\{(?!-)|\{-(?:[^-{]|-(?!\})|\{(?!-))*-\})*-\}/,
string: {
pattern: /"(?:[^"\\]|\\.)*"|''(?:[^']|'(?!')|'''|''\$\{)*''(?!'|\$)/,
greedy: true,
inside: {
interpolation: {
pattern: /\$\{[^{}]*\}/,
inside: {
expression: {
pattern: /(^\$\{)[\s\S]+(?=\}$)/,
lookbehind: true,
alias: 'language-dhall',
inside: null // see blow
},
punctuation: /\$\{|\}/
}
}
}
},
label: {
pattern: /`[^`]*`/,
greedy: true
},
url: {
// https://github.com/dhall-lang/dhall-lang/blob/5fde8ef1bead6fb4e999d3c1ffe7044cd019d63a/standard/dhall.abnf#L596
pattern:
/\bhttps?:\/\/[\w.:%!$&'*+;=@~-]+(?:\/[\w.:%!$&'*+;=@~-]*)*(?:\?[/?\w.:%!$&'*+;=@~-]*)?/,
greedy: true
},
env: {
// https://github.com/dhall-lang/dhall-lang/blob/5fde8ef1bead6fb4e999d3c1ffe7044cd019d63a/standard/dhall.abnf#L661
pattern: /\benv:(?:(?!\d)\w+|"(?:[^"\\=]|\\.)*")/,
greedy: true,
inside: {
function: /^env/,
operator: /^:/,
variable: /[\s\S]+/
}
},
hash: {
// https://github.com/dhall-lang/dhall-lang/blob/5fde8ef1bead6fb4e999d3c1ffe7044cd019d63a/standard/dhall.abnf#L725
pattern: /\bsha256:[\da-fA-F]{64}\b/,
inside: {
function: /sha256/,
operator: /:/,
number: /[\da-fA-F]{64}/
}
},
// https://github.com/dhall-lang/dhall-lang/blob/5fde8ef1bead6fb4e999d3c1ffe7044cd019d63a/standard/dhall.abnf#L359
keyword:
/\b(?:as|assert|else|forall|if|in|let|merge|missing|then|toMap|using|with)\b|\u2200/,
builtin: /\b(?:Some|None)\b/,
boolean: /\b(?:False|True)\b/,
number:
/\bNaN\b|-?\bInfinity\b|[+-]?\b(?:0x[\da-fA-F]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/,
operator:
/\/\\|\/\/\\\\|&&|\|\||===|[!=]=|\/\/|->|\+\+|::|[+*#@=:?<>|\\\u2227\u2a53\u2261\u2afd\u03bb\u2192]/,
punctuation: /\.\.|[{}\[\](),./]/,
// we'll just assume that every capital word left is a type name
'class-name': /\b[A-Z]\w*\b/
}
Prism.languages.dhall.string.inside.interpolation.inside.expression.inside =
Prism.languages.dhall
}
| 34.858974 | 120 | 0.47922 |
6fa3222ace58a531787ab4f715da46b46cecfd22 | 267 | js | JavaScript | src/saga/index.js | spybot/bots | 8d5ec87b6fd0aad6c95cc71049fa94ce6942650d | [
"MIT"
] | null | null | null | src/saga/index.js | spybot/bots | 8d5ec87b6fd0aad6c95cc71049fa94ce6942650d | [
"MIT"
] | null | null | null | src/saga/index.js | spybot/bots | 8d5ec87b6fd0aad6c95cc71049fa94ce6942650d | [
"MIT"
] | null | null | null | import createSagaMiddleware from 'redux-saga';
import {fork, all} from 'redux-saga/effects';
import userSaga from 'saga/userSagas';
export default function* rootSaga() {
yield all([
fork(userSaga)
]);
}
export const sagaMiddleware = createSagaMiddleware(); | 22.25 | 53 | 0.737828 |
6fa41fe270dec4bfbcf9192ae52e7c54fa6f9226 | 155 | js | JavaScript | types/modelStatusTypes.js | measurify/model-registry | 8219ea6a97ea9bb4008a252e1b7c152d359374bb | [
"MIT"
] | 1 | 2022-01-18T09:10:37.000Z | 2022-01-18T09:10:37.000Z | types/modelStatusTypes.js | measurify/model-registry | 8219ea6a97ea9bb4008a252e1b7c152d359374bb | [
"MIT"
] | null | null | null | types/modelStatusTypes.js | measurify/model-registry | 8219ea6a97ea9bb4008a252e1b7c152d359374bb | [
"MIT"
] | null | null | null | const ModelStatusTypes = Object.freeze({
training: 'training',
test: 'test',
production: 'production'
});
module.exports = ModelStatusTypes;
| 19.375 | 40 | 0.683871 |
6fa458bf1b2d24ed5b68be61fe1a158b16e34451 | 650 | js | JavaScript | PersonalFinance/Scripts/ig/modules/i18n/infragistics.ui.editors-ru.js | DEVX1/Personal-Finance | dde99e505878999356b1568b95caa5f257e0cb17 | [
"MIT"
] | 9 | 2015-12-28T11:16:12.000Z | 2018-09-09T23:59:57.000Z | PersonalFinance/Scripts/ig/modules/i18n/infragistics.ui.editors-ru.js | DEVX1/Personal-Finance | dde99e505878999356b1568b95caa5f257e0cb17 | [
"MIT"
] | null | null | null | PersonalFinance/Scripts/ig/modules/i18n/infragistics.ui.editors-ru.js | DEVX1/Personal-Finance | dde99e505878999356b1568b95caa5f257e0cb17 | [
"MIT"
] | 10 | 2015-02-06T04:55:39.000Z | 2018-01-24T05:30:20.000Z | /*!@license
* Infragistics.Web.ClientUI Editors localization resources 15.1.20151.1005
*
* Copyright (c) 2011-2015 Infragistics Inc.
*
* http://www.infragistics.com/
*
*/
/*global jQuery */
(function ($) {
$.ig = $.ig || {};
if (!$.ig.Editor) {
$.ig.Editor = {
locale: {
spinUpperTitle: 'Увеличение',
spinLowerTitle: 'Уменьшение',
buttonTitle: 'Показать список',
clearTitle: 'Удалить значение',
datePickerButtonTitle: 'Показать календарь',
updateModeUnsupportedValue: 'Опция updateMode поддерживает два возможных значения - "onChange" и "immediate"'
}
};
}
})(jQuery); | 25 | 119 | 0.624615 |
6fa460e083ce13553b5b5af68e11e80ee88afbc0 | 265 | js | JavaScript | 5-estrutura-controle/78-if2.js | MillerGlaeser/curso-web | 430365e77522b256abd349dd9f548ac7950a9c28 | [
"MIT"
] | null | null | null | 5-estrutura-controle/78-if2.js | MillerGlaeser/curso-web | 430365e77522b256abd349dd9f548ac7950a9c28 | [
"MIT"
] | null | null | null | 5-estrutura-controle/78-if2.js | MillerGlaeser/curso-web | 430365e77522b256abd349dd9f548ac7950a9c28 | [
"MIT"
] | null | null | null | function teste(num) {
if(num > 7)
console.log(num)
console.log('Final')
}
teste(6)
teste(8)
function teste2(num) {
if(num > 7); { // cuidado com o ; não usar com as estruturas de controle
console.log(num)
}
}
teste2(6)
teste2(8) | 14.722222 | 77 | 0.584906 |
6fa46d5a9f5a00c20a4c28982f2f364f9b38f7a3 | 2,463 | js | JavaScript | lib/es5/ui/SummaryHelpPopoverWithData.js | usergeek/canistergeek-ic-js | 2d1bc5e2ef08eb0aae75b22f68b03faea1066ba8 | [
"MIT"
] | 1 | 2022-02-27T00:01:17.000Z | 2022-02-27T00:01:17.000Z | lib/es5/ui/SummaryHelpPopoverWithData.js | usergeek/canistergeek-ic-js | 2d1bc5e2ef08eb0aae75b22f68b03faea1066ba8 | [
"MIT"
] | null | null | null | lib/es5/ui/SummaryHelpPopoverWithData.js | usergeek/canistergeek-ic-js | 2d1bc5e2ef08eb0aae75b22f68b03faea1066ba8 | [
"MIT"
] | null | null | null | "use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.SummaryHelpPopoverWithData = void 0;
const React = __importStar(require("react"));
const antd_1 = require("antd");
const AbstractHelpPopover_1 = require("./AbstractHelpPopover");
const CalculationUtils_1 = require("../dataProvider/CalculationUtils");
const DateTimeUtils_1 = require("./DateTimeUtils");
function SummaryHelpPopoverWithData(props) {
return React.createElement(AbstractHelpPopover_1.AbstractHelpPopover, { title: "Prediction based on 2 data points", content: React.createElement(React.Fragment, null,
React.createElement(antd_1.Space, { direction: "vertical" },
React.createElement("div", null,
React.createElement("div", null,
"From: ",
DateTimeUtils_1.DateTimeUtils.formatDate(props.data.date.fromMillis, "dayTime")),
React.createElement("div", null,
"To: ",
DateTimeUtils_1.DateTimeUtils.formatDate(props.data.date.toMillis, "dayTime"))),
React.createElement("div", null,
"Difference: ",
CalculationUtils_1.CalculationUtils.formatNumericValue(props.data.data.difference),
props.differenceTitlePostfix),
React.createElement("div", null,
"Prediction: ",
props.predictionLabel))) });
}
exports.SummaryHelpPopoverWithData = SummaryHelpPopoverWithData;
//# sourceMappingURL=SummaryHelpPopoverWithData.js.map | 52.404255 | 170 | 0.632562 |
6fa4a02cd6e5ed593cd80f92a88b65a42fc8c4aa | 1,464 | js | JavaScript | expo_project/components/SegmentedControl.js | spencerrdavid/commonspace | 19f245066be5ebd5ebd9503a3d93e6de775b06da | [
"Apache-2.0"
] | null | null | null | expo_project/components/SegmentedControl.js | spencerrdavid/commonspace | 19f245066be5ebd5ebd9503a3d93e6de775b06da | [
"Apache-2.0"
] | null | null | null | expo_project/components/SegmentedControl.js | spencerrdavid/commonspace | 19f245066be5ebd5ebd9503a3d93e6de775b06da | [
"Apache-2.0"
] | null | null | null | import React from 'react';
import { StyleSheet, View, Text, TouchableOpacity } from 'react-native';
import * as _ from 'lodash';
import Theme from '../constants/Theme';
class Tab extends React.Component {
render() {
const { selected, label, onPress } = this.props;
return (
<TouchableOpacity style={[styles.tab, selected && styles.activeTab]} onPress={onPress}>
<Text style={[styles.tabText]}>{label}</Text>
</TouchableOpacity>
);
}
}
class SegmentedControl extends React.Component {
setActive = label => {
if (this.props.activeTab !== label) {
this.props.onTabSelect(label);
}
};
render() {
const { labels, activeTab } = this.props;
return (
<View style={styles.tabs}>
{_.map(labels, label => (
<Tab selected={activeTab === label} label={label} onPress={() => this.setActive(label)} />
))}
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
},
tabs: {
flex: 0,
flexDirection: 'row',
},
tab: {
padding: 20,
flex: 1,
borderBottomColor: '#bbb',
borderBottomWidth: StyleSheet.hairlineWidth,
justifyContent: 'center',
alignItems: 'center',
},
activeTab: {
borderBottomColor: Theme.colors.primary,
borderBottomWidth: 2,
},
tabText: {
fontFamily: 'product-medium',
color: Theme.colors.primary,
},
});
export default SegmentedControl;
| 22.523077 | 100 | 0.613388 |
6fa5a1e4d0571c866e71e7bf1c9da65b89b995ba | 1,536 | js | JavaScript | dist/scroll-to.bundle.js | jiangfengming/scroll-to | 921934813bfa07fd149a378ad11933233bea8542 | [
"MIT"
] | null | null | null | dist/scroll-to.bundle.js | jiangfengming/scroll-to | 921934813bfa07fd149a378ad11933233bea8542 | [
"MIT"
] | null | null | null | dist/scroll-to.bundle.js | jiangfengming/scroll-to | 921934813bfa07fd149a378ad11933233bea8542 | [
"MIT"
] | null | null | null | function createTransition(animate, duration, easing) {
return new Promise(function (resolve) {
var start;
function step(now) {
if (!start) start = now;
var t = (now - start) / duration;
if (t > 1) t = 1;
animate(easing ? easing(t) : t);
if (t < 1) requestAnimationFrame(step);else resolve();
}
requestAnimationFrame(step);
});
}
var easeIn = function easeIn(p) {
return function (t) {
return Math.pow(t, p);
};
};
var easeOut = function easeOut(p) {
return function (t) {
return 1 - Math.abs(Math.pow(t - 1, p));
};
};
var easeInOut = function easeInOut(p) {
return function (t) {
return t < 0.5 ? easeIn(p)(t * 2) / 2 : easeOut(p)(t * 2 - 1) / 2 + 0.5;
};
};
var easeInOutQuad = easeInOut(2); // accelerating from zero velocity
function scrollToElement(el, offset) {
if (offset === void 0) {
offset = 0;
}
var y = window.scrollY;
var d = el.getBoundingClientRect().top - offset;
createTransition(function (t) {
return window.scrollTo(0, y + t * d);
}, 300, easeInOutQuad);
}
function scrollToTop() {
var y = window.scrollY;
createTransition(function (t) {
return window.scrollTo(0, y - t * y);
}, 300, easeInOutQuad);
}
function scrollToBottom() {
var y = window.scrollY;
var d = document.documentElement.scrollHeight - window.innerHeight - window.scrollY;
createTransition(function (t) {
return window.scrollTo(0, y + t * d);
}, 300, easeInOutQuad);
}
export { scrollToBottom, scrollToElement, scrollToTop };
| 24.380952 | 86 | 0.628906 |
6fa643a753456fa2cd64a90fda55ba806c4f898f | 58 | js | JavaScript | packages/data/src/dynamiccard/index.js | itsyui/itsyui-react | ecad34f52d208eb9444c66eb935b241d070952c8 | [
"MIT"
] | 1 | 2021-11-11T06:21:03.000Z | 2021-11-11T06:21:03.000Z | packages/data/src/dynamiccard/index.js | itsyui/itsyui-react | ecad34f52d208eb9444c66eb935b241d070952c8 | [
"MIT"
] | null | null | null | packages/data/src/dynamiccard/index.js | itsyui/itsyui-react | ecad34f52d208eb9444c66eb935b241d070952c8 | [
"MIT"
] | 1 | 2022-03-22T07:16:25.000Z | 2022-03-22T07:16:25.000Z | export { default as ItsyDynamicCard } from "./CardWidget"; | 58 | 58 | 0.758621 |
6fa72c3c34a07b83860c944a86a08cd56a4ce17b | 278 | js | JavaScript | src/core_modules/capture-core-utils/index.js | karolinelien/capture-app | 717eafd38d10450a661445dfc59fc5270ff12d6a | [
"BSD-2-Clause"
] | null | null | null | src/core_modules/capture-core-utils/index.js | karolinelien/capture-app | 717eafd38d10450a661445dfc59fc5270ff12d6a | [
"BSD-2-Clause"
] | null | null | null | src/core_modules/capture-core-utils/index.js | karolinelien/capture-app | 717eafd38d10450a661445dfc59fc5270ff12d6a | [
"BSD-2-Clause"
] | null | null | null | // @flow
export { errorCreator } from './errorCreator';
export { default as pipe } from './misc/pipe';
export { makeCancelable as makeCancelablePromise } from './cancelablePromise';
export { default as chunk } from './chunk';
export { default as WebWorker } from './WebWorker';
| 39.714286 | 78 | 0.715827 |
6fa7368015b0ddd2a70ad6b9ebc3876e6a93b3fc | 20,351 | js | JavaScript | backend/_lib/index.js | josiahakinloye/Latest-harchive | 2ccc3691d0e77db03bad9ee0c1f20aee22b5523d | [
"MIT"
] | null | null | null | backend/_lib/index.js | josiahakinloye/Latest-harchive | 2ccc3691d0e77db03bad9ee0c1f20aee22b5523d | [
"MIT"
] | 6 | 2021-05-10T17:45:02.000Z | 2022-02-26T19:13:45.000Z | backend/_lib/index.js | josiahakinloye/Latest-harchive | 2ccc3691d0e77db03bad9ee0c1f20aee22b5523d | [
"MIT"
] | null | null | null | //session management
const session = require('express-session');
const MongoDBStore = require('connect-mongodb-session')(session);
// express server setup
const express = require('express');
const app = express();
const bodyParser = require('body-parser')
const cors = require('cors');
const multer = require('multer');
var upload_profile_picture = multer({ dest: 'uploads/profile-picture'});
var upload_real_assets = multer({ dest: 'uploads/real-assets'});
// security package
const helmet = require('helmet')
// import from different files
const wallet = require('./modules/wallet');
const user = require('./modules/registration');
const uniqueUser = require('./modules/uniqueUsername');
const asset = require('./modules/assets');
const friend = require('./modules/friends');
const email = require('./modules/email');
const blockchain = require('./modules/blockchain');
const autoAssetTransfer = require('./modules/autoAssetTransfer');
// initialisaction of session management and session store.
var store = new MongoDBStore({
uri: 'mongodb://localhost:27017/will-management-system-test',
collection: 'users_sessions_test'
});
store.on('connected', function() {
console.log('connected to session store');
// console.log(store.client); // The underlying MongoClient object from the MongoDB driver
});
// Catch errors
store.on('error', function(error) {
console.log('error while connecting to session store.');
});
// cors enable
app.use(cors());
// security
app.use(helmet());
// parse application/json
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({ extended: true }));
app.use(require('express-session')({
secret: 'will-management-system-key',
cookie: {
maxAge: 1000 * 60 * 60 * 24 // 1 day
},
store: store,
// Boilerplate options, see:
// * https://www.npmjs.com/package/express-session#resave
// * https://www.npmjs.com/package/express-session#saveuninitialized
resave: false,
saveUninitialized: false
}));
// ************* API CREATION ************ //
// app.get('/', function(req, res) {
// // console.log(req);
// console.log(req.session);
// // res.send('Hello ' + JSON.stringify(req.session));
// });
// REGISTRATION MODULE.
app.post('/checkUniqueUser',function(req,res){
let username = req.body.username;
let emailAddress = req.body.email;
uniqueUser.checkUniqueness(username,emailAddress).then(function(response){
if(response.status == "success"){
res.status(200).send({status: "success",data:response.payload});
}else{
res.status(200).send({status: "error"});
}
})
});
app.post('/registerUser',upload_profile_picture.single('profile_picture'),(req,res) => {
let userDetails = {
image:req.file,
other:req.body
};
user.createUser(userDetails).then(function(response){
if(response.status == "success"){
res.status(200).send({status: "success",data:response.payload});
}else{
res.status(200).send({status: "error",data:response.payload});
}
});
})
app.get('/verifyEmailAddress',(req,res)=>{
let user_id = req.query.id;
let user_email = req.query.email;
email.verifyEmailAddress(user_email,user_id).then(function(response){
if(response.status == "success"){
res.status(200).send({status: "success",data:response.payload});
}else{
res.status(200).send({status: "error",data:response.payload});
}
});
})
app.get('/addNewDevice',(req,res)=>{
let user = req.query.username;
let user_mac_address = req.query.mac_address;
email.addNewDevice(user,user_mac_address).then(function(response){
if(response.status == "success"){
res.status(200).send({status: "success",data:response.payload});
}else{
res.status(200).send({status: "error",data:response.payload});
}
});
})
app.post('/login',(req,res)=>{
let username = req.body.username;
let password = req.body.password;
let macAddress = req.body.mac_address;
user.userLogin(username,password,macAddress).then(function(response){
if(response.status == "success"){
// if(Object.prototype.hasOwnProperty.call(req.session,'users')){
// req.session.users.push({username:username});
// }else{
// req.session.users = [];
// req.session.users.push({username:username});
// }
res.status(200).send({status: "success",data:response.payload});
}else{
res.status(200).send({status: "error",data:response.payload});
}
});
})
app.post('/logout',(req,res)=>{
let username = req.body.username;
user.checkAccountStatus(user).then(function(account_status_response){
if(account_status_response.status == "success"){
user.userLogout(username).then(function(response){
if(response.status == "success"){
res.status(200).send({status: "success",data:response.payload});
}else{
res.status(200).send({status: "error",data:response.payload});
}
});
}else{
res.status(200).send({status: "error",data:account_status_response.payload});
}
})
})
// get user profile can be used multiple ways so no need to check for login and etc.
app.post('/getUserProfile',(req,res)=>{
let username = req.body.username;
user.getUserProfile(username).then(function(response){
if(response.status == "success"){
res.status(200).send({status: "success",data:response.payload});
}else{
res.status(200).send({status: "error",data:response.payload});
}
})
})
app.post('/updateUserProfile',upload_profile_picture.single('profile_picture'),(req,res)=>{
let userDetails = {
image:req.file,
other:req.body
};
user.checkAccountStatus(userDetails.other.username).then(function(account_status_response){
if(account_status_response.status == "success"){
user.updateProfile(userDetails).then(function(response){
if(response.status == "success"){
res.status(200).send({status: "success",data:response.payload});
}else{
res.status(200).send({status: "error",data:response.payload});
}
})
}else{
res.status(200).send({status: "error",data:account_status_response.payload});
}
})
})
app.post('/deleteAccount',(req,res)=>{
let username = req.body.username;
let accountStatus = req.body.accountStatus;
user.checkAccountStatus(username).then(function(account_status_response){
if(account_status_response.status == "success"){
user.deleteAccount(username,accountStatus).then(function(response){
if(response.status == "success"){
res.status(200).send({status: "success",data:response.payload});
}else{
res.status(200).send({status: "error",data:response.payload});
}
})
}else{
res.status(200).send({status: "error",data:account_status_response.payload});
}
})
})
// WALLET MODULE.
app.post('/createWallet',function(req,res){
let username = req.body.username;
user.checkAccountStatus(username).then(function(account_status_response){
if(account_status_response.status == "success"){
wallet.createWallet(username).then(function(response){
if(response.status == "success"){
res.status(200).send({status: "success",data:response.payload});
}else{
res.status(200).send({status: "error"});
}
});
}else{
res.status(200).send({status: "error",data:account_status_response.payload});
}
})
});
// BLOCKCHAIN MODULE
app.post('/getEtherBalance',function(req,res){
let username = req.body.username;
let walletAddress = req.body.wallet_address;
user.checkAccountStatus(username).then(function(account_status_response){
if(account_status_response.status == "success"){
blockchain.getEtherBalance(username,walletAddress).then(function(response){
if(response.status == "success"){
res.status(200).send({status: "success",data:response.payload});
}else{
res.status(200).send({status: "error",data:response.payload});
}
})
}else{
res.status(200).send({status: "error",data:account_status_response.payload});
}
})
})
app.post('/createAssetInBlockchain',(req,res)=>{
let assetDetails = req.body;
user.checkAccountStatus(assetDetails.username).then(function(account_status_response){
if(account_status_response.status == "success"){
blockchain.createAssetContract(assetDetails).then(function(response){
if(response.status == "success"){
res.status(200).send({status: "success",data:response.payload});
}else{
res.status(200).send({status: "error",data:response.payload});
}
})
}else{
res.status(200).send({status: "error",data:account_status_response.payload});
}
})
})
app.post('/setContractData',(req,res)=>{
let assetDetails = req.body;
user.checkAccountStatus(assetDetails.username).then(function(account_status_response){
if(account_status_response.status == "success"){
blockchain.setContractData(assetDetails).then(function(response){
if(response.status == "success"){
res.status(200).send({status: "success",data:response.payload});
}else{
res.status(200).send({status: "error",data:response.payload});
}
})
}else{
res.status(200).send({status: "error",data:account_status_response.payload});
}
})
})
app.post('/getContractData',(req,res)=>{
let assetDetails = req.body;
user.checkAccountStatus(assetDetails.username).then(function(account_status_response){
if(account_status_response.status == "success"){
blockchain.getContractData(assetDetails).then(function(response){
if(response.status == "success"){
res.status(200).send({status: "success",data:response.payload});
}else{
res.status(200).send({status: "error",data:response.payload});
}
})
}else{
res.status(200).send({status: "error",data:account_status_response.payload});
}
})
})
app.post('/transferOwner',(req,res)=>{
let assetDetails = req.body;
user.checkAccountStatus(assetDetails.username).then(function(account_status_response){
if(account_status_response.status == "success"){
blockchain.transferOwner(assetDetails).then(function(response){
if(response.status == "success"){
res.status(200).send({status: "success",data:response.payload});
}else{
res.status(200).send({status: "error",data:response.payload});
}
})
}else{
res.status(200).send({status: "error",data:account_status_response.payload});
}
})
})
// ASSET MODULE.
app.get('/autoAssetTransfer',(req,res)=>{
autoAssetTransfer.transfer().then(function(response){
if(response.status == "success"){
res.status(200).send({status: "success",data:response.payload});
}else{
res.status(200).send({status: "error",data:response.payload});
}
})
})
app.post('/createRealAsset',upload_real_assets.array('asset_images'),(req,res)=>{
let assetDetails = {
asset_images:req.files,
other_form_fields:req.body
};
user.checkAccountStatus(assetDetails.other_form_fields.username).then(function(account_status_response){
if(account_status_response.status == "success"){
asset.createRealAssets(assetDetails).then(function(response){
if(response.status == "success"){
res.status(200).send({status: "success",data:response.payload});
}else{
res.status(200).send({status: "error",data:response.payload});
}
})
}else{
res.status(200).send({status: "error",data:account_status_response.payload});
}
})
})
app.post('/updateRealAsset',upload_real_assets.array('asset_images'),(req,res)=>{
let assetDetails = {
asset_images:req.files,
other_form_fields:req.body
};
user.checkAccountStatus(assetDetails.other_form_fields.username).then(function(account_status_response){
if(account_status_response.status == "success"){
asset.updateRealAsset(assetDetails).then(function(response){
if(response.status == "success"){
res.status(200).send({status: "success",data:response.payload});
}else{
res.status(200).send({status: "error",data:response.payload});
}
})
}else{
res.status(200).send({status: "error",data:account_status_response.payload});
}
})
})
app.post('/createDigitalAsset',(req,res)=>{
let assetDetails = req.body;
user.checkAccountStatus(assetDetails.username).then(function(account_status_response){
if(account_status_response.status == "success"){
asset.createDigitalAsset(assetDetails).then(function(response){
if(response.status == "success"){
res.status(200).send({status: "success",data:response.payload});
}else{
res.status(200).send({status: "error",data:response.payload});
}
})
}else{
res.status(200).send({status: "error",data:account_status_response.payload});
}
})
})
app.post('/updateDigitalAsset',(req,res)=>{
let assetObject = req.body;
user.checkAccountStatus(assetObject.username).then(function(account_status_response){
if(account_status_response.status == "success"){
asset.updateDigitalAsset(assetObject).then(function(response){
if(response.status == "success"){
res.status(200).send({status: "success",data:response.payload});
}else{
res.status(200).send({status: "error",data:response.payload});
}
})
}else{
res.status(200).send({status: "error",data:account_status_response.payload});
}
})
})
app.post('/deleteAsset',(req,res)=>{
let username = req.body.username;
let assetId = req.body.assetId;
user.checkAccountStatus(username).then(function(account_status_response){
if(account_status_response.status == "success"){
asset.deleteAsset(username,assetId).then(function(response){
if(response.status == "success"){
res.status(200).send({status: "success",data:response.payload});
}else{
res.status(200).send({status: "error",data:response.payload});
}
})
}else{
res.status(200).send({status: "error",data:account_status_response.payload});
}
})
})
app.post('/transferAsset',(req,res)=>{
let username = req.body.username;
let assetId = req.body.asset_id;
user.checkAccountStatus(username).then(function(account_status_response){
if(account_status_response.status == "success"){
asset.transferAsset(username,assetId).then(function(response){
if(response.status == "success"){
res.status(200).send({status: "success",data:response.payload});
}else{
res.status(200).send({status: "error",data:response.payload});
}
})
}else{
res.status(200).send({status: "error",data:account_status_response.payload});
}
})
})
app.post('/addBeneficiary',(req,res)=>{
let beneficiaryDetails = req.body;
user.checkAccountStatus(beneficiaryDetails.username).then(function(account_status_response){
if(account_status_response.status == "success"){
asset.addBeneficiary(beneficiaryDetails).then(function(response){
if(response.status == "success"){
res.status(200).send({status: "success",data:response.payload});
}else{
res.status(200).send({status: "error",data:response.payload});
}
})
}else{
res.status(200).send({status: "error",data:account_status_response.payload});
}
})
})
// beneficiary or friend request module
app.post('/addFriend',(req,res)=>{
let username = req.body.username;
let friends_username = req.body.friend_username;
user.checkAccountStatus(username).then(function(account_status_response){
if(account_status_response.status == "success"){
friend.addFriend(username,friends_username).then(function(response){
if(response.status == "success"){
res.status(200).send({status: "success",data:response.payload});
}else{
res.status(200).send({status: "error",data:response.payload});
}
})
}else{
res.status(200).send({status: "error",data:account_status_response.payload});
}
})
})
app.post('/acceptFriendRequest',(req,res)=>{
let username = req.body.username;
let friends_username = req.body.friend_username;
user.checkAccountStatus(username).then(function(account_status_response){
if(account_status_response.status == "success"){
friend.acceptFriendRequest(username,friends_username).then(function(response){
if(response.status == "success"){
res.status(200).send({status: "success",data:response.payload});
}else{
res.status(200).send({status: "error",data:response.payload});
}
})
}else{
res.status(200).send({status: "error",data:account_status_response.payload});
}
})
})
app.post('/removeFriend',(req,res)=>{
let username = req.body.username;
let friends_username = req.body.friend_username;
user.checkAccountStatus(username).then(function(account_status_response){
if(account_status_response.status == "success"){
friend.removeFriend(username,friends_username).then(function(response){
if(response.status == "success"){
res.status(200).send({status: "success",data:response.payload});
}else{
res.status(200).send({status: "error",data:response.payload});
}
})
}else{
res.status(200).send({status: "error",data:account_status_response.payload});
}
})
})
app.listen(9000,function(){
console.log("connection to server successfull");
});
| 38.76381 | 109 | 0.576778 |
6fa73b7ada065061b651960b7db9d2cef010c8fd | 210 | js | JavaScript | server/helpers/templateHelpers.js | biwano/bluejong | 9c3fe168557a3022ca7e9221e13a7f881e59ca19 | [
"Apache-2.0"
] | null | null | null | server/helpers/templateHelpers.js | biwano/bluejong | 9c3fe168557a3022ca7e9221e13a7f881e59ca19 | [
"Apache-2.0"
] | null | null | null | server/helpers/templateHelpers.js | biwano/bluejong | 9c3fe168557a3022ca7e9221e13a7f881e59ca19 | [
"Apache-2.0"
] | null | null | null | const HandlebarsDirectory = require('handlebars-directory');
const path = require('path');
const renderView = HandlebarsDirectory(path.join(__dirname, '..', 'templates'), 'hbs');
module.exports = renderView;
| 30 | 87 | 0.742857 |
6fa74f4f2dc3bf13565e72e44de3bd410a926133 | 2,654 | js | JavaScript | statics/js/terminal/command.js | Swivelgames/simple-terminal | eac4c115a854e85908fb1617d73d8a19ca25ee28 | [
"MIT"
] | null | null | null | statics/js/terminal/command.js | Swivelgames/simple-terminal | eac4c115a854e85908fb1617d73d8a19ca25ee28 | [
"MIT"
] | null | null | null | statics/js/terminal/command.js | Swivelgames/simple-terminal | eac4c115a854e85908fb1617d73d8a19ca25ee28 | [
"MIT"
] | null | null | null | var Command = (function(){
var Constructor = function(cmd, wait){
this.origCommand = cmd;
this.parseCommand(!wait);
};
Constructor.prototype = {
sudo: false,
params: null,
command: null,
origCommand: null,
pipeResponseTo: null,
parseCommand: function(exec) {
var cmd = this.parsePipes(this.origCommand);
var argsv = this.parseArgs(cmd);
this.command = this.parseParams(argsv);
if(exec) this.execute();
},
parseParams: function(argsv) {
if(argsv[0]==="sudo") {
this.sudo = true;
argsv.splice(0,1);
if(argsv.length < 1) {
argsv.push("sudohelp");
} else this.displaySudoLecture();
}
var ret = argsv.slice(0,1);
this.params = argsv.slice(1);
return argsv[0];
},
displaySudoLecture: function(){
if(ActiveTerminal.session.sudoLecture===true) return;
console.log("We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things:");
console.log("\t");
console.log("\t#1) Respect the privacy of others.");
console.log("\t#2) Think before you type.");
console.log("\t#3) With great power comes great responsibility.");
console.log("\t");
ActiveTerminal.session.sudoLecture = true;
},
parseArgs: function(cmd) {
return this.argsv = cmd.split(/[ ]+/) || [cmd];
},
parsePipes: function(cmd) {
if(cmd.indexOf("|") > -1) {
cmd = cmd.substr(0,cmd.indexOf("|"));
this.pipeResponseTo = this.origCommand.substr(
this.origCommand.indexOf("|") + 1
);
console.bufferStart();
}
return cmd;
},
execute: function(){
ActiveTerminal.pausePrompt();
CommandList.execute(this);
},
hasParam: function(lookFor, orEmpty) {
var opts = this.params;
if(orEmpty && opts.length < 1) return true;
return opts.indexOf("--"+lookFor) > -1 || opts.indexOf("-"+lookFor[0]) > -1;
},
exit: function(code){
if(code>=-1) {
if(this.pipeResponseTo!==null) {
var output = console.bufferGetCleanEnd();
var pipeCmd = this.pipeResponseTo;
var nextPipe = pipeCmd.indexOf("|");
if(nextPipe<0) nextPipe = pipeCmd.length;
var nextCmd = pipeCmd.slice(0, nextPipe);
var endCmd = pipeCmd.slice(nextPipe);
var completeCmd = "";
if(nextCmd.indexOf('%0') > -1) {
completeCmd = nextCmd.replace('%0', output);
} else {
completeCmd = nextCmd + " " + output + " " + endCmd;
}
ActiveTerminal.queue.cmdExit(code, true);
ActiveTerminal.queue.push(completeCmd.trim(), true);
} else {
ActiveTerminal.readyPrompt();
ActiveTerminal.queue.cmdExit(code);
}
}
}
};
return Constructor;
})();
| 27.645833 | 145 | 0.632253 |
6fa7821872fef616bd3ea48ab89b752b7cfaae7d | 9,327 | js | JavaScript | src/IconMenu/IconMenu.js | clearcapital/material-ui | 781fce8ee5917760111e90f0133c4a0b353c1b0a | [
"MIT"
] | null | null | null | src/IconMenu/IconMenu.js | clearcapital/material-ui | 781fce8ee5917760111e90f0133c4a0b353c1b0a | [
"MIT"
] | 1 | 2018-03-13T15:14:49.000Z | 2018-03-13T15:14:49.000Z | src/IconMenu/IconMenu.js | clearcapital/material-ui | 781fce8ee5917760111e90f0133c4a0b353c1b0a | [
"MIT"
] | 5 | 2016-12-09T08:43:09.000Z | 2018-03-05T07:15:01.000Z | import React, {Component} from 'react';
import PropTypes from 'prop-types';
import ReactDOM from 'react-dom';
import Events from '../utils/events';
import propTypes from '../utils/propTypes';
import Menu from '../Menu/Menu';
import Popover from '../Popover/Popover';
import warning from 'warning';
class IconMenu extends Component {
static muiName = 'IconMenu';
static propTypes = {
/**
* This is the point on the icon where the menu
* `targetOrigin` will attach.
* Options:
* vertical: [top, center, bottom]
* horizontal: [left, middle, right].
*/
anchorOrigin: propTypes.origin,
/**
* If true, the popover will apply transitions when
* it gets added to the DOM.
*/
animated: PropTypes.bool,
/**
* Override the default animation component used.
*/
animation: PropTypes.func,
/**
* Should be used to pass `MenuItem` components.
*/
children: PropTypes.node,
/**
* The CSS class name of the root element.
*/
className: PropTypes.string,
/**
* Sets the delay in milliseconds before closing the
* menu when an item is clicked.
* If set to 0 then the auto close functionality
* will be disabled.
*/
clickCloseDelay: PropTypes.number,
/**
* This is the `IconButton` to render. This button will open the menu.
*/
iconButtonElement: PropTypes.element.isRequired,
/**
* Override the inline-styles of the underlying icon element.
*/
iconStyle: PropTypes.object,
/**
* Override the inline-styles of the underlying `List` element.
*/
listStyle: PropTypes.object,
/**
* Override the inline-styles of the menu element.
*/
menuStyle: PropTypes.object,
/**
* If true, the value can an be array and allow the menu to be a multi-select.
*/
multiple: PropTypes.bool,
/**
* Callback function fired when the `IconButton` element is clicked.
*
* @param {object} event Click event targeting the `IconButton` element.
*/
onClick: PropTypes.func,
/**
* Callback function fired when a menu item is selected with a click.
*
* @param {object} event Click event targeting the selected menu item element.
* @param {object} child The selected element.
*/
onItemClick: PropTypes.func,
/**
* Callback function fired when the `IconButton` element is focused or blurred by the keyboard.
*
* @param {object} event `focus` or `blur` event targeting the `IconButton` element.
* @param {boolean} keyboardFocused If true, the `IconButton` element is focused.
*/
onKeyboardFocus: PropTypes.func,
/** @ignore */
onMouseDown: PropTypes.func,
/** @ignore */
onMouseEnter: PropTypes.func,
/** @ignore */
onMouseLeave: PropTypes.func,
/** @ignore */
onMouseUp: PropTypes.func,
/**
* Callback function fired when the `open` state of the menu is requested to be changed.
*
* @param {boolean} open If true, the menu was requested to be opened.
* @param {string} reason The reason for the open or close request. Possible values are
* 'keyboard' and 'iconTap' for open requests; 'enter', 'escape', 'itemTap', and 'clickAway'
* for close requests.
*/
onRequestChange: PropTypes.func,
/**
* If true, the `IconMenu` is opened.
*/
open: PropTypes.bool,
/**
* Override the inline-styles of the root element.
*/
style: PropTypes.object,
/**
* This is the point on the menu which will stick to the menu
* origin.
* Options:
* vertical: [top, center, bottom]
* horizontal: [left, middle, right].
*/
targetOrigin: propTypes.origin,
/**
* If true, the popover will render on top of an invisible
* layer, which will prevent clicks to the underlying elements.
*/
useLayerForClickAway: PropTypes.bool,
};
static defaultProps = {
anchorOrigin: {
vertical: 'top',
horizontal: 'left',
},
animated: true,
multiple: false,
open: null,
onItemClick: () => {},
onKeyboardFocus: () => {},
onMouseDown: () => {},
onMouseLeave: () => {},
onMouseEnter: () => {},
onMouseUp: () => {},
onRequestChange: () => {},
onClick: () => {},
targetOrigin: {
vertical: 'top',
horizontal: 'left',
},
clickCloseDelay: 200,
useLayerForClickAway: false,
};
static contextTypes = {
muiTheme: PropTypes.object.isRequired,
};
state = {
menuInitiallyKeyboardFocused: false,
open: false,
};
componentWillReceiveProps(nextProps) {
if (nextProps.open != null) {
this.setState({
open: nextProps.open,
anchorEl: this.refs.iconMenuContainer,
});
}
}
componentWillUnmount() {
clearTimeout(this.timerCloseId);
}
isOpen() {
return this.state.open;
}
close(reason, isKeyboard) {
if (!this.state.open) {
return;
}
if (this.props.open !== null) {
this.props.onRequestChange(false, reason);
} else {
this.setState({open: false}, () => {
// Set focus on the icon button when the menu close
if (isKeyboard) {
const iconButton = this.refs.iconButton;
ReactDOM.findDOMNode(iconButton).focus();
iconButton.setKeyboardFocus();
}
});
}
}
open(reason, event) {
if (this.props.open !== null) {
this.props.onRequestChange(true, reason);
return this.setState({
menuInitiallyKeyboardFocused: Events.isKeyboard(event),
anchorEl: event.currentTarget,
});
}
this.setState({
open: true,
menuInitiallyKeyboardFocused: Events.isKeyboard(event),
anchorEl: event.currentTarget,
});
}
handleItemClick = (event, child) => {
if (this.props.clickCloseDelay !== 0 && !child.props.hasOwnProperty('menuItems')) {
const isKeyboard = Events.isKeyboard(event);
this.timerCloseId = setTimeout(() => {
this.close(isKeyboard ? 'enter' : 'itemTap', isKeyboard);
}, this.props.clickCloseDelay);
}
this.props.onItemClick(event, child);
};
handleRequestClose = (reason) => {
this.close(reason);
};
handleEscKeyDownMenu = (event) => {
this.close('escape', event);
};
render() {
const {
anchorOrigin,
className,
animated,
animation,
iconButtonElement,
iconStyle,
onItemClick, // eslint-disable-line no-unused-vars
onKeyboardFocus,
onMouseDown,
onMouseLeave,
onMouseEnter,
onMouseUp,
onRequestChange, // eslint-disable-line no-unused-vars
onClick,
listStyle,
menuStyle,
style,
targetOrigin,
clickCloseDelay, // eslint-disable-line no-unused-vars
useLayerForClickAway,
...other
} = this.props;
const {prepareStyles} = this.context.muiTheme;
const {open, anchorEl} = this.state;
const styles = {
root: {
display: 'inline-block',
position: 'relative',
},
menu: {
position: 'relative',
},
};
const mergedRootStyles = Object.assign(styles.root, style);
const mergedMenuStyles = Object.assign(styles.menu, menuStyle);
warning(iconButtonElement.type.muiName !== 'SvgIcon',
`Material-UI: You shoud not provide an <SvgIcon /> to the 'iconButtonElement' property of <IconMenu />.
You should wrapped it with an <IconButton />.`);
const iconButtonProps = {
onKeyboardFocus: onKeyboardFocus,
onClick: (event) => {
this.open(Events.isKeyboard(event) ? 'keyboard' : 'iconTap', event);
if (iconButtonElement.props.onClick) {
iconButtonElement.props.onClick(event);
}
},
ref: 'iconButton',
};
if (iconStyle || iconButtonElement.props.iconStyle) {
iconButtonProps.iconStyle = iconStyle ?
Object.assign({}, iconStyle, iconButtonElement.props.iconStyle) :
iconButtonElement.props.iconStyle;
}
const iconButton = React.cloneElement(iconButtonElement, iconButtonProps);
const menu = (
<Menu
{...other}
initiallyKeyboardFocused={this.state.menuInitiallyKeyboardFocused}
onEscKeyDown={this.handleEscKeyDownMenu}
onItemClick={this.handleItemClick}
style={mergedMenuStyles}
listStyle={listStyle}
>
{this.props.children}
</Menu>
);
return (
<div
ref="iconMenuContainer"
className={className}
onMouseDown={onMouseDown}
onMouseLeave={onMouseLeave}
onMouseEnter={onMouseEnter}
onMouseUp={onMouseUp}
onClick={onClick}
style={prepareStyles(mergedRootStyles)}
>
{iconButton}
<Popover
anchorOrigin={anchorOrigin}
targetOrigin={targetOrigin}
open={open}
anchorEl={anchorEl}
childContextTypes={this.constructor.childContextTypes}
useLayerForClickAway={useLayerForClickAway}
onRequestClose={this.handleRequestClose}
animated={animated}
animation={animation}
context={this.context}
>
{menu}
</Popover>
</div>
);
}
}
export default IconMenu;
| 27.594675 | 109 | 0.613917 |
6fa78cb6ac38017a3ef09b0a71d5e8446fe61484 | 9,319 | js | JavaScript | public/assets/js/kweb/tree/datatables.js | qytela/kweb | 31d16393a156d4686d1de876db4b3094c296fdff | [
"MIT"
] | null | null | null | public/assets/js/kweb/tree/datatables.js | qytela/kweb | 31d16393a156d4686d1de876db4b3094c296fdff | [
"MIT"
] | null | null | null | public/assets/js/kweb/tree/datatables.js | qytela/kweb | 31d16393a156d4686d1de876db4b3094c296fdff | [
"MIT"
] | null | null | null | var tap_id = [];
var tanggal_status = [];
var event_type_id = [];
var params = {};
var TABLE_TREE = $("#table-tree");
reset();
setParams();
TABLE_TREE.DataTable({
oLanguage: {
sProcessing: "loading..."
},
processing: true,
serverSide: true,
tableReload: true,
ajax: {
"url": base_url + "tree/list_",
"type": "POST",
"data": function(d) {
d.tap_id = params.tap_id;
d.event_type_id = params.event_type_id;
d.periodstart = params.periodstart;
d.periodend = params.periodend;
d.tanggal_status = params.tanggal_status;
}
},
columns: [{
"data": "no",
"orderable": false,
className: 'dt-body-center',
"width": "4%"
},
{
"data": "EVENT_ID",
visible: false
},
{
"data": "NAMA_KASUS",
"orderable": false,
"searchable": false,
"width": "10%"
},
{
"data": "NAMA_TARGET",
"orderable": false,
"searchable": false,
"width": "10%"
},
{
"data": "ANUMBER",
"width": "6.5%"
},
{
"data": "DIRECTION",
className: 'dt-body-center',
"width": "5%"
},
{
"data": "BNUMBER",
"width": "6.5%"
},
{
"data": "STARTTIME",
render: function(data) {
return moment(data).format('DD-MM-YYYY HH:mm:ss');
},
className: 'dt-body-center',
"width": "10%"
},
{
"data": "ENDTIME",
render: function(data) {
return moment(data).format('DD-MM-YYYY HH:mm:ss');
},
className: 'dt-body-center',
"width": "10%"
},
{
"data": "EVENT_TYPE",
className: 'dt-body-center',
"width": "7%"
},
{
"data": "DATASIZE",
"width": "6%"
},
{
"data": "DURATION",
render: function(s) {
function pad(n, z) {
z = z || 2;
return ('00' + n).slice(-z);
}
var ms = s % 1000;
s = (s - ms) / 1000;
var secs = s % 60;
s = (s - secs) / 60;
var mins = s % 60;
var hrs = (s - mins) / 60;
return pad(hrs) + '.' + pad(mins) + '.' + pad(secs);
// return new Date(data * 1000).toISOString().substr(11, 8);
},
className: 'dt-body-center',
"width": "5%"
},
{
"data": null,
render: function(data, type, row) {
let prev = data.PREVIEW;
let result = '';
if (data.EVENT_TYPE == 'sms') {
if (prev && prev.length >= 50) {
const cut_prev = prev.substring(0, 50);
let title = "SMS Detail <a href='javascript:void(0);' class='close' data-dismiss='alert'>×</a>"
result = '<a href="javascript:void(0)" class="text-primary" data-html="true" title="' + title + '" data-toggle="popover" data-content="' + data.PREVIEW + '">' + cut_prev + ' ...</a>';
} else {
result = prev;
}
} else {
let content = "";
content += "<div class='loading-play'>";
content += "<div id='loading_run_" + data.EVENT_ID + "'>";
content += "<img src='" + base_url + "public/assets/images/loader-play.gif' width='70%' alt=''>";
content += "</div>";
content += "<div id='loading_success_" + data.EVENT_ID + "'>";
content += "</div>";
content += "<div id='loading_failed_" + data.EVENT_ID + "'>";
content += " <h2 class'text-primary'>Load file gagal..</h2>";
content += "</div>";
content += "</div>";
let title = "Play Audio <a href='#' class='close' data-dismiss='alert'>×</a>"
result = '<button type="button" data-html="true" title="' + title + '" data-toggle="popover" data-content="' + content + '" data="' + data.EVENT_ID + '" class="btn btn-primary btn-xs item-play"><span class="btn-icon-left text-primary"><i class="fas fa-play-circle fa-lg" style="color: #333;"></i> </span>Play</button>';
}
return result;
},
className: 'dt-body-center',
"orderable": false,
"searchable": false,
"width": "20%"
}
],
"fnDrawCallback": function(oSettings) {
$('[data-toggle="popover"]').popover({
html: true,
container: 'body'
});
$(document).on("click", ".popover .close", function() {
$(this).parents(".popover").popover('hide');
});
},
order: [
[1, 'desc']
]
});
TABLE_TREE.on("click", ".item-play", function() {
var id = $(this).attr('data');
$('#loading_run_' + id).show();
$('#loading_success_' + id).hide();
$('#loading_failed_' + id).hide();
$.ajax({
type: 'POST',
async: true,
url: base_url + 'tree/play_download_',
data: {
id: id
},
dataType: 'json',
success: function(data) {
$('#loading_run_' + id).hide();
let content = "";
content += "<audio controls class='audio-player' data-title='" + id + "' controlsList='nodownload'>";
content += "<source id='source_audio_" + id + "' src='" + api_play + "" + id + ".wav' type='audio/mpeg'>";
content += "</audio>";
$('#loading_success_' + id).html(content);
$('#loading_success_' + id).show();
},
error: function() {
$('#loading_run_' + id).hide();
$('#loading_failed_' + id).hide();
}
});
});
$("#filter").on("click", function() {
if (tree.length == 0) {
Swal.fire({
type: 'error',
title: 'Oops...',
text: 'Pilih filter!',
});
} else {
setParams();
$('#table-tree').DataTable().ajax.reload();
}
});
function setTree() {
var Source = [{
title: "Kasus",
folder: true,
children: setKasus(),
checkbox: false
}];
$("#tree").fancytree({
checkbox: true,
source: Source,
lazyLoad: function(event, data) {
var node = data.node;
data.result = setTarget(node.key);
},
selectMode: 2,
select: function(event, data) {
// Display list of selected nodes
var selNodes = data.tree.getSelectedNodes();
// convert to title/key array
var selKeys = $.map(selNodes, function(node) {
return parseInt(node.key);
});
tap_id = selKeys;
var selTitles = $.map(selNodes, function(node) {
return node.title;
});
var selTanggalStatus = $.map(selNodes, function(node) {
return node.data.tanggal_status;
});
tanggal_status = selTanggalStatus;
let $ul = $('.selected');
$ul.html('');
$ul.append(
selTitles.map(title =>
$("<li>").html(title)
)
);
},
});
$(".fancytree-container").addClass("fancytree-connectors");
$(".fancytree-container").css("font-size", "12pt");
}
$(".form-check-input").on("change", function() {
setEventType();
console.log("Fansa");
});
function setKasus() {
var data = [];
$.ajax({
url: base_url + "tree/get_kasus_",
type: "POST",
dataType: "json",
async: false,
dataType: "json",
success: function(response) {
var object = {}
$.each(response, function(key, value) {
object = {
key: value.id,
title: value.nama,
lazy: true,
checkbox: false,
folder: true,
};
data.push(object);
});
},
error: function() {
alert("Could not add data");
}
});
return data;
}
function setTarget(id) {
var data = [];
$.ajax({
url: base_url + "tree/get_target_",
type: "POST",
data: { id },
dataType: "json",
async: false,
dataType: "json",
success: function(response) {
var object = {}
$.each(response, function(key, value) {
object = {
key: value.tap_id,
title: value.nama,
mode: "children",
parent: id,
checkbox: true,
tanggal_status: value.tanggal_status
};
data.push(object);
});
},
error: function() {
alert("Could not add data");
}
});
return data;
}
function setEventType() {
const searchIDs = $("#cb_event_type input:checkbox:checked").map(function() {
return $(this).val();
}).get();
event_type_id = searchIDs;
}
function setParams() {
params = {
tap_id: tap_id,
event_type_id: event_type_id.toString(),
periodstart: $('#date_awal').val(),
periodend: $('#date_akhir').val(),
tanggal_status: tanggal_status
};
}
function reset() {
setTree();
$('#date_awal').datepicker("setDate", moment().add(-3, 'months').format("DD-MM-YYYY"));
$('#date_akhir').datepicker("setDate", moment().format("DD-MM-YYYY"));
$('.selected').html('');
$('#cb_voice').prop('checked', true);
$('#cb_sms').prop('checked', true);
setEventType();
} | 27.735119 | 337 | 0.483314 |
6fa7dcdc3cdc05c5a6af0700f4de7824fa33278f | 202 | js | JavaScript | src/createStaticElement.js | jayphelps/lazy-dom | 03153f8a9fd38d8c7d84825c2c7f5fdaa0a13d53 | [
"MIT"
] | null | null | null | src/createStaticElement.js | jayphelps/lazy-dom | 03153f8a9fd38d8c7d84825c2c7f5fdaa0a13d53 | [
"MIT"
] | 4 | 2021-10-06T08:27:04.000Z | 2022-02-26T21:01:04.000Z | src/createStaticElement.js | jayphelps/lazy-dom | 03153f8a9fd38d8c7d84825c2c7f5fdaa0a13d53 | [
"MIT"
] | null | null | null | import { $$isStatic } from './symbols';
import createElement from './createElement';
export default
function createStaticElement(domAsString) {
return createElement($$isStatic, null, domAsString);
}
| 25.25 | 54 | 0.762376 |
6fa8c146276f199892473ee922e1f02539c3a786 | 42 | js | JavaScript | Globals.js | smile-monkey/Push-Notification-React | cc04343ad517b9994b941084fcf386fd1db3aea8 | [
"MIT"
] | null | null | null | Globals.js | smile-monkey/Push-Notification-React | cc04343ad517b9994b941084fcf386fd1db3aea8 | [
"MIT"
] | null | null | null | Globals.js | smile-monkey/Push-Notification-React | cc04343ad517b9994b941084fcf386fd1db3aea8 | [
"MIT"
] | null | null | null | module.exports = {
PUSH_TOKEN: 'demo'
};
| 10.5 | 19 | 0.642857 |
6fa8f40c3b001c3f658b2f5c94231aa2cb59861e | 1,724 | js | JavaScript | __tests__/custom-rule-parser.test.js | iserko/look-at-me-sideways | bc18ce5d2b359075f400ea4b5ae848961871b10d | [
"MIT"
] | null | null | null | __tests__/custom-rule-parser.test.js | iserko/look-at-me-sideways | bc18ce5d2b359075f400ea4b5ae848961871b10d | [
"MIT"
] | null | null | null | __tests__/custom-rule-parser.test.js | iserko/look-at-me-sideways | bc18ce5d2b359075f400ea4b5ae848961871b10d | [
"MIT"
] | null | null | null | const {parse} = require('../lib/custom-rule-parser.js')
describe('Custom Rule Parser', () => {
it('Equality rule', () => {
let rule = parse(`( -> (match)
(=== ::match:foo "x")
)`);
expect(rule({foo:"x"})).toEqual(true)
expect(rule({foo:"y"})).toEqual(false)
});
it('And rules', () => {
let rule = parse(`( -> (match)
($all
(=== ::match:a 1)
(=== ::match:b 2)
)
)`);
expect(rule({a:1})).toEqual(false)
expect(rule({b:2})).toEqual(false)
expect(rule({a:1,b:2})).toEqual(true)
});
it('Pattern rules', () => {
let rule = parse(`( -> (match)
($match
"(ab)+"
::match:str
)
)`);
expect(rule({str:"xxxxx"})).toBeFalsy()
expect(rule({str:"xxxababxxx"})).toBeTruthy()
});
it('Sequential logic', () => {
let rule = parse(`( -> (match) ($last
($__let myvar (+ ::match:a ::match:b) )
(=== myvar 3)
))`);
expect(rule({a:1,b:1})).toEqual(false)
expect(rule({a:2,b:2})).toEqual(false)
expect(rule({a:1,b:2})).toEqual(true)
});
// FYI, below tests are addressed by https://github.com/shellyln/liyad/issues/1
it('Prototype unassignable 1', () => {
let rule = parse(`( -> (match)
(::match:constructor:prototype:foo= 1)
)`);
expect(() => rule({})).toThrow()
expect(({}).foo).toBeUndefined()
});
it('Prototype unassignable 2', () => {
let rule = parse(`( -> (match)
(::match:constructor@assign ::match:constructor:prototype (# ("bar" 2)) )
)`);
expect(() => rule({})).toThrow()
expect(({}).bar).toBeUndefined()
});
it('Can\'t Function.call(untrusted code)', () => {
let rule = parse(`( -> (match)
((::match:toString:constructor@call null "return this" ) ())
)`);
expect(() => rule({})).toThrow()
});
}); | 27.365079 | 80 | 0.537703 |
6fa992fa725074fd841f7d943b00619d52a5a332 | 348 | js | JavaScript | test/test.js | mugetsu/ash | 52e94a3c232217599847d668e5ecb7145b60758f | [
"MIT",
"Unlicense"
] | 3 | 2015-01-23T14:27:15.000Z | 2017-05-11T04:33:41.000Z | test/test.js | mugetsu/ash | 52e94a3c232217599847d668e5ecb7145b60758f | [
"MIT",
"Unlicense"
] | 1 | 2018-02-18T17:28:46.000Z | 2018-02-18T17:28:46.000Z | test/test.js | mugetsu/ash | 52e94a3c232217599847d668e5ecb7145b60758f | [
"MIT",
"Unlicense"
] | null | null | null | var assert = require('assert');
describe('Find the One', function() {
var person = 'Efrelyn';
var people = ['Randell', 'Efrelyn', 'Elise'];
describe('Find ' + person, function() {
it('should return 1 when ' + person + ' is the one', function() {
assert.equal(1, ['Randell', 'Efrelyn', 'Elise'].indexOf(person));
});
});
}); | 24.857143 | 71 | 0.583333 |
6fa9d48c016706faa722314bdbbfb7ff75fa33c7 | 1,368 | js | JavaScript | node_modules/caniuse-lite/data/features/border-image.js | spegustavo/VaadinProject | 4857741baeceb6ebc1fe3d79da4419b558fed119 | [
"Unlicense"
] | 8 | 2021-09-20T13:25:37.000Z | 2022-01-02T06:59:10.000Z | node_modules/caniuse-lite/data/features/border-image.js | spegustavo/VaadinProject | 4857741baeceb6ebc1fe3d79da4419b558fed119 | [
"Unlicense"
] | 34 | 2021-12-02T07:19:09.000Z | 2022-03-24T07:20:53.000Z | node_modules/caniuse-lite/data/features/border-image.js | spegustavo/VaadinProject | 4857741baeceb6ebc1fe3d79da4419b558fed119 | [
"Unlicense"
] | 5 | 2021-11-03T23:42:38.000Z | 2021-11-17T15:21:34.000Z | module.exports={A:{A:{"1":"B","2":"J D E F A jB"},B:{"1":"L G M N O R S T U V W X Y Z a b c P H","129":"C K"},C:{"1":"9 AB BB CB DB EB FB GB HB cB IB dB JB KB Q LB MB NB OB PB QB RB SB TB UB VB WB XB YB R S T lB U V W X Y Z a b c P H eB","2":"kB bB","260":"0 1 2 3 4 5 6 7 8 G M N O e f g h i j k l m n o p q r s t u v w x y z","804":"I d J D E F A B C K L mB nB"},D:{"1":"FB GB HB cB IB dB JB KB Q LB MB NB OB PB QB RB SB TB UB VB WB XB YB R S T U V W X Y Z a b c P H eB oB pB","260":"AB BB CB DB EB","388":"0 1 2 3 4 5 6 7 8 9 p q r s t u v w x y z","1412":"G M N O e f g h i j k l m n o","1956":"I d J D E F A B C K L"},E:{"129":"A B C K L G uB gB ZB aB vB wB xB","1412":"J D E F sB tB","1956":"I d qB fB rB"},F:{"1":"2 3 4 5 6 7 8 9 AB BB CB DB EB FB GB HB IB JB KB Q LB MB NB OB PB QB RB SB TB UB VB WB XB YB","2":"F yB zB","260":"0 1 x y z","388":"G M N O e f g h i j k l m n o p q r s t u v w","1796":"0B 1B","1828":"B C ZB hB 2B aB"},G:{"129":"9B AC BC CC DC EC FC GC HC IC JC KC LC","1412":"E 5B 6B 7B 8B","1956":"fB 3B iB 4B"},H:{"1828":"MC"},I:{"1":"H","388":"RC SC","1956":"bB I NC OC PC QC iB"},J:{"1412":"A","1924":"D"},K:{"1":"Q","2":"A","1828":"B C ZB hB aB"},L:{"1":"H"},M:{"1":"P"},N:{"1":"B","2":"A"},O:{"388":"TC"},P:{"1":"WC XC YC gB ZC aC bC cC","260":"UC VC","388":"I"},Q:{"260":"dC"},R:{"260":"eC"},S:{"260":"fC"}},B:4,C:"CSS3 Border images"};
| 684 | 1,367 | 0.509503 |
6fa9fb8f3f173987179b12bf644252eb4948665b | 15,999 | js | JavaScript | test/unit/lib/mod/parser/parser.spec.js | NPLFoshan/keepwork | c0632050508fb3809c81dd27f14a83b07db64a64 | [
"MIT"
] | 33 | 2017-07-20T03:14:08.000Z | 2022-02-22T12:24:20.000Z | test/unit/lib/mod/parser/parser.spec.js | NPLFoshan/keepwork | c0632050508fb3809c81dd27f14a83b07db64a64 | [
"MIT"
] | 2,829 | 2017-06-06T19:10:19.000Z | 2020-02-25T07:31:34.000Z | test/unit/lib/mod/parser/parser.spec.js | NPLFoshan/keepwork | c0632050508fb3809c81dd27f14a83b07db64a64 | [
"MIT"
] | 10 | 2017-07-20T03:14:10.000Z | 2018-12-13T06:51:15.000Z | import _ from 'lodash'
import Parser from '@/lib/mod/parser'
import BlockHelper from '@/lib/mod/parser/blockHelper'
describe('mod parser', () => {
const code = '\nhello\n```@Img\n```\n\n```@Title\n```\nworld\nwelcome\nto\nkeepwork\n'
const oldBlockList = Parser.buildBlockList(code)
let blockList
beforeEach(() => {
blockList = _.cloneDeep(oldBlockList)
})
describe('#buildBlockList', () => {
test('sample code', () => {
expect(code.split('\n').length).toEqual(12)
expect(blockList.length).toEqual(4)
expect(blockList[0].lineBegin).toEqual(1)
expect(blockList[1].lineBegin).toEqual(3)
expect(blockList[2].lineBegin).toEqual(6)
expect(blockList[3].lineBegin).toEqual(8)
expect(blockList[0].modType).toEqual('ModMarkdown')
expect(blockList[1].modType).toEqual('ModImg')
expect(blockList[2].modType).toEqual('ModTitle')
expect(blockList[3].modType).toEqual('ModMarkdown')
})
test('empty code', () => {
const newBlockList = Parser.buildBlockList('')
expect(newBlockList.length).toEqual(0)
})
test('code only contains \n', () => {
const newBlockList = Parser.buildBlockList('\n\n\n')
expect(newBlockList.length).toEqual(0)
})
test('non-empty code', () => {
const newBlockList = Parser.buildBlockList('\n hello \n world \n')
expect(newBlockList.length).toEqual(1)
})
test('mod list include different mods', () => {
const newBlockList = Parser.buildBlockList('\n hello \n```@Title\n```\n')
expect(newBlockList.length).toEqual(2)
})
test('begin line', () => {
const newBlockList = Parser.buildBlockList('\n hello \n world \n')
expect(newBlockList[0].lineBegin).toEqual(1)
})
test('should avoid the invalid mod cmd', () => {
const newBlockList = Parser.buildBlockList('\n hello \n```@AreYouKiddingMe\n```\n')
expect(newBlockList.length).toEqual(1)
})
test('should parse the old version cmd', () => {
const newBlockList = Parser.buildBlockList('\n hello \n```@board/main\n```\n')
expect(newBlockList.length).toEqual(2)
expect(newBlockList[1].modType).toEqual('ModBoard')
})
test('should parse the irregular cmd', () => {
let newBlockList = Parser.buildBlockList('\n hello \n```@bOArd\n```\n')
expect(newBlockList.length).toEqual(2)
expect(newBlockList[1].modType).toEqual('ModBoard')
newBlockList = Parser.buildBlockList('\n hello \n```@pARacraft\n```\n')
expect(newBlockList.length).toEqual(2)
expect(newBlockList[1].modType).toEqual('ModParacraft')
})
test('should not parse the irregular cmd with old version', () => {
let newBlockList = Parser.buildBlockList('\n hello \n```@boArd/MaIn\n```\n')
expect(newBlockList.length).toEqual(1)
newBlockList = Parser.buildBlockList('\n hello \n```@wiki/js/WOrld3D\n```\n')
expect(newBlockList.length).toEqual(1)
})
test('old paracraft mod', () => {
const newBlockList = Parser.buildBlockList('\n hello \n```@paracraft\n```\n```@wiki/js/world3D\n```\n')
expect(newBlockList.length).toEqual(3)
expect(newBlockList[1].modType).toEqual('ModParacraft')
expect(newBlockList[2].modType).toEqual('ModParacraft')
})
})
describe('#buildMarkdown', () => {
test('will keep the previous empty lines', () => {
const newCode = '\n\nhello\n```@Img\n```\n```@Title\n```\nworld\n'
const newBlockList = Parser.updateBlockList(blockList, Parser.buildBlockList(newCode))
expect(newBlockList[0].lineBegin).toEqual(1)
expect(Parser.buildMarkdown(newBlockList)).toMatch(newCode)
})
test('will remove the ending empty lines if the last mod is not markdown mod', () => {
const newCode = '\n\nhello\n```@Img\n```\n```@Title\n```\n\n\n'
const newBlockList = Parser.updateBlockList(blockList, Parser.buildBlockList(newCode))
expect(newBlockList[0].lineBegin).toEqual(1)
expect(Parser.buildMarkdown(newBlockList)).not.toEqual(newCode)
})
test('will keep the empty lines between mods', () => {
const newCode = '\n\nhello\n```@Img\n```\n\n\n```@Title\n```\nworld\n'
const newBlockList = Parser.updateBlockList(blockList, Parser.buildBlockList(newCode))
expect(newBlockList[0].lineBegin).toEqual(1)
expect(Parser.buildMarkdown(newBlockList)).toEqual(newCode)
})
})
describe('#updateBlockList', () => {
test('insert mod at the beginning', () => {
const newCode = '```@Menu\n```\n\nhello\n```@Img\n```\n```@Title\n```\nworld\n'
const newBlockList = Parser.updateBlockList(blockList, Parser.buildBlockList(newCode))
expect(newBlockList[1].key).toEqual(oldBlockList[0].key)
expect(newBlockList[2].key).toEqual(oldBlockList[1].key)
expect(newBlockList[1].lineBegin).toEqual(oldBlockList[0].lineBegin + 2)
expect(newBlockList[2].lineBegin).toEqual(oldBlockList[1].lineBegin + 2)
})
test('insert mod into the middle', () => {
const newCode = '\nhello\n```@Img\n```\n```@Menu\n```\n\n```@Title\n```\nworld\n'
const newBlockList = Parser.updateBlockList(blockList, Parser.buildBlockList(newCode))
expect(newBlockList[0].key).toEqual(oldBlockList[0].key)
expect(newBlockList[3].key).toEqual(oldBlockList[2].key)
expect(newBlockList[0].lineBegin).toEqual(oldBlockList[0].lineBegin)
expect(newBlockList[3].lineBegin).toEqual(oldBlockList[2].lineBegin + 2)
})
test('insert mod to the end', () => {
const newCode = '\nhello\n```@Img\n```\n```@Title\n```\nworld\n```@Menu\n```\n'
const newBlockList = Parser.updateBlockList(blockList, Parser.buildBlockList(newCode))
expect(newBlockList[0].key).toEqual(oldBlockList[0].key)
expect(newBlockList[1].key).toEqual(oldBlockList[1].key)
expect(newBlockList[0].lineBegin).toEqual(oldBlockList[0].lineBegin)
expect(newBlockList[1].lineBegin).toEqual(oldBlockList[1].lineBegin)
})
test('copy and paste to rearange mod order', () => {
const newCode = '\nhello\n```@Title\n```\n```@Img\n```\nworld\n'
const newBlockList = Parser.updateBlockList(blockList, Parser.buildBlockList(newCode))
expect(newBlockList[1].key).toEqual(oldBlockList[2].key)
expect(newBlockList[2].key).toEqual(oldBlockList[1].key)
})
test('copy and paste to rearange and update mods', () => {
const newCode = '\nhello\n```@Title\n```\nabc world\n```@Img\n```\n'
const newBlockList = Parser.updateBlockList(blockList, Parser.buildBlockList(newCode))
expect(newBlockList[2].uuid).toEqual(oldBlockList[3].uuid)
expect(newBlockList[1].key).toEqual(oldBlockList[2].key)
expect(newBlockList[3].key).toEqual(oldBlockList[1].key)
})
})
describe('#willAffectModData', () => {
const markdownBlock = oldBlockList[0]
const generalMod = oldBlockList[1]
test('no cmd info', () => {
const mdLines = 'hello\n world\n'.split('\n')
expect(Parser.willAffectModData(markdownBlock, mdLines)).toEqual(false)
expect(Parser.willAffectModData(generalMod, mdLines)).toEqual(false)
})
test('include fake cmd info', () => {
const mdLines = 'hello\n```@AreYouKiddingMe\n'.split('\n')
expect(Parser.willAffectModData(markdownBlock, mdLines)).toEqual(false)
expect(Parser.willAffectModData(generalMod, mdLines)).toEqual(false)
})
test('include real cmd info', () => {
const mdLines = 'hello\n```@Title\n'.split('\n')
expect(Parser.willAffectModData(markdownBlock, mdLines)).toEqual(true)
expect(Parser.willAffectModData(generalMod, mdLines)).toEqual(true)
})
test('include cmd ending', () => {
const mdLines = 'hello\n```\n'.split('\n')
expect(Parser.willAffectModData(markdownBlock, mdLines)).toEqual(false)
expect(Parser.willAffectModData(generalMod, mdLines)).toEqual(true)
})
})
describe('#updateBlockCode', () => {
test('update general mod code', () => {
const newCode = '\nhello\n```@Img\nstyle: 0\n```\n```@Title\n```\nworld\n'
const newBlock = Parser.updateBlockCode(blockList, blockList[1].key, newCode)
expect(blockList[2].lineBegin).toEqual(oldBlockList[2].lineBegin + 1)
expect(newBlock.lengthDiff).toEqual(1)
})
test('update markdown code', () => {
const newCode = '\nhello\nheyyo\n```@Img\n```\n```@Title\n```\nworld\n'
const newBlock = Parser.updateBlockCode(blockList, blockList[0].key, newCode)
expect(blockList[1].lineBegin).toEqual(oldBlockList[1].lineBegin + 1)
expect(newBlock.lengthDiff).toEqual(1)
})
})
describe('#updateBlockAttribute', () => {
test('set new attribute', () => {
let generalMod = oldBlockList[1]
// yaml parser will always add an empty line in the end of code
generalMod = Parser.updateBlockAttribute(blockList, generalMod.key, 'style', 0)
expect(generalMod.lengthDiff).toEqual(2)
expect(blockList[2].lineBegin).toEqual(oldBlockList[2].lineBegin + 2)
generalMod = Parser.updateBlockAttribute(blockList, generalMod.key, 'src', 'keepwork.com')
expect(generalMod.lengthDiff).toEqual(1)
})
test('update attribute', () => {
let generalMod = oldBlockList[1]
generalMod = Parser.updateBlockAttribute(blockList, generalMod.key, 'style', 0)
generalMod = Parser.updateBlockAttribute(blockList, generalMod.key, 'style', 1)
expect(generalMod.lengthDiff).toEqual(0)
})
})
describe('#deleteBlock', () => {
test('delete a general block', () => {
let generalMod = oldBlockList[1]
Parser.deleteBlock(blockList, generalMod.key)
expect(blockList.length).toEqual(oldBlockList.length - 1)
expect(blockList[1].lineBegin).not.toEqual(oldBlockList[2].lineBegin)
})
test('delete a markdown block', () => {
let markdownMod = oldBlockList[0]
Parser.deleteBlock(blockList, markdownMod.key)
expect(blockList.length).toEqual(oldBlockList.length - 1)
expect(blockList[1].lineBegin).not.toEqual(oldBlockList[2].lineBegin)
})
test('delete a general mod which is in the middle of two markdown mod', () => {
const newCode = '\nhello\n```@Img\n```\nworld\n'
let newBlockList = Parser.updateBlockList(blockList, Parser.buildBlockList(newCode))
expect(newBlockList[0].md.length).toEqual(2)
Parser.deleteBlock(newBlockList, newBlockList[1].key)
expect(newBlockList.length).toEqual(1)
expect(newBlockList[0].md.length).toEqual(4)
})
})
describe('#moveBlock', () => {
test('general moving', () => {
Parser.moveBlock(blockList, 2, 3)
expect(blockList.length).toEqual(oldBlockList.length)
expect(blockList[3].lineBegin).not.toEqual(oldBlockList[2].lineBegin)
})
test('moving with markdown merging', () => {
Parser.moveBlock(blockList, 0, 2)
expect(blockList.length).toEqual(oldBlockList.length - 1)
expect(blockList[1].lineBegin).not.toEqual(oldBlockList[0].lineBegin)
})
})
describe('#addBlockAfterIndex', () => {
test('add general mod after markdown mod', () => {
let newBlock = Parser.buildBlock('Title')
newBlock = Parser.addBlockAfterIndex(blockList, 0, newBlock)
expect(blockList.length).toEqual(oldBlockList.length + 1)
expect(newBlock.lineBegin).toBeGreaterThan(blockList[0].lineBegin)
expect(newBlock.lineBegin).toEqual(BlockHelper.endLine(blockList[0]))
})
test('add general mod after general mod', () => {
let newBlock = Parser.buildBlock('Title')
newBlock = Parser.addBlockAfterIndex(blockList, 1, newBlock)
expect(blockList.length).toEqual(oldBlockList.length + 1)
expect(newBlock.lineBegin).toBeGreaterThan(blockList[1].lineBegin)
expect(newBlock.lineBegin).toEqual(BlockHelper.endLine(blockList[1]) + 2)
})
test('add markdown mod before or after markdown mod', () => {
let newBlock = Parser.buildBlock('Markdown', { md: { data: '' } })
Parser.addBlockAfterIndex(blockList, 0, newBlock)
expect(blockList.length).toEqual(oldBlockList.length)
expect(blockList[0].md).not.toEqual(oldBlockList[0].md)
expect(blockList[0].key).not.toEqual(oldBlockList[0].key)
expect(blockList[1].key).toEqual(oldBlockList[1].key)
Parser.addBlockAfterIndex(blockList, -1, newBlock)
expect(blockList.length).toEqual(oldBlockList.length)
expect(blockList[0].md).not.toEqual(oldBlockList[0].md)
expect(blockList[0].key).not.toEqual(oldBlockList[0].key)
expect(blockList[1].key).toEqual(oldBlockList[1].key)
})
})
describe('#addBlockByKey', () => {
test('add general mod after markdown mod', () => {
let newBlock = Parser.buildBlock('Title')
newBlock = Parser.addBlockByKey(blockList, blockList[0].key, newBlock)
expect(blockList.length).toEqual(oldBlockList.length + 1)
expect(newBlock.lineBegin).toBeGreaterThan(blockList[0].lineBegin)
expect(newBlock.lineBegin).toEqual(BlockHelper.endLine(blockList[0]))
})
test('add general mod after general mod', () => {
let newBlock = Parser.buildBlock('Title')
newBlock = Parser.addBlockByKey(blockList, blockList[1].key, newBlock)
expect(blockList.length).toEqual(oldBlockList.length + 1)
expect(newBlock.lineBegin).toBeGreaterThan(blockList[1].lineBegin)
expect(newBlock.lineBegin).toEqual(BlockHelper.endLine(blockList[1]) + 2)
})
test('add markdown mod before or after markdown mod', () => {
let newBlock = Parser.buildBlock('Markdown', { md: { data: '' } })
Parser.addBlockByKey(blockList, blockList[0].key, newBlock)
expect(blockList.length).toEqual(oldBlockList.length)
expect(blockList[0].md).not.toEqual(oldBlockList[0].md)
expect(blockList[0].key).not.toEqual(oldBlockList[0].key)
expect(blockList[1].key).toEqual(oldBlockList[1].key)
Parser.addBlockByKey(blockList, null, newBlock)
expect(blockList.length).toEqual(oldBlockList.length)
expect(blockList[0].md).not.toEqual(oldBlockList[0].md)
expect(blockList[0].key).not.toEqual(oldBlockList[0].key)
expect(blockList[1].key).toEqual(oldBlockList[1].key)
})
})
describe('#addBlockToMarkdown', () => {
test('add mod inside markdown mod', () => {
let newCode = Parser.addBlockToMarkdown(code, 8, 'ModTitle', 'styleID : 1')
expect(newCode).toContain('styleID')
const newBlockList = Parser.buildBlockList(newCode)
expect(newBlockList.length).toBeGreaterThan(oldBlockList.length)
expect(newBlockList.length).toEqual(6)
expect(newBlockList[4].modType).toEqual('ModTitle')
expect(newBlockList[4].data.styleID).toEqual(1)
})
test('add mod inside markdown mod without styleID', () => {
let newCode = Parser.addBlockToMarkdown(code, 8, 'ModTitle')
expect(newCode).not.toContain('styleID')
const newBlockList = Parser.buildBlockList(newCode)
expect(newBlockList.length).toBeGreaterThan(oldBlockList.length)
expect(newBlockList.length).toEqual(6)
expect(newBlockList[4].modType).toEqual('ModTitle')
expect(newBlockList[4].data.styleID).toBeUndefined()
})
test('should not add markdown mod', () => {
let newCode = Parser.addBlockToMarkdown(code, 8, 'ModMarkdown')
expect(newCode).toEqual(code)
})
})
describe('#getCmd', () => {
test('valid cmd', () => {
expect(Parser.getCmd('ModTitle')).toEqual('Title')
})
test('invalid cmd', () => {
expect(Parser.getCmd('ModKiddingMe')).toEqual('')
})
})
describe('#getActiveBlock', () => {
test('cursor inside a mod', () => {
expect(Parser.getActiveBlock(blockList, 2)).not.toBeUndefined()
})
test('cursor outside a mod', () => {
expect(Parser.getActiveBlock(blockList, 5)).toBeUndefined()
})
test('cursor point to the cmd line', () => {
expect(Parser.getActiveBlock(blockList, 3)).toBeUndefined()
})
})
})
| 46.239884 | 109 | 0.665167 |
6faa689d52e6cef3e811fd367c435bad343ae429 | 626 | js | JavaScript | src/components/templates/dashboard/index.js | pranayag15/insurance-company | ff71647d7eb5f66380eedeba757f42a8cf991341 | [
"MIT"
] | null | null | null | src/components/templates/dashboard/index.js | pranayag15/insurance-company | ff71647d7eb5f66380eedeba757f42a8cf991341 | [
"MIT"
] | null | null | null | src/components/templates/dashboard/index.js | pranayag15/insurance-company | ff71647d7eb5f66380eedeba757f42a8cf991341 | [
"MIT"
] | null | null | null | import React from "react"
import ElementHeader from "../../molecules/elementHeader"
import Sidebar from "../../organisms/sidePanel"
import styles from "./styles.js"
const Dashboard = props => {
return (
<div className="dashboard">
<div className="header">
<ElementHeader logo="enabled" title="Business Details" />
</div>
<div className="content-wrapper">
<div className="sidebar">
<Sidebar user={props.user} />
</div>
<div className="content">{props.children}</div>
</div>
<style jsx>{styles}</style>
</div>
)
}
export default Dashboard
| 24.076923 | 65 | 0.615016 |
6faa6a3d3ca071df3c577cc9374a820c00da5c12 | 5,700 | js | JavaScript | node_modules/@walletconnect/socket-transport/dist/esm/index.js | paulslen/audits-slingshot | d065286c33939509056b400c8b81d41dabf58846 | [
"MIT"
] | null | null | null | node_modules/@walletconnect/socket-transport/dist/esm/index.js | paulslen/audits-slingshot | d065286c33939509056b400c8b81d41dabf58846 | [
"MIT"
] | null | null | null | node_modules/@walletconnect/socket-transport/dist/esm/index.js | paulslen/audits-slingshot | d065286c33939509056b400c8b81d41dabf58846 | [
"MIT"
] | null | null | null | import { isBrowser, getLocation, getQueryString, detectEnv, appendToQueryString, } from "@walletconnect/utils";
import NetworkMonitor from "./network";
const WS = typeof global.WebSocket !== "undefined" ? global.WebSocket : require("ws");
class SocketTransport {
constructor(opts) {
this._queue = [];
this._events = [];
this._subscriptions = [];
this._protocol = opts.protocol;
this._version = opts.version;
this._url = "";
this._netMonitor = null;
this._socket = null;
this._nextSocket = null;
this._subscriptions = opts.subscriptions || [];
this._netMonitor = opts.netMonitor || new NetworkMonitor();
if (!opts.url || typeof opts.url !== "string") {
throw new Error("Missing or invalid WebSocket url");
}
this._url = opts.url;
this._netMonitor.on("online", () => this._socketCreate());
}
set readyState(value) {
}
get readyState() {
return this._socket ? this._socket.readyState : -1;
}
set connecting(value) {
}
get connecting() {
return this.readyState === 0;
}
set connected(value) {
}
get connected() {
return this.readyState === 1;
}
set closing(value) {
}
get closing() {
return this.readyState === 2;
}
set closed(value) {
}
get closed() {
return this.readyState === 3;
}
open() {
this._socketCreate();
}
close() {
this._socketClose();
}
send(message, topic, silent) {
if (!topic || typeof topic !== "string") {
throw new Error("Missing or invalid topic field");
}
this._socketSend({
topic: topic,
type: "pub",
payload: message,
silent: !!silent,
});
}
subscribe(topic) {
this._socketSend({
topic: topic,
type: "sub",
payload: "",
silent: true,
});
}
on(event, callback) {
this._events.push({ event, callback });
}
_socketCreate() {
if (this._nextSocket) {
return;
}
const url = getWebSocketUrl(this._url, this._protocol, this._version);
this._nextSocket = new WS(url);
if (!this._nextSocket) {
throw new Error("Failed to create socket");
}
this._nextSocket.onmessage = (event) => this._socketReceive(event);
this._nextSocket.onopen = () => this._socketOpen();
this._nextSocket.onerror = (event) => this._socketError(event);
this._nextSocket.onclose = () => {
setTimeout(() => {
this._nextSocket = null;
this._socketCreate();
}, 1000);
};
}
_socketOpen() {
this._socketClose();
this._socket = this._nextSocket;
this._nextSocket = null;
this._queueSubscriptions();
this._pushQueue();
}
_socketClose() {
if (this._socket) {
this._socket.onclose = () => {
};
this._socket.close();
}
}
_socketSend(socketMessage) {
const message = JSON.stringify(socketMessage);
if (this._socket && this._socket.readyState === 1) {
this._socket.send(message);
}
else {
this._setToQueue(socketMessage);
this._socketCreate();
}
}
async _socketReceive(event) {
let socketMessage;
try {
socketMessage = JSON.parse(event.data);
}
catch (error) {
return;
}
this._socketSend({
topic: socketMessage.topic,
type: "ack",
payload: "",
silent: true,
});
if (this._socket && this._socket.readyState === 1) {
const events = this._events.filter(event => event.event === "message");
if (events && events.length) {
events.forEach(event => event.callback(socketMessage));
}
}
}
_socketError(e) {
const events = this._events.filter(event => event.event === "error");
if (events && events.length) {
events.forEach(event => event.callback(e));
}
}
_queueSubscriptions() {
const subscriptions = this._subscriptions;
subscriptions.forEach((topic) => this._queue.push({
topic: topic,
type: "sub",
payload: "",
silent: true,
}));
this._subscriptions = [];
}
_setToQueue(socketMessage) {
this._queue.push(socketMessage);
}
_pushQueue() {
const queue = this._queue;
queue.forEach((socketMessage) => this._socketSend(socketMessage));
this._queue = [];
}
}
function getWebSocketUrl(_url, protocol, version) {
var _a, _b;
const url = _url.startsWith("https")
? _url.replace("https", "wss")
: _url.startsWith("http")
? _url.replace("http", "ws")
: _url;
const splitUrl = url.split("?");
const params = isBrowser()
? {
protocol,
version,
env: "browser",
host: ((_a = getLocation()) === null || _a === void 0 ? void 0 : _a.host) || "",
}
: {
protocol,
version,
env: ((_b = detectEnv()) === null || _b === void 0 ? void 0 : _b.name) || "",
};
const queryString = appendToQueryString(getQueryString(splitUrl[1] || ""), params);
return splitUrl[0] + "?" + queryString;
}
export default SocketTransport;
//# sourceMappingURL=index.js.map | 30.15873 | 111 | 0.521053 |
6fabe32fb51433cf5263a8b3a5dca815143a7a45 | 1,705 | js | JavaScript | src/index.js | antireal/dictate.work | 9be5ad1a452d72db8c05741b01ff32d901b39bd2 | [
"MIT"
] | null | null | null | src/index.js | antireal/dictate.work | 9be5ad1a452d72db8c05741b01ff32d901b39bd2 | [
"MIT"
] | null | null | null | src/index.js | antireal/dictate.work | 9be5ad1a452d72db8c05741b01ff32d901b39bd2 | [
"MIT"
] | null | null | null | import * as THREE from "three";
import WebGLApp from "./lib/WebGLApp";
import assets from "./lib/AssetManager";
import MeshController from "./scene/MeshController";
import SimplexNoise from "simplex-noise";
import PostProcessing from "./scene/PostProcessing";
import CameraController from "./scene/CameraController";
window.DEBUG = window.location.search.includes("debug");
// grab our canvas
const canvas = document.querySelector("#app");
// setup the WebGLRenderer
const webgl = new WebGLApp({
canvas,
// enable transparency
alpha: true,
// set the scene background color
background: "#0a0d30",
backgroundAlpha: 1,
postprocessing: true,
// show the fps counter from stats.js
showFps: window.DEBUG,
orbitControls: false, //window.DEBUG && { distance: 7, damping: 0.1 },
});
// attach it to the window to inspect in the console
if (window.DEBUG) {
window.webgl = webgl;
}
// hide canvas
webgl.canvas.style.visibility = "hidden";
const simplex = new SimplexNoise();
// load any queued assets
assets.load({ renderer: webgl.renderer }).then(() => {
// show canvas
webgl.canvas.style.visibility = "";
// move the camera behind,
// this will be considered only if orbitControls are disabled
webgl.camera.position.set(0, 0, 6);
const mesh_controller = new MeshController(webgl, simplex, webgl.camera, {
regen_prob: 0.2,
regen_cooldown: 0.5,
});
webgl.scene.add(mesh_controller);
const post = new PostProcessing(webgl, {});
webgl.scene.add(post);
const camera_controller = new CameraController(
webgl,
webgl.orbitControls,
{}
);
webgl.scene.add(camera_controller);
// start animation loop
webgl.start();
webgl.draw();
});
| 24.710145 | 76 | 0.704985 |
6fac6bbd656ef43b7a28de058721a4fb2e424fde | 1,518 | js | JavaScript | server/models/Reservation.js | bgswilde/Stay-Happy | 596bcb7076c5a02aa5473ec9154b69f43c15955a | [
"MIT"
] | null | null | null | server/models/Reservation.js | bgswilde/Stay-Happy | 596bcb7076c5a02aa5473ec9154b69f43c15955a | [
"MIT"
] | 30 | 2021-11-18T02:29:33.000Z | 2021-11-29T05:46:01.000Z | server/models/Reservation.js | bgswilde/Stay-Happy | 596bcb7076c5a02aa5473ec9154b69f43c15955a | [
"MIT"
] | null | null | null | const mongoose = require('mongoose')
const { Schema, Types } = mongoose;
const FeedbackSchema = require('./Feedback');
const PackageSchema = require('./Package');
const HotelSchema = require('./Hotel');
const { dateFormater } = require('../utils/dateFormat');
const ReservationSchema = new Schema(
{
customerId: {
type: String
},
checkerId: {
type: String
},
createdAt: {
type: Date,
default: Date.now,
get: timestamp => dateFormater(timestamp)
},
claimedAt: {
type: Date,
get: timestamp => dateFormater(timestamp)
},
completedAt: {
type: Date,
get: timestamp => dateFormater(timestamp)
},
customer: {
type: Schema.Types.ObjectId,
ref: 'User'
},
checker: {
type: Schema.Types.ObjectId,
ref: 'User'
},
package: PackageSchema,
hotel: HotelSchema,
feedback: FeedbackSchema,
checkIn: {
type: String
},
confirmationKey: {
type: String
},
instructions: {
type: String,
minlength: 1
},
options: []
},
{
toJSON: {
virtuals: true
}
}
);
ReservationSchema.virtual('status').get(function() {
if (!this.claimedAt && !this.completedAt) {
return ''
} else if (!this.completedAt) {
return 'claimed'
} else {
return 'completed'
}
})
const Reservation = mongoose.model('Reservation', ReservationSchema)
module.exports = Reservation;
| 20.24 | 68 | 0.56917 |
6facd98164546ecb3c1568afe4feb2031e1565cc | 2,880 | js | JavaScript | node_modules/react-dev-utils/node_modules/caniuse-lite/data/regions/SZ.js | hugocoding/dragongen | 237e030f14925daf0caaffb4992d39a5e28492db | [
"MIT"
] | 40 | 2021-09-14T19:02:17.000Z | 2022-03-30T20:40:17.000Z | node_modules/react-dev-utils/node_modules/caniuse-lite/data/regions/SZ.js | hugocoding/dragongen | 237e030f14925daf0caaffb4992d39a5e28492db | [
"MIT"
] | 56 | 2021-10-11T21:57:39.000Z | 2022-01-14T22:12:38.000Z | node_modules/react-dev-utils/node_modules/caniuse-lite/data/regions/SZ.js | hugocoding/dragongen | 237e030f14925daf0caaffb4992d39a5e28492db | [
"MIT"
] | 9 | 2021-11-11T20:53:50.000Z | 2022-01-29T07:49:29.000Z | module.exports={C:{"52":0.00539,"54":0.00808,"56":0.00539,"59":0.00269,"60":0.06466,"61":0.02155,"66":0.00269,"68":0.00269,"72":0.00269,"78":0.03233,"83":0.00539,"88":0.01886,"91":0.03502,"92":0.26132,"93":0.51725,"94":0.0916,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 53 55 57 58 62 63 64 65 67 69 70 71 73 74 75 76 77 79 80 81 82 84 85 86 87 89 90 95 3.5 3.6"},D:{"11":0.00808,"37":0.00808,"40":0.00808,"46":0.00539,"48":0.00269,"49":0.00269,"51":0.00269,"57":0.00808,"60":0.01616,"62":0.00539,"63":0.00269,"65":0.06466,"66":0.00539,"67":0.00269,"69":0.01347,"70":0.05119,"71":0.00539,"73":0.00539,"74":0.01616,"75":0.00539,"77":0.01616,"78":0.00808,"79":0.01347,"80":0.00808,"81":0.02694,"84":0.01078,"85":0.01078,"86":0.06735,"87":0.11854,"88":0.01616,"89":0.03502,"90":0.01886,"91":0.53072,"92":0.15625,"93":0.51186,"94":10.94842,"95":1.60832,"96":0.00808,_:"4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 38 39 41 42 43 44 45 47 50 52 53 54 55 56 58 59 61 64 68 72 76 83 97 98"},F:{"16":0.00269,"42":0.00269,"63":0.00269,"65":0.01347,"74":0.00269,"76":0.00539,"77":0.01078,"78":0.00539,"79":0.73816,"80":0.19127,_:"9 11 12 15 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 64 66 67 68 69 70 71 72 73 75 9.5-9.6 10.5 10.6 11.1 11.5 11.6","10.0-10.1":0,"12.1":0.00539},G:{"8":0,"15":0.4359,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.01378,"5.0-5.1":0.00052,"6.0-6.1":0.00312,"7.0-7.1":0.00754,"8.1-8.4":0.00442,"9.0-9.2":0.0026,"9.3":0.00598,"10.0-10.2":0.00338,"10.3":0.09545,"11.0-11.2":0.00884,"11.3-11.4":0.00546,"12.0-12.1":0.01274,"12.2-12.5":0.37192,"13.0-13.1":0.01144,"13.2":0.00572,"13.3":0.02185,"13.4-13.7":0.05228,"14.0-14.4":0.47075,"14.5-14.8":1.06686},B:{"12":0.05657,"13":0.00808,"14":0.02155,"15":0.02425,"16":0.03772,"17":0.03772,"18":0.10776,"80":0.01078,"84":0.00808,"85":0.03233,"86":0.00269,"88":0.00539,"89":0.02425,"90":0.00539,"91":0.01616,"92":0.10776,"93":0.10776,"94":1.62987,"95":0.35022,_:"79 81 83 87"},E:{"4":0,"11":0.00269,"12":0.00808,"13":0.00539,"14":0.11584,"15":0.10237,_:"0 5 6 7 8 9 10 3.1 3.2 6.1 7.1 10.1","5.1":0.01078,"9.1":0.00539,"11.1":0.00269,"12.1":0.01616,"13.1":0.01886,"14.1":0.10507},P:{"4":0.50994,"5.0-5.4":0.07085,"6.2-6.4":0.0102,"7.2-7.4":0.8363,"8.2":0.03044,"9.2":0.0408,"10.1":0.0306,"11.1-11.2":0.14278,"12.0":0.09179,"13.0":0.28557,"14.0":0.43855,"15.0":1.83578},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0.00075,"4.2-4.3":0.00175,"4.4":0,"4.4.3-4.4.4":0.07056},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"11":0.12662,_:"6 7 8 9 10 5.5"},J:{"7":0,"10":0.01461},N:{"11":0.24045,_:"10"},R:{_:"0"},M:{"0":0.25568},Q:{"10.4":0},O:{"0":0.97887},H:{"0":21.48771},L:{"0":48.8893},S:{"2.5":0.23376}};
| 1,440 | 2,879 | 0.589931 |
6fad7313b01afb6b1ff7e40a6449154874c30b90 | 1,238 | js | JavaScript | Lecture_0120/script.js | AaronDean/Zero-to-Mastery | 8629313d508e51f786eb978983ce6a86177a8d1c | [
"MIT"
] | null | null | null | Lecture_0120/script.js | AaronDean/Zero-to-Mastery | 8629313d508e51f786eb978983ce6a86177a8d1c | [
"MIT"
] | null | null | null | Lecture_0120/script.js | AaronDean/Zero-to-Mastery | 8629313d508e51f786eb978983ce6a86177a8d1c | [
"MIT"
] | null | null | null | // using this array,
// var array = ["Banana", "Apples", "Oranges", "Blueberries"];
// 1. Remove the Banana from the array.
// 2. Sort the array in order.
// 3. Put "Kiwi" at the end of the array.
// 4. Remove "Apples" from the array.
// 5. Sort the array in reverse order. (Not alphabetical, but reverse
// the current Array i.e. ['a', 'c', 'b'] becomes ['b', 'c', 'a'])
// you should have at the end:
// ["Kiwi", "Oranges", "Blueberries"]
var myArray = ["Banana","Apples","Oranges","Blueberries"];
myArray.shift();
myArray.sort();
myArray.push("Kiwi");
myArray.shift();
myArray.reverse();
myArray.forEach(listingMyArray);
function listingMyArray(item, index) {
document.getElementById("myArray").innerHTML += index + ". " + item + "<br>";
}
// using this array,
// var array2 = ["Banana", ["Apples", ["Oranges"], "Blueberries"]];
// access "Oranges".
var myArray2 = ["Banana", ["Apples", ["Oranges","Banana"], "Blueberries"]];
/*
* I added "Banana" because if you just used myArray2[1][1] you would still get the right answer.
* But, it isn't exactly the right answer because it returns the hole array at [1][1] and not just
* "Oranges".
*/
document.getElementById("myArray2").innerHTML = myArray2[1][1][0]; | 26.340426 | 98 | 0.647819 |
6fad9c68a96fd694b9217e8ccd1045c1c5e25a50 | 1,831 | js | JavaScript | examples/youi/src/analytics/PostList.js | monishagunalan/react-admin | ba70010102f910ad2a9123cbb868426c935b661d | [
"MIT"
] | 2 | 2019-08-04T15:33:51.000Z | 2019-10-12T01:42:16.000Z | examples/youi/src/analytics/PostList.js | monishagunalan/react-admin | ba70010102f910ad2a9123cbb868426c935b661d | [
"MIT"
] | null | null | null | examples/youi/src/analytics/PostList.js | monishagunalan/react-admin | ba70010102f910ad2a9123cbb868426c935b661d | [
"MIT"
] | 3 | 2019-08-16T13:31:57.000Z | 2019-09-20T18:13:38.000Z | import React from 'react';
import Card from '@material-ui/core/Card';
import CardContent from '@material-ui/core/CardContent';
import Grid from '@material-ui/core/Grid'; //TODO: this is export!!!
import { withStyles } from '@material-ui/core/styles';
import {
List,
Responsive,
SimpleList,
TextField,
translate,
} from 'react-admin'; // eslint-disable-line import/no-unresolved
const listStyles = theme => ({
card: {
height: '100%',
display: 'flex',
flexDirection: 'column',
},
cardContent: theme.typography.body1,
cardLink: {
...theme.typography.body1,
flexGrow: 1,
},
});
// Determine what to display based on responsive layout ...
const PostList = props => (
<List {...props}>
<Responsive small={<CommentMobileList />} medium={<CommentGrid />} />
</List>
);
// Responsive display for mobile devices
const CommentMobileList = props => (
<SimpleList
primaryText={record => record.title}
secondaryText={record => record.body}
tertiaryText={record =>
new Date(record.created_at).toLocaleDateString()
}
{...props}
/>
);
// Responsive display for desktop
const CommentGrid = withStyles(listStyles)(
translate(({ classes, ids, data, basePath, translate }) => (
<Grid spacing={16} container style={{ padding: '0 1em' }}>
{ids.map(id => (
<Grid item key={id} sm={12} md={6} lg={4}>
<Card className={classes.card}>
<CardContent className={classes.cardContent}>
<TextField record={data[id]} source="body" />
</CardContent>
</Card>
</Grid>
))}
</Grid>
))
);
export default PostList;
| 28.609375 | 77 | 0.567449 |
6fadfdbe575478c95425a7b355b9d914fd750251 | 4,110 | js | JavaScript | Libraries/Utilities/differ/__tests__/deepDiffer-test.js | Buddhalow/react-native-astral | b02b1670d65118c333d3e0b83ddc99d2dc39dbed | [
"CC-BY-4.0",
"MIT"
] | 25 | 2019-10-30T21:33:39.000Z | 2021-11-17T15:22:09.000Z | Libraries/Utilities/differ/__tests__/deepDiffer-test.js | Buddhalow/react-native-astral | b02b1670d65118c333d3e0b83ddc99d2dc39dbed | [
"CC-BY-4.0",
"MIT"
] | 5 | 2019-10-30T21:25:24.000Z | 2021-02-16T18:39:24.000Z | Libraries/Utilities/differ/__tests__/deepDiffer-test.js | Buddhalow/react-native-astral | b02b1670d65118c333d3e0b83ddc99d2dc39dbed | [
"CC-BY-4.0",
"MIT"
] | 7 | 2017-01-28T19:26:50.000Z | 2021-12-02T06:31:11.000Z | /**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @emails oncall+react_native
*/
'use strict';
var deepDiffer = require('deepDiffer');
describe('deepDiffer', function() {
it('should diff primitives of the same type', () => {
expect(deepDiffer(1, 2)).toBe(true);
expect(deepDiffer(42, 42)).toBe(false);
expect(deepDiffer('foo', 'bar')).toBe(true);
expect(deepDiffer('foo', 'foo')).toBe(false);
expect(deepDiffer(true, false)).toBe(true);
expect(deepDiffer(false, true)).toBe(true);
expect(deepDiffer(true, true)).toBe(false);
expect(deepDiffer(false, false)).toBe(false);
expect(deepDiffer(null, null)).toBe(false);
expect(deepDiffer(undefined, undefined)).toBe(false);
});
it('should diff primitives of different types', () => {
expect(deepDiffer(1, '1')).toBe(true);
expect(deepDiffer(true, 'true')).toBe(true);
expect(deepDiffer(true, 1)).toBe(true);
expect(deepDiffer(false, 0)).toBe(true);
expect(deepDiffer(null, undefined)).toBe(true);
expect(deepDiffer(null, 0)).toBe(true);
expect(deepDiffer(null, false)).toBe(true);
expect(deepDiffer(null, '')).toBe(true);
expect(deepDiffer(undefined, 0)).toBe(true);
expect(deepDiffer(undefined, false)).toBe(true);
expect(deepDiffer(undefined, '')).toBe(true);
});
it('should diff Objects', () => {
expect(deepDiffer({}, {})).toBe(false);
expect(deepDiffer({}, null)).toBe(true);
expect(deepDiffer(null, {})).toBe(true);
expect(deepDiffer({a: 1}, {a: 1})).toBe(false);
expect(deepDiffer({a: 1}, {a: 2})).toBe(true);
expect(deepDiffer({a: 1}, {a: 1, b: null})).toBe(true);
expect(deepDiffer({a: 1}, {a: 1, b: 1})).toBe(true);
expect(deepDiffer({a: 1, b: 1}, {a: 1})).toBe(true);
expect(deepDiffer({a: {A: 1}, b: 1}, {a: {A: 1}, b: 1})).toBe(false);
expect(deepDiffer({a: {A: 1}, b: 1}, {a: {A: 2}, b: 1})).toBe(true);
expect(deepDiffer(
{a: {A: {aA: 1, bB: 1}}, b: 1},
{a: {A: {aA: 1, bB: 1}}, b: 1}
)).toBe(false);
expect(deepDiffer(
{a: {A: {aA: 1, bB: 1}}, b: 1},
{a: {A: {aA: 1, cC: 1}}, b: 1}
)).toBe(true);
});
it('should diff Arrays', () => {
expect(deepDiffer([], [])).toBe(false);
expect(deepDiffer([], null)).toBe(true);
expect(deepDiffer(null, [])).toBe(true);
expect(deepDiffer([42], [42])).toBe(false);
expect(deepDiffer([1], [2])).toBe(true);
expect(deepDiffer([1, 2, 3], [1, 2, 3])).toBe(false);
expect(deepDiffer([1, 2, 3], [1, 2, 4])).toBe(true);
expect(deepDiffer([1, 2, 3], [1, 4, 3])).toBe(true);
expect(deepDiffer([1, 2, 3, 4], [1, 2, 3])).toBe(true);
expect(deepDiffer([1, 2, 3], [1, 2, 3, 4])).toBe(true);
expect(deepDiffer([0, null, false, ''], [0, null, false, ''])).toBe(false);
expect(deepDiffer([0, null, false, ''], ['', false, null, 0])).toBe(true);
});
it('should diff mixed types', () => {
expect(deepDiffer({}, [])).toBe(true);
expect(deepDiffer([], {})).toBe(true);
expect(deepDiffer(
{a: [{A: {aA: 1, bB: 1}}, 'bar'], c: [1, [false]]},
{a: [{A: {aA: 1, bB: 1}}, 'bar'], c: [1, [false]]}
)).toBe(false);
expect(deepDiffer(
{a: [{A: {aA: 1, bB: 1}}, 'bar'], c: [1, [false]]},
{a: [{A: {aA: 1, bB: 2}}, 'bar'], c: [1, [false]]}
)).toBe(true);
expect(deepDiffer(
{a: [{A: {aA: 1, bB: 1}}, 'bar'], c: [1, [false]]},
{a: [{A: {aA: 1, bB: 1}}, 'bar'], c: [1, [false], null]}
)).toBe(true);
expect(deepDiffer(
{a: [{A: {aA: 1, bB: 1}}, 'bar'], c: [1, [false]]},
{a: [{A: {aA: 1, bB: 1}}, ['bar']], c: [1, [false]]}
)).toBe(true);
});
it('should distinguish between proper Array and Object', () => {
expect(deepDiffer(['a', 'b'], {0: 'a', 1: 'b', length: 2})).toBe(true);
expect(deepDiffer(['a', 'b'], {length: 2, 0: 'a', 1: 'b'})).toBe(true);
});
it('should diff same object', () => {
var obj = [1,[2,3]];
expect(deepDiffer(obj, obj)).toBe(false);
});
});
| 40.294118 | 79 | 0.551582 |
6fae7839d8e6c84d0407ca58ab73c6ba07f61d16 | 2,145 | js | JavaScript | test/modules/notifications/lib/template-renderer.js | uk-gov-mirror/defra.water-abstraction-service | 82b74a08825f319896e1e7a2bcd2865c42e4c876 | [
"Unlicense"
] | 4 | 2018-01-29T19:28:25.000Z | 2022-03-23T17:32:53.000Z | test/modules/notifications/lib/template-renderer.js | uk-gov-mirror/defra.water-abstraction-service | 82b74a08825f319896e1e7a2bcd2865c42e4c876 | [
"Unlicense"
] | 1,384 | 2018-02-09T16:33:44.000Z | 2022-03-31T20:20:56.000Z | test/modules/notifications/lib/template-renderer.js | uk-gov-mirror/defra.water-abstraction-service | 82b74a08825f319896e1e7a2bcd2865c42e4c876 | [
"Unlicense"
] | 3 | 2020-07-06T16:28:24.000Z | 2021-04-10T21:31:10.000Z | const Lab = require('@hapi/lab');
const lab = exports.lab = Lab.script();
const { expect } = require('@hapi/code');
const renderTemplates = require('../../../../src/modules/notifications/lib/template-renderer');
lab.experiment('Plurals', () => {
const getContacts = multiLicence => {
const contact = { method: 'post' };
contact.licences = multiLicence ? ['one', 'two'] : ['one'];
return [contact];
};
const licences = { one: {}, two: {} };
const template = '{{ \'Plural\' if pluralLicence }}{{ \'Singular\' if pluralLicence == false }}';
const task = {
config: {
content: { default: template }
}
};
lab.test('When one licence the pluralLicence value is false', async () => {
const rendered = renderTemplates(task, {}, getContacts(false), licences);
expect(rendered[0].output).to.equal('Singular');
});
lab.test('When zero licences the pluralLicence value is true', async () => {
const contacts = getContacts();
contacts[0].licences = [];
const rendered = renderTemplates(task, {}, contacts, {});
expect(rendered[0].output).to.equal('Plural');
});
lab.test('When two licences the pluralLicence value is true', async () => {
const rendered = renderTemplates(task, {}, getContacts(true), licences);
expect(rendered[0].output).to.equal('Plural');
});
});
lab.experiment('isPost', () => {
const getContacts = method => {
const contact = { method };
contact.licences = ['one'];
return [contact];
};
const licences = { one: {} };
const template = '{{ \'Post\' if isPost }}{{ \'Not Post\' if isPost == false }}';
const task = {
config: {
content: { default: template }
}
};
lab.test('Renders specific text for a post contact method', async () => {
const rendered = renderTemplates(task, {}, getContacts('post'), licences);
expect(rendered[0].output).to.equal('Post');
});
lab.test('Renders specific text if not a post contact method', async () => {
const rendered = renderTemplates(task, {}, getContacts('sms'), licences);
expect(rendered[0].output).to.equal('Not Post');
});
});
exports.lab = lab;
| 32.5 | 99 | 0.616783 |
6fae9dc8475f17f0878df3e0eaddaffa64202875 | 1,469 | js | JavaScript | w3school/js/arrayIterator.js | lzyang187/Html5 | abdeb42c91b642fc85a1241c2f01d4051c9e9f90 | [
"Apache-2.0"
] | null | null | null | w3school/js/arrayIterator.js | lzyang187/Html5 | abdeb42c91b642fc85a1241c2f01d4051c9e9f90 | [
"Apache-2.0"
] | null | null | null | w3school/js/arrayIterator.js | lzyang187/Html5 | abdeb42c91b642fc85a1241c2f01d4051c9e9f90 | [
"Apache-2.0"
] | null | null | null | var numbers = [45, 4, 9, 16, 25];
// forEach迭代
numbers.forEach(eachFun);
function eachFun(value, index, array) {
console.log("第" + index + "个元素:" + value);
}
// map,相当于rxjava中的转换
var mapResult = numbers.map(mapFun);
function mapFun(value, index) {
return value * 2;
}
console.log("map后的数组:" + mapResult);
// filter,用条件进行过滤
var filterResult = numbers.filter(filterFun);
function filterFun(value, index) {
return value > 16;
}
console.log("filter后的数组:" + filterResult);
// every() 方法检查所有值是否通过测试。
var allOver16 = numbers.every(everyFun);
function everyFun(value, index) {
return value > 16;
}
console.log("所有元素都大于16吗?" + allOver16);
// some() 方法检查所有值是否通过测试。
var someOver16 = numbers.some(someFun);
function someFun(value, index) {
return value > 16;
}
console.log("某些元素大于16吗?" + someOver16);
// find() 方法返回通过条件函数的第一个数组元素的值。
var result = numbers.find(findFun);
function findFun(value, index) {
return value > 16;
}
console.log("第一个大于16的元素是:" + result);
// findIndex() 方法返回通过条件函数的第一个数组元素的索引。
result = numbers.findIndex(findIndexFun);
function findIndexFun(value, index) {
return value > 16;
}
console.log("第一个大于16的元素索引是:" + result);
// indexOf() 方法在数组中搜索元素值并返回其位置。
console.log("16的位置是:" + numbers.indexOf(16));
// 从3开始查找
console.log("从位置3开始查找4的位置是:" + numbers.indexOf(4, 3));
// lastIndexOf() 方法在数组中搜索元素值并返回最后一个位置。
var fruits = ["Apple", "Apple", "Orange", "Mango"];
console.log("在数组中搜索元素值并返回最后一个位置" + fruits.lastIndexOf("Apple")); | 22.953125 | 64 | 0.699115 |
6fb05a05c9d33021aeb713c04d457ebf47421619 | 1,432 | js | JavaScript | tcgdex/pages/cowsay.js | mklx1319/tcgdex | 0172b9e5164ff34650eec9670abbd346c82c66fd | [
"MIT"
] | 1 | 2019-02-08T06:24:51.000Z | 2019-02-08T06:24:51.000Z | tcgdex/pages/cowsay.js | mklx1319/tcgdex | 0172b9e5164ff34650eec9670abbd346c82c66fd | [
"MIT"
] | 7 | 2020-10-28T03:36:22.000Z | 2021-12-09T01:15:39.000Z | tcgdex/pages/cowsay.js | mklx1319/tcgdex | 0172b9e5164ff34650eec9670abbd346c82c66fd | [
"MIT"
] | 4 | 2019-10-25T03:24:39.000Z | 2020-10-29T04:59:50.000Z | import { useState, useEffect } from "react";
import { say } from "cowsay-browser";
import { produce } from "immer";
const initState = {
text: " "
};
const a = `Prepare for trouble!
And make it double!
To protect the world from devastation!
To unite all peoples within our nation!
To denounce the evils of truth and love!
To extend our reach to the stars above!
Jessie!
James!
Team Rocket blasts off at the speed of light!
Surrender now, or prepare to fight!`;
function CowsayHi() {
const [state, setState] = useState(initState);
useEffect(() => {
const words = a.split(" ");
let { text: newText } = state;
let currentWord = words[0];
setInterval(() => {
if (words.length === 0) return;
let print = currentWord[0];
currentWord = currentWord.substr(1, currentWord.length - 1);
const newState = produce(state, draftState => {
draftState["text"] = (newText += print).trimStart();
});
setState(newState);
if (currentWord.length === 0) {
const newState = produce(state, draftState => {
draftState["text"] = (newText += " ").trimStart();
});
setState(newState);
words.shift();
currentWord = words[0];
}
}, 75);
}, []);
const { text } = state;
return (
<div>
<pre>
{say({
text,
f: "chick"
})}
</pre>
</div>
);
}
export default CowsayHi;
| 23.47541 | 66 | 0.581704 |
6fb093b41772202c9759d75fd549b602184bd775 | 447 | js | JavaScript | src/methods/connection.js | reicek/neataptic | 624f49cd1d12331047e5fdce11ceb6ba7b0e708f | [
"MIT"
] | 3 | 2019-12-06T16:56:58.000Z | 2021-02-26T17:35:12.000Z | src/methods/connection.js | reicek/neataptic | 624f49cd1d12331047e5fdce11ceb6ba7b0e708f | [
"MIT"
] | 4 | 2019-12-20T17:18:13.000Z | 2021-03-03T20:10:27.000Z | src/methods/connection.js | reicek/neataptic | 624f49cd1d12331047e5fdce11ceb6ba7b0e708f | [
"MIT"
] | 1 | 2021-02-26T17:35:20.000Z | 2021-02-26T17:35:20.000Z | /*******************************************************************************
CONNECTION
*******************************************************************************/
// Specifies in what manner two groups are connected
var connection = {
ALL_TO_ALL: {
name: "OUTPUT",
},
ALL_TO_ELSE: {
name: "INPUT",
},
ONE_TO_ONE: {
name: "SELF",
},
};
/* Export */
export default connection;
| 22.35 | 80 | 0.340045 |
6fb140a0b3a44eff3cb05948e22e272013c44283 | 5,612 | js | JavaScript | src/components/orders/OrderForm.js | AnhQ-T/Labs27-ecosoap-teamC-FE | c772612270d62b134be6368cfc0b8b4765c73c5c | [
"MIT"
] | null | null | null | src/components/orders/OrderForm.js | AnhQ-T/Labs27-ecosoap-teamC-FE | c772612270d62b134be6368cfc0b8b4765c73c5c | [
"MIT"
] | 2 | 2020-10-06T20:35:17.000Z | 2020-10-08T20:00:51.000Z | src/components/orders/OrderForm.js | AnhQ-T/Labs27-ecosoap-teamC-FE | c772612270d62b134be6368cfc0b8b4765c73c5c | [
"MIT"
] | 4 | 2020-10-22T15:41:23.000Z | 2020-10-29T18:14:10.000Z | import React, { useState, useEffect } from 'react';
import { Form, Input, Button, InputNumber } from 'antd';
import axios from 'axios';
import { useHistory } from 'react-router-dom';
import 'antd/dist/antd.css';
const OrderForm = props => {
const [form] = Form.useForm();
const formItemLayout = {
labelCol: {
span: 8,
},
wrapperCol: {
span: 14,
},
};
const buttonItemLayout = {
wrapperCol: {
span: 14,
offset: 5,
},
};
const [, forceUpdate] = useState();
const { push } = useHistory();
useEffect(() => {
forceUpdate({});
}, []);
const onFinish = values => {
var buyerId = localStorage.getItem('buyer_id');
var form_values = {
buyerId: buyerId,
organizationName: values.organizationName,
organizationWebsite: values.organizationWebsite,
contactName: values.contactName,
soapBarNum: values.soapBarNum,
contactPhone: values.contactPhone,
contactEmail: values.contactEmail,
address: values.address,
country: values.country,
beneficiariesNum: values.beneficiariesNum,
hygieneSituation: values.hygieneSituation,
hygieneInitiative: values.hygieneInitiative,
comments: values.comments,
};
axios
.post(
'https://labs27-ecosoap-teamc-api.herokuapp.com/orders/',
form_values
)
.then(res => {
console.log(res.data);
form.setFieldsValue(values);
})
.catch(err => console.log(`Order form error: ${err}`));
push({
pathname: '/confirmation',
state: { values: form.getFieldsValue() },
});
};
return (
<Form
{...formItemLayout}
form={form}
initialValues={{
organizationWebsite: '',
address: '',
hygieneSituation: '',
comments: '',
}}
onFinish={onFinish}
className="orderFormWrapper"
>
<Form.Item
name="organizationName"
label="Organization Name"
rules={[
{
required: true,
message: 'Please input organization name',
},
]}
className="formLabel"
>
<Input placeholder="Organization Name" className="orderInput" />
</Form.Item>
<Form.Item name="organizationWebsite" label="Organization Website">
<Input placeholder="Organization Website" className="orderInput" />
</Form.Item>
<Form.Item
name="contactName"
label="Contact Name"
rules={[
{
required: true,
message: 'Please input contact name',
},
]}
>
<Input placeholder="Contact Name" className="orderInput" />
</Form.Item>
<Form.Item
name="soapBarNum"
label="Number of Soap Bars Requested"
rules={[
{
required: true,
message: 'Please input number of soap bars requested',
},
]}
>
<InputNumber
placeholder="Number of Soap Bars Requested"
min={1}
className="orderInput"
/>
</Form.Item>
<Form.Item
name="contactPhone"
label="Contact Phone Number"
rules={[
{
required: true,
message: 'Please input phone number',
},
]}
>
<Input placeholder="Contact Phone Number" className="orderInput" />
</Form.Item>
<Form.Item
name="contactEmail"
label="Contact Email Address"
rules={[
{
type: 'email',
message: 'The input is not a valid email',
},
{
required: true,
message: 'Please input email address',
},
]}
>
<Input placeholder="Contact Email Address" className="orderInput" />
</Form.Item>
<Form.Item name="address" label="Address">
<Input placeholder="Address" className="orderInput" />
</Form.Item>
<Form.Item
name="country"
label="Country"
rules={[
{
required: true,
message: 'Please input country',
},
]}
>
<Input placeholder="Country" className="orderInput" />
</Form.Item>
<Form.Item
name="beneficiariesNum"
label="Number of Beneficiaries"
rules={[
{
required: true,
message: 'Please input number of beneficiaries',
},
]}
>
<InputNumber
placeholder="Number of Beneficiaries"
min={1}
className="orderInput"
/>
</Form.Item>
<Form.Item name="hygieneSituation" label="Hygiene Situation">
<Input
placeholder="Description of Hygiene Situation in Community"
className="orderInput"
/>
</Form.Item>
<Form.Item
name="hygieneInitiative"
label="Hygiene Initiative"
rules={[
{
required: true,
message: 'Please input description of hygiene initiative',
},
]}
>
<Input
placeholder="Description of Hygiene Initiative"
className="orderInput"
/>
</Form.Item>
<Form.Item name="comments" label="Comments">
<Input placeholder="Comments" className="orderInput" />
</Form.Item>
<Form.Item {...buttonItemLayout}>
<Button type="primary" htmlType="submit" className="orderBtn">
Submit Order
</Button>
</Form.Item>
</Form>
);
};
export default OrderForm;
| 25.861751 | 76 | 0.539914 |
6fb16f8a4ece384344a1120d88e1c2068b2e3d1d | 1,194 | js | JavaScript | build/rollup-common-config.js | aJean/vetur | 11ea186c343fd3bdcc30a82378a402388477c9fb | [
"MIT"
] | 5,149 | 2017-06-28T06:53:37.000Z | 2022-03-31T16:56:20.000Z | build/rollup-common-config.js | aJean/vetur | 11ea186c343fd3bdcc30a82378a402388477c9fb | [
"MIT"
] | 2,511 | 2017-06-28T06:52:18.000Z | 2022-03-31T22:04:18.000Z | build/rollup-common-config.js | aJean/vetur | 11ea186c343fd3bdcc30a82378a402388477c9fb | [
"MIT"
] | 739 | 2017-06-28T07:11:51.000Z | 2022-03-31T22:39:34.000Z | const path = require('path');
const fs = require('fs');
const json = require('@rollup/plugin-json');
const commonjs = require('@rollup/plugin-commonjs');
const typescript = require('rollup-plugin-typescript2');
const resolve = require('@rollup/plugin-node-resolve').default;
const { terser } = require('rollup-plugin-terser');
const getRootPath = root => relative => path.resolve(__dirname, '../', root, relative);
const clearDist = dist => {
if (fs.existsSync(dist)) {
fs.rmdirSync(dist, { recursive: true });
}
};
const onwarn = (warning, warn) => {
// typescript tslib
if (warning.code === 'THIS_IS_UNDEFINED') return;
warn(warning);
};
const external = [
// node built-in
'path',
'fs',
'child_process',
'os',
'net',
'util',
'crypto',
'url',
'assert',
'inspector',
'module',
'events',
'tty',
'buffer',
'stream',
'string_decoder',
'perf_hooks',
// vscode
'vscode'
];
const createPlugins = tsconfig => [
json(),
resolve(),
commonjs(),
typescript({ tsconfig, tsconfigOverride: { compilerOptions: { module: 'esnext' } } }),
terser()
];
module.exports = {
getRootPath,
clearDist,
onwarn,
external,
createPlugins
};
| 19.258065 | 88 | 0.634003 |
6fb1e210575ceefe276505a4d0ff0e648e74bb56 | 2,081 | js | JavaScript | d7/d2a/class_ext_1_1_net_1_1_sparkline_base.js | extnet/docs5.ext.net | e99e4d3894640fb1f66882443fe7348fc3181f55 | [
"Apache-2.0"
] | null | null | null | d7/d2a/class_ext_1_1_net_1_1_sparkline_base.js | extnet/docs5.ext.net | e99e4d3894640fb1f66882443fe7348fc3181f55 | [
"Apache-2.0"
] | null | null | null | d7/d2a/class_ext_1_1_net_1_1_sparkline_base.js | extnet/docs5.ext.net | e99e4d3894640fb1f66882443fe7348fc3181f55 | [
"Apache-2.0"
] | null | null | null | var class_ext_1_1_net_1_1_sparkline_base =
[
[ "Builder", "d7/d92/class_ext_1_1_net_1_1_sparkline_base_1_1_builder.html", "d7/d92/class_ext_1_1_net_1_1_sparkline_base_1_1_builder" ],
[ "Config", "d4/dea/class_ext_1_1_net_1_1_sparkline_base_1_1_config.html", "d4/dea/class_ext_1_1_net_1_1_sparkline_base_1_1_config" ],
[ "ConfigOptions", "d7/d2a/class_ext_1_1_net_1_1_sparkline_base.html#ac303e3302c3452a8ba156f9514b9d0b8", null ],
[ "DefaultPixelsPerValue", "d7/d2a/class_ext_1_1_net_1_1_sparkline_base.html#a105087fc3b35a00e876395642b873a58", null ],
[ "DirectEvents", "d7/d2a/class_ext_1_1_net_1_1_sparkline_base.html#a52e5776d289573631ec167a7b615f58b", null ],
[ "DisableInteraction", "d7/d2a/class_ext_1_1_net_1_1_sparkline_base.html#a2bf111143a26fe0a56e85009b7c31cb7", null ],
[ "DisableTooltips", "d7/d2a/class_ext_1_1_net_1_1_sparkline_base.html#a7a778e6b0f9c714818e61f5b8e6be2b2", null ],
[ "EnableHighlight", "d7/d2a/class_ext_1_1_net_1_1_sparkline_base.html#aad2f2058e76abc0d9023c1aaf84cd549", null ],
[ "HighlightColor", "d7/d2a/class_ext_1_1_net_1_1_sparkline_base.html#a2e5f6b5554f016c9c655afc53aaf5234", null ],
[ "HighlightLighten", "d7/d2a/class_ext_1_1_net_1_1_sparkline_base.html#acd6b8ee5a19ac9c2dd3293f43db0d15e", null ],
[ "LineColor", "d7/d2a/class_ext_1_1_net_1_1_sparkline_base.html#a069d3e5157622bf7d46c13b52a063fef", null ],
[ "Listeners", "d7/d2a/class_ext_1_1_net_1_1_sparkline_base.html#a228d2e95820457b0891fde1727f45bb9", null ],
[ "TipTpl", "d7/d2a/class_ext_1_1_net_1_1_sparkline_base.html#a1b886b5357567e1ac15f48ed496774a6", null ],
[ "TipTplString", "d7/d2a/class_ext_1_1_net_1_1_sparkline_base.html#a3e807c11eb1c665ddee7de594d073800", null ],
[ "TooltipPrefix", "d7/d2a/class_ext_1_1_net_1_1_sparkline_base.html#ae07706e6ce68c7db544acb846a0e68d6", null ],
[ "TooltipSkipNull", "d7/d2a/class_ext_1_1_net_1_1_sparkline_base.html#ac908c660c3d97d63a2e7e35439d59714", null ],
[ "Values", "d7/d2a/class_ext_1_1_net_1_1_sparkline_base.html#ad2adc3a2a8e3d54651493e190d58d3a9", null ]
]; | 104.05 | 141 | 0.814032 |
6fb1e8ee4b32ddc728e7327b2488806a4c12cad3 | 293 | js | JavaScript | backend/routes/routes.js | klxu03/global-courses | 043492bc771800e35411b0d1fa2d1ab2a4e8adee | [
"MIT"
] | null | null | null | backend/routes/routes.js | klxu03/global-courses | 043492bc771800e35411b0d1fa2d1ab2a4e8adee | [
"MIT"
] | null | null | null | backend/routes/routes.js | klxu03/global-courses | 043492bc771800e35411b0d1fa2d1ab2a4e8adee | [
"MIT"
] | null | null | null | const eventRoutes = require('./events');
const courseRoutes = require('./course');
const appRouter = (app, fs) => {
app.get('/', (req, res) => {
res.send('welcome to the developmental api-server');
});
eventRoutes(app, fs);
courseRoutes(app, fs);
};
module.exports = appRouter;
| 20.928571 | 56 | 0.634812 |
6fb22b405eba3fa8c7436372be51b71af8ed0006 | 3,482 | js | JavaScript | ddp-redux/src/DDPError.js | apendua/ddp | 412b4e38de09d398ad7bcc964f920f6fcf907396 | [
"MIT"
] | 7 | 2017-12-20T11:40:11.000Z | 2017-12-29T16:06:20.000Z | ddp-redux/src/DDPError.js | apendua/ddp-redux | 412b4e38de09d398ad7bcc964f920f6fcf907396 | [
"MIT"
] | 14 | 2017-12-21T19:40:00.000Z | 2017-12-21T20:31:12.000Z | ddp-redux/src/DDPError.js | apendua/ddp | 412b4e38de09d398ad7bcc964f920f6fcf907396 | [
"MIT"
] | 1 | 2018-07-19T09:35:31.000Z | 2018-07-19T09:35:31.000Z | // Based on Meteor's EJSON implementation: https://github.com/meteor/meteor
//
// packages/meteor/errors.js
// 2017-08-10
//
// The MIT License (MIT)
//
// Copyright (c) 2011 - 2017 Meteor Development Group, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
class DDPError extends Error {
constructor(error, reason, details) {
super();
// Ensure we get a proper stack trace in most Javascript environments
if (Error.captureStackTrace) {
// V8 environments (Chrome and Node.js)
Error.captureStackTrace(this, DDPError);
} else {
// Borrow the .stack property of a native Error object.
this.stack = new Error().stack;
}
// Safari magically works.
// Newer versions of DDP use this property to signify that an error
// can be sent back and reconstructed on the calling client.
this.isClientSafe = true;
// String code uniquely identifying this kind of error.
this.error = error;
// Optional: A short human-readable summary of the error. Not
// intended to be shown to end users, just developers. ("Not Found",
// "Internal Server Error")
this.reason = reason;
// Optional: Additional information about the error, say for
// debugging. It might be a (textual) stack trace if the server is
// willing to provide one. The corresponding thing in HTTP would be
// the body of a 404 or 500 response. (The difference is that we
// never expect this to be shown to end users, only developers, so
// it doesn't need to be pretty.)
this.details = details;
// This is what gets displayed at the top of a stack trace. Current
// format is "[404]" (if no reason is set) or "File not found [404]"
if (this.reason) {
this.message = `${this.reason} [${this.error}]`;
} else {
this.message = `[${this.error}]`;
}
this.errorType = 'Meteor.Error';
}
// Meteor.Error is basically data and is sent over DDP, so you should be able to
// properly EJSON-clone it. This is especially important because if a
// Meteor.Error is thrown through a Future, the error, reason, and details
// properties become non-enumerable so a standard Object clone won't preserve
// them and they will be lost from DDP.
clone() {
return new DDPError(this.error, this.reason, this.details);
}
}
DDPError.ERROR_CONNECTION = 'ErrorConnection';
DDPError.ERROR_BAD_MESSAGE = 'ErrorBadMessage';
export default DDPError;
| 40.022989 | 82 | 0.706491 |
6fb372fba018cf7e1d09a150de088adc52cedb10 | 141 | js | JavaScript | src/actions/index.js | hkpritiranjan/redux-saga-app | 8711e2dcbfd5b73a4bb630f6b6d948788a4bca70 | [
"MIT"
] | null | null | null | src/actions/index.js | hkpritiranjan/redux-saga-app | 8711e2dcbfd5b73a4bb630f6b6d948788a4bca70 | [
"MIT"
] | 5 | 2020-09-07T06:54:01.000Z | 2022-02-26T17:32:57.000Z | src/actions/index.js | hkpritiranjan/redux-saga-app | 8711e2dcbfd5b73a4bb630f6b6d948788a4bca70 | [
"MIT"
] | null | null | null | export const getNews = () => ({
type: 'GET_NEWS',
});
export const setText = (text) => ({
type: 'SET_TEXT',
text:text
}); | 17.625 | 36 | 0.510638 |
6fb3d265d12b4dde0591b58e397bbc188df43fe2 | 1,184 | js | JavaScript | public/_nuxt/pages_index.aeb3ab596d1fa0b47bab.js | dzkjz/laravel-nuxt-nuxt-js-lesson | 65a3c3cf619c8156ef78325524dcf1e529af1506 | [
"MIT"
] | null | null | null | public/_nuxt/pages_index.aeb3ab596d1fa0b47bab.js | dzkjz/laravel-nuxt-nuxt-js-lesson | 65a3c3cf619c8156ef78325524dcf1e529af1506 | [
"MIT"
] | 2 | 2021-02-02T18:39:15.000Z | 2021-03-10T17:56:07.000Z | public/_nuxt/pages_index.aeb3ab596d1fa0b47bab.js | dzkjz/laravel-nuxt-nuxt-js-lesson | 65a3c3cf619c8156ef78325524dcf1e529af1506 | [
"MIT"
] | null | null | null | webpackJsonp([0],{"2oH2":function(e,t,n){"use strict";var r=n("Xxa5"),a=n.n(r),s=n("exGp"),i=n.n(s);t.a={name:"index",data:function(){return{name:"world"}},asyncData:function(){var e=i()(a.a.mark(function e(t){var n,r=t.app;return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.$axios.$get("api/me");case 2:return n=e.sent,e.abrupt("return",{user:n});case 4:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()}},PLYA:function(e,t,n){"use strict";var r=function(){var e=this.$createElement;return(this._self._c||e)("h1",[this._v("Hello "+this._s(this.user.name)+"!")])};r._withStripped=!0;var a={render:r,staticRenderFns:[]};t.a=a},UORF:function(e,t,n){(e.exports=n("FZ+f")(!1)).push([e.i,"",""])},dQia:function(e,t,n){var r=n("UORF");"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);n("rjj0")("5db1cc0a",r,!1,{sourceMap:!1})},zmsi:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("2oH2"),a=n("PLYA"),s=!1;var i=function(e){s||n("dQia")},u=n("VU/8")(r.a,a.a,!1,i,"data-v-98d2541a",null);u.options.__file="resources/nuxt/pages/index.vue",t.default=u.exports}}); | 1,184 | 1,184 | 0.652027 |
6fb3db6ccde0a238ea4a93c52736508fe0374521 | 446 | js | JavaScript | resources/js/shared/new-orders.js | shekenz/ced-backend | ba955845b8a11a55c7dc2b832dd374f759041af1 | [
"MIT"
] | null | null | null | resources/js/shared/new-orders.js | shekenz/ced-backend | ba955845b8a11a55c7dc2b832dd374f759041af1 | [
"MIT"
] | null | null | null | resources/js/shared/new-orders.js | shekenz/ced-backend | ba955845b8a11a55c7dc2b832dd374f759041af1 | [
"MIT"
] | null | null | null |
let orderUnread = document.getElementById('orderUnread');
if(orderUnread) {
window.fetch('/api/orders/unread/count', {
method: 'post',
headers: {
'accept': 'application/json',
},
}).then(response => {
return response.json();
}).then(jsonResponse => {
if(jsonResponse.count && jsonResponse.count > 0) {
orderUnread.classList.remove('hidden');
orderUnread.appendChild(document.createTextNode(jsonResponse.count));
}
});
} | 24.777778 | 72 | 0.683857 |
6fb4fa415b5fb68ceb637b5eeec1f3ecb390588c | 107 | js | JavaScript | config/proxyEmail.js | CaliStyle/proxy-engine-example | 5394244c616719e2e2f41712514f0602985a5aad | [
"MIT"
] | null | null | null | config/proxyEmail.js | CaliStyle/proxy-engine-example | 5394244c616719e2e2f41712514f0602985a5aad | [
"MIT"
] | null | null | null | config/proxyEmail.js | CaliStyle/proxy-engine-example | 5394244c616719e2e2f41712514f0602985a5aad | [
"MIT"
] | null | null | null | /**
* Proxy Email Configuration
* (app.config.proxyEmail)
* @see {@link http://
*/
module.exports = {}
| 15.285714 | 28 | 0.616822 |
6fb51183c26d08d8af1b7a1ff75cd478dd21fec5 | 4,647 | js | JavaScript | test/unit/specs/PickerDay/highlightedDates.spec.js | mamitech/vue-datepicker | fe856d47a6a247b1419f1d03d7f1448b5658e3e0 | [
"Apache-2.0"
] | null | null | null | test/unit/specs/PickerDay/highlightedDates.spec.js | mamitech/vue-datepicker | fe856d47a6a247b1419f1d03d7f1448b5658e3e0 | [
"Apache-2.0"
] | null | null | null | test/unit/specs/PickerDay/highlightedDates.spec.js | mamitech/vue-datepicker | fe856d47a6a247b1419f1d03d7f1448b5658e3e0 | [
"Apache-2.0"
] | null | null | null | import { shallowMount } from '@vue/test-utils'
import PickerDay from '~/components/PickerDay.vue'
import { en } from '~/locale'
describe('PickerDay highlight date', () => {
let wrapper
beforeEach(() => {
wrapper = shallowMount(PickerDay, {
propsData: {
translation: en,
pageDate: new Date(2016, 9, 1),
highlighted: {
to: new Date(2016, 11, 8),
from: new Date(2016, 11, 4),
},
disabledDates: {
dates: [new Date(2016, 11, 5)],
},
},
})
})
afterEach(() => {
wrapper.destroy()
})
it('should detect a highlighted date', () => {
expect(wrapper.vm.isHighlightedDate(new Date(2006, 9, 2))).toEqual(false)
expect(wrapper.vm.isHighlightedDate(new Date(2026, 9, 2))).toEqual(false)
})
it('should not highlight a disabled date', () => {
expect(wrapper.vm.isHighlightedDate(new Date(2016, 11, 5))).toEqual(false)
})
it('should highlight a disabled date when explicitly configured to', () => {
wrapper.setProps({
highlighted: {
to: new Date(2016, 11, 8),
from: new Date(2016, 11, 4),
includeDisabled: true,
},
})
expect(wrapper.vm.isHighlightedDate(new Date(2016, 11, 5))).toEqual(true)
})
it('should highlight a date before the to property', () => {
expect(wrapper.vm.isHighlightedDate(new Date(2016, 11, 7))).toEqual(true)
})
it('should not highlight a date after the to property', () => {
expect(wrapper.vm.isHighlightedDate(new Date(2016, 11, 9))).toEqual(false)
})
it('should highlight a date after the from property', () => {
expect(wrapper.vm.isHighlightedDate(new Date(2016, 11, 6))).toEqual(true)
})
it('should not highlight a date before the from property', () => {
expect(wrapper.vm.isHighlightedDate(new Date(2016, 11, 3))).toEqual(false)
})
it('can accept an array of highlighted dates', () => {
wrapper.setProps({
highlighted: {
dates: [
new Date(2016, 9, 2),
new Date(2016, 9, 9),
new Date(2016, 9, 16),
],
},
})
expect(wrapper.vm.isHighlightedDate(new Date(2016, 9, 2))).toEqual(true)
expect(wrapper.vm.isHighlightedDate(new Date(2016, 9, 3))).toEqual(false)
})
it('can accept an array of highlighted days of the week', () => {
wrapper.setProps({
highlighted: {
days: [6, 0],
},
})
expect(wrapper.vm.isHighlightedDate(new Date(2016, 9, 2))).toEqual(true)
expect(wrapper.vm.isHighlightedDate(new Date(2016, 9, 3))).toEqual(false)
})
it('can accept an array of highlighted days of the month', () => {
wrapper.setProps({
highlighted: {
daysOfMonth: [1, 10, 31],
},
})
expect(wrapper.vm.isHighlightedDate(new Date(2016, 9, 1))).toEqual(true)
expect(wrapper.vm.isHighlightedDate(new Date(2016, 10, 10))).toEqual(true)
expect(wrapper.vm.isHighlightedDate(new Date(2016, 11, 31))).toEqual(true)
expect(wrapper.vm.isHighlightedDate(new Date(2017, 8, 10))).toEqual(true)
expect(wrapper.vm.isHighlightedDate(new Date(2016, 8, 7))).toEqual(false)
expect(wrapper.vm.isHighlightedDate(new Date(2016, 7, 20))).toEqual(false)
})
it('can accept a customPredictor to check if the date is highlighted', () => {
wrapper.setProps({
highlighted: {
customPredictor(date) {
if (date.getDate() % 5 === 0) {
return true
}
return false
},
},
})
expect(wrapper.vm.isHighlightedDate(new Date(2016, 8, 30))).toEqual(true)
expect(wrapper.vm.isHighlightedDate(new Date(2016, 9, 28))).toEqual(false)
expect(wrapper.vm.isHighlightedDate(new Date(2016, 10, 20))).toEqual(true)
expect(wrapper.vm.isHighlightedDate(new Date(2016, 9, 11))).toEqual(false)
})
it('should detect the first date of the highlighted dates', () => {
expect(wrapper.vm.isHighlightStart(new Date(2016, 11, 4))).toEqual(true)
expect(wrapper.vm.isHighlightStart(new Date(2016, 11, 3))).toEqual(false)
expect(wrapper.vm.isHighlightStart(new Date(2016, 11, 5))).toEqual(false)
})
it('should detect the last date of the highlighted dates', () => {
expect(wrapper.vm.isHighlightEnd(new Date(2016, 11, 8))).toEqual(true)
expect(wrapper.vm.isHighlightEnd(new Date(2016, 11, 6))).toEqual(false)
expect(wrapper.vm.isHighlightEnd(new Date(2016, 11, 7))).toEqual(false)
})
it('should close without warning when its undefined', () => {
wrapper.setProps({
highlighted: undefined,
})
expect(wrapper.vm.isHighlightedDate(new Date(2016, 8, 29))).toEqual(false)
})
})
| 33.919708 | 80 | 0.627071 |
6fb522562ef9b5dc444797a2b0f61ed67b164f7a | 1,515 | js | JavaScript | src/components/App/IntroContent/SE/index.js | ReiiYuki/NAIST-INTERN-SITE-2017 | dde5a3fae41bc2ae08fcfa3d1f77a0d6919cf37e | [
"MIT"
] | null | null | null | src/components/App/IntroContent/SE/index.js | ReiiYuki/NAIST-INTERN-SITE-2017 | dde5a3fae41bc2ae08fcfa3d1f77a0d6919cf37e | [
"MIT"
] | null | null | null | src/components/App/IntroContent/SE/index.js | ReiiYuki/NAIST-INTERN-SITE-2017 | dde5a3fae41bc2ae08fcfa3d1f77a0d6919cf37e | [
"MIT"
] | null | null | null | import React from 'react'
import img from './img.JPG'
export default class SE extends React.Component {
render(){
const whiteBg = {
backgroundColor: 'white',
marginBottom: '0px'
}
return (
<div className="jumbotron jumbotron-fluid" style={whiteBg} id="lab-se">
<div className="container">
<div className="row">
<div className="col">
<img src={img} className="img-fluid" />
</div>
<div className="col col-md-9">
<div className="row">
<div className="col">
<h1>Software Engineering (SE)</h1>
</div>
</div>
<div className="row">
<div className="col">
<p>
ผมชื่อ ณัฐพล เลิศวิทยาไตร (วิน) CPE ได้ฝึกงานที่ NAIST ระยะเวลา 2 เดือน 10 วัน ได้อยู่ที่แล็ป Software Engineering (SE) โดยมี Prof. Kenichi Matsumoto เป็นหัวหน้าแล็ป และมี Prof. อีก 4 ท่าน โดยแล็ปนี้เรียกได้ว่าเป็นแล็ปที่ทำงานจริงจัง แอบกดดันนิดๆ อาจารย์และคนในแล็ปมีความเป็นกันเอง สามารถปรึกษาเรื่องงานได้ตลอด สำหรับงานที่แล็ปนี้ทำจะเป็นในด้านของการวิจัยเกี่ยวกับซอร์ฟแวร์เป็นหลัก
</p>
</div>
</div>
<div className="row">
<div className="col">
<p>
สำหรับคนที่สนใจที่จะฝึกงานที่ญี่ปุ่น NAIST ก็เป็นทางเลือกที่ดีอย่างหนึ่ง ซึ่งจะได้รับประสบการณ์กลับมาหลายๆอย่าง และ ยังได้สัมผัสความเป็นอยู่ ถ้าเกิดใครที่มีแผนที่จะเรียนต่อเมืองนอก เพราะจะทำให้ช่วยตัดสินใจเรื่องอนาคตได้ดียิ่งขึ้น
</p>
</div>
</div>
</div>
</div>
</div>
</div>
)
}
}
| 31.5625 | 391 | 0.585479 |
6fb54cb606477a90d95f32c6141b35d1b746f1fd | 4,182 | js | JavaScript | js/noms/src/ordered-sequence-diff.js | bowlofstew/noms | f22646b8c2ca91827c417b158cb8df74ad621758 | [
"Apache-2.0"
] | null | null | null | js/noms/src/ordered-sequence-diff.js | bowlofstew/noms | f22646b8c2ca91827c417b158cb8df74ad621758 | [
"Apache-2.0"
] | null | null | null | js/noms/src/ordered-sequence-diff.js | bowlofstew/noms | f22646b8c2ca91827c417b158cb8df74ad621758 | [
"Apache-2.0"
] | null | null | null | // @flow
// Copyright 2016 Attic Labs, Inc. All rights reserved.
// Licensed under the Apache License, version 2.0:
// http://www.apache.org/licenses/LICENSE-2.0
import {invariant} from './assert.js';
import {OrderedSequence, OrderedSequenceCursor} from './ordered-sequence.js';
import {SequenceCursor} from './sequence.js';
import type Value from './value.js'; // eslint-disable-line no-unused-vars
// TODO: Expose an iteration API.
/**
* Returns a 3-tuple [added, removed, modified] sorted keys.
*/
export default async function diff<K: Value, T>(
last: OrderedSequence<K, T>, current: OrderedSequence<K, T>): Promise<[K[], K[], K[]]> {
// TODO: Construct the cursor at exactly the right position. There is no point reading in the
// first chunk of each sequence if we're not going to use them. This needs for chunks (or at
// least meta chunks) to encode their height.
// See https://github.com/attic-labs/noms/issues/1219.
const [lastCur, currentCur] = await Promise.all([last.newCursorAt(), current.newCursorAt()]);
const [added, removed, modified] = [[], [], []];
while (lastCur.valid && currentCur.valid) {
await fastForward(lastCur, currentCur);
while (lastCur.valid && currentCur.valid &&
!lastCur.sequence.getCompareFn(currentCur.sequence)(lastCur.idx, currentCur.idx)) {
const lastKey = lastCur.getCurrentKey(), currentKey = currentCur.getCurrentKey();
const compare = currentKey.compare(lastKey);
if (compare < 0) {
added.push(currentKey.value());
await currentCur.advance();
} else if (compare > 0) {
removed.push(lastKey.value());
await lastCur.advance();
} else {
modified.push(currentKey.value());
await Promise.all([lastCur.advance(), currentCur.advance()]);
}
}
}
for (; lastCur.valid; await lastCur.advance()) {
removed.push(lastCur.getCurrentKey().value());
}
for (; currentCur.valid; await currentCur.advance()) {
added.push(currentCur.getCurrentKey().value());
}
return [added, removed, modified];
}
/**
* Advances |a| and |b| past their common sequence of equal values.
*/
export function fastForward(a: OrderedSequenceCursor<any, any>, b: OrderedSequenceCursor<any, any>)
: Promise<void> {
return a.valid && b.valid ? doFastForward(true, a, b).then() : Promise.resolve();
}
/*
* Returns an array matching |a| and |b| respectively to whether that cursor has more values.
*/
async function doFastForward(allowPastEnd: boolean, a: OrderedSequenceCursor<any, any>,
b: OrderedSequenceCursor<any, any>): Promise<[boolean, boolean]> {
invariant(a.valid && b.valid);
let aHasMore = true, bHasMore = true;
while (aHasMore && bHasMore && isCurrentEqual(a, b)) {
const aParent = a.parent, bParent = b.parent;
if (aParent && bParent && isCurrentEqual(aParent, bParent)) {
// Key optimisation: if the sequences have common parents, then entire chunks can be
// fast-forwarded without reading unnecessary data.
invariant(aParent instanceof OrderedSequenceCursor);
invariant(bParent instanceof OrderedSequenceCursor);
[aHasMore, bHasMore] = await doFastForward(false, aParent, bParent);
const syncWithIdx = (cur, hasMore) => cur.sync().then(() => {
if (hasMore) {
cur.idx = 0;
} else if (allowPastEnd) {
cur.idx = cur.length;
} else {
cur.idx = cur.length - 1;
}
});
await Promise.all([syncWithIdx(a, aHasMore), syncWithIdx(b, bHasMore)]);
} else {
if (a.canAdvanceLocal() && b.canAdvanceLocal()) {
// Performance optimisation: allowing non-async resolution of leaf elements
aHasMore = a.advanceLocal(allowPastEnd);
bHasMore = b.advanceLocal(allowPastEnd);
} else {
await Promise.all([a.advance(allowPastEnd), b.advance(allowPastEnd)]).then(([am, bm]) => {
aHasMore = am;
bHasMore = bm;
});
}
}
}
return [aHasMore, bHasMore];
}
function isCurrentEqual(a: SequenceCursor<any, any>, b: SequenceCursor<any, any>): boolean {
return a.sequence.getCompareFn(b.sequence)(a.idx, b.idx);
}
| 37.339286 | 99 | 0.658537 |
6fb595b9fdb0e2291854aea090272be65a444d22 | 368 | js | JavaScript | tooling/cra-template/template/src/test-utils.js | chakra-xui/chakra-xui | be7a07f06565fb0d334d5f4e447a001289759450 | [
"MIT"
] | 1 | 2021-06-04T04:29:59.000Z | 2021-06-04T04:29:59.000Z | tooling/cra-template/template/src/test-utils.js | chakra-xui/chakra-xui | be7a07f06565fb0d334d5f4e447a001289759450 | [
"MIT"
] | 80 | 2020-12-30T11:33:28.000Z | 2022-03-28T00:56:50.000Z | tooling/cra-template/template/src/test-utils.js | chakra-xui/chakra-xui | be7a07f06565fb0d334d5f4e447a001289759450 | [
"MIT"
] | 1 | 2021-06-04T04:30:04.000Z | 2021-06-04T04:30:04.000Z | import React from 'react';
import { render } from '@testing-library/react';
import { ChakraProvider, theme } from '@chakra-xui/react';
const AllProviders = ({ children }) => (
<ChakraProvider theme={theme}>{children}</ChakraProvider>
);
const customRender = (ui, options) =>
render(ui, { wrapper: AllProviders, ...options });
export { customRender as render };
| 28.307692 | 59 | 0.692935 |
6fb67701a38f5004953697a2205a60a2965d896e | 16,033 | js | JavaScript | public/js/91.4289d4be811ed754efa6.js | Ecodenl/econobis | 71a2837eac26642b23d6e02a54e78ab5b771f9cf | [
"CECILL-B"
] | 4 | 2018-10-16T19:45:01.000Z | 2021-03-23T11:53:38.000Z | public/js/91.4289d4be811ed754efa6.js | Ecodenl/econobis | 71a2837eac26642b23d6e02a54e78ab5b771f9cf | [
"CECILL-B"
] | 11 | 2020-03-19T08:17:46.000Z | 2021-12-24T09:10:24.000Z | public/js/91.4289d4be811ed754efa6.js | Ecodenl/econobis | 71a2837eac26642b23d6e02a54e78ab5b771f9cf | [
"CECILL-B"
] | 3 | 2020-02-28T10:31:00.000Z | 2020-12-09T13:30:59.000Z | (window.webpackJsonp=window.webpackJsonp||[]).push([[91],{1563:function(e,a,t){"use strict";t.r(a);var n=t(24),r=t.n(n),s=t(25),o=t.n(s),l=t(22),c=t.n(l),i=t(26),m=t.n(i),u=t(27),d=t.n(u),p=t(16),f=t.n(p),g=t(6),v=t.n(g),h=t(0),b=t.n(h),y=(t(7),t(706)),N=t.n(y),E=(t(199),t(4)),C=t(699),D=t(700),O=t(701);function A(e){var a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,n=f()(e);if(a){var r=f()(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return d()(this,t)}}var I=function(e){m()(t,e);var a=A(t);function t(e){var n;return r()(this,t),(n=a.call(this,e)).state={showDelete:!1},n}return o()(t,[{key:"render",value:function(){return b.a.createElement("div",{className:"row"},b.a.createElement("div",{className:"col-sm-12"},b.a.createElement(C.a,null,b.a.createElement(D.a,{className:"panel-small"},b.a.createElement("div",{className:"col-md-4"},b.a.createElement("div",{className:"btn-group btn-group-flex margin-small",role:"group"},b.a.createElement(O.a,{iconName:"glyphicon-arrow-left",onClickAction:E.e.goBack}))),b.a.createElement("div",{className:"col-md-4"},b.a.createElement("h3",{className:"text-center table-title"},"Nieuwe campagne")),b.a.createElement("div",{className:"col-md-4"})))))}}]),t}(h.Component),S=t(32),q=t(705),w=t(708),k=t(702),M=t(712),R=t(732),z=t(703),x=Object(S.b)((function(e){return{status:e.systemData.campaignStatuses,types:e.systemData.campaignTypes,measureCategories:e.systemData.measureCategories}}))((function(e){var a=e.campaign,t=a.name,n=a.description,r=a.startDate,s=a.endDate,o=a.statusId,l=a.measureCategoryIds,c=a.typeId;return b.a.createElement("form",{className:"form-horizontal col-md-12",onSubmit:e.handleSubmit},b.a.createElement("div",{className:"row"},b.a.createElement(z.a,{label:"Naam",size:"col-sm-6",name:"name",value:t,onChangeAction:e.handleInputChange,required:"required",error:e.errors.name})),b.a.createElement("div",{className:"row"},b.a.createElement("div",{className:"form-group col-sm-12"},b.a.createElement("div",{className:"row"},b.a.createElement("div",{className:"col-sm-3"},b.a.createElement("label",{htmlFor:"description",className:"col-sm-12"},"Beschrijving")),b.a.createElement("div",{className:"col-sm-8"},b.a.createElement("textarea",{name:"description",value:n,onChange:e.handleInputChange,className:"form-control input-sm"}))))),b.a.createElement("div",{className:"row"},b.a.createElement(w.a,{label:"Begindatum",size:"col-sm-6",name:"startDate",value:r,onChangeAction:e.handleInputChangeDate}),b.a.createElement(w.a,{label:"Einddatum",size:"col-sm-6",name:"endDate",value:s,onChangeAction:e.handleInputChangeDate})),b.a.createElement("div",{className:"row"},b.a.createElement(q.a,{label:"Status",size:"col-sm-6",name:"statusId",options:e.status,value:o,onChangeAction:e.handleInputChange}),b.a.createElement(R.a,{label:"Aangeboden maatregelen",name:"measureCategoryIds",value:l,options:e.measureCategories,onChangeAction:e.handleMeasureCategoryIds})),b.a.createElement("div",{className:"row"},b.a.createElement(q.a,{label:"Type",size:"col-sm-6",name:"typeId",options:e.types,value:c,onChangeAction:e.handleInputChange,required:"required",error:e.errors.type})),b.a.createElement(M.a,null,b.a.createElement("div",{className:"pull-right btn-group",role:"group"},b.a.createElement(k.a,{buttonText:"Opslaan",onClickAction:e.handleSubmit,type:"submit",value:"Submit"}))))})),P=t(152);function T(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);a&&(n=n.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),t.push.apply(t,n)}return t}function B(e){for(var a=1;a<arguments.length;a++){var t=null!=arguments[a]?arguments[a]:{};a%2?T(Object(t),!0).forEach((function(a){v()(e,a,t[a])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):T(Object(t)).forEach((function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(t,a))}))}return e}function j(e){var a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,n=f()(e);if(a){var r=f()(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return d()(this,t)}}var F=function(e){m()(t,e);var a=j(t);function t(e){var n;return r()(this,t),n=a.call(this,e),v()(c()(n),"handleInputChange",(function(e){var a=e.target,t="checkbox"===a.type?a.checked:a.value,r=a.name;n.setState(B(B({},n.state),{},{campaign:B(B({},n.state.campaign),{},v()({},r,t))}))})),v()(c()(n),"handleInputChangeDate",(function(e,a){n.setState(B(B({},n.state),{},{campaign:B(B({},n.state.campaign),{},v()({},a,e))}))})),v()(c()(n),"handleMeasureCategoryIds",(function(e){n.setState(B(B({},n.state),{},{campaign:B(B({},n.state.campaign),{},{measureCategoryIds:e})}))})),v()(c()(n),"handleSubmit",(function(e){e.preventDefault();var a=n.state.campaign,t={},r=!1;N.a.isEmpty(a.name)&&(t.name=!0,r=!0),N.a.isEmpty(""+a.typeId)&&(t.type=!0,r=!0),n.setState(B(B({},n.state),{},{errors:t})),!r&&P.a.storeCampaign(a).then((function(e){E.f.push("/campagne/".concat(e.id))}))})),n.state={campaign:{name:"",description:"",startDate:"",endDate:"",statusId:"",typeId:"",measureCategoryIds:""},errors:{name:!1,type:!1}},n}return o()(t,[{key:"render",value:function(){return b.a.createElement("div",{className:"row"},b.a.createElement("div",{className:"col-md-9"},b.a.createElement("div",{className:"col-md-12"},b.a.createElement(I,null)),b.a.createElement("div",{className:"col-md-12"},b.a.createElement(C.a,null,b.a.createElement(D.a,null,b.a.createElement("div",{className:"col-md-12"},b.a.createElement(x,{campaign:this.state.campaign,errors:this.state.errors,handleInputChange:this.handleInputChange,handleInputChangeDate:this.handleInputChangeDate,handleMeasureCategoryIds:this.handleMeasureCategoryIds,handleSubmit:this.handleSubmit})))))),b.a.createElement("div",{className:"col-md-3"}))}}]),t}(h.Component);a.default=F},699:function(e,a,t){"use strict";var n=t(0),r=t.n(n),s=t(8),o=t.n(s),l=function(e){var a=e.children,t=e.className,n=e.onMouseEnter,s=e.onMouseLeave;return r.a.createElement("div",{className:"panel panel-default ".concat(t),onMouseEnter:n,onMouseLeave:s},a)};l.defaultProps={className:"",onMouseEnter:function(){},onMouseLeave:function(){}},l.propTypes={className:o.a.string,onMouseEnter:o.a.func,onMouseLeave:o.a.func},a.a=l},700:function(e,a,t){"use strict";var n=t(0),r=t.n(n),s=t(8),o=t.n(s),l=function(e){var a=e.className,t=e.children;return r.a.createElement("div",{className:"panel-body ".concat(a)},t)};l.defaultProps={className:""},l.propTypes={className:o.a.string},a.a=l},701:function(e,a,t){"use strict";var n=t(0),r=t.n(n),s=t(8),o=t.n(s),l=function(e){var a=e.buttonClassName,t=e.iconName,n=e.onClickAction,s=e.title,o=e.disabled;return r.a.createElement("button",{type:"button",className:"btn ".concat(a),onClick:n,disabled:o,title:s},r.a.createElement("span",{className:"glyphicon ".concat(t)}))};l.defaultProps={buttonClassName:"btn-success btn-sm",title:"",disabled:!1},l.propTypes={buttonClassName:o.a.string,iconName:o.a.string.isRequired,onClickAction:o.a.func,title:o.a.string,disabled:o.a.bool},a.a=l},702:function(e,a,t){"use strict";var n=t(0),r=t.n(n),s=t(8),o=t.n(s),l=function(e){var a=e.buttonClassName,t=e.buttonText,n=e.onClickAction,s=e.type,o=e.value,l=e.loading,c=e.loadText,i=e.disabled;return l?r.a.createElement("button",{type:s,className:"btn btn-sm btn-loading ".concat(a),value:o,disabled:l},r.a.createElement("span",{className:"glyphicon glyphicon-refresh glyphicon-refresh-animate"})," ",c):r.a.createElement("button",{type:s,className:"btn btn-sm ".concat(a),onClick:n,value:o,disabled:i},t)};l.defaultProps={buttonClassName:"btn-success",type:"button",value:"",loading:!1,loadText:"Aan het laden",disabled:!1},l.propTypes={buttonClassName:o.a.string,buttonText:o.a.string.isRequired,onClickAction:o.a.func,type:o.a.string,value:o.a.string,loading:o.a.bool,loadText:o.a.string,disabled:o.a.bool},a.a=l},703:function(e,a,t){"use strict";var n=t(0),r=t.n(n),s=t(8),o=t.n(s),l=function(e){var a=e.label,t=e.type,n=e.className,s=e.size,o=e.id,l=e.placeholder,c=e.name,i=e.value,m=e.onClickAction,u=e.onChangeAction,d=e.onBlurAction,p=e.required,f=e.readOnly,g=e.maxLength,v=e.error,h=e.min,b=e.max,y=e.step,N=e.errorMessage,E=e.divSize,C=e.divClassName,D=e.autoComplete;return r.a.createElement("div",{className:"form-group ".concat(E," ").concat(C)},r.a.createElement("label",{htmlFor:o,className:"col-sm-6 ".concat(p)},a),r.a.createElement("div",{className:"".concat(s)},r.a.createElement("input",{type:t,className:"form-control input-sm ".concat(n)+(v?"has-error":""),id:o,placeholder:l,name:c,value:i,onClick:m,onChange:u,onBlur:d,readOnly:f,maxLength:g,min:h,max:b,autoComplete:D,step:y})),v&&r.a.createElement("div",{className:"col-sm-offset-6 col-sm-6"},r.a.createElement("span",{className:"has-error-message"}," ",N)))};l.defaultProps={divClassName:"",className:"",size:"col-sm-6",divSize:"col-sm-6",name:"",type:"text",value:"",required:"",readOnly:!1,maxLength:null,error:!1,min:"",max:"",step:"",errorMessage:"",autoComplete:"off",onBlurAction:function(){},onClickAction:function(){},onChangeAction:function(){}},l.propTypes={label:o.a.oneOfType([o.a.string,o.a.object]).isRequired,type:o.a.string,className:o.a.string,divClassName:o.a.string,size:o.a.string,divSize:o.a.string,id:o.a.string,placeholder:o.a.string,name:o.a.string.isRequired,value:o.a.oneOfType([o.a.string,o.a.number]),onClickAction:o.a.func,onChangeAction:o.a.func,onBlurAction:o.a.func,required:o.a.string,readOnly:o.a.bool,maxLength:o.a.string,error:o.a.bool,min:o.a.string,max:o.a.string,step:o.a.string,errorMessage:o.a.string,autoComplete:o.a.string},a.a=l},705:function(e,a,t){"use strict";var n=t(0),r=t.n(n),s=t(8),o=t.n(s),l=function(e){var a=e.label,t=e.className,n=e.size,s=e.id,o=e.name,l=e.value,c=e.options,i=e.onChangeAction,m=e.onBlurAction,u=e.required,d=e.error,p=e.errorMessage,f=e.optionValue,g=e.optionName,v=e.readOnly,h=e.placeholder,b=e.divClassName,y=e.emptyOption;return r.a.createElement("div",{className:"form-group ".concat(n," ").concat(b)},r.a.createElement("label",{htmlFor:s,className:"col-sm-6 ".concat(u)},a),r.a.createElement("div",{className:"col-sm-6"},r.a.createElement("select",{className:"form-control input-sm ".concat(t)+(d&&" has-error"),id:s,name:o,value:l,onChange:i,onBlur:m,readOnly:v},y&&r.a.createElement("option",{value:""},h),c.map((function(e){return r.a.createElement("option",{key:e[f],value:e[f]},e[g])})))),d&&r.a.createElement("div",{className:"col-sm-offset-6 col-sm-6"},r.a.createElement("span",{className:"has-error-message"}," ",p)))};l.defaultProps={divClassName:"",className:"",size:"col-sm-6",readOnly:!1,required:"",error:!1,errorMessage:"",value:"",optionValue:"id",optionName:"name",placeholder:"",emptyOption:!0},l.propTypes={label:o.a.string.isRequired,className:o.a.string,size:o.a.string,id:o.a.string,name:o.a.string.isRequired,options:o.a.array,value:o.a.oneOfType([o.a.string,o.a.number]),onChangeAction:o.a.func,onBlurAction:o.a.func,required:o.a.string,readOnly:o.a.bool,error:o.a.bool,errorMessage:o.a.string,emptyOption:o.a.bool,optionValue:o.a.string,optionName:o.a.string,placeholder:o.a.string},a.a=l},708:function(e,a,t){"use strict";var n=t(24),r=t.n(n),s=t(25),o=t.n(s),l=t(22),c=t.n(l),i=t(26),m=t.n(i),u=t(27),d=t.n(u),p=t(16),f=t.n(p),g=t(6),v=t.n(g),h=t(0),b=t.n(h),y=t(8),N=t.n(y),E=t(717),C=t.n(E),D=t(718),O=t.n(D),A=t(7),I=t.n(A);function S(e){var a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,n=f()(e);if(a){var r=f()(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return d()(this,t)}}I.a.locale("nl");var q=function(e){m()(t,e);var a=S(t);function t(e){var n;return r()(this,t),n=a.call(this,e),v()(c()(n),"validateDate",(function(e){var a=I()(e.target.value,"DD-MM-YYYY",!0),t=!1;a.isValid()||""===e.target.value||(t=!0),n.props.disabledBefore&&a.isBefore(n.props.disabledBefore)&&(t=!0),n.props.disabledAfter&&a.isAfter(n.props.disabledAfter)&&(t=!0),n.setState({errorDateFormat:t})})),v()(c()(n),"onDateChange",(function(e){var a=e?I()(e).format("Y-MM-DD"):"",t=!1;a&&n.props.disabledBefore&&I()(a).isBefore(n.props.disabledBefore)&&(t=!0),a&&n.props.disabledAfter&&I()(a).isAfter(n.props.disabledAfter)&&(t=!0),n.setState({errorDateFormat:t}),!t&&n.props.onChangeAction(a,n.props.name)})),n.state={errorDateFormat:!1},n}return o()(t,[{key:"render",value:function(){var e=this.props,a=e.label,t=e.className,n=e.size,r=e.divSize,s=e.id,o=e.value,l=e.required,c=e.readOnly,i=e.name,m=e.error,u=e.errorMessage,d=e.disabledBefore,p=e.disabledAfter,f=o?I()(o).format("L"):"",g={};return d&&(g.before=new Date(d)),p&&(g.after=new Date(p)),b.a.createElement("div",{className:"form-group ".concat(r)},b.a.createElement("div",null,b.a.createElement("label",{htmlFor:s,className:"col-sm-6 ".concat(l)},a)),b.a.createElement("div",{className:"".concat(n)},b.a.createElement(C.a,{id:s,value:f,formatDate:D.formatDate,parseDate:D.parseDate,onDayChange:this.onDateChange,dayPickerProps:{showWeekNumbers:!0,locale:"nl",firstDayOfWeek:1,localeUtils:O.a,disabledDays:g},inputProps:{className:"form-control input-sm ".concat(t)+(this.state.errorDateFormat||m?" has-error":""),name:i,onBlur:this.validateDate,autoComplete:"off",readOnly:c,disabled:c},required:l,readOnly:c,placeholder:""})),m&&b.a.createElement("div",{className:"col-sm-offset-6 col-sm-6"},b.a.createElement("span",{className:"has-error-message"}," ",u)))}}]),t}(h.Component);q.defaultProps={className:"",size:"col-sm-6",divSize:"col-sm-6",required:"",readOnly:!1,value:null,error:!1,errorMessage:"",disabledBefore:null,disabledAfter:null},q.propTypes={label:N.a.string.isRequired,type:N.a.string,className:N.a.string,size:N.a.string,divSize:N.a.string,id:N.a.string,name:N.a.string,value:N.a.oneOfType([N.a.string,N.a.object]),onChangeAction:N.a.func,required:N.a.string,readOnly:N.a.bool,error:N.a.bool,errorMessage:N.a.string,disabledBefore:N.a.string,disabledAfter:N.a.string},a.a=q},712:function(e,a,t){"use strict";var n=t(0),r=t.n(n),s=t(8),o=t.n(s),l=function(e){var a=e.className,t=e.children;return r.a.createElement("div",{className:"panel-footer ".concat(a)},t)};l.defaultProps={className:""},l.propTypes={className:o.a.string},a.a=l},732:function(e,a,t){"use strict";var n=t(0),r=t.n(n),s=t(8),o=t.n(s),l=t(721),c=(t(722),function(e){var a=e.label,t=(e.className,e.size),n=e.id,s=e.name,o=e.value,c=e.options,i=e.optionId,m=e.optionName,u=e.onChangeAction,d=e.required,p=e.multi,f=e.error;return r.a.createElement("div",{className:"form-group col-sm-6"},r.a.createElement("label",{htmlFor:n,className:"col-sm-6 ".concat(d)},a),r.a.createElement("div",{className:"".concat(t)},r.a.createElement(l.a,{id:n,name:s,value:o,onChange:u,options:c,valueKey:i,labelKey:m,placeholder:"",noResultsText:"Geen resultaat gevonden",multi:p,simpleValue:!0,removeSelected:!0,className:f?" has-error":""})))});c.defaultProps={className:"",size:"col-sm-6",optionId:"id",optionName:"name",readOnly:!1,required:"",error:!1,value:"",multi:!0},c.propTypes={label:o.a.string.isRequired,className:o.a.string,size:o.a.string,id:o.a.string,name:o.a.string.isRequired,options:o.a.array,optionId:o.a.string,optionName:o.a.string,value:o.a.string,onChangeAction:o.a.func,onBlurAction:o.a.func,required:o.a.string,readOnly:o.a.bool,error:o.a.bool,multi:o.a.bool},a.a=c}}]); | 16,033 | 16,033 | 0.719267 |
6fb7225646dd324f19e7d0a9a41ea62325f58eeb | 2,088 | js | JavaScript | build/task/build/config/webpack.test.conf.js | linmingdao/v-bonjure | 02856068d6690277c29414f5a75e5201a0811f50 | [
"MIT"
] | 9 | 2020-07-08T07:34:52.000Z | 2022-03-03T08:35:02.000Z | build/task/build/config/webpack.test.conf.js | linmingdao/v-bonjure | 02856068d6690277c29414f5a75e5201a0811f50 | [
"MIT"
] | 17 | 2020-07-09T10:48:15.000Z | 2022-02-17T18:53:22.000Z | build/task/build/config/webpack.test.conf.js | linmingdao/v-bonjour | 02856068d6690277c29414f5a75e5201a0811f50 | [
"MIT"
] | 3 | 2020-07-08T07:34:52.000Z | 2020-07-10T00:55:45.000Z | const path = require('path');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const OptimizeCssnanoPlugin = require('@intervolga/optimize-cssnano-plugin');
function base(commonBase) {
return {
// 公共的配置信息
...commonBase,
// 启用source-map
devtool: 'cheap-eval-source-map'
};
}
function output(pathInfo) {
return {
path: pathInfo['app_dist'],
filename: 'js/index.bundle.[chunkhash].js',
// 上线该配置需要配置成线上地址
publicPath: '/'
};
}
function plugins(pathInfo, commonPlugins, env) {
return [
new CleanWebpackPlugin([env], {
root: path.resolve(pathInfo['app_dist'], '..'),
verbose: true,
dry: false
}),
// 公共插件配置
...commonPlugins,
new OptimizeCssnanoPlugin({
sourceMap: true,
compress: {
warnings: false,
drop_console: true
},
cssnanoOptions: {
preset: [
'default',
{
discardComments: {
removeAll: true
}
}
]
}
})
];
}
function rules(commonRules) {
return [
// 公共规则配置
...commonRules
];
}
/**
* 测试环境应用打包构建配置文件
*/
module.exports = {
/**
* 获取对应环境的webpack编译打包配置信息
* @param {Object} env
* @param {Object} appInfo
* @param {Object} pathInfo
* @param {String} analyzer
*/
getConfig({ env, appInfo, pathInfo, analyzer }) {
// 获取webpack公共配置
const baseConfig = require('./webpack.base.conf').getConfig({ appInfo, pathInfo, analyzer });
return {
// 基础配置
...base(baseConfig.base),
// 应用打包出口
output: output(pathInfo),
// 插件配置
plugins: plugins(pathInfo, baseConfig.plugins, env),
module: {
// 规则配置
rules: rules(baseConfig.rules)
}
};
}
};
| 24 | 101 | 0.479885 |
6fb7bdb6008fa5c1c7189e37af5c0a4cb57919d6 | 665 | js | JavaScript | src/redux/sagas/appt.saga.js | ShylaEarl/prime-solo-project-2021 | 9676b8995df599845cc9f460e3011155f5e8d8b6 | [
"MIT"
] | 1 | 2021-06-07T20:30:03.000Z | 2021-06-07T20:30:03.000Z | src/redux/sagas/appt.saga.js | ShylaEarl/prime-solo-project-2021 | 9676b8995df599845cc9f460e3011155f5e8d8b6 | [
"MIT"
] | null | null | null | src/redux/sagas/appt.saga.js | ShylaEarl/prime-solo-project-2021 | 9676b8995df599845cc9f460e3011155f5e8d8b6 | [
"MIT"
] | null | null | null | import axios from 'axios';
import { put, takeEvery } from 'redux-saga/effects'; //takeLatest
// worker Saga: will be fired on "FETCH_APPT" actions from client profile
function* fetchAppt(action) {
try {
const appt = yield axios.get(`/api/profile/${action.payload}`); // /${id} double check route!
yield put({ type: 'SET_APPT', payload: appt.data }); //double check this payload
} catch (error) {
console.log('Appt get request failed', error);
}
}
// function addAppt(){
// post for adding appointment
// }
function* apptSaga() {
yield takeEvery('FETCH_APPT', fetchAppt);
//yield takeEvery('ADD_APPT', addAppt);
}
export default apptSaga; | 28.913043 | 97 | 0.682707 |
6fb8e61651acf9bf9df99d630dda09d6db7b0285 | 658 | js | JavaScript | test/stop.js | mszewcz/queue | 5b6368e978efb62ca9fac18a6a8827cf67ba27bd | [
"MIT"
] | 527 | 2015-01-05T09:17:12.000Z | 2022-03-15T11:38:06.000Z | test/stop.js | mszewcz/queue | 5b6368e978efb62ca9fac18a6a8827cf67ba27bd | [
"MIT"
] | 72 | 2015-03-23T13:02:32.000Z | 2022-01-24T08:14:23.000Z | test/stop.js | mszewcz/queue | 5b6368e978efb62ca9fac18a6a8827cf67ba27bd | [
"MIT"
] | 84 | 2015-02-04T10:30:40.000Z | 2022-03-28T02:17:47.000Z | var tape = require('tape')
var queue = require('../')
tape('stop', function (t) {
t.plan(6)
var q = queue({ concurrency: 1 })
q.push(function (cb) {
setTimeout(function () {
t.equal(q.running, false)
cb()
// restart
setTimeout(function () {
q.start(function () {
t.ok(q)
})
}, 10)
}, 10)
})
q.push(function (cb) {
t.equal(q.running, true)
cb()
})
// start
q.start(function (err) {
t.error(err)
t.equal(q.running, false)
})
// but stop the q before the first job has finished
setTimeout(function () {
t.equal(q.length, 2)
q.stop()
}, 0)
})
| 16.45 | 53 | 0.516717 |
6fb997149fc2dfa53a62d521be546af4a83cbef7 | 21,640 | js | JavaScript | node_modules/@react-google-maps/infobox/dist/infobox.umd.development.js | ebi94/pmr-react | 6b26d5fc8d8ce9de8fae7a3f9eff154e6a870e80 | [
"MIT"
] | 2 | 2020-06-13T02:04:07.000Z | 2020-11-06T02:14:35.000Z | node_modules/@react-google-maps/infobox/dist/infobox.umd.development.js | ebi94/pmr-react | 6b26d5fc8d8ce9de8fae7a3f9eff154e6a870e80 | [
"MIT"
] | 1 | 2022-02-10T22:53:38.000Z | 2022-02-10T22:53:38.000Z | node_modules/@react-google-maps/infobox/dist/infobox.umd.development.js | ebi94/pmr-react | 6b26d5fc8d8ce9de8fae7a3f9eff154e6a870e80 | [
"MIT"
] | 1 | 2020-11-04T03:52:21.000Z | 2020-11-04T03:52:21.000Z | (function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = global || self, factory(global.infoBox = {}));
}(this, (function (exports) { 'use strict';
var InfoBox =
/*#__PURE__*/
function () {
function InfoBox(options) {
if (options === void 0) {
options = {};
}
this.extend(InfoBox, google.maps.OverlayView); // Standard options (in common with google.maps.InfoWindow):
this.content = options.content || '';
this.disableAutoPan = options.disableAutoPan || false;
this.maxWidth = options.maxWidth || 0;
this.pixelOffset = options.pixelOffset || new google.maps.Size(0, 0);
this.position = options.position || new google.maps.LatLng(0, 0);
this.zIndex = options.zIndex || null; // Additional options (unique to InfoBox):
this.boxClass = options.boxClass || 'infoBox';
this.boxStyle = options.boxStyle || {};
this.closeBoxMargin = options.closeBoxMargin || '2px';
this.closeBoxURL = options.closeBoxURL || 'http://www.google.com/intl/en_us/mapfiles/close.gif';
if (options.closeBoxURL === '') {
this.closeBoxURL = '';
}
this.infoBoxClearance = options.infoBoxClearance || new google.maps.Size(1, 1);
if (typeof options.visible === 'undefined') {
if (typeof options.isHidden === 'undefined') {
options.visible = true;
} else {
options.visible = !options.isHidden;
}
}
this.isHidden = !options.visible;
this.alignBottom = options.alignBottom || false;
this.pane = options.pane || 'floatPane';
this.enableEventPropagation = options.enableEventPropagation || false;
this.div = null;
this.closeListener = null;
this.moveListener = null;
this.mapListener = null;
this.contextListener = null;
this.eventListeners = null;
this.fixedWidthSet = null;
}
var _proto = InfoBox.prototype;
_proto.createInfoBoxDiv = function createInfoBoxDiv() {
var _this = this;
// This handler prevents an event in the InfoBox from being passed on to the map.
function cancelHandler(event) {
event.cancelBubble = true;
if (event.stopPropagation) {
event.stopPropagation();
}
} // This handler ignores the current event in the InfoBox and conditionally prevents
// the event from being passed on to the map. It is used for the contextmenu event.
var ignoreHandler = function ignoreHandler(event) {
event.returnValue = false;
if (event.preventDefault) {
event.preventDefault();
}
if (!_this.enableEventPropagation) {
cancelHandler(event);
}
};
if (!this.div) {
this.div = document.createElement('div');
this.setBoxStyle();
if (typeof this.content === 'string') {
this.div.innerHTML = this.getCloseBoxImg() + this.content;
} else {
this.div.innerHTML = this.getCloseBoxImg();
this.div.appendChild(this.content);
} // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
var panes = this.getPanes();
panes[this.pane].appendChild(this.div); // Add the InfoBox div to the DOM
this.addClickHandler();
if (this.div.style.width) {
this.fixedWidthSet = true;
} else {
if (this.maxWidth !== 0 && this.div.offsetWidth > this.maxWidth) {
this.div.style.width = this.maxWidth + 'px';
this.fixedWidthSet = true;
} else {
// The following code is needed to overcome problems with MSIE
var bw = this.getBoxWidths();
this.div.style.width = this.div.offsetWidth - bw.left - bw.right + 'px';
this.fixedWidthSet = false;
}
}
this.panBox(this.disableAutoPan);
if (!this.enableEventPropagation) {
this.eventListeners = []; // Cancel event propagation.
// Note: mousemove not included (to resolve Issue 152)
var events = ['mousedown', 'mouseover', 'mouseout', 'mouseup', 'click', 'dblclick', 'touchstart', 'touchend', 'touchmove'];
for (var i = 0; i < events.length; i++) {
this.eventListeners.push(google.maps.event.addDomListener(this.div, events[i], cancelHandler));
} // Workaround for Google bug that causes the cursor to change to a pointer
// when the mouse moves over a marker underneath InfoBox.
this.eventListeners.push(google.maps.event.addDomListener(this.div, 'mouseover', function () {
if (_this.div) {
_this.div.style.cursor = 'default';
}
}));
}
this.contextListener = google.maps.event.addDomListener(this.div, 'contextmenu', ignoreHandler);
/**
* This event is fired when the DIV containing the InfoBox's content is attached to the DOM.
* @name InfoBox#domready
* @event
*/
google.maps.event.trigger(this, 'domready');
}
};
_proto.getCloseBoxImg = function getCloseBoxImg() {
var img = '';
if (this.closeBoxURL !== '') {
img = '<img';
img += " src='" + this.closeBoxURL + "'";
img += ' align=right'; // Do this because Opera chokes on style='float: right;'
img += " style='";
img += ' position: relative;'; // Required by MSIE
img += ' cursor: pointer;';
img += ' margin: ' + this.closeBoxMargin + ';';
img += "'>";
}
return img;
};
_proto.addClickHandler = function addClickHandler() {
if (this.div && this.div.firstChild && this.closeBoxURL !== '') {
var closeBox = this.div.firstChild;
this.closeListener = google.maps.event.addDomListener(closeBox, 'click', this.getCloseClickHandler());
} else {
this.closeListener = null;
}
};
_proto.getCloseClickHandler = function getCloseClickHandler() {
var _this2 = this;
return function (event) {
// 1.0.3 fix: Always prevent propagation of a close box click to the map:
event.cancelBubble = true;
if (event.stopPropagation) {
event.stopPropagation();
}
/**
* This event is fired when the InfoBox's close box is clicked.
* @name InfoBox#closeclick
* @event
*/
google.maps.event.trigger(_this2, 'closeclick');
_this2.close();
};
};
_proto.panBox = function panBox(disablePan) {
if (this.div && !disablePan) {
var map = this.getMap(); // Only pan if attached to map, not panorama
if (map instanceof google.maps.Map) {
var xOffset = 0;
var yOffset = 0;
var bounds = map.getBounds();
if (bounds && !bounds.contains(this.position)) {
// Marker not in visible area of map, so set center
// of map to the marker position first.
map.setCenter(this.position);
}
var mapDiv = map.getDiv(); // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
var mapWidth = mapDiv.offsetWidth; // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
var mapHeight = mapDiv.offsetHeight;
var iwOffsetX = this.pixelOffset.width;
var iwOffsetY = this.pixelOffset.height;
var iwWidth = this.div.offsetWidth;
var iwHeight = this.div.offsetHeight;
var padX = this.infoBoxClearance.width;
var padY = this.infoBoxClearance.height; // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
var projection = this.getProjection();
var pixPosition = projection.fromLatLngToContainerPixel(this.position);
if (pixPosition.x < -iwOffsetX + padX) {
xOffset = pixPosition.x + iwOffsetX - padX;
} else if (pixPosition.x + iwWidth + iwOffsetX + padX > mapWidth) {
xOffset = pixPosition.x + iwWidth + iwOffsetX + padX - mapWidth;
}
if (this.alignBottom) {
if (pixPosition.y < -iwOffsetY + padY + iwHeight) {
yOffset = pixPosition.y + iwOffsetY - padY - iwHeight;
} else if (pixPosition.y + iwOffsetY + padY > mapHeight) {
yOffset = pixPosition.y + iwOffsetY + padY - mapHeight;
}
} else {
if (pixPosition.y < -iwOffsetY + padY) {
yOffset = pixPosition.y + iwOffsetY - padY;
} else if (pixPosition.y + iwHeight + iwOffsetY + padY > mapHeight) {
yOffset = pixPosition.y + iwHeight + iwOffsetY + padY - mapHeight;
}
}
if (!(xOffset === 0 && yOffset === 0)) {
// Move the map to the shifted center.
map.panBy(xOffset, yOffset);
}
}
}
};
_proto.setBoxStyle = function setBoxStyle() {
if (this.div) {
// Apply style values from the style sheet defined in the boxClass parameter:
this.div.className = this.boxClass; // Clear existing inline style values:
this.div.style.cssText = ''; // Apply style values defined in the boxStyle parameter:
var boxStyle = this.boxStyle;
for (var i in boxStyle) {
// eslint-disable-next-line no-prototype-builtins
if (boxStyle.hasOwnProperty(i)) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
this.div.style[i] = boxStyle[i];
}
} // Fix for iOS disappearing InfoBox problem
// See http://stackoverflow.com/questions/9229535/google-maps-markers-disappear-at-certain-zoom-level-only-on-iphone-ipad
this.div.style.webkitTransform = 'translateZ(0)'; // Fix up opacity style for benefit of MSIE
if (typeof this.div.style.opacity !== 'undefined' && this.div.style.opacity !== '') {
// See http://www.quirksmode.org/css/opacity.html
var opacity = parseFloat(this.div.style.opacity || ''); // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
this.div.style.msFilter = '"progid:DXImageTransform.Microsoft.Alpha(Opacity=' + opacity * 100 + ')"';
this.div.style.filter = 'alpha(opacity=' + opacity * 100 + ')';
} // Apply required styles
this.div.style.position = 'absolute';
this.div.style.visibility = 'hidden';
if (this.zIndex !== null) {
this.div.style.zIndex = this.zIndex + '';
}
if (!this.div.style.overflow) {
this.div.style.overflow = 'auto';
}
}
};
_proto.getBoxWidths = function getBoxWidths() {
var bw = {
top: 0,
bottom: 0,
left: 0,
right: 0
};
if (!this.div) {
return bw;
}
if (document.defaultView && document.defaultView.getComputedStyle) {
var ownerDocument = this.div.ownerDocument;
var computedStyle = ownerDocument && ownerDocument.defaultView ? ownerDocument.defaultView.getComputedStyle(this.div, '') : null;
if (computedStyle) {
// The computed styles are always in pixel units (good!)
bw.top = parseInt(computedStyle.borderTopWidth || '', 10) || 0;
bw.bottom = parseInt(computedStyle.borderBottomWidth || '', 10) || 0;
bw.left = parseInt(computedStyle.borderLeftWidth || '', 10) || 0;
bw.right = parseInt(computedStyle.borderRightWidth || '', 10) || 0;
}
} else if ( // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
document.documentElement.currentStyle // MSIE
) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
var currentStyle = this.div.currentStyle;
if (currentStyle) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// The current styles may not be in pixel units, but assume they are (bad!)
bw.top = parseInt(currentStyle.borderTopWidth || '', 10) || 0;
bw.bottom = parseInt(currentStyle.borderBottomWidth || '', 10) || 0;
bw.left = parseInt(currentStyle.borderLeftWidth || '', 10) || 0;
bw.right = parseInt(currentStyle.borderRightWidth || '', 10) || 0;
}
}
return bw;
};
_proto.onRemove = function onRemove() {
if (this.div && this.div.parentNode) {
this.div.parentNode.removeChild(this.div);
this.div = null;
}
};
_proto.draw = function draw() {
this.createInfoBoxDiv();
if (this.div) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
var projection = this.getProjection();
var pixPosition = projection.fromLatLngToDivPixel(this.position);
this.div.style.left = pixPosition.x + this.pixelOffset.width + 'px';
if (this.alignBottom) {
this.div.style.bottom = -(pixPosition.y + this.pixelOffset.height) + 'px';
} else {
this.div.style.top = pixPosition.y + this.pixelOffset.height + 'px';
}
if (this.isHidden) {
this.div.style.visibility = 'hidden';
} else {
this.div.style.visibility = 'visible';
}
}
};
_proto.setOptions = function setOptions(options) {
if (options === void 0) {
options = {};
}
if (typeof options.boxClass !== 'undefined') {
// Must be first
this.boxClass = options.boxClass;
this.setBoxStyle();
}
if (typeof options.boxStyle !== 'undefined') {
// Must be second
this.boxStyle = options.boxStyle;
this.setBoxStyle();
}
if (typeof options.content !== 'undefined') {
this.setContent(options.content);
}
if (typeof options.disableAutoPan !== 'undefined') {
this.disableAutoPan = options.disableAutoPan;
}
if (typeof options.maxWidth !== 'undefined') {
this.maxWidth = options.maxWidth;
}
if (typeof options.pixelOffset !== 'undefined') {
this.pixelOffset = options.pixelOffset;
}
if (typeof options.alignBottom !== 'undefined') {
this.alignBottom = options.alignBottom;
}
if (typeof options.position !== 'undefined') {
this.setPosition(options.position);
}
if (typeof options.zIndex !== 'undefined') {
this.setZIndex(options.zIndex);
}
if (typeof options.closeBoxMargin !== 'undefined') {
this.closeBoxMargin = options.closeBoxMargin;
}
if (typeof options.closeBoxURL !== 'undefined') {
this.closeBoxURL = options.closeBoxURL;
}
if (typeof options.infoBoxClearance !== 'undefined') {
this.infoBoxClearance = options.infoBoxClearance;
}
if (typeof options.isHidden !== 'undefined') {
this.isHidden = options.isHidden;
}
if (typeof options.visible !== 'undefined') {
this.isHidden = !options.visible;
}
if (typeof options.enableEventPropagation !== 'undefined') {
this.enableEventPropagation = options.enableEventPropagation;
}
if (this.div) {
this.draw();
}
};
_proto.setContent = function setContent(content) {
this.content = content;
if (this.div) {
if (this.closeListener) {
google.maps.event.removeListener(this.closeListener);
this.closeListener = null;
} // Odd code required to make things work with MSIE.
if (!this.fixedWidthSet) {
this.div.style.width = '';
}
if (typeof content === 'string') {
this.div.innerHTML = this.getCloseBoxImg() + content;
} else {
this.div.innerHTML = this.getCloseBoxImg();
this.div.appendChild(content);
} // Perverse code required to make things work with MSIE.
// (Ensures the close box does, in fact, float to the right.)
if (!this.fixedWidthSet) {
this.div.style.width = this.div.offsetWidth + 'px';
if (typeof content === 'string') {
this.div.innerHTML = this.getCloseBoxImg() + content;
} else {
this.div.innerHTML = this.getCloseBoxImg();
this.div.appendChild(content);
}
}
this.addClickHandler();
}
/**
* This event is fired when the content of the InfoBox changes.
* @name InfoBox#content_changed
* @event
*/
google.maps.event.trigger(this, 'content_changed');
};
_proto.setPosition = function setPosition(latLng) {
this.position = latLng;
if (this.div) {
this.draw();
}
/**
* This event is fired when the position of the InfoBox changes.
* @name InfoBox#position_changed
* @event
*/
google.maps.event.trigger(this, 'position_changed');
};
_proto.setVisible = function setVisible(isVisible) {
this.isHidden = !isVisible;
if (this.div) {
this.div.style.visibility = this.isHidden ? 'hidden' : 'visible';
}
};
_proto.setZIndex = function setZIndex(index) {
this.zIndex = index;
if (this.div) {
this.div.style.zIndex = index + '';
}
/**
* This event is fired when the zIndex of the InfoBox changes.
* @name InfoBox#zindex_changed
* @event
*/
google.maps.event.trigger(this, 'zindex_changed');
};
_proto.getContent = function getContent() {
return this.content;
};
_proto.getPosition = function getPosition() {
return this.position;
};
_proto.getZIndex = function getZIndex() {
return this.zIndex;
};
_proto.getVisible = function getVisible() {
var map = this.getMap();
var isVisible;
if (typeof map === 'undefined' || map === null) {
isVisible = false;
} else {
isVisible = !this.isHidden;
}
return isVisible;
};
_proto.show = function show() {
this.isHidden = false;
if (this.div) {
this.div.style.visibility = 'visible';
}
};
_proto.hide = function hide() {
this.isHidden = true;
if (this.div) {
this.div.style.visibility = 'hidden';
}
};
_proto.open = function open(map, anchor) {
var _this3 = this;
if (anchor) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
this.position = anchor.getPosition();
this.moveListener = google.maps.event.addListener(anchor, 'position_changed', function () {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
var position = anchor.getPosition();
_this3.setPosition(position);
});
this.mapListener = google.maps.event.addListener(anchor, 'map_changed', function () {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
_this3.setMap(anchor.map);
});
} // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
this.setMap(map);
if (this.div) {
this.panBox();
}
};
_proto.close = function close() {
if (this.closeListener) {
google.maps.event.removeListener(this.closeListener);
this.closeListener = null;
}
if (this.eventListeners) {
for (var i = 0; i < this.eventListeners.length; i++) {
google.maps.event.removeListener(this.eventListeners[i]);
}
this.eventListeners = null;
}
if (this.moveListener) {
google.maps.event.removeListener(this.moveListener);
this.moveListener = null;
}
if (this.mapListener) {
google.maps.event.removeListener(this.mapListener);
this.mapListener = null;
}
if (this.contextListener) {
google.maps.event.removeListener(this.contextListener);
this.contextListener = null;
} // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
this.setMap(null);
} // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
;
_proto.extend = function extend(obj1, obj2) {
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
return function applyExtend(object) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
for (var property in object.prototype) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// eslint-disable-next-line no-prototype-builtins
if (!this.prototype.hasOwnProperty(property)) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
this.prototype[property] = object.prototype[property];
}
} // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
return this;
}.apply(obj1, [obj2]);
};
return InfoBox;
}();
exports.InfoBox = InfoBox;
})));
//# sourceMappingURL=infobox.umd.development.js.map
| 32.059259 | 137 | 0.584288 |
6fb9f1c3e5c94ec802596024878f214d0929d6c4 | 3,111 | js | JavaScript | docusaurus.config.js | elC0mpa/easybtn.earias.me | 9d2302e9db41cb222257c4c4de112ea5c27d5a30 | [
"MIT"
] | null | null | null | docusaurus.config.js | elC0mpa/easybtn.earias.me | 9d2302e9db41cb222257c4c4de112ea5c27d5a30 | [
"MIT"
] | null | null | null | docusaurus.config.js | elC0mpa/easybtn.earias.me | 9d2302e9db41cb222257c4c4de112ea5c27d5a30 | [
"MIT"
] | null | null | null | module.exports = {
title: "EasyButton",
tagline: "Arduino library for debouncing momentary contact switches, detect press, release, long press and sequences with event definitions and callbacks.",
url: "https://easybtn.earias.me",
baseUrl: "/",
favicon: "img/favicon.ico",
organizationName: "evert-arias", // Usually your GitHub org/user name.
projectName: "EasyButton", // Usually your repo name.
themeConfig: {
navbar: {
title: "EasyButton",
logo: {
alt: "EasyButton Logo",
src: "img/logo.svg"
},
links: [
{
to: "docs/introduction",
activeBasePath: "docs",
label: "Docs",
position: "left"
},
{
to: "docs/on-single-press-api",
activeBasePath: "api",
label: "API",
position: "left"
},
{
to: "docs/on-single-press-example",
activeBasePath: "examples",
label: "Examples",
position: "left"
},
{ to: "https://blog.earias.me", label: "Blog", position: "right" },
{
href: "https://github.com/evert-arias/EasyButton",
label: "GitHub",
position: "right"
}
]
},
footer: {
style: "dark",
links: [
{
title: "Docs",
items: [
{
label: "Introduction",
to: "docs/introduction"
},
{
label: "Installation",
to: "docs/installation"
},
{
label: "Fundamentals",
to: "docs/fundamentals"
}
]
},
{
title: "Examples",
items: [
{
label: "Single Press",
to: "docs/on-single-press-example"
},
{
label: "Detecting Sequence",
href: "docs/on-sequence-example"
},
{
label: "Pressed For Duration",
href: "docs/on-pressed-for-duration-example"
}
]
},
{
title: "Community",
items: [
{
label: "Blog",
to: "https://blog.earias.me/"
},
{
label: "GitHub",
href: "https://github.com/evert-arias/EasyButton"
},
{
label: "Youtube",
href: "https://www.youtube.com/channel/UCbdTIe6YpgJ6bCL7FI16Bcw"
}
]
}
],
copyright: `Made with 💙 by Evert Arias`
},
googleAnalytics: {
trackingID: "UA-137998950-8",
anonymizeIP: false
}
},
presets: [
[
"@docusaurus/preset-classic",
{
docs: {
sidebarPath: require.resolve("./sidebars.js"),
editUrl: "https://github.com/evert-arias/easybutton-website"
},
theme: {
customCss: require.resolve("./src/css/custom.css")
}
}
]
],
plugins: ["@docusaurus/plugin-google-analytics"]
}; | 25.925 | 158 | 0.452909 |
6fbb26d1a7668ebef3ec2e94ff16ed63ab50e2e8 | 126 | js | JavaScript | src/helpers/monthsSlug.js | blugt/portuguese-utils | 20ce4cd111bd7ff9319bea020172def166189fd1 | [
"MIT"
] | 12 | 2018-05-07T23:28:11.000Z | 2020-02-27T15:35:22.000Z | src/helpers/monthsSlug.js | blugt/portuguese-utils | 20ce4cd111bd7ff9319bea020172def166189fd1 | [
"MIT"
] | 29 | 2018-05-07T20:36:30.000Z | 2020-04-03T19:36:03.000Z | src/helpers/monthsSlug.js | blugt/portuguese-utils | 20ce4cd111bd7ff9319bea020172def166189fd1 | [
"MIT"
] | 4 | 2018-05-08T10:01:53.000Z | 2018-07-31T20:55:16.000Z | export default [
'Jan',
'Fev',
'Mar',
'Abr',
'Mai',
'Jun',
'Jul',
'Ago',
'Set',
'Out',
'Nov',
'Dez'
]
| 8.4 | 16 | 0.388889 |
6fbb39cc542725cb1db28ee346583f6d82f93373 | 131 | js | JavaScript | src/assets/js/components/levelsList.js | apendua/u-cioci-emmy | 26b0883f735c14c3585c95fae0bdc6b5c6bfdf4b | [
"MIT"
] | null | null | null | src/assets/js/components/levelsList.js | apendua/u-cioci-emmy | 26b0883f735c14c3585c95fae0bdc6b5c6bfdf4b | [
"MIT"
] | null | null | null | src/assets/js/components/levelsList.js | apendua/u-cioci-emmy | 26b0883f735c14c3585c95fae0bdc6b5c6bfdf4b | [
"MIT"
] | null | null | null | var Ractive = require('ractive');
Ractive.components.levelsList = Ractive.extend({
template: require('./levelsList.html')
});
| 21.833333 | 48 | 0.709924 |
6fbb5ed72979bedeef3f60f659b1d58a9f541131 | 3,336 | js | JavaScript | app/assets/javascripts/pig/redactor_plugins/video.js | macool/pig | a2fd8cbb11e0f22c6e88fe52f12eec24bae65c7e | [
"MIT"
] | null | null | null | app/assets/javascripts/pig/redactor_plugins/video.js | macool/pig | a2fd8cbb11e0f22c6e88fe52f12eec24bae65c7e | [
"MIT"
] | 5 | 2018-11-30T08:59:17.000Z | 2018-11-30T08:59:42.000Z | app/assets/javascripts/pig/redactor_plugins/video.js | macool/pig | a2fd8cbb11e0f22c6e88fe52f12eec24bae65c7e | [
"MIT"
] | 1 | 2020-08-15T06:29:22.000Z | 2020-08-15T06:29:22.000Z | /*
* Video plugin.
* To include in a project add 'video' to config.redactor_plugins in config/initializers/pig.rb
* http://imperavi.com/redactor/plugins/video/ (modified to add wrapper div)
*/
if (!RedactorPlugins) var RedactorPlugins = {};
(function($)
{
RedactorPlugins.video = function()
{
return {
reUrlYoutube: /https?:\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube\.com\S*[^\w\-\s])([\w\-]{11})(?=[^\w\-]|$)(?![?=&+%\w.-]*(?:['"][^<>]*>|<\/a>))[?=&+%\w.-]*/ig,
reUrlVimeo: /https?:\/\/(www\.)?vimeo.com\/(\d+)($|\/)/,
reUrlSoundcloud: /https?:\/\/(www\.)?soundcloud.com\/.+/,
getTemplate: function() {
return "<section id=\"redactor-modal-video-insert\">" +
'<label>Paste a YouTube, Vimeo or Soundcloud link here.<br>(e.g. https://www.youtube.com/watch?v=8uDuls5TyNE)</label>' +
'<textarea id="redactor-insert-video-area" style="height: 160px;"></textarea>' +
'</section>';
},
init: function() {
var button = this.button.addAfter('image', 'video', this.lang.get('video'));
this.button.addCallback(button, this.video.show);
},
show: function()
{
this.modal.addTemplate('video', this.video.getTemplate());
this.modal.load('video', this.lang.get('video'), 700);
this.modal.createCancelButton();
var button = this.modal.createActionButton(this.lang.get('insert'));
button.on('click', this.video.insert);
this.selection.save();
this.modal.show();
$('#redactor-insert-video-area').focus();
},
insert: function() {
var data = $('#redactor-insert-video-area').val();
if (!data.match(/<iframe|<video/gi))
{
data = this.clean.stripTags(data);
var iframeStart = '<p class="responsive-video-wrapper"><iframe src="',
iframeEnd = '" frameborder="0" allowfullscreen></iframe></p>';
if (data.match(this.video.reUrlYoutube))
{
data = data.replace(this.video.reUrlYoutube, iframeStart + '//www.youtube.com/embed/$1' + iframeEnd);
this.video.addToRedactor(data);
}
else if (data.match(this.video.reUrlVimeo))
{
data = data.replace(this.video.reUrlVimeo, iframeStart + '//player.vimeo.com/video/$2' + iframeEnd);
this.video.addToRedactor(data);
}
else if (data.match(this.video.reUrlSoundcloud))
{
var self = this;
$.get("https://soundcloud.com/oembed?format=json&url=" + data, function(data) {
self.video.addToRedactor(data.html);
});
}
}
},
addToRedactor: function (data) {
this.selection.restore();
this.modal.close();
var current = this.selection.getBlock() || this.selection.getCurrent();
if (current) $(current).after(data);
else
{
this.insert.html(data);
}
this.code.sync();
},
update: function() {
// do not have responsive wrapper on paras without iframe
$('p.responsive-video-wrapper').each(function () {
if (!$(this).find('iframe').length) {
$(this).removeClass('responsive-video-wrapper');
}
});
}
};
};
})(jQuery); | 34.391753 | 167 | 0.55006 |
6fbb5f1bbfa98978bc71a90507ed23ef7cd38d72 | 3,626 | js | JavaScript | frontend/lost/src/coreui_containers/TheLayout.js | JonasGoebel/lost | 802be42fb6cd7d046db61a34d77c0b5d233eca46 | [
"MIT"
] | 490 | 2019-01-16T12:57:22.000Z | 2022-03-26T14:13:26.000Z | frontend/lost/src/coreui_containers/TheLayout.js | JonasGoebel/lost | 802be42fb6cd7d046db61a34d77c0b5d233eca46 | [
"MIT"
] | 147 | 2019-01-23T13:22:42.000Z | 2022-03-30T11:14:08.000Z | frontend/lost/src/coreui_containers/TheLayout.js | JonasGoebel/lost | 802be42fb6cd7d046db61a34d77c0b5d233eca46 | [
"MIT"
] | 91 | 2019-03-11T10:37:50.000Z | 2022-03-28T16:41:32.000Z | import React, { useEffect, useState, useRef } from 'react'
import { useDispatch } from 'react-redux'
import jwtDecode from 'jwt-decode'
import { useHistory } from 'react-router-dom'
import { useTranslation } from 'react-i18next'
import axios from 'axios'
import TheContent from './TheContent'
import TheSidebar from './TheSidebar'
import TheFooter from './TheFooter'
import TheHeader from './TheHeader'
import guiSetup from '../guiSetup'
import actions from '../actions'
const TheLayout = () => {
const role = useRef()
const history = useHistory()
const dispatch = useDispatch()
const [navItems, setNavItems] = useState([])
const [routes, setRoutes] = useState([])
const { i18n } = useTranslation()
useEffect(() => {
const token = localStorage.getItem('token')
if (token) {
axios.defaults.headers.common.Authorization = `Bearer ${localStorage.getItem('token')}`
const { roles } = jwtDecode(token).user_claims
role.current = roles[0]
if (!guiSetup[role.current]) {
throw new Error(`Role ${role.current} not found in Gui Setup`)
} else {
const roles = Object.keys(guiSetup).filter((e) => e !== 'additionalRoutes')
dispatch(actions.setRoles(roles))
const newRoutes1 = guiSetup[role.current].navItems.map((navItem) => ({
path: navItem.to,
name: navItem,
component: navItem.component,
}))
let newRoutes2 = []
if (guiSetup.additionalRoutes) {
newRoutes2 = guiSetup.additionalRoutes.map((route) => ({
path: route.path,
name: route.path,
exact: route.exact,
component: route.component,
}))
}
const newRoutes = [...newRoutes1, ...newRoutes2]
setRoutes(newRoutes)
dispatch(actions.setOwnUser())
dispatch(actions.getVersion())
if(history.location.pathname === '/'){
history.push(guiSetup[role.current].redirect)
}
}
} else {
history.push('/login')
}
}, [])
useEffect(() => {
const token = localStorage.getItem('token')
if (token) {
// ???
const navItemsFiltered = guiSetup[role.current].navItems.map(
({ component, ...navItem }) => {
const name =
i18n.language === 'de' && navItem.de_name ? navItem.de_name : navItem.name
if (navItem.title) {
return {
_tag: 'CSidebarNavTitle',
_children: [name],
}
}
return {
_tag: 'CSidebarNavItem',
...navItem,
name,
}
},
)
setNavItems(navItemsFiltered)
}
}, [i18n.language])
return (
<div className="c-app c-default-layout">
<TheSidebar navItems={navItems} />
<div className="c-wrapper">
<TheHeader numNavItems={navItems.length}/>
<div className="c-body">
<TheContent routes={routes} />
</div>
<TheFooter />
</div>
</div>
)
}
export default TheLayout
| 36.26 | 99 | 0.488417 |
6fbbf3e8c4c12d107a4524b58c84f99c6630720f | 5,714 | js | JavaScript | lib/ATGetDependencies.js | gruntjs-updater/atpackager | dd2eb27786c1bc5300eac2247744ad0154fce349 | [
"Apache-2.0"
] | 2 | 2018-02-09T10:38:06.000Z | 2019-03-13T15:26:57.000Z | lib/ATGetDependencies.js | gruntjs-updater/atpackager | dd2eb27786c1bc5300eac2247744ad0154fce349 | [
"Apache-2.0"
] | 6 | 2015-02-19T13:15:44.000Z | 2018-10-19T16:53:35.000Z | lib/ATGetDependencies.js | gruntjs-updater/atpackager | dd2eb27786c1bc5300eac2247744ad0154fce349 | [
"Apache-2.0"
] | 1 | 2017-01-25T16:57:41.000Z | 2017-01-25T16:57:41.000Z | /*
* Copyright 2013 Amadeus s.a.s.
* 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 UglifyJS = require("uglify-js");
var grunt = require('./grunt').grunt();
var acceptedAriaMethods = {
'classDefinition' : 1,
'interfaceDefinition' : 1,
'beanDefinitions' : 1,
'tplScriptDefinition' : 1
};
var getBaseLogicalPath = function (classpath) {
return classpath.replace(/\./g, '/');
};
var createGetLogicalPathFn = function (extension) {
return function (classpath) {
return getBaseLogicalPath(classpath) + extension;
};
};
var getLogicalPath = {
JS : createGetLogicalPathFn('.js'),
TPL : createGetLogicalPathFn('.tpl'),
RES : createGetLogicalPathFn('.js'),
CSS : createGetLogicalPathFn('.tpl.css'),
TML : createGetLogicalPathFn('.tml'),
CML : createGetLogicalPathFn('.cml'),
TXT : createGetLogicalPathFn('.tpl.txt')
};
var appendString = function (stringLitteral, mapFunction, array) {
if (stringLitteral instanceof UglifyJS.AST_String) {
var value = mapFunction(stringLitteral.value);
array.push(value);
} else {
reportError('Expected a string literal.', stringLitteral);
}
};
var appendMappedStringLitterals = function (stringLitterals, mapFunction, array) {
for (var i = 0, l = stringLitterals.length; i < l; i++) {
appendString(stringLitterals[i], mapFunction, array);
}
};
var appendMappedMapValueStringLitterals = function (object, mapFunction, array) {
var properties = object.properties;
for (var i = 0, l = properties.length; i < l; i++) {
appendString(properties[i].value, mapFunction, array);
}
};
var findMapValue = function (astObject, key) {
var properties = astObject.properties;
for (var i = 0, l = properties.length; i < l; i++) {
var curProperty = properties[i];
if (curProperty.key === key) {
return curProperty.value;
}
}
};
var reportError = function (errorMsg, item) {
var msg = ["ATDependencies warning: ", errorMsg.yellow];
var file = item.start.file;
if (file) {
msg.push(" in ", file.cyan, ' (line ', item.start.line, ')');
}
msg.push('\n ', item.print_to_string().yellow);
grunt.log.writeln(msg.join(''));
};
var checkAriaDefinition = function (walker) {
// check that the walker is positioned in the argument of
// an Aria.classDefinition, Aria.interfaceDefinition, Aria.tplScriptDefinition or Aria.beanDefinitions
var parent = walker.parent(1);
if (parent instanceof UglifyJS.AST_Call) {
var expr = parent.expression;
if (expr instanceof UglifyJS.AST_Dot) {
var aria = expr.expression;
if (aria instanceof UglifyJS.AST_SymbolRef && aria.name === "Aria" &&
acceptedAriaMethods.hasOwnProperty(expr.property)) {
return true;
}
}
}
// To check what is happening:
// reportError('Not taking the property into account.', walker.self())
return false;
};
var handleArray = function (mapFunction) {
return function (value, res, walker) {
if (value instanceof UglifyJS.AST_Array) {
appendMappedStringLitterals(value.elements, mapFunction, res);
} else {
reportError('Expected an array literal', walker.self());
}
};
};
var handleMap = function (mapFunction) {
return function (value, res, walker) {
if (value instanceof UglifyJS.AST_Object) {
appendMappedMapValueStringLitterals(value, mapFunction, res);
} else {
reportError('Expected an object literal', walker.self());
}
};
};
var processNames = {
'$dependencies' : handleArray(getLogicalPath.JS),
'$extends' : function (value, res, walker) {
var extendsType;
var extendsTypeValue = findMapValue(walker.parent(0), '$extendsType');
if (extendsTypeValue && extendsTypeValue instanceof UglifyJS.AST_String) {
extendsType = extendsTypeValue.value;
}
if (!getLogicalPath.hasOwnProperty(extendsType)) {
extendsType = "JS";
}
appendString(value, getLogicalPath[extendsType], res);
},
'$implements' : handleArray(getLogicalPath.JS),
'$namespaces' : handleMap(getLogicalPath.JS),
'$css' : handleArray(getLogicalPath.CSS),
'$templates' : handleArray(getLogicalPath.TPL),
'$texts' : handleMap(getLogicalPath.TXT),
'$macrolibs' : handleArray(getLogicalPath.TML),
'$csslibs' : handleArray(getLogicalPath.CML)
};
/**
* Analyses the AST of an Aria Templates file and returns its dependencies as an array of logical paths.
* @param {Object} ast uglify-js abstract syntax tree
* @return {Array} array of dependencies
*/
var getATDependencies = function (ast) {
var res = [];
var walker = new UglifyJS.TreeWalker(function (node) {
if (node instanceof UglifyJS.AST_ObjectProperty && processNames.hasOwnProperty(node.key)) {
if (checkAriaDefinition(walker)) {
processNames[node.key](node.value, res, walker);
}
}
});
ast.walk(walker);
return res;
};
module.exports = getATDependencies; | 34.215569 | 106 | 0.652083 |
6fbc6a5dbcd88380219fa81992102d92f5eab28f | 475 | js | JavaScript | ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/external-links.js | alexandru-m-g/hdx-ckan | 647f1f23f0505fa195601245b758edcaf4d25985 | [
"Apache-2.0"
] | 58 | 2015-01-11T09:05:15.000Z | 2022-03-17T23:44:07.000Z | ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/external-links.js | datopian/hdx-ckan | 2d8871c035a18e48b53859fec522b997b500afe9 | [
"Apache-2.0"
] | 1,467 | 2015-01-01T16:47:44.000Z | 2022-02-28T16:51:20.000Z | ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/external-links.js | datopian/hdx-ckan | 2d8871c035a18e48b53859fec522b997b500afe9 | [
"Apache-2.0"
] | 17 | 2015-05-06T14:04:21.000Z | 2021-11-11T19:58:16.000Z | //$(document).ready(function(){
// var base = '{{ app_globals.site_url }}';
// if(base.lastIndexOf('https://')){//Sometimes the site_url config doesn't factor in HTTPSs
// base = base.slice(7);
// }else if(base.lastIndexOf('http://')){
// base = base.slice(6);
// }
// $('a').each(function(){
// if (this.href.search(base) == -1 && this.href.search('http://docs.hdx.rwlabs.org') == -1){
// this.target="_blank";
// }
// });
//});
| 33.928571 | 98 | 0.532632 |
6fbc8b4c173cffe067a0a50e2571a1e6a57f2eb9 | 322 | js | JavaScript | src/chart-server.js | dapitts/google-charts | 1d00fab99c45d25a42f6e550e37a51578fc22b2e | [
"MIT"
] | null | null | null | src/chart-server.js | dapitts/google-charts | 1d00fab99c45d25a42f6e550e37a51578fc22b2e | [
"MIT"
] | null | null | null | src/chart-server.js | dapitts/google-charts | 1d00fab99c45d25a42f6e550e37a51578fc22b2e | [
"MIT"
] | null | null | null | let connect = require('connect'),
serveStatic = require('serve-static'),
app = connect(),
hostname = '127.0.0.1',
port = 8080;
app.use(serveStatic('./', { 'index': ['google-line-chart.html'] } ));
app.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
}); | 32.2 | 69 | 0.583851 |
6fbd2a3c316b739182738a607b8ce563c8188a72 | 1,094 | js | JavaScript | components/functionTitle.js | GetStaker/ethdoc | c5ea58e8cf1404c7a05e70e75b860947d8220124 | [
"MIT"
] | null | null | null | components/functionTitle.js | GetStaker/ethdoc | c5ea58e8cf1404c7a05e70e75b860947d8220124 | [
"MIT"
] | null | null | null | components/functionTitle.js | GetStaker/ethdoc | c5ea58e8cf1404c7a05e70e75b860947d8220124 | [
"MIT"
] | null | null | null | // import classNames from 'classnames';
import PropTypes from 'prop-types'
import SimpleHeader from './simpleHeader'
class FunctionTitle extends React.Component {
_renderInput(input) {
const { name, type } = input
return (
<span className="input">
<span className="type">{type} </span>
<span className="name">{name}</span>
<style>
{`
.input {
margin: 0px 2px;
}
`}
</style>
</span>
)
}
_renderInputs(inputs) {
return inputs.map((input, i) => {
const isNotLastInput = !(inputs.length - 1 === i)
return (
<span className="input-container">
{this._renderInput(input)}
{isNotLastInput && <span>,</span>}
</span>
)
})
}
render() {
const { name, inputs } = this.props
return (
<SimpleHeader>
{name}({this._renderInputs(inputs)})
</SimpleHeader>
)
}
}
FunctionTitle.propTypes = {
name: PropTypes.string.isRequired,
inputs: PropTypes.array,
}
export default FunctionTitle
| 21.038462 | 55 | 0.555759 |
6fbdaca1654d98a7c076fa4797a187e328138421 | 3,943 | js | JavaScript | o-three-sixty/src/js/o-video/test/playlist.test.js | alejandraimaz/player | a3cc86b5d7e4d6c2459798cc365360c0aa382088 | [
"BSD-3-Clause"
] | null | null | null | o-three-sixty/src/js/o-video/test/playlist.test.js | alejandraimaz/player | a3cc86b5d7e4d6c2459798cc365360c0aa382088 | [
"BSD-3-Clause"
] | null | null | null | o-three-sixty/src/js/o-video/test/playlist.test.js | alejandraimaz/player | a3cc86b5d7e4d6c2459798cc365360c0aa382088 | [
"BSD-3-Clause"
] | null | null | null | /* global describe, it, beforeEach */
const Player = require('../src/js/video');
const Subject = require('../src/js/playlist');
const sinon = require('sinon/pkg/sinon');
function createPlayer () {
const stub = sinon.createStubInstance(Player);
stub.opts = {};
stub.containerEl = document.createElement('div');
stub.videoEl = document.createElement('video');
stub.update.returns(Promise.resolve());
stub.fireWatchedEvent = sinon.spy();
stub.resetAmountWatched = sinon.spy();
return stub;
}
describe('Playlist', () => {
let player;
const queue = ['foo', 'bar', 'baz', 'qux'];
beforeEach(() => {
player = createPlayer();
});
describe('constructor', () => {
it('can instantiate', () => {
const instance = new Subject({ player, queue: [] });
instance.should.be.an.instanceOf(Subject);
instance.opts.should.exist;
instance.opts.player.should.equal(player);
});
it('selects currently playing video from playlist', () => {
player.videoData = { id: 'bar' };
const instance = new Subject({ player, queue });
instance.currentIndex.should.equal(1);
});
it('starts the playlist if the current video does not match', () => {
const instance = new Subject({ player, queue, autoplay: true });
instance.currentIndex.should.equal(0);
sinon.assert.calledOnce(player.update);
});
it('listens for the video to end to trigger the next in the queue when autoplay is set', () => {
player.videoData = { id: 'bar' };
new Subject({ player, queue, autoplay: true });
// no DOM so trigger this on the listener directly
player.containerEl.dispatchEvent(new CustomEvent('ended', { bubbles: false }));
sinon.assert.calledOnce(player.update);
sinon.assert.calledWith(player.update, sinon.match({ id: 'baz' }));
});
it('doesn\'t listen for the video to end when autoplay is not set', () => {
player.videoData = { id: 'bar' };
new Subject({ player, queue, autoplay: false });
player.containerEl.dispatchEvent(new CustomEvent('ended', { bubbles: false }));
sinon.assert.notCalled(player.update);
});
});
describe('#next', () => {
it('calls the next in the queue', () => {
const instance = new Subject({ player, queue, autoplay: true });
instance.currentIndex.should.equal(0);
instance.next();
instance.currentIndex.should.equal(1);
});
});
describe('#prev', () => {
it('calls the previous in the queue', () => {
const instance = new Subject({ player, queue, autoplay: true });
instance.currentIndex.should.equal(0);
instance.prev();
instance.currentIndex.should.equal(instance.opts.queue.length - 1);
});
});
describe('#goto', () => {
it('calls the update method on the player instance', () => {
const instance = new Subject({ player, queue });
instance.goto(10);
instance.currentIndex.should.equal(0);
sinon.assert.calledWith(player.update, sinon.match({ id: 'foo' }));
instance.goto(-10);
instance.currentIndex.should.equal(3);
sinon.assert.calledWith(player.update, sinon.match({ id: 'qux' }));
});
it('stores the currently playing video data', () => {
const instance = new Subject({ player, queue });
player.videoData = { id: 'abc' };
instance.goto(1);
instance.cache.hasOwnProperty('abc').should.be.true;
});
it('retrieves next video from cache when available', () => {
const instance = new Subject({ player, queue });
instance.cache.foo = { id: 'foo', name: 'lorem ipsum doler sit amet' };
instance.goto(0);
sinon.assert.calledWith(player.update, sinon.match({ data: instance.cache.foo }));
});
it('fires off watched event data', () => {
const instance = new Subject({ player, queue });
instance.goto(0);
sinon.assert.called(player.fireWatchedEvent);
});
it('resets amount watched', () => {
const instance = new Subject({ player, queue });
instance.goto(0);
sinon.assert.called(player.resetAmountWatched);
});
});
});
| 27.767606 | 98 | 0.650013 |
6fbdf907ef1e43a1401f846fcad6f92d82828a7c | 2,160 | js | JavaScript | Programming-Fundamentals-with-JavaScript/Mid-Exams/Technology-Fundamentals-Mid-Exam-10-March-2019-Group-2/theFinalQuest.js | Aykut5645/Software-University | 1990afd1d09c60b043c9771c516bc314c4922736 | [
"MIT"
] | null | null | null | Programming-Fundamentals-with-JavaScript/Mid-Exams/Technology-Fundamentals-Mid-Exam-10-March-2019-Group-2/theFinalQuest.js | Aykut5645/Software-University | 1990afd1d09c60b043c9771c516bc314c4922736 | [
"MIT"
] | null | null | null | Programming-Fundamentals-with-JavaScript/Mid-Exams/Technology-Fundamentals-Mid-Exam-10-March-2019-Group-2/theFinalQuest.js | Aykut5645/Software-University | 1990afd1d09c60b043c9771c516bc314c4922736 | [
"MIT"
] | null | null | null | function theFinalQuest(arr) {
let realMessage = arr.shift().split(' ');
let commands = arr;
let index = 0;
let currentCommand = commands[index];
while (currentCommand != 'Stop') {
currentCommand = commands[index].split(' ');
let action = currentCommand[0];
if (action == 'Delete') {
let index = Number(currentCommand[1]);
index = index + 1;
if (index >= 0 && index < realMessage.length) {
realMessage.splice(index, 1);
}
} else if (action == 'Swap') {
let firstWord = currentCommand[1];
let secondWord = currentCommand[2];
if (realMessage.includes(firstWord) && realMessage.includes(secondWord)) {
let firstInd = realMessage.indexOf(firstWord);
let secondInd = realMessage.indexOf(secondWord);
let copyInd = realMessage[firstInd];
realMessage[firstInd] = realMessage[secondInd];
realMessage[secondInd] = copyInd;
}
} else if (action == 'Put') {
let word = currentCommand[1];
let index = Number(currentCommand[2]);
index = index - 1;
if (index >= 0 && index <= realMessage.length) {
realMessage.splice(index, 0, word);
}
} else if (action == 'Sort') {
realMessage.sort((a, b) => b.localeCompare(a));
} else if (action == 'Replace') {
let firstWord = currentCommand[1];
let secondWord = currentCommand[2];
if (realMessage.includes(secondWord)) {
let index = realMessage.indexOf(secondWord);
realMessage[index] = firstWord;
}
}
index++;
}
console.log(realMessage.join(' '));
}
/*
theFinalQuest([
'Congratulations! You last also through the have challenge!',
'Swap have last',
'Replace made have',
'Delete 2',
'Put it 4',
'Stop',
''
]);
*/
theFinalQuest([
'This the my quest! final',
'Put is 2',
'Swap final quest!',
'Delete 2',
'Stop',
''
]);
| 29.589041 | 86 | 0.527778 |
6fbdf9ee8ab5ff00454b9c9841b07991734788df | 909 | js | JavaScript | app/app.js | shamil707/TennisBookingApplication | a14fa2e1fbe293f3385d93add10b796491259ec6 | [
"MIT"
] | null | null | null | app/app.js | shamil707/TennisBookingApplication | a14fa2e1fbe293f3385d93add10b796491259ec6 | [
"MIT"
] | null | null | null | app/app.js | shamil707/TennisBookingApplication | a14fa2e1fbe293f3385d93add10b796491259ec6 | [
"MIT"
] | null | null | null | 'use strict';
// Declare app level module which depends on views, and components
var myApp = angular.module('myApp', [
'ngRoute',
'myApp.version'
]).config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/overview', {
templateUrl: 'partials/overview.html',
controller: 'overviewCtrl'
}).when('/login', {
templateUrl: 'partials/login.html',
controller: 'loginCtrl'
});
$routeProvider.otherwise({
redirectTo : '/login'
});
}]).run(function($rootScope, $location) {
$rootScope.$on( "$routeChangeStart", function(event, next, current) {
$rootScope.loggedInUser = JSON.parse(localStorage.getItem("userDetails"));
if ($rootScope.loggedInUser) {
// no logged user, redirect to /login
$location.path("/overview");
}
else{
$location.path("/login");
}
});
});
| 25.25 | 83 | 0.60286 |
6fbed0004bc7b1942f922b3f233ca4af9e2f980a | 13,810 | js | JavaScript | resources/viewer.js | isaac-utilizecore/Compliancy | d6a37c4700e24313aa77b838c54220f5a7525fbd | [
"MIT"
] | null | null | null | resources/viewer.js | isaac-utilizecore/Compliancy | d6a37c4700e24313aa77b838c54220f5a7525fbd | [
"MIT"
] | null | null | null | resources/viewer.js | isaac-utilizecore/Compliancy | d6a37c4700e24313aa77b838c54220f5a7525fbd | [
"MIT"
] | null | null | null | function createViewer(story, files) {
return {
highlightLinks: story.highlightLinks,
prevPageIndex: -1,
lastRegularPage: -1,
currentPage : -1,
currentPageOverlay : false,
prevPageOverlayIndex : -1,
backStack: [],
cache: [],
urlLastIndex: -1,
files: files,
initialize: function() {
this.createImageMaps();
this.addHotkeys();
this.initializeHighDensitySupport();
},
initializeHighDensitySupport: function() {
if (window.matchMedia) {
this.hdMediaQuery = window
.matchMedia("only screen and (min--moz-device-pixel-ratio: 1.1), only screen and (-o-min-device-pixel-ratio: 2.2/2), only screen and (-webkit-min-device-pixel-ratio: 1.1), only screen and (min-device-pixel-ratio: 1.1), only screen and (min-resolution: 1.1dppx)");
var v = this;
this.hdMediaQuery.addListener(function(e) {
v.refresh();
});
}
},
isHighDensityDisplay: function() {
return (this.hdMediaQuery && this.hdMediaQuery.matches || (window.devicePixelRatio && window.devicePixelRatio > 1));
},
createImageMaps: function() {
var div = $('<div/>', {
'class': 'hidden'
});
var pages = story.pages;
for(var i = 0; i < pages.length; i ++) {
var page = pages[i];
var name = 'map' + i;
var map = $('<map/>', {
id: name,
type: "'"+page.type+"'",
name: name
});
for(var j = page.links.length - 1; j >= 0; j --) {
var link = page.links[j];
var title, href, target;
if(link.page != null) {
title = story.pages[link.page].title;
href = 'javascript:viewer.goTo(' + link.page + ')';
target = null;
} else if(link.action != null && link.action == 'back') {
title = "Go Back";
href = 'javascript:viewer.goBack()';
target = null;
} else if(link.url != null){
title = link.url;
href = link.url;
target = link.target!=null?link.target:null;
}
$('<area/>', {
shape: 'rect',
coords: link.rect.join(','),
href: href,
alt: title,
title: title,
target: target
}).appendTo(map);
}
map.appendTo(div);
}
div.appendTo('body');
},
addHotkeys: function() {
var v = this;
$(document).bind('keydown', 'right space return', function() {
v.next();
});
$(document).bind('keydown', 'left backspace', function() {
v.previous();
});
$(document).bind('keydown', 'shift', function() {
v.toggleLinks();
});
$(document).bind('keydown', 'g', function() {
gallery.toogle();
});
$(document).bind('keydown', 's', function() {
v.goToPage(0);
});
},
getPageHash: function(index) {
var image = story.pages[index].image;
return image.substring(0, image.length - 4); // strip .png suffix
},
getPageHashes: function() {
if(this.pageHashes == null) {
var hashes = {};
var pages = story.pages;
for(var i = 0; i < pages.length; i ++) {
hashes[this.getPageHash(i)] = i;
}
this.pageHashes = hashes;
}
return this.pageHashes;
},
getOverlayFirstParentPageIndex: function(overlayIndex){
var page = null;
var link = null;
for(var i=story.pages.length-1; i>=0 ;i --) {
page = story.pages[i];
if(page.type==='overlay') continue;
for(var li = 0; li < page.links.length; li ++) {
link = page.links[li];
if(link.page!=null && link.page==overlayIndex){
// return the page index which has link to overlay
return i;
}
}
}
// return first prototype page
return 0;
},
getPageIndex: function(page) {
var index;
if (typeof page === "number") {
index = page;
} else if (page === "") {
index = 0;
} else {
index = this.getPageHashes()[page];
if (index==undefined) {
var pageNumber = parseInt(page);
if (isNaN(pageNumber))
index = 0;
else
index = pageNumber - 1;
}
}
return index;
},
goBack: function() {
if(this.backStack.length>0){
this.goTo(this.backStack[this.backStack.length-1]);
this.backStack.shift();
}else{
window.history.back();
}
},
goToPage : function(page) {
this.clear_context();
this.goTo(page);
},
goTo : function(page,refreshURL=true) {
var index = this.getPageIndex(page);
if(!this.currentPageOverlay && this.currentPage>=0){
this.backStack.push(this.currentPage);
}
this.currentPageOverlay = false;
this.prevPageOverlayIndex = -1;
if(index <0 || index == this.currentPage || index >= story.pages.length) return;
var newPage = story.pages[index];
if(newPage.type==="overlay"){
// no any page to overlay, need to find something
if(this.currentPage==-1){
parentIndex = this.getOverlayFirstParentPageIndex(index);
this.goTo(parentIndex);
this.prevPageOverlayIndex = parentIndex;
}else{
this.prevPageOverlayIndex = this.currentPage;
}
this.currentPageOverlay = true;
}else{
this.currentPageOverlay = false;
}
this.prevPageIndex = this.currentPage;
this.refresh_adjust_content_layer(index);
this.refresh_show_or_create_img(index,true);
this.refresh_switch_overlay_layer(index);
this.refresh_update_navbar(index);
if(refreshURL) this.refresh_url(index)
this.currentPage = index;
if(story.pages[index].type!="overlay"){
this.lastRegularPage = index;
}
},
refresh_update_navbar: function(pageIndex) {
var page = story.pages[pageIndex];
$('#nav .title').html((pageIndex+1) + '/' + story.pages.length + ' - ' + page.title);
$('#nav-left-prev').toggleClass('disabled', !this.hasPrevious(pageIndex));
$('#nav-left-next').toggleClass('disabled', !this.hasNext(pageIndex));
if(this.hasPrevious(pageIndex)) {
$('#nav-left-prev a').attr('title', story.pages[pageIndex - 1].title);
} else {
$('#nav-left-prev a').removeAttr('title');
}
if(this.hasNext(pageIndex)) {
$('#nav-left-next a').attr('title', story.pages[pageIndex + 1].title);
} else {
$('#nav-left-next a').removeAttr('title');
}
$('#nav-right-hints').toggleClass('disabled', page.annotations==undefined);
this.refresh_update_links_toggler(pageIndex);
},
refresh_url: function(pageIndex) {
var page = story.pages[pageIndex];
this.urlLastIndex = pageIndex
$(document).attr('title', story.title + ': ' + page.title)
location.hash = '#' + encodeURIComponent(this.getPageHash(pageIndex))
},
refresh_update_links_toggler: function(pageIndex) {
var page = story.pages[pageIndex];
$('#nav-right-links').toggleClass('active', this.highlightLinks);
$('#nav-right-links').toggleClass('disabled', page.links.length == 0);
},
refresh_hide_last_image: function(pageIndex){
var page = story.pages[pageIndex];
var content = $('#content');
var contentOverlay = $('#content-overlay');
var isOverlay = page.type==="overlay";
// hide last regular page to show a new regular after ovelay
if(!isOverlay && this.lastRegularPage>=0 && this.lastRegularPage!=pageIndex){
var lastPage = $('#img_'+this.lastRegularPage);
if(lastPage.length) lastPage.parent().addClass('hidden');
}
// hide last overlay
var prevPageWasOverlay = this.prevPageIndex>=0 && story.pages[this.prevPageIndex].type==="overlay";
if(prevPageWasOverlay){
var prevImg = $('#img_'+this.prevPageIndex);
if(prevImg.length){
prevImg.parent().addClass('hidden');
}
}
},
refresh_adjust_content_layer: function(pageIndex){
var page = story.pages[pageIndex];
if(page.type=="overlay") return;
var contentShadow = $('#content-shadow');
var contentOverlay = $('#content-overlay');
var content = $('#content');
var prevPageWasOverlay = this.prevPageIndex>=0 && story.pages[this.prevPageIndex].type==="overlay";
if(prevPageWasOverlay){
contentShadow.addClass('hidden');
contentOverlay.addClass('hidden');
}
content.width(page.width);
content.height(page.height);
contentShadow.width(page.width);
contentShadow.height(page.height);
contentOverlay.width(page.width);
//contentOverlay.height(page.height)
},
refresh_switch_overlay_layer: function(pageIndex){
var page = story.pages[pageIndex];
var lastMainPage = story.pages[this.lastRegularPage];
if(page.type!="overlay") return;
var isOverlayShadow = page.overlayShadow==1;
var contentOverlay = $('#content-overlay');
var contentShadow = $('#content-shadow');
if(isOverlayShadow){
contentShadow.removeClass('no-shadow');
contentShadow.addClass('shadow');
contentShadow.removeClass('hidden');
}else{
contentOverlay.addClass('hidden');
}
contentOverlay.removeClass('hidden');
},
refresh_show_or_create_img: function(pageIndex,hideLast=false){
var img = $('#img_'+pageIndex);
var page = story.pages[pageIndex];
var isOverlay = page.type==="overlay";
if(isOverlay){
var contentOverlay = $('#content-overlay');
contentOverlay.width(page.width);
}
if(img.length){
if(hideLast) this.refresh_hide_last_image(pageIndex);
img.parent().removeClass('hidden');
}else{
this.refresh_recreate_img(pageIndex,hideLast);
}
},
clear_context_hide_all_images: function(){
var page = story.pages[this.currentPage];
var content = $('#content');
var contentOverlay = $('#content-overlay');
var contentShadow = $('#content-shadow');
var isOverlay = page.type==="overlay";
contentShadow.addClass('hidden');
contentOverlay.addClass('hidden');
// hide last regular page
if(this.lastRegularPage>=0){
var lastPage = $('#img_'+this.lastRegularPage);
if(lastPage.length) lastPage.parent().addClass('hidden');
}
// hide current overlay
if(isOverlay){
var overlayImg = $('#img_'+this.currentPage);
if(overlayImg.length) overlayImg.parent().addClass('hidden');
}
},
clear_context: function(){
this.clear_context_hide_all_images()
this.prevPageIndex = -1
this.lastRegularPage = -1
this.currentPage = -1
this.currentPageOverlay = false
this.prevPageOverlayIndex = -1
this.backStack = []
},
refresh: function(){
this.refresh_recreate_img(this.currentPage);
},
refresh_recreate_img: function(pageIndex,hideLast=false){
var page = story.pages[pageIndex];
// remove old
var img = $('#img_' + pageIndex);
if(img.length){
img.parent().remove();
img = null;
}
// create new img
var hasRetinaImages = $.inArray(2, story.resolutions) != -1;
var imageURI = hasRetinaImages && this.isHighDensityDisplay() ? page.image2x : page.image;
var isOverlay = page.type==="overlay";
var content = $('#content');
var contentOverlay = $('#content-overlay');
var highlight = this.highlightLinks;
var viewer = this;
img = $('<img/>', {
id : "img_"+pageIndex,
src : encodeURIComponent(files) + '/' + encodeURIComponent(imageURI),
usemap: '#map' + pageIndex,
}).attr('width', page.width).attr('height', page.height);
img.one('load', function() {
if(hideLast) viewer.refresh_hide_last_image(pageIndex);
img.appendTo(isOverlay?contentOverlay:content);
img.maphilight({
alwaysOn: highlight,
stroke: false,
fillColor: 'FFC400',
fillOpacity: 100.0/255
});
}).each(function() {
$(this).trigger('load');
});
},
next : function() {
if (this.hasNext(this.currentPage)){
const index = this.currentPage + 1;
this.goToPage(index);
}
},
previous : function() {
if (this.hasPrevious(this.currentPage)){
const index = this.currentPage - 1;
this.goToPage(index);
}
},
hasNext : function(pageIndex) {
return pageIndex < story.pages.length - 1;
},
hasPrevious : function(pageIndex) {
return pageIndex > 0;
},
toggleLinks : function() {
this.highlightLinks = !this.highlightLinks;
this.refresh_update_links_toggler(this.currentPage);
this.refresh_recreate_img(this.currentPage);
},
showHints : function(){
var text = story.pages[this.currentPage].annotations;
if(text==undefined) return;
alert(text);
},
hideNavbar : function() {
$('#nav').slideToggle('fast', function() {
$('#nav-hide').slideToggle('fast').removeClass('hidden');
});
},
showNavbar : function() {
$('#nav-hide').slideToggle('fast', function() {
$('#nav').slideToggle('fast');
}).addClass('hidden');
}
};
}
// ADD | REMOVE CLASS
// mode ID - getELementByID
// mode CLASS - getELementByClassName
function addRemoveClass(mode, el, cls) {
var el;
switch(mode) {
case 'class':
el = document.getElementsByClassName(el)[0];
break;
case 'id':
el = document.getElementById(el);
break;
}
if (el.classList.contains(cls)) {
el.classList.remove(cls)
} else {
el.classList.add(cls);
}
}
$(document).ready(function() {
viewer.initialize();
gallery.initialize();
if(!!('ontouchstart' in window) || !!('onmsgesturechange' in window)) {
$('body').removeClass('screen');
}
var hash = location.hash;
if(hash == null || hash.length == 0)
hash = '#';
hash = '#' + hash.replace( /^[^#]*#?(.*)$/, '$1' );
var page = decodeURIComponent(hash.substring(1));
viewer.goTo(page);
$(window).hashchange(function(e) {
var hash = location.hash;
if(hash == null || hash.length == 0)
hash = '#';
hash = '#' + hash.replace( /^[^#]*#?(.*)$/, '$1' );
var page = decodeURIComponent(hash.substring(1));
var pageIndex = viewer.getPageIndex(page);
if(viewer.urlLastIndex==pageIndex){
return
}
viewer.clear_context();
viewer.goTo(page,false);
viewer.urlLastIndex= pageIndex
});
$(window).hashchange();
});
| 27.346535 | 269 | 0.625851 |
6fc07359ed99121e5680d246a1ac687fd43f72ad | 157 | js | JavaScript | Redux/Store.js | arham-anees/studyAbroadApply | cbfe7cf989c3eb9d76ac1f9303cafb0d4d3ade89 | [
"MIT"
] | null | null | null | Redux/Store.js | arham-anees/studyAbroadApply | cbfe7cf989c3eb9d76ac1f9303cafb0d4d3ade89 | [
"MIT"
] | null | null | null | Redux/Store.js | arham-anees/studyAbroadApply | cbfe7cf989c3eb9d76ac1f9303cafb0d4d3ade89 | [
"MIT"
] | null | null | null | import { createStore } from "redux";
import tokenReducers from "./Reducers/TokenReducers";
const store = createStore(tokenReducers);
export default store;
| 22.428571 | 53 | 0.77707 |
6fc0e6ab7300e8d8ae4c05880f92d9736683c19e | 1,403 | js | JavaScript | scripts/freeman2.js | bhershkowitz/APW1 | 7f982d47240a11535d281fc7b50cd09fd1aa5341 | [
"CC0-1.0"
] | null | null | null | scripts/freeman2.js | bhershkowitz/APW1 | 7f982d47240a11535d281fc7b50cd09fd1aa5341 | [
"CC0-1.0"
] | null | null | null | scripts/freeman2.js | bhershkowitz/APW1 | 7f982d47240a11535d281fc7b50cd09fd1aa5341 | [
"CC0-1.0"
] | null | null | null | alert("i am programming")
var x = new [];
var y = new [];
var gameover=false;
var w=30, h=30, bs=20, dir=2, ax=12, ay=10;
var []dx={0,0,1,-1},dy={1,-1.0.0};
function setup(){
creatCanvas(600,600);
x.add(5);
y.add(5);
}
function draw(){
for(int i=0; i<w; i++){
line(i*bs,0,i*bs,height);
}
for(int i=0; i<h; i++){
line(0,i*bs,width,i*bs);
}
fill(0,255,0);
for (int i=0; i<x.size(); i++){
rect(x.get(i)*bs, y.get(i)*bs, bs, bs);
}
if (!gameover) {
fill(255, 0, 0);
rect(ax*bs, ay*bs, bs, bs);
if (frameCount%5==0) {
x.add(0, x.get(0) + dx[dir]);
y.add(0, y.get(0) + dy[dir]);
if(x.get(0) < 0 || y.get(0) < 0 || x.get(0) >= w || y.get(0) >= h)
gameover = true;
for(int i=1;i<x.size();i++)
if(x.get(0)==x.get(i)&&y.get(0)==y.get(i))
gameover=true;
if (x.get(0)==ax && y.get(0)==ay) {
ax = (int)random(0, w); ay = (int)random(0, h);
}
else { x.remove(x.size()-1); y.remove(y.size()-1); }
}
}else {
fill(0); textSize(30);
textAlign(CENTER);
text("GAME OVER. Press space",width/2,height/2);
if(keyPressed&&key==' ') {
x.clear(); y.clear(); x.add(5); y.add(5); gameover = false;
}
}
}
function keyPressed() { int nd=key=='s'? 0:(key=='w'?1:(key=='d'?2:(key=='a'?3:-1)));
if (nd!=-1&&(x.size()<=1||!(x.get(1)==x.get(0)+dx[nd]&&y.get(1)==y.get(0)+dy[nd]))) dir=nd;
}
| 25.981481 | 93 | 0.489665 |
6fc2d85f218d2b120c02e2cf3f05ada7eac292ac | 1,311 | js | JavaScript | validator/gitea.js | lzjyzq2/VuePress-Webhooks-Server | b8d118224562795de270fb64266e15cba7363c3e | [
"Apache-2.0"
] | 1 | 2021-06-16T14:19:02.000Z | 2021-06-16T14:19:02.000Z | validator/gitea.js | lzjyzq2/VuePress-Webhooks-Server | b8d118224562795de270fb64266e15cba7363c3e | [
"Apache-2.0"
] | null | null | null | validator/gitea.js | lzjyzq2/VuePress-Webhooks-Server | b8d118224562795de270fb64266e15cba7363c3e | [
"Apache-2.0"
] | null | null | null | const crypto = require('crypto');
const gitub = function ({
$config,
$logger
}, req) {
let flag = false;
let header = req.headers;
let body = req.body;
$logger.info("start validation");
if (header['x-gitea-event']&& header['content-type'].indexOf($config.options.type) != -1 && verift_repository(body,$config.options.git)) {
$logger.info("Delivery:" + header['x-gitea-delivery']);
let signature = verify_signature(JSON.stringify(body,null,2).trim(), $config.options.key, 'sha256');
if (signature === header['x-gitea-signature']&&body['secret']===$config.options.key) {
$logger.info("validation successful");
flag = true;
}
} else {
$logger.warning("request header does not match the configuration")
}
return flag;
};
const verify_signature = function (payload_body, secrectKey, method) {
let signature = crypto.createHmac(method, secrectKey)
.update(payload_body)
.digest()
.toString('hex');
return signature;
}
const verift_repository = function (body, git) {
let repository = body['repository'];
if (repository['ssh_url'] === git || repository['clone_url'] === git) {
return true;
}else{
return false;
}
}
module.exports = gitub; | 29.133333 | 142 | 0.614035 |
6fc2e778ad9535368f02577df0f2cc242551e929 | 1,286 | js | JavaScript | node_modules/styled-icons/boxicons-regular/Aperture/Aperture.js | TrueMarketing/trimtileandstone | 020756d8dcd4cb0540c375020cf5a11f0deb497c | [
"MIT"
] | null | null | null | node_modules/styled-icons/boxicons-regular/Aperture/Aperture.js | TrueMarketing/trimtileandstone | 020756d8dcd4cb0540c375020cf5a11f0deb497c | [
"MIT"
] | null | null | null | node_modules/styled-icons/boxicons-regular/Aperture/Aperture.js | TrueMarketing/trimtileandstone | 020756d8dcd4cb0540c375020cf5a11f0deb497c | [
"MIT"
] | null | null | null | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var React = tslib_1.__importStar(require("react"));
var StyledIconBase_1 = require("../../StyledIconBase");
exports.Aperture = React.forwardRef(function (props, ref) {
var attrs = {
"fill": "currentColor",
"xmlns": "http://www.w3.org/2000/svg",
};
return (React.createElement(StyledIconBase_1.StyledIconBase, tslib_1.__assign({ iconAttrs: attrs, iconVerticalAlign: "middle", iconViewBox: "0 0 24 24" }, props, { ref: ref }),
React.createElement("path", { d: "M12 2C6.579 2 2 6.579 2 12s4.579 10 10 10 10-4.579 10-10S17.421 2 12 2zm2.113 13H9.986l-1.723-3.094L10.202 9h3.736l1.871 3.062L14.113 15zM4 12c0-.953.186-1.87.508-2.727L7.696 15H4.61A7.757 7.757 0 014 12zm12.283-3h3.106A7.74 7.74 0 0120 12c0 .844-.143 1.66-.397 2.432L16.283 9zm1.905-2h-6.653l1.905-2.857c1.886.359 3.562 1.403 4.748 2.857zm-7.095-2.941L9.132 7H9v.197L7.17 9.942 5.65 7.214c1.3-1.703 3.249-2.895 5.443-3.155zM5.812 17h7.147l-1.709 2.961C9.084 19.748 7.141 18.63 5.812 17zm7.828 2.82l3.357-5.815 1.544 2.526c-1.154 1.642-2.901 2.854-4.901 3.289z", key: "k0" })));
});
exports.Aperture.displayName = 'Aperture';
exports.ApertureDimensions = { height: 24, width: 24 };
| 80.375 | 620 | 0.692068 |
6fc3541d6d0fbd038d23bca73ffb3e41c05969d9 | 8,837 | js | JavaScript | main/deploy/plugins/citnut/Kadeer/cunghoangdao.js | Alotritne/kb2apro | 84169b09b82f3cc02ca6ed506e1c7361c725a227 | [
"MIT"
] | null | null | null | main/deploy/plugins/citnut/Kadeer/cunghoangdao.js | Alotritne/kb2apro | 84169b09b82f3cc02ca6ed506e1c7361c725a227 | [
"MIT"
] | 1 | 2021-11-30T14:05:48.000Z | 2021-11-30T14:05:48.000Z | main/deploy/plugins/citnut/Kadeer/cunghoangdao.js | Alotritne/kb2apro | 84169b09b82f3cc02ca6ed506e1c7361c725a227 | [
"MIT"
] | null | null | null | const { getFile, asyncWait } = kb2abot.helpers;
const citnut = "==== 12 cung hoàng đạo ====\n 1. Ma Kết ♑️\n 2. Bảo Bình ♒️\n 3. Song Ngư ♓️\n 4. Bạch Dương ♈️\n 5. Kim Ngưu ♉️\n 6. Song Tử ♊️\n 7. Cự Giải ♋️\n 8. Sư tử ♌️\n 9. Xử Nữ ♍️\n10. Thiên Bìn h♎️\n11. Bọ Cạp ♏️\n12. Nhân Mã ♐️\n\nReply tin nhắn theo số để xem thêm về từng cung <3";
module.exports = {
keywords: ["12cung","cunghoangdao","12cunghoangdao"],
name: '12 cung hoàng đạo ( no prefix )',
description: 'plugin của Hoàng Hải Long, dịch sang kb2abot plugin bởi Kadeer(Code by Citnut)',
guide: '',
childs: [],
permission: {'*': '*'},
datastoreDesign: {
account: {
global: {},
local: {},
},
thread: {
global: {},
local: {},
},
},
async onLoad() {},
hookType: 'non-command',
async onMessage(message, reply) {
let setting = this.storage.account.global.citSetting;
if (message.type != "message_reply") return;
//let message = await handleReply(message);
if (!setting.autorun) return;
if (message.type != "message_reply") return;
if (message.messageReply.body == citnut && message.messageReply.senderID == this.storage.account.global.console.bot.id) {
switch(message.body){
case "1":
fca.sendMessage({
body: "1. Ma Kết♑️( 22/12 – 19/1 )\n\nCon số may mắn trong ngày: 26, 89 (Tình cảm: Ma Kết luôn biện minh cho sự ngu dốt của mình vì vậy bạn đang vướng phải một số vấn đề nhỏ.Công việc: Bạn mất nhiều thời gian để cân bằng lại giữa công việc và tình cảm.Tiền bạc: Cung hoàng đạo này hiếm khi có tiền tiết kiệm).",
attachment: getFile(`./main/deploy/plugins/citnut/data/cunghoangdao/maket.jpg`)
}, message.threadID, message.messageID);
break;
case "2":
fca.sendMessage({
body: "2. Bảo Bình♒️( 20/1 – 18/2 )\n\nCon số may mắn trong ngày: 10, 78 (Tình cảm: Bảo Bình không muốn làm người khác mất mặt nên bạn đã chuẩn bị hết tâm lý từ ban đầu rồi.Công việc: Đừng vội trách cứ ai trong lúc này, bạn sẽ không biết đối diện với cấp trên ra sao đâu.Tiền bạc: Ai cũng cần tiền cả nên có vay phải có trả nhé).",
attachment: getFile(`./main/deploy/plugins/citnut/data/cunghoangdao/baobinh.jpg`)
}, message.threadID, message.messageID);
break;
case "3":
fca.sendMessage({
body: "3. Song Ngư♓️( 19/2 – 20/3 )\n\nCon số may mắn trong ngày: 22, 78 (Tình cảm: Song Ngư và người ấy không có sự thấu hiểu lẫn nhau nên lúc nào bạn cũng là người gây sự trước.Công việc: Trong công việc, nếu không muốn bị người khác để ý hãy làm tốt công việc của mình là được.Tiền bạc: Tạm thời đừng đầu tư bất cứ khoản gì nhé).",
attachment: getFile(`./main/deploy/plugins/citnut/data/cunghoangdao/songngu.jpg`)
}, message.threadID, message.messageID);
break;
case "4":
fca.sendMessage({
body: "4. Bạch Dương♈️( 21/3 – 19/4 )\n\nCon số may mắn trong ngày: 23, 56 (Tình cảm: Bạch Dương không có cách nào làm cho người ấy yêu mình trở lại được nên bạn cảm thấy rất bất mãn.Công việc: Cung hoàng đạo này không muốn bị người khác bắt thóp nên bạn đã chọn cách lừa đồng nghiệp.Tiền bạc: Hãy chi tiêu cho những việc thật sự cần thiết thay vì chi tiêu hoang phí như bây giờ nhé).",
attachment: getFile(`./main/deploy/plugins/citnut/data/cunghoangdao/bachduong.jpg`)
}, message.threadID, message.messageID);
break;
case "5":
fca.sendMessage({
body: "5. Kim Ngưu♉️( 20/4 – 20/5 )\n\nCon số may mắn trong ngày: 11, 67 (Tình cảm: Kim Ngưu thông minh nhạy bén bình thường đang bị lu mờ dần do một số thế lực từ gia đình của bạn.Công việc: Trong công việc, Kim Ngưu là người không có tiếng nói, bởi vậy bạn rất hay bị bắt nạt.Tiền bạc: Dù bạn có cẩn thận đến mấy cũng bị người khác lừa tiền mà thôi).",
attachment: getFile(`./main/deploy/plugins/citnut/data/cunghoangdao/kimnguu.jpg`)
}, message.threadID, message.messageID);
break;
case "6":
fca.sendMessage({
body: "6. Song Tử♊️( 21/5 – 21/6 )\n\nCon số may mắn trong ngày: 70, 99 (Tình cảm: Song Tử bị Sao Kim làm khó trong chuyện tình cảm nên dù có cố gắng đến mấy cũng không có được tình cảm của người khác.Công việc: Hôm nay chỉ vì những lời nói trong lúc xúc động mà cung hoàng đạo này đã khiến cho cấp dưới hiểu nhầm.Tiền bạc: Song Tử không muốn người khác vay tiền).",
attachment: getFile(`./main/deploy/plugins/citnut/data/cunghoangdao/songtu.jpg`)
}, message.threadID, message.messageID);
break;
case "7":
fca.sendMessage({
body: "7. Cự Giải♋️( 22/6 – 22/7)\n\nCon số may mắn trong ngày: 31, 68 (Tình cảm: Cự Giải vẫn bình yên sau những cơn sóng lớn mà không cần sợ một thể lực nào quấy phá cả.Công việc: Trong công việc, bạn không quá nhiệt tình nên cấp trên cũng đánh giá thấp sự chủ động của bạn.Tiền bạc: Cự Giải không muốn trả tiền người khác mà bạn chỉ muốn tiêu thôi).",
attachment: getFile(`./main/deploy/plugins/citnut/data/cunghoangdao/cugiai.jpg`)
}, message.threadID, message.messageID);
break;
case "8":
fca.sendMessage({
body: "8. Sư tử♌️( 24/7 – 22/8 )\n\nCon số may mắn trong ngày: 14, 88 (Tình cảm: Sư Tử trong ngày hôm nay cần tránh tiếp xúc với những người mới quen vì có thể họ sẽ đem lại nhiều bất lợi cho bạn đấy.Công việc: Trong công việc, Sư Tử đang dần làm quen với việc phải được và mất gì khi mình không lựa chọn đúng.Tiền bạc: Trong chuyện tiền bạc, cung hoàng đạo này khá sòng phẳng nên ai cũng thoải mái với bạn).",
attachment: getFile(`./main/deploy/plugins/citnut/data/cunghoangdao/sutu.jpg`)
}, message.threadID, message.messageID);
break;
case "9":
fca.sendMessage({
body: "9. Xử Nữ♍️( 24/8 – 22/9 )\n\nCon số may mắn trong ngày: 25, 90 (Tình cảm: Xử Nữ ngày càng mạnh mẽ là nhờ có Thường Cương tiếp sức.Công việc: Cung hoàng đạo này khá thông minh khi liên tục lựa chọn những phần việc phù hợp với mình.Tiền bạc: Xử Nữ quá tiết kiệm và không dám chi tiêu gì cho bản thân).",
attachment: getFile(`./main/deploy/plugins/citnut/data/cunghoangdao/xunu.jpg`)
}, message.threadID, message.messageID);
break;
case "10":
fca.sendMessage({
body: "10. Thiên Bình♎️( 23/9 – 22/10 )\n\nCon số may mắn trong ngày: 22, 45 (Tình cảm: Thiên Bình một khi đã dứt khoát trong chuyện tình cảm thì bạn sẽ không dính líu thêm một chút nào nữa.Công việc: Thiên Bình mong muốn những dự định của mình được thuận lợi.Tiền bạc: Cung hoàng đạo này biết chi tiêu tiết kiệm nên cũng có một khoản kha khá).",
attachment: getFile(`./main/deploy/plugins/citnut/data/cunghoangdao/thienbinh.jpg`)
}, message.threadID, message.messageID);
break;
case "11":
fca.sendMessage({
body: "11. Bọ Cạp♏️( 24/11 – 21/11 )\n\nCon số may mắn trong ngày: 34, 89 (Tình cảm: Bọ Cạp không muốn người khác hiểu nhầm về mối quan hệ của mình và người ấy nên bạn liên tục có những hành động rất khó hiểu.Công việc: Bọ Cạp không cần phải tỏ ra đáng thương đâu vì bạn làm gì cũng không che được mắt cấp trên đâu.Tiền bạc: Cung hoàng đạo này rất suy tính trong việc chi tiêu).",
attachment: getFile(`./main/deploy/plugins/citnut/data/cunghoangdao/bocap.jpg`)
}, message.threadID, message.messageID);
break;
case "12":
fca.sendMessage({
body: "12. Nhân Mã♐️( 22/11 – 21/12 )\n\nCon số may mắn trong ngày: 25, 60 (Tình cảm: Nhân Mã hôm nay rất thiếu suy nghĩ khi liên tục tin tưởng người ấy vượt qua rào cản với mình và có cuộc sống mới.Công việc: Chòm sao này rất mệt mỏi khi phải làm những chuyện trái với đạo đức nghề nghiệp.Tiền bạc: Nhân Mã không nên chi tiêu bừa bãi trong thời điểm này).",
attachment: getFile(`./main/deploy/plugins/citnut/data/cunghoangdao/nhanma.jpg`)
}, message.threadID, message.messageID);
break;
default:
fca.sendMessage("Djtconmemaynguvailon nhap 1-12 thoi <3 iu", message.threadID, message.messageID);
break
};
asyncWait(10000).then(() => {fca.unsendMessage(message.messageReply.messageID)})
};
if (setting.autorun != true || message.senderID == this.storage.account.global.console.bot.id) {
}else if (message.body.toLowerCase().indexOf("12 cung hoàng đạo") == 0 || (message.body.toLowerCase().indexOf("12 cung hoàng đạo") == 0)) {
fca.sendMessage({
body: citnut,
attachment: getFile("./main/deploy/plugins/citnut/data/cunghoangdao/12cunghoangdao.jpg")
}, message.threadID, message.messageID);
}
},
async onCall(message, reply) {
let setting = this.storage.account.global.citSetting;
if (!setting.run.cunghoangdao) {
reply(`plugin này đã bị tắt`)
}else {
fca.sendMessage({
body: citnut,
attachment: getFile("./main/deploy/plugins/citnut/data/cunghoangdao/12cunghoangdao.jpg")
}, message.threadID, message.messageID);
}
}
} | 66.94697 | 418 | 0.673871 |
6fc3be1134c876af3147652963036cdfdd1bbebe | 577 | js | JavaScript | client/src/modules/Auth/submodules/Reset/submodules/ResetSendmail/components/ResetSendmailModal/components/Footer.js | ita-social-projects/AED-Map | a24b43fc40379864842a34234ed843db3046042d | [
"MIT"
] | null | null | null | client/src/modules/Auth/submodules/Reset/submodules/ResetSendmail/components/ResetSendmailModal/components/Footer.js | ita-social-projects/AED-Map | a24b43fc40379864842a34234ed843db3046042d | [
"MIT"
] | 4 | 2021-03-10T05:05:30.000Z | 2022-02-26T22:40:08.000Z | client/src/modules/Auth/submodules/SignUp/submodules/SignUpSendmail/components/SignUpSendmailModal/components/Footer.js | ita-social-projects/AED-Map | a24b43fc40379864842a34234ed843db3046042d | [
"MIT"
] | 5 | 2021-06-15T21:37:04.000Z | 2022-02-10T18:52:20.000Z | import React from 'react';
import PropTypes from 'prop-types';
import { makeStyles } from '@material-ui/core/styles';
import { Typography } from '@material-ui/core';
const useStyles = makeStyles({
message: {
whiteSpace: 'pre-line'
}
});
const Footer = ({ success }) => {
const classes = useStyles();
return (
<Typography className={classes.message} variant="body2" color="primary" align="center">
{success}
</Typography>
);
};
Footer.defaultProps = {
success: ''
};
Footer.propTypes = {
success: PropTypes.string
};
export default Footer;
| 18.612903 | 91 | 0.660312 |
6fc3da0471815d0dd606bc8f2d3f53b8b79b7877 | 835 | js | JavaScript | src/components/contactus/contactus.js | jeremyamartins/portfoliosite | b9ab23397425a053ff0275a537fc49dd7a81f957 | [
"MIT"
] | null | null | null | src/components/contactus/contactus.js | jeremyamartins/portfoliosite | b9ab23397425a053ff0275a537fc49dd7a81f957 | [
"MIT"
] | 1 | 2022-01-08T03:07:20.000Z | 2022-01-08T03:07:20.000Z | src/components/contactus/contactus.js | jeremyamartins/portfoliosite | b9ab23397425a053ff0275a537fc49dd7a81f957 | [
"MIT"
] | null | null | null | import React, { Component } from 'react';
export default class ContactUs extends Component {
render() {
let resumeData = this.props.resumeData;
return (
<section id="contact">
<div className="row section-head">
<div className="ten columns">
<p className="lead">
Feel free to contact me for any work or suggestions below
</p>
</div>
</div>
<div className="row">
<aside className="eigth columns footer-widgets">
<div className="widget">
<h4>
<a href="https://www.linkedin.com/in/jeremy-martins-780912182/">Click Here to contact me via LinkedIn</a>
</h4>
</div>
</aside>
</div>
</section>
);
}
}
| 30.925926 | 123 | 0.505389 |
6fc48b1ea98768b0c0ddd0e64011e10e03581964 | 1,286 | js | JavaScript | CSS Advanced/lazy/lazy/gulpfile.js | MartinValchevv/Front-End-Development-2018 | cefdcbcd6741a1cd60a6f4109c3580771995edb5 | [
"MIT"
] | null | null | null | CSS Advanced/lazy/lazy/gulpfile.js | MartinValchevv/Front-End-Development-2018 | cefdcbcd6741a1cd60a6f4109c3580771995edb5 | [
"MIT"
] | null | null | null | CSS Advanced/lazy/lazy/gulpfile.js | MartinValchevv/Front-End-Development-2018 | cefdcbcd6741a1cd60a6f4109c3580771995edb5 | [
"MIT"
] | null | null | null | var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var $ = require('gulp-load-plugins')();
var path = {
SCSS_SRC : './scss/**/*.scss',
SCSS_DST : './css',
CSS_JKDST : './docs/css',
HTML_SRC : ['./*.html','./_post/*.*','./_layouts/*.*', './_includes/*.*'],
}
gulp.task('scss', function () {
gulp.src( path.SCSS_SRC )
.pipe($.sourcemaps.init())
.pipe($.sass())
.pipe($.autoprefixer({ browsers: ['last 2 versions'], cascade: false }))
.pipe($.size({ showFiles: true }))
.pipe($.csso())
.pipe($.size({ showFiles: true }))
.pipe($.sourcemaps.write('map'))
.pipe(gulp.dest( path.SCSS_DST ))
.pipe(gulp.dest( path.CSS_JKDST ))
.pipe(browserSync.stream({ match: '**/*.css' }))
;
});
gulp.task('jekyll', function () {
require('child_process').exec('jekyll build --baseurl=', {stdio: 'inherit'}, function(){
browserSync.reload();
});
});
gulp.task('serve', function() {
// browserSync.init({
// proxy: {
// target: "http://127.0.0.1:4000/"
// }
// });
//browserSync.init({
//server: {
//baseDir: "./docs/"
//}
//});
gulp.watch(path.SCSS_SRC, ['scss']);
// gulp.watch(path.HTML_SRC, ['jekyll']);
gulp.watch(path.HTML_SRC).on('change', browserSync.reload);
});
gulp.task('default', ['scss','jekyll','serve']);
| 22.561404 | 89 | 0.583981 |
6fc50a5121b6a5701e31dbd2d144d943b7a75bfe | 643 | js | JavaScript | documentation-site/static/examples/radio/basic.js | jh3y/baseui | c56098a61219393cd2b00278b7d324a1c1d9f974 | [
"MIT"
] | null | null | null | documentation-site/static/examples/radio/basic.js | jh3y/baseui | c56098a61219393cd2b00278b7d324a1c1d9f974 | [
"MIT"
] | null | null | null | documentation-site/static/examples/radio/basic.js | jh3y/baseui | c56098a61219393cd2b00278b7d324a1c1d9f974 | [
"MIT"
] | null | null | null | import * as React from 'react';
import {Radio, RadioGroup} from 'baseui/radio';
export default class Stateless extends React.Component {
state = {value: null};
render() {
return (
<RadioGroup
name="radio group"
onChange={e => this.setState({value: e.target.value})}
value={this.state.value}
>
<Radio value="1">First</Radio>
<Radio
value="2"
description="This is a radio description, it gives a little more in-yo-face context about what this is."
>
Second
</Radio>
<Radio value="3">Third</Radio>
</RadioGroup>
);
}
}
| 25.72 | 114 | 0.573872 |
6fc5ceaa85460050365b8bf9de3eb8f5074f6880 | 17,520 | js | JavaScript | assets/js/cadastro-jogo/infos.js | AccentialLabs/WEB_GAME_ARCADY | 863d0fed4bde06ddfed2269c8c6bc995f4da0e40 | [
"MIT"
] | null | null | null | assets/js/cadastro-jogo/infos.js | AccentialLabs/WEB_GAME_ARCADY | 863d0fed4bde06ddfed2269c8c6bc995f4da0e40 | [
"MIT"
] | null | null | null | assets/js/cadastro-jogo/infos.js | AccentialLabs/WEB_GAME_ARCADY | 863d0fed4bde06ddfed2269c8c6bc995f4da0e40 | [
"MIT"
] | null | null | null | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
$(function() {
$("#btnCadastrarPremio").click(function() {
$('#premio-modal').modal('show');
});
/**
* Quando clicado em botão proximo na tela de infos
*/
$("#infos-proximo-passo").click(function() {
$("#loader").fadeIn(200);
var nome = $("#nome").val();
var usuario_responsavel_nome = $("#usuario_responsavel_nome").val();
var orientacoes = $("#orientacoes").val();
var regras = $("#regras").val();
$("#nomeJogo_H3").html(nome);
$(".error-insert-game").fadeOut(200);
$.ajax({
url: '../Jogo/cadastroSIMPLESNovoJogo',
type: 'POST',
data: {
nome: nome,
usuario_responsavel_nome: usuario_responsavel_nome,
orientacoes: orientacoes,
regras: regras
},
success: function(retorno) {
console.log(retorno);
$("#loader").fadeOut(200);
if (retorno !== 0) {
//caso SUCESSO
//iremos para seleção de jogadores que irão participar do jogo
$(".tab-pane").removeClass("active");
$("#jogadores").addClass("active");
} else {
//erro
$(".error-insert-game").fadeIn(200);
}
}
});
});
/**
* Quando clicado em botão proximo na tela de jogadoress
*/
$("#jogadores-proximo-passo").click(function() {
$("#loader").fadeIn(200);
var checkedValues = $('.jogadores-selecionados:checked').map(function() {
return this.value;
}).get();
console.log(checkedValues);
var jsonArray = JSON.stringify(checkedValues);
$.ajax({
url: '../Jogo/cadastroJogadoresJogo',
type: 'POST',
data: {
arrayJogadores: jsonArray
},
success: function(retorno) {
$("#loader").fadeOut(200);
//alert(retorno);
if (retorno !== 0) {
//caso SUCESSO
//iremos para seleção de jogadores que irão participar do jogo
$(".tab-pane").removeClass("active");
$("#interacoes").addClass("active");
} else {
//erro
}
}
});
});
/**
* Quando form CADASTRO DE DESAFIO for clicado
*/
$('#form-cadastra-desafio').on('submit', function(e) {
$("#loader").fadeIn(200);
e.preventDefault();
/**
* Capturamos a data INICIAL setada e verificamos se é menor que a existente
* @type @call;$@call;val
*/
var valorDataInicio = $("#form-cadastra-desafio input#datainicio").val();
var dataAtual_INICIO = $("#span_DataInicial").text();
var dataAtual = $.datepicker.formatDate('dd M yy', new Date(valorDataInicio));
$("#span_DataInicial").html(dataAtual);
/**
* Capturamos a data FINAL setada e verificamos se é menor que a existente
* @type @call;$@call;val
*/
var valorDataTermino = $("#form-cadastra-desafio input#datatermino").val();
var dataAtual_TERMINO = $("#span_DataFinal").text();
var dataAtual_FIM = $.datepicker.formatDate('dd M yy', new Date(valorDataTermino));
$("#span_DataFinal").html(dataAtual_FIM);
//CAPTURANDO PONTOS
var pontos = parseInt($("#form-cadastra-desafio input#ganha").val());
var pontosAtual = parseInt($("#span_Pontos").text());
var pontosSoma = pontos + pontosAtual;
$("#span_Pontos").html(pontosSoma);
$.ajax({
url: $(this).attr('action') || window.location.pathname,
type: "POST",
data: $(this).serialize(),
success: function(data) {
$("#loader").fadeOut(200);
$("#form-cadastra-desafio").trigger('reset');
$('#desafio-modal').modal('hide');
},
error: function(jXHR, textStatus, errorThrown) {
alert(errorThrown);
}
});
});
/**
* Quando form CADASTRO DE DESAFIO for clicado
*/
$('#form-cadastra-missao').on('submit', function(e) {
$("#loader").fadeIn(200);
e.preventDefault();
/**
* Capturamos a data INICIAL setada e verificamos se é menor que a existente
* @type @call;$@call;val
*/
var valorDataInicio = $("#form-cadastra-missao input#datainicio").val();
var dataAtual_INICIO = $("#span_DataInicial").text();
/**
* Verificamos se a data setada na Missao é menor que a data já setada no span do jogo
*/
if ((new Date(valorDataInicio).getTime() < new Date(dataAtual_INICIO).getTime())) {
var dataAtual = $.datepicker.formatDate('dd M yy', new Date(valorDataInicio));
$("#span_DataInicial").html(dataAtual);
}
/**
* Capturamos a data FINAL setada e verificamos se é menor que a existente
* @type @call;$@call;val
*/
var valorDataTermino = $("#form-cadastra-missao input#datatermino").val();
var dataAtual_TERMINO = $("#span_DataFinal").text();
if ((new Date(valorDataTermino).getTime() > new Date(dataAtual_TERMINO).getTime())) {
var dataAtual_FIM = $.datepicker.formatDate('dd M yy', new Date(valorDataTermino));
$("#span_DataFinal").html(dataAtual_FIM);
}
$.ajax({
url: $(this).attr('action') || window.location.pathname,
type: "POST",
data: $(this).serialize(),
success: function(data) {
$("#loader").fadeOut(200);
$("#form-cadastra-missao").trigger('reset');
$('#missao-modal').modal('hide');
},
error: function(jXHR, textStatus, errorThrown) {
alert(errorThrown);
}
});
});
/**
* Quando form CADASTRO DE DESAFIO for clicado
*/
$('#form-cadastra-acao').on('submit', function(e) {
$("#loader").fadeIn(200);
e.preventDefault();
/**
* Capturamos a data INICIAL setada e verificamos se é menor que a existente
* @type @call;$@call;val
*/
var valorDataInicio = $("#form-cadastra-acao input#datainicio").val();
var dataAtual_INICIO = $("#span_DataInicial").text();
/**
* Verificamos se a data setada na Missao é menor que a data já setada no span do jogo
*/
if ((new Date(valorDataInicio).getTime() < new Date(dataAtual_INICIO).getTime())) {
var dataAtual = $.datepicker.formatDate('dd M yy', new Date(valorDataInicio));
$("#span_DataInicial").html(dataAtual);
}
/**
* Capturamos a data FINAL setada e verificamos se é menor que a existente
* @type @call;$@call;val
*/
var valorDataTermino = $("#form-cadastra-acao input#datatermino").val();
var dataAtual_TERMINO = $("#span_DataFinal").text();
if ((new Date(valorDataTermino).getTime() > new Date(dataAtual_TERMINO).getTime())) {
var dataAtual_FIM = $.datepicker.formatDate('dd M yy', new Date(valorDataTermino));
$("#span_DataFinal").html(dataAtual_FIM);
}
$.ajax({
url: $(this).attr('action') || window.location.pathname,
type: "POST",
data: $(this).serialize(),
success: function(data) {
$("#loader").fadeOut(200);
$("form-cadastra-acao").trigger('reset');
$('#acao-modal').modal('hide');
},
error: function(jXHR, textStatus, errorThrown) {
alert(errorThrown);
}
});
});
/**
* Quando form CADASTRO DE DESAFIO for clicado
*/
$('#form-cadastra-programa').on('submit', function(e) {
$("#loader").fadeIn(200);
e.preventDefault();
/**
* Capturamos a data INICIAL setada e verificamos se é menor que a existente
* @type @call;$@call;val
*/
var valorDataInicio = $("#form-cadastra-programa input#datainicio").val();
var dataAtual_INICIO = $("#span_DataInicial").text();
/**
* Verificamos se a data setada na Missao é menor que a data já setada no span do jogo
*/
if ((new Date(valorDataInicio).getTime() < new Date(dataAtual_INICIO).getTime())) {
var dataAtual = $.datepicker.formatDate('dd M yy', new Date(valorDataInicio));
$("#span_DataInicial").html(dataAtual);
}
/**
* Capturamos a data FINAL setada e verificamos se é menor que a existente
* @type @call;$@call;val
*/
var valorDataTermino = $("#form-cadastra-programa input#datatermino").val();
var dataAtual_TERMINO = $("#span_DataFinal").text();
if ((new Date(valorDataTermino).getTime() > new Date(dataAtual_TERMINO).getTime())) {
var dataAtual_FIM = $.datepicker.formatDate('dd M yy', new Date(valorDataTermino));
$("#span_DataFinal").html(dataAtual_FIM);
}
$.ajax({
url: $(this).attr('action') || window.location.pathname,
type: "POST",
data: $(this).serialize(),
success: function(data) {
$("#loader").fadeOut(200);
$("form-cadastra-programa").trigger('reset');
$('#programa-modal').modal('hide');
},
error: function(jXHR, textStatus, errorThrown) {
alert(errorThrown);
}
});
});
$("#form-cadastra-premio").on('submit', function(e) {
$("#loader").fadeIn(200);
e.preventDefault();
$.ajax({
url: $(this).attr('action') || window.location.pathname,
type: "POST",
data: $(this).serialize(),
success: function(retorno) {
$("#loader").fadeOut(200);
$("form-cadastra-premio").trigger('reset');
// $('#premio-modal').modal('hide');
$("#fecha-modal-premio").click();
$(".modal-backdrop").fadeOut(200);
var name = $(".premio-input-nome").val();
var tipo = $(".premio-input-tipo").val();
var descricao = $(".premio-input-descricao").val();
// buscando tabela
var table = document.getElementById("tabelaPREMIOS");
var rowCount = table.rows.length;
//criando nova linha
var row = table.insertRow(rowCount);
//adicionando celular a tabela
var cell1 = row.insertCell(0);
var cell2 = row.insertCell(1);
var cell3 = row.insertCell(2);
var cell4 = row.insertCell(3);
//adicionando os valores às celulas
cell1.innerHTML = name;
cell2.innerHTML = tipo;
cell3.innerHTML = "<small>" + descricao + "</small>";
cell4.innerHTML = "<span class='glyphicon glyphicon-pause' id=" + retorno + " onclick='pausePremio(" + retorno + ", this)'></span>";
},
error: function(jXHR, textStatus, errorThrown) {
alert(errorThrown);
}
});
});
/**
* Ação para quando se fechar os modals dentro do cadastro de programa
*/
$("#myModalJogadores").on('hidden.bs.modal', function() {
setTimeout(
function() {
$("#btnAbreModal_PROGRAMA").click();
}, 400);
setTimeout(
function()
{
$(".modal-backdrop").removeClass("in");
$(".modal-backdrop").addClass("out");
//do something special
}, 2000);
});
/**
* Ação para quando se fechar os modals dentro do cadastro de programa
*/
$("#myModalEquipes").on('hidden.bs.modal', function() {
setTimeout(
function() {
$("#btnAbreModal_PROGRAMA").click();
}, 400);
setTimeout(
function()
{
$(".modal-backdrop").removeClass("in");
$(".modal-backdrop").addClass("out");
//do something special
}, 2000);
});
/**
* Ação para quando se fechar os modals dentro do cadastro de programa
*/
$("#myModalPersonagens").on('hidden.bs.modal', function() {
setTimeout(
function() {
$("#btnAbreModal_PROGRAMA").click();
}, 400);
setTimeout(
function()
{
$(".modal-backdrop").removeClass("in");
$(".modal-backdrop").addClass("out");
//do something special
}, 2000);
});
$(".menu-tab-premios").click(function() {
$.ajax({
url: '../Jogo/carregaPremiosDinamicamente',
type: 'POST',
data: {},
success: function(retorno) {
console.log(retorno);
// alert(retorno);
}
});
});
/**
* Função insere dinamicamente uma linha à tabela de Prêmios
$("#tabelaPREMIOS").click(function() {
var name = $(".premio-input-nome").val();
var tipo = $(".premio-input-tipo").val();
var descricao = $(".premio-input-descricao").val();
// buscando tabela
var table = document.getElementById("tabelaPREMIOS");
var rowCount = table.rows.length;
//criando nova linha
var row = table.insertRow(rowCount);
//adicionando celular a tabela
var cell1 = row.insertCell(0);
var cell2 = row.insertCell(1);
var cell3 = row.insertCell(2);
//adicionando os valores às celulas
cell1.innerHTML = name;
cell2.innerHTML = tipo;
cell3.innerHTML = descricao;
}); */
$(".play-premio").click(function() {
$("#loader").fadeIn(200);
var id = $(this).attr('id');
var element = $(this);
$.ajax({
url: '../Jogo/playPremio',
type: 'POST',
data: {id: id},
success: function(retorno) {
console.log(retorno);
// alert(retorno);
$(element).removeClass("glyphicon-play");
$(element).removeClass("play-premio");
$(element).addClass("glyphicon-pause");
$(element).addClass("pause-premio");
$("#loader").fadeOut(200);
}
});
});
$(".pause-premio").click(function() {
$("#loader").fadeIn(200);
var id = $(this).attr('id');
var element = $(this);
$.ajax({
url: '../Jogo/pausePremio',
type: 'POST',
data: {id: id},
success: function(retorno) {
console.log(retorno);
$(element).removeClass("glyphicon-pause");
$(element).removeClass("pause-premio");
$(element).addClass("glyphicon-play");
$(element).addClass("play-premio");
$("#loader").fadeOut(200);
//alert(retorno);
}
});
});
$(".trash-premio").click(function() {
$("#loader").fadeIn(200);
var id = $(this).attr('id');
var element = $(this);
$.ajax({
url: '../Jogo/trashPremio',
type: 'POST',
data: {id: id},
success: function(retorno) {
console.log(retorno);
var tr = $(element).closest('tr');
tr.css("opacity", "0.5");
tr.fadeOut(400, function() {
tr.remove();
});
$("#loader").fadeOut(200);
}
});
});
$(".busca-premios").click(function() {
$("#loader").fadeIn(200);
$.ajax({
url: '../Jogo/buscaPremiosCadastrados_PORJOGO',
type: 'POST',
data: {},
success: function(retorno) {
console.log(retorno);
//alert(retorno);
$("#recebe-table-premios").html(retorno);
$("#loader").fadeOut(200);
$("#lista-premios-modal").modal('show');
}
});
});
});
function pausePremio(id, element) {
$("#loader").fadeIn(200);
$.ajax({
url: '../Jogo/pausePremio',
type: 'POST',
data: {id: id},
success: function(retorno) {
console.log(retorno);
$(element).removeClass("glyphicon-pause");
$(element).addClass("glyphicon-play");
$(element).addClass("play-premio");
$("#loader").fadeOut(200);
//alert(retorno);
}
});
}
| 31.06383 | 149 | 0.494692 |
6fc5e6e93cae31acffdceaf9df624d862c3f10bf | 4,730 | js | JavaScript | dist/modules/index.js | onokumus/onoffcanvas | 583a091c475bc1d07af85e80cca3357db4ef623b | [
"MIT"
] | 26 | 2017-03-08T13:29:23.000Z | 2021-01-24T13:36:30.000Z | dist/modules/index.js | onokumus/onoffcanvas | 583a091c475bc1d07af85e80cca3357db4ef623b | [
"MIT"
] | 4 | 2017-03-10T06:24:09.000Z | 2019-01-11T11:02:49.000Z | dist/modules/index.js | onokumus/onoffcanvas | 583a091c475bc1d07af85e80cca3357db4ef623b | [
"MIT"
] | 4 | 2017-11-16T01:17:12.000Z | 2020-09-04T00:50:06.000Z | import { ClassName, EventName, OcDefault, Selector, } from "./constants";
import { isElement, selectorArray, uniqueArr } from "./util";
/**
*
* @export
* @class OnoffCanvas
*/
export default class OnoffCanvas {
/**
* Creates an instance of OnoffCanvas.
*
* @constructor
* @param {Element | string} element
* @param {IOCDefault} [options]
* @memberof OnoffCanvas
*/
constructor(element, options) {
this.element = isElement(element)
? element
: document.querySelector(element);
this.config = Object.assign(Object.assign({}, OcDefault), options);
this.triggerElements = [].slice.call(document.querySelectorAll(`${Selector.DATA_TOGGLE}[href="#${this.element.id}"],
${Selector.DATA_TOGGLE}[data-target="#${this.element.id}"]`));
this.addAriaExpanded(this.triggerElements);
this.triggerElements.forEach((el) => {
el.addEventListener("click", (event) => {
const eventTarget = event.target;
if (eventTarget && eventTarget.tagName === "A") {
event.preventDefault();
}
this.toggle();
});
});
this.drawer = document.createElement("div");
this.drawer.classList.add("onoffcanvas-drawer");
}
static attachTo(element, options) {
return new OnoffCanvas(element, options);
}
/**
* Auto init all OnoffCanvas elements
*
* @static
* @param {boolean} [escKey]
* @memberof OnoffCanvas
*/
static autoinit(options = OcDefault) {
const ocNodeList = document.querySelectorAll(`${Selector.DATA_TOGGLE}`);
const ocListArr = [].slice.call(ocNodeList);
const selectorArr = selectorArray(ocListArr);
const newOcArr = uniqueArr(selectorArr);
// eslint-disable-next-line no-restricted-syntax
for (const element of newOcArr) {
OnoffCanvas.attachTo(element, options);
}
}
on(event, handle) {
this.listen(event, handle);
return this;
}
/**
* Show/Hide OnoffCanvas element
*
* @returns {void}
* @memberof OnoffCanvas
*/
toggle() {
if (this.element.classList.contains(ClassName.SHOW)) {
this.hide();
}
else {
this.show();
}
}
/**
* Show OnoffCanvas element
*
* @returns {void}
* @memberof OnoffCanvas
*/
show() {
if (this.element.classList.contains(ClassName.SHOW)) {
return;
}
this.element.classList.add(ClassName.SHOW);
this.addAriaExpanded(this.triggerElements);
this.emit(EventName.SHOW, this.element);
if (this.config.createDrawer) {
document.documentElement.appendChild(this.drawer);
this.drawer.classList.add("is-open");
this.drawer.addEventListener("click", this.hide.bind(this));
}
if (this.config.hideByEsc) {
window.addEventListener("keydown", (event) => {
if (event.keyCode === 27) {
this.hide();
}
});
}
}
/**
* Hide OnoffCanvas element
*
* @returns {void}
* @memberof OnoffCanvas
*/
hide() {
if (!this.element.classList.contains(ClassName.SHOW)) {
return;
}
if (this.config.createDrawer) {
this.drawer.classList.remove("is-open");
this.drawer.removeEventListener("click", this.hide.bind(this));
document.documentElement.removeChild(this.drawer);
}
this.element.classList.remove(ClassName.SHOW);
this.addAriaExpanded(this.triggerElements);
this.emit(EventName.HIDE, this.element);
}
listen(event, handle) {
this.element.addEventListener(event, handle, false);
return this;
}
emit(evtType, target, shouldBubble = false) {
let evt;
if (typeof CustomEvent === "function") {
evt = new CustomEvent(evtType, {
bubbles: shouldBubble,
});
}
else {
evt = document.createEvent("CustomEvent");
evt.initCustomEvent(evtType, shouldBubble, false, target);
}
this.element.dispatchEvent(evt);
return this;
}
addAriaExpanded(triggerElements) {
const isOpen = this.element.classList.contains(ClassName.SHOW);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
Array.prototype.forEach.call(triggerElements, (el, i) => {
el.setAttribute("aria-expanded", isOpen ? "true" : "false");
});
}
}
| 32.39726 | 124 | 0.567653 |
6fc634a2619a7facb7a5c85e5db7504954f2e356 | 313 | js | JavaScript | src/SidebarOption.js | Sesmose/spoti-clone | 465e8bcfa186b10902f79f7ce733eeed9cfeebfc | [
"BSD-Source-Code"
] | null | null | null | src/SidebarOption.js | Sesmose/spoti-clone | 465e8bcfa186b10902f79f7ce733eeed9cfeebfc | [
"BSD-Source-Code"
] | null | null | null | src/SidebarOption.js | Sesmose/spoti-clone | 465e8bcfa186b10902f79f7ce733eeed9cfeebfc | [
"BSD-Source-Code"
] | null | null | null | import React from "react";
import "./SidebarOption.css";
function SidebarOption({ option = "test", Icon }) {
return (
<div className="sidebarOption">
{Icon && <Icon className="sidebarOption__icon" />}
{Icon ? <h4>{option}</h4> : <p>{option}</p>}
</div>
);
}
export default SidebarOption; | 24.076923 | 56 | 0.623003 |
6fc65d317cde8ade1ce16b2880226e546c18fd70 | 875 | js | JavaScript | src/models/treeContract.model.js | chungvux/nodedemo | 49b0f726d8147062362d3e09f73a088c19086866 | [
"MIT"
] | null | null | null | src/models/treeContract.model.js | chungvux/nodedemo | 49b0f726d8147062362d3e09f73a088c19086866 | [
"MIT"
] | null | null | null | src/models/treeContract.model.js | chungvux/nodedemo | 49b0f726d8147062362d3e09f73a088c19086866 | [
"MIT"
] | null | null | null | const mongoose = require('mongoose');
const treeSchema = new mongoose.Schema(
{
ID: {
type: Number,
required: true,
unique: [true, 'ID is taken.'],
},
Wallet: {
type: Array,
default: [],
},
Address: {
type: String,
default: null,
},
Email: {
type: String,
default: null,
},
Password: {
type: String,
default: null,
},
Jwt_Token: {
type: String,
default: null,
},
Blocked: {
type: Boolean,
default: false,
},
Username: {
type: String,
default: null,
},
Battle: {
type: Boolean,
default: false,
},
Point: {
type:Number,
default:0
},
ListFriend:{
type:Array,
}
},
{ timestamps: true }
);
module.exports = mongoose.model('tree_contract', treeSchema);
| 16.203704 | 61 | 0.492571 |
6fc6dcbc29905bfd13eedd18c84b8a03d967d69a | 421 | js | JavaScript | web/resources/smartTable/Component.js | gregorwolf/hana-xsa-opensap-hana7 | a87a88514f18c7f2261e8bfc17495d8329d280f7 | [
"Adobe-2006"
] | 72 | 2018-12-26T16:02:14.000Z | 2019-12-09T09:25:04.000Z | web/resources/smartTable/Component.js | gregorwolf/hana-xsa-opensap-hana7 | a87a88514f18c7f2261e8bfc17495d8329d280f7 | [
"Adobe-2006"
] | 2 | 2020-09-04T18:26:02.000Z | 2020-09-18T19:47:20.000Z | web/resources/smartTable/Component.js | gregorwolf/hana-xsa-opensap-hana7 | a87a88514f18c7f2261e8bfc17495d8329d280f7 | [
"Adobe-2006"
] | 66 | 2018-12-10T15:13:07.000Z | 2019-12-04T21:10:44.000Z | jQuery.sap.declare("sap.openSAP.smarttable.Component");
sap.ui.getCore().loadLibrary("sap.ui.generic.app");
jQuery.sap.require("sap.ui.generic.app.AppComponent");
sap.ui.core.UIComponent.extend("sap.openSAP.smarttable.Component", {
// sap.ui.generic.app.AppComponent.extend("sap.openSAP.smarttable.Component", {
metadata: {
manifest: "json",
dependencies: {
libs: [
"sap.m", "sap.ui.comp"
]
}
}
});
| 24.764706 | 81 | 0.693587 |
6fc723966c5ee01e7bb142d541f6fee84c197eb9 | 2,568 | js | JavaScript | build/translations/gl.js | tillable/ckeditor5-build-classic | 792b3ea458016f631d67f62d879e8872e35f9df3 | [
"MIT"
] | null | null | null | build/translations/gl.js | tillable/ckeditor5-build-classic | 792b3ea458016f631d67f62d879e8872e35f9df3 | [
"MIT"
] | null | null | null | build/translations/gl.js | tillable/ckeditor5-build-classic | 792b3ea458016f631d67f62d879e8872e35f9df3 | [
"MIT"
] | null | null | null | (function(d){d['gl']=Object.assign(d['gl']||{},{a:"Non é posíbel cargar o ficheiro:",b:"Table toolbar",c:"Image toolbar",d:"Aliñar á esquerda",e:"Aliñar á dereita",f:"Centrar horizontalmente",g:"Xustificado",h:"Aliñamento do texto",i:"Text alignment toolbar",j:"Tamaño da letra",k:"Predeterminada",l:"Diminuta",m:"Pequena",n:"Grande",o:"Enorme",p:"Subliñado",q:"Itálica",r:"Inserir imaxe ou ficheiro",s:"Negra",t:"Cita de bloque",u:"Ligar",v:"Lista numerada",w:"Lista viñeteada",x:"trebello multimedia",y:"Inserir elemento multimedia",z:"O URL non debe estar baleiro.",aa:"Este URL multimedia non é compatible.",ab:"Inserir táboa",ac:"Cabeceira de columna",ad:"Inserir columna á esquerda",ae:"Inserir columna á dereita",af:"Eliminar columna",ag:"Columna",ah:"Cabeceira de fila",ai:"Inserir fila embaixo",aj:"Inserir fila enriba",ak:"Eliminar fila",al:"Fila",am:"Combinar cela cara arriba",an:"Combinar cela cara a dereita",ao:"Combinar cela cara abaixo",ap:"Combinar cela cara a esquerda",aq:"Dividir cela en vertical",ar:"Dividir cela en horizontal",as:"Combinar celas",at:"Aumentar sangrado",au:"Reducir sangrado",av:"Escolla o título",aw:"Título",ax:"Trebello de imaxe",ay:"Imaxe a tamaño completo",az:"Lado da imaxe",ba:"Imaxe aliñada á esquerda",bb:"Imaxe centrada horizontalmente",bc:"Imaxe aliñada á dereita",bd:"Introduza o título da imaxe",be:"Inserir imaxe",bf:"Fallou o envío",bg:"Envío en proceso",bh:"Widget toolbar",bi:"Non foi posíbel obter o URL da imaxe redimensionada.",bj:"Non foi posíbel seleccionar a imaxe redimensionada",bk:"Non foi posíbel inserir a imaxe na posición actual.",bl:"Fallou a inserción da imaxe",bm:"Parágrafo",bn:"Título 1",bo:"Título 2",bp:"Título 3",bq:"Título 4",br:"Título 5",bs:"Título 6",bt:"Cambiar o texto alternativo da imaxe",bu:"Dropdown toolbar",bv:"Editor toolbar",bw:"Editor de texto mellorado",bx:"Editor de texto mellorado, %0",by:"%0 de %1",bz:"Anterior",ca:"Seguinte",cb:"Gardar",cc:"Cancelar",cd:"Texto alternativo",ce:"Desfacer",cf:"Refacer",cg:"Pegue o URL do medio na entrada.",ch:"Consello: Pegue o URL no contido para incrustalo máis rápido.",ci:"URL multimedia",cj:"Abrir nunha nova lapela",ck:"Descargábel",cl:"Desligar",cm:"Editar a ligazón",cn:"Abrir a ligazón nunha nova lapela",co:"Esta ligazón non ten URL",cp:"URL de ligazón",cq:"Negro",cr:"Gris fume",cs:"Gris",ct:"Gris claro",cu:"Branco",cv:"Vermello",cw:"Laranxa",cx:"Amarelo",cy:"Verde claro",cz:"Verde",da:"Augamariña",db:"Turquesa",dc:"Azul claro",dd:"Azul",de:"Púrpura"})})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})); | 2,568 | 2,568 | 0.73715 |
6fc72689d0acbc80b1698b8ed59118e5b1c9a863 | 610 | js | JavaScript | src/components/TableNav.js | tjvonbr/personal_split_the_bill_front_end | c1266ff575f098ec6cfe1cf8299ef80edc3da796 | [
"MIT"
] | null | null | null | src/components/TableNav.js | tjvonbr/personal_split_the_bill_front_end | c1266ff575f098ec6cfe1cf8299ef80edc3da796 | [
"MIT"
] | 5 | 2020-09-07T10:12:12.000Z | 2022-02-26T18:17:52.000Z | src/components/TableNav.js | tjvonbr/personal_split_the_bill_fe | c1266ff575f098ec6cfe1cf8299ef80edc3da796 | [
"MIT"
] | null | null | null | import React from "react";
import styled from "styled-components";
import TableImage from '../img/table_with_view.jpg';
// const Header = styled.header`
// width: 100%;
// background: #56baed;
// height: 60px;
// `
// const Nav = styled.nav`
// display: flex;
// align-content: center;
// align-items: center;
// height: 100%;
// padding: 0 1rem;
// `
const Image = styled.img`
object-fit: cover;
width: 100%;
height: 300px;
margin-bottom: -4px;
`
const TableNav = () => {
return (
<>
<Image src={TableImage} alt='table' />
</>
);
};
export default TableNav; | 16.486486 | 52 | 0.6 |
6fc7b6f73259ab74c9fa146a9ae9ceded056cb4a | 1,353 | js | JavaScript | webpack.config.js | georapbox/webpack-library-starter-k | 255b76d819d2a23cace910b8f4569a655be5eac1 | [
"MIT"
] | 17 | 2018-11-08T12:40:09.000Z | 2021-09-13T16:04:23.000Z | webpack.config.js | georapbox/webpack-library-starter-k | 255b76d819d2a23cace910b8f4569a655be5eac1 | [
"MIT"
] | null | null | null | webpack.config.js | georapbox/webpack-library-starter-k | 255b76d819d2a23cace910b8f4569a655be5eac1 | [
"MIT"
] | 8 | 2018-06-14T05:02:27.000Z | 2021-03-15T11:50:59.000Z | const webpack = require('webpack');
const mode = require('yargs').argv.mode;
const libraryTarget = require('yargs').argv['output-library-target'];
const pkg = require('./package.json');
const libraryName = 'Library';
const banner = `${pkg.name}
${pkg.description}\n
@version v${pkg.version}
@author ${pkg.author}
@homepage ${pkg.homepage}
@repository ${pkg.repository.url}`;
const plugins = [
new webpack.BannerPlugin(banner)
];
module.exports = {
entry: `${__dirname}/index.js`,
devtool: 'source-map',
output: {
path: `${__dirname}/${libraryTarget === 'umd' ? 'dist' : 'lib'}`,
filename: mode === 'development' ? `${libraryName}.js` : `${libraryName}.min.js`,
library: libraryName,
libraryTarget: libraryTarget || 'umd',
globalObject: '(typeof self !== \'undefined\' ? self : this)', // TODO Hack (for Webpack 4+) to enable create UMD build which can be required by Node without throwing error for window being undefined (https://github.com/webpack/webpack/issues/6522)
umdNamedDefine: true
},
module: {
rules: [
{
test: /(\.jsx|\.js)$/,
loader: 'babel-loader',
exclude: /(node_modules|bower_components)/
},
{
test: /(\.jsx|\.js)$/,
loader: 'eslint-loader',
exclude: /(node_modules|bower_components)/
}
]
},
plugins: plugins
};
| 29.413043 | 252 | 0.628234 |
6fc80a3db8ac264f848f4072c3981ef6b96a383b | 6,567 | js | JavaScript | lib/wrapper.js | EdgeVerve/oe-personalization | 1d4b7d63f2465ec2af252a9dfba051e04023bb71 | [
"MIT"
] | null | null | null | lib/wrapper.js | EdgeVerve/oe-personalization | 1d4b7d63f2465ec2af252a9dfba051e04023bb71 | [
"MIT"
] | 2 | 2020-05-04T19:13:00.000Z | 2020-10-07T12:23:59.000Z | lib/wrapper.js | EdgeVerve/oe-personalization | 1d4b7d63f2465ec2af252a9dfba051e04023bb71 | [
"MIT"
] | null | null | null | const loopback = require('loopback');
const DataSource = loopback.DataSource;
const DataAccessObject = DataSource.DataAccessObject;
// const daoutils = require('loopback-datasource-juggler/lib/utils');
const util = require('oe-cloud/lib/common/util');
var _ = require('lodash');
const log = require('oe-logger')('oe-personalization');
var _createOptionsFromRemotingContext = loopback.findModel('Model').createOptionsFromRemotingContext;
function _newCreateOptionsFromRemotingContext(ctx) {
var options = _createOptionsFromRemotingContext.call(this, ctx);
var callContext = null;
if (ctx && ctx.req && ctx.req.callContext && ctx.req.callContext.ctx) {
callContext = ctx.req.callContext;
}
// options.ctx = {tenantId: 'default'};
if (!options.ctx) options.ctx = {};
if (!callContext) { return options; }
for (var p in callContext.ctx) {
if (callContext.ctx.hasOwnProperty(p) && !options.ctx.hasOwnProperty(p)) {
options.ctx[p] = callContext.ctx[p];
}
}
if (callContext.ctxWeights) {
if (!options.ctxWeights) options.ctxWeights = {};
for (p in callContext.ctxWeights) {
if (callContext.ctxWeights.hasOwnProperty(p) && !options.ctxWeights.hasOwnProperty(p)) {
options.ctxWeights[p] = callContext.ctxWeights[p];
}
}
}
return options;
}
if (_createOptionsFromRemotingContext) {
for (var m in loopback.registry.modelBuilder.models) {
if (loopback.registry.modelBuilder.models.hasOwnProperty(m)) {
loopback.registry.modelBuilder.models[m].createOptionsFromRemotingContext = _newCreateOptionsFromRemotingContext;
}
}
}
function byIdQuery(m, id) {
var pk = util.idName(m);
var query = {
where: {}
};
query.where[pk] = id;
return query;
}
function removeIdValue(m, data) {
delete data[util.idName(m)];
return data;
}
function findByIdAndCreate(self, id, data, options, cb) {
if (!id) {
return self.create(data, options, cb);
}
var q = byIdQuery(self, id);
var flagOptionsModified = false;
if (typeof options.fetchAllScopes === 'undefined') {
options.fetchAllScopes = true;
flagOptionsModified = true;
}
self.find(q, options, function (err, r) {
if (flagOptionsModified) {
delete options.fetchAllScopes;
}
if (err) {
log.error(options, 'Error while finding record. ', err);
return cb(err);
}
if (r && r.length >= 1) {
var inst = r[0];
var properties = self.definition.properties;
for (var p in properties) {
if (properties.hasOwnProperty(p) && p.toLowerCase() !== 'id' && p.toLowerCase() !== 'scope' && p.toLowerCase() !== '_scope'
&& !data.hasOwnProperty(p)) {
data[p] = inst[p];
}
}
var resultScope = (inst.scope && inst.scope.__data) || inst.scope || null;
data.scope = data.scope || null;
if (!_.isEqual(data.scope, resultScope)) {
if (self.definition.settings.idInjection) {
removeIdValue(self, data);
return self.create(data, options, cb);
}
var error = new Error({ name: 'Data Error', message: 'Manual scope change update with same id not allowed', code: 'DATA_ERROR_023', type: 'ScopeChangeWithSameId', retriable: false, status: 422 });
return cb(error);
}
return cb('NO-ACTION', inst);
}
// removeIdValue(self, data);
return self.create(data, options, cb);
});
}
function callUpdateOnModel(self, actualFn, args) {
var model = self;
var ary = [];
if (args.hasOwnProperty('id')) {
ary.push(args.id);
}
ary.push(args.data);
ary.push(args.options);
var optionsIndex = ary.length;
ary.push(args.cb);
if (self.constructor.name !== 'Function') {
model = self.constructor;
}
if (!model.definition.settings.mixins || !model.definition.settings.mixins.DataPersonalizationMixin) {
return actualFn.apply(self, ary);
}
var id = args.id || util.getIdValue(model, args.data);
var dataScope = args.data.scope;
if (!id) {
return model.create.apply(model, ary);
}
// var q = byIdQuery(model, id);
var newOptions = args.options;
if (!newOptions) {
newOptions = {};
}
// var saveContext = args.options.ctx;
if (!newOptions.ctx) {
newOptions.ctx = {};
}
// var newCtx = Object.assign({}, args.options);
// if (!newCtx.ctx) {
// newCtx.ctx = {};
// }
// design break. should not use autoscope here.
const modelSettings = model.definition.settings;
const autoScope = modelSettings.autoscope;
if (dataScope) {
Object.keys(dataScope).forEach(function (k) {
// must not be allowed to change autoscope fields
if (autoScope && autoScope.indexOf && autoScope.indexOf(k) >= 0) {
return;
}
newOptions.ctx[k] = this[k];
}, dataScope);
}
findByIdAndCreate(model, id, args.data, newOptions, function (err, r) {
// newOptions.ctx = saveContext;
if (err === 'NO-ACTION') {
ary[optionsIndex - 1] = newOptions;
return actualFn.apply(self, ary);
}
if (err) {
return args.cb(err);
}
return args.cb(err, r);
});
}
// this function is called for PUT by ID request
const _replaceById = DataAccessObject.replaceById;
DataAccessObject.replaceById = function replaceById(id, data, options, cb) {
var self = this;
if (!id) {
return _replaceById.call(self, id, data, options, cb);
}
return callUpdateOnModel(self, _replaceById, { id, data, options, cb });
};
// this function is called for PUT request.
const _replaceOrCreate = DataAccessObject.replaceOrCreate;
DataAccessObject.replaceOrCreate = DataAccessObject.updateOrCreate = function (data, options, cb) {
var self = this;
// var id = util.getIdValue(self, data);
return callUpdateOnModel(self, _replaceOrCreate, { data, options, cb });
};
const _updateAttributes = DataAccessObject.prototype.updateAttributes;
DataAccessObject.prototype.updateAttributes =
DataAccessObject.prototype.patchAttributes = function (data, options, cb) {
var self = this;
var idField = this.getIdName();
data[idField] = data[idField] || self[idField];
return callUpdateOnModel(self, _updateAttributes, { data, options, cb });
};
const _upsert = DataAccessObject.upsert;
DataAccessObject.updateOrCreate =
DataAccessObject.patchOrCreate =
DataAccessObject.upsert = function upsert(data, options, cb) {
var self = this;
// var id = util.getIdValue(self, data);
return callUpdateOnModel(self, function (data, opts, cb) {
return _upsert.call(self, data, opts, cb);
}, { data, options, cb });
};
| 31.123223 | 204 | 0.662251 |
6fc8605d3891f38dfe9f122a66a8a1a6091bc8aa | 1,535 | js | JavaScript | web-client/src/presenter/sequences/submitUpdateUserContactInformationSequence.js | ericsorenson/ef-cms | 23431f6d1e5c2f3d8d2b68c0936345cda77361fc | [
"CC0-1.0"
] | null | null | null | web-client/src/presenter/sequences/submitUpdateUserContactInformationSequence.js | ericsorenson/ef-cms | 23431f6d1e5c2f3d8d2b68c0936345cda77361fc | [
"CC0-1.0"
] | null | null | null | web-client/src/presenter/sequences/submitUpdateUserContactInformationSequence.js | ericsorenson/ef-cms | 23431f6d1e5c2f3d8d2b68c0936345cda77361fc | [
"CC0-1.0"
] | null | null | null | import { clearAlertsAction } from '../actions/clearAlertsAction';
import { setCurrentPageAction } from '../actions/setCurrentPageAction';
import { setShowModalFactoryAction } from '../actions/setShowModalFactoryAction';
import { setValidationAlertErrorsAction } from '../actions/setValidationAlertErrorsAction';
import { setValidationErrorsAction } from '../actions/setValidationErrorsAction';
import { setWaitingForResponseAction } from '../actions/setWaitingForResponseAction';
import { startShowValidationAction } from '../actions/startShowValidationAction';
import { startWebSocketConnectionAction } from '../actions/webSocketConnection/startWebSocketConnectionAction';
import { unsetWaitingForResponseAction } from '../actions/unsetWaitingForResponseAction';
import { updateUserContactInformationAction } from '../actions/updateUserContactInformationAction';
import { validateUserContactAction } from '../actions/validateUserContactAction';
export const submitUpdateUserContactInformationSequence = [
clearAlertsAction,
startShowValidationAction,
validateUserContactAction,
{
error: [setValidationErrorsAction, setValidationAlertErrorsAction],
success: [
setWaitingForResponseAction,
startWebSocketConnectionAction,
{
error: [
unsetWaitingForResponseAction,
setShowModalFactoryAction('WebSocketErrorModal'),
],
success: [
setCurrentPageAction('Interstitial'),
updateUserContactInformationAction,
],
},
],
},
];
| 43.857143 | 111 | 0.765472 |
6fc879bdfbdfdf6206cc55f08da450b882aa4f8a | 880 | js | JavaScript | server/honey/honey.route.js | stewartmcgown/honeyhole | 6b37c4e711f34dbf6d510b7b8cfc18b7bc8f15c8 | [
"MIT"
] | null | null | null | server/honey/honey.route.js | stewartmcgown/honeyhole | 6b37c4e711f34dbf6d510b7b8cfc18b7bc8f15c8 | [
"MIT"
] | null | null | null | server/honey/honey.route.js | stewartmcgown/honeyhole | 6b37c4e711f34dbf6d510b7b8cfc18b7bc8f15c8 | [
"MIT"
] | null | null | null | const express = require('express');
const validate = require('express-validation');
const paramValidation = require('../../config/param-validation');
const HoneyCtrl = require('./honey.controller');
const router = express.Router(); // eslint-disable-line new-cap
router.route('/')
/** GET /api/honey - Get list of honey */
.get(HoneyCtrl.list)
/** POST /api/honey - Create new honey */
.post(validate(paramValidation.createHoney), HoneyCtrl.create);
router.route('/:HoneyId')
/** GET /api/honey/:HoneyId - Get honey */
.get(HoneyCtrl.get)
/** PUT /api/honey/:HoneyId - Update honey */
.put(validate(paramValidation.updateHoney), HoneyCtrl.update)
/** DELETE /api/honey/:HoneyId - Delete honey */
.delete(HoneyCtrl.remove);
/** Load honey when API with HoneyId route parameter is hit */
router.param('HoneyId', HoneyCtrl.load);
module.exports = router;
| 30.344828 | 65 | 0.697727 |
6fc99b4d8e3ce25d567e979cd0de3c235f0f9f6c | 175 | js | JavaScript | src/utils/handleResponse.js | Refemi/refemi_front | 91dc0fe2b174832ef854ead7449143c5e22e4745 | [
"MIT"
] | 2 | 2022-01-18T07:13:30.000Z | 2022-01-20T14:35:15.000Z | src/utils/handleResponse.js | Refemi/refemi_front | 91dc0fe2b174832ef854ead7449143c5e22e4745 | [
"MIT"
] | 73 | 2021-12-16T22:03:10.000Z | 2022-03-29T10:14:56.000Z | src/utils/handleResponse.js | Refemi/refemi_front | 91dc0fe2b174832ef854ead7449143c5e22e4745 | [
"MIT"
] | 1 | 2021-12-25T20:41:55.000Z | 2021-12-25T20:41:55.000Z | export default function handleResponse(response = {}, status = 200) {
if (response.status !== status) {
throw response.error;
} else {
return response.data;
}
}
| 21.875 | 69 | 0.651429 |
6fc9fe909c1c976fc54c4ca1bee8780441dcb0ce | 5,936 | js | JavaScript | src/components/@vuexy/wizard/WizardIcons.js | granitebps/portfolio-react-admin | 1289338c38b6ab4a91b56a03800781d65b27393d | [
"MIT"
] | null | null | null | src/components/@vuexy/wizard/WizardIcons.js | granitebps/portfolio-react-admin | 1289338c38b6ab4a91b56a03800781d65b27393d | [
"MIT"
] | 14 | 2020-05-25T17:19:17.000Z | 2022-03-31T22:56:18.000Z | src/components/@vuexy/wizard/WizardIcons.js | granitebps/portfolio-react-admin | 1289338c38b6ab4a91b56a03800781d65b27393d | [
"MIT"
] | null | null | null | import React from "react";
import Wizard from "./WizardComponent";
import {
Form,
FormGroup,
Input,
Label,
CustomInput,
Row,
Col,
Card,
CardBody,
CardTitle,
CardHeader,
Button,
} from "reactstrap";
import Checkbox from "../checkbox/CheckboxesVuexy";
import { Check, Home, Briefcase, Image } from "react-feather";
class WizardIcons extends React.Component {
state = {
activeStep: 0,
steps: {
step_1: (
<Form className="form-horizontal">
<Row>
<Col md="6" sm="12">
<FormGroup>
<Label> First Name </Label>
<Input type="text" />
</FormGroup>
</Col>
<Col md="6" sm="12">
<FormGroup>
<Label> Last Name </Label>
<Input type="text" />
</FormGroup>
</Col>
<Col md="6" sm="12">
<FormGroup>
<Label> Email Name </Label>
<Input type="email" />
</FormGroup>
</Col>
<Col md="6" sm="12">
<FormGroup>
<Label> City Name </Label>
<CustomInput type="select" name="select" id="city">
<option>New York</option>
<option>Chicago</option>
<option>San Francisco</option>
<option>Boston</option>
</CustomInput>
</FormGroup>
</Col>
</Row>
<div className="wizard-actions d-flex justify-content-between">
<Button color="primary" disabled>
Prev
</Button>
<Button color="primary" onClick={() => this.handleActiveStep(1)}>
Next
</Button>
</div>
</Form>
),
step_2: (
<Form className="form-horizontal">
<Row>
<Col md="6" sm="12">
<FormGroup>
<Label> Proposal Title </Label>
<Input type="text" />
</FormGroup>
<FormGroup>
<Label> Job Title </Label>
<Input type="text" />
</FormGroup>
</Col>
<Col md="6" sm="12">
<FormGroup>
<Label> Proposal Title </Label>
<Input type="textarea" rows="5" />
</FormGroup>
</Col>
</Row>
<div className="wizard-actions d-flex justify-content-between">
<Button color="primary" onClick={() => this.handleActiveStep(0)}>
Prev
</Button>
<Button color="primary" onClick={() => this.handleActiveStep(2)}>
Next
</Button>
</div>
</Form>
),
step_3: (
<Form className="form-horizontal">
<Row>
<Col md="6" sm="12">
<FormGroup>
<Label> Event Name </Label>
<Input type="text" />
</FormGroup>
</Col>
<Col md="6" sm="12">
<FormGroup>
<Label> Event Location </Label>
<CustomInput type="select" name="select" id="location">
<option>New York</option>
<option>Chicago</option>
<option>San Francisco</option>
<option>Boston</option>
</CustomInput>
</FormGroup>
</Col>
<Col md="6" sm="12">
<FormGroup>
<Label> Event Status </Label>
<CustomInput type="select" name="select" id="status">
<option>Planning</option>
<option>In Process</option>
<option>Finished</option>
</CustomInput>
</FormGroup>
</Col>
<Col md="6" sm="12">
<FormGroup>
<Label> Event Status </Label>
<Label className="mr-2">Requirements :</Label>
<div className="stacked-checkbox">
<div className="d-inline-block mr-2">
<Checkbox
color="primary"
icon={<Check className="vx-icon" size={16} />}
label="Staffing"
defaultChecked={false}
/>
</div>
<div className="d-inline-block">
<Checkbox
color="primary"
icon={<Check className="vx-icon" size={16} />}
label="Catering"
defaultChecked={false}
/>
</div>
</div>
</FormGroup>
</Col>
</Row>
<div className="wizard-actions d-flex justify-content-between">
<Button color="primary" onClick={() => this.handleActiveStep(1)}>
Prev
</Button>
<Button color="primary" onClick={() => alert("Form Submitted")}>
Submit
</Button>
</div>
</Form>
),
},
};
handleActiveStep = (step) => {
this.setState({
activeStep: step,
});
};
render() {
const { steps } = this.state;
return (
<Card>
<CardHeader>
<CardTitle>Wizard with Icons</CardTitle>
</CardHeader>
<CardBody>
<Wizard
activeStep={this.state.activeStep}
// eslint-disable-next-line react/jsx-key
stepsTitle={[
<Home key={0} size={20} />,
<Briefcase key={1} size={20} />,
<Image key={2} size={20} />,
]}
stepsContent={[steps.step_1, steps.step_2, steps.step_3]}
></Wizard>
</CardBody>
</Card>
);
}
}
export default WizardIcons;
| 30.441026 | 77 | 0.431098 |
6fca1b5f7f48f1463e0baa215c60e027a08ddc36 | 2,386 | js | JavaScript | assets/node_modules/@microsoft/tsdoc/lib/nodes/DocSection.js | Raftaaaar/aws-bookstore-demo-app | bbae2281ccb1dd41a237bd92e6de9eae4507f10b | [
"MIT-0"
] | 27 | 2020-12-29T14:05:29.000Z | 2022-03-02T05:53:14.000Z | assets/node_modules/@microsoft/tsdoc/lib/nodes/DocSection.js | Raftaaaar/aws-bookstore-demo-app | bbae2281ccb1dd41a237bd92e6de9eae4507f10b | [
"MIT-0"
] | null | null | null | assets/node_modules/@microsoft/tsdoc/lib/nodes/DocSection.js | Raftaaaar/aws-bookstore-demo-app | bbae2281ccb1dd41a237bd92e6de9eae4507f10b | [
"MIT-0"
] | 10 | 2020-12-30T02:48:01.000Z | 2022-03-19T13:32:29.000Z | var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
import { DocParagraph } from './DocParagraph';
import { DocNodeContainer } from './DocNodeContainer';
/**
* Represents a general block of rich text.
*/
var DocSection = /** @class */ (function (_super) {
__extends(DocSection, _super);
/**
* Don't call this directly. Instead use {@link TSDocParser}
* @internal
*/
function DocSection(parameters, childNodes) {
return _super.call(this, parameters, childNodes) || this;
}
Object.defineProperty(DocSection.prototype, "kind", {
/** @override */
get: function () {
return "Section" /* Section */;
},
enumerable: false,
configurable: true
});
/**
* If the last item in DocSection.nodes is not a DocParagraph, a new paragraph
* is started. Either way, the provided docNode will be appended to the paragraph.
*/
DocSection.prototype.appendNodeInParagraph = function (docNode) {
var paragraphNode = undefined;
if (this.nodes.length > 0) {
var lastNode = this.nodes[this.nodes.length - 1];
if (lastNode.kind === "Paragraph" /* Paragraph */) {
paragraphNode = lastNode;
}
}
if (!paragraphNode) {
paragraphNode = new DocParagraph({ configuration: this.configuration });
this.appendNode(paragraphNode);
}
paragraphNode.appendNode(docNode);
};
DocSection.prototype.appendNodesInParagraph = function (docNodes) {
for (var _i = 0, docNodes_1 = docNodes; _i < docNodes_1.length; _i++) {
var docNode = docNodes_1[_i];
this.appendNodeInParagraph(docNode);
}
};
return DocSection;
}(DocNodeContainer));
export { DocSection };
//# sourceMappingURL=DocSection.js.map | 37.873016 | 93 | 0.590109 |