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
c1bb62a18b9312a1d5ce06f966ad5ffc4b499b74
1,611
js
JavaScript
script.js
ScriptEdBayHackathon2k18/teamH
d30abbd0b57027e38ff1c925d28f6f60c303e82c
[ "MIT" ]
null
null
null
script.js
ScriptEdBayHackathon2k18/teamH
d30abbd0b57027e38ff1c925d28f6f60c303e82c
[ "MIT" ]
null
null
null
script.js
ScriptEdBayHackathon2k18/teamH
d30abbd0b57027e38ff1c925d28f6f60c303e82c
[ "MIT" ]
null
null
null
/* global width, height, Group, createCanvas, collideDebug, createSprite, textAlign, background, noStroke, fill, text, color, CENTER, keyCode, key, drawSprites, LEFT_ARROW, RIGHT_ARROW, hit, collideRectRect, windowHeight, windowWidth, collidePointPoint */ var maincharacter; var hit; var eighthgraders; var boyle; function setup() { createCanvas(windowWidth, windowHeight); maincharacter = createSprite( width/2, height/3, 40, 40); maincharacter.shapeColor = color(255); boyle = createSprite( width/2, height/2, 80, 80); boyle.shapeColor = color(111); eighthgraders = createSprite( width/2, height/3, 40, 40); eighthgraders.shapeColor = color(152); } function draw() { background(50); fill(255); textAlign(CENTER, CENTER); drawSprites(); hit = collideRectRect(eighthgraders.x,eighthgraders.y, maincharacter.x,maincharacter.y, 50, 50); if (hit){ print("colliding? " + hit); } } function randomWithRange(min, max){ var range = (max - min) + 1; return (Math.random() * range) + min; } function genEightGraders(count, stagger) { var eighthGraders = new Group(); var eighthGrader = createSprite(width/2, height/3, 40, 40); for(var i=0; i<count; i++) { eighthGraders.add(createSprite(width/2, height/3, randomWithRange(40), 40)); } return eighthgraders } function keyPressed() { if (keyCode == RIGHT_ARROW) { maincharacter.setSpeed(10, 0); } else if (keyCode == LEFT_ARROW) { maincharacter.setSpeed(10, 180); } else if (key == ' ') { maincharacter.setSpeed(0, 0); } return false; }
23.691176
256
0.672253
c1bc006fe90c5f923528a3badd6114b83fa02724
4,350
js
JavaScript
src/views/Departments/__tests__/Departments.test.js
mikenthiwa/travela_front
2e5dd8dc03bc114eb8f111d174eafbd37bcb5f85
[ "MIT" ]
null
null
null
src/views/Departments/__tests__/Departments.test.js
mikenthiwa/travela_front
2e5dd8dc03bc114eb8f111d174eafbd37bcb5f85
[ "MIT" ]
null
null
null
src/views/Departments/__tests__/Departments.test.js
mikenthiwa/travela_front
2e5dd8dc03bc114eb8f111d174eafbd37bcb5f85
[ "MIT" ]
null
null
null
import React from 'react'; import { Provider } from 'react-redux'; import sinon from 'sinon'; import { MemoryRouter } from 'react-router-dom'; import configureStore from 'redux-mock-store'; import { mount } from 'enzyme'; import DepartmentsView,{ Departments } from '../index'; describe('<Departments />', () => { const props = { getAllDepartments: jest.fn(), editDepartment: jest.fn(), deleteDepartment: jest.fn(), getSingleDepartment: jest.fn(), addDepartment: jest.fn(), openModal: sinon.spy(() => Promise.resolve()), closeModal: jest.fn(), shouldOpen: false, modalType: '', department: { singleDepartment: { id: 1, name: 'Operations', parentDepartment: 1, parentDepartments: { name: 'Andela', }, creator: { fullName: 'Adeniyi Adeyokunnu', }, createdBy: 1 }, isLoadingDepartment: true, pagination: { pageCount: 1, currentPage: 1, totalCount: 1 }, departments: [ { id: 1, name: 'Operations', parentDepartment: null, createdBy: 1 } ] }, location: {}, history: { push: jest.fn() }, modal: { modal: { modal: { openModal: jest.fn(), closeModal: jest.fn(), shouldOpen: false } } } }; const state = { department: { pagination: { pageCount: 1, currentPage: 1, totalCount: 1 }, errors: {}, isLoading: false }, modal: { modal: { shouldOpen: false, modalType: '' } } }; const mockStore = configureStore(); const store = mockStore (state); let wrapper; beforeEach(() => { wrapper = mount( <Departments {...props} store={store} />); }); it('renders appropriately', () => { const wrapper2 = mount( <Provider store={store}> <MemoryRouter> <DepartmentsView {...props} /> </MemoryRouter> </Provider> ); expect(wrapper2).toMatchSnapshot(); }); it('should show the create department modal', () => { wrapper.setProps({ shouldOpen: true, modalType: 'add department', department: { ...props.department, isLoadingDepartment: false}}); wrapper.find('PageHeader').find('button').simulate('click'); expect(wrapper.find('Modal').first().props().visibility).toEqual('visible'); }); it('creates a department when the create button is clicked', () => { wrapper.setProps({ shouldOpen: true, modalType: 'add department', department: { ...props.department, departments: [], isLoadingDepartment: false}}); wrapper.find('form').simulate('submit', { preventDefault: jest.fn()}); expect(props.addDepartment).toHaveBeenCalled(); }); it('should open the edit department modal', () => { wrapper.setProps({ shouldOpen: true, modalType: 'edit department', department: { ...props.department, departments: [ { id: 1, name: 'Operations', parentDepartment: 1, parentDepartments: { name: 'Andela', }, creator: { fullName: 'Adeniyi Adeyokunnu', }, createdBy: 1 }] }}); wrapper.find('MenuItem .edit').simulate('click'); expect(wrapper.find('Modal').first().props().visibility).toEqual('visible'); }); it('should open the edit department modal and edit department', () => { wrapper.setProps({ shouldOpen: true, modalType: 'edit department', department: { ...props.department, singleDepartment: { id: 1, name: 'Regle', parentDepartment: 1, parentDepartments: { name: 'Technology', }, creator: { fullName: 'Adeniyi Adeyokunnu', }, createdBy: 1 }, departments: [ { id: 1, name: 'Operations', parentDepartment: 1, parentDepartments: { name: 'Andela', }, creator: { fullName: 'Adeniyi Adeyokunnu', }, createdBy: 1 }] }}); wrapper.find('form').simulate('submit', { preventDefault: jest.fn()}); expect(props.editDepartment).toHaveBeenCalled(); }); });
25.739645
152
0.544598
c1bc118ace32952e69dc669ae9122cb052e13ebd
4,020
js
JavaScript
assets/javascript/app.js
komalpatel96/Contact-Your-Senator
dcd5a6f671b97c3d8515d7e2260964309af0f8f2
[ "MIT" ]
null
null
null
assets/javascript/app.js
komalpatel96/Contact-Your-Senator
dcd5a6f671b97c3d8515d7e2260964309af0f8f2
[ "MIT" ]
null
null
null
assets/javascript/app.js
komalpatel96/Contact-Your-Senator
dcd5a6f671b97c3d8515d7e2260964309af0f8f2
[ "MIT" ]
null
null
null
function reset(){ $("#senatorstuff").hide(); $("#senators-view").empty(); $("#senator-pics").empty(); $("#displayelection").empty(); $("#displayparty").empty(); $("#displaybirthdate").empty(); $("#mostRecentVote").empty(); $("#billsSponsered").empty(); $("#phoneNumber").empty(); $("#officeAddress").empty(); } reset(); $("#abbreviation").on("click", function(event) { event.preventDefault(); reset(); var abbr = $("#state").val().trim(); var checkstatement = false; $.ajax({ url: "https://api.propublica.org/congress/v1/members/senate/"+ abbr +"/current.json", type: "GET", beforeSend: function(xhr){xhr.setRequestHeader('X-API-Key', 'pOeVTMP0uUXsG3Gn6uAQ9AT2claobUTPM0Wse53Q');}, success: function(response){ console.log(response); if (response.status === "ERROR") { $("#senator-title").html("Please select a correct abbreviation") } for (var i = 0; i < response.results.length; i++){ var otherurl = "https://api.gettyimages.com/v3/search/images?phrase=" + response.results[i].name; var specialbutton = $("<button>"); $("#senator-title").html("Select a Senator by clicking on the Corresponding Button.") specialbutton.addClass("senators waves-effect grey darken-5 btn"); specialbutton.attr("data-api", response.results[i].api_uri); specialbutton.attr("data-nextterm", response.results[i].next_election); specialbutton.attr("data-party", response.results[i].party); specialbutton.text(response.results[i].name); $.ajax({ url: otherurl, type: "GET", headers: { 'api-key':'cgw6dcdm9svkuekgw2jrcx94' }, customButton: specialbutton, success: function(response){ var senatorImage = $("<img>"); senatorImage.attr("id", "senatorImage") senatorImage.attr("src", response.images[0].display_sizes[0].uri); $("#senator-pics").append(senatorImage); $("#senators-view").append(this.customButton); } }); } } }); }); function displaySenatorInfo(){ var url = $(this).attr("data-api"); var nextTerm = $(this).attr("data-nextterm") var party = $(this).attr("data-party") console.log(nextTerm); $("#displayelection").html("Next Election: " + nextTerm); $("#displayparty").html("Party: " + party); $("#senatorstuff").show(); $.ajax({ url: url, type: "GET", beforeSend: function(xhr){xhr.setRequestHeader('X-API-Key', 'pOeVTMP0uUXsG3Gn6uAQ9AT2claobUTPM0Wse53Q');}, success: function(response){ console.log(response); $("#website").attr("href", response.results[0].url); $("#contact").attr("href", response.results[0].roles[0].contact_form); $("#youtube").attr("href", "http://youtube.com/" + response.results[0].youtube_account); $("#recentnews").attr("href", response.results[0].times_topics_url); $("#senator-title").html("Facts About: " + response.results[0].first_name + " " + response.results[0].last_name); $("#displaybirthdate").html("Birthdate: " + response.results[0].date_of_birth); $("#mostRecentVote").html("Most recent vote: " + response.results[0].most_recent_vote); $("#billsCosponsored").html("Bill cosponsored: " + response.results[0].roles[0].bills_cosponsored); $("#billsSponsored").html("Bill sponsored: " + response.results[0].roles[0].bills_sponsored); $("#phoneNumber").html("Phone: " + response.results[0].roles[0].phone); $("#officeAddress").html("Office: " + response.results[0].roles[0].office); } }); } $(document).on("click", ".senators", displaySenatorInfo);
39.411765
128
0.568657
c1bc376ee39f397d7b292b0ebffb6dbcb18fdcbd
1,693
js
JavaScript
ajax/libs/angular-i18n/1.2.10/angular-locale_am.min.js
KZeni/cdnjs
203b064eff86919d1a3e89ea2502071c792fe5a7
[ "MIT" ]
5
2015-02-20T16:11:30.000Z
2017-05-15T11:50:44.000Z
ajax/libs/angular-i18n/1.2.10/angular-locale_am.min.js
sophiebits/cdnjs
74c2b95c5e0df14e498ea5e674303febfe3db126
[ "MIT" ]
null
null
null
ajax/libs/angular-i18n/1.2.10/angular-locale_am.min.js
sophiebits/cdnjs
74c2b95c5e0df14e498ea5e674303febfe3db126
[ "MIT" ]
4
2015-07-14T16:16:05.000Z
2021-03-10T08:15:54.000Z
"use strict";angular.module("ngLocale",[],["$provide",function(a){var b={ZERO:"zero",ONE:"one",TWO:"two",FEW:"few",MANY:"many",OTHER:"other"};a.value("$locale",{DATETIME_FORMATS:{AMPMS:["\u1321\u12cb\u1275","\u12a8\u1233\u12d3\u1275"],DAY:["\u12a5\u1211\u12f5","\u1230\u129e","\u121b\u12ad\u1230\u129e","\u1228\u1261\u12d5","\u1210\u1219\u1235","\u12d3\u122d\u1265","\u1245\u12f3\u121c"],MONTH:["\u1303\u1295\u12e9\u12c8\u122a","\u134c\u1265\u1229\u12c8\u122a","\u121b\u122d\u127d","\u12a4\u1355\u1228\u120d","\u121c\u12ed","\u1301\u1295","\u1301\u120b\u12ed","\u12a6\u1308\u1235\u1275","\u1234\u1355\u1274\u121d\u1260\u122d","\u12a6\u12ad\u1270\u12cd\u1260\u122d","\u1296\u126c\u121d\u1260\u122d","\u12f2\u1234\u121d\u1260\u122d"],SHORTDAY:["\u12a5\u1211\u12f5","\u1230\u129e","\u121b\u12ad\u1230","\u1228\u1261\u12d5","\u1210\u1219\u1235","\u12d3\u122d\u1265","\u1245\u12f3\u121c"],SHORTMONTH:["\u1303\u1295\u12e9","\u134c\u1265\u1229","\u121b\u122d\u127d","\u12a4\u1355\u1228","\u121c\u12ed","\u1301\u1295","\u1301\u120b\u12ed","\u12a6\u1308\u1235","\u1234\u1355\u1274","\u12a6\u12ad\u1270","\u1296\u126c\u121d","\u12f2\u1234\u121d"],fullDate:"EEEE, d MMMM y",longDate:"d MMMM y",medium:"d MMM y h:mm:ss a",mediumDate:"d MMM y",mediumTime:"h:mm:ss a","short":"dd/MM/yyyy h:mm a",shortDate:"dd/MM/yyyy",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"Birr",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,macFrac:0,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,macFrac:0,maxFrac:2,minFrac:2,minInt:1,negPre:"(\u00a4",negSuf:")",posPre:"\u00a4",posSuf:""}]},id:"am",pluralCat:function(c){if(c==0||c==1){return b.ONE}return b.OTHER}})}]);
1,693
1,693
0.705257
c1bc5d7757243609ab88da516a90b4b3db7d532d
1,191
js
JavaScript
ui/app/components/app/permissions-connect-header/permissions-connect-header.component.js
we4netbot/metaverse-vm-extension
1820e6004d8c9b8f0d2516068df7d79bbede3237
[ "MIT" ]
44
2019-04-15T21:03:08.000Z
2022-03-05T04:03:13.000Z
ui/app/components/app/permissions-connect-header/permissions-connect-header.component.js
we4netbot/metaverse-vm-extension
1820e6004d8c9b8f0d2516068df7d79bbede3237
[ "MIT" ]
59
2019-06-06T20:10:10.000Z
2021-11-16T13:30:02.000Z
ui/app/components/app/permissions-connect-header/permissions-connect-header.component.js
we4netbot/metaverse-vm-extension
1820e6004d8c9b8f0d2516068df7d79bbede3237
[ "MIT" ]
34
2019-06-17T21:16:17.000Z
2022-01-09T11:37:46.000Z
import PropTypes from 'prop-types' import React, { Component } from 'react' import SiteIcon from '../../ui/site-icon' export default class PermissionsConnectHeader extends Component { static propTypes = { icon: PropTypes.string, iconName: PropTypes.string.isRequired, siteOrigin: PropTypes.string.isRequired, headerTitle: PropTypes.node, headerText: PropTypes.string, } static defaultProps = { icon: null, headerTitle: '', headerText: '', } renderHeaderIcon () { const { icon, iconName, siteOrigin } = this.props return ( <div className="permissions-connect-header__icon"> <SiteIcon icon={ icon } name={ iconName } size={64} /> <div className="permissions-connect-header__text">{siteOrigin}</div> </div> ) } render () { const { headerTitle, headerText } = this.props return ( <div className="permissions-connect-header"> { this.renderHeaderIcon() } <div className="permissions-connect-header__title"> { headerTitle } </div> <div className="permissions-connect-header__subtitle"> { headerText } </div> </div> ) } }
25.891304
76
0.633921
c1bcc5bc1c45171ac79e9ec760a23f1740791840
705
js
JavaScript
gulp/config.js
IonicBrazil/ionic-garden
beae473454081431ba62262a99cda2825c5ca5bd
[ "MIT" ]
18
2015-06-24T14:25:44.000Z
2021-10-29T23:55:48.000Z
gulp/config.js
IonicBrazil/ionic-garden
beae473454081431ba62262a99cda2825c5ca5bd
[ "MIT" ]
22
2015-06-24T14:34:23.000Z
2015-12-03T14:40:19.000Z
gulp/config.js
felquis/ionic-garden
beae473454081431ba62262a99cda2825c5ca5bd
[ "MIT" ]
15
2015-06-29T03:50:08.000Z
2021-10-29T23:55:39.000Z
var src = 'src'; var dest = 'www'; var tasks = {}; tasks.common = {}; // All files path tasks.common.allHTMLFiles = src + '/*.html'; tasks.common.allJSFiles = ['src/{,*/,*/*/}*.js', '!src/lib{,/**}']; tasks.common.scriptBase = src + '/{,*/}{,*/}*.js'; tasks.common.allSCSSFiles = src + '/scss/{,*/}*.scss'; tasks.common.allStaticFiles = [src + '/**', '!'+src+'/scss{,/**}', '!'+src+'/{,*/,*/*/}*.js']; tasks.common.src = src + '/'; tasks.common.allFiles = src + '/**'; tasks.common.jsFilesHeader = ';(function () {\n\'use strict\';\n'; tasks.common.jsFilesFooter = '\n}())'; // Dest paths tasks.common.destBase = dest; tasks.common.destCSS = tasks.common.destBase + '/css/'; module.exports = tasks;
28.2
94
0.580142
c1bd3fe4f25741a0623f70adb293fe59da893203
95
js
JavaScript
server/models/index.js
chaldrich24/nft-hot-or-not
c0d9c7de3ed04a816602b4fc0884f4acd385eab7
[ "MIT" ]
null
null
null
server/models/index.js
chaldrich24/nft-hot-or-not
c0d9c7de3ed04a816602b4fc0884f4acd385eab7
[ "MIT" ]
null
null
null
server/models/index.js
chaldrich24/nft-hot-or-not
c0d9c7de3ed04a816602b4fc0884f4acd385eab7
[ "MIT" ]
null
null
null
const User = require('./User'); const Nft = require('./Nft'); module.exports = { User, Nft };
19
31
0.610526
c1bdb354057fccb141ead53afaf122c5bcc2e0bf
2,273
js
JavaScript
ui/file_manager/integration_tests/gallery/test_util.js
kjthegod/chromium
cf940f7f418436b77e15b1ea23e6fa100ca1c91a
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
1
2019-11-28T10:46:52.000Z
2019-11-28T10:46:52.000Z
ui/file_manager/integration_tests/gallery/test_util.js
kjthegod/chromium
cf940f7f418436b77e15b1ea23e6fa100ca1c91a
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
ui/file_manager/integration_tests/gallery/test_util.js
kjthegod/chromium
cf940f7f418436b77e15b1ea23e6fa100ca1c91a
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
2
2015-03-27T11:15:39.000Z
2016-08-17T14:19:56.000Z
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. 'use strict'; /** * Launches the Gallery app with the test entries. * * @param {string} testVolumeName Test volume name passed to the addEntries * function. Either 'drive' or 'local'. * @param {VolumeManagerCommon.VolumeType} volumeType Volume type. * @param {Array.<TestEntryInfo>} entries Entries to be parepared and passed to * the application. * @param {Array.<TestEntryInfo>=} opt_selected Entries to be selected. Should * be a sub-set of the entries argument. */ function launchWithTestEntries( testVolumeName, volumeType, entries, opt_selected) { var entriesPromise = addEntries([testVolumeName], entries).then(function() { var selectedEntries = opt_selected || entries; return getFilesUnderVolume( volumeType, selectedEntries.map(function(entry) { return entry.nameText; })); }); return launch(entriesPromise).then(function() { var launchedPromise = Promise.all([appWindowPromise, entriesPromise]); return launchedPromise.then(function(results) { return {appWindow: results[0], entries: results[1]}; }); }); } /** * Waits until the expected image is shown. * * @param {document} document Document. * @param {number} width Expected width of the image. * @param {number} height Expected height of the image. * @param {string} name Expected name of the image. * @return {Promise} Promsie to be fulfilled when the check is passed. */ function waitForSlideImage(document, width, height, name) { var expected = {width: width, height: height, name: name}; return repeatUntil(function() { var fullResCanvas = document.querySelector( '.gallery[mode="slide"] .content canvas.fullres'); var nameBox = document.querySelector('.namebox'); var actual = { width: fullResCanvas && fullResCanvas.width, height: fullResCanvas && fullResCanvas.height, name: nameBox && nameBox.value }; if (!chrome.test.checkDeepEq(expected, actual)) { return pending('Slide mode state, expected is %j, actual is %j.', expected, actual); } return actual; }); }
36.66129
79
0.694237
c1be52bf69329cd9d5c94d413fe3303a5ea5cb43
354
js
JavaScript
app/assets/javascripts/angularApp/directives/validations/ZipCodeRegex.js
lair001/virtual-address-book
1a61c5fe47ead87e447786299b57a41b832b34cd
[ "MIT" ]
1
2017-01-25T23:58:08.000Z
2017-01-25T23:58:08.000Z
app/assets/javascripts/angularApp/directives/validations/ZipCodeRegex.js
lair001/virtual-address-book
1a61c5fe47ead87e447786299b57a41b832b34cd
[ "MIT" ]
null
null
null
app/assets/javascripts/angularApp/directives/validations/ZipCodeRegex.js
lair001/virtual-address-book
1a61c5fe47ead87e447786299b57a41b832b34cd
[ "MIT" ]
null
null
null
(function() { angular .module('app') .directive('zipCodeRegex', [function ZipCodeRegex() { return { restrict: 'A', require: 'ngModel', link: function(scope, element, attrs, ngModel) { ngModel.$validators.zipCodeRegex = function(value) { return /^(\d{5}-\d{4}|\d{5}|)$/i.test(value); }; } }; }]); })();
15.391304
57
0.548023
c1bf525f0bbf7884926fcbd646b2600388e60c80
9,607
js
JavaScript
examples/react/build/5826764005552f7687d9.worker.js
mutebg/WorkerStore
138f4ac755a8bb4accdb8f4ec1a04d111c967710
[ "MIT" ]
35
2018-01-15T09:54:32.000Z
2021-06-22T01:38:16.000Z
examples/react/build/5826764005552f7687d9.worker.js
mutebg/WorkerStore
138f4ac755a8bb4accdb8f4ec1a04d111c967710
[ "MIT" ]
null
null
null
examples/react/build/5826764005552f7687d9.worker.js
mutebg/WorkerStore
138f4ac755a8bb4accdb8f4ec1a04d111c967710
[ "MIT" ]
2
2019-04-23T18:27:06.000Z
2020-10-28T06:39:02.000Z
!function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var r={};e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/",e(e.s=0)}([function(t,e,r){"use strict";function n(t){return function(){var e=t.apply(this,arguments);return new Promise(function(t,r){function n(o,i){try{var a=e[o](i),u=a.value}catch(t){return void r(t)}if(!a.done)return Promise.resolve(u).then(function(t){n("next",t)},function(t){n("throw",t)});t(u)}return n("next")})}}function o(t){return t<=1?1:o(t-1)+o(t-2)}Object.defineProperty(e,"__esModule",{value:!0});var i=r(1),a=r.n(i),u=r(4),c=(r.n(u),this);Object(u.runStore)({inc:function(t){return{count:t.count+1}},dec:function(t){return{count:t.count-1}},fib:function(t,e){return{count:o(e)}},delay:function(t){return new Promise(function(e,r){setTimeout(function(){return e({count:t.count+1})},2e3)})},fetchNews:function(){function t(t,r){return e.apply(this,arguments)}var e=n(a.a.mark(function t(e,r){var n,o=r.id;return a.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch("https://jsonplaceholder.typicode.com/posts/"+o);case 2:return n=t.sent,t.next=5,n.json();case 5:return t.t0=t.sent,t.abrupt("return",{news:t.t0});case 7:case"end":return t.stop()}},t,c)}));return t}(),asyncGen:a.a.mark(function t(e){var r,n;return a.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Object(u.put)({status:"loading"});case 3:return t.next=5,fetch("https://jsonplaceholder.typicode.com/posts/1");case 5:return r=t.sent,t.next=8,r.json();case 8:return n=t.sent,t.next=11,Object(u.put)({news:n});case 11:return t.next=13,Object(u.put)({status:"done"});case 13:t.next=18;break;case 15:return t.prev=15,t.t0=t.catch(0),t.abrupt("return",{status:"loaded",error:!0});case 18:case"end":return t.stop()}},t,this,[[0,15]])})})},function(t,e,r){t.exports=r(2)},function(t,e,r){var n=function(){return this}()||Function("return this")(),o=n.regeneratorRuntime&&Object.getOwnPropertyNames(n).indexOf("regeneratorRuntime")>=0,i=o&&n.regeneratorRuntime;if(n.regeneratorRuntime=void 0,t.exports=r(3),o)n.regeneratorRuntime=i;else try{delete n.regeneratorRuntime}catch(t){n.regeneratorRuntime=void 0}},function(t,e){!function(e){"use strict";function r(t,e,r,n){var i=e&&e.prototype instanceof o?e:o,a=Object.create(i.prototype),u=new p(n||[]);return a._invoke=s(t,r,u),a}function n(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}function o(){}function i(){}function a(){}function u(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function c(t){function e(r,o,i,a){var u=n(t[r],t,o);if("throw"!==u.type){var c=u.arg,s=c.value;return s&&"object"===typeof s&&m.call(s,"__await")?Promise.resolve(s.__await).then(function(t){e("next",t,i,a)},function(t){e("throw",t,i,a)}):Promise.resolve(s).then(function(t){c.value=t,i(c)},a)}a(u.arg)}function r(t,r){function n(){return new Promise(function(n,o){e(t,r,n,o)})}return o=o?o.then(n,n):n()}var o;this._invoke=r}function s(t,e,r){var o=E;return function(i,a){if(o===P)throw new Error("Generator is already running");if(o===k){if("throw"===i)throw a;return y()}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=f(u,r);if(c){if(c===N)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===E)throw o=k,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=P;var s=n(t,e,r);if("normal"===s.type){if(o=r.done?k:_,s.arg===N)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=k,r.method="throw",r.arg=s.arg)}}}function f(t,e){var r=t.iterator[e.method];if(r===d){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=d,f(t,e),"throw"===e.method))return N;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return N}var o=n(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,N;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=d),e.delegate=null,N):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,N)}function h(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function l(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function p(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(h,this),this.reset(!0)}function v(t){if(t){var e=t[x];if(e)return e.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(m.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=d,e.done=!0,e};return n.next=n}}return{next:y}}function y(){return{value:d,done:!0}}var d,g=Object.prototype,m=g.hasOwnProperty,w="function"===typeof Symbol?Symbol:{},x=w.iterator||"@@iterator",b=w.asyncIterator||"@@asyncIterator",L=w.toStringTag||"@@toStringTag",j="object"===typeof t,O=e.regeneratorRuntime;if(O)return void(j&&(t.exports=O));O=e.regeneratorRuntime=j?t.exports:{},O.wrap=r;var E="suspendedStart",_="suspendedYield",P="executing",k="completed",N={},G={};G[x]=function(){return this};var R=Object.getPrototypeOf,S=R&&R(R(v([])));S&&S!==g&&m.call(S,x)&&(G=S);var F=a.prototype=o.prototype=Object.create(G);i.prototype=F.constructor=a,a.constructor=i,a[L]=i.displayName="GeneratorFunction",O.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===i||"GeneratorFunction"===(e.displayName||e.name))},O.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,a):(t.__proto__=a,L in t||(t[L]="GeneratorFunction")),t.prototype=Object.create(F),t},O.awrap=function(t){return{__await:t}},u(c.prototype),c.prototype[b]=function(){return this},O.AsyncIterator=c,O.async=function(t,e,n,o){var i=new c(r(t,e,n,o));return O.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},u(F),F[L]="Generator",F[x]=function(){return this},F.toString=function(){return"[object Generator]"},O.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},O.values=v,p.prototype={constructor:p,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=d,this.done=!1,this.delegate=null,this.method="next",this.arg=d,this.tryEntries.forEach(l),!t)for(var e in this)"t"===e.charAt(0)&&m.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=d)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){function e(e,n){return i.type="throw",i.arg=t,r.next=e,n&&(r.method="next",r.arg=d),!!n}if(this.done)throw t;for(var r=this,n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=m.call(o,"catchLoc"),u=m.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&m.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,N):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),N},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),l(r),N}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;l(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:v(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=d),N}}}(function(){return this}()||Function("return this")())},function(t,e){function r(t){return"function"==typeof t.next&&"function"==typeof t.throw}function n(t,e){return void 0===e&&(e=!1),c=e?t:Object.assign(Object.assign({},c),t)}function o(t){var e;return(e={})[f]=t,e}function i(t){self.postMessage({state:t,action:s})}function a(t){var e=function(r){return r.value&&r.value[f]&&i(n(r.value[f])),r.done?Promise.resolve(r.value):Promise.resolve(r.value).then(function(r){return e(t.next(r))})};return e(t.next())}function u(t){var e=Object.assign({"@init":function(t,e){return e}},t);self.onmessage=function(t){return function(t){var o=t.actionName,u=t.args;s=o;var f=e[o].apply(e,[c].concat(u));"function"==typeof f&&(f=f()),f.then?f.then(function(t){i(n(t))}):r(f)?a(f):f&&i(n(f))}(t.data)}}var c,s,f="PUT";e.put=o,e.runStore=u,e.default=null}]); //# sourceMappingURL=5826764005552f7687d9.worker.js.map
4,803.5
9,551
0.694702
c1bf643e2d421a9d9f616ddaf65834b13222cf2a
728
js
JavaScript
src/Reducers/ToolsReducer.js
Gabriel-Batista/pixel-pixel
635748050ce9dcc7aee441825f769a2c9b5c3365
[ "MIT" ]
null
null
null
src/Reducers/ToolsReducer.js
Gabriel-Batista/pixel-pixel
635748050ce9dcc7aee441825f769a2c9b5c3365
[ "MIT" ]
3
2021-05-09T05:19:46.000Z
2022-02-27T09:58:00.000Z
src/Reducers/ToolsReducer.js
Gabriel-Batista/pixel-pixel
635748050ce9dcc7aee441825f769a2c9b5c3365
[ "MIT" ]
null
null
null
const eraserCursor = 'url("http://www.rw-designer.com/cursor-extern.php?id=85157"), pointer' const brushCursor = 'url("http://www.rw-designer.com/cursor-extern.php?id=95695"), pointer' const defaultState = { currentTool: 'brush', color: '#000', cursor: brushCursor } const ToolsReducer = (state= defaultState, action) => { switch(action.type) { case 'SELECT_BRUSH': return {...state, currentTool: 'brush', cursor: brushCursor} case 'SELECT_ERASER': return { ...state, currentTool: 'eraser', cursor: eraserCursor } case 'SELECT_COLOR': return {...state, color: action.payload} default: return state } } export default ToolsReducer
28
92
0.634615
c1c0c9dfd7fb7f47cffb8ddcaadf41a06f55e111
287
js
JavaScript
src/constants/starWars.js
SonerMulder/docs
c9f99558adb83c136e7d3778fad967a98477d51f
[ "MIT" ]
223
2015-01-15T19:38:54.000Z
2022-01-21T14:40:28.000Z
src/constants/starWars.js
SonerMulder/docs
c9f99558adb83c136e7d3778fad967a98477d51f
[ "MIT" ]
3,513
2015-01-02T17:18:47.000Z
2021-08-23T21:37:53.000Z
src/constants/starWars.js
SonerMulder/docs
c9f99558adb83c136e7d3778fad967a98477d51f
[ "MIT" ]
1,251
2015-01-04T05:55:28.000Z
2021-09-24T06:48:16.000Z
const STARWARS = { 'star wars': '/img/search-chewie.gif', 'darth vader': '/img/search-darth-vader.gif', 'r2d2': '/img/search-r2d2.gif', 'chewie': '/img/search-chewie.gif', 'luke skywalker': '/img/search-luke.gif', 'yoda': '/img/search-yoda.gif', }; export default STARWARS;
26.090909
47
0.644599
c1c0f5640e2f0db8053fbc5afd96fb9e39e50a9a
2,847
js
JavaScript
node_modules/redux-devtools/lib/react/JSONTree/JSONNullNode.js
toke182/react-redux-experiment
0d093a2d9e646f63ce137b9b8fbeeb1650b13c89
[ "MIT" ]
1
2017-03-10T21:18:00.000Z
2017-03-10T21:18:00.000Z
node_modules/redux-devtools/lib/react/JSONTree/JSONNullNode.js
Lukkub/Redux-ShopCartApp
ff10fa6e6f592fd0ffa276376665829514bd8f61
[ "MIT" ]
null
null
null
node_modules/redux-devtools/lib/react/JSONTree/JSONNullNode.js
Lukkub/Redux-ShopCartApp
ff10fa6e6f592fd0ffa276376665829514bd8f61
[ "MIT" ]
null
null
null
'use strict'; exports.__esModule = true; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _reactMixin = require('react-mixin'); var _reactMixin2 = _interopRequireDefault(_reactMixin); var _mixins = require('./mixins'); var _utilsHexToRgb = require('../../utils/hexToRgb'); var _utilsHexToRgb2 = _interopRequireDefault(_utilsHexToRgb); var styles = { base: { paddingTop: 3, paddingBottom: 3, paddingRight: 0, marginLeft: 14 }, label: { display: 'inline-block', marginRight: 5 } }; var JSONNullNode = (function (_React$Component) { _inherits(JSONNullNode, _React$Component); function JSONNullNode() { _classCallCheck(this, _JSONNullNode); _React$Component.apply(this, arguments); } JSONNullNode.prototype.render = function render() { var backgroundColor = 'transparent'; if (this.props.previousValue !== this.props.value) { var bgColor = _utilsHexToRgb2['default'](this.props.theme.base06); backgroundColor = 'rgba(' + bgColor.r + ', ' + bgColor.g + ', ' + bgColor.b + ', 0.1)'; } return _react2['default'].createElement( 'li', { style: _extends({}, styles.base, { backgroundColor: backgroundColor }), onClick: this.handleClick.bind(this) }, _react2['default'].createElement( 'label', { style: _extends({}, styles.label, { color: this.props.theme.base0D }) }, this.props.keyName, ':' ), _react2['default'].createElement( 'span', { style: { color: this.props.theme.base08 } }, 'null' ) ); }; var _JSONNullNode = JSONNullNode; JSONNullNode = _reactMixin2['default'].decorate(_mixins.SquashClickEventMixin)(JSONNullNode) || JSONNullNode; return JSONNullNode; })(_react2['default'].Component); exports['default'] = JSONNullNode; module.exports = exports['default'];
35.5875
424
0.671233
c1c14d93d266a4d51180b4534f81580ff418a9ba
28,808
js
JavaScript
Client.js
itsurka/api-baas-js
f387b545d59e2694ff43f0d1cc62da738cda6e75
[ "MIT" ]
null
null
null
Client.js
itsurka/api-baas-js
f387b545d59e2694ff43f0d1cc62da738cda6e75
[ "MIT" ]
null
null
null
Client.js
itsurka/api-baas-js
f387b545d59e2694ff43f0d1cc62da738cda6e75
[ "MIT" ]
null
null
null
const axios = require('axios'); const sha256 = require('js-sha256').sha256; const queryString = require('query-string'); const crypto = require('crypto'); const _ = require('lodash/core'); module.exports = class Client { /** * @param {string} partnerId * @param {string} token * @param {string} baseUrl */ constructor(partnerId, token, baseUrl = null) { this.partnerId = partnerId; this.token = token; this.baseUrl = baseUrl ? baseUrl : `https://baas_test.talkbank.io/api/v1`; this.urlLocation = this.getLocation(this.baseUrl); this.config = { method: "", url: "", headers: { Authorization: "", date: "", host: this.urlLocation.host, 'Content-Type': 'application/json' }, }; } // Create signature using HMAC. getSignature(config, query, url) { // Create hmac instance from your token const hmac = crypto.createHmac("sha256", this.token); // Join white list headers (date, tb-content-sha256) into a single string const headers = config.headers; const header = [ `date:${headers.date}`.trim(), `tb-content-sha256:${headers['tb-content-sha256']}`.trim() ]; const headerString = header.join('\n'); // Create a string from hmac encoding let string = `${config.method.toUpperCase()}\n`; string = `${string}/api/v1${url.trim()}\n${query.trim()}\n${headerString.trim()}\n${headers['tb-content-sha256'].trim()}`; hmac.write(string); hmac.end(); // Return Authorization header signature const signature = hmac.read().toString('hex'); return `TB1-HMAC-SHA256 ${this.partnerId}:${signature}`; } /** * Create axios request. Url = '', data = {} * * @param {string} url * @param {string} method * @param {object|null} data * @param {object|null} query * @param {object|null} options * @returns {Promise} */ createRequest(url, method = 'GET', data = null, query = null, options = null) { const config = _.clone(this.config); if (options && options.rewriteUri) { config.url = `${this.urlLocation.protocol}//${this.urlLocation.host}${url}`; } else { config.url = `${this.baseUrl}${url}`; } query = queryString.stringify(query); if (query) { config.url = `${this.url}?${query}`; } const hasBody = data && Object.keys(data).length > 0 && (method === 'POST' || method === 'PUT'); if (hasBody) { data = JSON.stringify(data); config.data = data; } config.method = method; config.headers.date = new Date().toUTCString(); config.headers['tb-content-sha256'] = hasBody ? sha256(data) : sha256(''); config.headers.Authorization = this.getSignature(config, query, url); return axios(config); } // Account Methods /** * Get account balance from bank * * GET /balance * * @returns {Promise} */ accountBalance() { return this.createRequest('/balance', 'GET'); } /** * @deprecated Synonym of the method accountBalance(), use this one instead * @returns {Promise} */ getAccountBalance() { return this.accountBalance(); } /** * Get account history * * GET /transactions * * @returns {Promise} */ accountTransactions() { return this.createRequest('/transactions', 'GET'); } /** * Transactions history from the bank account. * * @param {string|null} dateFrom * @param {string|null} dateTo * @param {string|null} bank * @param {string|null} limit * @param {string|null} page * @returns {Promise} */ getAccountHistory(dateFrom = null, dateTo = null, bank = null, limit = null, page = null) { const query = {}; if (bank) data.bank = bank; if (limit) data.limit = limit; if (page) data.page = page; if (dateFrom) data.dateFrom = dateFrom; if (dateTo) data.dateTo = dateTo; return this.createRequest('/transactions', 'GET', null, query); } /** * Get transactions for all partner's cards * * GET /cards-transactions * * @param {string} fromDate * @param {string} toDate * @param {int} page * @param {int} limit * @returns {Promise} */ accountCardsTransactions(fromDate, toDate, page = 1, limit = 1000) { const query = this.filterData({ fromDate: fromDate, toDate: toDate, page: page, limit: limit }); return this.createRequest('/cards-transactions', 'GET', null, query); } /** * Get card history * * GET /clients/{client_id}/cards/{barcode}/transactions * * @param {string} clientId * @param {string} barcode * @param {string|null} dateFrom Datetime with timezone * @param {string|null} dateTo Datetime with timezone * @param {int|null} limit * @param {int|null} page * @returns {Promise} */ cardTransactions(clientId, barcode, dateFrom = null, dateTo = null, limit = null, page = null) { const query = this.filterData({ dateFrom: dateFrom, dateTo: dateTo, limit: limit, page: page, }); return this.createRequest(`/clients/${clientId}/cards/${barcode}/transactions`, 'GET', null, query); } /** * @deprecated Synonym of the method cardTransactions(), use this one instead */ getCardHistory(clientId, ean, dateFrom = null, dateTo = null, limit = null, page = null) { return this.cardTransactions(clientId, ean, dateFrom, dateTo, limit, page); } /** * Get client's cards * * GET /clients/{client_id}/cards * * @param {string} clientId * @returns {Promise} */ cardList(clientId) { return this.createRequest(`/clients/${clientId}/cards`); } /** * @deprecated Synonym of the method cardList(), use this one instead */ getClientsCards(clientId) { return this.cardList(clientId); } /** * Get card details * * GET /api/v1/clients/{client_id}/cards/{barcode} * * @param {string} clientId * @param {string} barcode * @return {Promise} */ cardDetails(clientId, barcode) { return this.createRequest(`/clients/${clientId}/cards/${barcode}`); } /** * @deprecated Synonym of the method cardDetails(), use this one instead */ getCardInfo(clientId, ean) { return this.cardDetails(clientId, ean); } /** * Get direct transaction's status, this is alias for `payment_status` * * GET /api/v1/clients/{client_id}/cards/{barcode}/{order_id} * * @param {string} clientId * @param {string} barcode * @param {string} orderId * @returns {Promise} */ cardOrderStatus(clientId, barcode, orderId) { return this.createRequest(`/clients/${clientId}/cards/${barcode}/${orderId}`); } // Card Methods /** * Get card balance * * GET /clients/{client_id}/cards/{barcode}/balance * * @param clientId * @param barcode * @returns {Promise} */ cardBalance(clientId, barcode) { return this.createRequest(`/clients/${clientId}/cards/${barcode}/balance`); } /** * @deprecated Synonym of the method cardBalance(), use this one instead */ getCardBalance(clientId, ean) { return this.cardBalance(clientId, ean); } /** * Get card status * * GET /api/v1/clients/{client_id}/cards/{barcode}/lock * * @param clientId * @param barcode */ cardLockStatus(clientId, barcode) { return this.createRequest(`/clients/${clientId}/cards/${barcode}/lock`); } /** * Block the card * * POST /api/v1/clients/{client_id}/cards/{barcode}/lock * * @param {string} clientId * @param {string} barcode * @param {string|null} reason */ cardLock(clientId, barcode, reason = null) { const data = this.filterData({ reason: reason }); return this.createRequest(`/clients/${clientId}/cards/${barcode}/lock`, 'POST', data); } /** * @deprecated Synonym of the method cardLock(), use this one instead */ blockCard(clientId, ean, reason = null) { return this.cardLock(clientId, ean, reason); } /** * Unblock the card * * DELETE /api/v1/clients/{client_id}/cards/{barcode}/lock * * @param {string} clientId * @param {string} barcode * @returns {Promise} */ cardUnlock(clientId, barcode) { return this.createRequest(`/clients/${clientId}/cards/${barcode}/lock`, 'DELETE'); } /** * @deprecated Synonym of the method cardUnlock(), use this one instead */ unblockCard(clientId, ean) { return this.cardUnlock(clientId, ean); } /** * Create virtual card * * POST /clients/{client_id}/virtual-cards * * @param {string} clientId * @returns {Promise} */ cardActivateVirtual(clientId) { return this.createRequest(`/clients/${clientId}/virtual-cards`, 'POST'); } /** * @deprecated Synonym of the method cardActivateVirtual(), use this one instead */ createVirtualCard(clientId) { return this.cardActivateVirtual(clientId); } /** * Activate card * * POST /api/v1/clients/{client_id}/cards/{barcode}/activate * * @param {string} clientId * @param {string} barcode * @returns {Promise} */ cardActivate(clientId, barcode) { return this.createRequest(`/clients/${clientId}/cards/${barcode}/activate`, 'POST'); } /** * @deprecated Synonym of the method cardActivate(), use this one instead */ activateCard(clientId, ean) { return this.cardActivate(clientId, ean); } /** * Get card activation status * * GET /api/v1/clients/{client_id}/cards/{barcode}/activation * * @param {string} clientId * @param {string} barcode * @returns {Promise} */ cardActivation(clientId, barcode) { return this.createRequest(`/clients/${clientId}/cards/${barcode}/activation`); } /** * @deprecated Synonym of the method cardActivation(), use this one instead */ getActivationStatus(clientId, ean) { return this.cardActivation(clientId, ean); } /** * Sending a CVV on the client's phone * * GET /api/v1/clients/{client_id}/cards/{barcode}/security-code * * @param {string} clientId * @param {string} barcode * @return {Promise} */ cardCvv(clientId, barcode) { return this.createRequest(`/clients/${clientId}/cards/${barcode}/security-code`); } /** * @deprecated Synonym of the method cardCvv(), use this one instead */ getSecurityCode(clientId, ean) { return this.cardCvv(clientId, ean); } /** * Get cardholder data * * GET /api/v1/clients/{client_id}/cards/{barcode}/cardholder/data * * @param {string} clientId * @param {string} barcode * @returns {Promise} */ cardCardholderData(clientId, barcode) { return this.createRequest(`/clients/${clientId}/cards/${barcode}/cardholder/data`); } /** * Get card limits * * GET /api/v1/clients/{client_id}/cards/{barcode}/limits * * @param {string} clientId * @param {string} barcode * @return {Promise} */ cardLimits(clientId, barcode) { return this.createRequest(`/clients/${clientId}/cards/${barcode}/limits`); } /** * Refill card from account * * POST /api/v1/clients/{client_id}/cards/{barcode}/refill * * @param {string} clientId * @param {string} barcode * @param {float} amount * @param {string|null} orderId * @return {Promise} */ cardRefill(clientId, barcode, amount, orderId = null) { const data = this.filterData({ amount: amount, order_id: orderId, }); return this.createRequest(`/clients/${clientId}/cards/${barcode}/refill`, 'POST', data); } /** * @deprecated Synonym of the method cardRefill(), use this one instead */ refillCard(clientId, ean) { return this.cardRefill(clientId, ean); } /** * Withdraw money from the card * * POST /api/v1/clients/{client_id}/cards/{barcode}/withdrawal * * @param {string} clientId * @param {string} barcode * @param {float} amount * @param {string|null} orderId * @return {Promise} */ cardWithdrawal(clientId, barcode, amount, orderId = null) { const data = this.filterData({ amount: amount, order_id: orderId, }); return this.createRequest(`/clients/${clientId}/cards/${barcode}/withdrawal`, 'POST', data); } /** * @deprecated Synonym of the method cardWithdrawal(), use this one instead */ refillAccount(clientId, ean) { return this.cardWithdrawal(clientId, ean); } /** * Set PIN code for card (only for RFI now) * * POST /api/v1/clients/{client_id}/cards/{barcode}/set/pin * * @param {string} clientId * @param {string} barcode * @param {int} pinCode * @return {Promise} */ setCardPin(clientId, barcode, pinCode) { const data = this.filterData({ pin: pinCode, }); return this.createRequest(`/clients/${clientId}/cards/${barcode}/set/pin`, 'POST', data); } /** * Get identification pdf for Client/Card (a few banks only) * * GET /api/v1/clients/{client_id}/cards/{barcode}/pdf * * @param {string} clientId * @param {string} barcode * @return {Promise} */ cardPdf(clientId, barcode) { return this.createRequest(`/clients/${clientId}/cards/${barcode}/pdf`); } // Card2card Methods // Create payment link createPaymentLink(clientId) { return this.createRequest(`/clients/${clientId}/card2card`, 'POST'); } // Get payment link status getPaymentLinkStatus(clientId, paymentId) { return this.createRequest(`/clients/${clientId}/card2card/${paymentId}`, 'GET'); } // Event subscription methods /** * Get callbacks * * GET /api/v1/event-subscriptions * * @return {Promise} */ eventSubscriptionList() { return this.createRequest('/event-subscriptions'); } /** * @deprecated Synonym of the method eventSubscriptionList(), use this one instead */ getSubscriptions() { return this.eventSubscriptionList(); } /** * Add event subscription * * POST /api/v1/event-subscriptions * * @param {string} url * @param {array|null} events * @return {Promise} */ eventSubscriptionStore(url, events = null) { const data = this.filterData({ url: url, events: events }); return this.createRequest('/event-subscriptions', 'POST', data); } /** * Subscribe to event * * @param clientId * @param limit * @param skip * @param alpha * @return {Promise} * * @deprecated Use eventSubscriptionStore() instead! */ subscribeToEvent(clientId, limit = 50, skip = 500, alpha = '') { const data = {client_id: clientId}; const query = {limit: limit, skip: skip, alpha: alpha}; return this.createRequest('/event-subscriptions', 'POST', data, query) } /** * Delete subscription * * DELETE /api/v1/event-subscriptions/{subscription_id} * * @param {string} subscriptionId * @return {Promise} */ eventSubscriptionRemove(subscriptionId) { return this.createRequest(`/event-subscriptions/${subscriptionId}`, 'DELETE'); } /** * @deprecated Synonym of the method eventSubscriptionRemove(), use this one instead */ deleteSubscription(subscriptionId) { return this.eventSubscriptionRemove(subscriptionId); } // Card Delivery Methods /** * Add new delivery * * POST /api/v1/clients/{client_id}/card-deliveries * * @param {string} clientId * @param {object} data * @return {Promise} */ cardDeliveryStore(clientId, data) { return this.createRequest(`/clients/${clientId}/card-deliveries`, 'POST', data); } /** * @deprecated Synonym of the method cardDeliveryStore(), use this one instead */ createDelivery(clientId, data) { return this.cardDeliveryStore(clientId, data); } /** * Get info about delivery * * GET ​/api​/v1​/clients​/{client_id}​/card-deliveries​/{delivery_id} * * @param {string} clientId * @param {string} deliveryId * @return {Promise} */ cardDeliveryShow(clientId, deliveryId) { return this.createRequest(`/clients/${clientId}/card-deliveries/${deliveryId}`); } /** * @deprecated Synonym of the method cardDeliveryShow(), use this one instead */ getDeliveryStatus(clientId, deliveryId) { return this.cardDeliveryShow(clientId, deliveryId); } // Client Methods /** * Create the client * * POST /api/v1/clients * * @param {string} clientId * @param {object} person * @return {Promise} */ clientStore(clientId, person) { return this.createRequest('/clients', 'POST', { client_id: clientId, person: person }); } /** * @deprecated Synonym of the method clientStore(), use this one instead * * @param {object} person {client_id: 47, person: {...}} */ addClient(person) { return this.clientStore(person.client_id, person.person); } /** * Update the client * * PUT /api/v1/clients/{client_id} * * @param clientId * @param person * @return {Promise} */ clientEdit(clientId, person) { return this.createRequest('/clients', 'PUT', { client_id: clientId, person: person }); } /** * Get client's status * * GET /api/v1/clients/{client_id} * * @param {string} clientId * @return {Promise} */ clientShow(clientId) { return this.createRequest(`/clients/${clientId}`); } /** * @deprecated Synonym of the method clientShow(), use this one instead */ getClientStatus(clientId) { return this.clientShow(clientId); } /** * Hold money from registered or unregistered card * * POST /api/v1/hold * * @param {int|null} amount * @param {string|null} orderSlug * @param {object|null} cardInfo * @param {string|null} cardRefId * @param {string|null} redirectUrl * @return {Promise} */ hold(amount = null, orderSlug = null, cardInfo = null, cardRefId = null, redirectUrl = null) { const data = this.filterData({ amount: amount, order_slug: orderSlug, card_info: cardInfo, card_ref_id: cardRefId, redirect_url: redirectUrl }); return this.createRequest(`/hold`, 'POST', data); } /** * Hold money from registered or unregistered card with payment form * * POST /api/v1/hold/{client_id}/with/form * * @param {string} clientId * @param {string} redirectUrl * @param {int} amount * @param {string|null} orderSlug * @param {string|null} cardToken * @return {Promise} */ holdWithForm(clientId, redirectUrl, amount, orderSlug = null, cardToken = null) { const data = this.filterData({ redirect_url: redirectUrl, amount: amount, order_slug: orderSlug, card_token: cardToken }); return this.createRequest(`/hold/${clientId}/with/form`, 'POST', data); } /** * Confirm full or partial hold * * POST /api/v1/hold/confirm/{order_slug} * * @param {string} orderSlug * @param {int|null} amount * @return {Promise} */ holdConfirm(orderSlug, amount = null) { const data = this.filterData({ amount: amount }); return this.createRequest(`/hold/confirm/${orderSlug}`, 'POST', data); } /** * Reverse hold * * POST /api/v1/hold/reverse/{order_slug} * * @param {string} orderSlug * @param {int|null} amount * @return {Promise} */ holdReverse(orderSlug, amount = null) { const data = this.filterData({ amount: amount }); return this.createRequest(`/hold/reverse/${orderSlug}`, 'POST', data); } /** * Charge/withdraw money from card to account * * POST /api/v1/charge/{client_id}/unregistered/card * * @param {string} clientId * @param {int} amount * @param {object} cardInfo * @param {string|null} redirectUrl * @param {string|null} orderSlug * @return {Promise} */ paymentFromUnregisteredCard(clientId, amount, cardInfo, redirectUrl = null, orderSlug = null) { const data = this.filterData({ amount: amount, card_info: cardInfo, redirect_url: redirectUrl, order_slug: orderSlug }); return this.createRequest(`/charge/${clientId}/unregistered/card`, 'POST', data); } /** * Create token for clientCharge * * POST /api/v1/charge/{client_id}/token * * @param {string} clientId * @param {string} redirectUrl * @param {int} amount * @return {Promise} */ paymentFromUnregisteredCardToken(clientId, redirectUrl, amount) { const data = this.filterData({ redirect_url: redirectUrl, amount: amount }); return this.createRequest(`/charge/${clientId}/token`, 'POST', data); } /** * POST /api/v1/refill/{client_id}/token * * @param {string} clientId * @param {int} amount * @param {string|null} orderSlug * @return {Promise} */ paymentToUnregisteredCardToken(clientId, amount, orderSlug = null) { const data = this.filterData({ amount: amount, order_slug: orderSlug }); return this.createRequest(`/refill/${clientId}/token`, 'POST', data); } /** * POST /api/v1/charge/{client_id}/unregistered/card/with/form * * @param {string} clientId * @param {int} amount * @param {string|null} orderSlug * @param {string|null} redirectUrl * @return {Promise} */ paymentFromUnregisteredCardWithForm(clientId, amount, orderSlug = null, redirectUrl = null) { const data = this.filterData({ amount: amount, order_slug: orderSlug, redirect_url: redirectUrl }); return this.createRequest(`/charge/${clientId}/unregistered/card/with/form`, 'POST', data); } /** * Charge card without 3ds * * POST /api/v1/payment/from/{client_id}/registered/card * * @param {string} clientId * @param {int} amount * @param {string} cardToken * @param {string|null} orderSlug * @return {Promise} */ paymentFromRegisteredCard(clientId, amount, cardToken, orderSlug = null) { const data = this.filterData({ amount: amount, card_token: cardToken, order_slug: orderSlug }); return this.createRequest(`/payment/from/${clientId}/registered/card`, 'POST', data); } /** * Refill card from account * * POST /api/v1/authorize/card/{client_id} * * @param {string} clientId * @param {object} cardInfo * @param {string|null} redirectUrl * @return {Promise} */ paymentAuthorization(clientId, cardInfo, redirectUrl = null) { const data = this.filterData({ card_info: cardInfo, redirect_url: redirectUrl }); return this.createRequest(`/authorize/card/${clientId}`, 'POST', data); } /** * Get tokens for authorization on a client side * * POST /api/v1/authorize/card/{client_id}/token * * @param {string} clientId * @param {string|null} redirectUrl * @return {Promise} */ paymentAuthorizationToken(clientId, redirectUrl = null) { const data = this.filterData({ redirect_url: redirectUrl }); return this.createRequest(`/authorize/card/${clientId}/token`, 'POST', data); } /** * POST /api/v1/authorize/card/{client_id}/with/form * * @param {string} clientId * @param {string|null} redirectUrl * @param {string|null} orderSlug * @return {Promise} */ paymentAuthorizationWithForm(clientId, redirectUrl = null, orderSlug = null) { const data = this.filterData({ redirect_url: redirectUrl, order_slug: orderSlug }); return this.createRequest(`/authorize/card/${clientId}/with/form`, 'POST', data); } /** * POST /api/v1/payment/to/{client_id}/registered/card * * @param {string} clientId * @param {string} cardToken * @param {int} amount * @param {string|null} orderSlug * @return {Promise} */ paymentToRegisteredCard(clientId, cardToken, amount, orderSlug = null) { const data = this.filterData({ card_token: cardToken, amount: amount, order_slug: orderSlug }); return this.createRequest(`/payment/to/${clientId}/registered/card`, 'POST', data); } /** * POST /api/v1/account/transfer * * @param {int} amount * @param {string} account * @param {string} bik * @param {string} name * @param {string|null} inn * @param {string|null} description * @param {string|null} orderSlug * @return {Promise} */ paymentToAccount(amount, account, bik, name, inn = null, description = null, orderSlug = null) { const data = this.filterData({ amount: amount, account: account, bik: bik, name: name, inn: inn, description: description, order_slug: orderSlug }); return this.createRequest(`/account/transfer`, 'POST', data); } /** * Refill card by cardNumber * * POST /api/v1/refill/unregistered/card * * @param {string} cardNumber * @param {int|null} amount * @param {string|null} orderSlug * @return {Promise} */ paymentToUnregisteredCard(cardNumber, amount = null, orderSlug = null) { const data = this.filterData({ card_number: cardNumber, amount: amount, order_slug: orderSlug }); return this.createRequest(`/refill/unregistered/card`, 'POST', data); } /** * POST /api/v1/refill/{client_id}/unregistered/card/with/form * * @param {string} clientId * @param {int} amount * @param {string|null} orderSlug * @param {string|null} redirectUrl * @return {Promise} */ paymentToUnregisteredCardWithForm(clientId, amount, orderSlug = null, redirectUrl = null) { const data = this.filterData({ amount: amount, order_slug: orderSlug, redirect_url: redirectUrl }); return this.createRequest(`/refill/${clientId}/unregistered/card/with/form`, 'POST', data); } /** * Get direct payment status * * GET /api/v1/payment/{order_slug} * * @param {string} orderSlug * @return {Promise} */ paymentStatus(orderSlug) { return this.createRequest(`/payment/${orderSlug}`); } /** * GET /api/v1/selfemployments/{client_id} * * @param {string} clientId * @return {Promise} */ selfemploymentsRegistrationStatus(clientId) { return this.createRequest(`/selfemployments/${clientId}`); } /** * Charge method for Client (w/o signature!) * * POST /client/v1/charge * * @param {string} token * @param {int} amount * @param {object} cardInfo * @return {Promise} */ unsignedPaymentFromUnregisteredCard(token, amount, cardInfo) { const data = this.filterData({ token: token, amount: amount, card_info: cardInfo }); return this.createRequest(`/client/v1/charge`, 'POST', data, null, {rewriteUri: true}); } /** * Refill a card on the client-side using a temp token, * see payment_to_unregistered_card_token & payment_to_unregistered_card_with_form * * POST /client/v1/refill * * @param {string} token * @param {string} cardNumber * @return {Promise} */ unsignedPaymentToUnregisteredCard(token, cardNumber) { const data = this.filterData({ token: token, card_number: cardNumber }); return this.createRequest(`/client/v1/refill`, 'POST', data, null, {rewriteUri: true}); } /** * POST /client/v1/authorize * * @param {string} token * @param {object} cardInfo * @return {Promise} */ unsignedPaymentAuthorization(token, cardInfo) { const data = this.filterData({ token: token, card_info: cardInfo }); return this.createRequest(`/client/v1/authorize`, 'POST', data, null, {rewriteUri: true}); } /** * Hold card on the client-side * * POST /client/v1/hold * * @param {string} token * @param {object} cardInfo * @return {Promise} */ unsignedHold(token, cardInfo) { const data = this.filterData({ token: token, card_info: cardInfo }); return this.createRequest(`/client/v1/hold`, 'POST', data, null, {rewriteUri: true}); } /** * Get status by token * * GET /client/v1/status/{hash} * * @param {string} hash * @return {Promise} */ unsignedPaymentStatusByHash(hash) { return this.createRequest(`/client/v1/status/${hash}`, 'GET', null, null, {rewriteUri: true}); } /** * @param {object} data * @returns {Promise} */ filterData(data) { for (var propName in data) { if (data[propName] === null || data[propName] === undefined) { delete data[propName]; } } return data; } getLocation(href) { var match = href.match(/^(https?\:)\/\/(([^:\/?#]*)(?:\:([0-9]+))?)([\/]{0,1}[^?#]*)(\?[^#]*|)(#.*|)$/); return match && { href: href, protocol: match[1], host: match[2], hostname: match[3], port: match[4], pathname: match[5], search: match[6], hash: match[7] } } };
24.898876
126
0.624271
c1c17d1e5712b7b24a2afb6494d21c597544fb7b
23,540
js
JavaScript
src/portfolio.js
CryptoFist/Portfolio_v2
9ceaf768cdf77fadaccbd2e376af7b52a697750f
[ "MIT" ]
null
null
null
src/portfolio.js
CryptoFist/Portfolio_v2
9ceaf768cdf77fadaccbd2e376af7b52a697750f
[ "MIT" ]
null
null
null
src/portfolio.js
CryptoFist/Portfolio_v2
9ceaf768cdf77fadaccbd2e376af7b52a697750f
[ "MIT" ]
null
null
null
/* Change this file to get your personal Porfolio */ // Website related settings const settings = { isSplash: true, // Change this to true if you want to use the splash screen. useCustomCursor: true, // Change this to false if you want the good'ol cursor googleTrackingID: "UA-174238252-2", }; //Home Page const greeting = { title: "Hello 👋.", title2: "Denis", logo_name: "Denis.L()", nickname: "denis / kryptify", full_name: "Denis Lee", subTitle: "Full Stack Developer, Web3 Enthusiast 🔥. Always learning.", resumeLink: "https://docs.google.com/document/d/1A_jWRG74Rst427tg1izLa6vRXclS9_9F856jWJPJlDY/edit?usp=sharing", mail: "mailto:leedenis42@gmail.com", }; const socialMediaLinks = { /* Your Social Media Link */ github: "https://github.com/kryptify", gmail: "leedenis42@gmail.com", linkedin: "https://www.linkedin.com/sg/denis-lee/", }; const skills = { data: [ { title: "Blockchain Development", fileName: "BlockchainImg", skills: [ "⚡ Ethereum, BSC, Solana, Polygon, Alogrand, Cardano, and more", "⚡ DeFi, DAO, DEX, Yield Farming, AMM, ICO, IDO", "⚡ NFT marketplaces & NFT gaming platforms", "⚡ Smart Contract & Unit Test: Solidity, Rust, Python, Truffle, Hardhat", "⚡ Web3 Integration: Web3.js, ethers.js, Solana Web3.js", ], softwareSkills: [ { skillName: "Bitcoin", fontAwesomeClassname: "simple-icons:bitcoin", style: { color: "#eaa330", }, }, { skillName: "Ethereum", fontAwesomeClassname: "simple-icons:ethereum", style: { color: "#8e877e", }, }, { skillName: "Solidity", fontAwesomeClassname: "simple-icons:solidity", style: { color: "#4f889e", }, }, { skillName: "Rust", fontAwesomeClassname: "simple-icons:rust", style: { color: "#ac3a8c", }, }, { skillName: "Python", fontAwesomeClassname: "simple-icons:python", style: { color: "#3776AB", }, }, ], }, { title: "Full Stack Development", fileName: "FullStackImg", skills: [ "⚡ Web Frontend: ReactJS, VueJS, AngularJS, and more", "⚡ Web Backend: Node.js, PHP, Java(Spring), Python(Django)", "⚡ Database: MySQL, PostgreSQL, NoSQL(MongoDB, Redis, etc)", "⚡ Integration of third party services such as Firebase / AWS / Digital Ocean", "⚡ Git, Bitbucket, Slack, Jira, Asana, Trello" ], softwareSkills: [ { skillName: "HTML5", fontAwesomeClassname: "simple-icons:html5", style: { color: "#E34F26", }, }, { skillName: "CSS3", fontAwesomeClassname: "fa-css3", style: { color: "#1572B6", }, }, { skillName: "JavaScript", fontAwesomeClassname: "simple-icons:javascript", style: { backgroundColor: "#FFFFFF", color: "#F7DF1E", }, }, { skillName: "PHP", fontAwesomeClassname: "simple-icons:php", style: { color: "#7377AD", }, }, { skillName: "Python", fontAwesomeClassname: "simple-icons:python", style: { color: "#3776AB", }, }, { skillName: "Java", fontAwesomeClassname: "simple-icons:java", style: { color: "#3776AB", }, }, { skillName: "ReactJS", fontAwesomeClassname: "simple-icons:react", style: { color: "#61DAFB", }, }, { skillName: "VueJS", fontAwesomeClassname: "simple-icons:vuejs", style: { color: "#41b82e", }, }, { skillName: "NodeJS", fontAwesomeClassname: "simple-icons:node-dot-js", style: { color: "#c7893d", }, }, { skillName: "Spring", fontAwesomeClassname: "simple-icons:spring", style: { color: "#439743", }, }, { skillName: "Laravel", fontAwesomeClassname: "simple-icons:laravel", style: { color: "#f89820", }, }, { skillName: "MongoDB", fontAwesomeClassname: "simple-icons:mongodb", style: { color: "#439743", }, }, { skillName: "MySQL", fontAwesomeClassname: "simple-icons:mysql", style: { color: "#4479A1", }, }, { skillName: "GraphQL", fontAwesomeClassname: "simple-icons:graphql", style: { color: "#DE33A6", }, }, { skillName: "Apache", fontAwesomeClassname: "simple-icons:apache", style: { color: "#CA1A22", }, }, { skillName: "Git", fontAwesomeClassname: "simple-icons:git", style: { color: "#E94E32", }, }, ], }, { title: "Cloud Infra-Architecture", fileName: "CloudInfraImg", skills: [ "⚡ Experience working on Web3 projects", "⚡ Experience working on multiple cloud platforms", "⚡ Experience hosting and managing websites", "⚡ Experience with Continuous Integration", ], softwareSkills: [ { skillName: "AWS", fontAwesomeClassname: "simple-icons:amazonaws", style: { color: "#FF9900", }, }, { skillName: "Netlify", fontAwesomeClassname: "simple-icons:netlify", style: { color: "#38AFBB", }, }, { skillName: "Heroku", fontAwesomeClassname: "simple-icons:heroku", style: { color: "#6863A6", }, }, { skillName: "Firebase", fontAwesomeClassname: "simple-icons:firebase", style: { color: "#FFCA28", }, }, { skillName: "PostgreSQL", fontAwesomeClassname: "simple-icons:postgresql", style: { color: "#336791", }, }, { skillName: "MongoDB", fontAwesomeClassname: "simple-icons:mongodb", style: { color: "#47A248", }, }, { skillName: "Docker", fontAwesomeClassname: "simple-icons:docker", style: { color: "#1488C6", }, }, { skillName: "GitHub Actions", fontAwesomeClassname: "simple-icons:githubactions", style: { color: "#5b77ef", }, }, ], }, ], }; const degrees = { degrees: [ { title: "Nanyang Technological University", subtitle: "Bachelor of Engineering", logo_path: "ntu.png", alt_name: "NTU", duration: "2018 - 2020", descriptions: [ "⚡ I have completed various online blockchain courses like Certified Blockchain Developer, MSc in Digital Fintech, etc.", "⚡ I have learnt smart contracts & best-practices for blockchain and front-end interfaces.", "⚡ I have implemented several Web3 projects based on what I've learnt under my blockchain course.", ], website_link: "https://www.ntu.edu.sg/", }, { title: "National University of Singapore", subtitle: "Bachelor of Engineering", logo_path: "nus.png", alt_name: "NUS", duration: "2010 - 2014", descriptions: [ "⚡ I have studied core subjects like Artificial Intelligence, Data Science, DBMS, Networking, Security, etc.", "⚡ I have built several web & mobile projects based on what I've learnt under my Computer Engineering course.", ], website_link: "https://www.nus.edu.sg/", }, ], }; const certifications = { certifications: [ { title: "Bachelor of Engineering", subtitle: "National University of Singapore", logo_path: "nus.png", certificate_link: "https://drive.google.com/file/d/16KGXV3mhhDYvwSjSIde3-VI_VjSlUl4d/view?usp=sharing", alt_name: "Bachelor of Engineering", // color_code: "#2AAFED", color_code: "#47A048", }, { title: "Certificated Blockchain Professional", subtitle: "IIEC", logo_path: "IIEC-Final.jpg", certificate_link: "https://drive.google.com/file/d/1Sq1kDMyzItA9KHDYklraNkeyh9u5RNvJ/view?usp=sharing", alt_name: "hackathon", color_code: "#E2405F", }, { title: "Certificate of Completed Blockchain Training", subtitle: "EDUCBA", logo_path: "educba.jpg", certificate_link: "https://drive.google.com/file/d/1osmMvmOQhNO8F6Pl8EkQfcaFTa1yk9C4/view?usp=sharing", alt_name: "EDUCBA", // color_code: "#F6B808", color_code: "#47A048", }, { title: "Enterprise Blockchain Professional", subtitle: "101 Blockchains", logo_path: "101blockchain.jpg", certificate_link: "https://drive.google.com/file/d/12KvYwddRO4f1T0B4lYm05KDA5O4vQlBG/view?usp=sharing", alt_name: "101 Blockchains", // color_code: "#F6B808", color_code: "#4784a0", }, { title: "Cyber Security & Cyber Forensics", subtitle: "Workshop at IIT Bombay", logo_path: "iit.png", certificate_link: "https://drive.google.com/file/d/1nYMSt4WDrgYgVAPOpA2BCrasKQZL9_3R/view?usp=sharing", alt_name: "Workshop", color_code: "#2AAFED", }, { title: "Postman Student Expert", subtitle: "Postman", logo_path: "postman.png", certificate_link: "https://badgr.com/public/assertions/h2qevHs4SlyoHErJQ0mn2g", alt_name: "Postman", // color_code: "#f36c3d", color_code: "#fffbf3", }, // color_code: "#8C151599", // color_code: "#7A7A7A", // color_code: "#0C9D5899", // color_code: "#C5E2EE", // color_code: "#ffc475", // color_code: "#g", // color_code: "#ffbfae", // color_code: "#fffbf3", // color_code: "#b190b0", ], }; // Experience Page const experience = { title: "Experience", subtitle: "Work, Internship and Volunteership", description: "I've completed one internship. I've mostly done projects on my own and I am actively looking for new job opportunities. I love organizing workshops to share my knowledge with others.", header_image_path: "experience.svg", sections: [ { title: "Work Experience", experiences: [ { title: "Full Stack Developer (Intern)", company: "CRYSTAL centre", company_url: "https://www.crystal.comp.nus.edu.sg/", logo_path: "nus.png", duration: "Oct 2019 - Mar 2020", location: "Office", description: `Train, manage and provide guidance to blockchain development staff. Work closely with the Project Manager and Team Leads on change request functions. Develop a blockchain environment, smart contracts or decentralised applications. Gain in-depth technical knowledge of Bitcoin, Ethereum, Solana and several blockchain networks. Work on real-life projects about the fundamentals, implementation and also the governance of blockchain systems. `, color: "#0071C5", }, ], }, { title: "Volunteerships", experiences: [ { title: "Cross Winter of Code Mentor", company: "CWOC", company_url: "https://crosswoc.ieeedtu.in/", logo_path: "cwoc.png", duration: "Feb 2021 - Present", location: "Work From Home", description: "Mentorship responsibilities were to help students plan the project, review issues and pull requests, ensure smooth progress and help them out when they are stuck.", color: "#4285F4", }, { title: "Campus Hustler", company: "Skillenza", company_url: "https://skillenza.com/", logo_path: "skillenza.png", duration: "Feb 2021 - Present", location: "Work from Home", description: "Spread Awareness of new Technologies and new Opportunities to Students and Grow Skillenza Community.", color: "#196acf", }, { title: "GitHub Student Developer", company: "GitHub", company_url: "https://github.com/", logo_path: "github.png", duration: "Nov 2019 - Present", location: "Work from Home", description: "Contribute to Open Source Community and Open Source Project.", color: "#040f26", }, { title: "Google Local Guide", company: "Google Map", company_url: "https://maps.google.com/localguides/", logo_path: "localguide.png", duration: "Sep 2018 - Present", location: "Work From Home", description: "Day-to-day responsibilities of helping local businesses to spread their business to the world. Helping users by writing reviews about different locations and spaces such as shops, malls, etc.", color: "#D83B01", }, { title: "GDG Student Volunteer", company: "Google Developer Groups", company_url: "https://gdg.community.dev/", logo_path: "gdg.png", duration: "Feb 2021 - Present", location: "Work From Home", description: "Google Developer Group Surat Student Volunteer and Member.", color: "#D83B01", }, ], }, ], }; // Projects Page const projectsHeader = { title: "Projects", description: "My projects make use of a vast variety of latest blockchain and Web technology. My best experience is to create Solidity Smart contracts, NodeJS Backend, Web3.js integration, and React/Vue Project. Below are some of my projects. Note that not all of the mentioned projects are on GitHub yet.", avatar_image_path: "projects_image.svg", }; // Contact Page const contactPageData = { contactSection: { title: "Contact Me", profile_image_path: "denis.png", description: "You can contact me at any time. I will try to get back to you as fast as I can.", }, blogSection: { title: "Resume", subtitle: "You can contact me at any time. I will try to get back to you as fast as I can.", link: "https://docs.google.com/document/d/1jE_WH6agK1WYh5RS-NWopwMH7xC987Aqf07zh9ZDhfY/edit?usp=sharing", avatar_image_path: "blogs_image.svg", }, }; const projects = { data: [ { id: "0", name: "AutomateInstaPyBot", url: "https://github.com/harikanani/AutomateInstaPyBot", description: "This is Instagram Bot. This will login to your Instagram account. Follow Users, Unfollow Users, Remove Profile Photo", languages: [ { name: "Python", iconifyClass: "logos-python", }, ], }, { id: "1", name: "react-twitter-clone", url: "https://github.com/harikanani/react-twitter-clone", description: "A React Twitter Clone UI with basic functionality such as make a Tweet.Embedded Profile Tweets and Share on Twitter.", languages: [ { name: "HTML5", iconifyClass: "vscode-icons:file-type-html", }, { name: "CSS3", iconifyClass: "vscode-icons:file-type-css", }, { name: "React", iconifyClass: "logos-react", }, { name: "Firebase", iconifyClass: "logos-firebase", }, ], }, { id: "2", name: "node-blockchain", url: "https://github.com/harikanani/node-blockchain", description: "A simple blockchain and cryptocurrency wallet implemented in Node.js and TypeScript (for learning purposes).", languages: [ { name: "NodeJS", iconifyClass: "logos-nodejs", }, { name: "TypeScript", iconifyClass: "logos-typescript", }, ], }, { id: "3", name: "top-crypto-gainers", url: "https://github.com/harikanani/top-crypto-gainers", description: "A top high price changed crypto coins wring 24 hoursA sound-classifier webapp made with ReactJS + TensorflowJS.", languages: [ { name: "HTML5", iconifyClass: "vscode-icons:file-type-html", }, { name: "CSS3", iconifyClass: "vscode-icons:file-type-css", }, { name: "JavaScript", iconifyClass: "logos-javascript", }, { name: "ReactJS", iconifyClass: "logos-react", }, ], }, { id: "4", name: "personal-portfolio", url: "https://github.com/harikanani/personal-portfolio", description: "A simple command line interface based quiz app to know more about me :).", languages: [ { name: "JavaScript", iconifyClass: "logos-javascript", }, { name: "NodeJS", iconifyClass: "logos-nodejs", }, ], }, { id: "3", name: "node_express_crud_api_starter", url: "https://github.com/harikanani/node_express_crud_api_starter", description: "Simple NodeJS Express CRUD Operations API starter.", languages: [ { name: "NodeJS", iconifyClass: "logos-nodejs", }, ], }, { id: "4", name: "node-web-scrapper", url: "https://github.com/harikanani/node-web-scrapper", description: "A Simple web scrapper that scrap the information of amazon products such as price.It also scrap Wikipedia Data such as birthdate.", languages: [ { name: "HTML5", iconifyClass: "vscode-icons:file-type-html", }, { name: "CSS3", iconifyClass: "vscode-icons:file-type-css", }, { name: "NodeJs", iconifyClass: "logos-nodejs", }, ], }, { id: "5", name: "harikanani.github.io", url: "https://github.com/harikanani/harikanani.github.io", description: "A Personal Portfolio Website that showcases my work and experience. which is hosted on Github Pages.", languages: [ { name: "HTML5", iconifyClass: "vscode-icons:file-type-html", }, { name: "CSS3", iconifyClass: "vscode-icons:file-type-css", }, { name: "JavaScript", iconifyClass: "logos-javascript", }, { name: "SCSS", iconifyClass: "vscode-icons:file-type-scss2", }, ], }, { id: "6", name: "Automate Attendace", url: "https://github.com/harikanani/Node_Python", description: "Automation of Online Attendance using node js and python", languages: [ { name: "JavaScript", iconifyClass: "logos-javascript", }, { name: "Python", iconifyClass: "logos-python", }, ], }, { id: "7", name: "Automate Discord Bot", url: "https://github.com/harikanani/AutomateDiscordBot", description: "A Discord Bot to send Automatic messages to serer channel in regular time difference.", languages: [ { name: "Python", iconifyClass: "logos-python", }, { name: "Python Selenium", iconifyClass: "logos-selenium", }, { name: "Chromium Browser", iconifyClass: "openmoji-chromium", }, ], }, { id: "8", name: "Flask Blog", url: "https://github.com/harikanani/flask_blog", description: "A Simple Blog Web Application made using Flask Framework", languages: [ { name: "Python", iconifyClass: "logos-python", }, { name: "Flask", iconifyClass: "cib-flask", }, { name: "HTML5", iconifyClass: "vscode-icons:file-type-html", }, { name: "CSS3", iconifyClass: "vscode-icons:file-type-css", }, ], }, { id: "9", name: "Netflix top series", url: "https://github.com/harikanani/netflix-top-series", description: "List of Top Netflix Series which is deployed to vercel.", languages: [ { name: "JavaScript", iconifyClass: "logos-javascript", }, { name: "ReactJS", iconifyClass: "logos-react", }, { name: "HTML5", iconifyClass: "logos-html-5", }, { name: "CSS3", iconifyClass: "logos-css-3", }, ], }, { id: "10", name: "COVID-19 Tracker", url: "https://github.com/harikanani/Covid19TrackerReact", description: "Simple Covid-19 Tracker made using React and deployed to Vercel.", languages: [ { name: "JavaScript", iconifyClass: "logos-javascript", }, { name: "ReactJS", iconifyClass: "logos-react", }, { name: "HTML5", iconifyClass: "logos-html-5", }, { name: "CSS3", iconifyClass: "logos-css-3", }, ], }, { id: "11", name: "Food Order Static Website", url: "https://github.com/harikanani/food-order-website", description: "A simple static website related to food restaurants service. this is reasponsive as well.", languages: [ { name: "HTML5", iconifyClass: "logos-html-5", }, { name: "CSS3", iconifyClass: "logos-css-3", }, { name: "JavaScript", iconifyClass: "logos-javascript", }, { name: "PHP", iconifyClass: "logos-php", }, ], }, { id: "12", name: "NFT Launchpad", url: "https://deliquescent-cents.000webhostapp.com/", description: "NFT Launchpad crypto site portfolio", languages: [ { name: "HTML5", iconifyClass: "logos-html-5", }, { name: "CSS3", iconifyClass: "logos-css-3", }, { name: "JavaScript", iconifyClass: "logos-javascript", }, { name: "ReactJS", iconifyClass: "logos-react", }, ], }, ], }; export { settings, greeting, socialMediaLinks, skills, degrees, certifications, experience, projectsHeader, contactPageData, projects, };
28.429952
298
0.531181
c1c185dc31921c8d25bc88af9774785df8b384ca
770
js
JavaScript
src/NamedBackbone.js
youngseppa23/imvujs
344c399c9cc8a159f323591db7cfecdbab089fe2
[ "MIT" ]
8
2016-08-11T16:27:15.000Z
2021-08-10T06:20:09.000Z
src/NamedBackbone.js
youngseppa23/imvujs
344c399c9cc8a159f323591db7cfecdbab089fe2
[ "MIT" ]
5
2016-09-14T22:48:31.000Z
2017-03-16T18:42:17.000Z
src/NamedBackbone.js
youngseppa23/imvujs
344c399c9cc8a159f323591db7cfecdbab089fe2
[ "MIT" ]
6
2015-07-08T20:31:37.000Z
2022-03-18T01:33:27.000Z
/*global IMVU:true*/ var IMVU = IMVU || {}; (function (root) { function MakeNamedBackboneConstructor(Constructor) { return IMVU.BaseClass.extend.call(Constructor, 'Named' + Constructor.name, { 'static extend': IMVU.BaseClass.extend, initialize: function () { var oldInitialize = this.initialize; this.initialize = function () {}; Constructor.apply(this, arguments); this.initialize = oldInitialize; } }); } IMVU.NamedView = MakeNamedBackboneConstructor(root.Backbone.View); IMVU.NamedModel = MakeNamedBackboneConstructor(root.Backbone.Model); IMVU.NamedCollection = MakeNamedBackboneConstructor(root.Backbone.Collection); }(this));
36.666667
84
0.636364
c1c1f16790ddf9c00cba26d6c440bcb51f6fc2e8
4,091
js
JavaScript
dist/locale/pt_BR.js
chromecrown/heyui
89e670e4c83a939a9f213bc9b7ddacf3c82f780e
[ "MIT" ]
1
2019-07-11T08:22:19.000Z
2019-07-11T08:22:19.000Z
dist/locale/pt_BR.js
chromecrown/heyui
89e670e4c83a939a9f213bc9b7ddacf3c82f780e
[ "MIT" ]
null
null
null
dist/locale/pt_BR.js
chromecrown/heyui
89e670e4c83a939a9f213bc9b7ddacf3c82f780e
[ "MIT" ]
null
null
null
!function(e,o){if("object"==typeof exports&&"object"==typeof module)module.exports=o();else if("function"==typeof define&&define.amd)define([],o);else{var r=o();for(var t in r)("object"==typeof exports?exports:e)[t]=r[t]}}(window,function(){return function(e){var o={};function r(t){if(o[t])return o[t].exports;var a=o[t]={i:t,l:!1,exports:{}};return e[t].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=o,r.d=function(e,o,t){r.o(e,o)||Object.defineProperty(e,o,{enumerable:!0,get:t})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,o){if(1&o&&(e=r(e)),8&o)return e;if(4&o&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(r.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&o&&"string"!=typeof e)for(var a in e)r.d(t,a,function(o){return e[o]}.bind(null,a));return t},r.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(o,"a",o),o},r.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},r.p="",r(r.s=4)}({4:function(e,o,r){e.exports=r(5)},5:function(e,o,r){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0;var t={h:{locale:"pt-BR",common:{cancel:"Cancelar",confirm:"Confirmar",clear:"Limpar",nullOptionText:"por favor escolha",empty:"vazio",any:"qualquer"},confirm:{title:"Confirmar"},checkbox:{limitSize:"Você pode selecionar até {limitSize}"},select:{nullOptionText:"por favor escolha",placeholder:"selecionar",emptyContent:"nenhum resultado encontrado",searchPlaceHolder:"pesquisar",limitSize:"Você pode selecionar até {limitSize}."},category:{placeholder:"por favor escolha"},cascader:{placeholder:"por favor escolha"},categoryModal:{limitWords:"Você pode selecionar até {size} dados.",emptyContent:"Nenhum resultado encontrado",total:"total"},categoryPicker:{nullOptionText:"por favor escolha",placeholder:"selecionar",total:"total",limitSize:"Você pode selecionar até {0} dados."},autoComplate:{placeholder:"Entrada de pesquisa",emptyContent:"Nenhum resultado encontrado"},validation:{base:{required:" can not be empty",maxLen:" o comprimento do texto não pode exceder {value} bits",minLen:" comprimento do texto não pode ser inferior a {value} bits",max:" não maior que {value}",min:" não pode ser menor que {value}"},type:{int:" não é um formato inteiro correto",number:" não é um formato digital correto",email:" não é um formato de caixa de correio correto",url:" não é um formato de URL correto",tel:" não é um formato de número de telefone correto",mobile:" não é um formato de número de celular correto",globalmobile:" não é um formato de número de celular internacional correto"}},date:{today:"Hoje",yesterday:"Ontem",year:"ano",month:"meses",week:"semana",quarter:"trimestre",day:"dia",header:{year:"",month:"",day:""},show:{week:"{year} {weeknum}th semana {daystart} - {dayend}",weekInput:"{year} {week}th semana",quarter:"{year} {quarter}th trimestre"},months:{january:"Jan",february:"Fev",march:"Mar",april:"Abr",may:"Mai",june:"Jun",july:"Jul",august:"Ago",september:"Set",october:"Out",november:"Nov",december:"Dez"},weeks:{monday:"Seg",tuesday:"Ter",wednesday:"Qua",thursday:"Qui",friday:"Sex",saturday:"Sáb",sunday:"Dom"}},datepicker:{placeholder:"selecionar data",startTime:"Início",endTime:"Fim",customize:"personalizar",start:"Início",end:"Fim"},wordlimit:{warn:"Você está limitado a entrar {0} palavras"},wordcount:{warn:"Você excedeu {0} palavras"},treepicker:{selectDesc:"Você selecionou {0} items",placeholder:"por favor selecione"},search:{placeholder:"pesquisar...",searchText:"Pesquisar"},taginput:{limitWords:"Você excedeu o limite de caracteres"},table:{empty:"Nenhum resultado encontrado"},uploader:{upload:"Upload",reUpload:"ReUpload"},pagination:{incorrectFormat:"O formato do valor digitado está incorreto",overSize:"O valor que você inseriu excede o intervalo",totalBefore:"Total",totalAfter:"items",sizeOfPage:"{size} items/página"}}};o.default=t}}).default});
4,091
4,091
0.738206
c1c24e6aee042e21688d3295a176e0363ac9ac34
600
js
JavaScript
docs/html/release__docs_8py.js
abhi1625/human-detection-perception-module
e212c826923751e917d75358cd6f79f4e50c07c5
[ "MIT" ]
2
2020-01-30T18:54:50.000Z
2021-11-16T11:10:50.000Z
docs/html/release__docs_8py.js
abhi1625/human-detection-perception-module
e212c826923751e917d75358cd6f79f4e50c07c5
[ "MIT" ]
null
null
null
docs/html/release__docs_8py.js
abhi1625/human-detection-perception-module
e212c826923751e917d75358cd6f79f4e50c07c5
[ "MIT" ]
3
2019-11-09T05:10:21.000Z
2020-02-25T10:40:01.000Z
var release__docs_8py = [ [ "WikiBrancher", "classrelease__docs_1_1_wiki_brancher.html", "classrelease__docs_1_1_wiki_brancher" ], [ "DropWikiSuffix", "release__docs_8py.html#a6ea19a5ee397ce9f0565b90943d50e7f", null ], [ "main", "release__docs_8py.html#ac4eb92814ebe701e3936d1bfdd2ecf73", null ], [ "__author__", "release__docs_8py.html#a552c656ae88e89e818b44f18fa40967b", null ], [ "GMOCK_UNVERSIONED_WIKIS", "release__docs_8py.html#a675f92ba4643a6aef7773a6178e49b29", null ], [ "GTEST_UNVERSIONED_WIKIS", "release__docs_8py.html#aaeabb8c74d9db7a4b2f3c66e8f1a04ee", null ] ];
66.666667
108
0.786667
c1c2689049125e8a55c18703c41b3437ae41930e
2,342
js
JavaScript
public/assets/js/notif/js/notifier.js
giarsyaninuli/itnews
a74422aed20427349666759f601399a00921e333
[ "MIT" ]
null
null
null
public/assets/js/notif/js/notifier.js
giarsyaninuli/itnews
a74422aed20427349666759f601399a00921e333
[ "MIT" ]
null
null
null
public/assets/js/notif/js/notifier.js
giarsyaninuli/itnews
a74422aed20427349666759f601399a00921e333
[ "MIT" ]
null
null
null
/** Created by ** Author : Soufiane boukdir Website : http://www.bouksou.com **/ (function($){ var id = 1; $.extend({ notifier: function(options){ var defaults = { "type": "error", "title": "Message", "text": "-", "positionY": "top", "positionX": "right", "delay": 4000, "fadeOutdelay": 4000, "number" : 5, "animationIn" : 'shake', "animationIn_duration": 'slow', "animationOut" : 'drop', "animationOut_duration" : 'slow' } var positions; var parameters = $.extend(defaults,options); if(parameters.positionY=='top' && parameters.positionX=='right'){ positions = 'top:17px;right:10px'; pos = 'tr'; } else if(parameters.positionY=='top' && parameters.positionX=='left'){ positions = 'top:17px;left:10px'; pos = 'tl'; } else if(parameters.positionY=='bottom' && parameters.positionX=='right'){ positions = 'bottom:10px;right:10px'; pos = 'br'; } else if(parameters.positionY=='bottom' && parameters.positionX=='left'){ positions = 'bottom:10px;left:10px'; pos = 'bl'; } if(!$('#notifier').length>0 || $('#notifier').attr('class') != parameters.positionY.charAt(0)+parameters.positionX.charAt(0)){ $('#notifier').remove(); $('body').append('<ul id="notifier" class="'+ pos +'" style="'+ positions +'">'); } if($('.notif').length>parameters.number){ $('.notif').first().remove(); } $('#notifier').append('<li id="box'+ id +'" class="notif '+ parameters.type +'"><div class="icon"></div><div class="text"><h5>'+ parameters.title.substring(0,30) +'</h5><p>'+ parameters.text.substring(0,100) +'...</p></div><div class="close" data-id="'+ id +'"></div></li>'); $('#box'+id).css('margin-bottom','15px').effect(parameters.animationIn,parameters.animationIn_duration).delay(parameters.delay).effect(parameters.animationOut,parameters.animationOut_duration, function() { this.remove(); }); $('.notif .close').click(function() { var id = $(this).data('id'); $('#box'+id).remove(); }); id++; } }); })(jQuery);
32.985915
282
0.528181
c1c2e69c3b64ee506d540067371ec9aba69aaddb
111
js
JavaScript
both/index.js
WISVCH/app
6ddba40c0f38830daa05e32a576fa8f70504c5fa
[ "MIT" ]
null
null
null
both/index.js
WISVCH/app
6ddba40c0f38830daa05e32a576fa8f70504c5fa
[ "MIT" ]
null
null
null
both/index.js
WISVCH/app
6ddba40c0f38830daa05e32a576fa8f70504c5fa
[ "MIT" ]
null
null
null
if (Meteor.isClient) { // code to run on the client } if (Meteor.isServer) { // code to run on server }
13.875
32
0.621622
c1c34145a0c9ba03bd4cb5841aa281ce8ce70cf0
116
js
JavaScript
migrations/1_initial_migrations.js
alijnmerchant21/LIFE
9fc1f05b02ae677390c5e10cfb73e7630db8a763
[ "Unlicense" ]
1
2020-12-11T20:06:32.000Z
2020-12-11T20:06:32.000Z
migrations/1_initial_migrations.js
alijnmerchant21/LIFE
9fc1f05b02ae677390c5e10cfb73e7630db8a763
[ "Unlicense" ]
3
2020-07-19T11:34:06.000Z
2022-02-13T05:22:56.000Z
migrations/1_initial_migrations.js
alijnmerchant21/LIFE
9fc1f05b02ae677390c5e10cfb73e7630db8a763
[ "Unlicense" ]
null
null
null
var pharma = artifacts.require("./LIFE.sol"); module.exports = function(deployer) { deployer.deploy(pharma); };
16.571429
45
0.698276
c1c345e786ced4bcd75306d813a8d42172dc8627
45,802
js
JavaScript
client-js/lib/qrcode.js
hakanols/spider
2c4304aa284ba231a9d4b63a5b2713a9e8095508
[ "MIT" ]
2
2022-03-28T08:10:17.000Z
2022-03-29T17:47:55.000Z
client-js/lib/qrcode.js
hakanols/spider
2c4304aa284ba231a9d4b63a5b2713a9e8095508
[ "MIT" ]
null
null
null
client-js/lib/qrcode.js
hakanols/spider
2c4304aa284ba231a9d4b63a5b2713a9e8095508
[ "MIT" ]
null
null
null
/** * * <table width="100%"> * <tr> * <td> * <a href="https://github.com/rendaw/qrcode-generator-es6"><img src="https://raw.githubusercontent.com/primer/octicons/master/lib/svg/mark-github.svg?sanitize=true"> Github</a> * </td> * <td> * <a href="https://circleci.com/gh/rendaw/qrcode-generator-es6"><img alt="Build Status" src="https://circleci.com/gh/rendaw/qrcode-generator-es6.svg?style=svg"></a> * </td> * </table> * * ### How to use: * * First run: * * ``` * npm install --save qrcode-generator-es6 * ``` * * Then use it in your code like: * * ``` * import qrcode from './qrcode.js'; * * const qr = new qrcode(0, 'H'); * qr.addData('This is my data'); * qr.make(); * my_element.innerHTML = qr.createSvgTag({}); * ``` * * @module qrcode-generator-es6 */ //--------------------------------------------------------------------- // // QR Code Generator for JavaScript // // Copyright (c) 2009 Kazuhiko Arase // // URL: http://www.d-project.com/ // // Licensed under the MIT license: // http://www.opensource.org/licenses/mit-license.php // // The word 'QR Code' is registered trademark of // DENSO WAVE INCORPORATED // http://www.denso-wave.com/qrcode/faqpatent-e.html // //--------------------------------------------------------------------- const PAD0 = 0xEC; const PAD1 = 0x11; /** * Displays a QR code. Set the code data with `addData` and, call `make` and then call `createSvgTag` or `createImgTag`. * * See `gallery.html` for an example. * * @param {integer} typeNumber The minimum QR code type number from 1 to 40. Using 0 allows any QR code type number. * @param {String} errorCorrectionLevel 'L','M','Q','H' */ export default class qrcode { constructor(typeNumber, errorCorrectionLevel) { this._typeNumber = typeNumber; this._errorCorrectionLevel = QRErrorCorrectionLevel[errorCorrectionLevel]; this._modules = null; this._moduleCount = 0; this._dataCache = null; this._dataList = []; this.makeImpl = (test, maskPattern) => { this._moduleCount = this._typeNumber * 4 + 17; this._modules = function(moduleCount) { let modules = new Array(moduleCount); for (let row = 0; row < moduleCount; row += 1) { modules[row] = new Array(moduleCount); for (let col = 0; col < moduleCount; col += 1) { modules[row][col] = null; } } return modules; }(this._moduleCount); this.setupPositionProbePattern(0, 0); this.setupPositionProbePattern(this._moduleCount - 7, 0); this.setupPositionProbePattern(0, this._moduleCount - 7); this.setupPositionAdjustPattern(); this.setupTimingPattern(); this.setupTypeInfo(test, maskPattern); if (this._typeNumber >= 7) { this.setupTypeNumber(test); } if (this._dataCache == null) { this._dataCache = this.createData(this._typeNumber, this._errorCorrectionLevel, this._dataList); } this.mapData(this._dataCache, maskPattern); }; this.setupPositionProbePattern = (row, col) => { for (let r = -1; r <= 7; r += 1) { if (row + r <= -1 || this._moduleCount <= row + r) continue; for (let c = -1; c <= 7; c += 1) { if (col + c <= -1 || this._moduleCount <= col + c) continue; if ( (0 <= r && r <= 6 && (c == 0 || c == 6) ) || (0 <= c && c <= 6 && (r == 0 || r == 6) ) || (2 <= r && r <= 4 && 2 <= c && c <= 4) ) { this._modules[row + r][col + c] = true; } else { this._modules[row + r][col + c] = false; } } } }; this.getBestMaskPattern = () => { let minLostPoint = 0; let pattern = 0; for (let i = 0; i < 8; i += 1) { this.makeImpl(true, i); let lostPoint = QRUtil.getLostPoint(this); if (i == 0 || minLostPoint > lostPoint) { minLostPoint = lostPoint; pattern = i; } } return pattern; }; this.setupTimingPattern = () => { for (let r = 8; r < this._moduleCount - 8; r += 1) { if (this._modules[r][6] != null) { continue; } this._modules[r][6] = (r % 2 == 0); } for (let c = 8; c < this._moduleCount - 8; c += 1) { if (this._modules[6][c] != null) { continue; } this._modules[6][c] = (c % 2 == 0); } }; this.setupPositionAdjustPattern = () => { let pos = QRUtil.getPatternPosition(this._typeNumber); for (let i = 0; i < pos.length; i += 1) { for (let j = 0; j < pos.length; j += 1) { let row = pos[i]; let col = pos[j]; if (this._modules[row][col] != null) { continue; } for (let r = -2; r <= 2; r += 1) { for (let c = -2; c <= 2; c += 1) { if (r == -2 || r == 2 || c == -2 || c == 2 || (r == 0 && c == 0) ) { this._modules[row + r][col + c] = true; } else { this._modules[row + r][col + c] = false; } } } } } }; this.setupTypeNumber = (test) => { let bits = QRUtil.getBCHTypeNumber(this._typeNumber); for (let i = 0; i < 18; i += 1) { const mod = (!test && ( (bits >> i) & 1) == 1); this._modules[Math.floor(i / 3)][i % 3 + this._moduleCount - 8 - 3] = mod; } for (let i = 0; i < 18; i += 1) { const mod = (!test && ( (bits >> i) & 1) == 1); this._modules[i % 3 + this._moduleCount - 8 - 3][Math.floor(i / 3)] = mod; } }; this.setupTypeInfo = (test, maskPattern) => { let data = (this._errorCorrectionLevel << 3) | maskPattern; let bits = QRUtil.getBCHTypeInfo(data); // vertical for (let i = 0; i < 15; i += 1) { const mod = (!test && ( (bits >> i) & 1) == 1); if (i < 6) { this._modules[i][8] = mod; } else if (i < 8) { this._modules[i + 1][8] = mod; } else { this._modules[this._moduleCount - 15 + i][8] = mod; } } // horizontal for (let i = 0; i < 15; i += 1) { const mod = (!test && ( (bits >> i) & 1) == 1); if (i < 8) { this._modules[8][this._moduleCount - i - 1] = mod; } else if (i < 9) { this._modules[8][15 - i - 1 + 1] = mod; } else { this._modules[8][15 - i - 1] = mod; } } // fixed module this._modules[this._moduleCount - 8][8] = (!test); }; this.mapData = (data, maskPattern) => { let inc = -1; let row = this._moduleCount - 1; let bitIndex = 7; let byteIndex = 0; let maskFunc = QRUtil.getMaskFunction(maskPattern); for (let col = this._moduleCount - 1; col > 0; col -= 2) { if (col == 6) col -= 1; while (true) { for (let c = 0; c < 2; c += 1) { if (this._modules[row][col - c] == null) { let dark = false; if (byteIndex < data.length) { dark = ( ( (data[byteIndex] >>> bitIndex) & 1) == 1); } let mask = maskFunc(row, col - c); if (mask) { dark = !dark; } this._modules[row][col - c] = dark; bitIndex -= 1; if (bitIndex == -1) { byteIndex += 1; bitIndex = 7; } } } row += inc; if (row < 0 || this._moduleCount <= row) { row -= inc; inc = -inc; break; } } } }; this.createBytes = (buffer, rsBlocks) => { let offset = 0; let maxDcCount = 0; let maxEcCount = 0; let dcdata = new Array(rsBlocks.length); let ecdata = new Array(rsBlocks.length); for (let r = 0; r < rsBlocks.length; r += 1) { let dcCount = rsBlocks[r].dataCount; let ecCount = rsBlocks[r].totalCount - dcCount; maxDcCount = Math.max(maxDcCount, dcCount); maxEcCount = Math.max(maxEcCount, ecCount); dcdata[r] = new Array(dcCount); for (let i = 0; i < dcdata[r].length; i += 1) { dcdata[r][i] = 0xff & buffer.getBuffer()[i + offset]; } offset += dcCount; let rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount); let rawPoly = qrPolynomial(dcdata[r], rsPoly.getLength() - 1); let modPoly = rawPoly.mod(rsPoly); ecdata[r] = new Array(rsPoly.getLength() - 1); for (let i = 0; i < ecdata[r].length; i += 1) { let modIndex = i + modPoly.getLength() - ecdata[r].length; ecdata[r][i] = (modIndex >= 0)? modPoly.getAt(modIndex) : 0; } } let totalCodeCount = 0; for (let i = 0; i < rsBlocks.length; i += 1) { totalCodeCount += rsBlocks[i].totalCount; } let data = new Array(totalCodeCount); let index = 0; for (let i = 0; i < maxDcCount; i += 1) { for (let r = 0; r < rsBlocks.length; r += 1) { if (i < dcdata[r].length) { data[index] = dcdata[r][i]; index += 1; } } } for (let i = 0; i < maxEcCount; i += 1) { for (let r = 0; r < rsBlocks.length; r += 1) { if (i < ecdata[r].length) { data[index] = ecdata[r][i]; index += 1; } } } return data; }; this.createData = (typeNumber, errorCorrectionLevel, dataList) => { let rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectionLevel); let buffer = qrBitBuffer(); for (let i = 0; i < dataList.length; i += 1) { let data = dataList[i]; buffer.put(data.getMode(), 4); buffer.put(data.getLength(), QRUtil.getLengthInBits(data.getMode(), typeNumber) ); data.write(buffer); } // calc num max data. let totalDataCount = 0; for (let i = 0; i < rsBlocks.length; i += 1) { totalDataCount += rsBlocks[i].dataCount; } if (buffer.getLengthInBits() > totalDataCount * 8) { throw 'code length overflow. (' + buffer.getLengthInBits() + '>' + totalDataCount * 8 + ')'; } // end code if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) { buffer.put(0, 4); } // padding while (buffer.getLengthInBits() % 8 != 0) { buffer.putBit(false); } // padding while (true) { if (buffer.getLengthInBits() >= totalDataCount * 8) { break; } buffer.put(PAD0, 8); if (buffer.getLengthInBits() >= totalDataCount * 8) { break; } buffer.put(PAD1, 8); } return this.createBytes(buffer, rsBlocks); }; } addData(data, mode) { mode = mode || 'Byte'; let newData = null; switch(mode) { case 'Numeric' : newData = qrNumber(data); break; case 'Alphanumeric' : newData = qrAlphaNum(data); break; case 'Byte' : newData = qr8BitByte(data); break; case 'Kanji' : newData = qrKanji(data); break; default : throw 'mode:' + mode; } this._dataList.push(newData); this._dataCache = null; } /** * @returns {boolean} true if the module at `row, col` is dark. */ isDark(row, col) { if (row < 0 || this._moduleCount <= row || col < 0 || this._moduleCount <= col) { throw row + ',' + col; } return this._modules[row][col]; } /** * @returns {integer} The module count in one dimension of the QR code. The total number of modules is the square of this value. */ getModuleCount() { return this._moduleCount; } /** * Call this when done adding data before getting the generated QR code image. */ make() { if (this._typeNumber < 1) { let typeNumber = 1; for (; typeNumber < 40; typeNumber++) { let rsBlocks = QRRSBlock.getRSBlocks(typeNumber, this._errorCorrectionLevel); let buffer = qrBitBuffer(); for (let i = 0; i < this._dataList.length; i++) { let data = this._dataList[i]; buffer.put(data.getMode(), 4); buffer.put(data.getLength(), QRUtil.getLengthInBits(data.getMode(), typeNumber) ); data.write(buffer); } let totalDataCount = 0; for (let i = 0; i < rsBlocks.length; i++) { totalDataCount += rsBlocks[i].dataCount; } if (buffer.getLengthInBits() <= totalDataCount * 8) { break; } } this._typeNumber = typeNumber; } this.makeImpl(false, this.getBestMaskPattern()); } /** * @param {Object} args * @param {function} [args.drawCell] A callback with arguments `column, row, x, y` to draw a cell. `x, y` are the coordinates to draw it at. `c, y` are the QR code module indexes. Returns the svg element child string for the cell. * @param {function} [args.cellColor] A callback which returns the color for the cell. By default, a function that returns `black`. Unused if `drawCell` is provided. * @param {integer} [args.margin] The margin to draw around the QR code, by number of cells. * @param {Object} [args.obstruction] An image to place in the center of the QR code. * @param {integer} args.obstruction.width Width of the obstruction as a percentage of QR code width. * @param {integer} args.obstruction.height Height of the obstruction as a percentage of QR code height. * @param {String} args.obstruction.path The path of the obstruction image. Exclusive with svgData. * @param {String} args.obstruction.svgData The SVG data to embed as an obstruction. Must start with `<svg`. Exclusive with path. * @returns {String} An svg tag as a string. */ createSvgTag({drawCell, cellColor, cellSize, margin, obstruction}) { drawCell = drawCell || ((c, r, x, y) => '<rect ' + 'width="' + cellSize + '" ' + 'height="' + cellSize + '" ' + 'x="' + x + '" ' + 'y="' + y + '" ' + 'fill="' + cellColor(c, r) + '" ' + 'shape-rendering="crispEdges" ' + ' />' ); cellColor = cellColor || (() => 'black'); cellSize = cellSize || 2; margin = (typeof margin == 'undefined')? cellSize * 4 : margin; let size = this.getModuleCount() * cellSize + margin * 2; let qrSvg = ''; qrSvg += '<svg version="1.1"'; qrSvg += ' xmlns="http://www.w3.org/2000/svg"'; qrSvg += ' xmlns:xlink="http://www.w3.org/1999/xlink"'; qrSvg += ' viewBox="0 0 ' + size + ' ' + size + '" '; qrSvg += ' preserveAspectRatio="xMinYMin meet">'; qrSvg += '<rect width="100%" height="100%" fill="white" x="0" y="0"/>'; const modCount = this.getModuleCount(); const totalSize = modCount * cellSize + margin * 2; let obstructionCRStart, obstructionCREnd; if (obstruction) { const {width, height} = obstruction; const spans = [ Math.ceil(width * modCount), Math.ceil(height * modCount), ]; obstructionCRStart = spans.map(s => Math.floor(modCount / 2 - s / 2)); obstructionCREnd = spans.map(s => Math.ceil(modCount / 2 + s / 2)); } for (let r = 0; r < modCount; r += 1) { const mr = r * cellSize + margin; for (let c = 0; c < modCount; c += 1) { const mc = c * cellSize + margin; if ( obstruction && c >= obstructionCRStart[0] && c < obstructionCREnd[0] && r >= obstructionCRStart[1] && r < obstructionCREnd[1]) { if (c == obstructionCRStart[0] && r == obstructionCRStart[1]) { const img_attrs = ( 'x="' + (totalSize * (1.0 - obstruction.width) * 0.5).toFixed(3) + '" ' + 'y="' + (totalSize * (1.0 - obstruction.height) * 0.5).toFixed(3) + '" ' + 'width="' + (totalSize * obstruction.width).toFixed(3) + '" ' + 'height="' + (totalSize * obstruction.height).toFixed(3) + '" ' + 'preserveAspectRatio="xMidYMid meet" ' ); if (obstruction.path) { qrSvg += '<image ' + img_attrs + 'xlink:href="' + obstruction.path + '" />'; } else { qrSvg += '<svg ' + img_attrs + obstruction.svgData.substring(4); } } } else if (this.isDark(r, c) ) { qrSvg += drawCell(c, r, mc, mr); } } } qrSvg += '</svg>'; return qrSvg; } /** * @param {integer} cellSize The size of a module in pixels. * @param {integer} margin The margin to draw around the QR code in pixels. * @returns {String} An img tag as a string. */ createImgTag(cellSize, margin) { cellSize = cellSize || 2; margin = (typeof margin == 'undefined')? cellSize * 4 : margin; let size = this.getModuleCount() * cellSize + margin * 2; let min = margin; let max = size - margin; let self = this; return createImgTag(size, size, function(x, y) { if (min <= x && x < max && min <= y && y < max) { let c = Math.floor( (x - min) / cellSize); let r = Math.floor( (y - min) / cellSize); return self.isDark(r, c)? 0 : 1; } else { return 1; } } ); } } /** * */ export const stringToBytesFuncs = { 'default' : function(s) { let bytes = []; for (let i = 0; i < s.length; i += 1) { let c = s.charCodeAt(i); bytes.push(c & 0xff); } return bytes; }, }; /** * */ export const stringToBytes = stringToBytesFuncs['default']; //--------------------------------------------------------------------- // qrcode.createStringToBytes //--------------------------------------------------------------------- /** * */ const QRMode = { MODE_NUMBER: 1 << 0, MODE_ALPHA_NUM: 1 << 1, MODE_8BIT_BYTE: 1 << 2, MODE_KANJI: 1 << 3, }; /** * */ export const QRErrorCorrectionLevel = { L : 1, M : 0, Q : 3, H : 2, }; /** * */ const QRMaskPattern = { PATTERN000 : 0, PATTERN001 : 1, PATTERN010 : 2, PATTERN011 : 3, PATTERN100 : 4, PATTERN101 : 5, PATTERN110 : 6, PATTERN111 : 7, }; //--------------------------------------------------------------------- // QRUtil //--------------------------------------------------------------------- const QRUtil = function() { const PATTERN_POSITION_TABLE = [ [], [6, 18], [6, 22], [6, 26], [6, 30], [6, 34], [6, 22, 38], [6, 24, 42], [6, 26, 46], [6, 28, 50], [6, 30, 54], [6, 32, 58], [6, 34, 62], [6, 26, 46, 66], [6, 26, 48, 70], [6, 26, 50, 74], [6, 30, 54, 78], [6, 30, 56, 82], [6, 30, 58, 86], [6, 34, 62, 90], [6, 28, 50, 72, 94], [6, 26, 50, 74, 98], [6, 30, 54, 78, 102], [6, 28, 54, 80, 106], [6, 32, 58, 84, 110], [6, 30, 58, 86, 114], [6, 34, 62, 90, 118], [6, 26, 50, 74, 98, 122], [6, 30, 54, 78, 102, 126], [6, 26, 52, 78, 104, 130], [6, 30, 56, 82, 108, 134], [6, 34, 60, 86, 112, 138], [6, 30, 58, 86, 114, 142], [6, 34, 62, 90, 118, 146], [6, 30, 54, 78, 102, 126, 150], [6, 24, 50, 76, 102, 128, 154], [6, 28, 54, 80, 106, 132, 158], [6, 32, 58, 84, 110, 136, 162], [6, 26, 54, 82, 110, 138, 166], [6, 30, 58, 86, 114, 142, 170], ]; const G15 = (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0); const G18 = (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0); const G15_MASK = (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1); let _this = {}; let getBCHDigit = function(data) { let digit = 0; while (data != 0) { digit += 1; data >>>= 1; } return digit; }; _this.getBCHTypeInfo = function(data) { let d = data << 10; while (getBCHDigit(d) - getBCHDigit(G15) >= 0) { d ^= (G15 << (getBCHDigit(d) - getBCHDigit(G15) ) ); } return ( (data << 10) | d) ^ G15_MASK; }; _this.getBCHTypeNumber = function(data) { let d = data << 12; while (getBCHDigit(d) - getBCHDigit(G18) >= 0) { d ^= (G18 << (getBCHDigit(d) - getBCHDigit(G18) ) ); } return (data << 12) | d; }; _this.getPatternPosition = function(typeNumber) { return PATTERN_POSITION_TABLE[typeNumber - 1]; }; _this.getMaskFunction = function(maskPattern) { switch (maskPattern) { case QRMaskPattern.PATTERN000 : return function(i, j) { return (i + j) % 2 == 0; }; case QRMaskPattern.PATTERN001 : return function(i, _) { return i % 2 == 0; }; case QRMaskPattern.PATTERN010 : return function(i, j) { return j % 3 == 0; }; case QRMaskPattern.PATTERN011 : return function(i, j) { return (i + j) % 3 == 0; }; case QRMaskPattern.PATTERN100 : return function(i, j) { return (Math.floor(i / 2) + Math.floor(j / 3) ) % 2 == 0; }; case QRMaskPattern.PATTERN101 : return function(i, j) { return (i * j) % 2 + (i * j) % 3 == 0; }; case QRMaskPattern.PATTERN110 : return function(i, j) { return ( (i * j) % 2 + (i * j) % 3) % 2 == 0; }; case QRMaskPattern.PATTERN111 : return function(i, j) { return ( (i * j) % 3 + (i + j) % 2) % 2 == 0; }; default : throw 'bad maskPattern:' + maskPattern; } }; _this.getErrorCorrectPolynomial = function(errorCorrectLength) { let a = qrPolynomial([1], 0); for (let i = 0; i < errorCorrectLength; i += 1) { a = a.multiply(qrPolynomial([1, QRMath.gexp(i)], 0) ); } return a; }; _this.getLengthInBits = function(mode, type) { if (1 <= type && type < 10) { // 1 - 9 switch(mode) { case QRMode.MODE_NUMBER : return 10; case QRMode.MODE_ALPHA_NUM : return 9; case QRMode.MODE_8BIT_BYTE : return 8; case QRMode.MODE_KANJI : return 8; default : throw 'mode:' + mode; } } else if (type < 27) { // 10 - 26 switch(mode) { case QRMode.MODE_NUMBER : return 12; case QRMode.MODE_ALPHA_NUM : return 11; case QRMode.MODE_8BIT_BYTE : return 16; case QRMode.MODE_KANJI : return 10; default : throw 'mode:' + mode; } } else if (type < 41) { // 27 - 40 switch(mode) { case QRMode.MODE_NUMBER : return 14; case QRMode.MODE_ALPHA_NUM : return 13; case QRMode.MODE_8BIT_BYTE : return 16; case QRMode.MODE_KANJI : return 12; default : throw 'mode:' + mode; } } else { throw 'type:' + type; } }; _this.getLostPoint = function(qrcode) { let moduleCount = qrcode.getModuleCount(); let lostPoint = 0; // LEVEL1 for (let row = 0; row < moduleCount; row += 1) { for (let col = 0; col < moduleCount; col += 1) { let sameCount = 0; let dark = qrcode.isDark(row, col); for (let r = -1; r <= 1; r += 1) { if (row + r < 0 || moduleCount <= row + r) { continue; } for (let c = -1; c <= 1; c += 1) { if (col + c < 0 || moduleCount <= col + c) { continue; } if (r == 0 && c == 0) { continue; } if (dark == qrcode.isDark(row + r, col + c) ) { sameCount += 1; } } } if (sameCount > 5) { lostPoint += (3 + sameCount - 5); } } } // LEVEL2 for (let row = 0; row < moduleCount - 1; row += 1) { for (let col = 0; col < moduleCount - 1; col += 1) { let count = 0; if (qrcode.isDark(row, col) ) count += 1; if (qrcode.isDark(row + 1, col) ) count += 1; if (qrcode.isDark(row, col + 1) ) count += 1; if (qrcode.isDark(row + 1, col + 1) ) count += 1; if (count == 0 || count == 4) { lostPoint += 3; } } } // LEVEL3 for (let row = 0; row < moduleCount; row += 1) { for (let col = 0; col < moduleCount - 6; col += 1) { if (qrcode.isDark(row, col) && !qrcode.isDark(row, col + 1) && qrcode.isDark(row, col + 2) && qrcode.isDark(row, col + 3) && qrcode.isDark(row, col + 4) && !qrcode.isDark(row, col + 5) && qrcode.isDark(row, col + 6) ) { lostPoint += 40; } } } for (let col = 0; col < moduleCount; col += 1) { for (let row = 0; row < moduleCount - 6; row += 1) { if (qrcode.isDark(row, col) && !qrcode.isDark(row + 1, col) && qrcode.isDark(row + 2, col) && qrcode.isDark(row + 3, col) && qrcode.isDark(row + 4, col) && !qrcode.isDark(row + 5, col) && qrcode.isDark(row + 6, col) ) { lostPoint += 40; } } } // LEVEL4 let darkCount = 0; for (let col = 0; col < moduleCount; col += 1) { for (let row = 0; row < moduleCount; row += 1) { if (qrcode.isDark(row, col) ) { darkCount += 1; } } } let ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5; lostPoint += ratio * 10; return lostPoint; }; return _this; }(); //--------------------------------------------------------------------- // QRMath //--------------------------------------------------------------------- let QRMath = function() { let EXP_TABLE = new Array(256); let LOG_TABLE = new Array(256); // initialize tables for (let i = 0; i < 8; i += 1) { EXP_TABLE[i] = 1 << i; } for (let i = 8; i < 256; i += 1) { EXP_TABLE[i] = EXP_TABLE[i - 4] ^ EXP_TABLE[i - 5] ^ EXP_TABLE[i - 6] ^ EXP_TABLE[i - 8]; } for (let i = 0; i < 255; i += 1) { LOG_TABLE[EXP_TABLE[i] ] = i; } let _this = {}; _this.glog = function(n) { if (n < 1) { throw 'glog(' + n + ')'; } return LOG_TABLE[n]; }; _this.gexp = function(n) { while (n < 0) { n += 255; } while (n >= 256) { n -= 255; } return EXP_TABLE[n]; }; return _this; }(); //--------------------------------------------------------------------- // qrPolynomial //--------------------------------------------------------------------- function qrPolynomial(num, shift) { if (typeof num.length == 'undefined') { throw num.length + '/' + shift; } let _num = function() { let offset = 0; while (offset < num.length && num[offset] == 0) { offset += 1; } let _num = new Array(num.length - offset + shift); for (let i = 0; i < num.length - offset; i += 1) { _num[i] = num[i + offset]; } return _num; }(); let _this = {}; _this.getAt = function(index) { return _num[index]; }; _this.getLength = function() { return _num.length; }; _this.multiply = function(e) { let num = new Array(_this.getLength() + e.getLength() - 1); for (let i = 0; i < _this.getLength(); i += 1) { for (let j = 0; j < e.getLength(); j += 1) { num[i + j] ^= QRMath.gexp(QRMath.glog(_this.getAt(i) ) + QRMath.glog(e.getAt(j) ) ); } } return qrPolynomial(num, 0); }; _this.mod = function(e) { if (_this.getLength() - e.getLength() < 0) { return _this; } let ratio = QRMath.glog(_this.getAt(0) ) - QRMath.glog(e.getAt(0) ); let num = new Array(_this.getLength() ); for (let i = 0; i < _this.getLength(); i += 1) { num[i] = _this.getAt(i); } for (let i = 0; i < e.getLength(); i += 1) { num[i] ^= QRMath.gexp(QRMath.glog(e.getAt(i) ) + ratio); } // recursive call return qrPolynomial(num, 0).mod(e); }; return _this; } //--------------------------------------------------------------------- // QRRSBlock //--------------------------------------------------------------------- const QRRSBlock = function() { let RS_BLOCK_TABLE = [ // L // M // Q // H // 1 [1, 26, 19], [1, 26, 16], [1, 26, 13], [1, 26, 9], // 2 [1, 44, 34], [1, 44, 28], [1, 44, 22], [1, 44, 16], // 3 [1, 70, 55], [1, 70, 44], [2, 35, 17], [2, 35, 13], // 4 [1, 100, 80], [2, 50, 32], [2, 50, 24], [4, 25, 9], // 5 [1, 134, 108], [2, 67, 43], [2, 33, 15, 2, 34, 16], [2, 33, 11, 2, 34, 12], // 6 [2, 86, 68], [4, 43, 27], [4, 43, 19], [4, 43, 15], // 7 [2, 98, 78], [4, 49, 31], [2, 32, 14, 4, 33, 15], [4, 39, 13, 1, 40, 14], // 8 [2, 121, 97], [2, 60, 38, 2, 61, 39], [4, 40, 18, 2, 41, 19], [4, 40, 14, 2, 41, 15], // 9 [2, 146, 116], [3, 58, 36, 2, 59, 37], [4, 36, 16, 4, 37, 17], [4, 36, 12, 4, 37, 13], // 10 [2, 86, 68, 2, 87, 69], [4, 69, 43, 1, 70, 44], [6, 43, 19, 2, 44, 20], [6, 43, 15, 2, 44, 16], // 11 [4, 101, 81], [1, 80, 50, 4, 81, 51], [4, 50, 22, 4, 51, 23], [3, 36, 12, 8, 37, 13], // 12 [2, 116, 92, 2, 117, 93], [6, 58, 36, 2, 59, 37], [4, 46, 20, 6, 47, 21], [7, 42, 14, 4, 43, 15], // 13 [4, 133, 107], [8, 59, 37, 1, 60, 38], [8, 44, 20, 4, 45, 21], [12, 33, 11, 4, 34, 12], // 14 [3, 145, 115, 1, 146, 116], [4, 64, 40, 5, 65, 41], [11, 36, 16, 5, 37, 17], [11, 36, 12, 5, 37, 13], // 15 [5, 109, 87, 1, 110, 88], [5, 65, 41, 5, 66, 42], [5, 54, 24, 7, 55, 25], [11, 36, 12, 7, 37, 13], // 16 [5, 122, 98, 1, 123, 99], [7, 73, 45, 3, 74, 46], [15, 43, 19, 2, 44, 20], [3, 45, 15, 13, 46, 16], // 17 [1, 135, 107, 5, 136, 108], [10, 74, 46, 1, 75, 47], [1, 50, 22, 15, 51, 23], [2, 42, 14, 17, 43, 15], // 18 [5, 150, 120, 1, 151, 121], [9, 69, 43, 4, 70, 44], [17, 50, 22, 1, 51, 23], [2, 42, 14, 19, 43, 15], // 19 [3, 141, 113, 4, 142, 114], [3, 70, 44, 11, 71, 45], [17, 47, 21, 4, 48, 22], [9, 39, 13, 16, 40, 14], // 20 [3, 135, 107, 5, 136, 108], [3, 67, 41, 13, 68, 42], [15, 54, 24, 5, 55, 25], [15, 43, 15, 10, 44, 16], // 21 [4, 144, 116, 4, 145, 117], [17, 68, 42], [17, 50, 22, 6, 51, 23], [19, 46, 16, 6, 47, 17], // 22 [2, 139, 111, 7, 140, 112], [17, 74, 46], [7, 54, 24, 16, 55, 25], [34, 37, 13], // 23 [4, 151, 121, 5, 152, 122], [4, 75, 47, 14, 76, 48], [11, 54, 24, 14, 55, 25], [16, 45, 15, 14, 46, 16], // 24 [6, 147, 117, 4, 148, 118], [6, 73, 45, 14, 74, 46], [11, 54, 24, 16, 55, 25], [30, 46, 16, 2, 47, 17], // 25 [8, 132, 106, 4, 133, 107], [8, 75, 47, 13, 76, 48], [7, 54, 24, 22, 55, 25], [22, 45, 15, 13, 46, 16], // 26 [10, 142, 114, 2, 143, 115], [19, 74, 46, 4, 75, 47], [28, 50, 22, 6, 51, 23], [33, 46, 16, 4, 47, 17], // 27 [8, 152, 122, 4, 153, 123], [22, 73, 45, 3, 74, 46], [8, 53, 23, 26, 54, 24], [12, 45, 15, 28, 46, 16], // 28 [3, 147, 117, 10, 148, 118], [3, 73, 45, 23, 74, 46], [4, 54, 24, 31, 55, 25], [11, 45, 15, 31, 46, 16], // 29 [7, 146, 116, 7, 147, 117], [21, 73, 45, 7, 74, 46], [1, 53, 23, 37, 54, 24], [19, 45, 15, 26, 46, 16], // 30 [5, 145, 115, 10, 146, 116], [19, 75, 47, 10, 76, 48], [15, 54, 24, 25, 55, 25], [23, 45, 15, 25, 46, 16], // 31 [13, 145, 115, 3, 146, 116], [2, 74, 46, 29, 75, 47], [42, 54, 24, 1, 55, 25], [23, 45, 15, 28, 46, 16], // 32 [17, 145, 115], [10, 74, 46, 23, 75, 47], [10, 54, 24, 35, 55, 25], [19, 45, 15, 35, 46, 16], // 33 [17, 145, 115, 1, 146, 116], [14, 74, 46, 21, 75, 47], [29, 54, 24, 19, 55, 25], [11, 45, 15, 46, 46, 16], // 34 [13, 145, 115, 6, 146, 116], [14, 74, 46, 23, 75, 47], [44, 54, 24, 7, 55, 25], [59, 46, 16, 1, 47, 17], // 35 [12, 151, 121, 7, 152, 122], [12, 75, 47, 26, 76, 48], [39, 54, 24, 14, 55, 25], [22, 45, 15, 41, 46, 16], // 36 [6, 151, 121, 14, 152, 122], [6, 75, 47, 34, 76, 48], [46, 54, 24, 10, 55, 25], [2, 45, 15, 64, 46, 16], // 37 [17, 152, 122, 4, 153, 123], [29, 74, 46, 14, 75, 47], [49, 54, 24, 10, 55, 25], [24, 45, 15, 46, 46, 16], // 38 [4, 152, 122, 18, 153, 123], [13, 74, 46, 32, 75, 47], [48, 54, 24, 14, 55, 25], [42, 45, 15, 32, 46, 16], // 39 [20, 147, 117, 4, 148, 118], [40, 75, 47, 7, 76, 48], [43, 54, 24, 22, 55, 25], [10, 45, 15, 67, 46, 16], // 40 [19, 148, 118, 6, 149, 119], [18, 75, 47, 31, 76, 48], [34, 54, 24, 34, 55, 25], [20, 45, 15, 61, 46, 16], ]; let qrRSBlock = function(totalCount, dataCount) { let _this = {}; _this.totalCount = totalCount; _this.dataCount = dataCount; return _this; }; let _this = {}; let getRsBlockTable = function(typeNumber, errorCorrectionLevel) { switch(errorCorrectionLevel) { case QRErrorCorrectionLevel.L : return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0]; case QRErrorCorrectionLevel.M : return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1]; case QRErrorCorrectionLevel.Q : return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2]; case QRErrorCorrectionLevel.H : return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3]; default : return undefined; } }; _this.getRSBlocks = function(typeNumber, errorCorrectionLevel) { let rsBlock = getRsBlockTable(typeNumber, errorCorrectionLevel); if (typeof rsBlock == 'undefined') { throw 'bad rs block @ typeNumber:' + typeNumber + '/errorCorrectionLevel:' + errorCorrectionLevel; } let length = rsBlock.length / 3; let list = []; for (let i = 0; i < length; i += 1) { let count = rsBlock[i * 3 + 0]; let totalCount = rsBlock[i * 3 + 1]; let dataCount = rsBlock[i * 3 + 2]; for (let j = 0; j < count; j += 1) { list.push(qrRSBlock(totalCount, dataCount) ); } } return list; }; return _this; }(); //--------------------------------------------------------------------- // qrBitBuffer //--------------------------------------------------------------------- let qrBitBuffer = function() { let _buffer = []; let _length = 0; let _this = {}; _this.getBuffer = function() { return _buffer; }; _this.getAt = function(index) { let bufIndex = Math.floor(index / 8); return ( (_buffer[bufIndex] >>> (7 - index % 8) ) & 1) == 1; }; _this.put = function(num, length) { for (let i = 0; i < length; i += 1) { _this.putBit( ( (num >>> (length - i - 1) ) & 1) == 1); } }; _this.getLengthInBits = function() { return _length; }; _this.putBit = function(bit) { let bufIndex = Math.floor(_length / 8); if (_buffer.length <= bufIndex) { _buffer.push(0); } if (bit) { _buffer[bufIndex] |= (0x80 >>> (_length % 8) ); } _length += 1; }; return _this; }; //--------------------------------------------------------------------- // qrNumber //--------------------------------------------------------------------- let qrNumber = function(data) { let _mode = QRMode.MODE_NUMBER; let _data = data; let _this = {}; _this.getMode = function() { return _mode; }; _this.getLength = function(_) { return _data.length; }; _this.write = function(buffer) { let data = _data; let i = 0; while (i + 2 < data.length) { buffer.put(strToNum(data.substring(i, i + 3) ), 10); i += 3; } if (i < data.length) { if (data.length - i == 1) { buffer.put(strToNum(data.substring(i, i + 1) ), 4); } else if (data.length - i == 2) { buffer.put(strToNum(data.substring(i, i + 2) ), 7); } } }; const strToNum = function(s) { let num = 0; for (let i = 0; i < s.length; i += 1) { num = num * 10 + chatToNum(s.charAt(i) ); } return num; }; const chatToNum = function(c) { if ('0' <= c && c <= '9') { return c.charCodeAt(0) - '0'.charCodeAt(0); } throw 'illegal char :' + c; }; return _this; }; //--------------------------------------------------------------------- // qrAlphaNum //--------------------------------------------------------------------- const qrAlphaNum = function(data) { let _mode = QRMode.MODE_ALPHA_NUM; let _data = data; let _this = {}; _this.getMode = function() { return _mode; }; _this.getLength = function(_) { return _data.length; }; _this.write = function(buffer) { let s = _data; let i = 0; while (i + 1 < s.length) { buffer.put( getCode(s.charAt(i) ) * 45 + getCode(s.charAt(i + 1) ), 11); i += 2; } if (i < s.length) { buffer.put(getCode(s.charAt(i) ), 6); } }; const getCode = function(c) { if ('0' <= c && c <= '9') { return c.charCodeAt(0) - '0'.charCodeAt(0); } else if ('A' <= c && c <= 'Z') { return c.charCodeAt(0) - 'A'.charCodeAt(0) + 10; } else { switch (c) { case ' ' : return 36; case '$' : return 37; case '%' : return 38; case '*' : return 39; case '+' : return 40; case '-' : return 41; case '.' : return 42; case '/' : return 43; case ':' : return 44; default : throw 'illegal char :' + c; } } }; return _this; }; //--------------------------------------------------------------------- // qr8BitByte //--------------------------------------------------------------------- const qr8BitByte = function(data) { let _mode = QRMode.MODE_8BIT_BYTE; let _bytes = stringToBytes(data); let _this = {}; _this.getMode = function() { return _mode; }; _this.getLength = function(_) { return _bytes.length; }; _this.write = function(buffer) { for (let i = 0; i < _bytes.length; i += 1) { buffer.put(_bytes[i], 8); } }; return _this; }; //--------------------------------------------------------------------- // qrKanji //--------------------------------------------------------------------- const qrKanji = function(data) { let _mode = QRMode.MODE_KANJI; let stringToBytes = stringToBytesFuncs['SJIS']; if (!stringToBytes) { throw 'sjis not supported.'; } !function(c, code) { // self test for sjis support. let test = stringToBytes(c); if (test.length != 2 || ( (test[0] << 8) | test[1]) != code) { throw 'sjis not supported.'; } }('\u53cb', 0x9746); let _bytes = stringToBytes(data); let _this = {}; _this.getMode = function() { return _mode; }; _this.getLength = function(_) { return ~~(_bytes.length / 2); }; _this.write = function(buffer) { let data = _bytes; let i = 0; while (i + 1 < data.length) { let c = ( (0xff & data[i]) << 8) | (0xff & data[i + 1]); if (0x8140 <= c && c <= 0x9FFC) { c -= 0x8140; } else if (0xE040 <= c && c <= 0xEBBF) { c -= 0xC140; } else { throw 'illegal char at ' + (i + 1) + '/' + c; } c = ( (c >>> 8) & 0xff) * 0xC0 + (c & 0xff); buffer.put(c, 13); i += 2; } if (i < data.length) { throw 'illegal char at ' + (i + 1); } }; return _this; }; //===================================================================== // GIF Support etc. // //--------------------------------------------------------------------- // byteArrayOutputStream //--------------------------------------------------------------------- let byteArrayOutputStream = function() { let _bytes = []; let _this = {}; _this.writeByte = function(b) { _bytes.push(b & 0xff); }; _this.writeShort = function(i) { _this.writeByte(i); _this.writeByte(i >>> 8); }; _this.writeBytes = function(b, off, len) { off = off || 0; len = len || b.length; for (let i = 0; i < len; i += 1) { _this.writeByte(b[i + off]); } }; _this.writeString = function(s) { for (let i = 0; i < s.length; i += 1) { _this.writeByte(s.charCodeAt(i) ); } }; _this.toByteArray = function() { return _bytes; }; _this.toString = function() { let s = ''; s += '['; for (let i = 0; i < _bytes.length; i += 1) { if (i > 0) { s += ','; } s += _bytes[i]; } s += ']'; return s; }; return _this; }; //--------------------------------------------------------------------- // base64EncodeOutputStream //--------------------------------------------------------------------- let base64EncodeOutputStream = function() { let _buffer = 0; let _buflen = 0; let _length = 0; let _base64 = ''; let _this = {}; let writeEncoded = function(b) { _base64 += String.fromCharCode(encode(b & 0x3f) ); }; const encode = function(n) { if (n < 0) { // error. } else if (n < 26) { return 0x41 + n; } else if (n < 52) { return 0x61 + (n - 26); } else if (n < 62) { return 0x30 + (n - 52); } else if (n == 62) { return 0x2b; } else if (n == 63) { return 0x2f; } throw 'n:' + n; }; _this.writeByte = function(n) { _buffer = (_buffer << 8) | (n & 0xff); _buflen += 8; _length += 1; while (_buflen >= 6) { writeEncoded(_buffer >>> (_buflen - 6) ); _buflen -= 6; } }; _this.flush = function() { if (_buflen > 0) { writeEncoded(_buffer << (6 - _buflen) ); _buffer = 0; _buflen = 0; } if (_length % 3 != 0) { // padding let padlen = 3 - _length % 3; for (let i = 0; i < padlen; i += 1) { _base64 += '='; } } }; _this.toString = function() { return _base64; }; return _this; }; //--------------------------------------------------------------------- // base64DecodeInputStream //--------------------------------------------------------------------- const base64DecodeInputStream = function(str) { let _str = str; let _pos = 0; let _buffer = 0; let _buflen = 0; let _this = {}; _this.read = function() { while (_buflen < 8) { if (_pos >= _str.length) { if (_buflen == 0) { return -1; } throw 'unexpected end of file./' + _buflen; } let c = _str.charAt(_pos); _pos += 1; if (c == '=') { _buflen = 0; return -1; } else if (c.match(/^\s$/) ) { // ignore if whitespace. continue; } _buffer = (_buffer << 6) | decode(c.charCodeAt(0) ); _buflen += 6; } let n = (_buffer >>> (_buflen - 8) ) & 0xff; _buflen -= 8; return n; }; const decode = function(c) { if (0x41 <= c && c <= 0x5a) { return c - 0x41; } else if (0x61 <= c && c <= 0x7a) { return c - 0x61 + 26; } else if (0x30 <= c && c <= 0x39) { return c - 0x30 + 52; } else if (c == 0x2b) { return 62; } else if (c == 0x2f) { return 63; } else { throw 'c:' + c; } }; return _this; }; //--------------------------------------------------------------------- // gifImage (B/W) //--------------------------------------------------------------------- let gifImage = function(width, height) { let _width = width; let _height = height; let _data = new Array(width * height); let _this = {}; _this.setPixel = function(x, y, pixel) { _data[y * _width + x] = pixel; }; _this.write = function(out) { //--------------------------------- // GIF Signature out.writeString('GIF87a'); //--------------------------------- // Screen Descriptor out.writeShort(_width); out.writeShort(_height); out.writeByte(0x80); // 2bit out.writeByte(0); out.writeByte(0); //--------------------------------- // Global Color Map // black out.writeByte(0x00); out.writeByte(0x00); out.writeByte(0x00); // white out.writeByte(0xff); out.writeByte(0xff); out.writeByte(0xff); //--------------------------------- // Image Descriptor out.writeString(','); out.writeShort(0); out.writeShort(0); out.writeShort(_width); out.writeShort(_height); out.writeByte(0); //--------------------------------- // Local Color Map //--------------------------------- // Raster Data let lzwMinCodeSize = 2; let raster = getLZWRaster(lzwMinCodeSize); out.writeByte(lzwMinCodeSize); let offset = 0; while (raster.length - offset > 255) { out.writeByte(255); out.writeBytes(raster, offset, 255); offset += 255; } out.writeByte(raster.length - offset); out.writeBytes(raster, offset, raster.length - offset); out.writeByte(0x00); //--------------------------------- // GIF Terminator out.writeString(';'); }; let bitOutputStream = function(out) { let _out = out; let _bitLength = 0; let _bitBuffer = 0; let _this = {}; _this.write = function(data, length) { if ( (data >>> length) != 0) { throw 'length over'; } while (_bitLength + length >= 8) { _out.writeByte(0xff & ( (data << _bitLength) | _bitBuffer) ); length -= (8 - _bitLength); data >>>= (8 - _bitLength); _bitBuffer = 0; _bitLength = 0; } _bitBuffer = (data << _bitLength) | _bitBuffer; _bitLength = _bitLength + length; }; _this.flush = function() { if (_bitLength > 0) { _out.writeByte(_bitBuffer); } }; return _this; }; const getLZWRaster = function(lzwMinCodeSize) { let clearCode = 1 << lzwMinCodeSize; let endCode = (1 << lzwMinCodeSize) + 1; let bitLength = lzwMinCodeSize + 1; // Setup LZWTable let table = lzwTable(); for (let i = 0; i < clearCode; i += 1) { table.add(String.fromCharCode(i) ); } table.add(String.fromCharCode(clearCode) ); table.add(String.fromCharCode(endCode) ); let byteOut = byteArrayOutputStream(); let bitOut = bitOutputStream(byteOut); // clear code bitOut.write(clearCode, bitLength); let dataIndex = 0; let s = String.fromCharCode(_data[dataIndex]); dataIndex += 1; while (dataIndex < _data.length) { let c = String.fromCharCode(_data[dataIndex]); dataIndex += 1; if (table.contains(s + c) ) { s = s + c; } else { bitOut.write(table.indexOf(s), bitLength); if (table.size() < 0xfff) { if (table.size() == (1 << bitLength) ) { bitLength += 1; } table.add(s + c); } s = c; } } bitOut.write(table.indexOf(s), bitLength); // end code bitOut.write(endCode, bitLength); bitOut.flush(); return byteOut.toByteArray(); }; const lzwTable = function() { let _map = {}; let _size = 0; let _this = {}; _this.add = function(key) { if (_this.contains(key) ) { throw 'dup key:' + key; } _map[key] = _size; _size += 1; }; _this.size = function() { return _size; }; _this.indexOf = function(key) { return _map[key]; }; _this.contains = function(key) { return typeof _map[key] != 'undefined'; }; return _this; }; return _this; }; const createImgTag = function(width, height, getPixel, alt) { let gif = gifImage(width, height); for (let y = 0; y < height; y += 1) { for (let x = 0; x < width; x += 1) { gif.setPixel(x, y, getPixel(x, y) ); } } let b = byteArrayOutputStream(); gif.write(b); let base64 = base64EncodeOutputStream(); let bytes = b.toByteArray(); for (let i = 0; i < bytes.length; i += 1) { base64.writeByte(bytes[i]); } base64.flush(); let img = ''; img += '<img'; img += '\u0020src="'; img += 'data:image/gif;base64,'; img += base64; img += '"'; img += '\u0020width="'; img += width; img += '"'; img += '\u0020height="'; img += height; img += '"'; if (alt) { img += '\u0020alt="'; img += alt; img += '"'; } img += '/>'; return img; }; // multibyte support stringToBytesFuncs['UTF-8'] = function(s) { // http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array function toUTF8Array(str) { let utf8 = []; for (let i=0; i < str.length; i++) { let charcode = str.charCodeAt(i); if (charcode < 0x80) utf8.push(charcode); else if (charcode < 0x800) { utf8.push(0xc0 | (charcode >> 6), 0x80 | (charcode & 0x3f)); } else if (charcode < 0xd800 || charcode >= 0xe000) { utf8.push(0xe0 | (charcode >> 12), 0x80 | ((charcode>>6) & 0x3f), 0x80 | (charcode & 0x3f)); } // surrogate pair else { i++; // UTF-16 encodes 0x10000-0x10FFFF by // subtracting 0x10000 and splitting the // 20 bits of 0x0-0xFFFFF into two halves charcode = 0x10000 + (((charcode & 0x3ff)<<10) | (str.charCodeAt(i) & 0x3ff)); utf8.push(0xf0 | (charcode >>18), 0x80 | ((charcode>>12) & 0x3f), 0x80 | ((charcode>>6) & 0x3f), 0x80 | (charcode & 0x3f)); } } return utf8; } return toUTF8Array(s); };
21.820867
234
0.513427
c1c36da91b869c537dc1bf909ff5ce5a382af64c
348
js
JavaScript
441. Arranging Coins/solution.js
Rukeith/leetcode
001aaf83968889d0cbc634dcc3bd1b59728d1ecc
[ "MIT" ]
3
2018-06-19T08:36:32.000Z
2019-03-25T04:05:04.000Z
441. Arranging Coins/solution.js
Rukeith/leetcode
001aaf83968889d0cbc634dcc3bd1b59728d1ecc
[ "MIT" ]
null
null
null
441. Arranging Coins/solution.js
Rukeith/leetcode
001aaf83968889d0cbc634dcc3bd1b59728d1ecc
[ "MIT" ]
null
null
null
/** * @param {number} n * @return {number} */ var arrangeCoins = function(n) { if (n < 2) return n; let first = 0; let last = n; while (first < last) { const mid = Math.floor(first + (last - first) / 2); const target = ((mid + 1) * mid) / 2; if (target > n) last = mid; else first = mid + 1; } return first - 1; };
18.315789
55
0.522989
c1c38ed8ff0cb9eda8e321b721ad51070309c21e
1,821
js
JavaScript
rawtexts/parse.js
MacbethJ/political-life
018f9a45b7a6ce1ee2f63841eb587bbfaa4d11bb
[ "MIT" ]
33
2019-01-08T02:52:22.000Z
2022-02-24T17:59:19.000Z
rawtexts/parse.js
MichaelZuo/political-life
018f9a45b7a6ce1ee2f63841eb587bbfaa4d11bb
[ "MIT" ]
9
2019-08-01T09:22:36.000Z
2022-01-04T06:50:04.000Z
rawtexts/parse.js
MichaelZuo/political-life
018f9a45b7a6ce1ee2f63841eb587bbfaa4d11bb
[ "MIT" ]
23
2018-09-22T19:57:05.000Z
2021-12-12T09:47:40.000Z
const rawText = `11.txt`; const readline = require('readline'); const fs = require('fs'); let writeStream = null; const reg = new RegExp(/(\d+月\d+日)(星期.)/); let newfilename = null; if (!String.prototype.padStart) { String.prototype.padStart = function padStart(targetLength, padString) { targetLength = targetLength >> 0; //truncate if number or convert non-number to 0; padString = String((typeof padString !== 'undefined' ? padString : ' ')); if (this.length > targetLength) { return String(this); } else { targetLength = targetLength - this.length; if (targetLength > padString.length) { padString += padString.repeat(targetLength / padString.length); //append to original to ensure we are longer than needed } return padString.slice(0, targetLength) + String(this); } }; } fs.readdir(`${__dirname}/../src/pages/cn`, (err, files) => { let maxNo = Math.max(...files.map((filename) => parseInt(filename.substr(0, 4)))); const rl = readline.createInterface({ input: fs.createReadStream(`${__dirname}/${rawText}`) }); rl.on('line', function (line) { if (line.match(reg)) { maxNo++; newfilename = maxNo.toString().padStart(4, '0') + ".md"; let newline = line.trim().replace(reg, "title: '$1 $2'"); fs.appendFileSync(`${__dirname}/../src/pages/test/${newfilename}`, `---\n`); fs.appendFileSync(`${__dirname}/../src/pages/test/${newfilename}`, `${newline}\n`); fs.appendFileSync(`${__dirname}/../src/pages/test/${newfilename}`, `---\n`); } else { fs.appendFileSync(`${__dirname}/../src/pages/test/${newfilename}`, `${line.trim()}\n`); } }); });
39.586957
136
0.57441
c1c3b38bfef9759e9cbcd3a166d1f577eb515ddd
751
js
JavaScript
src/index.js
guilhermesteves/callboy
df490af060c1d368dfa8797ca0ce08cdc102ad4b
[ "MIT" ]
2
2019-09-27T18:52:54.000Z
2019-12-12T16:18:03.000Z
src/index.js
guilhermesteves/callboy
df490af060c1d368dfa8797ca0ce08cdc102ad4b
[ "MIT" ]
null
null
null
src/index.js
guilhermesteves/callboy
df490af060c1d368dfa8797ca0ce08cdc102ad4b
[ "MIT" ]
null
null
null
const { exec } = require('child_process') const { promisify } = require('util') const path = require('path') const fs = require('fs') const execPromise = promisify(exec) const mainPath = path.dirname(fs.realpathSync(__filename)) const soundPath = path.join(mainPath, './audios/callboy') const windowsScript = path.join(mainPath, './forWindows.jscript') const callboy = () => { const commandsForEachPlatform = { linux: `paplay ${soundPath}.ogg`, win32: `cscript /E:JScript /nologo "${windowsScript}" "${soundPath}.mp3"`, darwin: `afplay ${soundPath}.mp3`, } const platform = process.platform const codeToExecute = commandsForEachPlatform[platform] return execPromise(codeToExecute) } module.exports = callboy
30.04
80
0.700399
c1c51fac8b65fb46e8238734dca863b7ab936be1
1,636
js
JavaScript
src/contentful/render.js
Digital-Scope/diyar
6040509251a6c97381f3412cb622cace5028bb61
[ "MIT" ]
null
null
null
src/contentful/render.js
Digital-Scope/diyar
6040509251a6c97381f3412cb622cace5028bb61
[ "MIT" ]
null
null
null
src/contentful/render.js
Digital-Scope/diyar
6040509251a6c97381f3412cb622cace5028bb61
[ "MIT" ]
null
null
null
/* eslint global-require: off */ /* eslint import/no-dynamic-require: off */ /* eslint no-underscore-dangle: off */ import React from 'react'; import debug from '../shared/debug'; import componentsInfo from './components'; /* Renders a contentful component based on the `typename` */ export const renderComponent = (component, { keyPrefix, sections = false, props } = {}) => { const knownComponentInfo = componentsInfo.find(({ typename }) => typename === component.__typename); if (!knownComponentInfo) { if (debug) { console.warn(`[contentful/renderComponent] No component found to render "${component.__typename}". Skipping...`); } return null; } if (Object.keys(component).length === 1 && debug) { console.warn(`[contentful/renderComponent] No data found to render "${component.__typename}". Maybe you forgot to update the graphql query?`); } const module = require(`./components/${knownComponentInfo.path}`); // If we are rendering the components as sections, try to use the Section export // and fallback to the default export const Component = (sections ? module.Section || module.default : module.default) || module; return ( <Component key={`${keyPrefix != null ? `${keyPrefix}-` : ''}${component.id || component.__typename}`} {...props} data={component} /> ); }; /* Renders a series of components */ export const renderPage = (components, options) => ( components.map((component, index) => ( renderComponent(component, { keyPrefix: index, sections: true, ...options }) )) ); export default { renderComponent, renderPage, };
28.701754
146
0.668704
c1c52b118511fb0cf6053f399a93db79e80aee2e
3,327
js
JavaScript
src/client/left-list/left-list.js
johneisenheim/uwclient
15eb9d73d65aaed4366346eadc6d42f87cb0863f
[ "MIT" ]
null
null
null
src/client/left-list/left-list.js
johneisenheim/uwclient
15eb9d73d65aaed4366346eadc6d42f87cb0863f
[ "MIT" ]
null
null
null
src/client/left-list/left-list.js
johneisenheim/uwclient
15eb9d73d65aaed4366346eadc6d42f87cb0863f
[ "MIT" ]
null
null
null
import React, { Component } from 'react'; import { withStyles } from 'material-ui/styles'; import List, { ListItem, ListItemIcon, ListItemText, ListItemSecondaryAction } from 'material-ui/List'; import Divider from 'material-ui/Divider'; import InboxIcon from '@material-ui/icons/Inbox'; import DraftsIcon from '@material-ui/icons/Drafts'; import Badge from 'material-ui/Badge'; import ShoppingBasket from '@material-ui/icons/ShoppingBasket'; import CollectionIcon from '@material-ui/icons/Style'; import SearchIcon from '@material-ui/icons/Search'; import CommentIcon from '@material-ui/icons/Comment'; const styles = theme => ({ root: { width: '90%', display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', backgroundColor: '#FFFFFF', borderRadius: 5, boxShadow: '0 2px 4px 0 rgba(0,0,0,0.05)' }, list: { width: '100%', }, listItem: { color: '#808080', fontFamily: 'Roboto', fontSize: 14, fontWeight: 500 }, margin: { marginLeft: -20 }, icon: { color: '#808080' } }); class LeftList extends Component { constructor(props) { super(props) } render() { const { classes } = this.props; return ( <div className={classes.root}> <List className={classes.list}> <ListItem button> <ShoppingBasket className={classes.icon} /> <ListItemText primary="Your orders" classes={{ primary: classes.listItem }} /> <ListItemSecondaryAction> <Badge className={classes.margin} badgeContent={3} color="primary"> </Badge> </ListItemSecondaryAction> </ListItem> <Divider light={true} /> <ListItem button> <CollectionIcon className={classes.icon} /> <ListItemText primary="Your collection" classes={{ primary: classes.listItem }} /> <ListItemSecondaryAction> <Badge className={classes.margin} badgeContent={8} color="secondary"> </Badge> </ListItemSecondaryAction> </ListItem> <Divider light={true} /> <ListItem button> <SearchIcon className={classes.icon} /> <ListItemText primary="Search products" classes={{ primary: classes.listItem }} /> </ListItem> <Divider light={true} /> <ListItem button> <CommentIcon className={classes.icon} /> <ListItemText primary="Comments" classes={{ primary: classes.listItem }} /> <ListItemSecondaryAction> <Badge className={classes.margin} badgeContent={2} color="secondary"> </Badge> </ListItemSecondaryAction> </ListItem> </List> </div> ) } } export default withStyles(styles)(LeftList);
37.382022
106
0.518485
c1c566b1a259bd3c135803ee9794923ec3007b36
928
js
JavaScript
src/components/MetaDecorator/index.js
HackRU/mentorq
59eadcfb2e2a328e938ec5b4f3667723f87a2a7b
[ "MIT" ]
1
2020-08-24T18:52:49.000Z
2020-08-24T18:52:49.000Z
src/components/MetaDecorator/index.js
HackRU/mentorq
59eadcfb2e2a328e938ec5b4f3667723f87a2a7b
[ "MIT" ]
76
2019-02-23T20:26:27.000Z
2022-03-30T16:08:44.000Z
src/components/MetaDecorator/index.js
HackRU/mentorq
59eadcfb2e2a328e938ec5b4f3667723f87a2a7b
[ "MIT" ]
3
2019-08-22T01:47:49.000Z
2022-03-30T16:46:35.000Z
import React from "react"; import PropTypes from "prop-types"; import { Helmet } from "react-helmet"; import { HOSTNAME } from "../../constants"; import red_hackru_notif from "../../design/media/red_hackru_notif.png"; import red_hackru from "../../design/media/red_hackru.png"; const MetaDecorator = ({ title, description, notif, imageAlt }) => { return ( <Helmet> <title>{title}</title> <meta property="og:title" content={title} /> <meta name="description" content={description} /> <meta property="og:description" content={description} /> <link rel="shortcut icon" href={notif ? HOSTNAME + red_hackru_notif : HOSTNAME + red_hackru} /> </Helmet> ); }; MetaDecorator.propTypes = { title: PropTypes.string.isRequired, description: PropTypes.string.isRequired, imageAlt: PropTypes.string.isRequired, }; export default MetaDecorator;
35.692308
107
0.657328
c1c58bc2397d08c74000980d64e343992e7c8de6
7,886
js
JavaScript
src/layout.graph.js
oliverhuynh/my-mind
5a09cccecc9e554e5b0d040ca7ef07ca0349409e
[ "MIT" ]
null
null
null
src/layout.graph.js
oliverhuynh/my-mind
5a09cccecc9e554e5b0d040ca7ef07ca0349409e
[ "MIT" ]
null
null
null
src/layout.graph.js
oliverhuynh/my-mind
5a09cccecc9e554e5b0d040ca7ef07ca0349409e
[ "MIT" ]
null
null
null
MM.Layout.Graph = Object.create(MM.Layout, { SPACING_RANK: { value: 16 }, childDirection: { value: '' } }); MM.Layout.Graph.getChildDirection = function (child) { return this.childDirection; }; MM.Layout.Graph.create = function (direction, id, label) { var layout = Object.create(this, { childDirection: { value: direction }, id: { value: id }, label: { value: label } }); MM.Layout.ALL.push(layout); return layout; }; MM.Layout.Graph.update = function (item) { var side = this.childDirection; if (!item.isRoot()) { side = item.getParent().getLayout().getChildDirection(item); } this._alignItem(item, side); this._layoutItem(item, this.childDirection); if (this.childDirection == 'left' || this.childDirection == 'right') { this._drawLinesHorizontal(item, this.childDirection); } else { this._drawLinesVertical(item, this.childDirection); } return this; }; /** * Generic graph child layout routine. Updates item's orthogonal size according to the sum of its children. */ MM.Layout.Graph._layoutItem = function (item, rankDirection) { var sizeProps = ['width', 'height']; var posProps = ['left', 'top']; var rankIndex = rankDirection == 'left' || rankDirection == 'right' ? 0 : 1; var childIndex = (rankIndex + 1) % 2; var rankPosProp = posProps[rankIndex]; var childPosProp = posProps[childIndex]; var rankSizeProp = sizeProps[rankIndex]; var childSizeProp = sizeProps[childIndex]; var dom = item.getDOM(); /* content size */ var contentSize = [dom.content.offsetWidth, dom.content.offsetHeight]; /* children size */ var bbox = this._computeChildrenBBox(item.getChildren(), childIndex); /* node size */ var rankSize = contentSize[rankIndex]; if (bbox[rankIndex]) { rankSize += bbox[rankIndex] + this.SPACING_RANK; } var childSize = Math.max(bbox[childIndex], contentSize[childIndex]); dom.node.style[rankSizeProp] = rankSize + 'px'; dom.node.style[childSizeProp] = childSize + 'px'; var offset = [0, 0]; if (rankDirection == 'right') { offset[0] = contentSize[0] + this.SPACING_RANK; } if (rankDirection == 'bottom') { offset[1] = contentSize[1] + this.SPACING_RANK; } offset[childIndex] = Math.round((childSize - bbox[childIndex]) / 2); this._layoutChildren(item.getChildren(), rankDirection, offset, bbox); /* label position */ var labelPos = 0; if (rankDirection == 'left') { labelPos = rankSize - contentSize[0]; } if (rankDirection == 'top') { labelPos = rankSize - contentSize[1]; } dom.content.style[childPosProp] = Math.round((childSize - contentSize[childIndex]) / 2) + 'px'; dom.content.style[rankPosProp] = labelPos + 'px'; return this; }; MM.Layout.Graph._layoutChildren = function ( children, rankDirection, offset, bbox ) { var posProps = ['left', 'top']; var rankIndex = rankDirection == 'left' || rankDirection == 'right' ? 0 : 1; var childIndex = (rankIndex + 1) % 2; var rankPosProp = posProps[rankIndex]; var childPosProp = posProps[childIndex]; children.forEach(function (child, index) { var node = child.getDOM().node; var childSize = [node.offsetWidth, node.offsetHeight]; if (rankDirection == 'left') { offset[0] = bbox[0] - childSize[0]; } if (rankDirection == 'top') { offset[1] = bbox[1] - childSize[1]; } node.style[childPosProp] = offset[childIndex] + 'px'; node.style[rankPosProp] = offset[rankIndex] + 'px'; offset[childIndex] += childSize[childIndex] + this.SPACING_CHILD; /* offset for next child */ }, this); return bbox; }; MM.Layout.Graph._drawLinesHorizontal = function (item, side) { this._anchorCanvas(item); this._drawHorizontalConnectors(item, side, item.getChildren()); }; MM.Layout.Graph._drawLinesVertical = function (item, side) { this._anchorCanvas(item); this._drawVerticalConnectors(item, side, item.getChildren()); }; MM.Layout.Graph._drawHorizontalConnectors = function (item, side, children) { if (children.length == 0) { return; } var dom = item.getDOM(); var canvas = dom.canvas; var ctx = canvas.getContext('2d'); ctx.strokeStyle = item.getColor(); var R = this.SPACING_RANK / 2; /* first part */ var y1 = item.getShape().getVerticalAnchor(item); if (side == 'left') { var x1 = dom.content.offsetLeft - 0.5; } else { var x1 = dom.content.offsetWidth + dom.content.offsetLeft + 0.5; } this._anchorToggle(item, x1, y1, side); if (item.isCollapsed()) { return; } if (children.length == 1) { var child = children[0]; var y2 = child.getShape().getVerticalAnchor(child) + child.getDOM().node.offsetTop; var x2 = this._getChildAnchor(child, side); ctx.beginPath(); ctx.moveTo(x1, y1); ctx.bezierCurveTo((x1 + x2) / 2, y1, (x1 + x2) / 2, y2, x2, y2); ctx.stroke(); return; } if (side == 'left') { var x2 = x1 - R; } else { var x2 = x1 + R; } ctx.beginPath(); ctx.moveTo(x1, y1); ctx.lineTo(x2, y1); ctx.stroke(); /* rounded connectors */ var c1 = children[0]; var c2 = children[children.length - 1]; var x = x2; var xx = x + (side == 'left' ? -R : R); var y1 = c1.getShape().getVerticalAnchor(c1) + c1.getDOM().node.offsetTop; var y2 = c2.getShape().getVerticalAnchor(c2) + c2.getDOM().node.offsetTop; var x1 = this._getChildAnchor(c1, side); var x2 = this._getChildAnchor(c2, side); ctx.beginPath(); ctx.moveTo(x1, y1); ctx.lineTo(xx, y1); ctx.arcTo(x, y1, x, y1 + R, R); ctx.lineTo(x, y2 - R); ctx.arcTo(x, y2, xx, y2, R); ctx.lineTo(x2, y2); for (var i = 1; i < children.length - 1; i++) { var c = children[i]; var y = c.getShape().getVerticalAnchor(c) + c.getDOM().node.offsetTop; ctx.moveTo(x, y); ctx.lineTo(this._getChildAnchor(c, side), y); } ctx.stroke(); }; MM.Layout.Graph._drawVerticalConnectors = function (item, side, children) { if (children.length == 0) { return; } var dom = item.getDOM(); var canvas = dom.canvas; var ctx = canvas.getContext('2d'); ctx.strokeStyle = item.getColor(); /* first part */ var R = this.SPACING_RANK / 2; var x = item.getShape().getHorizontalAnchor(item); var height = children.length == 1 ? 2 * R : R; if (side == 'top') { var y1 = canvas.height - dom.content.offsetHeight; var y2 = y1 - height; this._anchorToggle(item, x, y1, side); } else { var y1 = item.getShape().getVerticalAnchor(item); var y2 = dom.content.offsetHeight + height; this._anchorToggle(item, x, dom.content.offsetHeight, side); } ctx.beginPath(); ctx.moveTo(x, y1); ctx.lineTo(x, y2); ctx.stroke(); if (children.length == 1) { return; } /* rounded connectors */ var c1 = children[0]; var c2 = children[children.length - 1]; var offset = dom.content.offsetHeight + height; var y = Math.round(side == 'top' ? canvas.height - offset : offset) + 0.5; var x1 = c1.getShape().getHorizontalAnchor(c1) + c1.getDOM().node.offsetLeft; var x2 = c2.getShape().getHorizontalAnchor(c2) + c2.getDOM().node.offsetLeft; var y1 = this._getChildAnchor(c1, side); var y2 = this._getChildAnchor(c2, side); ctx.beginPath(); ctx.moveTo(x1, y1); ctx.arcTo(x1, y, x1 + R, y, R); ctx.lineTo(x2 - R, y); ctx.arcTo(x2, y, x2, y2, R); for (var i = 1; i < children.length - 1; i++) { var c = children[i]; var x = c.getShape().getHorizontalAnchor(c) + c.getDOM().node.offsetLeft; ctx.moveTo(x, y); ctx.lineTo(x, this._getChildAnchor(c, side)); } ctx.stroke(); }; MM.Layout.Graph.Down = MM.Layout.Graph.create( 'bottom', 'graph-bottom', 'Bottom' ); MM.Layout.Graph.Up = MM.Layout.Graph.create('top', 'graph-top', 'Top'); MM.Layout.Graph.Left = MM.Layout.Graph.create('left', 'graph-left', 'Left'); MM.Layout.Graph.Right = MM.Layout.Graph.create('right', 'graph-right', 'Right');
27.964539
107
0.642911
c1c63c38635b59a0795b8c9d7130c646b03631da
523
js
JavaScript
js-test-suite/testsuite/ba175c6bfb9db47ffd45f9cfa3d22659.js
hao-wang/Montage
d1c98ec7dbe20d0449f0d02694930cf1f69a5cea
[ "MIT" ]
16
2020-03-23T12:53:10.000Z
2021-10-11T02:31:50.000Z
js-test-suite/testsuite/ba175c6bfb9db47ffd45f9cfa3d22659.js
hao-wang/Montage
d1c98ec7dbe20d0449f0d02694930cf1f69a5cea
[ "MIT" ]
null
null
null
js-test-suite/testsuite/ba175c6bfb9db47ffd45f9cfa3d22659.js
hao-wang/Montage
d1c98ec7dbe20d0449f0d02694930cf1f69a5cea
[ "MIT" ]
1
2020-08-17T14:06:59.000Z
2020-08-17T14:06:59.000Z
load("8b38e12cab5de21ec5393724c0d9b7dd.js"); //------------------------------------------------------------------------------------------------------- // Copyright (C) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. //------------------------------------------------------------------------------------------------------- var func1 = function() { var ary = new Array(1); ary.map(function(a) { }); } func1(); print("Pass");
37.357143
105
0.416826
c1c68960a39758d3fc925181b4b8c2904b3ae11c
8,054
js
JavaScript
js/script.js
xxelegyxx/js-quiz
e3e17c9e9e84267c9a979f8eb0b48860173f8a43
[ "MIT" ]
1
2021-07-06T04:27:37.000Z
2021-07-06T04:27:37.000Z
js/script.js
xxelegyxx/js-quiz
e3e17c9e9e84267c9a979f8eb0b48860173f8a43
[ "MIT" ]
null
null
null
js/script.js
xxelegyxx/js-quiz
e3e17c9e9e84267c9a979f8eb0b48860173f8a43
[ "MIT" ]
null
null
null
//Section list const QUIZ_SECTIONS = document.querySelectorAll(".quiz-section"); //Start const START_SECTION = document.getElementById("start"); const START_BTN = document.getElementById("start-button"); //Quiz questions const QUIZ_SECTION = document.getElementById("quiz-questions"); const TIME_REMAINING = document.getElementById("time-remaining"); const QUESTION = document.getElementById("question"); const CHOICES = document.getElementById("choices"); const CHOICE_STATUSES = document.querySelectorAll(".choice-status"); const CORRECT = document.getElementById("correct"); const WRONG = document.getElementById("wrong"); //End const END_SECTION = document.getElementById("end"); const END_TITLE = document.getElementById("end-title"); const SCORE = document.getElementById("score"); const INITIALS_INPUT = document.getElementById("initials"); const SUBMIT_SCORE = document.getElementById("submit-score"); const ERROR_MESSAGE = document.getElementById("error-message"); //Questions class Question { constructor(question, choices, indexOfCorrectChoice) { this.question = question; this.choices = choices; this.indexOfCorrectChoice = indexOfCorrectChoice; } } const QUESTION_1 = new Question("Which of the following is the correct syntax to redirect a url using JS?", ["document.location='http://www.newlocation.com'", "browser.location='http://www.newlocation.com'", "navigator.location='http://www.newlocation.com'", "window.location='http://www.newlocation.com'"], 3); const QUESTION_2 = new Question("Which built-in method returns the length of the string?", ["length()", "size()", "index()", "None of the above"], 0); const QUESTION_3 = new Question("Which of the following function of Number object formats a number with a specific number of digits to the right of the decimal?", ["toExponential()", "toFixed()", "toPrecision()", "toLocaleString()"], 1); const QUESTION_4 = new Question("String values must be enclosed within _____ when being assigned to variables.", ["Commas", "Curly brackets", "Quotes", "Parentheses"], 2); const QUESTION_5 = new Question("A very useful tool used during development and debugging for printing content to the debugger is: ", ["JavaScript", "Terminal/Bash", "For Loops", "console.log"], 3); const QUESTION_LIST = [QUESTION_1, QUESTION_2, QUESTION_3, QUESTION_4, QUESTION_5]; let currentQuestion = 0; let totalTime = 75; let totalTimeInterval; let choiceStatusTimeout; /******** EVENT LISTENERS ********/ START_BTN.addEventListener('click', startGame); CHOICES.addEventListener('click', processChoice); SUBMIT_SCORE.addEventListener('submit', processInput); /******** START GAME ********/ function startGame() { showElement(QUIZ_SECTIONS, QUIZ_SECTION); displayTime(); displayQuestion(); startTimer(); } /******** SHOWING/HIDING ELEMENTS ********/ function showElement(siblingList, showElement) { for (element of siblingList) { hideElement(element); } showElement.classList.remove("hidden"); } function hideElement(element) { if (!element.classList.contains("hidden")) { element.classList.add("hidden"); } } /******** TIME ********/ function displayTime() { TIME_REMAINING.textContent = totalTime; } function startTimer() { totalTimeInterval = setInterval(function() { totalTime--; displayTime(); checkTime(); }, 1000); } function checkTime() { if (totalTime <= 0) { totalTime = 0; endGame(); } } /******** QUESTIONS ********/ function displayQuestion() { QUESTION.textContent = QUESTION_LIST[currentQuestion].question; displayChoiceList(); } function displayChoiceList() { CHOICES.innerHTML = ""; QUESTION_LIST[currentQuestion].choices.forEach(function(answer, index) { const li = document.createElement("li"); li.dataset.index = index; const button = document.createElement("button"); button.textContent = (index + 1) + ". " + answer; li.appendChild(button); CHOICES.appendChild(li); }); } //when user answers a question function processChoice(event) { const userChoice = parseInt(event.target.parentElement.dataset.index); resetChoiceStatusEffects(); checkChoice(userChoice); getNextQuestion(); } //Displaying choice statuses function resetChoiceStatusEffects() { clearTimeout(choiceStatusTimeout); styleTimeRemainingDefault(); } function styleTimeRemainingDefault() { TIME_REMAINING.style.color = "#4616E8"; } function styleTimeRemainingWrong() { TIME_REMAINING.style.color = "#E81648"; } function checkChoice(userChoice) { if (isChoiceCorrect(userChoice)) { displayCorrectChoiceEffects(); } else { displayWrongChoiceEffects(); } } function isChoiceCorrect(choice) { return choice === QUESTION_LIST[currentQuestion].indexOfCorrectChoice; } function displayWrongChoiceEffects() { deductTimeBy(10); styleTimeRemainingWrong(); showElement(CHOICE_STATUSES, WRONG); choiceStatusTimeout = setTimeout(function() { hideElement(WRONG); styleTimeRemainingDefault(); }, 1000); } function deductTimeBy(seconds) { totalTime -= seconds; checkTime(); displayTime(); } function displayCorrectChoiceEffects() { showElement(CHOICE_STATUSES, CORRECT); choiceStatusTimeout = setTimeout(function() { hideElement(CORRECT); }, 1000); } //Get next question function getNextQuestion() { currentQuestion++; if (currentQuestion >= QUESTION_LIST.length) { endGame(); } else { displayQuestion(); } } /******** ENDING THE GAME ********/ function endGame() { clearInterval(totalTimeInterval); showElement(QUIZ_SECTIONS, END_SECTION); displayScore(); setEndHeading(); } function displayScore() { SCORE.textContent = totalTime; } function setEndHeading() { if (totalTime === 0) { END_TITLE.textContent = "Sorry! time out!"; } else { END_TITLE.textContent = "Congrats! You're done!"; } } /******** SUBMITTING INITIALS ********/ function processInput(event) { event.preventDefault(); const initials = INITIALS_INPUT.value.toUpperCase(); if (isInputValid(initials)) { const score = totalTime; const highscoreEntry = getNewHighscoreEntry(initials, score); saveHighscoreEntry(highscoreEntry); window.location.href= "./highscores.html"; } } function getNewHighscoreEntry(initials, score) { const entry = { initials: initials, score: score, } return entry; } function isInputValid(initials) { let errorMessage = ""; if (initials === "") { errorMessage = "You can't submit empty initials!"; displayFormError(errorMessage); return false; } else if (initials.match(/[^a-z]/ig)) { errorMessage = "Initials may only include letters." displayFormError(errorMessage); return false; } else { return true; } } function displayFormError(errorMessage) { ERROR_MESSAGE.textContent = errorMessage; if (!INITIALS_INPUT.classList.contains("error")) { INITIALS_INPUT.classList.add("error"); } } function saveHighscoreEntry(highscoreEntry) { const currentScores = getScoreList(); placeEntryInHighscoreList(highscoreEntry, currentScores); localStorage.setItem('scoreList', JSON.stringify(currentScores)); } function getScoreList() { const currentScores = localStorage.getItem('scoreList'); if (currentScores) { return JSON.parse(currentScores); } else { return []; } } function placeEntryInHighscoreList(newEntry, scoreList) { const newScoreIndex = getNewScoreIndex(newEntry, scoreList); scoreList.splice(newScoreIndex, 0, newEntry); } function getNewScoreIndex(newEntry, scoreList) { if (scoreList.length > 0) { for (let i = 0; i < scoreList.length; i++) { if (scoreList[i].score <= newEntry.score) { return i; } } } return scoreList.length; }
28.160839
206
0.687112
c1c7ecc19b9c6622ec51399464e0245ea51ad7e3
318
js
JavaScript
test/autotests/components-browser/input-no-value/test.js
ulivz/marko
b16e16a556c88a2b9b5b78ee3a1bf37b9d708317
[ "MIT" ]
null
null
null
test/autotests/components-browser/input-no-value/test.js
ulivz/marko
b16e16a556c88a2b9b5b78ee3a1bf37b9d708317
[ "MIT" ]
null
null
null
test/autotests/components-browser/input-no-value/test.js
ulivz/marko
b16e16a556c88a2b9b5b78ee3a1bf37b9d708317
[ "MIT" ]
null
null
null
var expect = require('chai').expect; module.exports = function(helpers) { var component = helpers.mount(require('./index.marko')); expect(component.getEl('searchInput').value).to.equal(''); component.increment(); component.update(); expect(component.getEl('searchInput').value).to.equal(''); };
26.5
62
0.672956
c1c7fe33d68bae652f22027a252d40b0f8e482f6
425
js
JavaScript
spec/javascripts/models/other_entry_spec.js
Modularfield/pageflow
840901b6e11da50b6bc4a06afb31cf3f3e98c069
[ "MIT" ]
1
2019-06-16T15:34:47.000Z
2019-06-16T15:34:47.000Z
spec/javascripts/models/other_entry_spec.js
karstengresch/pageflow
63b57087c88b4bd2f661c184df29e59783cc37b6
[ "MIT" ]
1
2022-03-02T12:32:41.000Z
2022-03-02T12:32:41.000Z
spec/javascripts/models/other_entry_spec.js
karstengresch/pageflow
63b57087c88b4bd2f661c184df29e59783cc37b6
[ "MIT" ]
null
null
null
describe('OtherEntry', function() { describe('#getFileCollection', function() { it('returns file collection for entry by fileType', function() { var entry = new pageflow.OtherEntry({id: 34}); var imageFileType = support.factories.imageFileType(); var collection = entry.getFileCollection(imageFileType); expect(collection.url()).to.eq('/editor/entries/34/files/image_files'); }); }); });
35.416667
77
0.677647
c1c8120b2dcc7c6c5b347e165aa98c31656bd918
971
js
JavaScript
__stories__/space.js
Chronstruct/primitives
ef6c67fad836316d54362b1543e293aff0c2c7d2
[ "MIT" ]
2
2018-01-09T22:01:20.000Z
2019-04-05T17:37:35.000Z
__stories__/space.js
Chronstruct/primitives
ef6c67fad836316d54362b1543e293aff0c2c7d2
[ "MIT" ]
80
2018-01-09T22:56:26.000Z
2022-03-23T02:03:31.000Z
__stories__/space.js
Chronstruct/primitives
ef6c67fad836316d54362b1543e293aff0c2c7d2
[ "MIT" ]
null
null
null
import React from "react" import { storiesOf } from "@storybook/react" import { action } from "@storybook/addon-actions" import { css } from "linaria" storiesOf("space", module) .add("horizontal", () => ( <row height={200} width={400}> <view grow style={{ backgroundColor: "red", }} /> <view grow style={{ backgroundColor: "green", }} /> <space size={20} /> <view grow style={{ backgroundColor: "blue", }} /> </row> )) .add("vertical", () => ( <col height={200} width={400}> <view grow style={{ backgroundColor: "red", }} /> <view grow style={{ backgroundColor: "green", }} /> <space size={20} /> <view grow style={{ backgroundColor: "blue", }} /> </col> ))
18.320755
49
0.426365
c1c841a13f61aacfd8c605f58b412e33e8800af2
4,695
js
JavaScript
dist/angular-bubbletree.min.js
amgadfahmi/angular-bubbletree
639482c65c406acb670f9b5703892fdcf04309cd
[ "Apache-2.0" ]
7
2016-06-04T15:49:09.000Z
2022-01-19T17:40:42.000Z
dist/angular-bubbletree.min.js
amgadfahmi/angular-bubbletree
639482c65c406acb670f9b5703892fdcf04309cd
[ "Apache-2.0" ]
1
2016-08-25T20:46:58.000Z
2017-04-02T15:27:52.000Z
dist/angular-bubbletree.min.js
amgadfahmi/angular-bubbletree
639482c65c406acb670f9b5703892fdcf04309cd
[ "Apache-2.0" ]
5
2016-06-22T04:57:56.000Z
2018-12-19T07:18:43.000Z
!function(e){e.module("angular-bubbletree.config",[]).value("angular-bubbletree.config",{debug:!0}),e.module("angular-bubbletree.directives",[]),e.module("angular-bubbletree.filters",[]),e.module("angular-bubbletree.services",[]),e.module("angular-bubbletree.controllers",[]),e.module("angular-bubbletree",["angular-bubbletree.config","angular-bubbletree.directives","angular-bubbletree.filters","angular-bubbletree.services","angular-bubbletree.controllers"])}(angular),function(){"use strict";function e(e,t){return{name:"bubbletree",scope:{datasource:"=",control:"="},restrict:"E",replace:!0,transclude:!1,link:function(r,a,l){function n(){var e;r.params={},e=l.id?r.params.id=l.id:r.params.id="bubbletree",e=l.width?r.params.width=l.width:r.params.width=1e3,e=l.height?r.params.height=l.height:r.params.height=400,e=l.linkDistance?r.params.linkDistance=l.linkDistance:r.params.linkDistance=100,e=l.enableTooltip?r.params.enableTooltip=r.$eval(l.enableTooltip):r.params.enableTooltip=!0,e=l.fillStyle&&["solid","gradient"].indexOf(l.fillStyle)>=0?r.params.fillStyle=l.fillStyle:r.params.fillStyle="gradient",e=l.parentColor?r.params.parentColor=l.parentColor:r.params.parentColor="#336699",e=l.childColor?r.params.childColor=l.childColor:r.params.childColor="#e0e0eb",e=l.collapsedColor?r.params.collapsedColor=l.collapsedColor:r.params.collapsedColor="#19334d",e=l.linkColor?r.params.linkColor=l.linkColor:r.params.linkColor="#9ecae1",e=l.textX?r.params.textX=l.textX:r.params.textX="1.45em",e=l.textY?r.params.textY=l.textY:r.params.textY="3.45em",e=l.scaleScore?r.params.scaleScore=l.scaleScore:r.params.scaleScore=10,c=d3.layout.force().linkDistance(r.params.linkDistance).charge(-120).gravity(.01).size([r.params.width,r.params.height]).on("tick",i),u=d3.select("#"+l.id).append("svg").attr("width",f).attr("height",g),p=u.selectAll(".btLink"),b=u.selectAll(".btNode"),r.params.enableTooltip&&(d=d3.select("#"+l.id).append("div").attr("class","btTooltip").style("opacity",0))}function o(){var e=t.flatten(m,h),a=d3.layout.tree().links(e);c.nodes(e).links(a).start(),p=p.data(a,function(e){return e.target.id}),p.exit().remove(),p.enter().insert("line",".btNode").attr("class","btLink"),r.params.linkColor&&p.attr("style","stroke:"+r.params.linkColor+";"),b=b.data(e,function(e){return e.id}),b.exit().remove();var l=b.enter().append("g").attr("class","btNode").on("click",s).call(c.drag);l.append("circle").on("mouseover",function(e){if(r.params.enableTooltip){d.transition().duration(1e3).style("opacity",.9);var t=d3.event.pageX,a=d3.event.pageY,l=e,n=l.size?l.size:"";d.html(l.name+"<br/>"+n).style("left",t-120+"px").style("top",a-12+"px")}}).on("mouseout",function(e){r.params.enableTooltip&&d.transition().duration(500).style("opacity",0)}).attr("r",function(e){var a=d3.min(h),l=d3.max(h);return t.linearScale(e.size,m,a,l,r.params.scaleScore)||10}),l.append("text").attr("dy",r.params.textY).attr("dx",r.params.textX).text(function(e){return e.name}),b.select("circle").style("fill",function(e){return"solid"===r.params.fillStyle?t.colorSolid(e,r.params):t.colorGradient(u,e,r.params)})}function i(){p.attr("x1",function(e){return e.source.x}).attr("y1",function(e){return e.source.y}).attr("x2",function(e){return e.target.x}).attr("y2",function(e){return e.target.y}),b.attr("transform",function(e){return"translate("+e.x+","+e.y+")"})}function s(e){d3.event.defaultPrevented||(e.children?(e._children=e.children,e.children=null):(e.children=e._children,e._children=null),o())}var c,u,d,p,b,m,f="100%",g="100%",h=[];r.internalCtrl=r.control||{},r.internalCtrl.bind=function(t){e.debug("Binding bubble tree chart"),t&&(m=t,o(),e.debug("Binding completed"))},n()}}}angular.module("angular-bubbletree").directive("bubbletree",e),e.$inject=["$log","bubbletreeSvc"]}(),function(){"use strict";function e(e){var t={};return t.linearScale=function(e,t,r,a,l){var n=d3.scale.linear().domain([r,a]).range([1*l,2*l]);return n(e)},t.flatten=function(e,t){function r(e){e.size&&t.push(e.size),e.children&&e.children.forEach(r),e.id||(e.id=++l),a.push(e)}var a=[],l=0;return r(e),a},t.colorSolid=function(e,t){return e._children?t.collapsedColor:e.children?t.parentColor:t.childColor},t.colorGradient=function(e,t){var r="#fff",a="btGradient",l=e.append("svg:defs").append("svg:linearGradient").attr("id",a).attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","100%").attr("spreadMethod","pad");return l.append("svg:stop").attr("offset","0%").attr("stop-color","#999").attr("stop-opacity",1),l.append("svg:stop").attr("offset","100%").attr("stop-color",r).attr("stop-opacity",1),"url(#"+a+")"},t}angular.module("angular-bubbletree").service("bubbletreeSvc",e),e.$inject=["$log"]}();
4,695
4,695
0.713951
c1c8b6e98f60915b4a7d6162dbbaac1f9d472d9f
2,683
js
JavaScript
node_modules/metalsmith-snippet/test.js
developer-zebra/developer-zebra-site
8b3ecb3fafc41d1bc9aa0e52ad07d66ae359902d
[ "Fair", "Unlicense" ]
2
2016-03-21T11:00:57.000Z
2016-04-27T06:46:52.000Z
node_modules/metalsmith-snippet/test.js
developer-zebra/developer-zebra-site
8b3ecb3fafc41d1bc9aa0e52ad07d66ae359902d
[ "Fair", "Unlicense" ]
7
2016-03-17T20:28:36.000Z
2020-07-07T19:02:59.000Z
node_modules/metalsmith-snippet/test.js
developer-zebra/developer-zebra-site
8b3ecb3fafc41d1bc9aa0e52ad07d66ae359902d
[ "Fair", "Unlicense" ]
8
2016-10-25T10:29:49.000Z
2021-06-04T03:34:40.000Z
var expect = require('chai').expect; var snippet = require('./'); describe('metalsmith snippet', function () { describe('extract all text when length is shorter than max', function () { var files = { 'test.html': { contents: 'Hello, world!' } }; it('should extract the snippet', function (done) { return snippet()(files, {}, function (err) { expect(files['test.html'].snippet).to.equal('Hello, world!'); return done(err); }); }); }); describe('should not override existing snippets', function () { var files = { 'test.html': { contents: 'Hello, world!', snippet: 'Look ma, I added my own snippet!' } }; it('should skip extracting a snippet', function (done) { return snippet()(files, {}, function (err) { expect(files['test.html'].snippet).to.equal( 'Look ma, I added my own snippet!' ); return done(err); }); }); }); describe('no word breaks', function () { var files = { 'test.html': { contents: 'Supercalifragilisticexpialidocious' } }; it('should not set the snippet when it does not fit', function (done) { return snippet({ maxLength: 20 })(files, {}, function (err) { expect(files['test.html'].snippet).to.be.empty; return done(err); }) }); }); describe('break between words', function () { var files = { 'test.html': { contents: 'This is some simple test content.' } }; it('should break on whitespace before the max length', function (done) { return snippet({ maxLength: 20 })(files, {}, function (err) { expect(files['test.html'].snippet).to.equal( 'This is some simple&#8230;' ); return done(err); }); }); }); describe('trim punctuation before break', function () { var files = { 'test.html': { contents: 'God, damn, commas.' } }; it('should trim the comma before appending the suffix', function (done) { return snippet({ maxLength: 10 })(files, {}, function (err) { expect(files['test.html'].snippet).to.equal('God, damn&#8230;'); return done(err); }); }); }); describe('custom suffix', function () { var files = { 'test.html': { contents: 'Hello, world!' } }; it('should be able to pass in a custom suffix', function (done) { return snippet({ maxLength: 8, suffix: '...' })(files, {}, function (err) { expect(files['test.html'].snippet).to.equal('Hello...'); return done(err); }); }); }); });
25.074766
77
0.540813
c1c91dc192f9b49073668d0474fd7e1dd92cc385
1,940
js
JavaScript
test/index.test.js
EveryMundo/runner
45e0c8b22dee58e04c03f04a01115f35fbf6a627
[ "MIT" ]
null
null
null
test/index.test.js
EveryMundo/runner
45e0c8b22dee58e04c03f04a01115f35fbf6a627
[ "MIT" ]
null
null
null
test/index.test.js
EveryMundo/runner
45e0c8b22dee58e04c03f04a01115f35fbf6a627
[ "MIT" ]
1
2018-01-27T22:56:35.000Z
2018-01-27T22:56:35.000Z
'require strict' /* eslint-env mocha */ /* eslint-disable no-unused-expressions */ const sinon = require('sinon') const { expect } = require('chai') describe('runner.js', () => { const noop = () => { } let sandbox beforeEach(() => { // creates sinon sandbox sandbox = sinon.sandbox.create() }) // retores the sandbox afterEach(() => { sandbox.restore() }) context('#run()', () => { context('when filename is NOT the second arg', () => { beforeEach(() => { sandbox.stub(process, 'argv').value([null, 'this is not a file name']) }) it('should NOT call the function', () => { const { run } = require('../') const callback = sinon.spy(noop) run(__filename, callback) expect(callback.called).to.be.false }) }) context('when filename is the second arg', () => { beforeEach(() => { sandbox.stub(process, 'argv').value([null, __filename]) }) it('should call the function', () => { const { run } = require('../') const callback = sinon.spy(noop) run(__filename, callback) expect(callback.calledOnce).to.be.true }) it('should call the function with the expected 3 arguments', () => { const { run } = require('../') const callback = sinon.spy(noop) run(__filename, callback, 2, 4, 6) expect(callback.calledOnce).to.be.true expect(callback.calledWithExactly(2, 4, 6)).to.be.true }) it('should call the function with the expected N arguments', () => { const { run } = require('../') const callback = sinon.spy(noop) const length = ~~(Math.random() * 10) const nArgs = Array.from({ length }, (v, i) => i) run(__filename, callback, ...nArgs) expect(callback.calledOnce).to.be.true expect(callback.calledWithExactly(...nArgs)).to.be.true }) }) }) })
26.575342
78
0.556701
c1c944290ff7a92ede3df20e89e306adc64e185c
628
js
JavaScript
Exams - Software University/08 - Gold Mine/index.js
EmbraceTheDefeat/Programming-Basics-JS---April-2021---Software-University
6e6d4dd011b8ce49e49d26c95da80013c32ec26a
[ "MIT" ]
null
null
null
Exams - Software University/08 - Gold Mine/index.js
EmbraceTheDefeat/Programming-Basics-JS---April-2021---Software-University
6e6d4dd011b8ce49e49d26c95da80013c32ec26a
[ "MIT" ]
null
null
null
Exams - Software University/08 - Gold Mine/index.js
EmbraceTheDefeat/Programming-Basics-JS---April-2021---Software-University
6e6d4dd011b8ce49e49d26c95da80013c32ec26a
[ "MIT" ]
null
null
null
function solve(inputs) { const locations = Number(inputs.shift()); for(let i=0; i<locations; i++) { let avgGold = Number(inputs.shift()) let days = Number(inputs.shift()) let amountExtractedGold = 0; for(let n=0; n<days; n++) { let extraction = Number(inputs.shift()) amountExtractedGold += extraction; } let average = amountExtractedGold / days; if(average >= avgGold) { console.log(`Good job! Average gold per day: ${average.toFixed(2)}.`) } else if (average < avgGold) { console.log(`You need ${(avgGold - average).toFixed(2)} gold.`) } } }
34.888889
78
0.600318
c1c99edfd8e8948f4abbb9af1a8464bad72c3af4
2,222
js
JavaScript
web/src/components/ProfileCell/ProfileCell.js
bdombro/redwoodblog
e807f1204f695b08f84e488cf4edbe8c6221e944
[ "MIT" ]
null
null
null
web/src/components/ProfileCell/ProfileCell.js
bdombro/redwoodblog
e807f1204f695b08f84e488cf4edbe8c6221e944
[ "MIT" ]
null
null
null
web/src/components/ProfileCell/ProfileCell.js
bdombro/redwoodblog
e807f1204f695b08f84e488cf4edbe8c6221e944
[ "MIT" ]
null
null
null
/** * Shows a user edit form * * Note: New users exist in netlify but not in our database yet. So, * this cell will create the user record if it doesn't exist. * */ import { useMutation, useFlash } from '@redwoodjs/web' import { navigate, routes } from '@redwoodjs/router' import UserForm from 'src/components/UserForm' export const QUERY = gql` query FIND_USER_BY_EMAIL($email: String!) { user: userByEmail(email: $email) { id createdAt email name } } ` const UPDATE_USER_MUTATION = gql` mutation UpdateUserMutation($id: Int!, $input: UpdateUserInput!) { updateUser(id: $id, input: $input) { id } } ` const CREATE_USER_MUTATION = gql` mutation CreateUserMutation($input: CreateUserInput!) { createUser(input: $input) { id } } ` export const Loading = () => <div>Loading...</div> export const Empty = ({email, name}) => { const [createUser, { error }] = useMutation(CREATE_USER_MUTATION, { onCompleted: () => { navigate(routes.profile()) }, }) React.useEffect(() => { createUser({ variables: { input: {email, name} } }) }, []); return !!error && ( <div className="rw-segment"> <header className="rw-segment-header"> <h2 className="rw-heading rw-heading-secondary">Oops!</h2> </header> <div className="rw-segment-main"> There was an error finding your profile. Details: <pre>{JSON.stringify(error, null, 2)}</pre> </div> </div> ) } export const Success = ({ user }) => { const { addMessage } = useFlash() const [updateUser, { loading, error }] = useMutation(UPDATE_USER_MUTATION, { onCompleted: () => { navigate(routes.profile()) addMessage('User updated.', { classes: 'rw-flash-success' }) }, }) const onSave = (input, id) => { updateUser({ variables: { id, input } }) } return ( <div className="rw-segment"> <header className="rw-segment-header"> <h2 className="rw-heading rw-heading-secondary">Edit User {user.id}</h2> </header> <div className="rw-segment-main"> <UserForm user={user} onSave={onSave} error={error} loading={loading} /> </div> </div> ) }
25.25
80
0.608011
c1c9b4a310affa32ed6b52104751743cfde1bfa9
935
js
JavaScript
test/defineMethod.js
hiun/self-js
6080d9e6ee49759a3ba7fd2002263ba974c48543
[ "MIT" ]
2
2017-03-09T04:59:18.000Z
2017-04-06T08:14:03.000Z
test/defineMethod.js
hiun/self
6080d9e6ee49759a3ba7fd2002263ba974c48543
[ "MIT" ]
21
2016-07-29T17:37:16.000Z
2017-10-29T08:02:26.000Z
test/defineMethod.js
hiun/self-js
6080d9e6ee49759a3ba7fd2002263ba974c48543
[ "MIT" ]
null
null
null
var Behavior = require('..'); var assert = require('assert'); var Formula = new Behavior(); Formula.defineMethod('deleteAddition', function () { this.behaviorStore.behaviors.forEach((behavior) => { if (behavior.name.slice(0, 3) === 'add') { this.delete.apply({name: behavior.name, behaviorStore: this.behaviorStore}); // or by using private API //this.behaviorStore.deleteBehavior(behavior.name); } }); }); Formula.add(function add100 (n) { return n + 100; }); Formula.add(function sub1000 (n) { return n - 1000; }); Formula.add(function add200 (n) { return n + 200; }); Formula.deleteAddition(); describe('Behavior', function() { describe('#defineMethod()', function() { it('correctness : should be return -1000 as a result of formula', function () { return Formula.exec(0).then((result) => { assert.equal(-1000, result); }).catch(assert.ifError); }); }); });
24.605263
83
0.635294
c1c9f8846560c4ad64c94b94628182c0abbc3a8a
6,836
js
JavaScript
test/util/utils.js
twitchax/azure-rest-api-specs
bf1335c5a5210688da54fe2f134cd313f1ba5c9d
[ "MIT" ]
null
null
null
test/util/utils.js
twitchax/azure-rest-api-specs
bf1335c5a5210688da54fe2f134cd313f1ba5c9d
[ "MIT" ]
1
2016-07-20T10:03:53.000Z
2016-07-20T10:03:53.000Z
test/util/utils.js
twitchax/azure-rest-api-specs
bf1335c5a5210688da54fe2f134cd313f1ba5c9d
[ "MIT" ]
3
2016-07-12T17:23:16.000Z
2016-08-02T09:59:18.000Z
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License in the project root for license information. 'use strict'; var assert = require("assert"), fs = require('fs'), glob = require('glob'), path = require('path'), _ = require('lodash'), z = require('z-schema'), request = require('request'), util = require('util'), execSync = require('child_process').execSync; exports = module.exports; exports.extensionSwaggerSchemaUrl = "https://raw.githubusercontent.com/Azure/autorest/master/schema/swagger-extensions.json"; exports.swaggerSchemaUrl = "http://json.schemastore.org/swagger-2.0"; exports.swaggerSchemaAltUrl = "http://swagger.io/v2/schema.json"; exports.schemaUrl = "http://json-schema.org/draft-04/schema"; exports.exampleSchemaUrl = "https://raw.githubusercontent.com/Azure/autorest/master/schema/example-schema.json"; exports.compositeSchemaUrl = "https://raw.githubusercontent.com/Azure/autorest/master/schema/composite-swagger.json"; exports.isWindows = (process.platform.lastIndexOf('win') === 0); exports.prOnly = undefined !== process.env['PR_ONLY'] ? process.env['PR_ONLY'] : 'false'; exports.globPath = path.join(__dirname, '../', '../', '/**/swagger/*.json'); exports.swaggers = _(glob.sync(exports.globPath)); exports.compositeGlobPath = path.join(__dirname, '../', '../', '/**/composite*.json'); exports.compositeSwaggers = _(glob.sync(exports.compositeGlobPath)); exports.exampleGlobPath = path.join(__dirname, '../', '../', '/**/examples/*.json'); exports.examples = _(glob.sync(exports.exampleGlobPath)); // Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) // because the buffer-to-string conversion in `fs.readFile()` // translates it to FEFF, the UTF-16 BOM. exports.stripBOM = function stripBOM(content) { if (Buffer.isBuffer(content)) { content = content.toString(); } if (content.charCodeAt(0) === 0xFEFF || content.charCodeAt(0) === 0xFFFE) { content = content.slice(1); } return content; }; /** * Parses the json from the given filepath * @returns {string} clr command */ exports.parseJsonFromFile = function parseJsonFromFile(filepath, callback) { fs.readFile(filepath, 'utf8', function (err, data) { if (err) return callback(err); try { return callback(null, JSON.parse(exports.stripBOM(data))); } catch (error) { let e = new Error(`swagger "${filepath}" is an invalid JSON.\n${util.inspect(err, { depth: null })}`); return callback(e); } }); }; /** * Converts command to OS specific command by prepending `mono` for non-windows prOnlySwaggers * @returns {string} clr command */ exports.clrCmd = function clrCmd(cmd) { return exports.isWindows ? cmd : ('mono ' + cmd); }; /** * Gets the name of the target branch to which the PR is sent. We are using the environment * variable provided by travis-ci. It is called TRAVIS_BRANCH. More info can be found here: * https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables * If the environment variable is undefined then the method returns 'master' as the default value. * @returns {string} branchName The target branch name. */ exports.getTargetBranch = function getTargetBranch() { console.log(`@@@@@ process.env['TRAVIS_BRANCH'] - ${process.env['TRAVIS_BRANCH']}`); let result = process.env['TRAVIS_BRANCH'] || 'master'; result = result.trim(); console.log(`>>>>> The target branch is: "${result}".`); return result; }; /** * Gets the name of the source branch from which the PR is sent. * @returns {string} branchName The source branch name. */ exports.getSourceBranch = function getSourceBranch() { let cmd = 'git rev-parse --abbrev-ref HEAD'; let result = process.env['TRAVIS_PULL_REQUEST_BRANCH']; console.log(`@@@@@ process.env['TRAVIS_PULL_REQUEST_BRANCH'] - ${process.env['TRAVIS_PULL_REQUEST_BRANCH']}`); if (!result) { try { result = execSync(cmd, { encoding: 'utf8' }); } catch (err) { console.log(`An error occurred while getting the current branch ${util.inspect(err, { depth: null })}.`); } } result = result.trim(); console.log(`>>>>> The source branch is: "${result}".`); return result; }; /** * Retrieves list of swagger files to be processed for linting * @returns {Array} list of files to be processed for linting */ exports.getFilesChangedInPR = function getFilesChangedInPR() { let result = exports.swaggers; if (exports.prOnly === 'true') { let targetBranch, cmd, filesChanged, swaggerFilesInPR; try { targetBranch = exports.getTargetBranch(); cmd = `git diff --name-only HEAD $(git merge-base HEAD ${targetBranch})`; filesChanged = execSync(cmd, { encoding: 'utf8' }); console.log('>>>>> Files changed in this PR are as follows:') console.log(filesChanged); swaggerFilesInPR = filesChanged.split('\n').filter(function (item) { return (item.match(/.*\/swagger\/*/ig) !== null); }); console.log(`>>>> Number of swaggers found in this PR: ${swaggerFilesInPR.length}`); result = swaggerFilesInPR; } catch (err) { throw err; } } return result; }; /** * Downloads the remote schemas and initializes the validator with remote references. * @returns {Object} context Provides the schemas in json format and the validator. */ exports.initializeValidator = function initializeValidator(callback) { request({ url: exports.extensionSwaggerSchemaUrl, json: true }, function (error, response, extensionSwaggerSchemaBody) { if (error) { return callback(error); } request({ url: exports.swaggerSchemaAltUrl, json: true }, function (error, response, swaggerSchemaBody) { if (error) { return callback(error); } request({ url: exports.exampleSchemaUrl, json: true }, function (error, response, exampleSchemaBody) { if (error) { return callback(error); } request({ url: exports.compositeSchemaUrl, json: true }, function (error, response, compositeSchemaBody) { if (error) { return callback(error); } let context = { extensionSwaggerSchema: extensionSwaggerSchemaBody, swaggerSchema: swaggerSchemaBody, exampleSchema: exampleSchemaBody, compositeSchema: compositeSchemaBody }; let validator = new z({ breakOnFirstError: false }); validator.setRemoteReference(exports.swaggerSchemaUrl, context.swaggerSchema); validator.setRemoteReference(exports.exampleSchemaUrl, context.exampleSchema); validator.setRemoteReference(exports.compositeSchemaUrl, context.compositeSchema); context.validator = validator; return callback(null, context); }); }); }); }); };
40.449704
125
0.680076
c1cb7958fe5efc1f4c66422de48f446d1de0a4b0
16,028
js
JavaScript
src/components/Angular.js
Kasilucky/coding-sastra
77203d237272c83ee4319944619f2d1116c33d21
[ "MIT" ]
null
null
null
src/components/Angular.js
Kasilucky/coding-sastra
77203d237272c83ee4319944619f2d1116c33d21
[ "MIT" ]
null
null
null
src/components/Angular.js
Kasilucky/coding-sastra
77203d237272c83ee4319944619f2d1116c33d21
[ "MIT" ]
null
null
null
import React from "react" import "./Global.css" import Sidebar from "./SideSearchbar"; import InstuctorVarma from "./InstructorVarma"; const Angular = () => ( <div> <section> <div className="container"> <div className="row"> <div className="col-lg-9"> <div className="single_course"> <div className="course_img"> <img src="https://www.encriss.com/wp-content/uploads/2019/04/angular-js.png" alt="course_img_big" /> <div className="enroll_btn"> <a href="https://docs.google.com/forms/d/e/1FAIpQLSds9Lhf8gwCJslxHRJ8ert0IWshl09tQHHX2qHFRsGi0tc7iQ/viewform" className="btn btn-default btn-sm" > Get Enroll </a> </div> </div> <div className="course_detail alert-warning"> <div className="course_title"> <h2>Nullam id varius nunc id varius nunc</h2> </div> <div className="countent_detail_meta"> <ul> <li> <div className="instructor"> <img src="http://mindandculture.org/wordpress6/wp-content/uploads/2018/07/Fotolia_188161178_XS-1.jpg" alt="user1" /> <div className="instructor_info"> <label>Teacher:</label> <h6>Varma Bhupatiraju</h6> </div> </div> </li> <li> <div className="course_student"> <label>Students: </label> <span> 352</span> </div> </li> <li> <div className="course_categories"> <label>Review: </label> <div className="rating_stars"> <i className="ion-android-star"></i> <i className="ion-android-star"></i> <i className="ion-android-star"></i> <i className="ion-android-star"></i> <i className="ion-android-star-half"></i> </div> </div> </li> </ul> </div> </div> <div className="course_tabs"> <ul className="nav nav-tabs" role="tablist"> <li className="nav-item"> <a className="nav-link active" id="overview-tab1" data-toggle="tab" href="#overview" role="tab" aria-controls="overview" aria-selected="true" > Overview </a> </li> <li className="nav-item"> <a className="nav-link" id="curriculum-tab1" data-toggle="tab" href="#curriculum" role="tab" aria-controls="curriculum" aria-selected="false" > curriculum </a> </li> <li className="nav-item"> <a className="nav-link" id="instructor-tab1" data-toggle="tab" href="#instructor" role="tab" aria-controls="instructor" aria-selected="false" > instructor </a> </li> </ul> <div className="tab-content"> <div className="tab-pane fade show active" id="overview" role="tabpanel" aria-labelledby="overview-tab1" > <div className="border radius_all_5 tab_box"> {" "} <p> Lorem Ipsu. is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. </p> </div> </div> <div className="tab-pane fade" id="curriculum" role="tabpanel" aria-labelledby="curriculum-tab1" > <div id="accordion" className="accordion"> <div className="card"> <div className="card-header" id="heading-1-One"> <h6 className="mb-0"> {" "} <a data-toggle="collapse" href="#collapse-1-One" aria-expanded="true" aria-controls="collapse-1-One" > Leap into electronic typesetting{" "} <span className="item_meta duration">30 min</span> </a> </h6> </div> <div id="collapse-1-One" className="collapse show" aria-labelledby="heading-1-One" data-parent="#accordion" > <div className="card-body"> <p> Lorem Ipsu. is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book. </p> </div> </div> </div> <div className="card"> <div className="card-header" id="heading-1-Two"> <h6 className="mb-0"> {" "} <a className="collapsed" data-toggle="collapse" href="#collapse-1-Two" aria-expanded="false" aria-controls="collapse-1-Two" > Letraset sheets containing{" "} <span className="item_meta duration">30 min</span> </a>{" "} </h6> </div> <div id="collapse-1-Two" className="collapse" aria-labelledby="heading-1-Two" data-parent="#accordion" > <div className="card-body"> <p> Lorem Ipsu. is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book. </p> </div> </div> </div> <div className="card"> <div className="card-header" id="heading-1-Three"> <h6 className="mb-0"> {" "} <a className="collapsed" data-toggle="collapse" href="#collapse-1-Three" aria-expanded="false" aria-controls="collapse-1-Three" > took a galley of type{" "} <span className="item_meta duration">45 min</span> </a>{" "} </h6> </div> <div id="collapse-1-Three" className="collapse" aria-labelledby="heading-1-Three" data-parent="#accordion" > <div className="card-body"> <p> Lorem Ipsu. is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book. </p> </div> </div> </div> </div> </div> <div className="tab-pane fade" id="instructor" role="tabpanel" aria-labelledby="instructor-tab1" > <InstuctorVarma/> </div> </div> </div> <div className="row"> <div className="col-12"> <div className="medium_divider"></div> <div className="comment-title"> <h5>Related Courses</h5> </div> </div> </div> <div className="row"> <div className="col-md-6"> <div className="content_box radius_all_10 box_shadow1"> <div className="content_img radius_ltrt_10"> <a href="/"> <img src="assets/images/course_img1.jpg" alt="course_img1" /> </a> </div> <div className="content_desc"> <h4 className="content_title"> <a href="/">Nullam id varius nunc id varius nunc</a> </h4> <p> If you are going to use a passage of Lorem Ipsum you need to be sure anything embarrassing hidden in the middle of text. </p> <div className="courses_info"> <div className="rating_stars"> <i className="ion-android-star"></i> <i className="ion-android-star"></i> <i className="ion-android-star"></i> <i className="ion-android-star"></i> <i className="ion-android-star-half"></i> </div> <ul className="list_none content_meta"> <li> <a href="/"> <i className="ti-user"></i>31 </a> </li> <li> <a href="/"> <i className="ti-heart"></i>10 </a> </li> </ul> </div> </div> <div className="content_footer"> <div className="teacher"> <a href="/"> <img src="assets/images/user1.jpg" alt="user1" /> <span>Alia Noor</span> </a> </div> </div> </div> </div> <div className="col-md-6"> <div className="content_box radius_all_10 box_shadow1"> <div className="content_img radius_ltrt_10"> <a href="/"> <img src="assets/images/course_img2.jpg" alt="course_img2" /> </a> </div> <div className="content_desc"> <h4 className="content_title"> <a href="/">Nullam id varius nunc id varius nunc</a> </h4> <p> If you are going to use a passage of Lorem Ipsum you need to be sure anything embarrassing hidden in the middle of text. </p> <div className="courses_info"> <div className="rating_stars"> <i className="ion-android-star"></i> <i className="ion-android-star"></i> <i className="ion-android-star"></i> <i className="ion-android-star"></i> <i className="ion-android-star-half"></i> </div> <ul className="list_none content_meta"> <li> <a href="/"> <i className="ti-user"></i>31 </a> </li> <li> <a href="/"> <i className="ti-heart"></i>10 </a> </li> </ul> </div> </div> <div className="content_footer"> <div className="teacher"> <a href="/"> <img src="assets/images/user2.jpg" alt="user2" /> <span>Dany Core</span> </a> </div> </div> </div> </div> </div> </div> </div> <Sidebar/> </div> </div> </section> </div> ) export default Angular
43.086022
140
0.347517
c1cba57806114279cea4c2bf11fcf9799fcbb9fc
5,470
js
JavaScript
smartphones/smartphones.js
systemsvanguard/smartphones
7d2ec1c15576b9f7c7586fc7594be1dfcd35b467
[ "MIT" ]
null
null
null
smartphones/smartphones.js
systemsvanguard/smartphones
7d2ec1c15576b9f7c7586fc7594be1dfcd35b467
[ "MIT" ]
null
null
null
smartphones/smartphones.js
systemsvanguard/smartphones
7d2ec1c15576b9f7c7586fc7594be1dfcd35b467
[ "MIT" ]
null
null
null
// Smartphones Electronic Store // Simple personal project to learn Vue.js. VERY, VERY powerful & easy to use framework! // , new Post('Motorola Moto G5S Plus', 'https://www.gsmarena.com/motorola_moto_g5s_plus-8699.php', '13MP', '8MP', 'motorola-moto-g5s', '2017 August', '1', '4GB RAM', '5.5"', '1080x1920 pixels', '64GB storage with microSD card slot', '168g ~ 8mm thickness') function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Post = function Post(title, link, camerafront, cameraback, img, date, id, memory, screensize, storage, dimensions) { _classCallCheck(this, Post); this.title = title; this.link = link; this.cameraback = cameraback; this.camerafront = camerafront; this.img = img; this.date = date; this.id = id; this.memory = memory; this.screensize = screensize; this.storage = storage; this.dimensions = dimensions; }; // (title, link, camerafront, cameraback, img, date, id, memory, screensize, storage, dimensions) var app = new Vue({ el: '#app', data: { keyword: '', onOff: false, activePost: null, postList: [ new Post('Motorola Moto G5S Plus', 'https://www.gsmarena.com/motorola_moto_g5s_plus-8699.php', '13MP', '8MP', 'images/motorola-moto-g5s.jpg', '2017 August', '1', '4GB RAM', '5.5"', '1080x1920 pixels', '64GB storage with microSD card slot', '168g ~ 8mm thickness') , new Post('Motorola DROID Turbo', 'https://www.gsmarena.com/motorola_droid_turbo-6727.php', '21MP', '2MP', 'images/motorola-droid-turbo.jpg', '2014 October', '2', '3GB RAM', '5.2"', '1440x2560 pixels', '64GB storage. No card slot', '169g ~ 11.2mm thickness') , new Post('Apple iPhone 7 Plus', 'https://www.gsmarena.com/apple_iphone_7_plus-8065.php', '12MP', '7MP', 'images/apple-iphone-7-plus-r2.jpg', '2016 September', '3', '3GB RAM', '5.5"', '1080x1920 pixels', '128GB. No card slot', '188g ~ 7.3mm thickness') , new Post('Meizu MX4 Pro', 'https://www.gsmarena.com/meizu_mx4_pro-6815.php', '20MP', '5MP', 'images/meizu-mx4-pro1.jpg', '2014 December', '4', '3GB RAM', '5.5"', '1080x1920 pixels', '64GB. No card slot', '158g ~ 9mm thickness') , new Post('Xiaomi Mi Note 3', 'https://www.gsmarena.com/xiaomi_mi_note_3-8707.php', '12MP', '16MP', 'images/xiaomi-mi-note3-.jpg', '2017 September', '5', '6GB RAM', '5.5"', '1080x1920 pixels', '128GB. No card slot', '163g ~ 7.6mm thickness') , new Post('Samsung Galaxy Note8', 'https://www.gsmarena.com/samsung_galaxy_note8-8505.php', '12MP', '8MP', 'images/samsung-galaxy-note-8-sm-n950.jpg', '2017 September', '6', '6GB RAM', '6.3"', '1440x2960 pixels', '256GB storage with microSD card slot', '195g ~ 8.6mm thickness') , new Post('LG V30', 'https://www.gsmarena.com/lg_v30-8712.php', '16MP', '5MP', 'images/lg-v30-.jpg', '2017 September', '7', '4GB RAM', '6.0"', '1440x2880 pixels', '128GB storage with microSD card slot', '158g ~ 7.3mm thickness') , new Post('Samsung Galaxy S7 edge', 'https://www.gsmarena.com/samsung_galaxy_note8-8505.php', '12MP', '5MP', 'images/samsung-galaxy-s7-edge-.jpg', '2016 March', '8', '4GB RAM', '5.5"', '1440x2560 pixels', '128GB storage with microSD card slot', '157g ~ 7.7mm thickness') , new Post('HTC One M9+', 'https://www.gsmarena.com/htc_one_m9+-6977.php', '20MP', '4MP', 'images/htc-one-m9-plus-new.jpg', '2015 May', '9', '3GB RAM', '5.2"', '1440x2560 pixels', '32GB storage with microSD card slot', '195g ~ 8.6mm thickness') , new Post('BlackBerry Keyone', 'https://www.gsmarena.com/blackberry_keyone-8508.php', '12MP', '8MP', 'images/blackberry-keyone-mercury.jpg', '2017 April', '10', '4GB RAM', '6.0"', '1080x2160 pixels', '64GB storage with microSD card slot', '180g ~ 9.4mm thickness') , new Post('HTC U11 Eyes', 'https://www.gsmarena.com/htc_u11_eyes-8990.php', '12MP', '5MP', 'images/htc-u11-eyes-.jpg', '2018 January', '11', '4GB RAM', '6.0"', '1080x2160 pixels', '64GB storage with microSD card slot', '185g ~ 8.5mm thickness') , new Post('Huawei Honor 9', 'https://www.gsmarena.com/huawei_honor_9-8704.php', '20MP', '8MP', 'images/huawei-honor-9-1.jpg', '2017 July', '12', '6GB RAM', '5.15"', '1080x1920 pixels', '128GB storage with microSD card slot', '155g ~ 7.5mm thickness') , new Post('Google Pixel 2 XL', 'https://www.gsmarena.com/htc_one_m9+-6977.php', '12MP', '8MP', 'images/google-pixel-xl2.jpg', '2017 October', '13', '4GB RAM', '6.0"', '1440x2880 pixels', '128GB with no card slot', '175g ~ 7.9mm thickness') , new Post('Huawei Mate 10 Pro', 'https://www.gsmarena.com/huawei_mate_10_pro-8854.php', '20MP', '8MP', 'images/huawei-mate10-pro.jpg', '2017 November', '14', '6GB RAM', '6.0"', '1080x2160 pixels', '32GB storage with microSD card slot', '178g ~ 7.9mm thickness') , new Post('Sony Xperia XZ Premium', 'https://www.gsmarena.com/sony_xperia_xz_premium-8593.php', '19MP', '13MP', 'images/sony-xperia-xz-premium-2017.jpg', '2017 June', '15', '4GB RAM', '5.46"', '3840x2160 pixels', '64GB storage with microSD card slot', '195g ~ 7.9mm thickness') ] }, methods: { toggleOnOff: function toggleOnOff(post, $event) { this.activePost = post; this.onOff = !this.onOff; } }, computed: { filteredList: function filteredList() { var _this = this; return this.postList.filter(function (post) { return post.title.toLowerCase().includes(_this.keyword.toLowerCase()); }); } } });
66.707317
280
0.665996
c1ccbbe94bcbbb6f589570a68eeb5387be40deee
2,635
js
JavaScript
source/renderer/app/containers/wallet/WalletTransactionsPage.js
Sundae-Kado/Daedalus-clone
f30ef2a8c2c205666812160d06fc9c4e893df451
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
source/renderer/app/containers/wallet/WalletTransactionsPage.js
Sundae-Kado/Daedalus-clone
f30ef2a8c2c205666812160d06fc9c4e893df451
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
source/renderer/app/containers/wallet/WalletTransactionsPage.js
Sundae-Kado/Daedalus-clone
f30ef2a8c2c205666812160d06fc9c4e893df451
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
// @flow import React, { Component } from 'react'; import { observer, inject } from 'mobx-react'; import WalletTransactions from '../../components/wallet/transactions/WalletTransactions'; import { getNetworkExplorerUrlByType } from '../../utils/network'; import type { InjectedProps } from '../../types/injectedPropsType'; type Props = InjectedProps; @inject('stores', 'actions') @observer export default class WalletTransactionsPage extends Component<Props> { render() { const { actions, stores } = this.props; const { app, wallets, profile } = stores; const { openExternalLink, environment: { network, rawNetwork }, } = app; const activeWallet = wallets.active; const { allFiltered, filterOptions, searchRequest, totalAvailable, deletePendingTransaction, deleteTransactionRequest, defaultFilterOptions, populatedFilterOptions, } = this.props.stores.transactions; const { currentTimeFormat, currentDateFormat, currentLocale, currentNumberFormat, } = profile; const { searchLimit = 0 } = filterOptions || {}; const { transactions: transactionActions } = this.props.actions; const { filterTransactions, requestCSVFile } = transactionActions; const getUrlByType = (type: 'tx' | 'address', param: string) => getNetworkExplorerUrlByType( type, param, network, rawNetwork, currentLocale ); const hasMoreToLoad = () => searchLimit !== null && searchLimit !== undefined && totalAvailable > searchLimit; return ( <WalletTransactions activeWallet={activeWallet} transactions={allFiltered} filterOptions={filterOptions || {}} defaultFilterOptions={defaultFilterOptions} populatedFilterOptions={populatedFilterOptions} deletePendingTransaction={deletePendingTransaction} isLoadingTransactions={searchRequest.isExecutingFirstTime} hasMoreToLoad={hasMoreToLoad()} onLoadMore={actions.transactions.loadMoreTransactions.trigger} isDeletingTransaction={deleteTransactionRequest.isExecuting} onOpenExternalLink={openExternalLink} getUrlByType={getUrlByType} totalAvailable={totalAvailable} currentLocale={currentLocale} currentTimeFormat={currentTimeFormat} currentNumberFormat={currentNumberFormat} currentDateFormat={currentDateFormat} onFilter={filterTransactions.trigger} onRequestCSVFile={requestCSVFile.trigger} isRenderingAsVirtualList /> ); } }
32.530864
89
0.681594
c1cd07fdeb1910c9212c947cb770ddee2609b9e2
5,781
js
JavaScript
tests/us_verifications_test.js
SidneyAllen/lob-openapi
f332b7ebca1d07689a52a9c0f1b942f7ecd7e2be
[ "MIT" ]
null
null
null
tests/us_verifications_test.js
SidneyAllen/lob-openapi
f332b7ebca1d07689a52a9c0f1b942f7ecd7e2be
[ "MIT" ]
null
null
null
tests/us_verifications_test.js
SidneyAllen/lob-openapi
f332b7ebca1d07689a52a9c0f1b942f7ecd7e2be
[ "MIT" ]
null
null
null
"use strict"; const test = require("ava"); const Prism = require("./setup.js"); const resource_endpoint = "/us_verifications", lobUri = "https://api.lob.com/v1", specFile = "./lob-api-public.yml"; const primary_line = "185 BERRY ST"; const city = "SAN FRANCISCO"; const state = "CA"; const zip_code = "94107"; const sla = "185 BERRY ST 94107"; const prism = new Prism(specFile, lobUri, process.env.LOB_API_LIVE_TOKEN); test("verify a US address given primary line, city, and state", async function (t) { try { const response = await prism .setup() .then((client) => client.post( resource_endpoint, { primary_line: primary_line, city: city, state: state }, { headers: prism.authHeader } ) ); t.assert(response.status === 200); } catch (prismError) { if (Object.keys(prismError).length > 0) { t.fail(JSON.stringify(prismError, null, 2)); } else { t.fail(prismError.toString()); } } }); test("verify a US address given primary line and zip code", async function (t) { try { const response = await prism .setup() .then((client) => client.post( resource_endpoint, { primary_line: primary_line, zip_code: zip_code }, { headers: prism.authHeader } ) ); t.assert(response.status === 200); } catch (prismError) { if (Object.keys(prismError).length > 0) { t.fail(JSON.stringify(prismError, null, 2)); } else { t.fail(prismError.toString()); } } }); test("verify a US address given a single-line address", async function (t) { try { const response = await prism .setup() .then((client) => client.post( resource_endpoint, { address: sla }, { headers: prism.authHeader } ) ); t.assert(response.status === 200); } catch (prismError) { if (Object.keys(prismError).length > 0) { t.fail(JSON.stringify(prismError, null, 2)); } else { t.fail(prismError.toString()); } } }); test("verify a US address with full payload", async function (t) { try { const response = await prism.setup().then((client) => client.post( resource_endpoint, { recipient: "Harry Zhang", primary_line: primary_line, secondary_line: "", city: city, state: state, zip_code: "94107", }, { headers: prism.authHeader } ) ); t.assert(response.status === 200); } catch (prismError) { if (Object.keys(prismError).length > 0) { t.fail(JSON.stringify(prismError, null, 2)); } else { t.fail(prismError.toString()); } } }); // tests request validation test("errors when not given a primary line", async function (t) { try { await prism .setup() .then((client) => client.post( resource_endpoint, { zip_code: zip_code }, { headers: prism.authHeader } ) ); } catch (err) { const firstError = err.additional.validation[0]["message"]; t.assert(firstError.includes("required")); } }); // set prism error-surfacing to false for these tests, to gauge the endpoint's response test("errors when given a primary line without city/state or zip", async function (t) { try { const response = await prism .setup({ errors: false }) .then((client) => client.post( resource_endpoint, { primary_line: primary_line }, { headers: prism.authHeader } ) ); t.assert(response.status === 422); t.assert(response.data.error.message.includes("zip_code")); } catch (prismError) { if (Object.keys(prismError).length > 0) { t.fail(JSON.stringify(prismError, null, 2)); } else { t.fail(prismError.toString()); } } }); test("errors when given a city without state or zip", async function (t) { try { const response = await prism .setup({ errors: false }) .then((client) => client.post( resource_endpoint, { primary_line: primary_line, city: city }, { headers: prism.authHeader } ) ); t.assert(response.status === 422); t.assert(response.data.error.message.includes("state")); } catch (prismError) { if (Object.keys(prismError).length > 0) { t.fail(JSON.stringify(prismError, null, 2)); } else { t.fail(prismError.toString()); } } }); test("errors when given a state without city or zip", async function (t) { try { const response = await prism .setup({ errors: false }) .then((client) => client.post( resource_endpoint, { primary_line: primary_line, state: state }, { headers: prism.authHeader } ) ); t.assert(response.status === 422); t.assert(response.data.error.message.includes("city")); } catch (prismError) { if (Object.keys(prismError).length > 0) { t.fail(JSON.stringify(prismError, null, 2)); } else { t.fail(prismError.toString()); } } }); test("errors when given extraneous information alongside a single-line address", async function (t) { try { const response = await prism .setup({ errors: false }) .then((client) => client.post( resource_endpoint, { address: sla, zip_code: zip_code }, { headers: prism.authHeader } ) ); t.assert(response.status === 422); t.assert(response.data.error.message.includes("zip_code")); } catch (prismError) { if (Object.keys(prismError).length > 0) { t.fail(JSON.stringify(prismError, null, 2)); } else { t.fail(prismError.toString()); } } });
26.277273
101
0.582079
c1cd4754ad3b2050436c4f3223a3ec635c505445
504
js
JavaScript
src/reducers/settingsReducer.js
DanielLandonJr/react-client_panel
47c2f28835ed413f1d5d289c5f3fd0b3d4770c76
[ "MIT" ]
null
null
null
src/reducers/settingsReducer.js
DanielLandonJr/react-client_panel
47c2f28835ed413f1d5d289c5f3fd0b3d4770c76
[ "MIT" ]
null
null
null
src/reducers/settingsReducer.js
DanielLandonJr/react-client_panel
47c2f28835ed413f1d5d289c5f3fd0b3d4770c76
[ "MIT" ]
null
null
null
import { DISABLE_BALANCE_ON_ADD, DISABLE_BALANCE_ON_EDIT, ALLOW_REGISTRATION } from '../actions/types'; export default (state = {}, action) => { switch (action.type) { case DISABLE_BALANCE_ON_ADD: return { ...state, disableBalanceOnAdd: action.payload }; case DISABLE_BALANCE_ON_EDIT: return { ...state, disableBalanceOnEdit: action.payload }; case ALLOW_REGISTRATION: return { ...state, allowRegistration: action.payload }; default: return state; } };
26.526316
64
0.686508
c1cd627b9c5e217b05839e19481ef195448d9302
1,735
js
JavaScript
src/pages/index.js
leolanese/react-crud-firebase-gatsby
393f37545a06143d5d92fc5f5a9a277e1909a19b
[ "MIT" ]
null
null
null
src/pages/index.js
leolanese/react-crud-firebase-gatsby
393f37545a06143d5d92fc5f5a9a277e1909a19b
[ "MIT" ]
null
null
null
src/pages/index.js
leolanese/react-crud-firebase-gatsby
393f37545a06143d5d92fc5f5a9a277e1909a19b
[ "MIT" ]
null
null
null
import React, { useState } from 'react' import ItemList from './components/itemlist' import Additem from './components/additem' import './styles/global.css' import UpdateItem from './components/updateitem' import getFirebase from './components/firebase' import 'bootstrap/dist/css/bootstrap.min.css' import { initialItemState } from './resources/resourcesAnimal' export default () => { const [editing, setEditing] = useState(false); const [currentItem, setCurrentItem] = useState(initialItemState); const [submitting, setSubmitting] = useState(false); const editItem = item => { setEditing(true); setCurrentItem({ id: item.id, name: item.name, type: item.type, food: item.food, alive: item.alive, }) }; const updateItem = ({ currentItem }, updatedItem) => { console.log('updateItem', updatedItem, currentItem.id); setEditing(false); const lazyApp = import('firebase/app'); const lazyDatabase = import('@firebase/firestore'); Promise.all([lazyApp, lazyDatabase]) .then(([firebase]) => { const firebaseDatabase = getFirebase(firebase).firestore(); console.log(firebaseDatabase); firebaseDatabase .collection('items') .doc(currentItem.id) .update(updatedItem) }) }; return ( <div> {editing ? ( <UpdateItem setEditing={setEditing} currentItem={currentItem} updateItem={updateItem} submitting={submitting} setSubmitting={setSubmitting} /> ) : ( <Additem /> )} <ItemList editItem={editItem} // send uniqueID /> </div> ) }
26.692308
69
0.608646
c1cd667f40a2ae9a399ff61971a79ea81a523907
985
js
JavaScript
src/Data/Weapons/Bow/RecurveBow.js
SohumB/genshin-optimizer
c8ef602fcee84418c0439dbcc212bc8969daf9ed
[ "MIT" ]
null
null
null
src/Data/Weapons/Bow/RecurveBow.js
SohumB/genshin-optimizer
c8ef602fcee84418c0439dbcc212bc8969daf9ed
[ "MIT" ]
null
null
null
src/Data/Weapons/Bow/RecurveBow.js
SohumB/genshin-optimizer
c8ef602fcee84418c0439dbcc212bc8969daf9ed
[ "MIT" ]
null
null
null
import DisplayPercent from "../../../Components/DisplayPercent" import RecurveBow from './Weapon_Recurve_Bow.png' const refinementVals = [8, 10, 12, 14, 16] const weapon = { name: "Recurve Bow", weaponType: "bow", img: RecurveBow, rarity: 3, passiveName: "Cull the Weak", passiveDescription: (refineIndex, charFinalStats) => <span>Defeating an opponent restores {refinementVals[refineIndex]}% HP{DisplayPercent(refinementVals[refineIndex], charFinalStats, "finalHP")}.</span>, description: "It is said that this bow can shoot down eagles in flight, but ultimately how true that is depends on the skill of the archer.", baseStats: { main: [38, 48, 61, 73, 86, 105, 117, 129, 140, 151, 171, 182, 193, 212, 223, 234, 253, 264, 274, 294, 304, 314, 334, 344, 354], subStatKey: "hp_", sub: [10.2, 11.9, 13.9, 16, 18, 18, 20.1, 22.2, 24.2, 26.3, 26.3, 28.4, 30.4, 30.4, 32.5, 34.6, 34.6, 36.6, 38.7, 38.7, 40.7, 42.8, 42.8, 44.9, 46.9], } } export default weapon
54.722222
206
0.672081
c1cd98901d8f4d1725a8cdc7b38d4d83a9aea41d
5,794
js
JavaScript
packages/chameleon-vue-precompiler/lib/precompiler/hooks/style-binding.js
ReusLi/chameleon
ac319782758908f58d156192a24d3ea3c94147f9
[ "Apache-2.0" ]
1
2019-11-07T14:05:06.000Z
2019-11-07T14:05:06.000Z
packages/chameleon-vue-precompiler/lib/precompiler/hooks/style-binding.js
ReusLi/chameleon
ac319782758908f58d156192a24d3ea3c94147f9
[ "Apache-2.0" ]
null
null
null
packages/chameleon-vue-precompiler/lib/precompiler/hooks/style-binding.js
ReusLi/chameleon
ac319782758908f58d156192a24d3ea3c94147f9
[ "Apache-2.0" ]
1
2020-03-06T07:26:06.000Z
2020-03-06T07:26:06.000Z
/** * @fileOverview to wrap object leterals with _px2rem() */ const escodegen = require('escodegen') const config = require('../config') const bindingStyleNamesForPx2Rem = config.get()['bindingStyleNamesForPx2Rem'] const { ast } = require('../util') const { getCompiler } = require('../components') const { getTransformer } = require('wxv-transformer') function transformArray (ast, tagName, rootValue) { const elements = ast.elements for (let i = 0, l = elements.length; i < l; i++) { const element = elements[i] const result = transformNode(element, tagName, rootValue) if (result) { elements[i] = result } } return ast } /** * transform ConditionalExpressions. e.g.: * :style="a ? b : c" => :style="_px2rem(a, rootValue) ? _px2rem(b, rootValue) : _px2rem(c, rootValue)" * @param {ConditionalExpression} ast */ function transformConditional (ast, tagName, rootValue) { ast.consequent = transformNode(ast.consequent, tagName, rootValue) ast.alternate = transformNode(ast.alternate, tagName, rootValue) return ast } /** * transform :style="{width:w}" => :style="{width:_px2rem(w, rootValue)}" * This kind of style binding with object literal is a good practice. * @param {ObjectExpression} ast */ function transformObject (ast, tagName, rootValue) { const compiler = getCompiler(tagName) if (compiler) { return compiler.compile(ast, bindingStyleNamesForPx2Rem, rootValue, transformNode) } const properties = ast.properties for (let i = 0, l = properties.length; i < l; i++) { const prop = properties[i] const keyNode = prop.key const keyType = keyNode.type const key = keyType === 'Literal' ? keyNode.value : keyNode.name if (bindingStyleNamesForPx2Rem.indexOf(key) > -1) { prop.value = transformNode(prop.value, tagName, rootValue, true/*asPropValue*/) } } return ast } function transformLiteral (...args) { // not to transform literal string directly since we don't know // if we could use 0.5px to support hairline unless in runtime. return transformAsWhole(...args) } /** * type = 'Identifier' * @param {Identifier} ast */ function transformIdentifier (...args) { return transformAsWhole(...args) } /** * transform MemberExpression like :styles="myData.styles" */ function transformMember (...args) { return transformAsWhole(...args) } /** * transform CallExpression like :stylles="getMyStyles()" */ function transformCall (ast, ...args) { const name = ast.callee.name if (name && name.match(/_processExclusiveStyle|_px2rem/)) { return ast // already transformed. } return transformAsWhole(ast, ...args) } /** * transform a value object for a property in a object expression. * @param {Literal || Identifier} ast a value expression in object literal. */ function transformAsValue (ast, tagName, rootValue) { return { type: 'CallExpression', callee: { type: 'Identifier', name: '_px2rem' }, arguments: [ast, { type: 'Literal', value: rootValue }] } } /** * transform :style="expression" => :style="_px2rem(expression, opts)" directly * wrapping with _px2rem or _processExclusiveStyle function. * ////////////////////// * support node type: * - MemberExpression * - Identifier * - CallExpression * ////////////////////// * not support: * - ObjectExpression * - ConditionalExpression * - ArrayExpression */ function transformAsWhole (ast, tagName, rootValue) { let callName = '_px2rem' const args = [ast, { type: 'Literal', value: rootValue }] const transformer = getTransformer(tagName) if (transformer) { // special treatment for exclusive styles, such as text-lines callName = '_processExclusiveStyle' args.push({ type: 'Literal', value: tagName, }) } return { type: 'CallExpression', callee: { type: 'Identifier', name: callName }, arguments: args } } /** * @param {boolean} asPropValue: whether this ast node is a value node for a style * object. If it is, we shouldn't use _processExclusiveStyle. */ function transformNode (ast, tagName, rootValue, asPropValue) { if (asPropValue) { return transformAsValue(ast, tagName, rootValue) } const type = ast.type switch (type) { // not as whole types. case 'ArrayExpression': return transformArray(ast, tagName, rootValue) case 'ConditionalExpression': return transformConditional(ast, tagName, rootValue) case 'ObjectExpression': return transformObject(ast, tagName, rootValue) // as whole types. case 'Identifier': return transformIdentifier(ast, tagName, rootValue) case 'CallExpression': return transformCall(ast, tagName, rootValue) case 'MemberExpression': return transformMember(ast, tagName, rootValue) case 'Literal': return transformLiteral(ast, tagName, rootValue) default: { console.warn('[weex-vue-precompiler]: current expression not in transform lists:', type) console.log('[weex-vue-precomiler]: current ast node:', ast) return transformAsWhole(ast, tagName, rootValue) } } } function styleBindingHook ( el, attrsMap, attrsList, attrs, staticClass ) { try { const styleBinding = el.styleBinding if (!styleBinding) { return } const parsedAst = ast.parseAst(styleBinding.trim()) const { rootValue } = this.config.px2rem const transformedAst = transformNode(parsedAst, el._origTag || el.tag, rootValue) const res = escodegen.generate(transformedAst, { format: { indent: { style: ' ' }, newline: '', } }) el.styleBinding = res } catch (err) { console.log(`[weex-vue-precompiler] ooops! There\'s a err`) } } module.exports = styleBindingHook
28.126214
104
0.668278
c1cea2d5cac9d92cfee18901da54355e7fe050d3
4,722
js
JavaScript
third_party/closure_compiler/interfaces/language_settings_private_interface.js
zealoussnow/chromium
fd8a8914ca0183f0add65ae55f04e287543c7d4a
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
14,668
2015-01-01T01:57:10.000Z
2022-03-31T23:33:32.000Z
third_party/closure_compiler/interfaces/language_settings_private_interface.js
zealoussnow/chromium
fd8a8914ca0183f0add65ae55f04e287543c7d4a
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
113
2015-05-04T09:58:14.000Z
2022-01-31T19:35:03.000Z
third_party/closure_compiler/interfaces/language_settings_private_interface.js
zealoussnow/chromium
fd8a8914ca0183f0add65ae55f04e287543c7d4a
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
5,941
2015-01-02T11:32:21.000Z
2022-03-31T16:35:46.000Z
// Copyright 2021 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // This file was generated by: // ./tools/json_schema_compiler/compiler.py. /** @fileoverview Interface for languageSettingsPrivate that can be overriden. */ /** @interface */ function LanguageSettingsPrivate() {} LanguageSettingsPrivate.prototype = { /** * Gets languages available for translate, spell checking, input and locale. * @param {function(!Array<!chrome.languageSettingsPrivate.Language>): void} * callback */ getLanguageList: function(callback) {}, /** * Enables a language, adding it to the Accept-Language list (used to decide * which languages to translate, generate the Accept-Language header, etc.). * @param {string} languageCode */ enableLanguage: function(languageCode) {}, /** * Disables a language, removing it from the Accept-Language list. * @param {string} languageCode */ disableLanguage: function(languageCode) {}, /** * Enables or disables translation for a given language. * @param {string} languageCode * @param {boolean} enable */ setEnableTranslationForLanguage: function(languageCode, enable) {}, /** * Moves a language inside the language list. * @param {string} languageCode * @param {!chrome.languageSettingsPrivate.MoveType} moveType */ moveLanguage: function(languageCode, moveType) {}, /** * Gets languages that should always be automatically translated. * @param {function(!Array<string>): void} callback */ getAlwaysTranslateLanguages: function(callback) {}, /** * Sets whether a given language should always be automatically translated. * @param {string} languageCode * @param {boolean} alwaysTranslate */ setLanguageAlwaysTranslateState: function(languageCode, alwaysTranslate) {}, /** * Gets languages that should never be offered to translate. * @param {function(!Array<string>): void} callback */ getNeverTranslateLanguages: function(callback) {}, /** * Gets the current status of the chosen spell check dictionaries. * @param {function(!Array<!chrome.languageSettingsPrivate.SpellcheckDictionaryStatus>): void} * callback */ getSpellcheckDictionaryStatuses: function(callback) {}, /** * Gets the custom spell check words, in sorted order. * @param {function(!Array<string>): void} callback */ getSpellcheckWords: function(callback) {}, /** * Adds a word to the custom dictionary. * @param {string} word */ addSpellcheckWord: function(word) {}, /** * Removes a word from the custom dictionary. * @param {string} word */ removeSpellcheckWord: function(word) {}, /** * Gets the translate target language (in most cases, the display locale). * @param {function(string): void} callback */ getTranslateTargetLanguage: function(callback) {}, /** * Sets the translate target language given a language code. * @param {string} languageCode */ setTranslateTargetLanguage: function(languageCode) {}, /** * Gets all supported input methods, including third-party IMEs. Chrome OS * only. * @param {function(!chrome.languageSettingsPrivate.InputMethodLists): void} * callback */ getInputMethodLists: function(callback) {}, /** * Adds the input method to the current user's list of enabled input methods, * enabling the input method for the current user. Chrome OS only. * @param {string} inputMethodId */ addInputMethod: function(inputMethodId) {}, /** * Removes the input method from the current user's list of enabled input * methods, disabling the input method for the current user. Chrome OS only. * @param {string} inputMethodId */ removeInputMethod: function(inputMethodId) {}, /** * Tries to download the dictionary after a failed download. * @param {string} languageCode */ retryDownloadDictionary: function(languageCode) {}, }; /** * Called when the pref for the dictionaries used for spell checking changes or * the status of one of the spell check dictionaries changes. * @type {!ChromeEvent} */ LanguageSettingsPrivate.prototype.onSpellcheckDictionariesChanged; /** * Called when words are added to and/or removed from the custom spell check * dictionary. * @type {!ChromeEvent} */ LanguageSettingsPrivate.prototype.onCustomDictionaryChanged; /** * Called when an input method is added. * @type {!ChromeEvent} */ LanguageSettingsPrivate.prototype.onInputMethodAdded; /** * Called when an input method is removed. * @type {!ChromeEvent} */ LanguageSettingsPrivate.prototype.onInputMethodRemoved;
29.886076
96
0.70881
c1cf1b1a46cfcf4c07bc0a9551340f6142a54183
225
js
JavaScript
valid-number.js
jojonium/leetcode
ea8fd32d71db79f408a1cdb943926310d1d3c997
[ "MIT" ]
null
null
null
valid-number.js
jojonium/leetcode
ea8fd32d71db79f408a1cdb943926310d1d3c997
[ "MIT" ]
null
null
null
valid-number.js
jojonium/leetcode
ea8fd32d71db79f408a1cdb943926310d1d3c997
[ "MIT" ]
null
null
null
/** * https://leetcode.com/problems/valid-number/ * * @param {string} s * @return {boolean} */ var isNumber = function(s) { return /^((([\+-]?((\d+\.)|(\d+\.\d+)|(\.\d+)))|([\+-]?\d+))([eE][\+-]?\d+)?)$/.test(s); };
22.5
92
0.44
c1cf20656080bf1f61fce9e2cbe09f019cf863f4
1,981
js
JavaScript
themes/docsy/assets/vendor/Font-Awesome/js-packages/@fortawesome/free-brands-svg-icons/faCpanel.js
huangjunxin/jyutping.org
346ac740614fe4635164b868548bc2ee8f184609
[ "CC0-1.0" ]
29
2020-09-29T14:47:32.000Z
2022-02-22T12:05:10.000Z
themes/docsy/assets/vendor/Font-Awesome/js-packages/@fortawesome/free-brands-svg-icons/faCpanel.js
huangjunxin/jyutping.org
346ac740614fe4635164b868548bc2ee8f184609
[ "CC0-1.0" ]
5
2020-11-18T23:36:57.000Z
2022-03-26T16:51:33.000Z
themes/docsy/assets/vendor/Font-Awesome/js-packages/@fortawesome/free-brands-svg-icons/faCpanel.js
huangjunxin/jyutping.org
346ac740614fe4635164b868548bc2ee8f184609
[ "CC0-1.0" ]
12
2020-07-29T10:26:48.000Z
2022-03-14T02:38:38.000Z
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var prefix = 'fab'; var iconName = 'cpanel'; var width = 640; var height = 512; var ligatures = []; var unicode = 'f388'; var svgPathData = 'M210.3 220.2c-5.6-24.8-26.9-41.2-51-41.2h-37c-7.1 0-12.5 4.5-14.3 10.9L73.1 320l24.7-.1c6.8 0 12.3-4.5 14.2-10.7l25.8-95.7h19.8c8.4 0 16.2 5.6 18.3 14.8 2.5 10.9-5.9 22.6-18.3 22.6h-10.3c-7 0-12.5 4.6-14.3 10.8l-6.4 23.8h32c37.2 0 58.3-36.2 51.7-65.3zm-156.5 28h18.6c6.9 0 12.4-4.4 14.3-10.9l6.2-23.6h-40C30 213.7 9 227.8 1.7 254.8-7 288.6 18.5 320 52 320h12.4l7.1-26.1c1.2-4.4-2.2-8.3-6.4-8.3H53.8c-24.7 0-24.9-37.4 0-37.4zm247.5-34.8h-77.9l-3.5 13.4c-2.4 9.6 4.5 18.5 14.2 18.5h57.5c4 0 2.4 4.3 2.1 5.3l-8.6 31.8c-.4 1.4-.9 5.3-5.5 5.3h-34.9c-5.3 0-5.3-7.9 0-7.9h21.6c6.8 0 12.3-4.6 14.2-10.8l3.5-13.2h-48.4c-39.2 0-43.6 63.8-.7 63.8l57.5.2c11.2 0 20.6-7.2 23.4-17.8l14-51.8c4.8-19.2-9.7-36.8-28.5-36.8zM633.1 179h-18.9c-4.9 0-9.2 3.2-10.4 7.9L568.2 320c20.7 0 39.8-13.8 44.9-34.5l26.5-98.2c1.2-4.3-2-8.3-6.5-8.3zm-236.3 34.7v.1h-48.3l-26.2 98c-1.2 4.4 2.2 8.3 6.4 8.3h18.9c4.8 0 9.2-3 10.4-7.8l17.2-64H395c12.5 0 21.4 11.8 18.1 23.4l-10.6 40c-1.2 4.3 1.9 8.3 6.4 8.3H428c4.6 0 9.1-2.9 10.3-7.8l8.8-33.1c9-33.1-15.9-65.4-50.3-65.4zm98.3 74.6c-3.6 0-6-3.4-5.1-6.7l8-30c.9-3.9 3.7-6 7.8-6h32.9c2.6 0 4.6 2.4 3.9 5.1l-.7 2.6c-.6 2-1.9 3-3.9 3h-21.6c-7 0-12.6 4.6-14.2 10.8l-3.5 13h53.4c10.5 0 20.3-6.6 23.2-17.6l3.2-12c4.9-19.1-9.3-36.8-28.3-36.8h-47.3c-17.9 0-33.8 12-38.6 29.6l-10.8 40c-5 17.7 8.3 36.7 28.3 36.7h66.7c6.8 0 12.3-4.5 14.2-10.7l5.7-21z'; exports.definition = { prefix: prefix, iconName: iconName, icon: [ width, height, ligatures, unicode, svgPathData ]}; exports.faCpanel = exports.definition; exports.prefix = prefix; exports.iconName = iconName; exports.width = width; exports.height = height; exports.ligatures = ligatures; exports.unicode = unicode; exports.svgPathData = svgPathData;
68.310345
1,373
0.635033
c1cf75fdc71a394065e303add5681998c4d64a20
474
js
JavaScript
node_modules/weak-lru-cache/tests/test.js
Gomatheeswaran/Gomatheeswaran
7e3d90c3db47ce20881c123d3227c813593911c3
[ "MIT" ]
36
2022-01-28T13:07:08.000Z
2022-03-30T10:17:23.000Z
node_modules/weak-lru-cache/tests/test.js
Gomatheeswaran/Gomatheeswaran
7e3d90c3db47ce20881c123d3227c813593911c3
[ "MIT" ]
19
2022-01-29T14:59:32.000Z
2022-03-31T10:59:17.000Z
node_modules/weak-lru-cache/tests/test.js
Gomatheeswaran/Gomatheeswaran
7e3d90c3db47ce20881c123d3227c813593911c3
[ "MIT" ]
3
2022-02-18T02:36:01.000Z
2022-03-05T15:59:28.000Z
import { WeakLRUCache } from '../index.js' import chai from 'chai' const assert = chai.assert let cache = new WeakLRUCache() suite('WeakLRUCache basic tests', function(){ test('add entries', function(){ let entry = cache.getValue(2) assert.equal(entry, undefined) let obj = {} cache.setValue(2, obj) assert.equal(cache.getValue(2), obj) debugger if (cache.expirer.clean) cache.expirer.clean() assert.equal(cache.getValue(2), obj) }) })
26.333333
46
0.670886
c1d02cc7da642812c7494147a9e57ed7d797c09c
2,338
js
JavaScript
js/estimate/trello-api.js
Pappira/power-up-template
c78dcd08459124092998bef3223007ec818cabd4
[ "MIT" ]
1
2020-07-28T12:47:13.000Z
2020-07-28T12:47:13.000Z
js/estimate/trello-api.js
Pappira/power-up-template
c78dcd08459124092998bef3223007ec818cabd4
[ "MIT" ]
null
null
null
js/estimate/trello-api.js
Pappira/power-up-template
c78dcd08459124092998bef3223007ec818cabd4
[ "MIT" ]
null
null
null
"use strict"; var Promise = TrelloPowerUp.Promise; var isAuthorized = function(t){ return t.get('member', 'private', 'token') .then(function(token){ if(token){ if(!Trello.token()){ setTrelloToken(token); } return { authorized: true }; } return { authorized: false }; }); }; var setTrelloToken = function(token){ Trello.setToken(token); }; var setTrelloCardName = function(t, card, name){ return isAuthorized(t).then(function(authorized){ if(authorized.authorized){ return Trello.put("/cards/"+card.id, {name: name}); } }); }; var updateTrelloCard = function(t, card, success, error){ return isAuthorized(t).then(function(authorized){ if(authorized.authorized){ return Trello.put("/cards/"+card.id, card, success, error); } }); }; var getTrelloCard = function(t, cardId){ return isAuthorized(t).then(function(authorized){ if(authorized.authorized){ return Trello.get("/cards/"+cardId,{fields: "name,desc,idChecklists,dateLastActivity",checklists: "all"}, function(theCard){return theCard;}); } }); }; var createNewTrelloCard = function(t, card, success, error){ return isAuthorized(t).then(function(authorized){ if(authorized.authorized){ return Trello.post("/cards/",card, success, error); } }); }; var addCheckListToCard = function(t,currentCheckList){ return isAuthorized(t).then(function(authorized){ if(authorized.authorized){ return Trello.post("/checklists", currentCheckList); } }); }; var addCheckListItemToCheckList = function(t,checkListItem,checkListId){ return isAuthorized(t).then(function(authorized){ if(authorized.authorized){ return Trello.post("/checklists/" + checkListId +"/checkItems",checkListItem); } }); }; var getCheckLists = function(t,cardId){ return isAuthorized(t).then(function(authorized){ if(authorized.authorized){ return Trello.get("card/" + cardId + "/checklists/"); } }); }; var removeCheckLists = function(t,checkListId){ return isAuthorized(t).then(function(authorized){ if(authorized.authorized){ return Trello.delete("checklists/" + checkListId); } }); };
28.864198
150
0.631737
c1d08c6cafc20f20b322226f133e8e20f5bb9420
51,154
js
JavaScript
ajax/libs/yui/3.4.1/editor/editor-min.js
platanus/cdnjs
daa228b7426fa70b2e3c82f9ef9e8d19548bc255
[ "MIT" ]
5
2015-02-20T16:11:30.000Z
2017-05-15T11:50:44.000Z
build/editor/editor-min.js
langpavel/yui3
05303ef5fe2bb6614b33df05cc3022cf20958d8d
[ "MIT" ]
null
null
null
build/editor/editor-min.js
langpavel/yui3
05303ef5fe2bb6614b33df05cc3022cf20958d8d
[ "MIT" ]
4
2015-07-14T16:16:05.000Z
2021-03-10T08:15:54.000Z
YUI.add("frame",function(d){var a=function(){a.superclass.constructor.apply(this,arguments);},c=":last-child",b="body";d.extend(a,d.Base,{_ready:null,_rendered:null,_iframe:null,_instance:null,_create:function(e){var k,j,g,i;this._iframe=d.Node.create(a.HTML);this._iframe.setStyle("visibility","hidden");this._iframe.set("src",this.get("src"));this.get("container").append(this._iframe);this._iframe.set("height","99%");var f="",h=((this.get("extracss"))?'<style id="extra_css">'+this.get("extracss")+"</style>":"");f=d.substitute(a.PAGE_HTML,{DIR:this.get("dir"),LANG:this.get("lang"),TITLE:this.get("title"),META:a.META,LINKED_CSS:this.get("linkedcss"),CONTENT:this.get("content"),BASE_HREF:this.get("basehref"),DEFAULT_CSS:a.DEFAULT_CSS,EXTRA_CSS:h});if(d.config.doc.compatMode!="BackCompat"){f=a.getDocType()+"\n"+f;}else{}g=this._resolveWinDoc();g.doc.open();g.doc.write(f);g.doc.close();if(!g.doc.documentElement){var l=d.later(1,this,function(){if(g.doc&&g.doc.documentElement){e(g);l.cancel();}},null,true);}else{e(g);}},_resolveWinDoc:function(f){var e=(f)?f:{};e.win=d.Node.getDOMNode(this._iframe.get("contentWindow"));e.doc=d.Node.getDOMNode(this._iframe.get("contentWindow.document"));if(!e.doc){e.doc=d.config.doc;}if(!e.win){e.win=d.config.win;}return e;},_onDomEvent:function(h){var g,f;if(!d.Node.getDOMNode(this._iframe)){return;}h.frameX=h.frameY=0;if(h.pageX>0||h.pageY>0){if(h.type.substring(0,3)!=="key"){f=this._instance.one("win");g=this._iframe.getXY();h.frameX=g[0]+h.pageX-f.get("scrollLeft");h.frameY=g[1]+h.pageY-f.get("scrollTop");}}h.frameTarget=h.target;h.frameCurrentTarget=h.currentTarget;h.frameEvent=h;this.fire("dom:"+h.type,h);},initializer:function(){this.publish("ready",{emitFacade:true,defaultFn:this._defReadyFn});},destructor:function(){var e=this.getInstance();e.one("doc").detachAll();e=null;this._iframe.remove();},_DOMPaste:function(i){var g=this.getInstance(),f="",h=g.config.win;if(i._event.originalTarget){f=i._event.originalTarget;}if(i._event.clipboardData){f=i._event.clipboardData.getData("Text");}if(h.clipboardData){f=h.clipboardData.getData("Text");if(f===""){if(!h.clipboardData.setData("Text",f)){f=null;}}}i.frameTarget=i.target;i.frameCurrentTarget=i.currentTarget;i.frameEvent=i;if(f){i.clipboardData={data:f,getData:function(){return f;}};}else{i.clipboardData=null;}this.fire("dom:paste",i);},_defReadyFn:function(){var e=this.getInstance();d.each(a.DOM_EVENTS,function(g,f){var h=d.bind(this._onDomEvent,this),i=((d.UA.ie&&a.THROTTLE_TIME>0)?d.throttle(h,a.THROTTLE_TIME):h);if(!e.Node.DOM_EVENTS[f]){e.Node.DOM_EVENTS[f]=1;}if(g===1){if(f!=="focus"&&f!=="blur"&&f!=="paste"){if(f.substring(0,3)==="key"){e.on(f,i,e.config.doc);}else{e.on(f,h,e.config.doc);}}}},this);e.Node.DOM_EVENTS.paste=1;e.on("paste",d.bind(this._DOMPaste,this),e.one("body"));e.on("focus",d.bind(this._onDomEvent,this),e.config.win);e.on("blur",d.bind(this._onDomEvent,this),e.config.win);e._use=e.use;e.use=d.bind(this.use,this);this._iframe.setStyles({visibility:"inherit"});e.one("body").setStyle("display","block");if(d.UA.ie){this._fixIECursors();}},_fixIECursors:function(){var h=this.getInstance(),f=h.all("table"),g=h.all("br"),e;if(f.size()&&g.size()){e=f.item(0).get("sourceIndex");g.each(function(l){var j=l.get("parentNode"),k=j.get("children"),i=j.all(">br");if(j.test("div")){if(k.size()>2){l.replace(h.Node.create("<wbr>"));}else{if(l.get("sourceIndex")>e){if(i.size()){l.replace(h.Node.create("<wbr>"));}}else{if(i.size()>1){l.replace(h.Node.create("<wbr>"));}}}}});}},_onContentReady:function(h){if(!this._ready){this._ready=true;var g=this.getInstance(),f=d.clone(this.get("use"));this.fire("contentready");if(h){g.config.doc=d.Node.getDOMNode(h.target);}f.push(d.bind(function(){if(g.Selection){g.Selection.DEFAULT_BLOCK_TAG=this.get("defaultblock");}if(this.get("designMode")){if(d.UA.ie){g.config.doc.body.contentEditable="true";this._ieSetBodyHeight();g.on("keyup",d.bind(this._ieSetBodyHeight,this),g.config.doc);}else{g.config.doc.designMode="on";}}this.fire("ready");},this));g.use.apply(g,f);g.one("doc").get("documentElement").addClass("yui-js-enabled");}},_ieHeightCounter:null,_ieSetBodyHeight:function(k){if(!this._ieHeightCounter){this._ieHeightCounter=0;}this._ieHeightCounter++;var j=false;if(!k){j=true;}if(k){switch(k.keyCode){case 8:case 13:j=true;break;}if(k.ctrlKey||k.shiftKey){j=true;}}if(j){try{var i=this.getInstance();var g=this._iframe.get("offsetHeight");var f=i.config.doc.body.scrollHeight;if(g>f){g=(g-15)+"px";i.config.doc.body.style.height=g;}else{i.config.doc.body.style.height="auto";}}catch(k){if(this._ieHeightCounter<100){d.later(200,this,this._ieSetBodyHeight);}else{}}}},_resolveBaseHref:function(e){if(!e||e===""){e=d.config.doc.location.href;if(e.indexOf("?")!==-1){e=e.substring(0,e.indexOf("?"));}e=e.substring(0,e.lastIndexOf("/"))+"/";}return e;},_getHTML:function(e){if(this._ready){var f=this.getInstance();e=f.one("body").get("innerHTML");}return e;},_setHTML:function(e){if(this._ready){var f=this.getInstance();f.one("body").set("innerHTML",e);}else{this.on("contentready",d.bind(function(g,i){var h=this.getInstance();h.one("body").set("innerHTML",g);},this,e));}return e;},_getLinkedCSS:function(e){if(!d.Lang.isArray(e)){e=[e];}var f="";if(!this._ready){d.each(e,function(g){if(g!==""){f+='<link rel="stylesheet" href="'+g+'" type="text/css">';}});}else{f=e;}return f;},_setLinkedCSS:function(e){if(this._ready){var f=this.getInstance();f.Get.css(e);}return e;},_setExtraCSS:function(e){if(this._ready){var g=this.getInstance(),f=g.one("#extra_css");f.remove();g.one("head").append('<style id="extra_css">'+e+"</style>");}return e;},_instanceLoaded:function(f){this._instance=f;this._onContentReady();var g=this._instance.config.doc;if(this.get("designMode")){if(!d.UA.ie){try{g.execCommand("styleWithCSS",false,false);g.execCommand("insertbronreturn",false,false);}catch(e){}}}},use:function(){var g=this.getInstance(),f=d.Array(arguments),e=false;if(d.Lang.isFunction(f[f.length-1])){e=f.pop(); }if(e){f.push(function(){e.apply(g,arguments);});}g._use.apply(g,f);},delegate:function(g,f,e,i){var h=this.getInstance();if(!h){return false;}if(!i){i=e;e="body";}return h.delegate(g,f,e,i);},getInstance:function(){return this._instance;},render:function(e){if(this._rendered){return this;}this._rendered=true;if(e){this.set("container",e);}this._create(d.bind(function(i){var k,l,f=d.bind(function(m){this._instanceLoaded(m);},this),h=d.clone(this.get("use")),g={debug:false,win:i.win,doc:i.doc},j=d.bind(function(){g=this._resolveWinDoc(g);k=YUI(g);k.host=this.get("host");try{k.use("node-base",f);if(l){clearInterval(l);}}catch(m){l=setInterval(function(){j();},350);}},this);h.push(j);d.use.apply(d,h);},this));return this;},_handleFocus:function(){var h=this.getInstance(),g=new h.Selection();if(g.anchorNode){var j=g.anchorNode,i;if(j.test("p")&&j.get("innerHTML")===""){j=j.get("parentNode");}i=j.get("childNodes");if(i.size()){if(i.item(0).test("br")){g.selectNode(j,true,false);}else{if(i.item(0).test("p")){j=i.item(0).one("br.yui-cursor");if(j){j=j.get("parentNode");}if(!j){j=i.item(0).get("firstChild");}if(!j){j=i.item(0);}if(j){g.selectNode(j,true,false);}}else{var e=h.one("br.yui-cursor");if(e){var f=e.get("parentNode");if(f){g.selectNode(f,true,false);}}}}}}},focus:function(e){if(d.UA.ie&&d.UA.ie<9){try{d.one("win").focus();this.getInstance().one("win").focus();}catch(g){}if(e===true){this._handleFocus();}if(d.Lang.isFunction(e)){e();}}else{try{d.one("win").focus();d.later(100,this,function(){this.getInstance().one("win").focus();if(e===true){this._handleFocus();}if(d.Lang.isFunction(e)){e();}});}catch(f){}}return this;},show:function(){this._iframe.setStyles({position:"static",left:""});if(d.UA.gecko){try{this._instance.config.doc.designMode="on";}catch(f){}this.focus();}return this;},hide:function(){this._iframe.setStyles({position:"absolute",left:"-999999px"});return this;}},{THROTTLE_TIME:100,DOM_EVENTS:{dblclick:1,click:1,paste:1,mouseup:1,mousedown:1,keyup:1,keydown:1,keypress:1,activate:1,deactivate:1,beforedeactivate:1,focusin:1,focusout:1},DEFAULT_CSS:"body { background-color: #fff; font: 13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small; } a, a:visited, a:hover { color: blue !important; text-decoration: underline !important; cursor: text !important; } img { cursor: pointer !important; border: none; }",HTML:'<iframe border="0" frameBorder="0" marginWidth="0" marginHeight="0" leftMargin="0" topMargin="0" allowTransparency="true" width="100%" height="99%"></iframe>',PAGE_HTML:'<html dir="{DIR}" lang="{LANG}"><head><title>{TITLE}</title>{META}<base href="{BASE_HREF}"/>{LINKED_CSS}<style id="editor_css">{DEFAULT_CSS}</style>{EXTRA_CSS}</head><body>{CONTENT}</body></html>',getDocType:function(){var e=d.config.doc.doctype,f=a.DOC_TYPE;if(e){f="<!DOCTYPE "+e.name+((e.publicId)?" "+e.publicId:"")+((e.systemId)?" "+e.systemId:"")+">";}else{if(d.config.doc.all){e=d.config.doc.all[0];if(e.nodeType){if(e.nodeType===8){if(e.nodeValue){if(e.nodeValue.toLowerCase().indexOf("doctype")!==-1){f="<!"+e.nodeValue+">";}}}}}}return f;},DOC_TYPE:'<!DOCTYPE HTML PUBLIC "-/'+"/W3C/"+"/DTD HTML 4.01/"+'/EN" "http:/'+'/www.w3.org/TR/html4/strict.dtd">',META:'<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><meta http-equiv="X-UA-Compatible" content="IE=7">',NAME:"frame",ATTRS:{title:{value:"Blank Page"},dir:{value:"ltr"},lang:{value:"en-US"},src:{value:"javascript"+((d.UA.ie)?":false":":")+";"},designMode:{writeOnce:true,value:false},content:{value:"<br>",setter:"_setHTML",getter:"_getHTML"},basehref:{value:false,getter:"_resolveBaseHref"},use:{writeOnce:true,value:["substitute","node","node-style","selector-css3"]},container:{value:"body",setter:function(e){return d.one(e);}},node:{readOnly:true,value:null,getter:function(){return this._iframe;}},id:{writeOnce:true,getter:function(e){if(!e){e="iframe-"+d.guid();}return e;}},linkedcss:{value:"",getter:"_getLinkedCSS",setter:"_setLinkedCSS"},extracss:{value:"",setter:"_setExtraCSS"},host:{value:false},defaultblock:{value:"p"}}});d.Frame=a;},"@VERSION@",{skinnable:false,requires:["base","node","selector-css3","substitute","yui-throttle"]});YUI.add("selection",function(b){var a="textContent",d="innerHTML",c="fontFamily";if(b.UA.ie){a="nodeValue";}b.Selection=function(o){var j,p,f,g,e,l;if(b.config.win.getSelection){j=b.config.win.getSelection();}else{if(b.config.doc.selection){j=b.config.doc.selection.createRange();}}this._selection=j;if(j.pasteHTML){this.isCollapsed=(j.compareEndPoints("StartToEnd",j))?false:true;if(this.isCollapsed){this.anchorNode=this.focusNode=b.one(j.parentElement());if(o){f=b.config.doc.elementFromPoint(o.clientX,o.clientY);}e=j.duplicate();if(!f){p=j.parentElement();g=p.childNodes;for(l=0;l<g.length;l++){if(e.inRange(j)){if(!f){f=g[l];}}}}this.ieNode=f;if(f){if(f.nodeType!==3){if(f.firstChild){f=f.firstChild;}if(f&&f.tagName&&f.tagName.toLowerCase()==="body"){if(f.firstChild){f=f.firstChild;}}}this.anchorNode=this.focusNode=b.Selection.resolve(f);e.moveToElementText(j.parentElement());var m=j.compareEndPoints("StartToStart",e),q=0;if(m){q=Math.abs(j.move("character",-9999));}this.anchorOffset=this.focusOffset=q;this.anchorTextNode=this.focusTextNode=b.one(f);}}else{if(j.htmlText&&j.htmlText!==""){var k=b.Node.create(j.htmlText);if(k&&k.get("id")){var h=k.get("id");this.anchorNode=this.focusNode=b.one("#"+h);}else{if(k){k=k.get("childNodes");this.anchorNode=this.focusNode=k.item(0);}}}}}else{this.isCollapsed=j.isCollapsed;this.anchorNode=b.Selection.resolve(j.anchorNode);this.focusNode=b.Selection.resolve(j.focusNode);this.anchorOffset=j.anchorOffset;this.focusOffset=j.focusOffset;this.anchorTextNode=b.one(j.anchorNode);this.focusTextNode=b.one(j.focusNode);}if(b.Lang.isString(j.text)){this.text=j.text;}else{if(j.toString){this.text=j.toString();}else{this.text="";}}};b.Selection.removeFontFamily=function(f){f.removeAttribute("face");var e=f.getAttribute("style").toLowerCase();if(e===""||(e=="font-family: ")){f.removeAttribute("style"); }if(e.match(b.Selection.REG_FONTFAMILY)){e=e.replace(b.Selection.REG_FONTFAMILY,"");f.setAttribute("style",e);}};b.Selection.filter=function(e){var h=(new Date()).getTime();var g=b.all(b.Selection.ALL),k=b.all("strong,em"),n=b.config.doc,p,f={},i="",l;var j=(new Date()).getTime();g.each(function(r){var q=b.Node.getDOMNode(r);if(q.style[c]){f["."+r._yuid]=q.style[c];r.addClass(r._yuid);b.Selection.removeFontFamily(q);}});var o=(new Date()).getTime();b.all(".hr").addClass("yui-skip").addClass("yui-non");if(b.UA.ie){p=n.getElementsByTagName("hr");b.each(p,function(t){var r=n.createElement("div");r.className="hr yui-non yui-skip";r.setAttribute("readonly",true);r.setAttribute("contenteditable",false);if(t.parentNode){t.parentNode.replaceChild(r,t);}var q=r.style;q.border="1px solid #ccc";q.lineHeight="0";q.height="0";q.fontSize="0";q.marginTop="5px";q.marginBottom="5px";q.marginLeft="0px";q.marginRight="0px";q.padding="0";});}b.each(f,function(r,q){i+=q+" { font-family: "+r.replace(/"/gi,"")+"; }";});b.StyleSheet(i,"editor");k.each(function(u,q){var r=u.get("tagName").toLowerCase(),s="i";if(r==="strong"){s="b";}b.Selection.prototype._swap(k.item(q),s);});l=b.all("ol,ul");l.each(function(r,q){var s=r.all("li");if(!s.size()){r.remove();}});if(e){b.Selection.filterBlocks();}var m=(new Date()).getTime();};b.Selection.filterBlocks=function(){var f=(new Date()).getTime();var n=b.config.doc.body.childNodes,h,g,q=false,k=true,e,r,t,p,m,o,u;if(n){for(h=0;h<n.length;h++){g=b.one(n[h]);if(!g.test(b.Selection.BLOCKS)){k=true;if(n[h].nodeType==3){o=n[h][a].match(b.Selection.REG_CHAR);u=n[h][a].match(b.Selection.REG_NON);if(o===null&&u){k=false;}}if(k){if(!q){q=[];}q.push(n[h]);}}else{q=b.Selection._wrapBlock(q);}}q=b.Selection._wrapBlock(q);}r=b.all(b.Selection.DEFAULT_BLOCK_TAG);if(r.size()===1){t=r.item(0).all("br");if(t.size()===1){if(!t.item(0).test(".yui-cursor")){t.item(0).remove();}var j=r.item(0).get("innerHTML");if(j===""||j===" "){r.set("innerHTML",b.Selection.CURSOR);e=new b.Selection();e.focusCursor(true,true);}if(t.item(0).test(".yui-cursor")&&b.UA.ie){t.item(0).remove();}}}else{r.each(function(s){var i=s.get("innerHTML");if(i===""){s.remove();}});}if(!b.UA.ie){}var l=(new Date()).getTime();};b.Selection.REG_FONTFAMILY=/font-family: ;/;b.Selection.REG_CHAR=/[a-zA-Z-0-9_!@#\$%\^&*\(\)-=_+\[\]\\{}|;':",.\/<>\?]/gi;b.Selection.REG_NON=/[\s|\n|\t]/gi;b.Selection.REG_NOHTML=/<\S[^><]*>/g;b.Selection._wrapBlock=function(f){if(f){var e=b.Node.create("<"+b.Selection.DEFAULT_BLOCK_TAG+"></"+b.Selection.DEFAULT_BLOCK_TAG+">"),h=b.one(f[0]),g;for(g=1;g<f.length;g++){e.append(f[g]);}h.replace(e);e.prepend(h);}return false;};b.Selection.unfilter=function(){var g=b.all("body [class]"),h="",f,i,e=b.one("body");g.each(function(j){if(j.hasClass(j._yuid)){j.setStyle(c,j.getStyle(c));j.removeClass(j._yuid);if(j.getAttribute("class")===""){j.removeAttribute("class");}}});f=b.all(".yui-non");f.each(function(j){if(!j.hasClass("yui-skip")&&j.get("innerHTML")===""){j.remove();}else{j.removeClass("yui-non").removeClass("yui-skip");}});i=b.all("body [id]");i.each(function(j){if(j.get("id").indexOf("yui_3_")===0){j.removeAttribute("id");j.removeAttribute("_yuid");}});if(e){h=e.get("innerHTML");}b.all(".hr").addClass("yui-skip").addClass("yui-non");return h;};b.Selection.resolve=function(f){if(f&&f.nodeType===3){try{f=f.parentNode;}catch(e){f="body";}}return b.one(f);};b.Selection.getText=function(f){var e=f.get("innerHTML").replace(b.Selection.REG_NOHTML,"");e=e.replace("<span><br></span>","").replace("<br>","");return e;};b.Selection.DEFAULT_BLOCK_TAG="p";b.Selection.ALL="[style],font[face]";b.Selection.BLOCKS="p,div,ul,ol,table,style";b.Selection.TMP="yui-tmp";b.Selection.DEFAULT_TAG="span";b.Selection.CURID="yui-cursor";b.Selection.CUR_WRAPID="yui-cursor-wrapper";b.Selection.CURSOR='<span><br class="yui-cursor"></span>';b.Selection.hasCursor=function(){var e=b.all("#"+b.Selection.CUR_WRAPID);return e.size();};b.Selection.cleanCursor=function(){var f,e="br.yui-cursor";f=b.all(e);if(f.size()){f.each(function(g){var i=g.get("parentNode.parentNode.childNodes"),h;if(i.size()){g.remove();}else{h=b.Selection.getText(i.item(0));if(h!==""){g.remove();}}});}};b.Selection.prototype={text:null,isCollapsed:null,anchorNode:null,anchorOffset:null,anchorTextNode:null,focusNode:null,focusOffset:null,focusTextNode:null,_selection:null,_wrap:function(g,e){var f=b.Node.create("<"+e+"></"+e+">");f.set(d,g.get(d));g.set(d,"");g.append(f);return b.Node.getDOMNode(f);},_swap:function(g,e){var f=b.Node.create("<"+e+"></"+e+">");f.set(d,g.get(d));g.replace(f,g);return b.Node.getDOMNode(f);},getSelected:function(){b.Selection.filter();b.config.doc.execCommand("fontname",null,b.Selection.TMP);var f=b.all(b.Selection.ALL),e=[];f.each(function(h,g){if(h.getStyle(c)==b.Selection.TMP){h.setStyle(c,"");b.Selection.removeFontFamily(h);if(!h.test("body")){e.push(b.Node.getDOMNode(f.item(g)));}}});return b.all(e);},insertContent:function(e){return this.insertAtCursor(e,this.anchorTextNode,this.anchorOffset,true);},insertAtCursor:function(l,g,i,o){var q=b.Node.create("<"+b.Selection.DEFAULT_TAG+' class="yui-non"></'+b.Selection.DEFAULT_TAG+">"),f,j,h,p,k=this.createRange(),n;if(g&&g.test("body")){n=b.Node.create("<span></span>");g.append(n);g=n;}if(k.pasteHTML){if(i===0&&g&&!g.previous()&&g.get("nodeType")===3){g.insert(l,"before");if(k.moveToElementText){k.moveToElementText(b.Node.getDOMNode(g.previous()));}k.collapse(false);k.select();return g.previous();}else{p=b.Node.create(l);try{k.pasteHTML('<span id="rte-insert"></span>');}catch(m){}f=b.one("#rte-insert");if(f){f.set("id","");f.replace(p);if(k.moveToElementText){k.moveToElementText(b.Node.getDOMNode(p));}k.collapse(false);k.select();return p;}else{b.on("available",function(){f.set("id","");f.replace(p);if(k.moveToElementText){k.moveToElementText(b.Node.getDOMNode(p));}k.collapse(false);k.select();},"#rte-insert");}}}else{if(i>0){f=g.get(a);j=b.one(b.config.doc.createTextNode(f.substr(0,i)));h=b.one(b.config.doc.createTextNode(f.substr(i))); g.replace(j,g);p=b.Node.create(l);if(p.get("nodeType")===11){n=b.Node.create("<span></span>");n.append(p);p=n;}j.insert(p,"after");if(h){p.insert(q,"after");q.insert(h,"after");this.selectNode(q,o);}}else{if(g.get("nodeType")===3){g=g.get("parentNode");}p=b.Node.create(l);l=g.get("innerHTML").replace(/\n/gi,"");if(l===""||l==="<br>"){g.append(p);}else{if(p.get("parentNode")){g.insert(p,"before");}else{b.one("body").prepend(p);}}if(g.get("firstChild").test("br")){g.get("firstChild").remove();}}}return p;},wrapContent:function(f){f=(f)?f:b.Selection.DEFAULT_TAG;if(!this.isCollapsed){var h=this.getSelected(),k=[],g,i,j,e;h.each(function(o,l){var m=o.get("tagName").toLowerCase();if(m==="font"){k.push(this._swap(h.item(l),f));}else{k.push(this._wrap(h.item(l),f));}},this);g=this.createRange();j=k[0];i=k[k.length-1];if(this._selection.removeAllRanges){g.setStart(k[0],0);g.setEnd(i,i.childNodes.length);this._selection.removeAllRanges();this._selection.addRange(g);}else{if(g.moveToElementText){g.moveToElementText(b.Node.getDOMNode(j));e=this.createRange();e.moveToElementText(b.Node.getDOMNode(i));g.setEndPoint("EndToEnd",e);}g.select();}k=b.all(k);return k;}else{return b.all([]);}},replace:function(k,i){var f=this.createRange(),j,e,g,h;if(f.getBookmark){g=f.getBookmark();e=this.anchorNode.get("innerHTML").replace(k,i);this.anchorNode.set("innerHTML",e);f.moveToBookmark(g);h=b.one(f.parentElement());}else{j=this.anchorTextNode;e=j.get(a);g=e.indexOf(k);e=e.replace(k,"");j.set(a,e);h=this.insertAtCursor(i,j,g,true);}return h;},remove:function(){this._selection.removeAllRanges();return this;},createRange:function(){if(b.config.doc.selection){return b.config.doc.selection.createRange();}else{return b.config.doc.createRange();}},selectNode:function(i,k,f){if(!i){return;}f=f||0;i=b.Node.getDOMNode(i);var g=this.createRange();if(g.selectNode){g.selectNode(i);this._selection.removeAllRanges();this._selection.addRange(g);if(k){try{this._selection.collapse(i,f);}catch(h){this._selection.collapse(i,0);}}}else{if(i.nodeType===3){i=i.parentNode;}try{g.moveToElementText(i);}catch(j){}if(k){g.collapse(((f)?false:true));}g.select();}return this;},setCursor:function(){this.removeCursor(false);return this.insertContent(b.Selection.CURSOR);},getCursor:function(){return b.all("#"+b.Selection.CURID);},removeCursor:function(e){var f=this.getCursor();if(f){if(e){f.removeAttribute("id");f.set("innerHTML",'<br class="yui-cursor">');}else{f.remove();}}return f;},focusCursor:function(g,e){if(g!==false){g=true;}if(e!==false){e=true;}var f=this.removeCursor(true);if(f){f.each(function(h){this.selectNode(h,g,e);},this);}},toString:function(){return"Selection Object";}};},"@VERSION@",{skinnable:false,requires:["node"]});YUI.add("exec-command",function(b){var a=function(){a.superclass.constructor.apply(this,arguments);};b.extend(a,b.Base,{_lastKey:null,_inst:null,command:function(f,e){var d=a.COMMANDS[f];if(d){return d.call(this,f,e);}else{return this._command(f,e);}},_command:function(g,f){var d=this.getInstance();try{try{d.config.doc.execCommand("styleWithCSS",null,1);}catch(j){try{d.config.doc.execCommand("useCSS",null,0);}catch(i){}}d.config.doc.execCommand(g,null,f);}catch(h){}},getInstance:function(){if(!this._inst){this._inst=this.get("host").getInstance();}return this._inst;},initializer:function(){b.mix(this.get("host"),{execCommand:function(e,d){return this.exec.command(e,d);},_execCommand:function(e,d){return this.exec._command(e,d);}});this.get("host").on("dom:keypress",b.bind(function(d){this._lastKey=d.keyCode;},this));}},{NAME:"execCommand",NS:"exec",ATTRS:{host:{value:false}},COMMANDS:{wrap:function(f,d){var e=this.getInstance();return(new e.Selection()).wrapContent(d);},inserthtml:function(f,d){var e=this.getInstance();if(e.Selection.hasCursor()||b.UA.ie){return(new e.Selection()).insertContent(d);}else{this._command("inserthtml",d);}},insertandfocus:function(h,e){var g=this.getInstance(),d,f;if(g.Selection.hasCursor()){e+=g.Selection.CURSOR;d=this.command("inserthtml",e);f=new g.Selection();f.focusCursor(true,true);}else{this.command("inserthtml",e);}return d;},insertbr:function(j){var i=this.getInstance(),h=new i.Selection(),d="<var>|</var>",e=null,g=(b.UA.webkit)?"span.Apple-style-span,var":"var";if(h._selection.pasteHTML){h._selection.pasteHTML(d);}else{this._command("inserthtml",d);}var f=function(l){var k=i.Node.create("<br>");l.insert(k,"before");return k;};i.all(g).each(function(m){var l=true;if(b.UA.webkit){l=false;if(m.get("innerHTML")==="|"){l=true;}}if(l){e=f(m);if((!e.previous()||!e.previous().test("br"))&&b.UA.gecko){var k=e.cloneNode();e.insert(k,"after");e=k;}m.remove();}});if(b.UA.webkit&&e){f(e);h.selectNode(e);}},insertimage:function(e,d){return this.command("inserthtml",'<img src="'+d+'">');},addclass:function(f,d){var e=this.getInstance();return(new e.Selection()).getSelected().addClass(d);},removeclass:function(f,d){var e=this.getInstance();return(new e.Selection()).getSelected().removeClass(d);},forecolor:function(f,g){var e=this.getInstance(),d=new e.Selection(),h;if(!b.UA.ie){this._command("useCSS",false);}if(e.Selection.hasCursor()){if(d.isCollapsed){if(d.anchorNode&&(d.anchorNode.get("innerHTML")==="&nbsp;")){d.anchorNode.setStyle("color",g);h=d.anchorNode;}else{h=this.command("inserthtml",'<span style="color: '+g+'">'+e.Selection.CURSOR+"</span>");d.focusCursor(true,true);}return h;}else{return this._command(f,g);}}else{this._command(f,g);}},backcolor:function(f,g){var e=this.getInstance(),d=new e.Selection(),h;if(b.UA.gecko||b.UA.opera){f="hilitecolor";}if(!b.UA.ie){this._command("useCSS",false);}if(e.Selection.hasCursor()){if(d.isCollapsed){if(d.anchorNode&&(d.anchorNode.get("innerHTML")==="&nbsp;")){d.anchorNode.setStyle("backgroundColor",g);h=d.anchorNode;}else{h=this.command("inserthtml",'<span style="background-color: '+g+'">'+e.Selection.CURSOR+"</span>");d.focusCursor(true,true);}return h;}else{return this._command(f,g);}}else{this._command(f,g);}},hilitecolor:function(){return a.COMMANDS.backcolor.apply(this,arguments); },fontname2:function(f,g){this._command("fontname",g);var e=this.getInstance(),d=new e.Selection();if(d.isCollapsed&&(this._lastKey!=32)){if(d.anchorNode.test("font")){d.anchorNode.set("face",g);}}},fontsize2:function(f,h){this._command("fontsize",h);var e=this.getInstance(),d=new e.Selection();if(d.isCollapsed&&d.anchorNode&&(this._lastKey!=32)){if(b.UA.webkit){if(d.anchorNode.getStyle("lineHeight")){d.anchorNode.setStyle("lineHeight","");}}if(d.anchorNode.test("font")){d.anchorNode.set("size",h);}else{if(b.UA.gecko){var g=d.anchorNode.ancestor(e.Selection.DEFAULT_BLOCK_TAG);if(g){g.setStyle("fontSize","");}}}}},insertunorderedlist:function(d){this.command("list","ul");},insertorderedlist:function(d){this.command("list","ol");},list:function(v,z){var f=this.getInstance(),h,u="dir",e="yui3-touched",m,k,l,g,o,q,i,j,x,d,t=(f.host.editorPara?true:false),r=new f.Selection();v="insert"+((z==="ul")?"un":"")+"orderedlist";if(b.UA.ie&&!r.isCollapsed){k=r._selection;h=k.htmlText;l=f.Node.create(h);if(l.test("li")||l.one("li")){this._command(v,null);return;}if(l.test(z)){g=k.item?k.item(0):k.parentElement();o=f.one(g);d=o.all("li");q="<div>";d.each(function(n){if(t){q+="<p>"+n.get("innerHTML")+"</p>";}else{q+=n.get("innerHTML")+"<br>";}});q+="</div>";i=f.Node.create(q);if(o.get("parentNode").test("div")){o=o.get("parentNode");}if(o&&o.hasAttribute(u)){if(t){i.all("p").setAttribute(u,o.getAttribute(u));}else{i.setAttribute(u,o.getAttribute(u));}}if(t){o.replace(i.get("innerHTML"));}else{o.replace(i);}if(k.moveToElementText){k.moveToElementText(i._node);}k.select();}else{j=b.one(k.parentElement());if(!j.test(f.Selection.BLOCKS)){j=j.ancestor(f.Selection.BLOCKS);}if(j){if(j.hasAttribute(u)){m=j.getAttribute(u);}}if(h.indexOf("<br>")>-1){h=h.split(/<br>/i);}else{var y=f.Node.create(h),p=y.all("p");if(p.size()){h=[];p.each(function(s){h.push(s.get("innerHTML"));});}else{h=[h];}}x="<"+z+' id="ie-list">';b.each(h,function(s){var n=f.Node.create(s);if(n.test("p")){if(n.hasAttribute(u)){m=n.getAttribute(u);}s=n.get("innerHTML");}x+="<li>"+s+"</li>";});x+="</"+z+">";k.pasteHTML(x);g=f.config.doc.getElementById("ie-list");g.id="";if(m){g.setAttribute(u,m);}if(k.moveToElementText){k.moveToElementText(g);}k.select();}}else{if(b.UA.ie){j=f.one(r._selection.parentElement());if(j.test("p")){if(j&&j.hasAttribute(u)){m=j.getAttribute(u);}h=b.Selection.getText(j);if(h===""){var w="";if(m){w=' dir="'+m+'"';}x=f.Node.create(b.Lang.sub("<{tag}{dir}><li></li></{tag}>",{tag:z,dir:w}));j.replace(x);r.selectNode(x.one("li"));}else{this._command(v,null);}}else{this._command(v,null);}}else{f.all(z).addClass(e);if(r.anchorNode.test(f.Selection.BLOCKS)){j=r.anchorNode;}else{j=r.anchorNode.ancestor(f.Selection.BLOCKS);}if(!j){j=r.anchorNode.one(f.Selection.BLOCKS);}if(j&&j.hasAttribute(u)){m=j.getAttribute(u);}if(j&&j.test(z)){h=f.Node.create("<div/>");g=j.all("li");g.each(function(n){if(t){h.append("<p>"+n.get("innerHTML")+"</p>");}else{h.append(n.get("innerHTML")+"<br>");}});if(m){if(t){h.all("p").setAttribute(u,m);}else{h.setAttribute(u,m);}}if(t){j.replace(h.get("innerHTML"));}else{j.replace(h);}r.selectNode(h.get("firstChild"));}else{this._command(v,null);}x=f.all(z);if(m){if(x.size()){x.each(function(s){if(!s.hasClass(e)){s.setAttribute(u,m);}});}}x.removeClass(e);}}},justify:function(i,j){if(b.UA.webkit){var h=this.getInstance(),g=new h.Selection(),d=g.anchorNode;var f=d.getStyle("backgroundColor");this._command(j);g=new h.Selection();if(g.anchorNode.test("div")){var e="<span>"+g.anchorNode.get("innerHTML")+"</span>";g.anchorNode.set("innerHTML",e);g.anchorNode.one("span").setStyle("backgroundColor",f);g.selectNode(g.anchorNode.one("span"));}}else{this._command(j);}},justifycenter:function(d){this.command("justify","justifycenter");},justifyleft:function(d){this.command("justify","justifyleft");},justifyright:function(d){this.command("justify","justifyright");},justifyfull:function(d){this.command("justify","justifyfull");}}});var c=function(j,v,r){var k=this.getInstance(),t=k.config.doc,h=t.selection.createRange(),g=t.queryCommandValue(j),l,f,i,e,n,u,q;if(g){l=h.htmlText;f=new RegExp(r,"g");i=l.match(f);if(i){l=l.replace(r+";","").replace(r,"");h.pasteHTML('<var id="yui-ie-bs">');e=t.getElementById("yui-ie-bs");n=t.createElement("div");u=t.createElement(v);n.innerHTML=l;if(e.parentNode!==k.config.doc.body){e=e.parentNode;}q=n.childNodes;e.parentNode.replaceChild(u,e);b.each(q,function(d){u.appendChild(d);});h.collapse();if(h.moveToElementText){h.moveToElementText(u);}h.select();}}this._command(j);};if(b.UA.ie){a.COMMANDS.bold=function(){c.call(this,"bold","b","FONT-WEIGHT: bold");};a.COMMANDS.italic=function(){c.call(this,"italic","i","FONT-STYLE: italic");};a.COMMANDS.underline=function(){c.call(this,"underline","u","TEXT-DECORATION: underline");};}b.namespace("Plugin");b.Plugin.ExecCommand=a;},"@VERSION@",{skinnable:false,requires:["frame"]});YUI.add("editor-tab",function(c){var b=function(){b.superclass.constructor.apply(this,arguments);},a="host";c.extend(b,c.Base,{_onNodeChange:function(f){var d="indent";if(f.changedType==="tab"){if(!f.changedNode.test("li, li *")){f.changedEvent.halt();f.preventDefault();if(f.changedEvent.shiftKey){d="outdent";}this.get(a).execCommand(d,"");}}},initializer:function(){this.get(a).on("nodeChange",c.bind(this._onNodeChange,this));}},{NAME:"editorTab",NS:"tab",ATTRS:{host:{value:false}}});c.namespace("Plugin");c.Plugin.EditorTab=b;},"@VERSION@",{skinnable:false,requires:["editor-base"]});YUI.add("createlink-base",function(b){var a={};a.STRINGS={PROMPT:"Please enter the URL for the link to point to:",DEFAULT:"http://"};b.namespace("Plugin");b.Plugin.CreateLinkBase=a;b.mix(b.Plugin.ExecCommand.COMMANDS,{createlink:function(i){var h=this.get("host").getInstance(),e,c,g,f,d=prompt(a.STRINGS.PROMPT,a.STRINGS.DEFAULT);if(d){f=h.config.doc.createElement("div");d=d.replace(/"/g,"").replace(/'/g,"");d=h.config.doc.createTextNode(d);f.appendChild(d);d=f.innerHTML;this.get("host")._execCommand(i,d); g=new h.Selection();e=g.getSelected();if(!g.isCollapsed&&e.size()){c=e.item(0).one("a");if(c){e.item(0).replace(c);}if(b.UA.gecko){if(c.get("parentNode").test("span")){if(c.get("parentNode").one("br.yui-cursor")){c.get("parentNode").insert(c,"before");}}}}else{this.get("host").execCommand("inserthtml",'<a href="'+d+'">'+d+"</a>");}}return c;}});},"@VERSION@",{skinnable:false,requires:["editor-base"]});YUI.add("editor-base",function(d){var c=function(){c.superclass.constructor.apply(this,arguments);},b=":last-child",a="body";d.extend(c,d.Base,{frame:null,initializer:function(){var e=new d.Frame({designMode:true,title:c.STRINGS.title,use:c.USE,dir:this.get("dir"),extracss:this.get("extracss"),linkedcss:this.get("linkedcss"),defaultblock:this.get("defaultblock"),host:this}).plug(d.Plugin.ExecCommand);e.after("ready",d.bind(this._afterFrameReady,this));e.addTarget(this);this.frame=e;this.publish("nodeChange",{emitFacade:true,bubbles:true,defaultFn:this._defNodeChangeFn});},destructor:function(){this.frame.destroy();this.detachAll();},copyStyles:function(h,g){if(h.test("a")){return;}var e=["color","fontSize","fontFamily","backgroundColor","fontStyle"],f={};d.each(e,function(i){f[i]=h.getStyle(i);});if(h.ancestor("b,strong")){f.fontWeight="bold";}if(h.ancestor("u")){if(!f.textDecoration){f.textDecoration="underline";}}g.setStyles(f);},_lastBookmark:null,_resolveChangedNode:function(i){var h=this.getInstance(),f,e,g;if(h&&i&&i.test("html")){f=h.one(a).one(b);while(!g){if(f){e=f.one(b);if(e){f=e;}else{g=true;}}else{g=true;}}if(f){if(f.test("br")){if(f.previous()){f=f.previous();}else{f=f.get("parentNode");}}if(f){i=f;}}}if(!i){i=h.one(a);}return i;},_defNodeChangeFn:function(t){var j=(new Date()).getTime();var q=this.getInstance(),i,u,p=q.Selection.DEFAULT_BLOCK_TAG;if(d.UA.ie){try{i=q.config.doc.selection.createRange();if(i.getBookmark){this._lastBookmark=i.getBookmark();}}catch(g){}}t.changedNode=this._resolveChangedNode(t.changedNode);switch(t.changedType){case"keydown":if(!d.UA.gecko){if(!c.NC_KEYS[t.changedEvent.keyCode]&&!t.changedEvent.shiftKey&&!t.changedEvent.ctrlKey&&(t.changedEvent.keyCode!==13)){}}break;case"tab":if(!t.changedNode.test("li, li *")&&!t.changedEvent.shiftKey){t.changedEvent.frameEvent.preventDefault();if(d.UA.webkit){this.execCommand("inserttext","\t");}else{if(d.UA.gecko){this.frame.exec._command("inserthtml",c.TABKEY);}else{if(d.UA.ie){this.execCommand("inserthtml",c.TABKEY);}}}}break;case"backspace-up":if(d.UA.webkit&&t.changedNode){t.changedNode.set("innerHTML",t.changedNode.get("innerHTML"));}break;}if(d.UA.webkit&&t.commands&&(t.commands.indent||t.commands.outdent)){var v=q.all(".webkit-indent-blockquote");if(v.size()){v.setStyle("margin","");}}var o=this.getDomPath(t.changedNode,false),f={},n,h,l=[],m="",k="";if(t.commands){f=t.commands;}var s=false;d.each(o,function(A){var w=A.tagName.toLowerCase(),B=c.TAG2CMD[w];if(B){f[B]=1;}var z=A.currentStyle||A.style;if((""+z.fontWeight)=="normal"){s=true;}if((""+z.fontWeight)=="bold"){f.bold=1;}if(d.UA.ie){if(z.fontWeight>400){f.bold=1;}}if(z.fontStyle=="italic"){f.italic=1;}if(z.textDecoration=="underline"){f.underline=1;}if(z.textDecoration=="line-through"){f.strikethrough=1;}var C=q.one(A);if(C.getStyle("fontFamily")){var y=C.getStyle("fontFamily").split(",")[0].toLowerCase();if(y){n=y;}if(n){n=n.replace(/'/g,"").replace(/"/g,"");}}h=c.NORMALIZE_FONTSIZE(C);var x=A.className.split(" ");d.each(x,function(D){if(D!==""&&(D.substr(0,4)!=="yui_")){l.push(D);}});m=c.FILTER_RGB(C.getStyle("color"));var e=c.FILTER_RGB(z.backgroundColor);if(e!=="transparent"){if(e!==""){k=e;}}});if(s){delete f.bold;delete f.italic;}t.dompath=q.all(o);t.classNames=l;t.commands=f;if(!t.fontFamily){t.fontFamily=n;}if(!t.fontSize){t.fontSize=h;}if(!t.fontColor){t.fontColor=m;}if(!t.backgroundColor){t.backgroundColor=k;}var r=(new Date()).getTime();},getDomPath:function(g,e){var i=[],f,h=this.frame.getInstance();f=h.Node.getDOMNode(g);while(f!==null){if((f===h.config.doc.documentElement)||(f===h.config.doc)||!f.tagName){f=null;break;}if(!h.DOM.inDoc(f)){f=null;break;}if(f.nodeName&&f.nodeType&&(f.nodeType==1)){i.push(f);}if(f==h.config.doc.body){f=null;break;}f=f.parentNode;}if(i.length===0){i[0]=h.config.doc.body;}if(e){return h.all(i.reverse());}else{return i.reverse();}},_afterFrameReady:function(){var e=this.frame.getInstance();this.frame.on("dom:mouseup",d.bind(this._onFrameMouseUp,this));this.frame.on("dom:mousedown",d.bind(this._onFrameMouseDown,this));this.frame.on("dom:keydown",d.bind(this._onFrameKeyDown,this));if(d.UA.ie){this.frame.on("dom:activate",d.bind(this._onFrameActivate,this));this.frame.on("dom:beforedeactivate",d.bind(this._beforeFrameDeactivate,this));}this.frame.on("dom:keyup",d.bind(this._onFrameKeyUp,this));this.frame.on("dom:keypress",d.bind(this._onFrameKeyPress,this));this.frame.on("dom:paste",d.bind(this._onPaste,this));e.Selection.filter();this.fire("ready");},_beforeFrameDeactivate:function(h){if(h.frameTarget.test("html")){return;}var g=this.getInstance(),f=g.config.doc.selection.createRange();if(f.compareEndPoints&&!f.compareEndPoints("StartToEnd",f)){f.pasteHTML('<var id="yui-ie-cursor">');}},_onFrameActivate:function(i){if(i.frameTarget.test("html")){return;}var h=this.getInstance(),g=new h.Selection(),f=g.createRange(),j=h.all("#yui-ie-cursor");if(j.size()){j.each(function(m){m.set("id","");if(f.moveToElementText){try{f.moveToElementText(m._node);var k=f.move("character",-1);if(k===-1){f.move("character",1);}f.select();f.text="";}catch(l){}}m.remove();});}},_onPaste:function(f){this.fire("nodeChange",{changedNode:f.frameTarget,changedType:"paste",changedEvent:f.frameEvent});},_onFrameMouseUp:function(f){this.fire("nodeChange",{changedNode:f.frameTarget,changedType:"mouseup",changedEvent:f.frameEvent});},_onFrameMouseDown:function(f){this.fire("nodeChange",{changedNode:f.frameTarget,changedType:"mousedown",changedEvent:f.frameEvent});},_currentSelection:null,_currentSelectionTimer:null,_currentSelectionClear:null,_onFrameKeyDown:function(h){var g,f; if(!this._currentSelection){if(this._currentSelectionTimer){this._currentSelectionTimer.cancel();}this._currentSelectionTimer=d.later(850,this,function(){this._currentSelectionClear=true;});g=this.frame.getInstance();f=new g.Selection(h);this._currentSelection=f;}else{f=this._currentSelection;}g=this.frame.getInstance();f=new g.Selection();this._currentSelection=f;if(f&&f.anchorNode){this.fire("nodeChange",{changedNode:f.anchorNode,changedType:"keydown",changedEvent:h.frameEvent});if(c.NC_KEYS[h.keyCode]){this.fire("nodeChange",{changedNode:f.anchorNode,changedType:c.NC_KEYS[h.keyCode],changedEvent:h.frameEvent});this.fire("nodeChange",{changedNode:f.anchorNode,changedType:c.NC_KEYS[h.keyCode]+"-down",changedEvent:h.frameEvent});}}},_onFrameKeyPress:function(g){var f=this._currentSelection;if(f&&f.anchorNode){this.fire("nodeChange",{changedNode:f.anchorNode,changedType:"keypress",changedEvent:g.frameEvent});if(c.NC_KEYS[g.keyCode]){this.fire("nodeChange",{changedNode:f.anchorNode,changedType:c.NC_KEYS[g.keyCode]+"-press",changedEvent:g.frameEvent});}}},_onFrameKeyUp:function(h){var g=this.frame.getInstance(),f=new g.Selection(h);if(f&&f.anchorNode){this.fire("nodeChange",{changedNode:f.anchorNode,changedType:"keyup",selection:f,changedEvent:h.frameEvent});if(c.NC_KEYS[h.keyCode]){this.fire("nodeChange",{changedNode:f.anchorNode,changedType:c.NC_KEYS[h.keyCode]+"-up",selection:f,changedEvent:h.frameEvent});}}if(this._currentSelectionClear){this._currentSelectionClear=this._currentSelection=null;}},execCommand:function(j,l){var g=this.frame.execCommand(j,l),i=this.frame.getInstance(),h=new i.Selection(),f={},k={changedNode:h.anchorNode,changedType:"execcommand",nodes:g};switch(j){case"forecolor":k.fontColor=l;break;case"backcolor":k.backgroundColor=l;break;case"fontsize":k.fontSize=l;break;case"fontname":k.fontFamily=l;break;}f[j]=1;k.commands=f;this.fire("nodeChange",k);return g;},getInstance:function(){return this.frame.getInstance();},render:function(e){this.frame.set("content",this.get("content"));this.frame.render(e);return this;},focus:function(e){this.frame.focus(e);return this;},show:function(){this.frame.show();return this;},hide:function(){this.frame.hide();return this;},getContent:function(){var e="",f=this.getInstance();if(f&&f.Selection){e=f.Selection.unfilter();}e=e.replace(/ _yuid="([^>]*)"/g,"");return e;}},{NORMALIZE_FONTSIZE:function(g){var e=g.getStyle("fontSize"),f=e;switch(e){case"-webkit-xxx-large":e="48px";break;case"xx-large":e="32px";break;case"x-large":e="24px";break;case"large":e="18px";break;case"medium":e="16px";break;case"small":e="13px";break;case"x-small":e="10px";break;}if(f!==e){g.setStyle("fontSize",e);}return e;},TABKEY:'<span class="tab">&nbsp;&nbsp;&nbsp;&nbsp;</span>',FILTER_RGB:function(h){if(h.toLowerCase().indexOf("rgb")!=-1){var k=new RegExp("(.*?)rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)(.*?)","gi");var f=h.replace(k,"$1,$2,$3,$4,$5").split(",");if(f.length==5){var j=parseInt(f[1],10).toString(16);var i=parseInt(f[2],10).toString(16);var e=parseInt(f[3],10).toString(16);j=j.length==1?"0"+j:j;i=i.length==1?"0"+i:i;e=e.length==1?"0"+e:e;h="#"+j+i+e;}}return h;},TAG2CMD:{"b":"bold","strong":"bold","i":"italic","em":"italic","u":"underline","sup":"superscript","sub":"subscript","img":"insertimage","a":"createlink","ul":"insertunorderedlist","ol":"insertorderedlist"},NC_KEYS:{8:"backspace",9:"tab",13:"enter",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",46:"delete"},USE:["substitute","node","selector-css3","selection","stylesheet"],NAME:"editorBase",STRINGS:{title:"Rich Text Editor"},ATTRS:{content:{value:'<br class="yui-cursor">',setter:function(e){if(e.substr(0,1)==="\n"){e=e.substr(1);}if(e===""){e='<br class="yui-cursor">';}if(e===" "){if(d.UA.gecko){e='<br class="yui-cursor">';}}return this.frame.set("content",e);},getter:function(){return this.frame.get("content");}},dir:{writeOnce:true,value:"ltr"},linkedcss:{value:"",setter:function(e){if(this.frame){this.frame.set("linkedcss",e);}return e;}},extracss:{value:false,setter:function(e){if(this.frame){this.frame.set("extracss",e);}return e;}},defaultblock:{value:"p"}}});d.EditorBase=c;},"@VERSION@",{skinnable:false,requires:["base","frame","node","exec-command","selection"]});YUI.add("editor-lists",function(f){var e=function(){e.superclass.constructor.apply(this,arguments);},b="li",c="ol",d="ul",a="host";f.extend(e,f.Base,{_onNodeChange:function(l){var j=this.get(a).getInstance(),g,o,p,h,i,m,n=false,q,k=false;if(l.changedType==="tab"){if(l.changedNode.test(b+", "+b+" *")){l.changedEvent.halt();l.preventDefault();o=l.changedNode;i=l.changedEvent.shiftKey;m=o.ancestor(c+","+d);q=d;if(m.get("tagName").toLowerCase()===c){q=c;}if(!o.test(b)){o=o.ancestor(b);}if(i){if(o.ancestor(b)){o.ancestor(b).insert(o,"after");n=true;k=true;}}else{if(o.previous(b)){h=j.Node.create("<"+q+"></"+q+">");o.previous(b).append(h);h.append(o);n=true;}}}if(n){if(!o.test(b)){o=o.ancestor(b);}o.all(e.REMOVE).remove();if(f.UA.ie){o=o.append(e.NON).one(e.NON_SEL);}(new j.Selection()).selectNode(o,true,k);}}},initializer:function(){this.get(a).on("nodeChange",f.bind(this._onNodeChange,this));}},{NON:'<span class="yui-non">&nbsp;</span>',NON_SEL:"span.yui-non",REMOVE:"br",NAME:"editorLists",NS:"lists",ATTRS:{host:{value:false}}});f.namespace("Plugin");f.Plugin.EditorLists=e;},"@VERSION@",{skinnable:false,requires:["editor-base"]});YUI.add("editor-bidi",function(a){var b=function(){b.superclass.constructor.apply(this,arguments);},i="host",h="dir",f="BODY",d="nodeChange",e="bidiContextChange",c=f+" > p",g="style";a.extend(b,a.Base,{lastDirection:null,firstEvent:null,_checkForChange:function(){var k=this.get(i),m=k.getInstance(),l=new m.Selection(),j,n;if(l.isCollapsed){j=b.blockParent(l.focusNode);if(j){n=j.getStyle("direction");if(n!==this.lastDirection){k.fire(e,{changedTo:n});this.lastDirection=n;}}}else{k.fire(e,{changedTo:"select"});this.lastDirection=null;}},_afterNodeChange:function(j){if(this.firstEvent||b.EVENTS[j.changedType]){this._checkForChange(); this.firstEvent=false;}},_afterMouseUp:function(j){this._checkForChange();this.firstEvent=false;},initializer:function(){var j=this.get(i);this.firstEvent=true;j.after(d,a.bind(this._afterNodeChange,this));j.after("dom:mouseup",a.bind(this._afterMouseUp,this));}},{EVENTS:{"backspace-up":true,"pageup-up":true,"pagedown-down":true,"end-up":true,"home-up":true,"left-up":true,"up-up":true,"right-up":true,"down-up":true,"delete-up":true},BLOCKS:a.Selection.BLOCKS,DIV_WRAPPER:"<DIV></DIV>",blockParent:function(l,k){var j=l,n,m;if(!j){j=a.one(f);}if(!j.test(b.BLOCKS)){j=j.ancestor(b.BLOCKS);}if(k&&j.test(f)){n=a.Node.create(b.DIV_WRAPPER);j.get("children").each(function(p,o){if(o===0){m=p;}else{n.append(p);}});m.replace(n);n.prepend(m);j=n;}return j;},_NODE_SELECTED:"bidiSelected",addParents:function(m){var j,l,k;for(j=0;j<m.length;j+=1){m[j].setData(b._NODE_SELECTED,true);}for(j=0;j<m.length;j+=1){l=m[j].get("parentNode");if(!l.test(f)&&!l.getData(b._NODE_SELECTED)){k=true;l.get("children").some(function(n){if(!n.getData(b._NODE_SELECTED)){k=false;return true;}});if(k){m.push(l);l.setData(b._NODE_SELECTED,true);}}}for(j=0;j<m.length;j+=1){m[j].clearData(b._NODE_SELECTED);}return m;},NAME:"editorBidi",NS:"editorBidi",ATTRS:{host:{value:false}},RE_TEXT_ALIGN:/text-align:\s*\w*\s*;/,removeTextAlign:function(j){if(j){if(j.getAttribute(g).match(b.RE_TEXT_ALIGN)){j.setAttribute(g,j.getAttribute(g).replace(b.RE_TEXT_ALIGN,""));}if(j.hasAttribute("align")){j.removeAttribute("align");}}return j;}});a.namespace("Plugin");a.Plugin.EditorBidi=b;a.Plugin.ExecCommand.COMMANDS.bidi=function(m,s){var p=this.getInstance(),k=new p.Selection(),r=this.get(i).get(i).editorBidi,j,n,o,t,l;if(!r){a.error("bidi execCommand is not available without the EditorBiDi plugin.");return;}p.Selection.filterBlocks();if(k.isCollapsed){n=b.blockParent(k.anchorNode);if(!n){n=p.one("body").one(p.Selection.BLOCKS);}n=b.removeTextAlign(n);if(!s){l=n.getAttribute(h);if(!l||l=="ltr"){s="rtl";}else{s="ltr";}}n.setAttribute(h,s);if(a.UA.ie){var q=n.all("br.yui-cursor");if(q.size()===1&&n.get("childNodes").size()==1){q.remove();}}j=n;}else{o=k.getSelected();t=[];o.each(function(u){t.push(b.blockParent(u));});t=p.all(b.addParents(t));t.each(function(v){var u=s;v=b.removeTextAlign(v);if(!u){l=v.getAttribute(h);if(!l||l=="ltr"){u="rtl";}else{u="ltr";}}v.setAttribute(h,u);});j=t;}r._checkForChange();return j;};},"@VERSION@",{skinnable:false,requires:["editor-base"]});YUI.add("editor-para",function(a){var d=function(){d.superclass.constructor.apply(this,arguments);},k="host",f="body",c="nodeChange",j="parentNode",b=f+" > p",h="p",g="<br>",i="firstChild",e="li";a.extend(d,a.Base,{_fixFirstPara:function(){var p=this.get(k),r=p.getInstance(),q,s,l=r.config.doc.body,o=l.innerHTML,m=((o.length)?true:false);if(o===g){o="";m=false;}l.innerHTML="<"+h+">"+o+r.Selection.CURSOR+"</"+h+">";s=r.one(b);q=new r.Selection();q.selectNode(s,true,m);},_onNodeChange:function(R){var F=this.get(k),q=F.getInstance(),x,D,C,T,O,H=q.Selection.DEFAULT_BLOCK_TAG,z,o,s,P,v,l,G,M,u,N,V,S,J,B,A,Q=":last-child";switch(R.changedType){case"enter-up":var m=((this._lastPara)?this._lastPara:R.changedNode),U=m.one("br.yui-cursor");if(this._lastPara){delete this._lastPara;}if(U){if(U.previous()||U.next()){if(U.ancestor(h)){U.remove();}}}if(!m.test(H)){var E=m.ancestor(H);if(E){m=E;E=null;}}if(m.test(H)){var I=m.previous(),L,w,y=false;if(I){L=I.one(Q);while(!y){if(L){w=L.one(Q);if(w){L=w;}else{y=true;}}else{y=true;}}if(L){F.copyStyles(L,m);}}}break;case"enter":if(a.UA.ie){if(R.changedNode.test("br")){R.changedNode.remove();}else{if(R.changedNode.test("p, span")){var U=R.changedNode.one("br.yui-cursor");if(U){U.remove();}}}}if(a.UA.webkit){if(R.changedEvent.shiftKey){F.execCommand("insertbr");R.changedEvent.preventDefault();}}if(R.changedNode.test("li")&&!a.UA.ie){x=q.Selection.getText(R.changedNode);if(x===""){C=R.changedNode.ancestor("ol,ul");var K=C.getAttribute("dir");if(K!==""){K=' dir = "'+K+'"';}C=R.changedNode.ancestor(q.Selection.BLOCKS);T=q.Node.create("<p"+K+">"+q.Selection.CURSOR+"</p>");C.insert(T,"after");R.changedNode.remove();R.changedEvent.halt();O=new q.Selection();O.selectNode(T,true,false);}}if(a.UA.gecko&&F.get("defaultblock")!=="p"){C=R.changedNode;if(!C.test(e)&&!C.ancestor(e)){if(!C.test(H)){C=C.ancestor(H);}T=q.Node.create("<"+H+"></"+H+">");C.insert(T,"after");O=new q.Selection();if(O.anchorOffset){z=O.anchorNode.get("textContent");D=q.one(q.config.doc.createTextNode(z.substr(0,O.anchorOffset)));o=q.one(q.config.doc.createTextNode(z.substr(O.anchorOffset)));P=O.anchorNode;P.setContent("");l=P.cloneNode();l.append(o);G=false;u=P;while(!G){u=u.get(j);if(u&&!u.test(H)){M=u.cloneNode();M.set("innerHTML","");M.append(l);s=u.get("childNodes");var r=false;s.each(function(n){if(r){M.append(n);}if(n===P){r=true;}});P=u;l=M;}else{G=true;}}o=l;O.anchorNode.append(D);if(o){T.append(o);}}if(T.get(i)){T=T.get(i);}T.prepend(q.Selection.CURSOR);O.focusCursor(true,true);x=q.Selection.getText(T);if(x!==""){q.Selection.cleanCursor();}R.changedEvent.preventDefault();}}break;case"keyup":if(a.UA.gecko){if(q.config.doc&&q.config.doc.body&&q.config.doc.body.innerHTML.length<20){if(!q.one(b)){this._fixFirstPara();}}}break;case"backspace-up":case"backspace-down":case"delete-up":if(!a.UA.ie){N=q.all(b);S=q.one(f);if(N.item(0)){S=N.item(0);}V=S.one("br");if(V){V.removeAttribute("id");V.removeAttribute("class");}D=q.Selection.getText(S);D=D.replace(/ /g,"").replace(/\n/g,"");B=S.all("img");if(D.length===0&&!B.size()){if(!S.test(h)){this._fixFirstPara();}J=null;if(R.changedNode&&R.changedNode.test(h)){J=R.changedNode;}if(!J&&F._lastPara&&F._lastPara.inDoc()){J=F._lastPara;}if(J&&!J.test(h)){J=J.ancestor(h);}if(J){if(!J.previous()&&J.get(j)&&J.get(j).test(f)){R.changedEvent.frameEvent.halt();}}}if(a.UA.webkit){if(R.changedNode){S=R.changedNode;if(S.test("li")&&(!S.previous()&&!S.next())){x=S.get("innerHTML").replace(g,"");if(x===""){if(S.get(j)){S.get(j).replace(q.Node.create(g));R.changedEvent.frameEvent.halt(); R.preventDefault();q.Selection.filterBlocks();}}}}}}if(a.UA.gecko){T=R.changedNode;A=q.config.doc.createTextNode(" ");T.appendChild(A);T.removeChild(A);}break;}if(a.UA.gecko){if(R.changedNode&&!R.changedNode.test(H)){J=R.changedNode.ancestor(H);if(J){this._lastPara=J;}}}},_afterEditorReady:function(){var m=this.get(k),n=m.getInstance(),l;if(n){n.Selection.filterBlocks();l=n.Selection.DEFAULT_BLOCK_TAG;b=f+" > "+l;h=l;}},_afterContentChange:function(){var l=this.get(k),m=l.getInstance();if(m&&m.Selection){m.Selection.filterBlocks();}},_afterPaste:function(){var l=this.get(k),n=l.getInstance(),m=new n.Selection();a.later(50,l,function(){n.Selection.filterBlocks();});},initializer:function(){var l=this.get(k);if(l.editorBR){a.error("Can not plug EditorPara and EditorBR at the same time.");return;}l.on(c,a.bind(this._onNodeChange,this));l.after("ready",a.bind(this._afterEditorReady,this));l.after("contentChange",a.bind(this._afterContentChange,this));if(a.Env.webkit){l.after("dom:paste",a.bind(this._afterPaste,this));}}},{NAME:"editorPara",NS:"editorPara",ATTRS:{host:{value:false}}});a.namespace("Plugin");a.Plugin.EditorPara=d;},"@VERSION@",{skinnable:false,requires:["editor-base"]});YUI.add("editor-br",function(c){var d=function(){d.superclass.constructor.apply(this,arguments);},a="host",b="li";c.extend(d,c.Base,{_onKeyDown:function(j){if(j.stopped){j.halt();return;}if(j.keyCode==13){var g=this.get(a),i=g.getInstance(),h=new i.Selection(),f="";if(h){if(c.UA.ie){if(!h.anchorNode||(!h.anchorNode.test(b)&&!h.anchorNode.ancestor(b))){h._selection.pasteHTML("<br>");h._selection.collapse(false);h._selection.select();j.halt();}}if(c.UA.webkit){if(!h.anchorNode.test(b)&&!h.anchorNode.ancestor(b)){g.frame._execCommand("insertlinebreak",null);j.halt();}}}}},_afterEditorReady:function(){var e=this.get(a).getInstance();try{e.config.doc.execCommand("insertbronreturn",null,true);}catch(f){}if(c.UA.ie||c.UA.webkit){e.on("keydown",c.bind(this._onKeyDown,this),e.config.doc);}},_onNodeChange:function(h){switch(h.changedType){case"backspace-up":case"backspace-down":case"delete-up":var g=this.get(a).getInstance();var i=h.changedNode;var f=g.config.doc.createTextNode(" ");i.appendChild(f);i.removeChild(f);break;}},initializer:function(){var e=this.get(a);if(e.editorPara){c.error("Can not plug EditorBR and EditorPara at the same time.");return;}e.after("ready",c.bind(this._afterEditorReady,this));if(c.UA.gecko){e.on("nodeChange",c.bind(this._onNodeChange,this));}}},{NAME:"editorBR",NS:"editorBR",ATTRS:{host:{value:false}}});c.namespace("Plugin");c.Plugin.EditorBR=d;},"@VERSION@",{skinnable:false,requires:["editor-base"]});YUI.add("editor",function(a){},"@VERSION@",{skinnable:false,use:["frame","selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"]});
5,683.777778
6,100
0.70233
c1d0d0f87ff1add69cfa1d06e230e36c45e94a32
307
js
JavaScript
tests/app.js
Codenetz/codew
465fb49a82515deb1d50a0b8fc3ec63208705a34
[ "MIT" ]
4
2018-02-18T15:00:59.000Z
2022-02-22T12:45:46.000Z
tests/app.js
Codenetz/codew
465fb49a82515deb1d50a0b8fc3ec63208705a34
[ "MIT" ]
2
2019-04-08T20:31:17.000Z
2021-03-10T13:40:21.000Z
tests/app.js
Codenetz/codew
465fb49a82515deb1d50a0b8fc3ec63208705a34
[ "MIT" ]
1
2018-11-13T11:01:03.000Z
2018-11-13T11:01:03.000Z
let path = require('path'); require('dotenv').config({ path: path.resolve(process.cwd(), '.env.test') }); require('./lib/is'); require('./lib/controllerTest'); let app = require('./../boot/server').app; require('./modules/user/actions/authentication')(app); require('./modules/user/actions/signup')(app);
30.7
77
0.674267
c1d172c9f14be3a803d2796a72a8605cea5f5077
10,067
js
JavaScript
underscore-1.8.3.js/src/collections.js
endday/underscore-analysis
2b3a2aa4a86eca59bc87a2dbd0475387b1c92280
[ "MIT" ]
3,656
2016-05-17T00:43:53.000Z
2019-04-26T09:59:34.000Z
underscore-1.8.3.js/src/collections.js
endday/underscore-analysis
2b3a2aa4a86eca59bc87a2dbd0475387b1c92280
[ "MIT" ]
34
2016-05-16T14:57:03.000Z
2019-04-11T07:15:48.000Z
underscore-1.8.3.js/src/collections.js
endday/underscore-analysis
2b3a2aa4a86eca59bc87a2dbd0475387b1c92280
[ "MIT" ]
796
2016-05-17T16:37:33.000Z
2019-04-23T03:59:05.000Z
// Collection Functions // -------------------- // The cornerstone, an `each` implementation, aka `forEach`. // Handles raw objects in addition to array-likes. Treats all // sparse array-likes as if they were dense. _.each = _.forEach = function(obj, iteratee, context) { iteratee = optimizeCb(iteratee, context); var i, length; if (isArrayLike(obj)) { for (i = 0, length = obj.length; i < length; i++) { iteratee(obj[i], i, obj); } } else { var keys = _.keys(obj); for (i = 0, length = keys.length; i < length; i++) { iteratee(obj[keys[i]], keys[i], obj); } } return obj; }; // Return the results of applying the iteratee to each element. _.map = _.collect = function(obj, iteratee, context) { iteratee = cb(iteratee, context); var keys = !isArrayLike(obj) && _.keys(obj), length = (keys || obj).length, results = Array(length); for (var index = 0; index < length; index++) { var currentKey = keys ? keys[index] : index; results[index] = iteratee(obj[currentKey], currentKey, obj); } return results; }; // Create a reducing function iterating left or right. function createReduce(dir) { // Optimized iterator function as using arguments.length // in the main function will deoptimize the, see #1991. function iterator(obj, iteratee, memo, keys, index, length) { for (; index >= 0 && index < length; index += dir) { var currentKey = keys ? keys[index] : index; memo = iteratee(memo, obj[currentKey], currentKey, obj); } return memo; } return function(obj, iteratee, memo, context) { iteratee = optimizeCb(iteratee, context, 4); var keys = !isArrayLike(obj) && _.keys(obj), length = (keys || obj).length, index = dir > 0 ? 0 : length - 1; // Determine the initial value if none is provided. if (arguments.length < 3) { memo = obj[keys ? keys[index] : index]; index += dir; } return iterator(obj, iteratee, memo, keys, index, length); }; } // **Reduce** builds up a single result from a list of values, aka `inject`, // or `foldl`. _.reduce = _.foldl = _.inject = createReduce(1); // The right-associative version of reduce, also known as `foldr`. _.reduceRight = _.foldr = createReduce(-1); // Return the first value which passes a truth test. Aliased as `detect`. _.find = _.detect = function(obj, predicate, context) { var key; if (isArrayLike(obj)) { key = _.findIndex(obj, predicate, context); } else { key = _.findKey(obj, predicate, context); } if (key !== void 0 && key !== -1) return obj[key]; }; // Return all the elements that pass a truth test. // Aliased as `select`. _.filter = _.select = function(obj, predicate, context) { var results = []; predicate = cb(predicate, context); _.each(obj, function(value, index, list) { if (predicate(value, index, list)) results.push(value); }); return results; }; // Return all the elements for which a truth test fails. _.reject = function(obj, predicate, context) { return _.filter(obj, _.negate(cb(predicate)), context); }; // Determine whether all of the elements match a truth test. // Aliased as `all`. _.every = _.all = function(obj, predicate, context) { predicate = cb(predicate, context); var keys = !isArrayLike(obj) && _.keys(obj), length = (keys || obj).length; for (var index = 0; index < length; index++) { var currentKey = keys ? keys[index] : index; if (!predicate(obj[currentKey], currentKey, obj)) return false; } return true; }; // Determine if at least one element in the object matches a truth test. // Aliased as `any`. _.some = _.any = function(obj, predicate, context) { predicate = cb(predicate, context); var keys = !isArrayLike(obj) && _.keys(obj), length = (keys || obj).length; for (var index = 0; index < length; index++) { var currentKey = keys ? keys[index] : index; if (predicate(obj[currentKey], currentKey, obj)) return true; } return false; }; // Determine if the array or object contains a given item (using `===`). // Aliased as `includes` and `include`. _.contains = _.includes = _.include = function(obj, item, fromIndex, guard) { if (!isArrayLike(obj)) obj = _.values(obj); if (typeof fromIndex != 'number' || guard) fromIndex = 0; return _.indexOf(obj, item, fromIndex) >= 0; }; // Invoke a method (with arguments) on every item in a collection. _.invoke = function(obj, method) { var args = slice.call(arguments, 2); var isFunc = _.isFunction(method); return _.map(obj, function(value) { var func = isFunc ? method : value[method]; return func == null ? func : func.apply(value, args); }); }; // Convenience version of a common use case of `map`: fetching a property. _.pluck = function(obj, key) { return _.map(obj, _.property(key)); }; // Convenience version of a common use case of `filter`: selecting only objects // containing specific `key:value` pairs. _.where = function(obj, attrs) { return _.filter(obj, _.matcher(attrs)); }; // Convenience version of a common use case of `find`: getting the first object // containing specific `key:value` pairs. _.findWhere = function(obj, attrs) { return _.find(obj, _.matcher(attrs)); }; // Return the maximum element (or element-based computation). _.max = function(obj, iteratee, context) { var result = -Infinity, lastComputed = -Infinity, value, computed; if (iteratee == null && obj != null) { obj = isArrayLike(obj) ? obj : _.values(obj); for (var i = 0, length = obj.length; i < length; i++) { value = obj[i]; if (value > result) { result = value; } } } else { iteratee = cb(iteratee, context); _.each(obj, function(value, index, list) { computed = iteratee(value, index, list); if (computed > lastComputed || computed === -Infinity && result === -Infinity) { result = value; lastComputed = computed; } }); } return result; }; // Return the minimum element (or element-based computation). _.min = function(obj, iteratee, context) { var result = Infinity, lastComputed = Infinity, value, computed; if (iteratee == null && obj != null) { obj = isArrayLike(obj) ? obj : _.values(obj); for (var i = 0, length = obj.length; i < length; i++) { value = obj[i]; if (value < result) { result = value; } } } else { iteratee = cb(iteratee, context); _.each(obj, function(value, index, list) { computed = iteratee(value, index, list); if (computed < lastComputed || computed === Infinity && result === Infinity) { result = value; lastComputed = computed; } }); } return result; }; // Shuffle a collection, using the modern version of the // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle). _.shuffle = function(obj) { var set = isArrayLike(obj) ? obj : _.values(obj); var length = set.length; var shuffled = Array(length); for (var index = 0, rand; index < length; index++) { rand = _.random(0, index); if (rand !== index) shuffled[index] = shuffled[rand]; shuffled[rand] = set[index]; } return shuffled; }; // Sample **n** random values from a collection. // If **n** is not specified, returns a single random element. // The internal `guard` argument allows it to work with `map`. _.sample = function(obj, n, guard) { if (n == null || guard) { if (!isArrayLike(obj)) obj = _.values(obj); return obj[_.random(obj.length - 1)]; } return _.shuffle(obj).slice(0, Math.max(0, n)); }; // Sort the object's values by a criterion produced by an iteratee. _.sortBy = function(obj, iteratee, context) { iteratee = cb(iteratee, context); return _.pluck(_.map(obj, function(value, index, list) { return { value: value, index: index, criteria: iteratee(value, index, list) }; }).sort(function(left, right) { var a = left.criteria; var b = right.criteria; if (a !== b) { if (a > b || a === void 0) return 1; if (a < b || b === void 0) return -1; } return left.index - right.index; }), 'value'); }; // An internal function used for aggregate "group by" operations. var group = function(behavior) { return function(obj, iteratee, context) { var result = {}; iteratee = cb(iteratee, context); _.each(obj, function(value, index) { var key = iteratee(value, index, obj); behavior(result, value, key); }); return result; }; }; // Groups the object's values by a criterion. Pass either a string attribute // to group by, or a function that returns the criterion. _.groupBy = group(function(result, value, key) { if (_.has(result, key)) result[key].push(value); else result[key] = [value]; }); // Indexes the object's values by a criterion, similar to `groupBy`, but for // when you know that your index values will be unique. _.indexBy = group(function(result, value, key) { result[key] = value; }); // Counts instances of an object that group by a certain criterion. Pass // either a string attribute to count by, or a function that returns the // criterion. _.countBy = group(function(result, value, key) { if (_.has(result, key)) result[key]++; else result[key] = 1; }); // Safely create a real, live array from anything iterable. _.toArray = function(obj) { if (!obj) return []; if (_.isArray(obj)) return slice.call(obj); if (isArrayLike(obj)) return _.map(obj, _.identity); return _.values(obj); }; // Return the number of elements in an object. _.size = function(obj) { if (obj == null) return 0; return isArrayLike(obj) ? obj.length : _.keys(obj).length; }; // Split a collection into two arrays: one whose elements all satisfy the given // predicate, and one whose elements all do not satisfy the predicate. _.partition = function(obj, predicate, context) { predicate = cb(predicate, context); var pass = [], fail = []; _.each(obj, function(value, key, obj) { (predicate(value, key, obj) ? pass : fail).push(value); }); return [pass, fail]; };
32.791531
86
0.638423
c1d248276fb2c91280497d026c2f5d72621bac9c
49
js
JavaScript
packages/q3-ui-rte/src/components/ToolbarMobileDrawer/index.js
3merge/q
2f02fa7114c90d460318c4eb190c8e962effd570
[ "MIT" ]
1
2020-10-15T18:32:52.000Z
2020-10-15T18:32:52.000Z
packages/q3-ui-rte/src/components/ToolbarMobileDrawer/index.js
3merge/q
2f02fa7114c90d460318c4eb190c8e962effd570
[ "MIT" ]
106
2019-12-05T20:43:27.000Z
2022-03-18T14:29:33.000Z
packages/q3-ui-rte/src/components/ToolbarMobileDrawer/index.js
3merge/q
2f02fa7114c90d460318c4eb190c8e962effd570
[ "MIT" ]
null
null
null
export { default } from './ToolbarMobileDrawer';
24.5
48
0.734694
c1d28bd8b69dddebbef5704947c705f6905e5e78
665
js
JavaScript
html5/svg.js
mihaiv95/mihaiv95.github.io
1a4737d96a7fb7465963531f89d7d4ee3d3e82b8
[ "MIT" ]
null
null
null
html5/svg.js
mihaiv95/mihaiv95.github.io
1a4737d96a7fb7465963531f89d7d4ee3d3e82b8
[ "MIT" ]
null
null
null
html5/svg.js
mihaiv95/mihaiv95.github.io
1a4737d96a7fb7465963531f89d7d4ee3d3e82b8
[ "MIT" ]
null
null
null
window.addEventListener("deviceorientation", on_device_orientation); document.getElementById("id_bussiness_version").innerHTML = "Bussiness version: 2018.12.3.7"; // window.addEventListener("devicemotion", on_device_motion); var R = 10; function on_device_orientation(e){ var svg = document.getElementById("id_svg"); var circle = document.getElementById("id_circle"); var R = 20; var svg_width = svg.getAttribute("width"); var svg_height = svg.getAttribute("height"); circle.setAttribute("cx", svg_width/2 + e.gamma / 90 * (svg_width/2 - R) + "px"); circle.setAttribute("cy", svg_height/2 + e.beta / 90 * (svg_height/2 - R) + "px"); }
41.5625
93
0.706767
c1d34d1298c93c7c13517393e5f1e496e7ecd986
376
js
JavaScript
eahub/base/static/scripts/cookieconsent/init.js
taymonbeal/eahub.org
311be65b927b7c7b02f16fba97d74903cf13cf59
[ "MIT" ]
36
2019-02-22T23:07:14.000Z
2022-02-10T13:24:27.000Z
eahub/base/static/scripts/cookieconsent/init.js
taymonbeal/eahub.org
311be65b927b7c7b02f16fba97d74903cf13cf59
[ "MIT" ]
717
2019-02-21T22:07:55.000Z
2022-02-26T15:17:49.000Z
eahub/base/static/scripts/cookieconsent/init.js
taymonbeal/eahub.org
311be65b927b7c7b02f16fba97d74903cf13cf59
[ "MIT" ]
19
2019-04-14T14:37:56.000Z
2022-02-14T22:05:16.000Z
import { CookieConsent } from 'cookieconsent'; document.addEventListener('DOMContentLoaded', () => { cookieconsent.initialise({ "palette": { "popup": { "background": "#635274" }, "button": { "background": "#A7DBAB", "text": "white" } }, "content": { "href": "https://eahub.org/privacy-policy" } }) });
20.888889
53
0.518617
c1d3635c27301722037d5363d3715aa4556deb05
672
js
JavaScript
src/icons/Navigation/map-empty.js
usamasulaiman/iconbowl
bbd7aaedd14c1632bc1889a4b1912ecad17bcbdf
[ "MIT" ]
null
null
null
src/icons/Navigation/map-empty.js
usamasulaiman/iconbowl
bbd7aaedd14c1632bc1889a4b1912ecad17bcbdf
[ "MIT" ]
12
2021-03-10T15:38:44.000Z
2022-01-16T14:07:17.000Z
src/icons/Navigation/map-empty.js
usamasulaiman/iconbowl
bbd7aaedd14c1632bc1889a4b1912ecad17bcbdf
[ "MIT" ]
null
null
null
import React from 'react'; export default function MapEmpty(prop) { const { color= 'currentColor', size= 100, ...otherProps } = prop; return ( <svg xmlns="http://www.w3.org/2000/svg" width={size} height={size} viewBox="0 0 32 32" fill="none" stroke={color} strokeWidth="1.75" strokeLinecap="round" strokeLinejoin="round" fill-rule="evenodd" clip-rule="evenodd" {...otherProps} > <path d="M12.6667 8.66667L6 6V23.3333L12.6667 26M12.6667 8.66667L19.3333 6M12.6667 8.66667V26M19.3333 6L26 8.66667V26L19.3333 23.3333M19.3333 6V23.3333M19.3333 23.3333L12.6667 26" /> </svg> ); };
28
188
0.622024
c1d393d28852332d2c134460508416856d17f544
1,042
js
JavaScript
kmall-web/views/coupons/coupons.js
princewck/princewck.github.io
f9041b51eb3a35dc0cd8e658fd57e9a65d026c89
[ "MIT" ]
null
null
null
kmall-web/views/coupons/coupons.js
princewck/princewck.github.io
f9041b51eb3a35dc0cd8e658fd57e9a65d026c89
[ "MIT" ]
null
null
null
kmall-web/views/coupons/coupons.js
princewck/princewck.github.io
f9041b51eb3a35dc0cd8e658fd57e9a65d026c89
[ "MIT" ]
null
null
null
define(['app'], function(app) { app.controller('couponController', ['$scope', function($scope) { $scope.navBarList = [ {title: '天猫超市', url: '#/'}, {title: '天猫国际', url: '#/'}, {title: '天猫会员', url: '#/'}, {title: '品牌节', url: '#/'}, {title: '电器城', url: '#/'}, {title: '喵先生', url: '#/'}, {title: '医药馆', url: '#/'}, {title: '营业厅', url: '#/'}, {title: '天天9块9', url: '#/'}, ]; /* `you may like` block test data */ var items = []; for(var i=20;i;i--) { items.push({title: 'Zbird/钻石小鸟18K金钻石戒指婚戒订婚结婚求婚钻戒女款正品-丝缠', price: 999, image:'images/product_demo.jpg', link:'https://detail.tmall.com/item.htm?spm=875.7931836/A.20161011.16.VuHLsM&abtest=_AB-LR845-PR845&pvid=c1e5c033-8405-4244-8a1b-f8b9e890af7e&pos=16&abbucket=_AB-M845_B2&acm=201509290.1003.1.1286473&id=19133990782&scm=1007.12710.67270.100200300000000'}); } $scope.guessItems = items; }]); });
45.304348
369
0.514395
c1d4052743feff2e8aeaf4d16e8f11929f3a5669
895
js
JavaScript
apps/nerves_hub_www/assets/js/app.js
tonnenpinguin/nerves_hub_web
9d36921eb7e20d20a3e3bd308cc98ad7b60cfa72
[ "Apache-2.0" ]
111
2018-07-25T01:07:51.000Z
2022-01-25T17:03:01.000Z
apps/nerves_hub_www/assets/js/app.js
tonnenpinguin/nerves_hub_web
9d36921eb7e20d20a3e3bd308cc98ad7b60cfa72
[ "Apache-2.0" ]
361
2018-07-22T12:53:00.000Z
2022-03-31T18:50:34.000Z
apps/nerves_hub_www/assets/js/app.js
tonnenpinguin/nerves_hub_web
9d36921eb7e20d20a3e3bd308cc98ad7b60cfa72
[ "Apache-2.0" ]
54
2018-08-26T02:58:04.000Z
2022-03-09T10:12:19.000Z
import '../css/app.scss' import 'phoenix_html' import 'bootstrap' import $ from 'jquery' import { Socket } from 'phoenix' import LiveSocket from 'phoenix_live_view' import Josh from 'joshjs' let dates = require('./dates') let csrfToken = document .querySelector("meta[name='csrf-token']") .getAttribute('content') let liveSocket = new LiveSocket('/live', Socket, { params: { _csrf_token: csrfToken } }) liveSocket.connect() new Josh() $(function() { $('.custom-upload-input').on('change', function() { let fileName = $(this) .val() .split('\\') .pop() $(this) .siblings('.custom-upload-label') .removeClass('not-selected') .addClass('selected') .html("Selected File: <div class='file-name'>" + fileName + '</div>') }) }) document.querySelectorAll('.date-time').forEach(d => { d.innerHTML = dates.formatDateTime(d.innerHTML) })
22.948718
75
0.643575
c1d40dd417776dccb8b9cddfda4d9b609167d742
323
js
JavaScript
vendor/oodle/krumo/js/krumo.js
edeermc/Framework
697449f9454bfc28f5dd80705224fafc9c1cb9ab
[ "MIT" ]
null
null
null
vendor/oodle/krumo/js/krumo.js
edeermc/Framework
697449f9454bfc28f5dd80705224fafc9c1cb9ab
[ "MIT" ]
null
null
null
vendor/oodle/krumo/js/krumo.js
edeermc/Framework
697449f9454bfc28f5dd80705224fafc9c1cb9ab
[ "MIT" ]
null
null
null
{% extends "layouts/main.twig" %} {% block content %} <div class="jumbotron"> <div class="container text-center"> <h1>Error 404</h1> <img src="{{ resource('img/404.png') }}" alt=""> <p>Ruta no encontrado en el dominio {{ route }}</p> </div> </div> {% endblock %}
29.363636
63
0.50774
c1d45d76a9da596c9b927f6aec891540a830f31d
111
js
JavaScript
tests/schema/core/option/failOnInvalidType.js
markfarl/json-schema-faker
3b651f6817e087aebcf628229865cd4bcae525a1
[ "MIT" ]
null
null
null
tests/schema/core/option/failOnInvalidType.js
markfarl/json-schema-faker
3b651f6817e087aebcf628229865cd4bcae525a1
[ "MIT" ]
null
null
null
tests/schema/core/option/failOnInvalidType.js
markfarl/json-schema-faker
3b651f6817e087aebcf628229865cd4bcae525a1
[ "MIT" ]
null
null
null
module.exports = { register(jsf) { return jsf.option({ failOnInvalidTypes: false, }); }, };
12.333333
32
0.558559
c1d4a2f21bb3377a54c2e7e6c606e4b755d9bb48
7,904
js
JavaScript
tests/jerry/regression-test-issue-3114.js
rerobika/jerryscript
bc091e174206b26e3ff71a9833e37527579b035f
[ "Apache-2.0" ]
4,324
2016-11-25T11:25:27.000Z
2022-03-31T03:24:49.000Z
tests/jerry/regression-test-issue-3114.js
rerobika/jerryscript
bc091e174206b26e3ff71a9833e37527579b035f
[ "Apache-2.0" ]
2,099
2016-11-25T08:08:59.000Z
2022-03-12T07:41:20.000Z
tests/jerry/regression-test-issue-3114.js
rerobika/jerryscript
bc091e174206b26e3ff71a9833e37527579b035f
[ "Apache-2.0" ]
460
2016-11-25T07:16:10.000Z
2022-03-24T14:05:29.000Z
// Copyright JS Foundation and other contributors, http://js.foundation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. function $() { var id_0 = $.SIMD.id_1; var id_1 = id_2.check; var id_3 = id_4; var id_5 = id_6.id_7; var id_7 = id_8.id_9; var id_9 = id_10; var id_11 = id_12; var id_13 = id_14; var id_15 = id_16; var id_17 = id_18; var id_19 = id_20; var id_21 = id_22; var id_23 = id_24; var id_25 = id_26; var id_27 = id_28; var id_29 = id_30.and; var id_31 = id_32.or; var id_33 = id_34.xor; var id_35 = id_36.not; var id_37 = id_38; var id_39 = id_40; var id_41 = id_42.id_43; var id_43 = id_44.id_45; var id_45 = id_46.store var id_47 = id_48.id_49; var id_49 = id_50.id_51; var id_56 = id_57.splat; var id_58 = id_59; var id_60 = id_61.id_62; var id_62 = id_63.abs; var id_64 = id_65.neg; var id_66 = id_67.add; var id_68 = id_69.sub; var id_70 = id_71.mul; var id_72 = id_73.div; var id_74 = id_75.min; var id_76 = id_77.max; var id_78 = id_79.sqrt; var id_80 = id_81.id_82; var id_82 = id_83.shuffle; var id_84 = id_85.lessThan; var id_86 = id_87.lessThanOrEqual; var id_88 = id_89.equal; var id_90 = id_91.notEqual; var id_92 = id_93.greaterThan; var id_94 = id_95.greaterThanOrEqual; var id_96 = id_97.select; var id_98 = id_99.load; var id_100 = id_101.id_102; var id_102 = id_103.id_104; var $ = id_105.id_106; var id_106 = id_107; var id_108 = id_109.id_110; var id_110 = id_111; var id_112 = id_113; var fround = stdlib.Math.fround; var id_114 = id_115(imports.asmModule); var id_116 = id_117; var id_118 = id_119(5033.2, 3401.0, 665.34, 32234.1); var id_120 = id_121(1065353216, 1073741824, 1077936128, 1082130432); var gval = 1234; var id_126 = $.id_127; var id_127 = $.$; function id_165() { value = id_166; id_167(id_168) } function id_169() { return id_170(id_171) } function id_172() { $ = id_173; id_174(id_175) } function id_176() { return id_177(id_178) } function id_179() { $ = id_180; id_181(id_182) } function id_183() { return id_184(id_185) } function id_186() { $ = id_187; id_188(id_189) } function id_190() {} function id_193() { $ = id_194; id_195(id_196) } function $() {} function id_200() { id_201(id_202, id_203); return id_204(id_205) } function id_206() { var $ = id_208; while ($) { id_209 = id_210; for (;;) { switch ($) { case $: id_211(id_212, id_213); case $: id_214(id_215, id_216); case $: id_217(id_218, id_219); case $: id_220(id_221, id_222) } id_223 = id_224(id_225, id_226) } } return id_227(id_228) } function id_229() { var $ = id_231; for (;;) { id_232 = id_233; for (;;) { switch ($) { case $: id_234(id_235, id_236); case $: id_237(id_238, id_239); case $: id_240(id_241, id_242); case $: id_243(id_244, id_245) } id_246 = id_247(id_248, id_249) } } return id_250(id_251) } function id_252() { var $ = id_254; do { id_255 = id_256; for (;;) { switch ($) { case $: id_257(id_258, id_259); case $: id_260(id_261, id_262); case $: id_263(id_264, id_265); case $: id_266(id_267, id_268) } id_269 = id_270(id_271, id_272) } } while ($) return id_273(id_274) } function id_275() { var $ = id_277; while ($) { id_278 = id_279; for (;;) { id_280(id_281, id_282); id_283 = id_284(id_285, id_286) } } return id_287(id_288) } function id_289() { var $ = id_291; while ($) { id_292 = id_293; for (;;) { id_294(id_295, id_296); id_297 = id_298(id_299, id_300) } } return id_301(id_302) } function id_303() { var $ = id_305; while ((loopIndex) < (loopCOUNT)) { id_306 = id_307; for (;;) { id_308(id_309, id_310); id_311 = id_312(id_313, id_314) } } return id_315(id_316) } function id_317() { var $ = id_319; while ($) { id_320 = id_321; for (;;) { id_322(id_323, id_324); id_325 = id_326(id_327, id_328) } } return id_329(id_330) } function id_331() { var $ = id_333; while ($) { id_334 = id_335; for (;;) { id_336(id_337, id_338); id_339 = id_340(id_341, id_342) } } return id_343(id_344) } function id_345() { var $ = id_347; while ($) { id_348 = id_349; for (;;) { id_350(id_351, id_352); id_353 = id_354(id_355, id_356) } } return id_357(id_358) } function id_359() { var $ = id_360; while ($) { for (;;) { switch (functionPicker) { case $: v = id_361(id_362); case $: $ = id_363(id_364); case $: $ = id_365(id_366); case $: $ = id_367(id_368, idx) } } } } function id_369() { var $ = id_370; for (;;) { for (;;) { switch ($) { case $: $ = id_371(id_372); case $: $ = id_373(id_374); case $: $ = id_375(id_376); case $: $ = id_377(id_378) } } } } function id_379() { var $ = id_380; do { for (;;) { switch ($) { case $: $ = id_381(id_382); case $: $ = id_383(id_384); case $: $ = id_385(id_386); case $: $ = id_387(id_388) } } } while ($) } function id_389() { var $ = id_390; while ($) { for (;;) { $ = id_391(id_392) } } } function id_393() { var $ = id_394; end = (((length))) } function id_397() { var $ = id_398; while ($) { for (;;) { $ = id_399(id_400) } } } function id_401() { var $ = id_402; while ($) { for (;;) { $ = id_403(id_404) } } } function id_405() { while ($) { for (;;) { $ = id_407(id_408) } } } function id_409() { var $ = id_410; while ($) { for (;;) { $ = id_411(id_412) } } } return { changeHeap: ch, id_413: id_414, id_415: id_416, id_417: id_418, id_419: id_420, id_421: id_422, id_423: id_424, id_425: id_426, id_427: id_428, id_429: id_430, id_431: id_432, id_433: id_434, id_435: id_436, id_437: id_438, id_439: id_440, id_441: id_442, id_443: id_444, id_445: id_446, id_447: id_448, id_449: id_450, id_451: id_452, id_453: id_454, id_455: id_456, id_457: id_458, id_459: id_460, id_461: id_462, id_463: id_464, id_465: id_466, id_467: id_468, id_469: id_470, id_471: id_472, id_473: id_474, id_475: id_476, id_477: $ } }
18.254042
75
0.514297
c1d4d63aa3d9aafabd773882181c030e94b2b2cb
4,526
js
JavaScript
src/lib/options-app-lib/get-random-name-maker.js
alexterliuk/data-gen
79892e30a33e134d3dd821670d65087157dab5d3
[ "MIT" ]
null
null
null
src/lib/options-app-lib/get-random-name-maker.js
alexterliuk/data-gen
79892e30a33e134d3dd821670d65087157dab5d3
[ "MIT" ]
null
null
null
src/lib/options-app-lib/get-random-name-maker.js
alexterliuk/data-gen
79892e30a33e134d3dd821670d65087157dab5d3
[ "MIT" ]
null
null
null
/** * Provider of makeRandomName with bound context. * @param {object} valueChecker * @param {object} helper * @param {object} optionsApp - options defined in app */ function getRandomNameMaker(valueChecker, helper, optionsApp) { const _v = valueChecker; const _h = helper; const _o = optionsApp; return makeRandomName; /** * option.data: * alphabet - {string} from which to slice characters randomly * allNames - {strings} minLength, maxLength, namesInCompoundName * - {booleans} capitalizeFirstLetter, capitalizeAllLetters * - {array of strings} collection * name1, name2 etc. - have the same params as in allNames, except namesInCompoundName which is absent. * If option.data.allNames, function works only with allNames contents - name1, name2 etc. are not checked. * If no allNames, function looks for name1, name2 etc. properties and works with them. * Steps inside allNames || name1 etc.: * - if collection - make compoundName from names inside collection * - use alphabet specified for allNames || name1 etc., or from option.data, or optionsApp's alphabet * - if minLength || maxLength - make names of random length within min-max range, make compoundName from names * (qty of names inside compoundName is defined by namesInCompoundName (if allNames), * or by counting name1, name2 etc. properties inside option.data) * - apply capitalizing options if specified */ function makeRandomName(option) { const alphabet = (_v.isString(option.data.alphabet) && option.data.alphabet) || _o.alphabet; const allNames = _v.isObject(option.data.allNames) && option.data.allNames; let compoundName = ''; if (allNames) { const namesInCompoundName = _v.getPositiveIntegerOrZero(allNames.namesInCompoundName); const _alphabet = option.data.allNames.alphabet || alphabet; for (let i = 1; i <= namesInCompoundName; i++) { compoundName += makeName(allNames, 'allNames', _alphabet, option); } } if (!allNames) { Object.keys(option.data).forEach(key => { if (key.slice(0, 4) === 'name' && !_v.isNaN(Number(key.slice(4)))) { const _alphabet = option.data[key].alphabet || alphabet; compoundName += makeName(option.data[key], key, _alphabet, option); } }); } //let cName = compoundName.split(' '); //console.log('10-14:', [cName[0].length, cName[0]], '7-13', [cName[1].length, cName[1]], 'max30', [cName[2].length, cName[2]]); return compoundName.trim(); /** * */ function makeName(data, key, alph, option) { // if collection, take random name from it const elementFromCollection = _h.getRandomElementFromArray(data, 'collection'); if (elementFromCollection) return elementFromCollection + ' '; if (data.minLength || data.maxLength) { let oneName = '', minLength, maxLength; if (data.minLength > data.maxLength) { _o.notifyOn.randomName_minBiggerThanMax(option, key); return ''; } else { // if one of lengths is not defined, make it +/- 15 chars compared to defined one if (typeof data.minLength === 'undefined') { maxLength = _v.getPositiveIntegerOrZero(data.maxLength); minLength = maxLength - 15 > 0 ? maxLength - 15 : 0; } if (typeof data.maxLength === 'undefined') { minLength = _v.getPositiveIntegerOrZero(data.minLength); maxLength = minLength + 15; } minLength = _v.isInfinity(minLength) ? 0 : (+minLength || _v.getPositiveIntegerOrZero(data.minLength)); maxLength = _v.isInfinity(minLength) ? 0 : (+maxLength || _v.getPositiveIntegerOrZero(data.maxLength)); // make lengths not exceed 100 maxLength = maxLength > 100 ? 100 : maxLength; minLength = maxLength === 100 ? maxLength - 15 : minLength; let nameLength = _o.getRandomNumber(minLength, maxLength); nameLength = Math.floor(Math.random() * 100) % 2 ? Math.ceil(nameLength) : Math.floor(nameLength); for (let y = 0; y < nameLength; y++) { let start = _h.getRandomFloor(0, alph.length); let end = start + 1; oneName += alph.slice(start, end); } return _h.optionallyCapitalize(oneName, data) + ' '; } } return ''; } } } module.exports = getRandomNameMaker;
40.053097
132
0.632346
c1d56e1ea54768709a8b0b5c3e8046f86faeb649
15,597
js
JavaScript
assets/js/custom.js
JigneshMistry/hnetwork
4f7ae006af053f40fd17d049595275ba47dcd06d
[ "MIT" ]
1
2016-12-08T14:05:47.000Z
2016-12-08T14:05:47.000Z
assets/js/custom.js
JigneshMistry/hnetwork
4f7ae006af053f40fd17d049595275ba47dcd06d
[ "MIT" ]
null
null
null
assets/js/custom.js
JigneshMistry/hnetwork
4f7ae006af053f40fd17d049595275ba47dcd06d
[ "MIT" ]
null
null
null
/* Name : Custom.Js * Description : Site Custom Function js file * Developer : JM * Verion : 01 */ var siteurl = 'http://localhost/hnetwork/'; var posturl = siteurl+'dashboard/getpost'; var subposturl = siteurl+'dashboard/ajaxpost'; jQuery( document ).ready(function() { /* image upload */ /*jQuery('#upload').click(function(){ //console.log("ok"); $.ajax({ url: "profile/do_upload", // Url to which the request is send type: "POST", // Type of request to be send, called as method data: new FormData(this), // Data sent to server, a set of key/value pairs (i.e. form fields and values) contentType: false, // The content type used when sending data to the server. cache: false, // To unable request pages to be cached processData:false, // To send DOMDocument or non processed data file it is set to false success: function(data) // A function to be called if request succeeds { console.log(data); $('#loading').hide(); $("#message").html(data); } }); });*/ /* update account */ jQuery("#account-update").click(function(){ var first_name=jQuery('#first_name').val(); var last_name=jQuery('#last_name').val(); var phone=jQuery('#phone').val(); var address=jQuery('#address').val(); var state=jQuery('#state').val(); var country=jQuery('#country').val(); var pincode=jQuery('#pincode').val(); var dob=jQuery('#dob').val(); //console.log("hello"); if(first_name == "" || last_name == "" || phone == "" || address == "" || state == "" || country == "" || pincode == "" || dob == "") { jQuery("#ack").html("<p style='color:red;'>All Fields are mandatory</p>"); } else { jQuery.ajax({ type: "POST", url: siteurl+'settings/editaccountdata', data:{ 'first_name':first_name, 'last_name':last_name, 'phone':phone, 'address':address, 'state':state, 'country':country, 'pincode':pincode, 'dob':dob }, dataType:"json", success:function(ack){ if(ack == 1) { jQuery("#ack").html("<p style='color:blue;'>Account Updated Successfully</p>"); } else { jQuery("#ack").html("<p style='color:red;'>Account Not Updated.</p>"); } console.log(ack); } }); } //console.log(first_name+"||"+last_name+"||"+phone+"||"+state+"||"+country+"||"+pincode+"||"+dob); }); /* update account */ $("#uploadimage").on('submit',(function(e) { e.preventDefault(); $("#message").empty(); $('#loading').show(); $.ajax({ url: "profile/do_upload", // Url to which the request is send type: "POST", // Type of request to be send, called as method data: new FormData(this), // Data sent to server, a set of key/value pairs (i.e. form fields and values) contentType: false, // The content type used when sending data to the server. cache: false, // To unable request pages to be cached processData:false, // To send DOMDocument or non processed data file it is set to false success: function(data) // A function to be called if request succeeds { $('#loading').hide(); $("#message").html(data); } }); })); $('input[type=file]').change(function(){ $(this).simpleUpload("/ajax/upload.php", { start: function(file){ //upload started $('#filename').html(file.name); $('#progress').html(""); $('#progressBar').width(0); }, progress: function(progress){ //received progress $('#progress').html("Progress: " + Math.round(progress) + "%"); $('#progressBar').width(progress + "%"); }, success: function(data){ //upload successful $('#progress').html("Success!<br>Data: " + JSON.stringify(data)); }, error: function(error){ //upload failed $('#progress').html("Failure!<br>" + error.name + ": " + error.message); } }); }); /* //image upload */ // Loading dashboard post jQuery('.loader').show(); setTimeout(function () { $.ajax({ url: posturl, type: "get", success: function (response) { //jQuery('.loader').hide(); jQuery(".se-pre-con").fadeOut("slow"); jQuery('.blogposts').append(response); }, error: function(jqXHR, textStatus, errorThrown) { console.log(textStatus, errorThrown); } }); }, 3000); jQuery('.nav li 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'); }); jQuery('.newpost a').click(function(){ jQuery('.text_post').hide(); jQuery('.quote_post').hide(); jQuery('.photo_post').hide(); jQuery('.video_post').hide(); jQuery('.audio_post').hide(); var clickid = jQuery(this).attr('id'); jQuery('.postarea').find('.'+clickid).toggle(); }); //Close Event For Post Write Box jQuery('.closebtn').click(function(){ jQuery('.text_post').hide(); jQuery('.quote_post').hide(); jQuery('.photo_post').hide(); jQuery('.video_post').hide(); jQuery('.audio_post').hide(); clearall(); }); //Upload Photo Click jQuery('.photo_upload').click(function(){ //jQuery('#photo_upload input').open(); jQuery('#photo_up').trigger('click'); jQuery('#photo_upload').show(); jQuery("#first_up").hide(); jQuery("input[type=file]").on("change", function() { // $("[for=file]").html(this.files[0].name); jQuery("#preview").attr("src", URL.createObjectURL(this.files[0])); }); }); //From Web Photo, Video, Audio jQuery('.fromweb').click(function(){ jQuery('#photo_upload').show(); jQuery("#first_up").hide(); jQuery('.enter_url').show(); }); //Remove Picture Click Event jQuery('.del').click(function(){ jQuery("#preview").attr("src",''); jQuery("input[type=file]").val(''); jQuery('#photo_upload').hide(); jQuery("#first_up").show(); }); // Post the ajax with all post data jQuery('#post_text').click(function(){ var posttitle = jQuery("#newstatustitle").val(); var postdesc = jQuery("#newdesc").val(); var posttype = jQuery("#post_type").val(); if(posttitle!='') { // Value found in text box Ajax begin $.ajax({ url: subposturl, type: "post", data: {posttitle:posttitle,postdesc:postdesc,posttype:posttype} , success: function (response) { jQuery('.postarea .text_post').hide(); jQuery('.postarea .quote_post').hide(); jQuery('.postarea .photo_post').hide(); jQuery('.postarea .video_post').hide(); jQuery('.postarea .audio_post').hide(); jQuery('.post-forms-glass').hide(); jQuery('.post-forms-glass').removeClass('active'); jQuery('.post-forms-glass').css({'opacity':'0','display':'none'}); jQuery('.blogposts').prepend(response).show('slow'); jQuery("#newstatustitle").val(''); }, error: function(jqXHR, textStatus, errorThrown) { console.log(textStatus, errorThrown); } }); } }); //Quote post Ajax jQuery('#post_quote').click(function(){ var postdesc = jQuery("#newdesc").val(); var posttype = 2; var postquote = jQuery("#quote").val(); if(postquote!='') { // Value found in text box Ajax begin $.ajax({ url: subposturl, type: "post", data: {posttitle:postquote,postdesc:postdesc,posttype:posttype} , success: function (response) { jQuery('.postarea .text_post').hide(); jQuery('.postarea .quote_post').hide(); jQuery('.postarea .photo_post').hide(); jQuery('.postarea .video_post').hide(); jQuery('.postarea .audio_post').hide(); jQuery('.post-forms-glass').hide(); jQuery('.post-forms-glass').removeClass('active'); jQuery('.post-forms-glass').css({'opacity':'0','display':'none'}); jQuery('.blogposts').prepend(response).show('slow'); jQuery("#quote").val(''); }, error: function(jqXHR, textStatus, errorThrown) { console.log(textStatus, errorThrown); } }); } }); //Photo jQuery('#post_photo').click(function(){ var selectedphoto = jQuery("#photo_up").val(); //alert("testing"+selectedphoto) var postdesc = ""; var posttype = 3; var posttitle = ""; if(selectedphoto!='') { $('#photo_up').simpleUpload({ url: subposturl, trigger: '#post_photo', fields: { posttitle:posttitle,postdesc:postdesc,posttype:posttype }, success: function(data){ jQuery('.postarea .text_post').hide(); jQuery('.postarea .quote_post').hide(); jQuery('.postarea .photo_post').hide(); jQuery('.postarea .video_post').hide(); jQuery('.postarea .audio_post').hide(); jQuery('.post-forms-glass').hide(); jQuery('.post-forms-glass').removeClass('active'); jQuery('.post-forms-glass').css({'opacity':'0','display':'none'}); jQuery('#blog-wall').prepend(data).show('slow'); jQuery("#quote").val(''); } }); } }); //Video Post jQuery('#post_v').click(function(){ var pin = jQuery("#pin").val(); var wseep = jQuery("#wseep").val(); var idw = jQuery("#idw").val(); var typeattach2 = 2; var combowsee = 0; var posttitle = ''; var videourl = jQuery("#atach-value").val(); var videotitle = jQuery("#videotitle").val(); if(videourl!='') { // Value found in text box Ajax begin $.ajax({ url: subposturl, type: "post", data: {txttitle:videotitle,pin:pin,wseep:wseep,idw:idw,typeattach2:typeattach2,combowsee:combowsee,videourl:videourl} , success: function (response) { jQuery('.postarea .text_post').hide(); jQuery('.postarea .quote_post').hide(); jQuery('.postarea .photo_post').hide(); jQuery('.postarea .video_post').hide(); jQuery('.postarea .audio_post').hide(); jQuery('.post-forms-glass').hide(); jQuery('.post-forms-glass').removeClass('active'); jQuery('.post-forms-glass').css({'opacity':'0','display':'none'}); jQuery('#blog-wall').prepend(response).show('slow'); jQuery("#atach-value").val(''); jQuery("#videotitle").val(''); }, error: function(jqXHR, textStatus, errorThrown) { console.log(textStatus, errorThrown); } }); } }); //Audio Post jQuery('#post_audio').click(function(){ var pin = jQuery("#pin").val(); var wseep = jQuery("#wseep").val(); var idw = jQuery("#idw").val(); var typeattach3 = 3; var combowsee = 0; var posttitle = ''; var audiourl = jQuery("#audiourl").val(); var audiotitle = jQuery("#audiotitle").val(); if(audiourl!='') { // Value found in text box Ajax begin $.ajax({ url: subposturl, type: "post", data: {txttitle:audiotitle,pin:pin,wseep:wseep,idw:idw,typeattach3:typeattach3,combowsee:combowsee,videourl:audiourl} , success: function (response) { jQuery('.postarea .text_post').hide(); jQuery('.postarea .quote_post').hide(); jQuery('.postarea .photo_post').hide(); jQuery('.postarea .video_post').hide(); jQuery('.postarea .audio_post').hide(); jQuery('.post-forms-glass').hide(); jQuery('.post-forms-glass').removeClass('active'); jQuery('.post-forms-glass').css({'opacity':'0','display':'none'}); jQuery('#blog-wall').prepend(response).show('slow'); jQuery("#audiourl").val(''); jQuery("#audiotitle").val(''); }, error: function(jqXHR, textStatus, errorThrown) { console.log(textStatus, errorThrown); } }); } }); //Post Settings box $("#bsmenup_VmRcQkrhPKt").on("click",function(){ $('.submenuitem').hide(); positop = $("#bsmenup_VmRcQkrhPKt").position() $('#smnp_VmRcQkrhPKt').css('top',positop.top + 17); $('#smnp_VmRcQkrhPKt').show(); return false; }); }); //Delete function function postdelete(postid) { jQuery("#postdeletebox").modal('show'); jQuery("#yesdelete").click(function(){ jQuery.ajax({ url: siteurl+'dashboard/ajaxdelete', type: "post", data: {postid:postid} , success: function (response) { if(response == 1) { alert('Sorry due to some techinicle problem we can not delte this post'); }else { jQuery("#post_"+postid).slideUp(2000); jQuery("#postdeletebox").modal('hide'); } }, error: function(jqXHR, textStatus, errorThrown) { console.log(textStatus, errorThrown); } }); }); } //Edit function function postedit(postid) { jQuery("#posteditbox").modal('show'); } //Report function function postreport(postid) { jQuery.ajax({ url: siteurl+'dashboard/ajaxreport', type: "post", data: {postid:postid} , success: function (response) { jQuery("#post_"+postid).slideUp(2000); }, error: function(jqXHR, textStatus, errorThrown) { console.log(textStatus, errorThrown); } }); } //Frendsuggestion function userfollow(userid,leaderid,clickid) { /* Add */ jQuery.ajax({ type:"post", dataType:"json", url:siteurl+'dashboard/follower', data:{ 'userid':userid, 'leaderid':leaderid, 'clickid':clickid }, success:function(res){ console.log(res); //console.log(res.uid); /*if(res == true) { //window.location.href=siteurl; //alert("follows "+res.cid+""); } */ } }); /* //Add */ //console.log("Hello "+ userid); jQuery("#"+clickid).slideUp(1000); } //Show img function on function showimg() { setTimeout(function () { var imgurl = jQuery('#from_url').val(); if(imgurl != '') { jQuery('.enter_url').hide(); jQuery("#preview").attr("src",imgurl); jQuery('.del').show(); } }, 1000); } function clearall() { jQuery("#newstatustitle").val(''); jQuery("#newdesc").html(''); jQuery("#quote").html(''); jQuery("#photo_up").val(''); jQuery("#from_url").val(''); jQuery("#preview").val(''); }
28.883333
135
0.55017
c1d5746947d77828130362baa0a07794bb125607
4,574
js
JavaScript
src/components/filter/FilterSelect.js
dhis2/maps-app
3c1d09393aada129c73c96d228e0c92a51111337
[ "BSD-3-Clause" ]
12
2018-02-07T05:08:44.000Z
2021-06-16T05:06:21.000Z
src/components/filter/FilterSelect.js
dhis2/maps-app
3c1d09393aada129c73c96d228e0c92a51111337
[ "BSD-3-Clause" ]
1,217
2018-04-24T07:48:35.000Z
2022-03-25T07:08:52.000Z
src/components/filter/FilterSelect.js
dhis2/maps-app
3c1d09393aada129c73c96d228e0c92a51111337
[ "BSD-3-Clause" ]
7
2018-03-20T09:07:26.000Z
2021-02-24T16:55:28.000Z
import React, { Fragment, useEffect } from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import i18n from '@dhis2/d2-i18n'; import { SelectField, NumberField, TextField, Checkbox, DatePicker, } from '../core'; import OptionSetSelect from '../optionSet/OptionSetSelect'; import { loadOptionSet } from '../../actions/optionSets'; import { numberValueTypes, textValueTypes, booleanValueTypes, } from '../../constants/valueTypes'; import styles from './styles/FilterSelect.module.css'; const getOperators = (valueType, optionSet) => { let operators; if (['NUMBER', 'INTEGER', 'INTEGER_POSITIVE', 'DATE'].includes(valueType)) { operators = [ { id: 'EQ', name: '=' }, { id: 'GT', name: '>' }, { id: 'GE', name: '>=' }, { id: 'LT', name: '<' }, { id: 'LE', name: '<=' }, { id: 'NE', name: '!=' }, ]; } else if (optionSet) { operators = [{ id: 'IN', name: i18n.t('one of') }]; } else if (textValueTypes.includes(valueType)) { operators = [ { id: 'LIKE', name: i18n.t('contains') }, { id: 'EQ', name: i18n.t('is') }, { id: 'NE', name: i18n.t('is not') }, ]; } return operators; }; const FilterSelect = ({ valueType, filter, optionSet, optionSets, onChange, loadOptionSet, }) => { const operators = getOperators(valueType, optionSet); let operator; let value; if (filter) { const splitFilter = filter.split(':'); operator = splitFilter[0]; value = splitFilter[1]; } else if (operators) { operator = operators[0].id; } useEffect(() => { if (optionSet && !optionSets[optionSet.id]) { loadOptionSet(optionSet.id); } }, [optionSet, optionSets, loadOptionSet]); return ( <Fragment> {operators && ( <SelectField label={i18n.t('Operator')} items={operators} value={operator} onChange={newOperator => onChange(`${newOperator.id}:${value ? value : ''}`) } className={styles.operator} /> )} {optionSet && optionSets[optionSet.id] && ( <OptionSetSelect options={optionSets[optionSet.id].options} value={value ? value.split(';') : null} onChange={newValue => onChange(`${operator}:${newValue.join(';')}`) } className={styles.inputField} /> )} {numberValueTypes.includes(valueType) && ( <NumberField label={i18n.t('Value')} value={value !== undefined ? Number(value) : value} onChange={newValue => onChange(`${operator}:${newValue}`)} className={styles.inputField} /> )} {textValueTypes.includes(valueType) && !optionSet && ( <TextField label={i18n.t('Value')} value={value || ''} onChange={newValue => onChange(`${operator}:${newValue}`)} className={styles.inputField} /> )} {booleanValueTypes.includes(valueType) && ( <Checkbox label={i18n.t('Yes')} checked={value == 1 ? true : false} onChange={isChecked => onChange(isChecked ? 'IN:1' : 'IN:0') } className={styles.checkbox} /> )} {valueType === 'DATE' && ( <DatePicker label={i18n.t('Date')} value={value} onChange={date => onChange(`${operator}:${date}`)} className={styles.inputField} /> )} </Fragment> ); }; FilterSelect.propTypes = { valueType: PropTypes.string, filter: PropTypes.string, optionSet: PropTypes.object, optionSets: PropTypes.object, loadOptionSet: PropTypes.func.isRequired, onChange: PropTypes.func.isRequired, }; export default connect( state => ({ optionSets: state.optionSets, }), { loadOptionSet } )(FilterSelect);
30.905405
80
0.475295
c1d57b30e2c0eb9c5b93ac7fa995e9dce361d738
9,030
js
JavaScript
GDJS/Runtime/inputmanager.js
mohajain/GDevelop
8e8d96dd3a5957221fb3d0ec28a694620149d835
[ "MIT" ]
1
2019-08-27T21:49:05.000Z
2019-08-27T21:49:05.000Z
GDJS/Runtime/inputmanager.js
mohajain/GDevelop
8e8d96dd3a5957221fb3d0ec28a694620149d835
[ "MIT" ]
9
2020-04-04T19:26:47.000Z
2022-03-25T18:41:20.000Z
GDJS/Runtime/inputmanager.js
mohajain/GDevelop
8e8d96dd3a5957221fb3d0ec28a694620149d835
[ "MIT" ]
2
2020-03-02T05:20:41.000Z
2021-05-10T03:59:05.000Z
/* * GDevelop JS Platform * Copyright 2013-2016 Florian Rival (Florian.Rival@gmail.com). All rights reserved. * This project is released under the MIT License. */ /** * Store input made on a canvas: mouse position, key pressed * and touches states. * * See **bindStandardEvents** method for connecting the input * manager to a canvas and **onFrameEnded** for signaling the * end of a frame (necessary for proper touches events handling). * * @constructor * @memberof gdjs * @class InputManager */ gdjs.InputManager = function() { this._pressedKeys = new Hashtable(); this._releasedKeys = new Hashtable(); this._lastPressedKey = 0; this._pressedMouseButtons = new Array(5); this._releasedMouseButtons = new Array(5); this._mouseX = 0; this._mouseY = 0; this._mouseWheelDelta = 0; this._touches = new Hashtable(); this._startedTouches = []; //Identifiers of the touches that started during/before the frame. this._endedTouches = []; //Identifiers of the touches that ended during/before the frame. this._touchSimulateMouse = true; }; /** @constant {number} */ gdjs.InputManager.MOUSE_LEFT_BUTTON = 0; /** @constant {number} */ gdjs.InputManager.MOUSE_RIGHT_BUTTON = 1; /** @constant {number} */ gdjs.InputManager.MOUSE_MIDDLE_BUTTON = 2; /** * Should be called whenever a key is pressed * @param {number} keyCode The key code associated to the key press. */ gdjs.InputManager.prototype.onKeyPressed = function(keyCode) { this._pressedKeys.put(keyCode, true); this._lastPressedKey = keyCode; }; /** * Should be called whenever a key is released * @param {number} keyCode The key code associated to the key release. */ gdjs.InputManager.prototype.onKeyReleased = function(keyCode) { this._pressedKeys.put(keyCode, false); this._releasedKeys.put(keyCode, true); }; /** * Return the code of the last key that was pressed. * @return {number} The code of the last key pressed. */ gdjs.InputManager.prototype.getLastPressedKey = function() { return this._lastPressedKey; }; /** * Return true if the key corresponding to keyCode is pressed. * @param {number} keyCode The key code to be tested. */ gdjs.InputManager.prototype.isKeyPressed = function(keyCode) { return this._pressedKeys.containsKey(keyCode) && this._pressedKeys.get(keyCode); }; /** * Return true if the key corresponding to keyCode was released during the last frame. * @param {number} keyCode The key code to be tested. */ gdjs.InputManager.prototype.wasKeyReleased = function(keyCode) { return this._releasedKeys.containsKey(keyCode) && this._releasedKeys.get(keyCode); }; /** * Return true if any key is pressed */ gdjs.InputManager.prototype.anyKeyPressed = function() { for(var keyCode in this._pressedKeys.items) { if (this._pressedKeys.items.hasOwnProperty(keyCode)) { if (this._pressedKeys.items[keyCode]) { return true; } } } return false; }; /** * Should be called when the mouse is moved.<br> * Please note that the coordinates must be expressed relative to the view position. * * @param {number} x The mouse new X position * @param {number} y The mouse new Y position */ gdjs.InputManager.prototype.onMouseMove = function(x,y) { this._mouseX = x; this._mouseY = y; }; /** * Get the mouse X position * * @return the mouse X position, relative to the game view. */ gdjs.InputManager.prototype.getMouseX = function() { return this._mouseX; }; /** * Get the mouse Y position * * @return the mouse Y position, relative to the game view. */ gdjs.InputManager.prototype.getMouseY = function() { return this._mouseY; }; /** * Should be called whenever a mouse button is pressed * @param {number} buttonCode The mouse button code associated to the event. * See gdjs.InputManager.MOUSE_LEFT_BUTTON, gdjs.InputManager.MOUSE_RIGHT_BUTTON, gdjs.InputManager.MOUSE_MIDDLE_BUTTON */ gdjs.InputManager.prototype.onMouseButtonPressed = function(buttonCode) { this._pressedMouseButtons[buttonCode] = true; this._releasedMouseButtons[buttonCode] = false; }; /** * Should be called whenever a mouse button is released * @param {number} buttonCode The mouse button code associated to the event. (see onMouseButtonPressed) */ gdjs.InputManager.prototype.onMouseButtonReleased = function(buttonCode) { this._pressedMouseButtons[buttonCode] = false; this._releasedMouseButtons[buttonCode] = true; }; /** * Return true if the mouse button corresponding to buttonCode is pressed. * @param {number} buttonCode The mouse button code (0: Left button, 1: Right button). */ gdjs.InputManager.prototype.isMouseButtonPressed = function(buttonCode) { return this._pressedMouseButtons[buttonCode] !== undefined && this._pressedMouseButtons[buttonCode]; }; /** * Return true if the mouse button corresponding to buttonCode was just released. * @param {number} buttonCode The mouse button code (0: Left button, 1: Right button). */ gdjs.InputManager.prototype.isMouseButtonReleased = function(buttonCode) { return this._releasedMouseButtons[buttonCode] !== undefined && this._releasedMouseButtons[buttonCode]; }; /** * Should be called whenever the mouse wheel is used * @param {number} wheelDelta The mouse wheel delta */ gdjs.InputManager.prototype.onMouseWheel = function(wheelDelta) { this._mouseWheelDelta = wheelDelta; }; /** * Return the mouse wheel delta */ gdjs.InputManager.prototype.getMouseWheelDelta = function() { return this._mouseWheelDelta; }; /** * Get a touch X position * * @return the touch X position, relative to the game view. */ gdjs.InputManager.prototype.getTouchX = function(identifier) { if (!this._touches.containsKey(identifier)) return 0; return this._touches.get(identifier).x; }; /** * Get a touch Y position * * @return the touch Y position, relative to the game view. */ gdjs.InputManager.prototype.getTouchY = function(identifier) { if (!this._touches.containsKey(identifier)) return 0; return this._touches.get(identifier).y; }; /** * Update and return the array containing the identifiers of all touches. * */ gdjs.InputManager.prototype.getAllTouchIdentifiers = function() { gdjs.InputManager._allTouchIds = gdjs.InputManager._allTouchIds || []; gdjs.InputManager._allTouchIds.length = 0; for(var id in this._touches.items) { if (this._touches.items.hasOwnProperty(id)) { gdjs.InputManager._allTouchIds.push(parseInt(id, 10)); } } return gdjs.InputManager._allTouchIds; }; gdjs.InputManager.prototype.onTouchStart = function(identifier, x, y) { this._startedTouches.push(identifier); this._touches.put(identifier, {x: x, y: y}); if (this._touchSimulateMouse) { this.onMouseMove(x, y); this.onMouseButtonPressed(gdjs.InputManager.MOUSE_LEFT_BUTTON); } }; gdjs.InputManager.prototype.onTouchMove = function(identifier, x, y) { var touch = this._touches.get(identifier); if (!touch) return; touch.x = x; touch.y = y; if (this._touchSimulateMouse) { this.onMouseMove(x, y); } }; gdjs.InputManager.prototype.onTouchEnd = function(identifier) { this._endedTouches.push(identifier); if (this._touches.containsKey(identifier)) { //Postpone deletion at the end of the frame this._touches.get(identifier).justEnded = true; } if (this._touchSimulateMouse) { this.onMouseButtonReleased(gdjs.InputManager.MOUSE_LEFT_BUTTON); } }; gdjs.InputManager.prototype.getStartedTouchIdentifiers = function() { return this._startedTouches; }; gdjs.InputManager.prototype.popStartedTouch = function() { return this._startedTouches.shift(); }; gdjs.InputManager.prototype.popEndedTouch = function() { return this._endedTouches.shift(); }; /** * Set if touch events should simulate mouse events. * * If true, any touch will move the mouse position and set mouse buttons * as pressed/released. * @param enable {Boolean} true to simulate mouse events, false to disable it. */ gdjs.InputManager.prototype.touchSimulateMouse = function(enable) { if (enable === undefined) enable = true; this._touchSimulateMouse = enable; }; /** * Notify the input manager that the frame ended, so anything that last * only for one frame (started/ended touches) should be reset. * * This method should be called in the game loop (see gdjs.RuntimeGame.startGameLoop). */ gdjs.InputManager.prototype.onFrameEnded = function() { //Only clear the ended touches at the end of the frame. for(var id in this._touches.items) { if (this._touches.items.hasOwnProperty(id)) { var touch = this._touches.items[id]; if(touch.justEnded) { this._touches.remove(id); } } } this._startedTouches.length = 0; this._endedTouches.length = 0; this._releasedKeys.clear(); this._releasedMouseButtons.length = 0; };
29.80198
119
0.708749
c1d632086695891bec8dcd3aa53f184e7b4839e3
2,307
js
JavaScript
packages/datadog-plugin-paperplane/src/index.js
hong823/dd-trace-js
6be3b617c65c20a61489de0cc4f575f4b27a3043
[ "Apache-2.0", "BSD-3-Clause" ]
1
2021-04-08T06:24:17.000Z
2021-04-08T06:24:17.000Z
packages/datadog-plugin-paperplane/src/index.js
hong823/dd-trace-js
6be3b617c65c20a61489de0cc4f575f4b27a3043
[ "Apache-2.0", "BSD-3-Clause" ]
9
2020-02-24T23:46:51.000Z
2022-02-08T07:14:02.000Z
packages/datadog-plugin-paperplane/src/index.js
hong823/dd-trace-js
6be3b617c65c20a61489de0cc4f575f4b27a3043
[ "Apache-2.0", "BSD-3-Clause" ]
5
2020-02-08T02:07:28.000Z
2020-09-29T12:42:55.000Z
'use strict' const web = require('../../dd-trace/src/plugins/util/web') const traceRoute = handler => req => { const { original, route } = req if (web.active(original)) { web.enterRoute(original, route) } return handler(req) } const wrapLogger = tracer => logger => record => { const span = tracer.scope().active() if (!span) return logger(record) const correlation = { dd: { trace_id: span.context().toTraceId(), span_id: span.context().toSpanId() } } record = record instanceof Error ? Object.assign(record, correlation) : Object.assign({}, record, correlation) return logger(record) } const wrapMount = (tracer, config) => mount => opts => { const handler = mount(opts) const traced = (req, res) => web.instrument( tracer, config, req, res, 'paperplane.request', () => handler(req, res) ) return traced } const wrapRoutes = tracer => routes => handlers => { const traced = {} for (const route in handlers) { traced[route] = traceRoute(handlers[route]) } return routes(traced) } module.exports = [ { name: 'paperplane', versions: ['>=2.3.2'], file: 'lib/logger.js', patch (exports, tracer) { if (tracer._logInjection) { this.wrap(exports, 'logger', wrapLogger(tracer)) } }, unpatch (exports) { this.unwrap(exports, 'logger') } }, { name: 'paperplane', versions: ['>=2.3.2'], file: 'lib/mount.js', patch (exports, tracer, config) { config = web.normalizeConfig(config) this.wrap(exports, 'mount', wrapMount(tracer, config)) }, unpatch (exports) { this.unwrap(exports, 'mount') } }, { name: 'paperplane', versions: ['>=2.3.2'], file: 'lib/routes.js', patch (exports, tracer) { this.wrap(exports, 'routes', wrapRoutes(tracer)) }, unpatch (exports) { this.unwrap(exports, 'routes') } }, { name: 'paperplane', versions: ['2.3.0 - 2.3.1'], patch (paperplane, tracer, config) { config = web.normalizeConfig(config) this.wrap(paperplane, 'mount', wrapMount(tracer, config)) this.wrap(paperplane, 'routes', wrapRoutes(tracer)) }, unpatch (paperplane) { this.unwrap(paperplane, ['mount', 'routes']) } } ]
21.764151
63
0.591678
c1d658c6726a7d7327a59d42746a7a2703a8dc88
3,367
js
JavaScript
mobile/src/pages/Detail/index.js
julio-0/be-the-hero
36e14a616401475af4b4defa036f8039bab25339
[ "MIT" ]
null
null
null
mobile/src/pages/Detail/index.js
julio-0/be-the-hero
36e14a616401475af4b4defa036f8039bab25339
[ "MIT" ]
5
2021-05-07T22:18:00.000Z
2022-02-27T02:00:20.000Z
mobile/src/pages/Detail/index.js
julio-0/be-the-hero
36e14a616401475af4b4defa036f8039bab25339
[ "MIT" ]
null
null
null
import React from 'react'; import { View, Image, Text, TouchableOpacity, Linking } from 'react-native'; import { Feather } from '@expo/vector-icons'; import { useNavigation, useRoute } from '@react-navigation/native'; import * as MailComposer from 'expo-mail-composer'; import LocalizationContext from '../../services/LocalizationContext'; import logoImg from '../../assets/logo.png'; import styles from './styles'; export default function Detail(){ const navigation = useNavigation(); const route =useRoute(); const { t } = React.useContext(LocalizationContext); const incident = route.params.incident; const value = Intl.NumberFormat(t('language'), {style: 'currency', currency: t('currency')}).format(incident.value); const message = `${t('message', { name: incident.name, title: incident.title, value: value })}`; function navigateBack(){ navigation.goBack(); } function openMail(){ MailComposer.composeAsync({ subject: `Herói do caso: ${incident.title}`, recipients: [incident.email], body: message, }) } function openWhatsapp(){ Linking.openURL(`whatsapp://send?phone=${incident.whatsapp}&text=${message}`) } return ( <View style={styles.container}> <View style={styles.header}> <Image source={logoImg} /> <TouchableOpacity style={styles.detailsButton} onPress={navigateBack} > <Feather name="arrow-left" size={28} color="#e02041" /> </TouchableOpacity> </View> <View style={styles.incident}> <Text style={[styles.incidentProperty, { marginTop: 0 }]}>{t('NGO')}:</Text> <Text style={styles.incidentValue}>{incident.name}</Text> <Text style={styles.incidentProperty}>{t('incident')}:</Text> <Text style={styles.incidentValue}>{incident.title}</Text> <Text style={styles.incidentProperty}>{t('value')}:</Text> <Text style={styles.incidentValue}> { Intl.NumberFormat(`${t('language')}`, { style: 'currency', currency: `${t('currency')}` }).format(incident.value) } </Text> </View> <View style={styles.contactBox}> <Text style={styles.heroTitle}>{t('saveTheDay')}</Text> <Text style={styles.heroTitle}>{t('beHero')}</Text> <Text style={styles.heroDescription}>{t('contact')}</Text> <View style={styles.actions}> <TouchableOpacity style={styles.action} onPress={openWhatsapp} > <Text style={styles.actionText}>{t('whatsapp')}</Text> </TouchableOpacity> <TouchableOpacity style={styles.action} onPress={openMail} > <Text style={styles.actionText}>{t('email')}</Text> </TouchableOpacity> </View> </View> </View> ) }
38.701149
120
0.517375
c1d74335060ac6bae5f14901942c66a0cfb11143
6,817
js
JavaScript
client.js
senakafdo/tuoris
706a2ddddcdcdc7219f78acad7ddae766aec99b0
[ "MIT" ]
null
null
null
client.js
senakafdo/tuoris
706a2ddddcdcdc7219f78acad7ddae766aec99b0
[ "MIT" ]
null
null
null
client.js
senakafdo/tuoris
706a2ddddcdcdc7219f78acad7ddae766aec99b0
[ "MIT" ]
null
null
null
/* Visualize a portion of the visualization given by the normalized view box */ function view(SVGelement, normViewbox) { const idToHtml = {}; const viewbox = [0, 0, 0, 0]; const changes = []; const processedElements = []; idToHtml['0'] = SVGelement; loop(idToHtml, viewbox, changes, processedElements); const viewboxStr = normViewbox.join(' '); const viewboxData = `viewbox=${viewboxStr}`; const socket = io('/dist-view-namespace', { reconnection: true, query: viewboxData }); socket.on('update', (ch) => { for (const i in ch) changes.push(ch[i]); changes.push([3]); }); // Currently unused socket.on('render', (timeStamp) => {}); socket.on('clear', () => { changes.length = 0; processedElements.length = 0; clear(SVGelement, idToHtml); idToHtml['0'] = SVGelement; }); } /* Recursively delete all descendants of a given element */ function recursivelyDelete(element) { while (element.hasChildNodes()) { const child = element.lastChild; recursivelyDelete(child); element.removeChild(child); } } /* Clear the index for elements */ function clear(SVGelement, idToHtml) { recursivelyDelete(SVGelement); for (const i in idToHtml) delete idToHtml[i]; } /* Override current CSS rules */ function setCSS(cssRules) { const styleElements = document.getElementsByTagName('style'); for (let i = 0; i < styleElements.length; i++) { const styleElement = styleElements[i]; styleElement.parentElement.removeChild(styleElement); } for (const i in cssRules) { const stylesheet = cssRules[i]; const s = document.createElement('style'); s.type = 'text/css'; s.innerText = ''; for (const j in stylesheet) s.innerText += stylesheet[j]; document.head.appendChild(s); } } /* Compute the normalized view box given the index of a screen * and the number of rows and columns */ function getNormalizedViewbox(index, rows, columns) { const viewWidth = 1.0 / columns; const viewHeight = 1.0 / rows; const gridX = index % columns; let gridY = (index - gridX) / columns; gridY = (rows - 1) - gridY; // Reverse return [gridX*viewWidth, gridY*viewHeight, viewWidth, viewHeight]; } /* Create a node */ function createNode(tag, namespaceURI, textContent, id, idToHtml) { let node; if (namespaceURI) node = document.createElementNS(namespaceURI, tag); else if (tag) node = document.createElement(tag); else node = document.createTextNode(textContent); idToHtml[id] = node; return node; } /* Set the parent of a node */ function setNodeParent(node, parentID, idToHtml) { if (parentID!==null) { const nextParentNode = idToHtml[parentID]; if (node.parentNode !== nextParentNode) { if (node.parentNode) node.parentNode.removeChild(node); if (!nextParentNode.lastElementChild) { nextParentNode.appendChild(node); } else { let currentChild = nextParentNode.lastElementChild; if (node.additionOrder > currentChild.additionOrder) { nextParentNode.appendChild(node); } else { while (currentChild.previousElementSibling && node.additionOrder < currentChild.previousElementSibling.additionOrder) { currentChild = currentChild.previousElementSibling; } nextParentNode.insertBefore(node, currentChild); } } } } else { if (id != 0 && node.parentNode) node.parentNode.removeChild(node); } } /* Update local view box */ function updateViewBox(entry, normalizedViewbox, viewbox, SVGelement) { const serverViewbox = entry[1]; const initialX = serverViewbox[0]; const initialY = serverViewbox[1]; const finalX = serverViewbox[0] + serverViewbox[2]; const finalY = serverViewbox[1] + serverViewbox[3]; const left = initialX + (normalizedViewbox[0]) * (finalX - initialX); const top = initialY + (normalizedViewbox[1]) * (finalY - initialY); const width = normalizedViewbox[2] * (finalX - initialX); const height = normalizedViewbox[3] * (finalY - initialY); const right = left+width; const bottom = top+height; viewbox[0] = left; viewbox[1] = top; viewbox[2] = right; viewbox[3] = bottom; SVGelement.setAttribute('viewBox', ""+left+" "+top+" "+width+" "+height); SVGelement.setAttribute('preserveAspectRatio', 'none'); } /* Remove every non visible element */ function removeNonVisibleElements(start, processedElements, viewbox, idToHtml) { let processedCount = 0; while(processedElements.length > 0 && (Date.now()-start) < 30) { processedCount += 1; var entry = processedElements.pop(); var type = entry[0]; if (type === 0) { var id = entry[1]; const hasBoundingBox = entry[7] !== null; var node = idToHtml[id]; if (id != 0 && hasBoundingBox && !( entry[7] <= viewbox[2] && entry[9] >= viewbox[0] && entry[8] <= viewbox[3] && entry[10] >= viewbox[1]) && !node.lastElementChild && node.parentNode) node.parentNode.removeChild(node); } } // If not finished, do not remove this entry if(processedElements.length > 0) deleteCount--; } /* Update a given element */ function updateElement(entry, processedElements, idToHtml) { var id = entry[1]; processedElements.push(entry); var parentID = entry[2]; var tag = entry[3]; var namespaceURI = entry[4]; var attributes = entry[5]; var textContent = entry[6]; const additionOrder = entry[11]; var node; if (id in idToHtml) node = idToHtml[id]; else node = createNode(tag, namespaceURI, textContent, id, idToHtml); node.additionOrder = additionOrder; for (const attributeName in attributes) { const prevValue = node.getAttribute(attributeName); const nextValue = attributes[attributeName]; if(prevValue!==nextValue) { if(nextValue===null) node.removeAttribute(attributeName); else node.setAttribute(attributeName, attributes[attributeName]); } } setNodeParent(node, parentID, idToHtml); } /* Main loop */ function loop(idToHtml, viewbox, changes, processedElements) { (function internalLoop() { requestAnimationFrame(internalLoop); const SVGelement = idToHtml['0']; if(SVGelement) { var start = Date.now(); var deleteCount = 0; for (var i=0;i<changes.length && (Date.now()-start) < 30;i++) { deleteCount++; var entry = changes[i]; var type = entry[0]; if (type === 0) { updateElement(entry, processedElements, idToHtml); } else if (type === 1) { setCSS(entry[1]); } else if (type === 2) { updateViewBox(entry, normalizedViewbox, viewbox, SVGelement); } else if(type === 3) { removeNonVisibleElements(start, processedElements, viewbox, idToHtml); } } changes.splice(0, deleteCount); } })(); }
31.85514
129
0.660261
c1d75efb11cba698f2795356fb7b0ddb92fb043e
3,768
js
JavaScript
build/lib/ot/undo-manager.js
zot/Leisure
2883396523242079172e56ba5370f6f128e9dbeb
[ "Zlib" ]
58
2015-04-09T21:13:23.000Z
2022-03-26T06:10:19.000Z
build/lib/ot/undo-manager.js
zot/Leisure
2883396523242079172e56ba5370f6f128e9dbeb
[ "Zlib" ]
2
2015-09-22T12:00:16.000Z
2017-04-05T15:04:09.000Z
build/lib/ot/undo-manager.js
zot/Leisure
2883396523242079172e56ba5370f6f128e9dbeb
[ "Zlib" ]
5
2015-01-26T11:33:54.000Z
2021-02-18T19:40:23.000Z
define(['./ot-base'], function(ot) { 'use strict'; var NORMAL_STATE = 'normal'; var UNDOING_STATE = 'undoing'; var REDOING_STATE = 'redoing'; // Create a new UndoManager with an optional maximum history size. function UndoManager (maxItems) { this.maxItems = maxItems || 50; this.state = NORMAL_STATE; this.dontCompose = false; this.undoStack = []; this.redoStack = []; } // Add an operation to the undo or redo stack, depending on the current state // of the UndoManager. The operation added must be the inverse of the last // edit. When `compose` is true, compose the operation with the last operation // unless the last operation was alread pushed on the redo stack or was hidden // by a newer operation on the undo stack. UndoManager.prototype.add = function (operation, compose) { if (this.state === UNDOING_STATE) { this.redoStack.push(operation); this.dontCompose = true; } else if (this.state === REDOING_STATE) { this.undoStack.push(operation); this.dontCompose = true; } else { var undoStack = this.undoStack; if (!this.dontCompose && compose && undoStack.length > 0) { undoStack.push(operation.compose(undoStack.pop())); } else { undoStack.push(operation); if (undoStack.length > this.maxItems) { undoStack.shift(); } } this.dontCompose = false; this.redoStack = []; } }; function transformStack (stack, operation) { var newStack = []; var Operation = operation.constructor; for (var i = stack.length - 1; i >= 0; i--) { var pair = Operation.transform(stack[i], operation); if (typeof pair[0].isNoop !== 'function' || !pair[0].isNoop()) { newStack.push(pair[0]); } operation = pair[1]; } return newStack.reverse(); } // Transform the undo and redo stacks against a operation by another client. UndoManager.prototype.transform = function (operation) { this.undoStack = transformStack(this.undoStack, operation); this.redoStack = transformStack(this.redoStack, operation); }; // Perform an undo by calling a function with the latest operation on the undo // stack. The function is expected to call the `add` method with the inverse // of the operation, which pushes the inverse on the redo stack. UndoManager.prototype.performUndo = function (fn) { this.state = UNDOING_STATE; if (this.undoStack.length === 0) { throw new Error("undo not possible"); } fn(this.undoStack.pop()); this.state = NORMAL_STATE; }; // The inverse of `performUndo`. UndoManager.prototype.performRedo = function (fn) { this.state = REDOING_STATE; if (this.redoStack.length === 0) { throw new Error("redo not possible"); } fn(this.redoStack.pop()); this.state = NORMAL_STATE; }; // Is the undo stack not empty? UndoManager.prototype.canUndo = function () { return this.undoStack.length !== 0; }; // Is the redo stack not empty? UndoManager.prototype.canRedo = function () { return this.redoStack.length !== 0; }; // Whether the UndoManager is currently performing an undo. UndoManager.prototype.isUndoing = function () { return this.state === UNDOING_STATE; }; // Whether the UndoManager is currently performing a redo. UndoManager.prototype.isRedoing = function () { return this.state === REDOING_STATE; }; ot.UndoManager = UndoManager; return ot; });
36.941176
82
0.608811
c1d7b53bc8bcddf4644fa680edbfda5eb362ac4a
1,767
js
JavaScript
test/js/spec/widgets/path-widget.js
hpautonomy/settings-page
1332723f3a1cffe92c681c1123bed9623ce9bd9d
[ "MIT" ]
1
2018-06-22T17:53:10.000Z
2018-06-22T17:53:10.000Z
test/js/spec/widgets/path-widget.js
hpautonomy/settings-page
1332723f3a1cffe92c681c1123bed9623ce9bd9d
[ "MIT" ]
null
null
null
test/js/spec/widgets/path-widget.js
hpautonomy/settings-page
1332723f3a1cffe92c681c1123bed9623ce9bd9d
[ "MIT" ]
4
2017-07-18T05:52:41.000Z
2017-07-31T15:32:48.000Z
/* * Copyright 2013-2015 Hewlett-Packard Development Company, L.P. * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. */ define([ 'settings/js/widgets/path-widget', 'test/test-utils', 'jasmine-jquery' ], function(PathWidget, utils) { describe('Path widget', function() { beforeEach(function() { this.widget = new PathWidget({ configItem: 'thingThatNeedsAPath', description: 'Choose a path', strings: { label: 'Path:' }, title: 'Path To Thing' }); this.widget.render(); this.widget.updateConfig({path: '/opt/thing'}); this.$path = this.widget.$('input[name="path"]'); }); utils.testSuperProperties.call(this, {configItem: 'thingThatNeedsAPath', title: 'Path To Thing', description: 'Choose a path'}); it('should display the correct config', function() { expect(this.$path).toHaveValue('/opt/thing'); }); it('should return the correct config', function() { this.$path.val('C:\\things'); expect(this.widget.getConfig()).toEqual({path: 'C:\\things'}); }); it('should fail client side validation on blank path', function() { var $controlGroup = this.$path.closest('.control-group'); this.$path.val(''); var isValid = this.widget.validateInputs(); expect(isValid).toBeFalsy(); expect($controlGroup).toHaveClass('error'); this.$path.val('/opt').trigger('change'); expect($controlGroup).not.toHaveClass('error'); }); }); });
32.722222
136
0.554612
c1d7c4d6b5a79d4947e8ac37d6cfb5603a594c6f
858
js
JavaScript
src/liquidity-pool-stake.js
stellar-expert/liquidity-pool-utils
7c45b32155b96390eab6bac6933330900222dbf9
[ "MIT" ]
null
null
null
src/liquidity-pool-stake.js
stellar-expert/liquidity-pool-utils
7c45b32155b96390eab6bac6933330900222dbf9
[ "MIT" ]
null
null
null
src/liquidity-pool-stake.js
stellar-expert/liquidity-pool-utils
7c45b32155b96390eab6bac6933330900222dbf9
[ "MIT" ]
null
null
null
import Bignumber from 'bignumber.js' import {stripTrailingZeros} from '@stellar-expert/formatter' /** * Estimate amounts of liquidity pool tokens based on the share of the pool * @param {Number|String|Bignumber} shares - Amount of pool shares that belong to the account * @param {Array<String|Number|Bignumber>} reserves - Total amount of tokens deposited to the pool * @param {Number|String|Bignumber} totalShares - Total pool shares * @return {Array<String>} */ export function estimateLiquidityPoolStakeValue(shares, reserves, totalShares) { if (!(shares > 0) || !(totalShares > 0)) return null return reserves.map(reserve => { const amount = new Bignumber(shares) .mul(new Bignumber(reserve)) .div(totalShares) .toFixed(7, Bignumber.ROUND_DOWN) return stripTrailingZeros(amount) }) }
42.9
98
0.703963
c1d87c49f538404b1dd1a0e5ad200e85912426a6
5,956
js
JavaScript
src/client/vendor/SanitizeConfig.js
emekaorjiani/steemnaira
7846c15d2bac0fbb331491e4cb0c669d30f2ec59
[ "MIT" ]
1
2018-02-10T03:26:07.000Z
2018-02-10T03:26:07.000Z
src/client/vendor/SanitizeConfig.js
emekaorjiani/steemnaira
7846c15d2bac0fbb331491e4cb0c669d30f2ec59
[ "MIT" ]
null
null
null
src/client/vendor/SanitizeConfig.js
emekaorjiani/steemnaira
7846c15d2bac0fbb331491e4cb0c669d30f2ec59
[ "MIT" ]
1
2019-01-29T04:45:18.000Z
2019-01-29T04:45:18.000Z
/** This function is extracted from steemit.com source code and does the same tasks with some slight- * adjustments to meet our needs. Refer to the main one in case of future problems: * https://raw.githubusercontent.com/steemit/steemit.com/354c08a10cf88e0828a70dbf7ed9082698aea20d/app/utils/SanitizeConfig.js * */ const iframeWhitelist = [ { re: /^(https?:)?\/\/player.vimeo.com\/video\/.*/i, fn: src => { // <iframe src="https://player.vimeo.com/video/179213493" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> if (!src) return null; const m = src.match(/https:\/\/player\.vimeo\.com\/video\/([0-9]+)/); if (!m || m.length !== 2) return null; return `https://player.vimeo.com/video/${m[1]}`; }, }, { re: /^(https?:)?\/\/www.youtube.com\/embed\/.*/i, fn: src => src.replace(/\?.+$/, ''), // strip query string (yt: autoplay=1,controls=0,showinfo=0, etc) }, { re: /^(https?:)?\/\/w.soundcloud.com\/player\/.*/i, fn: src => { if (!src) return null; // <iframe width="100%" height="450" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/257659076&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false&amp;visual=true"></iframe> const m = src.match(/url=(.+?)[&?]/); if (!m || m.length !== 2) return null; return ( `https://w.soundcloud.com/player/?url=${ m[1] }&auto_play=false&hide_related=false&show_comments=true` + '&show_user=true&show_reposts=false&visual=true' ); }, }, { re: /^(https?:)?\/\/(?:www\.)?(?:periscope.tv\/)(.*)?$/i, fn: src => src, // handled by embedjs }, { re: /^(https?:)?\/\/(?:www\.)?(?:(player.)?twitch.tv\/)(.*)?$/i, fn: src => src, // handled by embedjs }, ]; export const noImageText = '(Image not shown due to low ratings)'; export const allowedTags = ` div, iframe, del, a, p, b, q, br, ul, li, ol, img, h1, h2, h3, h4, h5, h6, hr, blockquote, pre, code, em, strong, center, table, thead, tbody, tr, th, td, strike, sup, sub ` .trim() .split(/,\s*/); // Medium insert plugin uses: div, figure, figcaption, iframe export default ({ large = true, noImage = false, sanitizeErrors = [] }) => ({ allowedTags, // figure, figcaption, // SEE https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet allowedAttributes: { // "src" MUST pass a whitelist (below) iframe: [ 'src', 'width', 'height', 'frameborder', 'allowfullscreen', 'webkitallowfullscreen', 'mozallowfullscreen', ], // class attribute is strictly whitelisted (below) div: ['class'], // style is subject to attack, filtering more below td: ['style'], img: ['src', 'alt'], a: ['href', 'rel', 'target'], }, transformTags: { iframe: (tagName, attribs) => { const srcAtty = decodeURIComponent(attribs.src); for (const item of iframeWhitelist) { if (item.re.test(srcAtty)) { const src = typeof item.fn === 'function' ? item.fn(srcAtty, item.re) : srcAtty; if (!src) break; return { tagName: 'iframe', attribs: { frameborder: '0', allowfullscreen: 'allowfullscreen', webkitallowfullscreen: 'webkitallowfullscreen', // deprecated but required for vimeo : https://vimeo.com/forums/help/topic:278181 mozallowfullscreen: 'mozallowfullscreen', // deprecated but required for vimeo src, width: large ? '640' : '480', height: large ? '360' : '270', }, }; } } console.log('Blocked, did not match iframe "src" white list urls:', tagName, attribs); sanitizeErrors.push(`Invalid iframe URL: ${srcAtty}`); return { tagName: 'div', text: `(Unsupported ${srcAtty})` }; }, img: (tagName, attribs) => { if (noImage) return { tagName: 'div', text: noImageText }; // See https://github.com/punkave/sanitize-html/issues/117 let { src, alt } = attribs; if (!/^(https?:)?\/\//i.test(src)) { console.log('Blocked, image tag src does not appear to be a url', tagName, attribs); sanitizeErrors.push('An image in this post did not save properly.'); return { tagName: 'img', attribs: { src: 'brokenimg.jpg' } }; } // replace http:// with // to force https when needed src = src.replace(/^http:\/\//i, '//'); const atts = { src }; if (alt && alt !== '') atts.alt = alt; return { tagName, attribs: atts }; }, div: (tagName, attribs) => { const attys = {}; const classWhitelist = [ 'pull-right', 'pull-left', 'text-justify', 'text-rtl', 'text-center', 'text-right', 'videoWrapper', ]; const validClass = classWhitelist.find(e => attribs.class === e); if (validClass) { attys.class = validClass; } return { tagName, attribs: attys, }; }, td: (tagName, attribs) => { const attys = {}; if (attribs.style === 'text-align:right') { attys.style = 'text-align:right'; } return { tagName, attribs: attys, }; }, a: (tagName, attribs) => { let { href } = attribs; if (!href) href = '#'; href = href.trim(); const attys = { href }; // If it's not a (relative or absolute) steemit URL... if (!href.match(/^(\/(?!\/)|https:\/\/(app\.|dev\.)?busy.org)/)) { attys.target = '_blank'; // pending iframe impl https://mathiasbynens.github.io/rel-noopener/ attys.rel = 'nofollow noopener'; } return { tagName, attribs: attys, }; }, }, });
34.830409
297
0.561786
c1d92b64664ef1f45bc279961175523c07136f07
496
js
JavaScript
scripts/server.js
mikekap/kubelay
534bfb28ab84a20fb430d8a3c50c1b312e67e8f6
[ "MIT" ]
22
2016-11-04T01:03:12.000Z
2020-02-15T07:00:15.000Z
scripts/server.js
mikekap/kubelay
534bfb28ab84a20fb430d8a3c50c1b312e67e8f6
[ "MIT" ]
null
null
null
scripts/server.js
mikekap/kubelay
534bfb28ab84a20fb430d8a3c50c1b312e67e8f6
[ "MIT" ]
1
2019-06-03T13:56:07.000Z
2019-06-03T13:56:07.000Z
import express from 'express'; import app from '../app/server'; // React server import graphQL from '../graphql'; // GraphQL server import logger from '../resources/logging'; const env = process.env; const host = env.npm_package_config_appServerHost; const port = env.npm_package_config_appServerPort; let router = express(); router.use('/graphql', graphQL); router.use('/*', app); let server = router.listen(port, host); logger.info(`Started server on port ${port}`); export default server;
27.555556
51
0.733871
c1d99c16dd62f53d7247c557dbf576f8ca17043f
3,728
js
JavaScript
app/dao/AgreementDao.js
anthonycluse/GestionDettes
ce5db5c578665c37651d767fdf2228dacb322874
[ "MIT" ]
null
null
null
app/dao/AgreementDao.js
anthonycluse/GestionDettes
ce5db5c578665c37651d767fdf2228dacb322874
[ "MIT" ]
null
null
null
app/dao/AgreementDao.js
anthonycluse/GestionDettes
ce5db5c578665c37651d767fdf2228dacb322874
[ "MIT" ]
null
null
null
var dbContext = require('./../../db/DbContext'); var _ = require('lodash'); var AgreementDao = function () { this.context = dbContext.entities; }; _.extend(AgreementDao.prototype, { /* getAllSearch: function(search, callback){ return this.context.Agreement.findAll({where: ["reference like ?", "%"+search+"%"], include: [ { model: this.context.Billbook} ], order: 'id DESC' }); }, getAllSearchByPage: function (search, offset, limit, callback) { return this.context.Agreement.findAll({where: ["reference like ?", "%"+search+"%"], offset: offset, limit: limit, order: 'id desc', include: [ { model: this.context.Billbook} ], order: 'id DESC' }); },*/ getAll: function (callback) { return this.context.Agreement.findAll({ include: [ { model: this.context.Billbook} ], order: 'number ASC' }); }, getAllNonePrivate: function (callback) { return this.context.Agreement.findAll({ where: {is_private: 0}, include: [ { model: this.context.Billbook} ], order: 'number ASC' }); }, getAllPrivate: function (callback) { return this.context.Agreement.findAll({ where: {is_private: 1}, include: [ { model: this.context.Billbook} ], order: 'number ASC' }); }, /*getAllByPage: function (offset, limit, callback) { return this.context.Agreement.findAll({offset: offset, limit: limit, order: 'id desc', include: [ { model: this.context.Billbook} ], order: 'id DESC' }); }, getAllNonePrivateByPage: function (offset, limit, callback) { return this.context.Agreement.findAll({offset: offset, limit: limit, order: 'id desc', where: {is_private: 0}, include: [ { model: this.context.Billbook} ], order: 'id DESC' }); }, getAllPrivateByPage: function (offset, limit, callback) { return this.context.Agreement.findAll({offset: offset, limit: limit, order: 'id desc', where: {is_private: 1}, include: [ { model: this.context.Billbook} ], order: 'id DESC' }); },*/ get: function (id, callback) { return this.context.Agreement.find({where: {id: id}, include: [ { model: this.context.Billbook} ]}); }, //query mysql : SELECT * FROM `billbooks` WHERE DATEDIFF(first_due_date, now()) <= 30 getAllDatediff: function (id, callback) { return this.context.Agreement.findAll({where: ["DATEDIFF(NOW(), first_due_date) <= 30"], include: [ { model: this.context.Billbook} ]}); }, save: function(properties, callback){ this.context.Agreement.create(properties) .success(function (media) { callback(null, media); }) .error(function (error) { callback(error, null); }); }, update: function (properties, callback) { this.get(properties.id).success(function (agreement) { if(agreement){ agreement.updateAttributes(properties).success(function (media) { callback(null, media); }).error(function (error) { callback(error, agreement); }); }else{ callback('Aucun contrat avec l\'id :' + properties.id, null); } }); }, delete: function (id, callback) { this.context.Agreement.find(id).success(function (agreement) { if(agreement){ agreement.destroy().success(callback); } else{ callback('Aucun contrat avec l\'id :' + id); } }) .error(callback); } }); module.exports = AgreementDao;
27.211679
136
0.572157
c1d9a4c482423fe3188c6af7b7aa89ed8e98cd6a
244
js
JavaScript
src/components/UI/Box/Box.js
aleksanderpiron/react-hooks
c6ad18968e3cda4a997349914e4138a49b8274ce
[ "MIT" ]
null
null
null
src/components/UI/Box/Box.js
aleksanderpiron/react-hooks
c6ad18968e3cda4a997349914e4138a49b8274ce
[ "MIT" ]
null
null
null
src/components/UI/Box/Box.js
aleksanderpiron/react-hooks
c6ad18968e3cda4a997349914e4138a49b8274ce
[ "MIT" ]
null
null
null
import React from 'react'; import './Box.scss'; const Box = ({children, center}) =>{ return( <div className={`box ${typeof center!=='undefined'?'box--center':''}`}> {children} </div> ) } export default Box;
20.333333
79
0.545082
c1d9e2bb96cc020e51650250d06eddceca9860ab
1,261
js
JavaScript
resources/js/admin/app/api/Api.js
genadyd/new_admin
622397593e42f6dd405c4f3f122c85a5731666e6
[ "MIT" ]
null
null
null
resources/js/admin/app/api/Api.js
genadyd/new_admin
622397593e42f6dd405c4f3f122c85a5731666e6
[ "MIT" ]
null
null
null
resources/js/admin/app/api/Api.js
genadyd/new_admin
622397593e42f6dd405c4f3f122c85a5731666e6
[ "MIT" ]
null
null
null
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Api = /** @class */ (function () { function Api(url, method, data, type) { var _this = this; if (method === void 0) { method = 'POST'; } if (data === void 0) { data = {}; } if (type === void 0) { type = 'json'; } this.exeq = function () { var urlPrefix = '/new_admin/public/api'; if (window.location.host == 'www.admin.loc' || window.location.host == '127.0.0.1:8000' || window.location.host == 'gena-admin.com') { urlPrefix = '/api'; } var type = _this.type === 'json' ? 'application/json' : 'text/html'; return fetch(urlPrefix + _this.url, { method: _this.method, headers: { 'Content-Type': type, }, body: _this.data == 'undefined' ? '' : JSON.stringify(_this.data) }).then(function (response) { return _this.type === 'json' ? response.json() : response.text(); }); }; this.url = url; this.data = data; this.method = method; this.type = type; } return Api; }()); exports.default = Api;
38.212121
146
0.484536
c1da001bbfec09d2f8ed80828b7e49ec286a8386
1,280
js
JavaScript
packages/element-app/src/redux/store/index.js
JaceHensley/element
971da7aca23119a6b37b8df47f804e93c4b566ae
[ "Apache-2.0" ]
93
2019-03-26T16:07:11.000Z
2022-02-04T02:19:39.000Z
packages/element-app/src/redux/store/index.js
JaceHensley/element
971da7aca23119a6b37b8df47f804e93c4b566ae
[ "Apache-2.0" ]
159
2019-04-02T15:24:37.000Z
2021-02-10T12:55:50.000Z
packages/element-app/src/redux/store/index.js
JaceHensley/element
971da7aca23119a6b37b8df47f804e93c4b566ae
[ "Apache-2.0" ]
28
2019-05-14T13:22:27.000Z
2022-01-10T21:54:30.000Z
import { createStore, combineReducers, applyMiddleware } from 'redux'; import { persistStore, persistReducer } from 'redux-persist'; import { createBrowserHistory } from 'history'; import { connectRouter, routerMiddleware } from 'connected-react-router'; import storage from 'redux-persist/lib/storage'; import { composeWithDevTools } from 'redux-devtools-extension'; import thunk from 'redux-thunk'; import lightNode from '../lightNode'; import fullNode from '../fullNode'; import tmui from '../tmui'; import keystore from '../keystore'; export const history = createBrowserHistory(); const rootReducer = { lightNode: lightNode.reducer, fullNode: fullNode.reducer, tmui: tmui.reducer, keystore: keystore.reducer, router: connectRouter(history), }; export default appReducers => { // Persistance configuration const persistConfig = { key: 'elementDID', whitelist: ['keystore'], storage, }; // Store. const reducers = combineReducers({ ...rootReducer, ...appReducers }); const store = createStore( persistReducer(persistConfig, reducers), composeWithDevTools(applyMiddleware(thunk, routerMiddleware(history))) ); // Persistor. const persistor = persistStore(store); return { store, persistor, history, }; };
25.6
74
0.720313
c1da7bc0f04f0c94cec38ef39f983be3869e7d54
552
js
JavaScript
node_modules/@iconify/icons-mdi/src/cloud-lock-outline.js
FAD95/NEXT.JS-Course
5177872c4045945f3e952d8b59c99dfa21fff5ef
[ "MIT" ]
1
2021-05-15T00:26:49.000Z
2021-05-15T00:26:49.000Z
node_modules/@iconify/icons-mdi/src/cloud-lock-outline.js
rydockman/YouPick
ad902eafb876ac425baeaef4ec066d335025c5bb
[ "Apache-2.0" ]
1
2021-12-09T01:30:41.000Z
2021-12-09T01:30:41.000Z
node_modules/@iconify/icons-mdi/src/cloud-lock-outline.js
rydockman/YouPick
ad902eafb876ac425baeaef4ec066d335025c5bb
[ "Apache-2.0" ]
null
null
null
let data = { "body": "<path d=\"M22 17c.5 0 1 .5 1 1v4c0 .5-.5 1-1 1h-5c-.5 0-1-.5-1-1v-4c0-.5.5-1 1-1v-1.5c0-1.4 1.1-2.5 2.5-2.5s2.5 1.1 2.5 2.5V17m-1 0v-1.5c0-.8-.7-1.5-1.5-1.5s-1.5.7-1.5 1.5V17h3m-3.5-6v-.5C17.5 7.46 15.04 5 12 5C9.5 5 7.37 6.69 6.71 9H6c-2.21 0-4 1.79-4 4s1.79 4 4 4h8.17a3 3 0 0 0-.17 1v1H6c-3.31 0-6-2.69-6-6c0-3.1 2.34-5.64 5.35-5.96A7.496 7.496 0 0 1 12 3c3.64 0 6.67 2.6 7.36 6.04C21.95 9.22 24 11.36 24 14l-.06.77A4.497 4.497 0 0 0 19.5 11h-2z\" fill=\"currentColor\"/>", "width": 24, "height": 24 }; export default data;
78.857143
486
0.601449
c1daa860f82dba1261f581a27b210b3180191d34
4,067
js
JavaScript
build/node-scroll-info/node-scroll-info-min.js
maniekmankowski/yui3
25264e3629b1c07fb779d203c4a25c0879ec862c
[ "MIT" ]
1,958
2015-01-01T02:46:43.000Z
2022-03-26T20:25:44.000Z
build/node-scroll-info/node-scroll-info-min.js
Genhir/yui3
25264e3629b1c07fb779d203c4a25c0879ec862c
[ "MIT" ]
58
2021-02-09T14:20:36.000Z
2021-02-09T14:41:51.000Z
build/node-scroll-info/node-scroll-info-min.js
Genhir/yui3
25264e3629b1c07fb779d203c4a25c0879ec862c
[ "MIT" ]
720
2015-01-01T02:49:26.000Z
2022-03-04T10:23:18.000Z
YUI.add("node-scroll-info",function(e,t){var n=e.config.doc,r=e.config.win,i="scroll",s="scrollDown",o="scrollLeft",u="scrollRight",a="scrollUp",f="scrollToBottom",l="scrollToLeft",c="scrollToRight",h="scrollToTop";e.Plugin.ScrollInfo=e.Base.create("scrollInfoPlugin",e.Plugin.Base,[],{initializer:function(e){this._host=e.host,this._hostIsBody=this._host.get("nodeName").toLowerCase()==="body",this._scrollDelay=this.get("scrollDelay"),this._scrollMargin=this.get("scrollMargin"),this._scrollNode=this._getScrollNode(),this.refreshDimensions(),this._lastScroll=this.getScrollInfo(),this._bind()},destructor:function(){(new e.EventHandle(this._events)).detach(),this._events=null},getOffscreenNodes:function(t,n){typeof n=="undefined"&&(n=this._scrollMargin);var r=e.Selector.query(t||"*",this._host._node);return new e.NodeList(e.Array.filter(r,function(e){return!this._isElementOnscreen(e,n)},this))},getOnscreenNodes:function(t,n){typeof n=="undefined"&&(n=this._scrollMargin);var r=e.Selector.query(t||"*",this._host._node);return new e.NodeList(e.Array.filter(r,function(e){return this._isElementOnscreen(e,n)},this))},getScrollInfo:function(){var e=this._scrollNode,t=this._lastScroll,n=this._scrollMargin,r=e.scrollLeft,i=e.scrollHeight,s=e.scrollTop,o=e.scrollWidth,u=s+this._height,a=r+this._width;return{atBottom:u>i-n,atLeft:r<n,atRight:a>o-n,atTop:s<n,isScrollDown:t&&s>t.scrollTop,isScrollLeft:t&&r<t.scrollLeft,isScrollRight:t&&r>t.scrollLeft,isScrollUp:t&&s<t.scrollTop,scrollBottom:u,scrollHeight:i,scrollLeft:r,scrollRight:a,scrollTop:s,scrollWidth:o}},isNodeOnscreen:function(t,n){return t=e.one(t),!!t&&!!this._isElementOnscreen(t._node,n)},refreshDimensions:function(){var t=n.documentElement;e.UA.ios||e.UA.android&&e.UA.chrome?(this._winHeight=r.innerHeight,this._winWidth=r.innerWidth):(this._winHeight=t.clientHeight,this._winWidth=t.clientWidth),this._hostIsBody?(this._height=this._winHeight,this._width=this._winWidth):(this._height=this._scrollNode.clientHeight,this._width=this._scrollNode.clientWidth),this._refreshHostBoundingRect()},_bind:function(){var t=e.one("win");this._events=[this.after({scrollDelayChange:this._afterScrollDelayChange,scrollMarginChange:this._afterScrollMarginChange}),t.on("windowresize",this._afterResize,this)],this._hostIsBody?this._events.push(t.after("scroll",this._afterHostScroll,this)):this._events.push(t.after("scroll",this._afterWindowScroll,this),this._host.after("scroll",this._afterHostScroll,this))},_getScrollNode:function(){return this._hostIsBody&&!e.UA.webkit?n.documentElement:e.Node.getDOMNode(this._host)},_isElementOnscreen:function(e,t){var n=this._hostRect,r=e.getBoundingClientRect();return typeof t=="undefined"&&(t=this._scrollMargin),!(r.top>n.bottom+t||r.bottom<n.top-t||r.right<n.left-t||r.left>n.right+t)},_refreshHostBoundingRect:function(){var e=this._winHeight,t=this._winWidth,n;this._hostIsBody?(n={bottom:e,height:e,left:0,right:t,top:0,width:t},this._isHostOnscreen=!0):n=this._scrollNode.getBoundingClientRect(),this._hostRect=n},_triggerScroll:function(t){var n=this.getScrollInfo(),r=e.merge(t,n),p=this._lastScroll;this._lastScroll=n,this.fire(i,r),n.isScrollLeft?this.fire(o,r):n.isScrollRight&&this.fire(u,r),n.isScrollUp?this.fire(a,r):n.isScrollDown&&this.fire(s,r),n.atBottom&&(!p.atBottom||n.scrollHeight>p.scrollHeight)&&this.fire(f,r),n.atLeft&&!p.atLeft&&this.fire(l,r),n.atRight&&(!p.atRight||n.scrollWidth>p.scrollWidth)&&this.fire(c,r),n.atTop&&!p.atTop&&this.fire(h,r)},_afterHostScroll:function(e){var t=this;clearTimeout(this._scrollTimeout),this._scrollTimeout=setTimeout(function(){t._triggerScroll(e)},this._scrollDelay)},_afterResize:function(){this.refreshDimensions()},_afterScrollDelayChange:function(e){this._scrollDelay=e.newVal},_afterScrollMarginChange:function(e){this._scrollMargin=e.newVal},_afterWindowScroll:function(){this._refreshHostBoundingRect()}},{NS:"scrollInfo",ATTRS:{scrollDelay:{value:50},scrollMargin:{value:50}}})},"@VERSION@",{requires:["array-extras","base-build","event-resize","node-pluginhost","plugin","selector"]});
2,033.5
4,066
0.785345
c1dab3698bba3c7f0e5f2c42944fce61c52d4b19
3,490
js
JavaScript
frontend/node_modules/@angular/compiler-cli/src/ngtsc/reflection/src/util.js
otaviooasc/CRUD-Angular
482d82d7a9c690e6172486b86b4a68c147bace5f
[ "MIT" ]
4
2020-11-18T06:27:02.000Z
2020-11-30T03:38:39.000Z
frontend/node_modules/@angular/compiler-cli/src/ngtsc/reflection/src/util.js
otaviooasc/CRUD-Angular
482d82d7a9c690e6172486b86b4a68c147bace5f
[ "MIT" ]
4
2020-08-11T15:32:22.000Z
2021-11-02T15:49:33.000Z
frontend/node_modules/@angular/compiler-cli/src/ngtsc/reflection/src/util.js
otaviooasc/CRUD-Angular
482d82d7a9c690e6172486b86b4a68c147bace5f
[ "MIT" ]
6
2020-11-18T05:22:36.000Z
2022-02-24T13:40:43.000Z
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ (function (factory) { if (typeof module === "object" && typeof module.exports === "object") { var v = factory(require, exports); if (v !== undefined) module.exports = v; } else if (typeof define === "function" && define.amd) { define("@angular/compiler-cli/src/ngtsc/reflection/src/util", ["require", "exports", "typescript"], factory); } })(function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isNamedVariableDeclaration = exports.isNamedFunctionDeclaration = exports.isNamedClassDeclaration = void 0; var ts = require("typescript"); function isNamedClassDeclaration(node) { return ts.isClassDeclaration(node) && (node.name !== undefined); } exports.isNamedClassDeclaration = isNamedClassDeclaration; function isNamedFunctionDeclaration(node) { return ts.isFunctionDeclaration(node) && (node.name !== undefined); } exports.isNamedFunctionDeclaration = isNamedFunctionDeclaration; function isNamedVariableDeclaration(node) { return ts.isVariableDeclaration(node) && (node.name !== undefined); } exports.isNamedVariableDeclaration = isNamedVariableDeclaration; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvbXBpbGVyLWNsaS9zcmMvbmd0c2MvcmVmbGVjdGlvbi9zcmMvdXRpbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7Ozs7Ozs7Ozs7Ozs7SUFFSCwrQkFBaUM7SUFHakMsU0FBZ0IsdUJBQXVCLENBQUMsSUFBYTtRQUVuRCxPQUFPLEVBQUUsQ0FBQyxrQkFBa0IsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxJQUFJLEtBQUssU0FBUyxDQUFDLENBQUM7SUFDbEUsQ0FBQztJQUhELDBEQUdDO0lBRUQsU0FBZ0IsMEJBQTBCLENBQUMsSUFBYTtRQUV0RCxPQUFPLEVBQUUsQ0FBQyxxQkFBcUIsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxJQUFJLEtBQUssU0FBUyxDQUFDLENBQUM7SUFDckUsQ0FBQztJQUhELGdFQUdDO0lBRUQsU0FBZ0IsMEJBQTBCLENBQUMsSUFBYTtRQUV0RCxPQUFPLEVBQUUsQ0FBQyxxQkFBcUIsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxJQUFJLEtBQUssU0FBUyxDQUFDLENBQUM7SUFDckUsQ0FBQztJQUhELGdFQUdDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBAbGljZW5zZVxuICogQ29weXJpZ2h0IEdvb2dsZSBMTEMgQWxsIFJpZ2h0cyBSZXNlcnZlZC5cbiAqXG4gKiBVc2Ugb2YgdGhpcyBzb3VyY2UgY29kZSBpcyBnb3Zlcm5lZCBieSBhbiBNSVQtc3R5bGUgbGljZW5zZSB0aGF0IGNhbiBiZVxuICogZm91bmQgaW4gdGhlIExJQ0VOU0UgZmlsZSBhdCBodHRwczovL2FuZ3VsYXIuaW8vbGljZW5zZVxuICovXG5cbmltcG9ydCAqIGFzIHRzIGZyb20gJ3R5cGVzY3JpcHQnO1xuaW1wb3J0IHtDbGFzc0RlY2xhcmF0aW9ufSBmcm9tICcuL2hvc3QnO1xuXG5leHBvcnQgZnVuY3Rpb24gaXNOYW1lZENsYXNzRGVjbGFyYXRpb24obm9kZTogdHMuTm9kZSk6XG4gICAgbm9kZSBpcyBDbGFzc0RlY2xhcmF0aW9uPHRzLkNsYXNzRGVjbGFyYXRpb24+IHtcbiAgcmV0dXJuIHRzLmlzQ2xhc3NEZWNsYXJhdGlvbihub2RlKSAmJiAobm9kZS5uYW1lICE9PSB1bmRlZmluZWQpO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gaXNOYW1lZEZ1bmN0aW9uRGVjbGFyYXRpb24obm9kZTogdHMuTm9kZSk6XG4gICAgbm9kZSBpcyBDbGFzc0RlY2xhcmF0aW9uPHRzLkZ1bmN0aW9uRGVjbGFyYXRpb24+IHtcbiAgcmV0dXJuIHRzLmlzRnVuY3Rpb25EZWNsYXJhdGlvbihub2RlKSAmJiAobm9kZS5uYW1lICE9PSB1bmRlZmluZWQpO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gaXNOYW1lZFZhcmlhYmxlRGVjbGFyYXRpb24obm9kZTogdHMuTm9kZSk6XG4gICAgbm9kZSBpcyBDbGFzc0RlY2xhcmF0aW9uPHRzLlZhcmlhYmxlRGVjbGFyYXRpb24+IHtcbiAgcmV0dXJuIHRzLmlzVmFyaWFibGVEZWNsYXJhdGlvbihub2RlKSAmJiAobm9kZS5uYW1lICE9PSB1bmRlZmluZWQpO1xufVxuIl19
102.647059
2,046
0.868768
c1daba05e28e72d96d012bd3327b967d5b450411
557
js
JavaScript
test/virtual-fs.js
shama/ix-head
6f8346e8e2e3a7044df0e59bbb9555b6a172c690
[ "MIT" ]
1
2019-03-24T02:48:42.000Z
2019-03-24T02:48:42.000Z
test/virtual-fs.js
shama/ix-head
6f8346e8e2e3a7044df0e59bbb9555b6a172c690
[ "MIT" ]
1
2015-04-02T23:29:58.000Z
2015-04-03T18:27:48.000Z
test/virtual-fs.js
shama/posix-head
6f8346e8e2e3a7044df0e59bbb9555b6a172c690
[ "MIT" ]
null
null
null
var fs = module.exports = {} var Readable = require('readable-stream/readable') var inherits = require('inherits') var data = { 'test/fixtures/twelve': 'one\ntwo\nthree\nfour\nfive\nsix\nseven\neight\nine\nten\neleven\ntwelve\n', 'test/fixtures/four': 'one\ntwo\nthree\nfour\n', } function VFile(filename) { Readable.call(this) this.filename = filename } inherits(VFile, Readable) VFile.prototype._read = function() { this.push(data[this.filename]) this.push(null) } fs.createReadStream = function(filename) { return new VFile(filename) }
23.208333
103
0.723519
c1db3b87ef3dd5bef5981deff6df19afecea492c
72,400
js
JavaScript
public/js/resources_js_Pages_Blog_vue.js
UrmeJaman/webApp
ec25f9663ccb3da15e0f6220e75b66b844c16595
[ "MIT" ]
null
null
null
public/js/resources_js_Pages_Blog_vue.js
UrmeJaman/webApp
ec25f9663ccb3da15e0f6220e75b66b844c16595
[ "MIT" ]
null
null
null
public/js/resources_js_Pages_Blog_vue.js
UrmeJaman/webApp
ec25f9663ccb3da15e0f6220e75b66b844c16595
[ "MIT" ]
null
null
null
(self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_Pages_Blog_vue"],{ /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/Pages/Blog.vue?vue&type=script&lang=js&": /*!******************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/Pages/Blog.vue?vue&type=script&lang=js& ***! \******************************************************************************************************************************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _vue_head_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./vue/head.vue */ "./resources/js/Pages/vue/head.vue"); /* harmony import */ var _vue_loader_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./vue/loader.vue */ "./resources/js/Pages/vue/loader.vue"); /* harmony import */ var _vue_nav_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./vue/nav.vue */ "./resources/js/Pages/vue/nav.vue"); /* harmony import */ var _vue_blog_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./vue/blog.vue */ "./resources/js/Pages/vue/blog.vue"); /* harmony import */ var _vue_pageCiecle_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./vue/pageCiecle.vue */ "./resources/js/Pages/vue/pageCiecle.vue"); /* harmony import */ var _vue_footer_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./vue/footer.vue */ "./resources/js/Pages/vue/footer.vue"); /* harmony import */ var _lib_TemplateMain__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../lib/TemplateMain */ "./resources/js/lib/TemplateMain.js"); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ components: { Head: _vue_head_vue__WEBPACK_IMPORTED_MODULE_0__.default, Loader: _vue_loader_vue__WEBPACK_IMPORTED_MODULE_1__.default, Nav: _vue_nav_vue__WEBPACK_IMPORTED_MODULE_2__.default, Blog: _vue_blog_vue__WEBPACK_IMPORTED_MODULE_3__.default, Page: _vue_pageCiecle_vue__WEBPACK_IMPORTED_MODULE_4__.default, Footer: _vue_footer_vue__WEBPACK_IMPORTED_MODULE_5__.default }, mounted: function mounted() { this.$nextTick(function () { (0,_lib_TemplateMain__WEBPACK_IMPORTED_MODULE_6__.TemplateMain)(); }); } }); /***/ }), /***/ "./resources/js/lib/TemplateMain.js": /*!******************************************!*\ !*** ./resources/js/lib/TemplateMain.js ***! \******************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "TemplateMain": () => (/* binding */ TemplateMain) /* harmony export */ }); function TemplateMain() { (function ($) { "use strict"; $(window).stellar({ responsive: true, parallaxBackgrounds: true, parallaxElements: true, horizontalScrolling: false, hideDistantElements: false, scrollProperty: "scroll" }); var fullHeight = function fullHeight() { $(".js-fullheight").css("height", $(window).height()); $(window).resize(function () { $(".js-fullheight").css("height", $(window).height()); }); }; fullHeight(); // loader var loader = function loader() { setTimeout(function () { if ($("#ftco-loader").length > 0) { $("#ftco-loader").removeClass("show"); } }, 1); }; loader(); // Scrollax $.Scrollax(); var carousel = function carousel() { $(".carousel-testimony").owlCarousel({ autoplay: true, autoHeight: true, center: true, loop: true, items: 1, margin: 30, stagePadding: 0, nav: true, dots: false, navText: ['<span class="fa fa-chevron-left">', '<span class="fa fa-chevron-right">'], responsive: { 0: { items: 1 }, 600: { items: 1 }, 1000: { items: 3 } } }); }; carousel(); $("nav .dropdown").hover(function () { var $this = $(this); // timer; // clearTimeout(timer); $this.addClass("show"); $this.find("> a").attr("aria-expanded", true); // $this.find('.dropdown-menu').addClass('animated-fast fadeInUp show'); $this.find(".dropdown-menu").addClass("show"); }, function () { var $this = $(this); // timer; // timer = setTimeout(function(){ $this.removeClass("show"); $this.find("> a").attr("aria-expanded", false); // $this.find('.dropdown-menu').removeClass('animated-fast fadeInUp show'); $this.find(".dropdown-menu").removeClass("show"); // }, 100); }); $("#dropdown04").on("show.bs.dropdown", function () { console.log("show"); }); // scroll var scrollWindow = function scrollWindow() { $(window).scroll(function () { var $w = $(this), st = $w.scrollTop(), navbar = $(".ftco_navbar"), sd = $(".js-scroll-wrap"); if (st > 150) { if (!navbar.hasClass("scrolled")) { navbar.addClass("scrolled"); } } if (st < 150) { if (navbar.hasClass("scrolled")) { navbar.removeClass("scrolled sleep"); } } if (st > 350) { if (!navbar.hasClass("awake")) { navbar.addClass("awake"); } if (sd.length > 0) { sd.addClass("sleep"); } } if (st < 350) { if (navbar.hasClass("awake")) { navbar.removeClass("awake"); navbar.addClass("sleep"); } if (sd.length > 0) { sd.removeClass("sleep"); } } }); }; scrollWindow(); var counter = function counter() { $("#section-counter, .hero-wrap, .ftco-counter").waypoint(function (direction) { if (direction === "down" && !$(this.element).hasClass("ftco-animated")) { var comma_separator_number_step = $.animateNumber.numberStepFactories.separator(","); $(".number").each(function () { var $this = $(this), num = $this.data("number"); console.log(num); $this.animateNumber({ number: num, numberStep: comma_separator_number_step }, 7000); }); } }, { offset: "95%" }); }; counter(); var contentWayPoint = function contentWayPoint() { var i = 0; $(".ftco-animate").waypoint(function (direction) { if (direction === "down" && !$(this.element).hasClass("ftco-animated")) { i++; $(this.element).addClass("item-animate"); setTimeout(function () { $("body .ftco-animate.item-animate").each(function (k) { var el = $(this); setTimeout(function () { var effect = el.data("animate-effect"); if (effect === "fadeIn") { el.addClass("fadeIn ftco-animated"); } else if (effect === "fadeInLeft") { el.addClass("fadeInLeft ftco-animated"); } else if (effect === "fadeInRight") { el.addClass("fadeInRight ftco-animated"); } else { el.addClass("fadeInUp ftco-animated"); } el.removeClass("item-animate"); }, k * 50, "easeInOutExpo"); }); }, 100); } }, { offset: "95%" }); }; contentWayPoint(); // magnific popup $(".image-popup").magnificPopup({ type: "image", closeOnContentClick: true, closeBtnInside: false, fixedContentPos: true, mainClass: "mfp-no-margins mfp-with-zoom", // class to remove default margin from left and right side gallery: { enabled: true, navigateByImgClick: true, preload: [0, 1] // Will preload 0 - before current, and 1 after the current image }, image: { verticalFit: true }, zoom: { enabled: true, duration: 300 // don't foget to change the duration also in CSS } }); $(".popup-youtube, .popup-vimeo, .popup-gmaps").magnificPopup({ disableOn: 700, type: "iframe", mainClass: "mfp-fade", removalDelay: 160, preloader: false, fixedContentPos: false }); })(jQuery); } /***/ }), /***/ "./resources/js/Pages/Blog.vue": /*!*************************************!*\ !*** ./resources/js/Pages/Blog.vue ***! \*************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _Blog_vue_vue_type_template_id_5ff005cb___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Blog.vue?vue&type=template&id=5ff005cb& */ "./resources/js/Pages/Blog.vue?vue&type=template&id=5ff005cb&"); /* harmony import */ var _Blog_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Blog.vue?vue&type=script&lang=js& */ "./resources/js/Pages/Blog.vue?vue&type=script&lang=js&"); /* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); /* normalize component */ ; var component = (0,_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__.default)( _Blog_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__.default, _Blog_vue_vue_type_template_id_5ff005cb___WEBPACK_IMPORTED_MODULE_0__.render, _Blog_vue_vue_type_template_id_5ff005cb___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns, false, null, null, null ) /* hot reload */ if (false) { var api; } component.options.__file = "resources/js/Pages/Blog.vue" /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (component.exports); /***/ }), /***/ "./resources/js/Pages/vue/blog.vue": /*!*****************************************!*\ !*** ./resources/js/Pages/vue/blog.vue ***! \*****************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _blog_vue_vue_type_template_id_0a8fef94___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./blog.vue?vue&type=template&id=0a8fef94& */ "./resources/js/Pages/vue/blog.vue?vue&type=template&id=0a8fef94&"); /* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); var script = {} /* normalize component */ ; var component = (0,_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_1__.default)( script, _blog_vue_vue_type_template_id_0a8fef94___WEBPACK_IMPORTED_MODULE_0__.render, _blog_vue_vue_type_template_id_0a8fef94___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns, false, null, null, null ) /* hot reload */ if (false) { var api; } component.options.__file = "resources/js/Pages/vue/blog.vue" /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (component.exports); /***/ }), /***/ "./resources/js/Pages/vue/footer.vue": /*!*******************************************!*\ !*** ./resources/js/Pages/vue/footer.vue ***! \*******************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _footer_vue_vue_type_template_id_4178a28d___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./footer.vue?vue&type=template&id=4178a28d& */ "./resources/js/Pages/vue/footer.vue?vue&type=template&id=4178a28d&"); /* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); var script = {} /* normalize component */ ; var component = (0,_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_1__.default)( script, _footer_vue_vue_type_template_id_4178a28d___WEBPACK_IMPORTED_MODULE_0__.render, _footer_vue_vue_type_template_id_4178a28d___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns, false, null, null, null ) /* hot reload */ if (false) { var api; } component.options.__file = "resources/js/Pages/vue/footer.vue" /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (component.exports); /***/ }), /***/ "./resources/js/Pages/vue/head.vue": /*!*****************************************!*\ !*** ./resources/js/Pages/vue/head.vue ***! \*****************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _head_vue_vue_type_template_id_2105825c___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./head.vue?vue&type=template&id=2105825c& */ "./resources/js/Pages/vue/head.vue?vue&type=template&id=2105825c&"); /* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); var script = {} /* normalize component */ ; var component = (0,_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_1__.default)( script, _head_vue_vue_type_template_id_2105825c___WEBPACK_IMPORTED_MODULE_0__.render, _head_vue_vue_type_template_id_2105825c___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns, false, null, null, null ) /* hot reload */ if (false) { var api; } component.options.__file = "resources/js/Pages/vue/head.vue" /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (component.exports); /***/ }), /***/ "./resources/js/Pages/vue/loader.vue": /*!*******************************************!*\ !*** ./resources/js/Pages/vue/loader.vue ***! \*******************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _loader_vue_vue_type_template_id_0305bdf6___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./loader.vue?vue&type=template&id=0305bdf6& */ "./resources/js/Pages/vue/loader.vue?vue&type=template&id=0305bdf6&"); /* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); var script = {} /* normalize component */ ; var component = (0,_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_1__.default)( script, _loader_vue_vue_type_template_id_0305bdf6___WEBPACK_IMPORTED_MODULE_0__.render, _loader_vue_vue_type_template_id_0305bdf6___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns, false, null, null, null ) /* hot reload */ if (false) { var api; } component.options.__file = "resources/js/Pages/vue/loader.vue" /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (component.exports); /***/ }), /***/ "./resources/js/Pages/vue/nav.vue": /*!****************************************!*\ !*** ./resources/js/Pages/vue/nav.vue ***! \****************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _nav_vue_vue_type_template_id_79059ebe___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./nav.vue?vue&type=template&id=79059ebe& */ "./resources/js/Pages/vue/nav.vue?vue&type=template&id=79059ebe&"); /* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); var script = {} /* normalize component */ ; var component = (0,_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_1__.default)( script, _nav_vue_vue_type_template_id_79059ebe___WEBPACK_IMPORTED_MODULE_0__.render, _nav_vue_vue_type_template_id_79059ebe___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns, false, null, null, null ) /* hot reload */ if (false) { var api; } component.options.__file = "resources/js/Pages/vue/nav.vue" /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (component.exports); /***/ }), /***/ "./resources/js/Pages/vue/pageCiecle.vue": /*!***********************************************!*\ !*** ./resources/js/Pages/vue/pageCiecle.vue ***! \***********************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _pageCiecle_vue_vue_type_template_id_3582dade___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pageCiecle.vue?vue&type=template&id=3582dade& */ "./resources/js/Pages/vue/pageCiecle.vue?vue&type=template&id=3582dade&"); /* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); var script = {} /* normalize component */ ; var component = (0,_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_1__.default)( script, _pageCiecle_vue_vue_type_template_id_3582dade___WEBPACK_IMPORTED_MODULE_0__.render, _pageCiecle_vue_vue_type_template_id_3582dade___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns, false, null, null, null ) /* hot reload */ if (false) { var api; } component.options.__file = "resources/js/Pages/vue/pageCiecle.vue" /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (component.exports); /***/ }), /***/ "./resources/js/Pages/Blog.vue?vue&type=script&lang=js&": /*!**************************************************************!*\ !*** ./resources/js/Pages/Blog.vue?vue&type=script&lang=js& ***! \**************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_0_rules_0_use_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Blog_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Blog.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/Pages/Blog.vue?vue&type=script&lang=js&"); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_babel_loader_lib_index_js_clonedRuleSet_5_0_rules_0_use_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Blog_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__.default); /***/ }), /***/ "./resources/js/Pages/Blog.vue?vue&type=template&id=5ff005cb&": /*!********************************************************************!*\ !*** ./resources/js/Pages/Blog.vue?vue&type=template&id=5ff005cb& ***! \********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "render": () => (/* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Blog_vue_vue_type_template_id_5ff005cb___WEBPACK_IMPORTED_MODULE_0__.render), /* harmony export */ "staticRenderFns": () => (/* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Blog_vue_vue_type_template_id_5ff005cb___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns) /* harmony export */ }); /* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Blog_vue_vue_type_template_id_5ff005cb___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Blog.vue?vue&type=template&id=5ff005cb& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/Pages/Blog.vue?vue&type=template&id=5ff005cb&"); /***/ }), /***/ "./resources/js/Pages/vue/blog.vue?vue&type=template&id=0a8fef94&": /*!************************************************************************!*\ !*** ./resources/js/Pages/vue/blog.vue?vue&type=template&id=0a8fef94& ***! \************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "render": () => (/* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_blog_vue_vue_type_template_id_0a8fef94___WEBPACK_IMPORTED_MODULE_0__.render), /* harmony export */ "staticRenderFns": () => (/* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_blog_vue_vue_type_template_id_0a8fef94___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns) /* harmony export */ }); /* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_blog_vue_vue_type_template_id_0a8fef94___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./blog.vue?vue&type=template&id=0a8fef94& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/Pages/vue/blog.vue?vue&type=template&id=0a8fef94&"); /***/ }), /***/ "./resources/js/Pages/vue/footer.vue?vue&type=template&id=4178a28d&": /*!**************************************************************************!*\ !*** ./resources/js/Pages/vue/footer.vue?vue&type=template&id=4178a28d& ***! \**************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "render": () => (/* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_footer_vue_vue_type_template_id_4178a28d___WEBPACK_IMPORTED_MODULE_0__.render), /* harmony export */ "staticRenderFns": () => (/* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_footer_vue_vue_type_template_id_4178a28d___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns) /* harmony export */ }); /* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_footer_vue_vue_type_template_id_4178a28d___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./footer.vue?vue&type=template&id=4178a28d& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/Pages/vue/footer.vue?vue&type=template&id=4178a28d&"); /***/ }), /***/ "./resources/js/Pages/vue/head.vue?vue&type=template&id=2105825c&": /*!************************************************************************!*\ !*** ./resources/js/Pages/vue/head.vue?vue&type=template&id=2105825c& ***! \************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "render": () => (/* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_head_vue_vue_type_template_id_2105825c___WEBPACK_IMPORTED_MODULE_0__.render), /* harmony export */ "staticRenderFns": () => (/* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_head_vue_vue_type_template_id_2105825c___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns) /* harmony export */ }); /* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_head_vue_vue_type_template_id_2105825c___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./head.vue?vue&type=template&id=2105825c& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/Pages/vue/head.vue?vue&type=template&id=2105825c&"); /***/ }), /***/ "./resources/js/Pages/vue/loader.vue?vue&type=template&id=0305bdf6&": /*!**************************************************************************!*\ !*** ./resources/js/Pages/vue/loader.vue?vue&type=template&id=0305bdf6& ***! \**************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "render": () => (/* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_loader_vue_vue_type_template_id_0305bdf6___WEBPACK_IMPORTED_MODULE_0__.render), /* harmony export */ "staticRenderFns": () => (/* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_loader_vue_vue_type_template_id_0305bdf6___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns) /* harmony export */ }); /* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_loader_vue_vue_type_template_id_0305bdf6___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./loader.vue?vue&type=template&id=0305bdf6& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/Pages/vue/loader.vue?vue&type=template&id=0305bdf6&"); /***/ }), /***/ "./resources/js/Pages/vue/nav.vue?vue&type=template&id=79059ebe&": /*!***********************************************************************!*\ !*** ./resources/js/Pages/vue/nav.vue?vue&type=template&id=79059ebe& ***! \***********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "render": () => (/* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_nav_vue_vue_type_template_id_79059ebe___WEBPACK_IMPORTED_MODULE_0__.render), /* harmony export */ "staticRenderFns": () => (/* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_nav_vue_vue_type_template_id_79059ebe___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns) /* harmony export */ }); /* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_nav_vue_vue_type_template_id_79059ebe___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./nav.vue?vue&type=template&id=79059ebe& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/Pages/vue/nav.vue?vue&type=template&id=79059ebe&"); /***/ }), /***/ "./resources/js/Pages/vue/pageCiecle.vue?vue&type=template&id=3582dade&": /*!******************************************************************************!*\ !*** ./resources/js/Pages/vue/pageCiecle.vue?vue&type=template&id=3582dade& ***! \******************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "render": () => (/* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_pageCiecle_vue_vue_type_template_id_3582dade___WEBPACK_IMPORTED_MODULE_0__.render), /* harmony export */ "staticRenderFns": () => (/* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_pageCiecle_vue_vue_type_template_id_3582dade___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns) /* harmony export */ }); /* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_pageCiecle_vue_vue_type_template_id_3582dade___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./pageCiecle.vue?vue&type=template&id=3582dade& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/Pages/vue/pageCiecle.vue?vue&type=template&id=3582dade&"); /***/ }), /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/Pages/Blog.vue?vue&type=template&id=5ff005cb&": /*!***********************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/Pages/Blog.vue?vue&type=template&id=5ff005cb& ***! \***********************************************************************************************************************************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "render": () => (/* binding */ render), /* harmony export */ "staticRenderFns": () => (/* binding */ staticRenderFns) /* harmony export */ }); var render = function() { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _c( "div", [ _c("Loader"), _vm._v(" "), _c("Head"), _vm._v(" "), _c("Nav"), _vm._v(" "), _vm._m(0), _vm._v(" "), _c("Blog"), _vm._v(" "), _c("Page"), _vm._v(" "), _c("Footer") ], 1 ) } var staticRenderFns = [ function() { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _c( "section", { staticClass: "hero-wrap hero-wrap-2", staticStyle: { "background-image": "url('images/bg_3.jpg')" }, attrs: { "data-stellar-background-ratio": "0.5" } }, [ _c("div", { staticClass: "overlay" }), _vm._v(" "), _c("div", { staticClass: "container" }, [ _c( "div", { staticClass: "row no-gutters slider-text align-items-end justify-content-center" }, [ _c( "div", { staticClass: "col-md-9 ftco-animate pb-5 text-center" }, [ _c("h1", { staticClass: "mb-3 bread" }, [ _vm._v("Read our blog") ]), _vm._v(" "), _c("p", { staticClass: "breadcrumbs" }, [ _c("span", { staticClass: "mr-2" }, [ _c("a", { attrs: { href: "index.html" } }, [ _vm._v("Home "), _c("i", { staticClass: "fa fa-chevron-right" }) ]) ]), _vm._v(" "), _c("span", [ _vm._v("Blog "), _c("i", { staticClass: "fa fa-chevron-right" }) ]) ]) ] ) ] ) ]) ] ) } ] render._withStripped = true /***/ }), /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/Pages/vue/blog.vue?vue&type=template&id=0a8fef94&": /*!***************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/Pages/vue/blog.vue?vue&type=template&id=0a8fef94& ***! \***************************************************************************************************************************************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "render": () => (/* binding */ render), /* harmony export */ "staticRenderFns": () => (/* binding */ staticRenderFns) /* harmony export */ }); var render = function() { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _vm._m(0) } var staticRenderFns = [ function() { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _c("div", { staticClass: "ftco-section bg-light" }, [ _c("div", { staticClass: "container" }, [ _c("div", { staticClass: "row justify-content-center mb-5 pb-3" }, [ _c( "div", { staticClass: "col-md-7 heading-section text-center ftco-animate" }, [_c("h2", [_vm._v("Read our latest blog")])] ) ]), _vm._v(" "), _c("div", { staticClass: "row d-flex" }, [ _c("div", { staticClass: "col-md-4 d-flex ftco-animate" }, [ _c("div", { staticClass: "blog-entry justify-content-end" }, [ _c("a", { staticClass: "block-20", staticStyle: { "background-image": "url('images/image_1.jpg')" }, attrs: { href: "blog-single.html" } }), _vm._v(" "), _c("div", { staticClass: "text mt-3 float-right d-block" }, [ _c( "div", { staticClass: "d-flex align-items-center pt-2 mb-4 topp" }, [ _c("div", { staticClass: "one" }, [ _c("span", { staticClass: "day" }, [_vm._v("29")]) ]), _vm._v(" "), _c("div", { staticClass: "two pl-1" }, [ _c("span", { staticClass: "yr" }, [_vm._v("2020")]), _vm._v(" "), _c("span", { staticClass: "mos" }, [_vm._v("June")]) ]) ] ), _vm._v(" "), _c("h3", { staticClass: "heading" }, [ _c("a", { attrs: { href: "#" } }, [ _vm._v( "Why Lead Generation is Key for Business\n Growth" ) ]) ]) ]) ]) ]), _vm._v(" "), _c("div", { staticClass: "col-md-4 d-flex ftco-animate" }, [ _c("div", { staticClass: "blog-entry justify-content-end" }, [ _c("a", { staticClass: "block-20", staticStyle: { "background-image": "url('images/image_2.jpg')" }, attrs: { href: "blog-single.html" } }), _vm._v(" "), _c("div", { staticClass: "text mt-3 float-right d-block" }, [ _c( "div", { staticClass: "d-flex align-items-center pt-2 mb-4 topp" }, [ _c("div", { staticClass: "one" }, [ _c("span", { staticClass: "day" }, [_vm._v("29")]) ]), _vm._v(" "), _c("div", { staticClass: "two pl-1" }, [ _c("span", { staticClass: "yr" }, [_vm._v("2020")]), _vm._v(" "), _c("span", { staticClass: "mos" }, [_vm._v("June")]) ]) ] ), _vm._v(" "), _c("h3", { staticClass: "heading" }, [ _c("a", { attrs: { href: "#" } }, [ _vm._v( "Why Lead Generation is Key for Business\n Growth" ) ]) ]) ]) ]) ]), _vm._v(" "), _c("div", { staticClass: "col-md-4 d-flex ftco-animate" }, [ _c("div", { staticClass: "blog-entry" }, [ _c("a", { staticClass: "block-20", staticStyle: { "background-image": "url('images/image_3.jpg')" }, attrs: { href: "blog-single.html" } }), _vm._v(" "), _c("div", { staticClass: "text mt-3 float-right d-block" }, [ _c( "div", { staticClass: "d-flex align-items-center pt-2 mb-4 topp" }, [ _c("div", { staticClass: "one" }, [ _c("span", { staticClass: "day" }, [_vm._v("29")]) ]), _vm._v(" "), _c("div", { staticClass: "two pl-1" }, [ _c("span", { staticClass: "yr" }, [_vm._v("2020")]), _vm._v(" "), _c("span", { staticClass: "mos" }, [_vm._v("June")]) ]) ] ), _vm._v(" "), _c("h3", { staticClass: "heading" }, [ _c("a", { attrs: { href: "#" } }, [ _vm._v( "Why Lead Generation is Key for Business\n Growth" ) ]) ]) ]) ]) ]) ]) ]) ]) } ] render._withStripped = true /***/ }), /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/Pages/vue/footer.vue?vue&type=template&id=4178a28d&": /*!*****************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/Pages/vue/footer.vue?vue&type=template&id=4178a28d& ***! \*****************************************************************************************************************************************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "render": () => (/* binding */ render), /* harmony export */ "staticRenderFns": () => (/* binding */ staticRenderFns) /* harmony export */ }); var render = function() { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _vm._m(0) } var staticRenderFns = [ function() { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _c( "footer", { staticClass: "ftco-footer ftco-footer-2 ftco-section" }, [ _c("div", { staticClass: "container" }, [ _c("div", { staticClass: "row mb-5" }, [ _c("div", { staticClass: "col-md" }, [ _c("div", { staticClass: "ftco-footer-widget mb-4" }, [ _c("h2", { staticClass: "ftco-footer-logo" }, [ _vm._v("\n IT"), _c("span", [_vm._v("solution")]) ]), _vm._v(" "), _c("p", [ _vm._v( "\n Far far away, behind the word mountains, far from\n the countries Vokalia and Consonantia, there live\n the blind texts.\n " ) ]), _vm._v(" "), _c( "ul", { staticClass: "ftco-footer-social list-unstyled mt-2" }, [ _c("li", { staticClass: "ftco-animate" }, [ _c("a", { attrs: { href: "#" } }, [ _c("span", { staticClass: "fa fa-twitter" }) ]) ]), _vm._v(" "), _c("li", { staticClass: "ftco-animate" }, [ _c("a", { attrs: { href: "#" } }, [ _c("span", { staticClass: "fa fa-facebook" }) ]) ]), _vm._v(" "), _c("li", { staticClass: "ftco-animate" }, [ _c("a", { attrs: { href: "#" } }, [ _c("span", { staticClass: "fa fa-instagram" }) ]) ]) ] ) ]) ]), _vm._v(" "), _c("div", { staticClass: "col-md" }, [ _c("div", { staticClass: "ftco-footer-widget mb-4 ml-md-5" }, [ _c("h2", { staticClass: "ftco-heading-2" }, [ _vm._v("Explore") ]), _vm._v(" "), _c("ul", { staticClass: "list-unstyled" }, [ _c("li", [ _c( "a", { staticClass: "py-2 d-block", attrs: { href: "#" } }, [_vm._v("About")] ) ]), _vm._v(" "), _c("li", [ _c( "a", { staticClass: "py-2 d-block", attrs: { href: "#" } }, [_vm._v("Contact")] ) ]), _vm._v(" "), _c("li", [ _c( "a", { staticClass: "py-2 d-block", attrs: { href: "#" } }, [_vm._v("What We Do")] ) ]), _vm._v(" "), _c("li", [ _c( "a", { staticClass: "py-2 d-block", attrs: { href: "#" } }, [_vm._v("Plans & Pricing")] ) ]), _vm._v(" "), _c("li", [ _c( "a", { staticClass: "py-2 d-block", attrs: { href: "#" } }, [_vm._v("Refund Policy")] ) ]), _vm._v(" "), _c("li", [ _c( "a", { staticClass: "py-2 d-block", attrs: { href: "#" } }, [_vm._v("Call Us")] ) ]) ]) ]) ]), _vm._v(" "), _c("div", { staticClass: "col-md" }, [ _c("div", { staticClass: "ftco-footer-widget mb-4" }, [ _c("h2", { staticClass: "ftco-heading-2" }, [_vm._v("Legal")]), _vm._v(" "), _c("ul", { staticClass: "list-unstyled" }, [ _c("li", [ _c( "a", { staticClass: "py-2 d-block", attrs: { href: "#" } }, [_vm._v("Join Us")] ) ]), _vm._v(" "), _c("li", [ _c( "a", { staticClass: "py-2 d-block", attrs: { href: "#" } }, [_vm._v("Blog")] ) ]), _vm._v(" "), _c("li", [ _c( "a", { staticClass: "py-2 d-block", attrs: { href: "#" } }, [_vm._v("Privacy & Policy")] ) ]), _vm._v(" "), _c("li", [ _c( "a", { staticClass: "py-2 d-block", attrs: { href: "#" } }, [_vm._v("Terms & Conditions")] ) ]), _vm._v(" "), _c("li", [ _c( "a", { staticClass: "py-2 d-block", attrs: { href: "#" } }, [_vm._v("Careers")] ) ]), _vm._v(" "), _c("li", [ _c( "a", { staticClass: "py-2 d-block", attrs: { href: "#" } }, [_vm._v("Contact")] ) ]) ]) ]) ]), _vm._v(" "), _c("div", { staticClass: "col-md" }, [ _c("div", { staticClass: "ftco-footer-widget mb-4" }, [ _c("h2", { staticClass: "ftco-heading-2" }, [ _vm._v("Have a Questions?") ]), _vm._v(" "), _c("div", { staticClass: "block-23 mb-3" }, [ _c("ul", [ _c("li", [ _c("span", { staticClass: "icon fa fa-map marker" }), _c("span", { staticClass: "text" }, [ _vm._v( "203 Fake St. Mountain View, San\n Francisco, California, USA" ) ]) ]), _vm._v(" "), _c("li", [ _c("a", { attrs: { href: "#" } }, [ _c("span", { staticClass: "icon fa fa-phone" }), _c("span", { staticClass: "text" }, [ _vm._v("+2 392 3929 210") ]) ]) ]), _vm._v(" "), _c("li", [ _c("a", { attrs: { href: "#" } }, [ _c("span", { staticClass: "icon fa fa-paper-plane pr-4" }), _c("span", { staticClass: "text" }, [ _vm._v("info@yourdomain.com") ]) ]) ]) ]) ]) ]) ]) ]), _vm._v(" "), _c("div", { staticClass: "row" }, [ _c("div", { staticClass: "col-md-12 text-center" }, [ _c("p", [ _vm._v( "\n Copyright ©\n " ), _vm._v( "\n All rights reserved | This template is made with\n " ), _c("i", { staticClass: "fa fa-heart", attrs: { "aria-hidden": "true" } }), _vm._v(" by\n "), _c( "a", { attrs: { href: "https://colorlib.com", target: "_blank" } }, [_vm._v("Colorlib")] ) ]) ]) ]) ]) ] ) } ] render._withStripped = true /***/ }), /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/Pages/vue/head.vue?vue&type=template&id=2105825c&": /*!***************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/Pages/vue/head.vue?vue&type=template&id=2105825c& ***! \***************************************************************************************************************************************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "render": () => (/* binding */ render), /* harmony export */ "staticRenderFns": () => (/* binding */ staticRenderFns) /* harmony export */ }); var render = function() { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _vm._m(0) } var staticRenderFns = [ function() { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _c("div", { staticClass: "wrap" }, [ _c("div", { staticClass: "container" }, [ _c("div", { staticClass: "row justify-content-between" }, [ _c( "div", { staticClass: "col-12 col-md d-flex align-items-center" }, [ _c("p", { staticClass: "mb-0 phone" }, [ _c("span", { staticClass: "mailus" }, [_vm._v("Phone no:")]), _vm._v(" "), _c("a", { attrs: { href: "#" } }, [_vm._v("+00 1234 567")]), _vm._v(" or\n "), _c("span", { staticClass: "mailus" }, [_vm._v("email us:")]), _vm._v(" "), _c("a", { attrs: { href: "#" } }, [ _vm._v("emailsample@email.com") ]) ]) ] ), _vm._v(" "), _c( "div", { staticClass: "col-12 col-md d-flex justify-content-md-end" }, [ _c("div", { staticClass: "social-media" }, [ _c("p", { staticClass: "mb-0 d-flex" }, [ _c( "a", { staticClass: "d-flex align-items-center justify-content-center", attrs: { href: "#" } }, [ _c("span", { staticClass: "fa fa-facebook" }, [ _c("i", { staticClass: "sr-only" }, [ _vm._v("Facebook") ]) ]) ] ), _vm._v(" "), _c( "a", { staticClass: "d-flex align-items-center justify-content-center", attrs: { href: "#" } }, [ _c("span", { staticClass: "fa fa-twitter" }, [ _c("i", { staticClass: "sr-only" }, [_vm._v("Twitter")]) ]) ] ), _vm._v(" "), _c( "a", { staticClass: "d-flex align-items-center justify-content-center", attrs: { href: "#" } }, [ _c("span", { staticClass: "fa fa-instagram" }, [ _c("i", { staticClass: "sr-only" }, [ _vm._v("Instagram") ]) ]) ] ), _vm._v(" "), _c( "a", { staticClass: "d-flex align-items-center justify-content-center", attrs: { href: "#" } }, [ _c("span", { staticClass: "fa fa-dribbble" }, [ _c("i", { staticClass: "sr-only" }, [ _vm._v("Dribbble") ]) ]) ] ) ]) ]) ] ) ]) ]) ]) } ] render._withStripped = true /***/ }), /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/Pages/vue/loader.vue?vue&type=template&id=0305bdf6&": /*!*****************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/Pages/vue/loader.vue?vue&type=template&id=0305bdf6& ***! \*****************************************************************************************************************************************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "render": () => (/* binding */ render), /* harmony export */ "staticRenderFns": () => (/* binding */ staticRenderFns) /* harmony export */ }); var render = function() { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _c( "div", { staticClass: "show fullscreen", attrs: { id: "ftco-loader" } }, [ _c( "svg", { staticClass: "circular", attrs: { width: "48px", height: "48px" } }, [ _c("circle", { staticClass: "path-bg", attrs: { cx: "24", cy: "24", r: "22", fill: "none", "stroke-width": "4", stroke: "#eeeeee" } }), _vm._v(" "), _c("circle", { staticClass: "path", attrs: { cx: "24", cy: "24", r: "22", fill: "none", "stroke-width": "4", "stroke-miterlimit": "10", stroke: "#F96D00" } }) ] ) ] ) } var staticRenderFns = [] render._withStripped = true /***/ }), /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/Pages/vue/nav.vue?vue&type=template&id=79059ebe&": /*!**************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/Pages/vue/nav.vue?vue&type=template&id=79059ebe& ***! \**************************************************************************************************************************************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "render": () => (/* binding */ render), /* harmony export */ "staticRenderFns": () => (/* binding */ staticRenderFns) /* harmony export */ }); var render = function() { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _vm._m(0) } var staticRenderFns = [ function() { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _c( "nav", { staticClass: "navbar navbar-expand-lg navbar-dark ftco_navbar bg-dark ftco-navbar-light", attrs: { id: "ftco-navbar" } }, [ _c("div", { staticClass: "container" }, [ _c( "a", { staticClass: "navbar-brand", staticStyle: { "background-image": "url('images/logo-dark-md.png')" }, attrs: { href: "index.html" } }, [_vm._v("IT"), _c("span", [_vm._v("solution")])] ), _vm._v(" "), _c( "button", { staticClass: "navbar-toggler", attrs: { type: "button", "data-toggle": "collapse", "data-target": "#ftco-nav", "aria-controls": "ftco-nav", "aria-expanded": "false", "aria-label": "Toggle navigation" } }, [ _c("span", { staticClass: "oi oi-menu" }), _vm._v(" Menu\n ") ] ), _vm._v(" "), _c( "div", { staticClass: "collapse navbar-collapse", attrs: { id: "ftco-nav" } }, [ _c("ul", { staticClass: "navbar-nav ml-auto" }, [ _c("li", { staticClass: "nav-item active" }, [ _c("a", { staticClass: "nav-link", attrs: { href: "/" } }, [ _vm._v("Home") ]) ]), _vm._v(" "), _c("li", { staticClass: "nav-item" }, [ _c( "a", { staticClass: "nav-link", attrs: { href: "/about" } }, [_vm._v("About")] ) ]), _vm._v(" "), _c("li", { staticClass: "nav-item" }, [ _c( "a", { staticClass: "nav-link", attrs: { href: "/service" } }, [_vm._v("Services")] ) ]), _vm._v(" "), _c("li", { staticClass: "nav-item" }, [ _c( "a", { staticClass: "nav-link", attrs: { href: "/caseStudy" } }, [_vm._v("Case Study")] ) ]), _vm._v(" "), _c("li", { staticClass: "nav-item" }, [ _c( "a", { staticClass: "nav-link", attrs: { href: "/blog" } }, [_vm._v("Blog")] ) ]), _vm._v(" "), _c("li", { staticClass: "nav-item" }, [ _c( "a", { staticClass: "nav-link", attrs: { href: "/contact" } }, [_vm._v("Contact us")] ) ]), _vm._v(" "), _c("li", { staticClass: "nav-item cta" }, [ _c( "a", { staticClass: "nav-link", attrs: { href: "/quete" } }, [_vm._v(" Get Quete")] ) ]) ]) ] ) ]) ] ) } ] render._withStripped = true /***/ }), /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/Pages/vue/pageCiecle.vue?vue&type=template&id=3582dade&": /*!*********************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/Pages/vue/pageCiecle.vue?vue&type=template&id=3582dade& ***! \*********************************************************************************************************************************************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "render": () => (/* binding */ render), /* harmony export */ "staticRenderFns": () => (/* binding */ staticRenderFns) /* harmony export */ }); var render = function() { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _vm._m(0) } var staticRenderFns = [ function() { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _c("div", { staticClass: "row mt-5" }, [ _c("div", { staticClass: "col text-center" }, [ _c("div", { staticClass: "block-27" }, [ _c("ul", [ _c("li", [_c("a", { attrs: { href: "#" } }, [_vm._v("<")])]), _vm._v(" "), _c("li", { staticClass: "active" }, [_c("span", [_vm._v("1")])]), _vm._v(" "), _c("li", [_c("a", { attrs: { href: "#" } }, [_vm._v("2")])]), _vm._v(" "), _c("li", [_c("a", { attrs: { href: "#" } }, [_vm._v("3")])]), _vm._v(" "), _c("li", [_c("a", { attrs: { href: "#" } }, [_vm._v("4")])]), _vm._v(" "), _c("li", [_c("a", { attrs: { href: "#" } }, [_vm._v("5")])]), _vm._v(" "), _c("li", [_c("a", { attrs: { href: "#" } }, [_vm._v(">")])]) ]) ]) ]) ]) } ] render._withStripped = true /***/ }), /***/ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js": /*!********************************************************************!*\ !*** ./node_modules/vue-loader/lib/runtime/componentNormalizer.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ normalizeComponent) /* harmony export */ }); /* globals __VUE_SSR_CONTEXT__ */ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules). // This module is a runtime utility for cleaner component module output and will // be included in the final webpack user bundle. function normalizeComponent ( scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, /* server only */ shadowMode /* vue-cli only */ ) { // Vue.extend constructor export interop var options = typeof scriptExports === 'function' ? scriptExports.options : scriptExports // render functions if (render) { options.render = render options.staticRenderFns = staticRenderFns options._compiled = true } // functional template if (functionalTemplate) { options.functional = true } // scopedId if (scopeId) { options._scopeId = 'data-v-' + scopeId } var hook if (moduleIdentifier) { // server build hook = function (context) { // 2.3 injection context = context || // cached call (this.$vnode && this.$vnode.ssrContext) || // stateful (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional // 2.2 with runInNewContext: true if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { context = __VUE_SSR_CONTEXT__ } // inject component styles if (injectStyles) { injectStyles.call(this, context) } // register component module identifier for async chunk inferrence if (context && context._registeredComponents) { context._registeredComponents.add(moduleIdentifier) } } // used by ssr in case component is cached and beforeCreate // never gets called options._ssrRegister = hook } else if (injectStyles) { hook = shadowMode ? function () { injectStyles.call( this, (options.functional ? this.parent : this).$root.$options.shadowRoot ) } : injectStyles } if (hook) { if (options.functional) { // for template-only hot-reload because in that case the render fn doesn't // go through the normalizer options._injectStyles = hook // register for functional component in vue file var originalRender = options.render options.render = function renderWithStyleInjection (h, context) { hook.call(context) return originalRender(h, context) } } else { // inject component registration as beforeCreate hook var existing = options.beforeCreate options.beforeCreate = existing ? [].concat(existing, hook) : [hook] } } return { exports: scriptExports, options: options } } /***/ }) }]);
42.438453
673
0.52087
c1dba00367e842dba0c3f4c104452349c5a62876
1,654
js
JavaScript
src/components/layout/layout.js
chrisberry-io/think-small
5401a8af4ae5e4024cfa2f7ab3697d2bf0dab16d
[ "MIT" ]
null
null
null
src/components/layout/layout.js
chrisberry-io/think-small
5401a8af4ae5e4024cfa2f7ab3697d2bf0dab16d
[ "MIT" ]
null
null
null
src/components/layout/layout.js
chrisberry-io/think-small
5401a8af4ae5e4024cfa2f7ab3697d2bf0dab16d
[ "MIT" ]
null
null
null
import React from "react" import { Link } from "gatsby" import { Helmet } from "react-helmet" import "./layout.scss" import styled from "styled-components" import gatsbylogo from "../../../content/assets/vectors/Gatsby-Monogram.svg" const Wrapper = styled.div` background: linear-gradient(to bottom, #00bcd4 0%, #9c27b0 100%); padding-left: 10px; ` const Content = styled.div` background: linear-gradient(180deg, rgba(16, 14, 23, 0.87) 0%, #100E17 92.76%), linear-gradient(116.32deg, #CC00FF 0%, #00F0FF 85.06%); position: relative; z-index: 0; p, ul { line-height: 1.5; margin: 10px 0; } li { list-style-type: initial; line-height: 1.5; } footer{ color: #827AA0; height: 200px; display: flex; align-items: center; justify-content: center; img{ width: auto; height: 16px; display: inline-block; } } ` const Layout = (props) =>{ const { children } = props return ( <Wrapper className="font-body"> <Content> <Helmet> <link href="https://fonts.googleapis.com/css?family=Hind:400,500,600,700|Noto+Sans:400,400i,700,700i&display=swap" rel="stylesheet" /> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/> </Helmet> <main>{children}</main> <footer> © {new Date().getFullYear()} Chris Berry, Made with 🍺, 🦄, and&nbsp;<a href="https://www.gatsbyjs.org"><img src={gatsbylogo} alt="Gatsby" /></a> </footer> </Content> </Wrapper> ) } export default Layout
27.566667
155
0.595526
c1dbb9541265e77bf91ffd1cb837efb7abed400f
3,725
js
JavaScript
vendor/plugins/flot/jquery.flot.grow.min.js
dianyanzen/visualisasi
38cf3e421cb6859b9eaafd487aedb026fb1ee400
[ "MIT" ]
null
null
null
vendor/plugins/flot/jquery.flot.grow.min.js
dianyanzen/visualisasi
38cf3e421cb6859b9eaafd487aedb026fb1ee400
[ "MIT" ]
null
null
null
vendor/plugins/flot/jquery.flot.grow.min.js
dianyanzen/visualisasi
38cf3e421cb6859b9eaafd487aedb026fb1ee400
[ "MIT" ]
null
null
null
(function($){var pluginName="grow",pluginVersion="0.4";var options={series:{grow:{active:false,stepDelay:20,steps:100,growings:[{valueIndex:1,stepMode:"linear",stepDirection:"up"}]}}};function init(plot){var done=false;var growfunc;var plt=plot;var data=null;var opt=null;var serie=null;var valueIndex;plot.hooks.bindEvents.push(processbindEvents);plot.hooks.drawSeries.push(processSeries);plot.hooks.shutdown.push(shutdown);function processSeries(plot,canvascontext,series){opt=plot.getOptions();valueIndex= opt.series.grow.valueIndex;if(opt.series.grow.active===true)if(done===false){data=plot.getData();data.actualStep=0;data.growingIndex=0;for(var j=0;j<data.length;j++){data[j].dataOrg=clone(data[j].data);for(var i=0;i<data[j].data.length;i++)data[j].data[i][valueIndex]=0}plot.setData(data);done=true}}function processbindEvents(plot,eventHolder){opt=plot.getOptions();if(opt.series.grow.active===true){var d=plot.getData();for(var j=0;j<data.length;j++)opt.series.grow.steps=Math.max(opt.series.grow.steps, d[j].grow.steps);if(opt.series.grow.stepDelay===0)opt.series.grow.stepDelay++;growingLoop();if(isPluginRegistered("resize"))plot.getPlaceholder().bind("resize",onResize)}}function growingLoop(){var growing,startTime=new Date,timeDiff;if(data.actualStep<opt.series.grow.steps){data.actualStep++;for(var j=0;j<data.length;j++)for(var g=0;g<data[j].grow.growings.length;g++){growing=data[j].grow.growings[g];if(typeof growing.stepMode==="function")growing.stepMode(data[j],data.actualStep,growing);else if(growing.stepMode=== "linear")growLinear();else if(growing.stepMode==="maximum")growMaximum();else if(growing.stepMode==="delay")growDelay();else growNone()}plt.setData(data);plt.draw();timeDiff=new Date-startTime;growfunc=window.setTimeout(growingLoop,Math.max(0,opt.series.grow.stepDelay-timeDiff))}else{window.clearTimeout(growfunc);growfunc=null}function growNone(){if(data.actualStep===1)for(var i=0;i<data[j].data.length;i++)data[j].data[i][valueIndex]=data[j].dataOrg[i][growing.valueIndex]}function growLinear(){if(data.actualStep<= data[j].grow.steps)for(var i=0;i<data[j].data.length;i++)if(growing.stepDirection==="up")data[j].data[i][growing.valueIndex]=data[j].dataOrg[i][growing.valueIndex]/data[j].grow.steps*data.actualStep;else if(growing.stepDirection==="down")data[j].data[i][growing.valueIndex]=data[j].dataOrg[i][growing.valueIndex]+(data[j].yaxis.max-data[j].dataOrg[i][growing.valueIndex])/data[j].grow.steps*(data[j].grow.steps-data.actualStep)}function growMaximum(){if(data.actualStep<=data[j].grow.steps)for(var i=0;i< data[j].data.length;i++)if(growing.stepDirection==="up")data[j].data[i][growing.valueIndex]=Math.min(data[j].dataOrg[i][growing.valueIndex],data[j].yaxis.max/data[j].grow.steps*data.actualStep);else if(growing.stepDirection==="down")data[j].data[i][growing.valueIndex]=Math.max(data[j].dataOrg[i][growing.valueIndex],data[j].yaxis.max/data[j].grow.steps*(data[j].grow.steps-data.actualStep))}function growDelay(){if(data.actualStep==data[j].grow.steps)for(var i=0;i<data[j].data.length;i++)data[j].data[i][growing.valueIndex]= data[j].dataOrg[i][growing.valueIndex]}}function onResize(){if(growfunc){window.clearTimeout(growfunc);growfunc=null}}function shutdown(plot,eventHolder){plot.getPlaceholder().unbind("resize",onResize)}function isPluginRegistered(pluginName){var plugins=$.plot.plugins;for(var i=0,len=plugins.length;i<len;i++){var plug=plugins[i];if(plug.name===pluginName)return true}return false}function clone(obj){if(obj===null||typeof obj!=="object")return obj;var temp=new obj.constructor;for(var key in obj)temp[key]= clone(obj[key]);return temp}}$.plot.plugins.push({init:init,options:options,name:pluginName,version:pluginVersion})})(jQuery);
465.625
526
0.769128
c1dbf6ad8fe2268c5183eacee8e471621ce6c68d
10,943
js
JavaScript
client/src/components/views/Thrusters/core.js
cavalier99/thorium
394e9388f685605141aa6ca372061c71ab395946
[ "Apache-2.0" ]
null
null
null
client/src/components/views/Thrusters/core.js
cavalier99/thorium
394e9388f685605141aa6ca372061c71ab395946
[ "Apache-2.0" ]
null
null
null
client/src/components/views/Thrusters/core.js
cavalier99/thorium
394e9388f685605141aa6ca372061c71ab395946
[ "Apache-2.0" ]
null
null
null
import React, { Fragment, Component } from "react"; import gql from "graphql-tag.macro"; import { Mutation, graphql, withApollo } from "react-apollo"; import { Container, Row, Col, Input } from "helpers/reactstrap"; import { InputField, OutputField } from "../../generic/core"; import SubscriptionHelper from "helpers/subscriptionHelper"; import FontAwesome from "react-fontawesome"; const ROTATION_CHANGE_SUB = gql` subscription RotationChanged($simulatorId: ID) { rotationChange(simulatorId: $simulatorId) { id direction { x y z } rotation { yaw pitch roll } rotationDelta { yaw pitch roll } rotationRequired { yaw pitch roll } manualThrusters rotationSpeed movementSpeed damage { damaged report } power { power powerLevels } } } `; class ThrusterCore extends Component { toggleManualThrusters = () => {}; setRequiredRotation = (which, value) => { const mutation = gql` mutation SetRequiredThrusters($id: ID!, $rotation: RotationInput) { requiredRotationSet(id: $id, rotation: $rotation) } `; const thrusters = this.props.data.thrusters[0]; const rotation = Object.assign( {}, { yaw: thrusters.rotationRequired.yaw, pitch: thrusters.rotationRequired.pitch, roll: thrusters.rotationRequired.roll } ); rotation[which] = value; const variables = { id: thrusters.id, rotation }; this.props.client.mutate({ mutation, variables }); }; render() { if (this.props.data.loading || !this.props.data.thrusters) return null; const thrusters = this.props.data.thrusters[0]; if (!thrusters) return <p>No Thrusters</p>; return ( <Container className="thrustersCore" fluid> <SubscriptionHelper subscribe={() => this.props.data.subscribeToMore({ document: ROTATION_CHANGE_SUB, variables: { simulatorId: this.props.simulator.id }, updateQuery: (previousResult, { subscriptionData }) => { return Object.assign({}, previousResult, { thrusters: [subscriptionData.data.rotationChange] }); } }) } /> {/*<label><input type="checkbox" onClick={this.toggleManualThrusters} /> Manual Thrusters</label>*/} <Row> <Col sm={4}>Yaw</Col> <Col sm={4}>Pitch</Col> <Col sm={4}>Roll</Col> <Col sm={4}> <OutputField> {Math.floor(thrusters.rotation && thrusters.rotation.yaw)} </OutputField> </Col> <Col sm={4}> <OutputField> {Math.floor(thrusters.rotation && thrusters.rotation.pitch)} </OutputField> </Col> <Col sm={4}> <OutputField> {Math.floor(thrusters.rotation && thrusters.rotation.roll)} </OutputField> </Col> {thrusters && thrusters.rotationRequired && ( <Fragment> <Col sm={4}> <InputField alert={ Math.round(thrusters.rotation && thrusters.rotation.yaw) !== Math.round(thrusters.rotationRequired.yaw) } prompt="What is the required yaw?" onClick={value => { this.setRequiredRotation( "yaw", Math.min(359, Math.max(0, value)) ); }} > {Math.round(thrusters.rotationRequired.yaw)} </InputField> </Col> <Col sm={4}> <InputField alert={ Math.round(thrusters.rotation.pitch) !== Math.round(thrusters.rotationRequired.pitch) } prompt="What is the required pitch?" onClick={value => { this.setRequiredRotation( "pitch", Math.min(359, Math.max(0, value)) ); }} > {Math.round(thrusters.rotationRequired.pitch)} </InputField> </Col> <Col sm={4}> <InputField alert={ Math.round(thrusters.rotation.roll) !== Math.round(thrusters.rotationRequired.roll) } prompt="What is the required roll?" onClick={value => { this.setRequiredRotation( "roll", Math.min(359, Math.max(0, value)) ); }} > {Math.round(thrusters.rotationRequired.roll)} </InputField> </Col> </Fragment> )} {thrusters.direction && ( <Fragment> <ThrusterArrow name="arrow-circle-down" value={ thrusters.direction.z < 0 ? Math.abs(thrusters.direction.z) : 0 } /> <ThrusterArrow name="arrow-up" value={ thrusters.direction.y > 0 ? Math.abs(thrusters.direction.y) : 0 } /> <ThrusterArrow name="arrow-circle-up" value={ thrusters.direction.z > 0 ? Math.abs(thrusters.direction.z) : 0 } /> <ThrusterArrow name="arrow-left" value={ thrusters.direction.x < 0 ? Math.abs(thrusters.direction.x) : 0 } /> <ThrusterArrow name="arrow-down" value={ thrusters.direction.y < 0 ? Math.abs(thrusters.direction.y) : 0 } /> <ThrusterArrow name="arrow-right" value={ thrusters.direction.x > 0 ? Math.abs(thrusters.direction.x) : 0 } /> </Fragment> )} </Row> <Row> <Col sm={6}> <label>Rotation Speed</label> <Mutation mutation={gql` mutation UpdateThrusterRotation($id: ID!, $speed: Float!) { setThrusterRotationSpeed(id: $id, speed: $speed) } `} > {action => ( <Input type="select" style={{ height: "18px" }} value={thrusters.rotationSpeed} onChange={e => { action({ variables: { id: thrusters.id, speed: parseFloat(e.target.value) } }); }} > <option value={0}>0</option> <option value={0.2}>0.2</option> <option value={0.5}>0.5</option> <option value={1}>1</option> <option value={2}>2</option> <option value={3}>3</option> <option value={4}>4</option> <option value={5}>5</option> <option value={6}>6</option> <option value={7}>7</option> <option value={8}>8</option> <option value={9}>9</option> <option value={10}>10 - Fast</option> </Input> )} </Mutation> </Col> <Col sm={6}> <label>Movement Speed (Sensors Auto-thrusters)</label> <Mutation mutation={gql` mutation UpdateThrusterMovement($id: ID!, $speed: Float!) { setThrusterMovementSpeed(id: $id, speed: $speed) } `} > {action => ( <Input type="select" style={{ height: "18px" }} value={thrusters.movementSpeed} onChange={e => { action({ variables: { id: thrusters.id, speed: parseFloat(e.target.value) } }); }} > <option value={0}>0</option> <option value={0.2}>0.2</option> <option value={0.5}>0.5</option> <option value={1}>1</option> <option value={2}>2</option> <option value={3}>3</option> <option value={4}>4</option> <option value={5}>5</option> <option value={6}>6</option> <option value={7}>7</option> <option value={8}>8</option> <option value={9}>9</option> <option value={10}>10 - Fast</option> </Input> )} </Mutation> </Col> </Row> </Container> ); } } const ThrusterArrow = ({ name, value }) => { return ( <Col sm={4} className="thruster-symbol"> <FontAwesome name={name} size="lg" style={{ margin: "2px", color: `rgb(${Math.round(value * 255)},${Math.round( value * 255 )},${Math.round(value * 255)})` }} /> </Col> ); }; const THRUSTER_QUERY = gql` query Thrusters($simulatorId: ID) { thrusters(simulatorId: $simulatorId) { id direction { x y z } rotation { yaw pitch roll } rotationDelta { yaw pitch roll } rotationRequired { yaw pitch roll } manualThrusters rotationSpeed movementSpeed damage { damaged report } power { power powerLevels } } } `; export default graphql(THRUSTER_QUERY, { options: ownProps => ({ fetchPolicy: "cache-and-network", variables: { simulatorId: ownProps.simulator.id } }) })(withApollo(ThrusterCore));
29.416667
108
0.426848
c1dd712fa4396259b6ee68976a409f3e1ad756aa
532
js
JavaScript
packages/components/pages/f-checkout/stories/api/responses/getAddress.js
dawidchar/fozzie-components
d7f40ff866de727e3d9839b11e774e49f5562521
[ "Apache-2.0" ]
null
null
null
packages/components/pages/f-checkout/stories/api/responses/getAddress.js
dawidchar/fozzie-components
d7f40ff866de727e3d9839b11e774e49f5562521
[ "Apache-2.0" ]
null
null
null
packages/components/pages/f-checkout/stories/api/responses/getAddress.js
dawidchar/fozzie-components
d7f40ff866de727e3d9839b11e774e49f5562521
[ "Apache-2.0" ]
null
null
null
import { Addresses } from '../../helpers/addresses'; import { getSuccess, TENANTS } from '../../helpers'; function getAddress (tenant) { return { ...Addresses[tenant] }; } function buildAddresses () { const tenantRequests = []; Object.values(TENANTS).forEach(tenant => { tenantRequests.push({ url: `/get-address-${tenant}`, ...getSuccess, payload: getAddress(tenant) }); }); return tenantRequests; } export default [ ...buildAddresses() ];
20.461538
52
0.571429
c1dd783f6c85816457d19d7bef45b72a3c87c345
2,169
js
JavaScript
_includes/scripts/lib/modal.js
JL233/jl233.github.io
cd9536d0ad9cded163149db1b138a8b734cadf04
[ "MIT" ]
1
2018-04-30T11:51:42.000Z
2018-04-30T11:51:42.000Z
_includes/scripts/lib/modal.js
pengloo53/jekyll-TeXt-theme
69d6140e612f40ded48c521e8ff43f6699545a7b
[ "MIT" ]
13
2020-02-13T17:38:56.000Z
2021-09-28T00:44:44.000Z
_includes/scripts/lib/modal.js
JinluZhang1126/jinluzhang1126.github.io
e5abb21a0aa8b11dc6fd8f67d40601a747605f70
[ "MIT" ]
1
2022-02-13T06:35:26.000Z
2022-02-13T06:35:26.000Z
(function() { var SOURCES = window.TEXT_VARIABLES.sources; window.Lazyload.js(SOURCES.jquery, function() { var $body = $('body'), $window = $(window); var $pageRoot = $('.js-page-root'), $pageMain = $('.js-page-main'); var activeCount = 0; function modal(options) { var $root = this, visible, onChange, hideWhenWindowScroll = false; var scrollTop; function setOptions(options) { var _options = options || {}; visible = _options.initialVisible === undefined ? false : show; onChange = _options.onChange; hideWhenWindowScroll = _options.hideWhenWindowScroll; } function init() { setState(visible); } function setState(isShow) { if (isShow === visible) { return; } visible = isShow; if (visible) { activeCount++; scrollTop = $(window).scrollTop() || $pageMain.scrollTop(); $root.addClass('modal--show'); $pageMain.scrollTop(scrollTop); activeCount === 1 && ($pageRoot.addClass('show-modal'), $body.addClass('of-hidden')); hideWhenWindowScroll && window.hasEvent('touchstart') && $window.on('scroll', hide); $window.on('keyup', handleKeyup); } else { activeCount > 0 && activeCount--; $root.removeClass('modal--show'); $window.scrollTop(scrollTop); activeCount === 0 && ($pageRoot.removeClass('show-modal'), $body.removeClass('of-hidden')); hideWhenWindowScroll && window.hasEvent('touchstart') && $window.off('scroll', hide); $window.off('keyup', handleKeyup); } onChange && onChange(visible); } function show() { setState(true); } function hide() { setState(false); } function handleKeyup(e) { // Char Code: 27 ESC if (e.which === 27) { hide(); } } setOptions(options); init(); return { show: show, hide: hide, $el: $root }; } $.fn.modal = modal; }); })();
33.369231
102
0.527432
c1dda73a6099e2f2cfe89e8f57ff3feaf25de1da
114
js
JavaScript
www/components/core/app.constants.js
balena-io-playground/balena-configurator-client
684c906ab59631a5f0d9e8a424414f1ba895cfdc
[ "Apache-2.0" ]
4
2018-11-26T13:12:07.000Z
2020-11-09T12:20:21.000Z
www/components/core/app.constants.js
balena-io-playground/balena-configurator-client
684c906ab59631a5f0d9e8a424414f1ba895cfdc
[ "Apache-2.0" ]
null
null
null
www/components/core/app.constants.js
balena-io-playground/balena-configurator-client
684c906ab59631a5f0d9e8a424414f1ba895cfdc
[ "Apache-2.0" ]
null
null
null
(function() { 'use strict'; angular .module('bluetoothConfig') .constant('ServerIP', '');//FIXME })();
11.4
35
0.578947
c1de1fce61f0c1bc119e9beb1007a88bab5014be
949
js
JavaScript
server.js
siddrc/session-help
f91d26aa2a90f97a125dfa6b23e433eead1979d4
[ "Apache-2.0" ]
null
null
null
server.js
siddrc/session-help
f91d26aa2a90f97a125dfa6b23e433eead1979d4
[ "Apache-2.0" ]
null
null
null
server.js
siddrc/session-help
f91d26aa2a90f97a125dfa6b23e433eead1979d4
[ "Apache-2.0" ]
null
null
null
const express = require('express'); const path = require('path'); const bodyParser = require('body-parser'); const cors = require('cors'); const mongoose = require('mongoose'); const config = require('./config/DB'); const app = express(); const session = require('express-session'); const cookieParser = require('cookie-parser'); app.use(cookieParser()); app.use(session({ secret: 'keyboard cat', cookie: { secure: false, expires: new Date(Date.now() + (90 * 86400 * 1000)) }, resave: true, saveUninitialized: true })); mongoose.Promise = global.Promise; const signUpRoutes = require('./routes/signup.route'); const logInRoutes = require('./routes/login.route'); app.use(bodyParser.json()); app.use(cors()); const port = process.env.PORT || 4000; app.use('/signup', signUpRoutes); app.use('/login', logInRoutes); const server = app.listen(port, function() { console.log('Listening on port ' + port); });
35.148148
84
0.670179
c1de459c4c001a4493d95d6330e59fe3185017a2
952
js
JavaScript
js/index.js
ZeroHang/proyecto-clases-UP-
c4b3d8732f7fcc2fbeda427733be65ec449baa9d
[ "MIT" ]
null
null
null
js/index.js
ZeroHang/proyecto-clases-UP-
c4b3d8732f7fcc2fbeda427733be65ec449baa9d
[ "MIT" ]
null
null
null
js/index.js
ZeroHang/proyecto-clases-UP-
c4b3d8732f7fcc2fbeda427733be65ec449baa9d
[ "MIT" ]
null
null
null
var usuarioGuardado = sessionStorage.getItem('usuarioLogueado'); if (usuarioGuardado) { usuarioGuardado = JSON.parse(usuarioGuardado); $('#login').text(usuarioGuardado.usuario); $('#login').parent().addClass('dropdown'); $('#login').addClass('dropdown-toggle'); $('#login').attr('href', '#'); $('#login').attr('data-toggle', 'dropdown'); $('#login').attr('aria-haspopup', 'true'); $('#login').attr('aria-expanded', 'false'); var div = document.createElement('div'); $(div).addClass('dropdown-menu', 'dropdown-menu-right'); $(div).attr('aria-labelledby', 'login'); $('<a class="dropdown-item" href="miperfil.html">Mi Perfil</a>').appendTo(div); $('<a class="dropdown-item" href="misordenes.html">Mis Ordenes</a>').appendTo(div); $('<a class="dropdown-item" href="javascript:void(0);" onclick="logout()">Logout</a>').appendTo(div); $('#login').parent().append(div); } traerProductosPrincipal();
50.105263
105
0.635504
c1de6ad813fb1289e1e272af777595efec1348aa
8,430
js
JavaScript
node_modules/@react-spring/addons/parallax.cjs.js
BW-Hair-Care/Frontend
edc11d890c378eea0e313df605b96366312e720b
[ "MIT" ]
null
null
null
node_modules/@react-spring/addons/parallax.cjs.js
BW-Hair-Care/Frontend
edc11d890c378eea0e313df605b96366312e720b
[ "MIT" ]
4
2021-03-09T23:38:01.000Z
2022-02-26T20:26:29.000Z
node_modules/@react-spring/addons/parallax.cjs.js
BW-Hair-Care/Frontend
edc11d890c378eea0e313df605b96366312e720b
[ "MIT" ]
null
null
null
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } var _extends = _interopDefault(require('@babel/runtime/helpers/extends')); var _objectWithoutPropertiesLoose = _interopDefault(require('@babel/runtime/helpers/objectWithoutPropertiesLoose')); var React = require('react'); var React__default = _interopDefault(React); var globals = require('@react-spring/shared/globals'); var core = require('@react-spring/core/index.cjs.js'); var animated = require('@react-spring/animated/index.cjs.js'); var useMemoOne = require('use-memo-one'); var shared = require('@react-spring/shared'); var AnimatedView = animated.withAnimated(globals.defaultElement); var ParentContext = React__default.createContext(null); function getScrollType(horizontal) { return horizontal ? 'scrollLeft' : 'scrollTop'; } var START_TRANSLATE_3D = 'translate3d(0px,0px,0px)'; var START_TRANSLATE = 'translate(0px,0px)'; var ParallaxLayer = React__default.memo(function (_ref) { var _extends2; var horizontal = _ref.horizontal, _ref$factor = _ref.factor, factor = _ref$factor === void 0 ? 1 : _ref$factor, _ref$offset = _ref.offset, offset = _ref$offset === void 0 ? 0 : _ref$offset, _ref$speed = _ref.speed, speed = _ref$speed === void 0 ? 0 : _ref$speed, rest = _objectWithoutPropertiesLoose(_ref, ["horizontal", "factor", "offset", "speed"]); // Our parent controls our height and position. var parent = React.useContext(ParentContext); // This is how we animate. var ctrl = useMemoOne.useMemoOne(function () { var targetScroll = Math.floor(offset) * parent.space; var distance = parent.space * offset + targetScroll * speed; return new core.Controller({ space: parent.space * factor, translate: -(parent.current * speed) + distance }); }, []); // Create the layer. var layer = useMemoOne.useMemoOne(function () { return { setPosition: function setPosition(height, scrollTop, immediate) { if (immediate === void 0) { immediate = false; } var targetScroll = Math.floor(offset) * height; var distance = height * offset + targetScroll * speed; ctrl.start({ translate: -(scrollTop * speed) + distance, config: parent.config, immediate: immediate }); }, setHeight: function setHeight(height, immediate) { if (immediate === void 0) { immediate = false; } ctrl.start({ space: height * factor, config: parent.config, immediate: immediate }); } }; }, []); // Register the layer with our parent. shared.useOnce(function () { if (parent) { parent.layers.add(layer); parent.update(); return function () { parent.layers.delete(layer); parent.update(); }; } }); var translate3d = ctrl.get('translate').to(horizontal ? function (x) { return "translate3d(" + x + "px,0,0)"; } : function (y) { return "translate3d(0," + y + "px,0)"; }); return React__default.createElement(AnimatedView, Object.assign({}, rest, { style: _extends((_extends2 = { position: 'absolute', backgroundSize: 'auto', backgroundRepeat: 'no-repeat', willChange: 'transform' }, _extends2[horizontal ? 'height' : 'width'] = '100%', _extends2[horizontal ? 'width' : 'height'] = ctrl.get('space'), _extends2.WebkitTransform = translate3d, _extends2.MsTransform = translate3d, _extends2.transform = translate3d, _extends2), rest.style) })); return null; }); var Parallax = React__default.memo(function (_ref2) { var _extends3; var pages = _ref2.pages, _ref2$config = _ref2.config, config = _ref2$config === void 0 ? core.config.slow : _ref2$config, _ref2$enabled = _ref2.enabled, enabled = _ref2$enabled === void 0 ? true : _ref2$enabled, _ref2$horizontal = _ref2.horizontal, horizontal = _ref2$horizontal === void 0 ? false : _ref2$horizontal, innerStyle = _ref2.innerStyle, rest = _objectWithoutPropertiesLoose(_ref2, ["pages", "config", "enabled", "horizontal", "innerStyle"]); var _useState = React.useState(false), ready = _useState[0], setReady = _useState[1]; var state; state = useMemoOne.useMemoOne(function () { return { config: config, busy: false, space: 0, current: 0, offset: 0, controller: new core.Controller({ scroll: 0 }), layers: new Set(), update: function update() { return _update(); }, scrollTo: function scrollTo(offset) { return _scrollTo(offset); }, stop: function stop() { return state.controller.stop(); } }; }, []); React.useEffect(function () { state.config = config; }, [config]); var containerRef = React.useRef(); var contentRef = React.useRef(); var _update = function _update() { var container = containerRef.current; if (!container) return; var spaceProp = horizontal ? 'clientWidth' : 'clientHeight'; state.space = container[spaceProp]; var scrollType = getScrollType(horizontal); if (enabled) { state.current = container[scrollType]; } else { container[scrollType] = state.current = state.offset * state.space; } var content = contentRef.current; if (content) { var sizeProp = horizontal ? 'width' : 'height'; content.style[sizeProp] = state.space * pages + "px"; } state.layers.forEach(function (layer) { layer.setHeight(state.space, true); layer.setPosition(state.space, state.current, true); }); }; var _scrollTo = function _scrollTo(offset) { var container = containerRef.current; var scrollType = getScrollType(horizontal); state.offset = offset; state.controller.stop().start({ scroll: offset * state.space, config: config, onFrame: function onFrame(_ref3) { var scroll = _ref3.scroll; container[scrollType] = scroll; } }); }; var onScroll = function onScroll(event) { if (!state.busy) { state.busy = true; state.current = event.target[getScrollType(horizontal)]; globals.frameLoop.onFrame(function () { state.layers.forEach(function (layer) { return layer.setPosition(state.space, state.current); }); state.busy = false; }); } }; React.useEffect(function () { return state.update(); }); shared.useOnce(function () { setReady(true); var onResize = function onResize() { var update = function update() { return state.update(); }; globals.frameLoop.onFrame(update); setTimeout(update, 150); // Some browsers don't fire on maximize! }; window.addEventListener('resize', onResize, false); return function () { return window.removeEventListener('resize', onResize, false); }; }); var overflow = enabled ? 'scroll' : 'hidden'; return React__default.createElement(globals.defaultElement, Object.assign({}, rest, { ref: containerRef, onScroll: onScroll, onWheel: enabled ? state.stop : null, onTouchStart: enabled ? state.stop : null, style: _extends({ position: 'absolute', width: '100%', height: '100%', overflow: overflow, overflowY: horizontal ? 'hidden' : overflow, overflowX: horizontal ? overflow : 'hidden', WebkitOverflowScrolling: 'touch', WebkitTransform: START_TRANSLATE, MsTransform: START_TRANSLATE, transform: START_TRANSLATE_3D }, rest.style) }), ready && React__default.createElement(globals.defaultElement, { ref: contentRef, style: _extends((_extends3 = { overflow: 'hidden', position: 'absolute' }, _extends3[horizontal ? 'height' : 'width'] = '100%', _extends3[horizontal ? 'width' : 'height'] = state.space * pages, _extends3.WebkitTransform = START_TRANSLATE, _extends3.MsTransform = START_TRANSLATE, _extends3.transform = START_TRANSLATE_3D, _extends3), innerStyle) }, React__default.createElement(ParentContext.Provider, { value: state }, rest.children))); }); exports.Parallax = Parallax; exports.ParallaxLayer = ParallaxLayer; //# sourceMappingURL=parallax.cjs.js.map
33.058824
277
0.639976
c1de754d8ffa61617115353a08ee4704695d6344
770
js
JavaScript
spring-boot-admin-panel/src/pages/Home/Home.js
cthanhnguyendn/cyan-boot-admin
6acc9712965dc589cb123bc36b2ccc6eb3e70e8a
[ "Apache-2.0" ]
null
null
null
spring-boot-admin-panel/src/pages/Home/Home.js
cthanhnguyendn/cyan-boot-admin
6acc9712965dc589cb123bc36b2ccc6eb3e70e8a
[ "Apache-2.0" ]
4
2021-03-10T13:44:16.000Z
2022-02-27T02:36:42.000Z
spring-boot-admin-panel/src/pages/Home/Home.js
cthanhnguyendn/cyan-boot-admin
6acc9712965dc589cb123bc36b2ccc6eb3e70e8a
[ "Apache-2.0" ]
null
null
null
import React from "react"; import {useSelector} from "react-redux"; import {Link} from "react-router-dom"; export default () => { const meta = useSelector(state => state.meta) return ( <div> <h1>Home</h1> <table className="table"> <thead> <tr> <th scope="col">Name</th> <th scope="col">Path</th> </tr> </thead> <tbody> {meta.restEndPoints && meta.restEndPoints.map(ep => (<tr> <td><Link to={`/${ep.entityName}`}>{ ep.entityName }</Link></td> <td>{ ep.path }</td> </tr>))} </tbody> </table> </div>) }
28.518519
84
0.411688
c1dec9528e982520daa3a734f8dc4e8dd50a9521
182
js
JavaScript
class_es_1_1_ink_painter_1_1_sample_1_1_mouse_painter.js
EsProgram/UnityTexturePaintDocument
027ef78536e052f62d711c0776056223e3167d76
[ "MIT" ]
4
2016-11-19T12:05:22.000Z
2017-03-02T12:31:11.000Z
class_es_1_1_ink_painter_1_1_sample_1_1_mouse_painter.js
EsProgram/UnityTexturePaintDocument
027ef78536e052f62d711c0776056223e3167d76
[ "MIT" ]
null
null
null
class_es_1_1_ink_painter_1_1_sample_1_1_mouse_painter.js
EsProgram/UnityTexturePaintDocument
027ef78536e052f62d711c0776056223e3167d76
[ "MIT" ]
1
2019-02-24T17:50:21.000Z
2019-02-24T17:50:21.000Z
var class_es_1_1_ink_painter_1_1_sample_1_1_mouse_painter = [ [ "OnGUI", "class_es_1_1_ink_painter_1_1_sample_1_1_mouse_painter.html#a972bd09ddd8e4ace63fd01a9d778f68a", null ] ];
45.5
117
0.851648
c1df2ccaad64e681a664e267fc831c2437bdca3c
306
js
JavaScript
analysis/stack-trace/stack-trace.js
Hongbo-Miao/node-clinic-bubbleprof
813112f9b8f6e554dc9a3cce95e13edf48d64b3c
[ "MIT" ]
22
2020-08-28T08:45:08.000Z
2022-03-26T22:01:56.000Z
analysis/stack-trace/stack-trace.js
Hongbo-Miao/node-clinic-bubbleprof
813112f9b8f6e554dc9a3cce95e13edf48d64b3c
[ "MIT" ]
16
2020-11-25T17:15:22.000Z
2022-03-31T15:54:37.000Z
analysis/stack-trace/stack-trace.js
Hongbo-Miao/node-clinic-bubbleprof
813112f9b8f6e554dc9a3cce95e13edf48d64b3c
[ "MIT" ]
6
2020-10-02T09:41:15.000Z
2021-12-21T11:10:35.000Z
'use strict' const Frames = require('./frames.js') class StackTrace { constructor (data) { this.asyncId = data.asyncId this.frames = new Frames(data.frames) } toJSON () { return { asyncId: this.asyncId, frames: this.frames.toJSON() } } } module.exports = StackTrace
15.3
41
0.624183
c1e04eb28a3f36ca7b64a6ff7fd9f54b3f4f4497
4,880
js
JavaScript
packages/components/src/components/TaskRunDetails/TaskRunDetails.test.js
oneconvergence/tekton-dashboard
1f29bc533bc58fa0f966696128dcc59f19e8514d
[ "Apache-2.0" ]
null
null
null
packages/components/src/components/TaskRunDetails/TaskRunDetails.test.js
oneconvergence/tekton-dashboard
1f29bc533bc58fa0f966696128dcc59f19e8514d
[ "Apache-2.0" ]
null
null
null
packages/components/src/components/TaskRunDetails/TaskRunDetails.test.js
oneconvergence/tekton-dashboard
1f29bc533bc58fa0f966696128dcc59f19e8514d
[ "Apache-2.0" ]
null
null
null
/* Copyright 2020-2021 The Tekton Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ import React from 'react'; import { fireEvent } from '@testing-library/react'; import { render } from '../../utils/test'; import TaskRunDetails from './TaskRunDetails'; describe('TaskRunDetails', () => { it('renders task name and error state', () => { const taskRunName = 'task-run-name'; const status = 'error'; const { queryByText } = render( <TaskRunDetails taskRun={{ metadata: { name: taskRunName }, spec: {}, status }} /> ); expect(queryByText(taskRunName)).toBeTruthy(); expect(queryByText(status)).toBeTruthy(); }); it('renders task name and inputs', () => { const taskRunName = 'task-run-name'; const status = 'error'; const paramKey = 'k'; const paramValue = 'v'; const params = [{ name: paramKey, value: paramValue }]; const description = 'param_description'; const { queryByText } = render( <TaskRunDetails task={{ metadata: 'task', spec: { params: [{ name: paramKey, description }] } }} taskRun={{ metadata: { name: taskRunName }, spec: { params }, status }} /> ); expect(queryByText(taskRunName)).toBeTruthy(); expect(queryByText(paramKey)).toBeTruthy(); expect(queryByText(paramValue)).toBeTruthy(); expect(queryByText(description)).toBeTruthy(); }); it('renders params with description from inline taskSpec', () => { const taskRunName = 'task-run-name'; const status = 'error'; const paramKey = 'k'; const paramValue = 'v'; const params = [{ name: paramKey, value: paramValue }]; const description = 'param_description'; const { queryByText } = render( <TaskRunDetails taskRun={{ metadata: { name: taskRunName }, spec: { params, taskSpec: { params: [{ name: paramKey, description }] } }, status }} /> ); expect(queryByText(paramKey)).toBeTruthy(); expect(queryByText(paramValue)).toBeTruthy(); expect(queryByText(description)).toBeTruthy(); }); it('does not render parameters or results tabs when those fields are not present', () => { const taskRun = { metadata: { name: 'task-run-name' }, spec: {}, status: {} }; const { queryByText } = render(<TaskRunDetails taskRun={taskRun} />); expect(queryByText(/parameters/i)).toBeFalsy(); expect(queryByText(/results/i)).toBeFalsy(); expect(queryByText(/status/i)).toBeTruthy(); }); it('renders selected view', () => { const taskRun = { metadata: { name: 'task-run-name' }, spec: { params: [{ name: 'fake_name', value: 'fake_value' }] } }; const { queryByText, queryAllByText } = render( <TaskRunDetails taskRun={taskRun} view="status" /> ); expect(queryByText(/status/i)).toBeTruthy(); expect(queryAllByText(/pending/i)[0]).toBeTruthy(); expect(queryByText('fake_name')).toBeFalsy(); fireEvent.click(queryByText(/parameters/i)); expect(queryByText('fake_name')).toBeTruthy(); }); it('renders results', () => { const resultName = 'message'; const description = 'result_description'; const taskRun = { metadata: { name: 'task-run-name' }, spec: {}, status: { taskResults: [{ name: resultName, value: 'hello' }] } }; const { queryByText } = render( <TaskRunDetails task={{ metadata: 'task', spec: { results: [{ name: resultName, description }] } }} taskRun={taskRun} view="results" /> ); expect(queryByText(/results/i)).toBeTruthy(); expect(queryByText(/message/)).toBeTruthy(); expect(queryByText(/hello/)).toBeTruthy(); expect(queryByText(description)).toBeTruthy(); }); it('renders results with description from inline taskSpec', () => { const resultName = 'message'; const description = 'result_description'; const taskRun = { metadata: { name: 'task-run-name' }, spec: { taskSpec: { results: [{ name: resultName, description }] } }, status: { taskResults: [{ name: resultName, value: 'hello' }] } }; const { queryByText } = render( <TaskRunDetails taskRun={taskRun} view="results" /> ); expect(queryByText(description)).toBeTruthy(); }); });
32.751678
92
0.619672