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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a7789ff4a20f00bf6408b8042bb6af40938bf782 | 1,309 | js | JavaScript | spec/frontend/vue_shared/directives/autofocusonshow_spec.js | C28NGO37/gitlabhq | f93be461801e85079cb761acf2aa0bc5f9942c51 | [
"MIT"
] | 2 | 2020-10-10T05:58:12.000Z | 2020-10-10T09:30:57.000Z | spec/frontend/vue_shared/directives/autofocusonshow_spec.js | C28NGO37/gitlabhq | f93be461801e85079cb761acf2aa0bc5f9942c51 | [
"MIT"
] | 1 | 2020-10-15T14:41:12.000Z | 2020-10-15T14:41:12.000Z | spec/frontend/vue_shared/directives/autofocusonshow_spec.js | C28NGO37/gitlabhq | f93be461801e85079cb761acf2aa0bc5f9942c51 | [
"MIT"
] | null | null | null | import autofocusonshow from '~/vue_shared/directives/autofocusonshow';
import { useMockIntersectionObserver } from 'helpers/mock_dom_observer';
/**
* We're testing this directive's hooks as pure functions
* since behaviour of this directive is highly-dependent
* on underlying DOM methods.
*/
describe('AutofocusOnShow directive', () => {
useMockIntersectionObserver();
describe('with input invisible on component render', () => {
let el;
beforeEach(() => {
setFixtures('<div id="container" style="display: none;"><input id="inputel"/></div>');
el = document.querySelector('#inputel');
});
it('should bind IntersectionObserver on input element', () => {
jest.spyOn(el, 'focus').mockImplementation(() => {});
autofocusonshow.inserted(el);
expect(el.visibilityObserver).toBeDefined();
expect(el.focus).not.toHaveBeenCalled();
});
it('should stop IntersectionObserver on input element on unbind hook', () => {
el.visibilityObserver = {
disconnect: () => {},
};
jest.spyOn(el.visibilityObserver, 'disconnect').mockImplementation(() => {});
autofocusonshow.unbind(el);
expect(el.visibilityObserver).toBeDefined();
expect(el.visibilityObserver.disconnect).toHaveBeenCalled();
});
});
});
| 31.166667 | 92 | 0.664629 |
a779291fe2590acf3b7d2ddb0642787f46fed625 | 3,409 | js | JavaScript | src/views/common/public/home/Home.js | jeromeviray/try-repo | e5b4de744a58ce95177e5ac5308b11d774c19610 | [
"MIT"
] | null | null | null | src/views/common/public/home/Home.js | jeromeviray/try-repo | e5b4de744a58ce95177e5ac5308b11d774c19610 | [
"MIT"
] | null | null | null | src/views/common/public/home/Home.js | jeromeviray/try-repo | e5b4de744a58ce95177e5ac5308b11d774c19610 | [
"MIT"
] | null | null | null | import React, { Component, Suspense } from "react"
import { CContainer, CRow, CCol } from "@coreui/react"
import { DotLoader } from "react-spinners"
// import { HeroCarousel } from 'src/components/carousel/index'
import { connect } from "react-redux"
// import { NewArrivalProducts, PopularProducts } from 'src/components/public'
// action
import {
getDiscoverProducts,
getProductsWithPromo,
getPopularProducts
} from "src/service/apiActions/productAction/productAction"
// import ProductDetialsModal from 'src/components/modals/product/ProductDetialsModal'
const HeroCarousel = React.lazy(() =>
import("src/components/carousel/HeroCarousel"),
)
const PromoProducts = React.lazy(() =>
import(
"src/components/public/productFeatures/PromoProducts/PromoProducts"
),
)
const PopularProducts = React.lazy(() =>
import(
"src/components/public/productFeatures/popularProducts/PopularProducts"
),
)
const ProductDetialsModal = React.lazy(() =>
import("src/components/modals/product/ProductDetialsModal"),
)
const Discover = React.lazy(() => import("src/components/public/productFeatures/discoverProduct/Discover"))
const CategoryList = React.lazy(() =>
import("src/components/category/CategoryList"),
)
export class Home extends Component {
state = {
loading: false,
message: "",
products: {
data: [],
totalPages: 0,
},
page: 0,
limit: 10,
query: "",
}
componentDidMount() {
const { page, limit, query } = this.state
this.getPopularProducts()
}
getPopularProducts = () => {
let { page, limit, query } = this.state
this.props.getPopularProducts(query, page, limit).catch(() => {
this.setState({
loading: false,
})
})
}
getDiscoverProducts = () => {
let { page, limit, query } = this.state
this.props.getDiscoverProducts(query, page, limit).catch(() => {
this.setState({
loading: false,
})
})
}
render() {
let { message } = this.state
return (
<>
<Suspense
fallback={
<div className="d-flex justify-content-center align-items-center position-fixed spinner">
<DotLoader color="#36D7B7" size={100} />
</div>
}
>
<ProductDetialsModal />
<CContainer>
<CRow>
<CCol xs="12" sm="12" md="12" lg="4">
<CategoryList />
</CCol>
<CCol xs="12" sm="12" md="12" lg="8">
<HeroCarousel />
</CCol>
</CRow>
{/* <div className="border d-flex justify-content-between align-items-center"></div> */}
</CContainer>
<CContainer className="mt-4">
{message && (
<div className="form-group d-flex justify-content-center align-items-center">
<div className="alert alert-danger" role="alert">
{message}
</div>
</div>
)}
<PopularProducts />
<PromoProducts />
<Discover />
</CContainer>
</Suspense>
</>
)
}
}
const mapStateToProps = (state) => {
return {
userResponse: state.userResponse,
messageResponse: state.messageResponse,
}
}
export default connect(mapStateToProps, {
getDiscoverProducts,
getProductsWithPromo,
getPopularProducts
})(Home)
| 27.491935 | 107 | 0.597536 |
a7794a55fb0d43da8fedb69549fdc3ba11e0ed8f | 4,605 | js | JavaScript | web/rainmaker/dev-packages/pgr-citizen-dev/src/Screens/Home/index.js | savitaepi/frontend | 1c4086b504b1fffc7388952c100e72b5a98fae75 | [
"MIT"
] | 3 | 2021-05-13T13:51:22.000Z | 2021-06-14T16:05:12.000Z | web/rainmaker/dev-packages/pgr-citizen-dev/src/Screens/Home/index.js | savitaepi/frontend | 1c4086b504b1fffc7388952c100e72b5a98fae75 | [
"MIT"
] | 29 | 2020-07-16T09:39:12.000Z | 2021-02-04T08:53:48.000Z | web/rainmaker/dev-packages/pgr-citizen-dev/src/Screens/Home/index.js | savitaepi/frontend | 1c4086b504b1fffc7388952c100e72b5a98fae75 | [
"MIT"
] | 12 | 2020-12-16T03:50:45.000Z | 2022-02-21T06:14:52.000Z | import React, { Component } from "react";
import { connect } from "react-redux";
import Icon from "egov-ui-kit/components/Icon";
import { Screen, ModuleLandingPage } from "modules/common";
import Label from "egov-ui-kit/utils/translationNode";
import NewAndOldComplaints from "./components/NewAndOldComplaints";
import Notifications from "./components/Notifications";
import { fetchComplaints } from "egov-ui-kit/redux/complaints/actions";
import { resetFiles, removeForm } from "egov-ui-kit/redux/form/actions";
import { mapCompIDToName } from "egov-ui-kit/utils/commons";
import { Image } from "components";
import logo from "egov-ui-kit/assets/images/punjab-logo.png";
import orderby from "lodash/orderBy";
import "./index.css";
const iconStyle = {
color: "#fe7a51",
height: 45,
width: 45,
overflow: "visible"
};
class Home extends Component {
componentDidMount = () => {
const { fetchComplaints, resetFiles, removeForm } = this.props;
fetchComplaints([], false);
if (this.props.form && this.props.form.complaint) {
resetFiles("reopenComplaint");
removeForm("complaint");
}
};
getCardItems = () => {
const { updates } = this.props;
return [
{
label: "CS_HOME_FILE_COMPLAINT",
icon: <Icon style={iconStyle} action="custom" name="comment-plus" />,
route: "/add-complaint"
},
{
label: "CS_HOME_MY_COMPLAINTS_CARD_LABEL",
dynamicArray: [updates.length],
icon: <Icon style={iconStyle} action="custom" name="account-alert" />,
route: "/my-complaints"
}
];
};
render() {
const { updates, history, loading } = this.props;
const { getCardItems } = this;
return (
<Screen className="homepage-screen" loading={loading}>
<ModuleLandingPage items={getCardItems()} history={history} />
<Label
label="CS_HOME_UPDATES"
dark={true}
fontSize={16}
fontWeight={900}
bold={true}
containerStyle={{ paddingLeft: 8, paddingTop: 16, paddingBottom: 8 }}
/>
<div style={{ padding: "0px 8px" }}>
<Notifications updates={updates} history={history} />
</div>
</Screen>
// <Screen className="homepage-screen">
// {/* <div className="home-page-top-banner-cont">
// <div className="banner-image">
// <div className="banner-overlay" />
// <div className="logo-wrapper user-logo-wrapper">
// <Image className="mseva-logo" source={`${logo}`} />
// </div>
// </div>
// </div> */}
// <div className="home-page-cont">
// <div>
// <NewAndOldComplaints history={history} />
// <Notifications updates={updates} history={history} />
// </div>
// </div>
// </Screen>
);
}
}
const mapStateToProps = state => {
const complaints = state.complaints || {};
const { fetchSuccess } = complaints;
const loading = fetchSuccess ? false : true;
const { form } = state || {};
let updates = [];
Object.keys(complaints.byId).forEach((complaintKey, index) => {
let complaintObj = {};
let complaintactions =
complaints.byId[complaintKey].actions &&
complaints.byId[complaintKey].actions.filter(
complaint => complaint.status
);
complaintObj.status = complaints.byId[complaintKey].status;
complaintObj.action = complaintactions && complaintactions[0].action;
complaintObj.title = mapCompIDToName(
complaints.categoriesById,
complaints.byId[complaintKey].serviceCode
);
complaintObj.date = complaints.byId[complaintKey].auditDetails.createdTime;
complaintObj.number = complaintKey;
updates.push(complaintObj);
});
var closedComplaints = orderby(
updates.filter(
complaint =>
complaint.status && complaint.status.toLowerCase() === "closed"
),
["date"],
["desc"]
);
var nonClosedComplaints = orderby(
updates.filter(
complaint =>
complaint.status && complaint.status.toLowerCase() != "closed"
),
["date"],
["desc"]
);
return {
form,
updates: [...nonClosedComplaints, ...closedComplaints],
loading
};
};
const mapDispatchToProps = dispatch => {
return {
fetchComplaints: (criteria, hasUsers) =>
dispatch(fetchComplaints(criteria, hasUsers)),
resetFiles: formKey => dispatch(resetFiles(formKey)),
removeForm: formKey => dispatch(removeForm(formKey))
};
};
export default connect(
mapStateToProps,
mapDispatchToProps
)(Home);
| 30.90604 | 79 | 0.623018 |
a779b7ecfa7effeb40d7d5d3f144ddd544d3d162 | 20,363 | js | JavaScript | src/utility.js | anthonynosek/sprint-reader-chrome | 5356292653fcc3d85ac935e4fbb082aa40a690b7 | [
"BSD-3-Clause"
] | 161 | 2015-01-26T13:46:40.000Z | 2022-03-11T17:43:59.000Z | src/utility.js | millern/sprint-reader-chrome | 1b328af5432a5458c1d0d1fe6b0b7fbb455838b6 | [
"BSD-3-Clause"
] | 30 | 2015-01-26T13:10:45.000Z | 2021-10-21T13:21:21.000Z | src/utility.js | millern/sprint-reader-chrome | 1b328af5432a5458c1d0d1fe6b0b7fbb455838b6 | [
"BSD-3-Clause"
] | 57 | 2015-01-30T08:23:37.000Z | 2022-02-23T18:12:56.000Z | //------------------------------------------------------------------------------
//
// SPRINT READER
// Speed Reading Extension for Google Chrome
// Copyright (c) 2013-2015, Anthony Nosek
// https://github.com/anthonynosek/sprint-reader-chrome/blob/master/LICENSE
//
//------------------------------------------------------------------------------
// This file contains generic utility functions and
// all the advanced settings used to control the
// display and splitting algorithm
// --------------------------------------------------
// Misc.
var textPositionDelimiter = "{{**POSI<>TION**}}";
// MORE ADVANCED SETTINGS (Variables)
// Algorithm
var madvStaticFocalUnicodeCharacter;
var madvEnableSpaceInsertion;
var madvRemoveLastSlideNullOrEmpty;
var madvEnableHyphenatedWordSplit;
var madvConsolidateHyphenatedWord;
var madvEnableLongWordHyphenation;
var madvLongWordTriggerCharacterCount;
var madvLongWordMinCharacterPerSlidePostSplit;
var madvLongWordCharacterTriggerDoNotJoin;
var madvEnableAcronymDetection;
var madvEnableNumberDecimalDetection;
var madvWordFreqMinimumSlideDuration;
var madvWordFreqHighestFreqSlideDuration;
var madvWordFreqLowestFreqSlideDuration;
var madvWordLengthMinimumSlideDuration;
var madvBasicMinimumSlideDuration;
var madvDeleteEmptySlides;
var madvWPMAdjustmentStep;
// Display
var madvDisplaySentenceWhenPaused;
var madvAutoHideSentence;
var madvAutoHideSentenceSeconds;
var madvDisplaySentenceTopBorder;
var madvDisplaySentenceAtReaderOpen;
var madvSentenceBackwardWordCount;
var madvSentencePositionPercentOffset;
var madvLargeStepNumberOfSlides;
var madvOptimisedPositionLeftMarginPercent;
var madvDisplayProgress;
var madvDisplaySocial;
var madvDisplayWPMSummary;
// Text Selection
var madvHotkeySelectionEnabled;
// Text Retrieval
var madvSaveSlidePosition;
// Get the advanced settings from the local storage
function getMoreAdvancedSettings() {
madvStaticFocalUnicodeCharacter = getFromLocalNotEmpty('madvStaticFocalUnicodeCharacter', madvStaticFocalUnicodeCharacter);
madvEnableSpaceInsertion = getFromLocalNotEmpty('madvEnableSpaceInsertion', madvEnableSpaceInsertion);
madvRemoveLastSlideNullOrEmpty = getFromLocalNotEmpty('madvRemoveLastSlideNullOrEmpty', madvRemoveLastSlideNullOrEmpty);
madvEnableHyphenatedWordSplit = getFromLocalNotEmpty('madvEnableHyphenatedWordSplit', madvEnableHyphenatedWordSplit);
madvConsolidateHyphenatedWord = getFromLocalNotEmpty('madvConsolidateHyphenatedWord', madvConsolidateHyphenatedWord);
madvEnableLongWordHyphenation = getFromLocalNotEmpty('madvEnableLongWordHyphenation', madvEnableLongWordHyphenation);
madvLongWordTriggerCharacterCount = getFromLocalGreaterThanZero('madvLongWordTriggerCharacterCount', madvLongWordTriggerCharacterCount);
madvLongWordMinCharacterPerSlidePostSplit = getFromLocalGreaterThanZero('madvLongWordMinCharacterPerSlidePostSplit', madvLongWordMinCharacterPerSlidePostSplit);
madvLongWordCharacterTriggerDoNotJoin = getFromLocalGreaterThanZero('madvLongWordCharacterTriggerDoNotJoin', madvLongWordCharacterTriggerDoNotJoin);
madvEnableAcronymDetection = getFromLocalNotEmpty('madvEnableAcronymDetection', madvEnableAcronymDetection);
madvEnableNumberDecimalDetection = getFromLocalNotEmpty('madvEnableNumberDecimalDetection', madvEnableNumberDecimalDetection);
madvDeleteEmptySlides = getFromLocalNotEmpty('madvDeleteEmptySlides', madvDeleteEmptySlides);
madvWPMAdjustmentStep = getFromLocalGreaterThanZero('madvWPMAdjustmentStep', madvWPMAdjustmentStep);
madvWordFreqMinimumSlideDuration = getFromLocalGreaterThanZero('madvWordFreqMinimumSlideDuration', madvWordFreqMinimumSlideDuration);
madvWordFreqHighestFreqSlideDuration = getFromLocalGreaterThanZero('madvWordFreqHighestFreqSlideDuration', madvWordFreqHighestFreqSlideDuration);
madvWordFreqLowestFreqSlideDuration = getFromLocalGreaterThanZero('madvWordFreqLowestFreqSlideDuration', madvWordFreqLowestFreqSlideDuration);
madvWordLengthMinimumSlideDuration = getFromLocalGreaterThanZero('madvWordLengthMinimumSlideDuration', madvWordLengthMinimumSlideDuration);
madvBasicMinimumSlideDuration = getFromLocalGreaterThanZero('madvBasicMinimumSlideDuration', madvBasicMinimumSlideDuration);
madvAlwaysHideFocalGuide = getFromLocalNotEmpty('madvAlwaysHideFocalGuide', madvAlwaysHideFocalGuide);
madvOptimisedPositionLeftMarginPercent = getFromLocalGreaterThanZero('madvOptimisedPositionLeftMarginPercent', madvOptimisedPositionLeftMarginPercent);
madvDisplaySentenceWhenPaused = getFromLocalNotEmpty('madvDisplaySentenceWhenPaused', madvDisplaySentenceWhenPaused);
madvAutoHideSentence = getFromLocalNotEmpty('madvAutoHideSentence', madvAutoHideSentence);
madvAutoHideSentenceSeconds = getFromLocalGreaterThanZero('madvAutoHideSentenceSeconds', madvAutoHideSentenceSeconds);
madvDisplaySentenceTopBorder = getFromLocalNotEmpty('madvDisplaySentenceTopBorder', madvDisplaySentenceTopBorder);
madvDisplaySentenceAtReaderOpen = getFromLocalNotEmpty('madvDisplaySentenceAtReaderOpen', madvDisplaySentenceAtReaderOpen);
madvSentenceBackwardWordCount = getFromLocalGreaterThanZero('madvSentenceBackwardWordCount', madvSentenceBackwardWordCount);
madvSentencePositionPercentOffset = getFromLocalGreaterThanZero('madvSentencePositionPercentOffset', madvSentencePositionPercentOffset);
madvLargeStepNumberOfSlides = getFromLocalGreaterThanZero('madvLargeStepNumberOfSlides', madvLargeStepNumberOfSlides);
madvDisplayProgress = getFromLocalNotEmpty('madvDisplayProgress', madvDisplayProgress);
madvDisplaySocial = getFromLocalNotEmpty('madvDisplaySocial', madvDisplaySocial);
madvDisplayWPMSummary = getFromLocalNotEmpty('madvDisplayWPMSummary', madvDisplayWPMSummary);
madvHotkeySelectionEnabled = getFromLocalNotEmpty('madvHotkeySelectionEnabled', madvHotkeySelectionEnabled);
madvSaveSlidePosition = getFromLocalNotEmpty('madvSaveSlidePosition', madvSaveSlidePosition);
}
// Set the default values of the advanced settings
function getMoreAdvancedSettingsDefaults() {
madvStaticFocalUnicodeCharacter = "";
madvEnableSpaceInsertion = 'true';
madvRemoveLastSlideNullOrEmpty = 'true';
madvEnableHyphenatedWordSplit = 'true';
madvConsolidateHyphenatedWord = 'true';
madvEnableLongWordHyphenation = 'true';
madvLongWordTriggerCharacterCount = 13;
madvLongWordMinCharacterPerSlidePostSplit = 6;
madvLongWordCharacterTriggerDoNotJoin = 4;
madvEnableAcronymDetection = 'true';
madvEnableNumberDecimalDetection = 'true';
madvWordFreqMinimumSlideDuration = 40;
madvWordFreqHighestFreqSlideDuration = 40;
madvWordFreqLowestFreqSlideDuration = 300;
madvWordLengthMinimumSlideDuration = 0;
madvBasicMinimumSlideDuration = 0;
madvDeleteEmptySlides = 'true';
madvWPMAdjustmentStep = 25;
madvAlwaysHideFocalGuide = 'false';
madvOptimisedPositionLeftMarginPercent = 30;
madvDisplaySentenceWhenPaused = 'true';
madvAutoHideSentence = 'false';
madvAutoHideSentenceSeconds = 5;
madvDisplaySentenceTopBorder = 'true';
madvDisplaySentenceAtReaderOpen = 'true';
madvSentenceBackwardWordCount = 20;
madvSentencePositionPercentOffset = 50;
madvLargeStepNumberOfSlides = 10;
madvHotkeySelectionEnabled = 'false';
madvSaveSlidePosition = 'true';
madvDisplayWPMSummary = 'true';
madvDisplaySocial = 'true';
madvDisplayProgress = 'true';
}
// --------------------------------------------------
// Obtain the version number of the chrome extension and display
function displayVersion() {
var version = chrome.app.getDetails().version;
var divVersion = document.getElementById('version');
divVersion.innerHTML = "<br><b>Sprint Reader</b> (v" + version + ")";
}
// Get an item from local storage, ensure the item is greater then zero
// Only assign to variable if the item passes the test
function getFromLocalGreaterThanZero(key, variable) {
if (localStorage.getItem(key) > 0) {
variable = localStorage.getItem(key);
variable = parseInt(variable);
}
return variable;
}
// Get an item from local storage, ensure the item is not empty
// Only assign to variable if the item passes the test
function getFromLocalNotEmpty(key, variable) {
if (!isEmpty(localStorage.getItem(key))) {
variable = localStorage.getItem(key);
}
return variable;
}
// Get an item from local storage, ensure the item is a number
// Only assign to variable if the item passes the test
function getFromLocalIsNumber(key, variable) {
if (!isEmpty(localStorage.getItem(key)) && !isNaN(localStorage.getItem(key))) {
variable = localStorage.getItem(key);
variable = parseInt(variable);
}
return variable;
}
// --------------------------------------------------
// String is empty
function isEmpty(str) {
return (!str || 0 === str.length);
}
// --------------------------------------------------
// Reverse a string (by letter)
function reverseString(s){
return s.split("").reverse().join("");
}
// --------------------------------------------------
// Return the full name of the selected text language
// Returns a language object
// - language.shortname
// - language.fullname
// - language.isrighttoleft
function getLanguage(selectedText){
// Detect the language of the passed in text
var selectedTextLanguage;
guessLanguage.detect(selectedText, function(language) {
selectedTextLanguage = language;
//console.log('Detected language of provided text is [' + language + ']');
});
var language = {};
language.shortname = selectedTextLanguage;
language.isrighttoleft = false;
language.pattern = 'en-us';
switch(selectedTextLanguage)
{
case 'en':
language.fullname = 'English';
break;
case 'ab':
language.fullname = 'Abkhazian';
break;
case 'af':
language.fullname = 'Afrikaans';
break;
case 'ar':
language.fullname = 'Arabic';
language.isrighttoleft = true;
break;
case 'az':
language.fullname = 'Azeri';
break;
case 'be':
language.fullname = 'Belarusian';
language.pattern = 'be';
break;
case 'bg':
language.fullname = 'Bulgarian';
break;
case 'bn':
language.fullname = 'Bengali';
language.pattern = 'bn';
break;
case 'bo':
language.fullname = 'Tibetan';
break;
case 'br':
language.fullname = 'Breton';
break;
case 'ca':
language.fullname = 'Catalan';
language.pattern = 'ca';
break;
case 'ceb':
language.fullname = 'Cebuano';
break;
case 'cs':
language.fullname = 'Czech';
language.pattern = 'cz';
break;
case 'cy':
language.fullname = 'Welsh';
break;
case 'da':
language.fullname = 'Danish';
language.pattern = 'da';
break;
case 'de':
language.fullname = 'German';
language.pattern = 'de';
break;
case 'el':
language.fullname = 'Greek';
break;
case 'eo':
language.fullname = 'Esperanto';
break;
case 'es':
language.fullname = 'Spanish';
language.pattern = 'es';
break;
case 'et':
language.fullname = 'Estonian';
break;
case 'eu':
language.fullname = 'Basque';
break;
case 'fa':
language.fullname = 'Farsi';
break;
case 'fi':
language.fullname = 'Finnish';
language.pattern = 'fi';
break;
case 'fo':
language.fullname = 'Faroese';
break;
case 'fr':
language.fullname = 'French';
language.pattern = 'fr';
break;
case 'fy':
language.fullname = 'Frisian';
break;
case 'gd':
language.fullname = 'Scots Gaelic';
break;
case 'gl':
language.fullname = 'Galician';
break;
case 'gu':
language.fullname = 'Gujarati';
language.pattern = 'gu';
break;
case 'ha':
language.fullname = 'Hausa';
break;
case 'haw':
language.fullname = 'Hawaiian';
break;
case 'he':
language.fullname = 'Hebrew';
language.isrighttoleft = true;
break;
case 'hi':
language.fullname = 'Hindi';
language.pattern = 'hi';
break;
case 'hr':
language.fullname = 'Croatian';
break;
case 'hu':
language.fullname = 'Hungarian';
language.pattern = 'hu';
break;
case 'hy':
language.fullname = 'Armenian';
language.pattern = 'hy';
break;
case 'id':
language.fullname = 'Indonesian';
break;
case 'is':
language.fullname = 'Icelandic';
break;
case 'it':
language.fullname = 'Italian';
language.pattern = 'it';
break;
case 'ja':
language.fullname = 'Japanese';
break;
case 'ka':
language.fullname = 'Georgian';
break;
case 'kk':
language.fullname = 'Kazakh';
break;
case 'km':
language.fullname = 'Cambodian';
break;
case 'ko':
language.fullname = 'Korean';
break;
case 'ku':
language.fullname = 'Kurdish';
language.isrighttoleft = true;
break;
case 'ky':
language.fullname = 'Kyrgyz';
break;
case 'la':
language.fullname = 'Latin';
language.pattern = 'la';
break;
case 'lt':
language.fullname = 'Lithuanian';
language.pattern = 'lt';
break;
case 'lv':
language.fullname = 'Latvian';
language.pattern = 'lv';
break;
case 'mg':
language.fullname = 'Malagasy';
break;
case 'mk':
language.fullname = 'Macedonian';
break;
case 'ml':
language.fullname = 'Malayalam';
language.pattern = 'ml';
break;
case 'mn':
language.fullname = 'Mongolian';
break;
case 'mr':
language.fullname = 'Marathi';
break;
case 'ms':
language.fullname = 'Malay';
break;
case 'nd':
language.fullname = 'Ndebele';
break;
case 'ne':
language.fullname = 'Nepali';
break;
case 'nl':
language.fullname = 'Dutch';
language.pattern = 'nl';
break;
case 'nn':
language.fullname = 'Nynorsk';
break;
case 'no':
language.fullname = 'Norwegian';
language.pattern = 'nb-no';
break;
case 'nso':
language.fullname = 'Sepedi';
break;
case 'pa':
language.fullname = 'Punjabi';
language.isrighttoleft = true;
language.pattern = 'pa';
break;
case 'pl':
language.fullname = 'Polish';
language.pattern = 'pl';
break;
case 'ps':
language.fullname = 'Pashto';
language.isrighttoleft = true;
break;
case 'pt':
language.fullname = 'Portuguese';
language.pattern = 'pt';
break;
case 'pt_PT':
language.fullname = 'Portuguese (Portugal)';
language.pattern = 'pt';
break;
case 'pt_BR':
language.fullname = 'Portuguese (Brazil)';
language.pattern = 'pt';
break;
case 'ro':
language.fullname = 'Romanian';
break;
case 'ru':
language.fullname = 'Russian';
language.pattern = 'ru';
break;
case 'sa':
language.fullname = 'Sanskrit';
break;
case 'sh':
language.fullname = 'Serbo-Croatian';
break;
case 'sk':
language.fullname = 'Slovak';
language.pattern = 'sk';
language.isrighttoleft = false;
break;
case 'sl':
language.fullname = 'Slovene';
language.pattern = 'sl';
break;
case 'so':
language.fullname = 'Somali';
break;
case 'sq':
language.fullname = 'Albanian';
break;
case 'sr':
language.fullname = 'Serbian';
break;
case 'sv':
language.fullname = 'Swedish';
language.pattern = 'sv';
break;
case 'sw':
language.fullname = 'Swahili';
break;
case 'ta':
language.fullname = 'Tamil';
language.pattern = 'ta';
break;
case 'te':
language.fullname = 'Telugu';
language.pattern = 'te';
break;
case 'th':
language.fullname = 'Thai';
break;
case 'tl':
language.fullname = 'Tagalog';
break;
case 'tlh':
language.fullname = 'Klingon';
break;
case 'tn':
language.fullname = 'Setswana';
break;
case 'tr':
language.fullname = 'Turkish';
language.pattern = 'tr';
break;
case 'ts':
language.fullname = 'Tsonga';
break;
case 'tw':
language.fullname = 'Tiwi';
break;
case 'uk':
language.fullname = 'Ukrainian';
language.pattern = 'uk';
break;
case 'ur':
language.fullname = 'Urdu';
language.isrighttoleft = true;
break;
case 'uz':
language.fullname = 'Uzbek';
break;
case 've':
language.fullname = 'Venda';
break;
case 'vi':
language.fullname = 'Vietnamese';
break;
case 'xh':
language.fullname = 'Xhosa';
break;
case 'zh':
language.fullname = 'Chinese';
break;
case 'zh_TW':
language.fullname = 'Traditional Chinese (Taiwan)';
break;
default:
language.fullname = "";
}
// load the pattern script
var patternJS = '../lib/guess_language/language_patterns/' + language.pattern + '.js'
$.ajax({
async: false,
url: patternJS,
dataType: "script"
});
return language;
}
// --------------------------------------------------
// Return just the text part of the selected text or history item
function getSelectedTextFromResourceString(textFromResource) {
if (textFromResource == null) return { text: "", position: 0 };
if (textFromResource.length == 0) return { text: "", position: 0 };
var textArray = textFromResource.split(textPositionDelimiter);
if (textArray.length >= 1) {
return {
text: textArray[0],
fulltext: textFromResource,
position: parseInt(textArray[1])
};
}
return { text: "", position: 0 };
}
// --------------------------------------------------
// Shuffle the text history items as the reader is closed
function saveSelectedTextToResource(latestTextSelection) {
if (latestTextSelection == null) latestTextSelection = "";
// Don't save duplicate text selections... why would we do this???
var text = getSelectedTextFromResourceString(localStorage.getItem('selectedText'));
if (text.text == latestTextSelection) return;
var hist1 = getSelectedTextFromResourceString(localStorage.getItem('selectedTextHistory1'));
// Save the historical text
if (text.text != hist1.text) {
// Move history1 to history 2
if (hist1.text != "") {
localStorage.setItem("selectedTextHistory2", hist1.fulltext);
}
// Save the currently selected text to history 1
// Window will reopen with latest selected text
if (text.text != "") {
localStorage.setItem("selectedTextHistory1", text.fulltext);
}
}
}
// --------------------------------------------------
// Create an HTML safe string, used when displaying the entire text contents
function htmlEntitiesEncode(str) {
return $('<div/>').text(str).html();
}
// --------------------------------------------------
// Decode an html safe string (creates unsafe string)
function htmlEntitiesDecode(str) {
return $('<div />').html(str).text();
}
// --------------------------------------------------
// Replace all SVG images with inline SVG
function insertSVG() {
jQuery(document).ready(function() {
jQuery('img.svg').each(function(){
var $img = jQuery(this);
var imgID = $img.attr('id');
var imgClass = $img.attr('class');
var imgURL = $img.attr('src');
jQuery.get(imgURL, function(data) {
// Get the SVG tag, ignore the rest
var $svg = jQuery(data).find('svg');
// Add replaced image's ID to the new SVG
if(typeof imgID !== 'undefined') {
$svg = $svg.attr('id', imgID);
}
// Add replaced image's classes to the new SVG
if(typeof imgClass !== 'undefined') {
$svg = $svg.attr('class', imgClass + ' replaced-svg');
}
// Remove any invalid XML tags as per http://validator.w3.org
$svg = $svg.removeAttr('xmlns:a');
// Replace image with new SVG
$img.replaceWith($svg);
}, 'xml');
});
});
$(window).load(function() {
// Update the css for the github_logo class (path)
jQuery('.github_logo path').css('fill', colorSentenceBorder);
});
}
// --------------------------------------------------
// Load a script passed in via URL parameter
function loadScript(url, callback)
{
// Adding the script tag to the head of the document
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = url;
// Then bind the event to the callback function.
// There are several events for cross browser compatibility.
script.onreadystatechange = callback;
script.onload = callback;
// Fire the loading
head.appendChild(script);
}
| 30.621053 | 161 | 0.686392 |
a77a02b7965bae7d815573ea82d1cdb89f249cbc | 1,759 | js | JavaScript | imports/startup/server/ssr.js | fknipp/cmdline-server | 974297c01705a47a507f0ba5ef6f6e9784d6e5b2 | [
"MIT"
] | null | null | null | imports/startup/server/ssr.js | fknipp/cmdline-server | 974297c01705a47a507f0ba5ef6f6e9784d6e5b2 | [
"MIT"
] | null | null | null | imports/startup/server/ssr.js | fknipp/cmdline-server | 974297c01705a47a507f0ba5ef6f6e9784d6e5b2 | [
"MIT"
] | null | null | null | import React from 'react';
import { renderToString } from 'react-dom/server';
import { onPageLoad } from 'meteor/server-render';
import { StaticRouter } from 'react-router';
import { Provider } from 'react-redux';
import { createStore, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import { Helmet } from 'react-helmet';
import { ServerStyleSheet } from 'styled-components';
import { Meteor } from 'meteor/meteor';
import App from '../../ui/layouts/App/App';
import mainReducer from '../../modules/redux/reducers';
import parseUrlForSSR from '../../modules/parse-url-for-ssr';
onPageLoad((sink) => {
const documentURL = parseUrlForSSR(sink.request.url, 'documents');
const context = {};
const data = {
loading: true,
loggingIn: false,
authenticated: false,
name: '',
roles: [],
userId: null,
emailAddress: '',
emailVerified: false,
doc: documentURL.isMatch ? Meteor.call('documents.findOne', documentURL.parts[1]) : '',
};
const store = createStore(mainReducer, data, applyMiddleware(thunk));
const initialData = store.getState();
const stylesheet = new ServerStyleSheet();
const app = renderToString(stylesheet.collectStyles( // eslint-disable-line
<Provider store={store}>
<StaticRouter location={sink.request.url} context={context}>
<App />
</StaticRouter>
</Provider>));
const helmet = Helmet.renderStatic();
sink.appendToHead(helmet.meta.toString());
sink.appendToHead(helmet.title.toString());
sink.appendToHead(stylesheet.getStyleTags());
sink.renderIntoElementById('react-root', app);
sink.appendToBody(`
<script>
window.__PRELOADED_STATE__ = ${JSON.stringify(initialData).replace(/</g, '\\u003c')}
</script>
`);
});
| 31.981818 | 91 | 0.688459 |
a77a153c2d11a409420d26bd0ccc951dc2eb0274 | 3,966 | js | JavaScript | etc/config.js | sillelien/docker-usergrid-server | ac6122829d2c3c9d7a17499c06a703a50b45b196 | [
"Apache-2.0"
] | 1 | 2015-12-31T00:32:12.000Z | 2015-12-31T00:32:12.000Z | etc/config.js | sillelien/docker-usergrid-server | ac6122829d2c3c9d7a17499c06a703a50b45b196 | [
"Apache-2.0"
] | null | null | null | etc/config.js | sillelien/docker-usergrid-server | ac6122829d2c3c9d7a17499c06a703a50b45b196 | [
"Apache-2.0"
] | 4 | 2015-12-18T09:17:04.000Z | 2019-03-12T15:39:37.000Z |
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
var Usergrid = Usergrid || {};
Usergrid.showNotifcations = true;
// used only if hostname does not match a real server name
Usergrid.overrideUrl = '${USERGRID_URL}/api';
Usergrid.options = {
client:{
requiresDeveloperKey:false
// apiKey:'123456'
},
showAutoRefresh:true,
autoUpdateTimer:61, //seconds
menuItems:[
{path:'#!/org-overview', active:true,pic:'🕪',title:'Org Administration'},
{path:'#!/app-overview/summary',pic:'',title:'App Overview'},
{path:'#!/users',pic:'👤',title:'Users'},
{path:'#!/groups',pic:'👥',title:'Groups'},
{path:'#!/roles',pic:'',title:'Roles'},
{path:'#!/data',pic:'📸',title:'Data'},
{path:'#!/activities',pic:'',title:'Activities'},
{path:'#!/shell',pic:'⌨',title:'Shell'}
]
};
Usergrid.regex = {
appNameRegex: new RegExp("^[0-9a-zA-Z.-]{3,25}$"),
usernameRegex: new RegExp("^[0-9a-zA-Z@\.\_-]{4,25}$"),
nameRegex: new RegExp("^([0-9a-zA-Z@#$%^&!?;:.,'\"~*-:+_\[\\](){}/\\ |]{3,60})+$"),
roleNameRegex: new RegExp("^([0-9a-zA-Z./-]{3,25})+$"),
emailRegex: new RegExp("^(([0-9a-zA-Z]+[_\+.-]?)+@[0-9a-zA-Z]+[0-9,a-z,A-Z,.,-]*(.){1}[a-zA-Z]{2,4})+$"),
passwordRegex: /(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/,
pathRegex: new RegExp("^/[a-zA-Z0-9\.\*_\$\{\}~-]+(\/[a-zA-Z0-9\.\*_\$\{\}~-]+)*$"),
titleRegex: new RegExp("[a-zA-Z0-9.!-?]+[\/]?"),
urlRegex: new RegExp("^(http?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$"),
zipRegex: new RegExp("^[0-9]{5}(?:-[0-9]{4})?$"),
countryRegex: new RegExp("^[A-Za-z ]{3,100}$"),
stateRegex: new RegExp("^[A-Za-z ]{2,100}$"),
collectionNameRegex: new RegExp("^[0-9a-zA-Z_.]{3,25}$"),
appNameRegexDescription: "This field only allows : A-Z, a-z, 0-9, dot, and dash and must be between 3-25 characters.",
usernameRegexDescription: "This field only allows : A-Z, a-z, 0-9, dot, underscore and dash. Must be between 4 and 15 characters.",
nameRegexDescription: "Please enter a valid name. Must be betwee 3 and 60 characters.",
roleNameRegexDescription: "Role only allows : /, a-z, 0-9, dot, and dash. Must be between 3 and 25 characters.",
emailRegexDescription: "Please enter a valid email.",
passwordRegexDescription: "Password must contain at least 1 upper and lower case letter, one number or special character and be at least 8 characters.",
pathRegexDescription: "Path must begin with a slash, path only allows: /, a-z, 0-9, dot, and dash, paths of the format: /path/ or /path//path are not allowed",
titleRegexDescription: "Please enter a valid title.",
urlRegexDescription: "Please enter a valid url",
zipRegexDescription: "Please enter a valid zip code.",
countryRegexDescription: "Sorry only alphabetical characters or spaces are allowed. Must be between 3-100 characters.",
stateRegexDescription: "Sorry only alphabetical characters or spaces are allowed. Must be between 2-100 characters.",
collectionNameRegexDescription: "Collection name only allows : a-z A-Z 0-9. Must be between 3-25 characters."
};
| 52.184211 | 164 | 0.641704 |
a77a6c834c35cd21028f354c2ed20e0630aec297 | 979 | js | JavaScript | docs/class_tempest_1_1_direction_light.js | enotio/Tempest | 1a7105cfca3669d54c696ad8188f04f25159c0a0 | [
"MIT"
] | 5 | 2017-05-31T21:25:57.000Z | 2020-01-14T14:11:41.000Z | docs/class_tempest_1_1_direction_light.js | enotio/Tempest | 1a7105cfca3669d54c696ad8188f04f25159c0a0 | [
"MIT"
] | 2 | 2017-11-13T14:32:21.000Z | 2018-10-03T17:07:36.000Z | docs/class_tempest_1_1_direction_light.js | enotio/Tempest | 1a7105cfca3669d54c696ad8188f04f25159c0a0 | [
"MIT"
] | 2 | 2018-01-31T14:06:58.000Z | 2018-10-02T11:46:34.000Z | var class_tempest_1_1_direction_light =
[
[ "DirectionLight", "class_tempest_1_1_direction_light.html#ade76372d16da3fd14db8c890523af09e", null ],
[ "ablimient", "class_tempest_1_1_direction_light.html#a64729cf80f29d3f5c790630591f16047", null ],
[ "color", "class_tempest_1_1_direction_light.html#a009be6ffd5e915cd6b4f454e17722d35", null ],
[ "setAblimient", "class_tempest_1_1_direction_light.html#adc8e07f8a8d363113d3dc4b3db1bdf97", null ],
[ "setColor", "class_tempest_1_1_direction_light.html#a278bf3b408fb798b63a1de68d3245b3d", null ],
[ "setDirection", "class_tempest_1_1_direction_light.html#ac8dc907c23e7578391c404e3d8ef5c78", null ],
[ "xDirection", "class_tempest_1_1_direction_light.html#a9183264f919c0c74ece71c772d88c9b3", null ],
[ "yDirection", "class_tempest_1_1_direction_light.html#a616b19a306082d1d3f36643a059a376b", null ],
[ "zDirection", "class_tempest_1_1_direction_light.html#ad810eb1685525f4d3df7007c9a091b64", null ]
]; | 81.583333 | 107 | 0.808989 |
a77ae077907e96a4c9f18c94aebf11c72dfd5d83 | 1,355 | js | JavaScript | SuiteCommerce Advanced/SC_21.1_Live/LocalDistributionAdvanced/javascript/compiled/QuoteToSalesOrderWizard.Module.PaymentMethod.Selector.js | Rudracool/MotherCareBackend- | 1e38dd4c839929b026b8565739fcc7879a9b79c3 | [
"MIT"
] | null | null | null | SuiteCommerce Advanced/SC_21.1_Live/LocalDistributionAdvanced/javascript/compiled/QuoteToSalesOrderWizard.Module.PaymentMethod.Selector.js | Rudracool/MotherCareBackend- | 1e38dd4c839929b026b8565739fcc7879a9b79c3 | [
"MIT"
] | null | null | null | SuiteCommerce Advanced/SC_21.1_Live/LocalDistributionAdvanced/javascript/compiled/QuoteToSalesOrderWizard.Module.PaymentMethod.Selector.js | Rudracool/MotherCareBackend- | 1e38dd4c839929b026b8565739fcc7879a9b79c3 | [
"MIT"
] | null | null | null | /*
© 2020 NetSuite Inc.
User may not copy, modify, distribute, or re-bundle or otherwise make available this code;
provided, however, if you are an authorized user with a NetSuite account or log-in, you
may use this code subject to the terms that govern your access and use.
*/
define("QuoteToSalesOrderWizard.Module.PaymentMethod.Selector", ["require", "exports", "Utils", "OrderWizard.Module.PaymentMethod.Selector"], function (require, exports, Utils, OrderWizardModulePaymentMethodSelector) {
"use strict";
return OrderWizardModulePaymentMethodSelector.extend({
className: 'QuoteToSalesOrderWizard.Module.PaymentMethod.Selector',
render: function () {
if (this.wizard.hidePayment()) {
this.$el.empty();
}
else {
OrderWizardModulePaymentMethodSelector.prototype.render.apply(this, arguments);
}
if (this.selectedModule && !!~this.selectedModule.type.indexOf('external_checkout')) {
this.trigger('change_label_continue', Utils.translate('Continue to External Payment'));
}
else {
this.trigger('change_label_continue', Utils.translate('Submit'));
}
}
});
});
//# sourceMappingURL=QuoteToSalesOrderWizard.Module.PaymentMethod.Selector.js.map
| 46.724138 | 218 | 0.661255 |
a77b03e1816129ef1908e7c9e2849f0776dd0a3e | 1,510 | js | JavaScript | other/firstPairSum.js | billyhkim/pe-practice | 217568a60a4046b5d51163ca087662ef9ec683e2 | [
"MIT"
] | null | null | null | other/firstPairSum.js | billyhkim/pe-practice | 217568a60a4046b5d51163ca087662ef9ec683e2 | [
"MIT"
] | null | null | null | other/firstPairSum.js | billyhkim/pe-practice | 217568a60a4046b5d51163ca087662ef9ec683e2 | [
"MIT"
] | null | null | null | /*
find a pair the first pair of numbers from an unsorted array that add up to a target number
input: number[] , number
output: [number, number] | ‘no pairs found’;
example inputs:
[3,4,2,1,4,7,8] , 8
=> [4,4]
example inputs:
[1,5,2,4,9,5] , 8
=> ‘no pairs found’
*/
const firstPairSum = (arr, target) => {
let result = [];
for (let i = 0; i < arr.length; i++) {
for (let j = i + 1; j < arr.length; j++) {
if (arr[i] + arr[j] === target) {
result.push(arr[i], arr[j]);
console.log(result);
return result;
}
}
}
if (result.length === 0) return 'no pairs found';
return result;
};
const firstPairSumOpt = (arr, target) => {
const numMap = {};
for (let i = 0; i < arr.length; i++) {
if (numMap[target - arr[i]]) {
console.log([arr[i], numMap[target - arr[i]]]);
return [arr[i], numMap[target - arr[i]]];
}
numMap[arr[i]] = arr[i];
}
if (result.length === 0) return 'no pairs found';
};
// firstPairSum([3,4,2,1,4,7,8], 8);
// firstPairSum([1,5,2,4,9,5], 8);
firstPairSumOpt([3,4,2,1,7,8], 8);
/*
// From DW for sorted
const findPair = (input, target) => {
let lowest = 0;
let highest = input.length - 1;
while ( lowest < highest ) {
const check = input[highest] + input[lowest];
if (check > target) {
highest--;
};
if (check < target) {
lowest++;
};
if (check === target) {
return [input[lowest], input[highest]];
}
};
return 'no pairs found';
};
*/ | 20.133333 | 91 | 0.541722 |
a77b20a074e57a5ca7041ba525339dad8d382ee1 | 1,243 | js | JavaScript | jnum-server-wrapper/lib/http-status.js | Maxfaider/jnum-server-wrapper | 9a39e28b20ead4cb7470b5571dc37f966e9ab08a | [
"MIT"
] | null | null | null | jnum-server-wrapper/lib/http-status.js | Maxfaider/jnum-server-wrapper | 9a39e28b20ead4cb7470b5571dc37f966e9ab08a | [
"MIT"
] | null | null | null | jnum-server-wrapper/lib/http-status.js | Maxfaider/jnum-server-wrapper | 9a39e28b20ead4cb7470b5571dc37f966e9ab08a | [
"MIT"
] | null | null | null | 'use strict'
// HTTP Status Code
module.exports = {
HS_OK: 200,
HS_ACCEPTED: 202,
HS_NOT_FOUND: 404,
HS_BAD_GATEWAY: 502,
HS_BAD_REQUEST: 400,
HS_UNAUTHORIZED: 401,
HS_FORBIDDEN: 403,
HS_SERVICE_UNAVAILABLE: 503,
HS_INTERNAL_SERVER_ERROR: 500,
HS_HTTP_VERSION_NOT_SUPPORTED: 505,
HS_CONFLICT: 409,
HS_CONTINUE: 100,
HS_CREATED: 201,
HS_EXPECTATION_FAILED: 417,
HS_FOUND: 302,
HS_GATEWAY_TIMEOUT: 504,
HS_GONE: 410,
HS_LENGTH_REQUIRED: 411,
HS_METHOD_NOT_ALLOWED: 405,
HS_MOVED_PERMANENTLY: 301,
HS_MOVED_TEMPORARILY: 302,
HS_MULTIPLE_CHOICES: 300,
HS_NO_CONTENT: 204,
HS_NON_AUTHORITATIVE_INFORMATION: 203,
HS_NOT_ACCEPTABLE: 406,
HS_NOT_IMPLEMENTED: 501,
HS_NOT_MODIFIED: 304,
HS_PARTIAL_CONTENT: 206,
HS_PAYMENT_REQUIRED: 402,
HS_PRECONDITION_FAILED: 412,
HS_PROXY_AUTHENTICATION_REQUIRED: 407,
HS_REQUEST_ENTITY_TOO_LARGE: 413,
HS_REQUEST_TIMEOUT: 408,
HS_REQUEST_URI_TOO_LONG: 414,
HS_REQUESTED_RANGE_NOT_SATISFIABLE: 416,
HS_RESET_CONTENT: 205,
HS_SEE_OTHER: 303,
HS_SWITCHING_PROTOCOLS: 101,
HS_TEMPORARY_REDIRECT: 307,
HS_UNSUPPORTED_MEDIA_TYPE: 415,
HS_USE_PROXY: 305
} | 26.446809 | 44 | 0.721641 |
a77b94ddad6454274c119ca55e4103063b104f1f | 1,100 | js | JavaScript | tests/test_cases/language/expressions/addition/S11.6.1_A3.2_T2.3.js | renesugar/Js2Py | 0d12da37910aca94203d431d4c9fb9a8f41a5dea | [
"MIT"
] | 1,926 | 2015-01-17T05:57:22.000Z | 2022-03-28T09:24:41.000Z | tests/test_cases/language/expressions/addition/S11.6.1_A3.2_T2.3.js | renesugar/Js2Py | 0d12da37910aca94203d431d4c9fb9a8f41a5dea | [
"MIT"
] | 253 | 2015-01-09T20:34:44.000Z | 2022-03-07T00:52:16.000Z | tests/test_cases/language/expressions/addition/S11.6.1_A3.2_T2.3.js | renesugar/Js2Py | 0d12da37910aca94203d431d4c9fb9a8f41a5dea | [
"MIT"
] | 260 | 2015-04-07T12:05:31.000Z | 2022-03-22T18:15:35.000Z | // Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: >
If Type(Primitive(x)) is String or Type(Primitive(y)) is String, then
operator x + y returns the result of concatenating ToString(x) followed
by ToString(y)
es5id: 11.6.1_A3.2_T2.3
description: >
Type(Primitive(x)) is different from Type(Primitive(y)) and both
types vary between String (primitive or object) and Undefined
---*/
//CHECK#1
if ("1" + undefined !== "1undefined") {
$ERROR('#1: "1" + undefined === "1undefined". Actual: ' + ("1" + undefined));
}
//CHECK#2
if (undefined + "1" !== "undefined1") {
$ERROR('#2: undefined + "1" === "undefined1". Actual: ' + (undefined + "1"));
}
//CHECK#3
if (new String("1") + undefined !== "1undefined") {
$ERROR('#3: new String("1") + undefined === "1undefined". Actual: ' + (new String("1") + undefined));
}
//CHECK#4
if (undefined + new String("1") !== "undefined1") {
$ERROR('#4: undefined + new String("1") === "undefined1". Actual: ' + (undefined + new String("1")));
}
| 32.352941 | 103 | 0.626364 |
a77bc2f5c6894030afc4c4c26fdc0e7040e15b06 | 5,743 | js | JavaScript | scrypt.js | bruno192000/Weather-Dashboard | 848725033c893d414bc1d171f473c7a8a15db197 | [
"Unlicense"
] | null | null | null | scrypt.js | bruno192000/Weather-Dashboard | 848725033c893d414bc1d171f473c7a8a15db197 | [
"Unlicense"
] | null | null | null | scrypt.js | bruno192000/Weather-Dashboard | 848725033c893d414bc1d171f473c7a8a15db197 | [
"Unlicense"
] | null | null | null | //var for the city that will be write
var city="";
// var for declare, using library with id
var searchCity = $("#search-city");
var searchButton = $("#search-button"); //searchbtn
var clearButton = $("#clear-history"); //clearbtn
var currentCity = $("#current-city");
var currentTemperature = $("#temperature");
var currentHumidty= $("#humidity");
var currentWSpeed=$("#wind-speed");
var currentUvindex= $("#uv-index");
var sCity=[];
// a function to search the typed city and deploy it in uppercase
function find(c){
for (var i=0; i<sCity.length; i++){
if(c.toUpperCase()===sCity[i]){
return -1;
}
}
return 1;
}
//the api key
var APIKey="a0aca8a89948154a4182dcecc780b513";
// to show the present weather of the city and also the next 5 days
function displayWeather(event){
event.preventDefault();
if(searchCity.val().trim()!==""){
city=searchCity.val().trim();
currentWeather(city);
}
//if theres no content then it will show an alert
else{
alert("write a city please")
}
}
function currentWeather(city){
// the api url to get the info of weather
var queryURL= "https://api.openweathermap.org/data/2.5/weather?q=" + city + "&APPID=" + APIKey;
$.ajax({
url:queryURL,
method:"GET",
}).then(function(response){
//icons from the api url
var weathericon= response.weather[0].icon;
var iconurl="https://openweathermap.org/img/wn/"+weathericon +"@2x.png";
var date=new Date(response.dt*1000).toLocaleDateString();
//parse the name of the city showed and mixed it with the date and icon
$(currentCity).html(response.name +"("+date+")" + "<img src="+iconurl+">");
// parse the response to display the current temperature.
// Convert the temp to fahrenheit
var tempF = (response.main.temp - 273.15) * 1.80 + 32;
$(currentTemperature).html((tempF).toFixed(2)+"℉");
// Display the Humidity
$(currentHumidty).html(response.main.humidity+"%");
//Display Wind speed and convert to MPH
var ws=response.wind.speed;
var windsmph=(ws*2.237).toFixed(1);
$(currentWSpeed).html(windsmph+"MPH");
// display uv index.
UVIndex(response.coord.lon,response.coord.lat);
forecast(response.id);
if(response.cod==200){
sCity=JSON.parse(localStorage.getItem("cityname"));
if (sCity==null){
sCity=[];
sCity.push(city.toUpperCase()
);
localStorage.setItem("cityname",JSON.stringify(sCity));
addToList(city);
}
else {
if(find(city)>0){
sCity.push(city.toUpperCase());
localStorage.setItem("cityname",JSON.stringify(sCity));
addToList(city);
}
}
}
});
}
// returning uv index response
function UVIndex(ln,lt){
//var for uvindex and get lat, lon
var uvqURL="https://api.openweathermap.org/data/2.5/uvi?appid="+ APIKey+"&lat="+lt+"&lon="+ln;
$.ajax({
url:uvqURL,
method:"GET"
}).then(function(response){
$(currentUvindex).html(response.value);
});
}
// desplaying the next 5 days weather
function forecast(cityid){
//using the url api for the next 5 days
var queryforcastURL="https://api.openweathermap.org/data/2.5/forecast?id="+cityid+"&appid="+APIKey;
$.ajax({
url:queryforcastURL,
method:"GET"
}).then(function(response){
// loop for the 5 days
for (i=0;i<5;i++){
var date= new Date((response.list[((i+1)*8)-1].dt)*1000).toLocaleDateString();
var iconcode= response.list[((i+1)*8)-1].weather[0].icon;
// getting the icon from api url
var iconurl="https://openweathermap.org/img/wn/"+iconcode+".png";
var tempK= response.list[((i+1)*8)-1].main.temp;
var tempF=(((tempK-273.5)*1.80)+32).toFixed(2);
var humidity= response.list[((i+1)*8)-1].main.humidity;
$("#fDate"+i).html(date);
$("#fImg"+i).html("<img src="+iconurl+">");
$("#fTemp"+i).html(tempF+"℉");
$("#fHumidity"+i).html(humidity+"%");
}
});
}
//adding the searched citys to the list group. using lower case for the searched citys
function addToList(c){
var listEl= $("<li>"+c.toLowerCase()+"</li>");
$(listEl).attr("class","list-group-item");
$(listEl).attr("data-value",c.toLowerCase());
$(".list-group").append(listEl);
}
// function to show the weather of every city in the list group once you click them
function pastcitys(event){
var liEl=event.target;
if (event.target.matches("li")){
city=liEl.textContent.trim();
currentWeather(city);
}
}
// render function
function loadlastCity(){
$("ul").empty();
var sCity = JSON.parse(localStorage.getItem("cityname"));
if(sCity!==null){
sCity=JSON.parse(localStorage.getItem("cityname"));
for(i=0; i<sCity.length;i++){
addToList(sCity[i]);
}
city=sCity[i-1];
currentWeather(city);
}
}
//function to clear all the citys from the list group
function clearHistory(event){
event.preventDefault();
sCity=[];
localStorage.removeItem("cityname");
document.location.reload();
}
//click handlers
$("#search-button").on("click",displayWeather);
$(document).on("click",pastcitys);
$(window).on("load",loadlastCity);
$("#clear-history").on("click",clearHistory);
| 33.005747 | 103 | 0.580707 |
a77be7b84618227b8bb5f341a4e3f1aa1913e821 | 9,621 | js | JavaScript | packages/picasso.js/src/core/chart-components/axis/__tests__/axis-size-calculator.spec.js | pontusnyman/picasso.js | 567941ea97fa98e826197fda82445d65c4db36fd | [
"MIT"
] | null | null | null | packages/picasso.js/src/core/chart-components/axis/__tests__/axis-size-calculator.spec.js | pontusnyman/picasso.js | 567941ea97fa98e826197fda82445d65c4db36fd | [
"MIT"
] | null | null | null | packages/picasso.js/src/core/chart-components/axis/__tests__/axis-size-calculator.spec.js | pontusnyman/picasso.js | 567941ea97fa98e826197fda82445d65c4db36fd | [
"MIT"
] | null | null | null | import extend from 'extend';
import calcRequiredSize from '../axis-size-calculator';
import { DEFAULT_CONTINUOUS_SETTINGS } from '../axis-default-settings';
describe('Axis size calculator', () => {
let settings;
let ticks;
let sizeFn;
let rect;
let scale;
let isDiscrete;
let state;
beforeEach(() => {
settings = extend(true, {}, DEFAULT_CONTINUOUS_SETTINGS);
settings.labels.show = false;
settings.labels.mode = 'horizontal';
settings.line.show = false;
settings.ticks.show = false;
settings.paddingStart = 0;
settings.paddingEnd = 10;
state = {
labels: {
activeMode: 'horizontal'
}
};
const bandwidth = (i, len) => 1 / len;
const start = (i, bw) => i * bw;
const pos = (s, bw) => s + (bw / 2);
const end = (s, bw) => s + bw;
ticks = ['AA', 'BB', 'CC'].map((label, i, ary) => {
const bw = bandwidth(i, ary.length);
const s = start(i, bw);
return {
label,
start: s,
position: pos(s, bw),
end: end(s, bw)
};
});
scale = {};
scale.ticks = sinon.stub().returns(ticks);
scale.bandwidth = sinon.stub().returns(1 / ticks.length);
isDiscrete = false;
rect = {
x: 0, y: 0, height: 100, width: 100
};
const data = null;
const formatter = null;
const measureText = ({ text = '' }) => ({ width: text.toString().length, height: 5 });
sizeFn = r => calcRequiredSize({
settings, rect: r, scale, data, formatter, measureText, isDiscrete, state
});
});
it('axis with no visible component have a margin of 10', () => {
const size = sizeFn(rect);
expect(size.size).to.equals(10);
});
it('the size of a vertical axis depend on text length', () => {
settings.dock = 'left';
settings.align = 'left';
settings.labels.show = true;
let size = sizeFn(rect);
expect(size.size).to.equals(16 /* = 10(margin) + 4(label padding) + 2(text size) */);
ticks[0].label = 'AAAAAA';
size = sizeFn(rect);
expect(size.size).to.equals(20 /* = 10(margin) + 4(label padding) + 6(text size) */);
});
it('the size of a vertical axis should depend on maxGlyhpCount if set', () => {
settings.dock = 'left';
settings.align = 'left';
settings.labels.show = true;
settings.labels.maxGlyphCount = 3;
let size = sizeFn(rect);
expect(size.size).to.equals(17 /* = 10(margin) + 4(label padding) + 3(text size) */);
ticks[0].label = 'AAAAAA';
size = sizeFn(rect);
expect(size.size).to.equals(17 /* = 10(margin) + 4(label padding) + 3(text size) */);
});
it("the size of a horizontal axis don't depend on text length", () => {
settings.dock = 'bottom';
settings.align = 'bottom';
settings.labels.show = true;
let size = sizeFn(rect);
expect(size.size).to.equals(19);
ticks[0].label = 'AAAAAA';
size = sizeFn(rect);
expect(size.size).to.equals(19);
});
describe('hide', () => {
beforeEach(() => {
settings.dock = 'bottom';
settings.align = 'bottom';
settings.labels.show = true;
});
it('horizontal discrete axis should be considered to large when labels requires more size then available', () => {
rect.width = 5;
isDiscrete = true;
// available bandWidth is ~1.7, required width from labels is 2
const size = sizeFn(rect);
expect(size.size).to.equals(100); // return the width of the container (rect in this test)
});
it('horizontal tilted discrete axis should be considered to large when labels requires more size then available', () => {
settings.labels.tiltAngle = 45;
settings.labels.maxEdgeBleed = Infinity;
state.labels.activeMode = 'tilted';
rect.width = 25;
isDiscrete = true;
const size = sizeFn(rect);
expect(size.size).to.equals(100); // return the width of the container (rect in this test)
});
it('horizontal tilted discrete axis should be considered to large if angle is set to zero', () => {
settings.labels.tiltAngle = 0;
state.labels.activeMode = 'tilted';
rect.width = 100;
isDiscrete = true;
const size = sizeFn(rect);
expect(size.size).to.equals(100); // return the width of the container (rect in this test)
});
it('horizontal tilted discrete axis should not be considered to large if there is only one tick', () => {
ticks.splice(1);
settings.labels.tiltAngle = 45;
state.labels.activeMode = 'tilted';
rect.width = 2; // would be considered to large if there were two ticks
isDiscrete = true;
const size = sizeFn(rect);
expect(size.size).to.not.equal(100);
});
});
describe('label mode', () => {
describe('auto', () => {
it('should switch to tilted orientation if horizontal size limit is reached', () => {
settings.dock = 'bottom';
settings.align = 'bottom';
settings.labels.show = true;
settings.labels.mode = 'auto';
rect.width = 5;
state.labels.activeMode = 'horizontal';
isDiscrete = true;
sizeFn(rect);
expect(state.labels.activeMode).to.equals('tilted');
});
it('should if set use maxGlyphCount to determine if horizontal size limit is reached', () => {
settings.dock = 'bottom';
settings.align = 'bottom';
settings.labels.show = true;
settings.labels.mode = 'auto';
settings.labels.maxGlyphCount = 200;
rect.width = 150;
state.labels.activeMode = 'horizontal';
isDiscrete = true;
sizeFn(rect);
expect(state.labels.activeMode).to.equals('tilted');
});
});
describe('horizontal', () => {
it('should handle when there are no ticks', () => {
isDiscrete = true;
settings.dock = 'left';
settings.align = 'left';
settings.labels.show = true;
state.labels.activeMode = 'horizontal';
scale.ticks = sinon.stub().returns([]);
const size = sizeFn(rect);
expect(size.size).to.equal(14); // Return the size of padding, ticks, margin but not the label size
});
});
describe('layered', () => {
it('should return correct size when docked at bottom', () => {
settings.dock = 'bottom';
settings.align = 'bottom';
settings.labels.show = true;
state.labels.activeMode = 'layered';
const size = sizeFn(rect);
expect(size.size).to.equals(28);
});
});
describe('tilted', () => {
beforeEach(() => {
settings.labels.maxEdgeBleed = Infinity;
settings.labels.tiltAngle = 45;
settings.dock = 'bottom';
settings.align = 'bottom';
settings.labels.show = true;
state.labels.activeMode = 'tilted';
isDiscrete = true;
});
it('should return correct size when docked at bottom', () => {
const size = sizeFn(rect);
expect(size.size).to.approximately(18.9497, 0.0001);
});
it('should handle when there are no ticks', () => {
scale.ticks = sinon.stub().returns([]);
const size = sizeFn(rect);
expect(size.size).to.equal(14); // Return the size of padding, ticks, margin but not the label size
expect(size.edgeBleed).to.deep.equal({
left: 10, top: 0, right: 0, bottom: 0
}); // left is paddingEnd
});
it('maxLengthPx', () => {
settings.labels.maxLengthPx = 5;
ticks[0].label = 'AAAAAAAAAAAAAA';
const size = sizeFn(rect);
expect(size.size).to.approximately(21.07106, 0.0001);
});
it('minLengthPx', () => {
settings.labels.minLengthPx = 75;
ticks[0].label = 'A';
const size = sizeFn(rect);
expect(size.size).to.approximately(70.568542, 0.0001);
});
it('require edgeBleed', () => {
ticks[0] = { label: 'AAAAAAAAAAAAAA', position: 0.1 };
ticks[1] = { label: 'BBBBBBBBBBBBBB', position: 0.5 };
ticks[2] = { label: 'CCCCCCCCCCCCCC', position: 0.9 };
const size = sizeFn(rect);
expect(size.edgeBleed.left).to.approximately(14.89949, 0.0001);
});
it('maxEdgeBleed', () => {
settings.labels.maxEdgeBleed = 1;
ticks[0] = { label: 'AAAAAAAAAAAAAA', position: 0.1 };
ticks[1] = { label: 'BBBBBBBBBBBBBB', position: 0.5 };
ticks[2] = { label: 'CCCCCCCCCCCCCC', position: 0.9 };
const size = sizeFn(rect);
expect(size.edgeBleed.left).to.equals(11); // maxEdgeBleed + paddingEnd
});
});
});
describe('ticks and line', () => {
it('measure ticks', () => {
settings.ticks.show = true;
settings.ticks.margin = 4;
settings.ticks.tickSize = 7;
const size = sizeFn(rect);
expect(size.size).to.equals(21);
});
it('measure minorTicks', () => {
settings.minorTicks.show = true;
settings.minorTicks.margin = 2;
settings.minorTicks.tickSize = 9;
const size = sizeFn(rect);
expect(size.size).to.equals(21);
});
it('measure line', () => {
settings.line.show = true;
settings.line.strokeWidth = 5;
const size = sizeFn(rect);
expect(size.size).to.equals(15);
});
it('minor and major ticks', () => {
settings.ticks.show = true;
settings.ticks.margin = 4;
settings.ticks.tickSize = 7;
settings.minorTicks.show = true;
settings.minorTicks.margin = 0;
settings.minorTicks.tickSize = 2;
const size = sizeFn(rect);
expect(size.size).to.equals(21);
});
});
});
| 31.752475 | 125 | 0.581333 |
a77e7f91a9d22b43012468f3bc52a0355240dc87 | 4,767 | js | JavaScript | web/bundles/applicationbootstrap/js/forms/jquery.inputmask/Gruntfile.js | sidczak/development | 75eddfba83ecc726c6eb30b0dd1a4c2568f6a9b7 | [
"MIT"
] | 1 | 2017-12-02T13:44:14.000Z | 2017-12-02T13:44:14.000Z | vendor/bower/jquery.inputmask/Gruntfile.js | dcb9/bobdarex | 56d6005791daaa7b1a3a70a16995b1aeecf49c7c | [
"BSD-3-Clause"
] | null | null | null | vendor/bower/jquery.inputmask/Gruntfile.js | dcb9/bobdarex | 56d6005791daaa7b1a3a70a16995b1aeecf49c7c | [
"BSD-3-Clause"
] | null | null | null | module.exports = function (grunt) {
function createBanner(fileName) {
return '/*!\n' +
'* ' + fileName + '\n' +
'* http://github.com/RobinHerbots/jquery.inputmask\n' +
'* Copyright (c) 2010 - <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>\n' +
'* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\n' +
'* Version: <%= pkg.version %>\n' +
'*/\n';
}
function createUglifyConfig(path) {
var uglifyConfig = {};
var srcFiles = grunt.file.expand(path + "/*.js");
for (var srcNdx in srcFiles) {
var dstFile = srcFiles[srcNdx].replace("js/", "");
wrapAMDLoader(srcFiles[srcNdx], "build/" + dstFile, dstFile.indexOf("extension") == -1 ? ["jquery"] : ["jquery", "./jquery.inputmask"]);
uglifyConfig[dstFile] = {
dest: 'dist/inputmask/' + dstFile,
src: "build/" + dstFile,
options: { banner: createBanner(dstFile), beautify: true, mangle: false, preserveComments: "some" }
};
}
srcFiles = grunt.file.expand(path + "/*.extensions.js");
srcFiles.splice(0, 0, "js/jquery.inputmask.js");
uglifyConfig["inputmaskbundle"] = {
files: {
'dist/<%= pkg.name %>.bundle.js': srcFiles
},
options: { banner: createBanner('<%= pkg.name %>.bundle'), beautify: true, mangle: false, preserveComments: "some" }
}
uglifyConfig["inputmaskbundlemin"] = {
files: {
'dist/<%= pkg.name %>.bundle.min.js': srcFiles
},
options: { banner: createBanner('<%= pkg.name %>.bundle'), preserveComments: "some" }
}
return uglifyConfig;
}
function wrapAMDLoader(src, dst, dependencies) {
function stripClosureExecution() {
return srcFile.replace(new RegExp("\\(jQuery\\).*$"), "");
}
var srcFile = grunt.file.read(src),
dstContent = "(function (factory) {" +
"if (typeof define === 'function' && define.amd) {" +
"define(" + JSON.stringify(dependencies) + ", factory);" +
"} else {" +
"factory(jQuery);" +
"}}\n" + stripClosureExecution() + ");";
grunt.file.write(dst, dstContent);
}
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: createUglifyConfig("js"),
clean: ["dist"],
qunit: {
files: ['qunit/qunit.html']
},
bump: {
options: {
files: ['package.json', 'bower.json', 'jquery.inputmask.jquery.json'],
updateConfigs: ['pkg'],
commit: false,
createTag: false,
push: false
}
},
release: {
options: {
bump: false,
commitMessage: 'jquery.inputmask <%= version %>'
}
},
nugetpack: {
dist: {
src: function () { return process.platform === "linux" ? 'nuget/jquery.inputmask.linux.nuspec' : 'nuget/jquery.inputmask.nuspec'; }(),
dest: 'dist/',
options: {
version: '<%= pkg.version %>'
}
}
},
nugetpush: {
dist: {
src: 'dist/jQuery.InputMask.<%= pkg.version %>.nupkg'
}
},
shell: {
options: {
stderr: false
},
gitcommitchanges: {
command: ['git add .',
'git reset -- package.json',
'git commit -m "jquery.inputmask <%= pkg.version %>"'
].join('&&')
}
}
});
// Load the plugin that provides the tasks.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-bump');
grunt.loadNpmTasks('grunt-release');
grunt.loadNpmTasks('grunt-nuget');
grunt.loadNpmTasks('grunt-shell');
grunt.registerTask('publish:patch', ['clean', 'bump:patch', 'uglify', 'shell:gitcommitchanges', 'release', 'nugetpack', 'nugetpush']);
grunt.registerTask('publish:minor', ['clean', 'bump:minor', 'uglify', 'shell:gitcommitchanges', 'release', 'nugetpack', 'nugetpush']);
grunt.registerTask('publish:major', ['clean', 'bump:major', 'uglify', 'shell:gitcommitchanges', 'release', 'nugetpack', 'nugetpush']);
// Default task(s).
grunt.registerTask('default', ['clean', 'uglify']);
}; | 39.07377 | 150 | 0.507027 |
a77ec1d2142484f1d64bb957fa6e89a13df511e9 | 8,891 | js | JavaScript | lib/iter-sync.js | Darkhogg/polyethylene | e95e6faf341a21b71490775a5f8f7b0d601df7e8 | [
"MIT"
] | 21 | 2018-08-06T21:21:01.000Z | 2022-03-25T23:27:02.000Z | lib/iter-sync.js | Darkhogg/polyethylene | e95e6faf341a21b71490775a5f8f7b0d601df7e8 | [
"MIT"
] | 8 | 2019-01-25T18:08:07.000Z | 2022-03-20T22:15:33.000Z | lib/iter-sync.js | Darkhogg/polyethylene | e95e6faf341a21b71490775a5f8f7b0d601df7e8 | [
"MIT"
] | 2 | 2019-08-22T11:31:37.000Z | 2022-03-25T23:26:40.000Z | const {identity, comparator, parseOptions, asserts} = require('./utils');
const AsyncIterator = require('./iter-async');
function * appendGen (iterA, iterB) {
yield * iterA;
yield * iterB;
}
function * prependGen (iterA, iterB) {
yield * iterB;
yield * iterA;
}
function * dropGen (iter, num) {
let rem = num;
for (const elem of iter) {
if (rem-- <= 0) {
yield elem;
}
}
}
function * takeGen (iter, num) {
let rem = num;
for (const elem of iter) {
if (rem-- <= 0) {
return;
}
yield elem;
}
}
function * dropLastGen (iter, num) {
const buf = Array(num);
let pos = 0;
let size = 0;
for (const elem of iter) {
if (size >= num) {
yield num ? buf[pos] : elem;
} else {
size++;
}
if (num) {
buf[pos] = elem;
pos = ((pos + 1) % num);
}
}
}
function * takeLastGen (iter, num) {
const buf = Array(num);
let pos = 0;
let size = 0;
for (const elem of iter) {
size = size >= num ? num : size + 1;
if (num) {
buf[pos] = elem;
pos = ((pos + 1) % num);
}
}
pos = size >= num ? pos : 0;
for (let i = 0; i < size; i++) {
yield buf[pos];
pos = ((pos + 1) % num);
}
}
function * sliceNegPosGen (iter, start, end) {
const buf = Array(start);
let pos = 0;
let size = 0;
let num = end;
for (const elem of iter) {
if (size >= start && end) {
num--;
}
size = size >= start ? start : size + 1;
if (start) {
buf[pos] = elem;
pos = ((pos + 1) % start);
}
}
pos = size >= start ? pos : 0;
for (let i = 0; i < Math.min(size, num); i++) {
yield buf[pos];
pos = ((pos + 1) % start);
}
}
function sliceGen (iter, start, end) {
if (start >= 0 && end >= 0) {
return takeGen(dropGen(iter, start), end - start);
} else if (start < 0 && end >= 0) {
return sliceNegPosGen(iter, -start, end);
} else if (start >= 0) { // && end < 0
return dropLastGen(dropGen(iter, start), -end);
} else { // start < 0 && end < 0
return dropLastGen(takeLastGen(iter, -start), -end);
}
}
function * dropWhileGen (iter, func) {
let idx = 0;
let yielding = false;
for (const elem of iter) {
if (yielding || !func(elem, idx++)) {
yielding = true;
yield elem;
}
}
}
function * takeWhileGen (iter, func) {
let idx = 0;
for (const elem of iter) {
if (!func(elem, idx++)) {
return;
}
yield elem;
}
}
function * filterGen (iter, func) {
let idx = 0;
for (const elem of iter) {
if (func(elem, idx++)) {
yield elem;
}
}
}
function * mapGen (iter, func) {
let idx = 0;
for (const elem of iter) {
yield func(elem, idx++);
}
}
function * tapGen (iter, func) {
let idx = 0;
for (const elem of iter) {
func(elem, idx++);
yield elem;
}
}
function * flattenGen (iter) {
for (const elem of iter) {
yield * elem;
}
}
function * groupGen (iter, num) {
let group = [];
for (const elem of iter) {
group.push(elem);
if (group.length === num) {
yield group;
group = [];
}
}
if (group.length) {
yield group;
}
}
function * groupWhileGen (iter, func) {
let group = [];
for (const elem of iter) {
if (group.length === 0 || func(elem, group[group.length - 1], group[0])) {
group.push(elem);
} else {
yield group;
group = [elem];
}
}
if (group.length) {
yield group;
}
}
function * uniqueGen (iter, func) {
const seen = new Set();
for (const elem of iter) {
const key = func(elem);
if (!seen.has(key)) {
yield elem;
seen.add(key);
}
}
}
function * reverseGen (iter, func) {
const buf = Array.from(iter);
for (let i = buf.length - 1; i >= 0; i--) {
yield buf[i];
}
}
function * sortGen (iter, func) {
const buf = Array.from(iter);
for (const elem of buf.sort(func)) {
yield elem;
}
}
class SyncIterable {
constructor (iterable, options = {}) {
this.options = parseOptions(options);
this._iterable = iterable;
}
* [Symbol.iterator] () {
yield * this._iterable;
}
async (options = {}) {
return new AsyncIterator(this._iterable, options);
}
append (iter, options = {}) {
asserts.isSyncIterable(iter);
return new SyncIterable(appendGen(this._iterable, iter), options);
}
concat (iter, options) {
return this.append(iter, options);
}
prepend (iter, options = {}) {
asserts.isSyncIterable(iter);
return new SyncIterable(prependGen(this._iterable, iter), options);
}
drop (num = 0, options = {}) {
asserts.isNonNegativeInteger(num);
return new SyncIterable(dropGen(this._iterable, num), options);
}
take (num = 0, options = {}) {
asserts.isNonNegativeInteger(num);
return new SyncIterable(takeGen(this._iterable, num), options);
}
dropLast (num = 0, options = {}) {
asserts.isNonNegativeInteger(num);
return new SyncIterable(dropLastGen(this._iterable, num), options);
}
takeLast (num = 0, options = {}) {
asserts.isNonNegativeInteger(num);
return new SyncIterable(takeLastGen(this._iterable, num), options);
}
slice (start, end, options = {}) {
asserts.isInteger(start, 'start');
asserts.isInteger(end, 'end');
return new SyncIterable(sliceGen(this._iterable, start, end), options);
}
dropWhile (func = identity, options = {}) {
asserts.isFunction(func);
return new SyncIterable(dropWhileGen(this._iterable, func), options);
}
takeWhile (func = identity, options = {}) {
asserts.isFunction(func);
return new SyncIterable(takeWhileGen(this._iterable, func), options);
}
filter (func = identity, options = {}) {
asserts.isFunction(func);
return new SyncIterable(filterGen(this._iterable, func), options);
}
map (func = identity, options = {}) {
asserts.isFunction(func);
return new SyncIterable(mapGen(this._iterable, func), options);
}
tap (func = identity, options = {}) {
asserts.isFunction(func);
return new SyncIterable(tapGen(this._iterable, func), options);
}
flatten (options = {}) {
return new SyncIterable(flattenGen(this._iterable), options);
}
flat (options) {
return this.flatten(options);
}
flatMap (func, options) {
return this.map(func, options).flatten(options);
}
group (num = 1, options = {}) {
asserts.isPositiveInteger(num);
return new SyncIterable(groupGen(this._iterable, num), options);
}
groupWhile (func = identity, options = {}) {
asserts.isFunction(func);
return new SyncIterable(groupWhileGen(this._iterable, func), options);
}
unique (func = identity, options = {}) {
asserts.isFunction(func);
return new SyncIterable(uniqueGen(this._iterable, func), options);
}
reverse (options) {
return new SyncIterable(reverseGen(this._iterable), options);
}
sort (func = comparator, options = {}) {
asserts.isFunction(func);
return new SyncIterable(sortGen(this._iterable, func), options);
}
toArray () {
return Array.from(this._iterable);
}
toObject () {
const object = {};
for (const [key, value] of this._iterable) {
object[key] = value;
}
return object;
}
find (func = identity) {
asserts.isFunction(func);
let idx = 0;
for (const elem of this._iterable) {
if (func(elem, idx++)) {
return elem;
}
}
return undefined;
}
includes (obj) {
for (const elem of this._iterable) {
if (Object.is(obj, elem) || (obj === 0 && elem === 0)) {
return true;
}
}
return false;
}
some (func = identity) {
asserts.isFunction(func);
let idx = 0;
for (const item of this._iterable) {
if (func(item, idx++)) {
return true;
}
}
return false;
}
every (func = identity) {
asserts.isFunction(func);
let idx = 0;
for (const item of this._iterable) {
if (!func(item, idx++)) {
return false;
}
}
return true;
}
reduce (reducer, init) {
asserts.isFunction(reducer);
let accumulated = init;
let isFirst = (accumulated === undefined);
let idx = 0;
for (const elem of this._iterable) {
accumulated = isFirst ? elem : reducer(accumulated, elem, idx++);
isFirst = false;
}
return accumulated;
}
forEach (func) {
asserts.isFunction(func);
let idx = 0;
for (const elem of this._iterable) {
func(elem, idx++);
}
}
join (glue = ',') {
let str = '';
let first = true;
for (const elem of this._iterable) {
str += (first ? '' : glue) + (elem == null ? '' : elem);
first = false;
}
return str;
}
drain () {
/* eslint-disable-next-line no-unused-vars */
for (const elem of this._iterable) {
/* do nothing, just iterate */
}
}
}
module.exports = SyncIterable;
| 20.486175 | 78 | 0.575526 |
a77ee776d7e11caac4ff167149a69941f1ecdc64 | 690 | js | JavaScript | src/components/Alert/Alert.js | kshirish/deck | 786895daa26720e6e65aec4618d16be215ff4d26 | [
"MIT"
] | null | null | null | src/components/Alert/Alert.js | kshirish/deck | 786895daa26720e6e65aec4618d16be215ff4d26 | [
"MIT"
] | null | null | null | src/components/Alert/Alert.js | kshirish/deck | 786895daa26720e6e65aec4618d16be215ff4d26 | [
"MIT"
] | null | null | null | import PropTypes from 'prop-types';
import styled from 'styled-components';
const SUCCESS = 'success';
const INFO = 'info';
const WARNING = 'warning';
const ERROR = 'error';
const StyledAlert = styled.div`
padding: 20px;
margin-bottom: ${(props) => props.theme.gutter};
color: ${(props) => props.theme[`${props.type}Shades`][0]};
border-left: 2px solid ${(props) => props.theme[`${props.type}Shades`][1]};
background-color: ${(props) => props.theme[`${props.type}Shades`][2]};
`;
StyledAlert.propTypes = {
className: PropTypes.string,
type: PropTypes.oneOf([SUCCESS, INFO, WARNING, ERROR]),
};
StyledAlert.defaultProps = {
type: SUCCESS,
};
export default StyledAlert;
| 25.555556 | 77 | 0.67971 |
a77f6d7608535e3dfdb6e1047a7f5e90f78a7398 | 213 | js | JavaScript | src/constants.js | kad3nce/aws-appsync-js | 1a4dae9db18af4f8d2ad5a0f3612eaa2c57b18e9 | [
"MIT"
] | 23 | 2018-01-30T18:54:02.000Z | 2021-08-23T00:34:20.000Z | src/constants.js | kad3nce/aws-appsync-js | 1a4dae9db18af4f8d2ad5a0f3612eaa2c57b18e9 | [
"MIT"
] | 1 | 2019-01-08T09:34:02.000Z | 2019-01-08T09:34:14.000Z | src/constants.js | kad3nce/aws-appsync-js | 1a4dae9db18af4f8d2ad5a0f3612eaa2c57b18e9 | [
"MIT"
] | 3 | 2018-08-20T14:25:59.000Z | 2018-10-15T00:49:28.000Z | const API_KEY_MODE = 'API_KEY_MODE';
const AWS_IAM = 'AWS_IAM';
const AMAZON_COGNITO_USER_POOLS = 'AMAZON_COGNITO_USER_POOLS';
export const authMode = {
API_KEY_MODE,
AWS_IAM,
AMAZON_COGNITO_USER_POOLS,
};
| 21.3 | 62 | 0.779343 |
a7804db583c62918bcdbee53ce63e0627b680fe5 | 392 | js | JavaScript | node_modules/@carbon/icons/lib/stop/16.js | fabianklonsdorf/ixhh | d595f89ddb8320b4f1847e9e5bd6265f9a529db3 | [
"Apache-2.0"
] | null | null | null | node_modules/@carbon/icons/lib/stop/16.js | fabianklonsdorf/ixhh | d595f89ddb8320b4f1847e9e5bd6265f9a529db3 | [
"Apache-2.0"
] | 10 | 2021-03-01T20:53:14.000Z | 2022-02-26T17:48:08.000Z | node_modules/@carbon/icons/lib/stop/16.js | fabianklonsdorf/ixhh | d595f89ddb8320b4f1847e9e5bd6265f9a529db3 | [
"Apache-2.0"
] | null | null | null | 'use strict';
var _16 = {
elem: 'svg',
attrs: {
xmlns: 'http://www.w3.org/2000/svg',
viewBox: '0 0 16 16',
width: 16,
height: 16,
},
content: [
{
elem: 'path',
attrs: {
d:
'M12 4v8H4V4h8m0-1H4c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h8c.6 0 1-.4 1-1V4c0-.6-.4-1-1-1z',
},
},
],
name: 'stop',
size: 16,
};
module.exports = _16;
| 15.68 | 95 | 0.464286 |
a780bfc2e271b1904e674044be0ea8ec0bbf1f60 | 2,669 | js | JavaScript | src/main/webapp/resources/shop/js/jquery.lSelect.js | yangge0301/jfinalshop-b2b2c | 869483d9fd549e090a7f2d976e0b4de45f52be2a | [
"Apache-2.0"
] | 3 | 2019-09-07T12:22:58.000Z | 2020-02-25T10:17:03.000Z | src/main/webapp/resources/shop/js/jquery.lSelect.js | yangge0301/jfinalshop-b2b2c | 869483d9fd549e090a7f2d976e0b4de45f52be2a | [
"Apache-2.0"
] | null | null | null | src/main/webapp/resources/shop/js/jquery.lSelect.js | yangge0301/jfinalshop-b2b2c | 869483d9fd549e090a7f2d976e0b4de45f52be2a | [
"Apache-2.0"
] | 5 | 2019-03-21T07:08:11.000Z | 2020-10-08T02:36:39.000Z | /*
* C o p y r i g h t 2 0 0 5 - 2 0 1 6 s h o p x x . n e t . A l l r i g h t s r e s e r v e d .
* S u p p o r t : h t t p : / / w w w . s h o p x x . n e t
* L i c e n s e : h t t p : / / w w w . s h o p x x . n e t / l i c e n s e
*/
(function($) {
$.fn.extend({
lSelect: function(options) {
var settings = {
choose: "请选择...",
emptyValue: "",
cssStyle: {"margin-right": "4px"},
url: null,
type: "GET"
};
$.extend(settings, options);
var cache = {};
return this.each(function() {
var lSelectId = new Date().getTime();
var $input = $(this);
var treePath = $input.attr("treePath");
if (treePath != null && treePath != "") {
var ids = (treePath + $input.val() + ",").split(",");
var $position = $input;
for (var i = 1; i < ids.length; i ++) {
$position = addSelect($position, ids[i - 1], ids[i]);
}
} else {
addSelect($input, null, null);
}
function addSelect($position, parentId, currentId) {
$position.nextAll("select[name=" + lSelectId + "]").remove();
if ($position.is("select") && (parentId == null || parentId == "")) {
return false;
}
if (cache[parentId] == null) {
$.ajax({
url: settings.url,
type: settings.type,
data: parentId != null ? {parentId: parentId} : null,
dataType: "json",
cache: false,
async: false,
success: function(data) {
cache[parentId] = data;
}
});
}
var data = cache[parentId];
if ($.isEmptyObject(data)) {
return false;
}
var select = '<select class="selectArea" name="' + lSelectId + '">';
if (settings.emptyValue != null && settings.choose != null) {
select += '<option value="' + settings.emptyValue + '">' + settings.choose + '</option>';
}
$.each(data, function(i, option) {
if(option.value == currentId) {
select += '<option value="' + option.value + '" selected="selected">' + option.name + '</option>';
} else {
select += '<option value="' + option.value + '">' + option.name + '</option>';
}
});
select += '</select>';
return $(select).css(settings.cssStyle).insertAfter($position).on("change", function() {
var $this = $(this);
if ($this.val() == "") {
var $prev = $this.prev("select[name=" + lSelectId + "]");
if ($prev.size() > 0) {
$input.val($prev.val());
} else {
$input.val(settings.emptyValue);
}
} else {
$input.val($this.val());
}
addSelect($this, $this.val(), null);
});
}
});
}
});
})(jQuery); | 30.329545 | 105 | 0.497939 |
a780cdc407177233d40fe554e52c1c05a0f3618d | 2,136 | js | JavaScript | src/renderer/src/scripts/fields/min-max.js | oscarmarcelo/loci | c409d01e3451ff1a9753b2c3b3010facca8b56bd | [
"0BSD"
] | null | null | null | src/renderer/src/scripts/fields/min-max.js | oscarmarcelo/loci | c409d01e3451ff1a9753b2c3b3010facca8b56bd | [
"0BSD"
] | 3 | 2021-03-10T20:25:25.000Z | 2022-02-09T00:35:17.000Z | src/renderer/src/scripts/fields/min-max.js | oscarmarcelo/loci | c409d01e3451ff1a9753b2c3b3010facca8b56bd | [
"0BSD"
] | null | null | null | import {appendToSettings} from './utils';
export default (field, options) => {
const template = document.querySelector('#min-max');
const clone = template.content.cloneNode(template);
const minInput = clone.querySelector('[name="min"]');
const maxInput = clone.querySelector('[name="max"]');
const precisionInput = clone.querySelector('[name="precision"]');
const unitsSelect = clone.querySelector('[name="unit"]');
minInput.name = `${field.prefix}-min`;
minInput.value = options.min;
if (field.min?.min) {
minInput.min = field.min.min;
}
if (field.min?.max) {
minInput.max = field.min.max;
}
if (field.min?.step) {
minInput.step = field.min.step;
}
if (field.min?.placeholder) {
minInput.placeholder = field.min.placeholder;
}
maxInput.name = `${field.prefix}-max`;
maxInput.value = options.max;
if (field.max?.min) {
maxInput.min = field.max.min;
}
if (field.max?.max) {
maxInput.max = field.max.max;
}
if (field.max?.step) {
maxInput.step = field.max.step;
}
if (field.max?.placeholder) {
maxInput.placeholder = field.max.placeholder;
}
for (const numberInput of clone.querySelectorAll('.number-input')) {
window.initNumberInput(numberInput);
}
window.pairMinMaxInputs(minInput, maxInput);
if (field.usePrecision) {
precisionInput.name = `${field.prefix}-precision`;
if (options.precision) {
precisionInput.value = options.precision;
}
} else {
precisionInput.closest('.label-below').remove();
}
if (field.units) {
unitsSelect.name = `${field.prefix}-unit`;
const unitsOptions = new DocumentFragment();
field.units.forEach(unit => {
const option = document.createElement('option');
option.value = unit.id;
option.textContent = unit.name;
if (unit.selected) {
option.selected = true;
}
unitsOptions.append(option);
});
unitsSelect.append(unitsOptions);
if (options.unit) {
unitsSelect.value = options.unit;
}
} else {
unitsSelect.closest('.label-below').remove();
}
appendToSettings(clone);
};
| 21.795918 | 70 | 0.643727 |
a78127c589072b36922495bc5c44810b00d05d63 | 1,212 | js | JavaScript | app/routes/index.js | nbailey20/imageSearchAPI | ec88802654733749aa192e76245e8f0be4d0f76a | [
"MIT"
] | null | null | null | app/routes/index.js | nbailey20/imageSearchAPI | ec88802654733749aa192e76245e8f0be4d0f76a | [
"MIT"
] | null | null | null | app/routes/index.js | nbailey20/imageSearchAPI | ec88802654733749aa192e76245e8f0be4d0f76a | [
"MIT"
] | null | null | null | 'use strict';
module.exports = function (app, db) {
var request = require("request");
var addToDB = require("../models/addDBhandler.js");
var pullFromDB = require("../models/pullDBhandler.js");
app.route("/")
.get(function (req, res) {
res.sendFile(process.cwd() + "/public/index.html");
});
app.route("/api/imagesearch/:QUERY")
.get(function (req,res) {
var offset = 1;
if (req.query["offset"]) {
offset = +req.query["offset"];
}
var urls = [];
var end = "https://www.googleapis.com/customsearch/v1?key=AIzaSyAZz38HvWaNZ5N3HwkzdqtBvNWf_onrdhs&cx=001144473970011108897:sc0uuj_4bns&q=";
end += req.params.QUERY + "&start=" + ((offset-1)*10+1);
request(end,
function(err, response, body) {
if (err) throw err;
var data = JSON.parse(body);
for (var i = 0; i < 10; i++) {
urls.push([data.items[i].pagemap.imageobject[0].url, data.items[i].title]);
}
res.send(JSON.stringify(urls));
addToDB(db, req.params.QUERY);
});
});
app.route("/api/latest/imagesearch")
.get(function (req,res) {
pullFromDB(db, function (err, data) {
if (err) throw err;
console.log(data);
res.send(JSON.stringify(data));
});
});
}; | 26.933333 | 142 | 0.617162 |
a781e003b3e69fbf1399408eaf593f0e4d1e81be | 1,596 | js | JavaScript | core/server/data/importer/handlers/json.js | anudr01d/anudr01d.github.io | f0886dce42932c2fc6bab5446c0707c441412d70 | [
"MIT"
] | 153 | 2015-04-08T22:04:08.000Z | 2021-11-23T20:17:25.000Z | core/server/data/importer/handlers/json.js | anudr01d/anudr01d.github.io | f0886dce42932c2fc6bab5446c0707c441412d70 | [
"MIT"
] | 371 | 2020-03-04T21:51:56.000Z | 2022-03-31T20:59:11.000Z | core/server/data/importer/handlers/json.js | anudr01d/anudr01d.github.io | f0886dce42932c2fc6bab5446c0707c441412d70 | [
"MIT"
] | 280 | 2015-04-10T20:02:50.000Z | 2022-01-19T02:19:25.000Z | var _ = require('lodash'),
Promise = require('bluebird'),
fs = require('fs-extra'),
errors = require('../../../errors'),
i18n = require('../../../i18n'),
JSONHandler;
JSONHandler = {
type: 'data',
extensions: ['.json'],
contentTypes: ['application/octet-stream', 'application/json'],
directories: [],
loadFile: function (files, startDir) {
/*jshint unused:false */
// @TODO: Handle multiple JSON files
var filePath = files[0].path;
return Promise.promisify(fs.readFile)(filePath).then(function (fileData) {
var importData;
try {
importData = JSON.parse(fileData);
// if importData follows JSON-API format `{ db: [exportedData] }`
if (_.keys(importData).length === 1) {
if (!importData.db || !Array.isArray(importData.db)) {
throw new Error(i18n.t('errors.data.importer.handlers.json.invalidJsonFormat'));
}
importData = importData.db[0];
}
return importData;
} catch (e) {
errors.logError(e, i18n.t('errors.data.importer.handlers.json.apiDbImportContent'),
i18n.t('errors.data.importer.handlers.json.checkImportJsonIsValid'));
return Promise.reject(new errors.BadRequestError(i18n.t('errors.data.importer.handlers.json.failedToParseImportJson')));
}
});
}
};
module.exports = JSONHandler;
| 36.272727 | 136 | 0.537594 |
a78218e2ac273aae06bd0ae123b3c673795ce479 | 2,741 | js | JavaScript | src/connectors.js | deusfinance/app-ui | cd019bbeb3e6f79d643a986811125131917e3cc5 | [
"MIT"
] | 23 | 2020-10-10T15:22:03.000Z | 2022-03-08T20:44:44.000Z | src/connectors.js | deusfinance/app-ui | cd019bbeb3e6f79d643a986811125131917e3cc5 | [
"MIT"
] | 4 | 2021-04-10T23:17:26.000Z | 2022-01-28T17:04:12.000Z | src/connectors.js | deusfinance/app-ui | cd019bbeb3e6f79d643a986811125131917e3cc5 | [
"MIT"
] | 11 | 2020-12-21T04:58:57.000Z | 2022-03-18T13:57:45.000Z | import { InjectedConnector } from '@web3-react/injected-connector'
import { WalletConnectConnector } from '@web3-react/walletconnect-connector'
import { FrameConnector } from '@web3-react/frame-connector'
import { WalletLinkConnector } from '@web3-react/walletlink-connector'
import { FortmaticConnector } from '@web3-react/fortmatic-connector'
import { ChainId, rpcConfig } from './constant/web3'
const supportedChainIds = Object.values(ChainId)
const INFURA_KEY = process.env.REACT_APP_INFURA_KEY
const FORTMATIC_KEY = process.env.REACT_APP_FORTMATIC_KEY
const RPC_URLS = {
1: 'https://mainnet.infura.io/v3/' + INFURA_KEY,
4: 'https://rinkeby.infura.io/v3/' + INFURA_KEY,
56: 'https://bsc-dataseed1.binance.org',
97: 'https://data-seed-prebsc-1-s1.binance.org:8545',
100: 'https://rpc.xdaichain.com',
4002: 'https://rpc.testnet.fantom.network/',
128: 'https://http-mainnet-node.huobichain.com',
256: 'https://http-testnet.hecochain.com',
250: 'https://rpcapi.fantom.network'
}
export const injected = new InjectedConnector({
supportedChainIds
})
const POLLING_INTERVAL = 15000
//only mainnet (walletconnect only one chain supports)
export const walletconnect_eth = new WalletConnectConnector({
rpc: { 1: RPC_URLS[1] },
// bridge: 'https://bridge.walletconnect.org',
// qrcode: true,
pollingInterval: POLLING_INTERVAL
})
//bsc
// export const walletconnect_Rinkeby = new WalletConnectConnector({
// rpc: { 4: RPC_URLS[4] },
// qrcode: true,
// // bridge: 'https://pancakeswap.bridge.walletconnect.org/',
// pollingInterval: POLLING_INTERVAL
// })
export const walletconnect_polygon = new WalletConnectConnector({
rpc: { [ChainId.MATIC]: rpcConfig[ChainId.MATIC].rpcUrls[0] },
qrcode: true,
pollingInterval: POLLING_INTERVAL
})
export const walletlink = new WalletLinkConnector({
url: RPC_URLS[1],
appName: 'app.deus.finance'
})
export const fortmatic = new FortmaticConnector({
apiKey: FORTMATIC_KEY,
chainId: 1
})
export const frame = new FrameConnector({ supportedChainIds: [1] })
export const ConnectorNames = {
Injected: 'MetaMask',
WalletConnect_ETH: 'WalletConnect (ETH)',
// WalletConnect_Rinkeby: 'WalletConnect (Rinkeby)',
WalletConnect_Polygon: 'WalletConnect (Polygon)',
WalletLink: 'WalletLink (ETH)',
Ledger: 'Ledger',
Trezor: 'Trezor',
Lattice: 'Lattice',
Frame: 'Frame',
Fortmatic: 'Fortmatic'
}
export const connectorsByName = {
[ConnectorNames.Injected]: injected,
[ConnectorNames.WalletConnect_ETH]: walletconnect_eth,
// [ConnectorNames.WalletConnect_Rinkeby]: walletconnect_Rinkeby,
[ConnectorNames.WalletConnect_Polygon]: walletconnect_polygon,
[ConnectorNames.WalletLink]: walletlink,
[ConnectorNames.Fortmatic]: fortmatic
}
| 32.630952 | 76 | 0.742065 |
a7825b1c132c62a35bf9d70dd25eeba05af9a8bd | 667 | js | JavaScript | Jint.Tests.Test262/test/built-ins/Array/prototype/map/15.4.4.19-3-22.js | marius-klimantavicius/jint | f180d16e7c38fa13b3d01b69ff9a48e7f388987e | [
"BSD-2-Clause"
] | 2,602 | 2015-01-02T10:45:13.000Z | 2022-03-30T23:04:17.000Z | Jint.Tests.Test262/test/built-ins/Array/prototype/map/15.4.4.19-3-22.js | marius-klimantavicius/jint | f180d16e7c38fa13b3d01b69ff9a48e7f388987e | [
"BSD-2-Clause"
] | 727 | 2015-01-02T13:58:22.000Z | 2022-03-31T16:33:29.000Z | Jint.Tests.Test262/test/built-ins/Array/prototype/map/15.4.4.19-3-22.js | marius-klimantavicius/jint | f180d16e7c38fa13b3d01b69ff9a48e7f388987e | [
"BSD-2-Clause"
] | 527 | 2015-01-08T16:04:26.000Z | 2022-03-24T03:34:47.000Z | // Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.map
es5id: 15.4.4.19-3-22
description: >
Array.prototype.map throws TypeError exception when 'length' is an
object with toString and valueOf methods that don�t return
primitive values
---*/
function callbackfn(val, idx, obj) {
return val > 10;
}
var obj = {
1: 11,
2: 12,
length: {
valueOf: function() {
return {};
},
toString: function() {
return {};
}
}
};
assert.throws(TypeError, function() {
Array.prototype.map.call(obj, callbackfn);
});
| 20.212121 | 70 | 0.647676 |
a78279c41720aecb78c6779a6e882d533d7dcde6 | 20,877 | js | JavaScript | index.js | thisisnagano/questionnaire-app-dev | 61a5fa51721b2f40717810560172a2208ecfb4be | [
"MIT"
] | 6 | 2018-12-13T02:50:20.000Z | 2019-12-24T00:32:25.000Z | index.js | thisisnagano/questionnaire-app-dev | 61a5fa51721b2f40717810560172a2208ecfb4be | [
"MIT"
] | null | null | null | index.js | thisisnagano/questionnaire-app-dev | 61a5fa51721b2f40717810560172a2208ecfb4be | [
"MIT"
] | 9 | 2018-11-30T11:05:36.000Z | 2020-08-13T03:09:53.000Z | var express = require('express');
var app = express();
var bodyParser = require('body-parser');
var moment = require('moment');
var favicon = require('serve-favicon');
var jsforce = require('jsforce');
var decodeUriComponent = require('decode-uri-component');
var lowerCase = require('lower-case');
var session = require('express-session');
// アンケート回答のコンポーネントファイルパスObject
var answerCompPathObj = {
"選択リスト": "../partials/selectListComp.ejs",
"チェックボックス": "../partials/checkboxComp.ejs",
"ラジオボタン": "../partials/radioButtonComp.ejs",
"テキスト": "../partials/textboxComp.ejs",
"テキストエリア": "../partials/textAreaComp.ejs"
};
var respondentName = '';
app.set('port', (process.env.PORT || 5000));
app.use(express.static(__dirname + '/public'));
app.use(favicon(__dirname + '/public/favicon16.ico'));
// views is directory for all template files
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs');
app.use( bodyParser.json() );
app.use( bodyParser.urlencoded() );
app.use(session({ secret: 'yabumi_dev_app', cookie: { maxAge: 600000 }}));
//パラメータなしの場合(不正な呼び出し)
app.get('/', function(request, response) {
var initResult = new Array();
var respondentInfo = {
"name": "",
"seibetsu": "",
"nendai": ""
};
request.session.respondentName = "";
alertType = 'alert-danger';
msg = "Error:アンケート情報を取得できませんでした。";
response.render('pages/error', {alertType: alertType, message: msg, respondentInfo: respondentInfo} );
});
app.listen(app.get('port'), function() {
console.log('Node app is running on port', app.get('port'));
});
var pg = require('pg');
// プレビュー画面の処理
app.get('/preview', function (request, response) {
var serverUrl = decodeURIComponent(request.query.serverUrl);
var qId = request.query.qId;
console.log('serverUrl:' + serverUrl);
console.log('qId:' + qId);
var conn = new jsforce.Connection({
loginUrl : serverUrl
});
var username = process.env.SF_USERID;
var password = process.env.SF_PASSWORD;
var respondentInfo = {
"name": "",
"seibetsu": "",
"nendai": ""
};
conn.login(username, password, function(err, userInfo) {
if (err) {
alertType = 'alert-danger';
msg = "Error:アンケート情報を取得できませんでした。";
response.render('pages/error', {alertType: alertType, message: msg, respondentInfo: respondentInfo} );
return console.error(err);
}
var queryStr = "SELECT id, name, questionnairetitle__c, no__c, type__c, answer__c FROM QuestionnaireQuestion__c WHERE Questionnaire__c = \'" + qId + "\' ORDER BY Questionnaire__c ASC, No__c ASC ";
conn.query(queryStr, function(err, result) {
if (err) {
alertType = 'alert-danger';
msg = "Error:アンケート情報を取得できませんでした。";
response.render('pages/error', {alertType: alertType, message: msg, respondentInfo: respondentInfo} );
console.log("errorです : ");
return console.error(err);
}
if (result.done) {
if(result.records.length > 0){
var parentTitle = '';
if(result.records.length > 0){
parentTitle = result.records[0].QuestionnaireTitle__c;
}
respondentInfo["name"] = 'プレビュー';
respondentInfo["seibetsu"] = '';
respondentInfo["nendai"] = '';
var ansMap = new Object();
// Postgres側の項目名に合わせる(KeyをLowerCaseにする)
var recList = new Array();
for(var i = 0; i < result.records.length; i++){
var rec = new Object();
Object.keys(result.records[i]).forEach(function(key) {
if (key != "attributes"){
rec[lowerCase(key)] = this[key];
console.log("key:" + lowerCase(key));
console.log("value:" + this[key]);
}
}, result.records[i]);
rec["sfid"] = result.records[i].Id;
ansMap[result.records[i].Id] = new Array();
recList.push(rec);
}
console.log(recList[0].type__c);
console.log(JSON.stringify(recList));
response.render('pages/qa', {results: recList, ansMap: ansMap, title: parentTitle, answerCompPathObj: answerCompPathObj, resSfid: "", respondentInfo: respondentInfo, previewFlg: true, answeredFlg: false} );
}
else{
alertType = 'alert-danger';
msg = "Error:アンケート情報を取得できませんでした。";
response.render('pages/error', {alertType: alertType, message: msg, respondentInfo: respondentInfo} );
}
}
else{
alertType = 'alert-danger';
msg = "Error:アンケート情報を取得できませんでした。";
response.render('pages/error', {alertType: alertType, message: msg, respondentInfo: respondentInfo} );
}
});
});
});
// アンケート画面の処理
app.get('/qa', function (request, response) {
pg.connect(process.env.DATABASE_URL, function(err, client, done) {
var sfid = '';
var resSfid = request.query.resSfid;
var selectStr = 'SELECT * FROM salesforce.questionnairequestion__c ';
var whereStr = '';
console.log("resSfid:" + resSfid);
var alertType = '';
var msg = '';
var respondentInfo = {
"name": "",
"seibetsu": "",
"nendai": ""
};
// 回答者情報を取得
var resSfidDecrypt = '';
if(!(typeof resSfid === "undefined") && resSfid != ''){
resSfidDecrypt = decrypt(resSfid);
console.log('resSfid:' + resSfidDecrypt);
}
var selectRespondent = 'SELECT * FROM salesforce.questionnairerespondent__c WHERE sfid = \'' + resSfidDecrypt + '\'';
client.query(selectRespondent, function(err, respondentResult) {
done();
if (err){
console.error(err);
alertType = 'alert-danger';
msg = "Error " + err;
response.render('pages/error', {alertType: alertType, message: msg, respondentInfo: respondentInfo} );
}
else{
// 回答者情報を取得できた場合
if(respondentResult.rows.length > 0){
if(!(typeof request.query.sfid === "undefined") && request.query.sfid != ''){
console.log('request.query.sfid:' + request.query.sfid);
sfid = decrypt(request.query.sfid);
console.log('sfid:' + sfid);
whereStr = ' WHERE questionnaire__c LIKE \'' + sfid + '%\'';
// 回答者の名前を取得
respondentName = '';
if(!(typeof respondentResult.rows[0].sei__c === "undefined") && respondentResult.rows[0].sei__c != ''){
respondentName = respondentResult.rows[0].sei__c;
}
if(!(typeof respondentResult.rows[0].mei === "undefined") && respondentResult.rows[0].mei != ''){
if(respondentName != ''){
respondentName += ' ';
}
respondentName += respondentResult.rows[0].mei;
}
// セッションに回答者名を格納
request.session.respondentName = respondentName;
respondentInfo["name"] = respondentName;
respondentInfo["seibetsu"] = respondentResult.rows[0].seibetsu__c;
respondentInfo["nendai"] = respondentResult.rows[0].nendai__c;
console.log('respondentInfo:' + respondentInfo["name"]);
console.log('respondentInfo:' + respondentInfo["seibetsu"]);
console.log('respondentInfo:' + respondentInfo["nendai"]);
}
var queryStr = selectStr + whereStr + ' ORDER BY questionnaire__c ASC, no__c ASC ';
client.query(queryStr, function(err, result) {
done();
if (err){
console.error(err);
alertType = 'alert-danger';
msg = "Error " + err;
response.render('pages/error', {alertType: alertType, message: msg, respondentInfo: respondentInfo} );
}
else{
var parentTitle = '';
if(result.rows.length > 0){
parentTitle = result.rows[0].questionnairetitle__c;
}
// 設問回答マップを作成
var ansMap = new Object();
result.rows.forEach(function(question){
// 回答マップにKey(設問ID)が存在しない場合、new Array()する
if(!(question.sfid in ansMap)){
ansMap[question.sfid] = new Array();
}
});
console.log('answeredflg: ' + respondentResult.rows[0].answerdatetime__c);
// 回答済みの場合、入力項目を非活性とし、回答内容を表示する
if(respondentResult.rows[0].answerdatetime__c){
console.log('回答済み');
// 回答内容を取得
var ansListQuery = "SELECT "
+ "a.sfid a_sfid "
+ ",a.name a_name "
+ ",a.question__c a_question "
+ ",a.answer__c a_answer "
+ ",a.answertextarea__c a_answertextarea "
+ ",q.sfid q_sfid "
+ ",q.name q_name "
+ ",q.type__c q_type "
+ ",q.no__c q_no "
+ "FROM "
+ "salesforce.answerdetails__c a "
+ ",salesforce.questionnairequestion__c q "
+ "WHERE "
+ "a.question__c = q.sfid "
+ "AND "
+ "a.questionnairerespondent__c = \'" + resSfidDecrypt + "\' "
+ "ORDER BY "
+ "q.no__c asc ";
client.query(ansListQuery, function(err, ansResult) {
done();
if (err){
console.error(err);
alertType = 'alert-danger';
msg = "Error " + err;
response.render('pages/error', {alertType: alertType, message: msg, respondentInfo: respondentInfo} );
}
else{
ansResult.rows.forEach(function(ans){
// 回答マップにKey(設問ID)が存在しない場合、new Array()する
if(!(ans.a_question in ansMap)){
ansMap[ans.a_question] = new Array();
}
if(ans.q_type != "テキストエリア"){
ansMap[ans.a_question].push(ans.a_answer);
}
else{
ansMap[ans.a_question].push(ans.a_answertextarea);
}
});
// paramを表示
Object.keys(ansMap).forEach(function (key) {
console.log(key + ":" + ansMap[key]);
});
response.render(
'pages/qa'
, {
results: result.rows
, ansMap: ansMap
, title: parentTitle
, answerCompPathObj: answerCompPathObj
, resSfid: resSfid
, respondentInfo: respondentInfo
, previewFlg: false
, answeredFlg: true
}
);
}
});
}
// 未回答の場合、入力項目を活性とし、回答内容を入力させる
else{
console.log('未回答');
response.render(
'pages/qa'
, {
results: result.rows
, ansMap: ansMap
, title: parentTitle
, answerCompPathObj: answerCompPathObj
, resSfid: resSfid
, respondentInfo: respondentInfo
, previewFlg: false
, answeredFlg: false
}
);
}
}
});
}
// 回答者を取得できなかった場合
else{
// エラー画面を表示
// 画面に表示するメッセージを設定
alertType = 'alert-danger';
msg = '該当する情報を取得できませんでした。下記までご連絡ください。';
response.render('pages/error', {alertType: alertType, message: msg, respondentInfo: respondentInfo} );
}
}
});
});
});
app.post('/qa', function (request, response) {
console.log(request.body);
// paramを表示
Object.keys(request.body).forEach(function (key) {
console.log(key + ":" + request.body[key]);
});
pg.connect(process.env.DATABASE_URL, function(err, client, done) {
var answerDateTime = moment().format('YYYY-MM-DDTHH:mm:ss');
var seibetsu = '';
if(!(typeof request.body.seibetsuRadio === "undefined") && request.body.seibetsuRadio != ''){
seibetsu = request.body.seibetsuRadio;
}
var nendai = request.body.nendaiList;
var resSfid = '';
if(!(typeof request.body.resSfid === "undefined") && request.body.resSfid != ''){
resSfid = decrypt(request.body.resSfid);
console.log('resSfid:' + resSfid);
}
console.log('answerDateTime:' + answerDateTime);
console.log('resSfid:' + resSfid);
console.log('seibetsu:' + seibetsu);
console.log('nendai:' + nendai);
// 回答詳細INSERT
var insertStr = 'INSERT INTO salesforce.answerdetails__c (question__c,questionnairerespondent__c,answer__c,answertextarea__c,createddate) VALUES ';
var insertValStr = '';
var insertPlaceHolder=[];
var insertPlaceHolderCnt=1;
// 入力内容を解析
Object.keys(request.body).forEach(function (key) {
// 対象の設問レコードIdを取得
if(key.startsWith('select_')){
questionSfid = key.replace('select_', '');
}
else if(key.startsWith('radioBtn_')){
questionSfid = key.replace('radioBtn_', '');
}
else if(key.startsWith('chkBox_')){
questionSfid = key.replace('chkBox_', '');
}
else if(key.startsWith('txtBox_')){
questionSfid = key.replace('txtBox_', '');
}
else if(key.startsWith('txtArea_')){
questionSfid = key.replace('txtArea_', '');
}
else{
return;
}
//SQLの設定値
var answer = request.body[key];
//チェックボックス(複数指定)
if(answer instanceof Array){
answer.forEach(function (value, index) {
if(insertValStr != ''){
insertValStr += ',';
}
insertValStr += ' ( $' + (insertPlaceHolderCnt++) + ',$' + (insertPlaceHolderCnt++) + ',$' + (insertPlaceHolderCnt++)+ ',$' + (insertPlaceHolderCnt++) + ',$' + (insertPlaceHolderCnt++) + ') ';
insertPlaceHolder.push(questionSfid);
insertPlaceHolder.push(resSfid);
insertPlaceHolder.push(value); //回答に値を設定
insertPlaceHolder.push(''); //回答(テキスト)は空白
insertPlaceHolder.push(answerDateTime);
});
}
else{
if(insertValStr != ''){
insertValStr += ',';
}
// テキストエリア
if(key.startsWith('txtArea_')){
insertValStr += ' ( $' + (insertPlaceHolderCnt++) + ',$' + (insertPlaceHolderCnt++) + ',$' + (insertPlaceHolderCnt++)+ ',$' + (insertPlaceHolderCnt++) + ',$' + (insertPlaceHolderCnt++) + ') ';
insertPlaceHolder.push(questionSfid);
insertPlaceHolder.push(resSfid);
insertPlaceHolder.push(''); //回答は空白
insertPlaceHolder.push(answer); //回答(テキスト)に値を設定
insertPlaceHolder.push(answerDateTime);
}
//チェックボックス(複数指定)、テキストエリア以外
else{
insertValStr += ' ( $' + (insertPlaceHolderCnt++) + ',$' + (insertPlaceHolderCnt++) + ',$' + (insertPlaceHolderCnt++)+ ',$' + (insertPlaceHolderCnt++) + ',$' + (insertPlaceHolderCnt++) + ') ';
insertPlaceHolder.push(questionSfid);
insertPlaceHolder.push(resSfid);
insertPlaceHolder.push(answer); //回答に値を設定
insertPlaceHolder.push(''); //回答(テキスト)は空白
insertPlaceHolder.push(answerDateTime);
}
}
});
// 回答のINSERT文を生成
var insertQuery = insertStr + insertValStr;
console.log("insertQuery:" + insertQuery);
console.log(insertPlaceHolder);
// 回答者のステータス更新UPDATE
var updatePlaceHolder=[];
var updatePlaceHolderCnt=1;
var updateStr = 'UPDATE salesforce.questionnairerespondent__c ';
updateStr += ' SET '
updateStr += ' answerdatetime__c = $' + (updatePlaceHolderCnt++) + ' ';
updateStr += ', nendai__c = $' + (updatePlaceHolderCnt++) + ' ';
updateStr += ', seibetsu__c = $' + (updatePlaceHolderCnt++) + ' ';
var whereStr = ' WHERE sfid = $' + (updatePlaceHolderCnt++) + ' ';
updatePlaceHolder.push(answerDateTime);
updatePlaceHolder.push(nendai);
updatePlaceHolder.push(seibetsu);
updatePlaceHolder.push(resSfid);
var queryStr = updateStr + whereStr;
console.log('queryStr:' + queryStr);
console.log(updatePlaceHolder);
var isSuccess = false;
// 回答内容をINSERT
client.query(insertQuery, insertPlaceHolder, function(err, result) {
done();
if (err){
isSuccess = false;
console.error(err); response.send("Error " + err);
}
else{
isSuccess = true;
console.log('result:' + result);
// 回答済みフラグを更新
client.query(queryStr, updatePlaceHolder, function(err, result) {
done();
if (err){
console.error(err); response.send("Error " + err);
}
else{
console.log('result:' + result);
response.redirect('qaCompleted');
}
});
}
});
});
});
app.get('/qaCompleted', function(request, response) {
console.log('アンケート回答完了');
console.log(request.session.respondentName);
// セッションから回答者名を取得
var respondentName = request.session.respondentName;
var respondentInfo = {
"name": respondentName,
"seibetsu": "",
"nendai": ""
};
response.render('pages/qaCompleted', {respondentInfo: respondentInfo});
});
//SendGridのWebhookを受けた処理
app.post('/sendgridwebhook', function(request, response) {
//ここから下はLoopの可能性あり
for (var i=0;i<request.body.length;i++){
var req = request.body[i];
//更新対象データの確認
pg.connect(process.env.DATABASE_URL, function(err, client, done) {
var answerDateTime = moment().format('YYYY-MM-DDTHH:mm:ss');
var sfid = req.salesforceid;
//キーが空の場合は何もしない
if (sfid !== undefined){
var selectStr = "SELECT *,COALESCE(tq1.mei__c,'') mei FROM salesforce.questionnairerespondent__c WHERE sendgrid_key__c = $1";
var selectPlaceHolder=[sfid];
console.log("selectStr:" + selectStr);
console.log(selectPlaceHolder);
var alertType = '';
var msg = '';
client.query(selectStr, selectPlaceHolder, function(err, respondentResult) {
var respondent;
done();
if (err){
console.error(err);
response.send('HTTP/1.1 300');
}
var updateStr='';
var updatePlaceHolder=[answerDateTime,respondentResult.rows[0].sendgrid_key__c];
switch (req.event){
case 'delivered':
//maildelivereddatetime__c を更新する
updateStr = "UPDATE salesforce.questionnairerespondent__c SET maildelivereddatetime__c = $1 WHERE sendgrid_key__c = $2 AND maildelivereddatetime__c IS NULL";
break;
case 'open':
//mailopendatetime__c を更新する
updateStr = "UPDATE salesforce.questionnairerespondent__c SET mailopendatetime__c = $1 WHERE sendgrid_key__c = $2 AND mailopendatetime__c IS NULL";
break;
case 'click':
//linkclickdatetime__c を更新する
updateStr = "UPDATE salesforce.questionnairerespondent__c SET linkclickdatetime__c = $1 WHERE sendgrid_key__c = $2 AND linkclickdatetime__c IS NULL";
break;
}
console.log("updateStr:" + updateStr);
console.log(updatePlaceHolder);
var isSuccess = false;
// 連携内容を更新
client.query(updateStr, updatePlaceHolder, function(err, result) {
done();
if (err){
console.error(err);
response.send('HTTP/1.1 300');
}else{
console.log(result);
}
});
});
}
});
}
response.send('HTTP/1.1 201');
});
//---------- 暗号化&複合化 ----------//
var crypto = require('crypto');
var algorithm = 'aes-256-ctr';
var passphrase = "7IeZlmfz";
var encrypt = (text) => {
var cipher = crypto.createCipher(algorithm,passphrase);
var crypted = cipher.update(text,'utf8','hex');
crypted += cipher.final('hex');
return crypted;
}
var decrypt = (text) => {
var decipher = crypto.createDecipher(algorithm,passphrase);
var dec = decipher.update(text,'hex','utf8');
dec += decipher.final('utf8');
return dec;
}
//---------- 暗号化&複合化 ----------//
| 36.820106 | 216 | 0.546774 |
a7830dcad70393da84643d8a7d47c99d4abb63a7 | 348 | js | JavaScript | src/containers/Root.dev.js | vikram-gsu/ReactTodoApp | 24b4419c5d176ec53daa147ada2ae7bf5a658481 | [
"MIT"
] | null | null | null | src/containers/Root.dev.js | vikram-gsu/ReactTodoApp | 24b4419c5d176ec53daa147ada2ae7bf5a658481 | [
"MIT"
] | null | null | null | src/containers/Root.dev.js | vikram-gsu/ReactTodoApp | 24b4419c5d176ec53daa147ada2ae7bf5a658481 | [
"MIT"
] | null | null | null | import React from 'react'
import App from '../components/App'
import {Provider} from 'react-redux'
import DevTools from './DevTools'
export default class Root extends React.Component{
render(){
const { store } = this.props
return (
<Provider store={store}>
<div>
<App />
<DevTools />
</div>
</Provider>
)
}
} | 15.130435 | 50 | 0.623563 |
a7831511b753a7edcfafbca6186b287171124f0c | 342 | js | JavaScript | Backend/app.js | fumalyson/Cadastro-De-Usuarios | 7eefcc282dfb33961faf37b92b752a8bd4bf24e8 | [
"MIT"
] | null | null | null | Backend/app.js | fumalyson/Cadastro-De-Usuarios | 7eefcc282dfb33961faf37b92b752a8bd4bf24e8 | [
"MIT"
] | null | null | null | Backend/app.js | fumalyson/Cadastro-De-Usuarios | 7eefcc282dfb33961faf37b92b752a8bd4bf24e8 | [
"MIT"
] | null | null | null | import express from "express"
import cors from 'cors'
import router from "./src/rotas/index.js"
import errorHandler from "./src/handlers/errorHandler.js"
const app = express()
app.use(cors())
app.use(express.json())
app.use(express.urlencoded({
extended: true
}))
app.use('/', router)
app.use(errorHandler.notFound)
export default app | 20.117647 | 57 | 0.733918 |
a78358523e41227f1f79d920d44ed399985ae6e1 | 817 | js | JavaScript | gulpfile.js | jrah/tachyons-we-craft | 7c1a0d2471026f1ca3a76a1b1f3a114cb583bd94 | [
"MIT"
] | null | null | null | gulpfile.js | jrah/tachyons-we-craft | 7c1a0d2471026f1ca3a76a1b1f3a114cb583bd94 | [
"MIT"
] | null | null | null | gulpfile.js | jrah/tachyons-we-craft | 7c1a0d2471026f1ca3a76a1b1f3a114cb583bd94 | [
"MIT"
] | null | null | null | const gulp = require('gulp');
const browserSync = require('browser-sync').create();
// sass
const sass = require('gulp-sass');
const autoprefixer = require('gulp-autoprefixer');
gulp.task('serve', ['sass'], function() {
browserSync.init({
proxy: 'grav.dev',
open: false,
tunnel: false
});
gulp.watch("css/**/*.scss", ['sass']);
});
gulp.task('sass', function() {
gulp.src("src/scss/**/*.scss")
.pipe(sass())
.pipe(gulp.dest('css'))
});
gulp.task('sass-build', function() {
gulp.src("src/scss/*.scss")
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(sass({
outputStyle: 'compressed'
}))
.pipe(rename('main.min.css'))
.pipe(gulp.dest('css'))});
gulp.task('default', ['serve']);
gulp.task('build', ['sass-build']);
| 20.425 | 53 | 0.586291 |
a783e3d5eedd3cf8114271ecc9120c2afbcd39c7 | 5,576 | js | JavaScript | node_modules/docpad-plugin-ghpages/out/ghpages.plugin.js | mobilization5/2015.mobilization.pl | 7f8e8f469a813697963181cee51998fd2a8d4781 | [
"MIT"
] | null | null | null | node_modules/docpad-plugin-ghpages/out/ghpages.plugin.js | mobilization5/2015.mobilization.pl | 7f8e8f469a813697963181cee51998fd2a8d4781 | [
"MIT"
] | null | null | null | node_modules/docpad-plugin-ghpages/out/ghpages.plugin.js | mobilization5/2015.mobilization.pl | 7f8e8f469a813697963181cee51998fd2a8d4781 | [
"MIT"
] | null | null | null | // Generated by CoffeeScript 1.9.0
(function() {
var TaskGroup, pathUtil, rimraf, safefs, safeps,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
__hasProp = {}.hasOwnProperty,
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
safeps = require('safeps');
rimraf = require('rimraf');
pathUtil = require('path');
safefs = require('safefs');
TaskGroup = require('taskgroup').TaskGroup;
module.exports = function(BasePlugin) {
var GhpagesPlugin;
return GhpagesPlugin = (function(_super) {
__extends(GhpagesPlugin, _super);
function GhpagesPlugin() {
this.consoleSetup = __bind(this.consoleSetup, this);
this.deployToGithubPages = __bind(this.deployToGithubPages, this);
return GhpagesPlugin.__super__.constructor.apply(this, arguments);
}
GhpagesPlugin.prototype.name = 'ghpages';
GhpagesPlugin.prototype.config = {
deployRemote: 'origin',
deployBranch: 'gh-pages',
environment: 'static'
};
GhpagesPlugin.prototype.deployToGithubPages = function(next) {
var config, docpad, opts, outPath, rootPath, tasks, _ref;
docpad = this.docpad;
config = this.getConfig();
_ref = docpad.getConfig(), outPath = _ref.outPath, rootPath = _ref.rootPath;
opts = {};
docpad.log('info', 'Deployment to GitHub Pages starting...');
tasks = new TaskGroup().done(next);
tasks.addTask(function(complete) {
var err;
if (outPath === rootPath) {
err = new Error("Your outPath configuration has been customised. Please remove the customisation in order to use the GitHub Pages plugin");
return next(err);
}
opts.outGitPath = pathUtil.join(outPath, '.git');
return complete();
});
tasks.addTask(function(complete) {
var err, _ref1;
if (_ref1 = config.environment, __indexOf.call(docpad.getEnvironments(), _ref1) < 0) {
err = new Error("Please run again using: docpad deploy-ghpages --env " + config.environment);
return next(err);
}
return complete();
});
tasks.addTask(function(complete) {
docpad.log('debug', 'Removing old ./out/.git directory..');
return rimraf(opts.outGitPath, complete);
});
tasks.addTask(function(complete) {
docpad.log('debug', 'Performing static generation...');
return docpad.action('generate', complete);
});
tasks.addTask(function(complete) {
docpad.log('debug', 'Disabling jekyll...');
return safefs.writeFile(pathUtil.join(outPath, '.nojekyll'), '', complete);
});
tasks.addTask(function(complete) {
docpad.log('debug', "Fetching the URL of the {config.deployRemote} remote...");
return safeps.spawnCommand('git', ['config', "remote." + config.deployRemote + ".url"], {
cwd: rootPath
}, function(err, stdout, stderr) {
if (err) {
return complete(err);
}
opts.remoteRepoUrl = stdout.replace(/\n/, "");
return complete();
});
});
tasks.addTask(function(complete) {
docpad.log('debug', 'Fetching log messages...');
return safeps.spawnCommand('git', ['log', '--oneline'], {
cwd: rootPath
}, function(err, stdout, stderr) {
if (err) {
return complete(err);
}
opts.lastCommit = stdout.split('\n')[0];
return complete();
});
});
tasks.addTask(function(complete) {
var gitCommands;
docpad.log('debug', 'Performing push...');
gitCommands = [['init'], ['add', '--all', '--force'], ['commit', '-m', opts.lastCommit], ['push', '--quiet', '--force', opts.remoteRepoUrl, "master:" + config.deployBranch]];
return safeps.spawnCommands('git', gitCommands, {
cwd: outPath,
stdio: 'inherit'
}, function(err) {
if (err) {
return complete(err);
}
docpad.log('info', 'Deployment to GitHub Pages completed successfully');
return complete();
});
});
tasks.addTask(function(complete) {
docpad.log('debug', 'Removing new ./out/.git directory..');
return rimraf(opts.outGitPath, complete);
});
tasks.run();
return this;
};
GhpagesPlugin.prototype.consoleSetup = function(opts) {
var commander, config, consoleInterface, docpad;
docpad = this.docpad;
config = this.getConfig();
consoleInterface = opts.consoleInterface, commander = opts.commander;
commander.command('deploy-ghpages').description("Deploys your " + config.environment + " website to the " + config.deployRemote + "/" + config.deployBranch + " branch").action(consoleInterface.wrapAction(this.deployToGithubPages));
return this;
};
return GhpagesPlugin;
})(BasePlugin);
};
}).call(this);
| 40.70073 | 292 | 0.583393 |
a784697a7e01cd58313f93d66f2d69da92497aab | 3,459 | js | JavaScript | src/opensteer/Vector.js | zerotacg/opensteer.js | 1c50dccce9cfe2ed0c7d3f1849ddf70a86fc0a37 | [
"MIT"
] | 7 | 2015-05-01T10:23:13.000Z | 2019-04-22T16:55:55.000Z | src/opensteer/Vector.js | zerotacg/opensteer.js | 1c50dccce9cfe2ed0c7d3f1849ddf70a86fc0a37 | [
"MIT"
] | 1 | 2015-10-10T07:12:32.000Z | 2015-10-10T17:38:49.000Z | src/opensteer/Vector.js | zerotacg/opensteer.js | 1c50dccce9cfe2ed0c7d3f1849ddf70a86fc0a37 | [
"MIT"
] | 1 | 2019-11-30T13:11:13.000Z | 2019-11-30T13:11:13.000Z | var sqrt = Math.sqrt;
/**
* @class opensteer.Vector
*/
export default class Vector {
constructor() {
this.x = 0;
this.y = 0;
this.z = 0;
this.set.apply(this, arguments);
}
/**
* @param {Vector|number} x
* @param {number} [y]
* @param {number} [z]
* @return {Vector} this
*/
set( x, y, z ) {
var signature = this.signature([x,y,z]);
if ( signature === "object,undefined,undefined" ) {
this.setObject(x);
}
else if ( signature === "number,number,number" ) {
this.setXYZ(x, y, z);
}
return this;
}
signature( args ) {
return args.map(parameter => typeof(parameter)).join(",");
}
setXYZ( x, y, z ) {
this.x = x;
this.y = y;
this.z = z;
return this;
}
setObject( o ) {
if ( o.x !== null ) {
this.x = o.x;
}
if ( o.y !== null ) {
this.y = o.y;
}
if ( o.z !== null ) {
this.z = o.z;
}
return this;
}
setX( x ) {
this.x = x;
}
setY( y ) {
this.y = y;
}
setZ( z ) {
this.z = z;
}
add( v ) {
this.x += v.x;
this.y += v.y;
this.z += v.z;
return this;
}
sub( v ) {
this.x -= v.x;
this.y -= v.y;
this.z -= v.z;
return this;
}
scale( f ) {
this.x *= f;
this.y *= f;
this.z *= f;
return this;
}
copy() {
return new Vector(this.x, this.y, this.z);
}
all( f, args, scope ) {
args = args || [];
scope = scope || this;
this.x = f.apply(scope, [ this.x ].concat(args));
this.y = f.apply(scope, [ this.y ].concat(args));
this.z = f.apply(scope, [ this.z ].concat(args));
return this;
}
dot( v ) {
return this.x * v.x + this.y * v.y + this.z * v.z;
}
cross( a, b ) {
this.setX((a.y * b.z) - (a.z * b.y));
this.setY((a.z * b.x) - (a.x * b.z));
this.setZ((a.x * b.y) - (a.y * b.x));
return this;
}
squaredLength() {
return this.dot(this);
}
length() {
return sqrt(this.squaredLength());
}
maxLength( max ) {
var len = this.length();
if ( len > max ) {
this.scale(max / len);
}
return this;
}
normalize() {
var len = this.length();
if ( len !== 0 ) {
this.scale(1 / len);
}
return this;
}
equals( v ) {
return this.x === v.x && this.y === v.y && this.z === v.z;
}
toArray() {
return [ this.x, this.y, this.z ];
}
toObject() {
return { x: this.x, y: this.y, z: this.z };
}
toString() {
return '{ x: ' + this.x + ', y: ' + this.y + ', z: ' + this.z + '}';
}
}
Vector.add = function( a, b ) {
return a.copy().add(b);
};
Vector.sub = function( a, b ) {
return a.copy().sub(b);
};
Vector.scale = function( v, f ) {
return v.copy().scale(f);
};
Vector.normalize = function( v ) {
return v.copy().normalize();
};
Vector.magnitude = function( v ) {
return v.length();
};
export const ZERO = new Vector(0, 0, 0);
export const UX = new Vector(1, 0, 0);
export const UY = new Vector(0, 1, 0);
export const UZ = new Vector(0, 0, 1);
| 18.398936 | 76 | 0.423244 |
a7846c8765dbf34089f9f7d89b2d34fb142055f7 | 2,743 | js | JavaScript | js/lib/JsColor.js | zhangpc0309/cesium-czmleditor | 457c6a0e1d5b5361b24a11cad18505933151e96b | [
"Apache-2.0"
] | 16 | 2020-12-22T03:05:07.000Z | 2022-03-11T08:07:15.000Z | js/lib/JsColor.js | zhangpc0309/cesium-czmleditor | 457c6a0e1d5b5361b24a11cad18505933151e96b | [
"Apache-2.0"
] | null | null | null | js/lib/JsColor.js | zhangpc0309/cesium-czmleditor | 457c6a0e1d5b5361b24a11cad18505933151e96b | [
"Apache-2.0"
] | 6 | 2021-02-02T14:06:39.000Z | 2022-03-29T02:10:03.000Z | const template = `
<v-input class="color-input v-text-field"
append-icon="mdi-close"
@click:append="$emit('input', null);">
<v-label>{{label}}</v-label>
<span ref="color_span" class="color-preview" @click="showColorPicker"> </span>
<input :value="value"
:id="id"
:alphaChannel="alphaChannel"
@change="onChange($event.target)"
@input="onChange($event.target)"
@focus="showColorPicker"
ref="color_input"
data-jscolor=""
/>
</v-input>
`
Vue.component('jscolor',{
template,
data(){
return {
color: '',
picker: null
}
},
props: {
value: String,
removeButton: {
default: true
},
label: String,
alphaChannel: {
default: 'true' // 'true', 'false', 'auto'
},
/**
'auto' - automatically detect format from the initial color value and keep it in effect
'any' - user can enter a color code in any supported format (and it will stay in that format until different one is used)
'hex' - HEX color in standard CSS notation #RRGGBB
'rgb' - RGB color in standard CSS notation rgb(r,g,b)
'rgba' - RGBA color in standard CSS notation rgba(r,g,b,a
*/
format: {
default: 'any'
},
id: String
},
methods: {
onChange(target){
// this.color = target.jscolor.toHEXString();
this.color = target.jscolor.channels;
this.color.input = target;
this.$refs.color_span.style.backgroundColor = this.color;
let text = target.value;
// Do not fire input and update while user enters values
if (/\#[\dabcdef]{6}/ig.test(text) ||
/rgb\s*\(\s*(\d{1,3})\,\s*(\d{1,3})\,\s*(\d{1,3})\s*\)/ig.test(text) ||
/rgba\s*\(\s*(\d{1,3})\,\s*(\d{1,3})\,\s*(\d{1,3})\,\s*([\d\.]+)\s*\)/ig.test(text)) {
this.$emit('input', this.color);
}
if (!text) {
this.$emit('input', null);
}
},
showColorPicker(){
this.picker.show();
}
},
mounted: function () {
this.picker = new JSColor(this.$refs.color_input, {
hash: true,
format: 'any',
value: this.value,
valueElement: this.$refs.color_input,
previewElement: this.$refs.color_span,
onInput: () => {this.onChange(this.$refs.color_input);}
});
},
updated: function () {
this.$refs.color_span.style.backgroundColor = this.value;
}
});
| 31.895349 | 129 | 0.496901 |
a7851e987841e082ac7bb4289e8d2b879fd0e242 | 1,887 | js | JavaScript | _site/assets/js/search.js | BrightcoveLearning/player-zh-tw | df010806e2f0c271dcd470ecbb97415b93454ec5 | [
"MIT"
] | null | null | null | _site/assets/js/search.js | BrightcoveLearning/player-zh-tw | df010806e2f0c271dcd470ecbb97415b93454ec5 | [
"MIT"
] | 1 | 2021-09-24T04:00:22.000Z | 2021-10-02T15:37:05.000Z | _site/assets/js/search.js | BrightcoveLearning/player-zh-tw | df010806e2f0c271dcd470ecbb97415b93454ec5 | [
"MIT"
] | 3 | 2021-05-18T17:12:55.000Z | 2021-09-24T03:11:17.000Z | const myInitCallback = function() {
if (document.readyState == 'complete') {
// Document is ready when CSE element is initialized.
// Render an element with both search box and search results
google.search.cse.element.render({div: 'search_box', tag: 'search'});
var searchbox_el=document.getElementById('gsc-i-id1');
console.log('searchbox_el', searchbox_el);
searchbox_el.setAttribute('style', 'background-image:none;');
searchbox_el.setAttribute('placeholder', 'Search Brightcove Player docs');
searchbox_el.addEventListener('click', function() {
searchbox_el.setAttribute('style', 'background-image:none;');
searchbox_el.setAttribute('placeholder', 'Search Brightcove Player docs');
});
} else {
// Document is not ready yet, when CSE element is initialized.
google.setOnLoadCallback(function() {
// Render an element with both search box and search results in div with id 'test'.
google.search.cse.element.render({div: 'search_box', tag: 'search'});
var searchbox_el=document.getElementById('gsc-i-id1');
console.log('searchbox_el', searchbox_el);
var searchbox_el=document.getElementById('gsc-i-id1');
console.log('searchbox_el', searchbox_el);
searchbox_el.setAttribute('style', 'background-image:none;border:none');
searchbox_el.setAttribute('placeholder', 'Search Brightcove Player docs');
searchbox_el.addEventListener('click', function() {
searchbox_el.setAttribute('style', 'background-image:none;border:none');
searchbox_el.setAttribute('placeholder', 'Search Brightcove Player docs');
});
}, true);
}
};
// Insert it before the CSE code snippet so the global properties like parsetags and callback
// are available when cse.js runs.
window.__gcse = {parsetags: 'explicit',initializationCallback: myInitCallback};
| 46.02439 | 93 | 0.706412 |
a7852e3724fccff6cd1ab05bf6e3fd0bc399b3cd | 435 | js | JavaScript | src/models/strategy.js | thesephist/strat | eb156149f3aa79dac191ad13dd849cb94e226371 | [
"MIT"
] | 3 | 2018-03-27T14:51:12.000Z | 2021-04-20T02:02:36.000Z | src/models/strategy.js | thesephist/strat | eb156149f3aa79dac191ad13dd849cb94e226371 | [
"MIT"
] | null | null | null | src/models/strategy.js | thesephist/strat | eb156149f3aa79dac191ad13dd849cb94e226371 | [
"MIT"
] | null | null | null | class Strategy {
constructor() {
}
}
class TimeStrategy extends Strategy {
constructor(buy_interval, sell_interval) {
super();
}
}
class BoundsStrategy extends Strategy {
constructor(buy_bound, sell_bound) {
super();
}
}
class DollarCostAverageStrategy extends Strategy {
}
module.exports = {
Security,
TimeStrategy,
BoundsStrategy,
DollarCostAverageStrategy,
}
| 12.083333 | 50 | 0.650575 |
a785a28c7b4705abf38bd4894766850955f467a5 | 1,155 | js | JavaScript | lib/installer.js | 3lvcz/install-me | 3df217b432b5a78adfd9261c276df5fb48454ef7 | [
"MIT"
] | null | null | null | lib/installer.js | 3lvcz/install-me | 3df217b432b5a78adfd9261c276df5fb48454ef7 | [
"MIT"
] | null | null | null | lib/installer.js | 3lvcz/install-me | 3df217b432b5a78adfd9261c276df5fb48454ef7 | [
"MIT"
] | null | null | null | const { exec } = require('child_process');
/**
* @param {string} name
* @param {string} version
* @param {string} path
* @param {object} [opts]
* @param {boolean} [opts.force=false]
*/
exports.installDependency = (name, version, path, opts = {}) =>
exports.installDependencies([[name, version]], path, opts);
/**
* @param {(string[])[]} dependencies [[name, version], [name, version], ...]
* @param {string} cwd
* @param {object} [opts]
* @param {boolean} [opts.force=false]
*/
exports.installDependencies = (dependencies, cwd, opts = {}) => new Promise((resolve, reject) => {
if (!dependencies.length) {
resolve();
return;
}
const cmdParts = ['npm', 'install', '--no-save'];
if (opts.force) {
cmdParts.push('--force');
}
for (const [name, version] of dependencies) {
const str = `${name}@${version}`;
cmdParts.push(str);
}
exec(cmdParts.join(' '), { cwd }, (err, stdout, stderr) => {
if (err) {
reject(err);
return;
}
process.stdout.write(stdout);
process.stderr.write(stderr);
resolve();
});
});
| 27.5 | 98 | 0.554113 |
a785e731cd42f958a52d9daa15e15ef3d517493f | 1,253 | js | JavaScript | visualizer2/src/main/webapp/app/admin/tracker/tracker.controller.js | Pyosch/powertac-server | b314592daf4279d181f115535226e563b6239d1c | [
"Apache-2.0"
] | 26 | 2015-03-15T07:41:52.000Z | 2022-01-26T07:57:22.000Z | visualizer2/src/main/webapp/app/admin/tracker/tracker.controller.js | Pyosch/powertac-server | b314592daf4279d181f115535226e563b6239d1c | [
"Apache-2.0"
] | 297 | 2015-01-29T12:19:42.000Z | 2022-03-30T18:58:54.000Z | visualizer2/src/main/webapp/app/admin/tracker/tracker.controller.js | powertac/powertac-server | 1924f9735f1ed7365b3a5836baad0c7c40ddc0e3 | [
"Apache-2.0"
] | 31 | 2015-03-14T10:20:59.000Z | 2021-02-23T13:48:42.000Z | (function () {
'use strict';
angular
.module('visualizer2App')
.controller('JhiTrackerController', JhiTrackerController);
JhiTrackerController.$inject = ['$cookies', '$http', 'JhiTrackerService'];
function JhiTrackerController ($cookies, $http, JhiTrackerService) {
// This controller uses a Websocket connection to receive user activities in real-time.
var vm = this;
vm.activities = [];
JhiTrackerService.receive().then(null, null, function(activity) {
showActivity(activity);
});
function showActivity(activity) {
var existingActivity = false;
for (var index = 0; index < vm.activities.length; index++) {
if(vm.activities[index].sessionId === activity.sessionId) {
existingActivity = true;
if (activity.page === 'logout') {
vm.activities.splice(index, 1);
} else {
vm.activities[index] = activity;
}
}
}
if (!existingActivity && (activity.page !== 'logout')) {
vm.activities.push(activity);
}
}
}
})();
| 32.128205 | 95 | 0.52514 |
a78656a1a61b8dee834328bd9c67bc1155400db4 | 847 | js | JavaScript | src/middleware/validation.js | fegzycole/DTA-backend | fae6411c494472b04fe771d01800576015bddc41 | [
"MIT"
] | null | null | null | src/middleware/validation.js | fegzycole/DTA-backend | fae6411c494472b04fe771d01800576015bddc41 | [
"MIT"
] | 1 | 2021-05-11T01:25:14.000Z | 2021-05-11T01:25:14.000Z | src/middleware/validation.js | fegzycole/DTA-backend | fae6411c494472b04fe771d01800576015bddc41 | [
"MIT"
] | null | null | null | import validationRules from '../utils/validationRules';
import { errResponse } from '../utils/util';
import { validate } from '../utils/util';
const { product, productId } = validationRules;
export const validateProduct = (req, res, next) => {
const { ...props } = req.body;
const data = { ...props };
validate(data, product, res, next);
};
export const validateId = (req, res, next) => {
const { id } = req.params;
const data = { id };
validate(data, productId, res, next);
};
export const isImageUploaded = async (req, res, next) => {
try {
if (req.file) {
const imageUrl = req.file;
req.body.image = imageUrl.secure_url;
return next();
} else {
return errResponse(res, 400, 'Please upload an image to continue');
}
} catch (error) {
return errResponse(res, 400, error.message);
}
};
| 27.322581 | 73 | 0.626919 |
a786a794830578e7612a859e05543a4e3c5d76d0 | 1,391 | js | JavaScript | src/js/main.js | yyhsz/resume | 0f2943c4c623a2d77559f56e4e26619cdfca9624 | [
"MIT"
] | null | null | null | src/js/main.js | yyhsz/resume | 0f2943c4c623a2d77559f56e4e26619cdfca9624 | [
"MIT"
] | null | null | null | src/js/main.js | yyhsz/resume | 0f2943c4c623a2d77559f56e4e26619cdfca9624 | [
"MIT"
] | null | null | null | //强制展现加载动画
// setTimeout(function () { siteWelcome.classList.remove('active') }, 0)
//实现导航栏及其子菜单动效 ; 实现高亮当前浏览元素
!function(){
let liTags = document.querySelectorAll('nav.menu > ul > li');
for (let i = 0; i < liTags.length; i++) {
liTags[i].onmouseenter = function (x) {
x.currentTarget.classList.add('active')
}
liTags[i].onmouseleave = function (x) {
x.currentTarget.classList.remove('active');
//x.currentTarget.classList.add('inactive');
}
}
//实现第一个元素上滑及导航栏下滑效果(打开页面即生效)
setTimeout(document.querySelectorAll(".slideUp")[0].classList.remove("offset"),2000)
setTimeout(document.querySelector('.slideDown').classList.remove('offset'),2000)
}()
/*if (Math.abs(currentTop - targetTop) < 200) {
let id = setInterval(() => {
if (i > 20) {
clearInterval(id); return;
}
window.scrollTo(0, currentTop + (targetTop - currentTop) / 20 * i);
i++;
}, 10)
}
else {
let id = setInterval(() => {
if (i > 25) {
clearInterval(id); return;
}
window.scrollTo(0, currentTop + (targetTop - currentTop) / 25 * i);
i++;
}, 20)
} 改良版页面内跳转动画,勉强达到平滑效果 */
| 25.290909 | 88 | 0.50683 |
a786c2ab30c03cc0f67ee2592f0b467fb376568e | 46 | js | JavaScript | src/custom/quartet/lang.js | chinese-quartet/quartet-data-portal | e35c1952a5643e476fc84e792fecc013e22d467c | [
"MIT"
] | null | null | null | src/custom/quartet/lang.js | chinese-quartet/quartet-data-portal | e35c1952a5643e476fc84e792fecc013e22d467c | [
"MIT"
] | null | null | null | src/custom/quartet/lang.js | chinese-quartet/quartet-data-portal | e35c1952a5643e476fc84e792fecc013e22d467c | [
"MIT"
] | null | null | null | export const enUS = {}
export const zhCN = {} | 15.333333 | 22 | 0.652174 |
a7874ea9736657ab7d72f760d5dd82c1073c6c46 | 270 | js | JavaScript | classes/Namespace.js | mandimartins/Websockets | dd6ea68f75589b7d0527a2617727a6a72adbe1b9 | [
"MIT"
] | null | null | null | classes/Namespace.js | mandimartins/Websockets | dd6ea68f75589b7d0527a2617727a6a72adbe1b9 | [
"MIT"
] | null | null | null | classes/Namespace.js | mandimartins/Websockets | dd6ea68f75589b7d0527a2617727a6a72adbe1b9 | [
"MIT"
] | null | null | null | class Namespace {
constructor(id, nsTitle, img, endpoint) {
this.id = id;
this.img = img;
this.nsTitle = nsTitle;
this.endpoint = endpoint;
this.rooms = [];
}
addRoom(roomObj) {
this.rooms.push(roomObj);
}
}
module.exports = Namespace;
| 16.875 | 43 | 0.614815 |
a7877ebff19b2759ac0fabe2950c2b4bc4e3040f | 226 | js | JavaScript | js/store.js | mtCarto/eagle-mobile-inspections | 0fbdb64a6709636ee1cc824d7a5b34f77e0445a5 | [
"Apache-2.0"
] | null | null | null | js/store.js | mtCarto/eagle-mobile-inspections | 0fbdb64a6709636ee1cc824d7a5b34f77e0445a5 | [
"Apache-2.0"
] | null | null | null | js/store.js | mtCarto/eagle-mobile-inspections | 0fbdb64a6709636ee1cc824d7a5b34f77e0445a5 | [
"Apache-2.0"
] | null | null | null | import { createStore } from 'redux';
import { devToolsEnhancer } from 'redux-devtools-extension';
import allReducers from '../reducers/all';
const store = createStore(allReducers, devToolsEnhancer());
export default store;
| 25.111111 | 60 | 0.761062 |
a787831d6eb981fc2cdc92359a96e60d787da148 | 492 | js | JavaScript | dist/utils/response.js | reihnagm/Story-View-Nest-JS | a71a7703c6e68f29a562b92ec6d7603ab5d2931e | [
"MIT"
] | null | null | null | dist/utils/response.js | reihnagm/Story-View-Nest-JS | a71a7703c6e68f29a562b92ec6d7603ab5d2931e | [
"MIT"
] | null | null | null | dist/utils/response.js | reihnagm/Story-View-Nest-JS | a71a7703c6e68f29a562b92ec6d7603ab5d2931e | [
"MIT"
] | null | null | null | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.response = void 0;
function response(res, status, error, message, data) {
let resultPrint = {};
resultPrint.status = status || 200;
resultPrint.error = error || false;
resultPrint.message = message || 'Ok.';
if (data) {
resultPrint.data = data;
}
return res.status(resultPrint.status).json(resultPrint);
}
exports.response = response;
//# sourceMappingURL=response.js.map | 32.8 | 62 | 0.676829 |
a787cbf846d28b08923affc49650b1d896678551 | 260 | js | JavaScript | examples/index.js | math-io/roundn | 383bde1e8ebc45086333bff888cbd3951d413705 | [
"MIT"
] | 1 | 2016-01-13T10:54:40.000Z | 2016-01-13T10:54:40.000Z | examples/index.js | math-io/roundn | 383bde1e8ebc45086333bff888cbd3951d413705 | [
"MIT"
] | null | null | null | examples/index.js | math-io/roundn | 383bde1e8ebc45086333bff888cbd3951d413705 | [
"MIT"
] | null | null | null | 'use strict';
var roundn = require( './../lib' );
var x;
var n;
var i;
for ( i = 0; i < 100; i++ ) {
x = Math.random()*100 - 50;
n = roundn( Math.random()*5, 0 );
console.log( 'Value: %d. Number of decimals: %d. Rounded: %d.', x, n, roundn( x, -n ) );
}
| 18.571429 | 89 | 0.523077 |
a78814b71636d4e97f221cd1a18c6f54bb45a6ad | 3,444 | js | JavaScript | examples/src/toggle.js | cyy641278529/ui-kit-3d | f96d3984f7ed4049edccd901f164aa348ac69c63 | [
"MIT"
] | 8 | 2017-12-01T12:12:19.000Z | 2018-09-07T03:31:47.000Z | examples/src/toggle.js | cyy641278529/ui-kit-3d | f96d3984f7ed4049edccd901f164aa348ac69c63 | [
"MIT"
] | 12 | 2017-12-06T07:27:58.000Z | 2018-03-05T05:59:10.000Z | examples/src/toggle.js | cyy641278529/ui-kit-3d | f96d3984f7ed4049edccd901f164aa348ac69c63 | [
"MIT"
] | 7 | 2017-12-04T03:38:33.000Z | 2018-08-15T02:42:52.000Z | (() => {
const { cc, app } = window;
const { vec3, color3, color4, quat } = cc.math;
let camEnt = app.createEntity('camera');
vec3.set(camEnt.lpos, 10, 10, 10);
camEnt.lookAt(vec3.new(0, 0, 0));
camEnt.addComp('Camera');
let screen = app.createEntity('screen');
screen.addComp('Screen');
// toggle1 (simple)
{
let ent = app.createEntity('toggle');
ent.setParent(screen);
let image = ent.addComp('Image');
image._width = 40;
image._height = 40;
image.setOffset(0, 50);
image.setAnchors(0.5, 0.5, 0.5, 0.5);
let toggle = ent.addComp('Toggle');
toggle._transition = 'color';
toggle._transitionColors.normal = color4.new(0.8, 0.8, 0.8, 1);
toggle._transitionColors.highlight = color4.new(1, 1, 0, 1);
toggle._transitionColors.pressed = color4.new(0.5, 0.5, 0.5, 1);
toggle._transitionColors.disabled = color4.new(0.2, 0.2, 0.2, 1);
let checker = app.createEntity('checker');
checker.setParent(ent);
let checkerImage = checker.addComp('Image');
checkerImage._color = color4.new(1, 0, 0, 1);
checkerImage.setAnchors(0, 0, 1, 1);
checkerImage.setMargin(5, 5, 5, 5);
toggle._background = ent;
toggle._checker = checker;
toggle._updateState();
}
// toggle2 (with text)
{
let entToggle = app.createEntity('toggle-02');
entToggle.setParent(screen);
let widget = entToggle.addComp('Widget');
widget._width = 200;
widget._height = 40;
widget.setOffset(0, -50);
let toggle = entToggle.addComp('Toggle');
toggle._transition = 'color';
toggle._transitionColors.normal = color4.new(0.8, 0.8, 0.8, 1);
toggle._transitionColors.highlight = color4.new(1, 1, 0, 1);
toggle._transitionColors.pressed = color4.new(0.5, 0.5, 0.5, 1);
toggle._transitionColors.disabled = color4.new(0.2, 0.2, 0.2, 1);
let entBG = app.createEntity('background');
entBG.setParent(entToggle);
let image = entBG.addComp('Image');
image._width = 40;
image._height = 40;
image.setAnchors(0, 1, 0, 1);
image.setPivot(0, 1);
let entChecker = app.createEntity('checker');
entChecker.setParent(entBG);
let checkerImage = entChecker.addComp('Image');
checkerImage._color = color4.new(1, 0, 0, 1);
checkerImage.setAnchors(0, 0, 1, 1);
checkerImage.setMargin(5, 5, 5, 5);
let entLabel = app.createEntity('label');
entLabel.setParent(entToggle);
let text = entLabel.addComp('Text');
text.setAnchors(0, 0, 1, 1);
text.setMargin(45, 5, 5, 5);
text._text = 'Foobar';
text._color = color4.new(0.1, 0.1, 0.1, 1);
text._align = 'left-center';
//
toggle._background = entBG;
toggle._checker = entChecker;
toggle._updateState();
}
// DEBUG
app.on('tick', () => {
cc.utils.walk(screen, ent => {
let color = color3.new(0, 0, 0);
let a = vec3.create();
let b = vec3.create();
let c = vec3.create();
let d = vec3.create();
let wpos = vec3.create();
let wrot = quat.create();
let widget = ent.getComp('Widget');
widget.getWorldCorners(a, b, c, d);
// rect
app.debugger.drawLine2D(a, b, color);
app.debugger.drawLine2D(b, c, color);
app.debugger.drawLine2D(c, d, color);
app.debugger.drawLine2D(d, a, color);
app.debugger.drawAxes2D(
ent.getWorldPos(wpos),
ent.getWorldRot(wrot),
5.0
);
});
});
})(); | 29.947826 | 69 | 0.614402 |
a78885e08faa2dc3984fabd10a2f7f54b182b89e | 10,287 | js | JavaScript | recorder/assets/jswav.js | unixpickle/speechrecog | 26fe002acebaf1d0fa9a6056bddc837238e402e6 | [
"BSD-2-Clause"
] | 9 | 2016-11-06T01:11:50.000Z | 2020-08-29T04:21:57.000Z | recorder/assets/jswav.js | unixpickle/speechrecog | 26fe002acebaf1d0fa9a6056bddc837238e402e6 | [
"BSD-2-Clause"
] | null | null | null | recorder/assets/jswav.js | unixpickle/speechrecog | 26fe002acebaf1d0fa9a6056bddc837238e402e6 | [
"BSD-2-Clause"
] | 3 | 2019-06-06T09:42:48.000Z | 2020-04-06T19:32:34.000Z | // Code from https://github.com/unixpickle/jswav
(function() {
function Recorder() {
this.ondone = null;
this.onerror = null;
this.onstart = null;
this.channels = 2;
this._started = false;
this._stopped = false;
this._stream = null;
}
Recorder.prototype.start = function() {
if (this._started) {
throw new Error('Recorder was already started.');
}
this._started = true;
getUserMedia(function(err, stream) {
if (this._stopped) {
return;
}
if (err !== null) {
if (this.onerror !== null) {
this.onerror(err);
}
return;
}
addStopMethod(stream);
this._stream = stream;
try {
this._handleStream();
} catch (e) {
this._stream.stop();
this._stopped = true;
if (this.onerror !== null) {
this.onerror(e);
}
}
}.bind(this));
};
Recorder.prototype.stop = function() {
if (!this._started) {
throw new Error('Recorder was not started.');
}
if (this._stopped) {
return;
}
this._stopped = true;
if (this._stream !== null) {
var stream = this._stream;
this._stream.stop();
// Firefox does not fire the onended event.
setTimeout(function() {
if (stream.onended) {
stream.onended();
}
}, 500);
}
};
Recorder.prototype._handleStream = function() {
var context = getAudioContext();
var source = context.createMediaStreamSource(this._stream);
var wavNode = new window.jswav.WavNode(context, this.channels);
source.connect(wavNode.node);
wavNode.node.connect(context.destination);
this._stream.onended = function() {
this._stream.onended = null;
source.disconnect(wavNode.node);
wavNode.node.disconnect(context.destination);
if (this.ondone !== null) {
this.ondone(wavNode.sound());
}
}.bind(this);
if (this.onstart !== null) {
this.onstart();
}
};
function getUserMedia(cb) {
var gum = (navigator.getUserMedia || navigator.webkitGetUserMedia ||
navigator.mozGetUserMedia || navigator.msGetUserMedia);
if (!gum) {
setTimeout(function() {
cb('getUserMedia() is not available.', null);
}, 10);
return;
}
gum.call(navigator, {audio: true, video: false},
function(stream) {
cb(null, stream);
},
function(err) {
cb(err, null);
}
);
}
function addStopMethod(stream) {
if ('undefined' === typeof stream.stop) {
stream.stop = function() {
var tracks = this.getTracks();
for (var i = 0, len = tracks.length; i < len; ++i) {
tracks[i].stop();
}
};
}
}
var reusableAudioContext = null;
function getAudioContext() {
if (reusableAudioContext !== null) {
return reusableAudioContext;
}
var AudioContext = (window.AudioContext || window.webkitAudioContext);
reusableAudioContext = new AudioContext();
return reusableAudioContext;
}
if (!window.jswav) {
window.jswav = {};
}
window.jswav.Recorder = Recorder;
})();
(function() {
function Header(view) {
this.view = view;
}
Header.prototype.getBitsPerSample = function() {
return this.view.getUint16(34, true);
};
Header.prototype.getChannels = function() {
return this.view.getUint16(22, true);
};
Header.prototype.getDuration = function() {
return this.getSampleCount() / this.getSampleRate();
};
Header.prototype.getSampleCount = function() {
var bps = this.getBitsPerSample() * this.getChannels() / 8;
return this.view.getUint32(40, true) / bps;
};
Header.prototype.getSampleRate = function() {
return this.view.getUint32(24, true);
};
Header.prototype.setDefaults = function() {
this.view.setUint32(0, 0x46464952, true); // RIFF
this.view.setUint32(8, 0x45564157, true); // WAVE
this.view.setUint32(12, 0x20746d66, true); // "fmt "
this.view.setUint32(16, 0x10, true); // length of "fmt"
this.view.setUint16(20, 1, true); // format = PCM
this.view.setUint32(36, 0x61746164, true); // "data"
};
Header.prototype.setFields = function(count, rate, bitsPerSample, channels) {
totalSize = count * (bitsPerSample / 8) * channels;
this.view.setUint32(4, totalSize + 36, true); // size of "RIFF"
this.view.setUint16(22, channels, true); // channel count
this.view.setUint32(24, rate, true); // sample rate
this.view.setUint32(28, rate * channels * bitsPerSample / 8,
true); // byte rate
this.view.setUint16(32, bitsPerSample * channels / 8, true); // block align
this.view.setUint16(34, bitsPerSample, true); // bits per sample
this.view.setUint32(40, totalSize, true); // size of "data"
};
function Sound(buffer) {
this.buffer = buffer;
this._view = new DataView(buffer);
this.header = new Header(this._view);
}
Sound.fromBase64 = function(str) {
var raw = window.atob(str);
var buffer = new ArrayBuffer(raw.length);
var bytes = new Uint8Array(buffer);
for (var i = 0; i < raw.length; ++i) {
bytes[i] = raw.charCodeAt(i);
}
return new Sound(buffer);
};
Sound.prototype.average = function(start, end) {
var startIdx = this.indexForTime(start);
var endIdx = this.indexForTime(end);
if (endIdx-startIdx === 0) {
return 0;
}
var sum = 0;
var channels = this.header.getChannels();
for (var i = startIdx; i < endIdx; ++i) {
for (var j = 0; j < channels; ++j) {
sum += Math.abs(this.getSample(i, j));
}
}
return sum / (channels*(endIdx-startIdx));
};
Sound.prototype.base64 = function() {
var binary = '';
var bytes = new Uint8Array(this.buffer);
for (var i = 0, len = bytes.length; i < len; ++i) {
binary += String.fromCharCode(bytes[i]);
}
return window.btoa(binary);
};
Sound.prototype.crop = function(start, end) {
var startIdx = this.indexForTime(start);
var endIdx = this.indexForTime(end);
// Figure out a bunch of math
var channels = this.header.getChannels();
var bps = this.header.getBitsPerSample();
var copyCount = endIdx - startIdx;
var blockSize = channels * bps / 8;
var copyBytes = blockSize * copyCount;
// Create a new buffer
var buffer = new ArrayBuffer(copyBytes + 44);
var view = new DataView(buffer);
// Setup the header
var header = new Header(view);
header.setDefaults();
header.setFields(copyCount, this.header.getSampleRate(), bps, channels);
// Copy the sample data
var bufferSource = startIdx*blockSize + 44;
for (var i = 0; i < copyBytes; ++i) {
view.setUint8(i+44, this._view.getUint8(bufferSource+i));
}
return new Sound(buffer);
};
Sound.prototype.getSample = function(idx, channel) {
if ('undefined' === typeof channel) {
// Default value of channel is 0.
channel = 0;
}
var bps = this.header.getBitsPerSample();
var channels = this.header.getChannels();
if (bps === 8) {
var offset = 44 + idx*channels + channel;
return (this._view.getUint8(offset)-0x80) / 0x80;
} else if (bps === 16) {
var offset = 44 + idx*channels*2 + channel*2;
return this._view.getInt16(offset, true) / 0x8000;
} else {
return NaN;
}
};
Sound.prototype.histogram = function(num) {
var duration = this.header.getDuration();
var timeSlice = duration / num;
var result = [];
for (var i = 0; i < num; ++i) {
result.push(this.average(i*timeSlice, (i+1)*timeSlice));
}
return result;
};
Sound.prototype.indexForTime = function(time) {
var samples = this.header.getSampleCount();
var duration = this.header.getDuration();
var rawIdx = Math.floor(samples * time / duration);
return Math.min(Math.max(rawIdx, 0), samples);
};
if (!window.jswav) {
window.jswav = {};
}
window.jswav.Sound = Sound;
window.jswav.Header = Header;
})();
(function() {
function WavNode(context, ch) {
this.node = null;
this._buffers = [];
this._sampleCount = 0;
this._sampleRate = 0;
this._channels = 0;
if (context.createScriptProcessor) {
this.node = context.createScriptProcessor(1024, ch, ch);
} else if (context.createJavaScriptNode) {
this.node = context.createJavaScriptNode(1024, ch, ch);
} else {
throw new Error('No javascript processing node available.');
}
this.node.onaudioprocess = function(event) {
var input = event.inputBuffer;
if (this._sampleRate === 0) {
this._sampleRate = Math.round(input.sampleRate);
}
if (this._channels === 0) {
this._channels = input.numberOfChannels;
}
// Interleave the audio data
var sampleCount = input.length;
this._sampleCount += sampleCount;
var buffer = new ArrayBuffer(sampleCount * this._channels * 2);
var view = new DataView(buffer);
var x = 0;
for (var i = 0; i < sampleCount; ++i) {
for (var j = 0; j < this._channels; ++j) {
var value = Math.round(input.getChannelData(j)[i] * 0x8000);
view.setInt16(x, value, true);
x += 2;
}
}
this._buffers.push(buffer);
// If I don't do this, the entire thing backs up after a few buffers.
event.outputBuffer = event.inputBuffer;
}.bind(this);
}
WavNode.prototype.sound = function() {
// Setup the buffer
var buffer = new ArrayBuffer(44 + this._sampleCount*this._channels*2);
var view = new DataView(buffer);
// Setup the header
var header = new window.jswav.Header(view);
header.setDefaults();
header.setFields(this._sampleCount, this._sampleRate, 16, this._channels);
// Copy the raw data
var byteIdx = 44;
for (var i = 0; i < this._buffers.length; ++i) {
var aBuffer = this._buffers[i];
var aView = new DataView(aBuffer);
var len = aBuffer.byteLength;
for (var j = 0; j < len; ++j) {
view.setUint8(byteIdx++, aView.getUint8(j));
}
}
return new window.jswav.Sound(buffer);
};
if (!window.jswav) {
window.jswav = {};
}
window.jswav.WavNode = WavNode;
})();
| 28.260989 | 79 | 0.605522 |
a78912e031618b5a567fda88115fc0a9a777ed85 | 1,615 | js | JavaScript | engine/util/console/opera.js | isabella232/TheRenderEngine | 18b480902314e0e09047566b79d6beb357417379 | [
"MIT"
] | 28 | 2015-02-15T05:45:04.000Z | 2020-02-28T18:53:42.000Z | engine/util/console/opera.js | isabella232/TheRenderEngine | 18b480902314e0e09047566b79d6beb357417379 | [
"MIT"
] | 1 | 2022-01-15T22:00:24.000Z | 2022-01-15T22:00:24.000Z | engine/util/console/opera.js | isabella232/TheRenderEngine | 18b480902314e0e09047566b79d6beb357417379 | [
"MIT"
] | 9 | 2015-02-19T09:56:59.000Z | 2022-01-15T21:59:29.000Z |
/**
* @class A debug console for Opera browsers.
* @extends R.debug.ConsoleRef
*/
R.util.console.Opera = function() {
R.debug.ConsoleRef.extend(/** @scope R.util.console.Opera.prototype **/{
constructor:function () {
},
resolved: function() {
R.debug.Console.setConsoleRef(new R.debug.Opera());
},
/**
* Write a debug message to the console
*/
info:function () {
window.opera.postError(this.fixArgs(arguments));
},
/**
* Write a debug message to the console
*/
debug:function () {
window.opera.postError(["[D]", this.fixArgs(arguments)]);
},
/**
* Write a warning message to the console
*/
warn:function () {
window.opera.postError(["[W]", this.fixArgs(arguments)]);
},
/**
* Write an error message to the console
*/
error:function () {
window.opera.postError(["[E!]", this.fixArgs(arguments)]);
}
}, {
resolved: function() {
setTimeout(function() {
R.debug.Console.setConsoleRef(new R.util.console.Opera());
}, 250);
},
/**
* Get the class name of this object
*
* @return {String} The string "R.util.console.Webkit"
*/
getClassName:function () {
return "R.util.console.Opera";
}
});
};
// The class this file defines and its required classes
R.Engine.define({
"class":"R.util.console.Opera"
});
| 23.75 | 76 | 0.505882 |
a78944090b7c3c77db6a6a3ac6885705c9ce054f | 376 | js | JavaScript | src/constant/color.js | rohankangale2011/rnative_assignment | 91819e989cbf12260bc13aae4f47a6f4fa1438c8 | [
"MIT"
] | null | null | null | src/constant/color.js | rohankangale2011/rnative_assignment | 91819e989cbf12260bc13aae4f47a6f4fa1438c8 | [
"MIT"
] | 3 | 2020-07-17T11:34:21.000Z | 2021-05-09T14:38:28.000Z | src/constant/color.js | rohankangale2011/rnative_assignment | 91819e989cbf12260bc13aae4f47a6f4fa1438c8 | [
"MIT"
] | null | null | null | export const PRIMARY_COLOR = '#7b256c';
export const SECONDARY_COLOR = '';
export const STATUS_BAR_COLOR = '#6C1D5F';
export const PRIMARY_BUTTON_COLOR = '';
export const SECONDARY_BUTTON_COLOR = '';
export const PRIMARY_TEXT_COLOR = '#333333';
export const SECONDARY_TEXT_COLOR = '#aaaaaa';
export const LIGHT_TEXT_COLOR = '#ffffff';
export const BORDER_COLOR = '#eeeeee'; | 31.333333 | 46 | 0.763298 |
a7898296465517d85bf361855e78c34c0bab0c95 | 4,768 | js | JavaScript | src/Components/MapWeather24H.js | FedericoTartarini/air-quality-weather-sg | 496c618000f5114c476756a24ef5bd900dc6274e | [
"MIT"
] | 1 | 2021-04-02T06:47:14.000Z | 2021-04-02T06:47:14.000Z | src/Components/MapWeather24H.js | FedericoTartarini/air-quality-weather-sg | 496c618000f5114c476756a24ef5bd900dc6274e | [
"MIT"
] | 15 | 2020-12-14T01:15:30.000Z | 2022-02-13T15:55:15.000Z | src/Components/MapWeather24H.js | FedericoTartarini/air-quality-weather-sg | 496c618000f5114c476756a24ef5bd900dc6274e | [
"MIT"
] | null | null | null | import React, { useState } from "react";
import "leaflet/dist/leaflet.css";
import L from "leaflet";
import { Map, TileLayer, Marker, Popup, ZoomControl } from "react-leaflet";
import { ForecastToIcon } from "../Functions/Utils";
import { Helmet } from "react-helmet";
import Loader from "./Loader";
function GetIcon(description, _iconSize) {
return L.icon({
iconUrl: ForecastToIcon(description),
iconSize: [_iconSize], // size of the icon
});
}
const regionsMetadata = {
west: { latitude: 1.35735, longitude: 103.7 },
national: { latitude: 0, longitude: 0 },
east: { latitude: 1.35735, longitude: 103.94 },
central: { latitude: 1.35735, longitude: 103.82 },
south: { latitude: 1.29587, longitude: 103.82 },
north: { latitude: 1.41803, longitude: 103.82 },
};
function MapWeather24H({ data }) {
const { innerWidth: width, innerHeight: height } = window;
const [indexForecast, setIndexForecast] = useState(0);
let zoom, iconSize;
if (width > 500) {
zoom = 11;
iconSize = 50;
} else {
zoom = 10;
iconSize = 40;
}
function ButtonForecast({ text, index }) {
if (text === "12-18") {
text = "Afternoon";
} else if (text === "18-06" || text === "00-06") {
text = "Night";
} else if (text === "18-00") {
text = "Evening";
} else if (text === "06-12") {
text = "Morning";
}
return (
<button
className={
"bg-white hover:bg-gray-200 text-gray-500 py-1 px-2" +
(indexForecast === index
? " border text-gray-700 font-semibold"
: " border-b hover:text-gray-800 ")
}
onClick={() => setIndexForecast(index)}
>
{text}
</button>
);
}
const position = [1.3521, 103.8198];
let content;
if (data.error) {
content = (
<p className="p-5">
data.gov.sg is under maintenance and we could not download the
current weather forecasts. Please try again later. Sorry for the inconvenience.
</p>
);
} else if (data.loading) {
content = <Loader />;
} else {
content = (
<div className="relative">
<Helmet>
<title>24-hour weather forecasts</title>
<meta
name="description"
content="In this page you can monitor the next 24 hours weather forecasts for five locations across Singapore"
/>
</Helmet>
<Map
center={position}
zoom={zoom}
style={{ height: height - 108 - 104, width: "100%" }}
className="z-0"
zoomControl={false}
>
<ZoomControl position="bottomleft" />
<TileLayer
className="leaflet-tile-pane"
attribution='&copy <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
{data.data
? Object.keys(data.data["items"][0]["periods"][0]["regions"]).map(
(marker) => (
<Marker
key={marker}
position={[
regionsMetadata[marker].latitude,
regionsMetadata[marker].longitude,
]}
icon={GetIcon(
data.data["items"][0]["periods"][indexForecast][
"regions"
][marker],
iconSize
)}
>
<Popup>
<div className="text-center">
<span className="text-lg capitalize">{marker}</span>{" "}
<br />
{
data.data["items"][0]["periods"][indexForecast][
"regions"
][marker]
}
</div>
</Popup>
</Marker>
)
)
: ""}
</Map>
<div className="z-10 absolute top-0 right-0 left-0 mx-auto text-center">
<div className="inline-flex mt-2 shadow-lg">
{data.data
? data.data["items"][0]["periods"].map((period, index) => (
<ButtonForecast
key={period.time.start}
text={
period.time.start.split("T")[1].split(":")[0] +
"-" +
period.time.end.split("T")[1].split(":")[0]
}
index={index}
/>
))
: ""}
</div>
</div>
</div>
);
}
return content;
}
export default MapWeather24H;
| 30.564103 | 122 | 0.475881 |
a789d2fffaff85036f2754088510195dbdf6da2a | 1,962 | js | JavaScript | src/routes/AppRouter.js | JorgeOARL121820/repoPrueba | 2a628c6acb2f9c83b31f6b8ae5afd96a9b2d2149 | [
"MIT"
] | null | null | null | src/routes/AppRouter.js | JorgeOARL121820/repoPrueba | 2a628c6acb2f9c83b31f6b8ae5afd96a9b2d2149 | [
"MIT"
] | null | null | null | src/routes/AppRouter.js | JorgeOARL121820/repoPrueba | 2a628c6acb2f9c83b31f6b8ae5afd96a9b2d2149 | [
"MIT"
] | null | null | null | import React, { useEffect } from 'react';
import { useDispatch } from 'react-redux';
import {
BrowserRouter as Router,
Routes,
Route,
Navigate
} from 'react-router-dom';
import { fetchDestinos, loadCart } from '../actions/actions';
// import { useDispatch } from 'react-redux';
import { NavigationBar } from '../components/NavigationBar';
import { ItemLinks } from '../components/shop/ItemLinks';
import { CartPage } from '../pages/CartPage';
import { FlyPage } from '../pages/FlyPage';
import { TicketsPage } from '../pages/TicketsPage';
import { types } from '../types/types';
const links = {
icon: 'bx bxs-cart-alt', link: '/carrito'
};
export const AppRouter = () => {
const dispatch = useDispatch();
useEffect(() => {
console.log("USE_EFFECT PASO POR AQUÍ");
dispatch(fetchDestinos());
dispatch(loadCart());
dispatch({
type: types.calculateTotal,
});
}, [dispatch]);
return (
<Router>
<NavigationBar></NavigationBar>
<div id="principalDiv" className="pages">
<div className="card">
<div className="pull-right">
<ItemLinks {...links} />
</div>
</div>
<Routes>
<Route exact
path="/comprar-vuelos"
element={ <FlyPage /> } />
<Route exact
path="/mis-compras"
element={ <TicketsPage/> } />
<Route exact
path="/carrito"
element={ <CartPage/> } />
<Route
path="*"
element={<Navigate to="/comprar-vuelos" />}
/>
</Routes>
</div>
</Router>
)
}
| 28.434783 | 71 | 0.464832 |
a78a5f33ac4befcca07d28eacafc43c3b9b1a58c | 166 | js | JavaScript | src/control/todo/setting.js | yesccx/tetris-online | b75bd81d717592f5a192ac07b0f7bb3793dc1ab4 | [
"MIT"
] | null | null | null | src/control/todo/setting.js | yesccx/tetris-online | b75bd81d717592f5a192ac07b0f7bb3793dc1ab4 | [
"MIT"
] | null | null | null | src/control/todo/setting.js | yesccx/tetris-online | b75bd81d717592f5a192ac07b0f7bb3793dc1ab4 | [
"MIT"
] | null | null | null |
const down = store => {
store.commit('key_setting', true)
}
const up = store => {
store.commit('key_setting', false)
}
export default {
down,
up
}
| 11.857143 | 38 | 0.590361 |
a78b8880e0bd043516a5ff06c0d7a6f5ecbfd8fa | 655 | js | JavaScript | src/server/routes/index.js | gmnordlogic/agenda | 2a87c5887edacdcb00e1b17b83fb85dcc57029e5 | [
"MIT"
] | null | null | null | src/server/routes/index.js | gmnordlogic/agenda | 2a87c5887edacdcb00e1b17b83fb85dcc57029e5 | [
"MIT"
] | null | null | null | src/server/routes/index.js | gmnordlogic/agenda | 2a87c5887edacdcb00e1b17b83fb85dcc57029e5 | [
"MIT"
] | null | null | null | module.exports = function(app) {
var jsonfileservice = require('./utils/jsonfileservice')();
app.get('/api/maa', getMaa);
app.get('/api/mam', getMam); // motto
function getMaa(req, res, next) {
var json = jsonfileservice.getJsonFromFile('/../../data/maa.json');
json[0].data.results.forEach(function(character) {
var pos = character.name.indexOf('(MAA)');
character.name = character.name.substr(0, pos - 1);
});
res.send(json);
}
function getMam(req, res, next) {
var json = jsonfileservice.getJsonFromFile('/../../data/mam.json');
res.send(json);
}
}; | 32.75 | 75 | 0.583206 |
a78c37dd3b976fcae90fcc3a7e220096d54d6ebf | 521 | js | JavaScript | src/background.js | eks5115/shell-chrome-extension | 4ff262ca6bdffba765aed63841e6491e5306e24c | [
"Apache-2.0"
] | null | null | null | src/background.js | eks5115/shell-chrome-extension | 4ff262ca6bdffba765aed63841e6491e5306e24c | [
"Apache-2.0"
] | null | null | null | src/background.js | eks5115/shell-chrome-extension | 4ff262ca6bdffba765aed63841e6491e5306e24c | [
"Apache-2.0"
] | null | null | null |
chrome.runtime.onMessage.addListener(function (message, sender, sendResponse) {
if (message.type === 'command') {
let port = chrome.runtime.connectNative('com.github.eks5115.shell.chrome.extension');
port.onMessage.addListener((data) => {
console.debug('command result: %o', data);
port.disconnect();
sendResponse(data);
});
port.onDisconnect.addListener(function() {
console.log("Disconnected");
});
port.postMessage({
command: message.payload
});
}
});
| 24.809524 | 89 | 0.644914 |
a78c55d08bb047c1b0870b1cd64adb5274bf5e37 | 1,095 | js | JavaScript | client/src/reducers/teamReducer.js | EricPuskas/zenips-gaming | c97eae83aa98a20e8f0fad1231704442eebc359d | [
"Apache-2.0"
] | 1 | 2019-10-30T19:40:55.000Z | 2019-10-30T19:40:55.000Z | client/src/reducers/teamReducer.js | cyps1000/zenips-gaming | fe409c662bd0491284524247e55da3d73708b672 | [
"Apache-2.0"
] | 1 | 2021-05-28T19:25:26.000Z | 2021-05-28T19:25:26.000Z | client/src/reducers/teamReducer.js | cyps1000/zenips-gaming | fe409c662bd0491284524247e55da3d73708b672 | [
"Apache-2.0"
] | 1 | 2019-02-28T18:34:45.000Z | 2019-02-28T18:34:45.000Z | import {
GET_TEAM_MEMBERS,
TEAM_LOADING,
DELETE_TEAM_MEMBER,
INIT_TEAM_LOADING,
} from "../actions/types";
const initialState = {
members: [],
loading: false,
init_loading: false,
delete_loading: false,
update_loading: false
};
export default function(state = initialState, action) {
switch (action.type) {
case GET_TEAM_MEMBERS:
return {
...state,
members: action.payload,
init_loading: false,
update_loading: false,
delete_loading: false,
loading: false
};
case INIT_TEAM_LOADING:
return {
...state,
update_loading: false,
delete_loading: false,
loading: false,
init_loading: true
};
case TEAM_LOADING:
return {
...state,
update_loading: false,
delete_loading: false,
loading: true,
init_loading: false
};
case DELETE_TEAM_MEMBER:
return {
...state,
members: state.members.filter(member => member._id !== action.payload)
};
default:
return state;
}
}
| 21.057692 | 78 | 0.592694 |
a78c5adf15e5895741bfaf7753bc63ac08d461c3 | 614 | js | JavaScript | node_modules/express-status-monitor/src/helpers/validate.js | elennon/ndMVC | 4820a451fe511a62a239da7e0fbe3754d00924ad | [
"MIT"
] | null | null | null | node_modules/express-status-monitor/src/helpers/validate.js | elennon/ndMVC | 4820a451fe511a62a239da7e0fbe3754d00924ad | [
"MIT"
] | null | null | null | node_modules/express-status-monitor/src/helpers/validate.js | elennon/ndMVC | 4820a451fe511a62a239da7e0fbe3754d00924ad | [
"MIT"
] | null | null | null | const defaultConfig = require('./default-config');
module.exports = (config) => {
if (!config) {
return defaultConfig;
}
config.title = (typeof config.title === 'string') ? config.title : defaultConfig.title;
config.path = (typeof config.path === 'string') ? config.path : defaultConfig.path;
config.spans = (typeof config.spans === 'object') ? config.spans : defaultConfig.spans;
config.port = (typeof config.port === 'number') ? config.port : defaultConfig.port;
config.websocket = (typeof config.websocket === 'object') ? config.websocket : defaultConfig.websocket;
return config;
};
| 30.7 | 105 | 0.68241 |
a78c805c19af99cfac1c6255b0cea3498e402354 | 2,439 | js | JavaScript | si/s.js | redcapital/dump | 348bec2abf9489fca0f8b596955ad554580e7808 | [
"MIT"
] | null | null | null | si/s.js | redcapital/dump | 348bec2abf9489fca0f8b596955ad554580e7808 | [
"MIT"
] | null | null | null | si/s.js | redcapital/dump | 348bec2abf9489fca0f8b596955ad554580e7808 | [
"MIT"
] | null | null | null | const g = document.getElementById('g');
const cells = new Array(10);
for (let y = 14; y >= 0; y--) {
const row = document.createElement('div');
g.appendChild(row);
const rowCells = [];
for (let x = 0; x < 27; x++) {
const cell = document.createElement('span');
if (y == 0 && x > 0) {
// X coord labels
cell.textContent = String.fromCharCode(96 + x);
}
if (x == 0 && y > 0) {
// Y coord labels
cell.textContent = (y - 1).toString();
}
row.appendChild(cell);
if (x > 0 && y > 0) {
rowCells.push(cell);
}
}
if (y > 0) {
cells[y - 1] = rowCells;
}
}
const s = 'a9 g4 c3 i3 b1 f6 f9 e4 y4 h4 h5 f3 a7 b0 e3 d3 j1 a3 f6 c9 m6 g1 a6 h3 r6 h6 g4 bb o0 a7 k2 a5 s3 b5 h3 a6 a7 b9 g1 w6 c8 c6 a6 h1 i3 g5 o4 c4';
const moves = s.split(' ').map((coord) => {
const x = coord.charCodeAt(0) - 97;
const y = coord[1] == 'b' ? 11 : parseInt(coord[1]);
return { x, y };
});
let move = 0;
function forward() {
if (move === moves.length) {
return;
}
const {x, y} = moves[move++];
const content = cells[y][x].textContent;
const classes = cells[y][x].classList;
if (classes.contains('o2')) {
classes.add('o3');
} else if (classes.contains('o1')) {
classes.add('o2');
} else {
classes.add('o1');
}
cells[y][x].textContent = content ? `${content}, ${move}` : move;
}
function backward() {
if (move < 1) {
return;
}
const {x, y} = moves[--move];
const content = cells[y][x].textContent;
const classes = cells[y][x].classList;
if (classes.contains('o3')) {
classes.remove('o3');
} else if (classes.contains('o2')) {
classes.remove('o2');
} else {
classes.remove('o1');
}
cells[y][x].textContent = content.split(', ').slice(0, -1).join(', ');
}
document.addEventListener('keydown', (e) => {
if (e.key === 'ArrowRight') {
forward();
} else if (e.key === 'ArrowLeft') {
backward();
}
});
//moves.forEach((move, idx) => {
//const { x, y } = move;;
//const content = cells[y][x].textContent;
//const classes = cells[y][x].classList;
//if (classes.contains('o2')) {
//classes.add('o3');
//} else if (classes.contains('o1')) {
//classes.add('o2');
//} else {
//classes.add('o1');
//}
//cells[y][x].textContent = content ? `${content}, ${idx}` : idx;
//});
//cells[0][0].textContent = 'asdf';
//cells[0][5].textContent = 'asdf';
//cells[9][5].textContent = 'asdf';
| 25.673684 | 156 | 0.550636 |
a78cc0237a2d38508930e85c2ba9f8522eca7da7 | 491 | js | JavaScript | src/utils/prismic-configuration.js | SeanPagal/portfolio | 281e14ae64550a8a0c3d20dfa2713c8884ce9ecc | [
"MIT"
] | null | null | null | src/utils/prismic-configuration.js | SeanPagal/portfolio | 281e14ae64550a8a0c3d20dfa2713c8884ce9ecc | [
"MIT"
] | 7 | 2020-05-18T19:55:37.000Z | 2022-02-27T05:02:03.000Z | src/utils/prismic-configuration.js | SeanPagal/portfolio | 281e14ae64550a8a0c3d20dfa2713c8884ce9ecc | [
"MIT"
] | null | null | null | // // In src/prismic-configuration.js
// linkResolver: function(doc) {
// // URL for a category type
// if (doc.type == 'category') {
// return '/category/' + doc.uid;
// }
// // URL for a product type
// if (doc.type == 'product') {
// return '/product/' + doc.uid;
// }
// // Backup for all other types
// return '/';
// }
export const removeCompressionFromPrismicUrl = string => {
return string.replace("?auto=compress,format", "")
}
| 23.380952 | 58 | 0.553971 |
a78d605d0905f84e2210089bcb0717fbca4e8588 | 46,703 | js | JavaScript | 20211SVAC/G14/InterpreteXPath/GramaticaXPath/xpathAsc.js | OscarLlamas6/tytusx | 627032e7e56e5b4488150a8885d64445b74768bd | [
"MIT"
] | 4 | 2021-06-13T05:34:26.000Z | 2021-06-16T21:53:00.000Z | 20211SVAC/G14/InterpreteXPath/GramaticaXPath/xpathAsc.js | OscarLlamas6/tytusx | 627032e7e56e5b4488150a8885d64445b74768bd | [
"MIT"
] | 14 | 2021-06-14T07:09:39.000Z | 2021-07-07T04:17:02.000Z | 20211SVAC/G14/InterpreteXPath/GramaticaXPath/xpathAsc.js | OscarLlamas6/tytusx | 627032e7e56e5b4488150a8885d64445b74768bd | [
"MIT"
] | 99 | 2021-06-08T03:43:42.000Z | 2021-07-05T05:03:29.000Z | /* parser generated by jison 0.4.18 */
/*
Returns a Parser object of the following structure:
Parser: {
yy: {}
}
Parser.prototype: {
yy: {},
trace: function(),
symbols_: {associative list: name ==> number},
terminals_: {associative list: number ==> name},
productions_: [...],
performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
table: [...],
defaultActions: {...},
parseError: function(str, hash),
parse: function(input),
lexer: {
EOF: 1,
parseError: function(str, hash),
setInput: function(input),
input: function(),
unput: function(str),
more: function(),
less: function(n),
pastInput: function(),
upcomingInput: function(),
showPosition: function(),
test_match: function(regex_match_array, rule_index),
next: function(),
lex: function(),
begin: function(condition),
popState: function(),
_currentRules: function(),
topState: function(),
pushState: function(condition),
options: {
ranges: boolean (optional: true ==> token location info will include a .range[] member)
flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
},
performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
rules: [...],
conditions: {associative list: name ==> set},
}
}
token location info (@$, _$, etc.): {
first_line: n,
last_line: n,
first_column: n,
last_column: n,
range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
}
the parseError function receives a 'hash' object with these members for lexer and parser errors: {
text: (matched text)
token: (the produced terminal token, if any)
line: (yylineno)
}
while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
loc: (yylloc)
expected: (string describing the set of expected tokens)
recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
}
*/
var xpathAsc = (function(){
var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,15],$V1=[1,14],$V2=[1,58],$V3=[1,11],$V4=[1,12],$V5=[1,27],$V6=[1,28],$V7=[1,29],$V8=[1,30],$V9=[1,31],$Va=[1,32],$Vb=[1,33],$Vc=[1,34],$Vd=[1,35],$Ve=[1,37],$Vf=[1,38],$Vg=[1,39],$Vh=[1,40],$Vi=[1,41],$Vj=[1,42],$Vk=[1,64],$Vl=[1,62],$Vm=[1,45],$Vn=[1,59],$Vo=[1,61],$Vp=[1,60],$Vq=[1,44],$Vr=[1,48],$Vs=[1,49],$Vt=[1,66],$Vu=[5,7,40,77],$Vv=[1,67],$Vw=[5,7,9,40,77],$Vx=[1,69],$Vy=[1,70],$Vz=[5,7,9,12,13,14,15,16,17,19,20,40,77],$VA=[1,77],$VB=[1,78],$VC=[1,79],$VD=[5,7,9,12,13,14,15,16,17,19,20,22,23,24,40,77],$VE=[1,80],$VF=[5,7,9,12,13,14,15,16,17,19,20,22,23,24,26,40,77],$VG=[1,82],$VH=[1,81],$VI=[5,7,9,12,13,14,15,16,17,19,20,22,23,24,26,29,31,40,77],$VJ=[19,20,22,29,31,44,46,47,48,49,50,51,52,53,56,57,58,59,60,61,70,75,76,78,79,80,85,86,87],$VK=[2,39],$VL=[1,91],$VM=[5,7,9,12,13,14,15,16,17,19,20,22,23,24,26,29,31,39,40,77],$VN=[22,70,75,78,79,80];
var parser = {trace: function trace () { },
yy: {},
symbols_: {"error":2,"INICIO":3,"EXPRESION_SIMPLE":4,"EOF":5,"EXPRESION_AND":6,"R_OR":7,"EXPRESION_COMPARAC":8,"R_AND":9,"EXPRESION_ADICION":10,"OPERADORES_LOGICOS":11,"E":12,"NE":13,"LT":14,"LE":15,"GT":16,"GE":17,"EXPRESION_MULTI":18,"RESTA":19,"SUMA":20,"EXPRESION_UNION":21,"MULTIPLICACION":22,"R_DIV":23,"R_MOD":24,"EXPRESION_UNARIA":25,"UNION":26,"RUTA_RELATIVA":27,"SIMBOLO":28,"DBARRA":29,"PASO":30,"BARRA":31,"PASO_EJE":32,"POSTFIX":33,"PASO_ADELANTE":34,"LISTA_PREDICADOS_AUX":35,"PASO_ATRAS":36,"LISTA_PREDICADOS":37,"PREDICADO":38,"CORCHETE_ABRE":39,"CORCHETE_CIERRA":40,"EJE_ADELANTE":41,"PRUEBA_NODO":42,"PASO_ADELANTE_ABREV":43,"R_CHILD":44,"ACCESO":45,"R_DESCENDANT":46,"R_ATTRIBUTE":47,"R_SELF":48,"R_DESCENDANT_OR_SELF":49,"R_FOLLOWING_SIBLING":50,"R_FOLLOWING":51,"R_NAMESPACE":52,"ARROBA":53,"EJE_ATRAS":54,"PASO_ATRAS_ABREV":55,"R_PARENT":56,"R_ANCESTOR":57,"R_PRECEDING_SIBLING":58,"R_PRECEDING":59,"R_ANCESTOR_OR_SELF":60,"DPUNTO":61,"NOMBRE_PRUEBA":62,"TIPO_PRUEBA":63,"Q_NAME":64,"WILDCARD":65,"NOMBRE_PREFIJO":66,"NOMBRE_SIN_PREFIJO":67,"NCNAME":68,"SEPARADOR":69,"IDENTIFICADOR":70,"PRUEBA_TEXTO":71,"PRUEBA_NODE":72,"PRUEBA_POSICION":73,"PRUEBA_ULTIMO":74,"R_LAST":75,"PARENTESIS_ABRE":76,"PARENTESIS_CIERRA":77,"R_TEXT":78,"R_POSITION":79,"R_NODE":80,"EXPRESION_PRIMARIA":81,"LITERAL":82,"EXPRESION_PARENTESIS":83,"LITERAL_NUMERO":84,"CADENA":85,"ENTERO":86,"DECIMAL":87,"$accept":0,"$end":1},
terminals_: {2:"error",5:"EOF",7:"R_OR",9:"R_AND",12:"E",13:"NE",14:"LT",15:"LE",16:"GT",17:"GE",19:"RESTA",20:"SUMA",22:"MULTIPLICACION",23:"R_DIV",24:"R_MOD",26:"UNION",29:"DBARRA",31:"BARRA",39:"CORCHETE_ABRE",40:"CORCHETE_CIERRA",44:"R_CHILD",45:"ACCESO",46:"R_DESCENDANT",47:"R_ATTRIBUTE",48:"R_SELF",49:"R_DESCENDANT_OR_SELF",50:"R_FOLLOWING_SIBLING",51:"R_FOLLOWING",52:"R_NAMESPACE",53:"ARROBA",56:"R_PARENT",57:"R_ANCESTOR",58:"R_PRECEDING_SIBLING",59:"R_PRECEDING",60:"R_ANCESTOR_OR_SELF",61:"DPUNTO",69:"SEPARADOR",70:"IDENTIFICADOR",75:"R_LAST",76:"PARENTESIS_ABRE",77:"PARENTESIS_CIERRA",78:"R_TEXT",79:"R_POSITION",80:"R_NODE",85:"CADENA",86:"ENTERO",87:"DECIMAL"},
productions_: [0,[3,2],[4,1],[4,3],[6,1],[6,3],[8,1],[8,3],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[10,1],[10,3],[10,3],[18,1],[18,3],[18,3],[18,3],[21,1],[21,3],[25,1],[25,2],[28,1],[28,1],[28,2],[28,2],[27,2],[27,2],[27,1],[27,3],[27,3],[30,1],[30,1],[32,2],[32,2],[35,1],[35,0],[37,1],[37,2],[38,3],[34,2],[34,1],[41,2],[41,2],[41,2],[41,2],[41,2],[41,2],[41,2],[41,2],[43,2],[43,1],[36,2],[36,1],[54,2],[54,2],[54,2],[54,2],[54,2],[55,1],[42,1],[42,1],[62,1],[62,1],[65,1],[64,1],[64,1],[66,3],[67,1],[68,1],[63,1],[63,1],[63,1],[63,1],[74,3],[71,3],[73,3],[72,3],[33,1],[33,2],[81,1],[81,1],[83,2],[83,3],[82,1],[82,1],[84,1],[84,1]],
performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
/* this == yyval */
var $0 = $$.length - 1;
switch (yystate) {
case 1:
return [$$[$0-1]];
break;
case 2: case 4: case 6: case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 17: case 21: case 25: case 26: case 35: case 38: case 40: case 44: case 62: case 63: case 64: case 65: case 66: case 68: case 69: case 71: case 73: case 74: case 75: case 76: case 83: case 84: case 87: case 88:
this.$ = $$[$0]
break;
case 3:
this.$ = new Logica(_$[$0-2].first_line, _$[$0-2].first_column,$$[$0-2],$$[$0],TipoL.OR)
break;
case 5:
this.$ = new Logica(_$[$0-2].first_line, _$[$0-2].first_column,$$[$0-2],$$[$0],TipoL.AND)
break;
case 7:
this.$ = new Relacional(_$[$0-2].first_line, _$[$0-2].first_column,$$[$0-2],$$[$0],$$[$0-1])
break;
case 15:
this.$ = new Aritmetica(_$[$0-2].first_line, _$[$0-2].first_column,$$[$0-2],$$[$0],TipoA.RESTA)
break;
case 16:
this.$ = new Aritmetica(_$[$0-2].first_line, _$[$0-2].first_column,$$[$0-2],$$[$0],TipoA.SUMA)
break;
case 18:
this.$ =new Aritmetica(_$[$0-2].first_line, _$[$0-2].first_column,$$[$0-2],$$[$0],TipoA.MULTI)
break;
case 19:
this.$ =new Aritmetica(_$[$0-2].first_line, _$[$0-2].first_column,$$[$0-2],$$[$0],TipoA.DIV)
break;
case 20:
this.$ = new Aritmetica(_$[$0-2].first_line, _$[$0-2].first_column,$$[$0-2],$$[$0],TipoA.MOD)
break;
case 22:
this.$ = $$[$0-2] + " " + $$[$0-1] + " " + $$[$0]
break;
case 23:
this.$ = $$[$0] ;
break;
case 24: case 85:
this.$ = $$[$0-1] + $$[$0]
break;
case 27: case 28: case 45: case 46: case 47: case 48: case 49: case 50: case 51: case 52:
this.$ = $$[$0-1] + $$[$0]
break;
case 29: case 30:
this.$ = new Consulta(_$[$0-1].first_column,$$[$0-1],$$[$0],null)
break;
case 31:
this.$ = $$[$0]
break;
case 32:
this.$ = new Consulta(_$[$0-2].first_column,$$[$0-1],$$[$0],$$[$0-2])
break;
case 33:
this.$ = new Consulta(_$[$0-2].first_column,$$[$0-1],$$[$0],$$[$0-2])
break;
case 34:
this.$ = $$[$0] ;
break;
case 36:
$$[$0-1].predicado = $$[$0]; this.$ = $$[$0-1] // cuerpo
break;
case 37:
$$[$0-1].predicado = $$[$0]; this.$=$$[$0-1]
break;
case 39:
this.$ = null
break;
case 41:
this.$ = $$[$0-1].push($$[$0])
break;
case 42:
this.$=new Predicado(_$[$0-2].first_column,$$[$0-1])
break;
case 43:
this.$ = new Cuerpo(_$[$0-1].first_column,
new Funcion(_$[$0-1].first_column,$$[$0-1],TipoF.ACCESO, $$[$0]),
);
break;
case 53:
this.$ = new Cuerpo(_$[$0-1].first_column,null,$$[$0-1],$$[$0],null);
// @ // id:id or id or * or funcion()
break;
case 54:
this.$ = new Cuerpo(_$[$0].first_column,null,null,$$[$0],null);
break;
case 55:
this.$ = new Cuerpo(_$[$0-1].first_column,
new Funcion(_$[$0-1].first_column,$$[$0-1],TipoF.ACCESO, $$[$0]),
);
/* ancestor:: position()
ancestor:: id:id
ancestor:: id
ancestor:: * */
break;
case 56:
this.$ = new Cuerpo(_$[$0].first_column,null,null,$$[$0],null);
break;
case 57:
this.$ = $$[$0-1] + $$[$0]; this.$ = $$[$0-1]
break;
case 58: case 59: case 60: case 61:
this.$ = $$[$0-1] + $$[$0];this.$ = $$[$0-1]
break;
case 67:
this.$ = new Primitivo(0, _$[$0].first_column, TipoDato.FILTRO, $$[$0])
break;
case 70:
this.$ = new Primitivo(0, _$[$0-2].first_column, TipoDato.VARIABLE, [$$[$0-2],$$[$0-1],$$[$0]])
break;
case 72:
this.$ = new Primitivo(0, _$[$0].first_column, TipoDato.VARIABLE, $$[$0])
break;
case 77:
this.$ = $$[$0-2] + $$[$0-1] + $$[$0]; this.$ = new Funcion(1,$$[$0-2],TipoF.FUNCION)
break;
case 78: case 79:
this.$ = $$[$0-2] + $$[$0-1] + $$[$0];this.$ = new Funcion(1,$$[$0-2],TipoF.FUNCION)
break;
case 80:
this.$ = $$[$0-2] + $$[$0-1] + $$[$0] ;this.$ = new Funcion(1,$$[$0-2],TipoF.FUNCION)
break;
case 81:
this.$ = new Cuerpo(_$[$0].first_column,null,null,$$[$0],null);
break;
case 82:
this.$ = new Cuerpo(_$[$0-1].first_column,null,null,$$[$0-1],$$[$0]);
break;
case 86:
this.$ =$$[$0-1]
break;
case 89:
this.$ = new Primitivo(0, 0, TipoDato.INT, $$[$0])
break;
case 90:
this.$ = new Primitivo(0,_$[$0].first_column, TipoDato.DOUBLE, $$[$0])
break;
}
},
table: [{3:1,4:2,6:3,8:4,10:5,18:6,19:$V0,20:$V1,21:7,22:$V2,25:8,27:9,28:10,29:$V3,30:13,31:$V4,32:16,33:17,34:18,36:19,41:21,42:36,43:22,44:$V5,46:$V6,47:$V7,48:$V8,49:$V9,50:$Va,51:$Vb,52:$Vc,53:$Vd,54:23,55:24,56:$Ve,57:$Vf,58:$Vg,59:$Vh,60:$Vi,61:$Vj,62:46,63:47,64:50,65:51,66:56,67:57,68:63,70:$Vk,71:52,72:53,73:54,74:55,75:$Vl,76:$Vm,78:$Vn,79:$Vo,80:$Vp,81:20,82:25,83:26,84:43,85:$Vq,86:$Vr,87:$Vs},{1:[3]},{5:[1,65],7:$Vt},o($Vu,[2,2],{9:$Vv}),o($Vw,[2,4]),o($Vw,[2,6],{11:68,12:[1,71],13:[1,72],14:[1,73],15:[1,74],16:[1,75],17:[1,76],19:$Vx,20:$Vy}),o($Vz,[2,14],{22:$VA,23:$VB,24:$VC}),o($VD,[2,17],{26:$VE}),o($VF,[2,21]),o($VF,[2,23],{29:$VG,31:$VH}),{19:[1,85],20:[1,84],22:$V2,27:83,29:$V3,30:13,31:$V4,32:16,33:17,34:18,36:19,41:21,42:36,43:22,44:$V5,46:$V6,47:$V7,48:$V8,49:$V9,50:$Va,51:$Vb,52:$Vc,53:$Vd,54:23,55:24,56:$Ve,57:$Vf,58:$Vg,59:$Vh,60:$Vi,61:$Vj,62:46,63:47,64:50,65:51,66:56,67:57,68:63,70:$Vk,71:52,72:53,73:54,74:55,75:$Vl,76:$Vm,78:$Vn,79:$Vo,80:$Vp,81:20,82:25,83:26,84:43,85:$Vq,86:$Vr,87:$Vs},{22:$V2,30:86,32:16,33:17,34:18,36:19,41:21,42:36,43:22,44:$V5,46:$V6,47:$V7,48:$V8,49:$V9,50:$Va,51:$Vb,52:$Vc,53:$Vd,54:23,55:24,56:$Ve,57:$Vf,58:$Vg,59:$Vh,60:$Vi,61:$Vj,62:46,63:47,64:50,65:51,66:56,67:57,68:63,70:$Vk,71:52,72:53,73:54,74:55,75:$Vl,76:$Vm,78:$Vn,79:$Vo,80:$Vp,81:20,82:25,83:26,84:43,85:$Vq,86:$Vr,87:$Vs},{22:$V2,30:87,32:16,33:17,34:18,36:19,41:21,42:36,43:22,44:$V5,46:$V6,47:$V7,48:$V8,49:$V9,50:$Va,51:$Vb,52:$Vc,53:$Vd,54:23,55:24,56:$Ve,57:$Vf,58:$Vg,59:$Vh,60:$Vi,61:$Vj,62:46,63:47,64:50,65:51,66:56,67:57,68:63,70:$Vk,71:52,72:53,73:54,74:55,75:$Vl,76:$Vm,78:$Vn,79:$Vo,80:$Vp,81:20,82:25,83:26,84:43,85:$Vq,86:$Vr,87:$Vs},o($VI,[2,31]),o($VJ,[2,25]),o($VJ,[2,26]),o($VI,[2,34]),o($VI,[2,35]),o($VI,$VK,{35:88,37:89,38:90,39:$VL}),o($VI,$VK,{37:89,38:90,35:92,39:$VL}),o($VI,[2,81],{38:90,37:93,39:$VL}),{22:$V2,42:94,62:46,63:47,64:50,65:51,66:56,67:57,68:63,70:$Vk,71:52,72:53,73:54,74:55,75:$Vl,78:$Vn,79:$Vo,80:$Vp},o($VM,[2,44]),{22:$V2,42:95,62:46,63:47,64:50,65:51,66:56,67:57,68:63,70:$Vk,71:52,72:53,73:54,74:55,75:$Vl,78:$Vn,79:$Vo,80:$Vp},o($VM,[2,56]),o($VM,[2,83]),o($VM,[2,84]),{45:[1,96]},{45:[1,97]},{45:[1,98]},{45:[1,99]},{45:[1,100]},{45:[1,101]},{45:[1,102]},{45:[1,103]},{22:$V2,42:104,62:46,63:47,64:50,65:51,66:56,67:57,68:63,70:$Vk,71:52,72:53,73:54,74:55,75:$Vl,78:$Vn,79:$Vo,80:$Vp},o($VM,[2,54]),{45:[1,105]},{45:[1,106]},{45:[1,107]},{45:[1,108]},{45:[1,109]},o($VM,[2,62]),o($VM,[2,87]),o($VM,[2,88]),{4:111,6:3,8:4,10:5,18:6,19:$V0,20:$V1,21:7,22:$V2,25:8,27:9,28:10,29:$V3,30:13,31:$V4,32:16,33:17,34:18,36:19,41:21,42:36,43:22,44:$V5,46:$V6,47:$V7,48:$V8,49:$V9,50:$Va,51:$Vb,52:$Vc,53:$Vd,54:23,55:24,56:$Ve,57:$Vf,58:$Vg,59:$Vh,60:$Vi,61:$Vj,62:46,63:47,64:50,65:51,66:56,67:57,68:63,70:$Vk,71:52,72:53,73:54,74:55,75:$Vl,76:$Vm,77:[1,110],78:$Vn,79:$Vo,80:$Vp,81:20,82:25,83:26,84:43,85:$Vq,86:$Vr,87:$Vs},o($VM,[2,63]),o($VM,[2,64]),o($VM,[2,89]),o($VM,[2,90]),o($VM,[2,65]),o($VM,[2,66]),o($VM,[2,73]),o($VM,[2,74]),o($VM,[2,75]),o($VM,[2,76]),o($VM,[2,68]),o($VM,[2,69]),o($VM,[2,67]),{76:[1,112]},{76:[1,113]},{76:[1,114]},{76:[1,115]},o($VM,[2,71],{69:[1,116]}),o([5,7,9,12,13,14,15,16,17,19,20,22,23,24,26,29,31,39,40,69,77],[2,72]),{1:[2,1]},{6:117,8:4,10:5,18:6,19:$V0,20:$V1,21:7,22:$V2,25:8,27:9,28:10,29:$V3,30:13,31:$V4,32:16,33:17,34:18,36:19,41:21,42:36,43:22,44:$V5,46:$V6,47:$V7,48:$V8,49:$V9,50:$Va,51:$Vb,52:$Vc,53:$Vd,54:23,55:24,56:$Ve,57:$Vf,58:$Vg,59:$Vh,60:$Vi,61:$Vj,62:46,63:47,64:50,65:51,66:56,67:57,68:63,70:$Vk,71:52,72:53,73:54,74:55,75:$Vl,76:$Vm,78:$Vn,79:$Vo,80:$Vp,81:20,82:25,83:26,84:43,85:$Vq,86:$Vr,87:$Vs},{8:118,10:5,18:6,19:$V0,20:$V1,21:7,22:$V2,25:8,27:9,28:10,29:$V3,30:13,31:$V4,32:16,33:17,34:18,36:19,41:21,42:36,43:22,44:$V5,46:$V6,47:$V7,48:$V8,49:$V9,50:$Va,51:$Vb,52:$Vc,53:$Vd,54:23,55:24,56:$Ve,57:$Vf,58:$Vg,59:$Vh,60:$Vi,61:$Vj,62:46,63:47,64:50,65:51,66:56,67:57,68:63,70:$Vk,71:52,72:53,73:54,74:55,75:$Vl,76:$Vm,78:$Vn,79:$Vo,80:$Vp,81:20,82:25,83:26,84:43,85:$Vq,86:$Vr,87:$Vs},{10:119,18:6,19:$V0,20:$V1,21:7,22:$V2,25:8,27:9,28:10,29:$V3,30:13,31:$V4,32:16,33:17,34:18,36:19,41:21,42:36,43:22,44:$V5,46:$V6,47:$V7,48:$V8,49:$V9,50:$Va,51:$Vb,52:$Vc,53:$Vd,54:23,55:24,56:$Ve,57:$Vf,58:$Vg,59:$Vh,60:$Vi,61:$Vj,62:46,63:47,64:50,65:51,66:56,67:57,68:63,70:$Vk,71:52,72:53,73:54,74:55,75:$Vl,76:$Vm,78:$Vn,79:$Vo,80:$Vp,81:20,82:25,83:26,84:43,85:$Vq,86:$Vr,87:$Vs},{18:120,19:$V0,20:$V1,21:7,22:$V2,25:8,27:9,28:10,29:$V3,30:13,31:$V4,32:16,33:17,34:18,36:19,41:21,42:36,43:22,44:$V5,46:$V6,47:$V7,48:$V8,49:$V9,50:$Va,51:$Vb,52:$Vc,53:$Vd,54:23,55:24,56:$Ve,57:$Vf,58:$Vg,59:$Vh,60:$Vi,61:$Vj,62:46,63:47,64:50,65:51,66:56,67:57,68:63,70:$Vk,71:52,72:53,73:54,74:55,75:$Vl,76:$Vm,78:$Vn,79:$Vo,80:$Vp,81:20,82:25,83:26,84:43,85:$Vq,86:$Vr,87:$Vs},{18:121,19:$V0,20:$V1,21:7,22:$V2,25:8,27:9,28:10,29:$V3,30:13,31:$V4,32:16,33:17,34:18,36:19,41:21,42:36,43:22,44:$V5,46:$V6,47:$V7,48:$V8,49:$V9,50:$Va,51:$Vb,52:$Vc,53:$Vd,54:23,55:24,56:$Ve,57:$Vf,58:$Vg,59:$Vh,60:$Vi,61:$Vj,62:46,63:47,64:50,65:51,66:56,67:57,68:63,70:$Vk,71:52,72:53,73:54,74:55,75:$Vl,76:$Vm,78:$Vn,79:$Vo,80:$Vp,81:20,82:25,83:26,84:43,85:$Vq,86:$Vr,87:$Vs},o($VJ,[2,8]),o($VJ,[2,9]),o($VJ,[2,10]),o($VJ,[2,11]),o($VJ,[2,12]),o($VJ,[2,13]),{19:$V0,20:$V1,21:122,22:$V2,25:8,27:9,28:10,29:$V3,30:13,31:$V4,32:16,33:17,34:18,36:19,41:21,42:36,43:22,44:$V5,46:$V6,47:$V7,48:$V8,49:$V9,50:$Va,51:$Vb,52:$Vc,53:$Vd,54:23,55:24,56:$Ve,57:$Vf,58:$Vg,59:$Vh,60:$Vi,61:$Vj,62:46,63:47,64:50,65:51,66:56,67:57,68:63,70:$Vk,71:52,72:53,73:54,74:55,75:$Vl,76:$Vm,78:$Vn,79:$Vo,80:$Vp,81:20,82:25,83:26,84:43,85:$Vq,86:$Vr,87:$Vs},{19:$V0,20:$V1,21:123,22:$V2,25:8,27:9,28:10,29:$V3,30:13,31:$V4,32:16,33:17,34:18,36:19,41:21,42:36,43:22,44:$V5,46:$V6,47:$V7,48:$V8,49:$V9,50:$Va,51:$Vb,52:$Vc,53:$Vd,54:23,55:24,56:$Ve,57:$Vf,58:$Vg,59:$Vh,60:$Vi,61:$Vj,62:46,63:47,64:50,65:51,66:56,67:57,68:63,70:$Vk,71:52,72:53,73:54,74:55,75:$Vl,76:$Vm,78:$Vn,79:$Vo,80:$Vp,81:20,82:25,83:26,84:43,85:$Vq,86:$Vr,87:$Vs},{19:$V0,20:$V1,21:124,22:$V2,25:8,27:9,28:10,29:$V3,30:13,31:$V4,32:16,33:17,34:18,36:19,41:21,42:36,43:22,44:$V5,46:$V6,47:$V7,48:$V8,49:$V9,50:$Va,51:$Vb,52:$Vc,53:$Vd,54:23,55:24,56:$Ve,57:$Vf,58:$Vg,59:$Vh,60:$Vi,61:$Vj,62:46,63:47,64:50,65:51,66:56,67:57,68:63,70:$Vk,71:52,72:53,73:54,74:55,75:$Vl,76:$Vm,78:$Vn,79:$Vo,80:$Vp,81:20,82:25,83:26,84:43,85:$Vq,86:$Vr,87:$Vs},{19:$V0,20:$V1,22:$V2,25:125,27:9,28:10,29:$V3,30:13,31:$V4,32:16,33:17,34:18,36:19,41:21,42:36,43:22,44:$V5,46:$V6,47:$V7,48:$V8,49:$V9,50:$Va,51:$Vb,52:$Vc,53:$Vd,54:23,55:24,56:$Ve,57:$Vf,58:$Vg,59:$Vh,60:$Vi,61:$Vj,62:46,63:47,64:50,65:51,66:56,67:57,68:63,70:$Vk,71:52,72:53,73:54,74:55,75:$Vl,76:$Vm,78:$Vn,79:$Vo,80:$Vp,81:20,82:25,83:26,84:43,85:$Vq,86:$Vr,87:$Vs},{22:$V2,30:126,32:16,33:17,34:18,36:19,41:21,42:36,43:22,44:$V5,46:$V6,47:$V7,48:$V8,49:$V9,50:$Va,51:$Vb,52:$Vc,53:$Vd,54:23,55:24,56:$Ve,57:$Vf,58:$Vg,59:$Vh,60:$Vi,61:$Vj,62:46,63:47,64:50,65:51,66:56,67:57,68:63,70:$Vk,71:52,72:53,73:54,74:55,75:$Vl,76:$Vm,78:$Vn,79:$Vo,80:$Vp,81:20,82:25,83:26,84:43,85:$Vq,86:$Vr,87:$Vs},{22:$V2,30:127,32:16,33:17,34:18,36:19,41:21,42:36,43:22,44:$V5,46:$V6,47:$V7,48:$V8,49:$V9,50:$Va,51:$Vb,52:$Vc,53:$Vd,54:23,55:24,56:$Ve,57:$Vf,58:$Vg,59:$Vh,60:$Vi,61:$Vj,62:46,63:47,64:50,65:51,66:56,67:57,68:63,70:$Vk,71:52,72:53,73:54,74:55,75:$Vl,76:$Vm,78:$Vn,79:$Vo,80:$Vp,81:20,82:25,83:26,84:43,85:$Vq,86:$Vr,87:$Vs},o($VF,[2,24],{29:$VG,31:$VH}),o($VJ,[2,27]),o($VJ,[2,28]),o($VI,[2,29]),o($VI,[2,30]),o($VI,[2,36]),o($VI,[2,38],{38:128,39:$VL}),o($VM,[2,40]),{4:129,6:3,8:4,10:5,18:6,19:$V0,20:$V1,21:7,22:$V2,25:8,27:9,28:10,29:$V3,30:13,31:$V4,32:16,33:17,34:18,36:19,41:21,42:36,43:22,44:$V5,46:$V6,47:$V7,48:$V8,49:$V9,50:$Va,51:$Vb,52:$Vc,53:$Vd,54:23,55:24,56:$Ve,57:$Vf,58:$Vg,59:$Vh,60:$Vi,61:$Vj,62:46,63:47,64:50,65:51,66:56,67:57,68:63,70:$Vk,71:52,72:53,73:54,74:55,75:$Vl,76:$Vm,78:$Vn,79:$Vo,80:$Vp,81:20,82:25,83:26,84:43,85:$Vq,86:$Vr,87:$Vs},o($VI,[2,37]),o($VI,[2,82],{38:128,39:$VL}),o($VM,[2,43]),o($VM,[2,55]),o($VN,[2,45]),o($VN,[2,46]),o($VN,[2,47]),o($VN,[2,48]),o($VN,[2,49]),o($VN,[2,50]),o($VN,[2,51]),o($VN,[2,52]),o($VM,[2,53]),o($VN,[2,57]),o($VN,[2,58]),o($VN,[2,59]),o($VN,[2,60]),o($VN,[2,61]),o($VM,[2,85]),{7:$Vt,77:[1,130]},{77:[1,131]},{77:[1,132]},{77:[1,133]},{77:[1,134]},{68:135,70:$Vk},o($Vu,[2,3],{9:$Vv}),o($Vw,[2,5]),o($Vw,[2,7],{19:$Vx,20:$Vy}),o($Vz,[2,15],{22:$VA,23:$VB,24:$VC}),o($Vz,[2,16],{22:$VA,23:$VB,24:$VC}),o($VD,[2,18],{26:$VE}),o($VD,[2,19],{26:$VE}),o($VD,[2,20],{26:$VE}),o($VF,[2,22]),o($VI,[2,32]),o($VI,[2,33]),o($VM,[2,41]),{7:$Vt,40:[1,136]},o($VM,[2,86]),o($VM,[2,78]),o($VM,[2,80]),o($VM,[2,79]),o($VM,[2,77]),o($VM,[2,70]),o($VM,[2,42])],
defaultActions: {65:[2,1]},
parseError: function parseError (str, hash) {
if (hash.recoverable) {
this.trace(str);
} else {
var error = new Error(str);
error.hash = hash;
throw error;
}
},
parse: function parse(input) {
var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
var args = lstack.slice.call(arguments, 1);
var lexer = Object.create(this.lexer);
var sharedState = { yy: {} };
for (var k in this.yy) {
if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
sharedState.yy[k] = this.yy[k];
}
}
lexer.setInput(input, sharedState.yy);
sharedState.yy.lexer = lexer;
sharedState.yy.parser = this;
if (typeof lexer.yylloc == 'undefined') {
lexer.yylloc = {};
}
var yyloc = lexer.yylloc;
lstack.push(yyloc);
var ranges = lexer.options && lexer.options.ranges;
if (typeof sharedState.yy.parseError === 'function') {
this.parseError = sharedState.yy.parseError;
} else {
this.parseError = Object.getPrototypeOf(this).parseError;
}
function popStack(n) {
stack.length = stack.length - 2 * n;
vstack.length = vstack.length - n;
lstack.length = lstack.length - n;
}
_token_stack:
var lex = function () {
var token;
token = lexer.lex() || EOF;
if (typeof token !== 'number') {
token = self.symbols_[token] || token;
}
return token;
};
var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
while (true) {
state = stack[stack.length - 1];
if (this.defaultActions[state]) {
action = this.defaultActions[state];
} else {
if (symbol === null || typeof symbol == 'undefined') {
symbol = lex();
}
action = table[state] && table[state][symbol];
}
if (typeof action === 'undefined' || !action.length || !action[0]) {
var errStr = '';
expected = [];
for (p in table[state]) {
if (this.terminals_[p] && p > TERROR) {
expected.push('\'' + this.terminals_[p] + '\'');
}
}
if (lexer.showPosition) {
errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
} else {
errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
}
this.parseError(errStr, {
text: lexer.match,
token: this.terminals_[symbol] || symbol,
line: lexer.yylineno,
loc: yyloc,
expected: expected
});
}
if (action[0] instanceof Array && action.length > 1) {
throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
}
switch (action[0]) {
case 1:
stack.push(symbol);
vstack.push(lexer.yytext);
lstack.push(lexer.yylloc);
stack.push(action[1]);
symbol = null;
if (!preErrorSymbol) {
yyleng = lexer.yyleng;
yytext = lexer.yytext;
yylineno = lexer.yylineno;
yyloc = lexer.yylloc;
if (recovering > 0) {
recovering--;
}
} else {
symbol = preErrorSymbol;
preErrorSymbol = null;
}
break;
case 2:
len = this.productions_[action[1]][1];
yyval.$ = vstack[vstack.length - len];
yyval._$ = {
first_line: lstack[lstack.length - (len || 1)].first_line,
last_line: lstack[lstack.length - 1].last_line,
first_column: lstack[lstack.length - (len || 1)].first_column,
last_column: lstack[lstack.length - 1].last_column
};
if (ranges) {
yyval._$.range = [
lstack[lstack.length - (len || 1)].range[0],
lstack[lstack.length - 1].range[1]
];
}
r = this.performAction.apply(yyval, [
yytext,
yyleng,
yylineno,
sharedState.yy,
action[1],
vstack,
lstack
].concat(args));
if (typeof r !== 'undefined') {
return r;
}
if (len) {
stack = stack.slice(0, -1 * len * 2);
vstack = vstack.slice(0, -1 * len);
lstack = lstack.slice(0, -1 * len);
}
stack.push(this.productions_[action[1]][0]);
vstack.push(yyval.$);
lstack.push(yyval._$);
newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
stack.push(newState);
break;
case 3:
return true;
}
}
return true;
}};
const { Valor } = require('../Instrucciones/Valor');
const { Aritmetica, TipoA} = require('../Expresiones/Aritmetica')
const { Primitivo } = require('../Expresiones/Primitivo')
const { TipoDato } = require ('../../InterpreteXML/TablaSimbolo/TipoDato')
const { Relacional } = require ('../Expresiones/Relacional')
const { Logica, TipoL} = require('../Expresiones/Logica')
const { Funcion, TipoF } = require ('../Instrucciones/Funcion')
const { Ruta } = require ('../Instrucciones/Ruta')
const { Consulta } = require('../Instrucciones/Consulta')
const { Cuerpo } = require('../Instrucciones/Cuerpo')
const { Predicado } = require('../Instrucciones/Predicado')
var Auxi = [];
var instr = ""
var Tokens =[]
var cvivar = ""
/* generated by jison-lex 0.3.4 */
var lexer = (function(){
var lexer = ({
EOF:1,
parseError:function parseError(str, hash) {
if (this.yy.parser) {
this.yy.parser.parseError(str, hash);
} else {
throw new Error(str);
}
},
// resets the lexer, sets new input
setInput:function (input, yy) {
this.yy = yy || this.yy || {};
this._input = input;
this._more = this._backtrack = this.done = false;
this.yylineno = this.yyleng = 0;
this.yytext = this.matched = this.match = '';
this.conditionStack = ['INITIAL'];
this.yylloc = {
first_line: 1,
first_column: 0,
last_line: 1,
last_column: 0
};
if (this.options.ranges) {
this.yylloc.range = [0,0];
}
this.offset = 0;
return this;
},
// consumes and returns one char from the input
input:function () {
var ch = this._input[0];
this.yytext += ch;
this.yyleng++;
this.offset++;
this.match += ch;
this.matched += ch;
var lines = ch.match(/(?:\r\n?|\n).*/g);
if (lines) {
this.yylineno++;
this.yylloc.last_line++;
} else {
this.yylloc.last_column++;
}
if (this.options.ranges) {
this.yylloc.range[1]++;
}
this._input = this._input.slice(1);
return ch;
},
// unshifts one char (or a string) into the input
unput:function (ch) {
var len = ch.length;
var lines = ch.split(/(?:\r\n?|\n)/g);
this._input = ch + this._input;
this.yytext = this.yytext.substr(0, this.yytext.length - len);
//this.yyleng -= len;
this.offset -= len;
var oldLines = this.match.split(/(?:\r\n?|\n)/g);
this.match = this.match.substr(0, this.match.length - 1);
this.matched = this.matched.substr(0, this.matched.length - 1);
if (lines.length - 1) {
this.yylineno -= lines.length - 1;
}
var r = this.yylloc.range;
this.yylloc = {
first_line: this.yylloc.first_line,
last_line: this.yylineno + 1,
first_column: this.yylloc.first_column,
last_column: lines ?
(lines.length === oldLines.length ? this.yylloc.first_column : 0)
+ oldLines[oldLines.length - lines.length].length - lines[0].length :
this.yylloc.first_column - len
};
if (this.options.ranges) {
this.yylloc.range = [r[0], r[0] + this.yyleng - len];
}
this.yyleng = this.yytext.length;
return this;
},
// When called from action, caches matched text and appends it on next action
more:function () {
this._more = true;
return this;
},
// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
reject:function () {
if (this.options.backtrack_lexer) {
this._backtrack = true;
} else {
return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), {
text: "",
token: null,
line: this.yylineno
});
}
return this;
},
// retain first n characters of the match
less:function (n) {
this.unput(this.match.slice(n));
},
// displays already matched input, i.e. for error messages
pastInput:function () {
var past = this.matched.substr(0, this.matched.length - this.match.length);
return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
},
// displays upcoming input, i.e. for error messages
upcomingInput:function () {
var next = this.match;
if (next.length < 20) {
next += this._input.substr(0, 20-next.length);
}
return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
},
// displays the character position where the lexing error occurred, i.e. for error messages
showPosition:function () {
var pre = this.pastInput();
var c = new Array(pre.length + 1).join("-");
return pre + this.upcomingInput() + "\n" + c + "^";
},
// test the lexed token: return FALSE when not a match, otherwise return token
test_match:function(match, indexed_rule) {
var token,
lines,
backup;
if (this.options.backtrack_lexer) {
// save context
backup = {
yylineno: this.yylineno,
yylloc: {
first_line: this.yylloc.first_line,
last_line: this.last_line,
first_column: this.yylloc.first_column,
last_column: this.yylloc.last_column
},
yytext: this.yytext,
match: this.match,
matches: this.matches,
matched: this.matched,
yyleng: this.yyleng,
offset: this.offset,
_more: this._more,
_input: this._input,
yy: this.yy,
conditionStack: this.conditionStack.slice(0),
done: this.done
};
if (this.options.ranges) {
backup.yylloc.range = this.yylloc.range.slice(0);
}
}
lines = match[0].match(/(?:\r\n?|\n).*/g);
if (lines) {
this.yylineno += lines.length;
}
this.yylloc = {
first_line: this.yylloc.last_line,
last_line: this.yylineno + 1,
first_column: this.yylloc.last_column,
last_column: lines ?
lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length :
this.yylloc.last_column + match[0].length
};
this.yytext += match[0];
this.match += match[0];
this.matches = match;
this.yyleng = this.yytext.length;
if (this.options.ranges) {
this.yylloc.range = [this.offset, this.offset += this.yyleng];
}
this._more = false;
this._backtrack = false;
this._input = this._input.slice(match[0].length);
this.matched += match[0];
token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
if (this.done && this._input) {
this.done = false;
}
if (token) {
return token;
} else if (this._backtrack) {
// recover context
for (var k in backup) {
this[k] = backup[k];
}
return false; // rule action called reject() implying the next rule should be tested instead.
}
return false;
},
// return next match in input
next:function () {
if (this.done) {
return this.EOF;
}
if (!this._input) {
this.done = true;
}
var token,
match,
tempMatch,
index;
if (!this._more) {
this.yytext = '';
this.match = '';
}
var rules = this._currentRules();
for (var i = 0; i < rules.length; i++) {
tempMatch = this._input.match(this.rules[rules[i]]);
if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
match = tempMatch;
index = i;
if (this.options.backtrack_lexer) {
token = this.test_match(tempMatch, rules[i]);
if (token !== false) {
return token;
} else if (this._backtrack) {
match = false;
continue; // rule action called reject() implying a rule MISmatch.
} else {
// else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
return false;
}
} else if (!this.options.flex) {
break;
}
}
}
if (match) {
token = this.test_match(match, rules[index]);
if (token !== false) {
return token;
}
// else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
return false;
}
if (this._input === "") {
return this.EOF;
} else {
return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
text: "",
token: null,
line: this.yylineno
});
}
},
// return next match that has a token
lex:function lex () {
var r = this.next();
if (r) {
return r;
} else {
return this.lex();
}
},
// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
begin:function begin (condition) {
this.conditionStack.push(condition);
},
// pop the previously active lexer condition state off the condition stack
popState:function popState () {
var n = this.conditionStack.length - 1;
if (n > 0) {
return this.conditionStack.pop();
} else {
return this.conditionStack[0];
}
},
// produce the lexer rule set which is active for the currently active lexer condition state
_currentRules:function _currentRules () {
if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
} else {
return this.conditions["INITIAL"].rules;
}
},
// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
topState:function topState (n) {
n = this.conditionStack.length - 1 - Math.abs(n || 0);
if (n >= 0) {
return this.conditionStack[n];
} else {
return "INITIAL";
}
},
// alias for begin(condition)
pushState:function pushState (condition) {
this.begin(condition);
},
// return the number of states currently on the stack
stateStackSize:function stateStackSize() {
return this.conditionStack.length;
},
options: {"case-insensitive":true},
performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
var YYSTATE=YY_START;
switch($avoiding_name_collisions) {
case 0:/* skip whitespace */
break;
case 1: Tokens.push(['reservada', yy_.yytext, (yy_.yylineno + 1).toString()]); return 78;
break;
case 2: Tokens.push(['reservada', yy_.yytext, (yy_.yylineno + 1).toString()]); return 80;
break;
case 3: Tokens.push(['reservada', yy_.yytext, (yy_.yylineno + 1).toString()]); return 75;
break;
case 4: Tokens.push(['reservada', yy_.yytext, (yy_.yylineno + 1).toString()]); return 79;
break;
case 5: Tokens.push(['reservada', yy_.yytext, (yy_.yylineno + 1).toString()]); return 7;
break;
case 6: Tokens.push(['reservada', yy_.yytext, (yy_.yylineno + 1).toString()]); return 9;
break;
case 7: Tokens.push(['reservada', yy_.yytext, (yy_.yylineno + 1).toString()]); return 23;
break;
case 8: Tokens.push(['reservada', yy_.yytext, (yy_.yylineno + 1).toString()]); return 24;
break;
case 9: Tokens.push(['reservada', yy_.yytext, (yy_.yylineno + 1).toString()]); return 'R_EQ';
break;
case 10: Tokens.push(['reservada', yy_.yytext, (yy_.yylineno + 1).toString()]); return 'R_NE';
break;
case 11: Tokens.push(['reservada', yy_.yytext, (yy_.yylineno + 1).toString()]); return 'R_LT';
break;
case 12: Tokens.push(['reservada', yy_.yytext, (yy_.yylineno + 1).toString()]); return 'R_LE';
break;
case 13: Tokens.push(['reservada', yy_.yytext, (yy_.yylineno + 1).toString()]); return 'R_GT';
break;
case 14: Tokens.push(['reservada', yy_.yytext, (yy_.yylineno + 1).toString()]); return 'R_GE';
break;
case 15: Tokens.push(['reservada', yy_.yytext, (yy_.yylineno + 1).toString()]); return 44;
break;
case 16: Tokens.push(['reservada', yy_.yytext, (yy_.yylineno + 1).toString()]); return 49;
break;
case 17: Tokens.push(['reservada', yy_.yytext, (yy_.yylineno + 1).toString()]); return 46;
break;
case 18: Tokens.push(['reservada', yy_.yytext, (yy_.yylineno + 1).toString()]); return 47;
break;
case 19: Tokens.push(['reservada', yy_.yytext, (yy_.yylineno + 1).toString()]); return 48;
break;
case 20: Tokens.push(['reservada', yy_.yytext, (yy_.yylineno + 1).toString()]); return 50;
break;
case 21: Tokens.push(['reservada', yy_.yytext, (yy_.yylineno + 1).toString()]); return 52;
break;
case 22: Tokens.push(['reservada', yy_.yytext, (yy_.yylineno + 1).toString()]); return 51;
break;
case 23: Tokens.push(['reservada', yy_.yytext, (yy_.yylineno + 1).toString()]); return 56;
break;
case 24: Tokens.push(['reservada', yy_.yytext, (yy_.yylineno + 1).toString()]); return 60;
break;
case 25: Tokens.push(['reservada', yy_.yytext, (yy_.yylineno + 1).toString()]); return 57;
break;
case 26: Tokens.push(['reservada', yy_.yytext, (yy_.yylineno + 1).toString()]); return 58;
break;
case 27: Tokens.push(['reservada', yy_.yytext, (yy_.yylineno + 1).toString()]); return 59;
break;
case 28: Tokens.push(['paren. a.', yy_.yytext, (yy_.yylineno + 1).toString()]); return 76;
break;
case 29: Tokens.push(['paren. c.', yy_.yytext, (yy_.yylineno + 1).toString()]); return 77;
break;
case 30: Tokens.push(['corch. a.', yy_.yytext, (yy_.yylineno + 1).toString()]); return 39;
break;
case 31: Tokens.push(['corch. c.', yy_.yytext, (yy_.yylineno + 1).toString()]); return 40;
break;
case 32: Tokens.push(['menor igual', yy_.yytext, (yy_.yylineno + 1).toString()]); return 15;
break;
case 33: Tokens.push(['mayor igual', yy_.yytext, (yy_.yylineno + 1).toString()]); return 17;
break;
case 34: Tokens.push(['menor', yy_.yytext, (yy_.yylineno + 1).toString()]); return 14;
break;
case 35: Tokens.push(['mayor', yy_.yytext, (yy_.yylineno + 1).toString()]); return 16;
break;
case 36: Tokens.push(['igual', yy_.yytext, (yy_.yylineno + 1).toString()]); return 12;
break;
case 37: Tokens.push(['distinto', yy_.yytext, (yy_.yylineno + 1).toString()]); return 13;
break;
case 38: Tokens.push(['acceso', yy_.yytext, (yy_.yylineno + 1).toString()]); return 45;
break;
case 39: Tokens.push(['acceso', yy_.yytext, (yy_.yylineno + 1).toString()]); return 69;
break;
case 40: Tokens.push(['arroba', yy_.yytext, (yy_.yylineno + 1).toString()]); return 53;
break;
case 41: Tokens.push(['doble_punto', yy_.yytext, (yy_.yylineno + 1).toString()]); return 61;
break;
case 42: Tokens.push(['punto', yy_.yytext, (yy_.yylineno + 1).toString()]); return 'PUNTO';
break;
case 43: Tokens.push(['union', yy_.yytext, (yy_.yylineno + 1).toString()]); return 26;
break;
case 44: Tokens.push(['multi', yy_.yytext, (yy_.yylineno + 1).toString()]); return 22;
break;
case 45: Tokens.push(['doble barra', yy_.yytext, (yy_.yylineno + 1).toString()]); return 29;
break;
case 46: Tokens.push(['barra', yy_.yytext, (yy_.yylineno + 1).toString()]); return 31;
break;
case 47: Tokens.push(['menos', yy_.yytext, (yy_.yylineno + 1).toString()]); return 19;
break;
case 48: Tokens.push(['mas', yy_.yytext, (yy_.yylineno + 1).toString()]); return 20;
break;
case 49: Tokens.push(['cadena', yy_.yytext, (yy_.yylineno + 1).toString()]); return 85;
break;
case 50: Tokens.push(['caracter', yy_.yytext, (yy_.yylineno + 1).toString()]); return 'CARACTER';
break;
case 51: Tokens.push(['decimal', yy_.yytext, (yy_.yylineno + 1).toString()]); return 87;
break;
case 52: Tokens.push(['entero', yy_.yytext, (yy_.yylineno + 1).toString()]); return 86;
break;
case 53: Tokens.push(['identificador', yy_.yytext, (yy_.yylineno + 1).toString()]); return 70;
break;
case 54:return 5;
break;
}
},
rules: [/^(?:\s+)/i,/^(?:text\b)/i,/^(?:node\b)/i,/^(?:last\b)/i,/^(?:position\b)/i,/^(?:or\b)/i,/^(?:and\b)/i,/^(?:div\b)/i,/^(?:mod\b)/i,/^(?:eq\b)/i,/^(?:ne\b)/i,/^(?:lt\b)/i,/^(?:le\b)/i,/^(?:gt\b)/i,/^(?:ge\b)/i,/^(?:child\b)/i,/^(?:descendant-or-self\b)/i,/^(?:descendant\b)/i,/^(?:attribute\b)/i,/^(?:self\b)/i,/^(?:following-sibling\b)/i,/^(?:namespace\b)/i,/^(?:following\b)/i,/^(?:parent\b)/i,/^(?:ancestor-or-self\b)/i,/^(?:ancestor\b)/i,/^(?:preceding-sibling\b)/i,/^(?:preceding\b)/i,/^(?:\()/i,/^(?:\))/i,/^(?:\[)/i,/^(?:\])/i,/^(?:<=)/i,/^(?:>=)/i,/^(?:<)/i,/^(?:>)/i,/^(?:=)/i,/^(?:!=)/i,/^(?:::)/i,/^(?::)/i,/^(?:@)/i,/^(?:\.\.)/i,/^(?:\.)/i,/^(?:\|)/i,/^(?:\*)/i,/^(?:\/\/)/i,/^(?:\/)/i,/^(?:-)/i,/^(?:\+)/i,/^(?:("[^"]*"))/i,/^(?:[\'][^\'\n][\'])/i,/^(?:[0-9]+(\.[0-9]+))/i,/^(?:[0-9]+)/i,/^(?:[A-Za-z][A-Za-z0-9_]*)/i,/^(?:$)/i],
conditions: {"INITIAL":{"rules":[0,1,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,52,53,54],"inclusive":true}}
});
return lexer;
})();
parser.lexer = lexer;
function Parser () {
this.yy = {};
}
Parser.prototype = parser;parser.Parser = Parser;
return new Parser;
})();
if (typeof require !== 'undefined' && typeof exports !== 'undefined') {
exports.parser = xpathAsc;
exports.Parser = xpathAsc.Parser;
exports.parse = function () { return xpathAsc.parse.apply(xpathAsc, arguments); };
exports.main = function commonjsMain (args) {
if (!args[1]) {
console.log('Usage: '+args[0]+' FILE');
process.exit(1);
}
var source = require('fs').readFileSync(require('path').normalize(args[1]), "utf8");
return exports.parser.parse(source);
};
if (typeof module !== 'undefined' && require.main === module) {
exports.main(process.argv.slice(1));
}
} | 53.619977 | 8,731 | 0.528103 |
a78d87a6fc3d4f655791c1cd44493812a76dbde0 | 5,204 | js | JavaScript | config/environment.js | rameshaggarwal/ui | 43929238f78bde06017d21f7b5ced6e4e8db6645 | [
"Apache-2.0"
] | 1 | 2020-04-21T00:32:14.000Z | 2020-04-21T00:32:14.000Z | config/environment.js | rameshaggarwal/ui | 43929238f78bde06017d21f7b5ced6e4e8db6645 | [
"Apache-2.0"
] | null | null | null | config/environment.js | rameshaggarwal/ui | 43929238f78bde06017d21f7b5ced6e4e8db6645 | [
"Apache-2.0"
] | null | null | null | /* eslint-env node */
var pkg = require('../package.json');
var fs = require('fs');
var YAML = require('yamljs');
// host can be an ip "1.2.3.4" -> https://1.2.3.4:30443
// or a URL+port
function normalizeHost(host,defaultPort) {
if ( host.indexOf('http') === 0 ) {
return host;
}
if ( host.indexOf(':') === -1 ) {
host = 'https://' + host + (defaultPort ? ':'+defaultPort : '');
} else {
host = 'https://' + host;
}
return host;
}
function readLocales(environment) {
/* Parse the translations from the translations folder*/
/* ember intl getLocalesByTranslations does not work if intl is not managing them (bundled) */
/* This needs a little work to read the yaml files for the langugae name prop*/
var files = fs.readdirSync('./translations');
var translationsOut = {};
files.forEach(function(filename) {
if ( !filename.match(/\.ya?ml$/) && !filename.match(/\.json$/) ) {
// Ignore non-YAML files
return;
}
if ( environment === 'production' && filename === 'none.yaml' ) {
// Don't show the "None" language in prod
return;
}
var ymlFile = YAML.load('./translations/' + filename);
var label = ymlFile.languageName;
var locale = filename.split('.')[0];
translationsOut[locale] = label;
});
return translationsOut;
}
module.exports = function(environment) {
var ENV = {
modulePrefix: 'ui',
environment: environment,
exportApplicationGlobal: true,
locationType: 'auto',
EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. EMBER_NATIVE_DECORATOR_SUPPORT: true
},
EXTEND_PROTOTYPES: {
// Prevent Ember Data from overriding Date.parse.
Date: false
}
},
minifyCSS: {
enabled: false
},
minifyJS: {
enabled: false
},
contentSecurityPolicy: {
// Allow the occasional <elem style="blah">...
'style-src': "'self' releases.rancher.com localhost:8000 'unsafe-inline'",
'font-src': "'self' releases.rancher.com",
'script-src': "'self' releases.rancher.com localhost:8000",
'object-src': "'self' releases.rancher.com",
'img-src': "'self' releases.rancher.com avatars.githubusercontent.com gravatar.com localhost:8000 data:",
'frame-src': "'self' releases.rancher.com",
// Allow connect to anywhere, for console and event stream socket
'connect-src': '*',
'unsafe-eval': "'self' releases.rancher.com"
},
APP: {
// Here you can pass flags/options to your application instance
// when it is created
version: pkg.version,
appName: 'DeltaDevOps',
environment: environment,
baseAssets: '/',
clusterToken: '%CLUSTERID%',
projectToken: '%PROJECTID%',
apiServer: 'https://localhost:543',
apiEndpoint: '/v3',
publicApiEndpoint: '/v3-public',
clusterEndpoint: '/v3/clusters/%CLUSTERID%',
projectEndpoint: '/v3/projects/%PROJECTID%',
proxyEndpoint: '/meta/proxy',
globalSubscribeEndpoint: '/v3/subscribe',
clusterSubscribeEndpoint: '/v3/clusters/%CLUSTERID%/subscribe',
projectSubscribeEndpoint: '/v3/projects/%PROJECTID%/subscribe',
magicEndpoint: '/r',
telemetryEndpoint: '/v1-telemetry',
kubernetesBase: '/k8s',
kubectlEndpoint: '/r/projects/%PROJECTID%/kubectld:8091/v1-kubectl',
kubernetesDashboard: '/k8s/clusters/%CLUSTERID%/api/v1/namespaces/kube-system/services/kubernetes-dashboard/proxy/',
needIntlPolyfill: false,
locales: readLocales(environment),
stripe: {
publishableKey: 'pk_test_g925RcuVORh2KgHWfFbE80by'
},
},
};
if (environment === 'development') {
// ENV.APP.LOG_RESOLVER = true;
// ENV.APP.LOG_ACTIVE_GENERATION = true;
ENV.APP.LOG_TRANSITIONS = true;
ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
ENV.APP.LOG_VIEW_LOOKUPS = true;
}
if (environment === 'test') {
// Testem prefers this...
ENV.locationType = 'none';
// keep test console output quieter
ENV.APP.LOG_ACTIVE_GENERATION = false;
ENV.APP.LOG_VIEW_LOOKUPS = false;
ENV.APP.rootElement = '#ember-testing';
ENV.APP.autoboot = false;
}
if (process.env.FINGERPRINT) {
ENV.APP.fingerprint = process.env.FINGERPRINT;
}
if (process.env.BASE_ASSETS) {
ENV.APP.baseAssets = process.env.BASE_ASSETS;
}
// Override the Rancher server/endpoint with environment var
var server = process.env.RANCHER;
if ( server )
{
ENV.APP.apiServer = normalizeHost(server,443);
}
else if (environment === 'production')
{
ENV.APP.apiServer = '';
}
var pl = process.env.PL;
if ( pl )
{
ENV.APP.pl = pl;
}
else
{
ENV.APP.pl = 'rancher';
}
return ENV;
};
// host can be an ip "1.2.3.4" -> https://1.2.3.4:30443
// or a URL+port
function normalizeHost(host, defaultPort) {
if ( host.indexOf('http') === 0 ) {
return host;
}
if ( host.indexOf(':') >= 0 || defaultPort === 443 ) {
host = `https://${ host }`;
} else {
host = `https://${ host }${ defaultPort ? `:${ defaultPort }` : '' }`;
}
return host;
}
| 27.680851 | 122 | 0.6201 |
a78d949dadccfaf7b8d2d3b9b4718235177c2c3a | 126 | js | JavaScript | 3.2.0/categories/Pi-symbols.js | mathiasbynens/unicode-data | 68cadd44a5b5078075ff54b6d07f2355bea4c933 | [
"MIT"
] | 25 | 2015-01-19T19:29:26.000Z | 2021-01-28T09:18:19.000Z | 3.2.0/categories/Pi-symbols.js | mathiasbynens/unicode-data | 68cadd44a5b5078075ff54b6d07f2355bea4c933 | [
"MIT"
] | 3 | 2015-08-21T14:50:31.000Z | 2017-12-08T21:33:29.000Z | 3.2.0/categories/Pi-symbols.js | mathiasbynens/unicode-data | 68cadd44a5b5078075ff54b6d07f2355bea4c933 | [
"MIT"
] | 3 | 2017-12-07T21:45:19.000Z | 2021-05-06T20:53:51.000Z | // All symbols in the `Pi` category as per Unicode v3.2.0:
[
'\xAB',
'\u2018',
'\u201B',
'\u201C',
'\u201F',
'\u2039'
]; | 14 | 58 | 0.547619 |
a78e026621f38c62b60e70ade49e513997bb3f83 | 70,285 | js | JavaScript | build/game.js | heyitsmdr/mysaas | b488929e5ebfa430508180e8df03901073b8ed10 | [
"MIT"
] | 2 | 2020-01-20T09:31:23.000Z | 2021-11-19T13:26:05.000Z | build/game.js | heyitsmdr/mysaas | b488929e5ebfa430508180e8df03901073b8ed10 | [
"MIT"
] | null | null | null | build/game.js | heyitsmdr/mysaas | b488929e5ebfa430508180e8df03901073b8ed10 | [
"MIT"
] | 1 | 2018-11-17T03:50:46.000Z | 2018-11-17T03:50:46.000Z | var __extends = (this && this.__extends) || (function () {
var 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 function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
System.register("managers/BaseManager", [], function (exports_1, context_1) {
"use strict";
var __moduleName = context_1 && context_1.id;
var BaseManager;
return {
setters: [],
execute: function () {
BaseManager = /** @class */ (function () {
function BaseManager(game) {
this.game = game;
}
return BaseManager;
}());
exports_1("default", BaseManager);
}
};
});
System.register("BaseObject", [], function (exports_2, context_2) {
"use strict";
var __moduleName = context_2 && context_2.id;
var BaseObject;
return {
setters: [],
execute: function () {
BaseObject = /** @class */ (function () {
function BaseObject(game) {
this.game = game;
}
return BaseObject;
}());
exports_2("default", BaseObject);
}
};
});
System.register("interfaces/ISavedGame", [], function (exports_3, context_3) {
"use strict";
var __moduleName = context_3 && context_3.id;
return {
setters: [],
execute: function () {
}
};
});
System.register("Server", ["BaseObject", "VM"], function (exports_4, context_4) {
"use strict";
var __moduleName = context_4 && context_4.id;
var BaseObject_1, VM_1, MAX_CPU, MAX_MEM, MAX_STORAGE, Server;
return {
setters: [
function (BaseObject_1_1) {
BaseObject_1 = BaseObject_1_1;
},
function (VM_1_1) {
VM_1 = VM_1_1;
}
],
execute: function () {
MAX_CPU = 8; // Core count
MAX_MEM = 32; // GB
MAX_STORAGE = 100; // GB
Server = /** @class */ (function (_super) {
__extends(Server, _super);
function Server(game) {
var _this = _super.call(this, game) || this;
_this.vms = [];
// Saved
_this.name = 'server00';
_this.name = _this.game.infraManager.getNextServerName();
return _this;
}
Server.prototype.save = function () {
return {
name: this.name,
vms: this.vms.map(function (vm) { return vm.save(); })
};
};
Server.prototype.load = function (savedServer) {
var _this = this;
this.name = savedServer.name;
savedServer.vms.forEach(function (savedVm) {
var vm = _this.createVM(savedVm.cpus, savedVm.memory, savedVm.storage, savedVm.type);
vm.load(savedVm);
});
};
Server.prototype.createVM = function (cpus, memory, storage, type) {
if ((this.getAllocatedCpus() + cpus) > MAX_CPU) {
return null;
}
else if ((this.getAllocatedMemory() + memory) > MAX_MEM) {
return null;
}
else if ((this.getAllocatedStorage() + storage) > MAX_STORAGE) {
return null;
}
var vm = new VM_1["default"](this.game, this);
this.vms.push(vm);
vm.setResourceLimits(cpus, memory, storage);
vm.setType(type);
this.game.infraManager.updateVMCount();
this.game.infraManager.updateResourceCount();
this.game.infraManager.renderInfrastructureView();
return vm;
};
Server.prototype.modifyVM = function (vm, cpus, memory, storage) {
var newAllocatedCpus = (this.getAllocatedCpus() - vm.getAllocatedCpus()) + cpus;
var newAllocatedMemory = (this.getAllocatedMemory() - vm.getAllocatedMemory()) + memory;
var newAllocatedStorage = (this.getAllocatedStorage() - vm.getAllocatedStorage()) + storage;
if (newAllocatedCpus > MAX_CPU || newAllocatedMemory > MAX_MEM || newAllocatedStorage > MAX_STORAGE) {
return false;
}
vm.setResourceLimits(cpus, memory, storage);
this.game.infraManager.updateResourceCount();
this.game.infraManager.renderInfrastructureView();
return true;
};
Server.prototype.getVMs = function () {
return this.vms;
};
Server.prototype.getAllocatedCpus = function () {
var cpus = 0;
this.vms.forEach(function (vm) { return cpus += vm.getAllocatedCpus(); });
return cpus;
};
Server.prototype.getAllocatedMemory = function () {
var memory = 0;
this.vms.forEach(function (vm) { return memory += vm.getAllocatedMemory(); });
return memory;
};
Server.prototype.getAllocatedStorage = function () {
var storage = 0;
this.vms.forEach(function (vm) { return storage += vm.getAllocatedStorage(); });
return storage;
};
Server.prototype.getCpuUsage = function () {
return this.getAllocatedCpus() + "/" + MAX_CPU;
};
Server.prototype.getMemoryUsage = function () {
return this.getAllocatedMemory() + "GB/" + MAX_MEM + "GB";
};
Server.prototype.getStorageUsage = function () {
return this.getAllocatedStorage() + "GB/" + MAX_STORAGE + "GB";
};
Server.prototype.getName = function () {
return this.name;
};
Server.prototype.destroyVm = function (vmName) {
var originalVmCount = this.vms.length;
this.vms = this.vms.filter(function (vm) {
return !(vm.getName() === vmName);
});
if (this.vms.length !== originalVmCount) {
this.game.infraManager.updateVMCount();
this.game.infraManager.updateResourceCount();
this.game.infraManager.renderInfrastructureView();
return true;
}
return false;
};
return Server;
}(BaseObject_1["default"]));
exports_4("default", Server);
}
};
});
System.register("VM", ["BaseObject"], function (exports_5, context_5) {
"use strict";
var __moduleName = context_5 && context_5.id;
var BaseObject_2, VM_TYPES, VM;
return {
setters: [
function (BaseObject_2_1) {
BaseObject_2 = BaseObject_2_1;
}
],
execute: function () {
(function (VM_TYPES) {
VM_TYPES[VM_TYPES["WEB_MONOLITH"] = 0] = "WEB_MONOLITH";
VM_TYPES[VM_TYPES["CDN"] = 1] = "CDN";
})(VM_TYPES || (VM_TYPES = {}));
VM = /** @class */ (function (_super) {
__extends(VM, _super);
function VM(game, server) {
var _this = _super.call(this, game) || this;
_this.cpus = 0;
_this.memory = 0;
_this.storage = 0;
_this.type = VM_TYPES.WEB_MONOLITH;
_this.poweredOn = false;
_this.poweredOnAt = 0;
_this.startingLoad = 0.0;
_this.startingMemory = 0.0;
_this.startingStorage = 0.0;
_this.currentLoad = 0.0;
_this.currentMemory = 0.0;
_this.currentStorage = 0.0;
_this.decreaseResourceInterval = 80;
_this.lastSshLogin = 0;
_this.server = server;
return _this;
}
VM.getShortType = function (vmType) {
switch (vmType) {
case VM_TYPES.WEB_MONOLITH:
return 'web';
default:
return 'unknown';
}
};
VM.prototype.save = function () {
return {
name: this.name,
cpus: this.cpus,
memory: this.memory,
storage: this.storage,
type: this.type,
poweredOn: this.poweredOn,
poweredOnAt: this.poweredOnAt,
startingLoad: this.startingLoad,
startingMemory: this.startingMemory,
startingStorage: this.startingStorage,
currentLoad: this.currentLoad,
currentMemory: this.currentMemory,
currentStorage: this.currentStorage,
decreaseResourceInterval: this.decreaseResourceInterval,
lastSshLogin: this.lastSshLogin
};
};
VM.prototype.load = function (savedVm) {
this.name = savedVm.name;
this.decreaseResourceInterval = savedVm.decreaseResourceInterval;
this.lastSshLogin = savedVm.lastSshLogin;
// cpus, memory, storage and type are all set already via setResourceLimits
this.setPoweredOn(savedVm.poweredOn);
// starting + current load, memory and cpu are all set above via setPoweredOn
// however, we want to override current stats with what was saved
this.poweredOnAt = savedVm.poweredOnAt;
this.currentLoad = savedVm.currentLoad;
this.currentMemory = savedVm.currentMemory;
this.currentStorage = savedVm.currentStorage;
};
VM.prototype.getServer = function () {
return this.server;
};
VM.prototype.setResourceLimits = function (cpus, memory, storage) {
this.cpus = cpus;
this.memory = memory;
this.storage = storage;
};
VM.prototype.getAllocatedCpus = function () {
return this.cpus;
};
VM.prototype.getAllocatedMemory = function () {
return this.memory;
};
VM.prototype.getAllocatedStorage = function () {
return this.storage;
};
VM.prototype.setType = function (vmType) {
this.type = vmType;
this.name = this.game.infraManager.getNextVmName(vmType);
};
VM.prototype.getType = function () {
return this.type;
};
VM.prototype.getName = function () {
return this.name;
};
VM.prototype.getShortType = function () {
return VM.getShortType(this.type);
};
VM.prototype.setPoweredOn = function (powerOn) {
this.poweredOn = powerOn;
if (powerOn === true) {
this.startingLoad = this.currentLoad = 0.1;
this.startingMemory = this.currentMemory = 0.2;
if (this.currentStorage === 0) {
this.startingStorage = this.currentStorage = 0.1;
}
this.poweredOnAt = Date.now();
this.lowerResourcesTimer = setInterval(this.lowerResourceUsage.bind(this), this.decreaseResourceInterval);
}
else {
this.currentLoad = 0;
this.currentMemory = 0;
clearInterval(this.lowerResourcesTimer);
this.lowerResourcesTimer = null;
}
this.game.infraManager.renderInfrastructureView();
};
VM.prototype.getPoweredOn = function () {
return this.poweredOn;
};
VM.prototype.getCurrentLoad = function () {
return this.currentLoad;
};
VM.prototype.getCurrentMemory = function () {
return this.currentMemory;
};
VM.prototype.getCurrentStorage = function () {
return this.currentStorage;
};
VM.prototype.canHandle = function (route) {
if (this.currentLoad > this.cpus) {
return false;
}
else if (this.currentMemory > this.memory) {
return false;
}
else if (this.currentStorage > this.storage) {
return false;
}
switch (this.type) {
case VM_TYPES.WEB_MONOLITH:
return route.match(/.*/) !== null;
}
};
VM.prototype.handleRequest = function (methodName, route) {
if (this.canHandle(route) === false) {
return false;
}
this.currentLoad += 0.1;
this.currentMemory += 0.05;
this.currentStorage += 0.01;
return true;
};
VM.prototype.updateSshLoginTime = function () {
this.lastSshLogin = Date.now();
};
VM.prototype.getLastSshLogin = function () {
if (this.lastSshLogin > 0) {
return new Date(this.lastSshLogin).toString();
}
return 'Never';
};
VM.prototype.getUptime = function () {
if (this.getPoweredOn() === false) {
return 'Uptime: 0s';
}
var uptimeMs = Date.now() - this.poweredOnAt;
var uptimeSecs = uptimeMs / 1000;
return "Uptime: " + uptimeSecs + " seconds";
};
VM.prototype.resetStorage = function () {
this.currentStorage = this.startingStorage;
this.game.infraManager.renderInfrastructureView();
return this.currentStorage;
};
VM.prototype.lowerResourceUsage = function () {
if (this.currentLoad > this.startingLoad) {
this.currentLoad -= (0.01 * this.currentLoad);
this.game.infraManager.renderInfrastructureView();
}
if (this.currentMemory > this.startingMemory) {
this.currentMemory -= (0.01 * this.currentMemory);
this.game.infraManager.renderInfrastructureView();
}
};
return VM;
}(BaseObject_2["default"]));
exports_5("default", VM);
}
};
});
System.register("managers/EventManager", ["managers/BaseManager"], function (exports_6, context_6) {
"use strict";
var __moduleName = context_6 && context_6.id;
var BaseManager_1, EventManager;
return {
setters: [
function (BaseManager_1_1) {
BaseManager_1 = BaseManager_1_1;
}
],
execute: function () {
EventManager = /** @class */ (function (_super) {
__extends(EventManager, _super);
function EventManager() {
return _super !== null && _super.apply(this, arguments) || this;
}
EventManager.prototype.emit = function (eventName, eventParameter) {
if (eventParameter === void 0) { eventParameter = ''; }
console.log("[emit] " + eventName + " [" + eventParameter + "]");
switch (eventName) {
case 'switch_view':
this.handleSwitchView(eventParameter);
break;
case 'visit_website':
this.handleVisitWebsite();
break;
case 'toggle_vm_power':
this.handleToggleVmPower(eventParameter);
break;
case 'delete_vm':
this.handleDeleteVm(eventParameter);
break;
case 'create_vm':
this.handleCreateVm(eventParameter);
break;
case 'edit_vm':
this.handleEditVm(eventParameter);
break;
case 'ssh_vm':
this.handleSshVm(eventParameter);
break;
case 'close_ssh':
this.handleCloseSsh();
break;
case 'vm_delete_logs':
this.handleDeleteVmLogs(eventParameter);
break;
case 'shop_purchase':
this.handleShopPurchase(eventParameter);
break;
default:
console.log('Invalid event emitted', eventName, eventParameter);
}
};
EventManager.prototype.handleSwitchView = function (viewName) {
// Reset
var gameViewDivs = document.querySelectorAll('.game-view');
for (var i = 0; i < gameViewDivs.length; i++) {
gameViewDivs[i].classList.add('hidden');
}
var viewLinkSpans = document.querySelectorAll('.view-links');
for (var i = 0; i < viewLinkSpans.length; i++) {
viewLinkSpans[i].classList.remove('selected');
}
switch (viewName) {
case 'infra':
document.querySelector('.game .infrastructure').classList.remove('hidden');
document.querySelector('#view-link-infra').classList.add('selected');
document.querySelector('#view-name').innerHTML = '<i class="fas fa-server"></i>Your Infrastructure';
this.game.infraManager.renderInfrastructureView();
break;
case 'dc':
document.querySelector('.game .dc').classList.remove('hidden');
document.querySelector('#view-link-dc').classList.add('selected');
document.querySelector('#view-name').innerHTML = '<i class="fas fa-building"></i>Your DataCenters';
break;
case 'bank':
document.querySelector('.game .bank').classList.remove('hidden');
document.querySelector('#view-link-bank').classList.add('selected');
document.querySelector('#view-name').innerHTML = '<i class="fas fa-piggy-bank"></i>The Bank';
break;
case 'shop':
document.querySelector('.game .shop').classList.remove('hidden');
document.querySelector('#view-link-shop').classList.add('selected');
document.querySelector('#view-name').innerHTML = '<i class="fas fa-shopping-bag"></i>The Shop';
this.game.shopManager.renderShopView();
break;
case 'ssh':
document.querySelector('.game .ssh').classList.remove('hidden');
break;
}
};
EventManager.prototype.handleVisitWebsite = function () {
this.game.trafficManager.generateHit();
};
EventManager.prototype.handleToggleVmPower = function (vmName) {
var dcs = this.game.infraManager.getDataCenters();
for (var dci = 0; dci < dcs.length; dci++) {
var vms = dcs[dci].getAllVMs();
for (var vmi = 0; vmi < vms.length; vmi++) {
if (vms[vmi].getName() === vmName) {
vms[vmi].setPoweredOn(!vms[vmi].getPoweredOn());
break;
}
}
}
this.game.infraManager.renderInfrastructureView();
};
EventManager.prototype.handleDeleteVm = function (vmName) {
var dcs = this.game.infraManager.getDataCenters();
for (var dci = 0; dci < dcs.length; dci++) {
var vms = dcs[dci].getAllVMs();
for (var vmi = 0; vmi < vms.length; vmi++) {
if (vms[vmi].getName() === vmName) {
var server = vms[vmi].getServer();
server.destroyVm(vmName);
}
}
}
};
EventManager.prototype.handleCreateVm = function (serverName) {
var vmType = prompt('What type of VM do you want to provision?\n\nValid choies:\n - web');
if (!vmType) {
return;
}
var dcs = this.game.infraManager.getDataCenters();
for (var dci = 0; dci < dcs.length; dci++) {
var servers = dcs[dci].getAllServers();
for (var si = 0; si < servers.length; si++) {
if (servers[si].getName() === serverName) {
switch (vmType.toLowerCase()) {
case 'web':
servers[si].createVM(1, 1, 10, 0);
break;
default:
alert('You have entered an invalid type. Nothing was created.');
return;
}
break;
}
}
}
};
EventManager.prototype.handleEditVm = function (vmName) {
var dcs = this.game.infraManager.getDataCenters();
for (var dci = 0; dci < dcs.length; dci++) {
var vms = dcs[dci].getAllVMs();
for (var vmi = 0; vmi < vms.length; vmi++) {
if (vms[vmi].getName() === vmName) {
var vm = vms[vmi];
if (vm.getPoweredOn() === true) {
alert('You cannot edit a VM that is powered on.');
return;
}
var editResource = prompt('Which resource would?>i you like to edit?\n\nValid choices:\n - cpu\n - memory\n - storage');
if (!editResource) {
return;
}
switch (editResource.toLowerCase()) {
case 'cpu':
var newCpu = prompt("What would you like to set the CPU cores to?\n\nCurrently Allocated: " + vm.getAllocatedCpus());
var newCpuNumber = Number(newCpu);
if (newCpuNumber > 0) {
var success = vm.getServer().modifyVM(vm, newCpuNumber, vm.getAllocatedMemory(), vm.getAllocatedStorage());
if (!success) {
alert('The re-allocation of cpu was unsuccessful. Nothing was modified.');
}
}
break;
case 'memory':
var newMemory = prompt("What would you like to set the Memory (in GB) to?\n\nCurrently Allocated: " + vm.getAllocatedMemory() + "GB");
var newMemoryNumber = Number(newMemory.toLowerCase().replace('gb', ''));
if (newMemoryNumber > 0) {
var success = vm.getServer().modifyVM(vm, vm.getAllocatedCpus(), newMemoryNumber, vm.getAllocatedStorage());
if (!success) {
alert('The re-allocation of memory was unsuccessful. Nothing was modified.');
}
}
break;
case 'storage':
var newStorage = prompt("What would you like to set the Storage (in GB) to?\n\nCurrently Allocated: " + vm.getAllocatedStorage() + "GB");
var newStorageNumber = Number(newStorage.toLowerCase().replace('gb', ''));
if (newStorageNumber > 0) {
var success = vm.getServer().modifyVM(vm, vm.getAllocatedCpus(), vm.getAllocatedStorage(), newStorageNumber);
if (!success) {
alert('The re-allocation of storage was unsuccessful. Nothing was modified.');
}
}
break;
default:
alert('You have entered an invalid resource type. Nothing was modified.');
}
}
}
}
};
EventManager.prototype.handleSshVm = function (vmName) {
var dcs = this.game.infraManager.getDataCenters();
for (var dci = 0; dci < dcs.length; dci++) {
var vms = dcs[dci].getAllVMs();
for (var vmi = 0; vmi < vms.length; vmi++) {
if (vms[vmi].getName() === vmName) {
var vm = vms[vmi];
this.handleSwitchView('ssh');
document.querySelector('#view-name').innerHTML = "<i class=\"fas fa-terminal\"></i>SSH: " + vmName;
document.querySelector('.game .ssh .last-login').innerHTML = "Last login: " + vm.getLastSshLogin();
document.querySelector('.game .ssh .uptime').innerHTML = "<br>Uptime is " + vm.getUptime();
var actionsContainerHtml = '';
actionsContainerHtml += "<div class=\"action\" onclick=\"Game.eventManager.emit('vm_delete_logs', '" + vm.getName() + "')\">Delete Logs</div>";
actionsContainerHtml += "<div class=\"action\" onclick=\"Game.eventManager.emit('close_ssh')\">Exit</div>";
document.querySelector('.game .ssh .actions .container').innerHTML = actionsContainerHtml;
vm.updateSshLoginTime();
}
}
}
};
EventManager.prototype.handleCloseSsh = function () {
this.handleSwitchView('infra');
};
EventManager.prototype.handleDeleteVmLogs = function (vmName) {
var dcs = this.game.infraManager.getDataCenters();
for (var dci = 0; dci < dcs.length; dci++) {
var vms = dcs[dci].getAllVMs();
for (var vmi = 0; vmi < vms.length; vmi++) {
if (vms[vmi].getName() === vmName) {
var vm = vms[vmi];
var newStorage = vm.resetStorage();
}
}
}
};
EventManager.prototype.handleShopPurchase = function (itemName) {
var item = this.game.shopManager.getItem(itemName);
if (!item) {
return;
}
else if (item.isPurchased() === true) {
return;
}
else if (item.canAfford() === false) {
alert('You cannot afford that shop item.');
return;
}
else if (item.hasRequirements() === false) {
alert('You do not meet the minimum requirements to purchase that shop item.');
return;
}
var cost = item.getCost();
this.game.takeMoney(cost);
item.activateEffects();
item.setAsPurchased();
this.game.shopManager.renderShopView();
};
return EventManager;
}(BaseManager_1["default"]));
exports_6("default", EventManager);
}
};
});
System.register("Rack", ["BaseObject", "Server"], function (exports_7, context_7) {
"use strict";
var __moduleName = context_7 && context_7.id;
var BaseObject_3, Server_1, Rack;
return {
setters: [
function (BaseObject_3_1) {
BaseObject_3 = BaseObject_3_1;
},
function (Server_1_1) {
Server_1 = Server_1_1;
}
],
execute: function () {
Rack = /** @class */ (function (_super) {
__extends(Rack, _super);
function Rack() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.servers = [];
return _this;
}
Rack.prototype.save = function () {
return {
servers: this.servers.map(function (server) { return server.save(); })
};
};
Rack.prototype.load = function (savedRack) {
var _this = this;
savedRack.servers.forEach(function (savedServer) {
var server = _this.addServer();
server.load(savedServer);
});
};
Rack.prototype.addServer = function () {
var server = new Server_1["default"](this.game);
this.servers.push(server);
this.game.infraManager.updateServerCount();
this.game.infraManager.renderInfrastructureView();
return server;
};
Rack.prototype.getServers = function () {
return this.servers;
};
return Rack;
}(BaseObject_3["default"]));
exports_7("default", Rack);
}
};
});
System.register("DataCenter", ["BaseObject", "Rack"], function (exports_8, context_8) {
"use strict";
var __moduleName = context_8 && context_8.id;
var BaseObject_4, Rack_1, DataCenter;
return {
setters: [
function (BaseObject_4_1) {
BaseObject_4 = BaseObject_4_1;
},
function (Rack_1_1) {
Rack_1 = Rack_1_1;
}
],
execute: function () {
DataCenter = /** @class */ (function (_super) {
__extends(DataCenter, _super);
function DataCenter() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.racks = [];
return _this;
}
DataCenter.prototype.save = function () {
return {
racks: this.racks.map(function (rack) { return rack.save(); })
};
};
DataCenter.prototype.load = function (savedDc) {
var _this = this;
savedDc.racks.forEach(function (savedRack) {
var rack = _this.addRack();
rack.load(savedRack);
});
};
DataCenter.prototype.addRack = function () {
var rack = new Rack_1["default"](this.game);
this.racks.push(rack);
this.game.infraManager.updateRackCount();
return rack;
};
DataCenter.prototype.getRacks = function () {
return this.racks;
};
DataCenter.prototype.getAllServers = function () {
var servers = [];
this.racks.forEach(function (rack) {
rack.getServers().forEach(function (server) { return servers.push(server); });
});
return servers;
};
DataCenter.prototype.getAllVMs = function () {
var vms = [];
this.racks.forEach(function (rack) {
rack.getServers().forEach(function (server) {
server.getVMs().forEach(function (vm) { return vms.push(vm); });
});
});
return vms;
};
return DataCenter;
}(BaseObject_4["default"]));
exports_8("default", DataCenter);
}
};
});
System.register("managers/InfraManager", ["managers/BaseManager", "DataCenter", "VM"], function (exports_9, context_9) {
"use strict";
var __moduleName = context_9 && context_9.id;
var BaseManager_2, DataCenter_1, VM_2, InfraManager;
return {
setters: [
function (BaseManager_2_1) {
BaseManager_2 = BaseManager_2_1;
},
function (DataCenter_1_1) {
DataCenter_1 = DataCenter_1_1;
},
function (VM_2_1) {
VM_2 = VM_2_1;
}
],
execute: function () {
InfraManager = /** @class */ (function (_super) {
__extends(InfraManager, _super);
function InfraManager(game) {
var _this = _super.call(this, game) || this;
_this.datacenters = [];
return _this;
}
InfraManager.prototype.save = function () {
return {
datacenters: this.datacenters.map(function (dc) { return dc.save(); })
};
};
InfraManager.prototype.load = function (savedInfra) {
var _this = this;
savedInfra.datacenters.forEach(function (savedDc) {
var dc = _this.addDataCenter();
dc.load(savedDc);
});
this.renderInfrastructureView();
};
InfraManager.prototype.addDataCenter = function () {
var dc = new DataCenter_1["default"](this.game);
this.datacenters.push(dc);
this.updateDataCenterCount();
return dc;
};
InfraManager.prototype.getDataCenters = function () {
return this.datacenters;
};
InfraManager.prototype.updateDataCenterCount = function () {
document.querySelector('#dc-count').innerHTML = this.datacenters.length.toString();
};
InfraManager.prototype.updateRackCount = function () {
var racks = 0;
this.datacenters.forEach(function (dc) { return racks += dc.getRacks().length; });
document.querySelector('#rack-count').innerHTML = racks.toString();
};
InfraManager.prototype.getServerCount = function () {
var servers = 0;
this.datacenters.forEach(function (dc) {
dc.getRacks().forEach(function (rack) {
servers += rack.getServers().length;
});
});
return servers;
};
InfraManager.prototype.updateServerCount = function () {
document.querySelector('#server-count').innerHTML = this.getServerCount().toString();
};
InfraManager.prototype.updateVMCount = function () {
var vms = 0;
this.datacenters.forEach(function (dc) {
dc.getRacks().forEach(function (rack) {
rack.getServers().forEach(function (server) {
vms += server.getVMs().length;
});
});
});
document.querySelector('#vm-count').innerHTML = vms.toString();
};
InfraManager.prototype.updateResourceCount = function () {
var cpus = 0;
var memory = 0;
var storage = 0;
this.datacenters.forEach(function (dc) {
dc.getRacks().forEach(function (rack) {
rack.getServers().forEach(function (server) {
cpus += server.getAllocatedCpus();
memory += server.getAllocatedMemory();
storage += server.getAllocatedStorage();
});
});
});
document.querySelector('#cpu-count').innerHTML = cpus.toString();
document.querySelector('#memory-count').innerHTML = memory.toString() + "GB";
document.querySelector('#storage-count').innerHTML = storage.toString() + "GB";
};
InfraManager.prototype.updateRps = function (successRps, failureRps) {
document.querySelector('#success-rps-count').innerHTML = successRps.toString();
document.querySelector('#failure-rps-count').innerHTML = failureRps.toString();
};
InfraManager.prototype.renderVmStatLine = function (statName, currentVal, maxVal, statSuffix) {
if (statSuffix === void 0) { statSuffix = ''; }
var percentage = (currentVal * 100) / maxVal;
var statColor = 'good-dark';
if (percentage >= 99) {
statColor = 'crit';
}
else if (percentage >= 80) {
statColor = 'warn';
}
var current = parseFloat(currentVal.toString()).toFixed(2);
return "<div class=\"stat " + statColor + "\"><strong>" + statName + "</strong>: " + current + statSuffix + " / " + maxVal + statSuffix + "</div>";
};
InfraManager.prototype.renderInfrastructureView = function () {
var _this = this;
var container = '';
this.datacenters.forEach(function (dc) {
dc.getRacks().forEach(function (rack) {
rack.getServers().forEach(function (server) {
container += "<div class=\"server-name\">" + server.getName();
container += "<span class=\"specs\">[ Cores: " + server.getCpuUsage() + ", Mem: " + server.getMemoryUsage() + ", Storage: " + server.getStorageUsage() + " ]</span></div>";
container += "<div class=\"server\">";
server.getVMs().forEach(function (vm) {
container += "<div class=\"vm\">";
container += "<div class=\"name\">[" + vm.getName() + "]</div>";
container += "<div class=\"stat " + (vm.getPoweredOn() ? 'good' : 'crit') + "\"><strong>" + (vm.getPoweredOn() ? 'ONLINE' : 'OFFLINE') + "</strong></div>";
container += _this.renderVmStatLine('Load', vm.getCurrentLoad(), vm.getAllocatedCpus());
container += _this.renderVmStatLine('Mem', vm.getCurrentMemory(), vm.getAllocatedMemory(), 'GB');
container += _this.renderVmStatLine('Storage', vm.getCurrentStorage(), vm.getAllocatedStorage(), 'GB');
container += "<div class=\"actions\">";
if (vm.getPoweredOn() === false) {
container += "<span class=\"link\" onmousedown=\"Game.eventManager.emit('edit_vm', '" + vm.getName() + "')\">Edit</span> | ";
}
else {
container += "<span class=\"link\" onmousedown=\"Game.eventManager.emit('ssh_vm', '" + vm.getName() + "')\">SSH</span> | ";
}
container += "<span class=\"link\" onmousedown=\"Game.eventManager.emit('toggle_vm_power', '" + vm.getName() + "')\">Power " + (vm.getPoweredOn() ? 'Down' : 'Up') + "</span> | ";
container += "<span class=\"link\" onmousedown=\"Game.eventManager.emit('delete_vm', '" + vm.getName() + "')\">Delete</span>";
container += "</div>";
container += "</div>";
});
container += "<div class=\"vm empty\" onmousedown=\"Game.eventManager.emit('create_vm', '" + server.getName() + "')\">+</div>";
container += "</div>";
});
});
});
document.querySelector('.game .infrastructure .container').innerHTML = container;
};
InfraManager.prototype.getNextServerName = function () {
var serverNames = [];
this.datacenters.forEach(function (dc) {
dc.getRacks().forEach(function (rack) {
rack.getServers().forEach(function (server) { return serverNames.push(server.getName()); });
});
});
for (var i = 1; i <= 99; i++) {
if (serverNames.indexOf('server' + this.zeroPad(i, 2)) === -1) {
return "server" + this.zeroPad(i, 2).toString();
}
}
return null;
};
InfraManager.prototype.getNextVmName = function (vmType) {
var vmNames = [];
this.datacenters.forEach(function (dc) {
dc.getRacks().forEach(function (rack) {
rack.getServers().forEach(function (server) {
server.getVMs().forEach(function (vm) { return vmNames.push(vm.getName()); });
});
});
});
for (var i = 1; i <= 99; i++) {
if (vmNames.indexOf(VM_2["default"].getShortType(vmType) + this.zeroPad(i, 2)) === -1) {
return VM_2["default"].getShortType(vmType) + this.zeroPad(i, 2).toString();
}
}
return null;
};
InfraManager.prototype.zeroPad = function (num, places) {
var zero = places - num.toString().length + 1;
return Array(+(zero > 0 && zero)).join("0") + num;
};
return InfraManager;
}(BaseManager_2["default"]));
exports_9("default", InfraManager);
}
};
});
System.register("managers/TrafficManager", ["managers/BaseManager"], function (exports_10, context_10) {
"use strict";
var __moduleName = context_10 && context_10.id;
var BaseManager_3, TrafficManager;
return {
setters: [
function (BaseManager_3_1) {
BaseManager_3 = BaseManager_3_1;
}
],
execute: function () {
TrafficManager = /** @class */ (function (_super) {
__extends(TrafficManager, _super);
function TrafficManager(game) {
var _this = _super.call(this, game) || this;
_this.requestsPerSecTimer = null;
_this.requestsPerSecSuccess = 0;
_this.requestsPerSecFailure = 0;
_this.requestsPerSecTimer = setInterval(_this.resetAndRenderRPS.bind(_this), 1000);
return _this;
}
TrafficManager.prototype.resetAndRenderRPS = function () {
this.game.infraManager.updateRps(this.requestsPerSecSuccess, this.requestsPerSecFailure);
this.requestsPerSecSuccess = 0;
this.requestsPerSecFailure = 0;
};
TrafficManager.prototype.generateHit = function () {
var method = this.getRandomMethodType();
var path = this.getRandomPath(method);
var success = true;
// Compile a list of VMs capable of handling this route
// We will favor microservices over web monolith where
// appropriate.
var capableVMs = [];
this.game.infraManager.getDataCenters().forEach(function (dc) {
dc.getAllVMs().forEach(function (vm) {
if (vm.getPoweredOn() === true) {
if (vm.canHandle(path) === true) {
capableVMs.push(vm);
}
}
});
});
// Get a random VM and pass the request on to the VM for handling
var vm = null;
if (capableVMs.length === 0) {
success = false;
}
else {
vm = capableVMs[Math.floor(Math.random() * capableVMs.length)];
success = vm.handleRequest(method, path);
}
if (success) {
this.requestsPerSecSuccess += 1;
}
else {
this.requestsPerSecFailure += 1;
}
var div = document.createElement('div');
div.className = 'pre';
div.innerHTML = "<span class=\"status-" + (success ? 'good' : 'bad') + "\">" + (success ? '200' : '503') + "</span> <span class=\"handled-by\">" + (success ? vm.getName() : '-') + "</span> " + method + " <span class=\"path\">" + path + "</span>";
document.querySelector('.traffic .access-logs .container').appendChild(div);
// Cleanup if needed
var logsRendered = document.querySelectorAll('.traffic .access-logs .container > div');
if (logsRendered.length >= 250) {
for (var i = 0; i < 50; i++) {
document.querySelector('.traffic .access-logs .container').removeChild(logsRendered[i]);
}
}
if (success) {
this.game.increaseHitCounter();
this.game.giveMoneyForHit();
}
this.game.infraManager.renderInfrastructureView();
};
TrafficManager.prototype.getRandomMethodType = function () {
var methods = ['GET', 'POST'];
return methods[Math.floor(Math.random() * methods.length)];
};
TrafficManager.prototype.getRandomPath = function (methodName) {
var paths = [];
switch (methodName) {
case 'GET':
paths = [
'/',
'/about',
'/jobs',
'/contact-us',
'/static/background.png',
'/static/favicon.ico',
'/static/sitemap.xml'
];
for (var i = 1; i <= 100; i++) {
paths.push("/static/img/image" + i.toString() + ".png");
}
break;
case 'POST':
paths = [
'/api/login',
'/api/signup',
'/api/help/request',
];
for (var i = 1; i <= 100; i++) {
paths.push("/api/help/" + i.toString() + "/save");
paths.push("/api/help/" + i.toString() + "/edit");
}
break;
}
return paths[Math.floor(Math.random() * paths.length)];
};
return TrafficManager;
}(BaseManager_3["default"]));
exports_10("default", TrafficManager);
}
};
});
System.register("ShopItem", [], function (exports_11, context_11) {
"use strict";
var __moduleName = context_11 && context_11.id;
var SHOP_CATEGORY, ITEM_EFFECT, ShopItem;
return {
setters: [],
execute: function () {
(function (SHOP_CATEGORY) {
SHOP_CATEGORY[SHOP_CATEGORY["GENERAL"] = 0] = "GENERAL";
SHOP_CATEGORY[SHOP_CATEGORY["MARKETING"] = 1] = "MARKETING";
})(SHOP_CATEGORY || (SHOP_CATEGORY = {}));
exports_11("SHOP_CATEGORY", SHOP_CATEGORY);
(function (ITEM_EFFECT) {
ITEM_EFFECT[ITEM_EFFECT["INCREASE_TRAFFIC"] = 0] = "INCREASE_TRAFFIC";
})(ITEM_EFFECT || (ITEM_EFFECT = {}));
exports_11("ITEM_EFFECT", ITEM_EFFECT);
ShopItem = /** @class */ (function () {
function ShopItem(manager, category, name, cost, description, icon, effectString, requirements) {
if (requirements === void 0) { requirements = []; }
this.requirements = [];
// Saved
this.purchased = false;
this.manager = manager;
this.name = name;
this.cost = cost;
this.category = category;
this.description = description;
this.icon = icon;
this.effects = effectString;
if (requirements.length > 0) {
this.parseRequirements(requirements);
}
}
ShopItem.prototype.save = function () {
return {
name: this.name,
purchased: this.purchased
};
};
ShopItem.prototype.parseRequirements = function (requirements) {
var _this = this;
requirements.forEach(function (req) {
var item = _this.manager.getItem(req);
if (item instanceof ShopItem) {
_this.requirements.push(item);
}
});
};
ShopItem.prototype.getName = function () {
return this.name;
};
ShopItem.prototype.getDescription = function (parseDescription) {
if (parseDescription === void 0) { parseDescription = false; }
if (parseDescription) {
return this.description.replace(/\[/g, '<span>').replace(/\]/g, '</span>');
}
return this.description;
};
ShopItem.prototype.getIcon = function () {
return this.icon;
};
ShopItem.prototype.getCost = function () {
return this.cost;
};
ShopItem.prototype.isInCategory = function (category) {
return this.category === category;
};
ShopItem.prototype.getRequirements = function () {
return this.requirements;
};
ShopItem.prototype.hasRequirements = function () {
for (var i = 0; i < this.requirements.length; i++) {
if (this.requirements[i].isPurchased() === false) {
return false;
}
}
return true;
};
ShopItem.prototype.canAfford = function () {
return this.cost <= this.manager.game.getMoney();
};
ShopItem.prototype.isPurchased = function () {
return this.purchased;
};
ShopItem.prototype.setAsPurchased = function () {
this.purchased = true;
};
ShopItem.prototype.activateEffects = function () {
var _this = this;
this.effects.split(';').forEach(function (effect) {
var effectName = effect.split(':')[0];
var effectValue = effect.split(':')[1];
switch (effectName) {
case 'traffic':
_this.manager.game.increaseTrafficPerSec(Number(effectValue.replace('+', '')));
break;
}
});
};
return ShopItem;
}());
exports_11("default", ShopItem);
}
};
});
System.register("managers/ShopManager", ["managers/BaseManager", "ShopItem"], function (exports_12, context_12) {
"use strict";
var __moduleName = context_12 && context_12.id;
var BaseManager_4, ShopItem_1, ShopManager;
return {
setters: [
function (BaseManager_4_1) {
BaseManager_4 = BaseManager_4_1;
},
function (ShopItem_1_1) {
ShopItem_1 = ShopItem_1_1;
}
],
execute: function () {
ShopManager = /** @class */ (function (_super) {
__extends(ShopManager, _super);
function ShopManager(game) {
var _this = _super.call(this, game) || this;
_this.items = [];
_this.populateItems();
return _this;
}
ShopManager.prototype.save = function () {
return {
items: this.items.map(function (item) { return item.save(); })
};
};
ShopManager.prototype.load = function (savedShop) {
var _this = this;
savedShop.items.forEach(function (item) {
var itemObj = _this.getItem(item.name);
if (itemObj && item.purchased === true) {
itemObj.setAsPurchased();
}
});
};
ShopManager.prototype.populateItems = function () {
// General
this.items.push(new ShopItem_1["default"](this, ShopItem_1.SHOP_CATEGORY.GENERAL, 'CDN', 500, 'Research how to create a [CDN] vm type. This will handle all [/static] routes.', 'fab fa-maxcdn', '', []));
// Marketing
this.items.push(new ShopItem_1["default"](this, ShopItem_1.SHOP_CATEGORY.MARKETING, 'Tell My Friends I', 100, 'You tell your friends about your new website and gain [+1/s] in traffic.', 'fas fa-users', 'traffic:+1', []));
this.items.push(new ShopItem_1["default"](this, ShopItem_1.SHOP_CATEGORY.MARKETING, 'Tell My Friends II', 1000, 'You post about your website on social media and gain [+5/s] in traffic.', 'fas fa-users', 'traffic:+5', ['Tell My Friends I']));
this.items.push(new ShopItem_1["default"](this, ShopItem_1.SHOP_CATEGORY.MARKETING, 'Podcast I', 2000, 'You advertise on a podcast and gain [+15/s] in traffic.', 'fas fa-podcast', 'traffic:+15', []));
};
ShopManager.prototype.getItem = function (itemName) {
for (var i = 0; i < this.items.length; i++) {
if (this.items[i].getName() === itemName) {
return this.items[i];
}
}
return null;
};
ShopManager.prototype.renderShopView = function () {
var _this = this;
var cats = [
{ name: 'general', category: ShopItem_1.SHOP_CATEGORY.GENERAL },
{ name: 'marketing', category: ShopItem_1.SHOP_CATEGORY.MARKETING }
];
cats.forEach(function (cat) {
var divContainer = document.querySelector(".game .shop .shop-container." + cat.name);
var filteredItems = _this.items.filter(function (item) { return item.isInCategory(cat.category) && item.hasRequirements(); });
var divHtml = '';
filteredItems.forEach(function (item) {
divHtml += "<div class=\"item " + (item.isPurchased() ? 'purchased' : '') + "\" onclick=\"Game.eventManager.emit('shop_purchase', '" + item.getName() + "')\">";
divHtml += "<div class=\"icon\"><i class=\"" + item.getIcon() + "\"></i></div>";
divHtml += "<div class=\"about\">";
divHtml += "<div class=\"name\">" + item.getName() + "</div>";
divHtml += "<div class=\"desc\">" + item.getDescription(true) + "</div>";
if (item.getRequirements().length > 0) {
divHtml += "<div class=\"req\">Requires [";
item.getRequirements().forEach(function (req) {
divHtml += "<span>" + req.getName() + "</span>";
});
divHtml += "]</div>";
}
divHtml += "</div>";
divHtml += "<div class=\"actions " + (item.isPurchased() ? 'purchased' : '') + "\">";
if (!item.isPurchased()) {
divHtml += '<div class="purchase">';
divHtml += '<div>BUY</div>';
divHtml += "<div class=\"purchase-amount " + (item.canAfford() ? '' : 'red') + "\">[ $" + item.getCost() + " ]</div>";
divHtml += '</div>';
}
else {
divHtml += '<div class="purchased"><i class="fas fa-check"></i></div>';
}
divHtml += "</div>";
divHtml += '</div>';
});
divContainer.innerHTML = divHtml;
});
};
return ShopManager;
}(BaseManager_4["default"]));
exports_12("default", ShopManager);
}
};
});
System.register("game", ["managers/EventManager", "managers/InfraManager", "managers/TrafficManager", "managers/ShopManager"], function (exports_13, context_13) {
"use strict";
var __moduleName = context_13 && context_13.id;
var EventManager_1, InfraManager_1, TrafficManager_1, ShopManager_1, Game;
return {
setters: [
function (EventManager_1_1) {
EventManager_1 = EventManager_1_1;
},
function (InfraManager_1_1) {
InfraManager_1 = InfraManager_1_1;
},
function (TrafficManager_1_1) {
TrafficManager_1 = TrafficManager_1_1;
},
function (ShopManager_1_1) {
ShopManager_1 = ShopManager_1_1;
}
],
execute: function () {
Game = /** @class */ (function () {
function Game() {
// Saved
this.visitCount = 0;
this.money = 0;
this.moneyPerHit = 1;
this.trafficPerSec = 0;
// Private
this.saveTimer = null;
this.trafficTimer = null;
this.partialTrafficCounter = 0;
this.eventManager = new EventManager_1["default"](this);
this.infraManager = new InfraManager_1["default"](this);
this.trafficManager = new TrafficManager_1["default"](this);
this.shopManager = new ShopManager_1["default"](this);
this.loadSavedGame();
this.saveTimer = setInterval(this.saveGame.bind(this), 1000);
this.trafficTimer = setInterval(this.generateTraffic.bind(this), 100);
}
Game.prototype.saveGame = function () {
var savedGame = {
lastSaveTime: Date.now(),
infrastructure: this.infraManager.save(),
visitCount: this.visitCount,
money: this.money,
moneyPerHit: this.moneyPerHit,
shop: this.shopManager.save(),
trafficPerSec: this.trafficPerSec
};
localStorage.setItem('savedGame', JSON.stringify(savedGame));
};
Game.prototype.loadSavedGame = function () {
if (localStorage.getItem('savedGame') !== null) {
var savedGame = JSON.parse(localStorage.getItem('savedGame'));
this.increaseHitCounter(savedGame.visitCount);
this.giveMoney(savedGame.money);
this.moneyPerHit = savedGame.moneyPerHit;
this.trafficPerSec = savedGame.trafficPerSec;
this.infraManager.load(savedGame.infrastructure);
this.shopManager.load(savedGame.shop);
return;
}
// Create a new game
this.giveMoney(1000);
var dc = this.infraManager.addDataCenter();
var rack = dc.addRack();
var server = rack.addServer();
var vm = server.createVM(1, 1, 10, 0);
vm.setPoweredOn(true);
};
Game.prototype.increaseHitCounter = function (amount) {
if (amount === void 0) { amount = 1; }
this.visitCount += amount;
document.querySelector('#hit-count').innerHTML = this.visitCount.toString();
};
Game.prototype.giveMoney = function (money) {
this.money += money;
this.updateMoney();
};
Game.prototype.takeMoney = function (money) {
this.money -= money;
this.updateMoney();
};
Game.prototype.updateMoney = function () {
document.querySelector('#money-count').innerHTML = "$" + this.money.toString();
};
Game.prototype.giveMoneyForHit = function () {
this.giveMoney(this.moneyPerHit);
};
Game.prototype.getMoney = function () {
return this.money;
};
Game.prototype.increaseTrafficPerSec = function (amount) {
this.trafficPerSec += amount;
};
Game.prototype.generateTraffic = function () {
if (this.trafficPerSec === 0) {
return;
}
var trafficPerTick = this.trafficPerSec / 10;
this.partialTrafficCounter += trafficPerTick;
if (this.partialTrafficCounter >= 1) {
var hits = Math.floor(this.partialTrafficCounter);
console.log(hits);
for (var i = 0; i < hits; i++) {
this.trafficManager.generateHit();
}
this.partialTrafficCounter -= hits;
}
};
return Game;
}());
exports_13("default", Game);
window['Game'] = new Game();
}
};
});
| 51.377924 | 267 | 0.42635 |
a78e72970ebbfdaddd04e2c4f21947d27261debb | 360 | js | JavaScript | config/.storybook/config.js | RyanCCollins/react-ts-starter | 9c6eb0bb74a1d4029d4811871d46e010913b88c7 | [
"MIT"
] | 179 | 2017-02-21T20:16:31.000Z | 2022-02-26T15:08:21.000Z | config/.storybook/config.js | RyanCCollins/react-ts-starter | 9c6eb0bb74a1d4029d4811871d46e010913b88c7 | [
"MIT"
] | 24 | 2017-02-21T20:19:40.000Z | 2018-03-06T20:17:05.000Z | config/.storybook/config.js | RyanCCollins/react-ts-starter | 9c6eb0bb74a1d4029d4811871d46e010913b88c7 | [
"MIT"
] | 34 | 2017-02-22T02:37:42.000Z | 2020-10-03T01:11:24.000Z | import { configure, setAddon } from '@kadira/storybook';
import infoAddon from '@kadira/react-storybook-addon-info';
import withPropsCombinations, { setDefaults } from 'react-storybook-addon-props-combinations'
setAddon(withPropsCombinations)
setAddon(infoAddon);
function loadStories() {
require('./stories/index.js');
}
configure(loadStories, module);
| 25.714286 | 93 | 0.777778 |
a78ec86b98ff37a9033ecf390850acdcf27959af | 1,250 | js | JavaScript | Truck/routes/api/items.js | dbhagesh/TruckingSoftware | 11ed17d96cbfa6af7c14c4c2a27fae2716058e7d | [
"MIT"
] | 2 | 2018-07-08T11:33:52.000Z | 2018-07-08T17:43:55.000Z | Truck/routes/api/items.js | dbhagesh/TruckingSoftware | 11ed17d96cbfa6af7c14c4c2a27fae2716058e7d | [
"MIT"
] | null | null | null | Truck/routes/api/items.js | dbhagesh/TruckingSoftware | 11ed17d96cbfa6af7c14c4c2a27fae2716058e7d | [
"MIT"
] | null | null | null | const express = require('express');
const router = express.Router();
const Item = require('../../models/Item');
// @route GET api/items
// @desc GET All Items
// @access Public
router.get('/',(req,res)=>{
Item.find()
.then(items => res.json(items));
});
// @route POST api/items
// @desc POST All Items
// @access Public
/*router.post('/',(req,res)=>{
const newItem = new Item({
name: req.body.name
})
newItem.save().then(item => res.json(item));
});
router.post('/', (req, res) => {
const newItem = new Item({vehiclenumber: req.body.vehiclenumber,
drivername: req.body.drivername,
driverphonenumber: req.body.driverphonenumber});
newItem.save()
.then(item =>
res.json(item),
res.send(console.log("Fucking Working"))
)
.catch(err => {
res.status(400).send("unable to save to database");
});
});
// @route DELETE api/items/:id
// @desc DELETE a Items
// @access Public
router.delete('/:id',(req,res)=>{
Item.findById(req.params.id)
.then(item => item.remove().then(() => res.json({success: true})))
.catch(err => res.status(404).json({success: false}));
});
*/
module.exports = router; | 25.510204 | 71 | 0.5744 |
a7910c32c64aebdc7e0a6a62c92e8a6028cf59de | 8,995 | js | JavaScript | src/ghostdriver/third_party/webdriver-atoms/set_local_storage_item.js | ant0ine/phantomjs | 8114d44a28134b765ab26b7e13ce31594fa81253 | [
"BSD-3-Clause"
] | 46 | 2015-01-08T14:32:34.000Z | 2022-02-05T16:48:26.000Z | app/hybrid/ios/webdriver-atoms/set_local_storage_item.js | kevinkong/appium | 8846f0c64e41a5400c72a48ad402b2a7ed89c566 | [
"Apache-2.0"
] | 7 | 2015-01-20T14:28:12.000Z | 2017-01-18T17:21:44.000Z | app/hybrid/ios/webdriver-atoms/set_local_storage_item.js | kevinkong/appium | 8846f0c64e41a5400c72a48ad402b2a7ed89c566 | [
"Apache-2.0"
] | 14 | 2015-10-27T06:17:48.000Z | 2020-03-03T06:15:50.000Z | function(){return function(){var g=void 0,h=!0,i=null,j=!1,k=this;
function n(a){var c=typeof a;if("object"==c)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return c;var b=Object.prototype.toString.call(a);if("[object Window]"==b)return"object";if("[object Array]"==b||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==b||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
else if("function"==c&&"undefined"==typeof a.call)return"object";return c}var aa=Date.now||function(){return+new Date};function p(a,c){function b(){}b.prototype=c.prototype;a.f=c.prototype;a.prototype=new b};var q=window;function ba(a,c){var b={},e;for(e in a)b[e]=c.call(g,a[e],e,a);return b};function r(a,c){this.code=a;this.message=c||"";this.name=ca[a]||ca[13];var b=Error(this.message);b.name=this.name;this.stack=b.stack||""}p(r,Error);
var ca={7:"NoSuchElementError",8:"NoSuchFrameError",9:"UnknownCommandError",10:"StaleElementReferenceError",11:"ElementNotVisibleError",12:"InvalidElementStateError",13:"UnknownError",15:"ElementNotSelectableError",19:"XPathLookupError",23:"NoSuchWindowError",24:"InvalidCookieDomainError",25:"UnableToSetCookieError",26:"ModalDialogOpenedError",27:"NoModalDialogOpenError",28:"ScriptTimeoutError",32:"InvalidSelectorError",35:"SqlDatabaseError",34:"MoveTargetOutOfBoundsError"};
r.prototype.toString=function(){return this.name+": "+this.message};function da(a,c){for(var b=1;b<arguments.length;b++)var e=String(arguments[b]).replace(/\$/g,"$$$$"),a=a.replace(/\%s/,e);return a}
function s(a,c){for(var b=0,e=String(a).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),d=String(c).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),f=Math.max(e.length,d.length),t=0;0==b&&t<f;t++){var O=e[t]||"",x=d[t]||"",Ga=RegExp("(\\d*)(\\D*)","g"),Ha=RegExp("(\\d*)(\\D*)","g");do{var l=Ga.exec(O)||["","",""],m=Ha.exec(x)||["","",""];if(0==l[0].length&&0==m[0].length)break;b=((0==l[1].length?0:parseInt(l[1],10))<(0==m[1].length?0:parseInt(m[1],10))?-1:(0==l[1].length?0:parseInt(l[1],10))>(0==
m[1].length?0:parseInt(m[1],10))?1:0)||((0==l[2].length)<(0==m[2].length)?-1:(0==l[2].length)>(0==m[2].length)?1:0)||(l[2]<m[2]?-1:l[2]>m[2]?1:0)}while(0==b)}return b};var u,v,w,y;function z(){return k.navigator?k.navigator.userAgent:i}y=w=v=u=j;var A;if(A=z()){var ea=k.navigator;u=0==A.indexOf("Opera");v=!u&&-1!=A.indexOf("MSIE");w=!u&&-1!=A.indexOf("WebKit");y=!u&&!w&&"Gecko"==ea.product}var B=u,C=v,D=y,fa=w,ga=k.navigator,ha=-1!=(ga&&ga.platform||"").indexOf("Win");function ia(){var a=k.document;return a?a.documentMode:g}var E;
a:{var F="",G;if(B&&k.opera)var H=k.opera.version,F="function"==typeof H?H():H;else if(D?G=/rv\:([^\);]+)(\)|;)/:C?G=/MSIE\s+([^\);]+)(\)|;)/:fa&&(G=/WebKit\/(\S+)/),G)var ja=G.exec(z()),F=ja?ja[1]:"";if(C){var ka=ia();if(ka>parseFloat(F)){E=String(ka);break a}}E=F}var la={};function I(a){return la[a]||(la[a]=0<=s(E,a))}var ma=k.document,na=!ma||!C?g:ia()||("CSS1Compat"==ma.compatMode?parseInt(E,10):5);var J,K,L,M,N,P,Q;Q=P=N=M=L=K=J=j;var R=z();R&&(-1!=R.indexOf("Firefox")?J=h:-1!=R.indexOf("Camino")?K=h:-1!=R.indexOf("iPhone")||-1!=R.indexOf("iPod")?L=h:-1!=R.indexOf("iPad")?M=h:-1!=R.indexOf("Android")?N=h:-1!=R.indexOf("Chrome")?P=h:-1!=R.indexOf("Safari")&&(Q=h));var oa=J,pa=K,qa=L,ra=M,S=N,sa=P,ta=Q;function T(a){return(a=a.exec(z()))?a[1]:""}var ua=function(){if(oa)return T(/Firefox\/([0-9.]+)/);if(C||B)return E;if(sa)return T(/Chrome\/([0-9.]+)/);if(ta)return T(/Version\/([0-9.]+)/);if(qa||ra){var a=/Version\/(\S+).*Mobile\/(\S+)/.exec(z());if(a)return a[1]+"."+a[2]}else{if(S)return(a=T(/Android\s+([0-9.]+)/))?a:T(/Version\/([0-9.]+)/);if(pa)return T(/Camino\/([0-9.]+)/)}return""}();var va,wa;function U(a){return xa?va(a):C?0<=s(na,a):I(a)}function V(a){return xa?wa(a):S?0<=s(ya,a):0<=s(ua,a)}
var xa=function(){if(!D)return j;var a=k.Components;if(!a)return j;try{if(!a.classes)return j}catch(c){return j}var b=a.classes,a=a.interfaces,e=b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),b=b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo),d=b.platformVersion,f=b.version;va=function(a){return 0<=e.d(d,""+a)};wa=function(a){return 0<=e.d(f,""+a)};return h}(),za;if(S){var Aa=/Android\s+([0-9\.]+)/.exec(z());za=Aa?Aa[1]:"0"}else za="0";var ya=za;S&&V(2.3);function Ba(){this.a=g}
function Ca(a,c,b){switch(typeof c){case "string":Da(c,b);break;case "number":b.push(isFinite(c)&&!isNaN(c)?c:"null");break;case "boolean":b.push(c);break;case "undefined":b.push("null");break;case "object":if(c==i){b.push("null");break}if("array"==n(c)){var e=c.length;b.push("[");for(var d="",f=0;f<e;f++)b.push(d),d=c[f],Ca(a,a.a?a.a.call(c,String(f),d):d,b),d=",";b.push("]");break}b.push("{");e="";for(f in c)Object.prototype.hasOwnProperty.call(c,f)&&(d=c[f],"function"!=typeof d&&(b.push(e),Da(f,
b),b.push(":"),Ca(a,a.a?a.a.call(c,f,d):d,b),e=","));b.push("}");break;case "function":break;default:throw Error("Unknown type: "+typeof c);}}var Ea={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},Fa=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g;
function Da(a,c){c.push('"',a.replace(Fa,function(a){if(a in Ea)return Ea[a];var c=a.charCodeAt(0),d="\\u";16>c?d+="000":256>c?d+="00":4096>c&&(d+="0");return Ea[a]=d+c.toString(16)}),'"')};fa||B||D&&U(3.5)||C&&U(8);function W(a){Error.captureStackTrace?Error.captureStackTrace(this,W):this.stack=Error().stack||"";a&&(this.message=String(a))}p(W,Error);W.prototype.name="CustomError";function Ia(a,c){c.unshift(a);W.call(this,da.apply(i,c));c.shift();this.e=a}p(Ia,W);Ia.prototype.name="AssertionError";function Ja(a,c){for(var b=a.length,e=Array(b),d="string"==typeof a?a.split(""):a,f=0;f<b;f++)f in d&&(e[f]=c.call(g,d[f],f,a));return e};if(D||C){var Ka;if(Ka=C)Ka=C&&9<=na;Ka||D&&I("1.9.1")}C&&I("9");function X(a){switch(n(a)){case "string":case "number":case "boolean":return a;case "function":return a.toString();case "array":return Ja(a,X);case "object":if("nodeType"in a&&(1==a.nodeType||9==a.nodeType)){var c={};c.ELEMENT=La(a);return c}if("document"in a)return c={},c.WINDOW=La(a),c;var b=n(a);if("array"==b||"object"==b&&"number"==typeof a.length)return Ja(a,X);var b=function(a,b){return"number"==typeof b||"string"==typeof b},e={};for(c in a)b.call(g,0,c)&&(e[c]=a[c]);return ba(e,X);default:return i}}
function Ma(a,c){var b;"array"==n(a)?b=Ja(a,function(a){return Ma(a,c)}):(b=typeof a,b="object"==b&&a!=i||"function"==b?"function"==typeof a?a:"ELEMENT"in a?Na(a.ELEMENT,c):"WINDOW"in a?Na(a.WINDOW,c):ba(a,function(a){return Ma(a,c)}):a);return b}function Oa(a){var a=a||document,c=a.$wdc_;c||(c=a.$wdc_={},c.b=aa());c.b||(c.b=aa());return c}
function La(a){var c=Oa(a.ownerDocument),b;a:{b=function(b){return b==a};for(var e in c)if(b.call(g,c[e])){b=e;break a}b=g}b||(b=":wdc:"+c.b++,c[b]=a);return b}
function Na(a,c){var a=decodeURIComponent(a),b=c||document,e=Oa(b);if(!(a in e))throw new r(10,"Element does not exist in cache");var d=e[a];if("setInterval"in d){if(d.closed)throw delete e[a],new r(23,"Window has been closed.");return d}for(var f=d;f;){if(f==b.documentElement)return d;f=f.parentNode}delete e[a];throw new r(10,"Element is no longer attached to the DOM");};var Pa=C&&U(8)&&!U(9),Qa=ta&&V(4)&&!V(5),Ra=S&&V(2.2)&&!V(2.3),Sa=ha&&ta&&V(4)&&!V(6);
function Ta(){var a=q||q;switch("local_storage"){case "appcache":return Pa?j:a.applicationCache!=i;case "browser_connection":return a.navigator!=i&&a.navigator.onLine!=i;case "database":return Qa||Ra?j:a.openDatabase!=i;case "location":return Sa?j:a.navigator!=i&&a.navigator.geolocation!=i;case "local_storage":return Pa?j:a.localStorage!=i;case "session_storage":return Pa?j:a.sessionStorage!=i&&a.sessionStorage.clear!=i;default:throw new r(13,"Unsupported API identifier provided as parameter");}}
;function Ua(a){this.c=a}Ua.prototype.setItem=function(a,c){try{this.c.setItem(a,c+"")}catch(b){throw new r(13,b.message);}};Ua.prototype.clear=function(){this.c.clear()};function Va(a,c){if(!Ta())throw new r(13,"Local storage undefined");(new Ua(q.localStorage)).setItem(a,c)};function Wa(a,c){var b=Va,e=[a,c],d=window||q,f;try{var b="string"==typeof b?new d.Function(b):d==window?b:new d.Function("return ("+b+").apply(null,arguments);"),t=Ma(e,d.document),O=b.apply(i,t);f={status:0,value:X(O)}}catch(x){f={status:"code"in x?x.code:13,value:{message:x.message}}}b=[];Ca(new Ba,f,b);return b.join("")}var Y=["_"],Z=k;!(Y[0]in Z)&&Z.execScript&&Z.execScript("var "+Y[0]);for(var $;Y.length&&($=Y.shift());){var Xa;if(Xa=!Y.length)Xa=Wa!==g;Xa?Z[$]=Wa:Z=Z[$]?Z[$]:Z[$]={}};; return this._.apply(null,arguments);}.apply({navigator:typeof window!=undefined?window.navigator:null,document:typeof window!=undefined?window.document:null}, arguments);}
| 499.722222 | 1,220 | 0.645692 |
a791108461c333284e3a2ce83a358fcbd9fc4fe5 | 1,337 | js | JavaScript | app/components/Card/styles.js | mariozugaj/reddit-hot-pics | 35b10e6c137f8561a953f7d5c8b583a585c3ac39 | [
"MIT"
] | null | null | null | app/components/Card/styles.js | mariozugaj/reddit-hot-pics | 35b10e6c137f8561a953f7d5c8b583a585c3ac39 | [
"MIT"
] | 1 | 2021-09-01T20:54:48.000Z | 2021-09-01T20:54:48.000Z | app/components/Card/styles.js | mariozugaj/reddit-hot-pics | 35b10e6c137f8561a953f7d5c8b583a585c3ac39 | [
"MIT"
] | null | null | null | import EStyleSheet from "react-native-extended-stylesheet";
import { Dimensions } from "react-native";
const windowWidth = Dimensions.get("window").width;
export default EStyleSheet.create({
$underlayColor: "$underlay",
container: {
flex: 1,
backgroundColor: "$white",
marginTop: 5,
marginBottom: 5,
},
header: {
paddingLeft: 15,
paddingRight: 15,
paddingTop: 10,
flexDirection: "row",
alignItems: "center",
},
avatar: {
width: 29,
height: 29,
borderRadius: 15,
overflow: "hidden",
},
metaText: {
paddingLeft: 10,
color: "$lightText",
},
title: {
padding: 15,
fontSize: 20,
fontWeight: "400",
},
pinIcon: {
position: "absolute",
top: 15,
right: 15,
},
text: {
paddingLeft: 15,
paddingRight: 15,
paddingBottom: 10,
color: "$lightText",
},
image: {
width: windowWidth,
height: windowWidth,
},
footer: {
flex: 1,
flexDirection: "row",
justifyContent: "space-around",
padding: 15,
},
footerText: {
color: "$darkText",
fontSize: 16,
fontWeight: "400",
marginLeft: 10,
},
footerGroup: {
flexDirection: "row",
alignItems: "center",
},
empty: {
flex: 1,
justifyContent: "center",
width: windowWidth,
alignItems: "center",
},
});
| 18.067568 | 59 | 0.586387 |
a7913588cca8f06bc3c3134be79c9cd511682406 | 215 | js | JavaScript | src/components/atoms/TextInput.js | ztlhayden/react-dictionary | 83894f827befb76364abd25472be505b9ec43ca1 | [
"MIT"
] | null | null | null | src/components/atoms/TextInput.js | ztlhayden/react-dictionary | 83894f827befb76364abd25472be505b9ec43ca1 | [
"MIT"
] | null | null | null | src/components/atoms/TextInput.js | ztlhayden/react-dictionary | 83894f827befb76364abd25472be505b9ec43ca1 | [
"MIT"
] | null | null | null | import styled from "styled-components";
const TextInput = styled.input`
font-size: 1.5em;
width: 100%;
border: var(--color-light-grey) solid 1px;
border-radius: 7px;
`;
export default TextInput;
| 19.545455 | 45 | 0.674419 |
a791ba8fd526cecf40eeb34cc1e883b741e030ab | 904 | js | JavaScript | src/components/UserInfo/UserInfo.js | RomanPidlisnychyi/react-team-project-health | 71b214b3eb23d25a1f247a0c5e5458f151872080 | [
"MIT"
] | null | null | null | src/components/UserInfo/UserInfo.js | RomanPidlisnychyi/react-team-project-health | 71b214b3eb23d25a1f247a0c5e5458f151872080 | [
"MIT"
] | null | null | null | src/components/UserInfo/UserInfo.js | RomanPidlisnychyi/react-team-project-health | 71b214b3eb23d25a1f247a0c5e5458f151872080 | [
"MIT"
] | null | null | null | import React from 'react';
import { connect } from 'react-redux';
import { authOperations, authSelectors } from '../../redux/auth';
import styles from './UserInfo.module.css';
function UserInfo({ showName, logOut }) {
if (showName !== null) {
return (
<div className={styles.userInfo}>
<ul className={styles.userInfo_list}>
<li className={styles.userInfo_item}>
<span>{showName}</span>
</li>
<li className={styles.userInfo_item}>
<button onClick={() => logOut()} className={styles.button}>
Выйти
</button>
</li>
</ul>
</div>
);
}
return <></>;
}
const mapStateToProps = state => ({
showName: authSelectors.getUserName(state),
});
const mapDispatchToProps = {
logOut: authOperations.logOut,
};
export default connect(mapStateToProps, mapDispatchToProps)(UserInfo);
| 25.828571 | 71 | 0.603982 |
a7921bd2d80e3d191ad3ed05e2e43df628607d93 | 184 | js | JavaScript | data/js/00/50/c2/9a/a0/00.36.js | p-g-krish/deepmac-tracker | 44d625a6b1ec30bf52f8d12a44b0afc594eb5f94 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | data/js/00/50/c2/9a/a0/00.36.js | p-g-krish/deepmac-tracker | 44d625a6b1ec30bf52f8d12a44b0afc594eb5f94 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | data/js/00/50/c2/9a/a0/00.36.js | p-g-krish/deepmac-tracker | 44d625a6b1ec30bf52f8d12a44b0afc594eb5f94 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | deepmacDetailCallback("0050c29aa000/36",[{"a":"Via dell' Industria, 5 San Lazzaro di Savena Bologna IT 40068","o":"TEKO TELECOM SpA","d":"2008-10-09","t":"add","s":"ieee","c":"IT"}]);
| 92 | 183 | 0.657609 |
a7925577466e63c3a752cb0c1563ef86d4084bb6 | 21,783 | js | JavaScript | modules/kodoc/views/kodoc/media/js/jquery-ui.js | WebarchivCZ/WA-Admin | f4864f3449974174a660852f347067fe87afbc02 | [
"BSD-3-Clause"
] | 1 | 2015-02-19T09:46:56.000Z | 2015-02-19T09:46:56.000Z | modules/kodoc/views/kodoc/media/js/jquery-ui.js | WebArchivCZ/WA-Admin | f4864f3449974174a660852f347067fe87afbc02 | [
"BSD-3-Clause"
] | 1 | 2021-03-21T23:25:50.000Z | 2021-03-21T23:25:50.000Z | modules/kodoc/views/kodoc/media/js/jquery-ui.js | WebArchivCZ/WA-Admin | f4864f3449974174a660852f347067fe87afbc02 | [
"BSD-3-Clause"
] | null | null | null | ;(function($){$.ui={plugin:{add:function(module,option,set){var proto=$.ui[module].prototype;for(var i in set){proto.plugins[i]=proto.plugins[i]||[];proto.plugins[i].push([option,set[i]]);}},call:function(instance,name,args){var set=instance.plugins[name];if(!set){return;}
for(var i=0;i<set.length;i++){if(instance.options[set[i][0]]){set[i][1].apply(instance.element,args);}}}},cssCache:{},css:function(name){if($.ui.cssCache[name]){return $.ui.cssCache[name];}
var tmp=$('<div class="ui-gen">').addClass(name).css({position:'absolute',top:'-5000px',left:'-5000px',display:'block'}).appendTo('body');$.ui.cssCache[name]=!!((!(/auto|default/).test(tmp.css('cursor'))||(/^[1-9]/).test(tmp.css('height'))||(/^[1-9]/).test(tmp.css('width'))||!(/none/).test(tmp.css('backgroundImage'))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(tmp.css('backgroundColor'))));try{$('body').get(0).removeChild(tmp.get(0));}catch(e){}
return $.ui.cssCache[name];},disableSelection:function(el){$(el).attr('unselectable','on').css('MozUserSelect','none');},enableSelection:function(el){$(el).attr('unselectable','off').css('MozUserSelect','');},hasScroll:function(e,a){var scroll=/top/.test(a||"top")?'scrollTop':'scrollLeft',has=false;if(e[scroll]>0)return true;e[scroll]=1;has=e[scroll]>0?true:false;e[scroll]=0;return has;}};var _remove=$.fn.remove;$.fn.remove=function(){$("*",this).add(this).triggerHandler("remove");return _remove.apply(this,arguments);};function getter(namespace,plugin,method){var methods=$[namespace][plugin].getter||[];methods=(typeof methods=="string"?methods.split(/,?\s+/):methods);return($.inArray(method,methods)!=-1);}
$.widget=function(name,prototype){var namespace=name.split(".")[0];name=name.split(".")[1];$.fn[name]=function(options){var isMethodCall=(typeof options=='string'),args=Array.prototype.slice.call(arguments,1);if(isMethodCall&&getter(namespace,name,options)){var instance=$.data(this[0],name);return(instance?instance[options].apply(instance,args):undefined);}
return this.each(function(){var instance=$.data(this,name);if(isMethodCall&&instance&&$.isFunction(instance[options])){instance[options].apply(instance,args);}else if(!isMethodCall){$.data(this,name,new $[namespace][name](this,options));}});};$[namespace][name]=function(element,options){var self=this;this.widgetName=name;this.widgetBaseClass=namespace+'-'+name;this.options=$.extend({},$.widget.defaults,$[namespace][name].defaults,options);this.element=$(element).bind('setData.'+name,function(e,key,value){return self.setData(key,value);}).bind('getData.'+name,function(e,key){return self.getData(key);}).bind('remove',function(){return self.destroy();});this.init();};$[namespace][name].prototype=$.extend({},$.widget.prototype,prototype);};$.widget.prototype={init:function(){},destroy:function(){this.element.removeData(this.widgetName);},getData:function(key){return this.options[key];},setData:function(key,value){this.options[key]=value;if(key=='disabled'){this.element[value?'addClass':'removeClass'](this.widgetBaseClass+'-disabled');}},enable:function(){this.setData('disabled',false);},disable:function(){this.setData('disabled',true);}};$.widget.defaults={disabled:false};$.ui.mouse={mouseInit:function(){var self=this;this.element.bind('mousedown.'+this.widgetName,function(e){return self.mouseDown(e);});if($.browser.msie){this._mouseUnselectable=this.element.attr('unselectable');this.element.attr('unselectable','on');}
this.started=false;},mouseDestroy:function(){this.element.unbind('.'+this.widgetName);($.browser.msie&&this.element.attr('unselectable',this._mouseUnselectable));},mouseDown:function(e){(this._mouseStarted&&this.mouseUp(e));this._mouseDownEvent=e;var self=this,btnIsLeft=(e.which==1),elIsCancel=(typeof this.options.cancel=="string"?$(e.target).parents().add(e.target).filter(this.options.cancel).length:false);if(!btnIsLeft||elIsCancel||!this.mouseCapture(e)){return true;}
this._mouseDelayMet=!this.options.delay;if(!this._mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){self._mouseDelayMet=true;},this.options.delay);}
if(this.mouseDistanceMet(e)&&this.mouseDelayMet(e)){this._mouseStarted=(this.mouseStart(e)!==false);if(!this._mouseStarted){e.preventDefault();return true;}}
this._mouseMoveDelegate=function(e){return self.mouseMove(e);};this._mouseUpDelegate=function(e){return self.mouseUp(e);};$(document).bind('mousemove.'+this.widgetName,this._mouseMoveDelegate).bind('mouseup.'+this.widgetName,this._mouseUpDelegate);return false;},mouseMove:function(e){if($.browser.msie&&!e.button){return this.mouseUp(e);}
if(this._mouseStarted){this.mouseDrag(e);return false;}
if(this.mouseDistanceMet(e)&&this.mouseDelayMet(e)){this._mouseStarted=(this.mouseStart(this._mouseDownEvent,e)!==false);(this._mouseStarted?this.mouseDrag(e):this.mouseUp(e));}
return!this._mouseStarted;},mouseUp:function(e){$(document).unbind('mousemove.'+this.widgetName,this._mouseMoveDelegate).unbind('mouseup.'+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this.mouseStop(e);}
return false;},mouseDistanceMet:function(e){return(Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance);},mouseDelayMet:function(e){return this._mouseDelayMet;},mouseStart:function(e){},mouseDrag:function(e){},mouseStop:function(e){},mouseCapture:function(e){return true;}};$.ui.mouse.defaults={cancel:null,distance:1,delay:0};})(jQuery);(function($){$.widget("ui.accordion",{init:function(){var options=this.options;if(options.navigation){var current=this.element.find("a").filter(options.navigationFilter);if(current.length){if(current.filter(options.header).length){options.active=current;}else{options.active=current.parent().parent().prev();current.addClass("current");}}}
options.headers=this.element.find(options.header);options.active=findActive(options.headers,options.active);if($.browser.msie){this.element.find('a').css('zoom','1');}
if(!this.element.hasClass("ui-accordion")){this.element.addClass("ui-accordion");$("<span class='ui-accordion-left'/>").insertBefore(options.headers);$("<span class='ui-accordion-right'/>").appendTo(options.headers);options.headers.addClass("ui-accordion-header").attr("tabindex","0");}
var maxHeight;if(options.fillSpace){maxHeight=this.element.parent().height();options.headers.each(function(){maxHeight-=$(this).outerHeight();});var maxPadding=0;options.headers.next().each(function(){maxPadding=Math.max(maxPadding,$(this).innerHeight()-$(this).height());}).height(maxHeight-maxPadding);}else if(options.autoHeight){maxHeight=0;options.headers.next().each(function(){maxHeight=Math.max(maxHeight,$(this).outerHeight());}).height(maxHeight);}
options.headers.not(options.active||"").next().hide();options.active.parent().andSelf().addClass(options.selectedClass);if(options.event){this.element.bind((options.event)+".accordion",clickHandler);}},activate:function(index){clickHandler.call(this.element[0],{target:findActive(this.options.headers,index)[0]});},destroy:function(){this.options.headers.next().css("display","");if(this.options.fillSpace||this.options.autoHeight){this.options.headers.next().css("height","");}
$.removeData(this.element[0],"accordion");this.element.removeClass("ui-accordion").unbind(".accordion");}});function scopeCallback(callback,scope){return function(){return callback.apply(scope,arguments);};};function completed(cancel){if(!$.data(this,"accordion")){return;}
var instance=$.data(this,"accordion");var options=instance.options;options.running=cancel?0:--options.running;if(options.running){return;}
if(options.clearStyle){options.toShow.add(options.toHide).css({height:"",overflow:""});}
$(this).triggerHandler("accordionchange",[$.event.fix({type:'accordionchange',target:instance.element[0]}),options.data],options.change);}
function toggle(toShow,toHide,data,clickedActive,down){var options=$.data(this,"accordion").options;options.toShow=toShow;options.toHide=toHide;options.data=data;var complete=scopeCallback(completed,this);options.running=toHide.size()===0?toShow.size():toHide.size();if(options.animated){if(!options.alwaysOpen&&clickedActive){$.ui.accordion.animations[options.animated]({toShow:jQuery([]),toHide:toHide,complete:complete,down:down,autoHeight:options.autoHeight});}else{$.ui.accordion.animations[options.animated]({toShow:toShow,toHide:toHide,complete:complete,down:down,autoHeight:options.autoHeight});}}else{if(!options.alwaysOpen&&clickedActive){toShow.toggle();}else{toHide.hide();toShow.show();}
complete(true);}}
function clickHandler(event){var options=$.data(this,"accordion").options;if(options.disabled){return false;}
if(!event.target&&!options.alwaysOpen){options.active.parent().andSelf().toggleClass(options.selectedClass);var toHide=options.active.next(),data={options:options,newHeader:jQuery([]),oldHeader:options.active,newContent:jQuery([]),oldContent:toHide},toShow=(options.active=$([]));toggle.call(this,toShow,toHide,data);return false;}
var clicked=$(event.target);clicked=$(clicked.parents(options.header)[0]||clicked);var clickedActive=clicked[0]==options.active[0];if(options.running||(options.alwaysOpen&&clickedActive)){return false;}
if(!clicked.is(options.header)){return;}
options.active.parent().andSelf().toggleClass(options.selectedClass);if(!clickedActive){clicked.parent().andSelf().addClass(options.selectedClass);}
var toShow=clicked.next(),toHide=options.active.next(),data={options:options,newHeader:clicked,oldHeader:options.active,newContent:toShow,oldContent:toHide},down=options.headers.index(options.active[0])>options.headers.index(clicked[0]);options.active=clickedActive?$([]):clicked;toggle.call(this,toShow,toHide,data,clickedActive,down);return false;};function findActive(headers,selector){return selector!=undefined?typeof selector=="number"?headers.filter(":eq("+selector+")"):headers.not(headers.not(selector)):selector===false?$([]):headers.filter(":eq(0)");}
$.extend($.ui.accordion,{defaults:{selectedClass:"selected",alwaysOpen:true,animated:'slide',event:"click",header:"a",autoHeight:true,running:0,navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase();}},animations:{slide:function(options,additions){options=$.extend({easing:"swing",duration:300},options,additions);if(!options.toHide.size()){options.toShow.animate({height:"show"},options);return;}
var hideHeight=options.toHide.height(),showHeight=options.toShow.height(),difference=showHeight/hideHeight;options.toShow.css({height:0,overflow:'hidden'}).show();options.toHide.filter(":hidden").each(options.complete).end().filter(":visible").animate({height:"hide"},{step:function(now){var current=(hideHeight-now)*difference;if($.browser.msie||$.browser.opera){current=Math.ceil(current);}
options.toShow.height(current);},duration:options.duration,easing:options.easing,complete:function(){if(!options.autoHeight){options.toShow.css("height","auto");}
options.complete();}});},bounceslide:function(options){this.slide(options,{easing:options.down?"bounceout":"swing",duration:options.down?1000:200});},easeslide:function(options){this.slide(options,{easing:"easeinout",duration:700});}}});$.fn.activate=function(index){return this.accordion("activate",index);};})(jQuery);(function($){$.widget("ui.tabs",{init:function(){this.options.event+='.tabs';this.tabify(true);},setData:function(key,value){if((/^selected/).test(key))
this.select(value);else{this.options[key]=value;this.tabify();}},length:function(){return this.$tabs.length;},tabId:function(a){return a.title&&a.title.replace(/\s/g,'_').replace(/[^A-Za-z0-9\-_:\.]/g,'')||this.options.idPrefix+$.data(a);},ui:function(tab,panel){return{options:this.options,tab:tab,panel:panel,index:this.$tabs.index(tab)};},tabify:function(init){this.$lis=$('li:has(a[href])',this.element);this.$tabs=this.$lis.map(function(){return $('a',this)[0];});this.$panels=$([]);var self=this,o=this.options;this.$tabs.each(function(i,a){if(a.hash&&a.hash.replace('#',''))
self.$panels=self.$panels.add(a.hash);else if($(a).attr('href')!='#'){$.data(a,'href.tabs',a.href);$.data(a,'load.tabs',a.href);var id=self.tabId(a);a.href='#'+id;var $panel=$('#'+id);if(!$panel.length){$panel=$(o.panelTemplate).attr('id',id).addClass(o.panelClass).insertAfter(self.$panels[i-1]||self.element);$panel.data('destroy.tabs',true);}
self.$panels=self.$panels.add($panel);}
else
o.disabled.push(i+1);});if(init){this.element.addClass(o.navClass);this.$panels.each(function(){var $this=$(this);$this.addClass(o.panelClass);});if(o.selected===undefined){if(location.hash){this.$tabs.each(function(i,a){if(a.hash==location.hash){o.selected=i;if($.browser.msie||$.browser.opera){var $toShow=$(location.hash),toShowId=$toShow.attr('id');$toShow.attr('id','');setTimeout(function(){$toShow.attr('id',toShowId);},500);}
scrollTo(0,0);return false;}});}
else if(o.cookie){var index=parseInt($.cookie('ui-tabs'+$.data(self.element)),10);if(index&&self.$tabs[index])
o.selected=index;}
else if(self.$lis.filter('.'+o.selectedClass).length)
o.selected=self.$lis.index(self.$lis.filter('.'+o.selectedClass)[0]);}
o.selected=o.selected===null||o.selected!==undefined?o.selected:0;o.disabled=$.unique(o.disabled.concat($.map(this.$lis.filter('.'+o.disabledClass),function(n,i){return self.$lis.index(n);}))).sort();if($.inArray(o.selected,o.disabled)!=-1)
o.disabled.splice($.inArray(o.selected,o.disabled),1);this.$panels.addClass(o.hideClass);this.$lis.removeClass(o.selectedClass);if(o.selected!==null){this.$panels.eq(o.selected).show().removeClass(o.hideClass);this.$lis.eq(o.selected).addClass(o.selectedClass);var onShow=function(){$(self.element).triggerHandler('tabsshow',[self.fakeEvent('tabsshow'),self.ui(self.$tabs[o.selected],self.$panels[o.selected])],o.show);};if($.data(this.$tabs[o.selected],'load.tabs'))
this.load(o.selected,onShow);else
onShow();}
$(window).bind('unload',function(){self.$tabs.unbind('.tabs');self.$lis=self.$tabs=self.$panels=null;});}
for(var i=0,li;li=this.$lis[i];i++)
$(li)[$.inArray(i,o.disabled)!=-1&&!$(li).hasClass(o.selectedClass)?'addClass':'removeClass'](o.disabledClass);if(o.cache===false)
this.$tabs.removeData('cache.tabs');var hideFx,showFx,baseFx={'min-width':0,duration:1},baseDuration='normal';if(o.fx&&o.fx.constructor==Array)
hideFx=o.fx[0]||baseFx,showFx=o.fx[1]||baseFx;else
hideFx=showFx=o.fx||baseFx;var resetCSS={display:'',overflow:'',height:''};if(!$.browser.msie)
resetCSS.opacity='';function hideTab(clicked,$hide,$show){$hide.animate(hideFx,hideFx.duration||baseDuration,function(){$hide.addClass(o.hideClass).css(resetCSS);if($.browser.msie&&hideFx.opacity)
$hide[0].style.filter='';if($show)
showTab(clicked,$show,$hide);});}
function showTab(clicked,$show,$hide){if(showFx===baseFx)
$show.css('display','block');$show.animate(showFx,showFx.duration||baseDuration,function(){$show.removeClass(o.hideClass).css(resetCSS);if($.browser.msie&&showFx.opacity)
$show[0].style.filter='';$(self.element).triggerHandler('tabsshow',[self.fakeEvent('tabsshow'),self.ui(clicked,$show[0])],o.show);});}
function switchTab(clicked,$li,$hide,$show){$li.addClass(o.selectedClass).siblings().removeClass(o.selectedClass);hideTab(clicked,$hide,$show);}
this.$tabs.unbind('.tabs').bind(o.event,function(){var $li=$(this).parents('li:eq(0)'),$hide=self.$panels.filter(':visible'),$show=$(this.hash);if(($li.hasClass(o.selectedClass)&&!o.unselect)||$li.hasClass(o.disabledClass)||$(this).hasClass(o.loadingClass)||$(self.element).triggerHandler('tabsselect',[self.fakeEvent('tabsselect'),self.ui(this,$show[0])],o.select)===false){this.blur();return false;}
self.options.selected=self.$tabs.index(this);if(o.unselect){if($li.hasClass(o.selectedClass)){self.options.selected=null;$li.removeClass(o.selectedClass);self.$panels.stop();hideTab(this,$hide);this.blur();return false;}else if(!$hide.length){self.$panels.stop();var a=this;self.load(self.$tabs.index(this),function(){$li.addClass(o.selectedClass).addClass(o.unselectClass);showTab(a,$show);});this.blur();return false;}}
if(o.cookie)
$.cookie('ui-tabs'+$.data(self.element),self.options.selected,o.cookie);self.$panels.stop();if($show.length){var a=this;self.load(self.$tabs.index(this),$hide.length?function(){switchTab(a,$li,$hide,$show);}:function(){$li.addClass(o.selectedClass);showTab(a,$show);});}else
throw'jQuery UI Tabs: Mismatching fragment identifier.';if($.browser.msie)
this.blur();return false;});if(!(/^click/).test(o.event))
this.$tabs.bind('click.tabs',function(){return false;});},add:function(url,label,index){if(index==undefined)
index=this.$tabs.length;var o=this.options;var $li=$(o.tabTemplate.replace(/#\{href\}/g,url).replace(/#\{label\}/g,label));$li.data('destroy.tabs',true);var id=url.indexOf('#')==0?url.replace('#',''):this.tabId($('a:first-child',$li)[0]);var $panel=$('#'+id);if(!$panel.length){$panel=$(o.panelTemplate).attr('id',id).addClass(o.hideClass).data('destroy.tabs',true);}
$panel.addClass(o.panelClass);if(index>=this.$lis.length){$li.appendTo(this.element);$panel.appendTo(this.element[0].parentNode);}else{$li.insertBefore(this.$lis[index]);$panel.insertBefore(this.$panels[index]);}
o.disabled=$.map(o.disabled,function(n,i){return n>=index?++n:n});this.tabify();if(this.$tabs.length==1){$li.addClass(o.selectedClass);$panel.removeClass(o.hideClass);var href=$.data(this.$tabs[0],'load.tabs');if(href)
this.load(index,href);}
this.element.triggerHandler('tabsadd',[this.fakeEvent('tabsadd'),this.ui(this.$tabs[index],this.$panels[index])],o.add);},remove:function(index){var o=this.options,$li=this.$lis.eq(index).remove(),$panel=this.$panels.eq(index).remove();if($li.hasClass(o.selectedClass)&&this.$tabs.length>1)
this.select(index+(index+1<this.$tabs.length?1:-1));o.disabled=$.map($.grep(o.disabled,function(n,i){return n!=index;}),function(n,i){return n>=index?--n:n});this.tabify();this.element.triggerHandler('tabsremove',[this.fakeEvent('tabsremove'),this.ui($li.find('a')[0],$panel[0])],o.remove);},enable:function(index){var o=this.options;if($.inArray(index,o.disabled)==-1)
return;var $li=this.$lis.eq(index).removeClass(o.disabledClass);if($.browser.safari){$li.css('display','inline-block');setTimeout(function(){$li.css('display','block');},0);}
o.disabled=$.grep(o.disabled,function(n,i){return n!=index;});this.element.triggerHandler('tabsenable',[this.fakeEvent('tabsenable'),this.ui(this.$tabs[index],this.$panels[index])],o.enable);},disable:function(index){var self=this,o=this.options;if(index!=o.selected){this.$lis.eq(index).addClass(o.disabledClass);o.disabled.push(index);o.disabled.sort();this.element.triggerHandler('tabsdisable',[this.fakeEvent('tabsdisable'),this.ui(this.$tabs[index],this.$panels[index])],o.disable);}},select:function(index){if(typeof index=='string')
index=this.$tabs.index(this.$tabs.filter('[href$='+index+']')[0]);this.$tabs.eq(index).trigger(this.options.event);},load:function(index,callback){var self=this,o=this.options,$a=this.$tabs.eq(index),a=$a[0],bypassCache=callback==undefined||callback===false,url=$a.data('load.tabs');callback=callback||function(){};if(!url||!bypassCache&&$.data(a,'cache.tabs')){callback();return;}
var inner=function(parent){var $parent=$(parent),$inner=$parent.find('*:last');return $inner.length&&$inner.is(':not(img)')&&$inner||$parent;};var cleanup=function(){self.$tabs.filter('.'+o.loadingClass).removeClass(o.loadingClass).each(function(){if(o.spinner)
inner(this).parent().html(inner(this).data('label.tabs'));});self.xhr=null;};if(o.spinner){var label=inner(a).html();inner(a).wrapInner('<em></em>').find('em').data('label.tabs',label).html(o.spinner);}
var ajaxOptions=$.extend({},o.ajaxOptions,{url:url,success:function(r,s){$(a.hash).html(r);cleanup();if(o.cache)
$.data(a,'cache.tabs',true);$(self.element).triggerHandler('tabsload',[self.fakeEvent('tabsload'),self.ui(self.$tabs[index],self.$panels[index])],o.load);o.ajaxOptions.success&&o.ajaxOptions.success(r,s);callback();}});if(this.xhr){this.xhr.abort();cleanup();}
$a.addClass(o.loadingClass);setTimeout(function(){self.xhr=$.ajax(ajaxOptions);},0);},url:function(index,url){this.$tabs.eq(index).removeData('cache.tabs').data('load.tabs',url);},destroy:function(){var o=this.options;this.element.unbind('.tabs').removeClass(o.navClass).removeData('tabs');this.$tabs.each(function(){var href=$.data(this,'href.tabs');if(href)
this.href=href;var $this=$(this).unbind('.tabs');$.each(['href','load','cache'],function(i,prefix){$this.removeData(prefix+'.tabs');});});this.$lis.add(this.$panels).each(function(){if($.data(this,'destroy.tabs'))
$(this).remove();else
$(this).removeClass([o.selectedClass,o.unselectClass,o.disabledClass,o.panelClass,o.hideClass].join(' '));});},fakeEvent:function(type){return $.event.fix({type:type,target:this.element[0]});}});$.ui.tabs.defaults={unselect:false,event:'click',disabled:[],cookie:null,spinner:'Loading…',cache:false,idPrefix:'ui-tabs-',ajaxOptions:{},fx:null,tabTemplate:'<li><a href="#{href}"><span>#{label}</span></a></li>',panelTemplate:'<div></div>',navClass:'ui-tabs-nav',selectedClass:'ui-tabs-selected',unselectClass:'ui-tabs-unselect',disabledClass:'ui-tabs-disabled',panelClass:'ui-tabs-panel',hideClass:'ui-tabs-hide',loadingClass:'ui-tabs-loading'};$.ui.tabs.getter="length";$.extend($.ui.tabs.prototype,{rotation:null,rotate:function(ms,continuing){continuing=continuing||false;var self=this,t=this.options.selected;function start(){self.rotation=setInterval(function(){t=++t<self.$tabs.length?t:0;self.select(t);},ms);}
function stop(e){if(!e||e.clientX){clearInterval(self.rotation);}}
if(ms){start();if(!continuing)
this.$tabs.bind(this.options.event,stop);else
this.$tabs.bind(this.options.event,function(){stop();t=self.options.selected;start();});}
else{stop();this.$tabs.unbind(this.options.event,stop);}}});})(jQuery); | 242.033333 | 1,438 | 0.739568 |
a792f246653ec7d5f2f9eb95148c58c699d9a4f8 | 10,416 | js | JavaScript | app/containers/WalletPage/index.js | ahsan-virani/gcd-portal | 991eb0b142d15b5c72e576455411cdf85bebd465 | [
"MIT"
] | null | null | null | app/containers/WalletPage/index.js | ahsan-virani/gcd-portal | 991eb0b142d15b5c72e576455411cdf85bebd465 | [
"MIT"
] | null | null | null | app/containers/WalletPage/index.js | ahsan-virani/gcd-portal | 991eb0b142d15b5c72e576455411cdf85bebd465 | [
"MIT"
] | null | null | null | /*
* HomePage
*
* This is the first thing users see of our App, at the '/' route
*/
import React from 'react';
import Helmet from 'react-helmet';
import { FormattedMessage } from 'react-intl';
// import { connect } from 'react-redux';
// import { createStructuredSelector } from 'reselect';
// import { makeSelectRepos, makeSelectLoading, makeSelectError } from 'containers/App/selectors';
import H2 from 'components/H2';
// import ReposList from 'components/ReposList';
// import AtPrefix from './AtPrefix';
// import CenteredSection from './CenteredSection';
import Section from './Section';
import messages from './messages';
import BannerImg from './inner-banner.jpg';
import PlusImg from './plus.png';
import MinusImg from './minus1.png';
import Img from './Img';
import { Table ,Grid, Row ,Col,Clearfix } from 'react-bootstrap';
import { Link } from 'react-router';
// import { loadRepos } from '../App/actions';
// import { changeUsername } from './actions';
// import { makeSelectUsername } from './selectors';
export default class WalletPage extends React.PureComponent { // eslint-disable-line react/prefer-stateless-function
/**
* when initial state username is not null, submit the form to load repos
*/
// componentDidMount() {
// if (this.props.username && this.props.username.trim().length > 0) {
// this.props.onSubmitForm();
// }
// }
// shouldComponentUpdate() {
// return false;
// }
render() {
// const { loading, error, repos } = this.props;
// const reposListProps = {
// loading,
// error,
// repos,
// };
return (
<div >
<Helmet
title="Wallet"
meta={[
{ name: 'description', content: 'Cryptocurrency trading platform' },
]}
/>
<Img src={BannerImg} alt="GlobalCoinDex" />
<div className="captionBanner">
<h2>WALLET </h2>
</div>
<Grid>
<Row className="show-grid balances">
<h1>ACCOUNT BALANCES (ESTIMATED VALUE: 0.00000000 BTC) </h1>
<Table responsive>
<thead>
<tr>
<th>+</th>
<th>Currency Name</th>
<th>SYMBOL</th>
<th>AVAILABLE BALANCE</th>
<th>PENDING DEPOSIT</th>
<th>RESERVED</th>
<th>TOTAL</th>
<th>EST. BTC VALUE</th>
<th>% CHANGE</th>
</tr>
</thead>
<tr>
<td>
<a href="#"><span className="plus"><Img src={PlusImg} alt="GlobalCoinDex" /></span></a>
<a href="#"><span className="minus1"><Img src={MinusImg} alt="GlobalCoinDex" /></span></a>
</td>
<td>2give</td>
<td>2give</td>
<td>0.0000058</td>
<td>0.000007</td>
<td>0.000007</td>
<td>0.0000058</td>
<td>0.0000058</td>
<td>12.5%</td>
</tr>
<tr>
<td>
<a href="#"><span className="plus"><Img src={PlusImg} alt="GlobalCoinDex" /></span></a>
<a href="#"><span className="minus1"><Img src={MinusImg} alt="GlobalCoinDex" /></span></a>
</td>
<td>2give</td>
<td>2give</td>
<td>0.0000058</td>
<td>0.000007</td>
<td>0.000007</td>
<td>0.0000058</td>
<td>0.0000058</td>
<td>12.5%</td>
</tr>
<tr>
<td>
<a href="#"><span className="plus"><Img src={PlusImg} alt="GlobalCoinDex" /></span></a>
<a href="#"><span className="minus1"><Img src={MinusImg} alt="GlobalCoinDex" /></span></a>
</td>
<td>2give</td>
<td>2give</td>
<td>0.0000058</td>
<td>0.000007</td>
<td>0.000007</td>
<td>0.0000058</td>
<td>0.0000058</td>
<td>12.5%</td>
</tr>
<tr>
<td>
<a href="#"><span className="plus"><Img src={PlusImg} alt="GlobalCoinDex" /></span></a>
<a href="#"><span className="minus1"><Img src={MinusImg} alt="GlobalCoinDex" /></span></a>
</td>
<td>2give</td>
<td>2give</td>
<td>0.0000058</td>
<td>0.000007</td>
<td>0.000007</td>
<td>0.0000058</td>
<td>0.0000058</td>
<td>12.5%</td>
</tr>
<tr>
<td>
<a href="#"><span className="plus"><Img src={PlusImg} alt="GlobalCoinDex" /></span></a>
<a href="#"><span className="minus1"><Img src={MinusImg} alt="GlobalCoinDex" /></span></a>
</td>
<td>2give</td>
<td>2give</td>
<td>0.0000058</td>
<td>0.000007</td>
<td>0.000007</td>
<td>0.0000058</td>
<td>0.0000058</td>
<td>12.5%</td>
</tr>
<tr>
<td>
<a href="#"><span className="plus"><Img src={PlusImg} alt="GlobalCoinDex" /></span></a>
<a href="#"><span className="minus1"><Img src={MinusImg} alt="GlobalCoinDex" /></span></a>
</td>
<td>2give</td>
<td>2give</td>
<td>0.0000058</td>
<td>0.000007</td>
<td>0.000007</td>
<td>0.0000058</td>
<td>0.0000058</td>
<td>12.5%</td>
</tr>
<tr>
<td>
<a href="#"><span className="plus"><Img src={PlusImg} alt="GlobalCoinDex" /></span></a>
<a href="#"><span className="minus1"><Img src={MinusImg} alt="GlobalCoinDex" /></span></a>
</td>
<td>2give</td>
<td>2give</td>
<td>0.0000058</td>
<td>0.000007</td>
<td>0.000007</td>
<td>0.0000058</td>
<td>0.0000058</td>
<td>12.5%</td>
</tr>
</Table>
</Row>
<Row className="show-grid pending">
<Col md={6} sm={12} lg={6} className="pwithdrawls">
<h1>PENDING WITHDRAWALS</h1>
<table>
<tr>
<td>+</td>
<td>DATE</td>
<td>CURRENCY</td>
<td>UNITS</td>
<td>+</td>
</tr>
<tr>
<td colSpan="5">You have no pending withdrawals.</td>
</tr>
</table>
</Col>
<Col md={6} sm={12} lg={6} className="pdeposits">
<h1>PENDING DEPOSITS</h1>
<table>
<tr>
<td>+</td>
<td>DATE</td>
<td>CURRENCY</td>
<td>UNITS</td>
<td>+</td>
</tr>
<tr>
<td colSpan="5">You have no pending withdrawals.</td>
</tr>
</table>
</Col>
<Clearfix ></Clearfix>
<Col md={6} sm={12} lg={6} className="hwithdrawls">
<h1>WITHDRAWAL HISTORY</h1>
<table>
<tr>
<td>+</td>
<td>DATE</td>
<td>CURRENCY</td>
<td>UNITS</td>
<td>+</td>
</tr>
<tr>
<td colSpan="5">You have no pending withdrawals.</td>
</tr>
</table>
</Col>
<Col md={6} sm={12} lg={6} className="hdeposits">
<h1>DEPOSIT HISTORY</h1>
<table>
<tr>
<td>+</td>
<td>DATE</td>
<td>CURRENCY</td>
<td>UNITS</td>
<td>+</td>
</tr>
<tr>
<td colSpan="5">You have no pending withdrawals.</td>
</tr>
</table>
</Col>
<Clearfix></Clearfix>
</Row>
</Grid>
</div>
);
}
}
// HomePage.propTypes = {
// loading: React.PropTypes.bool,
// error: React.PropTypes.oneOfType([
// React.PropTypes.object,
// React.PropTypes.bool,
// ]),
// repos: React.PropTypes.oneOfType([
// React.PropTypes.array,
// React.PropTypes.bool,
// ]),
// onSubmitForm: React.PropTypes.func,
// username: React.PropTypes.string,
// onChangeUsername: React.PropTypes.func,
// };
// export function mapDispatchToProps(dispatch) {
// return {
// onChangeUsername: (evt) => dispatch(changeUsername(evt.target.value)),
// onSubmitForm: (evt) => {
// if (evt !== undefined && evt.preventDefault) evt.preventDefault();
// dispatch(loadRepos());
// },
// };
// }
// const mapStateToProps = createStructuredSelector({
// repos: makeSelectRepos(),
// username: makeSelectUsername(),
// loading: makeSelectLoading(),
// error: makeSelectError(),
// });
// Wrap the component to inject dispatch and state into it
// export default connect(mapStateToProps, mapDispatchToProps)(HomePage);
| 34.83612 | 116 | 0.407738 |
a792f97c746c0832a00453b146384c0a4233af0f | 3,391 | js | JavaScript | db/file.js | ikushum/expressa | e1eb791d6902c82567a90fe4c2cd1757cf479258 | [
"MIT"
] | 399 | 2016-05-11T16:06:43.000Z | 2022-03-26T19:17:06.000Z | db/file.js | ikushum/expressa | e1eb791d6902c82567a90fe4c2cd1757cf479258 | [
"MIT"
] | 124 | 2016-05-17T00:37:51.000Z | 2022-03-02T19:39:12.000Z | db/file.js | ikushum/expressa | e1eb791d6902c82567a90fe4c2cd1757cf479258 | [
"MIT"
] | 34 | 2016-05-20T00:40:37.000Z | 2021-06-24T16:53:20.000Z | const Store = require('jfs')
const debug = require('debug')('expressa')
const { promisify } = require('util')
Store.prototype.allAsync = promisify(Store.prototype.all)
Store.prototype.getAsync = promisify(Store.prototype.get)
Store.prototype.saveAsync = promisify(Store.prototype.save)
const sift = require('sift')
const util = require('../util')
module.exports = function (settings, collection) {
const store = new Store((settings.file_storage_path || 'data') + '/' + collection, {
pretty: true,
saveId: '_id'
})
return {
init: function () {},
all: async function () {
return this.find({})
},
find: async function (query, offset, limit, orderby, fields) {
const data = await store.allAsync()
const arr = Object.keys(data).map(function (id) {
return data[id]
})
let matches = sift(query || {}, arr)
if (orderby) {
matches = util.orderBy(matches, orderby)
}
if (typeof offset !== 'undefined' && typeof limit !== 'undefined') {
matches = matches.slice(offset, offset + limit)
} else if (typeof offset !== 'undefined') {
matches = matches.slice(offset)
} else if (typeof limit !== 'undefined') {
matches = matches.slice(0, limit)
}
if (matches) { // prevent store from being modified
matches = matches.map(function (m) {
return util.clone(m)
})
} // prevent store from being modified
if (fields) {
matches = matches.map((doc) => util.mongoProject(doc, fields))
}
return matches
},
get: async function (id, fields) {
try {
let data = await store.getAsync(id)
if (data) {
data = util.clone(data) // prevent store from getting modified
}
if (fields) {
data = util.mongoProject(data, fields)
}
return data
} catch (err) {
debug(collection + ' ' + id)
throw new util.ApiError(404, 'document not found')
}
},
exists: async function (id) {
try {
await store.getAsync(id)
return true
} catch (err) {
return false
}
},
create: async function (data) {
data = util.sortObjectKeys(data)
util.addIdIfMissing(data)
const id = data._id
const existing = await this.exists(id)
if (existing) {
throw new util.ApiError(409, 'document already exists')
}
await store.saveAsync(id, data)
return id
},
update: async function (id, data) {
data._id = data._id || id
data = util.sortObjectKeys(data)
await store.saveAsync(data._id, data)
if (data._id !== id) {
await store.delete(id)
}
return data
},
// eslint-disable-next-line no-unused-vars
updateWithQuery: async function (query, update, options) {
const data = await store.allAsync()
const arr = Object.keys(data).map((id) => ({ _id: id, ...data[id]}) )
const matches = sift(query || {}, arr)
const promises = matches.map((doc) => {
util.mongoUpdate(doc, update)
return store.saveAsync(doc._id, doc)
})
await Promise.all(promises)
return {
matchedCount: promises.length
}
},
delete: async function (id) {
await this.get(id) // to check if exists
await store.delete(id)
}
}
}
| 30.276786 | 86 | 0.579475 |
a79313bb5c058533ab59dae7db4a5ef14227febe | 37,284 | js | JavaScript | src/pages/problemsPage/ProblemsPage.js | leesha19/Frontend | 28cda6b84aab6439ccc7353a693e604a40ff6b82 | [
"Apache-2.0"
] | 18 | 2020-10-20T10:34:13.000Z | 2022-03-04T10:04:00.000Z | src/pages/problemsPage/ProblemsPage.js | leesha19/Frontend | 28cda6b84aab6439ccc7353a693e604a40ff6b82 | [
"Apache-2.0"
] | 29 | 2020-10-29T04:38:24.000Z | 2022-01-17T13:35:08.000Z | src/pages/problemsPage/ProblemsPage.js | leesha19/Frontend | 28cda6b84aab6439ccc7353a693e604a40ff6b82 | [
"Apache-2.0"
] | 45 | 2020-10-04T09:04:44.000Z | 2022-01-16T08:05:31.000Z | import React,{useState,useEffect} from 'react';
import Loading from '../logreg/loading.jsx';
import Navbar from '../../components/Header/Navbar';
import FooterSmall from '../../components/Footer/FooterSmall';
import { Button, Modal, ModalHeader, ModalBody, ModalFooter, Input, Collapse} from 'reactstrap';
import {Form,Row,Col} from 'react-bootstrap';
import queryString from 'query-string';
import {faSearch} from '@fortawesome/free-solid-svg-icons';
// import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
import { getProblems,getProblemsWithCreds } from "../../actions/problems.actions"
import './ProblemPage.css'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
// import ReactBootstrapSlider from 'react-bootstrap-slider';
import { makeStyles } from '@material-ui/core/styles';
import Typography from '@material-ui/core/Typography';
import Slider from '@material-ui/core/Slider';
import update from 'react-addons-update';
import { event } from 'jquery';
import {faFolderPlus} from '@fortawesome/free-solid-svg-icons'
import AccordionCom from '../../components/problems/AccordionCom';
import Switch from '@material-ui/core/Switch';
import { withStyles } from '@material-ui/core/styles';
const AntSwitch = withStyles((theme) => ({
root: {
// width: 28,
// height: 16,
// padding: 0,
// display: 'flex',
float:'right'
},
switchBase: {
// padding: 2,
color: 'blue',
'&$checked': {
transform: 'translateX(20px)',
color: 'white',
'& + $track': {
opacity: 1,
backgroundColor: 'blue',
borderColor: 'black',
},
},
},
thumb: {
// width: 12,
// height: 12,
boxShadow: 'none',
},
track: {
// border: `1px solid ${theme.palette.grey[500]}`,
// borderRadius: 16 / 2,
// opacity: 1,
backgroundColor: 'white',
},
checked: {},
}))(Switch);
function ProblemsPage({info,queryStr}) {
console.log("qs", queryStr);
const queryDefault = queryString.parse(queryStr, {parseBooleans: true});
console.log(queryDefault);
const creds= JSON.parse(localStorage.getItem("creds"));
const [error, setErrors] = useState(false);
const [show, setShow] = useState(true);
const [problems, setProblems] = useState([]);
const [playlists, setPlaylists] = useState([]);
const [modal, setModal] = useState(false);
const[modalOpenDiffi,setModalOpenDiffi]=useState(false);
const[modalOpenPlat,setModalOpenPlat]=useState(false);
const[modalOpenDiffiRange,setModalOpenDiffiRange]=useState(false);
const [openTags,setOpenTags]=useState(false);
const [searchText, setSearchText] = useState();
const [tagText, setTagText] = useState();
const [problemid, setProblemListId] = useState();
const [problemplatform, setProblemListPlatform] = useState();
const platforms=[
"Codechef",
"Codeforces",
"Atcoder",
"Spoj",
"UVA"
];
const difficultyLevels=[
"Beginner",
"Easy" ,
"Medium",
"Hard",
"SuperHard",
"Challenging"
]
const defaultTags = ["string","dp","math","combinatorics", "Number Theory", "interactive","Binary Search","greedy","graph"];
const [rangeLeft,setRangeLeft]=useState(queryDefault.range_l ? queryDefault.range_l : 0);
const [rangeRight,setRangeRight]=useState(queryDefault.range_r ? queryDefault.range_r : 0);
const [displayDiff, setDisplayDiff] = useState(
queryDefault.difficulty ? { values: [
queryDefault.difficulty.includes("B"), queryDefault.difficulty.includes("E"),queryDefault.difficulty.includes("M"),queryDefault.difficulty.includes("H"),queryDefault.difficulty.includes("S"),queryDefault.difficulty.includes("C")
] } : {values:[false,false,false,false,false,false]}
)
const [displayPlat, setDisplayPlat] = useState(
queryDefault.platform ? {
values:[
queryDefault.platform.includes("C"),queryDefault.platform.includes("F"),queryDefault.platform.includes("A"),queryDefault.platform.includes("S"),queryDefault.platform.includes("U")
// false,false,false,false,false
]} : {values:[false,false,false,false,false]}
)
const [displayTags, setDisplayTags] = useState(
queryDefault.tags ? {
values:[
queryDefault.tags.includes("string"),queryDefault.tags.includes("dp"),queryDefault.tags.includes("math"),queryDefault.tags.includes("combinatorics"),queryDefault.tags.includes("Number Theory"),queryDefault.tags.includes("interactive"),queryDefault.tags.includes("Binary Search"),queryDefault.tags.includes("greedy"),queryDefault.tags.includes("graph")
]} : {
values:[
false,false,false,false,false,false,false,false,false
]}
)
const platformFilters = [
'C', 'F', 'A', 'S', 'U'
];
const difficultyFilters = [
'B','E','M','H','S','C'
]
const [queries,setQueries]=useState({
difficulty:[],
platform:[],
range_l:1200,
range_r:5000,
tags:[]
});
const [mentorr,setMentorr] = useState(queryDefault.mentor ? queryDefault.mentor : false);
const [mentorrCount,setMentorrCount] = useState(queryDefault.mentor ? true : false);
const[platformQueries, setPlatformQueries]=useState(queryDefault.platform ? queryDefault.platform.split(',') : []);
const[difficultyQueries, setDifficultyQueries]=useState(queryDefault.difficulty ? queryDefault.difficulty.split(',') : []);
const[tagQueries, setTagQueries]=useState(queryDefault.tags ? queryDefault.tags.split(','):[]);
// var difficultyQueries=[];
// var TagQueries=[];
const [diffRange, setDiffRange] = useState( queryDefault.range_l && queryDefault.range_r ? [queryDefault.range_l, queryDefault.range_r] : queryDefault.range_l ? [queryDefault.range_l,3200] : queryDefault.range_r ? [0,queryDefault.range_r] : [100,3200]);
const [sliderChange,setSliderChange] = useState(queryDefault.range_l || queryDefault.range_r ? true:false);
const handleSlider = (event, newValue) => {
setSliderChange(true);
setDiffRange(newValue);
};
const setLeftRangeQuery = (event) => {
event.preventDefault();
setRangeLeft(event.target.value);
}
const setRightRangeQuery = (event) => {
event.preventDefault();
setRangeRight(event.target.value);
}
// const toggle = (e) => {
// e.preventDefault();
// setModal(!modal);
// }
function toggle2(event) {
event.preventDefault();
setModal(!modal);
// console.log(id, platform);
if(!modal)
{
// console.log("ppppppp");
getPlaylists();
// fetchData();
}
// console.log(playlists);
};
const changePlatformFilter = (event,lev) => {
// console.log(queryString.stringifyUrl({url: 'https://api.codedigger.tech/problems/', query: {platform: 'F,A',difficulty:'B,E'}}));
// console.log(queryString.parseUrl('https://foo.bar?foo=b,l&g=k'))
const res=event.target.checked;
// console.log(lev);
// console.log(res);
const platformAdd=platformFilters[lev];
if(res)
{
// queries.platform.push(platformFilters[lev]);
// setQueries({platform:[...queries.platforms, platformFilters[lev]]});
// console.log(platformAdd);
// platformQueries.concat([platformAdd]);
// var temp=platformQueries.concat([platformAdd]);
// setPlatformQueries({platformQueries:temp});
setPlatformQueries([...platformQueries,[platformAdd]]);
// setDisplayPlat(
// result: { // object that we want to update
// ...prevState.result, // keep all other key-value pairs
// platformAdd: true // update the value of specific key
// }
// )
setDisplayPlat(update(displayPlat, {
values: {
[lev]: {
$set: true
}
}
}));
}
else
{
// setDisplayPlat(prevState => ({
// result: { // object that we want to update
// ...prevState.result, // keep all other key-value pairs
// platformAdd: false // update the value of specific key
// }
// }))
const newList = platformQueries.filter((item) => item != platformFilters[lev]);
setPlatformQueries(newList);
setDisplayPlat(update(displayPlat, {
values: {
[lev]: {
$set: false
}
}
}));
}
// console.log(JSON.stringify(queries.platform).replace(/"/g,'').replace(/]|[[]/g, ''));
}
const tagTextAdd = (event) => {
setTagQueries([...tagQueries, [tagText]]);
setTagText("");
}
function addProblem(slug){
if(!creds){
return;
}
let p;
let platform = problemplatform;
if(platform === "Codeforces"){
p = "F";
}else if(platform === "Codechef"){
p = "C";
}else if(platform === "Atcoder"){
p = "A";
}else if(platform === "UVA"){
p = "U";
}else if(platform === "SPOJ"){
p = "S";
}
// console.log(slug, prob_id, platform)
const result = fetch (`https://api.codedigger.tech/lists/userlist/add`,{
method:"POST",
headers:{
"Content-type":"application/json",
"Authorization":`Bearer ${creds.access}`
},
body:JSON.stringify({
"prob_id": problemid,
"slug": slug,
"platform": p
})
}).then(data => data.json())
.then(data => data.status === "FAILED"? alert("Problem has already been added to the problem list!"):alert("Problem is successfully Added to problem list."))
}
const changeTagFilter = (event,lev) => {
// console.log(difficultyFilters[lev]);
const res=event.target.checked;
// console.log(lev + res);
const tagAdd=defaultTags[lev];
if(res)
{
// console.log(queries.difficulty.push(difficultyFilters[lev]));
setTagQueries([...tagQueries, [tagAdd]]);
setDisplayTags(update(displayTags, {
values: {
[lev]: {
$set: true
}
}
}));
}
else
{
// var y=-1;
// queries.difficulty.map((plat,i) => {
// if(plat==difficultyFilters[lev])
// {
// y=i;
// }
// });
// queries.difficulty.splice(y,1);
const newList = tagQueries.filter((item) => item != defaultTags[lev]);
setTagQueries(newList);
// console.log(newList);
// console.log(lev);
// console.log(defaultTags[lev]);
setDisplayTags(update(displayTags, {
values: {
[lev]: {
$set: false
}
}
}));
}
// console.log(JSON.stringify(queries.difficulty).replace(/"/g,'').replace(/]|[[]/g, ''));
}
const changeDifficultyFilter = (event,lev) => {
// console.log(difficultyFilters[lev]);
const res=event.target.checked;
// console.log(lev + res);
const difficultyAdd=difficultyFilters[lev];
if(res)
{
// console.log(queries.difficulty.push(difficultyFilters[lev]));
setDifficultyQueries([...difficultyQueries, [difficultyAdd]]);
setDisplayDiff(update(displayDiff, {
values: {
[lev]: {
$set: true
}
}
}));
}
else
{
// var y=-1;
// queries.difficulty.map((plat,i) => {
// if(plat==difficultyFilters[lev])
// {
// y=i;
// }
// });
// queries.difficulty.splice(y,1);
const newList = difficultyQueries.filter((item) => item != difficultyFilters[lev]);
setDifficultyQueries(newList);
setDisplayDiff(update(displayDiff, {
values: {
[lev]: {
$set: false
}
}
}));
}
// console.log(JSON.stringify(queries.difficulty).replace(/"/g,'').replace(/]|[[]/g, ''));
}
const mentorrChange = (e) => {
setMentorr(!mentorr);
setMentorrCount(true);
}
const handleSubmit = (e) => {
e.preventDefault();
// console.log(queries);
// console.log(platformQueries);
// console.log(difficultyQueries);
// console.log(displayPlat);
// console.log(tagQueries);
if(!sliderChange)
{
if(mentorrCount)
{
const queryy = {
difficulty:JSON.stringify(difficultyQueries).replace(/"/g,'').replace(/]|[[]/g, ''),
platform:JSON.stringify(platformQueries).replace(/"/g,'').replace(/]|[[]/g, ''),
tags:JSON.stringify(tagQueries).replace(/"/g,'').replace(/]|[[]/g, ''),
mentor:JSON.stringify(mentorr)
}
const finalQ = queryString.stringify(queryy,{skipEmptyString:true});
const urlTo = `/problems/?${finalQ}`;
// console.log(urlTo);
window.location.href=urlTo;
}
else
{
const queryy = {
difficulty:JSON.stringify(difficultyQueries).replace(/"/g,'').replace(/]|[[]/g, ''),
platform:JSON.stringify(platformQueries).replace(/"/g,'').replace(/]|[[]/g, ''),
tags:JSON.stringify(tagQueries).replace(/"/g,'').replace(/]|[[]/g, '')
}
const finalQ = queryString.stringify(queryy,{skipEmptyString:true});
const urlTo = `/problems/?${finalQ}`;
// console.log(urlTo);
window.location.href=urlTo;
}
}
else
{
if(mentorrCount)
{
const queryy = {
difficulty:JSON.stringify(difficultyQueries).replace(/"/g,'').replace(/]|[[]/g, ''),
platform:JSON.stringify(platformQueries).replace(/"/g,'').replace(/]|[[]/g, ''),
tags:JSON.stringify(tagQueries).replace(/"/g,'').replace(/]|[[]/g, ''),
range_l:JSON.stringify(diffRange[0]).replace(/"/g,'').replace(/]|[[]/g, ''),
range_r:JSON.stringify(diffRange[1]).replace(/"/g,'').replace(/]|[[]/g, ''),
mentor:JSON.stringify(mentorr)
}
const finalQ = queryString.stringify(queryy,{skipEmptyString:true});
const urlTo = `/problems/?${finalQ}`;
// console.log(urlTo);
window.location.href=urlTo;
}
else
{
const queryy = {
difficulty:JSON.stringify(difficultyQueries).replace(/"/g,'').replace(/]|[[]/g, ''),
platform:JSON.stringify(platformQueries).replace(/"/g,'').replace(/]|[[]/g, ''),
tags:JSON.stringify(tagQueries).replace(/"/g,'').replace(/]|[[]/g, ''),
range_l:JSON.stringify(diffRange[0]).replace(/"/g,'').replace(/]|[[]/g, ''),
range_r:JSON.stringify(diffRange[1]).replace(/"/g,'').replace(/]|[[]/g, '')
}
const finalQ = queryString.stringify(queryy,{skipEmptyString:true});
const urlTo = `/problems/?${finalQ}`;
// console.log(urlTo);
window.location.href=urlTo;
}
}
}
const handleSearch = (e) => {
e.preventDefault();
const searchUrl = `/problems/?search=${searchText}`;
window.location.href=searchUrl;
}
function openNav() {
document.getElementById("mySidenav").style.width = "250px";
}
function closeNav() {
document.getElementById("mySidenav").style.width="0";
}
async function getPlaylists()
{
if(!creds){
alert("Please Login to Add Problems to Problem List!")
return;
}
const res = await fetch(`https://api.codedigger.tech/lists/userlist/`, {
method:"GET",
headers:{
"Content-Type":"application/json",
"Authorization":`Bearer ${creds.access}`
}
});
res
.json()
.then(res => setPlaylists(res))
.catch(error => setErrors(true));
}
useEffect(() => {
if(creds)
{
getProblemsWithCreds(queryStr,creds.access)
.then(res => setProblems(res))
.then(show => setShow(false))
.catch(error => setErrors(true));
}
else
{
getProblems(queryStr)
.then(res => setProblems(res))
.then(show => setShow(false))
.catch(error => setErrors(true));
}
},[])
function toggle(){
setModalOpenDiffi(false)
}
return (
show==true ? <><Loading/></>:
<>
<Navbar />
<h3
style={{
textAlign: 'center',
marginBottom: '65px',
marginTop: '100px'
}}
>Problems</h3>
<Button style={{position:'absolute', bottom:'77vh', right:'6vw'}} onClick={openNav}>Filter</Button>
<Button style={{position:'absolute', bottom:'77vh', right:'12vw'}} onClick={() => window.location.reload()}>Refresh</Button>
<div id="mySidenav" className="sidenav">
<Button className="filterHeading" onClick={(e)=>setModalOpenDiffi(!modalOpenDiffi)}>Difficulty</Button>
<Modal toggle={(e)=>{setModalOpenDiffi(false)}}
isOpen={modalOpenDiffi}><ModalBody>
<h2 style={{marginBottom:'2rem'}}>Difficulty</h2>
<Form style={{marginBottom:'1rem'}}>
<div key="inline-checkbox">
{difficultyLevels.map((lev,i) => {
if(displayDiff.values[i])
{
return(
<Form.Check checked={true} onChange={(event) => changeDifficultyFilter(event,i)} inline label={lev} type="checkbox" id={`inline-${lev}-${i}`} />
)
}
else
{
return(
<Form.Check onChange={(event) => changeDifficultyFilter(event,i)} inline label={lev} type="checkbox" id={`inline-${lev}-${i}`} />
)
}
})}
</div></Form>
<Button onClick={(e)=>setModalOpenDiffi(false)}>Set</Button>
</ModalBody></Modal>
<br></br><br></br>
<Button className="filterHeading" onClick={(e)=>setOpenTags(!openTags)}>Tags</Button>
<Modal toggle={(e)=>{setOpenTags(false)}} isOpen={openTags}><ModalBody>
<h2 style={{marginBottom:'2rem'}}>Tags</h2>
<Form style={{marginBottom:'1rem'}}>
<div key="inline-checkbox">
{defaultTags.map((lev,i) => {
if(displayTags.values[i])
{
return(
<Form.Check checked={true} onChange={(event) => changeTagFilter(event,i)} inline label={lev} type="checkbox" id={`inline-${lev}-${i}`} />
)
}
else
{
return(
<Form.Check onChange={(event) => changeTagFilter(event,i)} inline label={lev} type="checkbox" id={`inline-${lev}-${i}`} />
)
}
})}
</div>
<div>
<Form.Group as={Row} onSubmit={e => { e.preventDefault(); }} style={{marginTop:'1rem'}}>
<Form.Label column sm="3" style={{maxWidth:'18%'}}>
Your Tag
</Form.Label>
<Col sm="8">
<Form.Control onKeyPress={event => {
if (event.key === "Enter") {
event.preventDefault();
tagTextAdd();
}
}} value={tagText} onChange={(e)=>setTagText(e.target.value)} type="text" placeholder="Type your Tag" />
</Col>
<Col sm="1" style={{paddingLeft:'0'}}>
<Button onClick={tagTextAdd}>Add</Button>
</Col>
</Form.Group>
</div>
</Form>
<Row style={{marginBottom:'2rem'}}>
<Col sm='3'>Your Tags</Col>
<Col sm='9'>
<div style={{display:'flex', flexWrap:'wrap'}}>
{tagQueries.map((quer) => {
return(
<>
<div
style={{
padding:'0.4rem',
color:'black',
backgroundColor:'powderblue',
borderRadius:'4px',
margin:"0.3rem"
}}
>
{quer}
</div></>
)
})}
</div>
</Col>
</Row>
<Button onClick={(e)=>setOpenTags(false)}>Set</Button>
</ModalBody> </Modal> <br></br><br></br>
<Button className="filterHeading" onClick={(e)=>setModalOpenPlat(!modalOpenPlat)}>Platforms</Button>
<Modal toggle={(e)=>{setModalOpenPlat(false)}} isOpen={modalOpenPlat}><ModalBody>
<h2 style={{marginBottom:'2rem'}}>Platforms</h2>
<Form style={{marginBottom:'1rem'}}>
<div key="inline-checkbox">
{platforms.map((lev,i) => {
// console.log(`${displayPlat.values[i]}`)
if(displayPlat.values[i])
{
return(
<Form.Check checked={true} onChange={(event) => changePlatformFilter(event,i)} inline label={lev} type="checkbox" id={`inline-${lev}-${i}`} />
)
}
else
{
return(
<Form.Check checked={false} onChange={(event) => changePlatformFilter(event,i)} inline label={lev} type="checkbox" id={`inline-${lev}-${i}`} />
)
}
})}
</div>
</Form>
<Button onClick={(e)=>setModalOpenPlat(false)}>Set</Button>
</ModalBody></Modal>
<br></br><br></br>
<Button className="filterHeading" onClick={(e)=>setModalOpenDiffiRange(!modalOpenDiffiRange)}>Difficulty Range</Button>
<Modal toggle={(e)=>{setModalOpenDiffiRange(false)}} isOpen={modalOpenDiffiRange}><ModalBody>
{/* <Form inline>
<label style={{marginRight:'20px',padding:'4px'}}>
Range Left
<input style={{width:'100px',height:'32px',marginLeft:'11px'}} onChange={setLeftRangeQuery} type="number"/>
</label>
<br></br>
<label style={{padding:'4px'}}>
Range Right
<input style={{width:'100px',height:'32px',marginLeft:'11px'}} onChange={setRightRangeQuery} type="number"/>
</label>
</Form> */}
<div style={{width:'300'}}>
<Typography id="range-slider" gutterBottom>
Set your Difficulty Range
</Typography>
<Slider
value={diffRange}
min={400}
max={6000}
onChange={handleSlider}
valueLabelDisplay="auto"
aria-labelledby="range-slider"
// getAriaValueText={diffRange}
/>
<Typography>
<strong>Your Range :</strong>
<span>{diffRange[0]}</span>
<span> - </span>
<span>{diffRange[1]}</span>
</Typography>
</div>
<Button onClick={(e)=>setModalOpenDiffiRange(false)}>Set</Button>
</ModalBody> </Modal>
<br></br> <br></br>
<div className="filterHeading" style={{
marginTop:'1rem',
fontSize:'1.2rem',
marginBottom:'1rem'
}}>
Solved By Mentor:
<AntSwitch
checked={mentorr}
onChange={mentorrChange}
/>
{/* <Switch
// checked={state.checkedB}
// onChange={handleChange}
color="default"
name="checkedB"
inputProps={{ 'aria-label': 'checkbox with default color' }}
/> */}
</div>
<Button style={{padding:'6px',marginLeft:'12px',backgroundColor:'forestgreen'}}onClick={handleSubmit}>Apply</Button>
<Button style={{padding:'6px',marginLeft:'5px',backgroundColor:'firebrick'}} onClick={closeNav}>Close</Button>
</div>
{/** */}
{!problems.result? (<Loading />) :
(
<>
<div onClick={closeNav} style={{
margin: '0px',
padding: '0px',
marginLeft: '100px',
marginRight: '100px',
paddingBottom:'100px'
}}>
<div className="row" style={{marginBottom:'3rem'}}>
<div class="input-group" style={{justifyContent:'center'}}>
<div class="form-outline">
<input onChange={(e)=>setSearchText(e.target.value)} type="search" id="form1" class="form-control" style={{height:'3rem', width:'26rem'}}/>
</div>
<button type="button" onClick={handleSearch} class="btn btn-primary">
Search
</button>
</div>
</div>
<div>
{creds? <>
<Modal isOpen={modal} toggle={creds.access? toggle2:null}>
<ModalHeader toggle={toggle2}>Add to Problem List</ModalHeader>
<ModalBody>
</ModalBody>
<ul>
{playlists.map((list, i) => {
return(
<>
<li style={{
marginBottom:'10px'
}}>
<span style={{color:"white", fontSize:"19px"}}>{list.name}</span>
<Button
onClick={() => {addProblem(list.slug)}}
color="success"
style={{padding:"5px 7px",
position:"relative",
float:"right",
right:"40px",
bottom:"0",
borderRadius:"10%",
marginBottom: '3px'
}}>
Add
</Button>
</li>
</>
)
})}
</ul>
<ModalFooter>
<Button color="secondary" onClick={toggle2}>Close</Button>
</ModalFooter>
</Modal></> : <></>}
{/* {console.log(problems.result)} */}
<div className="row">
<div className="col-md-6" >
{problems.result.slice(0,9).map((playlist, i) => {
return(
<>
<div className="col-md-12" style={{
}} style={{marginBottom:'1rem'}}>
<AccordionCom problem={playlist}/>
<span onClick={() => {
setModal(!modal);
if(!modal){
getPlaylists();
}
setProblemListId(playlist.prob_id);
setProblemListPlatform(playlist.platform);
}} ><FontAwesomeIcon style={{cursor:"pointer", position: 'absolute', right: '30%', height: '30px', fontSize: '20px', color: 'black', zIndex: '100', top: "20px" }} icon={faFolderPlus} /></span>
</div>
</>
)
})}
</div>
<div className="col-md-6">
{problems.result.slice(10,19).map((playlist, i) => {
return(
<>
<div className="col-md-12" style={{
}} style={{marginBottom:'1rem'}}>
<AccordionCom problem={playlist}/>
<span onClick={() => {
setModal(!modal);
if(!modal){
getPlaylists();
}
setProblemListId(playlist.prob_id);
setProblemListPlatform(playlist.platform);
}} ><FontAwesomeIcon style={{cursor:"pointer", position: 'absolute', right: '30%', height: '30px', fontSize: '20px', color: 'black', zIndex: '100', top: "20px" }} icon={faFolderPlus} /></span>
</div>
</>
)
})}
</div></div>
</div>
</div>
<FooterSmall/>
</>
)
}
</>
)
}
export default ProblemsPage | 44.491647 | 363 | 0.396926 |
a793655418ae37034a1ef0304bf91626bb9954b3 | 12,542 | js | JavaScript | src/templates/eth2.js | vasumanhas000/ethereum-org-website | 9880c7a50103be6e4742ab28d685fb591d5053e9 | [
"MIT"
] | 3 | 2021-07-06T19:02:25.000Z | 2021-07-06T19:03:24.000Z | src/templates/eth2.js | vasumanhas000/ethereum-org-website | 9880c7a50103be6e4742ab28d685fb591d5053e9 | [
"MIT"
] | null | null | null | src/templates/eth2.js | vasumanhas000/ethereum-org-website | 9880c7a50103be6e4742ab28d685fb591d5053e9 | [
"MIT"
] | null | null | null | import React from "react"
import { graphql } from "gatsby"
import { useIntl } from "gatsby-plugin-intl"
import { MDXProvider } from "@mdx-js/react"
import { MDXRenderer } from "gatsby-plugin-mdx"
import styled from "styled-components"
import Img from "gatsby-image"
import ButtonLink from "../components/ButtonLink"
import ButtonDropdown from "../components/ButtonDropdown"
import BannerNotification from "../components/BannerNotification"
import Breadcrumbs from "../components/Breadcrumbs"
import Card from "../components/Card"
import Icon from "../components/Icon"
import Contributors from "../components/Contributors"
import DismissibleCard from "../components/DismissibleCard"
import InfoBanner from "../components/InfoBanner"
import UpgradeStatus from "../components/UpgradeStatus"
import Link from "../components/Link"
import MarkdownTable from "../components/MarkdownTable"
import Eth2BeaconChainActions from "../components/Eth2BeaconChainActions"
import Eth2ShardChainsList from "../components/Eth2ShardChainsList"
import Eth2DockingList from "../components/Eth2DockingList"
import Logo from "../components/Logo"
import MeetupList from "../components/MeetupList"
import PageMetadata from "../components/PageMetadata"
import Pill from "../components/Pill"
import RandomAppList from "../components/RandomAppList"
import Roadmap from "../components/Roadmap"
import Eth2TableOfContents from "../components/Eth2TableOfContents"
import Translation from "../components/Translation"
import TranslationsInProgress from "../components/TranslationsInProgress"
import SectionNav from "../components/SectionNav"
import { getLocaleTimestamp } from "../utils/time"
import { isLangRightToLeft } from "../utils/translations"
import {
Divider,
Paragraph,
Header1,
Header4,
} from "../components/SharedStyledComponents"
import Emoji from "../components/Emoji"
const Page = styled.div`
display: flex;
justify-content: space-between;
width: 100%;
margin: 0 auto 4rem;
@media (min-width: ${(props) => props.theme.breakpoints.l}) {
padding-top: 4rem;
}
@media (max-width: ${(props) => props.theme.breakpoints.l}) {
flex-direction: column;
}
`
const InfoColumn = styled.aside`
display: flex;
flex-direction: column;
position: sticky;
top: 6.25rem; /* account for navbar */
height: calc(100vh - 80px);
flex: 0 1 400px;
margin-right: 4rem;
margin-left: 2rem;
@media (max-width: ${(props) => props.theme.breakpoints.l}) {
display: none;
}
`
const MobileButton = styled.div`
@media (max-width: ${(props) => props.theme.breakpoints.l}) {
background: ${(props) => props.theme.colors.background};
box-shadow: 0 -1px 0px ${(props) => props.theme.colors.border};
width: 100%;
bottom: 0;
position: sticky;
padding: 2rem;
z-index: 99;
margin-bottom: 0rem;
}
`
// Apply styles for classes within markdown here
const ContentContainer = styled.article`
flex: 1 1 ${(props) => props.theme.breakpoints.l};
position: relative;
padding: 2rem;
padding-top: 0rem;
.featured {
padding-left: 1rem;
margin-left: -1rem;
border-left: 1px dotted ${(props) => props.theme.colors.primary};
}
.citation {
p {
color: ${(props) => props.theme.colors.text200};
}
}
`
const LastUpdated = styled.p`
color: ${(props) => props.theme.colors.text200};
font-style: italic;
padding-top: 1rem;
margin-bottom: 0rem;
border-top: 1px solid ${(props) => props.theme.colors.border};
`
const Pre = styled.pre`
max-width: 100%;
overflow-x: scroll;
background-color: ${(props) => props.theme.colors.preBackground};
border-radius: 0.25rem;
padding: 1rem;
border: 1px solid ${(props) => props.theme.colors.preBorder};
white-space: pre-wrap;
`
const H1 = styled.h1`
font-size: 48px;
font-weight: 700;
text-align: right;
margin-top: 0rem;
@media (max-width: ${(props) => props.theme.breakpoints.l}) {
text-align: left;
font-size: 40px;
display: none;
}
`
const H2 = styled.h2`
font-size: 32px;
font-weight: 700;
margin-top: 4rem;
a {
display: none;
}
/* Anchor tag styles */
a {
position: relative;
display: none;
margin-left: -1.5em;
padding-right: 0.5rem;
font-size: 1rem;
vertical-align: middle;
&:hover {
display: initial;
fill: ${(props) => props.theme.colors.primary};
}
}
&:hover {
a {
display: initial;
fill: ${(props) => props.theme.colors.primary};
}
}
`
const H3 = styled.h3`
font-size: 24px;
font-weight: 700;
a {
display: none;
}
/* Anchor tag styles */
a {
position: relative;
display: none;
margin-left: -1.5em;
padding-right: 0.5rem;
font-size: 1rem;
vertical-align: middle;
&:hover {
display: initial;
fill: ${(props) => props.theme.colors.primary};
}
}
&:hover {
a {
display: initial;
fill: ${(props) => props.theme.colors.primary};
}
}
`
// Note: you must pass components to MDXProvider in order to render them in markdown files
// https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/#mdxprovider
const components = {
a: Link,
h1: Header1,
h2: H2,
h3: H3,
h4: Header4,
p: Paragraph,
pre: Pre,
table: MarkdownTable,
MeetupList,
RandomAppList,
Roadmap,
Logo,
ButtonLink,
Contributors,
InfoBanner,
Card,
Divider,
SectionNav,
Pill,
TranslationsInProgress,
Emoji,
UpgradeStatus,
Eth2BeaconChainActions,
Eth2ShardChainsList,
Eth2DockingList,
}
const Title = styled.h1`
font-size: 40px;
font-weight: 700;
margin-top: 0rem;
`
const SummaryPoint = styled.li`
font-size: 16px;
color: ${(props) => props.theme.colors.text300};
margin-bottom: 0rem;
line-height: auto;
`
const SummaryBox = styled.div`
/* border: 1px solid ${(props) => props.theme.colors.border};
padding: 1.5rem;
padding-bottom: 0rem;
border-radius: 4px; */
`
const DesktopBreadcrumbs = styled(Breadcrumbs)`
margin-top: 0.5rem;
@media (max-width: ${(props) => props.theme.breakpoints.l}) {
display: none;
}
`
const MobileBreadcrumbs = styled(Breadcrumbs)`
margin-top: 0.5rem;
@media (min-width: ${(props) => props.theme.breakpoints.l}) {
display: none;
}
`
const StyledButtonDropdown = styled(ButtonDropdown)`
margin-bottom: 2rem;
display: flex;
justify-content: flex-end;
text-align: center;
@media (min-width: ${(props) => props.theme.breakpoints.s}) {
align-self: flex-end;
}
`
const MobileButtonDropdown = styled(StyledButtonDropdown)`
margin-bottom: 0rem;
@media (min-width: ${(props) => props.theme.breakpoints.l}) {
display: none;
}
`
const Container = styled.div`
position: relative;
`
const HeroContainer = styled.div`
background: ${(props) => props.theme.colors.cardGradient};
box-shadow: inset 0px -1px 0px rgba(0, 0, 0, 0.1);
display: flex;
justify-content: flex-end;
max-height: 608px;
min-height: 608px;
width: 100%;
@media (max-width: ${(props) => props.theme.breakpoints.l}) {
flex-direction: column-reverse;
max-height: 100%;
}
`
const Image = styled(Img)`
flex: 1 1 100%;
max-width: 816px;
background-size: cover;
background-repeat: no-repeat;
margin-left: 2rem;
align-self: flex-end;
right: 0;
bottom: 0;
background-size: cover;
@media (max-width: ${(props) => props.theme.breakpoints.l}) {
width: 100%;
height: 100%;
overflow: initial;
}
`
const MoreContent = styled(Link)`
width: 100%;
background: ${(props) => props.theme.colors.ednBackground};
padding: 1rem;
display: flex;
justify-content: center;
&:hover {
background: ${(props) => props.theme.colors.background};
}
@media (max-width: ${(props) => props.theme.breakpoints.l}) {
display: none;
}
`
const TitleCard = styled.div`
background: ${(props) => props.theme.colors.background};
border: 1px solid ${(props) => props.theme.colors.border};
box-shadow: ${(props) => props.theme.colors.cardBoxShadow};
padding: 2rem;
display: flex;
position: absolute;
left: 6rem;
top: 6rem;
flex-direction: column;
justify-content: flex-start;
border-radius: 2px;
z-index: 10;
max-width: 640px;
@media (max-width: ${(props) => props.theme.breakpoints.l}) {
max-width: 100%;
position: relative;
left: 0rem;
top: 0rem;
background: ${(props) => props.theme.colors.ednBackground};
box-shadow: none;
}
`
const StyledBannerNotification = styled(BannerNotification)`
display: flex;
justify-content: center;
`
const StyledEmoji = styled(Emoji)`
margin-right: 1rem;
flex-shrink: 0;
`
const dropdownLinks = {
text: "page-eth2-upgrades-guide",
ariaLabel: "page-eth2-upgrades-aria-label",
items: [
{
text: "page-eth2-upgrades-beacon-chain",
to: "/eth2/beacon-chain/",
},
{
text: "page-eth2-upgrades-shard-chains",
to: "/eth2/shard-chains/",
},
{
text: "page-eth2-upgrades-docking",
to: "/eth2/docking/",
},
],
}
const Eth2Page = ({ data, data: { mdx } }) => {
const intl = useIntl()
const isRightToLeft = isLangRightToLeft(intl.locale)
const tocItems = mdx.tableOfContents.items
// TODO some `gitLogLatestDate` are `null` - why?
const lastUpdatedDate = mdx.parent.fields
? mdx.parent.fields.gitLogLatestDate
: mdx.parent.mtime
return (
<Container>
<StyledBannerNotification shouldShow>
<StyledEmoji text=":megaphone:" />
<div>
<b>Latest:</b> Eth2 researchers are working on ways to accelerate the
merge. It will probably happen earlier than expected. More soon.{" "}
<Link to="https://blog.ethereum.org/category/research-and-development/">
Follow updates
</Link>
</div>
</StyledBannerNotification>
<HeroContainer>
<TitleCard>
<DesktopBreadcrumbs slug={mdx.fields.slug} startDepth={1} />
<MobileBreadcrumbs slug={mdx.fields.slug} startDepth={1} />
<Title>{mdx.frontmatter.title}</Title>
<SummaryBox>
<ul>
{mdx.frontmatter.summaryPoints.map((point, idx) => (
<SummaryPoint key={idx}>{point}</SummaryPoint>
))}
</ul>
</SummaryBox>
<LastUpdated>
<Translation id="page-last-updated" />:{" "}
{getLocaleTimestamp(intl.locale, lastUpdatedDate)}
</LastUpdated>
</TitleCard>
<Image fluid={mdx.frontmatter.image.childImageSharp.fluid} />
</HeroContainer>
<MoreContent to="#content">
<Icon name="chevronDown" />
</MoreContent>
<Page dir={isRightToLeft ? "rtl" : "ltr"}>
<PageMetadata
title={mdx.frontmatter.title}
description={mdx.frontmatter.description}
/>
<InfoColumn>
<StyledButtonDropdown list={dropdownLinks} />
<H1>{mdx.frontmatter.title}</H1>
{mdx.frontmatter.sidebar && tocItems && (
<Eth2TableOfContents
items={tocItems}
maxDepth={mdx.frontmatter.sidebarDepth}
/>
)}
<DismissibleCard storageKey="dismissed-eth2-psa">
<Emoji text=":cheering_megaphone:" size={5} />
<h2>
<Translation id="eth2-service-announcement" />
</h2>
<p>
<Translation id="eth2-no-action-needed" />
</p>
</DismissibleCard>
</InfoColumn>
<ContentContainer id="content">
{/* <DesktopBreadcrumbs slug={mdx.fields.slug} startDepth={1} /> */}
<MDXProvider components={components}>
<MDXRenderer>{mdx.body}</MDXRenderer>
</MDXProvider>
</ContentContainer>
<MobileButton>
<MobileButtonDropdown list={dropdownLinks} />
</MobileButton>
</Page>
</Container>
)
}
export const eth2PageQuery = graphql`
query Eth2PageQuery($relativePath: String) {
mdx(fields: { relativePath: { eq: $relativePath } }) {
fields {
slug
}
frontmatter {
title
description
sidebar
sidebarDepth
summaryPoints
image {
childImageSharp {
fluid(maxHeight: 640) {
...GatsbyImageSharpFluid
}
}
}
}
body
tableOfContents
parent {
... on File {
mtime
fields {
gitLogLatestDate
}
}
}
}
}
`
export default Eth2Page
| 25.440162 | 90 | 0.633551 |
a7938f4dbd99fcaa96257023b5b08e52fb8c028a | 8,904 | js | JavaScript | js/MSSA_ACS_SD_Imperial_simple.js | HDMA-SDSU/HealthWebMapper1.5 | cd9fa25834c9b97079c5cf5a9b1405004c617d85 | [
"MIT"
] | 3 | 2018-07-09T02:42:17.000Z | 2021-02-04T05:17:15.000Z | js/MSSA_ACS_SD_Imperial_simple.js | HDMA-SDSU/HealthWebMapper1.5 | cd9fa25834c9b97079c5cf5a9b1405004c617d85 | [
"MIT"
] | null | null | null | js/MSSA_ACS_SD_Imperial_simple.js | HDMA-SDSU/HealthWebMapper1.5 | cd9fa25834c9b97079c5cf5a9b1405004c617d85 | [
"MIT"
] | 4 | 2018-02-12T09:41:04.000Z | 2018-06-12T02:50:27.000Z | var MSSA_ACS_SD_Imperical =
[
["MSSA_ID","UNIT_COUNT","CNTY_FIPS","COUNTY","MSSA_NAME","DEFINITION","AREA_SQMI","POP","DENTIST","HISPANIC","WHITE","BLACK","NHS_BLACK","ASIAN","AGE_65OVER","AGE_18_64","AGE_UNDR18","AGE_UNDER5" ],
["152","4","73","San Diego","Borrego Springs/Cuyamaca/Julian/Kentwood in the Pines/Laguna/Ocotillo Wells/Palomar/Pine Valley/Warner Springs","Frontier","1788.019088","9965","2","1756","8400","87","87","269","2529","5672","1764","454" ],
["153.1","1","73","San Diego","Pala/Pauma Valley","Rural","112.9743827","7323","1","2193","5004","87","87","284","622","4627","2074","714" ],
["153.2","3","73","San Diego","Rincon/San Pasqual/Valley Center","Rural","94.77429121","17165","8","3965","13655","39","4","307","2664","10435","4066","918" ],
["154","1","73","San Diego","Barona/Moreno","Rural","48.05424153","2486","0","328","1756","32","26","43","439","1486","561","142" ],
["155","7","73","San Diego","Alpine/Blossom Valley/Crest/Descanso/Glen Oaks/Harbison Canyon/Japatul/Palo Verde","Rural","142.7951244","33320","13","5227","29029","400","384","345","5562","21252","6506","1397" ],
["156a","23","73","San Diego","Encinitas Central/Leucadia/Oceanside North and West/San Luis Rey/South Oceanside","Urban","21.79040028","111128","65","43267","78140","4412","3938","5700","13295","72421","25412","7743" ],
["156b","19","73","San Diego","Carlsbad East/Encinitas East/Oceanside East","Urban","35.73875959","109982","75","20589","86488","2898","2758","8509","16206","70722","23054","5796" ],
["156c","25","73","San Diego","Cardiff by the Sea/Eden Gardens/Harmony Grove/La Costa/Ocean Hills/Lomas Santa Fe/Olivehain/Rancho Santa Fe/San Marcos South/Solana Beach/Vista South","Urban","81.72658733","157079","117","20333","133235","2777","2466","10743","23063","98065","35951","9218" ],
["156d","25","73","San Diego","Oceanside East/San Marcos West/Vista","Urban","54.38300273","128176","103","63017","99517","4064","3664","5662","13241","83000","31935","9029" ],
["156e","26","73","San Diego","Escondido Central and South/San Marcos Central and East","Urban","25.61814246","134247","152","72413","110007","2507","2042","6181","13891","84526","35830","11389" ],
["156f","18","73","San Diego","Escondido East/Hidden Meadows/Poway North","Urban","135.134211","101864","23","22503","81800","2171","2147","9385","15688","63163","23013","6192" ],
["157","3","73","San Diego","Dulzura/Engineer Springs/Indian Springs/Jamacha/Jamul","Rural","208.2527023","18768","5","6126","14400","1172","1105","1433","1986","12377","4405","859" ],
["158.1","5","73","San Diego","Ramona/Rock Haven/Rosemont","Rural","102.2935626","26062","11","7636","22705","329","311","199","2689","16576","6797","1691" ],
["158.2","2","73","San Diego","Ballena/Four Corners/San Diego Country Estates","Urban","33.71526454","10833","2","1232","9993","160","160","101","1199","6795","2839","644" ],
["159","1","73","San Diego","Buckman Springs/Canyon City/Jacumba/Morena Village/Tecate","Rural","452.1445525","6794","0","1949","5405","242","144","87","896","3952","1946","614" ],
["160","10","73","San Diego","Bonsall/Camp Pendleton/Fallbrook/Live Oak Park/Rainbow/San Luis Rey Heights/Winterwarm","Urban","337.0054547","87309","78","24105","65437","4677","4552","3068","9310","57406","20593","9302" ],
["161a","28","73","San Diego","Clairemont/Fiesta Shores/Linda Vista/Mission Beach/Sorrento/University City","Urban","28.21819878","146800","148","26705","101841","4419","4225","28780","18915","104451","23434","7099" ],
["161b","25","73","San Diego","Bay Park/Five Points/Hillcrest Northwest/Mission Hills/Mission Valley/Morena/Normal Heights/Old Town/Serra Mesa","Urban","18.91774383","100320","97","18165","73908","5007","4632","10556","11645","73981","14694","5223" ],
["161c","21","73","San Diego","Downtown/Golden Hill/Logan Heights","Urban","9.2967569","91031","105","51361","55321","8473","8007","3931","7358","65029","18644","5402" ],
["161d","20","73","San Diego","Chollas Creek/City Heights/East San Diego/North Park/Oak Park/South Park","Urban","7.582194533","97571","35","48192","57465","12005","11517","14769","7407","63708","26456","8351" ],
["161e","21","73","San Diego","College Heights/Hillcrest Southeast/Kensington/Rolando North/University Heights","Urban","8.355288051","91713","121","23694","64903","8704","8464","7543","9691","70028","11994","3859" ],
["161f","17","73","San Diego","La Mesa/Rolando South","Urban","11.4151592","81594","113","21232","54485","9023","8648","8002","10359","53621","17614","6001" ],
["161g","22","73","San Diego","Encanto/Lemon Grove Northwest/Lincoln Acres/National City East/Paradise Hills Southwest","Urban","11.89412643","97682","42","55962","43220","14598","14018","15315","10189","60408","27085","7922" ],
["161h","18","73","San Diego","El Cajon Central and South/Fletcher Hills","Urban","11.19853098","87209","64","29373","62852","5797","5584","3729","8936","54575","23698","7040" ],
["161i","19","73","San Diego","Calavo Gardens/Casa de Oro/Cottonwood/Grossmont/Homelands/Lemon Grove Central and North/Mount Helix/Rancho San Diego/Spring Valley","Urban","20.80350769","85901","24","26211","63506","8175","7663","4352","11177","53553","21171","5356" ],
["161j","35","73","San Diego","Castle Park/Chula Vista Southwest/Imperial Beach West/Nestor East/Palm City/San Ysidro/South San Diego","Urban","46.56351557","155495","68","101943","123362","5505","5006","9185","17161","96353","41981","11208" ],
["161k","18","73","San Diego","Chula Vista Central and Northwest/National City West","Urban","10.32632605","80000","104","56521","53050","4200","3844","6698","8252","50469","21279","5984" ],
["161l","17","73","San Diego","Lemon Grove South/Paradise Hills","Urban","8.995491876","82472","7","30459","30037","13421","13057","23287","9090","52357","21025","5588" ],
["161m","18","73","San Diego","Carlton Hills/El Cajon North/Eucalyptus Hills/Lake Murray/Loma Portal/San Carlos/Santee","Urban","37.78622755","85698","49","13413","72064","2023","1978","3724","13083","52778","19837","4988" ],
["161n","17","73","San Diego","Civic Center/Coronado/Harbor Island/Imperial Beach East/Nestor West/Ocean Beach/Point Loma/Silver Strand","Urban","12.04361102","62608","47","9991","53885","2053","1959","2370","6859","45733","10016","3595" ],
["161o","19","73","San Diego","Allied Gardens/Del Cerro/Grantville/Miramar/Tierrasanta","Urban","76.05200059","85573","93","13373","63352","4770","4568","9071","10782","55870","18921","5799" ],
["161p","24","73","San Diego","Carmel Valley/Del Dios/Escondido South/Fairbanks Ranch/Poway Southeast/Rancho Bernardo Southeast/Rancho Penasquitos","Urban","67.78139217","151372","79","14312","97538","3080","2905","39590","13849","94875","42648","9880" ],
["161q","18","73","San Diego","Poway Central/Poway Grove/Rancho Bernardo Southwest/Sabre Springs","Urban","42.30004271","79251","113","11376","56435","1802","1734","13414","11375","49144","18732","5287" ],
["161r","22","73","San Diego","Crown Point/Del Mar/La Jolla/Pacific Beach","Urban","18.04729054","75594","101","6628","66695","640","640","4509","12539","53688","9367","2940" ],
["161s","18","73","San Diego","Cockatoo Grove/Eastlake Greens/Otay Mesa","Urban","37.03790847","144697","37","80939","92663","7913","7420","26695","11992","92848","39857","10469" ],
["161t","20","73","San Diego","Bonita/Chula Vista East/Eastlake/La Presa/Lynwood Hills/Rancho del Rey/Sunnyside/Sunny Vista","Urban","28.53923232","96857","71","48124","66019","5264","5059","12634","13167","60344","23346","5599" ],
["161u","15","73","San Diego","Bostonia/Glenview/Granite Hills/Hillsdale/Johnstown/Lakeside/Riverview/Winter Gardens","Urban","24.15819607","83457","21","17419","72139","2124","1954","1982","10316","52899","20242","5863" ],
["161v","22","73","San Diego","Mira Mesa/Scripps Miramar Ranch","Urban","27.3450127","112869","124","13330","51334","3793","3591","46499","10524","76336","26009","7148" ],
["46","1","25","Imperial","Bard/Winterhaven","Rural","44.93551617","2594","1","931","873","6","3","58","386","1420","788","307" ],
["47","4","25","Imperial","Bombay Beach/Calipatria/Desert Shores/Niland/Salton City/Salton Sea Beach","Frontier","2820.196762","17450","4","12199","11189","1607","1455","110","1940","11123","4387","1243" ],
["48","14","25","Imperial","El Centro/Heber/Holtville/Imperial/Seeley","Rural","332.2018236","82390","32","65228","57291","1739","1558","1518","8463","49034","24893","6773" ],
["49","6","25","Imperial","Calexico/Ocotillo","Rural","1007.706193","44657","7","40724","27373","1520","1419","714","4916","27563","12178","3356" ],
["50","6","25","Imperial","Brawley/Westmorland","Rural","276.3327801","28110","8","22627","23177","549","503","203","3257","16241","8612","2433" ]
] | 189.446809 | 295 | 0.643419 |
a794ba5ba884ed0cef41100e5173cab6f552c286 | 625 | js | JavaScript | tutorial/src/watchContract.js | yuxuanyao/SmartCar2 | 24144ba363d77fd4d07236005c8c5b2030082cf2 | [
"MIT"
] | null | null | null | tutorial/src/watchContract.js | yuxuanyao/SmartCar2 | 24144ba363d77fd4d07236005c8c5b2030082cf2 | [
"MIT"
] | null | null | null | tutorial/src/watchContract.js | yuxuanyao/SmartCar2 | 24144ba363d77fd4d07236005c8c5b2030082cf2 | [
"MIT"
] | null | null | null | const axios = require('axios')
const ethers = require('ethers')
const abi = require('../../../EtherRide/foo/build/contracts/CounterApp.json').abi
let provider = new ethers.providers.JsonRpcProvider('http://localhost:8545', 'unspecified')
let contract = new ethers.Contract('0xc7d453d31ac839088ea3cda6ea6a22d8758ae478', abi, provider)
contract.on('UnlockCar', () => {
console.log("Received Unlock Event from Aragon");
return axios.post(`http://localhost:8000/unlock`);
})
contract.on('LockCar', () => {
console.log("Received Lock Event from Aragon");
return axios.post(`http://localhost:8000/lock`);
})
| 29.761905 | 95 | 0.7088 |
a795580c381f6e50d1da35006440ffae68b7cd10 | 1,958 | js | JavaScript | packages/docusaurus/src/webpack/react-dev-utils-webpack5/evalSourceMapMiddleware.js | EkaterinaMozheiko/docusaurus | 730de9f0257b12cd45eca2120ec54f3e81d94f3d | [
"CC-BY-4.0",
"MIT"
] | 20,886 | 2019-06-19T02:07:25.000Z | 2022-03-31T23:59:41.000Z | packages/docusaurus/src/webpack/react-dev-utils-webpack5/evalSourceMapMiddleware.js | EkaterinaMozheiko/docusaurus | 730de9f0257b12cd45eca2120ec54f3e81d94f3d | [
"CC-BY-4.0",
"MIT"
] | 4,977 | 2019-06-19T17:33:56.000Z | 2022-03-31T12:23:42.000Z | packages/docusaurus/src/webpack/react-dev-utils-webpack5/evalSourceMapMiddleware.js | EkaterinaMozheiko/docusaurus | 730de9f0257b12cd45eca2120ec54f3e81d94f3d | [
"CC-BY-4.0",
"MIT"
] | 4,829 | 2019-06-20T11:54:26.000Z | 2022-03-31T22:28:04.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.
*/
/* eslint-disable */
/*
* THIS FILE IS MODIFIED FOR DOCUSAURUS
* the above copyright header must be preserved for license compliance.
*/
/*
Implementation based on comment: https://github.com/facebook/create-react-app/issues/9994#issuecomment-811289191
*/
function base64SourceMap(source) {
const base64 = Buffer.from(JSON.stringify(source.map()), 'utf8').toString(
'base64',
);
return `data:application/json;charset=utf-8;base64,${base64}`;
}
// modified for Docusaurus => remove webpack 5 deprecation warnings
// See https://github.com/facebook/create-react-app/issues/9994#issuecomment-811289191
function getSourceById(server, id) {
const module = Array.from(server._stats.compilation.modules).find(
(m) => server._stats.compilation.chunkGraph.getModuleId(m) == id,
);
return module.originalSource();
}
/*
* Middleware responsible for retrieving a generated source
* Receives a webpack internal url: "webpack-internal:///<module-id>"
* Returns a generated source: "<source-text><sourceMappingURL><sourceURL>"
*
* Based on EvalSourceMapDevToolModuleTemplatePlugin.js
*/
module.exports = function createEvalSourceMapMiddleware(server) {
return function handleWebpackInternalMiddleware(req, res, next) {
if (req.url.startsWith('/__get-internal-source')) {
const fileName = req.query.fileName;
const id = fileName.match(/webpack-internal:\/\/\/(.+)/)[1];
if (!id || !server._stats) {
next();
}
const source = getSourceById(server, id);
const sourceMapURL = `//# sourceMappingURL=${base64SourceMap(source)}`;
const sourceURL = `//# sourceURL=webpack-internal:///${module.id}`;
res.end(`${source.source()}\n${sourceMapURL}\n${sourceURL}`);
} else {
next();
}
};
};
| 33.758621 | 112 | 0.697651 |
a7959b5720c3e22d0f5080ef624a9d0f1bf603e4 | 954 | js | JavaScript | test/Encoder/CaseTransform.js | JARVIS-AI/cryptii | 826afc83d08ac6da494ecf2eceb9bdb05f8f77ce | [
"MIT"
] | 995 | 2017-07-04T03:36:43.000Z | 2022-03-30T01:26:19.000Z | test/Encoder/CaseTransform.js | JARVIS-AI/cryptii | 826afc83d08ac6da494ecf2eceb9bdb05f8f77ce | [
"MIT"
] | 106 | 2017-07-04T15:02:31.000Z | 2022-01-08T11:47:33.000Z | test/Encoder/CaseTransform.js | JARVIS-AI/cryptii | 826afc83d08ac6da494ecf2eceb9bdb05f8f77ce | [
"MIT"
] | 182 | 2017-07-04T16:26:03.000Z | 2022-03-31T05:46:00.000Z |
import { describe } from 'mocha'
import EncoderTester from '../Helper/EncoderTester'
import CaseTransformEncoder from '../../src/Encoder/CaseTransform'
/** @test {CaseTransformEncoder} */
describe('CaseTransformEncoder', () => EncoderTester.test(CaseTransformEncoder, [
{
settings: { case: 'lower' },
direction: 'encode',
content: 'Hello 👋 World',
expectedResult: 'hello 👋 world'
},
{
settings: { case: 'upper' },
direction: 'encode',
content: 'Hello 👋 World',
expectedResult: 'HELLO 👋 WORLD'
},
{
settings: { case: 'capitalize' },
direction: 'encode',
content: 'HElLo 👋 wORLd',
expectedResult: 'Hello 👋 World'
},
{
settings: { case: 'alternating' },
direction: 'encode',
content: 'Hello 👋 World',
expectedResult: 'hElLo 👋 wOrLd'
},
{
settings: { case: 'inverse' },
direction: 'encode',
content: 'Hello 👋 World',
expectedResult: 'hELLO 👋 wORLD'
}
]))
| 23.85 | 81 | 0.613208 |
a796cf38d637c2c7dda2d6221c75362afeab7282 | 1,396 | js | JavaScript | wwwroot/js/script.js | vishal-appwrk/fusioncharts_blazor_demo | b5119b0e1e5865224890958cdc8eb4e942e5d498 | [
"X11",
"MIT"
] | null | null | null | wwwroot/js/script.js | vishal-appwrk/fusioncharts_blazor_demo | b5119b0e1e5865224890958cdc8eb4e942e5d498 | [
"X11",
"MIT"
] | null | null | null | wwwroot/js/script.js | vishal-appwrk/fusioncharts_blazor_demo | b5119b0e1e5865224890958cdc8eb4e942e5d498 | [
"X11",
"MIT"
] | null | null | null | alert('Welcome to FusionCharts with Blazor APP');
function GetStudentName() {
//STEP 2 - Chart Data
const chartData = [{
"label": "Venezuela",
"value": "290"
}, {
"label": "Saudi",
"value": "260"
}, {
"label": "Canada",
"value": "180"
}, {
"label": "Iran",
"value": "140"
}, {
"label": "Russia",
"value": "115"
}, {
"label": "UAE",
"value": "100"
}, {
"label": "US",
"value": "30"
}, {
"label": "China",
"value": "30"
}];
//STEP 3 - Chart Configurations
const chartConfig = {
type: 'column2d',
renderAt: 'chart-container',
width: '100%',
height: '400',
dataFormat: 'json',
dataSource: {
// Chart Configuration
"chart": {
"caption": "Countries With Most Oil Reserves [2017-18]",
"subCaption": "In MMbbl = One Million barrels",
"xAxisName": "Country",
"yAxisName": "Reserves (MMbbl)",
"numberSuffix": "K",
"theme": "fusion",
},
// Chart Data
"data": chartData
}
};
FusionCharts.ready(function () {
var fusioncharts = new FusionCharts(chartConfig);
fusioncharts.render();
});
}
| 24.068966 | 72 | 0.438395 |
a79706ab4ad6aea3a5e5ae9c477ca16a107f3007 | 2,419 | js | JavaScript | docs/pages/docs/icons/index.js | TheLearneer/bootstrap-vue | 35a2f2327202de67b97f74e5fe3f4002038301e9 | [
"MIT"
] | 2 | 2020-01-24T13:50:39.000Z | 2020-02-14T17:52:45.000Z | docs/pages/docs/icons/index.js | vanfranrocha/bootstrap-vue | 3a3ee1dc9312a1a8c530a5ea42d1d239d5a24351 | [
"MIT"
] | 2 | 2020-06-03T01:23:36.000Z | 2020-11-04T01:26:24.000Z | docs/pages/docs/icons/index.js | vanfranrocha/bootstrap-vue | 3a3ee1dc9312a1a8c530a5ea42d1d239d5a24351 | [
"MIT"
] | null | null | null | import AnchoredHeading from '~/components/anchored-heading'
import Componentdoc from '~/components/componentdoc'
import IconsTable from '~/components/icons-table'
import Importdoc from '~/components/importdoc'
import Main from '~/components/main'
import Section from '~/components/section'
import docsMixin from '~/plugins/docs-mixin'
import { icons as iconsMeta, bootstrapIconsVersion } from '~/content'
import readme from '~/../src/icons/README.md'
export default {
name: 'BDVIcons',
layout: 'docs',
// We use a string template here so that the docs README can do interpolation
template: `
<Main class="bd-components">
<Section play>${readme}</Section>
<Section class="bd-component-reference">
<AnchoredHeading id="component-reference">Component reference</AnchoredHeading>
<template v-for="c in componentMeta">
<Componentdoc
:key="c.component"
:component="c.component"
:src-component="c.srcComponent"
:events="c.events"
:root-event-listeners="c.rootEventListeners"
:slots="c.slots"
:aliases="c.aliases"
:props-meta="c.props"
:version="c.version"
></Componentdoc>
</template>
<div class="alert alert-info small">
<p class="mb-0">
Individual icon components are not listed here due to the large number of components.
</p>
</div>
<Importdoc :meta="importMeta"></ImportDoc>
<p>
<code>IconsPlugin</code> is also exported as <code>BootstrapVueIcons</code>.
</p>
</Section>
</Main>`,
components: {
AnchoredHeading,
Componentdoc,
IconsTable,
Importdoc,
Main,
Section
},
mixins: [docsMixin],
data() {
return {
readme: readme,
// Key for icons meta is '' (empty slug)
meta: iconsMeta[''],
bootstrapIconsVersion
}
},
computed: {
componentMeta() {
// `docs/content/index.js` massages the list of icon components
// to include only `BIcon`, `BIconstack` and an example component
// The example icon has a special `srcComponent` property that lists
// `BIconBlank` as the component to grab the `$options.props` from
return this.meta.components
},
importMeta() {
return { ...this.meta, slug: 'icons', components: this.componentMeta }
}
}
}
| 32.689189 | 97 | 0.625465 |
a797359ed6ae16d141679b3824220128d1d87baa | 4,037 | js | JavaScript | x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/get_nodes/get_paginated_nodes.js | yojiwatanabe/kibana | 1225c32fac1e21d2648f83ee77d01ca2c425cd7a | [
"Apache-2.0"
] | 2 | 2021-04-04T20:57:55.000Z | 2022-01-04T22:22:20.000Z | x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/get_nodes/get_paginated_nodes.js | yojiwatanabe/kibana | 1225c32fac1e21d2648f83ee77d01ca2c425cd7a | [
"Apache-2.0"
] | 12 | 2020-04-20T18:10:48.000Z | 2020-07-07T21:24:29.000Z | x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/get_nodes/get_paginated_nodes.js | yojiwatanabe/kibana | 1225c32fac1e21d2648f83ee77d01ca2c425cd7a | [
"Apache-2.0"
] | 1 | 2021-05-17T19:55:10.000Z | 2021-05-17T19:55:10.000Z | /*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { get, isUndefined } from 'lodash';
import { getNodeIds } from './get_node_ids';
import { filter } from '../../../pagination/filter';
import { sortNodes } from './sort_nodes';
import { paginate } from '../../../pagination/paginate';
import { getMetrics } from '../../../details/get_metrics';
/**
* This function performs an optimization around the node listing tables in the UI. To avoid
* query performances in Elasticsearch (mainly thinking of `search.max_buckets` overflows), we do
* not want to fetch all time-series data for all nodes. Instead, we only want to fetch the
* time-series data for the nodes visible in the listing table. This function accepts
* pagination/sorting/filtering data to determine which nodes will be visible in the table
* and returns that so the caller can perform their normal call to get the time-series data.
*
* @param {*} req - Server request object
* @param {*} esIndexPattern - The index pattern to search against (`.monitoring-es-*`)
* @param {*} uuids - The optional `clusterUuid` and `nodeUuid` to filter the results from
* @param {*} metricSet - The array of metrics that are sortable in the UI
* @param {*} pagination - ({ index, size })
* @param {*} sort - ({ field, direction })
* @param {*} queryText - Text that will be used to filter out pipelines
*/
export async function getPaginatedNodes(
req,
esIndexPattern,
{ clusterUuid },
metricSet,
pagination,
sort,
queryText,
{ clusterStats, nodesShardCount }
) {
const config = req.server.config();
const size = config.get('monitoring.ui.max_bucket_size');
const nodes = await getNodeIds(req, esIndexPattern, { clusterUuid }, size);
// Add `isOnline` and shards from the cluster state and shard stats
const clusterState = get(clusterStats, 'cluster_state', { nodes: {} });
for (const node of nodes) {
node.isOnline = !isUndefined(get(clusterState, ['nodes', node.uuid]));
node.shardCount = get(nodesShardCount, `nodes[${node.uuid}].shardCount`, 0);
}
// `metricSet` defines a list of metrics that are sortable in the UI
// but we don't need to fetch all the data for these metrics to perform
// the necessary sort - we only need the last bucket of data so we
// fetch the last two buckets of data (to ensure we have a single full bucekt),
// then return the value from that last bucket
const filters = [
{
terms: {
'source_node.name': nodes.map((node) => node.name),
},
},
];
const groupBy = {
field: `source_node.uuid`,
include: nodes.map((node) => node.uuid),
size: config.get('monitoring.ui.max_bucket_size'),
};
const metricSeriesData = await getMetrics(
req,
esIndexPattern,
metricSet,
filters,
{ nodes },
4,
groupBy
);
for (const metricName in metricSeriesData) {
if (!metricSeriesData.hasOwnProperty(metricName)) {
continue;
}
const metricList = metricSeriesData[metricName];
for (const metricItem of metricList[0]) {
const node = nodes.find((node) => node.uuid === metricItem.groupedBy);
if (!node) {
continue;
}
const dataSeries = metricItem.data;
if (dataSeries && dataSeries.length) {
const lastItem = dataSeries[dataSeries.length - 1];
if (lastItem.length && lastItem.length === 2) {
node[metricName] = lastItem[1];
}
}
}
}
// Manually apply pagination/sorting/filtering concerns
// Filtering
const filteredNodes = filter(nodes, queryText, ['name']); // We only support filtering by name right now
// Sorting
const sortedNodes = sortNodes(filteredNodes, sort);
// Pagination
const pageOfNodes = paginate(pagination, sortedNodes);
return {
pageOfNodes,
totalNodeCount: filteredNodes.length,
};
}
| 35.104348 | 106 | 0.679713 |
a79868acaac62fc1442c2f5607020b0f3838dec5 | 1,056 | js | JavaScript | ipfs_upload/node_modules/level-js/util/deserialize.js | 2ndHG/Simple-Mall | 6fac11408056c5d93c3d0438a84745e71acb6966 | [
"MIT"
] | 139 | 2018-05-27T20:40:59.000Z | 2022-03-15T04:31:27.000Z | ipfs_upload/node_modules/level-js/util/deserialize.js | 2ndHG/Simple-Mall | 6fac11408056c5d93c3d0438a84745e71acb6966 | [
"MIT"
] | 73 | 2018-05-27T12:40:44.000Z | 2022-03-05T15:24:08.000Z | ipfs_upload/node_modules/level-js/util/deserialize.js | 2ndHG/Simple-Mall | 6fac11408056c5d93c3d0438a84745e71acb6966 | [
"MIT"
] | 14 | 2018-09-17T03:03:15.000Z | 2021-12-13T13:28:40.000Z | 'use strict'
const Buffer = require('buffer').Buffer
const ta2str = (function () {
if (global.TextDecoder) {
const decoder = new TextDecoder('utf-8')
return decoder.decode.bind(decoder)
} else {
return function ta2str (ta) {
return ta2buf(ta).toString()
}
}
})()
const ab2str = (function () {
if (global.TextDecoder) {
const decoder = new TextDecoder('utf-8')
return decoder.decode.bind(decoder)
} else {
return function ab2str (ab) {
return Buffer.from(ab).toString()
}
}
})()
function ta2buf (ta) {
const buf = Buffer.from(ta.buffer)
if (ta.byteLength === ta.buffer.byteLength) {
return buf
} else {
return buf.slice(ta.byteOffset, ta.byteOffset + ta.byteLength)
}
}
module.exports = function (data, asBuffer) {
if (data instanceof Uint8Array) {
return asBuffer ? ta2buf(data) : ta2str(data)
} else if (data instanceof ArrayBuffer) {
return asBuffer ? Buffer.from(data) : ab2str(data)
} else {
return asBuffer ? Buffer.from(String(data)) : String(data)
}
}
| 23.466667 | 66 | 0.645833 |
a798b4c3e5e4506b64e3565704d0e2e9f565a0b7 | 1,884 | js | JavaScript | src/components/Pokecard/colors.js | raonemota/pokedex | 83a67ea196d137a45109b3edb3f0be2f42e27b53 | [
"MIT"
] | null | null | null | src/components/Pokecard/colors.js | raonemota/pokedex | 83a67ea196d137a45109b3edb3f0be2f42e27b53 | [
"MIT"
] | null | null | null | src/components/Pokecard/colors.js | raonemota/pokedex | 83a67ea196d137a45109b3edb3f0be2f42e27b53 | [
"MIT"
] | null | null | null | import { lighten, darken } from "polished";
// SETUP COLORS
const PRIMARY = {
grass: {
back: '#08a045',
border: darken(0.1, '#08a045'),
title: lighten(0.4, '#08a045')
},
fire: {
back: '#ED3237',
border: darken(0.1, '#ED3237'),
title: lighten(0.4, '#ED3237')
},
water: {
back: '#334195',
border: darken(0.1, '#334195'),
title: lighten(0.4, '#334195')
},
fairy: {
back: '#ffc0cb',
border: darken(0.1, '#ffc0cb'),
title: lighten(0.4, '#ffc0cb')
},
normal: {
back: '#f1dac4',
border: darken(0.1, '#f1dac4'),
title: lighten(0.4, '#f1dac4')
},
bug: {
back: '#f6d6a7',
border: darken(0.1, '#f6d6a7'),
title: lighten(0.4, '#f6d6a7')
},
poison: {
back: '#a69cac',
border: darken(0.1, '#a69cac'),
title: lighten(0.4, '#a69cac')
},
electric: {
back: '#ffd972',
border: darken(0.1, '#ffd972'),
title: lighten(0.4, '#ffd972')
},
ghost: {
back: '#5c164e',
border: darken(0.1, '#5c164e'),
title: lighten(0.4, '#5c164e')
},
rock: {
back: '#945151',
border: darken(0.1, '#945151'),
title: lighten(0.4, '#945151')
},
ice: {
back: '#26dbeb',
border: darken(0.1, '#26dbeb'),
title: lighten(0.4, '#26dbeb')
},
fighting: {
back: '#eb6826',
border: darken(0.1, '#eb6826'),
title: lighten(0.4, '#eb6826')
},
psychic: {
back: '#db4dcf',
border: darken(0.1, '#db4dcf'),
title: lighten(0.4, '#db4dcf')
},
ground: {
back: '#b5835c',
border: darken(0.1, '#b5835c'),
title: lighten(0.4, '#b5835c')
},
dragon: {
back: '#3218d9',
border: darken(0.1, '#3218d9'),
title: lighten(0.4, '#3218d9')
}
};
export default PRIMARY; | 22.698795 | 43 | 0.480361 |
a79982af8b044005887421e29bd846737c873d2e | 347 | js | JavaScript | resources/assets/js/test.js | ikiranis/sport-data | 7d9059f26c32292ea85ba262a41acc33081360b3 | [
"MIT"
] | null | null | null | resources/assets/js/test.js | ikiranis/sport-data | 7d9059f26c32292ea85ba262a41acc33081360b3 | [
"MIT"
] | null | null | null | resources/assets/js/test.js | ikiranis/sport-data | 7d9059f26c32292ea85ba262a41acc33081360b3 | [
"MIT"
] | null | null | null | Vue.component('todo-item', {
props: ['todo'],
template: '<li>{{ todo.text }}</li>'
});
let myApp = new Vue({
el: '#testVue',
data: {
groceryList: [
{ id: 0, text: 'Vegetables' },
{ id: 1, text: 'Cheese' },
{ id: 2, text: 'Whatever else humans are supposed to eat' }
]
}
}); | 21.6875 | 71 | 0.455331 |
a79997d0d8350579f42bb3cf43083f034be574f6 | 777 | js | JavaScript | modules/tasks/client/services/tasks.client.service.js | sujeethk/skat | 19c2a54e1ab5f63dc8ed7ca15507f218792f5061 | [
"MIT"
] | 2 | 2016-10-18T00:18:33.000Z | 2017-08-01T10:45:10.000Z | modules/tasks/client/services/tasks.client.service.js | sujeethk/skat | 19c2a54e1ab5f63dc8ed7ca15507f218792f5061 | [
"MIT"
] | null | null | null | modules/tasks/client/services/tasks.client.service.js | sujeethk/skat | 19c2a54e1ab5f63dc8ed7ca15507f218792f5061 | [
"MIT"
] | 1 | 2016-10-18T00:18:41.000Z | 2016-10-18T00:18:41.000Z | //Tasks service used to communicate Tasks REST endpoints
(function () {
'use strict';
angular
.module('tasks')
.factory('TasksService', TasksService);
TasksService.$inject = ['$resource'];
function TasksService($resource) {
return $resource('api/plans/:planId/tasks/:taskId', {
taskId: '@_id',
planId: '@planId'
}, {
update: {
method: 'PUT',
params: {
taskId: '@_id',
planId: '@parent._id'
}
},
save: {
method: 'POST',
params: {
taskId: '@_id',
planId: '@parent._id'
}
},
remove: {
method: 'DELETE',
params: {
taskId: '@_id',
planId: '@parent._id'
}
}
});
}
})();
| 19.425 | 57 | 0.468468 |
a799bcd5a6b5b7212f3e91f0396e5bdd4c7dd29a | 1,080 | js | JavaScript | subgenerator/index.js | daniel-dx/generator-dx-generator | 4b266463ec0f2603358103e9d3044bd791412028 | [
"MIT"
] | 1 | 2016-10-07T01:34:15.000Z | 2016-10-07T01:34:15.000Z | subgenerator/index.js | daniel-dx/generator-dx-generator | 4b266463ec0f2603358103e9d3044bd791412028 | [
"MIT"
] | null | null | null | subgenerator/index.js | daniel-dx/generator-dx-generator | 4b266463ec0f2603358103e9d3044bd791412028 | [
"MIT"
] | null | null | null | 'use strict';
const path = require('path');
const Generator = require('yeoman-generator');
const superb = require('superb');
module.exports = class extends Generator {
constructor(args, opts) {
super(args, opts);
this.argument('name', {
type: String,
required: true,
description: 'Generator name'
});
}
writing() {
const generatorName = this.fs.readJSON(this.destinationPath('package.json')).name;
this.fs.copyTpl(
this.templatePath('index.js'),
this.destinationPath(path.join('generators', this.options.name, 'index.js')),
{
// Escape apostrophes from superb to not conflict with JS strings
superb: superb.random().replace("'", "\\'"),
generatorName
}
);
this.fs.copy(
this.templatePath('templates/**'),
this.destinationPath(path.join('generators', this.options.name, 'templates'))
);
this.fs.copyTpl(
this.templatePath('__tests__/subgenerator.js'),
this.destinationPath(`__tests__/${this.options.name}.js`),
this.options
);
}
};
| 26.341463 | 86 | 0.62963 |
a79aa4170553d3641fe540ba4fabfc82dc3d441d | 3,124 | js | JavaScript | src/components/bosons/InfiniteScroll/InfiniteScroll.test.js | Yoonit-Labs/vue-yoonit-components | 58835663c1f0b6afdefe6b89f8cb84ba4e7be881 | [
"MIT"
] | 1 | 2022-02-23T16:19:55.000Z | 2022-02-23T16:19:55.000Z | src/components/bosons/InfiniteScroll/InfiniteScroll.test.js | Yoonit-Labs/vue-yoonit-components | 58835663c1f0b6afdefe6b89f8cb84ba4e7be881 | [
"MIT"
] | 2 | 2021-11-06T06:35:38.000Z | 2022-02-28T04:26:09.000Z | src/components/bosons/InfiniteScroll/InfiniteScroll.test.js | Yoonit-Labs/vue-yoonit-components | 58835663c1f0b6afdefe6b89f8cb84ba4e7be881 | [
"MIT"
] | null | null | null | /**
* ██╗ ██╗ ██████╗ ██████╗ ███╗ ██╗██╗████████╗
* ╚██╗ ██╔╝██╔═══██╗██╔═══██╗████╗ ██║██║╚══██╔══╝
* ╚████╔╝ ██║ ██║██║ ██║██╔██╗ ██║██║ ██║
* ╚██╔╝ ██║ ██║██║ ██║██║╚██╗██║██║ ██║
* ██║ ╚██████╔╝╚██████╔╝██║ ╚████║██║ ██║
* ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═╝
*
* https://yoonit.dev - about@yoonit.dev
*
* Vue Yoonit Components
* VueJS Atomic Design System framework
*
* Vitória Costa, Tiago Brito, Fernando Junior, Sabrina Sampaio, Gabriel Mule, Gabriel Moraes, Gabriel Rizzo & Luigui Delyer @ 2020-2021
*/
import { shallowMount } from '@vue/test-utils'
import YooInfiniteScroll from '@/components/bosons/InfiniteScroll/InfiniteScroll.vue'
import PropsConfig from '@/components/bosons/InfiniteScroll/InfiniteScroll.config'
const classBlock = 'yoo-infinite'
const SlotText = 'Default Slot Text'
const mountComponent = () => {
return shallowMount(YooInfiniteScroll, {
slots: { default: SlotText },
propsData: {
isReady: true,
showLoading: true
}
})
}
describe('YooInfiniteScroll Component', () => {
let wrapper
beforeEach(() => {
const observe = jest.fn()
window.IntersectionObserver = jest.fn(function () {
this.observe = observe
})
wrapper = mountComponent()
})
it('Matches Snapshot', () => {
expect(wrapper).toMatchSnapshot()
})
it('Loads the Component HTML', () => {
expect(wrapper.find('.yoo-infinite').exists()).toBe(true)
})
describe('Props', () => {
describe('loadingFill', () => {
it('Has a valid default value', () => {
expect(PropsConfig.loadingFill.options.includes(YooInfiniteScroll.props.loadingFill.default)).toBe(true)
})
PropsConfig.loadingFill.options.forEach(loadingFill => {
it(`Includes loadingFill class: .${classBlock}__loader--${loadingFill}`, async () => {
await wrapper.setProps({ loadingFill })
expect(wrapper.find(`.${classBlock}__loader--${loadingFill}`).exists()).toBe(true)
})
})
})
describe('loadingSize', () => {
it('Has a valid default value', () => {
expect(PropsConfig.loadingSize.options.includes(YooInfiniteScroll.props.loadingSize.default)).toBe(true)
})
PropsConfig.loadingSize.options.forEach(loadingSize => {
it(`Includes loadingSize class: .${classBlock}__loader--${loadingSize}`, async () => {
await wrapper.setProps({ loadingSize })
expect(wrapper.find(`.${classBlock}__loader--${loadingSize}`).exists()).toBe(true)
})
})
})
}) // describe Props
describe('Events', () => {
describe('Check emit method', () => {
it('Emitted true intersecting', async () => {
wrapper.vm.callbackObserver([{ isIntersecting: true }])
expect(wrapper.emitted('intersecting')).toEqual([[true]])
})
})
describe('Check emit method', () => {
it('Emitted false intersecting', async () => {
wrapper.vm.callbackObserver([{ isIntersecting: false }])
expect(wrapper.emitted('intersecting')).toEqual(undefined)
})
})
}) // describe Events
})
| 33.591398 | 136 | 0.572663 |
a79abb8fce632cd3c70b97d73d97d99075b05ebe | 65,490 | js | JavaScript | react-app/src/components/Map.js | nithincspnr/marche | 193a1309e1bfc8334a2a6fa7a3e80845790e8357 | [
"MIT"
] | null | null | null | react-app/src/components/Map.js | nithincspnr/marche | 193a1309e1bfc8334a2a6fa7a3e80845790e8357 | [
"MIT"
] | null | null | null | react-app/src/components/Map.js | nithincspnr/marche | 193a1309e1bfc8334a2a6fa7a3e80845790e8357 | [
"MIT"
] | null | null | null | import React, { useEffect } from "react";
export default function Map({ activeStates }) {
useEffect(() => {
if (activeStates.length === 0) {
// Clears existing selections on Map
const statePaths = document.getElementsByClassName("state")[0].childNodes;
statePaths.forEach((element) => (element.style.fill = "#fcdaa9"));
}
// Sets selected states
activeStates.forEach((state) => {
if (document.getElementsByClassName(state)?.[0]) {
document.getElementsByClassName(state)[0].style.fill = "#F59200";
}
});
}, [activeStates]);
return (
<div className="map">
<svg xmlns="http://www.w3.org/2000/svg" width="959" height="593">
<title>Blank map of the United States, territories not included</title>
<g className="state">
<path
className="al"
d="m 643,467.4 .4,-7.3 -.9,-1.2 -1.7,-.7 -2.5,-2.8 .5,-2.9 48.8,-5.1 -.7,-2.2 -1.5,-1.5 -.5,-1.4 .6,-6.3 -2.4,-5.7 .5,-2.6 .3,-3.7 2.2,-3.8 -.2,-1.1 -1.7,-1 v -3.2 l -1.8,-1.9 -2.9,-6.1 -12.9,-45.8 -45.7,4 1.3,2 -1.3,67 4.4,33.2 .9,-.5 1.3,.1 .6,.4 .8,-.1 2,-3.8 v -2.3 l 1.1,-1.1 1.4,.5 3.4,6.4 v .9 l -3.3,2.2 3.5,-.4 4.9,-1.6 z"
>
<title>Alabama</title>
</path>
<path
className="ak"
d="m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5 70.4,105 -.9,2.1 1.3,3.4 1.4,1.8 1.2,5.8 2.3,2.5 .4,1.9 -1.3,1.3 -4.8,1.7 -2.4,3.6 -1.6,7 -2.4,3.2 -1.6,.3 -1.1,6.9 1.1,1.6 1.8,.2 1,1.6 -.8,2.4 -3,2.2 -2.2,-.1 z"
>
<title>California</title>
</path>
<path
className="co"
d="m 374.6,323.3 -16.5,-1 -51.7,-4.8 -52.6,-6.5 11.5,-88.3 44.9,5.7 37.5,3.4 33.1,2.4 -1.4,22.1 z"
>
<title>Colorado</title>
</path>
<path
className="ct"
d="m 873.5,178.9 .4,-1.1 -3.2,-12.3 -.1,-.3 -14.9,3.4 v .7 l -.9,.3 -.5,-.7 -10.5,2.4 2.8,16.3 1.8,1.5 -3.5,3.4 1.7,2.2 5.4,-4.5 1.7,-1.3 h .8 l 2.4,-3.1 1.4,.1 2.9,-1.1 h 2.1 l 5.3,-2.7 2.8,-.9 1,-1 1.5,.5 z"
>
<title>Connecticut</title>
</path>
<path
className="de"
d="m 822.2,226.6 -1.6,.3 -1.5,1.1 -1.2,2.1 7.6,27.1 10.9,-2.3 -2.2,-7.6 -1.1,.5 -3.3,-2.6 -.5,-1.7 -1.8,-1 -.2,-3.7 -2.1,-2.2 -1.1,-.8 -1.2,-1.1 -.4,-3.2 .3,-2.1 1,-2.2 z"
>
<title>Delaware</title>
</path>
<path
className="fl"
d="m 751.7,445.1 -4,-.7 -1.7,-.9 -2.2,1.4 v 2.5 l 1.4,2.1 -.5,4.3 -2.1,.6 -1,-1.1 -.6,-3.2 -50.1,3.3 -3.3,-6 -48.8,5.1 -.5,2.9 2.5,2.8 1.7,.7 .9,1.2 -.4,7.3 -1.1,.6 .5,.4 1,-.3 .7,-.8 10.5,-2.7 9.2,-.5 8.1,1.9 8.5,5 2.4,.8 2.2,2 -.1,2.7 h 2.4 l 1.9,-1 2.5,.1 2,-.8 2.9,-2 3.1,-2.9 1.1,-.4 .6,.5 h 1.4 l .5,-.8 -.5,-1.2 -.6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-.8 l -1.1,-1.4 2.9,-5.4 h 1.9 l 1.5,-1.2 -.3,-5.2 3.1,-4.5 1.8,-.6 -.5,-3.1 38.3,-2.6 1.3,2 -1.3,67 4.4,33.2 z"
>
<title>Mississippi</title>
</path>
<path
className="mo"
d="m 555.3,248.9 -1.1,-1.1 -.6,-1.6 -1.7,-1.3 -14.3,.8 -27.2,1.2 -25.9,-.1 1.3,1.3 -.3,1.4 2.1,3.7 3.9,6.3 2.9,3 2,.6 .9,-1 1.5,2.1 -.1,1.2 -2.7,2.6 -.5,2.3 2.5,2.5 2.6,4.7 3.2,.7 .5,48.1 .2,10.8 39.1,-.7 39.8,-2 1.6,2.5 v 2.2 l -1.7,1.5 -2.8,5.1 11.2,-.8 1,-2 1.2,-.5 v -.7 l -1.2,-1.1 -.6,-1 1.7,.2 .8,-.7 -1.4,-1.5 1.4,-.5 .1,-1 -.6,-1 v -1.3 l -.7,-.7 .2,-1 h 1.1 l .7,.7 -.3,1 .8,.7 .8,-1 1,-2.7 1.4,.9 .7,-.4 1.2,-4.1 -1,-1 1,-2 .2,-.9 -1.3,-.8 h -2.8 l -1.4,-1.5 -1.8,-3.8 v -1.9 l .8,-.6 .1,-1.3 -1.7,-1.9 -.9,-2.5 -2.7,-4.1 -4.8,-1.3 -7.4,-7.1 -.4,-2.4 2.8,-7.6 -.4,-1.9 1.2,-1.1 v -1.3 l -2.8,-1.5 -3,-.7 -3.4,1.2 -1.3,-2.3 .6,-1.9 -.7,-2.4 -8.6,-8.4 -2.2,-1.5 -2.5,-5.9 -1.2,-5.4 1.4,-3.7 z"
>
<title>Missouri</title>
</path>
<path
className="mt"
d="m 247,130.5 57.3,7.9 51,5.3 2,-20.7 5.2,-66.7 -53.5,-5.6 -54.3,-7.7 -65.9,-12.5 -4.8,22 3.7,7.4 -1.6,4.8 3.6,4.8 1.9,.7 3.9,8.3 v 2.1 l 2.3,3 h .9 l 1.4,2.1 h 3.2 v 1.6 l -7.1,17 -.5,4.1 1.4,.5 1.6,2.6 2.8,-1.4 3.6,-2.4 1.9,1.9 .5,2.5 -.5,3.2 2.5,9.7 2.6,3.5 2.3,1.4 .4,3 v 4.1 l 2.3,2.3 1.6,-2.3 6.9,1.6 2.1,-1.2 9,1.7 2.8,-3.3 1.8,-.6 1.2,1.8 1.6,4.1 .9,.1 z"
>
<title>Montana</title>
</path>
<path
className="ne"
d="m 402.5,191.1 38,1.6 3.4,3.2 1.7,.2 2.1,2 1.8,-.1 1.8,-2 1.5,.6 1,-.7 .7,.5 .9,-.4 .7,.4 .9,-.4 1,.5 1.4,-.6 2,.6 .6,1.1 6.1,2.2 1.2,1.3 .9,2.6 1.8,.7 1.5,-.2 .5,.9 v 2.3 l .6,1.7 v 1.4 l 1.3,3.7 2.2,4.3 .2,3.7 2.8,5 .4,6.1 1.3,.7 -.2,2.9 .8,3.3 -.7,2.2 1.8,4.4 1.3,1.3 -.3,1.4 2.1,3.7 3.9,6.3 h -32.4 l -43.7,-1.2 -36,-2 1.4,-22.1 -33.1,-2.4 3.7,-44.2 z"
>
<title>Nebraska</title>
</path>
<path
className="nv"
d="m 167.6,296.8 -3.4,17.5 -2.4,2.9 h -2 l -1.2,-2.7 -3.7,-1.4 -3.5,.6 -1,13.6 .5,4.9 -.5,2.9 -1.4,3 -70.4,-105 -1.1,-3.5 16.4,-63.1 47,11.2 24.4,5.4 23.3,4.7 z"
>
<title>Nevada</title>
</path>
<path
className="nh"
d="m 862.6,93.6 -1.3,.1 -1,-1.1 -1.9,1.4 -.5,6.1 1.2,2.3 -1.1,3.5 2.1,2.8 -.4,1.7 .1,1.3 -1.1,2.1 -1.4,.4 -.6,1.3 -2.1,1 -.7,1.5 1.4,3.4 -.5,2.5 .5,1.5 -1,1.9 .4,1.9 -1.3,1.9 .2,2.2 -.7,1.1 .7,4.5 .7,1.5 -.5,2.6 .9,1.8 -.2,2.5 -.5,1.3 -.1,1.4 2.1,2.6 18.4,-3.8 1,-1.5 .3,-1.7 1.9,-.6 .5,-1.1 1.7,-1.1 1.3,.3 .8,-4.8 -2.3,-1.4 -.8,-2.2 -3.2,-2 -.6,-4 -11.9,-36.8 z"
>
<title>New Hampshire</title>
</path>
<path
className="nj"
d="m 842.5,195.4 -14.6,-4.9 -1.8,2.5 .1,2.2 -3,5.4 1.5,1.8 -.7,2 -1,1 .5,3.6 2.7,.9 1,2.8 2.1,1.1 4.2,3.2 -3.3,2.6 -1.6,2.3 -1.8,3 -1.6,.6 -1.4,1.7 -1,2.2 -.3,2.1 .8,.9 .4,2.3 1.2,.6 2.4,1.5 1.8,.8 1.6,.8 .1,1.1 .8,.1 1.1,-1.2 .8,.4 2.1,.2 -.2,2.9 .2,2.5 1.8,-.7 1.5,-3.9 1.6,-4.8 2.9,-2.8 .6,-3.5 -.6,-1.2 1.7,-2.9 v -1.2 l -.7,-1.1 1.2,-2.7 -.3,-3.6 -.6,-8.2 -1.2,-1.4 v 1.4 l .5,.6 h -1.1 l -.6,-.4 -1.3,-.2 -.9,.6 -1.2,-1.6 .7,-1.7 v -1 l 1.7,-.7 .8,-2.1 z"
>
<title>New Jersey</title>
</path>
<path
className="nm"
d="m 357.5,332.9 h -.8 l -7.9,99.3 -31.8,-2.6 -34.4,-3.6 -.3,3 2,2.2 -30.8,-4.1 -1.4,10.2 -15.7,-2.2 17.4,-124.1 52.6,6.5 51.7,4.8 z"
>
<title>New Mexico</title>
</path>
<path
className="ny"
d="m 872.9,181.6 -1.3,.1 -.5,1 z m -30.6,22.7 .7,.6 1.3,-.3 1.1,.3 .9,-1.3 h 1.9 l 2.4,-.9 5.1,-2.1 -.5,-.5 -1.9,.8 -2,.9 .2,-.8 2.6,-1.1 .8,-1 1.2,.1 4.1,-2.3 v .7 l -4.2,3 4.5,-2.8 1.7,-2.2 1.5,-.1 4.5,-3.1 3.2,-3.1 3,-2.3 1,-1.2 -1.7,-.1 -1,1.2 -.2,.7 -.9,.7 -.8,-1.1 -1.7,1 -.1,.9 -.9,-.2 .5,-.9 -1.2,-.7 -.6,.9 .9,.3 .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.8,2.1 z"
>
<title>North Carolina</title>
</path>
<path
className="nd"
d="m 464.7,68.6 -1.1,2.8 .8,1.4 -.3,5.1 -.5,1.1 2.7,9.1 1.3,2.5 .7,14 1,2.7 -.4,5.8 2.9,7.4 .3,5.8 -.1,2.1 -29.5,-.4 -46,-2.1 -39.2,-2.9 5.2,-66.7 44.5,3.4 55.3,1.6 z"
>
<title>North Dakota</title>
</path>
<path
className="oh"
d="m 685.7,208.8 1.9,-.4 3,1.3 2.1,.6 .7,.9 h 1 l 1,-1.5 1.3,.8 h 1.5 l -.1,1 -3.1,.5 -2,1.1 1.9,.8 1.6,-1.5 2.4,-.4 2.2,1.5 1.5,-.1 2.5,-1.7 3.6,-2.1 5.2,-.3 4.9,-5.9 3.8,-3.1 9.3,-5.1 4.9,29.9 -2.2,1.2 1.4,2.1 -.1,2.2 .6,2 -1.1,3.4 -.1,5.4 -1,3.6 .5,1.1 -.4,2.2 -1.1,.5 -2,3.3 -1.8,2 h -.6 l -1.8,1.7 -1.3,-1.2 -1.5,1.8 -.3,1.2 h -1.3 l -1.3,2.2 .1,2.1 -1,.5 1.4,1.1 v 1.9 l -1,.2 -.7,.8 -1,.5 -.6,-2.1 -1.6,-.5 -1,2.3 -.3,2.2 -1.1,1.3 1.3,3.6 -1.5,.8 -.4,3.5 h -1.5 l -3.2,1.4 -1.2,-2.1 -3.5,-1.4 -.8,-2.9 -.5,-.8 -3.4,1.8 -.6,1.7 h -.9 l -1.3,.7 -1.2,-.8 -3,-.8 -1.9,.8 v 1 l -2.2,-.2 -1.9,-2.1 -2.3,.2 -4.1,-.7 v -1 l -2.2,-3.4 -2.9,-1.2 -1.9,.8 -2.2,-.1 -1.3,-.5 -6.6,-57.2 21.4,-3.5 z"
>
<title>Ohio</title>
</path>
<path
className="ok"
d="m 501.5,398.6 -4.6,-3.8 -2.2,-.9 -.5,1.6 -5.1,.3 -.6,-1.5 -5,2.5 -1.6,-.7 -3.7,.3 -.6,1.7 -3.6,.9 -1.3,-1.2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.7 1.2,2.9 z"
>
<title>Oregon</title>
</path>
<path
className="pa"
d="m 826.3,189.4 -1.9,.3 -3,-2.2 -3,-5.8 h -2 l -.4,-1.5 -1.7,-1.1 -70.5,13.9 -.8,-6 -4.2,3.4 -.9,.1 -2.7,3 -3.3,1.7 4.9,29.9 3.2,19.7 17.4,-2.9 60.5,-11.8 1.2,-2.1 1.5,-1.1 1.6,-.3 1.6,.6 1.4,-1.7 1.6,-.6 1.8,-3 1.6,-2.3 3.3,-2.6 -4.2,-3.2 -2.1,-1.1 -1,-2.8 -2.7,-.9 -.5,-3.6 1,-1 .7,-2 -1.5,-1.8 3,-5.4 -.1,-2.2 1.8,-2.5 z"
>
<title>Pennsylvania</title>
</path>
<path
className="ri"
d="m 883.2,170.7 -1.3,-1.1 -2.6,-1.3 -.6,-2.2 h -.8 l -.7,-2.6 -6.5,2 3.2,12.3 -.4,1.1 .4,1.8 5.6,-3.6 .1,-3 -.8,-.8 .4,-.6 -.1,-1.3 -.9,-.7 1.2,-.4 -.9,-1.6 1.8,.7 .3,1.4 .7,1.2 -1.4,-.8 1.1,1.7 -.3,1.2 -.6,-1.1 v 2.5 l .6,-.9 .4,.9 1.3,-1.5 -.2,-2.5 1.4,3.1 1,-.9 z m -4.7,12.2 h .9 l .5,-.6 -.8,-1.3 -.7,.7 z"
>
<title>Rhode Island</title>
</path>
<path
className="sc"
d="m 772.3,350.2 -19.7,2.8 -.1,-2.6 -3.3,-3 -1.2,1.5 -.7,-.3 .2,-1.4 -.4,-.5 -23.2,2.2 -7.3,4.3 -1.3,.1 -4.4,1.9 -.1,1.9 -1.9,1 -1.4,3.2 .2,1.3 6.1,3.8 2.6,-.3 3.1,4 .4,1.7 4.2,5.1 2.6,1.7 1.4,.2 2.2,1.6 1.1,2.2 2,1.6 1.8,.5 2.7,2.7 .1,1.4 2.6,2.8 5,2.3 3.6,6.7 .3,2.7 3.9,2.1 2.5,4.8 .8,3.1 4.2,.4 .8,-1.5 h .6 l 1.8,-1.5 .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3 -.5,.1 -1.5,1.6 .2,.5 1.5,-.6 v -.6 l .9,-.3 z m 1.6,-1.1 -1,.3 -.2,.7 .9,-.1 z m -1.3,-1.6 -.2,.9 h 1.7 l .6,-.4 .1,-1 z m 2.8,-3 -.3,1.9 1.2,-.5 .1,-1.4 z m 58.3,31.9 -2,.3 -.4,1.3 1.3,1.7 z"
>
<title>Wisconsin</title>
</path>
<path
className="wy"
d="m 355.3,143.7 -51,-5.3 -57.3,-7.9 -2,10.7 -8.5,54.8 -3.3,21.9 32.1,4.8 44.9,5.7 37.5,3.4 3.7,-44.2 z"
>
<title>Wyoming</title>
</path>
<path
className="dc"
d="m 803.5,252 -2.6,-1.8 -1,1.7 .5,.4 .4,.1 .6,.5 .3,.7 -.1,.5 .2,.5 z"
>
<title>District of Columbia</title>
</path>
</g>
<g className="borders" fill="none">
<path
className="al-fl"
d="m 687.6,447.4 -48.8,5.1 -.5,2.9 2.5,2.8 1.7,.7 .9,1.2 -.4,7.3 -1.1,.6"
/>
<path
className="al-ga"
d="m 666.6,361.1 12.9,45.8 2.9,6.1 1.8,1.9 v 3.2 l 1.7,1 .2,1.1 -2.2,3.8 -.3,3.7 -.5,2.6 2.4,5.7 -.6,6.3 .5,1.4 1.5,1.5 .7,2.2"
/>
<path className="al-ms" d="m 620.9,365.1 1.3,2 -1.3,67 4.4,33.2" />
<path className="al-tn" d="m 620.9,365.1 45.7,-4" />
<path className="ar-la" d="m 516.7,414.2 52.3,-1.3" />
<path
className="ar-mo"
d="m 591.7,344.9 -11.2,.8 2.8,-5.1 1.7,-1.5 v -2.2 l -1.6,-2.5 -39.8,2 -39.1,.7"
/>
<path
className="ar-ms"
d="m 569,412.9 1.2,-1.5 .5,-3 -1.5,-2.3 -.5,-2.2 .9,-.7 v -.8 l -1.7,-1.1 -.1,-.7 1.6,-.9 -1.2,-1.1 1.7,-7.1 3.4,-1.6 0,-.8 -1.1,-1.4 2.9,-5.4 h 1.9 l 1.5,-1.2 -.3,-5.2 3.1,-4.5 1.8,-.6 -.5,-3.1"
/>
<path className="ar-ok" d="m 507.9,400.5 .7,-39 -4.1,-24.4" />
<path
className="ar-tn"
d="m 582.6,367.7 1.6,-.7 .9,-2.2 1.2,.5 .7,-1 -.8,-.7 .3,-1.5 -1.1,-.9 .6,-1 -.1,-1.5 -1.1,-.1 .8,-.8 1.3,.8 .3,-1.4 -.4,-1.1 .1,-.7 2,.6 -.4,-1.5 1.6,-1.3 -.5,-.9 -1.1,.1 -.6,-.9 .9,-.9 1.6,-.2 .5,-.8 1.4,-.2 -.1,-.8 -.9,-.9 0,-.5 h 1.5 l .4,-.7 -1.4,-1 -.1,-.6"
/>
<path
className="ar-tx"
d="m 507.9,400.5 2.6,2.3 2.8,-1.3 3.2,.8 .2,11.9"
/>
<path
className="az-ca"
d="m 149,338.1 -.9,2.1 1.3,3.4 1.4,1.8 1.2,5.8 2.3,2.5 .4,1.9 -1.3,1.3 -4.8,1.7 -2.4,3.6 -1.6,7 -2.4,3.2 -1.6,.3 -1.1,6.9 1.1,1.6 1.8,.2 1,1.6 -.8,2.4 -3,2.2 -2.2,-.1"
/>
<path className="az-nm" d="m 253.8,311 -17.4,124.1" />
<path
className="az-nv"
d="m 167.6,296.8 -3.4,17.5 -2.4,2.9 h -2 l -1.2,-2.7 -3.7,-1.4 -3.5,.6 -1,13.6 .5,4.9 -.5,2.9 -1.4,3"
/>
<path className="az-ut" d="m 167.6,296.8 46.2,8.2 40,6" />
<path
className="ca-nv"
d="m 93.9,166.5 -16.4,63.1 1.1,3.5 70.4,105"
/>
<path className="ca-or" d="m 27.8,147.9 66.1,18.6" />
<path className="co-ks" d="m 379.4,256.3 -4.8,67" />
<path className="co-ne" d="m 347.7,231.8 33.1,2.4 -1.4,22.1" />
<path className="co-nm" d="m 253.8,311 52.6,6.5 51.7,4.8" />
<path className="co-ok" d="m 358.1,322.3 16.5,1" />
<path className="co-ut" d="m 265.3,222.7 -11.5,88.3" />
<path className="co-wy" d="m 265.3,222.7 44.9,5.7 37.5,3.4" />
<path
className="ct-ma"
d="m 843.8,171.3 10.5,-2.4 .5,.7 .9,-.3 0,-.7 14.9,-3.4 .1,.3"
/>
<path
className="ct-ny"
d="m 846.6,194.7 -1.7,-2.2 3.5,-3.4 -1.8,-1.5 -2.8,-16.3"
/>
<path className="ct-ri" d="m 870.7,165.5 3.2,12.3 -.4,1.1 .4,1.8" />
<path className="dc-md" d="m 801.8,254.6 1.7,-2.6 -2.6,-1.8 -1,1.7" />
<path
className="dc-va"
d="m 799.9,251.9 .5,.4 .4,.1 .6,.5 .3,.7 -.1,.5 .2,.5"
/>
<path className="de-md" d="m 817.9,230.1 7.6,27.1 10.9,-2.3" />
<path className="de-nj" d="m 823.8,227.2 -1,2.2 -.3,2.1" />
<path
className="de-pa"
d="m 817.9,230.1 1.2,-2.1 1.5,-1.1 1.6,-.3 1.6,.6"
/>
<path
className="fl-ga"
d="m 687.6,447.4 3.3,6 50.1,-3.3 .6,3.2 1,1.1 2.1,-.6 .5,-4.3 -1.4,-2.1 v -2.5 l 2.2,-1.4 1.7,.9 4,.7 3.6,-.3"
/>
<path className="ga-nc" d="m 689.5,358.2 21.4,-3" />
<path
className="ga-sc"
d="m 710.9,355.2 -.1,1.9 -1.9,1 -1.4,3.2 .2,1.3 6.1,3.8 2.6,-.3 3.1,4 .4,1.7 4.2,5.1 2.6,1.7 1.4,.2 2.2,1.6 1.1,2.2 2,1.6 1.8,.5 2.7,2.7 .1,1.4 2.6,2.8 5,2.3 3.6,6.7 .3,2.7 3.9,2.1 2.5,4.8 .8,3.1 4.2,.4"
/>
<path className="ga-tn" d="m 666.6,361.1 22.9,-2.9" />
<path
className="ia-il"
d="m 556.8,249.7 .7,-.7 .1,-2.3 -.7,-.9 1,-1.5 1.8,-.6 .9,-.3 1,-1.2 0,-2.4 1.7,-2.4 .5,-.5 .1,-3.5 -.9,-1.4 -1,-.3 -1.1,-1.6 1,-4 3,-.8 h 2.4 l 4.2,-1.8 1.7,-2.2 .1,-2.4 1.1,-1.3 1.3,-3.2 -.1,-2.6 -2.8,-3.5 -1.2,0 -.9,-1.1 .2,-1.6 -1.7,-1.7 -2.5,-1.3 .5,-.6"
/>
<path className="ia-mn" d="m 473.6,182 28.2,0 36.3,-.9 18.6,-.7" />
<path
className="ia-mo"
d="m 484.5,246.8 25.9,.1 27.2,-1.2 14.3,-.8 1.7,1.3 .6,1.6 1.1,1.1 1.5,.8"
/>
<path
className="ia-ne"
d="m 484.5,246.8 -1.8,-4.4 .7,-2.2 -.8,-3.3 .2,-2.9 -1.3,-.7 -.4,-6.1 -2.8,-5 -.2,-3.7 -2.2,-4.3 -1.3,-3.7 v -1.4 l -.6,-1.7 v -2.3 l -.5,-.9"
/>
<path
className="ia-sd"
d="m 473.5,204.2 -.7,-1.7 -.3,-1.3 -1.3,-1.2 1,-4.3 1.7,-5.1 -.7,-2 -1.3,-.4 -.4,-1.6 1,-.5 .1,-1.1 -1.3,-1.5 .1,-1.6 2.2,.1"
/>
<path
className="ia-wi"
d="m 567.2,202 -1.3,-2.8 -3.3,-.7 -2.7,-1.5 -2,-5.5 .1,-2.5 1.6,-3.3 -.6,-1.1 -2.1,-1.6 -.2,-2.6"
/>
<path
className="id-mt"
d="m 188.8,30.5 -4.8,22 3.7,7.4 -1.6,4.8 3.6,4.8 1.9,.7 3.9,8.3 v 2.1 l 2.3,3 h .9 l 1.4,2.1 h 3.2 v 1.6 l -7.1,17 -.5,4.1 1.4,.5 1.6,2.6 2.8,-1.4 3.6,-2.4 1.9,1.9 .5,2.5 -.5,3.2 2.5,9.7 2.6,3.5 2.3,1.4 .4,3 v 4.1 l 2.3,2.3 1.6,-2.3 6.9,1.6 2.1,-1.2 9,1.7 2.8,-3.3 1.8,-.6 1.2,1.8 1.6,4.1 .9,.1"
/>
<path className="id-nv" d="m 140.9,177.7 24.4,5.4 23.3,4.7" />
<path
className="id-or"
d="m 140.9,177.7 8.5,-37.3 2.9,-5.8 .4,-2.1 .8,-.9 -.9,-2 -2.9,-1.2 .2,-4.2 4,-5.8 2.5,-.8 1.6,-2.3 -.1,-1.6 1.8,-1.6 3.2,-5.5 4.2,-4.8 -.5,-3.2 -3.5,-3.1 -1.6,-3.6"
/>
<path className="id-ut" d="m 236.5,196 -47.9,-8.2" />
<path className="id-wa" d="m 174.6,27.5 -12.7,56.1 .7,4 -1.1,4.3" />
<path className="id-wy" d="m 245,141.2 -8.5,54.8" />
<path
className="il-in"
d="m 619.4,215.7 4.1,50.2 -1,5.2 v 2 l 2.4,3.5 v .7 l -.3,.9 .9,1.9 -.3,2.4 -1.6,1.8 -1.3,4.2 -3.8,5.3 -.1,7 h -1 l .9,1.9"
/>
<path
className="il-ky"
d="m 599.9,322.5 -.3,-1.8 4,-3.7 6.9,3 1.5,-.3 .4,-2.4 -1.7,-1.8 .4,-3.3 1,-.5 1.2,.6 .6,-1.2 3.7,-.6 .1,-.9 -1.5,-2.2 -.1,-1.1 2.2,-2.7 v -.9"
/>
<path
className="il-mo"
d="m 599.9,322.5 -2.8,0 -1.4,-1.5 -1.8,-3.8 v -1.9 l .8,-.6 .1,-1.3 -1.7,-1.9 -.9,-2.5 -2.7,-4.1 -4.8,-1.3 -7.4,-7.1 -.4,-2.4 2.8,-7.6 -.4,-1.9 1.2,-1.1 v -1.3 l -2.8,-1.5 -3,-.7 -3.4,1.2 -1.3,-2.3 .6,-1.9 -.7,-2.4 -8.6,-8.4 -2.2,-1.5 -2.5,-5.9 -1.2,-5.4 1.4,-3.7"
/>
<path className="il-wi" d="m 567.2,202 45.9,-2.8" />
<path
className="in-ky"
d="m 618.3,302.7 1.1,.8 .6,-1 -.7,-1.7 4.6,-.5 .2,1.2 1.1,.2 .4,-.9 -.6,-1.3 .3,-.8 1.3,.8 1.7,-.4 1.7,.6 3.4,2.1 1.8,-2.8 3.5,-2.2 3,3.3 1.6,-2.1 .3,-2.7 3.8,-2.3 .2,1.3 1.9,1.2 3,-.2 1.2,-.7 .1,-3.4 2.5,-3.7 4.6,-4.4 -.1,-1.7 1.2,-3.8 2.2,1 6.7,-4.5 -.4,-1.7 -1.5,-2.1 1,-1.9"
/>
<path className="in-mi" d="m 630.9,213.2 32.4,-3.4 .1,1.4" />
<path className="in-oh" d="m 670,268.4 -6.6,-57.2" />
<path
className="ks-mo"
d="m 504.3,326.3 -.5,-48.1 -3.2,-.7 -2.6,-4.7 -2.5,-2.5 .5,-2.3 2.7,-2.6 .1,-1.2 -1.5,-2.1 -.9,1 -2,-.6 -2.9,-3"
/>
<path className="ks-ne" d="m 379.4,256.3 36,2 43.7,1.2 h 32.4" />
<path className="ks-ok" d="m 374.6,323.3 67.7,2.9 62,.1" />
<path
className="ky-mo"
d="m 596.7,333.5 1,-2.7 1.4,.9 .7,-.4 1.2,-4.1 -1,-1 1,-2 .2,-.9 -1.3,-.8 m -5.8,11.3 -.7,-.7 .2,-1 h 1.1 l .7,.7 -.3,1"
/>
<path
className="ky-oh"
d="m 670,268.4 1.3,.5 2.2,.1 1.9,-.8 2.9,1.2 2.2,3.4 v 1 l 4.1,.7 2.3,-.2 1.9,2.1 2.2,.2 v -1 l 1.9,-.8 3,.8 1.2,.8 1.3,-.7 h .9 l .6,-1.7 3.4,-1.8 .5,.8 .8,2.9 3.5,1.4 1.2,2.1"
/>
<path
className="ky-tn"
d="m 596.7,333.5 23.3,-1.5 .6,-.9 -1.2,-3.2 h 3.7 l .7,.6 22.6,-2 2.6,-.8 17.4,-1 5.2,-.8 20.5,-1.4 5.6,-1.4 m -103.6,12.7 h 1"
/>
<path
className="ky-va"
d="m 697.7,321.1 6.9,-4.2 1,-.4 .5,-1.9 1.8,-.5 1.4,-1.4 .1,-1.7 2.1,-1.3 .4,-2.2 3,-3 2.9,-1 4.9,-6.6"
/>
<path
className="ky-wv"
d="m 709.3,279.4 -.1,1.1 .6,1 -.6,3.6 1.9,1.6 .8,1.1 1,.6 -.1,.9 4.4,5.6 h 1.4 l 1.5,1.8 1.2,.3 1.4,-.1"
/>
<path
className="la-ms"
d="m 569,412.9 -.6,1.4 1.6,7.1 1.2,1 -.5,1.7 2.4,2.5 v 3.3 l -2,0 1.8,2.5 -6,8.4 -2.4,4.8 -1.7,11.9 36,-2 -.1,1.4 -1,1.4 -.9,4.6 4.8,6.8 -.3,1.3 1.2,1.8 .6,.7"
/>
<path
className="la-tx"
d="m 516.7,414.2 .5,19.9 .7,3.4 2.6,2.8 .7,5.4 3.8,4.6 .8,4.3 h 1 l -.1,7.3 -3.3,6.4 1.3,2.3 -1.3,1.5 .7,3 -.1,4.3 -2.2,3.5 -.1,.8 -1.7,1.2 1,1.8 1.2,1.1"
/>
<path
className="ma-nh"
d="m 856,152.6 18.4,-3.8 1,-1.5 .3,-1.7 1.9,-.6 .5,-1.1 1.7,-1.1 1.3,.3"
/>
<path className="ma-ny" d="m 843.8,171.3 -.7,-1 .5,-15" />
<path
className="ma-ri"
d="m 870.7,165.5 6.5,-2 .7,2.6 h .8 l .6,2.2 2.6,1.3 1.3,1.1 1.4,3"
/>
<path className="ma-vt" d="m 843.6,155.3 12.4,-2.7" />
<path className="md-pa" d="m 757.4,241.9 60.5,-11.8" />
<path
className="md-va"
d="m 822.9,269.3 -.8,.1 m 13.2,-4.3 -.6,.3 m -1.3,.2 -4.6,1.6 -.7,.8 m -28.2,-16.1 -.6,-.6 h -1 l -.6,-.1 -.4,-.4 .1,-.5 -1.7,-.6 -.8,.3 -1.2,-.1 -.7,-.7 -.5,-.2 -.2,-.7 .6,-.8 v -.9 l -1.2,-.2 -1,-.9 -.9,.1 -1.6,-.3 m 11.6,13.5 .3,-.4 -.7,-1 1,-.1 1,-.9 .4,-1.8"
/>
<path
className="md-wv"
d="m 757.4,241.9 1.7,11.4 1.8,-1.6 .9,-1.6 3.1,-3.9 2.2,.3 2.6,-3.8 1.9,1 3.3,-.4 1.7,-2.9 h 1.3 l .9,-1.4 1.4,-.3 2.2,1.6 2.6,-.4 -.2,1 .8,1.2 h .7 l .2,.7 1,.5 -.2,1.6 .9,.4"
/>
<path
className="me-nh"
d="m 881.9,138.3 -2.3,-1.4 -.8,-2.2 -3.2,-2 -.6,-4 -11.9,-36.8"
/>
<path className="mi-oh" d="m 663.4,211.2 21.4,-3.5" />
<path
className="mi-wi"
d="m 565.6,112.3 1.9,.7 3,3.8 17,3.8 1.4,1 4,.8 .7,.5 2.8,-.2 4.9,.8 1.4,1.5 -1,1 .8,.8 3.8,.7 1.2,1.2 .1,4.4 -1.3,2.8 2,.1 1,-.8 .9,.8 -1.1,3.1 1,1.6 1.2,.3"
/>
<path
className="mn-nd"
d="m 462.3,61.3 2.4,7.3 -1.1,2.8 .8,1.4 -.3,5.1 -.5,1.1 2.7,9.1 1.3,2.5 .7,14 1,2.7 -.4,5.8 2.9,7.4 .3,5.8 -.1,2.1"
/>
<path
className="mn-sd"
d="m 473.6,182 .2,-39.5 -1.5,-1.9 -2.6,-.6 -.4,-1.8 -1.7,-2.5 .3,-1.2 3.1,-1.9 .9,-2 .1,-2.2"
/>
<path
className="mn-wi"
d="m 556.7,180.4 -1.1,-4.5 -.2,-3 -2.2,-3 -2.8,-.7 -5.2,-3.6 -.6,-3.3 -6.3,-3.1 -.2,-1.3 -3.3,0 -2.2,-2.6 -2,-1.3 .7,-5.1 -.9,-1.6 .5,-5.4 1,-1.8 -.3,-2.7 -1.2,-1.3 -1.8,-.3 v -1.7 l 2.8,-5.8 5.9,-3.9 -.4,-13 .9,.4 .6,-.5 .1,-1.1 .9,-.6 1.4,1.2 .7,-.1"
/>
<path
className="mo-ne"
d="m 491.5,259.5 -3.9,-6.3 -2.1,-3.7 .3,-1.4 -1.3,-1.3"
/>
<path className="mo-ok" d="m 504.3,326.3 .2,10.8" />
<path
className="mo-tn"
d="m 591.7,344.9 1,-2 1.2,-.5 v -.7 l -1.2,-1.1 -.6,-1 1.7,.2 .8,-.7 -1.4,-1.5 1.4,-.5 .1,-1 -.6,-1 0,-1.3 m 1,0 .8,.7 .8,-1"
/>
<path className="ms-tn" d="m 582.6,367.7 38.3,-2.6" />
<path className="mt-nd" d="m 362.5,56.3 -5.2,66.7" />
<path className="mt-sd" d="m 357.3,123 -2,20.7" />
<path
className="mt-wy"
d="m 355.3,143.7 -51,-5.3 -57.3,-7.9 -2,10.7"
/>
<path
className="nc-sc"
d="m 710.9,355.2 4.4,-1.9 1.3,-.1 7.3,-4.3 23.2,-2.2 .4,.5 -.2,1.4 .7,.3 1.2,-1.5 3.3,3 .1,2.6 19.7,-2.8 24.5,17.1"
/>
<path
className="nc-tn"
d="m 731.1,317 0,5.2 -1.5,-.1 -1.4,1.2 -2.4,5.2 -2.6,-1.1 -3.5,2.5 -.7,2.1 -1.5,1.2 -.8,-.8 -.1,-1.5 -.8,-.2 -4,3.3 -.6,3.4 -4.7,2.4 -.5,1.2 -3.2,2.6 -3.6,.5 -4.6,3 -.8,4.1 -1.3,.9 -1.5,-.1 -1.4,1.3 -.1,4.9"
/>
<path
className="nc-va"
d="m 731.1,317 29.4,-3.5 39.4,-7.3 29.1,-6.1"
/>
<path className="nd-sd" d="m 357.3,123 39.2,2.9 46,2.1 29.5,.4" />
<path
className="ne-sd"
d="m 351.4,187.6 51.1,3.5 38,1.6 3.4,3.2 1.7,.2 2.1,2 1.8,-.1 1.8,-2 1.5,.6 1,-.7 .7,.5 .9,-.4 .7,.4 .9,-.4 1,.5 1.4,-.6 2,.6 .6,1.1 6.1,2.2 1.2,1.3 .9,2.6 1.8,.7 1.5,-.2"
/>
<path className="ne-wy" d="m 347.7,231.8 3.7,-44.2" />
<path
className="nh-vt"
d="m 857.9,100.1 1.2,2.3 -1.1,3.5 2.1,2.8 -.4,1.7 .1,1.3 -1.1,2.1 -1.4,.4 -.6,1.3 -2.1,1 -.7,1.5 1.4,3.4 -.5,2.5 .5,1.5 -1,1.9 .4,1.9 -1.3,1.9 .2,2.2 -.7,1.1 .7,4.5 .7,1.5 -.5,2.6 .9,1.8 -.2,2.5 -.5,1.3 -.1,1.4 2.1,2.6"
/>
<path className="nj-ny" d="m 827.9,190.5 14.6,4.9 -.4,5.9" />
<path
className="nj-pa"
d="m 823.8,227.2 1.4,-1.7 1.6,-.6 1.8,-3 1.6,-2.3 3.3,-2.6 -4.2,-3.2 -2.1,-1.1 -1,-2.8 -2.7,-.9 -.5,-3.6 1,-1 .7,-2 -1.5,-1.8 3,-5.4 -.1,-2.2 1.8,-2.5"
/>
<path className="nm-ok" d="m 358.1,322.3 -.6,10.6" />
<path
className="nm-tx"
d="m 284.3,431.2 -2,-2.2 .3,-3 34.4,3.6 31.8,2.6 7.9,-99.3 .8,0"
/>
<path className="nv-or" d="m 93.9,166.5 47,11.2" />
<path className="nv-ut" d="m 188.6,187.8 -21,109" />
<path
className="ny-pa"
d="m 827.9,190.5 -1.6,-1.1 -1.9,.3 -3,-2.2 -3,-5.8 h -2 l -.4,-1.5 -1.7,-1.1 -70.5,13.9 -.8,-6"
/>
<path
className="ny-vt"
d="m 843.6,155.3 -1.1,-1 .5,-2 -3,-14.2 -1.9,-1.5 -.9,1.6 -.9,-2.2 .8,-1.8 -3.1,-6.7 .3,-3.8 .4,-1 -.6,-2 .4,-2.2 -2.2,-2.3 -.5,-3.2 .4,-1.5 -1.4,-.9 .6,-1.9 -.8,-1.7"
/>
<path className="oh-pa" d="m 736.8,225.1 -4.9,-29.9" />
<path
className="oh-wv"
d="m 709.3,279.4 3.2,-1.4 h 1.5 l .4,-3.5 1.5,-.8 -1.3,-3.6 1.1,-1.3 .3,-2.2 1,-2.3 1.6,.5 .6,2.1 1,-.5 .7,-.8 1,-.2 v -1.9 l -1.4,-1.1 1,-.5 -.1,-2.1 1.3,-2.2 h 1.3 l .3,-1.2 1.5,-1.8 1.3,1.2 1.8,-1.7 h .6 l 1.8,-2 2,-3.3 1.1,-.5 .4,-2.2 -.5,-1.1 1,-3.6 .1,-5.4 1.1,-3.4 -.6,-2 .1,-2.2 -1.4,-2.1 2.2,-1.2"
/>
<path
className="ok-tx"
d="m 357.5,332.9 52.6,3.2 -1.4,42.7 2.7,1.3 2.5,3 1.5,.3 1.1,-1 1.2,.4 1.4,1 1.1,-1.5 2.3,1.7 .5,2.9 1.2,.7 2.3,-.1 3.5,1.9 2,-.1 1.4,-.4 2.3,2.2 2,-2.3 3.5,1.1 1.9,3 2.3,-.1 -.7,2.1 2.3,1.1 3,-2.6 2.6,1.7 1.3,-.5 .1,1.5 1.7,1.2 2.3,-2.5 1.2,.7 -.3,2 1,1.8 1.2,-.8 2.5,-4.2 1.8,2 2,.5 2.1,-.7 2,1.8 1.2,-.1 1.3,1.2 3.6,-.9 .6,-1.7 3.7,-.3 1.6,.7 5,-2.5 .6,1.5 5.1,-.3 .5,-1.6 2.2,.9 4.6,3.8 6.4,1.9"
/>
<path
className="or-wa"
d="m 161.5,91.9 -30.3,-7.3 -2.8,1 -5.4,-.9 -1.8,-.9 -1.5,1.2 -3.3,-.4 -4.5,.5 -.9,.7 -4.2,-.4 -.8,-1.6 -1.2,-.2 -4.4,1.3 -1.6,-1.1 -2.2,.8 -.2,-1.8 -2.3,-1.2 -1.5,-.2 -1,-1.1 -3,.3 -1.2,-.8 h -1.2 l -1.2,.9 -5.5,.7 -6.6,-4.2 1.1,-5.6 -.4,-4.1 -3.2,-3.7 -3.7,.1 -.4,-1.1 .4,-1.2 -.7,-.8 -1,.1"
/>
<path className="pa-wv" d="m 736.8,225.1 3.2,19.7 17.4,-2.9" />
<path className="sd-wy" d="m 351.4,187.6 3.9,-43.9" />
<path
className="tn-va"
d="m 697.7,321.1 28.9,-3.3 .2,-1 4.6,-.5 -.3,.7"
/>
<path className="ut-wy" d="m 236.5,196 -3.3,21.9 32.1,4.8" />
<path
className="va-wv"
d="m 722.7,296.9 .7,.6 -.8,1.2 1.5,.7 .1,1.5 4.4,2.3 2.3,-.1 1.9,-1.8 .8,-1.7 3,1.8 5.5,-2.4 .5,-.9 -.8,-.5 .6,-1.4 1.5,1 4.3,-3.1 .7,1.1 2.3,-2 -.1,-1.4 1.5,-1.9 -1.5,-1.2 1,-3.3 3.7,-6.3 -.4,-1.9 2.1,-2.2 -.4,-1.5 1.4,-1.7 .1,-4.7 2.3,.7 1.3,1.9 2.8,.5 1.3,-1.6 2.3,-8.5 2.4,1.1 1,-2.5 .9,-.8 1.4,-1.8 .9,-.8 .5,-2.1 1.2,-.8 -.1,-2.9 .8,-2.3 -.9,-1.6 .2,-.9 10,5.2 .5,-2.3 .4,-1.6 .4,-.7"
/>
</g>
<circle
className="state borders dccircle dc"
cx="801.6"
cy="252.1"
r="5"
>
<title>District of Columbia</title>
</circle>
<path
className="separator1"
fill="none"
d="m 215,493 v 55 l 36,45 m -251,-168 h 147 l 68,68 h 85 l 54,54 v 46"
/>
</svg>
</div>
);
}
| 94.913043 | 5,544 | 0.395175 |
a79ad5abb83e51865b805ca796dac2254f08ac59 | 351 | js | JavaScript | 4-AccessControl/1-app-roles/App/routes/todolistRoutes.js | Azure-Samples/ms-identity-javascript-nodejs-tutorial | b85e5b004546bbe432f0336bd8f562ac413b8eee | [
"MIT"
] | 9 | 2021-06-17T09:53:18.000Z | 2022-03-24T21:54:52.000Z | 4-AccessControl/1-app-roles/App/routes/todolistRoutes.js | Azure-Samples/ms-identity-javascript-nodejs-tutorial | b85e5b004546bbe432f0336bd8f562ac413b8eee | [
"MIT"
] | 10 | 2021-11-24T11:49:16.000Z | 2022-03-24T00:15:09.000Z | 4-AccessControl/1-app-roles/App/routes/todolistRoutes.js | Azure-Samples/ms-identity-javascript-nodejs-tutorial | b85e5b004546bbe432f0336bd8f562ac413b8eee | [
"MIT"
] | 9 | 2021-06-17T09:53:21.000Z | 2022-02-11T12:40:34.000Z | const express = require('express');
const todolistController = require('../controllers/todolistController');
// initialize router
const router = express.Router();
// user routes
router.get('/', todolistController.getTodos);
router.post('/', todolistController.postTodo);
router.delete('/', todolistController.deleteTodo);
module.exports = router; | 25.071429 | 72 | 0.754986 |
a79b2b4fffe43d0dcafe9375994b03aee94954b1 | 634 | js | JavaScript | packages/ckeditor5-markdown-gfm/tests/gfmdataprocessor/strikethrough.js | LoveToKnow/ckeditor5 | c8f71b9afc843267eaceea243929d56ff9b08f52 | [
"MIT"
] | 1 | 2022-01-07T07:17:31.000Z | 2022-01-07T07:17:31.000Z | packages/ckeditor5-markdown-gfm/tests/gfmdataprocessor/strikethrough.js | LoveToKnow/ckeditor5 | c8f71b9afc843267eaceea243929d56ff9b08f52 | [
"MIT"
] | 1 | 2022-03-25T23:17:15.000Z | 2022-03-25T23:17:15.000Z | packages/ckeditor5-markdown-gfm/tests/gfmdataprocessor/strikethrough.js | LoveToKnow/ckeditor5 | c8f71b9afc843267eaceea243929d56ff9b08f52 | [
"MIT"
] | null | null | null | /**
* @license Copyright (c) 2003-2022, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
import { testDataProcessor } from '../_utils/utils';
describe( 'GFMDataProcessor', () => {
describe( 'Strikethrough', () => {
it( 'should process strikethrough text', () => {
testDataProcessor(
'~deleted~',
'<p><del>deleted</del></p>'
);
} );
it( 'should process strikethrough inside text', () => {
testDataProcessor(
'This is ~deleted content~.',
'<p>This is <del>deleted content</del>.</p>'
);
} );
} );
} );
| 23.481481 | 87 | 0.611987 |
a79c63256d7112266d0473771ba212f7812b34c5 | 13,701 | js | JavaScript | server/index.js | mdshimul186/test-rtc | 1b44634bdb9c3e8e3326e4d6f13536c58372b057 | [
"MIT"
] | null | null | null | server/index.js | mdshimul186/test-rtc | 1b44634bdb9c3e8e3326e4d6f13536c58372b057 | [
"MIT"
] | null | null | null | server/index.js | mdshimul186/test-rtc | 1b44634bdb9c3e8e3326e4d6f13536c58372b057 | [
"MIT"
] | null | null | null |
const path = require('path') ;
const url = require('url') ;
const https = require('https') ;
const fs = require('fs') ;
const express = require('express') ;
const kurento = require('kurento-client') ;
const socketIO = require('socket.io') ;
const minimist = require('minimist') ;
const { Session, Register } = require('./lib');
let userRegister = new Register();
let rooms = {};
const argv = minimist(process.argv.slice(2), {
default: {
as_uri: 'https://localhost:3000',
ws_uri: 'ws://96.85.103.129:8888/kurento'
}
});
/////////////////////////// https ///////////////////////////////
const options = {
key: fs.readFileSync('./server/keys/server.key'),
cert: fs.readFileSync('./server/keys/server.crt')
};
let app = express();
let asUrl = url.parse(argv.as_uri);
let port = asUrl.port;
let server = https.createServer(options, app).listen(port, () => {
console.log('Group Call started');
console.log('Open %s with a WebRTC capable brower.', url.format(asUrl));
});
/////////////////////////// websocket ///////////////////////////////
let io = socketIO(server).path('/groupcall');
let wsUrl = url.parse(argv.ws_uri).href;
io.on('connection', socket => {
// error handle
socket.on('error', err => {
console.error(`Connection %s error : %s`, socket.id, err);
});
socket.on('disconnect', data => {
console.log(`Connection : %s disconnect`, data);
});
socket.on('message', message => {
console.log(`Connection: %s receive message`, message.id);
switch (message.id) {
case 'joinRoom':
joinRoom(socket, message, err => {
if (err) {
console.log(`join Room error ${err}`);
}
});
break;
case 'receiveVideoFrom':
receiveVideoFrom(socket, message.sender, message.sdpOffer, (err) => {
if (err) {
console.error(err);
}
});
break;
case 'leaveRoom':
leaveRoom(socket, err => {
if (err) {
console.error(err);
}
});
break;
case 'onIceCandidate':
addIceCandidate(socket, message, err => {
if (err) {
console.error(err);
}
});
break;
default:
socket.emit({id: 'error', message: `Invalid message %s. `, message});
}
});
});
/**
*
* @param {*} socket
* @param {*} roomName
*/
function joinRoom(socket, message, callback) {
getRoom(message.roomName, (error, room) => {
if (error) {
callback(error);
return;
}
join(socket, room, message.name, (err, user) => {
console.log(`join success : ${user.name}`);
if (err) {
callback(err);
return;
}
callback();
});
});
}
/**
* Get room. Creates room if room does not exists
*
* @param {string} roomName
* @param {function} callback
*/
function getRoom(roomName, callback) {
let room = rooms[roomName];
if (room == null) {
console.log(`create new room : ${roomName}`);
getKurentoClient((error, kurentoClient) => {
if (error) {
return callback(error);
}
kurentoClient.create('MediaPipeline', (error, pipeline) => {
if (error) {
return callback(error);
}
pipeline.create('Composite', (error, composite) => {
if (error) {
return callback(error);
}
room = {
name: roomName,
pipeline: pipeline,
participants: {},
kurentoClient: kurentoClient,
composite: composite
};
rooms[roomName] = room;
callback(null, room);
});
});
});
} else {
console.log(`get existing room : ${roomName}`);
callback(null, room);
}
}
/**
*
* join call room
*
* @param {*} socket
* @param {*} room
* @param {*} userName
* @param {*} callback
*/
function join(socket, room, userName, callback) {
// add user to session
let userSession = new Session(socket, userName, room.name);
// register
userRegister.register(userSession);
room.pipeline.create('WebRtcEndpoint', (error, outgoingMedia) => {
if (error) {
console.error('no participant in room');
if (Object.keys(room.participants).length === 0) {
room.pipeline.release();
}
return callback(error);
}
// else
outgoingMedia.setMaxVideoRecvBandwidth(300);
outgoingMedia.setMinVideoRecvBandwidth(100);
userSession.setOutgoingMedia(outgoingMedia);
// add ice candidate the get sent before endpoint is established
// socket.id : room iceCandidate Queue
let iceCandidateQueue = userSession.iceCandidateQueue[userSession.name];
if (iceCandidateQueue) {
while (iceCandidateQueue.length) {
let message = iceCandidateQueue.shift();
console.error(`user: ${userSession.id} collect candidate for outgoing media`);
userSession.outgoingMedia.addIceCandidate(message.candidate);
}
}
// ICE
// listener
userSession.outgoingMedia.on('OnIceCandidate', event => {
// ka ka ka ka ka
// console.log(`generate outgoing candidate ${userSession.id}`);
let candidate = kurento.register.complexTypes.IceCandidate(event.candidate);
userSession.sendMessage({
id: 'iceCandidate',
name: userSession.name,
candidate: candidate
});
});
// notify other user that new user is joing
let usersInRoom = room.participants;
for (let i in usersInRoom) {
if (usersInRoom[i].name != userSession.name) {
usersInRoom[i].sendMessage({
id: 'newParticipantArrived',
name: userSession.name
});
}
}
// send list of current user in the room to current participant
let existingUsers = [];
for (let i in usersInRoom) {
if (usersInRoom[i].name != userSession.name) {
existingUsers.push(usersInRoom[i].name);
}
}
userSession.sendMessage({
id: 'existingParticipants',
data: existingUsers,
roomName: room.name
});
// register user to room
room.participants[userSession.name] = userSession;
room.composite.createHubPort((error, hubPort) => {
if (error) {
return callback(error);
}
userSession.setHubPort(hubPort);
userSession.outgoingMedia.connect(userSession.hubPort);
//userSession.hubPort.connect(userSession.outz);
callback(null, userSession);
});
});
}
// receive video from sender
function receiveVideoFrom(socket, senderName, sdpOffer, callback) {
let userSession = userRegister.getById(socket.id);
let sender = userRegister.getByName(senderName);
getEndpointForUser(userSession, sender, (error, endpoint) => {
if (error) {
callback(error);
}
endpoint.processOffer(sdpOffer, (error, sdpAnswer) => {
console.log(`process offer from ${senderName} to ${userSession.id}`);
if (error) {
return callback(error);
}
let data = {
id: 'receiveVideoAnswer',
name: sender.name,
sdpAnswer: sdpAnswer
};
userSession.sendMessage(data);
endpoint.gatherCandidates(error => {
if (error) {
return callback(error);
}
});
return callback(null, sdpAnswer);
});
});
}
/**
*
*/
function leaveRoom(socket, callback) {
var userSession = userRegister.getById(socket.id);
if (!userSession) {
return;
}
var room = rooms[userSession.roomName];
if(!room){
return;
}
console.log('notify all user that ' + userSession.id + ' is leaving the room ' + room.name);
var usersInRoom = room.participants;
delete usersInRoom[userSession.name];
userSession.outgoingMedia.release();
// release incoming media for the leaving user
for (var i in userSession.incomingMedia) {
userSession.incomingMedia[i].release();
delete userSession.incomingMedia[i];
}
var data = {
id: 'participantLeft',
name: userSession.name
};
for (var i in usersInRoom) {
var user = usersInRoom[i];
// release viewer from this
user.incomingMedia[userSession.name].release();
delete user.incomingMedia[userSession.name];
// notify all user in the room
user.sendMessage(data);
}
// Release pipeline and delete room when room is empty
if (Object.keys(room.participants).length == 0) {
room.pipeline.release();
delete rooms[userSession.roomName];
}
delete userSession.roomName;
callback();
}
/**
* getKurento Client
*
* @param {function} callback
*/
function getKurentoClient(callback) {
kurento(wsUrl, (error, kurentoClient) => {
if (error) {
let message = `Could not find media server at address ${wsUrl}`;
return callback(`${message} . Exiting with error ${error}`);
}
callback(null, kurentoClient);
});
}
/**
* Add ICE candidate, required for WebRTC calls
*
* @param {*} socket
* @param {*} message
* @param {*} callback
*/
function addIceCandidate(socket, message, callback) {
let user = userRegister.getById(socket.id);
if (user != null) {
// assign type to IceCandidate
let candidate = kurento.register.complexTypes.IceCandidate(message.candidate);
user.addIceCandidate(message, candidate);
callback();
} else {
console.error(`ice candidate with no user receive : ${message.sender}`);
callback(new Error("addIceCandidate failed."));
}
}
/**
*
* @param {*} userSession
* @param {*} sender
* @param {*} callback
*/
function getEndpointForUser(userSession, sender, callback) {
if (userSession.name === sender.name) {
return callback(null, userSession.outgoingMedia);
}
let incoming = userSession.incomingMedia[sender.name];
if (incoming == null) {
console.log(`user : ${userSession.name} create endpoint to receive video from : ${sender.name}`);
// getRoom
getRoom(userSession.roomName, (error, room) => {
if (error) {
return callback(error);
}
// create WebRtcEndpoint for sender user
room.pipeline.create('WebRtcEndpoint', (error, incomingMedia) => {
if (error) {
if (Object.keys(room.participants).length === 0) {
room.pipeline.release();
}
return callback(error);
}
console.log(`user: ${userSession.id} successfully create pipeline`);
incomingMedia.setMaxVideoRecvBandwidth(300);
incomingMedia.setMinVideoRecvBandwidth(100);
userSession.incomingMedia[sender.name] = incomingMedia;
// add ice candidate the get sent before endpoints is establlished
let iceCandidateQueue = userSession.iceCandidateQueue[sender.name];
if (iceCandidateQueue) {
while (iceCandidateQueue.length) {
let message = iceCandidateQueue.shift();
console.log(`user: ${userSession.name} collect candidate for ${message.data.sender}`);
incomingMedia.addIceCandidate(message.candidate);
}
}
incomingMedia.on('OnIceCandidate', event => {
// ka ka ka ka ka
// console.log(`generate incoming media candidate: ${userSession.id} from ${sender.name}`);
let candidate = kurento.register.complexTypes.IceCandidate(event.candidate);
userSession.sendMessage({
id: 'iceCandidate',
name: sender.name,
candidate: candidate
});
});
sender.hubPort.connect(incomingMedia);
callback(null, incomingMedia);
});
})
} else {
console.log(`user: ${userSession.id} get existing endpoint to receive video from: ${sender.id}`);
sender.outgoingMedia.connect(incoming, error => {
if (error) {
callback(error);
}
callback(null, incoming);
});
}
}
app.use(express.static(path.join(__dirname, 'static'))); | 29.849673 | 111 | 0.524633 |
a79ca2c8d64c0f8cade504f010ded1a3ac4aee22 | 26,182 | js | JavaScript | docs/assets/js/12.bae27dac.js | joshua-s/vue-good-table | 695ea91d0ea228472c5de1663b3b0c183a635d21 | [
"MIT"
] | null | null | null | docs/assets/js/12.bae27dac.js | joshua-s/vue-good-table | 695ea91d0ea228472c5de1663b3b0c183a635d21 | [
"MIT"
] | 2 | 2022-02-14T13:54:30.000Z | 2022-02-26T02:18:26.000Z | docs/assets/js/12.bae27dac.js | joshua-s/vue-good-table | 695ea91d0ea228472c5de1663b3b0c183a635d21 | [
"MIT"
] | null | null | null | (window.webpackJsonp=window.webpackJsonp||[]).push([[12],{173:function(t,a,s){"use strict";s.r(a);var n=s(0),o=Object(n.a)({},function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("div",{staticClass:"content"},[t._m(0),t._m(1),s("p",[t._v("Sometimes you might want to customize exactly how rows are displayed in a table. Vue-good-table also supports dynamic td templates where you dictate how to display the cells. Example:")]),t._m(2),t._m(3),s("custom-row"),t._m(4),t._m(5),s("p",[t._v("Sometimes you might want to add columns to the table that are not part of your row data. Maybe before or after the other columns.")]),t._m(6),t._m(7),s("before-after-columns"),t._m(8),s("p",[t._v("Sometimes you might want to customize column headers. You can do that in the following way")]),t._m(9),t._m(10),s("p",[t._v("Sometimes you might want to customize the pagination. You can do that in the following way:")]),t._m(11),t._m(12),t._m(13)],1)},[function(){var t=this.$createElement,a=this._self._c||t;return a("h1",{attrs:{id:"customizations"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#customizations","aria-hidden":"true"}},[this._v("#")]),this._v(" Customizations")])},function(){var t=this.$createElement,a=this._self._c||t;return a("h2",{attrs:{id:"custom-row-template"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#custom-row-template","aria-hidden":"true"}},[this._v("#")]),this._v(" Custom Row Template")])},function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("div",{staticClass:"language-html extra-class"},[s("pre",{pre:!0,attrs:{class:"language-html"}},[s("code",[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("<")]),t._v("vue-good-table")]),t._v("\n "),s("span",{attrs:{class:"token attr-name"}},[t._v(":columns")]),s("span",{attrs:{class:"token attr-value"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{attrs:{class:"token punctuation"}},[t._v('"')]),t._v("columns"),s("span",{attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),s("span",{attrs:{class:"token attr-name"}},[t._v(":rows")]),s("span",{attrs:{class:"token attr-value"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{attrs:{class:"token punctuation"}},[t._v('"')]),t._v("rows"),s("span",{attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("<")]),t._v("template")]),t._v(" "),s("span",{attrs:{class:"token attr-name"}},[t._v("slot")]),s("span",{attrs:{class:"token attr-value"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{attrs:{class:"token punctuation"}},[t._v('"')]),t._v("table-row"),s("span",{attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),s("span",{attrs:{class:"token attr-name"}},[t._v("slot-scope")]),s("span",{attrs:{class:"token attr-value"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{attrs:{class:"token punctuation"}},[t._v('"')]),t._v("props"),s("span",{attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("<")]),t._v("span")]),t._v(" "),s("span",{attrs:{class:"token attr-name"}},[t._v("v-if")]),s("span",{attrs:{class:"token attr-value"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{attrs:{class:"token punctuation"}},[t._v('"')]),t._v("props.column.field == "),s("span",{attrs:{class:"token punctuation"}},[t._v("'")]),t._v("age"),s("span",{attrs:{class:"token punctuation"}},[t._v("'")]),s("span",{attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("<")]),t._v("span")]),s("span",{attrs:{class:"token style-attr language-css"}},[s("span",{attrs:{class:"token attr-name"}},[t._v(" "),s("span",{attrs:{class:"token attr-name"}},[t._v("style")])]),s("span",{attrs:{class:"token punctuation"}},[t._v('="')]),s("span",{attrs:{class:"token attr-value"}},[s("span",{attrs:{class:"token property"}},[t._v("font-weight")]),s("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" bold"),s("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{attrs:{class:"token property"}},[t._v("color")]),s("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" blue"),s("span",{attrs:{class:"token punctuation"}},[t._v(";")])]),s("span",{attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("{{props.row.age}}"),s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("</")]),t._v("span")]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" \n "),s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("</")]),t._v("span")]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("<")]),t._v("span")]),t._v(" "),s("span",{attrs:{class:"token attr-name"}},[t._v("v-else")]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n {{props.formattedRow[props.column.field]}}\n "),s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("</")]),t._v("span")]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("</")]),t._v("template")]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("</")]),t._v("vue-good-table")]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n")])])])},function(){var t=this.$createElement,a=this._self._c||t;return a("h3",{attrs:{id:"result"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#result","aria-hidden":"true"}},[this._v("#")]),this._v(" Result")])},function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("div",{staticClass:"tip custom-block"},[s("p",{staticClass:"custom-block-title"},[t._v("NOTE")]),s("ul",[s("li",[t._v("The original row object can be accessed via "),s("code",[t._v("props.row")])]),s("li",[t._v("The currently displayed table row index can be accessed via "),s("code",[t._v("props.index")]),t._v(" .")]),s("li",[t._v("The original row index can be accessed via "),s("code",[t._v("props.row.originalIndex")]),t._v(". You can then access the original row object by using "),s("code",[t._v("rows[props.row.originalIndex]")]),t._v(".")]),s("li",[t._v("The column object can be accessed via "),s("code",[t._v("props.column")])]),s("li",[t._v("You can access the formatted row data (for example - formatted date) via "),s("code",[t._v("props.formattedRow")])])])])},function(){var t=this.$createElement,a=this._self._c||t;return a("h2",{attrs:{id:"adding-custom-columns"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#adding-custom-columns","aria-hidden":"true"}},[this._v("#")]),this._v(" Adding custom columns")])},function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("div",{staticClass:"language-html extra-class"},[s("pre",{pre:!0,attrs:{class:"language-html"}},[s("code",[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("<")]),t._v("vue-good-table")]),t._v("\n "),s("span",{attrs:{class:"token attr-name"}},[t._v(":columns")]),s("span",{attrs:{class:"token attr-value"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{attrs:{class:"token punctuation"}},[t._v('"')]),t._v("columns"),s("span",{attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),s("span",{attrs:{class:"token attr-name"}},[t._v(":rows")]),s("span",{attrs:{class:"token attr-value"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{attrs:{class:"token punctuation"}},[t._v('"')]),t._v("rows"),s("span",{attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("<")]),t._v("template")]),t._v(" "),s("span",{attrs:{class:"token attr-name"}},[t._v("slot")]),s("span",{attrs:{class:"token attr-value"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{attrs:{class:"token punctuation"}},[t._v('"')]),t._v("table-row"),s("span",{attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),s("span",{attrs:{class:"token attr-name"}},[t._v("slot-scope")]),s("span",{attrs:{class:"token attr-value"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{attrs:{class:"token punctuation"}},[t._v('"')]),t._v("props"),s("span",{attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("<")]),t._v("span")]),t._v(" "),s("span",{attrs:{class:"token attr-name"}},[t._v("v-if")]),s("span",{attrs:{class:"token attr-value"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{attrs:{class:"token punctuation"}},[t._v('"')]),t._v("props.column.field == "),s("span",{attrs:{class:"token punctuation"}},[t._v("'")]),t._v("before"),s("span",{attrs:{class:"token punctuation"}},[t._v("'")]),s("span",{attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n before\n "),s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("</")]),t._v("span")]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("<")]),t._v("span")]),t._v(" "),s("span",{attrs:{class:"token attr-name"}},[t._v("v-else-if")]),s("span",{attrs:{class:"token attr-value"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{attrs:{class:"token punctuation"}},[t._v('"')]),t._v("props.column.field == "),s("span",{attrs:{class:"token punctuation"}},[t._v("'")]),t._v("after"),s("span",{attrs:{class:"token punctuation"}},[t._v("'")]),s("span",{attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n after\n "),s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("</")]),t._v("span")]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("<")]),t._v("span")]),t._v(" "),s("span",{attrs:{class:"token attr-name"}},[t._v("v-else")]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n {{props.formattedRow[props.column.field]}}\n "),s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("</")]),t._v("span")]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("</")]),t._v("template")]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("</")]),t._v("vue-good-table")]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n")])])])},function(){var t=this.$createElement,a=this._self._c||t;return a("h3",{attrs:{id:"result-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#result-2","aria-hidden":"true"}},[this._v("#")]),this._v(" Result")])},function(){var t=this.$createElement,a=this._self._c||t;return a("h2",{attrs:{id:"custom-column-headers"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#custom-column-headers","aria-hidden":"true"}},[this._v("#")]),this._v(" Custom column headers")])},function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("div",{staticClass:"language-html extra-class"},[s("pre",{pre:!0,attrs:{class:"language-html"}},[s("code",[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("<")]),t._v("vue-good-table")]),t._v("\n "),s("span",{attrs:{class:"token attr-name"}},[t._v(":columns")]),s("span",{attrs:{class:"token attr-value"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{attrs:{class:"token punctuation"}},[t._v('"')]),t._v("columns"),s("span",{attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),s("span",{attrs:{class:"token attr-name"}},[t._v(":rows")]),s("span",{attrs:{class:"token attr-value"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{attrs:{class:"token punctuation"}},[t._v('"')]),t._v("rows"),s("span",{attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("<")]),t._v("template")]),t._v(" "),s("span",{attrs:{class:"token attr-name"}},[t._v("slot")]),s("span",{attrs:{class:"token attr-value"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{attrs:{class:"token punctuation"}},[t._v('"')]),t._v("table-column"),s("span",{attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),s("span",{attrs:{class:"token attr-name"}},[t._v("slot-scope")]),s("span",{attrs:{class:"token attr-value"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{attrs:{class:"token punctuation"}},[t._v('"')]),t._v("props"),s("span",{attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("<")]),t._v("span")]),t._v(" "),s("span",{attrs:{class:"token attr-name"}},[t._v("v-if")]),s("span",{attrs:{class:"token attr-value"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{attrs:{class:"token punctuation"}},[t._v('"')]),t._v("props.column.label =="),s("span",{attrs:{class:"token punctuation"}},[t._v("'")]),t._v("Name"),s("span",{attrs:{class:"token punctuation"}},[t._v("'")]),s("span",{attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("<")]),t._v("i")]),t._v(" "),s("span",{attrs:{class:"token attr-name"}},[t._v("class")]),s("span",{attrs:{class:"token attr-value"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{attrs:{class:"token punctuation"}},[t._v('"')]),t._v("fa fa-address-book"),s("span",{attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("</")]),t._v("i")]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" {{props.column.label}}\n "),s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("</")]),t._v("span")]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("<")]),t._v("span")]),t._v(" "),s("span",{attrs:{class:"token attr-name"}},[t._v("v-else")]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n {{props.column.label}}\n "),s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("</")]),t._v("span")]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("</")]),t._v("template")]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("</")]),t._v("vue-good-table")]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n")])])])},function(){var t=this.$createElement,a=this._self._c||t;return a("h2",{attrs:{id:"custom-pagination"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#custom-pagination","aria-hidden":"true"}},[this._v("#")]),this._v(" Custom pagination")])},function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("div",{staticClass:"language-html extra-class"},[s("pre",{pre:!0,attrs:{class:"language-html"}},[s("code",[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("<")]),t._v("vue-good-table")]),t._v("\n "),s("span",{attrs:{class:"token attr-name"}},[t._v(":columns")]),s("span",{attrs:{class:"token attr-value"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{attrs:{class:"token punctuation"}},[t._v('"')]),t._v("columns"),s("span",{attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),s("span",{attrs:{class:"token attr-name"}},[t._v(":rows")]),s("span",{attrs:{class:"token attr-value"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{attrs:{class:"token punctuation"}},[t._v('"')]),t._v("rows"),s("span",{attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),s("span",{attrs:{class:"token attr-name"}},[t._v(":pagination-options")]),s("span",{attrs:{class:"token attr-value"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{attrs:{class:"token punctuation"}},[t._v('"')]),t._v("{enabled: true}"),s("span",{attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("<")]),t._v("template")]),t._v(" "),s("span",{attrs:{class:"token attr-name"}},[t._v("slot")]),s("span",{attrs:{class:"token attr-value"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{attrs:{class:"token punctuation"}},[t._v('"')]),t._v("pagination-bottom"),s("span",{attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),s("span",{attrs:{class:"token attr-name"}},[t._v("slot-scope")]),s("span",{attrs:{class:"token attr-value"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{attrs:{class:"token punctuation"}},[t._v('"')]),t._v("props"),s("span",{attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("<")]),t._v("custom-pagination")]),t._v("\n "),s("span",{attrs:{class:"token attr-name"}},[t._v(":total")]),s("span",{attrs:{class:"token attr-value"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{attrs:{class:"token punctuation"}},[t._v('"')]),t._v("props.total"),s("span",{attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),s("span",{attrs:{class:"token attr-name"}},[t._v(":pageChanged")]),s("span",{attrs:{class:"token attr-value"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{attrs:{class:"token punctuation"}},[t._v('"')]),t._v("props.pageChanged"),s("span",{attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),s("span",{attrs:{class:"token attr-name"}},[t._v(":perPageChanged")]),s("span",{attrs:{class:"token attr-value"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("=")]),s("span",{attrs:{class:"token punctuation"}},[t._v('"')]),t._v("props.perPageChanged"),s("span",{attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("</")]),t._v("custom-pagination")]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("</")]),t._v("template")]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token tag"}},[s("span",{attrs:{class:"token punctuation"}},[t._v("</")]),t._v("vue-good-table")]),s("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n")])])])},function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{attrs:{class:"token comment"}},[t._v("// within your <custom-pagination> component")]),t._v("\nprops"),s("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n pageChanged"),s("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n type"),s("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" Function"),s("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n perPageChanged"),s("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n type"),s("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" Function"),s("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{attrs:{class:"token comment"}},[t._v("// and...")]),t._v("\nmethods"),s("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{attrs:{class:"token function"}},[t._v("customPageChange")]),s("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("customCurrentPage"),s("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{attrs:{class:"token keyword"}},[t._v("this")]),s("span",{attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{attrs:{class:"token function"}},[t._v("pageChanged")]),s("span",{attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("currentPage"),s("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" customCurrentPage"),s("span",{attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{attrs:{class:"token function"}},[t._v("customPerPageChange")]),s("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("customPerPage"),s("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{attrs:{class:"token keyword"}},[t._v("this")]),s("span",{attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{attrs:{class:"token function"}},[t._v("perPageChanged")]),s("span",{attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("currentPerPage"),s("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" customPerPage"),s("span",{attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("div",{staticClass:"tip custom-block"},[s("p",{staticClass:"custom-block-title"},[t._v("NOTE")]),s("p",[t._v("You will have to implement your own pagination system:")]),s("ul",[s("li",[t._v("The total number of rows can be accessed via "),s("code",[t._v("props.total")])]),s("li",[t._v("The function to call when the current page has changed can be accessed via "),s("code",[t._v("props.pageChanged")]),t._v(".")]),s("li",[t._v("The function to call when the per page value has changed can be accessed via "),s("code",[t._v("props.perPageChanged")]),t._v(" .")])])])}],!1,null,null,null);a.default=o.exports}}]); | 26,182 | 26,182 | 0.594836 |
a79d5fe9ebe3af6f64e310051beb062bb170fc61 | 1,145 | js | JavaScript | docs/generated/oxygen-webhelp/app/nav-links/json/task_gmd_msw_yr-d46e150467.js | klaxman/datacollector | 6ebf079dcf7cadc55ded87fe0c9bc2e6b527a319 | [
"Apache-2.0"
] | null | null | null | docs/generated/oxygen-webhelp/app/nav-links/json/task_gmd_msw_yr-d46e150467.js | klaxman/datacollector | 6ebf079dcf7cadc55ded87fe0c9bc2e6b527a319 | [
"Apache-2.0"
] | null | null | null | docs/generated/oxygen-webhelp/app/nav-links/json/task_gmd_msw_yr-d46e150467.js | klaxman/datacollector | 6ebf079dcf7cadc55ded87fe0c9bc2e6b527a319 | [
"Apache-2.0"
] | null | null | null | define({"topics" : [{"title":"Kafka Consumer Maximum Batch Size","href":"datacollector\/UserGuide\/Cluster_Mode\/KafkaRequirements.html#concept_al2_cxh_cdb","attributes": {"data-id":"concept_al2_cxh_cdb",},"menu": {"hasChildren":false,},"tocID":"concept_al2_cxh_cdb-d46e150560","topics":[]},{"title":"Configuring Cluster YARN Streaming for Kafka","href":"datacollector\/UserGuide\/Cluster_Mode\/KafkaRequirements.html#task_hhk_bfv_cy","attributes": {"data-id":"task_hhk_bfv_cy",},"menu": {"hasChildren":false,},"tocID":"task_hhk_bfv_cy-d46e150582","topics":[]},{"title":"Enabling Security for Cluster YARN Streaming","href":"datacollector\/UserGuide\/Cluster_Mode\/KafkaRequirements.html#concept_bb2_m5p_tdb","attributes": {"data-id":"concept_bb2_m5p_tdb",},"menu": {"hasChildren":true,},"tocID":"concept_bb2_m5p_tdb-d46e150614","next":"concept_bb2_m5p_tdb-d46e150614",},{"title":"Configuring Cluster Mesos Streaming for Kafka","href":"datacollector\/UserGuide\/Cluster_Mode\/KafkaRequirements.html#task_kf1_fgv_cy","attributes": {"data-id":"task_kf1_fgv_cy",},"menu": {"hasChildren":false,},"tocID":"task_kf1_fgv_cy-d46e150852","topics":[]}]}); | 1,145 | 1,145 | 0.762445 |
a79dbc6e71fe949f9f8a0f3e48de009ceeec1f07 | 65 | js | JavaScript | src/layouts/embed/header/index.js | khlevon/panembed | e418638e79fe7dc0088755caba85aaf3a20a46f3 | [
"MIT"
] | 1 | 2019-07-21T18:25:16.000Z | 2019-07-21T18:25:16.000Z | src/layouts/embed/header/index.js | khlevon/panembed | e418638e79fe7dc0088755caba85aaf3a20a46f3 | [
"MIT"
] | 6 | 2021-05-08T01:16:22.000Z | 2022-02-12T17:23:42.000Z | src/layouts/embed/header/index.js | khlevon98/panembed | e418638e79fe7dc0088755caba85aaf3a20a46f3 | [
"MIT"
] | 1 | 2021-08-13T17:53:40.000Z | 2021-08-13T17:53:40.000Z | import EmbedHeader from './header';
export default EmbedHeader;
| 16.25 | 35 | 0.784615 |
a79e254eb187018e4272621e8283b1d42f697779 | 1,182 | js | JavaScript | asynchronous/src/images.js | marismarcosta/javascript-course | 5656ffcd3a97059f787ed7a25a91d31c0cb20e20 | [
"MIT"
] | null | null | null | asynchronous/src/images.js | marismarcosta/javascript-course | 5656ffcd3a97059f787ed7a25a91d31c0cb20e20 | [
"MIT"
] | null | null | null | asynchronous/src/images.js | marismarcosta/javascript-course | 5656ffcd3a97059f787ed7a25a91d31c0cb20e20 | [
"MIT"
] | null | null | null | 'use strict';
// Coding challenge #2
let currentImg;
const wait = function (seconds) {
return new Promise(resolve => {
setTimeout(resolve, seconds * 1000);
});
};
const createImage = function (imgPath) {
return new Promise((resolve, reject) => {
const imgEl = document.createElement('img');
imgEl.src = imgPath;
imgEl.addEventListener('load', () => {
document.querySelector('.images').append(imgEl);
resolve(imgEl);
});
imgEl.addEventListener('error', () => {
reject(new Error('Image not found'));
});
});
};
createImage('../images/img-1.jpg')
.then(response => {
currentImg = response;
console.log('Image 1 loaded');
return wait(2);
})
.then(() => {
currentImg.style.display = 'none';
return createImage('../images/img-2.jpg');
})
.then(response => {
currentImg = response;
console.log('Image 2 loaded');
return wait(2);
})
.then(() => {
currentImg.style.display = 'none';
return createImage('../images/img-3.jpg');
})
.then(response => {
currentImg = response;
console.log('Image 3 loaded');
return wait(2);
})
.catch(err => console.error(err));
| 22.301887 | 54 | 0.597293 |
a79f045fc3df363bef5892ac8f5af3cb8d6f7756 | 332 | js | JavaScript | js/templatemo-script.js | Cmaster-co/PopGoing | c057cd37fe480ce1ae9b3049f95de2e4b6640a15 | [
"MIT"
] | null | null | null | js/templatemo-script.js | Cmaster-co/PopGoing | c057cd37fe480ce1ae9b3049f95de2e4b6640a15 | [
"MIT"
] | null | null | null | js/templatemo-script.js | Cmaster-co/PopGoing | c057cd37fe480ce1ae9b3049f95de2e4b6640a15 | [
"MIT"
] | null | null | null |
$(document).ready(function(){
/* Mobile menu */
$('.mobile-menu-icon').click(function(){
$('.templatemo-left-nav').slideToggle();
});
/* Close the widget when clicked on close button */
$('.templatemo-content-widget .fa-times').click(function(){
$(this).parent().slideUp(function(){
$(this).hide();
});
});
}); | 22.133333 | 60 | 0.60241 |
a79f62af73e0a028dab4187cfc1f5fb3f72f0711 | 490 | js | JavaScript | src/App.js | BauTancredi/moviedb | 7dd505433a0f311a7d865c2051fc1056d8194af8 | [
"MIT"
] | null | null | null | src/App.js | BauTancredi/moviedb | 7dd505433a0f311a7d865c2051fc1056d8194af8 | [
"MIT"
] | null | null | null | src/App.js | BauTancredi/moviedb | 7dd505433a0f311a7d865c2051fc1056d8194af8 | [
"MIT"
] | null | null | null | import React from "react";
import { Provider } from "react-redux";
import Header from "./components/Header";
import RatingFilter from "./components/RatingFilter";
import MoviesContainer from "./components/MoviesContainer";
import SearchBar from "./components/SearchBar";
import store from "./store";
function App() {
return (
<Provider store={store}>
<Header />
<SearchBar />
<RatingFilter />
<MoviesContainer />
</Provider>
);
}
export default App;
| 21.304348 | 59 | 0.679592 |
a7a00096e147e17ec60ac93f50f6794095b3f7fe | 51 | js | JavaScript | src/index.js | jbwyme/persistent-queue | 935427665fbe3d5c228cd62775299421f5873a2f | [
"MIT"
] | null | null | null | src/index.js | jbwyme/persistent-queue | 935427665fbe3d5c228cd62775299421f5873a2f | [
"MIT"
] | null | null | null | src/index.js | jbwyme/persistent-queue | 935427665fbe3d5c228cd62775299421f5873a2f | [
"MIT"
] | null | null | null | import Queue from './queue';
export default Queue;
| 17 | 28 | 0.745098 |
1853d12bb5f9ca82b43abe23cb7a66079982f1d9 | 1,415 | js | JavaScript | public/assets/ckeditor/plugins/docprops/lang/pl.js | bunthoeuniskype/sarana-ecommerce | 3656362d6c264242a747621bcabeccf184f017d5 | [
"MIT"
] | null | null | null | public/assets/ckeditor/plugins/docprops/lang/pl.js | bunthoeuniskype/sarana-ecommerce | 3656362d6c264242a747621bcabeccf184f017d5 | [
"MIT"
] | null | null | null | public/assets/ckeditor/plugins/docprops/lang/pl.js | bunthoeuniskype/sarana-ecommerce | 3656362d6c264242a747621bcabeccf184f017d5 | [
"MIT"
] | 1 | 2021-01-15T11:01:55.000Z | 2021-01-15T11:01:55.000Z | /*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'docprops', 'pl', {
bgColor: 'Kolor tła',
bgFixed: 'Tło nieruchome (nieprzewijające się)',
bgImage: 'Adres URL obrazka tła',
charset: 'Kodowanie znaków',
charsetASCII: 'ASCII',
charsetCE: 'Środkowoeuropejskie',
charsetCR: 'Cyrylica',
charsetCT: 'Chińskie tradycyjne (Big5)',
charsetGR: 'Greckie',
charsetJP: 'Japońskie',
charsetKR: 'Koreańskie',
charsetOther: 'Inne kodowanie znaków',
charsetTR: 'Tureckie',
charsetUN: 'Unicode (UTF-8)',
charsetWE: 'Zachodnioeuropejskie',
chooseColor: 'Wybierz',
design: 'Projekt strony',
docTitle: 'Tytuł strony',
docType: 'Definicja typu dokumentu',
docTypeOther: 'Inna definicja typu dokumentu',
label: 'Właściwości dokumentu',
margin: 'Marginesy strony',
marginBottom: 'Dolny',
marginLeft: 'Lewy',
marginRight: 'Prawy',
marginTop: 'Górny',
meta: 'Znaczniki meta',
metaAuthor: 'Autor',
metaCopyright: 'Prawa autorskie',
metaDescription: 'Opis dokumentu',
metaKeywords: 'Słowa kluczowe dokumentu (oddzielone przecinkami)',
other: 'Inne',
previewHtml: '<p>To jest <strong>przykładowy tekst</strong>. Korzystasz z programu <a href="javascript:void(0)">CKEditor</a>.</p>',
title: 'Właściwości dokumentu',
txtColor: 'Kolor tekstu',
xhtmlDec: 'Uwzględnij deklaracje XHTML'
} );
| 32.906977 | 132 | 0.732155 |
18547c400a1dd52155d05b24dcafe4d96b500a13 | 953 | js | JavaScript | client/node_modules/react-route/lib/go.js | ghacc4me/reactjs-crud-application | 9f22493f75b5736afcf4cb9e5cdb3dc981580148 | [
"MIT"
] | 1 | 2019-04-29T14:36:51.000Z | 2019-04-29T14:36:51.000Z | client/node_modules/react-route/lib/go.js | ghacc4me/reactjs-crud-application | 9f22493f75b5736afcf4cb9e5cdb3dc981580148 | [
"MIT"
] | 2 | 2019-04-26T12:09:01.000Z | 2019-04-26T12:15:05.000Z | client/node_modules/react-route/lib/go.js | ghacc4me/reactjs-crud-application | 9f22493f75b5736afcf4cb9e5cdb3dc981580148 | [
"MIT"
] | 2 | 2019-04-26T20:13:25.000Z | 2019-06-01T17:01:18.000Z | /**
* Module Dependencies
*/
var location = require('./location');
var bus = require('./bus');
/**
* Export `Go`
*/
module.exports = Go;
/**
* Go
*/
function Go(path, state) {
if (arguments.length) {
window.history.pushState(state, null, path);
bus.emit('pushstate', path);
} else {
var params = {};
var m = match(location.pathname, params);
return m && params;
}
}
/**
* Setup the "popstate" events
*/
function onpopstate() {
var loaded = false;
if ('undefined' === typeof window) return;
if (document.readyState === 'complete') {
loaded = true;
} else {
window.addEventListener('load', function() {
setTimeout(function() {
loaded = true;
}, 0);
});
}
return function _onpopstate(e) {
if (!loaded) return;
bus.emit('popstate', location.pathname);
}
}
/**
* Start listening for the "popstate" event
*/
window.addEventListener('popstate', onpopstate());
| 16.719298 | 50 | 0.592865 |
1854f3ad1052085e4b2f19eadd53786ee8383417 | 117 | js | JavaScript | part-6/index.js | tomassundvall/node-hero | 75985427e57bcd0b4e766372b8b7b8054a47621b | [
"Apache-2.0"
] | null | null | null | part-6/index.js | tomassundvall/node-hero | 75985427e57bcd0b4e766372b8b7b8054a47621b | [
"Apache-2.0"
] | null | null | null | part-6/index.js | tomassundvall/node-hero | 75985427e57bcd0b4e766372b8b7b8054a47621b | [
"Apache-2.0"
] | null | null | null | const request = require('request-promise')
const options = {
method: 'GET',
uri: 'https://risingstack.com'
} | 19.5 | 42 | 0.649573 |
185665ea896d883e85652b8590daa7e1d7e90706 | 105 | js | JavaScript | es/SharpFilterDrama.js | eugeneilyin/mdi-norm | e9ee50f99aafa1f4dd77ffbe8c06fbdc49ec58f4 | [
"MIT"
] | 3 | 2018-11-11T01:48:20.000Z | 2019-12-02T06:13:14.000Z | es/SharpFilterDrama.js | eugeneilyin/mdi-norm | e9ee50f99aafa1f4dd77ffbe8c06fbdc49ec58f4 | [
"MIT"
] | 1 | 2019-02-21T05:59:35.000Z | 2019-02-21T21:57:57.000Z | es/SharpFilterDrama.js | eugeneilyin/mdi-norm | e9ee50f99aafa1f4dd77ffbe8c06fbdc49ec58f4 | [
"MIT"
] | null | null | null | import { FilledFilterDrama as SharpFilterDrama } from './FilledFilterDrama';
export { SharpFilterDrama }; | 52.5 | 76 | 0.8 |
1856e33e94a37d0db02c92b7a07d5f9b8e5276a6 | 11,772 | js | JavaScript | TypeScriptTetris/app.min.js | markheath/typescript-tetris | ea2285da06ca8babdd24a35522c6fd28e0db314d | [
"MIT"
] | 13 | 2016-03-02T18:53:30.000Z | 2021-08-18T21:00:31.000Z | TypeScriptTetris/app.min.js | markheath/typescript-tetris | ea2285da06ca8babdd24a35522c6fd28e0db314d | [
"MIT"
] | null | null | null | TypeScriptTetris/app.min.js | markheath/typescript-tetris | ea2285da06ca8babdd24a35522c6fd28e0db314d | [
"MIT"
] | 6 | 2016-01-14T15:41:19.000Z | 2022-01-13T06:29:55.000Z | var __extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},requestAnimFrame=function(){return window.requestAnimationFrame||window.msRequestAnimationFrame||function(n){window.setTimeout(n,1e3/60)}}(),Point=function(){function n(n,t){this.x=n;this.y=t}return n}(),Shape=function(){function n(){this.rotation=0}return n.prototype.move=function(n,t){for(var r=[],i=0;i<this.points.length;i++)r.push(new Point(this.points[i].x+n,this.points[i].y+t));return r},n.prototype.setPos=function(n){this.points=n},n.prototype.drop=function(){return this.move(0,1)},n.prototype.moveLeft=function(){return this.move(-1,0)},n.prototype.moveRight=function(){return this.move(1,0)},n.prototype.rotate=function(){throw new Error("This method is abstract");},n}(),SquareShape=function(n){function t(t){n.call(this);this.fillColor="green";var i=t/2,r=-2;this.points=[];this.points.push(new Point(i,r));this.points.push(new Point(i+1,r));this.points.push(new Point(i,r+1));this.points.push(new Point(i+1,r+1))}return __extends(t,n),t.prototype.rotate=function(){return this.points},t}(Shape),LShape=function(n){function t(t,i){n.call(this);this.leftHanded=t;this.fillColor=t?"yellow":"white";var r=i/2,u=-2;this.points=[];this.points.push(new Point(r,u-1));this.points.push(new Point(r,u));this.points.push(new Point(r,u+1));this.points.push(new Point(r+(t?-1:1),u+1))}return __extends(t,n),t.prototype.rotate=function(n){this.rotation=(this.rotation+(n?1:-1))%4;var t=[];switch(this.rotation){case 0:t.push(new Point(this.points[1].x,this.points[1].y-1));t.push(new Point(this.points[1].x,this.points[1].y));t.push(new Point(this.points[1].x,this.points[1].y+1));t.push(new Point(this.points[1].x+(this.leftHanded?-1:1),this.points[1].y+1));break;case 1:t.push(new Point(this.points[1].x+1,this.points[1].y));t.push(new Point(this.points[1].x,this.points[1].y));t.push(new Point(this.points[1].x-1,this.points[1].y));t.push(new Point(this.points[1].x-1,this.points[1].y+(this.leftHanded?-1:1)));break;case 2:t.push(new Point(this.points[1].x,this.points[1].y+1));t.push(new Point(this.points[1].x,this.points[1].y));t.push(new Point(this.points[1].x,this.points[1].y-1));t.push(new Point(this.points[1].x+(this.leftHanded?1:-1),this.points[1].y-1));break;case 3:t.push(new Point(this.points[1].x-1,this.points[1].y));t.push(new Point(this.points[1].x,this.points[1].y));t.push(new Point(this.points[1].x+1,this.points[1].y));t.push(new Point(this.points[1].x+1,this.points[1].y+(this.leftHanded?1:-1)))}return t},t}(Shape),StepShape=function(n){function t(t,i){n.call(this);this.fillColor=t?"cyan":"magenta";this.leftHanded=t;var r=i/2,u=-1;this.points=[];this.points.push(new Point(r+(t?1:-1),u));this.points.push(new Point(r,u));this.points.push(new Point(r,u-1));this.points.push(new Point(r+(t?-1:1),u-1))}return __extends(t,n),t.prototype.rotate=function(n){this.rotation=(this.rotation+(n?1:-1))%2;var t=[];switch(this.rotation){case 0:t.push(new Point(this.points[1].x+(this.leftHanded?1:-1),this.points[1].y));t.push(new Point(this.points[1].x,this.points[1].y));t.push(new Point(this.points[1].x,this.points[1].y-1));t.push(new Point(this.points[1].x+(this.leftHanded?-1:1),this.points[1].y-1));break;case 1:t.push(new Point(this.points[1].x,this.points[1].y+(this.leftHanded?1:-1)));t.push(new Point(this.points[1].x,this.points[1].y));t.push(new Point(this.points[1].x+1,this.points[1].y));t.push(new Point(this.points[1].x+1,this.points[1].y+(this.leftHanded?-1:1)))}return t},t}(Shape),StraightShape=function(n){function t(t){n.call(this);this.fillColor="blue";var i=t/2,r=-2;this.points=[];this.points.push(new Point(i,r-2));this.points.push(new Point(i,r-1));this.points.push(new Point(i,r));this.points.push(new Point(i,r+1))}return __extends(t,n),t.prototype.rotate=function(n){this.rotation=(this.rotation+(n?1:-1))%2;var t=[];switch(this.rotation){case 0:t[0]=new Point(this.points[2].x,this.points[2].y-2);t[1]=new Point(this.points[2].x,this.points[2].y-1);t[2]=new Point(this.points[2].x,this.points[2].y);t[3]=new Point(this.points[2].x,this.points[2].y+1);break;case 1:t[0]=new Point(this.points[2].x+2,this.points[2].y);t[1]=new Point(this.points[2].x+1,this.points[2].y);t[2]=new Point(this.points[2].x,this.points[2].y);t[3]=new Point(this.points[2].x-1,this.points[2].y)}return t},t}(Shape),TShape=function(n){function t(t){n.call(this);this.fillColor="red";this.points=[];var i=t/2,r=-2;this.points.push(new Point(i-1,r));this.points.push(new Point(i,r));this.points.push(new Point(i+1,r));this.points.push(new Point(i,r+1))}return __extends(t,n),t.prototype.rotate=function(n){this.rotation=(this.rotation+(n?1:-1))%4;var t=[];switch(this.rotation){case 0:t.push(new Point(this.points[1].x-1,this.points[1].y));t.push(new Point(this.points[1].x,this.points[1].y));t.push(new Point(this.points[1].x+1,this.points[1].y));t.push(new Point(this.points[1].x,this.points[1].y+1));break;case 1:t.push(new Point(this.points[1].x,this.points[1].y-1));t.push(new Point(this.points[1].x,this.points[1].y));t.push(new Point(this.points[1].x,this.points[1].y+1));t.push(new Point(this.points[1].x-1,this.points[1].y));break;case 2:t.push(new Point(this.points[1].x+1,this.points[1].y));t.push(new Point(this.points[1].x,this.points[1].y));t.push(new Point(this.points[1].x-1,this.points[1].y));t.push(new Point(this.points[1].x,this.points[1].y-1));break;case 3:t.push(new Point(this.points[1].x,this.points[1].y+1));t.push(new Point(this.points[1].x,this.points[1].y));t.push(new Point(this.points[1].x,this.points[1].y-1));t.push(new Point(this.points[1].x+1,this.points[1].y))}return t},t}(Shape),Grid=function(){function n(n,t,i,r,u){this.canvas=u;this.context=u.getContext("2d");this.blockSize=i;this.blockColor=new Array(n);this.backColor=r;this.cols=t;this.rows=n;for(var f=0;f<n;f++)this.blockColor[f]=new Array(t);this.xOffset=20;this.yOffset=20}return n.prototype.draw=function(n){this.paintShape(n,n.fillColor)},n.prototype.erase=function(n){this.paintShape(n,this.backColor)},n.prototype.paintShape=function(n,t){var i=this;n.points.forEach(function(n){return i.paintSquare(n.y,n.x,t)})},n.prototype.getPreferredSize=function(){return new Point(this.blockSize*this.cols,this.blockSize*this.rows)},n.prototype.isPosValid=function(n){for(var i=!0,t=0;t<n.length;t++){if(n[t].x<0||n[t].x>=this.cols||n[t].y>=this.rows){i=!1;break}if(n[t].y>=0&&this.blockColor[n[t].y][n[t].x]!=this.backColor){i=!1;break}}return i},n.prototype.addShape=function(n){for(var t=0;t<n.points.length;t++){if(n.points[t].y<0)return!1;this.blockColor[n.points[t].y][n.points[t].x]=n.fillColor}return!0},n.prototype.eraseGrid=function(){this.context.fillStyle=this.backColor;var n=this.cols*this.blockSize,t=this.rows*this.blockSize;this.context.fillRect(this.xOffset,this.yOffset,n,t)},n.prototype.clearGrid=function(){for(var t,n=0;n<this.rows;n++)for(t=0;t<this.cols;t++)this.blockColor[n][t]=this.backColor;this.eraseGrid()},n.prototype.paintSquare=function(n,t,i){n>=0&&(this.context.fillStyle=i,this.context.fillRect(this.xOffset+t*this.blockSize,this.yOffset+n*this.blockSize,this.blockSize-1,this.blockSize-1))},n.prototype.drawGrid=function(){for(var t,n=0;n<this.rows;n++)for(t=0;t<this.cols;t++)this.blockColor[n][t]!==this.backColor&&this.paintSquare(n,t,this.blockColor[n][t])},n.prototype.paint=function(){this.eraseGrid();this.drawGrid()},n.prototype.checkRows=function(n){for(var t,f,i=n.points[0].y,r=n.points[0].y,e,o=0,u=1;u<n.points.length;u++)n.points[u].y<i&&(i=n.points[u].y),n.points[u].y>r&&(r=n.points[u].y);for(i<0&&(i=0);r>=i;){for(e=!0,t=0;t<this.cols;t++)if(this.blockColor[r][t]==this.backColor){e=!1;break}if(e){for(o++,f=r;f>=0;f--)for(t=0;t<this.cols;t++)this.blockColor[f][t]=f>0?this.blockColor[f-1][t]:this.backColor;i++}else r--}return o>0&&(this.eraseGrid(),this.paint()),o},n}(),Game=function(){function n(){this.running=!1;this.phase=n.gameState.initial;this.scoreLabel=document.getElementById("scoreLabel");this.rowsLabel=document.getElementById("rowsLabel");this.levelLabel=document.getElementById("levelLabel");this.messageLabel=document.getElementById("floatingMessage");this.canvas=document.getElementById("gameCanvas");this.context=this.canvas.getContext("2d");this.grid=new Grid(16,10,20,"gray",this.canvas);this.grid.eraseGrid();this.speed=1e3;var t=this;document.onkeydown=function(n){t.keyhandler(n)};this.showMessage("Press F2 to start")}return n.prototype.draw=function(){this.phase==n.gameState.playing&&(this.grid.paint(),this.grid.draw(this.currentShape),requestAnimFrame(function(n){return function(){n.draw()}}(this)))},n.prototype.newGame=function(){this.messageLabel.style.display="none";this.grid.clearGrid();this.currentShape=this.newShape();this.score=0;this.rowsCompleted=0;this.score=0;this.level=-1;this.incrementLevel();this.updateLabels();this.phase=n.gameState.playing;requestAnimFrame(function(n){return function(){n.draw()}}(this))},n.prototype.updateLabels=function(){this.scoreLabel.innerText=this.score.toString();this.rowsLabel.innerText=this.rowsCompleted.toString();this.levelLabel.innerText=this.level.toString()},n.prototype.gameTimer=function(){if(this.phase==n.gameState.playing){var t=this.currentShape.drop();this.grid.isPosValid(t)?this.currentShape.setPos(t):this.shapeFinished()}},n.prototype.keyhandler=function(t){var i;if(this.phase==n.gameState.playing){switch(t.keyCode){case 39:i=this.currentShape.moveRight();break;case 37:i=this.currentShape.moveLeft();break;case 38:i=this.currentShape.rotate(!0);break;case 40:for(i=this.currentShape.drop();this.grid.isPosValid(i);)this.currentShape.setPos(i),i=this.currentShape.drop();this.shapeFinished()}switch(t.keyCode){case 39:case 37:case 38:this.grid.isPosValid(i)&&this.currentShape.setPos(i)}}t.keyCode==113?(this.newGame(),this.timerToken=setInterval(function(n){return function(){n.gameTimer()}}(this),this.speed)):t.keyCode==80?this.togglePause():t.keyCode==115&&(this.level<10&&this.phase==n.gameState.playing||this.phase==n.gameState.paused)&&(this.incrementLevel(),this.updateLabels())},n.prototype.togglePause=function(){this.phase==n.gameState.paused?(this.messageLabel.style.display="none",this.phase=n.gameState.playing,this.draw()):this.phase==n.gameState.playing&&(this.phase=n.gameState.paused,this.showMessage("PAUSED"))},n.prototype.showMessage=function(n){this.messageLabel.style.display="block";this.messageLabel.innerText=n},n.prototype.incrementLevel=function(){this.level++;this.level<10&&(this.speed=1e3-this.level*100,clearTimeout(this.timerToken),this.timerToken=setInterval(function(n){return function(){n.gameTimer()}}(this),this.speed))},n.prototype.shapeFinished=function(){if(this.grid.addShape(this.currentShape)){this.grid.draw(this.currentShape);var t=this.grid.checkRows(this.currentShape);this.rowsCompleted+=t;this.score+=t*(this.level+1)*10;this.rowsCompleted>(this.level+1)*10&&this.incrementLevel();this.updateLabels();this.currentShape=this.newShape()}else window.console&&console.log("Game over"),this.phase=n.gameState.gameover,this.showMessage("GAME OVER"),clearTimeout(this.timerToken)},n.prototype.newShape=function(){var t=Math.floor(Math.random()*7),n;switch(t){case 0:n=new LShape(!1,this.grid.cols);break;case 1:n=new LShape(!0,this.grid.cols);break;case 2:n=new TShape(this.grid.cols);break;case 3:n=new StepShape(!1,this.grid.cols);break;case 4:n=new StepShape(!0,this.grid.cols);break;case 5:n=new SquareShape(this.grid.cols);break;case 6:n=new StraightShape(this.grid.cols)}return n},n.gameState={initial:0,playing:1,paused:2,gameover:3},n}();(function(){"use strict";function n(){var n=new Game}window.addEventListener("DOMContentLoaded",n,!1)})();
/*
//# sourceMappingURL=app.min.js.map
*/ | 2,943 | 11,730 | 0.736493 |