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
28931dcbb891b06d69481f25728488d37abd7f79
8,975
js
JavaScript
seed/unpackedChallenge.js
VisheshSingh/freeCodeCamp
47e8d93ec4187b3aec8a128cfe56b86f2aaca822
[ "BSD-3-Clause" ]
1
2018-08-03T04:57:49.000Z
2018-08-03T04:57:49.000Z
seed/unpackedChallenge.js
VisheshSingh/freeCodeCamp
47e8d93ec4187b3aec8a128cfe56b86f2aaca822
[ "BSD-3-Clause" ]
1
2018-05-14T13:18:38.000Z
2018-05-14T13:18:38.000Z
seed/unpackedChallenge.js
VisheshSingh/freeCodeCamp
47e8d93ec4187b3aec8a128cfe56b86f2aaca822
[ "BSD-3-Clause" ]
1
2022-02-24T07:54:03.000Z
2022-02-24T07:54:03.000Z
/* eslint-disable no-inline-comments */ import fs from 'fs-extra'; import path from 'path'; import _ from 'lodash'; import { dasherize } from '../common/utils'; const jsonLinePrefix = '//--JSON:'; const paragraphBreak = '<!--break-->'; class ChallengeFile { constructor(dir, name, suffix) { this.dir = dir; this.name = name; this.suffix = suffix; } filePath() { return path.join(this.dir, this.name + this.suffix); } write(contents) { if (_.isArray(contents)) { contents = contents.join('\n'); } fs.writeFile(this.filePath(), contents, err => { if (err) { throw err; } }); } readChunks() { // todo: make this work async // todo: make sure it works with encodings let data = fs.readFileSync(this.filePath()); let lines = data.toString().split(/(?:\r\n|\r|\n)/g); let chunks = {}; let readingChunk = null; let currentParagraph = []; function removeLeadingEmptyLines(array) { let emptyString = /^\s*$/; while (array && Array.isArray(array) && emptyString.test(array[0])) { array.shift(); } } lines.forEach(line => { let chunkEnd = /(<!|\/\*)--end--/; let chunkStart = /(<!|\/\*)--(\w+)--/; line = line.toString(); function pushParagraph() { removeLeadingEmptyLines(currentParagraph); chunks[ readingChunk ].push(currentParagraph.join('\n')); currentParagraph = []; } if (chunkEnd.test(line)) { if (!readingChunk) { throw 'Encountered --end-- without being in a chunk'; } if (currentParagraph.length) { pushParagraph(); } else { removeLeadingEmptyLines(chunks[readingChunk]); } readingChunk = null; } else if (readingChunk === 'description' && line === paragraphBreak) { pushParagraph(); } else if (chunkStart.test(line)) { let chunkName = line.match(chunkStart)[ 2 ]; if (readingChunk) { throw `Encountered chunk ${chunkName} start ` + `while already reading ${readingChunk}: ${line}`; } readingChunk = chunkName; } else if (readingChunk) { if (!chunks[ readingChunk ]) { chunks[ readingChunk ] = []; } if (line.startsWith(jsonLinePrefix)) { line = JSON.parse(line.slice(jsonLinePrefix.length)); chunks[ readingChunk ].push(line); } else if (readingChunk === 'description') { currentParagraph.push(line); } else { chunks[ readingChunk ].push(line); } } }); // hack to deal with solutions field being an array of a single string // instead of an array of lines like some other fields if (chunks.solutions) { chunks.solutions = [ chunks.solutions.join('\n') ]; } Object.keys(chunks).forEach(key => { removeLeadingEmptyLines(chunks[key]); }); // console.log(JSON.stringify(chunks, null, 2)); return chunks; } } export {ChallengeFile}; class UnpackedChallenge { constructor(targetDir, challengeJson, index) { this.targetDir = targetDir; this.index = index; // todo: merge challengeJson properties into this object? this.challenge = challengeJson; // extract names of block and superblock from path // note: this is a bit redundant with the // fileName,superBlock,superOrder fields // that getChallenges() adds to the challenge JSON let targetDirPath = path.parse(targetDir); let parentDirPath = path.parse(targetDirPath.dir); // superBlockName e.g. "03-front-end-libraries" this.superBlockName = parentDirPath.base; // challengeBlockName e.g. "bootstrap" this.challengeBlockName = targetDirPath.base; } unpack() { this.challengeFile() .write(this.unpackedHTML()); } challengeFile() { return new ChallengeFile(this.targetDir, this.baseName(), '.html'); } baseName() { // eslint-disable-next-line no-nested-ternary let prefix = ((this.index < 10) ? '00' : (this.index < 100) ? '0' : '') + this.index; return `${prefix}-${dasherize(this.challenge.title)}-${this.challenge.id}`; } expandedDescription() { let out = []; this.challenge.description.forEach(part => { if (_.isString(part)) { out.push(part.toString()); out.push(paragraphBreak); } else { // Descriptions are weird since sometimes they're text and sometimes // they're "steps" which appear one at a time with optional pix and // captions and links, or "questions" with choices and explanations... // For now we preserve non-string descriptions via JSON but this is // not a great solution. // It would be better if "steps" and "description" were separate fields. // For the record, the (unnamed) fields in step are: // 0: image URL // 1: caption // 2: text // 3: link URL out.push(jsonLinePrefix + JSON.stringify(part)); } }); if (out[ out.length - 1 ] === paragraphBreak) { out.pop(); } return out; } expandedTests(tests) { if (!tests) { return []; } let out = []; tests.forEach(test => { if (_.isString(test)) { out.push(test); } else { // todo: figure out what to do about these id-title challenge links out.push(jsonLinePrefix + JSON.stringify(test)); } }); return out; } unpackedHTML() { let text = []; text.push('<html>'); text.push('<head>'); text.push('<link rel="stylesheet" href="../../../unpacked.css">'); text.push('<!-- shim to enable running the tests in-browser -->'); text.push('<script src="../../unpacked-bundle.js"></script>'); text.push('</head>'); text.push('<body>'); text.push(`<h1>${this.challenge.title}</h1>`); text.push(`<p>This is the <b>unpacked</b> version of <code>${this.superBlockName}/${this.challengeBlockName}</code> (challenge id <code>${this.challenge.id}</code>).</p>`); text.push('<p>Open the JavaScript console to see test results.</p>'); text.push(`<p>Edit this HTML file (between &lt;!-- marks only!) and run <code>npm run repack</code> to incorporate your changes into the challenge database.</p>`); text.push(''); text.push('<h2>Description</h2>'); text.push('<div class="unpacked description">'); text.push('<!--description-->'); if (this.challenge.description.length) { text.push(this.expandedDescription().join('\n')); } text.push('<!--end-->'); text.push('</div>'); text.push(''); text.push('<h2>Seed</h2>'); text.push('<!--seed--><pre class="unpacked">'); if (this.challenge.seed) { text.push(text, this.challenge.seed.join('\n')); } text.push('<!--end-->'); text.push('</pre>'); // Q: What is the difference between 'seed' and 'challengeSeed' ? text.push(''); text.push('<h2>Challenge Seed</h2>'); text.push('<!--challengeSeed--><pre class="unpacked">'); if (this.challenge.challengeSeed) { text.push(text, this.challenge.challengeSeed.join('\n')); } text.push('<!--end-->'); text.push('</pre>'); text.push(''); text.push('<h2>Head</h2>'); text.push('<!--head--><script class="unpacked head">'); if (this.challenge.head) { text.push(text, this.challenge.head.join('\n')); } text.push('</script><!--end-->'); text.push(''); text.push('<h2>Solution</h2>'); text.push( '<!--solutions--><script class="unpacked solution" id="solution">' ); // Note: none of the challenges have more than one solution // todo: should we deal with multiple solutions or not? if (this.challenge.solutions && this.challenge.solutions.length > 0) { let solution = this.challenge.solutions[ 0 ]; text.push(solution); } text.push('</script><!--end-->'); text.push(''); text.push('<h2>Tail</h2>'); text.push('<!--tail--><script class="unpacked tail">'); if (this.challenge.tail) { text.push(text, this.challenge.tail.join('\n')); } text.push('</script><!--end-->'); text.push(''); text.push('<h2>Tests</h2>'); text.push('<script class="unpacked tests">'); text.push(`test(\'${this.challenge.title} challenge tests\', ` + 'function(t) {'); text.push('let assert = addAssertsToTapTest(t);'); text.push('let code = document.getElementById(\'solution\').innerText;'); text.push('t.plan(' + (this.challenge.tests ? this.challenge.tests.length : 0) + ');'); text.push('/*--tests--*/'); text.push(this.expandedTests(this.challenge.tests).join('\n')); text.push('/*--end--*/'); text.push('});') text.push('</script>'); text.push(''); text.push('</body>'); text.push('</html>'); return text; } } export {UnpackedChallenge};
30.527211
80
0.58351
28939ed95aade42c889f01e0dcc00cd73d0adb47
28
js
JavaScript
testSetup.js
pansarhq/json
a619ff3498382e16fb0ead624cabffaebae4b47f
[ "Apache-2.0" ]
null
null
null
testSetup.js
pansarhq/json
a619ff3498382e16fb0ead624cabffaebae4b47f
[ "Apache-2.0" ]
4
2021-05-26T07:14:55.000Z
2021-05-28T12:58:22.000Z
testSetup.js
pansarhq/json
a619ff3498382e16fb0ead624cabffaebae4b47f
[ "Apache-2.0" ]
null
null
null
require('reflect-metadata')
14
27
0.785714
2893c5cd6f785aaae183b43fc602bf8ec25bd138
43,206
js
JavaScript
character-controller.js
antpb/app
6b965370637aeecc75c6e59973f1642dc83d324f
[ "MIT" ]
null
null
null
character-controller.js
antpb/app
6b965370637aeecc75c6e59973f1642dc83d324f
[ "MIT" ]
null
null
null
character-controller.js
antpb/app
6b965370637aeecc75c6e59973f1642dc83d324f
[ "MIT" ]
1
2022-03-29T04:43:22.000Z
2022-03-29T04:43:22.000Z
/* this file is responisible for maintaining player state that is network-replicated. */ import * as THREE from 'three'; import * as Z from 'zjs'; import {getRenderer, scene, camera, dolly} from './renderer.js'; import physicsManager from './physics-manager.js'; import {world} from './world.js'; import cameraManager from './camera-manager.js'; import physx from './physx.js'; import Avatar from './avatars/avatars.js'; import metaversefile from 'metaversefile'; import { actionsMapName, avatarMapName, appsMapName, playersMapName, crouchMaxTime, activateMaxTime, // useMaxTime, avatarInterpolationFrameRate, avatarInterpolationTimeDelay, avatarInterpolationNumFrames, // groundFriction, voiceEndpoint, } from './constants.js'; import {AppManager} from './app-manager.js'; import {CharacterPhysics} from './character-physics.js'; import {CharacterHups} from './character-hups.js'; import {CharacterSfx} from './character-sfx.js'; import {CharacterFx} from './character-fx.js'; import {VoicePack, VoicePackVoicer} from './voice-output/voice-pack-voicer.js'; import {VoiceEndpoint, VoiceEndpointVoicer} from './voice-output/voice-endpoint-voicer.js'; import {BinaryInterpolant, BiActionInterpolant, UniActionInterpolant, InfiniteActionInterpolant, PositionInterpolant, QuaternionInterpolant, FixedTimeStep} from './interpolants.js'; import {applyPlayerToAvatar, switchAvatar} from './player-avatar-binding.js'; import { defaultPlayerName, defaultPlayerBio, } from './ai/lore/lore-model.js'; import {makeId, clone, unFrustumCull, enableShadows} from './util.js'; const localVector = new THREE.Vector3(); // const localVector2 = new THREE.Vector3(); // const localQuaternion = new THREE.Quaternion(); // const localQuaternion2 = new THREE.Quaternion(); const localMatrix = new THREE.Matrix4(); const localMatrix2 = new THREE.Matrix4(); const localArray3 = [0, 0, 0]; const localArray4 = [0, 0, 0, 0]; function makeCancelFn() { let live = true; return { isLive() { return live; }, cancel() { live = false; }, }; } const heightFactor = 1.6; const baseRadius = 0.3; function loadPhysxCharacterController() { const avatarHeight = this.avatar.height; const radius = baseRadius/heightFactor * avatarHeight; const height = avatarHeight - radius*2; const contactOffset = 0.1/heightFactor * avatarHeight; const stepOffset = 0.5/heightFactor * avatarHeight; const position = this.position.clone() .add(new THREE.Vector3(0, -avatarHeight/2, 0)); const physicsMaterial = new THREE.Vector3(0, 0, 0); if (this.characterController) { physicsManager.destroyCharacterController(this.characterController); this.characterController = null; // this.characterControllerObject = null; } this.characterController = physicsManager.createCharacterController( radius - contactOffset, height, contactOffset, stepOffset, position, physicsMaterial ); // this.characterControllerObject = new THREE.Object3D(); } /* function loadPhysxAuxCharacterCapsule() { const avatarHeight = this.avatar.height; const radius = baseRadius/heightFactor * avatarHeight; const height = avatarHeight - radius*2; const halfHeight = height/2; const position = this.position.clone() .add(new THREE.Vector3(0, -avatarHeight/2, 0)); const physicsMaterial = new THREE.Vector3(0, 0, 0); const physicsObject = physicsManager.addCapsuleGeometry( position, localQuaternion.copy(this.quaternion) .premultiply( localQuaternion2.setFromAxisAngle( localVector.set(0, 0, 1), Math.PI/2 ) ), radius, halfHeight, physicsMaterial, true ); physicsObject.name = 'characterCapsuleAux'; physicsManager.setGravityEnabled(physicsObject, false); physicsManager.setLinearLockFlags(physicsObject.physicsId, false, false, false); physicsManager.setAngularLockFlags(physicsObject.physicsId, false, false, false); this.physicsObject = physicsObject; } */ class PlayerHand extends THREE.Object3D { constructor() { super(); this.pointer = 0; this.grab = 0; this.enabled = false; } } class PlayerBase extends THREE.Object3D { constructor() { super(); this.leftHand = new PlayerHand(); this.rightHand = new PlayerHand(); this.hands = [ this.leftHand, this.rightHand, ]; this.avatar = null; this.appManager = new AppManager({ appsMap: null, }); this.appManager.addEventListener('appadd', e => { const app = e.data; scene.add(app); }); this.appManager.addEventListener('appremove', e => { const app = e.data; app.parent && app.parent.remove(app); }); this.eyeballTarget = new THREE.Vector3(); this.eyeballTargetEnabled = false; this.voicePack = null; this.voiceEndpoint = null; } findAction(fn) { const actions = this.getActionsState(); for (const action of actions) { if (fn(action)) { return action; } } return null; } findActionIndex(fn) { const actions = this.getActionsState(); let i = 0; for (const action of actions) { if (fn(action)) { return i; } i++ } return -1; } getAction(type) { const actions = this.getActionsState(); for (const action of actions) { if (action.type === type) { return action; } } return null; } getActionByActionId(actionId) { const actions = this.getActionsState(); for (const action of actions) { if (action.actionId === actionId) { return action; } } return null; } getActionIndex(type) { const actions = this.getActionsState(); let i = 0; for (const action of actions) { if (action.type === type) { return i; } i++; } return -1; } indexOfAction(action) { const actions = this.getActionsState(); let i = 0; for (const a of actions) { if (a === action) { return i; } i++; } return -1; } hasAction(type) { const actions = this.getActionsState(); for (const action of actions) { if (action.type === type) { return true; } } return false; } async loadVoicePack({audioUrl, indexUrl}) { this.voicePack = await VoicePack.load({ audioUrl, indexUrl, }); this.updateVoicer(); } setVoiceEndpoint(voiceId) { if (voiceId) { const url = `${voiceEndpoint}?voice=${encodeURIComponent(voiceId)}`; this.voiceEndpoint = new VoiceEndpoint(url); } else { this.voiceEndpoint = null; } this.updateVoicer(); } getVoice() { return this.voiceEndpoint || this.voicePack || null; } updateVoicer() { const voice = this.getVoice(); if (voice instanceof VoicePack) { const {syllableFiles, audioBuffer} = voice; this.voicer = new VoicePackVoicer(syllableFiles, audioBuffer, this); } else if (voice instanceof VoiceEndpoint) { this.voicer = new VoiceEndpointVoicer(voice, this); } else if (voice === null) { this.voicer = null; } else { throw new Error('invalid voice'); } } getCrouchFactor() { return 1 - 0.4 * this.actionInterpolants.crouch.getNormalized(); /* let factor = 1; factor *= 1 - 0.4 * this.actionInterpolants.crouch.getNormalized(); return factor; */ } wear(app) { if (world.appManager.hasTrackedApp(app.instanceId)) { world.appManager.transplantApp(app, this.appManager); } else { // console.warn('need to transplant unowned app', app, world.appManager, this.appManager); // debugger; } const physicsObjects = app.getPhysicsObjects(); for (const physicsObject of physicsObjects) { physx.physxWorker.disableGeometryQueriesPhysics(physx.physics, physicsObject.physicsId); physx.physxWorker.disableGeometryPhysics(physx.physics, physicsObject.physicsId); } const {instanceId} = app; this.addAction({ type: 'wear', instanceId, }); // this.ungrab(); app.dispatchEvent({ type: 'wearupdate', player: this, wear: true, }); this.dispatchEvent({ type: 'wearupdate', app, wear: true, }); } unwear(app) { const wearActionIndex = this.findActionIndex(({type, instanceId}) => { return type === 'wear' && instanceId === app.instanceId; }); if (wearActionIndex !== -1) { this.removeActionIndex(wearActionIndex); if (this.appManager.hasTrackedApp(app.instanceId)) { this.appManager.transplantApp(app, world.appManager); } else { // console.warn('need to transplant unowned app', app, this.appManager, world.appManager); // debugger; } const wearComponent = app.getComponent('wear'); if (wearComponent) { const avatarHeight = this.avatar ? this.avatar.height : 0; app.position.copy(this.position) .add(localVector.set(0, -avatarHeight + 0.5, -0.5).applyQuaternion(this.quaternion)); app.quaternion.identity(); app.scale.set(1, 1, 1); app.updateMatrixWorld(); } const physicsObjects = app.getPhysicsObjects(); for (const physicsObject of physicsObjects) { physx.physxWorker.enableGeometryQueriesPhysics(physx.physics, physicsObject.physicsId); physx.physxWorker.enableGeometryPhysics(physx.physics, physicsObject.physicsId); } app.dispatchEvent({ type: 'wearupdate', player: this, wear: false, }); this.dispatchEvent({ type: 'wearupdate', app, wear: false, }); } } destroy() { // nothing } } const controlActionTypes = [ 'jump', 'crouch', 'fly', 'sit', ]; class StatePlayer extends PlayerBase { constructor({ playerId = makeId(5), playersArray = new Z.Doc().getArray(playersMapName), } = {}) { super(); this.playerId = playerId; this.playersArray = null; this.playerMap = null; this.microphoneMediaStream = null; this.avatarEpoch = 0; this.syncAvatarCancelFn = null; this.unbindFns = []; this.bindState(playersArray); } isBound() { return !!this.playersArray; } unbindState() { if (this.isBound()) { this.playersArray = null; this.playerMap = null; for (const unbindFn of this.unbindFns) { unbindFn(); } this.unbindFns.length = 0; } } detachState() { throw new Error('called abstract method'); } attachState(oldState) { throw new Error('called abstract method'); } bindCommonObservers() { const actions = this.getActionsState(); let lastActions = actions.toJSON(); const observeActionsFn = () => { const nextActions = Array.from(this.getActionsState()); for (const nextAction of nextActions) { if (!lastActions.some(lastAction => lastAction.actionId === nextAction.actionId)) { this.dispatchEvent({ type: 'actionadd', action: nextAction, }); // console.log('add action', nextAction); } } for (const lastAction of lastActions) { if (!nextActions.some(nextAction => nextAction.actionId === lastAction.actionId)) { this.dispatchEvent({ type: 'actionremove', action: lastAction, }); // console.log('remove action', lastAction); } } // console.log('actions changed'); lastActions = nextActions; }; actions.observe(observeActionsFn); this.unbindFns.push(actions.unobserve.bind(actions, observeActionsFn)); const avatar = this.getAvatarState(); let lastAvatarInstanceId = ''; const observeAvatarFn = async () => { // we are in an observer and we want to perform a state transaction as a result // therefore we need to yeild out of the observer first or else the other transaction handlers will get confused about timing await Promise.resolve(); const instanceId = this.getAvatarInstanceId(); if (lastAvatarInstanceId !== instanceId) { lastAvatarInstanceId = instanceId; this.syncAvatar(); } }; avatar.observe(observeAvatarFn); this.unbindFns.push(avatar.unobserve.bind(avatar, observeAvatarFn)); const _cancelSyncAvatar = () => { if (this.syncAvatarCancelFn) { this.syncAvatarCancelFn(); this.syncAvatarCancelFn = null; } }; this.unbindFns.push(_cancelSyncAvatar); } bindState(nextPlayersArray) { // latch old state const oldState = this.detachState(); // unbind this.unbindState(); this.appManager.unbindState(); // note: leave the old state as is. it is the host's responsibility to garbage collect us when we disconnect. // blindly add to new state this.playersArray = nextPlayersArray; if (this.playersArray) { this.attachState(oldState); this.bindCommonObservers(); } } getAvatarInstanceId() { return this.getAvatarState().get('instanceId') ?? ''; } // serializers getPosition() { return this.playerMap.get('position') ?? [0, 0, 0]; } getQuaternion() { return this.playerMap.get('quaternion') ?? [0, 0, 0, 1]; } async syncAvatar() { if (this.syncAvatarCancelFn) { this.syncAvatarCancelFn.cancel(); this.syncAvatarCancelFn = null; } const cancelFn = makeCancelFn(); this.syncAvatarCancelFn = cancelFn; const instanceId = this.getAvatarInstanceId(); // remove last app if (this.avatar) { const oldPeerOwnerAppManager = this.appManager.getPeerOwnerAppManager(this.avatar.app.instanceId); if (oldPeerOwnerAppManager) { // console.log('transplant last app'); this.appManager.transplantApp(this.avatar.app, oldPeerOwnerAppManager); } else { // console.log('remove last app', this.avatar.app); // this.appManager.removeTrackedApp(this.avatar.app.instanceId); } } const _setNextAvatarApp = app => { (() => { const avatar = switchAvatar(this.avatar, app); if (!cancelFn.isLive()) return; this.avatar = avatar; this.dispatchEvent({ type: 'avatarchange', app, avatar, }); loadPhysxCharacterController.call(this); // console.log('disable actor', this.characterController); physicsManager.disableGeometryQueries(this.characterController); })(); this.dispatchEvent({ type: 'avatarupdate', app, }); }; if (instanceId) { // add next app from player app manager const nextAvatarApp = this.appManager.getAppByInstanceId(instanceId); // console.log('add next avatar local', nextAvatarApp); if (nextAvatarApp) { _setNextAvatarApp(nextAvatarApp); } else { // add next app from world app manager const nextAvatarApp = world.appManager.getAppByInstanceId(instanceId); // console.log('add next avatar world', nextAvatarApp); if (nextAvatarApp) { world.appManager.transplantApp(nextAvatarApp, this.appManager); _setNextAvatarApp(nextAvatarApp); } else { // add next app from currently loading apps const addPromise = this.appManager.pendingAddPromises.get(instanceId); if (addPromise) { const nextAvatarApp = await addPromise; if (!cancelFn.isLive()) return; _setNextAvatarApp(nextAvatarApp); } else { console.warn('switching avatar to instanceId that does not exist in any app manager', instanceId); } } } } else { _setNextAvatarApp(null); } this.syncAvatarCancelFn = null; } setSpawnPoint(position, quaternion) { const localPlayer = metaversefile.useLocalPlayer(); localPlayer.position.copy(position); localPlayer.quaternion.copy(quaternion); camera.position.copy(position); camera.quaternion.copy(quaternion); camera.updateMatrixWorld(); if (this.characterController) { this.characterPhysics.setPosition(position); } } getActions() { return this.getActionsState(); } getActionsState() { let actionsArray = this.playerMap.has(avatarMapName) ? this.playerMap.get(actionsMapName, Z.Array) : null; if (!actionsArray) { actionsArray = new Z.Array(); this.playerMap.set(actionsMapName, actionsArray); } return actionsArray; } getActionsArray() { return this.isBound() ? Array.from(this.getActionsState()) : []; } getAvatarState() { let avatarMap = this.playerMap.has(avatarMapName) ? this.playerMap.get(avatarMapName, Z.Map) : null; if (!avatarMap) { avatarMap = new Z.Map(); this.playerMap.set(avatarMapName, avatarMap); } return avatarMap; } getAppsState() { let appsArray = this.playerMap.has(avatarMapName) ? this.playerMap.get(appsMapName, Z.Array) : null; if (!appsArray) { appsArray = new Z.Array(); this.playerMap.set(appsMapName, appsArray); } return appsArray; } getAppsArray() { return this.isBound() ? Array.from(this.getAppsState()) : []; } addAction(action) { action = clone(action); action.actionId = makeId(5); this.getActionsState().push([action]); return action; } removeAction(type) { const actions = this.getActionsState(); let i = 0; for (const action of actions) { if (action.type === type) { actions.delete(i); break; } i++; } } removeActionIndex(index) { this.getActionsState().delete(index); } setControlAction(action) { const actions = this.getActionsState(); for (let i = 0; i < actions.length; i++) { const action = actions.get(i); const isControlAction = controlActionTypes.includes(action.type); if (isControlAction) { actions.delete(i); i--; } } actions.push([action]); } setMicMediaStream(mediaStream) { if (this.microphoneMediaStream) { this.microphoneMediaStream.disconnect(); this.microphoneMediaStream = null; } if (mediaStream) { this.avatar.setAudioEnabled(true); const audioContext = Avatar.getAudioContext(); const mediaStreamSource = audioContext.createMediaStreamSource(mediaStream); mediaStreamSource.connect(this.avatar.getAudioInput()); this.microphoneMediaStream = mediaStreamSource; } } new() { const self = this; this.playersArray.doc.transact(function tx() { const actions = self.getActionsState(); while (actions.length > 0) { actions.delete(actions.length - 1); } const avatar = self.getAvatarState(); avatar.delete('instanceId'); const apps = self.getAppsState(); while (apps.length > 0) { apps.delete(apps.length - 1); } }); } save() { const actions = this.getActionsState(); const avatar = this.getAvatarState(); const apps = this.getAppsState(); return JSON.stringify({ // actions: actions.toJSON(), avatar: avatar.toJSON(), apps: apps.toJSON(), }); } load(s) { const j = JSON.parse(s); // console.log('load', j); const self = this; this.playersArray.doc.transact(function tx() { const actions = self.getActionsState(); while (actions.length > 0) { actions.delete(actions.length - 1); } const avatar = self.getAvatarState(); if (j?.avatar?.instanceId) { avatar.set('instanceId', j.avatar.instanceId); } const apps = self.getAppsState(); if (Array.isArray(j?.apps)) { for (const app of j.apps) { apps.push([app]); } } }); } destroy() { this.unbindState(); this.appManager.unbindState(); this.appManager.destroy(); super.destroy(); } } class InterpolatedPlayer extends StatePlayer { constructor(opts) { super(opts); this.positionInterpolant = new PositionInterpolant(() => this.getPosition(), avatarInterpolationTimeDelay, avatarInterpolationNumFrames); this.quaternionInterpolant = new QuaternionInterpolant(() => this.getQuaternion(), avatarInterpolationTimeDelay, avatarInterpolationNumFrames); this.positionTimeStep = new FixedTimeStep(timeDiff => { this.positionInterpolant.snapshot(timeDiff); }, avatarInterpolationFrameRate); this.quaternionTimeStep = new FixedTimeStep(timeDiff => { this.quaternionInterpolant.snapshot(timeDiff); }, avatarInterpolationFrameRate); this.actionBinaryInterpolants = { crouch: new BinaryInterpolant(() => this.hasAction('crouch'), avatarInterpolationTimeDelay, avatarInterpolationNumFrames), activate: new BinaryInterpolant(() => this.hasAction('activate'), avatarInterpolationTimeDelay, avatarInterpolationNumFrames), use: new BinaryInterpolant(() => this.hasAction('use'), avatarInterpolationTimeDelay, avatarInterpolationNumFrames), aim: new BinaryInterpolant(() => this.hasAction('aim'), avatarInterpolationTimeDelay, avatarInterpolationNumFrames), narutoRun: new BinaryInterpolant(() => this.hasAction('narutoRun'), avatarInterpolationTimeDelay, avatarInterpolationNumFrames), fly: new BinaryInterpolant(() => this.hasAction('fly'), avatarInterpolationTimeDelay, avatarInterpolationNumFrames), jump: new BinaryInterpolant(() => this.hasAction('jump'), avatarInterpolationTimeDelay, avatarInterpolationNumFrames), dance: new BinaryInterpolant(() => this.hasAction('dance'), avatarInterpolationTimeDelay, avatarInterpolationNumFrames), // throw: new BinaryInterpolant(() => this.hasAction('throw'), avatarInterpolationTimeDelay, avatarInterpolationNumFrames), // chargeJump: new BinaryInterpolant(() => this.hasAction('chargeJump'), avatarInterpolationTimeDelay, avatarInterpolationNumFrames), // standCharge: new BinaryInterpolant(() => this.hasAction('standCharge'), avatarInterpolationTimeDelay, avatarInterpolationNumFrames), // fallLoop: new BinaryInterpolant(() => this.hasAction('fallLoop'), avatarInterpolationTimeDelay, avatarInterpolationNumFrames), // swordSideSlash: new BinaryInterpolant(() => this.hasAction('swordSideSlash'), avatarInterpolationTimeDelay, avatarInterpolationNumFrames), // swordTopDownSlash: new BinaryInterpolant(() => this.hasAction('swordTopDownSlash'), avatarInterpolationTimeDelay, avatarInterpolationNumFrames), hurt: new BinaryInterpolant(() => this.hasAction('hurt'), avatarInterpolationTimeDelay, avatarInterpolationNumFrames), }; this.actionBinaryInterpolantsArray = Object.keys(this.actionBinaryInterpolants).map(k => this.actionBinaryInterpolants[k]); this.actionBinaryTimeSteps = { crouch: new FixedTimeStep(timeDiff => {this.actionBinaryInterpolants.crouch.snapshot(timeDiff);}, avatarInterpolationFrameRate), activate: new FixedTimeStep(timeDiff => {this.actionBinaryInterpolants.activate.snapshot(timeDiff);}, avatarInterpolationFrameRate), use: new FixedTimeStep(timeDiff => {this.actionBinaryInterpolants.use.snapshot(timeDiff);}, avatarInterpolationFrameRate), aim: new FixedTimeStep(timeDiff => {this.actionBinaryInterpolants.aim.snapshot(timeDiff);}, avatarInterpolationFrameRate), narutoRun: new FixedTimeStep(timeDiff => {this.actionBinaryInterpolants.narutoRun.snapshot(timeDiff);}, avatarInterpolationFrameRate), fly: new FixedTimeStep(timeDiff => {this.actionBinaryInterpolants.fly.snapshot(timeDiff);}, avatarInterpolationFrameRate), jump: new FixedTimeStep(timeDiff => {this.actionBinaryInterpolants.jump.snapshot(timeDiff);}, avatarInterpolationFrameRate), dance: new FixedTimeStep(timeDiff => {this.actionBinaryInterpolants.dance.snapshot(timeDiff);}, avatarInterpolationFrameRate), // throw: new FixedTimeStep(timeDiff => {this.actionBinaryInterpolants.throw.snapshot(timeDiff);}, avatarInterpolationFrameRate), // chargeJump: new FixedTimeStep(timeDiff => {this.actionBinaryInterpolants.chargeJump.snapshot(timeDiff);}, avatarInterpolationFrameRate), // standCharge: new FixedTimeStep(timeDiff => {this.actionBinaryInterpolants.standCharge.snapshot(timeDiff);}, avatarInterpolationFrameRate), // fallLoop: new FixedTimeStep(timeDiff => {this.actionBinaryInterpolants.fallLoop.snapshot(timeDiff);}, avatarInterpolationFrameRate), // swordSideSlash: new FixedTimeStep(timeDiff => {this.actionBinaryInterpolants.swordSideSlash.snapshot(timeDiff);}, avatarInterpolationFrameRate), // swordTopDownSlash: new FixedTimeStep(timeDiff => {this.actionBinaryInterpolants.swordTopDownSlash.snapshot(timeDiff);}, avatarInterpolationFrameRate), hurt: new FixedTimeStep(timeDiff => {this.actionBinaryInterpolants.hurt.snapshot(timeDiff);}, avatarInterpolationFrameRate), }; this.actionBinaryTimeStepsArray = Object.keys(this.actionBinaryTimeSteps).map(k => this.actionBinaryTimeSteps[k]); this.actionInterpolants = { crouch: new BiActionInterpolant(() => this.actionBinaryInterpolants.crouch.get(), 0, crouchMaxTime), activate: new UniActionInterpolant(() => this.actionBinaryInterpolants.activate.get(), 0, activateMaxTime), use: new InfiniteActionInterpolant(() => this.actionBinaryInterpolants.use.get(), 0), unuse: new InfiniteActionInterpolant(() => !this.actionBinaryInterpolants.use.get(), 0), aim: new InfiniteActionInterpolant(() => this.actionBinaryInterpolants.aim.get(), 0), narutoRun: new InfiniteActionInterpolant(() => this.actionBinaryInterpolants.narutoRun.get(), 0), fly: new InfiniteActionInterpolant(() => this.actionBinaryInterpolants.fly.get(), 0), jump: new InfiniteActionInterpolant(() => this.actionBinaryInterpolants.jump.get(), 0), dance: new InfiniteActionInterpolant(() => this.actionBinaryInterpolants.dance.get(), 0), // throw: new UniActionInterpolant(() => this.actionBinaryInterpolants.throw.get(), 0, throwMaxTime), // chargeJump: new InfiniteActionInterpolant(() => this.actionBinaryInterpolants.chargeJump.get(), 0), // standCharge: new InfiniteActionInterpolant(() => this.actionBinaryInterpolants.standCharge.get(), 0), // fallLoop: new InfiniteActionInterpolant(() => this.actionBinaryInterpolants.fallLoop.get(), 0), // swordSideSlash: new InfiniteActionInterpolant(() => this.actionBinaryInterpolants.swordSideSlash.get(), 0), // swordTopDownSlash: new InfiniteActionInterpolant(() => this.actionBinaryInterpolants.swordTopDownSlash.get(), 0), hurt: new InfiniteActionInterpolant(() => this.actionBinaryInterpolants.hurt.get(), 0), }; this.actionInterpolantsArray = Object.keys(this.actionInterpolants).map(k => this.actionInterpolants[k]); this.avatarBinding = { position: this.positionInterpolant.get(), quaternion: this.quaternionInterpolant.get(), }; } updateInterpolation(timeDiff) { this.positionTimeStep.update(timeDiff); this.quaternionTimeStep.update(timeDiff); this.positionInterpolant.update(timeDiff); this.quaternionInterpolant.update(timeDiff); for (const actionInterpolantTimeStep of this.actionBinaryTimeStepsArray) { actionInterpolantTimeStep.update(timeDiff); } for (const actionBinaryInterpolant of this.actionBinaryInterpolantsArray) { actionBinaryInterpolant.update(timeDiff); } for (const actionInterpolant of this.actionInterpolantsArray) { actionInterpolant.update(timeDiff); } } } class UninterpolatedPlayer extends StatePlayer { constructor(opts) { super(opts); UninterpolatedPlayer.init.apply(this, arguments) } static init() { this.actionInterpolants = { crouch: new BiActionInterpolant(() => this.hasAction('crouch'), 0, crouchMaxTime), activate: new UniActionInterpolant(() => this.hasAction('activate'), 0, activateMaxTime), use: new InfiniteActionInterpolant(() => this.hasAction('use'), 0), unuse: new InfiniteActionInterpolant(() => !this.hasAction('use'), 0), aim: new InfiniteActionInterpolant(() => this.hasAction('aim'), 0), narutoRun: new InfiniteActionInterpolant(() => this.hasAction('narutoRun'), 0), fly: new InfiniteActionInterpolant(() => this.hasAction('fly'), 0), jump: new InfiniteActionInterpolant(() => this.hasAction('jump'), 0), dance: new BiActionInterpolant(() => this.hasAction('dance'), 0, crouchMaxTime), // throw: new UniActionInterpolant(() => this.hasAction('throw'), 0, throwMaxTime), // chargeJump: new InfiniteActionInterpolant(() => this.hasAction('chargeJump'), 0), // standCharge: new InfiniteActionInterpolant(() => this.hasAction('standCharge'), 0), // fallLoop: new InfiniteActionInterpolant(() => this.hasAction('fallLoop'), 0), // swordSideSlash: new InfiniteActionInterpolant(() => this.hasAction('swordSideSlash'), 0), // swordTopDownSlash: new InfiniteActionInterpolant(() => this.hasAction('swordTopDownSlash'), 0), hurt: new InfiniteActionInterpolant(() => this.hasAction('hurt'), 0), }; this.actionInterpolantsArray = Object.keys(this.actionInterpolants).map(k => this.actionInterpolants[k]); this.avatarBinding = { position: this.position, quaternion: this.quaternion, }; } updateInterpolation(timeDiff) { for (const actionInterpolant of this.actionInterpolantsArray) { actionInterpolant.update(timeDiff); } } } class LocalPlayer extends UninterpolatedPlayer { constructor(opts) { super(opts); this.isLocalPlayer = true; this.name = defaultPlayerName; this.bio = defaultPlayerBio; this.characterPhysics = new CharacterPhysics(this); this.characterHups = new CharacterHups(this); this.characterSfx = new CharacterSfx(this); this.characterFx = new CharacterFx(this); } async setAvatarUrl(u) { const localAvatarEpoch = ++this.avatarEpoch; const avatarApp = await this.appManager.addTrackedApp(u); if (this.avatarEpoch !== localAvatarEpoch) { this.appManager.removeTrackedApp(avatarApp.instanceId); return; } this.setAvatarApp(avatarApp); } setAvatarApp(app) { const self = this; this.playersArray.doc.transact(function tx() { const avatar = self.getAvatarState(); const oldInstanceId = avatar.get('instanceId'); avatar.set('instanceId', app.instanceId); if (oldInstanceId) { self.appManager.removeTrackedAppInternal(oldInstanceId); } }); } detachState() { const oldActions = (this.playersArray ? this.getActionsState() : new Z.Array()); const oldAvatar = (this.playersArray ? this.getAvatarState() : new Z.Map()).toJSON(); const oldApps = (this.playersArray ? this.getAppsState() : new Z.Array()).toJSON(); return { oldActions, oldAvatar, oldApps, }; } attachState(oldState) { const { oldActions, oldAvatar, oldApps, } = oldState; const self = this; this.playersArray.doc.transact(function tx() { self.playerMap = new Z.Map(); self.playersArray.push([self.playerMap]); self.playerMap.set('playerId', self.playerId); self.playerMap.set('position', self.position.toArray(localArray3)); self.playerMap.set('quaternion', self.quaternion.toArray(localArray4)); const actions = self.getActionsState(); for (const oldAction of oldActions) { actions.push([oldAction]); } const avatar = self.getAvatarState(); const {instanceId} = oldAvatar; if (instanceId !== undefined) { avatar.set('instanceId', instanceId); } const apps = self.getAppsState(); for (const oldApp of oldApps) { const mapApp = new Z.Map(); for (const k in oldApp) { const v = oldApp[k]; mapApp.set(k, v); } apps.push([mapApp]); } }); this.appManager.bindState(this.getAppsState()); } grab(app, hand = 'left') { const renderer = getRenderer(); const localPlayer = metaversefile.useLocalPlayer(); const {position, quaternion} = renderer.xr.getSession() ? localPlayer[hand === 'left' ? 'leftHand' : 'rightHand'] : camera; app.updateMatrixWorld(); app.savedRotation = app.rotation.clone(); app.startQuaternion = quaternion.clone(); const grabAction = { type: 'grab', hand, instanceId: app.instanceId, matrix: localMatrix.copy(app.matrixWorld) .premultiply(localMatrix2.compose(position, quaternion, localVector.set(1, 1, 1)).invert()) .toArray() }; localPlayer.addAction(grabAction); const physicsObjects = app.getPhysicsObjects(); for (const physicsObject of physicsObjects) { //physx.physxWorker.disableGeometryPhysics(physx.physics, physicsObject.physicsId); physx.physxWorker.disableGeometryQueriesPhysics(physx.physics, physicsObject.physicsId); } app.dispatchEvent({ type: 'grabupdate', grab: true, }); } ungrab() { const actions = Array.from(this.getActionsState()); let removeOffset = 0; for (let i = 0; i < actions.length; i++) { const action = actions[i]; if (action.type === 'grab') { const app = metaversefile.getAppByInstanceId(action.instanceId); const physicsObjects = app.getPhysicsObjects(); for (const physicsObject of physicsObjects) { //physx.physxWorker.enableGeometryPhysics(physx.physics, physicsObject.physicsId); physx.physxWorker.enableGeometryQueriesPhysics(physx.physics, physicsObject.physicsId); } this.removeActionIndex(i + removeOffset); removeOffset -= 1; app.dispatchEvent({ type: 'grabupdate', grab: false, }); } } } /* lookAt(p) { const cameraOffset = cameraManager.getCameraOffset(); camera.position.add(localVector.copy(cameraOffset).applyQuaternion(camera.quaternion)); camera.quaternion.setFromRotationMatrix( localMatrix.lookAt( camera.position, p, localVector2.set(0, 1, 0) ) ); camera.position.sub(localVector.copy(cameraOffset).applyQuaternion(camera.quaternion)); camera.updateMatrixWorld(); } */ pushPlayerUpdates() { this.playersArray.doc.transact(() => { /* if (isNaN(this.position.x) || isNaN(this.position.y) || isNaN(this.position.z)) { debugger; } */ this.playerMap.set('position', this.position.toArray(localArray3)); this.playerMap.set('quaternion', this.quaternion.toArray(localArray4)); }, 'push'); this.appManager.updatePhysics(); } getSession() { const renderer = getRenderer(); const session = renderer.xr.getSession(); return session; } updatePhysics(timestamp, timeDiff) { if (this.avatar) { const timeDiffS = timeDiff / 1000; this.characterPhysics.update(timestamp, timeDiffS); } } updateAvatar(timestamp, timeDiff) { if (this.avatar) { const timeDiffS = timeDiff / 1000; this.characterSfx.update(timestamp, timeDiffS); this.characterFx.update(timestamp, timeDiffS); this.updateInterpolation(timeDiff); const session = this.getSession(); const mirrors = metaversefile.getMirrors(); applyPlayerToAvatar(this, session, this.avatar, mirrors); this.avatar.update(timestamp, timeDiff); this.characterHups.update(timestamp); } } resetPhysics() { this.characterPhysics.reset(); } teleportTo = (() => { const localVector = new THREE.Vector3(); const localVector2 = new THREE.Vector3(); const localQuaternion = new THREE.Quaternion(); const localMatrix = new THREE.Matrix4(); return function(position, quaternion, {relation = 'floor'} = {}) { const renderer = getRenderer(); const xrCamera = renderer.xr.getSession() ? renderer.xr.getCamera(camera) : camera; const avatarHeight = this.avatar ? this.avatar.height : 0; if (renderer.xr.getSession()) { localMatrix.copy(xrCamera.matrix) .premultiply(dolly.matrix) .decompose(localVector, localQuaternion, localVector2); dolly.matrix .premultiply(localMatrix.makeTranslation(position.x - localVector.x, position.y - localVector.y, position.z - localVector.z)) // .premultiply(localMatrix.makeRotationFromQuaternion(localQuaternion3.copy(quaternion).inverse())) // .premultiply(localMatrix.makeTranslation(localVector.x, localVector.y, localVector.z)) .premultiply(localMatrix.makeTranslation(0, relation === 'floor' ? avatarHeight : 0, 0)) .decompose(dolly.position, dolly.quaternion, dolly.scale); dolly.updateMatrixWorld(); } else { camera.position.copy(position) .sub(localVector.copy(cameraManager.getCameraOffset()).applyQuaternion(camera.quaternion)); camera.position.y += relation === 'floor' ? avatarHeight : 0; camera.quaternion.copy(quaternion); camera.updateMatrixWorld(); } this.resetPhysics(); }; })() destroy() { this.characterPhysics.destroy(); this.characterHups.destroy(); this.characterSfx.destroy(); this.characterFx.destroy(); super.destroy(); } } class RemotePlayer extends InterpolatedPlayer { constructor(opts) { super(opts); this.isRemotePlayer = true; } detachState() { return null; } attachState(oldState) { let index = -1; for (let i = 0; i < this.playersArray.length; i++) { const player = this.playersArray.get(i, Z.Map); if (player.get('playerId') === this.playerId) { index = i; break; } } if (index !== -1) { this.playerMap = this.playersArray.get(index, Z.Map); } else { console.warn('binding to nonexistent player object', this.playersArray.toJSON()); } const observePlayerFn = e => { this.position.fromArray(this.playerMap.get('position')); this.quaternion.fromArray(this.playerMap.get('quaternion')); }; this.playerMap.observe(observePlayerFn); this.unbindFns.push(this.playerMap.unobserve.bind(this.playerMap, observePlayerFn)); this.appManager.bindState(this.getAppsState()); this.appManager.loadApps(); this.syncAvatar(); } } class StaticUninterpolatedPlayer extends PlayerBase { constructor(opts) { super(opts); UninterpolatedPlayer.init.apply(this, arguments); this.actions = []; } getActionsState() { return this.actions; } getActions() { return this.actions; } getActionsArray() { return this.actions; } getAction(type) { return this.actions.find(action => action.type === type); } getActionByActionId(actionId) { return this.actions.find(action => action.actionId === actionId); } hasAction(type) { return this.actions.some(a => a.type === type); } addAction(action) { this.actions.push(action); this.dispatchEvent({ type: 'actionadd', action, }); } removeAction(type) { for (let i = 0; i < this.actions.length; i++) { const action = this.actions[i]; if (action.type === type) { this.removeActionIndex(i); break; } } } removeActionIndex(index) { const action = this.actions.splice(index, 1)[0]; this.dispatchEvent({ type: 'actionremove', action, }); } updateInterpolation = UninterpolatedPlayer.prototype.updateInterpolation; } class NpcPlayer extends StaticUninterpolatedPlayer { constructor(opts) { super(opts); this.isNpcPlayer = true; } setAvatarApp(app) { app.toggleBoneUpdates(true); const {skinnedVrm} = app; const avatar = new Avatar(skinnedVrm, { fingers: true, hair: true, visemes: true, debug: false, }); unFrustumCull(app); enableShadows(app); this.avatar = avatar; this.characterPhysics = new CharacterPhysics(this); this.characterHups = new CharacterHups(this); this.characterSfx = new CharacterSfx(this); this.characterFx = new CharacterFx(this); loadPhysxCharacterController.call(this); // loadPhysxAuxCharacterCapsule.call(this); } getSession() { return null; } updatePhysics = LocalPlayer.prototype.updatePhysics; updateAvatar = LocalPlayer.prototype.updateAvatar; /* detachState() { return null; } attachState(oldState) { let index = -1; for (let i = 0; i < this.playersArray.length; i++) { const player = this.playersArray.get(i, Z.Map); if (player.get('playerId') === this.playerId) { index = i; break; } } if (index !== -1) { this.playerMap = this.playersArray.get(index, Z.Map); } else { console.warn('binding to nonexistent player object', this.playersArray.toJSON()); } const observePlayerFn = e => { this.position.fromArray(this.playerMap.get('position')); this.quaternion.fromArray(this.playerMap.get('quaternion')); }; this.playerMap.observe(observePlayerFn); this.unbindFns.push(this.playerMap.unobserve.bind(this.playerMap, observePlayerFn)); this.appManager.bindState(this.getAppsState()); this.appManager.syncApps(); this.syncAvatar(); } */ destroy() { /* const npcs = metaversefile.useNpcs(); const index = npcs.indexOf(this); if (index !== -1) { npcs.splice(index, 1); } */ super.destroy(); } updateInterpolation = UninterpolatedPlayer.prototype.updateInterpolation; } export { LocalPlayer, RemotePlayer, NpcPlayer, };
34.984615
182
0.64417
2893cd5dbe7981af23fd28eb5cf735aaf7bb3037
828
js
JavaScript
src/hooks/useArrowKeys.js
krnsk0/webcomic-site
8723be73f0bc653c8945a410bd34d7b7757872d6
[ "MIT" ]
1
2021-06-03T22:41:41.000Z
2021-06-03T22:41:41.000Z
src/hooks/useArrowKeys.js
krnsk0/webcomic-site
8723be73f0bc653c8945a410bd34d7b7757872d6
[ "MIT" ]
3
2021-09-21T15:58:25.000Z
2022-02-27T10:34:24.000Z
src/hooks/useArrowKeys.js
krnsk0/webcomic-site
8723be73f0bc653c8945a410bd34d7b7757872d6
[ "MIT" ]
null
null
null
import React from "react" import { navigate } from "gatsby" const useArrowKeys = pageInfo => { // navigate between pages using arrow keys but only on comic pages React.useEffect(() => { const handleUserKeyPress = event => { const { keyCode } = event if ( keyCode === 39 && pageInfo && pageInfo.currentPage < pageInfo.lastPage ) { event.preventDefault() navigate(`/page/${pageInfo.nextPage}`) } else if (keyCode === 37 && pageInfo && pageInfo.currentPage > 1) { event.preventDefault() navigate(`/page/${pageInfo.previousPage}`) } } window.addEventListener("keydown", handleUserKeyPress) return () => { window.removeEventListener("keydown", handleUserKeyPress) } }, [pageInfo]) } export default useArrowKeys
26.709677
74
0.618357
2893e4906dc6f03914c152ad5bd68d53730dec70
684
js
JavaScript
node_modules/surge/lib/middleware/welcome.js
JacobDFrank/moire-effect
05e19452055d7bc47ebbf1827c8933758f2fe014
[ "MIT" ]
1
2019-10-25T21:03:24.000Z
2019-10-25T21:03:24.000Z
node_modules/surge/lib/middleware/welcome.js
JacobDFrank/moire-effect
05e19452055d7bc47ebbf1827c8933758f2fe014
[ "MIT" ]
4
2018-02-26T21:29:12.000Z
2018-03-21T09:48:15.000Z
node_modules/surge/lib/middleware/welcome.js
JacobDFrank/moire-effect
05e19452055d7bc47ebbf1827c8933758f2fe014
[ "MIT" ]
1
2020-05-22T23:14:24.000Z
2020-05-22T23:14:24.000Z
var helpers = require("./util/helpers.js") module.exports = function(req, next){ if (req.creds == null) { helpers.log(" Welcome to " + (req.config.name || "Surge").bold + "! (" + req.config.platform +")" ) if (req.config.name) { helpers.log(" Powered by Surge".grey).hr() } helpers.log(" Please login or create an account by entering your email and password:").hr() } else { if(req.config.name){ helpers.log(" " + req.config.name.bold + " - " + (req.config.platform || "surge.sh")) helpers.log(" Powered by Surge".grey) } else { helpers.log(" Surge".bold + " - surge.sh") } helpers.hr() } next() }
34.2
106
0.564327
2894675dec1b44f244e13ecb1feb3d4764864fcc
7,583
js
JavaScript
ohara-manager/client/src/store/epics/__tests__/topic/createAndStartTopicEpic.test.js
mathsigit/ohara
bc1706565387868a5bbfcbf73d16bafa856ec54b
[ "Apache-2.0" ]
1
2019-03-28T02:33:36.000Z
2019-03-28T02:33:36.000Z
ohara-manager/client/src/store/epics/__tests__/topic/createAndStartTopicEpic.test.js
mathsigit/ohara
bc1706565387868a5bbfcbf73d16bafa856ec54b
[ "Apache-2.0" ]
null
null
null
ohara-manager/client/src/store/epics/__tests__/topic/createAndStartTopicEpic.test.js
mathsigit/ohara
bc1706565387868a5bbfcbf73d16bafa856ec54b
[ "Apache-2.0" ]
1
2020-07-03T11:05:45.000Z
2020-07-03T11:05:45.000Z
/* * Copyright 2019 is-land * * 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 { of, throwError } from 'rxjs'; import { delay } from 'rxjs/operators'; import { TestScheduler } from 'rxjs/testing'; import { omit } from 'lodash'; import * as topicApi from 'api/topicApi'; import createAndStartTopicEpic from '../../topic/createAndStartTopicEpic'; import * as actions from 'store/actions'; import { getId } from 'utils/object'; import { entity as topicEntity } from 'api/__mocks__/topicApi'; import { CELL_STATUS, LOG_LEVEL } from 'const'; import { SERVICE_STATE } from 'api/apiInterface/clusterInterface'; jest.mock('api/topicApi'); const paperApi = { updateElement: jest.fn(), removeElement: jest.fn(), getCell: jest.fn(), }; const promise = { resolve: jest.fn(), reject: jest.fn() }; const topicId = getId(topicEntity); beforeEach(() => { jest.restoreAllMocks(); jest.resetAllMocks(); }); const makeTestScheduler = () => new TestScheduler((actual, expected) => { expect(actual).toEqual(expected); }); it('should be able to create and start a topic', () => { makeTestScheduler().run((helpers) => { const { hot, expectObservable, expectSubscriptions, flush } = helpers; const input = ' ^-a '; const expected = '--a 99ms (mn) 196ms v'; const subs = ' ^----------------------'; const id = '1234'; const action$ = hot(input, { a: { type: actions.createAndStartTopic.TRIGGER, payload: { values: { ...topicEntity, id }, options: { paperApi }, ...promise, }, }, }); const output$ = createAndStartTopicEpic(action$); expectObservable(output$).toBe(expected, { a: { type: actions.createTopic.REQUEST, payload: { topicId, }, }, m: { type: actions.createTopic.SUCCESS, payload: { topicId, entities: { topics: { [topicId]: { ...topicEntity, id }, }, }, result: topicId, }, }, n: { type: actions.startTopic.REQUEST, payload: { topicId, }, }, v: { type: actions.startTopic.SUCCESS, payload: { topicId, entities: { topics: { [topicId]: { ...topicEntity, id, state: SERVICE_STATE.RUNNING, }, }, }, result: topicId, }, }, }); expectSubscriptions(action$.subscriptions).toBe(subs); flush(); expect(paperApi.updateElement).toHaveBeenCalledTimes(2); expect(paperApi.updateElement).toHaveBeenCalledWith(id, { status: CELL_STATUS.running, }); expect(promise.resolve).toHaveBeenCalledTimes(1); }); }); it('should handle start error', () => { const spyGet = jest.spyOn(topicApi, 'get'); for (let i = 0; i < 20; i++) { spyGet.mockReturnValueOnce( of({ status: 200, title: 'retry mock get data', data: { ...omit(topicEntity, 'state') }, }).pipe(delay(100)), ); } makeTestScheduler().run((helpers) => { const { hot, expectObservable, expectSubscriptions, flush } = helpers; const displayName = 'T1'; const id = '1234'; const values = { ...topicEntity, id, state: undefined, displayName }; const input = ' ^-a '; const expected = '--a 99ms (bc) 32196ms (de)'; const subs = ' ^---------------------------'; const action$ = hot(input, { a: { type: actions.createAndStartTopic.TRIGGER, payload: { values, options: { paperApi }, ...promise, }, }, }); const output$ = createAndStartTopicEpic(action$); expectObservable(output$).toBe(expected, { a: { type: actions.createTopic.REQUEST, payload: { topicId }, }, b: { type: actions.createTopic.SUCCESS, payload: { topicId, entities: { topics: { [topicId]: values, }, }, result: topicId, }, }, c: { type: actions.startTopic.REQUEST, payload: { topicId }, }, d: { type: actions.createAndStartTopic.FAILURE, payload: { topicId, data: topicEntity, status: 200, title: `Failed to start topic "${displayName}": Unable to confirm the status of the topic is running`, }, }, e: { type: actions.createEventLog.TRIGGER, payload: { data: topicEntity, status: 200, title: `Failed to start topic "${displayName}": Unable to confirm the status of the topic is running`, type: LOG_LEVEL.error, }, }, }); expectSubscriptions(action$.subscriptions).toBe(subs); flush(); expect(paperApi.updateElement).toHaveBeenCalledTimes(2); expect(paperApi.updateElement).toHaveBeenCalledWith(id, { status: CELL_STATUS.pending, }); expect(paperApi.updateElement).toHaveBeenCalledWith(id, { status: CELL_STATUS.stopped, }); expect(promise.reject).toHaveBeenCalledTimes(1); }); }); it('should handle create error', () => { const displayName = 'T1'; const error = { status: -1, data: {}, title: 'Create topic "abc" failed.', }; const expectedError = { ...error, title: `Create topic "${displayName}" failed.`, }; jest.spyOn(topicApi, 'create').mockReturnValue(throwError(error)); makeTestScheduler().run((helpers) => { const { hot, expectObservable, expectSubscriptions, flush } = helpers; const input = ' ^-a '; const expected = '--(abc)'; const subs = ' ^------'; const id = '1234'; const action$ = hot(input, { a: { type: actions.createAndStartTopic.TRIGGER, payload: { values: { ...topicEntity, id, displayName }, options: { paperApi }, ...promise, }, }, }); const output$ = createAndStartTopicEpic(action$); expectObservable(output$).toBe(expected, { a: { type: actions.createTopic.REQUEST, payload: { topicId, }, }, b: { type: actions.createAndStartTopic.FAILURE, payload: error, }, c: { type: actions.createEventLog.TRIGGER, payload: { ...expectedError, type: LOG_LEVEL.error }, }, }); expectSubscriptions(action$.subscriptions).toBe(subs); flush(); expect(paperApi.updateElement).toHaveBeenCalledTimes(1); expect(paperApi.updateElement).toHaveBeenCalledWith(id, { status: CELL_STATUS.pending, }); expect(promise.reject).toHaveBeenCalledTimes(1); expect(promise.reject).toHaveBeenCalledWith(error); expect(paperApi.removeElement).toHaveBeenCalledTimes(1); expect(paperApi.removeElement).toHaveBeenCalledWith(id); }); });
26.329861
112
0.568113
289472b0bf0c3d478a2603a9887748b741b7cf34
946
js
JavaScript
src/handleChannelJoined.js
baob/submit-this
5a03f53e65a0119e8cbee8c6e08d053ef79f73ad
[ "MIT" ]
2
2020-04-13T09:49:50.000Z
2020-04-13T09:49:51.000Z
src/handleChannelJoined.js
baob/submit-this
5a03f53e65a0119e8cbee8c6e08d053ef79f73ad
[ "MIT" ]
3
2020-04-15T07:39:48.000Z
2020-04-18T12:06:46.000Z
src/handleChannelJoined.js
baob/submit-this
5a03f53e65a0119e8cbee8c6e08d053ef79f73ad
[ "MIT" ]
null
null
null
const sendIntroduction = require('./sendIntroduction'); const handleChannelJoined = async (event, web) => { console.log( `Received a member_joined_channel event: user ${event.user} in channel ${event.channel}` ); console.log('---- event:', event); // console.log('---- web:', web); const authTestResponse = await web.auth.test(); const botUser = authTestResponse.user_id; const botName = authTestResponse.user; // console.log('---- authTestResponse:', authTestResponse); if (botUser == event.user) { console.log( '---- bot', botName, 'joined the channel invited by', event.inviter ); sendIntroduction(event, web); } else { console.log( '---- user', event.user, 'joined the channel invited by', event.inviter ); } }; module.exports = handleChannelJoined;
27.823529
96
0.567653
2894850d444ab52b93ca94c12172bc679ab96875
13,456
js
JavaScript
public/test/AgeOfTroyEGT/html5/lib/puremvc.min.js
heidi-dang/game
95cdf371282cbabc44b4cdde6d31acd5779d5aa0
[ "MIT" ]
null
null
null
public/test/AgeOfTroyEGT/html5/lib/puremvc.min.js
heidi-dang/game
95cdf371282cbabc44b4cdde6d31acd5779d5aa0
[ "MIT" ]
null
null
null
public/test/AgeOfTroyEGT/html5/lib/puremvc.min.js
heidi-dang/game
95cdf371282cbabc44b4cdde6d31acd5779d5aa0
[ "MIT" ]
2
2021-07-05T21:47:41.000Z
2022-01-21T04:45:41.000Z
var puremvc;!function(puremvc){"use strict";var Observer=function(){function Observer(notifyMethod,notifyContext){this.notify=null,this.context=null,this.setNotifyMethod(notifyMethod),this.setNotifyContext(notifyContext)}return Observer.prototype.getNotifyMethod=function(){return this.notify},Observer.prototype.setNotifyMethod=function(notifyMethod){this.notify=notifyMethod},Observer.prototype.getNotifyContext=function(){return this.context},Observer.prototype.setNotifyContext=function(notifyContext){this.context=notifyContext},Observer.prototype.notifyObserver=function(notification){this.getNotifyMethod().call(this.getNotifyContext(),notification)},Observer.prototype.compareNotifyContext=function(object){return object===this.context},Observer}();puremvc.Observer=Observer}(puremvc||(puremvc={}));var puremvc;!function(puremvc){"use strict";var View=function(){function View(key){if(this.mediatorMap=null,this.observerMap=null,this.multitonKey=null,View.instanceMap[key])throw Error(View.MULTITON_MSG);View.instanceMap[key]=this,this.multitonKey=key,this.mediatorMap={},this.observerMap={},this.initializeView()}return View.prototype.initializeView=function(){},View.prototype.registerObserver=function(notificationName,observer){var observers=this.observerMap[notificationName];observers?observers.push(observer):this.observerMap[notificationName]=[observer]},View.prototype.removeObserver=function(notificationName,notifyContext){for(var observers=this.observerMap[notificationName],i=observers.length;i--;){var observer=observers[i];if(observer.compareNotifyContext(notifyContext)){observers.splice(i,1);break}}0==observers.length&&delete this.observerMap[notificationName]},View.prototype.notifyObservers=function(notification){var notificationName=notification.getName(),observersRef=this.observerMap[notificationName];if(observersRef)for(var observers=observersRef.slice(0),len=observers.length,i=0;i<len;i++){var observer=observers[i];observer.notifyObserver(notification)}},View.prototype.registerMediator=function(mediator){var name=mediator.getMediatorName();if(!this.mediatorMap[name]){mediator.initializeNotifier(this.multitonKey),this.mediatorMap[name]=mediator;var interests=mediator.listNotificationInterests(),len=interests.length;if(len>0)for(var observer=new puremvc.Observer(mediator.handleNotification,mediator),i=0;i<len;i++)this.registerObserver(interests[i],observer);mediator.onRegister()}},View.prototype.retrieveMediator=function(mediatorName){return this.mediatorMap[mediatorName]||null},View.prototype.removeMediator=function(mediatorName){var mediator=this.mediatorMap[mediatorName];if(!mediator)return null;for(var interests=mediator.listNotificationInterests(),i=interests.length;i--;)this.removeObserver(interests[i],mediator);return delete this.mediatorMap[mediatorName],mediator.onRemove(),mediator},View.prototype.hasMediator=function(mediatorName){return null!=this.mediatorMap[mediatorName]},View.getInstance=function(key){return View.instanceMap[key]||(View.instanceMap[key]=new View(key)),View.instanceMap[key]},View.removeView=function(key){delete View.instanceMap[key]},View.MULTITON_MSG="View instance for this multiton key already constructed!",View.instanceMap={},View}();puremvc.View=View}(puremvc||(puremvc={}));var puremvc;!function(puremvc){"use strict";var Controller=function(){function Controller(key){if(this.view=null,this.commandMap=null,this.multitonKey=null,Controller.instanceMap[key])throw Error(Controller.MULTITON_MSG);Controller.instanceMap[key]=this,this.multitonKey=key,this.commandMap={},this.initializeController()}return Controller.prototype.initializeController=function(){this.view=puremvc.View.getInstance(this.multitonKey)},Controller.prototype.executeCommand=function(notification){var commandClassRef=this.commandMap[notification.getName()];if(commandClassRef){var command=new commandClassRef;command.initializeNotifier(this.multitonKey),command.execute(notification)}},Controller.prototype.registerCommand=function(notificationName,commandClassRef){this.commandMap[notificationName]||this.view.registerObserver(notificationName,new puremvc.Observer(this.executeCommand,this)),this.commandMap[notificationName]=commandClassRef},Controller.prototype.hasCommand=function(notificationName){return null!=this.commandMap[notificationName]},Controller.prototype.removeCommand=function(notificationName){this.hasCommand(notificationName)&&(this.view.removeObserver(notificationName,this),delete this.commandMap[notificationName])},Controller.getInstance=function(key){return Controller.instanceMap[key]||(Controller.instanceMap[key]=new Controller(key)),Controller.instanceMap[key]},Controller.removeController=function(key){delete Controller.instanceMap[key]},Controller.MULTITON_MSG="Controller instance for this multiton key already constructed!",Controller.instanceMap={},Controller}();puremvc.Controller=Controller}(puremvc||(puremvc={}));var puremvc;!function(puremvc){"use strict";var Model=function(){function Model(key){if(this.proxyMap=null,this.multitonKey=null,Model.instanceMap[key])throw Error(Model.MULTITON_MSG);Model.instanceMap[key]=this,this.multitonKey=key,this.proxyMap={},this.initializeModel()}return Model.prototype.initializeModel=function(){},Model.prototype.registerProxy=function(proxy){proxy.initializeNotifier(this.multitonKey),this.proxyMap[proxy.getProxyName()]=proxy,proxy.onRegister()},Model.prototype.removeProxy=function(proxyName){var proxy=this.proxyMap[proxyName];return proxy&&(delete this.proxyMap[proxyName],proxy.onRemove()),proxy},Model.prototype.retrieveProxy=function(proxyName){return this.proxyMap[proxyName]||null},Model.prototype.hasProxy=function(proxyName){return null!=this.proxyMap[proxyName]},Model.getInstance=function(key){return Model.instanceMap[key]||(Model.instanceMap[key]=new Model(key)),Model.instanceMap[key]},Model.removeModel=function(key){delete Model.instanceMap[key]},Model.MULTITON_MSG="Model instance for this multiton key already constructed!",Model.instanceMap={},Model}();puremvc.Model=Model}(puremvc||(puremvc={}));var puremvc;!function(puremvc){"use strict";var Notification=function(){function Notification(name,body,type){void 0===body&&(body=null),void 0===type&&(type=null),this.name=null,this.body=null,this.type=null,this.name=name,this.body=body,this.type=type}return Notification.prototype.getName=function(){return this.name},Notification.prototype.setBody=function(body){this.body=body},Notification.prototype.getBody=function(){return this.body},Notification.prototype.setType=function(type){this.type=type},Notification.prototype.getType=function(){return this.type},Notification.prototype.toString=function(){var msg="Notification Name: "+this.getName();return msg+="\nBody:"+(null==this.getBody()?"null":this.getBody().toString()),msg+="\nType:"+(null==this.getType()?"null":this.getType())},Notification}();puremvc.Notification=Notification}(puremvc||(puremvc={}));var puremvc;!function(puremvc){"use strict";var Facade=function(){function Facade(key){if(this.model=null,this.view=null,this.controller=null,this.multitonKey=null,Facade.instanceMap[key])throw Error(Facade.MULTITON_MSG);this.initializeNotifier(key),Facade.instanceMap[key]=this,this.initializeFacade()}return Facade.prototype.initializeFacade=function(){this.initializeModel(),this.initializeController(),this.initializeView()},Facade.prototype.initializeModel=function(){this.model||(this.model=puremvc.Model.getInstance(this.multitonKey))},Facade.prototype.initializeController=function(){this.controller||(this.controller=puremvc.Controller.getInstance(this.multitonKey))},Facade.prototype.initializeView=function(){this.view||(this.view=puremvc.View.getInstance(this.multitonKey))},Facade.prototype.registerCommand=function(notificationName,commandClassRef){this.controller.registerCommand(notificationName,commandClassRef)},Facade.prototype.removeCommand=function(notificationName){this.controller.removeCommand(notificationName)},Facade.prototype.hasCommand=function(notificationName){return this.controller.hasCommand(notificationName)},Facade.prototype.registerProxy=function(proxy){this.model.registerProxy(proxy)},Facade.prototype.retrieveProxy=function(proxyName){return this.model.retrieveProxy(proxyName)},Facade.prototype.removeProxy=function(proxyName){var proxy;return this.model&&(proxy=this.model.removeProxy(proxyName)),proxy},Facade.prototype.hasProxy=function(proxyName){return this.model.hasProxy(proxyName)},Facade.prototype.registerMediator=function(mediator){this.view&&this.view.registerMediator(mediator)},Facade.prototype.retrieveMediator=function(mediatorName){return this.view.retrieveMediator(mediatorName)},Facade.prototype.removeMediator=function(mediatorName){var mediator;return this.view&&(mediator=this.view.removeMediator(mediatorName)),mediator},Facade.prototype.hasMediator=function(mediatorName){return this.view.hasMediator(mediatorName)},Facade.prototype.notifyObservers=function(notification){this.view&&this.view.notifyObservers(notification)},Facade.prototype.sendNotification=function(name,body,type){void 0===body&&(body=null),void 0===type&&(type=null),this.notifyObservers(new puremvc.Notification(name,body,type))},Facade.prototype.initializeNotifier=function(key){this.multitonKey=key},Facade.getInstance=function(key){return Facade.instanceMap[key]||(Facade.instanceMap[key]=new Facade(key)),Facade.instanceMap[key]},Facade.hasCore=function(key){return!!Facade.instanceMap[key]},Facade.removeCore=function(key){Facade.instanceMap[key]&&(puremvc.Model.removeModel(key),puremvc.View.removeView(key),puremvc.Controller.removeController(key),delete Facade.instanceMap[key])},Facade.MULTITON_MSG="Facade instance for this multiton key already constructed!",Facade.instanceMap={},Facade}();puremvc.Facade=Facade}(puremvc||(puremvc={}));var puremvc;!function(puremvc){"use strict";var Notifier=function(){function Notifier(){this.multitonKey=null}return Notifier.prototype.initializeNotifier=function(key){this.multitonKey=key},Notifier.prototype.sendNotification=function(name,body,type){void 0===body&&(body=null),void 0===type&&(type=null),this.facade()&&this.facade().sendNotification(name,body,type)},Notifier.prototype.facade=function(){if(null===this.multitonKey)throw Error(Notifier.MULTITON_MSG);return puremvc.Facade.getInstance(this.multitonKey)},Notifier.MULTITON_MSG="multitonKey for this Notifier not yet initialized!",Notifier}();puremvc.Notifier=Notifier}(puremvc||(puremvc={}));var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},puremvc;!function(puremvc){"use strict";var MacroCommand=function(_super){function MacroCommand(){_super.call(this),this.subCommands=null,this.subCommands=new Array,this.initializeMacroCommand()}return __extends(MacroCommand,_super),MacroCommand.prototype.initializeMacroCommand=function(){},MacroCommand.prototype.addSubCommand=function(commandClassRef){this.subCommands.push(commandClassRef)},MacroCommand.prototype.execute=function(notification){for(var subCommands=this.subCommands.slice(0),len=this.subCommands.length,i=0;i<len;i++){var commandClassRef=subCommands[i],commandInstance=new commandClassRef;commandInstance.initializeNotifier(this.multitonKey),commandInstance.execute(notification)}this.subCommands.splice(0)},MacroCommand}(puremvc.Notifier);puremvc.MacroCommand=MacroCommand}(puremvc||(puremvc={}));var puremvc;!function(puremvc){"use strict";var SimpleCommand=function(_super){function SimpleCommand(){_super.apply(this,arguments)}return __extends(SimpleCommand,_super),SimpleCommand.prototype.execute=function(notification){},SimpleCommand}(puremvc.Notifier);puremvc.SimpleCommand=SimpleCommand}(puremvc||(puremvc={}));var puremvc;!function(puremvc){"use strict";var Mediator=function(_super){function Mediator(mediatorName,viewComponent){void 0===mediatorName&&(mediatorName=null),void 0===viewComponent&&(viewComponent=null),_super.call(this),this.mediatorName=null,this.viewComponent=null,this.mediatorName=null!=mediatorName?mediatorName:Mediator.NAME,this.viewComponent=viewComponent}return __extends(Mediator,_super),Mediator.prototype.getMediatorName=function(){return this.mediatorName},Mediator.prototype.getViewComponent=function(){return this.viewComponent},Mediator.prototype.setViewComponent=function(viewComponent){this.viewComponent=viewComponent},Mediator.prototype.listNotificationInterests=function(){return new Array},Mediator.prototype.handleNotification=function(notification){},Mediator.prototype.onRegister=function(){},Mediator.prototype.onRemove=function(){},Mediator.NAME="Mediator",Mediator}(puremvc.Notifier);puremvc.Mediator=Mediator}(puremvc||(puremvc={}));var puremvc;!function(puremvc){"use strict";var Proxy=function(_super){function Proxy(proxyName,data){void 0===proxyName&&(proxyName=null),void 0===data&&(data=null),_super.call(this),this.proxyName=null,this.data=null,this.proxyName=null!=proxyName?proxyName:Proxy.NAME,null!=data&&this.setData(data)}return __extends(Proxy,_super),Proxy.prototype.getProxyName=function(){return this.proxyName},Proxy.prototype.setData=function(data){this.data=data},Proxy.prototype.getData=function(){return this.data},Proxy.prototype.onRegister=function(){},Proxy.prototype.onRemove=function(){},Proxy.NAME="Proxy",Proxy}(puremvc.Notifier);puremvc.Proxy=Proxy}(puremvc||(puremvc={}));
13,456
13,456
0.828032
28951978176578de69ac29eae94adeb2c2470196
5,407
js
JavaScript
public/system/zyzl-admin/assets/scripts/modules/charts/forceChart.js
baby-plan/common-website
309fe8de442ae1a3607960931913546222d9af21
[ "MIT" ]
6
2017-08-21T00:52:19.000Z
2018-12-03T01:53:53.000Z
public/system/zyzl-admin/assets/scripts/modules/charts/forceChart.js
baby-plan/common-website
309fe8de442ae1a3607960931913546222d9af21
[ "MIT" ]
null
null
null
public/system/zyzl-admin/assets/scripts/modules/charts/forceChart.js
baby-plan/common-website
309fe8de442ae1a3607960931913546222d9af21
[ "MIT" ]
null
null
null
define(['jquery', 'echarts'], ($, echarts) => { let module = {}; let chart; module.init = (el) => { var chart = echarts.init(document.getElementById(el)); var options = { title: { text: '人物关系:乔布斯', subtext: '数据来自人立方', x: 'right', y: 'bottom' }, tooltip: { trigger: 'item', formatter: '{a} : {b}' }, toolbox: { show: true, feature: { restore: { show: true }, magicType: { show: true, type: ['force', 'chord'] }, saveAsImage: { show: true } } }, legend: { x: 'left', data: ['家人', '朋友'] }, series: [{ type: 'force', name: "人物关系", ribbonType: false, categories: [{ name: '人物' }, { name: '家人' }, { name: '朋友' } ], itemStyle: { normal: { label: { show: true, textStyle: { color: '#333' } }, nodeStyle: { brushType: 'both', borderColor: 'rgba(255,215,0,0.4)', borderWidth: 1 }, linkStyle: { type: 'curve' } }, emphasis: { label: { show: false // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE }, nodeStyle: { //r: 30 }, linkStyle: {} } }, useWorker: false, minRadius: 15, maxRadius: 25, gravity: 1.1, scaling: 1.1, roam: 'move', nodes: [{ category: 0, name: '乔布斯', value: 10 }, { category: 1, name: '丽萨-乔布斯', value: 2 }, { category: 1, name: '保罗-乔布斯', value: 3 }, { category: 1, name: '克拉拉-乔布斯', value: 3 }, { category: 1, name: '劳伦-鲍威尔', value: 7 }, { category: 2, name: '史蒂夫-沃兹尼艾克', value: 5 }, { category: 2, name: '奥巴马', value: 8 }, { category: 2, name: '比尔-盖茨', value: 9 }, { category: 2, name: '乔纳森-艾夫', value: 4 }, { category: 2, name: '蒂姆-库克', value: 4 }, { category: 2, name: '龙-韦恩', value: 1 }, ], links: [{ source: '丽萨-乔布斯', target: '乔布斯', weight: 1, name: '女儿' }, { source: '保罗-乔布斯', target: '乔布斯', weight: 2, name: '父亲' }, { source: '克拉拉-乔布斯', target: '乔布斯', weight: 1, name: '母亲' }, { source: '劳伦-鲍威尔', target: '乔布斯', weight: 2 }, { source: '史蒂夫-沃兹尼艾克', target: '乔布斯', weight: 3, name: '合伙人' }, { source: '奥巴马', target: '乔布斯', weight: 1 }, { source: '比尔-盖茨', target: '乔布斯', weight: 6, name: '竞争对手' }, { source: '乔纳森-艾夫', target: '乔布斯', weight: 1, name: '爱将' }, { source: '蒂姆-库克', target: '乔布斯', weight: 1 }, { source: '龙-韦恩', target: '乔布斯', weight: 1 }, { source: '克拉拉-乔布斯', target: '保罗-乔布斯', weight: 1 }, { source: '奥巴马', target: '保罗-乔布斯', weight: 1 }, { source: '奥巴马', target: '克拉拉-乔布斯', weight: 1 }, { source: '奥巴马', target: '劳伦-鲍威尔', weight: 1 }, { source: '奥巴马', target: '史蒂夫-沃兹尼艾克', weight: 1 }, { source: '比尔-盖茨', target: '奥巴马', weight: 6 }, { source: '比尔-盖茨', target: '克拉拉-乔布斯', weight: 1 }, { source: '蒂姆-库克', target: '奥巴马', weight: 1 } ] }] }; chart.setOption(options); $(window).on('resize', chart.resize); }; module.destroy = () => { if (chart) { $(window).off('resize', chart.resize); } }; return module; });
21.714859
64
0.280562
28953c5077fce602f817b60b3498aa54aec023dc
2,253
js
JavaScript
src/components/auth/signin.js
dapinitial/ReactClientSetup
cbcce4b76f0725b201aca211fd7d6a025f477425
[ "MIT" ]
null
null
null
src/components/auth/signin.js
dapinitial/ReactClientSetup
cbcce4b76f0725b201aca211fd7d6a025f477425
[ "MIT" ]
null
null
null
src/components/auth/signin.js
dapinitial/ReactClientSetup
cbcce4b76f0725b201aca211fd7d6a025f477425
[ "MIT" ]
null
null
null
import React, { Component } from "react"; import { reduxForm, Field } from "redux-form"; import { connect } from "react-redux"; import * as actions from "../../actions"; const renderInput = field => { const { input, type } = field; return ( <div> <input {...field.input} type={field.type} /> {field.meta.touched && field.meta.error && <span className="error">{field.meta.error}</span>} </div> ); }; class Signin extends Component { handleFormSubmit({ email, password }) { console.log(email, password); // need something to log user in this.props.signinUser({ email, password }); } renderAlert() { if (this.props.errorMessage) { return ( <div className="danger alert-danger"> <strong>Ooops!</strong> {this.props.errorMessage} </div> ); } } render() { const { handleSubmit } = this.props; // return ( <form className="input-group" onSubmit={handleSubmit(this.handleFormSubmit.bind(this))} > <div className="form-group"> <label>Email:</label> <Field name="email" // Specify field name component={renderInput} // Specify render component above type="email" // Specify "type" prop passed to renderInput /> {/* <input {...email} placeholder="john.doe@example.com" type="email" /> */} </div> <div className="form-group"> <label>Password:</label> <Field name="password" // Specify field name component={renderInput} // Specify render component above type="password" // Specify "type" prop passed to renderInput /> {/* <input {...password} placeholder="password" type="password" /> */} </div> {this.renderAlert()} <button action="submit" className="button"> Sign in </button> </form> ); } } const mapStateToProps = state => { //console.log("state", state); return { form: state.form, errorMessage: state.authReducer.error }; }; Signin = connect(mapStateToProps, actions)(Signin); export default (Signin = reduxForm({ form: "signin" // no fields array given })(Signin));
27.47561
86
0.575677
2896b3abd08b538ef6e054387e535e5a1b308e60
2,848
js
JavaScript
etc/Hatsu Logger.js
NatsuX1448/Hatsu
1a9528cdb7b3f75f5b005ec874943cd56cd02086
[ "0BSD" ]
2
2021-03-18T10:36:59.000Z
2021-03-21T05:10:05.000Z
etc/Hatsu Logger.js
NatsuX1448/Hatsu
1a9528cdb7b3f75f5b005ec874943cd56cd02086
[ "0BSD" ]
null
null
null
etc/Hatsu Logger.js
NatsuX1448/Hatsu
1a9528cdb7b3f75f5b005ec874943cd56cd02086
[ "0BSD" ]
null
null
null
//Libs //const clr = require('chalk'); const logger = require('log4js'); const hatsuLog = logger.configure({ appenders:{ HatsuError: { type: "file", filename: "log/hatsuku.log" }, HatsuConsoleError: { type: "console", layout: {type: "coloured"} }, HatsuInfo: { type: "file", filename: "log/hatsuku.log" }, HatsuConsoleInfo: { type: "console", layout: {type: "coloured"} }, HatsuDebug: { type: "file", filename: "log/hatsuku.log" }, HatsuConsoleDebug: { type: "console", layout: {type: "coloured"} }, HatsuMusicDebug: { type: "file", filename: "log/hatsuMusicNode.log", }, HatsuMusicDebugConsole: { type: "console", layout: {type: "coloured"} }, HatsuMusicError: { type: "file", filename: "log/hatsuMusicNode.log", }, HatsuMusicErrorConsole: { type: "console", layout: {type: "coloured"} }, HatsuMusicWarn: { type: "file", filename: "log/hatsuMusicNode.log", }, HatsuMusicWarnConsole: { type: "console", layout: {type: "coloured"} }, HatsuWarn: { type: "file", filename: "log/hatsuku.log", }, HatsuWarnConsole: { type: "console", layout: {type: "coloured"} } }, categories: { default: { appenders: ["HatsuInfo", "HatsuConsoleInfo"], level: "info" }, HatsuInfo: { appenders: ["HatsuInfo", "HatsuConsoleInfo"], level: "info" }, HatsuError: { appenders: ["HatsuError", "HatsuConsoleError"], level: "error" }, HatsuDebug: { appenders: ["HatsuDebug", "HatsuConsoleDebug"], level: "debug" }, HatsuMusicDebug: { appenders: ["HatsuMusicDebug", "HatsuMusicDebugConsole"], level: "debug" }, HatsuMusicError: { appenders: ["HatsuMusicError", "HatsuMusicErrorConsole"], level: "error" }, HatsuMusicWarn: { appenders: ["HatsuMusicWarn", "HatsuMusicWarnConsole"], level: "warn" }, HatsuWarn: { appenders: ["HatsuWarn", "HatsuWarnConsole"], level: "warn" } } /* appenders: { HatsuError: { type: ["file", "console"], filename: "Hatsuku.log" } }, categories: { default: { appenders: ["HatsuError"], level: "error" } } */ }); module.exports = hatsuLog
26.37037
86
0.466643
2896c329ed1aec44d8b6751d90e41c62c06e2f05
1,654
js
JavaScript
front/hello-world/node_modules/zrender/lib/graphic/mixin/RectText.js
Mayasuyu/LabSystem
1008b63b078e5653bf508ccab8d442d2a77a605e
[ "Apache-2.0" ]
18
2021-03-01T06:17:40.000Z
2022-03-28T06:42:21.000Z
front/hello-world/node_modules/zrender/lib/graphic/mixin/RectText.js
Mayasuyu/LabSystem
1008b63b078e5653bf508ccab8d442d2a77a605e
[ "Apache-2.0" ]
12
2020-09-06T21:20:04.000Z
2022-03-08T22:58:34.000Z
front/hello-world/node_modules/zrender/lib/graphic/mixin/RectText.js
Mayasuyu/LabSystem
1008b63b078e5653bf508ccab8d442d2a77a605e
[ "Apache-2.0" ]
13
2021-03-01T06:17:45.000Z
2022-03-28T06:42:03.000Z
var textHelper = require("../helper/text"); var BoundingRect = require("../../core/BoundingRect"); var _constant = require("../constant"); var WILL_BE_RESTORED = _constant.WILL_BE_RESTORED; /** * Mixin for drawing text in a element bounding rect * @module zrender/mixin/RectText */ var tmpRect = new BoundingRect(); var RectText = function () {}; RectText.prototype = { constructor: RectText, /** * Draw text in a rect with specified position. * @param {CanvasRenderingContext2D} ctx * @param {Object} rect Displayable rect */ drawRectText: function (ctx, rect) { var style = this.style; rect = style.textRect || rect; // Optimize, avoid normalize every time. this.__dirty && textHelper.normalizeTextStyle(style, true); var text = style.text; // Convert to string text != null && (text += ''); if (!textHelper.needDrawText(text, style)) { return; } // FIXME // Do not provide prevEl to `textHelper.renderText` for ctx prop cache, // but use `ctx.save()` and `ctx.restore()`. Because the cache for rect // text propably break the cache for its host elements. ctx.save(); // Transform rect to view space var transform = this.transform; if (!style.transformText) { if (transform) { tmpRect.copy(rect); tmpRect.applyTransform(transform); rect = tmpRect; } } else { this.setTransform(ctx); } // transformText and textRotation can not be used at the same time. textHelper.renderText(this, ctx, text, style, rect, WILL_BE_RESTORED); ctx.restore(); } }; var _default = RectText; module.exports = _default;
26.677419
75
0.65659
28975f748c88988c9ff1c173d85d3dd2e3073422
2,604
js
JavaScript
smartux-build/inspector/inline_editor/SwatchPopoverHelper.js
powwowinc/devtools-frontend
c9f3856c82158a625ef4e78d335712122399c646
[ "BSD-3-Clause" ]
null
null
null
smartux-build/inspector/inline_editor/SwatchPopoverHelper.js
powwowinc/devtools-frontend
c9f3856c82158a625ef4e78d335712122399c646
[ "BSD-3-Clause" ]
null
null
null
smartux-build/inspector/inline_editor/SwatchPopoverHelper.js
powwowinc/devtools-frontend
c9f3856c82158a625ef4e78d335712122399c646
[ "BSD-3-Clause" ]
null
null
null
import*as Common from'../common/common.js';import*as UI from'../ui/ui.js';export class SwatchPopoverHelper extends Common.ObjectWrapper.ObjectWrapper{constructor(){super();this._popover=new UI.GlassPane.GlassPane();this._popover.registerRequiredCSS('inline_editor/swatchPopover.css');this._popover.setSizeBehavior(UI.GlassPane.SizeBehavior.MeasureContent);this._popover.setMarginBehavior(UI.GlassPane.MarginBehavior.Arrow);this._popover.element.addEventListener('mousedown',e=>e.consume(),false);this._hideProxy=this.hide.bind(this,true);this._boundOnKeyDown=this._onKeyDown.bind(this);this._boundFocusOut=this._onFocusOut.bind(this);this._isHidden=true;} _onFocusOut(event){if(!event.relatedTarget||event.relatedTarget.isSelfOrDescendant(this._view.contentElement)){return;} this._hideProxy();} isShowing(){return this._popover.isShowing();} show(view,anchorElement,hiddenCallback){if(this._popover.isShowing()){if(this._anchorElement===anchorElement){return;} this.hide(true);} delete this._isHidden;this._anchorElement=anchorElement;this._view=view;this._hiddenCallback=hiddenCallback;this.reposition();view.focus();const document=this._popover.element.ownerDocument;document.addEventListener('mousedown',this._hideProxy,false);document.defaultView.addEventListener('resize',this._hideProxy,false);this._view.contentElement.addEventListener('keydown',this._boundOnKeyDown,false);} reposition(){this._view.contentElement.removeEventListener('focusout',this._boundFocusOut,false);this._view.show(this._popover.contentElement);this._popover.setContentAnchorBox(this._anchorElement.boxInWindow());this._popover.show(this._anchorElement.ownerDocument);this._view.contentElement.addEventListener('focusout',this._boundFocusOut,false);if(!this._focusRestorer){this._focusRestorer=new UI.Widget.WidgetFocusRestorer(this._view);}} hide(commitEdit){if(this._isHidden){return;} const document=this._popover.element.ownerDocument;this._isHidden=true;this._popover.hide();document.removeEventListener('mousedown',this._hideProxy,false);document.defaultView.removeEventListener('resize',this._hideProxy,false);if(this._hiddenCallback){this._hiddenCallback.call(null,!!commitEdit);} this._focusRestorer.restore();delete this._anchorElement;if(this._view){this._view.detach();this._view.contentElement.removeEventListener('keydown',this._boundOnKeyDown,false);this._view.contentElement.removeEventListener('focusout',this._boundFocusOut,false);delete this._view;}} _onKeyDown(event){if(event.key==='Enter'){this.hide(true);event.consume(true);return;} if(event.key==='Escape'){this.hide(false);event.consume(true);}}}
200.307692
655
0.830261
2897858d55248f0c94c3e94b106ea7e6361398db
6,892
js
JavaScript
tests/newtests/test_events.js
tuncelmert/dom.js
84b7ab6cf9fa2f41aa4dfbe661f2747b938ca292
[ "BSD-2-Clause" ]
157
2015-01-01T06:04:08.000Z
2022-02-15T23:07:57.000Z
tests/newtests/test_events.js
tuncelmert/dom.js
84b7ab6cf9fa2f41aa4dfbe661f2747b938ca292
[ "BSD-2-Clause" ]
4
2015-10-25T02:33:27.000Z
2018-02-27T10:44:53.000Z
tests/newtests/test_events.js
tuncelmert/dom.js
84b7ab6cf9fa2f41aa4dfbe661f2747b938ca292
[ "BSD-2-Clause" ]
22
2015-04-13T23:19:12.000Z
2022-01-02T06:48:45.000Z
// In a node module, in non-strict mode, we get the global object // one way. In spidermonkey, in strict mode, we just use this. var global = (function() { return this; }()) || this; assert(Event); assert(EventTarget); assertThrows(function() { document.createEvent("this event does not exist"); }); var evt = document.createEvent("Event"); evt.initEvent("click", true, true); var node = document.createElement("div"); node.appendChild(document.createTextNode("click me")); var clicked = false; function click_handler(evt) { assert(evt.type === "click", evt.type); assert(evt.bubbles); assert(evt.cancelable); assert(evt.timeStamp); assert(!evt.isTrusted); assert(evt.target === node); assert(evt.currentTarget === node, evt.currentTarget); assert(evt.eventPhase === evt.AT_TARGET, evt.eventPhase); // TODO move these to another test that actually tests that they function evt.stopPropagation(); evt.stopImmediatePropagation(); evt.preventDefault(); assert(evt.defaultPrevented === true, evt.defaultPrevented); clicked = true; } node.addEventListener("click", click_handler, false); // should be able to add again and it will be ignored node.addEventListener("click", click_handler, false); // should be able to pass no event handler and it will be ignored node.addEventListener("click", null, false); document.body.appendChild(node); node.dispatchEvent(evt); assert(clicked); clicked = false; node.removeEventListener("click", click_handler, false); node.dispatchEvent(evt); assert(!clicked); var newevent = new Event("click", {bubbles: true, cancelable: true}); assert(newevent.type === "click", newevent.type); assert(newevent.bubbles === true); assert(newevent.cancelable === true); var defaultevent = new Event("click"); assert(defaultevent.type === "click", defaultevent.type); assert(defaultevent.bubbles === false); assert(defaultevent.cancelable === false); var customevent = new CustomEvent("foo", {bubbles: true, cancelable: true, detail: "hello"}); assert(customevent.type === "foo", customevent.type); assert(customevent.bubbles === true); assert(customevent.cancelable === true); assert(customevent.detail === "hello", customevent.detail); var defaultcustom = new CustomEvent("bar"); assert(defaultcustom.type === "bar", defaultcustom.type); assert(defaultcustom.bubbles === false); assert(defaultcustom.cancelable === false); // // Now test that idl and content attributes like "onclick" work correctly // to register event handlers, that they are invoked before listeners // registered with addEventListener, and that handlers registered with // content attributes are invoked with the correct scope chain. // // Also test that all of the event types work. // // Does an idl attribute event handler work? (function() { var elt = document.createElement("div"); var evt = document.createEvent("Event"); evt.initEvent("click", true, true); var pass = false; elt.onclick = function() { pass = true; } elt.dispatchEvent(evt); assert(pass === true); }()); // Does a content event handler work? (function() { var elt = document.createElement("div"); var evt = document.createEvent("Event"); evt.initEvent("click", true, true); global.pass = false; elt.setAttribute("onclick", "pass = true;"); elt.dispatchEvent(evt); assert(global.pass === true); }()); // Are handlers invoked before listeners? (function() { var elt = document.createElement("div"); var evt = document.createEvent("Event"); evt.initEvent("click", true, true); var s = ""; elt.addEventListener("click", function() { s += "foo"; }); elt.onclick = function() { s += "bar" }; elt.dispatchEvent(evt); assert(s === "barfoo"); }()); // Does the scope chain get set appropriately for content attribute handlers? // XXX: can't test the form element on the scope chain yet, since HTMLElement // does not yet support the form property (function() { var elt = document.createElement("div"); var evt = document.createEvent("Event"); evt.initEvent("click", true, true); global.x = "globalx"; document.y = "docy"; elt.z = "eltz"; global.result = ""; elt.setAttribute("onclick", "result = x + y + z;"); elt.dispatchEvent(evt); assert(global.result === "globalxdocyeltz"); }()); // Do idl and content handlers respond as expected when the other is set? (function() { var elt = document.createElement("div"); function f() {}; function g() {}; elt.onclick = f; assert(elt.onclick === f); elt.setAttribute("onclick", "foo()"); assert(elt.getAttribute("onclick") === "foo()"); assert(elt.onclick !== f); elt.onclick = g; assert(elt.onclick === g); // Surprising, but setting the idl attribute does not change the // value of the content attribute. This is the correct behavior. assert(elt.getAttribute("onclick") === "foo()"); }()); // Now test that all of these event handler attributes work ["abort", "canplay", "canplaythrough", "change", "click", "contextmenu", "cuechange", "dblclick", "drag", "dragend", "dragenter", "dragleave", "dragover", "dragstart", "drop", "durationchange", "emptied", "ended", "input", "invalid", "keydown", "keypress", "keyup", "loadeddata", "loadedmetadata", "loadstart", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "mousewheel", "pause", "play", "playing", "progress", "ratechange", "reset", "seeked", "seeking", "select", "show", "stalled", "submit", "suspend", "timeupdate", "volumechange", "waiting", "blur", "error", "focus", "load", "scroll" ].forEach(function(type) { var elt = document.createElement("div"); var evt = document.createEvent("Event"); evt.initEvent(type, true, true); var pass = false; elt["on" + type] = function() { pass = true; } elt.dispatchEvent(evt); assert(pass === true); global.pass = false; elt.setAttribute("on" + type, "pass = true;"); elt.dispatchEvent(evt); assert(global.pass === true); }); // In addition, make sure that the following ones work for <body> tags [ "afterprint", "beforeprint", "beforeunload", "blur", "error", "focus", "hashchange", "load", "message", "offline", "online", "pagehide", "pageshow", "popstate", "resize", "scroll", "storage", "unload", ].forEach(function(type) { var elt = document.body var evt = document.createEvent("Event"); evt.initEvent(type, true, true); var pass = false; elt["on" + type] = function() { pass = true; } elt.dispatchEvent(evt); assert(pass === true); global.pass = false; elt.setAttribute("on" + type, "pass = true;"); elt.dispatchEvent(evt); assert(global.pass === true); });
25.620818
93
0.652931
2897e5d42ffbfe55839b7c504680313c86bf0695
1,176
js
JavaScript
lib/tiny/errors-message.js
ecomplus/app-tiny
4418dd28c63a28aaae194e214daa4f247884fec7
[ "MIT" ]
null
null
null
lib/tiny/errors-message.js
ecomplus/app-tiny
4418dd28c63a28aaae194e214daa4f247884fec7
[ "MIT" ]
12
2020-03-16T23:59:00.000Z
2020-10-16T02:10:00.000Z
lib/tiny/errors-message.js
ecomplus/app-tiny
4418dd28c63a28aaae194e214daa4f247884fec7
[ "MIT" ]
1
2019-10-11T16:58:40.000Z
2019-10-11T16:58:40.000Z
module.exports = errorCode => { switch (errorCode) { case 1: return 'token não informado' case 2: return 'token inválido ou não encontrado' case 3: return 'XML mal formado ou com erros' case 4: return 'Erro de procesamento de XML' case 5: return 'API bloqueada ou sem acesso' case 6: return 'API bloqueada momentaneamente - muitos acessos no último minuto' case 7: return 'Espaço da empresa Esgotado' case 8: return 'Empresa Bloqueada' case 9: return 'Números de sequencia em duplicidade' case 10: return 'Parametro não informado' case 20: return 'A Consulta não retornou registros' case 21: return 'A Consulta retornou muitos registros' case 22: return 'O xml tem mais registros que o permitido por lote de envio' case 23: return 'A página que você está tentanto obter não existe' case 30: return 'Erro de Duplicidade de Registro' case 31: return 'Erros de Validação' case 32: return 'Registro não localizado' case 33: return 'Registro localizado em duplicidade' case 34: return 'Nota Fiscal não autorizada' case 99: return 'Sistema em manutenção' default: return 'Erro desconhecido' } }
47.04
84
0.715136
28986615bb91458a087113956192428ad9056ff9
922
es6
JavaScript
test/extension.es6
vsimonian/datumo
1f8c6c337f3da91fc5fc0e8871f2bf238fdf36f6
[ "MIT" ]
null
null
null
test/extension.es6
vsimonian/datumo
1f8c6c337f3da91fc5fc0e8871f2bf238fdf36f6
[ "MIT" ]
null
null
null
test/extension.es6
vsimonian/datumo
1f8c6c337f3da91fc5fc0e8871f2bf238fdf36f6
[ "MIT" ]
null
null
null
/* global describe, it */ 'use strict' let expect = require('chai').expect let testModels = require('./test-models') describe('Model extension', () => { describe('Subsets', () => { it('should only contain the given properties if inclusive', () => { let Person = testModels.createPersonModel() class Friend extends Person.subset('givenName', 'email') {} expect(Object.getOwnPropertyNames(Friend.schema)).to.have.length(2) expect(Friend.schema).to.contain.all.keys(['givenName', 'email']) }) it('should not contain the given properties if exclusive', () => { let Person = testModels.createPersonModel() class OfflinePerson extends Person.exclude('email') {} expect(Object.getOwnPropertyNames(OfflinePerson.schema)).to.have.length(3) expect(OfflinePerson.schema).to.contain.all.keys([ 'givenName', 'middleName', 'familyName' ]) }) }) })
31.793103
80
0.660521
2898bc7f355ddee53343168178f2e2ed7f0938f5
1,851
js
JavaScript
js/videovm.js
rajch/yt-chapters
207d6cfc9ea555de5b3056133e26afdb946efccf
[ "MIT" ]
2
2021-12-02T16:31:15.000Z
2022-01-15T18:57:59.000Z
js/videovm.js
rajch/yt-chapters
207d6cfc9ea555de5b3056133e26afdb946efccf
[ "MIT" ]
null
null
null
js/videovm.js
rajch/yt-chapters
207d6cfc9ea555de5b3056133e26afdb946efccf
[ "MIT" ]
1
2022-01-15T18:58:00.000Z
2022-01-15T18:58:00.000Z
"use strict"; Vue.component('video-section', { template: '\ <section id="video">\ <div class="videorow">\ <div class="videocol head">\ <label>Video ID:\ <input type="text" class="videoid" v-model="videodata.currentvideoid" />\ </label>\ <button disabled="true" v-bind:disabled="videodata.godisabled" v-on:click="getvideosnippet">Go</button>\ <button disabled="true" v-bind:disabled="!videodata.fetched" v-on:click="clearvideodata">Clear</button>\ </div>\ <div class="videocol">\ <label>Description: </label><button v-bind:disabled="!videodata.fetched" v-on:click="updatevideosnippet">Update</button>\ </div>\ </div>\ <div class="videorow">\ <div class="videocol">\ <iframe id="video-player" v-bind:src="embedUrl">\ </iframe>\ </div>\ <div class="videocol">\ <textarea v-model="videodata.currentdescriptiontext"></textarea>\ </div>\ </div>\ </section>\ ', props: ['videodata'], computed: { embedUrl: function () { return !this.videodata.currentvideoid ? "about:blank" : "https://www.youtube.com/embed/" + this.videodata.currentvideoid } }, watch: { "videodata.currentvideoid": function (val) { if (val === "") { this.$parent.resetVideoData() } } }, methods: { getvideosnippet: function () { this.$parent.getVideoSnippet() }, updatevideosnippet: function () { this.$parent.updateVideoSnippet() }, clearvideodata: function () { this.$parent.resetVideoData() } } })
34.277778
137
0.515397
28996f0d49265783263783c6d8cc9ce1addd93ae
5,761
js
JavaScript
Gruntfile.js
Krinkle/jquery-migrate
7cae174876bae4ac49662842cc10821500241e8f
[ "MIT" ]
null
null
null
Gruntfile.js
Krinkle/jquery-migrate
7cae174876bae4ac49662842cc10821500241e8f
[ "MIT" ]
null
null
null
Gruntfile.js
Krinkle/jquery-migrate
7cae174876bae4ac49662842cc10821500241e8f
[ "MIT" ]
null
null
null
"use strict"; /* global module:false */ module.exports = function( grunt ) { const gzip = require( "gzip-js" ); const karmaFilesExceptJQuery = [ "external/npo/npo.js", "dist/jquery-migrate.min.js", "test/data/compareVersions.js", "test/testinit.js", "test/migrate.js", "test/core.js", "test/ajax.js", "test/attributes.js", "test/css.js", "test/data.js", "test/deferred.js", "test/effects.js", "test/event.js", "test/manipulation.js", "test/offset.js", "test/serialize.js", "test/traversing.js", { pattern: "dist/jquery-migrate.js", included: false, served: true }, { pattern: "test/**/*.@(js|json|css|jpg|html|xml)", included: false, served: true } ]; // Project configuration. grunt.initConfig( { pkg: grunt.file.readJSON( "package.json" ), compare_size: { files: [ "dist/jquery-migrate.js", "dist/jquery-migrate.min.js" ], options: { compress: { gz: function( contents ) { return gzip.zip( contents, {} ).length; } }, cache: "build/.sizecache.json" } }, tests: { jquery: [ "dev+git", "min+git.min", "dev+git.slim", "min+git.slim.min" ], "jquery-3": [ "dev+3.x-git", "min+3.x-git.min", "dev+3.x-git.slim", "min+3.x-git.slim.min", "dev+3.5.1", "dev+3.5.1.slim", "dev+3.4.1", "dev+3.4.1.slim", "dev+3.3.1", "dev+3.3.1.slim", "dev+3.2.1", "dev+3.2.1.slim", "dev+3.1.1", "dev+3.1.1.slim", "dev+3.0.0", "dev+3.0.0.slim" ] }, banners: { tiny: "/*! <%= pkg.name %> <%= pkg.version %> - <%= pkg.homepage %> */" }, concat: { options: { banner: "/*!\n * <%= pkg.title || pkg.name %> - v<%= pkg.version %> - " + "<%= grunt.template.today('yyyy-mm-dd') %>\n" + " * Copyright <%= pkg.author.name %>\n */\n" }, dist: { src: "<%= files %>", dest: "dist/<%= pkg.name %>.js" } }, build: { all: { src: "src/migrate.js", dest: "dist/jquery-migrate.js" } }, qunit: { files: [ "test/**/index.html" ] }, eslint: { options: { // See https://github.com/sindresorhus/grunt-eslint/issues/119 quiet: true }, dist: { src: "dist/jquery-migrate.js" }, dev: { src: [ "Gruntfile.js", "build/**/*.js", "src/**/*.js", "test/**/*.js" ] } }, npmcopy: { all: { options: { destPrefix: "external" }, files: { "npo/npo.js": "native-promise-only/lib/npo.src.js", "qunit/qunit.js": "qunit/qunit/qunit.js", "qunit/qunit.css": "qunit/qunit/qunit.css", "qunit/LICENSE.txt": "qunit/LICENSE.txt" } } }, uglify: { all: { files: { "dist/jquery-migrate.min.js": [ "src/migratemute.js", "dist/jquery-migrate.js" ] }, options: { preserveComments: false, sourceMap: true, sourceMapName: "dist/jquery-migrate.min.map", report: "min", output: { "ascii_only": true, // Support: Android 4.0 only // UglifyJS 3 breaks Android 4.0 if this option is not enabled. // This is in lieu of setting ie8 for all of mangle, compress, and output "ie8": true }, banner: "/*! jQuery Migrate v<%= pkg.version %>" + " | (c) <%= pkg.author.name %> | jquery.org/license */", compress: { "hoist_funs": false, loops: false, // Support: IE <11 // typeofs transformation is unsafe for IE9-10 // See https://github.com/mishoo/UglifyJS2/issues/2198 typeofs: false } } } }, karma: { options: { customLaunchers: { ChromeHeadlessNoSandbox: { base: "ChromeHeadless", flags: [ "--no-sandbox" ] } }, frameworks: [ "qunit" ], files: [ "https://code.jquery.com/jquery-3.x-git.min.js", ...karmaFilesExceptJQuery ], client: { clearContext: false, qunit: { showUI: true, testTimeout: 5000 } }, reporters: [ "dots" ], autoWatch: false, concurrency: 3, captureTimeout: 20 * 1000, singleRun: true }, main: { browsers: [ "ChromeHeadless", "FirefoxHeadless" ] }, "jquery-slim": { browsers: [ "ChromeHeadless", "FirefoxHeadless" ], options: { files: [ "https://code.jquery.com/jquery-3.x-git.slim.min.js", ...karmaFilesExceptJQuery ] } }, // To debug tests with Karma: // 1. Run 'grunt karma:chrome-debug' or 'grunt karma:firefox-debug' // (any karma subtask that has singleRun=false) // 2. Press "Debug" in the opened browser window to start // the tests. Unlike the other karma tasks, the debug task will // keep the browser window open. "chrome-debug": { browsers: [ "Chrome" ], singleRun: false }, "firefox-debug": { browsers: [ "Firefox" ], singleRun: false } }, watch: { files: [ "src/*.js", "test/*.js" ], tasks: [ "build" ] } } ); // Load grunt tasks from NPM packages require( "load-grunt-tasks" )( grunt ); // Integrate jQuery migrate specific tasks grunt.loadTasks( "build/tasks" ); // Just an alias grunt.registerTask( "test", [ "karma:main", "karma:jquery-slim" ] ); grunt.registerTask( "lint", [ // Running the full eslint task without breaking it down to targets // would run the dist target first which would point to errors in the built // file, making it harder to fix them. We want to check the built file only // if we already know the source files pass the linter. "eslint:dev", "eslint:dist" ] ); grunt.registerTask( "default-no-test", [ "npmcopy", "build", "uglify", "lint", "compare_size" ] ); grunt.registerTask( "default", [ "default-no-test", "test" ] ); // For CI grunt.registerTask( "ci", [ "default" ] ); };
21.98855
85
0.55841
2899e93dfbcbe760e9fe5dd95a6d0dd00e8917e8
365
js
JavaScript
public/css/vendors/bower_components/nouislider/documentation/examples/skipstep-slider.js
wushan/kcc-api
0fee0f9e5198334f2ff848077fe73efdab4056f3
[ "MIT" ]
25
2015-07-13T22:16:36.000Z
2021-11-11T02:45:32.000Z
public/css/vendors/bower_components/nouislider/documentation/examples/skipstep-slider.js
wushan/kcc-api
0fee0f9e5198334f2ff848077fe73efdab4056f3
[ "MIT" ]
74
2015-12-01T18:57:47.000Z
2022-03-11T23:25:47.000Z
public/css/vendors/bower_components/nouislider/documentation/examples/skipstep-slider.js
wushan/kcc-api
0fee0f9e5198334f2ff848077fe73efdab4056f3
[ "MIT" ]
6
2016-01-08T21:12:43.000Z
2019-05-20T16:07:56.000Z
var skipSlider = document.getElementById('skipstep'); noUiSlider.create(skipSlider, { range: { 'min': 0, '10%': 10, '20%': 20, '30%': 30, // Nope, 40 is no fun. '50%': 50, '60%': 60, '70%': 70, // I never liked 80. '90%': 90, 'max': 100 }, snap: true, start: [20, 90] });
18.25
53
0.424658
289a6e59ec248709c63e6f369e8936d929d492aa
1,922
js
JavaScript
src/Sobre/Sobre.js
AndersonAlencarBarros/How2uSleepRepo
0f28d0931a0c13c8db01f0052e1ef41499925a23
[ "MIT" ]
null
null
null
src/Sobre/Sobre.js
AndersonAlencarBarros/How2uSleepRepo
0f28d0931a0c13c8db01f0052e1ef41499925a23
[ "MIT" ]
null
null
null
src/Sobre/Sobre.js
AndersonAlencarBarros/How2uSleepRepo
0f28d0931a0c13c8db01f0052e1ef41499925a23
[ "MIT" ]
null
null
null
import React, { Component } from 'react'; import './Sobre.css'; import { Link } from 'react-router-dom' import logo from '../Menu/logo512.png'; function MenuBar(){ return( <div className="App-header"> <ul className="menuBar"> <Link to="/"> <li className="itemLeft"> <img src={logo} className="App-logo" alt="logo" /> </li> </Link> <li className="itemLeft"> <h3 className="mainTitle">How2uSleep</h3> </li> </ul> </div> ); } class Sobre extends Component{ render() { return ( <div> <MenuBar /> <div id="sobreDiv"> <h1 id="sobreTitle">Sobre</h1> <p id="textoSobre"> Dormir mal parece ser um dos males da vida moderna. Só nos Estados Unidos, cerca de 70 milhões de pessoas sofrem com noites mal dormidas, sendo que 60% delas apresentam algum problema crônico. Com isso, a preocupação com a qualidade do sono vem ganhando destaque. Nesse sentido, a possibilidade de identificar a causa, em que fase da noite ocorre e poder associá-lo a outros fatores, pode ser de grande ajuda no tratamento do distúrbio do sono (insônia, apneia, privação crônica do sono, sonambulismo, bruxismo, síndrome dos movimentos periódicos dos membros). </p> <h3>Autores</h3> <p> Anderson de Alencar <br /> Djeysi Alves <br /> Uendel Couto </p> </div> </div> ); } } export default Sobre;
36.961538
105
0.472945
289a70e1c4287bdfd9e2ac4db22651f1b66f7e8d
206
js
JavaScript
src/services/jobPositionService.js
kubranurbayindir/Java-React-HRMS-Application-Frontend
8af63762a140b953af5df1f8dde4a16a728db640
[ "MIT" ]
5
2021-06-19T15:06:27.000Z
2021-07-11T11:40:59.000Z
src/services/jobPositionService.js
kubranurbayindir/Java-React-HRMS-Application-Frontend
8af63762a140b953af5df1f8dde4a16a728db640
[ "MIT" ]
null
null
null
src/services/jobPositionService.js
kubranurbayindir/Java-React-HRMS-Application-Frontend
8af63762a140b953af5df1f8dde4a16a728db640
[ "MIT" ]
null
null
null
import axios from "axios" export default class JobPositionList { getJobPositions(){ return axios.get("http://localhost:8080/api/job-positions/getall") //apini adresini yazıyoruz } }
25.75
102
0.68932
289c0b711fd443cbb40da83695d0b277c8864fd2
24,501
js
JavaScript
net/ink/js/lines.js
fgergo/clive
bbd0190bca49d3c1d01df8b23d3f529b96d11438
[ "MIT" ]
80
2015-08-02T02:14:48.000Z
2022-03-22T19:40:53.000Z
net/ink/js/lines.js
fgergo/clive
bbd0190bca49d3c1d01df8b23d3f529b96d11438
[ "MIT" ]
2
2018-06-21T16:04:18.000Z
2021-05-29T04:53:01.000Z
net/ink/js/lines.js
fgergo/clive
bbd0190bca49d3c1d01df8b23d3f529b96d11438
[ "MIT" ]
12
2015-12-30T04:01:04.000Z
2022-03-22T19:40:55.000Z
"use strict"; /* text frame support */ /* * Hack to make sure the fixed and var width fonts exist, and * global font names for those variants. */ var tffixed = "monospace"; var tfvar = "Lucida Grande"; // or Verdana var fontscheckedout = false; var tdebug = false; function checkoutfonts(ctx) { if(fontscheckedout) return; fontscheckedout = true; var old = ctx.font; ctx.font = "50px Arial"; var sz = ctx.measureText("ABC").width; ctx.font = "50px " + tffixed; if(ctx.measureText("ABC").width == sz) tffixed = "Courier"; ctx.font = "50px " + tfvar; if(ctx.measureText("ABC").width == sz) tffixed = "Arial"; ctx.font = old; } var wordre = null; function iswordchar(c) { if(!wordre) wordre = /\w/; return wordre.test(c); } function islongwordchar(c) { if(!wordre) wordre = /\w/; return c == '-' || c == '(' || c == ')' || c == '/' || c == '.' || c == ':' || c == '#' || c == ',' || wordre.test(c); } function islparen(c) { return "([{<'`\"".indexOf(c) >= 0; } function isrparen(c) { return ")]}>'`\"".indexOf(c) >= 0; } function rparen(c) { var i = "([{<".indexOf(c); if(i < 0) return c; return ")]}>".charAt(i); } function lparen(c) { var i = ")]}>".indexOf(c); if(i < 0) return c; return "([{<".charAt(i); } // Using ctx.clearRect(x, y, w, h) has problems in Chrome. // This seems to work. function ctxClearRect(ctx, x, y, wid, ht) { var ofs = ctx.fillStyle; ctx.fillStyle = "#DDDDC8"; ctx.fillRect(x, y, wid, ht) ctx.fillStyle = ofs; } // Using ctx.fillText(txt, x, y) has problems in Chrome. // This seems to work. function ctxFillText(ctx, txt, x, y) { var ofs = ctx.fillStyle; ctx.fillStyle = "black"; ctx.fillText(txt, x, y); ctx.fillStyle = ofs; } function Line(lni, off, txt, eol) { this.lni = lni; this.off = off; this.txt = txt; this.eol = eol; this.next = null; this.prev = null; // not toString(), by intention. this.str = function() { if(this.eol) { return ""+this.off+"["+this.lni+"]"+" =\t[" + this.txt + "\\n]"; } else { return ""+this.off+"["+this.lni+"]"+" =\t[" + this.txt + "]"; } }; // len counts the \n, this.txt.length does not. this.len = function() { if(this.eol) { return this.txt.length+1; } return this.txt.length; }; this.split = function(lnoff, addnl) { var nln = new Line(this.lni+1, this.off+lnoff+1, "", this.eol); var lnlen = this.txt.length; if(lnoff < lnlen) { nln.txt = this.txt.slice(lnoff, lnlen); this.txt = this.txt.slice(0, lnoff); } this.eol = addnl; nln.next = this.next; if(nln.next) { nln.next.prev = nln; } nln.prev = this; this.next = nln; }; this.join = function() { if(!this.next) { return; } this.txt += this.next.txt; this.eol = this.next.eol; this.next = this.next.next; if(this.next) { this.next.prev = this; } }; this.ins = function(t, lnoff) { if(lnoff == this.txt.length) { this.txt += t; } else { this.txt = this.txt.slice(0, lnoff) + t + this.txt.slice(lnoff, this.txt.length); } }; // does not del eol this.del = function(lnoff, n) { var lnlen = this.txt.length; if(lnoff+n > lnlen) { n = lnlen - lnoff; } if(n > 0) { this.txt = this.txt.slice(0,lnoff) + this.txt.slice(lnoff+n, lnlen); } return n; }; this.delline = function() { if(this.prev) { this.prev.next = this.next; } if(this.next) { this.next.prev = this.prev; } }; this.renumber = function() { for(var ln = this; ln != null; ln = ln.next) { if(ln.prev == null) { ln.off = 0; ln.lni = 0; } else { ln.off = ln.prev.off + ln.prev.len(); ln.lni = ln.prev.lni+1; } } }; } function Lines(els) { this.clear = function() { this.lns = new Line(0, 0, "", false); this.ln0 = this.lns; // first line shown this.lne = this.lns; // last line this.nrunes = 0; this.p0 = 0; this.p1 = 0; this.marks = []; // of {name: mark, pos: p} }; this.clear(); this.tabstop = 4; // these must be redefined to draw the lines. this.untick = function(){}; this.mayscrollins = function(ln){}; this.mayscrolldel = function(ln){}; this.scrolldown = function(n){ return 0;}; this.scrollup = function(n){ return 0;}; this.redrawtext = function(){}; this.wrapoff = function(t){ return t.length; }; this.frlninsdel = function(ln, ninsdel){}; // pos0 is optional (0 by default). this.tabtxt = function(t, pos0) { if(t.indexOf('\t') < 0) return t; var s = ""; var pos = 0; if(pos0) { pos = pos0; } for(var i = 0; i < t.length; i++){ var r = t.charAt(i); if(r == '\t') { do { s += " "; pos++; }while(pos%this.tabstop); }else{ pos++; s += r; } } return s; }; this.markins = function(p0, n) { for(var i = 0; i < this.marks.length; i++){ var m = this.marks[i]; if(m.pos > p0) { m.pos += n; } } }; this.markdel = function(p0, p1) { for(var i = 0; i < this.marks.length; i++){ var m = this.marks[i]; if(m.pos <= p0) { continue; } var mp1 = p1; if(mp1 > m.pos) { mp1 = m.pos; } m.pos -= (mp1-p0); } }; this.setmark = function(mark, p) { for(var i = 0; i < this.marks.length; i++){ var m = this.marks[i]; if(m.name == mark) { m.pos = p; return; } } this.marks.push({name: mark, pos: p}); }; this.getmark = function(mark) { for(var i = 0; i < this.marks.length; i++){ var m = this.marks[i]; if(m.name == mark) { return m; } } return null; }; this.delmark = function(mark) { for(var i = 0; i < this.marks.length; i++){ var m = this.marks[i]; if(m.name == mark) { this.marks.splice(i, 1); break; } } } this.addln = function(ln) { ln.prev = this.lne; this.lne = ln; if(ln.prev) { ln.lni = ln.prev.lni+1; ln.off = ln.prev.off + ln.prev.len(); ln.prev.next = ln; } else { ln.lni = 0; ln.off = 0; this.lns = ln; this.ln0 = ln; } this.nrunes += ln.len(); }; // seek a line (first is 0). this.seekln = function(pos) { var ln = this.lns; for(var ln = this.lns; ln; ln = ln.next) { if(pos-- <= 0) { return ln; } } return this.lns; }; // return [line, off at line] or [null, 0] // if pos is at the end of a line, that line is returned, // and not the next line at 0. this.seek = function(pos) { for(var ln = this.lns; ln; ln = ln.next) { if(pos >= ln.off && pos <= ln.off + ln.txt.length) { return [ln, pos-ln.off]; } } return [null, 0]; }; // return the pos for a seek this.seekpos = function(ln, lnoff) { if(ln == null) { return 0; } if(lnoff > ln.txt.length) { return ln.off + ln.len(); } return ln.off + lnoff; }; this.reformat = function(ln0) { var ctx = this.ctx; this.fixfont(); if(tdebug) { var avail = this.c.width - this.marginsz; var ln0i = ln0?ln0.lni:-1; console.log("reformat ln " + ln0i + " wid " + avail + ":" ); console.trace(); } // TODO: should get an indication regarding at which // point it's safe to assume that no further reformat // work is needed and stop there. for(var ln = ln0; ln != null; ) { // merge text on the same line while(!ln.eol && ln.next != null) { if(ln.next == this.lne) { this.lne = ln; } if(ln.next == this.ln0) { this.ln0 = ln; } ln.join(); } // remove empty lines but keep an empty line at the end. var next = ln.next; if(ln.len() == 0 && next) { if(this.lne == ln) { console.log("lines: reformat join bug?"); } if(ln0 == ln) { ln0 = next; } if(this.ln0 == ln) { this.ln0 = next; } if(this.lns == ln) { this.lns = next; } ln.delline(); } ln = next; } // recompute wraps, offsets, and numbers. for(var ln = ln0; ln != null; ln = ln.next) { if(!ln.prev) { ln.off = 0; ln.lni = 0; } else { ln.off = ln.prev.off + ln.prev.len(); ln.lni = ln.prev.lni + 1; } var woff = this.wrapoff(ln.txt); if(woff < ln.txt.length) { if(tdebug) { console.log("wrap off " + woff + " ln" + ln.str()); } ln.split(woff, false); if(this.lne == ln) { this.lne = ln.next; } } else if(tdebug) { console.log("no wrap ln " + ln.str()); } } // keep the empty line at the end if(this.lne.eol) { this.addln(new Line(0, 0, "", false)); } // if ln0 moved to the end marker, backup if we can. if(!ln0.next && ln0.prev) { ln0 = ln0.prev; } if(tdebug) { console.log("after reformat:"); this.dump(); } return ln0; }; // add a single line or a \n. this.ins1 = function(t, dontscroll) { this.untick(); this.markins(this.p0, t.length); var xln, lnoff; [xln, lnoff] = this.seek(this.p0); if(!xln) { console.log("Lines.ins: no line for p0"); return; } if(t == '\n') { xln.split(lnoff, true); if(this.lne === xln) { this.lne = xln.next; } } else { xln.ins(t, lnoff); } this.p0 += t.length; this.p1 = this.p0; this.nrunes += t.length; if(t != '\n') { var woff = this.wrapoff(xln.txt); if(woff == xln.txt.length) { // ins within a line, don't reformat; just redraw it. xln.renumber(); this.frlninsdel(xln, +t.length); return; } } xln = this.reformat(xln); if(!dontscroll) { this.mayscrollins(xln); } this.redrawtext(); }; // add arbitrary text at p0 this.ins = function(s, dontscroll) { var lns = s.split('\n'); for(var i = 0; i < lns.length; i++) { if(lns[i].length > 0) { this.ins1(lns[i], dontscroll); } if(i < lns.length-1) { this.ins1('\n', dontscroll); } } }; // del p0:p1 or last char if p0 == p1 this.del = function(dontscroll) { if(this.p0 >= this.nrunes || this.p1 <= this.p0) { return; } this.untick(); if(this.p0 > 0 && this.p0 == this.p1) { this.p0--; } this.markdel(this.p0, this.p1); var xln, lnoff; [xln, lnoff] = this.seek(this.p0); if(!xln) { console.log("lines: del: no line"); return; } var ndel = this.p1 - this.p0; var tot = 0; var xln0 = xln; for(; tot < ndel && xln != null; xln = xln.next) { if(tdebug && 0) { console.log("lines del " + ndel + " loff " + lnoff + " " + xln.str()); } var nd = xln.del(lnoff, ndel-tot); if(tot+nd < ndel && xln.eol) { xln.eol = false; nd++; } if(tot == 0 && nd == ndel && xln.eol) { // del within a line; don't reformat; redraw it. if(tdebug) { console.log("single line del"); } this.nrunes -= nd; this.p1 -= nd; xln.renumber(); this.frlninsdel(xln, -nd); return; } tot += nd; lnoff = 0; } var mightscroll = (this.p1 >= xln0.off); this.nrunes -= tot; this.p1 -= tot; if(xln0.prev) { xln0 = xln0.prev; } this.reformat(xln0); this.redrawtext(); if(!dontscroll && mightscroll) { this.mayscrolldel(xln0); } }; this.get = function(p0, p1) { if(p0 == p1 || p0 >= this.nrunes || p1 < p0 || p1 <= 0) { return ""; } var ln0, lnoff; [ln0, lnoff] = this.seek(p0); if(ln0 == null) { return ""; } var ln = ln0; var nget = p1 - p0; var off = p0 - ln.off; var tot = 0; var txt = ""; do{ var ng = nget-tot; if(off+ng > ln.txt.length) { ng = ln.txt.length - off; } txt += ln.txt.slice(off, off+ng); tot += ng; if(tot < nget && ln.eol){ txt += "\n"; tot++; } ln = ln.next; off = 0; }while(tot < nget && ln != null); return txt; }; // returns [word, wp0, wp1] this.getword = function(pos, long) { if(pos < 0) { return ["", 0, 0]; } if(pos >= this.nrunes) { return ["", this.nrunes, this.nrunes]; } var ischar = iswordchar; if(long) { ischar = islongwordchar; } var ln, lnoff; [ln, lnoff] = this.seek(pos); if(ln == null) { ln = this.lne; } if(ln == this.lne && ln.prev != null && ln.txt.length == 0) { ln = ln.prev; pos = ln.off; } var epos = pos; var p0 = pos - ln.off; if(p0 == ln.txt.length){ var txt = ln.txt; var off = ln.off for(var lnp = ln.prev; lnp && !lnp.eol; lnp = lnp.prev) { txt = lnp.txt + txt; off = lnp.off; } if(!ln.eol) { return [txt, off, off+txt.length]; } return [txt+"\n", off, off+txt.length+1]; } // heuristic: if click at the right of lparen and not // at rparen, use the lparen. if(p0 > 0 && !isrparen(ln.txt.charAt(p0)) && islparen(ln.txt.charAt(p0-1))){ pos--; p0--; } var p1 = p0; var c = ln.txt.charAt(p0); if(islparen(c)){ pos++; var rc = rparen(c); var txt = ""; var n = 1; p1++; epos++; do { var x = 0; for(; p1 < ln.txt.length; p1++, epos++) { x = ln.txt.charAt(p1); if(x == rc) n--; if(x == c) n++; if(n == 0) return [txt, pos, epos]; txt += x; } if(ln.eol){ epos++; txt += "\n"; } ln = ln.next; p1 = 0; } while(ln != null); return [txt, pos, epos]; } if(isrparen(c)){ var n = 1; var lc = lparen(c); var txt = ""; do{ for(p0--; p0 >= 0; p0--){ x = ln.txt.charAt(p0); if(x == lc) n--; else if(x == c) n++; if(n != 0){ pos--; txt = x + txt; } if(n == 0) return [txt, pos, epos]; } ln = ln.prev; if(ln != null){ p0 = ln.txt.length; if(ln.eol){ pos--; txt = "\n" + txt; } } }while(n > 0 && ln != null); return [txt, pos, epos]; } if(!islongwordchar(c)) return [ln.txt.slice(p0, p1), pos, epos]; var txt = ln.txt; for(var lnp = ln.prev; lnp && !lnp.eol; lnp = lnp.prev) { txt = lnp.txt + txt; p0 += lnp.txt.length; p1 += lnp.txt.length; } for(var lnn = ln; lnn.next && !lnn.eol; lnn = lnn.next) { txt += lnn.next.txt; } while(p0 > 0 && ischar(txt.charAt(p0-1))){ pos--; p0--; } while(p1 < txt.length && ischar(txt.charAt(p1))){ epos++; p1++; } return [txt.slice(p0, p1), pos, epos]; }; this.dump = function() { var off = 0; var i = 0; for(var ln = this.lns; ln; ln = ln.next){ var n = ln.len(); var o = ln.off; if(!o && !(o === 0)){ console.log("BAD off " + o + " in:"); o = off; } if(o != off){ console.log("BAD off " + o + " (!=" + off + ") in:"); off = o; } off += n; console.log(""+ ln.str()); i++; } }; } // Lines that know how to draw using a canvas function DrawLines(c) { Lines.apply(this, arguments); this.nlines = 0; // lines in window this.frlines = 0; // lines with text this.frsize = 0; // nb. of runes in frame this.c = c; // canvas, perhaps it's this. this.fontstyle = 'r'; this.tabstop = 4; this.marginsz = 6; this.tscale = 4; // scale must be even; we /2 without Math.floor this.secondary = 0; // button for selection this.tickimg = undefined; // tick image this.tickx = 0; this.ticky = 0; this.saved = undefined; // saved image under tick var ctx = c.getContext("2d", {alpha: false}); this.ctx = ctx; checkoutfonts(ctx); ctx.fillStyle = "#FFFFEA"; var tabtext = Array(this.tabstop+1).join("X"); this.tabwid = ctx.measureText(tabtext).width; // 14 pixels = 12pt font + 2pts of separation at the bottom, // but we scale the canvas *tscale. this.fontht = 14*this.tscale; this.fixfont = function() { var ctx = this.ctx; var mod = ""; var style = ""; style = tfvar; if(this.fontstyle.indexOf('r') === -1) { style = tffixed; } if(this.fontstyle.indexOf('b') > -1) { mod = "bold " + mod; } if(this.fontstyle.indexOf('i') > -1) { mod = "italic " + mod; } // at scale 1, we keep two empty pts at the bottom. var ht = this.fontht - 2*this.tscale; ctx.font = mod + " " + ht+"px "+ style; ctx.textBaseline="top"; }; var oldclear = this.clear; this.clear = function() { oldclear.call(this); this.nlines = 0; this.frlines = 0; this.frsize = 0; this.saved = undefined; this.tickx = this.ticky = 0; }; this.clearline = function(i) { var ctx = this.ctx; var pos = i*this.fontht; if(pos >= this.c.height) { return false; } ctxClearRect(ctx, 1, pos, this.c.width-1, this.fontht); return true; }; this.mktick = function() { var ctx = this.ctx; var x = ctx.lineWidth; ctx.lineWidth = 1; var d = 3*this.tscale; ctx.fillRect(0, 0, d, d); ctx.fillRect(0, this.fontht-d, d, d); ctx.moveTo(d/2, 0); ctx.lineTo(d/2, this.fontht); ctx.stroke(); ctx.lineWidth = x; this.tickimg = ctx.getImageData(0, 0, d, this.fontht); }; this.untick = function() { if(!this.saved) { return; } var ctx = this.ctx; ctx.putImageData(this.saved, this.tickx, this.ticky); this.saved = undefined; }; this.tick = function(x, y) { var ctx = this.ctx; if(0)console.log("tick", x, y); this.saved = ctx.getImageData(x, y, 3*this.tscale, this.fontht); this.tickx = x; this.ticky = y; ctx.putImageData(this.tickimg, x, y); }; // draw a line and return false if it's out of the draw space. this.drawline = function(ln) { var ctx = this.ctx; var lnht = this.fontht; var avail = this.c.width - 2*this.marginsz - 1; var y = (ln.lni-this.ln0.lni)*lnht; if(y > this.c.height) { return false; } // non-empty selection. if(this.p0 != this.p1) { if(this.p0 > ln.off+ln.txt.length || this.p1 < ln.off){ // unselected line ctxClearRect(ctx, 1, y, this.c.width-this.marginsz-1, lnht); var t = this.tabtxt(ln.txt); ctxFillText(ctx, t, this.marginsz, y); return true; } // up to p0 unselected var dx = this.marginsz; var s0 = 0; var s0pos = 0; if(this.p0 > ln.off){ s0 = this.p0 - ln.off; var s0t = this.tabtxt(ln.txt.slice(0, s0)); s0pos = s0t.length; dx += ctx.measureText(s0t).width; ctxClearRect(ctx, 1, y, dx, lnht); ctxFillText(ctx, s0t, this.marginsz, y); } // from p0 to p1 selected var s1 = ln.txt.length - s0; if(this.p1 < ln.off+ln.txt.length) s1 = this.p1 - s0 - ln.off; var s1t = this.tabtxt(ln.txt.slice(s0, s0+s1), s0pos); var s1pos = s0pos + s1t.length; var sx = ctx.measureText(s1t).width; var old = ctx.fillStyle; if(this.secondary >= 2) { ctx.fillStyle = "#FF7575"; } else if(this.secondary) { ctx.fillStyle = "#7373FF"; } else { ctx.fillStyle = "#D1A0A0"; } if(this.p1 > ln.off+ln.txt.length) { ctx.fillRect(dx, y, this.c.width-dx-this.marginsz-1, lnht); } else { ctx.fillRect(dx, y, sx, lnht); } ctxFillText(ctx, s1t, dx, y); ctx.fillStyle = old; if(this.p1 > ln.off+ln.txt.length) { return true; } // from p1 unselected ctxClearRect(ctx, dx+sx, y, this.c.width-(dx+sx)-this.marginsz-1, lnht); if(s1 >= ln.txt.length) { return true; } var s2t = this.tabtxt(ln.txt.slice(s0+s1, ln.txt.length), s1pos); ctxFillText(ctx, s2t, dx+sx, y); return true; } // unselected line ctxClearRect(ctx, 1, y, this.c.width-this.marginsz-1, lnht); var t = this.tabtxt(ln.txt); ctxFillText(ctx, t, this.marginsz, y); if(this.p0 < ln.off || this.p0 > ln.off + ln.txt.length) { return true; } // line with tick var x = this.posdx(ln.txt, this.p0 - ln.off); x += this.marginsz - 3*this.tscale/2; // a bit to the left this.tick(x, y); return true; }; this.updatescrl = function() { var ctx = this.ctx; var y0 = this.ln0.lni / this.lne.lni * this.c.height; var dy = this.frlines / this.lne.lni * this.c.height; ctxClearRect(ctx, this.c.width-this.marginsz, 0, this.marginsz, y0); var old = ctx.fillStyle; ctx.fillStyle = "#7373FF"; ctx.fillRect(this.c.width-this.marginsz, y0, this.marginsz, dy); ctx.fillStyle = old; ctxClearRect(ctx, this.c.width-this.marginsz, y0+dy, this.marginsz, this.c.height-(y0+dy)); }; this.redrawtext = function() { this.fixfont(); this.nlines = Math.floor(this.c.height/this.fontht); if(!this.tickimg) { this.mktick(); } if(!this.ln0) { console.log("redrawtext: no ln0"); return; } var froff = this.ln0.off; this.frsize = 0; this.frlines = 0; var ln = this.ln0; for(var i = 0; i <= this.nlines; i++){ if(ln != null){ if(!this.drawline(ln)) break; this.frlines++; this.frsize += ln.len(); ln = ln.next; }else if(!this.clearline(i)) { break; } } if(tdebug)console.log("redraw " + i + " " + this.nlines); this.updatescrl(); }; // requires a redraw if returns true. this.scrolldown = function(n) { var old = this.ln0; for(; n > 0; n--) { if(!this.ln0.prev) { break; } this.ln0 = this.ln0.prev; } return this.ln0 != old; }; // requires a redraw if returns true. this.scrollup = function(n) { var old = this.ln0; for(; n > 0; n--) { if(!this.ln0.next || !this.ln0.next.next) { break; } this.ln0 = this.ln0.next; } return old != this.ln0; }; this.nscrl = function() { var nscrl = Math.floor(this.nlines/4); if(nscrl > 0) { return nscrl; } return 1; }; this.mayscrollins = function(ln) { if(ln.lni >= this.ln0.lni+this.nlines-1 && ln.lni <= this.ln0.lni+this.nlines+1 && this.nlines > 1) { this.scrolldown(this.nscrl()); } }; this.mayscrolldel = function(ln) { if(this.p0 < this.ln0.off) { this.scrollup(this.nscrl()); this.redrawtext(); } }; this.wrapoff = function(t) { var ctx = this.ctx; var avail = this.c.width - this.marginsz; var pos = 0; var s = ""; if(tdebug) { console.log("wrapoff: X wid: " + ctx.measureText("X").width); } for(var i = 0; i < t.length; i++){ var r = t.charAt(i); if(r == '\t') { do { s += " "; pos++; }while(pos%this.tabstop); }else{ pos++; s += r; } if(ctx.measureText(s).width > avail){ if(tdebug) { console.log('wrapoff: ' + s + ': wrap: ' + ctx.measureText(s).width + " " + avail); } return i; } } if(tdebug) { console.log('wrapoff: ' + s + ': no wrap: ' + ctx.measureText(s).width + " " + avail); } return t.length; }; this.posdx = function(t, n) { var ctx = this.ctx; var pos = 0; var dx = 0; var spcwid = ctx.measureText(" ").width; for(var i = 0; i < t.length && i < n; i++){ var r = t.charAt(i); if(r == '\t') { do { dx += spcwid; pos++; }while(pos%this.tabstop); }else{ pos++; dx += ctx.measureText(r).width; } } return dx; }; // returns [line, off at line, click past text?] // later you can use seekpos(line, lnoff) to get a valid pos. this.ptr2seek = function(cx, cy) { var marginsz = Math.floor(this.marginsz/2); var x = cx; var y = cy; var ovf = 0; x *= this.tscale; y *= this.tscale; var nln = Math.floor(y/this.fontht); if(nln < 0) { return [this.ln0, 0, false]; } if(nln >= this.frlines) { // overflow return [this.lne, this.lne.txt.length, true]; } var ln = this.ln0; while(nln-- > 0 && ln.next) { ln = ln.next; } var pos = 0; for(; pos <= ln.txt.length; pos++){ var coff = this.posdx(ln.txt, pos); if(coff+marginsz > x){ if(pos > 0) pos--; break; } } if(pos > ln.txt.length){ pos = ln.txt.length; return [ln, pos, true]; } return [ln, pos, false]; }; this.viewsel = function() { if(this.p0 >= this.ln0.off && this.p0 <= this.ln0.off+this.frsize) { return; } for(var ln = this.lns; ln != null; ln = ln.next) { if(this.p0 >= ln.off && this.p0 <= ln.off+ln.txt.length) { for(var n = Math.floor(this.frlines/3); n > 0 && ln.prev; n--) { ln = ln.prev; } this.ln0 = ln; this.redrawtext(); break; } } }; this.setsel = function(p0, p1, refreshall) { var ctx = this.ctx; if(p0 > this.nrunes) { p0 = this.nrunes; } if(p1 < p0) { p1 = p0; } if(p1 > this.nrunes) { p1 = this.nrunes; } if(this.p0 != this.p1) { refreshall = true; } var froff = this.ln0.off; if(refreshall && (this.p1 <froff || this.p0 >froff+this.frsize)) refreshall = false; var mp0 = p0; var mp1 = p1; if(refreshall){ if(this.p0 < mp0) { mp0 = this.p0; } if(this.p1 > mp1) { mp1 = this.p1; } } this.p0 = p0; this.p1 = p1; this.untick(); if(mp1 <froff || mp0 >froff+this.frsize) { return; } var insel = false; var ln = this.ln0; for(var i = 0; i < this.frlines && ln != null; i++){ if(mp1 >= ln.off && mp0 <= ln.off+ln.txt.length) { insel=true; } if(insel) { this.drawline(ln); } if(mp1 < ln.off) { break; } ln = ln.next; } }; this.frlninsdel = function(ln, ninsdel){ if(ln.lni >= this.ln0.lni && ln.lni < this.ln0.lni+this.frlines) { this.frsize += ninsdel; this.drawline(ln); } }; this.fixfont(); }
21.740018
119
0.551569
289c6726ad5abd55cd16687fed82c9d1dc066f25
1,553
js
JavaScript
index.js
frnjjq/IRAC-P4-TestiVoox
1a3abd503bba6524b3fc1865853a3af3198d0636
[ "Apache-2.0" ]
null
null
null
index.js
frnjjq/IRAC-P4-TestiVoox
1a3abd503bba6524b3fc1865853a3af3198d0636
[ "Apache-2.0" ]
null
null
null
index.js
frnjjq/IRAC-P4-TestiVoox
1a3abd503bba6524b3fc1865853a3af3198d0636
[ "Apache-2.0" ]
null
null
null
const ivoox = require('node-ivoox'); const request = require('request'); const fs = require('fs'); const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); console.log('Running - irac-p4-test-ivoox'); var toBeSearched, fileDir; process.argv.forEach((val, index, array) => { if(val === '-i' || val === '--input' ) { toBeSearched = array[index+1]; } else if(val === '-o' || val === '--output') { fileDir = array[index+1]; } }); if (!toBeSearched || !fileDir) { console.log('Input arguments are not right or missing'); process.exit(); } ivoox.search(toBeSearched).then((data) => { var answer; if(data.length > 1) { console.log('Your search produced the results:'); data.forEach((val, index, array) =>{ console.log('Episode Number :', index, ' ---- ', val.title.slice(13,-17)); }); rl.question('Type the episode you want to download ', (answer) => { saveAudio(data[answer], fileDir); rl.close(); }); } else { console.log('Only one Podcast matched: ', data[0].title.slice(13,-17)); saveAudio(data[0], fileDir); } }).catch(function(e) { console.error(e); }); function saveAudio (data, fileDir) { console.log('Downloading ->', data.title.slice(13,-17)); request(data.file) .pipe(fs.createWriteStream(fileDir + data.title.slice(13,-17) + '.mp3')) .on('close', () =>{ console.log('Finished downloading'); console.log('Finished - irac-p4-test-ivoox'); process.exit(); }); };
27.732143
80
0.613007
289d8234ec06e25bf0bdf0815e54d8a09309108f
750
js
JavaScript
DailyByte/reverseString.js
Hail91/code-challenges
ef8710c859fe1b6c34df75701f9b9a5e12966a06
[ "MIT" ]
null
null
null
DailyByte/reverseString.js
Hail91/code-challenges
ef8710c859fe1b6c34df75701f9b9a5e12966a06
[ "MIT" ]
null
null
null
DailyByte/reverseString.js
Hail91/code-challenges
ef8710c859fe1b6c34df75701f9b9a5e12966a06
[ "MIT" ]
null
null
null
// Reverse a string utilizing pointers function reverseString(string) { let strArray = string.split(""); let temp; for (let i = 0, j = strArray.length - 1; i < j; i++, j--) { temp = strArray[i]; strArray[i] = strArray[j]; strArray[j] = temp; } return strArray.join(""); } // Reverse using builtins function reverseStringBuiltin(string) { return string.split("").reverse().join(""); } // Add solution using recursion *to do* // Test cases for solution #1 console.log(reverseString("cat")); console.log(reverseString("cart")); console.log(reverseString("Hello")); // Test cases for solution #2 console.log(reverseStringBuiltin("cat")); console.log(reverseStringBuiltin("cart")); console.log(reverseStringBuiltin("Hello"));
25
61
0.684
289df7222e076b49196ed374ed778f8bf61cc2c5
7,159
js
JavaScript
tests/fixtures-valid.js
kengruven/open-fixture-library
fad477e8c3ab60b42a4a168c8c80f7f17d8b4332
[ "MIT" ]
15
2017-02-24T20:39:01.000Z
2018-03-25T00:45:53.000Z
tests/fixtures-valid.js
kengruven/open-fixture-library
fad477e8c3ab60b42a4a168c8c80f7f17d8b4332
[ "MIT" ]
377
2017-02-23T23:17:40.000Z
2018-03-28T17:07:07.000Z
tests/fixtures-valid.js
kengruven/open-fixture-library
fad477e8c3ab60b42a4a168c8c80f7f17d8b4332
[ "MIT" ]
4
2017-08-03T18:39:27.000Z
2018-03-27T07:47:56.000Z
#!/usr/bin/env node import { readdir } from 'fs/promises'; import path from 'path'; import chalk from 'chalk'; import minimist from 'minimist'; import getAjvValidator from '../lib/ajv-validator.js'; import getAjvErrorMessages from '../lib/get-ajv-error-messages.js'; import importJson from '../lib/import-json.js'; import { checkFixture, checkUniqueness } from './fixture-valid.js'; const cliArguments = minimist(process.argv.slice(2), { boolean: [`h`, `a`], alias: { h: `help`, a: `all-fixtures` }, }); const scriptName = import.meta.url.split(`/`).pop(); const helpMessage = [ `Check validity of some/all fixtures`, `Usage: node ${scriptName} -a | -h | fixtures [...]`, `Options:`, ` fixtures: a list of fixtures contained in the fixtures/ directory.`, ` has to resolve to the form 'manufacturer/fixture'`, ` depending on your shell, you can use glob-patterns to match multiple fixtures`, ` --all-fixtures, -a:`, ` check all fixtures contained in the fixtures/ directory`, ` --help, -h:`, ` Show this help message.`, ].join(`\n`); let fixturePaths = cliArguments._; // print help and exit on -h or no fixtures given. if (cliArguments.help || (fixturePaths.length === 0 && !cliArguments.a)) { console.log(helpMessage); process.exit(0); } /** * @typedef {object} UniqueValues * @property {Set<string>} manNames All manufacturer names * @property {Record<string, Set<string>>} fixKeysInMan All fixture keys by manufacturer key * @property {Record<string, Set<string>>} fixNamesInMan All fixture names by manufacturer key * @property {Record<string, Set<string>>} fixRdmIdsInMan All RDM ids by manufacturer key * @property {Set<string>} fixShortNames All fixture short names */ /** @type {UniqueValues} */ const uniqueValues = { manNames: new Set(), manRdmIds: new Set(), fixKeysInMan: {}, // new Set() for each manufacturer fixNamesInMan: {}, // new Set() for each manufacturer fixRdmIdsInMan: {}, // new Set() for each manufacturer fixShortNames: new Set(), }; const fixtureDirectoryUrl = new URL(`../fixtures/`, import.meta.url); try { const results = await runTests(); let totalFails = 0; let totalWarnings = 0; // each file for (const result of results) { const failed = result.errors.length > 0; totalFails += failed ? 1 : 0; totalWarnings += result.warnings.length; printFileResult(result); } // newline console.log(); // summary if (totalWarnings > 0) { console.log(chalk.yellow(`[INFO]`), `${totalWarnings} unresolved warning(s)`); } if (totalFails === 0) { console.log(chalk.green(`[PASS]`), `All ${results.length} tested files were valid.`); process.exit(0); } console.error(chalk.red(`[FAIL]`), `${totalFails} of ${results.length} tested files failed.`); process.exit(1); } catch (error) { console.error(chalk.red(`[Error]`), `Test errored:`, error); } /** * @returns {Promise<object[]>} A Promise that resolves to an array of result objects. */ async function runTests() { const promises = []; if (cliArguments.a) { const directoryEntries = await readdir(fixtureDirectoryUrl, { withFileTypes: true }); const manufacturerKeys = directoryEntries.filter(entry => entry.isDirectory()).map(entry => entry.name); for (const manufacturerKey of manufacturerKeys) { const manufacturersDirectoryUrl = new URL(manufacturerKey, fixtureDirectoryUrl); for (const file of await readdir(manufacturersDirectoryUrl)) { if (path.extname(file) === `.json`) { const fixtureKey = path.basename(file, `.json`); promises.push(checkFixtureFile(manufacturerKey, fixtureKey)); } } } promises.push(checkManufacturers()); } else { // sanitize given path fixturePaths = fixturePaths.map(relativePath => path.resolve(relativePath)); for (const fixturePath of fixturePaths) { if (path.extname(fixturePath) !== `.json`) { // TODO: only produce this warning at a higher verbosity level promises.push({ name: fixturePath, errors: [], warnings: [`specified file is not a .json document`], }); continue; } const fixtureKey = path.basename(fixturePath, `.json`); const manufacturerKey = path.dirname(fixturePath).split(path.sep).pop(); promises.push(checkFixtureFile(manufacturerKey, fixtureKey)); } } return Promise.all(promises); } /** * Checks (asynchronously) the given fixture. * @param {string} manufacturerKey The manufacturer key. * @param {string} fixtureKey The fixture key. * @returns {Promise<object>} A Promise resolving to a result object. */ async function checkFixtureFile(manufacturerKey, fixtureKey) { const filename = `${manufacturerKey}/${fixtureKey}.json`; const result = { name: filename, errors: [], warnings: [], }; try { const fixtureJson = await importJson(filename, fixtureDirectoryUrl); Object.assign(result, await checkFixture(manufacturerKey, fixtureKey, fixtureJson, uniqueValues)); } catch (error) { result.errors.push(error); } return result; } /** * Checks Manufacturers file * @returns {Promise<object>} A Promise resolving to a result object. */ async function checkManufacturers() { const result = { name: `manufacturers.json`, errors: [], warnings: [], }; try { const manufacturers = await importJson(result.name, fixtureDirectoryUrl); const validate = await getAjvValidator(`manufacturers`); const valid = validate(manufacturers); if (!valid) { throw getAjvErrorMessages(validate.errors, `manufacturers`); } for (const [manufacturerKey, manufacturerProperties] of Object.entries(manufacturers)) { if (manufacturerKey.startsWith(`$`)) { // JSON schema property continue; } // legacy purposes const uniquenessTestResults = { errors: [], }; checkUniqueness( uniqueValues.manNames, manufacturerProperties.name, uniquenessTestResults, `Manufacturer name '${manufacturerProperties.name}' is not unique (test is not case-sensitive).`, ); if (`rdmId` in manufacturerProperties) { checkUniqueness( uniqueValues.manRdmIds, `${manufacturerProperties.rdmId}`, uniquenessTestResults, `Manufacturer RDM ID '${manufacturerProperties.rdmId}' is not unique.`, ); } result.errors.push(...uniquenessTestResults.errors); } } catch (error) { const isIterable = typeof error[Symbol.iterator] === `function`; result.errors.push(...(isIterable ? error : [error])); } return result; } /** * @param {object} result The result object for a single file. */ function printFileResult(result) { const failed = result.errors.length > 0; console.log( failed ? chalk.red(`[FAIL]`) : chalk.green(`[PASS]`), result.name, ); for (const error of result.errors) { console.log(`└`, chalk.red(`Error:`), error); } for (const warning of result.warnings) { console.log(`└`, chalk.yellow(`Warning:`), warning); } }
30.079832
108
0.660427
289e195918c8c136517ec543cba8ed7fca59bcd7
237
js
JavaScript
transforms/__testfixtures__/time-related-value-to-moment.with-moment.input.js
ant-design/antd-codemod
2c574425eaf017eb3a240f8bd105f0e435bbac66
[ "MIT" ]
24
2016-11-22T05:21:55.000Z
2021-11-10T13:24:27.000Z
transforms/__testfixtures__/time-related-value-to-moment.with-moment.input.js
ant-design/antd-codemod
2c574425eaf017eb3a240f8bd105f0e435bbac66
[ "MIT" ]
21
2016-11-30T06:43:01.000Z
2021-03-01T14:42:45.000Z
transforms/__testfixtures__/time-related-value-to-moment.with-moment.input.js
ant-design/antd-codemod
2c574425eaf017eb3a240f8bd105f0e435bbac66
[ "MIT" ]
7
2017-07-20T13:20:14.000Z
2021-08-02T16:37:09.000Z
/* eslint-disable quotes */ import moment from 'moment'; // eslint-disable-line no-unused-vars function Test(props) { // eslint-disable-line no-unused-vars return ( <form> <DatePicker value="2016-11-23" /> </form> ); }
23.7
66
0.64557
289e9fdf38c45cb3e5f794ed7627d18ad314dc07
725
js
JavaScript
app/komutlar/hesap-bilgi.js
Mehmet966/bot
d13f01cedb52b987efa1a613deecf72047874642
[ "MIT" ]
8
2021-01-30T20:09:15.000Z
2022-02-26T22:50:01.000Z
app/komutlar/hesap-bilgi.js
Mehmet966/bot
d13f01cedb52b987efa1a613deecf72047874642
[ "MIT" ]
null
null
null
app/komutlar/hesap-bilgi.js
Mehmet966/bot
d13f01cedb52b987efa1a613deecf72047874642
[ "MIT" ]
4
2021-02-03T16:49:29.000Z
2022-02-06T10:10:35.000Z
const Discord = require('discord.js'); const ayarlar = require('../ayarlar.json'); const db = require('quick.db'); const ms = require('ms') exports.run = async (client, message, args) => { let kişi = message.mentions.users.first() || message.author let parapara = await db.fetch(`para_${kişi.id}`) || 0 /// ARKADASLAR CALMAYIN BIR CODER DERKI ÇALAN KODIR DEĞİL let isim = await db.fetch(`hesapisim_${kişi.id}`) || 'Hesap Yok' const sa = new Discord.MessageEmbed() .setDescription(`Kullanıcı: ${kişi} \n Parası : ${parapara} \n Hesap Adı ${isim}`) return message.channel.send(sa) }; ///HAZIRLAYANLAR Clearly_ , FORCEX.js exports.conf = { aliases: [], permLevel: 0 }; exports.help = { name: 'hesap' };
29
83
0.666207
289eb6a64fe908fcb6448bb6185c2c873f95beba
39,097
js
JavaScript
lib/bible-tools/bibles/ms/alkitab/books/17.js
saiba-mais/bible-lessons
6c352c1060c48b80f74f8bf0c1cbff5450de2fe6
[ "MIT" ]
null
null
null
lib/bible-tools/bibles/ms/alkitab/books/17.js
saiba-mais/bible-lessons
6c352c1060c48b80f74f8bf0c1cbff5450de2fe6
[ "MIT" ]
null
null
null
lib/bible-tools/bibles/ms/alkitab/books/17.js
saiba-mais/bible-lessons
6c352c1060c48b80f74f8bf0c1cbff5450de2fe6
[ "MIT" ]
null
null
null
var book = { "name": "Ester", "numChapters": 10, "chapters": { "1": { "1": "<span>1 </span> Pada zaman Ahasyweros--dialah Ahasyweros yang merajai seratus dua puluh tujuh daerah mulai dari India sampai ke Etiopia--,", "2": "<span>2 </span> pada zaman itu, ketika raja Ahasyweros bersemayam di atas takhta kerajaannya di dalam benteng Susan,", "3": "<span>3 </span> pada tahun yang ketiga dalam pemerintahannya, diadakanlah oleh baginda perjamuan bagi semua pembesar dan pegawainya; tentara Persia dan Media, kaum bangsawan dan pembesar daerah hadir di hadapan baginda.", "4": "<span>4 </span> Di samping itu baginda memamerkan kekayaan kemuliaan kerajaannya dan keindahan kebesarannya yang bersemarak, berhari-hari lamanya, sampai seratus delapan puluh hari.", "5": "<span>5 </span> Setelah genap hari-hari itu, maka raja mengadakan perjamuan lagi tujuh hari lamanya bagi seluruh rakyatnya yang terdapat di dalam benteng Susan, dari pada orang besar sampai kepada orang kecil, bertempat di pelataran yang ada di taman istana kerajaan.", "6": "<span>6 </span> Di situ tirai-mirai dari pada kain lenan, mori halus dan kain ungu tua, yang terikat dengan tali lenan halus dan ungu muda bergantung pada tombol-tombol perak di tiang-tiang marmar putih, sedang katil emas dan perak ditempatkan di atas lantai pualam, marmar putih, gewang dan pelinggam.", "7": "<span>7 </span> Minuman dihidangkan dalam piala emas yang beraneka warna, dan anggurnya ialah anggur minuman raja yang berlimpah-limpah, sebagaimana layak bagi raja.", "8": "<span>8 </span> Adapun aturan minum ialah: tiada dengan paksa; karena beginilah disyaratkan raja kepada semua bentara dalam, supaya mereka berbuat menurut keinginan tiap-tiap orang.", "9": "<span>9 </span> Juga Wasti, sang ratu, mengadakan perjamuan bagi semua perempuan di dalam istana raja Ahasyweros.", "10": "<span>10 </span> Pada hari yang ketujuh, ketika raja riang gembira hatinya karena minum anggur, bertitahlah baginda kepada Mehuman, Bizta, Harbona, Bigta, Abagta, Zetar dan Karkas, yakni ketujuh sida-sida yang bertugas di hadapan raja Ahasyweros,", "11": "<span>11 </span> supaya mereka membawa Wasti, sang ratu, dengan memakai mahkota kerajaan, menghadap raja untuk memperlihatkan kecantikannya kepada sekalian rakyat dan pembesar-pembesar, karena sang ratu sangat elok rupanya.", "12": "<span>12 </span> Tetapi ratu Wasti menolak untuk menghadap menurut titah raja yang disampaikan oleh sida-sida itu, sehingga sangat geramlah raja dan berapi-apilah murkanya.", "13": "<span>13 </span> Maka bertanyalah raja kepada orang-orang arif bijaksana, orang-orang yang mengetahui kebiasaan zaman--karena demikianlah biasanya masalah-masalah raja dikemukakan kepada para ahli undang-undang dan hukum;", "14": "<span>14 </span> adapun yang terdekat kepada baginda ialah Karsena, Setar, Admata, Tarsis, Meres, Marsena dan Memukan, ketujuh pembesar Persia dan Media, yang boleh memandang wajah raja dan yang mempunyai kedudukan yang tinggi di dalam kerajaan--,tanya raja:", "15": "<span>15 </span> \"Apakah yang harus diperbuat atas ratu Wasti menurut undang-undang, karena tidak dilakukannya titah raja Ahasyweros yang disampaikan oleh sida-sida?\"", "16": "<span>16 </span> Maka sembah Memukan di hadapan raja dan para pembesar itu: \"Wasti, sang ratu, bukan bersalah kepada raja saja, melainkan juga kepada semua pembesar dan segala bangsa yang di dalam segala daerah raja Ahasyweros.", "17": "<span>17 </span> Karena kelakuan sang ratu itu akan merata kepada semua perempuan, sehingga mereka tidak menghiraukan suaminya, apabila diceritakan orang: Raja Ahasyweros menitahkan, supaya Wasti, sang ratu, dibawa menghadap kepadanya, tetapi ia tidak mau datang.", "18": "<span>18 </span> Pada hari ini juga isteri para pembesar raja di Persia dan Media yang mendengar tentang kelakuan sang ratu akan berbicara tentang hal itu kepada suaminya, sehingga berlarut-larutlah penghinaan dan kegusaran.", "19": "<span>19 </span> Jikalau baik pada pemandangan raja, hendaklah dikeluarkan suatu titah kerajaan dari hadapan baginda dan dituliskan di dalam undang-undang Persia dan Media, sehingga tidak dapat dicabut kembali, bahwa Wasti dilarang menghadap raja Ahasyweros, dan bahwa raja akan mengaruniakan kedudukannya sebagai ratu kepada orang lain yang lebih baik dari padanya.", "20": "<span>20 </span> Bila keputusan yang diambil raja kedengaran di seluruh kerajaannya--alangkah besarnya kerajaan itu! --,maka semua perempuan akan memberi hormat kepada suami mereka, dari pada orang besar sampai kepada orang kecil.\"", "21": "<span>21 </span> Usul itu dipandang baik oleh raja serta para pembesar, jadi bertindaklah raja sesuai dengan usul Memukan itu.", "22": "<span>22 </span> Dikirimkanlah oleh baginda surat-surat ke segenap daerah kerajaan, tiap-tiap daerah menurut tulisannya dan tiap-tiap bangsa menurut bahasanya, bunyinya: \"Setiap laki-laki harus menjadi kepala dalam rumah tangganya dan berbicara menurut bahasa bangsanya.\"" }, "2": { "1": "<span>1 </span> Sesudah peristiwa-peristiwa ini, setelah kepanasan murka raja Ahasyweros surut, terkenanglah baginda kepada Wasti dan yang dilakukannya, dan kepada apa yang diputuskan atasnya.", "2": "<span>2 </span> Maka sembah para biduanda raja yang bertugas pada baginda: \"Hendaklah orang mencari bagi raja gadis-gadis, yaitu anak-anak dara yang elok rupanya;", "3": "<span>3 </span> hendaklah raja menempatkan kuasa-kuasa di segenap daerah kerajaannya, supaya mereka mengumpulkan semua gadis, anak-anak dara yang elok rupanya, di dalam benteng Susan, di balai perempuan, di bawah pengawasan Hegai, sida-sida raja, penjaga para perempuan; hendaklah diberikan wangi-wangian kepada mereka.", "4": "<span>4 </span> Dan gadis yang terbaik pada pemandangan raja, baiklah dia menjadi ratu ganti Wasti.\" Hal itu dipandang baik oleh raja, dan dilakukanlah demikian.", "5": "<span>5 </span> Pada waktu itu ada di dalam benteng Susan seorang Yahudi, yang bernama Mordekhai bin Yair bin Simei bin Kish, seorang Benyamin", "6": "<span>6 </span> yang diangkut dari Yerusalem sebagai salah seorang buangan yang turut dengan Yekhonya, raja Yehuda, ketika ia diangkut ke dalam pembuangan oleh raja Nebukadnezar, raja Babel.", "7": "<span>7 </span> Mordekhai itu pengasuh Hadasa, yakni Ester, anak saudara ayahnya, sebab anak itu tidak beribu bapa lagi; gadis itu elok perawakannya dan cantik parasnya. Ketika ibu bapanya mati, ia diangkat sebagai anak oleh Mordekhai.", "8": "<span>8 </span> Setelah titah dan undang-undang raja tersiar dan banyak gadis dikumpulkan di dalam benteng Susan, di bawah pengawasan Hegai, maka Esterpun dibawa masuk ke dalam istana raja, di bawah pengawasan Hegai, penjaga para perempuan.", "9": "<span>9 </span> Maka gadis itu sangat baik pada pemandangannya dan menimbulkan kasih sayangnya, sehingga Hegai segera memberikan wangi-wangian dan pelabur kepadanya, dan juga tujuh orang dayang-dayang yang terpilih dari isi istana raja, kemudian memindahkan dia dengan dayang-dayangnya ke bagian yang terbaik di dalam balai perempuan.", "10": "<span>10 </span> Ester tidak memberitahukan kebangsaan dan asal usulnya, karena dilarang oleh Mordekhai.", "11": "<span>11 </span> Tiap-tiap hari berjalan-jalanlah Mordekhai di depan pelataran balai perempuan itu untuk mengetahui bagaimana keadaan Ester dan apa yang akan berlaku atasnya.", "12": "<span>12 </span> Tiap-tiap kali seorang gadis mendapat giliran untuk masuk menghadap raja Ahasyweros, dan sebelumnya ia dirawat menurut peraturan bagi para perempuan selama dua belas bulan, sebab seluruh waktu itu digunakan untuk pemakaian wangi-wangian: enam bulan untuk memakai minyak mur dan enam bulan lagi untuk memakai minyak kasai serta lain-lain wangi-wangian perempuan.", "13": "<span>13 </span> Lalu gadis itu masuk menghadap raja, dan segala apa yang dimintanya harus diberikan kepadanya untuk dibawa masuk dari balai perempuan ke dalam istana raja.", "14": "<span>14 </span> Pada waktu petang ia masuk dan pada waktu pagi ia kembali, tetapi sekali ini ke dalam balai perempuan yang kedua, di bawah pengawasan Saasgas, sida-sida raja, penjaga para gundik. Ia tidak diperkenankan masuk lagi menghadap raja, kecuali jikalau raja berkenan kepadanya dan ia dipanggil dengan disebutkan namanya.", "15": "<span>15 </span> Ketika Ester--anak Abihail, yakni saudara ayah Mordekhai yang mengangkat Ester sebagai anak--mendapat giliran untuk masuk menghadap raja, maka ia tidak menghendaki sesuatu apapun selain dari pada yang dianjurkan oleh Hegai, sida-sida raja, penjaga para perempuan. Maka Ester dapat menimbulkan kasih sayang pada semua orang yang melihat dia.", "16": "<span>16 </span> Demikianlah Ester dibawa masuk menghadap raja Ahasyweros ke dalam istananya pada bulan yang kesepuluh--yakni bulan Tebet--pada tahun yang ketujuh dalam pemerintahan baginda.", "17": "<span>17 </span> Maka Ester dikasihi oleh baginda lebih dari pada semua perempuan lain, dan ia beroleh sayang dan kasih baginda lebih dari pada semua anak dara lain, sehingga baginda mengenakan mahkota kerajaan ke atas kepalanya dan mengangkat dia menjadi ratu ganti Wasti.", "18": "<span>18 </span> Kemudian diadakanlah oleh baginda suatu perjamuan bagi semua pembesar dan pegawainya, yakni perjamuan karena Ester, dan baginda menitahkan kebebasan pajak bagi daerah-daerah serta mengaruniakan anugerah, sebagaimana layak bagi raja.", "19": "<span>19 </span> Selama anak-anak dara dikumpulkan untuk kedua kalinya, Mordekhai duduk di pintu gerbang istana raja.", "20": "<span>20 </span> Adapun Ester tidak memberitahukan asal usul dan kebangsaannya seperti diperintahkan kepadanya oleh Mordekhai, sebab Ester tetap berbuat menurut perkataan Mordekhai seperti pada waktu ia masih dalam asuhannya.", "21": "<span>21 </span> Pada waktu itu, ketika Mordekhai duduk di pintu gerbang istana raja, sakit hatilah Bigtan dan Teresh, dua orang sida-sida raja yang termasuk golongan penjaga pintu, lalu berikhtiarlah mereka untuk membunuh raja Ahasyweros.", "22": "<span>22 </span> Tetapi perkara itu dapat diketahui oleh Mordekhai, lalu diberitahukannyala kepada Ester, sang ratu, dan Ester mempersembahkannya kepada raja atas nama Mordekhai.", "23": "<span>23 </span> Perkara itu diperiksa dan ternyata benar, maka kedua orang itu disulakan pada tiang. Dan peristiwa itu dituliskan di dalam kitab sejarah, di hadapan raja." }, "3": { "1": "<span>1 </span> Sesudah peristiwa-peristiwa ini maka Haman bin Hamedata, orang Agag, dikaruniailah kebesaran oleh raja Ahasyweros, dan pangkatnya dinaikkan serta kedudukannya ditetapkan di atas semua pembesar yang ada di hadapan baginda.", "2": "<span>2 </span> Dan semua pegawai raja yang di pintu gerbang istana raja berlutut dan sujud kepada Haman, sebab demikianlah diperintahkan raja tentang dia, tetapi Mordekhai tidak berlutut dan tidak sujud.", "3": "<span>3 </span> Maka para pegawai raja yang di pintu gerbang istana raja berkata kepada Mordekhai: \"Mengapa engkau melanggar perintah raja?\"", "4": "<span>4 </span> Setelah mereka menegor dia berhari-hari dengan tidak didengarkannya juga, maka hal itu diberitahukan merekalah kepada Haman untuk melihat, apakah sikap Mordekhai itu dapat tetap, sebab ia telah menceritakan kepada mereka, bahwa ia orang Yahudi.", "5": "<span>5 </span> Ketika Haman melihat, bahwa Mordekhai tidak berlutut dan sujud kepadanya, maka sangat panaslah hati Haman,", "6": "<span>6 </span> tetapi ia menganggap dirinya terlalu hina untuk membunuh hanya Mordekhai saja, karena orang telah memberitahukan kepadanya kebangsaan Mordekhai itu. Jadi Haman mencari ikhtiar memunahkan semua orang Yahudi, yakni bangsa Mordekhai itu, di seluruh kerajaan Ahasyweros.", "7": "<span>7 </span> Dalam bulan pertama, yakni bulan Nisan, dalam tahun yang kedua belas zaman raja Ahasyweros, orang membuang pur--yakni undi--di depan Haman, hari demi hari dan bulan demi bulan sampai jatuh pada bulan yang kedua belas, yakni bulan Adar.", "8": "<span>8 </span> Maka sembah Haman kepada raja Ahasyweros: \"Ada suatu bangsa yang hidup tercerai-berai dan terasing di antara bangsa-bangsa di dalam seluruh daerah kerajaan tuanku, dan hukum mereka berlainan dengan hukum segala bangsa, dan hukum raja tidak dilakukan mereka, sehingga tidak patut bagi raja membiarkan mereka leluasa.", "9": "<span>9 </span> Jikalau baik pada pemandangan raja, hendaklah dikeluarkan surat titah untuk membinasakan mereka; maka hamba akan menimbang perak sepuluh ribu talenta dan menyerahkannya kepada tangan para pejabat yang bersangkutan, supaya mereka memasukkannya ke dalam perbendaharaan raja.\"", "10": "<span>10 </span> Maka raja mencabut cincin meterainya dari jarinya, lalu diserahkannya kepada Haman bin Hamedata, orang Agag, seteru orang Yahudi itu,", "11": "<span>11 </span> kemudian titah raja kepada Haman: \"Perak itu terserah kepadamu, juga bangsa itu untuk kauperlakukan seperti yang kaupandang baik.\"", "12": "<span>12 </span> Maka dalam bulan yang pertama pada hari yang ketiga belas dipanggillah para panitera raja, lalu, sesuai dengan segala yang diperintahkan Haman, ditulislah surat kepada wakil-wakil raja, kepada setiap bupati yang menguasai daerah dan kepada setiap pembesar bangsa, yakni kepada tiap-tiap daerah menurut tulisannya dan kepada tiap-tiap bangsa menurut bahasanya; surat itu ditulis atas nama raja Ahasyweros dan dimeterai dengan cincin meterai raja.", "13": "<span>13 </span> Surat-surat itu dikirimkan dengan perantaraan pesuruh-pesuruh cepat ke segala daerah kerajaan, supaya dipunahkan, dibunuh dan dibinasakan semua orang Yahudi dari pada yang muda sampai kepada yang tua, bahkan anak-anak dan perempuan-perempuan, pada satu hari juga, pada tanggal tiga belas bulan yang kedua belas--yakni bulan Adar--,dan supaya dirampas harta milik mereka.", "14": "<span>14 </span> Salinan surat itu harus diundangkan di dalam tiap-tiap daerah, lalu diumumkan kepada segala bangsa, supaya mereka bersiap-siap untuk hari itu.", "15": "<span>15 </span> Maka dengan tergesa-gesa berangkatlah pesuruh-pesuruh cepat itu, atas titah raja, dan undang-undang itu dikeluarkan di dalam benteng Susan. Sementara itu raja serta Haman duduk minum-minum, tetapi kota Susan menjadi gempar." }, "4": { "1": "<span>1 </span> Setelah Mordekhai mengetahui segala yang terjadi itu, ia mengoyakkan pakaiannya, lalu memakai kain kabung dan abu, kemudian keluar berjalan di tengah-tengah kota, sambil melolong-lolong dengan nyaring dan pedih.", "2": "<span>2 </span> Dengan demikian datanglah ia sampai ke depan pintu gerbang istana raja, karena seorangpun tidak boleh masuk pintu gerbang istana raja dengan berpakaian kain kabung.", "3": "<span>3 </span> Di tiap-tiap daerah, ke mana titah dan undang-undang raja telah sampai, ada perkabungan yang besar di antara orang Yahudi disertai puasa dan ratap tangis; oleh banyak orang dibentangkan kain kabung dengan abu sebagai lapik tidurnya.", "4": "<span>4 </span> Ketika dayang-dayang dan sida-sida Ester memberitahukan hal itu kepadanya, maka sangatlah risau hati sang ratu, lalu dikirimkannyalah pakaian, supaya dipakaikan kepada Mordekhai dan supaya ditanggalkan kain kabungnya dari padanya, tetapi tidak diterimanya.", "5": "<span>5 </span> Maka Ester memanggil Hatah, salah seorang sida-sida raja yang ditetapkan baginda melayani dia, lalu memberi perintah kepadanya menanyakan Mordekhai untuk mengetahui apa artinya dan apa sebabnya hal itu.", "6": "<span>6 </span> Lalu keluarlah Hatah mendapatkan Mordekhai di lapangan kota yang di depan pintu gerbang istana raja,", "7": "<span>7 </span> dan Mordekhai menceritakan kepadanya segala yang dialaminya, serta berapa banyaknya perak yang dijanjikan oleh Haman akan ditimbang untuk perbendaharaan raja sebagai harga pembinasaan orang Yahudi.", "8": "<span>8 </span> Juga salinan surat undang-undang, yang dikeluarkan di Susan untuk memunahkan mereka itu, diserahkannya kepada Hatah, supaya diperlihatkan dan diberitahukan kepada Ester. Lagipula Hatah disuruh menyampaikan pesan kepada Ester, supaya pergi menghadap raja untuk memohon karunianya dan untuk membela bangsanya di hadapan baginda.", "9": "<span>9 </span> Lalu masuklah Hatah dan menyampaikan perkataan Mordekhai kepada Ester.", "10": "<span>10 </span> Akan tetapi Ester menyuruh Hatah memberitahukan kepada Mordekhai:", "11": "<span>11 </span> \"Semua pegawai raja serta penduduk daerah-daerah kerajaan mengetahui bahwa bagi setiap laki-laki atau perempuan, yang menghadap raja di pelataran dalam dengan tiada dipanggil, hanya berlaku satu undang-undang, yakni hukuman mati. Hanya orang yang kepadanya raja mengulurkan tongkat emas, yang akan tetap hidup. Dan aku selama tiga puluh hari ini tidak dipanggil menghadap raja.\"", "12": "<span>12 </span> Ketika disampaikan orang perkataan Ester itu kepada Mordekhai,", "13": "<span>13 </span> maka Mordekhai menyuruh menyampaikan jawab ini kepada Ester: \"Jangan kira, karena engkau di dalam istana raja, hanya engkau yang akan terluput dari antara semua orang Yahudi.", "14": "<span>14 </span> Sebab sekalipun engkau pada saat ini berdiam diri saja, bagi orang Yahudi akan timbul juga pertolongan dan kelepasan dari pihak lain, dan engkau dengan kaum keluargamu akan binasa. Siapa tahu, mungkin justru untuk saat yang seperti ini engkau beroleh kedudukan sebagai ratu.\"", "15": "<span>15 </span> Maka Ester menyuruh menyampaikan jawab ini kepada Mordekhai:", "16": "<span>16 </span> \"Pergilah, kumpulkanlah semua orang Yahudi yang terdapat di Susan dan berpuasalah untuk aku; janganlah makan dan janganlah minum tiga hari lamanya, baik waktu malam, baik waktu siang. Aku serta dayang-dayangkupun akan berpuasa demikian, dan kemudian aku akan masuk menghadap raja, sungguhpun berlawanan dengan undang-undang; kalau terpaksa aku mati, biarlah aku mati.\"", "17": "<span>17 </span> Maka pergilah Mordekhai dan diperbuatnyalah tepat seperti yang dipesankan Ester kepadanya." }, "5": { "1": "<span>1 </span> Pada hari yang ketiga Ester mengenakan pakaian ratu, lalu berdirilah ia di pelataran dalam istana raja, tepat di depan istana raja. Raja bersemayam di atas takhta kerajaan di dalam istana, berhadapan dengan pintu istana itu.", "2": "<span>2 </span> Ketika raja melihat Ester, sang ratu, berdiri di pelataran, berkenanlah raja kepadanya, sehingga raja mengulurkan tongkat emas yang di tangannya ke arah Ester, lalu mendekatlah Ester dan menyentuh ujung tongkat itu.", "3": "<span>3 </span> Tanya raja kepadanya: \"Apa maksudmu, hai ratu Ester, dan apa keinginanmu? Sampai setengah kerajaan sekalipun akan diberikan kepadamu.\"", "4": "<span>4 </span> Jawab Ester: \"Jikalau baik pada pemandangan raja, datanglah kiranya raja dengan Haman pada hari ini ke perjamuan yang diadakan oleh hamba bagi raja.\"", "5": "<span>5 </span> Maka titah raja: \"Suruhlah Haman datang dengan segera, supaya kami memenuhi permintaan Ester.\" Lalu raja datang dengan Haman ke perjamuan yang diadakan oleh Ester.", "6": "<span>6 </span> Sementara minum anggur bertanyalah raja kepada Ester: \"Apakah permintaanmu? Niscaya akan dikabulkan. Dan apakah keinginanmu? Sampai setengah kerajaan sekalipun akan dipenuhi.\"", "7": "<span>7 </span> Maka jawab Ester: \"Permintaan dan keinginan hamba ialah:", "8": "<span>8 </span> Jikalau hamba mendapat kasih raja, dan jikalau baik pada pemandangan raja mengabulkan permintaan serta memenuhi keinginan hamba, datang pulalah kiranya raja dengan Haman ke perjamuan yang akan hamba adakan bagi raja dan Haman; maka besok akan hamba lakukan yang dikehendaki raja.\"", "9": "<span>9 </span> Pada hari itu keluarlah Haman dengan hati riang dan gembira; tetapi ketika Haman melihat Mordekhai ada di pintu gerbang istana raja, tidak bangkit dan tidak bergerak menghormati dia, maka sangat panaslah hati Haman kepada Mordekhai.", "10": "<span>10 </span> Tetapi Haman menahan hatinya, lalu pulanglah ia ke rumahnya dan menyuruh datang sahabat-sahabatnya dan Zeresh, isterinya.", "11": "<span>11 </span> Maka Haman menceriterakan kepada mereka itu besarnya kekayaannya, banyaknya anaknya laki-laki, dan segala kebesaran yang diberikan raja kepadanya serta kenaikan pangkatnya di atas para pembesar dan pegawai raja.", "12": "<span>12 </span> Lagi kata Haman: \"Tambahan pula tiada seorangpun diminta oleh Ester, sang ratu, untuk datang bersama-sama dengan raja ke perjamuan yang diadakannya, kecuali aku; dan untuk besokpun aku diundangnya bersama-sama dengan raja.", "13": "<span>13 </span> Akan tetapi semuanya itu tidak berguna bagiku, selama aku masih melihat si Mordekhai, si Yahudi itu, duduk di pintu gerbang istana raja.\"", "14": "<span>14 </span> Lalu kata Zeresh, isterinya, dan semua sahabatnya kepadanya: \"Suruhlah orang membuat tiang yang tingginya lima puluh hasta, dan persembahkanlah besok pagi kepada raja, supaya Mordekhai disulakan orang pada tiang itu; kemudian dapatlah engkau dengan bersukacita pergi bersama-sama dengan raja ke perjamuan itu.\" Hal itu dipandang baik oleh Haman, lalu ia menyuruh membuat tiang itu." }, "6": { "1": "<span>1 </span> Pada malam itu juga raja tidak dapat tidur. Maka bertitahlah baginda membawa kitab pencatatan sejarah, lalu dibacakan di hadapan raja.", "2": "<span>2 </span> Dan di situ didapati suatu catatan tentang Mordekhai, yang pernah memberitahukan bahwa Bigtan dan Teresh, dua orang sida-sida raja yang termasuk golongan penjaga pintu, telah berikhtiar membunuh raja Ahasyweros.", "3": "<span>3 </span> Maka bertanyalah raja: \"Kehormatan dan kebesaran apakah yang dianugerahkan kepada Mordekhai oleh sebab perkara itu?\" Jawab para biduanda raja yang bertugas pada baginda: \"Kepadanya tidak dianugerahkan suatu apapun.\"", "4": "<span>4 </span> Maka bertanyalah raja: \"Siapakah itu yang ada di pelataran?\" Pada waktu itu Haman baru datang di pelataran luar istana raja untuk memberitahukan kepada baginda, bahwa ia hendak menyulakan Mordekhai pada tiang yang sudah didirikannya untuk dia.", "5": "<span>5 </span> Lalu jawab para biduanda raja kepada baginda: \"Itulah Haman, ia berdiri di pelataran.\" Maka titah raja: \"Suruhlah dia masuk.\"", "6": "<span>6 </span> Setelah Haman masuk, bertanyalah raja kepadanya: \"Apakah yang harus dilakukan kepada orang yang raja berkenan menghormatinya?\" Kata Haman dalam hatinya: \"Kepada siapa lagi raja berkenan menganugerahkan kehormatan lebih dari kepadaku?\"", "7": "<span>7 </span> Oleh karena itu jawab Haman kepada raja: \"Mengenai orang yang raja berkenan menghormatinya,", "8": "<span>8 </span> hendaklah diambil pakaian kerajaan yang biasa dipakai oleh raja sendiri, dan lagi kuda yang biasa dikendarai oleh raja sendiri dan yang diberi mahkota kerajaan di kepalanya,", "9": "<span>9 </span> dan hendaklah diserahkan pakaian dan kuda itu ke tangan seorang dari antara para pembesar raja, orang-orang bangsawan, lalu hendaklah pakaian itu dikenakan kepada orang yang raja berkenan menghormatinya, kemudian hendaklah ia diarak dengan mengendarai kuda itu melalui lapangan kota sedang orang berseru-seru di depannya: Beginilah dilakukan kepada orang yang raja berkenan menghormatinya!\"", "10": "<span>10 </span> Maka titah raja kepada Haman: \"Segera ambillah pakaian dan kuda itu, seperti yang kaukatakan itu, dan lakukanlah demikian kepada Mordekhai, orang Yahudi, yang duduk di pintu gerbang istana. Sepatah katapun janganlah kaulalaikan dari pada segala yang kaukatakan itu.\"", "11": "<span>11 </span> Lalu Haman mengambil pakaian dan kuda itu, dan dikenakannya pakaian itu kepada Mordekhai, kemudian diaraknya Mordekhai melalui lapangan kota itu, sedang ia menyerukan di depannya: \"Beginilah dilakukan kepada orang yang raja berkenan menghormatinya.\"", "12": "<span>12 </span> Kemudian kembalilah Mordekhai ke pintu gerbang istana raja, tetapi Haman bergesa-gesa pulang ke rumahnya dengan sedih hatinya dan berselubung kepalanya.", "13": "<span>13 </span> Dan Haman menceritakan kepada Zeresh, isterinya, dan kepada semua sahabatnya apa yang dialaminya. Maka kata para orang arif bijaksana dan Zeresh, isterinya, kepadanya: \"Jikalau Mordekhai, yang di depannya engkau sudah mulai jatuh, adalah keturunan Yahudi, maka engkau tidak akan sanggup melawan dia, malahan engkau akan jatuh benar-benar di depannya.\"", "14": "<span>14 </span> Selagi mereka itu bercakap-cakap dengan dia, datanglah sida-sida raja, lalu mengantarkan Haman dengan segera ke perjamuan yang diadakan oleh Ester." }, "7": { "1": "<span>1 </span> Datanglah raja dengan Haman untuk dijamu oleh Ester, sang ratu.", "2": "<span>2 </span> Pada hari yang kedua itu, sementara minum anggur, bertanyalah pula raja kepada Ester: \"Apakah permintaanmu, hai ratu Ester? Niscaya akan dikabulkan. Dan apakah keinginanmu? Sampai setengah kerajaan sekalipun akan dipenuhi.\"", "3": "<span>3 </span> Maka jawab Ester, sang ratu: \"Ya raja, jikalau hamba mendapat kasih raja dan jikalau baik pada pemandangan raja, karuniakanlah kiranya kepada hamba nyawa hamba atas permintaan hamba, dan bangsa hamba atas keinginan hamba.", "4": "<span>4 </span> Karena kami, hamba serta bangsa hamba, telah terjual untuk dipunahkan, dibunuh dan dibinasakan. Jikalau seandainya kami hanya dijual sebagai budak laki-laki dan perempuan, niscaya hamba akan berdiam diri, tetapi malapetaka ini tiada taranya di antara bencana yang menimpa raja.\"", "5": "<span>5 </span> Maka bertanyalah raja Ahasyweros kepada Ester, sang ratu: \"Siapakah orang itu dan di manakah dia yang hatinya mengandung niat akan berbuat demikian?\"", "6": "<span>6 </span> Lalu jawab Ester: \"Penganiaya dan musuh itu, ialah Haman, orang jahat ini!\" Maka Hamanpun sangatlah ketakutan di hadapan raja dan ratu.", "7": "<span>7 </span> Lalu bangkitlah raja dengan panas hatinya dari pada minum anggur dan keluar ke taman istana; akan tetapi Haman masih tinggal untuk memohon nyawanya kepada Ester, sang ratu, karena ia melihat, bahwa telah putus niat raja untuk mendatangkan celaka kepadanya.", "8": "<span>8 </span> Ketika raja kembali dari taman istana ke dalam ruangan minum anggur, maka Haman berlutut pada katil tempat Ester berbaring. Maka titah raja: \"Masih jugakah ia hendak menggagahi sang ratu di dalam istanaku sendiri?\" Tatkala titah raja itu keluar dari mulutnya, maka diselubungi oranglah muka Haman.", "9": "<span>9 </span> Sembah Harbona, salah seorang sida-sida yang di hadapan raja: \"Lagipula tiang yang dibuat Haman untuk Mordekhai, orang yang menyelamatkan raja dengan pemberitahuannya itu, telah berdiri di dekat rumah Haman, lima puluh hasta tingginya.\" Lalu titah raja: \"Sulakan dia pada tiang itu.\"", "10": "<span>10 </span> Kemudian Haman disulakan pada tiang yang didirikannya untuk Mordekhai. Maka surutlah panas hati raja." }, "8": { "1": "<span>1 </span> Pada hari itu juga raja Ahasyweros mengaruniakan harta milik Haman, seteru orang Yahudi, kepada Ester, sang ratu, dan Mordekhai masuk menghadap raja, karena Ester telah memberitahukan apa pertalian Mordekhai dengan dia.", "2": "<span>2 </span> Maka raja mencabut cincin meterai yang diambil dari pada Haman, lalu diserahkannya kepada Mordekhai; dan Mordekhai diangkat oleh Ester menjadi kuasa atas harta milik Haman.", "3": "<span>3 </span> Kemudian Ester berkata lagi kepada raja sambil sujud pada kakinya dan menangis memohon karunianya, supaya dibatalkannya maksud jahat Haman, orang Agag itu, serta rancangan yang sudah dibuatnya terhadap orang Yahudi.", "4": "<span>4 </span> Maka raja mengulurkan tongkat emas kepada Ester, lalu bangkitlah Ester dan berdiri di hadapan raja,", "5": "<span>5 </span> serta sembahnya: \"Jikalau baik pada pemandangan raja dan jikalau hamba mendapat kasih raja, dan hal ini kiranya dipandang benar oleh raja dan raja berkenan kepada hamba, maka hendaklah dikeluarkan surat titah untuk menarik kembali surat-surat yang berisi rancangan Haman bin Hamedata, orang Agag itu, yang ditulisnya untuk membinasakan orang Yahudi di dalam semua daerah kerajaan.", "6": "<span>6 </span> Karena bagaimana hamba dapat melihat malapetaka yang menimpa bangsa hamba dan bagaimana hamba dapat melihat kebinasaan sanak saudara hamba?\"", "7": "<span>7 </span> Maka jawab raja Ahasyweros kepada Ester, sang ratu, serta kepada Mordekhai, orang Yahudi itu: \"Harta milik Haman telah kukaruniakan kepada Ester, dan Haman sendiri telah disulakan pada tiang karena ia sudah mengacungkan tangannya kepada orang Yahudi.", "8": "<span>8 </span> Tuliskanlah atas nama raja apa yang kamu pandang baik tentang orang Yahudi dan meteraikanlah surat itu dengan cincin meterai raja, karena surat yang dituliskan atas nama raja dan dimeteraikan dengan cincin meterai raja tidak dapat ditarik kembali.\"", "9": "<span>9 </span> Pada waktu itu juga dipanggillah para panitera raja, dalam bulan yang ketiga--yakni bulan Siwan--pada tanggal dua puluh tiga, dan sesuai dengan segala yang diperintahkan Mordekhai ditulislah surat kepada orang Yahudi, dan kepada para wakil pemerintah, para bupati dan para pembesar daerah, dari India sampai ke Etiopia, seratus dua puluh tujuh daerah, kepada tiap-tiap daerah menurut tulisannya dan kepada tiap-tiap bangsa menurut bahasanya, dan juga kepada orang Yahudi menurut tulisan dan bahasanya.", "10": "<span>10 </span> Maka ditulislah pesan atas nama raja Ahasyweros dan dimeterai dengan cincin meterai raja, lalu dengan perantaraan pesuruh-pesuruh cepat yang berkuda, yang mengendarai kuda kerajaan yang tangkas yang diternakkan di pekudaan, dikirimkanlah surat-surat", "11": "<span>11 </span> yang isinya: raja mengizinkan orang Yahudi di tiap-tiap kota untuk berkumpul dan mempertahankan nyawanya serta memunahkan, membunuh atau membinasakan segala tentara, bahkan anak-anak dan perempuan-perempuan, dari bangsa dan daerah yang hendak menyerang mereka, dan untuk merampas harta miliknya,", "12": "<span>12 </span> pada hari yang sama di segala daerah raja Ahasyweros, pada tanggal tiga belas bulan yang kedua belas, yakni bulan Adar.", "13": "<span>13 </span> Salinan pesan tertulis itu harus diundangkan di tiap-tiap daerah, lalu diumumkan kepada segala bangsa, dan orang Yahudi harus bersiap-siap untuk hari itu akan melakukan pembalasan kepada musuhnya.", "14": "<span>14 </span> Maka dengan terburu-buru dan tergesa-gesa berangkatlah pesuruh-pesuruh cepat yang mengendarai kuda kerajaan yang tangkas itu, atas titah raja, dan undang-undang itu dikeluarkan di dalam benteng Susan.", "15": "<span>15 </span> Dan Mordekhai keluar dari hadapan raja dengan memakai pakaian kerajaan dari pada kain ungu tua dan kain lenan, dengan memakai tajuk emas yang mengagumkan serta jubah dari pada kain lenan halus dan kain ungu muda. Maka kota Susanpun bertempiksoraklah dan bersukaria:", "16": "<span>16 </span> orang Yahudi telah beroleh kelapangan hati dan sukacita, kegirangan dan kehormatan.", "17": "<span>17 </span> Demikian juga di tiap-tiap daerah dan di tiap-tiap kota, di tempat manapun titah dan undang-undang raja telah sampai, ada sukacita dan kegirangan di antara orang Yahudi, dan perjamuan serta hari gembira; dan lagi banyak dari antara rakyat negeri itu masuk Yahudi, karena mereka ditimpa ketakutan kepada orang Yahudi." }, "9": { "1": "<span>1 </span> Dalam bulan yang kedua belas--yakni bulan Adar--,pada hari yang ketiga belas, ketika titah serta undang-undang raja akan dilaksanakan, pada hari musuh-musuh orang Yahudi berharap mengalahkan orang Yahudi, terjadilah yang sebaliknya: orang Yahudi mengalahkan pembenci-pembenci mereka.", "2": "<span>2 </span> Maka berkumpullah orang Yahudi di dalam kota-kotanya di seluruh daerah raja Ahasyweros, untuk membunuh orang-orang yang berikhtiar mencelakakan mereka, dan tiada seorangpun tahan menghadapi mereka, karena ketakutan kepada orang Yahudi telah menimpa segala bangsa itu.", "3": "<span>3 </span> Dan semua pembesar daerah dan wakil pemerintahan dan bupati serta pejabat kerajaan menyokong orang Yahudi, karena ketakutan kepada Mordekhai telah menimpa mereka.", "4": "<span>4 </span> Sebab Mordekhai besar kekuasaannya di dalam istana raja dan tersiarlah berita tentang dia ke segenap daerah, karena Mordekhai itu bertambah-tambah besar kekuasaannya.", "5": "<span>5 </span> Maka orang Yahudi mengalahkan semua musuhnya: mereka memukulnya dengan pedang, membunuh dan membinasakannya; mereka berbuat sekehendak hatinya terhadap pembenci-pembenci mereka.", "6": "<span>6 </span> Di dalam benteng Susan saja orang Yahudi membunuh dan membinasakan lima ratus orang.", "7": "<span>7 </span> Juga Parsandata, Dalfon, Aspata,", "8": "<span>8 </span> Porata, Adalya, Aridata,", "9": "<span>9 </span> Parmasta, Arisai, Aridai dan Waizata,", "10": "<span>10 </span> kesepuluh anak laki-laki Haman bin Hamedata, seteru orang Yahudi, dibunuh oleh mereka, tetapi kepada barang rampasan tidaklah mereka mengulurkan tangan.", "11": "<span>11 </span> Pada hari itu juga jumlah orang-orang yang terbunuh di dalam benteng Susan disampaikan ke hadapan raja.", "12": "<span>12 </span> Lalu titah raja kepada Ester, sang ratu: \"Di dalam benteng Susan saja orang Yahudi telah membunuh dan membinasakan lima ratus orang beserta kesepuluh anak Haman. Di daerah-daerah kerajaan yang lain, entahlah apa yang diperbuat mereka. Dan apakah permintaanmu sekarang? Niscaya akan dikabulkan. Dan apakah keinginanmu lagi? Niscaya dipenuhi.\"", "13": "<span>13 </span> Lalu jawab Ester: \"Jikalau baik pada pemandangan raja, diizinkanlah kiranya kepada orang Yahudi yang di Susan untuk berbuat besokpun sesuai dengan undang-undang untuk hari ini, dan kesepuluh anak Haman itu hendaklah disulakan pada tiang.\"", "14": "<span>14 </span> Rajapun menitahkan berbuat demikian; maka undang-undang itu dikeluarkan di Susan dan kesepuluh anak Haman disulakan orang.", "15": "<span>15 </span> Jadi berkumpullah orang Yahudi yang di Susan pada hari yang keempat belas bulan Adar juga dan dibunuhnyalah di Susan tiga ratus orang, tetapi kepada barang rampasan tidaklah mereka mengulurkan tangan.", "16": "<span>16 </span> Orang Yahudi yang lain, yang ada di dalam daerah kerajaan, berkumpul dan mempertahankan nyawanya serta mendapat keamanan terhadap musuhnya; mereka membunuh tujuh puluh lima ribu orang di antara pembenci-pembenci mereka, tetapi kepada barang rampasan tidaklah mereka mengulurkan tangan.", "17": "<span>17 </span> Hal itu terjadi pada hari yang ketiga belas dalam bulan Adar. Pada hari yang keempat belas berhentilah mereka dan hari itu dijadikan mereka hari perjamuan dan sukacita.", "18": "<span>18 </span> Akan tetapi orang Yahudi yang di Susan berkumpul, baik pada hari yang ketiga belas, baik pada hari yang keempat belas dalam bulan itu. Lalu berhentilah mereka pada hari yang kelima belas dan hari itu dijadikan mereka hari perjamuan dan sukacita.", "19": "<span>19 </span> Oleh sebab itu orang Yahudi yang di pedusunan, yakni yang diam di perkampungan merayakan hari yang keempat belas bulan Adar itu sebagai hari sukacita dan hari perjamuan, dan sebagai hari gembira untuk antar-mengantar makanan.", "20": "<span>20 </span> Maka Mordekhai menuliskan peristiwa itu, lalu mengirimkan surat-surat kepada semua orang Yahudi di seluruh daerah raja Ahasyweros, baik yang dekat baik yang jauh,", "21": "<span>21 </span> untuk mewajibkan mereka, supaya tiap-tiap tahun merayakan hari yang keempat belas dan yang kelima belas bulan Adar,", "22": "<span>22 </span> karena pada hari-hari itulah orang Yahudi mendapat keamanan terhadap musuhnya dan dalam bulan itulah dukacita mereka berubah menjadi sukacita dan hari perkabungan menjadi hari gembira, dan supaya menjadikan hari-hari itu hari perjamuan dan sukacita dan hari untuk antar-mengantar makanan dan untuk bersedekah kepada orang-orang miskin.", "23": "<span>23 </span> Maka orang Yahudi menerima sebagai ketetapan apa yang sudah dimulai mereka melakukannya dan apa yang ditulis Mordekhai kepada mereka.", "24": "<span>24 </span> Sesungguhnya Haman bin Hamedata, orang Agag, seteru semua orang Yahudi itu, telah merancangkan hendak membinasakan orang Yahudi dan diapun telah membuang pur--yakni undi--untuk menghancurkan dan membinasakan mereka,", "25": "<span>25 </span> akan tetapi ketika hal itu disampaikan ke hadapan raja, maka dititahkannyalah dengan surat, supaya rancangan jahat yang dibuat Haman terhadap orang Yahudi itu dibalikkan ke atas kepalanya. Maka Haman beserta anak-anaknya disulakan pada tiang.", "26": "<span>26 </span> Oleh sebab itulah hari-hari itu disebut Purim, menurut kata pur. Oleh sebab itu jugalah, yakni karena seluruh isi surat itu dan karena apa yang dilihat mereka mengenai hal itu dan apa yang dialami mereka,", "27": "<span>27 </span> orang Yahudi menerima sebagai kewajiban dan sebagai ketetapan bagi dirinya sendiri dan keturunannya dan bagi sekalian orang yang akan bergabung dengan mereka, bahwa mereka tidak akan melampaui merayakan kedua hari itu tiap-tiap tahun, menurut yang dituliskan tentang itu dan pada waktu yang ditentukan,", "28": "<span>28 </span> dan bahwa hari-hari itu akan diperingati dan dirayakan di dalam tiap-tiap angkatan, di dalam tiap-tiap kaum, di tiap-tiap daerah, di tiap-tiap kota, sehingga hari-hari Purim itu tidak akan lenyap dari tengah-tengah orang Yahudi dan peringatannya tidak akan berakhir dari antara keturunan mereka.", "29": "<span>29 </span> Lalu Ester, sang ratu, anak Abihail, menulis surat, bersama-sama dengan Mordekhai, orang Yahudi itu; surat yang kedua tentang hari raya Purim ini dituliskannya dengan segala ketegasan untuk menguatkannya.", "30": "<span>30 </span> Lalu dikirimkanlah surat-surat kepada semua orang Yahudi di dalam keseratus dua puluh tujuh daerah kerajaan Ahasyweros, dengan kata-kata salam dan setia,", "31": "<span>31 </span> supaya hari-hari Purim itu dirayakan pada waktu yang ditentukan, seperti yang diwajibkan kepada mereka oleh Mordekhai, orang Yahudi itu, dan oleh Ester, sang ratu, dan seperti yang diwajibkan mereka kepada dirinya sendiri serta keturunan mereka, mengenai hal berpuasa dan meratap-ratap.", "32": "<span>32 </span> Demikianlah perintah Ester menetapkan perihal Purim itu, kemudian dituliskan di dalam kitab." }, "10": { "1": "<span>1 </span> Maka raja Ahasyweros mengenakan upeti atas negeri dan daerah-daerah pesisir juga.", "2": "<span>2 </span> Segala perbuatannya yang hebat serta gagah dan pemberitaan yang seksama tentang kebesaran yang dikaruniakan raja kepada Mordekhai, bukankah semuanya itu tertulis di dalam kitab sejarah raja-raja Media dan Persia?", "3": "<span>3 </span> Karena Mordekhai, orang Yahudi itu, menjadi orang kedua di bawah raja Ahasyweros, dan ia dihormati oleh orang Yahudi serta disukai oleh banyak sanak saudaranya, sebab ia mengikhtiarkan yang baik bagi bangsanya dan berbicara untuk keselamatan bagi semua orang sebangsanya." } } }; module.exports = book;
201.530928
528
0.775737
289f0f3862bc0312571fb9f0e5cdc3f438cf345f
17,684
js
JavaScript
lib/components/Group.js
kurispesso/react-awesome-query-builder
369801aa8e61351f63f1d94c10d0eefbc813037e
[ "MIT" ]
null
null
null
lib/components/Group.js
kurispesso/react-awesome-query-builder
369801aa8e61351f63f1d94c10d0eefbc813037e
[ "MIT" ]
null
null
null
lib/components/Group.js
kurispesso/react-awesome-query-builder
369801aa8e61351f63f1d94c10d0eefbc813037e
[ "MIT" ]
null
null
null
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = exports.Group = void 0; var _react = _interopRequireWildcard(require("react")); var _propTypes = _interopRequireDefault(require("prop-types")); var _startsWith = _interopRequireDefault(require("lodash/startsWith")); var _GroupContainer = _interopRequireDefault(require("./containers/GroupContainer")); var _Draggable = _interopRequireDefault(require("./containers/Draggable")); var _Item = _interopRequireDefault(require("./Item")); var _GroupActions = require("./GroupActions"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var classNames = require("classnames"); var defaultPosition = "topRight"; var dummyFn = function dummyFn() {}; var DragIcon = function DragIcon() { return /*#__PURE__*/_react["default"].createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "gray", width: "18px", height: "18px" }, /*#__PURE__*/_react["default"].createElement("path", { d: "M0 0h24v24H0V0z", fill: "none" }), /*#__PURE__*/_react["default"].createElement("path", { d: "M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" })); }; var Group = /*#__PURE__*/function (_PureComponent) { _inherits(Group, _PureComponent); var _super = _createSuper(Group); function Group(props) { var _this; _classCallCheck(this, Group); _this = _super.call(this, props); _this.childrenClassName = function () { return ""; }; _this.renderBeforeActions = function () { var BeforeActions = _this.props.config.settings.renderBeforeActions; if (BeforeActions == undefined) return null; return typeof BeforeActions === "function" ? /*#__PURE__*/_react["default"].createElement(BeforeActions, _this.props) : BeforeActions; }; _this.renderAfterActions = function () { var AfterActions = _this.props.config.settings.renderAfterActions; if (AfterActions == undefined) return null; return typeof AfterActions === "function" ? /*#__PURE__*/_react["default"].createElement(AfterActions, _this.props) : AfterActions; }; _this.canAddGroup = function () { return _this.props.allowFurtherNesting; }; _this.canAddRule = function () { var maxNumberOfRules = _this.props.config.settings.maxNumberOfRules; var totalRulesCnt = _this.props.totalRulesCnt; if (maxNumberOfRules) { return totalRulesCnt < maxNumberOfRules; } return true; }; _this.canDeleteGroup = function () { return !_this.props.isRoot; }; _this.removeSelf = _this.removeSelf.bind(_assertThisInitialized(_this)); return _this; } _createClass(Group, [{ key: "isGroupTopPosition", value: function isGroupTopPosition() { return (0, _startsWith["default"])(this.props.config.settings.groupActionsPosition || defaultPosition, "top"); } }, { key: "removeSelf", value: function removeSelf() { var _this2 = this; var _this$props$config$se = this.props.config.settings, renderConfirm = _this$props$config$se.renderConfirm, confirmOptions = _this$props$config$se.removeGroupConfirmOptions; var doRemove = function doRemove() { _this2.props.removeSelf(); }; if (confirmOptions && !this.isEmptyCurrentGroup()) { renderConfirm(_objectSpread(_objectSpread({}, confirmOptions), {}, { onOk: doRemove, onCancel: null })); } else { doRemove(); } } }, { key: "isEmptyCurrentGroup", value: function isEmptyCurrentGroup() { var children = this.props.children1; return children.size == 0 || children.size == 1 && this.isEmpty(children.first()); } }, { key: "isEmpty", value: function isEmpty(item) { return item.get("type") == "group" || item.get("type") == "rule_group" ? this.isEmptyGroup(item) : this.isEmptyRule(item); } }, { key: "isEmptyGroup", value: function isEmptyGroup(group) { var children = group.get("children1"); return children.size == 0 || children.size == 1 && this.isEmpty(children.first()); } }, { key: "isEmptyRule", value: function isEmptyRule(rule) { var properties = rule.get("properties"); return !(properties.get("field") !== null && properties.get("operator") !== null && properties.get("value").filter(function (val) { return val !== undefined; }).size > 0); } }, { key: "render", value: function render() { return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, this.renderHeaderWrapper(), this.renderChildrenWrapper(), this.renderFooterWrapper()); } }, { key: "renderChildrenWrapper", value: function renderChildrenWrapper() { var _this$props = this.props, conjunctionOptions = _this$props.conjunctionOptions, children1 = _this$props.children1, config = _this$props.config; var conjunctionCount = Object.keys(conjunctionOptions).length; var showConjs = conjunctionCount > 1 || config.settings.showNot; return children1 && /*#__PURE__*/_react["default"].createElement("div", { key: "group-children", className: classNames("group--children", !showConjs ? "hide--conjs" : "", children1.size < 2 && config.settings.hideConjForOne ? "hide--line" : "", children1.size < 2 ? "one--child" : "", this.childrenClassName()) }, this.renderChildren()); } }, { key: "renderHeaderWrapper", value: function renderHeaderWrapper() { var isGroupTopPosition = this.isGroupTopPosition(); return /*#__PURE__*/_react["default"].createElement("div", { key: "group-header", className: "group--header" }, this.renderHeader(), isGroupTopPosition && this.renderBeforeActions(), isGroupTopPosition && this.renderActions(), isGroupTopPosition && this.renderAfterActions()); } }, { key: "renderFooterWrapper", value: function renderFooterWrapper() { var isGroupTopPosition = this.isGroupTopPosition(); return !isGroupTopPosition && /*#__PURE__*/_react["default"].createElement("div", { key: "group-footer", className: "group--footer" }, this.renderBeforeActions(), this.renderActions(), this.renderAfterActions()); } }, { key: "renderActions", value: function renderActions() { var _this$props2 = this.props, config = _this$props2.config, addRule = _this$props2.addRule, addGroup = _this$props2.addGroup; return /*#__PURE__*/_react["default"].createElement(_GroupActions.GroupActions, { config: config, addRule: addRule, addGroup: addGroup, canAddGroup: this.canAddGroup(), canAddRule: this.canAddRule(), canDeleteGroup: this.canDeleteGroup(), removeSelf: this.removeSelf }); } }, { key: "renderChildren", value: function renderChildren() { var children1 = this.props.children1; return children1 ? children1.map(this.renderItem.bind(this)).toList() : null; } }, { key: "renderItem", value: function renderItem(item) { var props = this.props; var config = props.config, actions = props.actions, onDragStart = props.onDragStart, addRule = props.addRule, addGroup = props.addGroup; var isRuleGroup = item.get("type") == "group" && item.getIn(["properties", "field"]) != null; var type = isRuleGroup ? "rule_group" : item.get("type"); return /*#__PURE__*/_react["default"].createElement(_Item["default"], _extends({}, this.extraPropsForItem(item), { key: item.get("id"), id: item.get("id") //path={props.path.push(item.get('id'))} , path: item.get("path"), type: type, properties: item.get("properties"), config: config, actions: actions, children1: item.get("children1") //tree={props.tree} , reordableNodesCnt: this.reordableNodesCnt(), totalRulesCnt: this.props.totalRulesCnt, onDragStart: onDragStart, isDraggingTempo: this.props.isDraggingTempo, removeSelf: this.removeSelf, addRule: addRule, addGroup: addGroup })); } }, { key: "extraPropsForItem", value: function extraPropsForItem(_item) { return {}; } }, { key: "reordableNodesCnt", value: function reordableNodesCnt() { return this.props.reordableNodesCnt; } }, { key: "renderDrag", value: function renderDrag() { var _this$props3 = this.props, config = _this$props3.config, isRoot = _this$props3.isRoot, reordableNodesCnt = _this$props3.reordableNodesCnt, handleDraggerMouseDown = _this$props3.handleDraggerMouseDown; var showDragIcon = config.settings.canReorder && !isRoot && reordableNodesCnt > 1; var drag = showDragIcon && /*#__PURE__*/_react["default"].createElement("span", { key: "group-drag-icon", className: "qb-drag-handler group--drag-handler", onMouseDown: handleDraggerMouseDown }, /*#__PURE__*/_react["default"].createElement(DragIcon, null), " "); return drag; } }, { key: "renderConjs", value: function renderConjs() { var _this$props4 = this.props, config = _this$props4.config, children1 = _this$props4.children1, id = _this$props4.id, selectedConjunction = _this$props4.selectedConjunction, setConjunction = _this$props4.setConjunction, conjunctionOptions = _this$props4.conjunctionOptions, not = _this$props4.not, setNot = _this$props4.setNot; var _config$settings = config.settings, immutableGroupsMode = _config$settings.immutableGroupsMode, Conjs = _config$settings.renderConjs, showNot = _config$settings.showNot; var conjunctionCount = Object.keys(conjunctionOptions).length; var showConjs = conjunctionCount > 1 || showNot; if (!showConjs) return null; var renderProps = { disabled: children1.size < 2, readonly: immutableGroupsMode, selectedConjunction: selectedConjunction, setConjunction: immutableGroupsMode ? dummyFn : setConjunction, conjunctionOptions: conjunctionOptions, config: config, not: not || false, id: id, setNot: immutableGroupsMode ? dummyFn : setNot }; return /*#__PURE__*/_react["default"].createElement(Conjs, renderProps); } }, { key: "renderHeader", value: function renderHeader() { return /*#__PURE__*/_react["default"].createElement("div", { className: classNames("group--conjunctions" // children1.size < 2 && config.settings.hideConjForOne ? 'hide--conj' : '' ) }, this.renderConjs(), this.renderDrag()); } }]); return Group; }(_react.PureComponent); exports.Group = Group; Group.propTypes = { //tree: PropTypes.instanceOf(Immutable.Map).isRequired, reordableNodesCnt: _propTypes["default"].number, conjunctionOptions: _propTypes["default"].object.isRequired, allowFurtherNesting: _propTypes["default"].bool.isRequired, isRoot: _propTypes["default"].bool.isRequired, not: _propTypes["default"].bool, selectedConjunction: _propTypes["default"].string, config: _propTypes["default"].object.isRequired, id: _propTypes["default"].string.isRequired, path: _propTypes["default"].any, //instanceOf(Immutable.List) children1: _propTypes["default"].any, //instanceOf(Immutable.OrderedMap) isDraggingMe: _propTypes["default"].bool, isDraggingTempo: _propTypes["default"].bool, //actions handleDraggerMouseDown: _propTypes["default"].func, onDragStart: _propTypes["default"].func, addRule: _propTypes["default"].func.isRequired, addGroup: _propTypes["default"].func.isRequired, removeSelf: _propTypes["default"].func.isRequired, setConjunction: _propTypes["default"].func.isRequired, setNot: _propTypes["default"].func.isRequired, actions: _propTypes["default"].object.isRequired }; var _default = (0, _GroupContainer["default"])((0, _Draggable["default"])("group")(Group)); exports["default"] = _default;
47.031915
750
0.675469
289ffa84616061f4870f4cc507d98092ded8be46
457
js
JavaScript
packages/pageflow/src/frontend/jquery_ui_widgets/index.js
unknoweleven/pageflow
d88885b184985580de228f767a0aa8c049730dc4
[ "MIT" ]
null
null
null
packages/pageflow/src/frontend/jquery_ui_widgets/index.js
unknoweleven/pageflow
d88885b184985580de228f767a0aa8c049730dc4
[ "MIT" ]
null
null
null
packages/pageflow/src/frontend/jquery_ui_widgets/index.js
unknoweleven/pageflow
d88885b184985580de228f767a0aa8c049730dc4
[ "MIT" ]
null
null
null
import './events'; import './fullscreen_button'; import './header'; import './multimedia_alert'; import './mute_button'; import './navigation'; import './navigation_mobile'; import './overview'; import './page_navigation_list_animation'; import './page_navigation_list'; import './parent_page_button'; import './player_controls'; import './scroll_button'; import './share_menu'; import './skip_page_button'; import './top_button'; import './volume_slider';
25.388889
42
0.739606
28a03fdcfd5cd9453c5d0e3cb5782f88429688ed
657
js
JavaScript
src/modules/shop/controllers/AmdShopZonesCtrl.js
viraweb123/vw-dashboard
67de8d2c0143defdf5236285d4027c2dc226ea29
[ "MIT" ]
2
2020-01-27T06:52:33.000Z
2020-01-27T09:09:03.000Z
src/modules/shop/controllers/AmdShopZonesCtrl.js
viraweb123/vw-dashboard
67de8d2c0143defdf5236285d4027c2dc226ea29
[ "MIT" ]
42
2020-03-24T10:50:16.000Z
2022-02-27T11:51:45.000Z
src/modules/shop/controllers/AmdShopZonesCtrl.js
viraweb123/vw-dashboard
67de8d2c0143defdf5236285d4027c2dc226ea29
[ "MIT" ]
null
null
null
/** @ngInject */ export default function( /* angularjs */ $scope, $controller, /* seen-shop */ $shop) { angular.extend(this, $controller('MbSeenAbstractCollectionCtrl', { $scope: $scope, })); // Override the function this.getModelSchema = function() { return $shop.zoneSchema(); }; // get accounts this.getModels = function(parameterQuery) { return $shop.getZones(parameterQuery); }; // get an account this.getModel = function(id) { return $shop.getZone(id); }; // delete account this.deleteModel = function(model) { return $shop.deleteZone(model.id); }; this.init({ eventType: AMD_SHOP_ZONE_SP, }); }
16.425
67
0.649924
28a04acf88b9b0efd6b028da09e0f11f5f0e2ad3
111
js
JavaScript
src/pages/start/start.js
leslielee888888/Puzzler
8f5d26cc4920866dff18ca0b1e1c6974b6119475
[ "MIT" ]
null
null
null
src/pages/start/start.js
leslielee888888/Puzzler
8f5d26cc4920866dff18ca0b1e1c6974b6119475
[ "MIT" ]
null
null
null
src/pages/start/start.js
leslielee888888/Puzzler
8f5d26cc4920866dff18ca0b1e1c6974b6119475
[ "MIT" ]
null
null
null
import MODULE_NAME from '../../app/app.js'; class StartCtrl { constructor() {} } export default StartCtrl
15.857143
43
0.684685
28a1a357345a77ff490c792d08d78baf6a2e8462
519
js
JavaScript
api/server.spec.js
labs14-lambda-app-store/be2
974e0adbff5f09b5aa44e2e9d631a95a97078967
[ "MIT" ]
2
2019-08-05T16:31:26.000Z
2020-01-24T18:06:37.000Z
api/server.spec.js
labs14-lambda-app-store/be2
974e0adbff5f09b5aa44e2e9d631a95a97078967
[ "MIT" ]
14
2019-07-22T22:30:55.000Z
2022-02-18T05:46:04.000Z
api/server.spec.js
labs14-lambda-app-store/be2
974e0adbff5f09b5aa44e2e9d631a95a97078967
[ "MIT" ]
null
null
null
const server = require("./server"); const supertest = require("supertest"); describe("Server", () => { it("Should be running on production env", () => { expect(process.env.DB_ENV).toBe("testing"); }); describe("GET /", () => { it("should respond with a 200 status code", () => { return supertest(server) .get("/") .expect(200); }); it("should return JSON", () => { return supertest(server) .get("/") .expect("content-type", /json/i); }); }); });
24.714286
55
0.527938
28a1ceff50c05d67ac72088411b3be743304f0a8
172
js
JavaScript
esm/compressed.js
douglasduteil/ucompress
338357700631c1aadc2eb43cdd09cdd27db682a2
[ "0BSD" ]
89
2020-03-23T13:28:52.000Z
2021-12-31T00:53:08.000Z
esm/compressed.js
douglasduteil/ucompress
338357700631c1aadc2eb43cdd09cdd27db682a2
[ "0BSD" ]
7
2020-03-27T00:48:29.000Z
2021-09-04T07:29:26.000Z
esm/compressed.js
douglasduteil/ucompress
338357700631c1aadc2eb43cdd09cdd27db682a2
[ "0BSD" ]
6
2020-05-04T07:21:06.000Z
2021-09-03T19:11:27.000Z
/** * A list of all extensions that will be compressed via brotli and others. * Every other file will simply be served as is (likely binary). */ export default new Set;
28.666667
74
0.726744
28a24e0558a90da89352ea8469f18b24cfee070f
8,634
js
JavaScript
src/PresentationalComponents/Modals/AddEditTopic.js
rvsia/insights-advisor-frontend
ebabac16c702540b6745d3acf13c8a5ef570aec4
[ "Apache-2.0" ]
null
null
null
src/PresentationalComponents/Modals/AddEditTopic.js
rvsia/insights-advisor-frontend
ebabac16c702540b6745d3acf13c8a5ef570aec4
[ "Apache-2.0" ]
null
null
null
src/PresentationalComponents/Modals/AddEditTopic.js
rvsia/insights-advisor-frontend
ebabac16c702540b6745d3acf13c8a5ef570aec4
[ "Apache-2.0" ]
null
null
null
import './_AddEditTopic.scss'; import React, { useState } from 'react'; import { Split, SplitItem } from '@patternfly/react-core/dist/js/layouts/Split/index'; import API from '../../Utilities/Api'; import { BASE_URL } from '../../AppConstants'; import { Button } from '@patternfly/react-core/dist/js/components/Button/Button'; import { Checkbox } from '@patternfly/react-core/dist/js/components/Checkbox/Checkbox'; import { Form } from '@patternfly/react-core/dist/js/components/Form/Form'; import { FormGroup } from '@patternfly/react-core/dist/js/components/Form/FormGroup'; import { Modal } from '@patternfly/react-core/dist/js/components/Modal/Modal'; import PropTypes from 'prop-types'; import { Radio } from '@patternfly/react-core/dist/js/components/Radio/Radio'; import { TextArea } from '@patternfly/react-core/dist/js/components/TextArea/TextArea'; import { TextInput } from '@patternfly/react-core/dist/js/components/TextInput/TextInput'; import { addNotification } from '@redhat-cloud-services/frontend-components-notifications'; import { connect } from 'react-redux'; import { fetchTopicsAdmin } from '../../AppActions'; import { injectIntl } from 'react-intl'; import messages from '../../Messages'; const AddEditTopic = ({ handleModalToggle, intl, isModalOpen, topic, addNotification, fetchTopicsAdmin }) => { const [name, setName] = useState(topic.name || ''); const [description, setDescription] = useState(topic.description || ''); const [tag, setTag] = useState(topic.tag || ''); const [enabled, setEnabled] = useState(topic.enabled || false); const [featured, setFeatured] = useState(topic.featured || false); const [slug, setSlug] = useState(topic.slug || undefined); const editTopic = async ({ type }) => { try { const data = { name, slug, tag, description, enabled, featured }; if (type === 'DELETE') { await API.delete(`${BASE_URL}/topic/${slug}`); } else if (topic.slug) { await API.put(`${BASE_URL}/topic/${slug}/`, data); } else { await API.post(`${BASE_URL}/topic/`, {}, data); } } catch (error) { addNotification({ variant: 'danger', dismissable: true, title: intl.formatMessage(messages.error), description: Object.entries(error.response.data).map(([key, value]) => `${key.toUpperCase()}:${value} `) }); } finally { handleModalToggle(false); fetchTopicsAdmin(); } }; const setNameAndSlug = (name) => { if (topic.slug) { setName(name); } else { setName(name); setSlug(name.replace(/\s/g, '').toLowerCase()); } }; const footer = ( <Split className='split-override' hasGutter> <SplitItem> <Button key='confirm' variant='primary' onClick={ () => editTopic({ type: 'POST/PUT' }) } ouiaId="confirm"> {intl.formatMessage(messages.save)} </Button> </SplitItem> <SplitItem> <Button key='cancel' variant='secondary' onClick={ () => handleModalToggle(false) } ouiaId="cancel"> {intl.formatMessage(messages.cancel)} </Button> </SplitItem> <SplitItem isFilled/> <SplitItem> <Button key='delete' ouiaId="delete" variant='danger' isDisabled={ topic.slug ? false : true } onClick={ () => editTopic({ type: 'DELETE' }) } > {intl.formatMessage(messages.deleteTopic)} </Button> </SplitItem> </Split> ); return <Modal title={intl.formatMessage(messages.topicAdminTitle)} isOpen={isModalOpen} onClose={ () => handleModalToggle(false) } footer={footer} className='modal-width-override' > <Form> <FormGroup label={intl.formatMessage(messages.name)} fieldId='topic-form-name' className='text-input-override' > <TextInput value={name} isRequired type='text' id='topic-form-name' name='topic-form-name' onChange={ (name) => setNameAndSlug(name) } /> </FormGroup> <FormGroup label={intl.formatMessage(messages.topicAddEditDescription)} fieldId='topic-form-description' helperText={intl.formatMessage( messages.topicAddEditDescriptionHelperText )} className='text-area-override' > <TextArea value={description} isRequired name='topic-form-description' id='topic-form-description' onChange={ (desc) => setDescription(desc) } /> </FormGroup> <FormGroup isInline fieldId='topic-form-labels'> <FormGroup label={intl.formatMessage(messages.tag)} fieldId='topic-form-tag' helperText={intl.formatMessage( messages.topicAddEditTagHelperText )} className='text-input-override' > <TextInput value={tag.replace(/\s/g, '').toLowerCase()} isRequired type='text' id='topic-form-tag' name='topic-form-tag' onChange={ (tag) => setTag(tag.replace(/\s/g, '').toLowerCase()) } /> </FormGroup> <FormGroup label={intl.formatMessage(messages.topicSlug)} fieldId='topic-form-name-2' helperText='' className='text-input-override' > <TextInput value={ slug || name.replace(/\s/g, '').toLowerCase()} isDisabled={ topic.slug } type='text' id='topic-form-name-2' name='topic-form-name-2' onChange={ (name) => setNameAndSlug(name) } /> </FormGroup> </FormGroup> <FormGroup label={intl.formatMessage(messages.status)} fieldId='topic-form-enabled' > <Radio isChecked={ !enabled } id='disabled' label={intl.formatMessage(messages.topicAddEditDisabled)} onChange={ () => setEnabled(!enabled) } className='radio-override' /> <Radio isChecked={ enabled } id='enabled' label={intl.formatMessage(messages.topicAddEditEnabled)} onChange={ () => setEnabled(!enabled) } className='radio-override' /> </FormGroup> <FormGroup label={intl.formatMessage(messages.featured)} fieldId='topic-form-featured' > <Checkbox isChecked={ featured } label={intl.formatMessage(messages.topicAddEditFeatureBox)} id='checkbox-featured' name='checkbox-featured' aria-label='update-featured' onChange={ () => setFeatured(!featured) } className='checkbox-override' /> </FormGroup> </Form> </Modal>; }; AddEditTopic.propTypes = { handleModalToggle: PropTypes.func, isModalOpen: PropTypes.bool, topic: PropTypes.object, intl: PropTypes.any, addNotification: PropTypes.func, fetchTopicsAdmin: PropTypes.func }; const mapDispatchToProps = dispatch => ({ addNotification: data => dispatch(addNotification(data)), fetchTopicsAdmin: () => dispatch(fetchTopicsAdmin()) }); export default injectIntl(connect(null, mapDispatchToProps)(AddEditTopic));
39.605505
120
0.508571
28a3d00fd25ffe866bf0a94e9b94fed5cfe8c53b
7,352
js
JavaScript
src/components/legend/attributes.js
Kosm0naut/plotly.js
e858f180bf8d80b35fcbda4f59f3185710a9eba9
[ "MIT" ]
null
null
null
src/components/legend/attributes.js
Kosm0naut/plotly.js
e858f180bf8d80b35fcbda4f59f3185710a9eba9
[ "MIT" ]
3
2021-09-01T00:48:05.000Z
2022-03-02T11:52:14.000Z
src/components/legend/attributes.js
Kosm0naut/plotly.js
e858f180bf8d80b35fcbda4f59f3185710a9eba9
[ "MIT" ]
null
null
null
'use strict'; var fontAttrs = require('../../plots/font_attributes'); var colorAttrs = require('../color/attributes'); module.exports = { bgcolor: { valType: 'color', editType: 'legend', description: [ 'Sets the legend background color.', 'Defaults to `layout.paper_bgcolor`.' ].join(' ') }, bordercolor: { valType: 'color', dflt: colorAttrs.defaultLine, editType: 'legend', description: 'Sets the color of the border enclosing the legend.' }, borderwidth: { valType: 'number', min: 0, dflt: 0, editType: 'legend', description: 'Sets the width (in px) of the border enclosing the legend.' }, font: fontAttrs({ editType: 'legend', description: 'Sets the font used to text the legend items.' }), orientation: { valType: 'enumerated', values: ['v', 'h'], dflt: 'v', editType: 'legend', description: 'Sets the orientation of the legend.' }, traceorder: { valType: 'flaglist', flags: ['reversed', 'grouped'], extras: ['normal'], editType: 'legend', description: [ 'Determines the order at which the legend items are displayed.', 'If *normal*, the items are displayed top-to-bottom in the same', 'order as the input data.', 'If *reversed*, the items are displayed in the opposite order', 'as *normal*.', 'If *grouped*, the items are displayed in groups', '(when a trace `legendgroup` is provided).', 'if *grouped+reversed*, the items are displayed in the opposite order', 'as *grouped*.' ].join(' ') }, tracegroupgap: { valType: 'number', min: 0, dflt: 10, editType: 'legend', description: [ 'Sets the amount of vertical space (in px) between legend groups.' ].join(' ') }, itemsizing: { valType: 'enumerated', values: ['trace', 'constant'], dflt: 'trace', editType: 'legend', description: [ 'Determines if the legend items symbols scale with their corresponding *trace* attributes', 'or remain *constant* independent of the symbol size on the graph.' ].join(' ') }, itemwidth: { valType: 'number', min: 30, dflt: 30, editType: 'legend', description: 'Sets the width (in px) of the legend item symbols (the part other than the title.text).', }, itemclick: { valType: 'enumerated', values: ['toggle', 'toggleothers', false], dflt: 'toggle', editType: 'legend', description: [ 'Determines the behavior on legend item click.', '*toggle* toggles the visibility of the item clicked on the graph.', '*toggleothers* makes the clicked item the sole visible item on the graph.', '*false* disable legend item click interactions.' ].join(' ') }, itemdoubleclick: { valType: 'enumerated', values: ['toggle', 'toggleothers', false], dflt: 'toggleothers', editType: 'legend', description: [ 'Determines the behavior on legend item double-click.', '*toggle* toggles the visibility of the item clicked on the graph.', '*toggleothers* makes the clicked item the sole visible item on the graph.', '*false* disable legend item double-click interactions.' ].join(' ') }, x: { valType: 'number', min: -2, max: 3, editType: 'legend', description: [ 'Sets the x position (in normalized coordinates) of the legend.', 'Defaults to *1.02* for vertical legends and', 'defaults to *0* for horizontal legends.' ].join(' ') }, xanchor: { valType: 'enumerated', values: ['auto', 'left', 'center', 'right'], dflt: 'left', editType: 'legend', description: [ 'Sets the legend\'s horizontal position anchor.', 'This anchor binds the `x` position to the *left*, *center*', 'or *right* of the legend.', 'Value *auto* anchors legends to the right for `x` values greater than or equal to 2/3,', 'anchors legends to the left for `x` values less than or equal to 1/3 and', 'anchors legends with respect to their center otherwise.' ].join(' ') }, y: { valType: 'number', min: -2, max: 3, editType: 'legend', description: [ 'Sets the y position (in normalized coordinates) of the legend.', 'Defaults to *1* for vertical legends,', 'defaults to *-0.1* for horizontal legends on graphs w/o range sliders and', 'defaults to *1.1* for horizontal legends on graph with one or multiple range sliders.' ].join(' ') }, yanchor: { valType: 'enumerated', values: ['auto', 'top', 'middle', 'bottom'], editType: 'legend', description: [ 'Sets the legend\'s vertical position anchor', 'This anchor binds the `y` position to the *top*, *middle*', 'or *bottom* of the legend.', 'Value *auto* anchors legends at their bottom for `y` values less than or equal to 1/3,', 'anchors legends to at their top for `y` values greater than or equal to 2/3 and', 'anchors legends with respect to their middle otherwise.' ].join(' ') }, uirevision: { valType: 'any', editType: 'none', description: [ 'Controls persistence of legend-driven changes in trace and pie label', 'visibility. Defaults to `layout.uirevision`.' ].join(' ') }, valign: { valType: 'enumerated', values: ['top', 'middle', 'bottom'], dflt: 'middle', editType: 'legend', description: [ 'Sets the vertical alignment of the symbols with respect to their associated text.', ].join(' ') }, title: { text: { valType: 'string', dflt: '', editType: 'legend', description: [ 'Sets the title of the legend.' ].join(' ') }, font: fontAttrs({ editType: 'legend', description: [ 'Sets this legend\'s title font.', 'Defaults to `legend.font` with its size increased about 20%.' ].join(' '), }), side: { valType: 'enumerated', values: ['top', 'left', 'top left'], editType: 'legend', description: [ 'Determines the location of legend\'s title', 'with respect to the legend items.', 'Defaulted to *top* with `orientation` is *h*.', 'Defaulted to *left* with `orientation` is *v*.', 'The *top left* options could be used to expand', 'legend area in both x and y sides.' ].join(' ') }, editType: 'legend', }, editType: 'legend' };
34.35514
111
0.531284
28a4199e15c4462582939e907593441cd8e6e034
805
js
JavaScript
src/components/Detail/ChartD.js
EroAuditore/visualcovid
8f482eadfc2ca194ebe27745b9cf34a628f45cb9
[ "FTL", "CECILL-B" ]
null
null
null
src/components/Detail/ChartD.js
EroAuditore/visualcovid
8f482eadfc2ca194ebe27745b9cf34a628f45cb9
[ "FTL", "CECILL-B" ]
null
null
null
src/components/Detail/ChartD.js
EroAuditore/visualcovid
8f482eadfc2ca194ebe27745b9cf34a628f45cb9
[ "FTL", "CECILL-B" ]
null
null
null
import React from 'react'; import { Doughnut } from 'react-chartjs-2'; import PropTypes from 'prop-types'; const ChartD = ({ country }) => { const { confirmed, deaths } = country; if (!confirmed) return <></>; const data = { labels: ['infected', 'Death'], datasets: [ { label: '# infections', data: [confirmed.value, deaths.value], backgroundColor: ['rgba(255, 99, 132, 1)', 'rgba(54, 162, 235, 1)'], borderColor: ['rgba(255, 99, 132, 1)', 'rgba(54, 162, 235, 1)'], borderWidth: 1, }, ], }; return <Doughnut data={data} className="chart" />; }; ChartD.propTypes = { country: PropTypes.shape({ confirmed: PropTypes.instanceOf(Object).isRequired, deaths: PropTypes.isRequired, }).isRequired, }; export default ChartD;
25.967742
76
0.597516
28a4b1fcfc6d810f3b1be73789d3abad72e40461
1,046
js
JavaScript
canvas-app/src/components/pages/Rooms.js
mfasman95/590-project-1
ceb2d4edda05e221e420854f8f1d7a9371accd15
[ "MIT" ]
null
null
null
canvas-app/src/components/pages/Rooms.js
mfasman95/590-project-1
ceb2d4edda05e221e420854f8f1d7a9371accd15
[ "MIT" ]
null
null
null
canvas-app/src/components/pages/Rooms.js
mfasman95/590-project-1
ceb2d4edda05e221e420854f8f1d7a9371accd15
[ "MIT" ]
null
null
null
import React, { Component } from 'react'; import { connect } from 'react-redux'; import { Well, Col } from 'react-bootstrap'; import RoomButton from './../RoomButton'; import CreateRoom from './../CreateRoom'; class Rooms extends Component { render() { const hasRooms = Object.keys(this.props.rooms).length > 0; return ( <Col xs={10} xsOffset={1}> <h1>Welcome <b>{this.props.name}</b></h1> <h2>Create A Room!</h2> <CreateRoom /> <h2>Enter A Room!</h2> <Well className={hasRooms ? 'roomWell' : ''}> { !hasRooms && <h3><b>No Rooms Currently Exist</b></h3> } { hasRooms && Object.keys(this.props.rooms).map((key, i) => <RoomButton room={this.props.rooms[key]} key={i} /> ) } </Well> </Col> ); } } const mapStateToProps = (state, ownProps) => { return { rooms: state.main.rooms, name: state.main.name, } } export default connect(mapStateToProps)(Rooms);
26.15
70
0.544933
28a52f87b4fbee608a8ca7d902d85288f7d02643
2,780
js
JavaScript
src/components/RefControl/FormControl.js
gsjzhbj/iuap_train_example-new
381a348861e8b90b59034d051059dcccb6f11202
[ "MIT" ]
22
2018-06-24T16:20:10.000Z
2021-05-11T02:09:25.000Z
src/components/RefControl/FormControl.js
gsjzhbj/iuap_train_example-new
381a348861e8b90b59034d051059dcccb6f11202
[ "MIT" ]
2
2018-08-05T01:13:56.000Z
2019-05-05T06:15:44.000Z
packages/iuapfe-scaffold-application/src/components/RefControl/FormControl.js
iuap-design/CloudIDE-Frontend
78a2d09b7cc68bcb280a1fb3ba187cbfb1533ec2
[ "MIT" ]
19
2018-06-24T17:12:15.000Z
2022-02-14T06:55:48.000Z
import React, { Component } from 'react'; import classnames from 'classnames'; import Icon from 'bee-icon'; import PropTypes from 'prop-types'; const propTypes = { componentClass: PropTypes.oneOfType([ PropTypes.element, PropTypes.string ]), type: PropTypes.string, size: PropTypes.oneOf(['sm', 'md', 'lg']), onSearch: PropTypes.func, onChange: PropTypes.func }; const defaultProps = { componentClass: 'input', clsPrefix: 'u-form-control', type: 'text', size: 'md' }; class FormControl extends React.Component { constructor(props) { super(props); this.state = { value: props.value == null ? "" : props.value } this.input = {}; } componentWillReceiveProps(nextProp) { if (nextProp.value !== this.state.value) { this.setState({ value: nextProp.value }); } } handleSearchChange = (e) => { const { value } = this.props; //const value = this.input.value; this.input.value = value; } handleInputClick = (e) => { const { onSearch } = this.props; if (onSearch) { onSearch(); } } handleSearchClick = (e) => { const { onSearch } = this.props; if (onSearch) { onSearch(); } } renderSearch = () => { const { componentClass: Component, type, className, size, clsPrefix, value, onChange, onSearch, iconDisabled, ...others } = this.props; // input[type="file"] 不应该有类名 .form-control. let classes = {}; if (size) { classes[`${size}`] = true; } classes[`${clsPrefix}-search`] = true; return ( <div className={classnames(`${clsPrefix}-search`, `${clsPrefix}-affix-wrapper`, className)}> <Component {...others} type={type} ref={(el) => this.input = el} onChange={this.handleSearchChange} onClick={this.handleInputClick} value={value} className={classnames(className, clsPrefix, classes)} /> <div className={`${clsPrefix}-suffix`}> <Icon style={{ padding: 0, color: '#bdbdbd', cursor: 'pointer' }} type="iconfont icon-canzhao" onClick={iconDisabled?()=>{}:this.handleSearchClick} /> </div> </div> ); } render() { return this.renderSearch() } } FormControl.propTypes = propTypes; FormControl.defaultProps = defaultProps; export default FormControl;
25.981308
170
0.509353
28a6163e9b5c889c14e58510328c56515c8a4eb1
1,933
js
JavaScript
javascript/1719.3sum-with-multiplicity.js
Ubastic/lintcode
9f600eece075410221a24859331a810503c76014
[ "MIT" ]
null
null
null
javascript/1719.3sum-with-multiplicity.js
Ubastic/lintcode
9f600eece075410221a24859331a810503c76014
[ "MIT" ]
null
null
null
javascript/1719.3sum-with-multiplicity.js
Ubastic/lintcode
9f600eece075410221a24859331a810503c76014
[ "MIT" ]
1
2020-08-27T11:58:03.000Z
2020-08-27T11:58:03.000Z
/** * @param A: the given integer array * @param target: the given integer target * @return: the number of tuples */ const mod = Math.pow(10,9)+7; const threeSumMulti = function (A, target) { A.sort((a,b)=>a-b); let index1 = 0; let result = 0; while(index1<A.length-2){ let index2 = index1+1; let index3 = A.length-1; const val1 = A[index1]; let curTarget = target-A[index1]; // 计算A[index1]的数量 let count1 = 1; index1++; while(index1<A.length && A[index1] === val1){ index1++; count1++ } while(index2<index3){ const sum = A[index2]+A[index3]; if(sum>curTarget){ index3--; }else if(sum<curTarget){ index2++; }else{ // 计算重复元素的数量 const val2 = A[index2++]; const val3 = A[index3--]; let count2 = 1; let count3 = 1; while(index2<A.length && A[index2] === val2){ count2++; index2++; } // 这里有个-1 考虑这么一个情况,val2和val3紧挨着,经过上面的操作index2指向了第一个val3 while(index3>index2-1 && A[index3] === val3){ index3--; count3++; } // 排列组合 if(val1 === val2 && val2 === val3){ result = (result+cn3(count1))%mod; }else if(val1 === val2){ result = (result + cn2(count1)*count3)%mod; }else if(val2 === val3){ result = (result+count1*cn2(count2))%mod; }else{ result = (result+count1*count2*count3)%mod; } } } } return result; } function cn2(n){ return n*(n-1)/2; } function cn3(n){ return n*(n-1)*(n-2)/6; }
28.014493
71
0.429902
28a653ba213a7dddd2f19cb6069b9121743edb4f
2,672
js
JavaScript
src/mibew/js/source/default/collection_views/base_collection.js
Youthline/mibew
cb177db78af51fe7a53d5a4b720ff6602dac59d0
[ "Apache-2.0" ]
1
2021-12-16T01:02:30.000Z
2021-12-16T01:02:30.000Z
src/mibew/js/source/default/collection_views/base_collection.js
Youthline/mibew
cb177db78af51fe7a53d5a4b720ff6602dac59d0
[ "Apache-2.0" ]
null
null
null
src/mibew/js/source/default/collection_views/base_collection.js
Youthline/mibew
cb177db78af51fe7a53d5a4b720ff6602dac59d0
[ "Apache-2.0" ]
null
null
null
/*! * This file is a part of Mibew Messenger. * * Copyright 2005-2020 the original author or 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. */ (function(Mibew, Backbone, _){ /** * Return special contructor for an item view if it exists or the * default constructor otherwise. Use in Mibew.Views.CollectionBase and * Mibew.Views.CompositeBase * @private * @param {Backbone.Model} item Collection item * @param {Function} ChildViewType Default item view constructor * @param {Object} childViewOptions Additional item view options * @returns Item view instance */ var buildChildView = function(item, ChildViewType, childViewOptions) { // Build options object var options = _.extend({model: item}, childViewOptions); // Try to find special view for this model if (typeof item.getModelType != 'function') { return new ChildViewType(options); } var modelType = item.getModelType(); if (modelType && Mibew.Views[modelType]) { return new Mibew.Views[modelType](options); } else { return new ChildViewType(options); } }; /** * @class Represents base collection view */ Mibew.Views.CollectionBase = Backbone.Marionette.CollectionView.extend( /** @lends Mibew.Views.CollectionBase.prototype */ { /** * Default item view constructor. * @type Function */ childView: Backbone.Marionette.ItemView, /** * Return special contructor for an item view if it exists or the * default constructor otherwise. */ buildChildView: buildChildView } ); Mibew.Views.CompositeBase = Backbone.Marionette.CompositeView.extend( /** @lends Mibew.Views.CompositeBase.prototype */ { /** * Return special contructor for an item view if it exists or the * default constructor otherwise. */ buildChildView: buildChildView } ); })(Mibew, Backbone, _);
34.701299
77
0.629117
28a6941ee65cbb7282542eeb0733f771f28a6d3c
1,449
js
JavaScript
client/v1/feeds/user-media.js
AOTOA/instagram-private-api
29d6f8ac2818f958ba583037bd20f5996adcca96
[ "MIT" ]
6
2020-04-22T17:22:35.000Z
2021-11-15T10:39:48.000Z
client/v1/feeds/user-media.js
linkfy/instagram-private-api
d49355f09663781d9b2564cf42726dfb68f6baf3
[ "MIT" ]
null
null
null
client/v1/feeds/user-media.js
linkfy/instagram-private-api
d49355f09663781d9b2564cf42726dfb68f6baf3
[ "MIT" ]
1
2020-06-28T15:52:47.000Z
2020-06-28T15:52:47.000Z
var _ = require('underscore'); var util = require('util'); var FeedBase = require('./feed-base'); function UserMediaFeed(session, accountId, limit) { this.accountId = accountId; this.timeout = 10 * 60 * 1000; // 10 minutes this.limit = limit; FeedBase.apply(this, arguments); } util.inherits(UserMediaFeed, FeedBase); module.exports = UserMediaFeed; var Media = require('../media'); var Request = require('../request'); var Helpers = require('../../../helpers'); var Account = require('../account'); UserMediaFeed.prototype.get = function () { var that = this; return this.session.getAccountId() .then(function(id) { var rankToken = Helpers.buildRankToken(id); return new Request(that.session) .setMethod('GET') .setResource('userFeed', { id: that.accountId, maxId: that.getCursor(), rankToken: rankToken }) .send() .then(function(data) { that.moreAvailable = data.more_available; var lastOne = _.last(data.items); if (that.moreAvailable && lastOne) that.setCursor(lastOne.id); return _.map(data.items, function (medium) { return new Media(that.session, medium); }); }) }); };
32.931818
64
0.531401
28a717f06b2fb58aa1975057ee2968a5330b8637
4,397
js
JavaScript
mobile/_maskUtils.js
vansimke/dojox
082aa526ad413807ec1db816efb6f42bffacc496
[ "AFL-2.1" ]
2
2015-09-15T03:38:45.000Z
2020-08-03T03:21:10.000Z
mobile/_maskUtils.js
vansimke/dojox
082aa526ad413807ec1db816efb6f42bffacc496
[ "AFL-2.1" ]
7
2020-03-10T18:14:30.000Z
2022-03-25T18:53:36.000Z
node_modules/dojox/mobile/_maskUtils.js
Julboteroc/csmb
90991f64ed86a018a40910a83df00585e8e70ee5
[ "Artistic-2.0" ]
1
2020-05-31T20:41:09.000Z
2020-05-31T20:41:09.000Z
define([ "dojo/_base/window", "dojo/dom-style", "./sniff" ], function(win, domStyle, has){ has.add("mask-image-css", function(global, doc, elt){ return typeof doc.getCSSCanvasContext === "function" && typeof elt.style.webkitMaskImage !== "undefined"; }); // Indicates whether image mask is available (either via css mask image or svg) has.add("mask-image", function(){ return has("mask-image-css") || has("svg"); }); var cache = {}; return { // summary: // Utility methods to clip rounded corners of various elements (Switch, ScrollablePane, scrollbars in scrollable widgets). // Uses -webkit-mask-image on webkit, or SVG on other browsers. createRoundMask: function(/*DomNode*/node, x, y, r, b, w, h, rx, ry, e){ // summary: // Creates and sets a mask for the specified node. var tw = x + w + r; var th = y + h + b; if(has("mask-image-css")){ // use -webkit-mask-image var id = ("DojoMobileMask" + x + y + w + h + rx + ry).replace(/\./g, "_"); if (!cache[id]) { cache[id] = 1; var ctx = win.doc.getCSSCanvasContext("2d", id, tw, th); ctx.beginPath(); if (rx == ry) { // round arc if(rx == 2 && w == 5){ // optimized case for vertical scrollbar ctx.fillStyle = "rgba(0,0,0,0.5)"; ctx.fillRect(1, 0, 3, 2); ctx.fillRect(0, 1, 5, 1); ctx.fillRect(0, h - 2, 5, 1); ctx.fillRect(1, h - 1, 3, 2); ctx.fillStyle = "rgb(0,0,0)"; ctx.fillRect(0, 2, 5, h - 4); }else if(rx == 2 && h == 5){ // optimized case for horizontal scrollbar ctx.fillStyle = "rgba(0,0,0,0.5)"; ctx.fillRect(0, 1, 2, 3); ctx.fillRect(1, 0, 1, 5); ctx.fillRect(w - 2, 0, 1, 5); ctx.fillRect(w - 1, 1, 2, 3); ctx.fillStyle = "rgb(0,0,0)"; ctx.fillRect(2, 0, w - 4, 5); }else{ // general case ctx.fillStyle = "#000000"; ctx.moveTo(x+rx, y); ctx.arcTo(x, y, x, y+rx, rx); ctx.lineTo(x, y+h - rx); ctx.arcTo(x, y+h, x+rx, y+h, rx); ctx.lineTo(x+w - rx, y+h); ctx.arcTo(x+w, y+h, x+w, y+rx, rx); ctx.lineTo(x+w, y+rx); ctx.arcTo(x+w, y, x+w - rx, y, rx); } } else { // elliptical arc var pi = Math.PI; ctx.scale(1, ry / rx); ctx.moveTo(x+rx, y); ctx.arc(x+rx, y+rx, rx, 1.5 * pi, 0.5 * pi, true); ctx.lineTo(x+w - rx, y+2 * rx); ctx.arc(x+w - rx, y+rx, rx, 0.5 * pi, 1.5 * pi, true); } ctx.closePath(); ctx.fill(); } node.style.webkitMaskImage = "-webkit-canvas(" + id + ")"; }else if(has("svg")){ // add an SVG image to clip the corners. if(node._svgMask){ node.removeChild(node._svgMask); } var bg = null; for(var p = node.parentNode; p; p = p.parentNode){ bg = domStyle.getComputedStyle(p).backgroundColor; if(bg && bg != "transparent" && !bg.match(/rgba\(.*,\s*0\s*\)/)){ break; } } var svgNS = "http://www.w3.org/2000/svg"; var svg = win.doc.createElementNS(svgNS, "svg"); svg.setAttribute("width", tw); svg.setAttribute("height", th); svg.style.position = "absolute"; svg.style.pointerEvents = "none"; svg.style.opacity = "1"; svg.style.zIndex = "2147483647"; // max int var path = win.doc.createElementNS(svgNS, "path"); e = e || 0; rx += e; ry += e; // TODO: optimized cases for scrollbars as in webkit case? var d = " M" + (x + rx - e) + "," + (y - e) + " a" + rx + "," + ry + " 0 0,0 " + (-rx) + "," + ry + " v" + (-ry) + " h" + rx + " Z" + " M" + (x - e) + "," + (y + h - ry + e) + " a" + rx + "," + ry + " 0 0,0 " + rx + "," + ry + " h" + (-rx) + " v" + (-ry) + " z" + " M" + (x + w - rx + e) + "," + (y + h + e) + " a" + rx + "," + ry + " 0 0,0 " + rx + "," + (-ry) + " v" + ry + " h" + (-rx) + " z" + " M" + (x + w + e) + "," + (y + ry - e) + " a" + rx + "," + ry + " 0 0,0 " + (-rx) + "," + (-ry) + " h" + rx + " v" + ry + " z"; if(y > 0){ d += " M0,0 h" + tw + " v" + y + " h" + (-tw) + " z"; } if(b > 0){ d += " M0," + (y + h) + " h" + tw + " v" + b + " h" + (-tw) + " z"; } path.setAttribute("d", d); path.setAttribute("fill", bg); path.setAttribute("stroke", bg); path.style.opacity = "1"; svg.appendChild(path); node._svgMask = svg; node.appendChild(svg); } } }; });
34.896825
139
0.489652
28a84327ac425d5120812d60894f80260bcab4ab
16,757
js
JavaScript
src/common.js
OnamOfficial/BitGoJS
b02baf1d8e783e115f48380e9904b9ecc168ea0b
[ "Apache-2.0" ]
null
null
null
src/common.js
OnamOfficial/BitGoJS
b02baf1d8e783e115f48380e9904b9ecc168ea0b
[ "Apache-2.0" ]
6
2019-10-12T15:49:36.000Z
2022-02-26T15:01:29.000Z
src/common.js
OnamOfficial/BitGoJS
b02baf1d8e783e115f48380e9904b9ecc168ea0b
[ "Apache-2.0" ]
1
2021-03-31T20:20:38.000Z
2021-03-31T20:20:38.000Z
const bitcoin = require('bitgo-utxo-lib'); const _ = require('lodash'); exports.Environments = { prod: { uri: 'https://www.bitgo.com', networks: { btc: bitcoin.networks.bitcoin }, network: 'bitcoin', ethNetwork: 'ethereum', rmgNetwork: 'rmg', signingAddress: '1BitGo3gxRZ6mQSEH52dvCKSUgVCAH4Rja', serverXpub: 'xpub661MyMwAqRbcEtUgu9HF8ai4ipuVKKHBzUqks4jSFypW8dwwQL1zygLgQx99NmC7zJJznSiwKG6RQfVjAKMtCsx8VjR6kQW8x7HrkXFZdnQ', smartBitApiBaseUrl: 'https://api.smartbit.com.au/v1', bchExplorerBaseUrl: 'https://blockdozer.com/insight-api', btgExplorerBaseUrl: 'https://btgexplorer.com/api', etherscanBaseUrl: 'https://api.etherscan.io', ltcExplorerBaseUrl: 'https://insight.litecore.io/api', zecExplorerBaseUrl: 'https://zcash.blockexplorer.com/api', dashExplorerBaseUrl: 'https://insight.dash.org/insight-api', stellarFederationServerUrl: 'https://www.bitgo.com/api/v2/xlm/federation' }, rmgProd: { uri: 'https://rmg.bitgo.com', networks: { btc: bitcoin.networks.bitcoin }, network: 'bitcoin', ethNetwork: 'ethereum', rmgNetwork: 'rmg', signingAddress: '1BitGo3gxRZ6mQSEH52dvCKSUgVCAH4Rja', serverXpub: 'xpub661MyMwAqRbcEtUgu9HF8ai4ipuVKKHBzUqks4jSFypW8dwwQL1zygLgQx99NmC7zJJznSiwKG6RQfVjAKMtCsx8VjR6kQW8x7HrkXFZdnQ', smartBitApiBaseUrl: 'https://api.smartbit.com.au/v1', bchExplorerBaseUrl: 'https://blockdozer.com/insight-api', btgExplorerBaseUrl: 'https://btgexplorer.com/api', etherscanBaseUrl: 'https://api.etherscan.io', ltcExplorerBaseUrl: 'https://insight.litecore.io/api', zecExplorerBaseUrl: 'https://zcash.blockexplorer.com/api', dashExplorerBaseUrl: 'https://insight.dash.org/insight-api', stellarFederationServerUrl: 'https://rmg.bitgo.com/api/v2/xlm/federation' }, staging: { uri: 'https://staging.bitgo.com', networks: { btc: bitcoin.networks.bitcoin }, network: 'bitcoin', ethNetwork: 'ethereum', rmgNetwork: 'rmg', signingAddress: '1BitGo3gxRZ6mQSEH52dvCKSUgVCAH4Rja', serverXpub: 'xpub661MyMwAqRbcEtUgu9HF8ai4ipuVKKHBzUqks4jSFypW8dwwQL1zygLgQx99NmC7zJJznSiwKG6RQfVjAKMtCsx8VjR6kQW8x7HrkXFZdnQ', smartBitApiBaseUrl: 'https://api.smartbit.com.au/v1', bchExplorerBaseUrl: 'https://blockdozer.com/insight-api', btgExplorerBaseUrl: 'https://btgexplorer.com/api', etherscanBaseUrl: 'https://api.etherscan.io', ltcExplorerBaseUrl: 'https://insight.litecore.io/api', zecExplorerBaseUrl: 'https://zcash.blockexplorer.com/api', dashExplorerBaseUrl: 'https://insight.dash.org/insight-api', stellarFederationServerUrl: 'https://staging.bitgo.com/api/v2/xlm/federation' }, rmgStaging: { uri: 'https://rmgstaging.bitgo.com', networks: { btc: bitcoin.networks.bitcoin }, network: 'bitcoin', ethNetwork: 'ethereum', rmgNetwork: 'rmg', signingAddress: '1BitGo3gxRZ6mQSEH52dvCKSUgVCAH4Rja', serverXpub: 'xpub661MyMwAqRbcEtUgu9HF8ai4ipuVKKHBzUqks4jSFypW8dwwQL1zygLgQx99NmC7zJJznSiwKG6RQfVjAKMtCsx8VjR6kQW8x7HrkXFZdnQ', smartBitApiBaseUrl: 'https://api.smartbit.com.au/v1', bchExplorerBaseUrl: 'https://blockdozer.com/insight-api', btgExplorerBaseUrl: 'https://btgexplorer.com/api', etherscanBaseUrl: 'https://api.etherscan.io', ltcExplorerBaseUrl: 'https://insight.litecore.io/api', zecExplorerBaseUrl: 'https://zcash.blockexplorer.com/api', dashExplorerBaseUrl: 'https://insight.dash.org/insight-api', stellarFederationServerUrl: 'https://rmgstaging.bitgo.com/api/v2/xlm/federation' }, test: { uri: 'https://test.bitgo.com', networks: { tbtc: bitcoin.networks.testnet }, network: 'testnet', ethNetwork: 'ethereum', rmgNetwork: 'rmgTest', signingAddress: 'msignBdFXteehDEgB6DNm7npRt7AcEZJP3', serverXpub: 'xpub661MyMwAqRbcErFqVXGiUFv9YeoPbhN72UiNCUdj9nj3T6M8h7iKNmbCYpMVWVZP7LA2ma3HWcPngz1gRTm4FPdtm9mHfrNvU93MCoszsGL', smartBitApiBaseUrl: 'https://testnet-api.smartbit.com.au/v1', bchExplorerBaseUrl: 'https://test-bch-insight.bitpay.com/api', etherscanBaseUrl: 'https://kovan.etherscan.io', ltcExplorerBaseUrl: 'http://explorer.litecointools.com/api', zecExplorerBaseUrl: 'https://explorer.testnet.z.cash/api', dashExplorerBaseUrl: 'https://testnet-insight.dashevo.org/insight-api', stellarFederationServerUrl: 'https://test.bitgo.com/api/v2/txlm/federation' }, rmgTest: { uri: 'https://rmgtest.bitgo.com', networks: { tbtc: bitcoin.networks.testnet }, network: 'testnet', ethNetwork: 'ethereum', rmgNetwork: 'rmgTest', signingAddress: 'msignBdFXteehDEgB6DNm7npRt7AcEZJP3', serverXpub: 'xpub661MyMwAqRbcErFqVXGiUFv9YeoPbhN72UiNCUdj9nj3T6M8h7iKNmbCYpMVWVZP7LA2ma3HWcPngz1gRTm4FPdtm9mHfrNvU93MCoszsGL', smartBitApiBaseUrl: 'https://testnet-api.smartbit.com.au/v1', bchExplorerBaseUrl: 'https://test-bch-insight.bitpay.com/api', etherscanBaseUrl: 'https://kovan.etherscan.io', ltcExplorerBaseUrl: 'http://explorer.litecointools.com/api', zecExplorerBaseUrl: 'https://explorer.testnet.z.cash/api', dashExplorerBaseUrl: 'https://testnet-insight.dashevo.org/insight-api', stellarFederationServerUrl: 'https://rmgtest.bitgo.com/api/v2/txlm/federation' }, dev: { uri: 'https://webdev.bitgo.com', networks: { tbtc: bitcoin.networks.testnet }, network: 'testnet', ethNetwork: 'ethereum', rmgNetwork: 'rmgTest', signingAddress: 'msignBdFXteehDEgB6DNm7npRt7AcEZJP3', serverXpub: 'xpub661MyMwAqRbcErFqVXGiUFv9YeoPbhN72UiNCUdj9nj3T6M8h7iKNmbCYpMVWVZP7LA2ma3HWcPngz1gRTm4FPdtm9mHfrNvU93MCoszsGL', smartBitApiBaseUrl: 'https://testnet-api.smartbit.com.au/v1', bchExplorerBaseUrl: 'https://test-bch-insight.bitpay.com/api', etherscanBaseUrl: 'https://kovan.etherscan.io', ltcExplorerBaseUrl: 'http://explorer.litecointools.com/api', zecExplorerBaseUrl: 'https://explorer.testnet.z.cash/api', dashExplorerBaseUrl: 'https://testnet-insight.dashevo.org/insight-api', stellarFederationServerUrl: 'https://webdev.bitgo.com/api/v2/txlm/federation' }, latest: { uri: 'https://latest.bitgo.com', networks: { tbtc: bitcoin.networks.testnet }, network: 'testnet', ethNetwork: 'ethereum', rmgNetwork: 'rmgTest', signingAddress: 'msignBdFXteehDEgB6DNm7npRt7AcEZJP3', serverXpub: 'xpub661MyMwAqRbcErFqVXGiUFv9YeoPbhN72UiNCUdj9nj3T6M8h7iKNmbCYpMVWVZP7LA2ma3HWcPngz1gRTm4FPdtm9mHfrNvU93MCoszsGL', smartBitApiBaseUrl: 'https://testnet-api.smartbit.com.au/v1', bchExplorerBaseUrl: 'https://test-bch-insight.bitpay.com/api', etherscanBaseUrl: 'https://kovan.etherscan.io', ltcExplorerBaseUrl: 'http://explorer.litecointools.com/api', zecExplorerBaseUrl: 'https://explorer.testnet.z.cash/api', dashExplorerBaseUrl: 'https://testnet-insight.dashevo.org/insight-api', stellarFederationServerUrl: 'https://latest.bitgo.com/api/v2/txlm/federation' }, rmgLatest: { uri: 'https://rmglatest.bitgo.com', networks: { tbtc: bitcoin.networks.testnet }, network: 'testnet', ethNetwork: 'ethereum', rmgNetwork: 'rmgTest', signingAddress: 'msignBdFXteehDEgB6DNm7npRt7AcEZJP3', serverXpub: 'xpub661MyMwAqRbcErFqVXGiUFv9YeoPbhN72UiNCUdj9nj3T6M8h7iKNmbCYpMVWVZP7LA2ma3HWcPngz1gRTm4FPdtm9mHfrNvU93MCoszsGL', smartBitApiBaseUrl: 'https://testnet-api.smartbit.com.au/v1', bchExplorerBaseUrl: 'https://test-bch-insight.bitpay.com/api', etherscanBaseUrl: 'https://kovan.etherscan.io', ltcExplorerBaseUrl: 'http://explorer.litecointools.com/api', zecExplorerBaseUrl: 'https://explorer.testnet.z.cash/api', dashExplorerBaseUrl: 'https://testnet-insight.dashevo.org/insight-api', stellarFederationServerUrl: 'https://rmglatest.bitgo.com/api/v2/txlm/federation' }, rmgDev: { uri: 'https://rmgwebdev.bitgo.com', networks: { tbtc: bitcoin.networks.testnet }, network: 'testnet', ethNetwork: 'ethereum', rmgNetwork: 'rmgTest', signingAddress: 'msignBdFXteehDEgB6DNm7npRt7AcEZJP3', serverXpub: 'xpub661MyMwAqRbcErFqVXGiUFv9YeoPbhN72UiNCUdj9nj3T6M8h7iKNmbCYpMVWVZP7LA2ma3HWcPngz1gRTm4FPdtm9mHfrNvU93MCoszsGL', smartBitApiBaseUrl: 'https://testnet-api.smartbit.com.au/v1', bchExplorerBaseUrl: 'https://test-bch-insight.bitpay.com/api', etherscanBaseUrl: 'https://kovan.etherscan.io', ltcExplorerBaseUrl: 'http://explorer.litecointools.com/api', zecExplorerBaseUrl: 'https://explorer.testnet.z.cash/api', dashExplorerBaseUrl: 'https://testnet-insight.dashevo.org/insight-api', stellarFederationServerUrl: 'https://rmgwebdev.bitgo.com/api/v2/txlm/federation' }, local: { uri: 'https://localhost:3000', networks: { tbtc: bitcoin.networks.testnet }, network: 'testnet', ethNetwork: 'ethereum', rmgNetwork: 'rmgTest', signingAddress: 'msignBdFXteehDEgB6DNm7npRt7AcEZJP3', serverXpub: 'xpub661MyMwAqRbcErFqVXGiUFv9YeoPbhN72UiNCUdj9nj3T6M8h7iKNmbCYpMVWVZP7LA2ma3HWcPngz1gRTm4FPdtm9mHfrNvU93MCoszsGL', smartBitApiBaseUrl: 'https://testnet-api.smartbit.com.au/v1', bchExplorerBaseUrl: 'https://test-bch-insight.bitpay.com/api', etherscanBaseUrl: 'https://kovan.etherscan.io', ltcExplorerBaseUrl: 'http://explorer.litecointools.com/api', zecExplorerBaseUrl: 'https://explorer.testnet.z.cash/api', stellarFederationServerUrl: 'https://localhost:3000/api/v2/txlm/federation' }, localNonSecure: { uri: 'http://localhost:3000', networks: { tbtc: bitcoin.networks.testnet }, network: 'testnet', ethNetwork: 'ethereum', rmgNetwork: 'rmgTest', signingAddress: 'msignBdFXteehDEgB6DNm7npRt7AcEZJP3', serverXpub: 'xpub661MyMwAqRbcErFqVXGiUFv9YeoPbhN72UiNCUdj9nj3T6M8h7iKNmbCYpMVWVZP7LA2ma3HWcPngz1gRTm4FPdtm9mHfrNvU93MCoszsGL', smartBitApiBaseUrl: 'https://testnet-api.smartbit.com.au/v1', bchExplorerBaseUrl: 'https://test-bch-insight.bitpay.com/api', etherscanBaseUrl: 'https://kovan.etherscan.io', ltcExplorerBaseUrl: 'http://explorer.litecointools.com/api', zecExplorerBaseUrl: 'https://explorer.testnet.z.cash/api', dashExplorerBaseUrl: 'https://testnet-insight.dashevo.org/insight-api', stellarFederationServerUrl: 'http://localhost:3000/api/v2/txlm/federation' }, mock: { uri: 'https://bitgo.fakeurl', networks: { tbtc: bitcoin.networks.testnet }, network: 'testnet', ethNetwork: 'ethereum', rmgNetwork: 'rmgTest', signingAddress: 'msignBdFXteehDEgB6DNm7npRt7AcEZJP3', serverXpub: 'xpub661MyMwAqRbcErFqVXGiUFv9YeoPbhN72UiNCUdj9nj3T6M8h7iKNmbCYpMVWVZP7LA2ma3HWcPngz1gRTm4FPdtm9mHfrNvU93MCoszsGL', smartBitApiBaseUrl: 'https://testnet-api.smartbit.fakeurl/v1', bchExplorerBaseUrl: 'https://test-bch-insight.bitpay.fakeurl/api', etherscanBaseUrl: 'https://kovan.etherscan.io', ltcExplorerBaseUrl: 'http://explorer.litecointools.com/api', zecExplorerBaseUrl: 'https://explorer.testnet.z.cash/api', dashExplorerBaseUrl: 'https://testnet-insight.dashevo.org/insight-api', stellarFederationServerUrl: 'https://bitgo.fakeurl/api/v2/txlm/federation' }, rmgLocal: { uri: 'https://rmglocalhost:3000', networks: { tbtc: bitcoin.networks.testnet }, network: 'testnet', ethNetwork: 'ethereum', rmgNetwork: 'rmgTest', signingAddress: 'msignBdFXteehDEgB6DNm7npRt7AcEZJP3', serverXpub: 'xpub661MyMwAqRbcErFqVXGiUFv9YeoPbhN72UiNCUdj9nj3T6M8h7iKNmbCYpMVWVZP7LA2ma3HWcPngz1gRTm4FPdtm9mHfrNvU93MCoszsGL', smartBitApiBaseUrl: 'https://testnet-api.smartbit.com.au/v1', bchExplorerBaseUrl: 'https://test-bch-insight.bitpay.com/api', etherscanBaseUrl: 'https://kovan.etherscan.io', ltcExplorerBaseUrl: 'http://explorer.litecointools.com/api', zecExplorerBaseUrl: 'https://explorer.testnet.z.cash/api', stellarFederationServerUrl: 'https://rmglocalhost:3000/api/v2/txlm/federation' }, rmglocalNonSecure: { uri: 'http://rmglocalhost:3000', networks: { tbtc: bitcoin.networks.testnet }, network: 'testnet', ethNetwork: 'ethereum', rmgNetwork: 'rmgTest', signingAddress: 'msignBdFXteehDEgB6DNm7npRt7AcEZJP3', serverXpub: 'xpub661MyMwAqRbcErFqVXGiUFv9YeoPbhN72UiNCUdj9nj3T6M8h7iKNmbCYpMVWVZP7LA2ma3HWcPngz1gRTm4FPdtm9mHfrNvU93MCoszsGL', smartBitApiBaseUrl: 'https://testnet-api.smartbit.com.au/v1', bchExplorerBaseUrl: 'https://test-bch-insight.bitpay.com/api', etherscanBaseUrl: 'https://kovan.etherscan.io', ltcExplorerBaseUrl: 'http://explorer.litecointools.com/api', zecExplorerBaseUrl: 'https://explorer.testnet.z.cash/api', dashExplorerBaseUrl: 'https://testnet-insight.dashevo.org/insight-api', stellarFederationServerUrl: 'http://rmglocalhost:3000/api/v2/txlm/federation' }, custom: { uri: process.env.BITGO_CUSTOM_ROOT_URI, networks: { btc: bitcoin.networks.bitcoin, tbtc: bitcoin.networks.testnet }, network: process.env.BITGO_CUSTOM_BITCOIN_NETWORK || 'bitcoin', ethNetwork: process.env.BITGO_CUSTOM_ETHEREUM_NETWORK || 'ethereum', rmgNetwork: process.env.BITGO_CUSTOM_RMG_NETWORK || 'rmg', signingAddress: '1BitGo3gxRZ6mQSEH52dvCKSUgVCAH4Rja', serverXpub: 'xpub661MyMwAqRbcEtUgu9HF8ai4ipuVKKHBzUqks4jSFypW8dwwQL1zygLgQx99NmC7zJJznSiwKG6RQfVjAKMtCsx8VjR6kQW8x7HrkXFZdnQ', smartBitApiBaseUrl: 'https://' + (process.env.BITGO_CUSTOM_BITCOIN_NETWORK !== 'bitcoin' ? 'testnet-api' : 'api') + '.smartbit.com.au/v1', bchExplorerBaseUrl: process.env.BITGO_CUSTOM_BITCOIN_NETWORK !== 'bitcoin' ? 'https://test-bch-insight.bitpay.com/api' : 'https://blockdozer.com/insight-api', btgExplorerBaseUrl: process.env.BITGO_CUSTOM_BITCOIN_NETWORK !== 'bitcoin' ? null : 'https://btgexplorer.com/api', ltcExplorerBaseUrl: process.env.BITGO_CUSTOM_LITECOIN_NETWORK !== 'litecoin' ? 'http://explorer.litecointools.com/api' : 'https://insight.litecore.io/api', etherscanBaseUrl: process.env.BITGO_CUSTOM_ETHEREUM_NETWORK !== 'ethereum' ? 'https://kovan.etherscan.io' : 'https://api.etherscan.io', zecExplorerBaseUrl: process.env.BITGO_CUSTOM_ZCASH_NETWORK !== 'zcash' ? 'https://explorer.testnet.z.cash/api' : 'https://zcash.blockexplorer.com/api', dashExplorerBaseUrl: process.env.BITGO_CUSTOM_DASH_NETWORK !== 'dash' ? 'https://testnet-insight.dashevo.org/insight-api' : 'https://insight.dash.org/insight-api', stellarFederationServerUrl: process.env.BITGO_CUSTOM_STELLAR_NETWORK !== 'stellar' ? `https://${process.env.BITGO_CUSTOM_ROOT_URI}/api/v2/txlm/federation` : `https://${process.env.BITGO_CUSTOM_ROOT_URI}/api/v2/xlm/federation` } }; let bitcoinNetwork; let ethereumNetwork; let rmgNetwork; exports.setNetwork = function(network) { if (network === 'bitcoin') { bitcoinNetwork = 'bitcoin'; } else { // test network bitcoinNetwork = 'testnet'; } }; exports.getNetwork = function() { return bitcoinNetwork; }; exports.getRmgNetwork = function() { return rmgNetwork; }; exports.setRmgNetwork = function(network) { rmgNetwork = network; }; exports.setEthNetwork = function(network) { ethereumNetwork = 'ethereum'; }; exports.getEthNetwork = function() { return ethereumNetwork; }; /** * Helper function to validate the input parameters to an SDK method. * Only validates for strings - if parameter is different, check that manually * * @param params {Object} dictionary of parameter key-value pairs * @param expectedParams {string[]} list of expected string parameters * @param optionalParams {string[]} list of optional string parameters * @param optionalCallback {Function} if callback provided, must be a function * @returns {boolean} true if validated, throws with reason otherwise */ exports.validateParams = function(params, expectedParams, optionalParams, optionalCallback) { if (!_.isObject(params)) { throw new Error('Must pass in parameters dictionary'); } expectedParams = expectedParams || []; expectedParams.forEach(function(expectedParam) { if (!params[expectedParam]) { throw new Error('Missing parameter: ' + expectedParam); } if (!_.isString(params[expectedParam])) { throw new Error('Expecting parameter string: ' + expectedParam + ' but found ' + typeof(params[expectedParam])); } }); optionalParams = optionalParams || []; optionalParams.forEach(function(optionalParam) { if (params[optionalParam] && !_.isString(params[optionalParam])) { throw new Error('Expecting parameter string: ' + optionalParam + ' but found ' + typeof(params[optionalParam])); } }); if (optionalCallback && !_.isFunction(optionalCallback)) { throw new Error('illegal callback argument'); } return true; };
44.924933
167
0.735633
28a9f6a0e04e9340add82211694b5c643ed7589f
1,078
js
JavaScript
Userland/Libraries/LibJS/Tests/builtins/Temporal/Instant/Instant.prototype.epochNanoseconds.js
squeek502/serenity
c54ae3afd67a991287731f56a28c96e07da8b2dc
[ "BSD-2-Clause" ]
2
2020-05-18T18:17:49.000Z
2021-06-11T13:58:54.000Z
Userland/Libraries/LibJS/Tests/builtins/Temporal/Instant/Instant.prototype.epochNanoseconds.js
squeek502/serenity
c54ae3afd67a991287731f56a28c96e07da8b2dc
[ "BSD-2-Clause" ]
null
null
null
Userland/Libraries/LibJS/Tests/builtins/Temporal/Instant/Instant.prototype.epochNanoseconds.js
squeek502/serenity
c54ae3afd67a991287731f56a28c96e07da8b2dc
[ "BSD-2-Clause" ]
1
2021-06-05T16:58:05.000Z
2021-06-05T16:58:05.000Z
describe("correct behavior", () => { test("basic functionality", () => { expect(new Temporal.Instant(0n).epochNanoseconds).toBe(0n); expect(new Temporal.Instant(1n).epochNanoseconds).toBe(1n); expect(new Temporal.Instant(999n).epochNanoseconds).toBe(999n); expect(new Temporal.Instant(8_640_000_000_000_000_000_000n).epochNanoseconds).toBe( 8_640_000_000_000_000_000_000n ); expect(new Temporal.Instant(-0n).epochNanoseconds).toBe(-0n); expect(new Temporal.Instant(-1n).epochNanoseconds).toBe(-1n); expect(new Temporal.Instant(-999n).epochNanoseconds).toBe(-999n); expect(new Temporal.Instant(-8_640_000_000_000_000_000_000n).epochNanoseconds).toBe( -8_640_000_000_000_000_000_000n ); }); }); test("errors", () => { test("this value must be a Temporal.Instant object", () => { expect(() => { Reflect.get(Temporal.Instant.prototype, "epochNanoseconds", "foo"); }).toThrowWithMessage(TypeError, "Not a Temporal.Instant"); }); });
41.461538
92
0.653989
28aa4df77e9db756fd7d25fff1b96571122010b4
17,613
js
JavaScript
website/static/js/jquery.keypad.min.js
SimonGreenhill/Language5
c59f502dda7be27fc338f0338cc3b03e63bad9c8
[ "MIT" ]
1
2020-08-17T05:56:16.000Z
2020-08-17T05:56:16.000Z
website/static/js/jquery.keypad.min.js
SimonGreenhill/Language5
c59f502dda7be27fc338f0338cc3b03e63bad9c8
[ "MIT" ]
5
2020-06-05T17:51:56.000Z
2022-01-13T00:42:51.000Z
website/static/js/jquery.keypad.min.js
SimonGreenhill/Language5
c59f502dda7be27fc338f0338cc3b03e63bad9c8
[ "MIT" ]
1
2015-02-23T22:54:00.000Z
2015-02-23T22:54:00.000Z
/* http://keith-wood.name/keypad.html Keypad field entry extension for jQuery v1.5.0. Written by Keith Wood (kbwood{at}iinet.com.au) August 2008. Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses. Please attribute the author if you use it. */ (function($){function Keypad(){this._curInst=null;this._disabledFields=[];this._keypadShowing=false;this._keyCode=0;this._specialKeys=[];this.addKeyDef('CLOSE','close',function(a){l._curInst=(a._inline?a:l._curInst);l._hidePlugin()});this.addKeyDef('CLEAR','clear',function(a){l._clearValue(a)});this.addKeyDef('BACK','back',function(a){l._backValue(a)});this.addKeyDef('SHIFT','shift',function(a){l._shiftKeypad(a)});this.addKeyDef('SPACE_BAR','spacebar',function(a){l._selectValue(a,' ')},true);this.addKeyDef('SPACE','space');this.addKeyDef('HALF_SPACE','half-space');this.addKeyDef('ENTER','enter',function(a){l._selectValue(a,'\x0D')},true);this.addKeyDef('TAB','tab',function(a){l._selectValue(a,'\x09')},true);this.qwertyAlphabetic=['qwertyuiop','asdfghjkl','zxcvbnm'];this.qwertyLayout=['!@#$%^&*()_='+this.HALF_SPACE+this.SPACE+this.CLOSE,this.HALF_SPACE+'`~[]{}<>\\|/'+this.SPACE+'789','qwertyuiop\'"'+this.HALF_SPACE+'456',this.HALF_SPACE+'asdfghjkl;:'+this.SPACE+'123',this.SPACE+'zxcvbnm,.?'+this.SPACE+this.HALF_SPACE+'-0+',''+this.TAB+this.ENTER+this.SPACE_BAR+this.SHIFT+this.HALF_SPACE+this.BACK+this.CLEAR];this.regional=[];this.regional['']={buttonText:'...',buttonStatus:'Open the keypad',closeText:'Close',closeStatus:'Close the keypad',clearText:'Clear',clearStatus:'Erase all the text',backText:'Back',backStatus:'Erase the previous character',spacebarText:'&nbsp;',spacebarStatus:'Space',enterText:'Enter',enterStatus:'Carriage return',tabText:'→',tabStatus:'Horizontal tab',shiftText:'Shift',shiftStatus:'Toggle upper/lower case characters',alphabeticLayout:this.qwertyAlphabetic,fullLayout:this.qwertyLayout,isAlphabetic:this.isAlphabetic,isNumeric:this.isNumeric,toUpper:this.toUpper,isRTL:false};this._defaults={showOn:'focus',buttonImage:'',buttonImageOnly:false,showAnim:'show',showOptions:{},duration:'normal',appendText:'',useThemeRoller:false,keypadClass:'',prompt:'',layout:['123'+this.CLOSE,'456'+this.CLEAR,'789'+this.BACK,this.SPACE+'0'],separator:'',target:null,keypadOnly:true,randomiseAlphabetic:false,randomiseNumeric:false,randomiseOther:false,randomiseAll:false,beforeShow:null,onKeypress:null,onClose:null};$.extend(this._defaults,this.regional['']);this.mainDiv=$('<div class="'+this._mainDivClass+'" style="display: none;"></div>')}$.extend(Keypad.prototype,{markerClassName:'hasKeypad',propertyName:'keypad',_mainDivClass:'keypad-popup',_inlineClass:'keypad-inline',_appendClass:'keypad-append',_triggerClass:'keypad-trigger',_disableClass:'keypad-disabled',_inlineEntryClass:'keypad-keyentry',_coverClass:'keypad-cover',_rtlClass:'keypad-rtl',_rowClass:'keypad-row',_promptClass:'keypad-prompt',_specialClass:'keypad-special',_namePrefixClass:'keypad-',_keyClass:'keypad-key',_keyDownClass:'keypad-key-down',setDefaults:function(a){$.extend(this._defaults,a||{});return this},addKeyDef:function(a,b,c,d){if(this._keyCode==32){throw'Only 32 special keys allowed';}this[a]=String.fromCharCode(this._keyCode++);this._specialKeys.push({code:this[a],id:a,name:b,action:c,noHighlight:d});return this},_attachPlugin:function(a,b){a=$(a);if(a.hasClass(this.markerClassName)){return}var c=!a[0].nodeName.toLowerCase().match(/input|textarea/);var d={options:$.extend({},this._defaults,b),_inline:c,_mainDiv:(c?$('<div class="'+this._inlineClass+'"></div>'):l.mainDiv),ucase:false};this._setInput(a,d);this._connectKeypad(a,d);if(c){a.append(d._mainDiv).bind('click.'+this.propertyName,function(){d._input.focus()});this._updateKeypad(d)}else if(a.is(':disabled')){this._disablePlugin(a)}},_setInput:function(a,b){b._input=$(!b._inline?a:b.options.target||'<input type="text" class="'+this._inlineEntryClass+'" disabled="disabled"/>');if(b._inline){a.find('input').remove();if(!b.options.target){a.append(b._input)}}},_connectKeypad:function(d,e){d=$(d);var f=e.options.appendText;if(f){d[e.options.isRTL?'before':'after']('<span class="'+this._appendClass+'">'+f+'</span>')}if(!e._inline){if(e.options.showOn=='focus'||e.options.showOn=='both'){d.bind('focus.'+this.propertyName,this._showPlugin).bind('keydown.'+this.propertyName,this._doKeyDown)}if(e.options.showOn=='button'||e.options.showOn=='both'){var g=e.options.buttonStatus;var h=e.options.buttonImage;var i=$(e.options.buttonImageOnly?$('<img src="'+h+'" alt="'+g+'" title="'+g+'"/>'):$('<button type="button" title="'+g+'"></button>').html(h==''?e.options.buttonText:$('<img src="'+h+'" alt="'+g+'" title="'+g+'"/>')));d[e.options.isRTL?'before':'after'](i);i.addClass(this._triggerClass).click(function(){if(l._keypadShowing&&l._lastField==d[0]){l._hidePlugin()}else{l._showPlugin(d[0])}return false})}}e.saveReadonly=d.attr('readonly');d.addClass(this.markerClassName).data(this.propertyName,e)[e.options.keypadOnly?'attr':'removeAttr']('readonly',true).bind('setData.'+this.propertyName,function(a,b,c){e.options[b]=c}).bind('getData.'+this.propertyName,function(a,b){return e.options[b]})},_optionPlugin:function(a,b,c){a=$(a);var d=a.data(this.propertyName);if(!b||(typeof b=='string'&&c==null)){var e=b;b=(d||{}).options;return(b&&e?b[e]:b)}if(!a.hasClass(this.markerClassName)){return}b=b||{};if(typeof b=='string'){var e=b;b={};b[e]=c}if(this._curInst==d){this._hidePlugin()}$.extend(d.options,b);this._setInput(a,d);this._updateKeypad(d)},_destroyPlugin:function(a){a=$(a);if(!a.hasClass(this.markerClassName)){return}var b=a.data(this.propertyName);if(this._curInst==b){this._hidePlugin()}a.siblings('.'+this._appendClass).remove().end().siblings('.'+this._triggerClass).remove().end().prev('.'+this._inlineEntryClass).remove();a.removeClass(this.markerClassName).empty().unbind('.'+this.propertyName).removeData(this.propertyName)[b.saveReadonly?'attr':'removeAttr']('readonly',true);b._input.removeData(this.propertyName)},_enablePlugin:function(b){b=$(b);if(!b.hasClass(this.markerClassName)){return}var c=b[0].nodeName.toLowerCase();if(c.match(/input|textarea/)){b[0].disabled=false;b.siblings('button.'+this._triggerClass).each(function(){this.disabled=false}).end().siblings('img.'+this._triggerClass).css({opacity:'1.0',cursor:''})}else if(c.match(/div|span/)){b.children('.'+this._disableClass).remove();var d=b.data(this.propertyName);d._mainDiv.find('button').removeAttr('disabled')}this._disabledFields=$.map(this._disabledFields,function(a){return(a==b[0]?null:a)})},_disablePlugin:function(b){b=$(b);if(!b.hasClass(this.markerClassName)){return}var c=b[0].nodeName.toLowerCase();if(c.match(/input|textarea/)){b[0].disabled=true;b.siblings('button.'+this._triggerClass).each(function(){this.disabled=true}).end().siblings('img.'+this._triggerClass).css({opacity:'0.5',cursor:'default'})}else if(c.match(/div|span/)){var d=b.children('.'+this._inlineClass);var e=d.offset();var f={left:0,top:0};d.parents().each(function(){if($(this).css('position')=='relative'){f=$(this).offset();return false}});b.prepend('<div class="'+this._disableClass+'" style="width: '+d.outerWidth()+'px; height: '+d.outerHeight()+'px; left: '+(e.left-f.left)+'px; top: '+(e.top-f.top)+'px;"></div>');var g=b.data(this.propertyName);g._mainDiv.find('button').attr('disabled','disabled')}this._disabledFields=$.map(this._disabledFields,function(a){return(a==b[0]?null:a)});this._disabledFields[this._disabledFields.length]=b[0]},_isDisabledPlugin:function(a){return(a&&$.inArray(a,this._disabledFields)>-1)},_showPlugin:function(b){b=b.target||b;if(l._isDisabledPlugin(b)||l._lastField==b){return}var c=$.data(b,l.propertyName);l._hidePlugin(null,'');l._lastField=b;l._pos=l._findPos(b);l._pos[1]+=b.offsetHeight;var d=false;$(b).parents().each(function(){d|=$(this).css('position')=='fixed';return!d});if(d&&$.browser.opera){l._pos[0]-=document.documentElement.scrollLeft;l._pos[1]-=document.documentElement.scrollTop}var e={left:l._pos[0],top:l._pos[1]};l._pos=null;c._mainDiv.css({position:'absolute',display:'block',top:'-1000px',width:($.browser.opera?'1000px':'auto')});l._updateKeypad(c);e=l._checkOffset(c,e,d);c._mainDiv.css({position:(d?'fixed':'absolute'),display:'none',left:e.left+'px',top:e.top+'px'});var f=c.options.duration;f=(f=='normal'&&$.ui&&$.ui.version>='1.8'?'_default':f);var g=c.options.showAnim;var h=function(){l._keypadShowing=true;var a=l._getBorders(c._mainDiv);c._mainDiv.find('iframe.'+l._coverClass).css({left:-a[0],top:-a[1],width:c._mainDiv.outerWidth(),height:c._mainDiv.outerHeight()})};if($.effects&&($.effects[g]||($.effects.effect&&$.effects.effect[g]))){var i=c._mainDiv.data();for(var j in i){if(j.match(/^ec\.storage\./)){i[j]=c._mainDiv.css(j.replace(/ec\.storage\./,''))}}c._mainDiv.data(i).show(g,c.options.showOptions,f,h)}else{c._mainDiv[g||'show']((g?f:''),h)}if(!g){h()}if(c._input[0].type!='hidden'){c._input[0].focus()}l._curInst=c},_updateKeypad:function(a){var b=this._getBorders(a._mainDiv);a._mainDiv.empty().append(this._generateHTML(a)).find('iframe.'+this._coverClass).css({left:-b[0],top:-b[1],width:a._mainDiv.outerWidth(),height:a._mainDiv.outerHeight()});a._mainDiv.removeClass().addClass(a.options.keypadClass+(a.options.useThemeRoller?' ui-widget ui-widget-content':'')+(a.options.isRTL?' '+this._rtlClass:'')+' '+(a._inline?this._inlineClass:this._mainDivClass));if($.isFunction(a.options.beforeShow)){a.options.beforeShow.apply((a._input?a._input[0]:null),[a._mainDiv,a])}},_getBorders:function(c){var d=function(a){var b=($.browser.msie?1:0);return{thin:1+b,medium:3+b,thick:5+b}[a]||a};return[parseFloat(d(c.css('border-left-width'))),parseFloat(d(c.css('border-top-width')))]},_checkOffset:function(a,b,c){var d=a._input?this._findPos(a._input[0]):null;var e=window.innerWidth||document.documentElement.clientWidth;var f=window.innerHeight||document.documentElement.clientHeight;var g=document.documentElement.scrollLeft||document.body.scrollLeft;var h=document.documentElement.scrollTop||document.body.scrollTop;if(($.browser.msie&&parseInt($.browser.version,10)<7)||$.browser.opera){var i=0;a._mainDiv.find(':not(div,iframe)').each(function(){i=Math.max(i,this.offsetLeft+$(this).outerWidth()+parseInt($(this).css('margin-right'),10))});a._mainDiv.css('width',i)}if(a.options.isRTL||(b.left+a._mainDiv.outerWidth()-g)>e){b.left=Math.max((c?0:g),d[0]+(a._input?a._input.outerWidth():0)-(c?g:0)-a._mainDiv.outerWidth()-(c&&$.browser.opera?document.documentElement.scrollLeft:0))}else{b.left-=(c?g:0)}if((b.top+a._mainDiv.outerHeight()-h)>f){b.top=Math.max((c?0:h),d[1]-(c?h:0)-a._mainDiv.outerHeight()-(c&&$.browser.opera?document.documentElement.scrollTop:0))}else{b.top-=(c?h:0)}return b},_findPos:function(a){while(a&&(a.type=='hidden'||a.nodeType!=1)){a=a.nextSibling}var b=$(a).offset();return[b.left,b.top]},_hidePlugin:function(a,b){var c=this._curInst;if(!c||(a&&c!=$.data(a,this.propertyName))){return}if(this._keypadShowing){b=(b!=null?b:c.options.duration);b=(b=='normal'&&$.ui&&$.ui.version>='1.8'?'_default':b);var d=c.options.showAnim;if($.effects&&($.effects[d]||($.effects.effect&&$.effects.effect[d]))){c._mainDiv.hide(d,c.options.showOptions,b)}else{c._mainDiv[(d=='slideDown'?'slideUp':(d=='fadeIn'?'fadeOut':'hide'))](d?b:'')}}if($.isFunction(c.options.onClose)){c.options.onClose.apply((c._input?c._input[0]:null),[c._input.val(),c])}if(this._keypadShowing){this._keypadShowing=false;this._lastField=null}if(c._inline){c._input.val('')}this._curInst=null},_doKeyDown:function(e){if(e.keyCode==9){l.mainDiv.stop(true,true);l._hidePlugin()}},_checkExternalClick:function(a){if(!l._curInst){return}var b=$(a.target);if(!b.parents().andSelf().hasClass(l._mainDivClass)&&!b.hasClass(l.markerClassName)&&!b.parents().andSelf().hasClass(l._triggerClass)&&l._keypadShowing){l._hidePlugin()}},_shiftKeypad:function(a){a.ucase=!a.ucase;this._updateKeypad(a);a._input.focus()},_clearValue:function(a){this._setValue(a,'',0);this._notifyKeypress(a,l.DEL)},_backValue:function(a){var b=a._input[0];var c=a._input.val();var d=[c.length,c.length];if(b.setSelectionRange){d=(a._input.attr('readonly')||a._input.attr('disabled')?d:[b.selectionStart,b.selectionEnd])}else if(b.createTextRange){d=(a._input.attr('readonly')||a._input.attr('disabled')?d:this._getIERange(b))}this._setValue(a,(c.length==0?'':c.substr(0,d[0]-1)+c.substr(d[1])),d[0]-1);this._notifyKeypress(a,l.BS)},_selectValue:function(a,b){this.insertValue(a._input[0],b);this._setValue(a,a._input.val());this._notifyKeypress(a,b)},insertValue:function(a,b){a=(a.jquery?a:$(a));var c=a[0];var d=a.val();var e=[d.length,d.length];if(c.setSelectionRange){e=(a.attr('readonly')||a.attr('disabled')?e:[c.selectionStart,c.selectionEnd])}else if(c.createTextRange){e=(a.attr('readonly')||a.attr('disabled')?e:this._getIERange(c))}a.val(d.substr(0,e[0])+b+d.substr(e[1]));pos=e[0]+b.length;if(a.is(':visible')){a.focus()}if(c.setSelectionRange){if(a.is(':visible')){c.setSelectionRange(pos,pos)}}else if(c.createTextRange){e=c.createTextRange();e.move('character',pos);e.select()}},_getIERange:function(e){e.focus();var f=document.selection.createRange().duplicate();var g=this._getIETextRange(e);g.setEndPoint('EndToStart',f);var h=function(a){var b=a.text;var c=b;var d=false;while(true){if(a.compareEndPoints('StartToEnd',a)==0){break}else{a.moveEnd('character',-1);if(a.text==b){c+='\r\n'}else{break}}}return c};var i=h(g);var j=h(f);return[i.length,i.length+j.length]},_getIETextRange:function(a){var b=(a.nodeName.toLowerCase()=='input');var c=(b?a.createTextRange():document.body.createTextRange());if(!b){c.moveToElementText(a)}return c},_setValue:function(a,b){var c=a._input.attr('maxlength');if(c>-1){b=b.substr(0,c)}a._input.val(b);if(!$.isFunction(a.options.onKeypress)){a._input.trigger('change')}},_notifyKeypress:function(a,b){if($.isFunction(a.options.onKeypress)){a.options.onKeypress.apply((a._input?a._input[0]:null),[b,a._input.val(),a])}},_generateHTML:function(b){var c=(!b.options.prompt?'':'<div class="'+this._promptClass+(b.options.useThemeRoller?' ui-widget-header ui-corner-all':'')+'">'+b.options.prompt+'</div>');var d=this._randomiseLayout(b);for(var i=0;i<d.length;i++){c+='<div class="'+this._rowClass+'">';var e=d[i].split(b.options.separator);for(var j=0;j<e.length;j++){if(b.ucase){e[j]=b.options.toUpper(e[j])}var f=this._specialKeys[e[j].charCodeAt(0)];if(f){c+=(f.action?'<button type="button" class="'+this._specialClass+' '+this._namePrefixClass+f.name+(b.options.useThemeRoller?' ui-corner-all ui-state-default'+(f.noHighlight?'':' ui-state-highlight'):'')+'" title="'+b.options[f.name+'Status']+'">'+(b.options[f.name+'Text']||'&nbsp;')+'</button>':'<div class="'+this._namePrefixClass+f.name+'"></div>')}else{c+='<button type="button" class="'+this._keyClass+(b.options.useThemeRoller?' ui-corner-all ui-state-default':'')+'">'+(e[j]==' '?'&nbsp;':e[j])+'</button>'}}c+='</div>'}c+='<div style="clear: both;"></div>'+(!b._inline&&$.browser.msie&&parseInt($.browser.version,10)<7?'<iframe src="javascript:false;" class="'+l._coverClass+'"></iframe>':'');c=$(c);var g=b;var h=this._keyDownClass+(b.options.useThemeRoller?' ui-state-active':'');c.find('button').mousedown(function(){$(this).addClass(h)}).mouseup(function(){$(this).removeClass(h)}).mouseout(function(){$(this).removeClass(h)}).filter('.'+this._keyClass).click(function(){l._selectValue(g,$(this).text())});$.each(this._specialKeys,function(i,a){c.find('.'+l._namePrefixClass+a.name).click(function(){a.action.apply(g._input,[g])})});return c},_randomiseLayout:function(b){if(!b.options.randomiseNumeric&&!b.options.randomiseAlphabetic&&!b.options.randomiseOther&&!b.options.randomiseAll){return b.options.layout}var c=[];var d=[];var e=[];var f=[];for(var i=0;i<b.options.layout.length;i++){f[i]='';var g=b.options.layout[i].split(b.options.separator);for(var j=0;j<g.length;j++){if(this._isControl(g[j])){continue}if(b.options.randomiseAll){e.push(g[j])}else if(b.options.isNumeric(g[j])){c.push(g[j])}else if(b.options.isAlphabetic(g[j])){d.push(g[j])}else{e.push(g[j])}}}if(b.options.randomiseNumeric){this._shuffle(c)}if(b.options.randomiseAlphabetic){this._shuffle(d)}if(b.options.randomiseOther||b.options.randomiseAll){this._shuffle(e)}var n=0;var a=0;var o=0;for(var i=0;i<b.options.layout.length;i++){var g=b.options.layout[i].split(b.options.separator);for(var j=0;j<g.length;j++){f[i]+=(this._isControl(g[j])?g[j]:(b.options.randomiseAll?e[o++]:(b.options.isNumeric(g[j])?c[n++]:(b.options.isAlphabetic(g[j])?d[a++]:e[o++]))))+b.options.separator}}return f},_isControl:function(a){return a<' '},isAlphabetic:function(a){return(a>='A'&&a<='Z')||(a>='a'&&a<='z')},isNumeric:function(a){return(a>='0'&&a<='9')},toUpper:function(a){return a.toUpperCase()},_shuffle:function(a){for(var i=a.length-1;i>0;i--){var j=Math.floor(Math.random()*a.length);var b=a[i];a[i]=a[j];a[j]=b}}});var k=['isDisabled'];function isNotChained(a,b){if(a=='option'&&(b.length==0||(b.length==1&&typeof b[0]=='string'))){return true}return $.inArray(a,k)>-1}$.fn.keypad=function(a){var b=Array.prototype.slice.call(arguments,1);if(isNotChained(a,b)){return l['_'+a+'Plugin'].apply(l,[this[0]].concat(b))}return this.each(function(){if(typeof a=='string'){if(!l['_'+a+'Plugin']){throw'Unknown command: '+a;}l['_'+a+'Plugin'].apply(l,[this].concat(b))}else{l._attachPlugin(this,a||{})}})};var l=$.keypad=new Keypad();$(function(){$(document.body).append(l.mainDiv).mousedown(l._checkExternalClick)})})(jQuery);
2,516.142857
17,229
0.71839
28aa7126e28a03fb36988d4ade5ae0bc5dc2e6bb
23,647
js
JavaScript
dist/global.min.js
kashiro/GlobalJS
291a09f21e45abeeb7e55edcae007833ad9f45dc
[ "MIT" ]
null
null
null
dist/global.min.js
kashiro/GlobalJS
291a09f21e45abeeb7e55edcae007833ad9f45dc
[ "MIT" ]
null
null
null
dist/global.min.js
kashiro/GlobalJS
291a09f21e45abeeb7e55edcae007833ad9f45dc
[ "MIT" ]
null
null
null
!function(){var a=!1,b=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;this.Class=function(){},Class.extend=function(c){function d(){!a&&this.init&&this.init.apply(this,arguments)}var e=this.prototype;a=!0;var f=new this;a=!1;for(var g in c)f[g]="function"==typeof c[g]&&"function"==typeof e[g]&&b.test(c[g])?function(a,b){return function(){var c=this._super;this._super=e[a];var d=b.apply(this,arguments);return this._super=c,d}}(g,c[g]):c[g];return d.prototype=f,d.prototype.constructor=d,d.extend=arguments.callee,d}}(),function(a){"use strict";var b={define:function(a,c){var d=this._modifyDefinition(c),e=this._getModule(d),f=this._generateClass(e,a),g=c.alias;b.regist(a,f),c.alias&&b.regist(g,this._getRegistedClass(a))},regist:function(b,c){for(var d,e=b.split("."),f=e.length,g=0,h=a;f>g;g++)d=e[g],"undefined"==typeof h[d]&&(h[d]=g===e.length-1?c:{}),h=h[d]},keys:function(a){var c,d=b.isObject(a),e=Object.keys,f=[];if(d||(f=[]),e)f=Object.keys(a);else for(c in a)a.hasOwnProperty(c)&&f.push(c);return f},isObject:function(a){return a===Object(a)},isUndefined:function(a){return void 0===a},_makeWhetherFun:function(){var a=this,b=["Function","String","Number","Date","Array"];$.each(b,function(b,c){a["is"+c]=function(a){return Object.prototype.toString.call(a)==="[object "+c+"]"}})},_getRegistedClass:function(b){for(var c,d=b.split("."),e=d.length,f=0,g=a;e>f;f++)c=d[f],g=g[c];return g},_getModule:function(a){var c,d;if(this.isUndefined(a.extend))d=b.core.BaseClass;else{if(!this.isFunction(a.extend))return void console.error("you should set sub class of lib/Class.js");d=a.extend}return c=d.extend(a),c.$parentClass=d,c},_generateClass:function(a,b){var c;return c=a.prototype.singleton?new a:a,c.$className=b,c},_modifyDefinition:function(a){var b;return b=this._addGetSetter(a)},_addGetSetter:function(a){var b,c,d;for(d in a)b=a[d],!this.isFunction(b)&&a.hasOwnProperty(d)&&(c=this._conbineUpperStr("get",d),a[c]=this._getGetSetFunc("get",a,d),c=this._conbineUpperStr("set",d),a[c]=this._getGetSetFunc("set",a,d));return a},_conbineUpperStr:function(a,b){var c=b.charAt(0).toUpperCase(),d=b.slice(1);return a+c+d},_getGetSetFunc:function(a,b,c){var d;return d="get"===a?function(){return this[c]}:function(a){this[c]=a}}};b.regist("Global",b),b._makeWhetherFun()}(window),function(){"use strict";Global.define("Global.core.BaseClass",{alias:"Global.BaseClass",extend:Class,init:function(a){this.config=a,this._applyConfig(a)},_applyConfig:function(a){for(var b in a)this[b]=a[b]}})}(),function(){"use strict";Global.define("Global.event.Event",{init:function(a){this._super(a),this.target=a.target,this.type=a.type,this.data=a.data}})}(),function(){"use strict";Global.define("Global.event.EventDispatcher",{init:function(a){this.listeners={},this._super(a)},addEventListener:function(a,b){(this.listeners[a]||(this.listeners[a]=[])).push(b)},hasEventListener:function(a){return!!this.listeners[a]},removeEventListener:function(a,b){var c=this.listeners[a];if(c)for(var d=c.length-1;d>=0;d--)c[d]===b&&c.splice(d,1)},onesEventListener:function(a,b){var c=this,d=function(e){c.removeEventListener(a,d),b.apply(c,[e]),d=null};this.addEventListener(a,d)},dispatchEvent:function(a,b){var c=this.listeners[a],d=new Global.event.Event({target:this,type:a,data:b});if(c){c=c.concat();for(var e=0,f=c.length;f>e;e++)c[e].apply(this,[d])}}})}(),function(){"use strict";Global.define("Global.core.ObservableClass",{alias:"Global.ObservableClass",extend:Global.event.EventDispatcher,init:function(a){this.listeners={},this._super(a)}})}(),function(){"use strict";Global.define("Global.core.ManipulateDomClass",{alias:"Global.ObservableClass",extend:Global.core.ObservableClass,refs:{},events:{},$elm:null,init:function(a){this.listeners={},this.elmCaches={},this._super(a),this._setElmCaches(this.getRefs()),this._applyEvents(this.getEvents())},getCacheRef:function(a,b){if(this.$elm){var c=this.elmCaches[a],d=!c&&b?this.$elm.find(b):void 0;return d&&0===d.length&&(d=void 0),c||(this.elmCaches[a]=d),this.elmCaches[a]}},_setElmCaches:function(a){var b,c=this;for(b in a)c.getCacheRef(b,a[b])},_applyEvents:function(a){var b,c,d,e=this;$.each(a,function(a,f){return(b=e.getCacheRef(a))?(c=Global.keys(f)[0],d=f[c],void(Global.isObject(d)&&d.delegate?b.on(c,d.delegate,$.proxy(e[d.handler],e)):Global.isString(d)&&b.on(c,$.proxy(e[d],e)))):!1})}})}(),function(){"use strict";Global.define("Global.core.Array",{alias:"Global.Array",singleton:!0,args2Array:function(a){return a instanceof Array?a:Array.prototype.slice.call(a)},map2Array:function(a){var b,c=[];for(b in a)c.push(a[b]);return c},each:function(a,b){for(var c=a.length,d=0;c>d;d++)b(d,a[d])},contains:function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return!0;return!1},remove:function(a,b,c){var d=c||1;a.splice(b,d)},makeRandomList:function(a,b){var c=b||a.length,d=Global.math.Random.getRandomNumList(c),e=[];return Global.Array.each(d,function(b,c){e.push(a[c])}),e}})}(),function(){"use strict";Global.define("Global.core.Functions",{alias:"Global.Functions",singleton:!0,createDebounce:function(a){var b=new Global.util.functions.Debounce(a);return function(){var a=Global.core.Array.args2Array(arguments);b.execute.apply(b,a)}},bind:function(a,b,c){var d;return function(){d=Global.core.Array.args2Array(arguments),Global.isArray(c)&&(d=d.concat(c)),a.apply(b,d)}}})}(),function(){"use strict";Global.define("Global.data.Map",{singleton:!0,list2Map:function(a,b){var c={};return $.each(a,function(a,d){c[d[b]]=d}),c}})}(),function(){"use strict";Global.define("Global.data.proxy.Proxy",{extend:Global.core.ObservableClass,singleRequest:!0,isRequesting:!1,init:function(a){this._super(a)},get:function(a){var b,c=this,d=$.Deferred();return c.getSingleRequest()&&c.getIsRequesting()?void d.resolve.apply(d,[{},"error"]):(c.setIsRequesting(!0),$.ajax(a).done(function(){b=Global.Array.args2Array(arguments),c.setIsRequesting(!1),d.resolve.apply(d,b)}).fail(function(){b=Global.Array.args2Array(arguments),c.setIsRequesting(!1),d.reject.apply(d,b)}),d.promise())}})}(),function(){"use strict";Global.define("Global.data.model.Model",{extend:Global.core.ObservableClass,eventName:{LOAD:"load",ERROR:"error"},isGetCurrentTime:!1,currentTime:null,proxy:Global.data.proxy.Proxy,requestSetting:{GET:{type:"GET",dataType:"json"}},requestParam:{GET:{}},data:null,init:function(a){this._super(a),this.proxy=new this.proxy},get:function(a){var b=this._getRequestObj("GET",a);return this._request(b)},_request:function(a){var b=this,c=$.Deferred(),d=this.proxy.get(a);return d.done(function(a,d,e){b._onSuccess(a,d,e),c.resolve(a,d,e),b.dispatchEvent(b.eventName.LOAD,a)}),d.fail(function(a,d,e){c.reject(a,d,e),b.dispatchEvent(b.eventName.ERROR,a)}),c.promise()},_getRequestObj:function(a,b){var c=this.getRequestSetting()[a],d=this.getRequestParam()[a],e=$.extend(!0,{},d,b);return c.data=e,c},_onSuccess:function(a,b,c){var d=c?c.getResponseHeader("Date"):void 0;this._setCurrentTime(d);var e=this._modifyData(a);this.setData(e)},_setCurrentTime:function(a){this.getIsGetCurrentTime()&&a&&this.setCurrentTime(new Date(a))},_modifyData:function(a){return a}})}(),function(){"use strict";Global.define("Global.math.Random",{singleton:!0,getRandomNum:function(a){return Math.floor(Math.random()*a+1)},getRandomNumList:function(a){var b,c,d,e=new Array(a);for(e[0]=0,b=a-1;b>0;b--)c=Math.floor(Math.random()*(b+1)),d=e[b]||b,e[b]=e[c]||c,e[c]=d;return e}})}(),function(){"use strict";Global.define("Global.animation.Easing",{singleton:!0,linear:function(a,b,c,d){return c*a/d+b},easeInQuad:function(a,b,c,d){return a/=d,c*a*a+b},easeOutQuad:function(a,b,c,d){return a/=d,-c*a*(a-2)+b},easeInOutQuad:function(a,b,c,d){return a/=d/2,1>a?c/2*a*a+b:(a--,-c/2*(a*(a-2)-1)+b)},easeInCubic:function(a,b,c,d){return a/=d,c*a*a*a+b},easeOutCubic:function(a,b,c,d){return a/=d,a--,c*(a*a*a+1)+b},easeInOutCubic:function(a,b,c,d){return a/=d/2,1>a?c/2*a*a*a+b:(a-=2,c/2*(a*a*a+2)+b)},easeInQuart:function(a,b,c,d){return a/=d,c*a*a*a*a+b},easeOutQuart:function(a,b,c,d){return a/=d,a--,-c*(a*a*a*a-1)+b},easeInOutQuart:function(a,b,c,d){return a/=d/2,1>a?c/2*a*a*a*a+b:(a-=2,-c/2*(a*a*a*a-2)+b)},easeInQuint:function(a,b,c,d){return a/=d,c*a*a*a*a*a+b},easeOutQuint:function(a,b,c,d){return a/=d,a--,c*(a*a*a*a*a+1)+b},easeInOutQuint:function(a,b,c,d){return a/=d/2,1>a?c/2*a*a*a*a*a+b:(a-=2,c/2*(a*a*a*a*a+2)+b)},easeInSine:function(a,b,c,d){return-c*Math.cos(a/d*(Math.PI/2))+c+b},easeOutSine:function(a,b,c,d){return c*Math.sin(a/d*(Math.PI/2))+b},easeInOutSine:function(a,b,c,d){return-c/2*(Math.cos(Math.PI*a/d)-1)+b},easeInExpo:function(a,b,c,d){return c*Math.pow(2,10*(a/d-1))+b},easeOutExpo:function(a,b,c,d){return c*(-Math.pow(2,-10*a/d)+1)+b},easeInOutExpo:function(a,b,c,d){return a/=d/2,1>a?c/2*Math.pow(2,10*(a-1))+b:(a--,c/2*(-Math.pow(2,-10*a)+2)+b)},easeInCirc:function(a,b,c,d){return a/=d,-c*(Math.sqrt(1-a*a)-1)+b},easeOutCirc:function(a,b,c,d){return a/=d,a--,c*Math.sqrt(1-a*a)+b},easeInOutCirc:function(a,b,c,d){return a/=d/2,1>a?-c/2*(Math.sqrt(1-a*a)-1)+b:(a-=2,c/2*(Math.sqrt(1-a*a)+1)+b)}})}(),function(){"use strict";Global.define("Global.animation.Animation",{extend:Global.core.ObservableClass,eventName:{start:"start",step:"step",end:"end"},easingFn:Global.animation.Easing,easing:"linear",stepFn:null,fps:60,from:0,to:0,duration:0,speed:0,startTime:null,value:0,currentTime:null,id:null,init:function(a){this._super(a),this._calcSpeed(this.getFps()),this._setEasing(this.getEasing())},start:function(){var a=this,b=a.getStepFn(),c=a.getTo(),d=a.getFrom(),e=a.getStartTime(),f=a.getSpeed(),g=a.getDuration(),h=null;e=(new Date).getTime(),this.setStartTime(e),a.dispatchEvent(a.eventName.start,{time:void 0,value:void 0}),function i(){h=a.getValue(),c>h?a.setId(setTimeout(i,f)):a.dispatchEvent(a.eventName.end,{time:a.getCurrentTime(),value:h}),a._doStart(e,d,c,g,b)}()},_doStart:function(a,b,c,d,e){var f,g=(new Date).getTime()-a;this.setCurrentTime(g),f=e(g,b,c,d),this.setValue(f),this.dispatchEvent(this.eventName.step,{time:g,value:f})},stop:function(){var a=this.getId();window.clearTimeout(a)},cancel:function(){var a=this.getValue(),b=this.getCurrentTime();this.stop(),this.setCurrentTime(null),this.setValue(null),this.setId(null),this.dispatchEvent(this.eventName.end,{time:b,value:a})},_calcSpeed:function(a){this.setSpeed(1e3/a)},_setEasing:function(a){var b,c=this.getEasingFn();Global.isFunction(a)?b=a:Global.isString(a)&&(b=c[a]),this.setStepFn(b)}})}(),function(){"use strict";Global.define("Global.util.functions.Debounce",{init:function(a){this.timer=null,this._super(a)},execute:function(){var a={callback:this.callback,args:Global.core.Array.args2Array(arguments),scope:this.scope||this,interval:this.interval||1e3,immediate:this.immediate};return this.timer?!1:void this._switchExecute(a)},_switchExecute:function(a){a.immediate?this._executeBefore(a.callback,a.args,a.scope,a.interval):this._executeAfter(a.callback,a.args,a.scope,a.interval)},_executeBefore:function(a,b,c,d){var e=this;a.apply(c,b),e.timer=setTimeout(function(){e.timer=null},d)},_executeAfter:function(a,b,c,d){var e=this;e.timer=setTimeout(function(){a.apply(c,b),e.timer=null},d)}})}(),function(){"use strict";Global.define("Global.util.PreLoad",{extend:Global.core.ObservableClass,srcs:[],imgs:{},cacheBuster:null,useCacheBuster:!1,eventName:{load:"load",loadEnd:"loadend"},init:function(a){this.srcs=[],this.imgs={},this.cacheBuster="cache="+(new Date).getTime(),this._super(a)},load:function(){var a=this,b=this.getSrcs(),c=document.createElement("img"),d=this.getCacheBuster(),e=[];Global.core.Array.each(b,function(b,f){e.push({img:c.cloneNode(),src:f,cacheBusterSrc:a._addCacheBuster(f,d)})}),this._prepareImages(e)},_prepareImages:function(a){var b=this,c=b.getUseCacheBuster();Global.core.Array.each(a,function(a,d){d.img.onload=function(a){b._onLoad(a,this)},d=b._addImgSrc(c,d),d.img.complete&&b._onLoad({currentTarget:d.img},this)})},_addImgSrc:function(a,b){return b.img.src=a?b.cacheBusterSrc:b.src,b},_addCacheBuster:function(a,b){var c=-1!==a.indexOf("?")?"&"+b:"?"+b;return a+c},_removeCacheBuster:function(a,b){var c=a.indexOf(b)-1;return a.slice(0,c)},_getImgSrc:function(a,b,c){var d=a?this._removeCacheBuster(c.src,b):c.src;return d},_onLoad:function(a,b){var c,d,e,f=this,g=this.getSrcs(),h=this.getImgs(),i=this.getCacheBuster(),j=a?a.currentTarget:b;e=f._getImgSrc(f.getUseCacheBuster(),i,j),h[e]=j,this.setImgs(h),c=this._getPercentage(g.length,Global.keys(h).length),d=this._getEventData(j,c),this._doDispatchEvent(d)},_doDispatchEvent:function(a){var b=this.getEventName();this.dispatchEvent(b.load,a),100===a.percentage&&this.dispatchEvent(b.loadEnd,a)},_getPercentage:function(a,b){return b/a*100},_getEventData:function(a,b){return{current:a,percentage:b}}})}(),function(){"use strict";Global.define("Global.util.SpriteSheet",{extend:Global.core.ObservableClass,classList:[],interval:500,eventName:{end:"end",change:"change"},targetSelector:null,$elm:null,totalCount:0,limit:null,count:0,intervalId:null,init:function(a){this.$elm=$(a.targetSelector),this._super(a)},execute:function(){var a=this;a.intervalId=setInterval(function(){a._doSprite(a.count),a._countUp(a.count),a.dispatchEvent(a.getEventName().change,a.getTotalCount()),Global.isNumber(a.getLimit())&&a.getTotalCount()===a.getLimit()&&(window.clearInterval(a.intervalId),a.setTotalCount(0),a.dispatchEvent(a.getEventName().end))},a.interval)},_doSprite:function(a){var b=this,c=b._getClass(a);b.$elm.removeClass(c.current),b.$elm.addClass(c.next)},_countUp:function(a){this.count=(1+a)%this.classList.length,this.totalCount=++this.totalCount},_getClass:function(a){var b=this,c=(1+a)%this.classList.length,d=b.classList[a],e=b.classList[c];return{current:d,next:e}}})}(),function(){"use strict";Global.define("Global.util.RequestAnimationFrame",{singleton:!0,init:function(a){this.polyfill(),this._super(a)},start:function(a){return this.raf.apply(window,[a])},cancel:function(a){return this.caf(a)},polyfill:function(){var a=window,b=a.requestAnimationFrame||a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.msRequestAnimationFrame||a.oRequestAnimationFrame||function(a){setTimeout(a,1e3/60)},c=a.cancelAnimationFrame||a.cancelRequestAnimationFrame||a.webkitCancelAnimationFrame||a.webkitCancelRequestAnimationFrame||a.mozCancelAnimationFrame||a.mozCancelRequestAnimationFrame||a.msCancelAnimationFrame||a.msCancelRequestAnimationFrame||a.oCancelAnimationFrame||a.oCancelRequestAnimationFrame||function(a){clearTimeout(a)};this.raf=b,this.caf=c}})}(),function(){"use strict";Global.define("Global.util.WindowScrollEventer",{extend:Global.ObservableClass,eventName:{jquery:"windowscrolleventer"},isShown:function(a,b){return b>0&&a<document.documentElement.clientHeight},targets:null,start:function(){$(window).on("scroll."+this.getEventName().jquery,$.proxy(this._onScroll,this))},_onScroll:function(){this._judgeTrigger(this.getTargets())},_judgeTrigger:function(a){var b,c,d,e=this;Global.Array.each(a,function(a,f){b=f.$elm[0].getBoundingClientRect(),c=b.top,d=b.bottom,e.isShown(c,d)?e.dispatchEvent(f.name+"show",{target:f}):e.dispatchEvent(f.name+"hide",{target:f})})},stop:function(){$(window).off("scroll."+this.getEventName().jquery)},add:function(a){var b=this.getTargets().concat(a);this.setTargets(b)},remove:function(a){var b=this,c=this.getTargets(),d=[];Global.Array.each(c,function(b,c){c.name!==a&&d.push(c)}),b.setTargets(d)}})}(),function(){"use strict";Global.define("Global.util.CountDown",{extend:Global.core.ObservableClass,eventName:{TIMEUPDATE:"timeupdate",END:"end"},countDown:0,interval:100,execute:function(){var a=this,b=0,c=!1,d=this.getInterval(),e=this.getEventName();window.setTimeout(function(){!function f(){b+=d,c=a._isEnd(b),c?a.dispatchEvent(e.END,b):(a.dispatchEvent(e.TIMEUPDATE,b),window.setTimeout(f,d))}()},d)},_isEnd:function(a){var b=!1;return a>=this.getCountDown()&&(b=!0),b}})}(),function(){"use strict";Global.define("Global.media.video.YouTubeEmbed",{extend:Global.ObservableClass,eventName:{loadSdk:"loadsdk",loadPlayer:"loadplayer"},id:"",sdkId:"g-youtube-embed",sdkSrc:"https://www.youtube.com/iframe_api",inst:null,param:null,init:function(a){this._super(a)},initSdk:function(){return this._hasSdk()?void this._onLoadSdk():void this._appendSdk()},embed:function(){var a=this._getParam(),b=this._createEmbedInstance(a);this.inst=b},_appendSdk:function(){window.onYouTubeIframeAPIReady=Global.Functions.bind(this._onLoadSdk,this);var a=this._getSdkCode();$(document.body).append(a)},_onLoadSdk:function(){this.dispatchEvent(this.getEventName().loadSdk,{currentTarget:this}),this.embed()},_hasSdk:function(){var a=$("#"+this.getSdkId());return a.length>0&&window.YT},_getSdkCode:function(){var a=$("<script>"),b=this.getSdkId(),c=this.getSdkSrc();return a.prop("id",b),a.prop("src",c),a},_createEmbedInstance:function(a){return new window.YT.Player(this.getId(),a)},_getParam:function(){var a=this.getParam(),b={events:{onReady:Global.Functions.bind(this._onReadyVideo,this)}};return $.extend(!0,{},a,b)},_onReadyVideo:function(){this.dispatchEvent(this.getEventName().loadPlayer,{currentTarget:this})}})}(),function(){"use strict";Global.define("Global.media.video.VideoElement",{elm:null,extend:Global.ObservableClass,init:function(a){this._super(a),this.$elm=$(this.elm),this._bind(),this._load()},_load:function(){this.elm.load()},_bind:function(){this.elm.addEventListener("timeupdate",Global.Functions.bind(this._onTimeupdate,this)),this.elm.addEventListener("canplay",Global.Functions.bind(this._onCanPlay,this))},_onCanPlay:function(){this.dispatchEvent("canplay")},_onTimeupdate:function(){},play:function(){var a=this;a.elm.play()},pause:function(){this.elm.pause()},_skip:function(a){this._setCurrentTime(a)},_setCurrentTime:function(a){this.elm.currentTime=a/1e3}})}(),function(){"use strict";Global.define("Global.view.Base",{extend:Global.core.ManipulateDomClass,EVENT:{show:"show",hide:"hide"},show:function(){var a=this.get$elm();a.show(),this.dispatchEvent(this.EVENT.SHOW)},hide:function(){var a=this.get$elm();a.hide(),a.remove(),this.dispatchEvent(this.EVENT.HIDE)}})}(),function(){"use strict";Global.define("Global.view.Modal",{extend:Global.view.Base,centerd:!0,cls:null,hideOnMaskClick:!1,outerTpl:'<div class="g-modal <%= centerdCls %> <%= cls %>"></div>',maskTpl:'<div class="g-modal__mask <%= centerdCls %> <%= cls %>"></div>',tpl:[],$elm:null,compiledOuterTpl:null,compiledMaskTpl:null,compiledTpl:null,init:function(a){this._super(a),this.compiledOuterTpl=this._getCompiledOuterTpl(),this.compiledMaskTpl=this._getCompiledMaskTpl(),this.compiledTpl=this._getCompiledTpl()},show:function(a){var b,c,d,e=this._getTplData(a);this.$elm||(this._create(e),this._setElmCaches(this.getRefs()),this._applyEvents(this.getEvents()),b=this.$elm,c=this.$mask,d=$(document.body),d.append(b),d.append(c),b.show(),c.show(),this.dispatchEvent(this.getEventName().show))},_create:function(a){var b=this.getCompiledOuterTpl(),c=this.getCompiledMaskTpl(),d=this.getCompiledTpl(),e=b(a),f=c(a),g=d(a),h=$(e),i=$(f);h.append(g),h.hide(),i.hide(),this.$elm=h,this.$mask=i,this.getHideOnMaskClick()?this._bindMaskClickHide(i):this._bindMaskClickNone(i)},_bindMaskClickHide:function(a){var b=this;a.on("click",function(){b.hide()})},_bindMaskClickNone:function(a){a.on("click",function(a){a.preventDefault(),a.stopPropagation()})},_getTplData:function(a){var b=this._getModalTplData();return $.extend(!0,{},b,a)},hide:function(){this.$elm.hide(),this.$elm.remove(),this.$mask.hide(),this.$mask.remove(),this.$elm=null,this.$mask=null,this.dispatchEvent(this.getEventName().hide)},_getCompiledOuterTpl:function(){return _.template(this.getOuterTpl())},_getCompiledMaskTpl:function(){return _.template(this.getMaskTpl())},_getCompiledTpl:function(){return _.template(this.getTpl())},_getModalTplData:function(){var a=this.getCls()?this.getCls():"",b=this.getCenterd()?"g-modal--centerd":"";return{cls:a,centerdCls:b}}})}(),function(){"use strict";Global.define("Global.app.History",{extend:Global.core.ObservableClass,defaultPathName:"",changeHash:!1,eventName:{change:"change"},isSupported:history&&!!history.pushState,data:null,hashExtention:"!/",state:function(){return this.getData()},length:function(){return this.isSupported?history.length:null},init:function(a){this._super(a),this._setUseHash(this.useHash),this._bind()},_setUseHash:function(a){a&&(this.isSupported=!1)},pushState:function(a,b,c){var d,e=this.getDefaultPathName();this.setData(b),this.isSupported?(d=e+a,history.pushState(b,c,d)):(this.setChangeHash(!0),location.hash=this._getHashByPathName(a))},forward:function(){history.forward()},back:function(){history.back()},go:function(){history.go()},getNormalizePath:function(){var a;return a=this.isSupported?this.getPathName():this.getHash()},getPathName:function(){var a=location.pathname;return a=a.split(this.getDefaultPathName())[1],a=this._addSlashAtFirst(a),this._getNoLastSlashPath(a)},getHash:function(){var a=location.hash,b=this._changeHashToPathName(a);return this._getNoLastSlashPath(b)},_changeHashToPathName:function(a){var b,c="#"+this.getHashExtention();return a?(b=a.split(c)[1],b=this._addSlashAtFirst(b)):b="/",b},_getHashByPathName:function(a){var b,c=this.getHashExtention();return b="/"===a?c:c+(this._isFirstSlash(a)?a.substring(1):a)},_bind:function(){this.isSupported?window.addEventListener("popstate",Global.Functions.bind(this._onPopState,this)):this._bindHashChange()},_bindHashChange:function(){var a=this,b=window.addEventListener?"addEventListener":"attachEvent";window[b]("hashchange",function(b){a.getChangeHash()||a._onPopState(b),a.setChangeHash(!1)})},_onPopState:function(a){var b={state:this.state(),raw:a};this.dispatchEvent(this.getEventName().change,b)},_isFirstSlash:function(a){var b=/^\//;return b.test(a)},_addSlashAtFirst:function(a){var b;return Global.isUndefined(a)?b=void 0:(this._isFirstSlash(a)||(a="/"+a),b=a),a},_getNoLastSlashPath:function(a){var b=/\/$/;return"/"===a?a:b.test(a)?a.slice(0,-1):a}})}(),function(){"use strict";Global.define("Global.app.Controller",{extend:Global.core.ManipulateDomClass,restart:function(){}})}(),function(){"use strict";Global.define("Global.app.Router",{routing:{},controllers:{},start:function(){var a=location.pathname,b=this.getRouting(),c=this._getController(a,b),d=c?new c:void 0,e=this._getNoLastSlashPath(a);this.controllers[e]=d},_getController:function(a,b){var c=/\/$/,d=c.test(a)?a:a+"/",e=this._getNoLastSlashPath(a),f=b[d],g=b[e];return f?f:g},_getNoLastSlashPath:function(a){var b=/\/$/;return b.test(a)?a.slice(0,-1):a}})}(),function(){"use strict";Global.define("Global.app.HistoryRouter",{extend:Global.app.Router,historyCtr:null,useHash:!1,defaultPathName:"/",init:function(a){var b=this;this._super(a),this.setHistoryCtr(new Global.app.History({useHash:b.getUseHash(),defaultPathName:b.getDefaultPathName()})),this._bind()},_bind:function(){this.getHistoryCtr().addEventListener("change",Global.Functions.bind(this._onChangeState,this))},_onChangeState:function(){var a=!0;this.start(a)},start:function(a){var b=this.getHistoryCtr().getNormalizePath(),c=this._start(b,a);c||this._startDefault()},_startDefault:function(){var a=this.getDefaultPathName();this.changePage(a)},_start:function(a,b){var c=this._getControllerInstance(a);return c?c.restart():c=this._makeController(a),!b&&c&&this.getHistoryCtr().pushState(a),!!c},_getControllerInstance:function(a){return this.controllers[a]},_makeController:function(a){var b=this.getRouting(),c=this._getController(a,b),d=c?new c({pathKey:a}):void 0;return this.controllers[a]=d,d},changePage:function(a){this._start(a)}})}();
23,647
23,647
0.737303
28aab30ed87ad3035272d32743a24cea05964eb3
4,473
js
JavaScript
old_examples/nested/app.js
voluntadpear/react-tabs
249e9dae708b07cc3123f108292cf579ef965b12
[ "MIT" ]
2,588
2016-02-12T04:00:18.000Z
2022-03-31T13:44:26.000Z
old_examples/nested/app.js
voluntadpear/react-tabs
249e9dae708b07cc3123f108292cf579ef965b12
[ "MIT" ]
353
2016-02-14T22:27:15.000Z
2022-03-31T17:28:40.000Z
old_examples/nested/app.js
voluntadpear/react-tabs
249e9dae708b07cc3123f108292cf579ef965b12
[ "MIT" ]
468
2016-02-15T06:56:37.000Z
2022-03-23T19:48:01.000Z
import React from 'react'; import { render } from 'react-dom'; import { Tab, Tabs, TabList, TabPanel } from '../../src/index'; import '../../style/react-tabs.css'; const App = () => { return ( <div style={{ padding: 50 }}> <Tabs> <TabList> <Tab>The Simpsons</Tab> <Tab>Futurama</Tab> </TabList> <TabPanel> <Tabs> <TabList> <Tab>Homer Simpson</Tab> <Tab>Marge Simpson</Tab> <Tab>Bart Simpson</Tab> <Tab>Lisa Simpson</Tab> <Tab>Maggie Simpson</Tab> </TabList> <TabPanel> <p>Husband of Marge; father of Bart, Lisa, and Maggie.</p> <img src="https://upload.wikimedia.org/wikipedia/en/thumb/0/02/Homer_Simpson_2006.png/212px-Homer_Simpson_2006.png" alt="Homer Simpson" /> </TabPanel> <TabPanel> <p>Wife of Homer; mother of Bart, Lisa, and Maggie.</p> <img src="https://upload.wikimedia.org/wikipedia/en/thumb/0/0b/Marge_Simpson.png/220px-Marge_Simpson.png" alt="Marge Simpson" /> </TabPanel> <TabPanel> <p>Oldest child and only son of Homer and Marge; brother of Lisa and Maggie.</p> <img src="https://upload.wikimedia.org/wikipedia/en/a/aa/Bart_Simpson_200px.png" alt="Bart Simpson" /> </TabPanel> <TabPanel> <p>Middle child and eldest daughter of Homer and Marge; sister of Bart and Maggie.</p> <img src="https://upload.wikimedia.org/wikipedia/en/thumb/e/ec/Lisa_Simpson.png/200px-Lisa_Simpson.png" alt="Lisa Simpson" /> </TabPanel> <TabPanel> <p>Youngest child and daughter of Homer and Marge; sister of Bart and Lisa.</p> <img src="https://upload.wikimedia.org/wikipedia/en/thumb/9/9d/Maggie_Simpson.png/223px-Maggie_Simpson.png" alt="Maggie Simpson" /> </TabPanel> </Tabs> </TabPanel> <TabPanel> <Tabs> <TabList> <Tab>Philip J. Fry</Tab> <Tab>Turanga Leela</Tab> <Tab>Bender Bending Rodriguez</Tab> <Tab>Amy Wong</Tab> <Tab>Professor Hubert J. Farnsworth</Tab> <Tab>Doctor John Zoidberg</Tab> </TabList> <TabPanel> <p>Protagonist, from the 20th Century. Delivery boy. Many times great-uncle to Professor Hubert Farnsworth. Suitor of Leela.</p> <img src="https://upload.wikimedia.org/wikipedia/en/thumb/2/28/Philip_Fry.png/175px-Philip_Fry.png" alt="Philip J. Fry" /> </TabPanel> <TabPanel> <p>Mutant cyclops. Captain of the Planet Express Ship. Love interest of Fry.</p> <img src="https://upload.wikimedia.org/wikipedia/en/thumb/d/d4/Turanga_Leela.png/150px-Turanga_Leela.png" alt="Turanga Leela" /> </TabPanel> <TabPanel> <p>A kleptomaniacal, lazy, cigar-smoking, heavy-drinking robot who is Fry's best friend. Built in Tijuana, Mexico, he is the Planet Express Ship's cook.</p> <img src="https://upload.wikimedia.org/wikipedia/en/thumb/a/a6/Bender_Rodriguez.png/220px-Bender_Rodriguez.png" alt="Bender Bending Rodriguez" /> </TabPanel> <TabPanel> <p>Chinese-Martian intern at Planet Express. Fonfon Ru of Kif Kroker.</p> <img src="https://upload.wikimedia.org/wikipedia/en/thumb/f/fd/FuturamaAmyWong.png/140px-FuturamaAmyWong.png" alt="Amy Wong" /> </TabPanel> <TabPanel> <p>Many times great-nephew of Fry. CEO and owner of Planet Express delivery company. Tenured professor of Mars University.</p> <img src="https://upload.wikimedia.org/wikipedia/en/thumb/0/0f/FuturamaProfessorFarnsworth.png/175px-FuturamaProfessorFarnsworth.png" alt="Professor Hubert J. Farnsworth" /> </TabPanel> <TabPanel> <p>Alien from Decapod 10. Planet Express' staff doctor and steward. Has a medical degree and Ph.D in art history.</p> <img src="https://upload.wikimedia.org/wikipedia/en/thumb/4/4a/Dr_John_Zoidberg.png/200px-Dr_John_Zoidberg.png" alt="Doctor John Zoidberg" /> </TabPanel> </Tabs> </TabPanel> </Tabs> </div> ); }; render(<App />, document.getElementById('example'));
50.829545
187
0.591102
28ab81b3d85f600915af08009d2557f6839a746b
503
js
JavaScript
app/components/ListItem/index.js
Nemsae/website
020afd7a72cc50db511bea8722698334f699894e
[ "MIT" ]
null
null
null
app/components/ListItem/index.js
Nemsae/website
020afd7a72cc50db511bea8722698334f699894e
[ "MIT" ]
null
null
null
app/components/ListItem/index.js
Nemsae/website
020afd7a72cc50db511bea8722698334f699894e
[ "MIT" ]
null
null
null
import styled from 'styled-components'; const ListItem = styled.li.attrs({ className: 'list__item' })` display: flex; align-items: center; justify-content: space-between; position: relative; margin: 1rem -1rem; padding: 1rem; cursor: pointer; &:first-child { margin-top: 2rem; } :hover { background-color: rgba(255, 255, 255, 0.2); .list__item__number { color: var(--pink); transform: translateY(-50%) scale(1.5); } } `; export default ListItem;
17.344828
62
0.638171
28ac60e718075d44dd9f00e7be991902991c2607
7,049
js
JavaScript
app.js
Troothe/tictactoe
147edc11f25bad3bc75fefe6469b21f8b2bb82ca
[ "MIT" ]
null
null
null
app.js
Troothe/tictactoe
147edc11f25bad3bc75fefe6469b21f8b2bb82ca
[ "MIT" ]
null
null
null
app.js
Troothe/tictactoe
147edc11f25bad3bc75fefe6469b21f8b2bb82ca
[ "MIT" ]
null
null
null
let play_board = ["", "", "", "", "", "", "", "", ""]; const player = "O"; const computer = "X"; var playerstat = 0; var computerstat = 0; var drawstat = 0; let board_full = false; const render_board = () => { const board_container = document.querySelector(".play-area"); board_container.innerHTML = ""; document.getElementsByClassName("playerstat").innerText = playerstat; document.getElementsByClassName("computerstat").innerText = computerstat; document.getElementsByClassName("drawstat").innerText = drawstat; play_board.forEach((e,i) => { board_container.innerHTML += `<div id="block_${i}" class="block" onclick="addPlayerMove(${i})">${play_board[i]}</div>`; if(e == player || e == computer) { document.querySelector(`#block_${i}`).classList.add("occupied"); } }); }; FBInstant.initializeAsync() .then(function(){ var progress = 0; var interval = setInterval(function() { if(progress>=95){ clearInterval(interval); FBInstant.startGameAsync().then( function() { console.log("Game Loaded"); } ) }; FBInstant.setLoadingProgress(progress); progress += 5; }, 100); } ); render_board(); //setTimeout(render_board(), 3000); const checkBoardComplete = () => { let flag = true; play_board.forEach(element => { if(element == "") { flag = false; } }); board_full = flag; }; const game_loop = () => { render_board(); checkBoardComplete(); checkWinner(); } const randomizeStart = () => { if(play_board.every(item=> item==="")){ // const PLAYER = 0; const COMPUTER = 1; const start = Math.round(Math.random()); if(start === COMPUTER){ addComputerMove(); console.log("COMPUTER STARTED") }else{ console.log("PLAYER STARTS") }} } const addPlayerMove = e => { if (play_board[e] == "" && !board_full) { play_board[e] = player; game_loop(); addComputerMove(); } }; const addComputerMove = () => { if(!board_full){ let bestScore = -Infinity; let bestMove; for(let i = 0; i < play_board.length; i++){ if(play_board[i] == ""){ play_board[i] = computer; let score = minimax(play_board,0, false); play_board[i] = ""; if(score > bestScore){ bestScore = score; bestMove = i; } } } play_board[bestMove] = computer; game_loop(); } } let scores = {X : 1, O : -1, tie : 0}; const minimax = (board, depth, isMaximizing) => { let res = check_match(); if(res != ""){ return scores[res]; } if(isMaximizing){ let bestScore = -Infinity; for(let i = 0;i<board.length;i++){ if(board[i] == ""){ board[i] = computer; let score = minimax(board, depth + 1, false); board[i] = ""; bestScore = Math.max(score,bestScore); } } return bestScore; } else { let bestScore = Infinity; for(let i = 0;i<board.length;i++){ if(board[i] == ""){ board[i] = player; let score = minimax(board, depth + 1, true); board[i] = ""; bestScore = Math.min(score,bestScore); } } return bestScore; } } const checkWinner = () => { let res = check_match(); const winner_statement = document.getElementById("winner"); if (res == player) { winner_statement.innerText = "Player Won"; winner_statement.classList.add("playerWin"); board_full = true; playerstat++; document.getElementsByClassName("playerstat")[0].innerText = playerstat; document.getElementsByClassName("playerstat")[0].innerText = playerstat; console.log("player win"); } else if (res == computer) { winner_statement.innerText = "Computer Won"; winner_statement.classList.add("computerWin"); board_full = true; computerstat++; document.getElementsByClassName("computerstat")[0].innerText = computerstat; document.getElementsByClassName("computerstat")[1].innerText = computerstat; console.log("computer win"); } else if (board_full) { winner_statement.innerText = "Draw..."; winner_statement.classList.add("draw"); drawstat++; document.getElementsByClassName("drawstat")[0].innerText = drawstat; document.getElementsByClassName("drawstat")[1].innerText = drawstat; console.log("draw"); } }; const check_line = (a,b,c) => { let status = play_board[a] == play_board[b] && play_board[b] == play_board[c] && (play_board[a] == player || play_board[a] == computer); if (status) { document.getElementById(`block_${a}`).classList.add("won"); document.getElementById(`block_${b}`).classList.add("won"); document.getElementById(`block_${c}`).classList.add("won"); } return status; }; const check_match = () => { for (let i=0; i<9; i+=3) { if(check_line(i,i+1,i+2)) { return play_board[i]; } } for (let i=0; i<3; i++) { if(check_line(i, i+3, i+6)) { return play_board[i]; } } if(check_line(0,4,8)) { return play_board[0]; } if(check_line(2,4,6)) { return play_board[2]; } checkBoardComplete(); if(board_full) return "tie"; return ""; } const reset_board = () => { const winner_statement = document.getElementById("winner"); play_board = ["", "", "", "", "", "", "", "", ""]; board_full = false; winner_statement.classList.remove("playerWin"); winner_statement.classList.remove("computerWin"); winner_statement.classList.remove("draw"); winner_statement.innerText = ""; render_board(); randomizeStart(); } document.getElementsByClassName("playerstat").innerText = playerstat; document.getElementsByClassName("computerstat").innerText = computerstat; randomizeStart(); window.addEventListener("DOMContentLoaded", event => { const audio = document.querySelector("audio"); audio.volume = 0.2; audio.play(); }); // const checkbox = document.getElementById('checkbox'); // container-custom.addEventListener('onclick', () => { // // change the theme of the website // document.body.classList.toggle('dark'); // }); var button = document.getElementById("checkbox"); button.addEventListener("click", function() { const curColour = document.body.style.backgroundColor; if (curColour === 'white') { document.body.style.backgroundColor = "darkgray"; } else { document.body.style.backgroundColor = "white"; } });
28.654472
127
0.560505
28ac9c563e04984781db95d158dc69e5f409ac92
3,475
js
JavaScript
src/controllers/clients.js
SenteSol/finance-api
517e9de9cbd06872fa23546442cc31203d9c920d
[ "MIT" ]
null
null
null
src/controllers/clients.js
SenteSol/finance-api
517e9de9cbd06872fa23546442cc31203d9c920d
[ "MIT" ]
6
2021-08-06T14:46:43.000Z
2021-11-16T09:01:54.000Z
src/controllers/clients.js
SenteSol/finance-api
517e9de9cbd06872fa23546442cc31203d9c920d
[ "MIT" ]
null
null
null
import Clients from '../models/Clients'; import shortid from 'shortid'; import { decodeToken } from '../utils/decode-token'; class ClientController { static async getAllClients(req, res) { const clients = await Clients.find().sort({ createdAt: -1 }); if (clients.length === 0) { return res.status(200).json({ message: 'There are no clients in the system', }); } res.json(clients); } static async getClient(req, res) { const { id } = req.params; const client = await Clients.findOne({ clientId: id }); if (!client) { return res.status(400).json({ message: `There are no clients who exist with id: ${id}`, }); } res.json(client); } static async getClientByManager(req, res) { const decodedData = await decodeToken(req); const managerEmail = decodedData.email; const clients = await Clients.find({ managerEmail }).sort({ createdAt: -1, }); res.json(clients); } static async addClient(req, res) { const decodedData = await decodeToken(req); const managerEmail = decodedData.email; const { clientName, address, city, country, clientContactEmail, clientContactNumber, } = req.body; const existingClient = await Clients.findOne({ clientContactEmail }); if (existingClient) { return res.status(400).json({ message: `The email: ${clientContactEmail} has been registered, please use a different email or confirm it is a new client`, }); } const clientId = shortid.generate(); const newClient = new Clients({ clientId, clientName, address, managerEmail, city, country, clientContactEmail, clientContactNumber, }); const client = await newClient.save(); return res .status(201) .json({ client, message: 'You have added a client' }); } static async updateClient(req, res) { const decodedData = await decodeToken(req); const managerEmail = decodedData.email; const { id } = req.params; const checkExistingClient = await Clients.findOne({ clientId: id }); if (!checkExistingClient) { return res.status(400).json({ message: `There are no clients with id: ${id}`, }); } if (managerEmail !== checkExistingClient.managerEmail) { return res.status(400).json({ message: 'This admin does not manage this client', }); } await Object.assign(checkExistingClient, req.body); checkExistingClient.save(); return res.status(201).json({ checkExistingClient, message: 'You have updated the client', }); } static async deleteClient(req, res) { const { id } = req.params; const client = await Clients.findOne({ clientId: id }); if (!client) { return res.status(400).json({ message: `There are no loans disbursed with id: ${id}`, }); } await client.remove(); return res.status(204).json({}); } } export default ClientController;
31.590909
140
0.545324
28acc47a4f2787aa06e854a1cd852175abe70e47
824
js
JavaScript
app/js/helpers/persist.babel.js
ajhalls/Simple-Animation-Timeline
5e1483879a465574a537fa345e11bb764c1f66fc
[ "MIT" ]
105
2019-03-12T19:44:28.000Z
2022-03-26T17:57:41.000Z
app/js/helpers/persist.babel.js
ajhalls/Simple-Animation-Timeline
5e1483879a465574a537fa345e11bb764c1f66fc
[ "MIT" ]
1
2020-05-14T01:39:12.000Z
2020-05-14T01:39:12.000Z
app/js/helpers/persist.babel.js
ajhalls/Simple-Animation-Timeline
5e1483879a465574a537fa345e11bb764c1f66fc
[ "MIT" ]
22
2019-03-12T19:44:31.000Z
2021-11-05T19:34:27.000Z
import C from '../constants'; import addUnload from './add-unload'; /* Function to store state into localStorage on page `unload` and restore it on page `load`. @param {Object} Redux store. */ export default (store) => { if (C.IS_PERSIST_STATE) { // save to localstorage addUnload(()=> { const preState = store.getState(); try { localStorage.setItem(C.NAME, JSON.stringify( preState ) ); } catch (e) { console.error(e); } }); // load from localstorage try { const stored = localStorage.getItem(C.NAME); if ( stored ) { store.dispatch({ type: 'SET_APP_STATE', data: JSON.parse(stored) }); } } catch (e) { console.error(e); } } else { try { localStorage.removeItem(C.NAME); } catch (e) { console.error(e); } } };
24.969697
76
0.586165
28ad083ce38391b4a5232d1d6b109d542f109192
9,112
js
JavaScript
front_end/network_test_runner/network_test_runner.js
rakuco/devtools-frontend
a1bc5c9977751940a1857308f9e7c90100d5e790
[ "BSD-3-Clause" ]
2
2021-04-25T19:26:02.000Z
2022-01-13T00:36:50.000Z
front_end/network_test_runner/network_test_runner.js
rakuco/devtools-frontend
a1bc5c9977751940a1857308f9e7c90100d5e790
[ "BSD-3-Clause" ]
null
null
null
front_end/network_test_runner/network_test_runner.js
rakuco/devtools-frontend
a1bc5c9977751940a1857308f9e7c90100d5e790
[ "BSD-3-Clause" ]
null
null
null
// Copyright 2017 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. /** * @fileoverview using private properties isn't a Closure violation in tests. * @suppress {accessControls} */ self.NetworkTestRunner = self.NetworkTestRunner || {}; NetworkTestRunner.waitForRequestResponse = function(request) { if (request.responseReceivedTime !== -1) { return Promise.resolve(request); } return TestRunner.waitForEvent( SDK.NetworkManager.Events.RequestUpdated, TestRunner.networkManager, updateRequest => updateRequest === request && request.responseReceivedTime !== -1); }; NetworkTestRunner.waitForNetworkLogViewNodeForRequest = function(request) { const networkLogView = UI.panels.network._networkLogView; const node = networkLogView.nodeForRequest(request); if (node) { return Promise.resolve(node); } console.assert(networkLogView._staleRequests.has(request)); return TestRunner.addSnifferPromise(networkLogView, '_didRefreshForTest').then(() => { const node = networkLogView.nodeForRequest(request); console.assert(node); return node; }); }; NetworkTestRunner.waitForWebsocketFrameReceived = function(wsRequest, message) { for (const frame of wsRequest.frames()) { if (checkFrame(frame)) { return Promise.resolve(frame); } } return TestRunner.waitForEvent(SDK.NetworkRequest.Events.WebsocketFrameAdded, wsRequest, checkFrame); function checkFrame(frame) { return frame.type === SDK.NetworkRequest.WebSocketFrameType.Receive && frame.text === message; } }; NetworkTestRunner.recordNetwork = function() { UI.panels.network._networkLogView.setRecording(true); }; NetworkTestRunner.networkWaterfallColumn = function() { return UI.panels.network._networkLogView._columns._waterfallColumn; }; NetworkTestRunner.networkRequests = function() { return Array.from(SDK.NetworkLog.instance().requests()); }; NetworkTestRunner.dumpNetworkRequests = function() { const requests = NetworkTestRunner.networkRequests(); requests.sort(function(a, b) { return a.url().localeCompare(b.url()); }); TestRunner.addResult('resources count = ' + requests.length); for (i = 0; i < requests.length; i++) { TestRunner.addResult(requests[i].url()); } }; NetworkTestRunner.dumpNetworkRequestsWithSignedExchangeInfo = function() { for (const request of SDK.NetworkLog.instance().requests()) { TestRunner.addResult(`* ${request.url()}`); TestRunner.addResult(` failed: ${!!request.failed}`); TestRunner.addResult(` statusCode: ${request.statusCode}`); TestRunner.addResult(` resourceType: ${request.resourceType().name()}`); if (request.signedExchangeInfo()) { TestRunner.addResult(' SignedExchangeInfo'); if (request.signedExchangeInfo().header) { const header = request.signedExchangeInfo().header; TestRunner.addResult(` Request URL: ${header.requestUrl}`); for (const signature of header.signatures) { TestRunner.addResult(` Certificate URL: ${signature.certUrl}`); } } if (request.signedExchangeInfo().securityDetails) { const securityDetails = request.signedExchangeInfo().securityDetails; TestRunner.addResult(` Certificate Subject: ${securityDetails.subjectName}`); TestRunner.addResult(` Certificate Issuer: ${securityDetails.issuer}`); } if (request.signedExchangeInfo().errors) { for (const errorMessage of request.signedExchangeInfo().errors) { TestRunner.addResult(` Error: ${JSON.stringify(errorMessage)}`); } } } } }; NetworkTestRunner.findRequestsByURLPattern = function(urlPattern) { return NetworkTestRunner.networkRequests().filter(function(value) { return urlPattern.test(value.url()); }); }; NetworkTestRunner.makeSimpleXHR = function(method, url, async, callback) { NetworkTestRunner.makeXHR(method, url, async, undefined, undefined, [], false, undefined, undefined, callback); }; NetworkTestRunner.makeSimpleXHRWithPayload = function(method, url, async, payload, callback) { NetworkTestRunner.makeXHR(method, url, async, undefined, undefined, [], false, payload, undefined, callback); }; NetworkTestRunner.makeXHRWithTypedArrayPayload = function(method, url, async, payload, callback) { const args = {}; args.typedArrayPayload = new TextDecoder('utf-8').decode(payload); NetworkTestRunner.makeXHRImpl(method, url, async, args, callback); }; NetworkTestRunner.makeXHR = function( method, url, async, user, password, headers, withCredentials, payload, type, callback) { const args = {}; args.user = user; args.password = password; args.headers = headers; args.withCredentials = withCredentials; args.payload = payload; args.type = type; NetworkTestRunner.makeXHRImpl(method, url, async, args, callback); }; NetworkTestRunner.makeXHRImpl = function(method, url, async, args, callback) { args.method = method; args.url = TestRunner.url(url); args.async = async; const jsonArgs = JSON.stringify(args).replace(/\"/g, '\\"'); function innerCallback(msg) { if (msg.messageText.indexOf('XHR loaded') !== -1) { if (callback) { callback(); } } else { ConsoleTestRunner.addConsoleSniffer(innerCallback); } } ConsoleTestRunner.addConsoleSniffer(innerCallback); TestRunner.evaluateInPageAnonymously('makeXHRForJSONArguments("' + jsonArgs + '")'); }; NetworkTestRunner.makeFetch = function(url, requestInitializer, callback) { TestRunner.callFunctionInPageAsync('makeFetch', [url, requestInitializer]).then(callback); }; NetworkTestRunner.makeFetchInWorker = function(url, requestInitializer, callback) { TestRunner.callFunctionInPageAsync('makeFetchInWorker', [url, requestInitializer]).then(callback); }; NetworkTestRunner.clearNetworkCache = function() { // This turns cache off and then on, effectively clearning the memory cache. return Promise.all([ TestRunner.NetworkAgent.clearBrowserCache(), TestRunner.NetworkAgent.setCacheDisabled(true).then(() => TestRunner.NetworkAgent.setCacheDisabled(false)) ]); }; NetworkTestRunner.HARPropertyFormatters = { bodySize: 'formatAsTypeName', compression: 'formatAsTypeName', connection: 'formatAsTypeName', headers: 'formatAsTypeName', headersSize: 'formatAsTypeName', id: 'formatAsTypeName', onContentLoad: 'formatAsTypeName', onLoad: 'formatAsTypeName', receive: 'formatAsTypeName', startedDateTime: 'formatAsRecentTime', time: 'formatAsTypeName', timings: 'formatAsTypeName', version: 'formatAsTypeName', wait: 'formatAsTypeName', _transferSize: 'formatAsTypeName', _error: 'skip', _initiator: 'formatAsTypeName', _priority: 'formatAsTypeName' }; NetworkTestRunner.HARPropertyFormattersWithSize = JSON.parse(JSON.stringify(NetworkTestRunner.HARPropertyFormatters)); NetworkTestRunner.HARPropertyFormattersWithSize.size = 'formatAsTypeName'; TestRunner.deprecatedInitAsync(` let lastXHRIndex = 0; function xhrLoadedCallback() { console.log('XHR loaded: ' + ++lastXHRIndex); } function makeSimpleXHR(method, url, async, callback) { makeSimpleXHRWithPayload(method, url, async, null, callback); } function makeSimpleXHRWithPayload(method, url, async, payload, callback) { makeXHR(method, url, async, undefined, undefined, [], false, payload, undefined, callback); } function makeXHR(method, url, async, user, password, headers, withCredentials, payload, type, callback) { let xhr = new XMLHttpRequest(); if (type == undefined) xhr.responseType = ''; else xhr.responseType = type; xhr.onreadystatechange = function() { if (xhr.readyState === XMLHttpRequest.DONE) { if (typeof callback === 'function') callback(); } }; xhr.open(method, url, async, user, password); xhr.withCredentials = withCredentials; for (let i = 0; i < headers.length; ++i) xhr.setRequestHeader(headers[i][0], headers[i][1]); try { xhr.send(payload); } catch (e) {} } function makeXHRForJSONArguments(jsonArgs) { let args = JSON.parse(jsonArgs); let payload = args.payload; if (args.typedArrayPayload) payload = new TextEncoder('utf-8').encode(args.typedArrayPayload); makeXHR( args.method, args.url, args.async, args.user, args.password, args.headers || [], args.withCredentials, payload, args.type, xhrLoadedCallback ); } function makeFetch(url, requestInitializer) { return fetch(url, requestInitializer).then(res => { res.text(); return res; }).catch(e => e); } function makeFetchInWorker(url, requestInitializer) { return new Promise(resolve => { let worker = new Worker('/devtools/network/resources/fetch-worker.js'); worker.onmessage = event => { resolve(event.data); }; worker.postMessage({ url: url, init: requestInitializer }); }); } `);
32.312057
118
0.706102
28add5404b2acbb49c4b9aa8e9d9206e05638fc1
81,516
js
JavaScript
third_party/google_input_tools/src/chrome/os/inputview/_locales/all_i18n_messages_localized_with_data_de.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/google_input_tools/src/chrome/os/inputview/_locales/all_i18n_messages_localized_with_data_de.js
zealoussnow/chromium
fd8a8914ca0183f0add65ae55f04e287543c7d4a
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
395
2020-04-18T08:22:18.000Z
2021-12-08T13:04:49.000Z
third_party/google_input_tools/src/chrome/os/inputview/_locales/all_i18n_messages_localized_with_data_de.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
var emojiData={ "\ud83d\udec5": "LEFT LUGGAGE", "\ud83d\udec4": "BAGGAGE CLAIM", "\ud83c\udfe9": "LOVE HOTEL", "\ud83c\udfe8": "HOTEL", "\ud83c\udfeb": "SCHOOL", "\ud83c\udfea": "CONVENIENCE STORE", "\ud83c\udfed": "FACTORY", "\ud83c\udfec": "DEPARTMENT STORE", "\ud83c\udfef": "JAPANESE CASTLE", "\ud83c\udfee": "IZAKAYA LANTERN", "\ud83c\udfe1": "HOUSE WITH GARDEN", "\ud83c\udfe0": "HOUSE BUILDING", "\ud83c\udfe3": "Japanisches Postgeb\u00e4ude", "\ud83c\udfe2": "OFFICE BUILDING", "\ud83c\udfe5": "HOSPITAL", "\ud83c\udfe4": "Europ\u00e4isches Postgeb\u00e4ude", "\ud83c\udfe7": "AUTOMATED TELLER MACHINE", "\ud83c\udfe6": "BANK", "\ud83c\udff0": "EUROPEAN CASTLE", "\ud83c\udfc9": "RUGBY FOOTBALL", "\ud83c\udfc8": "AMERICAN FOOTBALL", "\ud83c\udfca": "SWIMMER", "\ud83c\udfc1": "CHEQUERED FLAG", "\ud83c\udfc0": "BASKETBALL AND HOOP", "\ud83c\udfc3": "RUNNER", "\ud83c\udfc2": "SNOWBOARDER", "\ud83c\udfc4": "SURFER", "\ud83c\udfc7": "HORSE RACING", "\ud83c\udfc6": "TROPHY", "\ud83d\udec1": "BATHTUB", "\ud83c\ude38": "Chinesisches Zeichen f\u00fcr \"Bewerbung\"", "\ud83c\ude39": "Japanisches Zeichen f\u00fcr \"Rabatt\"", "\ud83c\ude3a": "Chinesisches Zeichen f\u00fcr \"ge\u00f6ffnet\"", "\u26ce": "OPHIUCHUS", "\ud83c\ude34": "Chinesisches Zeichen f\u00fcr \"bestanden\"", "\ud83c\ude35": "Chinesisches Zeichen f\u00fcr \"voll\"", "\ud83c\ude36": "Japanisches Zeichen f\u00fcr \"Geb\u00fchren\"", "\ud83c\ude37": "Japanisches Zeichen f\u00fcr \"monatlich\"", "\u26c5": "SUN BEHIND CLOUD", "\u26c4": "SNOWMAN WITHOUT SNOW", "\ud83c\ude32": "Japanisches Zeichen f\u00fcr \"verboten\"", "\ud83c\ude33": "Chinesisches Zeichen f\u00fcr \"frei\"", "\ud83c\ude2f": "Japanisches Zeichen f\u00fcr \"reserviert\"", "\ud83d\udec0": "BATH", "\u26d4": "NO ENTRY", "\u26ea": "CHURCH", "\ud83c\ude1a": "Japanisches Zeichen f\u00fcr \"frei\"", "\u26fa": "TENT", "\u26fd": "FUEL PUMP", "\u26f3": "FLAG IN HOLE", "\u26f2": "FOUNTAIN", "\u26f5": "SAILBOAT", "\ud83c\ude01": "Japanisches Zeichen f\u00fcr \"hier\"", "\ud83c\ude02": "Japanisches Zeichen f\u00fcr \"Dienst\"", "\ud83d\udeaa": "DOOR", "\ud83d\udeab": "NO ENTRY SIGN", "\ud83d\udea8": "POLICE CARS REVOLVING LIGHT", "\ud83d\udea9": "TRIANGULAR FLAG ON POST", "\ud83d\udeae": "PUT LITTER IN ITS PLACE SYMBOL", "\ud83d\udeaf": "DO NOT LITTER SYMBOL", "\ud83d\udeac": "SMOKING SYMBOL", "\ud83d\udead": "NO SMOKING SYMBOL", "\ud83d\udea2": "SHIP", "\ud83d\udea3": "ROWBOAT", "\ud83d\udea0": "MOUNTAIN CABLEWAY", "\ud83d\udea1": "AERIAL TRAMWAY", "\ud83d\udea6": "Vertikale Verkehrsampel", "\ud83d\udea7": "CONSTRUCTION SIGN", "\ud83d\udea4": "SPEEDBOAT", "\ud83d\udea5": "Waagerechte Verkehrsampel", "\ud83d\udeba": "WOMENS SYMBOL", "\ud83d\udebb": "RESTROOM", "\ud83d\udeb8": "CHILDREN CROSSING", "\ud83d\udeb9": "MENS SYMBOL", "\ud83d\udebe": "WATER CLOSET", "\ud83d\udebf": "SHOWER", "\ud83d\udebc": "BABY SYMBOL", "\ud83d\udebd": "TOILET", "\ud83d\udeb2": "BICYCLE", "\ud83d\udeb3": "NO BICYCLES", "\ud83d\udeb0": "POTABLE WATER SYMBOL", "\ud83d\udeb1": "NON-POTABLE WATER SYMBOL", "\ud83d\udeb6": "PEDESTRIAN", "Actual data (in utf-8)": "DE TTS annotation - Long (use a comma \",\" to separate annotations) TTS = text to speech", "\ud83d\udeb4": "BICYCLIST", "\ud83d\udeb5": "MOUNTAIN BICYCLIST", "\ud83d\ude8a": "TRAM", "\ud83d\ude8b": "TRAM CAR", "\ud83d\ude88": "LIGHT RAIL", "\ud83d\ude89": "STATION", "\ud83d\ude8e": "TROLLEYBUS", "\ud83d\ude8f": "BUS STOP", "\ud83d\ude8c": "BUS", "\ud83d\ude8d": "ONCOMING BUS", "\ud83d\ude82": "STEAM LOCOMOTIVE", "\ud83d\ude83": "RAILWAY CAR", "\ud83d\ude80": "ROCKET", "\ud83d\ude81": "HELICOPTER", "\ud83d\ude86": "TRAIN", "\ud83d\ude87": "METRO", "\ud83d\ude84": "HIGH-SPEED TRAIN", "\ud83d\ude85": "Hochgeschwindigkeitszug mit runder Nase", "\ud83d\ude9a": "DELIVERY TRUCK", "\ud83d\ude9b": "ARTICULATED LORRY", "\ud83d\ude98": "ONCOMING AUTOMOBILE", "\ud83d\ude99": "RECREATIONAL VEHICLE", "\ud83d\ude9e": "MOUNTAIN RAILWAY", "\ud83d\ude9f": "SUSPENSION RAILWAY", "\ud83d\ude9c": "TRACTOR", "\ud83d\ude9d": "MONORAIL", "\ud83d\ude92": "FIRE ENGINE", "\ud83d\ude93": "POLICE CAR", "\ud83d\ude90": "MINIBUS", "\ud83d\ude91": "AMBULANCE", "\ud83d\ude96": "ONCOMING TAXI", "\ud83d\ude97": "AUTOMOBILE", "\ud83d\ude94": "ONCOMING POLICE CAR", "\ud83d\ude95": "TAXI", "\ud83d\udcfc": "VIDEOCASSETTE", "\ud83d\udcf9": "VIDEO CAMERA", "\ud83d\udcfb": "RADIO", "\ud83d\udcfa": "TELEVISION", "\ud83d\udcf5": "NO MOBILE PHONES", "\ud83d\udcf4": "MOBILE PHONE OFF", "\ud83d\udcf7": "CAMERA", "\ud83d\udcf6": "ANTENNA WITH BARS", "\ud83d\udcf1": "MOBILE PHONE", "\ud83d\udcf0": "NEWSPAPER", "\ud83d\udcf3": "VIBRATION MODE", "\ud83d\udcf2": "MOBILE PHONE WITH RIGHTWARDS ARROW AT LEFT", "\ud83d\udced": "Offener Briefkasten ohne Post", "\ud83d\udcec": "Offener Briefkasten mit Post", "\ud83d\udcef": "POSTAL HORN", "\ud83d\udcee": "POSTBOX", "\ud83d\udce9": "ENVELOPE WITH DOWNWARDS ARROW ABOVE", "\ud83d\udce8": "INCOMING ENVELOPE", "\ud83d\udceb": "Geschlossener Briefkasten mit Post", "\ud83d\udcea": "Geschlossener Briefkasten ohne Post", "\ud83d\udce5": "INBOX TRAY", "\ud83d\udce4": "OUTBOX TRAY", "\ud83d\udce7": "E-MAIL SYMBOL", "\ud83d\udce6": "PACKAGE", "\ud83d\udce1": "SATELLITE ANTENNA", "\ud83d\udce0": "FAX MACHINE", "\ud83d\udce3": "CHEERING MEGAPHONE", "\ud83d\udce2": "PUBLIC ADDRESS LOUDSPEAKER", "\ud83d\udcdd": "MEMO", "\ud83d\udcdc": "SCROLL", "\ud83d\udcdf": "PAGER", "\ud83d\udcde": "TELEPHONE RECEIVER", "\ud83d\udcd9": "ORANGE BOOK", "\ud83d\udcd8": "BLUE BOOK", "\ud83d\udcdb": "NAME BADGE", "\ud83d\udcda": "BOOKS", "\ud83d\udcd5": "CLOSED BOOK", "\ud83d\udcd4": "NOTEBOOK WITH DECORATIVE COVER", "\ud83d\udcd7": "GREEN BOOK", "\ud83d\udcd6": "OPEN BOOK", "\ud83d\udcd1": "BOOKMARK TABS", "\ud83d\udcd0": "TRIANGULAR RULER", "\ud83d\udcd3": "NOTEBOOK", "\ud83d\udcd2": "LEDGER", "\ud83d\udccd": "ROUND PUSHPIN", "\ud83d\udccc": "PUSHPIN", "\ud83d\udccf": "STRAIGHT RULER", "\ud83d\udcce": "PAPERCLIP", "\ud83d\udcc9": "CHART WITH DOWNWARDS TREND", "\ud83d\udcc8": "CHART WITH UPWARDS TREND", "\ud83d\udccb": "CLIPBOARD", "\ud83d\udcca": "BAR CHART", "\ud83d\udcc5": "CALENDAR", "\ud83d\udcc4": "PAGE FACING UP", "\ud83d\udcc7": "CARD INDEX", "\ud83d\udcc6": "TEAR-OFF CALENDAR", "\ud83d\udcc1": "FILE FOLDER", "\ud83d\udcc0": "DVD", "\ud83d\udcc3": "PAGE WITH CURL", "\ud83d\udcc2": "OPEN FILE FOLDER", "\u267f": "WHEELCHAIR SYMBOL", "\u23eb": "BLACK UP-POINTING DOUBLE TRIANGLE", "\ud83c\udf20": "SHOOTING STAR", "\ud83c\udf30": "CHESTNUT", "\ud83c\udf31": "SEEDLING", "\ud83c\udf32": "EVERGREEN TREE", "\ud83c\udf33": "DECIDUOUS TREE", "\ud83c\udf34": "PALM TREE", "\ud83c\udf35": "CACTUS", "\ud83c\udf37": "TULIP", "\ud83c\udf38": "CHERRY BLOSSOM", "\ud83c\udf39": "ROSE", "\ud83c\udf3a": "HIBISCUS", "\ud83c\udf3b": "SUNFLOWER", "\ud83c\udf3c": "BLOSSOM", "\ud83c\udf3d": "EAR OF MAIZE", "\ud83c\udf3e": "EAR OF RICE", "\ud83c\udf3f": "HERB", "\ud83c\udf00": "CYCLONE", "\ud83c\udf01": "FOGGY", "\ud83c\udf02": "CLOSED UMBRELLA", "\ud83c\udf03": "NIGHT WITH STARS", "\ud83c\udf04": "Sonnenaufgang \u00fcber den Bergen", "\ud83c\udf05": "SUNRISE", "\ud83c\udf06": "CITYSCAPE AT DUSK", "\ud83c\udf07": "SUNSET OVER BUILDINGS", "\ud83c\udf08": "RAINBOW", "\ud83c\udf09": "BRIDGE AT NIGHT", "\ud83c\udf0a": "WATER WAVE", "\ud83c\udf0b": "VOLCANO", "\ud83c\udf0c": "MILKY WAY", "\ud83c\udf0d": "Globus mit Europa und Afrika", "\ud83c\udf0e": "Globus mit Nord- und S\u00fcdamerika", "\ud83c\udf0f": "Globus mit Asien und Australien", "\ud83c\udf10": "Globus mit Meridianen", "\ud83c\udf11": "NEW MOON SYMBOL", "\ud83c\udf12": "Erstes Mondviertel", "\ud83c\udf13": "Zunehmender Halbmond", "\ud83c\udf14": "WAXING GIBBOUS MOON SYMBOL", "\ud83c\udf15": "FULL MOON SYMBOL", "\ud83c\udf16": "WANING GIBBOUS MOON SYMBOL", "\ud83c\udf17": "Abnehmender Halbmond", "\ud83c\udf18": "Letztes Mondviertel", "\ud83c\udf19": "CRESCENT MOON", "\ud83c\udf1a": "NEW MOON WITH FACE", "\ud83c\udf1b": "Erstes Mondviertel mit Gesicht", "\ud83c\udf1c": "Letztes Mondviertel mit Gesicht", "\ud83c\udf1d": "FULL MOON WITH FACE", "\ud83c\udf1e": "SUN WITH FACE", "\ud83c\udf1f": "GLOWING STAR", "\u2796": "HEAVY MINUS SIGN", "\u2797": "HEAVY DIVISION SIGN", "\u2795": "HEAVY PLUS SIGN", "\u26a0": "WARNING SIGN", "\u23ea": "BLACK LEFT-POINTING DOUBLE TRIANGLE", "\u27b0": "CURLY LOOP", "\ud83c\udd7f": "NEGATIVE SQUARED LATIN CAPITAL LETTER P", "\ud83c\udd7e": "NEGATIVE SQUARED LATIN CAPITAL LETTER O", "\ud83c\udd71": "NEGATIVE SQUARED LATIN CAPITAL LETTER B", "\ud83c\udd70": "NEGATIVE SQUARED LATIN CAPITAL LETTER A", "\u27bf": "DOUBLE CURLY LOOP", "\ud83d\uddfb": "MOUNT FUJI", "\ud83d\uddfd": "STATUE OF LIBERTY", "\ud83d\uddfc": "TOKYO TOWER", "\ud83d\uddff": "MOYAI", "\ud83d\uddfe": "SILHOUETTE OF JAPAN", "\u264c": "LEO", "\ud83d\udc34": "HORSE FACE", "\ud83d\udc35": "MONKEY FACE", "\ud83d\udc36": "DOG FACE", "\ud83d\udc37": "PIG FACE", "\ud83d\udc30": "RABBIT FACE", "\ud83d\udc31": "CAT FACE", "\ud83d\udc32": "DRAGON FACE", "\ud83d\udc33": "SPOUTING WHALE", "\ud83d\udc3c": "PANDA FACE", "\ud83d\udc3d": "PIG NOSE", "\ud83d\udc3e": "PAW PRINTS", "\ud83d\udc38": "FROG FACE", "\ud83d\udc39": "HAMSTER FACE", "\ud83d\udc3a": "WOLF FACE", "\ud83d\udc3b": "BEAR FACE", "\ud83d\udc24": "K\u00fckengesicht", "\ud83d\udc25": "FRONT-FACING BABY CHICK", "\ud83d\udc26": "BIRD", "\ud83d\udc27": "PENGUIN", "\ud83d\udc20": "TROPICAL FISH", "\ud83d\udc21": "BLOWFISH", "\ud83d\udc22": "TURTLE", "\ud83d\udc23": "HATCHING CHICK", "\ud83d\udc2c": "DOLPHIN", "\ud83d\udc2d": "MOUSE FACE", "\ud83d\udc2e": "COW FACE", "\ud83d\udc2f": "TIGER FACE", "\ud83d\udc28": "KOALA", "\ud83d\udc29": "POODLE", "\ud83d\udc2a": "DROMEDARY CAMEL", "\ud83d\udc2b": "BACTRIAN CAMEL", "\ud83d\udc14": "CHICKEN", "\ud83d\udc15": "DOG", "\ud83d\udc16": "PIG", "\ud83d\udc17": "BOAR", "\ud83d\udc10": "GOAT", "\ud83d\udc11": "SHEEP", "\ud83d\udc12": "MONKEY", "\ud83d\udc13": "ROOSTER", "\ud83d\udc1c": "ANT", "\ud83d\udc1d": "HONEYBEE", "\ud83d\udc1e": "LADY BEETLE", "\ud83d\udc1f": "FISH", "\ud83d\udc18": "ELEPHANT", "\ud83d\udc19": "OCTOPUS", "\ud83d\udc1a": "SPIRAL SHELL", "\ud83d\udc1b": "BUG", "\ud83d\udc04": "COW", "\ud83d\udc05": "TIGER", "\ud83d\udc06": "LEOPARD", "\ud83d\udc07": "RABBIT", "\ud83d\udc00": "RAT", "\ud83d\udc01": "MOUSE", "\ud83d\udc02": "OX", "\ud83d\udc03": "WATER BUFFALO", "\ud83d\udc0c": "SNAIL", "\ud83d\udc0d": "SNAKE", "\ud83d\udc0e": "HORSE", "\ud83d\udc0f": "RAM", "\ud83d\udc08": "CAT", "\ud83d\udc09": "DRAGON", "\ud83d\udc0a": "CROCODILE", "\ud83d\udc0b": "WHALE", "\u23ec": "BLACK DOWN-POINTING DOUBLE TRIANGLE", "\u2693": "ANCHOR", "\ud83c\ude51": "Chinesisches Zeichen f\u00fcr \"genehmigt\"", "\ud83c\ude50": "Japanisches Zeichen f\u00fcr \"Vorteil\"", "\u26be": "BASEBALL", "\u26bd": "SOCCER BALL", "\u2753": "Rotes Fragezeichen", "\u2755": "WHITE EXCLAMATION MARK ORNAMENT", "\u2754": "Helles Fragezeichen", "\u26a1": "HIGH VOLTAGE SIGN", "\u274e": "Umrandetes Kreuz", "\u274c": "CROSS MARK", "\u23e9": "BLACK RIGHT-POINTING DOUBLE TRIANGLE", "\ud83d\udd38": "Kleine orangefarbene Raute", "\ud83d\udd39": "Kleine blaue Raute", "\ud83d\udd3a": "UP-POINTING RED TRIANGLE", "\ud83d\udd3b": "DOWN-POINTING RED TRIANGLE", "\ud83d\udd3c": "Schaltfl\u00e4che \"Nach oben\"", "\ud83d\udd3d": "Schaltfl\u00e4che \"Nach unten\"", "\ud83d\udd30": "JAPANESE SYMBOL FOR BEGINNER", "\ud83d\udd31": "TRIDENT EMBLEM", "\ud83d\udd32": "Dunkel umrahmte quadratische Schaltfl\u00e4che", "\ud83d\udd33": "Hell umrahmte quadratische Schaltfl\u00e4che", "\ud83d\udd34": "Gro\u00dfer roter Kreis", "\ud83d\udd35": "Gro\u00dfer blauer Kreis", "\ud83d\udd36": "Gro\u00dfe orangefarbene Raute", "\ud83d\udd37": "Gro\u00dfe blaue Raute", "\ud83d\udd28": "HAMMER", "\ud83d\udd29": "NUT AND BOLT", "\ud83d\udd2a": "HOCHO", "\ud83d\udd2b": "PISTOL", "\ud83d\udd2c": "MICROSCOPE", "\ud83d\udd2d": "TELESCOPE", "\ud83d\udd2e": "CRYSTAL BALL", "\ud83d\udd2f": "SIX POINTED STAR WITH MIDDLE DOT", "\ud83d\udd20": "INPUT SYMBOL FOR LATIN CAPITAL LETTERS", "\ud83d\udd21": "INPUT SYMBOL FOR LATIN SMALL LETTERS", "\ud83d\udd22": "INPUT SYMBOL FOR NUMBERS", "\ud83d\udd23": "INPUT SYMBOL FOR SYMBOLS", "\ud83d\udd24": "INPUT SYMBOL FOR LATIN LETTERS", "\ud83d\udd25": "FIRE", "\ud83d\udd26": "ELECTRIC TORCH", "\ud83d\udd27": "WRENCH", "\ud83d\udd18": "RADIO BUTTON", "\ud83d\udd19": "BACK WITH LEFTWARDS ARROW ABOVE", "\ud83d\udd1a": "END WITH LEFTWARDS ARROW ABOVE", "\ud83d\udd1b": "ON WITH EXCLAMATION MARK WITH LEFT RIGHT ARROW ABOVE", "\ud83d\udd1c": "SOON WITH RIGHTWARDS ARROW ABOVE", "\ud83d\udd1d": "TOP WITH UPWARDS ARROW ABOVE", "\ud83d\udd1e": "NO ONE UNDER EIGHTEEN SYMBOL", "\ud83d\udd1f": "KEYCAP TEN", "\ud83d\udd10": "Schloss mit Schl\u00fcssel", "\ud83d\udd11": "KEY", "\ud83d\udd12": "Geschlossenes Schloss", "\ud83d\udd13": "Offenes Schloss", "\ud83d\udd14": "BELL", "\ud83d\udd15": "BELL WITH CANCELLATION STROKE", "\ud83d\udd16": "BOOKMARK", "\ud83d\udd17": "LINK SYMBOL", "\ud83d\udd08": "SPEAKER", "\ud83d\udd09": "Lautsprecher mit geringer Lautst\u00e4rke", "\ud83d\udd0a": "Lautsprecher mit hoher Lautst\u00e4rke", "\ud83d\udd0b": "BATTERY", "\ud83d\udd0c": "ELECTRIC PLUG", "\ud83d\udd0d": "Nach links gerichtete Lupe", "\ud83d\udd0e": "Nach rechts gerichtete Lupe", "\ud83d\udd0f": "Schloss mit F\u00fcller", "\ud83d\udd00": "TWISTED RIGHTWARDS ARROWS", "\ud83d\udd01": "CLOCKWISE RIGHTWARDS AND LEFTWARDS OPEN CIRCLE ARROWS", "\ud83d\udd02": "CLOCKWISE RIGHTWARDS AND LEFTWARDS OPEN CIRCLE ARROWS WITH CIRCLED ONE OVERLAY", "\ud83d\udd03": "CLOCKWISE DOWNWARDS AND UPWARDS OPEN CIRCLE ARROWS", "\ud83d\udd04": "ANTICLOCKWISE DOWNWARDS AND UPWARDS OPEN CIRCLE ARROWS", "\ud83d\udd05": "LOW BRIGHTNESS SYMBOL", "\ud83d\udd06": "HIGH BRIGHTNESS SYMBOL", "\ud83d\udd07": "SPEAKER WITH CANCELLATION STROKE", "\udbba\udc30": "KEYCAP 3", "\udbba\udc31": "KEYCAP 4", "\udbba\udc32": "KEYCAP 5", "\udbba\udc33": "KEYCAP 6", "\udbba\udc34": "KEYCAP 7", "\udbba\udc35": "KEYCAP 8", "\udbba\udc36": "KEYCAP 9", "\udbba\udc37": "KEYCAP 0", "\udbba\udc2c": "HASH KEY", "\udbba\udc2e": "KEYCAP 1", "\udbba\udc2f": "KEYCAP 2", "\ud83c\udf63": "SUSHI", "\ud83c\udf62": "ODEN", "\ud83c\udf61": "DANGO", "\ud83c\udf60": "ROASTED SWEET POTATO", "\ud83c\udf67": "SHAVED ICE", "\ud83c\udf66": "SOFT ICE CREAM", "\ud83c\udf65": "FISH CAKE WITH SWIRL DESIGN", "\ud83c\udf64": "FRIED SHRIMP", "\ud83c\udf6b": "CHOCOLATE BAR", "\ud83c\udf6a": "COOKIE", "\ud83c\udf69": "DOUGHNUT", "\ud83c\udf68": "ICE CREAM", "\ud83c\udf6f": "HONEY POT", "\ud83c\udf6e": "CUSTARD", "\ud83c\udf6d": "LOLLIPOP", "\ud83c\udf6c": "CANDY", "\ud83c\udf73": "COOKING", "\ud83c\udf72": "POT OF FOOD", "\ud83c\udf71": "BENTO BOX", "\ud83c\udf70": "SHORTCAKE", "\ud83c\udf77": "WINE GLASS", "\ud83c\udf76": "SAKE BOTTLE AND CUP", "\ud83c\udf75": "TEACUP WITHOUT HANDLE", "\ud83c\udf74": "FORK AND KNIFE", "\ud83c\udf7b": "CLINKING BEER MUGS", "\ud83c\udf7a": "BEER MUG", "\ud83c\udf79": "TROPICAL DRINK", "\ud83c\udf78": "COCKTAIL GLASS", "\ud83c\udf7c": "BABY BOTTLE", "\ud83c\udf43": "LEAF FLUTTERING IN WIND", "\ud83c\udf42": "FALLEN LEAF", "\ud83c\udf41": "MAPLE LEAF", "\ud83c\udf40": "FOUR LEAF CLOVER", "\ud83c\udf47": "GRAPES", "\ud83c\udf46": "AUBERGINE", "\ud83c\udf45": "TOMATO", "\ud83c\udf44": "MUSHROOM", "\ud83c\udf4b": "LEMON", "\ud83c\udf4a": "TANGERINE", "\ud83c\udf49": "WATERMELON", "\ud83c\udf48": "MELON", "\ud83c\udf4f": "GREEN APPLE", "\ud83c\udf4e": "RED APPLE", "\ud83c\udf4d": "PINEAPPLE", "\ud83c\udf4c": "BANANA", "\ud83c\udf53": "STRAWBERRY", "\ud83c\udf52": "CHERRIES", "\ud83c\udf51": "PEACH", "\ud83c\udf50": "PEAR", "\ud83c\udf57": "POULTRY LEG", "\ud83c\udf56": "MEAT ON BONE", "\ud83c\udf55": "SLICE OF PIZZA", "\ud83c\udf54": "HAMBURGER", "\ud83c\udf5b": "CURRY AND RICE", "\ud83c\udf5a": "COOKED RICE", "\ud83c\udf59": "RICE BALL", "\ud83c\udf58": "RICE CRACKER", "\ud83c\udf5f": "FRENCH FRIES", "\ud83c\udf5e": "BREAD", "\ud83c\udf5d": "SPAGHETTI", "\ud83c\udf5c": "STEAMING BOWL", "\ud83d\udec3": "CUSTOMS", "\u264f": "SCORPIUS", "\u264e": "LIBRA", "\u264d": "VIRGO", "\ud83d\udec2": "PASSPORT CONTROL", "\u264b": "CANCER", "\u264a": "GEMINI", "\u2649": "TAURUS", "\u2648": "ARIES", "\u2653": "PISCES", "\u2652": "AQUARIUS", "\u2651": "CAPRICORN", "\u2650": "SAGITTARIUS", "\ud83c\udd96": "SQUARED NG", "\ud83c\udd97": "SQUARED OK", "\ud83c\udd94": "SQUARED ID", "\ud83c\udd95": "SQUARED NEW", "\ud83c\udd92": "SQUARED COOL", "\ud83c\udd93": "SQUARED FREE", "\ud83c\udd91": "SQUARED CL", "\ud83c\udd9a": "SQUARED VS", "\ud83c\udd98": "SQUARED SOS", "\ud83c\udd99": "SQUARED UP WITH EXCLAMATION MARK", "\ud83c\udd8e": "NEGATIVE SQUARED AB", "\u267b": "BLACK UNIVERSAL RECYCLING SYMBOL", "\ud83d\ude2c": "GRIMACING FACE", "\ud83d\ude2d": "LOUDLY CRYING FACE", "\ud83d\ude2e": "FACE WITH OPEN MOUTH", "\ud83d\ude2f": "HUSHED FACE", "\ud83d\ude28": "FEARFUL FACE", "\ud83d\ude29": "WEARY FACE", "\ud83d\ude2a": "SLEEPY FACE", "\ud83d\ude2b": "TIRED FACE", "\ud83d\ude24": "FACE WITH LOOK OF TRIUMPH", "\ud83d\ude25": "DISAPPOINTED BUT RELIEVED FACE", "\ud83d\ude26": "FROWNING FACE WITH OPEN MOUTH", "\ud83d\ude27": "ANGUISHED FACE", "\ud83d\ude20": "ANGRY FACE", "\ud83d\ude21": "POUTING FACE", "\ud83d\ude22": "CRYING FACE", "\ud83d\ude23": "PERSEVERING FACE", "\ud83d\ude3c": "CAT FACE WITH WRY SMILE", "\ud83d\ude3d": "KISSING CAT FACE WITH CLOSED EYES", "\ud83d\ude3e": "POUTING CAT FACE", "\ud83d\ude3f": "CRYING CAT FACE", "\ud83d\ude38": "GRINNING CAT FACE WITH SMILING EYES", "\ud83d\ude39": "Katzen-Smiley mit Freudentr\u00e4nen", "\ud83d\ude3a": "SMILING CAT FACE WITH OPEN MOUTH", "\ud83d\ude3b": "SMILING CAT FACE WITH HEART-SHAPED EYES", "\ud83d\ude34": "SLEEPING FACE", "\ud83d\ude35": "DIZZY FACE", "\ud83d\ude36": "FACE WITHOUT MOUTH", "\ud83d\ude37": "FACE WITH MEDICAL MASK", "\ud83d\ude30": "FACE WITH OPEN MOUTH AND COLD SWEAT", "\ud83d\ude31": "FACE SCREAMING IN FEAR", "\ud83d\ude32": "ASTONISHED FACE", "\ud83d\ude33": "FLUSHED FACE", "\ud83d\ude0c": "RELIEVED FACE", "\ud83d\ude0d": "SMILING FACE WITH HEART-SHAPED EYES", "\ud83d\ude0e": "SMILING FACE WITH SUNGLASSES", "\ud83d\ude0f": "SMIRKING FACE", "\ud83d\ude08": "SMILING FACE WITH HORNS", "\ud83d\ude09": "WINKING FACE", "\ud83d\ude0a": "SMILING FACE WITH SMILING EYES", "\ud83d\ude0b": "FACE SAVOURING DELICIOUS FOOD", "\ud83d\ude04": "Lachender Smiley mit lachenden Augen", "\ud83d\ude05": "SMILING FACE WITH OPEN MOUTH AND COLD SWEAT", "\ud83d\ude06": "Lachender Smiley mit geschlossenen Augen", "\ud83d\ude07": "SMILING FACE WITH HALO", "\ud83d\ude00": "GRINNING FACE", "\ud83d\ude01": "Grinsender Smiley mit lachenden Augen", "\ud83d\ude02": "FACE WITH TEARS OF JOY", "\ud83d\ude03": "SMILING FACE WITH OPEN MOUTH", "\ud83d\ude1c": "Zwinkernder Smiley mit herausgestreckter Zunge", "\ud83d\ude1d": "FACE WITH STUCK-OUT TONGUE AND TIGHTLY-CLOSED EYES", "\ud83d\ude1e": "DISAPPOINTED FACE", "\ud83d\ude1f": "WORRIED FACE", "\ud83d\ude18": "FACE THROWING A KISS", "\ud83d\ude19": "KISSING FACE WITH SMILING EYES", "\ud83d\ude1a": "KISSING FACE WITH CLOSED EYES", "\ud83d\ude1b": "FACE WITH STUCK-OUT TONGUE", "\ud83d\ude14": "PENSIVE FACE", "\ud83d\ude15": "CONFUSED FACE", "\ud83d\ude16": "CONFOUNDED FACE", "\ud83d\ude17": "KISSING FACE", "\ud83d\ude10": "NEUTRAL FACE", "\ud83d\ude11": "EXPRESSIONLESS FACE", "\ud83d\ude12": "UNAMUSED FACE", "\ud83d\ude13": "FACE WITH COLD SWEAT", "\ud83d\udc77": "CONSTRUCTION WORKER", "\ud83d\udc76": "BABY", "\ud83d\udc75": "OLDER WOMAN", "\ud83d\udc74": "OLDER MAN", "\ud83d\udc73": "Mann mit Turban", "\ud83d\udc72": "Mann mit chinesischem Hut", "\ud83d\udc71": "PERSON WITH BLOND HAIR", "\ud83d\udc70": "BRIDE WITH VEIL", "\ud83d\udc7f": "IMP", "\ud83d\udc7e": "ALIEN MONSTER", "\ud83d\udc7d": "EXTRATERRESTRIAL ALIEN", "\ud83d\udc7c": "BABY ANGEL", "\ud83d\udc7b": "GHOST", "\ud83d\udc7a": "JAPANESE GOBLIN", "\ud83d\udc79": "JAPANESE OGRE", "\ud83d\udc78": "PRINCESS", "\ud83d\udc67": "GIRL", "\ud83d\udc66": "BOY", "\ud83d\udc65": "BUSTS IN SILHOUETTE", "\ud83d\udc64": "BUST IN SILHOUETTE", "\ud83d\udc63": "FOOTPRINTS", "\ud83d\udc62": "WOMANS BOOTS", "\ud83d\udc61": "WOMANS SANDAL", "\ud83d\udc60": "HIGH-HEELED SHOE", "\ud83d\udc6f": "WOMAN WITH BUNNY EARS", "\ud83d\udc6e": "POLICE OFFICER", "\ud83d\udc6d": "TWO WOMEN HOLDING HANDS", "\ud83d\udc6c": "TWO MEN HOLDING HANDS", "\ud83d\udc6b": "MAN AND WOMAN HOLDING HANDS", "\ud83d\udc6a": "FAMILY", "\ud83d\udc69": "WOMAN", "\ud83d\udc68": "MAN", "\ud83d\udc57": "DRESS", "\ud83d\udc56": "JEANS", "\ud83d\udc55": "T-SHIRT", "\ud83d\udc54": "NECKTIE", "\ud83d\udc53": "EYEGLASSES", "\ud83d\udc52": "WOMANS HAT", "\ud83d\udc51": "CROWN", "\ud83d\udc50": "OPEN HANDS SIGN", "\ud83d\udc5f": "ATHLETIC SHOE", "\ud83d\udc5e": "MANS SHOE", "\ud83d\udc5d": "POUCH", "\ud83d\udc5c": "HANDBAG", "\ud83d\udc5b": "PURSE", "\ud83d\udc5a": "WOMANS CLOTHES", "\ud83d\udc59": "BIKINI", "\ud83d\udc58": "KIMONO", "\ud83d\udc47": "WHITE DOWN POINTING BACKHAND INDEX", "\ud83d\udc46": "WHITE UP POINTING BACKHAND INDEX", "\ud83d\udc45": "TONGUE", "\ud83d\udc44": "MOUTH", "\ud83d\udc43": "NOSE", "\ud83d\udc42": "EAR", "\ud83d\udc40": "EYES", "\ud83d\udc4f": "CLAPPING HANDS SIGN", "\ud83d\udc4e": "THUMBS DOWN SIGN", "\ud83d\udc4d": "THUMBS UP SIGN", "\ud83d\udc4c": "Handzeichen f\u00fcr \"OK\"", "\ud83d\udc4b": "WAVING HAND SIGN", "\ud83d\udc4a": "FISTED HAND SIGN", "\ud83d\udc49": "WHITE RIGHT POINTING BACKHAND INDEX", "\ud83d\udc48": "WHITE LEFT POINTING BACKHAND INDEX", "\u23f0": "ALARM CLOCK", "\u23f3": "HOURGLASS WITH FLOWING SAND", "\u00ae": "REGISTERED SIGN", "\u00a9": "COPYRIGHT SIGN", "\ud83d\udeb7": "NO PEDESTRIANS", "\ud83c\udccf": "PLAYING CARD BLACK JOKER", "\u270a": "RAISED FIST", "\u270b": "RAISED HAND", "\u270c": "VICTORY HAND", "\u2705": "WHITE HEAVY CHECK MARK", "\u2728": "SPARKLES", "\ud83d\udd63": "CLOCK FACE EIGHT-THIRTY", "\ud83d\udd62": "CLOCK FACE SEVEN-THIRTY", "\ud83d\udd61": "CLOCK FACE SIX-THIRTY", "\ud83d\udd60": "CLOCK FACE FIVE-THIRTY", "\ud83d\udd67": "CLOCK FACE TWELVE-THIRTY", "\ud83d\udd66": "CLOCK FACE ELEVEN-THIRTY", "\ud83d\udd65": "CLOCK FACE TEN-THIRTY", "\ud83d\udd64": "CLOCK FACE NINE-THIRTY", "\ud83d\udd5b": "CLOCK FACE TWELVE OCLOCK", "\ud83d\udd5a": "CLOCK FACE ELEVEN OCLOCK", "\ud83d\udd59": "CLOCK FACE TEN OCLOCK", "\ud83d\udd58": "CLOCK FACE NINE OCLOCK", "\ud83d\udd5f": "CLOCK FACE FOUR-THIRTY", "\ud83d\udd5e": "CLOCK FACE THREE-THIRTY", "\ud83d\udd5d": "CLOCK FACE TWO-THIRTY", "\ud83d\udd5c": "CLOCK FACE ONE-THIRTY", "\ud83d\udd53": "CLOCK FACE FOUR OCLOCK", "\ud83d\udd52": "CLOCK FACE THREE OCLOCK", "\ud83d\udd51": "CLOCK FACE TWO OCLOCK", "\ud83d\udd50": "CLOCK FACE ONE OCLOCK", "\ud83d\udd57": "CLOCK FACE EIGHT OCLOCK", "\ud83d\udd56": "CLOCK FACE SEVEN OCLOCK", "\ud83d\udd55": "CLOCK FACE SIX OCLOCK", "\ud83d\udd54": "CLOCK FACE FIVE OCLOCK", "\ud83c\udfae": "VIDEO GAME", "\ud83c\udfaf": "DIRECT HIT", "\ud83c\udfac": "CLAPPER BOARD", "\ud83c\udfad": "PERFORMING ARTS", "\ud83c\udfaa": "CIRCUS TENT", "\ud83c\udfab": "TICKET", "\ud83c\udfa8": "ARTIST PALETTE", "\ud83c\udfa9": "TOP HAT", "\ud83c\udfa6": "CINEMA", "\ud83c\udfa7": "HEADPHONE", "\ud83c\udfa4": "MICROPHONE", "\ud83c\udfa5": "MOVIE CAMERA", "\ud83c\udfa2": "ROLLER COASTER", "\ud83c\udfa3": "FISHING POLE AND FISH", "\ud83c\udfa0": "CAROUSEL HORSE", "\ud83c\udfa1": "FERRIS WHEEL", "\ud83c\udfbe": "TENNIS RACQUET AND BALL", "\ud83c\udfbf": "SKI AND SKI BOOT", "\ud83c\udfbc": "MUSICAL SCORE", "\ud83c\udfbd": "RUNNING SHIRT WITH SASH", "\ud83c\udfba": "TRUMPET", "\ud83c\udfbb": "VIOLIN", "\ud83c\udfb8": "GUITAR", "\ud83c\udfb9": "MUSICAL KEYBOARD", "\ud83c\udfb6": "MULTIPLE MUSICAL NOTES", "\ud83c\udfb7": "SAXOPHONE", "\ud83c\udfb4": "FLOWER PLAYING CARDS", "\ud83c\udfb5": "MUSICAL NOTE", "\ud83c\udfb2": "GAME DIE", "\ud83c\udfb3": "BOWLING", "\ud83c\udfb0": "SLOT MACHINE", "\ud83c\udfb1": "BILLIARDS", "\ud83c\udf8e": "JAPANESE DOLLS", "\ud83c\udf8f": "CARP STREAMER", "\ud83c\udf8c": "CROSSED FLAGS", "\ud83c\udf8d": "PINE DECORATION", "\ud83c\udf8a": "CONFETTI BALL", "\ud83c\udf8b": "TANABATA TREE", "\ud83c\udf88": "BALLOON", "\ud83c\udf89": "PARTY POPPER", "\ud83c\udf86": "FIREWORKS", "\ud83c\udf87": "FIREWORK SPARKLER", "\ud83c\udf84": "CHRISTMAS TREE", "\ud83c\udf85": "FATHER CHRISTMAS", "\ud83c\udf82": "BIRTHDAY CAKE", "\ud83c\udf83": "JACK-O-LANTERN", "\ud83c\udf80": "RIBBON", "\ud83c\udf81": "WRAPPED PRESENT", "\ud83c\udf92": "SCHOOL SATCHEL", "\ud83c\udf93": "GRADUATION CAP", "\ud83c\udf90": "WIND CHIME", "\ud83c\udf91": "MOON VIEWING CEREMONY", "\ud83c\uddf1": "Do not translate", "\ud83c\uddf0": "Do not translate", "\ud83c\uddf3": "Do not translate", "\ud83c\uddf2": "Do not translate", "\ud83c\uddf5": "Do not translate", "\ud83c\uddf4": "Do not translate", "\ud83c\uddf7": "Do not translate", "\ud83c\uddf6": "Do not translate", "\ud83c\uddf9": "Do not translate", "\ud83c\uddf8": "Do not translate", "\ud83c\uddfb": "Do not translate", "\ud83c\uddfa": "Do not translate", "\ud83c\uddfd": "Do not translate", "\ud83c\uddfc": "Do not translate", "\ud83c\uddff": "Do not translate", "\ud83c\uddfe": "Do not translate", "\ud83c\udde7": "Do not translate", "\ud83c\udde6": "Do not translate", "\ud83c\udde9": "Do not translate", "\ud83c\udde8": "Do not translate", "\ud83c\uddeb": "Do not translate", "\ud83c\uddea": "Do not translate", "\ud83c\udded": "Do not translate", "\ud83c\uddec": "Do not translate", "\ud83c\uddef": "Do not translate", "\ud83c\uddee": "Do not translate", "\u231a": "WATCH", "\u231b": "HOURGLASS", "\udbb9\udce7": "REGIONAL INDICATOR SYMBOL LETTERS FR", "\udbb9\udce6": "REGIONAL INDICATOR SYMBOL LETTERS US", "\udbb9\udce9": "REGIONAL INDICATOR SYMBOL LETTERS IT", "\udbb9\udce8": "REGIONAL INDICATOR SYMBOL LETTERS DE", "\udbb9\udceb": "REGIONAL INDICATOR SYMBOL LETTERS ES", "\udbb9\udcea": "REGIONAL INDICATOR SYMBOL LETTERS GB", "\udbb9\udced": "REGIONAL INDICATOR SYMBOL LETTERS CN", "\udbb9\udcec": "REGIONAL INDICATOR SYMBOL LETTERS RU", "\u263a": "Lachender Smiley", "\udbb9\udcee": "REGIONAL INDICATOR SYMBOL LETTERS KR", "\ud83c\udc04": "MAHJONG TILE RED DRAGON", "\u20e3": "Do not translate", "\ud83d\ude4f": "PERSON WITH FOLDED HANDS", "\ud83d\ude4e": "PERSON WITH POUTING FACE", "\ud83d\ude4d": "Stirnrunzelnde Frau", "\ud83d\ude4c": "PERSON RAISING BOTH HANDS IN CELEBRATION", "\ud83d\ude4b": "HAPPY PERSON RAISING ONE HAND", "\ud83d\ude4a": "SPEAK-NO-EVIL MONKEY", "\ud83d\ude49": "HEAR-NO-EVIL MONKEY", "\ud83d\ude48": "SEE-NO-EVIL MONKEY", "\ud83d\ude47": "PERSON BOWING DEEPLY", "\ud83d\ude46": "FACE WITH OK GESTURE", "\ud83d\ude45": "FACE WITH NO GOOD GESTURE", "\u3030": "WAVY DASH", "\ud83d\ude40": "WEARY CAT FACE", "\ud83d\udcb2": "HEAVY DOLLAR SIGN", "\ud83d\udcb3": "CREDIT CARD", "\ud83d\udcb0": "MONEY BAG", "\ud83d\udcb1": "CURRENCY EXCHANGE", "\ud83d\udcb6": "BANKNOTE WITH EURO SIGN", "\ud83d\udcb7": "BANKNOTE WITH POUND SIGN", "\ud83d\udcb4": "BANKNOTE WITH YEN SIGN", "\ud83d\udcb5": "BANKNOTE WITH DOLLAR SIGN", "\ud83d\udcba": "SEAT", "\ud83d\udcbb": "PERSONAL COMPUTER", "\ud83d\udcb8": "MONEY WITH WINGS", "\ud83d\udcb9": "CHART WITH UPWARDS TREND AND YEN SIGN", "\ud83d\udcbe": "FLOPPY DISK", "\ud83d\udcbf": "OPTICAL DISC", "\ud83d\udcbc": "BRIEFCASE", "\ud83d\udcbd": "Minidisk", "\ud83d\udca2": "ANGER SYMBOL", "\ud83d\udca3": "BOMB", "\ud83d\udca0": "DIAMOND SHAPE WITH A DOT INSIDE", "\ud83d\udca1": "ELECTRIC LIGHT BULB", "\ud83d\udca6": "SPLASHING SWEAT SYMBOL", "\ud83d\udca7": "DROPLET", "\ud83d\udca4": "Symbol f\u00fcr Schlaf", "\ud83d\udca5": "COLLISION SYMBOL", "\ud83d\udcaa": "FLEXED BICEPS", "\ud83d\udcab": "DIZZY SYMBOL", "\ud83d\udca8": "DASH SYMBOL", "\ud83d\udca9": "PILE OF POO", "\ud83d\udcae": "WHITE FLOWER", "\ud83d\udcaf": "HUNDRED POINTS SYMBOL", "\ud83d\udcac": "SPEECH BALLOON", "\ud83d\udcad": "THOUGHT BALLOON", "\ud83d\udc92": "WEDDING", "\ud83d\udc93": "BEATING HEART", "\ud83d\udc90": "BOUQUET", "\ud83d\udc91": "COUPLE WITH HEART", "\ud83d\udc96": "SPARKLING HEART", "\ud83d\udc97": "GROWING HEART", "\ud83d\udc94": "BROKEN HEART", "\ud83d\udc95": "TWO HEARTS", "\ud83d\udc9a": "GREEN HEART", "\ud83d\udc9b": "YELLOW HEART", "\ud83d\udc98": "HEART WITH ARROW", "\ud83d\udc99": "BLUE HEART", "\ud83d\udc9e": "REVOLVING HEARTS", "\ud83d\udc9f": "HEART DECORATION", "\ud83d\udc9c": "PURPLE HEART", "\ud83d\udc9d": "HEART WITH RIBBON", "\ud83d\udc82": "GUARDSMAN", "\ud83d\udc83": "DANCER", "\ud83d\udc80": "SKULL", "\ud83d\udc81": "INFORMATION DESK PERSON", "\ud83d\udc86": "FACE MASSAGE", "\ud83d\udc87": "HAIRCUT", "\ud83d\udc84": "LIPSTICK", "\ud83d\udc85": "NAIL POLISH", "\ud83d\udc8a": "PILL", "\ud83d\udc8b": "KISS MARK", "\ud83d\udc88": "BARBER POLE", "\ud83d\udc89": "SYRINGE", "\ud83d\udc8e": "GEM STONE", "\ud83d\udc8f": "KISS", "\ud83d\udc8c": "LOVE LETTER", "\ud83d\udc8d": "RING", "\u2601": "CLOUD", "\u2122": "TRADE MARK SIGN" };var goog$typeOf=function $goog$typeOf$(value){var s=typeof value;if("object"==s)if(value){if(value instanceof Array)return"array";if(value instanceof Object)return s;var className=Object.prototype.toString.call(value);if("[object Window]"==className)return"object";if("[object Array]"==className||"number"==typeof value.length&&"undefined"!=typeof value.splice&&"undefined"!=typeof value.propertyIsEnumerable&&!value.propertyIsEnumerable("splice"))return"array";if("[object Function]"==className||"undefined"!= typeof value.call&&"undefined"!=typeof value.propertyIsEnumerable&&!value.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"==s&&"undefined"==typeof value.call)return"object";return s};var goog$json$Serializer=function $goog$json$Serializer$(opt_replacer){this.replacer_=opt_replacer};goog$json$Serializer.prototype.serialize=function $goog$json$Serializer$$serialize$(object){var sb=[];JSCompiler_StaticMethods_serializeInternal(this,object,sb);return sb.join("")}; var JSCompiler_StaticMethods_serializeInternal=function $JSCompiler_StaticMethods_serializeInternal$(JSCompiler_StaticMethods_serializeInternal$self,object,sb){if(null==object)sb.push("null");else{if("object"==typeof object){if("array"==goog$typeOf(object)){var arr=object,l=arr.length;sb.push("[");for(var sep="",i=0;i<l;i++){sb.push(sep);var value=arr[i];JSCompiler_StaticMethods_serializeInternal(JSCompiler_StaticMethods_serializeInternal$self,JSCompiler_StaticMethods_serializeInternal$self.replacer_? JSCompiler_StaticMethods_serializeInternal$self.replacer_.call(arr,String(i),value):value,sb);sep=","}sb.push("]");return}if(object instanceof String||object instanceof Number||object instanceof Boolean)object=object.valueOf();else{var obj=object;sb.push("{");var sep$$0="",key;for(key in obj)if(Object.prototype.hasOwnProperty.call(obj,key)){var value$$0=obj[key];"function"!=typeof value$$0&&(sb.push(sep$$0),JSCompiler_StaticMethods_serializeString_(key,sb),sb.push(":"),JSCompiler_StaticMethods_serializeInternal(JSCompiler_StaticMethods_serializeInternal$self, JSCompiler_StaticMethods_serializeInternal$self.replacer_?JSCompiler_StaticMethods_serializeInternal$self.replacer_.call(obj,key,value$$0):value$$0,sb),sep$$0=",")}sb.push("}");return}}switch(typeof object){case "string":JSCompiler_StaticMethods_serializeString_(object,sb);break;case "number":sb.push(isFinite(object)&&!isNaN(object)?String(object):"null");break;case "boolean":sb.push(String(object));break;case "function":sb.push("null");break;default:throw Error("Unknown type: "+typeof object);}}}, goog$json$Serializer$charToJsonCharCache_={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},goog$json$Serializer$charsToReplace_=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g,JSCompiler_StaticMethods_serializeString_=function $JSCompiler_StaticMethods_serializeString_$(s,sb){sb.push('"',s.replace(goog$json$Serializer$charsToReplace_,function(c){var rv=goog$json$Serializer$charToJsonCharCache_[c];rv||(rv="\\u"+ (c.charCodeAt(0)|65536).toString(16).substr(1),goog$json$Serializer$charToJsonCharCache_[c]=rv);return rv}),'"')};var emojiMsgs={MSG_D83D_DE02:"tears of joy",MSG_D83D_DE12:"unamused",MSG_D83D_DE0D:"smiling face",MSG_D83D_DC4C:"OK hand sign",MSG_D83D_DE18:"throwing kisses",MSG_D83D_DE0A:"smile",MSG_D83D_DE14:"pensive face",MSG_D83D_DE0F:"smirk",MSG_D83D_DE29:"weary",MSG_D83D_DE01:" grin with smiling eyes",MSG_D83D_DE2D:"loudly crying",MSG_D83D_DE33:"flushed",MSG_D83D_DC95:"two hearts",MSG_D83D_DC4D:"thumbs up",MSG_D83D_DE09:"winking face",MSG_D83D_DC81:"information desk",MSG_D83D_DE4C:"hooray",MSG_D83D_DE0C:"relieved face", MSG_D83D_DE0E:"cool",MSG_D83D_DE48:"see no evil",MSG_D83D_DE11:"expressionless",MSG_D83D_DE1C:"tongue out with a wink",MSG_D83D_DE0B:"yummy face",MSG_D83D_DE1E:"disappointed",MSG_D83D_DE4F:"folded hands",MSG_D83D_DE04:"open mouth smile with smiling eyes",MSG_D83D_DE4A:"speak no evil",MSG_D83D_DE15:"confused face",MSG_D83D_DE21:"pouting",MSG_D83D_DC4F:"hands clapping",MSG_D83D_DE22:"crying",MSG_D83D_DE34:"sleeping",MSG_D83D_DC40:"eyes",MSG_D83D_DE10:"deadpan face",MSG_D83D_DE31:"fearful face",MSG_D83D_DE2B:"tired", MSG_D83D_DE1D:"yuck",MSG_D83D_DC9C:"purple heart",MSG_D83D_DC94:"heart break",MSG_D83D_DC8B:"kiss mark",MSG_D83D_DE03:"open mouth smile",MSG_D83D_DE2A:"sleepy",MSG_D83D_DE23:"blew it",MSG_D83D_DC99:"blue heart",MSG_D83D_DE24:"look of triumph",MSG_D83D_DC4B:"hand waving",MSG_D83D_DC4A:"clenched fist",MSG_D83D_DE37:"face with mask",MSG_D83D_DE20:"angry",MSG_D83D_DE16:"confounded face",MSG_D83D_DE2C:"grimace",MSG_D83D_DC97:"growing heart",MSG_D83D_DE45:"No good gesture",MSG_D83D_DE08:"smile with horns", MSG_D83D_DE05:"cold sweat smile",MSG_D83D_DC4E:"thumbs down",MSG_D83D_DE25:"whew!",MSG_D83D_DE4B:"happy person",MSG_D83D_DE06:" open mouth smile with closed eyes",MSG_D83D_DE13:"cold sweat",MSG_D83D_DCAA:"biceps",MSG_D83D_DC96:"sparkling heart",MSG_D83D_DE36:"no mouth face",MSG_D83D_DE1A:"kissing",MSG_D83D_DC9B:"yellow heart",MSG_D83D_DC9A:"green heart",MSG_D83D_DE1B:"tongue out",MSG_D83D_DC83:"dancer",MSG_D83D_DC9E:"revolving hearts",MSG_D83D_DE00:"grin",MSG_D83D_DE30:"rushed face",MSG_D83D_DCA9:"poop", MSG_D83D_DC98:"heart and arrow",MSG_D83D_DE07:"smile with a halo",MSG_D83D_DE2F:"hushed face",MSG_D83D_DE2E:"open mouth face",MSG_D83D_DE26:"frowning face",MSG_D83D_DE27:"anguished",MSG_D83D_DE28:"fearful",MSG_D83D_DE1F:"worried",MSG_D83D_DE32:"astonished face",MSG_D83D_DE35:"dizzy",MSG_D83D_DE17:"kissy face",MSG_D83D_DE19:"kiss and smile",MSG_D83D_DE4D:"frowning person",MSG_D83D_DE46:"OK gesture",MSG_D83D_DE47:"i'm sorry",MSG_D83D_DE4E:"pouting",MSG_D83D_DE3A:"smiling cat face",MSG_D83D_DE3C:"wry cat face", MSG_D83D_DE38:"grinning cat face",MSG_D83D_DE39:"tears of joy cat face",MSG_D83D_DE3B:"smiling cat face",MSG_D83D_DE3D:"kissing cat",MSG_D83D_DE3F:"crying cat face",MSG_D83D_DE3E:"pouting cat face",MSG_D83D_DE40:"weary cat face",MSG_D83D_DE49:"hear no evil",MSG_D83D_DC76:"baby",MSG_D83D_DC66:"boy",MSG_D83D_DC67:"girl",MSG_D83D_DC68:"man",MSG_D83D_DC69:"woman",MSG_D83D_DC74:"older man",MSG_D83D_DC75:"older woman",MSG_D83D_DC8F:"kiss",MSG_D83D_DC91:"couple",MSG_D83D_DC6A:"family",MSG_D83D_DC6B:"man and woman", MSG_D83D_DC6C:"two men",MSG_D83D_DC6D:"two women",MSG_D83D_DC64:"bust in silhouette",MSG_D83D_DC65:"busts in silhouette",MSG_D83D_DC6E:"police officer",MSG_D83D_DC77:"construction worker",MSG_D83D_DC82:"guardsman",MSG_D83D_DC6F:"bunny girl",MSG_D83D_DC70:"bride",MSG_D83D_DC78:"princess",MSG_D83C_DF85:"santa",MSG_D83D_DC7C:"baby angel",MSG_D83D_DC71:"blond person",MSG_D83D_DC72:"man with gua pi mao",MSG_D83D_DC73:"man with a turban",MSG_D83D_DC86:"face massage",MSG_D83D_DC87:"haircut",MSG_D83D_DC85:"nail care", MSG_D83D_DC7B:"ghost",MSG_D83D_DC79:"ogre",MSG_D83D_DC7A:"goblin",MSG_D83D_DC7D:"alien",MSG_D83D_DC7E:"alien monster",MSG_D83D_DC7F:"imp",MSG_D83D_DC80:"skull",MSG_D83D_DC42:"ear",MSG_D83D_DC43:"nose",MSG_D83D_DC63:"footprint",MSG_D83D_DC44:"mouth",MSG_D83D_DC45:"tongue",MSG_D83D_DC93:"pulsating heart",MSG_D83D_DC9D:"heart with ribbon",MSG_D83D_DC9F:"heart decoration",MSG_D83D_DC46:"up finger",MSG_D83D_DC47:"down finger",MSG_D83D_DC48:"left finger",MSG_D83D_DC49:"right finger",MSG_D83D_DC50:"open hands", MSG_D83D_DD30:"green and yellow leaf",MSG_D83D_DC84:"lipstick",MSG_D83D_DC5E:"man's shoe",MSG_D83D_DC5F:"athletic shoe",MSG_D83D_DC51:"crown",MSG_D83D_DC52:"woman's hat",MSG_D83C_DFA9:"top hat",MSG_D83C_DF93:"graduation cap",MSG_D83D_DC53:"eyeglasses",MSG_D83D_DC54:"necktie",MSG_D83D_DC55:"T-shirt",MSG_D83D_DC56:"trousers",MSG_D83D_DC57:"dress",MSG_D83D_DC58:"kimono",MSG_D83D_DC59:"bikini",MSG_D83D_DC60:"high-heel",MSG_D83D_DC61:"woman's sandal",MSG_D83D_DC62:"woman's boot",MSG_D83D_DC5A:"woman's clothes", MSG_D83D_DC5C:"handbag",MSG_D83D_DCBC:"briefcase",MSG_D83C_DF92:"school bag",MSG_D83D_DC5D:"pouch",MSG_D83D_DC5B:"purse",MSG_D83D_DCB0:"money bag",MSG_D83D_DCB3:"credit card",MSG_D83D_DCB2:"dollar sign",MSG_D83D_DCB5:"dollar note",MSG_D83D_DCB4:"yen note",MSG_D83D_DCB6:"Euro note",MSG_D83D_DCB7:"Pound note",MSG_D83D_DCB8:"flying money",MSG_D83D_DCB1:"currency exchange",MSG_D83D_DCB9:"rising market",MSG_D83D_DD2B:"gun",MSG_D83D_DD2A:"cooking knife",MSG_D83D_DCA3:"bomb",MSG_D83D_DC89:"shot",MSG_D83D_DC8A:"pill", MSG_D83D_DEAC:"smoking sign",MSG_D83D_DD14:"bell",MSG_D83D_DD15:"no bell",MSG_D83D_DEAA:"door",MSG_D83D_DD2C:"microscope",MSG_D83D_DD2D:"telescope",MSG_D83D_DD2E:"crystal ball",MSG_D83D_DD26:"flashlight",MSG_D83D_DD0B:"battery",MSG_D83D_DD0C:"electric plug",MSG_D83D_DCDC:"scroll",MSG_D83D_DCD7:"green book",MSG_D83D_DCD8:"book",MSG_D83D_DCD9:"orange book",MSG_D83D_DCDA:"books",MSG_D83D_DCD4:"decorated notebook",MSG_D83D_DCD2:"ledger",MSG_D83D_DCD1:"bookmark tabs",MSG_D83D_DCD3:"notebook",MSG_D83D_DCD5:"closed book", MSG_D83D_DCD6:"open book",MSG_D83D_DCF0:"newspaper",MSG_D83D_DCDB:"name badge",MSG_D83C_DF83:"jack-o-lantern",MSG_D83C_DF84:"christmas tree",MSG_D83C_DF80:"ribbon",MSG_D83C_DF81:"gift",MSG_D83C_DF82:"birthday cake",MSG_D83C_DF88:"balloon",MSG_D83C_DF86:"firework",MSG_D83C_DF87:"sparkler",MSG_D83C_DF89:"party popper",MSG_D83C_DF8A:"confetti",MSG_D83C_DF8D:"pine decoration",MSG_D83C_DF8F:"carp streamer",MSG_D83C_DF8C:"crossed flags",MSG_D83C_DF90:"wind chime",MSG_D83C_DF8B:"tree and paper strips",MSG_D83C_DF8E:"dolls", MSG_D83D_DCF1:"cell phone",MSG_D83D_DCF2:"cell phone with arrow",MSG_D83D_DCDF:"pager",MSG_D83D_DCDE:"phone",MSG_D83D_DCE0:"fax",MSG_D83D_DCE6:"package",MSG_D83D_DCE8:"incoming mail",MSG_D83D_DCE9:"outgoing mail",MSG_D83D_DCEA:"closed mailbox with flag down",MSG_D83D_DCEB:"closed mailbox with flag up",MSG_D83D_DCED:"open mailbox with flag down",MSG_D83D_DCEC:"open mailbox with flag up",MSG_D83D_DCEE:"postbox",MSG_D83D_DCE4:"sent mail",MSG_D83D_DCE5:"Inbox",MSG_D83D_DCEF:"postal horn",MSG_D83D_DCE2:"loudspeaker", MSG_D83D_DCE3:"megaphone",MSG_D83D_DCE1:"satellite dish",MSG_D83D_DCAC:"speech balloon",MSG_D83D_DCAD:"thought balloon",MSG_D83D_DCDD:"memo",MSG_D83D_DCCF:"straight ruler",MSG_D83D_DCD0:"triangle ruler",MSG_D83D_DCCD:"round pushpin",MSG_D83D_DCCC:"pushpin",MSG_D83D_DCCE:"paperclip",MSG_D83D_DCBA:"seat",MSG_D83D_DCBB:"PC",MSG_D83D_DCBD:"mini disc",MSG_D83D_DCBE:"floppy disc",MSG_D83D_DCBF:"blu-ray",MSG_D83D_DCC6:"tear-off calendar",MSG_D83D_DCC5:"calendar",MSG_D83D_DCC7:"card index",MSG_D83D_DCCB:"clipboard", MSG_D83D_DCC1:"file folder",MSG_D83D_DCC2:"open folder",MSG_D83D_DCC3:"document",MSG_D83D_DCC4:"document",MSG_D83D_DCCA:"bar graph",MSG_D83D_DCC8:"upward trend",MSG_D83D_DCC9:"downward trend",MSG_D83C_DFA1:"ferris wheel",MSG_D83C_DFA2:"roller coaster",MSG_D83C_DFA0:"carousel",MSG_D83C_DFAA:"circus",MSG_D83C_DFA8:"paint palette",MSG_D83C_DFAC:"clapperboard",MSG_D83C_DFA5:"movie camera",MSG_D83D_DCF7:"camera",MSG_D83D_DCF9:"video cam",MSG_D83C_DFA6:"movie",MSG_D83C_DFAD:"face mask",MSG_D83C_DFAB:"ticket", MSG_D83C_DFAE:"video game",MSG_D83C_DFB2:"game die",MSG_D83C_DFB0:"slot machine",MSG_D83C_DCCF:"Joker card",MSG_D83C_DFB4:"playing card",MSG_D83C_DC04:"Mahjong tile",MSG_D83C_DFAF:"bull's eye",MSG_D83D_DCFA:"TV",MSG_D83D_DCFB:"radio",MSG_D83D_DCC0:"DVD",MSG_D83D_DCFC:"video tape",MSG_D83C_DFA7:"headphone",MSG_D83C_DFA4:"mic",MSG_D83C_DFB5:"musical note",MSG_D83C_DFB6:"musical notes",MSG_D83C_DFBC:"music score",MSG_D83C_DFBB:"violin",MSG_D83C_DFB9:"piano",MSG_D83C_DFB7:"sax",MSG_D83C_DFBA:"trumpet", MSG_D83C_DFB8:"guitar",MSG_D83D_DC15:"dog",MSG_D83D_DC36:"dog face",MSG_D83D_DC29:"poodle",MSG_D83D_DC08:"cat",MSG_D83D_DC31:"cat face",MSG_D83D_DC00:"Rat",MSG_D83D_DC01:"Mouse",MSG_D83D_DC2D:"mouse face",MSG_D83D_DC39:"hamster face",MSG_D83D_DC22:"turtle",MSG_D83D_DC07:"rabbit",MSG_D83D_DC30:"rabbit face",MSG_D83D_DC13:"rooster",MSG_D83D_DC14:"chicken",MSG_D83D_DC23:"hatching chick",MSG_D83D_DC24:"baby chick face",MSG_D83D_DC25:"baby chick",MSG_D83D_DC26:"bird",MSG_D83D_DC0F:"ram",MSG_D83D_DC11:"sheep", MSG_D83D_DC10:"goat",MSG_D83D_DC3A:"wolf face",MSG_D83D_DC03:"water buffalo",MSG_D83D_DC02:"Ox",MSG_D83D_DC04:"cow",MSG_D83D_DC2E:"cow face",MSG_D83D_DC34:"horse face",MSG_D83D_DC17:"boar",MSG_D83D_DC16:"pig",MSG_D83D_DC37:"pig face",MSG_D83D_DC3D:"pig nose",MSG_D83D_DC38:"frog face",MSG_D83D_DC0D:"snake",MSG_D83D_DC3C:"panda face",MSG_D83D_DC27:"penguin",MSG_D83D_DC18:"elephant",MSG_D83D_DC28:"koala",MSG_D83D_DC12:"monkey",MSG_D83D_DC35:"monkey face",MSG_D83D_DC06:"leopard",MSG_D83D_DC2F:"tiger face", MSG_D83D_DC3B:"bear face",MSG_D83D_DC2B:"two hump camel",MSG_D83D_DC2A:"one hump camel",MSG_D83D_DC0A:"crocodile",MSG_D83D_DC33:"spouting whale",MSG_D83D_DC0B:"whale",MSG_D83D_DC1F:"fish",MSG_D83D_DC20:"tropical fish",MSG_D83D_DC21:"blowfish",MSG_D83D_DC19:"octopus",MSG_D83D_DC1A:"shell",MSG_D83D_DC2C:"dolphin",MSG_D83D_DC0C:"snail",MSG_D83D_DC1B:"bug",MSG_D83D_DC1C:"ant",MSG_D83D_DC1D:"honeybee",MSG_D83D_DC1E:"lady beetle",MSG_D83D_DC32:"dragon face",MSG_D83D_DC09:"dragon",MSG_D83D_DC3E:"paw",MSG_D83C_DF78:"cocktail", MSG_D83C_DF7A:"beer",MSG_D83C_DF7B:"beer mugs",MSG_D83C_DF77:"wine",MSG_D83C_DF79:"tropical drink",MSG_D83C_DF76:"sake",MSG_D83C_DF75:"teacup",MSG_D83C_DF7C:"baby bottle",MSG_D83C_DF74:"fork and knife",MSG_D83C_DF68:"ice cream",MSG_D83C_DF67:"shaved ice",MSG_D83C_DF66:"soft ice cream",MSG_D83C_DF69:"donut",MSG_D83C_DF70:"shortcake",MSG_D83C_DF6A:"cookie",MSG_D83C_DF6B:"chocolate",MSG_D83C_DF6C:"candy",MSG_D83C_DF6D:"lollipop",MSG_D83C_DF6E:"custard",MSG_D83C_DF6F:"honeypot",MSG_D83C_DF73:"frying pan", MSG_D83C_DF54:"hamburger",MSG_D83C_DF5F:"fries",MSG_D83C_DF5D:"spaghetti",MSG_D83C_DF55:"pizza slice",MSG_D83C_DF56:"meat",MSG_D83C_DF57:"chicken leg",MSG_D83C_DF64:"fried shrimp",MSG_D83C_DF63:"sushi",MSG_D83C_DF71:"bento",MSG_D83C_DF5E:"bread",MSG_D83C_DF5C:"ramen",MSG_D83C_DF59:"rice ball",MSG_D83C_DF5A:"cooked rice",MSG_D83C_DF5B:"curry and rice",MSG_D83C_DF72:"stew",MSG_D83C_DF65:"fish cake",MSG_D83C_DF62:"oden",MSG_D83C_DF61:"mochi",MSG_D83C_DF58:"rice cracker",MSG_D83C_DF60:"roasted potato", MSG_D83C_DF4C:"banana",MSG_D83C_DF4E:"red apple",MSG_D83C_DF4F:"green apple",MSG_D83C_DF4A:"tangerine",MSG_D83C_DF4B:"lemon",MSG_D83C_DF44:"mushroom",MSG_D83C_DF45:"tomato",MSG_D83C_DF46:"eggplant",MSG_D83C_DF47:"grapes",MSG_D83C_DF48:"melon",MSG_D83C_DF49:"watermelon",MSG_D83C_DF50:"pear",MSG_D83C_DF51:"peach",MSG_D83C_DF52:"cherry",MSG_D83C_DF53:"strawberry",MSG_D83C_DF4D:"pineapple",MSG_D83C_DF30:"chestnut",MSG_D83C_DF31:"young plant",MSG_D83C_DF32:"evergreen tree",MSG_D83C_DF33:"shedding tree", MSG_D83C_DF34:"palm tree",MSG_D83C_DF35:"cactus",MSG_D83C_DF37:"tulip",MSG_D83C_DF38:"cherry blossom",MSG_D83C_DF39:"rose",MSG_D83C_DF40:"four leaf clover",MSG_D83C_DF41:"maple leaf",MSG_D83C_DF42:"falling leaves",MSG_D83C_DF43:"leaf in wind",MSG_D83C_DF3A:"hibiscus",MSG_D83C_DF3B:"sunflower",MSG_D83C_DF3C:"blossom",MSG_D83C_DF3D:"corn",MSG_D83C_DF3E:"rice plant",MSG_D83C_DF3F:"herb",MSG_D83C_DF08:"rainbow",MSG_D83C_DF01:"foggy",MSG_D83C_DF02:"umbrella",MSG_D83D_DCA7:"cold sweat",MSG_D83C_DF00:"cyclone", MSG_D83C_DF19:"crescent moon",MSG_D83C_DF1E:"sun face",MSG_D83C_DF1D:"full moon face",MSG_D83C_DF1A:"new moon face",MSG_D83C_DF1B:"first quarter moon face",MSG_D83C_DF1C:"last quarter moon face",MSG_D83C_DF11:"new moon",MSG_D83C_DF12:"waxing crescent moon",MSG_D83C_DF13:"first quarter moon",MSG_D83C_DF14:"waxing moon",MSG_D83C_DF15:"full moon",MSG_D83C_DF16:"waning moon",MSG_D83C_DF17:"last quarter moon",MSG_D83C_DF18:"waning crescent moon",MSG_D83C_DF91:"moon viewing",MSG_D83C_DF04:"sunrise over mountains", MSG_D83C_DF05:"sunrise",MSG_D83C_DF07:"sunset",MSG_D83C_DF06:"city at dusk",MSG_D83C_DF03:"night stars",MSG_D83C_DF0C:"Milky Way",MSG_D83C_DF09:"night bridge",MSG_D83C_DF0A:"wave",MSG_D83C_DF0B:"volcano",MSG_D83C_DF0E:"globe Americas",MSG_D83C_DF0F:"globe Asia-Australia",MSG_D83C_DF0D:"globe Europe-Africa",MSG_D83C_DF10:"globe with meridians",MSG_D83C_DFE0:"house",MSG_D83C_DFE1:"home",MSG_D83C_DFE2:"office building",MSG_D83C_DFE3:"Japanese post office",MSG_D83C_DFE4:"European post office",MSG_D83C_DFE5:"hospital", MSG_D83C_DFE6:"bank",MSG_D83C_DFE7:"ATM",MSG_D83C_DFE8:"hotel",MSG_D83C_DFE9:"love hotel",MSG_D83C_DFEA:"convenience store",MSG_D83C_DFEB:"school",MSG_D83C_DFEC:"department store",MSG_D83C_DFEF:"Japanese castle",MSG_D83C_DFF0:"European castle",MSG_D83C_DFED:"factory",MSG_D83D_DDFB:"Mt. Fuji",MSG_D83D_DDFC:"Tokyo Tower",MSG_D83D_DDFD:"Statue of Liberty",MSG_D83D_DDFE:"Map of Japan",MSG_D83D_DDFF:"Moyai statue",MSG_D83C_DFEE:"red lantern",MSG_D83D_DC88:"barber shop",MSG_D83D_DD27:"wrench",MSG_D83D_DD28:"hammer", MSG_D83D_DD29:"nut and bolt",MSG_D83D_DEBF:"shower",MSG_D83D_DEC1:"bathtub",MSG_D83D_DEC0:"bath",MSG_D83D_DEBD:"toilet",MSG_D83D_DEBE:"water closet",MSG_D83C_DFBD:"running shirt",MSG_D83C_DFA3:"fishing",MSG_D83C_DFB1:"billiard",MSG_D83C_DFB3:"bowling",MSG_D83C_DFBE:"tennis",MSG_D83C_DFBF:"ski",MSG_D83C_DFC0:"basketball",MSG_D83C_DFC1:"checkered flag",MSG_D83C_DFC2:"snowboarder",MSG_D83C_DFC3:"runner",MSG_D83C_DFC4:"surfing",MSG_D83C_DFC6:"trophy",MSG_D83C_DFC7:"horse racing",MSG_D83D_DC0E:"horse", MSG_D83C_DFC8:"American football",MSG_D83C_DFC9:"soccer",MSG_D83C_DFCA:"swimmer",MSG_D83D_DE82:"steam locomotive",MSG_D83D_DE83:"train",MSG_D83D_DE84:"high-speed train",MSG_D83D_DE85:"high-speed train with bullet nose",MSG_D83D_DE86:"train",MSG_D83D_DE87:"subway",MSG_D83D_DE88:"light rail",MSG_D83D_DE8A:"tram",MSG_D83D_DE8B:"tram car",MSG_D83D_DE8C:"bus",MSG_D83D_DE8D:"oncoming bus",MSG_D83D_DE8E:"trolleybus",MSG_D83D_DE8F:"bus stop",MSG_D83D_DE90:"minibus",MSG_D83D_DE91:"ambulance",MSG_D83D_DE92:"fire engine", MSG_D83D_DE93:"police car",MSG_D83D_DE94:"oncoming police car",MSG_D83D_DE95:"taxi",MSG_D83D_DE96:"oncoming taxi",MSG_D83D_DE97:"car",MSG_D83D_DE98:"oncoming car",MSG_D83D_DE99:"RV",MSG_D83D_DE9A:"delivery truck",MSG_D83D_DE9B:"lorry",MSG_D83D_DE9C:"tractor",MSG_D83D_DE9D:"monorail",MSG_D83D_DE9E:"mountain railway",MSG_D83D_DE9F:"suspension railway",MSG_D83D_DEA0:"mountain cableway",MSG_D83D_DEA1:"cable car",MSG_D83D_DEA2:"ship",MSG_D83D_DEA3:"rowboat",MSG_D83D_DE81:"helicopter",MSG_D83D_DEC2:"passport control", MSG_D83D_DEC3:"customs",MSG_D83D_DEC4:"baggage claim",MSG_D83D_DEC5:"left luggage",MSG_D83D_DEB2:"bike",MSG_D83D_DEB3:"no bike",MSG_D83D_DEB4:"bicyclist",MSG_D83D_DEB5:"mountain bicyclist",MSG_D83D_DEB7:"no pedestrians",MSG_D83D_DEB8:"children crossing",MSG_D83D_DE89:"train station",MSG_D83D_DE80:"rocket",MSG_D83D_DEA4:"speedboat",MSG_D83D_DEB6:"pedestrian",MSG_D83C_DD7F:"parking",MSG_D83D_DEA5:"horizontal traffic lights",MSG_D83D_DEA6:"vertical traffic lights",MSG_D83D_DEA7:"under construction", MSG_D83D_DEA8:"revolving light",MSG_D83D_DC8C:"love letter",MSG_D83D_DC8D:"ring",MSG_D83D_DC8E:"gem",MSG_D83D_DC90:"bouquet",MSG_D83D_DC92:"wedding chapel",MSG_D83D_DD1D:"Top sign",MSG_D83D_DD19:"back",MSG_D83D_DD1B:"ON arrow",MSG_D83D_DD1C:"Soon sign",MSG_D83D_DD1A:"end",MSG_D83D_DD31:"trident sign",MSG_D83D_DD2F:"six-pointed star",MSG_D83D_DEBB:"restroom sign",MSG_D83D_DEAE:"litterbox sign",MSG_D83D_DEAF:"don't litter sign",MSG_D83D_DEB0:"drinking water",MSG_D83D_DEB1:"non-drinking water",MSG_D83C_DD70:"blood type A", MSG_D83C_DD71:"blood type B",MSG_D83C_DD8E:"blood type AB",MSG_D83C_DD7E:"blood type O",MSG_D83D_DCAE:"flower stamp",MSG_D83D_DCAF:"full score",MSG_D83D_DD20:"uppercase letters",MSG_D83D_DD21:"lowercase letters",MSG_D83D_DD22:"numbers",MSG_D83D_DD23:"symbols",MSG_D83D_DD24:"Latin Alphabet",MSG_D83D_DCF6:"mobile signals",MSG_D83D_DCF3:"vibration mode",MSG_D83D_DCF4:"phone off",MSG_D83D_DCF5:"no cell phone",MSG_D83D_DEB9:"Men sign",MSG_D83D_DEBA:"Women sign",MSG_D83D_DEBC:"baby sign",MSG_D83D_DEAD:"no smoking sign", MSG_D83D_DEA9:"location flag",MSG_D83C_DE01:"Japanese word \u00e2\u20ac\u02dchere\u00e2\u20ac\u2122",MSG_D83D_DD1E:"No one under 18",MSG_D83C_DD92:"cool",MSG_D83C_DD97:"OK",MSG_D83C_DD95:"New",MSG_D83C_DD98:"SOS",MSG_D83C_DD99:"UP!",MSG_D83C_DD93:"free",MSG_D83C_DD96:"NG",MSG_D83C_DD9A:"versus",MSG_D83C_DE32:"Japanese word \u00e2\u20ac\u02dcprohibited\u00e2\u20ac\u2122",MSG_D83C_DE33:"Chinese word 'space available'",MSG_D83C_DE34:"Chinese word 'pass'",MSG_D83C_DE35:"Chinese word 'full'",MSG_D83C_DE36:"Japanese word 'fees'", MSG_D83C_DE37:"Japanese word 'monthly'",MSG_D83C_DE38:"Chinese word 'application'",MSG_D83C_DE39:"Japanese word 'discount'",MSG_D83C_DE02:"Japanese word \u00e2\u20ac\u02dcservice\u00e2\u20ac\u2122",MSG_D83C_DE3A:"Chinese word 'in business'",MSG_D83C_DE50:"Japanese word 'advantage'",MSG_D83C_DE51:"Chinese word 'approved'",MSG_D83C_DE1A:"Japanese word 'free'",MSG_D83C_DE2F:"Japanese word 'reserved'",MSG_D83D_DEAB:"No entry sign",MSG_D83D_DD17:"link sign",MSG_D83D_DCA0:"flower petal",MSG_D83D_DCA1:"light bulb", MSG_D83D_DCA4:"sleepy symbol",MSG_D83D_DCA2:"anger",MSG_D83D_DD25:"fire",MSG_D83D_DCA5:"collision",MSG_D83D_DCA8:"running dash",MSG_D83D_DCA6:"splashing sweat",MSG_D83D_DCAB:"dizzy",MSG_D83D_DD5B:"12 o'clock",MSG_D83D_DD67:"twelve-thirty",MSG_D83D_DD50:"1 o'clock",MSG_D83D_DD5C:"one-thirty",MSG_D83D_DD51:"2 o'clock",MSG_D83D_DD5D:"two-thirty",MSG_D83D_DD52:"3 o'clock",MSG_D83D_DD5E:"three-thirty",MSG_D83D_DD53:"4 o'clock",MSG_D83D_DD5F:"four-thirty",MSG_D83D_DD54:"5 o'clock",MSG_D83D_DD60:"five-thirty", MSG_D83D_DD55:"6 o'clock",MSG_D83D_DD61:"six-thirty",MSG_D83D_DD56:"7 o'clock",MSG_D83D_DD62:"seven-thirty",MSG_D83D_DD57:"8 o'clock",MSG_D83D_DD63:"eight-thirty",MSG_D83D_DD58:"9 o'clock",MSG_D83D_DD64:"nine-thirty",MSG_D83D_DD59:"10 o'clock",MSG_D83D_DD65:"ten-thirty",MSG_D83D_DD5A:"11 o'clock",MSG_D83D_DD66:"eleven-thirty",MSG_D83D_DD3D:"down triangle button",MSG_D83D_DD3C:"up triangle button",MSG_D83D_DD34:"large red circle",MSG_D83D_DD35:"large blue circle",MSG_D83D_DD33:"outlined frame square button", MSG_D83D_DD32:"solid frame square button",MSG_D83C_DF1F:"glowing star",MSG_D83C_DF20:"shooting star",MSG_D83D_DD38:"small orange diamond",MSG_D83D_DD39:"small blue diamond",MSG_D83D_DD36:"large orange diamond",MSG_D83D_DD37:"large blue diamond",MSG_D83D_DD3A:"up triangle",MSG_D83D_DD3B:"down triangle",MSG_D83C_DD94:"ID",MSG_D83D_DD11:"key",MSG_D83C_DD91:"CL",MSG_D83D_DD0D:"left-tilted magnifying glass",MSG_D83D_DD12:"closed lock",MSG_D83D_DD13:"open lock",MSG_D83D_DD10:"closed lock with a key",MSG_D83D_DD18:"radio button", MSG_D83D_DD0E:"right-tilted magnifying glass",MSG_D83D_DD16:"bookmark",MSG_D83D_DD0F:"lock with an ink pen",MSG_D83D_DD03:"reload",MSG_D83D_DD00:"crossed arrows",MSG_D83D_DD01:"clockwise arrows",MSG_D83D_DD02:"clockwise arrows",MSG_D83D_DD04:"anti-clockwise arrows",MSG_D83D_DCE7:"email",MSG_D83D_DD05:"low brightness",MSG_D83D_DD06:"high brightness",MSG_D83D_DD07:"no speaking",MSG_D83D_DD08:"speaker",MSG_D83D_DD09:"speaker with low volume",MSG_D83D_DD0A:"speaker with high volume",MSG_SMILEY:"smiley"};var jaMsgs={MSG_appNameJpKeyboard:"Google Japanese Input (for Japanese keyboard)",MSG_appNameUsKeyboard:"Google Japanese Input (for US keyboard)",MSG_compositionModeHiragana:"Hiragana",MSG_compositionModeFullKatakana:"Katakana",MSG_compositionModeFullAscii:"Wide Latin",MSG_compositionModeHalfKatakana:"Half width katakana",MSG_compositionModeHalfAscii:"Latin",MSG_compositionModeDirect:"Direct input",MSG_configPunctuationMethod:"Punctuation style:",MSG_configPreeditMethod:"Input mode:",MSG_configPreeditMethodRomaji:"Romaji", MSG_configPreeditMethodKana:"Kana",MSG_configSymbolMethod:"Symbol style:",MSG_configSpaceCharacterForm:"Space input style:",MSG_configSpaceCharacterFormFollow:"Follow input mode",MSG_configSpaceCharacterFormFull:"Fullwidth",MSG_configSpaceCharacterFormHalf:"Halfwidth",MSG_configSelectionShortcut:"Selection shortcut:",MSG_configSelectionShortcutNo:"No shortcut",MSG_configShiftKeyModeSwitch:"Shift key mode switch:",MSG_configShiftKeyModeSwitchOff:"Off",MSG_configShiftKeyModeSwitchAlphanumeric:"Alphanumeric", MSG_configShiftKeyModeSwitchKatakana:"Katakana",MSG_configSessionKeymap:"Keymap style:",MSG_configSessionKeymapAtok:"ATOK",MSG_configSessionKeymapChromeOs:"Chrome OS",MSG_configSessionKeymapMsIme:"MS-IME",MSG_configSessionKeymapKotoeri:"Kotoeri",MSG_configSessionKeymapCustom:"Custom keymap",MSG_configIncognitoMode:"Disable personalized conversions and suggestions as well as user dictionary",MSG_configUseAutoImeTurnOff:"Automatically switch to halfwidth",MSG_configUseHistorySuggest:"Use input history", MSG_configUseDictionarySuggest:"Use system dictionary",MSG_configSuggestionsSize:"Number of suggestions:",MSG_configSettingsTitle:"Japanese input settings",MSG_configBasicsTitle:"Basics",MSG_configInputAssistanceTitle:"Input assistance",MSG_configSuggestTitle:"Suggest",MSG_configPrivacyTitle:"Privacy",MSG_configClearHistory:"Clear personalization data...",MSG_configClearHistoryTitle:"Clear personalization data",MSG_configClearHistoryMessage:"Obliterate the following items:",MSG_configClearHistoryConversionHistory:"Conversion history", MSG_configClearHistorySuggestionHistory:"Suggestion history",MSG_configClearHistoryOkButton:"Clear personalization data",MSG_configClearHistoryCancelButton:"Cancel",MSG_configCreditsDescription:"Copyright \u00a9 2013 Google Inc. All Rights Reserved.",MSG_configOssCreditsDescription:'This software is made possible by <a href="./credits_en.html">open source software</a>.',MSG_configDialogCancel:"Cancel",MSG_configDialogOk:"OK",MSG_configDictionaryToolTitle:"User dictionaries",MSG_configDictionaryToolDescription:"Add your own words to the user dictionary in order to customize the conversion candidates.", MSG_configDictionaryToolButton:"Manage user dictionary...",MSG_dictionaryToolPageTitle:"User dictionaries",MSG_dictionaryToolDictionaryListTitle:"Dictionaries",MSG_dictionaryToolReadingTitle:"Reading",MSG_dictionaryToolWordTitle:"Word",MSG_dictionaryToolCategoryTitle:"Category",MSG_dictionaryToolCommentTitle:"Comment",MSG_dictionaryToolMenuTitle:"Dictionary management",MSG_dictionaryToolExportButton:"Export",MSG_dictionaryToolImportButton:"Import...",MSG_dictionaryToolDoneButton:"Done",MSG_dictionaryToolReadingNewInput:"New reading", MSG_dictionaryToolWordNewInput:"New word",MSG_dictionaryToolCommentNewInput:"Comment",MSG_dictionaryToolDeleteDictionaryTitle:"Delete dictionary",MSG_dictionaryToolDictionaryName:"Dictionary Name",MSG_dictionaryToolNewDictionaryNamePlaceholder:"New dictionary",MSG_dictionaryToolDeleteDictionaryConfirm:"Do you want to delete [object Object]?",MSG_dictionaryToolStatusErrorGeneral:"The operation has failed.",MSG_dictionaryToolStatusErrorFileNotFound:"Could not open the file.",MSG_dictionaryToolStatusErrorInvalidFileFormat:"Could not read the file.", MSG_dictionaryToolStatusErrorEmptyFile:"The file is empty.",MSG_dictionaryToolStatusErrorFileSizeLimitExceeded:"The data size exceeds the file size limit.",MSG_dictionaryToolStatusErrorDictionarySizeLimitExceeded:"Can't create any more dictionaries.",MSG_dictionaryToolStatusErrorEntrySizeLimitExceeded:"Can't create any more entries in this dictionary.",MSG_dictionaryToolStatusErrorDictionaryNameEmpty:"Please type a dictionary name.",MSG_dictionaryToolStatusErrorDictionaryNameTooLong:"The name is too long.", MSG_dictionaryToolStatusErrorDictionaryNameContainsInvalidCharacter:"The name contains invalid character(s).",MSG_dictionaryToolStatusErrorDictionaryNameDuplicated:"The name already exists.",MSG_dictionaryToolStatusErrorReadingEmpty:"Please type the reading.",MSG_dictionaryToolStatusErrorReadingTooLong:"The reading is too long.",MSG_dictionaryToolStatusErrorReadingContainsInvalidCharacter:"The reading contains invalid character(s). You can use use ASCII characters, Hiragana, voiced sound mark(\u309b), semi-voiced sound mark(\u309c), middle dot(\u30fb), prolonged sound mark(\u30fc), Japanese comma(\u3001), Japanese period(\u3002), Japanese brackets(\u300c\u300d\u300e\u300f) and Japanese wavedash(\u301c) in the reading.", MSG_dictionaryToolStatusErrorWordEmpty:"Please type the word.",MSG_dictionaryToolStatusErrorWordTooLong:"The word is too long.",MSG_dictionaryToolStatusErrorWordContainsInvalidCharacter:"The word contains invalid character(s).",MSG_dictionaryToolStatusErrorImportTooManyWords:"The import source contains too many words.",MSG_dictionaryToolStatusErrorImportInvalidEntries:"Some words could not be imported.",MSG_dictionaryToolStatusErrorNoUndoHistory:"No more undo-able operation.",MSG_dictionaryToolStatusErrorTitleCreateDictionary:"Create dictionary error", MSG_dictionaryToolStatusErrorTitleDeleteDictionary:"Delete dictionary error",MSG_dictionaryToolStatusErrorTitleRenameDictionary:"Rename dictionary error",MSG_dictionaryToolStatusErrorTitleEditEntry:"Edit entry error",MSG_dictionaryToolStatusErrorTitleDeleteEntry:"Delete entry error",MSG_dictionaryToolStatusErrorTitleAddEntry:"Add entry error",MSG_dictionaryToolStatusErrorTitleImportData:"Import error",MSG_configUploadUsageStats:"Automatically send usage statistics and crash reports to Google"};var msgs={MSG_CHOS_INPUTTOOL_TITLE:"Google Input Tools",MSG_CHOS_INPUTTOOL_DESCRIPTION:"Mit Google Input Tools f\u00fcr Chrome OS k\u00f6nnen Sie in Chrome OS Eingaben in Ihrer gew\u00fcnschten Sprache vornehmen.",MSG_PINYIN_SETTINGS_PAGE:"Seite mit Pinyin-Einstellungen",MSG_SWIPE_SELECTION_TOOLTIP:"Wischen Sie nach links oder rechts, um den Cursor zu bewegen.",MSG_SWIPE_RESTORATION_TOOLTIP:"Wischen Sie nach rechts, um W\u00f6rter wiederherzustellen.",MSG_SWIPE_DELETION_TOOLTIP:"Wischen Sie nach links, um ganze W\u00f6rter zu l\u00f6schen.", MSG_ZHUYIN_SETTINGS_PAGE:"Seite mit Zhuyin-Einstellungen",MSG_FUZZY_PINYIN:"Fuzzy-Pinyin-Modus aktivieren",MSG_USER_DICT:"Pers\u00f6nliches W\u00f6rterbuch aktivieren",MSG_USER_DICT_SYNC:"Pers\u00f6nliches W\u00f6rterbuch synchronisieren",MSG_USER_DICT_RESET:"Alle W\u00f6rterbucheintr\u00e4ge zur\u00fccksetzen",MSG_USER_DICT_EDIT:"W\u00f6rterbucheintr\u00e4ge bearbeiten",MSG_USER_DICT_MANAGE:"Pers\u00f6nliches W\u00f6rterbuch verwalten...",MSG_USER_DICT_TITLE:"Pers\u00f6nliches W\u00f6rterbuch",MSG_USER_DICT_REMOVE:"Auswahl entfernen", MSG_USER_DICT_CLEAR:"Alle l\u00f6schen",MSG_USER_DICT_ADD:"Hinzuf\u00fcgen",MSG_USER_DICT_NEW_WORD:"Neues Wort",MSG_USER_DICT_SAVE:"Speichern",MSG_MOVE_PAGE_KEY_ABOVE:'Kandidatenliste mit den Tasten "-" und "=" paginieren',MSG_MOVE_PAGE_KEY_BELOW:'Kandidatenliste mit den Tasten "," und "." paginieren',MSG_INIT_LANG:"Anf\u00e4ngliche Eingabesprache ist Chinesisch.",MSG_INIT_PUNC:'Anf\u00e4ngliche Punktbreite ist "Voll".',MSG_INIT_SBC:'Anf\u00e4ngliche Zeichenbreite ist "Voll".',MSG_CURRENT_LANG:"Eingabesprache ist Chinesisch.", MSG_CURRENT_PUNC:'Punktbreite ist "Voll".',MSG_CURRENT_SBC:'Zeichenbreite ist "Voll".',MSG_ZHUYIN_KEYBOARD_LAYOUT:"Tastaturtyp",MSG_ZHUYIN_SELECT_KEYS:"Auswahltasten",MSG_ZHUYIN_PAGE_SIZE:"Anzahl von Kandidaten, die pro Seite angezeigt werden sollen",MSG_XKB_LAYOUT:"Keyboard layouts",MSG_KEYBOARD_NONE:"Tastatur",MSG_KEYBOARD_PHONETIC:"Tastatur (phonetisch)",MSG_KEYBOARD_INSCRIPT:"Tastatur (InScript)",MSG_KEYBOARD_TAMIL99:"Tastatur (Tamil99)",MSG_KEYBOARD_TYPEWRITER:"Tastatur (Schreibmaschine)",MSG_KEYBOARD_ITRANS:"Tastatur (ITRANS)", MSG_KEYBOARD_KEDMANEE:"Tastatur (Kedmanee)",MSG_KEYBOARD_PATTACHOTE:"Tastatur (Pattachote)",MSG_KEYBOARD_TIS:"Tastatur (TIS 820-2531)",MSG_KEYBOARD_TCVN:"Tastatur (TCVN)",MSG_KEYBOARD_TELEX:"Tastatur (Telex)",MSG_KEYBOARD_VNI:"Tastatur (VNI)",MSG_KEYBOARD_VIQR:"Tastatur (VIQR)",MSG_BASIC:"Grundeinstellungen",MSG_ADVANCED:"Erweitert",MSG_INPUTMETHOD_HANGUL:"Koreanische Eingabemethode",MSG_INPUTMETHOD_PINYIN:"Pinyin-Eingabemethode",MSG_INPUTMETHOD_TRADITIONAL_PINYIN:"Pinyin-Eingabemethode f\u00fcr traditionelles Chinesisch", MSG_INPUTMETHOD_ZHUYIN:"Zhuyin-Eingabemethode",MSG_INPUTMETHOD_WUBI:"Wubi-Eingabemethode",MSG_INPUTMETHOD_CANGJIE:"Cangjie-Eingabemethode",MSG_INPUTMETHOD_ARRAY:"Array-Eingabemethode",MSG_INPUTMETHOD_DAYI:"Dayi-Eingabemethode",MSG_INPUTMETHOD_QUICK:"Schnelle Eingabemethode",MSG_INPUTMETHOD_CANTONESE:"Cantonese input method",MSG_KEYBOARD_BENGALI_PHONETIC:"Bengalische Tastatur (phonetisch)",MSG_KEYBOARD_GUJARATI_PHONETIC:"Gujarati-Tastatur (phonetisch)",MSG_KEYBOARD_DEVANAGARI_PHONETIC:"Devanagari-Tastatur (phonetisch)", MSG_KEYBOARD_KANNADA_PHONETIC:"Kannada-Tastatur (phonetisch)",MSG_KEYBOARD_MALAYALAM_PHONETIC:"Malayalam-Tastatur (phonetisch)",MSG_KEYBOARD_TAMIL_PHONETIC:"Tamil-Tastatur (phonetisch)",MSG_KEYBOARD_TAMIL_INSCRIPT:"Tamil-Tastatur (InScript)",MSG_KEYBOARD_TAMIL_TAMIL99:"Tamil-Tastatur (Tamil99)",MSG_KEYBOARD_TAMIL_TYPEWRITER:"Tamil-Tastatur (Schreibmaschine)",MSG_KEYBOARD_TAMIL_ITRANS:"Tamil-Tastatur (ITRANS)",MSG_KEYBOARD_TELUGU_PHONETIC:"Telugu-Tastatur (phonetisch)",MSG_KEYBOARD_ETHIOPIC:"\u00c4thiopische Tastatur", MSG_KEYBOARD_THAI_KEDMANEE:"Thail\u00e4ndische Tastatur (Kedmanee)",MSG_KEYBOARD_THAI_PATTACHOTE:"Thail\u00e4ndische Tastatur (Pattachote)",MSG_KEYBOARD_THAI_TIS:"Thail\u00e4ndische Tastatur (TIS 820-2531)",MSG_KEYBOARD_PERSIAN:"Persische Tastatur",MSG_KEYBOARD_VIETNAMESE_TCVN:"Vietnamesische Tastatur (TCVN)",MSG_KEYBOARD_VIETNAMESE_TELEX:"Vietnamesische Tastatur (Telex)",MSG_KEYBOARD_VIETNAMESE_VNI:"Vietnamesische Tastatur (VNI)",MSG_KEYBOARD_VIETNAMESE_VIQR:"Vietnamesische Tastatur (VIQR)",MSG_KEYBOARD_ARABIC:"Arabische Tastatur", MSG_KEYBOARD_LAO:"Lao-Tastatur",MSG_KEYBOARD_NEPALI_INSCRIPT:"Nepali-Tastatur (InScript)",MSG_KEYBOARD_NEPALI_PHONETIC:"Nepali-Tastatur (phonetisch)",MSG_KEYBOARD_KHMER:"Khmer-Tastatur",MSG_KEYBOARD_MYANMAR:"Myanmar-MM3-Tastatur",MSG_KEYBOARD_SINHALA:"Singhalesische Tastatur",MSG_KEYBOARD_US:"US-amerikanische Tastatur",MSG_KEYBOARD_US_INTERNATIONAL:"Internationale US-amerikanische Tastatur",MSG_KEYBOARD_US_EXTENDED:"US-amerikanische erweiterte Tastatur",MSG_KEYBOARD_US_DVORAK:"US-amerikanische Dvorak-Tastatur", MSG_KEYBOARD_US_DVP:'US-amerikanische "Programmer Dvorak"-Tastatur',MSG_KEYBOARD_US_COLEMAK:"US-amerikanische Colemak-Tastatur",MSG_KEYBOARD_BELGIAN:"Belgische Tastatur",MSG_KEYBOARD_FAROESE:"F\u00e4r\u00f6ische Tastatur",MSG_KEYBOARD_NETHERLANDS:"Niederl\u00e4ndische Tastatur",MSG_KEYBOARD_FRENCH_BEPO:"Franz\u00f6sische B\u00c9PO-Tastatur",MSG_KEYBOARD_FRENCH:"Franz\u00f6sische Tastatur",MSG_KEYBOARD_CANADIAN_FRENCH:"Kanadisch-franz\u00f6sische Tastatur",MSG_KEYBOARD_SWISS_FRENCH:"Schweizerisch-franz\u00f6sische Tastatur", MSG_KEYBOARD_CANADIAN_MULTILINGUAL:"Kanadische mehrsprachige Tastatur",MSG_KEYBOARD_GERMAN:"Deutsche Tastatur",MSG_KEYBOARD_GERMAN_NEO_2:"Deutsche Neo-2-Tastatur",MSG_KEYBOARD_SWISS:"Schweizerische Tastatur",MSG_KEYBOARD_JAPANESE:"Japanische Tastatur",MSG_KEYBOARD_RUSSIAN:"Russische Tastatur",MSG_KEYBOARD_RUSSIAN_PHONETIC:"Russische phonetische Tastatur",MSG_KEYBOARD_RUSSIAN_PHONETIC_AATSEEL:"Russische phonetische Tastatur (AATSEEL)",MSG_KEYBOARD_RUSSIAN_PHONETIC_YAZHERT:"Russische phonetische Tastatur (YaZHert)", MSG_KEYBOARD_BRAZILIAN:"Brasilianische Tastatur",MSG_KEYBOARD_BULGARIAN:"Bulgarische Tastatur",MSG_KEYBOARD_BULGARIAN_PHONETIC:"Bulgarische phonetische Tastatur",MSG_KEYBOARD_CANADIAN_ENGLISH:"Kanadisch-englische Tastatur",MSG_KEYBOARD_CZECH:"Tschechische Tastatur",MSG_KEYBOARD_CZECH_QWERTY:"Tschechische Qwerty-Tastatur",MSG_KEYBOARD_ESTONIAN:"Estnische Tastatur",MSG_KEYBOARD_SPANISH:"Spanische Tastatur",MSG_KEYBOARD_CATALAN:"Katalanische Tastatur",MSG_KEYBOARD_DANISH:"D\u00e4nische Tastatur",MSG_KEYBOARD_GREEK:"Griechische Tastatur", MSG_KEYBOARD_HEBREW:"Hebr\u00e4ische Tastatur",MSG_KEYBOARD_LATIN_AMERICAN:"Lateinamerikanische Tastatur",MSG_KEYBOARD_LITHUANIAN:"Litauische Tastatur",MSG_KEYBOARD_LATVIAN:"Lettische Tastatur",MSG_KEYBOARD_CROATIAN:"Kroatische Tastatur",MSG_KEYBOARD_UK:"UK-englische Tastatur",MSG_KEYBOARD_UK_DVORAK:"UK-Dvorak-Tastatur",MSG_KEYBOARD_FINNISH:"Finnische Tastatur",MSG_KEYBOARD_HUNGARIAN:"Ungarische Tastatur",MSG_KEYBOARD_HUNGARIAN_QWERTY:"Ungarische Qwerty-Tastatur",MSG_KEYBOARD_ITALIAN:"Italienische Tastatur", MSG_KEYBOARD_ICELANDIC:"Isl\u00e4ndische Tastatur",MSG_KEYBOARD_NORWEGIAN:"Norwegische Tastatur",MSG_KEYBOARD_POLISH:"Polnische Tastatur",MSG_KEYBOARD_PORTUGUESE:"Portugiesische Tastatur",MSG_KEYBOARD_ROMANIAN:"Rum\u00e4nische Tastatur",MSG_KEYBOARD_ROMANIAN_STANDARD:"Rum\u00e4nische Standardtastatur",MSG_KEYBOARD_SWEDISH:"Schwedische Tastatur",MSG_KEYBOARD_SLOVAKIAN:"Slowakische Tastatur",MSG_KEYBOARD_SLOVAK:"Slowakische Tastatur",MSG_KEYBOARD_SLOVENIAN:"Slowenische Tastatur",MSG_KEYBOARD_SERBIAN:"Serbische Tastatur", MSG_KEYBOARD_TURKISH:"T\u00fcrkische Tastatur",MSG_KEYBOARD_TURKISH_F:'Tastatur "T\u00fcrkisch-F"',MSG_KEYBOARD_UKRAINIAN:"Ukrainische Tastatur",MSG_KEYBOARD_BELARUSIAN:"Wei\u00dfrussische Tastatur",MSG_KEYBOARD_ARMENIAN_PHONETIC:"Armenische phonetische Tastatur",MSG_KEYBOARD_GEORGIAN:"Georgische Tastatur",MSG_KEYBOARD_MONGOLIAN:"Mongolische Tastatur",MSG_KEYBOARD_MALTESE:"Maltesische Tastatur",MSG_KEYBOARD_MACEDONIAN:"Mazedonische Tastatur",MSG_KEYBOARD_IRISH:"Irische Tastatur",MSG_KEYBOARD_SORANIKURDISH_EN:"Kurdische Tastatur nach englischem Layout", MSG_KEYBOARD_SORANIKURDISH_AR:"Kurdische Tastatur nach arabischem Layout",MSG_KEYBOARD_MYANMAR_MYANSAN:"Myanmar-Myansan-Tastatur",MSG_KEYBOARD_LAOTHIAN:"Laotische Tastatur",MSG_KEYBOARD_KAZAKH:"Kazakh keyboard",MSG_TRANSLITERATION_AM:"Transliteration salam \u2192 \u1230\u120b\u121d",MSG_TRANSLITERATION_AR:"Transliteration marhaban \u2190 \u0645\u0631\u062d\u0628\u0627",MSG_TRANSLITERATION_BE:"Transliteration pryvitannie \u2192 \u043f\u0440\u044b\u0432\u0456\u0442\u0430\u043d\u043d\u0435",MSG_TRANSLITERATION_BG:"Transliteration zdrasti \u2192 \u0437\u0434\u0440\u0430\u0441\u0442\u0438", MSG_TRANSLITERATION_BN:"Transliteration namaskar \u2192 \u09a8\u09ae\u09b8\u09cd\u0995\u09be\u09b0",MSG_TRANSLITERATION_EL:"Transliteration geia \u2192 \u03b3\u03b5\u03b9\u03b1",MSG_TRANSLITERATION_FA:"Transliteration salam \u2190 \u0633\u0644\u0627\u0645",MSG_TRANSLITERATION_GU:"Transliteration namaste \u2192 \u0aa8\u0aae\u0ab8\u0acd\u0aa4\u0ac7",MSG_TRANSLITERATION_HE:"Transliteration shalom \u2190 \u05e9\u05dc\u05d5\u05dd",MSG_TRANSLITERATION_HI:"Transliteration namaste \u2192 \u0928\u092e\u0938\u094d\u0924\u0947", MSG_TRANSLITERATION_KN:"Transliteration namaskaram \u2192 \u0ca8\u0cae\u0cb8\u0ccd\u0c95\u0cbe\u0cb0",MSG_TRANSLITERATION_ML:"Transliteration namaskar \u2192 \u0d28\u0d2e\u0d38\u0d4d\u0d15\u0d3e\u0d30\u0d02",MSG_TRANSLITERATION_MR:"Transliteration namaste \u2192 \u0928\u092e\u0938\u094d\u0915\u093e\u0930",MSG_TRANSLITERATION_NE:"Transliteration namaste \u2192 \u0928\u092e\u0938\u094d\u0924\u0947",MSG_TRANSLITERATION_OR:"Transliteration mausam \u2192 \u0b28\u0b2e\u0b38\u0b4d\u0b24\u0b47",MSG_TRANSLITERATION_PA:"Transliteration mausam \u2192 \u0a2e\u0a4c\u0a38\u0a2e", MSG_TRANSLITERATION_RU:"Transliteration privet \u2192 \u043f\u0440\u0438\u0432\u0435\u0442",MSG_TRANSLITERATION_SA:"Transliteration namaste \u2192 \u0928\u092e\u0938\u094d\u0924\u0947",MSG_TRANSLITERATION_SR:"Transliteration zdravo \u2192 \u0437\u0434\u0440\u0430\u0432\u043e",MSG_TRANSLITERATION_SI:"Transliteration halo \u2192 \u0dc4\u0dbd\u0ddd",MSG_TRANSLITERATION_TA:"Transliteration vanakkam \u2192 \u0bb5\u0ba3\u0b95\u0bcd\u0b95\u0bae\u0bcd",MSG_TRANSLITERATION_TE:"Transliteration emandi \u2192 \u0c0f\u0c2e\u0c02\u0c21\u0c40", MSG_TRANSLITERATION_TI:"Transliteration selam \u2192 \u1230\u120b\u121d",MSG_TRANSLITERATION_UK:"Transliteration pryvit \u2192 \u043f\u0440\u0438\u0432\u0456\u0442",MSG_TRANSLITERATION_UR:"Transliteration salam \u2190 \u0633\u0644\u0627\u0645",MSG_TRANSLITERATION_VI:"Transliteration chao \u2192 ch\u00e0o",MSG_HANDWRITING_BACK:"Zur\u00fcck",MSG_HANDWRITING_NETOWRK_ERROR:"Sie k\u00f6nnen Handschrift nicht verwenden, da kein Netzwerk verf\u00fcgbar ist.",MSG_HANDWRITING_PRIVACY_INFO:"Ihre Eingabe wird zwecks Texterkennung an die Google-Server gesendet.", MSG_VOICE_PRIVACY_INFO:"Ihre Spracheingabe wird zwecks Texterkennung an die Google-Server gesendet.",MSG_CAPITAL:"Gro\u00dfbuchstabe",MSG_BACKSPACE:"R\u00fccktaste",MSG_TAB:"Tabulatortaste",MSG_ENTER:"Eingabetaste",MSG_SPACE:"Leertaste",MSG_SHIFT:"Umschalttaste",MSG_CTRL:"Strg-Taste",MSG_ALT:"Alt-Taste",MSG_ALTGR:"AltGr-Taste",MSG_CAPSLOCK:"Feststelltaste",MSG_SHIFT_LOCK:"Umschaltsperre",MSG_LEFT_ARROW:"Linkspfeil",MSG_RIGHT_ARROW:"Rechtspfeil",MSG_UP_ARROW:"Aufw\u00e4rtspfeil",MSG_DOWN_ARROW:"Abw\u00e4rtspfeil", MSG_HIDE_KEYBOARD:"Tastatur ausblenden",MSG_GLOBE:"Zur vorherigen Tastatur wechseln",MSG_MENU_KEY:"Tastaturmen\u00fc \u00f6ffnen",MSG_DISMISS_MENU:"Tastaturmen\u00fc schlie\u00dfen",MSG_FOOTER_EMOJI_BUTTON:"Zu Emoji wechseln",MSG_FOOTER_HANDWRITING_BUTTON:"Zu Handschrift wechseln",MSG_FOOTER_SETTINGS_BUTTON:"Einstellungen f\u00fcr die Eingabemethode \u00f6ffnen",MSG_FOOTER_FLOATING_BUTTON:"Bildschirmtastatur beweglich machen",MSG_FOOTER_DOCKING_BUTTON:"Bildschirmtastatur verankern",MSG_SWITCH_TO_KEYBOARD_PREFIX:"Wechseln zu ", MSG_CURRENT_KEYBOARD_PREFIX:"Momentan ausgew\u00e4hlte Tastatur ",MSG_SWITCH_TO:"Wechseln zu ",MSG_SWITCHED_TO:"Gewechselt zu ",MSG_GOT_IT:"OK",MSG_NEVER_AUTO_CORRECT:"Aus",MSG_SOMETIMES_AUTO_CORRECT:"Moderat",MSG_ALWAYS_AUTO_CORRECT:"Aggressiv",MSG_SHOW_CANDIDATES_BACKSPACE:"Drop-down-Liste mit Vorschl\u00e4gen per R\u00fccktaste einblenden",MSG_SHOW_CANDIDATES_500:"Drop-down-Liste mit Vorschl\u00e4gen nach 500\u00a0ms einblenden",MSG_SHOW_CANDIDATES_1000:"Drop-down-Liste mit Vorschl\u00e4gen nach 1\u00a0s einblenden", MSG_SHOW_CANDIDATES_2000:"Drop-down-Liste mit Vorschl\u00e4gen nach 2\u00a0s einblenden",MSG_SHOW_CANDIDATES_5000:"Drop-down-Liste mit Vorschl\u00e4gen nach 5\u00a0s einblenden",MSG_LATIN_SETTINGS_PAGE:"Einstellungen",MSG_AUTO_CORRECTION_LEVEL:"Autokorrektur",MSG_ENABLE_CAPITALIZATION:"Automatische Gro\u00df-/Kleinschreibung",MSG_PHYSICAL_AUTO_CORRECTION_LEVEL:"Autokorrektur",MSG_PHYSICAL_ENABLE_CAPITALIZATION:"Automatische Gro\u00df-/Kleinschreibung",MSG_SHOW_HANGUL_CANDIDATE:"Kandidaten im Hangul-Modus anzeigen", MSG_SHOW_CANDIDATE_MODE:"Verz\u00f6gerung f\u00fcr Drop-down-Liste mit Vorschl\u00e4gen",MSG_ENABLE_PREDICTION:"Vervollst\u00e4ndigung des n\u00e4chsten Wortes aktivieren",MSG_AM_PHONETIC_ARM_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr armenische phonetische Tastatur",MSG_BE_FRA_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr belgische Tastatur (franz\u00f6sisch)",MSG_BE_GER_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr belgische Tastatur (deutsch)",MSG_BE_NLD_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr belgische Tastatur (niederl\u00e4ndisch)", MSG_BG_BUL_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr bulgarische Tastatur",MSG_BG_PHONETIC_BUL_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr bulgarische phonetische Tastatur",MSG_BR_POR_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr brasilianische Tastatur (brasilianisch-portugiesisch)",MSG_BY_BEL_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr wei\u00dfrussische Tastatur",MSG_CA_FRA_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr kanadisch-franz\u00f6sische Tastatur (franz\u00f6sisch)", MSG_CA_ENG_ENG_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr kanadisch-englische Tastatur (englisch)",MSG_CA_MULTIX_FRA_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr kanadische mehrsprachige Tastatur (franz\u00f6sisch)",MSG_CH_GER_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr schweizerische Tastatur (deutsch)",MSG_CH_FR_FRA_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr schweizerisch-franz\u00f6sische Tastatur (franz\u00f6sisch)",MSG_CZ_CZE_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr tschechische Tastatur", MSG_CZ_QWERTY_CZE_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr tschechische Qwerty-Tastatur",MSG_DE_GER_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr deutsche Tastatur",MSG_DE_NEO_GER_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr deutsche Neo-2-Tastatur",MSG_DK_DAN_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr d\u00e4nische Tastatur",MSG_EE_EST_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr estnische Tastatur",MSG_ES_SPA_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr spanische Tastatur", MSG_ES_CAT_CAT_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr katalanische Tastatur",MSG_FO_FAO_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr f\u00e4r\u00f6ische Tastatur",MSG_FI_FIN_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr finnische Tastatur",MSG_FR_BEPO_FRA_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr franz\u00f6sische B\u00c9PO-Tastatur (Franz\u00f6sisch)",MSG_FR_FRA_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr franz\u00f6sische Tastatur",MSG_GB_DVORAK_ENG_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr UK-Dvorak-Tastatur (englisch)", MSG_GB_EXTD_ENG_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr UK-englische-Tastatur (englisch)",MSG_GE_GEO_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr georgische Tastatur",MSG_GR_GRE_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr griechische Tastatur",MSG_HR_SCR_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr kroatische Tastatur",MSG_HU_HUN_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr ungarische Tastatur",MSG_HU_QWERTY_HUN_SETTINGS_PAGE:"Ungarische Qwerty-Tastatur \u2013 Einrichtungsseite", MSG_IE_GA_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr irische Tastatur",MSG_IL_HEB_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr hebr\u00e4ische Tastatur",MSG_IS_ICE_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr isl\u00e4ndische Tastatur",MSG_IT_ITA_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr italienische Tastatur",MSG_JP_JPN_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr japanische Tastatur",MSG_LATAM_SPA_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr lateinamerikanische Tastatur (spanisch)", MSG_LT_LIT_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr litauische Tastatur",MSG_LV_APOSTROPHE_LAV_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr lettische Tastatur (lettisch)",MSG_MN_MON_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr mongolische Tastatur",MSG_NO_NOB_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr norwegische Tastatur",MSG_PL_POL_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr polnische Tastatur",MSG_PT_POR_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr portugiesische Tastatur", MSG_RO_RUM_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr rum\u00e4nische Tastatur",MSG_RS_SRP_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr serbische Tastatur",MSG_RU_RUS_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr russische Tastatur",MSG_RU_PHONETIC_RUS_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr russische phonetische Tastatur",MSG_SE_SWE_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr schwedische Tastatur",MSG_SI_SLV_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr slowenische Tastatur", MSG_SK_SLO_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr slowakische Tastatur",MSG_TR_TUR_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr t\u00fcrkische Tastatur",MSG_TR_F_TUR_SETTINGS_PAGE:'Seite mit Einstellungen f\u00fcr die Tastatur "T\u00fcrkisch-F"',MSG_UA_UKR_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr ukrainische Tastatur",MSG_US_ENG_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr US-amerikanische Tastatur (englisch)",MSG_US_FIL_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr US-amerikanische Tastatur (philippinisch)", MSG_US_IND_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr US-amerikanische Tastatur (indonesisch)",MSG_US_MSA_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr US-amerikanische Tastatur (malaiisch)",MSG_US_ALTGR_INTL_ENG_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr US-amerikanische erweiterte Tastatur (englisch)",MSG_US_COLEMAK_ENG_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr US-amerikanische Colemak-Tastatur (englisch)",MSG_US_DVORAK_ENG_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr US-amerikanische Dvorak-Tastatur (englisch)", MSG_US_INTL_ENG_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr internationale US-amerikanische Tastatur (englisch)",MSG_US_INTL_NLD_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr internationale US-amerikanische Tastatur (niederl\u00e4ndisch)",MSG_US_INTL_POR_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr internationale US-amerikanische Tastatur (brasilianisch-portugiesisch)",MSG_TOUCH_KEYBOARD:"Bildschirmtastatur",MSG_PHYSICAL_KEYBOARD:"Physische Tastatur",MSG_SOUND_ON_KEYPRESS:"Ton bei Tastendruck", MSG_DOUBLE_SPACE_PERIOD:"Punkteingabe durch Doppeltippen auf die Leertaste",MSG_ENABLE_COMPLETION:"Vervollst\u00e4ndigung aktivieren",MSG_KOREAN_SETTINGS_PAGE:"Seite mit Einstellungen f\u00fcr die koreanische Eingabemethode",MSG_KOREAN_KEYBOARD_LAYOUT:"Koreanische Tastaturbelegung",MSG_KOREAN_SYLLABLE_INPUT:"Jeweils eine Silbe eingeben",MSG_KOREAN_HANJA_DISPLAY:"Hanja-Vorschlagsmodus",MSG_INPUT_HANGUL:"Hangul-Modus",MSG_INPUT_HANJA:"Hanja-Modus",MSG_SWITCH_TO_COMPACT_LAYOUT:"Zum kompakten Layout wechseln", MSG_SWITCH_TO_FULL_LAYOUT:"Zum vollst\u00e4ndigen Layout wechseln",MSG_PAUSE:"Pausieren",MSG_WAIT:"Warten",MSG_DRAG_BUTTON:"Zum Bewegen der Bildschirmtastatur ziehen",MSG_EMOJI_TAB_RECENT:'Emoji-Kategorie "zuletzt verwendet"',MSG_EMOJI_TAB_HOT:'Emoji-Kategorie "hei\u00df"',MSG_EMOJI_TAB_FACE:'Emoji-Kategorie "Gesicht"',MSG_EMOJI_TAB_SYMBOL:'Emoji-Kategorie "Symbol"',MSG_EMOJI_TAB_NATURE:'Emoji-Kategorie "Natur"',MSG_EMOJI_TAB_PLACE:'Emoji-Kategorie "Ort"',MSG_EMOJI_TAB_OBJECT:'Emoji-Kategorie "Objekt"', MSG_EMOJI_TAB_EMOTICON:'Emoji-Kategorie "Emoticon"',MSG_VOICE:"Spracheingabe",MSG_VOICE_TURN_ON:"Spracheingabetool aktivieren",MSG_VOICE_TURN_OFF:"Spracheingabetool deaktivieren",MSG_ADD_TO_PERSONAL_DICTIONARY:"In pers\u00f6nliches W\u00f6rterbuch aufnehmen",MSG_ADD_TO_DICTIONARY:"Zum W\u00f6rterbuch hinzuf\u00fcgen",MSG_ADD_WORD_TO_DICTIONARY:'"$1" zum W\u00f6rterbuch hinzuf\u00fcgen',MSG_IGNORE_CORRECTION:"Korrektur ignorieren f\u00fcr",MSG_IGNORE_CORRECTION_SHORT:"Korrektur ignorieren",MSG_SETTINGS:"Einstellungen", MSG_EXPAND:"Maximieren",MSG_SHRINK_CANDIDATES:"Kandidatenliste minimieren",MSG_EXPAND_CANDIDATES:"Kandidatenliste maximieren",MSG_ENABLE_GESTURE_EDITING:"Wischbewegungen aktivieren",MSG_ENABLE_GESTURE_EDITING_DESC:"Wischen Sie vom Rand der Tastatur, um den Cursor zu bewegen, oder von der R\u00fccktaste, um ganze W\u00f6rter zu l\u00f6schen.",MSG_ENABLE_GESTURE_TYPING:"Bewegungseingabe aktivieren",MSG_ENABLE_GESTURE_TYPING_DESC:"Geben Sie durch Bewegen der Finger \u00fcber die Buchstaben ein Wort ein."};var emojiData=emojiData||{},key;for(key in emojiMsgs){for(var values$$inline_20=key.split("_"),ints$$inline_21=[],i$$inline_22=1;i$$inline_22<values$$inline_20.length;i$$inline_22++)ints$$inline_21[i$$inline_22-1]=parseInt(values$$inline_20[i$$inline_22],16);msgs[key]=emojiData[String.fromCharCode.apply(String,ints$$inline_21)]||emojiMsgs[key]}for(var k in jaMsgs)msgs[k]=jaMsgs[k];var JSCompiler_temp_const$$24=print,container$$inline_28={},name$$inline_29; for(name$$inline_29 in msgs)if(0==name$$inline_29.indexOf("MSG_")){var msg$$inline_30=msgs[name$$inline_29],msgObj$$inline_31={message:msg$$inline_30},matches$$inline_32=msg$$inline_30.match(/\$([1-9])/g);if(matches$$inline_32){for(var placeholders$$inline_33={},i$$inline_34=1;i$$inline_34<matches$$inline_32.length+1;i$$inline_34++)placeholders$$inline_33[i$$inline_34]={content:"$"+i$$inline_34};msgObj$$inline_31.placeholders=placeholders$$inline_33}container$$inline_28[name$$inline_29.slice(4).toLowerCase()]= msgObj$$inline_31}var JSCompiler_inline_result$$26;JSCompiler_inline_result$$26=(new goog$json$Serializer(void 0)).serialize(container$$inline_28);JSCompiler_temp_const$$24(JSCompiler_inline_result$$26);
89.578022
1,046
0.765322
28adf53f750e9009e8c50f43f2fb940b5a2eca6e
11,513
js
JavaScript
src/engines/_ArcGIS.js
wandergis/osmbuildings
0b0d3df17489d35897ea0474fbd99ac28fa577c8
[ "BSD-2-Clause" ]
1
2019-05-19T02:13:18.000Z
2019-05-19T02:13:18.000Z
src/engines/_ArcGIS.js
thangqd/osmbuildings
405ce9403d90722928262c550570367c7e12aae5
[ "BSD-2-Clause" ]
null
null
null
src/engines/_ArcGIS.js
thangqd/osmbuildings
405ce9403d90722928262c550570367c7e12aae5
[ "BSD-2-Clause" ]
null
null
null
/** * @name Extruded Feature Layer * @author: Nianwei Liu * @fileoverview * A canvas based ESRI ArcGIS Server JavaScript API ported from Open Streem Map Buildings.(osmbuildings.org). */ /*(function() { if (!window.OSMBuildings) { // only include minimal filters: invert and desaturate. If need more, include the pixastic.all.js in header before require this. var src = dojo.moduleUrl('agsjs', 'osm/OSMBuildings.js'); var s = dojo.create('script', { type: 'text/javascript', src: src }); dojo.doc.getElementsByTagName('head')[0].appendChild(s); } }()); */ // ********* end of osm *******************/ // TODO get rid of dojo dojo.provide('agsjs.layers.BuildingsLayer'); dojo.declare('agsjs.layers.BuildingsLayer', esri.layers.Layer, { _osmb: null, _container: null, _tileInfo: null, _mode: 0,// ON_DEMAND|SNAPSHOT _heightAttribute: '', _oidField: null,// will be overridden from meta query _query: null, _task: null, _oids: null, //track current objectids to mark new/old for animation fade in _featureExt: null,//current feature extent, 1.5 map extent _suspendOnPan: false,//whether to suspend drawing during map panning. default is false. // set to true if performance is not optimal (non-Chrome browsers); /** * @name BuildingsLayerOptions * @class This is an object literal that specify the options for each BuildingsLayer. * @property {string} heightAttribute required. name of the attribute for height; * @property {number} defaultHeight optional. default Height to use if the height value is 0. default=0; * @property {number} heightScaleRatio optional. number used to multiple the value from service. default=1; * @property {number} extentScaleRatio optional. extra buffer on map extent to load features to reduce server traffic. default=1.5; * @property {int} [mode] optional. agsjs.layers.BuildingsLayer.MODE_ONDEMAND | MODE_SNAPSHOT. default=ON_DEMAND * @property {esri.tasks.Query} [query] optional. query set on the feature layer for retrieving data. * @property {Object} [style] object with color, roofColor (#ffcc00' 'rgb(255,200,200)' 'rgba(255,200,200,0.9)) */ /** * Create an BuildingsLayer * @name BuildingsLayer * @constructor * @class This class is a BuildingsLayer, such as a polygon feature layer with a height attribute. * @param {string||FeatureCollection} url * @param {BuildingsLayerOptions} opts */ constructor: function(url, opts) { // Manually call superclass constructor with required arguments if (!(!!document.createElement('canvas').getContext)){ throw new Error('Canvas unsupported. Try different browser'); } this.inherited(arguments); opts = opts || {}; this._heightAttribute = opts.heightAttribute; this._mode = opts.mode || agsjs.layers.BuildingsLayer.MODE_ONDEMAND; this._heightScaleRatio = opts.heightScaleRatio || 1; this._extentScaleRatio = opts.extentScaleRatio || 1.5; this._defaultHeight = opts.defaultHeight || 0; this._style = opts.style; // Deal with feature collection if (dojo.isObject(url) && url.featureSet) { this._mode = agsjs.layers.BuildingsLayer.MODE_SNAPSHOT; this._setFeatures(url.featureSet.features); this.loaded = true; this.onLoad(this); } else { this._url = url; // get meta data for layer new esri.request({ url: this._url, content: { f: 'json' }, callbackParamName: 'callback' }).then(dojo.hitch(this, this._initLayer)); this._query = new esri.tasks.Query(); dojo.mixin(this._query, opts.query); dojo.mixin(this._query, { returnGeometry: true, outSpatialReference: { wkid: 4326 } }); this._task = new esri.tasks.QueryTask(url); dojo.connect(this._task, 'onComplete', dojo.hitch(this, this._onQueryComplete)); dojo.connect(this._task, 'onError', esri.config.defaults.io.errorHandler); } }, /********************** * @see http://help.arcgis.com/en/webapi/javascript/arcgis/samples/exp_rasterlayer/javascript/RasterLayer.js * Internal Properties * * _map * _element * _context * _mapWidth * _mapHeight * _connects **********************/ _setMap: function(map, container, ind, lod) { this._map = map; var element = dojo.create('div', { width: map.width + 'px', height: map.height + 'px', style: 'position: absolute; left: 0px; top: 0px;' }, container); this._osmb = new OSMBuildings(); // allow attribution widget to add copyright text this.suspended = false; this.copyright = OSMBuildings.ATTRIBUTION + ',' + this.copyrightText; this._element = element; this._container = this._osmb.appendTo(element); this._osmb.setSize(map.width, map.height); // calc orgins //9241483,13264618 if (map.layerIds.length == 0 || !map.getLayer(map.layerIds[0]).tileInfo) { throw new Error('must have at least one tiled layer added before this layer'); } this._tileInfo = map.getLayer(map.layerIds[0]).tileInfo; this._osmb.setZoom(map.getLevel()); // ! assume basemap is tiled. this._setOrigin(); this._loadData(); // Event connections this._connects = []; this._connects.push(dojo.connect(map, 'onResize', this, this._onResize)); this._connects.push(dojo.connect(map, 'onPan', this, this._onPan)); this._connects.push(dojo.connect(map, 'onExtentChange', this, this._onExtentChange)); this._connects.push(dojo.connect(map, 'onZoomStart', this, this._onZoomStart)); return element; }, // esri.layers.Layer.method _unsetMap: function(map, container) { if (this._osmb) { this._container.parentNode.removeChild(this._container); this._osmb = null; } dojo.forEach(this._connects, dojo.disconnect, dojo); if (this._element) { container.removeChild(this._element); } this._map = null; this._element = null; }, _initLayer: function(json) { //dojo.mixin(this, json); this.setMinScale(json.minScale || 0); this.setMaxScale (json.maxScale || 0); this.copyrightText = json.copyrightText; dojo.some(json.fields, function(field, i) { if (field.type == 'esriFieldTypeOID') { this._oidField = field.name; return true; } return false; }, this); this._query.outFields = [this._oidField, this._heightAttribute]; this.loaded = true; this.onLoad(this); }, _setOrigin: function(dx, dy) { var resolution = this._tileInfo.lods[this._map.getLevel()].resolution; //map.getScale()/12/96/3.28084; //inch_pre_ft/px_per_in/ft_per_mt; var topLeft = this._map.toMap(new esri.geometry.Point(0, 0)); var x = Math.round((topLeft.x - this._tileInfo.origin.x) / resolution); var y = Math.round((this._tileInfo.origin.y - topLeft.y) / resolution); this._osmb.setOrigin(x+(dx||0), y+(dy||0)); this._osmb.setSize(this._map.width, this._map.height); }, _onResize: function(extent, width, height) { if (this._osmb) { this._osmb.setSize(width,height ); Layers.render(); } }, _onPan: function(extent, delta) { if (this._suspendOnPan){ dojo.style(this._container, { left: delta.x + 'px', top: delta.y + 'px' }); //moveCam(-delta.x, -delta.y); } else { this._setOrigin(-delta.x, -delta.y); Layers.render(); } }, _onExtentChange: function(extent, delta, levelChange, lod) { dojo.style(this._container, { left: 0, top: 0 }); this._setOrigin(); moveCam(0, 0); if (levelChange) { this._osmb.onZoomEnd({ zoom: this._map.getLevel() }); if (this.isVisibleAtScale(this._map.getScale())) { this._loadData(); } else { // clear canvas. Current OSMB does not handle null or {} as no feature. this._osmb.geoJSON({ features: [] }); } } else { this._osmb.onMoveEnd(); if (this._featureExt && !this._featureExt.contains(extent)) { this._loadData(); } } }, _onZoomStart: function(extent, zoomFactor, anchor, level) { // actually clear the this._osmb.onZoomStart(); }, _setFeatures: function(features) { var oids = {}; var jfs = []; this._oids = this._oids ||{}; for (var i = 0; i < features.length; i++) { var f = features[i]; var oid = f.attributes[this._oidField]; var gj = { type: 'Feature', geometry: { type: 'Polygon', coordinates: f.geometry.rings }, properties: { height: (f.attributes[this._heightAttribute] || this._defaultHeight) * this._heightScaleRatio, isNew: !this._oids[oid] } } // find out the y coords range for sorting var minY = maxY = f.geometry.rings[0][0][1]; for (var j = 0; j < f.geometry.rings.length; j++){ for (var k = 0; k < f.geometry.rings[j].length; k++){ minY = Math.min(minY,f.geometry.rings[j][k][1] ); maxY = Math.max(maxY,f.geometry.rings[j][k][1] ); } } gj.minY = minY; gj.maxY = maxY; jfs[i] = gj; oids[oid] = f; } // sort features by height and y coord desc for potential drawing improvement jfs.sort(function (a, b){ // if polygon a is completely north of b then put a first. // otherwise put the taller one first. // this ensures north/taller poly draw first if (a.maxY < b.minY){ return 1; } else if (a.minY > b.maxY){ return -1; } else { return b.properties.height - a.properties.height } }); this._oids = oids; this._osmb.geoJSON({ type: 'FeatureCollection', features: jfs }); if (this._style) { this._osmb.setStyle(this._style); } }, _loadData: function() { if (this._mode == agsjs.layers.BuildingsLayer.MODE_SNAPSHOT) { if (this._oids) { return; } else { this._query.geometry = null; this._query.where = this._query.where || '1=1'; } } else { this._featureExt = this._map.extent.expand(this._extentScaleRatio); this._query.geometry = this._featureExt; } this._task.execute(this._query); }, _onQueryComplete: function(featureSet) { this._setFeatures(featureSet.features); } }); dojo.mixin(agsjs.layers.BuildingsLayer, { MODE_ONDEMAND: 0, MODE_SNAPSHOT: 1 });
37.13871
144
0.576739
28ae324647b4528d36b0d9d509cd4e11b25d5d44
1,998
js
JavaScript
src/components/form/components/FormCheckboxGroup/FormCheckboxGroup.stories.js
neuroio/ui-kit
0491ca3c8df4fac2bec2bd5cd3a238ddd0d4b661
[ "MIT" ]
null
null
null
src/components/form/components/FormCheckboxGroup/FormCheckboxGroup.stories.js
neuroio/ui-kit
0491ca3c8df4fac2bec2bd5cd3a238ddd0d4b661
[ "MIT" ]
null
null
null
src/components/form/components/FormCheckboxGroup/FormCheckboxGroup.stories.js
neuroio/ui-kit
0491ca3c8df4fac2bec2bd5cd3a238ddd0d4b661
[ "MIT" ]
null
null
null
import React from "react"; import styled from "styled-components"; import { storiesOf } from "@storybook/react"; import { useState } from "react"; import { FormCheckboxGroup } from "./index"; import { FormLabelTitle } from "../FormLabel"; import { generateOptions } from "../../../../../test/generate"; const options = generateOptions(5); const StyledForm = styled.form` ${FormLabelTitle} { width: 200px; } `; storiesOf("Form Components| FormCheckboxGroup", module).add("default", () => { function ComponentWrapper() { const [checked, setChecked] = useState([]); return ( <StyledForm data-testid="test-form"> <FormCheckboxGroup groupName="test-group" options={options} value={checked} onChange={setChecked} render={({ checkboxes, ...selectableProps }) => ( <div> <FormCheckboxGroup.Item name="test-group-select-all" label="Select all" data-testid="test-group-select-all" checked={selectableProps.isAllSelected} onChange={({ target }) => { if (target.checked) { selectableProps.selectAll(); } else { selectableProps.deselectAll(); } }} /> <FormCheckboxGroup.Item name="test-group-deselect-all" label="Deselect all" data-testid="test-group-deselect-all" checked={selectableProps.isAllDeselected} onChange={({ target }) => { if (!target.checked) { selectableProps.selectAll(); } else { selectableProps.deselectAll(); } }} /> {checkboxes()} </div> )} /> </StyledForm> ); } return <ComponentWrapper />; });
28.956522
78
0.502002
28af785215d709840294ee520f601337fe4c2d6e
1,581
js
JavaScript
test.js
giuseppeg/babel-plugin-universal-css-prop
be5f2d0b66342cf81eaf8aaa4175b114ea9ad6d0
[ "MIT" ]
24
2018-09-27T22:13:48.000Z
2021-01-23T11:11:07.000Z
test.js
giuseppeg/babel-plugin-universal-css-prop
be5f2d0b66342cf81eaf8aaa4175b114ea9ad6d0
[ "MIT" ]
null
null
null
test.js
giuseppeg/babel-plugin-universal-css-prop
be5f2d0b66342cf81eaf8aaa4175b114ea9ad6d0
[ "MIT" ]
null
null
null
const assert = require('assert') const transform = require('@babel/core').transform const plugin = require('./') transform( ` <span css={{ color: red }} /> `.trim(), { plugins: [ '@babel/plugin-syntax-jsx', [plugin, { importName: 'css', packageName: 'emotion' }] ] }, (err, result) => { if (err) { throw err } assert.equal( result.code, ` import { css as _cssProp } from "emotion"; <span className={_cssProp({ color: red })} />; `.trim() ) } ) // transform( // ` // <div className={[a,b && fo]} />; // `.trim(), // { plugins: ['@babel/plugin-syntax-jsx', [plugin, { importName: 'cx' }]] }, // (err, result) => { // if (err) { // throw err // } // assert.equal( // result.code, // ` // import { cx as _classNames } from "classnames"; // <div className={_classNames(a, b && fo)} />; // `.trim() // ) // } // ) // transform( // ` // <div className={[a,b && fo]}><div className={[styles.foo]} /></div>; // `.trim(), // { presets: ['@babel/env'], plugins: ['@babel/plugin-syntax-jsx', plugin] }, // (err, result) => { // if (err) { // throw err // } // assert.equal( // result.code, // ` // "use strict"; // var _classnames = _interopRequireDefault(require("classnames")); // function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // <div className={(0, _classnames.default)(a, b && fo)}><div className={(0, _classnames.default)(styles.foo)} /></div>; // `.trim() // ) // } // )
21.08
120
0.517394
28afef2ee44d0833968870626e5664b4115206d4
2,352
js
JavaScript
spec/lobbySpec.js
jacob-grahn/futurism-multi
dd21bbe1b14939a6fa91417bff608b7eb9360f63
[ "MIT" ]
null
null
null
spec/lobbySpec.js
jacob-grahn/futurism-multi
dd21bbe1b14939a6fa91417bff608b7eb9360f63
[ "MIT" ]
null
null
null
spec/lobbySpec.js
jacob-grahn/futurism-multi
dd21bbe1b14939a6fa91417bff608b7eb9360f63
[ "MIT" ]
3
2020-01-09T08:37:02.000Z
2020-01-17T03:49:13.000Z
'use strict'; describe('lobby', function() { var broadcast = require('../broadcast'); var Lobby = require('../lobby'); var lobby; beforeEach(function() { lobby = Lobby.createRoom('tester'); }); afterEach(function() { lobby.clear(); }); it('should create a matchup', function() { var matchup1 = lobby.createMatchup({_id:15}, {maxPride:20}); expect(matchup1.accounts[0]._id).toBe(15); expect(matchup1.rules.maxPride).toBe(20); var matchup2 = lobby.createMatchup({_id:123}, {maxPride:20}); expect(matchup2.accounts[0]._id).toBe(123); }); it('should remove a matchup if everyone leaves', function() { var user = {_id:15}; var matchup = lobby.createMatchup(user, {maxPride:20}); expect(lobby.matchups.idToValue(matchup.id)).toBeTruthy(); lobby.leaveMatchup(user); expect(lobby.matchups.idToValue(matchup.id)).toBeFalsy(); }); it('should not let the same user exist in two matchups', function() { var user = {_id:15}; var matchup1 = lobby.createMatchup(user, {maxPride:20}); expect(matchup1.accounts.length).toBe(1); var matchup2 = lobby.createMatchup(user, {maxPride:25}); expect(matchup1.accounts.length).toBe(0); expect(matchup2.accounts.length).toBe(1); expect(lobby.matchups.toArray().length).toBe(1); expect(lobby.matchups.toArray()[0].rules.maxPride).toBe(25); var err = lobby.joinMatchup(user, matchup2.id); expect(err).toContain('already'); var user2 = {_id:1}; var matchup3 = lobby.createMatchup(user2, {maxPride:70, players: 4}); lobby.joinMatchup(user, matchup3.id); expect(lobby.matchups.toArray().length).toBe(1); expect(lobby.matchups.toArray()[0].accounts.length).toBe(2); }); it('should start a match that has reached its player count', function() { var user1 = {_id:1, hand: [], deck: []}; var user2 = {_id:2, hand: [], deck: []}; var user3 = {_id:3, hand: [], deck: []}; var matchup = lobby.createMatchup(user1, {players:3, pride:50}); lobby.joinMatchup(user2, matchup.id); lobby.joinMatchup(user3, matchup.id); expect(broadcast.lastMessage.event).toBe('startMatchup'); }); });
31.783784
77
0.606718
28b06374ce8a80a5f851778890a54017faeb59f3
545
js
JavaScript
gatsby-config.js
mastapegs/amandazdealz
33262cfbf0a2f1c2985caf49cbb2eeb179b6de1b
[ "MIT" ]
null
null
null
gatsby-config.js
mastapegs/amandazdealz
33262cfbf0a2f1c2985caf49cbb2eeb179b6de1b
[ "MIT" ]
null
null
null
gatsby-config.js
mastapegs/amandazdealz
33262cfbf0a2f1c2985caf49cbb2eeb179b6de1b
[ "MIT" ]
null
null
null
/** * Configure your Gatsby site with this file. * * See: https://www.gatsbyjs.org/docs/gatsby-config/ */ module.exports = { /* Your site config here */ plugins: [ { resolve: `gatsby-source-shopify`, options: { // The domain name of your Shopify shop. shopName: `amandaz-dealz.myshopify.com`, // The storefront access token accessToken: `7bb072426eb538dc4f6a913355f95c24`, }, }, 'gatsby-transformer-sharp', 'gatsby-plugin-sharp', 'gatsby-plugin-react-helmet' ], }
22.708333
56
0.614679
28b06a1dc741dea8c54a201f01f80f0998788e55
3,956
js
JavaScript
node_modules/tslint-microsoft-contrib/noInnerHtmlRule.js
GhostMachineSoftware/SPFX_UsefulLinks
5f75dac4adb579948b85f497394db943bb891462
[ "MIT" ]
1
2022-03-05T01:49:46.000Z
2022-03-05T01:49:46.000Z
node_modules/tslint-microsoft-contrib/noInnerHtmlRule.js
GhostMachineSoftware/SPFX_UsefulLinks
5f75dac4adb579948b85f497394db943bb891462
[ "MIT" ]
2
2020-11-17T09:19:44.000Z
2021-05-10T22:12:39.000Z
node_modules/tslint-microsoft-contrib/noInnerHtmlRule.js
GhostMachineSoftware/SPFX_UsefulLinks
5f75dac4adb579948b85f497394db943bb891462
[ "MIT" ]
1
2020-10-19T13:47:51.000Z
2020-10-19T13:47:51.000Z
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var ts = require("typescript"); var Lint = require("tslint"); var ErrorTolerantWalker_1 = require("./utils/ErrorTolerantWalker"); var AstUtils_1 = require("./utils/AstUtils"); var FAILURE_INNER = 'Writing a string to the innerHTML property is insecure: '; var FAILURE_OUTER = 'Writing a string to the outerHTML property is insecure: '; var FAILURE_HTML_LIB = 'Using the html() function to write a string to innerHTML is insecure: '; var Rule = (function (_super) { __extends(Rule, _super); function Rule() { return _super !== null && _super.apply(this, arguments) || this; } Rule.prototype.apply = function (sourceFile) { return this.applyWithWalker(new NoInnerHtmlRuleWalker(sourceFile, this.getOptions())); }; Rule.metadata = { ruleName: 'no-inner-html', type: 'maintainability', description: 'Do not write values to innerHTML, outerHTML, or set HTML using the JQuery html() function.', options: null, optionsDescription: '', typescriptOnly: true, issueClass: 'SDL', issueType: 'Error', severity: 'Critical', level: 'Mandatory', group: 'Security', commonWeaknessEnumeration: '79, 85, 710' }; return Rule; }(Lint.Rules.AbstractRule)); exports.Rule = Rule; var NoInnerHtmlRuleWalker = (function (_super) { __extends(NoInnerHtmlRuleWalker, _super); function NoInnerHtmlRuleWalker(sourceFile, options) { var _this = _super.call(this, sourceFile, options) || this; _this.htmlLibExpressionRegex = /^(jquery|[$])/i; var opt = _this.getOptions(); if (typeof opt[1] === 'object' && opt[1]['html-lib-matcher']) { _this.htmlLibExpressionRegex = new RegExp(opt[1]['html-lib-matcher']); } return _this; } NoInnerHtmlRuleWalker.prototype.visitBinaryExpression = function (node) { if (node.operatorToken.kind === ts.SyntaxKind.EqualsToken) { if (node.left.kind === ts.SyntaxKind.PropertyAccessExpression) { var propAccess = node.left; var propName = propAccess.name.text; if (propName === 'innerHTML') { this.addFailureAt(node.getStart(), node.getWidth(), FAILURE_INNER + node.getText()); } else if (propName === 'outerHTML') { this.addFailureAt(node.getStart(), node.getWidth(), FAILURE_OUTER + node.getText()); } } } _super.prototype.visitBinaryExpression.call(this, node); }; NoInnerHtmlRuleWalker.prototype.visitCallExpression = function (node) { var functionName = AstUtils_1.AstUtils.getFunctionName(node); if (functionName === 'html') { if (node.arguments.length > 0) { var functionTarget = AstUtils_1.AstUtils.getFunctionTarget(node); if (this.htmlLibExpressionRegex.test(functionTarget)) { this.addFailureAt(node.getStart(), node.getWidth(), FAILURE_HTML_LIB + node.getText()); } } } _super.prototype.visitCallExpression.call(this, node); }; return NoInnerHtmlRuleWalker; }(ErrorTolerantWalker_1.ErrorTolerantWalker)); //# sourceMappingURL=noInnerHtmlRule.js.map
46.541176
115
0.607432
28b12f7dc4378c698afcd04a86c076673c8f0381
2,228
js
JavaScript
webpack.dev.config.js
ErandiniJim/fish-project
a1ddee8e97250735e7827f590875b480780e29c4
[ "MIT" ]
null
null
null
webpack.dev.config.js
ErandiniJim/fish-project
a1ddee8e97250735e7827f590875b480780e29c4
[ "MIT" ]
9
2021-12-02T03:32:45.000Z
2021-12-08T06:53:43.000Z
webpack.dev.config.js
ErandiniJim/fish-project
a1ddee8e97250735e7827f590875b480780e29c4
[ "MIT" ]
null
null
null
const path = require('path'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const EslintWebpackPlugin = require('eslint-webpack-plugin'); module.exports = { // 1. Se estrablece modo desarrollo mode: 'development', // 2. Especificar archivo entrada entry: './client/index.js', // 3. Salida de empaquetado output: { // 4. Ruta absoluta salida path: path.join(__dirname, 'public'), // 5. Nombre archivo salida filename: 'js/bundle.js', // 6. Servidor desarrollo, ruta path publico publicPath: '/' }, module: { rules: [ { test: /\.js$ /, exclude: /(node_modules|bower_components)/, use: [ { loader: 'babel-loader', options: { presets: [ [ '@babel/preset-env', { 'modules': false, 'useBuiltIns': 'usage', 'targets': {"chrome": "80"}, 'corejs': 3 } ] ], "plugins": [ [ "module-resolver", { "root": ["./"], "alias":{ "@client" : "./client", } } ] ] } } ] }, { test: /\.css$/, use: [MiniCssExtractPlugin.loader, 'css-loader'] } ] }, plugins: [ new MiniCssExtractPlugin({ filename: 'styles/app.css' }), new EslintWebpackPlugin() ] }
33.757576
68
0.307002
28b13b64aaa3850ccde14af0992d081baae195fb
2,532
js
JavaScript
tests-manual/qml/qml/qml/+osx/UI.js
Darlingnotin/Antisocial_VR
f1debafb784ed5a63a40fe9b80790fbaccfedfce
[ "Apache-2.0" ]
272
2021-01-07T03:06:08.000Z
2022-03-25T03:54:07.000Z
tests-manual/qml/qml/qml/+osx/UI.js
Darlingnotin/Antisocial_VR
f1debafb784ed5a63a40fe9b80790fbaccfedfce
[ "Apache-2.0" ]
1,021
2020-12-12T02:33:32.000Z
2022-03-31T23:36:37.000Z
tests-manual/qml/qml/qml/+osx/UI.js
Darlingnotin/Antisocial_VR
f1debafb784ed5a63a40fe9b80790fbaccfedfce
[ "Apache-2.0" ]
77
2020-12-15T06:59:34.000Z
2022-03-23T22:18:04.000Z
/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** BSD License Usage ** Alternatively, you may use this file under the terms of the BSD license ** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are ** met: ** * Redistributions of source code must retain the above copyright ** notice, this list of conditions and the following disclaimer. ** * Redistributions in binary form must reproduce the above copyright ** notice, this list of conditions and the following disclaimer in ** the documentation and/or other materials provided with the ** distribution. ** * Neither the name of The Qt Company Ltd nor the names of its ** contributors may be used to endorse or promote products derived ** from this software without specific prior written permission. ** ** ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** ****************************************************************************/ .pragma library var margin = 12 var tabPosition = Qt.TopEdge var label = ""
45.214286
77
0.706556
28b142ca0afe8f46d08d74da231a164c6347ed36
402
js
JavaScript
test/node_modules/pt5/index.js
mwri/plugorg
0bbdeda8c250c68f17f2a9d4b024c760c8d664db
[ "MIT" ]
null
null
null
test/node_modules/pt5/index.js
mwri/plugorg
0bbdeda8c250c68f17f2a9d4b024c760c8d664db
[ "MIT" ]
13
2019-10-30T07:42:05.000Z
2022-03-10T08:37:43.000Z
test/node_modules/pt5/index.js
mwri/plugorg
0bbdeda8c250c68f17f2a9d4b024c760c8d664db
[ "MIT" ]
null
null
null
(function () { 'use strict'; let pt5 = (function() { let pt5 = function pt5 () { }; pt5.prototype.po_name = function () { return 'pt5'; }; pt5.prototype.po_attribs = function () { return { name: 'bad' }; }; return pt5; })(); if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') { module.exports = pt5; } else { window.pt5 = pt5; } }) ();
8.933333
77
0.544776
28b1a026e59709c1875afdb343d43bc4e770f64c
5,387
js
JavaScript
src/example/layer-other/s3m/basis/map.js
marsgis/mars3d-vue3-example
1590336774055e301e02d3f603d51ecd24060ae7
[ "Apache-2.0" ]
null
null
null
src/example/layer-other/s3m/basis/map.js
marsgis/mars3d-vue3-example
1590336774055e301e02d3f603d51ecd24060ae7
[ "Apache-2.0" ]
null
null
null
src/example/layer-other/s3m/basis/map.js
marsgis/mars3d-vue3-example
1590336774055e301e02d3f603d51ecd24060ae7
[ "Apache-2.0" ]
null
null
null
import * as mars3d from "mars3d" export let map // 需要覆盖config.json中地图属性参数(当前示例框架中自动处理合并) export const mapOptions = { scene: { center: { lat: 28.440864, lng: 119.486477, alt: 588.23, heading: 268.6, pitch: -37.8, roll: 359.8 }, fxaa: true, requestRenderMode: true // 显式渲染 }, control: { infoBox: false }, layers: [] } /** * 初始化地图业务,生命周期钩子函数(必须) * 框架在地图初始化完成后自动调用该函数 * @param {mars3d.Map} mapInstance 地图对象 * @returns {void} 无 */ export function onMounted(mapInstance) { map = mapInstance // 记录首次创建的map map.fixedLight = true // 固定光照,避免gltf模型随时间存在亮度不一致。 globalNotify("已知问题提示", `当前使用的是原生Cesium+SuperMap3D插件方式,很多API不支持,完整方式需要参考Github开源代码切换Cesium到超图版Cesium。`) showMaxNiaochaoDemo() } /** * 释放当前地图业务的生命周期函数 * @returns {void} 无 */ export function onUnmounted() { removeLayer() map = null } let s3mLayer function removeLayer() { if (s3mLayer) { map.basemap = 2021 // 切换到默认影像底图 map.removeLayer(s3mLayer, true) s3mLayer = null } } // 示例:人工建模 鸟巢 export function showMaxNiaochaoDemo() { removeLayer() s3mLayer = new mars3d.layer.S3MLayer({ name: "鸟巢", url: "http://www.supermapol.com/realspace/services/3D-OlympicGreen/rest/realspace", flyTo: true }) map.addLayer(s3mLayer) // 可以绑定Popup弹窗,回调方法中任意处理 // s3mLayer.bindPopup(function (event) { // var attr = event.graphic.attr; // // attr["视频"] = `<video src='//data.mars3d.cn/file/video/lukou.mp4' controls autoplay style="width: 300px;" ></video>`; // return mars3d.Util.getTemplateHtml({ title: "石化工厂", template: "all", attr: attr }); // }); // 单击事件 // s3mLayer.on(mars3d.EventType.click, function (event) { // console.log("单击了3dtiles图层", event); // }); } // 示例:人工建模 CBD export function showMaxCBDDemo() { removeLayer() s3mLayer = new mars3d.layer.S3MLayer({ name: "人工建模CBD", url: "http://www.supermapol.com/realspace/services/3D-CBD/rest/realspace", flyTo: true }) map.addLayer(s3mLayer) } // 示例: 地下管网 export function showMaxPipeDemo() { removeLayer() globalMsg("插件版暂不支持 “fillForeColor” 参数的修改") s3mLayer = new mars3d.layer.S3MLayer({ name: "地下管网", url: "http://www.supermapol.com/realspace/services/3D-pipe/rest/realspace", center: { lat: 45.768407, lng: 126.621981, alt: 101, heading: 162, pitch: -38 }, flyTo: true }) map.addLayer(s3mLayer) // 加载完成Promise s3mLayer.readyPromise.then(function (s3mLayer) { console.log("s3m模型加载完成", s3mLayer) const layers = s3mLayer.layer const overGroundLayer = layers[25] overGroundLayer.style3D.fillForeColor.alpha = 0.5 // for (var i = 0; i < layers.length; i++) { // var layerName = layers[i].name; // if ( // layerName === "雨水井盖" || // layerName === "消防水井盖" || // layerName === "中水井盖" || // layerName === "生活水井盖" || // layerName === "路灯井盖" // ) { // layers[i].setPBRMaterialFromJSON("./data/pbr/showUnderGround/jing2/UnityUDBJG2.json"); // } // if ( // layerName === "中水管线" || // layerName === "雨水管线" || // layerName === "消防水管线" || // layerName === "生活水管线" || // layerName === "路灯管线" // ) { // layers[i].setPBRMaterialFromJSON("./data/pbr/showUnderGround/piple.json"); // } // } }) } // 示例:BIM export function showBIMQiaoDemo() { removeLayer() s3mLayer = new mars3d.layer.S3MLayer({ name: "BIM桥梁", url: "http://www.supermapol.com/realspace/services/3D-BIMMoXing/rest/realspace", center: { lat: 40.234379, lng: 116.148777, alt: 223, heading: 331, pitch: -19 }, flyTo: true }) map.addLayer(s3mLayer) // 加载完成Promise s3mLayer.readyPromise.then(function (s3mLayer) { console.log("s3m模型加载完成", s3mLayer) const layers = s3mLayer.layer for (const layer of layers) { // 设置边框线 layer.style3D.lineWidth = 0.5 layer.style3D.lineColor = new Cesium.Color(60 / 255, 60 / 255, 60 / 255, 1) layer.style3D.fillStyle = Cesium.FillStyle.Fill_And_WireFrame layer.wireFrameMode = Cesium.WireFrameType.EffectOutline } }) } // 示例:倾斜摄影 哈尔滨索菲亚教堂 export function showQxSuofeiyaDemo() { removeLayer() s3mLayer = new mars3d.layer.S3MLayer({ name: "哈尔滨索菲亚教堂", type: "supermap_s3m", url: "http://www.supermapol.com/realspace/services/3D-suofeiya_church/rest/realspace", s3mOptions: { selectEnabled: false }, position: { alt: 140 }, center: { lat: 45.769034, lng: 126.623702, alt: 291, heading: 250, pitch: -36 }, flyTo: true }) map.addLayer(s3mLayer) // 事件 s3mLayer.on(mars3d.EventType.load, function (event) { console.log("s3m模型加载完成", event) }) } // 示例:倾斜摄影 萨尔茨堡 export function showQxSrsbDemo() { removeLayer() s3mLayer = new mars3d.layer.S3MLayer({ name: "萨尔茨堡", url: "http://www.supermapol.com/realspace/services/3D-srsb/rest/realspace", // position: { alt: 400 }, center: { lat: 47.803782, lng: 13.04465, alt: 582, heading: 0, pitch: -40 }, flyTo: true }) map.addLayer(s3mLayer) // 加载完成Promise s3mLayer.readyPromise.then(function (s3mLayer) { console.log("s3m模型加载完成", s3mLayer) // 查找水面图层 // var waterLayer = s3mLayer.layer[1]; // var style = new Cesium.Style3D(); // style.bottomAltitude = 5; //设置水面图层的底部高程,确保水面与模型贴合 // waterLayer.style3D = style; }) }
24.824885
126
0.630963
28b1a4d124285f22f9e925c74ecdd6ddd17810aa
3,957
js
JavaScript
node_modules/office-ui-fabric-react/lib-commonjs/components/Dialog/Dialog.doc.js
GhostMachineSoftware/SPFx_Connect2List
9d54d6430a0fea830385a8bd1c7f748547b41c35
[ "MIT" ]
1
2020-08-06T19:22:04.000Z
2020-08-06T19:22:04.000Z
node_modules/office-ui-fabric-react/lib-commonjs/components/Dialog/Dialog.doc.js
GhostMachineSoftware/SPFx_Connect2List
9d54d6430a0fea830385a8bd1c7f748547b41c35
[ "MIT" ]
null
null
null
node_modules/office-ui-fabric-react/lib-commonjs/components/Dialog/Dialog.doc.js
GhostMachineSoftware/SPFx_Connect2List
9d54d6430a0fea830385a8bd1c7f748547b41c35
[ "MIT" ]
null
null
null
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var React = require("react"); var Dialog_Basic_Example_1 = require("./examples/Dialog.Basic.Example"); var Dialog_LargeHeader_Example_1 = require("./examples/Dialog.LargeHeader.Example"); var Dialog_Blocking_Example_1 = require("./examples/Dialog.Blocking.Example"); var Dialog_TopOffsetFixed_Example_1 = require("./examples/Dialog.TopOffsetFixed.Example"); var Dialog_checklist_1 = require("./Dialog.checklist"); var DialogBasicExampleCode = require('!raw-loader!office-ui-fabric-react/src/components/Dialog/examples/Dialog.Basic.Example.tsx'); var DialogLargeHeaderExampleCode = require('!raw-loader!office-ui-fabric-react/src/components/Dialog/examples/Dialog.LargeHeader.Example.tsx'); var DialogBlockingExampleCode = require('!raw-loader!office-ui-fabric-react/src/components/Dialog/examples/Dialog.Blocking.Example.tsx'); var DialogTopOffsetFixedExampleCode = require('!raw-loader!office-ui-fabric-react/src/components/Dialog/examples/Dialog.TopOffsetFixed.Example.tsx'); var DialogBlockingExampleCodepen = require('!raw-loader!office-ui-fabric-react/lib/codepen/components/Dialog/Dialog.Blocking.Example.Codepen.txt'); exports.DialogPageProps = { title: 'Dialog', componentName: 'Dialog', componentUrl: 'https://github.com/OfficeDev/office-ui-fabric-react/tree/master/packages/office-ui-fabric-react/src/components/Dialog', componentStatus: Dialog_checklist_1.DialogStatus, examples: [ { title: 'Default Dialog', code: DialogBasicExampleCode, view: React.createElement(Dialog_Basic_Example_1.DialogBasicExample, null) }, { title: 'Dialog with large header and ChoiceGroup', code: DialogLargeHeaderExampleCode, view: (React.createElement(React.Fragment, null, React.createElement("p", null, "Use this Dialog sparingly, when calling extra attention to the content. It can be used in situations where you want to teach the user something or notify them of an important change."), React.createElement(Dialog_LargeHeader_Example_1.DialogLargeHeaderExample, null))) }, { title: 'Blocking Dialog', code: DialogBlockingExampleCode, view: (React.createElement(React.Fragment, null, React.createElement("p", null, "A blocking Dialog disables all other actions and commands on the page behind it. They should be used very sparingly, only when it is critical that the user makes a choice or provides information before they can proceed. Blocking Dialogs are generally used for irreversible or potentially destructive tasks."), React.createElement(Dialog_Blocking_Example_1.DialogBlockingExample, null))), codepenJS: DialogBlockingExampleCodepen }, { title: 'Dialog with Top Offset Fixed', code: DialogTopOffsetFixedExampleCode, view: (React.createElement(React.Fragment, null, React.createElement("p", null, "This Dialog maintains its top position and expands only the bottom, offering a more stable appearance when a Dialog's content changes dynamically."), React.createElement(Dialog_TopOffsetFixed_Example_1.DialogTopOffsetFixedExample, null))) } ], propertiesTablesSources: [require('!raw-loader!office-ui-fabric-react/src/components/Dialog/Dialog.types.ts')], overview: require('!raw-loader!office-ui-fabric-react/src/components/Dialog/docs/DialogOverview.md'), bestPractices: '', dos: require('!raw-loader!office-ui-fabric-react/src/components/Dialog/docs/DialogDos.md'), donts: require('!raw-loader!office-ui-fabric-react/src/components/Dialog/docs/DialogDonts.md'), isHeaderVisible: true, isFeedbackVisible: true }; //# sourceMappingURL=Dialog.doc.js.map
70.660714
358
0.722264
28b229532d3393f96492acc7401a9d56084bda27
685
js
JavaScript
src/components/ControlPresupuesto.js
barosv/learn-react-project-02
cd27a27d15b2908281d84a4545ada2329ef6ccf2
[ "MIT" ]
null
null
null
src/components/ControlPresupuesto.js
barosv/learn-react-project-02
cd27a27d15b2908281d84a4545ada2329ef6ccf2
[ "MIT" ]
null
null
null
src/components/ControlPresupuesto.js
barosv/learn-react-project-02
cd27a27d15b2908281d84a4545ada2329ef6ccf2
[ "MIT" ]
null
null
null
import React, { Fragment } from 'react'; import { revisarPresupuesto } from '../components/Helpers' import PropTypes from 'prop-types'; const ControlPresupuesto = ( { presupuesto, restante}) => { return ( <Fragment> <div className="alert alert-primary"> Presupuesto: $ {presupuesto} </div> <div className={revisarPresupuesto(presupuesto, restante)}> Restante: $ {restante} </div> </Fragment> ); }; ControlPresupuesto.propTypes = { presupuesto: PropTypes.number.isRequired, restante: PropTypes.number.isRequired } export default ControlPresupuesto;
29.782609
72
0.60438
28b2f99928ad5b68ab2a78b48099cbe3ff963c3b
2,935
js
JavaScript
plugins/object-fit/ls.object-fit.min.js
Dotdashcom/lazysizes
d66eba7c80530bea592152c512316442b768eefa
[ "MIT" ]
7
2020-05-06T10:14:02.000Z
2020-09-12T08:10:54.000Z
plugins/object-fit/ls.object-fit.min.js
Dotdashcom/lazysizes
d66eba7c80530bea592152c512316442b768eefa
[ "MIT" ]
null
null
null
plugins/object-fit/ls.object-fit.min.js
Dotdashcom/lazysizes
d66eba7c80530bea592152c512316442b768eefa
[ "MIT" ]
null
null
null
/*! lazysizes - v5.2.0 */ !function(a,b){if(a){var c=function(d){b(a.lazySizes,d),a.removeEventListener("lazyunveilread",c,!0)};b=b.bind(null,a,a.document),"object"==typeof module&&module.exports?b(require("lazysizes")):a.lazySizes?c():a.addEventListener("lazyunveilread",c,!0)}}("undefined"!=typeof window?window:0,function(a,b,c,d){"use strict";function e(a){var b=getComputedStyle(a,null)||{},c=b.fontFamily||"",d=c.match(m)||"",e=d&&c.match(n)||"";return e&&(e=e[1]),{fit:d&&d[1]||"",position:q[e]||e||"center"}}function f(){if(!i){var a=b.createElement("style");i=c.cfg.objectFitClass||"lazysizes-display-clone",b.querySelector("head").appendChild(a)}}function g(a){var b=a.previousElementSibling;b&&c.hC(b,i)&&(b.parentNode.removeChild(b),a.style.position=b.getAttribute("data-position")||"",a.style.visibility=b.getAttribute("data-visibility")||"")}function h(a,b){var d,e,h,j,k=c.cfg,l=function(){var b=a.currentSrc||a.src;b&&e!==b&&(e=b,j.backgroundImage="url("+(p.test(b)?JSON.stringify(b):b)+")",d||(d=!0,c.rC(h,k.loadingClass),c.aC(h,k.loadedClass)))},m=function(){c.rAF(l)};a._lazysizesParentFit=b.fit,a.addEventListener("lazyloaded",m,!0),a.addEventListener("load",m,!0),c.rAF(function(){var d=a,e=a.parentNode;"PICTURE"==e.nodeName.toUpperCase()&&(d=e,e=e.parentNode),g(d),i||f(),h=a.cloneNode(!1),j=h.style,h.addEventListener("load",function(){var a=h.currentSrc||h.src;a&&a!=o&&(h.src=o,h.srcset="")}),c.rC(h,k.loadedClass),c.rC(h,k.lazyClass),c.rC(h,k.autosizesClass),c.aC(h,k.loadingClass),c.aC(h,i),["data-parent-fit","data-parent-container","data-object-fit-polyfilled",k.srcsetAttr,k.srcAttr].forEach(function(a){h.removeAttribute(a)}),h.src=o,h.srcset="",j.backgroundRepeat="no-repeat",j.backgroundPosition=b.position,j.backgroundSize=b.fit,h.setAttribute("data-position",d.style.position),h.setAttribute("data-visibility",d.style.visibility),d.style.visibility="hidden",d.style.position="absolute",a.setAttribute("data-parent-fit",b.fit),a.setAttribute("data-parent-container","prev"),a.setAttribute("data-object-fit-polyfilled",""),a._objectFitPolyfilledDisplay=h,e.insertBefore(h,d),a._lazysizesParentFit&&delete a._lazysizesParentFit,a.complete&&l()})}var i,j=b.createElement("a").style,k="objectFit"in j,l=k&&"objectPosition"in j,m=/object-fit["']*\s*:\s*["']*(contain|cover)/,n=/object-position["']*\s*:\s*["']*(.+?)(?=($|,|'|"|;))/,o="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",p=/\(|\)|'/,q={center:"center","50% 50%":"center"};if(!k||!l){var r=function(a){if(a.detail.instance==c){var b=a.target,d=e(b);return!(!d.fit||k&&"center"==d.position)&&(h(b,d),!0)}};a.addEventListener("lazybeforesizes",function(a){if(a.detail.instance==c){var b=a.target;null==b.getAttribute("data-object-fit-polyfilled")||b._objectFitPolyfilledDisplay||r(a)||c.rAF(function(){b.removeAttribute("data-object-fit-polyfilled")})}}),a.addEventListener("lazyunveilread",r,!0),d&&d.detail&&r(d)}});
1,467.5
2,909
0.705281
28b30f48d00124e6a69ade6ffa23b92ee9f20ab5
4,575
js
JavaScript
src/api/variants/variant.js
sebimoe/fractal
9596257acd7b0341ded6cd8022b94c932c7a75c8
[ "MIT" ]
1
2019-08-25T15:40:59.000Z
2019-08-25T15:40:59.000Z
src/api/variants/variant.js
davgit/fractal
0d4c3ce37f11e5bafe8c884d323ba8f93eb82402
[ "MIT" ]
null
null
null
src/api/variants/variant.js
davgit/fractal
0d4c3ce37f11e5bafe8c884d323ba8f93eb82402
[ "MIT" ]
null
null
null
'use strict'; const Path = require('path'); const _ = require('lodash'); const utils = require('../../core/utils'); const Entity = require('../../core/entities/entity'); module.exports = class Variant extends Entity { constructor(config, view, resources, parent) { super(config.name, config, parent); this.isVariant = true; this.view = config.view; this.viewPath = config.viewPath; this.viewDir = config.dir; this.relViewPath = Path.relative(this.source.fullPath, Path.resolve(this.viewPath)); this.isDefault = config.isDefault || false; this.lang = view.lang.name; this.editorMode = view.lang.mode; this.editorScope = view.lang.scope; this._notes = config.notes || config.readme || null; this._view = view; this._resources = resources; this._referencedBy = null; this._references = null; } _title(config) { return config.title || `${this.parent.title}: ${this.label}`; } _handle(config) { return utils.slugify(config.handle).toLowerCase(); } get notes() { return this._notes || this.parent.notes; } get alias() { if (this.isDefault) { return this.parent.handle; } return null; } get siblings() { return this.parent.variants(); } get content() { return this.getContentSync(); } get baseHandle() { return this.parent.handle; } get references() { if (!this._references) { try { this._references = this.source._engine.getReferencesForView(this.handle); } catch (e) { // older Adapters will throw an error because getReferencesForView is not defined this._references = this._parseReferences(); } } return this._references; } get referencedBy() { if (!this._referencedBy) { this._referencedBy = this.source.getReferencesOf(this); } return this._referencedBy; } render(context, env, opts) { return this.source.render(this, context, env, opts); } /* * Deprecated, do not use! */ renderWithGlobals(context, globals, preview, collate) { return this.source.render(this, context, { request: globals._request || {}, server: globals._env.server, builder: globals._env.builder, }, { preview: preview, collate: collate, }); } /* * Deprecated, do not use! */ _parseReferences() { const matcher = /\@[0-9a-zA-Z\-\_]*/g; const content = this.content; const referenced = content.match(matcher) || []; return _.uniq(_.compact(referenced.map(handle => this.source.find(this.handle)))); } getPreviewContext() { return this.getResolvedContext(); } getPreviewContent() { return this.getContent(); } component() { return this.parent; } variant() { return this; } defaultVariant() { return this; } resources() { return this._resources; } resourcesJSON() { const items = {}; for (const item of this.resources()) { items[item.name] = item.toJSON().items; } return items; } getContent() { return this._view.read().then(c => c.toString()); } getContentSync() { return this._view.readSync().toString(); } toJSON() { const self = super.toJSON(); self.isVariant = true; self.baseHandle = this.baseHandle; self.alias = this.alias; self.notes = this.notes; self.meta = this.meta; self.status = this.status; self.display = this.display; self.isDefault = this.isDefault; self.viewPath = this.viewPath; self.preview = this.preview; self.context = this.getContext(); self.resources = this.resourcesJSON(); self.content = this.getContentSync(); self.lang = this.lang; self.editorMode = this.editorMode; self.editorScope = this.editorScope; return self; } static create(config, view, resources, parent) { parent.source.emit('variant:beforeCreate', config, view, resources, parent); const variant = new Variant(config, view, resources, parent); parent.source.emit('variant:created', variant); return variant; } };
26.142857
97
0.566776
28b32916c6f84847f9dd0e649a1f438197e4340c
239
js
JavaScript
.eslintrc.js
rafaelcalhau/devplaces-mobile
a330b15415b2619da2fd99b61ec42caf2713ebee
[ "MIT" ]
null
null
null
.eslintrc.js
rafaelcalhau/devplaces-mobile
a330b15415b2619da2fd99b61ec42caf2713ebee
[ "MIT" ]
1
2021-09-02T02:33:44.000Z
2021-09-02T02:33:44.000Z
.eslintrc.js
rafaelcalhau/devplaces-mobile
a330b15415b2619da2fd99b61ec42caf2713ebee
[ "MIT" ]
null
null
null
module.exports = { root: true, extends: [ '@react-native-community', 'plugin:@typescript-eslint/recommended', 'plugin:security/recommended', 'standard' ], plugins: [ '@typescript-eslint', 'security' ], };
17.071429
44
0.606695
28b375e5f203ac6d337bf03c060029d5122c2221
208
js
JavaScript
docs/Chip16/search/functions_6c.js
faouellet/CHIP-16
f85aed30d849052ac057092b124321953de80db6
[ "BSD-3-Clause" ]
null
null
null
docs/Chip16/search/functions_6c.js
faouellet/CHIP-16
f85aed30d849052ac057092b124321953de80db6
[ "BSD-3-Clause" ]
null
null
null
docs/Chip16/search/functions_6c.js
faouellet/CHIP-16
f85aed30d849052ac057092b124321953de80db6
[ "BSD-3-Clause" ]
null
null
null
var searchData= [ ['load',['Load',['../class_c_p_u.html#ab94b5f27f05255eba968a806e673cb7d',1,'CPU']]], ['loadpalette',['LoadPalette',['../class_g_p_u.html#a2188ac90b4e81072f3cd7f828d6b36bc',1,'GPU']]] ];
34.666667
99
0.706731
28b3a67c22f20dcbe3f17ef1050c95a1073408a6
4,819
js
JavaScript
public/extjs/packages/sencha-core/src/event/gesture/Swipe.js
Varus/FlightPub
0dec78b9eaa8fcdb6b254999f285716e93e9d332
[ "Apache-2.0" ]
2
2015-01-10T06:31:42.000Z
2016-01-26T11:53:06.000Z
public/extjs/packages/sencha-core/src/event/gesture/Swipe.js
Varus/FlightPub
0dec78b9eaa8fcdb6b254999f285716e93e9d332
[ "Apache-2.0" ]
null
null
null
public/extjs/packages/sencha-core/src/event/gesture/Swipe.js
Varus/FlightPub
0dec78b9eaa8fcdb6b254999f285716e93e9d332
[ "Apache-2.0" ]
null
null
null
/** * A gesture recognizer for swipe events */ Ext.define('Ext.event.gesture.Swipe', { extend: 'Ext.event.gesture.SingleTouch', handledEvents: ['swipestart', 'swipe', 'swipecancel'], /** * @member Ext.dom.Element * @event swipe * Fires when there is a swipe * When listening to this, ensure you know about the {@link Ext.event.Event#direction} property in the `event` object. * @param {Ext.event.Event} event The {@link Ext.event.Event} event encapsulating the DOM event. * @param {HTMLElement} node The target of the event. * @param {Object} options The options object passed to Ext.mixin.Observable.addListener. */ /** * @property {Number} direction * The direction of the swipe. Available options are: * * - up * - down * - left * - right * * **This is only available when the event type is `swipe`** * @member Ext.event.Event */ /** * @property {Number} duration * The duration of the swipe. * * **This is only available when the event type is `swipe`** * @member Ext.event.Event */ inheritableStatics: { MAX_OFFSET_EXCEEDED: 'Max Offset Exceeded', MAX_DURATION_EXCEEDED: 'Max Duration Exceeded', DISTANCE_NOT_ENOUGH: 'Distance Not Enough' }, config: { minDistance: 80, maxOffset: 35, maxDuration: 1000 }, onTouchStart: function(e) { if (this.callParent(arguments) === false) { return false; } var touch = e.changedTouches[0]; this.startTime = e.time; this.isHorizontal = true; this.isVertical = true; this.startX = touch.pageX; this.startY = touch.pageY; }, onTouchMove: function(e) { var touch = e.changedTouches[0], x = touch.pageX, y = touch.pageY, deltaX = x - this.startX, deltaY = y - this.startY, absDeltaX = Math.abs(x - this.startX), absDeltaY = Math.abs(y - this.startY), duration = e.time - this.startTime, minDistance = this.getMinDistance(), time = e.time, direction, distance; if (time - this.startTime > this.getMaxDuration()) { return this.fail(this.self.MAX_DURATION_EXCEEDED); } if (this.isHorizontal && absDeltaY > this.getMaxOffset()) { this.isHorizontal = false; } if (this.isVertical && absDeltaX > this.getMaxOffset()) { this.isVertical = false; } if (!this.isVertical || !this.isHorizontal) { if (this.isHorizontal && absDeltaX < minDistance) { direction = (deltaX < 0) ? 'left' : 'right'; distance = absDeltaX; } else if (this.isVertical && absDeltaY < minDistance) { direction = (deltaY < 0) ? 'up' : 'down'; distance = absDeltaY; } } if (direction && !this.started) { this.started = true; this.fire('swipestart', e, { touch: touch, direction: direction, distance: distance, duration: duration }); } if (!this.isHorizontal && !this.isVertical) { return this.fail(this.self.MAX_OFFSET_EXCEEDED); } }, onTouchEnd: function(e) { if (this.onTouchMove(e) === false) { return false; } var touch = e.changedTouches[0], x = touch.pageX, y = touch.pageY, deltaX = x - this.startX, deltaY = y - this.startY, absDeltaX = Math.abs(deltaX), absDeltaY = Math.abs(deltaY), minDistance = this.getMinDistance(), duration = e.time - this.startTime, direction, distance; if (this.isVertical && absDeltaY < minDistance) { this.isVertical = false; } if (this.isHorizontal && absDeltaX < minDistance) { this.isHorizontal = false; } if (this.isHorizontal) { direction = (deltaX < 0) ? 'left' : 'right'; distance = absDeltaX; } else if (this.isVertical) { direction = (deltaY < 0) ? 'up' : 'down'; distance = absDeltaY; } else { return this.fail(this.self.DISTANCE_NOT_ENOUGH); } this.started = false; this.fire('swipe', e, { touch: touch, direction: direction, distance: distance, duration: duration }); }, onTouchCancel: function(e) { this.fire('swipecancel', e); return false; } });
28.181287
122
0.528118
28b48958b40b686a70b6d20763719dcd0ac40cf8
250
js
JavaScript
src/config/index.js
RyanQuey/khmer_speech_to_text
06bcdcc24b6587b7e42b77406b9b12c556a67d71
[ "Unlicense" ]
1
2020-05-03T21:53:21.000Z
2020-05-03T21:53:21.000Z
src/config/index.js
RyanQuey/khmer_speech_to_text
06bcdcc24b6587b7e42b77406b9b12c556a67d71
[ "Unlicense" ]
12
2020-06-05T04:31:13.000Z
2022-02-27T06:03:04.000Z
src/config/index.js
RyanQuey/khmer_speech_to_text
06bcdcc24b6587b7e42b77406b9b12c556a67d71
[ "Unlicense" ]
null
null
null
import dev from './dev' import dist from './dist' let config if (process.env.NODE_ENV == 'production') { console.log('production', process.env.NODE_ENV) config = dist } else { console.log('development') config = dev } export default config
17.857143
49
0.696
28b568fe3831501ca4fd556a7e05170af80e8a87
716
js
JavaScript
JavaScript/Intermediate Algorithms/WhatIsInAName.js
SeventhDreamer/Algorithms
bd654d5cdb17bd02b761bf9f43dbf176cced5d7f
[ "Unlicense" ]
null
null
null
JavaScript/Intermediate Algorithms/WhatIsInAName.js
SeventhDreamer/Algorithms
bd654d5cdb17bd02b761bf9f43dbf176cced5d7f
[ "Unlicense" ]
null
null
null
JavaScript/Intermediate Algorithms/WhatIsInAName.js
SeventhDreamer/Algorithms
bd654d5cdb17bd02b761bf9f43dbf176cced5d7f
[ "Unlicense" ]
null
null
null
function whatIsInAName(collection, source) { // What's in a name? var arr = []; // Only change code below this line var lookingFor = Object.keys(source); //setup array of the keys we are looking for arr = collection.filter(function (item){ //filters based on following criteria for(var i=0; i<lookingFor.length; i++){ //loops for each key we need to test //if the key of the item is not present or the item does not match the source then it is kicked out if(!item.hasOwnProperty(lookingFor[i]) || item[lookingFor[i]] !== source[lookingFor[i]]) return false; } return true; //both the keys and the item values match }); // Only change code above this line return arr; }
44.75
105
0.681564
28b6d60c93e023520a33ee9b84306fa7d1edb972
1,310
js
JavaScript
komutlar/raidengel.js
Akame-Sama/Extrax-Chat-Guard
8dab54e94b7e012e93d707a2d0a196ebd6ef3f5b
[ "MIT" ]
2
2022-01-02T09:07:13.000Z
2022-01-05T03:34:01.000Z
komutlar/raidengel.js
Akame-Sama/Extrax-Chat-Guard
8dab54e94b7e012e93d707a2d0a196ebd6ef3f5b
[ "MIT" ]
null
null
null
komutlar/raidengel.js
Akame-Sama/Extrax-Chat-Guard
8dab54e94b7e012e93d707a2d0a196ebd6ef3f5b
[ "MIT" ]
null
null
null
module.exports = { name:"raid-engel", code:` $if[$message[1]==aç] $channelSendMessage[$channelID;{color:$getServerVar[renk]}{description:$getServerVar[rick_tick] | Raid Engel Sistemi Başarıyla Açıldı}{thumbnail:$userAvatar}] $setServerVar[raid;açık] $endif $if[$message[1]==kapat] $channelSendMessage[$channelID;{color:$getServerVar[renk]}{description:$getServerVar[rick_tick] | Raid Engel Sistemi Başarıyla Kapatıldı}{thumbnail:$userAvatar}] $setServerVar[raid;kapalı] $endif $if[$message[1]==sayı] $channelSendMessage[$channelID;{color:$getServerVar[renk]}{description:$getServerVar[rick_tick] | Artık \`\$message[2]\`\ Sayıda Kişi Etiketlenirse Kişiyi Uyaracam}{thumbnail:$userAvatar}] $setServerVar[raidsayı;message[2]] $onlyIf[$isNumber[$message[2]]==true;{color:$getServerVar[renk]}{description:$getServerVar[rick_carpi] | Lütfen Bir Sayı Dışında Başka Birşey Girmeyiniz!}{thumbnail:$userAvatar}] $onlyIf[$message[2]!=;{color:$getServerVar[renk]}{description:$getServerVar[rick_carpi] | Lütfen Bir Sayı Giriniz!}{thumbnail:$userAvatar}] $endif $onlyIf[$checkContains[$toLowercase[$message[1]];aç;kapat;sayı]==true;{color:$getServerVar[renk]}{description:$getServerVar[rick_carpi] | Lütfen Bir Argüman Giriniz : \`\aç,kapat,sayı\`\}{thumbnail:$userAvatar}] $onlyPerms[admin;$getServerVar[admin]] ` }   
54.583333
211
0.767939
28b8e5c2739de9e3033dfcb36c862f17e05bb336
854
js
JavaScript
index.js
marcduiker/devopsdaysams-actions
c23db563ca72f1a5954a04beb213cb8ddb3897bf
[ "MIT" ]
5
2020-07-09T08:29:43.000Z
2021-06-26T00:54:52.000Z
index.js
marcduiker/devopsdaysams-actions
c23db563ca72f1a5954a04beb213cb8ddb3897bf
[ "MIT" ]
1
2020-07-09T16:09:35.000Z
2020-07-09T16:09:35.000Z
index.js
marcduiker/devopsdaysams-actions
c23db563ca72f1a5954a04beb213cb8ddb3897bf
[ "MIT" ]
12
2020-07-08T20:20:47.000Z
2021-06-26T00:54:54.000Z
var express = require("express"); const fetch = require('node-fetch'); const { addToWall } = require('./utils'); var app = express(); // Post a quote to the Zen wall // The API base URL is retrieved from the BASE_URL environment variable // The GitHub repository URL is passed in as a query parameter app.get("/addtowall", async (req, res, next) => { try { const baseUrl = process.env.BASE_URL; const repoUrl = req.query.repoUrl; console.log(`Base URL: ${baseUrl}`); console.log(`Repo URL: ${repoUrl}`); let response = await addToWall(baseUrl, repoUrl); console.log('Got zen'); res.json(response); } catch (error) { res.status(500).send(error); }; }); app.listen(process.env.PORT || 3000, () => { console.log(`Server running on port ${process.env.PORT || 3000}`); });
28.466667
71
0.62178
28b8fe1847dc60829ce52d0bcd7e4e27e888f2a6
521
js
JavaScript
src/components/Layout.js
GarciaDFE/newshiro
069f136ca078b7268e1d2f676525fea4c403ed86
[ "Adobe-2006", "Adobe-Glyph" ]
null
null
null
src/components/Layout.js
GarciaDFE/newshiro
069f136ca078b7268e1d2f676525fea4c403ed86
[ "Adobe-2006", "Adobe-Glyph" ]
null
null
null
src/components/Layout.js
GarciaDFE/newshiro
069f136ca078b7268e1d2f676525fea4c403ed86
[ "Adobe-2006", "Adobe-Glyph" ]
null
null
null
import React from "react"; import { ThemeProvider } from "styled-components"; import GlobalStyles from "../styles/globalStyles"; import theme from "../styles/projectStyles"; import "typeface-ubuntu"; import "typeface-roboto"; import ButtonToTop from "../objects/ButtonToTop" const Layout = ({ children }) => { return ( <> <GlobalStyles /> <ThemeProvider theme={theme}> <> {children} <ButtonToTop /> </> </ThemeProvider> </> ); }; export default Layout;
21.708333
50
0.619962
28b92ba154e553b5128e025dac6518f338010d06
697
es6
JavaScript
packages/client-app/internal_packages/nylas-private-salesforce/lib/form/pending-salesforce-object.es6
cnheider/nylas-mail
e16cb1982e944ae7edb69b1abef1436dd16b442d
[ "MIT" ]
24,369
2015-10-05T16:35:18.000Z
2017-01-27T15:33:55.000Z
packages/client-app/internal_packages/nylas-private-salesforce/lib/form/pending-salesforce-object.es6
cnheider/nylas-mail
e16cb1982e944ae7edb69b1abef1436dd16b442d
[ "MIT" ]
3,209
2015-10-05T17:37:34.000Z
2017-01-27T18:36:01.000Z
packages/client-app/internal_packages/nylas-private-salesforce/lib/form/pending-salesforce-object.es6
cnheider/nylas-mail
e16cb1982e944ae7edb69b1abef1436dd16b442d
[ "MIT" ]
1,308
2015-10-05T17:14:18.000Z
2017-01-24T19:36:40.000Z
import {Utils} from 'nylas-exports' /* There are many places we want to have a SalesforceObject for which we don't yet have the full data. An example is when we're created a linked SalesforceObject in a SalesforceForm. It may take a user a long time to create that object. In the meantime, we stub in a PendingSalesforceObject to indicate that such an activity is in progress. */ export default class PendingSalesforceObject { constructor({id, type, name}) { this.id = id || Utils.generateTempId(); this.type = type; this.name = name; } toJSON() { return { id: this.id, type: this.type, name: this.name, pendingSalesforceObject: true, } } }
24.034483
72
0.691535
28b9415156998b47800d357a2858fbe9ac1b46e7
1,992
js
JavaScript
target/banzhuan/js/login.js
lbzz1906/banzhuan
a597a0527e5036d5f99baceaca8d3e2b521c65d3
[ "MulanPSL-1.0" ]
null
null
null
target/banzhuan/js/login.js
lbzz1906/banzhuan
a597a0527e5036d5f99baceaca8d3e2b521c65d3
[ "MulanPSL-1.0" ]
1
2022-03-31T22:48:24.000Z
2022-03-31T22:48:24.000Z
target/banzhuan/js/login.js
lbzz1906/banzhuan
a597a0527e5036d5f99baceaca8d3e2b521c65d3
[ "MulanPSL-1.0" ]
null
null
null
var check1=document.getElementById('buy'); var check2=document.getElementById('sold'); var check3=document.getElementById('manager'); var username=document.querySelector('#uname'); var userpassword=document.querySelector('#upass'); var log=document.querySelector('#log'); check1.addEventListener("click", function f(){ this.className='checked'; check2.className='check'; check3.className='check'; log.addEventListener("click",function login(){ var usersname=username.value; sessionStorage.setItem('username',usersname); $.getJSON("loginCheck", {"username":username.value,"password":userpassword.value}, function(data){ if(data){ window.location.href = "web-hid/buy.html"; }else{ alert("用户名或密码错误"); } }) }) }); check2.addEventListener("click", function f(){ this.className='checked'; check1.className='check'; check3.className='check'; log.addEventListener("click",function login(){ var usersname=username.value; sessionStorage.setItem('username',usersname); $.getJSON("loginCheck", {"username":username.value,"password":userpassword.value}, function(data){ if(data){ window.location.href = "web-hid/solder.html"; }else{ alert("用户名或密码错误"); } }) }) }); check3.addEventListener("click", function f(){ this.className='checked'; check1.className='check'; check2.className='check'; log.addEventListener("click",function login(){ $.getJSON("managerCheck", {"username":username.value,"password":userpassword.value}, function(data){ if(data){ window.location.href = "web-hid/rooter.html"; }else{ alert("用户名或密码错误"); } }) }) });
32.655738
70
0.569779
28b94a13a98e3aa9777bf803245f8de63a95888b
998
js
JavaScript
docs/Documentation/html/class_c_i___cache__wincache.js
nejcpusnik/trippy-website
04e441b941237f6816176b8c7be7429f800038f0
[ "MIT" ]
null
null
null
docs/Documentation/html/class_c_i___cache__wincache.js
nejcpusnik/trippy-website
04e441b941237f6816176b8c7be7429f800038f0
[ "MIT" ]
null
null
null
docs/Documentation/html/class_c_i___cache__wincache.js
nejcpusnik/trippy-website
04e441b941237f6816176b8c7be7429f800038f0
[ "MIT" ]
null
null
null
var class_c_i___cache__wincache = [ [ "__construct", "class_c_i___cache__wincache.html#a095c5d389db211932136b53f25f39685", null ], [ "cache_info", "class_c_i___cache__wincache.html#acb4742926a6fa901e4f0917e1a35ef4c", null ], [ "clean", "class_c_i___cache__wincache.html#adb40b812890a8bc058bf6b7a0e1a54d9", null ], [ "decrement", "class_c_i___cache__wincache.html#a4eb1c2772c8efc48c411ea060dd040b7", null ], [ "delete", "class_c_i___cache__wincache.html#a2f8258add505482d7f00ea26493a5723", null ], [ "get", "class_c_i___cache__wincache.html#a50e3bfb586b2f42932a6a93f3fbb0828", null ], [ "get_metadata", "class_c_i___cache__wincache.html#a59635cf18e997c5141bffa05ff7622e0", null ], [ "increment", "class_c_i___cache__wincache.html#a2f07a4e09b57f4460d49852497d1808f", null ], [ "is_supported", "class_c_i___cache__wincache.html#a98c68fd153468bc148c4ed8c716859fc", null ], [ "save", "class_c_i___cache__wincache.html#a472645db04a8ce4b040b789a3062a7d2", null ] ];
76.769231
99
0.792585
28b966e2c6557fd7c276d84b082dfb36a4acfa85
545
js
JavaScript
core/index.js
bodetc/react-phone-number-input
ccaa302ba2331d1f057a682cc7ad35f198eebdda
[ "MIT" ]
1
2021-12-07T12:27:58.000Z
2021-12-07T12:27:58.000Z
core/index.js
bodetc/react-phone-number-input
ccaa302ba2331d1f057a682cc7ad35f198eebdda
[ "MIT" ]
null
null
null
core/index.js
bodetc/react-phone-number-input
ccaa302ba2331d1f057a682cc7ad35f198eebdda
[ "MIT" ]
1
2021-06-16T05:39:28.000Z
2021-06-16T05:39:28.000Z
export { default as default } from '../modules/PhoneInputWithCountry' export { default as formatPhoneNumber, formatPhoneNumberIntl } from '../modules/libphonenumber/formatPhoneNumber' export { default as isValidPhoneNumber } from '../modules/libphonenumber/isValidPhoneNumber' export { default as isPossiblePhoneNumber } from '../modules/libphonenumber/isPossiblePhoneNumber' export { getCountryCallingCode as getCountryCallingCode, getCountries as getCountries, parsePhoneNumberFromString as parsePhoneNumber } from 'libphonenumber-js/core'
54.5
113
0.827523
28b9aaf6f64ba0014bf313613e9014edf6dce4f0
374
js
JavaScript
packages/identity-x/api/queries/get-active-context.js
crandall-endeavor/websites
8b021063fff2aa83f773f00676e2a61a745174ce
[ "MIT" ]
3
2019-03-10T02:39:15.000Z
2020-11-06T18:03:28.000Z
packages/identity-x/api/queries/get-active-context.js
crandall-endeavor/websites
8b021063fff2aa83f773f00676e2a61a745174ce
[ "MIT" ]
56
2019-05-03T19:48:47.000Z
2022-01-22T03:56:56.000Z
packages/identity-x/api/queries/get-active-context.js
crandall-endeavor/websites
8b021063fff2aa83f773f00676e2a61a745174ce
[ "MIT" ]
14
2019-03-08T17:11:46.000Z
2021-03-25T17:44:37.000Z
const gql = require('graphql-tag'); const userFragment = require('../fragments/active-user'); module.exports = gql` query GetActiveAppContext { activeAppContext { user { ...ActiveUserFragment } mergedTeams { id name photoURL } mergedAccessLevels { id name } hasTeams hasUser } } ${userFragment} `;
13.357143
57
0.593583
28b9bd3a836e7e52617980b68412d2d86e4b4bb5
3,046
js
JavaScript
ionic/www/js/controllers/deliveryman/viewOrders.js
cleberpicolo/CodeDelivery
e295e46bd8bf95aced66f2e51be7f1202b353f66
[ "MIT" ]
null
null
null
ionic/www/js/controllers/deliveryman/viewOrders.js
cleberpicolo/CodeDelivery
e295e46bd8bf95aced66f2e51be7f1202b353f66
[ "MIT" ]
18
2016-09-08T21:33:26.000Z
2016-09-15T14:29:42.000Z
ionic/www/js/controllers/deliveryman/viewOrders.js
cleberpicolo/CodeDelivery
e295e46bd8bf95aced66f2e51be7f1202b353f66
[ "MIT" ]
null
null
null
angular.module('starter.controllers') .controller('DeliverymanViewOrdersCtrl', [ '$scope', '$ionicLoading', '$state', 'DeliverymanOrder', function ($scope, $ionicLoading, $state, DeliverymanOrder) { $scope.orders = []; $ionicLoading.show({ template: 'Carregando...' }); $scope.doRefresh = function () { getOrders().then(function (data) { $scope.orders = data.data; angular.forEach($scope.orders, function (order) { switch (order.status){ case 0: order.status = 'Pendente'; break; case 1: order.status = 'Processando'; break; case 2: order.status = 'Entregue'; break; case 3: order.status = 'Cancelado'; break; } var dt = new Date(order.created_at.date); order.created_at.date = dt; var items = order.items.data.length; if(items > 1){ order.orderItems = items + " Itens"; }else{ order.orderItems = items + " Item"; } }); $scope.$broadcast('scroll.refreshComplete'); }, function (error) { $scope.$broadcast('scroll.refreshComplete'); }) }; $scope.openOrderDetail = function (order) { $state.go("deliveryman.order", {id: order.id}); }; function getOrders() { return DeliverymanOrder.query({ include: "items", orderBy: "created_at", sortedBy: "desc" }).$promise; } getOrders().then(function (data) { $scope.orders = data.data; angular.forEach($scope.orders, function (order) { switch (order.status){ case 0: order.status = 'Pendente'; break; case 1: order.status = 'Processando'; break; case 2: order.status = 'Entregue'; break; case 3: order.status = 'Cancelado'; break; } var dt = new Date(order.created_at.date); order.created_at.date = dt; var items = order.items.data.length; if(items > 1){ order.orderItems = items + " Itens"; }else{ order.orderItems = items + " Item"; } }); $ionicLoading.hide(); }, function (error) { $ionicLoading.hide(); } ); }]);
40.613333
72
0.401182
28ba055355f5e2e4cafea8256769a664c0e651a7
5,046
js
JavaScript
service/UI/UIEvents.js
marquetd/jitsi-meet-CGTR
d49b35482f339e85421001f407cbf6981cfb3fd5
[ "Apache-2.0" ]
null
null
null
service/UI/UIEvents.js
marquetd/jitsi-meet-CGTR
d49b35482f339e85421001f407cbf6981cfb3fd5
[ "Apache-2.0" ]
null
null
null
service/UI/UIEvents.js
marquetd/jitsi-meet-CGTR
d49b35482f339e85421001f407cbf6981cfb3fd5
[ "Apache-2.0" ]
null
null
null
export default { NICKNAME_CHANGED: "UI.nickname_changed", SELECTED_ENDPOINT: "UI.selected_endpoint", PINNED_ENDPOINT: "UI.pinned_endpoint", /** * Notifies that local user created text message. */ MESSAGE_CREATED: "UI.message_created", /** * Notifies that local user changed language. */ LANG_CHANGED: "UI.lang_changed", /** * Notifies that local user changed email. */ EMAIL_CHANGED: "UI.email_changed", /** * Notifies that "start muted" settings changed. */ START_MUTED_CHANGED: "UI.start_muted_changed", AUDIO_MUTED: "UI.audio_muted", VIDEO_MUTED: "UI.video_muted", ETHERPAD_CLICKED: "UI.etherpad_clicked", SHARED_VIDEO_CLICKED: "UI.start_shared_video", /** * Indicates that an invite button has been clicked. */ INVITE_CLICKED: "UI.invite_clicked", /** * Updates shared video with params: url, state, time(optional) * Where url is the video link, state is stop/start/pause and time is the * current video playing time. */ UPDATE_SHARED_VIDEO: "UI.update_shared_video", USER_KICKED: "UI.user_kicked", REMOTE_AUDIO_MUTED: "UI.remote_audio_muted", TOGGLE_FULLSCREEN: "UI.toogle_fullscreen", FULLSCREEN_TOGGLED: "UI.fullscreen_toggled", AUTH_CLICKED: "UI.auth_clicked", TOGGLE_CHAT: "UI.toggle_chat", TOGGLE_SETTINGS: "UI.toggle_settings", TOGGLE_CONTACT_LIST: "UI.toggle_contact_list", /** * Notifies that the profile toolbar button has been clicked. */ TOGGLE_PROFILE: "UI.toggle_profile", /** * Notifies that a command to toggle the film strip has been issued. The * event may optionally specify a {Boolean} (primitive) value to assign to * the visibility of the film strip (i.e. the event may act as a setter). * The very toggling of the film strip may or may not occurred at the time * of the receipt of the event depending on the position of the receiving * event listener in relation to the event listener which carries out the * command to toggle the film strip. * * @see {TOGGLED_FILM_STRIP} */ TOGGLE_FILM_STRIP: "UI.toggle_film_strip", /** * Notifies that the film strip was (actually) toggled. The event supplies * a {Boolean} (primitive) value indicating the visibility of the film * strip after the toggling (at the time of the event emission). * * @see {TOGGLE_FILM_STRIP} */ TOGGLED_FILM_STRIP: "UI.toggled_film_strip", TOGGLE_SCREENSHARING: "UI.toggle_screensharing", TOGGLED_SHARED_DOCUMENT: "UI.toggled_shared_document", CONTACT_CLICKED: "UI.contact_clicked", HANGUP: "UI.hangup", LOGOUT: "UI.logout", RECORDING_TOGGLED: "UI.recording_toggled", SIP_DIAL: "UI.sip_dial", SUBJECT_CHANGED: "UI.subject_changed", VIDEO_DEVICE_CHANGED: "UI.video_device_changed", AUDIO_DEVICE_CHANGED: "UI.audio_device_changed", AUDIO_OUTPUT_DEVICE_CHANGED: "UI.audio_output_device_changed", /** * Notifies interested listeners that the follow-me feature is enabled or * disabled. */ FOLLOW_ME_ENABLED: "UI.follow_me_enabled", /** * Notifies that flipX property of the local video is changed. */ LOCAL_FLIPX_CHANGED: "UI.local_flipx_changed", // An event which indicates that the resolution of a remote video has // changed. RESOLUTION_CHANGED: "UI.resolution_changed", /** * Notifies that the button "Go to webstore" is pressed on the dialog for * external extension installation. */ OPEN_EXTENSION_STORE: "UI.open_extension_store", /** * Notifies that the button "Cancel" is pressed on the dialog for * external extension installation. */ EXTERNAL_INSTALLATION_CANCELED: "UI.external_installation_canceled", /** * Notifies that the side toolbar container has been toggled. The actual * event must contain the identifier of the container that has been toggled * and information about toggle on or off. */ SIDE_TOOLBAR_CONTAINER_TOGGLED: "UI.side_container_toggled", /** * Notifies that the raise hand has been changed. */ LOCAL_RAISE_HAND_CHANGED: "UI.local_raise_hand_changed", /** * Notifies that the avatar is displayed or not on the largeVideo. */ LARGE_VIDEO_AVATAR_VISIBLE: "UI.large_video_avatar_visible", /** * Toggling room lock */ TOGGLE_ROOM_LOCK: "UI.toggle_room_lock", /** * Adding contact to contact list */ CONTACT_ADDED: "UI.contact_added", /** * Removing the contact from contact list */ CONTACT_REMOVED: "UI.contact_removed", /** * Indicates that a user avatar has changed. */ USER_AVATAR_CHANGED: "UI.user_avatar_changed", /** * Display name changed. */ DISPLAY_NAME_CHANGED: "UI.display_name_changed", /** * Indicates that a password is required for the call. */ PASSWORD_REQUIRED: "UI.password_required" };
32.980392
79
0.681728
28bab93d41b86a75fb324d38d1e24318a750f8bd
8,064
js
JavaScript
core/router.js
tmslnz/W.js
25a11baf8edb27c306f2baf6438bed2faf935bc6
[ "MIT" ]
2
2017-06-26T10:29:38.000Z
2018-11-18T22:13:46.000Z
core/router.js
tmslnz/W.js
25a11baf8edb27c306f2baf6438bed2faf935bc6
[ "MIT" ]
13
2015-02-12T11:34:47.000Z
2017-12-07T12:37:01.000Z
core/router.js
tmslnz/W.js
25a11baf8edb27c306f2baf6438bed2faf935bc6
[ "MIT" ]
null
null
null
// Inspired by express.js and path.js var noOp = function (){}; // # Router // _Note the router is async and will never trigger synchronously._ // ## Example // ### Setup // // var router = new Router(); // router // .map( '/a/:b/' ) // .to( function ( route, next ) { // next(); // }) // .to( function ( route ) { // console.log( "b", route.params.b ); // }) // .map( '/a/:b/:c', 'GET' ) // .to( function ( route ) { // // }) // .map( '/a/:b/:c', [ 'POST', 'PUT' ] ) // .to( function ( route, next ) { // next(); // }) // .whenMethod( 'POST', route, next, function () { // next(); // }) // .whenMethod( ['POST', 'PUT'], route, next, function () { // next(); // }) // .map( 'extra args' ) // .to( function ( route, x, y, z ) { // // }) // .noMatch( function ( route, extra ) { // console.log( 'no route for', route.path ); // }); // ### Triggering // // With `onDone` as trigger will happen in next tick // // router.trigger( '/a/10/' ).onDone( function () {} ); // // With method // // router.trigger( '/a/1/2/' ).withMethod( 'GET' ); // // With extra arguments // // router.trigger( '/a/1/2/', 1, 2, 3 ); function Router () { this.routes = []; this.noMatch = function () {}; } // ## Trigger // Arguments: // * path <String:URL/Pattern> // * args... Router.prototype.trigger = function (path) { var self = this; var triggerArguments = arguments; var promise = new RouterTriggerPromise(noOp,noOp); setTimeout((function (promise) { return function () { // Route detection var matchingRoute; var i = 0; while ( i < self.routes.length ) { if ( self.routes[i].method === promise.method && self.routes[i].match(path) ) { matchingRoute = self.routes[i]; break; } ++i; } if (matchingRoute) { // convert the array with keys back to an object var route = { method : promise.method, params : {}, path : path }; Object.keys(matchingRoute.params).forEach(function (key) { route.params[key] = matchingRoute.params[key]; }); var args = [route]; for (var j=1; j<triggerArguments.length; j++) { args.push(triggerArguments[j]); } args.push( null ); // holder for next // Action all sequentally W.loop(matchingRoute.callbacks.length, function ( i, next, end ) { var callback = matchingRoute.callbacks[ i ]; // Updated the args[ args.length - 1 ] = next; callback.apply(this, args); }, function () { promise.allCallbacksDidNext(); }); promise.done(); } else { var route = { method : promise.method, params : {}, path : path }; var args = [route]; for (var j=1; j<triggerArguments.length; j++) { args.push(triggerArguments[j]); } self.noMatch.apply(this, args); promise.done(); } }; }(promise)),0); return promise; }; Router.prototype.map = function ( path, methods ) { var routerContext = this; var routes = []; if ( typeof methods === 'undefined' || methods === null ) { methods = ['none']; } if ( typeof methods === 'string' ) { methods = [methods]; } methods.forEach(function (method) { routes.push( new Route(method, path, [], {sensitive:true, strict:true}) ); }); this.routes = this.routes.concat(routes); return new RouterMapPromise(routes, routerContext); }; function RouterTriggerPromise(allCallbacksDidNext, onNoMatch) { this.allCallbacksDidNext = allCallbacksDidNext; this.onAllCallbacksDidNext = function ( fn ) { this.allCallbacksDidNext = fn; return this; }; this.done = noOp; this.onDone = function ( fn ) { this.done = fn; return this; }; this.method = 'none'; this.withMethod = function ( method ) { this.method = method; return this; }; } function RouterMapPromise(routes, routerContext) { var self = this; this.to = function (fn) { routes.forEach(function (route) { route.callbacks.push(fn); }); return self; }; this.toWhenMethod = function (methods, fn) { if ( !(methods instanceof Array) ) { methods = [methods]; } routes.forEach(function (route) { route.callbacks.push(function (req) { if ( methods.indexOf( req.method ) > -1 ) { fn.apply( this, arguments ); } else { // take the last argument, which is next and call it arguments[ arguments.length-1 ](); } }); }); return self; }; this.map = function () { return routerContext.map.apply(routerContext, arguments); }; this.trigger = function () { return routerContext.trigger.apply(routerContext, arguments); }; this.noMatch = function ( fn ) { routerContext.noMatch = fn; return this; }; return this; } /** * Initialize `Route` with the given HTTP `method`, `path`, * and an array of `callbacks` and `options`. * * Options: * * - `sensitive` enable case-sensitive routes * - `strict` enable strict matching for trailing slashes * * @param {String} method * @param {String} path * @param {Array} callbacks * @param {Object} options. * @api private */ function Route(method, path, callbacks, options) { options = options || {}; this.path = path; this.method = method; this.callbacks = callbacks; this.regexp = pathRegexp(path, this.keys = [], options.sensitive, options.strict); } /** * Check if this route matches `path`, if so * populate `.params`. * * @param {String} path * @return {Boolean} * @api private */ Route.prototype.match = function(path){ var keys = this.keys; var params = this.params = []; var m = this.regexp.exec(path); if (!m) return false; for (var i = 1, len = m.length; i < len; ++i) { var key = keys[i - 1]; var val = 'string' == typeof m[i] ? decodeURIComponent(m[i]) : m[i]; if (key) { params[key.name] = val; } else { params.push(val); } } return true; }; // Borrowed from express utils function pathRegexp(path, keys, sensitive, strict) { if (''+path == '[object RegExp]') return path; if (Array.isArray(path)) path = '(' + path.join('|') + ')'; path = path .concat(strict ? '' : '/?') .replace(/\/\(/g, '(?:/') .replace(/(\/)?(\.)?:(\w+)(?:(\(.*?\)))?(\?)?(\*)?/g, function(_, slash, format, key, capture, optional, star){ keys.push({ name: key, optional: !! optional }); slash = slash || ''; return '' + (optional ? '' : slash) + '(?:' + (optional ? slash : '') + (format || '') + (capture || (format && '([^/.]+?)' || '([^/]+?)')) + ')' + (optional || '') + (star ? '(/*)?' : ''); }) .replace(/([\/.])/g, '\\$1') .replace(/\*/g, '(.*)'); return new RegExp('^' + path + '$', sensitive ? '' : 'i'); }
29.430657
119
0.473214
28bbe24a261738e7df905693b1690f531cc74599
315
js
JavaScript
src/st-dns-stats.js
AVor0n/basic-js
f90c2568f860cf138a6aae1d0697efda244a8747
[ "MIT" ]
null
null
null
src/st-dns-stats.js
AVor0n/basic-js
f90c2568f860cf138a6aae1d0697efda244a8747
[ "MIT" ]
null
null
null
src/st-dns-stats.js
AVor0n/basic-js
f90c2568f860cf138a6aae1d0697efda244a8747
[ "MIT" ]
null
null
null
export default function getDNSStats(domains) { const DNS = {} for (let dom of domains) { let arr = dom.split('.').reverse() for (let i = 0; i < arr.length; i++) { let s = '.' + arr.slice(0, i + 1).join('.') if (DNS[s]) DNS[s]++ else DNS[s] = 1 } } return DNS }
21
49
0.48254
28bc8bc80c0e63fda858cc52874d44795874940b
1,776
js
JavaScript
bugs/garbage/【高清图】小米(xiaomi)红米Note(增强版_移动3G_2GB RAM)局部细节图 图37-ZOL中关村在线_files/ue.js
bokand/bokand.github.io
0ec437cc6178a2a0fb78cd4324664347bbbcc19e
[ "MIT" ]
23
2015-12-16T08:31:42.000Z
2021-07-30T02:28:32.000Z
bugs/garbage/【高清图】小米(xiaomi)红米Note(增强版_移动3G_2GB RAM)局部细节图 图37-ZOL中关村在线_files/ue.js
bokand/bokand.github.io
0ec437cc6178a2a0fb78cd4324664347bbbcc19e
[ "MIT" ]
10
2017-12-01T20:12:06.000Z
2022-01-30T12:02:27.000Z
bugs/garbage/【高清图】小米(xiaomi)红米Note(增强版_移动3G_2GB RAM)局部细节图 图37-ZOL中关村在线_files/ue.js
bokand/bokand.github.io
0ec437cc6178a2a0fb78cd4324664347bbbcc19e
[ "MIT" ]
6
2017-11-03T16:44:20.000Z
2021-11-17T16:06:27.000Z
(function(){var a={init:function(){this.data=[];this.iframeurl=(window.DSPUIIFRAMEURI||"http://entry.baidu.com/rp/home")+"?";this.script();this.render()},render:function(c){if(this.data.length){for(var d=0,b=this.data.length;d<b;d++){this.done(this.data[d])}try{window.cpro_psid=null}catch(f){}}},getParam:function(b){var d=[];b.di=b.psid;b.rsi0=b.pswidth;b.rsi1=b.psheight;b.title=document.title;b.ref=document.referrer;b.ltu=window.location+"";if(window.cpro_psdata){for(var c in cpro_psdata){b[c]=cpro_psdata[c]}window.cpro_psdata=undefined}for(var c in b){if(typeof b[c]!=="object"){d.push(c+"="+encodeURIComponent(b[c]))}}return d},done:function(c){var b=document.createElement("iframe"),f=this.getParam(c);b.src=this.iframeurl+f.join("&");b.width=c.pswidth;b.height=c.psheight;b.scrolling="no";b.frameBorder="0";b.allowTransparency=true;b.style.width=c.pswidth+"px";b.style.height=c.psheight+"px";b.style.backgroundColor="transparent";try{c.script.parentNode.insertBefore(b,c.script)}catch(d){}},script:function(){var b=document.getElementsByTagName("script"),d,f,g,j,h;for(var e=0,c=b.length;e<c;e++){d=b[e];if(!d.getAttribute("src")){f=d.innerHTML.replace(/\/\/[^\n]+/g,"").replace(/\n/g,";").replace(/\/\*.+\*\//ig,"").replace(/[\s\uFEFF\xA0\t]/ig,"");if(!d.id){g=this.getMatch("psid",f);j=this.getMatch("pswidth",f);h=this.getMatch("psheight",f);if(g&&j&&h){d.id="BDEMBED_PSID"+g;this.data.push({script:d,psid:g,pswidth:j,psheight:h})}}}}},getMatch:function(){var b={psid:/cpro_psid[\s\uFEFF\xA0]*=[\s\uFEFF\xA0]*['"]([a-z0-9]{4,20})/i,pswidth:/cpro_pswidth[\s\uFEFF\xA0]*=[\s\uFEFF\xA0]*['"]*([0-9a-z]{1,10})/i,psheight:/cpro_psheight[\s\uFEFF\xA0]*=[\s\uFEFF\xA0]*['"]*([0-9]{1,10})/i};return function(d,e){var c=e.match(b[d]);if(c){return c[1]}}}()};a.init()})();
1,776
1,776
0.684122
28bd13f1730ad1b351fee3b968a1fe1acaa0eccd
465
js
JavaScript
shared/constants.js
mevanabey/metamask-connection-demo
c15529eeed02bb1d6f81bdf2629c1836cda3f02a
[ "MIT" ]
null
null
null
shared/constants.js
mevanabey/metamask-connection-demo
c15529eeed02bb1d6f81bdf2629c1836cda3f02a
[ "MIT" ]
null
null
null
shared/constants.js
mevanabey/metamask-connection-demo
c15529eeed02bb1d6f81bdf2629c1836cda3f02a
[ "MIT" ]
null
null
null
// General export const WEI_IN_WTH = 1000000000000000000; export const ETHERSCAN_API_URL = 'https://api.etherscan.io/api?module=account'; export const EHERSCAN_TRANSACTION_URL = 'https://etherscan.io/tx'; //Move to Env Variables (Private) export const MORALIS_APP_ID = 'TCDv7lnGwNN7RIhlj30wA69dnaamxtsmqcTnm3ch'; export const MORALIS_SERVER_URL = 'https://9c8nrl6lfq8u.moralis.io:2053/server'; export const ETHERSCAN_API_KEY = 'WY7V2HASZ7D2QR46JR2C9S8Q49ZC9FS4WT';
51.666667
80
0.817204
28bd14348c025cdea94a0abbaaffb7b1018b0884
3,663
js
JavaScript
docs/doc/implementors/asynchronous_codec/decoder/trait.Decoder.js
AtlDragoon/Fennel-Protocol
f5f1a87d1564543484f27b4819a7a196fe91994f
[ "Unlicense" ]
null
null
null
docs/doc/implementors/asynchronous_codec/decoder/trait.Decoder.js
AtlDragoon/Fennel-Protocol
f5f1a87d1564543484f27b4819a7a196fe91994f
[ "Unlicense" ]
null
null
null
docs/doc/implementors/asynchronous_codec/decoder/trait.Decoder.js
AtlDragoon/Fennel-Protocol
f5f1a87d1564543484f27b4819a7a196fe91994f
[ "Unlicense" ]
null
null
null
(function() {var implementors = {}; implementors["libp2p_gossipsub"] = [{"text":"impl <a class=\"trait\" href=\"asynchronous_codec/decoder/trait.Decoder.html\" title=\"trait asynchronous_codec::decoder::Decoder\">Decoder</a> for <a class=\"struct\" href=\"libp2p_gossipsub/protocol/struct.GossipsubCodec.html\" title=\"struct libp2p_gossipsub::protocol::GossipsubCodec\">GossipsubCodec</a>","synthetic":false,"types":["libp2p_gossipsub::protocol::GossipsubCodec"]}]; implementors["unsigned_varint"] = [{"text":"impl <a class=\"trait\" href=\"asynchronous_codec/decoder/trait.Decoder.html\" title=\"trait asynchronous_codec::decoder::Decoder\">Decoder</a> for <a class=\"struct\" href=\"unsigned_varint/codec/struct.Uvi.html\" title=\"struct unsigned_varint::codec::Uvi\">Uvi</a>&lt;<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.u8.html\">u8</a>&gt;","synthetic":false,"types":["unsigned_varint::codec::Uvi"]},{"text":"impl <a class=\"trait\" href=\"asynchronous_codec/decoder/trait.Decoder.html\" title=\"trait asynchronous_codec::decoder::Decoder\">Decoder</a> for <a class=\"struct\" href=\"unsigned_varint/codec/struct.Uvi.html\" title=\"struct unsigned_varint::codec::Uvi\">Uvi</a>&lt;<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.u16.html\">u16</a>&gt;","synthetic":false,"types":["unsigned_varint::codec::Uvi"]},{"text":"impl <a class=\"trait\" href=\"asynchronous_codec/decoder/trait.Decoder.html\" title=\"trait asynchronous_codec::decoder::Decoder\">Decoder</a> for <a class=\"struct\" href=\"unsigned_varint/codec/struct.Uvi.html\" title=\"struct unsigned_varint::codec::Uvi\">Uvi</a>&lt;<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.u32.html\">u32</a>&gt;","synthetic":false,"types":["unsigned_varint::codec::Uvi"]},{"text":"impl <a class=\"trait\" href=\"asynchronous_codec/decoder/trait.Decoder.html\" title=\"trait asynchronous_codec::decoder::Decoder\">Decoder</a> for <a class=\"struct\" href=\"unsigned_varint/codec/struct.Uvi.html\" title=\"struct unsigned_varint::codec::Uvi\">Uvi</a>&lt;<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.u64.html\">u64</a>&gt;","synthetic":false,"types":["unsigned_varint::codec::Uvi"]},{"text":"impl <a class=\"trait\" href=\"asynchronous_codec/decoder/trait.Decoder.html\" title=\"trait asynchronous_codec::decoder::Decoder\">Decoder</a> for <a class=\"struct\" href=\"unsigned_varint/codec/struct.Uvi.html\" title=\"struct unsigned_varint::codec::Uvi\">Uvi</a>&lt;<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.u128.html\">u128</a>&gt;","synthetic":false,"types":["unsigned_varint::codec::Uvi"]},{"text":"impl <a class=\"trait\" href=\"asynchronous_codec/decoder/trait.Decoder.html\" title=\"trait asynchronous_codec::decoder::Decoder\">Decoder</a> for <a class=\"struct\" href=\"unsigned_varint/codec/struct.Uvi.html\" title=\"struct unsigned_varint::codec::Uvi\">Uvi</a>&lt;<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.usize.html\">usize</a>&gt;","synthetic":false,"types":["unsigned_varint::codec::Uvi"]},{"text":"impl&lt;T&gt; <a class=\"trait\" href=\"asynchronous_codec/decoder/trait.Decoder.html\" title=\"trait asynchronous_codec::decoder::Decoder\">Decoder</a> for <a class=\"struct\" href=\"unsigned_varint/codec/struct.UviBytes.html\" title=\"struct unsigned_varint::codec::UviBytes\">UviBytes</a>&lt;T&gt;","synthetic":false,"types":["unsigned_varint::codec::UviBytes"]}]; if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
915.75
3,061
0.731095
28bd1964bba3200e70a21add2c3976b1ecb641d1
1,200
js
JavaScript
webpack.config.js
aiheon/pokemon-challenge
cfc49ac277391f07750a6be4bca59766503ccb66
[ "Apache-2.0" ]
4
2017-12-21T20:47:31.000Z
2022-03-09T14:54:43.000Z
webpack.config.js
aiheon/pokemon-challenge
cfc49ac277391f07750a6be4bca59766503ccb66
[ "Apache-2.0" ]
10
2021-03-02T01:19:57.000Z
2022-03-08T23:19:42.000Z
webpack.config.js
aiheon/pokemon-challenge
cfc49ac277391f07750a6be4bca59766503ccb66
[ "Apache-2.0" ]
21
2016-12-12T16:04:48.000Z
2022-03-08T17:23:59.000Z
const webpack = require('webpack'); const minimize = process.argv.indexOf('--minimize') !== -1; const path = require("path"); const colors = require('colors'); const failPlugin = require('webpack-fail-plugin'); if (minimize) { console.log('Building minified version of the library'.bgGreen.red); } else { console.log('Building non minified version of the library'.bgGreen.red); } module.exports = [{ mode: minimize ? 'production' : 'development', devtool: 'source-map', entry: { 'coveo.extension': path.resolve(__dirname,'./src/Index') }, output: { path: require('path').resolve('./bin/js'), // Output a filename based on the entry. This will generate a "coveo.extension.js" file. filename: minimize ? `[name].min.js` : `[name].js`, library: 'CoveoExtension' }, externals: [{ // Defines the module "coveo-search-ui" as external, "Coveo" is defined in the global scope. // This requires you to load the original CoveoJsSearch.js file in your page. "coveo-search-ui":"Coveo" }], resolve: { extensions: ['.ts', '.js'], }, module: { rules: [{ test: /\.ts$/, loader: 'ts-loader', options: {} }] }, bail: true }]
29.268293
96
0.634167
28bd513f2c8402e78cb8d33f9f664dc7c99808f2
290
js
JavaScript
__mocks__/factories/base.factory.js
anthonywallen/node-api-poc
ea14bef77a9e626374a2d972c6e50a5903eb3ef3
[ "MIT" ]
null
null
null
__mocks__/factories/base.factory.js
anthonywallen/node-api-poc
ea14bef77a9e626374a2d972c6e50a5903eb3ef3
[ "MIT" ]
6
2021-05-31T22:27:41.000Z
2021-05-31T22:27:54.000Z
__mocks__/factories/base.factory.js
anthonywallen/node-api-poc
ea14bef77a9e626374a2d972c6e50a5903eb3ef3
[ "MIT" ]
null
null
null
/** * BaseFatory */ export default class BaseFactory { generateList(count, attrs = {}) { const list = []; let numberOfItemsToCreate = count; while (numberOfItemsToCreate) { list.push(this.generate(attrs)); numberOfItemsToCreate--; } return list; } }
17.058824
38
0.624138
28bdb30b44015d5cbbe5afcb5c76554a589752ea
1,730
js
JavaScript
js/blog.js
aurelielerouxel/bankroot
6f7fe0c4ee40fcfcc24ea8c938a01c566ef44615
[ "MIT" ]
null
null
null
js/blog.js
aurelielerouxel/bankroot
6f7fe0c4ee40fcfcc24ea8c938a01c566ef44615
[ "MIT" ]
null
null
null
js/blog.js
aurelielerouxel/bankroot
6f7fe0c4ee40fcfcc24ea8c938a01c566ef44615
[ "MIT" ]
null
null
null
let card = document.getElementById("card"); // AJAX request let httpRequest = new XMLHttpRequest(); httpRequest.onreadystatechange = function() { if (httpRequest.readyState === XMLHttpRequest.DONE) { if (httpRequest.status === 200) { // Store the json file in a variable let blog = JSON.parse(httpRequest.responseText); console.log(blog); // create a loop for each object of the json for (let article of blog) { let section = document.createElement("section"); // mais WTF card.appendChild(section); // card.style. let id = document.createElement("id"); id.innerText = article.id; card.appendChild(id); // id.style. let titre = document.createElement("titre"); titre.innerText = article.titre; // cardTitle.style. let contenu = document.createElement("p"); contenu.innerText = article.contenu; // cardContent.style. // let button = document.createElement("a"); section.appendChild(id); section.appendChild(titre); section.appendChild(contenu); } } else { // there was a problem with the request, console.log("ERROR"); } } else { // not ready yet, console.log("chargement en cours"); } }; // opening and sending of the request, httpRequest.open('GET', 'https://oc-jswebsrv.herokuapp.com/api/articles', true); httpRequest.send();
32.037037
80
0.520809
28bdb6d36c39e027807613bf733c3f1eade735f2
5,772
js
JavaScript
public/front/img/icons/Facebook_files/7L1cu4edn6z.js
dungyeutrang/abe
ca3b567bc926714c59a6e1d270abf61f53223089
[ "MIT" ]
null
null
null
public/front/img/icons/Facebook_files/7L1cu4edn6z.js
dungyeutrang/abe
ca3b567bc926714c59a6e1d270abf61f53223089
[ "MIT" ]
null
null
null
public/front/img/icons/Facebook_files/7L1cu4edn6z.js
dungyeutrang/abe
ca3b567bc926714c59a6e1d270abf61f53223089
[ "MIT" ]
null
null
null
if (self.CavalryLogger) { CavalryLogger.start_js(["iKS8Y"]); } __d("CreditCardFormParam",[],(function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports={ACCOUNT_ID:"account_id",ACCOUNT_COUNTRY_CODE:"account_country_code",APP_ID:"app_id",CARD_EXPIRATION:"exp",CARD_FBID:"cc_fbid",CARD_ID:"cc_id",CARD_TYPE:"cardType",CITY:"city",CONTEXT_ID:"context_id",COUNTRY:"country",CSC_LENGTH:"csc_length",EMAIL:"email",FIRST_NAME:"firstName",TRACKING_ID:"tracking_id",JSFAIL_SOURCE:"jsfail_source",KEYPRESS_TIMES:"kpts",LAST_NAME:"lastName",MONTH:"month",STATE:"state",STREET:"street",STREET_2:"street2",VALIDATE_ADDRESS:"validate_address",VALIDATE_NAME:"validate_name",VALIDATE_ZIP:"validate_zip",YEAR:"year",ZIP:"zip",VALIDATOR_CHECKS:"checks",CARD_NUMBER:"creditCardNumber",CSC:"csc",CARD_NUMBER_FIRST_6:"creditCardNumber_first6",CARD_NUMBER_LAST_4:"creditCardNumber_last4",CARD_NUMBER_TOKEN:"creditCardNumber_token",CSC_TOKEN:"csc_token",AUTH_LEVEL_FLAG:"auth_level",AUTH_AMOUNT:"auth_amount",AUTH_CURRENCY:"auth_currency",AUTO_EXPAND_AUTH_LEVEL_FLAG:"auto_expand_auth_level",PAYMENT_ITEM_TYPE:"payment_item_type",CREDENTIAL_ID:"credential_id",IS_STORED_BALANCE:"is_stored_balance",FLOW_PLACEMENT:"flow_placement",FLOW_TYPE:"flow_type",STORED_BALANCE_STATUS:"stored_balance_status"};}),null); __d("CreditCardTypeEnum",[],(function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports={VISA:86,MASTERCARD:77,DISCOVER:68,AMERICANEXPRESS:65,DINERSCLUB:64,JCB:74,CUP:80};}),null); __d('PYMABoostedComponentUtils',['AsyncRequest','Event','tidyEvent'],(function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();var h={listenForClick:function i(j,k,l){c('tidyEvent')(c('Event').listen(j,'click',function(m){new (c('AsyncRequest'))().setURI(k).setMethod('POST').send();if(l)new (c('AsyncRequest'))().setURI(l).setMethod('POST').send();}));}};f.exports=h;}),null); __d('ShareDialogAudienceTypes',['getObjectValues','ShareModeConst'],(function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={OWN:c('ShareModeConst').SELF_POST,PERSON:c('ShareModeConst').FRIEND,GROUP:c('ShareModeConst').GROUP,EVENT:c('ShareModeConst').EVENT,PAGE:c('ShareModeConst').PAGE,MESSAGE:c('ShareModeConst').MESSAGE},i=c('getObjectValues')(h);function j(k){return i.some(function(l){return l===k;});}f.exports=h;f.exports.ALL=i;f.exports.isValid=j;f.exports.propType=function(k,l){if(!j(k[l]))throw new Error('Invalid audience '+k[l]);};}),null); __d('PaymentMethodUtils',[],(function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=16,i=4,j=[{pattern:/^5[1-5]/,name:'mc',cscDigits:3,digits:16,supported:true,code:77},{pattern:/^4/,name:'visa',cscDigits:3,digits:16,supported:true,code:86},{pattern:/^3[47]/,name:'amex',cscDigits:4,digits:15,supported:true,code:65},{pattern:/^35(2[8-9]|[3-8])/,name:'jcb',cscDigits:3,digits:16,supported:true,code:74},{pattern:/^62/,name:'cup',cscDigits:3,digits:16,supported:true,code:80},{pattern:/^(6011|65|64[4-9])/,name:'disc',cscDigits:3,digits:16,supported:true,code:68},{pattern:/^30[0-5]/,name:'diners',digits:14,cscDigits:3,supported:false,code:64},{name:'unknown',digits:16,cscDigits:3,supported:false,code:85}],k=function m(n){return n.replace(/[iIl]/g,'1').replace(/[Oo]/g,'0').replace(/[^\d]/gi,'');},l={getCardType:function m(n){n=k(n);n=n.substr(0,6);for(var o=0;o<j.length;o++)if(n.match(j[o].pattern))return j[o];},getCardTypeFromCode:function m(n){for(var o=0;o<j.length;o++)if(n==j[o].code)return j[o];return null;},isValidCCNumber:function m(n){n=k(n);var o=l.getCardType(n);if(o.digits!==n.length)return false;if(!o.supported)return false;return l.isValidLuhn(n);},isValidLuhn:function m(n){n=k(n);var o=n.split('').reverse(),p='';for(var q=0;q<o.length;q++){var r=parseInt(o[q],10);if(q%2!==0)r=r*2;p=p+r;}var s=0;for(q=0;q<p.length;q++)s=s+parseInt(p.charAt(q),10);return !!(s!==0&&s%10===0);},getMaxCardLength:function m(n){return h;},getMaxCSCLength:function m(){return i;}};f.exports=l;}),null); __d('PaymentTokenProxyUtils',['CurrentEnvironment','URI'],(function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={getURI:function i(j){var k=new (c('URI'))('/ajax/payment/token_proxy.php').setDomain(window.location.hostname).setProtocol('https').addQueryData(j),l=k.getDomain().split('.');if(l.indexOf('secure')<0){l.splice(1,0,'secure');if(l[0]=='www')l.shift();k.setDomain(l.join('.'));}if(c('CurrentEnvironment').messengerdotcom){var m=k.getDomain();m=m.replace('messenger.com','facebook.com');k.setDomain(m);}return k;}};f.exports=h;}),null); __d("XShareDialogSubmitController",["XController"],(function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports=c("XController").create("\/share\/dialog\/submit\/",{post_id:{type:"Int"},share_type:{type:"Int"},url:{type:"String"},audience_type:{type:"String"},owner_id:{type:"Int"},app_id:{type:"Int"},message:{type:"String"},shared_ad_id:{type:"Int"},sharer_id:{type:"Int"},source:{type:"String"},composer_session_id:{type:"String"},audience_targets:{type:"IntVector"},ephemeral_ttl_mode:{type:"Int"},tagged_people:{type:"IntVector"},tagged_place:{type:"Int"},tagged_action:{type:"Int"},tagged_object:{type:"Int"},tagged_object_str:{type:"String"},tagged_action_icon:{type:"Int"},tagged_feed_topics:{type:"StringVector"},attribution:{type:"Int"},privacy:{type:"String"},messaging_tags:{type:"StringVector"},internalextra:{type:"StringToStringMap"},internal_preview_image_id:{type:"Int"},share_now:{type:"Bool",defaultValue:false},is_forced_reshare_of_post:{type:"Bool",defaultValue:false},targeted_privacy_data:{type:"HackType"},unpublished_content_type:{type:"Enum",enumType:0},branded_content_repost_root:{type:"Int"},share_to_group_as_page:{type:"Bool",defaultValue:false},shared_to_group_id:{type:"Int"}});}),null);
641.333333
1,521
0.745842
28be01e7f13742d659d8ae73f67529197bea3b4a
3,812
js
JavaScript
apps/homescreen/everything.me/js/helpers/Storage.js
allstarschh/gaia
216ca858b69ec3c090893feb4d2f4b906e38e368
[ "Apache-2.0" ]
1
2016-12-29T05:54:24.000Z
2016-12-29T05:54:24.000Z
apps/homescreen/everything.me/js/helpers/Storage.js
mathroc/gaia
c0d069dc90865aa66c10917a2e383b1f7eac7d2a
[ "Apache-2.0" ]
null
null
null
apps/homescreen/everything.me/js/helpers/Storage.js
mathroc/gaia
c0d069dc90865aa66c10917a2e383b1f7eac7d2a
[ "Apache-2.0" ]
null
null
null
Evme.Storage = new function() { var _this = this, CURRENT_VERSION = "1.3", _valueKey = "_v", _expirationKey = "_e", _versionKey = "_ver", _cache = {}; this.set = function(key, val, ttl) { _this.remove(key, true); if (val === undefined) { return false; } var objToSave = {}; objToSave[_valueKey] = val; if (ttl) { objToSave[_expirationKey] = new Date().getTime() + ttl*1000; } _cache[key] = objToSave; try { localStorage.setItem(key, JSON.stringify(objToSave)); return true; } catch(ex) { err(ex, "save"); return false; } return true; }; this.add = this.set; this.get = function(key) { if (key) { var val = _cache[key]; if (!val) { return null; } if (val[_expirationKey]) { if (new Date().getTime() >= val[_expirationKey]) { _this.remove(key); val = null; } } return val && val[_valueKey]; } else { return _cache; } }; this.remove = function(key, bDontUpdate) { if (!_cache[key]) { return false; } delete _cache[key]; if (!bDontUpdate) { try { localStorage.removeItem(key); } catch(ex) { } } return !bDontUpdate; }; this.enabled = function() { var enabled = false; try { if (!("localStorage" in window) || !window["localStorage"]) { return false; } var key = "__testkey__", val = "__testval__"; localStorage.setItem(key, val); enabled = localStorage.getItem(key) == val; } catch(ex) { enabled = false; } return enabled; }; function populate() { if (_this.enabled()) { var version = null; try { version = localStorage.getItem(_versionKey); } catch(ex) {} if (version == CURRENT_VERSION) { var now = new Date().getTime(); for (var k in localStorage) { var value = localStorage.getItem(k); if (!value) { continue; } try { _cache[k] = JSON.parse(value); if (_cache[k][_expirationKey] && now >= _cache[k][_expirationKey]){ _this.remove(k); } } catch(ex) { _cache[k] = value; } } } else { try { localStorage.clear(); localStorage.setItem(_versionKey, CURRENT_VERSION); } catch(ex) {} } } } function err(ex, method, key, size) { if (typeof ex == "string") { ex = {"message": ex}; } var message = "Storage error (" + method + "): " + ex.message; if (key) { message += ", key: " + key; } if (size) { message += ", size: " + size; } ex.message = message; ("ErrorHandler" in window) && ErrorHandler.add(ex); } populate(); };
26.289655
91
0.379328
28be976b70bb1a7bf45b061529e0822d7fb67a71
5,162
js
JavaScript
src/physics/impact/ImpactSprite.js
VillePisara/phasersandbox
3d1598bab9903ed115586565ab22542df6d5dcb3
[ "MIT" ]
1
2019-04-02T06:33:06.000Z
2019-04-02T06:33:06.000Z
src/physics/impact/ImpactSprite.js
VillePisara/phasersandbox
3d1598bab9903ed115586565ab22542df6d5dcb3
[ "MIT" ]
67
2019-05-06T07:10:42.000Z
2020-06-08T05:57:54.000Z
src/physics/impact/ImpactSprite.js
VillePisara/phasersandbox
3d1598bab9903ed115586565ab22542df6d5dcb3
[ "MIT" ]
null
null
null
/** * @author Richard Davey <rich@photonstorm.com> * @copyright 2019 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ var Class = require('../../utils/Class'); var Components = require('./components'); var Sprite = require('../../gameobjects/sprite/Sprite'); /** * @classdesc * An Impact Physics Sprite Game Object. * * A Sprite Game Object is used for the display of both static and animated images in your game. * Sprites can have input events and physics bodies. They can also be tweened, tinted, scrolled * and animated. * * The main difference between a Sprite and an Image Game Object is that you cannot animate Images. * As such, Sprites take a fraction longer to process and have a larger API footprint due to the Animation * Component. If you do not require animation then you can safely use Images to replace Sprites in all cases. * * @class ImpactSprite * @extends Phaser.GameObjects.Sprite * @memberof Phaser.Physics.Impact * @constructor * @since 3.0.0 * * @extends Phaser.Physics.Impact.Components.Acceleration * @extends Phaser.Physics.Impact.Components.BodyScale * @extends Phaser.Physics.Impact.Components.BodyType * @extends Phaser.Physics.Impact.Components.Bounce * @extends Phaser.Physics.Impact.Components.CheckAgainst * @extends Phaser.Physics.Impact.Components.Collides * @extends Phaser.Physics.Impact.Components.Debug * @extends Phaser.Physics.Impact.Components.Friction * @extends Phaser.Physics.Impact.Components.Gravity * @extends Phaser.Physics.Impact.Components.Offset * @extends Phaser.Physics.Impact.Components.SetGameObject * @extends Phaser.Physics.Impact.Components.Velocity * @extends Phaser.GameObjects.Components.Alpha * @extends Phaser.GameObjects.Components.BlendMode * @extends Phaser.GameObjects.Components.Depth * @extends Phaser.GameObjects.Components.Flip * @extends Phaser.GameObjects.Components.GetBounds * @extends Phaser.GameObjects.Components.Origin * @extends Phaser.GameObjects.Components.Pipeline * @extends Phaser.GameObjects.Components.ScrollFactor * @extends Phaser.GameObjects.Components.Size * @extends Phaser.GameObjects.Components.Texture * @extends Phaser.GameObjects.Components.Tint * @extends Phaser.GameObjects.Components.Transform * @extends Phaser.GameObjects.Components.Visible * * @param {Phaser.Physics.Impact.World} world - [description] * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var ImpactSprite = new Class({ Extends: Sprite, Mixins: [ Components.Acceleration, Components.BodyScale, Components.BodyType, Components.Bounce, Components.CheckAgainst, Components.Collides, Components.Debug, Components.Friction, Components.Gravity, Components.Offset, Components.SetGameObject, Components.Velocity ], initialize: function ImpactSprite (world, x, y, texture, frame) { Sprite.call(this, world.scene, x, y, texture, frame); /** * [description] * * @name Phaser.Physics.Impact.ImpactSprite#body * @type {Phaser.Physics.Impact.Body} * @since 3.0.0 */ this.body = world.create(x - this.frame.centerX, y - this.frame.centerY, this.width, this.height); this.body.parent = this; this.body.gameObject = this; /** * [description] * * @name Phaser.Physics.Impact.ImpactSprite#size * @type {{x: number, y: number}} * @since 3.0.0 */ this.size = this.body.size; /** * [description] * * @name Phaser.Physics.Impact.ImpactSprite#offset * @type {{x: number, y: number}} * @since 3.0.0 */ this.offset = this.body.offset; /** * [description] * * @name Phaser.Physics.Impact.ImpactSprite#vel * @type {{x: number, y: number}} * @since 3.0.0 */ this.vel = this.body.vel; /** * [description] * * @name Phaser.Physics.Impact.ImpactSprite#accel * @type {{x: number, y: number}} * @since 3.0.0 */ this.accel = this.body.accel; /** * [description] * * @name Phaser.Physics.Impact.ImpactSprite#friction * @type {{x: number, y: number}} * @since 3.0.0 */ this.friction = this.body.friction; /** * [description] * * @name Phaser.Physics.Impact.ImpactSprite#maxVel * @type {{x: number, y: number}} * @since 3.0.0 */ this.maxVel = this.body.maxVel; } }); module.exports = ImpactSprite;
33.089744
127
0.648586
28beb75a4c040e4608adaa07f56ed687432b1198
918
js
JavaScript
projectBM/api/router/sells_goods.js
hehesha/zhierBM
8788d2257bddb04e1de18dca1992cff35063322b
[ "MIT" ]
null
null
null
projectBM/api/router/sells_goods.js
hehesha/zhierBM
8788d2257bddb04e1de18dca1992cff35063322b
[ "MIT" ]
null
null
null
projectBM/api/router/sells_goods.js
hehesha/zhierBM
8788d2257bddb04e1de18dca1992cff35063322b
[ "MIT" ]
null
null
null
var db = require('../db/db') module.exports = { sells:function(app){ app.post('/sell',function(req,res){ console.log(req.body); db.insert(`insert into sells_goods(goods_trademark,goods_pto,type,availability,default_price) values('${req.body.goods_trademark}','${req.body.goods_pto}','${req.body.type}',0,1000)`,function(result){ res.send(result) }) }) app.get('/getsell',function(req,res){ console.log(req.query) db.select(`select * from sells_goods`,function(result){ res.send(result) }) }) app.post('/delete_sell',function(req,res){ console.log(req.body) var id = req.body.id; db.delete(`delete from sells_goods where id ='${id}' `,function(result){ res.send(result) }) }) } }
31.655172
118
0.528322
28bf5320bff413a486dd49af1d58eee4b43d77e9
1,137
js
JavaScript
src/test/backend/indexeddb/BinaryCodec.js
bt/jungle-db
fd6f1e6b9f60175d95ee26aee3669caedf1e9bb4
[ "Apache-2.0" ]
30
2017-08-10T07:56:20.000Z
2019-04-27T13:08:22.000Z
src/test/backend/indexeddb/BinaryCodec.js
bt/jungle-db
fd6f1e6b9f60175d95ee26aee3669caedf1e9bb4
[ "Apache-2.0" ]
27
2019-10-29T23:15:21.000Z
2022-03-27T17:23:51.000Z
src/test/backend/indexeddb/BinaryCodec.js
bt/jungle-db
fd6f1e6b9f60175d95ee26aee3669caedf1e9bb4
[ "Apache-2.0" ]
11
2017-08-08T14:33:25.000Z
2018-06-26T22:10:41.000Z
/** * @implements {ICodec} */ class BinaryCodec { static get instance() { if (!BinaryCodec._instance) { BinaryCodec._instance = new BinaryCodec(); } return BinaryCodec._instance; } /** * Encodes an object before storing it in the database. * @param {*} obj The object to encode before storing it. * @returns {*} Encoded object. */ encode(obj) { return obj; } /** * Decodes an object before returning it to the user. * @param {*} obj The object to decode. * @param {string} key The object's primary key. * @returns {*} Decoded object. */ decode(obj, key) { return obj; } /** * A value encoding used for the nodeJS implementation and ignored for the indexedDB. * For example, JungleDB.JSON_ENCODING provides a slightly modified JSON encoding supporting UInt8Arrays and Sets. * @type {{encode: function(val:*):*, decode: function(val:*):*, buffer: boolean, type: string}|void} */ get valueEncoding() { return JungleDB.JSON_ENCODING; } } Class.register(BinaryCodec);
27.731707
118
0.60686
28bf7d437d15b2c42c6d0367e19ae5b074898e0f
732
js
JavaScript
public/js/libs/jquery-ui-1.9.2/development-bundle/ui/minified/jquery.ui.effect-clip.min.js
thienkimlove/fruit
121739881c7b09af7dc3aed5c03406a2d4f9474a
[ "MIT" ]
null
null
null
public/js/libs/jquery-ui-1.9.2/development-bundle/ui/minified/jquery.ui.effect-clip.min.js
thienkimlove/fruit
121739881c7b09af7dc3aed5c03406a2d4f9474a
[ "MIT" ]
null
null
null
public/js/libs/jquery-ui-1.9.2/development-bundle/ui/minified/jquery.ui.effect-clip.min.js
thienkimlove/fruit
121739881c7b09af7dc3aed5c03406a2d4f9474a
[ "MIT" ]
null
null
null
/*! jQuery UI - v1.9.2 - 2015-06-14 * http://jqueryui.com * Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */ (function(t){t.effects.effect.clip=function(e,i){var s,n,o,r=t(this),a=["position","top","bottom","left","right","height","width"],h=t.effects.setMode(r,e.mode||"hide"),l="show"===h,c=e.direction||"vertical",d="vertical"===c,p=d?"height":"width",u=d?"top":"left",f={};t.effects.save(r,a),r.show(),s=t.effects.createWrapper(r).css({overflow:"hidden"}),n="IMG"===r[0].tagName?s:r,o=n[p](),l&&(n.css(p,0),n.css(u,o/2)),f[p]=l?o:0,f[u]=l?0:o/2,n.animate(f,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){l||r.hide(),t.effects.restore(r,a),t.effects.removeWrapper(r),i()}})}})(jQuery);
146.4
598
0.657104
28c098c94a5431c64ef76b6e55a7daad79578e29
7,167
js
JavaScript
sapui5-sdk-1.74.0/resources/sap/ui/vk/threejs/PerspectiveCamera-dbg.js
juanfelipe82193/opensap
568c01843a07b8a1be88f8fb8ccb49845fb8110e
[ "Apache-2.0" ]
null
null
null
sapui5-sdk-1.74.0/resources/sap/ui/vk/threejs/PerspectiveCamera-dbg.js
juanfelipe82193/opensap
568c01843a07b8a1be88f8fb8ccb49845fb8110e
[ "Apache-2.0" ]
null
null
null
sapui5-sdk-1.74.0/resources/sap/ui/vk/threejs/PerspectiveCamera-dbg.js
juanfelipe82193/opensap
568c01843a07b8a1be88f8fb8ccb49845fb8110e
[ "Apache-2.0" ]
null
null
null
/*! * SAP UI development toolkit for HTML5 (SAPUI5) (c) Copyright 2009-2015 SAP SE. All rights reserved */ // Provides the PerspectiveCamera class. sap.ui.define([ "../PerspectiveCamera", "./thirdparty/three" ], function( PerspectiveCamera, threeJs ) { "use strict"; /** * Constructor for a new PerspectiveCamera. * * * @class Provides the interface for the camera. * * * @public * @author SAP SE * @version 1.74.0 * @extends sap.ui.vk.PerspectiveCamera * @alias sap.ui.vk.threejs.PerspectiveCamera * @since 1.52.0 */ var ThreeJsPerspectiveCamera = PerspectiveCamera.extend("sap.ui.vk.threejs.PerspectiveCamera", /** @lends sap.ui.vk.three.PerspectiveCamera.prototype */ { metadata: { } }); var basePrototype = PerspectiveCamera.getMetadata().getParent().getClass().prototype; ThreeJsPerspectiveCamera.prototype.init = function() { if (basePrototype.init) { basePrototype.init.call(this); } var near = 1; var far = 10000; this._nativeCamera = new THREE.PerspectiveCamera(30, 1, near, far); this._nativeCamera.position.set(0, 0, 100); this.setUsingDefaultClipPlanes(true); }; /** * Updates the camera properties with width and height of viewport * * @param {float} width width of the viewport * @param {float} height height of the viewport * @public */ ThreeJsPerspectiveCamera.prototype.update = function(width, height) { var oldAspect = this._nativeCamera.aspect; var oldZoom = this._nativeCamera.zoom; this._nativeCamera.aspect = width / height; this._nativeCamera.zoom = Math.min(this._nativeCamera.aspect, 1); // we need to use three.js camera zoom when width is less than height var view = this._nativeCamera.view; if (view && view.enabled) { // Redline mode is activated var sw = width / view.fullWidth; var sh = height / view.fullHeight; var sy = this._nativeCamera.zoom / oldZoom; var sx = sy * oldAspect / this._nativeCamera.aspect; // when you modify the projection matrix you can simply multiply the matrix offset elements (8, 9) by (sx, sy) respectively, // but when you use three.js view offsetX, offsetY you have to recalculate them using a complex formula: // matProj[8] = (2 * view.offsetX + view.width - view.fullHeight) / view.width // matProj[9] = -(2 * view.offsetY + view.height - view.fullHeight) / view.height // view.offsetX = ( matProj[8] * view.width - view.width + view.fullWidth) / 2 // view.offsetY = (-matProj[9] * view.height - view.height + view.fullHeight) / 2 view.offsetX = (view.offsetX * sx + (view.fullWidth - view.width) * (1 - sx) * 0.5) * sw; view.offsetY = (view.offsetY * sy + (view.fullHeight - view.height) * (1 - sy) * 0.5) * sh; view.width *= sw; // scaled width of the viewport, depends on the zoom of the viewport (not the three.js camera zoom) view.height *= sh; // scaled height of the viewport, depends on the zoom of the viewport (not the three.js camera zoom) view.fullWidth = width; // width of the viewport view.fullHeight = height; // height of the viewport // recalculate the view offset from the projection matrix offset // var matProj = this._nativeCamera.projectionMatrix.elements; // view.offsetX = ( matProj[8] * sx * view.width - view.width + view.fullWidth) * 0.5; // view.offsetY = (-matProj[9] * sy * view.height - view.height + view.fullHeight) * 0.5; } this._nativeCamera.updateProjectionMatrix(); }; ThreeJsPerspectiveCamera.prototype.exit = function() { if (basePrototype.exit) { basePrototype.exit.call(this); } this._nativeCamera = null; }; ThreeJsPerspectiveCamera.prototype.getFov = function() { return this._nativeCamera.fov; }; ThreeJsPerspectiveCamera.prototype.setFov = function(val) { this._nativeCamera.fov = val; this._nativeCamera.updateProjectionMatrix(); this.setIsModified(true); return this; }; // base class - camera properties.. ThreeJsPerspectiveCamera.prototype.getCameraRef = function() { return this._nativeCamera; }; ThreeJsPerspectiveCamera.prototype.setCameraRef = function(camRef) { this._nativeCamera = camRef; return this; }; ThreeJsPerspectiveCamera.prototype.getNearClipPlane = function() { return this._nativeCamera.near; }; ThreeJsPerspectiveCamera.prototype.setNearClipPlane = function(val) { this._nativeCamera.near = val; this.setUsingDefaultClipPlanes(false); this._nativeCamera.updateProjectionMatrix(); this.setIsModified(true); return this; }; ThreeJsPerspectiveCamera.prototype.getFarClipPlane = function() { return this._nativeCamera.far; }; ThreeJsPerspectiveCamera.prototype.setFarClipPlane = function(val) { this._nativeCamera.far = val; this.setUsingDefaultClipPlanes(false); this._nativeCamera.updateProjectionMatrix(); this.setIsModified(true); return this; }; ThreeJsPerspectiveCamera.prototype.getPosition = function() { return this._nativeCamera.position.toArray(); }; ThreeJsPerspectiveCamera.prototype.setPosition = function(vals) { this._nativeCamera.position.fromArray(vals); this._nativeCamera.updateMatrixWorld(); return this; }; ThreeJsPerspectiveCamera.prototype.getUpDirection = function() { return this._nativeCamera.up.toArray(); }; ThreeJsPerspectiveCamera.prototype.setUpDirection = function(vals) { this._nativeCamera.up.fromArray(vals); this._nativeCamera.updateMatrixWorld(); return this; }; ThreeJsPerspectiveCamera.prototype.getTargetDirection = function() { return this._nativeCamera.getWorldDirection().toArray(); }; ThreeJsPerspectiveCamera.prototype.setTargetDirection = function(vals) { var target = new THREE.Vector3().fromArray(vals); target.add(this._nativeCamera.position); this._nativeCamera.lookAt(target); return this; }; ThreeJsPerspectiveCamera.prototype.setUsingDefaultClipPlanes = function(val) { this._nativeCamera.userData.usingDefaultClipPlanes = val; return this; }; ThreeJsPerspectiveCamera.prototype.getUsingDefaultClipPlanes = function() { return this._nativeCamera.userData.usingDefaultClipPlanes; }; /** * Adjust the camera near and far clipping planes to include the entire specified bounding box * * @param {THREE.Box3} boundingBox Bounding box * @returns {sap.ui.vk.threejs.PerspectiveCamera} this * @public */ ThreeJsPerspectiveCamera.prototype.adjustClipPlanes = function(boundingBox) { var camera = this._nativeCamera; camera.updateMatrixWorld(); boundingBox = boundingBox.clone().applyMatrix4(camera.matrixWorldInverse); camera.near = -boundingBox.max.z; camera.far = -boundingBox.min.z; var epsilon = Math.max((camera.far - camera.near) * 0.0025, 0.001); camera.far = Math.max(camera.far, 0.1); epsilon = Math.max(epsilon, camera.far * 0.0025); camera.near -= epsilon; camera.far += epsilon; camera.near = Math.max(camera.near, camera.far * 0.0025); var c = -(camera.far + camera.near) / (camera.far - camera.near); var d = -2 * camera.far * camera.near / (camera.far - camera.near); camera.projectionMatrix.elements[ 10 ] = c; camera.projectionMatrix.elements[ 14 ] = d; return this; }; return ThreeJsPerspectiveCamera; });
31.995536
155
0.722059
28c0dd87a8a232b1539e3e97338c88faa791b99a
1,454
js
JavaScript
src/rules/drone/__tests__/skipRelease.test.js
sogame/danger-plugin-toolbox
213a96d36c63ac52b08dff4f2222313d422fe71c
[ "MIT" ]
18
2018-10-22T20:58:47.000Z
2021-12-14T07:39:44.000Z
src/rules/drone/__tests__/skipRelease.test.js
sogame/danger-plugin-toolbox
213a96d36c63ac52b08dff4f2222313d422fe71c
[ "MIT" ]
492
2018-10-20T19:14:04.000Z
2022-03-28T08:06:45.000Z
src/rules/drone/__tests__/skipRelease.test.js
sogame/danger-plugin-toolbox
213a96d36c63ac52b08dff4f2222313d422fe71c
[ "MIT" ]
1
2020-09-22T16:46:41.000Z
2020-09-22T16:46:41.000Z
import * as helpers from '../../helpers'; import droneSkipRelease from '../skipRelease'; const errorMsg = 'A new version will not be created, as `[skip release]` is part of all commit messages.'; const mockCommits = (messages) => { helpers.commits = messages.map((message) => ({ message })); }; const skipReleaseMsg = '[skip release]'; describe('droneSkipRelease', () => { beforeEach(() => { global.warn = jest.fn(); global.fail = jest.fn(); jest.resetAllMocks(); }); it('should not warn when no commit skips release', () => { const messages = ['Commit message']; mockCommits(messages); droneSkipRelease(); expect(global.warn).not.toHaveBeenCalled(); }); it('should not warn when not all commits skips release', () => { const messages = ['Commit message 1', skipReleaseMsg]; mockCommits(messages); droneSkipRelease(); expect(global.warn).not.toHaveBeenCalled(); }); it('should warn when all commits skips release', () => { const messages = [skipReleaseMsg, skipReleaseMsg]; mockCommits(messages); droneSkipRelease(); expect(global.warn).toHaveBeenCalledWith(errorMsg); }); it('should log as "logType" when is provided', () => { const messages = [skipReleaseMsg, skipReleaseMsg]; mockCommits(messages); droneSkipRelease({ logType: 'fail' }); expect(global.warn).not.toHaveBeenCalled(); expect(global.fail).toHaveBeenCalled(); }); });
25.068966
91
0.655433
28c100935339b321cc80be2b4156201c62758070
1,069
js
JavaScript
stream-adventure/10_html_stream.js
claudiopro/nodeschool-solutions
5c1eaa2dcd2c4bd72845ccb08b5c7979be82ea3c
[ "MIT" ]
null
null
null
stream-adventure/10_html_stream.js
claudiopro/nodeschool-solutions
5c1eaa2dcd2c4bd72845ccb08b5c7979be82ea3c
[ "MIT" ]
null
null
null
stream-adventure/10_html_stream.js
claudiopro/nodeschool-solutions
5c1eaa2dcd2c4bd72845ccb08b5c7979be82ea3c
[ "MIT" ]
2
2019-01-13T10:10:43.000Z
2019-08-25T17:36:36.000Z
/* Your program will get some html written to stdin. Convert all the inner html to upper-case for elements with a class name of "loud". You can use `trumpet` and `through` to solve this adventure. With `trumpet` you can create a transform stream from a css selector: var trumpet = require('trumpet'); var fs = require('fs'); var tr = trumpet(); fs.createReadStream('input.html').pipe(tr); var stream = tr.select('.beep').createStream(); Now `stream` outputs all the inner html content at `'.beep'` and the data you write to `stream` will appear as the new inner html content. Make sure to `npm install trumpet through` in the directory where your solution file lives. To verify your program, run: `stream-adventure verify program.js`. */ var trumpet = require('trumpet'), through = require('through') var tr = trumpet() tr.selectAll('.loud', function(elem){ var stream = elem.createStream() stream.pipe(through(function(buf){ this.queue(buf.toString().toUpperCase()) })).pipe(stream) }) process.stdin.pipe(tr).pipe(process.stdout)
30.542857
79
0.714687